@wirekyt/vue 0.0.1 → 0.0.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/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-CEjnJlpm.js +179 -0
- package/dist/collapsible-aSz4kYqo.cjs +232 -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-1IjtyI-g.cjs +254 -0
- package/dist/collection-Ea6ZCZKK.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-C6Q2DqG6.d.ts +37 -0
- package/dist/index-CG9mpPgL.d.cts +444 -0
- package/dist/index-Cc4qS0rQ.d.cts +38 -0
- package/dist/index-Cc4qS0rQ.d.ts +38 -0
- package/dist/index-DB2uALlJ.d.cts +74 -0
- package/dist/index-DXb0W_NP.d.cts +37 -0
- package/dist/index-Zc9P69Ka.d.cts +104 -0
- package/dist/index-aMWdJRGL.d.ts +444 -0
- package/dist/index-uLE-tXSk.d.ts +74 -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-CWH9tv7s.cjs +651 -0
- package/dist/tree-view-CZcXMwi6.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 +278 -6
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { a as PolymorphicProps } from "./factory-BNwuanv4.js";
|
|
2
|
+
import { i as EmitFn$1, l as PropTypes, o as Optional } from "./index-BSoF1D-v.js";
|
|
3
|
+
import { ButtonHTMLAttributes, ComputedRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, MaybeRef, SlotsType, UnwrapRef } from "vue";
|
|
4
|
+
import * as editable from "@wirekyt/dom/machines/editable";
|
|
5
|
+
import { EditChangeDetails as EditableEditChangeDetails, FocusOutsideEvent, FocusOutsideEvent as EditableFocusOutsideEvent, InteractOutsideEvent, InteractOutsideEvent as EditableInteractOutsideEvent, PointerDownOutsideEvent, PointerDownOutsideEvent as EditablePointerDownOutsideEvent, ValueChangeDetails, ValueChangeDetails as EditableValueChangeDetails, anatomy as editableAnatomy } from "@wirekyt/dom/machines/editable";
|
|
6
|
+
//#region src/components/editable/area.vue.d.ts
|
|
7
|
+
interface EditableAreaBaseProps extends PolymorphicProps {}
|
|
8
|
+
interface EditableAreaProps extends EditableAreaBaseProps,
|
|
9
|
+
/**
|
|
10
|
+
* @vue-ignore
|
|
11
|
+
*/
|
|
12
|
+
HTMLAttributes {}
|
|
13
|
+
declare const _default: typeof __VLS_export$10;
|
|
14
|
+
declare const __VLS_export$10: __VLS_WithSlots$10<import("vue").DefineComponent<EditableAreaProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EditableAreaProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
15
|
+
default?: (props: {}) => any;
|
|
16
|
+
}>;
|
|
17
|
+
type __VLS_WithSlots$10<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/editable/cancel-trigger.vue.d.ts
|
|
24
|
+
interface EditableCancelTriggerBaseProps extends PolymorphicProps {}
|
|
25
|
+
interface EditableCancelTriggerProps extends EditableCancelTriggerBaseProps,
|
|
26
|
+
/**
|
|
27
|
+
* @vue-ignore
|
|
28
|
+
*/
|
|
29
|
+
ButtonHTMLAttributes {}
|
|
30
|
+
declare const _default$1: typeof __VLS_export$9;
|
|
31
|
+
declare const __VLS_export$9: __VLS_WithSlots$9<import("vue").DefineComponent<EditableCancelTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EditableCancelTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
32
|
+
default?: (props: {}) => any;
|
|
33
|
+
}>;
|
|
34
|
+
type __VLS_WithSlots$9<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/editable/control.vue.d.ts
|
|
41
|
+
interface EditableControlBaseProps extends PolymorphicProps {}
|
|
42
|
+
interface EditableControlProps extends EditableControlBaseProps,
|
|
43
|
+
/**
|
|
44
|
+
* @vue-ignore
|
|
45
|
+
*/
|
|
46
|
+
HTMLAttributes {}
|
|
47
|
+
declare const _default$3: typeof __VLS_export$8;
|
|
48
|
+
declare const __VLS_export$8: __VLS_WithSlots$8<import("vue").DefineComponent<EditableControlProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EditableControlProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
49
|
+
default?: (props: {}) => any;
|
|
50
|
+
}>;
|
|
51
|
+
type __VLS_WithSlots$8<T, S> = T & {
|
|
52
|
+
new (): {
|
|
53
|
+
$slots: S;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/editable/edit-trigger.vue.d.ts
|
|
58
|
+
interface EditableEditTriggerBaseProps extends PolymorphicProps {}
|
|
59
|
+
interface EditableEditTriggerProps extends EditableEditTriggerBaseProps,
|
|
60
|
+
/**
|
|
61
|
+
* @vue-ignore
|
|
62
|
+
*/
|
|
63
|
+
ButtonHTMLAttributes {}
|
|
64
|
+
declare const _default$4: typeof __VLS_export$7;
|
|
65
|
+
declare const __VLS_export$7: __VLS_WithSlots$7<import("vue").DefineComponent<EditableEditTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EditableEditTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
66
|
+
default?: (props: {}) => any;
|
|
67
|
+
}>;
|
|
68
|
+
type __VLS_WithSlots$7<T, S> = T & {
|
|
69
|
+
new (): {
|
|
70
|
+
$slots: S;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/components/editable/input.vue.d.ts
|
|
75
|
+
interface EditableInputBaseProps extends PolymorphicProps {}
|
|
76
|
+
interface EditableInputProps extends EditableInputBaseProps,
|
|
77
|
+
/**
|
|
78
|
+
* @vue-ignore
|
|
79
|
+
*/
|
|
80
|
+
InputHTMLAttributes {}
|
|
81
|
+
declare const _default$5: typeof __VLS_export$6;
|
|
82
|
+
declare const __VLS_export$6: __VLS_WithSlots$6<import("vue").DefineComponent<EditableInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EditableInputProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
83
|
+
default?: (props: {}) => any;
|
|
84
|
+
}>;
|
|
85
|
+
type __VLS_WithSlots$6<T, S> = T & {
|
|
86
|
+
new (): {
|
|
87
|
+
$slots: S;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/components/editable/label.vue.d.ts
|
|
92
|
+
interface EditableLabelBaseProps extends PolymorphicProps {}
|
|
93
|
+
interface EditableLabelProps extends EditableLabelBaseProps,
|
|
94
|
+
/**
|
|
95
|
+
* @vue-ignore
|
|
96
|
+
*/
|
|
97
|
+
LabelHTMLAttributes {}
|
|
98
|
+
declare const _default$6: typeof __VLS_export$5;
|
|
99
|
+
declare const __VLS_export$5: __VLS_WithSlots$5<import("vue").DefineComponent<EditableLabelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EditableLabelProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
100
|
+
default?: (props: {}) => any;
|
|
101
|
+
}>;
|
|
102
|
+
type __VLS_WithSlots$5<T, S> = T & {
|
|
103
|
+
new (): {
|
|
104
|
+
$slots: S;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/components/editable/preview.vue.d.ts
|
|
109
|
+
interface EditablePreviewBaseProps extends PolymorphicProps {}
|
|
110
|
+
interface EditablePreviewProps extends EditablePreviewBaseProps,
|
|
111
|
+
/**
|
|
112
|
+
* @vue-ignore
|
|
113
|
+
*/
|
|
114
|
+
HTMLAttributes {}
|
|
115
|
+
declare const _default$7: typeof __VLS_export$4;
|
|
116
|
+
declare const __VLS_export$4: __VLS_WithSlots$4<import("vue").DefineComponent<EditablePreviewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EditablePreviewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
117
|
+
default?: (props: {}) => any;
|
|
118
|
+
}>;
|
|
119
|
+
type __VLS_WithSlots$4<T, S> = T & {
|
|
120
|
+
new (): {
|
|
121
|
+
$slots: S;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/components/editable/root-provider.vue.d.ts
|
|
126
|
+
interface RootProviderProps {
|
|
127
|
+
value: UnwrapRef<UseEditableReturn>;
|
|
128
|
+
}
|
|
129
|
+
interface EditableRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
|
|
130
|
+
interface EditableRootProviderProps extends EditableRootProviderBaseProps,
|
|
131
|
+
/**
|
|
132
|
+
* @vue-ignore
|
|
133
|
+
*/
|
|
134
|
+
Omit<HTMLAttributes, "placeholder"> {}
|
|
135
|
+
declare const _default$9: typeof __VLS_export$3;
|
|
136
|
+
declare const __VLS_export$3: __VLS_WithSlots$3<import("vue").DefineComponent<EditableRootProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EditableRootProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
137
|
+
default?: (props: {}) => any;
|
|
138
|
+
}>;
|
|
139
|
+
type __VLS_WithSlots$3<T, S> = T & {
|
|
140
|
+
new (): {
|
|
141
|
+
$slots: S;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/components/editable/types.d.ts
|
|
146
|
+
interface RootProps {
|
|
147
|
+
activationMode?: editable.ActivationMode;
|
|
148
|
+
autoResize?: boolean;
|
|
149
|
+
defaultEdit?: boolean;
|
|
150
|
+
defaultValue?: string;
|
|
151
|
+
disabled?: boolean;
|
|
152
|
+
edit?: boolean;
|
|
153
|
+
finalFocusEl?: () => HTMLElement | null;
|
|
154
|
+
form?: string;
|
|
155
|
+
id?: string;
|
|
156
|
+
ids?: Partial<{
|
|
157
|
+
root: string;
|
|
158
|
+
area: string;
|
|
159
|
+
label: string;
|
|
160
|
+
preview: string;
|
|
161
|
+
input: string;
|
|
162
|
+
control: string;
|
|
163
|
+
submitTrigger: string;
|
|
164
|
+
cancelTrigger: string;
|
|
165
|
+
editTrigger: string;
|
|
166
|
+
}>;
|
|
167
|
+
invalid?: boolean;
|
|
168
|
+
maxLength?: number;
|
|
169
|
+
modelValue?: string;
|
|
170
|
+
name?: string;
|
|
171
|
+
placeholder?: string | {
|
|
172
|
+
edit: string;
|
|
173
|
+
preview: string;
|
|
174
|
+
};
|
|
175
|
+
readOnly?: boolean;
|
|
176
|
+
required?: boolean;
|
|
177
|
+
selectOnFocus?: boolean;
|
|
178
|
+
submitMode?: editable.SubmitMode;
|
|
179
|
+
translations?: editable.IntlTranslations;
|
|
180
|
+
}
|
|
181
|
+
type RootEmits = {
|
|
182
|
+
editChange: [details: editable.EditChangeDetails];
|
|
183
|
+
focusOutside: [event: editable.FocusOutsideEvent];
|
|
184
|
+
interactOutside: [event: editable.InteractOutsideEvent];
|
|
185
|
+
pointerDownOutside: [event: editable.PointerDownOutsideEvent];
|
|
186
|
+
valueChange: [details: editable.ValueChangeDetails];
|
|
187
|
+
valueCommit: [details: editable.ValueChangeDetails];
|
|
188
|
+
valueRevert: [details: editable.ValueChangeDetails];
|
|
189
|
+
"update:modelValue": [value: string];
|
|
190
|
+
"update:edit": [edit: boolean];
|
|
191
|
+
};
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/components/editable/root.vue.d.ts
|
|
194
|
+
interface EditableRootBaseProps extends RootProps, PolymorphicProps {}
|
|
195
|
+
interface EditableRootProps extends EditableRootBaseProps,
|
|
196
|
+
/**
|
|
197
|
+
* @vue-ignore
|
|
198
|
+
*/
|
|
199
|
+
Omit<HTMLAttributes, "placeholder"> {}
|
|
200
|
+
interface EditableRootEmits extends RootEmits {}
|
|
201
|
+
declare const _default$8: typeof __VLS_export$2;
|
|
202
|
+
declare const __VLS_export$2: __VLS_WithSlots$2<import("vue").DefineComponent<EditableRootProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
203
|
+
valueChange: (details: import("@wirekyt/dom/machines/editable").ValueChangeDetails) => any;
|
|
204
|
+
"update:modelValue": (value: string) => any;
|
|
205
|
+
focusOutside: (event: import("@wirekyt/dom/machines/popover").FocusOutsideEvent) => any;
|
|
206
|
+
interactOutside: (event: import("@wirekyt/dom/machines/popover").InteractOutsideEvent) => any;
|
|
207
|
+
pointerDownOutside: (event: import("@wirekyt/dom/machines/popover").PointerDownOutsideEvent) => any;
|
|
208
|
+
editChange: (details: import("@wirekyt/dom/machines/editable").EditChangeDetails) => any;
|
|
209
|
+
valueCommit: (details: import("@wirekyt/dom/machines/editable").ValueChangeDetails) => any;
|
|
210
|
+
valueRevert: (details: import("@wirekyt/dom/machines/editable").ValueChangeDetails) => any;
|
|
211
|
+
"update:edit": (edit: boolean) => any;
|
|
212
|
+
}, string, import("vue").PublicProps, Readonly<EditableRootProps> & Readonly<{
|
|
213
|
+
onValueChange?: ((details: import("@wirekyt/dom/machines/editable").ValueChangeDetails) => any) | undefined;
|
|
214
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
215
|
+
onFocusOutside?: ((event: import("@wirekyt/dom/machines/popover").FocusOutsideEvent) => any) | undefined;
|
|
216
|
+
onInteractOutside?: ((event: import("@wirekyt/dom/machines/popover").InteractOutsideEvent) => any) | undefined;
|
|
217
|
+
onPointerDownOutside?: ((event: import("@wirekyt/dom/machines/popover").PointerDownOutsideEvent) => any) | undefined;
|
|
218
|
+
onEditChange?: ((details: import("@wirekyt/dom/machines/editable").EditChangeDetails) => any) | undefined;
|
|
219
|
+
onValueCommit?: ((details: import("@wirekyt/dom/machines/editable").ValueChangeDetails) => any) | undefined;
|
|
220
|
+
onValueRevert?: ((details: import("@wirekyt/dom/machines/editable").ValueChangeDetails) => any) | undefined;
|
|
221
|
+
"onUpdate:edit"?: ((edit: boolean) => any) | undefined;
|
|
222
|
+
}>, {
|
|
223
|
+
disabled: boolean;
|
|
224
|
+
required: boolean;
|
|
225
|
+
invalid: boolean;
|
|
226
|
+
readOnly: boolean;
|
|
227
|
+
selectOnFocus: boolean;
|
|
228
|
+
autoResize: boolean;
|
|
229
|
+
defaultEdit: boolean;
|
|
230
|
+
edit: boolean;
|
|
231
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
232
|
+
default?: (props: {}) => any;
|
|
233
|
+
}>;
|
|
234
|
+
type __VLS_WithSlots$2<T, S> = T & {
|
|
235
|
+
new (): {
|
|
236
|
+
$slots: S;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/components/editable/submit-trigger.vue.d.ts
|
|
241
|
+
interface EditableSubmitTriggerBaseProps extends PolymorphicProps {}
|
|
242
|
+
interface EditableSubmitTriggerProps extends EditableSubmitTriggerBaseProps,
|
|
243
|
+
/**
|
|
244
|
+
* @vue-ignore
|
|
245
|
+
*/
|
|
246
|
+
ButtonHTMLAttributes {}
|
|
247
|
+
declare const _default$10: typeof __VLS_export$1;
|
|
248
|
+
declare const __VLS_export$1: __VLS_WithSlots$1<import("vue").DefineComponent<EditableSubmitTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EditableSubmitTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
249
|
+
default?: (props: {}) => any;
|
|
250
|
+
}>;
|
|
251
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
252
|
+
new (): {
|
|
253
|
+
$slots: S;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
declare namespace editable_d_exports {
|
|
257
|
+
export { _default as Area, EditableAreaBaseProps as AreaBaseProps, EditableAreaProps as AreaProps, _default$1 as CancelTrigger, EditableCancelTriggerBaseProps as CancelTriggerBaseProps, EditableCancelTriggerProps as CancelTriggerProps, _default$2 as Context, EditableContextProps as ContextProps, _default$3 as Control, EditableControlBaseProps as ControlBaseProps, EditableControlProps as ControlProps, _default$4 as EditTrigger, EditableEditTriggerBaseProps as EditTriggerBaseProps, EditableEditTriggerProps as EditTriggerProps, FocusOutsideEvent, _default$5 as Input, EditableInputBaseProps as InputBaseProps, EditableInputProps as InputProps, InteractOutsideEvent, _default$6 as Label, EditableLabelBaseProps as LabelBaseProps, EditableLabelProps as LabelProps, PointerDownOutsideEvent, _default$7 as Preview, EditablePreviewBaseProps as PreviewBaseProps, EditablePreviewProps as PreviewProps, _default$8 as Root, EditableRootBaseProps as RootBaseProps, EditableRootEmits as RootEmits, EditableRootProps as RootProps, _default$9 as RootProvider, EditableRootProviderBaseProps as RootProviderBaseProps, EditableRootProviderProps as RootProviderProps, _default$10 as SubmitTrigger, EditableSubmitTriggerBaseProps as SubmitTriggerBaseProps, EditableSubmitTriggerProps as SubmitTriggerProps, ValueChangeDetails };
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/components/editable/use-editable.d.ts
|
|
261
|
+
interface UseEditableProps extends Optional<Omit<editable.Props, "dir" | "getRootNode">, "id"> {
|
|
262
|
+
modelValue?: editable.Props["value"];
|
|
263
|
+
}
|
|
264
|
+
interface UseEditableReturn extends ComputedRef<editable.Api<PropTypes>> {}
|
|
265
|
+
declare const useEditable: (props?: MaybeRef<UseEditableProps>, emit?: EmitFn$1<EditableRootEmits>) => UseEditableReturn;
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/components/editable/use-context.d.ts
|
|
268
|
+
interface UseEditableContext extends UseEditableReturn {}
|
|
269
|
+
declare const EditableProvider: (opts: UseEditableContext) => void, useEditableContext: (fallback?: UseEditableContext | undefined) => UseEditableContext;
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region src/components/editable/context.vue.d.ts
|
|
272
|
+
interface EditableContextProps extends SlotsType<{
|
|
273
|
+
default: UnwrapRef<UseEditableContext>;
|
|
274
|
+
}> {}
|
|
275
|
+
declare const _default$2: typeof __VLS_export;
|
|
276
|
+
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>, {
|
|
277
|
+
default(editable: UnwrapRef<UseEditableContext>): unknown;
|
|
278
|
+
}>;
|
|
279
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
280
|
+
new (): {
|
|
281
|
+
$slots: S;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
//#endregion
|
|
285
|
+
export { editable_d_exports as Editable, _default as EditableArea, type EditableAreaBaseProps, type EditableAreaProps, _default$1 as EditableCancelTrigger, type EditableCancelTriggerBaseProps, type EditableCancelTriggerProps, _default$2 as EditableContext, type EditableContextProps, _default$3 as EditableControl, type EditableControlBaseProps, type EditableControlProps, type EditableEditChangeDetails, _default$4 as EditableEditTrigger, type EditableEditTriggerBaseProps, type EditableEditTriggerProps, type EditableFocusOutsideEvent, _default$5 as EditableInput, type EditableInputBaseProps, type EditableInputProps, type EditableInteractOutsideEvent, _default$6 as EditableLabel, type EditableLabelBaseProps, type EditableLabelProps, type EditablePointerDownOutsideEvent, _default$7 as EditablePreview, type EditablePreviewBaseProps, type EditablePreviewProps, _default$8 as EditableRoot, type EditableRootBaseProps, type EditableRootEmits, type EditableRootProps, _default$9 as EditableRootProvider, type EditableRootProviderBaseProps, type EditableRootProviderProps, _default$10 as EditableSubmitTrigger, type EditableSubmitTriggerBaseProps, type EditableSubmitTriggerProps, type EditableValueChangeDetails, type UseEditableContext, type UseEditableProps, type UseEditableReturn, editableAnatomy, useEditable, useEditableContext };
|
package/dist/editable.js
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { c as normalizeProps$1, d as useForwardExpose, m as createContext, 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 { h as useFieldContext } from "./field-C3pLqz1S.js";
|
|
7
|
+
import { computed, createBlock, defineComponent, guardReactiveProps, mergeDefaults, mergeProps, normalizeProps, openBlock, renderSlot, toValue, unref, useId, withCtx } from "vue";
|
|
8
|
+
import * as editable from "@wirekyt/dom/machines/editable";
|
|
9
|
+
import { anatomy as editableAnatomy } from "@wirekyt/dom/machines/editable";
|
|
10
|
+
//#region src/components/editable/use-context.ts
|
|
11
|
+
const [EditableProvider, useEditableContext] = createContext("EditableContext");
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/editable/area.vue
|
|
14
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
15
|
+
__name: "area",
|
|
16
|
+
props: { asChild: { type: Boolean } },
|
|
17
|
+
setup(__props) {
|
|
18
|
+
const editable = useEditableContext();
|
|
19
|
+
useForwardExpose();
|
|
20
|
+
return (_ctx, _cache) => {
|
|
21
|
+
return openBlock(), createBlock(unref(wire).div, mergeProps(unref(editable).getAreaProps(), { "as-child": __props.asChild }), {
|
|
22
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
23
|
+
_: 3
|
|
24
|
+
}, 16, ["as-child"]);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/editable/cancel-trigger.vue
|
|
30
|
+
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
31
|
+
__name: "cancel-trigger",
|
|
32
|
+
props: { asChild: { type: Boolean } },
|
|
33
|
+
setup(__props) {
|
|
34
|
+
const editable = useEditableContext();
|
|
35
|
+
useForwardExpose();
|
|
36
|
+
return (_ctx, _cache) => {
|
|
37
|
+
return openBlock(), createBlock(unref(wire).button, mergeProps(unref(editable).getCancelTriggerProps(), { "as-child": __props.asChild }), {
|
|
38
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
39
|
+
_: 3
|
|
40
|
+
}, 16, ["as-child"]);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/components/editable/context.vue
|
|
46
|
+
const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
47
|
+
__name: "context",
|
|
48
|
+
setup(__props) {
|
|
49
|
+
const editable = useEditableContext();
|
|
50
|
+
return (_ctx, _cache) => {
|
|
51
|
+
return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(editable))));
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/editable/control.vue
|
|
57
|
+
const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
58
|
+
__name: "control",
|
|
59
|
+
props: { asChild: { type: Boolean } },
|
|
60
|
+
setup(__props) {
|
|
61
|
+
const editable = useEditableContext();
|
|
62
|
+
useForwardExpose();
|
|
63
|
+
return (_ctx, _cache) => {
|
|
64
|
+
return openBlock(), createBlock(unref(wire).div, mergeProps(unref(editable).getControlProps(), { "as-child": __props.asChild }), {
|
|
65
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
66
|
+
_: 3
|
|
67
|
+
}, 16, ["as-child"]);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/components/editable/edit-trigger.vue
|
|
73
|
+
const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
74
|
+
__name: "edit-trigger",
|
|
75
|
+
props: { asChild: { type: Boolean } },
|
|
76
|
+
setup(__props) {
|
|
77
|
+
const editable = useEditableContext();
|
|
78
|
+
useForwardExpose();
|
|
79
|
+
return (_ctx, _cache) => {
|
|
80
|
+
return openBlock(), createBlock(unref(wire).button, mergeProps(unref(editable).getEditTriggerProps(), { "as-child": __props.asChild }), {
|
|
81
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
82
|
+
_: 3
|
|
83
|
+
}, 16, ["as-child"]);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/components/editable/input.vue
|
|
89
|
+
const _sfc_main$5 = /*@__PURE__*/ defineComponent({
|
|
90
|
+
__name: "input",
|
|
91
|
+
props: { asChild: { type: Boolean } },
|
|
92
|
+
setup(__props) {
|
|
93
|
+
const editable = useEditableContext();
|
|
94
|
+
const field = useFieldContext();
|
|
95
|
+
useForwardExpose();
|
|
96
|
+
return (_ctx, _cache) => {
|
|
97
|
+
return openBlock(), createBlock(unref(wire).input, mergeProps({ "aria-describedby": unref(field)?.ariaDescribedby }, unref(editable).getInputProps(), { "as-child": __props.asChild }), {
|
|
98
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
99
|
+
_: 3
|
|
100
|
+
}, 16, ["aria-describedby", "as-child"]);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/components/editable/label.vue
|
|
106
|
+
const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
107
|
+
__name: "label",
|
|
108
|
+
props: { asChild: { type: Boolean } },
|
|
109
|
+
setup(__props) {
|
|
110
|
+
const editable = useEditableContext();
|
|
111
|
+
useForwardExpose();
|
|
112
|
+
return (_ctx, _cache) => {
|
|
113
|
+
return openBlock(), createBlock(unref(wire).label, mergeProps(unref(editable).getLabelProps(), { "as-child": __props.asChild }), {
|
|
114
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
115
|
+
_: 3
|
|
116
|
+
}, 16, ["as-child"]);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/components/editable/preview.vue
|
|
122
|
+
const _sfc_main$7 = /*@__PURE__*/ defineComponent({
|
|
123
|
+
__name: "preview",
|
|
124
|
+
props: { asChild: { type: Boolean } },
|
|
125
|
+
setup(__props) {
|
|
126
|
+
const editable = useEditableContext();
|
|
127
|
+
useForwardExpose();
|
|
128
|
+
return (_ctx, _cache) => {
|
|
129
|
+
return openBlock(), createBlock(unref(wire).span, mergeProps(unref(editable).getPreviewProps(), { "as-child": __props.asChild }), {
|
|
130
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
131
|
+
_: 3
|
|
132
|
+
}, 16, ["as-child"]);
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/components/editable/root-provider.vue
|
|
138
|
+
const _sfc_main$9 = /*@__PURE__*/ defineComponent({
|
|
139
|
+
__name: "root-provider",
|
|
140
|
+
props: {
|
|
141
|
+
value: {},
|
|
142
|
+
asChild: { type: Boolean }
|
|
143
|
+
},
|
|
144
|
+
setup(__props) {
|
|
145
|
+
const props = __props;
|
|
146
|
+
const editable = computed(() => props.value);
|
|
147
|
+
EditableProvider(editable);
|
|
148
|
+
useForwardExpose();
|
|
149
|
+
return (_ctx, _cache) => {
|
|
150
|
+
return openBlock(), createBlock(unref(wire).div, mergeProps(editable.value.getRootProps(), { "as-child": __props.asChild }), {
|
|
151
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
152
|
+
_: 3
|
|
153
|
+
}, 16, ["as-child"]);
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/components/editable/use-editable.ts
|
|
159
|
+
const useEditable = (props = {}, emit) => {
|
|
160
|
+
const id = useId();
|
|
161
|
+
const env = useEnvironmentContext(DEFAULT_ENVIRONMENT);
|
|
162
|
+
const locale = useLocaleContext(DEFAULT_LOCALE);
|
|
163
|
+
const field = useFieldContext();
|
|
164
|
+
const context = computed(() => {
|
|
165
|
+
const localeProps = toValue(props);
|
|
166
|
+
return {
|
|
167
|
+
id,
|
|
168
|
+
ids: {
|
|
169
|
+
label: field?.value.ids.label,
|
|
170
|
+
input: field?.value.ids.control
|
|
171
|
+
},
|
|
172
|
+
disabled: field?.value.disabled,
|
|
173
|
+
invalid: field?.value.invalid,
|
|
174
|
+
readOnly: field?.value.readOnly,
|
|
175
|
+
required: field?.value.required,
|
|
176
|
+
dir: locale.value.dir,
|
|
177
|
+
value: localeProps.modelValue,
|
|
178
|
+
getRootNode: env?.value.getRootNode,
|
|
179
|
+
...cleanProps(localeProps),
|
|
180
|
+
onEditChange: (details) => {
|
|
181
|
+
emit?.("editChange", details);
|
|
182
|
+
emit?.("update:edit", details.edit);
|
|
183
|
+
localeProps.onEditChange?.(details);
|
|
184
|
+
},
|
|
185
|
+
onValueChange(details) {
|
|
186
|
+
emit?.("valueChange", details);
|
|
187
|
+
emit?.("update:modelValue", details.value);
|
|
188
|
+
localeProps.onValueChange?.(details);
|
|
189
|
+
},
|
|
190
|
+
onFocusOutside: (details) => {
|
|
191
|
+
emit?.("focusOutside", details);
|
|
192
|
+
localeProps.onFocusOutside?.(details);
|
|
193
|
+
},
|
|
194
|
+
onInteractOutside: (details) => {
|
|
195
|
+
emit?.("interactOutside", details);
|
|
196
|
+
localeProps.onInteractOutside?.(details);
|
|
197
|
+
},
|
|
198
|
+
onPointerDownOutside: (details) => {
|
|
199
|
+
emit?.("pointerDownOutside", details);
|
|
200
|
+
localeProps.onPointerDownOutside?.(details);
|
|
201
|
+
},
|
|
202
|
+
onValueCommit: (details) => {
|
|
203
|
+
emit?.("valueCommit", details);
|
|
204
|
+
localeProps.onValueCommit?.(details);
|
|
205
|
+
},
|
|
206
|
+
onValueRevert: (details) => {
|
|
207
|
+
emit?.("valueRevert", details);
|
|
208
|
+
localeProps.onValueRevert?.(details);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
const service = useMachine(editable.machine, context);
|
|
213
|
+
return computed(() => editable.connect(service, normalizeProps$1));
|
|
214
|
+
};
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/components/editable/root.vue
|
|
217
|
+
const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
218
|
+
__name: "root",
|
|
219
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
220
|
+
activationMode: {},
|
|
221
|
+
autoResize: { type: Boolean },
|
|
222
|
+
defaultEdit: { type: Boolean },
|
|
223
|
+
defaultValue: {},
|
|
224
|
+
disabled: { type: Boolean },
|
|
225
|
+
edit: { type: Boolean },
|
|
226
|
+
finalFocusEl: { type: Function },
|
|
227
|
+
form: {},
|
|
228
|
+
id: {},
|
|
229
|
+
ids: {},
|
|
230
|
+
invalid: { type: Boolean },
|
|
231
|
+
maxLength: {},
|
|
232
|
+
modelValue: {},
|
|
233
|
+
name: {},
|
|
234
|
+
placeholder: {},
|
|
235
|
+
readOnly: { type: Boolean },
|
|
236
|
+
required: { type: Boolean },
|
|
237
|
+
selectOnFocus: { type: Boolean },
|
|
238
|
+
submitMode: {},
|
|
239
|
+
translations: {},
|
|
240
|
+
asChild: { type: Boolean }
|
|
241
|
+
}, {
|
|
242
|
+
autoResize: void 0,
|
|
243
|
+
defaultEdit: void 0,
|
|
244
|
+
disabled: void 0,
|
|
245
|
+
edit: void 0,
|
|
246
|
+
invalid: void 0,
|
|
247
|
+
readOnly: void 0,
|
|
248
|
+
required: void 0,
|
|
249
|
+
selectOnFocus: void 0
|
|
250
|
+
}),
|
|
251
|
+
emits: [
|
|
252
|
+
"editChange",
|
|
253
|
+
"focusOutside",
|
|
254
|
+
"interactOutside",
|
|
255
|
+
"pointerDownOutside",
|
|
256
|
+
"valueChange",
|
|
257
|
+
"valueCommit",
|
|
258
|
+
"valueRevert",
|
|
259
|
+
"update:modelValue",
|
|
260
|
+
"update:edit"
|
|
261
|
+
],
|
|
262
|
+
setup(__props, { emit: __emit }) {
|
|
263
|
+
const editable = useEditable(__props, __emit);
|
|
264
|
+
EditableProvider(editable);
|
|
265
|
+
useForwardExpose();
|
|
266
|
+
return (_ctx, _cache) => {
|
|
267
|
+
return openBlock(), createBlock(unref(wire).div, mergeProps(unref(editable).getRootProps(), { "as-child": __props.asChild }), {
|
|
268
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
269
|
+
_: 3
|
|
270
|
+
}, 16, ["as-child"]);
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/components/editable/submit-trigger.vue
|
|
276
|
+
const _sfc_main$10 = /*@__PURE__*/ defineComponent({
|
|
277
|
+
__name: "submit-trigger",
|
|
278
|
+
props: { asChild: { type: Boolean } },
|
|
279
|
+
setup(__props) {
|
|
280
|
+
const editable = useEditableContext();
|
|
281
|
+
useForwardExpose();
|
|
282
|
+
return (_ctx, _cache) => {
|
|
283
|
+
return openBlock(), createBlock(unref(wire).button, mergeProps(unref(editable).getSubmitTriggerProps(), { "as-child": __props.asChild }), {
|
|
284
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
285
|
+
_: 3
|
|
286
|
+
}, 16, ["as-child"]);
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
//#endregion
|
|
291
|
+
//#region src/components/editable/editable.ts
|
|
292
|
+
var editable_exports = /* @__PURE__ */ __exportAll({
|
|
293
|
+
Area: () => _sfc_main,
|
|
294
|
+
CancelTrigger: () => _sfc_main$1,
|
|
295
|
+
Context: () => _sfc_main$2,
|
|
296
|
+
Control: () => _sfc_main$3,
|
|
297
|
+
EditTrigger: () => _sfc_main$4,
|
|
298
|
+
Input: () => _sfc_main$5,
|
|
299
|
+
Label: () => _sfc_main$6,
|
|
300
|
+
Preview: () => _sfc_main$7,
|
|
301
|
+
Root: () => _sfc_main$8,
|
|
302
|
+
RootProvider: () => _sfc_main$9,
|
|
303
|
+
SubmitTrigger: () => _sfc_main$10
|
|
304
|
+
});
|
|
305
|
+
//#endregion
|
|
306
|
+
export { editable_exports as Editable, _sfc_main as EditableArea, _sfc_main$1 as EditableCancelTrigger, _sfc_main$2 as EditableContext, _sfc_main$3 as EditableControl, _sfc_main$4 as EditableEditTrigger, _sfc_main$5 as EditableInput, _sfc_main$6 as EditableLabel, _sfc_main$7 as EditablePreview, _sfc_main$8 as EditableRoot, _sfc_main$9 as EditableRootProvider, _sfc_main$10 as EditableSubmitTrigger, editableAnatomy, useEditable, useEditableContext };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { i as Dynamic } from "./utils-D95V66v9.js";
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
//#region src/components/factory.ts
|
|
4
|
+
const SELF_CLOSING_TAGS = "br, hr, img, input, area, textarea".split(", ");
|
|
5
|
+
const isSelfClosingTag = (tag) => typeof tag === "string" && SELF_CLOSING_TAGS.includes(tag);
|
|
6
|
+
const withAsChild = (component) => {
|
|
7
|
+
return defineComponent({
|
|
8
|
+
name: "Polymorphic",
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
props: { asChild: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false
|
|
13
|
+
} },
|
|
14
|
+
setup(props, { attrs, slots }) {
|
|
15
|
+
if (!props.asChild) return () => h(component, attrs, isSelfClosingTag(component) ? void 0 : slots.default?.());
|
|
16
|
+
return () => h(Dynamic, attrs, slots);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
function jsxFactory() {
|
|
21
|
+
const cache = /* @__PURE__ */ new Map();
|
|
22
|
+
return new Proxy(withAsChild, {
|
|
23
|
+
apply(_target, _thisArg, argArray) {
|
|
24
|
+
return withAsChild(argArray[0]);
|
|
25
|
+
},
|
|
26
|
+
get(_, element) {
|
|
27
|
+
if (!cache.has(element)) cache.set(element, withAsChild(element));
|
|
28
|
+
return cache.get(element);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const wire = jsxFactory();
|
|
33
|
+
//#endregion
|
|
34
|
+
export { wire as n, jsxFactory as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, IntrinsicElementAttributes, VNodeProps, h } from "vue";
|
|
2
|
+
//#region src/components/factory.d.ts
|
|
3
|
+
type DOMElements = keyof IntrinsicElementAttributes;
|
|
4
|
+
type ElementType = Parameters<typeof h>[0];
|
|
5
|
+
interface PolymorphicProps {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}
|
|
8
|
+
type AsChildComponent<Component extends ElementType, P extends Record<string, unknown> = Record<never, never>> = {
|
|
9
|
+
new (): {
|
|
10
|
+
$props: AllowedComponentProps & ComponentCustomProps & VNodeProps & ExtractPropTypes<Component> & (Component extends keyof IntrinsicElementAttributes ? IntrinsicElementAttributes[Component] : Record<never, never>) & P & PolymorphicProps;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type HTMLPolymorphicComponents = { [E in DOMElements]: AsChildComponent<E>; };
|
|
14
|
+
type HTMLPolymorphicProps<T extends ElementType> = Omit<ExtractPropTypes<T extends DOMElements ? IntrinsicElementAttributes[T] : T>, "ref"> & {
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type HTMLWireProps<T extends DOMElements> = HTMLPolymorphicProps<T>;
|
|
18
|
+
declare function jsxFactory(): HTMLPolymorphicComponents;
|
|
19
|
+
declare const wire: HTMLPolymorphicComponents;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { PolymorphicProps as a, HTMLWireProps as i, HTMLPolymorphicComponents as n, jsxFactory as o, HTMLPolymorphicProps as r, wire as s, AsChildComponent as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, IntrinsicElementAttributes, VNodeProps, h } from "vue";
|
|
2
|
+
//#region src/components/factory.d.ts
|
|
3
|
+
type DOMElements = keyof IntrinsicElementAttributes;
|
|
4
|
+
type ElementType = Parameters<typeof h>[0];
|
|
5
|
+
interface PolymorphicProps {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}
|
|
8
|
+
type AsChildComponent<Component extends ElementType, P extends Record<string, unknown> = Record<never, never>> = {
|
|
9
|
+
new (): {
|
|
10
|
+
$props: AllowedComponentProps & ComponentCustomProps & VNodeProps & ExtractPropTypes<Component> & (Component extends keyof IntrinsicElementAttributes ? IntrinsicElementAttributes[Component] : Record<never, never>) & P & PolymorphicProps;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type HTMLPolymorphicComponents = { [E in DOMElements]: AsChildComponent<E>; };
|
|
14
|
+
type HTMLPolymorphicProps<T extends ElementType> = Omit<ExtractPropTypes<T extends DOMElements ? IntrinsicElementAttributes[T] : T>, "ref"> & {
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type HTMLWireProps<T extends DOMElements> = HTMLPolymorphicProps<T>;
|
|
18
|
+
declare function jsxFactory(): HTMLPolymorphicComponents;
|
|
19
|
+
declare const wire: HTMLPolymorphicComponents;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { PolymorphicProps as a, HTMLWireProps as i, HTMLPolymorphicComponents as n, jsxFactory as o, HTMLPolymorphicProps as r, wire as s, AsChildComponent as t };
|