@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,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
|
};
|