@threadlabs/looma 0.23.9 → 0.23.10
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/components/ui-disclosure/ui-disclosure.html +2 -4
- package/components/ui-tree/ui-tree.html +4 -0
- package/components/ui-tree/ui-tree.js +32 -6
- package/components/ui-tree-item/ui-tree-item.html +21 -8
- package/components/ui-tree-item/ui-tree-item.js +3 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-disclosure.css +0 -3
- package/styles/ui-tree-item.css +12 -4
- package/vanilla/UiTree.d.ts +1 -0
- package/vanilla/UiTree.js +1 -1
- package/vanilla/UiTreeItem.js +25 -15
- package/vue/UiDisclosure.vue +1 -5
- package/vue/UiTree.d.ts +9 -0
- package/vue/UiTree.vue +31 -1
- package/vue/UiTreeItem.d.ts +3 -3
- package/vue/UiTreeItem.vue +55 -8
- package/vue/chunks/UiDisclosure.js +2 -2
- package/vue/chunks/UiTree.js +24 -1
- package/vue/chunks/UiTreeItem.js +39 -8
- package/vue/components.css +128 -125
package/package.json
CHANGED
package/styles/ui-disclosure.css
CHANGED
|
@@ -174,9 +174,6 @@
|
|
|
174
174
|
background: var(--ui-nav-hover-surface);
|
|
175
175
|
color: var(--ui-text-primary);
|
|
176
176
|
}
|
|
177
|
-
:scope[data-ui-disclosure-state~="variant=navigation"][data-ui-disclosure-state~="internalOpen"] .trigger {
|
|
178
|
-
color: var(--ui-selection-text);
|
|
179
|
-
}
|
|
180
177
|
:scope[data-ui-disclosure-state~="variant=navigation"] :is(.leading, .indicator) {
|
|
181
178
|
inline-size: var(--ui-nav-icon-size);
|
|
182
179
|
font-size: var(--ui-nav-icon-size);
|
package/styles/ui-tree-item.css
CHANGED
|
@@ -86,7 +86,12 @@
|
|
|
86
86
|
background: var(--ui-disabled-surface);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
:scope[data-dragging] .row {
|
|
89
|
+
:scope[data-dragging]:not([data-move-source]) .row {
|
|
90
|
+
opacity: 0.42;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:scope[data-move-source] > .row > .label,
|
|
94
|
+
:scope[data-move-source] > .row > .leading {
|
|
90
95
|
opacity: 0.42;
|
|
91
96
|
}
|
|
92
97
|
|
|
@@ -247,7 +252,8 @@
|
|
|
247
252
|
/* The controls sit over the label's end, so the text fades out where they begin. The fade is
|
|
248
253
|
the truncation mark while it shows: an ellipsis under it would read as a second one. */
|
|
249
254
|
.row:hover > .label,
|
|
250
|
-
.row:focus-within > .label
|
|
255
|
+
.row:focus-within > .label,
|
|
256
|
+
:scope[data-move-source] > .row > .label {
|
|
251
257
|
text-overflow: clip;
|
|
252
258
|
mask-image: linear-gradient(
|
|
253
259
|
to right,
|
|
@@ -257,7 +263,8 @@
|
|
|
257
263
|
}
|
|
258
264
|
|
|
259
265
|
.row:hover > .label:dir(rtl),
|
|
260
|
-
.row:focus-within > .label:dir(rtl)
|
|
266
|
+
.row:focus-within > .label:dir(rtl),
|
|
267
|
+
:scope[data-move-source] > .row > .label:dir(rtl) {
|
|
261
268
|
mask-image: linear-gradient(
|
|
262
269
|
to left,
|
|
263
270
|
#000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-1)),
|
|
@@ -323,7 +330,8 @@
|
|
|
323
330
|
}
|
|
324
331
|
|
|
325
332
|
.row:hover > .actions,
|
|
326
|
-
.row:focus-within > .actions
|
|
333
|
+
.row:focus-within > .actions,
|
|
334
|
+
:scope[data-move-source] > .row > .actions {
|
|
327
335
|
opacity: 1;
|
|
328
336
|
pointer-events: auto;
|
|
329
337
|
}
|
package/vanilla/UiTree.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface UiTreeProps {
|
|
|
15
15
|
label?: string | null;
|
|
16
16
|
marquee?: boolean | null;
|
|
17
17
|
maxDepth?: number | null;
|
|
18
|
+
moveActivation?: "click" | "keyboard-touch" | null;
|
|
18
19
|
selection?: "none" | "single" | "multiple" | null;
|
|
19
20
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
20
21
|
children?: readonly (string | Node)[];
|
package/vanilla/UiTree.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-tree/ui-tree.js";
|
|
4
4
|
import "../styles/ui-tree.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-tree","props":{"density":{"type":{"kind":"terminal","name":"keyword"},"values":["comfortable","compact"],"required":false,"target":{"attribute":"density"},"default":"comfortable"},"hoverExpandDelay":{"type":"number","required":false,"target":{"attribute":"hoverexpanddelay"},"default":700},"label":{"type":"string","required":false,"target":{"attribute":"label"},"default":"Tree"},"marquee":{"type":"boolean","required":false,"target":{"attribute":"marquee"},"default":false},"maxDepth":{"type":"number","required":false,"target":{"attribute":"maxdepth"},"default":0},"selection":{"type":{"kind":"terminal","name":"keyword"},"values":["none","single","multiple"],"required":false,"target":{"attribute":"selection"},"default":"none"}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"tree"}],"children":[{"kind":"slot"}]},"declarations":[{"kind":"event","name":"reorder","type":"object","shape":{"kind":"object","fields":[{"name":"sourceId","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"targetId","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"position","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["before","inside","after"]},"optional":false},{"name":"sourceType","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"targetType","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"sourceScope","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"targetScope","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"reorder-rejected","type":"object","shape":{"kind":"object","fields":[{"name":"sourceId","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"targetId","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"position","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["before","inside","after"]},"optional":false},{"name":"reason","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["max-depth"]},"optional":false},{"name":"maxDepth","type":{"kind":"terminal","name":"integer"},"optional":false},{"name":"resultingDepth","type":{"kind":"terminal","name":"integer"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"activate","type":"object","shape":{"kind":"object","fields":[{"name":"id","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"select","type":"object","shape":{"kind":"object","fields":[{"name":"ids","type":{"kind":"list","item":{"kind":"terminal","name":"string"}},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-tree","props":{"density":{"type":{"kind":"terminal","name":"keyword"},"values":["comfortable","compact"],"required":false,"target":{"attribute":"density"},"default":"comfortable"},"hoverExpandDelay":{"type":"number","required":false,"target":{"attribute":"hoverexpanddelay"},"default":700},"label":{"type":"string","required":false,"target":{"attribute":"label"},"default":"Tree"},"marquee":{"type":"boolean","required":false,"target":{"attribute":"marquee"},"default":false},"maxDepth":{"type":"number","required":false,"target":{"attribute":"maxdepth"},"default":0},"moveActivation":{"type":{"kind":"terminal","name":"keyword"},"values":["click","keyboard-touch"],"required":false,"target":{"attribute":"moveactivation"},"default":"click"},"selection":{"type":{"kind":"terminal","name":"keyword"},"values":["none","single","multiple"],"required":false,"target":{"attribute":"selection"},"default":"none"}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"tree"}],"children":[{"kind":"slot"}]},"declarations":[{"kind":"event","name":"reorder","type":"object","shape":{"kind":"object","fields":[{"name":"sourceId","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"targetId","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"position","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["before","inside","after"]},"optional":false},{"name":"sourceType","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"targetType","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"sourceScope","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"targetScope","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"reorder-rejected","type":"object","shape":{"kind":"object","fields":[{"name":"sourceId","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"targetId","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"position","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["before","inside","after"]},"optional":false},{"name":"reason","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["max-depth"]},"optional":false},{"name":"maxDepth","type":{"kind":"terminal","name":"integer"},"optional":false},{"name":"resultingDepth","type":{"kind":"terminal","name":"integer"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"activate","type":"object","shape":{"kind":"object","fields":[{"name":"id","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"select","type":"object","shape":{"kind":"object","fields":[{"name":"ids","type":{"kind":"list","item":{"kind":"terminal","name":"string"}},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiTree(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
package/vanilla/UiTreeItem.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-tree-item/ui-tree-item.js";
|
|
4
4
|
import "../styles/ui-tree-item.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-tree-item","props":{"accepts":{"type":"string","required":false,"target":{"attribute":"data-accepts"},"default":""},"container":{"type":"boolean","required":false,"target":{"attribute":"container"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"aria-disabled"},"default":false},"dragType":{"type":"string","required":false,"target":{"attribute":"data-drag-type"},"default":"item"},"dropDepth":{"type":"number","required":false,"target":{"attribute":"data-drop-depth"}},"dropScope":{"type":"string","required":false,"target":{"attribute":"data-drop-scope"},"default":""},"expanded":{"type":"boolean","required":false,"target":{"attribute":"expanded"},"default":false},"itemId":{"type":"string","required":false,"target":{"attribute":"data-item-id"},"default":""},"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":""},"lazy":{"type":"boolean","required":false,"target":{"attribute":"lazy"},"default":false},"marquee":{"type":"boolean","required":false,"target":{"attribute":"marquee"},"default":false},"selected":{"type":"boolean","required":false,"target":{"attribute":"aria-selected"},"default":false},"sortable":{"type":"boolean","required":false,"target":{"attribute":"sortable"},"default":false},"subtreeDepth":{"type":"number","required":false,"target":{"attribute":"data-subtree-depth"}}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"treeitem"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}},{"kind":"attribute","name":"aria-level","expression":"structuralLevel","expressionPlan":{"source":"structuralLevel","ast":{"kind":"id","name":"structuralLevel"},"dependencies":["structuralLevel"]}},{"kind":"attribute","name":"aria-selected","expression":"selected","expressionPlan":{"source":"selected","ast":{"kind":"id","name":"selected"},"dependencies":["selected"]}},{"kind":"attribute","name":"aria-disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"data-item-id","expression":"itemId","expressionPlan":{"source":"itemId","ast":{"kind":"id","name":"itemId"},"dependencies":["itemId"]}},{"kind":"attribute","name":"data-drag-type","expression":"dragType","expressionPlan":{"source":"dragType","ast":{"kind":"id","name":"dragType"},"dependencies":["dragType"]}},{"kind":"attribute","name":"data-drop-scope","expression":"dropScope","expressionPlan":{"source":"dropScope","ast":{"kind":"id","name":"dropScope"},"dependencies":["dropScope"]}},{"kind":"attribute","name":"data-accepts","expression":"accepts","expressionPlan":{"source":"accepts","ast":{"kind":"id","name":"accepts"},"dependencies":["accepts"]}},{"kind":"attribute","name":"data-drop-depth","expression":"dropDepth","expressionPlan":{"source":"dropDepth","ast":{"kind":"id","name":"dropDepth"},"dependencies":["dropDepth"]}},{"kind":"attribute","name":"data-subtree-depth","expression":"subtreeDepth","expressionPlan":{"source":"subtreeDepth","ast":{"kind":"id","name":"subtreeDepth"},"dependencies":["subtreeDepth"]}}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"row"}],"children":[{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"drag-handle"},{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"draggable","value":"true"},{"kind":"attribute","name":"aria-label","expression":"format('Drag %s to reorder', label)","expressionPlan":{"source":"format('Drag %s to reorder', label)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Drag %s to reorder"},{"kind":"id","name":"label"}]},"dependencies":["label"]}}],"children":[{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"aria-hidden","value":"true"},{"kind":"literal","name":"focusable","value":"false"},{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]}]}],"flow":{"kind":"if","test":"sortable and not disabled","testPlan":{"source":"sortable and not disabled","ast":{"kind":"binary","op":"and","left":{"kind":"id","name":"sortable"},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"disabled"}}},"dependencies":["disabled","sortable"]}},"ref":"dragHandle"},{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"disclosure"},{"kind":"literal","name":"type","value":"button"},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"hidden","expression":"not isContainer","expressionPlan":{"source":"not isContainer","ast":{"kind":"unary","op":"not","operand":{"kind":"id","name":"isContainer"}},"dependencies":["isContainer"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"disclosure-icon"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"disclosure"},{"kind":"element","name":"label","attributes":[{"kind":"literal","name":"class","value":"selection-hit"}],"children":[{"kind":"element","name":"input","attributes":[{"kind":"literal","name":"class","value":"selection-checkbox"},{"kind":"literal","name":"type","value":"checkbox"},{"kind":"literal","name":"tabindex","value":"-1"},{"kind":"attribute","name":"checked","expression":"selected","expressionPlan":{"source":"selected","ast":{"kind":"id","name":"selected"},"dependencies":["selected"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"aria-label","expression":"format('Select %s', label)","expressionPlan":{"source":"format('Select %s', label)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Select %s"},{"kind":"id","name":"label"}]},"dependencies":["label"]}}],"children":[]}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"leading"}],"children":[{"kind":"slot","fallback":[],"name":"leading"}],"ref":"leading"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label-text"}],"children":[{"kind":"slot","fallback":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[]}],"name":"label"}],"ref":"labelText"}],"ref":"label"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"actions"}],"children":[{"kind":"slot","fallback":[],"name":"actions"}],"ref":"actions"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator row-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"row"},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"children"},{"kind":"literal","name":"role","value":"group"},{"kind":"attribute","name":"hidden","expression":"not (isContainer and internalExpanded)","expressionPlan":{"source":"not (isContainer and internalExpanded)","ast":{"kind":"unary","op":"not","operand":{"kind":"binary","op":"and","left":{"kind":"id","name":"isContainer"},"right":{"kind":"id","name":"internalExpanded"}}},"dependencies":["internalExpanded","isContainer"]}}],"children":[{"kind":"slot"}],"ref":"children"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator subtree-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}]},"declarations":[{"kind":"state","name":"internalExpanded","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"structuralLevel","type":"integer","value":"1","expression":{"source":"1","ast":{"kind":"literal","value":1},"dependencies":[]}},{"kind":"state","name":"tabStop","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"isContainer","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"expand","type":"object","shape":{"kind":"object","fields":[{"name":"id","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"expanded","type":{"kind":"terminal","name":"boolean"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":false,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-tree-item","props":{"accepts":{"type":"string","required":false,"target":{"attribute":"data-accepts"},"default":""},"container":{"type":"boolean","required":false,"target":{"attribute":"container"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"aria-disabled"},"default":false},"dragType":{"type":"string","required":false,"target":{"attribute":"data-drag-type"},"default":"item"},"dropDepth":{"type":"number","required":false,"target":{"attribute":"data-drop-depth"}},"dropScope":{"type":"string","required":false,"target":{"attribute":"data-drop-scope"},"default":""},"expanded":{"type":"boolean","required":false,"target":{"attribute":"expanded"},"default":false},"itemId":{"type":"string","required":false,"target":{"attribute":"data-item-id"},"default":""},"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":""},"lazy":{"type":"boolean","required":false,"target":{"attribute":"lazy"},"default":false},"marquee":{"type":"boolean","required":false,"target":{"attribute":"marquee"},"default":false},"selected":{"type":"boolean","required":false,"target":{"attribute":"aria-selected"},"default":false},"sortable":{"type":"boolean","required":false,"target":{"attribute":"sortable"},"default":false},"subtreeDepth":{"type":"number","required":false,"target":{"attribute":"data-subtree-depth"}}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"treeitem"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}},{"kind":"attribute","name":"aria-level","expression":"structuralLevel","expressionPlan":{"source":"structuralLevel","ast":{"kind":"id","name":"structuralLevel"},"dependencies":["structuralLevel"]}},{"kind":"attribute","name":"aria-selected","expression":"selected","expressionPlan":{"source":"selected","ast":{"kind":"id","name":"selected"},"dependencies":["selected"]}},{"kind":"attribute","name":"aria-disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"data-item-id","expression":"itemId","expressionPlan":{"source":"itemId","ast":{"kind":"id","name":"itemId"},"dependencies":["itemId"]}},{"kind":"attribute","name":"data-drag-type","expression":"dragType","expressionPlan":{"source":"dragType","ast":{"kind":"id","name":"dragType"},"dependencies":["dragType"]}},{"kind":"attribute","name":"data-drop-scope","expression":"dropScope","expressionPlan":{"source":"dropScope","ast":{"kind":"id","name":"dropScope"},"dependencies":["dropScope"]}},{"kind":"attribute","name":"data-accepts","expression":"accepts","expressionPlan":{"source":"accepts","ast":{"kind":"id","name":"accepts"},"dependencies":["accepts"]}},{"kind":"attribute","name":"data-drop-depth","expression":"dropDepth","expressionPlan":{"source":"dropDepth","ast":{"kind":"id","name":"dropDepth"},"dependencies":["dropDepth"]}},{"kind":"attribute","name":"data-subtree-depth","expression":"subtreeDepth","expressionPlan":{"source":"subtreeDepth","ast":{"kind":"id","name":"subtreeDepth"},"dependencies":["subtreeDepth"]}}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"row"}],"children":[{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"drag-handle"},{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"draggable","value":"true"},{"kind":"attribute","name":"aria-label","expression":"{ true: format('Cancel moving %s', label), false: format('Drag %s to reorder', label) }[format('%s', moving)]","expressionPlan":{"source":"{ true: format('Cancel moving %s', label), false: format('Drag %s to reorder', label) }[format('%s', moving)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Cancel moving %s"},{"kind":"id","name":"label"}]}},{"key":"false","value":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Drag %s to reorder"},{"kind":"id","name":"label"}]}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"id","name":"moving"}]}},"dependencies":["label","moving"]}}],"children":[{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"aria-hidden","value":"true"},{"kind":"literal","name":"focusable","value":"false"},{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]}]}],"flow":{"kind":"if","test":"sortable and not disabled","testPlan":{"source":"sortable and not disabled","ast":{"kind":"binary","op":"and","left":{"kind":"id","name":"sortable"},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"disabled"}}},"dependencies":["disabled","sortable"]}},"ref":"dragHandle"},{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"disclosure"},{"kind":"literal","name":"type","value":"button"},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"hidden","expression":"not isContainer","expressionPlan":{"source":"not isContainer","ast":{"kind":"unary","op":"not","operand":{"kind":"id","name":"isContainer"}},"dependencies":["isContainer"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"disclosure-icon"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"disclosure"},{"kind":"element","name":"label","attributes":[{"kind":"literal","name":"class","value":"selection-hit"}],"children":[{"kind":"element","name":"input","attributes":[{"kind":"literal","name":"class","value":"selection-checkbox"},{"kind":"literal","name":"type","value":"checkbox"},{"kind":"literal","name":"tabindex","value":"-1"},{"kind":"attribute","name":"checked","expression":"selected","expressionPlan":{"source":"selected","ast":{"kind":"id","name":"selected"},"dependencies":["selected"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"aria-label","expression":"format('Select %s', label)","expressionPlan":{"source":"format('Select %s', label)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Select %s"},{"kind":"id","name":"label"}]},"dependencies":["label"]}}],"children":[]}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"leading"}],"children":[{"kind":"slot","fallback":[],"name":"leading"}],"ref":"leading"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label-text"}],"children":[{"kind":"slot","fallback":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[]}],"name":"label"}],"ref":"labelText"}],"ref":"label"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"actions"}],"children":[{"kind":"element","name":"ui-button","attributes":[{"kind":"literal","name":"data-tree-cancel-move","value":""},{"kind":"literal","name":"variant","value":"ghost"},{"kind":"literal","name":"tone","value":"neutral"},{"kind":"literal","name":"size","value":"sm"},{"kind":"literal","name":"aria-label","value":"Cancel move"}],"children":[{"kind":"text","value":"Cancel"}],"flow":{"kind":"if","test":"moving","testPlan":{"source":"moving","ast":{"kind":"id","name":"moving"},"dependencies":["moving"]}}},{"kind":"element","name":"span","attributes":[],"children":[{"kind":"slot","fallback":[],"name":"actions"}],"flow":{"kind":"else"}}],"ref":"actions"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator row-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"row"},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"children"},{"kind":"literal","name":"role","value":"group"},{"kind":"attribute","name":"hidden","expression":"not (isContainer and internalExpanded)","expressionPlan":{"source":"not (isContainer and internalExpanded)","ast":{"kind":"unary","op":"not","operand":{"kind":"binary","op":"and","left":{"kind":"id","name":"isContainer"},"right":{"kind":"id","name":"internalExpanded"}}},"dependencies":["internalExpanded","isContainer"]}}],"children":[{"kind":"slot"}],"ref":"children"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator subtree-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}]},"declarations":[{"kind":"state","name":"internalExpanded","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"structuralLevel","type":"integer","value":"1","expression":{"source":"1","ast":{"kind":"literal","value":1},"dependencies":[]}},{"kind":"state","name":"tabStop","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"isContainer","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"moving","type":"boolean","value":"false","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"expand","type":"object","shape":{"kind":"object","fields":[{"name":"id","type":{"kind":"terminal","name":"string"},"optional":false},{"name":"expanded","type":{"kind":"terminal","name":"boolean"},"optional":false},{"name":"trigger","type":{"kind":"constrained","base":{"kind":"terminal","name":"keyword"},"values":["keyboard","pointer","programmatic"]},"optional":false}],"open":false},"bubbles":false,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiTreeItem(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -145,38 +145,48 @@ export function createUiTreeItem(options = {}) {
|
|
|
145
145
|
element0.append(element14);
|
|
146
146
|
const element17 = document.createElement("span");
|
|
147
147
|
element17.setAttribute("class", "actions");
|
|
148
|
+
const element18 = document.createElement("ui-button");
|
|
149
|
+
element18.setAttribute("data-tree-cancel-move", "");
|
|
150
|
+
element18.setAttribute("variant", "ghost");
|
|
151
|
+
element18.setAttribute("tone", "neutral");
|
|
152
|
+
element18.setAttribute("size", "sm");
|
|
153
|
+
element18.setAttribute("aria-label", "Cancel move");
|
|
154
|
+
element18.append("Cancel");
|
|
155
|
+
element17.append(element18);
|
|
156
|
+
const element19 = document.createElement("span");
|
|
148
157
|
if (slots["actions"] ?? [].length > 0) {
|
|
149
158
|
for (const child of slots["actions"] ?? []) {
|
|
150
159
|
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
151
160
|
if (node.nodeType === 1) node.setAttribute("data-slotted", "");
|
|
152
161
|
projected.push([node, "actions"]);
|
|
153
|
-
|
|
162
|
+
element19.append(node);
|
|
154
163
|
}
|
|
155
164
|
} else {
|
|
156
165
|
}
|
|
166
|
+
element17.append(element19);
|
|
157
167
|
element0.append(element17);
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
element0.append(
|
|
168
|
+
const element20 = document.createElement("span");
|
|
169
|
+
element20.setAttribute("class", "drop-indicator row-drop-indicator");
|
|
170
|
+
element20.setAttribute("aria-hidden", "true");
|
|
171
|
+
element0.append(element20);
|
|
162
172
|
element.append(element0);
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
173
|
+
const element21 = document.createElement("div");
|
|
174
|
+
element21.setAttribute("class", "children");
|
|
175
|
+
element21.setAttribute("role", "group");
|
|
166
176
|
if (children.length > 0) {
|
|
167
177
|
for (const child of children) {
|
|
168
178
|
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
169
179
|
if (node.nodeType === 1) node.setAttribute("data-slotted", "");
|
|
170
180
|
projected.push([node, ""]);
|
|
171
|
-
|
|
181
|
+
element21.append(node);
|
|
172
182
|
}
|
|
173
183
|
} else {
|
|
174
184
|
}
|
|
175
|
-
element.append(
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
element.append(
|
|
185
|
+
element.append(element21);
|
|
186
|
+
const element22 = document.createElement("span");
|
|
187
|
+
element22.setAttribute("class", "drop-indicator subtree-drop-indicator");
|
|
188
|
+
element22.setAttribute("aria-hidden", "true");
|
|
189
|
+
element.append(element22);
|
|
180
190
|
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
181
191
|
controller,
|
|
182
192
|
});
|
package/vue/UiDisclosure.vue
CHANGED
|
@@ -78,7 +78,7 @@ const propValidityContract = {
|
|
|
78
78
|
required: false,
|
|
79
79
|
target: { attribute: 'variant' },
|
|
80
80
|
description:
|
|
81
|
-
'Navigation shares icon columns, spacing, type, hover, and corners with Nav Item. Plain retains the standard disclosure treatment.',
|
|
81
|
+
'Navigation shares icon columns, spacing, type, hover, and corners with Nav Item, while keeping expanded sections neutral: opening content is not route\n selection. Plain retains the standard disclosure treatment.',
|
|
82
82
|
values: ['plain', 'navigation'],
|
|
83
83
|
default: 'plain',
|
|
84
84
|
},
|
|
@@ -582,10 +582,6 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
|
|
|
582
582
|
background: var(--ui-nav-hover-surface);
|
|
583
583
|
color: var(--ui-text-primary);
|
|
584
584
|
}
|
|
585
|
-
[data-component~="ui-disclosure"][data-ui-disclosure-state~="variant=navigation"][data-ui-disclosure-state~="internalOpen"]
|
|
586
|
-
.trigger {
|
|
587
|
-
color: var(--ui-selection-text);
|
|
588
|
-
}
|
|
589
585
|
[data-component~="ui-disclosure"][data-ui-disclosure-state~="variant=navigation"]
|
|
590
586
|
:is(.leading, .indicator) {
|
|
591
587
|
inline-size: var(--ui-nav-icon-size);
|
package/vue/UiTree.d.ts
CHANGED
|
@@ -24,6 +24,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
24
24
|
type: PropType<number | null>;
|
|
25
25
|
default: number;
|
|
26
26
|
};
|
|
27
|
+
moveActivation: {
|
|
28
|
+
type: PropType<"click" | "keyboard-touch" | null>;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
27
31
|
selection: {
|
|
28
32
|
type: PropType<"none" | "single" | "multiple" | null>;
|
|
29
33
|
default: string;
|
|
@@ -78,6 +82,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
78
82
|
type: PropType<number | null>;
|
|
79
83
|
default: number;
|
|
80
84
|
};
|
|
85
|
+
moveActivation: {
|
|
86
|
+
type: PropType<"click" | "keyboard-touch" | null>;
|
|
87
|
+
default: string;
|
|
88
|
+
};
|
|
81
89
|
selection: {
|
|
82
90
|
type: PropType<"none" | "single" | "multiple" | null>;
|
|
83
91
|
default: string;
|
|
@@ -118,6 +126,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
118
126
|
density: "comfortable" | "compact" | null;
|
|
119
127
|
hoverExpandDelay: number | null;
|
|
120
128
|
maxDepth: number | null;
|
|
129
|
+
moveActivation: "click" | "keyboard-touch" | null;
|
|
121
130
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
122
131
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
123
132
|
declare const _default: typeof __VLS_export;
|
package/vue/UiTree.vue
CHANGED
|
@@ -49,6 +49,15 @@ const propValidityContract = {
|
|
|
49
49
|
'The deepest level a drag may produce, counting the top level as 1. A drop that would place the dragged item, or any item beneath it, deeper than this is\n refused and reported as reorder-rejected. 0 means no limit.',
|
|
50
50
|
default: 0,
|
|
51
51
|
},
|
|
52
|
+
moveActivation: {
|
|
53
|
+
type: { kind: 'terminal', name: 'keyword' },
|
|
54
|
+
required: false,
|
|
55
|
+
target: { attribute: 'moveactivation' },
|
|
56
|
+
description:
|
|
57
|
+
'Which handle activations start guided moving. click preserves two-click moving with any pointer. keyboard-touch leaves ordinary mouse and pen clicks inert\n while retaining keyboard activation and touch taps. Actual pointer dragging works in either mode. Guided moves show Cancel on the source row; Escape or\n reactivating that source handle also cancels without requesting a reorder.',
|
|
58
|
+
values: ['click', 'keyboard-touch'],
|
|
59
|
+
default: 'click',
|
|
60
|
+
},
|
|
52
61
|
selection: {
|
|
53
62
|
type: { kind: 'terminal', name: 'keyword' },
|
|
54
63
|
required: false,
|
|
@@ -69,6 +78,10 @@ const props = defineProps({
|
|
|
69
78
|
label: { type: null as unknown as PropType<string | null>, default: 'Tree' },
|
|
70
79
|
marquee: { type: null as unknown as PropType<boolean | null>, default: false },
|
|
71
80
|
maxDepth: { type: null as unknown as PropType<number | null>, default: 0 },
|
|
81
|
+
moveActivation: {
|
|
82
|
+
type: null as unknown as PropType<'click' | 'keyboard-touch' | null>,
|
|
83
|
+
default: 'click',
|
|
84
|
+
},
|
|
72
85
|
selection: {
|
|
73
86
|
type: null as unknown as PropType<'none' | 'single' | 'multiple' | null>,
|
|
74
87
|
default: 'none',
|
|
@@ -80,6 +93,7 @@ const acceptedProps: Record<string, unknown> = {
|
|
|
80
93
|
label: 'Tree',
|
|
81
94
|
marquee: false,
|
|
82
95
|
maxDepth: 0,
|
|
96
|
+
moveActivation: 'click',
|
|
83
97
|
selection: 'none',
|
|
84
98
|
}
|
|
85
99
|
const checkedProps = computed(() => ({
|
|
@@ -118,6 +132,13 @@ const checkedProps = computed(() => ({
|
|
|
118
132
|
'maxDepth',
|
|
119
133
|
acceptedProps,
|
|
120
134
|
) as number,
|
|
135
|
+
moveActivation: checkedProp<'click' | 'keyboard-touch'>(
|
|
136
|
+
props['moveActivation'],
|
|
137
|
+
{ kind: 'terminal', name: 'keyword' },
|
|
138
|
+
false,
|
|
139
|
+
'moveActivation',
|
|
140
|
+
acceptedProps,
|
|
141
|
+
) as 'click' | 'keyboard-touch',
|
|
121
142
|
selection: checkedProp<'none' | 'single' | 'multiple'>(
|
|
122
143
|
props['selection'],
|
|
123
144
|
{ kind: 'terminal', name: 'keyword' },
|
|
@@ -312,7 +333,15 @@ useComponentHost(() => import('../components/ui-tree/ui-tree.js'), {
|
|
|
312
333
|
? (incoming[name] ?? incoming[kebab] ?? null)
|
|
313
334
|
: null
|
|
314
335
|
},
|
|
315
|
-
propNames: [
|
|
336
|
+
propNames: [
|
|
337
|
+
'density',
|
|
338
|
+
'hoverExpandDelay',
|
|
339
|
+
'label',
|
|
340
|
+
'marquee',
|
|
341
|
+
'maxDepth',
|
|
342
|
+
'moveActivation',
|
|
343
|
+
'selection',
|
|
344
|
+
],
|
|
316
345
|
propValidity: (name: string) =>
|
|
317
346
|
propValidityState({ contract: propValidityContract, values: { ...props } }, name),
|
|
318
347
|
})
|
|
@@ -335,6 +364,7 @@ useComponentHost(() => import('../components/ui-tree/ui-tree.js'), {
|
|
|
335
364
|
:data-label="reflectedProp('label', 'label', checkedProps.label, undefined, false)"
|
|
336
365
|
:data-marquee="reflectedProp('marquee', 'marquee', checkedProps.marquee, undefined, false)"
|
|
337
366
|
:data-max-depth="reflectedProp('maxDepth', 'max-depth', checkedProps.maxDepth, undefined, false)"
|
|
367
|
+
:data-move-activation="reflectedProp('moveActivation', 'move-activation', checkedProps.moveActivation, undefined, false)"
|
|
338
368
|
:data-selection="reflectedProp('selection', 'selection', checkedProps.selection, undefined, false)"
|
|
339
369
|
:data-ui-tree-state="hostState || undefined"
|
|
340
370
|
ref="root"
|
package/vue/UiTreeItem.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
declare var __VLS_1: {}, __VLS_3: {},
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_11: {}, __VLS_13: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
4
|
leading?: (props: typeof __VLS_1) => any;
|
|
5
5
|
} & {
|
|
6
6
|
label?: (props: typeof __VLS_3) => any;
|
|
7
7
|
} & {
|
|
8
|
-
actions?: (props: typeof
|
|
8
|
+
actions?: (props: typeof __VLS_11) => any;
|
|
9
9
|
} & {
|
|
10
|
-
default?: (props: typeof
|
|
10
|
+
default?: (props: typeof __VLS_13) => any;
|
|
11
11
|
};
|
|
12
12
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
13
13
|
accepts: {
|
package/vue/UiTreeItem.vue
CHANGED
|
@@ -4,6 +4,7 @@ import { computed, getCurrentInstance, provide, ref, useTemplateRef, watchSyncEf
|
|
|
4
4
|
import type { PropType } from 'vue'
|
|
5
5
|
import { createDispatch, useComponentHost } from './host'
|
|
6
6
|
import { checkedProp, propValidityState, vPropValidity } from './props'
|
|
7
|
+
import UiButton from './UiButton.vue'
|
|
7
8
|
|
|
8
9
|
defineOptions({ inheritAttrs: false })
|
|
9
10
|
|
|
@@ -109,7 +110,7 @@ const propValidityContract = {
|
|
|
109
110
|
required: false,
|
|
110
111
|
target: { attribute: 'sortable' },
|
|
111
112
|
description:
|
|
112
|
-
'Gives the item a move handle. Drag it, or activate it and choose a target by a second click or the keyboard. The tree reports reorder and leaves moving the
|
|
113
|
+
'Gives the item a move handle. Drag it, or activate it according to the tree\'s moveActivation and choose a target by a second click or the keyboard. A\n guided move exposes Cancel on this row. The tree reports reorder and leaves moving the item to you. Needs itemId; disabled items show no handle.',
|
|
113
114
|
default: false,
|
|
114
115
|
},
|
|
115
116
|
subtreeDepth: {
|
|
@@ -316,6 +317,7 @@ const internalExpanded = ref(false)
|
|
|
316
317
|
const structuralLevel = ref(1)
|
|
317
318
|
const tabStop = ref(false)
|
|
318
319
|
const isContainer = ref(false)
|
|
320
|
+
const moving = ref(false)
|
|
319
321
|
let guardedPrevious: any
|
|
320
322
|
const guarded = computed(() => {
|
|
321
323
|
if (!(structuralLevel.value == null || Number.isInteger(structuralLevel.value))) {
|
|
@@ -342,6 +344,7 @@ provide('html-next:ui-tree-item:internalExpanded', internalExpanded)
|
|
|
342
344
|
provide('html-next:ui-tree-item:structuralLevel', structuralLevel)
|
|
343
345
|
provide('html-next:ui-tree-item:tabStop', tabStop)
|
|
344
346
|
provide('html-next:ui-tree-item:isContainer', isContainer)
|
|
347
|
+
provide('html-next:ui-tree-item:moving', moving)
|
|
345
348
|
const hydrationNode = hydrationInstance?.vnode.el
|
|
346
349
|
if (
|
|
347
350
|
typeof window !== 'undefined' && hydrationNode != null
|
|
@@ -427,8 +430,21 @@ useComponentHost(() => import('../components/ui-tree-item/ui-tree-item.js'), {
|
|
|
427
430
|
actions: actionsElement,
|
|
428
431
|
children: childrenElement,
|
|
429
432
|
},
|
|
430
|
-
state: { internalExpanded, structuralLevel, tabStop, isContainer },
|
|
433
|
+
state: { internalExpanded, structuralLevel, tabStop, isContainer, moving },
|
|
431
434
|
})
|
|
435
|
+
|
|
436
|
+
function text(value: unknown): string {
|
|
437
|
+
if (Array.isArray(value)) return value.map(text).join(' ')
|
|
438
|
+
return value === null || value === undefined || typeof value === 'object' ? '' : String(value)
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function attribute(value: unknown): any {
|
|
442
|
+
if (
|
|
443
|
+
value === null || value === undefined || value === false
|
|
444
|
+
|| (typeof value === 'object' && !Array.isArray(value))
|
|
445
|
+
) return undefined
|
|
446
|
+
return value === true ? '' : text(value)
|
|
447
|
+
}
|
|
432
448
|
</script>
|
|
433
449
|
|
|
434
450
|
<template>
|
|
@@ -464,7 +480,22 @@ useComponentHost(() => import('../components/ui-tree-item/ui-tree-item.js'), {
|
|
|
464
480
|
class="drag-handle"
|
|
465
481
|
type="button"
|
|
466
482
|
draggable="true"
|
|
467
|
-
:aria-label="
|
|
483
|
+
:aria-label="typeof ((({
|
|
484
|
+
true: `Cancel moving ${checkedProps.label ?? ''}`,
|
|
485
|
+
false: `Drag ${checkedProps.label ?? ''} to reorder`,
|
|
486
|
+
}) as Record<string, any>)[`${moving}`]) === 'boolean'
|
|
487
|
+
? String(
|
|
488
|
+
(({
|
|
489
|
+
true: `Cancel moving ${checkedProps.label ?? ''}`,
|
|
490
|
+
false: `Drag ${checkedProps.label ?? ''} to reorder`,
|
|
491
|
+
}) as Record<string, any>)[`${moving}`],
|
|
492
|
+
)
|
|
493
|
+
: attribute(
|
|
494
|
+
(({
|
|
495
|
+
true: `Cancel moving ${checkedProps.label ?? ''}`,
|
|
496
|
+
false: `Drag ${checkedProps.label ?? ''} to reorder`,
|
|
497
|
+
}) as Record<string, any>)[`${moving}`],
|
|
498
|
+
)"
|
|
468
499
|
ref="dragHandle"
|
|
469
500
|
>
|
|
470
501
|
<svg
|
|
@@ -506,7 +537,15 @@ useComponentHost(() => import('../components/ui-tree-item/ui-tree-item.js'), {
|
|
|
506
537
|
<span class="label" ref="label"><span class="label-text" ref="labelText"><slot name="label">{{
|
|
507
538
|
checkedProps.label
|
|
508
539
|
}}</slot></span></span>
|
|
509
|
-
<span class="actions" ref="actions"><
|
|
540
|
+
<span class="actions" ref="actions"><UiButton
|
|
541
|
+
v-if="moving"
|
|
542
|
+
data-tree-cancel-move=""
|
|
543
|
+
variant="ghost"
|
|
544
|
+
tone="neutral"
|
|
545
|
+
size="sm"
|
|
546
|
+
aria-label="Cancel move"
|
|
547
|
+
>Cancel</UiButton>
|
|
548
|
+
<span><slot name="actions" /></span></span>
|
|
510
549
|
<span class="drop-indicator row-drop-indicator" aria-hidden="true"></span>
|
|
511
550
|
</div>
|
|
512
551
|
<div class="children" role="group" :hidden="guardedBinding2" ref="children"><slot /></div>
|
|
@@ -600,7 +639,12 @@ useComponentHost(() => import('../components/ui-tree-item/ui-tree-item.js'), {
|
|
|
600
639
|
background: var(--ui-disabled-surface);
|
|
601
640
|
}
|
|
602
641
|
|
|
603
|
-
[data-component~="ui-tree-item"][data-dragging] .row {
|
|
642
|
+
[data-component~="ui-tree-item"][data-dragging]:not([data-move-source]) .row {
|
|
643
|
+
opacity: 0.42;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
[data-component~="ui-tree-item"][data-move-source] > .row > .label,
|
|
647
|
+
[data-component~="ui-tree-item"][data-move-source] > .row > .leading {
|
|
604
648
|
opacity: 0.42;
|
|
605
649
|
}
|
|
606
650
|
|
|
@@ -775,7 +819,8 @@ useComponentHost(() => import('../components/ui-tree-item/ui-tree-item.js'), {
|
|
|
775
819
|
/* The controls sit over the label's end, so the text fades out where they begin. The fade is
|
|
776
820
|
the truncation mark while it shows: an ellipsis under it would read as a second one. */
|
|
777
821
|
.row:hover > .label,
|
|
778
|
-
.row:focus-within > .label
|
|
822
|
+
.row:focus-within > .label,
|
|
823
|
+
[data-component~="ui-tree-item"][data-move-source] > .row > .label {
|
|
779
824
|
text-overflow: clip;
|
|
780
825
|
mask-image: linear-gradient(
|
|
781
826
|
to right,
|
|
@@ -785,7 +830,8 @@ useComponentHost(() => import('../components/ui-tree-item/ui-tree-item.js'), {
|
|
|
785
830
|
}
|
|
786
831
|
|
|
787
832
|
.row:hover > .label:dir(rtl),
|
|
788
|
-
.row:focus-within > .label:dir(rtl)
|
|
833
|
+
.row:focus-within > .label:dir(rtl),
|
|
834
|
+
[data-component~="ui-tree-item"][data-move-source] > .row > .label:dir(rtl) {
|
|
789
835
|
mask-image: linear-gradient(
|
|
790
836
|
to left,
|
|
791
837
|
#000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-1)),
|
|
@@ -872,7 +918,8 @@ useComponentHost(() => import('../components/ui-tree-item/ui-tree-item.js'), {
|
|
|
872
918
|
}
|
|
873
919
|
|
|
874
920
|
.row:hover > .actions,
|
|
875
|
-
.row:focus-within > .actions
|
|
921
|
+
.row:focus-within > .actions,
|
|
922
|
+
[data-component~="ui-tree-item"][data-move-source] > .row > .actions {
|
|
876
923
|
opacity: 1;
|
|
877
924
|
pointer-events: auto;
|
|
878
925
|
}
|
|
@@ -167,7 +167,7 @@ var UiDisclosure_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
167
167
|
},
|
|
168
168
|
required: false,
|
|
169
169
|
target: { attribute: "variant" },
|
|
170
|
-
description: "Navigation shares icon columns, spacing, type, hover, and corners with Nav Item. Plain retains the standard disclosure treatment.",
|
|
170
|
+
description: "Navigation shares icon columns, spacing, type, hover, and corners with Nav Item, while keeping expanded sections neutral: opening content is not route\n selection. Plain retains the standard disclosure treatment.",
|
|
171
171
|
values: ["plain", "navigation"],
|
|
172
172
|
default: "plain"
|
|
173
173
|
}
|
|
@@ -385,6 +385,6 @@ var UiDisclosure_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
385
385
|
}]]);
|
|
386
386
|
};
|
|
387
387
|
}
|
|
388
|
-
}), [["__scopeId", "data-v-
|
|
388
|
+
}), [["__scopeId", "data-v-a6fee58b"]]);
|
|
389
389
|
//#endregion
|
|
390
390
|
export { UiDisclosure_default as t };
|