@lax-wp/design-system 0.13.73 → 0.13.75
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/dist/components/navigation/tabs/TabSwitch.cjs.js +1 -1
- package/dist/components/navigation/tabs/TabSwitch.cjs.js.map +1 -1
- package/dist/components/navigation/tabs/TabSwitch.es.js +60 -57
- package/dist/components/navigation/tabs/TabSwitch.es.js.map +1 -1
- package/dist/components/navigation/tabs/Tabs.cjs.js +1 -1
- package/dist/components/navigation/tabs/Tabs.cjs.js.map +1 -1
- package/dist/components/navigation/tabs/Tabs.es.js +402 -381
- package/dist/components/navigation/tabs/Tabs.es.js.map +1 -1
- package/dist/components/user-avatar/UserAvatar.cjs.js +1 -1
- package/dist/components/user-avatar/UserAvatar.cjs.js.map +1 -1
- package/dist/components/user-avatar/UserAvatar.es.js +17 -17
- package/dist/components/user-avatar/UserAvatar.es.js.map +1 -1
- package/dist/hooks/useTextWidth.cjs.js +1 -1
- package/dist/hooks/useTextWidth.cjs.js.map +1 -1
- package/dist/hooks/useTextWidth.es.js +11 -14
- package/dist/hooks/useTextWidth.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useSensors as
|
|
3
|
-
import { SortableContext as
|
|
4
|
-
import { Dropdown as
|
|
1
|
+
import { jsx as n, jsxs as ve } from "react/jsx-runtime";
|
|
2
|
+
import { useSensors as Xt, useSensor as it, MouseSensor as qt, TouchSensor as Qt, DndContext as Kt, closestCenter as Zt } from "@dnd-kit/core";
|
|
3
|
+
import { SortableContext as en, horizontalListSortingStrategy as tn, arrayMove as lt } from "@dnd-kit/sortable";
|
|
4
|
+
import { Dropdown as De } from "antd";
|
|
5
5
|
import l from "../../../_virtual/index.es.js";
|
|
6
|
-
import { useState as
|
|
7
|
-
import { useTranslation as
|
|
8
|
-
import
|
|
9
|
-
import { INITIAL_TAB_OPTION_CONFIG as
|
|
10
|
-
import { formatCount as
|
|
11
|
-
import { useTabConfig as
|
|
12
|
-
import { useTextWidth as
|
|
13
|
-
import
|
|
14
|
-
import { OptionButton as
|
|
15
|
-
import { SearchBar as
|
|
16
|
-
import
|
|
17
|
-
import { EditIcon as
|
|
18
|
-
import { toast as
|
|
19
|
-
import { TabSwitch as
|
|
20
|
-
import { PinIcon as
|
|
21
|
-
import { SortableTab as
|
|
22
|
-
import { DropableWrapper as
|
|
23
|
-
import { MoreButton as
|
|
24
|
-
import { TabOptions as
|
|
25
|
-
import { TabDragOverlay as
|
|
26
|
-
const
|
|
6
|
+
import { useState as g, useRef as re, useMemo as U, useCallback as C, useLayoutEffect as nn, useEffect as ae } from "react";
|
|
7
|
+
import { useTranslation as on } from "react-i18next";
|
|
8
|
+
import ct from "@mui/icons-material/MoreHorizOutlined";
|
|
9
|
+
import { INITIAL_TAB_OPTION_CONFIG as sn } from "./types.es.js";
|
|
10
|
+
import { formatCount as rn } from "../../../utils/formatters.es.js";
|
|
11
|
+
import { useTabConfig as an } from "../../../providers/design-system-provider/hooks.es.js";
|
|
12
|
+
import { useTextWidth as ln } from "../../../hooks/useTextWidth.es.js";
|
|
13
|
+
import cn from "../../button/IconButton.es.js";
|
|
14
|
+
import { OptionButton as k } from "../../buttons/option-button/OptionButton.es.js";
|
|
15
|
+
import { SearchBar as dn } from "../../forms/search-bar/SearchBar.es.js";
|
|
16
|
+
import Oe from "../../tooltip/Tooltip.es.js";
|
|
17
|
+
import { EditIcon as un } from "../../icons/EditIcon.es.js";
|
|
18
|
+
import { toast as mn } from "react-toastify";
|
|
19
|
+
import { TabSwitch as Ve } from "./TabSwitch.es.js";
|
|
20
|
+
import { PinIcon as ie, ArrowOutwardIcon as pn, ArrowUpwardIcon as fn, ArrowDownwardIcon as hn, ContentCopyIcon as bn, VisibilityOffIcon as xn, VisibilityIcon as gn, UnpinFilledIcon as wn, DeleteIcon as kn } from "../../icon/icons.generated.es.js";
|
|
21
|
+
import { SortableTab as dt } from "./SortableTab.es.js";
|
|
22
|
+
import { DropableWrapper as yn } from "./DropableWrapper.es.js";
|
|
23
|
+
import { MoreButton as Tn } from "./MoreButton.es.js";
|
|
24
|
+
import { TabOptions as Nn } from "./TabOptions.es.js";
|
|
25
|
+
import { TabDragOverlay as Sn } from "./TabDragOverlay.es.js";
|
|
26
|
+
const _n = () => Math.random().toString(16).slice(2, 13), le = [
|
|
27
27
|
"[&_.ant-dropdown-menu-item]:!outline-none",
|
|
28
28
|
"[&_.ant-dropdown-menu-submenu-title]:!outline-none",
|
|
29
29
|
"[&_.ant-dropdown-menu-item:focus-visible_.option-button-inner]:ring-2",
|
|
@@ -34,15 +34,15 @@ const mn = () => Math.random().toString(16).slice(2, 13), oe = [
|
|
|
34
34
|
"[&_.ant-dropdown-menu-submenu-title:focus-visible_.option-button-inner]:ring-primary-500",
|
|
35
35
|
"[&_.ant-dropdown-menu-submenu-title:focus-visible_.option-button-inner]:bg-gray-50",
|
|
36
36
|
"[&_.ant-dropdown-menu-submenu-title:focus-visible_.option-button-inner]:dark:bg-black-600"
|
|
37
|
-
].join(" ");
|
|
38
|
-
let
|
|
39
|
-
const
|
|
40
|
-
|
|
37
|
+
].join(" "), Cn = 26, ut = 6, In = 20, En = 32, vn = 24, Dn = 37, On = "(min-width: 640px)", Vn = 2, Ln = 'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif';
|
|
38
|
+
let Le = null;
|
|
39
|
+
const Me = (b) => {
|
|
40
|
+
b ? (Le = document.activeElement, setTimeout(() => {
|
|
41
41
|
document.querySelector(
|
|
42
42
|
".row-option-cell .ant-dropdown-menu-item:not(.ant-dropdown-menu-item-disabled), .row-option-cell .ant-dropdown-menu-submenu-title"
|
|
43
43
|
)?.focus();
|
|
44
44
|
}, 50)) : setTimeout(() => {
|
|
45
|
-
|
|
45
|
+
Le?.focus(), Le = null;
|
|
46
46
|
}, 0);
|
|
47
47
|
}, c = {
|
|
48
48
|
SELECT: "Select",
|
|
@@ -55,318 +55,328 @@ const Ie = (T) => {
|
|
|
55
55
|
PIN: "Pin",
|
|
56
56
|
UNPIN: "Unpin",
|
|
57
57
|
EDIT: "Edit"
|
|
58
|
-
},
|
|
59
|
-
variant:
|
|
60
|
-
tabs:
|
|
61
|
-
activeTab:
|
|
62
|
-
onTabClick:
|
|
58
|
+
}, ro = ({
|
|
59
|
+
variant: b = "default",
|
|
60
|
+
tabs: y = [],
|
|
61
|
+
activeTab: i,
|
|
62
|
+
onTabClick: mt,
|
|
63
63
|
suffixRecord: $,
|
|
64
|
-
isLoading:
|
|
65
|
-
size:
|
|
66
|
-
className:
|
|
67
|
-
draggable:
|
|
68
|
-
showAllItems:
|
|
69
|
-
copyLink:
|
|
70
|
-
isDisabled:
|
|
71
|
-
color:
|
|
72
|
-
iconsOnly:
|
|
73
|
-
tabIcons:
|
|
74
|
-
height:
|
|
75
|
-
fullWidth:
|
|
76
|
-
fitContentWidth:
|
|
77
|
-
disableAnimation:
|
|
78
|
-
onEdit:
|
|
79
|
-
onDelete:
|
|
80
|
-
onCopyLink:
|
|
81
|
-
allowPin:
|
|
82
|
-
isFullWidth:
|
|
83
|
-
rightSection:
|
|
84
|
-
initialTabs:
|
|
85
|
-
tabConfig:
|
|
86
|
-
onTabConfigChange:
|
|
87
|
-
onTabsChange:
|
|
88
|
-
parentContainer:
|
|
89
|
-
tabKey:
|
|
90
|
-
linkConfig:
|
|
91
|
-
showTabOptions:
|
|
64
|
+
isLoading: pt,
|
|
65
|
+
size: T = "md",
|
|
66
|
+
className: Ue,
|
|
67
|
+
draggable: I = !1,
|
|
68
|
+
showAllItems: G = !1,
|
|
69
|
+
copyLink: ft = !1,
|
|
70
|
+
isDisabled: ht = !1,
|
|
71
|
+
color: ce = "light",
|
|
72
|
+
iconsOnly: E = !1,
|
|
73
|
+
tabIcons: Y = {},
|
|
74
|
+
height: bt = "h-6",
|
|
75
|
+
fullWidth: de = !1,
|
|
76
|
+
fitContentWidth: ue = !1,
|
|
77
|
+
disableAnimation: xt = !1,
|
|
78
|
+
onEdit: He,
|
|
79
|
+
onDelete: Re,
|
|
80
|
+
onCopyLink: Ae,
|
|
81
|
+
allowPin: v = !1,
|
|
82
|
+
isFullWidth: D = !1,
|
|
83
|
+
rightSection: P,
|
|
84
|
+
initialTabs: gt,
|
|
85
|
+
tabConfig: wt,
|
|
86
|
+
onTabConfigChange: Pe,
|
|
87
|
+
onTabsChange: Fe,
|
|
88
|
+
parentContainer: kt = document.body,
|
|
89
|
+
tabKey: N,
|
|
90
|
+
linkConfig: p,
|
|
91
|
+
showTabOptions: me = !0
|
|
92
92
|
}) => {
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
), [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
),
|
|
93
|
+
const h = an(), Be = N ? h?.getTabSettings(N) : void 0, pe = gt ?? Be?.tab_items, J = wt ?? Be?.tab_options, [fe, yt] = g(""), [O, X] = g(!1), [he, ze] = g(0), [m, be] = g([]), [q, Tt] = g([]), [Nt, Q] = g(null), [H, K] = g(null), [St, We] = g(!1), [je, $e] = g(
|
|
94
|
+
J ?? sn
|
|
95
|
+
), [xe, _t] = g(""), [Ge, Ct] = g("contains"), { showCounts: S, lockOrder: F, sortOrder: ge } = je, { t: u } = on(), we = re(null), It = re(null), ke = re(!1), ye = re(""), { measureText: Z, clearCache: Ye } = ln(), B = U(() => _n(), []), Et = Xt(
|
|
96
|
+
it(qt, { activationConstraint: { distance: 5 } }),
|
|
97
|
+
it(Qt, { activationConstraint: { delay: 300, tolerance: 5 } })
|
|
98
|
+
), w = U(() => $ && Object.fromEntries(
|
|
99
99
|
Object.entries($).map(([e, t]) => [
|
|
100
100
|
e,
|
|
101
|
-
|
|
101
|
+
rn(t)
|
|
102
102
|
])
|
|
103
|
-
), [$]),
|
|
104
|
-
() =>
|
|
105
|
-
if (!
|
|
106
|
-
const t = (e ?? "").toLowerCase(),
|
|
107
|
-
return
|
|
103
|
+
), [$]), Je = U(() => q.filter(({ is_hidden: e }) => !e), [q]), R = U(() => q.filter(({ is_hidden: e }) => e), [q]), Xe = U(
|
|
104
|
+
() => Je.filter(({ name: e }) => {
|
|
105
|
+
if (!xe) return !0;
|
|
106
|
+
const t = (e ?? "").toLowerCase(), o = xe.toLowerCase();
|
|
107
|
+
return Ge === "contains" ? t.includes(o) : !t.includes(o);
|
|
108
108
|
}),
|
|
109
|
-
[
|
|
110
|
-
),
|
|
111
|
-
() => [...
|
|
112
|
-
[
|
|
113
|
-
),
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
[Je, xe, Ge]
|
|
110
|
+
), d = U(
|
|
111
|
+
() => [...Xe].sort((e, t) => e.is_pinned && !t.is_pinned ? -1 : !e.is_pinned && t.is_pinned ? 1 : 0),
|
|
112
|
+
[Xe]
|
|
113
|
+
), qe = JSON.stringify(
|
|
114
|
+
Object.entries(Y ?? {}).filter(([, e]) => e != null).map(([e]) => e).sort()
|
|
115
|
+
), Qe = U(
|
|
116
|
+
() => new Set(JSON.parse(qe)),
|
|
117
|
+
[qe]
|
|
118
|
+
), vt = he < d.length, ee = G ? d.length : vt ? he : d.length, Ke = d.findIndex((e) => e.name === i) >= ee, Ze = Math.max(0, d.length - ee - (Ke ? 1 : 0)) + R.length, z = C(
|
|
116
119
|
(e) => {
|
|
117
|
-
|
|
120
|
+
be(e), Fe?.(e), N && h?.persistTabSettings && h.persistTabSettings({ tab_type: N, tab_items: e });
|
|
118
121
|
},
|
|
119
|
-
[
|
|
120
|
-
),
|
|
122
|
+
[Fe, N, h]
|
|
123
|
+
), Dt = C(
|
|
121
124
|
(e) => {
|
|
122
|
-
|
|
125
|
+
$e(e), Pe?.(e), N && h?.persistTabSettings && h.persistTabSettings({ tab_type: N, tab_options: e });
|
|
123
126
|
},
|
|
124
|
-
[
|
|
125
|
-
),
|
|
127
|
+
[Pe, N, h]
|
|
128
|
+
), et = C(() => {
|
|
129
|
+
if (ye.current) return ye.current;
|
|
130
|
+
const e = we.current?.querySelector('[id^="btn-tabs-tabswitch-"] span'), t = e ? getComputedStyle(e).fontFamily : "";
|
|
131
|
+
return t && (ye.current = t), t || Ln;
|
|
132
|
+
}, []), te = C(
|
|
126
133
|
(e) => {
|
|
127
134
|
if (!e) return;
|
|
128
|
-
const t =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const N = a[h], ne = p?.[N.name] ? String(p?.[N.name]) : "", xe = k && ne ? z(ne, {
|
|
133
|
-
fontSize: "16px",
|
|
134
|
-
fontWeight: "500",
|
|
135
|
-
fontFamily: "Inter, system-ui, -apple-system, sans-serif"
|
|
136
|
-
}) + 18 + 2 : 0, ge = z(N?.name || "", {
|
|
137
|
-
fontSize: "16px",
|
|
138
|
-
fontWeight: "600",
|
|
139
|
-
fontFamily: "Inter, system-ui, -apple-system, sans-serif"
|
|
140
|
-
}), we = C ? je(N) : 0, Xe = ge + xe + o + i + we;
|
|
141
|
-
if (N.name === r && (te = Xe), f += Xe, b > f + (Je || qe ? s : 0) + h * 25)
|
|
142
|
-
g = h + 1;
|
|
143
|
-
else
|
|
144
|
-
break;
|
|
135
|
+
const t = d.length;
|
|
136
|
+
if (G) {
|
|
137
|
+
ze(t);
|
|
138
|
+
return;
|
|
145
139
|
}
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
b >= f + we && (g += 1);
|
|
140
|
+
const o = typeof window > "u" || window.matchMedia(On).matches, r = et(), s = { fontSize: "14px", fontWeight: "600", fontFamily: r }, f = { fontSize: "12px", fontWeight: "400", fontFamily: r }, V = (a, L = !1) => {
|
|
141
|
+
const M = E ? 0 : Z(u(a.name).toUpperCase(), s), _ = w?.[a.name], se = S && _ !== void 0 ? Z(String(_), f) + Cn + (E ? 0 : ut) : 0, $t = v && a.is_pinned || Qe.has(a.name) ? In + (E ? 0 : ut) : 0, Gt = I && a.name === i ? L ? vn : En : 0, Yt = b === "secondary" ? T === "sm" ? 24 : 32 : o ? 16 : 20, Jt = o && (L || !D) ? 8 : 0;
|
|
142
|
+
return M + se + $t + Gt + Yt + Jt;
|
|
143
|
+
}, oe = e - Vn, x = D ? 0 : T === "sm" ? 4 : 8, _e = [0];
|
|
144
|
+
d.forEach((a, L) => {
|
|
145
|
+
_e.push(_e[L] + V(a));
|
|
146
|
+
});
|
|
147
|
+
const Ce = d.findIndex((a) => a.name === i), zt = Ce >= 0 ? V(d[Ce], !0) : 0, Wt = b === "secondary" ? T === "sm" ? 24 : 32 : o ? 32 : 48, jt = (a) => Z(S ? `${a} MORE...` : "MORE...", s) + Wt + (o ? 8 : 0), st = I && me && y.length > 0 ? Dn : 0, rt = P?.width || 0, at = (a, L) => {
|
|
148
|
+
let M = _e[a], _ = a;
|
|
149
|
+
const se = L && Ce >= a;
|
|
150
|
+
if (se && (M += zt, _ += 1), L) {
|
|
151
|
+
const Ee = Math.max(0, t - a - (se ? 1 : 0)) + R.length;
|
|
152
|
+
Ee > 0 && (M += jt(Ee), _ += 1);
|
|
160
153
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
154
|
+
return st && (M += st, _ += 1), rt && (M += rt, _ += 1), M + x * Math.max(_ - 1, 0);
|
|
155
|
+
};
|
|
156
|
+
let Ie = 0;
|
|
157
|
+
if (R.length === 0 && at(t, !1) <= oe)
|
|
158
|
+
Ie = t;
|
|
159
|
+
else
|
|
160
|
+
for (let a = t; a >= 0; a--)
|
|
161
|
+
if (at(a, !0) <= oe) {
|
|
162
|
+
Ie = a;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
ze(Ie);
|
|
164
166
|
},
|
|
165
167
|
[
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
O,
|
|
168
|
+
d,
|
|
169
|
+
R.length,
|
|
170
|
+
y.length,
|
|
171
|
+
G,
|
|
172
|
+
i,
|
|
173
|
+
b,
|
|
174
|
+
T,
|
|
174
175
|
E,
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
D,
|
|
177
|
+
S,
|
|
178
|
+
w,
|
|
179
|
+
v,
|
|
180
|
+
Qe,
|
|
181
|
+
I,
|
|
182
|
+
me,
|
|
183
|
+
P?.width,
|
|
184
|
+
Z,
|
|
185
|
+
et,
|
|
186
|
+
u
|
|
177
187
|
]
|
|
178
|
-
),
|
|
188
|
+
), Te = C(
|
|
179
189
|
() => {
|
|
180
190
|
if (typeof window < "u")
|
|
181
191
|
return new URLSearchParams(window.location.search);
|
|
182
|
-
if (
|
|
183
|
-
const e = new URLSearchParams(), t =
|
|
184
|
-
return t && e.set(
|
|
192
|
+
if (p && h?.getSearchParam) {
|
|
193
|
+
const e = new URLSearchParams(), t = h.getSearchParam(p.key);
|
|
194
|
+
return t && e.set(p.key, t), e;
|
|
185
195
|
}
|
|
186
196
|
return new URLSearchParams();
|
|
187
197
|
},
|
|
188
|
-
[
|
|
189
|
-
),
|
|
190
|
-
(e, t) => (
|
|
191
|
-
[
|
|
192
|
-
),
|
|
193
|
-
(e) =>
|
|
194
|
-
[
|
|
195
|
-
),
|
|
198
|
+
[p, h]
|
|
199
|
+
), Ne = C(
|
|
200
|
+
(e, t) => (p && (t === p.defaultLink ? e.delete(p.key) : e.set(p.key, t), p.onResolve?.(e)), e),
|
|
201
|
+
[p]
|
|
202
|
+
), W = C(
|
|
203
|
+
(e) => p ? `?${Ne(Te(), e).toString()}` : void 0,
|
|
204
|
+
[Ne, Te, p]
|
|
205
|
+
), Ot = ft || !!p, Vt = C(
|
|
196
206
|
async (e) => {
|
|
197
|
-
const t =
|
|
198
|
-
await navigator.clipboard.writeText(
|
|
207
|
+
const t = W(e), o = typeof window < "u" ? window.location.origin : "", r = typeof window < "u" ? window.location.pathname : "", s = t ? `${o}${r}${t}` : `${o}${r}`;
|
|
208
|
+
await navigator.clipboard.writeText(s), mn.success(u("Link copied to clipboard"), {
|
|
199
209
|
toastId: "Link copied to clipboard"
|
|
200
|
-
}),
|
|
210
|
+
}), Ae?.(e, s);
|
|
201
211
|
},
|
|
202
|
-
[
|
|
203
|
-
),
|
|
204
|
-
if (
|
|
205
|
-
const t =
|
|
206
|
-
|
|
212
|
+
[W, u, Ae]
|
|
213
|
+
), j = (e) => {
|
|
214
|
+
if (X(!1), mt?.(e), p && h?.navigate) {
|
|
215
|
+
const t = Ne(Te(), e);
|
|
216
|
+
h.navigate(`?${t.toString()}`);
|
|
207
217
|
}
|
|
208
|
-
},
|
|
209
|
-
if (
|
|
210
|
-
const t =
|
|
211
|
-
(
|
|
212
|
-
),
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
const t =
|
|
216
|
-
(
|
|
218
|
+
}, tt = (e) => {
|
|
219
|
+
if (d.length <= 1) return;
|
|
220
|
+
const t = m.map(
|
|
221
|
+
(s) => s.name === e ? { ...s, is_hidden: !0 } : s
|
|
222
|
+
), o = d.findIndex((s) => s.name === e), r = o === 0 ? 1 : o - 1;
|
|
223
|
+
j(d[r].name), z(t);
|
|
224
|
+
}, Lt = (e) => {
|
|
225
|
+
const t = m.map(
|
|
226
|
+
(o) => o.name === e ? { ...o, is_hidden: !1 } : o
|
|
217
227
|
);
|
|
218
|
-
|
|
219
|
-
},
|
|
220
|
-
if (!
|
|
221
|
-
const t =
|
|
222
|
-
(
|
|
228
|
+
X(!1), z(t);
|
|
229
|
+
}, ne = (e) => {
|
|
230
|
+
if (!v) return;
|
|
231
|
+
const t = m.map(
|
|
232
|
+
(o) => o.name === e ? { ...o, is_pinned: !o.is_pinned } : o
|
|
223
233
|
);
|
|
224
|
-
|
|
225
|
-
},
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
},
|
|
229
|
-
const { active: t, over:
|
|
230
|
-
if (
|
|
231
|
-
|
|
234
|
+
z(t);
|
|
235
|
+
}, nt = (e, t) => {
|
|
236
|
+
const o = m.findIndex(({ name: s }) => s === e), r = t === "left" ? o - (m[o - 1]?.name === i ? 2 : 1) : o + 1;
|
|
237
|
+
z(lt(m, o, r));
|
|
238
|
+
}, ot = () => X(!O), Mt = (e) => K(e.active.id), Ut = (e) => {
|
|
239
|
+
const { active: t, over: o } = e;
|
|
240
|
+
if (o?.id === "more-tabs") {
|
|
241
|
+
tt(t.id), K(null), Q(null);
|
|
232
242
|
return;
|
|
233
243
|
}
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
-
},
|
|
244
|
+
const r = m.findIndex(({ name: f }) => f === t.id), s = m.findIndex(({ name: f }) => f === o?.id);
|
|
245
|
+
z(lt(m, r, s)), K(null), Q(null);
|
|
246
|
+
}, Ht = () => {
|
|
247
|
+
K(null), Q(null);
|
|
248
|
+
}, Rt = (e) => {
|
|
239
249
|
Q(e.over?.id === "more-tabs" ? "more-tabs" : null);
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
const
|
|
250
|
+
}, At = () => {
|
|
251
|
+
}, Pt = (e, t) => {
|
|
252
|
+
_t(e), Ct(t);
|
|
253
|
+
}, Se = (e, t = !1, o = !1) => {
|
|
254
|
+
const s = m.find((x) => x.name === e)?.is_pinned, f = [
|
|
245
255
|
{
|
|
246
256
|
label: /* @__PURE__ */ n(
|
|
247
|
-
|
|
257
|
+
k,
|
|
248
258
|
{
|
|
249
|
-
icon: /* @__PURE__ */ n(
|
|
259
|
+
icon: /* @__PURE__ */ n(pn, { size: 18, className: "text-inherit dark:text-inherit" }),
|
|
250
260
|
text: u("Select Tab"),
|
|
251
261
|
className: "text-black-900 dark:text-white"
|
|
252
262
|
}
|
|
253
263
|
),
|
|
254
264
|
key: c.SELECT,
|
|
255
|
-
onClick: () =>
|
|
265
|
+
onClick: () => j(e)
|
|
256
266
|
},
|
|
257
267
|
{
|
|
258
268
|
label: /* @__PURE__ */ n(
|
|
259
|
-
|
|
269
|
+
k,
|
|
260
270
|
{
|
|
261
|
-
icon: /* @__PURE__ */ n(
|
|
271
|
+
icon: /* @__PURE__ */ n(fn, { size: 18, className: "text-inherit dark:text-inherit" }),
|
|
262
272
|
text: u("Move Up"),
|
|
263
|
-
isDisabled:
|
|
273
|
+
isDisabled: F,
|
|
264
274
|
className: "text-black-900 dark:text-white"
|
|
265
275
|
}
|
|
266
276
|
),
|
|
267
277
|
key: c.MOVE_LEFT,
|
|
268
|
-
disabled:
|
|
269
|
-
onClick: () =>
|
|
278
|
+
disabled: F,
|
|
279
|
+
onClick: () => nt(e, "left")
|
|
270
280
|
},
|
|
271
281
|
{
|
|
272
282
|
label: /* @__PURE__ */ n(
|
|
273
|
-
|
|
283
|
+
k,
|
|
274
284
|
{
|
|
275
|
-
icon: /* @__PURE__ */ n(
|
|
285
|
+
icon: /* @__PURE__ */ n(hn, { size: 18, className: "text-inherit dark:text-inherit" }),
|
|
276
286
|
text: u("Move Down"),
|
|
277
|
-
isDisabled:
|
|
287
|
+
isDisabled: F,
|
|
278
288
|
className: "text-black-900 dark:text-white"
|
|
279
289
|
}
|
|
280
290
|
),
|
|
281
291
|
key: c.MOVE_RIGHT,
|
|
282
|
-
disabled:
|
|
283
|
-
onClick: () =>
|
|
292
|
+
disabled: F,
|
|
293
|
+
onClick: () => nt(e, "right")
|
|
284
294
|
},
|
|
285
295
|
{
|
|
286
296
|
label: /* @__PURE__ */ n(
|
|
287
|
-
|
|
297
|
+
k,
|
|
288
298
|
{
|
|
289
|
-
icon: /* @__PURE__ */ n(
|
|
299
|
+
icon: /* @__PURE__ */ n(bn, { size: 18, className: "text-inherit dark:text-inherit" }),
|
|
290
300
|
text: u("Copy Link"),
|
|
291
301
|
className: "text-black-900 dark:text-white"
|
|
292
302
|
}
|
|
293
303
|
),
|
|
294
304
|
key: c.COPY_LINK,
|
|
295
|
-
onClick: () =>
|
|
305
|
+
onClick: () => Vt(e)
|
|
296
306
|
},
|
|
297
307
|
{
|
|
298
308
|
label: /* @__PURE__ */ n(
|
|
299
|
-
|
|
309
|
+
k,
|
|
300
310
|
{
|
|
301
|
-
icon: /* @__PURE__ */ n(
|
|
311
|
+
icon: /* @__PURE__ */ n(xn, { size: 18, className: "text-inherit dark:text-inherit" }),
|
|
302
312
|
text: u("Hide"),
|
|
303
313
|
className: "text-black-900 dark:text-white"
|
|
304
314
|
}
|
|
305
315
|
),
|
|
306
316
|
key: c.HIDE,
|
|
307
|
-
onClick: () =>
|
|
317
|
+
onClick: () => tt(e)
|
|
308
318
|
},
|
|
309
319
|
{
|
|
310
320
|
label: /* @__PURE__ */ n(
|
|
311
|
-
|
|
321
|
+
k,
|
|
312
322
|
{
|
|
313
|
-
icon: /* @__PURE__ */ n(
|
|
323
|
+
icon: /* @__PURE__ */ n(gn, { size: 18, className: "text-inherit dark:text-inherit" }),
|
|
314
324
|
text: u("Unhide"),
|
|
315
325
|
className: "text-black-900 dark:text-white"
|
|
316
326
|
}
|
|
317
327
|
),
|
|
318
328
|
key: c.UNHIDE,
|
|
319
|
-
onClick: () =>
|
|
329
|
+
onClick: () => Lt(e)
|
|
320
330
|
},
|
|
321
331
|
{
|
|
322
332
|
label: /* @__PURE__ */ n(
|
|
323
|
-
|
|
333
|
+
k,
|
|
324
334
|
{
|
|
325
|
-
icon:
|
|
326
|
-
text: u(
|
|
335
|
+
icon: s ? /* @__PURE__ */ n(wn, { size: 20, className: "rotate-12 text-inherit dark:text-inherit" }) : /* @__PURE__ */ n(ie, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }),
|
|
336
|
+
text: u(s ? "Unpin" : "Pin"),
|
|
327
337
|
className: "text-black-900 dark:text-white",
|
|
328
|
-
notVisible: !
|
|
338
|
+
notVisible: !v
|
|
329
339
|
}
|
|
330
340
|
),
|
|
331
|
-
key:
|
|
332
|
-
onClick: () =>
|
|
341
|
+
key: s ? c.UNPIN : c.PIN,
|
|
342
|
+
onClick: () => ne(e)
|
|
333
343
|
},
|
|
334
344
|
{
|
|
335
345
|
label: /* @__PURE__ */ n(
|
|
336
|
-
|
|
346
|
+
k,
|
|
337
347
|
{
|
|
338
348
|
className: "text-black-900 dark:text-white",
|
|
339
|
-
icon: /* @__PURE__ */ n(
|
|
349
|
+
icon: /* @__PURE__ */ n(un, {}),
|
|
340
350
|
text: u("Edit"),
|
|
341
|
-
notVisible: !
|
|
351
|
+
notVisible: !He
|
|
342
352
|
}
|
|
343
353
|
),
|
|
344
354
|
key: c.EDIT,
|
|
345
|
-
onClick: () =>
|
|
355
|
+
onClick: () => He?.(e)
|
|
346
356
|
},
|
|
347
357
|
{
|
|
348
358
|
label: /* @__PURE__ */ n(
|
|
349
|
-
|
|
359
|
+
k,
|
|
350
360
|
{
|
|
351
361
|
className: "text-error-600 dark:text-error-600",
|
|
352
|
-
icon: /* @__PURE__ */ n(
|
|
362
|
+
icon: /* @__PURE__ */ n(kn, { size: 18, className: "text-error-600 dark:text-error-600" }),
|
|
353
363
|
text: u("Delete"),
|
|
354
|
-
notVisible: !
|
|
364
|
+
notVisible: !Re
|
|
355
365
|
}
|
|
356
366
|
),
|
|
357
367
|
key: c.DELETE,
|
|
358
|
-
onClick: () =>
|
|
368
|
+
onClick: () => Re?.(e)
|
|
359
369
|
}
|
|
360
|
-
],
|
|
370
|
+
], V = [c.HIDE, c.UNHIDE], oe = [c.SELECT, c.MOVE_LEFT, c.MOVE_RIGHT, c.UNHIDE];
|
|
361
371
|
return f.filter(
|
|
362
|
-
(
|
|
363
|
-
).filter((
|
|
364
|
-
},
|
|
372
|
+
(x) => t ? x.key === c.UNHIDE : o ? !V.includes(x.key) : !oe.includes(x.key)
|
|
373
|
+
).filter((x) => Ot ? !0 : x.key !== c.COPY_LINK).filter((x) => d.length === 1 ? x.key !== c.HIDE : !0);
|
|
374
|
+
}, A = (e, t) => ({
|
|
365
375
|
classValue: {
|
|
366
376
|
default: l("relative inline-flex pt-2 pb-3 px-2 pl-3 sm:px-2 rounded-t-sm group"),
|
|
367
377
|
secondary: l(
|
|
368
378
|
"flex w-full sm:w-auto relative rounded-lg font-sans font-semibold text-center cursor-pointer uppercase",
|
|
369
|
-
|
|
379
|
+
T === "sm" ? "py-1 px-3 text-sm" : "py-2 px-4 text-base"
|
|
370
380
|
)
|
|
371
381
|
},
|
|
372
382
|
selectedClassValue: {
|
|
@@ -383,78 +393,87 @@ const Ie = (T) => {
|
|
|
383
393
|
t ? "text-primary-600 dark:text-primary-500" : "text-neutral-400 dark:text-neutral-400"
|
|
384
394
|
)
|
|
385
395
|
}
|
|
386
|
-
})[e][
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
396
|
+
})[e][b];
|
|
397
|
+
nn(() => {
|
|
398
|
+
const e = we.current;
|
|
399
|
+
if (!e || b === "switch") return;
|
|
400
|
+
const t = (ue ? e.parentElement : e) ?? e, o = (f) => {
|
|
401
|
+
const V = getComputedStyle(f);
|
|
402
|
+
return f.clientWidth - (parseFloat(V.paddingLeft) || 0) - (parseFloat(V.paddingRight) || 0);
|
|
403
|
+
};
|
|
404
|
+
let r = !1;
|
|
405
|
+
const s = new ResizeObserver((f) => {
|
|
406
|
+
te(f[0].contentRect.width);
|
|
392
407
|
});
|
|
393
|
-
return
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
408
|
+
return s.observe(t), te(o(t)), !ke.current && typeof document < "u" && document.fonts && document.fonts.ready.then(() => {
|
|
409
|
+
r || ke.current || (ke.current = !0, Ye(), te(o(t)));
|
|
410
|
+
}), () => {
|
|
411
|
+
r = !0, s.disconnect();
|
|
412
|
+
};
|
|
413
|
+
}, [te, b, ue, Ye]);
|
|
414
|
+
const Ft = JSON.stringify(y), Bt = JSON.stringify(pe?.map(({ name: e }) => e));
|
|
415
|
+
return ae(() => {
|
|
416
|
+
if (pe?.length) {
|
|
417
|
+
let e = [...pe];
|
|
418
|
+
y.forEach((t) => {
|
|
419
|
+
e.find((o) => o.name === t) || e.push({ name: t, is_default: !1, is_hidden: !1, is_pinned: !1 });
|
|
401
420
|
}), e = e.filter(
|
|
402
|
-
(t,
|
|
403
|
-
),
|
|
421
|
+
(t, o, r) => y.includes(t.name) && o === r.findIndex((s) => s.name === t.name)
|
|
422
|
+
), be(e);
|
|
404
423
|
} else
|
|
405
|
-
|
|
406
|
-
|
|
424
|
+
be(
|
|
425
|
+
y.map((e) => ({ name: e, is_default: !1, is_hidden: !1, is_pinned: !1 })).filter((e, t, o) => t === o.findIndex((r) => r.name === e.name))
|
|
407
426
|
);
|
|
408
|
-
}, [
|
|
409
|
-
|
|
410
|
-
}, [
|
|
411
|
-
if (!
|
|
412
|
-
const e = [...
|
|
413
|
-
|
|
414
|
-
}, [
|
|
415
|
-
|
|
416
|
-
}, [
|
|
427
|
+
}, [Ft, Bt]), ae(() => {
|
|
428
|
+
J && $e(J);
|
|
429
|
+
}, [J]), ae(() => {
|
|
430
|
+
if (!m.length) return;
|
|
431
|
+
const e = [...m];
|
|
432
|
+
ge === "asc" ? e.sort((t, o) => t.name.localeCompare(o.name)) : ge === "desc" && e.sort((t, o) => o.name.localeCompare(t.name)), Tt(e);
|
|
433
|
+
}, [m, ge]), ae(() => {
|
|
434
|
+
Me(O);
|
|
435
|
+
}, [O]), b === "switch" ? /* @__PURE__ */ n("div", { className: l("inline", Ue), children: /* @__PURE__ */ n(
|
|
417
436
|
"ul",
|
|
418
437
|
{
|
|
419
438
|
role: "tablist",
|
|
420
439
|
"aria-orientation": "horizontal",
|
|
421
440
|
className: l(
|
|
422
441
|
"inline-flex grow-0 p-1 rounded-lg",
|
|
423
|
-
|
|
424
|
-
|
|
442
|
+
ce === "dark" ? "border-[1.5px] border-neutral-800 bg-neutral-800 dark:border-black-800" : "bg-neutral-100 dark:bg-black-700",
|
|
443
|
+
de ? "w-full" : "w-auto"
|
|
425
444
|
),
|
|
426
|
-
children:
|
|
427
|
-
const t =
|
|
428
|
-
return /* @__PURE__ */ n("li", { role: "presentation", className: l("inline-flex",
|
|
429
|
-
|
|
445
|
+
children: y.map((e) => {
|
|
446
|
+
const t = i === e, o = Y?.[e], r = m.find((f) => f.name === e), s = v && r?.is_pinned;
|
|
447
|
+
return /* @__PURE__ */ n("li", { role: "presentation", className: l("inline-flex", de ? "w-full" : "w-auto"), children: /* @__PURE__ */ n(
|
|
448
|
+
Ve,
|
|
430
449
|
{
|
|
431
450
|
title: e,
|
|
432
|
-
showCounts:
|
|
451
|
+
showCounts: S,
|
|
433
452
|
role: "tab",
|
|
434
453
|
ariaSelected: t,
|
|
435
454
|
tabIndex: 0,
|
|
436
|
-
icon:
|
|
437
|
-
iconsOnly:
|
|
455
|
+
icon: s ? /* @__PURE__ */ n(Oe, { title: "Unpin", children: /* @__PURE__ */ n("span", { onClick: () => ne(e), children: /* @__PURE__ */ n(ie, { className: "rotate-45 w-icon h-icon text-inherit dark:text-inherit" }) }) }) : o,
|
|
456
|
+
iconsOnly: E,
|
|
438
457
|
classValue: l(
|
|
439
458
|
"relative py-0.5 border-gray-200",
|
|
440
|
-
|
|
441
|
-
|
|
459
|
+
bt,
|
|
460
|
+
de ? "w-full flex items-center justify-center" : "px-2"
|
|
442
461
|
),
|
|
443
462
|
selectedClassValue: l(
|
|
444
463
|
"absolute inset-0 rounded-md z-0",
|
|
445
|
-
|
|
464
|
+
ce === "dark" ? "bg-neutral-900" : "bg-white dark:bg-black-800"
|
|
446
465
|
),
|
|
447
466
|
textClassValue: l(
|
|
448
467
|
"relative text-xs font-semibold font-sans whitespace-nowrap",
|
|
449
468
|
t ? "text-neutral-900 dark:text-neutral-100" : "text-neutral-700 dark:text-neutral-100"
|
|
450
469
|
),
|
|
451
470
|
isSelected: t,
|
|
452
|
-
href:
|
|
453
|
-
onClick:
|
|
454
|
-
suffixRecord:
|
|
455
|
-
selectedId:
|
|
456
|
-
color:
|
|
457
|
-
disableAnimation:
|
|
471
|
+
href: W(e),
|
|
472
|
+
onClick: ht ? void 0 : () => j(e),
|
|
473
|
+
suffixRecord: w,
|
|
474
|
+
selectedId: B,
|
|
475
|
+
color: ce,
|
|
476
|
+
disableAnimation: xt
|
|
458
477
|
}
|
|
459
478
|
) }, e);
|
|
460
479
|
})
|
|
@@ -462,136 +481,138 @@ const Ie = (T) => {
|
|
|
462
481
|
) }) : /* @__PURE__ */ n(
|
|
463
482
|
"div",
|
|
464
483
|
{
|
|
465
|
-
ref:
|
|
466
|
-
className: l(
|
|
467
|
-
onMouseEnter: () =>
|
|
468
|
-
onMouseLeave: () =>
|
|
469
|
-
children: /* @__PURE__ */
|
|
470
|
-
|
|
484
|
+
ref: we,
|
|
485
|
+
className: l(ue ? "w-fit" : "w-full"),
|
|
486
|
+
onMouseEnter: () => We(!0),
|
|
487
|
+
onMouseLeave: () => We(!1),
|
|
488
|
+
children: /* @__PURE__ */ ve(
|
|
489
|
+
Kt,
|
|
471
490
|
{
|
|
472
|
-
sensors:
|
|
473
|
-
onDragEnd:
|
|
474
|
-
onDragStart:
|
|
475
|
-
onDragCancel:
|
|
476
|
-
collisionDetection:
|
|
477
|
-
onDragOver:
|
|
491
|
+
sensors: Et,
|
|
492
|
+
onDragEnd: Ut,
|
|
493
|
+
onDragStart: Mt,
|
|
494
|
+
onDragCancel: Ht,
|
|
495
|
+
collisionDetection: Zt,
|
|
496
|
+
onDragOver: Rt,
|
|
478
497
|
children: [
|
|
479
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ ve(
|
|
480
499
|
"ul",
|
|
481
500
|
{
|
|
482
501
|
role: "tablist",
|
|
483
502
|
"aria-orientation": "horizontal",
|
|
484
503
|
className: l(
|
|
485
504
|
"flex items-center w-full",
|
|
486
|
-
|
|
487
|
-
|
|
505
|
+
Ue,
|
|
506
|
+
D ? "gap-0" : T === "sm" ? "gap-1" : "gap-2"
|
|
488
507
|
),
|
|
489
|
-
ref:
|
|
508
|
+
ref: It,
|
|
490
509
|
children: [
|
|
491
|
-
|
|
492
|
-
|
|
510
|
+
pt ? /* @__PURE__ */ n("div", { className: "skeleton bg-neutral-300 dark:bg-black-700 animate-pulse h-10 min-w-[100px] w-full rounded" }) : /* @__PURE__ */ ve(
|
|
511
|
+
en,
|
|
493
512
|
{
|
|
494
|
-
items:
|
|
495
|
-
strategy:
|
|
513
|
+
items: d.map(({ name: e }) => e),
|
|
514
|
+
strategy: tn,
|
|
496
515
|
id: "sortable",
|
|
497
|
-
disabled: !
|
|
516
|
+
disabled: !I || F,
|
|
498
517
|
children: [
|
|
499
|
-
|
|
500
|
-
const
|
|
518
|
+
d.slice(0, ee).map(({ name: e, is_pinned: t }) => {
|
|
519
|
+
const o = i === e && !O, r = v && t;
|
|
501
520
|
return /* @__PURE__ */ n(
|
|
502
|
-
|
|
521
|
+
dt,
|
|
503
522
|
{
|
|
504
523
|
title: e,
|
|
505
|
-
isDragging:
|
|
506
|
-
className:
|
|
507
|
-
children: /* @__PURE__ */ n("li", { role: "presentation", className: l(
|
|
508
|
-
|
|
524
|
+
isDragging: H === e,
|
|
525
|
+
className: D ? "flex-1 flex justify-center" : "",
|
|
526
|
+
children: /* @__PURE__ */ n("li", { role: "presentation", className: l(D ? "w-full flex" : "sm:mr-2"), children: /* @__PURE__ */ n(
|
|
527
|
+
Ve,
|
|
509
528
|
{
|
|
510
|
-
showCounts:
|
|
529
|
+
showCounts: S,
|
|
511
530
|
title: e,
|
|
531
|
+
iconsOnly: E,
|
|
512
532
|
role: "tab",
|
|
513
|
-
ariaSelected:
|
|
533
|
+
ariaSelected: o,
|
|
514
534
|
tabIndex: 0,
|
|
515
535
|
classValue: l(
|
|
516
|
-
|
|
517
|
-
|
|
536
|
+
A("classValue", o),
|
|
537
|
+
D ? "w-full justify-center" : ""
|
|
518
538
|
),
|
|
519
|
-
selectedClassValue:
|
|
520
|
-
textClassValue:
|
|
521
|
-
isSelected:
|
|
522
|
-
tabOptions:
|
|
523
|
-
|
|
539
|
+
selectedClassValue: A("selectedClassValue", o),
|
|
540
|
+
textClassValue: A("textClassValue", o),
|
|
541
|
+
isSelected: o,
|
|
542
|
+
tabOptions: o && I ? /* @__PURE__ */ n(
|
|
543
|
+
De,
|
|
524
544
|
{
|
|
525
545
|
menu: {
|
|
526
|
-
items:
|
|
527
|
-
className:
|
|
546
|
+
items: Se(e),
|
|
547
|
+
className: le
|
|
528
548
|
},
|
|
529
549
|
trigger: ["click"],
|
|
530
|
-
onOpenChange:
|
|
550
|
+
onOpenChange: Me,
|
|
531
551
|
overlayClassName: "row-option-cell",
|
|
532
552
|
rootClassName: "",
|
|
533
553
|
openClassName: "max-h-[350px] overflow-y-auto",
|
|
534
554
|
placement: "bottom",
|
|
535
555
|
children: /* @__PURE__ */ n(
|
|
536
|
-
|
|
556
|
+
cn,
|
|
537
557
|
{
|
|
538
558
|
tooltip: u("More"),
|
|
539
559
|
variant: "ghost",
|
|
540
560
|
className: "!text-primary-500 hover:!bg-primary-100 dark:hover:!bg-primary-900",
|
|
541
|
-
children: /* @__PURE__ */ n(
|
|
561
|
+
children: /* @__PURE__ */ n(ct, { sx: { fontSize: 20 } })
|
|
542
562
|
}
|
|
543
563
|
)
|
|
544
564
|
}
|
|
545
565
|
) : null,
|
|
546
|
-
draggingTab:
|
|
547
|
-
href:
|
|
548
|
-
onClick: () =>
|
|
549
|
-
suffixRecord:
|
|
550
|
-
selectedId:
|
|
551
|
-
icon:
|
|
566
|
+
draggingTab: H === e,
|
|
567
|
+
href: W(e),
|
|
568
|
+
onClick: () => j(e),
|
|
569
|
+
suffixRecord: w,
|
|
570
|
+
selectedId: B,
|
|
571
|
+
icon: r ? /* @__PURE__ */ n(Oe, { title: u("Unpin"), children: /* @__PURE__ */ n("span", { onClick: () => ne(e), children: /* @__PURE__ */ n(ie, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }) }) }) : Y?.[e] ?? null
|
|
552
572
|
}
|
|
553
573
|
) }, e)
|
|
554
574
|
},
|
|
555
575
|
e
|
|
556
576
|
);
|
|
557
577
|
}),
|
|
558
|
-
|
|
559
|
-
|
|
578
|
+
i && Ke ? /* @__PURE__ */ n(dt, { title: i, isDragging: H === i, children: /* @__PURE__ */ n("li", { role: "presentation", className: l("sm:mr-2"), children: /* @__PURE__ */ n(
|
|
579
|
+
Ve,
|
|
560
580
|
{
|
|
561
|
-
showCounts:
|
|
562
|
-
title:
|
|
581
|
+
showCounts: S,
|
|
582
|
+
title: i,
|
|
583
|
+
iconsOnly: E,
|
|
563
584
|
role: "tab",
|
|
564
585
|
ariaSelected: !0,
|
|
565
586
|
tabIndex: 0,
|
|
566
|
-
classValue:
|
|
567
|
-
selectedClassValue:
|
|
568
|
-
textClassValue:
|
|
587
|
+
classValue: A("classValue", !0),
|
|
588
|
+
selectedClassValue: A("selectedClassValue", !0),
|
|
589
|
+
textClassValue: A("textClassValue", !0),
|
|
569
590
|
isSelected: !0,
|
|
570
|
-
tabOptions:
|
|
571
|
-
|
|
591
|
+
tabOptions: I ? /* @__PURE__ */ n(
|
|
592
|
+
De,
|
|
572
593
|
{
|
|
573
594
|
menu: {
|
|
574
|
-
items:
|
|
575
|
-
className:
|
|
595
|
+
items: Se(i),
|
|
596
|
+
className: le
|
|
576
597
|
},
|
|
577
598
|
trigger: ["click"],
|
|
578
|
-
onOpenChange:
|
|
599
|
+
onOpenChange: Me,
|
|
579
600
|
overlayClassName: "row-option-cell",
|
|
580
601
|
rootClassName: "",
|
|
581
602
|
openClassName: "max-h-[350px] overflow-y-auto",
|
|
582
603
|
placement: "bottom",
|
|
583
|
-
children: /* @__PURE__ */ n(
|
|
604
|
+
children: /* @__PURE__ */ n(ct, { sx: { fontSize: 20 }, className: "text-primary-600" })
|
|
584
605
|
}
|
|
585
606
|
) : null,
|
|
586
|
-
draggingTab:
|
|
587
|
-
href:
|
|
588
|
-
suffixRecord:
|
|
589
|
-
selectedId:
|
|
590
|
-
icon:
|
|
607
|
+
draggingTab: H === i,
|
|
608
|
+
href: W(i),
|
|
609
|
+
suffixRecord: w,
|
|
610
|
+
selectedId: B,
|
|
611
|
+
icon: v && m.find((e) => e.name === i)?.is_pinned ? /* @__PURE__ */ n(Oe, { title: u("Pinned"), children: /* @__PURE__ */ n("span", { onClick: () => ne(i), children: /* @__PURE__ */ n(ie, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }) }) }) : Y?.[i] ?? null
|
|
591
612
|
}
|
|
592
|
-
) },
|
|
593
|
-
(
|
|
594
|
-
|
|
613
|
+
) }, i) }, i) : null,
|
|
614
|
+
(he < d.length && !G || R.length > 0) && Ze > 0 ? /* @__PURE__ */ n(yn, { id: "more-tabs", children: /* @__PURE__ */ n(
|
|
615
|
+
De,
|
|
595
616
|
{
|
|
596
617
|
overlayStyle: {
|
|
597
618
|
maxHeight: "calc(100vh - 350px)",
|
|
@@ -601,8 +622,8 @@ const Ie = (T) => {
|
|
|
601
622
|
borderRadius: 8,
|
|
602
623
|
boxShadow: "0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)"
|
|
603
624
|
},
|
|
604
|
-
onOpenChange: () =>
|
|
605
|
-
open:
|
|
625
|
+
onOpenChange: () => ot(),
|
|
626
|
+
open: O,
|
|
606
627
|
menu: {
|
|
607
628
|
items: [
|
|
608
629
|
{
|
|
@@ -610,41 +631,41 @@ const Ie = (T) => {
|
|
|
610
631
|
disabled: !0,
|
|
611
632
|
style: { minWidth: "190px", marginBottom: "8px" },
|
|
612
633
|
label: /* @__PURE__ */ n("div", { className: "px-2 bg-white dark:bg-black-800", children: /* @__PURE__ */ n(
|
|
613
|
-
|
|
634
|
+
dn,
|
|
614
635
|
{
|
|
615
636
|
id: "search-bar-more-tabs",
|
|
616
|
-
value:
|
|
637
|
+
value: fe,
|
|
617
638
|
classValues: "!rounded-lg",
|
|
618
|
-
onChange: (e) =>
|
|
639
|
+
onChange: (e) => yt(e)
|
|
619
640
|
}
|
|
620
641
|
) })
|
|
621
642
|
},
|
|
622
|
-
...
|
|
623
|
-
({ name: e }) => typeof e == "string" && (e ?? "").toLowerCase().includes(
|
|
643
|
+
...d.slice(ee).filter((e) => e.name !== i).concat(R).filter(
|
|
644
|
+
({ name: e }) => typeof e == "string" && (e ?? "").toLowerCase().includes(fe.toLowerCase())
|
|
624
645
|
).map(({ name: e, is_hidden: t }) => ({
|
|
625
646
|
key: e,
|
|
626
647
|
label: /* @__PURE__ */ n(
|
|
627
|
-
|
|
648
|
+
k,
|
|
628
649
|
{
|
|
629
650
|
className: l(
|
|
630
651
|
"uppercase",
|
|
631
652
|
t ? "text-neutral-400 dark:text-neutral-500" : "text-black-900 dark:text-black-200"
|
|
632
653
|
),
|
|
633
654
|
text: e,
|
|
634
|
-
suffixRecord:
|
|
635
|
-
highlight:
|
|
655
|
+
suffixRecord: S ? w : {},
|
|
656
|
+
highlight: fe,
|
|
636
657
|
truncateText: !0,
|
|
637
658
|
isDisabled: t,
|
|
638
659
|
onClick: t ? void 0 : () => {
|
|
639
|
-
|
|
660
|
+
j(e), X(!1);
|
|
640
661
|
}
|
|
641
662
|
}
|
|
642
663
|
),
|
|
643
|
-
popupClassName:
|
|
644
|
-
children:
|
|
664
|
+
popupClassName: le,
|
|
665
|
+
children: O ? Se(e, t, !0) : null
|
|
645
666
|
}))
|
|
646
667
|
],
|
|
647
|
-
className:
|
|
668
|
+
className: le
|
|
648
669
|
},
|
|
649
670
|
openClassName: "max-h-[350px] overflow-y-auto",
|
|
650
671
|
trigger: ["click"],
|
|
@@ -652,16 +673,16 @@ const Ie = (T) => {
|
|
|
652
673
|
placement: "bottomRight",
|
|
653
674
|
getPopupContainer: (e) => e.parentElement,
|
|
654
675
|
children: /* @__PURE__ */ n(
|
|
655
|
-
|
|
676
|
+
Tn,
|
|
656
677
|
{
|
|
657
|
-
title: `${
|
|
658
|
-
variant:
|
|
659
|
-
size:
|
|
660
|
-
draggingOver:
|
|
661
|
-
suffixRecord:
|
|
662
|
-
handleShowMoreDropdown:
|
|
663
|
-
selectedId:
|
|
664
|
-
showMoreDropdown:
|
|
678
|
+
title: `${S ? `${Ze} ` : ""}MORE...`,
|
|
679
|
+
variant: b,
|
|
680
|
+
size: T,
|
|
681
|
+
draggingOver: Nt,
|
|
682
|
+
suffixRecord: w,
|
|
683
|
+
handleShowMoreDropdown: ot,
|
|
684
|
+
selectedId: B,
|
|
685
|
+
showMoreDropdown: O
|
|
665
686
|
}
|
|
666
687
|
)
|
|
667
688
|
}
|
|
@@ -669,40 +690,40 @@ const Ie = (T) => {
|
|
|
669
690
|
]
|
|
670
691
|
}
|
|
671
692
|
),
|
|
672
|
-
|
|
673
|
-
|
|
693
|
+
P ? /* @__PURE__ */ n("div", { className: l(P?.className), children: /* @__PURE__ */ n("li", { children: P.component }) }) : null,
|
|
694
|
+
I && me && y.length > 0 ? /* @__PURE__ */ n(
|
|
674
695
|
"li",
|
|
675
696
|
{
|
|
676
697
|
className: l(
|
|
677
|
-
|
|
698
|
+
St ? "opacity-100" : "opacity-0",
|
|
678
699
|
"transition-opacity duration-300"
|
|
679
700
|
),
|
|
680
701
|
children: /* @__PURE__ */ n(
|
|
681
|
-
|
|
702
|
+
Nn,
|
|
682
703
|
{
|
|
683
|
-
hasSuffixRecord: !!(
|
|
684
|
-
savedConfig:
|
|
685
|
-
onApplyFilter: (e) =>
|
|
704
|
+
hasSuffixRecord: !!(w && Object.keys(w).length > 0),
|
|
705
|
+
savedConfig: je,
|
|
706
|
+
onApplyFilter: (e) => Dt(e),
|
|
686
707
|
setUnsavedChanges: () => {
|
|
687
708
|
},
|
|
688
|
-
handleTabSort:
|
|
689
|
-
onSearchChange:
|
|
709
|
+
handleTabSort: At,
|
|
710
|
+
onSearchChange: Pt
|
|
690
711
|
}
|
|
691
712
|
)
|
|
692
713
|
}
|
|
693
|
-
)
|
|
714
|
+
) : null
|
|
694
715
|
]
|
|
695
716
|
}
|
|
696
717
|
),
|
|
697
|
-
|
|
698
|
-
|
|
718
|
+
H ? /* @__PURE__ */ n(
|
|
719
|
+
Sn,
|
|
699
720
|
{
|
|
700
|
-
draggingTab:
|
|
701
|
-
suffixRecord:
|
|
702
|
-
size:
|
|
703
|
-
variant:
|
|
704
|
-
selectedId:
|
|
705
|
-
parentContainer:
|
|
721
|
+
draggingTab: H,
|
|
722
|
+
suffixRecord: w,
|
|
723
|
+
size: T,
|
|
724
|
+
variant: b,
|
|
725
|
+
selectedId: B,
|
|
726
|
+
parentContainer: kt
|
|
706
727
|
}
|
|
707
728
|
) : null
|
|
708
729
|
]
|
|
@@ -712,6 +733,6 @@ const Ie = (T) => {
|
|
|
712
733
|
);
|
|
713
734
|
};
|
|
714
735
|
export {
|
|
715
|
-
|
|
736
|
+
ro as Tabs
|
|
716
737
|
};
|
|
717
738
|
//# sourceMappingURL=Tabs.es.js.map
|