bits-ui 2.10.0 → 2.11.0
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 +4 -4
- 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 +14 -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.js +4 -3
- 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,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { watch } from "runed";
|
|
3
|
-
import {
|
|
3
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
4
4
|
import type { DateValue } from "@internationalized/date";
|
|
5
5
|
import { DateRangeFieldRootState } from "../date-range-field.svelte.js";
|
|
6
6
|
import type { DateRangeFieldRootProps } from "../types.js";
|
|
@@ -80,52 +80,52 @@
|
|
|
80
80
|
);
|
|
81
81
|
|
|
82
82
|
const rootState = DateRangeFieldRootState.create({
|
|
83
|
-
id:
|
|
84
|
-
ref:
|
|
83
|
+
id: boxWith(() => id),
|
|
84
|
+
ref: boxWith(
|
|
85
85
|
() => ref,
|
|
86
86
|
(v) => (ref = v)
|
|
87
87
|
),
|
|
88
|
-
disabled:
|
|
89
|
-
readonly:
|
|
90
|
-
required:
|
|
91
|
-
hourCycle:
|
|
92
|
-
granularity:
|
|
88
|
+
disabled: boxWith(() => disabled),
|
|
89
|
+
readonly: boxWith(() => readonly),
|
|
90
|
+
required: boxWith(() => required),
|
|
91
|
+
hourCycle: boxWith(() => hourCycle),
|
|
92
|
+
granularity: boxWith(() => granularity),
|
|
93
93
|
locale: resolveLocaleProp(() => locale),
|
|
94
|
-
hideTimeZone:
|
|
95
|
-
validate:
|
|
96
|
-
maxValue:
|
|
97
|
-
minValue:
|
|
98
|
-
placeholder:
|
|
94
|
+
hideTimeZone: boxWith(() => hideTimeZone),
|
|
95
|
+
validate: boxWith(() => validate),
|
|
96
|
+
maxValue: boxWith(() => maxValue),
|
|
97
|
+
minValue: boxWith(() => minValue),
|
|
98
|
+
placeholder: boxWith(
|
|
99
99
|
() => placeholder as DateValue,
|
|
100
100
|
(v) => {
|
|
101
101
|
placeholder = v;
|
|
102
102
|
onPlaceholderChange(v);
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
|
-
readonlySegments:
|
|
106
|
-
value:
|
|
105
|
+
readonlySegments: boxWith(() => readonlySegments),
|
|
106
|
+
value: boxWith(
|
|
107
107
|
() => value as DateRange,
|
|
108
108
|
(v) => {
|
|
109
109
|
value = v;
|
|
110
110
|
onValueChange(v);
|
|
111
111
|
}
|
|
112
112
|
),
|
|
113
|
-
startValue:
|
|
113
|
+
startValue: boxWith(
|
|
114
114
|
() => startValue,
|
|
115
115
|
(v) => {
|
|
116
116
|
startValue = v;
|
|
117
117
|
onStartValueChange(v);
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
|
-
endValue:
|
|
120
|
+
endValue: boxWith(
|
|
121
121
|
() => endValue,
|
|
122
122
|
(v) => {
|
|
123
123
|
endValue = v;
|
|
124
124
|
onEndValueChange(v);
|
|
125
125
|
}
|
|
126
126
|
),
|
|
127
|
-
onInvalid:
|
|
128
|
-
errorMessageId:
|
|
127
|
+
onInvalid: boxWith(() => onInvalid),
|
|
128
|
+
errorMessageId: boxWith(() => errorMessageId),
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
const mergedProps = $derived(mergeProps(restProps, rootState.props));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DateRangeFieldRootProps } from "../types.js";
|
|
2
|
-
declare const DateRangeField: import("svelte").Component<DateRangeFieldRootProps, {}, "
|
|
2
|
+
declare const DateRangeField: import("svelte").Component<DateRangeFieldRootProps, {}, "ref" | "value" | "placeholder">;
|
|
3
3
|
type DateRangeField = ReturnType<typeof DateRangeField>;
|
|
4
4
|
export default DateRangeField;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { boxWith, onDestroyEffect, attachRef, DOMContext, } from "svelte-toolbelt";
|
|
2
2
|
import { Context, watch } from "runed";
|
|
3
3
|
import { DateFieldInputState, DateFieldRootState } from "../date-field/date-field.svelte.js";
|
|
4
4
|
import { useId } from "../../internal/use-id.js";
|
|
5
|
-
import { createBitsAttrs,
|
|
5
|
+
import { createBitsAttrs, boolToEmptyStrOrUndef } from "../../internal/attrs.js";
|
|
6
6
|
import { createFormatter } from "../../internal/date-time/formatter.js";
|
|
7
7
|
import { removeDescriptionElement } from "../../internal/date-time/field/helpers.js";
|
|
8
8
|
import { isBefore } from "../../internal/date-time/utils.js";
|
|
@@ -33,8 +33,8 @@ export class DateRangeFieldRootState {
|
|
|
33
33
|
this.opts = opts;
|
|
34
34
|
this.formatter = createFormatter({
|
|
35
35
|
initialLocale: this.opts.locale.current,
|
|
36
|
-
monthFormat:
|
|
37
|
-
yearFormat:
|
|
36
|
+
monthFormat: boxWith(() => "long"),
|
|
37
|
+
yearFormat: boxWith(() => "numeric"),
|
|
38
38
|
});
|
|
39
39
|
this.domContext = new DOMContext(this.opts.ref);
|
|
40
40
|
this.attachment = attachRef(this.opts.ref, (v) => (this.fieldNode = v));
|
|
@@ -143,7 +143,7 @@ export class DateRangeFieldRootState {
|
|
|
143
143
|
id: this.opts.id.current,
|
|
144
144
|
role: "group",
|
|
145
145
|
[dateRangeFieldAttrs.root]: "",
|
|
146
|
-
"data-invalid":
|
|
146
|
+
"data-invalid": boolToEmptyStrOrUndef(this.isInvalid),
|
|
147
147
|
...this.attachment,
|
|
148
148
|
}));
|
|
149
149
|
}
|
|
@@ -169,8 +169,8 @@ export class DateRangeFieldLabelState {
|
|
|
169
169
|
};
|
|
170
170
|
props = $derived.by(() => ({
|
|
171
171
|
id: this.opts.id.current,
|
|
172
|
-
"data-invalid":
|
|
173
|
-
"data-disabled":
|
|
172
|
+
"data-invalid": boolToEmptyStrOrUndef(this.root.isInvalid),
|
|
173
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
174
174
|
[dateRangeFieldAttrs.label]: "",
|
|
175
175
|
onclick: this.#onclick,
|
|
176
176
|
...this.attachment,
|
|
@@ -184,7 +184,7 @@ export class DateRangeFieldInputState {
|
|
|
184
184
|
disabled: root.opts.disabled,
|
|
185
185
|
readonly: root.opts.readonly,
|
|
186
186
|
readonlySegments: root.opts.readonlySegments,
|
|
187
|
-
validate:
|
|
187
|
+
validate: boxWith(() => undefined),
|
|
188
188
|
minValue: root.opts.minValue,
|
|
189
189
|
maxValue: root.opts.maxValue,
|
|
190
190
|
hourCycle: root.opts.hourCycle,
|
|
@@ -195,7 +195,7 @@ export class DateRangeFieldInputState {
|
|
|
195
195
|
placeholder: root.opts.placeholder,
|
|
196
196
|
onInvalid: root.opts.onInvalid,
|
|
197
197
|
errorMessageId: root.opts.errorMessageId,
|
|
198
|
-
isInvalidProp:
|
|
198
|
+
isInvalidProp: boxWith(() => root.isInvalid),
|
|
199
199
|
}, root);
|
|
200
200
|
return new DateFieldInputState({ name: opts.name, id: opts.id, ref: opts.ref }, fieldState);
|
|
201
201
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { DateRangePickerCalendarProps } from "../types.js";
|
|
4
4
|
import { DateRangePickerRootContext } from "../date-range-picker.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
const dateRangePickerRootState = DateRangePickerRootContext.get();
|
|
19
19
|
|
|
20
20
|
const rangeCalendarState = RangeCalendarRootState.create({
|
|
21
|
-
id:
|
|
22
|
-
ref:
|
|
21
|
+
id: boxWith(() => id),
|
|
22
|
+
ref: boxWith(
|
|
23
23
|
() => ref,
|
|
24
24
|
(v) => (ref = v)
|
|
25
25
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { watch } from "runed";
|
|
3
|
-
import {
|
|
3
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
4
4
|
import type { DateValue } from "@internationalized/date";
|
|
5
5
|
import { DateRangePickerRootState } from "../date-range-picker.svelte.js";
|
|
6
6
|
import type { DateRangePickerRootProps } from "../types.js";
|
|
@@ -114,73 +114,73 @@
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
const pickerRootState = DateRangePickerRootState.create({
|
|
117
|
-
open:
|
|
117
|
+
open: boxWith(
|
|
118
118
|
() => open,
|
|
119
119
|
(v) => {
|
|
120
120
|
open = v;
|
|
121
121
|
onOpenChange(v);
|
|
122
122
|
}
|
|
123
123
|
),
|
|
124
|
-
value:
|
|
124
|
+
value: boxWith(
|
|
125
125
|
() => value as DateRange,
|
|
126
126
|
(v) => {
|
|
127
127
|
value = v;
|
|
128
128
|
onValueChange(v);
|
|
129
129
|
}
|
|
130
130
|
),
|
|
131
|
-
placeholder:
|
|
131
|
+
placeholder: boxWith(
|
|
132
132
|
() => placeholder as DateValue,
|
|
133
133
|
(v) => {
|
|
134
134
|
placeholder = v;
|
|
135
135
|
onPlaceholderChange(v as DateValue);
|
|
136
136
|
}
|
|
137
137
|
),
|
|
138
|
-
isDateUnavailable:
|
|
139
|
-
minValue:
|
|
140
|
-
maxValue:
|
|
141
|
-
minDays:
|
|
142
|
-
maxDays:
|
|
143
|
-
disabled:
|
|
144
|
-
readonly:
|
|
145
|
-
granularity:
|
|
146
|
-
readonlySegments:
|
|
147
|
-
hourCycle:
|
|
138
|
+
isDateUnavailable: boxWith(() => isDateUnavailable),
|
|
139
|
+
minValue: boxWith(() => minValue),
|
|
140
|
+
maxValue: boxWith(() => maxValue),
|
|
141
|
+
minDays: boxWith(() => minDays),
|
|
142
|
+
maxDays: boxWith(() => maxDays),
|
|
143
|
+
disabled: boxWith(() => disabled),
|
|
144
|
+
readonly: boxWith(() => readonly),
|
|
145
|
+
granularity: boxWith(() => granularity),
|
|
146
|
+
readonlySegments: boxWith(() => readonlySegments),
|
|
147
|
+
hourCycle: boxWith(() => hourCycle),
|
|
148
148
|
locale: resolveLocaleProp(() => locale),
|
|
149
|
-
hideTimeZone:
|
|
150
|
-
required:
|
|
151
|
-
calendarLabel:
|
|
152
|
-
disableDaysOutsideMonth:
|
|
153
|
-
preventDeselect:
|
|
154
|
-
pagedNavigation:
|
|
155
|
-
weekStartsOn:
|
|
156
|
-
weekdayFormat:
|
|
157
|
-
isDateDisabled:
|
|
158
|
-
fixedWeeks:
|
|
159
|
-
numberOfMonths:
|
|
160
|
-
excludeDisabled:
|
|
161
|
-
onRangeSelect:
|
|
162
|
-
startValue:
|
|
149
|
+
hideTimeZone: boxWith(() => hideTimeZone),
|
|
150
|
+
required: boxWith(() => required),
|
|
151
|
+
calendarLabel: boxWith(() => calendarLabel),
|
|
152
|
+
disableDaysOutsideMonth: boxWith(() => disableDaysOutsideMonth),
|
|
153
|
+
preventDeselect: boxWith(() => preventDeselect),
|
|
154
|
+
pagedNavigation: boxWith(() => pagedNavigation),
|
|
155
|
+
weekStartsOn: boxWith(() => weekStartsOn),
|
|
156
|
+
weekdayFormat: boxWith(() => weekdayFormat),
|
|
157
|
+
isDateDisabled: boxWith(() => isDateDisabled),
|
|
158
|
+
fixedWeeks: boxWith(() => fixedWeeks),
|
|
159
|
+
numberOfMonths: boxWith(() => numberOfMonths),
|
|
160
|
+
excludeDisabled: boxWith(() => excludeDisabled),
|
|
161
|
+
onRangeSelect: boxWith(() => onRangeSelect),
|
|
162
|
+
startValue: boxWith(
|
|
163
163
|
() => startValue,
|
|
164
164
|
(v) => {
|
|
165
165
|
startValue = v;
|
|
166
166
|
onStartValueChange(v);
|
|
167
167
|
}
|
|
168
168
|
),
|
|
169
|
-
endValue:
|
|
169
|
+
endValue: boxWith(
|
|
170
170
|
() => endValue,
|
|
171
171
|
(v) => {
|
|
172
172
|
endValue = v;
|
|
173
173
|
onEndValueChange(v);
|
|
174
174
|
}
|
|
175
175
|
),
|
|
176
|
-
monthFormat:
|
|
177
|
-
yearFormat:
|
|
176
|
+
monthFormat: boxWith(() => monthFormat),
|
|
177
|
+
yearFormat: boxWith(() => yearFormat),
|
|
178
178
|
defaultPlaceholder,
|
|
179
179
|
});
|
|
180
180
|
|
|
181
181
|
PopoverRootState.create({
|
|
182
182
|
open: pickerRootState.opts.open,
|
|
183
|
-
onOpenChangeComplete:
|
|
183
|
+
onOpenChangeComplete: boxWith(() => onOpenChangeComplete),
|
|
184
184
|
});
|
|
185
185
|
|
|
186
186
|
const fieldRootState = DateRangeFieldRootState.create({
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
disabled: pickerRootState.opts.disabled,
|
|
189
189
|
readonly: pickerRootState.opts.readonly,
|
|
190
190
|
readonlySegments: pickerRootState.opts.readonlySegments,
|
|
191
|
-
validate:
|
|
191
|
+
validate: boxWith(() => validate),
|
|
192
192
|
minValue: pickerRootState.opts.minValue,
|
|
193
193
|
maxValue: pickerRootState.opts.maxValue,
|
|
194
194
|
granularity: pickerRootState.opts.granularity,
|
|
@@ -197,15 +197,15 @@
|
|
|
197
197
|
locale: pickerRootState.opts.locale,
|
|
198
198
|
required: pickerRootState.opts.required,
|
|
199
199
|
placeholder: pickerRootState.opts.placeholder,
|
|
200
|
-
id:
|
|
201
|
-
ref:
|
|
200
|
+
id: boxWith(() => id),
|
|
201
|
+
ref: boxWith(
|
|
202
202
|
() => ref,
|
|
203
203
|
(v) => (ref = v)
|
|
204
204
|
),
|
|
205
205
|
startValue: pickerRootState.opts.startValue,
|
|
206
206
|
endValue: pickerRootState.opts.endValue,
|
|
207
|
-
onInvalid:
|
|
208
|
-
errorMessageId:
|
|
207
|
+
onInvalid: boxWith(() => onInvalid),
|
|
208
|
+
errorMessageId: boxWith(() => errorMessageId),
|
|
209
209
|
});
|
|
210
210
|
|
|
211
211
|
const mergedProps = $derived(mergeProps(restProps, fieldRootState.props));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DateRangePickerRootProps } from "../types.js";
|
|
2
|
-
declare const DateRangePicker: import("svelte").Component<DateRangePickerRootProps, {}, "
|
|
2
|
+
declare const DateRangePicker: import("svelte").Component<DateRangePickerRootProps, {}, "ref" | "value" | "placeholder" | "open">;
|
|
3
3
|
type DateRangePicker = ReturnType<typeof DateRangePicker>;
|
|
4
4
|
export default DateRangePicker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { DialogCloseState } from "../dialog.svelte.js";
|
|
4
4
|
import type { DialogCloseProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
}: DialogCloseProps = $props();
|
|
17
17
|
|
|
18
18
|
const closeState = DialogCloseState.create({
|
|
19
|
-
variant:
|
|
20
|
-
id:
|
|
21
|
-
ref:
|
|
19
|
+
variant: boxWith(() => "close"),
|
|
20
|
+
id: boxWith(() => id),
|
|
21
|
+
ref: boxWith(
|
|
22
22
|
() => ref,
|
|
23
23
|
(v) => (ref = v)
|
|
24
24
|
),
|
|
25
|
-
disabled:
|
|
25
|
+
disabled: boxWith(() => Boolean(disabled)),
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const mergedProps = $derived(mergeProps(restProps, closeState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { DialogContentState } from "../dialog.svelte.js";
|
|
4
4
|
import type { DialogContentProps } from "../types.js";
|
|
5
5
|
import DismissibleLayer from "../../utilities/dismissible-layer/dismissible-layer.svelte";
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
}: DialogContentProps = $props();
|
|
31
31
|
|
|
32
32
|
const contentState = DialogContentState.create({
|
|
33
|
-
id:
|
|
34
|
-
ref:
|
|
33
|
+
id: boxWith(() => id),
|
|
34
|
+
ref: boxWith(
|
|
35
35
|
() => ref,
|
|
36
36
|
(v) => (ref = v)
|
|
37
37
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { DialogDescriptionState } from "../dialog.svelte.js";
|
|
4
4
|
import type { DialogDescriptionProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: DialogDescriptionProps = $props();
|
|
16
16
|
|
|
17
17
|
const descriptionState = DialogDescriptionState.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 { DialogOverlayState } from "../dialog.svelte.js";
|
|
4
4
|
import type { DialogOverlayProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
}: DialogOverlayProps = $props();
|
|
18
18
|
|
|
19
19
|
const overlayState = DialogOverlayState.create({
|
|
20
|
-
id:
|
|
21
|
-
ref:
|
|
20
|
+
id: boxWith(() => id),
|
|
21
|
+
ref: boxWith(
|
|
22
22
|
() => ref,
|
|
23
23
|
(v) => (ref = v)
|
|
24
24
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { DialogTitleState } from "../dialog.svelte.js";
|
|
4
4
|
import type { DialogTitleProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
}: DialogTitleProps = $props();
|
|
17
17
|
|
|
18
18
|
const titleState = DialogTitleState.create({
|
|
19
|
-
id:
|
|
20
|
-
level:
|
|
21
|
-
ref:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
level: boxWith(() => level),
|
|
21
|
+
ref: boxWith(
|
|
22
22
|
() => ref,
|
|
23
23
|
(v) => (ref = v)
|
|
24
24
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { DialogTriggerState } from "../dialog.svelte.js";
|
|
4
4
|
import type { DialogTriggerProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
}: DialogTriggerProps = $props();
|
|
17
17
|
|
|
18
18
|
const triggerState = DialogTriggerState.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(() => Boolean(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 } from "svelte-toolbelt";
|
|
3
3
|
import { DialogRootState } from "../dialog.svelte.js";
|
|
4
4
|
import type { DialogRootProps } from "../types.js";
|
|
5
5
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
}: DialogRootProps = $props();
|
|
13
13
|
|
|
14
14
|
DialogRootState.create({
|
|
15
|
-
variant:
|
|
16
|
-
open:
|
|
15
|
+
variant: boxWith(() => "dialog"),
|
|
16
|
+
open: boxWith(
|
|
17
17
|
() => open,
|
|
18
18
|
(v) => {
|
|
19
19
|
open = v;
|
|
20
20
|
onOpenChange(v);
|
|
21
21
|
}
|
|
22
22
|
),
|
|
23
|
-
onOpenChangeComplete:
|
|
23
|
+
onOpenChangeComplete: boxWith(() => onOpenChangeComplete),
|
|
24
24
|
});
|
|
25
25
|
</script>
|
|
26
26
|
|
|
@@ -100,7 +100,7 @@ export declare class DialogTitleState {
|
|
|
100
100
|
readonly "data-state": "open" | "closed";
|
|
101
101
|
readonly id: string;
|
|
102
102
|
readonly role: "heading";
|
|
103
|
-
readonly "aria-level": 1 | 2 | 3 | 4 |
|
|
103
|
+
readonly "aria-level": 1 | 2 | 3 | 4 | 5 | 6;
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
interface DialogDescriptionStateOpts extends WithRefOpts {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { attachRef,
|
|
1
|
+
import { attachRef, boxWith, } from "svelte-toolbelt";
|
|
2
2
|
import { Context, watch } from "runed";
|
|
3
|
-
import { createBitsAttrs,
|
|
3
|
+
import { createBitsAttrs, boolToStr, getDataOpenClosed } from "../../internal/attrs.js";
|
|
4
4
|
import { kbd } from "../../internal/kbd.js";
|
|
5
5
|
import { OpenChangeComplete } from "../../internal/open-change-complete.js";
|
|
6
6
|
const dialogAttrs = createBitsAttrs({
|
|
@@ -26,7 +26,7 @@ export class DialogRootState {
|
|
|
26
26
|
this.handleOpen = this.handleOpen.bind(this);
|
|
27
27
|
this.handleClose = this.handleClose.bind(this);
|
|
28
28
|
new OpenChangeComplete({
|
|
29
|
-
ref:
|
|
29
|
+
ref: boxWith(() => this.contentNode),
|
|
30
30
|
open: this.opts.open,
|
|
31
31
|
enabled: true,
|
|
32
32
|
onComplete: () => {
|
|
@@ -86,7 +86,7 @@ export class DialogTriggerState {
|
|
|
86
86
|
props = $derived.by(() => ({
|
|
87
87
|
id: this.opts.id.current,
|
|
88
88
|
"aria-haspopup": "dialog",
|
|
89
|
-
"aria-expanded":
|
|
89
|
+
"aria-expanded": boolToStr(this.root.opts.open.current),
|
|
90
90
|
"aria-controls": this.root.contentId,
|
|
91
91
|
[this.root.getBitsAttr("trigger")]: "",
|
|
92
92
|
onkeydown: this.onkeydown,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { DropdownMenuContentStaticProps } from "../types.js";
|
|
4
4
|
import { MenuContentState } from "../../menu/menu.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
}: DropdownMenuContentStaticProps = $props();
|
|
25
25
|
|
|
26
26
|
const contentState = MenuContentState.create({
|
|
27
|
-
id:
|
|
28
|
-
loop:
|
|
29
|
-
ref:
|
|
27
|
+
id: boxWith(() => id),
|
|
28
|
+
loop: boxWith(() => loop),
|
|
29
|
+
ref: boxWith(
|
|
30
30
|
() => ref,
|
|
31
31
|
(v) => (ref = v)
|
|
32
32
|
),
|
|
33
|
-
onCloseAutoFocus:
|
|
33
|
+
onCloseAutoFocus: boxWith(() => onCloseAutoFocus),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
const mergedProps = $derived(mergeProps(restProps, contentState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { DropdownMenuContentProps } from "../types.js";
|
|
4
4
|
import { MenuContentState } from "../../menu/menu.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
}: DropdownMenuContentProps = $props();
|
|
26
26
|
|
|
27
27
|
const contentState = MenuContentState.create({
|
|
28
|
-
id:
|
|
29
|
-
loop:
|
|
30
|
-
ref:
|
|
28
|
+
id: boxWith(() => id),
|
|
29
|
+
loop: boxWith(() => loop),
|
|
30
|
+
ref: boxWith(
|
|
31
31
|
() => ref,
|
|
32
32
|
(v) => (ref = v)
|
|
33
33
|
),
|
|
34
|
-
onCloseAutoFocus:
|
|
34
|
+
onCloseAutoFocus: boxWith(() => onCloseAutoFocus),
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const mergedProps = $derived(mergeProps(restProps, contentState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { LabelRootProps } from "../types.js";
|
|
4
4
|
import { LabelRootState } from "../label.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
}: LabelRootProps = $props();
|
|
17
17
|
|
|
18
18
|
const rootState = LabelRootState.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 { LinkPreviewContentStaticProps } from "../types.js";
|
|
4
4
|
import { LinkPreviewContentState } from "../link-preview.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
}: LinkPreviewContentStaticProps = $props();
|
|
24
24
|
|
|
25
25
|
const contentState = LinkPreviewContentState.create({
|
|
26
|
-
id:
|
|
27
|
-
ref:
|
|
26
|
+
id: boxWith(() => id),
|
|
27
|
+
ref: boxWith(
|
|
28
28
|
() => ref,
|
|
29
29
|
(v) => (ref = v)
|
|
30
30
|
),
|
|
31
|
-
onInteractOutside:
|
|
32
|
-
onEscapeKeydown:
|
|
31
|
+
onInteractOutside: boxWith(() => onInteractOutside),
|
|
32
|
+
onEscapeKeydown: boxWith(() => onEscapeKeydown),
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
const mergedProps = $derived(mergeProps(restProps, contentState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { LinkPreviewContentProps } from "../types.js";
|
|
4
4
|
import { LinkPreviewContentState } from "../link-preview.svelte.js";
|
|
5
5
|
import PopperLayer from "../../utilities/popper-layer/popper-layer.svelte";
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
}: LinkPreviewContentProps = $props();
|
|
32
32
|
|
|
33
33
|
const contentState = LinkPreviewContentState.create({
|
|
34
|
-
id:
|
|
35
|
-
ref:
|
|
34
|
+
id: boxWith(() => id),
|
|
35
|
+
ref: boxWith(
|
|
36
36
|
() => ref,
|
|
37
37
|
(v) => (ref = v)
|
|
38
38
|
),
|
|
39
|
-
onInteractOutside:
|
|
40
|
-
onEscapeKeydown:
|
|
39
|
+
onInteractOutside: boxWith(() => onInteractOutside),
|
|
40
|
+
onEscapeKeydown: boxWith(() => onEscapeKeydown),
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
const floatingProps = $derived({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { LinkPreviewTriggerProps } from "../types.js";
|
|
4
4
|
import { LinkPreviewTriggerState } from "../link-preview.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
}: LinkPreviewTriggerProps = $props();
|
|
17
17
|
|
|
18
18
|
const triggerState = LinkPreviewTriggerState.create({
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
ref: boxWith(
|
|
21
21
|
() => ref,
|
|
22
22
|
(v) => (ref = v)
|
|
23
23
|
),
|