@aplus-frontend/ui 7.17.1-beta.0 → 7.17.2
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/ap-field/cascader/index.vue.mjs +82 -130
- 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 +13 -23
- 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.d.ts +1 -1
- package/es/src/ap-field/select/index.vue.mjs +147 -136
- package/es/src/ap-field/select/read.vue2.mjs +2 -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/interface.d.ts +18 -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 +10 -8
- package/es/src/ap-form/items/switch/index.vue.d.ts +3 -3
- 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 +600 -37
- 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/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/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 +13 -23
- 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.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-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/interface.d.ts +18 -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 +10 -8
- package/lib/src/ap-form/items/switch/index.vue.d.ts +3 -3
- 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 +600 -37
- 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/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 +1 -1
- 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,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Spin as
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as S, computed as f, ref as h, useSlots as U, onMounted as V, unref as o, createVNode as s, Fragment as a, createBlock as i, createElementBlock as _, openBlock as u, resolveDynamicComponent as N, mergeProps as P, withCtx as q, renderSlot as z, normalizeProps as F, guardReactiveProps as T } from "vue";
|
|
2
|
+
import { Spin as O, Segmented as R } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as w, isFunction as c, isUndefined as A, isString as D, isNumber as E } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import
|
|
6
|
-
import { useControllableValue as
|
|
7
|
-
const
|
|
5
|
+
import M from "../hooks/use-options.mjs";
|
|
6
|
+
import { useControllableValue as $ } from "../../hooks/useControllableValue.mjs";
|
|
7
|
+
const L = /* @__PURE__ */ S({
|
|
8
8
|
name: "ApFieldSegmented",
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
@@ -13,6 +13,9 @@ const K = /* @__PURE__ */ B({
|
|
|
13
13
|
},
|
|
14
14
|
class: {},
|
|
15
15
|
style: {},
|
|
16
|
+
emptyText: {
|
|
17
|
+
default: "--"
|
|
18
|
+
},
|
|
16
19
|
prefixCls: {},
|
|
17
20
|
options: {},
|
|
18
21
|
block: {
|
|
@@ -33,59 +36,56 @@ const K = /* @__PURE__ */ B({
|
|
|
33
36
|
},
|
|
34
37
|
shape: {},
|
|
35
38
|
name: {},
|
|
36
|
-
emptyText: {
|
|
37
|
-
default: "--"
|
|
38
|
-
},
|
|
39
39
|
defaultValue: {},
|
|
40
40
|
request: {}
|
|
41
41
|
},
|
|
42
42
|
emits: ["update:value"],
|
|
43
|
-
setup(
|
|
44
|
-
emit:
|
|
43
|
+
setup(v, {
|
|
44
|
+
emit: y
|
|
45
45
|
}) {
|
|
46
|
-
const
|
|
46
|
+
const t = v, g = f(() => w(t, ["onUpdate:value", "value", "defaultValue", "options"])), {
|
|
47
47
|
options: p,
|
|
48
|
-
updateOptions:
|
|
49
|
-
} =
|
|
48
|
+
updateOptions: b
|
|
49
|
+
} = M(t), k = y, {
|
|
50
50
|
value: d,
|
|
51
|
-
updateValue:
|
|
52
|
-
} =
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
updateValue: x
|
|
52
|
+
} = $(t, k), r = h(!1), B = U();
|
|
53
|
+
V(() => {
|
|
54
|
+
c(t.request) && (r.value = !0, t.request().then((e) => b(e)).finally(() => {
|
|
55
55
|
r.value = !1;
|
|
56
56
|
}));
|
|
57
57
|
});
|
|
58
|
-
const
|
|
59
|
-
const e =
|
|
60
|
-
if (
|
|
61
|
-
return s(a, null, [
|
|
62
|
-
const l =
|
|
63
|
-
if (
|
|
58
|
+
const C = f(() => {
|
|
59
|
+
const e = o(d);
|
|
60
|
+
if (A(e))
|
|
61
|
+
return s(a, null, [t.emptyText]);
|
|
62
|
+
const l = o(p)?.find((m) => m === e || m?.value === e);
|
|
63
|
+
if (D(l) || E(l))
|
|
64
64
|
return s(a, null, [l]);
|
|
65
|
-
const n = l?.label ||
|
|
66
|
-
return
|
|
65
|
+
const n = l?.label || B.label;
|
|
66
|
+
return c(n) ? s(a, null, [n?.({
|
|
67
67
|
...l
|
|
68
|
-
})]) : s(a, null, [n ||
|
|
68
|
+
})]) : s(a, null, [n || t.emptyText]);
|
|
69
69
|
});
|
|
70
|
-
return (e, l) => r.value ? (u(), i(
|
|
70
|
+
return (e, l) => r.value ? (u(), i(o(O), {
|
|
71
71
|
key: 0,
|
|
72
72
|
size: "small"
|
|
73
|
-
})) : (u(),
|
|
73
|
+
})) : (u(), _(a, {
|
|
74
74
|
key: 1
|
|
75
|
-
}, [e.mode === "read" ? (u(), i(
|
|
75
|
+
}, [e.mode === "read" ? (u(), i(N(C.value), {
|
|
76
76
|
key: 0
|
|
77
|
-
})) : (u(), i(
|
|
77
|
+
})) : (u(), i(o(R), P({
|
|
78
78
|
key: 1
|
|
79
|
-
},
|
|
80
|
-
value:
|
|
81
|
-
options:
|
|
82
|
-
"onUpdate:value":
|
|
79
|
+
}, g.value, {
|
|
80
|
+
value: o(d),
|
|
81
|
+
options: o(p),
|
|
82
|
+
"onUpdate:value": o(x)
|
|
83
83
|
}), {
|
|
84
|
-
label: q((n) => [z(e.$slots, "label", F(
|
|
84
|
+
label: q((n) => [z(e.$slots, "label", F(T(n)))]),
|
|
85
85
|
_: 3
|
|
86
86
|
}, 16, ["value", "options", "onUpdate:value"]))], 64));
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
export {
|
|
90
|
-
|
|
90
|
+
L as default
|
|
91
91
|
};
|
|
@@ -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 l, 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 T, withModifiers as we, renderList as Oe, renderSlot as Se, normalizeProps as Fe, guardReactiveProps as Be } from "vue";
|
|
2
|
+
import { Select as ke, Flex as q, Checkbox as L, Spin as Ne } from "@aplus-frontend/antdv";
|
|
3
|
+
import { debounce as xe, isFunction as z, isArray as Ae, isNil as Ve, 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 A } from "../../utils/is.mjs";
|
|
12
|
+
import { useNamespace as E } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useLocale as Te } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import { useControllableValue as qe } from "../../hooks/useControllableValue.mjs";
|
|
15
|
+
const Le = {
|
|
16
16
|
key: 0
|
|
17
|
-
},
|
|
17
|
+
}, ze = ["onClick"], et = /* @__PURE__ */ fe({
|
|
18
18
|
name: "ApFieldSelect",
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
|
@@ -23,6 +23,9 @@ const Te = {
|
|
|
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 Te = {
|
|
|
138
141
|
showAction: {},
|
|
139
142
|
onPopupScroll: {},
|
|
140
143
|
onInputKeyDown: {},
|
|
141
|
-
emptyText: {
|
|
142
|
-
default: "--"
|
|
143
|
-
},
|
|
144
144
|
request: {},
|
|
145
145
|
multiple: {
|
|
146
146
|
type: Boolean,
|
|
@@ -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:
|
|
183
|
+
setup(U, {
|
|
184
|
+
expose: K,
|
|
182
185
|
emit: $
|
|
183
186
|
}) {
|
|
184
187
|
let r = 0;
|
|
185
|
-
const
|
|
186
|
-
deprecated:
|
|
187
|
-
} =
|
|
188
|
-
|
|
188
|
+
const b = me(), e = U, {
|
|
189
|
+
deprecated: j
|
|
190
|
+
} = _e("ApFieldSelect");
|
|
191
|
+
j(!A(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"), V = k(!1), I = k(!1), {
|
|
197
|
+
t: _
|
|
198
|
+
} = Te(), W = xe((t) => {
|
|
199
|
+
if (!z(e.request))
|
|
197
200
|
return;
|
|
198
201
|
r += 1;
|
|
199
|
-
const
|
|
200
|
-
g([]), u.value = !0, e.request(t).then((
|
|
201
|
-
r ===
|
|
202
|
+
const n = r;
|
|
203
|
+
g([]), u.value = !0, e.request(t).then((o) => {
|
|
204
|
+
r === n && (g(o), u.value = !1);
|
|
202
205
|
});
|
|
203
|
-
}, e.searchDelay),
|
|
204
|
-
const
|
|
205
|
-
return typeof
|
|
206
|
+
}, e.searchDelay), G = (t, n) => {
|
|
207
|
+
const o = e.fieldNames?.label || "label";
|
|
208
|
+
return typeof n?.[o] == "string" && n[o].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
|
-
const
|
|
221
|
-
if (
|
|
223
|
+
const o = await e.request(void 0, e.params);
|
|
224
|
+
if (n !== r)
|
|
222
225
|
return;
|
|
223
|
-
g(
|
|
226
|
+
g(o);
|
|
224
227
|
} finally {
|
|
225
228
|
u.value = !1;
|
|
226
229
|
}
|
|
227
230
|
}
|
|
228
|
-
function
|
|
229
|
-
!
|
|
231
|
+
function Y(t) {
|
|
232
|
+
!V.value && r === 0 && e.lazy === "first-focus" ? i() : Q.value && !u.value && i(!0), e.onFocus?.(t), V.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
|
+
} = qe(e, J), ee = De("Select", e), te = s(() => {
|
|
255
|
+
const t = l(f);
|
|
246
256
|
if (!t)
|
|
247
257
|
return e.emptyText;
|
|
248
|
-
const
|
|
249
|
-
return
|
|
250
|
-
}),
|
|
251
|
-
const t = !!e?.showSearch,
|
|
252
|
-
let
|
|
253
|
-
return t && (
|
|
258
|
+
const n = e.fieldNames?.label || "label", o = e.fieldNames?.value || "value";
|
|
259
|
+
return Ae(t) ? t.map((a) => l(p).find((pe) => pe[o] === a)?.[n]).filter(Boolean).join("、") || e.emptyText : l(p).find((a) => a[o] === t)?.[n] || e.emptyText;
|
|
260
|
+
}), ne = s(() => {
|
|
261
|
+
const t = !!e?.showSearch, n = e.searchMode;
|
|
262
|
+
let o = {};
|
|
263
|
+
return t && (o = 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: Ve(e?.filterOption) ? G : e?.filterOption
|
|
261
271
|
}), {
|
|
262
272
|
...R(e, ["mode", "value", "onUpdate:value", "onSearch", "request", "searchMode", "onFocus", "onBeforeSelect"]),
|
|
263
|
-
placeholder:
|
|
264
|
-
...
|
|
273
|
+
placeholder: l(ee),
|
|
274
|
+
...o
|
|
265
275
|
};
|
|
266
|
-
}),
|
|
267
|
-
function
|
|
268
|
-
|
|
276
|
+
}), oe = 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 || A(e.maxCount) ? !1 : Ie(e.addAll) ? oe.value.length >= e.addAll : !!e.addAll), le = s(() => e.multiple && e.allowOnlySelect && (!A(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
|
|
275
|
-
return t[
|
|
283
|
+
function B(t, n) {
|
|
284
|
+
const o = e.fieldNames?.[n] ?? n;
|
|
285
|
+
return t[o];
|
|
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
|
|
283
|
-
class:
|
|
284
|
-
}, [
|
|
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
|
|
298
|
+
const ie = s(() => {
|
|
299
|
+
const t = l(f) || [], n = F.value;
|
|
300
|
+
return n.length > 0 && n.every((o) => t.includes(o));
|
|
301
|
+
}), ce = s(() => {
|
|
302
|
+
const t = l(f) || [], n = F.value, o = n.filter((c) => t.includes(c)).length;
|
|
303
|
+
return o > 0 && o < n.length;
|
|
294
304
|
});
|
|
295
|
-
function
|
|
296
|
-
const t = new Set(
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
|
|
305
|
+
function de() {
|
|
306
|
+
const t = new Set(l(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", Le, N(te.value), 1)) : (h(), C(l(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: l(f),
|
|
323
|
+
options: l(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": `${l(w)("popup")} ${l(H)}`,
|
|
327
|
+
"onUpdate:value": l(S),
|
|
328
|
+
onFocus: Y,
|
|
329
|
+
onDropdownVisibleChange: Z
|
|
330
|
+
}), be({
|
|
331
|
+
option: v((o) => [x("div", {
|
|
332
|
+
class: y(l(d)("outter"))
|
|
333
|
+
}, [m(l(q), {
|
|
323
334
|
justify: "space-between",
|
|
324
335
|
align: "center",
|
|
325
|
-
class:
|
|
336
|
+
class: y(l(d)("wrapper")),
|
|
326
337
|
gap: 8
|
|
327
338
|
}, {
|
|
328
|
-
default:
|
|
339
|
+
default: v(() => [m(l(q), {
|
|
329
340
|
gap: 8,
|
|
330
341
|
align: "center",
|
|
331
|
-
class:
|
|
342
|
+
class: y(l(d)("content-wrapper"))
|
|
332
343
|
}, {
|
|
333
|
-
default:
|
|
344
|
+
default: v(() => [D.value ? (h(), C(l(L), {
|
|
334
345
|
key: 0,
|
|
335
|
-
checked:
|
|
336
|
-
}, null, 8, ["checked"])) : P("", !0), (
|
|
346
|
+
checked: l(f)?.includes(B(o, "value"))
|
|
347
|
+
}, null, 8, ["checked"])) : P("", !0), (h(), C(T(re(o))))]),
|
|
337
348
|
_: 2
|
|
338
|
-
}, 1032, ["class"]),
|
|
349
|
+
}, 1032, ["class"]), le.value && !o?.disabled ? (h(), M("span", {
|
|
339
350
|
key: 0,
|
|
340
|
-
class:
|
|
341
|
-
onClick:
|
|
342
|
-
},
|
|
351
|
+
class: y(l(d)("action")),
|
|
352
|
+
onClick: we(() => ue(o), ["stop"])
|
|
353
|
+
}, N(l(_)("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(l(R)(b, ["option"]), (o, 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(l(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:
|
|
358
|
-
menuNode:
|
|
359
|
-
}) => [
|
|
368
|
+
fn: v(({
|
|
369
|
+
menuNode: o
|
|
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(l(w)("popup-all-option")),
|
|
373
|
+
onClick: de
|
|
374
|
+
}, [m(l(L), {
|
|
375
|
+
checked: ie.value,
|
|
376
|
+
indeterminate: ce.value
|
|
377
|
+
}, null, 8, ["checked", "indeterminate"]), x("span", {
|
|
378
|
+
class: y(l(w)("popup-all-option-label"))
|
|
379
|
+
}, N(l(_)("ap.field.selectAll")), 3)], 2), (h(), C(T(o)))]),
|
|
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
|
};
|
|
@@ -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: {},
|
|
@@ -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: {},
|
|
@@ -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
|
};
|