@threadlabs/looma 0.25.6 → 0.25.7
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-tree-item/ui-tree-item.html +14 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-tree-item.css +13 -0
- package/vanilla/UiTreeItem.d.ts +1 -0
- package/vanilla/UiTreeItem.js +1 -1
- package/vue/UiTreeItem.d.ts +9 -0
- package/vue/UiTreeItem.vue +35 -0
- package/vue/chunks/UiTreeItem.js +24 -1
- package/vue/components.css +115 -100
package/package.json
CHANGED
package/styles/ui-tree-item.css
CHANGED
|
@@ -253,6 +253,7 @@
|
|
|
253
253
|
the truncation mark while it shows: an ellipsis under it would read as a second one. */
|
|
254
254
|
.row:hover > .label,
|
|
255
255
|
.row:focus-within > .label,
|
|
256
|
+
:scope[data-ui-tree-item-state~="actionsVisible"] > .row > .label,
|
|
256
257
|
:scope[data-move-source] > .row > .label {
|
|
257
258
|
text-overflow: clip;
|
|
258
259
|
mask-image: linear-gradient(
|
|
@@ -264,6 +265,7 @@
|
|
|
264
265
|
|
|
265
266
|
.row:hover > .label:dir(rtl),
|
|
266
267
|
.row:focus-within > .label:dir(rtl),
|
|
268
|
+
:scope[data-ui-tree-item-state~="actionsVisible"] > .row > .label:dir(rtl),
|
|
267
269
|
:scope[data-move-source] > .row > .label:dir(rtl) {
|
|
268
270
|
mask-image: linear-gradient(
|
|
269
271
|
to left,
|
|
@@ -331,6 +333,7 @@
|
|
|
331
333
|
|
|
332
334
|
.row:hover > .actions,
|
|
333
335
|
.row:focus-within > .actions,
|
|
336
|
+
:scope[data-ui-tree-item-state~="actionsVisible"] > .row > .actions,
|
|
334
337
|
:scope[data-move-source] > .row > .actions {
|
|
335
338
|
opacity: 1;
|
|
336
339
|
pointer-events: auto;
|
|
@@ -367,6 +370,14 @@
|
|
|
367
370
|
);
|
|
368
371
|
}
|
|
369
372
|
|
|
373
|
+
/* Persistent content has its own column on touch. Fade only the label's end. */
|
|
374
|
+
:scope[data-ui-tree-item-state~="actionsVisible"] > .row > .label {
|
|
375
|
+
mask-image: linear-gradient(to right, #000 calc(100% - var(--ui-space-1)), transparent 100%);
|
|
376
|
+
}
|
|
377
|
+
:scope[data-ui-tree-item-state~="actionsVisible"] > .row > .label:dir(rtl) {
|
|
378
|
+
mask-image: linear-gradient(to left, #000 calc(100% - var(--ui-space-1)), transparent 100%);
|
|
379
|
+
}
|
|
380
|
+
|
|
370
381
|
.row[data-ui-marquee] > .label:dir(rtl) {
|
|
371
382
|
mask-image: linear-gradient(
|
|
372
383
|
to left,
|
|
@@ -620,6 +631,8 @@
|
|
|
620
631
|
|
|
621
632
|
/* Without hover there is no reveal, so the controls keep their own column. */
|
|
622
633
|
@media (hover: none), (pointer: coarse) {
|
|
634
|
+
|
|
635
|
+
/* Persistent content has its own column on touch. Fade only the label's end. */
|
|
623
636
|
}
|
|
624
637
|
|
|
625
638
|
/* The handle sits beside what it drags. A leaf row has no disclosure, so the handle takes that
|
package/vanilla/UiTreeItem.d.ts
CHANGED
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":"{ true: concat('Cancel moving ', label), false: concat('Drag ', label, ' to reorder') }[concat(moving)]","expressionPlan":{"source":"{ true: concat('Cancel moving ', label), false: concat('Drag ', label, ' to reorder') }[concat(moving)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"call","fn":"concat","args":[{"kind":"literal","value":"Cancel moving "},{"kind":"id","name":"label"}]}},{"key":"false","value":{"kind":"call","fn":"concat","args":[{"kind":"literal","value":"Drag "},{"kind":"id","name":"label"},{"kind":"literal","value":" to reorder"}]}}]},"index":{"kind":"call","fn":"concat","args":[{"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":"concat('Select ', label)","expressionPlan":{"source":"concat('Select ', label)","ast":{"kind":"call","fn":"concat","args":[{"kind":"literal","value":"Select "},{"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":"text","value":"$label","expressionPlan":{"source":"$label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"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:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-tree-item","props":{"accepts":{"type":"string","required":false,"target":{"attribute":"data-accepts"},"default":""},"actionsVisible":{"type":"boolean","required":false,"target":{"attribute":"actionsvisible"},"default":false},"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: concat('Cancel moving ', label), false: concat('Drag ', label, ' to reorder') }[concat(moving)]","expressionPlan":{"source":"{ true: concat('Cancel moving ', label), false: concat('Drag ', label, ' to reorder') }[concat(moving)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"call","fn":"concat","args":[{"kind":"literal","value":"Cancel moving "},{"kind":"id","name":"label"}]}},{"key":"false","value":{"kind":"call","fn":"concat","args":[{"kind":"literal","value":"Drag "},{"kind":"id","name":"label"},{"kind":"literal","value":" to reorder"}]}}]},"index":{"kind":"call","fn":"concat","args":[{"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":"concat('Select ', label)","expressionPlan":{"source":"concat('Select ', label)","ast":{"kind":"call","fn":"concat","args":[{"kind":"literal","value":"Select "},{"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":"text","value":"$label","expressionPlan":{"source":"$label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"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;
|
package/vue/UiTreeItem.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
|
|
|
6
6
|
type: PropType<string | null>;
|
|
7
7
|
default: string;
|
|
8
8
|
};
|
|
9
|
+
actionsVisible: {
|
|
10
|
+
type: PropType<boolean | null>;
|
|
11
|
+
default: boolean;
|
|
12
|
+
};
|
|
9
13
|
container: {
|
|
10
14
|
type: PropType<boolean | null>;
|
|
11
15
|
default: boolean;
|
|
@@ -70,6 +74,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
|
|
|
70
74
|
type: PropType<string | null>;
|
|
71
75
|
default: string;
|
|
72
76
|
};
|
|
77
|
+
actionsVisible: {
|
|
78
|
+
type: PropType<boolean | null>;
|
|
79
|
+
default: boolean;
|
|
80
|
+
};
|
|
73
81
|
container: {
|
|
74
82
|
type: PropType<boolean | null>;
|
|
75
83
|
default: boolean;
|
|
@@ -136,6 +144,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
|
|
|
136
144
|
disabled: boolean | null;
|
|
137
145
|
expanded: boolean | null;
|
|
138
146
|
accepts: string | null;
|
|
147
|
+
actionsVisible: boolean | null;
|
|
139
148
|
container: boolean | null;
|
|
140
149
|
dragType: string | null;
|
|
141
150
|
dropDepth: number | null;
|
package/vue/UiTreeItem.vue
CHANGED
|
@@ -30,6 +30,14 @@ const propValidityContract = {
|
|
|
30
30
|
'A comma-separated list of the dragType values this branch accepts dropped inside it. Empty accepts any type. It does not affect drops before or after the\n item.',
|
|
31
31
|
default: '',
|
|
32
32
|
},
|
|
33
|
+
actionsVisible: {
|
|
34
|
+
type: { kind: 'terminal', name: 'boolean' },
|
|
35
|
+
required: false,
|
|
36
|
+
target: { attribute: 'actionsvisible' },
|
|
37
|
+
description:
|
|
38
|
+
'Keeps the actions slot visible before hover or focus, for persistent status or controls. The label fades beneath its measured width on pointer devices;\n touch rows retain a separate actions column with a short end fade. Does not change keyboard navigation or start the marquee.',
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
33
41
|
container: {
|
|
34
42
|
type: { kind: 'terminal', name: 'boolean' },
|
|
35
43
|
required: false,
|
|
@@ -136,6 +144,7 @@ const propValidityContract = {
|
|
|
136
144
|
} as const
|
|
137
145
|
const props = defineProps({
|
|
138
146
|
accepts: { type: null as unknown as PropType<string | null>, default: '' },
|
|
147
|
+
actionsVisible: { type: null as unknown as PropType<boolean | null>, default: false },
|
|
139
148
|
container: { type: null as unknown as PropType<boolean | null>, default: false },
|
|
140
149
|
disabled: { type: null as unknown as PropType<boolean | null>, default: false },
|
|
141
150
|
dragType: { type: null as unknown as PropType<string | null>, default: 'item' },
|
|
@@ -152,6 +161,7 @@ const props = defineProps({
|
|
|
152
161
|
})
|
|
153
162
|
const acceptedProps: Record<string, unknown> = {
|
|
154
163
|
accepts: '',
|
|
164
|
+
actionsVisible: false,
|
|
155
165
|
container: false,
|
|
156
166
|
disabled: false,
|
|
157
167
|
dragType: 'item',
|
|
@@ -174,6 +184,13 @@ const checkedProps = computed(() => ({
|
|
|
174
184
|
'accepts',
|
|
175
185
|
acceptedProps,
|
|
176
186
|
) as string,
|
|
187
|
+
actionsVisible: checkedProp<boolean>(
|
|
188
|
+
props['actionsVisible'],
|
|
189
|
+
{ kind: 'terminal', name: 'boolean' },
|
|
190
|
+
false,
|
|
191
|
+
'actionsVisible',
|
|
192
|
+
acceptedProps,
|
|
193
|
+
) as boolean,
|
|
177
194
|
container: checkedProp<boolean>(
|
|
178
195
|
props['container'],
|
|
179
196
|
{ kind: 'terminal', name: 'boolean' },
|
|
@@ -486,6 +503,7 @@ const hostState = computed(() =>
|
|
|
486
503
|
[
|
|
487
504
|
checkedProps.value.selected && 'selected',
|
|
488
505
|
checkedProps.value.disabled && 'disabled',
|
|
506
|
+
checkedProps.value.actionsVisible && 'actionsVisible',
|
|
489
507
|
isContainer.value && 'isContainer',
|
|
490
508
|
].filter(Boolean).join(' ')
|
|
491
509
|
)
|
|
@@ -536,6 +554,7 @@ useComponentHost(() => import('../components/ui-tree-item/ui-tree-item.js'), {
|
|
|
536
554
|
},
|
|
537
555
|
propNames: [
|
|
538
556
|
'accepts',
|
|
557
|
+
'actionsVisible',
|
|
539
558
|
'container',
|
|
540
559
|
'disabled',
|
|
541
560
|
'dragType',
|
|
@@ -608,6 +627,7 @@ function concat<T extends unknown[]>(...values: T): ConcatResult<T> {
|
|
|
608
627
|
:aria-disabled="checkedProps.disabled ?? undefined"
|
|
609
628
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
610
629
|
:data-accepts="reflectedProp('accepts', 'accepts', checkedProps.accepts, undefined, true)"
|
|
630
|
+
:data-actions-visible="reflectedProp('actionsVisible', 'actions-visible', checkedProps.actionsVisible, undefined, false)"
|
|
611
631
|
:data-container="reflectedProp('container', 'container', checkedProps.container, undefined, false)"
|
|
612
632
|
:data-disabled="reflectedProp('disabled', 'disabled', checkedProps.disabled, undefined, false)"
|
|
613
633
|
:data-drag-type="reflectedProp('dragType', 'drag-type', checkedProps.dragType, undefined, true)"
|
|
@@ -957,6 +977,7 @@ function concat<T extends unknown[]>(...values: T): ConcatResult<T> {
|
|
|
957
977
|
the truncation mark while it shows: an ellipsis under it would read as a second one. */
|
|
958
978
|
.row:hover > .label,
|
|
959
979
|
.row:focus-within > .label,
|
|
980
|
+
[data-component~="ui-tree-item"][data-ui-tree-item-state~="actionsVisible"] > .row > .label,
|
|
960
981
|
[data-component~="ui-tree-item"][data-move-source] > .row > .label {
|
|
961
982
|
text-overflow: clip;
|
|
962
983
|
mask-image: linear-gradient(
|
|
@@ -968,6 +989,9 @@ function concat<T extends unknown[]>(...values: T): ConcatResult<T> {
|
|
|
968
989
|
|
|
969
990
|
.row:hover > .label:dir(rtl),
|
|
970
991
|
.row:focus-within > .label:dir(rtl),
|
|
992
|
+
[data-component~="ui-tree-item"][data-ui-tree-item-state~="actionsVisible"]
|
|
993
|
+
> .row
|
|
994
|
+
> .label:dir(rtl),
|
|
971
995
|
[data-component~="ui-tree-item"][data-move-source] > .row > .label:dir(rtl) {
|
|
972
996
|
mask-image: linear-gradient(
|
|
973
997
|
to left,
|
|
@@ -1056,6 +1080,7 @@ function concat<T extends unknown[]>(...values: T): ConcatResult<T> {
|
|
|
1056
1080
|
|
|
1057
1081
|
.row:hover > .actions,
|
|
1058
1082
|
.row:focus-within > .actions,
|
|
1083
|
+
[data-component~="ui-tree-item"][data-ui-tree-item-state~="actionsVisible"] > .row > .actions,
|
|
1059
1084
|
[data-component~="ui-tree-item"][data-move-source] > .row > .actions {
|
|
1060
1085
|
opacity: 1;
|
|
1061
1086
|
pointer-events: auto;
|
|
@@ -1094,6 +1119,16 @@ function concat<T extends unknown[]>(...values: T): ConcatResult<T> {
|
|
|
1094
1119
|
);
|
|
1095
1120
|
}
|
|
1096
1121
|
|
|
1122
|
+
/* Persistent content has its own column on touch. Fade only the label's end. */
|
|
1123
|
+
[data-component~="ui-tree-item"][data-ui-tree-item-state~="actionsVisible"] > .row > .label {
|
|
1124
|
+
mask-image: linear-gradient(to right, #000 calc(100% - var(--ui-space-1)), transparent 100%);
|
|
1125
|
+
}
|
|
1126
|
+
[data-component~="ui-tree-item"][data-ui-tree-item-state~="actionsVisible"]
|
|
1127
|
+
> .row
|
|
1128
|
+
> .label:dir(rtl) {
|
|
1129
|
+
mask-image: linear-gradient(to left, #000 calc(100% - var(--ui-space-1)), transparent 100%);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1097
1132
|
.row[data-ui-marquee] > .label:dir(rtl) {
|
|
1098
1133
|
mask-image: linear-gradient(
|
|
1099
1134
|
to left,
|
package/vue/chunks/UiTreeItem.js
CHANGED
|
@@ -10,6 +10,7 @@ var _hoisted_1 = [
|
|
|
10
10
|
"aria-selected",
|
|
11
11
|
"aria-disabled",
|
|
12
12
|
"data-accepts",
|
|
13
|
+
"data-actions-visible",
|
|
13
14
|
"data-container",
|
|
14
15
|
"data-disabled",
|
|
15
16
|
"data-drag-type",
|
|
@@ -52,6 +53,10 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
52
53
|
type: null,
|
|
53
54
|
default: ""
|
|
54
55
|
},
|
|
56
|
+
actionsVisible: {
|
|
57
|
+
type: null,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
55
60
|
container: {
|
|
56
61
|
type: null,
|
|
57
62
|
default: false
|
|
@@ -118,6 +123,16 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
118
123
|
description: "A comma-separated list of the dragType values this branch accepts dropped inside it. Empty accepts any type. It does not affect drops before or after the\n item.",
|
|
119
124
|
default: ""
|
|
120
125
|
},
|
|
126
|
+
actionsVisible: {
|
|
127
|
+
type: {
|
|
128
|
+
kind: "terminal",
|
|
129
|
+
name: "boolean"
|
|
130
|
+
},
|
|
131
|
+
required: false,
|
|
132
|
+
target: { attribute: "actionsvisible" },
|
|
133
|
+
description: "Keeps the actions slot visible before hover or focus, for persistent status or controls. The label fades beneath its measured width on pointer devices;\n touch rows retain a separate actions column with a short end fade. Does not change keyboard navigation or start the marquee.",
|
|
134
|
+
default: false
|
|
135
|
+
},
|
|
121
136
|
container: {
|
|
122
137
|
type: {
|
|
123
138
|
kind: "terminal",
|
|
@@ -250,6 +265,7 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
250
265
|
const props = __props;
|
|
251
266
|
const acceptedProps = {
|
|
252
267
|
accepts: "",
|
|
268
|
+
actionsVisible: false,
|
|
253
269
|
container: false,
|
|
254
270
|
disabled: false,
|
|
255
271
|
dragType: "item",
|
|
@@ -269,6 +285,10 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
269
285
|
kind: "terminal",
|
|
270
286
|
name: "string"
|
|
271
287
|
}, false, "accepts", acceptedProps),
|
|
288
|
+
actionsVisible: checkedProp(props["actionsVisible"], {
|
|
289
|
+
kind: "terminal",
|
|
290
|
+
name: "boolean"
|
|
291
|
+
}, false, "actionsVisible", acceptedProps),
|
|
272
292
|
container: checkedProp(props["container"], {
|
|
273
293
|
kind: "terminal",
|
|
274
294
|
name: "boolean"
|
|
@@ -422,6 +442,7 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
422
442
|
const hostState = computed(() => [
|
|
423
443
|
checkedProps.value.selected && "selected",
|
|
424
444
|
checkedProps.value.disabled && "disabled",
|
|
445
|
+
checkedProps.value.actionsVisible && "actionsVisible",
|
|
425
446
|
isContainer.value && "isContainer"
|
|
426
447
|
].filter(Boolean).join(" "));
|
|
427
448
|
const isExpandDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && typeof detail["id"] === "string" && typeof detail["expanded"] === "boolean" && (detail["trigger"] === "keyboard" || detail["trigger"] === "pointer" || detail["trigger"] === "programmatic") && Object.keys(detail).every((key) => [
|
|
@@ -475,6 +496,7 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
475
496
|
},
|
|
476
497
|
propNames: [
|
|
477
498
|
"accepts",
|
|
499
|
+
"actionsVisible",
|
|
478
500
|
"container",
|
|
479
501
|
"disabled",
|
|
480
502
|
"dragType",
|
|
@@ -535,6 +557,7 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
535
557
|
"aria-selected": checkedProps.value.selected ?? void 0,
|
|
536
558
|
"aria-disabled": checkedProps.value.disabled ?? void 0,
|
|
537
559
|
"data-accepts": reflectedProp("accepts", "accepts", checkedProps.value.accepts, void 0, true),
|
|
560
|
+
"data-actions-visible": reflectedProp("actionsVisible", "actions-visible", checkedProps.value.actionsVisible, void 0, false),
|
|
538
561
|
"data-container": reflectedProp("container", "container", checkedProps.value.container, void 0, false),
|
|
539
562
|
"data-disabled": reflectedProp("disabled", "disabled", checkedProps.value.disabled, void 0, false),
|
|
540
563
|
"data-drag-type": reflectedProp("dragType", "drag-type", checkedProps.value.dragType, void 0, true),
|
|
@@ -676,6 +699,6 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
676
699
|
}]]);
|
|
677
700
|
};
|
|
678
701
|
}
|
|
679
|
-
}), [["__scopeId", "data-v-
|
|
702
|
+
}), [["__scopeId", "data-v-dc15f210"]]);
|
|
680
703
|
//#endregion
|
|
681
704
|
export { UiTreeItem_default as t };
|