@aplus-frontend/ui 7.17.1 → 7.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +29 -31
- package/es/src/ag-grid/editable/form-item.vue.mjs +48 -48
- package/es/src/ag-grid/index.vue.mjs +180 -183
- package/es/src/ap-field/cascader/index.vue.mjs +64 -67
- package/es/src/ap-field/interface.d.ts +6 -1
- package/es/src/ap-field/select/index.vue.d.ts +1 -1
- package/es/src/ap-field/select/index.vue.mjs +139 -128
- package/es/src/ap-field/select/read.vue2.mjs +1 -0
- package/es/src/ap-form/interface.d.ts +18 -0
- package/es/src/ap-form/items/select/index.vue.d.ts +8 -6
- package/es/src/ap-form/items/switch/index.vue.d.ts +1 -1
- package/es/src/ap-table/constants.d.ts +7 -6
- package/es/src/check-card/index.vue2.mjs +61 -64
- package/es/src/hooks/index.d.ts +0 -1
- package/es/src/hooks/index.mjs +10 -12
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ap-field/cascader/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +6 -1
- package/lib/src/ap-field/select/index.vue.d.ts +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-form/interface.d.ts +18 -0
- package/lib/src/ap-form/items/select/index.vue.d.ts +8 -6
- package/lib/src/ap-form/items/switch/index.vue.d.ts +1 -1
- package/lib/src/ap-table/constants.d.ts +7 -6
- package/lib/src/check-card/index.vue2.js +1 -1
- package/lib/src/hooks/index.d.ts +0 -1
- package/lib/src/hooks/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
- package/es/src/hooks/useMessage.d.ts +0 -62
- package/es/src/hooks/useMessage.mjs +0 -86
- package/lib/src/hooks/useMessage.d.ts +0 -62
- package/lib/src/hooks/useMessage.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as A, computed as
|
|
2
|
-
import { Space as
|
|
1
|
+
import { defineComponent as A, computed as b, useSlots as L, ref as O, unref as e, createElementBlock as u, createBlock as w, openBlock as l, Fragment as B, toDisplayString as x, withCtx as m, renderList as S, mergeProps as U, createSlots as E, renderSlot as K, normalizeProps as j, guardReactiveProps as q, createVNode as G } from "vue";
|
|
2
|
+
import { Space as W, Cascader as $, Spin as H } from "@aplus-frontend/antdv";
|
|
3
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
|
-
const ee = { key: 0 },
|
|
8
|
+
const ee = { key: 0 }, pe = /* @__PURE__ */ A({
|
|
9
9
|
name: "ApFieldCascader",
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
@@ -94,79 +94,76 @@ const ee = { key: 0 }, de = /* @__PURE__ */ A({
|
|
|
94
94
|
loadData: { type: Boolean }
|
|
95
95
|
},
|
|
96
96
|
emits: ["update:value"],
|
|
97
|
-
setup(
|
|
98
|
-
const
|
|
99
|
-
() => J(
|
|
100
|
-
), I = L(), V =
|
|
101
|
-
const o = e(
|
|
97
|
+
setup(N, { expose: k, emit: P }) {
|
|
98
|
+
const n = N, T = b(
|
|
99
|
+
() => J(n, ["onUpdate:value", "value", "options", "loadData"])
|
|
100
|
+
), I = L(), V = P, i = O(), { value: f, updateValue: D } = Z(n, V), R = X("Cascader", n), { options: h, request: g, loading: y } = Y(n), v = b(() => {
|
|
101
|
+
const o = e(f);
|
|
102
102
|
if (!o?.length) return [];
|
|
103
|
-
const
|
|
104
|
-
function
|
|
105
|
-
const
|
|
106
|
-
for (const p of
|
|
103
|
+
const C = n.fieldNames?.label || "label", s = n.fieldNames?.value || "value";
|
|
104
|
+
function a(c, t) {
|
|
105
|
+
const r = [];
|
|
106
|
+
for (const p of c || []) {
|
|
107
107
|
if (t.find(
|
|
108
|
-
(M) => M === p[
|
|
109
|
-
) &&
|
|
110
|
-
return
|
|
111
|
-
p.children?.length &&
|
|
108
|
+
(M) => M === p[s]
|
|
109
|
+
) && r.push(p[C]), r.length === t.length)
|
|
110
|
+
return r;
|
|
111
|
+
p.children?.length && r.push(...a(p.children, t));
|
|
112
112
|
}
|
|
113
|
-
return
|
|
113
|
+
return r;
|
|
114
114
|
}
|
|
115
|
-
const
|
|
116
|
-
for (const
|
|
117
|
-
const t =
|
|
118
|
-
t.length &&
|
|
115
|
+
const d = [], F = Q(o[0]) ? o : [o];
|
|
116
|
+
for (const c of F) {
|
|
117
|
+
const t = a(h.value, c);
|
|
118
|
+
t.length && d.push(t);
|
|
119
119
|
}
|
|
120
|
-
return
|
|
120
|
+
return d;
|
|
121
121
|
});
|
|
122
|
-
function
|
|
123
|
-
|
|
122
|
+
function _() {
|
|
123
|
+
i.value?.focus?.();
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
125
|
+
function z() {
|
|
126
|
+
i.value?.blur?.();
|
|
127
127
|
}
|
|
128
|
-
return
|
|
129
|
-
focus:
|
|
130
|
-
blur:
|
|
131
|
-
request:
|
|
132
|
-
}), (o,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
} : void 0
|
|
166
|
-
]), 1040, ["value", "loading", "options", "placeholder", "load-data", "onUpdate:value"]));
|
|
167
|
-
};
|
|
128
|
+
return k({
|
|
129
|
+
focus: _,
|
|
130
|
+
blur: z,
|
|
131
|
+
request: g
|
|
132
|
+
}), (o, C) => o.mode === "read" ? (l(), u(B, { key: 0 }, [
|
|
133
|
+
v.value.length ? (l(), w(e(W), {
|
|
134
|
+
key: 1,
|
|
135
|
+
size: 4
|
|
136
|
+
}, {
|
|
137
|
+
default: m(() => [
|
|
138
|
+
(l(!0), u(B, null, S(v.value, (s, a) => (l(), u("span", { key: a }, x(s.join(", ")), 1))), 128))
|
|
139
|
+
]),
|
|
140
|
+
_: 1
|
|
141
|
+
})) : (l(), u("span", ee, x(o.emptyText), 1))
|
|
142
|
+
], 64)) : (l(), w(e($), U({ key: 1 }, T.value, {
|
|
143
|
+
ref: i.value,
|
|
144
|
+
value: e(f),
|
|
145
|
+
loading: e(y),
|
|
146
|
+
options: e(h),
|
|
147
|
+
placeholder: e(R),
|
|
148
|
+
"load-data": o.loadData ? e(g) : void 0,
|
|
149
|
+
"onUpdate:value": e(D)
|
|
150
|
+
}), E({ _: 2 }, [
|
|
151
|
+
S(I, (s, a) => ({
|
|
152
|
+
name: a,
|
|
153
|
+
fn: m((d) => [
|
|
154
|
+
K(o.$slots, a, j(q(d || {})))
|
|
155
|
+
])
|
|
156
|
+
})),
|
|
157
|
+
e(y) ? {
|
|
158
|
+
name: "notFoundContent",
|
|
159
|
+
fn: m(() => [
|
|
160
|
+
G(e(H), { size: "small" })
|
|
161
|
+
]),
|
|
162
|
+
key: "0"
|
|
163
|
+
} : void 0
|
|
164
|
+
]), 1040, ["value", "loading", "options", "placeholder", "load-data", "onUpdate:value"]));
|
|
168
165
|
}
|
|
169
166
|
});
|
|
170
167
|
export {
|
|
171
|
-
|
|
168
|
+
pe as default
|
|
172
169
|
};
|
|
@@ -203,10 +203,15 @@ export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'v
|
|
|
203
203
|
* @since 7.15.0
|
|
204
204
|
*/
|
|
205
205
|
fetchOnFocus?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* 是否在打开选项列表时请求列表数据
|
|
208
|
+
* @since 7.17.2
|
|
209
|
+
*/
|
|
210
|
+
fetchOnOpen?: boolean;
|
|
206
211
|
/**
|
|
207
212
|
* 是否延迟请求选项列表 true: 不请求选项; 'first-focus': 首次聚焦时触发网络请求
|
|
208
213
|
*/
|
|
209
|
-
lazy?: boolean | 'first-focus';
|
|
214
|
+
lazy?: boolean | 'first-focus' | 'first-open';
|
|
210
215
|
/**
|
|
211
216
|
* 添加一个名为全部的节点(只在多选的情况下有效)
|
|
212
217
|
*/
|
|
@@ -468,7 +468,7 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
|
|
|
468
468
|
disabled: boolean;
|
|
469
469
|
virtual: boolean;
|
|
470
470
|
autofocus: boolean;
|
|
471
|
-
lazy: boolean | "first-focus";
|
|
471
|
+
lazy: boolean | "first-focus" | "first-open";
|
|
472
472
|
loading: boolean;
|
|
473
473
|
bordered: boolean;
|
|
474
474
|
allowClear: boolean;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Select as
|
|
3
|
-
import { debounce as
|
|
1
|
+
import { defineComponent as fe, useSlots as me, ref as k, shallowRef as he, computed as s, onMounted as ve, watch as ye, unref as o, createVNode as m, createElementBlock as M, createBlock as C, openBlock as h, toDisplayString as N, mergeProps as ge, h as Ce, createSlots as be, withCtx as v, createElementVNode as x, normalizeClass as y, createCommentVNode as P, resolveDynamicComponent as L, withModifiers as we, renderList as Oe, renderSlot as Se, normalizeProps as Fe, guardReactiveProps as Be } from "vue";
|
|
2
|
+
import { Select as ke, Flex as T, Checkbox as q, Spin as Ne } from "@aplus-frontend/antdv";
|
|
3
|
+
import { debounce as xe, isFunction as z, isArray as Ve, isNil as Ae, omit as R, isNumber as Ie } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../utils/index.mjs";
|
|
6
|
-
import { useDevWarning as
|
|
6
|
+
import { useDevWarning as _e } from "../../utils/warning.mjs";
|
|
7
7
|
import "../../hooks/index.mjs";
|
|
8
|
-
import { useDefaultPlaceholder as
|
|
9
|
-
import
|
|
10
|
-
import { useSelectOptions as
|
|
11
|
-
import { isDef as
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
import { useLocale as
|
|
14
|
-
import { useControllableValue as
|
|
15
|
-
const
|
|
8
|
+
import { useDefaultPlaceholder as De } from "../hooks/use-default-placeholder.mjs";
|
|
9
|
+
import Me from "../style/index.mjs";
|
|
10
|
+
import { useSelectOptions as Pe } from "./use-select-options.mjs";
|
|
11
|
+
import { isDef as V } from "../../utils/is.mjs";
|
|
12
|
+
import { useNamespace as E } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useLocale as Le } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import { useControllableValue as Te } from "../../hooks/useControllableValue.mjs";
|
|
15
|
+
const qe = {
|
|
16
16
|
key: 0
|
|
17
|
-
},
|
|
17
|
+
}, ze = ["onClick"], et = /* @__PURE__ */ fe({
|
|
18
18
|
name: "ApFieldSelect",
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
|
@@ -159,6 +159,9 @@ const Te = {
|
|
|
159
159
|
type: Boolean,
|
|
160
160
|
default: void 0
|
|
161
161
|
},
|
|
162
|
+
fetchOnOpen: {
|
|
163
|
+
type: Boolean
|
|
164
|
+
},
|
|
162
165
|
lazy: {
|
|
163
166
|
type: [Boolean, String],
|
|
164
167
|
default: !1
|
|
@@ -177,199 +180,207 @@ const Te = {
|
|
|
177
180
|
}
|
|
178
181
|
},
|
|
179
182
|
emits: ["update:value"],
|
|
180
|
-
setup(
|
|
181
|
-
expose:
|
|
182
|
-
emit:
|
|
183
|
+
setup(U, {
|
|
184
|
+
expose: K,
|
|
185
|
+
emit: $
|
|
183
186
|
}) {
|
|
184
187
|
let r = 0;
|
|
185
|
-
const b =
|
|
186
|
-
deprecated:
|
|
187
|
-
} =
|
|
188
|
-
|
|
188
|
+
const b = me(), e = U, {
|
|
189
|
+
deprecated: j
|
|
190
|
+
} = _e("ApFieldSelect");
|
|
191
|
+
j(!V(e.refetchOnFocus), "refetchOnFocus", "fetchOnFocus");
|
|
189
192
|
const {
|
|
190
|
-
b:
|
|
191
|
-
} =
|
|
192
|
-
b:
|
|
193
|
-
} =
|
|
194
|
-
t:
|
|
195
|
-
} =
|
|
196
|
-
if (!
|
|
193
|
+
b: w
|
|
194
|
+
} = E("field-select"), {
|
|
195
|
+
b: d
|
|
196
|
+
} = E("field-select-popup-option"), H = Me("field"), A = k(!1), I = k(!1), {
|
|
197
|
+
t: _
|
|
198
|
+
} = Le(), W = xe((t) => {
|
|
199
|
+
if (!z(e.request))
|
|
197
200
|
return;
|
|
198
201
|
r += 1;
|
|
199
|
-
const
|
|
202
|
+
const n = r;
|
|
200
203
|
g([]), u.value = !0, e.request(t).then((l) => {
|
|
201
|
-
r ===
|
|
204
|
+
r === n && (g(l), u.value = !1);
|
|
202
205
|
});
|
|
203
|
-
}, e.searchDelay),
|
|
206
|
+
}, e.searchDelay), G = (t, n) => {
|
|
204
207
|
const l = e.fieldNames?.label || "label";
|
|
205
|
-
return typeof
|
|
208
|
+
return typeof n?.[l] == "string" && n[l].toLowerCase().indexOf(t.toLowerCase()) > -1;
|
|
206
209
|
}, {
|
|
207
|
-
options:
|
|
210
|
+
options: p,
|
|
208
211
|
updateOptions: g
|
|
209
|
-
} =
|
|
212
|
+
} = Pe(e), O = he(), u = k(e?.loading || !1), J = $, Q = s(() => e.fetchOnFocus ?? e.refetchOnFocus), X = s(() => {
|
|
210
213
|
if (e.multiple)
|
|
211
214
|
return e.tokenSeparators ? "tags" : "multiple";
|
|
212
215
|
});
|
|
213
|
-
async function
|
|
214
|
-
if (!
|
|
216
|
+
async function i(t = !0) {
|
|
217
|
+
if (!z(e.request))
|
|
215
218
|
return;
|
|
216
219
|
u.value = !0, r += 1;
|
|
217
|
-
const
|
|
220
|
+
const n = r;
|
|
218
221
|
try {
|
|
219
222
|
t && g([]);
|
|
220
223
|
const l = await e.request(void 0, e.params);
|
|
221
|
-
if (
|
|
224
|
+
if (n !== r)
|
|
222
225
|
return;
|
|
223
226
|
g(l);
|
|
224
227
|
} finally {
|
|
225
228
|
u.value = !1;
|
|
226
229
|
}
|
|
227
230
|
}
|
|
228
|
-
function
|
|
229
|
-
!A.value && r === 0 && e.lazy === "first-focus" ?
|
|
231
|
+
function Y(t) {
|
|
232
|
+
!A.value && r === 0 && e.lazy === "first-focus" ? i() : Q.value && !u.value && i(!0), e.onFocus?.(t), A.value = !0;
|
|
233
|
+
}
|
|
234
|
+
function Z(t) {
|
|
235
|
+
if (!t) {
|
|
236
|
+
e.onDropdownVisibleChange?.(t);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
!I.value && r === 0 && e.lazy === "first-open" ? i() : e.fetchOnOpen && !u.value && i(!0), e.onDropdownVisibleChange?.(t), I.value = !0;
|
|
230
240
|
}
|
|
231
|
-
|
|
241
|
+
ve(() => {
|
|
232
242
|
if (!e.lazy) {
|
|
233
|
-
|
|
243
|
+
i();
|
|
234
244
|
return;
|
|
235
245
|
}
|
|
236
|
-
}),
|
|
237
|
-
|
|
246
|
+
}), ye(() => e.params, () => {
|
|
247
|
+
i();
|
|
238
248
|
}, {
|
|
239
249
|
deep: !0
|
|
240
250
|
});
|
|
241
251
|
const {
|
|
242
|
-
value:
|
|
243
|
-
updateValue:
|
|
244
|
-
} =
|
|
245
|
-
const t =
|
|
252
|
+
value: f,
|
|
253
|
+
updateValue: S
|
|
254
|
+
} = Te(e, J), ee = De("Select", e), te = s(() => {
|
|
255
|
+
const t = o(f);
|
|
246
256
|
if (!t)
|
|
247
257
|
return e.emptyText;
|
|
248
|
-
const
|
|
249
|
-
return
|
|
250
|
-
}),
|
|
251
|
-
const t = !!e?.showSearch,
|
|
258
|
+
const n = e.fieldNames?.label || "label", l = e.fieldNames?.value || "value";
|
|
259
|
+
return Ve(t) ? t.map((a) => o(p).find((pe) => pe[l] === a)?.[n]).filter(Boolean).join("、") || e.emptyText : o(p).find((a) => a[l] === t)?.[n] || e.emptyText;
|
|
260
|
+
}), ne = s(() => {
|
|
261
|
+
const t = !!e?.showSearch, n = e.searchMode;
|
|
252
262
|
let l = {};
|
|
253
|
-
return t && (l =
|
|
263
|
+
return t && (l = n === "request" ? {
|
|
254
264
|
defaultActiveFirstOption: !1,
|
|
255
|
-
onSearch:
|
|
265
|
+
onSearch: W,
|
|
256
266
|
notFoundContent: u.value ? void 0 : null,
|
|
257
267
|
filterOption: !1,
|
|
258
268
|
suffixIcon: null
|
|
259
269
|
} : {
|
|
260
|
-
filterOption:
|
|
270
|
+
filterOption: Ae(e?.filterOption) ? G : e?.filterOption
|
|
261
271
|
}), {
|
|
262
|
-
...R(e, ["mode", "value", "onUpdate:value", "onSearch", "request", "searchMode", "onFocus", "onBeforeSelect"]),
|
|
263
|
-
placeholder:
|
|
272
|
+
...R(e, ["mode", "value", "onUpdate:value", "onSearch", "request", "searchMode", "onFocus", "onBeforeSelect", "onDropdownVisibleChange"]),
|
|
273
|
+
placeholder: o(ee),
|
|
264
274
|
...l
|
|
265
275
|
};
|
|
266
|
-
}),
|
|
267
|
-
function
|
|
268
|
-
|
|
276
|
+
}), le = s(() => p.value.map((t) => t[e.fieldNames?.value || "value"])), F = s(() => p.value.filter((t) => !t.disabled).map((t) => t[e.fieldNames?.value || "value"])), D = s(() => !e.multiple || V(e.maxCount) ? !1 : Ie(e.addAll) ? le.value.length >= e.addAll : !!e.addAll), oe = s(() => e.multiple && e.allowOnlySelect && (!V(e.maxCount) || e.maxCount >= 1));
|
|
277
|
+
function ae() {
|
|
278
|
+
O.value?.focus();
|
|
269
279
|
}
|
|
270
|
-
function
|
|
271
|
-
|
|
280
|
+
function se() {
|
|
281
|
+
O.value?.blur();
|
|
272
282
|
}
|
|
273
|
-
function
|
|
274
|
-
const l = e.fieldNames?.[
|
|
275
|
-
return t[l];
|
|
283
|
+
function B(t, n) {
|
|
284
|
+
const l = e.fieldNames?.[n] ?? n;
|
|
285
|
+
return l === "groupLabel" ? t[l] ?? t.label : t[l];
|
|
276
286
|
}
|
|
277
|
-
function
|
|
278
|
-
const
|
|
279
|
-
|
|
287
|
+
function ue(t) {
|
|
288
|
+
const n = B(t, "value");
|
|
289
|
+
S(e.multiple ? [n] : n), e.onChange?.([n], [t]);
|
|
280
290
|
}
|
|
281
|
-
function
|
|
282
|
-
return b.option ?
|
|
283
|
-
class:
|
|
284
|
-
}, [b.option(t)]) :
|
|
285
|
-
class:
|
|
286
|
-
}, [
|
|
291
|
+
function re(t) {
|
|
292
|
+
return b.option ? m("div", {
|
|
293
|
+
class: d("custom")
|
|
294
|
+
}, [b.option(t)]) : m("span", {
|
|
295
|
+
class: d("label")
|
|
296
|
+
}, [B(t, t.options?.length ? "groupLabel" : "label")]);
|
|
287
297
|
}
|
|
288
|
-
const
|
|
289
|
-
const t =
|
|
290
|
-
return
|
|
291
|
-
}),
|
|
292
|
-
const t =
|
|
293
|
-
return l > 0 && l <
|
|
298
|
+
const ie = s(() => {
|
|
299
|
+
const t = o(f) || [], n = F.value;
|
|
300
|
+
return n.length > 0 && n.every((l) => t.includes(l));
|
|
301
|
+
}), ce = s(() => {
|
|
302
|
+
const t = o(f) || [], n = F.value, l = n.filter((c) => t.includes(c)).length;
|
|
303
|
+
return l > 0 && l < n.length;
|
|
294
304
|
});
|
|
295
|
-
function
|
|
296
|
-
const t = new Set(
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
|
|
305
|
+
function de() {
|
|
306
|
+
const t = new Set(o(f) || []), n = F.value;
|
|
307
|
+
n.length > 0 && n.every((a) => t.has(a)) ? n.forEach((a) => t.delete(a)) : n.forEach((a) => t.add(a));
|
|
308
|
+
const c = p.value.filter((a) => t.has(a[e.fieldNames?.value || "value"]));
|
|
309
|
+
S([...t]), e.onChange?.([...t], c);
|
|
300
310
|
}
|
|
301
|
-
return
|
|
302
|
-
focus:
|
|
303
|
-
blur:
|
|
304
|
-
request:
|
|
305
|
-
}), (t,
|
|
311
|
+
return K({
|
|
312
|
+
focus: ae,
|
|
313
|
+
blur: se,
|
|
314
|
+
request: i
|
|
315
|
+
}), (t, n) => t.mode === "read" ? (h(), M("span", qe, N(te.value), 1)) : (h(), C(o(ke), ge({
|
|
306
316
|
key: 1,
|
|
307
317
|
ref_key: "selectRef",
|
|
308
|
-
ref:
|
|
318
|
+
ref: O,
|
|
309
319
|
"allow-clear": ""
|
|
310
|
-
},
|
|
311
|
-
mode:
|
|
312
|
-
value:
|
|
313
|
-
options:
|
|
320
|
+
}, ne.value, {
|
|
321
|
+
mode: X.value,
|
|
322
|
+
value: o(f),
|
|
323
|
+
options: o(p),
|
|
314
324
|
loading: u.value,
|
|
315
|
-
"menu-item-selected-icon":
|
|
316
|
-
"popup-class-name": `${
|
|
317
|
-
"onUpdate:value":
|
|
318
|
-
onFocus:
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
325
|
+
"menu-item-selected-icon": Ce("span"),
|
|
326
|
+
"popup-class-name": `${o(w)("popup")} ${o(H)}`,
|
|
327
|
+
"onUpdate:value": o(S),
|
|
328
|
+
onFocus: Y,
|
|
329
|
+
onDropdownVisibleChange: Z
|
|
330
|
+
}), be({
|
|
331
|
+
option: v((l) => [x("div", {
|
|
332
|
+
class: y(o(d)("outter"))
|
|
333
|
+
}, [m(o(T), {
|
|
323
334
|
justify: "space-between",
|
|
324
335
|
align: "center",
|
|
325
|
-
class:
|
|
336
|
+
class: y(o(d)("wrapper")),
|
|
326
337
|
gap: 8
|
|
327
338
|
}, {
|
|
328
|
-
default:
|
|
339
|
+
default: v(() => [m(o(T), {
|
|
329
340
|
gap: 8,
|
|
330
341
|
align: "center",
|
|
331
|
-
class:
|
|
342
|
+
class: y(o(d)("content-wrapper"))
|
|
332
343
|
}, {
|
|
333
|
-
default:
|
|
344
|
+
default: v(() => [D.value ? (h(), C(o(q), {
|
|
334
345
|
key: 0,
|
|
335
|
-
checked:
|
|
336
|
-
}, null, 8, ["checked"])) : P("", !0), (
|
|
346
|
+
checked: o(f)?.includes(B(l, "value"))
|
|
347
|
+
}, null, 8, ["checked"])) : P("", !0), (h(), C(L(re(l))))]),
|
|
337
348
|
_: 2
|
|
338
|
-
}, 1032, ["class"]), oe.value && !l?.disabled ? (
|
|
349
|
+
}, 1032, ["class"]), oe.value && !l?.disabled ? (h(), M("span", {
|
|
339
350
|
key: 0,
|
|
340
|
-
class:
|
|
341
|
-
onClick:
|
|
342
|
-
},
|
|
351
|
+
class: y(o(d)("action")),
|
|
352
|
+
onClick: we(() => ue(l), ["stop"])
|
|
353
|
+
}, N(o(_)("ap.field.chooseOnly")), 11, ze)) : P("", !0)]),
|
|
343
354
|
_: 2
|
|
344
355
|
}, 1032, ["class"])], 2)]),
|
|
345
356
|
_: 2
|
|
346
|
-
}, [
|
|
347
|
-
name:
|
|
348
|
-
fn:
|
|
357
|
+
}, [Oe(o(R)(b, ["option"]), (l, c) => ({
|
|
358
|
+
name: c,
|
|
359
|
+
fn: v((a) => [Se(t.$slots, c, Fe(Be(a || {})))])
|
|
349
360
|
})), u.value ? {
|
|
350
361
|
name: "notFoundContent",
|
|
351
|
-
fn:
|
|
362
|
+
fn: v(() => [m(o(Ne), {
|
|
352
363
|
size: "small"
|
|
353
364
|
})]),
|
|
354
365
|
key: "0"
|
|
355
|
-
} : void 0,
|
|
366
|
+
} : void 0, D.value ? {
|
|
356
367
|
name: "dropdownRender",
|
|
357
|
-
fn:
|
|
368
|
+
fn: v(({
|
|
358
369
|
menuNode: l
|
|
359
|
-
}) => [
|
|
370
|
+
}) => [x("div", {
|
|
360
371
|
tabindex: -1,
|
|
361
|
-
class:
|
|
362
|
-
onClick:
|
|
363
|
-
}, [
|
|
364
|
-
checked:
|
|
365
|
-
indeterminate:
|
|
366
|
-
}, null, 8, ["checked", "indeterminate"]),
|
|
367
|
-
class:
|
|
368
|
-
},
|
|
372
|
+
class: y(o(w)("popup-all-option")),
|
|
373
|
+
onClick: de
|
|
374
|
+
}, [m(o(q), {
|
|
375
|
+
checked: ie.value,
|
|
376
|
+
indeterminate: ce.value
|
|
377
|
+
}, null, 8, ["checked", "indeterminate"]), x("span", {
|
|
378
|
+
class: y(o(w)("popup-all-option-label"))
|
|
379
|
+
}, N(o(_)("ap.field.selectAll")), 3)], 2), (h(), C(L(l)))]),
|
|
369
380
|
key: "1"
|
|
370
381
|
} : void 0]), 1040, ["mode", "value", "options", "loading", "menu-item-selected-icon", "popup-class-name", "onUpdate:value"]));
|
|
371
382
|
}
|
|
372
383
|
});
|
|
373
384
|
export {
|
|
374
|
-
|
|
385
|
+
et as default
|
|
375
386
|
};
|
|
@@ -91,6 +91,7 @@ const f = { key: 0 }, C = /* @__PURE__ */ i({
|
|
|
91
91
|
searchMode: {},
|
|
92
92
|
refetchOnFocus: { type: Boolean },
|
|
93
93
|
fetchOnFocus: { type: Boolean },
|
|
94
|
+
fetchOnOpen: { type: Boolean },
|
|
94
95
|
lazy: { type: [Boolean, String] },
|
|
95
96
|
addAll: { type: [Boolean, Number] },
|
|
96
97
|
params: {},
|
|
@@ -171,8 +171,22 @@ export type ApFormListProps = {
|
|
|
171
171
|
transform?: ApFormItemTransformType;
|
|
172
172
|
};
|
|
173
173
|
export type ApFormSearchFormProps = ApFormProps & {
|
|
174
|
+
/**
|
|
175
|
+
* 是否展开
|
|
176
|
+
* @deprecated 已废弃
|
|
177
|
+
*/
|
|
174
178
|
collapse?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* 默认情况下是否展开
|
|
181
|
+
* @deprecated 已废弃
|
|
182
|
+
*/
|
|
175
183
|
defaultCollapse?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* 展开关闭时的回调
|
|
186
|
+
* @deprecated 已废弃
|
|
187
|
+
* @param collapse
|
|
188
|
+
* @returns
|
|
189
|
+
*/
|
|
176
190
|
'onUpdate:collapse'?: (collapse?: boolean) => void;
|
|
177
191
|
searchText?: string;
|
|
178
192
|
resetText?: string;
|
|
@@ -180,6 +194,10 @@ export type ApFormSearchFormProps = ApFormProps & {
|
|
|
180
194
|
onReset?: () => void;
|
|
181
195
|
customReset?: boolean;
|
|
182
196
|
extraInAction?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* 是否是强制展开的(即无法关闭)
|
|
199
|
+
* @deprecated 已废弃
|
|
200
|
+
*/
|
|
183
201
|
forceExpand?: boolean;
|
|
184
202
|
countPerRow?: number;
|
|
185
203
|
submitLoading?: boolean;
|