haze-ui 1.34.1 → 1.35.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/README.md +26 -0
- package/dist/THIRD-PARTY-NOTICES.md +2 -1
- package/dist/components/Anchor/Anchor.js +84 -65
- package/dist/components/BackToTop/BackToTop.js +18 -12
- package/dist/components/Combobox/Combobox.js +109 -99
- package/dist/components/CopyButton/CopyButton.js +13 -12
- package/dist/components/DataTable/DataTable.js +16 -16
- package/dist/components/FloatButton/FloatButton.js +11 -19
- package/dist/components/FollowUpSuggestions/FollowUpSuggestions.js +45 -0
- package/dist/components/FollowUpSuggestions/index.js +3 -0
- package/dist/components/LocaleProvider/ar-sa.js +9 -0
- package/dist/components/LocaleProvider/de-de.js +9 -0
- package/dist/components/LocaleProvider/es-es.js +9 -0
- package/dist/components/LocaleProvider/fr-fr.js +9 -0
- package/dist/components/LocaleProvider/it-it.js +9 -0
- package/dist/components/LocaleProvider/ja-jp.js +9 -0
- package/dist/components/LocaleProvider/ko-kr.js +9 -0
- package/dist/components/LocaleProvider/locale.js +9 -0
- package/dist/components/LocaleProvider/pt-br.js +9 -0
- package/dist/components/LocaleProvider/ru-ru.js +9 -0
- package/dist/components/LocaleProvider/zh-cn.js +9 -0
- package/dist/components/NavigationBar/NavLink.js +15 -16
- package/dist/components/NotificationCenter/NotificationCenter.js +294 -0
- package/dist/components/NotificationCenter/index.js +3 -0
- package/dist/components/Tabs/Tab.js +58 -50
- package/dist/components/TaskList/TaskList.js +96 -0
- package/dist/components/TaskList/index.js +3 -0
- package/dist/components/Toggle/Toggle.js +8 -8
- package/dist/components/Toggle/ToggleCore.js +4 -5
- package/dist/components/Toolbar/ToolbarButton.js +7 -7
- package/dist/components/Toolbar/ToolbarToggle.js +9 -9
- package/dist/components/Tree/Tree.js +159 -137
- package/dist/components/Tree/index.js +2 -1
- package/dist/components/Tree/useTree.js +32 -0
- package/dist/components/Tree/utils.js +21 -11
- package/dist/css/anchor.css +1 -1
- package/dist/css/combobox.css +1 -1
- package/dist/css/data-table.css +1 -1
- package/dist/css/follow-up-suggestions.css +4 -0
- package/dist/css/notification-center.css +5 -0
- package/dist/css/task-list.css +4 -0
- package/dist/css/tokens.css +1 -0
- package/dist/css-manifest.json +21 -0
- package/dist/haze-ui.css +17 -3
- package/dist/headless/index.js +2 -1
- package/dist/hooks/index.js +25 -0
- package/dist/hooks/useAnchorSpy.js +49 -0
- package/dist/hooks/useElementSize.js +31 -0
- package/dist/hooks/useIdle.js +45 -0
- package/dist/hooks/useMutationObserver.js +31 -0
- package/dist/hooks/useNetwork.js +28 -0
- package/dist/hooks/useOrientation.js +27 -0
- package/dist/hooks/useResizeObserver.js +16 -0
- package/dist/icons/index.js +9 -0
- package/dist/index.js +323 -318
- package/dist/mcp-docs.json +535 -13
- package/dist/registry.json +387 -7
- package/dist/sitemap.xml +6 -0
- package/dist/tokens/index.js +2 -1
- package/dist/tokens/zoom.js +6 -0
- package/dist/types/components/Anchor/Anchor.d.ts +5 -1
- package/dist/types/components/BackToTop/BackToTop.d.ts +23 -5
- package/dist/types/components/Combobox/Combobox.d.ts +17 -1
- package/dist/types/components/ConfigProvider/ConfigContext.d.ts +6 -0
- package/dist/types/components/CopyButton/CopyButton.d.ts +16 -4
- package/dist/types/components/DataTable/DataTable.bench.d.ts +1 -0
- package/dist/types/components/FloatButton/FloatButton.d.ts +25 -5
- package/dist/types/components/FollowUpSuggestions/FollowUpSuggestions.d.ts +27 -0
- package/dist/types/components/FollowUpSuggestions/index.d.ts +2 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +9 -0
- package/dist/types/components/NavigationBar/NavLink.d.ts +24 -32
- package/dist/types/components/NotificationCenter/NotificationCenter.d.ts +111 -0
- package/dist/types/components/NotificationCenter/index.d.ts +2 -0
- package/dist/types/components/Select/Select.bench.d.ts +1 -0
- package/dist/types/components/Tabs/Tab.d.ts +26 -4
- package/dist/types/components/TaskList/TaskList.d.ts +50 -0
- package/dist/types/components/TaskList/index.d.ts +2 -0
- package/dist/types/components/Toggle/Toggle.d.ts +15 -8
- package/dist/types/components/Toggle/ToggleCore.d.ts +16 -7
- package/dist/types/components/Toolbar/ToolbarButton.d.ts +17 -5
- package/dist/types/components/Toolbar/ToolbarToggle.d.ts +22 -5
- package/dist/types/components/Tree/Tree.d.ts +1 -1
- package/dist/types/components/Tree/index.d.ts +4 -1
- package/dist/types/components/Tree/types.d.ts +20 -0
- package/dist/types/components/Tree/useTree.d.ts +96 -0
- package/dist/types/components/Tree/utils.d.ts +7 -0
- package/dist/types/components/VirtualList/VirtualList.bench.d.ts +1 -0
- package/dist/types/headless/index.d.ts +16 -0
- package/dist/types/hooks/index.d.ts +4 -0
- package/dist/types/hooks/useAnchorSpy.d.ts +62 -0
- package/dist/types/icons/index.d.ts +138 -0
- package/dist/types/index.d.ts +10 -2
- package/dist/types/tokens/index.d.ts +1 -0
- package/dist/types/tokens/zoom.d.ts +33 -0
- package/dist/types/utils/deprecate.d.ts +13 -0
- package/dist/types/utils/portal.d.ts +29 -0
- package/dist/utils/portal.js +13 -0
- package/package.json +40 -8
|
@@ -8,9 +8,9 @@ import i from "../VirtualList/VirtualList.js";
|
|
|
8
8
|
import { filterTreeByQuery as a, findNodeByKey as o, flattenVisibleTree as s, getChildKeys as c, getParentKey as l, mergeLoadedChildren as u, pruneLoadedChildren as d } from "./utils.js";
|
|
9
9
|
import ee from "./TreeItem.js";
|
|
10
10
|
/* empty css */
|
|
11
|
-
import { useCallback as f, useEffect as p,
|
|
12
|
-
import { jsx as
|
|
13
|
-
import { useControl as
|
|
11
|
+
import { useCallback as f, useEffect as p, useImperativeHandle as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
12
|
+
import { jsx as v, jsxs as te } from "react/jsx-runtime";
|
|
13
|
+
import { useControl as y } from "react-use-control";
|
|
14
14
|
//#region src/lib/components/Tree/Tree.tsx
|
|
15
15
|
var ne = "haze-Tree__base", re = "haze-Tree__virtualTree", ie = 320, ae = 32, oe = "haze-Tree__group", se = "haze-Tree__emptyBlock";
|
|
16
16
|
function ce(e, t) {
|
|
@@ -36,275 +36,297 @@ function le(e, t, n) {
|
|
|
36
36
|
halfChecked: Array.from(i)
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
let
|
|
39
|
+
function b({ treeData: b, multiple: ue = !1, checkable: x = !1, checkStrictly: S = !1, selectable: C = !0, disabled: w = !1, blockNode: de = !1, showLine: fe = !1, showIcon: pe = !1, switcherIcon: me, loadingIcon: he, titleRender: ge, iconRender: _e, virtualized: T, loadData: E, searchValue: D, rowWrap: O, keyboardNavigation: ve = !0, scrollHandleRef: ye, expandedKeys: be, selectedKeys: xe, checkedKeys: Se, ref: Ce, className: k, onExpand: we, onSelect: Te, onCheck: Ee }) {
|
|
40
|
+
let De = n("tree"), [A, Oe] = y(be, []), [j, ke] = y(xe, []), [Ae, je] = y(Se, []), Me = Ae, M = !!E, [N, Ne] = _({}), [P, F] = _({}), I = g(/* @__PURE__ */ new Set()), L = h(() => d(N, b), [N, b]);
|
|
41
41
|
p(() => {
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
let
|
|
45
|
-
|
|
42
|
+
L !== N && Ne(L);
|
|
43
|
+
}, [L, N]);
|
|
44
|
+
let R = h(() => u(b, L), [b, L]), z = f((e, t) => {
|
|
45
|
+
E && !I.current.has(e) && (I.current.add(e), F((t) => ({
|
|
46
46
|
...t,
|
|
47
47
|
[e]: "loading"
|
|
48
|
-
})),
|
|
49
|
-
|
|
48
|
+
})), E(t).then((t) => {
|
|
49
|
+
I.current.delete(e), Ne((n) => ({
|
|
50
50
|
...n,
|
|
51
51
|
[e]: t
|
|
52
|
-
})),
|
|
52
|
+
})), F((t) => ce(t, e));
|
|
53
53
|
}).catch(() => {
|
|
54
|
-
|
|
54
|
+
I.current.delete(e), F((t) => ({
|
|
55
55
|
...t,
|
|
56
56
|
[e]: "error"
|
|
57
57
|
}));
|
|
58
58
|
}));
|
|
59
|
-
}, [
|
|
60
|
-
function
|
|
61
|
-
let t = o(
|
|
62
|
-
t &&
|
|
59
|
+
}, [E]);
|
|
60
|
+
function Pe(e) {
|
|
61
|
+
let t = o(R, e);
|
|
62
|
+
t && z(e, t);
|
|
63
63
|
}
|
|
64
|
-
let
|
|
64
|
+
let B = h(() => a(R, D), [R, D]), Fe = B !== null, V = B ? B.tree : R, H = h(() => !B || B.ancestorKeys.length === 0 ? A : Array.from(/* @__PURE__ */ new Set([...A, ...B.ancestorKeys])), [A, B]);
|
|
65
65
|
p(() => {
|
|
66
|
-
if (
|
|
67
|
-
let t = o(
|
|
68
|
-
t && !t.children?.length && t.isLeaf !== !0 &&
|
|
66
|
+
if (E) for (let e of H) {
|
|
67
|
+
let t = o(R, e);
|
|
68
|
+
t && !t.children?.length && t.isLeaf !== !0 && L[e] === void 0 && P[e] === void 0 && z(e, t);
|
|
69
69
|
}
|
|
70
70
|
}, [
|
|
71
|
-
|
|
71
|
+
E,
|
|
72
|
+
z,
|
|
72
73
|
R,
|
|
74
|
+
H,
|
|
73
75
|
L,
|
|
74
|
-
|
|
75
|
-
I,
|
|
76
|
-
N
|
|
76
|
+
P
|
|
77
77
|
]);
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
]),
|
|
83
|
-
B,
|
|
78
|
+
let Ie = h(() => le(Me, R, S), [
|
|
79
|
+
Me,
|
|
80
|
+
R,
|
|
81
|
+
S
|
|
82
|
+
]), U = Ie.checked, Le = Ie.halfChecked, W = T !== void 0 && T !== !1, G = typeof T == "object" ? T : void 0, [Re, ze] = _(null), [K, Be] = _(null), q = g(null), Ve = g(null), He = f((e) => r(q, Ce)(e), [Ce]), J = h(() => s(V, H, w), [
|
|
84
83
|
V,
|
|
85
|
-
|
|
84
|
+
H,
|
|
85
|
+
w
|
|
86
86
|
]), Ue = (() => {
|
|
87
|
-
let e =
|
|
88
|
-
return e ? e.key :
|
|
87
|
+
let e = J.find((e) => e.key === Re && !e.disabled);
|
|
88
|
+
return e ? e.key : J.find((e) => !e.disabled)?.key ?? null;
|
|
89
89
|
})();
|
|
90
|
-
function
|
|
91
|
-
let t =
|
|
92
|
-
t && !t.disabled && (
|
|
90
|
+
function Y(e) {
|
|
91
|
+
let t = J[e];
|
|
92
|
+
t && !t.disabled && (W && Ve.current?.scrollToIndex(e, "auto"), ze(t.key), Be(t.key));
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
for (let n = e + t; n >= 0 && n <
|
|
96
|
-
let e =
|
|
94
|
+
function X(e, t) {
|
|
95
|
+
for (let n = e + t; n >= 0 && n < J.length; n += t) {
|
|
96
|
+
let e = J[n];
|
|
97
97
|
if (e && !e.disabled) return n;
|
|
98
98
|
}
|
|
99
99
|
return -1;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function Z(e) {
|
|
102
102
|
let t = e.target;
|
|
103
103
|
if (t.getAttribute("role") !== "treeitem") return;
|
|
104
104
|
let n = t.dataset.treeKey;
|
|
105
105
|
n && ze(n);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function We(e) {
|
|
108
108
|
if (!ve) return;
|
|
109
|
-
let n =
|
|
109
|
+
let n = J;
|
|
110
110
|
if (n.length === 0) return;
|
|
111
111
|
let r = e.target;
|
|
112
112
|
if (r.getAttribute("role") !== "treeitem") return;
|
|
113
113
|
let i = r.dataset.treeKey, a = i ? n.findIndex((e) => e.key === i) : -1, o = a >= 0 ? n[a] : void 0;
|
|
114
114
|
if (!o || o.disabled) return;
|
|
115
|
-
let s = o.node.isLeaf ?? (!o.node.children?.length && !
|
|
115
|
+
let s = o.node.isLeaf ?? (!o.node.children?.length && !M), c = t(e.currentTarget) === "rtl", l = c ? "ArrowLeft" : "ArrowRight", u = c ? "ArrowRight" : "ArrowLeft";
|
|
116
116
|
switch (e.key) {
|
|
117
117
|
case "ArrowDown":
|
|
118
|
-
e.preventDefault(),
|
|
118
|
+
e.preventDefault(), Y(X(a, 1));
|
|
119
119
|
return;
|
|
120
120
|
case "ArrowUp":
|
|
121
|
-
e.preventDefault(),
|
|
121
|
+
e.preventDefault(), Y(X(a, -1));
|
|
122
122
|
return;
|
|
123
123
|
case l:
|
|
124
124
|
if (e.preventDefault(), s) return;
|
|
125
|
-
|
|
125
|
+
H.includes(o.key) ? Y(X(a, 1)) : $(o.key);
|
|
126
126
|
return;
|
|
127
127
|
case u: {
|
|
128
|
-
if (e.preventDefault(), !s &&
|
|
129
|
-
|
|
128
|
+
if (e.preventDefault(), !s && H.includes(o.key)) {
|
|
129
|
+
$(o.key);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
let t = o.parentKey === null ? -1 : n.findIndex((e) => e.key === o.parentKey);
|
|
133
|
-
t >= 0 &&
|
|
133
|
+
t >= 0 && Y(t);
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
case "Home":
|
|
137
|
-
e.preventDefault(),
|
|
137
|
+
e.preventDefault(), Y(X(-1, 1));
|
|
138
138
|
return;
|
|
139
139
|
case "End":
|
|
140
|
-
e.preventDefault(),
|
|
140
|
+
e.preventDefault(), Y(X(n.length, -1));
|
|
141
141
|
return;
|
|
142
142
|
case "Enter":
|
|
143
|
-
e.preventDefault(),
|
|
143
|
+
e.preventDefault(), qe(o.key);
|
|
144
144
|
return;
|
|
145
145
|
case " ":
|
|
146
146
|
case "Space":
|
|
147
|
-
if (!
|
|
148
|
-
e.preventDefault(),
|
|
147
|
+
if (!x) return;
|
|
148
|
+
e.preventDefault(), Je(o.key);
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
p(() => {
|
|
153
|
-
if (
|
|
154
|
-
let e =
|
|
153
|
+
if (K === null) return;
|
|
154
|
+
let e = q.current;
|
|
155
155
|
if (!e) return;
|
|
156
|
-
let t = Array.from(e.querySelectorAll("[role=\"treeitem\"]")).find((e) => e.dataset.treeKey ===
|
|
156
|
+
let t = Array.from(e.querySelectorAll("[role=\"treeitem\"]")).find((e) => e.dataset.treeKey === K);
|
|
157
157
|
t && (t.focus(), Be(null));
|
|
158
|
-
}, [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
}, [K, J]);
|
|
159
|
+
let [Q, Ge] = _(null), Ke = f((e, t = "auto") => {
|
|
160
|
+
Ge({
|
|
161
|
+
key: e,
|
|
162
|
+
align: t
|
|
163
|
+
});
|
|
164
|
+
}, []);
|
|
165
|
+
m(ye, () => ({ scrollToKey: Ke }), [Ke]), p(() => {
|
|
166
|
+
if (!Q) return;
|
|
167
|
+
let e = J.findIndex((e) => e.key === Q.key);
|
|
168
|
+
if (!(e < 0)) {
|
|
169
|
+
if (W) Ve.current?.scrollToIndex(e, Q.align);
|
|
170
|
+
else {
|
|
171
|
+
let e = Array.from(q.current?.querySelectorAll("[role=\"treeitem\"]") ?? []).find((e) => e.dataset.treeKey === Q.key), t = Q.align === "start" ? "start" : Q.align === "end" ? "end" : Q.align === "center" ? "center" : "nearest";
|
|
172
|
+
e?.scrollIntoView({ block: t });
|
|
173
|
+
}
|
|
174
|
+
Ge(null);
|
|
175
|
+
}
|
|
176
|
+
}, [
|
|
177
|
+
Q,
|
|
178
|
+
J,
|
|
179
|
+
W
|
|
180
|
+
]);
|
|
181
|
+
function $(e) {
|
|
182
|
+
let t = A.includes(e), n = t ? A.filter((t) => t !== e) : [...A, e];
|
|
183
|
+
Oe(n), !t && P[e] === "error" && F((t) => ce(t, e)), we?.(n, {
|
|
162
184
|
expanded: !t,
|
|
163
|
-
node: o(
|
|
185
|
+
node: o(R, e)
|
|
164
186
|
});
|
|
165
187
|
}
|
|
166
|
-
function
|
|
167
|
-
let t = o(
|
|
168
|
-
if (!t?.selectable && t?.selectable !== void 0 || !
|
|
188
|
+
function qe(e) {
|
|
189
|
+
let t = o(R, e);
|
|
190
|
+
if (!t?.selectable && t?.selectable !== void 0 || !C) return;
|
|
169
191
|
let n;
|
|
170
|
-
n = ue ?
|
|
192
|
+
n = ue ? j.indexOf(e) >= 0 ? j.filter((t) => t !== e) : [...j, e] : j.includes(e) ? [] : [e], ke(n), Te?.(n, {
|
|
171
193
|
selected: n.includes(e),
|
|
172
|
-
selectedNodes: n.map((e) => o(
|
|
194
|
+
selectedNodes: n.map((e) => o(R, e)).filter(Boolean),
|
|
173
195
|
node: t
|
|
174
196
|
});
|
|
175
197
|
}
|
|
176
|
-
function
|
|
177
|
-
if (!
|
|
178
|
-
let t =
|
|
179
|
-
if (
|
|
198
|
+
function Je(e) {
|
|
199
|
+
if (!x || o(R, e)?.disableCheckbox) return;
|
|
200
|
+
let t = U.includes(e), n;
|
|
201
|
+
if (S) n = t ? U.filter((t) => t !== e) : [...U, e];
|
|
180
202
|
else {
|
|
181
|
-
let r = c(
|
|
203
|
+
let r = c(R, e);
|
|
182
204
|
if (t) {
|
|
183
|
-
n =
|
|
184
|
-
let t = l(
|
|
185
|
-
for (; t;) n = n.filter((e) => e !== t), t = l(
|
|
205
|
+
n = U.filter((t) => t !== e && !r.includes(t));
|
|
206
|
+
let t = l(R, e);
|
|
207
|
+
for (; t;) n = n.filter((e) => e !== t), t = l(R, t);
|
|
186
208
|
} else {
|
|
187
|
-
let t = [e, ...r].filter((e) => !
|
|
188
|
-
n = [...
|
|
189
|
-
let i = l(
|
|
190
|
-
for (; i;) c(
|
|
209
|
+
let t = [e, ...r].filter((e) => !U.includes(e));
|
|
210
|
+
n = [...U, ...t];
|
|
211
|
+
let i = l(R, e);
|
|
212
|
+
for (; i;) c(R, i).every((e) => n.includes(e)) && !n.includes(i) && n.push(i), i = l(R, i);
|
|
191
213
|
}
|
|
192
214
|
}
|
|
193
|
-
let r = le(n,
|
|
194
|
-
|
|
215
|
+
let r = le(n, R, S);
|
|
216
|
+
je(S ? n : r.checked), Ee?.(S ? n : r, {
|
|
195
217
|
checked: !t,
|
|
196
|
-
checkedNodes: n.map((e) => o(
|
|
197
|
-
node: o(
|
|
218
|
+
checkedNodes: n.map((e) => o(R, e)).filter(Boolean),
|
|
219
|
+
node: o(R, e),
|
|
198
220
|
halfCheckedKeys: r.halfChecked
|
|
199
221
|
});
|
|
200
222
|
}
|
|
201
|
-
function
|
|
223
|
+
function Ye(t, n, r) {
|
|
202
224
|
return t.map((i, a) => {
|
|
203
|
-
let o = !!i.children?.length, s =
|
|
225
|
+
let o = !!i.children?.length, s = H.includes(i.key), c = j.includes(i.key), l = U.includes(i.key), u = Le.includes(i.key), d = P[i.key], f = l ? "checked" : u ? "halfChecked" : "unchecked", p = a === t.length - 1, m = [...r, p], h = /* @__PURE__ */ v(ee, {
|
|
204
226
|
node: i,
|
|
205
227
|
level: n,
|
|
206
228
|
expanded: s,
|
|
207
229
|
selected: c,
|
|
208
230
|
checked: f,
|
|
209
|
-
disabled:
|
|
210
|
-
checkable:
|
|
211
|
-
selectable:
|
|
231
|
+
disabled: w,
|
|
232
|
+
checkable: x,
|
|
233
|
+
selectable: C,
|
|
212
234
|
blockNode: de,
|
|
213
235
|
showLine: fe,
|
|
214
236
|
showIcon: pe,
|
|
215
237
|
switcherIcon: me,
|
|
216
238
|
loadingIcon: he,
|
|
217
239
|
loading: d === "loading",
|
|
218
|
-
loadable:
|
|
240
|
+
loadable: M,
|
|
219
241
|
loadFailed: d === "error",
|
|
220
|
-
searchValue:
|
|
242
|
+
searchValue: D,
|
|
221
243
|
titleRender: ge,
|
|
222
244
|
iconRender: _e,
|
|
223
245
|
isLast: m,
|
|
224
246
|
tabIndex: i.key === Ue ? 0 : -1,
|
|
225
|
-
onToggle: () =>
|
|
226
|
-
onSelect: () =>
|
|
227
|
-
onCheck: () =>
|
|
228
|
-
onRetry: () =>
|
|
247
|
+
onToggle: () => $(i.key),
|
|
248
|
+
onSelect: () => qe(i.key),
|
|
249
|
+
onCheck: () => Je(i.key),
|
|
250
|
+
onRetry: () => Pe(i.key)
|
|
229
251
|
});
|
|
230
252
|
return /* @__PURE__ */ te("div", {
|
|
231
253
|
role: "group",
|
|
232
254
|
"data-slot": "group",
|
|
233
255
|
className: e(oe),
|
|
234
|
-
children: [
|
|
256
|
+
children: [O ? O(h, i) : h, o && s && /* @__PURE__ */ v("div", {
|
|
235
257
|
"data-slot": "list",
|
|
236
|
-
children:
|
|
258
|
+
children: Ye(i.children, n + 1, m)
|
|
237
259
|
})]
|
|
238
260
|
}, i.key);
|
|
239
261
|
});
|
|
240
262
|
}
|
|
241
|
-
function
|
|
242
|
-
let t =
|
|
263
|
+
function Xe(e) {
|
|
264
|
+
let t = U.includes(e.key), n = Le.includes(e.key), r = P[e.key], i = t ? "checked" : n ? "halfChecked" : "unchecked", a = /* @__PURE__ */ v(ee, {
|
|
243
265
|
node: e.node,
|
|
244
266
|
level: e.level,
|
|
245
|
-
expanded:
|
|
246
|
-
selected:
|
|
267
|
+
expanded: H.includes(e.key),
|
|
268
|
+
selected: j.includes(e.key),
|
|
247
269
|
checked: i,
|
|
248
|
-
disabled:
|
|
249
|
-
checkable:
|
|
250
|
-
selectable:
|
|
270
|
+
disabled: w,
|
|
271
|
+
checkable: x,
|
|
272
|
+
selectable: C,
|
|
251
273
|
blockNode: de,
|
|
252
274
|
showLine: fe,
|
|
253
275
|
showIcon: pe,
|
|
254
276
|
switcherIcon: me,
|
|
255
277
|
loadingIcon: he,
|
|
256
278
|
loading: r === "loading",
|
|
257
|
-
loadable:
|
|
279
|
+
loadable: M,
|
|
258
280
|
loadFailed: r === "error",
|
|
259
|
-
searchValue:
|
|
281
|
+
searchValue: D,
|
|
260
282
|
titleRender: ge,
|
|
261
283
|
iconRender: _e,
|
|
262
284
|
isLast: e.isLast,
|
|
263
285
|
tabIndex: e.key === Ue ? 0 : -1,
|
|
264
|
-
onToggle: () =>
|
|
265
|
-
onSelect: () =>
|
|
266
|
-
onCheck: () =>
|
|
267
|
-
onRetry: () =>
|
|
286
|
+
onToggle: () => $(e.key),
|
|
287
|
+
onSelect: () => qe(e.key),
|
|
288
|
+
onCheck: () => Je(e.key),
|
|
289
|
+
onRetry: () => Pe(e.key)
|
|
268
290
|
});
|
|
269
|
-
return
|
|
291
|
+
return O ? O(a, e.node) : a;
|
|
270
292
|
}
|
|
271
|
-
return
|
|
293
|
+
return Fe && V.length === 0 ? /* @__PURE__ */ v("div", {
|
|
272
294
|
role: "tree",
|
|
273
295
|
"data-slot": "tree",
|
|
274
|
-
ref:
|
|
275
|
-
onKeyDown:
|
|
276
|
-
onFocus:
|
|
277
|
-
className: e([ne,
|
|
278
|
-
children:
|
|
296
|
+
ref: He,
|
|
297
|
+
onKeyDown: We,
|
|
298
|
+
onFocus: Z,
|
|
299
|
+
className: e([ne, k]),
|
|
300
|
+
children: v("div", {
|
|
279
301
|
"data-slot": "empty",
|
|
280
302
|
className: e(se),
|
|
281
|
-
children:
|
|
303
|
+
children: De.noMatch
|
|
282
304
|
})
|
|
283
|
-
}) :
|
|
305
|
+
}) : W ? /* @__PURE__ */ v("div", {
|
|
284
306
|
role: "tree",
|
|
285
307
|
"data-slot": "tree",
|
|
286
|
-
ref:
|
|
287
|
-
onKeyDown:
|
|
288
|
-
onFocus:
|
|
289
|
-
className: e([re,
|
|
290
|
-
children:
|
|
291
|
-
ref:
|
|
308
|
+
ref: He,
|
|
309
|
+
onKeyDown: We,
|
|
310
|
+
onFocus: Z,
|
|
311
|
+
className: e([re, k]),
|
|
312
|
+
children: v(i, {
|
|
313
|
+
ref: Ve,
|
|
292
314
|
"data-virtualized": !0,
|
|
293
|
-
items:
|
|
294
|
-
height:
|
|
295
|
-
itemHeight:
|
|
296
|
-
overscan:
|
|
297
|
-
renderItem:
|
|
315
|
+
items: J,
|
|
316
|
+
height: G?.height ?? ie,
|
|
317
|
+
itemHeight: G?.itemHeight ?? ae,
|
|
318
|
+
overscan: G?.overscan,
|
|
319
|
+
renderItem: Xe
|
|
298
320
|
})
|
|
299
|
-
}) : /* @__PURE__ */
|
|
321
|
+
}) : /* @__PURE__ */ v("div", {
|
|
300
322
|
role: "tree",
|
|
301
323
|
"data-slot": "tree",
|
|
302
|
-
ref:
|
|
303
|
-
onKeyDown:
|
|
304
|
-
onFocus:
|
|
305
|
-
className: e([ne,
|
|
306
|
-
children:
|
|
324
|
+
ref: He,
|
|
325
|
+
onKeyDown: We,
|
|
326
|
+
onFocus: Z,
|
|
327
|
+
className: e([ne, k]),
|
|
328
|
+
children: Ye(V, 0, [])
|
|
307
329
|
});
|
|
308
330
|
}
|
|
309
331
|
//#endregion
|
|
310
|
-
export {
|
|
332
|
+
export { b as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { flattenVisibleTree as e, getNodePath as t } from "./utils.js";
|
|
3
|
+
import { useCallback as n, useRef as r } from "react";
|
|
4
|
+
import { useControl as i } from "react-use-control";
|
|
5
|
+
//#region src/lib/components/Tree/useTree.ts
|
|
6
|
+
function a(a) {
|
|
7
|
+
let { treeData: o, expandedKeys: s } = a, [c, l, u] = i(s, []), d = r(null), f = n((e) => t(o, e), [o]), p = n(() => e(o, c, !1), [o, c]), m = n((e, n) => {
|
|
8
|
+
let { autoExpand: r = !1, align: i = "auto" } = n ?? {};
|
|
9
|
+
if (r) {
|
|
10
|
+
let n = t(o, e).slice(0, -1).map((e) => e.key);
|
|
11
|
+
n.length > 0 && l((e) => {
|
|
12
|
+
let t = n.filter((t) => !e.includes(t));
|
|
13
|
+
return t.length === 0 ? e : [...e, ...t];
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
d.current?.scrollToKey(e, i);
|
|
17
|
+
}, [o, l]);
|
|
18
|
+
return {
|
|
19
|
+
treeProps: {
|
|
20
|
+
treeData: o,
|
|
21
|
+
expandedKeys: u,
|
|
22
|
+
scrollHandleRef: d
|
|
23
|
+
},
|
|
24
|
+
expandedKeys: c,
|
|
25
|
+
setExpandedKeys: l,
|
|
26
|
+
getPath: f,
|
|
27
|
+
flattenVisible: p,
|
|
28
|
+
scrollTo: m
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { a as useTree };
|
|
@@ -45,26 +45,36 @@ function r(e, t, n) {
|
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
function i(e, t) {
|
|
48
|
+
for (let n of e) {
|
|
49
|
+
if (n.key === t) return [n];
|
|
50
|
+
if (n.children?.length) {
|
|
51
|
+
let e = i(n.children, t);
|
|
52
|
+
if (e.length > 0) return [n, ...e];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
function a(e, t) {
|
|
48
58
|
if (!t) return [];
|
|
49
59
|
let n = e.toLowerCase(), r = t.toLowerCase(), i = [], a = n.indexOf(r);
|
|
50
60
|
for (; a !== -1;) i.push([a, a + r.length]), a = n.indexOf(r, a + r.length);
|
|
51
61
|
return i;
|
|
52
62
|
}
|
|
53
|
-
function a(e, t) {
|
|
54
|
-
return typeof e.title == "string" && i(e.title, t).length > 0;
|
|
55
|
-
}
|
|
56
63
|
function o(e, t) {
|
|
64
|
+
return typeof e.title == "string" && a(e.title, t).length > 0;
|
|
65
|
+
}
|
|
66
|
+
function s(e, t) {
|
|
57
67
|
if (!t) return null;
|
|
58
68
|
let n = [], r = [], i = (e) => {
|
|
59
|
-
let
|
|
69
|
+
let a = [];
|
|
60
70
|
for (let s of e) {
|
|
61
|
-
let e = s.children?.length ? i(s.children) : [], c =
|
|
62
|
-
c && n.push(s.key), (c || e.length !== 0) && (e.length > 0 ? (r.push(s.key),
|
|
71
|
+
let e = s.children?.length ? i(s.children) : [], c = o(s, t);
|
|
72
|
+
c && n.push(s.key), (c || e.length !== 0) && (e.length > 0 ? (r.push(s.key), a.push({
|
|
63
73
|
...s,
|
|
64
74
|
children: e
|
|
65
|
-
})) :
|
|
75
|
+
})) : a.push(s));
|
|
66
76
|
}
|
|
67
|
-
return
|
|
77
|
+
return a;
|
|
68
78
|
};
|
|
69
79
|
return {
|
|
70
80
|
tree: i(e),
|
|
@@ -72,7 +82,7 @@ function o(e, t) {
|
|
|
72
82
|
ancestorKeys: r
|
|
73
83
|
};
|
|
74
84
|
}
|
|
75
|
-
function
|
|
85
|
+
function c(e, t) {
|
|
76
86
|
if (Object.keys(t).length === 0) return e;
|
|
77
87
|
let n = (e) => e.map((e) => {
|
|
78
88
|
if (e.children?.length) return {
|
|
@@ -90,7 +100,7 @@ function s(e, t) {
|
|
|
90
100
|
});
|
|
91
101
|
return n(e);
|
|
92
102
|
}
|
|
93
|
-
function
|
|
103
|
+
function l(e, n) {
|
|
94
104
|
let r = Object.entries(e);
|
|
95
105
|
if (r.length === 0) return e;
|
|
96
106
|
let i = {}, a = !1;
|
|
@@ -101,4 +111,4 @@ function c(e, n) {
|
|
|
101
111
|
return a ? i : e;
|
|
102
112
|
}
|
|
103
113
|
//#endregion
|
|
104
|
-
export {
|
|
114
|
+
export { s as filterTreeByQuery, t as findNodeByKey, e as flattenVisibleTree, n as getChildKeys, i as getNodePath, r as getParentKey, a as matchRanges, c as mergeLoadedChildren, o as nodeTitleMatches, l as pruneLoadedChildren };
|
package/dist/css/anchor.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* haze-ui anchor — generated by scripts/split-css.mjs, do not edit */
|
|
2
2
|
@layer haze {
|
|
3
|
-
.haze-Anchor__nav{font-size:var(--haze-text-sm);position:sticky;top:0}.haze-Anchor__list{gap:var(--haze-space-1);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.haze-Anchor__link{padding:var(--haze-space-1) var(--haze-space-2);border-inline-start:var(--haze-space-1) solid transparent;border-radius:0 var(--haze-radius-sm) var(--haze-radius-sm) 0;color:var(--haze-color-text-muted);-webkit-transition:color var(--haze-duration-fast) var(--haze-ease),border-color var(--haze-duration-fast) var(--haze-ease);transition:color var(--haze-duration-fast) var(--haze-ease),border-color var(--haze-duration-fast) var(--haze-ease);-webkit-text-decoration:none;text-decoration:none;display:block}.haze-Anchor__link:hover{color:var(--haze-color-text)}.haze-Anchor__linkActive{border-inline-start-color:var(--haze-color-primary);
|
|
3
|
+
.haze-Anchor__nav{font-size:var(--haze-text-sm);position:sticky;top:0}.haze-Anchor__list{gap:var(--haze-space-1);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.haze-Anchor__sublist{gap:var(--haze-space-1);margin:var(--haze-space-1) 0 0;-webkit-padding-start:var(--haze-space-4);flex-direction:column;padding-inline-start:var(--haze-space-4);list-style:none;display:flex}.haze-Anchor__link{padding:var(--haze-space-1) var(--haze-space-2);border-inline-start:var(--haze-space-1) solid transparent;border-radius:0 var(--haze-radius-sm) var(--haze-radius-sm) 0;color:var(--haze-color-text-muted);-webkit-transition:color var(--haze-duration-fast) var(--haze-ease),border-color var(--haze-duration-fast) var(--haze-ease);transition:color var(--haze-duration-fast) var(--haze-ease),border-color var(--haze-duration-fast) var(--haze-ease);-webkit-text-decoration:none;text-decoration:none;display:block}.haze-Anchor__link:hover{color:var(--haze-color-text)}.haze-Anchor__linkActive{color:var(--haze-color-primary);font-weight:var(--haze-weight-medium)}.haze-Anchor__linkActiveBar{border-inline-start-color:var(--haze-color-primary)}.haze-Anchor__indicatorBar{inset-inline-start:0;width:var(--haze-space-1);border-radius:var(--haze-radius-sm);background:var(--haze-color-primary);pointer-events:none;-webkit-transition:-webkit-transform var(--haze-duration-normal) var(--haze-ease),height var(--haze-duration-normal) var(--haze-ease),opacity var(--haze-duration-fast) var(--haze-ease);transition:transform var(--haze-duration-normal) var(--haze-ease),height var(--haze-duration-normal) var(--haze-ease),opacity var(--haze-duration-fast) var(--haze-ease);position:absolute;top:0}@media (prefers-reduced-motion:reduce){.haze-Anchor__indicatorBar{transition:none}}.haze-Anchor__indicatorHidden{opacity:0}
|
|
4
4
|
}
|
package/dist/css/combobox.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* haze-ui combobox — generated by scripts/split-css.mjs, do not edit */
|
|
2
2
|
@layer haze {
|
|
3
|
-
.haze-Combobox__wrapper{width:100%;display:inline-block;position:relative}.haze-Combobox__input{border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);width:100%;color:var(--haze-color-text);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);padding:var(--haze-space-2) var(--haze-space-3);line-height:var(--haze-leading-normal);-webkit-transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);box-sizing:border-box;display:block}.haze-Combobox__input:focus{border-color:var(--haze-color-primary);box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-Combobox__multiBox{-webkit-box-flex-wrap:wrap;align-items:center;gap:var(--haze-space-1);box-sizing:border-box;border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);cursor:text;width:100%;padding:var(--haze-space-1) var(--haze-space-2);-webkit-transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);flex-wrap:wrap;display:flex}.haze-Combobox__multiBox:focus-within{border-color:var(--haze-color-primary);box-shadow:0 0 0 3px var(--haze-color-focus-ring)}.haze-Combobox__multiInput{min-width:4rem;padding:var(--haze-space-1) 0;color:var(--haze-color-text);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);line-height:var(--haze-leading-normal);background:0 0;border:none;outline:none;flex:1}.haze-Combobox__multiInput::-webkit-input-placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput::placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput:-ms-placeholder-shown{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput::placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__matchMark{background:var(--haze-color-primary-subtle);color:var(--haze-color-primary);border-radius:var(--haze-radius-sm);padding:0}.haze-Combobox__stateRow{justify-content:center;align-items:center;gap:var(--haze-space-2);padding:var(--haze-space-2) var(--haze-space-3);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);color:var(--haze-color-text-muted);cursor:default;display:flex}.haze-Combobox__groupHeadingText{font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);color:var(--haze-color-text-muted)}.haze-Combobox__listbox{box-sizing:border-box;min-width:100%;min-width:anchor-size(width);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);max-height:200px;box-shadow:var(--haze-shadow-lg);overflow-y:auto}.haze-Combobox__listboxVirtual{box-sizing:border-box;min-width:100%;min-width:anchor-size(width);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);box-shadow:var(--haze-shadow-lg)}.haze-Combobox__virtualRow{box-sizing:border-box;height:100%}
|
|
3
|
+
.haze-Combobox__wrapper{width:100%;display:inline-block;position:relative}.haze-Combobox__input{border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);width:100%;color:var(--haze-color-text);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);padding:var(--haze-space-2) var(--haze-space-3);line-height:var(--haze-leading-normal);-webkit-transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);box-sizing:border-box;display:block}.haze-Combobox__input:focus{border-color:var(--haze-color-primary);box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-Combobox__multiBox{-webkit-box-flex-wrap:wrap;align-items:center;gap:var(--haze-space-1);box-sizing:border-box;border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);cursor:text;width:100%;padding:var(--haze-space-1) var(--haze-space-2);-webkit-transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);flex-wrap:wrap;display:flex}.haze-Combobox__multiBox:focus-within{border-color:var(--haze-color-primary);box-shadow:0 0 0 3px var(--haze-color-focus-ring)}.haze-Combobox__multiInput{min-width:4rem;padding:var(--haze-space-1) 0;color:var(--haze-color-text);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);line-height:var(--haze-leading-normal);background:0 0;border:none;outline:none;flex:1}.haze-Combobox__multiInput::-webkit-input-placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput::placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput:-ms-placeholder-shown{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput::placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__overflowBadge{border-radius:var(--haze-radius-full);background:var(--haze-color-bg-muted);color:var(--haze-color-text-secondary);font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);font-weight:var(--haze-weight-medium);white-space:nowrap;padding:var(--haze-space-1) var(--haze-space-2);cursor:default;align-items:center;line-height:1;display:inline-flex}.haze-Combobox__matchMark{background:var(--haze-color-primary-subtle);color:var(--haze-color-primary);border-radius:var(--haze-radius-sm);padding:0}.haze-Combobox__stateRow{justify-content:center;align-items:center;gap:var(--haze-space-2);padding:var(--haze-space-2) var(--haze-space-3);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);color:var(--haze-color-text-muted);cursor:default;display:flex}.haze-Combobox__groupHeadingText{font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);color:var(--haze-color-text-muted)}.haze-Combobox__listbox{box-sizing:border-box;min-width:100%;min-width:anchor-size(width);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);max-height:200px;box-shadow:var(--haze-shadow-lg);overflow-y:auto}.haze-Combobox__listboxVirtual{box-sizing:border-box;min-width:100%;min-width:anchor-size(width);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);box-shadow:var(--haze-shadow-lg)}.haze-Combobox__virtualRow{box-sizing:border-box;height:100%}
|
|
4
4
|
.haze-ComboboxGroup__groupHeading{z-index:var(--haze-z-local-1);box-sizing:border-box;background:var(--haze-color-bg);border-bottom:1px solid var(--haze-color-border);padding:var(--haze-space-1) var(--haze-space-3);font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);color:var(--haze-color-text-muted);position:sticky;top:0}
|
|
5
5
|
.haze-ComboboxOption__option{padding:var(--haze-space-2) var(--haze-space-3);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);color:var(--haze-color-text);cursor:pointer;-webkit-transition:background var(--haze-duration-fast);transition:background var(--haze-duration-fast);align-items:center;display:flex}.haze-ComboboxOption__option:hover:not([data-disabled]){background:var(--haze-color-bg-subtle)}.haze-ComboboxOption__option:active:not([data-disabled]){background:var(--haze-color-bg-muted)}.haze-ComboboxOption__option[data-disabled]{opacity:.5;cursor:not-allowed}.haze-ComboboxOption__highlightedStyle{background:var(--haze-color-bg-subtle)}.haze-ComboboxOption__selectedStyle{font-weight:var(--haze-weight-medium);color:var(--haze-color-primary)}
|
|
6
6
|
.haze-floating__floatingNative{margin:0;inset:auto}.haze-floating__floatingAnchored{position-anchor:var(--haze-floating-anchor)}.haze-floating__floatingFixed{position:fixed}.haze-floating__floatingHidden{display:none}.haze-floating__floatingAnimated[data-state=open]{-webkit-animation:haze-floating-in-haze-floating__floatingAnimated var(--haze-duration-fast) var(--haze-ease);animation:haze-floating-in-haze-floating__floatingAnimated var(--haze-duration-fast) var(--haze-ease)}.haze-floating__floatingAnimated[data-state=closed]{-webkit-animation:haze-floating-out-haze-floating__floatingAnimated var(--haze-duration-fast) var(--haze-ease) forwards;animation:haze-floating-out-haze-floating__floatingAnimated var(--haze-duration-fast) var(--haze-ease) forwards}@keyframes haze-floating-in-haze-floating__floatingAnimated{0%{opacity:0}}@keyframes haze-floating-out-haze-floating__floatingAnimated{to{opacity:0}}.haze-floating__anchoredBottom,.haze-floating__anchoredBottomSpan{position-area:bottom span-right;margin-top:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredBottomCenter{position-area:bottom center;margin-top:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredBottomEnd{position-area:bottom span-left;margin-top:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredTop{position-area:top center;margin-bottom:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredLeft{position-area:left center;margin-right:var(--haze-space-1);position-try-fallbacks:flip-inline}.haze-floating__anchoredRight{position-area:right center;margin-left:var(--haze-space-1);position-try-fallbacks:flip-inline}.haze-floating__anchoredLogicalBottom{position-area:span-inline-end block-end;position-try-fallbacks:flip-block;margin-block-start:var(--haze-space-1)}.haze-floating__anchoredLogicalBottomCenter{position-area:block-end center;position-try-fallbacks:flip-block;margin-block-start:var(--haze-space-1)}.haze-floating__anchoredLogicalBottomEnd{position-area:span-inline-start block-end;position-try-fallbacks:flip-block;margin-block-start:var(--haze-space-1)}.haze-floating__anchoredLogicalTop{position-area:block-start center;position-try-fallbacks:flip-block;margin-block-end:var(--haze-space-1)}.haze-floating__anchoredLogicalLeft{position-area:inline-start center;-webkit-margin-end:var(--haze-space-1);position-try-fallbacks:flip-inline;margin-inline-end:var(--haze-space-1)}.haze-floating__anchoredLogicalRight{position-area:inline-end center;-webkit-margin-start:var(--haze-space-1);position-try-fallbacks:flip-inline;margin-inline-start:var(--haze-space-1)}.haze-floating__fallbackBottom{z-index:var(--haze-z-overlay-fallback);margin-top:var(--haze-space-1);position:absolute;top:100%;left:0}.haze-floating__fallbackBottomCenter{z-index:var(--haze-z-overlay-fallback);margin-top:var(--haze-space-1);position:absolute;top:100%;left:50%;transform:translate(-50%)}.haze-floating__fallbackBottomEnd{z-index:var(--haze-z-overlay-fallback);margin-top:var(--haze-space-1);position:absolute;top:100%;right:0}.haze-floating__fallbackTop{z-index:var(--haze-z-overlay-fallback);margin-bottom:var(--haze-space-1);position:absolute;bottom:100%;left:50%;transform:translate(-50%)}.haze-floating__fallbackLeft{z-index:var(--haze-z-overlay-fallback);margin-right:var(--haze-space-1);position:absolute;top:50%;right:100%;transform:translateY(-50%)}.haze-floating__fallbackRight{z-index:var(--haze-z-overlay-fallback);margin-left:var(--haze-space-1);position:absolute;top:50%;left:100%;transform:translateY(-50%)}.haze-floating__gapBelow{margin-top:var(--haze-space-1)}.haze-floating__gapAbove{margin-bottom:var(--haze-space-1)}.haze-floating__gapBefore{margin-right:var(--haze-space-1)}.haze-floating__gapAfter{margin-left:var(--haze-space-1)}
|
package/dist/css/data-table.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* haze-ui data-table — generated by scripts/split-css.mjs, do not edit */
|
|
2
2
|
@layer haze {
|
|
3
3
|
.haze-CellEditor__editorInput{min-width:0;margin-block:calc(-1 * var(--haze-space-1))}
|
|
4
|
-
.haze-DataTable__root{flex-direction:column;display:flex}.haze-DataTable__scrollArea{overflow-x:auto}.haze-DataTable__stickyScrollArea{flex:1;min-height:0;overflow:auto}.haze-DataTable__virtualArea{-webkit-scrollbar-gutter:stable;-ms-scrollbar-gutter:stable;scrollbar-gutter:stable;flex:1;min-height:0;overflow:auto hidden}.haze-DataTable__fixedLayout{table-layout:fixed}.haze-DataTable__virtualRowTable{height:100%}.haze-DataTable__tableBase{border-collapse:collapse;width:100%;font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);color:var(--haze-color-text)}.haze-DataTable__stickyHead th{z-index:var(--haze-z-local-2);background:var(--haze-color-bg);box-shadow:var(--haze-shadow-sm);position:sticky;top:0}.haze-DataTable__sortButton{align-items:center;gap:var(--haze-space-1);font:inherit;font-weight:inherit;color:inherit;cursor:pointer;background:0 0;border:none;padding:0;display:inline-flex}.haze-DataTable__sortButton:hover{color:var(--haze-color-primary)}.haze-DataTable__sortButton:focus-visible{border-radius:var(--haze-radius-sm);box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-DataTable__sortIcon{color:var(--haze-color-text-muted);font-size:var(--haze-text-xs)}.haze-DataTable__rowHover:hover{background:var(--haze-color-bg-subtle)}.haze-DataTable__rowSelected,.haze-DataTable__rowSelected:hover{background:var(--haze-color-primary-subtle)}.haze-DataTable__clickableRow{cursor:pointer}.haze-DataTable__checkCell{white-space:nowrap;width:1%}.haze-DataTable__checkCellCol{white-space:nowrap}.haze-DataTable__fixedCell{z-index:var(--haze-z-local-1);background:var(--haze-color-bg);position:sticky}tr:hover .haze-DataTable__fixedCell{background:var(--haze-color-bg-subtle)}tr .haze-DataTable__fixedCellSelected,tr:hover .haze-DataTable__fixedCellSelected{background:var(--haze-color-primary-subtle)}.haze-DataTable__fixedHeadCell{z-index:var(--haze-z-local-3)}.haze-DataTable__fixedLeftEdge{clip-path:inset(0 -8px 0 0);box-shadow:6px 0 8px -6px var(--haze-color-border)}.haze-DataTable__fixedRightEdge{clip-path:inset(0 0 0 -8px);box-shadow:-6px 0 8px -6px var(--haze-color-border)}.haze-DataTable__emptyCell{padding:0}.haze-DataTable__footer{margin-top:var(--haze-space-3);justify-content:flex-end;align-items:center;display:flex}.haze-DataTable__toolbar{-webkit-box-flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:var(--haze-space-2);margin-bottom:var(--haze-space-3);flex-wrap:wrap;display:flex}.haze-DataTable__footerMenu{-webkit-margin-end:auto;margin-inline-end:auto}.haze-DataTable__columnsTrigger{align-items:center;gap:var(--haze-space-1);padding:var(--haze-space-1) var(--haze-space-2);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);color:var(--haze-color-text);font-size:var(--haze-text-sm);font-family:var(--haze-font-sans);display:inline-flex}.haze-DataTable__columnsTrigger:hover{border-color:var(--haze-color-border-hover);background:var(--haze-color-bg-subtle)}.haze-DataTable__toggleRow{padding:var(--haze-space-1) var(--haze-space-2);border-radius:var(--haze-radius-sm);cursor:pointer;font-size:var(--haze-text-sm);align-items:center;display:flex}.haze-DataTable__toggleRow:hover{background:var(--haze-color-bg-subtle)}.haze-
|
|
4
|
+
.haze-DataTable__root{flex-direction:column;display:flex}.haze-DataTable__scrollArea{overflow-x:auto}.haze-DataTable__stickyScrollArea{flex:1;min-height:0;overflow:auto}.haze-DataTable__virtualArea{-webkit-scrollbar-gutter:stable;-ms-scrollbar-gutter:stable;scrollbar-gutter:stable;flex:1;min-height:0;overflow:auto hidden}.haze-DataTable__fixedLayout{table-layout:fixed}.haze-DataTable__virtualRowTable{height:100%}.haze-DataTable__tableBase{border-collapse:collapse;width:100%;font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);color:var(--haze-color-text)}.haze-DataTable__stickyHead th{z-index:var(--haze-z-local-2);background:var(--haze-color-bg);box-shadow:var(--haze-shadow-sm);position:sticky;top:0}.haze-DataTable__sortButton{align-items:center;gap:var(--haze-space-1);font:inherit;font-weight:inherit;color:inherit;cursor:pointer;background:0 0;border:none;padding:0;display:inline-flex}.haze-DataTable__sortButton:hover{color:var(--haze-color-primary)}.haze-DataTable__sortButton:focus-visible{border-radius:var(--haze-radius-sm);box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-DataTable__sortIcon{color:var(--haze-color-text-muted);font-size:var(--haze-text-xs)}.haze-DataTable__rowHover:hover{background:var(--haze-color-bg-subtle)}.haze-DataTable__rowSelected,.haze-DataTable__rowSelected:hover{background:var(--haze-color-primary-subtle)}.haze-DataTable__clickableRow{cursor:pointer}.haze-DataTable__checkCell{white-space:nowrap;width:1%}.haze-DataTable__checkCellCol{white-space:nowrap}.haze-DataTable__resizableHead{position:relative}.haze-DataTable__fixedCell{z-index:var(--haze-z-local-1);background:var(--haze-color-bg);position:sticky}tr:hover .haze-DataTable__fixedCell{background:var(--haze-color-bg-subtle)}tr .haze-DataTable__fixedCellSelected,tr:hover .haze-DataTable__fixedCellSelected{background:var(--haze-color-primary-subtle)}thead .haze-DataTable__fixedHeadCell{z-index:var(--haze-z-local-3)}.haze-DataTable__fixedLeftEdge{clip-path:inset(0 -8px 0 0);box-shadow:6px 0 8px -6px var(--haze-color-border)}.haze-DataTable__fixedRightEdge{clip-path:inset(0 0 0 -8px);box-shadow:-6px 0 8px -6px var(--haze-color-border)}.haze-DataTable__emptyCell{padding:0}.haze-DataTable__footer{margin-top:var(--haze-space-3);justify-content:flex-end;align-items:center;display:flex}.haze-DataTable__toolbar{-webkit-box-flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:var(--haze-space-2);margin-bottom:var(--haze-space-3);flex-wrap:wrap;display:flex}.haze-DataTable__footerMenu{-webkit-margin-end:auto;margin-inline-end:auto}.haze-DataTable__columnsTrigger{align-items:center;gap:var(--haze-space-1);padding:var(--haze-space-1) var(--haze-space-2);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);color:var(--haze-color-text);font-size:var(--haze-text-sm);font-family:var(--haze-font-sans);display:inline-flex}.haze-DataTable__columnsTrigger:hover{border-color:var(--haze-color-border-hover);background:var(--haze-color-bg-subtle)}.haze-DataTable__toggleRow{padding:var(--haze-space-1) var(--haze-space-2);border-radius:var(--haze-radius-sm);cursor:pointer;font-size:var(--haze-text-sm);align-items:center;display:flex}.haze-DataTable__toggleRow:hover{background:var(--haze-color-bg-subtle)}.haze-DataTable__resizeHandle{top:0;bottom:0;width:6px;z-index:var(--haze-z-local-1);cursor:col-resize;touch-action:none;border-radius:var(--haze-radius-sm);position:absolute;inset-inline-end:-3px}.haze-DataTable__resizeHandle:after{content:"";top:25%;bottom:25%;background:var(--haze-color-border);width:1px;position:absolute;inset-inline-end:2.5px}.haze-DataTable__resizeHandle:hover:after,.haze-DataTable__resizeHandle:focus-visible:after{background:var(--haze-color-primary);top:0;bottom:0}.haze-DataTable__resizeHandle:focus-visible{box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-DataTable__reorderGripClass{width:var(--haze-space-6);height:var(--haze-space-6);-webkit-margin-end:var(--haze-space-1);font:inherit;font-size:var(--haze-text-xs);color:var(--haze-color-text-muted);vertical-align:middle;border-radius:var(--haze-radius-sm);background:0 0;border:none;justify-content:center;align-items:center;margin-inline-end:var(--haze-space-1);padding:0;line-height:1;display:inline-flex}.haze-DataTable__reorderGripClass:hover{color:var(--haze-color-primary);background:var(--haze-color-bg-subtle)}.haze-DataTable__reorderGripClass:focus-visible{box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-DataTable__reorderItemClass{vertical-align:middle;display:inline-flex}.haze-DataTable__endSentinelClass{height:1px}.haze-DataTable__expander{width:var(--haze-space-5);height:var(--haze-space-5);-webkit-margin-end:var(--haze-space-1);color:var(--haze-color-text-muted);font-size:var(--haze-text-xs);vertical-align:middle;cursor:pointer;border-radius:var(--haze-radius-sm);background:0 0;border:none;justify-content:center;align-items:center;margin-inline-end:var(--haze-space-1);padding:0;display:inline-flex}.haze-DataTable__expander:hover{color:var(--haze-color-text);background:var(--haze-color-bg-subtle)}.haze-DataTable__expander:focus-visible{box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-DataTable__expanderIcon{-webkit-transition:-webkit-transform var(--haze-duration-fast) var(--haze-ease);transition:transform var(--haze-duration-fast) var(--haze-ease)}[aria-expanded=true] .haze-DataTable__expanderIcon{transform:rotate(90deg)}.haze-DataTable__panelCell{padding:var(--haze-space-3);background:var(--haze-color-bg-subtle)}.haze-DataTable__treeIndent{vertical-align:middle;display:inline-block}.haze-DataTable__summaryFoot td{padding:var(--haze-space-2) var(--haze-space-3);border-top:2px solid var(--haze-color-border);color:var(--haze-color-text);font-weight:var(--haze-weight-semibold);white-space:nowrap}.haze-DataTable__stickyFoot td{z-index:var(--haze-z-local-2);background:var(--haze-color-bg);box-shadow:var(--haze-shadow-sm);position:sticky;bottom:0}.haze-DataTable__editableCell{cursor:text}.haze-DataTable__navCell:focus-visible{box-shadow:inset 0 0 0 2px var(--haze-color-focus-ring);outline:none}.haze-DataTable__sizeSm>thead>tr>th,.haze-DataTable__sizeSm>tbody>tr>td:not([data-slot=panel-cell]):not([data-slot=empty-cell]),.haze-DataTable__sizeSm>tfoot>tr>td{padding:var(--haze-space-1) var(--haze-space-2)}.haze-DataTable__sizeLg>thead>tr>th,.haze-DataTable__sizeLg>tbody>tr>td:not([data-slot=panel-cell]):not([data-slot=empty-cell]),.haze-DataTable__sizeLg>tfoot>tr>td{padding:var(--haze-space-3) var(--haze-space-4)}
|
|
5
5
|
.haze-column-filter__filterTrigger{-webkit-margin-start:var(--haze-space-1);font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;align-items:center;margin-inline-start:var(--haze-space-1);padding:0;display:inline-flex}.haze-column-filter__filterTrigger:hover [data-slot=icon],.haze-column-filter__filterTrigger:focus-visible [data-slot=icon]{color:var(--haze-color-primary)}.haze-column-filter__filterTrigger:focus-visible{border-radius:var(--haze-radius-sm);box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-column-filter__filterIcon{font-size:var(--haze-text-xs);color:var(--haze-color-text-muted)}.haze-column-filter__filterIconActive{color:var(--haze-color-primary)}.haze-column-filter__filterMenu{gap:var(--haze-space-2);flex-direction:column;display:flex}.haze-column-filter__filterOptions{gap:var(--haze-space-1);flex-direction:column;display:flex}.haze-column-filter__filterActions{justify-content:flex-end;gap:var(--haze-space-2);display:flex}
|
|
6
6
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/* haze-ui follow-up-suggestions — generated by scripts/split-css.mjs, do not edit */
|
|
2
|
+
@layer haze {
|
|
3
|
+
.haze-FollowUpSuggestions__list{-webkit-box-flex-wrap:wrap;align-items:center;gap:var(--haze-space-2);flex-wrap:wrap;display:flex}.haze-FollowUpSuggestions__item{display:flex}
|
|
4
|
+
}
|