@wirekyt/vue 0.0.1 → 0.0.3
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/accordion.cjs +273 -0
- package/dist/accordion.d.cts +195 -0
- package/dist/accordion.d.ts +195 -0
- package/dist/accordion.js +250 -0
- package/dist/angle-slider.cjs +268 -0
- package/dist/angle-slider.d.cts +228 -0
- package/dist/angle-slider.d.ts +228 -0
- package/dist/angle-slider.js +244 -0
- package/dist/avatar.cjs +145 -0
- package/dist/avatar.d.cts +114 -0
- package/dist/avatar.d.ts +114 -0
- package/dist/avatar.js +126 -0
- package/dist/boolean-BCaEpMxQ.js +6 -0
- package/dist/boolean-Dyu9-5Wp.cjs +11 -0
- package/dist/carousel.cjs +342 -0
- package/dist/carousel.d.cts +303 -0
- package/dist/carousel.d.ts +303 -0
- package/dist/carousel.js +320 -0
- package/dist/checkbox.cjs +345 -0
- package/dist/checkbox.d.cts +272 -0
- package/dist/checkbox.d.ts +272 -0
- package/dist/checkbox.js +324 -0
- package/dist/clean-props--1kqQE0Y.js +8 -0
- package/dist/clean-props-MyKqus13.cjs +13 -0
- package/dist/client-only.cjs +17 -0
- package/dist/client-only.d.cts +18 -0
- package/dist/client-only.d.ts +18 -0
- package/dist/client-only.js +16 -0
- package/dist/clipboard.cjs +229 -0
- package/dist/clipboard.d.cts +203 -0
- package/dist/clipboard.d.ts +203 -0
- package/dist/clipboard.js +206 -0
- package/dist/collapsible-BnUr4dTo.cjs +232 -0
- package/dist/collapsible-jvqnRz16.js +179 -0
- package/dist/collapsible.cjs +23 -0
- package/dist/collapsible.d.cts +161 -0
- package/dist/collapsible.d.ts +161 -0
- package/dist/collapsible.js +2 -0
- package/dist/collection-B0onOyyK.cjs +254 -0
- package/dist/collection-Dg6EtML_.js +211 -0
- package/dist/collection.cjs +9 -0
- package/dist/collection.d.cts +2 -0
- package/dist/collection.d.ts +2 -0
- package/dist/collection.js +2 -0
- package/dist/color-picker.cjs +804 -0
- package/dist/color-picker.d.cts +605 -0
- package/dist/color-picker.d.ts +605 -0
- package/dist/color-picker.js +759 -0
- package/dist/combobox.cjs +552 -0
- package/dist/combobox.d.cts +442 -0
- package/dist/combobox.d.ts +442 -0
- package/dist/combobox.js +521 -0
- package/dist/create-split-props-BBxrD7TV.js +10 -0
- package/dist/create-split-props-Jx-IEwdk.cjs +15 -0
- package/dist/date-input.cjs +293 -0
- package/dist/date-input.d.cts +212 -0
- package/dist/date-input.d.ts +212 -0
- package/dist/date-input.js +270 -0
- package/dist/date-picker.cjs +821 -0
- package/dist/date-picker.d.cts +637 -0
- package/dist/date-picker.d.ts +637 -0
- package/dist/date-picker.js +776 -0
- package/dist/dialog.cjs +333 -0
- package/dist/dialog.d.cts +272 -0
- package/dist/dialog.d.ts +272 -0
- package/dist/dialog.js +308 -0
- package/dist/download-trigger.cjs +65 -0
- package/dist/download-trigger.d.cts +34 -0
- package/dist/download-trigger.d.ts +34 -0
- package/dist/download-trigger.js +63 -0
- package/dist/drawer.cjs +448 -0
- package/dist/drawer.d.cts +346 -0
- package/dist/drawer.d.ts +346 -0
- package/dist/drawer.js +415 -0
- package/dist/editable.cjs +331 -0
- package/dist/editable.d.cts +285 -0
- package/dist/editable.d.ts +285 -0
- package/dist/editable.js +306 -0
- package/dist/factory-8Ao0DEy3.js +34 -0
- package/dist/factory-BNwuanv4.d.cts +21 -0
- package/dist/factory-BNwuanv4.d.ts +21 -0
- package/dist/factory-JL7MPjkk.cjs +45 -0
- package/dist/field-C3pLqz1S.js +435 -0
- package/dist/field-DRz-v4rB.cjs +524 -0
- package/dist/field.cjs +22 -0
- package/dist/field.d.cts +344 -0
- package/dist/field.d.ts +344 -0
- package/dist/field.js +2 -0
- package/dist/fieldset-ByP_r1Uq.js +216 -0
- package/dist/fieldset-C5aj6Ims.cjs +275 -0
- package/dist/fieldset.cjs +17 -0
- package/dist/fieldset.d.cts +159 -0
- package/dist/fieldset.d.ts +159 -0
- package/dist/fieldset.js +2 -0
- package/dist/file-upload.cjs +421 -0
- package/dist/file-upload.d.cts +327 -0
- package/dist/file-upload.d.ts +327 -0
- package/dist/file-upload.js +392 -0
- package/dist/floating-panel.cjs +412 -0
- package/dist/floating-panel.d.cts +337 -0
- package/dist/floating-panel.d.ts +337 -0
- package/dist/floating-panel.js +383 -0
- package/dist/focus-trap.cjs +79 -0
- package/dist/focus-trap.d.cts +46 -0
- package/dist/focus-trap.d.ts +46 -0
- package/dist/focus-trap.js +78 -0
- package/dist/format.cjs +116 -0
- package/dist/format.d.cts +46 -0
- package/dist/format.d.ts +46 -0
- package/dist/format.js +106 -0
- package/dist/frame.cjs +93 -0
- package/dist/frame.d.cts +37 -0
- package/dist/frame.d.ts +37 -0
- package/dist/frame.js +92 -0
- package/dist/highlight.cjs +44 -0
- package/dist/highlight.d.cts +32 -0
- package/dist/highlight.d.ts +32 -0
- package/dist/highlight.js +42 -0
- package/dist/hover-card.cjs +269 -0
- package/dist/hover-card.d.cts +202 -0
- package/dist/hover-card.d.ts +202 -0
- package/dist/hover-card.js +246 -0
- package/dist/image-cropper.cjs +252 -0
- package/dist/image-cropper.d.cts +207 -0
- package/dist/image-cropper.d.ts +207 -0
- package/dist/image-cropper.js +235 -0
- package/dist/index-B-o8jLyV.d.cts +31 -0
- package/dist/index-BSoF1D-v.d.ts +31 -0
- package/dist/index-BTNfeIXf.d.ts +104 -0
- package/dist/index-C8zR9eg3.d.ts +444 -0
- package/dist/index-Cc4qS0rQ.d.cts +38 -0
- package/dist/index-Cc4qS0rQ.d.ts +38 -0
- package/dist/index-DaLvr6SW.d.ts +37 -0
- package/dist/index-Di84rFjS.d.cts +444 -0
- package/dist/index-Dpm1wGVS.d.cts +74 -0
- package/dist/index-Zc9P69Ka.d.cts +104 -0
- package/dist/index-kCBQJqpU.d.ts +74 -0
- package/dist/index-vIbTjrJ-.d.cts +37 -0
- package/dist/index.cjs +43 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -0
- package/dist/json-tree-view.cjs +346 -0
- package/dist/json-tree-view.d.cts +86 -0
- package/dist/json-tree-view.d.ts +86 -0
- package/dist/json-tree-view.js +336 -0
- package/dist/listbox.cjs +386 -0
- package/dist/listbox.d.cts +323 -0
- package/dist/listbox.d.ts +323 -0
- package/dist/listbox.js +361 -0
- package/dist/marquee.cjs +256 -0
- package/dist/marquee.d.cts +208 -0
- package/dist/marquee.d.ts +208 -0
- package/dist/marquee.js +235 -0
- package/dist/menu.cjs +650 -0
- package/dist/menu.d.cts +501 -0
- package/dist/menu.d.ts +501 -0
- package/dist/menu.js +613 -0
- package/dist/navigation-menu.cjs +408 -0
- package/dist/navigation-menu.d.cts +271 -0
- package/dist/navigation-menu.d.ts +271 -0
- package/dist/navigation-menu.js +380 -0
- package/dist/number-input.cjs +298 -0
- package/dist/number-input.d.cts +253 -0
- package/dist/number-input.d.ts +253 -0
- package/dist/number-input.js +274 -0
- package/dist/pagination.cjs +249 -0
- package/dist/pagination.d.cts +209 -0
- package/dist/pagination.d.ts +209 -0
- package/dist/pagination.js +226 -0
- package/dist/password-input.cjs +232 -0
- package/dist/password-input.d.cts +208 -0
- package/dist/password-input.d.ts +208 -0
- package/dist/password-input.js +210 -0
- package/dist/pin-input.cjs +245 -0
- package/dist/pin-input.d.cts +199 -0
- package/dist/pin-input.d.ts +199 -0
- package/dist/pin-input.js +224 -0
- package/dist/popover.cjs +377 -0
- package/dist/popover.d.cts +324 -0
- package/dist/popover.d.ts +324 -0
- package/dist/popover.js +349 -0
- package/dist/presence-DD3l4Tgb.cjs +60 -0
- package/dist/presence-jaHZaD_O.js +43 -0
- package/dist/presence.cjs +7 -0
- package/dist/presence.d.cts +3 -0
- package/dist/presence.d.ts +3 -0
- package/dist/presence.js +3 -0
- package/dist/progress.cjs +270 -0
- package/dist/progress.d.cts +229 -0
- package/dist/progress.d.ts +229 -0
- package/dist/progress.js +245 -0
- package/dist/providers-5QhcwgSd.cjs +190 -0
- package/dist/providers-C3XQH-uu.js +119 -0
- package/dist/qr-code.cjs +195 -0
- package/dist/qr-code.d.cts +157 -0
- package/dist/qr-code.d.ts +157 -0
- package/dist/qr-code.js +174 -0
- package/dist/radio-group.cjs +274 -0
- package/dist/radio-group.d.cts +230 -0
- package/dist/radio-group.d.ts +230 -0
- package/dist/radio-group.js +249 -0
- package/dist/rating-group.cjs +243 -0
- package/dist/rating-group.d.cts +200 -0
- package/dist/rating-group.d.ts +200 -0
- package/dist/rating-group.js +220 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/rolldown-runtime-DakpK96I.cjs +43 -0
- package/dist/scroll-area.cjs +206 -0
- package/dist/scroll-area.d.cts +169 -0
- package/dist/scroll-area.d.ts +169 -0
- package/dist/scroll-area.js +184 -0
- package/dist/segment-group.cjs +318 -0
- package/dist/segment-group.d.cts +229 -0
- package/dist/segment-group.d.ts +229 -0
- package/dist/segment-group.js +298 -0
- package/dist/select.cjs +560 -0
- package/dist/select.d.cts +430 -0
- package/dist/select.d.ts +430 -0
- package/dist/select.js +523 -0
- package/dist/signature-pad.cjs +260 -0
- package/dist/signature-pad.d.cts +200 -0
- package/dist/signature-pad.d.ts +200 -0
- package/dist/signature-pad.js +237 -0
- package/dist/slider.cjs +350 -0
- package/dist/slider.d.cts +299 -0
- package/dist/slider.d.ts +299 -0
- package/dist/slider.js +323 -0
- package/dist/splitter.cjs +225 -0
- package/dist/splitter.d.cts +166 -0
- package/dist/splitter.d.ts +166 -0
- package/dist/splitter.js +198 -0
- package/dist/steps.cjs +348 -0
- package/dist/steps.d.cts +289 -0
- package/dist/steps.d.ts +289 -0
- package/dist/steps.js +319 -0
- package/dist/swap.cjs +154 -0
- package/dist/swap.d.cts +98 -0
- package/dist/swap.d.ts +98 -0
- package/dist/swap.js +141 -0
- package/dist/switch.cjs +213 -0
- package/dist/switch.d.cts +177 -0
- package/dist/switch.d.ts +177 -0
- package/dist/switch.js +192 -0
- package/dist/tabs.cjs +240 -0
- package/dist/tabs.d.cts +179 -0
- package/dist/tabs.d.ts +179 -0
- package/dist/tabs.js +218 -0
- package/dist/tags-input.cjs +405 -0
- package/dist/tags-input.d.cts +340 -0
- package/dist/tags-input.d.ts +340 -0
- package/dist/tags-input.js +376 -0
- package/dist/timer.cjs +221 -0
- package/dist/timer.d.cts +176 -0
- package/dist/timer.d.ts +176 -0
- package/dist/timer.js +199 -0
- package/dist/toast.cjs +211 -0
- package/dist/toast.d.cts +157 -0
- package/dist/toast.d.ts +157 -0
- package/dist/toast.js +189 -0
- package/dist/toggle-group.cjs +150 -0
- package/dist/toggle-group.d.cts +122 -0
- package/dist/toggle-group.d.ts +122 -0
- package/dist/toggle-group.js +132 -0
- package/dist/toggle.cjs +107 -0
- package/dist/toggle.d.cts +98 -0
- package/dist/toggle.d.ts +98 -0
- package/dist/toggle.js +94 -0
- package/dist/tooltip.cjs +265 -0
- package/dist/tooltip.d.cts +204 -0
- package/dist/tooltip.d.ts +204 -0
- package/dist/tooltip.js +242 -0
- package/dist/tour.cjs +418 -0
- package/dist/tour.d.cts +304 -0
- package/dist/tour.d.ts +304 -0
- package/dist/tour.js +374 -0
- package/dist/tree-view-DnTVwhew.cjs +651 -0
- package/dist/tree-view-goUH3_RC.js +508 -0
- package/dist/tree-view.cjs +41 -0
- package/dist/tree-view.d.cts +3 -0
- package/dist/tree-view.d.ts +3 -0
- package/dist/tree-view.js +3 -0
- package/dist/types-rSRkzyd6.d.cts +13 -0
- package/dist/types-rSRkzyd6.d.ts +13 -0
- package/dist/use-presence-BSp_dR-C.d.cts +22 -0
- package/dist/use-presence-CtEY6ZT8.cjs +49 -0
- package/dist/use-presence-DkGU_j9h.d.ts +22 -0
- package/dist/use-presence-oNdFU2c2.js +42 -0
- package/dist/utils-D95V66v9.js +548 -0
- package/dist/utils-XrBZd2Yk.cjs +625 -0
- package/package.json +277 -6
package/dist/dialog.d.ts
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { a as PolymorphicProps } from "./factory-BNwuanv4.js";
|
|
2
|
+
import { t as RootEmits$1 } from "./types-rSRkzyd6.js";
|
|
3
|
+
import { i as EmitFn$1, l as PropTypes, o as Optional } from "./index-BSoF1D-v.js";
|
|
4
|
+
import { n as RenderStrategyProps } from "./index-Cc4qS0rQ.js";
|
|
5
|
+
import { ButtonHTMLAttributes, ComputedRef, HTMLAttributes, MaybeRef, SlotsType, UnwrapRef } from "vue";
|
|
6
|
+
import * as dialog from "@wirekyt/dom/machines/dialog";
|
|
7
|
+
import { FocusOutsideEvent, FocusOutsideEvent as DialogFocusOutsideEvent, InteractOutsideEvent, InteractOutsideEvent as DialogInteractOutsideEvent, OpenChangeDetails, OpenChangeDetails as DialogOpenChangeDetails, PointerDownOutsideEvent, PointerDownOutsideEvent as DialogPointerDownOutsideEvent, TriggerProps, TriggerValueChangeDetails, TriggerValueChangeDetails as DialogTriggerValueChangeDetails, anatomy as dialogAnatomy } from "@wirekyt/dom/machines/dialog";
|
|
8
|
+
//#region src/components/dialog/backdrop.vue.d.ts
|
|
9
|
+
interface DialogBackdropBaseProps extends PolymorphicProps {}
|
|
10
|
+
interface DialogBackdropProps extends DialogBackdropBaseProps,
|
|
11
|
+
/**
|
|
12
|
+
* @vue-ignore
|
|
13
|
+
*/
|
|
14
|
+
HTMLAttributes {}
|
|
15
|
+
declare const _default: typeof __VLS_export$9;
|
|
16
|
+
declare const __VLS_export$9: __VLS_WithSlots$9<import("vue").DefineComponent<DialogBackdropProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogBackdropProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
17
|
+
default?: (props: {}) => any;
|
|
18
|
+
}>;
|
|
19
|
+
type __VLS_WithSlots$9<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/dialog/close-trigger.vue.d.ts
|
|
26
|
+
interface DialogCloseTriggerBaseProps extends PolymorphicProps {}
|
|
27
|
+
interface DialogCloseTriggerProps extends DialogCloseTriggerBaseProps,
|
|
28
|
+
/**
|
|
29
|
+
* @vue-ignore
|
|
30
|
+
*/
|
|
31
|
+
ButtonHTMLAttributes {}
|
|
32
|
+
declare const _default$1: typeof __VLS_export$8;
|
|
33
|
+
declare const __VLS_export$8: __VLS_WithSlots$8<import("vue").DefineComponent<DialogCloseTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogCloseTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
34
|
+
default?: (props: {}) => any;
|
|
35
|
+
}>;
|
|
36
|
+
type __VLS_WithSlots$8<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/dialog/content.vue.d.ts
|
|
43
|
+
interface DialogContentBaseProps extends PolymorphicProps {}
|
|
44
|
+
interface DialogContentProps extends DialogContentBaseProps,
|
|
45
|
+
/**
|
|
46
|
+
* @vue-ignore
|
|
47
|
+
*/
|
|
48
|
+
HTMLAttributes {}
|
|
49
|
+
declare const _default$2: typeof __VLS_export$7;
|
|
50
|
+
declare const __VLS_export$7: __VLS_WithSlots$7<import("vue").DefineComponent<DialogContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
51
|
+
default?: (props: {}) => any;
|
|
52
|
+
}>;
|
|
53
|
+
type __VLS_WithSlots$7<T, S> = T & {
|
|
54
|
+
new (): {
|
|
55
|
+
$slots: S;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/components/dialog/description.vue.d.ts
|
|
60
|
+
interface DialogDescriptionBaseProps extends PolymorphicProps {}
|
|
61
|
+
interface DialogDescriptionProps extends DialogDescriptionBaseProps,
|
|
62
|
+
/**
|
|
63
|
+
* @vue-ignore
|
|
64
|
+
*/
|
|
65
|
+
HTMLAttributes {}
|
|
66
|
+
declare const _default$4: typeof __VLS_export$6;
|
|
67
|
+
declare const __VLS_export$6: __VLS_WithSlots$6<import("vue").DefineComponent<DialogDescriptionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogDescriptionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
68
|
+
default?: (props: {}) => any;
|
|
69
|
+
}>;
|
|
70
|
+
type __VLS_WithSlots$6<T, S> = T & {
|
|
71
|
+
new (): {
|
|
72
|
+
$slots: S;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/components/dialog/positioner.vue.d.ts
|
|
77
|
+
interface DialogPositionerBaseProps extends PolymorphicProps {}
|
|
78
|
+
interface DialogPositionerProps extends DialogPositionerBaseProps,
|
|
79
|
+
/**
|
|
80
|
+
* @vue-ignore
|
|
81
|
+
*/
|
|
82
|
+
HTMLAttributes {}
|
|
83
|
+
declare const _default$5: typeof __VLS_export$5;
|
|
84
|
+
declare const __VLS_export$5: __VLS_WithSlots$5<import("vue").DefineComponent<DialogPositionerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogPositionerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
85
|
+
default?: (props: {}) => any;
|
|
86
|
+
}>;
|
|
87
|
+
type __VLS_WithSlots$5<T, S> = T & {
|
|
88
|
+
new (): {
|
|
89
|
+
$slots: S;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/components/dialog/root-provider.vue.d.ts
|
|
94
|
+
interface RootProviderProps {
|
|
95
|
+
value: UnwrapRef<UseDialogReturn>;
|
|
96
|
+
}
|
|
97
|
+
interface DialogRootProviderBaseProps extends RootProviderProps, RenderStrategyProps {}
|
|
98
|
+
interface DialogRootProviderProps extends DialogRootProviderBaseProps {}
|
|
99
|
+
interface DialogRootProviderEmits extends RootEmits$1 {}
|
|
100
|
+
declare const _default$7: typeof __VLS_export$4;
|
|
101
|
+
declare const __VLS_export$4: __VLS_WithSlots$4<import("vue").DefineComponent<DialogRootProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
102
|
+
exitComplete: () => any;
|
|
103
|
+
}, string, import("vue").PublicProps, Readonly<DialogRootProviderProps> & Readonly<{
|
|
104
|
+
onExitComplete?: (() => any) | undefined;
|
|
105
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
106
|
+
default?: (props: {}) => any;
|
|
107
|
+
}>;
|
|
108
|
+
type __VLS_WithSlots$4<T, S> = T & {
|
|
109
|
+
new (): {
|
|
110
|
+
$slots: S;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/components/dialog/types.d.ts
|
|
115
|
+
interface RootProps {
|
|
116
|
+
"aria-label"?: string;
|
|
117
|
+
closeOnEscape?: boolean;
|
|
118
|
+
closeOnInteractOutside?: boolean;
|
|
119
|
+
defaultOpen?: boolean;
|
|
120
|
+
finalFocusEl?: () => HTMLElement | null;
|
|
121
|
+
id?: string;
|
|
122
|
+
ids?: Partial<{
|
|
123
|
+
trigger: string;
|
|
124
|
+
positioner: string;
|
|
125
|
+
backdrop: string;
|
|
126
|
+
content: string;
|
|
127
|
+
closeTrigger: string;
|
|
128
|
+
title: string;
|
|
129
|
+
description: string;
|
|
130
|
+
}>;
|
|
131
|
+
initialFocusEl?: () => HTMLElement | null;
|
|
132
|
+
modal?: boolean;
|
|
133
|
+
open?: boolean;
|
|
134
|
+
persistentElements?: (() => Element | null)[];
|
|
135
|
+
preventScroll?: boolean;
|
|
136
|
+
restoreFocus?: boolean;
|
|
137
|
+
role?: "dialog" | "alertdialog";
|
|
138
|
+
trapFocus?: boolean;
|
|
139
|
+
triggerValue?: string | null;
|
|
140
|
+
defaultTriggerValue?: string | null;
|
|
141
|
+
}
|
|
142
|
+
type RootEmits = {
|
|
143
|
+
escapeKeyDown: [event: KeyboardEvent];
|
|
144
|
+
exitComplete: [];
|
|
145
|
+
focusOutside: [event: dialog.FocusOutsideEvent];
|
|
146
|
+
interactOutside: [event: dialog.InteractOutsideEvent];
|
|
147
|
+
openChange: [details: dialog.OpenChangeDetails];
|
|
148
|
+
pointerDownOutside: [event: dialog.PointerDownOutsideEvent];
|
|
149
|
+
requestDismiss: [event: CustomEvent<{
|
|
150
|
+
originalLayer: HTMLElement;
|
|
151
|
+
targetLayer: HTMLElement | undefined;
|
|
152
|
+
originalIndex: number;
|
|
153
|
+
targetIndex: number;
|
|
154
|
+
}>];
|
|
155
|
+
triggerValueChange: [details: dialog.TriggerValueChangeDetails];
|
|
156
|
+
"update:open": [open: boolean];
|
|
157
|
+
};
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/components/dialog/root.vue.d.ts
|
|
160
|
+
interface DialogRootBaseProps extends RootProps, RenderStrategyProps {}
|
|
161
|
+
interface DialogRootProps extends DialogRootBaseProps {}
|
|
162
|
+
interface DialogRootEmits extends RootEmits {}
|
|
163
|
+
declare const _default$6: typeof __VLS_export$3;
|
|
164
|
+
declare const __VLS_export$3: __VLS_WithSlots$3<import("vue").DefineComponent<DialogRootProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
165
|
+
exitComplete: () => any;
|
|
166
|
+
openChange: (details: import("@wirekyt/dom/machines/dialog").OpenChangeDetails) => any;
|
|
167
|
+
"update:open": (open: boolean) => any;
|
|
168
|
+
focusOutside: (event: import("@wirekyt/dom/machines/color-picker").FocusOutsideEvent) => any;
|
|
169
|
+
interactOutside: (event: import("@wirekyt/dom/machines/color-picker").InteractOutsideEvent) => any;
|
|
170
|
+
pointerDownOutside: (event: import("@wirekyt/dom/machines/color-picker").PointerDownOutsideEvent) => any;
|
|
171
|
+
triggerValueChange: (details: import("@wirekyt/dom/machines/dialog").TriggerValueChangeDetails) => any;
|
|
172
|
+
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
173
|
+
requestDismiss: (event: CustomEvent<{
|
|
174
|
+
originalLayer: HTMLElement;
|
|
175
|
+
targetLayer: HTMLElement | undefined;
|
|
176
|
+
originalIndex: number;
|
|
177
|
+
targetIndex: number;
|
|
178
|
+
}>) => any;
|
|
179
|
+
}, string, import("vue").PublicProps, Readonly<DialogRootProps> & Readonly<{
|
|
180
|
+
onExitComplete?: (() => any) | undefined;
|
|
181
|
+
onOpenChange?: ((details: import("@wirekyt/dom/machines/dialog").OpenChangeDetails) => any) | undefined;
|
|
182
|
+
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
183
|
+
onFocusOutside?: ((event: import("@wirekyt/dom/machines/color-picker").FocusOutsideEvent) => any) | undefined;
|
|
184
|
+
onInteractOutside?: ((event: import("@wirekyt/dom/machines/color-picker").InteractOutsideEvent) => any) | undefined;
|
|
185
|
+
onPointerDownOutside?: ((event: import("@wirekyt/dom/machines/color-picker").PointerDownOutsideEvent) => any) | undefined;
|
|
186
|
+
onTriggerValueChange?: ((details: import("@wirekyt/dom/machines/dialog").TriggerValueChangeDetails) => any) | undefined;
|
|
187
|
+
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
188
|
+
onRequestDismiss?: ((event: CustomEvent<{
|
|
189
|
+
originalLayer: HTMLElement;
|
|
190
|
+
targetLayer: HTMLElement | undefined;
|
|
191
|
+
originalIndex: number;
|
|
192
|
+
targetIndex: number;
|
|
193
|
+
}>) => any) | undefined;
|
|
194
|
+
}>, {
|
|
195
|
+
open: boolean;
|
|
196
|
+
defaultOpen: boolean;
|
|
197
|
+
closeOnEscape: boolean;
|
|
198
|
+
trapFocus: boolean;
|
|
199
|
+
preventScroll: boolean;
|
|
200
|
+
modal: boolean;
|
|
201
|
+
restoreFocus: boolean;
|
|
202
|
+
closeOnInteractOutside: boolean;
|
|
203
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
204
|
+
default?: (props: {}) => any;
|
|
205
|
+
}>;
|
|
206
|
+
type __VLS_WithSlots$3<T, S> = T & {
|
|
207
|
+
new (): {
|
|
208
|
+
$slots: S;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/components/dialog/title.vue.d.ts
|
|
213
|
+
interface DialogTitleBaseProps extends PolymorphicProps {}
|
|
214
|
+
interface DialogTitleProps extends DialogTitleBaseProps,
|
|
215
|
+
/**
|
|
216
|
+
* @vue-ignore
|
|
217
|
+
*/
|
|
218
|
+
HTMLAttributes {}
|
|
219
|
+
declare const _default$8: typeof __VLS_export$2;
|
|
220
|
+
declare const __VLS_export$2: __VLS_WithSlots$2<import("vue").DefineComponent<DialogTitleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogTitleProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
221
|
+
default?: (props: {}) => any;
|
|
222
|
+
}>;
|
|
223
|
+
type __VLS_WithSlots$2<T, S> = T & {
|
|
224
|
+
new (): {
|
|
225
|
+
$slots: S;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/components/dialog/trigger.vue.d.ts
|
|
230
|
+
interface DialogTriggerBaseProps extends TriggerProps, PolymorphicProps {}
|
|
231
|
+
interface DialogTriggerProps extends DialogTriggerBaseProps,
|
|
232
|
+
/**
|
|
233
|
+
* @vue-ignore
|
|
234
|
+
*/
|
|
235
|
+
Omit<ButtonHTMLAttributes, "value"> {}
|
|
236
|
+
declare const _default$9: typeof __VLS_export$1;
|
|
237
|
+
declare const __VLS_export$1: __VLS_WithSlots$1<import("vue").DefineComponent<DialogTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
238
|
+
default?: (props: {}) => any;
|
|
239
|
+
}>;
|
|
240
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
241
|
+
new (): {
|
|
242
|
+
$slots: S;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
declare namespace dialog_d_exports {
|
|
246
|
+
export { _default as Backdrop, DialogBackdropBaseProps as BackdropBaseProps, DialogBackdropProps as BackdropProps, _default$1 as CloseTrigger, DialogCloseTriggerBaseProps as CloseTriggerBaseProps, DialogCloseTriggerProps as CloseTriggerProps, _default$2 as Content, DialogContentBaseProps as ContentBaseProps, DialogContentProps as ContentProps, _default$3 as Context, DialogContextProps as ContextProps, _default$4 as Description, DialogDescriptionBaseProps as DescriptionBaseProps, DialogDescriptionProps as DescriptionProps, FocusOutsideEvent, InteractOutsideEvent, OpenChangeDetails, PointerDownOutsideEvent, _default$5 as Positioner, DialogPositionerBaseProps as PositionerBaseProps, DialogPositionerProps as PositionerProps, _default$6 as Root, DialogRootBaseProps as RootBaseProps, DialogRootEmits as RootEmits, DialogRootProps as RootProps, _default$7 as RootProvider, DialogRootProviderBaseProps as RootProviderBaseProps, DialogRootProviderProps as RootProviderProps, _default$8 as Title, DialogTitleBaseProps as TitleBaseProps, DialogTitleProps as TitleProps, _default$9 as Trigger, DialogTriggerBaseProps as TriggerBaseProps, DialogTriggerProps as TriggerProps, TriggerValueChangeDetails };
|
|
247
|
+
}
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/components/dialog/use-dialog.d.ts
|
|
250
|
+
interface UseDialogProps extends Optional<Omit<dialog.Props, "dir" | "getRootNode">, "id"> {}
|
|
251
|
+
interface UseDialogReturn extends ComputedRef<dialog.Api<PropTypes>> {}
|
|
252
|
+
declare const useDialog: (props?: MaybeRef<UseDialogProps>, emit?: EmitFn$1<DialogRootEmits>) => ComputedRef<dialog.Api<PropTypes>>;
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/components/dialog/use-context.d.ts
|
|
255
|
+
interface UseDialogContext extends UseDialogReturn {}
|
|
256
|
+
declare const DialogProvider: (opts: UseDialogContext) => void, useDialogContext: (fallback?: UseDialogContext | undefined) => UseDialogContext;
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/components/dialog/context.vue.d.ts
|
|
259
|
+
interface DialogContextProps extends SlotsType<{
|
|
260
|
+
default: UnwrapRef<UseDialogContext>;
|
|
261
|
+
}> {}
|
|
262
|
+
declare const _default$3: typeof __VLS_export;
|
|
263
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
264
|
+
default(dialog: UnwrapRef<UseDialogContext>): unknown;
|
|
265
|
+
}>;
|
|
266
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
267
|
+
new (): {
|
|
268
|
+
$slots: S;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
//#endregion
|
|
272
|
+
export { dialog_d_exports as Dialog, _default as DialogBackdrop, type DialogBackdropBaseProps, type DialogBackdropProps, _default$1 as DialogCloseTrigger, type DialogCloseTriggerBaseProps, type DialogCloseTriggerProps, _default$2 as DialogContent, type DialogContentBaseProps, type DialogContentProps, _default$3 as DialogContext, type DialogContextProps, _default$4 as DialogDescription, type DialogDescriptionBaseProps, type DialogDescriptionProps, type DialogFocusOutsideEvent, type DialogInteractOutsideEvent, type DialogOpenChangeDetails, type DialogPointerDownOutsideEvent, _default$5 as DialogPositioner, type DialogPositionerBaseProps, type DialogPositionerProps, _default$6 as DialogRoot, type DialogRootBaseProps, type DialogRootEmits, type DialogRootProps, _default$7 as DialogRootProvider, type DialogRootProviderBaseProps, type DialogRootProviderEmits, type DialogRootProviderProps, _default$8 as DialogTitle, type DialogTitleBaseProps, type DialogTitleProps, _default$9 as DialogTrigger, type DialogTriggerBaseProps, type DialogTriggerProps, type DialogTriggerValueChangeDetails, type UseDialogContext, type UseDialogProps, type UseDialogReturn, dialogAnatomy, useDialog, useDialogContext };
|
package/dist/dialog.js
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { a as mergeProps$1, c as normalizeProps$1, d as useForwardExpose, m as createContext, n as RenderStrategyPropsProvider, r as useRenderStrategyProps, s as useMachine } from "./utils-D95V66v9.js";
|
|
3
|
+
import { a as DEFAULT_LOCALE, d as useEnvironmentContext, o as useLocaleContext, u as DEFAULT_ENVIRONMENT } from "./providers-C3XQH-uu.js";
|
|
4
|
+
import { t as cleanProps } from "./clean-props--1kqQE0Y.js";
|
|
5
|
+
import { n as wire } from "./factory-8Ao0DEy3.js";
|
|
6
|
+
import { n as PresenceProvider, r as usePresenceContext } from "./presence-jaHZaD_O.js";
|
|
7
|
+
import { t as usePresence } from "./use-presence-oNdFU2c2.js";
|
|
8
|
+
import { computed, createBlock, createCommentVNode, defineComponent, guardReactiveProps, mergeDefaults, mergeProps, normalizeProps, openBlock, renderSlot, toValue, unref, useId, withCtx } from "vue";
|
|
9
|
+
import * as dialog from "@wirekyt/dom/machines/dialog";
|
|
10
|
+
import { anatomy as dialogAnatomy } from "@wirekyt/dom/machines/dialog";
|
|
11
|
+
//#region src/components/dialog/use-context.ts
|
|
12
|
+
const [DialogProvider, useDialogContext] = createContext("DialogContext");
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/dialog/backdrop.vue
|
|
15
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
16
|
+
__name: "backdrop",
|
|
17
|
+
props: { asChild: { type: Boolean } },
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const dialog = useDialogContext();
|
|
20
|
+
const renderStrategy = useRenderStrategyProps();
|
|
21
|
+
const presence = usePresence(computed(() => ({
|
|
22
|
+
...renderStrategy.value,
|
|
23
|
+
present: dialog.value.open
|
|
24
|
+
})));
|
|
25
|
+
const mergedProps = computed(() => mergeProps$1(dialog.value.getBackdropProps(), presence.value.presenceProps));
|
|
26
|
+
useForwardExpose();
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
return !unref(presence).unmounted ? (openBlock(), createBlock(unref(wire).div, mergeProps({ key: 0 }, mergedProps.value, { "as-child": __props.asChild }), {
|
|
29
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
30
|
+
_: 3
|
|
31
|
+
}, 16, ["as-child"])) : createCommentVNode("v-if", true);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/dialog/close-trigger.vue
|
|
37
|
+
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
38
|
+
__name: "close-trigger",
|
|
39
|
+
props: { asChild: { type: Boolean } },
|
|
40
|
+
setup(__props) {
|
|
41
|
+
const dialog = useDialogContext();
|
|
42
|
+
useForwardExpose();
|
|
43
|
+
return (_ctx, _cache) => {
|
|
44
|
+
return openBlock(), createBlock(unref(wire).button, mergeProps(unref(dialog).getCloseTriggerProps(), { "as-child": __props.asChild }), {
|
|
45
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
46
|
+
_: 3
|
|
47
|
+
}, 16, ["as-child"]);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/components/dialog/content.vue
|
|
53
|
+
const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
54
|
+
__name: "content",
|
|
55
|
+
props: { asChild: { type: Boolean } },
|
|
56
|
+
setup(__props) {
|
|
57
|
+
const dialog = useDialogContext();
|
|
58
|
+
const presence = usePresenceContext();
|
|
59
|
+
const mergedProps = computed(() => mergeProps$1(dialog.value.getContentProps(), presence.value.presenceProps));
|
|
60
|
+
useForwardExpose();
|
|
61
|
+
return (_ctx, _cache) => {
|
|
62
|
+
return !unref(presence).unmounted ? (openBlock(), createBlock(unref(wire).div, mergeProps({ key: 0 }, mergedProps.value, { "as-child": __props.asChild }), {
|
|
63
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
64
|
+
_: 3
|
|
65
|
+
}, 16, ["as-child"])) : createCommentVNode("v-if", true);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/components/dialog/context.vue
|
|
71
|
+
const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
72
|
+
__name: "context",
|
|
73
|
+
setup(__props) {
|
|
74
|
+
const dialog = useDialogContext();
|
|
75
|
+
return (_ctx, _cache) => {
|
|
76
|
+
return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(dialog))));
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/components/dialog/description.vue
|
|
82
|
+
const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
83
|
+
__name: "description",
|
|
84
|
+
props: { asChild: { type: Boolean } },
|
|
85
|
+
setup(__props) {
|
|
86
|
+
const dialog = useDialogContext();
|
|
87
|
+
useForwardExpose();
|
|
88
|
+
return (_ctx, _cache) => {
|
|
89
|
+
return openBlock(), createBlock(unref(wire).div, mergeProps(unref(dialog).getDescriptionProps(), { "as-child": __props.asChild }), {
|
|
90
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
91
|
+
_: 3
|
|
92
|
+
}, 16, ["as-child"]);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/components/dialog/positioner.vue
|
|
98
|
+
const _sfc_main$5 = /*@__PURE__*/ defineComponent({
|
|
99
|
+
__name: "positioner",
|
|
100
|
+
props: { asChild: { type: Boolean } },
|
|
101
|
+
setup(__props) {
|
|
102
|
+
const dialog = useDialogContext();
|
|
103
|
+
const presence = usePresenceContext();
|
|
104
|
+
useForwardExpose();
|
|
105
|
+
return (_ctx, _cache) => {
|
|
106
|
+
return !unref(presence).unmounted ? (openBlock(), createBlock(unref(wire).div, mergeProps({ key: 0 }, unref(dialog).getPositionerProps(), { "as-child": __props.asChild }), {
|
|
107
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
108
|
+
_: 3
|
|
109
|
+
}, 16, ["as-child"])) : createCommentVNode("v-if", true);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/components/dialog/root-provider.vue
|
|
115
|
+
const _sfc_main$7 = /*@__PURE__*/ defineComponent({
|
|
116
|
+
__name: "root-provider",
|
|
117
|
+
props: {
|
|
118
|
+
value: {},
|
|
119
|
+
lazyMount: { type: Boolean },
|
|
120
|
+
unmountOnExit: { type: Boolean }
|
|
121
|
+
},
|
|
122
|
+
emits: ["exitComplete"],
|
|
123
|
+
setup(__props, { emit: __emit }) {
|
|
124
|
+
const props = __props;
|
|
125
|
+
const emits = __emit;
|
|
126
|
+
const dialog = computed(() => props.value);
|
|
127
|
+
const presence = usePresence(computed(() => ({
|
|
128
|
+
present: dialog.value.open,
|
|
129
|
+
lazyMount: props.lazyMount,
|
|
130
|
+
unmountOnExit: props.unmountOnExit
|
|
131
|
+
})), emits);
|
|
132
|
+
DialogProvider(dialog);
|
|
133
|
+
PresenceProvider(presence);
|
|
134
|
+
RenderStrategyPropsProvider(computed(() => ({
|
|
135
|
+
lazyMount: props.lazyMount,
|
|
136
|
+
unmountOnExit: props.unmountOnExit
|
|
137
|
+
})));
|
|
138
|
+
useForwardExpose();
|
|
139
|
+
return (_ctx, _cache) => {
|
|
140
|
+
return renderSlot(_ctx.$slots, "default");
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/components/dialog/use-dialog.ts
|
|
146
|
+
const useDialog = (props = {}, emit) => {
|
|
147
|
+
const id = useId();
|
|
148
|
+
const env = useEnvironmentContext(DEFAULT_ENVIRONMENT);
|
|
149
|
+
const locale = useLocaleContext(DEFAULT_LOCALE);
|
|
150
|
+
const context = computed(() => {
|
|
151
|
+
const localeProps = toValue(props);
|
|
152
|
+
return {
|
|
153
|
+
id,
|
|
154
|
+
dir: locale.value.dir,
|
|
155
|
+
getRootNode: env?.value.getRootNode,
|
|
156
|
+
...cleanProps(localeProps),
|
|
157
|
+
onOpenChange: (details) => {
|
|
158
|
+
emit?.("openChange", details);
|
|
159
|
+
emit?.("update:open", details.open);
|
|
160
|
+
localeProps.onOpenChange?.(details);
|
|
161
|
+
},
|
|
162
|
+
onTriggerValueChange: (details) => {
|
|
163
|
+
emit?.("triggerValueChange", details);
|
|
164
|
+
localeProps.onTriggerValueChange?.(details);
|
|
165
|
+
},
|
|
166
|
+
onEscapeKeyDown: (details) => {
|
|
167
|
+
emit?.("escapeKeyDown", details);
|
|
168
|
+
localeProps.onEscapeKeyDown?.(details);
|
|
169
|
+
},
|
|
170
|
+
onFocusOutside: (details) => {
|
|
171
|
+
emit?.("focusOutside", details);
|
|
172
|
+
localeProps.onFocusOutside?.(details);
|
|
173
|
+
},
|
|
174
|
+
onInteractOutside: (details) => {
|
|
175
|
+
emit?.("interactOutside", details);
|
|
176
|
+
localeProps.onInteractOutside?.(details);
|
|
177
|
+
},
|
|
178
|
+
onPointerDownOutside: (details) => {
|
|
179
|
+
emit?.("pointerDownOutside", details);
|
|
180
|
+
localeProps.onPointerDownOutside?.(details);
|
|
181
|
+
},
|
|
182
|
+
onRequestDismiss: (details) => {
|
|
183
|
+
emit?.("requestDismiss", details);
|
|
184
|
+
localeProps.onRequestDismiss?.(details);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
});
|
|
188
|
+
const service = useMachine(dialog.machine, context);
|
|
189
|
+
return computed(() => dialog.connect(service, normalizeProps$1));
|
|
190
|
+
};
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/components/dialog/root.vue
|
|
193
|
+
const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
194
|
+
__name: "root",
|
|
195
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
196
|
+
"aria-label": {},
|
|
197
|
+
closeOnEscape: { type: Boolean },
|
|
198
|
+
closeOnInteractOutside: { type: Boolean },
|
|
199
|
+
defaultOpen: { type: Boolean },
|
|
200
|
+
finalFocusEl: { type: Function },
|
|
201
|
+
id: {},
|
|
202
|
+
ids: {},
|
|
203
|
+
initialFocusEl: { type: Function },
|
|
204
|
+
modal: { type: Boolean },
|
|
205
|
+
open: { type: Boolean },
|
|
206
|
+
persistentElements: {},
|
|
207
|
+
preventScroll: { type: Boolean },
|
|
208
|
+
restoreFocus: { type: Boolean },
|
|
209
|
+
role: {},
|
|
210
|
+
trapFocus: { type: Boolean },
|
|
211
|
+
triggerValue: {},
|
|
212
|
+
defaultTriggerValue: {},
|
|
213
|
+
lazyMount: { type: Boolean },
|
|
214
|
+
unmountOnExit: { type: Boolean }
|
|
215
|
+
}, {
|
|
216
|
+
closeOnEscape: void 0,
|
|
217
|
+
closeOnInteractOutside: void 0,
|
|
218
|
+
defaultOpen: void 0,
|
|
219
|
+
modal: void 0,
|
|
220
|
+
open: void 0,
|
|
221
|
+
preventScroll: void 0,
|
|
222
|
+
restoreFocus: void 0,
|
|
223
|
+
trapFocus: void 0
|
|
224
|
+
}),
|
|
225
|
+
emits: [
|
|
226
|
+
"escapeKeyDown",
|
|
227
|
+
"exitComplete",
|
|
228
|
+
"focusOutside",
|
|
229
|
+
"interactOutside",
|
|
230
|
+
"openChange",
|
|
231
|
+
"pointerDownOutside",
|
|
232
|
+
"requestDismiss",
|
|
233
|
+
"triggerValueChange",
|
|
234
|
+
"update:open"
|
|
235
|
+
],
|
|
236
|
+
setup(__props, { emit: __emit }) {
|
|
237
|
+
const props = __props;
|
|
238
|
+
const emits = __emit;
|
|
239
|
+
const dialog = useDialog(props, emits);
|
|
240
|
+
const presence = usePresence(computed(() => ({
|
|
241
|
+
present: dialog.value.open,
|
|
242
|
+
lazyMount: props.lazyMount,
|
|
243
|
+
unmountOnExit: props.unmountOnExit
|
|
244
|
+
})), emits);
|
|
245
|
+
DialogProvider(dialog);
|
|
246
|
+
PresenceProvider(presence);
|
|
247
|
+
RenderStrategyPropsProvider(computed(() => ({
|
|
248
|
+
lazyMount: props.lazyMount,
|
|
249
|
+
unmountOnExit: props.unmountOnExit
|
|
250
|
+
})));
|
|
251
|
+
useForwardExpose();
|
|
252
|
+
return (_ctx, _cache) => {
|
|
253
|
+
return renderSlot(_ctx.$slots, "default");
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/components/dialog/title.vue
|
|
259
|
+
const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
260
|
+
__name: "title",
|
|
261
|
+
props: { asChild: { type: Boolean } },
|
|
262
|
+
setup(__props) {
|
|
263
|
+
const dialog = useDialogContext();
|
|
264
|
+
useForwardExpose();
|
|
265
|
+
return (_ctx, _cache) => {
|
|
266
|
+
return openBlock(), createBlock(unref(wire).h2, mergeProps(unref(dialog).getTitleProps(), { "as-child": __props.asChild }), {
|
|
267
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
268
|
+
_: 3
|
|
269
|
+
}, 16, ["as-child"]);
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/components/dialog/trigger.vue
|
|
275
|
+
const _sfc_main$9 = /*@__PURE__*/ defineComponent({
|
|
276
|
+
__name: "trigger",
|
|
277
|
+
props: {
|
|
278
|
+
value: {},
|
|
279
|
+
asChild: { type: Boolean }
|
|
280
|
+
},
|
|
281
|
+
setup(__props) {
|
|
282
|
+
const props = __props;
|
|
283
|
+
const dialog = useDialogContext();
|
|
284
|
+
useForwardExpose();
|
|
285
|
+
return (_ctx, _cache) => {
|
|
286
|
+
return openBlock(), createBlock(unref(wire).button, mergeProps(unref(dialog).getTriggerProps(props), { "as-child": __props.asChild }), {
|
|
287
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
288
|
+
_: 3
|
|
289
|
+
}, 16, ["as-child"]);
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/components/dialog/dialog.ts
|
|
295
|
+
var dialog_exports = /* @__PURE__ */ __exportAll({
|
|
296
|
+
Backdrop: () => _sfc_main,
|
|
297
|
+
CloseTrigger: () => _sfc_main$1,
|
|
298
|
+
Content: () => _sfc_main$2,
|
|
299
|
+
Context: () => _sfc_main$3,
|
|
300
|
+
Description: () => _sfc_main$4,
|
|
301
|
+
Positioner: () => _sfc_main$5,
|
|
302
|
+
Root: () => _sfc_main$6,
|
|
303
|
+
RootProvider: () => _sfc_main$7,
|
|
304
|
+
Title: () => _sfc_main$8,
|
|
305
|
+
Trigger: () => _sfc_main$9
|
|
306
|
+
});
|
|
307
|
+
//#endregion
|
|
308
|
+
export { dialog_exports as Dialog, _sfc_main as DialogBackdrop, _sfc_main$1 as DialogCloseTrigger, _sfc_main$2 as DialogContent, _sfc_main$3 as DialogContext, _sfc_main$4 as DialogDescription, _sfc_main$5 as DialogPositioner, _sfc_main$6 as DialogRoot, _sfc_main$7 as DialogRootProvider, _sfc_main$8 as DialogTitle, _sfc_main$9 as DialogTrigger, dialogAnatomy, useDialog, useDialogContext };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utils = require("./utils-XrBZd2Yk.cjs");
|
|
3
|
+
const require_providers = require("./providers-5QhcwgSd.cjs");
|
|
4
|
+
const require_factory = require("./factory-JL7MPjkk.cjs");
|
|
5
|
+
let vue = require("vue");
|
|
6
|
+
let _wirekyt_dom_file_utils = require("@wirekyt/dom/file-utils");
|
|
7
|
+
//#region src/components/download-trigger/use-download.ts
|
|
8
|
+
const useDownload = (props) => {
|
|
9
|
+
const env = require_providers.useEnvironmentContext(require_providers.DEFAULT_ENVIRONMENT);
|
|
10
|
+
const download = () => {
|
|
11
|
+
const { fileName, mimeType, data } = (0, vue.toValue)(props);
|
|
12
|
+
const win = env?.value.getWindow() || window;
|
|
13
|
+
const saveToDisk = (value) => {
|
|
14
|
+
(0, _wirekyt_dom_file_utils.downloadFile)({
|
|
15
|
+
file: value,
|
|
16
|
+
name: fileName,
|
|
17
|
+
type: mimeType,
|
|
18
|
+
win
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
if (typeof data === "function") {
|
|
22
|
+
const maybePromise = data();
|
|
23
|
+
if (maybePromise instanceof Promise) maybePromise.then(saveToDisk);
|
|
24
|
+
else saveToDisk(maybePromise);
|
|
25
|
+
} else saveToDisk(data);
|
|
26
|
+
};
|
|
27
|
+
return { download };
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/download-trigger/download-trigger.vue
|
|
31
|
+
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
32
|
+
__name: "download-trigger",
|
|
33
|
+
props: {
|
|
34
|
+
asChild: { type: Boolean },
|
|
35
|
+
fileName: {},
|
|
36
|
+
mimeType: {},
|
|
37
|
+
data: { type: [String, Function] }
|
|
38
|
+
},
|
|
39
|
+
setup(__props) {
|
|
40
|
+
const props = __props;
|
|
41
|
+
const { download } = useDownload(() => ({
|
|
42
|
+
fileName: props.fileName,
|
|
43
|
+
mimeType: props.mimeType,
|
|
44
|
+
data: props.data
|
|
45
|
+
}));
|
|
46
|
+
const handleClick = (e) => {
|
|
47
|
+
if (e.defaultPrevented) return;
|
|
48
|
+
download();
|
|
49
|
+
};
|
|
50
|
+
require_utils.useForwardExpose();
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_factory.wire).button, {
|
|
53
|
+
"as-child": __props.asChild,
|
|
54
|
+
type: "button",
|
|
55
|
+
onClick: handleClick
|
|
56
|
+
}, {
|
|
57
|
+
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
|
|
58
|
+
_: 3
|
|
59
|
+
}, 8, ["as-child"]);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
//#endregion
|
|
64
|
+
exports.DownloadTrigger = _sfc_main;
|
|
65
|
+
exports.useDownload = useDownload;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { a as PolymorphicProps } from "./factory-BNwuanv4.cjs";
|
|
2
|
+
import { a as MaybePromise } from "./index-B-o8jLyV.cjs";
|
|
3
|
+
import { ButtonHTMLAttributes, MaybeRefOrGetter } from "vue";
|
|
4
|
+
import { FileMimeType } from "@wirekyt/dom/file-utils";
|
|
5
|
+
//#region src/components/download-trigger/use-download.d.ts
|
|
6
|
+
type DownloadableData = string | Blob | File;
|
|
7
|
+
interface UseDownloadProps {
|
|
8
|
+
fileName: string;
|
|
9
|
+
mimeType: FileMimeType;
|
|
10
|
+
data: DownloadableData | (() => MaybePromise<DownloadableData>);
|
|
11
|
+
}
|
|
12
|
+
interface UseDownloadReturn {
|
|
13
|
+
download: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare const useDownload: (props: MaybeRefOrGetter<UseDownloadProps>) => UseDownloadReturn;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/download-trigger/download-trigger.vue.d.ts
|
|
18
|
+
interface DownloadTriggerBaseProps extends PolymorphicProps, UseDownloadProps {}
|
|
19
|
+
interface DownloadTriggerProps extends DownloadTriggerBaseProps,
|
|
20
|
+
/**
|
|
21
|
+
* @vue-ignore
|
|
22
|
+
*/
|
|
23
|
+
ButtonHTMLAttributes {}
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DownloadTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DownloadTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
26
|
+
default?: (props: {}) => any;
|
|
27
|
+
}>;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { _default as DownloadTrigger, type DownloadTriggerBaseProps, type DownloadTriggerProps, type DownloadableData, type UseDownloadProps, type UseDownloadReturn, useDownload };
|