@aplus-frontend/ui 7.7.3 → 7.7.4
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/checkbox/index.vue.mjs +18 -8
- package/es/src/ap-field/number/index.vue.mjs +19 -19
- package/es/src/ap-field/radio/index.vue.mjs +24 -24
- package/es/src/ap-field/rate/index.vue.mjs +10 -10
- package/es/src/ap-field/select/index.vue.mjs +74 -71
- package/es/src/ap-field/slider/index.vue.d.ts +4 -2
- package/es/src/ap-field/slider/index.vue.mjs +12 -12
- package/es/src/ap-field/switch/index.vue.mjs +20 -20
- package/es/src/ap-field/text/index.vue2.mjs +23 -23
- package/es/src/ap-field/text/password.vue.mjs +9 -9
- package/es/src/ap-field/text-area/index.vue.mjs +24 -20
- package/es/src/ap-field/tree-select/index.vue.mjs +17 -17
- package/es/src/ap-form/ap-form.vue2.mjs +64 -64
- package/es/src/ap-form/drawer-form/index.vue.mjs +41 -41
- package/es/src/ap-form/item/index.vue.mjs +64 -64
- package/es/src/ap-form/items/number/index.vue.mjs +10 -10
- package/es/src/ap-form/items/radio/index.vue.mjs +3 -3
- package/es/src/ap-form/items/select/index.vue.mjs +5 -5
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/index.vue2.mjs +6 -6
- package/es/src/ap-form/items/text/password.vue.mjs +7 -7
- package/es/src/ap-form/items/text-area/index.vue.mjs +5 -5
- package/es/src/ap-form/items/tree-select/index.vue.mjs +7 -7
- package/es/src/ap-form/search-form/index.vue.mjs +63 -63
- package/es/src/ap-form/style/item.mjs +8 -7
- package/es/src/ap-list/index.vue.mjs +6 -6
- package/es/src/ap-table/constants.d.ts +1 -1
- package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/es/src/editable-table/form-item.vue.mjs +64 -64
- package/es/src/editable-table/index.vue.mjs +66 -66
- package/es/src/scroll-bar/index.vue.d.ts +7 -7
- package/es/src/scroll-bar/index.vue.mjs +21 -21
- package/es/src/scroll-bar/internal.vue.d.ts +4 -4
- package/es/src/scroll-bar/internal.vue.mjs +20 -20
- package/es/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
- package/es/src/scroll-view/hooks/use-scroll-wrapper.mjs +13 -13
- package/es/src/scroll-view/index.vue.d.ts +25 -25
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/rate/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/slider/index.vue.d.ts +4 -2
- 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/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/style/item.js +1 -1
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +1 -1
- package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/scroll-bar/index.vue.d.ts +7 -7
- package/lib/src/scroll-bar/index.vue.js +1 -1
- package/lib/src/scroll-bar/internal.vue.d.ts +4 -4
- package/lib/src/scroll-bar/internal.vue.js +1 -1
- package/lib/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
- package/lib/src/scroll-view/hooks/use-scroll-wrapper.js +1 -1
- package/lib/src/scroll-view/index.vue.d.ts +25 -25
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as g, ref as C, onMounted as V, createElementBlock as l, openBlock as o, Fragment as i, unref as e, createTextVNode as u, toDisplayString as m, createBlock as d, mergeProps as B } from "vue";
|
|
2
|
-
import { isFunction as O, isNil as
|
|
2
|
+
import { isFunction as O, isNil as T, omit as q } from "lodash-unified";
|
|
3
3
|
import { Spin as U, CheckboxGroup as _ } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
5
|
import { getOptionValue as F, getOptionLabel as N } from "./helper.mjs";
|
|
@@ -45,7 +45,7 @@ const Q = /* @__PURE__ */ g({
|
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
return (a, D) => a.mode === "read" ? (o(), l(i, { key: 0 }, [
|
|
48
|
-
e(
|
|
48
|
+
e(T)(e(r)) ? (o(), l(i, { key: 0 }, [
|
|
49
49
|
u(m(t.emptyText), 1)
|
|
50
50
|
], 64)) : (o(), l(i, { key: 1 }, [
|
|
51
51
|
u(m(e(p)?.filter((s) => e(r).indexOf(e(F)(s)) > -1).map((s) => e(N)(s)).join("、") || t.emptyText), 1)
|
|
@@ -54,12 +54,22 @@ const Q = /* @__PURE__ */ g({
|
|
|
54
54
|
n.value ? (o(), d(e(U), {
|
|
55
55
|
key: 0,
|
|
56
56
|
size: "small"
|
|
57
|
-
})) : (o(), d(e(_), B(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
})) : (o(), d(e(_), B(
|
|
58
|
+
{ key: 1 },
|
|
59
|
+
e(q)(t, [
|
|
60
|
+
"onUpdate:value",
|
|
61
|
+
"value",
|
|
62
|
+
"request",
|
|
63
|
+
"vertical",
|
|
64
|
+
"emptyText"
|
|
65
|
+
]),
|
|
66
|
+
{
|
|
67
|
+
options: e(p),
|
|
68
|
+
value: e(r),
|
|
69
|
+
class: [e(k)(), a.vertical ? e(x)("vertical") : null, e(h)],
|
|
70
|
+
"onUpdate:value": e(b)
|
|
71
|
+
}
|
|
72
|
+
), null, 16, ["options", "value", "class", "onUpdate:value"]))
|
|
63
73
|
], 64));
|
|
64
74
|
}
|
|
65
75
|
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as C,
|
|
1
|
+
import { defineComponent as C, shallowRef as N, computed as D, unref as t, createElementBlock as s, createBlock as P, openBlock as l, normalizeClass as i, createCommentVNode as f, createElementVNode as R, renderSlot as u, toDisplayString as V, mergeProps as $, createSlots as I, renderList as A, withCtx as U, normalizeProps as z, guardReactiveProps as E } from "vue";
|
|
2
2
|
import { InputNumber as M } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { isNil as T, omit as
|
|
5
|
-
import { addZeroToDecimalPlaces as
|
|
4
|
+
import { isNil as T, omit as w } from "lodash-unified";
|
|
5
|
+
import { addZeroToDecimalPlaces as F } from "./helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
|
-
import { useDefaultPlaceholder as
|
|
8
|
-
import
|
|
7
|
+
import { useDefaultPlaceholder as W } from "../hooks/use-default-placeholder.mjs";
|
|
8
|
+
import _ from "../style/index.mjs";
|
|
9
9
|
import { roundWith as L, toDecimalMark as O } from "../../utils/format.mjs";
|
|
10
10
|
import { useNamespace as Z } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
11
|
import { useControllableValue as j } from "../../hooks/useControllableValue.mjs";
|
|
12
|
-
const
|
|
12
|
+
const le = /* @__PURE__ */ C({
|
|
13
13
|
name: "ApFieldNumber",
|
|
14
14
|
__name: "index",
|
|
15
15
|
props: {
|
|
@@ -60,16 +60,16 @@ const re = /* @__PURE__ */ C({
|
|
|
60
60
|
},
|
|
61
61
|
emits: ["update:value"],
|
|
62
62
|
setup(m, { expose: c, emit: y }) {
|
|
63
|
-
const v = y, { b:
|
|
63
|
+
const v = y, { b: r } = Z("field-number"), h = _("field"), o = m, n = N(), { value: p, updateValue: B } = j(
|
|
64
64
|
o,
|
|
65
65
|
v
|
|
66
|
-
), b =
|
|
66
|
+
), b = W("Number", o), k = D(() => {
|
|
67
67
|
let e = t(p);
|
|
68
68
|
if (T(e))
|
|
69
69
|
return o.emptyText;
|
|
70
70
|
o.precision && (e = L(e, o.precision));
|
|
71
71
|
let a = o.thousands ? O(e) : String(e);
|
|
72
|
-
return o.precision && o.limitDecimalsRetain && (a =
|
|
72
|
+
return o.precision && o.limitDecimalsRetain && (a = F(a, o.precision)), a;
|
|
73
73
|
});
|
|
74
74
|
function g() {
|
|
75
75
|
n.value?.focus();
|
|
@@ -77,30 +77,30 @@ const re = /* @__PURE__ */ C({
|
|
|
77
77
|
function S() {
|
|
78
78
|
n.value?.blur();
|
|
79
79
|
}
|
|
80
|
-
return c({ focus: g, blur: S }), (e, a) => e.mode === "read" ? (
|
|
80
|
+
return c({ focus: g, blur: S }), (e, a) => e.mode === "read" ? (l(), s("span", {
|
|
81
81
|
key: 0,
|
|
82
|
-
class: i([t(
|
|
82
|
+
class: i([t(r)(), t(h)])
|
|
83
83
|
}, [
|
|
84
|
-
e.$slots.prefix ? (
|
|
84
|
+
e.$slots.prefix ? (l(), s("span", {
|
|
85
85
|
key: 0,
|
|
86
|
-
class: i(t(
|
|
86
|
+
class: i(t(r)("label-left"))
|
|
87
87
|
}, [
|
|
88
88
|
u(e.$slots, "prefix")
|
|
89
89
|
], 2)) : f("", !0),
|
|
90
|
-
|
|
91
|
-
e.$slots.addonAfter ? (
|
|
90
|
+
R("span", null, V(k.value), 1),
|
|
91
|
+
e.$slots.addonAfter ? (l(), s("span", {
|
|
92
92
|
key: 1,
|
|
93
|
-
class: i(t(
|
|
93
|
+
class: i(t(r)("label-right"))
|
|
94
94
|
}, [
|
|
95
95
|
u(e.$slots, "addonAfter")
|
|
96
96
|
], 2)) : f("", !0)
|
|
97
|
-
], 2)) : (
|
|
97
|
+
], 2)) : (l(), P(t(M), $({ key: 1 }, t(w)(o, ["value", "onUpdate:value"]), {
|
|
98
98
|
ref_key: "inputRef",
|
|
99
99
|
ref: n,
|
|
100
100
|
placeholder: t(b),
|
|
101
101
|
value: t(p),
|
|
102
102
|
"onUpdate:value": t(B)
|
|
103
|
-
}),
|
|
103
|
+
}), I({ _: 2 }, [
|
|
104
104
|
A(e.$slots, (q, d) => ({
|
|
105
105
|
name: d,
|
|
106
106
|
fn: U((x) => [
|
|
@@ -111,5 +111,5 @@ const re = /* @__PURE__ */ C({
|
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
export {
|
|
114
|
-
|
|
114
|
+
le as default
|
|
115
115
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Spin as
|
|
1
|
+
import { defineComponent as V, shallowRef as _, ref as q, onMounted as C, computed as O, unref as e, createElementBlock as s, openBlock as a, Fragment as p, createTextVNode as S, toDisplayString as U, createBlock as m, mergeProps as G } from "vue";
|
|
2
|
+
import { Spin as N, RadioGroup as z } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { isNil as
|
|
4
|
+
import { isNil as F, omit as w } from "lodash-unified";
|
|
5
5
|
import { getOptionValue as A, getOptionLabel as D } from "./helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
7
|
import E from "../hooks/use-options.mjs";
|
|
8
8
|
import I from "../style/index.mjs";
|
|
9
9
|
import { useControllableValue as L } from "../../hooks/useControllableValue.mjs";
|
|
10
10
|
import { useNamespace as M } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
-
const
|
|
11
|
+
const $ = /* @__PURE__ */ V({
|
|
12
12
|
name: "ApFieldRadio",
|
|
13
13
|
__name: "index",
|
|
14
14
|
props: {
|
|
@@ -32,40 +32,40 @@ const Z = /* @__PURE__ */ q({
|
|
|
32
32
|
vertical: { type: Boolean, default: !1 }
|
|
33
33
|
},
|
|
34
34
|
emits: ["update:value"],
|
|
35
|
-
setup(
|
|
36
|
-
const t =
|
|
35
|
+
setup(d, { expose: f, emit: c }) {
|
|
36
|
+
const t = d, v = c, l = _(), { options: r, updateOptions: y } = E(t), { value: u, updateValue: g } = L(t, v), { b: k, m: b } = M("field-radio"), x = I("field"), n = q(!1);
|
|
37
37
|
C(() => {
|
|
38
|
-
t.request && (n.value = !0, t.request?.().then((o) =>
|
|
38
|
+
t.request && (n.value = !0, t.request?.().then((o) => y(o)).finally(() => {
|
|
39
39
|
n.value = !1;
|
|
40
40
|
}));
|
|
41
41
|
});
|
|
42
|
-
const
|
|
42
|
+
const h = O(() => {
|
|
43
43
|
const o = e(u);
|
|
44
|
-
if (
|
|
44
|
+
if (F(o))
|
|
45
45
|
return t.emptyText;
|
|
46
46
|
const i = r.value?.find(
|
|
47
|
-
(
|
|
47
|
+
(R) => o === A(R)
|
|
48
48
|
);
|
|
49
49
|
return D(i) || t.emptyText;
|
|
50
50
|
});
|
|
51
|
-
function
|
|
51
|
+
function B() {
|
|
52
52
|
l.value?.focus();
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function T() {
|
|
55
55
|
l.value?.blur();
|
|
56
56
|
}
|
|
57
|
-
return
|
|
58
|
-
focus:
|
|
59
|
-
blur:
|
|
60
|
-
}), (o, i) => o.mode === "read" ? (a(), p
|
|
61
|
-
|
|
62
|
-
], 64)) : (a(), p
|
|
63
|
-
n.value ? (a(),
|
|
57
|
+
return f({
|
|
58
|
+
focus: B,
|
|
59
|
+
blur: T
|
|
60
|
+
}), (o, i) => o.mode === "read" ? (a(), s(p, { key: 0 }, [
|
|
61
|
+
S(U(h.value), 1)
|
|
62
|
+
], 64)) : (a(), s(p, { key: 1 }, [
|
|
63
|
+
n.value ? (a(), m(e(N), {
|
|
64
64
|
key: 0,
|
|
65
65
|
size: "small"
|
|
66
|
-
})) : (a(),
|
|
66
|
+
})) : (a(), m(e(z), G(
|
|
67
67
|
{ key: 1 },
|
|
68
|
-
e(
|
|
68
|
+
e(w)(t, [
|
|
69
69
|
"value",
|
|
70
70
|
"onUpdate:value",
|
|
71
71
|
"options",
|
|
@@ -77,13 +77,13 @@ const Z = /* @__PURE__ */ q({
|
|
|
77
77
|
ref: l,
|
|
78
78
|
value: e(u),
|
|
79
79
|
options: e(r),
|
|
80
|
-
class: [e(
|
|
81
|
-
"onUpdate:value": e(
|
|
80
|
+
class: [e(k)(), o.vertical ? e(b)("vertical") : null, e(x)],
|
|
81
|
+
"onUpdate:value": e(g)
|
|
82
82
|
}
|
|
83
83
|
), null, 16, ["value", "options", "class", "onUpdate:value"]))
|
|
84
84
|
], 64));
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
export {
|
|
88
|
-
|
|
88
|
+
$ as default
|
|
89
89
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as m,
|
|
2
|
-
import { omit as
|
|
1
|
+
import { defineComponent as m, shallowRef as v, useSlots as b, computed as y, createBlock as h, openBlock as B, unref as o, mergeProps as C, createSlots as _, withCtx as x, renderSlot as k } from "vue";
|
|
2
|
+
import { omit as w } from "lodash-unified";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { Rate as
|
|
5
|
-
import { useControllableValue as
|
|
4
|
+
import { Rate as R } from "@aplus-frontend/antdv";
|
|
5
|
+
import { useControllableValue as g } from "../../hooks/useControllableValue.mjs";
|
|
6
6
|
const D = /* @__PURE__ */ m({
|
|
7
7
|
name: "ApFieldRate",
|
|
8
8
|
__name: "index",
|
|
@@ -32,20 +32,20 @@ const D = /* @__PURE__ */ m({
|
|
|
32
32
|
defaultValue: {}
|
|
33
33
|
},
|
|
34
34
|
emits: ["update:value"],
|
|
35
|
-
setup(
|
|
36
|
-
const e =
|
|
35
|
+
setup(t, { expose: l, emit: r }) {
|
|
36
|
+
const e = t, a = v(), u = r, n = b(), { value: d, updateValue: s } = g(e, u), f = y(() => e.mode === "read" ? !0 : e.disabled);
|
|
37
37
|
function c() {
|
|
38
|
-
|
|
38
|
+
a.value?.focus?.();
|
|
39
39
|
}
|
|
40
40
|
function i() {
|
|
41
|
-
|
|
41
|
+
a.value?.blur?.();
|
|
42
42
|
}
|
|
43
43
|
return l({
|
|
44
44
|
focus: c,
|
|
45
45
|
blur: i
|
|
46
|
-
}), (p, V) => (B(), h(o(
|
|
46
|
+
}), (p, V) => (B(), h(o(R), C(o(w)(e, ["mode", "defaultValue"]), {
|
|
47
47
|
ref_key: "rateRef",
|
|
48
|
-
ref:
|
|
48
|
+
ref: a,
|
|
49
49
|
value: o(d),
|
|
50
50
|
disabled: f.value,
|
|
51
51
|
"onUpdate:value": o(s)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { debounce as
|
|
3
|
-
import { Select as
|
|
1
|
+
import { defineComponent as q, ref as D, shallowRef as R, computed as s, onMounted as z, watch as E, unref as a, createElementBlock as U, createBlock as K, openBlock as g, toDisplayString as H, mergeProps as $, createSlots as j, renderList as W, withCtx as S, renderSlot as Y, normalizeProps as G, guardReactiveProps as J, createVNode as Q } from "vue";
|
|
2
|
+
import { debounce as X, isFunction as B, isArray as Z, isNil as ee, omit as te } from "lodash-unified";
|
|
3
|
+
import { Select as oe, Spin as le } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { useDefaultPlaceholder as
|
|
6
|
-
import { useSelectOptions as
|
|
7
|
-
import { useControllableValue as
|
|
8
|
-
const
|
|
5
|
+
import { useDefaultPlaceholder as ae } from "../hooks/use-default-placeholder.mjs";
|
|
6
|
+
import { useSelectOptions as ne, SELECT_ALL_VALUE_KEY as f } from "./use-select-options.mjs";
|
|
7
|
+
import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
|
|
8
|
+
const ue = { key: 0 }, ve = /* @__PURE__ */ q({
|
|
9
9
|
name: "ApFieldSelect",
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
@@ -100,72 +100,75 @@ const ne = { key: 0 }, fe = /* @__PURE__ */ M({
|
|
|
100
100
|
searchDelay: { default: 300 }
|
|
101
101
|
},
|
|
102
102
|
emits: ["update:value"],
|
|
103
|
-
setup(
|
|
103
|
+
setup(C, { expose: w, emit: F }) {
|
|
104
104
|
let r = 0;
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
105
|
+
const e = C, b = X((t) => {
|
|
106
|
+
if (!B(e.request))
|
|
107
107
|
return;
|
|
108
108
|
r += 1;
|
|
109
109
|
const l = r;
|
|
110
|
-
|
|
111
|
-
r === l && (
|
|
110
|
+
d([]), n.value = !0, e.request(t).then((o) => {
|
|
111
|
+
r === l && (d(o), n.value = !1);
|
|
112
112
|
});
|
|
113
|
-
},
|
|
114
|
-
const o =
|
|
115
|
-
return typeof l?.[o] == "string" && l[o].toLowerCase().indexOf(
|
|
116
|
-
}, { options: u, updateOptions:
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
}, e.searchDelay), x = (t, l) => {
|
|
114
|
+
const o = e.fieldNames?.label || "label";
|
|
115
|
+
return typeof l?.[o] == "string" && l[o].toLowerCase().indexOf(t.toLowerCase()) > -1;
|
|
116
|
+
}, { options: u, updateOptions: d } = ne(e), m = R(), n = D(e?.loading || !1), N = F, O = s(() => {
|
|
117
|
+
if (e.multiple)
|
|
118
|
+
return e.tokenSeparators ? "tags" : "multiple";
|
|
119
|
+
});
|
|
120
|
+
async function c(t = !0) {
|
|
121
|
+
if (!B(e.request))
|
|
119
122
|
return;
|
|
120
123
|
n.value = !0, r += 1;
|
|
121
124
|
const l = r;
|
|
122
125
|
try {
|
|
123
|
-
|
|
124
|
-
const o = await
|
|
126
|
+
t && d([]);
|
|
127
|
+
const o = await e.request(void 0, e.params);
|
|
125
128
|
if (l !== r)
|
|
126
129
|
return;
|
|
127
|
-
|
|
130
|
+
d(o);
|
|
128
131
|
} finally {
|
|
129
132
|
n.value = !1;
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
|
-
function I(
|
|
133
|
-
|
|
135
|
+
function I(t) {
|
|
136
|
+
e.onFocus?.(t), e.refetchOnFocus && r > 0 && !n.value && c(!0);
|
|
134
137
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}),
|
|
138
|
-
() =>
|
|
138
|
+
z(() => {
|
|
139
|
+
e.lazy || c();
|
|
140
|
+
}), E(
|
|
141
|
+
() => e.params,
|
|
139
142
|
() => {
|
|
140
|
-
|
|
143
|
+
c();
|
|
141
144
|
},
|
|
142
145
|
{
|
|
143
146
|
deep: !0
|
|
144
147
|
}
|
|
145
148
|
);
|
|
146
|
-
const { value:
|
|
147
|
-
const
|
|
148
|
-
if (!
|
|
149
|
-
return
|
|
150
|
-
const l =
|
|
151
|
-
return
|
|
152
|
-
(i) => a(u).find((
|
|
153
|
-
).filter(Boolean).join("、") ||
|
|
154
|
-
(i) => i[o] ===
|
|
155
|
-
)?.[l] ||
|
|
156
|
-
}),
|
|
157
|
-
const
|
|
149
|
+
const { value: p, updateValue: v } = re(e, N), V = ae("Select", e), _ = s(() => {
|
|
150
|
+
const t = a(p);
|
|
151
|
+
if (!t)
|
|
152
|
+
return e.emptyText;
|
|
153
|
+
const l = e.fieldNames?.label || "label", o = e.fieldNames?.value || "value";
|
|
154
|
+
return Z(t) ? t.map(
|
|
155
|
+
(i) => a(u).find((T) => T[o] === i)?.[l]
|
|
156
|
+
).filter(Boolean).join("、") || e.emptyText : a(u).find(
|
|
157
|
+
(i) => i[o] === t
|
|
158
|
+
)?.[l] || e.emptyText;
|
|
159
|
+
}), A = s(() => {
|
|
160
|
+
const t = !!e?.showSearch, l = e.searchMode;
|
|
158
161
|
let o = {};
|
|
159
|
-
return
|
|
162
|
+
return t && (o = l === "request" ? {
|
|
160
163
|
defaultActiveFirstOption: !1,
|
|
161
|
-
onSearch:
|
|
164
|
+
onSearch: b,
|
|
162
165
|
notFoundContent: n.value ? void 0 : null,
|
|
163
166
|
filterOption: !1,
|
|
164
167
|
suffixIcon: null
|
|
165
168
|
} : {
|
|
166
|
-
filterOption:
|
|
169
|
+
filterOption: ee(e?.filterOption) ? x : e?.filterOption
|
|
167
170
|
}), {
|
|
168
|
-
...
|
|
171
|
+
...te(e, [
|
|
169
172
|
"mode",
|
|
170
173
|
"value",
|
|
171
174
|
"onUpdate:value",
|
|
@@ -178,56 +181,56 @@ const ne = { key: 0 }, fe = /* @__PURE__ */ M({
|
|
|
178
181
|
placeholder: a(V),
|
|
179
182
|
...o
|
|
180
183
|
};
|
|
181
|
-
}), y =
|
|
182
|
-
() => u.value.map((
|
|
183
|
-
),
|
|
184
|
-
if (!
|
|
185
|
-
return a(
|
|
184
|
+
}), y = s(
|
|
185
|
+
() => u.value.map((t) => t[e.fieldNames?.value || "value"]).filter((t) => t !== f)
|
|
186
|
+
), k = s(() => {
|
|
187
|
+
if (!e.multiple || !e.addAll)
|
|
188
|
+
return a(p);
|
|
186
189
|
if (u.value.some(
|
|
187
|
-
(
|
|
190
|
+
(t) => t[e.fieldNames?.value || "value"] === f
|
|
188
191
|
)) {
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
192
|
+
const t = a(y), l = a(p) || [];
|
|
193
|
+
if (t.length && t.every((o) => l?.includes(o)))
|
|
191
194
|
return [f];
|
|
192
195
|
}
|
|
193
|
-
return a(
|
|
196
|
+
return a(p);
|
|
194
197
|
});
|
|
195
|
-
function
|
|
196
|
-
return
|
|
198
|
+
function P(t) {
|
|
199
|
+
return e.multiple && t.includes(f) ? v(a(y)) : v(t);
|
|
197
200
|
}
|
|
198
201
|
function L() {
|
|
199
202
|
m.value?.focus();
|
|
200
203
|
}
|
|
201
|
-
function
|
|
204
|
+
function M() {
|
|
202
205
|
m.value?.blur();
|
|
203
206
|
}
|
|
204
|
-
return
|
|
207
|
+
return w({
|
|
205
208
|
focus: L,
|
|
206
|
-
blur:
|
|
207
|
-
request:
|
|
208
|
-
}), (
|
|
209
|
+
blur: M,
|
|
210
|
+
request: c
|
|
211
|
+
}), (t, l) => t.mode === "read" ? (g(), U("span", ue, H(_.value), 1)) : (g(), K(a(oe), $({
|
|
209
212
|
key: 1,
|
|
210
213
|
ref_key: "selectRef",
|
|
211
214
|
ref: m,
|
|
212
215
|
"allow-clear": ""
|
|
213
|
-
},
|
|
214
|
-
mode:
|
|
215
|
-
value:
|
|
216
|
+
}, A.value, {
|
|
217
|
+
mode: O.value,
|
|
218
|
+
value: k.value,
|
|
216
219
|
options: a(u),
|
|
217
220
|
loading: n.value,
|
|
218
|
-
"onUpdate:value":
|
|
221
|
+
"onUpdate:value": P,
|
|
219
222
|
onFocus: I
|
|
220
|
-
}),
|
|
221
|
-
|
|
223
|
+
}), j({ _: 2 }, [
|
|
224
|
+
W(t.$slots, (o, h) => ({
|
|
222
225
|
name: h,
|
|
223
|
-
fn:
|
|
224
|
-
|
|
226
|
+
fn: S((i) => [
|
|
227
|
+
Y(t.$slots, h, G(J(i || {})))
|
|
225
228
|
])
|
|
226
229
|
})),
|
|
227
230
|
n.value ? {
|
|
228
231
|
name: "notFoundContent",
|
|
229
|
-
fn:
|
|
230
|
-
|
|
232
|
+
fn: S(() => [
|
|
233
|
+
Q(a(le), { size: "small" })
|
|
231
234
|
]),
|
|
232
235
|
key: "0"
|
|
233
236
|
} : void 0
|
|
@@ -235,5 +238,5 @@ const ne = { key: 0 }, fe = /* @__PURE__ */ M({
|
|
|
235
238
|
}
|
|
236
239
|
});
|
|
237
240
|
export {
|
|
238
|
-
|
|
241
|
+
ve as default
|
|
239
242
|
};
|
|
@@ -63,7 +63,8 @@ declare function __VLS_template(): {
|
|
|
63
63
|
};
|
|
64
64
|
tipFormatter: {
|
|
65
65
|
type: PropType<(value?: number) => any>;
|
|
66
|
-
default: (value
|
|
66
|
+
default: (value
|
|
67
|
+
/** @type { typeof __VLS_ctx.sliderRef } */ ? /** @type { typeof __VLS_ctx.sliderRef } */: number) => any;
|
|
67
68
|
};
|
|
68
69
|
tooltipOpen: {
|
|
69
70
|
type: BooleanConstructor;
|
|
@@ -339,7 +340,8 @@ declare const __VLS_component: DefineComponent<ApFieldSliderProps, {
|
|
|
339
340
|
};
|
|
340
341
|
tipFormatter: {
|
|
341
342
|
type: PropType<(value?: number) => any>;
|
|
342
|
-
default: (value
|
|
343
|
+
default: (value
|
|
344
|
+
/** @type { typeof __VLS_ctx.sliderRef } */ ? /** @type { typeof __VLS_ctx.sliderRef } */: number) => any;
|
|
343
345
|
};
|
|
344
346
|
tooltipOpen: {
|
|
345
347
|
type: BooleanConstructor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as x,
|
|
1
|
+
import { defineComponent as B, useSlots as x, shallowRef as g, computed as k, unref as t, createElementBlock as C, createBlock as S, openBlock as n, Fragment as _, createTextVNode as h, toDisplayString as P, mergeProps as T, createSlots as V, renderList as b, withCtx as R, renderSlot as F, normalizeProps as U, guardReactiveProps as A } from "vue";
|
|
2
2
|
import { Slider as $ } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { isNil as
|
|
4
|
+
import { isNil as w, isArray as N, omit as z } from "lodash-unified";
|
|
5
5
|
import { useControllableValue as D } from "../../hooks/useControllableValue.mjs";
|
|
6
6
|
const I = /* @__PURE__ */ B({
|
|
7
7
|
name: "ApFieldSlider",
|
|
@@ -41,10 +41,10 @@ const I = /* @__PURE__ */ B({
|
|
|
41
41
|
emptyText: { default: "--" }
|
|
42
42
|
},
|
|
43
43
|
emits: ["update:value"],
|
|
44
|
-
setup(u, { expose:
|
|
45
|
-
const
|
|
44
|
+
setup(u, { expose: s, emit: i }) {
|
|
45
|
+
const p = x(), o = g(), l = u, d = i, { value: a, updateValue: f } = D(l, d), m = k(() => {
|
|
46
46
|
const e = t(a);
|
|
47
|
-
return
|
|
47
|
+
return w(e) ? l.emptyText : N(e) ? `${e[0]}-${e[1]}` : e;
|
|
48
48
|
});
|
|
49
49
|
function c() {
|
|
50
50
|
o.value?.focus?.();
|
|
@@ -52,12 +52,12 @@ const I = /* @__PURE__ */ B({
|
|
|
52
52
|
function v() {
|
|
53
53
|
o.value?.blur?.();
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return s({
|
|
56
56
|
focus: c,
|
|
57
57
|
blur: v
|
|
58
58
|
}), (e, E) => e.mode === "read" ? (n(), C(_, { key: 0 }, [
|
|
59
|
-
P(
|
|
60
|
-
], 64)) : (n(), S(t($),
|
|
59
|
+
h(P(m.value), 1)
|
|
60
|
+
], 64)) : (n(), S(t($), T(
|
|
61
61
|
{ key: 1 },
|
|
62
62
|
t(z)(l, [
|
|
63
63
|
"value",
|
|
@@ -72,11 +72,11 @@ const I = /* @__PURE__ */ B({
|
|
|
72
72
|
value: t(a),
|
|
73
73
|
"onUpdate:value": t(f)
|
|
74
74
|
}
|
|
75
|
-
),
|
|
76
|
-
|
|
75
|
+
), V({ _: 2 }, [
|
|
76
|
+
b(p, (L, r) => ({
|
|
77
77
|
name: r,
|
|
78
|
-
fn:
|
|
79
|
-
|
|
78
|
+
fn: R((y) => [
|
|
79
|
+
F(e.$slots, r, U(A(y || {})))
|
|
80
80
|
])
|
|
81
81
|
}))
|
|
82
82
|
]), 1040, ["value", "onUpdate:value"]));
|