@aplus-frontend/ui 7.17.1-beta.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 +38 -38
- 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,31 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Space as
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as A, computed as w, useSlots as L, ref as O, unref as e, resolveComponent as U, createElementBlock as d, createBlock as B, openBlock as l, Fragment as S, toDisplayString as x, withCtx as f, renderList as N, mergeProps as E, createSlots as K, renderSlot as j, normalizeProps as q, guardReactiveProps as G, createVNode as W } from "vue";
|
|
2
|
+
import { Space as $, Cascader as H } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as J, isArray as Q } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
5
|
import { useDefaultPlaceholder as X } from "../hooks/use-default-placeholder.mjs";
|
|
6
6
|
import { useOptions as Y } from "./use-options.mjs";
|
|
7
7
|
import { useControllableValue as Z } from "../../hooks/useControllableValue.mjs";
|
|
8
|
-
|
|
9
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !O(t);
|
|
10
|
-
}
|
|
11
|
-
const ue = /* @__PURE__ */ j({
|
|
8
|
+
const ee = { key: 0 }, de = /* @__PURE__ */ A({
|
|
12
9
|
name: "ApFieldCascader",
|
|
13
10
|
__name: "index",
|
|
14
11
|
props: {
|
|
15
|
-
mode: {
|
|
16
|
-
default: "edit"
|
|
17
|
-
},
|
|
12
|
+
mode: { default: "edit" },
|
|
18
13
|
class: {},
|
|
19
14
|
style: {},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
default: void 0
|
|
23
|
-
},
|
|
15
|
+
emptyText: { default: "--" },
|
|
16
|
+
multiple: { type: Boolean, default: void 0 },
|
|
24
17
|
size: {},
|
|
25
|
-
bordered: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: !0
|
|
28
|
-
},
|
|
18
|
+
bordered: { type: Boolean, default: !0 },
|
|
29
19
|
placement: {},
|
|
30
20
|
suffixIcon: {},
|
|
31
21
|
status: {},
|
|
@@ -46,54 +36,34 @@ const ue = /* @__PURE__ */ j({
|
|
|
46
36
|
onKeydown: {},
|
|
47
37
|
onKeyup: {},
|
|
48
38
|
onMousedown: {},
|
|
49
|
-
open: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: void 0
|
|
52
|
-
},
|
|
39
|
+
open: { type: Boolean, default: void 0 },
|
|
53
40
|
animation: {},
|
|
54
41
|
direction: {},
|
|
55
|
-
disabled: {
|
|
56
|
-
type: Boolean
|
|
57
|
-
},
|
|
42
|
+
disabled: { type: Boolean },
|
|
58
43
|
prefixCls: {},
|
|
59
44
|
id: {},
|
|
60
|
-
autofocus: {
|
|
61
|
-
type: Boolean
|
|
62
|
-
},
|
|
45
|
+
autofocus: { type: Boolean },
|
|
63
46
|
getPopupContainer: {},
|
|
64
|
-
dropdownMatchSelectWidth: {
|
|
65
|
-
type: [Number, Boolean]
|
|
66
|
-
},
|
|
47
|
+
dropdownMatchSelectWidth: { type: [Number, Boolean] },
|
|
67
48
|
placeholder: {},
|
|
68
|
-
loading: {
|
|
69
|
-
type: Boolean
|
|
70
|
-
},
|
|
49
|
+
loading: { type: Boolean },
|
|
71
50
|
defaultValue: {},
|
|
72
51
|
prefix: {},
|
|
73
52
|
clearIcon: {},
|
|
74
|
-
allowClear: {
|
|
75
|
-
type: Boolean,
|
|
76
|
-
default: !0
|
|
77
|
-
},
|
|
53
|
+
allowClear: { type: Boolean, default: !0 },
|
|
78
54
|
getInputElement: {},
|
|
79
55
|
getRawInputElement: {},
|
|
80
56
|
fieldNames: {},
|
|
81
57
|
searchValue: {},
|
|
82
58
|
onSearch: {},
|
|
83
59
|
maxCount: {},
|
|
84
|
-
showSearch: {
|
|
85
|
-
type: [Boolean, Object],
|
|
86
|
-
default: !1
|
|
87
|
-
},
|
|
60
|
+
showSearch: { type: [Boolean, Object], default: !1 },
|
|
88
61
|
tagRender: {},
|
|
89
62
|
optionLabelRender: {},
|
|
90
63
|
notFoundContent: {},
|
|
91
64
|
onClear: {},
|
|
92
65
|
choiceTransitionName: {},
|
|
93
|
-
defaultOpen: {
|
|
94
|
-
type: Boolean,
|
|
95
|
-
default: void 0
|
|
96
|
-
},
|
|
66
|
+
defaultOpen: { type: Boolean, default: void 0 },
|
|
97
67
|
onDropdownVisibleChange: {},
|
|
98
68
|
maxTagTextLength: {},
|
|
99
69
|
maxTagCount: {},
|
|
@@ -109,109 +79,94 @@ const ue = /* @__PURE__ */ j({
|
|
|
109
79
|
onPopupVisibleChange: {},
|
|
110
80
|
popupStyle: {},
|
|
111
81
|
popupPlacement: {},
|
|
112
|
-
popupVisible: {
|
|
113
|
-
type: Boolean,
|
|
114
|
-
default: void 0
|
|
115
|
-
},
|
|
82
|
+
popupVisible: { type: Boolean, default: void 0 },
|
|
116
83
|
expandIcon: {},
|
|
117
|
-
changeOnSelect: {
|
|
118
|
-
type: Boolean
|
|
119
|
-
},
|
|
84
|
+
changeOnSelect: { type: Boolean },
|
|
120
85
|
displayRender: {},
|
|
121
86
|
showCheckedStrategy: {},
|
|
122
87
|
expandTrigger: {},
|
|
123
88
|
dropdownPrefixCls: {},
|
|
124
89
|
dropdownMenuColumnStyle: {},
|
|
125
90
|
loadingIcon: {},
|
|
126
|
-
emptyText: {
|
|
127
|
-
default: "--"
|
|
128
|
-
},
|
|
129
91
|
request: {},
|
|
130
|
-
lazy: {
|
|
131
|
-
type: Boolean
|
|
132
|
-
},
|
|
92
|
+
lazy: { type: Boolean },
|
|
133
93
|
params: {},
|
|
134
|
-
loadData: {
|
|
135
|
-
type: Boolean
|
|
136
|
-
}
|
|
94
|
+
loadData: { type: Boolean }
|
|
137
95
|
},
|
|
138
96
|
emits: ["update:value"],
|
|
139
|
-
setup(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return u(C, null, [o.emptyText]);
|
|
155
|
-
const l = [], v = o.fieldNames?.label || "label", s = o.fieldNames?.value || "value";
|
|
156
|
-
function i(r, d) {
|
|
157
|
-
const p = [];
|
|
158
|
-
for (const c of r) {
|
|
159
|
-
if (d.find((R) => R === c[s]) && p.push(c[v]), p.length === d.length)
|
|
160
|
-
return p;
|
|
161
|
-
c.children?.length && p.push(...i(c.children, d));
|
|
97
|
+
setup(k, { expose: P, emit: T }) {
|
|
98
|
+
const a = k, _ = w(
|
|
99
|
+
() => J(a, ["onUpdate:value", "value", "options", "loadData"])
|
|
100
|
+
), I = L(), V = T, u = O(), { value: h, updateValue: D } = Z(a, V), R = X("Cascader", a), { options: g, request: y, loading: v } = Y(a), C = w(() => {
|
|
101
|
+
const o = e(h);
|
|
102
|
+
if (!o?.length) return [];
|
|
103
|
+
const b = a.fieldNames?.label || "label", i = a.fieldNames?.value || "value";
|
|
104
|
+
function r(m, t) {
|
|
105
|
+
const s = [];
|
|
106
|
+
for (const p of m || []) {
|
|
107
|
+
if (t.find(
|
|
108
|
+
(M) => M === p[i]
|
|
109
|
+
) && s.push(p[b]), s.length === t.length)
|
|
110
|
+
return s;
|
|
111
|
+
p.children?.length && s.push(...r(p.children, t));
|
|
162
112
|
}
|
|
163
|
-
return
|
|
113
|
+
return s;
|
|
114
|
+
}
|
|
115
|
+
const n = [], c = Q(o[0]) ? o : [o];
|
|
116
|
+
for (const m of c) {
|
|
117
|
+
const t = r(g.value, m);
|
|
118
|
+
t.length && n.push(t);
|
|
164
119
|
}
|
|
165
|
-
|
|
166
|
-
for (const r of D)
|
|
167
|
-
l.push(i(y.value, r));
|
|
168
|
-
return l.length ? u(G, {
|
|
169
|
-
size: 4
|
|
170
|
-
}, ee(n = l.map((r, d) => u("span", {
|
|
171
|
-
key: d
|
|
172
|
-
}, [r.join(", ")]))) ? n : {
|
|
173
|
-
default: () => [n]
|
|
174
|
-
}) : u(C, null, [o.emptyText]);
|
|
120
|
+
return n;
|
|
175
121
|
});
|
|
176
|
-
function
|
|
177
|
-
|
|
122
|
+
function z() {
|
|
123
|
+
u.value?.focus?.();
|
|
178
124
|
}
|
|
179
|
-
function
|
|
180
|
-
|
|
125
|
+
function F() {
|
|
126
|
+
u.value?.blur?.();
|
|
181
127
|
}
|
|
182
|
-
return
|
|
183
|
-
focus:
|
|
184
|
-
blur:
|
|
185
|
-
request:
|
|
186
|
-
}), (
|
|
187
|
-
const
|
|
188
|
-
return
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
128
|
+
return P({
|
|
129
|
+
focus: z,
|
|
130
|
+
blur: F,
|
|
131
|
+
request: y
|
|
132
|
+
}), (o, b) => {
|
|
133
|
+
const i = U("Spin");
|
|
134
|
+
return o.mode === "read" ? (l(), d(S, { key: 0 }, [
|
|
135
|
+
C.value.length ? (l(), B(e($), {
|
|
136
|
+
key: 1,
|
|
137
|
+
size: 4
|
|
138
|
+
}, {
|
|
139
|
+
default: f(() => [
|
|
140
|
+
(l(!0), d(S, null, N(C.value, (r, n) => (l(), d("span", { key: n }, x(r.join(", ")), 1))), 128))
|
|
141
|
+
]),
|
|
142
|
+
_: 1
|
|
143
|
+
})) : (l(), d("span", ee, x(o.emptyText), 1))
|
|
144
|
+
], 64)) : (l(), B(e(H), E({ key: 1 }, _.value, {
|
|
145
|
+
ref: u.value,
|
|
146
|
+
value: e(h),
|
|
147
|
+
loading: e(v),
|
|
148
|
+
options: e(g),
|
|
149
|
+
placeholder: e(R),
|
|
150
|
+
"load-data": o.loadData ? e(y) : void 0,
|
|
151
|
+
"onUpdate:value": e(D)
|
|
152
|
+
}), K({ _: 2 }, [
|
|
153
|
+
N(I, (r, n) => ({
|
|
154
|
+
name: n,
|
|
155
|
+
fn: f((c) => [
|
|
156
|
+
j(o.$slots, n, q(G(c || {})))
|
|
157
|
+
])
|
|
158
|
+
})),
|
|
159
|
+
e(v) ? {
|
|
160
|
+
name: "notFoundContent",
|
|
161
|
+
fn: f(() => [
|
|
162
|
+
W(i, { size: "small" })
|
|
163
|
+
]),
|
|
164
|
+
key: "0"
|
|
165
|
+
} : void 0
|
|
166
|
+
]), 1040, ["value", "loading", "options", "placeholder", "load-data", "onUpdate:value"]));
|
|
212
167
|
};
|
|
213
168
|
}
|
|
214
169
|
});
|
|
215
170
|
export {
|
|
216
|
-
|
|
171
|
+
de as default
|
|
217
172
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent as C, computed as w, unref as m, createElementBlock as d, createBlock as B, openBlock as p, toDisplayString as f, withCtx as x, Fragment as b, renderList as v } from "vue";
|
|
2
2
|
import { Space as N } from "@aplus-frontend/antdv";
|
|
3
|
-
import { isArray as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
const P = /* @__PURE__ */ C({
|
|
3
|
+
import { isArray as S } from "lodash-unified";
|
|
4
|
+
const T = {
|
|
5
|
+
key: 0
|
|
6
|
+
}, R = /* @__PURE__ */ C({
|
|
8
7
|
name: "ApFieldCascaderRead",
|
|
9
8
|
__name: "read",
|
|
10
9
|
props: {
|
|
@@ -13,6 +12,9 @@ const P = /* @__PURE__ */ C({
|
|
|
13
12
|
},
|
|
14
13
|
class: {},
|
|
15
14
|
style: {},
|
|
15
|
+
emptyText: {
|
|
16
|
+
default: "--"
|
|
17
|
+
},
|
|
16
18
|
multiple: {
|
|
17
19
|
type: Boolean
|
|
18
20
|
},
|
|
@@ -112,9 +114,6 @@ const P = /* @__PURE__ */ C({
|
|
|
112
114
|
dropdownPrefixCls: {},
|
|
113
115
|
dropdownMenuColumnStyle: {},
|
|
114
116
|
loadingIcon: {},
|
|
115
|
-
emptyText: {
|
|
116
|
-
default: "--"
|
|
117
|
-
},
|
|
118
117
|
request: {},
|
|
119
118
|
lazy: {
|
|
120
119
|
type: Boolean
|
|
@@ -124,36 +123,38 @@ const P = /* @__PURE__ */ C({
|
|
|
124
123
|
type: Boolean
|
|
125
124
|
}
|
|
126
125
|
},
|
|
127
|
-
setup(
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
return l;
|
|
139
|
-
r.children?.length && l.push(...s(r.children, a));
|
|
126
|
+
setup(h) {
|
|
127
|
+
const a = h, i = w(() => {
|
|
128
|
+
const e = m(a.value);
|
|
129
|
+
if (!e?.length) return [];
|
|
130
|
+
const u = a.fieldNames?.label || "label", r = a.fieldNames?.value || "value";
|
|
131
|
+
function t(s, o) {
|
|
132
|
+
const n = [];
|
|
133
|
+
for (const l of s || []) {
|
|
134
|
+
if (o.find((g) => g === l[r]) && n.push(l[u]), n.length === o.length)
|
|
135
|
+
return n;
|
|
136
|
+
l.children?.length && n.push(...t(l.children, o));
|
|
140
137
|
}
|
|
141
|
-
return
|
|
138
|
+
return n;
|
|
139
|
+
}
|
|
140
|
+
const c = [], y = S(e[0]) ? e : [e];
|
|
141
|
+
for (const s of y) {
|
|
142
|
+
const o = t(a.options, s);
|
|
143
|
+
o.length && c.push(o);
|
|
142
144
|
}
|
|
143
|
-
|
|
144
|
-
for (const t of y)
|
|
145
|
-
i.push(s(e.options, t));
|
|
146
|
-
return i.length ? d(N, {
|
|
147
|
-
size: 4
|
|
148
|
-
}, S(p = i.map((t, a) => d("span", {
|
|
149
|
-
key: a
|
|
150
|
-
}, [t.join(", ")]))) ? p : {
|
|
151
|
-
default: () => [p]
|
|
152
|
-
}) : d(c, null, [e.emptyText]);
|
|
145
|
+
return c;
|
|
153
146
|
});
|
|
154
|
-
return (
|
|
147
|
+
return (e, u) => i.value.length ? (p(), B(m(N), {
|
|
148
|
+
key: 1,
|
|
149
|
+
size: 4
|
|
150
|
+
}, {
|
|
151
|
+
default: x(() => [(p(!0), d(b, null, v(i.value, (r, t) => (p(), d("span", {
|
|
152
|
+
key: t
|
|
153
|
+
}, f(r.join(", ")), 1))), 128))]),
|
|
154
|
+
_: 1
|
|
155
|
+
})) : (p(), d("span", T, f(e.emptyText), 1));
|
|
155
156
|
}
|
|
156
157
|
});
|
|
157
158
|
export {
|
|
158
|
-
|
|
159
|
+
R as default
|
|
159
160
|
};
|
|
@@ -2,7 +2,18 @@ import { ApFieldCheckboxProps } from '../interface';
|
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
import { FieldMode } from '..';
|
|
4
4
|
import { CheckboxOptionType } from '@aplus-frontend/antdv';
|
|
5
|
-
|
|
5
|
+
type CheckboxGroupSlots = {
|
|
6
|
+
label?: any;
|
|
7
|
+
default?: any;
|
|
8
|
+
};
|
|
9
|
+
declare function __VLS_template(): {
|
|
10
|
+
attrs: Partial<{}>;
|
|
11
|
+
slots: Readonly<CheckboxGroupSlots> & CheckboxGroupSlots;
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: any;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: DefineComponent<ApFieldCheckboxProps, {
|
|
6
17
|
request: () => void;
|
|
7
18
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
8
19
|
"update:value": (...args: any[]) => void;
|
|
@@ -14,4 +25,10 @@ declare const _default: DefineComponent<ApFieldCheckboxProps, {
|
|
|
14
25
|
options: (string | number | CheckboxOptionType)[];
|
|
15
26
|
emptyText: string;
|
|
16
27
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
29
|
export default _default;
|
|
30
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Spin as
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as O, computed as T, useSlots as _, ref as P, onMounted as U, createElementBlock as r, openBlock as o, Fragment as s, unref as e, createTextVNode as d, toDisplayString as c, createBlock as f, mergeProps as F, createSlots as N, renderList as z, withCtx as A, renderSlot as L, normalizeProps as j, guardReactiveProps as w } from "vue";
|
|
2
|
+
import { Spin as D, CheckboxGroup as E } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as G, isFunction as I, isNil as M } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getOptionValue as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useControllableValue as
|
|
11
|
-
const
|
|
6
|
+
import R from "../hooks/use-options.mjs";
|
|
7
|
+
import $ from "../style/index.mjs";
|
|
8
|
+
import { getOptionValue as H, getOptionLabel as J } from "./helper.mjs";
|
|
9
|
+
import { useNamespace as K } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useControllableValue as Q } from "../../hooks/useControllableValue.mjs";
|
|
11
|
+
const ne = /* @__PURE__ */ O({
|
|
12
12
|
name: "ApFieldCheckbox",
|
|
13
13
|
inheritAttrs: !1,
|
|
14
14
|
__name: "index",
|
|
@@ -16,6 +16,7 @@ const W = /* @__PURE__ */ V({
|
|
|
16
16
|
mode: { default: "edit" },
|
|
17
17
|
class: {},
|
|
18
18
|
style: {},
|
|
19
|
+
emptyText: { default: "--" },
|
|
19
20
|
defaultValue: {},
|
|
20
21
|
value: {},
|
|
21
22
|
onChange: {},
|
|
@@ -25,60 +26,58 @@ const W = /* @__PURE__ */ V({
|
|
|
25
26
|
options: { default: () => [] },
|
|
26
27
|
disabled: { type: Boolean, default: void 0 },
|
|
27
28
|
id: {},
|
|
28
|
-
emptyText: { default: "--" },
|
|
29
29
|
request: {},
|
|
30
30
|
vertical: { type: Boolean }
|
|
31
31
|
},
|
|
32
32
|
emits: ["update:value"],
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
33
|
+
setup(v, { expose: y, emit: k }) {
|
|
34
|
+
const x = k, t = v, h = T(
|
|
35
|
+
() => G(t, ["onUpdate:value", "value", "request", "vertical", "emptyText"])
|
|
36
|
+
), g = _(), { options: u, updateOptions: b } = R(t), { b: C, m: S } = K("field-checkbox"), V = $("field"), n = P(!1);
|
|
35
37
|
async function p() {
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
38
|
-
|
|
38
|
+
if (I(t.request))
|
|
39
|
+
return n.value = !0, t.request().then((a) => b(a)).finally(() => {
|
|
40
|
+
n.value = !1;
|
|
39
41
|
});
|
|
40
42
|
}
|
|
41
|
-
|
|
43
|
+
U(() => {
|
|
42
44
|
p();
|
|
43
45
|
});
|
|
44
|
-
const { value: i, updateValue:
|
|
46
|
+
const { value: i, updateValue: q } = Q(
|
|
45
47
|
t,
|
|
46
|
-
|
|
48
|
+
x,
|
|
47
49
|
{
|
|
48
50
|
defaultValue: []
|
|
49
51
|
}
|
|
50
52
|
);
|
|
51
|
-
return
|
|
53
|
+
return y({
|
|
52
54
|
request: p
|
|
53
|
-
}), (a,
|
|
54
|
-
e(
|
|
55
|
-
|
|
56
|
-
], 64)) : (o(),
|
|
57
|
-
|
|
55
|
+
}), (a, W) => a.mode === "read" ? (o(), r(s, { key: 0 }, [
|
|
56
|
+
e(M)(e(i)) ? (o(), r(s, { key: 0 }, [
|
|
57
|
+
d(c(t.emptyText), 1)
|
|
58
|
+
], 64)) : (o(), r(s, { key: 1 }, [
|
|
59
|
+
d(c(e(u)?.filter((l) => e(i).indexOf(e(H)(l)) > -1).map((l) => e(J)(l)).join("、") || t.emptyText), 1)
|
|
58
60
|
], 64))
|
|
59
|
-
], 64)) : (o(),
|
|
60
|
-
|
|
61
|
+
], 64)) : (o(), r(s, { key: 1 }, [
|
|
62
|
+
n.value ? (o(), f(e(D), {
|
|
61
63
|
key: 0,
|
|
62
64
|
size: "small"
|
|
63
|
-
})) : (o(),
|
|
64
|
-
|
|
65
|
-
e(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"onUpdate:value": e(C)
|
|
77
|
-
}
|
|
78
|
-
), null, 16, ["options", "value", "class", "onUpdate:value"]))
|
|
65
|
+
})) : (o(), f(e(E), F({ key: 1 }, h.value, {
|
|
66
|
+
options: e(u),
|
|
67
|
+
value: e(i),
|
|
68
|
+
class: [e(C)(), a.vertical ? e(S)("vertical") : null, e(V)],
|
|
69
|
+
"onUpdate:value": e(q)
|
|
70
|
+
}), N({ _: 2 }, [
|
|
71
|
+
z(g, (l, m) => ({
|
|
72
|
+
name: m,
|
|
73
|
+
fn: A((B) => [
|
|
74
|
+
L(a.$slots, m, j(w(B || {})))
|
|
75
|
+
])
|
|
76
|
+
}))
|
|
77
|
+
]), 1040, ["options", "value", "class", "onUpdate:value"]))
|
|
79
78
|
], 64));
|
|
80
79
|
}
|
|
81
80
|
});
|
|
82
81
|
export {
|
|
83
|
-
|
|
82
|
+
ne as default
|
|
84
83
|
};
|
|
@@ -8,6 +8,7 @@ const g = /* @__PURE__ */ r({
|
|
|
8
8
|
mode: { default: "edit" },
|
|
9
9
|
class: {},
|
|
10
10
|
style: {},
|
|
11
|
+
emptyText: { default: "--" },
|
|
11
12
|
defaultValue: {},
|
|
12
13
|
value: {},
|
|
13
14
|
onChange: {},
|
|
@@ -17,7 +18,6 @@ const g = /* @__PURE__ */ r({
|
|
|
17
18
|
options: { default: () => [] },
|
|
18
19
|
disabled: { type: Boolean, default: void 0 },
|
|
19
20
|
id: {},
|
|
20
|
-
emptyText: { default: "--" },
|
|
21
21
|
request: {},
|
|
22
22
|
vertical: { type: Boolean }
|
|
23
23
|
},
|