@sewadah/selaras 0.3.0 → 0.3.2
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/README.md +4 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +21 -6
- package/dist/runtime/components/AlertDialog.d.vue.ts +5 -3
- package/dist/runtime/components/AlertDialog.vue +17 -9
- package/dist/runtime/components/AlertDialog.vue.d.ts +5 -3
- package/dist/runtime/components/App.vue +2 -0
- package/dist/runtime/components/Autocomplete.d.vue.ts +2 -2
- package/dist/runtime/components/Autocomplete.vue +4 -2
- package/dist/runtime/components/Autocomplete.vue.d.ts +2 -2
- package/dist/runtime/components/Button.d.vue.ts +7 -5
- package/dist/runtime/components/Button.vue +14 -3
- package/dist/runtime/components/Button.vue.d.ts +7 -5
- package/dist/runtime/components/Calendar.d.vue.ts +69 -0
- package/dist/runtime/components/Calendar.vue +163 -0
- package/dist/runtime/components/Calendar.vue.d.ts +69 -0
- package/dist/runtime/components/Callout.vue +12 -1
- package/dist/runtime/components/CodeGroup.vue +13 -3
- package/dist/runtime/components/CodeTree.d.vue.ts +2 -0
- package/dist/runtime/components/CodeTree.vue +52 -1
- package/dist/runtime/components/CodeTree.vue.d.ts +2 -0
- package/dist/runtime/components/ColorModeSwitch.d.vue.ts +18 -0
- package/dist/runtime/components/ColorModeSwitch.vue +59 -0
- package/dist/runtime/components/ColorModeSwitch.vue.d.ts +18 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +8 -0
- package/dist/runtime/components/ColorPicker.vue +66 -45
- package/dist/runtime/components/ColorPicker.vue.d.ts +8 -0
- package/dist/runtime/components/Column.js +1 -1
- package/dist/runtime/components/CommandPalette.d.vue.ts +3 -1
- package/dist/runtime/components/CommandPalette.vue +5 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +3 -1
- package/dist/runtime/components/ConfirmRenderer.d.vue.ts +3 -0
- package/dist/runtime/components/ConfirmRenderer.vue +39 -0
- package/dist/runtime/components/ConfirmRenderer.vue.d.ts +3 -0
- package/dist/runtime/components/ContentNavigation.d.vue.ts +8 -1
- package/dist/runtime/components/ContentNavigation.vue +9 -2
- package/dist/runtime/components/ContentNavigation.vue.d.ts +8 -1
- package/dist/runtime/components/ContextMenu.d.vue.ts +8 -1
- package/dist/runtime/components/ContextMenu.vue +20 -6
- package/dist/runtime/components/ContextMenu.vue.d.ts +8 -1
- package/dist/runtime/components/DatePicker.d.vue.ts +10 -3
- package/dist/runtime/components/DatePicker.vue +24 -16
- package/dist/runtime/components/DatePicker.vue.d.ts +10 -3
- package/dist/runtime/components/Drawer.vue +3 -2
- package/dist/runtime/components/Dropdown.d.vue.ts +33 -6
- package/dist/runtime/components/Dropdown.vue +146 -12
- package/dist/runtime/components/Dropdown.vue.d.ts +33 -6
- package/dist/runtime/components/FileTree.d.vue.ts +2 -0
- package/dist/runtime/components/FileTree.vue +8 -4
- package/dist/runtime/components/FileTree.vue.d.ts +2 -0
- package/dist/runtime/components/FormField.d.vue.ts +4 -0
- package/dist/runtime/components/FormField.vue +19 -4
- package/dist/runtime/components/FormField.vue.d.ts +4 -0
- package/dist/runtime/components/Input.vue +3 -2
- package/dist/runtime/components/Kbd.vue +12 -2
- package/dist/runtime/components/Modal.vue +3 -2
- package/dist/runtime/components/NavigationMenu.d.vue.ts +10 -10
- package/dist/runtime/components/NavigationMenu.vue +13 -9
- package/dist/runtime/components/NavigationMenu.vue.d.ts +10 -10
- package/dist/runtime/components/NavigationMenuAccordionItem.vue +5 -1
- package/dist/runtime/components/NavigationMenuFlyoutList.vue +7 -4
- package/dist/runtime/components/Popover.d.vue.ts +8 -2
- package/dist/runtime/components/Popover.vue +13 -6
- package/dist/runtime/components/Popover.vue.d.ts +8 -2
- package/dist/runtime/components/ProsePre.d.vue.ts +2 -0
- package/dist/runtime/components/ProsePre.vue +2 -1
- package/dist/runtime/components/ProsePre.vue.d.ts +2 -0
- package/dist/runtime/components/Select.d.vue.ts +8 -4
- package/dist/runtime/components/Select.vue +4 -2
- package/dist/runtime/components/Select.vue.d.ts +8 -4
- package/dist/runtime/components/Slideover.vue +3 -2
- package/dist/runtime/components/SplitterPanel.d.vue.ts +2 -2
- package/dist/runtime/components/SplitterPanel.vue.d.ts +2 -2
- package/dist/runtime/components/Table.vue +95 -26
- package/dist/runtime/components/Tabs.d.vue.ts +44 -4
- package/dist/runtime/components/Tabs.vue +171 -18
- package/dist/runtime/components/Tabs.vue.d.ts +44 -4
- package/dist/runtime/components/Textarea.vue +3 -2
- package/dist/runtime/components/Timeline.d.vue.ts +19 -0
- package/dist/runtime/components/Timeline.vue +99 -0
- package/dist/runtime/components/Timeline.vue.d.ts +19 -0
- package/dist/runtime/components/Toast.d.vue.ts +10 -1
- package/dist/runtime/components/Toast.vue +94 -8
- package/dist/runtime/components/Toast.vue.d.ts +10 -1
- package/dist/runtime/components/Tooltip.d.vue.ts +8 -2
- package/dist/runtime/components/Tooltip.vue +13 -6
- package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
- package/dist/runtime/composables/use-confirm.d.ts +14 -0
- package/dist/runtime/composables/use-confirm.js +28 -0
- package/dist/runtime/composables/use-form-field.d.ts +1 -0
- package/dist/runtime/composables/use-table.d.ts +3 -0
- package/dist/runtime/composables/use-table.js +10 -4
- package/dist/runtime/composables/use-toast.js +5 -1
- package/dist/runtime/directives/hotkey.d.ts +13 -0
- package/dist/runtime/directives/hotkey.js +107 -0
- package/dist/runtime/directives/index.d.ts +2 -0
- package/dist/runtime/directives/index.js +2 -0
- package/dist/runtime/directives/mask.d.ts +30 -0
- package/dist/runtime/directives/mask.js +165 -0
- package/dist/runtime/internal/ComboboxSelectBase.d.vue.ts +41 -36
- package/dist/runtime/internal/ComboboxSelectBase.vue +119 -26
- package/dist/runtime/internal/ComboboxSelectBase.vue.d.ts +41 -36
- package/dist/runtime/internal/ComboboxSelectBody.d.vue.ts +23 -17
- package/dist/runtime/internal/ComboboxSelectBody.vue +50 -11
- package/dist/runtime/internal/ComboboxSelectBody.vue.d.ts +23 -17
- package/dist/runtime/internal/DatePickerCalendarBody.vue +1 -1
- package/dist/runtime/internal/DatePickerRangeCalendarBody.vue +1 -1
- package/dist/runtime/internal/ShortcutHint.d.vue.ts +6 -0
- package/dist/runtime/internal/ShortcutHint.vue +13 -0
- package/dist/runtime/internal/ShortcutHint.vue.d.ts +6 -0
- package/dist/runtime/internal/ToastItemRenderer.d.vue.ts +9 -1
- package/dist/runtime/internal/ToastItemRenderer.vue +55 -8
- package/dist/runtime/internal/ToastItemRenderer.vue.d.ts +9 -1
- package/dist/runtime/internal/combobox-select.d.ts +19 -18
- package/dist/runtime/internal/combobox-select.js +38 -15
- package/dist/runtime/internal/programmatic-services.d.ts +13 -0
- package/dist/runtime/internal/programmatic-services.js +9 -0
- package/dist/runtime/internal/toast-stack.d.ts +36 -0
- package/dist/runtime/internal/toast-stack.js +36 -0
- package/dist/runtime/structural.css +1 -1
- package/dist/runtime/table.d.ts +1 -1
- package/dist/runtime/theme/alert-dialog.js +1 -1
- package/dist/runtime/theme/badge.d.ts +9 -0
- package/dist/runtime/theme/badge.js +2 -1
- package/dist/runtime/theme/button.d.ts +18 -0
- package/dist/runtime/theme/button.js +4 -1
- package/dist/runtime/theme/calendar.d.ts +86 -0
- package/dist/runtime/theme/calendar.js +19 -0
- package/dist/runtime/theme/callout.d.ts +0 -12
- package/dist/runtime/theme/callout.js +8 -8
- package/dist/runtime/theme/code-tree.js +1 -1
- package/dist/runtime/theme/command-palette.js +1 -1
- package/dist/runtime/theme/content-navigation.d.ts +3 -0
- package/dist/runtime/theme/content-navigation.js +1 -0
- package/dist/runtime/theme/drawer.js +1 -1
- package/dist/runtime/theme/dropdown.d.ts +21 -0
- package/dist/runtime/theme/dropdown.js +15 -2
- package/dist/runtime/theme/file-tree.js +1 -1
- package/dist/runtime/theme/form-field.d.ts +18 -0
- package/dist/runtime/theme/form-field.js +6 -1
- package/dist/runtime/theme/modal.js +1 -1
- package/dist/runtime/theme/slideover.js +1 -1
- package/dist/runtime/theme/table.d.ts +27 -0
- package/dist/runtime/theme/table.js +11 -2
- package/dist/runtime/theme/tabs.d.ts +87 -3
- package/dist/runtime/theme/tabs.js +46 -22
- package/dist/runtime/theme/timeline.d.ts +251 -0
- package/dist/runtime/theme/timeline.js +84 -0
- package/dist/runtime/theme/toast.d.ts +92 -0
- package/dist/runtime/theme/toast.js +29 -7
- package/dist/runtime/theme-config.d.ts +13 -2
- package/dist/runtime/types/index.d.ts +10 -2
- package/dist/runtime/utils/arrow.d.ts +21 -0
- package/dist/runtime/utils/arrow.js +10 -0
- package/dist/runtime/utils/autocomplete-contracts.d.ts +4 -4
- package/dist/runtime/utils/file-icons.js +3 -0
- package/dist/runtime/utils/icons.d.ts +2 -0
- package/dist/runtime/utils/icons.js +2 -0
- package/dist/runtime/utils/messages.d.ts +7 -0
- package/dist/runtime/utils/messages.js +7 -0
- package/dist/runtime/utils/navigation-menu.d.ts +7 -0
- package/dist/runtime/utils/navigation-menu.js +3 -0
- package/dist/runtime/utils/overlay.d.ts +17 -0
- package/dist/runtime/utils/overlay.js +7 -0
- package/dist/runtime/utils/select-contracts.d.ts +25 -11
- package/dist/runtime/utils/table-columns.js +1 -1
- package/dist/runtime/utils/table-contracts.d.ts +9 -1
- package/dist/runtime/utils/timeline-contracts.d.ts +42 -0
- package/dist/runtime/utils/timeline-contracts.js +0 -0
- package/dist/runtime/utils/ui.d.ts +11 -0
- package/dist/runtime/utils/ui.js +54 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -128,7 +128,10 @@ See the full [Theming guide](./docs/content/overview/theming.md).
|
|
|
128
128
|
# Generate type stubs and prepare the docs site
|
|
129
129
|
npm run docs:prepare
|
|
130
130
|
|
|
131
|
-
# Develop with the
|
|
131
|
+
# Develop with the Selaras documentation site in /docs
|
|
132
|
+
npm run dev
|
|
133
|
+
|
|
134
|
+
# Develop the standalone documentation template preview
|
|
132
135
|
npm run docs:dev
|
|
133
136
|
|
|
134
137
|
# Generate the static docs site
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -41,7 +41,10 @@ function createBuiltinColorRegistry(classPrefix) {
|
|
|
41
41
|
fill,
|
|
42
42
|
fillHover: hover,
|
|
43
43
|
fillPressed: pressed,
|
|
44
|
-
|
|
44
|
+
// The vivid light-mode intent fills intentionally use white text.
|
|
45
|
+
// Dark mode restores the shared dark foreground on its lighter fills.
|
|
46
|
+
// Consumers can override onFill in their own recipe.
|
|
47
|
+
onFill: brightIntent && !dark ? "#ffffff" : foundation("neutral", dark ? 950 : 25),
|
|
45
48
|
indicator,
|
|
46
49
|
subtle,
|
|
47
50
|
subtleHover: brightIntent ? `color-mix(in oklab, ${subtle} 96%, ${text})` : dark ? `color-mix(in oklab, ${foundation(role, 500)} 32%, var(--selaras-resolved-surface-default))` : `color-mix(in oklab, ${subtle} 94%, ${text})`,
|
|
@@ -83,10 +86,11 @@ const module$1 = defineNuxtModule({
|
|
|
83
86
|
path: resolver.resolve("./runtime/components"),
|
|
84
87
|
prefix: options.prefix,
|
|
85
88
|
pathPrefix: false,
|
|
86
|
-
// SColumn/SColumnGroup are plain
|
|
87
|
-
// .
|
|
88
|
-
extensions: ["vue", "ts"],
|
|
89
|
-
// ModalRenderer
|
|
89
|
+
// SColumn/SColumnGroup are plain render-function modules (never render
|
|
90
|
+
// real DOM). Source uses .ts; the published build emits .js.
|
|
91
|
+
extensions: ["vue", "ts", "js"],
|
|
92
|
+
// ModalRenderer/ConfirmRenderer are App.vue's internal render loops for
|
|
93
|
+
// useModal()/useConfirm(),
|
|
90
94
|
// mirroring the same un-exported overlay-provider pattern other Nuxt
|
|
91
95
|
// component libraries commonly use internally - not meant to be
|
|
92
96
|
// placed by a consumer (App.vue already mounts one; a second copy
|
|
@@ -99,7 +103,7 @@ const module$1 = defineNuxtModule({
|
|
|
99
103
|
// meant to be placed directly either. SlideoverRenderer/DrawerRenderer
|
|
100
104
|
// are useSlideover()'s/useDrawer()'s own render loops, same reasoning
|
|
101
105
|
// as ModalRenderer.
|
|
102
|
-
ignore: ["**/ModalRenderer.vue", "**/NavigationMenuAccordionItem.vue", "**/NavigationMenuFlyoutList.vue", "**/NavigationMenuFlyoutTrigger.vue", "**/SlideoverRenderer.vue", "**/DrawerRenderer.vue"]
|
|
106
|
+
ignore: ["**/ModalRenderer.vue", "**/ConfirmRenderer.vue", "**/NavigationMenuAccordionItem.vue", "**/NavigationMenuFlyoutList.vue", "**/NavigationMenuFlyoutTrigger.vue", "**/SlideoverRenderer.vue", "**/DrawerRenderer.vue"]
|
|
103
107
|
});
|
|
104
108
|
const hasContentModule = nuxt.options.modules.some((m) => {
|
|
105
109
|
const name = typeof m === "string" ? m : Array.isArray(m) && typeof m[0] === "string" ? m[0] : void 0;
|
|
@@ -117,6 +121,7 @@ const module$1 = defineNuxtModule({
|
|
|
117
121
|
}
|
|
118
122
|
addImports([
|
|
119
123
|
{ name: "useCommandPalette", from: resolver.resolve("./runtime/composables/use-command-palette") },
|
|
124
|
+
{ name: "useConfirm", from: resolver.resolve("./runtime/composables/use-confirm") },
|
|
120
125
|
{ name: "useDrawer", from: resolver.resolve("./runtime/composables/use-drawer") },
|
|
121
126
|
{ name: "useIcons", from: resolver.resolve("./runtime/composables/use-icons") },
|
|
122
127
|
{ name: "useLocale", from: resolver.resolve("./runtime/composables/use-locale") },
|
|
@@ -135,6 +140,16 @@ const module$1 = defineNuxtModule({
|
|
|
135
140
|
from: resolver.resolve("./runtime/directives/ripple"),
|
|
136
141
|
meta: { vueDirective: true }
|
|
137
142
|
});
|
|
143
|
+
addImports({
|
|
144
|
+
name: "vMask",
|
|
145
|
+
from: resolver.resolve("./runtime/directives/mask"),
|
|
146
|
+
meta: { vueDirective: true }
|
|
147
|
+
});
|
|
148
|
+
addImports({
|
|
149
|
+
name: "vHotkey",
|
|
150
|
+
from: resolver.resolve("./runtime/directives/hotkey"),
|
|
151
|
+
meta: { vueDirective: true }
|
|
152
|
+
});
|
|
138
153
|
addTemplate({
|
|
139
154
|
filename: "selaras-class-prefix.mjs",
|
|
140
155
|
getContents: () => `export const classPrefix = ${JSON.stringify(options.classPrefix ?? null)}
|
|
@@ -7,6 +7,8 @@ export interface AlertDialogProps {
|
|
|
7
7
|
defaultOpen?: boolean;
|
|
8
8
|
title?: string;
|
|
9
9
|
description?: string;
|
|
10
|
+
/** Optional icon shown beside the dialog heading. */
|
|
11
|
+
icon?: string;
|
|
10
12
|
/** Label for the default Cancel button - only rendered when no `footer` slot is given. @default 'Cancel' */
|
|
11
13
|
cancelLabel?: string;
|
|
12
14
|
/** Label for the default action button - only rendered when no `footer` slot is given. @default 'Continue' */
|
|
@@ -33,15 +35,15 @@ export interface AlertDialogEmits {
|
|
|
33
35
|
/** Fires once the close transition has actually finished (or immediately, if `transition` is off) - the signal a programmatic caller needs before it's safe to unmount this instance without cutting its exit animation short. */
|
|
34
36
|
'afterLeave': [];
|
|
35
37
|
}
|
|
36
|
-
declare var __VLS_16: {}, __VLS_39: {},
|
|
38
|
+
declare var __VLS_16: {}, __VLS_39: {}, __VLS_58: {}, __VLS_60: {};
|
|
37
39
|
type __VLS_Slots = {} & {
|
|
38
40
|
default?: (props: typeof __VLS_16) => any;
|
|
39
41
|
} & {
|
|
40
42
|
header?: (props: typeof __VLS_39) => any;
|
|
41
43
|
} & {
|
|
42
|
-
body?: (props: typeof
|
|
44
|
+
body?: (props: typeof __VLS_58) => any;
|
|
43
45
|
} & {
|
|
44
|
-
footer?: (props: typeof
|
|
46
|
+
footer?: (props: typeof __VLS_60) => any;
|
|
45
47
|
};
|
|
46
48
|
declare const __VLS_base: import("vue").DefineComponent<AlertDialogProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
49
|
cancel: () => any;
|
|
@@ -3,13 +3,16 @@ import { AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDe
|
|
|
3
3
|
import { computed, getCurrentInstance, ref, useSlots, watch, watchEffect } from "vue";
|
|
4
4
|
import { useMessages } from "../composables/use-messages";
|
|
5
5
|
import { alertDialogTheme } from "../theme/alert-dialog";
|
|
6
|
-
import { resolveSlot, useComponentTheme, useThemeBindings } from "../utils/ui";
|
|
6
|
+
import { resolveSlot, useComponentTheme, useRootProps, useThemeBindings } from "../utils/ui";
|
|
7
7
|
import Button from "./Button.vue";
|
|
8
|
+
import Icon from "./Icon.vue";
|
|
9
|
+
defineOptions({ inheritAttrs: false });
|
|
8
10
|
const props = defineProps({
|
|
9
11
|
open: { type: Boolean, required: false, default: void 0 },
|
|
10
12
|
defaultOpen: { type: Boolean, required: false },
|
|
11
13
|
title: { type: String, required: false },
|
|
12
14
|
description: { type: String, required: false },
|
|
15
|
+
icon: { type: String, required: false },
|
|
13
16
|
cancelLabel: { type: String, required: false },
|
|
14
17
|
actionLabel: { type: String, required: false },
|
|
15
18
|
actionColor: { type: null, required: false },
|
|
@@ -65,8 +68,8 @@ const messages = useMessages();
|
|
|
65
68
|
const theme = useComponentTheme("alertDialog", alertDialogTheme);
|
|
66
69
|
const themeBindings = useThemeBindings();
|
|
67
70
|
const ui = computed(() => theme.value({ transition: props.transition }));
|
|
71
|
+
const contentProps = useRootProps(() => ui.value.content, () => props.ui?.content);
|
|
68
72
|
const overlayProps = computed(() => resolveSlot(ui.value.overlay, props.ui?.overlay));
|
|
69
|
-
const contentProps = computed(() => resolveSlot(ui.value.content, props.ui?.content));
|
|
70
73
|
const headerProps = computed(() => resolveSlot(ui.value.header, props.ui?.header));
|
|
71
74
|
const titleProps = computed(() => resolveSlot(ui.value.title, props.ui?.title));
|
|
72
75
|
const descriptionProps = computed(() => resolveSlot(ui.value.description, props.ui?.description));
|
|
@@ -96,14 +99,19 @@ const footerProps = computed(() => resolveSlot(ui.value.footer, props.ui?.footer
|
|
|
96
99
|
@pointer-down-outside="onPointerDownOutside"
|
|
97
100
|
@animationend="onContentAnimationEnd"
|
|
98
101
|
>
|
|
99
|
-
<div v-if="title || description || $slots.header" v-bind="headerProps">
|
|
102
|
+
<div v-if="title || description || icon || $slots.header" v-bind="headerProps">
|
|
100
103
|
<slot name="header">
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
<div class="flex items-start gap-3">
|
|
105
|
+
<Icon v-if="icon" :name="icon" class="mt-0.5 size-5 shrink-0" aria-hidden="true" />
|
|
106
|
+
<div class="min-w-0">
|
|
107
|
+
<AlertDialogTitle v-if="title" v-bind="titleProps">
|
|
108
|
+
{{ title }}
|
|
109
|
+
</AlertDialogTitle>
|
|
110
|
+
<AlertDialogDescription v-if="description" v-bind="descriptionProps">
|
|
111
|
+
{{ description }}
|
|
112
|
+
</AlertDialogDescription>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
107
115
|
</slot>
|
|
108
116
|
</div>
|
|
109
117
|
<div v-if="$slots.body" v-bind="bodyProps">
|
|
@@ -7,6 +7,8 @@ export interface AlertDialogProps {
|
|
|
7
7
|
defaultOpen?: boolean;
|
|
8
8
|
title?: string;
|
|
9
9
|
description?: string;
|
|
10
|
+
/** Optional icon shown beside the dialog heading. */
|
|
11
|
+
icon?: string;
|
|
10
12
|
/** Label for the default Cancel button - only rendered when no `footer` slot is given. @default 'Cancel' */
|
|
11
13
|
cancelLabel?: string;
|
|
12
14
|
/** Label for the default action button - only rendered when no `footer` slot is given. @default 'Continue' */
|
|
@@ -33,15 +35,15 @@ export interface AlertDialogEmits {
|
|
|
33
35
|
/** Fires once the close transition has actually finished (or immediately, if `transition` is off) - the signal a programmatic caller needs before it's safe to unmount this instance without cutting its exit animation short. */
|
|
34
36
|
'afterLeave': [];
|
|
35
37
|
}
|
|
36
|
-
declare var __VLS_16: {}, __VLS_39: {},
|
|
38
|
+
declare var __VLS_16: {}, __VLS_39: {}, __VLS_58: {}, __VLS_60: {};
|
|
37
39
|
type __VLS_Slots = {} & {
|
|
38
40
|
default?: (props: typeof __VLS_16) => any;
|
|
39
41
|
} & {
|
|
40
42
|
header?: (props: typeof __VLS_39) => any;
|
|
41
43
|
} & {
|
|
42
|
-
body?: (props: typeof
|
|
44
|
+
body?: (props: typeof __VLS_58) => any;
|
|
43
45
|
} & {
|
|
44
|
-
footer?: (props: typeof
|
|
46
|
+
footer?: (props: typeof __VLS_60) => any;
|
|
45
47
|
};
|
|
46
48
|
declare const __VLS_base: import("vue").DefineComponent<AlertDialogProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
49
|
cancel: () => any;
|
|
@@ -4,6 +4,7 @@ import { computed } from "vue";
|
|
|
4
4
|
import { useAppConfig, useHead } from "#imports";
|
|
5
5
|
import { useLocale } from "../composables/use-locale";
|
|
6
6
|
import { generateRuntimeTokenOverrideCss } from "../utils/color-registry";
|
|
7
|
+
import ConfirmRenderer from "./ConfirmRenderer.vue";
|
|
7
8
|
import DrawerRenderer from "./DrawerRenderer.vue";
|
|
8
9
|
import ModalRenderer from "./ModalRenderer.vue";
|
|
9
10
|
import SlideoverRenderer from "./SlideoverRenderer.vue";
|
|
@@ -29,5 +30,6 @@ useHead({
|
|
|
29
30
|
<ModalRenderer />
|
|
30
31
|
<SlideoverRenderer />
|
|
31
32
|
<DrawerRenderer />
|
|
33
|
+
<ConfirmRenderer />
|
|
32
34
|
</ConfigProvider>
|
|
33
35
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AutocompleteProps, AutocompleteSlots, AutocompleteValue } from '../utils/autocomplete-contracts.js';
|
|
2
|
-
import type { SelectModel } from '../utils/select-contracts.js';
|
|
2
|
+
import type { SelectEntry, SelectModel } from '../utils/select-contracts.js';
|
|
3
3
|
export type { AutocompleteEmits, AutocompleteProps, AutocompleteSlots } from '../utils/autocomplete-contracts.js';
|
|
4
|
-
declare const __VLS_export: <Entry extends
|
|
4
|
+
declare const __VLS_export: <Entry extends SelectEntry, Key extends string = "value", Multiple extends boolean = false, Forced extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
5
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<AutocompleteProps<Entry, Key, Multiple, Forced> & {
|
|
6
6
|
"onUpdate:modelValue"?: ((value: SelectModel<AutocompleteValue<Entry, Key, Forced>, Multiple>) => any) | undefined;
|
|
7
7
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
@@ -11,7 +11,7 @@ const props = defineProps({
|
|
|
11
11
|
name: { type: String, required: false },
|
|
12
12
|
form: { type: String, required: false },
|
|
13
13
|
items: { type: Array, required: true },
|
|
14
|
-
valueKey: { type:
|
|
14
|
+
valueKey: { type: void 0, required: false },
|
|
15
15
|
labelKey: { type: String, required: false },
|
|
16
16
|
open: { type: Boolean, required: false },
|
|
17
17
|
defaultOpen: { type: Boolean, required: false },
|
|
@@ -30,7 +30,9 @@ const props = defineProps({
|
|
|
30
30
|
searchTerm: { type: String, required: false },
|
|
31
31
|
resetSearchTermOnBlur: { type: Boolean, required: false },
|
|
32
32
|
resetSearchTermOnSelect: { type: Boolean, required: false },
|
|
33
|
-
arrow: { type: Boolean, required: false },
|
|
33
|
+
arrow: { type: [Boolean, Object], required: false },
|
|
34
|
+
positioning: { type: Object, required: false },
|
|
35
|
+
portal: { type: [Boolean, String], required: false, skipCheck: true, default: void 0 },
|
|
34
36
|
adaptive: { type: Boolean, required: false },
|
|
35
37
|
ui: { type: Object, required: false }
|
|
36
38
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AutocompleteProps, AutocompleteSlots, AutocompleteValue } from '../utils/autocomplete-contracts.js';
|
|
2
|
-
import type { SelectModel } from '../utils/select-contracts.js';
|
|
2
|
+
import type { SelectEntry, SelectModel } from '../utils/select-contracts.js';
|
|
3
3
|
export type { AutocompleteEmits, AutocompleteProps, AutocompleteSlots } from '../utils/autocomplete-contracts.js';
|
|
4
|
-
declare const __VLS_export: <Entry extends
|
|
4
|
+
declare const __VLS_export: <Entry extends SelectEntry, Key extends string = "value", Multiple extends boolean = false, Forced extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
5
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<AutocompleteProps<Entry, Key, Multiple, Forced> & {
|
|
6
6
|
"onUpdate:modelValue"?: ((value: SelectModel<AutocompleteValue<Entry, Key, Forced>, Multiple>) => any) | undefined;
|
|
7
7
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
@@ -8,6 +8,8 @@ type ButtonVariants = VariantProps<typeof buttonTheme>;
|
|
|
8
8
|
export interface ButtonProps {
|
|
9
9
|
/** A tag name ('a', 'span', ...) or a component reference (e.g. NuxtLink, via resolveComponent) - Primitive renders whichever is given. */
|
|
10
10
|
as?: string | Component;
|
|
11
|
+
/** Nuxt route or URL. Renders NuxtLink unless an explicit `as` overrides it. */
|
|
12
|
+
to?: string;
|
|
11
13
|
/** Native button type when `as="button"`. Defaults to `button` so actions inside forms do not submit accidentally. */
|
|
12
14
|
type?: 'button' | 'submit' | 'reset';
|
|
13
15
|
color?: ColorRole;
|
|
@@ -25,17 +27,17 @@ export interface ButtonProps {
|
|
|
25
27
|
square?: boolean;
|
|
26
28
|
ui?: UiProp<ButtonThemeSlots>;
|
|
27
29
|
}
|
|
28
|
-
declare var
|
|
30
|
+
declare var __VLS_15: {
|
|
29
31
|
class: unknown;
|
|
30
|
-
},
|
|
32
|
+
}, __VLS_22: {}, __VLS_24: {
|
|
31
33
|
class: unknown;
|
|
32
34
|
};
|
|
33
35
|
type __VLS_Slots = {} & {
|
|
34
|
-
icon?: (props: typeof
|
|
36
|
+
icon?: (props: typeof __VLS_15) => any;
|
|
35
37
|
} & {
|
|
36
|
-
default?: (props: typeof
|
|
38
|
+
default?: (props: typeof __VLS_22) => any;
|
|
37
39
|
} & {
|
|
38
|
-
'trailing-icon'?: (props: typeof
|
|
40
|
+
'trailing-icon'?: (props: typeof __VLS_24) => any;
|
|
39
41
|
};
|
|
40
42
|
declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
43
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Primitive } from "reka-ui";
|
|
3
|
-
import { computed, useSlots } from "vue";
|
|
3
|
+
import { computed, getCurrentInstance, useSlots } from "vue";
|
|
4
|
+
import { NuxtLink } from "#components";
|
|
4
5
|
import { useIcons } from "../composables/use-icons";
|
|
5
6
|
import { useMessages } from "../composables/use-messages";
|
|
6
7
|
import { useRippleEnabled } from "../composables/use-ripple";
|
|
@@ -12,6 +13,7 @@ import Icon from "./Icon.vue";
|
|
|
12
13
|
defineOptions({ inheritAttrs: false });
|
|
13
14
|
const props = defineProps({
|
|
14
15
|
as: { type: null, required: false, default: "button" },
|
|
16
|
+
to: { type: String, required: false },
|
|
15
17
|
type: { type: String, required: false, default: "button" },
|
|
16
18
|
color: { type: null, required: false },
|
|
17
19
|
variant: { type: null, required: false },
|
|
@@ -26,11 +28,20 @@ const props = defineProps({
|
|
|
26
28
|
ui: { type: Object, required: false }
|
|
27
29
|
});
|
|
28
30
|
const slots = useSlots();
|
|
31
|
+
const hasExplicitAs = Object.hasOwn(getCurrentInstance()?.vnode.props ?? {}, "as");
|
|
32
|
+
const resolvedAs = computed(() => hasExplicitAs ? props.as : props.to ? NuxtLink : props.as);
|
|
33
|
+
const isNativeButton = computed(() => resolvedAs.value === "button");
|
|
34
|
+
function onClick(event) {
|
|
35
|
+
if (props.disabled && !isNativeButton.value) {
|
|
36
|
+
event.preventDefault();
|
|
37
|
+
event.stopPropagation();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
29
40
|
const iconOnly = computed(() => !slots.default);
|
|
30
41
|
const icons = useIcons();
|
|
31
42
|
const messages = useMessages();
|
|
32
43
|
const rippleEnabledSetting = useRippleEnabled();
|
|
33
|
-
const rippleEnabled = computed(() => rippleEnabledSetting.value && props.variant !== "text");
|
|
44
|
+
const rippleEnabled = computed(() => rippleEnabledSetting.value && props.variant !== "text" && props.variant !== "link");
|
|
34
45
|
const theme = useComponentTheme("button", buttonTheme);
|
|
35
46
|
const themeProps = useThemeProps("button");
|
|
36
47
|
const effectiveColor = computed(() => resolveRegisteredColorRole(props.color ?? themeProps.value.color ?? "primary", "primary"));
|
|
@@ -46,7 +57,7 @@ const rootProps = useRootProps(() => ui.value.base, () => props.ui?.base);
|
|
|
46
57
|
</script>
|
|
47
58
|
|
|
48
59
|
<template>
|
|
49
|
-
<Primitive v-ripple="rippleEnabled" :as="
|
|
60
|
+
<Primitive v-ripple="rippleEnabled" :as="resolvedAs" :to="resolvedAs === NuxtLink || typeof resolvedAs !== 'string' ? to : void 0" :type="isNativeButton ? type : void 0" :disabled="isNativeButton ? disabled : void 0" :aria-disabled="!isNativeButton && disabled ? 'true' : void 0" :tabindex="!isNativeButton && disabled ? -1 : void 0" :aria-busy="loading || void 0" :data-selaras-color="effectiveColor" v-bind="rootProps" @click="onClick">
|
|
50
61
|
<Icon v-if="loading" :name="icons.loading" :class="applyClassPrefix('animate-spin')" v-bind="resolveSlot(ui.leadingIcon, props.ui?.leadingIcon)" />
|
|
51
62
|
<!--
|
|
52
63
|
A named slot (not just the `icon` prop) so a consumer building a
|
|
@@ -8,6 +8,8 @@ type ButtonVariants = VariantProps<typeof buttonTheme>;
|
|
|
8
8
|
export interface ButtonProps {
|
|
9
9
|
/** A tag name ('a', 'span', ...) or a component reference (e.g. NuxtLink, via resolveComponent) - Primitive renders whichever is given. */
|
|
10
10
|
as?: string | Component;
|
|
11
|
+
/** Nuxt route or URL. Renders NuxtLink unless an explicit `as` overrides it. */
|
|
12
|
+
to?: string;
|
|
11
13
|
/** Native button type when `as="button"`. Defaults to `button` so actions inside forms do not submit accidentally. */
|
|
12
14
|
type?: 'button' | 'submit' | 'reset';
|
|
13
15
|
color?: ColorRole;
|
|
@@ -25,17 +27,17 @@ export interface ButtonProps {
|
|
|
25
27
|
square?: boolean;
|
|
26
28
|
ui?: UiProp<ButtonThemeSlots>;
|
|
27
29
|
}
|
|
28
|
-
declare var
|
|
30
|
+
declare var __VLS_15: {
|
|
29
31
|
class: unknown;
|
|
30
|
-
},
|
|
32
|
+
}, __VLS_22: {}, __VLS_24: {
|
|
31
33
|
class: unknown;
|
|
32
34
|
};
|
|
33
35
|
type __VLS_Slots = {} & {
|
|
34
|
-
icon?: (props: typeof
|
|
36
|
+
icon?: (props: typeof __VLS_15) => any;
|
|
35
37
|
} & {
|
|
36
|
-
default?: (props: typeof
|
|
38
|
+
default?: (props: typeof __VLS_22) => any;
|
|
37
39
|
} & {
|
|
38
|
-
'trailing-icon'?: (props: typeof
|
|
40
|
+
'trailing-icon'?: (props: typeof __VLS_24) => any;
|
|
39
41
|
};
|
|
40
42
|
declare const __VLS_base: import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
43
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { DateValue } from '@internationalized/date';
|
|
2
|
+
import type { CalendarThemeSlots } from '../theme/calendar.js';
|
|
3
|
+
import type { ColorRole } from '../utils/color-registry.js';
|
|
4
|
+
import type { UiProp } from '../utils/ui.js';
|
|
5
|
+
type __VLS_Slots = {
|
|
6
|
+
'day'?: (props: CalendarDaySlotProps) => any;
|
|
7
|
+
/** Renders beside the date trigger within its grid cell. Safe for event links/buttons. */
|
|
8
|
+
'day-details'?: (props: {
|
|
9
|
+
date: DateValue;
|
|
10
|
+
month: DateValue;
|
|
11
|
+
}) => any;
|
|
12
|
+
'footer'?: () => any;
|
|
13
|
+
};
|
|
14
|
+
export interface CalendarProps {
|
|
15
|
+
modelValue?: DateValue;
|
|
16
|
+
defaultValue?: DateValue;
|
|
17
|
+
/** The displayed month when controlled independently of the selected date. */
|
|
18
|
+
placeholder?: DateValue;
|
|
19
|
+
defaultPlaceholder?: DateValue;
|
|
20
|
+
minValue?: DateValue;
|
|
21
|
+
maxValue?: DateValue;
|
|
22
|
+
isDateDisabled?: (date: DateValue) => boolean;
|
|
23
|
+
isDateUnavailable?: (date: DateValue) => boolean;
|
|
24
|
+
locale?: string;
|
|
25
|
+
numberOfMonths?: number;
|
|
26
|
+
pagedNavigation?: boolean;
|
|
27
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
28
|
+
weekdayFormat?: 'narrow' | 'short' | 'long';
|
|
29
|
+
fixedWeeks?: boolean;
|
|
30
|
+
disableDaysOutsideCurrentView?: boolean;
|
|
31
|
+
preventDeselect?: boolean;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
readonly?: boolean;
|
|
34
|
+
initialFocus?: boolean;
|
|
35
|
+
calendarLabel?: string;
|
|
36
|
+
color?: ColorRole;
|
|
37
|
+
activeColor?: ColorRole;
|
|
38
|
+
ui?: UiProp<CalendarThemeSlots>;
|
|
39
|
+
}
|
|
40
|
+
export interface CalendarEmits {
|
|
41
|
+
'update:modelValue': [value: DateValue | undefined];
|
|
42
|
+
'update:placeholder': [value: DateValue];
|
|
43
|
+
}
|
|
44
|
+
export interface CalendarDaySlotProps {
|
|
45
|
+
date: DateValue;
|
|
46
|
+
month: DateValue;
|
|
47
|
+
dayValue: string;
|
|
48
|
+
selected: boolean;
|
|
49
|
+
today: boolean;
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
unavailable: boolean;
|
|
52
|
+
outsideView: boolean;
|
|
53
|
+
outsideVisibleView: boolean;
|
|
54
|
+
}
|
|
55
|
+
declare const __VLS_base: import("vue").DefineComponent<CalendarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
56
|
+
"update:modelValue": (value: DateValue | undefined) => any;
|
|
57
|
+
"update:placeholder": (value: DateValue) => any;
|
|
58
|
+
}, string, import("vue").PublicProps, Readonly<CalendarProps> & Readonly<{
|
|
59
|
+
"onUpdate:modelValue"?: ((value: DateValue | undefined) => any) | undefined;
|
|
60
|
+
"onUpdate:placeholder"?: ((value: DateValue) => any) | undefined;
|
|
61
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
62
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
63
|
+
declare const _default: typeof __VLS_export;
|
|
64
|
+
export default _default;
|
|
65
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
66
|
+
new (): {
|
|
67
|
+
$slots: S;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import {
|
|
3
|
+
CalendarCell,
|
|
4
|
+
CalendarCellTrigger,
|
|
5
|
+
CalendarGrid,
|
|
6
|
+
CalendarGridBody,
|
|
7
|
+
CalendarGridHead,
|
|
8
|
+
CalendarGridRow,
|
|
9
|
+
CalendarHeadCell,
|
|
10
|
+
CalendarHeader,
|
|
11
|
+
CalendarHeading,
|
|
12
|
+
CalendarNext,
|
|
13
|
+
CalendarPrev,
|
|
14
|
+
CalendarRoot
|
|
15
|
+
} from "reka-ui";
|
|
16
|
+
import { computed, getCurrentInstance, useId, useSlots } from "vue";
|
|
17
|
+
import { useIcons } from "../composables/use-icons";
|
|
18
|
+
import { useMessages } from "../composables/use-messages";
|
|
19
|
+
import { calendarTheme } from "../theme/calendar";
|
|
20
|
+
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
21
|
+
import { resolveSlot, useComponentTheme, useRootProps } from "../utils/ui";
|
|
22
|
+
import Button from "./Button.vue";
|
|
23
|
+
defineOptions({ inheritAttrs: false });
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
modelValue: { type: Object, required: false },
|
|
26
|
+
defaultValue: { type: Object, required: false },
|
|
27
|
+
placeholder: { type: Object, required: false },
|
|
28
|
+
defaultPlaceholder: { type: Object, required: false },
|
|
29
|
+
minValue: { type: Object, required: false },
|
|
30
|
+
maxValue: { type: Object, required: false },
|
|
31
|
+
isDateDisabled: { type: Function, required: false },
|
|
32
|
+
isDateUnavailable: { type: Function, required: false },
|
|
33
|
+
locale: { type: String, required: false },
|
|
34
|
+
numberOfMonths: { type: Number, required: false },
|
|
35
|
+
pagedNavigation: { type: Boolean, required: false },
|
|
36
|
+
weekStartsOn: { type: Number, required: false },
|
|
37
|
+
weekdayFormat: { type: String, required: false },
|
|
38
|
+
fixedWeeks: { type: Boolean, required: false },
|
|
39
|
+
disableDaysOutsideCurrentView: { type: Boolean, required: false },
|
|
40
|
+
preventDeselect: { type: Boolean, required: false },
|
|
41
|
+
disabled: { type: Boolean, required: false },
|
|
42
|
+
readonly: { type: Boolean, required: false },
|
|
43
|
+
initialFocus: { type: Boolean, required: false },
|
|
44
|
+
calendarLabel: { type: String, required: false },
|
|
45
|
+
color: { type: null, required: false, default: "neutral" },
|
|
46
|
+
activeColor: { type: null, required: false, default: "primary" },
|
|
47
|
+
ui: { type: Object, required: false }
|
|
48
|
+
});
|
|
49
|
+
const emit = defineEmits(["update:modelValue", "update:placeholder"]);
|
|
50
|
+
defineSlots();
|
|
51
|
+
const slots = useSlots();
|
|
52
|
+
const instance = getCurrentInstance();
|
|
53
|
+
const detailsId = useId();
|
|
54
|
+
const icons = useIcons();
|
|
55
|
+
const messages = useMessages();
|
|
56
|
+
const theme = useComponentTheme("calendar", calendarTheme);
|
|
57
|
+
const ui = computed(() => theme.value());
|
|
58
|
+
const color = computed(() => resolveRegisteredColorRole(props.color, "neutral"));
|
|
59
|
+
const activeColor = computed(() => resolveRegisteredColorRole(props.activeColor, "primary"));
|
|
60
|
+
const rootModelValue = computed(() => {
|
|
61
|
+
const vnodeProps = instance.vnode.props ?? {};
|
|
62
|
+
const isControlled = Object.hasOwn(vnodeProps, "modelValue") || Object.hasOwn(vnodeProps, "model-value");
|
|
63
|
+
return isControlled && props.modelValue === void 0 ? null : props.modelValue;
|
|
64
|
+
});
|
|
65
|
+
const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
66
|
+
const headerProps = computed(() => resolveSlot(ui.value.header, props.ui?.header));
|
|
67
|
+
const headingProps = computed(() => resolveSlot(ui.value.heading, props.ui?.heading));
|
|
68
|
+
const gridsProps = computed(() => resolveSlot(ui.value.grids, props.ui?.grids));
|
|
69
|
+
const gridProps = computed(() => resolveSlot(ui.value.grid, props.ui?.grid));
|
|
70
|
+
const gridHeadProps = computed(() => resolveSlot(ui.value.gridHead, props.ui?.gridHead));
|
|
71
|
+
const headCellProps = computed(() => resolveSlot(ui.value.headCell, props.ui?.headCell));
|
|
72
|
+
const cellProps = computed(() => resolveSlot(ui.value.cell, props.ui?.cell));
|
|
73
|
+
const dayButtonProps = computed(() => resolveSlot(ui.value.dayButton, props.ui?.dayButton));
|
|
74
|
+
const dayDetailsProps = computed(() => resolveSlot(ui.value.dayDetails, props.ui?.dayDetails));
|
|
75
|
+
const footerProps = computed(() => resolveSlot(ui.value.footer, props.ui?.footer));
|
|
76
|
+
const navButtonUi = { leadingIcon: "rtl:-scale-x-100" };
|
|
77
|
+
const dayDetailsId = (month, date) => `${detailsId}-${month.toString()}-${date.toString()}`;
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<template>
|
|
81
|
+
<CalendarRoot
|
|
82
|
+
:model-value="rootModelValue"
|
|
83
|
+
:default-value="defaultValue"
|
|
84
|
+
:placeholder="placeholder"
|
|
85
|
+
:default-placeholder="defaultPlaceholder"
|
|
86
|
+
:min-value="minValue"
|
|
87
|
+
:max-value="maxValue"
|
|
88
|
+
:is-date-disabled="isDateDisabled"
|
|
89
|
+
:is-date-unavailable="isDateUnavailable"
|
|
90
|
+
:locale="locale"
|
|
91
|
+
:number-of-months="numberOfMonths"
|
|
92
|
+
:paged-navigation="pagedNavigation"
|
|
93
|
+
:week-starts-on="weekStartsOn"
|
|
94
|
+
:weekday-format="weekdayFormat"
|
|
95
|
+
:fixed-weeks="fixedWeeks"
|
|
96
|
+
:disable-days-outside-current-view="disableDaysOutsideCurrentView"
|
|
97
|
+
:prevent-deselect="preventDeselect"
|
|
98
|
+
:disabled="disabled"
|
|
99
|
+
:readonly="readonly"
|
|
100
|
+
:initial-focus="initialFocus"
|
|
101
|
+
:calendar-label="calendarLabel"
|
|
102
|
+
:data-selaras-color="activeColor"
|
|
103
|
+
v-bind="rootProps"
|
|
104
|
+
@update:model-value="(value) => emit('update:modelValue', value)"
|
|
105
|
+
@update:placeholder="(value) => emit('update:placeholder', value)"
|
|
106
|
+
>
|
|
107
|
+
<template #default="{ grid, weekDays }">
|
|
108
|
+
<CalendarHeader v-bind="headerProps">
|
|
109
|
+
<CalendarPrev as-child>
|
|
110
|
+
<Button variant="ghost" :color="color" size="sm" :icon="icons.chevronLeft" :aria-label="messages.previousMonth" :ui="navButtonUi" />
|
|
111
|
+
</CalendarPrev>
|
|
112
|
+
<CalendarHeading v-bind="headingProps" />
|
|
113
|
+
<CalendarNext as-child>
|
|
114
|
+
<Button variant="ghost" :color="color" size="sm" :icon="icons.chevronRight" :aria-label="messages.nextMonth" :ui="navButtonUi" />
|
|
115
|
+
</CalendarNext>
|
|
116
|
+
</CalendarHeader>
|
|
117
|
+
|
|
118
|
+
<div v-bind="gridsProps">
|
|
119
|
+
<CalendarGrid v-for="month in grid" :key="month.value.toString()" v-bind="gridProps">
|
|
120
|
+
<CalendarGridHead v-bind="gridHeadProps">
|
|
121
|
+
<CalendarGridRow>
|
|
122
|
+
<CalendarHeadCell v-for="(day, index) in weekDays" :key="index" v-bind="headCellProps">
|
|
123
|
+
{{ day }}
|
|
124
|
+
</CalendarHeadCell>
|
|
125
|
+
</CalendarGridRow>
|
|
126
|
+
</CalendarGridHead>
|
|
127
|
+
<CalendarGridBody>
|
|
128
|
+
<CalendarGridRow v-for="(week, weekIndex) in month.rows" :key="weekIndex">
|
|
129
|
+
<CalendarCell v-for="date in week" :key="date.toString()" :date="date" v-bind="cellProps">
|
|
130
|
+
<CalendarCellTrigger
|
|
131
|
+
v-slot="dayState"
|
|
132
|
+
:day="date"
|
|
133
|
+
:month="month.value"
|
|
134
|
+
as-child
|
|
135
|
+
>
|
|
136
|
+
<Button
|
|
137
|
+
:variant="dayState.selected ? 'solid' : 'ghost'"
|
|
138
|
+
:color="dayState.selected ? activeColor : color"
|
|
139
|
+
size="sm"
|
|
140
|
+
square
|
|
141
|
+
:disabled="dayState.disabled"
|
|
142
|
+
:aria-describedby="slots['day-details'] ? dayDetailsId(month.value, date) : void 0"
|
|
143
|
+
v-bind="dayButtonProps"
|
|
144
|
+
>
|
|
145
|
+
<slot name="day" :date="date" :month="month.value" v-bind="dayState">
|
|
146
|
+
{{ dayState.dayValue }}
|
|
147
|
+
</slot>
|
|
148
|
+
</Button>
|
|
149
|
+
</CalendarCellTrigger>
|
|
150
|
+
<div v-if="slots['day-details']" :id="dayDetailsId(month.value, date)" v-bind="dayDetailsProps">
|
|
151
|
+
<slot name="day-details" :date="date" :month="month.value" />
|
|
152
|
+
</div>
|
|
153
|
+
</CalendarCell>
|
|
154
|
+
</CalendarGridRow>
|
|
155
|
+
</CalendarGridBody>
|
|
156
|
+
</CalendarGrid>
|
|
157
|
+
</div>
|
|
158
|
+
<div v-if="slots.footer" v-bind="footerProps">
|
|
159
|
+
<slot name="footer" />
|
|
160
|
+
</div>
|
|
161
|
+
</template>
|
|
162
|
+
</CalendarRoot>
|
|
163
|
+
</template>
|