@vunk/form 1.1.41 → 1.1.43
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/form/index.js +11 -4
- package/components/form/src/ctx.d.ts +3 -1
- package/components/form/src/ctx.js +2 -1
- package/components/form/src/index.vue.d.ts +3 -0
- package/components/input-link/index.js +5 -1
- package/components/input-link/src/ctx.d.ts +4 -1
- package/components/input-link/src/ctx.js +4 -0
- package/components/input-link/src/index.vue.d.ts +11 -5
- package/package.json +1 -1
package/components/form/index.js
CHANGED
|
@@ -60,7 +60,8 @@ const props = __spreadProps$1(__spreadValues$1({}, formProps), {
|
|
|
60
60
|
const createBindProps = bindPropsFactory(props);
|
|
61
61
|
const emits = __spreadProps$1(__spreadValues$1({}, formEmits), {
|
|
62
62
|
setData: (e) => e,
|
|
63
|
-
validate: null
|
|
63
|
+
validate: null,
|
|
64
|
+
submit: null
|
|
64
65
|
});
|
|
65
66
|
const createOnEmits = onEmitsFactory(emits);
|
|
66
67
|
|
|
@@ -173,13 +174,18 @@ const _sfc_main = defineComponent({
|
|
|
173
174
|
}
|
|
174
175
|
return props2.formItems;
|
|
175
176
|
});
|
|
177
|
+
const handleSubmit = (e) => {
|
|
178
|
+
e.preventDefault();
|
|
179
|
+
emit("submit", e);
|
|
180
|
+
};
|
|
176
181
|
return {
|
|
177
182
|
formProps,
|
|
178
183
|
formEmits,
|
|
179
184
|
getValue,
|
|
180
185
|
getRef,
|
|
181
186
|
computed,
|
|
182
|
-
rendererSource
|
|
187
|
+
rendererSource,
|
|
188
|
+
handleSubmit
|
|
183
189
|
};
|
|
184
190
|
}
|
|
185
191
|
});
|
|
@@ -194,7 +200,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
194
200
|
}
|
|
195
201
|
}, _ctx.formProps, toHandlers(_ctx.formEmits), {
|
|
196
202
|
model: _ctx.model || _ctx.data,
|
|
197
|
-
ref: _ctx.getRef
|
|
203
|
+
ref: _ctx.getRef,
|
|
204
|
+
onSubmit: _ctx.handleSubmit
|
|
198
205
|
}), {
|
|
199
206
|
default: withCtx(() => [
|
|
200
207
|
createVNode(_component_VkfFormItemRenderer, { source: _ctx.rendererSource }, {
|
|
@@ -211,7 +218,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
211
218
|
renderSlot(_ctx.$slots, "default")
|
|
212
219
|
]),
|
|
213
220
|
_: 3
|
|
214
|
-
}, 16, ["class", "model"]);
|
|
221
|
+
}, 16, ["class", "model", "onSubmit"]);
|
|
215
222
|
}
|
|
216
223
|
var VkfForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
217
224
|
|
|
@@ -387,8 +387,10 @@ export declare const createBindProps: <T2 extends import("@vunk/core").NormalObj
|
|
|
387
387
|
export declare const emits: {
|
|
388
388
|
setData: (e: SetDataEvent) => SetDataEvent<any>;
|
|
389
389
|
validate: null;
|
|
390
|
+
submit: null;
|
|
390
391
|
};
|
|
391
|
-
export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("validate" | "setData")[] | undefined>(emit: T2, excludes?: EX | undefined) => { [P in EX extends (infer KE)[] ? Exclude<"validate", KE> | Exclude<"setData", KE> : "validate" | "setData"]: {
|
|
392
|
+
export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("submit" | "validate" | "setData")[] | undefined>(emit: T2, excludes?: EX | undefined) => { [P in EX extends (infer KE)[] ? Exclude<"submit", KE> | Exclude<"validate", KE> | Exclude<"setData", KE> : "submit" | "validate" | "setData"]: {
|
|
392
393
|
setData: (...e: import("@vunk/core").RestParameters<T2>) => void;
|
|
393
394
|
validate: (...e: import("@vunk/core").RestParameters<T2>) => void;
|
|
395
|
+
submit: (...e: import("@vunk/core").RestParameters<T2>) => void;
|
|
394
396
|
}[P]; };
|
|
@@ -53,7 +53,8 @@ const props = __spreadProps(__spreadValues({}, formProps), {
|
|
|
53
53
|
const createBindProps = bindPropsFactory(props);
|
|
54
54
|
const emits = __spreadProps(__spreadValues({}, formEmits), {
|
|
55
55
|
setData: (e) => e,
|
|
56
|
-
validate: null
|
|
56
|
+
validate: null,
|
|
57
|
+
submit: null
|
|
57
58
|
});
|
|
58
59
|
const createOnEmits = onEmitsFactory(emits);
|
|
59
60
|
|
|
@@ -393,9 +393,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
393
393
|
getRef: (e: InstanceType<typeof ElForm>) => void;
|
|
394
394
|
computed: typeof import("@vue/reactivity").computed;
|
|
395
395
|
rendererSource: import("vue").ComputedRef<any>;
|
|
396
|
+
handleSubmit: (e: Event) => void;
|
|
396
397
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
397
398
|
setData: (e: import("@vunk/core").SetDataEvent<any>) => import("@vunk/core").SetDataEvent<any>;
|
|
398
399
|
validate: null;
|
|
400
|
+
submit: null;
|
|
399
401
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
400
402
|
data: {
|
|
401
403
|
type: import("vue").PropType<Record<string, any>>;
|
|
@@ -767,6 +769,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
767
769
|
}>> & {
|
|
768
770
|
onSetData?: ((e: import("@vunk/core").SetDataEvent<any>) => any) | undefined;
|
|
769
771
|
onValidate?: ((...args: any[]) => any) | undefined;
|
|
772
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
770
773
|
}, {
|
|
771
774
|
labelWidth: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
772
775
|
inlineMessage: boolean;
|
|
@@ -59,6 +59,10 @@ const props = __spreadProps(__spreadValues({}, _VkfInputCtx.props), {
|
|
|
59
59
|
referenceLabel: {
|
|
60
60
|
type: String,
|
|
61
61
|
default: "\u53C2\u8003\u5730\u5740"
|
|
62
|
+
},
|
|
63
|
+
modelValue: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: ""
|
|
62
66
|
}
|
|
63
67
|
});
|
|
64
68
|
const emits = __spreadValues({}, _VkfInputCtx.emits);
|
|
@@ -172,7 +176,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
172
176
|
readonly: _ctx.readonly,
|
|
173
177
|
type: _ctx.readonly ? "text" : _ctx.type,
|
|
174
178
|
inputSlots: {
|
|
175
|
-
append: _ctx.readonly ? _ctx.createAppendEl(_ctx.modelValue
|
|
179
|
+
append: _ctx.readonly ? _ctx.createAppendEl(_ctx.modelValue) : void 0
|
|
176
180
|
}
|
|
177
181
|
}), null, 16, ["rules", "readonly", "type", "inputSlots"])) : createCommentVNode("v-if", true)
|
|
178
182
|
]);
|
|
@@ -47,6 +47,10 @@ export declare const props: {
|
|
|
47
47
|
type: StringConstructor;
|
|
48
48
|
default: string;
|
|
49
49
|
};
|
|
50
|
+
modelValue: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
50
54
|
maxlength: {
|
|
51
55
|
type: NumberConstructor;
|
|
52
56
|
/**
|
|
@@ -114,7 +118,6 @@ export declare const props: {
|
|
|
114
118
|
__epPropKey: true;
|
|
115
119
|
};
|
|
116
120
|
disabled: BooleanConstructor;
|
|
117
|
-
modelValue: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown, "", boolean>;
|
|
118
121
|
resize: {
|
|
119
122
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "horizontal" | "vertical" | "none" | "both", unknown>>;
|
|
120
123
|
readonly required: false;
|
|
@@ -55,6 +55,10 @@ const props = __spreadProps(__spreadValues({}, _VkfInputCtx.props), {
|
|
|
55
55
|
referenceLabel: {
|
|
56
56
|
type: String,
|
|
57
57
|
default: "\u53C2\u8003\u5730\u5740"
|
|
58
|
+
},
|
|
59
|
+
modelValue: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ""
|
|
58
62
|
}
|
|
59
63
|
});
|
|
60
64
|
const emits = __spreadValues({}, _VkfInputCtx.emits);
|
|
@@ -36,6 +36,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
36
|
type: StringConstructor;
|
|
37
37
|
default: string;
|
|
38
38
|
};
|
|
39
|
+
modelValue: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
39
43
|
maxlength: {
|
|
40
44
|
type: NumberConstructor;
|
|
41
45
|
required: boolean;
|
|
@@ -100,7 +104,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
104
|
__epPropKey: true;
|
|
101
105
|
};
|
|
102
106
|
disabled: BooleanConstructor;
|
|
103
|
-
modelValue: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown, "", boolean>;
|
|
104
107
|
resize: {
|
|
105
108
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "horizontal" | "vertical" | "none" | "both", unknown>>;
|
|
106
109
|
readonly required: false;
|
|
@@ -168,7 +171,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
168
171
|
labelPosition: "right";
|
|
169
172
|
disabled: boolean;
|
|
170
173
|
id: string | undefined;
|
|
171
|
-
modelValue:
|
|
174
|
+
modelValue: string;
|
|
172
175
|
resize: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "horizontal" | "vertical" | "none" | "both", unknown> | undefined;
|
|
173
176
|
autosize: import("element-plus").InputAutoSize;
|
|
174
177
|
autocomplete: string;
|
|
@@ -204,7 +207,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
204
207
|
compositionupdate: (evt: CompositionEvent) => void;
|
|
205
208
|
compositionend: (evt: CompositionEvent) => void;
|
|
206
209
|
};
|
|
207
|
-
createAppendEl: (url
|
|
210
|
+
createAppendEl: (url?: string) => () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
208
211
|
[key: string]: any;
|
|
209
212
|
}>;
|
|
210
213
|
rules: import("vue").ComputedRef<FormItemRule[]>;
|
|
@@ -259,6 +262,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
259
262
|
type: StringConstructor;
|
|
260
263
|
default: string;
|
|
261
264
|
};
|
|
265
|
+
modelValue: {
|
|
266
|
+
type: StringConstructor;
|
|
267
|
+
default: string;
|
|
268
|
+
};
|
|
262
269
|
maxlength: {
|
|
263
270
|
type: NumberConstructor;
|
|
264
271
|
required: boolean;
|
|
@@ -323,7 +330,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
323
330
|
__epPropKey: true;
|
|
324
331
|
};
|
|
325
332
|
disabled: BooleanConstructor;
|
|
326
|
-
modelValue: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown, "", boolean>;
|
|
327
333
|
resize: {
|
|
328
334
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "horizontal" | "vertical" | "none" | "both", unknown>>;
|
|
329
335
|
readonly required: false;
|
|
@@ -396,7 +402,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
396
402
|
labelPosition: "right";
|
|
397
403
|
disabled: boolean;
|
|
398
404
|
id: string;
|
|
399
|
-
modelValue:
|
|
405
|
+
modelValue: string;
|
|
400
406
|
autosize: import("element-plus").InputAutoSize;
|
|
401
407
|
autocomplete: string;
|
|
402
408
|
placeholder: string;
|