@vunk/form 2.19.1 → 2.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/components/api-tables-select/index.cjs +1 -1
- package/components/api-tables-select/index.mjs +1 -1
- package/components/api-tables-select/src/ctx.d.ts +5 -2
- package/components/api-tables-select/src/index.vue.d.ts +11 -5
- package/components/button/index.cjs +1 -1
- package/components/button/index.mjs +1 -1
- package/components/button/src/ctx.d.ts +5 -2
- package/components/button/src/index.vue.d.ts +22 -10
- package/components/card-input-collection/index.cjs +1 -1
- package/components/card-input-collection/index.mjs +2 -2
- package/components/card-input-collection/src/core.vue.d.ts +11 -5
- package/components/card-input-collection/src/ctx.d.ts +5 -2
- package/components/card-input-collection/src/index.vue.d.ts +11 -5
- package/components/cascader/src/ctx.d.ts +6 -3
- package/components/cascader/src/index.vue.d.ts +11 -5
- package/components/checkbox/index.cjs +1 -1
- package/components/checkbox/index.mjs +1 -1
- package/components/checkbox/src/ctx.d.ts +6 -3
- package/components/checkbox/src/index.vue.d.ts +22 -10
- package/components/cloneDeep-DE0l40hv.mjs +486 -0
- package/components/cloneDeep-DaYwfXwD.js +1 -0
- package/components/color-picker/src/ctx.d.ts +5 -2
- package/components/color-picker/src/index.vue.d.ts +11 -5
- package/components/date-picker/src/ctx.d.ts +6 -3
- package/components/date-picker/src/index.vue.d.ts +11 -5
- package/components/date-picker-range/index.cjs +1 -1
- package/components/date-picker-range/index.mjs +1 -1
- package/components/date-picker-range/src/ctx.d.ts +5 -2
- package/components/date-picker-range/src/index.vue.d.ts +22 -10
- package/components/debounce-CliSPkvP.js +1 -0
- package/components/debounce-DIph5ENi.mjs +85 -0
- package/components/dialog-input-collection/index.cjs +1 -1
- package/components/dialog-input-collection/index.mjs +2 -2
- package/components/dialog-input-collection/src/ctx.d.ts +5 -2
- package/components/dialog-input-collection/src/index.vue.d.ts +11 -5
- package/components/download-plus/index.cjs +1 -1
- package/components/download-plus/index.mjs +3 -3
- package/components/download-plus/src/ctx.d.ts +5 -2
- package/components/download-plus/src/index.vue.d.ts +22 -10
- package/components/editable-text/index.cjs +1 -1
- package/components/editable-text/index.mjs +1 -1
- package/components/editable-text/src/ctx.d.ts +5 -2
- package/components/editable-text/src/index.vue.d.ts +11 -5
- package/components/el-slider/index.cjs +1 -1
- package/components/el-slider/index.mjs +1 -1
- package/components/el-slider/src/composables/index.cjs +1 -1
- package/components/el-slider/src/composables/index.mjs +1 -1
- package/components/esri-input-geojson/index.cjs +1 -1
- package/components/esri-input-geojson/index.mjs +2 -2
- package/components/esri-input-geojson/src/ctx.d.ts +6 -3
- package/components/esri-input-geojson/src/index.vue.d.ts +35 -17
- package/components/fieldset/index.cjs +1 -1
- package/components/fieldset/index.mjs +40 -35
- package/components/fieldset/src/ctx.d.ts +1 -1
- package/components/fieldset/src/index.vue.d.ts +3 -3
- package/components/form/index.cjs +1 -1
- package/components/form/index.mjs +83 -72
- package/components/form/src/ctx.d.ts +5 -2
- package/components/form/src/index.vue.d.ts +13 -7
- package/components/form-item/index.cjs +1 -1
- package/components/form-item/index.mjs +78 -69
- package/components/form-item/src/ctx.d.ts +6 -3
- package/components/form-item/src/index.vue.d.ts +11 -5
- package/components/index-BCZuzyeO.mjs +317 -0
- package/components/index-DJv1MwwH.mjs +14 -0
- package/components/information-collection/src/ctx.d.ts +5 -2
- package/components/information-collection/src/index.vue.d.ts +11 -5
- package/components/input/index.cjs +1 -1
- package/components/input/index.mjs +1 -1
- package/components/input/src/ctx.d.ts +6 -3
- package/components/input/src/index.vue.d.ts +22 -10
- package/components/input-array/index.cjs +1 -1
- package/components/input-array/index.mjs +2 -2
- package/components/input-array/src/ctx.d.ts +5 -2
- package/components/input-array/src/index.vue.d.ts +11 -5
- package/components/input-collection/index.cjs +1 -1
- package/components/input-collection/index.mjs +2 -2
- package/components/input-collection/src/core.vue.d.ts +11 -5
- package/components/input-collection/src/ctx.d.ts +5 -2
- package/components/input-collection/src/index.vue.d.ts +11 -5
- package/components/input-file/src/index.vue.d.ts +11 -5
- package/components/input-link/index.cjs +1 -1
- package/components/input-link/index.mjs +2 -2
- package/components/input-link/src/ctx.d.ts +5 -2
- package/components/input-link/src/index.vue.d.ts +33 -15
- package/components/input-number/index.cjs +1 -1
- package/components/input-number/index.mjs +1 -1
- package/components/input-number/src/ctx.d.ts +6 -3
- package/components/input-number/src/index.vue.d.ts +22 -10
- package/components/input-tag/index.cjs +1 -1
- package/components/input-tag/index.mjs +1 -1
- package/components/input-tag/src/ctx.d.ts +6 -3
- package/components/input-tag/src/index.vue.d.ts +22 -10
- package/components/isObject-DQpnfMRp.mjs +34 -0
- package/components/monaco-editor/index.cjs +1 -1
- package/components/monaco-editor/index.mjs +1 -1
- package/components/monaco-editor/src/ctx.d.ts +5 -2
- package/components/monaco-editor/src/index.vue.d.ts +22 -10
- package/components/radio/index.cjs +1 -1
- package/components/radio/index.mjs +1 -1
- package/components/radio/src/ctx.d.ts +5 -2
- package/components/radio/src/index.vue.d.ts +22 -10
- package/components/radio/src/wraper.vue.d.ts +11 -5
- package/components/select/index.cjs +1 -1
- package/components/select/index.mjs +1 -1
- package/components/select/src/core.vue.d.ts +22 -10
- package/components/select/src/ctx.d.ts +6 -3
- package/components/select/src/index.vue.d.ts +11 -5
- package/components/slider/src/ctx.d.ts +5 -2
- package/components/slider/src/index.vue.d.ts +11 -5
- package/components/style.css +1 -1
- package/components/switch/src/ctx.d.ts +5 -2
- package/components/switch/src/index.vue.d.ts +11 -5
- package/components/tables-select/src/ctx.d.ts +6 -3
- package/components/tables-select/src/index.vue.d.ts +12 -6
- package/components/templates-default/index.cjs +1 -1
- package/components/templates-default/index.mjs +1 -1
- package/components/templates-default/src/index.vue.d.ts +219 -102
- package/components/templates-element-plus/index.cjs +1 -1
- package/components/templates-element-plus/index.mjs +1 -1
- package/components/templates-esri/index.cjs +1 -1
- package/components/templates-esri/index.mjs +1 -1
- package/components/templates-esri/src/index.vue.d.ts +35 -17
- package/components/templates-layout/index.cjs +1 -1
- package/components/templates-layout/index.mjs +1 -1
- package/components/templates-layout/src/index.vue.d.ts +3 -3
- package/components/templates-variant/index.cjs +1 -1
- package/components/templates-variant/index.mjs +1 -1
- package/components/templates-variant/src/index.vue.d.ts +22 -10
- package/components/time-picker/src/ctx.d.ts +6 -3
- package/components/time-picker/src/index.vue.d.ts +11 -5
- package/components/upload/index.cjs +1 -1
- package/components/upload/index.mjs +2 -2
- package/components/upload/src/ctx.d.ts +6 -3
- package/components/upload/src/index.vue.d.ts +22 -10
- package/components/upload/src/wraper.vue.d.ts +11 -5
- package/components/upload-plus/index.cjs +1 -1
- package/components/upload-plus/index.mjs +2 -2
- package/components/upload-plus/src/ctx.d.ts +5 -2
- package/components/upload-plus/src/index.vue.d.ts +11 -5
- package/components/use-watch-Bfrz9pv_.js +1 -0
- package/components/use-watch-t49wP7jy.mjs +414 -0
- package/components/van-cascader/src/ctx.d.ts +5 -2
- package/components/van-cascader/src/index.vue.d.ts +11 -5
- package/components/var-datetime-picker/index.cjs +1 -1
- package/components/var-datetime-picker/index.mjs +1 -1
- package/components/var-datetime-picker/src/ctx.d.ts +5 -2
- package/components/var-datetime-picker/src/index.vue.d.ts +22 -10
- package/components/vditor/index.cjs +1 -1
- package/components/vditor/index.mjs +1 -1
- package/components/vditor/src/ctx.d.ts +5 -2
- package/components/vditor/src/index.vue.d.ts +22 -10
- package/composables/index.cjs +1 -1
- package/composables/index.d.ts +1 -0
- package/composables/index.mjs +69 -60
- package/composables/useComputedLabelPosition.d.ts +15 -0
- package/index.css +1 -1
- package/package.json +1 -1
- package/shared/element-plus/ctx.d.ts +2 -2
- package/components/cloneDeep.cjs +0 -1
- package/components/debounce.cjs +0 -1
- package/components/use-watch.cjs +0 -1
- /package/components/{_plugin-vue_export-helper.cjs → _plugin-vue_export-helper-BHFhmbuH.js} +0 -0
- /package/components/{index2.cjs → index-BNPcMpOO.js} +0 -0
- /package/components/{index.cjs → index-DSyxYMB0.js} +0 -0
- /package/components/{isObject.cjs → isObject-fAvOGw_H.js} +0 -0
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import { formProps as
|
|
2
|
-
import { bindPropsFactory as
|
|
3
|
-
import { NOOP as
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { VkfFormItemRenderer as
|
|
6
|
-
import { createFormBindProps as
|
|
7
|
-
import { getValue as
|
|
8
|
-
import { VkfTemplatesDefault as
|
|
9
|
-
import { VkfTemplatesLayout as
|
|
10
|
-
import { pickObject as
|
|
11
|
-
import { genTemplateIfFunc as
|
|
12
|
-
import { VkfRendererData as
|
|
13
|
-
import { pickObject as
|
|
14
|
-
import { VkfFormsSegment as
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { formProps as I, formEmits as T, ElForm as h } from "element-plus";
|
|
2
|
+
import { bindPropsFactory as j, onEmitsFactory as C } from "@vunk/core/shared/utils-vue";
|
|
3
|
+
import { NOOP as D } from "@vunk/core/shared/utils-function";
|
|
4
|
+
import { defineComponent as L, shallowRef as $, getCurrentInstance as B, computed as l, provide as w, resolveComponent as a, openBlock as A, createBlock as q, mergeProps as v, toHandlers as z, withCtx as f, createVNode as m, renderSlot as O } from "vue";
|
|
5
|
+
import { VkfFormItemRenderer as M } from "@vunk/form/components/form-item-renderer";
|
|
6
|
+
import { createFormBindProps as N, createFormOnEmits as H } from "@vunk/form/shared/element-plus";
|
|
7
|
+
import { getValue as G } from "@vunk/core/shared/helper";
|
|
8
|
+
import { VkfTemplatesDefault as J } from "@vunk/form/components/templates-default";
|
|
9
|
+
import { VkfTemplatesLayout as K } from "@vunk/form/components/templates-layout";
|
|
10
|
+
import { pickObject as Q } from "@vunk/core/shared/utils-object";
|
|
11
|
+
import { genTemplateIfFunc as U } from "@vunk/form/shared/form";
|
|
12
|
+
import { VkfRendererData as W } from "@vunk/form/components/renderer-data";
|
|
13
|
+
import { pickObject as X } from "@vunk/shared/object";
|
|
14
|
+
import { VkfFormsSegment as Y } from "@vunk/form/components/forms-provider";
|
|
15
|
+
import { useComputedLabelPosition as Z } from "@vunk/form/composables";
|
|
16
|
+
import { _ as x } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
17
|
+
const b = {
|
|
18
|
+
...I,
|
|
19
|
+
labelPosition: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "end"
|
|
22
|
+
},
|
|
18
23
|
data: {
|
|
19
24
|
type: Object,
|
|
20
25
|
default: () => ({})
|
|
@@ -28,7 +33,7 @@ const d = {
|
|
|
28
33
|
},
|
|
29
34
|
elRef: {
|
|
30
35
|
type: Function,
|
|
31
|
-
default: () =>
|
|
36
|
+
default: () => D
|
|
32
37
|
},
|
|
33
38
|
/**
|
|
34
39
|
* 是否开启布局模式
|
|
@@ -62,22 +67,22 @@ const d = {
|
|
|
62
67
|
type: Object,
|
|
63
68
|
default: () => ({})
|
|
64
69
|
}
|
|
65
|
-
},
|
|
66
|
-
...
|
|
70
|
+
}, ee = j(b), k = {
|
|
71
|
+
...T,
|
|
67
72
|
setData: (e) => e,
|
|
68
73
|
validate: null,
|
|
69
74
|
submit: null
|
|
70
|
-
},
|
|
75
|
+
}, te = C(k), _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
71
76
|
__proto__: null,
|
|
72
|
-
createBindProps:
|
|
73
|
-
createOnEmits:
|
|
74
|
-
emits:
|
|
75
|
-
props:
|
|
76
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
77
|
+
createBindProps: ee,
|
|
78
|
+
createOnEmits: te,
|
|
79
|
+
emits: k,
|
|
80
|
+
props: b
|
|
81
|
+
}, Symbol.toStringTag, { value: "Module" })), oe = (e) => 24 - e.templateSlots.reduce((o, r) => {
|
|
77
82
|
if (!r.span)
|
|
78
83
|
throw new Error("ElColSource span is required");
|
|
79
84
|
return o + r.span;
|
|
80
|
-
}, 0),
|
|
85
|
+
}, 0), re = (e, o = {}) => {
|
|
81
86
|
const r = e.span ?? o.span;
|
|
82
87
|
if (r == null)
|
|
83
88
|
throw new Error("genColItem ElColSource span is required");
|
|
@@ -86,89 +91,95 @@ const d = {
|
|
|
86
91
|
templateType: "ElCol",
|
|
87
92
|
span: r,
|
|
88
93
|
templateSlots: [
|
|
89
|
-
|
|
94
|
+
Q(e, {
|
|
90
95
|
excludes: ["span"]
|
|
91
96
|
})
|
|
92
97
|
]
|
|
93
98
|
};
|
|
94
|
-
},
|
|
99
|
+
}, ne = (e, o = {}) => ({
|
|
95
100
|
...o,
|
|
96
101
|
templateType: "ElRow",
|
|
97
102
|
templateSlots: e ? [
|
|
98
103
|
e
|
|
99
104
|
] : []
|
|
100
|
-
}),
|
|
105
|
+
}), ae = L({
|
|
101
106
|
name: "VkfForm",
|
|
102
107
|
components: {
|
|
103
|
-
VkfRendererData:
|
|
104
|
-
ElForm:
|
|
105
|
-
VkfFormItemRenderer:
|
|
106
|
-
VkfTemplatesDefault:
|
|
107
|
-
VkfTemplatesLayout:
|
|
108
|
-
VkfFormsSegment:
|
|
108
|
+
VkfRendererData: W,
|
|
109
|
+
ElForm: h,
|
|
110
|
+
VkfFormItemRenderer: M,
|
|
111
|
+
VkfTemplatesDefault: J,
|
|
112
|
+
VkfTemplatesLayout: K,
|
|
113
|
+
VkfFormsSegment: Y
|
|
109
114
|
},
|
|
110
|
-
props:
|
|
111
|
-
emits:
|
|
115
|
+
props: b,
|
|
116
|
+
emits: k,
|
|
112
117
|
setup(e, { emit: o }) {
|
|
113
|
-
const r =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
const r = N(e, ["model", "labelPosition"]), F = H(o), s = $(), g = B(), p = l(() => {
|
|
119
|
+
var t;
|
|
120
|
+
return (t = s.value) == null ? void 0 : t.$el;
|
|
121
|
+
}), u = l(() => e.labelPosition), c = Z(p, u), i = l(() => ({
|
|
122
|
+
...r.value,
|
|
123
|
+
"label-position": c.value
|
|
124
|
+
}));
|
|
125
|
+
w("vkfFormVm", g), w("elFormRef", s);
|
|
126
|
+
const d = (t) => {
|
|
127
|
+
s.value = t, e.elRef(t);
|
|
128
|
+
}, y = l(() => e.layout ? e.formItems.reduce((t, n) => {
|
|
129
|
+
var _;
|
|
130
|
+
const S = t.findLast((P) => P.templateType === "ElRow"), R = n.span ?? e.colSource.span;
|
|
131
|
+
if (!R)
|
|
121
132
|
return t.push(n), t;
|
|
122
|
-
if (!((
|
|
133
|
+
if (!((_ = n.templateLayout) != null && _.allowEmpty) && Reflect.has(n, "templateIf") && !U(n.templateIf)(e.data))
|
|
123
134
|
return t;
|
|
124
|
-
const
|
|
135
|
+
const E = re(n, X({
|
|
125
136
|
...e.colSource,
|
|
126
137
|
...n.templateLayout
|
|
127
138
|
}, {
|
|
128
139
|
excludes: ["allowEmpty"]
|
|
129
140
|
}));
|
|
130
|
-
return !
|
|
141
|
+
return !S || oe(S) < R ? t.push(ne(E, e.rowSource)) : S.templateSlots.push(E), t;
|
|
131
142
|
}, []) : e.formItems);
|
|
132
143
|
return {
|
|
133
|
-
formProps:
|
|
134
|
-
formEmits:
|
|
135
|
-
getValue:
|
|
136
|
-
getRef:
|
|
137
|
-
computed:
|
|
138
|
-
rendererSource:
|
|
144
|
+
formProps: i,
|
|
145
|
+
formEmits: F,
|
|
146
|
+
getValue: G,
|
|
147
|
+
getRef: d,
|
|
148
|
+
computed: l,
|
|
149
|
+
rendererSource: y,
|
|
139
150
|
handleSubmit: (t) => {
|
|
140
151
|
t.preventDefault(), o("submit", t);
|
|
141
152
|
}
|
|
142
153
|
};
|
|
143
154
|
}
|
|
144
155
|
});
|
|
145
|
-
function
|
|
146
|
-
const
|
|
147
|
-
return
|
|
156
|
+
function le(e, o, r, F, s, g) {
|
|
157
|
+
const p = a("VkfFormsSegment"), u = a("VkfTemplatesDefault"), c = a("VkfTemplatesLayout"), i = a("VkfFormItemRenderer"), d = a("VkfRendererData"), y = a("ElForm");
|
|
158
|
+
return A(), q(y, v(e.formProps, {
|
|
148
159
|
ref: e.getRef,
|
|
149
160
|
class: {
|
|
150
161
|
"is-readonly": e.readonly
|
|
151
162
|
},
|
|
152
163
|
model: e.model || e.data
|
|
153
|
-
},
|
|
164
|
+
}, z(e.formEmits), { onSubmit: e.handleSubmit }), {
|
|
154
165
|
default: f(() => [
|
|
155
|
-
|
|
166
|
+
m(d, {
|
|
156
167
|
data: e.data,
|
|
157
|
-
onSetData: o[0] || (o[0] = (
|
|
168
|
+
onSetData: o[0] || (o[0] = (V) => e.$emit("setData", V))
|
|
158
169
|
}, {
|
|
159
170
|
default: f(() => [
|
|
160
|
-
|
|
161
|
-
|
|
171
|
+
m(p, v({ data: e.data }, e.segmentAttrs), null, 16, ["data"]),
|
|
172
|
+
m(i, { source: e.rendererSource }, {
|
|
162
173
|
placeholder: f(() => [
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
m(u),
|
|
175
|
+
m(c)
|
|
165
176
|
]),
|
|
166
177
|
default: f(() => [
|
|
167
|
-
|
|
178
|
+
O(e.$slots, "rendererTemplate")
|
|
168
179
|
]),
|
|
169
180
|
_: 3
|
|
170
181
|
}, 8, ["source"]),
|
|
171
|
-
|
|
182
|
+
O(e.$slots, "default")
|
|
172
183
|
]),
|
|
173
184
|
_: 3
|
|
174
185
|
}, 8, ["data"])
|
|
@@ -176,12 +187,12 @@ function te(e, o, r, y, p, S) {
|
|
|
176
187
|
_: 3
|
|
177
188
|
}, 16, ["class", "model", "onSubmit"]);
|
|
178
189
|
}
|
|
179
|
-
const
|
|
190
|
+
const Pe = /* @__PURE__ */ x(ae, [["render", le]]), we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
180
191
|
__proto__: null
|
|
181
192
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
182
193
|
export {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
194
|
+
Pe as VkfForm,
|
|
195
|
+
_e as _VkfFormCtx,
|
|
196
|
+
we as __VkfForm,
|
|
197
|
+
Pe as default
|
|
187
198
|
};
|
|
@@ -3,6 +3,10 @@ import type { SetDataEvent } from '@vunk/core';
|
|
|
3
3
|
import { ColItem, RowItem } from './types';
|
|
4
4
|
import { AnyFunc } from '@vunk/shared';
|
|
5
5
|
export declare const props: {
|
|
6
|
+
labelPosition: {
|
|
7
|
+
type: PropType<"left" | "right" | "top" | "start" | "end">;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
6
10
|
data: {
|
|
7
11
|
type: PropType<Record<string, any>>;
|
|
8
12
|
default: () => {};
|
|
@@ -57,7 +61,6 @@ export declare const props: {
|
|
|
57
61
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
58
62
|
__epPropKey: true;
|
|
59
63
|
};
|
|
60
|
-
labelPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right" | "top", unknown, "right", boolean>;
|
|
61
64
|
requireAsteriskPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right", unknown, "left", boolean>;
|
|
62
65
|
labelWidth: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
63
66
|
labelSuffix: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -77,7 +80,7 @@ export declare const props: {
|
|
|
77
80
|
};
|
|
78
81
|
disabled: BooleanConstructor;
|
|
79
82
|
};
|
|
80
|
-
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"
|
|
83
|
+
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"rules", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"data", keyof T2> | Extract<"model", keyof T2> | Extract<"requireAsteriskPosition", keyof T2> | Extract<"labelSuffix", keyof T2> | Extract<"statusIcon", keyof T2> | Extract<"validateOnRuleChange", keyof T2> | Extract<"hideRequiredAsterisk", keyof T2> | Extract<"scrollToError", keyof T2> | Extract<"scrollIntoViewOptions", keyof T2> | Extract<"layout", keyof T2> | Extract<"formItems", keyof T2> | Extract<"rowSource", keyof T2> | Extract<"colSource", keyof T2> | Extract<"segmentAttrs", keyof T2>)[]>(propsArg: T2, excludes?: EX | undefined) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size", keyof T2>, KE> | Exclude<Extract<"labelPosition", keyof T2>, KE> | Exclude<Extract<"elRef", keyof T2>, KE> | Exclude<Extract<"inline", keyof T2>, KE> | Exclude<Extract<"readonly", keyof T2>, KE> | Exclude<Extract<"labelWidth", keyof T2>, KE> | Exclude<Extract<"rules", keyof T2>, KE> | Exclude<Extract<"inlineMessage", keyof T2>, KE> | Exclude<Extract<"showMessage", keyof T2>, KE> | Exclude<Extract<"disabled", keyof T2>, KE> | Exclude<Extract<"data", keyof T2>, KE> | Exclude<Extract<"model", keyof T2>, KE> | Exclude<Extract<"requireAsteriskPosition", keyof T2>, KE> | Exclude<Extract<"labelSuffix", keyof T2>, KE> | Exclude<Extract<"statusIcon", keyof T2>, KE> | Exclude<Extract<"validateOnRuleChange", keyof T2>, KE> | Exclude<Extract<"hideRequiredAsterisk", keyof T2>, KE> | Exclude<Extract<"scrollToError", keyof T2>, KE> | Exclude<Extract<"scrollIntoViewOptions", keyof T2>, KE> | Exclude<Extract<"layout", keyof T2>, KE> | Exclude<Extract<"formItems", keyof T2>, KE> | Exclude<Extract<"rowSource", keyof T2>, KE> | Exclude<Extract<"colSource", keyof T2>, KE> | Exclude<Extract<"segmentAttrs", keyof T2>, KE> : Extract<"size", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"rules", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"data", keyof T2> | Extract<"model", keyof T2> | Extract<"requireAsteriskPosition", keyof T2> | Extract<"labelSuffix", keyof T2> | Extract<"statusIcon", keyof T2> | Extract<"validateOnRuleChange", keyof T2> | Extract<"hideRequiredAsterisk", keyof T2> | Extract<"scrollToError", keyof T2> | Extract<"scrollIntoViewOptions", keyof T2> | Extract<"layout", keyof T2> | Extract<"formItems", keyof T2> | Extract<"rowSource", keyof T2> | Extract<"colSource", keyof T2> | Extract<"segmentAttrs", keyof T2>]: { [k in Extract<"size", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"rules", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"data", keyof T2> | Extract<"model", keyof T2> | Extract<"requireAsteriskPosition", keyof T2> | Extract<"labelSuffix", keyof T2> | Extract<"statusIcon", keyof T2> | Extract<"validateOnRuleChange", keyof T2> | Extract<"hideRequiredAsterisk", keyof T2> | Extract<"scrollToError", keyof T2> | Extract<"scrollIntoViewOptions", keyof T2> | Extract<"layout", keyof T2> | Extract<"formItems", keyof T2> | Extract<"rowSource", keyof T2> | Extract<"colSource", keyof T2> | Extract<"segmentAttrs", keyof T2>]: T2[k]; }[P]; }>;
|
|
81
84
|
export declare const emits: {
|
|
82
85
|
setData: (e: SetDataEvent) => SetDataEvent;
|
|
83
86
|
validate: null;
|
|
@@ -2,6 +2,10 @@ import { RowItem } from './types';
|
|
|
2
2
|
declare const _default: typeof __VLS_export;
|
|
3
3
|
export default _default;
|
|
4
4
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
labelPosition: {
|
|
6
|
+
type: import("vue").PropType<"left" | "right" | "top" | "start" | "end">;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
5
9
|
data: {
|
|
6
10
|
type: import("vue").PropType<Record<string, any>>;
|
|
7
11
|
default: () => {};
|
|
@@ -40,7 +44,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
40
44
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
41
45
|
__epPropKey: true;
|
|
42
46
|
};
|
|
43
|
-
labelPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right" | "top", unknown, "right", boolean>;
|
|
44
47
|
requireAsteriskPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right", unknown, "left", boolean>;
|
|
45
48
|
labelWidth: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
46
49
|
labelSuffix: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -61,10 +64,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
61
64
|
disabled: BooleanConstructor;
|
|
62
65
|
}>, {
|
|
63
66
|
formProps: import("vue").ComputedRef<{
|
|
67
|
+
'label-position': "left" | "right" | "top" | undefined;
|
|
64
68
|
size: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", unknown> | undefined;
|
|
65
69
|
inline: boolean;
|
|
66
70
|
labelWidth: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
67
|
-
labelPosition: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "left" | "right" | "top", unknown>;
|
|
68
71
|
rules: Partial<Record<string, Record<string, any> | import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>>> | undefined;
|
|
69
72
|
inlineMessage: boolean;
|
|
70
73
|
showMessage: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
@@ -88,6 +91,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
88
91
|
validate: null;
|
|
89
92
|
submit: null;
|
|
90
93
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
94
|
+
labelPosition: {
|
|
95
|
+
type: import("vue").PropType<"left" | "right" | "top" | "start" | "end">;
|
|
96
|
+
default: string;
|
|
97
|
+
};
|
|
91
98
|
data: {
|
|
92
99
|
type: import("vue").PropType<Record<string, any>>;
|
|
93
100
|
default: () => {};
|
|
@@ -126,7 +133,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
126
133
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
127
134
|
__epPropKey: true;
|
|
128
135
|
};
|
|
129
|
-
labelPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right" | "top", unknown, "right", boolean>;
|
|
130
136
|
requireAsteriskPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right", unknown, "left", boolean>;
|
|
131
137
|
labelWidth: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
132
138
|
labelSuffix: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -150,11 +156,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
150
156
|
onValidate?: ((...args: any[]) => any) | undefined;
|
|
151
157
|
onSetData?: ((e: import("@vunk/core").SetDataEvent) => any) | undefined;
|
|
152
158
|
}>, {
|
|
159
|
+
labelPosition: "left" | "right" | "top" | "start" | "end";
|
|
153
160
|
elRef: import("@vunk/shared").AnyFunc;
|
|
154
161
|
inline: boolean;
|
|
155
162
|
readonly: boolean;
|
|
156
163
|
labelWidth: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
157
|
-
labelPosition: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "left" | "right" | "top", unknown>;
|
|
158
164
|
inlineMessage: boolean;
|
|
159
165
|
showMessage: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
160
166
|
disabled: boolean;
|
|
@@ -444,7 +450,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
444
450
|
}, {}, {
|
|
445
451
|
ElRow: import("element-plus/es/utils/index.mjs").SFCWithInstall<{
|
|
446
452
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("element-plus").RowProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
447
|
-
justify: "
|
|
453
|
+
justify: "start" | "end" | "center" | "space-around" | "space-between" | "space-evenly";
|
|
448
454
|
tag: string;
|
|
449
455
|
gutter: number;
|
|
450
456
|
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
@@ -455,7 +461,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
455
461
|
M: {};
|
|
456
462
|
Defaults: {};
|
|
457
463
|
}, Readonly<import("element-plus").RowProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
458
|
-
justify: "
|
|
464
|
+
justify: "start" | "end" | "center" | "space-around" | "space-between" | "space-evenly";
|
|
459
465
|
tag: string;
|
|
460
466
|
gutter: number;
|
|
461
467
|
}>;
|
|
@@ -463,7 +469,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
463
469
|
__isTeleport?: never;
|
|
464
470
|
__isSuspense?: never;
|
|
465
471
|
} & import("vue").ComponentOptionsBase<Readonly<import("element-plus").RowProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
466
|
-
justify: "
|
|
472
|
+
justify: "start" | "end" | "center" | "space-around" | "space-between" | "space-evenly";
|
|
467
473
|
tag: string;
|
|
468
474
|
gutter: number;
|
|
469
475
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("element-plus"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("element-plus"),h=require("@vunk/core/shared/utils-vue"),e=require("vue"),q=require("@vunk/form/shared/element-plus"),m=require("@vunk/form/composables"),B=require("@vunk/form/composables/element-plus"),v=require("@vunk/core/shared/utils-object"),V=require("@vunk/form/shared/rules"),_=require("../index-DSyxYMB0.js"),I={...a.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(I,"size");const c=I,$=h.bindPropsFactory(c),R=Object.freeze(Object.defineProperty({__proto__:null,createBindProps:$,props:c},Symbol.toStringTag,{value:"Module"})),E={key:0,class:"vkf-form-item-label__span"},O={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},setup(t){return(o,i)=>(e.openBlock(),e.createBlock(e.unref(a.ElFormItem),e.mergeProps(o.$attrs,{ref:t.elRef,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",E,e.toDisplayString(n.label),1)):e.createCommentVNode("",!0),t.labelTip?(e.openBlock(),e.createBlock(e.unref(a.ElTooltip),{key:1,content:t.labelTip},{default:e.withCtx(()=>[e.createVNode(e.unref(a.ElButton),{text:"",class:"vkf-form-item-label-tip-button"},{default:e.withCtx(()=>[e.createVNode(e.unref(a.ElIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(_.warning_default))]),_:1})]),_:1})]),_:1},8,["content"])):e.createCommentVNode("",!0),o.$slots.labelActions?(e.openBlock(),e.createElementBlock("div",O,[e.renderSlot(o.$slots,"labelActions")])):e.createCommentVNode("",!0)])]),error:e.withCtx(n=>[e.renderSlot(o.$slots,"error",e.normalizeProps(e.guardReactiveProps(n)))]),_:3},16,["class","label"]))}}),k=e.defineComponent({name:"VkfFormItem",props:c,setup(t,{slots:o}){const i=q.createFormItemBindProps(t,["rules"]),n=m.useComputedReadonly(t),{tr:s}=B.useLocale(),d=e.ref(),P=e.computed(()=>i.value.labelPosition??t.labelPosition),T=m.useComputedLabelPosition(d,P),b=()=>t.label||s("vkf.formItem.defaultField","该字段"),S=l=>{if(l.message)return;l.required&&(l.message=s("vkf.formItem.required","{label}不能为空",{label:b()}));const r=V.PATTERN_OPTIONS.find(y=>y.value===l.pattern);r&&(l.message=s("vkf.formItem.pattern","输入 {label} {pattern}",{label:b(),pattern:r.title}))},g=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(r=>r.required)&&l.push({required:!0})),l=l.filter(r=>{if(r&&v.isPlainObject(r))return Object.keys(r).filter(C=>!C.startsWith("data-")).length>0}),l.forEach(r=>{S(r)}),l}),{getDataValue:u,emitSetData:f}=m.useRendererData();setTimeout(()=>{t.defaultModelValue!==void 0&&t.prop&&(u==null?void 0:u(t.prop))===void 0&&(f==null||f({k:t.prop,v:t.defaultModelValue}))});const p=l=>{d.value=(l==null?void 0:l.$el)??l,typeof t.elRef=="function"&&t.elRef(l)};return()=>e.h(j,{...i.value,"label-position":T.value,elRef:p,class:{"is-readonly":n.value,"vkf-form-item--inline":t.inline,"is-empty-label":!t.label,"is-information":t.information},size:t.formItemSize,rules:g.value,formItemTip:t.formItemTip,formItemTipClass:t.formItemTipClass,labelTip:t.labelTip,label:t.label},{...o,...t.formItemSlots})}}),N=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfFormItem=k;exports._VkfFormItemCtx=R;exports.__VkfFormItem=N;exports.default=k;
|