@vunk/form 2.19.11 → 2.19.13
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/components/card-input-collection/index.cjs +1 -1
- package/components/card-input-collection/index.mjs +1 -1
- package/components/card-input-collection/src/core.vue.d.ts +3 -1
- package/components/card-input-collection/src/types.d.ts +3 -1
- package/components/collapse/index.cjs +1 -0
- package/components/collapse/index.d.ts +4 -0
- package/components/collapse/index.mjs +45 -0
- package/components/collapse/src/index.vue.d.ts +15 -0
- package/components/collapse/src/set-attrs.vue.d.ts +23 -0
- package/components/collapse-item/index.cjs +1 -0
- package/components/collapse-item/index.d.ts +6 -0
- package/components/collapse-item/index.mjs +56 -0
- package/components/collapse-item/src/ctx.d.ts +7 -0
- package/components/collapse-item/src/index.vue.d.ts +30 -0
- package/components/collapse-item/src/types.d.ts +1 -0
- package/components/collapse-item/src/use.d.ts +13 -0
- package/components/form/index.cjs +1 -1
- package/components/form/index.d.ts +1 -0
- package/components/form/index.mjs +115 -80
- package/components/form/src/index.vue.d.ts +1 -1
- package/components/form/src/types.d.ts +2 -1
- package/components/form/src/use.d.ts +206 -0
- package/components/form-item/index.cjs +1 -1
- package/components/form-item/index.mjs +92 -75
- package/components/form-item/src/core.vue.d.ts +2 -0
- package/composables/form-mitt/index.cjs +1 -0
- package/composables/form-mitt/index.d.ts +37 -0
- package/composables/form-mitt/index.mjs +41 -0
- package/composables/index.cjs +1 -1
- package/composables/index.d.ts +1 -0
- package/composables/index.mjs +16 -14
- package/package.json +19 -1
- package/shared/element-plus/ctx.d.ts +1 -0
- package/shared/element-plus/index.cjs +1 -1
- package/shared/element-plus/index.mjs +57 -56
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { __VkfTemplatesDefault } from '@vunk/form/components/templates-default';
|
|
2
2
|
import { __VkfTemplatesLayout } from '@vunk/form/components/templates-layout';
|
|
3
3
|
import { VueComponentPropsType } from '@vunk/shared';
|
|
4
|
-
import { ElCol } from 'element-plus';
|
|
4
|
+
import { ElCol, FormItemProp } from 'element-plus';
|
|
5
|
+
export type OnValidate = (prop: FormItemProp, isValid: boolean, message: string) => any;
|
|
5
6
|
export type LayoutProps = {
|
|
6
7
|
/**
|
|
7
8
|
* 如果开启 props.layout,那么
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { AnyFunc } from '@vunk/shared';
|
|
2
|
+
import { FormValidateCallback, FormValidationResult } from 'element-plus';
|
|
3
|
+
export { initFormMitt, type FormEmitter, useFormMitt } from '@vunk/form/composables/form-mitt';
|
|
4
|
+
export declare function initFormRef(props: {
|
|
5
|
+
elRef: AnyFunc;
|
|
6
|
+
onAfterValidate?: FormValidateCallback;
|
|
7
|
+
}): {
|
|
8
|
+
setFormRef: (e: any) => void;
|
|
9
|
+
formRef: import("vue").ShallowRef<({
|
|
10
|
+
$: import("vue").ComponentInternalInstance;
|
|
11
|
+
$data: {};
|
|
12
|
+
$props: {
|
|
13
|
+
readonly model?: Record<string, any> | undefined;
|
|
14
|
+
readonly rules?: import("element-plus").FormRules | undefined;
|
|
15
|
+
readonly labelPosition?: "left" | "right" | "top" | undefined;
|
|
16
|
+
readonly requireAsteriskPosition?: "left" | "right" | undefined;
|
|
17
|
+
readonly labelWidth?: string | number | undefined;
|
|
18
|
+
readonly labelSuffix?: string | undefined;
|
|
19
|
+
readonly inline?: boolean | undefined;
|
|
20
|
+
readonly inlineMessage?: boolean | undefined;
|
|
21
|
+
readonly statusIcon?: boolean | undefined;
|
|
22
|
+
readonly showMessage?: boolean | undefined;
|
|
23
|
+
readonly validateOnRuleChange?: boolean | undefined;
|
|
24
|
+
readonly hideRequiredAsterisk?: boolean | undefined;
|
|
25
|
+
readonly scrollToError?: boolean | undefined;
|
|
26
|
+
readonly scrollIntoViewOptions?: (ScrollIntoViewOptions | boolean) | undefined;
|
|
27
|
+
readonly size?: import("element-plus").ComponentSize | undefined;
|
|
28
|
+
readonly disabled?: boolean | undefined;
|
|
29
|
+
readonly onValidate?: ((prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => any) | undefined | undefined;
|
|
30
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
31
|
+
$attrs: import("vue").Attrs;
|
|
32
|
+
$refs: {
|
|
33
|
+
[x: string]: unknown;
|
|
34
|
+
};
|
|
35
|
+
$slots: Readonly<{
|
|
36
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
39
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
40
|
+
$host: Element | null;
|
|
41
|
+
$emit: (event: "validate", prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => void;
|
|
42
|
+
$el: any;
|
|
43
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("element-plus").FormProps> & Readonly<{
|
|
44
|
+
onValidate?: ((prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
45
|
+
}>, {
|
|
46
|
+
validate: (callback?: FormValidateCallback) => FormValidationResult;
|
|
47
|
+
validateField: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
|
|
48
|
+
resetFields: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>) => void;
|
|
49
|
+
clearValidate: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>) => void;
|
|
50
|
+
scrollToField: (prop: import("element-plus").FormItemProp) => void;
|
|
51
|
+
getField: (prop: import("element-plus").FormItemProp) => import("element-plus").FormItemContext | undefined;
|
|
52
|
+
fields: import("vue").Reactive<import("element-plus").FormItemContext[]>;
|
|
53
|
+
setInitialValues: (initModel: Record<string, any>) => void;
|
|
54
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
55
|
+
validate: (prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => void;
|
|
56
|
+
}, string, {
|
|
57
|
+
labelWidth: string | number;
|
|
58
|
+
labelPosition: "left" | "right" | "top";
|
|
59
|
+
requireAsteriskPosition: "left" | "right";
|
|
60
|
+
labelSuffix: string;
|
|
61
|
+
showMessage: boolean;
|
|
62
|
+
validateOnRuleChange: boolean;
|
|
63
|
+
scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
|
|
64
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
65
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
66
|
+
created?: (() => void) | (() => void)[];
|
|
67
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
68
|
+
mounted?: (() => void) | (() => void)[];
|
|
69
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
70
|
+
updated?: (() => void) | (() => void)[];
|
|
71
|
+
activated?: (() => void) | (() => void)[];
|
|
72
|
+
deactivated?: (() => void) | (() => void)[];
|
|
73
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
74
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
75
|
+
destroyed?: (() => void) | (() => void)[];
|
|
76
|
+
unmounted?: (() => void) | (() => void)[];
|
|
77
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
78
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
79
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
80
|
+
};
|
|
81
|
+
$forceUpdate: () => void;
|
|
82
|
+
$nextTick: typeof import("vue").nextTick;
|
|
83
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
84
|
+
} & Readonly<{
|
|
85
|
+
labelWidth: string | number;
|
|
86
|
+
labelPosition: "left" | "right" | "top";
|
|
87
|
+
requireAsteriskPosition: "left" | "right";
|
|
88
|
+
labelSuffix: string;
|
|
89
|
+
showMessage: boolean;
|
|
90
|
+
validateOnRuleChange: boolean;
|
|
91
|
+
scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
|
|
92
|
+
}> & Omit<Readonly<import("element-plus").FormProps> & Readonly<{
|
|
93
|
+
onValidate?: ((prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
94
|
+
}>, "labelPosition" | "labelWidth" | "showMessage" | "validate" | "requireAsteriskPosition" | "labelSuffix" | "validateOnRuleChange" | "scrollIntoViewOptions" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "fields" | "setInitialValues"> & {
|
|
95
|
+
validate: (callback?: FormValidateCallback) => FormValidationResult;
|
|
96
|
+
validateField: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
|
|
97
|
+
resetFields: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>) => void;
|
|
98
|
+
clearValidate: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>) => void;
|
|
99
|
+
scrollToField: (prop: import("element-plus").FormItemProp) => void;
|
|
100
|
+
getField: (prop: import("element-plus").FormItemProp) => import("element-plus").FormItemContext | undefined;
|
|
101
|
+
fields: import("vue").Reactive<import("element-plus").FormItemContext[]>;
|
|
102
|
+
setInitialValues: (initModel: Record<string, any>) => void;
|
|
103
|
+
} & {} & import("vue").ComponentCustomProperties & {} & {
|
|
104
|
+
$slots: {
|
|
105
|
+
default?: (props: {}) => any;
|
|
106
|
+
};
|
|
107
|
+
}) | undefined, ({
|
|
108
|
+
$: import("vue").ComponentInternalInstance;
|
|
109
|
+
$data: {};
|
|
110
|
+
$props: {
|
|
111
|
+
readonly model?: Record<string, any> | undefined;
|
|
112
|
+
readonly rules?: import("element-plus").FormRules | undefined;
|
|
113
|
+
readonly labelPosition?: "left" | "right" | "top" | undefined;
|
|
114
|
+
readonly requireAsteriskPosition?: "left" | "right" | undefined;
|
|
115
|
+
readonly labelWidth?: string | number | undefined;
|
|
116
|
+
readonly labelSuffix?: string | undefined;
|
|
117
|
+
readonly inline?: boolean | undefined;
|
|
118
|
+
readonly inlineMessage?: boolean | undefined;
|
|
119
|
+
readonly statusIcon?: boolean | undefined;
|
|
120
|
+
readonly showMessage?: boolean | undefined;
|
|
121
|
+
readonly validateOnRuleChange?: boolean | undefined;
|
|
122
|
+
readonly hideRequiredAsterisk?: boolean | undefined;
|
|
123
|
+
readonly scrollToError?: boolean | undefined;
|
|
124
|
+
readonly scrollIntoViewOptions?: (ScrollIntoViewOptions | boolean) | undefined;
|
|
125
|
+
readonly size?: import("element-plus").ComponentSize | undefined;
|
|
126
|
+
readonly disabled?: boolean | undefined;
|
|
127
|
+
readonly onValidate?: ((prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => any) | undefined | undefined;
|
|
128
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
129
|
+
$attrs: import("vue").Attrs;
|
|
130
|
+
$refs: {
|
|
131
|
+
[x: string]: unknown;
|
|
132
|
+
};
|
|
133
|
+
$slots: Readonly<{
|
|
134
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
135
|
+
}>;
|
|
136
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
137
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
138
|
+
$host: Element | null;
|
|
139
|
+
$emit: (event: "validate", prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => void;
|
|
140
|
+
$el: any;
|
|
141
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("element-plus").FormProps> & Readonly<{
|
|
142
|
+
onValidate?: ((prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
143
|
+
}>, {
|
|
144
|
+
validate: (callback?: FormValidateCallback) => FormValidationResult;
|
|
145
|
+
validateField: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
|
|
146
|
+
resetFields: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>) => void;
|
|
147
|
+
clearValidate: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>) => void;
|
|
148
|
+
scrollToField: (prop: import("element-plus").FormItemProp) => void;
|
|
149
|
+
getField: (prop: import("element-plus").FormItemProp) => import("element-plus").FormItemContext | undefined;
|
|
150
|
+
fields: import("vue").Reactive<import("element-plus").FormItemContext[]>;
|
|
151
|
+
setInitialValues: (initModel: Record<string, any>) => void;
|
|
152
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
153
|
+
validate: (prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => void;
|
|
154
|
+
}, string, {
|
|
155
|
+
labelWidth: string | number;
|
|
156
|
+
labelPosition: "left" | "right" | "top";
|
|
157
|
+
requireAsteriskPosition: "left" | "right";
|
|
158
|
+
labelSuffix: string;
|
|
159
|
+
showMessage: boolean;
|
|
160
|
+
validateOnRuleChange: boolean;
|
|
161
|
+
scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
|
|
162
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
163
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
164
|
+
created?: (() => void) | (() => void)[];
|
|
165
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
166
|
+
mounted?: (() => void) | (() => void)[];
|
|
167
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
168
|
+
updated?: (() => void) | (() => void)[];
|
|
169
|
+
activated?: (() => void) | (() => void)[];
|
|
170
|
+
deactivated?: (() => void) | (() => void)[];
|
|
171
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
172
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
173
|
+
destroyed?: (() => void) | (() => void)[];
|
|
174
|
+
unmounted?: (() => void) | (() => void)[];
|
|
175
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
176
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
177
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
178
|
+
};
|
|
179
|
+
$forceUpdate: () => void;
|
|
180
|
+
$nextTick: typeof import("vue").nextTick;
|
|
181
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
182
|
+
} & Readonly<{
|
|
183
|
+
labelWidth: string | number;
|
|
184
|
+
labelPosition: "left" | "right" | "top";
|
|
185
|
+
requireAsteriskPosition: "left" | "right";
|
|
186
|
+
labelSuffix: string;
|
|
187
|
+
showMessage: boolean;
|
|
188
|
+
validateOnRuleChange: boolean;
|
|
189
|
+
scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
|
|
190
|
+
}> & Omit<Readonly<import("element-plus").FormProps> & Readonly<{
|
|
191
|
+
onValidate?: ((prop: import("element-plus").FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
192
|
+
}>, "labelPosition" | "labelWidth" | "showMessage" | "validate" | "requireAsteriskPosition" | "labelSuffix" | "validateOnRuleChange" | "scrollIntoViewOptions" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "fields" | "setInitialValues"> & {
|
|
193
|
+
validate: (callback?: FormValidateCallback) => FormValidationResult;
|
|
194
|
+
validateField: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
|
|
195
|
+
resetFields: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>) => void;
|
|
196
|
+
clearValidate: (props?: import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemProp>) => void;
|
|
197
|
+
scrollToField: (prop: import("element-plus").FormItemProp) => void;
|
|
198
|
+
getField: (prop: import("element-plus").FormItemProp) => import("element-plus").FormItemContext | undefined;
|
|
199
|
+
fields: import("vue").Reactive<import("element-plus").FormItemContext[]>;
|
|
200
|
+
setInitialValues: (initModel: Record<string, any>) => void;
|
|
201
|
+
} & {} & import("vue").ComponentCustomProperties & {} & {
|
|
202
|
+
$slots: {
|
|
203
|
+
default?: (props: {}) => any;
|
|
204
|
+
};
|
|
205
|
+
}) | undefined>;
|
|
206
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("element-plus"),h=require("@vunk/core/shared/utils-vue"),e=require("vue"),q=require("@vunk/form/shared/element-plus"),u=require("@vunk/form/composables"),B=require("@vunk/form/composables/element-plus"),v=require("@vunk/core/shared/utils-object"),V=require("@vunk/form/shared/rules"),O=require("../index-DSyxYMB0.js"),$=require("@vunk/form/components/collapse-item"),k={...s.formItemProps,labelPosition:{type:String,default:void 0},formItemSize:{type:String,default:void 0},formItemSlots:{type:Object,default:void 0},elRef:{type:Function,required:!1},inline:{type:Boolean,default:!1},readonly:{type:Boolean,default:void 0},formItemTip:{type:String,default:void 0},formItemTipClass:null,labelTip:{type:String,default:void 0},information:{type:Boolean,default:!1},prop:null,defaultModelValue:null};Reflect.deleteProperty(k,"size");const b=k,_=h.bindPropsFactory(b),E=Object.freeze(Object.defineProperty({__proto__:null,createBindProps:_,props:b},Symbol.toStringTag,{value:"Module"})),N={key:0,class:"vkf-form-item-label__span"},R={key:2,class:"vkf-form-item-label__actions"},j=e.defineComponent({inheritAttrs:!1,__name:"core",props:{labelTip:{type:String,default:""},formItemTip:{type:String,default:""},formItemTipClass:null,elRef:null,label:null,prop:null},setup(t){const i=t,{mittOn:f}=u.useFormMitt(),m=$.useCollapseItemContext();return f("afterValidate",({invalidFields:o})=>{if(!o||i.prop==null||!(i.prop in o))return;const r=m;if(!r)return;const n=r.name;if(r.accordion){if(Object.keys(o)[0]===i.prop){if(r.activeNames.includes(n))return;r.handleItemClick(n)}}else{if(r.activeNames.includes(n))return;r.handleItemClick(n)}}),(o,r)=>(e.openBlock(),e.createBlock(e.unref(s.ElFormItem),e.mergeProps(o.$attrs,{prop:t.prop,class:["vkf-form-item",{"has-label-actions":o.$slots.labelActions}],label:t.label}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"before"),e.renderSlot(o.$slots,"default"),e.renderSlot(o.$slots,"after"),t.formItemTip?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vkf-form-item__tip",t.formItemTipClass])},[e.createElementVNode("span",null,e.toDisplayString(t.formItemTip),1)],2)):e.createCommentVNode("",!0)]),label:e.withCtx(n=>[e.renderSlot(o.$slots,"label",e.normalizeProps(e.guardReactiveProps(n)),()=>[t.label?(e.openBlock(),e.createElementBlock("span",N,e.toDisplayString(n.label),1)):e.createCommentVNode("",!0),t.labelTip?(e.openBlock(),e.createBlock(e.unref(s.ElTooltip),{key:1,content:t.labelTip},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElButton),{text:"",class:"vkf-form-item-label-tip-button"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(O.warning_default))]),_:1})]),_:1})]),_:1},8,["content"])):e.createCommentVNode("",!0),o.$slots.labelActions?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(o.$slots,"labelActions")])):e.createCommentVNode("",!0)])]),error:e.withCtx(n=>[e.renderSlot(o.$slots,"error",e.normalizeProps(e.guardReactiveProps(n)))]),_:3},16,["prop","class","label"]))}}),C=e.defineComponent({name:"VkfFormItem",props:b,setup(t,{slots:i}){const f=q.createFormItemBindProps(t,["rules"]),m=u.useComputedReadonly(t),{tr:o}=B.useLocale(),r=e.ref(),n=e.computed(()=>t.labelPosition),p=u.useComputedLabelPosition(r,n),y=()=>t.label||o("vkf.formItem.defaultField","该字段"),P=l=>{if(l.message)return;l.required&&(l.message=o("vkf.formItem.required","{label}不能为空",{label:y()}));const a=V.PATTERN_OPTIONS.find(I=>I.value===l.pattern);a&&(l.message=o("vkf.formItem.pattern","输入 {label} {pattern}",{label:y(),pattern:a.title}))},T=e.computed(()=>{let l=[];return!t.rules&&t.required&&l.push({required:!0}),v.isPlainObject(t.rules)&&(l=[t.rules]),Array.isArray(t.rules)&&(l=t.rules,t.required&&!t.rules.find(a=>a.required)&&l.push({required:!0})),l=l.filter(a=>{if(a&&v.isPlainObject(a))return Object.keys(a).filter(g=>!g.startsWith("data-")).length>0}),l.forEach(a=>{P(a)}),l}),{getDataValue:c,emitSetData:d}=u.useRendererData();setTimeout(()=>{t.defaultModelValue!==void 0&&t.prop&&(c==null?void 0:c(t.prop))===void 0&&(d==null||d({k:t.prop,v:t.defaultModelValue}))});const S=l=>{r.value=(l==null?void 0:l.$el)??l,typeof t.elRef=="function"&&t.elRef(l)};return()=>e.h(j,{...f.value,"label-position":p.value,elRef:S,class:{"is-readonly":m.value,"vkf-form-item--inline":t.inline,"is-empty-label":!t.label,"is-information":t.information},size:t.formItemSize,rules:T.value,formItemTip:t.formItemTip,formItemTipClass:t.formItemTipClass,labelTip:t.labelTip,label:t.label},{...i,...t.formItemSlots})}}),z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfFormItem=C;exports._VkfFormItemCtx=E;exports.__VkfFormItem=z;exports.default=C;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { formItemProps as q, ElFormItem as z, ElTooltip as
|
|
2
|
-
import { bindPropsFactory as
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { createFormItemBindProps as
|
|
5
|
-
import { useComputedReadonly as H, useComputedLabelPosition as J, useRendererData as Q } from "@vunk/form/composables";
|
|
1
|
+
import { formItemProps as q, ElFormItem as z, ElTooltip as F, ElButton as A, ElIcon as M } from "element-plus";
|
|
2
|
+
import { bindPropsFactory as N } from "@vunk/core/shared/utils-vue";
|
|
3
|
+
import { defineComponent as _, openBlock as f, createBlock as P, unref as m, mergeProps as L, withCtx as i, renderSlot as n, normalizeProps as C, guardReactiveProps as S, createElementBlock as y, toDisplayString as h, createCommentVNode as u, createVNode as I, normalizeClass as w, createElementVNode as K, ref as D, computed as O, h as W } from "vue";
|
|
4
|
+
import { createFormItemBindProps as x } from "@vunk/form/shared/element-plus";
|
|
5
|
+
import { useFormMitt as G, useComputedReadonly as H, useComputedLabelPosition as J, useRendererData as Q } from "@vunk/form/composables";
|
|
6
6
|
import { useLocale as U } from "@vunk/form/composables/element-plus";
|
|
7
|
-
import { isPlainObject as
|
|
7
|
+
import { isPlainObject as R } from "@vunk/core/shared/utils-object";
|
|
8
8
|
import { PATTERN_OPTIONS as X } from "@vunk/form/shared/rules";
|
|
9
9
|
import { w as Y } from "../index-BCZuzyeO.mjs";
|
|
10
|
-
|
|
10
|
+
import { useCollapseItemContext as Z } from "@vunk/form/components/collapse-item";
|
|
11
|
+
const $ = {
|
|
11
12
|
...q,
|
|
12
13
|
labelPosition: {
|
|
13
14
|
type: String,
|
|
@@ -49,18 +50,18 @@ const R = {
|
|
|
49
50
|
prop: null,
|
|
50
51
|
defaultModelValue: null
|
|
51
52
|
};
|
|
52
|
-
Reflect.deleteProperty(
|
|
53
|
-
const
|
|
53
|
+
Reflect.deleteProperty($, "size");
|
|
54
|
+
const v = $, ee = N(v), be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
54
55
|
__proto__: null,
|
|
55
|
-
createBindProps:
|
|
56
|
-
props:
|
|
57
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
56
|
+
createBindProps: ee,
|
|
57
|
+
props: v
|
|
58
|
+
}, Symbol.toStringTag, { value: "Module" })), te = {
|
|
58
59
|
key: 0,
|
|
59
60
|
class: "vkf-form-item-label__span"
|
|
60
|
-
},
|
|
61
|
+
}, le = {
|
|
61
62
|
key: 2,
|
|
62
63
|
class: "vkf-form-item-label__actions"
|
|
63
|
-
},
|
|
64
|
+
}, oe = /* @__PURE__ */ _({
|
|
64
65
|
inheritAttrs: !1,
|
|
65
66
|
__name: "core",
|
|
66
67
|
props: {
|
|
@@ -74,43 +75,59 @@ const y = R, Z = L(y), ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object
|
|
|
74
75
|
},
|
|
75
76
|
formItemTipClass: null,
|
|
76
77
|
elRef: null,
|
|
77
|
-
label: null
|
|
78
|
+
label: null,
|
|
79
|
+
prop: null
|
|
78
80
|
},
|
|
79
81
|
setup(e) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
const s = e, { mittOn: c } = G(), d = Z();
|
|
83
|
+
return c("afterValidate", ({ invalidFields: l }) => {
|
|
84
|
+
if (!l || s.prop == null || !(s.prop in l)) return;
|
|
85
|
+
const o = d;
|
|
86
|
+
if (!o) return;
|
|
87
|
+
const r = o.name;
|
|
88
|
+
if (o.accordion) {
|
|
89
|
+
if (Object.keys(l)[0] === s.prop) {
|
|
90
|
+
if (o.activeNames.includes(r)) return;
|
|
91
|
+
o.handleItemClick(r);
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
if (o.activeNames.includes(r)) return;
|
|
95
|
+
o.handleItemClick(r);
|
|
96
|
+
}
|
|
97
|
+
}), (l, o) => (f(), P(m(z), L(l.$attrs, {
|
|
98
|
+
prop: e.prop,
|
|
82
99
|
class: ["vkf-form-item", {
|
|
83
100
|
"has-label-actions": l.$slots.labelActions
|
|
84
101
|
}],
|
|
85
102
|
label: e.label
|
|
86
103
|
}), {
|
|
87
|
-
default:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
e.formItemTip ? (
|
|
104
|
+
default: i(() => [
|
|
105
|
+
n(l.$slots, "before"),
|
|
106
|
+
n(l.$slots, "default"),
|
|
107
|
+
n(l.$slots, "after"),
|
|
108
|
+
e.formItemTip ? (f(), y("div", {
|
|
92
109
|
key: 0,
|
|
93
110
|
class: w(["vkf-form-item__tip", e.formItemTipClass])
|
|
94
111
|
}, [
|
|
95
|
-
|
|
96
|
-
], 2)) :
|
|
112
|
+
K("span", null, h(e.formItemTip), 1)
|
|
113
|
+
], 2)) : u("", !0)
|
|
97
114
|
]),
|
|
98
|
-
label:
|
|
99
|
-
|
|
100
|
-
e.label ? (
|
|
101
|
-
e.labelTip ? (
|
|
115
|
+
label: i((r) => [
|
|
116
|
+
n(l.$slots, "label", C(S(r)), () => [
|
|
117
|
+
e.label ? (f(), y("span", te, h(r.label), 1)) : u("", !0),
|
|
118
|
+
e.labelTip ? (f(), P(m(F), {
|
|
102
119
|
key: 1,
|
|
103
120
|
content: e.labelTip
|
|
104
121
|
}, {
|
|
105
|
-
default:
|
|
106
|
-
|
|
122
|
+
default: i(() => [
|
|
123
|
+
I(m(A), {
|
|
107
124
|
text: "",
|
|
108
125
|
class: "vkf-form-item-label-tip-button"
|
|
109
126
|
}, {
|
|
110
|
-
default:
|
|
111
|
-
|
|
112
|
-
default:
|
|
113
|
-
|
|
127
|
+
default: i(() => [
|
|
128
|
+
I(m(M), null, {
|
|
129
|
+
default: i(() => [
|
|
130
|
+
I(m(Y))
|
|
114
131
|
]),
|
|
115
132
|
_: 1
|
|
116
133
|
})
|
|
@@ -119,88 +136,88 @@ const y = R, Z = L(y), ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object
|
|
|
119
136
|
})
|
|
120
137
|
]),
|
|
121
138
|
_: 1
|
|
122
|
-
}, 8, ["content"])) :
|
|
123
|
-
l.$slots.labelActions ? (
|
|
124
|
-
|
|
125
|
-
])) :
|
|
139
|
+
}, 8, ["content"])) : u("", !0),
|
|
140
|
+
l.$slots.labelActions ? (f(), y("div", le, [
|
|
141
|
+
n(l.$slots, "labelActions")
|
|
142
|
+
])) : u("", !0)
|
|
126
143
|
])
|
|
127
144
|
]),
|
|
128
|
-
error:
|
|
129
|
-
|
|
145
|
+
error: i((r) => [
|
|
146
|
+
n(l.$slots, "error", C(S(r)))
|
|
130
147
|
]),
|
|
131
148
|
_: 3
|
|
132
|
-
}, 16, ["class", "label"]));
|
|
149
|
+
}, 16, ["prop", "class", "label"]));
|
|
133
150
|
}
|
|
134
|
-
}),
|
|
151
|
+
}), pe = /* @__PURE__ */ _({
|
|
135
152
|
name: "VkfFormItem",
|
|
136
|
-
props:
|
|
153
|
+
props: v,
|
|
137
154
|
setup(e, {
|
|
138
|
-
slots:
|
|
155
|
+
slots: s
|
|
139
156
|
}) {
|
|
140
|
-
const
|
|
141
|
-
tr:
|
|
142
|
-
} = U(),
|
|
157
|
+
const c = x(e, ["rules"]), d = H(e), {
|
|
158
|
+
tr: l
|
|
159
|
+
} = U(), o = D(), r = O(() => e.labelPosition), k = J(o, r), T = () => e.label || l("vkf.formItem.defaultField", "该字段"), B = (t) => {
|
|
143
160
|
if (t.message) return;
|
|
144
|
-
t.required && (t.message =
|
|
161
|
+
t.required && (t.message = l("vkf.formItem.required", "{label}不能为空", {
|
|
145
162
|
label: T()
|
|
146
163
|
}));
|
|
147
|
-
const
|
|
148
|
-
|
|
164
|
+
const a = X.find((g) => g.value === t.pattern);
|
|
165
|
+
a && (t.message = l("vkf.formItem.pattern", "输入 {label} {pattern}", {
|
|
149
166
|
label: T(),
|
|
150
|
-
pattern:
|
|
167
|
+
pattern: a.title
|
|
151
168
|
}));
|
|
152
|
-
},
|
|
169
|
+
}, E = O(() => {
|
|
153
170
|
let t = [];
|
|
154
171
|
return !e.rules && e.required && t.push({
|
|
155
172
|
required: !0
|
|
156
|
-
}),
|
|
173
|
+
}), R(e.rules) && (t = [e.rules]), Array.isArray(e.rules) && (t = e.rules, e.required && !e.rules.find((a) => a.required) && t.push({
|
|
157
174
|
required: !0
|
|
158
|
-
})), t = t.filter((
|
|
159
|
-
if (
|
|
160
|
-
return Object.keys(
|
|
161
|
-
}), t.forEach((
|
|
162
|
-
|
|
175
|
+
})), t = t.filter((a) => {
|
|
176
|
+
if (a && R(a))
|
|
177
|
+
return Object.keys(a).filter((j) => !j.startsWith("data-")).length > 0;
|
|
178
|
+
}), t.forEach((a) => {
|
|
179
|
+
B(a);
|
|
163
180
|
}), t;
|
|
164
181
|
}), {
|
|
165
|
-
getDataValue:
|
|
166
|
-
emitSetData:
|
|
182
|
+
getDataValue: b,
|
|
183
|
+
emitSetData: p
|
|
167
184
|
} = Q();
|
|
168
185
|
setTimeout(() => {
|
|
169
|
-
e.defaultModelValue !== void 0 && e.prop && (
|
|
186
|
+
e.defaultModelValue !== void 0 && e.prop && (b == null ? void 0 : b(e.prop)) === void 0 && (p == null || p({
|
|
170
187
|
k: e.prop,
|
|
171
188
|
v: e.defaultModelValue
|
|
172
189
|
}));
|
|
173
190
|
});
|
|
174
|
-
const
|
|
175
|
-
|
|
191
|
+
const V = (t) => {
|
|
192
|
+
o.value = (t == null ? void 0 : t.$el) ?? t, typeof e.elRef == "function" && e.elRef(t);
|
|
176
193
|
};
|
|
177
|
-
return () => W(
|
|
178
|
-
...
|
|
179
|
-
"label-position":
|
|
180
|
-
elRef:
|
|
194
|
+
return () => W(oe, {
|
|
195
|
+
...c.value,
|
|
196
|
+
"label-position": k.value,
|
|
197
|
+
elRef: V,
|
|
181
198
|
class: {
|
|
182
|
-
"is-readonly":
|
|
199
|
+
"is-readonly": d.value,
|
|
183
200
|
"vkf-form-item--inline": e.inline,
|
|
184
201
|
"is-empty-label": !e.label,
|
|
185
202
|
"is-information": e.information
|
|
186
203
|
},
|
|
187
204
|
size: e.formItemSize,
|
|
188
|
-
rules:
|
|
205
|
+
rules: E.value,
|
|
189
206
|
formItemTip: e.formItemTip,
|
|
190
207
|
formItemTipClass: e.formItemTipClass,
|
|
191
208
|
labelTip: e.labelTip,
|
|
192
209
|
label: e.label
|
|
193
210
|
}, {
|
|
194
|
-
...
|
|
211
|
+
...s,
|
|
195
212
|
...e.formItemSlots
|
|
196
213
|
});
|
|
197
214
|
}
|
|
198
|
-
}),
|
|
215
|
+
}), ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
199
216
|
__proto__: null
|
|
200
217
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
201
218
|
export {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
219
|
+
pe as VkfFormItem,
|
|
220
|
+
be as _VkfFormItemCtx,
|
|
221
|
+
ye as __VkfFormItem,
|
|
222
|
+
pe as default
|
|
206
223
|
};
|
|
@@ -28,6 +28,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
28
28
|
formItemTipClass: null;
|
|
29
29
|
elRef: null;
|
|
30
30
|
label: null;
|
|
31
|
+
prop: null;
|
|
31
32
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
33
|
labelTip: {
|
|
33
34
|
type: StringConstructor;
|
|
@@ -40,6 +41,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
40
41
|
formItemTipClass: null;
|
|
41
42
|
elRef: null;
|
|
42
43
|
label: null;
|
|
44
|
+
prop: null;
|
|
43
45
|
}>> & Readonly<{}>, {
|
|
44
46
|
formItemTip: string;
|
|
45
47
|
labelTip: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");function m(t){return{all:t=t||new Map,on:function(n,o){var i=t.get(n);i?i.push(o):t.set(n,[o])},off:function(n,o){var i=t.get(n);i&&(o?i.splice(i.indexOf(o)>>>0,1):t.set(n,[]))},emit:function(n,o){var i=t.get(n);i&&i.slice().map(function(e){e(o)}),(i=t.get("*"))&&i.slice().map(function(e){e(n,o)})}}}const u=Symbol("vkfFormMitt");function c(){const t=m();return r.provide(u,t),t}function f(){const t=r.inject(u,null);return{mittOn:(o,i)=>{if(!t){console.warn("useFormMitt must be used within a VkfForm component");return}t.on(o,i),r.onBeforeUnmount(()=>{t.off(o,i)})},mitt:t}}exports.initFormMitt=c;exports.useFormMitt=f;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Emitter } from 'mitt';
|
|
2
|
+
export type FormEmitter = Emitter<{
|
|
3
|
+
afterValidate: {
|
|
4
|
+
isValid: boolean;
|
|
5
|
+
invalidFields?: Record<string, {
|
|
6
|
+
message?: string;
|
|
7
|
+
fieldValue?: any;
|
|
8
|
+
field?: string;
|
|
9
|
+
}[]>;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export declare function initFormMitt(): FormEmitter;
|
|
13
|
+
export declare function useFormMitt(): {
|
|
14
|
+
mittOn: {
|
|
15
|
+
<Key extends "afterValidate">(type: Key, handler: import("mitt").Handler<{
|
|
16
|
+
afterValidate: {
|
|
17
|
+
isValid: boolean;
|
|
18
|
+
invalidFields?: Record<string, {
|
|
19
|
+
message?: string;
|
|
20
|
+
fieldValue?: any;
|
|
21
|
+
field?: string;
|
|
22
|
+
}[]>;
|
|
23
|
+
};
|
|
24
|
+
}[Key]>): void;
|
|
25
|
+
(type: "*", handler: import("mitt").WildcardHandler<{
|
|
26
|
+
afterValidate: {
|
|
27
|
+
isValid: boolean;
|
|
28
|
+
invalidFields?: Record<string, {
|
|
29
|
+
message?: string;
|
|
30
|
+
fieldValue?: any;
|
|
31
|
+
field?: string;
|
|
32
|
+
}[]>;
|
|
33
|
+
};
|
|
34
|
+
}>): void;
|
|
35
|
+
};
|
|
36
|
+
mitt: FormEmitter | null;
|
|
37
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { provide as m, inject as f, onBeforeUnmount as u } from "vue";
|
|
2
|
+
function c(t) {
|
|
3
|
+
return { all: t = t || /* @__PURE__ */ new Map(), on: function(n, o) {
|
|
4
|
+
var i = t.get(n);
|
|
5
|
+
i ? i.push(o) : t.set(n, [o]);
|
|
6
|
+
}, off: function(n, o) {
|
|
7
|
+
var i = t.get(n);
|
|
8
|
+
i && (o ? i.splice(i.indexOf(o) >>> 0, 1) : t.set(n, []));
|
|
9
|
+
}, emit: function(n, o) {
|
|
10
|
+
var i = t.get(n);
|
|
11
|
+
i && i.slice().map(function(e) {
|
|
12
|
+
e(o);
|
|
13
|
+
}), (i = t.get("*")) && i.slice().map(function(e) {
|
|
14
|
+
e(n, o);
|
|
15
|
+
});
|
|
16
|
+
} };
|
|
17
|
+
}
|
|
18
|
+
const r = Symbol("vkfFormMitt");
|
|
19
|
+
function a() {
|
|
20
|
+
const t = c();
|
|
21
|
+
return m(r, t), t;
|
|
22
|
+
}
|
|
23
|
+
function l() {
|
|
24
|
+
const t = f(r, null);
|
|
25
|
+
return {
|
|
26
|
+
mittOn: (o, i) => {
|
|
27
|
+
if (!t) {
|
|
28
|
+
console.warn("useFormMitt must be used within a VkfForm component");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
t.on(o, i), u(() => {
|
|
32
|
+
t.off(o, i);
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
mitt: t
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
a as initFormMitt,
|
|
40
|
+
l as useFormMitt
|
|
41
|
+
};
|
package/composables/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),T=require("@vunk/form/composables/form-mitt"),C=require("@vunk/shared/function"),P=require("element-plus"),m=require("@vunk/core"),j=(t,n={})=>{o.isRef(t)||(t=o.ref(t));const s={...n,slotsChildren:["default"]};n.slotsChildren&&s.slotsChildren.push(...n.slotsChildren);const e=o.computed(()=>{const c={},g={},I={};function d(M,R=[]){M.forEach((u,h)=>{const i=[...R,h],p={source:u,key:i,nextKey:[...R,h+1],prop:u.prop,id:u.id};c[i.join()]=p,u.prop&&(g[u.prop]=p),u.id&&(I[u.id]=p),u.templateSlots&&(Array.isArray(u.templateSlots)&&(i.push("templateSlots"),d(u.templateSlots,i)),s.slotsChildren.forEach(f=>{Array.isArray(u.templateSlots[f])&&(i.push("templateSlots",f),d(u.templateSlots[f],i))}))})}return d(o.unref(t)),{keyRecord:c,propRecord:g,idRecord:I}});return[t,{manager:e,getManagerInfoByProp:c=>e.value.propRecord[c],getManagerInfoByKey:c=>e.value.keyRecord[c.join()],getManagerInfoById:c=>e.value.idRecord[c]}]},v=()=>o.inject("vkfFormVm",null),E=t=>{const n=v();return o.computed(()=>t.readonly??(n==null?void 0:n.props.readonly)??!1)},D=t=>{const n=o.ref(0),s=o.computed(()=>{n.value;const r=t.value;return r?r.matches(":dir(rtl)")||getComputedStyle(r).direction==="rtl":!1});let e=null;const a=r=>{e==null||e.disconnect(),e=new MutationObserver(()=>{n.value++});let l=r.parentElement;for(;l;)e.observe(l,{attributes:!0,attributeFilter:["dir","style","class"]}),l=l.parentElement};return o.watch(t,r=>{r?a(r):e==null||e.disconnect()},{immediate:!0,flush:"post"}),o.onBeforeUnmount(()=>e==null?void 0:e.disconnect()),s};function b(t,n){const s=D(t),e=o.inject(P.formContextKey,null);return o.computed(()=>{C.noop(t.value);const a=n.value??o.unref(e==null?void 0:e.labelPosition);return a==="start"?s.value?"right":"left":a==="end"?s.value?"left":"right":a})}const S=Symbol("PARENT_KEY"),y=()=>o.inject("vkTemplateInstances",null),k=()=>{const t=y(),n=e=>e==null?void 0:e[S];return{templateInstances:t,getTemplateInstance:e=>{let a=t==null?void 0:t[e];if(a)return a;let r=n(t);for(;r;){if(a=r==null?void 0:r[e],a)return a;r=n(r)}return null},getParent:n}},A=()=>{const t=y(),n=o.shallowReactive({});return n[S]=t,o.provide("vkTemplateInstances",n),n},B=(t,n)=>{const s=o.computed(()=>t.data),r={data:s,emitSetData:l=>{n.emit("setData",{intoUndefined:m.defaultIntoUndefined,...l})},getDataValue:l=>m.getValue(s.value,l,m.defaultIntoUndefined,!0)};return o.provide("vkRendererData",r),r},K=()=>o.inject("vkRendererData",{});Object.defineProperty(exports,"useFormMitt",{enumerable:!0,get:()=>T.useFormMitt});exports.initRendererData=B;exports.initTemplateInstances=A;exports.useComputedLabelPosition=b;exports.useComputedReadonly=E;exports.useForm=v;exports.useRendererData=K;exports.useRtl=D;exports.useSourceManager=j;exports.useTemplateInstances=y;exports.useTemplateInstancesContext=k;
|
package/composables/index.d.ts
CHANGED