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,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { SelectTriggerState } from "../select.svelte.js";
|
|
4
4
|
import type { SelectTriggerProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
}: SelectTriggerProps = $props();
|
|
18
18
|
|
|
19
19
|
const triggerState = SelectTriggerState.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 type { SelectViewportProps } from "../types.js";
|
|
4
4
|
import { SelectViewportState } from "../select.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: SelectViewportProps = $props();
|
|
16
16
|
|
|
17
17
|
const viewportState = SelectViewportState.create({
|
|
18
|
-
id:
|
|
19
|
-
ref:
|
|
18
|
+
id: boxWith(() => id),
|
|
19
|
+
ref: boxWith(
|
|
20
20
|
() => ref,
|
|
21
21
|
(v) => (ref = v)
|
|
22
22
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import FloatingLayer from "../../utilities/floating-layer/components/floating-layer.svelte";
|
|
3
3
|
import { noop } from "../../../internal/noop.js";
|
|
4
|
-
import { type WritableBox,
|
|
4
|
+
import { type WritableBox, boxWith } from "svelte-toolbelt";
|
|
5
5
|
import { SelectRootState } from "../select.svelte.js";
|
|
6
6
|
import type { SelectRootProps } from "../types.js";
|
|
7
7
|
import SelectHiddenInput from "./select-hidden-input.svelte";
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
const rootState = SelectRootState.create({
|
|
46
46
|
type,
|
|
47
|
-
value:
|
|
47
|
+
value: boxWith(
|
|
48
48
|
() => value!,
|
|
49
49
|
(v) => {
|
|
50
50
|
value = v;
|
|
@@ -52,26 +52,26 @@
|
|
|
52
52
|
onValueChange(v as any);
|
|
53
53
|
}
|
|
54
54
|
) as WritableBox<string> | WritableBox<string[]>,
|
|
55
|
-
disabled:
|
|
56
|
-
required:
|
|
57
|
-
open:
|
|
55
|
+
disabled: boxWith(() => disabled),
|
|
56
|
+
required: boxWith(() => required),
|
|
57
|
+
open: boxWith(
|
|
58
58
|
() => open,
|
|
59
59
|
(v) => {
|
|
60
60
|
open = v;
|
|
61
61
|
onOpenChange(v);
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
loop:
|
|
65
|
-
scrollAlignment:
|
|
66
|
-
name:
|
|
64
|
+
loop: boxWith(() => loop),
|
|
65
|
+
scrollAlignment: boxWith(() => scrollAlignment),
|
|
66
|
+
name: boxWith(() => name),
|
|
67
67
|
isCombobox: false,
|
|
68
|
-
items:
|
|
69
|
-
allowDeselect:
|
|
70
|
-
inputValue:
|
|
68
|
+
items: boxWith(() => items),
|
|
69
|
+
allowDeselect: boxWith(() => allowDeselect),
|
|
70
|
+
inputValue: boxWith(
|
|
71
71
|
() => inputValue,
|
|
72
72
|
(v) => (inputValue = v)
|
|
73
73
|
),
|
|
74
|
-
onOpenChangeComplete:
|
|
74
|
+
onOpenChangeComplete: boxWith(() => onOpenChangeComplete),
|
|
75
75
|
});
|
|
76
76
|
</script>
|
|
77
77
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Context, Previous, watch } from "runed";
|
|
2
|
-
import { afterSleep, afterTick, onDestroyEffect, attachRef, DOMContext,
|
|
2
|
+
import { afterSleep, afterTick, onDestroyEffect, attachRef, DOMContext, boxWith, } from "svelte-toolbelt";
|
|
3
3
|
import { on } from "svelte/events";
|
|
4
4
|
import { backward, forward, next, prev } from "../../internal/arrays.js";
|
|
5
|
-
import {
|
|
5
|
+
import { boolToStr, boolToStrTrueOrUndef, boolToEmptyStrOrUndef, getDataOpenClosed, boolToTrueOrUndef, } from "../../internal/attrs.js";
|
|
6
6
|
import { kbd } from "../../internal/kbd.js";
|
|
7
7
|
import { noop } from "../../internal/noop.js";
|
|
8
8
|
import { isIOS } from "../../internal/is.js";
|
|
@@ -70,7 +70,7 @@ class SelectBaseRootState {
|
|
|
70
70
|
this.opts = opts;
|
|
71
71
|
this.isCombobox = opts.isCombobox;
|
|
72
72
|
new OpenChangeComplete({
|
|
73
|
-
ref:
|
|
73
|
+
ref: boxWith(() => this.contentNode),
|
|
74
74
|
open: this.opts.open,
|
|
75
75
|
onComplete: () => {
|
|
76
76
|
this.opts.onOpenChangeComplete.current(this.opts.open.current);
|
|
@@ -382,9 +382,9 @@ export class SelectInputState {
|
|
|
382
382
|
disabled: this.root.opts.disabled.current ? true : undefined,
|
|
383
383
|
"aria-activedescendant": this.root.highlightedId,
|
|
384
384
|
"aria-autocomplete": "list",
|
|
385
|
-
"aria-expanded":
|
|
385
|
+
"aria-expanded": boolToStr(this.root.opts.open.current),
|
|
386
386
|
"data-state": getDataOpenClosed(this.root.opts.open.current),
|
|
387
|
-
"data-disabled":
|
|
387
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
388
388
|
onkeydown: this.onkeydown,
|
|
389
389
|
oninput: this.oninput,
|
|
390
390
|
[this.root.getBitsAttr("input")]: "",
|
|
@@ -434,7 +434,7 @@ export class SelectComboTriggerState {
|
|
|
434
434
|
disabled: this.root.opts.disabled.current ? true : undefined,
|
|
435
435
|
"aria-haspopup": "listbox",
|
|
436
436
|
"data-state": getDataOpenClosed(this.root.opts.open.current),
|
|
437
|
-
"data-disabled":
|
|
437
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
438
438
|
[this.root.getBitsAttr("trigger")]: "",
|
|
439
439
|
onpointerdown: this.onpointerdown,
|
|
440
440
|
onkeydown: this.onkeydown,
|
|
@@ -668,10 +668,10 @@ export class SelectTriggerState {
|
|
|
668
668
|
id: this.opts.id.current,
|
|
669
669
|
disabled: this.root.opts.disabled.current ? true : undefined,
|
|
670
670
|
"aria-haspopup": "listbox",
|
|
671
|
-
"aria-expanded":
|
|
671
|
+
"aria-expanded": boolToStr(this.root.opts.open.current),
|
|
672
672
|
"aria-activedescendant": this.root.highlightedId,
|
|
673
673
|
"data-state": getDataOpenClosed(this.root.opts.open.current),
|
|
674
|
-
"data-disabled":
|
|
674
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
675
675
|
"data-placeholder": this.root.hasValue ? undefined : "",
|
|
676
676
|
[this.root.getBitsAttr("trigger")]: "",
|
|
677
677
|
onpointerdown: this.onpointerdown,
|
|
@@ -879,7 +879,7 @@ export class SelectItemState {
|
|
|
879
879
|
? "true"
|
|
880
880
|
: undefined,
|
|
881
881
|
"data-value": this.opts.value.current,
|
|
882
|
-
"data-disabled":
|
|
882
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
883
883
|
"data-highlighted": this.root.highlightedValue === this.opts.value.current &&
|
|
884
884
|
!this.opts.disabled.current
|
|
885
885
|
? ""
|
|
@@ -954,8 +954,8 @@ export class SelectHiddenInputState {
|
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
956
|
props = $derived.by(() => ({
|
|
957
|
-
disabled:
|
|
958
|
-
required:
|
|
957
|
+
disabled: boolToTrueOrUndef(this.root.opts.disabled.current),
|
|
958
|
+
required: boolToTrueOrUndef(this.root.opts.required.current),
|
|
959
959
|
name: this.root.opts.name.current,
|
|
960
960
|
value: this.opts.value.current,
|
|
961
961
|
onfocus: this.onfocus,
|
|
@@ -1053,7 +1053,7 @@ export class SelectScrollButtonImplState {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
props = $derived.by(() => ({
|
|
1055
1055
|
id: this.opts.id.current,
|
|
1056
|
-
"aria-hidden":
|
|
1056
|
+
"aria-hidden": boolToStrTrueOrUndef(true),
|
|
1057
1057
|
style: {
|
|
1058
1058
|
flexShrink: 0,
|
|
1059
1059
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { SeparatorRootState } from "../separator.svelte.js";
|
|
4
4
|
import type { SeparatorRootProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
}: SeparatorRootProps = $props();
|
|
18
18
|
|
|
19
19
|
const rootState = SeparatorRootState.create({
|
|
20
|
-
ref:
|
|
20
|
+
ref: boxWith(
|
|
21
21
|
() => ref,
|
|
22
22
|
(v) => (ref = v)
|
|
23
23
|
),
|
|
24
|
-
id:
|
|
25
|
-
decorative:
|
|
26
|
-
orientation:
|
|
24
|
+
id: boxWith(() => id),
|
|
25
|
+
decorative: boxWith(() => decorative),
|
|
26
|
+
orientation: boxWith(() => orientation),
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const mergedProps = $derived(mergeProps(restProps, rootState.props));
|
|
@@ -14,9 +14,9 @@ export declare class SeparatorRootState {
|
|
|
14
14
|
readonly props: {
|
|
15
15
|
readonly id: string;
|
|
16
16
|
readonly role: "none" | "separator";
|
|
17
|
-
readonly "aria-orientation":
|
|
17
|
+
readonly "aria-orientation": Orientation;
|
|
18
18
|
readonly "aria-hidden": "true" | undefined;
|
|
19
|
-
readonly "data-orientation":
|
|
19
|
+
readonly "data-orientation": Orientation;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { attachRef } from "svelte-toolbelt";
|
|
2
|
-
import { createBitsAttrs,
|
|
2
|
+
import { createBitsAttrs, boolToStrTrueOrUndef } from "../../internal/attrs.js";
|
|
3
3
|
const separatorAttrs = createBitsAttrs({
|
|
4
4
|
component: "separator",
|
|
5
5
|
parts: ["root"],
|
|
@@ -17,9 +17,9 @@ export class SeparatorRootState {
|
|
|
17
17
|
props = $derived.by(() => ({
|
|
18
18
|
id: this.opts.id.current,
|
|
19
19
|
role: this.opts.decorative.current ? "none" : "separator",
|
|
20
|
-
"aria-orientation":
|
|
21
|
-
"aria-hidden":
|
|
22
|
-
"data-orientation":
|
|
20
|
+
"aria-orientation": this.opts.orientation.current,
|
|
21
|
+
"aria-hidden": boolToStrTrueOrUndef(this.opts.decorative.current),
|
|
22
|
+
"data-orientation": this.opts.orientation.current,
|
|
23
23
|
[separatorAttrs.root]: "",
|
|
24
24
|
...this.attachment,
|
|
25
25
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { SliderRangeProps } from "../types.js";
|
|
4
4
|
import { SliderRangeState } from "../slider.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: SliderRangeProps = $props();
|
|
16
16
|
|
|
17
17
|
const rangeState = SliderRangeState.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 { SliderThumbLabelProps } from "../types.js";
|
|
4
4
|
import { SliderRootContext, SliderThumbLabelState } from "../slider.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
const tickLabelState = SliderThumbLabelState.create({
|
|
34
|
-
id:
|
|
35
|
-
ref:
|
|
34
|
+
id: boxWith(() => id),
|
|
35
|
+
ref: boxWith(
|
|
36
36
|
() => ref,
|
|
37
37
|
(v) => (ref = v)
|
|
38
38
|
),
|
|
39
|
-
index:
|
|
40
|
-
position:
|
|
39
|
+
index: boxWith(() => index),
|
|
40
|
+
position: boxWith(() => position),
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
const mergedProps = $derived(mergeProps(restProps, tickLabelState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { SliderThumbProps } from "../types.js";
|
|
4
4
|
import { SliderThumbState } from "../slider.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
}: SliderThumbProps = $props();
|
|
18
18
|
|
|
19
19
|
const thumbState = SliderThumbState.create({
|
|
20
|
-
id:
|
|
21
|
-
ref:
|
|
20
|
+
id: boxWith(() => id),
|
|
21
|
+
ref: boxWith(
|
|
22
22
|
() => ref,
|
|
23
23
|
(v) => (ref = v)
|
|
24
24
|
),
|
|
25
|
-
index:
|
|
26
|
-
disabled:
|
|
25
|
+
index: boxWith(() => index),
|
|
26
|
+
disabled: boxWith(() => disabled),
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const mergedProps = $derived(mergeProps(restProps, thumbState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { SliderTickLabelProps } from "../types.js";
|
|
4
4
|
import { SliderRootContext, SliderTickLabelState } from "../slider.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
const tickLabelState = SliderTickLabelState.create({
|
|
34
|
-
id:
|
|
35
|
-
ref:
|
|
34
|
+
id: boxWith(() => id),
|
|
35
|
+
ref: boxWith(
|
|
36
36
|
() => ref,
|
|
37
37
|
(v) => (ref = v)
|
|
38
38
|
),
|
|
39
|
-
index:
|
|
40
|
-
position:
|
|
39
|
+
index: boxWith(() => index),
|
|
40
|
+
position: boxWith(() => position),
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
const mergedProps = $derived(mergeProps(restProps, tickLabelState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { SliderTickProps } from "../types.js";
|
|
4
4
|
import { SliderTickState } from "../slider.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
}: SliderTickProps = $props();
|
|
17
17
|
|
|
18
18
|
const tickState = SliderTickState.create({
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
ref: boxWith(
|
|
21
21
|
() => ref,
|
|
22
22
|
(v) => (ref = v)
|
|
23
23
|
),
|
|
24
|
-
index:
|
|
24
|
+
index: boxWith(() => index),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const mergedProps = $derived(mergeProps(restProps, tickState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps, type WritableBox } from "svelte-toolbelt";
|
|
3
3
|
import type { SliderRootProps } from "../types.js";
|
|
4
4
|
import { SliderRootState } from "../slider.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
);
|
|
61
61
|
|
|
62
62
|
const rootState = SliderRootState.create({
|
|
63
|
-
id:
|
|
64
|
-
ref:
|
|
63
|
+
id: boxWith(() => id),
|
|
64
|
+
ref: boxWith(
|
|
65
65
|
() => ref,
|
|
66
66
|
(v) => (ref = v)
|
|
67
67
|
),
|
|
68
|
-
value:
|
|
68
|
+
value: boxWith(
|
|
69
69
|
() => value,
|
|
70
70
|
(v) => {
|
|
71
71
|
value = v;
|
|
@@ -74,17 +74,17 @@
|
|
|
74
74
|
}
|
|
75
75
|
) as WritableBox<number> | WritableBox<number[]>,
|
|
76
76
|
// @ts-expect-error - we know
|
|
77
|
-
onValueCommit:
|
|
78
|
-
disabled:
|
|
79
|
-
min:
|
|
80
|
-
max:
|
|
81
|
-
step:
|
|
82
|
-
dir:
|
|
83
|
-
autoSort:
|
|
84
|
-
orientation:
|
|
85
|
-
thumbPositioning:
|
|
77
|
+
onValueCommit: boxWith(() => onValueCommit),
|
|
78
|
+
disabled: boxWith(() => disabled),
|
|
79
|
+
min: boxWith(() => min),
|
|
80
|
+
max: boxWith(() => max),
|
|
81
|
+
step: boxWith(() => step),
|
|
82
|
+
dir: boxWith(() => dir),
|
|
83
|
+
autoSort: boxWith(() => autoSort),
|
|
84
|
+
orientation: boxWith(() => orientation),
|
|
85
|
+
thumbPositioning: boxWith(() => thumbPositioning),
|
|
86
86
|
type,
|
|
87
|
-
trackPadding:
|
|
87
|
+
trackPadding: boxWith(() => trackPadding),
|
|
88
88
|
});
|
|
89
89
|
|
|
90
90
|
const mergedProps = $derived(mergeProps(restProps, rootState.props));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SliderRootProps } from "../types.js";
|
|
2
|
-
declare const Slider: import("svelte").Component<SliderRootProps, {}, "
|
|
2
|
+
declare const Slider: import("svelte").Component<SliderRootProps, {}, "ref" | "value">;
|
|
3
3
|
type Slider = ReturnType<typeof Slider>;
|
|
4
4
|
export default Slider;
|
|
@@ -32,7 +32,7 @@ declare abstract class SliderBaseRootState {
|
|
|
32
32
|
getPositionFromValue: (thumbValue: number) => number;
|
|
33
33
|
readonly props: {
|
|
34
34
|
readonly id: string;
|
|
35
|
-
readonly "data-orientation":
|
|
35
|
+
readonly "data-orientation": Orientation;
|
|
36
36
|
readonly "data-disabled": "" | undefined;
|
|
37
37
|
readonly style: {
|
|
38
38
|
readonly touchAction: "pan-x" | "pan-y" | undefined;
|
|
@@ -66,16 +66,16 @@ declare class SliderSingleRootState extends SliderBaseRootState {
|
|
|
66
66
|
readonly "aria-valuemax": number;
|
|
67
67
|
readonly "aria-valuenow": number;
|
|
68
68
|
readonly "aria-disabled": "true" | "false";
|
|
69
|
-
readonly "aria-orientation":
|
|
69
|
+
readonly "aria-orientation": Orientation;
|
|
70
70
|
readonly "data-value": number;
|
|
71
|
-
readonly "data-orientation":
|
|
71
|
+
readonly "data-orientation": Orientation;
|
|
72
72
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
73
73
|
}[];
|
|
74
74
|
readonly thumbsRenderArr: number[];
|
|
75
75
|
readonly ticksPropsArr: {
|
|
76
76
|
readonly [sliderAttrs.tick]: "";
|
|
77
77
|
readonly "data-disabled": "" | undefined;
|
|
78
|
-
readonly "data-orientation":
|
|
78
|
+
readonly "data-orientation": Orientation;
|
|
79
79
|
readonly "data-bounded": "" | undefined;
|
|
80
80
|
readonly "data-value": number;
|
|
81
81
|
readonly "data-selected": "" | undefined;
|
|
@@ -139,16 +139,16 @@ declare class SliderMultiRootState extends SliderBaseRootState {
|
|
|
139
139
|
readonly "aria-valuemax": number;
|
|
140
140
|
readonly "aria-valuenow": number | undefined;
|
|
141
141
|
readonly "aria-disabled": "true" | "false";
|
|
142
|
-
readonly "aria-orientation":
|
|
142
|
+
readonly "aria-orientation": Orientation;
|
|
143
143
|
readonly "data-value": number | undefined;
|
|
144
|
-
readonly "data-orientation":
|
|
144
|
+
readonly "data-orientation": Orientation;
|
|
145
145
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
146
146
|
}[];
|
|
147
147
|
readonly thumbsRenderArr: number[];
|
|
148
148
|
readonly ticksPropsArr: {
|
|
149
149
|
readonly [sliderAttrs.tick]: "";
|
|
150
150
|
readonly "data-disabled": "" | undefined;
|
|
151
|
-
readonly "data-orientation":
|
|
151
|
+
readonly "data-orientation": Orientation;
|
|
152
152
|
readonly "data-bounded": "" | undefined;
|
|
153
153
|
readonly "data-value": number;
|
|
154
154
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
@@ -1021,7 +1021,7 @@ export declare class SliderRangeState {
|
|
|
1021
1021
|
};
|
|
1022
1022
|
readonly props: {
|
|
1023
1023
|
readonly id: string;
|
|
1024
|
-
readonly "data-orientation":
|
|
1024
|
+
readonly "data-orientation": Orientation;
|
|
1025
1025
|
readonly "data-disabled": "" | undefined;
|
|
1026
1026
|
readonly style: {
|
|
1027
1027
|
accentColor?: import("csstype").Property.AccentColor | undefined;
|
|
@@ -1876,9 +1876,9 @@ export declare class SliderThumbState {
|
|
|
1876
1876
|
readonly "aria-valuemax": number;
|
|
1877
1877
|
readonly "aria-valuenow": number;
|
|
1878
1878
|
readonly "aria-disabled": "true" | "false";
|
|
1879
|
-
readonly "aria-orientation":
|
|
1879
|
+
readonly "aria-orientation": Orientation;
|
|
1880
1880
|
readonly "data-value": number;
|
|
1881
|
-
readonly "data-orientation":
|
|
1881
|
+
readonly "data-orientation": Orientation;
|
|
1882
1882
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
1883
1883
|
} | {
|
|
1884
1884
|
readonly id: string;
|
|
@@ -1891,9 +1891,9 @@ export declare class SliderThumbState {
|
|
|
1891
1891
|
readonly "aria-valuemax": number;
|
|
1892
1892
|
readonly "aria-valuenow": number | undefined;
|
|
1893
1893
|
readonly "aria-disabled": "true" | "false";
|
|
1894
|
-
readonly "aria-orientation":
|
|
1894
|
+
readonly "aria-orientation": Orientation;
|
|
1895
1895
|
readonly "data-value": number | undefined;
|
|
1896
|
-
readonly "data-orientation":
|
|
1896
|
+
readonly "data-orientation": Orientation;
|
|
1897
1897
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
1898
1898
|
};
|
|
1899
1899
|
}
|
|
@@ -1910,7 +1910,7 @@ export declare class SliderTickState {
|
|
|
1910
1910
|
readonly props: {
|
|
1911
1911
|
readonly id: string;
|
|
1912
1912
|
readonly "data-disabled": "" | undefined;
|
|
1913
|
-
readonly "data-orientation":
|
|
1913
|
+
readonly "data-orientation": Orientation;
|
|
1914
1914
|
readonly "data-bounded": "" | undefined;
|
|
1915
1915
|
readonly "data-value": number;
|
|
1916
1916
|
readonly "data-selected": "" | undefined;
|
|
@@ -1918,7 +1918,7 @@ export declare class SliderTickState {
|
|
|
1918
1918
|
} | {
|
|
1919
1919
|
readonly id: string;
|
|
1920
1920
|
readonly "data-disabled": "" | undefined;
|
|
1921
|
-
readonly "data-orientation":
|
|
1921
|
+
readonly "data-orientation": Orientation;
|
|
1922
1922
|
readonly "data-bounded": "" | undefined;
|
|
1923
1923
|
readonly "data-value": number;
|
|
1924
1924
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
@@ -1937,7 +1937,7 @@ export declare class SliderTickLabelState {
|
|
|
1937
1937
|
constructor(opts: SliderTickLabelStateOpts, root: SliderRoot);
|
|
1938
1938
|
readonly props: {
|
|
1939
1939
|
readonly id: string;
|
|
1940
|
-
readonly "data-orientation":
|
|
1940
|
+
readonly "data-orientation": Orientation;
|
|
1941
1941
|
readonly "data-disabled": "" | undefined;
|
|
1942
1942
|
readonly "data-bounded": "" | undefined;
|
|
1943
1943
|
readonly "data-value": number;
|
|
@@ -1959,7 +1959,7 @@ export declare class SliderThumbLabelState {
|
|
|
1959
1959
|
constructor(opts: SliderThumbLabelStateOpts, root: SliderRoot);
|
|
1960
1960
|
readonly props: {
|
|
1961
1961
|
readonly id: string;
|
|
1962
|
-
readonly "data-orientation":
|
|
1962
|
+
readonly "data-orientation": Orientation;
|
|
1963
1963
|
readonly "data-disabled": "" | undefined;
|
|
1964
1964
|
readonly "data-value": number;
|
|
1965
1965
|
readonly "data-active": "" | undefined;
|
|
@@ -7,7 +7,7 @@ import { executeCallbacks, onMountEffect, attachRef, DOMContext, } from "svelte-
|
|
|
7
7
|
import { on } from "svelte/events";
|
|
8
8
|
import { Context, watch } from "runed";
|
|
9
9
|
import { getRangeStyles, getThumbStyles, getTickStyles, normalizeSteps, snapValueToCustomSteps, getAdjacentStepValue, getTickLabelStyles, getThumbLabelStyles, } from "./helpers.js";
|
|
10
|
-
import { createBitsAttrs,
|
|
10
|
+
import { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef } from "../../internal/attrs.js";
|
|
11
11
|
import { kbd } from "../../internal/kbd.js";
|
|
12
12
|
import { isElementOrSVGElement } from "../../internal/is.js";
|
|
13
13
|
import { isValidIndex } from "../../internal/arrays.js";
|
|
@@ -90,8 +90,8 @@ class SliderBaseRootState {
|
|
|
90
90
|
};
|
|
91
91
|
props = $derived.by(() => ({
|
|
92
92
|
id: this.opts.id.current,
|
|
93
|
-
"data-orientation":
|
|
94
|
-
"data-disabled":
|
|
93
|
+
"data-orientation": this.opts.orientation.current,
|
|
94
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
95
95
|
style: {
|
|
96
96
|
touchAction: this.#touchAction,
|
|
97
97
|
},
|
|
@@ -223,10 +223,10 @@ class SliderSingleRootState extends SliderBaseRootState {
|
|
|
223
223
|
"aria-valuemin": this.opts.min.current,
|
|
224
224
|
"aria-valuemax": this.opts.max.current,
|
|
225
225
|
"aria-valuenow": thumbValue,
|
|
226
|
-
"aria-disabled":
|
|
227
|
-
"aria-orientation":
|
|
226
|
+
"aria-disabled": boolToStr(this.opts.disabled.current),
|
|
227
|
+
"aria-orientation": this.opts.orientation.current,
|
|
228
228
|
"data-value": thumbValue,
|
|
229
|
-
"data-orientation":
|
|
229
|
+
"data-orientation": this.opts.orientation.current,
|
|
230
230
|
style,
|
|
231
231
|
[sliderAttrs.thumb]: "",
|
|
232
232
|
};
|
|
@@ -247,8 +247,8 @@ class SliderSingleRootState extends SliderBaseRootState {
|
|
|
247
247
|
const style = getTickStyles(this.direction, tickPosition, offsetPercentage);
|
|
248
248
|
const bounded = tickValue <= currValue;
|
|
249
249
|
return {
|
|
250
|
-
"data-disabled":
|
|
251
|
-
"data-orientation":
|
|
250
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
251
|
+
"data-orientation": this.opts.orientation.current,
|
|
252
252
|
"data-bounded": bounded ? "" : undefined,
|
|
253
253
|
"data-value": tickValue,
|
|
254
254
|
"data-selected": this.isTickValueSelected(tickValue) ? "" : undefined,
|
|
@@ -485,10 +485,10 @@ class SliderMultiRootState extends SliderBaseRootState {
|
|
|
485
485
|
"aria-valuemin": this.opts.min.current,
|
|
486
486
|
"aria-valuemax": this.opts.max.current,
|
|
487
487
|
"aria-valuenow": thumbValue,
|
|
488
|
-
"aria-disabled":
|
|
489
|
-
"aria-orientation":
|
|
488
|
+
"aria-disabled": boolToStr(this.opts.disabled.current),
|
|
489
|
+
"aria-orientation": this.opts.orientation.current,
|
|
490
490
|
"data-value": thumbValue,
|
|
491
|
-
"data-orientation":
|
|
491
|
+
"data-orientation": this.opts.orientation.current,
|
|
492
492
|
style,
|
|
493
493
|
[sliderAttrs.thumb]: "",
|
|
494
494
|
};
|
|
@@ -511,8 +511,8 @@ class SliderMultiRootState extends SliderBaseRootState {
|
|
|
511
511
|
? tickValue <= currValue[0]
|
|
512
512
|
: currValue[0] <= tickValue && tickValue <= currValue[currValue.length - 1];
|
|
513
513
|
return {
|
|
514
|
-
"data-disabled":
|
|
515
|
-
"data-orientation":
|
|
514
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
515
|
+
"data-orientation": this.opts.orientation.current,
|
|
516
516
|
"data-bounded": bounded ? "" : undefined,
|
|
517
517
|
"data-value": tickValue,
|
|
518
518
|
style,
|
|
@@ -605,8 +605,8 @@ export class SliderRangeState {
|
|
|
605
605
|
});
|
|
606
606
|
props = $derived.by(() => ({
|
|
607
607
|
id: this.opts.id.current,
|
|
608
|
-
"data-orientation":
|
|
609
|
-
"data-disabled":
|
|
608
|
+
"data-orientation": this.root.opts.orientation.current,
|
|
609
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
610
610
|
style: this.rangeStyles,
|
|
611
611
|
[sliderAttrs.range]: "",
|
|
612
612
|
...this.attachment,
|
|
@@ -721,7 +721,7 @@ export class SliderThumbState {
|
|
|
721
721
|
id: this.opts.id.current,
|
|
722
722
|
onkeydown: this.onkeydown,
|
|
723
723
|
"data-active": this.root.isThumbActive(this.opts.index.current) ? "" : undefined,
|
|
724
|
-
"data-disabled":
|
|
724
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current || this.root.opts.disabled.current),
|
|
725
725
|
tabindex: this.opts.disabled.current || this.root.opts.disabled.current ? -1 : 0,
|
|
726
726
|
...this.attachment,
|
|
727
727
|
}));
|
|
@@ -765,8 +765,8 @@ export class SliderTickLabelState {
|
|
|
765
765
|
const style = getTickLabelStyles(this.root.direction, tickPosition, labelPosition);
|
|
766
766
|
return {
|
|
767
767
|
id: this.opts.id.current,
|
|
768
|
-
"data-orientation":
|
|
769
|
-
"data-disabled":
|
|
768
|
+
"data-orientation": this.root.opts.orientation.current,
|
|
769
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
770
770
|
"data-bounded": tickProps["data-bounded"],
|
|
771
771
|
"data-value": tickValue,
|
|
772
772
|
"data-selected": this.root.isTickValueSelected(tickValue) ? "" : undefined,
|
|
@@ -797,8 +797,8 @@ export class SliderThumbLabelState {
|
|
|
797
797
|
const style = getThumbLabelStyles(this.root.direction, thumbPosition, labelPosition);
|
|
798
798
|
return {
|
|
799
799
|
id: this.opts.id.current,
|
|
800
|
-
"data-orientation":
|
|
801
|
-
"data-disabled":
|
|
800
|
+
"data-orientation": this.root.opts.orientation.current,
|
|
801
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
802
802
|
"data-value": thumbValue,
|
|
803
803
|
"data-active": this.root.isThumbActive(this.opts.index.current) ? "" : undefined,
|
|
804
804
|
"data-position": labelPosition,
|