@unicom-cloud/ui 0.8.105 → 0.8.107
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/App.js +7 -0
- package/BackTop.js +2 -4
- package/Calendar.js +2 -2
- package/Modal.js +4 -2
- package/Segmented.js +4 -2
- package/app/App.js +26 -0
- package/app/context.js +9 -0
- package/app/index.js +9 -0
- package/app/interface.js +1 -0
- package/app/useApp.js +8 -0
- package/back-top/index.js +44 -56
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- package/color-picker/index.js +34 -34
- package/components/common/flex/index.js +4 -4
- package/components/common/icons/file/index.js +13 -11
- package/components/common/utils/dayjs.js +99 -124
- package/components/common/utils/is.js +98 -104
- package/components/common/utils/setDir.js +12 -0
- package/components/common/utils/setTheme.js +13 -13
- package/config-provider/ConfigProvider.js +32 -30
- package/descriptions/index.js +32 -32
- package/divider/index.js +28 -20
- package/empty/index.js +1 -1
- package/grid/Grid.js +55 -88
- package/grid/Item.js +40 -61
- package/grid/context.js +1 -4
- package/grid/hook/useResponsiveState.js +22 -25
- package/grid/util.js +6 -44
- package/index.js +462 -457
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/Search.js +24 -24
- package/modal/Confirm.js +17 -17
- package/modal/Modal.js +247 -237
- package/modal/index.js +4 -2
- package/modal/use-modal/index.js +2 -2
- package/package.json +1 -1
- package/segmented/index.js +93 -90
- package/select-view/Core.js +31 -28
- package/splitter/SplitBar.js +44 -46
- package/style.css +1 -1
- package/table/Table.js +198 -210
- package/table/th-resizable/index.js +9 -10
- package/time-picker/util.js +20 -30
- package/types/common/development/interface.d.ts +3 -3
- package/types/common/utils/is.d.ts +3 -4
- package/types/common/utils/setDir.d.ts +2 -0
- package/types/pc/app/App.d.ts +6 -0
- package/types/pc/app/context.d.ts +4 -0
- package/types/pc/app/index.d.ts +5 -0
- package/types/pc/app/interface.d.ts +17 -0
- package/types/pc/app/useApp.d.ts +3 -0
- package/types/pc/back-top/interface.d.ts +4 -17
- package/types/pc/calendar/Lunar.d.ts +17 -0
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +1 -1
- package/types/pc/divider/interface.d.ts +1 -0
- package/types/pc/grid/Grid.d.ts +1 -2
- package/types/pc/grid/Item.d.ts +2 -5
- package/types/pc/grid/context.d.ts +4 -10
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +9 -19
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/index.d.ts +3 -1
- package/types/pc/input/Button.d.ts +2 -2
- package/types/pc/message/index.d.ts +1 -9
- package/types/pc/message/interface.d.ts +8 -0
- package/types/pc/message/useMessage.d.ts +1 -2
- package/types/pc/modal/Modal.d.ts +1 -0
- package/types/pc/modal/config.d.ts +1 -2
- package/types/pc/modal/index.d.ts +2 -1
- package/types/pc/modal/interface.d.ts +17 -5
- package/types/pc/notification/index.d.ts +2 -9
- package/types/pc/notification/interface.d.ts +7 -0
- package/types/pc/notification/useNotification.d.ts +1 -2
- package/types/pc/segmented/interface.d.ts +6 -0
- package/types/pc/select-view/Core.d.ts +1 -8
- package/types/pc/select-view/index.d.ts +1 -8
- package/types/pc/select-view/interface.d.ts +9 -2
- package/types/pc/utils/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +303 -0
- package/utils/index.js +58 -59
- package/utils/is.js +65 -66
- package/utils/names.js +298 -144
- package/version/index.js +1 -1
package/modal/index.js
CHANGED
package/modal/use-modal/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unicom-cloud/ui","version":"0.8.
|
|
1
|
+
{"name":"@unicom-cloud/ui","version":"0.8.107","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"react":"^18.3.1","react-dom":"^18.3.1","dayjs":"^1.11.10","lodash":"^4.17.21","uuid":"^11.1.0","qrcode.react":"^4.2.0"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
|
package/segmented/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { jsxs as D, jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as D, jsx as v, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as re, useContext as oe, useMemo as ie, useState as P, useRef as A, useCallback as se, useEffect as $ } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
4
|
import ae from "../components/common/hooks/useMergeProps.js";
|
|
5
5
|
import j from "@unicom-cloud/utils/class-name";
|
|
6
|
-
import
|
|
7
|
-
import le from "../
|
|
8
|
-
|
|
6
|
+
import "../components/common/utils/is.js";
|
|
7
|
+
import { resizeObserver as le } from "../components/common/utils/resizeObserver.js";
|
|
8
|
+
import ce from "../config-provider/context.js";
|
|
9
|
+
import { isNil as ue, isFunction as de } from "@unicom-cloud/utils/is";
|
|
10
|
+
const fe = {
|
|
9
11
|
options: [],
|
|
10
12
|
size: "medium",
|
|
11
13
|
mode: "default",
|
|
@@ -14,56 +16,57 @@ const ce = {
|
|
|
14
16
|
direction: "horizontal",
|
|
15
17
|
showIndicator: !0,
|
|
16
18
|
animationDuration: 300
|
|
17
|
-
},
|
|
18
|
-
(B,
|
|
19
|
-
const { getPrefixCls: E, componentConfig: M, rtl:
|
|
19
|
+
}, pe = re(
|
|
20
|
+
(B, p) => {
|
|
21
|
+
const { getPrefixCls: E, componentConfig: M, rtl: F } = oe(ce), K = ae(
|
|
20
22
|
B,
|
|
21
|
-
|
|
23
|
+
fe,
|
|
22
24
|
M?.Segmented
|
|
23
25
|
), {
|
|
24
|
-
style:
|
|
25
|
-
className:
|
|
26
|
+
style: L,
|
|
27
|
+
className: U,
|
|
26
28
|
options: O = [],
|
|
27
|
-
defaultValue:
|
|
29
|
+
defaultValue: c,
|
|
28
30
|
value: R,
|
|
29
31
|
size: H,
|
|
30
|
-
mode:
|
|
31
|
-
disabled:
|
|
32
|
-
block:
|
|
33
|
-
direction:
|
|
34
|
-
showIndicator:
|
|
35
|
-
animationDuration:
|
|
32
|
+
mode: k,
|
|
33
|
+
disabled: m,
|
|
34
|
+
block: T,
|
|
35
|
+
direction: h,
|
|
36
|
+
showIndicator: C,
|
|
37
|
+
animationDuration: _,
|
|
36
38
|
name: x,
|
|
37
|
-
|
|
39
|
+
immediateTrigger: q,
|
|
40
|
+
onChange: u,
|
|
38
41
|
...G
|
|
39
|
-
} =
|
|
42
|
+
} = K, i = ie(() => O.map((e) => typeof e == "string" ? { value: e, label: e } : e), [O]), [J, S] = P(() => c && i.some((e) => e.value === c) ? c : i[0]?.value || ""), [Q, b] = P({}), d = A(null), I = A([]), V = A(!1), r = E?.("segmented"), W = j(
|
|
40
43
|
r,
|
|
41
44
|
{
|
|
42
|
-
[`${r}-block`]:
|
|
43
|
-
[`${r}-disabled`]:
|
|
44
|
-
[`${r}-rtl`]:
|
|
45
|
-
[`${r}-${
|
|
46
|
-
[`${r}-${
|
|
45
|
+
[`${r}-block`]: T,
|
|
46
|
+
[`${r}-disabled`]: m,
|
|
47
|
+
[`${r}-rtl`]: F,
|
|
48
|
+
[`${r}-${k}`]: k,
|
|
49
|
+
[`${r}-${h}`]: h
|
|
47
50
|
},
|
|
48
|
-
|
|
49
|
-
),
|
|
50
|
-
if (
|
|
51
|
-
|
|
51
|
+
U
|
|
52
|
+
), g = R !== void 0, a = g ? R : J, w = se(() => {
|
|
53
|
+
if (!C || !d.current) {
|
|
54
|
+
b((s) => ({ ...s, opacity: 0 }));
|
|
52
55
|
return;
|
|
53
56
|
}
|
|
54
|
-
const e =
|
|
55
|
-
(
|
|
57
|
+
const e = i.findIndex(
|
|
58
|
+
(s) => s?.value === a
|
|
56
59
|
);
|
|
57
60
|
if (e === -1) {
|
|
58
|
-
|
|
61
|
+
b((s) => ({ ...s, opacity: 0 }));
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
61
|
-
const o =
|
|
64
|
+
const o = I.current[e];
|
|
62
65
|
if (!o) {
|
|
63
|
-
|
|
66
|
+
b((s) => ({ ...s, opacity: 0 }));
|
|
64
67
|
return;
|
|
65
68
|
}
|
|
66
|
-
const n =
|
|
69
|
+
const n = d.current.getBoundingClientRect(), t = o.getBoundingClientRect(), l = h === "vertical" ? {
|
|
67
70
|
width: t.width,
|
|
68
71
|
// 垂直模式下宽度撑满
|
|
69
72
|
top: t.top - n.top,
|
|
@@ -74,15 +77,15 @@ const ce = {
|
|
|
74
77
|
height: t.height
|
|
75
78
|
// 水平模式下高度撑满
|
|
76
79
|
};
|
|
77
|
-
|
|
80
|
+
b({
|
|
78
81
|
...l,
|
|
79
82
|
opacity: 1
|
|
80
83
|
});
|
|
81
|
-
}, [i,
|
|
82
|
-
o ||
|
|
83
|
-
},
|
|
84
|
-
if (
|
|
85
|
-
const n =
|
|
84
|
+
}, [a, i, C, h]), z = (e, o) => {
|
|
85
|
+
o || m || (g || S(e), u?.(e));
|
|
86
|
+
}, X = (e, o) => {
|
|
87
|
+
if (m) return;
|
|
88
|
+
const n = i.length;
|
|
86
89
|
if (n === 0) return;
|
|
87
90
|
let t = o;
|
|
88
91
|
switch (e.key) {
|
|
@@ -103,114 +106,114 @@ const ce = {
|
|
|
103
106
|
default:
|
|
104
107
|
return;
|
|
105
108
|
}
|
|
106
|
-
for (; t !== o &&
|
|
109
|
+
for (; t !== o && i[t]?.disabled; )
|
|
107
110
|
t = (t + (e.key === "ArrowLeft" || e.key === "ArrowUp" ? -1 : 1) + n) % n;
|
|
108
|
-
const l =
|
|
109
|
-
l && l !==
|
|
111
|
+
const l = i[t]?.value;
|
|
112
|
+
l && l !== a && (z(l), I.current[t]?.focus());
|
|
110
113
|
};
|
|
111
|
-
|
|
114
|
+
$(() => {
|
|
112
115
|
if (!V.current) {
|
|
113
116
|
V.current = !0;
|
|
114
117
|
return;
|
|
115
118
|
}
|
|
116
|
-
if (!
|
|
117
|
-
const e =
|
|
118
|
-
|
|
119
|
+
if (!i.some((e) => e.value === a)) {
|
|
120
|
+
const e = i[0]?.value || "";
|
|
121
|
+
g || S(e), u?.(e);
|
|
119
122
|
}
|
|
120
|
-
}, [
|
|
121
|
-
|
|
122
|
-
}, [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
}, [i, a, g, u]), $(() => {
|
|
124
|
+
q && !ue(c) && de(u) && u(c);
|
|
125
|
+
}, []), $(() => {
|
|
126
|
+
w();
|
|
127
|
+
}, [a, i, w]), $(() => {
|
|
128
|
+
if (!d.current) return;
|
|
129
|
+
const e = le(
|
|
130
|
+
[d.current],
|
|
126
131
|
() => {
|
|
127
|
-
|
|
132
|
+
w();
|
|
128
133
|
}
|
|
129
134
|
);
|
|
130
135
|
return () => {
|
|
131
136
|
e();
|
|
132
137
|
};
|
|
133
|
-
}, [
|
|
134
|
-
const
|
|
138
|
+
}, [w]);
|
|
139
|
+
const Y = (e, o) => {
|
|
135
140
|
if (e.render)
|
|
136
141
|
return e.render(e, o);
|
|
137
142
|
const n = !e.label && !!e.icon;
|
|
138
|
-
return /* @__PURE__ */ D(
|
|
139
|
-
e.icon && /* @__PURE__ */
|
|
140
|
-
!n && e.label && /* @__PURE__ */
|
|
143
|
+
return /* @__PURE__ */ D(ne, { children: [
|
|
144
|
+
e.icon && /* @__PURE__ */ v("span", { className: `${r}-option-icon`, children: e.icon }),
|
|
145
|
+
!n && e.label && /* @__PURE__ */ v("span", { className: `${r}-option-label`, children: e.label })
|
|
141
146
|
] });
|
|
142
147
|
};
|
|
143
148
|
return /* @__PURE__ */ D(
|
|
144
149
|
"div",
|
|
145
150
|
{
|
|
146
151
|
ref: (e) => {
|
|
147
|
-
typeof
|
|
152
|
+
typeof p == "function" ? p(e) : p && (p.current = e), d.current = e;
|
|
148
153
|
},
|
|
149
154
|
...G,
|
|
150
|
-
style:
|
|
151
|
-
className:
|
|
155
|
+
style: L,
|
|
156
|
+
className: W,
|
|
152
157
|
role: "radiogroup",
|
|
153
158
|
children: [
|
|
154
|
-
!Array.isArray(
|
|
159
|
+
!Array.isArray(i) || i.length === 0 ? null : i.map((e, o) => {
|
|
155
160
|
if (!e) return null;
|
|
156
161
|
const {
|
|
157
162
|
value: n,
|
|
158
163
|
label: t,
|
|
159
164
|
disabled: l,
|
|
160
|
-
icon:
|
|
161
|
-
render:
|
|
162
|
-
...
|
|
163
|
-
} = e,
|
|
165
|
+
icon: s,
|
|
166
|
+
render: he,
|
|
167
|
+
...Z
|
|
168
|
+
} = e, f = n === a, y = l || m, ee = !t && !!s, te = [t, n, o].filter(Boolean).join("-");
|
|
164
169
|
return /* @__PURE__ */ D(
|
|
165
170
|
"button",
|
|
166
171
|
{
|
|
167
|
-
ref: (
|
|
172
|
+
ref: (N) => I.current[o] = N,
|
|
168
173
|
className: j(
|
|
169
174
|
`${r}-option`,
|
|
170
175
|
`${r}-option-${H}`,
|
|
171
|
-
`${r}-option-${
|
|
176
|
+
`${r}-option-${k}`,
|
|
172
177
|
{
|
|
173
|
-
[`${r}-option-active`]:
|
|
174
|
-
[`${r}-option-disabled`]:
|
|
175
|
-
[`${r}-option-icon-only`]:
|
|
178
|
+
[`${r}-option-active`]: f,
|
|
179
|
+
[`${r}-option-disabled`]: y,
|
|
180
|
+
[`${r}-option-icon-only`]: ee
|
|
176
181
|
}
|
|
177
182
|
),
|
|
178
|
-
onClick: () => z(n,
|
|
179
|
-
onKeyDown: (
|
|
180
|
-
disabled:
|
|
183
|
+
onClick: () => z(n, y),
|
|
184
|
+
onKeyDown: (N) => X(N, o),
|
|
185
|
+
disabled: y,
|
|
181
186
|
role: "radio",
|
|
182
|
-
"aria-checked":
|
|
183
|
-
"aria-disabled":
|
|
184
|
-
tabIndex:
|
|
185
|
-
...
|
|
187
|
+
"aria-checked": f,
|
|
188
|
+
"aria-disabled": y,
|
|
189
|
+
tabIndex: f ? 0 : -1,
|
|
190
|
+
...Z,
|
|
186
191
|
children: [
|
|
187
|
-
x && /* @__PURE__ */
|
|
192
|
+
x && /* @__PURE__ */ v(
|
|
188
193
|
"input",
|
|
189
194
|
{
|
|
190
195
|
type: "radio",
|
|
191
196
|
name: x,
|
|
192
197
|
value: n,
|
|
193
|
-
checked:
|
|
194
|
-
onChange: () => {
|
|
195
|
-
},
|
|
198
|
+
checked: f,
|
|
196
199
|
className: `${r}-input`,
|
|
197
200
|
tabIndex: -1,
|
|
198
201
|
"aria-hidden": "true"
|
|
199
202
|
}
|
|
200
203
|
),
|
|
201
|
-
|
|
204
|
+
Y(e, f)
|
|
202
205
|
]
|
|
203
206
|
},
|
|
204
|
-
|
|
207
|
+
te
|
|
205
208
|
);
|
|
206
209
|
}),
|
|
207
|
-
|
|
210
|
+
C && /* @__PURE__ */ v(
|
|
208
211
|
"div",
|
|
209
212
|
{
|
|
210
213
|
className: `${r}-indicator`,
|
|
211
214
|
style: {
|
|
212
215
|
...Q,
|
|
213
|
-
transitionDuration: `${
|
|
216
|
+
transitionDuration: `${_}ms`
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
219
|
)
|
|
@@ -219,7 +222,7 @@ const ce = {
|
|
|
219
222
|
);
|
|
220
223
|
}
|
|
221
224
|
);
|
|
222
|
-
|
|
225
|
+
pe.displayName = "Segmented";
|
|
223
226
|
export {
|
|
224
|
-
|
|
227
|
+
pe as default
|
|
225
228
|
};
|
package/select-view/Core.js
CHANGED
|
@@ -36,7 +36,7 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
36
36
|
allowCreate: Ce,
|
|
37
37
|
status: xe,
|
|
38
38
|
loading: Ie,
|
|
39
|
-
disabled:
|
|
39
|
+
disabled: b,
|
|
40
40
|
animation: we,
|
|
41
41
|
prefixCls: n,
|
|
42
42
|
suffixIcon: G,
|
|
@@ -45,7 +45,7 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
45
45
|
clearIcon: D,
|
|
46
46
|
placeholder: q,
|
|
47
47
|
renderText: X,
|
|
48
|
-
value:
|
|
48
|
+
value: v,
|
|
49
49
|
inputValue: F,
|
|
50
50
|
popupVisible: p,
|
|
51
51
|
maxTagCount: c,
|
|
@@ -66,7 +66,7 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
66
66
|
onRemoveCheckedItem: Re,
|
|
67
67
|
onSort: A,
|
|
68
68
|
...Oe
|
|
69
|
-
} = x, N = ae(null), f = ae(null), { size: Me, getPrefixCls: Q } = qe(fo), [Ae, Y] = ce(w.NONE), [B, Z] = ce(!1), Be = to(), T = "showSearch" in x ? x.showSearch : I, m = T || Ce, y = ge || Me, V = B || p, Ve = C(T) && T.retainInputValue,
|
|
69
|
+
} = x, N = ae(null), f = ae(null), { size: Me, getPrefixCls: Q } = qe(fo), [Ae, Y] = ce(w.NONE), [B, Z] = ce(!1), Be = to(), T = "showSearch" in x ? x.showSearch : I, m = T || Ce, y = ge || Me, V = B || p, Ve = C(T) && T.retainInputValue, h = !I && v !== void 0 ? X(v).text : "", _ = (e) => {
|
|
70
70
|
e?.preventDefault?.();
|
|
71
71
|
}, U = (e) => {
|
|
72
72
|
const o = m ? N.current : f.current;
|
|
@@ -103,13 +103,13 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
103
103
|
let e;
|
|
104
104
|
switch (Ae) {
|
|
105
105
|
case w.BEFORE:
|
|
106
|
-
e = F || (Ve ?
|
|
106
|
+
e = F || (Ve ? h : "");
|
|
107
107
|
break;
|
|
108
108
|
case w.EDITING:
|
|
109
109
|
e = F || "";
|
|
110
110
|
break;
|
|
111
111
|
default:
|
|
112
|
-
e =
|
|
112
|
+
e = h;
|
|
113
113
|
break;
|
|
114
114
|
}
|
|
115
115
|
const o = !!(V && m || R), s = {
|
|
@@ -117,7 +117,8 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
117
117
|
// _inputValue after renderText(value) may be rich text, but the value of <input> cannot be object
|
|
118
118
|
value: o && typeof e != "object" ? e : "",
|
|
119
119
|
// Allow placeholder to display the selected value first when searching
|
|
120
|
-
placeholder: m &&
|
|
120
|
+
placeholder: m && // 0 can also be used as a placeholder, because when options is number[], the selected value may be 0
|
|
121
|
+
(h || h === 0) && typeof h != "object" ? h : q
|
|
121
122
|
};
|
|
122
123
|
return m ? (s.onPaste = i.paste, s.onKeyDown = i.keyDown, s.onFocus = i.focus, s.onBlur = i.blur, s.onChange = i.change) : (s.tabIndex = -1, s.style.pointerEvents = "none"), /* @__PURE__ */ k("span", { className: `${n}-view-selector`, children: [
|
|
123
124
|
/* @__PURE__ */ t(
|
|
@@ -125,7 +126,7 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
125
126
|
{
|
|
126
127
|
"aria-hidden": !o || void 0,
|
|
127
128
|
ref: N,
|
|
128
|
-
disabled:
|
|
129
|
+
disabled: b,
|
|
129
130
|
className: E(`${n}-view-input`, {
|
|
130
131
|
[`${n}-hidden`]: !o
|
|
131
132
|
}),
|
|
@@ -149,9 +150,9 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
149
150
|
}, L = Qe(() => {
|
|
150
151
|
if (!I)
|
|
151
152
|
return [];
|
|
152
|
-
const e = le(
|
|
153
|
-
return (de(oe) ? e.slice(0, oe) : e).map((P,
|
|
154
|
-
}, [
|
|
153
|
+
const e = le(v) ? [] : [].concat(v);
|
|
154
|
+
return (de(oe) ? e.slice(0, oe) : e).map((P, g, te) => ne(P));
|
|
155
|
+
}, [v, I, c, z]), Le = () => {
|
|
155
156
|
const e = C(c) ? c.count : c, o = C(c) && c.showPopover, s = Q?.("input-tag"), P = (r) => C(c) && ro(c.render) ? c.render(r) : e === "responsive" ? /* @__PURE__ */ k(
|
|
156
157
|
ie,
|
|
157
158
|
{
|
|
@@ -163,9 +164,9 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
163
164
|
]
|
|
164
165
|
},
|
|
165
166
|
K
|
|
166
|
-
) : `+${r}...`,
|
|
167
|
-
for (let r =
|
|
168
|
-
const l =
|
|
167
|
+
) : `+${r}...`, g = le(v) ? [] : [].concat(v), te = () => {
|
|
168
|
+
for (let r = g.length - 1; r >= 0; r--) {
|
|
169
|
+
const l = g[r];
|
|
169
170
|
if (!z(l).disabled)
|
|
170
171
|
return r;
|
|
171
172
|
}
|
|
@@ -179,7 +180,7 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
179
180
|
onRemove: (r, l, u) => {
|
|
180
181
|
const $ = u.key;
|
|
181
182
|
let a = -1;
|
|
182
|
-
$ === po.key && (a = te()) !== -1 && (r =
|
|
183
|
+
$ === po.key && (a = te()) !== -1 && (r = g[a], l = a), c && Be(), Re?.(r, l, u);
|
|
183
184
|
}
|
|
184
185
|
}, Ke = {
|
|
185
186
|
suffix: null,
|
|
@@ -190,7 +191,7 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
190
191
|
labelInValue: !1
|
|
191
192
|
}, se = (() => {
|
|
192
193
|
if (de(e)) {
|
|
193
|
-
const r =
|
|
194
|
+
const r = g.length - e;
|
|
194
195
|
if (r > 0) {
|
|
195
196
|
const l = {
|
|
196
197
|
label: P(r),
|
|
@@ -199,14 +200,16 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
199
200
|
value: K
|
|
200
201
|
};
|
|
201
202
|
if (o) {
|
|
202
|
-
const u =
|
|
203
|
+
const u = g.map((a, d) => ({ val: a, index: d })).slice(e).map((a) => {
|
|
203
204
|
const d = ne(a.val);
|
|
204
205
|
return M ? M(
|
|
205
206
|
{
|
|
206
207
|
...d,
|
|
207
|
-
onClose: (H) =>
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
onClose: (H) => j.onRemove(
|
|
209
|
+
d.value,
|
|
210
|
+
a.index,
|
|
211
|
+
H
|
|
212
|
+
)
|
|
210
213
|
},
|
|
211
214
|
a.index,
|
|
212
215
|
L.concat(l)
|
|
@@ -248,7 +251,7 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
248
251
|
...Ke,
|
|
249
252
|
className: V ? `${Q?.("input-tag")}-focus` : "",
|
|
250
253
|
ref: N,
|
|
251
|
-
disabled:
|
|
254
|
+
disabled: b,
|
|
252
255
|
dragToSort: J,
|
|
253
256
|
disableInput: !T,
|
|
254
257
|
animation: we,
|
|
@@ -270,8 +273,8 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
270
273
|
K
|
|
271
274
|
);
|
|
272
275
|
if (u > -1) {
|
|
273
|
-
const $ = r.slice(0, u), a = r.slice(u + 1), d =
|
|
274
|
-
r.length - 1 -
|
|
276
|
+
const $ = r.slice(0, u), a = r.slice(u + 1), d = g.slice(
|
|
277
|
+
r.length - 1 - g.length
|
|
275
278
|
);
|
|
276
279
|
A($.concat(d, a));
|
|
277
280
|
} else
|
|
@@ -281,7 +284,7 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
281
284
|
...j
|
|
282
285
|
}
|
|
283
286
|
);
|
|
284
|
-
}, re = xe || (x.error ? "error" : void 0), je = !
|
|
287
|
+
}, re = xe || (x.error ? "error" : void 0), je = !b && !R && ve ? /* @__PURE__ */ t(
|
|
285
288
|
ao,
|
|
286
289
|
{
|
|
287
290
|
size: y,
|
|
@@ -300,7 +303,7 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
300
303
|
[`${n}-size-${y}`]: y,
|
|
301
304
|
[`${n}-focused`]: V,
|
|
302
305
|
[`${n}-${re}`]: re,
|
|
303
|
-
[`${n}-disabled`]:
|
|
306
|
+
[`${n}-disabled`]: b,
|
|
304
307
|
[`${n}-no-border`]: !be,
|
|
305
308
|
[`${n}-rtl`]: $e
|
|
306
309
|
},
|
|
@@ -313,24 +316,24 @@ const K = "__pqb_value_tag_placeholder", w = {
|
|
|
313
316
|
"aria-haspopup": "listbox",
|
|
314
317
|
"aria-autocomplete": "list",
|
|
315
318
|
"aria-expanded": p,
|
|
316
|
-
"aria-disabled":
|
|
319
|
+
"aria-disabled": b,
|
|
317
320
|
"aria-controls": Te,
|
|
318
321
|
...uo(Oe, ["onClick", "onMouseEnter", "onMouseLeave"]),
|
|
319
322
|
...ye,
|
|
320
323
|
ref: f,
|
|
321
|
-
tabIndex:
|
|
324
|
+
tabIndex: b ? -1 : 0,
|
|
322
325
|
id: pe,
|
|
323
326
|
style: fe,
|
|
324
327
|
className: He,
|
|
325
328
|
onKeyDown: ee,
|
|
326
329
|
onFocus: (e) => {
|
|
327
|
-
!
|
|
330
|
+
!b && !J && (m ? N.current && N.current.focus() : S("focus", e));
|
|
328
331
|
},
|
|
329
332
|
onBlur: (e) => S("blur", e),
|
|
330
333
|
children: /* @__PURE__ */ k(
|
|
331
334
|
"div",
|
|
332
335
|
{
|
|
333
|
-
title: typeof
|
|
336
|
+
title: typeof h == "string" ? h : void 0,
|
|
334
337
|
className: E(`${n}-view`, {
|
|
335
338
|
[`${n}-view-with-prefix`]: O
|
|
336
339
|
}),
|