@vuer-ai/vuer-uikit 0.0.75 → 0.0.77
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/{chunk-P27TWGME.cjs → chunk-33ZAFHOY.cjs} +2 -2
- package/dist/{chunk-IZFHHQ6S.mjs → chunk-3HERIMKO.mjs} +2 -2
- package/dist/chunk-3LM4LVYM.mjs +187 -0
- package/dist/chunk-6E4NTY34.cjs +494 -0
- package/dist/{chunk-VNYP2IVJ.cjs → chunk-7644AY3P.cjs} +2 -2
- package/dist/chunk-AHNVEAOM.cjs +855 -0
- package/dist/{chunk-5432JOTN.mjs → chunk-AOAM6HV2.mjs} +2 -2
- package/dist/chunk-BWBBQCG2.mjs +217 -0
- package/dist/{chunk-P5T6EVSQ.mjs → chunk-CSSMBHBD.mjs} +1 -1
- package/dist/chunk-CW6FHIAT.cjs +624 -0
- package/dist/chunk-D4W2G6CY.cjs +494 -0
- package/dist/{chunk-NS2P4CPA.mjs → chunk-D5YKZOUG.mjs} +4 -4
- package/dist/{chunk-2274XZ2C.cjs → chunk-E6D3BSYY.cjs} +6 -6
- package/dist/chunk-HOJOWLJT.mjs +142 -0
- package/dist/chunk-HTAFERCZ.mjs +1 -0
- package/dist/chunk-HTHCG2AN.cjs +125 -0
- package/dist/chunk-HVVT3D2T.mjs +1 -0
- package/dist/chunk-IZJYFVS7.mjs +15 -0
- package/dist/chunk-KFPS5CCR.cjs +2 -0
- package/dist/chunk-KQXLV6YW.mjs +489 -0
- package/dist/chunk-LBENVTO2.mjs +853 -0
- package/dist/chunk-MMT74K7A.mjs +247 -0
- package/dist/chunk-NEOSSUNE.mjs +599 -0
- package/dist/chunk-OEM5OJDP.mjs +489 -0
- package/dist/chunk-RM7E3WGH.cjs +71 -0
- package/dist/chunk-SYXRPCBO.cjs +220 -0
- package/dist/chunk-TE5JNR5C.mjs +117 -0
- package/dist/chunk-UHDBWDHS.cjs +190 -0
- package/dist/{chunk-Z5P6VCGR.cjs → chunk-V2OROE7H.cjs} +2 -2
- package/dist/chunk-VOTZLQ6J.cjs +2 -0
- package/dist/chunk-W4CDQ2RJ.mjs +69 -0
- package/dist/chunk-XKIB3LSS.cjs +167 -0
- package/dist/chunk-YPQYI63K.cjs +249 -0
- package/dist/chunk-ZO3X2NDT.cjs +21 -0
- package/dist/highlight-cursor/enhanced-components.cjs +8 -8
- package/dist/highlight-cursor/enhanced-components.mjs +3 -3
- package/dist/highlight-cursor/index.cjs +12 -12
- package/dist/highlight-cursor/index.mjs +3 -3
- package/dist/index.cjs +442 -417
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +43 -38
- package/dist/ui/UIKitBadge.cjs +5 -5
- package/dist/ui/UIKitBadge.mjs +1 -1
- package/dist/ui/badge.d.cts +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/index.cjs +362 -337
- package/dist/ui/index.d.cts +6 -2
- package/dist/ui/index.d.ts +6 -2
- package/dist/ui/index.mjs +42 -37
- package/dist/ui/inputs/index.cjs +5 -5
- package/dist/ui/inputs/index.mjs +1 -1
- package/dist/ui/inputs/input.d.cts +1 -1
- package/dist/ui/inputs/input.d.ts +1 -1
- package/dist/ui/layouts/index.cjs +6 -6
- package/dist/ui/layouts/index.mjs +2 -2
- package/dist/ui/pagination.cjs +9 -9
- package/dist/ui/pagination.mjs +2 -2
- package/dist/ui/select.d.cts +1 -1
- package/dist/ui/select.d.ts +1 -1
- package/dist/ui/sidebar.cjs +26 -26
- package/dist/ui/sidebar.mjs +2 -2
- package/dist/ui/{tree-view.cjs → simple-tree-view.cjs} +3 -3
- package/dist/ui/{tree-view.d.cts → simple-tree-view.d.cts} +1 -1
- package/dist/ui/{tree-view.d.ts → simple-tree-view.d.ts} +1 -1
- package/dist/ui/{tree-view.mjs → simple-tree-view.mjs} +1 -1
- package/dist/ui/tabs.cjs +6 -6
- package/dist/ui/tabs.mjs +2 -2
- package/dist/ui/textarea.d.cts +1 -1
- package/dist/ui/textarea.d.ts +1 -1
- package/dist/ui/timeline.cjs +4 -4
- package/dist/ui/timeline.d.cts +1 -1
- package/dist/ui/timeline.d.ts +1 -1
- package/dist/ui/timeline.mjs +3 -3
- package/dist/ui/tree-view/TreeSearchBar.cjs +22 -0
- package/dist/ui/tree-view/TreeSearchBar.d.cts +16 -0
- package/dist/ui/tree-view/TreeSearchBar.d.ts +16 -0
- package/dist/ui/tree-view/TreeSearchBar.mjs +13 -0
- package/dist/ui/tree-view/TreeView.cjs +24 -0
- package/dist/ui/tree-view/TreeView.d.cts +48 -0
- package/dist/ui/tree-view/TreeView.d.ts +48 -0
- package/dist/ui/tree-view/TreeView.mjs +11 -0
- package/dist/ui/tree-view/hooks.cjs +14 -0
- package/dist/ui/tree-view/hooks.d.cts +38 -0
- package/dist/ui/tree-view/hooks.d.ts +38 -0
- package/dist/ui/tree-view/hooks.mjs +1 -0
- package/dist/ui/tree-view/index.cjs +42 -0
- package/dist/ui/tree-view/index.d.cts +6 -0
- package/dist/ui/tree-view/index.d.ts +6 -0
- package/dist/ui/tree-view/index.mjs +17 -0
- package/dist/ui/tree-view/types.cjs +4 -0
- package/dist/ui/tree-view/types.d.cts +24 -0
- package/dist/ui/tree-view/types.d.ts +24 -0
- package/dist/ui/tree-view/types.mjs +1 -0
- package/dist/ui/tree-view-legacy.cjs +37 -0
- package/dist/ui/tree-view-legacy.d.cts +108 -0
- package/dist/ui/tree-view-legacy.d.ts +108 -0
- package/dist/ui/{tree-view-v2.mjs → tree-view-legacy.mjs} +2 -2
- package/dist/ui/waterfall/TimelineEvent.d.cts +1 -1
- package/dist/ui/waterfall/TimelineEvent.d.ts +1 -1
- package/dist/ui/waterfall/TimelineProcessBar.d.cts +1 -1
- package/dist/ui/waterfall/TimelineProcessBar.d.ts +1 -1
- package/dist/ui/waterfall/Wedges.d.cts +1 -1
- package/dist/ui/waterfall/Wedges.d.ts +1 -1
- package/dist/ui/waterfall/hooks/useTimelineState.d.cts +1 -2
- package/dist/ui/waterfall/hooks/useTimelineState.d.ts +1 -2
- package/dist/ui/waterfall/hooks/useViewport.d.cts +1 -2
- package/dist/ui/waterfall/hooks/useViewport.d.ts +1 -2
- package/dist/ui/waterfall/index.cjs +6 -6
- package/dist/ui/waterfall/index.d.cts +1 -1
- package/dist/ui/waterfall/index.d.ts +1 -1
- package/dist/ui/waterfall/index.mjs +5 -5
- package/dist/ui/waterfall/types.d.cts +1 -2
- package/dist/ui/waterfall/types.d.ts +1 -2
- package/package.json +1 -1
- package/dist/chunk-FD5AAGON.cjs +0 -487
- package/dist/chunk-ILGNKXK2.mjs +0 -485
- package/dist/ui/tree-view-v2.cjs +0 -25
- package/dist/ui/tree-view-v2.d.cts +0 -43
- package/dist/ui/tree-view-v2.d.ts +0 -43
- /package/dist/{chunk-SUABRIFA.mjs → chunk-2SWBXWLK.mjs} +0 -0
- /package/dist/{chunk-XMUP5MIM.mjs → chunk-G3EIVAVR.mjs} +0 -0
- /package/dist/{chunk-OX2U5RAG.cjs → chunk-G5NT42YF.cjs} +0 -0
- /package/dist/{chunk-J5DLIKNB.cjs → chunk-X2A7TKER.cjs} +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
// src/ui/tree-view/hooks.tsx
|
|
7
|
+
function useTreeSearch({
|
|
8
|
+
data,
|
|
9
|
+
searchQuery,
|
|
10
|
+
isCaseSensitive = false,
|
|
11
|
+
isRegex = false
|
|
12
|
+
}) {
|
|
13
|
+
const [isRegexValid, setIsRegexValid] = react.useState(true);
|
|
14
|
+
const { filteredData, matchingIds, searchResultsCount } = react.useMemo(() => {
|
|
15
|
+
const dataMap = new Map(data.map((item) => [item.id, item]));
|
|
16
|
+
if (!searchQuery) {
|
|
17
|
+
return {
|
|
18
|
+
filteredData: data,
|
|
19
|
+
matchingIds: /* @__PURE__ */ new Set(),
|
|
20
|
+
searchResultsCount: 0
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const matchingAndAncestorIds = /* @__PURE__ */ new Set();
|
|
24
|
+
const directMatchIds = /* @__PURE__ */ new Set();
|
|
25
|
+
let regex = null;
|
|
26
|
+
if (isRegex) {
|
|
27
|
+
try {
|
|
28
|
+
regex = new RegExp(searchQuery, isCaseSensitive ? "" : "i");
|
|
29
|
+
if (!isRegexValid) setIsRegexValid(true);
|
|
30
|
+
} catch {
|
|
31
|
+
if (isRegexValid) setIsRegexValid(false);
|
|
32
|
+
return {
|
|
33
|
+
filteredData: [],
|
|
34
|
+
matchingIds: /* @__PURE__ */ new Set(),
|
|
35
|
+
searchResultsCount: 0
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
data.forEach((item) => {
|
|
40
|
+
let labelMatches = false;
|
|
41
|
+
if (regex) {
|
|
42
|
+
labelMatches = regex.test(item.label);
|
|
43
|
+
} else {
|
|
44
|
+
const source = isCaseSensitive ? item.label : item.label.toLowerCase();
|
|
45
|
+
const query = isCaseSensitive ? searchQuery : searchQuery.toLowerCase();
|
|
46
|
+
labelMatches = source.includes(query);
|
|
47
|
+
}
|
|
48
|
+
if (labelMatches) {
|
|
49
|
+
directMatchIds.add(item.id);
|
|
50
|
+
matchingAndAncestorIds.add(item.id);
|
|
51
|
+
let current = item.parentId;
|
|
52
|
+
while (current) {
|
|
53
|
+
const parent = dataMap.get(current);
|
|
54
|
+
if (parent) {
|
|
55
|
+
matchingAndAncestorIds.add(parent.id);
|
|
56
|
+
current = parent.parentId;
|
|
57
|
+
} else {
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const filtered = data.filter((item) => matchingAndAncestorIds.has(item.id));
|
|
64
|
+
return {
|
|
65
|
+
filteredData: filtered,
|
|
66
|
+
matchingIds: directMatchIds,
|
|
67
|
+
searchResultsCount: directMatchIds.size
|
|
68
|
+
};
|
|
69
|
+
}, [searchQuery, data, isCaseSensitive, isRegex, isRegexValid]);
|
|
70
|
+
const renderLabel = react.useCallback((label, itemId) => {
|
|
71
|
+
if (!searchQuery || !isRegexValid || !matchingIds.has(itemId)) {
|
|
72
|
+
return label;
|
|
73
|
+
}
|
|
74
|
+
let regex;
|
|
75
|
+
try {
|
|
76
|
+
regex = new RegExp(`(${searchQuery})`, isCaseSensitive ? "g" : "gi");
|
|
77
|
+
} catch {
|
|
78
|
+
return label;
|
|
79
|
+
}
|
|
80
|
+
const parts = label.split(regex);
|
|
81
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: parts.map(
|
|
82
|
+
(part, i) => i % 2 === 1 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-uk-xs bg-accent-warning", children: part }, i) : part
|
|
83
|
+
) });
|
|
84
|
+
}, [searchQuery, isCaseSensitive, isRegexValid, matchingIds]);
|
|
85
|
+
return {
|
|
86
|
+
filteredData,
|
|
87
|
+
searchResultsCount,
|
|
88
|
+
isRegexValid,
|
|
89
|
+
renderLabel,
|
|
90
|
+
hasActiveSearch: !!searchQuery
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function useTreeState({
|
|
94
|
+
data,
|
|
95
|
+
defaultExpanded = true,
|
|
96
|
+
expandedItems: externalExpandedItems,
|
|
97
|
+
onToggleItem: externalOnToggleItem
|
|
98
|
+
}) {
|
|
99
|
+
const [internalExpandedItems, setInternalExpandedItems] = react.useState(() => {
|
|
100
|
+
const initial = /* @__PURE__ */ new Set();
|
|
101
|
+
if (defaultExpanded) {
|
|
102
|
+
data.forEach((item) => {
|
|
103
|
+
if (item.isCollapsible) initial.add(item.id);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return initial;
|
|
107
|
+
});
|
|
108
|
+
const expandedItems = externalExpandedItems ?? internalExpandedItems;
|
|
109
|
+
const toggleItem = react.useCallback((id) => {
|
|
110
|
+
if (externalOnToggleItem) {
|
|
111
|
+
externalOnToggleItem(id);
|
|
112
|
+
} else {
|
|
113
|
+
setInternalExpandedItems((prev) => {
|
|
114
|
+
const newSet = new Set(prev);
|
|
115
|
+
if (newSet.has(id)) {
|
|
116
|
+
newSet.delete(id);
|
|
117
|
+
} else {
|
|
118
|
+
newSet.add(id);
|
|
119
|
+
}
|
|
120
|
+
return newSet;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}, [externalOnToggleItem]);
|
|
124
|
+
const expandAll = react.useCallback(() => {
|
|
125
|
+
const allCollapsible = /* @__PURE__ */ new Set();
|
|
126
|
+
data.forEach((item) => {
|
|
127
|
+
if (item.isCollapsible) allCollapsible.add(item.id);
|
|
128
|
+
});
|
|
129
|
+
if (externalExpandedItems) {
|
|
130
|
+
allCollapsible.forEach((id) => {
|
|
131
|
+
if (!expandedItems.has(id) && externalOnToggleItem) {
|
|
132
|
+
externalOnToggleItem(id);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
} else {
|
|
136
|
+
setInternalExpandedItems(allCollapsible);
|
|
137
|
+
}
|
|
138
|
+
}, [data, expandedItems, externalExpandedItems, externalOnToggleItem]);
|
|
139
|
+
const collapseAll = react.useCallback(() => {
|
|
140
|
+
if (externalExpandedItems) {
|
|
141
|
+
expandedItems.forEach((id) => {
|
|
142
|
+
if (externalOnToggleItem) {
|
|
143
|
+
externalOnToggleItem(id);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
} else {
|
|
147
|
+
setInternalExpandedItems(/* @__PURE__ */ new Set());
|
|
148
|
+
}
|
|
149
|
+
}, [expandedItems, externalExpandedItems, externalOnToggleItem]);
|
|
150
|
+
const childrenMap = react.useMemo(() => {
|
|
151
|
+
const map = /* @__PURE__ */ new Map();
|
|
152
|
+
data.forEach((item) => {
|
|
153
|
+
if (!map.has(item.parentId)) {
|
|
154
|
+
map.set(item.parentId, []);
|
|
155
|
+
}
|
|
156
|
+
map.get(item.parentId).push(item);
|
|
157
|
+
});
|
|
158
|
+
return map;
|
|
159
|
+
}, [data]);
|
|
160
|
+
const hasDescendants = react.useCallback((itemId) => {
|
|
161
|
+
return (childrenMap.get(itemId) || []).length > 0;
|
|
162
|
+
}, [childrenMap]);
|
|
163
|
+
const dataWithMeta = react.useMemo(() => {
|
|
164
|
+
const dataMap = new Map(data.map((item) => [item.id, item]));
|
|
165
|
+
const getAncestors = (item) => {
|
|
166
|
+
const ancestors = [];
|
|
167
|
+
let current = item.parentId;
|
|
168
|
+
while (current) {
|
|
169
|
+
const parent = dataMap.get(current);
|
|
170
|
+
if (parent) {
|
|
171
|
+
ancestors.unshift(parent);
|
|
172
|
+
current = parent.parentId;
|
|
173
|
+
} else {
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return ancestors;
|
|
178
|
+
};
|
|
179
|
+
const sortedData = [];
|
|
180
|
+
const visited = /* @__PURE__ */ new Set();
|
|
181
|
+
const traverseNode = (nodeId) => {
|
|
182
|
+
const children = childrenMap.get(nodeId) || [];
|
|
183
|
+
children.forEach((child) => {
|
|
184
|
+
if (!visited.has(child.id)) {
|
|
185
|
+
visited.add(child.id);
|
|
186
|
+
sortedData.push(child);
|
|
187
|
+
traverseNode(child.id);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
traverseNode(null);
|
|
192
|
+
return sortedData.map((item) => {
|
|
193
|
+
const siblings = childrenMap.get(item.parentId) || [];
|
|
194
|
+
const isLast = siblings.length > 0 && siblings[siblings.length - 1].id === item.id;
|
|
195
|
+
const ancestors = getAncestors(item);
|
|
196
|
+
const indent = ancestors.length;
|
|
197
|
+
return { ...item, indent, isLast, ancestors };
|
|
198
|
+
});
|
|
199
|
+
}, [data, childrenMap]);
|
|
200
|
+
const visibleData = react.useMemo(() => {
|
|
201
|
+
const isVisible = (item) => {
|
|
202
|
+
return item.ancestors.every(
|
|
203
|
+
(ancestor) => !ancestor.isCollapsible || expandedItems.has(ancestor.id)
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
return dataWithMeta.filter(isVisible);
|
|
207
|
+
}, [dataWithMeta, expandedItems]);
|
|
208
|
+
return {
|
|
209
|
+
visibleData,
|
|
210
|
+
expandedItems,
|
|
211
|
+
toggleItem,
|
|
212
|
+
expandAll,
|
|
213
|
+
collapseAll,
|
|
214
|
+
hasDescendants,
|
|
215
|
+
dataWithMeta
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
exports.useTreeSearch = useTreeSearch;
|
|
220
|
+
exports.useTreeState = useTreeState;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { buttonVariants } from './chunk-INHZ5D7P.mjs';
|
|
2
|
+
import { cn } from './chunk-HMN4IKTG.mjs';
|
|
3
|
+
import { useTabsCursor, TabsCursorProvider } from './chunk-XMG3IVGZ.mjs';
|
|
4
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function Pagination({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
"nav",
|
|
10
|
+
{
|
|
11
|
+
role: "navigation",
|
|
12
|
+
"aria-label": "pagination",
|
|
13
|
+
"data-slot": "pagination",
|
|
14
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function PaginationContent({ className, ...props }) {
|
|
20
|
+
const { setCursorTarget } = useTabsCursor();
|
|
21
|
+
return /* @__PURE__ */ jsx(TabsCursorProvider, { children: /* @__PURE__ */ jsx(
|
|
22
|
+
"ul",
|
|
23
|
+
{
|
|
24
|
+
onMouseLeave: () => setCursorTarget(null),
|
|
25
|
+
"data-slot": "pagination-content",
|
|
26
|
+
className: cn("gap-xs flex flex-row items-center", className),
|
|
27
|
+
style: {
|
|
28
|
+
marginBottom: "0px"
|
|
29
|
+
},
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
) });
|
|
33
|
+
}
|
|
34
|
+
function PaginationItem({ ...props }) {
|
|
35
|
+
const { setCursorTarget } = useTabsCursor();
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
"li",
|
|
38
|
+
{
|
|
39
|
+
onMouseEnter: (e) => setCursorTarget(e.currentTarget),
|
|
40
|
+
"data-slot": "pagination-item",
|
|
41
|
+
className: "rounded-uk-sm",
|
|
42
|
+
style: {
|
|
43
|
+
marginBottom: "0px"
|
|
44
|
+
},
|
|
45
|
+
...props
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function PaginationLink({ className, isActive, size = "md", ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
"a",
|
|
52
|
+
{
|
|
53
|
+
"aria-current": isActive ? "page" : void 0,
|
|
54
|
+
"data-slot": "pagination-link",
|
|
55
|
+
"data-active": isActive,
|
|
56
|
+
className: cn(
|
|
57
|
+
buttonVariants({
|
|
58
|
+
variant: isActive ? "secondary" : "ghost",
|
|
59
|
+
size
|
|
60
|
+
}),
|
|
61
|
+
"hover:bg-transparent",
|
|
62
|
+
"hover:text-text-primary",
|
|
63
|
+
"min-w-[32px]",
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
...props
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
function PaginationPrevious({ className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsxs(
|
|
72
|
+
PaginationLink,
|
|
73
|
+
{
|
|
74
|
+
"aria-label": "Go to previous page",
|
|
75
|
+
className: cn("gap-xs px-lg sm:pl-lg", className),
|
|
76
|
+
...props,
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ jsx(ChevronLeftIcon, {}),
|
|
79
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: "Previous" })
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
function PaginationNext({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsxs(
|
|
86
|
+
PaginationLink,
|
|
87
|
+
{
|
|
88
|
+
"aria-label": "Go to next page",
|
|
89
|
+
className: cn("gap-xs px-lg sm:pr-lg", className),
|
|
90
|
+
...props,
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: "Next" }),
|
|
93
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function PaginationEllipsis({ className, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsxs(
|
|
100
|
+
"span",
|
|
101
|
+
{
|
|
102
|
+
"aria-hidden": true,
|
|
103
|
+
"data-slot": "pagination-ellipsis",
|
|
104
|
+
className: cn(
|
|
105
|
+
"text-text-primary flex size-9 size-[32px] items-center justify-center",
|
|
106
|
+
className
|
|
107
|
+
),
|
|
108
|
+
...props,
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }),
|
|
111
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkOHIB3TEN_cjs = require('./chunk-OHIB3TEN.cjs');
|
|
4
|
+
var lucideReact = require('lucide-react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function TreeView({
|
|
8
|
+
data,
|
|
9
|
+
getIcon,
|
|
10
|
+
expandedItems,
|
|
11
|
+
onToggleItem,
|
|
12
|
+
onItemHover,
|
|
13
|
+
hoveredId,
|
|
14
|
+
isSelectable = false,
|
|
15
|
+
selectedItemId,
|
|
16
|
+
onSelectChange,
|
|
17
|
+
alwaysShowExpand = false,
|
|
18
|
+
hasDescendants = () => false,
|
|
19
|
+
renderLabel = (label) => label,
|
|
20
|
+
className
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkOHIB3TEN_cjs.cn("flex-1 overflow-y-auto", className), children: data.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
+
TreeEntryItem,
|
|
24
|
+
{
|
|
25
|
+
item,
|
|
26
|
+
hoveredId,
|
|
27
|
+
onItemHover,
|
|
28
|
+
isSelectable,
|
|
29
|
+
selectedItemId,
|
|
30
|
+
onSelectChange,
|
|
31
|
+
expandedItems,
|
|
32
|
+
toggleItem: onToggleItem,
|
|
33
|
+
alwaysShowExpand,
|
|
34
|
+
hasDescendants,
|
|
35
|
+
getIcon,
|
|
36
|
+
renderLabel,
|
|
37
|
+
dataWithMeta: data
|
|
38
|
+
},
|
|
39
|
+
item.id
|
|
40
|
+
)) });
|
|
41
|
+
}
|
|
42
|
+
function TreeEntryItem({
|
|
43
|
+
item,
|
|
44
|
+
hoveredId,
|
|
45
|
+
onItemHover,
|
|
46
|
+
isSelectable,
|
|
47
|
+
selectedItemId,
|
|
48
|
+
onSelectChange,
|
|
49
|
+
expandedItems,
|
|
50
|
+
toggleItem,
|
|
51
|
+
alwaysShowExpand,
|
|
52
|
+
hasDescendants,
|
|
53
|
+
getIcon,
|
|
54
|
+
renderLabel,
|
|
55
|
+
dataWithMeta
|
|
56
|
+
}) {
|
|
57
|
+
const handleItemSelect = () => {
|
|
58
|
+
if (!item.disable && isSelectable && onSelectChange) {
|
|
59
|
+
onSelectChange(selectedItemId === item.id ? null : item.id);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const ancestors = item.ancestors || [];
|
|
63
|
+
const indent = item.indent || 0;
|
|
64
|
+
const isLast = item.isLast !== void 0 ? item.isLast : false;
|
|
65
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: chunkOHIB3TEN_cjs.cn(
|
|
69
|
+
"group relative flex h-[32px] items-center",
|
|
70
|
+
isSelectable && "rounded-uk-md",
|
|
71
|
+
!item.disable && "cursor-pointer",
|
|
72
|
+
hoveredId === item.id && !item.disable && "bg-bg-secondary",
|
|
73
|
+
isSelectable && selectedItemId === item.id && "bg-brand-primary text-text-withbg"
|
|
74
|
+
),
|
|
75
|
+
onMouseEnter: () => onItemHover?.(item.id),
|
|
76
|
+
onMouseLeave: () => onItemHover?.(null),
|
|
77
|
+
onClick: handleItemSelect,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-0 left-[-0.28rem] z-0 flex h-full items-center", children: [
|
|
80
|
+
ancestors.map((ancestor, index) => {
|
|
81
|
+
const parentIsLast = dataWithMeta.find((d) => d.id === ancestor.id)?.isLast;
|
|
82
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: chunkOHIB3TEN_cjs.cn(
|
|
86
|
+
"h-full w-[1.25rem]",
|
|
87
|
+
parentIsLast ? "" : "border-l",
|
|
88
|
+
"border-line-primary"
|
|
89
|
+
)
|
|
90
|
+
},
|
|
91
|
+
index
|
|
92
|
+
);
|
|
93
|
+
}),
|
|
94
|
+
indent > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-full w-[1.24rem]", children: [
|
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
className: chunkOHIB3TEN_cjs.cn(
|
|
99
|
+
"absolute top-0 left-0 h-1/2 w-1/2 border-b border-l",
|
|
100
|
+
isLast ? "rounded-bl-md" : "",
|
|
101
|
+
"border-line-primary"
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
!isLast && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-line-primary absolute top-1/2 left-0 h-1/2 w-1/2 border-l" })
|
|
106
|
+
] })
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
className: "text-uk-md z-10 flex w-full items-center justify-between gap-2 px-2 whitespace-nowrap",
|
|
112
|
+
style: { paddingLeft: `${indent * 1.25 + 0.5}rem` },
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
115
|
+
alwaysShowExpand && hasDescendants(item.id) && !expandedItems.has(item.id) ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
116
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
117
|
+
"button",
|
|
118
|
+
{
|
|
119
|
+
onClick: (e) => {
|
|
120
|
+
e.stopPropagation();
|
|
121
|
+
toggleItem(item.id);
|
|
122
|
+
},
|
|
123
|
+
className: "flex size-4 cursor-pointer items-center justify-center",
|
|
124
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
125
|
+
lucideReact.ChevronDown,
|
|
126
|
+
{
|
|
127
|
+
className: chunkOHIB3TEN_cjs.cn(
|
|
128
|
+
"size-4 -rotate-90 transition-transform",
|
|
129
|
+
item.disable && "text-icon-tertiary"
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
className: chunkOHIB3TEN_cjs.cn(
|
|
139
|
+
"flex size-4 items-center justify-center",
|
|
140
|
+
item.disable && "text-icon-tertiary"
|
|
141
|
+
),
|
|
142
|
+
children: getIcon(item)
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex size-4 items-center justify-center", children: [
|
|
146
|
+
item.isCollapsible && /* @__PURE__ */ jsxRuntime.jsx(
|
|
147
|
+
"button",
|
|
148
|
+
{
|
|
149
|
+
onClick: (e) => {
|
|
150
|
+
e.stopPropagation();
|
|
151
|
+
toggleItem(item.id);
|
|
152
|
+
},
|
|
153
|
+
className: "absolute z-20 flex cursor-pointer items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",
|
|
154
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
155
|
+
lucideReact.ChevronDown,
|
|
156
|
+
{
|
|
157
|
+
className: chunkOHIB3TEN_cjs.cn(
|
|
158
|
+
"size-4 transition-transform",
|
|
159
|
+
!expandedItems.has(item.id) && "-rotate-90",
|
|
160
|
+
item.disable && "text-icon-tertiary"
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
className: chunkOHIB3TEN_cjs.cn(
|
|
170
|
+
"cursor-pointer transition-opacity",
|
|
171
|
+
item.isCollapsible && "group-hover:opacity-0",
|
|
172
|
+
item.disable && "text-icon-tertiary"
|
|
173
|
+
),
|
|
174
|
+
children: getIcon(item)
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkOHIB3TEN_cjs.cn("truncate", item.disable && "text-text-tertiary"), children: renderLabel(item.label, item.id) })
|
|
179
|
+
] }),
|
|
180
|
+
item.actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", onClick: (e) => e.stopPropagation(), children: item.actions })
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
exports.TreeEntryItem = TreeEntryItem;
|
|
190
|
+
exports.TreeView = TreeView;
|
|
@@ -4,9 +4,9 @@ var chunkOHIB3TEN_cjs = require('./chunk-OHIB3TEN.cjs');
|
|
|
4
4
|
var lucideReact = require('lucide-react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
|
-
var PACKAGE_VERSION = "0.0.
|
|
7
|
+
var PACKAGE_VERSION = "0.0.76" ;
|
|
8
8
|
var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
|
|
9
|
-
var GIT_HASH = "
|
|
9
|
+
var GIT_HASH = "d181b80" ;
|
|
10
10
|
function PackageBadge({
|
|
11
11
|
className,
|
|
12
12
|
packageName,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from './chunk-PCSY5IJ2.mjs';
|
|
2
|
+
import { InputRoot, InputSlot } from './chunk-JXALL32A.mjs';
|
|
3
|
+
import { cn } from './chunk-HMN4IKTG.mjs';
|
|
4
|
+
import { Search, CaseSensitive, Regex } from 'lucide-react';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function TreeSearchBar({
|
|
8
|
+
searchQuery,
|
|
9
|
+
setSearchQuery,
|
|
10
|
+
isCaseSensitive,
|
|
11
|
+
setIsCaseSensitive,
|
|
12
|
+
isRegex,
|
|
13
|
+
setIsRegex,
|
|
14
|
+
isRegexValid,
|
|
15
|
+
searchResultsCount,
|
|
16
|
+
className
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("shrink-0", className), children: [
|
|
19
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 py-1", children: /* @__PURE__ */ jsxs(
|
|
20
|
+
InputRoot,
|
|
21
|
+
{
|
|
22
|
+
type: "text",
|
|
23
|
+
placeholder: "Search...",
|
|
24
|
+
size: "md",
|
|
25
|
+
className: "flex-1",
|
|
26
|
+
inputClassName: cn(!isRegexValid && "text-red-500"),
|
|
27
|
+
value: searchQuery,
|
|
28
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx(InputSlot, { side: "left", children: /* @__PURE__ */ jsx(Search, { className: "text-text-secondary size-4 stroke-1" }) }),
|
|
31
|
+
/* @__PURE__ */ jsx(InputSlot, { side: "right", children: /* @__PURE__ */ jsxs(TooltipProvider, { delayDuration: 200, children: [
|
|
32
|
+
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
onClick: () => setIsCaseSensitive((prev) => !prev),
|
|
37
|
+
className: cn(
|
|
38
|
+
"rounded-uk-sm mr-1 p-1",
|
|
39
|
+
isCaseSensitive ? "bg-shadow-secondary" : ""
|
|
40
|
+
),
|
|
41
|
+
children: /* @__PURE__ */ jsx(CaseSensitive, { className: "size-4" })
|
|
42
|
+
}
|
|
43
|
+
) }),
|
|
44
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Case Sensitive" }) })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
onClick: () => setIsRegex((prev) => !prev),
|
|
51
|
+
className: cn("rounded-uk-sm p-1", isRegex && "bg-shadow-secondary"),
|
|
52
|
+
children: /* @__PURE__ */ jsx(Regex, { className: "size-4" })
|
|
53
|
+
}
|
|
54
|
+
) }),
|
|
55
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Use Regular Expression" }) })
|
|
56
|
+
] })
|
|
57
|
+
] }) })
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
) }),
|
|
61
|
+
searchQuery && isRegexValid && /* @__PURE__ */ jsx("div", { className: "flex justify-end px-2 pb-1", children: /* @__PURE__ */ jsxs("span", { className: "text-uk-xs text-text-secondary", children: [
|
|
62
|
+
searchResultsCount,
|
|
63
|
+
" result",
|
|
64
|
+
searchResultsCount !== 1 ? "s" : ""
|
|
65
|
+
] }) })
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { TreeSearchBar };
|