mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 08:18:11 +08:00
Make checkboxes not use interior mutability (#2976)
* Make checkboxes not use interior mutability * Use copy instead of cloning * Fix --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
export let minWidth = 0;
|
||||
export let multiline = false;
|
||||
export let tooltip: string | undefined = undefined;
|
||||
export let checkboxId: bigint | undefined = undefined;
|
||||
export let forCheckbox: bigint | undefined = undefined;
|
||||
|
||||
$: extraClasses = Object.entries(classes)
|
||||
.flatMap(([className, stateName]) => (stateName ? [className] : []))
|
||||
@@ -34,7 +34,7 @@
|
||||
style:min-width={minWidth > 0 ? `${minWidth}px` : undefined}
|
||||
style={`${styleName} ${extraStyles}`.trim() || undefined}
|
||||
title={tooltip}
|
||||
for={checkboxId !== undefined ? `checkbox-input-${checkboxId}` : undefined}
|
||||
for={forCheckbox !== undefined ? `checkbox-input-${forCheckbox}` : undefined}
|
||||
>
|
||||
<slot />
|
||||
</label>
|
||||
|
||||
@@ -1348,7 +1348,7 @@ export class TextLabel extends WidgetProps {
|
||||
@Transform(({ value }: { value: string }) => value || undefined)
|
||||
tooltip!: string | undefined;
|
||||
|
||||
checkboxId!: bigint | undefined;
|
||||
forCheckbox!: bigint | undefined;
|
||||
}
|
||||
|
||||
export type ReferencePoint = "None" | "TopLeft" | "TopCenter" | "TopRight" | "CenterLeft" | "Center" | "CenterRight" | "BottomLeft" | "BottomCenter" | "BottomRight";
|
||||
|
||||
Reference in New Issue
Block a user