@aplus-frontend/ui 0.5.20 → 0.5.21
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/interface.d.ts +6 -0
- package/es/src/ap-field/text/index.vue2.mjs +45 -39
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -0
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +8 -4
- package/es/src/ap-table/constants.d.ts +1 -0
- package/es/src/ap-table/utils.d.ts +1 -0
- package/es/src/business/ap-ladder/components/ValueGroupMode.vue2.mjs +51 -47
- package/es/src/business/ap-ladder/interface.d.ts +4 -0
- package/es/src/business/batch-input-group/index.vue.d.ts +1 -0
- package/es/src/business/batch-input-group/index.vue.mjs +2 -1
- package/lib/src/ap-field/interface.d.ts +6 -0
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -0
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +8 -4
- package/lib/src/ap-table/constants.d.ts +1 -0
- package/lib/src/ap-table/utils.d.ts +1 -0
- package/lib/src/business/ap-ladder/components/ValueGroupMode.vue2.js +1 -1
- package/lib/src/business/ap-ladder/interface.d.ts +4 -0
- package/lib/src/business/batch-input-group/index.vue.d.ts +1 -0
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/package.json +1 -1
|
@@ -15,6 +15,12 @@ export type BasicApFieldProps<FieldPropsType = any> = {
|
|
|
15
15
|
} & FieldPropsType;
|
|
16
16
|
export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
|
|
17
17
|
emptyText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 输入生效前的事件,受控输入拦截
|
|
20
|
+
* @param nextVal
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
beforeInput?: (nextVal: string) => string;
|
|
18
24
|
};
|
|
19
25
|
export type ApFieldTextPasswordProps = BasicApFieldProps<InputPasswordProps> & {
|
|
20
26
|
emptyText?: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Input as
|
|
1
|
+
import { isVNode as g, defineComponent as I, ref as C, useSlots as S, computed as _, createVNode as s, mergeProps as R, unref as p, createBlock as V, openBlock as w, resolveDynamicComponent as T } from "vue";
|
|
2
|
+
import { Input as j } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { omit as
|
|
5
|
-
import { useDefaultPlaceholder as
|
|
6
|
-
import { useControllableValue as
|
|
7
|
-
function
|
|
8
|
-
return typeof
|
|
4
|
+
import { omit as U } from "lodash-unified";
|
|
5
|
+
import { useDefaultPlaceholder as z } from "../hooks/use-default-placeholder.mjs";
|
|
6
|
+
import { useControllableValue as F } from "../../hooks/useControllableValue.mjs";
|
|
7
|
+
function M(a) {
|
|
8
|
+
return typeof a == "function" || Object.prototype.toString.call(a) === "[object Object]" && !g(a);
|
|
9
9
|
}
|
|
10
|
-
const
|
|
10
|
+
const G = /* @__PURE__ */ I({
|
|
11
11
|
name: "ApFieldText",
|
|
12
12
|
__name: "index",
|
|
13
13
|
props: {
|
|
@@ -88,54 +88,60 @@ const E = /* @__PURE__ */ B({
|
|
|
88
88
|
},
|
|
89
89
|
emptyText: {
|
|
90
90
|
default: "--"
|
|
91
|
-
}
|
|
91
|
+
},
|
|
92
|
+
beforeInput: {}
|
|
92
93
|
},
|
|
93
94
|
emits: ["update:value"],
|
|
94
|
-
setup(
|
|
95
|
-
expose:
|
|
96
|
-
emit:
|
|
95
|
+
setup(a, {
|
|
96
|
+
expose: m,
|
|
97
|
+
emit: y
|
|
97
98
|
}) {
|
|
98
|
-
const
|
|
99
|
-
|
|
99
|
+
const u = C(), t = S();
|
|
100
|
+
m({
|
|
100
101
|
focus: (e) => {
|
|
101
|
-
var
|
|
102
|
-
(
|
|
102
|
+
var n;
|
|
103
|
+
(n = u.value) == null || n.focus(e);
|
|
103
104
|
},
|
|
104
105
|
blur: () => {
|
|
105
106
|
var e;
|
|
106
|
-
(e =
|
|
107
|
+
(e = u.value) == null || e.blur();
|
|
107
108
|
},
|
|
108
|
-
setSelectionRange: (e,
|
|
109
|
-
var
|
|
110
|
-
(
|
|
109
|
+
setSelectionRange: (e, n, r) => {
|
|
110
|
+
var l;
|
|
111
|
+
(l = u.value) == null || l.setSelectionRange(e, n, r);
|
|
111
112
|
},
|
|
112
113
|
select: () => {
|
|
113
114
|
var e;
|
|
114
|
-
(e =
|
|
115
|
+
(e = u.value) == null || e.select();
|
|
115
116
|
},
|
|
116
|
-
input:
|
|
117
|
+
input: _(() => {
|
|
117
118
|
var e;
|
|
118
|
-
return (e =
|
|
119
|
+
return (e = u.value) == null ? void 0 : e.input;
|
|
119
120
|
})
|
|
120
121
|
});
|
|
121
|
-
const
|
|
122
|
-
value:
|
|
123
|
-
updateValue:
|
|
124
|
-
} =
|
|
125
|
-
function
|
|
126
|
-
var
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
122
|
+
const x = y, o = a, {
|
|
123
|
+
value: i,
|
|
124
|
+
updateValue: v
|
|
125
|
+
} = F(o, x), B = z("Text", o);
|
|
126
|
+
function b(e) {
|
|
127
|
+
var c, d, f;
|
|
128
|
+
const n = e.target.value || "", r = o.beforeInput ? (c = o.beforeInput) == null ? void 0 : c.call(o, n) : n, l = (f = (d = u.value) == null ? void 0 : d.$el) == null ? void 0 : f.querySelector("input");
|
|
129
|
+
l && (l.value = r), v(r);
|
|
130
|
+
}
|
|
131
|
+
function h() {
|
|
132
|
+
var e, n;
|
|
133
|
+
return o.mode === "edit" ? s(j, R(U(o, ["mode", "emptyText", "value", "onUpdate:value"]), {
|
|
134
|
+
placeholder: p(B),
|
|
135
|
+
value: p(i),
|
|
136
|
+
onInput: b,
|
|
137
|
+
ref: u
|
|
138
|
+
}), M(t) ? t : {
|
|
139
|
+
default: () => [t]
|
|
140
|
+
}) : s("span", null, [o.prefix || ((e = t == null ? void 0 : t.prefix) == null ? void 0 : e.call(t)), p(i) || o.emptyText, o.suffix || ((n = t == null ? void 0 : t.suffix) == null ? void 0 : n.call(t))]);
|
|
135
141
|
}
|
|
136
|
-
return (e,
|
|
142
|
+
return (e, n) => (w(), V(T(h())));
|
|
137
143
|
}
|
|
138
144
|
});
|
|
139
145
|
export {
|
|
140
|
-
|
|
146
|
+
G as default
|
|
141
147
|
};
|
|
@@ -75,6 +75,7 @@ declare function __VLS_template(): {
|
|
|
75
75
|
readonly clearIcon?: any;
|
|
76
76
|
readonly allowClear?: boolean | undefined;
|
|
77
77
|
readonly emptyText?: string | undefined;
|
|
78
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
78
79
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
79
80
|
$attrs: {
|
|
80
81
|
[x: string]: unknown;
|
|
@@ -230,6 +231,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTextProps, {
|
|
|
230
231
|
readonly clearIcon?: any;
|
|
231
232
|
readonly allowClear?: boolean | undefined;
|
|
232
233
|
readonly emptyText?: string | undefined;
|
|
234
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
233
235
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
234
236
|
$attrs: {
|
|
235
237
|
[x: string]: unknown;
|
|
@@ -705,7 +705,8 @@ declare function __VLS_template(): {
|
|
|
705
705
|
}>, {
|
|
706
706
|
blur: () => void;
|
|
707
707
|
focus: () => void;
|
|
708
|
-
request: (currentNode
|
|
708
|
+
request: (currentNode
|
|
709
|
+
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
709
710
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
710
711
|
"update:value": (...args: any[]) => void;
|
|
711
712
|
}, string, {
|
|
@@ -773,7 +774,8 @@ declare function __VLS_template(): {
|
|
|
773
774
|
}>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
|
|
774
775
|
blur: () => void;
|
|
775
776
|
focus: () => void;
|
|
776
|
-
request: (currentNode
|
|
777
|
+
request: (currentNode
|
|
778
|
+
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
777
779
|
}> & {} & ComponentCustomProperties & {} & {
|
|
778
780
|
$slots: Readonly<{
|
|
779
781
|
title?: any;
|
|
@@ -1479,7 +1481,8 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1479
1481
|
}>, {
|
|
1480
1482
|
blur: () => void;
|
|
1481
1483
|
focus: () => void;
|
|
1482
|
-
request: (currentNode
|
|
1484
|
+
request: (currentNode
|
|
1485
|
+
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1483
1486
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1484
1487
|
"update:value": (...args: any[]) => void;
|
|
1485
1488
|
}, string, {
|
|
@@ -1547,7 +1550,8 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1547
1550
|
}>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
|
|
1548
1551
|
blur: () => void;
|
|
1549
1552
|
focus: () => void;
|
|
1550
|
-
request: (currentNode
|
|
1553
|
+
request: (currentNode
|
|
1554
|
+
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1551
1555
|
}> & {} & ComponentCustomProperties & {} & {
|
|
1552
1556
|
$slots: Readonly<{
|
|
1553
1557
|
title?: any;
|
|
@@ -1666,6 +1666,7 @@ export declare const apTableFormItemMap: {
|
|
|
1666
1666
|
readonly clearIcon?: any;
|
|
1667
1667
|
readonly allowClear?: boolean | undefined;
|
|
1668
1668
|
readonly emptyText?: string | undefined;
|
|
1669
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
1669
1670
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1670
1671
|
$attrs: {
|
|
1671
1672
|
[x: string]: unknown;
|
|
@@ -374,6 +374,7 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
|
|
|
374
374
|
readonly clearIcon?: any;
|
|
375
375
|
readonly allowClear?: boolean | undefined;
|
|
376
376
|
readonly emptyText?: string | undefined;
|
|
377
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
377
378
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
378
379
|
$attrs: {
|
|
379
380
|
[x: string]: unknown;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Tooltip as
|
|
1
|
+
import { defineComponent as P, isVNode as C, h as g, ref as x, createBlock as h, openBlock as r, unref as i, normalizeProps as A, guardReactiveProps as B, createSlots as w, withCtx as v, createElementVNode as d, normalizeClass as s, createElementBlock as n, Fragment as f, renderList as j, createCommentVNode as p, normalizeStyle as u, createTextVNode as O, toDisplayString as a, withModifiers as z, renderSlot as M, createVNode as R } from "vue";
|
|
2
|
+
import { Tooltip as Y } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../../config-provider/index.mjs";
|
|
4
|
-
import { locales as
|
|
5
|
-
import { useNamespace as
|
|
6
|
-
const
|
|
4
|
+
import { locales as E } from "../interface.mjs";
|
|
5
|
+
import { useNamespace as G } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
6
|
+
const T = { key: 0 }, D = ["href", "onClick"], U = ["onClick"], b = { key: 0 }, q = { key: 0 }, W = /* @__PURE__ */ P({
|
|
7
7
|
name: "ApLadderValueGroupMode",
|
|
8
8
|
__name: "ValueGroupMode",
|
|
9
9
|
props: {
|
|
@@ -50,17 +50,17 @@ const E = { key: 0 }, G = ["href", "onClick"], T = { key: 0 }, D = { key: 0 }, Q
|
|
|
50
50
|
},
|
|
51
51
|
emits: ["update:valueRefs", "handleClick"],
|
|
52
52
|
setup(l, { emit: N }) {
|
|
53
|
-
const $ = N, { e: c } =
|
|
54
|
-
const { value:
|
|
55
|
-
return
|
|
53
|
+
const $ = N, { e: c } = G("ap-ladder"), m = (e) => C(e) || typeof e == "function", S = (e) => {
|
|
54
|
+
const { value: o, style: t } = e;
|
|
55
|
+
return C(o) ? g(o, {
|
|
56
56
|
style: t
|
|
57
|
-
}) : typeof
|
|
58
|
-
ref:
|
|
57
|
+
}) : typeof o == "function" ? g(o(), {
|
|
58
|
+
ref: x,
|
|
59
59
|
style: {
|
|
60
60
|
...t
|
|
61
61
|
}
|
|
62
62
|
}) : null;
|
|
63
|
-
}, k = (e,
|
|
63
|
+
}, k = (e, o = {
|
|
64
64
|
rawValue: !0,
|
|
65
65
|
precision: 2,
|
|
66
66
|
thousand: !0,
|
|
@@ -71,39 +71,39 @@ const E = { key: 0 }, G = ["href", "onClick"], T = { key: 0 }, D = { key: 0 }, Q
|
|
|
71
71
|
if (Object.prototype.toString.call(e) === "[object Null]" || Object.prototype.toString.call(e) === "[object Undefined]" || Object.prototype.toString.call(e) === "[object Object]" || Object.prototype.toString.call(e) === "[object Function]")
|
|
72
72
|
return "--";
|
|
73
73
|
if (typeof e == "number") {
|
|
74
|
-
if (
|
|
75
|
-
return `${e.toFixed(
|
|
76
|
-
if (
|
|
74
|
+
if (o.percent)
|
|
75
|
+
return `${e.toFixed(o.precision)}%`;
|
|
76
|
+
if (o.currency)
|
|
77
77
|
return e.toLocaleString(
|
|
78
|
-
|
|
78
|
+
E[o.currency ? o.currency : "CNY"],
|
|
79
79
|
{
|
|
80
80
|
style: "currency",
|
|
81
|
-
currency:
|
|
81
|
+
currency: o.currency ? o.currency : "CNY"
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
if (
|
|
85
|
-
const [t,
|
|
84
|
+
if (o.thousand) {
|
|
85
|
+
const [t, y] = e.toFixed(o.precision ? o.precision : 2).split(".");
|
|
86
86
|
return `${t.replace(
|
|
87
87
|
/(\d)(?=(\d{3})+(?!\d))/g,
|
|
88
|
-
`$1${
|
|
89
|
-
)}.${
|
|
88
|
+
`$1${o.thousandSeparator ? o.thousandSeparator : ","}`
|
|
89
|
+
)}.${y}`;
|
|
90
90
|
}
|
|
91
|
-
return e.toFixed(
|
|
91
|
+
return e.toFixed(o.precision ? o.precision : 2);
|
|
92
92
|
}
|
|
93
93
|
return e;
|
|
94
94
|
}, F = (e) => {
|
|
95
95
|
$("handleClick", e);
|
|
96
96
|
};
|
|
97
|
-
return (e,
|
|
97
|
+
return (e, o) => (r(), h(i(Y), A(B(l.tooltipProps)), w({
|
|
98
98
|
default: v(() => [
|
|
99
99
|
d("div", {
|
|
100
100
|
class: s(i(c)("value-group"))
|
|
101
101
|
}, [
|
|
102
|
-
(
|
|
103
|
-
key:
|
|
102
|
+
(r(!0), n(f, null, j(l.labelValues, (t, y) => (r(), n("div", {
|
|
103
|
+
key: y,
|
|
104
104
|
class: s(i(c)("value-group-item"))
|
|
105
105
|
}, [
|
|
106
|
-
t.label ? (
|
|
106
|
+
t.label ? (r(), n("div", {
|
|
107
107
|
key: 0,
|
|
108
108
|
class: s([
|
|
109
109
|
i(c)("value-group-label"),
|
|
@@ -111,18 +111,18 @@ const E = { key: 0 }, G = ["href", "onClick"], T = { key: 0 }, D = { key: 0 }, Q
|
|
|
111
111
|
]),
|
|
112
112
|
style: u(t.labelStyles)
|
|
113
113
|
}, [
|
|
114
|
-
O(
|
|
115
|
-
t.label ? (
|
|
114
|
+
O(a(t.label), 1),
|
|
115
|
+
t.label ? (r(), n("span", T, ":")) : p("", !0)
|
|
116
116
|
], 6)) : p("", !0),
|
|
117
117
|
d("div", {
|
|
118
118
|
class: s(i(c)("value-group-value"))
|
|
119
119
|
}, [
|
|
120
|
-
m(t.value) ? (
|
|
120
|
+
m(t.value) ? (r(), h(S, {
|
|
121
121
|
key: 0,
|
|
122
122
|
value: t.value,
|
|
123
123
|
style: u([t.labelColor, t.valueStyles])
|
|
124
|
-
}, null, 8, ["value", "style"])) : (
|
|
125
|
-
t.link ? (
|
|
124
|
+
}, null, 8, ["value", "style"])) : (r(), n(f, { key: 1 }, [
|
|
125
|
+
t.link ? (r(), n("a", {
|
|
126
126
|
key: 0,
|
|
127
127
|
href: t.link,
|
|
128
128
|
target: "_blank",
|
|
@@ -132,16 +132,20 @@ const E = { key: 0 }, G = ["href", "onClick"], T = { key: 0 }, D = { key: 0 }, Q
|
|
|
132
132
|
t.linkStyles,
|
|
133
133
|
t.linkColor ? { color: t.linkColor } : void 0
|
|
134
134
|
]),
|
|
135
|
-
onClick:
|
|
136
|
-
},
|
|
135
|
+
onClick: z((L) => F(t), ["prevent"])
|
|
136
|
+
}, a(k(t.value, { ...t })), 15, D)) : (r(), n(f, { key: 1 }, [
|
|
137
137
|
d("span", {
|
|
138
138
|
style: u([
|
|
139
139
|
l.valueStyles,
|
|
140
140
|
t.valueStyles,
|
|
141
141
|
t.valueColor ? { color: t.valueColor } : void 0
|
|
142
|
-
])
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
]),
|
|
143
|
+
class: s(
|
|
144
|
+
t.handleValueClick ? i(c)("value-group-link") : void 0
|
|
145
|
+
),
|
|
146
|
+
onClick: (L) => t.handleValueClick && t.handleValueClick(l.labelValues)
|
|
147
|
+
}, a(k(t.value, { ...t })), 15, U),
|
|
148
|
+
t.unit ? (r(), n("span", {
|
|
145
149
|
key: 0,
|
|
146
150
|
class: s(i(c)("value-group-unit")),
|
|
147
151
|
style: u([
|
|
@@ -149,7 +153,7 @@ const E = { key: 0 }, G = ["href", "onClick"], T = { key: 0 }, D = { key: 0 }, Q
|
|
|
149
153
|
t.unitStyles,
|
|
150
154
|
t.unitColor ? { color: t.unitColor } : void 0
|
|
151
155
|
])
|
|
152
|
-
},
|
|
156
|
+
}, a(t.unit), 7)) : p("", !0)
|
|
153
157
|
], 64))
|
|
154
158
|
], 64))
|
|
155
159
|
], 2)
|
|
@@ -161,7 +165,7 @@ const E = { key: 0 }, G = ["href", "onClick"], T = { key: 0 }, D = { key: 0 }, Q
|
|
|
161
165
|
e.$slots.title ? {
|
|
162
166
|
name: "title",
|
|
163
167
|
fn: v(() => [
|
|
164
|
-
|
|
168
|
+
M(e.$slots, "title")
|
|
165
169
|
]),
|
|
166
170
|
key: "0"
|
|
167
171
|
} : l.tooltip ? {
|
|
@@ -170,31 +174,31 @@ const E = { key: 0 }, G = ["href", "onClick"], T = { key: 0 }, D = { key: 0 }, Q
|
|
|
170
174
|
d("div", {
|
|
171
175
|
class: s(i(c)("tooltip"))
|
|
172
176
|
}, [
|
|
173
|
-
(
|
|
174
|
-
key:
|
|
177
|
+
(r(!0), n(f, null, j(l.labelValues, (t, y) => (r(), n("div", {
|
|
178
|
+
key: y,
|
|
175
179
|
class: s(i(c)("tooltip-item"))
|
|
176
180
|
}, [
|
|
177
181
|
d("span", {
|
|
178
182
|
class: s(i(c)("tooltip-label")),
|
|
179
183
|
style: u(l.tooltipLabelStyles)
|
|
180
|
-
},
|
|
181
|
-
m(t.value) ? (
|
|
184
|
+
}, a(t.label ? t.label : "--") + ": ", 7),
|
|
185
|
+
m(t.value) ? (r(), n("span", {
|
|
182
186
|
key: 0,
|
|
183
187
|
class: s(i(c)("tooltip-value")),
|
|
184
188
|
style: u(l.tooltipValueStyles)
|
|
185
189
|
}, [
|
|
186
|
-
|
|
190
|
+
R(S, {
|
|
187
191
|
value: t.value,
|
|
188
192
|
style: u([t.tooltipValueStyles])
|
|
189
193
|
}, null, 8, ["value", "style"]),
|
|
190
|
-
t.unit ? (
|
|
191
|
-
], 6)) : (
|
|
194
|
+
t.unit ? (r(), n("span", b, a(t.unit), 1)) : p("", !0)
|
|
195
|
+
], 6)) : (r(), n("span", {
|
|
192
196
|
key: 1,
|
|
193
197
|
class: s(i(c)("tooltip-value")),
|
|
194
198
|
style: u(l.tooltipValueStyles)
|
|
195
199
|
}, [
|
|
196
|
-
O(
|
|
197
|
-
t.unit ? (
|
|
200
|
+
O(a(k(t.value, { ...t })) + " ", 1),
|
|
201
|
+
t.unit ? (r(), n("span", q, a(t.unit), 1)) : p("", !0)
|
|
198
202
|
], 6))
|
|
199
203
|
], 2))), 128))
|
|
200
204
|
], 2)
|
|
@@ -205,5 +209,5 @@ const E = { key: 0 }, G = ["href", "onClick"], T = { key: 0 }, D = { key: 0 }, Q
|
|
|
205
209
|
}
|
|
206
210
|
});
|
|
207
211
|
export {
|
|
208
|
-
|
|
212
|
+
W as default
|
|
209
213
|
};
|
|
@@ -68,6 +68,10 @@ export interface ApLadderLabelValue {
|
|
|
68
68
|
* 跳转第三方链接 - 回调
|
|
69
69
|
*/
|
|
70
70
|
handleClickLink?: () => void;
|
|
71
|
+
/**
|
|
72
|
+
* value值-点击事件
|
|
73
|
+
*/
|
|
74
|
+
handleValueClick?: (labelValueRecord: ApLadderLabelValue[]) => void;
|
|
71
75
|
/**
|
|
72
76
|
* label 标签的文本对齐方式 仅支持健值对(labelValues)类型
|
|
73
77
|
* @default `right`
|
|
@@ -73,6 +73,7 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
|
|
|
73
73
|
readonly clearIcon?: any;
|
|
74
74
|
readonly allowClear?: boolean | undefined;
|
|
75
75
|
readonly emptyText?: string | undefined;
|
|
76
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
76
77
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
77
78
|
$attrs: {
|
|
78
79
|
[x: string]: unknown;
|
|
@@ -67,7 +67,8 @@ const d = "GROUP_SEARCH_ALL", ge = /* @__PURE__ */ N({
|
|
|
67
67
|
suffix: {},
|
|
68
68
|
clearIcon: {},
|
|
69
69
|
allowClear: { type: Boolean, default: !0 },
|
|
70
|
-
emptyText: { default: "--" }
|
|
70
|
+
emptyText: { default: "--" },
|
|
71
|
+
beforeInput: {}
|
|
71
72
|
},
|
|
72
73
|
emits: ["update:value"],
|
|
73
74
|
setup(V, { emit: C }) {
|
|
@@ -15,6 +15,12 @@ export type BasicApFieldProps<FieldPropsType = any> = {
|
|
|
15
15
|
} & FieldPropsType;
|
|
16
16
|
export type ApFieldTextProps = BasicApFieldProps<InputProps> & {
|
|
17
17
|
emptyText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 输入生效前的事件,受控输入拦截
|
|
20
|
+
* @param nextVal
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
beforeInput?: (nextVal: string) => string;
|
|
18
24
|
};
|
|
19
25
|
export type ApFieldTextPasswordProps = BasicApFieldProps<InputPasswordProps> & {
|
|
20
26
|
emptyText?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),B=require("@aplus-frontend/antdv");require("../../hooks/index.js");const g=require("lodash-unified"),C=require("../hooks/use-default-placeholder.js"),I=require("../../hooks/useControllableValue.js");function S(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!t.isVNode(a)}const _=t.defineComponent({name:"ApFieldText",__name:"index",props:{mode:{default:"edit"},class:{},style:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onMousedown:{},onMouseUp:{},onFocus:{},onBlur:{},onChange:{},onInput:{},onRawInput:{},"onUpdate:value":{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},value:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean,default:void 0},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"},beforeInput:{}},emits:["update:value"],setup(a,{expose:f,emit:m}){const l=t.ref(),o=t.useSlots();f({focus:e=>{var u;(u=l.value)==null||u.focus(e)},blur:()=>{var e;(e=l.value)==null||e.blur()},setSelectionRange:(e,u,c)=>{var r;(r=l.value)==null||r.setSelectionRange(e,u,c)},select:()=>{var e;(e=l.value)==null||e.select()},input:t.computed(()=>{var e;return(e=l.value)==null?void 0:e.input})});const y=m,n=a,{value:i,updateValue:v}=I.useControllableValue(n,y),x=C.useDefaultPlaceholder("Text",n);function b(e){var d,p,s;const u=e.target.value||"",c=n.beforeInput?(d=n.beforeInput)==null?void 0:d.call(n,u):u,r=(s=(p=l.value)==null?void 0:p.$el)==null?void 0:s.querySelector("input");r&&(r.value=c),v(c)}function h(){var e,u;return n.mode==="edit"?t.createVNode(B.Input,t.mergeProps(g.omit(n,["mode","emptyText","value","onUpdate:value"]),{placeholder:t.unref(x),value:t.unref(i),onInput:b,ref:l}),S(o)?o:{default:()=>[o]}):t.createVNode("span",null,[n.prefix||((e=o==null?void 0:o.prefix)==null?void 0:e.call(o)),t.unref(i)||n.emptyText,n.suffix||((u=o==null?void 0:o.suffix)==null?void 0:u.call(o))])}return(e,u)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(h())))}});exports.default=_;
|
|
@@ -75,6 +75,7 @@ declare function __VLS_template(): {
|
|
|
75
75
|
readonly clearIcon?: any;
|
|
76
76
|
readonly allowClear?: boolean | undefined;
|
|
77
77
|
readonly emptyText?: string | undefined;
|
|
78
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
78
79
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
79
80
|
$attrs: {
|
|
80
81
|
[x: string]: unknown;
|
|
@@ -230,6 +231,7 @@ declare const __VLS_component: DefineComponent<ApFormItemTextProps, {
|
|
|
230
231
|
readonly clearIcon?: any;
|
|
231
232
|
readonly allowClear?: boolean | undefined;
|
|
232
233
|
readonly emptyText?: string | undefined;
|
|
234
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
233
235
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
234
236
|
$attrs: {
|
|
235
237
|
[x: string]: unknown;
|
|
@@ -705,7 +705,8 @@ declare function __VLS_template(): {
|
|
|
705
705
|
}>, {
|
|
706
706
|
blur: () => void;
|
|
707
707
|
focus: () => void;
|
|
708
|
-
request: (currentNode
|
|
708
|
+
request: (currentNode
|
|
709
|
+
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
709
710
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
710
711
|
"update:value": (...args: any[]) => void;
|
|
711
712
|
}, string, {
|
|
@@ -773,7 +774,8 @@ declare function __VLS_template(): {
|
|
|
773
774
|
}>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
|
|
774
775
|
blur: () => void;
|
|
775
776
|
focus: () => void;
|
|
776
|
-
request: (currentNode
|
|
777
|
+
request: (currentNode
|
|
778
|
+
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
777
779
|
}> & {} & ComponentCustomProperties & {} & {
|
|
778
780
|
$slots: Readonly<{
|
|
779
781
|
title?: any;
|
|
@@ -1479,7 +1481,8 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1479
1481
|
}>, {
|
|
1480
1482
|
blur: () => void;
|
|
1481
1483
|
focus: () => void;
|
|
1482
|
-
request: (currentNode
|
|
1484
|
+
request: (currentNode
|
|
1485
|
+
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1483
1486
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1484
1487
|
"update:value": (...args: any[]) => void;
|
|
1485
1488
|
}, string, {
|
|
@@ -1547,7 +1550,8 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
1547
1550
|
}>, "blur" | "focus" | "request" | ("mode" | "open" | "multiple" | "disabled" | "bordered" | "virtual" | "dropdownMatchSelectWidth" | "showSearch" | "loading" | "autofocus" | "allowClear" | "defaultOpen" | "showArrow" | "autoClearSearchValue" | "labelInValue" | "treeCheckable" | "treeDefaultExpandAll" | "treeCheckStrictly" | "emptyText")> & ShallowUnwrapRef<{
|
|
1548
1551
|
blur: () => void;
|
|
1549
1552
|
focus: () => void;
|
|
1550
|
-
request: (currentNode
|
|
1553
|
+
request: (currentNode
|
|
1554
|
+
/** @type { typeof __VLS_ctx.treeSelectRef } */ ? /** @type { typeof __VLS_ctx.treeSelectRef } */: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
1551
1555
|
}> & {} & ComponentCustomProperties & {} & {
|
|
1552
1556
|
$slots: Readonly<{
|
|
1553
1557
|
title?: any;
|
|
@@ -1666,6 +1666,7 @@ export declare const apTableFormItemMap: {
|
|
|
1666
1666
|
readonly clearIcon?: any;
|
|
1667
1667
|
readonly allowClear?: boolean | undefined;
|
|
1668
1668
|
readonly emptyText?: string | undefined;
|
|
1669
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
1669
1670
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1670
1671
|
$attrs: {
|
|
1671
1672
|
[x: string]: unknown;
|
|
@@ -374,6 +374,7 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
|
|
|
374
374
|
readonly clearIcon?: any;
|
|
375
375
|
readonly allowClear?: boolean | undefined;
|
|
376
376
|
readonly emptyText?: string | undefined;
|
|
377
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
377
378
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
378
379
|
$attrs: {
|
|
379
380
|
[x: string]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("@aplus-frontend/antdv");require("../../../config-provider/index.js");const k=require("../interface.js"),f=require("../../../config-provider/hooks/use-namespace.js"),S={key:0},C=["href","onClick"],v=["onClick"],g={key:0},B={key:0},h=e.defineComponent({name:"ApLadderValueGroupMode",__name:"ValueGroupMode",props:{labelValues:{type:Array,default:()=>[]},labelAlign:{type:String,default:""},labelStyles:{type:Object,default:()=>({})},valueStyles:{type:Object,default:()=>({})},linkStyles:{type:Object,default:()=>({})},unitStyles:{type:Object,default:()=>({})},tooltipLabelStyles:{type:Object,default:()=>({})},tooltipValueStyles:{type:Object,default:()=>({})},tooltipProps:{type:Object,default:()=>({})},tooltip:{type:Boolean,default:!1}},emits:["update:valueRefs","handleClick"],setup(l,{emit:u}){const y=u,{e:r}=f.useNamespace("ap-ladder"),a=o=>e.isVNode(o)||typeof o=="function",s=o=>{const{value:n,style:t}=o;return e.isVNode(n)?e.h(n,{style:t}):typeof n=="function"?e.h(n(),{ref:e.ref,style:{...t}}):null},i=(o,n={rawValue:!0,precision:2,thousand:!0,thousandSeparator:",",currency:"CNY",percent:!1})=>{if(Object.prototype.toString.call(o)==="[object Null]"||Object.prototype.toString.call(o)==="[object Undefined]"||Object.prototype.toString.call(o)==="[object Object]"||Object.prototype.toString.call(o)==="[object Function]")return"--";if(typeof o=="number"){if(n.percent)return`${o.toFixed(n.precision)}%`;if(n.currency)return o.toLocaleString(k.locales[n.currency?n.currency:"CNY"],{style:"currency",currency:n.currency?n.currency:"CNY"});if(n.thousand){const[t,c]=o.toFixed(n.precision?n.precision:2).split(".");return`${t.replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${n.thousandSeparator?n.thousandSeparator:","}`)}.${c}`}return o.toFixed(n.precision?n.precision:2)}return o},d=o=>{y("handleClick",o)};return(o,n)=>(e.openBlock(),e.createBlock(e.unref(p.Tooltip),e.normalizeProps(e.guardReactiveProps(l.tooltipProps)),e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("value-group"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelValues,(t,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass(e.unref(r)("value-group-item"))},[t.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(r)("value-group-label"),l.labelAlign&&`label-align-${l.labelAlign}`]),style:e.normalizeStyle(t.labelStyles)},[e.createTextVNode(e.toDisplayString(t.label),1),t.label?(e.openBlock(),e.createElementBlock("span",S,":")):e.createCommentVNode("",!0)],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("value-group-value"))},[a(t.value)?(e.openBlock(),e.createBlock(s,{key:0,value:t.value,style:e.normalizeStyle([t.labelColor,t.valueStyles])},null,8,["value","style"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.link?(e.openBlock(),e.createElementBlock("a",{key:0,href:t.link,target:"_blank",class:e.normalizeClass(e.unref(r)("value-group-link")),style:e.normalizeStyle([l.linkStyles,t.linkStyles,t.linkColor?{color:t.linkColor}:void 0]),onClick:e.withModifiers(m=>d(t),["prevent"])},e.toDisplayString(i(t.value,{...t})),15,C)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",{style:e.normalizeStyle([l.valueStyles,t.valueStyles,t.valueColor?{color:t.valueColor}:void 0]),class:e.normalizeClass(t.handleValueClick?e.unref(r)("value-group-link"):void 0),onClick:m=>t.handleValueClick&&t.handleValueClick(l.labelValues)},e.toDisplayString(i(t.value,{...t})),15,v),t.unit?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r)("value-group-unit")),style:e.normalizeStyle([l.unitStyles,t.unitStyles,t.unitColor?{color:t.unitColor}:void 0])},e.toDisplayString(t.unit),7)):e.createCommentVNode("",!0)],64))],64))],2)],2))),128))],2)]),_:2},[o.$slots.title?{name:"title",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"title")]),key:"0"}:l.tooltip?{name:"title",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r)("tooltip"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelValues,(t,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass(e.unref(r)("tooltip-item"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r)("tooltip-label")),style:e.normalizeStyle(l.tooltipLabelStyles)},e.toDisplayString(t.label?t.label:"--")+": ",7),a(t.value)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r)("tooltip-value")),style:e.normalizeStyle(l.tooltipValueStyles)},[e.createVNode(s,{value:t.value,style:e.normalizeStyle([t.tooltipValueStyles])},null,8,["value","style"]),t.unit?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(t.unit),1)):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(r)("tooltip-value")),style:e.normalizeStyle(l.tooltipValueStyles)},[e.createTextVNode(e.toDisplayString(i(t.value,{...t}))+" ",1),t.unit?(e.openBlock(),e.createElementBlock("span",B,e.toDisplayString(t.unit),1)):e.createCommentVNode("",!0)],6))],2))),128))],2)]),key:"1"}:void 0]),1040))}});exports.default=h;
|
|
@@ -68,6 +68,10 @@ export interface ApLadderLabelValue {
|
|
|
68
68
|
* 跳转第三方链接 - 回调
|
|
69
69
|
*/
|
|
70
70
|
handleClickLink?: () => void;
|
|
71
|
+
/**
|
|
72
|
+
* value值-点击事件
|
|
73
|
+
*/
|
|
74
|
+
handleValueClick?: (labelValueRecord: ApLadderLabelValue[]) => void;
|
|
71
75
|
/**
|
|
72
76
|
* label 标签的文本对齐方式 仅支持健值对(labelValues)类型
|
|
73
77
|
* @default `right`
|
|
@@ -73,6 +73,7 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
|
|
|
73
73
|
readonly clearIcon?: any;
|
|
74
74
|
readonly allowClear?: boolean | undefined;
|
|
75
75
|
readonly emptyText?: string | undefined;
|
|
76
|
+
readonly beforeInput?: ((nextVal: string) => string) | undefined;
|
|
76
77
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
77
78
|
$attrs: {
|
|
78
79
|
[x: string]: unknown;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../../ap-field/index.js");const L=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const y=require("lodash-unified");require("./popover-input/index.vue.js");require("../../hooks/index.js");const N=require("../../utils/index.js"),O=require("../../ap-field/hooks/use-default-placeholder.js"),z=require("../../hooks/useControllableValue.js"),E=require("../../config-provider/hooks/use-locale.js"),F=require("../../config-provider/hooks/use-namespace.js"),T=require("../../ap-field/select/index.vue.js"),M=require("../../ap-field/text/index.js"),$=require("./popover-input/index.vue2.js"),p="GROUP_SEARCH_ALL",D=t.defineComponent({__name:"index",props:{style:{type:[Boolean,null,String,Object,Array]},inputStyle:{type:[Boolean,null,String,Object,Array]},options:{},hasAll:{type:Boolean,default:!0},value:{},"onUpdate:value":{},popoverPlacement:{default:"left"},mode:{default:"edit"},class:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onMousedown:{},onMouseUp:{},onFocus:{},onBlur:{},onChange:{},onInput:{},onRawInput:{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"}},emits:["update:value"],setup(h,{emit:g}){const l=h,B=O.useDefaultPlaceholder("Text",l),b=g,{value:u,updateValue:
|
|
2
|
-
`):""}),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../../ap-field/index.js");const L=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const y=require("lodash-unified");require("./popover-input/index.vue.js");require("../../hooks/index.js");const N=require("../../utils/index.js"),O=require("../../ap-field/hooks/use-default-placeholder.js"),z=require("../../hooks/useControllableValue.js"),E=require("../../config-provider/hooks/use-locale.js"),F=require("../../config-provider/hooks/use-namespace.js"),T=require("../../ap-field/select/index.vue.js"),M=require("../../ap-field/text/index.js"),$=require("./popover-input/index.vue2.js"),p="GROUP_SEARCH_ALL",D=t.defineComponent({__name:"index",props:{style:{type:[Boolean,null,String,Object,Array]},inputStyle:{type:[Boolean,null,String,Object,Array]},options:{},hasAll:{type:Boolean,default:!0},value:{},"onUpdate:value":{},popoverPlacement:{default:"left"},mode:{default:"edit"},class:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onMousedown:{},onMouseUp:{},onFocus:{},onBlur:{},onChange:{},onInput:{},onRawInput:{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"},beforeInput:{}},emits:["update:value"],setup(h,{emit:g}){const l=h,B=O.useDefaultPlaceholder("Text",l),b=g,{value:u,updateValue:a}=z.useControllableValue(l,b),i=t.ref(),c=t.ref(),{t:V}=E.useLocale(),{b:_,cssVar:A}=F.useNamespace("batch-input-group"),C=t.computed(()=>{const e=l.popoverPlacement;return{"popover-left":y.isNumber(e)?`${e}px`:e==="left"?"0px":"unset","popover-right":e==="right"?"0px":"unset"}}),q=t.computed(()=>l.options?l.options.length>1&&l.hasAll?[{value:p,label:V("ap.common.all")},...l.options]:l.options:[]),S=t.computed(()=>l.options?l.options.map(e=>e.value):[]),x=t.computed(()=>{var e,n;return(n=(e=t.unref(u))==null?void 0:e.value)!=null&&n.length?t.unref(u).value.join(","):""}),I=t.computed(()=>{var e,n;return(n=(e=t.unref(u))==null?void 0:e.value)!=null&&n.length?t.unref(u).value.join(`
|
|
2
|
+
`):""}),P=t.computed(()=>{var n;const e=(n=t.unref(u))==null?void 0:n.key;if(e!=null&&e.length)return e.length===1?e[0]:p}),U=t.computed(()=>{var o;const e=(o=t.unref(u))==null?void 0:o.key;return!e||(e==null?void 0:e.length)<=1?t.unref(B):(l.options||[]).filter(r=>e.includes(r.value)).map(r=>r.label).join("/")});function w(e){const n=t.unref(u)||{},o=e===p?t.unref(S):N.isDef(e)?[e]:[];a({...n,key:o})}function k(e){var f,v;const n=t.unref(u)||{},o=e.target.value||"",r=o.replace(/[,]+/g,",");if(o!==r){const m=(v=(f=c.value)==null?void 0:f.$el)==null?void 0:v.querySelector("input");m&&(m.value=r)}let s=r.split(",");s.length===1&&s[0]===""&&(s=[]),a({...n,value:s})}function R(e){const n=t.unref(u)||{};let o=e.split(/,|\n/);a({...n,value:o})}function d(){var o;const e=t.unref(u)||{},n=(o=e.value)==null?void 0:o.filter(Boolean);a({...e,value:n})}function j(e){var n;d(),(n=l.onBlur)==null||n.call(l,e)}return(e,n)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"containerRef",ref:i,class:t.normalizeClass(t.unref(_)()),style:t.normalizeStyle(t.unref(A)(C.value)),onFocus:n[0]||(n[0]=(...o)=>e.onFocus&&e.onFocus(...o)),onBlur:n[1]||(n[1]=(...o)=>e.onBlur&&e.onBlur(...o))},[t.createVNode(t.unref(L.Space).Compact,{block:""},{default:t.withCtx(()=>{var o;return[(o=e.options)!=null&&o.length?(t.openBlock(),t.createBlock(t.unref(T.default),{key:0,style:t.normalizeStyle(e.style),options:q.value,value:P.value,"allow-clear":!1,"dropdown-match-select-width":!1,disabled:e.disabled,"get-popup-container":()=>i.value,"onUpdate:value":w},null,8,["style","options","value","disabled","get-popup-container"])):t.createCommentVNode("",!0),t.createVNode(t.unref(M.ApFieldText),t.mergeProps(t.unref(y.omit)(l,["style","value","onUpdate:value","inputStyle","hasAll","options","onBlur"]),{ref_key:"inputRef",ref:c,style:e.inputStyle,value:x.value,placeholder:U.value,onInput:k,onBlur:j}),{suffix:t.withCtx(()=>[t.createVNode($.default,{_parent:i.value,value:I.value,disabled:e.disabled,placement:l.popoverPlacement,"onUpdate:value":R,onClose:d},null,8,["_parent","value","disabled","placement"])]),_:1},16,["style","value","placeholder"])]}),_:1})],38))}});exports.default=D;
|