@aplus-frontend/ui 0.6.0-beta.0 → 0.6.0-beta.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-form/ap-form.vue2.mjs +57 -58
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-form/item/index.vue.mjs +33 -28
- package/es/src/ap-form/items/checkbox/index.vue.mjs +1 -0
- package/es/src/ap-form/items/date/index.vue.mjs +8 -7
- package/es/src/ap-form/items/date-range/index.vue.mjs +1 -0
- package/es/src/ap-form/items/number/index.vue.mjs +9 -8
- package/es/src/ap-form/items/radio/index.vue.mjs +1 -0
- package/es/src/ap-form/items/select/index.vue.mjs +7 -6
- package/es/src/ap-form/items/switch/index.vue.mjs +1 -0
- package/es/src/ap-form/items/text/index.vue2.mjs +8 -7
- package/es/src/ap-form/items/text/password.vue.mjs +1 -0
- package/es/src/ap-form/items/text-area/index.vue.mjs +1 -0
- package/es/src/ap-form/items/tree-select/index.vue.mjs +6 -5
- package/es/src/ap-form/render/item.vue.mjs +5 -4
- package/es/src/ap-form/search-form/components/popover-filter.vue2.mjs +10 -10
- package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.mjs +8 -8
- package/es/src/ap-form/search-form/index.vue.mjs +35 -34
- package/es/src/ap-grid/editable/form-item.vue.mjs +1 -1
- package/es/src/ap-grid/editable/index.vue.mjs +1 -1
- package/es/src/ap-grid/index.vue.mjs +24 -23
- package/es/src/ap-grid/interface.d.ts +1 -1
- package/es/src/business/ap-view/ap-view.vue2.mjs +91 -88
- package/es/src/business/ap-view/components/main-button-content.vue2.mjs +25 -23
- package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +38 -38
- package/es/src/business/batch-input-group/form-item.vue.mjs +1 -0
- package/es/src/check-card/index.vue2.mjs +1 -1
- package/es/src/design-token/index.mjs +9 -3
- package/es/src/editable-table/form-item.vue.mjs +1 -1
- package/es/src/editable-table/index.vue.mjs +27 -27
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/switch/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/render/item.vue.js +1 -1
- package/lib/src/ap-form/search-form/components/popover-filter.vue2.js +1 -1
- package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +1 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
- package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/check-card/index.vue2.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/package.json +1 -1
- package/theme/ap-action/item-dropdown.css +5 -5
- package/theme/ap-action/item-dropdown.less +1 -1
- package/theme/ap-action/item.css +5 -5
- package/theme/ap-action/item.less +1 -1
- package/theme/ap-appendix/ap-appendix.css +3 -3
- package/theme/ap-attachment/ap-attachment.css +3 -3
- package/theme/ap-batch-action/ap-batch-action.css +3 -3
- package/theme/ap-button/ap-button.css +3 -3
- package/theme/ap-card/ap-card.css +3 -3
- package/theme/ap-descriptions/ap-descriptions.css +3 -3
- package/theme/ap-download/ap-download.css +3 -3
- package/theme/ap-expand-alert/ap-expand-alert.css +3 -3
- package/theme/ap-field/checkbox.css +4 -4
- package/theme/ap-field/checkbox.less +2 -1
- package/theme/ap-field/index.css +5 -5
- package/theme/ap-field/number.css +3 -3
- package/theme/ap-field/radio.css +4 -4
- package/theme/ap-field/radio.less +1 -1
- package/theme/ap-field/text-area.css +3 -3
- package/theme/ap-form/ap-form-item-group.css +3 -3
- package/theme/ap-form/ap-form-item.css +10 -8
- package/theme/ap-form/ap-form-item.less +8 -6
- package/theme/ap-form/drawer-form.css +3 -3
- package/theme/ap-form/index.css +21 -19
- package/theme/ap-form/item-text-group.css +3 -3
- package/theme/ap-form/item-text.css +3 -3
- package/theme/ap-form/modal-form.css +3 -3
- package/theme/ap-form/search-form-sorter.css +12 -12
- package/theme/ap-form/search-form-sorter.less +7 -7
- package/theme/ap-form/search-form.css +21 -19
- package/theme/ap-form/search-form.less +5 -5
- package/theme/ap-grid/editable.css +5 -5
- package/theme/ap-grid/editable.less +2 -2
- package/theme/ap-grid/index.css +44 -33
- package/theme/ap-grid/index.less +17 -8
- package/theme/ap-group-search/ap-extension-select.css +3 -3
- package/theme/ap-group-search/ap-group-search.css +3 -3
- package/theme/ap-group-search/ap-popover-select.css +3 -3
- package/theme/ap-image/ap-image.css +3 -3
- package/theme/ap-input-radio/ap-input-radio.css +3 -3
- package/theme/ap-label/ap-label.css +3 -3
- package/theme/ap-ladder/ap-ladder.css +3 -3
- package/theme/ap-layout/ap-info-layout.css +3 -3
- package/theme/ap-list/index.css +4 -4
- package/theme/ap-list/index.less +2 -1
- package/theme/ap-product-info/ap-product-info.css +3 -3
- package/theme/ap-select-layout/ap-select-layout.css +3 -3
- package/theme/ap-size-input/ap-size-input.css +3 -3
- package/theme/ap-status/ap-status.css +3 -3
- package/theme/ap-summary/index.css +3 -3
- package/theme/ap-table/ap-table-index.css +3 -3
- package/theme/ap-table/ap-table-paragraph-ellipsis.css +3 -3
- package/theme/ap-table/ap-table.css +43 -37
- package/theme/ap-table/ap-table.less +12 -8
- package/theme/ap-table/setting/index.css +7 -7
- package/theme/ap-table/setting/modal.css +5 -5
- package/theme/ap-table/setting/select-group.css +3 -3
- package/theme/ap-table/setting/sortable-item-meta.css +3 -3
- package/theme/ap-table/setting/sortable-item.css +3 -3
- package/theme/ap-table/setting/sorter.css +5 -5
- package/theme/ap-table-modal/index.css +43 -37
- package/theme/ap-tag/ap-tag-group.css +3 -3
- package/theme/ap-tag/ap-tag.css +3 -3
- package/theme/ap-title/ap-title.css +3 -3
- package/theme/ap-upload/index.css +3 -3
- package/theme/ap-upload/multiple-file.css +3 -3
- package/theme/ap-upload/picture.css +3 -3
- package/theme/ap-upload/single-file.css +3 -3
- package/theme/ap-upload/upload.css +3 -3
- package/theme/ap-upload-single/index.css +3 -3
- package/theme/ap-view/ap-view.css +3 -3
- package/theme/batch-input-group/index.css +5 -5
- package/theme/batch-input-group/popover-input.css +3 -3
- package/theme/check-card/index.css +22 -22
- package/theme/check-card/index.less +17 -15
- package/theme/editable-table/index.css +36 -32
- package/theme/editable-table/index.less +9 -7
- package/theme/full-screen/index.css +3 -3
- package/theme/index.css +98 -81
- package/theme/mask/index.css +3 -3
- package/theme/mixins/config.less +26 -4
- package/theme/mixins/mixins.css +3 -3
- package/theme/scroll-bar/index.css +3 -3
- package/theme/scroll-view/index.css +3 -3
- package/theme/splitter/index.css +8 -8
- package/theme/text/group.css +3 -3
- package/theme/text/index.css +5 -5
- package/theme/work-order-modal/index.css +3 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as Q, reactive as X, ref as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useProvideForm as
|
|
4
|
-
import { isArray as f, cloneDeep as ae, isFunction as
|
|
1
|
+
import { defineComponent as Q, reactive as X, ref as E, unref as p, nextTick as Y, toRaw as _, watch as Z, onWatcherCleanup as z, computed as ee, createBlock as te, openBlock as re, mergeProps as le, withCtx as oe, renderSlot as se } from "vue";
|
|
2
|
+
import { Form as ne } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useProvideForm as ie } from "./context.mjs";
|
|
4
|
+
import { isArray as f, cloneDeep as ae, isFunction as B, isPlainObject as M, omit as ue } from "lodash-unified";
|
|
5
5
|
import { useUrlSearchParams as ce } from "@vueuse/core";
|
|
6
6
|
import { INTERNAL_FORM_INSTANCE_MARK as fe } from "./constant.mjs";
|
|
7
7
|
import { getRouteType as de, isDef as V } from "../utils/index.mjs";
|
|
8
8
|
import ge from "./utils/set.mjs";
|
|
9
|
-
import { genParams as
|
|
10
|
-
import { useInjectFormProvider as
|
|
9
|
+
import { genParams as b, setToParams as A } from "./utils/params.mjs";
|
|
10
|
+
import { useInjectFormProvider as he } from "./provider/context.mjs";
|
|
11
11
|
const Re = /* @__PURE__ */ Q({
|
|
12
12
|
__name: "ap-form",
|
|
13
13
|
props: {
|
|
@@ -38,11 +38,11 @@ const Re = /* @__PURE__ */ Q({
|
|
|
38
38
|
syncToUrl: { type: [Boolean, Function], default: !1 },
|
|
39
39
|
syncToUrlPriority: { type: Boolean }
|
|
40
40
|
},
|
|
41
|
-
setup(
|
|
42
|
-
function
|
|
41
|
+
setup(C, { expose: N }) {
|
|
42
|
+
function S(e, t) {
|
|
43
43
|
return f(t) ? t.reduce((r, o) => r == null ? void 0 : r[o], e) : e == null ? void 0 : e[t];
|
|
44
44
|
}
|
|
45
|
-
const l =
|
|
45
|
+
const l = C;
|
|
46
46
|
function v(e, t, r = !0, o) {
|
|
47
47
|
var s;
|
|
48
48
|
if (f(e)) {
|
|
@@ -59,13 +59,13 @@ const Re = /* @__PURE__ */ Q({
|
|
|
59
59
|
}
|
|
60
60
|
T();
|
|
61
61
|
}
|
|
62
|
-
const u =
|
|
63
|
-
l.syncToUrl ?
|
|
62
|
+
const u = E(), I = ce(de()), y = he(), P = E(
|
|
63
|
+
l.syncToUrl ? b(l.syncToUrl, I, "get") : {}
|
|
64
64
|
);
|
|
65
|
-
let m = ae(
|
|
66
|
-
const n = X(
|
|
67
|
-
let
|
|
68
|
-
function
|
|
65
|
+
let m = ae(w()), g = {};
|
|
66
|
+
const n = X(w());
|
|
67
|
+
let h = [];
|
|
68
|
+
function w() {
|
|
69
69
|
const e = l.initialValues || {};
|
|
70
70
|
return l.syncToUrlPriority ? {
|
|
71
71
|
...e,
|
|
@@ -75,43 +75,42 @@ const Re = /* @__PURE__ */ Q({
|
|
|
75
75
|
...e
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function W(e) {
|
|
79
79
|
var r;
|
|
80
|
-
const t =
|
|
81
|
-
y.triggerFormFinish(l.name, e), l.syncToUrl &&
|
|
80
|
+
const t = F(e, g);
|
|
81
|
+
y.triggerFormFinish(l.name, e), l.syncToUrl && A(I, b(l.syncToUrl, t, "set")), (r = l.onFinish) == null || r.call(l, t);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const q = async () => {
|
|
84
84
|
var e;
|
|
85
85
|
(e = u.value) == null || e.resetFields(), await Y(() => {
|
|
86
|
-
Object.keys(n).forEach((t) => delete n[t]), Object.assign(n, m), T(), l.syncToUrl &&
|
|
86
|
+
Object.keys(n).forEach((t) => delete n[t]), Object.assign(n, m), T(), l.syncToUrl && A(
|
|
87
87
|
I,
|
|
88
|
-
|
|
88
|
+
b(
|
|
89
89
|
l.syncToUrl,
|
|
90
|
-
|
|
90
|
+
F(m, g),
|
|
91
91
|
"set"
|
|
92
92
|
)
|
|
93
93
|
);
|
|
94
94
|
});
|
|
95
|
-
},
|
|
95
|
+
}, D = (e) => {
|
|
96
96
|
var t;
|
|
97
97
|
(t = u.value) == null || t.clearValidate(e);
|
|
98
|
-
},
|
|
98
|
+
}, k = (e, t) => {
|
|
99
99
|
var r;
|
|
100
100
|
return (r = u.value) == null ? void 0 : r.validateFields(e, t);
|
|
101
|
-
},
|
|
101
|
+
}, K = async (e, t) => {
|
|
102
102
|
var o;
|
|
103
103
|
const r = await ((o = u.value) == null ? void 0 : o.validateFields(
|
|
104
104
|
e,
|
|
105
105
|
t
|
|
106
106
|
));
|
|
107
|
-
return
|
|
108
|
-
},
|
|
107
|
+
return F(r, g);
|
|
108
|
+
}, O = (e) => {
|
|
109
109
|
var t;
|
|
110
|
-
return (t = u.value) == null ? void 0 : t.getFieldsValue(e);
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return h(t, g);
|
|
110
|
+
return e === !0 ? _(n) : (t = u.value) == null ? void 0 : t.getFieldsValue(e);
|
|
111
|
+
}, L = (e) => {
|
|
112
|
+
const t = O(e);
|
|
113
|
+
return F(t, g);
|
|
115
114
|
}, $ = (e, t) => {
|
|
116
115
|
var r;
|
|
117
116
|
return (r = u.value) == null ? void 0 : r.validate(e, t);
|
|
@@ -124,13 +123,13 @@ const Re = /* @__PURE__ */ Q({
|
|
|
124
123
|
v(e, t, r, o), T();
|
|
125
124
|
};
|
|
126
125
|
function R(e, t) {
|
|
127
|
-
return t || e(
|
|
128
|
-
|
|
126
|
+
return t || e(_(n)), h.push(e), () => {
|
|
127
|
+
h = h.filter((r) => r !== e);
|
|
129
128
|
};
|
|
130
129
|
}
|
|
131
|
-
function
|
|
130
|
+
function j({ initialValue: e, name: t, transform: r }) {
|
|
132
131
|
if (V(e) && V(t)) {
|
|
133
|
-
const o =
|
|
132
|
+
const o = S(p(P), t);
|
|
134
133
|
if (!V(o) || !l.syncToUrlPriority)
|
|
135
134
|
if (v(t, e, !1), f(t)) {
|
|
136
135
|
let i = m;
|
|
@@ -153,33 +152,33 @@ const Re = /* @__PURE__ */ Q({
|
|
|
153
152
|
return;
|
|
154
153
|
}
|
|
155
154
|
return {
|
|
156
|
-
registerField:
|
|
155
|
+
registerField: j,
|
|
157
156
|
registerWatch: R,
|
|
158
157
|
setFieldValue: U
|
|
159
158
|
};
|
|
160
159
|
}
|
|
161
160
|
function T() {
|
|
162
|
-
if (
|
|
163
|
-
const e =
|
|
164
|
-
|
|
161
|
+
if (h.length) {
|
|
162
|
+
const e = _(n);
|
|
163
|
+
h.forEach((t) => {
|
|
165
164
|
t(e);
|
|
166
165
|
});
|
|
167
166
|
}
|
|
168
167
|
}
|
|
169
|
-
function
|
|
168
|
+
function F(e, t) {
|
|
170
169
|
if (e == null)
|
|
171
170
|
return;
|
|
172
171
|
let r = f(e) ? [] : {};
|
|
173
172
|
return Object.keys(e).forEach((o) => {
|
|
174
|
-
const i = e[o], s = t == null ? void 0 : t[o], a =
|
|
175
|
-
if (
|
|
173
|
+
const i = e[o], s = t == null ? void 0 : t[o], a = B(s) ? s : s == null ? void 0 : s.transformer, d = B(s) ? !0 : s == null ? void 0 : s.flat;
|
|
174
|
+
if (B(a)) {
|
|
176
175
|
const c = a(i);
|
|
177
|
-
d ? f(c) && f(r) ? r = [...r, ...c] :
|
|
176
|
+
d ? f(c) && f(r) ? r = [...r, ...c] : M(c) && M(r) ? r = {
|
|
178
177
|
...r,
|
|
179
178
|
...c
|
|
180
179
|
} : r[o] = c : r[o] = c;
|
|
181
|
-
} else if (
|
|
182
|
-
const c =
|
|
180
|
+
} else if (M(i) || f(i)) {
|
|
181
|
+
const c = F(
|
|
183
182
|
i,
|
|
184
183
|
s
|
|
185
184
|
);
|
|
@@ -188,44 +187,44 @@ const Re = /* @__PURE__ */ Q({
|
|
|
188
187
|
r[o] = i;
|
|
189
188
|
}), r;
|
|
190
189
|
}
|
|
191
|
-
const
|
|
192
|
-
resetFields:
|
|
193
|
-
clearValidate:
|
|
194
|
-
validateFields:
|
|
195
|
-
getFieldsValue:
|
|
190
|
+
const x = {
|
|
191
|
+
resetFields: q,
|
|
192
|
+
clearValidate: D,
|
|
193
|
+
validateFields: k,
|
|
194
|
+
getFieldsValue: O,
|
|
196
195
|
validate: $,
|
|
197
196
|
scrollToField: G,
|
|
198
197
|
setFieldsValue: H,
|
|
199
198
|
setFieldValue: U,
|
|
200
199
|
registerWatch: R,
|
|
201
|
-
validateFieldsReturnTransformed:
|
|
202
|
-
getFieldsValueTransformed:
|
|
200
|
+
validateFieldsReturnTransformed: K,
|
|
201
|
+
getFieldsValueTransformed: L,
|
|
203
202
|
getInternalInstance: J
|
|
204
203
|
};
|
|
205
204
|
return Z(
|
|
206
205
|
() => l.name,
|
|
207
206
|
(e) => {
|
|
208
|
-
e && (y.registerForm(e,
|
|
207
|
+
e && (y.registerForm(e, x), z(() => {
|
|
209
208
|
y.unregisterForm(l.name);
|
|
210
209
|
}));
|
|
211
210
|
},
|
|
212
211
|
{
|
|
213
212
|
immediate: !0
|
|
214
213
|
}
|
|
215
|
-
),
|
|
214
|
+
), ie({
|
|
216
215
|
model: ee(() => n),
|
|
217
216
|
updateModel: v,
|
|
218
217
|
internalInstance: {
|
|
219
218
|
registerWatch: R,
|
|
220
|
-
registerField:
|
|
219
|
+
registerField: j,
|
|
221
220
|
setFieldValue: U
|
|
222
221
|
}
|
|
223
|
-
}),
|
|
222
|
+
}), N(x), (e, t) => (re(), te(p(ne), le({
|
|
224
223
|
ref_key: "formRef",
|
|
225
224
|
ref: u
|
|
226
225
|
}, p(ue)(l, ["initialValues", "onValuesChange", "onFinish"]), {
|
|
227
226
|
model: n,
|
|
228
|
-
onFinish:
|
|
227
|
+
onFinish: W
|
|
229
228
|
}), {
|
|
230
229
|
default: oe(() => [
|
|
231
230
|
se(e.$slots, "default")
|
|
@@ -34,6 +34,10 @@ export type ApFormItemProps = FormItemProps & Partial<ApFormColProps> & {
|
|
|
34
34
|
*/
|
|
35
35
|
transform?: ApFormItemTransformType;
|
|
36
36
|
tooltip?: any;
|
|
37
|
+
/**
|
|
38
|
+
* 此表单项的描述,设置此信息后,在查询表单排序时将优先使用此属性值
|
|
39
|
+
*/
|
|
40
|
+
description?: string;
|
|
37
41
|
};
|
|
38
42
|
export type ApFormItemGroupProps = RowProps & {
|
|
39
43
|
countPerRow?: number;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as D, useSlots as $, ref as
|
|
1
|
+
import { defineComponent as D, useSlots as $, ref as f, onMounted as j, computed as F, unref as l, watch as q, cloneVNode as E, createBlock as g, openBlock as h, mergeProps as K, createSlots as O, withCtx as i, createCommentVNode as Q, resolveDynamicComponent as U, renderList as G, createElementVNode as H, normalizeClass as J, createVNode as p, normalizeStyle as M, renderSlot as W, normalizeProps as X, guardReactiveProps as Y } from "vue";
|
|
2
2
|
import { Form as Z, Tooltip as ee, TypographyText as oe } from "@aplus-frontend/antdv";
|
|
3
3
|
import { useToken as le } from "@aplus-frontend/antdv/es/theme/internal";
|
|
4
|
-
import { isFunction as B, cloneDeep as te, isArray as
|
|
5
|
-
import { apFormItemColPropKeys as
|
|
4
|
+
import { isFunction as B, cloneDeep as te, isArray as re, omit as C } from "lodash-unified";
|
|
5
|
+
import { apFormItemColPropKeys as ae } from "../constant.mjs";
|
|
6
6
|
import { QuestionCircleOutlined as ne } from "@ant-design/icons-vue";
|
|
7
7
|
import "../../config-provider/index.mjs";
|
|
8
8
|
import { useInjectForm as ie } from "../context.mjs";
|
|
9
9
|
import { isPromise as se } from "@fruits-chain/utils";
|
|
10
10
|
import { getSingleVNode as ue, getValidVNodeList as me } from "../../utils/slot.mjs";
|
|
11
|
-
import { useNamespace as
|
|
11
|
+
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
12
12
|
const Ce = /* @__PURE__ */ D({
|
|
13
13
|
name: "ApFormItem",
|
|
14
14
|
__name: "index",
|
|
@@ -51,10 +51,11 @@ const Ce = /* @__PURE__ */ D({
|
|
|
51
51
|
valuePropName: { default: "value" },
|
|
52
52
|
initialValue: {},
|
|
53
53
|
_signal: {},
|
|
54
|
-
transform: {}
|
|
54
|
+
transform: {},
|
|
55
|
+
description: {}
|
|
55
56
|
},
|
|
56
57
|
setup(N, { expose: k }) {
|
|
57
|
-
const o = N,
|
|
58
|
+
const o = N, a = $(), { model: s, updateModel: u, internalInstance: m } = ie(), { m: c, b: P } = de("ap-form-item"), d = f(!1), n = f(), [, x] = le();
|
|
58
59
|
j(async () => {
|
|
59
60
|
let e = B(o.initialValue) ? o.initialValue() : o.initialValue;
|
|
60
61
|
se(e) && (e = await e), m == null || m.registerField({
|
|
@@ -63,11 +64,11 @@ const Ce = /* @__PURE__ */ D({
|
|
|
63
64
|
transform: o.transform
|
|
64
65
|
});
|
|
65
66
|
});
|
|
66
|
-
const y = F(() => o.name ?
|
|
67
|
+
const y = F(() => o.name ? re(o.name) ? o.name.reduce((e, t) => e == null ? void 0 : e[t], l(s)) : s == null ? void 0 : s.value[o.name] : null), v = f(ue(a.default));
|
|
67
68
|
q(
|
|
68
69
|
() => {
|
|
69
70
|
var e;
|
|
70
|
-
return (e =
|
|
71
|
+
return (e = a.default) == null ? void 0 : e.call(a);
|
|
71
72
|
},
|
|
72
73
|
(e) => {
|
|
73
74
|
v.value = me(e)[0];
|
|
@@ -77,20 +78,20 @@ const Ce = /* @__PURE__ */ D({
|
|
|
77
78
|
u == null || u(o.name, e);
|
|
78
79
|
}
|
|
79
80
|
function S() {
|
|
80
|
-
|
|
81
|
+
d.value = !0;
|
|
81
82
|
}
|
|
82
83
|
function I() {
|
|
83
|
-
|
|
84
|
+
d.value = !1;
|
|
84
85
|
}
|
|
85
86
|
const V = F(() => {
|
|
86
|
-
var t,
|
|
87
|
+
var t, r;
|
|
87
88
|
if (!o.name)
|
|
88
|
-
return (t =
|
|
89
|
+
return (t = a.default()) == null ? void 0 : t[0];
|
|
89
90
|
const e = l(v);
|
|
90
91
|
return e ? E(e, {
|
|
91
92
|
[o.valuePropName]: l(y),
|
|
92
93
|
[`onUpdate:${o.valuePropName}`]: w,
|
|
93
|
-
bordered: o.bordered ? !1 : (
|
|
94
|
+
bordered: o.bordered ? !1 : (r = e == null ? void 0 : e.props) == null ? void 0 : r.bordered,
|
|
94
95
|
onFocus: S,
|
|
95
96
|
onBlur: I
|
|
96
97
|
}) : null;
|
|
@@ -115,8 +116,8 @@ const Ce = /* @__PURE__ */ D({
|
|
|
115
116
|
const t = l(y);
|
|
116
117
|
if (!e || !o.transform)
|
|
117
118
|
return t;
|
|
118
|
-
const
|
|
119
|
-
return o.transform ?
|
|
119
|
+
const r = B(o.transform) ? o.transform : o.transform.transformer;
|
|
120
|
+
return o.transform ? r(t) : t;
|
|
120
121
|
}
|
|
121
122
|
return k({
|
|
122
123
|
onFieldBlur: T,
|
|
@@ -124,17 +125,21 @@ const Ce = /* @__PURE__ */ D({
|
|
|
124
125
|
clearValidate: A,
|
|
125
126
|
resetField: L,
|
|
126
127
|
getFieldValue: R
|
|
127
|
-
}), (e, t) => (h(), g(l(Z).Item, K(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
class: {
|
|
132
|
-
[l(c)("bordered")]: e.bordered,
|
|
133
|
-
[l(c)("focused")]: e.bordered && f.value,
|
|
134
|
-
[l(P)()]: !0
|
|
128
|
+
}), (e, t) => (h(), g(l(Z).Item, K(
|
|
129
|
+
{
|
|
130
|
+
ref_key: "formItemRef",
|
|
131
|
+
ref: n
|
|
135
132
|
},
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
l(C)(o, [...l(ae), "tooltip", "label", "description"]),
|
|
134
|
+
{
|
|
135
|
+
class: {
|
|
136
|
+
[l(c)("bordered")]: e.bordered,
|
|
137
|
+
[l(c)("focused")]: e.bordered && d.value,
|
|
138
|
+
[l(P)()]: !0
|
|
139
|
+
},
|
|
140
|
+
colon: e.bordered ? !1 : o.colon
|
|
141
|
+
}
|
|
142
|
+
), O({
|
|
138
143
|
default: i(() => [
|
|
139
144
|
V.value ? (h(), g(U(V.value), { key: 0 })) : Q("", !0)
|
|
140
145
|
]),
|
|
@@ -142,9 +147,9 @@ const Ce = /* @__PURE__ */ D({
|
|
|
142
147
|
}, [
|
|
143
148
|
o.tooltip ? {
|
|
144
149
|
name: "tooltip",
|
|
145
|
-
fn: i(({ class:
|
|
150
|
+
fn: i(({ class: r }) => [
|
|
146
151
|
H("span", {
|
|
147
|
-
class: J(
|
|
152
|
+
class: J(r)
|
|
148
153
|
}, [
|
|
149
154
|
p(l(ee), {
|
|
150
155
|
title: o.tooltip
|
|
@@ -171,7 +176,7 @@ const Ce = /* @__PURE__ */ D({
|
|
|
171
176
|
]),
|
|
172
177
|
key: "1"
|
|
173
178
|
} : void 0,
|
|
174
|
-
G(l(C)(
|
|
179
|
+
G(l(C)(a, "default"), (r, b) => ({
|
|
175
180
|
name: b,
|
|
176
181
|
fn: i((_) => [
|
|
177
182
|
W(e.$slots, b, X(Y(_ || {})))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as h, useSlots as B, computed as v, createBlock as y, openBlock as x, normalizeProps as
|
|
1
|
+
import { defineComponent as h, useSlots as B, computed as v, createBlock as y, openBlock as x, normalizeProps as a, guardReactiveProps as t, unref as r, createSlots as s, withCtx as i, createVNode as g, renderList as p, renderSlot as f } from "vue";
|
|
2
2
|
import "../../item/index.vue2.mjs";
|
|
3
3
|
import "../../../ap-field/date/index.vue2.mjs";
|
|
4
4
|
import { isUndefined as F, omit as m, pick as S } from "lodash-unified";
|
|
@@ -48,6 +48,7 @@ const L = /* @__PURE__ */ h({
|
|
|
48
48
|
initialValue: {},
|
|
49
49
|
_signal: {},
|
|
50
50
|
transform: {},
|
|
51
|
+
description: {},
|
|
51
52
|
field: { default: () => ({}) },
|
|
52
53
|
placeholder: {},
|
|
53
54
|
disabled: { type: Boolean, default: void 0 }
|
|
@@ -62,23 +63,23 @@ const L = /* @__PURE__ */ h({
|
|
|
62
63
|
bordered: e.bordered ? !1 : F((o = e.field) == null ? void 0 : o.bordered) ? !0 : e.field.bordered
|
|
63
64
|
};
|
|
64
65
|
});
|
|
65
|
-
return (o, P) => (x(), y(k,
|
|
66
|
+
return (o, P) => (x(), y(k, a(t(r(m)(e, ["field", "placeholder", "disabled"]))), s({
|
|
66
67
|
default: i(() => [
|
|
67
|
-
g(C,
|
|
68
|
-
p(
|
|
68
|
+
g(C, a(t(b.value)), s({ _: 2 }, [
|
|
69
|
+
p(r(m)(n, r(u)), (_, l) => ({
|
|
69
70
|
name: l,
|
|
70
71
|
fn: i((d) => [
|
|
71
|
-
f(o.$slots, l,
|
|
72
|
+
f(o.$slots, l, a(t(d || {})))
|
|
72
73
|
])
|
|
73
74
|
}))
|
|
74
75
|
]), 1040)
|
|
75
76
|
]),
|
|
76
77
|
_: 2
|
|
77
78
|
}, [
|
|
78
|
-
p(
|
|
79
|
+
p(r(S)(n, r(u)), (_, l) => ({
|
|
79
80
|
name: l,
|
|
80
81
|
fn: i((d) => [
|
|
81
|
-
f(o.$slots, l,
|
|
82
|
+
f(o.$slots, l, a(t(d || {})))
|
|
82
83
|
])
|
|
83
84
|
}))
|
|
84
85
|
]), 1040));
|
|
@@ -48,33 +48,34 @@ const T = /* @__PURE__ */ y({
|
|
|
48
48
|
initialValue: {},
|
|
49
49
|
_signal: {},
|
|
50
50
|
transform: {},
|
|
51
|
+
description: {},
|
|
51
52
|
field: { default: () => ({}) },
|
|
52
53
|
placeholder: {},
|
|
53
54
|
disabled: { type: Boolean, default: void 0 }
|
|
54
55
|
},
|
|
55
56
|
setup(c, { expose: b }) {
|
|
56
|
-
const h = c, p = B(),
|
|
57
|
+
const h = c, p = B(), r = _();
|
|
57
58
|
return b({
|
|
58
59
|
focus: () => {
|
|
59
60
|
var e;
|
|
60
|
-
(e =
|
|
61
|
+
(e = r.value) == null || e.focus();
|
|
61
62
|
},
|
|
62
63
|
blur: () => {
|
|
63
64
|
var e;
|
|
64
|
-
(e =
|
|
65
|
+
(e = r.value) == null || e.blur();
|
|
65
66
|
}
|
|
66
67
|
}), (e, R) => (x(), g(C, t(s(l(f)(h, ["field", "placeholder", "disabled"]))), d({
|
|
67
68
|
default: n(() => [
|
|
68
69
|
k(F, N({
|
|
69
70
|
ref_key: "inputNumberRef",
|
|
70
|
-
ref:
|
|
71
|
+
ref: r,
|
|
71
72
|
placeholder: e.placeholder,
|
|
72
73
|
disabled: e.disabled
|
|
73
74
|
}, e.field), d({ _: 2 }, [
|
|
74
75
|
i(l(f)(p, l(m)), (v, o) => ({
|
|
75
76
|
name: o,
|
|
76
|
-
fn: n((
|
|
77
|
-
u(e.$slots, o, t(s(
|
|
77
|
+
fn: n((a) => [
|
|
78
|
+
u(e.$slots, o, t(s(a || {})))
|
|
78
79
|
])
|
|
79
80
|
}))
|
|
80
81
|
]), 1040, ["placeholder", "disabled"])
|
|
@@ -83,8 +84,8 @@ const T = /* @__PURE__ */ y({
|
|
|
83
84
|
}, [
|
|
84
85
|
i(l(S)(p, l(m)), (v, o) => ({
|
|
85
86
|
name: o,
|
|
86
|
-
fn: n((
|
|
87
|
-
u(e.$slots, o, t(s(
|
|
87
|
+
fn: n((a) => [
|
|
88
|
+
u(e.$slots, o, t(s(a || {})))
|
|
88
89
|
])
|
|
89
90
|
}))
|
|
90
91
|
]), 1040));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as B, ref as x, useSlots as g, computed as S, createBlock as k, openBlock as F, normalizeProps as d, guardReactiveProps as n, unref as l, createSlots as f, withCtx as i, createVNode as C, mergeProps as P, renderList as u, renderSlot as
|
|
1
|
+
import { defineComponent as B, ref as x, useSlots as g, computed as S, createBlock as k, openBlock as F, normalizeProps as d, guardReactiveProps as n, unref as l, createSlots as f, withCtx as i, createVNode as C, mergeProps as P, renderList as u, renderSlot as c } from "vue";
|
|
2
2
|
import "../../item/index.vue2.mjs";
|
|
3
3
|
import "../../../ap-field/index.mjs";
|
|
4
|
-
import { isUndefined as q, omit as
|
|
4
|
+
import { isUndefined as q, omit as m, pick as $ } from "lodash-unified";
|
|
5
5
|
import { apFormItemSlotNames as b } from "../../constant.mjs";
|
|
6
6
|
import N from "../../item/index.vue.mjs";
|
|
7
7
|
import R from "../../../ap-field/select/index.vue.mjs";
|
|
@@ -48,6 +48,7 @@ const E = /* @__PURE__ */ B({
|
|
|
48
48
|
initialValue: {},
|
|
49
49
|
_signal: {},
|
|
50
50
|
transform: {},
|
|
51
|
+
description: {},
|
|
51
52
|
field: { default: () => ({}) },
|
|
52
53
|
placeholder: {},
|
|
53
54
|
disabled: { type: Boolean, default: void 0 }
|
|
@@ -77,16 +78,16 @@ const E = /* @__PURE__ */ B({
|
|
|
77
78
|
bordered: o.bordered ? !1 : q((e = o.field) == null ? void 0 : e.bordered) ? !0 : (a = o.field) == null ? void 0 : a.bordered
|
|
78
79
|
};
|
|
79
80
|
});
|
|
80
|
-
return (e, a) => (F(), k(N, d(n(l(
|
|
81
|
+
return (e, a) => (F(), k(N, d(n(l(m)(o, ["field", "placeholder", "disabled"]))), f({
|
|
81
82
|
default: i(() => [
|
|
82
83
|
C(l(R), P(h.value, {
|
|
83
84
|
ref_key: "selectRef",
|
|
84
85
|
ref: t
|
|
85
86
|
}), f({ _: 2 }, [
|
|
86
|
-
u(l(
|
|
87
|
+
u(l(m)(p, l(b)), (y, r) => ({
|
|
87
88
|
name: r,
|
|
88
89
|
fn: i((s) => [
|
|
89
|
-
|
|
90
|
+
c(e.$slots, r, d(n(s || {})))
|
|
90
91
|
])
|
|
91
92
|
}))
|
|
92
93
|
]), 1040)
|
|
@@ -96,7 +97,7 @@ const E = /* @__PURE__ */ B({
|
|
|
96
97
|
u(l($)(p, l(b)), (y, r) => ({
|
|
97
98
|
name: r,
|
|
98
99
|
fn: i((s) => [
|
|
99
|
-
|
|
100
|
+
c(e.$slots, r, d(n(s || {})))
|
|
100
101
|
])
|
|
101
102
|
}))
|
|
102
103
|
]), 1040));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as x, ref as S, computed as _, createBlock as k, openBlock as F, normalizeProps as n, guardReactiveProps as p, unref as t, createSlots as u, withCtx as
|
|
1
|
+
import { defineComponent as B, useSlots as x, ref as S, computed as _, createBlock as k, openBlock as F, normalizeProps as n, guardReactiveProps as p, unref as t, createSlots as u, withCtx as i, createVNode as R, mergeProps as C, renderList as f, renderSlot as c } from "vue";
|
|
2
2
|
import "../../item/index.vue2.mjs";
|
|
3
3
|
import { ApField as P } from "../../../ap-field/index.mjs";
|
|
4
4
|
import { omit as m, pick as A } from "lodash-unified";
|
|
@@ -47,12 +47,13 @@ const E = /* @__PURE__ */ B({
|
|
|
47
47
|
initialValue: {},
|
|
48
48
|
_signal: {},
|
|
49
49
|
transform: {},
|
|
50
|
+
description: {},
|
|
50
51
|
field: { default: () => ({}) },
|
|
51
52
|
placeholder: {},
|
|
52
53
|
disabled: { type: Boolean, default: void 0 }
|
|
53
54
|
},
|
|
54
55
|
setup(v, { expose: h }) {
|
|
55
|
-
const { Text: g } = P,
|
|
56
|
+
const { Text: g } = P, d = x(), y = v, l = S();
|
|
56
57
|
return h({
|
|
57
58
|
focus: (e) => {
|
|
58
59
|
var a;
|
|
@@ -75,16 +76,16 @@ const E = /* @__PURE__ */ B({
|
|
|
75
76
|
return (e = l.value) == null ? void 0 : e.input;
|
|
76
77
|
})
|
|
77
78
|
}), (e, a) => (F(), k(N, n(p(t(m)(y, ["field", "disabled", "placeholder"]))), u({
|
|
78
|
-
default:
|
|
79
|
+
default: i(() => [
|
|
79
80
|
R(t(g), C({
|
|
80
81
|
ref_key: "inputRef",
|
|
81
82
|
ref: l,
|
|
82
83
|
disabled: e.disabled,
|
|
83
84
|
placeholder: e.placeholder
|
|
84
85
|
}, e.field), u({ _: 2 }, [
|
|
85
|
-
f(t(m)(
|
|
86
|
+
f(t(m)(d, t(b)), (r, o) => ({
|
|
86
87
|
name: o,
|
|
87
|
-
fn:
|
|
88
|
+
fn: i((s) => [
|
|
88
89
|
c(e.$slots, o, n(p(s || {})))
|
|
89
90
|
])
|
|
90
91
|
}))
|
|
@@ -92,9 +93,9 @@ const E = /* @__PURE__ */ B({
|
|
|
92
93
|
]),
|
|
93
94
|
_: 2
|
|
94
95
|
}, [
|
|
95
|
-
f(t(A)(
|
|
96
|
+
f(t(A)(d, t(b)), (r, o) => ({
|
|
96
97
|
name: o,
|
|
97
|
-
fn:
|
|
98
|
+
fn: i((s) => [
|
|
98
99
|
c(e.$slots, o, n(p(s || {})))
|
|
99
100
|
])
|
|
100
101
|
}))
|