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
|
@@ -3,7 +3,7 @@ import { DEV } from "esm-env";
|
|
|
3
3
|
import { onMount, untrack } from "svelte";
|
|
4
4
|
import { attachRef, DOMContext, } from "svelte-toolbelt";
|
|
5
5
|
import { Context, watch } from "runed";
|
|
6
|
-
import {
|
|
6
|
+
import { boolToStr, boolToStrTrueOrUndef, boolToEmptyStrOrUndef } from "../../internal/attrs.js";
|
|
7
7
|
import { useId } from "../../internal/use-id.js";
|
|
8
8
|
import { getAnnouncer } from "../../internal/date-time/announcer.js";
|
|
9
9
|
import { createFormatter } from "../../internal/date-time/formatter.js";
|
|
@@ -435,9 +435,9 @@ export class CalendarHeadingState {
|
|
|
435
435
|
}
|
|
436
436
|
props = $derived.by(() => ({
|
|
437
437
|
id: this.opts.id.current,
|
|
438
|
-
"aria-hidden":
|
|
439
|
-
"data-disabled":
|
|
440
|
-
"data-readonly":
|
|
438
|
+
"aria-hidden": boolToStrTrueOrUndef(true),
|
|
439
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
440
|
+
"data-readonly": boolToEmptyStrOrUndef(this.root.opts.readonly.current),
|
|
441
441
|
[this.root.getBitsAttr("heading")]: "",
|
|
442
442
|
...this.attachment,
|
|
443
443
|
}));
|
|
@@ -482,22 +482,22 @@ export class CalendarCellState {
|
|
|
482
482
|
this.isUnavailable);
|
|
483
483
|
});
|
|
484
484
|
sharedDataAttrs = $derived.by(() => ({
|
|
485
|
-
"data-unavailable":
|
|
485
|
+
"data-unavailable": boolToEmptyStrOrUndef(this.isUnavailable),
|
|
486
486
|
"data-today": this.isDateToday ? "" : undefined,
|
|
487
487
|
"data-outside-month": this.isOutsideMonth ? "" : undefined,
|
|
488
488
|
"data-outside-visible-months": this.isOutsideVisibleMonths ? "" : undefined,
|
|
489
489
|
"data-focused": this.isFocusedDate ? "" : undefined,
|
|
490
|
-
"data-selected":
|
|
490
|
+
"data-selected": boolToEmptyStrOrUndef(this.isSelectedDate),
|
|
491
491
|
"data-value": this.opts.date.current.toString(),
|
|
492
492
|
"data-type": getDateValueType(this.opts.date.current),
|
|
493
|
-
"data-disabled":
|
|
493
|
+
"data-disabled": boolToEmptyStrOrUndef(this.isDisabled ||
|
|
494
494
|
(this.isOutsideMonth && this.root.opts.disableDaysOutsideMonth.current)),
|
|
495
495
|
}));
|
|
496
496
|
props = $derived.by(() => ({
|
|
497
497
|
id: this.opts.id.current,
|
|
498
498
|
role: "gridcell",
|
|
499
|
-
"aria-selected":
|
|
500
|
-
"aria-disabled":
|
|
499
|
+
"aria-selected": boolToStr(this.isSelectedDate),
|
|
500
|
+
"aria-disabled": boolToStr(this.ariaDisabled),
|
|
501
501
|
...this.sharedDataAttrs,
|
|
502
502
|
[this.root.getBitsAttr("cell")]: "",
|
|
503
503
|
...this.attachment,
|
|
@@ -537,7 +537,7 @@ export class CalendarDayState {
|
|
|
537
537
|
id: this.opts.id.current,
|
|
538
538
|
role: "button",
|
|
539
539
|
"aria-label": this.cell.labelText,
|
|
540
|
-
"aria-disabled":
|
|
540
|
+
"aria-disabled": boolToStr(this.cell.ariaDisabled),
|
|
541
541
|
...this.cell.sharedDataAttrs,
|
|
542
542
|
tabindex: this.#tabindex,
|
|
543
543
|
[this.cell.root.getBitsAttr("day")]: "",
|
|
@@ -572,8 +572,8 @@ export class CalendarNextButtonState {
|
|
|
572
572
|
role: "button",
|
|
573
573
|
type: "button",
|
|
574
574
|
"aria-label": "Next",
|
|
575
|
-
"aria-disabled":
|
|
576
|
-
"data-disabled":
|
|
575
|
+
"aria-disabled": boolToStr(this.isDisabled),
|
|
576
|
+
"data-disabled": boolToEmptyStrOrUndef(this.isDisabled),
|
|
577
577
|
disabled: this.isDisabled,
|
|
578
578
|
[this.root.getBitsAttr("next-button")]: "",
|
|
579
579
|
//
|
|
@@ -605,8 +605,8 @@ export class CalendarPrevButtonState {
|
|
|
605
605
|
role: "button",
|
|
606
606
|
type: "button",
|
|
607
607
|
"aria-label": "Previous",
|
|
608
|
-
"aria-disabled":
|
|
609
|
-
"data-disabled":
|
|
608
|
+
"aria-disabled": boolToStr(this.isDisabled),
|
|
609
|
+
"data-disabled": boolToEmptyStrOrUndef(this.isDisabled),
|
|
610
610
|
disabled: this.isDisabled,
|
|
611
611
|
[this.root.getBitsAttr("prev-button")]: "",
|
|
612
612
|
//
|
|
@@ -630,10 +630,10 @@ export class CalendarGridState {
|
|
|
630
630
|
id: this.opts.id.current,
|
|
631
631
|
tabindex: -1,
|
|
632
632
|
role: "grid",
|
|
633
|
-
"aria-readonly":
|
|
634
|
-
"aria-disabled":
|
|
635
|
-
"data-readonly":
|
|
636
|
-
"data-disabled":
|
|
633
|
+
"aria-readonly": boolToStr(this.root.opts.readonly.current),
|
|
634
|
+
"aria-disabled": boolToStr(this.root.opts.disabled.current),
|
|
635
|
+
"data-readonly": boolToEmptyStrOrUndef(this.root.opts.readonly.current),
|
|
636
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
637
637
|
[this.root.getBitsAttr("grid")]: "",
|
|
638
638
|
...this.attachment,
|
|
639
639
|
}));
|
|
@@ -652,8 +652,8 @@ export class CalendarGridBodyState {
|
|
|
652
652
|
}
|
|
653
653
|
props = $derived.by(() => ({
|
|
654
654
|
id: this.opts.id.current,
|
|
655
|
-
"data-disabled":
|
|
656
|
-
"data-readonly":
|
|
655
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
656
|
+
"data-readonly": boolToEmptyStrOrUndef(this.root.opts.readonly.current),
|
|
657
657
|
[this.root.getBitsAttr("grid-body")]: "",
|
|
658
658
|
...this.attachment,
|
|
659
659
|
}));
|
|
@@ -672,8 +672,8 @@ export class CalendarGridHeadState {
|
|
|
672
672
|
}
|
|
673
673
|
props = $derived.by(() => ({
|
|
674
674
|
id: this.opts.id.current,
|
|
675
|
-
"data-disabled":
|
|
676
|
-
"data-readonly":
|
|
675
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
676
|
+
"data-readonly": boolToEmptyStrOrUndef(this.root.opts.readonly.current),
|
|
677
677
|
[this.root.getBitsAttr("grid-head")]: "",
|
|
678
678
|
...this.attachment,
|
|
679
679
|
}));
|
|
@@ -692,8 +692,8 @@ export class CalendarGridRowState {
|
|
|
692
692
|
}
|
|
693
693
|
props = $derived.by(() => ({
|
|
694
694
|
id: this.opts.id.current,
|
|
695
|
-
"data-disabled":
|
|
696
|
-
"data-readonly":
|
|
695
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
696
|
+
"data-readonly": boolToEmptyStrOrUndef(this.root.opts.readonly.current),
|
|
697
697
|
[this.root.getBitsAttr("grid-row")]: "",
|
|
698
698
|
...this.attachment,
|
|
699
699
|
}));
|
|
@@ -712,8 +712,8 @@ export class CalendarHeadCellState {
|
|
|
712
712
|
}
|
|
713
713
|
props = $derived.by(() => ({
|
|
714
714
|
id: this.opts.id.current,
|
|
715
|
-
"data-disabled":
|
|
716
|
-
"data-readonly":
|
|
715
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
716
|
+
"data-readonly": boolToEmptyStrOrUndef(this.root.opts.readonly.current),
|
|
717
717
|
[this.root.getBitsAttr("head-cell")]: "",
|
|
718
718
|
...this.attachment,
|
|
719
719
|
}));
|
|
@@ -732,8 +732,8 @@ export class CalendarHeaderState {
|
|
|
732
732
|
}
|
|
733
733
|
props = $derived.by(() => ({
|
|
734
734
|
id: this.opts.id.current,
|
|
735
|
-
"data-disabled":
|
|
736
|
-
"data-readonly":
|
|
735
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
736
|
+
"data-readonly": boolToEmptyStrOrUndef(this.root.opts.readonly.current),
|
|
737
737
|
[this.root.getBitsAttr("header")]: "",
|
|
738
738
|
...this.attachment,
|
|
739
739
|
}));
|
|
@@ -794,7 +794,7 @@ export class CalendarMonthSelectState {
|
|
|
794
794
|
id: this.opts.id.current,
|
|
795
795
|
value: this.currentMonth,
|
|
796
796
|
disabled: this.isDisabled,
|
|
797
|
-
"data-disabled":
|
|
797
|
+
"data-disabled": boolToEmptyStrOrUndef(this.isDisabled),
|
|
798
798
|
[this.root.getBitsAttr("month-select")]: "",
|
|
799
799
|
//
|
|
800
800
|
onchange: this.onchange,
|
|
@@ -861,7 +861,7 @@ export class CalendarYearSelectState {
|
|
|
861
861
|
id: this.opts.id.current,
|
|
862
862
|
value: this.currentYear,
|
|
863
863
|
disabled: this.isDisabled,
|
|
864
|
-
"data-disabled":
|
|
864
|
+
"data-disabled": boolToEmptyStrOrUndef(this.isDisabled),
|
|
865
865
|
[this.root.getBitsAttr("year-select")]: "",
|
|
866
866
|
//
|
|
867
867
|
onchange: this.onchange,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { CalendarCellState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarCellProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
}: CalendarCellProps = $props();
|
|
18
18
|
|
|
19
19
|
const cellState = CalendarCellState.create({
|
|
20
|
-
id:
|
|
21
|
-
ref:
|
|
20
|
+
id: boxWith(() => id),
|
|
21
|
+
ref: boxWith(
|
|
22
22
|
() => ref,
|
|
23
23
|
(v) => (ref = v)
|
|
24
24
|
),
|
|
25
|
-
date:
|
|
26
|
-
month:
|
|
25
|
+
date: boxWith(() => date),
|
|
26
|
+
month: boxWith(() => month),
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const mergedProps = $derived(mergeProps(restProps, cellState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { CalendarDayState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarDayProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CalendarDayProps = $props();
|
|
16
16
|
|
|
17
17
|
const dayState = CalendarDayState.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 { CalendarGridBodyProps } from "../types.js";
|
|
4
4
|
import { CalendarGridBodyState } from "../calendar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CalendarGridBodyProps = $props();
|
|
16
16
|
|
|
17
17
|
const gridBodyState = CalendarGridBodyState.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 { CalendarGridHeadState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarGridHeadProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CalendarGridHeadProps = $props();
|
|
16
16
|
|
|
17
17
|
const gridHeadState = CalendarGridHeadState.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 { CalendarGridRowState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarGridRowProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CalendarGridRowProps = $props();
|
|
16
16
|
|
|
17
17
|
const gridRowState = CalendarGridRowState.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 { CalendarGridState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarGridProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CalendarGridProps = $props();
|
|
16
16
|
|
|
17
17
|
const gridState = CalendarGridState.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 { CalendarHeadCellState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarHeadCellProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CalendarHeadCellProps = $props();
|
|
16
16
|
|
|
17
17
|
const headCellState = CalendarHeadCellState.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 { CalendarHeaderState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarHeaderProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CalendarHeaderProps = $props();
|
|
16
16
|
|
|
17
17
|
const headerState = CalendarHeaderState.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 { CalendarHeadingProps } from "../types.js";
|
|
4
4
|
import { CalendarHeadingState } from "../calendar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CalendarHeadingProps = $props();
|
|
16
16
|
|
|
17
17
|
const headingState = CalendarHeadingState.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 { CalendarMonthSelectProps } from "../types.js";
|
|
4
4
|
import { CalendarMonthSelectState } from "../calendar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
}: CalendarMonthSelectProps = $props();
|
|
20
20
|
|
|
21
21
|
const monthSelectState = CalendarMonthSelectState.create({
|
|
22
|
-
id:
|
|
23
|
-
ref:
|
|
22
|
+
id: boxWith(() => id),
|
|
23
|
+
ref: boxWith(
|
|
24
24
|
() => ref,
|
|
25
25
|
(v) => (ref = v)
|
|
26
26
|
),
|
|
27
|
-
months:
|
|
28
|
-
monthFormat:
|
|
29
|
-
disabled:
|
|
27
|
+
months: boxWith(() => months),
|
|
28
|
+
monthFormat: boxWith(() => monthFormat),
|
|
29
|
+
disabled: boxWith(() => Boolean(disabled)),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
const mergedProps = $derived(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { CalendarNextButtonState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarNextButtonProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
}: CalendarNextButtonProps = $props();
|
|
18
18
|
|
|
19
19
|
const nextButtonState = CalendarNextButtonState.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 { CalendarPrevButtonProps } from "../types.js";
|
|
4
4
|
import { CalendarPrevButtonState } from "../calendar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
}: CalendarPrevButtonProps = $props();
|
|
18
18
|
|
|
19
19
|
const prevButtonState = CalendarPrevButtonState.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 { CalendarYearSelectProps } from "../types.js";
|
|
4
4
|
import { CalendarYearSelectState } from "../calendar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
}: CalendarYearSelectProps = $props();
|
|
20
20
|
|
|
21
21
|
const yearSelectState = CalendarYearSelectState.create({
|
|
22
|
-
id:
|
|
23
|
-
ref:
|
|
22
|
+
id: boxWith(() => id),
|
|
23
|
+
ref: boxWith(
|
|
24
24
|
() => ref,
|
|
25
25
|
(v) => (ref = v)
|
|
26
26
|
),
|
|
27
|
-
years:
|
|
28
|
-
yearFormat:
|
|
29
|
-
disabled:
|
|
27
|
+
years: boxWith(() => years),
|
|
28
|
+
yearFormat: boxWith(() => yearFormat),
|
|
29
|
+
disabled: boxWith(() => Boolean(disabled)),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
const mergedProps = $derived(
|
|
@@ -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 { CalendarRootState } from "../calendar.svelte.js";
|
|
6
6
|
import type { CalendarRootProps } from "../types.js";
|
|
@@ -76,36 +76,36 @@
|
|
|
76
76
|
);
|
|
77
77
|
|
|
78
78
|
const rootState = CalendarRootState.create({
|
|
79
|
-
id:
|
|
80
|
-
ref:
|
|
79
|
+
id: boxWith(() => id),
|
|
80
|
+
ref: boxWith(
|
|
81
81
|
() => ref,
|
|
82
82
|
(v) => (ref = v)
|
|
83
83
|
),
|
|
84
|
-
weekdayFormat:
|
|
85
|
-
weekStartsOn:
|
|
86
|
-
pagedNavigation:
|
|
87
|
-
isDateDisabled:
|
|
88
|
-
isDateUnavailable:
|
|
89
|
-
fixedWeeks:
|
|
90
|
-
numberOfMonths:
|
|
84
|
+
weekdayFormat: boxWith(() => weekdayFormat),
|
|
85
|
+
weekStartsOn: boxWith(() => weekStartsOn),
|
|
86
|
+
pagedNavigation: boxWith(() => pagedNavigation),
|
|
87
|
+
isDateDisabled: boxWith(() => isDateDisabled),
|
|
88
|
+
isDateUnavailable: boxWith(() => isDateUnavailable),
|
|
89
|
+
fixedWeeks: boxWith(() => fixedWeeks),
|
|
90
|
+
numberOfMonths: boxWith(() => numberOfMonths),
|
|
91
91
|
locale: resolveLocaleProp(() => locale),
|
|
92
|
-
calendarLabel:
|
|
93
|
-
readonly:
|
|
94
|
-
disabled:
|
|
95
|
-
minValue:
|
|
96
|
-
maxValue:
|
|
97
|
-
disableDaysOutsideMonth:
|
|
98
|
-
initialFocus:
|
|
99
|
-
maxDays:
|
|
100
|
-
placeholder:
|
|
92
|
+
calendarLabel: boxWith(() => calendarLabel),
|
|
93
|
+
readonly: boxWith(() => readonly),
|
|
94
|
+
disabled: boxWith(() => disabled),
|
|
95
|
+
minValue: boxWith(() => minValue),
|
|
96
|
+
maxValue: boxWith(() => maxValue),
|
|
97
|
+
disableDaysOutsideMonth: boxWith(() => disableDaysOutsideMonth),
|
|
98
|
+
initialFocus: boxWith(() => initialFocus),
|
|
99
|
+
maxDays: boxWith(() => maxDays),
|
|
100
|
+
placeholder: boxWith(
|
|
101
101
|
() => placeholder as DateValue,
|
|
102
102
|
(v) => {
|
|
103
103
|
placeholder = v;
|
|
104
104
|
onPlaceholderChange(v as DateValue);
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
preventDeselect:
|
|
108
|
-
value:
|
|
107
|
+
preventDeselect: boxWith(() => preventDeselect),
|
|
108
|
+
value: boxWith(
|
|
109
109
|
() => value,
|
|
110
110
|
(v) => {
|
|
111
111
|
value = v;
|
|
@@ -113,9 +113,9 @@
|
|
|
113
113
|
onValueChange(v as any);
|
|
114
114
|
}
|
|
115
115
|
),
|
|
116
|
-
type:
|
|
117
|
-
monthFormat:
|
|
118
|
-
yearFormat:
|
|
116
|
+
type: boxWith(() => type),
|
|
117
|
+
monthFormat: boxWith(() => monthFormat),
|
|
118
|
+
yearFormat: boxWith(() => yearFormat),
|
|
119
119
|
defaultPlaceholder,
|
|
120
120
|
});
|
|
121
121
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CalendarRootProps } from "../types.js";
|
|
2
|
-
declare const Calendar: import("svelte").Component<CalendarRootProps, {}, "
|
|
2
|
+
declare const Calendar: import("svelte").Component<CalendarRootProps, {}, "ref" | "value" | "placeholder">;
|
|
3
3
|
type Calendar = ReturnType<typeof Calendar>;
|
|
4
4
|
export default Calendar;
|
|
@@ -73,7 +73,7 @@ export declare class CheckboxRootState {
|
|
|
73
73
|
readonly props: {
|
|
74
74
|
readonly id: string;
|
|
75
75
|
readonly role: "checkbox";
|
|
76
|
-
readonly type: "
|
|
76
|
+
readonly type: "reset" | "submit" | "button" | null | undefined;
|
|
77
77
|
readonly disabled: boolean;
|
|
78
78
|
readonly "aria-checked": "true" | "false" | "mixed";
|
|
79
79
|
readonly "aria-required": "true" | "false";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { attachRef } from "svelte-toolbelt";
|
|
2
2
|
import { Context, watch } from "runed";
|
|
3
|
-
import { createBitsAttrs, getAriaChecked,
|
|
3
|
+
import { boolToStr, createBitsAttrs, getAriaChecked, boolToEmptyStrOrUndef, } from "../../internal/attrs.js";
|
|
4
4
|
import { kbd } from "../../internal/kbd.js";
|
|
5
5
|
import { arraysAreEqual } from "../../internal/arrays.js";
|
|
6
6
|
import { isHTMLElement } from "../../internal/is.js";
|
|
@@ -47,7 +47,7 @@ export class CheckboxGroupState {
|
|
|
47
47
|
id: this.opts.id.current,
|
|
48
48
|
role: "group",
|
|
49
49
|
"aria-labelledby": this.labelId,
|
|
50
|
-
"data-disabled":
|
|
50
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
51
51
|
[checkboxAttrs.group]: "",
|
|
52
52
|
...this.attachment,
|
|
53
53
|
}));
|
|
@@ -70,7 +70,7 @@ export class CheckboxGroupLabelState {
|
|
|
70
70
|
}
|
|
71
71
|
props = $derived.by(() => ({
|
|
72
72
|
id: this.opts.id.current,
|
|
73
|
-
"data-disabled":
|
|
73
|
+
"data-disabled": boolToEmptyStrOrUndef(this.group.opts.disabled.current),
|
|
74
74
|
[checkboxAttrs["group-label"]]: "",
|
|
75
75
|
...this.attachment,
|
|
76
76
|
}));
|
|
@@ -164,10 +164,10 @@ export class CheckboxRootState {
|
|
|
164
164
|
type: this.opts.type.current,
|
|
165
165
|
disabled: this.trueDisabled,
|
|
166
166
|
"aria-checked": getAriaChecked(this.opts.checked.current, this.opts.indeterminate.current),
|
|
167
|
-
"aria-required":
|
|
168
|
-
"aria-readonly":
|
|
169
|
-
"data-disabled":
|
|
170
|
-
"data-readonly":
|
|
167
|
+
"aria-required": boolToStr(this.trueRequired),
|
|
168
|
+
"aria-readonly": boolToStr(this.trueReadonly),
|
|
169
|
+
"data-disabled": boolToEmptyStrOrUndef(this.trueDisabled),
|
|
170
|
+
"data-readonly": boolToEmptyStrOrUndef(this.trueReadonly),
|
|
171
171
|
"data-state": getCheckboxDataState(this.opts.checked.current, this.opts.indeterminate.current),
|
|
172
172
|
[checkboxAttrs.root]: "",
|
|
173
173
|
//
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CheckboxGroupLabelProps } from "../types.js";
|
|
4
4
|
import { CheckboxGroupLabelState } from "../checkbox.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: CheckboxGroupLabelProps = $props();
|
|
16
16
|
|
|
17
17
|
const labelState = CheckboxGroupLabelState.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 { CheckboxGroupProps } from "../types.js";
|
|
4
4
|
import { CheckboxGroupState } from "../checkbox.svelte.js";
|
|
5
5
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
}: CheckboxGroupProps = $props();
|
|
24
24
|
|
|
25
25
|
const groupState = CheckboxGroupState.create({
|
|
26
|
-
id:
|
|
27
|
-
ref:
|
|
26
|
+
id: boxWith(() => id),
|
|
27
|
+
ref: boxWith(
|
|
28
28
|
() => ref,
|
|
29
29
|
(v) => (ref = v)
|
|
30
30
|
),
|
|
31
|
-
disabled:
|
|
32
|
-
required:
|
|
33
|
-
readonly:
|
|
34
|
-
name:
|
|
35
|
-
value:
|
|
31
|
+
disabled: boxWith(() => Boolean(disabled)),
|
|
32
|
+
required: boxWith(() => Boolean(required)),
|
|
33
|
+
readonly: boxWith(() => Boolean(readonly)),
|
|
34
|
+
name: boxWith(() => name),
|
|
35
|
+
value: boxWith(
|
|
36
36
|
() => $state.snapshot(value),
|
|
37
37
|
(v) => {
|
|
38
38
|
if (arraysAreEqual(value, v)) return;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
onValueChange(v);
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
|
-
onValueChange:
|
|
43
|
+
onValueChange: boxWith(() => onValueChange),
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
const mergedProps = $derived(mergeProps(restProps, groupState.props));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CheckboxGroupProps } from "../types.js";
|
|
2
|
-
declare const CheckboxGroup: import("svelte").Component<CheckboxGroupProps, {}, "
|
|
2
|
+
declare const CheckboxGroup: import("svelte").Component<CheckboxGroupProps, {}, "ref" | "value">;
|
|
3
3
|
type CheckboxGroup = ReturnType<typeof CheckboxGroup>;
|
|
4
4
|
export default CheckboxGroup;
|