@aplus-frontend/ui 6.11.0 → 6.13.0
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-descriptions/interface.d.ts +1 -1
- package/es/src/ap-form/ap-form.vue2.mjs +118 -108
- package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +4 -4
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +4 -4
- package/es/src/ap-form/search-form/hooks/use-collapse-input-count.d.ts +8 -1
- package/es/src/ap-form/search-form/hooks/use-collapse-input-count.mjs +27 -19
- package/es/src/ap-form/search-form/hooks/use-sorter.mjs +31 -30
- package/es/src/ap-form/search-form/index.vue.d.ts +6 -2
- package/es/src/ap-form/search-form/index.vue.mjs +35 -35
- package/es/src/ap-grid/index.vue.mjs +221 -225
- package/es/src/ap-modal/interface.d.ts +8 -0
- package/es/src/ap-modal/utils/createModalStream.mjs +69 -66
- package/es/src/ap-table/ap-table.vue2.mjs +107 -111
- package/es/src/ap-table/constants.d.ts +7 -7
- package/es/src/ap-table/context.d.ts +1 -0
- package/es/src/ap-table/context.mjs +6 -5
- package/es/src/ap-table/utils.d.ts +5 -3247
- package/es/src/ap-table/utils.mjs +107 -121
- package/es/src/business/ap-card/ApCard.vue2.mjs +17 -17
- package/es/src/business/ap-summary/interface.d.ts +1 -1
- package/es/src/business/ap-view/ap-view.vue2.mjs +76 -74
- package/es/src/business/ap-view/interface.d.ts +1 -0
- package/es/src/business/batch-input-group/index.vue.d.ts +2 -1
- package/es/src/business/batch-input-group/index.vue.mjs +56 -52
- package/es/src/business/batch-input-group/interface.d.ts +5 -0
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +36 -32
- package/es/src/business/batch-input-group/utils.d.ts +8 -0
- package/es/src/business/batch-input-group/utils.mjs +10 -0
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +14 -5
- package/es/src/config-provider/config-provider.mjs +19 -18
- package/es/src/config-provider/constants.d.ts +3 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +28 -13
- package/es/src/utils/config-provider-preset.d.ts +6 -6
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-descriptions/interface.d.ts +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/select/index.vue.d.ts +4 -4
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +4 -4
- package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.d.ts +8 -1
- package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.js +1 -1
- package/lib/src/ap-form/search-form/hooks/use-sorter.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +6 -2
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-modal/interface.d.ts +8 -0
- package/lib/src/ap-modal/utils/createModalStream.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +7 -7
- package/lib/src/ap-table/context.d.ts +1 -0
- package/lib/src/ap-table/context.js +1 -1
- package/lib/src/ap-table/utils.d.ts +5 -3247
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-card/ApCard.vue2.js +1 -1
- package/lib/src/business/ap-summary/interface.d.ts +1 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/interface.d.ts +1 -0
- package/lib/src/business/batch-input-group/index.vue.d.ts +2 -1
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/business/batch-input-group/interface.d.ts +5 -0
- package/lib/src/business/batch-input-group/popover-input/index.vue2.js +3 -2
- package/lib/src/business/batch-input-group/utils.d.ts +8 -0
- package/lib/src/business/batch-input-group/utils.js +1 -0
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +14 -5
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +3 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +28 -13
- package/lib/src/utils/config-provider-preset.d.ts +6 -6
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-grid/index.less +3 -4
- package/theme/index.css +3 -0
- package/es/src/ap-table/components/dynamic-component/index.vue.d.ts +0 -4
- package/es/src/ap-table/components/dynamic-component/index.vue.mjs +0 -4
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +0 -15
- package/lib/src/ap-table/components/dynamic-component/index.vue.d.ts +0 -4
- package/lib/src/ap-table/components/dynamic-component/index.vue.js +0 -1
- package/lib/src/ap-table/components/dynamic-component/index.vue2.js +0 -1
|
@@ -21,7 +21,7 @@ type AllKeys<T, P extends string = '', Level extends unknown[] = []> = Level['le
|
|
|
21
21
|
/** 基本描述类型 */
|
|
22
22
|
export interface ItemSchema<T extends Recordable = Recordable> {
|
|
23
23
|
label: VNodeChild | VNode;
|
|
24
|
-
field: Extract<AllKeys<T>, string> | string[];
|
|
24
|
+
field: Extract<AllKeys<T>, string> | (string & {}) | string[];
|
|
25
25
|
span?: number;
|
|
26
26
|
prefix?: VNodeChild | VNode;
|
|
27
27
|
suffix?: VNodeChild | VNode;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useProvideForm as
|
|
4
|
-
import { isArray as f, cloneDeep as
|
|
5
|
-
import { useUrlSearchParams as
|
|
6
|
-
import { INTERNAL_FORM_INSTANCE_MARK as
|
|
7
|
-
import { getRouteType as
|
|
8
|
-
import
|
|
9
|
-
import { genParams as b, setToParams as
|
|
10
|
-
import { useInjectFormProvider as
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as Z, reactive as z, ref as x, unref as m, nextTick as ee, toRaw as R, watch as te, onWatcherCleanup as re, computed as ie, createBlock as le, openBlock as ne, mergeProps as oe, withCtx as se, renderSlot as ae } from "vue";
|
|
2
|
+
import { Form as ue } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useProvideForm as ce } from "./context.mjs";
|
|
4
|
+
import { isArray as f, cloneDeep as fe, isEqual as de, isFunction as B, isPlainObject as _, omit as ge } from "lodash-unified";
|
|
5
|
+
import { useUrlSearchParams as Fe } from "@vueuse/core";
|
|
6
|
+
import { INTERNAL_FORM_INSTANCE_MARK as he } from "./constant.mjs";
|
|
7
|
+
import { getRouteType as pe, isDef as V } from "../utils/index.mjs";
|
|
8
|
+
import me from "./utils/set.mjs";
|
|
9
|
+
import { genParams as b, setToParams as C } from "./utils/params.mjs";
|
|
10
|
+
import { useInjectFormProvider as ye } from "./provider/context.mjs";
|
|
11
|
+
const be = /* @__PURE__ */ Z({
|
|
12
12
|
name: "ApForm",
|
|
13
13
|
__name: "ap-form",
|
|
14
14
|
props: {
|
|
@@ -39,153 +39,163 @@ const Re = /* @__PURE__ */ Q({
|
|
|
39
39
|
syncToUrl: { type: [Boolean, Function], default: !1 },
|
|
40
40
|
syncToUrlPriority: { type: Boolean }
|
|
41
41
|
},
|
|
42
|
-
setup(
|
|
43
|
-
function
|
|
44
|
-
return f(t) ? t.reduce((r,
|
|
42
|
+
setup(N, { expose: S }) {
|
|
43
|
+
function w(e, t) {
|
|
44
|
+
return f(t) ? t.reduce((r, i) => r == null ? void 0 : r[i], e) : e == null ? void 0 : e[t];
|
|
45
45
|
}
|
|
46
|
-
const
|
|
47
|
-
function
|
|
48
|
-
var
|
|
46
|
+
const l = N;
|
|
47
|
+
function I(e, t, r = !0, i) {
|
|
48
|
+
var o;
|
|
49
49
|
if (f(e)) {
|
|
50
|
-
let
|
|
50
|
+
let s = n;
|
|
51
51
|
for (let d = 0; d < e.length - 1; d++)
|
|
52
|
-
e[d] in
|
|
53
|
-
|
|
52
|
+
e[d] in s || (s[e[d]] = {}), s = s[e[d]];
|
|
53
|
+
i ? i(s, e[e.length - 1]) : s[e[e.length - 1]] = t;
|
|
54
54
|
} else
|
|
55
|
-
|
|
56
|
-
let
|
|
55
|
+
i ? i(n, e) : n[e] = t;
|
|
56
|
+
let u = f(e) ? e[0] : e;
|
|
57
57
|
if (r) {
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const s = { [u]: n[u] };
|
|
59
|
+
y.triggerFormChange(l.name, s), (o = l.onValuesChange) == null || o.call(l, s, n, e);
|
|
60
60
|
}
|
|
61
61
|
T();
|
|
62
62
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
63
|
+
const a = x(), U = Fe(pe()), y = ye(), v = x(
|
|
64
|
+
l.syncToUrl ? b(l.syncToUrl, U, "get") : {}
|
|
65
65
|
);
|
|
66
|
-
let
|
|
67
|
-
const
|
|
68
|
-
let
|
|
69
|
-
function
|
|
70
|
-
const e =
|
|
71
|
-
return
|
|
66
|
+
let F = fe(E()), g = {};
|
|
67
|
+
const n = z(E());
|
|
68
|
+
let h = [];
|
|
69
|
+
function E() {
|
|
70
|
+
const e = l.initialValues || {};
|
|
71
|
+
return l.syncToUrlPriority ? {
|
|
72
72
|
...e,
|
|
73
|
-
...m(
|
|
73
|
+
...m(v)
|
|
74
74
|
} : {
|
|
75
|
-
...m(
|
|
75
|
+
...m(v),
|
|
76
76
|
...e
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
function W(e) {
|
|
80
80
|
var r;
|
|
81
|
-
const t =
|
|
82
|
-
|
|
81
|
+
const t = p(e, g);
|
|
82
|
+
y.triggerFormFinish(l.name, e), l.syncToUrl && C(U, b(l.syncToUrl, t, "set")), (r = l.onFinish) == null || r.call(l, t);
|
|
83
83
|
}
|
|
84
84
|
const q = async () => {
|
|
85
85
|
var e;
|
|
86
|
-
(e =
|
|
87
|
-
Object.keys(
|
|
86
|
+
(e = a.value) == null || e.resetFields(), await ee(() => {
|
|
87
|
+
Object.keys(n).forEach((t) => delete n[t]), Object.assign(n, F), T(), l.syncToUrl && C(
|
|
88
88
|
U,
|
|
89
89
|
b(
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
l.syncToUrl,
|
|
91
|
+
p(F, g),
|
|
92
92
|
"set"
|
|
93
93
|
)
|
|
94
94
|
);
|
|
95
95
|
});
|
|
96
96
|
}, D = (e) => {
|
|
97
97
|
var t;
|
|
98
|
-
(t =
|
|
98
|
+
(t = a.value) == null || t.clearValidate(e);
|
|
99
99
|
}, k = (e, t) => {
|
|
100
100
|
var r;
|
|
101
|
-
return (r =
|
|
101
|
+
return (r = a.value) == null ? void 0 : r.validateFields(e, t);
|
|
102
102
|
}, K = async (e, t) => {
|
|
103
|
-
var
|
|
104
|
-
const r = await ((
|
|
103
|
+
var i;
|
|
104
|
+
const r = await ((i = a.value) == null ? void 0 : i.validateFields(
|
|
105
105
|
e,
|
|
106
106
|
t
|
|
107
107
|
));
|
|
108
|
-
return
|
|
108
|
+
return p(r, g);
|
|
109
109
|
}, O = (e) => {
|
|
110
110
|
var t;
|
|
111
|
-
return e === !0 ?
|
|
111
|
+
return e === !0 ? R(n) : (t = a.value) == null ? void 0 : t.getFieldsValue(e);
|
|
112
112
|
}, L = (e) => {
|
|
113
113
|
const t = O(e);
|
|
114
|
-
return
|
|
114
|
+
return p(t, g);
|
|
115
115
|
}, $ = (e, t) => {
|
|
116
116
|
var r;
|
|
117
|
-
return (r =
|
|
117
|
+
return (r = a.value) == null ? void 0 : r.validate(e, t);
|
|
118
118
|
}, G = (e, t = {}) => {
|
|
119
119
|
var r;
|
|
120
|
-
(r =
|
|
120
|
+
(r = a.value) == null || r.scrollToField(e, t);
|
|
121
121
|
}, H = (e) => {
|
|
122
|
-
Object.assign(
|
|
123
|
-
},
|
|
124
|
-
|
|
122
|
+
Object.assign(n, e), T();
|
|
123
|
+
}, P = (e, t, r = !0, i) => {
|
|
124
|
+
I(e, t, r, i), T();
|
|
125
125
|
};
|
|
126
|
-
function
|
|
127
|
-
return t || e(
|
|
128
|
-
|
|
126
|
+
function M(e, t) {
|
|
127
|
+
return t || e(R(n)), h.push(e), () => {
|
|
128
|
+
h = h.filter((r) => r !== e);
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
r
|
|
131
|
+
function J(e, t) {
|
|
132
|
+
if (f(e)) {
|
|
133
|
+
let r = F;
|
|
134
|
+
for (let i = 0; i < e.length - 1; i++)
|
|
135
|
+
V(r[e[i]]) || (r[e[i]] = {}), r = r[e[i]];
|
|
136
|
+
r[e[e.length - 1]] = t;
|
|
137
|
+
} else
|
|
138
|
+
F[e] = t;
|
|
139
|
+
}
|
|
140
|
+
function Q(e, t) {
|
|
141
|
+
if (!V(e) || !V(t))
|
|
142
|
+
return;
|
|
143
|
+
const r = w(F, t);
|
|
144
|
+
if (de(r, e))
|
|
145
|
+
return;
|
|
146
|
+
const i = w(m(v), t);
|
|
147
|
+
V(i) && l.syncToUrlPriority || (I(t, e, !1), J(t, e));
|
|
148
|
+
}
|
|
149
|
+
function X(e, t) {
|
|
150
|
+
t && (g = me(
|
|
144
151
|
g,
|
|
145
|
-
[
|
|
146
|
-
|
|
152
|
+
[e].flat(1),
|
|
153
|
+
t,
|
|
147
154
|
!0
|
|
148
155
|
));
|
|
149
156
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
157
|
+
function j({ initialValue: e, name: t, transform: r }) {
|
|
158
|
+
Q(e, t), X(t, r);
|
|
159
|
+
}
|
|
160
|
+
function Y(e) {
|
|
161
|
+
if (e !== he) {
|
|
152
162
|
console.warn("getInternalInstance should only used at internal");
|
|
153
163
|
return;
|
|
154
164
|
}
|
|
155
165
|
return {
|
|
156
166
|
registerField: j,
|
|
157
|
-
registerWatch:
|
|
158
|
-
setFieldValue:
|
|
167
|
+
registerWatch: M,
|
|
168
|
+
setFieldValue: P
|
|
159
169
|
};
|
|
160
170
|
}
|
|
161
171
|
function T() {
|
|
162
|
-
if (
|
|
163
|
-
const e =
|
|
164
|
-
|
|
172
|
+
if (h.length) {
|
|
173
|
+
const e = R(n);
|
|
174
|
+
h.forEach((t) => {
|
|
165
175
|
t(e);
|
|
166
176
|
});
|
|
167
177
|
}
|
|
168
178
|
}
|
|
169
|
-
function
|
|
179
|
+
function p(e, t) {
|
|
170
180
|
if (e == null)
|
|
171
181
|
return;
|
|
172
182
|
let r = f(e) ? [] : {};
|
|
173
|
-
return Object.keys(e).forEach((
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const c =
|
|
183
|
+
return Object.keys(e).forEach((i) => {
|
|
184
|
+
const u = e[i], o = t == null ? void 0 : t[i], s = B(o) ? o : o == null ? void 0 : o.transformer, d = B(o) ? !0 : o == null ? void 0 : o.flat;
|
|
185
|
+
if (B(s)) {
|
|
186
|
+
const c = s(u);
|
|
177
187
|
d ? f(c) && f(r) ? r = [...r, ...c] : _(c) && _(r) ? r = {
|
|
178
188
|
...r,
|
|
179
189
|
...c
|
|
180
|
-
} : r[
|
|
181
|
-
} else if (_(
|
|
182
|
-
const c =
|
|
183
|
-
|
|
184
|
-
|
|
190
|
+
} : r[i] = c : r[i] = c;
|
|
191
|
+
} else if (_(u) || f(u)) {
|
|
192
|
+
const c = p(
|
|
193
|
+
u,
|
|
194
|
+
o
|
|
185
195
|
);
|
|
186
|
-
r[
|
|
196
|
+
r[i] = c;
|
|
187
197
|
} else
|
|
188
|
-
r[
|
|
198
|
+
r[i] = u;
|
|
189
199
|
}), r;
|
|
190
200
|
}
|
|
191
201
|
const A = {
|
|
@@ -196,36 +206,36 @@ const Re = /* @__PURE__ */ Q({
|
|
|
196
206
|
validate: $,
|
|
197
207
|
scrollToField: G,
|
|
198
208
|
setFieldsValue: H,
|
|
199
|
-
setFieldValue:
|
|
200
|
-
registerWatch:
|
|
209
|
+
setFieldValue: P,
|
|
210
|
+
registerWatch: M,
|
|
201
211
|
validateFieldsReturnTransformed: K,
|
|
202
212
|
getFieldsValueTransformed: L,
|
|
203
|
-
getInternalInstance:
|
|
213
|
+
getInternalInstance: Y
|
|
204
214
|
};
|
|
205
|
-
return
|
|
206
|
-
() =>
|
|
215
|
+
return te(
|
|
216
|
+
() => l.name,
|
|
207
217
|
(e) => {
|
|
208
|
-
e && (
|
|
209
|
-
|
|
218
|
+
e && (y.registerForm(e, A), re(() => {
|
|
219
|
+
y.unregisterForm(l.name);
|
|
210
220
|
}));
|
|
211
221
|
},
|
|
212
222
|
{
|
|
213
223
|
immediate: !0
|
|
214
224
|
}
|
|
215
|
-
),
|
|
216
|
-
model:
|
|
217
|
-
updateModel:
|
|
225
|
+
), ce({
|
|
226
|
+
model: ie(() => n),
|
|
227
|
+
updateModel: I,
|
|
218
228
|
internalInstance: {
|
|
219
|
-
registerWatch:
|
|
229
|
+
registerWatch: M,
|
|
220
230
|
registerField: j,
|
|
221
|
-
setFieldValue:
|
|
231
|
+
setFieldValue: P
|
|
222
232
|
}
|
|
223
|
-
}),
|
|
233
|
+
}), S(A), (e, t) => (ne(), le(m(ue), oe(
|
|
224
234
|
{
|
|
225
235
|
ref_key: "formRef",
|
|
226
|
-
ref:
|
|
236
|
+
ref: a
|
|
227
237
|
},
|
|
228
|
-
m(
|
|
238
|
+
m(ge)(l, [
|
|
229
239
|
"initialValues",
|
|
230
240
|
"onValuesChange",
|
|
231
241
|
"onFinish",
|
|
@@ -233,18 +243,18 @@ const Re = /* @__PURE__ */ Q({
|
|
|
233
243
|
"syncToUrlPriority"
|
|
234
244
|
]),
|
|
235
245
|
{
|
|
236
|
-
model:
|
|
246
|
+
model: n,
|
|
237
247
|
"data-form-name": e.name,
|
|
238
248
|
onFinish: W
|
|
239
249
|
}
|
|
240
250
|
), {
|
|
241
|
-
default:
|
|
242
|
-
|
|
251
|
+
default: se(() => [
|
|
252
|
+
ae(e.$slots, "default")
|
|
243
253
|
]),
|
|
244
254
|
_: 3
|
|
245
255
|
}, 16, ["model", "data-form-name"]));
|
|
246
256
|
}
|
|
247
257
|
});
|
|
248
258
|
export {
|
|
249
|
-
|
|
259
|
+
be as default
|
|
250
260
|
};
|
|
@@ -66,8 +66,8 @@ declare function __VLS_template(): {
|
|
|
66
66
|
readonly type?: string | undefined;
|
|
67
67
|
readonly name?: string | undefined;
|
|
68
68
|
readonly suffix?: any;
|
|
69
|
-
readonly placeholder?: string | undefined;
|
|
70
69
|
readonly id?: string | undefined;
|
|
70
|
+
readonly placeholder?: string | undefined;
|
|
71
71
|
readonly valueModifiers?: Record<string, any> | undefined;
|
|
72
72
|
readonly addonBefore?: any;
|
|
73
73
|
readonly addonAfter?: any;
|
|
@@ -539,8 +539,8 @@ declare const __VLS_component: DefineComponent<ApFormItemNumberProps, {
|
|
|
539
539
|
readonly type?: string | undefined;
|
|
540
540
|
readonly name?: string | undefined;
|
|
541
541
|
readonly suffix?: any;
|
|
542
|
-
readonly placeholder?: string | undefined;
|
|
543
542
|
readonly id?: string | undefined;
|
|
543
|
+
readonly placeholder?: string | undefined;
|
|
544
544
|
readonly valueModifiers?: Record<string, any> | undefined;
|
|
545
545
|
readonly addonBefore?: any;
|
|
546
546
|
readonly addonAfter?: any;
|
|
@@ -72,11 +72,11 @@ declare function __VLS_template(): {
|
|
|
72
72
|
readonly autofocus?: boolean | undefined;
|
|
73
73
|
readonly bordered?: boolean | undefined;
|
|
74
74
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
75
|
-
readonly placeholder?: any;
|
|
76
|
-
readonly defaultValue?: SelectValue;
|
|
77
75
|
readonly virtual?: boolean | undefined;
|
|
78
76
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
77
|
+
readonly defaultValue?: SelectValue;
|
|
79
78
|
readonly id?: string | undefined;
|
|
79
|
+
readonly placeholder?: any;
|
|
80
80
|
readonly status?: "" | "error" | "warning" | undefined;
|
|
81
81
|
readonly clearIcon?: any;
|
|
82
82
|
readonly allowClear?: boolean | undefined;
|
|
@@ -703,11 +703,11 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
|
|
|
703
703
|
readonly autofocus?: boolean | undefined;
|
|
704
704
|
readonly bordered?: boolean | undefined;
|
|
705
705
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
706
|
-
readonly placeholder?: any;
|
|
707
|
-
readonly defaultValue?: SelectValue;
|
|
708
706
|
readonly virtual?: boolean | undefined;
|
|
709
707
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
708
|
+
readonly defaultValue?: SelectValue;
|
|
710
709
|
readonly id?: string | undefined;
|
|
710
|
+
readonly placeholder?: any;
|
|
711
711
|
readonly status?: "" | "error" | "warning" | undefined;
|
|
712
712
|
readonly clearIcon?: any;
|
|
713
713
|
readonly allowClear?: boolean | undefined;
|
|
@@ -54,9 +54,9 @@ declare function __VLS_template(): {
|
|
|
54
54
|
readonly suffix?: any;
|
|
55
55
|
readonly focused?: boolean | undefined;
|
|
56
56
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
57
|
-
readonly placeholder?: string | number | undefined;
|
|
58
57
|
readonly defaultValue?: string | number | undefined;
|
|
59
58
|
readonly id?: string | undefined;
|
|
59
|
+
readonly placeholder?: string | number | undefined;
|
|
60
60
|
readonly autocomplete?: string | undefined;
|
|
61
61
|
readonly maxlength?: number | undefined;
|
|
62
62
|
readonly showCount?: boolean | ShowCountProps | undefined;
|
|
@@ -210,9 +210,9 @@ declare const __VLS_component: DefineComponent<ApFormItemTextProps, {
|
|
|
210
210
|
readonly suffix?: any;
|
|
211
211
|
readonly focused?: boolean | undefined;
|
|
212
212
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
213
|
-
readonly placeholder?: string | number | undefined;
|
|
214
213
|
readonly defaultValue?: string | number | undefined;
|
|
215
214
|
readonly id?: string | undefined;
|
|
215
|
+
readonly placeholder?: string | number | undefined;
|
|
216
216
|
readonly autocomplete?: string | undefined;
|
|
217
217
|
readonly maxlength?: number | undefined;
|
|
218
218
|
readonly showCount?: boolean | ShowCountProps | undefined;
|
|
@@ -55,9 +55,9 @@ declare function __VLS_template(): {
|
|
|
55
55
|
readonly suffix?: any;
|
|
56
56
|
readonly focused?: boolean | undefined;
|
|
57
57
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
58
|
-
readonly placeholder?: string | number | undefined;
|
|
59
58
|
readonly defaultValue?: string | number | undefined;
|
|
60
59
|
readonly id?: string | undefined;
|
|
60
|
+
readonly placeholder?: string | number | undefined;
|
|
61
61
|
readonly autocomplete?: string | undefined;
|
|
62
62
|
readonly maxlength?: number | undefined;
|
|
63
63
|
readonly showCount?: boolean | ShowCountProps | undefined;
|
|
@@ -217,9 +217,9 @@ declare const __VLS_component: DefineComponent<ApFormItemTextPasswordProps, {
|
|
|
217
217
|
readonly suffix?: any;
|
|
218
218
|
readonly focused?: boolean | undefined;
|
|
219
219
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
220
|
-
readonly placeholder?: string | number | undefined;
|
|
221
220
|
readonly defaultValue?: string | number | undefined;
|
|
222
221
|
readonly id?: string | undefined;
|
|
222
|
+
readonly placeholder?: string | number | undefined;
|
|
223
223
|
readonly autocomplete?: string | undefined;
|
|
224
224
|
readonly maxlength?: number | undefined;
|
|
225
225
|
readonly showCount?: boolean | ShowCountProps | undefined;
|
|
@@ -77,11 +77,11 @@ declare function __VLS_template(): {
|
|
|
77
77
|
readonly 'onUpdate:value'?: (((value: any) => void) & ((...args: any[]) => any)) | undefined;
|
|
78
78
|
readonly bordered?: boolean | undefined;
|
|
79
79
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
80
|
-
readonly placeholder?: any;
|
|
81
|
-
readonly defaultValue?: unknown;
|
|
82
80
|
readonly virtual?: boolean | undefined;
|
|
83
81
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
82
|
+
readonly defaultValue?: unknown;
|
|
84
83
|
readonly id?: string | undefined;
|
|
84
|
+
readonly placeholder?: any;
|
|
85
85
|
readonly status?: "" | "error" | "warning" | undefined;
|
|
86
86
|
readonly clearIcon?: any;
|
|
87
87
|
readonly allowClear?: boolean | undefined;
|
|
@@ -851,11 +851,11 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
851
851
|
readonly 'onUpdate:value'?: (((value: any) => void) & ((...args: any[]) => any)) | undefined;
|
|
852
852
|
readonly bordered?: boolean | undefined;
|
|
853
853
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
854
|
-
readonly placeholder?: any;
|
|
855
|
-
readonly defaultValue?: unknown;
|
|
856
854
|
readonly virtual?: boolean | undefined;
|
|
857
855
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
856
|
+
readonly defaultValue?: unknown;
|
|
858
857
|
readonly id?: string | undefined;
|
|
858
|
+
readonly placeholder?: any;
|
|
859
859
|
readonly status?: "" | "error" | "warning" | undefined;
|
|
860
860
|
readonly clearIcon?: any;
|
|
861
861
|
readonly allowClear?: boolean | undefined;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { Ref, ComputedRef } from 'vue';
|
|
1
|
+
import { Ref, VNode, ComputedRef } from 'vue';
|
|
2
2
|
import { SearchFormRenderNodeConfig } from '../../interface';
|
|
3
|
+
/**
|
|
4
|
+
* 默认用于判断当前值是否是空值的判断函数
|
|
5
|
+
* @param value
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function defaultFilled(value: any): boolean;
|
|
9
|
+
export declare function getTargetNode(node: VNode): any;
|
|
3
10
|
export declare const useCollapseInputCount: (config: Ref<SearchFormRenderNodeConfig[]>) => {
|
|
4
11
|
count: ComputedRef<number>;
|
|
5
12
|
};
|
|
@@ -1,39 +1,47 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { useInjectForm as
|
|
3
|
-
import { isArray as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { computed as m } from "vue";
|
|
2
|
+
import { useInjectForm as d } from "../../context.mjs";
|
|
3
|
+
import { isArray as a, isObject as g, isFunction as h } from "lodash-unified";
|
|
4
|
+
import "../../../config-provider/index.mjs";
|
|
5
|
+
import { useGlobalConfig as y } from "../../../config-provider/hooks/use-global-config.mjs";
|
|
6
|
+
function C(t, r) {
|
|
7
|
+
return a(r) ? r.reduce((n, i) => n == null ? void 0 : n[i], t) : t == null ? void 0 : t[r];
|
|
6
8
|
}
|
|
7
|
-
function
|
|
9
|
+
function c(t) {
|
|
8
10
|
if (t == null)
|
|
9
11
|
return !1;
|
|
10
12
|
if (typeof t == "string")
|
|
11
13
|
return t.trim() !== "";
|
|
12
|
-
if (
|
|
13
|
-
return t.some((n) =>
|
|
14
|
-
if (
|
|
14
|
+
if (a(t))
|
|
15
|
+
return t.some((n) => c(n));
|
|
16
|
+
if (g(t)) {
|
|
15
17
|
const r = Object.keys(t);
|
|
16
18
|
if (r.length === 0)
|
|
17
19
|
return !1;
|
|
18
20
|
for (const n of r)
|
|
19
|
-
if (
|
|
21
|
+
if (c(t[n]))
|
|
20
22
|
return !0;
|
|
21
23
|
return !1;
|
|
22
24
|
}
|
|
23
25
|
return !0;
|
|
24
26
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
function b(t) {
|
|
28
|
+
return h(t.type) ? t.type() : t;
|
|
29
|
+
}
|
|
30
|
+
const x = (t) => {
|
|
31
|
+
const { model: r } = d(), n = y("searchForm");
|
|
27
32
|
return {
|
|
28
|
-
count:
|
|
29
|
-
let
|
|
30
|
-
return t.value.forEach((
|
|
31
|
-
|
|
32
|
-
f(
|
|
33
|
-
|
|
33
|
+
count: m(() => {
|
|
34
|
+
let s = 0;
|
|
35
|
+
return t.value.forEach((p) => {
|
|
36
|
+
var u;
|
|
37
|
+
const o = b(p.node), F = [o.props.name].flat(1), f = C(r == null ? void 0 : r.value, F), l = o.props.customFilled || o.props["custom-filled"], e = (u = n.value) == null ? void 0 : u.customFilled;
|
|
38
|
+
!l && e ? e != null && e(o, f) && (s += 1) : (l || c)(f) && (s += 1);
|
|
39
|
+
}), s;
|
|
34
40
|
})
|
|
35
41
|
};
|
|
36
42
|
};
|
|
37
43
|
export {
|
|
38
|
-
|
|
44
|
+
c as defaultFilled,
|
|
45
|
+
b as getTargetNode,
|
|
46
|
+
x as useCollapseInputCount
|
|
39
47
|
};
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import { isBoolean as
|
|
2
|
-
import { ref as
|
|
3
|
-
import { getStringName as
|
|
4
|
-
import { isDef as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
t
|
|
1
|
+
import { isBoolean as f } from "lodash-unified";
|
|
2
|
+
import { ref as c, computed as u } from "vue";
|
|
3
|
+
import { getStringName as m } from "../../item-group/helper.mjs";
|
|
4
|
+
import { isDef as l } from "../../../utils/index.mjs";
|
|
5
|
+
import { getTargetNode as p } from "./use-collapse-input-count.mjs";
|
|
6
|
+
function g(n, r) {
|
|
7
|
+
var d;
|
|
8
|
+
const i = new Set(n.map((e) => e.name)), a = /* @__PURE__ */ new Map();
|
|
9
|
+
for (const e of r) {
|
|
10
|
+
const t = String(m((d = p(e).props) == null ? void 0 : d.name));
|
|
11
|
+
t && i.has(t) && a.set(t, e);
|
|
11
12
|
}
|
|
12
|
-
const
|
|
13
|
-
for (const
|
|
14
|
-
const t =
|
|
15
|
-
t && (
|
|
13
|
+
const s = /* @__PURE__ */ new Set(), o = [];
|
|
14
|
+
for (const e of n) {
|
|
15
|
+
const t = a.get(e.name);
|
|
16
|
+
t && (o.push(t), s.add(t));
|
|
16
17
|
}
|
|
17
|
-
for (const
|
|
18
|
-
|
|
19
|
-
return
|
|
18
|
+
for (const e of r)
|
|
19
|
+
s.has(e) || o.push(e);
|
|
20
|
+
return o;
|
|
20
21
|
}
|
|
21
|
-
const
|
|
22
|
-
const r =
|
|
23
|
-
const e =
|
|
22
|
+
const C = (n) => {
|
|
23
|
+
const r = c(!1), i = u(() => (n.value || []).map((o) => {
|
|
24
|
+
const e = p(o).props;
|
|
24
25
|
return {
|
|
25
26
|
label: e.description || e.label || e.placeholder,
|
|
26
|
-
name:
|
|
27
|
-
isHidden:
|
|
27
|
+
name: m(e.name),
|
|
28
|
+
isHidden: f(e.hidden) ? !!e.hidden : l(e.hidden)
|
|
28
29
|
};
|
|
29
30
|
}));
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
function a(s) {
|
|
32
|
+
const o = g(
|
|
33
|
+
s || [],
|
|
34
|
+
n.value || []
|
|
34
35
|
);
|
|
35
|
-
r.value = !0,
|
|
36
|
+
r.value = !0, n.value = o;
|
|
36
37
|
}
|
|
37
38
|
return {
|
|
38
|
-
items:
|
|
39
|
-
handleClickConfirm:
|
|
39
|
+
items: i,
|
|
40
|
+
handleClickConfirm: a,
|
|
40
41
|
sorted: r
|
|
41
42
|
};
|
|
42
43
|
};
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
C as useSorter
|
|
45
46
|
};
|