@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,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Spin as
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as V, computed as p, ref as C, onMounted as O, unref as e, createElementBlock as u, openBlock as a, Fragment as m, createTextVNode as S, toDisplayString as U, createBlock as d, mergeProps as _ } from "vue";
|
|
2
|
+
import { Spin as N, RadioGroup as R } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as z, isNil as F } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import G from "../hooks/use-options.mjs";
|
|
7
|
+
import P from "../style/index.mjs";
|
|
8
8
|
import { getOptionValue as A, getOptionLabel as D } from "./helper.mjs";
|
|
9
9
|
import { useControllableValue as E } from "../../hooks/useControllableValue.mjs";
|
|
10
10
|
import { useNamespace as I } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
-
const
|
|
11
|
+
const Y = /* @__PURE__ */ V({
|
|
12
12
|
name: "ApFieldRadio",
|
|
13
13
|
__name: "index",
|
|
14
14
|
props: {
|
|
15
15
|
mode: { default: "edit" },
|
|
16
16
|
class: {},
|
|
17
17
|
style: {},
|
|
18
|
+
emptyText: { default: "--" },
|
|
18
19
|
prefixCls: {},
|
|
19
20
|
value: {},
|
|
20
21
|
size: {},
|
|
@@ -28,57 +29,48 @@ const X = /* @__PURE__ */ h({
|
|
|
28
29
|
onChange: {},
|
|
29
30
|
"onUpdate:value": {},
|
|
30
31
|
vertical: { type: Boolean, default: !1 },
|
|
31
|
-
emptyText: { default: "--" },
|
|
32
32
|
request: {}
|
|
33
33
|
},
|
|
34
34
|
emits: ["update:value"],
|
|
35
|
-
setup(
|
|
36
|
-
const t =
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
setup(c, { expose: f, emit: v }) {
|
|
36
|
+
const t = c, y = p(
|
|
37
|
+
() => z(t, ["value", "onUpdate:value", "options", "request", "vertical"])
|
|
38
|
+
), g = v, { options: n, updateOptions: k } = G(t), { value: r, updateValue: x } = E(t, g), { b, m: B } = I("field-radio"), T = P("field"), l = C(!1);
|
|
39
|
+
async function s() {
|
|
40
|
+
t.request && (l.value = !0, t.request?.().then((o) => k(o)).finally(() => {
|
|
39
41
|
l.value = !1;
|
|
40
42
|
}));
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
O(() => {
|
|
45
|
+
s();
|
|
44
46
|
});
|
|
45
|
-
const
|
|
47
|
+
const h = p(() => {
|
|
46
48
|
const o = e(r);
|
|
47
|
-
if (
|
|
49
|
+
if (F(o))
|
|
48
50
|
return t.emptyText;
|
|
49
|
-
const
|
|
50
|
-
(
|
|
51
|
+
const i = n.value?.find(
|
|
52
|
+
(q) => o === A(q)
|
|
51
53
|
);
|
|
52
|
-
return D(
|
|
54
|
+
return D(i) || t.emptyText;
|
|
53
55
|
});
|
|
54
|
-
return
|
|
55
|
-
request:
|
|
56
|
-
}), (o,
|
|
57
|
-
|
|
58
|
-
], 64)) : (a(),
|
|
59
|
-
l.value ? (a(),
|
|
56
|
+
return f({
|
|
57
|
+
request: s
|
|
58
|
+
}), (o, i) => o.mode === "read" ? (a(), u(m, { key: 0 }, [
|
|
59
|
+
S(U(h.value), 1)
|
|
60
|
+
], 64)) : (a(), u(m, { key: 1 }, [
|
|
61
|
+
l.value ? (a(), d(e(N), {
|
|
60
62
|
key: 0,
|
|
61
63
|
size: "small"
|
|
62
|
-
})) : (a(),
|
|
63
|
-
|
|
64
|
-
e(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"vertical"
|
|
70
|
-
]),
|
|
71
|
-
{
|
|
72
|
-
ref: "radioGroupRef",
|
|
73
|
-
value: e(r),
|
|
74
|
-
options: e(n),
|
|
75
|
-
class: [e(k)(), o.vertical ? e(x)("vertical") : null, e(b)],
|
|
76
|
-
"onUpdate:value": e(g)
|
|
77
|
-
}
|
|
78
|
-
), null, 16, ["value", "options", "class", "onUpdate:value"]))
|
|
64
|
+
})) : (a(), d(e(R), _({ key: 1 }, y.value, {
|
|
65
|
+
ref: "radioGroupRef",
|
|
66
|
+
value: e(r),
|
|
67
|
+
options: e(n),
|
|
68
|
+
class: [e(b)(), o.vertical ? e(B)("vertical") : null, e(T)],
|
|
69
|
+
"onUpdate:value": e(x)
|
|
70
|
+
}), null, 16, ["value", "options", "class", "onUpdate:value"]))
|
|
79
71
|
], 64));
|
|
80
72
|
}
|
|
81
73
|
});
|
|
82
74
|
export {
|
|
83
|
-
|
|
75
|
+
Y as default
|
|
84
76
|
};
|
|
@@ -8,6 +8,7 @@ const y = /* @__PURE__ */ p({
|
|
|
8
8
|
mode: { default: "edit" },
|
|
9
9
|
class: {},
|
|
10
10
|
style: {},
|
|
11
|
+
emptyText: { default: "--" },
|
|
11
12
|
prefixCls: {},
|
|
12
13
|
value: {},
|
|
13
14
|
size: {},
|
|
@@ -21,7 +22,6 @@ const y = /* @__PURE__ */ p({
|
|
|
21
22
|
onChange: {},
|
|
22
23
|
"onUpdate:value": {},
|
|
23
24
|
vertical: { type: Boolean, default: !1 },
|
|
24
|
-
emptyText: { default: "--" },
|
|
25
25
|
request: {}
|
|
26
26
|
},
|
|
27
27
|
setup(a) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Rate as
|
|
3
|
-
import { omit as
|
|
1
|
+
import { defineComponent as b, computed as a, shallowRef as y, useSlots as h, createBlock as B, openBlock as C, unref as t, mergeProps as _, createSlots as x, withCtx as k, renderSlot as w } from "vue";
|
|
2
|
+
import { Rate as R } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as g } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { useControllableValue as
|
|
6
|
-
const A = /* @__PURE__ */
|
|
5
|
+
import { useControllableValue as V } from "../../hooks/useControllableValue.mjs";
|
|
6
|
+
const A = /* @__PURE__ */ b({
|
|
7
7
|
name: "ApFieldRate",
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
|
@@ -33,28 +33,28 @@ const A = /* @__PURE__ */ m({
|
|
|
33
33
|
defaultValue: {}
|
|
34
34
|
},
|
|
35
35
|
emits: ["update:value"],
|
|
36
|
-
setup(
|
|
37
|
-
const e =
|
|
38
|
-
function
|
|
39
|
-
|
|
36
|
+
setup(l, { expose: r, emit: u }) {
|
|
37
|
+
const e = l, n = a(() => g(e, ["mode", "defaultValue"])), o = y(), s = u, d = h(), { value: c, updateValue: f } = V(e, s), i = a(() => e.mode === "read" ? !0 : e.disabled);
|
|
38
|
+
function p() {
|
|
39
|
+
o.value?.focus?.();
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
41
|
+
function m() {
|
|
42
|
+
o.value?.blur?.();
|
|
43
43
|
}
|
|
44
|
-
return
|
|
45
|
-
focus:
|
|
46
|
-
blur:
|
|
47
|
-
}), (
|
|
44
|
+
return r({
|
|
45
|
+
focus: p,
|
|
46
|
+
blur: m
|
|
47
|
+
}), (v, S) => (C(), B(t(R), _(n.value, {
|
|
48
48
|
ref_key: "rateRef",
|
|
49
|
-
ref:
|
|
50
|
-
value:
|
|
51
|
-
disabled:
|
|
52
|
-
"onUpdate:value":
|
|
53
|
-
}),
|
|
54
|
-
|
|
49
|
+
ref: o,
|
|
50
|
+
value: t(c),
|
|
51
|
+
disabled: i.value,
|
|
52
|
+
"onUpdate:value": t(f)
|
|
53
|
+
}), x({ _: 2 }, [
|
|
54
|
+
d.character ? {
|
|
55
55
|
name: "character",
|
|
56
|
-
fn:
|
|
57
|
-
|
|
56
|
+
fn: k(() => [
|
|
57
|
+
w(v.$slots, "character")
|
|
58
58
|
]),
|
|
59
59
|
key: "0"
|
|
60
60
|
} : void 0
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { InputNumber as
|
|
3
|
-
import { omit as
|
|
1
|
+
import { defineComponent as B, computed as b, shallowRef as x, useSlots as S, createElementBlock as _, createBlock as g, openBlock as r, toDisplayString as k, unref as e, mergeProps as P, createSlots as C, renderList as I, withCtx as U, renderSlot as w, normalizeProps as R, guardReactiveProps as V } from "vue";
|
|
2
|
+
import { InputNumber as z } from "@aplus-frontend/antdv";
|
|
3
|
+
import { omit as A } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { useDefaultPlaceholder as
|
|
6
|
-
import { formatSecond as
|
|
7
|
-
import { useControllableValue as
|
|
8
|
-
const
|
|
5
|
+
import { useDefaultPlaceholder as D } from "../hooks/use-default-placeholder.mjs";
|
|
6
|
+
import { formatSecond as E } from "./helper.mjs";
|
|
7
|
+
import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
|
|
8
|
+
const M = { key: 0 }, H = /* @__PURE__ */ B({
|
|
9
9
|
name: "ApFieldSecond",
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
12
12
|
mode: {},
|
|
13
13
|
class: {},
|
|
14
14
|
style: {},
|
|
15
|
+
emptyText: { default: "--" },
|
|
15
16
|
size: {},
|
|
16
17
|
bordered: { type: Boolean, default: !0 },
|
|
17
18
|
placeholder: {},
|
|
@@ -50,41 +51,38 @@ const E = { key: 0 }, q = /* @__PURE__ */ h({
|
|
|
50
51
|
onPressEnter: {},
|
|
51
52
|
onStep: {},
|
|
52
53
|
onBlur: {},
|
|
53
|
-
onFocus: {}
|
|
54
|
-
emptyText: { default: "--" }
|
|
54
|
+
onFocus: {}
|
|
55
55
|
},
|
|
56
56
|
emits: ["update:value"],
|
|
57
57
|
setup(u, { expose: d, emit: s }) {
|
|
58
|
-
const o = u, p =
|
|
58
|
+
const o = u, p = b(
|
|
59
|
+
() => A(o, ["value", "onUpdate:value", "min", "placeholder", "mode"])
|
|
60
|
+
), i = s, t = x(), { value: a, updateValue: f } = F(
|
|
59
61
|
o,
|
|
60
|
-
|
|
61
|
-
),
|
|
62
|
-
function
|
|
62
|
+
i
|
|
63
|
+
), c = S(), m = D("Second", o);
|
|
64
|
+
function y() {
|
|
63
65
|
t.value?.focus();
|
|
64
66
|
}
|
|
65
|
-
function
|
|
67
|
+
function v() {
|
|
66
68
|
t.value?.blur();
|
|
67
69
|
}
|
|
68
|
-
return d({ focus:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
e(V)(o, ["value", "onUpdate:value", "min", "placeholder", "mode"]),
|
|
77
|
-
{ "onUpdate:value": e(i) }
|
|
78
|
-
), k({ _: 2 }, [
|
|
79
|
-
C(f, (M, n) => ({
|
|
70
|
+
return d({ focus: y, blur: v }), (l, N) => l.mode === "read" ? (r(), _("span", M, k(e(E)(Number(e(a)))), 1)) : (r(), g(e(z), P({
|
|
71
|
+
key: 1,
|
|
72
|
+
min: 0,
|
|
73
|
+
style: { width: "100%" },
|
|
74
|
+
placeholder: e(m),
|
|
75
|
+
value: e(a)
|
|
76
|
+
}, p.value, { "onUpdate:value": e(f) }), C({ _: 2 }, [
|
|
77
|
+
I(c, (O, n) => ({
|
|
80
78
|
name: n,
|
|
81
|
-
fn:
|
|
82
|
-
|
|
79
|
+
fn: U((h) => [
|
|
80
|
+
w(l.$slots, n, R(V(h || {})))
|
|
83
81
|
])
|
|
84
82
|
}))
|
|
85
83
|
]), 1040, ["placeholder", "value", "onUpdate:value"]));
|
|
86
84
|
}
|
|
87
85
|
});
|
|
88
86
|
export {
|
|
89
|
-
|
|
87
|
+
H as default
|
|
90
88
|
};
|
|
@@ -7,6 +7,7 @@ const m = /* @__PURE__ */ n({
|
|
|
7
7
|
mode: {},
|
|
8
8
|
class: {},
|
|
9
9
|
style: {},
|
|
10
|
+
emptyText: { default: "--" },
|
|
10
11
|
size: {},
|
|
11
12
|
bordered: { type: Boolean },
|
|
12
13
|
placeholder: {},
|
|
@@ -45,8 +46,7 @@ const m = /* @__PURE__ */ n({
|
|
|
45
46
|
onPressEnter: {},
|
|
46
47
|
onStep: {},
|
|
47
48
|
onBlur: {},
|
|
48
|
-
onFocus: {}
|
|
49
|
-
emptyText: { default: "--" }
|
|
49
|
+
onFocus: {}
|
|
50
50
|
},
|
|
51
51
|
setup(o) {
|
|
52
52
|
const a = o;
|
|
@@ -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
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
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
|
|
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
2
|
import { Select as Oe, Flex as T, Checkbox as q, Spin as ke } from "@aplus-frontend/antdv";
|
|
3
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";
|
|
@@ -8,7 +8,7 @@ import "../../hooks/index.mjs";
|
|
|
8
8
|
import { useDefaultPlaceholder as Ie } from "../hooks/use-default-placeholder.mjs";
|
|
9
9
|
import _e from "../style/index.mjs";
|
|
10
10
|
import { useSelectOptions as Me } from "./use-select-options.mjs";
|
|
11
|
-
import { isDef as
|
|
11
|
+
import { isDef as x } from "../../utils/is.mjs";
|
|
12
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
14
|
import { useControllableValue as De } from "../../hooks/useControllableValue.mjs";
|
|
@@ -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,
|
|
@@ -179,15 +179,15 @@ const Te = {
|
|
|
179
179
|
emits: ["update:value"],
|
|
180
180
|
setup(E, {
|
|
181
181
|
expose: U,
|
|
182
|
-
emit:
|
|
182
|
+
emit: K
|
|
183
183
|
}) {
|
|
184
184
|
let r = 0;
|
|
185
|
-
const
|
|
186
|
-
deprecated:
|
|
185
|
+
const b = pe(), e = E, {
|
|
186
|
+
deprecated: $
|
|
187
187
|
} = Ve("ApFieldSelect");
|
|
188
|
-
|
|
188
|
+
$(!x(e.refetchOnFocus), "refetchOnFocus", "fetchOnFocus");
|
|
189
189
|
const {
|
|
190
|
-
b
|
|
190
|
+
b: S
|
|
191
191
|
} = z("field-select"), {
|
|
192
192
|
b: c
|
|
193
193
|
} = z("field-select-popup-option"), j = _e("field"), A = _(!1), {
|
|
@@ -206,7 +206,7 @@ const Te = {
|
|
|
206
206
|
}, {
|
|
207
207
|
options: d,
|
|
208
208
|
updateOptions: g
|
|
209
|
-
} = Me(e),
|
|
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
|
});
|
|
@@ -240,7 +240,7 @@ const Te = {
|
|
|
240
240
|
});
|
|
241
241
|
const {
|
|
242
242
|
value: p,
|
|
243
|
-
updateValue:
|
|
243
|
+
updateValue: F
|
|
244
244
|
} = De(e, G), Y = Ie("Select", e), Z = s(() => {
|
|
245
245
|
const t = n(p);
|
|
246
246
|
if (!t)
|
|
@@ -263,49 +263,49 @@ const Te = {
|
|
|
263
263
|
placeholder: n(Y),
|
|
264
264
|
...l
|
|
265
265
|
};
|
|
266
|
-
}), te = s(() => d.value.map((t) => t[e.fieldNames?.value || "value"])),
|
|
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
267
|
function le() {
|
|
268
|
-
|
|
268
|
+
w.value?.focus();
|
|
269
269
|
}
|
|
270
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
277
|
function ae(t) {
|
|
278
|
-
const o =
|
|
279
|
-
|
|
278
|
+
const o = k(t, "value");
|
|
279
|
+
F(e.multiple ? [o] : o), e.onChange?.([o], [t]);
|
|
280
280
|
}
|
|
281
281
|
function se(t) {
|
|
282
|
-
return
|
|
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
288
|
const ue = s(() => {
|
|
289
|
-
const t = n(p) || [], o =
|
|
289
|
+
const t = n(p) || [], o = O.value;
|
|
290
290
|
return o.length > 0 && o.every((l) => t.includes(l));
|
|
291
291
|
}), re = s(() => {
|
|
292
|
-
const t = n(p) || [], o =
|
|
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
295
|
function ie() {
|
|
296
|
-
const t = new Set(n(p) || []), o =
|
|
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
301
|
return U({
|
|
302
302
|
focus: le,
|
|
303
303
|
blur: ne,
|
|
304
304
|
request: y
|
|
305
|
-
}), (t, o) => t.mode === "read" ? (m(), M("span", Te,
|
|
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
|
-
ref:
|
|
308
|
+
ref: w,
|
|
309
309
|
"allow-clear": ""
|
|
310
310
|
}, ee.value, {
|
|
311
311
|
mode: Q.value,
|
|
@@ -313,11 +313,11 @@ const Te = {
|
|
|
313
313
|
options: n(d),
|
|
314
314
|
loading: u.value,
|
|
315
315
|
"menu-item-selected-icon": ye("span"),
|
|
316
|
-
"popup-class-name": `${n(
|
|
317
|
-
"onUpdate:value": n(
|
|
316
|
+
"popup-class-name": `${n(S)("popup")} ${n(j)}`,
|
|
317
|
+
"onUpdate:value": n(F),
|
|
318
318
|
onFocus: X
|
|
319
319
|
}), ge({
|
|
320
|
-
option: h((l) => [
|
|
320
|
+
option: h((l) => [N("div", {
|
|
321
321
|
class: v(n(c)("outter"))
|
|
322
322
|
}, [f(n(T), {
|
|
323
323
|
justify: "space-between",
|
|
@@ -332,18 +332,18 @@ const Te = {
|
|
|
332
332
|
}, {
|
|
333
333
|
default: h(() => [I.value ? (m(), C(n(q), {
|
|
334
334
|
key: 0,
|
|
335
|
-
checked: n(p)?.includes(
|
|
335
|
+
checked: n(p)?.includes(k(l, "value"))
|
|
336
336
|
}, null, 8, ["checked"])) : P("", !0), (m(), C(D(se(l))))]),
|
|
337
337
|
_: 2
|
|
338
338
|
}, 1032, ["class"]), oe.value && !l?.disabled ? (m(), M("span", {
|
|
339
339
|
key: 0,
|
|
340
340
|
class: v(n(c)("action")),
|
|
341
341
|
onClick: Ce(() => ae(l), ["stop"])
|
|
342
|
-
},
|
|
342
|
+
}, B(n(V)("ap.field.chooseOnly")), 11, qe)) : P("", !0)]),
|
|
343
343
|
_: 2
|
|
344
344
|
}, 1032, ["class"])], 2)]),
|
|
345
345
|
_: 2
|
|
346
|
-
}, [be(n(R)(
|
|
346
|
+
}, [be(n(R)(b, ["option"]), (l, i) => ({
|
|
347
347
|
name: i,
|
|
348
348
|
fn: h((a) => [Se(t.$slots, i, we(Fe(a || {})))])
|
|
349
349
|
})), u.value ? {
|
|
@@ -356,16 +356,16 @@ const Te = {
|
|
|
356
356
|
name: "dropdownRender",
|
|
357
357
|
fn: h(({
|
|
358
358
|
menuNode: l
|
|
359
|
-
}) => [
|
|
359
|
+
}) => [N("div", {
|
|
360
360
|
tabindex: -1,
|
|
361
|
-
class: v(n(
|
|
361
|
+
class: v(n(S)("popup-all-option")),
|
|
362
362
|
onClick: ie
|
|
363
363
|
}, [f(n(q), {
|
|
364
364
|
checked: ue.value,
|
|
365
365
|
indeterminate: re.value
|
|
366
|
-
}, null, 8, ["checked", "indeterminate"]),
|
|
367
|
-
class: v(n(
|
|
368
|
-
},
|
|
366
|
+
}, null, 8, ["checked", "indeterminate"]), N("span", {
|
|
367
|
+
class: v(n(S)("popup-all-option-label"))
|
|
368
|
+
}, B(n(V)("ap.field.selectAll")), 3)], 2), (m(), C(D(l)))]),
|
|
369
369
|
key: "1"
|
|
370
370
|
} : void 0]), 1040, ["mode", "value", "options", "loading", "menu-item-selected-icon", "popup-class-name", "onUpdate:value"]));
|
|
371
371
|
}
|
|
@@ -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: {},
|