bits-ui 1.7.0 → 2.1.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 +56 -53
- package/dist/bits/accordion/accordion.svelte.js +78 -89
- package/dist/bits/accordion/components/accordion-content.svelte +5 -3
- package/dist/bits/accordion/components/accordion-header.svelte +4 -2
- package/dist/bits/accordion/components/accordion-item.svelte +6 -3
- package/dist/bits/accordion/components/accordion-trigger.svelte +4 -2
- package/dist/bits/accordion/components/accordion.svelte +4 -2
- package/dist/bits/alert-dialog/components/alert-dialog-action.svelte +4 -2
- package/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte +4 -2
- package/dist/bits/alert-dialog/components/alert-dialog-content.svelte +8 -3
- package/dist/bits/aspect-ratio/aspect-ratio.svelte.js +2 -2
- package/dist/bits/aspect-ratio/components/aspect-ratio.svelte +4 -2
- package/dist/bits/avatar/avatar.svelte.js +4 -4
- package/dist/bits/avatar/components/avatar-fallback.svelte +4 -2
- package/dist/bits/avatar/components/avatar-image.svelte +4 -2
- package/dist/bits/avatar/components/avatar.svelte +4 -2
- package/dist/bits/button/components/button.svelte +1 -1
- package/dist/bits/calendar/calendar.svelte.d.ts +1 -9
- package/dist/bits/calendar/calendar.svelte.js +47 -38
- package/dist/bits/calendar/components/calendar-cell.svelte +4 -2
- package/dist/bits/calendar/components/calendar-day.svelte +4 -2
- package/dist/bits/calendar/components/calendar-grid-body.svelte +4 -2
- package/dist/bits/calendar/components/calendar-grid-head.svelte +4 -2
- package/dist/bits/calendar/components/calendar-grid-row.svelte +4 -2
- package/dist/bits/calendar/components/calendar-grid.svelte +4 -2
- package/dist/bits/calendar/components/calendar-head-cell.svelte +4 -2
- package/dist/bits/calendar/components/calendar-header.svelte +4 -2
- package/dist/bits/calendar/components/calendar-heading.svelte +4 -2
- package/dist/bits/calendar/components/calendar-next-button.svelte +4 -2
- package/dist/bits/calendar/components/calendar-prev-button.svelte +4 -2
- package/dist/bits/checkbox/checkbox.svelte.js +4 -14
- package/dist/bits/checkbox/components/checkbox-group-label.svelte +4 -2
- package/dist/bits/checkbox/components/checkbox-group.svelte +4 -2
- package/dist/bits/checkbox/components/checkbox.svelte +4 -2
- package/dist/bits/collapsible/collapsible.svelte.js +4 -10
- package/dist/bits/collapsible/components/collapsible-content.svelte +5 -3
- package/dist/bits/collapsible/components/collapsible-trigger.svelte +4 -2
- package/dist/bits/collapsible/components/collapsible.svelte +4 -2
- package/dist/bits/combobox/components/combobox-input.svelte +1 -1
- package/dist/bits/combobox/components/combobox.svelte +1 -1
- package/dist/bits/command/command.svelte.js +13 -45
- package/dist/bits/command/components/_command-label.svelte +6 -7
- package/dist/bits/command/components/_command-label.svelte.d.ts +1 -1
- package/dist/bits/command/components/command-empty.svelte +4 -2
- package/dist/bits/command/components/command-group-heading.svelte +4 -2
- package/dist/bits/command/components/command-group-items.svelte +4 -2
- package/dist/bits/command/components/command-group.svelte +4 -2
- package/dist/bits/command/components/command-input.svelte +4 -2
- package/dist/bits/command/components/command-item.svelte +4 -2
- package/dist/bits/command/components/command-link-item.svelte +4 -2
- package/dist/bits/command/components/command-list.svelte +4 -2
- package/dist/bits/command/components/command-loading.svelte +4 -2
- package/dist/bits/command/components/command-separator.svelte +4 -2
- package/dist/bits/command/components/command-viewport.svelte +4 -2
- package/dist/bits/command/components/command.svelte +4 -2
- package/dist/bits/context-menu/components/context-menu-content-static.svelte +2 -3
- package/dist/bits/context-menu/components/context-menu-content.svelte +2 -3
- package/dist/bits/context-menu/components/context-menu-trigger.svelte +1 -1
- package/dist/bits/date-field/components/date-field-input.svelte +4 -2
- package/dist/bits/date-field/components/date-field-label.svelte +4 -2
- package/dist/bits/date-field/components/date-field-segment.svelte +4 -2
- package/dist/bits/date-field/date-field.svelte.d.ts +4 -4
- package/dist/bits/date-field/date-field.svelte.js +15 -33
- package/dist/bits/date-picker/components/date-picker-calendar.svelte +4 -2
- package/dist/bits/date-range-field/components/date-range-field-input.svelte +4 -2
- package/dist/bits/date-range-field/components/date-range-field-label.svelte +4 -2
- package/dist/bits/date-range-field/components/date-range-field.svelte +4 -2
- package/dist/bits/date-range-field/date-range-field.svelte.js +3 -13
- package/dist/bits/date-range-picker/components/date-range-picker-calendar.svelte +4 -2
- package/dist/bits/dialog/components/dialog-close.svelte +4 -2
- package/dist/bits/dialog/components/dialog-content.svelte +8 -2
- package/dist/bits/dialog/components/dialog-description.svelte +4 -2
- package/dist/bits/dialog/components/dialog-overlay.svelte +8 -3
- package/dist/bits/dialog/components/dialog-title.svelte +4 -2
- package/dist/bits/dialog/components/dialog-trigger.svelte +4 -2
- package/dist/bits/dialog/dialog.svelte.d.ts +1 -1
- package/dist/bits/dialog/dialog.svelte.js +19 -47
- package/dist/bits/dropdown-menu/components/dropdown-menu-content-static.svelte +6 -5
- package/dist/bits/dropdown-menu/components/dropdown-menu-content.svelte +6 -5
- package/dist/bits/index.d.ts +2 -0
- package/dist/bits/index.js +2 -0
- package/dist/bits/label/components/label.svelte +4 -2
- package/dist/bits/label/label.svelte.js +2 -2
- package/dist/bits/link-preview/components/link-preview-content-static.svelte +6 -2
- package/dist/bits/link-preview/components/link-preview-content.svelte +6 -2
- package/dist/bits/link-preview/components/link-preview-trigger.svelte +5 -3
- package/dist/bits/link-preview/link-preview.svelte.js +3 -14
- package/dist/bits/menu/components/menu-checkbox-group.svelte +4 -2
- package/dist/bits/menu/components/menu-checkbox-item.svelte +6 -4
- package/dist/bits/menu/components/menu-content-static.svelte +6 -5
- package/dist/bits/menu/components/menu-content.svelte +6 -5
- package/dist/bits/menu/components/menu-group-heading.svelte +4 -2
- package/dist/bits/menu/components/menu-group.svelte +4 -2
- package/dist/bits/menu/components/menu-item.svelte +4 -2
- package/dist/bits/menu/components/menu-radio-group.svelte +4 -2
- package/dist/bits/menu/components/menu-radio-item.svelte +4 -2
- package/dist/bits/menu/components/menu-separator.svelte +4 -2
- package/dist/bits/menu/components/menu-sub-content-static.svelte +6 -5
- package/dist/bits/menu/components/menu-sub-content.svelte +6 -5
- package/dist/bits/menu/components/menu-sub-trigger.svelte +6 -3
- package/dist/bits/menu/components/menu-trigger.svelte +5 -3
- package/dist/bits/menu/menu.svelte.d.ts +7 -20
- package/dist/bits/menu/menu.svelte.js +26 -54
- package/dist/bits/menubar/components/menubar-content-static.svelte +4 -2
- package/dist/bits/menubar/components/menubar-content.svelte +4 -2
- package/dist/bits/menubar/components/menubar-menu.svelte +4 -2
- package/dist/bits/menubar/components/menubar-trigger.svelte +14 -6
- package/dist/bits/menubar/components/menubar.svelte +4 -2
- package/dist/bits/menubar/menubar.svelte.d.ts +24 -20
- package/dist/bits/menubar/menubar.svelte.js +40 -56
- package/dist/bits/meter/components/meter.svelte +4 -2
- package/dist/bits/meter/meter.svelte.js +2 -2
- package/dist/bits/navigation-menu/components/navigation-menu-content-impl.svelte +5 -2
- package/dist/bits/navigation-menu/components/navigation-menu-content.svelte +8 -3
- package/dist/bits/navigation-menu/components/navigation-menu-indicator-impl.svelte +4 -2
- package/dist/bits/navigation-menu/components/navigation-menu-indicator.svelte +6 -4
- package/dist/bits/navigation-menu/components/navigation-menu-item.svelte +8 -3
- package/dist/bits/navigation-menu/components/navigation-menu-link.svelte +4 -2
- package/dist/bits/navigation-menu/components/navigation-menu-list.svelte +4 -2
- package/dist/bits/navigation-menu/components/navigation-menu-sub.svelte +4 -2
- package/dist/bits/navigation-menu/components/navigation-menu-trigger.svelte +4 -2
- package/dist/bits/navigation-menu/components/navigation-menu-viewport.svelte +7 -3
- package/dist/bits/navigation-menu/components/navigation-menu.svelte +4 -2
- package/dist/bits/navigation-menu/navigation-menu.svelte.d.ts +29 -17
- package/dist/bits/navigation-menu/navigation-menu.svelte.js +107 -74
- package/dist/bits/navigation-menu/types.d.ts +14 -7
- package/dist/bits/pagination/components/pagination-next-button.svelte +4 -2
- package/dist/bits/pagination/components/pagination-page.svelte +4 -2
- package/dist/bits/pagination/components/pagination-prev-button.svelte +4 -2
- package/dist/bits/pagination/components/pagination.svelte +4 -2
- package/dist/bits/pagination/pagination.svelte.js +4 -4
- package/dist/bits/pin-input/components/pin-input-cell.svelte +4 -2
- package/dist/bits/pin-input/components/pin-input.svelte +5 -3
- package/dist/bits/pin-input/pin-input.svelte.js +4 -10
- package/dist/bits/popover/components/popover-close.svelte +4 -2
- package/dist/bits/popover/components/popover-content-static.svelte +6 -2
- package/dist/bits/popover/components/popover-content.svelte +6 -2
- package/dist/bits/popover/components/popover-trigger.svelte +5 -3
- package/dist/bits/popover/popover.svelte.js +4 -18
- package/dist/bits/progress/components/progress.svelte +4 -2
- package/dist/bits/progress/progress.svelte.js +2 -2
- package/dist/bits/radio-group/components/radio-group-item.svelte +4 -2
- package/dist/bits/radio-group/components/radio-group.svelte +4 -2
- package/dist/bits/radio-group/radio-group.svelte.js +4 -7
- package/dist/bits/range-calendar/components/range-calendar-cell.svelte +4 -2
- package/dist/bits/range-calendar/components/range-calendar-day.svelte +4 -2
- package/dist/bits/range-calendar/components/range-calendar.svelte +4 -2
- package/dist/bits/range-calendar/range-calendar.svelte.js +4 -4
- package/dist/bits/scroll-area/components/scroll-area-corner.svelte +8 -2
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-auto.svelte +4 -1
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-hover.svelte +1 -1
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-scroll.svelte +5 -1
- package/dist/bits/scroll-area/components/scroll-area-scrollbar.svelte +4 -2
- package/dist/bits/scroll-area/components/scroll-area-thumb.svelte +8 -3
- package/dist/bits/scroll-area/components/scroll-area-viewport.svelte +4 -2
- package/dist/bits/scroll-area/components/scroll-area.svelte +4 -2
- package/dist/bits/scroll-area/scroll-area.svelte.js +13 -47
- package/dist/bits/select/components/select-content-static.svelte +6 -2
- package/dist/bits/select/components/select-content.svelte +6 -2
- package/dist/bits/select/components/select-group-heading.svelte +3 -2
- package/dist/bits/select/components/select-group.svelte +4 -2
- package/dist/bits/select/components/select-item.svelte +4 -2
- package/dist/bits/select/components/select-scroll-down-button.svelte +4 -2
- package/dist/bits/select/components/select-scroll-up-button.svelte +4 -2
- package/dist/bits/select/components/select-trigger.svelte +5 -3
- package/dist/bits/select/components/select-viewport.svelte +4 -2
- package/dist/bits/select/components/select.svelte +1 -1
- package/dist/bits/select/select.svelte.d.ts +0 -18
- package/dist/bits/select/select.svelte.js +10 -43
- package/dist/bits/separator/components/separator.svelte +4 -2
- package/dist/bits/separator/separator.svelte.js +2 -2
- package/dist/bits/slider/components/slider-range.svelte +4 -2
- package/dist/bits/slider/components/slider-thumb-label.svelte +50 -0
- package/dist/bits/slider/components/slider-thumb-label.svelte.d.ts +4 -0
- package/dist/bits/slider/components/slider-thumb.svelte +4 -2
- package/dist/bits/slider/components/slider-tick-label.svelte +50 -0
- package/dist/bits/slider/components/slider-tick-label.svelte.d.ts +4 -0
- package/dist/bits/slider/components/slider-tick.svelte +4 -2
- package/dist/bits/slider/components/slider.svelte +26 -5
- package/dist/bits/slider/exports.d.ts +3 -1
- package/dist/bits/slider/exports.js +2 -0
- package/dist/bits/slider/helpers.d.ts +14 -0
- package/dist/bits/slider/helpers.js +122 -0
- package/dist/bits/slider/slider.svelte.d.ts +93 -6
- package/dist/bits/slider/slider.svelte.js +198 -101
- package/dist/bits/slider/types.d.ts +111 -11
- package/dist/bits/switch/components/switch-thumb.svelte +4 -2
- package/dist/bits/switch/components/switch.svelte +4 -2
- package/dist/bits/switch/switch.svelte.js +3 -3
- package/dist/bits/tabs/components/tabs-content.svelte +4 -2
- package/dist/bits/tabs/components/tabs-list.svelte +4 -2
- package/dist/bits/tabs/components/tabs-trigger.svelte +4 -2
- package/dist/bits/tabs/components/tabs.svelte +4 -2
- package/dist/bits/tabs/tabs.svelte.js +6 -6
- package/dist/bits/time-field/components/time-field-hidden-input.svelte +10 -0
- package/dist/bits/{date-field/components/date-field-error.svelte.d.ts → time-field/components/time-field-hidden-input.svelte.d.ts} +6 -14
- package/dist/bits/time-field/components/time-field-input.svelte +39 -0
- package/dist/bits/time-field/components/time-field-input.svelte.d.ts +4 -0
- package/dist/bits/time-field/components/time-field-label.svelte +34 -0
- package/dist/bits/time-field/components/time-field-label.svelte.d.ts +4 -0
- package/dist/bits/time-field/components/time-field-segment.svelte +37 -0
- package/dist/bits/time-field/components/time-field-segment.svelte.d.ts +4 -0
- package/dist/bits/time-field/components/time-field.svelte +94 -0
- package/dist/bits/time-field/components/time-field.svelte.d.ts +20 -0
- package/dist/bits/time-field/exports.d.ts +5 -0
- package/dist/bits/time-field/exports.js +4 -0
- package/dist/bits/time-field/index.d.ts +1 -0
- package/dist/bits/time-field/index.js +1 -0
- package/dist/bits/time-field/time-field.svelte.d.ts +415 -0
- package/dist/bits/time-field/time-field.svelte.js +971 -0
- package/dist/bits/time-field/types.d.ts +137 -0
- package/dist/bits/time-field/types.js +1 -0
- package/dist/bits/time-range-field/components/time-range-field-input.svelte +43 -0
- package/dist/bits/time-range-field/components/time-range-field-input.svelte.d.ts +4 -0
- package/dist/bits/time-range-field/components/time-range-field-label.svelte +34 -0
- package/dist/bits/time-range-field/components/time-range-field-label.svelte.d.ts +4 -0
- package/dist/bits/time-range-field/components/time-range-field.svelte +144 -0
- package/dist/bits/time-range-field/components/time-range-field.svelte.d.ts +20 -0
- package/dist/bits/time-range-field/exports.d.ts +5 -0
- package/dist/bits/time-range-field/exports.js +4 -0
- package/dist/bits/time-range-field/index.d.ts +1 -0
- package/dist/bits/time-range-field/index.js +1 -0
- package/dist/bits/time-range-field/time-range-field.svelte.d.ts +90 -0
- package/dist/bits/time-range-field/time-range-field.svelte.js +210 -0
- package/dist/bits/time-range-field/types.d.ts +150 -0
- package/dist/bits/time-range-field/types.js +1 -0
- package/dist/bits/toggle/components/toggle.svelte +4 -2
- package/dist/bits/toggle/toggle.svelte.js +2 -2
- package/dist/bits/toggle-group/components/toggle-group-item.svelte +4 -2
- package/dist/bits/toggle-group/components/toggle-group.svelte +4 -2
- package/dist/bits/toggle-group/toggle-group.svelte.js +4 -4
- package/dist/bits/toolbar/components/toolbar-button.svelte +4 -2
- package/dist/bits/toolbar/components/toolbar-group-item.svelte +4 -2
- package/dist/bits/toolbar/components/toolbar-group.svelte +4 -2
- package/dist/bits/toolbar/components/toolbar-link.svelte +4 -2
- package/dist/bits/toolbar/components/toolbar.svelte +4 -2
- package/dist/bits/toolbar/toolbar.svelte.js +7 -7
- package/dist/bits/tooltip/components/tooltip-content-static.svelte +6 -2
- package/dist/bits/tooltip/components/tooltip-content.svelte +6 -2
- package/dist/bits/tooltip/components/tooltip-trigger.svelte +5 -3
- package/dist/bits/tooltip/tooltip.svelte.js +3 -14
- package/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte +2 -0
- package/dist/bits/utilities/dismissible-layer/types.d.ts +2 -0
- package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.d.ts +3 -3
- package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js +16 -25
- package/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte +2 -1
- package/dist/bits/utilities/floating-layer/types.d.ts +1 -0
- package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.d.ts +3 -2
- package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js +5 -26
- package/dist/bits/utilities/focus-scope/focus-scope.svelte +2 -0
- package/dist/bits/utilities/focus-scope/types.d.ts +2 -0
- package/dist/bits/utilities/focus-scope/use-focus-scope.svelte.d.ts +2 -1
- package/dist/bits/utilities/focus-scope/use-focus-scope.svelte.js +2 -8
- package/dist/bits/utilities/popper-layer/popper-layer-inner.svelte +4 -0
- package/dist/bits/utilities/popper-layer/popper-layer.svelte +3 -1
- package/dist/bits/utilities/presence-layer/presence-layer.svelte +2 -2
- package/dist/bits/utilities/presence-layer/types.d.ts +2 -1
- package/dist/bits/utilities/presence-layer/use-presence.svelte.d.ts +1 -1
- package/dist/bits/utilities/presence-layer/use-presence.svelte.js +19 -36
- package/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte +2 -0
- package/dist/bits/utilities/text-selection-layer/types.d.ts +2 -0
- package/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.d.ts +3 -1
- package/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.js +2 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/create-id.d.ts +8 -0
- package/dist/internal/create-id.js +5 -0
- package/dist/internal/date-time/field/helpers.d.ts +1 -0
- package/dist/internal/date-time/field/helpers.js +8 -2
- package/dist/internal/date-time/field/parts.d.ts +3 -1
- package/dist/internal/date-time/field/parts.js +10 -2
- package/dist/internal/date-time/field/segments.d.ts +9 -0
- package/dist/internal/date-time/field/segments.js +65 -0
- package/dist/internal/date-time/field/time-helpers.d.ts +77 -0
- package/dist/internal/date-time/field/time-helpers.js +301 -0
- package/dist/internal/date-time/field/types.d.ts +2 -2
- package/dist/internal/date-time/formatter.d.ts +11 -1
- package/dist/internal/date-time/formatter.js +56 -0
- package/dist/internal/date-time/utils.d.ts +7 -2
- package/dist/internal/date-time/utils.js +15 -1
- package/dist/internal/dom-context.svelte.d.ts +9 -0
- package/dist/internal/dom-context.svelte.js +26 -0
- package/dist/internal/use-roving-focus.svelte.d.ts +3 -3
- package/dist/internal/use-roving-focus.svelte.js +10 -11
- package/dist/shared/date/types.d.ts +27 -4
- package/dist/shared/index.d.ts +9 -2
- package/dist/types.d.ts +2 -0
- package/package.json +18 -16
- package/dist/bits/date-field/components/date-field-error.svelte +0 -0
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { AspectRatioRootProps } from "../types.js";
|
|
4
4
|
import { useAspectRatioRoot } from "../aspect-ratio.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
ref = $bindable(null),
|
|
9
|
-
id =
|
|
11
|
+
id = createId(uid),
|
|
10
12
|
ratio = 1,
|
|
11
13
|
children,
|
|
12
14
|
child,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { untrack } from "svelte";
|
|
2
|
-
import {
|
|
2
|
+
import { attachRef } from "svelte-toolbelt";
|
|
3
3
|
import { Context } from "runed";
|
|
4
4
|
const AVATAR_ROOT_ATTR = "data-avatar-root";
|
|
5
5
|
const AVATAR_IMAGE_ATTR = "data-avatar-image";
|
|
@@ -9,7 +9,6 @@ class AvatarRootState {
|
|
|
9
9
|
constructor(opts) {
|
|
10
10
|
this.opts = opts;
|
|
11
11
|
this.loadImage = this.loadImage.bind(this);
|
|
12
|
-
useRefById(opts);
|
|
13
12
|
}
|
|
14
13
|
loadImage(src, crossorigin, referrerPolicy) {
|
|
15
14
|
if (this.opts.loadingStatus.current === "loaded")
|
|
@@ -38,6 +37,7 @@ class AvatarRootState {
|
|
|
38
37
|
id: this.opts.id.current,
|
|
39
38
|
[AVATAR_ROOT_ATTR]: "",
|
|
40
39
|
"data-status": this.opts.loadingStatus.current,
|
|
40
|
+
...attachRef(this.opts.ref),
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
43
43
|
class AvatarImageState {
|
|
@@ -46,7 +46,6 @@ class AvatarImageState {
|
|
|
46
46
|
constructor(opts, root) {
|
|
47
47
|
this.opts = opts;
|
|
48
48
|
this.root = root;
|
|
49
|
-
useRefById(opts);
|
|
50
49
|
$effect.pre(() => {
|
|
51
50
|
if (!this.opts.src.current) {
|
|
52
51
|
this.root.opts.loadingStatus.current = "error";
|
|
@@ -67,6 +66,7 @@ class AvatarImageState {
|
|
|
67
66
|
src: this.opts.src.current,
|
|
68
67
|
crossorigin: this.opts.crossOrigin.current,
|
|
69
68
|
referrerpolicy: this.opts.referrerPolicy.current,
|
|
69
|
+
...attachRef(this.opts.ref),
|
|
70
70
|
}));
|
|
71
71
|
}
|
|
72
72
|
class AvatarFallbackState {
|
|
@@ -75,13 +75,13 @@ class AvatarFallbackState {
|
|
|
75
75
|
constructor(opts, root) {
|
|
76
76
|
this.opts = opts;
|
|
77
77
|
this.root = root;
|
|
78
|
-
useRefById(opts);
|
|
79
78
|
}
|
|
80
79
|
style = $derived.by(() => this.root.opts.loadingStatus.current === "loaded" ? { display: "none" } : undefined);
|
|
81
80
|
props = $derived.by(() => ({
|
|
82
81
|
style: this.style,
|
|
83
82
|
"data-status": this.root.opts.loadingStatus.current,
|
|
84
83
|
[AVATAR_FALLBACK_ATTR]: "",
|
|
84
|
+
...attachRef(this.opts.ref),
|
|
85
85
|
}));
|
|
86
86
|
}
|
|
87
87
|
const AvatarRootContext = new Context("Avatar.Root");
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { AvatarFallbackProps } from "../types.js";
|
|
4
4
|
import { useAvatarFallback } from "../avatar.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
|
-
id =
|
|
12
|
+
id = createId(uid),
|
|
11
13
|
ref = $bindable(null),
|
|
12
14
|
...restProps
|
|
13
15
|
}: AvatarFallbackProps = $props();
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { AvatarImageProps } from "../types.js";
|
|
4
4
|
import { useAvatarImage } from "../avatar.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
src,
|
|
9
11
|
child,
|
|
10
|
-
id =
|
|
12
|
+
id = createId(uid),
|
|
11
13
|
ref = $bindable(null),
|
|
12
14
|
crossorigin = undefined,
|
|
13
15
|
referrerpolicy = undefined,
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { AvatarRootProps } from "../types.js";
|
|
4
4
|
import { useAvatarRoot } from "../avatar.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
delayMs = 0,
|
|
@@ -10,7 +12,7 @@
|
|
|
10
12
|
onLoadingStatusChange,
|
|
11
13
|
child,
|
|
12
14
|
children,
|
|
13
|
-
id =
|
|
15
|
+
id = createId(uid),
|
|
14
16
|
ref = $bindable(null),
|
|
15
17
|
...restProps
|
|
16
18
|
}: AvatarRootProps = $props();
|
|
@@ -38,6 +38,7 @@ type CalendarRootStateProps = WithRefProps<WritableBoxedValues<{
|
|
|
38
38
|
defaultPlaceholder: DateValue;
|
|
39
39
|
}>;
|
|
40
40
|
export declare class CalendarRootState {
|
|
41
|
+
#private;
|
|
41
42
|
readonly opts: CalendarRootStateProps;
|
|
42
43
|
months: Month<DateValue>[];
|
|
43
44
|
visibleMonths: DateValue[];
|
|
@@ -101,7 +102,6 @@ export declare class CalendarHeadingState {
|
|
|
101
102
|
headingValue: string;
|
|
102
103
|
constructor(opts: CalendarHeadingStateProps, root: CalendarRootState | RangeCalendarRootState);
|
|
103
104
|
props: {
|
|
104
|
-
readonly [x: string]: string | undefined;
|
|
105
105
|
readonly id: string;
|
|
106
106
|
readonly "aria-hidden": "true" | undefined;
|
|
107
107
|
readonly "data-disabled": "" | undefined;
|
|
@@ -198,7 +198,6 @@ export declare class CalendarNextButtonState {
|
|
|
198
198
|
constructor(opts: CalendarNextButtonStateProps, root: CalendarRootState | RangeCalendarRootState);
|
|
199
199
|
onclick(_: BitsMouseEvent): void;
|
|
200
200
|
props: {
|
|
201
|
-
readonly [x: string]: string | boolean | ((_: BitsMouseEvent) => void) | undefined;
|
|
202
201
|
readonly id: string;
|
|
203
202
|
readonly role: "button";
|
|
204
203
|
readonly type: "button";
|
|
@@ -217,7 +216,6 @@ export declare class CalendarPrevButtonState {
|
|
|
217
216
|
constructor(opts: CalendarPrevButtonStateProps, root: CalendarRootState | RangeCalendarRootState);
|
|
218
217
|
onclick(_: BitsMouseEvent): void;
|
|
219
218
|
props: {
|
|
220
|
-
readonly [x: string]: string | boolean | ((_: BitsMouseEvent) => void) | undefined;
|
|
221
219
|
readonly id: string;
|
|
222
220
|
readonly role: "button";
|
|
223
221
|
readonly type: "button";
|
|
@@ -234,7 +232,6 @@ export declare class CalendarGridState {
|
|
|
234
232
|
readonly root: CalendarRootState | RangeCalendarRootState;
|
|
235
233
|
constructor(opts: CalendarGridStateProps, root: CalendarRootState | RangeCalendarRootState);
|
|
236
234
|
props: {
|
|
237
|
-
readonly [x: string]: string | -1 | undefined;
|
|
238
235
|
readonly id: string;
|
|
239
236
|
readonly tabindex: -1;
|
|
240
237
|
readonly role: "grid";
|
|
@@ -250,7 +247,6 @@ export declare class CalendarGridBodyState {
|
|
|
250
247
|
readonly root: CalendarRootState | RangeCalendarRootState;
|
|
251
248
|
constructor(opts: CalendarGridBodyStateProps, root: CalendarRootState | RangeCalendarRootState);
|
|
252
249
|
props: {
|
|
253
|
-
readonly [x: string]: string | undefined;
|
|
254
250
|
readonly id: string;
|
|
255
251
|
readonly "data-disabled": "" | undefined;
|
|
256
252
|
readonly "data-readonly": "" | undefined;
|
|
@@ -262,7 +258,6 @@ export declare class CalendarGridHeadState {
|
|
|
262
258
|
readonly root: CalendarRootState | RangeCalendarRootState;
|
|
263
259
|
constructor(opts: CalendarGridHeadStateProps, root: CalendarRootState | RangeCalendarRootState);
|
|
264
260
|
props: {
|
|
265
|
-
readonly [x: string]: string | undefined;
|
|
266
261
|
readonly id: string;
|
|
267
262
|
readonly "data-disabled": "" | undefined;
|
|
268
263
|
readonly "data-readonly": "" | undefined;
|
|
@@ -274,7 +269,6 @@ export declare class CalendarGridRowState {
|
|
|
274
269
|
readonly root: CalendarRootState | RangeCalendarRootState;
|
|
275
270
|
constructor(opts: CalendarGridRowStateProps, root: CalendarRootState | RangeCalendarRootState);
|
|
276
271
|
props: {
|
|
277
|
-
readonly [x: string]: string | undefined;
|
|
278
272
|
readonly id: string;
|
|
279
273
|
readonly "data-disabled": "" | undefined;
|
|
280
274
|
readonly "data-readonly": "" | undefined;
|
|
@@ -286,7 +280,6 @@ export declare class CalendarHeadCellState {
|
|
|
286
280
|
readonly root: CalendarRootState | RangeCalendarRootState;
|
|
287
281
|
constructor(opts: CalendarHeadCellStateProps, root: CalendarRootState | RangeCalendarRootState);
|
|
288
282
|
props: {
|
|
289
|
-
readonly [x: string]: string | undefined;
|
|
290
283
|
readonly id: string;
|
|
291
284
|
readonly "data-disabled": "" | undefined;
|
|
292
285
|
readonly "data-readonly": "" | undefined;
|
|
@@ -298,7 +291,6 @@ export declare class CalendarHeaderState {
|
|
|
298
291
|
readonly root: CalendarRootState | RangeCalendarRootState;
|
|
299
292
|
constructor(opts: CalendarHeaderStateProps, root: CalendarRootState | RangeCalendarRootState);
|
|
300
293
|
props: {
|
|
301
|
-
readonly [x: string]: string | undefined;
|
|
302
294
|
readonly id: string;
|
|
303
295
|
readonly "data-disabled": "" | undefined;
|
|
304
296
|
readonly "data-readonly": "" | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getLocalTimeZone, isSameDay, isSameMonth, isToday, } from "@internationalized/date";
|
|
2
2
|
import { DEV } from "esm-env";
|
|
3
3
|
import { untrack } from "svelte";
|
|
4
|
-
import {
|
|
4
|
+
import { attachRef } from "svelte-toolbelt";
|
|
5
5
|
import { Context, watch } from "runed";
|
|
6
6
|
import { getAriaDisabled, getAriaHidden, getAriaReadonly, getAriaSelected, getDataDisabled, getDataReadonly, getDataSelected, getDataUnavailable, } from "../../internal/attrs.js";
|
|
7
7
|
import { useId } from "../../internal/use-id.js";
|
|
@@ -36,7 +36,6 @@ export class CalendarRootState {
|
|
|
36
36
|
this.handleSingleUpdate = this.handleSingleUpdate.bind(this);
|
|
37
37
|
this.onkeydown = this.onkeydown.bind(this);
|
|
38
38
|
this.getBitsAttr = this.getBitsAttr.bind(this);
|
|
39
|
-
useRefById(opts);
|
|
40
39
|
this.months = createMonths({
|
|
41
40
|
dateObj: this.opts.placeholder.current,
|
|
42
41
|
weekStartsOn: this.opts.weekStartsOn.current,
|
|
@@ -44,31 +43,9 @@ export class CalendarRootState {
|
|
|
44
43
|
fixedWeeks: this.opts.fixedWeeks.current,
|
|
45
44
|
numberOfMonths: this.opts.numberOfMonths.current,
|
|
46
45
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// focus the first `data-focused` day node
|
|
51
|
-
const firstFocusedDay = this.opts.ref.current?.querySelector(`[data-focused]`);
|
|
52
|
-
if (firstFocusedDay) {
|
|
53
|
-
firstFocusedDay.focus();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
$effect(() => {
|
|
58
|
-
if (!this.opts.ref.current)
|
|
59
|
-
return;
|
|
60
|
-
const removeHeading = createAccessibleHeading({
|
|
61
|
-
calendarNode: this.opts.ref.current,
|
|
62
|
-
label: this.fullCalendarLabel,
|
|
63
|
-
accessibleHeadingId: this.accessibleHeadingId,
|
|
64
|
-
});
|
|
65
|
-
return removeHeading;
|
|
66
|
-
});
|
|
67
|
-
$effect(() => {
|
|
68
|
-
if (this.formatter.getLocale() === this.opts.locale.current)
|
|
69
|
-
return;
|
|
70
|
-
this.formatter.setLocale(this.opts.locale.current);
|
|
71
|
-
});
|
|
46
|
+
this.#setupInitialFocusEffect();
|
|
47
|
+
this.#setupAccessibleHeadingEffect();
|
|
48
|
+
this.#setupFormatterEffect();
|
|
72
49
|
/**
|
|
73
50
|
* Updates the displayed months based on changes in the placeholder value.
|
|
74
51
|
*/
|
|
@@ -146,6 +123,37 @@ export class CalendarRootState {
|
|
|
146
123
|
weekdayFormat: this.opts.weekdayFormat.current,
|
|
147
124
|
});
|
|
148
125
|
});
|
|
126
|
+
#setupInitialFocusEffect() {
|
|
127
|
+
$effect(() => {
|
|
128
|
+
const initialFocus = untrack(() => this.opts.initialFocus.current);
|
|
129
|
+
if (initialFocus) {
|
|
130
|
+
// focus the first `data-focused` day node
|
|
131
|
+
const firstFocusedDay = this.opts.ref.current?.querySelector(`[data-focused]`);
|
|
132
|
+
if (firstFocusedDay) {
|
|
133
|
+
firstFocusedDay.focus();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
#setupAccessibleHeadingEffect() {
|
|
139
|
+
$effect(() => {
|
|
140
|
+
if (!this.opts.ref.current)
|
|
141
|
+
return;
|
|
142
|
+
const removeHeading = createAccessibleHeading({
|
|
143
|
+
calendarNode: this.opts.ref.current,
|
|
144
|
+
label: this.fullCalendarLabel,
|
|
145
|
+
accessibleHeadingId: this.accessibleHeadingId,
|
|
146
|
+
});
|
|
147
|
+
return removeHeading;
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
#setupFormatterEffect() {
|
|
151
|
+
$effect(() => {
|
|
152
|
+
if (this.formatter.getLocale() === this.opts.locale.current)
|
|
153
|
+
return;
|
|
154
|
+
this.formatter.setLocale(this.opts.locale.current);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
149
157
|
/**
|
|
150
158
|
* Navigates to the next page of the calendar.
|
|
151
159
|
*/
|
|
@@ -365,6 +373,7 @@ export class CalendarRootState {
|
|
|
365
373
|
[this.getBitsAttr("root")]: "",
|
|
366
374
|
//
|
|
367
375
|
onkeydown: this.onkeydown,
|
|
376
|
+
...attachRef(this.opts.ref),
|
|
368
377
|
}));
|
|
369
378
|
}
|
|
370
379
|
export class CalendarHeadingState {
|
|
@@ -374,7 +383,6 @@ export class CalendarHeadingState {
|
|
|
374
383
|
constructor(opts, root) {
|
|
375
384
|
this.opts = opts;
|
|
376
385
|
this.root = root;
|
|
377
|
-
useRefById(opts);
|
|
378
386
|
}
|
|
379
387
|
props = $derived.by(() => ({
|
|
380
388
|
id: this.opts.id.current,
|
|
@@ -382,6 +390,7 @@ export class CalendarHeadingState {
|
|
|
382
390
|
"data-disabled": getDataDisabled(this.root.opts.disabled.current),
|
|
383
391
|
"data-readonly": getDataReadonly(this.root.opts.readonly.current),
|
|
384
392
|
[this.root.getBitsAttr("heading")]: "",
|
|
393
|
+
...attachRef(this.opts.ref),
|
|
385
394
|
}));
|
|
386
395
|
}
|
|
387
396
|
class CalendarCellState {
|
|
@@ -404,7 +413,6 @@ class CalendarCellState {
|
|
|
404
413
|
constructor(opts, root) {
|
|
405
414
|
this.opts = opts;
|
|
406
415
|
this.root = root;
|
|
407
|
-
useRefById(opts);
|
|
408
416
|
}
|
|
409
417
|
snippetProps = $derived.by(() => ({
|
|
410
418
|
disabled: this.isDisabled,
|
|
@@ -435,6 +443,7 @@ class CalendarCellState {
|
|
|
435
443
|
"aria-disabled": getAriaDisabled(this.ariaDisabled),
|
|
436
444
|
...this.sharedDataAttrs,
|
|
437
445
|
[this.root.getBitsAttr("cell")]: "",
|
|
446
|
+
...attachRef(this.opts.ref),
|
|
438
447
|
}));
|
|
439
448
|
}
|
|
440
449
|
class CalendarDayState {
|
|
@@ -444,7 +453,6 @@ class CalendarDayState {
|
|
|
444
453
|
this.opts = opts;
|
|
445
454
|
this.cell = cell;
|
|
446
455
|
this.onclick = this.onclick.bind(this);
|
|
447
|
-
useRefById(opts);
|
|
448
456
|
}
|
|
449
457
|
#tabindex = $derived.by(() => (this.cell.isOutsideMonth && this.cell.root.opts.disableDaysOutsideMonth.current) ||
|
|
450
458
|
this.cell.isDisabled
|
|
@@ -475,6 +483,7 @@ class CalendarDayState {
|
|
|
475
483
|
"data-bits-day": "",
|
|
476
484
|
//
|
|
477
485
|
onclick: this.onclick,
|
|
486
|
+
...attachRef(this.opts.ref),
|
|
478
487
|
}));
|
|
479
488
|
}
|
|
480
489
|
export class CalendarNextButtonState {
|
|
@@ -485,7 +494,6 @@ export class CalendarNextButtonState {
|
|
|
485
494
|
this.opts = opts;
|
|
486
495
|
this.root = root;
|
|
487
496
|
this.onclick = this.onclick.bind(this);
|
|
488
|
-
useRefById(opts);
|
|
489
497
|
}
|
|
490
498
|
onclick(_) {
|
|
491
499
|
if (this.isDisabled)
|
|
@@ -503,6 +511,7 @@ export class CalendarNextButtonState {
|
|
|
503
511
|
[this.root.getBitsAttr("next-button")]: "",
|
|
504
512
|
//
|
|
505
513
|
onclick: this.onclick,
|
|
514
|
+
...attachRef(this.opts.ref),
|
|
506
515
|
}));
|
|
507
516
|
}
|
|
508
517
|
export class CalendarPrevButtonState {
|
|
@@ -513,7 +522,6 @@ export class CalendarPrevButtonState {
|
|
|
513
522
|
this.opts = opts;
|
|
514
523
|
this.root = root;
|
|
515
524
|
this.onclick = this.onclick.bind(this);
|
|
516
|
-
useRefById(opts);
|
|
517
525
|
}
|
|
518
526
|
onclick(_) {
|
|
519
527
|
if (this.isDisabled)
|
|
@@ -531,6 +539,7 @@ export class CalendarPrevButtonState {
|
|
|
531
539
|
[this.root.getBitsAttr("prev-button")]: "",
|
|
532
540
|
//
|
|
533
541
|
onclick: this.onclick,
|
|
542
|
+
...attachRef(this.opts.ref),
|
|
534
543
|
}));
|
|
535
544
|
}
|
|
536
545
|
export class CalendarGridState {
|
|
@@ -539,7 +548,6 @@ export class CalendarGridState {
|
|
|
539
548
|
constructor(opts, root) {
|
|
540
549
|
this.opts = opts;
|
|
541
550
|
this.root = root;
|
|
542
|
-
useRefById(opts);
|
|
543
551
|
}
|
|
544
552
|
props = $derived.by(() => ({
|
|
545
553
|
id: this.opts.id.current,
|
|
@@ -550,6 +558,7 @@ export class CalendarGridState {
|
|
|
550
558
|
"data-readonly": getDataReadonly(this.root.opts.readonly.current),
|
|
551
559
|
"data-disabled": getDataDisabled(this.root.opts.disabled.current),
|
|
552
560
|
[this.root.getBitsAttr("grid")]: "",
|
|
561
|
+
...attachRef(this.opts.ref),
|
|
553
562
|
}));
|
|
554
563
|
}
|
|
555
564
|
export class CalendarGridBodyState {
|
|
@@ -558,13 +567,13 @@ export class CalendarGridBodyState {
|
|
|
558
567
|
constructor(opts, root) {
|
|
559
568
|
this.opts = opts;
|
|
560
569
|
this.root = root;
|
|
561
|
-
useRefById(opts);
|
|
562
570
|
}
|
|
563
571
|
props = $derived.by(() => ({
|
|
564
572
|
id: this.opts.id.current,
|
|
565
573
|
"data-disabled": getDataDisabled(this.root.opts.disabled.current),
|
|
566
574
|
"data-readonly": getDataReadonly(this.root.opts.readonly.current),
|
|
567
575
|
[this.root.getBitsAttr("grid-body")]: "",
|
|
576
|
+
...attachRef(this.opts.ref),
|
|
568
577
|
}));
|
|
569
578
|
}
|
|
570
579
|
export class CalendarGridHeadState {
|
|
@@ -573,13 +582,13 @@ export class CalendarGridHeadState {
|
|
|
573
582
|
constructor(opts, root) {
|
|
574
583
|
this.opts = opts;
|
|
575
584
|
this.root = root;
|
|
576
|
-
useRefById(opts);
|
|
577
585
|
}
|
|
578
586
|
props = $derived.by(() => ({
|
|
579
587
|
id: this.opts.id.current,
|
|
580
588
|
"data-disabled": getDataDisabled(this.root.opts.disabled.current),
|
|
581
589
|
"data-readonly": getDataReadonly(this.root.opts.readonly.current),
|
|
582
590
|
[this.root.getBitsAttr("grid-head")]: "",
|
|
591
|
+
...attachRef(this.opts.ref),
|
|
583
592
|
}));
|
|
584
593
|
}
|
|
585
594
|
export class CalendarGridRowState {
|
|
@@ -588,13 +597,13 @@ export class CalendarGridRowState {
|
|
|
588
597
|
constructor(opts, root) {
|
|
589
598
|
this.opts = opts;
|
|
590
599
|
this.root = root;
|
|
591
|
-
useRefById(opts);
|
|
592
600
|
}
|
|
593
601
|
props = $derived.by(() => ({
|
|
594
602
|
id: this.opts.id.current,
|
|
595
603
|
"data-disabled": getDataDisabled(this.root.opts.disabled.current),
|
|
596
604
|
"data-readonly": getDataReadonly(this.root.opts.readonly.current),
|
|
597
605
|
[this.root.getBitsAttr("grid-row")]: "",
|
|
606
|
+
...attachRef(this.opts.ref),
|
|
598
607
|
}));
|
|
599
608
|
}
|
|
600
609
|
export class CalendarHeadCellState {
|
|
@@ -603,13 +612,13 @@ export class CalendarHeadCellState {
|
|
|
603
612
|
constructor(opts, root) {
|
|
604
613
|
this.opts = opts;
|
|
605
614
|
this.root = root;
|
|
606
|
-
useRefById(opts);
|
|
607
615
|
}
|
|
608
616
|
props = $derived.by(() => ({
|
|
609
617
|
id: this.opts.id.current,
|
|
610
618
|
"data-disabled": getDataDisabled(this.root.opts.disabled.current),
|
|
611
619
|
"data-readonly": getDataReadonly(this.root.opts.readonly.current),
|
|
612
620
|
[this.root.getBitsAttr("head-cell")]: "",
|
|
621
|
+
...attachRef(this.opts.ref),
|
|
613
622
|
}));
|
|
614
623
|
}
|
|
615
624
|
export class CalendarHeaderState {
|
|
@@ -618,13 +627,13 @@ export class CalendarHeaderState {
|
|
|
618
627
|
constructor(opts, root) {
|
|
619
628
|
this.opts = opts;
|
|
620
629
|
this.root = root;
|
|
621
|
-
useRefById(opts);
|
|
622
630
|
}
|
|
623
631
|
props = $derived.by(() => ({
|
|
624
632
|
id: this.opts.id.current,
|
|
625
633
|
"data-disabled": getDataDisabled(this.root.opts.disabled.current),
|
|
626
634
|
"data-readonly": getDataReadonly(this.root.opts.readonly.current),
|
|
627
635
|
[this.root.getBitsAttr("header")]: "",
|
|
636
|
+
...attachRef(this.opts.ref),
|
|
628
637
|
}));
|
|
629
638
|
}
|
|
630
639
|
export const CalendarRootContext = new Context("Calendar.Root | RangeCalender.Root");
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { useCalendarCell } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarCellProps } from "../types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
12
|
ref = $bindable(null),
|
|
11
|
-
id =
|
|
13
|
+
id = createId(uid),
|
|
12
14
|
date,
|
|
13
15
|
month,
|
|
14
16
|
...restProps
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { useCalendarDay } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarDayProps } from "../types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
12
|
ref = $bindable(null),
|
|
11
|
-
id =
|
|
13
|
+
id = createId(uid),
|
|
12
14
|
...restProps
|
|
13
15
|
}: CalendarDayProps = $props();
|
|
14
16
|
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CalendarGridBodyProps } from "../types.js";
|
|
4
4
|
import { useCalendarGridBody } from "../calendar.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
12
|
ref = $bindable(null),
|
|
11
|
-
id =
|
|
13
|
+
id = createId(uid),
|
|
12
14
|
...restProps
|
|
13
15
|
}: CalendarGridBodyProps = $props();
|
|
14
16
|
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { useCalendarGridHead } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarGridHeadProps } from "../types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
12
|
ref = $bindable(null),
|
|
11
|
-
id =
|
|
13
|
+
id = createId(uid),
|
|
12
14
|
...restProps
|
|
13
15
|
}: CalendarGridHeadProps = $props();
|
|
14
16
|
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { useCalendarGridRow } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarGridRowProps } from "../types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
12
|
ref = $bindable(null),
|
|
11
|
-
id =
|
|
13
|
+
id = createId(uid),
|
|
12
14
|
...restProps
|
|
13
15
|
}: CalendarGridRowProps = $props();
|
|
14
16
|
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { useCalendarGrid } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarGridProps } from "../types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
12
|
ref = $bindable(null),
|
|
11
|
-
id =
|
|
13
|
+
id = createId(uid),
|
|
12
14
|
...restProps
|
|
13
15
|
}: CalendarGridProps = $props();
|
|
14
16
|
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { useCalendarHeadCell } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarHeadCellProps } from "../types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
12
|
ref = $bindable(null),
|
|
11
|
-
id =
|
|
13
|
+
id = createId(uid),
|
|
12
14
|
...restProps
|
|
13
15
|
}: CalendarHeadCellProps = $props();
|
|
14
16
|
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { useCalendarHeader } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarHeaderProps } from "../types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
12
|
ref = $bindable(null),
|
|
11
|
-
id =
|
|
13
|
+
id = createId(uid),
|
|
12
14
|
...restProps
|
|
13
15
|
}: CalendarHeaderProps = $props();
|
|
14
16
|
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CalendarHeadingProps } from "../types.js";
|
|
4
4
|
import { useCalendarHeading } from "../calendar.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
12
|
ref = $bindable(null),
|
|
11
|
-
id =
|
|
13
|
+
id = createId(uid),
|
|
12
14
|
...restProps
|
|
13
15
|
}: CalendarHeadingProps = $props();
|
|
14
16
|
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { useCalendarNextButton } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarNextButtonProps } from "../types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
|
-
id =
|
|
12
|
+
id = createId(uid),
|
|
11
13
|
ref = $bindable(null),
|
|
12
14
|
...restProps
|
|
13
15
|
}: CalendarNextButtonProps = $props();
|