numori-ui 0.5.0 → 0.6.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/CHANGELOG.md +54 -0
- package/README.md +9 -1
- package/dist/components/Avatar.js +71 -19
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Dropdown.js +3 -1
- package/dist/components/Dropdown.js.map +1 -1
- package/dist/components/Modal.js +61 -4
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/Prompt.js +11 -6
- package/dist/components/Prompt.js.map +1 -1
- package/dist/components/Select.js +1 -1
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Skeleton.js +122 -0
- package/dist/components/Skeleton.js.map +1 -0
- package/dist/components/SplitPane.js +264 -0
- package/dist/components/SplitPane.js.map +1 -0
- package/dist/components/Tree.js +417 -0
- package/dist/components/Tree.js.map +1 -0
- package/dist/components/VirtualList.js +292 -0
- package/dist/components/VirtualList.js.map +1 -0
- package/dist/components/index.js +29 -22
- package/dist/components/index.js.map +1 -1
- package/dist/icons/mdi.js +2 -0
- package/dist/icons/mdi.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/dist/internal/focusTrap.js +163 -0
- package/dist/internal/focusTrap.js.map +1 -0
- package/dist/manifest.js +5 -1
- package/dist/manifest.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Avatar.vue +69 -18
- package/src/components/Dropdown.vue +4 -1
- package/src/components/Modal.vue +51 -3
- package/src/components/Prompt.vue +14 -3
- package/src/components/Select.vue +1 -1
- package/src/components/Skeleton.vue +91 -0
- package/src/components/SplitPane.vue +264 -0
- package/src/components/Tree.vue +428 -0
- package/src/components/VirtualList.vue +250 -0
- package/src/components/index.js +12 -1
- package/src/icons/mdi.js +2 -0
- package/src/internal/focusTrap.js +185 -0
- package/src/manifest.js +4 -0
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import _sfc_main$1 from "../icons/Icon.js";
|
|
2
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, renderSlot, toDisplayString, withModifiers } from "vue";
|
|
3
|
+
//#region src/components/Tree.vue
|
|
4
|
+
var _hoisted_1 = ["aria-label"];
|
|
5
|
+
var _hoisted_2 = [
|
|
6
|
+
"aria-level",
|
|
7
|
+
"aria-setsize",
|
|
8
|
+
"aria-posinset",
|
|
9
|
+
"aria-expanded",
|
|
10
|
+
"aria-selected",
|
|
11
|
+
"aria-disabled",
|
|
12
|
+
"tabindex",
|
|
13
|
+
"draggable",
|
|
14
|
+
"onClick",
|
|
15
|
+
"onFocus",
|
|
16
|
+
"onContextmenu",
|
|
17
|
+
"onDragstart",
|
|
18
|
+
"onDragover",
|
|
19
|
+
"onDragleave",
|
|
20
|
+
"onDrop"
|
|
21
|
+
];
|
|
22
|
+
var _hoisted_3 = ["onClick"];
|
|
23
|
+
var _hoisted_4 = { class: "min-w-0 flex-1 truncate" };
|
|
24
|
+
var DRAG_TYPE = "application/x-numori-tree-node";
|
|
25
|
+
var _sfc_main = {
|
|
26
|
+
__name: "Tree",
|
|
27
|
+
props: {
|
|
28
|
+
/**
|
|
29
|
+
* The root nodes.
|
|
30
|
+
* @type {Array<{ id: string | number, label: string, icon?: string, badge?: string | number, disabled?: boolean, children?: Array<object> }>}
|
|
31
|
+
* @default []
|
|
32
|
+
*/
|
|
33
|
+
nodes: {
|
|
34
|
+
type: Array,
|
|
35
|
+
default: () => []
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Id of the selected node, for `v-model`.
|
|
39
|
+
* @type {string | number | null}
|
|
40
|
+
* @default null
|
|
41
|
+
*/
|
|
42
|
+
modelValue: {
|
|
43
|
+
type: [String, Number],
|
|
44
|
+
default: null
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* Ids of expanded nodes, for `v-model:expanded`. Leave unset to let the
|
|
48
|
+
* tree manage expansion itself.
|
|
49
|
+
* @type {Array<string | number>}
|
|
50
|
+
* @default undefined
|
|
51
|
+
*/
|
|
52
|
+
expanded: {
|
|
53
|
+
type: Array,
|
|
54
|
+
default: void 0
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Ids expanded initially when `expanded` is not bound.
|
|
58
|
+
* @type {Array<string | number>}
|
|
59
|
+
* @default []
|
|
60
|
+
*/
|
|
61
|
+
defaultExpanded: {
|
|
62
|
+
type: Array,
|
|
63
|
+
default: () => []
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Accessible name for the tree.
|
|
67
|
+
* @type {string}
|
|
68
|
+
* @default ''
|
|
69
|
+
*/
|
|
70
|
+
label: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: ""
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* Indentation per level, in pixels.
|
|
76
|
+
* @type {number}
|
|
77
|
+
* @default 16
|
|
78
|
+
*/
|
|
79
|
+
indent: {
|
|
80
|
+
type: Number,
|
|
81
|
+
default: 16
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* Let rows be dragged.
|
|
85
|
+
* @type {boolean}
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
draggable: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Let rows accept drops: `true` for every enabled row, or a predicate
|
|
94
|
+
* `(node, event) => boolean`.
|
|
95
|
+
* @type {boolean | Function}
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
droppable: {
|
|
99
|
+
type: [Boolean, Function],
|
|
100
|
+
default: false
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
emits: [
|
|
104
|
+
"update:modelValue",
|
|
105
|
+
"update:expanded",
|
|
106
|
+
"select",
|
|
107
|
+
"drop",
|
|
108
|
+
"contextmenu"
|
|
109
|
+
],
|
|
110
|
+
setup(__props, { emit: __emit }) {
|
|
111
|
+
/**
|
|
112
|
+
* UiTree — a nested, collapsible, keyboard-navigable tree (folders, outlines,
|
|
113
|
+
* file browsers), following the WAI-ARIA tree view pattern.
|
|
114
|
+
*
|
|
115
|
+
* Nodes are plain objects:
|
|
116
|
+
* `{ id, label, icon?, badge?, disabled?, children?: Node[] }`.
|
|
117
|
+
* Only expanded branches are rendered, as a flat run of rows; each row carries
|
|
118
|
+
* `aria-level`, `aria-setsize` and `aria-posinset`, so assistive technology
|
|
119
|
+
* hears the structure without nested groups in the DOM.
|
|
120
|
+
*
|
|
121
|
+
* Keyboard (one tab stop for the whole tree, with a roving tabindex):
|
|
122
|
+
* Up / Down move between visible rows; Right expands, or moves to the first
|
|
123
|
+
* child; Left collapses, or moves to the parent; Home / End jump to the ends;
|
|
124
|
+
* Enter or Space selects; `*` expands every sibling; typing a few letters
|
|
125
|
+
* jumps to the next row whose label starts with them.
|
|
126
|
+
*
|
|
127
|
+
* Selection is `v-model` (a single node id). Expansion is `v-model:expanded`
|
|
128
|
+
* (an array of ids), or uncontrolled from `default-expanded`.
|
|
129
|
+
*
|
|
130
|
+
* Drag and drop is opt-in. `draggable` lets rows be picked up; `droppable`
|
|
131
|
+
* (true, or a predicate `(node, event) => boolean`) lets rows accept a drop —
|
|
132
|
+
* from this tree or from anywhere else, such as messages dragged out of a list.
|
|
133
|
+
* Hovering a collapsed branch during a drag opens it. The tree does not move
|
|
134
|
+
* anything itself: it emits `drop` and leaves the data to you.
|
|
135
|
+
*
|
|
136
|
+
* @example Mail folders
|
|
137
|
+
* <UiTree
|
|
138
|
+
* v-model="folderId"
|
|
139
|
+
* v-model:expanded="openFolders"
|
|
140
|
+
* :nodes="[
|
|
141
|
+
* { id: 'inbox', label: 'Inbox', icon: 'mdi:inbox', badge: 3 },
|
|
142
|
+
* { id: 'work', label: 'Work', icon: 'mdi:folder-outline', children: [
|
|
143
|
+
* { id: 'work/2026', label: '2026', icon: 'mdi:folder-outline' },
|
|
144
|
+
* ] },
|
|
145
|
+
* ]"
|
|
146
|
+
* label="Folders"
|
|
147
|
+
* droppable
|
|
148
|
+
* @drop="({ node, event }) => moveMessages(event.dataTransfer, node.id)"
|
|
149
|
+
* />
|
|
150
|
+
*
|
|
151
|
+
* @emits {string | number} update:modelValue — A node was selected (its id).
|
|
152
|
+
* @emits {Array<string | number>} update:expanded — The set of expanded ids changed.
|
|
153
|
+
* @emits {object} select — A node was selected (the node object).
|
|
154
|
+
* @emits {{ node: object, event: DragEvent, sourceId: string | number | null }} drop —
|
|
155
|
+
* Something was dropped on a row. `sourceId` is set when it was a row of this tree.
|
|
156
|
+
* @emits {{ node: object, event: MouseEvent }} contextmenu — A row was right-clicked.
|
|
157
|
+
*
|
|
158
|
+
* @slot item — Replaces a row's icon, label and badge (the disclosure arrow
|
|
159
|
+
* stays). Scope: `{ node, level, expanded, selected }`.
|
|
160
|
+
*/
|
|
161
|
+
const props = __props;
|
|
162
|
+
const emit = __emit;
|
|
163
|
+
/** MIME type a dragged row carries, so drops can tell tree rows from other data. */
|
|
164
|
+
const internalExpanded = ref(new Set(props.defaultExpanded));
|
|
165
|
+
const expandedSet = computed(() => props.expanded ? new Set(props.expanded) : internalExpanded.value);
|
|
166
|
+
function setExpanded(next) {
|
|
167
|
+
internalExpanded.value = next;
|
|
168
|
+
emit("update:expanded", [...next]);
|
|
169
|
+
}
|
|
170
|
+
function toggle(id, force) {
|
|
171
|
+
const next = new Set(expandedSet.value);
|
|
172
|
+
const open = force ?? !next.has(id);
|
|
173
|
+
if (open === next.has(id)) return;
|
|
174
|
+
if (open) next.add(id);
|
|
175
|
+
else next.delete(id);
|
|
176
|
+
setExpanded(next);
|
|
177
|
+
}
|
|
178
|
+
const rows = computed(() => {
|
|
179
|
+
const out = [];
|
|
180
|
+
const walk = (nodes, level, parentId) => {
|
|
181
|
+
nodes.forEach((node, i) => {
|
|
182
|
+
const hasChildren = Array.isArray(node.children) && node.children.length > 0;
|
|
183
|
+
const expanded = hasChildren && expandedSet.value.has(node.id);
|
|
184
|
+
out.push({
|
|
185
|
+
node,
|
|
186
|
+
level,
|
|
187
|
+
parentId,
|
|
188
|
+
hasChildren,
|
|
189
|
+
expanded,
|
|
190
|
+
setSize: nodes.length,
|
|
191
|
+
posInSet: i + 1
|
|
192
|
+
});
|
|
193
|
+
if (expanded) walk(node.children, level + 1, node.id);
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
walk(props.nodes, 1, null);
|
|
197
|
+
return out;
|
|
198
|
+
});
|
|
199
|
+
const userFocusId = ref(null);
|
|
200
|
+
const focusId = computed({
|
|
201
|
+
get() {
|
|
202
|
+
const ids = rows.value.map((r) => r.node.id);
|
|
203
|
+
if (userFocusId.value !== null && ids.includes(userFocusId.value)) return userFocusId.value;
|
|
204
|
+
if (props.modelValue !== null && ids.includes(props.modelValue)) return props.modelValue;
|
|
205
|
+
return rows.value.find((r) => !r.node.disabled)?.node.id ?? null;
|
|
206
|
+
},
|
|
207
|
+
set(id) {
|
|
208
|
+
userFocusId.value = id;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
const rowEls = /* @__PURE__ */ new Map();
|
|
212
|
+
const setRowRef = (id, el) => {
|
|
213
|
+
if (el) rowEls.set(id, el);
|
|
214
|
+
else rowEls.delete(id);
|
|
215
|
+
};
|
|
216
|
+
function focusRow(id) {
|
|
217
|
+
if (id === null || id === void 0) return;
|
|
218
|
+
focusId.value = id;
|
|
219
|
+
rowEls.get(id)?.focus();
|
|
220
|
+
}
|
|
221
|
+
function select(row) {
|
|
222
|
+
if (row.node.disabled) return;
|
|
223
|
+
emit("update:modelValue", row.node.id);
|
|
224
|
+
emit("select", row.node);
|
|
225
|
+
}
|
|
226
|
+
function onRowClick(row) {
|
|
227
|
+
focusId.value = row.node.id;
|
|
228
|
+
select(row);
|
|
229
|
+
}
|
|
230
|
+
let typeahead = "";
|
|
231
|
+
let typeaheadTimer = null;
|
|
232
|
+
function onKeydown(event) {
|
|
233
|
+
const list = rows.value;
|
|
234
|
+
const index = list.findIndex((r) => r.node.id === focusId.value);
|
|
235
|
+
if (index === -1) return;
|
|
236
|
+
const row = list[index];
|
|
237
|
+
const enabledFrom = (start, step) => {
|
|
238
|
+
for (let i = start; i >= 0 && i < list.length; i += step) if (!list[i].node.disabled) return list[i].node.id;
|
|
239
|
+
return null;
|
|
240
|
+
};
|
|
241
|
+
switch (event.key) {
|
|
242
|
+
case "ArrowDown":
|
|
243
|
+
event.preventDefault();
|
|
244
|
+
focusRow(enabledFrom(index + 1, 1));
|
|
245
|
+
return;
|
|
246
|
+
case "ArrowUp":
|
|
247
|
+
event.preventDefault();
|
|
248
|
+
focusRow(enabledFrom(index - 1, -1));
|
|
249
|
+
return;
|
|
250
|
+
case "Home":
|
|
251
|
+
event.preventDefault();
|
|
252
|
+
focusRow(enabledFrom(0, 1));
|
|
253
|
+
return;
|
|
254
|
+
case "End":
|
|
255
|
+
event.preventDefault();
|
|
256
|
+
focusRow(enabledFrom(list.length - 1, -1));
|
|
257
|
+
return;
|
|
258
|
+
case "ArrowRight":
|
|
259
|
+
event.preventDefault();
|
|
260
|
+
if (row.hasChildren && !row.expanded) toggle(row.node.id, true);
|
|
261
|
+
else if (row.expanded) focusRow(list[index + 1]?.node.id);
|
|
262
|
+
return;
|
|
263
|
+
case "ArrowLeft":
|
|
264
|
+
event.preventDefault();
|
|
265
|
+
if (row.expanded) toggle(row.node.id, false);
|
|
266
|
+
else focusRow(row.parentId);
|
|
267
|
+
return;
|
|
268
|
+
case "Enter":
|
|
269
|
+
case " ":
|
|
270
|
+
event.preventDefault();
|
|
271
|
+
select(row);
|
|
272
|
+
return;
|
|
273
|
+
case "*": {
|
|
274
|
+
event.preventDefault();
|
|
275
|
+
const next = new Set(expandedSet.value);
|
|
276
|
+
for (const sibling of list) if (sibling.parentId === row.parentId && sibling.hasChildren) next.add(sibling.node.id);
|
|
277
|
+
setExpanded(next);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
282
|
+
typeahead += event.key.toLowerCase();
|
|
283
|
+
clearTimeout(typeaheadTimer);
|
|
284
|
+
typeaheadTimer = setTimeout(() => typeahead = "", 500);
|
|
285
|
+
const ordered = [...list.slice(index + 1), ...list.slice(0, index + 1)];
|
|
286
|
+
const match = (typeahead.length > 1 ? [row, ...ordered] : ordered).find((r) => !r.node.disabled && String(r.node.label).toLowerCase().startsWith(typeahead));
|
|
287
|
+
if (match) focusRow(match.node.id);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const draggingId = ref(null);
|
|
291
|
+
const dropTargetId = ref(null);
|
|
292
|
+
let expandTimer = null;
|
|
293
|
+
function onDragStart(row, event) {
|
|
294
|
+
if (!props.draggable || row.node.disabled) return;
|
|
295
|
+
draggingId.value = row.node.id;
|
|
296
|
+
event.dataTransfer.effectAllowed = "move";
|
|
297
|
+
event.dataTransfer.setData(DRAG_TYPE, String(row.node.id));
|
|
298
|
+
event.dataTransfer.setData("text/plain", String(row.node.label));
|
|
299
|
+
}
|
|
300
|
+
function onDragEnd() {
|
|
301
|
+
draggingId.value = null;
|
|
302
|
+
dropTargetId.value = null;
|
|
303
|
+
clearTimeout(expandTimer);
|
|
304
|
+
}
|
|
305
|
+
function accepts(row, event) {
|
|
306
|
+
if (!props.droppable || row.node.disabled) return false;
|
|
307
|
+
if (draggingId.value !== null && draggingId.value === row.node.id) return false;
|
|
308
|
+
return typeof props.droppable === "function" ? !!props.droppable(row.node, event) : true;
|
|
309
|
+
}
|
|
310
|
+
function onDragOver(row, event) {
|
|
311
|
+
if (!accepts(row, event)) return;
|
|
312
|
+
event.preventDefault();
|
|
313
|
+
if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
|
|
314
|
+
if (dropTargetId.value !== row.node.id) {
|
|
315
|
+
dropTargetId.value = row.node.id;
|
|
316
|
+
clearTimeout(expandTimer);
|
|
317
|
+
if (row.hasChildren && !row.expanded) expandTimer = setTimeout(() => toggle(row.node.id, true), 700);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function onDragLeave(row, event) {
|
|
321
|
+
if (event.currentTarget.contains(event.relatedTarget)) return;
|
|
322
|
+
if (dropTargetId.value === row.node.id) {
|
|
323
|
+
dropTargetId.value = null;
|
|
324
|
+
clearTimeout(expandTimer);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function onDrop(row, event) {
|
|
328
|
+
if (!accepts(row, event)) return;
|
|
329
|
+
event.preventDefault();
|
|
330
|
+
const raw = event.dataTransfer?.getData(DRAG_TYPE);
|
|
331
|
+
const source = raw ? draggingId.value ?? raw : null;
|
|
332
|
+
dropTargetId.value = null;
|
|
333
|
+
clearTimeout(expandTimer);
|
|
334
|
+
emit("drop", {
|
|
335
|
+
node: row.node,
|
|
336
|
+
event,
|
|
337
|
+
sourceId: source
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
onBeforeUnmount(() => {
|
|
341
|
+
clearTimeout(expandTimer);
|
|
342
|
+
clearTimeout(typeaheadTimer);
|
|
343
|
+
});
|
|
344
|
+
function rowClass(row) {
|
|
345
|
+
return [
|
|
346
|
+
row.node.id === props.modelValue ? "bg-primary-50 text-primary-700 dark:bg-primary-400/10 dark:text-primary-200" : "text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-gray-100",
|
|
347
|
+
row.node.disabled ? "pointer-events-none opacity-40" : "cursor-pointer",
|
|
348
|
+
dropTargetId.value === row.node.id ? "ring-2 ring-inset ring-primary-400 dark:ring-primary-500" : "",
|
|
349
|
+
draggingId.value === row.node.id ? "opacity-50" : ""
|
|
350
|
+
].join(" ");
|
|
351
|
+
}
|
|
352
|
+
return (_ctx, _cache) => {
|
|
353
|
+
return openBlock(), createElementBlock("div", {
|
|
354
|
+
role: "tree",
|
|
355
|
+
"aria-label": __props.label || void 0,
|
|
356
|
+
class: "flex flex-col gap-px",
|
|
357
|
+
onKeydown
|
|
358
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row) => {
|
|
359
|
+
return openBlock(), createElementBlock("div", {
|
|
360
|
+
key: row.node.id,
|
|
361
|
+
ref_for: true,
|
|
362
|
+
ref: (el) => setRowRef(row.node.id, el),
|
|
363
|
+
role: "treeitem",
|
|
364
|
+
"aria-level": row.level,
|
|
365
|
+
"aria-setsize": row.setSize,
|
|
366
|
+
"aria-posinset": row.posInSet,
|
|
367
|
+
"aria-expanded": row.hasChildren ? row.expanded ? "true" : "false" : void 0,
|
|
368
|
+
"aria-selected": row.node.id === __props.modelValue ? "true" : "false",
|
|
369
|
+
"aria-disabled": row.node.disabled ? "true" : void 0,
|
|
370
|
+
tabindex: row.node.id === focusId.value ? 0 : -1,
|
|
371
|
+
draggable: __props.draggable && !row.node.disabled ? "true" : void 0,
|
|
372
|
+
class: normalizeClass(["group flex w-full items-center gap-2 rounded-lg py-1.5 pr-3 text-left text-sm font-medium transition-colors select-none focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary-500 dark:focus-visible:outline-primary-400", rowClass(row)]),
|
|
373
|
+
style: normalizeStyle({ paddingLeft: `${8 + (row.level - 1) * __props.indent}px` }),
|
|
374
|
+
onClick: ($event) => onRowClick(row),
|
|
375
|
+
onFocus: ($event) => focusId.value = row.node.id,
|
|
376
|
+
onContextmenu: ($event) => emit("contextmenu", {
|
|
377
|
+
node: row.node,
|
|
378
|
+
event: $event
|
|
379
|
+
}),
|
|
380
|
+
onDragstart: ($event) => onDragStart(row, $event),
|
|
381
|
+
onDragend: onDragEnd,
|
|
382
|
+
onDragover: ($event) => onDragOver(row, $event),
|
|
383
|
+
onDragleave: ($event) => onDragLeave(row, $event),
|
|
384
|
+
onDrop: ($event) => onDrop(row, $event)
|
|
385
|
+
}, [createElementVNode("span", {
|
|
386
|
+
class: normalizeClass(["-my-1 inline-flex size-5 shrink-0 items-center justify-center rounded text-gray-400 dark:text-gray-500", row.hasChildren ? "hover:bg-gray-200 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-gray-200" : ""]),
|
|
387
|
+
"aria-hidden": "true",
|
|
388
|
+
onClick: withModifiers(($event) => row.hasChildren && toggle(row.node.id), ["stop"])
|
|
389
|
+
}, [row.hasChildren ? (openBlock(), createBlock(_sfc_main$1, {
|
|
390
|
+
key: 0,
|
|
391
|
+
name: "mdi:chevron-right",
|
|
392
|
+
class: normalizeClass(["size-4 transition-transform motion-reduce:transition-none", row.expanded ? "rotate-90" : ""])
|
|
393
|
+
}, null, 8, ["class"])) : createCommentVNode("", true)], 10, _hoisted_3), renderSlot(_ctx.$slots, "item", {
|
|
394
|
+
node: row.node,
|
|
395
|
+
level: row.level,
|
|
396
|
+
expanded: row.expanded,
|
|
397
|
+
selected: row.node.id === __props.modelValue
|
|
398
|
+
}, () => [
|
|
399
|
+
row.node.icon ? (openBlock(), createBlock(_sfc_main$1, {
|
|
400
|
+
key: 0,
|
|
401
|
+
name: row.node.icon,
|
|
402
|
+
class: normalizeClass(["size-[18px] shrink-0", row.node.id === __props.modelValue ? "text-primary-600 dark:text-primary-400" : "text-gray-400 group-hover:text-gray-600 dark:text-gray-500 dark:group-hover:text-gray-300"])
|
|
403
|
+
}, null, 8, ["name", "class"])) : createCommentVNode("", true),
|
|
404
|
+
createElementVNode("span", _hoisted_4, toDisplayString(row.node.label), 1),
|
|
405
|
+
row.node.badge !== void 0 && row.node.badge !== null && row.node.badge !== "" ? (openBlock(), createElementBlock("span", {
|
|
406
|
+
key: 1,
|
|
407
|
+
class: normalizeClass(["ml-auto inline-flex min-w-5 items-center justify-center rounded-full px-1.5 text-xs font-semibold tabular-nums", row.node.id === __props.modelValue ? "bg-primary-100 text-primary-700 dark:bg-primary-400/20 dark:text-primary-200" : "bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-300"])
|
|
408
|
+
}, toDisplayString(row.node.badge), 3)) : createCommentVNode("", true)
|
|
409
|
+
])], 46, _hoisted_2);
|
|
410
|
+
}), 128))], 40, _hoisted_1);
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
//#endregion
|
|
415
|
+
export { _sfc_main as default };
|
|
416
|
+
|
|
417
|
+
//# sourceMappingURL=Tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tree.js","names":[],"sources":["../../src/components/Tree.vue"],"sourcesContent":["<template>\n <div\n role=\"tree\"\n :aria-label=\"label || undefined\"\n class=\"flex flex-col gap-px\"\n @keydown=\"onKeydown\"\n >\n <div\n v-for=\"row in rows\"\n :key=\"row.node.id\"\n :ref=\"(el) => setRowRef(row.node.id, el)\"\n role=\"treeitem\"\n :aria-level=\"row.level\"\n :aria-setsize=\"row.setSize\"\n :aria-posinset=\"row.posInSet\"\n :aria-expanded=\"row.hasChildren ? (row.expanded ? 'true' : 'false') : undefined\"\n :aria-selected=\"row.node.id === modelValue ? 'true' : 'false'\"\n :aria-disabled=\"row.node.disabled ? 'true' : undefined\"\n :tabindex=\"row.node.id === focusId ? 0 : -1\"\n :draggable=\"draggable && !row.node.disabled ? 'true' : undefined\"\n class=\"group flex w-full items-center gap-2 rounded-lg py-1.5 pr-3 text-left text-sm font-medium transition-colors select-none focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary-500 dark:focus-visible:outline-primary-400\"\n :class=\"rowClass(row)\"\n :style=\"{ paddingLeft: `${8 + (row.level - 1) * indent}px` }\"\n @click=\"onRowClick(row)\"\n @focus=\"focusId = row.node.id\"\n @contextmenu=\"emit('contextmenu', { node: row.node, event: $event })\"\n @dragstart=\"onDragStart(row, $event)\"\n @dragend=\"onDragEnd\"\n @dragover=\"onDragOver(row, $event)\"\n @dragleave=\"onDragLeave(row, $event)\"\n @drop=\"onDrop(row, $event)\"\n >\n <!-- Disclosure. Not a separate tab stop: the row itself carries\n aria-expanded and answers Left / Right. -->\n <span\n class=\"-my-1 inline-flex size-5 shrink-0 items-center justify-center rounded text-gray-400 dark:text-gray-500\"\n :class=\"\n row.hasChildren\n ? 'hover:bg-gray-200 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-gray-200'\n : ''\n \"\n aria-hidden=\"true\"\n @click.stop=\"row.hasChildren && toggle(row.node.id)\"\n >\n <UiIcon\n v-if=\"row.hasChildren\"\n name=\"mdi:chevron-right\"\n class=\"size-4 transition-transform motion-reduce:transition-none\"\n :class=\"row.expanded ? 'rotate-90' : ''\"\n />\n </span>\n <slot\n name=\"item\"\n :node=\"row.node\"\n :level=\"row.level\"\n :expanded=\"row.expanded\"\n :selected=\"row.node.id === modelValue\"\n >\n <UiIcon\n v-if=\"row.node.icon\"\n :name=\"row.node.icon\"\n class=\"size-[18px] shrink-0\"\n :class=\"\n row.node.id === modelValue\n ? 'text-primary-600 dark:text-primary-400'\n : 'text-gray-400 group-hover:text-gray-600 dark:text-gray-500 dark:group-hover:text-gray-300'\n \"\n />\n <span class=\"min-w-0 flex-1 truncate\">{{ row.node.label }}</span>\n <span\n v-if=\"row.node.badge !== undefined && row.node.badge !== null && row.node.badge !== ''\"\n class=\"ml-auto inline-flex min-w-5 items-center justify-center rounded-full px-1.5 text-xs font-semibold tabular-nums\"\n :class=\"\n row.node.id === modelValue\n ? 'bg-primary-100 text-primary-700 dark:bg-primary-400/20 dark:text-primary-200'\n : 'bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-300'\n \"\n >{{ row.node.badge }}</span\n >\n </slot>\n </div>\n </div>\n</template>\n\n<script setup>\n/**\n * UiTree — a nested, collapsible, keyboard-navigable tree (folders, outlines,\n * file browsers), following the WAI-ARIA tree view pattern.\n *\n * Nodes are plain objects:\n * `{ id, label, icon?, badge?, disabled?, children?: Node[] }`.\n * Only expanded branches are rendered, as a flat run of rows; each row carries\n * `aria-level`, `aria-setsize` and `aria-posinset`, so assistive technology\n * hears the structure without nested groups in the DOM.\n *\n * Keyboard (one tab stop for the whole tree, with a roving tabindex):\n * Up / Down move between visible rows; Right expands, or moves to the first\n * child; Left collapses, or moves to the parent; Home / End jump to the ends;\n * Enter or Space selects; `*` expands every sibling; typing a few letters\n * jumps to the next row whose label starts with them.\n *\n * Selection is `v-model` (a single node id). Expansion is `v-model:expanded`\n * (an array of ids), or uncontrolled from `default-expanded`.\n *\n * Drag and drop is opt-in. `draggable` lets rows be picked up; `droppable`\n * (true, or a predicate `(node, event) => boolean`) lets rows accept a drop —\n * from this tree or from anywhere else, such as messages dragged out of a list.\n * Hovering a collapsed branch during a drag opens it. The tree does not move\n * anything itself: it emits `drop` and leaves the data to you.\n *\n * @example Mail folders\n * <UiTree\n * v-model=\"folderId\"\n * v-model:expanded=\"openFolders\"\n * :nodes=\"[\n * { id: 'inbox', label: 'Inbox', icon: 'mdi:inbox', badge: 3 },\n * { id: 'work', label: 'Work', icon: 'mdi:folder-outline', children: [\n * { id: 'work/2026', label: '2026', icon: 'mdi:folder-outline' },\n * ] },\n * ]\"\n * label=\"Folders\"\n * droppable\n * @drop=\"({ node, event }) => moveMessages(event.dataTransfer, node.id)\"\n * />\n *\n * @emits {string | number} update:modelValue — A node was selected (its id).\n * @emits {Array<string | number>} update:expanded — The set of expanded ids changed.\n * @emits {object} select — A node was selected (the node object).\n * @emits {{ node: object, event: DragEvent, sourceId: string | number | null }} drop —\n * Something was dropped on a row. `sourceId` is set when it was a row of this tree.\n * @emits {{ node: object, event: MouseEvent }} contextmenu — A row was right-clicked.\n *\n * @slot item — Replaces a row's icon, label and badge (the disclosure arrow\n * stays). Scope: `{ node, level, expanded, selected }`.\n */\nimport { computed, onBeforeUnmount, ref } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\n\nconst props = defineProps({\n /**\n * The root nodes.\n * @type {Array<{ id: string | number, label: string, icon?: string, badge?: string | number, disabled?: boolean, children?: Array<object> }>}\n * @default []\n */\n nodes: { type: Array, default: () => [] },\n /**\n * Id of the selected node, for `v-model`.\n * @type {string | number | null}\n * @default null\n */\n modelValue: { type: [String, Number], default: null },\n /**\n * Ids of expanded nodes, for `v-model:expanded`. Leave unset to let the\n * tree manage expansion itself.\n * @type {Array<string | number>}\n * @default undefined\n */\n expanded: { type: Array, default: undefined },\n /**\n * Ids expanded initially when `expanded` is not bound.\n * @type {Array<string | number>}\n * @default []\n */\n defaultExpanded: { type: Array, default: () => [] },\n /**\n * Accessible name for the tree.\n * @type {string}\n * @default ''\n */\n label: { type: String, default: '' },\n /**\n * Indentation per level, in pixels.\n * @type {number}\n * @default 16\n */\n indent: { type: Number, default: 16 },\n /**\n * Let rows be dragged.\n * @type {boolean}\n * @default false\n */\n draggable: { type: Boolean, default: false },\n /**\n * Let rows accept drops: `true` for every enabled row, or a predicate\n * `(node, event) => boolean`.\n * @type {boolean | Function}\n * @default false\n */\n droppable: { type: [Boolean, Function], default: false },\n})\n\nconst emit = defineEmits(['update:modelValue', 'update:expanded', 'select', 'drop', 'contextmenu'])\n\n/** MIME type a dragged row carries, so drops can tell tree rows from other data. */\nconst DRAG_TYPE = 'application/x-numori-tree-node'\n\n// ── Expansion (controlled or uncontrolled) ──\nconst internalExpanded = ref(new Set(props.defaultExpanded))\nconst expandedSet = computed(() =>\n props.expanded ? new Set(props.expanded) : internalExpanded.value,\n)\n\nfunction setExpanded(next) {\n internalExpanded.value = next\n emit('update:expanded', [...next])\n}\n\nfunction toggle(id, force) {\n const next = new Set(expandedSet.value)\n const open = force ?? !next.has(id)\n if (open === next.has(id)) return\n if (open) next.add(id)\n else next.delete(id)\n setExpanded(next)\n}\n\n// ── Flatten the visible part of the tree ──\nconst rows = computed(() => {\n const out = []\n const walk = (nodes, level, parentId) => {\n nodes.forEach((node, i) => {\n const hasChildren = Array.isArray(node.children) && node.children.length > 0\n const expanded = hasChildren && expandedSet.value.has(node.id)\n out.push({\n node,\n level,\n parentId,\n hasChildren,\n expanded,\n setSize: nodes.length,\n posInSet: i + 1,\n })\n if (expanded) walk(node.children, level + 1, node.id)\n })\n }\n walk(props.nodes, 1, null)\n return out\n})\n\n// ── Focus (roving tabindex) ──\nconst userFocusId = ref(null)\nconst focusId = computed({\n get() {\n const ids = rows.value.map((r) => r.node.id)\n if (userFocusId.value !== null && ids.includes(userFocusId.value)) return userFocusId.value\n if (props.modelValue !== null && ids.includes(props.modelValue)) return props.modelValue\n return rows.value.find((r) => !r.node.disabled)?.node.id ?? null\n },\n set(id) {\n userFocusId.value = id\n },\n})\n\nconst rowEls = new Map()\nconst setRowRef = (id, el) => {\n if (el) rowEls.set(id, el)\n else rowEls.delete(id)\n}\n\nfunction focusRow(id) {\n if (id === null || id === undefined) return\n focusId.value = id\n rowEls.get(id)?.focus()\n}\n\nfunction select(row) {\n if (row.node.disabled) return\n emit('update:modelValue', row.node.id)\n emit('select', row.node)\n}\n\nfunction onRowClick(row) {\n focusId.value = row.node.id\n select(row)\n}\n\n// ── Keyboard ──\nlet typeahead = ''\nlet typeaheadTimer = null\n\nfunction onKeydown(event) {\n const list = rows.value\n const index = list.findIndex((r) => r.node.id === focusId.value)\n if (index === -1) return\n const row = list[index]\n\n const enabledFrom = (start, step) => {\n for (let i = start; i >= 0 && i < list.length; i += step) {\n if (!list[i].node.disabled) return list[i].node.id\n }\n return null\n }\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault()\n focusRow(enabledFrom(index + 1, 1))\n return\n case 'ArrowUp':\n event.preventDefault()\n focusRow(enabledFrom(index - 1, -1))\n return\n case 'Home':\n event.preventDefault()\n focusRow(enabledFrom(0, 1))\n return\n case 'End':\n event.preventDefault()\n focusRow(enabledFrom(list.length - 1, -1))\n return\n case 'ArrowRight':\n event.preventDefault()\n if (row.hasChildren && !row.expanded) toggle(row.node.id, true)\n else if (row.expanded) focusRow(list[index + 1]?.node.id)\n return\n case 'ArrowLeft':\n event.preventDefault()\n if (row.expanded) toggle(row.node.id, false)\n else focusRow(row.parentId)\n return\n case 'Enter':\n case ' ':\n event.preventDefault()\n select(row)\n return\n case '*': {\n event.preventDefault()\n const next = new Set(expandedSet.value)\n for (const sibling of list) {\n if (sibling.parentId === row.parentId && sibling.hasChildren) next.add(sibling.node.id)\n }\n setExpanded(next)\n return\n }\n }\n\n // Type-ahead: printable characters, no modifiers.\n if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n typeahead += event.key.toLowerCase()\n clearTimeout(typeaheadTimer)\n typeaheadTimer = setTimeout(() => (typeahead = ''), 500)\n const ordered = [...list.slice(index + 1), ...list.slice(0, index + 1)]\n // A single repeated letter cycles through matches; a longer prefix\n // searches from the current row.\n const search = typeahead.length > 1 ? [row, ...ordered] : ordered\n const match = search.find(\n (r) => !r.node.disabled && String(r.node.label).toLowerCase().startsWith(typeahead),\n )\n if (match) focusRow(match.node.id)\n }\n}\n\n// ── Drag and drop ──\nconst draggingId = ref(null)\nconst dropTargetId = ref(null)\nlet expandTimer = null\n\nfunction onDragStart(row, event) {\n if (!props.draggable || row.node.disabled) return\n draggingId.value = row.node.id\n event.dataTransfer.effectAllowed = 'move'\n event.dataTransfer.setData(DRAG_TYPE, String(row.node.id))\n event.dataTransfer.setData('text/plain', String(row.node.label))\n}\n\nfunction onDragEnd() {\n draggingId.value = null\n dropTargetId.value = null\n clearTimeout(expandTimer)\n}\n\nfunction accepts(row, event) {\n if (!props.droppable || row.node.disabled) return false\n if (draggingId.value !== null && draggingId.value === row.node.id) return false\n return typeof props.droppable === 'function' ? !!props.droppable(row.node, event) : true\n}\n\nfunction onDragOver(row, event) {\n if (!accepts(row, event)) return\n event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move'\n if (dropTargetId.value !== row.node.id) {\n dropTargetId.value = row.node.id\n clearTimeout(expandTimer)\n if (row.hasChildren && !row.expanded) {\n expandTimer = setTimeout(() => toggle(row.node.id, true), 700)\n }\n }\n}\n\nfunction onDragLeave(row, event) {\n if (event.currentTarget.contains(event.relatedTarget)) return\n if (dropTargetId.value === row.node.id) {\n dropTargetId.value = null\n clearTimeout(expandTimer)\n }\n}\n\nfunction onDrop(row, event) {\n if (!accepts(row, event)) return\n event.preventDefault()\n const raw = event.dataTransfer?.getData(DRAG_TYPE)\n const source = raw ? (draggingId.value ?? raw) : null\n dropTargetId.value = null\n clearTimeout(expandTimer)\n emit('drop', { node: row.node, event, sourceId: source })\n}\n\nonBeforeUnmount(() => {\n clearTimeout(expandTimer)\n clearTimeout(typeaheadTimer)\n})\n\n// ── Appearance ──\nfunction rowClass(row) {\n const selected = row.node.id === props.modelValue\n return [\n selected\n ? 'bg-primary-50 text-primary-700 dark:bg-primary-400/10 dark:text-primary-200'\n : 'text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-gray-100',\n row.node.disabled ? 'pointer-events-none opacity-40' : 'cursor-pointer',\n dropTargetId.value === row.node.id\n ? 'ring-2 ring-inset ring-primary-400 dark:ring-primary-500'\n : '',\n draggingId.value === row.node.id ? 'opacity-50' : '',\n ].join(' ')\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkMA,IAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAxDlB,MAAM,QAAQ;EAqDd,MAAM,OAAO;;EAMb,MAAM,mBAAmB,IAAI,IAAI,IAAI,MAAM,eAAe,CAAC;EAC3D,MAAM,cAAc,eAClB,MAAM,WAAW,IAAI,IAAI,MAAM,QAAQ,IAAI,iBAAiB,KAC9D;EAEA,SAAS,YAAY,MAAM;GACzB,iBAAiB,QAAQ;GACzB,KAAK,mBAAmB,CAAC,GAAG,IAAI,CAAC;EACnC;EAEA,SAAS,OAAO,IAAI,OAAO;GACzB,MAAM,OAAO,IAAI,IAAI,YAAY,KAAK;GACtC,MAAM,OAAO,SAAS,CAAC,KAAK,IAAI,EAAE;GAClC,IAAI,SAAS,KAAK,IAAI,EAAE,GAAG;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