@aplus-frontend/ui 7.17.0 → 7.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-field/cascader/index.vue.mjs +86 -131
- package/es/src/ap-field/cascader/read.vue2.mjs +36 -35
- package/es/src/ap-field/checkbox/index.vue.d.ts +18 -1
- package/es/src/ap-field/checkbox/index.vue.mjs +42 -43
- package/es/src/ap-field/checkbox/read.vue2.mjs +1 -1
- package/es/src/ap-field/date/index.vue.mjs +48 -48
- package/es/src/ap-field/date/read.vue2.mjs +1 -1
- package/es/src/ap-field/date-range/index.vue.mjs +31 -31
- package/es/src/ap-field/date-range/read.vue2.mjs +1 -1
- package/es/src/ap-field/interface.d.ts +7 -22
- package/es/src/ap-field/number/index.vue.mjs +36 -34
- package/es/src/ap-field/number/read.vue2.mjs +1 -1
- package/es/src/ap-field/radio/index.vue.mjs +34 -42
- package/es/src/ap-field/radio/read.vue2.mjs +1 -1
- package/es/src/ap-field/rate/index.vue.mjs +23 -23
- package/es/src/ap-field/second/index.vue.mjs +27 -29
- package/es/src/ap-field/second/read.vue2.mjs +2 -2
- package/es/src/ap-field/segmented/index.vue.mjs +37 -37
- package/es/src/ap-field/select/index.vue.mjs +90 -92
- package/es/src/ap-field/select/read.vue2.mjs +1 -1
- package/es/src/ap-field/slider/index.vue.mjs +35 -37
- package/es/src/ap-field/switch/index.vue.mjs +38 -38
- package/es/src/ap-field/switch/read.vue2.mjs +3 -3
- package/es/src/ap-field/text/index.vue.d.ts +478 -3
- package/es/src/ap-field/text/index.vue2.mjs +47 -46
- package/es/src/ap-field/text/password.vue.d.ts +549 -3
- package/es/src/ap-field/text/password.vue.mjs +61 -56
- package/es/src/ap-field/text/read-password.vue2.mjs +16 -16
- package/es/src/ap-field/text/read.vue2.mjs +1 -1
- package/es/src/ap-field/text-area/index.vue.mjs +29 -31
- package/es/src/ap-field/text-area/read.vue2.mjs +1 -1
- package/es/src/ap-field/tree-select/index.vue.mjs +47 -47
- package/es/src/ap-field/tree-select/read.vue2.mjs +3 -3
- package/es/src/ap-form/drawer-form/index.vue.mjs +99 -90
- package/es/src/ap-form/hooks/use-regist-form.d.ts +7 -0
- package/es/src/ap-form/hooks/use-regist-form.mjs +24 -0
- package/es/src/ap-form/item/index.vue.d.ts +6 -6
- package/es/src/ap-form/item/index.vue.mjs +85 -94
- package/es/src/ap-form/item-group/index.vue.mjs +14 -14
- package/es/src/ap-form/items/cascader/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/checkbox/index.vue.d.ts +159 -47
- package/es/src/ap-form/items/date/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/date-range/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/switch/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/index.vue.d.ts +476 -4
- package/es/src/ap-form/items/text/password.vue.d.ts +547 -4
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
- package/es/src/ap-form/list/index.vue.mjs +29 -34
- package/es/src/ap-form/modal-form/index.vue.mjs +77 -68
- package/es/src/ap-form/set/index.vue.d.ts +2 -4
- package/es/src/ap-form/set/index.vue.mjs +23 -18
- package/es/src/ap-grid/index.vue.mjs +1 -1
- package/es/src/ap-table/constants.d.ts +593 -31
- package/es/src/ap-table/utils.d.ts +1 -1
- package/es/src/business/batch-input-group/index.vue.d.ts +240 -3
- package/es/src/business/batch-input-group/index.vue.mjs +1 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-field/cascader/index.vue.js +1 -1
- package/lib/src/ap-field/cascader/read.vue2.js +1 -1
- package/lib/src/ap-field/checkbox/index.vue.d.ts +18 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/checkbox/read.vue2.js +1 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date/read.vue2.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/read.vue2.js +1 -1
- package/lib/src/ap-field/interface.d.ts +7 -22
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/number/read.vue2.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/radio/read.vue2.js +1 -1
- package/lib/src/ap-field/rate/index.vue.js +1 -1
- package/lib/src/ap-field/second/index.vue.js +1 -1
- package/lib/src/ap-field/second/read.vue2.js +1 -1
- package/lib/src/ap-field/segmented/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/select/read.vue2.js +1 -1
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/switch/read.vue2.js +1 -1
- package/lib/src/ap-field/text/index.vue.d.ts +478 -3
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.d.ts +549 -3
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text/read-password.vue2.js +1 -1
- package/lib/src/ap-field/text/read.vue2.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/text-area/read.vue2.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/hooks/use-regist-form.d.ts +7 -0
- package/lib/src/ap-form/hooks/use-regist-form.js +1 -0
- package/lib/src/ap-form/item/index.vue.d.ts +6 -6
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/item-group/index.vue.js +1 -1
- package/lib/src/ap-form/items/cascader/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/checkbox/index.vue.d.ts +159 -47
- package/lib/src/ap-form/items/date/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/select/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/switch/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/index.vue.d.ts +476 -4
- package/lib/src/ap-form/items/text/password.vue.d.ts +547 -4
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
- package/lib/src/ap-form/list/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/set/index.vue.d.ts +2 -4
- package/lib/src/ap-form/set/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +593 -31
- package/lib/src/ap-table/utils.d.ts +1 -1
- package/lib/src/business/batch-input-group/index.vue.d.ts +240 -3
- package/lib/src/business/batch-input-group/index.vue.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Select as
|
|
3
|
-
import { debounce as
|
|
1
|
+
import { defineComponent as de, useSlots as pe, ref as _, shallowRef as fe, computed as s, onMounted as me, watch as he, unref as n, createVNode as f, createElementBlock as M, createBlock as C, openBlock as m, toDisplayString as B, mergeProps as ve, h as ye, createSlots as ge, withCtx as h, createElementVNode as N, normalizeClass as v, createCommentVNode as P, resolveDynamicComponent as D, withModifiers as Ce, renderList as be, renderSlot as Se, normalizeProps as we, guardReactiveProps as Fe } from "vue";
|
|
2
|
+
import { Select as Oe, Flex as T, Checkbox as q, Spin as ke } from "@aplus-frontend/antdv";
|
|
3
|
+
import { debounce as Be, isFunction as L, isArray as Ne, isNil as xe, omit as R, isNumber as Ae } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../utils/index.mjs";
|
|
6
|
-
import { useDevWarning as
|
|
6
|
+
import { useDevWarning as Ve } from "../../utils/warning.mjs";
|
|
7
7
|
import "../../hooks/index.mjs";
|
|
8
|
-
import { useDefaultPlaceholder as
|
|
9
|
-
import
|
|
8
|
+
import { useDefaultPlaceholder as Ie } from "../hooks/use-default-placeholder.mjs";
|
|
9
|
+
import _e from "../style/index.mjs";
|
|
10
10
|
import { useSelectOptions as Me } from "./use-select-options.mjs";
|
|
11
11
|
import { isDef as x } from "../../utils/is.mjs";
|
|
12
|
-
import { useNamespace as
|
|
12
|
+
import { useNamespace as z } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
13
|
import { useLocale as Pe } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
|
-
import { useControllableValue as
|
|
15
|
-
const
|
|
14
|
+
import { useControllableValue as De } from "../../hooks/useControllableValue.mjs";
|
|
15
|
+
const Te = {
|
|
16
16
|
key: 0
|
|
17
|
-
},
|
|
17
|
+
}, qe = ["onClick"], Ye = /* @__PURE__ */ de({
|
|
18
18
|
name: "ApFieldSelect",
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
|
@@ -23,6 +23,9 @@ const qe = {
|
|
|
23
23
|
},
|
|
24
24
|
class: {},
|
|
25
25
|
style: {},
|
|
26
|
+
emptyText: {
|
|
27
|
+
default: "--"
|
|
28
|
+
},
|
|
26
29
|
defaultValue: {},
|
|
27
30
|
notFoundContent: {},
|
|
28
31
|
suffixIcon: {},
|
|
@@ -138,9 +141,6 @@ const qe = {
|
|
|
138
141
|
showAction: {},
|
|
139
142
|
onPopupScroll: {},
|
|
140
143
|
onInputKeyDown: {},
|
|
141
|
-
emptyText: {
|
|
142
|
-
default: "--"
|
|
143
|
-
},
|
|
144
144
|
request: {},
|
|
145
145
|
multiple: {
|
|
146
146
|
type: Boolean,
|
|
@@ -177,41 +177,41 @@ const qe = {
|
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
179
|
emits: ["update:value"],
|
|
180
|
-
setup(
|
|
181
|
-
expose:
|
|
180
|
+
setup(E, {
|
|
181
|
+
expose: U,
|
|
182
182
|
emit: K
|
|
183
183
|
}) {
|
|
184
184
|
let r = 0;
|
|
185
|
-
const
|
|
186
|
-
deprecated:
|
|
187
|
-
} =
|
|
188
|
-
|
|
185
|
+
const b = pe(), e = E, {
|
|
186
|
+
deprecated: $
|
|
187
|
+
} = Ve("ApFieldSelect");
|
|
188
|
+
$(!x(e.refetchOnFocus), "refetchOnFocus", "fetchOnFocus");
|
|
189
189
|
const {
|
|
190
|
-
b
|
|
191
|
-
} =
|
|
190
|
+
b: S
|
|
191
|
+
} = z("field-select"), {
|
|
192
192
|
b: c
|
|
193
|
-
} =
|
|
194
|
-
t:
|
|
195
|
-
} = Pe(),
|
|
196
|
-
if (!
|
|
193
|
+
} = z("field-select-popup-option"), j = _e("field"), A = _(!1), {
|
|
194
|
+
t: V
|
|
195
|
+
} = Pe(), H = Be((t) => {
|
|
196
|
+
if (!L(e.request))
|
|
197
197
|
return;
|
|
198
198
|
r += 1;
|
|
199
199
|
const o = r;
|
|
200
200
|
g([]), u.value = !0, e.request(t).then((l) => {
|
|
201
201
|
r === o && (g(l), u.value = !1);
|
|
202
202
|
});
|
|
203
|
-
}, e.searchDelay),
|
|
203
|
+
}, e.searchDelay), W = (t, o) => {
|
|
204
204
|
const l = e.fieldNames?.label || "label";
|
|
205
205
|
return typeof o?.[l] == "string" && o[l].toLowerCase().indexOf(t.toLowerCase()) > -1;
|
|
206
206
|
}, {
|
|
207
207
|
options: d,
|
|
208
208
|
updateOptions: g
|
|
209
|
-
} = Me(e), w =
|
|
209
|
+
} = Me(e), w = fe(), u = _(e?.loading || !1), G = K, J = s(() => e.fetchOnFocus ?? e.refetchOnFocus), Q = s(() => {
|
|
210
210
|
if (e.multiple)
|
|
211
211
|
return e.tokenSeparators ? "tags" : "multiple";
|
|
212
212
|
});
|
|
213
213
|
async function y(t = !0) {
|
|
214
|
-
if (!
|
|
214
|
+
if (!L(e.request))
|
|
215
215
|
return;
|
|
216
216
|
u.value = !0, r += 1;
|
|
217
217
|
const o = r;
|
|
@@ -225,153 +225,151 @@ const qe = {
|
|
|
225
225
|
u.value = !1;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
!
|
|
228
|
+
function X(t) {
|
|
229
|
+
!A.value && r === 0 && e.lazy === "first-focus" ? y() : J.value && !u.value && y(!0), e.onFocus?.(t), A.value = !0;
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
me(() => {
|
|
232
232
|
if (!e.lazy) {
|
|
233
233
|
y();
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
|
-
}),
|
|
236
|
+
}), he(() => e.params, () => {
|
|
237
237
|
y();
|
|
238
238
|
}, {
|
|
239
239
|
deep: !0
|
|
240
240
|
});
|
|
241
241
|
const {
|
|
242
242
|
value: p,
|
|
243
|
-
updateValue:
|
|
244
|
-
} =
|
|
243
|
+
updateValue: F
|
|
244
|
+
} = De(e, G), Y = Ie("Select", e), Z = s(() => {
|
|
245
245
|
const t = n(p);
|
|
246
246
|
if (!t)
|
|
247
247
|
return e.emptyText;
|
|
248
248
|
const o = e.fieldNames?.label || "label", l = e.fieldNames?.value || "value";
|
|
249
|
-
return
|
|
250
|
-
}),
|
|
249
|
+
return Ne(t) ? t.map((a) => n(d).find((ce) => ce[l] === a)?.[o]).filter(Boolean).join("、") || e.emptyText : n(d).find((a) => a[l] === t)?.[o] || e.emptyText;
|
|
250
|
+
}), ee = s(() => {
|
|
251
251
|
const t = !!e?.showSearch, o = e.searchMode;
|
|
252
252
|
let l = {};
|
|
253
253
|
return t && (l = o === "request" ? {
|
|
254
254
|
defaultActiveFirstOption: !1,
|
|
255
|
-
onSearch:
|
|
255
|
+
onSearch: H,
|
|
256
256
|
notFoundContent: u.value ? void 0 : null,
|
|
257
257
|
filterOption: !1,
|
|
258
258
|
suffixIcon: null
|
|
259
259
|
} : {
|
|
260
|
-
filterOption:
|
|
260
|
+
filterOption: xe(e?.filterOption) ? W : e?.filterOption
|
|
261
261
|
}), {
|
|
262
|
-
...
|
|
263
|
-
placeholder: n(
|
|
262
|
+
...R(e, ["mode", "value", "onUpdate:value", "onSearch", "request", "searchMode", "onFocus", "onBeforeSelect"]),
|
|
263
|
+
placeholder: n(Y),
|
|
264
264
|
...l
|
|
265
265
|
};
|
|
266
|
-
}),
|
|
267
|
-
function
|
|
266
|
+
}), te = s(() => d.value.map((t) => t[e.fieldNames?.value || "value"])), O = s(() => d.value.filter((t) => !t.disabled).map((t) => t[e.fieldNames?.value || "value"])), I = s(() => !e.multiple || x(e.maxCount) ? !1 : Ae(e.addAll) ? te.value.length >= e.addAll : !!e.addAll), oe = s(() => e.multiple && e.allowOnlySelect && (!x(e.maxCount) || e.maxCount >= 1));
|
|
267
|
+
function le() {
|
|
268
268
|
w.value?.focus();
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function ne() {
|
|
271
271
|
w.value?.blur();
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function k(t, o) {
|
|
274
274
|
const l = e.fieldNames?.[o] ?? o;
|
|
275
275
|
return t[l];
|
|
276
276
|
}
|
|
277
|
-
function
|
|
278
|
-
const o =
|
|
279
|
-
|
|
277
|
+
function ae(t) {
|
|
278
|
+
const o = k(t, "value");
|
|
279
|
+
F(e.multiple ? [o] : o), e.onChange?.([o], [t]);
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
return
|
|
281
|
+
function se(t) {
|
|
282
|
+
return b.option ? f("div", {
|
|
283
283
|
class: c("custom")
|
|
284
|
-
}, [
|
|
284
|
+
}, [b.option(t)]) : f("span", {
|
|
285
285
|
class: c("label")
|
|
286
|
-
}, [
|
|
286
|
+
}, [k(t, "label")]);
|
|
287
287
|
}
|
|
288
|
-
const
|
|
289
|
-
const t = n(p) || [], o =
|
|
288
|
+
const ue = s(() => {
|
|
289
|
+
const t = n(p) || [], o = O.value;
|
|
290
290
|
return o.length > 0 && o.every((l) => t.includes(l));
|
|
291
|
-
}),
|
|
292
|
-
const t = n(p) || [], o =
|
|
291
|
+
}), re = s(() => {
|
|
292
|
+
const t = n(p) || [], o = O.value, l = o.filter((i) => t.includes(i)).length;
|
|
293
293
|
return l > 0 && l < o.length;
|
|
294
294
|
});
|
|
295
|
-
function
|
|
296
|
-
const t = new Set(n(p) || []), o =
|
|
295
|
+
function ie() {
|
|
296
|
+
const t = new Set(n(p) || []), o = O.value;
|
|
297
297
|
o.length > 0 && o.every((a) => t.has(a)) ? o.forEach((a) => t.delete(a)) : o.forEach((a) => t.add(a));
|
|
298
298
|
const i = d.value.filter((a) => t.has(a[e.fieldNames?.value || "value"]));
|
|
299
|
-
|
|
299
|
+
F([...t]), e.onChange?.([...t], i);
|
|
300
300
|
}
|
|
301
|
-
return
|
|
302
|
-
focus:
|
|
303
|
-
blur:
|
|
301
|
+
return U({
|
|
302
|
+
focus: le,
|
|
303
|
+
blur: ne,
|
|
304
304
|
request: y
|
|
305
|
-
}), (t, o) => t.mode === "read" ? (m(), M("span",
|
|
305
|
+
}), (t, o) => t.mode === "read" ? (m(), M("span", Te, B(Z.value), 1)) : (m(), C(n(Oe), ve({
|
|
306
306
|
key: 1,
|
|
307
307
|
ref_key: "selectRef",
|
|
308
308
|
ref: w,
|
|
309
309
|
"allow-clear": ""
|
|
310
|
-
},
|
|
311
|
-
mode:
|
|
310
|
+
}, ee.value, {
|
|
311
|
+
mode: Q.value,
|
|
312
312
|
value: n(p),
|
|
313
313
|
options: n(d),
|
|
314
314
|
loading: u.value,
|
|
315
|
-
"menu-item-selected-icon":
|
|
316
|
-
"popup-class-name": `${n(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
onDropdownVisibleChange: o[0] || (o[0] = (l) => V.value = l)
|
|
321
|
-
}), Ce({
|
|
315
|
+
"menu-item-selected-icon": ye("span"),
|
|
316
|
+
"popup-class-name": `${n(S)("popup")} ${n(j)}`,
|
|
317
|
+
"onUpdate:value": n(F),
|
|
318
|
+
onFocus: X
|
|
319
|
+
}), ge({
|
|
322
320
|
option: h((l) => [N("div", {
|
|
323
321
|
class: v(n(c)("outter"))
|
|
324
|
-
}, [f(n(
|
|
322
|
+
}, [f(n(T), {
|
|
325
323
|
justify: "space-between",
|
|
326
324
|
align: "center",
|
|
327
325
|
class: v(n(c)("wrapper")),
|
|
328
326
|
gap: 8
|
|
329
327
|
}, {
|
|
330
|
-
default: h(() => [f(n(
|
|
328
|
+
default: h(() => [f(n(T), {
|
|
331
329
|
gap: 8,
|
|
332
330
|
align: "center",
|
|
333
331
|
class: v(n(c)("content-wrapper"))
|
|
334
332
|
}, {
|
|
335
|
-
default: h(() => [
|
|
333
|
+
default: h(() => [I.value ? (m(), C(n(q), {
|
|
336
334
|
key: 0,
|
|
337
|
-
checked: n(p)?.includes(
|
|
338
|
-
}, null, 8, ["checked"])) : P("", !0), (m(), C(
|
|
335
|
+
checked: n(p)?.includes(k(l, "value"))
|
|
336
|
+
}, null, 8, ["checked"])) : P("", !0), (m(), C(D(se(l))))]),
|
|
339
337
|
_: 2
|
|
340
|
-
}, 1032, ["class"]),
|
|
338
|
+
}, 1032, ["class"]), oe.value && !l?.disabled ? (m(), M("span", {
|
|
341
339
|
key: 0,
|
|
342
340
|
class: v(n(c)("action")),
|
|
343
|
-
onClick:
|
|
344
|
-
}, B(n(
|
|
341
|
+
onClick: Ce(() => ae(l), ["stop"])
|
|
342
|
+
}, B(n(V)("ap.field.chooseOnly")), 11, qe)) : P("", !0)]),
|
|
345
343
|
_: 2
|
|
346
344
|
}, 1032, ["class"])], 2)]),
|
|
347
345
|
_: 2
|
|
348
|
-
}, [
|
|
346
|
+
}, [be(n(R)(b, ["option"]), (l, i) => ({
|
|
349
347
|
name: i,
|
|
350
|
-
fn: h((a) => [Se(t.$slots, i, Fe(
|
|
348
|
+
fn: h((a) => [Se(t.$slots, i, we(Fe(a || {})))])
|
|
351
349
|
})), u.value ? {
|
|
352
350
|
name: "notFoundContent",
|
|
353
|
-
fn: h(() => [f(n(
|
|
351
|
+
fn: h(() => [f(n(ke), {
|
|
354
352
|
size: "small"
|
|
355
353
|
})]),
|
|
356
354
|
key: "0"
|
|
357
|
-
} : void 0,
|
|
355
|
+
} : void 0, I.value ? {
|
|
358
356
|
name: "dropdownRender",
|
|
359
357
|
fn: h(({
|
|
360
358
|
menuNode: l
|
|
361
359
|
}) => [N("div", {
|
|
362
360
|
tabindex: -1,
|
|
363
|
-
class: v(n(
|
|
364
|
-
onClick:
|
|
365
|
-
}, [f(n(
|
|
366
|
-
checked:
|
|
367
|
-
indeterminate:
|
|
361
|
+
class: v(n(S)("popup-all-option")),
|
|
362
|
+
onClick: ie
|
|
363
|
+
}, [f(n(q), {
|
|
364
|
+
checked: ue.value,
|
|
365
|
+
indeterminate: re.value
|
|
368
366
|
}, null, 8, ["checked", "indeterminate"]), N("span", {
|
|
369
|
-
class: v(n(
|
|
370
|
-
}, B(n(
|
|
367
|
+
class: v(n(S)("popup-all-option-label"))
|
|
368
|
+
}, B(n(V)("ap.field.selectAll")), 3)], 2), (m(), C(D(l)))]),
|
|
371
369
|
key: "1"
|
|
372
|
-
} : void 0]), 1040, ["mode", "value", "options", "loading", "menu-item-selected-icon", "popup-class-name", "
|
|
370
|
+
} : void 0]), 1040, ["mode", "value", "options", "loading", "menu-item-selected-icon", "popup-class-name", "onUpdate:value"]));
|
|
373
371
|
}
|
|
374
372
|
});
|
|
375
373
|
export {
|
|
376
|
-
|
|
374
|
+
Ye as default
|
|
377
375
|
};
|
|
@@ -7,6 +7,7 @@ const f = { key: 0 }, C = /* @__PURE__ */ i({
|
|
|
7
7
|
mode: {},
|
|
8
8
|
class: {},
|
|
9
9
|
style: {},
|
|
10
|
+
emptyText: { default: "--" },
|
|
10
11
|
defaultValue: {},
|
|
11
12
|
notFoundContent: {},
|
|
12
13
|
suffixIcon: {},
|
|
@@ -83,7 +84,6 @@ const f = { key: 0 }, C = /* @__PURE__ */ i({
|
|
|
83
84
|
showAction: {},
|
|
84
85
|
onPopupScroll: {},
|
|
85
86
|
onInputKeyDown: {},
|
|
86
|
-
emptyText: { default: "--" },
|
|
87
87
|
request: {},
|
|
88
88
|
multiple: { type: Boolean },
|
|
89
89
|
value: {},
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Slider as
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as C, useSlots as b, shallowRef as g, computed as n, unref as t, createElementBlock as k, createBlock as F, openBlock as s, Fragment as S, createTextVNode as h, toDisplayString as P, mergeProps as T, createSlots as V, renderList as _, withCtx as R, renderSlot as N, normalizeProps as U, guardReactiveProps as A } from "vue";
|
|
2
|
+
import { Slider as H } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as L, isNil as $, isArray as w } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { useControllableValue as
|
|
6
|
-
const
|
|
5
|
+
import { useControllableValue as j } from "../../hooks/useControllableValue.mjs";
|
|
6
|
+
const J = /* @__PURE__ */ C({
|
|
7
7
|
name: "ApFieldSlider",
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
|
10
10
|
mode: {},
|
|
11
11
|
class: {},
|
|
12
12
|
style: {},
|
|
13
|
+
emptyText: { default: "--" },
|
|
13
14
|
range: { type: [Boolean, Object] },
|
|
14
15
|
value: {},
|
|
15
16
|
defaultValue: {},
|
|
@@ -48,51 +49,48 @@ const G = /* @__PURE__ */ B({
|
|
|
48
49
|
ariaLabelForHandle: {},
|
|
49
50
|
ariaLabelledByForHandle: {},
|
|
50
51
|
ariaRequired: { type: Boolean },
|
|
51
|
-
ariaValueTextFormatterForHandle: {}
|
|
52
|
-
emptyText: { default: "--" }
|
|
52
|
+
ariaValueTextFormatterForHandle: {}
|
|
53
53
|
},
|
|
54
54
|
emits: ["update:value"],
|
|
55
|
-
setup(
|
|
56
|
-
const
|
|
55
|
+
setup(u, { expose: i, emit: p }) {
|
|
56
|
+
const d = b(), o = g(), a = u, m = n(
|
|
57
|
+
() => L(a, [
|
|
58
|
+
"value",
|
|
59
|
+
"onUpdate:value",
|
|
60
|
+
"mode",
|
|
61
|
+
"emptyText",
|
|
62
|
+
"defaultValue"
|
|
63
|
+
])
|
|
64
|
+
), c = p, { value: l, updateValue: f } = j(a, c), y = n(() => {
|
|
57
65
|
const e = t(l);
|
|
58
|
-
return
|
|
66
|
+
return $(e) ? a.emptyText : w(e) ? `${e[0]}-${e[1]}` : e;
|
|
59
67
|
});
|
|
60
|
-
function
|
|
68
|
+
function v() {
|
|
61
69
|
o.value?.focus?.();
|
|
62
70
|
}
|
|
63
|
-
function
|
|
71
|
+
function B() {
|
|
64
72
|
o.value?.blur?.();
|
|
65
73
|
}
|
|
66
|
-
return
|
|
67
|
-
focus:
|
|
68
|
-
blur:
|
|
69
|
-
}), (e,
|
|
70
|
-
|
|
71
|
-
], 64)) : (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"defaultValue"
|
|
79
|
-
]),
|
|
80
|
-
{
|
|
81
|
-
ref_key: "sliderRef",
|
|
82
|
-
ref: o,
|
|
83
|
-
value: t(l),
|
|
84
|
-
"onUpdate:value": t(m)
|
|
85
|
-
}
|
|
86
|
-
), V({ _: 2 }, [
|
|
87
|
-
_(p, (q, r) => ({
|
|
74
|
+
return i({
|
|
75
|
+
focus: v,
|
|
76
|
+
blur: B
|
|
77
|
+
}), (e, q) => e.mode === "read" ? (s(), k(S, { key: 0 }, [
|
|
78
|
+
h(P(y.value), 1)
|
|
79
|
+
], 64)) : (s(), F(t(H), T({ key: 1 }, m.value, {
|
|
80
|
+
ref_key: "sliderRef",
|
|
81
|
+
ref: o,
|
|
82
|
+
value: t(l),
|
|
83
|
+
"onUpdate:value": t(f)
|
|
84
|
+
}), V({ _: 2 }, [
|
|
85
|
+
_(d, (z, r) => ({
|
|
88
86
|
name: r,
|
|
89
|
-
fn:
|
|
90
|
-
|
|
87
|
+
fn: R((x) => [
|
|
88
|
+
N(e.$slots, r, U(A(x || {})))
|
|
91
89
|
])
|
|
92
90
|
}))
|
|
93
91
|
]), 1040, ["value", "onUpdate:value"]));
|
|
94
92
|
}
|
|
95
93
|
});
|
|
96
94
|
export {
|
|
97
|
-
|
|
95
|
+
J as default
|
|
98
96
|
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Switch as
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as D, useSlots as U, computed as p, ref as b, unref as o, createVNode as d, Fragment as s, createBlock as k, createElementBlock as E, openBlock as f, resolveDynamicComponent as K, mergeProps as C, createSlots as w, renderList as B, withCtx as y, renderSlot as P, normalizeProps as A, guardReactiveProps as _ } from "vue";
|
|
2
|
+
import { Switch as S, Popconfirm as L } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as M, isNil as j, isFunction as q } from "lodash-unified";
|
|
4
4
|
import "../../utils/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { useControllableValue as
|
|
6
|
+
import { useControllableValue as G } from "../../hooks/useControllableValue.mjs";
|
|
7
7
|
import { isDef as r } from "../../utils/is.mjs";
|
|
8
|
-
const
|
|
8
|
+
const Y = /* @__PURE__ */ D({
|
|
9
9
|
name: "ApFieldSwitch",
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
12
12
|
mode: {},
|
|
13
13
|
class: {},
|
|
14
14
|
style: {},
|
|
15
|
+
emptyText: {
|
|
16
|
+
default: "--"
|
|
17
|
+
},
|
|
15
18
|
id: {},
|
|
16
19
|
prefixCls: {},
|
|
17
20
|
size: {
|
|
@@ -44,89 +47,86 @@ const X = /* @__PURE__ */ z({
|
|
|
44
47
|
"onUpdate:checked": {},
|
|
45
48
|
onBlur: {},
|
|
46
49
|
onFocus: {},
|
|
47
|
-
emptyText: {
|
|
48
|
-
default: "--"
|
|
49
|
-
},
|
|
50
50
|
onAction: {},
|
|
51
51
|
confirm: {}
|
|
52
52
|
},
|
|
53
53
|
emits: ["update:checked"],
|
|
54
54
|
setup(F, {
|
|
55
55
|
expose: N,
|
|
56
|
-
emit:
|
|
56
|
+
emit: $
|
|
57
57
|
}) {
|
|
58
|
-
const
|
|
58
|
+
const i = U(), e = F, v = p(() => M(e, ["onUpdate:checked", "emptyText"])), R = $, h = b(), {
|
|
59
59
|
value: t,
|
|
60
|
-
updateValue:
|
|
61
|
-
} =
|
|
60
|
+
updateValue: u
|
|
61
|
+
} = G(e, R, {
|
|
62
62
|
valuePropName: "checked"
|
|
63
|
-
}), c =
|
|
64
|
-
async function
|
|
63
|
+
}), c = b(!1);
|
|
64
|
+
async function g(n, a) {
|
|
65
65
|
if (!r(e.confirm)) {
|
|
66
66
|
if (!r(e.onAction)) {
|
|
67
|
-
|
|
67
|
+
u(n);
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
c.value = !0;
|
|
71
71
|
try {
|
|
72
|
-
await e.onAction(n,
|
|
72
|
+
await e.onAction(n, a) && u(n);
|
|
73
73
|
} finally {
|
|
74
74
|
c.value = !1;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
async function
|
|
78
|
+
async function T() {
|
|
79
79
|
const n = o(t) === e.checkedValue ? e.unCheckedValue : e.checkedValue;
|
|
80
80
|
if (!r(e.onAction)) {
|
|
81
|
-
|
|
81
|
+
u(n);
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
await e.onAction(n) &&
|
|
84
|
+
await e.onAction(n) && u(n);
|
|
85
85
|
}
|
|
86
|
-
const
|
|
86
|
+
const x = p(() => {
|
|
87
87
|
const n = o(t);
|
|
88
|
-
return
|
|
89
|
-
}),
|
|
88
|
+
return j(n) ? d(s, null, [e.emptyText]) : n === e.checkedValue ? d(s, null, [e.checkedChildren || i.checkedChildren?.() || `${e.checkedValue}`]) : d(s, null, [e.unCheckedChildren || i.unCheckedChildren?.() || `${e.unCheckedValue}`]);
|
|
89
|
+
}), z = p(() => r(e.confirm) ? q(e.confirm) ? e.confirm(o(t)) : e.confirm : {});
|
|
90
90
|
return N({
|
|
91
91
|
focus: () => h.value?.focus(),
|
|
92
92
|
blur: () => h.value?.blur()
|
|
93
|
-
}), (n,
|
|
93
|
+
}), (n, a) => n.mode === "read" ? (f(), k(K(x.value), {
|
|
94
94
|
key: 0
|
|
95
95
|
})) : (f(), E(s, {
|
|
96
96
|
key: 1
|
|
97
|
-
}, [!o(r)(n.confirm) || n.disabled ? (f(),
|
|
97
|
+
}, [!o(r)(n.confirm) || n.disabled ? (f(), k(o(S), C({
|
|
98
98
|
key: 0,
|
|
99
99
|
ref_key: "switchRef",
|
|
100
100
|
ref: h
|
|
101
|
-
},
|
|
101
|
+
}, v.value, {
|
|
102
102
|
checked: o(t),
|
|
103
103
|
loading: n.loading ?? c.value,
|
|
104
|
-
onClick:
|
|
105
|
-
}),
|
|
104
|
+
onClick: g
|
|
105
|
+
}), w({
|
|
106
106
|
_: 2
|
|
107
|
-
}, [
|
|
107
|
+
}, [B(i, (V, l) => ({
|
|
108
108
|
name: l,
|
|
109
|
-
fn:
|
|
110
|
-
}))]), 1040, ["checked", "loading"])) : (f(),
|
|
109
|
+
fn: y((m) => [P(n.$slots, l, A(_(m || {})))])
|
|
110
|
+
}))]), 1040, ["checked", "loading"])) : (f(), k(o(L), C({
|
|
111
111
|
key: 1,
|
|
112
112
|
disabled: c.value
|
|
113
|
-
},
|
|
114
|
-
onConfirm:
|
|
113
|
+
}, z.value, {
|
|
114
|
+
onConfirm: T
|
|
115
115
|
}), {
|
|
116
|
-
default:
|
|
116
|
+
default: y(() => [d(o(S), C(v.value, {
|
|
117
117
|
checked: o(t),
|
|
118
118
|
loading: n.loading ?? c.value,
|
|
119
|
-
onClick:
|
|
120
|
-
}),
|
|
119
|
+
onClick: g
|
|
120
|
+
}), w({
|
|
121
121
|
_: 2
|
|
122
|
-
}, [
|
|
122
|
+
}, [B(i, (V, l) => ({
|
|
123
123
|
name: l,
|
|
124
|
-
fn:
|
|
124
|
+
fn: y((m) => [P(n.$slots, l, A(_(m || {})))])
|
|
125
125
|
}))]), 1040, ["checked", "loading"])]),
|
|
126
126
|
_: 3
|
|
127
127
|
}, 16, ["disabled"]))], 64));
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
export {
|
|
131
|
-
|
|
131
|
+
Y as default
|
|
132
132
|
};
|
|
@@ -7,6 +7,9 @@ const k = /* @__PURE__ */ u({
|
|
|
7
7
|
mode: {},
|
|
8
8
|
class: {},
|
|
9
9
|
style: {},
|
|
10
|
+
emptyText: {
|
|
11
|
+
default: "--"
|
|
12
|
+
},
|
|
10
13
|
id: {},
|
|
11
14
|
prefixCls: {},
|
|
12
15
|
size: {
|
|
@@ -39,9 +42,6 @@ const k = /* @__PURE__ */ u({
|
|
|
39
42
|
"onUpdate:checked": {},
|
|
40
43
|
onBlur: {},
|
|
41
44
|
onFocus: {},
|
|
42
|
-
emptyText: {
|
|
43
|
-
default: "--"
|
|
44
|
-
},
|
|
45
45
|
onAction: {},
|
|
46
46
|
confirm: {}
|
|
47
47
|
},
|