bits-ui 2.10.0 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bits/accordion/accordion.svelte.d.ts +9 -7
- package/dist/bits/accordion/accordion.svelte.js +36 -13
- package/dist/bits/accordion/components/accordion-content.svelte +15 -7
- package/dist/bits/accordion/components/accordion-header.svelte +4 -4
- package/dist/bits/accordion/components/accordion-item.svelte +5 -5
- package/dist/bits/accordion/components/accordion-trigger.svelte +4 -4
- package/dist/bits/accordion/components/accordion.svelte +7 -7
- package/dist/bits/accordion/components/accordion.svelte.d.ts +1 -1
- package/dist/bits/accordion/types.d.ts +17 -8
- package/dist/bits/alert-dialog/components/alert-dialog-action.svelte +3 -3
- package/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte +4 -4
- package/dist/bits/alert-dialog/components/alert-dialog-content.svelte +3 -3
- package/dist/bits/alert-dialog/components/alert-dialog.svelte +4 -4
- package/dist/bits/aspect-ratio/components/aspect-ratio.svelte +4 -4
- package/dist/bits/avatar/components/avatar-fallback.svelte +3 -3
- package/dist/bits/avatar/components/avatar-image.svelte +6 -6
- package/dist/bits/avatar/components/avatar.svelte +5 -5
- package/dist/bits/calendar/calendar.svelte.js +30 -30
- package/dist/bits/calendar/components/calendar-cell.svelte +5 -5
- package/dist/bits/calendar/components/calendar-day.svelte +3 -3
- package/dist/bits/calendar/components/calendar-grid-body.svelte +3 -3
- package/dist/bits/calendar/components/calendar-grid-head.svelte +3 -3
- package/dist/bits/calendar/components/calendar-grid-row.svelte +3 -3
- package/dist/bits/calendar/components/calendar-grid.svelte +3 -3
- package/dist/bits/calendar/components/calendar-head-cell.svelte +3 -3
- package/dist/bits/calendar/components/calendar-header.svelte +3 -3
- package/dist/bits/calendar/components/calendar-heading.svelte +3 -3
- package/dist/bits/calendar/components/calendar-month-select.svelte +6 -6
- package/dist/bits/calendar/components/calendar-next-button.svelte +3 -3
- package/dist/bits/calendar/components/calendar-prev-button.svelte +3 -3
- package/dist/bits/calendar/components/calendar-year-select.svelte +6 -6
- package/dist/bits/calendar/components/calendar.svelte +24 -24
- package/dist/bits/calendar/components/calendar.svelte.d.ts +1 -1
- package/dist/bits/checkbox/checkbox.svelte.d.ts +1 -1
- package/dist/bits/checkbox/checkbox.svelte.js +7 -7
- package/dist/bits/checkbox/components/checkbox-group-label.svelte +3 -3
- package/dist/bits/checkbox/components/checkbox-group.svelte +9 -9
- package/dist/bits/checkbox/components/checkbox-group.svelte.d.ts +1 -1
- package/dist/bits/checkbox/components/checkbox.svelte +11 -11
- package/dist/bits/checkbox/components/checkbox.svelte.d.ts +1 -1
- package/dist/bits/collapsible/collapsible.svelte.d.ts +2 -0
- package/dist/bits/collapsible/collapsible.svelte.js +31 -8
- package/dist/bits/collapsible/components/collapsible-content.svelte +15 -7
- package/dist/bits/collapsible/components/collapsible-trigger.svelte +4 -4
- package/dist/bits/collapsible/components/collapsible.svelte +6 -6
- package/dist/bits/collapsible/types.d.ts +12 -3
- package/dist/bits/combobox/components/combobox-input.svelte +4 -4
- package/dist/bits/combobox/components/combobox-trigger.svelte +3 -3
- package/dist/bits/combobox/components/combobox.svelte +12 -12
- package/dist/bits/command/command.svelte.js +6 -6
- package/dist/bits/command/components/_command-label.svelte +3 -3
- package/dist/bits/command/components/command-empty.svelte +4 -4
- package/dist/bits/command/components/command-group-heading.svelte +3 -3
- package/dist/bits/command/components/command-group-items.svelte +3 -3
- package/dist/bits/command/components/command-group.svelte +5 -5
- package/dist/bits/command/components/command-input.svelte +5 -5
- package/dist/bits/command/components/command-input.svelte.d.ts +1 -1
- package/dist/bits/command/components/command-item.svelte +8 -8
- package/dist/bits/command/components/command-link-item.svelte +8 -8
- package/dist/bits/command/components/command-list.svelte +4 -4
- package/dist/bits/command/components/command-loading.svelte +4 -4
- package/dist/bits/command/components/command-separator.svelte +4 -4
- package/dist/bits/command/components/command-viewport.svelte +3 -3
- package/dist/bits/command/components/command.svelte +12 -12
- package/dist/bits/command/components/command.svelte.d.ts +1 -1
- package/dist/bits/context-menu/components/context-menu-content-static.svelte +5 -5
- package/dist/bits/context-menu/components/context-menu-content.svelte +5 -5
- package/dist/bits/context-menu/components/context-menu-trigger.svelte +12 -5
- package/dist/bits/context-menu/components/context-menu.svelte +5 -5
- package/dist/bits/date-field/components/date-field-input.svelte +4 -4
- package/dist/bits/date-field/components/date-field-label.svelte +3 -3
- package/dist/bits/date-field/components/date-field-segment.svelte +3 -3
- package/dist/bits/date-field/components/date-field.svelte +16 -16
- package/dist/bits/date-field/date-field.svelte.js +17 -17
- package/dist/bits/date-picker/components/date-picker-calendar.svelte +5 -5
- package/dist/bits/date-picker/components/date-picker.svelte +32 -32
- package/dist/bits/date-range-field/components/date-range-field-input.svelte +4 -4
- package/dist/bits/date-range-field/components/date-range-field-label.svelte +3 -3
- package/dist/bits/date-range-field/components/date-range-field.svelte +19 -19
- package/dist/bits/date-range-field/components/date-range-field.svelte.d.ts +1 -1
- package/dist/bits/date-range-field/date-range-field.svelte.js +9 -9
- package/dist/bits/date-range-picker/components/date-range-picker-calendar.svelte +3 -3
- package/dist/bits/date-range-picker/components/date-range-picker.svelte +37 -37
- package/dist/bits/date-range-picker/components/date-range-picker.svelte.d.ts +1 -1
- package/dist/bits/dialog/components/dialog-close.svelte +5 -5
- package/dist/bits/dialog/components/dialog-content.svelte +3 -3
- package/dist/bits/dialog/components/dialog-description.svelte +3 -3
- package/dist/bits/dialog/components/dialog-overlay.svelte +3 -3
- package/dist/bits/dialog/components/dialog-title.svelte +4 -4
- package/dist/bits/dialog/components/dialog-trigger.svelte +4 -4
- package/dist/bits/dialog/components/dialog.svelte +4 -4
- package/dist/bits/dialog/dialog.svelte.d.ts +1 -1
- package/dist/bits/dialog/dialog.svelte.js +4 -4
- package/dist/bits/dropdown-menu/components/dropdown-menu-content-static.svelte +5 -5
- package/dist/bits/dropdown-menu/components/dropdown-menu-content.svelte +5 -5
- package/dist/bits/label/components/label.svelte +3 -3
- package/dist/bits/link-preview/components/link-preview-content-static.svelte +5 -5
- package/dist/bits/link-preview/components/link-preview-content.svelte +5 -5
- package/dist/bits/link-preview/components/link-preview-trigger.svelte +3 -3
- package/dist/bits/link-preview/components/link-preview.svelte +6 -6
- package/dist/bits/link-preview/link-preview.svelte.js +4 -4
- package/dist/bits/menu/components/menu-checkbox-group.svelte +5 -5
- package/dist/bits/menu/components/menu-checkbox-group.svelte.d.ts +1 -1
- package/dist/bits/menu/components/menu-checkbox-item.svelte +9 -9
- package/dist/bits/menu/components/menu-checkbox-item.svelte.d.ts +1 -1
- package/dist/bits/menu/components/menu-content-static.svelte +5 -5
- package/dist/bits/menu/components/menu-content.svelte +5 -5
- package/dist/bits/menu/components/menu-group-heading.svelte +3 -3
- package/dist/bits/menu/components/menu-group.svelte +3 -3
- package/dist/bits/menu/components/menu-item.svelte +6 -6
- package/dist/bits/menu/components/menu-radio-group.svelte +4 -4
- package/dist/bits/menu/components/menu-radio-group.svelte.d.ts +1 -1
- package/dist/bits/menu/components/menu-radio-item.svelte +7 -7
- package/dist/bits/menu/components/menu-separator.svelte +3 -3
- package/dist/bits/menu/components/menu-sub-content-static.svelte +5 -5
- package/dist/bits/menu/components/menu-sub-content.svelte +5 -5
- package/dist/bits/menu/components/menu-sub-trigger.svelte +5 -5
- package/dist/bits/menu/components/menu-sub.svelte +3 -3
- package/dist/bits/menu/components/menu-trigger.svelte +4 -4
- package/dist/bits/menu/components/menu.svelte +5 -5
- package/dist/bits/menu/menu.svelte.d.ts +1 -1
- package/dist/bits/menu/menu.svelte.js +24 -14
- package/dist/bits/menubar/components/menubar-content-static.svelte +8 -8
- package/dist/bits/menubar/components/menubar-content.svelte +8 -8
- package/dist/bits/menubar/components/menubar-menu.svelte +3 -3
- package/dist/bits/menubar/components/menubar-trigger.svelte +4 -4
- package/dist/bits/menubar/components/menubar.svelte +6 -6
- package/dist/bits/menubar/menubar.svelte.js +5 -5
- package/dist/bits/meter/components/meter.svelte +6 -6
- package/dist/bits/navigation-menu/components/navigation-menu-content-impl.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu-content.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu-indicator-impl.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu-indicator.svelte +2 -2
- package/dist/bits/navigation-menu/components/navigation-menu-item.svelte +5 -5
- package/dist/bits/navigation-menu/components/navigation-menu-link.svelte +5 -5
- package/dist/bits/navigation-menu/components/navigation-menu-list.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu-sub.svelte +5 -5
- package/dist/bits/navigation-menu/components/navigation-menu-sub.svelte.d.ts +1 -1
- package/dist/bits/navigation-menu/components/navigation-menu-trigger.svelte +4 -4
- package/dist/bits/navigation-menu/components/navigation-menu-viewport.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu.svelte +8 -8
- package/dist/bits/navigation-menu/components/navigation-menu.svelte.d.ts +1 -1
- package/dist/bits/navigation-menu/navigation-menu.svelte.d.ts +6 -6
- package/dist/bits/navigation-menu/navigation-menu.svelte.js +23 -23
- package/dist/bits/pagination/components/pagination-next-button.svelte +4 -4
- package/dist/bits/pagination/components/pagination-page.svelte +5 -5
- package/dist/bits/pagination/components/pagination-prev-button.svelte +4 -4
- package/dist/bits/pagination/components/pagination.svelte +9 -9
- package/dist/bits/pagination/pagination.svelte.d.ts +1 -1
- package/dist/bits/pagination/pagination.svelte.js +2 -2
- package/dist/bits/pin-input/components/pin-input-cell.svelte +4 -4
- package/dist/bits/pin-input/components/pin-input.svelte +14 -14
- package/dist/bits/pin-input/components/pin-input.svelte.d.ts +1 -1
- package/dist/bits/pin-input/pin-input.svelte.d.ts +2 -2
- package/dist/bits/pin-input/pin-input.svelte.js +5 -5
- package/dist/bits/popover/components/popover-close.svelte +3 -3
- package/dist/bits/popover/components/popover-content-static.svelte +6 -6
- package/dist/bits/popover/components/popover-content.svelte +6 -6
- package/dist/bits/popover/components/popover-trigger.svelte +4 -4
- package/dist/bits/popover/components/popover.svelte +3 -3
- package/dist/bits/popover/popover.svelte.js +4 -4
- package/dist/bits/progress/components/progress.svelte +6 -6
- package/dist/bits/radio-group/components/radio-group-item.svelte +5 -5
- package/dist/bits/radio-group/components/radio-group.svelte +10 -10
- package/dist/bits/radio-group/components/radio-group.svelte.d.ts +1 -1
- package/dist/bits/radio-group/radio-group.svelte.js +7 -7
- package/dist/bits/range-calendar/components/range-calendar-cell.svelte +5 -5
- package/dist/bits/range-calendar/components/range-calendar-day.svelte +3 -3
- package/dist/bits/range-calendar/components/range-calendar.svelte +26 -26
- package/dist/bits/range-calendar/components/range-calendar.svelte.d.ts +1 -1
- package/dist/bits/range-calendar/range-calendar.svelte.js +7 -7
- package/dist/bits/rating-group/components/rating-group-item.svelte +5 -5
- package/dist/bits/rating-group/components/rating-group.svelte +14 -14
- package/dist/bits/rating-group/components/rating-group.svelte.d.ts +1 -1
- package/dist/bits/rating-group/rating-group.svelte.js +4 -4
- package/dist/bits/scroll-area/components/scroll-area-corner-impl.svelte +3 -3
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-x.svelte +2 -2
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-y.svelte +2 -2
- package/dist/bits/scroll-area/components/scroll-area-scrollbar.svelte +4 -4
- package/dist/bits/scroll-area/components/scroll-area-thumb-impl.svelte +4 -4
- package/dist/bits/scroll-area/components/scroll-area-viewport.svelte +3 -3
- package/dist/bits/scroll-area/components/scroll-area.svelte +6 -6
- package/dist/bits/scroll-area/scroll-area.svelte.d.ts +2 -2
- package/dist/bits/scroll-area/scroll-area.svelte.js +6 -7
- package/dist/bits/select/components/select-content-static.svelte +5 -5
- package/dist/bits/select/components/select-content.svelte +5 -5
- package/dist/bits/select/components/select-group-heading.svelte +3 -3
- package/dist/bits/select/components/select-group.svelte +3 -3
- package/dist/bits/select/components/select-hidden-input.svelte +2 -2
- package/dist/bits/select/components/select-item.svelte +8 -8
- package/dist/bits/select/components/select-scroll-down-button.svelte +4 -4
- package/dist/bits/select/components/select-scroll-up-button.svelte +4 -4
- package/dist/bits/select/components/select-trigger.svelte +3 -3
- package/dist/bits/select/components/select-viewport.svelte +3 -3
- package/dist/bits/select/components/select.svelte +12 -12
- package/dist/bits/select/select.svelte.js +12 -12
- package/dist/bits/separator/components/separator.svelte +5 -5
- package/dist/bits/separator/separator.svelte.d.ts +2 -2
- package/dist/bits/separator/separator.svelte.js +4 -4
- package/dist/bits/slider/components/slider-range.svelte +3 -3
- package/dist/bits/slider/components/slider-thumb-label.svelte +5 -5
- package/dist/bits/slider/components/slider-thumb.svelte +5 -5
- package/dist/bits/slider/components/slider-tick-label.svelte +5 -5
- package/dist/bits/slider/components/slider-tick.svelte +4 -4
- package/dist/bits/slider/components/slider.svelte +14 -14
- package/dist/bits/slider/components/slider.svelte.d.ts +1 -1
- package/dist/bits/slider/slider.svelte.d.ts +16 -16
- package/dist/bits/slider/slider.svelte.js +20 -20
- package/dist/bits/switch/components/switch-thumb.svelte +3 -3
- package/dist/bits/switch/components/switch.svelte +8 -8
- package/dist/bits/switch/components/switch.svelte.d.ts +1 -1
- package/dist/bits/switch/switch.svelte.js +5 -5
- package/dist/bits/tabs/components/tabs-content.svelte +4 -4
- package/dist/bits/tabs/components/tabs-list.svelte +3 -3
- package/dist/bits/tabs/components/tabs-trigger.svelte +5 -5
- package/dist/bits/tabs/components/tabs.svelte +8 -8
- package/dist/bits/tabs/components/tabs.svelte.d.ts +1 -1
- package/dist/bits/tabs/tabs.svelte.d.ts +5 -5
- package/dist/bits/tabs/tabs.svelte.js +11 -11
- package/dist/bits/time-field/components/time-field-input.svelte +4 -4
- package/dist/bits/time-field/components/time-field-label.svelte +3 -3
- package/dist/bits/time-field/components/time-field-segment.svelte +3 -3
- package/dist/bits/time-field/components/time-field.svelte +16 -16
- package/dist/bits/time-field/time-field.svelte.js +15 -15
- package/dist/bits/time-range-field/components/time-range-field-input.svelte +4 -4
- package/dist/bits/time-range-field/components/time-range-field-label.svelte +3 -3
- package/dist/bits/time-range-field/components/time-range-field.svelte +19 -19
- package/dist/bits/time-range-field/components/time-range-field.svelte.d.ts +1 -1
- package/dist/bits/time-range-field/time-range-field.svelte.js +7 -7
- package/dist/bits/toggle/components/toggle.svelte +5 -5
- package/dist/bits/toggle/toggle.svelte.d.ts +0 -1
- package/dist/bits/toggle/toggle.svelte.js +5 -10
- package/dist/bits/toggle-group/components/toggle-group-item.svelte +5 -5
- package/dist/bits/toggle-group/components/toggle-group.svelte +8 -8
- package/dist/bits/toggle-group/components/toggle-group.svelte.d.ts +1 -1
- package/dist/bits/toggle-group/toggle-group.svelte.d.ts +2 -2
- package/dist/bits/toggle-group/toggle-group.svelte.js +7 -7
- package/dist/bits/toolbar/components/toolbar-button.svelte +4 -4
- package/dist/bits/toolbar/components/toolbar-group-item.svelte +5 -5
- package/dist/bits/toolbar/components/toolbar-group.svelte +5 -5
- package/dist/bits/toolbar/components/toolbar-group.svelte.d.ts +1 -1
- package/dist/bits/toolbar/components/toolbar-link.svelte +3 -3
- package/dist/bits/toolbar/components/toolbar.svelte +5 -5
- package/dist/bits/toolbar/toolbar.svelte.d.ts +4 -4
- package/dist/bits/toolbar/toolbar.svelte.js +11 -11
- package/dist/bits/tooltip/components/tooltip-content-static.svelte +5 -5
- package/dist/bits/tooltip/components/tooltip-content.svelte +7 -5
- package/dist/bits/tooltip/components/tooltip-provider.svelte +7 -7
- package/dist/bits/tooltip/components/tooltip-trigger.svelte +4 -4
- package/dist/bits/tooltip/components/tooltip.svelte +8 -8
- package/dist/bits/tooltip/tooltip.svelte.js +7 -7
- package/dist/bits/tooltip/types.d.ts +1 -1
- package/dist/bits/utilities/config/bits-config.js +2 -2
- package/dist/bits/utilities/config/components/bits-config.svelte +3 -3
- package/dist/bits/utilities/config/prop-resolvers.js +2 -2
- package/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte +7 -7
- package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.d.ts +3 -2
- package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js +8 -5
- package/dist/bits/utilities/escape-layer/escape-layer.svelte +4 -4
- package/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte +3 -3
- package/dist/bits/utilities/floating-layer/components/floating-layer-arrow.svelte +3 -3
- package/dist/bits/utilities/floating-layer/components/floating-layer-content.svelte +20 -20
- package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.d.ts +3 -3
- package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js +9 -9
- package/dist/bits/utilities/focus-scope/focus-scope-manager.js +2 -2
- package/dist/bits/utilities/focus-scope/focus-scope.svelte +5 -5
- package/dist/bits/utilities/presence-layer/presence-layer.svelte +2 -2
- package/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte +5 -5
- package/dist/internal/attrs.d.ts +4 -19
- package/dist/internal/attrs.js +11 -56
- package/dist/internal/body-scroll-lock.svelte.js +5 -5
- package/dist/internal/box-auto-reset.svelte.js +2 -2
- package/dist/internal/date-time/calendar-helpers.svelte.js +4 -4
- package/dist/internal/events.d.ts +0 -6
- package/dist/internal/events.js +0 -17
- package/dist/internal/floating-svelte/use-floating.svelte.js +2 -2
- package/dist/internal/state-machine.js +2 -2
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CheckboxRootProps } from "../types.js";
|
|
4
4
|
import { CheckboxGroupContext, CheckboxRootState } from "../checkbox.svelte.js";
|
|
5
5
|
import CheckboxInput from "./checkbox-input.svelte";
|
|
@@ -51,31 +51,31 @@
|
|
|
51
51
|
|
|
52
52
|
const rootState = CheckboxRootState.create(
|
|
53
53
|
{
|
|
54
|
-
checked:
|
|
54
|
+
checked: boxWith(
|
|
55
55
|
() => checked,
|
|
56
56
|
(v) => {
|
|
57
57
|
checked = v;
|
|
58
58
|
onCheckedChange?.(v);
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
disabled:
|
|
62
|
-
required:
|
|
63
|
-
name:
|
|
64
|
-
value:
|
|
65
|
-
id:
|
|
66
|
-
ref:
|
|
61
|
+
disabled: boxWith(() => disabled ?? false),
|
|
62
|
+
required: boxWith(() => required),
|
|
63
|
+
name: boxWith(() => name),
|
|
64
|
+
value: boxWith(() => value),
|
|
65
|
+
id: boxWith(() => id),
|
|
66
|
+
ref: boxWith(
|
|
67
67
|
() => ref,
|
|
68
68
|
(v) => (ref = v)
|
|
69
69
|
),
|
|
70
|
-
indeterminate:
|
|
70
|
+
indeterminate: boxWith(
|
|
71
71
|
() => indeterminate,
|
|
72
72
|
(v) => {
|
|
73
73
|
indeterminate = v;
|
|
74
74
|
onIndeterminateChange?.(v);
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
|
-
type:
|
|
78
|
-
readonly:
|
|
77
|
+
type: boxWith(() => type),
|
|
78
|
+
readonly: boxWith(() => Boolean(readonly)),
|
|
79
79
|
},
|
|
80
80
|
group
|
|
81
81
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CheckboxRootProps } from "../types.js";
|
|
2
|
-
declare const Checkbox: import("svelte").Component<CheckboxRootProps, {}, "
|
|
2
|
+
declare const Checkbox: import("svelte").Component<CheckboxRootProps, {}, "ref" | "checked" | "indeterminate">;
|
|
3
3
|
type Checkbox = ReturnType<typeof Checkbox>;
|
|
4
4
|
export default Checkbox;
|
|
@@ -23,6 +23,7 @@ export declare class CollapsibleRootState {
|
|
|
23
23
|
}
|
|
24
24
|
interface CollapsibleContentStateOpts extends WithRefOpts, ReadableBoxedValues<{
|
|
25
25
|
forceMount: boolean;
|
|
26
|
+
hiddenUntilFound: boolean;
|
|
26
27
|
}> {
|
|
27
28
|
}
|
|
28
29
|
export declare class CollapsibleContentState {
|
|
@@ -42,6 +43,7 @@ export declare class CollapsibleContentState {
|
|
|
42
43
|
readonly "--bits-collapsible-content-height": string | undefined;
|
|
43
44
|
readonly "--bits-collapsible-content-width": string | undefined;
|
|
44
45
|
};
|
|
46
|
+
readonly hidden: "until-found" | undefined;
|
|
45
47
|
readonly "data-state": "open" | "closed";
|
|
46
48
|
readonly "data-disabled": "" | undefined;
|
|
47
49
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { afterTick, attachRef,
|
|
1
|
+
import { afterTick, attachRef, boxWith, } from "svelte-toolbelt";
|
|
2
2
|
import { Context, watch } from "runed";
|
|
3
|
-
import { createBitsAttrs,
|
|
3
|
+
import { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef, getDataOpenClosed, } from "../../internal/attrs.js";
|
|
4
4
|
import { kbd } from "../../internal/kbd.js";
|
|
5
5
|
import { OpenChangeComplete } from "../../internal/open-change-complete.js";
|
|
6
|
+
import { on } from "svelte/events";
|
|
6
7
|
const collapsibleAttrs = createBitsAttrs({
|
|
7
8
|
component: "collapsible",
|
|
8
9
|
parts: ["root", "content", "trigger"],
|
|
@@ -21,7 +22,7 @@ export class CollapsibleRootState {
|
|
|
21
22
|
this.toggleOpen = this.toggleOpen.bind(this);
|
|
22
23
|
this.attachment = attachRef(this.opts.ref);
|
|
23
24
|
new OpenChangeComplete({
|
|
24
|
-
ref:
|
|
25
|
+
ref: boxWith(() => this.contentNode),
|
|
25
26
|
open: this.opts.open,
|
|
26
27
|
onComplete: () => {
|
|
27
28
|
this.opts.onOpenChangeComplete.current(this.opts.open.current);
|
|
@@ -34,7 +35,7 @@ export class CollapsibleRootState {
|
|
|
34
35
|
props = $derived.by(() => ({
|
|
35
36
|
id: this.opts.id.current,
|
|
36
37
|
"data-state": getDataOpenClosed(this.opts.open.current),
|
|
37
|
-
"data-disabled":
|
|
38
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
38
39
|
[collapsibleAttrs.root]: "",
|
|
39
40
|
...this.attachment,
|
|
40
41
|
}));
|
|
@@ -46,7 +47,11 @@ export class CollapsibleContentState {
|
|
|
46
47
|
opts;
|
|
47
48
|
root;
|
|
48
49
|
attachment;
|
|
49
|
-
present = $derived.by(() =>
|
|
50
|
+
present = $derived.by(() => {
|
|
51
|
+
if (this.opts.hiddenUntilFound.current)
|
|
52
|
+
return this.root.opts.open.current;
|
|
53
|
+
return this.opts.forceMount.current || this.root.opts.open.current;
|
|
54
|
+
});
|
|
50
55
|
#originalStyles;
|
|
51
56
|
#isMountAnimationPrevented = $state(false);
|
|
52
57
|
#width = $state(0);
|
|
@@ -68,6 +73,21 @@ export class CollapsibleContentState {
|
|
|
68
73
|
cancelAnimationFrame(rAF);
|
|
69
74
|
};
|
|
70
75
|
});
|
|
76
|
+
watch.pre([() => this.opts.ref.current, () => this.opts.hiddenUntilFound.current], ([node, hiddenUntilFound]) => {
|
|
77
|
+
if (!node || !hiddenUntilFound)
|
|
78
|
+
return;
|
|
79
|
+
const handleBeforeMatch = () => {
|
|
80
|
+
if (this.root.opts.open.current)
|
|
81
|
+
return;
|
|
82
|
+
// we need to defer opening until after browser completes search highlighting
|
|
83
|
+
// otherwise the browser will immediately open the collapsible
|
|
84
|
+
// and the search highlighting will not be visible
|
|
85
|
+
requestAnimationFrame(() => {
|
|
86
|
+
this.root.opts.open.current = true;
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
return on(node, "beforematch", handleBeforeMatch);
|
|
90
|
+
});
|
|
71
91
|
watch([() => this.opts.ref.current, () => this.present], ([node]) => {
|
|
72
92
|
if (!node)
|
|
73
93
|
return;
|
|
@@ -107,8 +127,11 @@ export class CollapsibleContentState {
|
|
|
107
127
|
? `${this.#width}px`
|
|
108
128
|
: undefined,
|
|
109
129
|
},
|
|
130
|
+
hidden: this.opts.hiddenUntilFound.current && !this.root.opts.open.current
|
|
131
|
+
? "until-found"
|
|
132
|
+
: undefined,
|
|
110
133
|
"data-state": getDataOpenClosed(this.root.opts.open.current),
|
|
111
|
-
"data-disabled":
|
|
134
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
112
135
|
[collapsibleAttrs.content]: "",
|
|
113
136
|
...this.attachment,
|
|
114
137
|
}));
|
|
@@ -148,9 +171,9 @@ export class CollapsibleTriggerState {
|
|
|
148
171
|
type: "button",
|
|
149
172
|
disabled: this.#isDisabled,
|
|
150
173
|
"aria-controls": this.root.contentId,
|
|
151
|
-
"aria-expanded":
|
|
174
|
+
"aria-expanded": boolToStr(this.root.opts.open.current),
|
|
152
175
|
"data-state": getDataOpenClosed(this.root.opts.open.current),
|
|
153
|
-
"data-disabled":
|
|
176
|
+
"data-disabled": boolToEmptyStrOrUndef(this.#isDisabled),
|
|
154
177
|
[collapsibleAttrs.trigger]: "",
|
|
155
178
|
//
|
|
156
179
|
onclick: this.onclick,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { CollapsibleContentState } from "../collapsible.svelte.js";
|
|
4
4
|
import type { CollapsibleContentProps } from "../types.js";
|
|
5
5
|
import { PresenceLayer } from "../../utilities/presence-layer/index.js";
|
|
@@ -11,15 +11,17 @@
|
|
|
11
11
|
child,
|
|
12
12
|
ref = $bindable(null),
|
|
13
13
|
forceMount = false,
|
|
14
|
+
hiddenUntilFound = false,
|
|
14
15
|
children,
|
|
15
16
|
id = createId(uid),
|
|
16
17
|
...restProps
|
|
17
18
|
}: CollapsibleContentProps = $props();
|
|
18
19
|
|
|
19
20
|
const contentState = CollapsibleContentState.create({
|
|
20
|
-
id:
|
|
21
|
-
forceMount:
|
|
22
|
-
|
|
21
|
+
id: boxWith(() => id),
|
|
22
|
+
forceMount: boxWith(() => forceMount),
|
|
23
|
+
hiddenUntilFound: boxWith(() => hiddenUntilFound),
|
|
24
|
+
ref: boxWith(
|
|
23
25
|
() => ref,
|
|
24
26
|
(v) => (ref = v)
|
|
25
27
|
),
|
|
@@ -28,9 +30,15 @@
|
|
|
28
30
|
|
|
29
31
|
<PresenceLayer forceMount={true} open={contentState.present} ref={contentState.opts.ref}>
|
|
30
32
|
{#snippet presence({ present })}
|
|
31
|
-
{@const mergedProps = mergeProps(
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
{@const mergedProps = mergeProps(
|
|
34
|
+
restProps,
|
|
35
|
+
contentState.props,
|
|
36
|
+
hiddenUntilFound && !present
|
|
37
|
+
? {}
|
|
38
|
+
: {
|
|
39
|
+
hidden: hiddenUntilFound ? !present : forceMount ? undefined : !present,
|
|
40
|
+
}
|
|
41
|
+
)}
|
|
34
42
|
{#if child}
|
|
35
43
|
{@render child({
|
|
36
44
|
...contentState.snippetProps,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CollapsibleTriggerProps } from "../types.js";
|
|
4
4
|
import { CollapsibleTriggerState } from "../collapsible.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
}: CollapsibleTriggerProps = $props();
|
|
17
17
|
|
|
18
18
|
const triggerState = CollapsibleTriggerState.create({
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
ref: boxWith(
|
|
21
21
|
() => ref,
|
|
22
22
|
(v) => (ref = v)
|
|
23
23
|
),
|
|
24
|
-
disabled:
|
|
24
|
+
disabled: boxWith(() => disabled),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const mergedProps = $derived(mergeProps(restProps, triggerState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CollapsibleRootProps } from "../types.js";
|
|
4
4
|
import { CollapsibleRootState } from "../collapsible.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -20,20 +20,20 @@
|
|
|
20
20
|
}: CollapsibleRootProps = $props();
|
|
21
21
|
|
|
22
22
|
const rootState = CollapsibleRootState.create({
|
|
23
|
-
open:
|
|
23
|
+
open: boxWith(
|
|
24
24
|
() => open,
|
|
25
25
|
(v) => {
|
|
26
26
|
open = v;
|
|
27
27
|
onOpenChange(v);
|
|
28
28
|
}
|
|
29
29
|
),
|
|
30
|
-
disabled:
|
|
31
|
-
id:
|
|
32
|
-
ref:
|
|
30
|
+
disabled: boxWith(() => disabled),
|
|
31
|
+
id: boxWith(() => id),
|
|
32
|
+
ref: boxWith(
|
|
33
33
|
() => ref,
|
|
34
34
|
(v) => (ref = v)
|
|
35
35
|
),
|
|
36
|
-
onOpenChangeComplete:
|
|
36
|
+
onOpenChangeComplete: boxWith(() => onOpenChangeComplete),
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const mergedProps = $derived(mergeProps(restProps, rootState.props));
|
|
@@ -4,13 +4,13 @@ export type CollapsibleRootPropsWithoutHTML = WithChild<{
|
|
|
4
4
|
/**
|
|
5
5
|
* Whether the collapsible is disabled.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @default false
|
|
8
8
|
*/
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
/**
|
|
11
11
|
* Whether the collapsible is open.
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
13
|
+
* @default false
|
|
14
14
|
*/
|
|
15
15
|
open?: boolean;
|
|
16
16
|
/**
|
|
@@ -30,9 +30,18 @@ export type CollapsibleContentPropsWithoutHTML = WithChildNoChildrenSnippetProps
|
|
|
30
30
|
/**
|
|
31
31
|
* Whether to force mount the content to the DOM.
|
|
32
32
|
*
|
|
33
|
-
* @
|
|
33
|
+
* @default false
|
|
34
34
|
*/
|
|
35
35
|
forceMount?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to allow the browser to expand the content when searching for content
|
|
38
|
+
* within the panel via the browser's built-in search functionality.
|
|
39
|
+
*
|
|
40
|
+
* When `true`, this prop will override the `forceMount` prop.
|
|
41
|
+
*
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
hiddenUntilFound?: boolean;
|
|
36
45
|
}, CollapsibleContentSnippetProps>;
|
|
37
46
|
export type CollapsibleContentProps = CollapsibleContentPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, CollapsibleContentPropsWithoutHTML>;
|
|
38
47
|
export type CollapsibleTriggerPropsWithoutHTML = WithChild;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { ComboboxInputProps } from "../types.js";
|
|
4
4
|
import { useId } from "../../../internal/use-id.js";
|
|
5
5
|
import { FloatingLayer } from "../../utilities/floating-layer/index.js";
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
}: ComboboxInputProps = $props();
|
|
16
16
|
|
|
17
17
|
const inputState = SelectInputState.create({
|
|
18
|
-
id:
|
|
19
|
-
ref:
|
|
18
|
+
id: boxWith(() => id),
|
|
19
|
+
ref: boxWith(
|
|
20
20
|
() => ref,
|
|
21
21
|
(v) => (ref = v)
|
|
22
22
|
),
|
|
23
|
-
clearOnDeselect:
|
|
23
|
+
clearOnDeselect: boxWith(() => clearOnDeselect),
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
if (defaultValue) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { ComboboxTriggerProps } from "../types.js";
|
|
4
4
|
import { useId } from "../../../internal/use-id.js";
|
|
5
5
|
import { SelectComboTriggerState } from "../../select/select.svelte.js";
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
}: ComboboxTriggerProps = $props();
|
|
15
15
|
|
|
16
16
|
const triggerState = SelectComboTriggerState.create({
|
|
17
|
-
id:
|
|
18
|
-
ref:
|
|
17
|
+
id: boxWith(() => id),
|
|
18
|
+
ref: boxWith(
|
|
19
19
|
() => ref,
|
|
20
20
|
(v) => (ref = v)
|
|
21
21
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { type WritableBox,
|
|
2
|
+
import { type WritableBox, boxWith } from "svelte-toolbelt";
|
|
3
3
|
import type { ComboboxRootProps } from "../types.js";
|
|
4
4
|
import { noop } from "../../../internal/noop.js";
|
|
5
5
|
import FloatingLayer from "../../utilities/floating-layer/components/floating-layer.svelte";
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
const rootState = SelectRootState.create({
|
|
42
42
|
type,
|
|
43
|
-
value:
|
|
43
|
+
value: boxWith(
|
|
44
44
|
() => value!,
|
|
45
45
|
(v) => {
|
|
46
46
|
value = v;
|
|
@@ -48,26 +48,26 @@
|
|
|
48
48
|
onValueChange(v);
|
|
49
49
|
}
|
|
50
50
|
) as WritableBox<string> | WritableBox<string[]>,
|
|
51
|
-
disabled:
|
|
52
|
-
required:
|
|
53
|
-
open:
|
|
51
|
+
disabled: boxWith(() => disabled),
|
|
52
|
+
required: boxWith(() => required),
|
|
53
|
+
open: boxWith(
|
|
54
54
|
() => open,
|
|
55
55
|
(v) => {
|
|
56
56
|
open = v;
|
|
57
57
|
onOpenChange(v);
|
|
58
58
|
}
|
|
59
59
|
),
|
|
60
|
-
loop:
|
|
61
|
-
scrollAlignment:
|
|
62
|
-
name:
|
|
60
|
+
loop: boxWith(() => loop),
|
|
61
|
+
scrollAlignment: boxWith(() => scrollAlignment),
|
|
62
|
+
name: boxWith(() => name),
|
|
63
63
|
isCombobox: true,
|
|
64
|
-
items:
|
|
65
|
-
allowDeselect:
|
|
66
|
-
inputValue:
|
|
64
|
+
items: boxWith(() => items),
|
|
65
|
+
allowDeselect: boxWith(() => allowDeselect),
|
|
66
|
+
inputValue: boxWith(
|
|
67
67
|
() => inputValue,
|
|
68
68
|
(v) => (inputValue = v)
|
|
69
69
|
),
|
|
70
|
-
onOpenChangeComplete:
|
|
70
|
+
onOpenChangeComplete: boxWith(() => onOpenChangeComplete),
|
|
71
71
|
});
|
|
72
72
|
</script>
|
|
73
73
|
|
|
@@ -2,7 +2,7 @@ import { afterSleep, afterTick, srOnlyStyles, attachRef, } from "svelte-toolbelt
|
|
|
2
2
|
import { Context, watch } from "runed";
|
|
3
3
|
import { findNextSibling, findPreviousSibling } from "./utils.js";
|
|
4
4
|
import { kbd } from "../../internal/kbd.js";
|
|
5
|
-
import { createBitsAttrs,
|
|
5
|
+
import { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef } from "../../internal/attrs.js";
|
|
6
6
|
import { getFirstNonCommentChild } from "../../internal/dom.js";
|
|
7
7
|
import { computeCommandScore } from "./index.js";
|
|
8
8
|
import { cssEscape } from "../../internal/css-escape.js";
|
|
@@ -1087,7 +1087,7 @@ export class CommandInputState {
|
|
|
1087
1087
|
spellcheck: false,
|
|
1088
1088
|
"aria-autocomplete": "list",
|
|
1089
1089
|
role: "combobox",
|
|
1090
|
-
"aria-expanded":
|
|
1090
|
+
"aria-expanded": boolToStr(true),
|
|
1091
1091
|
"aria-controls": this.root.viewportNode?.id ?? undefined,
|
|
1092
1092
|
"aria-labelledby": this.root.labelNode?.id ?? undefined,
|
|
1093
1093
|
"aria-activedescendant": this.#selectedItemId,
|
|
@@ -1174,10 +1174,10 @@ export class CommandItemState {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
props = $derived.by(() => ({
|
|
1176
1176
|
id: this.opts.id.current,
|
|
1177
|
-
"aria-disabled":
|
|
1178
|
-
"aria-selected":
|
|
1179
|
-
"data-disabled":
|
|
1180
|
-
"data-selected":
|
|
1177
|
+
"aria-disabled": boolToStr(this.opts.disabled.current),
|
|
1178
|
+
"aria-selected": boolToStr(this.isSelected),
|
|
1179
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
1180
|
+
"data-selected": boolToEmptyStrOrUndef(this.isSelected),
|
|
1181
1181
|
"data-value": this.trueValue,
|
|
1182
1182
|
"data-group": this.#group?.trueValue,
|
|
1183
1183
|
[commandAttrs.item]: "",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith } from "svelte-toolbelt";
|
|
3
3
|
import { CommandLabelState } from "../command.svelte.js";
|
|
4
4
|
|
|
5
5
|
import type { WithChildren } from "../../../internal/types.js";
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
}: WithChildren<WithElementRef<BitsPrimitiveLabelAttributes>> = $props();
|
|
17
17
|
|
|
18
18
|
const labelState = CommandLabelState.create({
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
ref: boxWith(
|
|
21
21
|
() => ref,
|
|
22
22
|
(v) => (ref = v)
|
|
23
23
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandEmptyProps } from "../types.js";
|
|
4
4
|
import { CommandEmptyState } from "../command.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
}: CommandEmptyProps = $props();
|
|
17
17
|
|
|
18
18
|
const emptyState = CommandEmptyState.create({
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
ref: boxWith(
|
|
21
21
|
() => ref,
|
|
22
22
|
(v) => (ref = v)
|
|
23
23
|
),
|
|
24
|
-
forceMount:
|
|
24
|
+
forceMount: boxWith(() => forceMount),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const mergedProps = $derived(mergeProps(emptyState.props, restProps));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { CommandGroupHeadingState } from "../command.svelte.js";
|
|
4
4
|
import type { CommandGroupHeadingProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CommandGroupHeadingProps = $props();
|
|
16
16
|
|
|
17
17
|
const headingState = CommandGroupHeadingState.create({
|
|
18
|
-
id:
|
|
19
|
-
ref:
|
|
18
|
+
id: boxWith(() => id),
|
|
19
|
+
ref: boxWith(
|
|
20
20
|
() => ref,
|
|
21
21
|
(v) => (ref = v)
|
|
22
22
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandGroupItemsProps } from "../types.js";
|
|
4
4
|
import { CommandGroupItemsState } from "../command.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CommandGroupItemsProps = $props();
|
|
16
16
|
|
|
17
17
|
const groupItemsState = CommandGroupItemsState.create({
|
|
18
|
-
id:
|
|
19
|
-
ref:
|
|
18
|
+
id: boxWith(() => id),
|
|
19
|
+
ref: boxWith(
|
|
20
20
|
() => ref,
|
|
21
21
|
(v) => (ref = v)
|
|
22
22
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandGroupProps } from "../types.js";
|
|
4
4
|
import { CommandGroupContainerState } from "../command.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
}: CommandGroupProps = $props();
|
|
18
18
|
|
|
19
19
|
const groupState = CommandGroupContainerState.create({
|
|
20
|
-
id:
|
|
21
|
-
ref:
|
|
20
|
+
id: boxWith(() => id),
|
|
21
|
+
ref: boxWith(
|
|
22
22
|
() => ref,
|
|
23
23
|
(v) => (ref = v)
|
|
24
24
|
),
|
|
25
|
-
forceMount:
|
|
26
|
-
value:
|
|
25
|
+
forceMount: boxWith(() => forceMount),
|
|
26
|
+
value: boxWith(() => value),
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const mergedProps = $derived(mergeProps(restProps, groupState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandInputProps } from "../types.js";
|
|
4
4
|
import { CommandInputState } from "../command.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,18 +16,18 @@
|
|
|
16
16
|
}: CommandInputProps = $props();
|
|
17
17
|
|
|
18
18
|
const inputState = CommandInputState.create({
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
ref: boxWith(
|
|
21
21
|
() => ref,
|
|
22
22
|
(v) => (ref = v)
|
|
23
23
|
),
|
|
24
|
-
value:
|
|
24
|
+
value: boxWith(
|
|
25
25
|
() => value,
|
|
26
26
|
(v) => {
|
|
27
27
|
value = v;
|
|
28
28
|
}
|
|
29
29
|
),
|
|
30
|
-
autofocus:
|
|
30
|
+
autofocus: boxWith(() => autofocus ?? false),
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
const mergedProps = $derived(mergeProps(restProps, inputState.props));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CommandInputProps } from "../types.js";
|
|
2
|
-
declare const CommandInput: import("svelte").Component<CommandInputProps, {}, "
|
|
2
|
+
declare const CommandInput: import("svelte").Component<CommandInputProps, {}, "ref" | "value">;
|
|
3
3
|
type CommandInput = ReturnType<typeof CommandInput>;
|
|
4
4
|
export default CommandInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandItemProps } from "../types.js";
|
|
4
4
|
import { CommandItemState } from "../command.svelte.js";
|
|
5
5
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
}: CommandItemProps = $props();
|
|
22
22
|
|
|
23
23
|
const itemState = CommandItemState.create({
|
|
24
|
-
id:
|
|
25
|
-
ref:
|
|
24
|
+
id: boxWith(() => id),
|
|
25
|
+
ref: boxWith(
|
|
26
26
|
() => ref,
|
|
27
27
|
(v) => (ref = v)
|
|
28
28
|
),
|
|
29
|
-
value:
|
|
30
|
-
disabled:
|
|
31
|
-
onSelect:
|
|
32
|
-
forceMount:
|
|
33
|
-
keywords:
|
|
29
|
+
value: boxWith(() => value),
|
|
30
|
+
disabled: boxWith(() => disabled),
|
|
31
|
+
onSelect: boxWith(() => onSelect),
|
|
32
|
+
forceMount: boxWith(() => forceMount),
|
|
33
|
+
keywords: boxWith(() => keywords),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
const mergedProps = $derived(mergeProps(restProps, itemState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandLinkItemProps } from "../types.js";
|
|
4
4
|
import { CommandItemState } from "../command.svelte.js";
|
|
5
5
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
}: CommandLinkItemProps = $props();
|
|
22
22
|
|
|
23
23
|
const itemState = CommandItemState.create({
|
|
24
|
-
id:
|
|
25
|
-
ref:
|
|
24
|
+
id: boxWith(() => id),
|
|
25
|
+
ref: boxWith(
|
|
26
26
|
() => ref,
|
|
27
27
|
(v) => (ref = v)
|
|
28
28
|
),
|
|
29
|
-
value:
|
|
30
|
-
disabled:
|
|
31
|
-
onSelect:
|
|
32
|
-
forceMount:
|
|
33
|
-
keywords:
|
|
29
|
+
value: boxWith(() => value),
|
|
30
|
+
disabled: boxWith(() => disabled),
|
|
31
|
+
onSelect: boxWith(() => onSelect),
|
|
32
|
+
forceMount: boxWith(() => forceMount),
|
|
33
|
+
keywords: boxWith(() => keywords),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
const mergedProps = $derived(mergeProps(restProps, itemState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandListProps } from "../types.js";
|
|
4
4
|
import { CommandListState } from "../command.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
}: CommandListProps = $props();
|
|
17
17
|
|
|
18
18
|
const listState = CommandListState.create({
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
ref: boxWith(
|
|
21
21
|
() => ref,
|
|
22
22
|
(v) => (ref = v)
|
|
23
23
|
),
|
|
24
|
-
ariaLabel:
|
|
24
|
+
ariaLabel: boxWith(() => ariaLabel ?? "Suggestions..."),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const mergedProps = $derived(mergeProps(restProps, listState.props));
|