@aplus-frontend/ui 7.17.0 → 7.17.1
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/es/src/ap-field/cascader/index.vue.mjs +86 -131
- package/es/src/ap-field/cascader/read.vue2.mjs +36 -35
- package/es/src/ap-field/checkbox/index.vue.d.ts +18 -1
- package/es/src/ap-field/checkbox/index.vue.mjs +42 -43
- package/es/src/ap-field/checkbox/read.vue2.mjs +1 -1
- package/es/src/ap-field/date/index.vue.mjs +48 -48
- package/es/src/ap-field/date/read.vue2.mjs +1 -1
- package/es/src/ap-field/date-range/index.vue.mjs +31 -31
- package/es/src/ap-field/date-range/read.vue2.mjs +1 -1
- package/es/src/ap-field/interface.d.ts +7 -22
- package/es/src/ap-field/number/index.vue.mjs +36 -34
- package/es/src/ap-field/number/read.vue2.mjs +1 -1
- package/es/src/ap-field/radio/index.vue.mjs +34 -42
- package/es/src/ap-field/radio/read.vue2.mjs +1 -1
- package/es/src/ap-field/rate/index.vue.mjs +23 -23
- package/es/src/ap-field/second/index.vue.mjs +27 -29
- package/es/src/ap-field/second/read.vue2.mjs +2 -2
- package/es/src/ap-field/segmented/index.vue.mjs +37 -37
- package/es/src/ap-field/select/index.vue.mjs +90 -92
- package/es/src/ap-field/select/read.vue2.mjs +1 -1
- package/es/src/ap-field/slider/index.vue.mjs +35 -37
- package/es/src/ap-field/switch/index.vue.mjs +38 -38
- package/es/src/ap-field/switch/read.vue2.mjs +3 -3
- package/es/src/ap-field/text/index.vue.d.ts +478 -3
- package/es/src/ap-field/text/index.vue2.mjs +47 -46
- package/es/src/ap-field/text/password.vue.d.ts +549 -3
- package/es/src/ap-field/text/password.vue.mjs +61 -56
- package/es/src/ap-field/text/read-password.vue2.mjs +16 -16
- package/es/src/ap-field/text/read.vue2.mjs +1 -1
- package/es/src/ap-field/text-area/index.vue.mjs +29 -31
- package/es/src/ap-field/text-area/read.vue2.mjs +1 -1
- package/es/src/ap-field/tree-select/index.vue.mjs +47 -47
- package/es/src/ap-field/tree-select/read.vue2.mjs +3 -3
- package/es/src/ap-form/drawer-form/index.vue.mjs +99 -90
- package/es/src/ap-form/hooks/use-regist-form.d.ts +7 -0
- package/es/src/ap-form/hooks/use-regist-form.mjs +24 -0
- package/es/src/ap-form/item/index.vue.d.ts +6 -6
- package/es/src/ap-form/item/index.vue.mjs +85 -94
- package/es/src/ap-form/item-group/index.vue.mjs +14 -14
- package/es/src/ap-form/items/cascader/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/checkbox/index.vue.d.ts +159 -47
- package/es/src/ap-form/items/date/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/date-range/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/switch/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/index.vue.d.ts +476 -4
- package/es/src/ap-form/items/text/password.vue.d.ts +547 -4
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
- package/es/src/ap-form/list/index.vue.mjs +29 -34
- package/es/src/ap-form/modal-form/index.vue.mjs +77 -68
- package/es/src/ap-form/set/index.vue.d.ts +2 -4
- package/es/src/ap-form/set/index.vue.mjs +23 -18
- package/es/src/ap-grid/index.vue.mjs +1 -1
- package/es/src/ap-table/constants.d.ts +593 -31
- package/es/src/ap-table/utils.d.ts +1 -1
- package/es/src/business/batch-input-group/index.vue.d.ts +240 -3
- package/es/src/business/batch-input-group/index.vue.mjs +1 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-field/cascader/index.vue.js +1 -1
- package/lib/src/ap-field/cascader/read.vue2.js +1 -1
- package/lib/src/ap-field/checkbox/index.vue.d.ts +18 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/checkbox/read.vue2.js +1 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date/read.vue2.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/read.vue2.js +1 -1
- package/lib/src/ap-field/interface.d.ts +7 -22
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/number/read.vue2.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/radio/read.vue2.js +1 -1
- package/lib/src/ap-field/rate/index.vue.js +1 -1
- package/lib/src/ap-field/second/index.vue.js +1 -1
- package/lib/src/ap-field/second/read.vue2.js +1 -1
- package/lib/src/ap-field/segmented/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/select/read.vue2.js +1 -1
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/switch/read.vue2.js +1 -1
- package/lib/src/ap-field/text/index.vue.d.ts +478 -3
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.d.ts +549 -3
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text/read-password.vue2.js +1 -1
- package/lib/src/ap-field/text/read.vue2.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/text-area/read.vue2.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/hooks/use-regist-form.d.ts +7 -0
- package/lib/src/ap-form/hooks/use-regist-form.js +1 -0
- package/lib/src/ap-form/item/index.vue.d.ts +6 -6
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/item-group/index.vue.js +1 -1
- package/lib/src/ap-form/items/cascader/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/checkbox/index.vue.d.ts +159 -47
- package/lib/src/ap-form/items/date/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/select/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/switch/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/index.vue.d.ts +476 -4
- package/lib/src/ap-form/items/text/password.vue.d.ts +547 -4
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
- package/lib/src/ap-form/list/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/set/index.vue.d.ts +2 -4
- package/lib/src/ap-form/set/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +593 -31
- package/lib/src/ap-table/utils.d.ts +1 -1
- package/lib/src/business/batch-input-group/index.vue.d.ts +240 -3
- package/lib/src/business/batch-input-group/index.vue.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Button as
|
|
3
|
-
import {
|
|
1
|
+
import { isVNode as A, defineComponent as E, computed as m, useSlots as L, shallowRef as G, ref as h, watch as H, unref as i, cloneVNode as J, createVNode as o, mergeProps as c, createElementBlock as K, openBlock as b, Fragment as Q, createBlock as w, createCommentVNode as B, withCtx as f, renderSlot as R, createTextVNode as X, toDisplayString as Y } from "vue";
|
|
2
|
+
import { Button as F, Flex as Z, Space as ee, Drawer as te } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as ae, isBoolean as le, isUndefined as ie } from "lodash-unified";
|
|
4
|
+
import "../../render/index.mjs";
|
|
4
5
|
import "../../config-provider/index.mjs";
|
|
5
6
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { getNumberPx as
|
|
7
|
+
import { getNumberPx as g, convertReactiveToRaw as ne } from "../../utils/index.mjs";
|
|
7
8
|
import { getSingleVNode as oe } from "../../utils/slot.mjs";
|
|
8
9
|
import "../ap-form.vue.mjs";
|
|
9
10
|
import se from "../style/drawer-form.mjs";
|
|
@@ -11,10 +12,11 @@ import { useControllableValue as re } from "../../hooks/useControllableValue.mjs
|
|
|
11
12
|
import { useLocale as ue } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
13
|
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
14
|
import me from "../ap-form.vue2.mjs";
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
import x from "../../render/render.mjs";
|
|
16
|
+
function O(s) {
|
|
17
|
+
return typeof s == "function" || Object.prototype.toString.call(s) === "[object Object]" && !A(s);
|
|
16
18
|
}
|
|
17
|
-
const
|
|
19
|
+
const Ie = /* @__PURE__ */ E({
|
|
18
20
|
name: "ApFormDrawerForm",
|
|
19
21
|
__name: "index",
|
|
20
22
|
props: {
|
|
@@ -101,24 +103,24 @@ const Se = /* @__PURE__ */ A({
|
|
|
101
103
|
},
|
|
102
104
|
emits: ["update:open"],
|
|
103
105
|
setup(s, {
|
|
104
|
-
expose:
|
|
105
|
-
emit:
|
|
106
|
+
expose: k,
|
|
107
|
+
emit: W
|
|
106
108
|
}) {
|
|
107
|
-
const t = s,
|
|
108
|
-
value:
|
|
109
|
+
const t = s, P = m(() => ae(t, ["drawerProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), p = L(), N = W, l = G(), r = h(), n = h(!1), {
|
|
110
|
+
value: S,
|
|
109
111
|
updateValue: u
|
|
110
|
-
} = re(t,
|
|
112
|
+
} = re(t, N, {
|
|
111
113
|
valuePropName: "open",
|
|
112
114
|
defaultValue: !1
|
|
113
115
|
}), {
|
|
114
|
-
t:
|
|
115
|
-
} = ue(),
|
|
116
|
-
b:
|
|
116
|
+
t: v
|
|
117
|
+
} = ue(), _ = se("ap-form-drawer-form"), {
|
|
118
|
+
b: I
|
|
117
119
|
} = de("ap-form-drawer-form");
|
|
118
|
-
|
|
120
|
+
H(() => l.value, (e) => {
|
|
119
121
|
e && r.value && (e.setFieldsValue?.(r.value), r.value = void 0);
|
|
120
122
|
});
|
|
121
|
-
const d =
|
|
123
|
+
const d = m(() => {
|
|
122
124
|
const e = {
|
|
123
125
|
onResize: () => {
|
|
124
126
|
},
|
|
@@ -126,143 +128,150 @@ const Se = /* @__PURE__ */ A({
|
|
|
126
128
|
maxWidth: window.innerWidth * 0.8,
|
|
127
129
|
resizeOnOpen: !0
|
|
128
130
|
};
|
|
129
|
-
return
|
|
131
|
+
return le(t.resize) ? t.resize ? e : {} : {
|
|
130
132
|
minWidth: t.resize?.minWidth ?? e.minWidth,
|
|
131
133
|
maxWidth: t.resize?.maxWidth ?? e.maxWidth,
|
|
132
134
|
onResize: t.resize?.onResize ?? e.onResize,
|
|
133
|
-
resizeOnOpen:
|
|
135
|
+
resizeOnOpen: ie(t.resize?.resizeOnOpen) ? e.resizeOnOpen : t.resize.resizeOnOpen
|
|
134
136
|
};
|
|
135
137
|
});
|
|
136
|
-
function
|
|
137
|
-
const e =
|
|
138
|
+
function j() {
|
|
139
|
+
const e = i(d)?.minWidth;
|
|
138
140
|
return !e || e && e < t.width ? t.width : e;
|
|
139
141
|
}
|
|
140
|
-
const
|
|
141
|
-
function
|
|
142
|
+
const y = h(g(j()));
|
|
143
|
+
function U(e) {
|
|
142
144
|
const {
|
|
143
|
-
resizeOnOpen:
|
|
144
|
-
onResize:
|
|
145
|
+
resizeOnOpen: a,
|
|
146
|
+
onResize: T
|
|
145
147
|
} = d.value;
|
|
146
|
-
|
|
148
|
+
a && (y.value = e, T?.(e));
|
|
147
149
|
}
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
const z = m(() => {
|
|
151
|
+
const e = oe(p.trigger);
|
|
152
|
+
return e ? J(e, {
|
|
153
|
+
onClick: () => {
|
|
154
|
+
u(!0);
|
|
155
|
+
}
|
|
156
|
+
}) : null;
|
|
157
|
+
}), V = m(() => {
|
|
153
158
|
const e = [];
|
|
154
159
|
if (t.submitter === !1)
|
|
155
160
|
return null;
|
|
156
161
|
if (t.showCancel) {
|
|
157
|
-
let
|
|
158
|
-
e.push(o(
|
|
159
|
-
onClick:
|
|
162
|
+
let a;
|
|
163
|
+
e.push(o(F, {
|
|
164
|
+
onClick: C,
|
|
160
165
|
disabled: n.value
|
|
161
|
-
},
|
|
162
|
-
default: () => [
|
|
166
|
+
}, O(a = v("ap.common.cancelText")) ? a : {
|
|
167
|
+
default: () => [a]
|
|
163
168
|
}));
|
|
164
169
|
}
|
|
165
|
-
return t.submitter?.resetButtonProps !== !1 && e.push(o(
|
|
166
|
-
key: "
|
|
170
|
+
return t.submitter?.resetButtonProps !== !1 && e.push(o(F, c(t.submitter?.resetButtonProps || {}, {
|
|
171
|
+
key: "reset",
|
|
167
172
|
disabled: n.value,
|
|
168
|
-
onClick:
|
|
173
|
+
onClick: M
|
|
169
174
|
}), {
|
|
170
|
-
default: () => [t.submitter?.resetText ||
|
|
171
|
-
})), t.submitter?.submitButtonProps !== !1 && e.push(o(
|
|
175
|
+
default: () => [t.submitter?.resetText || v("ap.common.resetText")]
|
|
176
|
+
})), t.submitter?.submitButtonProps !== !1 && e.push(o(F, c({
|
|
172
177
|
type: "primary",
|
|
173
178
|
key: "submit"
|
|
174
179
|
}, t.submitter?.submitButtonProps || {}, {
|
|
175
180
|
loading: n.value,
|
|
176
181
|
onClick: D
|
|
177
182
|
}), {
|
|
178
|
-
default: () => [t.submitter?.submitText ||
|
|
183
|
+
default: () => [t.submitter?.submitText || v("ap.common.okText")]
|
|
179
184
|
})), o(Z, {
|
|
180
185
|
justify: "flex-end"
|
|
181
186
|
}, {
|
|
182
|
-
default: () => [
|
|
187
|
+
default: () => [p.submitter ? p.submitter(e) : o(ee, null, O(e) ? e : {
|
|
183
188
|
default: () => [e]
|
|
184
189
|
})]
|
|
185
190
|
});
|
|
186
191
|
});
|
|
187
|
-
function
|
|
188
|
-
t.submitter !== !1 && (
|
|
192
|
+
function M() {
|
|
193
|
+
t.submitter !== !1 && (l.value?.resetFields(), t.submitter?.onReset?.());
|
|
189
194
|
}
|
|
190
195
|
async function D() {
|
|
191
196
|
if (t.submitter !== !1)
|
|
192
197
|
try {
|
|
193
|
-
const e = await
|
|
198
|
+
const e = await l.value?.validateFieldsReturnTransformed();
|
|
194
199
|
t.submitter?.onSubmit?.(), n.value = !0;
|
|
195
|
-
const
|
|
196
|
-
if (t.submitTimeout &&
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
clearTimeout(
|
|
200
|
+
const a = t.onFinish?.(ne(e));
|
|
201
|
+
if (t.submitTimeout && a instanceof Promise) {
|
|
202
|
+
const q = setTimeout(() => n.value = !1, t.submitTimeout);
|
|
203
|
+
a.finally(() => {
|
|
204
|
+
clearTimeout(q), n.value = !1;
|
|
200
205
|
});
|
|
201
206
|
}
|
|
202
|
-
await
|
|
207
|
+
await a && u(!1);
|
|
203
208
|
} finally {
|
|
204
209
|
n.value = !1;
|
|
205
210
|
}
|
|
206
211
|
}
|
|
207
|
-
function
|
|
208
|
-
|
|
212
|
+
function C() {
|
|
213
|
+
i(n) || u(!1);
|
|
209
214
|
}
|
|
210
|
-
function
|
|
211
|
-
!e &&
|
|
215
|
+
function $(e) {
|
|
216
|
+
!e && i(n) || u(e);
|
|
212
217
|
}
|
|
213
|
-
return
|
|
218
|
+
return k({
|
|
214
219
|
resetFields: async () => {
|
|
215
|
-
|
|
220
|
+
l.value?.resetFields();
|
|
216
221
|
},
|
|
217
222
|
clearValidate: (e) => {
|
|
218
|
-
|
|
223
|
+
l.value?.clearValidate(e);
|
|
219
224
|
},
|
|
220
|
-
validateFields: (e,
|
|
221
|
-
getFieldsValue: (e) =>
|
|
222
|
-
validate: (e,
|
|
223
|
-
scrollToField: (e,
|
|
224
|
-
|
|
225
|
+
validateFields: (e, a) => l.value?.validateFields(e, a),
|
|
226
|
+
getFieldsValue: (e) => l.value?.getFieldsValue(e),
|
|
227
|
+
validate: (e, a) => l.value?.validate(e, a),
|
|
228
|
+
scrollToField: (e, a = {}) => {
|
|
229
|
+
l.value?.scrollToField(e, a);
|
|
225
230
|
},
|
|
226
|
-
setFieldValue: (e,
|
|
227
|
-
|
|
231
|
+
setFieldValue: (e, a) => {
|
|
232
|
+
l.value?.setFieldValue?.(e, a);
|
|
228
233
|
},
|
|
229
234
|
setFieldsValue: (e) => {
|
|
230
|
-
if (!
|
|
235
|
+
if (!l.value) {
|
|
231
236
|
r.value = e;
|
|
232
237
|
return;
|
|
233
238
|
}
|
|
234
|
-
|
|
239
|
+
l.value?.setFieldsValue?.(e);
|
|
235
240
|
},
|
|
236
|
-
getInternalInstance: (e) =>
|
|
237
|
-
getFieldsValueTransformed: (e) =>
|
|
238
|
-
validateFieldsReturnTransformed: (e) =>
|
|
239
|
-
}), (e,
|
|
240
|
-
open:
|
|
241
|
-
size:
|
|
242
|
-
"max-size":
|
|
243
|
-
"min-size":
|
|
241
|
+
getInternalInstance: (e) => l.value?.getInternalInstance(e),
|
|
242
|
+
getFieldsValueTransformed: (e) => l.value?.getFieldsValueTransformed(e),
|
|
243
|
+
validateFieldsReturnTransformed: (e) => l.value?.validateFieldsReturnTransformed(e)
|
|
244
|
+
}), (e, a) => (b(), K(Q, null, [o(i(te), c(e.drawerProps, {
|
|
245
|
+
open: i(S),
|
|
246
|
+
size: y.value,
|
|
247
|
+
"max-size": i(g)(d.value.maxWidth),
|
|
248
|
+
"min-size": i(g)(d.value.minWidth),
|
|
244
249
|
resizable: {
|
|
245
|
-
onResize:
|
|
250
|
+
onResize: U
|
|
246
251
|
},
|
|
247
|
-
class: [
|
|
248
|
-
"onUpdate:open":
|
|
249
|
-
onCancel:
|
|
252
|
+
class: [i(I)(), i(_)],
|
|
253
|
+
"onUpdate:open": $,
|
|
254
|
+
onCancel: C
|
|
250
255
|
}), {
|
|
251
|
-
title:
|
|
252
|
-
footer:
|
|
253
|
-
|
|
256
|
+
title: f(() => [R(e.$slots, "title", {}, () => [X(Y(t.title), 1)])]),
|
|
257
|
+
footer: f(() => [V.value ? (b(), w(i(x), {
|
|
258
|
+
key: 0,
|
|
259
|
+
node: V.value
|
|
260
|
+
}, null, 8, ["node"])) : B("", !0)]),
|
|
261
|
+
default: f(() => [o(me, c({
|
|
254
262
|
ref_key: "formRef",
|
|
255
|
-
ref:
|
|
256
|
-
},
|
|
257
|
-
default:
|
|
263
|
+
ref: l
|
|
264
|
+
}, P.value), {
|
|
265
|
+
default: f(() => [R(e.$slots, "default")]),
|
|
258
266
|
_: 3
|
|
259
267
|
}, 16)]),
|
|
260
268
|
_: 3
|
|
261
|
-
}, 16, ["open", "size", "max-size", "min-size", "resizable", "class"]),
|
|
262
|
-
key: 0
|
|
263
|
-
|
|
269
|
+
}, 16, ["open", "size", "max-size", "min-size", "resizable", "class"]), z.value ? (b(), w(i(x), {
|
|
270
|
+
key: 0,
|
|
271
|
+
node: z.value
|
|
272
|
+
}, null, 8, ["node"])) : B("", !0)], 64));
|
|
264
273
|
}
|
|
265
274
|
});
|
|
266
275
|
export {
|
|
267
|
-
|
|
276
|
+
Ie as default
|
|
268
277
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isFunction as o, cloneDeep as r } from "lodash-unified";
|
|
2
|
+
import { onMounted as l, onBeforeUnmount as m } from "vue";
|
|
3
|
+
import { isPromise as u } from "../../utils/is.mjs";
|
|
4
|
+
import { useInjectForm as s } from "../context.mjs";
|
|
5
|
+
const V = (e) => {
|
|
6
|
+
let t = !1;
|
|
7
|
+
const { internalInstance: n } = s();
|
|
8
|
+
l(() => {
|
|
9
|
+
a();
|
|
10
|
+
}), m(() => {
|
|
11
|
+
t = !0;
|
|
12
|
+
});
|
|
13
|
+
async function a() {
|
|
14
|
+
let i = o(e.initialValue) ? e.initialValue() : e.initialValue;
|
|
15
|
+
u(i) && (i = await i), !t && n?.registerField({
|
|
16
|
+
name: e.name,
|
|
17
|
+
initialValue: r(i),
|
|
18
|
+
transform: e.transform
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
V as default
|
|
24
|
+
};
|
|
@@ -446,7 +446,7 @@ declare function __VLS_template(): {
|
|
|
446
446
|
default: string | number | ColSize;
|
|
447
447
|
};
|
|
448
448
|
xxl: {
|
|
449
|
-
type: PropType<string | number | ColSize>;
|
|
449
|
+
type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
|
|
450
450
|
default: string | number | ColSize;
|
|
451
451
|
};
|
|
452
452
|
prefixCls: StringConstructor;
|
|
@@ -548,7 +548,7 @@ declare function __VLS_template(): {
|
|
|
548
548
|
default: string | number | ColSize;
|
|
549
549
|
};
|
|
550
550
|
xxl: {
|
|
551
|
-
type: PropType<string | number | ColSize>;
|
|
551
|
+
type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
|
|
552
552
|
default: string | number | ColSize;
|
|
553
553
|
};
|
|
554
554
|
prefixCls: StringConstructor;
|
|
@@ -704,7 +704,7 @@ declare function __VLS_template(): {
|
|
|
704
704
|
default: string | number | ColSize;
|
|
705
705
|
};
|
|
706
706
|
xxl: {
|
|
707
|
-
type: PropType<string | number | ColSize>;
|
|
707
|
+
type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
|
|
708
708
|
default: string | number | ColSize;
|
|
709
709
|
};
|
|
710
710
|
prefixCls: StringConstructor;
|
|
@@ -1241,7 +1241,7 @@ declare const __VLS_component: DefineComponent<ApFormItemProps, {
|
|
|
1241
1241
|
default: string | number | ColSize;
|
|
1242
1242
|
};
|
|
1243
1243
|
xxl: {
|
|
1244
|
-
type: PropType<string | number | ColSize>;
|
|
1244
|
+
type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
|
|
1245
1245
|
default: string | number | ColSize;
|
|
1246
1246
|
};
|
|
1247
1247
|
prefixCls: StringConstructor;
|
|
@@ -1343,7 +1343,7 @@ declare const __VLS_component: DefineComponent<ApFormItemProps, {
|
|
|
1343
1343
|
default: string | number | ColSize;
|
|
1344
1344
|
};
|
|
1345
1345
|
xxl: {
|
|
1346
|
-
type: PropType<string | number | ColSize>;
|
|
1346
|
+
type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
|
|
1347
1347
|
default: string | number | ColSize;
|
|
1348
1348
|
};
|
|
1349
1349
|
prefixCls: StringConstructor;
|
|
@@ -1499,7 +1499,7 @@ declare const __VLS_component: DefineComponent<ApFormItemProps, {
|
|
|
1499
1499
|
default: string | number | ColSize;
|
|
1500
1500
|
};
|
|
1501
1501
|
xxl: {
|
|
1502
|
-
type: PropType<string | number | ColSize>;
|
|
1502
|
+
type: PropType<string | number | ** @type { [typeof __VLS_components.Render, typeof __VLS_components.Render, ] } */).ColSize>;
|
|
1503
1503
|
default: string | number | ColSize;
|
|
1504
1504
|
};
|
|
1505
1505
|
prefixCls: StringConstructor;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as L, useSlots as _, ref as $, shallowRef as j,
|
|
2
|
-
import { QuestionCircleOutlined as
|
|
3
|
-
import { Form as
|
|
4
|
-
import { useToken as
|
|
5
|
-
import {
|
|
1
|
+
import { defineComponent as L, computed as c, useSlots as _, ref as $, shallowRef as j, unref as r, cloneVNode as E, createBlock as O, openBlock as q, mergeProps as D, createSlots as K, withCtx as n, createVNode as u, renderSlot as b, renderList as M, createElementVNode as Q, normalizeClass as U, normalizeStyle as Y, normalizeProps as G, guardReactiveProps as H } from "vue";
|
|
2
|
+
import { QuestionCircleOutlined as J } from "@ant-design/icons-vue";
|
|
3
|
+
import { Form as W, Tooltip as X, TypographyText as Z } from "@aplus-frontend/antdv";
|
|
4
|
+
import { useToken as ee } from "@aplus-frontend/antdv/es/theme/internal";
|
|
5
|
+
import { omit as y, isArray as oe, isFunction as te } from "lodash-unified";
|
|
6
6
|
import "../../render/index.mjs";
|
|
7
|
-
import { isPromise as ae } from "../../utils/is.mjs";
|
|
8
7
|
import "../../config-provider/index.mjs";
|
|
9
|
-
import { getValidVNodeList as
|
|
10
|
-
import { apFormItemColPropKeys as
|
|
11
|
-
import { useInjectForm as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
8
|
+
import { getValidVNodeList as re } from "../../utils/slot.mjs";
|
|
9
|
+
import { apFormItemColPropKeys as le } from "../constant.mjs";
|
|
10
|
+
import { useInjectForm as ae } from "../context.mjs";
|
|
11
|
+
import ne from "../hooks/use-regist-form.mjs";
|
|
12
|
+
import se from "../style/item.mjs";
|
|
13
|
+
import { useNamespace as ie } from "../../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import ue from "../../render/render.mjs";
|
|
15
|
+
const Ce = /* @__PURE__ */ L({
|
|
16
16
|
name: "ApFormItem",
|
|
17
17
|
__name: "index",
|
|
18
18
|
props: {
|
|
@@ -61,120 +61,111 @@ const Ne = /* @__PURE__ */ L({
|
|
|
61
61
|
autoFocus: { type: Boolean, default: void 0 }
|
|
62
62
|
},
|
|
63
63
|
setup(v, { expose: F }) {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
const e = v, h = c(
|
|
65
|
+
() => y(e, [
|
|
66
|
+
...le,
|
|
67
|
+
"tooltip",
|
|
68
|
+
"label",
|
|
69
|
+
"description",
|
|
70
|
+
"autoFocus"
|
|
71
|
+
])
|
|
72
|
+
), g = _(), { model: p, updateModel: B } = ae(), { m: d, b: V } = ie("ap-form-item"), k = se("ap-form-item"), f = $(!1), s = j(), [, C] = ee();
|
|
73
|
+
ne(e);
|
|
74
|
+
const m = c(() => e.name ? oe(e.name) ? e.name.reduce((o, t) => o?.[t], r(p)) : p?.value[e.name] : null);
|
|
75
|
+
function P(o, t) {
|
|
75
76
|
const l = Object.keys(t), a = { ...t };
|
|
76
|
-
return l.forEach((
|
|
77
|
-
|
|
77
|
+
return l.forEach((i) => {
|
|
78
|
+
i in o || delete a[i];
|
|
78
79
|
}), a;
|
|
79
80
|
}
|
|
80
|
-
function N(
|
|
81
|
-
if (!
|
|
82
|
-
return
|
|
83
|
-
const t =
|
|
81
|
+
function N(o) {
|
|
82
|
+
if (!e.name)
|
|
83
|
+
return o[0];
|
|
84
|
+
const t = re(o)[0];
|
|
84
85
|
if (!t)
|
|
85
86
|
return null;
|
|
86
87
|
const l = t?.type?.props ?? {}, a = {
|
|
87
|
-
autofocus:
|
|
88
|
-
variant:
|
|
89
|
-
bordered:
|
|
90
|
-
onFocus:
|
|
91
|
-
onBlur:
|
|
88
|
+
autofocus: e.autoFocus ?? t?.props?.autofocus,
|
|
89
|
+
variant: e.bordered ? "borderless" : t?.props?.variant,
|
|
90
|
+
bordered: e.bordered ? !1 : t?.props?.bordered,
|
|
91
|
+
onFocus: S,
|
|
92
|
+
onBlur: I
|
|
92
93
|
};
|
|
93
|
-
return
|
|
94
|
+
return E(t, {
|
|
94
95
|
...P(l, a),
|
|
95
|
-
[
|
|
96
|
-
[`onUpdate:${
|
|
96
|
+
[e.valuePropName]: r(m),
|
|
97
|
+
[`onUpdate:${e.valuePropName}`]: x
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
|
-
function x(
|
|
100
|
-
|
|
100
|
+
function x(o) {
|
|
101
|
+
B?.(e.name, o);
|
|
101
102
|
}
|
|
102
|
-
function
|
|
103
|
+
function S() {
|
|
103
104
|
f.value = !0;
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
+
function I() {
|
|
106
107
|
f.value = !1;
|
|
107
108
|
}
|
|
109
|
+
function R() {
|
|
110
|
+
s.value?.onFieldBlur();
|
|
111
|
+
}
|
|
108
112
|
function T() {
|
|
109
|
-
|
|
113
|
+
s.value?.onFieldChange();
|
|
110
114
|
}
|
|
111
115
|
function w() {
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
function R() {
|
|
115
|
-
i.value?.clearValidate();
|
|
116
|
+
s.value?.clearValidate();
|
|
116
117
|
}
|
|
117
118
|
function z() {
|
|
118
|
-
|
|
119
|
+
s.value?.resetField();
|
|
119
120
|
}
|
|
120
|
-
function A(
|
|
121
|
+
function A(o = !1) {
|
|
121
122
|
const t = r(m);
|
|
122
|
-
if (!
|
|
123
|
+
if (!o || !e.transform)
|
|
123
124
|
return t;
|
|
124
|
-
const l =
|
|
125
|
-
return
|
|
125
|
+
const l = te(e.transform) ? e.transform : e.transform.transformer;
|
|
126
|
+
return e.transform ? l(t) : t;
|
|
126
127
|
}
|
|
127
128
|
return F({
|
|
128
|
-
onFieldBlur:
|
|
129
|
-
onFieldChange:
|
|
130
|
-
clearValidate:
|
|
129
|
+
onFieldBlur: R,
|
|
130
|
+
onFieldChange: T,
|
|
131
|
+
clearValidate: w,
|
|
131
132
|
resetField: z,
|
|
132
133
|
getFieldValue: A
|
|
133
|
-
}), (
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
}), (o, t) => (q(), O(r(W).Item, D({
|
|
135
|
+
ref_key: "formItemRef",
|
|
136
|
+
ref: s
|
|
137
|
+
}, h.value, {
|
|
138
|
+
class: {
|
|
139
|
+
[r(d)("bordered")]: o.bordered,
|
|
140
|
+
[r(d)("focused")]: o.bordered && f.value,
|
|
141
|
+
[r(d)("disabled")]: o.bordered && o.disabled,
|
|
142
|
+
[r(V)()]: !0,
|
|
143
|
+
[r(k)]: !0
|
|
137
144
|
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
"tooltip",
|
|
141
|
-
"label",
|
|
142
|
-
"description",
|
|
143
|
-
"autoFocus"
|
|
144
|
-
]),
|
|
145
|
-
{
|
|
146
|
-
class: {
|
|
147
|
-
[r(d)("bordered")]: e.bordered,
|
|
148
|
-
[r(d)("focused")]: e.bordered && f.value,
|
|
149
|
-
[r(d)("disabled")]: e.bordered && e.disabled,
|
|
150
|
-
[r(B)()]: !0,
|
|
151
|
-
[r(k)]: !0
|
|
152
|
-
},
|
|
153
|
-
colon: e.bordered ? !1 : o.colon
|
|
154
|
-
}
|
|
155
|
-
), Q({
|
|
145
|
+
colon: o.bordered ? !1 : e.colon
|
|
146
|
+
}), K({
|
|
156
147
|
default: n(() => [
|
|
157
|
-
u(r(
|
|
148
|
+
u(r(ue), { renderer: N }, {
|
|
158
149
|
default: n(() => [
|
|
159
|
-
|
|
150
|
+
b(o.$slots, "default")
|
|
160
151
|
]),
|
|
161
152
|
_: 3
|
|
162
153
|
})
|
|
163
154
|
]),
|
|
164
155
|
_: 2
|
|
165
156
|
}, [
|
|
166
|
-
|
|
157
|
+
e.tooltip ? {
|
|
167
158
|
name: "tooltip",
|
|
168
159
|
fn: n(({ class: l }) => [
|
|
169
|
-
|
|
170
|
-
class:
|
|
160
|
+
Q("span", {
|
|
161
|
+
class: U(l)
|
|
171
162
|
}, [
|
|
172
|
-
u(r(
|
|
173
|
-
title:
|
|
163
|
+
u(r(X), {
|
|
164
|
+
title: e.tooltip
|
|
174
165
|
}, {
|
|
175
166
|
default: n(() => [
|
|
176
|
-
u(r(
|
|
177
|
-
style:
|
|
167
|
+
u(r(J), {
|
|
168
|
+
style: Y({
|
|
178
169
|
color: r(C).colorTextTertiary,
|
|
179
170
|
fontSize: "14px",
|
|
180
171
|
transform: "translateY(1px)"
|
|
@@ -187,26 +178,26 @@ const Ne = /* @__PURE__ */ L({
|
|
|
187
178
|
]),
|
|
188
179
|
key: "0"
|
|
189
180
|
} : void 0,
|
|
190
|
-
|
|
181
|
+
o.label ? {
|
|
191
182
|
name: "label",
|
|
192
183
|
fn: n(() => [
|
|
193
|
-
u(r(
|
|
194
|
-
content:
|
|
195
|
-
ellipsis: { tooltip:
|
|
184
|
+
u(r(Z), {
|
|
185
|
+
content: o.label,
|
|
186
|
+
ellipsis: { tooltip: o.label },
|
|
196
187
|
style: { "min-width": "0px", flex: "1" }
|
|
197
188
|
}, null, 8, ["content", "ellipsis"])
|
|
198
189
|
]),
|
|
199
190
|
key: "1"
|
|
200
191
|
} : void 0,
|
|
201
|
-
|
|
192
|
+
M(r(y)(g, "default"), (l, a) => ({
|
|
202
193
|
name: a,
|
|
203
|
-
fn: n((
|
|
204
|
-
|
|
194
|
+
fn: n((i) => [
|
|
195
|
+
b(o.$slots, a, G(H(i || {})))
|
|
205
196
|
])
|
|
206
197
|
}))
|
|
207
198
|
]), 1040, ["class", "colon"]));
|
|
208
199
|
}
|
|
209
200
|
});
|
|
210
201
|
export {
|
|
211
|
-
|
|
202
|
+
Ce as default
|
|
212
203
|
};
|