@pstdio/ui 0.44.0-nightly.20261018030230 → 0.44.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.
- package/dist/{MermaidComponent-DIHl8p85.js → MermaidComponent-DhNTaUMt.js} +2 -2
- package/dist/{MermaidComponent-DIHl8p85.js.map → MermaidComponent-DhNTaUMt.js.map} +1 -1
- package/dist/apply-theme-preference-B0vCu8zY.d.ts +26 -0
- package/dist/chat-ui.d.ts +50 -50
- package/dist/chat-ui.js +143 -141
- package/dist/chat-ui.js.map +1 -1
- package/dist/{collection-view-fields-Sa5HO5P7.d.ts → collection-view-fields-tMtZmuhS.d.ts} +0 -2
- package/dist/{collection-view-grouping-aKZhxYfX.js → collection-view-grouping-BKIr4QAb.js} +2 -2
- package/dist/{collection-view-grouping-aKZhxYfX.js.map → collection-view-grouping-BKIr4QAb.js.map} +1 -1
- package/dist/{collection-view-search-mHPkdyxT.js → collection-view-search-D7HFymZW.js} +160 -166
- package/dist/collection-view-search-D7HFymZW.js.map +1 -0
- package/dist/collection-view.d.ts +3 -90
- package/dist/collection-view.js +1 -1
- package/dist/data-table.d.ts +3 -2
- package/dist/data-table.js +98 -88
- package/dist/data-table.js.map +1 -1
- package/dist/{diff-drawer-BMl0zobj.js → diff-drawer-ByJsQg8F.js} +10 -10
- package/dist/diff-drawer-ByJsQg8F.js.map +1 -0
- package/dist/{diff-viewer-C5KXwq7E.js → diff-viewer-Cpiw-1ut.js} +4 -4
- package/dist/{diff-viewer-C5KXwq7E.js.map → diff-viewer-Cpiw-1ut.js.map} +1 -1
- package/dist/diff.js +2 -2
- package/dist/{display-sort-control-0_gG-W9g.js → display-sort-control-BuqijDAl.js} +3 -3
- package/dist/{display-sort-control-0_gG-W9g.js.map → display-sort-control-BuqijDAl.js.map} +1 -1
- package/dist/{edit-mode-data-table-BI_UDPfF.js → edit-mode-data-table-BwNTRik5.js} +147 -136
- package/dist/edit-mode-data-table-BwNTRik5.js.map +1 -0
- package/dist/host-storage-28AkEy1N.js +98 -0
- package/dist/host-storage-28AkEy1N.js.map +1 -0
- package/dist/index-3H4B61XK.d.ts +38 -0
- package/dist/{index-BTABZd25.d.ts → index-DTjRTEez.d.ts} +2 -2
- package/dist/index-kYQwGcym.d.ts +91 -0
- package/dist/index.d.ts +114 -101
- package/dist/index.js +763 -761
- package/dist/index.js.map +1 -1
- package/dist/kanban-renderer.d.ts +2 -2
- package/dist/kanban-renderer.js +509 -494
- package/dist/kanban-renderer.js.map +1 -1
- package/dist/list-row-BDDAVuVd.js +1228 -0
- package/dist/list-row-BDDAVuVd.js.map +1 -0
- package/dist/{markdown-editor-Dx41ftfs.js → markdown-editor-DUBUE7M-.js} +150 -138
- package/dist/markdown-editor-DUBUE7M-.js.map +1 -0
- package/dist/{param-editor-C4IUuO77.js → param-editor-DK1uCOh3.js} +2 -2
- package/dist/{param-editor-C4IUuO77.js.map → param-editor-DK1uCOh3.js.map} +1 -1
- package/dist/{param-editor-field-uBStVJ48.js → param-editor-field-B5z6200g.js} +278 -282
- package/dist/param-editor-field-B5z6200g.js.map +1 -0
- package/dist/param-editor.js +2 -2
- package/dist/{rich-text-Dlv0q1r_.js → rich-text-2c_ra5gK.js} +3 -3
- package/dist/{rich-text-Dlv0q1r_.js.map → rich-text-2c_ra5gK.js.map} +1 -1
- package/dist/rich-text.js +3 -3
- package/dist/terminal.d.ts +28 -0
- package/dist/terminal.js +59 -32
- package/dist/terminal.js.map +1 -1
- package/dist/{theme-DJE3KvWt.js → theme-Chgjys_o.js} +124 -96
- package/dist/theme-Chgjys_o.js.map +1 -0
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +1 -1
- package/dist/{tree-list-Ces1hpRd.js → tree-list-B8Gtot1M.js} +99 -99
- package/dist/tree-list-B8Gtot1M.js.map +1 -0
- package/dist/{use-virtualizer-CfDHoDer.js → use-virtualizer-CqDYJolY.js} +8 -3
- package/dist/use-virtualizer-CqDYJolY.js.map +1 -0
- package/dist/{workspace-badge-CvQBU6Hs.d.ts → workspace-badge-BMjS8ii4.d.ts} +6 -1
- package/package.json +2 -2
- package/dist/collection-view-search-mHPkdyxT.js.map +0 -1
- package/dist/diff-drawer-BMl0zobj.js.map +0 -1
- package/dist/edit-mode-data-table-BI_UDPfF.js.map +0 -1
- package/dist/host-storage-BIo5azql.js +0 -31
- package/dist/host-storage-BIo5azql.js.map +0 -1
- package/dist/index-Dd6e8lU_.d.ts +0 -61
- package/dist/list-row-F8kBQGB-.js +0 -1232
- package/dist/list-row-F8kBQGB-.js.map +0 -1
- package/dist/markdown-editor-Dx41ftfs.js.map +0 -1
- package/dist/param-editor-field-uBStVJ48.js.map +0 -1
- package/dist/theme-DJE3KvWt.js.map +0 -1
- package/dist/tree-list-Ces1hpRd.js.map +0 -1
- package/dist/use-virtualizer-CfDHoDer.js.map +0 -1
|
@@ -0,0 +1,1228 @@
|
|
|
1
|
+
import { n as e, t } from "./scroll-area-IeoRS73V.js";
|
|
2
|
+
import { Box as n, HStack as r, Icon as i, IconButton as a, Input as o, InputGroup as s, Menu as c, Portal as l, Stack as u, Text as d, Tooltip as f, chakra as p, useMenu as m, useMenuContext as h, useRecipe as g } from "@chakra-ui/react";
|
|
3
|
+
import { c as _ } from "react/compiler-runtime";
|
|
4
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
5
|
+
import * as x from "react";
|
|
6
|
+
import { Fragment as S, forwardRef as C, useEffect as w, useId as T, useRef as E, useState as D } from "react";
|
|
7
|
+
import { Check as O, ChevronDown as k, ChevronRight as A, Search as j } from "lucide-react";
|
|
8
|
+
//#region src/components/overlays/resource-menu-items.tsx
|
|
9
|
+
var M = (e) => {
|
|
10
|
+
let t = _(28), { action: n, onSelect: a } = e;
|
|
11
|
+
if (n.items && !n.isDisabled) {
|
|
12
|
+
let e;
|
|
13
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
|
|
14
|
+
placement: "right-start",
|
|
15
|
+
gutter: 2
|
|
16
|
+
}, t[0] = e) : e = t[0];
|
|
17
|
+
let r;
|
|
18
|
+
t[1] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ y(A, { size: 14 }), t[1] = r) : r = t[1];
|
|
19
|
+
let i;
|
|
20
|
+
t[2] !== n.icon || t[3] !== n.label ? (i = /* @__PURE__ */ y(c.TriggerItem, {
|
|
21
|
+
asChild: !0,
|
|
22
|
+
children: /* @__PURE__ */ y(Y, {
|
|
23
|
+
asChild: !0,
|
|
24
|
+
variant: "full-width",
|
|
25
|
+
label: n.label,
|
|
26
|
+
icon: n.icon,
|
|
27
|
+
endContent: r
|
|
28
|
+
})
|
|
29
|
+
}), t[2] = n.icon, t[3] = n.label, t[4] = i) : i = t[4];
|
|
30
|
+
let o;
|
|
31
|
+
t[5] !== n.items || t[6] !== a ? (o = /* @__PURE__ */ y(P, {
|
|
32
|
+
actions: n.items,
|
|
33
|
+
onSelect: a
|
|
34
|
+
}), t[5] = n.items, t[6] = a, t[7] = o) : o = t[7];
|
|
35
|
+
let s;
|
|
36
|
+
return t[8] !== i || t[9] !== o ? (s = /* @__PURE__ */ b(c.Root, {
|
|
37
|
+
positioning: e,
|
|
38
|
+
closeOnSelect: !1,
|
|
39
|
+
children: [i, o]
|
|
40
|
+
}), t[8] = i, t[9] = o, t[10] = s) : s = t[10], s;
|
|
41
|
+
}
|
|
42
|
+
let o;
|
|
43
|
+
t[11] !== n || t[12] !== a ? (o = () => a(n), t[11] = n, t[12] = a, t[13] = o) : o = t[13];
|
|
44
|
+
let s;
|
|
45
|
+
t[14] !== n.endContent || t[15] !== n.isSelected ? (s = n.isSelected ? /* @__PURE__ */ b(r, {
|
|
46
|
+
gap: "xs",
|
|
47
|
+
children: [n.endContent, /* @__PURE__ */ y(i, {
|
|
48
|
+
as: O,
|
|
49
|
+
boxSize: "3.5"
|
|
50
|
+
})]
|
|
51
|
+
}) : n.endContent, t[14] = n.endContent, t[15] = n.isSelected, t[16] = s) : s = t[16];
|
|
52
|
+
let l;
|
|
53
|
+
t[17] !== n.icon || t[18] !== n.isDisabled || t[19] !== n.label || t[20] !== s ? (l = /* @__PURE__ */ y(Y, {
|
|
54
|
+
asChild: !0,
|
|
55
|
+
variant: "full-width",
|
|
56
|
+
label: n.label,
|
|
57
|
+
icon: n.icon,
|
|
58
|
+
endContent: s,
|
|
59
|
+
disabled: n.isDisabled
|
|
60
|
+
}), t[17] = n.icon, t[18] = n.isDisabled, t[19] = n.label, t[20] = s, t[21] = l) : l = t[21];
|
|
61
|
+
let u;
|
|
62
|
+
return t[22] !== n.closeOnSelect || t[23] !== n.isDisabled || t[24] !== n.key || t[25] !== o || t[26] !== l ? (u = /* @__PURE__ */ y(c.Item, {
|
|
63
|
+
value: n.key,
|
|
64
|
+
disabled: n.isDisabled,
|
|
65
|
+
closeOnSelect: n.closeOnSelect,
|
|
66
|
+
onSelect: o,
|
|
67
|
+
asChild: !0,
|
|
68
|
+
children: l
|
|
69
|
+
}), t[22] = n.closeOnSelect, t[23] = n.isDisabled, t[24] = n.key, t[25] = o, t[26] = l, t[27] = u) : u = t[27], u;
|
|
70
|
+
}, N = (e) => {
|
|
71
|
+
let { actions: t, onSelect: n } = e, r = /* @__PURE__ */ new Map();
|
|
72
|
+
for (let e of t) {
|
|
73
|
+
let t = e.group?.id ?? "ungrouped", n = r.get(t) ?? {
|
|
74
|
+
label: e.group?.label,
|
|
75
|
+
actions: []
|
|
76
|
+
};
|
|
77
|
+
n.actions.push(e), r.set(t, n);
|
|
78
|
+
}
|
|
79
|
+
return [...r.entries()].map(([e, t], r) => /* @__PURE__ */ b(S, { children: [r > 0 ? /* @__PURE__ */ y(c.Separator, {}) : null, /* @__PURE__ */ b(c.ItemGroup, { children: [t.label ? /* @__PURE__ */ y(c.ItemGroupLabel, { children: t.label }) : null, t.actions.map((e, t) => /* @__PURE__ */ b(S, { children: [e.separatorBefore && t > 0 ? /* @__PURE__ */ y(c.Separator, {}) : null, /* @__PURE__ */ y(M, {
|
|
80
|
+
action: e,
|
|
81
|
+
onSelect: n
|
|
82
|
+
})] }, e.key))] })] }, e));
|
|
83
|
+
}, P = (e) => {
|
|
84
|
+
let t = _(2), n;
|
|
85
|
+
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ y(l, { children: /* @__PURE__ */ y(c.Positioner, { children: /* @__PURE__ */ y(c.Content, { children: /* @__PURE__ */ y(N, { ...e }) }) }) }), t[0] = e, t[1] = n), n;
|
|
86
|
+
}, F = (e) => {
|
|
87
|
+
let n = _(11), { actions: r, contentBackground: i, contentMinWidth: a, onSelect: o } = e, s = h(), u;
|
|
88
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (u = {
|
|
89
|
+
overscrollBehavior: "contain",
|
|
90
|
+
tabIndex: -1
|
|
91
|
+
}, n[0] = u) : u = n[0];
|
|
92
|
+
let d;
|
|
93
|
+
n[1] !== r || n[2] !== s.open || n[3] !== o ? (d = s.open ? /* @__PURE__ */ y(N, {
|
|
94
|
+
actions: r,
|
|
95
|
+
onSelect: o
|
|
96
|
+
}) : null, n[1] = r, n[2] = s.open, n[3] = o, n[4] = d) : d = n[4];
|
|
97
|
+
let f;
|
|
98
|
+
n[5] === d ? f = n[6] : (f = /* @__PURE__ */ y(t, {
|
|
99
|
+
flex: "1",
|
|
100
|
+
minH: "0",
|
|
101
|
+
viewportProps: u,
|
|
102
|
+
children: d
|
|
103
|
+
}), n[5] = d, n[6] = f);
|
|
104
|
+
let p;
|
|
105
|
+
return n[7] !== i || n[8] !== a || n[9] !== f ? (p = /* @__PURE__ */ y(l, { children: /* @__PURE__ */ y(c.Positioner, { children: /* @__PURE__ */ y(c.Content, {
|
|
106
|
+
minW: a,
|
|
107
|
+
bg: i,
|
|
108
|
+
maxH: "var(--available-height)",
|
|
109
|
+
children: f
|
|
110
|
+
}) }) }), n[7] = i, n[8] = a, n[9] = f, n[10] = p) : p = n[10], p;
|
|
111
|
+
}, I = (e) => {
|
|
112
|
+
let t = _(5), n = E(null), r;
|
|
113
|
+
t[0] === e ? r = t[1] : (r = (t) => {
|
|
114
|
+
t.closeOnSelect ?? e ?? !0 ? n.current = t : t.onClick?.();
|
|
115
|
+
}, t[0] = e, t[1] = r);
|
|
116
|
+
let i;
|
|
117
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (i = () => {
|
|
118
|
+
let e = n.current;
|
|
119
|
+
n.current = null, e?.onClick?.();
|
|
120
|
+
}, t[2] = i) : i = t[2];
|
|
121
|
+
let a;
|
|
122
|
+
return t[3] === r ? a = t[4] : (a = {
|
|
123
|
+
onSelect: r,
|
|
124
|
+
onExitComplete: i
|
|
125
|
+
}, t[3] = r, t[4] = a), a;
|
|
126
|
+
}, L = (e) => {
|
|
127
|
+
let t = _(15), { actions: n, children: r, contentMinWidth: i, contentBackground: a, positioning: o, closeOnSelect: s } = e, l = i === void 0 ? "17.5rem" : i, u = a === void 0 ? "bg" : a, d;
|
|
128
|
+
t[0] === o ? d = t[1] : (d = o === void 0 ? { placement: "bottom-start" } : o, t[0] = o, t[1] = d);
|
|
129
|
+
let f = d, { onSelect: p, onExitComplete: m } = I(s);
|
|
130
|
+
if (n.length === 0) return r;
|
|
131
|
+
let h;
|
|
132
|
+
t[2] === r ? h = t[3] : (h = /* @__PURE__ */ y(c.Trigger, {
|
|
133
|
+
asChild: !0,
|
|
134
|
+
children: r
|
|
135
|
+
}), t[2] = r, t[3] = h);
|
|
136
|
+
let g;
|
|
137
|
+
t[4] !== n || t[5] !== u || t[6] !== l || t[7] !== p ? (g = /* @__PURE__ */ y(F, {
|
|
138
|
+
actions: n,
|
|
139
|
+
contentMinWidth: l,
|
|
140
|
+
contentBackground: u,
|
|
141
|
+
onSelect: p
|
|
142
|
+
}), t[4] = n, t[5] = u, t[6] = l, t[7] = p, t[8] = g) : g = t[8];
|
|
143
|
+
let v;
|
|
144
|
+
return t[9] !== s || t[10] !== m || t[11] !== f || t[12] !== h || t[13] !== g ? (v = /* @__PURE__ */ b(c.Root, {
|
|
145
|
+
positioning: f,
|
|
146
|
+
closeOnSelect: s,
|
|
147
|
+
onExitComplete: m,
|
|
148
|
+
children: [h, g]
|
|
149
|
+
}), t[9] = s, t[10] = m, t[11] = f, t[12] = h, t[13] = g, t[14] = v) : v = t[14], v;
|
|
150
|
+
}, R = (e) => {
|
|
151
|
+
let t = _(40), { actions: n, children: r, contentMinWidth: i, contentBackground: a, positioning: o, closeOnSelect: s, keepMountedWhenEmpty: l } = e, u = i === void 0 ? "17.5rem" : i, d = a === void 0 ? "bg" : a, f;
|
|
152
|
+
t[0] === o ? f = t[1] : (f = o === void 0 ? { placement: "bottom-start" } : o, t[0] = o, t[1] = f);
|
|
153
|
+
let h = f, g = l !== void 0 && l, { onSelect: x, onExitComplete: S } = I(s), C = E(null), w;
|
|
154
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (w = {
|
|
155
|
+
x: 0,
|
|
156
|
+
y: 0,
|
|
157
|
+
width: 0,
|
|
158
|
+
height: 0
|
|
159
|
+
}, t[2] = w) : w = t[2];
|
|
160
|
+
let T = E(w), D;
|
|
161
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (D = () => T.current, t[3] = D) : D = t[3];
|
|
162
|
+
let O;
|
|
163
|
+
t[4] === h ? O = t[5] : (O = {
|
|
164
|
+
...h,
|
|
165
|
+
strategy: "fixed",
|
|
166
|
+
getAnchorRect: D
|
|
167
|
+
}, t[4] = h, t[5] = O);
|
|
168
|
+
let k;
|
|
169
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (k = () => {
|
|
170
|
+
let e = C.current;
|
|
171
|
+
C.current = null, e && requestAnimationFrame(() => e.focus());
|
|
172
|
+
}, t[6] = k) : k = t[6];
|
|
173
|
+
let A;
|
|
174
|
+
t[7] !== s || t[8] !== O ? (A = {
|
|
175
|
+
positioning: O,
|
|
176
|
+
closeOnSelect: s,
|
|
177
|
+
onEscapeKeyDown: k
|
|
178
|
+
}, t[7] = s, t[8] = O, t[9] = A) : A = t[9];
|
|
179
|
+
let j = m(A), M;
|
|
180
|
+
t[10] === j.api ? M = t[11] : (M = j.api.getContextTriggerProps(), t[10] = j.api, t[11] = M);
|
|
181
|
+
let N = M;
|
|
182
|
+
if (n.length === 0 && !g) {
|
|
183
|
+
let e;
|
|
184
|
+
return t[12] === r ? e = t[13] : (e = /* @__PURE__ */ y(v, { children: r }), t[12] = r, t[13] = e), e;
|
|
185
|
+
}
|
|
186
|
+
let P;
|
|
187
|
+
t[14] !== n.length || t[15] !== N ? (P = (e) => {
|
|
188
|
+
n.length !== 0 && e.pointerType !== "mouse" && (C.current = null, e.stopPropagation(), T.current = {
|
|
189
|
+
x: e.clientX,
|
|
190
|
+
y: e.clientY,
|
|
191
|
+
width: 0,
|
|
192
|
+
height: 0
|
|
193
|
+
}, N.onPointerDown?.(e));
|
|
194
|
+
}, t[14] = n.length, t[15] = N, t[16] = P) : P = t[16];
|
|
195
|
+
let L;
|
|
196
|
+
t[17] === n.length ? L = t[18] : (L = (e) => {
|
|
197
|
+
if (e.defaultPrevented || n.length === 0 || e.key !== "ContextMenu" && !(e.shiftKey && e.key === "F10")) return;
|
|
198
|
+
e.preventDefault(), e.stopPropagation();
|
|
199
|
+
let t = e.currentTarget.getBoundingClientRect();
|
|
200
|
+
e.currentTarget.dispatchEvent(new MouseEvent("contextmenu", {
|
|
201
|
+
bubbles: !0,
|
|
202
|
+
cancelable: !0,
|
|
203
|
+
clientX: t.left,
|
|
204
|
+
clientY: t.bottom
|
|
205
|
+
})), C.current = e.target;
|
|
206
|
+
}, t[17] = n.length, t[18] = L);
|
|
207
|
+
let R;
|
|
208
|
+
t[19] !== n.length || t[20] !== N ? (R = (e) => {
|
|
209
|
+
C.current = null, n.length > 0 && !e.defaultPrevented && (T.current = {
|
|
210
|
+
x: e.clientX,
|
|
211
|
+
y: e.clientY,
|
|
212
|
+
width: 0,
|
|
213
|
+
height: 0
|
|
214
|
+
}, e.stopPropagation(), N.onContextMenu?.(e));
|
|
215
|
+
}, t[19] = n.length, t[20] = N, t[21] = R) : R = t[21];
|
|
216
|
+
let z;
|
|
217
|
+
t[22] !== r || t[23] !== P || t[24] !== L || t[25] !== R || t[26] !== N ? (z = /* @__PURE__ */ y(p.div, {
|
|
218
|
+
asChild: !0,
|
|
219
|
+
...N,
|
|
220
|
+
onPointerDown: P,
|
|
221
|
+
onKeyDown: L,
|
|
222
|
+
onContextMenu: R,
|
|
223
|
+
children: r
|
|
224
|
+
}), t[22] = r, t[23] = P, t[24] = L, t[25] = R, t[26] = N, t[27] = z) : z = t[27];
|
|
225
|
+
let B;
|
|
226
|
+
t[28] !== n || t[29] !== d || t[30] !== u || t[31] !== x ? (B = n.length > 0 ? /* @__PURE__ */ y(F, {
|
|
227
|
+
actions: n,
|
|
228
|
+
contentMinWidth: u,
|
|
229
|
+
contentBackground: d,
|
|
230
|
+
onSelect: x
|
|
231
|
+
}) : null, t[28] = n, t[29] = d, t[30] = u, t[31] = x, t[32] = B) : B = t[32];
|
|
232
|
+
let V;
|
|
233
|
+
t[33] !== j || t[34] !== S || t[35] !== B ? (V = /* @__PURE__ */ y(c.RootProvider, {
|
|
234
|
+
value: j,
|
|
235
|
+
lazyMount: !0,
|
|
236
|
+
unmountOnExit: !0,
|
|
237
|
+
onExitComplete: S,
|
|
238
|
+
children: B
|
|
239
|
+
}), t[33] = j, t[34] = S, t[35] = B, t[36] = V) : V = t[36];
|
|
240
|
+
let H;
|
|
241
|
+
return t[37] !== z || t[38] !== V ? (H = /* @__PURE__ */ b(v, { children: [z, V] }), t[37] = z, t[38] = V, t[39] = H) : H = t[39], H;
|
|
242
|
+
}, z = (e) => {
|
|
243
|
+
let t = _(4), { item: r } = e;
|
|
244
|
+
if (!r.icon) return null;
|
|
245
|
+
let a;
|
|
246
|
+
t[0] === r.icon ? a = t[1] : (a = typeof r.icon == "function" ? /* @__PURE__ */ y(i, {
|
|
247
|
+
as: r.icon,
|
|
248
|
+
boxSize: "14px"
|
|
249
|
+
}) : r.icon, t[0] = r.icon, t[1] = a);
|
|
250
|
+
let o;
|
|
251
|
+
return t[2] === a ? o = t[3] : (o = /* @__PURE__ */ y(n, {
|
|
252
|
+
color: "fg.muted",
|
|
253
|
+
flexShrink: 0,
|
|
254
|
+
display: "inline-flex",
|
|
255
|
+
children: a
|
|
256
|
+
}), t[2] = a, t[3] = o), o;
|
|
257
|
+
}, B = (e) => {
|
|
258
|
+
let t = _(22), { children: a, items: o, onOpenChange: s, onSelect: f, open: p, placement: m, triggerId: h } = e, g = m === void 0 ? "right-start" : m, v = E(null), x;
|
|
259
|
+
t[0] === h ? x = t[1] : (x = { trigger: h }, t[0] = h, t[1] = x);
|
|
260
|
+
let C;
|
|
261
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (C = { mainAxis: 4 }, t[2] = C) : C = t[2];
|
|
262
|
+
let w;
|
|
263
|
+
t[3] === g ? w = t[4] : (w = {
|
|
264
|
+
placement: g,
|
|
265
|
+
offset: C
|
|
266
|
+
}, t[3] = g, t[4] = w);
|
|
267
|
+
let T;
|
|
268
|
+
t[5] === s ? T = t[6] : (T = (e) => s(e.open), t[5] = s, t[6] = T);
|
|
269
|
+
let D;
|
|
270
|
+
t[7] === Symbol.for("react.memo_cache_sentinel") ? (D = () => {
|
|
271
|
+
let e = v.current;
|
|
272
|
+
v.current = null, e?.onClick?.();
|
|
273
|
+
}, t[7] = D) : D = t[7];
|
|
274
|
+
let O;
|
|
275
|
+
t[8] === a ? O = t[9] : (O = /* @__PURE__ */ y(c.Trigger, {
|
|
276
|
+
asChild: !0,
|
|
277
|
+
children: a
|
|
278
|
+
}), t[8] = a, t[9] = O);
|
|
279
|
+
let k;
|
|
280
|
+
t[10] !== o || t[11] !== f ? (k = o.some(V) ? /* @__PURE__ */ y(N, {
|
|
281
|
+
actions: o.map((e) => ({
|
|
282
|
+
key: e.id,
|
|
283
|
+
label: e.label,
|
|
284
|
+
group: e.group,
|
|
285
|
+
icon: typeof e.icon == "function" ? /* @__PURE__ */ y(i, {
|
|
286
|
+
as: e.icon,
|
|
287
|
+
boxSize: "4"
|
|
288
|
+
}) : e.icon,
|
|
289
|
+
endContent: e.endContent,
|
|
290
|
+
isDisabled: e.disabled || e.readOnly,
|
|
291
|
+
separatorBefore: e.separatorBefore,
|
|
292
|
+
onClick: () => f(e)
|
|
293
|
+
})),
|
|
294
|
+
onSelect: (e) => {
|
|
295
|
+
v.current = e;
|
|
296
|
+
}
|
|
297
|
+
}) : o.map((e) => /* @__PURE__ */ b(S, { children: [e.separatorBefore ? /* @__PURE__ */ y(c.Separator, {}) : null, /* @__PURE__ */ y(c.Item, {
|
|
298
|
+
value: e.id,
|
|
299
|
+
disabled: e.disabled || e.readOnly,
|
|
300
|
+
_disabled: e.readOnly ? {
|
|
301
|
+
opacity: 1,
|
|
302
|
+
cursor: "default"
|
|
303
|
+
} : void 0,
|
|
304
|
+
onClick: () => {
|
|
305
|
+
e.readOnly || f(e);
|
|
306
|
+
},
|
|
307
|
+
children: /* @__PURE__ */ b(r, {
|
|
308
|
+
gap: "2",
|
|
309
|
+
minW: "0",
|
|
310
|
+
w: "full",
|
|
311
|
+
justify: "space-between",
|
|
312
|
+
alignItems: "center",
|
|
313
|
+
children: [/* @__PURE__ */ b(r, {
|
|
314
|
+
gap: "2",
|
|
315
|
+
minW: "0",
|
|
316
|
+
flex: "1",
|
|
317
|
+
alignItems: e.description ? "flex-start" : "center",
|
|
318
|
+
children: [/* @__PURE__ */ y(z, { item: e }), /* @__PURE__ */ b(u, {
|
|
319
|
+
gap: "0",
|
|
320
|
+
minW: "0",
|
|
321
|
+
children: [/* @__PURE__ */ y(d, {
|
|
322
|
+
textStyle: "label/S/regular",
|
|
323
|
+
truncate: !0,
|
|
324
|
+
children: e.label
|
|
325
|
+
}), e.description ? /* @__PURE__ */ y(d, {
|
|
326
|
+
textStyle: "label/XS",
|
|
327
|
+
color: "fg.menu-item.secondary",
|
|
328
|
+
truncate: !0,
|
|
329
|
+
children: e.description
|
|
330
|
+
}) : null]
|
|
331
|
+
})]
|
|
332
|
+
}), e.endContent ? /* @__PURE__ */ y(n, {
|
|
333
|
+
flexShrink: 0,
|
|
334
|
+
children: e.endContent
|
|
335
|
+
}) : null]
|
|
336
|
+
})
|
|
337
|
+
})] }, e.id)), t[10] = o, t[11] = f, t[12] = k) : k = t[12];
|
|
338
|
+
let A;
|
|
339
|
+
t[13] === k ? A = t[14] : (A = /* @__PURE__ */ y(l, { children: /* @__PURE__ */ y(c.Positioner, { children: /* @__PURE__ */ y(c.Content, {
|
|
340
|
+
minW: "200px",
|
|
341
|
+
bg: "bg",
|
|
342
|
+
children: k
|
|
343
|
+
}) }) }), t[13] = k, t[14] = A);
|
|
344
|
+
let j;
|
|
345
|
+
return t[15] !== p || t[16] !== x || t[17] !== w || t[18] !== T || t[19] !== O || t[20] !== A ? (j = /* @__PURE__ */ b(c.Root, {
|
|
346
|
+
ids: x,
|
|
347
|
+
open: p,
|
|
348
|
+
positioning: w,
|
|
349
|
+
onOpenChange: T,
|
|
350
|
+
onExitComplete: D,
|
|
351
|
+
children: [O, A]
|
|
352
|
+
}), t[15] = p, t[16] = x, t[17] = w, t[18] = T, t[19] = O, t[20] = A, t[21] = j) : j = t[21], j;
|
|
353
|
+
};
|
|
354
|
+
function V(e) {
|
|
355
|
+
return e.group;
|
|
356
|
+
}
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region src/components/list-row/list-row-chrome.tsx
|
|
359
|
+
var H = (e) => e.map((e) => ({
|
|
360
|
+
key: e.id,
|
|
361
|
+
label: e.label,
|
|
362
|
+
commandId: e.commandId,
|
|
363
|
+
group: e.group,
|
|
364
|
+
icon: typeof e.icon == "function" ? /* @__PURE__ */ y(i, {
|
|
365
|
+
as: e.icon,
|
|
366
|
+
boxSize: "16px"
|
|
367
|
+
}) : e.icon,
|
|
368
|
+
endContent: e.endContent,
|
|
369
|
+
isDisabled: e.disabled,
|
|
370
|
+
separatorBefore: e.separatorBefore,
|
|
371
|
+
onClick: () => e.onAction?.()
|
|
372
|
+
})), ee = (e) => {
|
|
373
|
+
let t = _(23), { children: n, item: r, menuOpen: i, onMenuOpenChange: a, onMenuSelect: o } = e, s = T();
|
|
374
|
+
if (r.menuItems && r.menuItems.length > 0) {
|
|
375
|
+
let e;
|
|
376
|
+
return t[0] !== n || t[1] !== r.id || t[2] !== r.menuItems || t[3] !== r.menuPlacement || t[4] !== i || t[5] !== a || t[6] !== o ? (e = /* @__PURE__ */ y(B, {
|
|
377
|
+
triggerId: r.id,
|
|
378
|
+
items: r.menuItems,
|
|
379
|
+
open: i,
|
|
380
|
+
placement: r.menuPlacement,
|
|
381
|
+
onOpenChange: a,
|
|
382
|
+
onSelect: o,
|
|
383
|
+
children: n
|
|
384
|
+
}), t[0] = n, t[1] = r.id, t[2] = r.menuItems, t[3] = r.menuPlacement, t[4] = i, t[5] = a, t[6] = o, t[7] = e) : e = t[7], e;
|
|
385
|
+
}
|
|
386
|
+
let c = n.props.id ?? s, u;
|
|
387
|
+
t[8] !== n || t[9] !== r.tooltip || t[10] !== c ? (u = r.tooltip ? /* @__PURE__ */ y(f.Trigger, {
|
|
388
|
+
asChild: !0,
|
|
389
|
+
id: c,
|
|
390
|
+
children: n
|
|
391
|
+
}) : n, t[8] = n, t[9] = r.tooltip, t[10] = c, t[11] = u) : u = t[11];
|
|
392
|
+
let d = u, p;
|
|
393
|
+
t[12] !== r.contextMenuItems || t[13] !== d ? (p = r.contextMenuItems && r.contextMenuItems.length > 0 ? /* @__PURE__ */ y(R, {
|
|
394
|
+
actions: H(r.contextMenuItems),
|
|
395
|
+
children: d
|
|
396
|
+
}) : d, t[12] = r.contextMenuItems, t[13] = d, t[14] = p) : p = t[14];
|
|
397
|
+
let m = p;
|
|
398
|
+
if (!r.tooltip) return m;
|
|
399
|
+
let h;
|
|
400
|
+
t[15] === c ? h = t[16] : (h = { trigger: c }, t[15] = c, t[16] = h);
|
|
401
|
+
let g;
|
|
402
|
+
t[17] === r.tooltip ? g = t[18] : (g = /* @__PURE__ */ y(l, { children: /* @__PURE__ */ y(f.Positioner, { children: /* @__PURE__ */ y(f.Content, { children: r.tooltip }) }) }), t[17] = r.tooltip, t[18] = g);
|
|
403
|
+
let v;
|
|
404
|
+
return t[19] !== m || t[20] !== h || t[21] !== g ? (v = /* @__PURE__ */ b(f.Root, {
|
|
405
|
+
openDelay: 100,
|
|
406
|
+
closeDelay: 100,
|
|
407
|
+
ids: h,
|
|
408
|
+
children: [m, g]
|
|
409
|
+
}), t[19] = m, t[20] = h, t[21] = g, t[22] = v) : v = t[22], v;
|
|
410
|
+
}, te = {
|
|
411
|
+
main: {
|
|
412
|
+
h: "2.5rem",
|
|
413
|
+
px: "xs"
|
|
414
|
+
},
|
|
415
|
+
narrow: {
|
|
416
|
+
h: "2rem",
|
|
417
|
+
px: "xs"
|
|
418
|
+
},
|
|
419
|
+
input: {
|
|
420
|
+
h: "3rem",
|
|
421
|
+
px: "0"
|
|
422
|
+
}
|
|
423
|
+
}, ne = x.forwardRef(function(e, t) {
|
|
424
|
+
let n = _(9), i, a, o;
|
|
425
|
+
n[0] === e ? (i = n[1], a = n[2], o = n[3]) : ({variant: o, children: i, ...a} = e, n[0] = e, n[1] = i, n[2] = a, n[3] = o);
|
|
426
|
+
let s = te[o === void 0 ? "main" : o], c;
|
|
427
|
+
return n[4] !== i || n[5] !== t || n[6] !== a || n[7] !== s ? (c = /* @__PURE__ */ y(r, {
|
|
428
|
+
ref: t,
|
|
429
|
+
as: "header",
|
|
430
|
+
alignItems: "center",
|
|
431
|
+
borderWidth: "0",
|
|
432
|
+
...s,
|
|
433
|
+
...a,
|
|
434
|
+
children: i
|
|
435
|
+
}), n[4] = i, n[5] = t, n[6] = a, n[7] = s, n[8] = c) : c = n[8], c;
|
|
436
|
+
}), re = (e) => {
|
|
437
|
+
let t = _(11), { inputRef: n, value: r, placeholder: i, onValueChange: a, onKeyDown: c } = e, l;
|
|
438
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ y(j, { size: 14 }), t[0] = l) : l = t[0];
|
|
439
|
+
let u;
|
|
440
|
+
t[1] === a ? u = t[2] : (u = (e) => a(e.target.value), t[1] = a, t[2] = u);
|
|
441
|
+
let d;
|
|
442
|
+
t[3] === c ? d = t[4] : (d = (e) => {
|
|
443
|
+
c?.(e), (!c || e.key !== "Escape") && e.stopPropagation();
|
|
444
|
+
}, t[3] = c, t[4] = d);
|
|
445
|
+
let f;
|
|
446
|
+
return t[5] !== n || t[6] !== i || t[7] !== u || t[8] !== d || t[9] !== r ? (f = /* @__PURE__ */ y(ne, {
|
|
447
|
+
variant: "input",
|
|
448
|
+
borderBottomWidth: "1px",
|
|
449
|
+
borderColor: "border.subtle",
|
|
450
|
+
flexShrink: 0,
|
|
451
|
+
children: /* @__PURE__ */ y(s, {
|
|
452
|
+
startElement: l,
|
|
453
|
+
width: "full",
|
|
454
|
+
children: /* @__PURE__ */ y(o, {
|
|
455
|
+
ref: n,
|
|
456
|
+
mx: "xs",
|
|
457
|
+
variant: "borderless",
|
|
458
|
+
value: r,
|
|
459
|
+
placeholder: i,
|
|
460
|
+
"aria-label": i,
|
|
461
|
+
autoComplete: "off",
|
|
462
|
+
onChange: u,
|
|
463
|
+
onKeyDown: d
|
|
464
|
+
})
|
|
465
|
+
})
|
|
466
|
+
}), t[5] = n, t[6] = i, t[7] = u, t[8] = d, t[9] = r, t[10] = f) : f = t[10], f;
|
|
467
|
+
}, ie = (e) => {
|
|
468
|
+
let t = _(39), { item: a, multiple: o } = e, s = a.variant === "compact" ? "3" : "3.5", l;
|
|
469
|
+
t[0] !== a.isSelected || t[1] !== a.secondaryLabel || t[2] !== o ? (l = o ? /* @__PURE__ */ b(r, {
|
|
470
|
+
gap: "xs",
|
|
471
|
+
children: [a.secondaryLabel, a.isSelected ? /* @__PURE__ */ y(i, {
|
|
472
|
+
as: O,
|
|
473
|
+
boxSize: "3.5"
|
|
474
|
+
}) : null]
|
|
475
|
+
}) : void 0, t[0] = a.isSelected, t[1] = a.secondaryLabel, t[2] = o, t[3] = l) : l = t[3];
|
|
476
|
+
let u = l;
|
|
477
|
+
if (!o && a.isSelected) {
|
|
478
|
+
let e;
|
|
479
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ y(i, {
|
|
480
|
+
as: O,
|
|
481
|
+
boxSize: "3.5"
|
|
482
|
+
}), t[4] = e) : e = t[4], u = e;
|
|
483
|
+
}
|
|
484
|
+
let f, p, m;
|
|
485
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (f = { bg: "transparent" }, p = { bg: "transparent" }, m = { bg: "transparent" }, t[5] = f, t[6] = p, t[7] = m) : (f = t[5], p = t[6], m = t[7]);
|
|
486
|
+
let h = a.variant ?? "full-width", g = o ? void 0 : a.secondaryLabel, v;
|
|
487
|
+
t[8] !== s || t[9] !== a.icon || t[10] !== a.iconColor || t[11] !== a.label || t[12] !== o ? (v = o ? /* @__PURE__ */ b(r, {
|
|
488
|
+
minW: "0",
|
|
489
|
+
gap: "xs",
|
|
490
|
+
children: [a.icon ? /* @__PURE__ */ y(i, {
|
|
491
|
+
as: a.icon,
|
|
492
|
+
boxSize: s,
|
|
493
|
+
color: a.iconColor ?? "fg.muted"
|
|
494
|
+
}) : null, /* @__PURE__ */ y(d, {
|
|
495
|
+
textStyle: "label/S/regular",
|
|
496
|
+
truncate: !0,
|
|
497
|
+
children: a.label
|
|
498
|
+
})]
|
|
499
|
+
}) : a.label, t[8] = s, t[9] = a.icon, t[10] = a.iconColor, t[11] = a.label, t[12] = o, t[13] = v) : v = t[13];
|
|
500
|
+
let x;
|
|
501
|
+
t[14] !== s || t[15] !== a.icon || t[16] !== a.iconColor || t[17] !== o ? (x = !o && a.icon ? /* @__PURE__ */ y(i, {
|
|
502
|
+
as: a.icon,
|
|
503
|
+
boxSize: s,
|
|
504
|
+
color: a.iconColor ?? "fg.muted"
|
|
505
|
+
}) : void 0, t[14] = s, t[15] = a.icon, t[16] = a.iconColor, t[17] = o, t[18] = x) : x = t[18];
|
|
506
|
+
let S;
|
|
507
|
+
t[19] !== u || t[20] !== a.id || t[21] !== a.isDisabled || t[22] !== a.tooltipLabel || t[23] !== h || t[24] !== g || t[25] !== v || t[26] !== x ? (S = /* @__PURE__ */ y(n, {
|
|
508
|
+
bg: "transparent",
|
|
509
|
+
h: "auto",
|
|
510
|
+
p: "0",
|
|
511
|
+
_hover: f,
|
|
512
|
+
_focus: p,
|
|
513
|
+
_active: m,
|
|
514
|
+
children: /* @__PURE__ */ y(Y, {
|
|
515
|
+
asChild: !0,
|
|
516
|
+
id: a.id,
|
|
517
|
+
role: "presentation",
|
|
518
|
+
variant: h,
|
|
519
|
+
disabled: a.isDisabled,
|
|
520
|
+
tooltip: a.tooltipLabel,
|
|
521
|
+
description: g,
|
|
522
|
+
label: v,
|
|
523
|
+
icon: x,
|
|
524
|
+
endContent: u
|
|
525
|
+
})
|
|
526
|
+
}), t[19] = u, t[20] = a.id, t[21] = a.isDisabled, t[22] = a.tooltipLabel, t[23] = h, t[24] = g, t[25] = v, t[26] = x, t[27] = S) : S = t[27];
|
|
527
|
+
let C = S;
|
|
528
|
+
if (o) {
|
|
529
|
+
let e = a.id, n = !!a.isSelected, r;
|
|
530
|
+
return t[28] !== C || t[29] !== a.id || t[30] !== a.isDisabled || t[31] !== a.onSelect || t[32] !== n ? (r = /* @__PURE__ */ y(c.CheckboxItem, {
|
|
531
|
+
value: e,
|
|
532
|
+
checked: n,
|
|
533
|
+
disabled: a.isDisabled,
|
|
534
|
+
onCheckedChange: a.onSelect,
|
|
535
|
+
asChild: !0,
|
|
536
|
+
children: C
|
|
537
|
+
}), t[28] = C, t[29] = a.id, t[30] = a.isDisabled, t[31] = a.onSelect, t[32] = n, t[33] = r) : r = t[33], r;
|
|
538
|
+
}
|
|
539
|
+
let w;
|
|
540
|
+
return t[34] !== C || t[35] !== a.id || t[36] !== a.isDisabled || t[37] !== a.onSelect ? (w = /* @__PURE__ */ y(c.Item, {
|
|
541
|
+
value: a.id,
|
|
542
|
+
disabled: a.isDisabled,
|
|
543
|
+
onSelect: a.onSelect,
|
|
544
|
+
asChild: !0,
|
|
545
|
+
children: C
|
|
546
|
+
}), t[34] = C, t[35] = a.id, t[36] = a.isDisabled, t[37] = a.onSelect, t[38] = w) : w = t[38], w;
|
|
547
|
+
}, ae = (e, t) => {
|
|
548
|
+
let n = t.trim().toLowerCase();
|
|
549
|
+
return n ? e.filter((e) => [e.label, e.searchText].filter(Boolean).join(" ").toLowerCase().includes(n)) : e;
|
|
550
|
+
}, oe = (e, t) => !e || !t ? !1 : e !== t, se = (e, t, n) => !e || !t ? n : {
|
|
551
|
+
items: t.items,
|
|
552
|
+
filterItems: t.filterItems ?? n.filterItems,
|
|
553
|
+
showSearch: t.showSearch ?? n.showSearch,
|
|
554
|
+
searchPlaceholder: t.searchPlaceholder ?? n.searchPlaceholder,
|
|
555
|
+
emptyState: t.emptyState ?? n.emptyState,
|
|
556
|
+
contentTestId: t.contentTestId ?? n.contentTestId,
|
|
557
|
+
closeOnSelect: !1,
|
|
558
|
+
listId: "parent"
|
|
559
|
+
}, ce = (e) => {
|
|
560
|
+
let n = _(46), { trigger: r, items: a, searchPlaceholder: o, emptyState: s, filterItems: u, listId: d, header: f, width: p, maxListHeight: m, showSearch: h, closeOnSelect: g, lazyMount: v, open: x, positioning: S, onOpenChange: C, onFocusOutside: T, contentTestId: O, portalled: A, parentList: j, multiple: M } = e, N = u === void 0 ? ae : u, P = p === void 0 ? "260px" : p, F = m === void 0 ? "18rem" : m, I = h === void 0 || h, L = g === void 0 || g, R = v !== void 0 && v, z = A === void 0 || A, B = M !== void 0 && M, V = !!j, [H, ee] = D(!1), [te, ce] = D(""), [de, U] = D("child"), fe = E(null), pe = x ?? H, me = V && de === "parent", W = se(me, j, {
|
|
561
|
+
items: a,
|
|
562
|
+
filterItems: N,
|
|
563
|
+
showSearch: I,
|
|
564
|
+
searchPlaceholder: o,
|
|
565
|
+
emptyState: s,
|
|
566
|
+
contentTestId: O,
|
|
567
|
+
closeOnSelect: L,
|
|
568
|
+
listId: V ? "child" : d ?? ""
|
|
569
|
+
}), he = W.filterItems(W.items, te), G = E(W.listId);
|
|
570
|
+
w(() => {
|
|
571
|
+
if (!pe) {
|
|
572
|
+
G.current = W.listId;
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
oe(G.current, W.listId) && ce(""), G.current = W.listId;
|
|
576
|
+
}, [pe, W.listId]);
|
|
577
|
+
let ge;
|
|
578
|
+
n[0] !== W.showSearch || n[1] !== pe ? (ge = [pe, W.showSearch], n[0] = W.showSearch, n[1] = pe, n[2] = ge) : ge = n[2], w(() => {
|
|
579
|
+
if (!pe || !W.showSearch) return;
|
|
580
|
+
let e = setTimeout(() => fe.current?.focus(), 0);
|
|
581
|
+
return () => clearTimeout(e);
|
|
582
|
+
}, ge);
|
|
583
|
+
let _e;
|
|
584
|
+
n[3] !== V || n[4] !== C || n[5] !== x ? (_e = (e) => {
|
|
585
|
+
x === void 0 && ee(e.open), ce(""), e.open && V && U("child"), C?.(e);
|
|
586
|
+
}, n[3] = V, n[4] = C, n[5] = x, n[6] = _e) : _e = n[6];
|
|
587
|
+
let K = _e, ve;
|
|
588
|
+
n[7] !== me || n[8] !== j ? (ve = (e) => {
|
|
589
|
+
if (!me || !j) return;
|
|
590
|
+
let t = j.items.find((t) => t.id === e.value);
|
|
591
|
+
t && (j.onSelect?.(t), U("child"));
|
|
592
|
+
}, n[7] = me, n[8] = j, n[9] = ve) : ve = n[9];
|
|
593
|
+
let q = ve, ye;
|
|
594
|
+
n[10] === j ? ye = n[11] : (ye = j ? /* @__PURE__ */ y(ne, {
|
|
595
|
+
as: "div",
|
|
596
|
+
role: "menuitem",
|
|
597
|
+
"aria-label": j.ariaLabel,
|
|
598
|
+
"aria-disabled": j.disabled || void 0,
|
|
599
|
+
tabIndex: j.disabled ? -1 : 0,
|
|
600
|
+
variant: "narrow",
|
|
601
|
+
px: "0",
|
|
602
|
+
borderBottomWidth: "1px",
|
|
603
|
+
borderColor: "border.subtle",
|
|
604
|
+
flexShrink: 0,
|
|
605
|
+
onPointerDownCapture: le,
|
|
606
|
+
onClickCapture: (e) => {
|
|
607
|
+
e.stopPropagation(), !j.disabled && U(ue);
|
|
608
|
+
},
|
|
609
|
+
children: /* @__PURE__ */ y(Y, {
|
|
610
|
+
asChild: !0,
|
|
611
|
+
role: "presentation",
|
|
612
|
+
variant: "full-width",
|
|
613
|
+
id: "__parent-toggle",
|
|
614
|
+
label: j.selectedLabel,
|
|
615
|
+
icon: j.selectedIcon ? /* @__PURE__ */ y(i, {
|
|
616
|
+
as: j.selectedIcon,
|
|
617
|
+
boxSize: "14px"
|
|
618
|
+
}) : void 0,
|
|
619
|
+
disabled: j.disabled,
|
|
620
|
+
endContent: j.disabled ? void 0 : /* @__PURE__ */ y(i, {
|
|
621
|
+
as: k,
|
|
622
|
+
boxSize: "14px"
|
|
623
|
+
})
|
|
624
|
+
})
|
|
625
|
+
}) : null, n[10] = j, n[11] = ye);
|
|
626
|
+
let be = j ? ye : f, xe = !!be && !W.showSearch, Se = W.showSearch ? /* @__PURE__ */ y(re, {
|
|
627
|
+
inputRef: fe,
|
|
628
|
+
value: te,
|
|
629
|
+
placeholder: W.searchPlaceholder,
|
|
630
|
+
onValueChange: ce
|
|
631
|
+
}) : null, J = c, Ce = c, we;
|
|
632
|
+
n[12] === xe ? we = n[13] : (we = xe ? /* @__PURE__ */ y(c.Separator, { margin: "0" }) : null, n[12] = xe, n[13] = we);
|
|
633
|
+
let Te = t, Ee;
|
|
634
|
+
n[14] === Symbol.for("react.memo_cache_sentinel") ? (Ee = { overscrollBehavior: "contain" }, n[14] = Ee) : Ee = n[14];
|
|
635
|
+
let X = he.length > 0 ? he.map((e) => /* @__PURE__ */ y(ie, {
|
|
636
|
+
item: e,
|
|
637
|
+
multiple: B && !me
|
|
638
|
+
}, e.id)) : W.emptyState, De;
|
|
639
|
+
n[15] !== Te || n[16] !== W.contentTestId || n[17] !== F || n[18] !== Ee || n[19] !== X ? (De = /* @__PURE__ */ y(Te, {
|
|
640
|
+
maxH: F,
|
|
641
|
+
"data-testid": W.contentTestId,
|
|
642
|
+
viewportProps: Ee,
|
|
643
|
+
p: "0",
|
|
644
|
+
gap: "0",
|
|
645
|
+
children: X
|
|
646
|
+
}), n[15] = Te, n[16] = W.contentTestId, n[17] = F, n[18] = Ee, n[19] = X, n[20] = De) : De = n[20];
|
|
647
|
+
let Z;
|
|
648
|
+
n[21] !== be || n[22] !== Se || n[23] !== Ce.Content || n[24] !== we || n[25] !== De || n[26] !== P ? (Z = /* @__PURE__ */ b(Ce.Content, {
|
|
649
|
+
w: P,
|
|
650
|
+
bg: "bg",
|
|
651
|
+
gap: "0",
|
|
652
|
+
p: "0",
|
|
653
|
+
children: [
|
|
654
|
+
be,
|
|
655
|
+
Se,
|
|
656
|
+
we,
|
|
657
|
+
De
|
|
658
|
+
]
|
|
659
|
+
}), n[21] = be, n[22] = Se, n[23] = Ce.Content, n[24] = we, n[25] = De, n[26] = P, n[27] = Z) : Z = n[27];
|
|
660
|
+
let Oe;
|
|
661
|
+
n[28] !== J.Positioner || n[29] !== Z ? (Oe = /* @__PURE__ */ y(J.Positioner, { children: Z }), n[28] = J.Positioner, n[29] = Z, n[30] = Oe) : Oe = n[30];
|
|
662
|
+
let ke = Oe, Ae = V ? q : void 0, je;
|
|
663
|
+
n[31] === r ? je = n[32] : (je = /* @__PURE__ */ y(c.Trigger, {
|
|
664
|
+
asChild: !0,
|
|
665
|
+
children: r
|
|
666
|
+
}), n[31] = r, n[32] = je);
|
|
667
|
+
let Me = !z, Ne;
|
|
668
|
+
n[33] !== ke || n[34] !== Me ? (Ne = /* @__PURE__ */ y(l, {
|
|
669
|
+
disabled: Me,
|
|
670
|
+
children: ke
|
|
671
|
+
}), n[33] = ke, n[34] = Me, n[35] = Ne) : Ne = n[35];
|
|
672
|
+
let Pe;
|
|
673
|
+
return n[36] !== W.closeOnSelect || n[37] !== K || n[38] !== R || n[39] !== T || n[40] !== x || n[41] !== S || n[42] !== Ae || n[43] !== je || n[44] !== Ne ? (Pe = /* @__PURE__ */ b(c.Root, {
|
|
674
|
+
lazyMount: R,
|
|
675
|
+
closeOnSelect: W.closeOnSelect,
|
|
676
|
+
open: x,
|
|
677
|
+
positioning: S,
|
|
678
|
+
onOpenChange: K,
|
|
679
|
+
onFocusOutside: T,
|
|
680
|
+
onSelect: Ae,
|
|
681
|
+
children: [je, Ne]
|
|
682
|
+
}), n[36] = W.closeOnSelect, n[37] = K, n[38] = R, n[39] = T, n[40] = x, n[41] = S, n[42] = Ae, n[43] = je, n[44] = Ne, n[45] = Pe) : Pe = n[45], Pe;
|
|
683
|
+
};
|
|
684
|
+
function le(e) {
|
|
685
|
+
return e.stopPropagation();
|
|
686
|
+
}
|
|
687
|
+
function ue(e) {
|
|
688
|
+
return e === "child" ? "parent" : "child";
|
|
689
|
+
}
|
|
690
|
+
//#endregion
|
|
691
|
+
//#region src/components/list-row/searchable-action-menu.tsx
|
|
692
|
+
var de = (e) => {
|
|
693
|
+
let t = _(14), { action: n } = e, r;
|
|
694
|
+
t[0] === n.menuItems ? r = t[1] : (r = n.menuItems ?? [], t[0] = n.menuItems, t[1] = r);
|
|
695
|
+
let i;
|
|
696
|
+
t[2] === r ? i = t[3] : (i = r.map(U), t[2] = r, t[3] = i);
|
|
697
|
+
let o = i, s;
|
|
698
|
+
t[4] !== n.icon || t[5] !== n.label ? (s = /* @__PURE__ */ y(a, {
|
|
699
|
+
variant: "ghost",
|
|
700
|
+
size: "2xs",
|
|
701
|
+
"aria-label": n.label,
|
|
702
|
+
children: n.icon
|
|
703
|
+
}), t[4] = n.icon, t[5] = n.label, t[6] = s) : s = t[6];
|
|
704
|
+
let l = n.searchPlaceholder ?? "Search...", u = n.emptyMenuLabel ?? "No results found", d;
|
|
705
|
+
t[7] === u ? d = t[8] : (d = /* @__PURE__ */ y(c.Item, {
|
|
706
|
+
value: "empty",
|
|
707
|
+
asChild: !0,
|
|
708
|
+
children: /* @__PURE__ */ y(Y, {
|
|
709
|
+
asChild: !0,
|
|
710
|
+
variant: "full-width",
|
|
711
|
+
label: u,
|
|
712
|
+
disabled: !0
|
|
713
|
+
})
|
|
714
|
+
}), t[7] = u, t[8] = d);
|
|
715
|
+
let f;
|
|
716
|
+
return t[9] !== o || t[10] !== s || t[11] !== l || t[12] !== d ? (f = /* @__PURE__ */ y(ce, {
|
|
717
|
+
trigger: s,
|
|
718
|
+
items: o,
|
|
719
|
+
searchPlaceholder: l,
|
|
720
|
+
emptyState: d,
|
|
721
|
+
onFocusOutside: fe
|
|
722
|
+
}), t[9] = o, t[10] = s, t[11] = l, t[12] = d, t[13] = f) : f = t[13], f;
|
|
723
|
+
};
|
|
724
|
+
function U(e) {
|
|
725
|
+
return {
|
|
726
|
+
id: e.id,
|
|
727
|
+
label: e.label,
|
|
728
|
+
searchText: [e.label, e.description].filter(Boolean).join(" "),
|
|
729
|
+
tooltipLabel: e.description,
|
|
730
|
+
variant: "full-width",
|
|
731
|
+
onSelect: () => e.onAction?.()
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
function fe(e) {
|
|
735
|
+
return e.preventDefault();
|
|
736
|
+
}
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region src/components/list-row/list-row-actions.tsx
|
|
739
|
+
var pe = (t, n) => t.tooltip ? /* @__PURE__ */ y(e, {
|
|
740
|
+
content: t.tooltip,
|
|
741
|
+
openDelay: 300,
|
|
742
|
+
children: n
|
|
743
|
+
}, t.id) : /* @__PURE__ */ y(S, { children: n }, t.id), me = (e) => {
|
|
744
|
+
let t = _(12), { actions: n, alwaysVisible: i, context: o } = e, s = i !== void 0 && i, u;
|
|
745
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = { key: "listRowAccessory" }, t[0] = u) : u = t[0];
|
|
746
|
+
let d = g(u);
|
|
747
|
+
if (n.length === 0) return null;
|
|
748
|
+
let f = s ? "always" : "hover", p;
|
|
749
|
+
t[1] !== d || t[2] !== f ? (p = d({ visibility: f }), t[1] = d, t[2] = f, t[3] = p) : p = t[3];
|
|
750
|
+
let m;
|
|
751
|
+
if (t[4] !== n || t[5] !== o) {
|
|
752
|
+
let e;
|
|
753
|
+
t[7] === o ? e = t[8] : (e = (e) => e.menuItems && e.menuItems.length >= 8 ? /* @__PURE__ */ y(de, { action: e }, e.id) : e.menuItems && e.menuItems.length > 0 ? pe(e, /* @__PURE__ */ b(c.Root, { children: [/* @__PURE__ */ y(c.Trigger, {
|
|
754
|
+
asChild: !0,
|
|
755
|
+
children: /* @__PURE__ */ y(a, {
|
|
756
|
+
variant: "ghost",
|
|
757
|
+
size: "2xs",
|
|
758
|
+
"aria-label": e.label,
|
|
759
|
+
children: e.icon
|
|
760
|
+
})
|
|
761
|
+
}), /* @__PURE__ */ y(l, { children: /* @__PURE__ */ y(c.Positioner, { children: /* @__PURE__ */ y(c.Content, {
|
|
762
|
+
minW: "160px",
|
|
763
|
+
bg: "bg",
|
|
764
|
+
children: e.menuItems.map(he)
|
|
765
|
+
}) }) })] })) : pe(e, /* @__PURE__ */ y(a, {
|
|
766
|
+
variant: "ghost",
|
|
767
|
+
size: "2xs",
|
|
768
|
+
"aria-label": e.label,
|
|
769
|
+
onClick: (t) => {
|
|
770
|
+
t.stopPropagation(), e.onAction?.(o);
|
|
771
|
+
},
|
|
772
|
+
children: e.icon
|
|
773
|
+
})), t[7] = o, t[8] = e), m = n.map(e), t[4] = n, t[5] = o, t[6] = m;
|
|
774
|
+
} else m = t[6];
|
|
775
|
+
let h;
|
|
776
|
+
return t[9] !== p || t[10] !== m ? (h = /* @__PURE__ */ y(r, {
|
|
777
|
+
gap: "0",
|
|
778
|
+
css: p,
|
|
779
|
+
onClick: W,
|
|
780
|
+
children: m
|
|
781
|
+
}), t[9] = p, t[10] = m, t[11] = h) : h = t[11], h;
|
|
782
|
+
};
|
|
783
|
+
function W(e) {
|
|
784
|
+
return e.stopPropagation();
|
|
785
|
+
}
|
|
786
|
+
function he(t) {
|
|
787
|
+
return /* @__PURE__ */ b(S, { children: [t.separatorBefore ? /* @__PURE__ */ y(c.Separator, {}) : null, /* @__PURE__ */ y(e, {
|
|
788
|
+
content: t.description,
|
|
789
|
+
disabled: !t.description,
|
|
790
|
+
openDelay: 300,
|
|
791
|
+
children: /* @__PURE__ */ y(c.Item, {
|
|
792
|
+
value: t.id,
|
|
793
|
+
disabled: t.disabled || t.readOnly,
|
|
794
|
+
onClick: () => {
|
|
795
|
+
t.readOnly || t.onAction?.();
|
|
796
|
+
},
|
|
797
|
+
children: /* @__PURE__ */ b(r, {
|
|
798
|
+
gap: "2",
|
|
799
|
+
minW: "0",
|
|
800
|
+
w: "full",
|
|
801
|
+
justify: "space-between",
|
|
802
|
+
children: [/* @__PURE__ */ b(r, {
|
|
803
|
+
gap: "2",
|
|
804
|
+
minW: "0",
|
|
805
|
+
children: [t.icon ? /* @__PURE__ */ y(n, { children: t.icon }) : null, /* @__PURE__ */ y(n, {
|
|
806
|
+
minW: "0",
|
|
807
|
+
children: t.label
|
|
808
|
+
})]
|
|
809
|
+
}), t.endContent ? /* @__PURE__ */ y(n, {
|
|
810
|
+
flexShrink: 0,
|
|
811
|
+
children: t.endContent
|
|
812
|
+
}) : null]
|
|
813
|
+
})
|
|
814
|
+
})
|
|
815
|
+
})] }, t.id);
|
|
816
|
+
}
|
|
817
|
+
//#endregion
|
|
818
|
+
//#region src/components/list-row/list-row-content.tsx
|
|
819
|
+
var G = (e, t = !1) => {
|
|
820
|
+
let n = e.contextMenuItems ?? [];
|
|
821
|
+
if (n.length === 0 || !t) return e.actions ?? [];
|
|
822
|
+
let r = e.actions?.flatMap((t) => t.menuItems?.length ? t.menuItems : [{
|
|
823
|
+
id: t.id,
|
|
824
|
+
label: t.label,
|
|
825
|
+
icon: t.icon,
|
|
826
|
+
onAction: () => t.onAction?.({ nodeId: e.id })
|
|
827
|
+
}]) ?? [], a = new Set(r.map((e) => e.id)), o = n.filter((e) => !a.has(e.id)).map((e, t) => ({
|
|
828
|
+
...e,
|
|
829
|
+
separatorBefore: e.separatorBefore || t === 0 && r.length > 0
|
|
830
|
+
}));
|
|
831
|
+
return [{
|
|
832
|
+
id: "resource-actions",
|
|
833
|
+
label: "Resource actions",
|
|
834
|
+
icon: /* @__PURE__ */ y(i, {
|
|
835
|
+
as: k,
|
|
836
|
+
boxSize: "14px"
|
|
837
|
+
}),
|
|
838
|
+
menuItems: [...r, ...o]
|
|
839
|
+
}];
|
|
840
|
+
}, ge = {
|
|
841
|
+
collection: "compact",
|
|
842
|
+
tree: "1"
|
|
843
|
+
}, _e = (e) => e.isEmptyStateVariant ? "fg.menu-item.secondary" : e.isDisabled ? "fg.muted" : e.tone === "danger" ? "red.500" : "fg", K = (e) => {
|
|
844
|
+
let t = _(7), { label: r, textStyle: i, color: a } = e;
|
|
845
|
+
if (typeof r == "string") {
|
|
846
|
+
let e;
|
|
847
|
+
return t[0] !== a || t[1] !== r || t[2] !== i ? (e = /* @__PURE__ */ y(d, {
|
|
848
|
+
textStyle: i,
|
|
849
|
+
color: a,
|
|
850
|
+
truncate: !0,
|
|
851
|
+
children: r
|
|
852
|
+
}), t[0] = a, t[1] = r, t[2] = i, t[3] = e) : e = t[3], e;
|
|
853
|
+
}
|
|
854
|
+
let o;
|
|
855
|
+
return t[4] !== a || t[5] !== r ? (o = /* @__PURE__ */ y(n, {
|
|
856
|
+
minW: "0",
|
|
857
|
+
maxW: "full",
|
|
858
|
+
overflow: "hidden",
|
|
859
|
+
color: a,
|
|
860
|
+
children: r
|
|
861
|
+
}), t[4] = a, t[5] = r, t[6] = o) : o = t[6], o;
|
|
862
|
+
}, ve = (e) => {
|
|
863
|
+
let t = _(8), { description: r, textStyle: i, color: a, marginLeft: o } = e;
|
|
864
|
+
if (!r) return null;
|
|
865
|
+
if (typeof r == "string") {
|
|
866
|
+
let e;
|
|
867
|
+
return t[0] !== a || t[1] !== r || t[2] !== o || t[3] !== i ? (e = /* @__PURE__ */ y(d, {
|
|
868
|
+
ml: o,
|
|
869
|
+
textStyle: i,
|
|
870
|
+
color: a,
|
|
871
|
+
truncate: !0,
|
|
872
|
+
children: r
|
|
873
|
+
}), t[0] = a, t[1] = r, t[2] = o, t[3] = i, t[4] = e) : e = t[4], e;
|
|
874
|
+
}
|
|
875
|
+
let s;
|
|
876
|
+
return t[5] !== r || t[6] !== o ? (s = /* @__PURE__ */ y(n, {
|
|
877
|
+
ml: o,
|
|
878
|
+
minW: "0",
|
|
879
|
+
maxW: "full",
|
|
880
|
+
overflow: "hidden",
|
|
881
|
+
children: r
|
|
882
|
+
}), t[5] = r, t[6] = o, t[7] = s) : s = t[7], s;
|
|
883
|
+
}, q = (t) => {
|
|
884
|
+
let a = _(36), { item: o, isExpanded: s, showChevron: c, isDisabled: l, variant: d, tone: f, labelId: p } = t, m;
|
|
885
|
+
a[0] === Symbol.for("react.memo_cache_sentinel") ? (m = { key: "treeChevron" }, a[0] = m) : m = a[0];
|
|
886
|
+
let h = g(m), v = d === "empty-state", x = d === "compact" || d === "collection" || d === "full-width" || d === "tree" || v, S = x ? "label/S/regular" : "label/M/regular", C = x ? "label/XS" : "label/S/regular", w = x ? "0" : "2px", T = d === "tree" || d === "collection" ? "16px" : "14px", E = ge[d ?? ""] ?? "2", D;
|
|
887
|
+
a[1] !== l || a[2] !== v || a[3] !== f ? (D = _e({
|
|
888
|
+
isEmptyStateVariant: v,
|
|
889
|
+
isDisabled: l,
|
|
890
|
+
tone: f
|
|
891
|
+
}), a[1] = l, a[2] = v, a[3] = f, a[4] = D) : D = a[4];
|
|
892
|
+
let O = D, k = o.iconColor ?? (f === "danger" ? "red.500" : "fg.muted"), j = f === "danger" ? "red.400" : "fg.menu-item.secondary", M;
|
|
893
|
+
a[5] !== h || a[6] !== s || a[7] !== c ? (M = c ? /* @__PURE__ */ y(n, {
|
|
894
|
+
color: "fg.muted",
|
|
895
|
+
flexShrink: 0,
|
|
896
|
+
display: "flex",
|
|
897
|
+
alignItems: "center",
|
|
898
|
+
children: /* @__PURE__ */ y(i, {
|
|
899
|
+
as: A,
|
|
900
|
+
boxSize: "12px",
|
|
901
|
+
css: h(),
|
|
902
|
+
"data-open": s
|
|
903
|
+
})
|
|
904
|
+
}) : null, a[5] = h, a[6] = s, a[7] = c, a[8] = M) : M = a[8];
|
|
905
|
+
let N;
|
|
906
|
+
a[9] !== k || a[10] !== T || a[11] !== o.icon ? (N = o.icon ? /* @__PURE__ */ y(n, {
|
|
907
|
+
color: k,
|
|
908
|
+
flexShrink: 0,
|
|
909
|
+
display: "inline-flex",
|
|
910
|
+
alignItems: "center",
|
|
911
|
+
justifyContent: "center",
|
|
912
|
+
boxSize: T,
|
|
913
|
+
fontSize: T,
|
|
914
|
+
lineHeight: "1",
|
|
915
|
+
css: { "& > svg": {
|
|
916
|
+
width: T,
|
|
917
|
+
height: T
|
|
918
|
+
} },
|
|
919
|
+
children: o.icon
|
|
920
|
+
}) : null, a[9] = k, a[10] = T, a[11] = o.icon, a[12] = N) : N = a[12];
|
|
921
|
+
let P;
|
|
922
|
+
a[13] === o.indicator ? P = a[14] : (P = o.indicator ? /* @__PURE__ */ y(e, {
|
|
923
|
+
content: o.indicator.tooltip,
|
|
924
|
+
disabled: !o.indicator.tooltip,
|
|
925
|
+
openDelay: 300,
|
|
926
|
+
children: /* @__PURE__ */ y(n, {
|
|
927
|
+
color: o.indicator.color ?? "fg.muted",
|
|
928
|
+
flexShrink: 0,
|
|
929
|
+
children: o.indicator.icon
|
|
930
|
+
})
|
|
931
|
+
}) : null, a[13] = o.indicator, a[14] = P);
|
|
932
|
+
let F;
|
|
933
|
+
a[15] !== o.label || a[16] !== O || a[17] !== S ? (F = /* @__PURE__ */ y(K, {
|
|
934
|
+
label: o.label,
|
|
935
|
+
textStyle: S,
|
|
936
|
+
color: O
|
|
937
|
+
}), a[15] = o.label, a[16] = O, a[17] = S, a[18] = F) : F = a[18];
|
|
938
|
+
let I;
|
|
939
|
+
a[19] !== E || a[20] !== N || a[21] !== P || a[22] !== F ? (I = /* @__PURE__ */ b(r, {
|
|
940
|
+
gap: E,
|
|
941
|
+
minW: "0",
|
|
942
|
+
alignItems: "center",
|
|
943
|
+
children: [
|
|
944
|
+
N,
|
|
945
|
+
P,
|
|
946
|
+
F
|
|
947
|
+
]
|
|
948
|
+
}), a[19] = E, a[20] = N, a[21] = P, a[22] = F, a[23] = I) : I = a[23];
|
|
949
|
+
let L;
|
|
950
|
+
a[24] !== j || a[25] !== w || a[26] !== C || a[27] !== o.description ? (L = /* @__PURE__ */ y(ve, {
|
|
951
|
+
description: o.description,
|
|
952
|
+
textStyle: C,
|
|
953
|
+
color: j,
|
|
954
|
+
marginLeft: w
|
|
955
|
+
}), a[24] = j, a[25] = w, a[26] = C, a[27] = o.description, a[28] = L) : L = a[28];
|
|
956
|
+
let R;
|
|
957
|
+
a[29] !== I || a[30] !== L ? (R = /* @__PURE__ */ b(u, {
|
|
958
|
+
gap: "0",
|
|
959
|
+
minW: "0",
|
|
960
|
+
flex: "1",
|
|
961
|
+
children: [I, L]
|
|
962
|
+
}), a[29] = I, a[30] = L, a[31] = R) : R = a[31];
|
|
963
|
+
let z;
|
|
964
|
+
return a[32] !== p || a[33] !== M || a[34] !== R ? (z = /* @__PURE__ */ b(r, {
|
|
965
|
+
id: p,
|
|
966
|
+
gap: "2",
|
|
967
|
+
minW: "0",
|
|
968
|
+
flex: "1",
|
|
969
|
+
overflow: "hidden",
|
|
970
|
+
alignItems: "center",
|
|
971
|
+
children: [M, R]
|
|
972
|
+
}), a[32] = p, a[33] = M, a[34] = R, a[35] = z) : z = a[35], z;
|
|
973
|
+
}, ye = (e) => {
|
|
974
|
+
let t = _(23), { labelId: r, item: i, isDisabled: a, isExpanded: o, showChevron: s, tone: c, variant: l, showContextMenuTrigger: u } = e, d = c === void 0 ? "default" : c, f = l === void 0 ? "default" : l, p;
|
|
975
|
+
t[0] !== i || t[1] !== u ? (p = G(i, u), t[0] = i, t[1] = u, t[2] = p) : p = t[2];
|
|
976
|
+
let m = p, h;
|
|
977
|
+
t[3] !== a || t[4] !== o || t[5] !== i || t[6] !== r || t[7] !== s || t[8] !== d || t[9] !== f ? (h = /* @__PURE__ */ y(q, {
|
|
978
|
+
labelId: r,
|
|
979
|
+
item: i,
|
|
980
|
+
isExpanded: o,
|
|
981
|
+
showChevron: s,
|
|
982
|
+
isDisabled: a,
|
|
983
|
+
tone: d,
|
|
984
|
+
variant: f
|
|
985
|
+
}), t[3] = a, t[4] = o, t[5] = i, t[6] = r, t[7] = s, t[8] = d, t[9] = f, t[10] = h) : h = t[10];
|
|
986
|
+
let g;
|
|
987
|
+
t[11] !== i.endContent || t[12] !== r ? (g = i.endContent ? /* @__PURE__ */ y(n, {
|
|
988
|
+
id: `${r}-end`,
|
|
989
|
+
color: "fg.muted",
|
|
990
|
+
flexShrink: 0,
|
|
991
|
+
display: "flex",
|
|
992
|
+
alignItems: "center",
|
|
993
|
+
children: i.endContent
|
|
994
|
+
}) : null, t[11] = i.endContent, t[12] = r, t[13] = g) : g = t[13];
|
|
995
|
+
let x;
|
|
996
|
+
t[14] !== m || t[15] !== i.contextMenuItems?.length || t[16] !== i.id || t[17] !== u ? (x = m.length > 0 ? /* @__PURE__ */ y(me, {
|
|
997
|
+
actions: m,
|
|
998
|
+
context: { nodeId: i.id },
|
|
999
|
+
alwaysVisible: u && (i.contextMenuItems?.length ?? 0) > 0
|
|
1000
|
+
}) : null, t[14] = m, t[15] = i.contextMenuItems?.length, t[16] = i.id, t[17] = u, t[18] = x) : x = t[18];
|
|
1001
|
+
let S;
|
|
1002
|
+
return t[19] !== h || t[20] !== g || t[21] !== x ? (S = /* @__PURE__ */ b(v, { children: [
|
|
1003
|
+
h,
|
|
1004
|
+
g,
|
|
1005
|
+
x
|
|
1006
|
+
] }), t[19] = h, t[20] = g, t[21] = x, t[22] = S) : S = t[22], S;
|
|
1007
|
+
}, be = (e) => {
|
|
1008
|
+
if (!(e <= 0)) return `calc(var(--chakra-spacing-1) + ${e} * 12px)`;
|
|
1009
|
+
}, xe = (e) => e === "compact" || e === "full-width" || e === "empty-state", Se = (e, t) => e === "collection" && !t ? {
|
|
1010
|
+
rowHeight: "collection-row",
|
|
1011
|
+
minHeight: void 0
|
|
1012
|
+
} : xe(e) && !t ? {
|
|
1013
|
+
rowHeight: "1.75rem",
|
|
1014
|
+
minHeight: void 0
|
|
1015
|
+
} : {
|
|
1016
|
+
rowHeight: "auto",
|
|
1017
|
+
minHeight: e === "default" ? "2.25rem" : "1.75rem"
|
|
1018
|
+
}, J = (e) => ({
|
|
1019
|
+
bg: e.isSelected ? e.selectedBg : "transparent",
|
|
1020
|
+
_hover: e.variant === "empty-state" ? { bg: "transparent" } : e.isSelected ? { bg: e.selectedBg } : e.tone === "danger" ? {
|
|
1021
|
+
outline: "1px solid",
|
|
1022
|
+
outlineColor: "red.500",
|
|
1023
|
+
outlineOffset: "-1px"
|
|
1024
|
+
} : { bg: e.hoverBg },
|
|
1025
|
+
_active: e.variant === "empty-state" ? { bg: "transparent" } : { bg: e.selectedBg }
|
|
1026
|
+
}), Ce = (e, t) => t ? `${e} ${e}-end` : e, we = (e) => {
|
|
1027
|
+
let t = e.isDisabled ? "not-allowed" : "pointer";
|
|
1028
|
+
return {
|
|
1029
|
+
"aria-labelledby": e.rootProps["aria-label"] ? void 0 : Ce(e.labelId, e.hasEndContent),
|
|
1030
|
+
...e.rootProps,
|
|
1031
|
+
role: e.rowRole,
|
|
1032
|
+
"aria-selected": e.rootProps["aria-selected"] ?? (e.rowRole === "option" ? e.isSelected : void 0),
|
|
1033
|
+
"aria-expanded": e.showChevron ? e.isExpanded : void 0,
|
|
1034
|
+
className: e.className ? `group ${e.className}` : "group",
|
|
1035
|
+
width: "full",
|
|
1036
|
+
minWidth: "0",
|
|
1037
|
+
maxWidth: "full",
|
|
1038
|
+
height: e.rowHeight,
|
|
1039
|
+
minHeight: e.minHeight,
|
|
1040
|
+
display: "flex",
|
|
1041
|
+
position: "relative",
|
|
1042
|
+
alignItems: "center",
|
|
1043
|
+
justifyContent: "space-between",
|
|
1044
|
+
gap: "xs",
|
|
1045
|
+
px: "sm",
|
|
1046
|
+
py: e.verticalPadding,
|
|
1047
|
+
pl: e.paddingLeft,
|
|
1048
|
+
borderRadius: e.variant === "full-width" || e.variant === "collection" ? "0" : "xs",
|
|
1049
|
+
...e.rowRole?.startsWith("menuitem") ? {} : J(e),
|
|
1050
|
+
cursor: e.variant === "empty-state" ? "default" : t,
|
|
1051
|
+
overflow: "hidden",
|
|
1052
|
+
textAlign: "left",
|
|
1053
|
+
color: "inherit",
|
|
1054
|
+
textDecoration: "none"
|
|
1055
|
+
};
|
|
1056
|
+
}, Y = C((e, t) => {
|
|
1057
|
+
let n = _(104), { id: r, label: i, description: a, icon: o, iconColor: s, indicator: c, endContent: l, tooltip: u, disabled: d, isContainer: f, isNavigable: m, href: h, navigationIntent: g, menuItems: v, menuPlacement: b, contextMenuItems: x, actions: S, children: C, onActivate: w, depth: E, isSelected: O, isExpanded: k, showExpandToggle: A, showContextMenuTrigger: j, variant: M, tone: N, selectedBg: P, hoverBg: F, asChild: I, className: L, role: R, onToggleExpand: z, onPointerMove: B, draggable: V, onDragStart: H, onDragOver: te, onDragEnd: ne, onDrop: re, onClick: ie, onKeyDown: ae, ...oe } = e, se = E === void 0 ? 0 : E, ce = O !== void 0 && O, le = k !== void 0 && k, ue = A !== void 0 && A, de = j !== void 0 && j, U = M === void 0 ? "default" : M, fe = N === void 0 ? "default" : N, pe = P === void 0 ? "bg.active" : P, me = F === void 0 ? "bg.hover" : F, W = I !== void 0 && I, [he, G] = D(!1), ge = T(), _e;
|
|
1058
|
+
n[0] !== S || n[1] !== C || n[2] !== x || n[3] !== a || n[4] !== d || n[5] !== l || n[6] !== h || n[7] !== o || n[8] !== s || n[9] !== r || n[10] !== c || n[11] !== f || n[12] !== m || n[13] !== i || n[14] !== v || n[15] !== b || n[16] !== g || n[17] !== w || n[18] !== u ? (_e = {
|
|
1059
|
+
id: r,
|
|
1060
|
+
label: i,
|
|
1061
|
+
description: a,
|
|
1062
|
+
icon: o,
|
|
1063
|
+
iconColor: s,
|
|
1064
|
+
indicator: c,
|
|
1065
|
+
endContent: l,
|
|
1066
|
+
tooltip: u,
|
|
1067
|
+
disabled: d,
|
|
1068
|
+
isContainer: f,
|
|
1069
|
+
isNavigable: m,
|
|
1070
|
+
href: h,
|
|
1071
|
+
navigationIntent: g,
|
|
1072
|
+
menuItems: v,
|
|
1073
|
+
menuPlacement: b,
|
|
1074
|
+
contextMenuItems: x,
|
|
1075
|
+
actions: S,
|
|
1076
|
+
children: C,
|
|
1077
|
+
onActivate: w
|
|
1078
|
+
}, n[0] = S, n[1] = C, n[2] = x, n[3] = a, n[4] = d, n[5] = l, n[6] = h, n[7] = o, n[8] = s, n[9] = r, n[10] = c, n[11] = f, n[12] = m, n[13] = i, n[14] = v, n[15] = b, n[16] = g, n[17] = w, n[18] = u, n[19] = _e) : _e = n[19];
|
|
1079
|
+
let K = _e, ve;
|
|
1080
|
+
n[20] !== V || n[21] !== ne || n[22] !== te || n[23] !== H || n[24] !== re ? (ve = {
|
|
1081
|
+
draggable: V,
|
|
1082
|
+
onDragStart: H,
|
|
1083
|
+
onDragOver: te,
|
|
1084
|
+
onDragEnd: ne,
|
|
1085
|
+
onDrop: re
|
|
1086
|
+
}, n[20] = V, n[21] = ne, n[22] = te, n[23] = H, n[24] = re, n[25] = ve) : ve = n[25];
|
|
1087
|
+
let q = ve, xe = (K.children?.length ?? 0) > 0 || K.isContainer === !0, J = (K.menuItems?.length ?? 0) > 0, Ce = (K.actions?.length ?? 0) > 0 || (K.contextMenuItems?.length ?? 0) > 0, Y = ue && xe, X = K.disabled === !0, De;
|
|
1088
|
+
n[26] !== J || n[27] !== X || n[28] !== w || n[29] !== z || n[30] !== Y ? (De = () => {
|
|
1089
|
+
if (!X && !J) {
|
|
1090
|
+
if (Y) {
|
|
1091
|
+
z?.();
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
w?.();
|
|
1095
|
+
}
|
|
1096
|
+
}, n[26] = J, n[27] = X, n[28] = w, n[29] = z, n[30] = Y, n[31] = De) : De = n[31];
|
|
1097
|
+
let Z = De, Oe;
|
|
1098
|
+
n[32] !== Z || n[33] !== J || n[34] !== X || n[35] !== ie || n[36] !== G ? (Oe = (e) => {
|
|
1099
|
+
if (ie?.(e), !e.defaultPrevented) {
|
|
1100
|
+
if (X) {
|
|
1101
|
+
e.preventDefault();
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
J ? G(Te) : Z();
|
|
1105
|
+
}
|
|
1106
|
+
}, n[32] = Z, n[33] = J, n[34] = X, n[35] = ie, n[36] = G, n[37] = Oe) : Oe = n[37];
|
|
1107
|
+
let ke = Oe, Ae;
|
|
1108
|
+
n[38] !== Z || n[39] !== J || n[40] !== X || n[41] !== ae || n[42] !== G ? (Ae = (e) => {
|
|
1109
|
+
if (ae?.(e), !e.defaultPrevented && e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), !X)) {
|
|
1110
|
+
if (J) {
|
|
1111
|
+
G(Ee);
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
Z();
|
|
1115
|
+
}
|
|
1116
|
+
}, n[38] = Z, n[39] = J, n[40] = X, n[41] = ae, n[42] = G, n[43] = Ae) : Ae = n[43];
|
|
1117
|
+
let je = Ae, Me = K.description !== void 0, Ne = be(se), Pe = U === "default" || Me ? "xs" : "2xs", Fe;
|
|
1118
|
+
n[44] === ke ? Fe = n[45] : (Fe = { onClick: ke }, n[44] = ke, n[45] = Fe);
|
|
1119
|
+
let Ie = Fe, { rowHeight: Le, minHeight: Re } = Se(U, Me), ze = R ?? (J ? "button" : "option"), Be = we({
|
|
1120
|
+
rootProps: {
|
|
1121
|
+
...oe,
|
|
1122
|
+
id: r
|
|
1123
|
+
},
|
|
1124
|
+
labelId: ge,
|
|
1125
|
+
hasEndContent: !!K.endContent,
|
|
1126
|
+
rowRole: ze,
|
|
1127
|
+
className: L,
|
|
1128
|
+
isSelected: ce,
|
|
1129
|
+
isExpanded: le,
|
|
1130
|
+
showChevron: Y,
|
|
1131
|
+
rowHeight: Le,
|
|
1132
|
+
minHeight: Re,
|
|
1133
|
+
verticalPadding: Pe,
|
|
1134
|
+
paddingLeft: Ne,
|
|
1135
|
+
selectedBg: pe,
|
|
1136
|
+
hoverBg: me,
|
|
1137
|
+
tone: fe,
|
|
1138
|
+
isDisabled: X,
|
|
1139
|
+
variant: U
|
|
1140
|
+
}), Ve;
|
|
1141
|
+
n[46] !== X || n[47] !== le || n[48] !== K || n[49] !== ge || n[50] !== Y || n[51] !== de || n[52] !== fe || n[53] !== U ? (Ve = /* @__PURE__ */ y(ye, {
|
|
1142
|
+
labelId: ge,
|
|
1143
|
+
item: K,
|
|
1144
|
+
isExpanded: le,
|
|
1145
|
+
showChevron: Y,
|
|
1146
|
+
isDisabled: X,
|
|
1147
|
+
tone: fe,
|
|
1148
|
+
variant: U,
|
|
1149
|
+
showContextMenuTrigger: de
|
|
1150
|
+
}), n[46] = X, n[47] = le, n[48] = K, n[49] = ge, n[50] = Y, n[51] = de, n[52] = fe, n[53] = U, n[54] = Ve) : Ve = n[54];
|
|
1151
|
+
let Q = Ve, He;
|
|
1152
|
+
n[55] !== K || n[56] !== he || n[57] !== G ? (He = (e) => /* @__PURE__ */ y(ee, {
|
|
1153
|
+
item: K,
|
|
1154
|
+
menuOpen: he,
|
|
1155
|
+
onMenuOpenChange: G,
|
|
1156
|
+
onMenuSelect: (e) => {
|
|
1157
|
+
G(!1), e.onAction?.();
|
|
1158
|
+
},
|
|
1159
|
+
children: e
|
|
1160
|
+
}), n[55] = K, n[56] = he, n[57] = G, n[58] = He) : He = n[58];
|
|
1161
|
+
let $ = He;
|
|
1162
|
+
if (W) {
|
|
1163
|
+
let e;
|
|
1164
|
+
n[59] !== Ie || n[60] !== Q || n[61] !== q || n[62] !== B || n[63] !== t || n[64] !== Be ? (e = /* @__PURE__ */ y(p.div, {
|
|
1165
|
+
ref: t,
|
|
1166
|
+
...Be,
|
|
1167
|
+
...q,
|
|
1168
|
+
...Ie,
|
|
1169
|
+
onPointerMove: B,
|
|
1170
|
+
children: Q
|
|
1171
|
+
}), n[59] = Ie, n[60] = Q, n[61] = q, n[62] = B, n[63] = t, n[64] = Be, n[65] = e) : e = n[65];
|
|
1172
|
+
let r;
|
|
1173
|
+
return n[66] !== e || n[67] !== $ ? (r = $(e), n[66] = e, n[67] = $, n[68] = r) : r = n[68], r;
|
|
1174
|
+
}
|
|
1175
|
+
if (K.href && !Y && !X && !J) {
|
|
1176
|
+
let e = Be, r;
|
|
1177
|
+
n[69] !== Q || n[70] !== q || n[71] !== ke || n[72] !== K.href || n[73] !== B || n[74] !== t || n[75] !== e ? (r = /* @__PURE__ */ y(p.a, {
|
|
1178
|
+
ref: t,
|
|
1179
|
+
href: K.href,
|
|
1180
|
+
...e,
|
|
1181
|
+
...q,
|
|
1182
|
+
onClick: ke,
|
|
1183
|
+
onPointerMove: B,
|
|
1184
|
+
children: Q
|
|
1185
|
+
}), n[69] = Q, n[70] = q, n[71] = ke, n[72] = K.href, n[73] = B, n[74] = t, n[75] = e, n[76] = r) : r = n[76];
|
|
1186
|
+
let i;
|
|
1187
|
+
return n[77] !== r || n[78] !== $ ? (i = $(r), n[77] = r, n[78] = $, n[79] = i) : i = n[79], i;
|
|
1188
|
+
}
|
|
1189
|
+
if (Ce) {
|
|
1190
|
+
let e = X || void 0, r = oe.tabIndex ?? 0, i;
|
|
1191
|
+
n[80] !== Ie || n[81] !== Q || n[82] !== q || n[83] !== je || n[84] !== B || n[85] !== t || n[86] !== Be || n[87] !== e || n[88] !== r ? (i = /* @__PURE__ */ y(p.div, {
|
|
1192
|
+
ref: t,
|
|
1193
|
+
"aria-disabled": e,
|
|
1194
|
+
...Be,
|
|
1195
|
+
...q,
|
|
1196
|
+
...Ie,
|
|
1197
|
+
tabIndex: r,
|
|
1198
|
+
onKeyDown: je,
|
|
1199
|
+
onPointerMove: B,
|
|
1200
|
+
children: Q
|
|
1201
|
+
}), n[80] = Ie, n[81] = Q, n[82] = q, n[83] = je, n[84] = B, n[85] = t, n[86] = Be, n[87] = e, n[88] = r, n[89] = i) : i = n[89];
|
|
1202
|
+
let a;
|
|
1203
|
+
return n[90] !== i || n[91] !== $ ? (a = $(i), n[90] = i, n[91] = $, n[92] = a) : a = n[92], a;
|
|
1204
|
+
}
|
|
1205
|
+
let Ue = Be, We;
|
|
1206
|
+
n[93] !== Ie || n[94] !== Q || n[95] !== q || n[96] !== X || n[97] !== B || n[98] !== t || n[99] !== Ue ? (We = /* @__PURE__ */ y(p.button, {
|
|
1207
|
+
ref: t,
|
|
1208
|
+
type: "button",
|
|
1209
|
+
disabled: X,
|
|
1210
|
+
...Ue,
|
|
1211
|
+
...q,
|
|
1212
|
+
...Ie,
|
|
1213
|
+
onPointerMove: B,
|
|
1214
|
+
children: Q
|
|
1215
|
+
}), n[93] = Ie, n[94] = Q, n[95] = q, n[96] = X, n[97] = B, n[98] = t, n[99] = Ue, n[100] = We) : We = n[100];
|
|
1216
|
+
let Ge;
|
|
1217
|
+
return n[101] !== We || n[102] !== $ ? (Ge = $(We), n[101] = We, n[102] = $, n[103] = Ge) : Ge = n[103], Ge;
|
|
1218
|
+
});
|
|
1219
|
+
function Te(e) {
|
|
1220
|
+
return !e;
|
|
1221
|
+
}
|
|
1222
|
+
function Ee(e) {
|
|
1223
|
+
return !e;
|
|
1224
|
+
}
|
|
1225
|
+
//#endregion
|
|
1226
|
+
export { re as a, L as c, ae as i, R as l, de as n, ne as o, ce as r, H as s, Y as t, N as u };
|
|
1227
|
+
|
|
1228
|
+
//# sourceMappingURL=list-row-BDDAVuVd.js.map
|