mimir-ui-kit 1.56.2 → 1.58.0
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as z, jsx as
|
|
1
|
+
import { jsxs as z, jsx as k } from "react/jsx-runtime";
|
|
2
2
|
import { c as H } from "../../index-DIxK0V-G.js";
|
|
3
|
-
import { memo as kt, forwardRef as Nt, useState as
|
|
4
|
-
import { months as
|
|
5
|
-
import { DatePickerModal as
|
|
3
|
+
import { memo as kt, forwardRef as Nt, useState as b, useEffect as v } from "react";
|
|
4
|
+
import { months as P, EDatePickerBorderRadius as C, MAX_DAY as ut, MAX_MONTH as ht, DATE_LENGTH as Mt } from "./constants.js";
|
|
5
|
+
import { DatePickerModal as gt } from "./DatePickerModal.js";
|
|
6
6
|
import { MonthPickerModal as Tt } from "./MonthPickerModal.js";
|
|
7
|
-
import { c as
|
|
7
|
+
import { c as y } from "../../styles.module-DeBRSK_x.js";
|
|
8
8
|
import { formatDatePart as R } from "./utils.js";
|
|
9
9
|
import { YearPickerModal as $t } from "./YearPickerModal.js";
|
|
10
10
|
import { useClickOutside as bt } from "../../hooks/useClickOutside/useClickOutside.js";
|
|
@@ -16,79 +16,79 @@ const St = kt(
|
|
|
16
16
|
Nt(
|
|
17
17
|
({
|
|
18
18
|
size: j,
|
|
19
|
-
value:
|
|
19
|
+
value: u,
|
|
20
20
|
onChangeValue: a,
|
|
21
|
-
name:
|
|
22
|
-
before:
|
|
23
|
-
type:
|
|
24
|
-
dateFormat:
|
|
25
|
-
error:
|
|
26
|
-
onError:
|
|
27
|
-
onBlur:
|
|
21
|
+
name: N,
|
|
22
|
+
before: M,
|
|
23
|
+
type: l = "days",
|
|
24
|
+
dateFormat: h = "full",
|
|
25
|
+
error: O,
|
|
26
|
+
onError: T,
|
|
27
|
+
onBlur: i,
|
|
28
28
|
validateImmediately: L,
|
|
29
29
|
variant: tt,
|
|
30
|
-
disabled:
|
|
31
|
-
editable:
|
|
30
|
+
disabled: _ = !1,
|
|
31
|
+
editable: A = !1,
|
|
32
32
|
openOnInput: W = !0,
|
|
33
33
|
sendIntermediateValues: et = !1,
|
|
34
34
|
disableFuture: q = !1,
|
|
35
35
|
disablePast: J = !1,
|
|
36
36
|
disabledDate: U,
|
|
37
|
-
validRange:
|
|
37
|
+
validRange: c,
|
|
38
38
|
borderRadius: X = C.All,
|
|
39
39
|
full: st,
|
|
40
|
-
...
|
|
41
|
-
},
|
|
42
|
-
const [
|
|
43
|
-
() =>
|
|
44
|
-
), [
|
|
45
|
-
|
|
46
|
-
F(
|
|
47
|
-
}, [
|
|
40
|
+
...S
|
|
41
|
+
}, at) => {
|
|
42
|
+
const [Y, D] = b(!1), [E, p] = b(l), [f, g] = b(
|
|
43
|
+
() => u && !isNaN(new Date(u).getTime()) ? new Date(u) : void 0
|
|
44
|
+
), [I, F] = b(O), [rt, x] = b(""), [ct, $] = b();
|
|
45
|
+
S.status = !!I && Pt.Error || S.status, v(() => {
|
|
46
|
+
F(O);
|
|
47
|
+
}, [O]), v(() => {
|
|
48
48
|
g(
|
|
49
|
-
|
|
49
|
+
u && !isNaN(new Date(u).getTime()) ? new Date(u) : void 0
|
|
50
50
|
);
|
|
51
|
-
}, [
|
|
52
|
-
if (
|
|
51
|
+
}, [u]), v(() => {
|
|
52
|
+
if (f && typeof f != "string" && !isNaN(f == null ? void 0 : f.getTime())) {
|
|
53
53
|
let t = "";
|
|
54
|
-
switch (
|
|
54
|
+
switch (h) {
|
|
55
55
|
case "year": {
|
|
56
|
-
t =
|
|
56
|
+
t = f.getFullYear().toString();
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
59
|
case "month": {
|
|
60
|
-
const s =
|
|
60
|
+
const s = P[f.getMonth()], e = f.getFullYear();
|
|
61
61
|
t = `${s} ${e}`;
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
64
|
case "full": {
|
|
65
|
-
t = d.Date(
|
|
65
|
+
t = d.Date(f, "dd/mm/yyyy");
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
default: {
|
|
69
|
-
t = d.Date(
|
|
69
|
+
t = d.Date(f, "dd/mm/yyyy");
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
x(t);
|
|
74
74
|
} else
|
|
75
|
-
|
|
76
|
-
}, [
|
|
77
|
-
const K =
|
|
75
|
+
x("");
|
|
76
|
+
}, [f, h]);
|
|
77
|
+
const K = u && new Date(u).getTime;
|
|
78
78
|
v(() => {
|
|
79
|
-
L && (K ? (F(!1),
|
|
80
|
-
}, [L,
|
|
81
|
-
isActive:
|
|
79
|
+
L && (K ? (F(!1), T == null || T({ name: N, active: !1 })) : (F(!0), T == null || T({ name: N, active: !0 })));
|
|
80
|
+
}, [L, N, K]), bt({
|
|
81
|
+
isActive: Y,
|
|
82
82
|
setActive: (t) => {
|
|
83
|
-
|
|
83
|
+
D(t), p(l), t || $(void 0);
|
|
84
84
|
},
|
|
85
|
-
className:
|
|
85
|
+
className: y["calendar-block"]
|
|
86
86
|
});
|
|
87
|
-
const
|
|
88
|
-
!
|
|
87
|
+
const ot = () => {
|
|
88
|
+
!_ && (W || !A) && D(!0);
|
|
89
89
|
}, Q = (t) => {
|
|
90
90
|
const s = t.getTime();
|
|
91
|
-
if (t.setHours(0, 0, 0, 0),
|
|
91
|
+
if (t.setHours(0, 0, 0, 0), M && (typeof M == "string" ? new Date(M) : M).getTime() > s)
|
|
92
92
|
return !1;
|
|
93
93
|
if (q) {
|
|
94
94
|
const e = /* @__PURE__ */ new Date();
|
|
@@ -99,31 +99,31 @@ const St = kt(
|
|
|
99
99
|
if (e.setHours(0, 0, 0, 0), s < e.getTime()) return !1;
|
|
100
100
|
}
|
|
101
101
|
if (U && U(t)) return !1;
|
|
102
|
-
if (
|
|
102
|
+
if (c) {
|
|
103
103
|
let e;
|
|
104
|
-
typeof
|
|
105
|
-
new Date(
|
|
106
|
-
typeof
|
|
104
|
+
typeof c[0] == "string" ? e = [
|
|
105
|
+
new Date(c[0]),
|
|
106
|
+
typeof c[1] == "string" ? new Date(c[1]) : c[1]
|
|
107
107
|
] : e = [
|
|
108
|
-
|
|
109
|
-
typeof
|
|
108
|
+
c[0],
|
|
109
|
+
typeof c[1] == "string" ? new Date(c[1]) : c[1]
|
|
110
110
|
];
|
|
111
|
-
const [
|
|
112
|
-
if (
|
|
111
|
+
const [o, r] = e, m = new Date(o), n = new Date(r);
|
|
112
|
+
if (m.setHours(0, 0, 0, 0), n.setHours(23, 59, 59, 999), t < m || t > n) return !1;
|
|
113
113
|
}
|
|
114
114
|
return !0;
|
|
115
|
-
},
|
|
115
|
+
}, it = (t) => {
|
|
116
116
|
if (!isNaN(t.getTime())) {
|
|
117
|
-
g(t),
|
|
117
|
+
g(t), $(void 0);
|
|
118
118
|
let e = "";
|
|
119
|
-
switch (
|
|
119
|
+
switch (h) {
|
|
120
120
|
case "year": {
|
|
121
121
|
e = t.getFullYear().toString();
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
124
|
case "month": {
|
|
125
|
-
const
|
|
126
|
-
e = `${
|
|
125
|
+
const o = P[t.getMonth()], r = t.getFullYear();
|
|
126
|
+
e = `${o} ${r}`;
|
|
127
127
|
break;
|
|
128
128
|
}
|
|
129
129
|
case "full": {
|
|
@@ -137,19 +137,19 @@ const St = kt(
|
|
|
137
137
|
}
|
|
138
138
|
a == null || a({
|
|
139
139
|
value: e,
|
|
140
|
-
name:
|
|
140
|
+
name: N
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
E === "years" && (
|
|
143
|
+
E === "years" && (l === "years" ? (D(!1), p(l)) : p("months")), E === "months" && (l === "months" ? (D(!1), p(l)) : p("days")), g(t);
|
|
144
144
|
let s = "";
|
|
145
|
-
switch (
|
|
145
|
+
switch (h) {
|
|
146
146
|
case "year": {
|
|
147
147
|
s = t.getFullYear().toString();
|
|
148
148
|
break;
|
|
149
149
|
}
|
|
150
150
|
case "month": {
|
|
151
|
-
const e =
|
|
152
|
-
s = `${e} ${
|
|
151
|
+
const e = P[t.getMonth()], o = t.getFullYear();
|
|
152
|
+
s = `${e} ${o}`;
|
|
153
153
|
break;
|
|
154
154
|
}
|
|
155
155
|
case "full": {
|
|
@@ -163,148 +163,148 @@ const St = kt(
|
|
|
163
163
|
}
|
|
164
164
|
a == null || a({
|
|
165
165
|
value: s,
|
|
166
|
-
name:
|
|
167
|
-
}),
|
|
166
|
+
name: N
|
|
167
|
+
}), i == null || i(s);
|
|
168
168
|
}, ft = (t) => {
|
|
169
|
-
const s =
|
|
170
|
-
if (r.getFullYear() === t && r.getMonth() ===
|
|
171
|
-
g(r),
|
|
172
|
-
let
|
|
173
|
-
switch (
|
|
169
|
+
const s = f || /* @__PURE__ */ new Date(), e = s.getDate(), o = s.getMonth() + 1, r = new Date(t, o - 1, e);
|
|
170
|
+
if (r.getFullYear() === t && r.getMonth() === o - 1 && r.getDate() === e && Q(r)) {
|
|
171
|
+
g(r), $(void 0);
|
|
172
|
+
let m = "";
|
|
173
|
+
switch (h) {
|
|
174
174
|
case "year": {
|
|
175
|
-
|
|
175
|
+
m = t.toString();
|
|
176
176
|
break;
|
|
177
177
|
}
|
|
178
178
|
case "month": {
|
|
179
|
-
|
|
179
|
+
m = `${P[o - 1]} ${t}`;
|
|
180
180
|
break;
|
|
181
181
|
}
|
|
182
182
|
case "full": {
|
|
183
|
-
|
|
183
|
+
m = d.Date(r, "yyyy-mm-dd");
|
|
184
184
|
break;
|
|
185
185
|
}
|
|
186
186
|
default: {
|
|
187
|
-
|
|
187
|
+
m = d.Date(r, "yyyy-mm-dd");
|
|
188
188
|
break;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
if (a == null || a({
|
|
192
|
-
value:
|
|
193
|
-
name:
|
|
194
|
-
}),
|
|
195
|
-
|
|
192
|
+
value: m,
|
|
193
|
+
name: N
|
|
194
|
+
}), i == null || i(m), l === "years") {
|
|
195
|
+
D(!1), p(l);
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
198
|
} else
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
$(new Date(t, o - 1, 1));
|
|
200
|
+
l === "years" ? (D(!1), p(l)) : p("months");
|
|
201
201
|
}, mt = (t, s) => {
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
204
|
-
g(
|
|
205
|
-
let
|
|
206
|
-
switch (
|
|
202
|
+
const o = (f || /* @__PURE__ */ new Date()).getDate(), r = new Date(t, s, 0).getDate(), m = Math.min(o, r), n = new Date(t, s - 1, m);
|
|
203
|
+
if (n.getFullYear() === t && n.getMonth() === s - 1 && n.getDate() === m && Q(n)) {
|
|
204
|
+
g(n), $(void 0);
|
|
205
|
+
let w = "";
|
|
206
|
+
switch (h) {
|
|
207
207
|
case "year": {
|
|
208
|
-
|
|
208
|
+
w = t.toString();
|
|
209
209
|
break;
|
|
210
210
|
}
|
|
211
211
|
case "month": {
|
|
212
|
-
|
|
212
|
+
w = `${P[s - 1]} ${t}`;
|
|
213
213
|
break;
|
|
214
214
|
}
|
|
215
215
|
case "full": {
|
|
216
|
-
|
|
216
|
+
w = d.Date(n, "yyyy-mm-dd");
|
|
217
217
|
break;
|
|
218
218
|
}
|
|
219
219
|
default: {
|
|
220
|
-
|
|
220
|
+
w = d.Date(n, "yyyy-mm-dd");
|
|
221
221
|
break;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
if (a == null || a({
|
|
225
|
-
value:
|
|
226
|
-
name:
|
|
227
|
-
}),
|
|
228
|
-
|
|
225
|
+
value: w,
|
|
226
|
+
name: N
|
|
227
|
+
}), i == null || i(w), l === "months") {
|
|
228
|
+
D(!1), p(l);
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
231
|
} else
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
$(new Date(t, s - 1, 1));
|
|
233
|
+
l === "months" ? (D(!1), p(l)) : p("days");
|
|
234
234
|
}, nt = (t) => {
|
|
235
|
-
if (
|
|
235
|
+
if (A || t.target.value === "") {
|
|
236
236
|
const s = t.target.value.replace(/[^\d]/g, "");
|
|
237
237
|
if (s.length === 0)
|
|
238
|
-
|
|
238
|
+
x(""), g(void 0), D(!1), a == null || a({ value: "", name: N }), i == null || i("");
|
|
239
239
|
else {
|
|
240
|
-
const [e,
|
|
240
|
+
const [e, o, r] = [
|
|
241
241
|
R(s.substring(0, 2), ut),
|
|
242
242
|
R(s.substring(2, 4), ht),
|
|
243
243
|
s.substring(4, 8)
|
|
244
|
-
],
|
|
245
|
-
if (
|
|
246
|
-
const
|
|
244
|
+
], m = [e, o, r].filter(Boolean).join("/");
|
|
245
|
+
if (x(m), et) {
|
|
246
|
+
const n = r ? `${r}-${o || "00"}-${e || "00"}` : [e, o, r].filter(Boolean).join("-");
|
|
247
247
|
a == null || a({
|
|
248
|
-
value:
|
|
249
|
-
name:
|
|
248
|
+
value: n,
|
|
249
|
+
name: N
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
if (
|
|
253
|
-
const
|
|
254
|
-
`${
|
|
252
|
+
if (m.length === Mt) {
|
|
253
|
+
const n = parseInt(r), w = /* @__PURE__ */ new Date(
|
|
254
|
+
`${n}-${o.padStart(2, "0")}-${e.padStart(2, "0")}`
|
|
255
255
|
);
|
|
256
|
-
isNaN(
|
|
257
|
-
value: d.Date(
|
|
258
|
-
name:
|
|
259
|
-
}),
|
|
256
|
+
isNaN(w.getTime()) || (g(w), a == null || a({
|
|
257
|
+
value: d.Date(w, "yyyy-mm-dd"),
|
|
258
|
+
name: N
|
|
259
|
+
}), i == null || i(d.Date(w, "yyyy-mm-dd")));
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
}, lt = H(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
), yt = H(
|
|
264
|
+
y.wrapper,
|
|
265
|
+
Y && !A && y.active
|
|
266
|
+
), yt = H(y.input, y.inputBorderControl);
|
|
267
267
|
let Z;
|
|
268
|
-
if (
|
|
268
|
+
if (c) {
|
|
269
269
|
let t, s;
|
|
270
|
-
typeof
|
|
270
|
+
typeof c[0] == "string" ? t = new Date(c[0]) : t = c[0], typeof c[1] == "string" ? s = new Date(c[1]) : s = c[1], Z = [t, s];
|
|
271
271
|
}
|
|
272
272
|
const G = {
|
|
273
|
-
onChangeValue:
|
|
274
|
-
date: ct ||
|
|
275
|
-
selectedDate:
|
|
276
|
-
before: typeof
|
|
273
|
+
onChangeValue: it,
|
|
274
|
+
date: ct || f || /* @__PURE__ */ new Date(),
|
|
275
|
+
selectedDate: f,
|
|
276
|
+
before: typeof M == "string" ? new Date(M) : M,
|
|
277
277
|
onChangeType: p,
|
|
278
|
-
setIsActive:
|
|
278
|
+
setIsActive: D,
|
|
279
279
|
disableFuture: q,
|
|
280
280
|
disablePast: J,
|
|
281
281
|
disabledDate: U,
|
|
282
282
|
validRange: Z,
|
|
283
|
-
dateFormat:
|
|
284
|
-
},
|
|
283
|
+
dateFormat: h
|
|
284
|
+
}, Dt = {
|
|
285
285
|
...G,
|
|
286
286
|
onChangeMonth: mt,
|
|
287
|
-
dateFormat:
|
|
288
|
-
},
|
|
287
|
+
dateFormat: h
|
|
288
|
+
}, pt = {
|
|
289
289
|
...G,
|
|
290
290
|
onChangeYear: ft
|
|
291
|
-
},
|
|
291
|
+
}, dt = (() => {
|
|
292
292
|
switch (E) {
|
|
293
293
|
case "months":
|
|
294
|
-
return () => /* @__PURE__ */
|
|
294
|
+
return () => /* @__PURE__ */ k(Tt, { ...Dt });
|
|
295
295
|
case "years":
|
|
296
|
-
return () => /* @__PURE__ */
|
|
296
|
+
return () => /* @__PURE__ */ k($t, { ...pt });
|
|
297
297
|
default:
|
|
298
|
-
return () => /* @__PURE__ */
|
|
298
|
+
return () => /* @__PURE__ */ k(gt, { ...G });
|
|
299
299
|
}
|
|
300
|
-
})(), wt = ({ isActive: t }) => /* @__PURE__ */
|
|
301
|
-
e.stopPropagation(),
|
|
302
|
-
}, className:
|
|
300
|
+
})(), wt = ({ isActive: t }) => /* @__PURE__ */ k("button", { onClick: (e) => {
|
|
301
|
+
e.stopPropagation(), _ || D(!t);
|
|
302
|
+
}, className: y["icon-button"], children: t ? /* @__PURE__ */ k(
|
|
303
303
|
B,
|
|
304
304
|
{
|
|
305
305
|
iconName: j === V.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
|
|
306
306
|
}
|
|
307
|
-
) : /* @__PURE__ */
|
|
307
|
+
) : /* @__PURE__ */ k(
|
|
308
308
|
B,
|
|
309
309
|
{
|
|
310
310
|
iconName: j === V.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
|
|
@@ -313,49 +313,49 @@ const St = kt(
|
|
|
313
313
|
return /* @__PURE__ */ z(
|
|
314
314
|
"div",
|
|
315
315
|
{
|
|
316
|
-
className: H(
|
|
317
|
-
[
|
|
316
|
+
className: H(y["input-field-group-datePicker"], {
|
|
317
|
+
[y.full]: st
|
|
318
318
|
}),
|
|
319
319
|
children: [
|
|
320
|
-
/* @__PURE__ */ z("div", { className: lt, "data-disabled":
|
|
321
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ z("div", { className: lt, "data-disabled": _, children: [
|
|
321
|
+
/* @__PURE__ */ k(
|
|
322
322
|
"div",
|
|
323
323
|
{
|
|
324
324
|
role: "button",
|
|
325
|
-
"data-status":
|
|
326
|
-
className: H(
|
|
327
|
-
[
|
|
328
|
-
[
|
|
325
|
+
"data-status": S.status,
|
|
326
|
+
className: H(y["date-wrapper"], {
|
|
327
|
+
[y.editable]: A,
|
|
328
|
+
[y[`border-radius-${X}`]]: X !== C.All
|
|
329
329
|
}),
|
|
330
|
-
onClick:
|
|
331
|
-
children: /* @__PURE__ */
|
|
330
|
+
onClick: ot,
|
|
331
|
+
children: /* @__PURE__ */ k(
|
|
332
332
|
At,
|
|
333
333
|
{
|
|
334
|
-
ref:
|
|
334
|
+
ref: at,
|
|
335
335
|
className: yt,
|
|
336
|
-
wrapperClassName:
|
|
336
|
+
wrapperClassName: y["input-wrapper"],
|
|
337
337
|
size: j,
|
|
338
338
|
type: "text",
|
|
339
339
|
variant: tt,
|
|
340
|
-
value:
|
|
340
|
+
value: rt,
|
|
341
341
|
onChange: nt,
|
|
342
342
|
rightAddon: {
|
|
343
343
|
addonType: "react-node",
|
|
344
|
-
addonContent: /* @__PURE__ */
|
|
344
|
+
addonContent: /* @__PURE__ */ k(wt, { isActive: Y })
|
|
345
345
|
},
|
|
346
|
-
rightSlotClassName:
|
|
346
|
+
rightSlotClassName: y["right-slot"],
|
|
347
347
|
onFocus: () => {
|
|
348
|
-
W && !
|
|
348
|
+
W && !A && D(!0);
|
|
349
349
|
},
|
|
350
350
|
borderRadius: X,
|
|
351
|
-
...
|
|
351
|
+
...S
|
|
352
352
|
}
|
|
353
353
|
)
|
|
354
354
|
}
|
|
355
355
|
),
|
|
356
|
-
|
|
356
|
+
Y && /* @__PURE__ */ k(dt, {})
|
|
357
357
|
] }),
|
|
358
|
-
|
|
358
|
+
I && typeof I == "string" && /* @__PURE__ */ k("div", { className: y.textError, children: I })
|
|
359
359
|
]
|
|
360
360
|
}
|
|
361
361
|
);
|
|
@@ -27,6 +27,10 @@ export type TCategoryTab = {
|
|
|
27
27
|
* Цвет нижней границы для detailed варианта таба.
|
|
28
28
|
*/
|
|
29
29
|
borderColor?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Цвет нижней границы по дефолту для detailed варианта таба.
|
|
32
|
+
*/
|
|
33
|
+
defaultActive?: boolean;
|
|
30
34
|
};
|
|
31
35
|
export type TTabTrailProps = {
|
|
32
36
|
/**
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import { ETabTrailSize as
|
|
6
|
-
import { TabButtons as
|
|
7
|
-
import { ETabTrailButtonVariant as
|
|
1
|
+
import { jsxs as j, jsx as h, Fragment as Se } from "react/jsx-runtime";
|
|
2
|
+
import { c as I } from "../../index-DIxK0V-G.js";
|
|
3
|
+
import * as q from "react";
|
|
4
|
+
import V, { useState as ae, createContext as ve, useReducer as Ae, useMemo as C, useId as he, useRef as se, useContext as xe, forwardRef as Fe, useEffect as ue } from "react";
|
|
5
|
+
import { ETabTrailSize as ke } from "./constants.js";
|
|
6
|
+
import { TabButtons as De } from "./TabButtons/TabButtons.js";
|
|
7
|
+
import { ETabTrailButtonVariant as Re } from "./TabButtons/constants.js";
|
|
8
8
|
import { Icon as be } from "../../icons/Icon.js";
|
|
9
|
-
import { NotificationBadge as
|
|
10
|
-
import { M as me, W as
|
|
11
|
-
import { w as
|
|
12
|
-
import { e as
|
|
13
|
-
import { f as
|
|
14
|
-
import { T as Te, s as
|
|
15
|
-
import { _ as
|
|
16
|
-
import '../../assets/TabTrail.css';function
|
|
17
|
-
let [t, n] =
|
|
18
|
-
return t ?
|
|
9
|
+
import { NotificationBadge as Le } from "../NotificationBadge/NotificationBadge.js";
|
|
10
|
+
import { M as me, W as Y, s as re, y as Q, o as W, n as le, H as X, $ as ge, b as Oe, D as _e, a as K, u as Me, c as N, e as Be } from "../../keyboard-wis2TUql.js";
|
|
11
|
+
import { w as We } from "../../use-active-press-CnDeVvQq.js";
|
|
12
|
+
import { e as Ce } from "../../use-resolve-button-type-DhFdPxnv.js";
|
|
13
|
+
import { f as Ge } from "../../use-is-mounted-MBU4fiLr.js";
|
|
14
|
+
import { T as Te, s as Ue } from "../../hidden-CkTYbiNM.js";
|
|
15
|
+
import { _ as J, T as ne, P as z, F as S } from "../../focus-management-BAl0GmRk.js";
|
|
16
|
+
import '../../assets/TabTrail.css';function ze({ onFocus: e }) {
|
|
17
|
+
let [t, n] = ae(!0), r = Ge();
|
|
18
|
+
return t ? V.createElement(Te, { as: "button", type: "button", features: Ue.Focusable, onFocus: (a) => {
|
|
19
19
|
a.preventDefault();
|
|
20
|
-
let s,
|
|
20
|
+
let s, i = 50;
|
|
21
21
|
function f() {
|
|
22
|
-
if (
|
|
22
|
+
if (i-- <= 0) {
|
|
23
23
|
s && cancelAnimationFrame(s);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -33,8 +33,8 @@ import '../../assets/TabTrail.css';function Ue({ onFocus: e }) {
|
|
|
33
33
|
s = requestAnimationFrame(f);
|
|
34
34
|
} }) : null;
|
|
35
35
|
}
|
|
36
|
-
const Ie =
|
|
37
|
-
function
|
|
36
|
+
const Ie = q.createContext(null);
|
|
37
|
+
function Ve() {
|
|
38
38
|
return { groups: /* @__PURE__ */ new Map(), get(e, t) {
|
|
39
39
|
var n;
|
|
40
40
|
let r = this.groups.get(e);
|
|
@@ -42,57 +42,57 @@ function ze() {
|
|
|
42
42
|
let a = (n = r.get(t)) != null ? n : 0;
|
|
43
43
|
r.set(t, a + 1);
|
|
44
44
|
let s = Array.from(r.keys()).indexOf(t);
|
|
45
|
-
function
|
|
45
|
+
function i() {
|
|
46
46
|
let f = r.get(t);
|
|
47
47
|
f > 1 ? r.set(t, f - 1) : r.delete(t);
|
|
48
48
|
}
|
|
49
|
-
return [s,
|
|
49
|
+
return [s, i];
|
|
50
50
|
} };
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
let t =
|
|
54
|
-
return
|
|
52
|
+
function qe({ children: e }) {
|
|
53
|
+
let t = q.useRef(Ve());
|
|
54
|
+
return q.createElement(Ie.Provider, { value: t }, e);
|
|
55
55
|
}
|
|
56
56
|
function Pe(e) {
|
|
57
|
-
let t =
|
|
57
|
+
let t = q.useContext(Ie);
|
|
58
58
|
if (!t) throw new Error("You must wrap your component in a <StableCollection>");
|
|
59
|
-
let n =
|
|
60
|
-
return
|
|
59
|
+
let n = q.useId(), [r, a] = t.current.get(e, n);
|
|
60
|
+
return q.useEffect(() => a, []), r;
|
|
61
61
|
}
|
|
62
|
-
var
|
|
63
|
-
let
|
|
62
|
+
var He = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(He || {}), je = ((e) => (e[e.Less = -1] = "Less", e[e.Equal = 0] = "Equal", e[e.Greater = 1] = "Greater", e))(je || {}), Je = ((e) => (e[e.SetSelectedIndex = 0] = "SetSelectedIndex", e[e.RegisterTab = 1] = "RegisterTab", e[e.UnregisterTab = 2] = "UnregisterTab", e[e.RegisterPanel = 3] = "RegisterPanel", e[e.UnregisterPanel = 4] = "UnregisterPanel", e))(Je || {});
|
|
63
|
+
let Ke = { 0(e, t) {
|
|
64
64
|
var n;
|
|
65
|
-
let r =
|
|
65
|
+
let r = J(e.tabs, (d) => d.current), a = J(e.panels, (d) => d.current), s = r.filter((d) => {
|
|
66
66
|
var x;
|
|
67
67
|
return !((x = d.current) != null && x.hasAttribute("disabled"));
|
|
68
|
-
}),
|
|
68
|
+
}), i = { ...e, tabs: r, panels: a };
|
|
69
69
|
if (t.index < 0 || t.index > r.length - 1) {
|
|
70
|
-
let d =
|
|
71
|
-
if (s.length === 0) return
|
|
72
|
-
let x =
|
|
73
|
-
return { ...
|
|
70
|
+
let d = K(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => K(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
|
|
71
|
+
if (s.length === 0) return i;
|
|
72
|
+
let x = K(d, { 0: () => r.indexOf(s[0]), 1: () => r.indexOf(s[s.length - 1]) });
|
|
73
|
+
return { ...i, selectedIndex: x === -1 ? e.selectedIndex : x };
|
|
74
74
|
}
|
|
75
|
-
let f = r.slice(0, t.index),
|
|
76
|
-
if (!
|
|
77
|
-
let v = (n = r.indexOf(
|
|
78
|
-
return v === -1 && (v = e.selectedIndex), { ...
|
|
75
|
+
let f = r.slice(0, t.index), P = [...r.slice(t.index), ...f].find((d) => s.includes(d));
|
|
76
|
+
if (!P) return i;
|
|
77
|
+
let v = (n = r.indexOf(P)) != null ? n : e.selectedIndex;
|
|
78
|
+
return v === -1 && (v = e.selectedIndex), { ...i, selectedIndex: v };
|
|
79
79
|
}, 1(e, t) {
|
|
80
80
|
if (e.tabs.includes(t.tab)) return e;
|
|
81
|
-
let n = e.tabs[e.selectedIndex], r =
|
|
81
|
+
let n = e.tabs[e.selectedIndex], r = J([...e.tabs, t.tab], (s) => s.current), a = e.selectedIndex;
|
|
82
82
|
return e.info.current.isControlled || (a = r.indexOf(n), a === -1 && (a = e.selectedIndex)), { ...e, tabs: r, selectedIndex: a };
|
|
83
83
|
}, 2(e, t) {
|
|
84
84
|
return { ...e, tabs: e.tabs.filter((n) => n !== t.tab) };
|
|
85
85
|
}, 3(e, t) {
|
|
86
|
-
return e.panels.includes(t.panel) ? e : { ...e, panels:
|
|
86
|
+
return e.panels.includes(t.panel) ? e : { ...e, panels: J([...e.panels, t.panel], (n) => n.current) };
|
|
87
87
|
}, 4(e, t) {
|
|
88
88
|
return { ...e, panels: e.panels.filter((n) => n !== t.panel) };
|
|
89
89
|
} }, de = ve(null);
|
|
90
90
|
de.displayName = "TabsDataContext";
|
|
91
|
-
function
|
|
91
|
+
function H(e) {
|
|
92
92
|
let t = xe(de);
|
|
93
93
|
if (t === null) {
|
|
94
94
|
let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
|
|
95
|
-
throw Error.captureStackTrace && Error.captureStackTrace(n,
|
|
95
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, H), n;
|
|
96
96
|
}
|
|
97
97
|
return t;
|
|
98
98
|
}
|
|
@@ -106,124 +106,124 @@ function pe(e) {
|
|
|
106
106
|
}
|
|
107
107
|
return t;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return
|
|
109
|
+
function Ye(e, t) {
|
|
110
|
+
return K(t.type, Ke, e, t);
|
|
111
111
|
}
|
|
112
|
-
let
|
|
113
|
-
function
|
|
114
|
-
let { defaultIndex: n = 0, vertical: r = !1, manual: a = !1, onChange: s, selectedIndex:
|
|
115
|
-
const
|
|
116
|
-
let d =
|
|
117
|
-
})), y =
|
|
112
|
+
let Qe = "div";
|
|
113
|
+
function Xe(e, t) {
|
|
114
|
+
let { defaultIndex: n = 0, vertical: r = !1, manual: a = !1, onChange: s, selectedIndex: i = null, ...f } = e;
|
|
115
|
+
const P = r ? "vertical" : "horizontal", v = a ? "manual" : "auto";
|
|
116
|
+
let d = i !== null, x = re({ isControlled: d }), A = Q(t), [p, u] = Ae(Ye, { info: x, selectedIndex: i ?? n, tabs: [], panels: [] }), D = C(() => ({ selectedIndex: p.selectedIndex }), [p.selectedIndex]), R = re(s || (() => {
|
|
117
|
+
})), y = re(p.tabs), b = C(() => ({ orientation: P, activation: v, ...p }), [P, v, p]), F = W((o) => (u({ type: 1, tab: o }), () => u({ type: 2, tab: o }))), L = W((o) => (u({ type: 3, panel: o }), () => u({ type: 4, panel: o }))), g = W((o) => {
|
|
118
118
|
_.current !== o && R.current(o), d || u({ type: 0, index: o });
|
|
119
|
-
}), _ =
|
|
120
|
-
|
|
121
|
-
u({ type: 0, index:
|
|
122
|
-
}, [
|
|
119
|
+
}), _ = re(d ? e.selectedIndex : p.selectedIndex), O = C(() => ({ registerTab: F, registerPanel: L, change: g }), []);
|
|
120
|
+
le(() => {
|
|
121
|
+
u({ type: 0, index: i ?? n });
|
|
122
|
+
}, [i]), le(() => {
|
|
123
123
|
if (_.current === void 0 || p.tabs.length <= 0) return;
|
|
124
|
-
let o =
|
|
124
|
+
let o = J(p.tabs, (E) => E.current);
|
|
125
125
|
o.some((E, k) => p.tabs[k] !== E) && g(o.indexOf(p.tabs[_.current]));
|
|
126
126
|
});
|
|
127
127
|
let T = { ref: A };
|
|
128
|
-
return
|
|
128
|
+
return V.createElement(qe, null, V.createElement(fe.Provider, { value: O }, V.createElement(de.Provider, { value: b }, b.tabs.length <= 0 && V.createElement(ze, { onFocus: () => {
|
|
129
129
|
var o, E;
|
|
130
130
|
for (let k of y.current) if (((o = k.current) == null ? void 0 : o.tabIndex) === 0) return (E = k.current) == null || E.focus(), !0;
|
|
131
131
|
return !1;
|
|
132
|
-
} }),
|
|
132
|
+
} }), X({ ourProps: T, theirProps: f, slot: D, defaultTag: Qe, name: "Tabs" }))));
|
|
133
133
|
}
|
|
134
|
-
let
|
|
135
|
-
function
|
|
136
|
-
let { orientation: n, selectedIndex: r } =
|
|
137
|
-
return
|
|
134
|
+
let Ze = "div";
|
|
135
|
+
function et(e, t) {
|
|
136
|
+
let { orientation: n, selectedIndex: r } = H("Tab.List"), a = Q(t), s = C(() => ({ selectedIndex: r }), [r]);
|
|
137
|
+
return X({ ourProps: { ref: a, role: "tablist", "aria-orientation": n }, theirProps: e, slot: s, defaultTag: Ze, name: "Tabs.List" });
|
|
138
138
|
}
|
|
139
|
-
let
|
|
140
|
-
function
|
|
139
|
+
let tt = "button";
|
|
140
|
+
function rt(e, t) {
|
|
141
141
|
var n, r;
|
|
142
|
-
let a = he(), { id: s = `headlessui-tabs-tab-${a}`, disabled:
|
|
143
|
-
|
|
142
|
+
let a = he(), { id: s = `headlessui-tabs-tab-${a}`, disabled: i = !1, autoFocus: f = !1, ...P } = e, { orientation: v, activation: d, selectedIndex: x, tabs: A, panels: p } = H("Tab"), u = pe("Tab"), D = H("Tab"), [R, y] = ae(null), b = se(null), F = Q(b, t, y);
|
|
143
|
+
le(() => u.registerTab(b), [u, b]);
|
|
144
144
|
let L = Pe("tabs"), g = A.indexOf(b);
|
|
145
145
|
g === -1 && (g = L);
|
|
146
|
-
let _ = g === x, O = W((
|
|
147
|
-
var
|
|
148
|
-
let B =
|
|
149
|
-
if (B ===
|
|
150
|
-
let
|
|
151
|
-
|
|
146
|
+
let _ = g === x, O = W((l) => {
|
|
147
|
+
var $;
|
|
148
|
+
let B = l();
|
|
149
|
+
if (B === ne.Success && d === "auto") {
|
|
150
|
+
let ee = ($ = Me(b)) == null ? void 0 : $.activeElement, U = D.tabs.findIndex((te) => te.current === ee);
|
|
151
|
+
U !== -1 && u.change(U);
|
|
152
152
|
}
|
|
153
153
|
return B;
|
|
154
|
-
}), T = W((
|
|
155
|
-
let
|
|
156
|
-
if (
|
|
157
|
-
|
|
154
|
+
}), T = W((l) => {
|
|
155
|
+
let $ = A.map((B) => B.current).filter(Boolean);
|
|
156
|
+
if (l.key === N.Space || l.key === N.Enter) {
|
|
157
|
+
l.preventDefault(), l.stopPropagation(), u.change(g);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
switch (
|
|
160
|
+
switch (l.key) {
|
|
161
161
|
case N.Home:
|
|
162
162
|
case N.PageUp:
|
|
163
|
-
return
|
|
163
|
+
return l.preventDefault(), l.stopPropagation(), O(() => z($, S.First));
|
|
164
164
|
case N.End:
|
|
165
165
|
case N.PageDown:
|
|
166
|
-
return
|
|
166
|
+
return l.preventDefault(), l.stopPropagation(), O(() => z($, S.Last));
|
|
167
167
|
}
|
|
168
|
-
if (O(() =>
|
|
169
|
-
return
|
|
168
|
+
if (O(() => K(v, { vertical() {
|
|
169
|
+
return l.key === N.ArrowUp ? z($, S.Previous | S.WrapAround) : l.key === N.ArrowDown ? z($, S.Next | S.WrapAround) : ne.Error;
|
|
170
170
|
}, horizontal() {
|
|
171
|
-
return
|
|
172
|
-
} })) ===
|
|
173
|
-
}), o =
|
|
174
|
-
var
|
|
175
|
-
o.current || (o.current = !0, (
|
|
171
|
+
return l.key === N.ArrowLeft ? z($, S.Previous | S.WrapAround) : l.key === N.ArrowRight ? z($, S.Next | S.WrapAround) : ne.Error;
|
|
172
|
+
} })) === ne.Success) return l.preventDefault();
|
|
173
|
+
}), o = se(!1), E = W(() => {
|
|
174
|
+
var l;
|
|
175
|
+
o.current || (o.current = !0, (l = b.current) == null || l.focus({ preventScroll: !0 }), u.change(g), Be(() => {
|
|
176
176
|
o.current = !1;
|
|
177
177
|
}));
|
|
178
|
-
}), k = W((
|
|
179
|
-
|
|
180
|
-
}), { isFocusVisible: M, focusProps:
|
|
181
|
-
return
|
|
178
|
+
}), k = W((l) => {
|
|
179
|
+
l.preventDefault();
|
|
180
|
+
}), { isFocusVisible: M, focusProps: ie } = ge({ autoFocus: f }), { isHovered: G, hoverProps: oe } = Oe({ isDisabled: i }), { pressed: Z, pressProps: ce } = We({ disabled: i }), c = C(() => ({ selected: _, hover: G, active: Z, focus: M, autofocus: f, disabled: i }), [_, G, M, Z, f, i]), w = _e({ ref: F, onKeyDown: T, onMouseDown: k, onClick: E, id: s, role: "tab", type: Ce(e, R), "aria-controls": (r = (n = p[g]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": _, tabIndex: _ ? 0 : -1, disabled: i || void 0, autoFocus: f }, ie, oe, ce);
|
|
181
|
+
return X({ ourProps: w, theirProps: P, slot: c, defaultTag: tt, name: "Tabs.Tab" });
|
|
182
182
|
}
|
|
183
|
-
let
|
|
184
|
-
function
|
|
185
|
-
let { selectedIndex: n } =
|
|
186
|
-
return
|
|
183
|
+
let nt = "div";
|
|
184
|
+
function at(e, t) {
|
|
185
|
+
let { selectedIndex: n } = H("Tab.Panels"), r = Q(t), a = C(() => ({ selectedIndex: n }), [n]);
|
|
186
|
+
return X({ ourProps: { ref: r }, theirProps: e, slot: a, defaultTag: nt, name: "Tabs.Panels" });
|
|
187
187
|
}
|
|
188
|
-
let
|
|
189
|
-
function
|
|
188
|
+
let st = "div", lt = me.RenderStrategy | me.Static;
|
|
189
|
+
function it(e, t) {
|
|
190
190
|
var n, r, a, s;
|
|
191
|
-
let
|
|
192
|
-
|
|
191
|
+
let i = he(), { id: f = `headlessui-tabs-panel-${i}`, tabIndex: P = 0, ...v } = e, { selectedIndex: d, tabs: x, panels: A } = H("Tab.Panel"), p = pe("Tab.Panel"), u = se(null), D = Q(u, t);
|
|
192
|
+
le(() => p.registerPanel(u), [p, u]);
|
|
193
193
|
let R = Pe("panels"), y = A.indexOf(u);
|
|
194
194
|
y === -1 && (y = R);
|
|
195
|
-
let b = y === d, { isFocusVisible: F, focusProps: L } = ge(), g = C(() => ({ selected: b, focus: F }), [b, F]), _ = _e({ ref: D, id: f, role: "tabpanel", "aria-labelledby": (r = (n = x[y]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: b ?
|
|
196
|
-
return !b && ((a = v.unmount) == null || a) && !((s = v.static) != null && s) ?
|
|
195
|
+
let b = y === d, { isFocusVisible: F, focusProps: L } = ge(), g = C(() => ({ selected: b, focus: F }), [b, F]), _ = _e({ ref: D, id: f, role: "tabpanel", "aria-labelledby": (r = (n = x[y]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: b ? P : -1 }, L);
|
|
196
|
+
return !b && ((a = v.unmount) == null || a) && !((s = v.static) != null && s) ? V.createElement(Te, { "aria-hidden": "true", ..._ }) : X({ ourProps: _, theirProps: v, slot: g, defaultTag: st, features: lt, visible: b, name: "Tabs.Panel" });
|
|
197
197
|
}
|
|
198
|
-
let
|
|
199
|
-
const
|
|
200
|
-
container:
|
|
201
|
-
group:
|
|
198
|
+
let ot = Y(rt), we = Y(Xe), $e = Y(et), ye = Y(at), Ee = Y(it), ct = Object.assign(ot, { Group: we, List: $e, Panels: ye, Panel: Ee });
|
|
199
|
+
const ut = "_container_14t2i_2", dt = "_group_14t2i_6", ft = "_tab_14t2i_17", pt = "_list_14t2i_55", bt = "_tabs_14t2i_66", mt = "_buttons_14t2i_72", vt = "_m_14t2i_79", ht = "_s_14t2i_87", xt = "_detailed_14t2i_95", m = {
|
|
200
|
+
container: ut,
|
|
201
|
+
group: dt,
|
|
202
202
|
"group-inner": "_group-inner_14t2i_10",
|
|
203
|
-
tab:
|
|
204
|
-
list:
|
|
205
|
-
tabs:
|
|
206
|
-
buttons:
|
|
207
|
-
m:
|
|
208
|
-
s:
|
|
209
|
-
detailed:
|
|
203
|
+
tab: ft,
|
|
204
|
+
list: pt,
|
|
205
|
+
tabs: bt,
|
|
206
|
+
buttons: mt,
|
|
207
|
+
m: vt,
|
|
208
|
+
s: ht,
|
|
209
|
+
detailed: xt,
|
|
210
210
|
"tab-content": "_tab-content_14t2i_123",
|
|
211
211
|
"tab-value": "_tab-value_14t2i_131",
|
|
212
212
|
"tab-name": "_tab-name_14t2i_140",
|
|
213
213
|
"tab-header": "_tab-header_14t2i_149",
|
|
214
214
|
"tab-text": "_tab-text_14t2i_155",
|
|
215
215
|
"tab-icon": "_tab-icon_14t2i_162"
|
|
216
|
-
},
|
|
216
|
+
}, Dt = Fe(
|
|
217
217
|
({
|
|
218
218
|
categories: e,
|
|
219
|
-
size: t =
|
|
219
|
+
size: t = ke.M,
|
|
220
220
|
showButtons: n = !0,
|
|
221
221
|
className: r,
|
|
222
222
|
selectedTabIndex: a,
|
|
223
223
|
onTabChange: s,
|
|
224
|
-
buttonsVariant:
|
|
224
|
+
buttonsVariant: i = Re.WHITE,
|
|
225
225
|
autoShowButtons: f = !1,
|
|
226
|
-
tabClassName:
|
|
226
|
+
tabClassName: P,
|
|
227
227
|
listClassName: v,
|
|
228
228
|
panelClassName: d,
|
|
229
229
|
buttonsClassName: x,
|
|
@@ -239,7 +239,7 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
|
|
|
239
239
|
tabsClassName: g,
|
|
240
240
|
groupInnerClassName: _
|
|
241
241
|
}, O) => {
|
|
242
|
-
const [T, o] =
|
|
242
|
+
const [T, o] = ae(a || 0), [E, k] = ae(!1), M = se(null), ie = {
|
|
243
243
|
...A && { "--tab-indicator-color": A }
|
|
244
244
|
};
|
|
245
245
|
ue(() => {
|
|
@@ -247,16 +247,16 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
|
|
|
247
247
|
}, [T, a]);
|
|
248
248
|
const G = (c) => {
|
|
249
249
|
o(c), s == null || s(c);
|
|
250
|
-
},
|
|
250
|
+
}, oe = () => {
|
|
251
251
|
const c = (T + 1) % e.length;
|
|
252
252
|
G(c);
|
|
253
|
-
},
|
|
253
|
+
}, Z = () => {
|
|
254
254
|
const c = (T - 1 + e.length) % e.length;
|
|
255
255
|
G(c);
|
|
256
256
|
};
|
|
257
257
|
ue(() => {
|
|
258
|
-
var
|
|
259
|
-
const c = (
|
|
258
|
+
var w;
|
|
259
|
+
const c = (w = M.current) == null ? void 0 : w.querySelector(
|
|
260
260
|
`.${m.tab}[data-active="true"]`
|
|
261
261
|
);
|
|
262
262
|
c && typeof c.scrollIntoView == "function" && c.scrollIntoView({
|
|
@@ -267,18 +267,18 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
|
|
|
267
267
|
}, [T]), ue(() => {
|
|
268
268
|
const c = () => {
|
|
269
269
|
if (M.current) {
|
|
270
|
-
const { scrollWidth:
|
|
271
|
-
k(
|
|
270
|
+
const { scrollWidth: w, clientWidth: l } = M.current;
|
|
271
|
+
k(w > l);
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
274
|
return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
|
|
275
275
|
}, [e]);
|
|
276
|
-
const
|
|
277
|
-
return /* @__PURE__ */
|
|
276
|
+
const ce = f ? E : n;
|
|
277
|
+
return /* @__PURE__ */ j(
|
|
278
278
|
we,
|
|
279
279
|
{
|
|
280
280
|
ref: O,
|
|
281
|
-
className:
|
|
281
|
+
className: I(
|
|
282
282
|
m.group,
|
|
283
283
|
m[t],
|
|
284
284
|
u === "detailed" && m.detailed,
|
|
@@ -286,49 +286,56 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
|
|
|
286
286
|
),
|
|
287
287
|
selectedIndex: T,
|
|
288
288
|
onChange: G,
|
|
289
|
-
style:
|
|
289
|
+
style: ie,
|
|
290
290
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ j("div", { className: I(m["group-inner"], _), children: [
|
|
292
292
|
/* @__PURE__ */ h(
|
|
293
293
|
$e,
|
|
294
294
|
{
|
|
295
295
|
ref: M,
|
|
296
|
-
className:
|
|
297
|
-
children: /* @__PURE__ */ h("div", { className:
|
|
298
|
-
({
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
296
|
+
className: I(m.list, v),
|
|
297
|
+
children: /* @__PURE__ */ h("div", { className: I(m.tabs, g), children: e.map(
|
|
298
|
+
({
|
|
299
|
+
name: c,
|
|
300
|
+
defaultActive: w,
|
|
301
|
+
notificationCount: l,
|
|
302
|
+
value: $,
|
|
303
|
+
valueColor: B,
|
|
304
|
+
borderColor: ee
|
|
305
|
+
}, U) => {
|
|
306
|
+
const te = p[U], Ne = u === "detailed" ? {
|
|
303
307
|
...B && {
|
|
304
|
-
"--detailed-
|
|
308
|
+
"--detailed-value-color": B
|
|
309
|
+
},
|
|
310
|
+
...ee && {
|
|
311
|
+
"--detailed-border-color": ee
|
|
305
312
|
}
|
|
306
313
|
} : void 0;
|
|
307
314
|
return /* @__PURE__ */ h(
|
|
308
|
-
|
|
315
|
+
ct,
|
|
309
316
|
{
|
|
310
|
-
className: `${m.tab} ${T ===
|
|
311
|
-
"data-active": T ===
|
|
312
|
-
style:
|
|
317
|
+
className: `${m.tab} ${w || T === U ? 'data-active="true"' : ""} ${P || ""}`,
|
|
318
|
+
"data-active": w || T === U,
|
|
319
|
+
style: Ne,
|
|
313
320
|
children: u === "detailed" ? /* @__PURE__ */ h(
|
|
314
321
|
"div",
|
|
315
322
|
{
|
|
316
|
-
className:
|
|
323
|
+
className: I(
|
|
317
324
|
m["tab-content"],
|
|
318
325
|
D
|
|
319
326
|
),
|
|
320
|
-
children: /* @__PURE__ */
|
|
327
|
+
children: /* @__PURE__ */ j(
|
|
321
328
|
"div",
|
|
322
329
|
{
|
|
323
|
-
className:
|
|
330
|
+
className: I(
|
|
324
331
|
m["tab-header"],
|
|
325
332
|
R
|
|
326
333
|
),
|
|
327
334
|
children: [
|
|
328
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ j(
|
|
329
336
|
"div",
|
|
330
337
|
{
|
|
331
|
-
className:
|
|
338
|
+
className: I(
|
|
332
339
|
m["tab-text"],
|
|
333
340
|
y
|
|
334
341
|
),
|
|
@@ -336,17 +343,17 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
|
|
|
336
343
|
/* @__PURE__ */ h(
|
|
337
344
|
"div",
|
|
338
345
|
{
|
|
339
|
-
className:
|
|
346
|
+
className: I(
|
|
340
347
|
m["tab-value"],
|
|
341
348
|
b
|
|
342
349
|
),
|
|
343
|
-
children:
|
|
350
|
+
children: $
|
|
344
351
|
}
|
|
345
352
|
),
|
|
346
353
|
/* @__PURE__ */ h(
|
|
347
354
|
"div",
|
|
348
355
|
{
|
|
349
|
-
className:
|
|
356
|
+
className: I(
|
|
350
357
|
m["tab-name"],
|
|
351
358
|
F
|
|
352
359
|
),
|
|
@@ -359,7 +366,7 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
|
|
|
359
366
|
/* @__PURE__ */ h(
|
|
360
367
|
"div",
|
|
361
368
|
{
|
|
362
|
-
className:
|
|
369
|
+
className: I(
|
|
363
370
|
m["tab-icon"],
|
|
364
371
|
L
|
|
365
372
|
),
|
|
@@ -370,13 +377,13 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
|
|
|
370
377
|
}
|
|
371
378
|
)
|
|
372
379
|
}
|
|
373
|
-
) : /* @__PURE__ */
|
|
374
|
-
|
|
380
|
+
) : /* @__PURE__ */ j(Se, { children: [
|
|
381
|
+
te && /* @__PURE__ */ h(be, { iconName: te }),
|
|
375
382
|
c,
|
|
376
|
-
|
|
377
|
-
|
|
383
|
+
l && /* @__PURE__ */ h(
|
|
384
|
+
Le,
|
|
378
385
|
{
|
|
379
|
-
count:
|
|
386
|
+
count: l,
|
|
380
387
|
size: "m"
|
|
381
388
|
}
|
|
382
389
|
)
|
|
@@ -388,20 +395,20 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
|
|
|
388
395
|
) })
|
|
389
396
|
}
|
|
390
397
|
),
|
|
391
|
-
|
|
392
|
-
|
|
398
|
+
ce && /* @__PURE__ */ h("div", { className: I(m.buttons, x), children: /* @__PURE__ */ h(
|
|
399
|
+
De,
|
|
393
400
|
{
|
|
394
|
-
handlePrevTab:
|
|
395
|
-
handleNextTab:
|
|
396
|
-
buttonsVariant:
|
|
401
|
+
handlePrevTab: Z,
|
|
402
|
+
handleNextTab: oe,
|
|
403
|
+
buttonsVariant: i
|
|
397
404
|
}
|
|
398
405
|
) })
|
|
399
406
|
] }),
|
|
400
|
-
/* @__PURE__ */ h(ye, { className: m.panels, children: e.map(({ name: c, content:
|
|
407
|
+
/* @__PURE__ */ h(ye, { className: m.panels, children: e.map(({ name: c, content: w }) => /* @__PURE__ */ h(
|
|
401
408
|
Ee,
|
|
402
409
|
{
|
|
403
|
-
className:
|
|
404
|
-
children:
|
|
410
|
+
className: I(m.panel, d),
|
|
411
|
+
children: w
|
|
405
412
|
},
|
|
406
413
|
c
|
|
407
414
|
)) })
|
|
@@ -411,5 +418,5 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
|
|
|
411
418
|
}
|
|
412
419
|
);
|
|
413
420
|
export {
|
|
414
|
-
|
|
421
|
+
Dt as TabTrail
|
|
415
422
|
};
|