@conduction/nextcloud-vue 2.56.0-beta.69 → 2.56.0-beta.70

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.
Files changed (180) hide show
  1. package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
  2. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +114 -11
  3. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
  4. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +67 -17
  5. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
  6. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue.js +9 -0
  7. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue.js.map +1 -0
  8. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue2.js +352 -0
  9. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue2.js.map +1 -0
  10. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue3.js +266 -0
  11. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue3.js.map +1 -0
  12. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
  13. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +257 -7
  14. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
  15. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js +113 -59
  16. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
  17. package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue.js +1 -1
  18. package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue2.js +210 -5
  19. package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue2.js.map +1 -1
  20. package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue3.js +134 -46
  21. package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue3.js.map +1 -1
  22. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue.js +9 -0
  23. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue.js.map +1 -0
  24. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue2.js +385 -0
  25. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue2.js.map +1 -0
  26. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue3.js +277 -0
  27. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue3.js.map +1 -0
  28. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
  29. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js +175 -20
  30. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
  31. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js +30 -8
  32. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
  33. package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue.js +1 -1
  34. package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue2.js +72 -6
  35. package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue2.js.map +1 -1
  36. package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue3.js +48 -14
  37. package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue3.js.map +1 -1
  38. package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue.js +1 -1
  39. package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js +162 -9
  40. package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js.map +1 -1
  41. package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js +63 -23
  42. package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js.map +1 -1
  43. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue.js +9 -0
  44. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue.js.map +1 -0
  45. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue2.js +175 -0
  46. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue2.js.map +1 -0
  47. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue3.js +114 -0
  48. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue3.js.map +1 -0
  49. package/dist/esm/components/CnDurationField/CnDurationField.vue.js +1 -1
  50. package/dist/esm/components/CnDurationField/CnDurationField.vue2.js +218 -4
  51. package/dist/esm/components/CnDurationField/CnDurationField.vue2.js.map +1 -1
  52. package/dist/esm/components/CnDurationField/CnDurationField.vue3.js +133 -44
  53. package/dist/esm/components/CnDurationField/CnDurationField.vue3.js.map +1 -1
  54. package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
  55. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  56. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +5 -1
  57. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  58. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue.js +9 -0
  59. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue.js.map +1 -0
  60. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue2.js +113 -0
  61. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue2.js.map +1 -0
  62. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue3.js +43 -0
  63. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue3.js.map +1 -0
  64. package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue.js +1 -1
  65. package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js +110 -1
  66. package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js.map +1 -1
  67. package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue3.js +60 -18
  68. package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue3.js.map +1 -1
  69. package/dist/esm/components/CnMenuTreeNode/CnMenuTreeNode.vue2.js +2 -2
  70. package/dist/esm/components/CnMenuTreeNode/CnMenuTreeNode.vue2.js.map +1 -1
  71. package/dist/esm/components/CnObjectKanban/CnObjectKanban.vue2.js +2 -2
  72. package/dist/esm/components/CnObjectKanban/CnObjectKanban.vue2.js.map +1 -1
  73. package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js +2 -2
  74. package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js.map +1 -1
  75. package/dist/esm/components/CnQrCode/CnQrCode.vue.js +9 -0
  76. package/dist/esm/components/CnQrCode/CnQrCode.vue.js.map +1 -0
  77. package/dist/esm/components/CnQrCode/CnQrCode.vue2.js +241 -0
  78. package/dist/esm/components/CnQrCode/CnQrCode.vue2.js.map +1 -0
  79. package/dist/esm/components/CnQrCode/CnQrCode.vue3.js +75 -0
  80. package/dist/esm/components/CnQrCode/CnQrCode.vue3.js.map +1 -0
  81. package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue.js +1 -1
  82. package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue2.js +34 -3
  83. package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue2.js.map +1 -1
  84. package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue3.js +81 -19
  85. package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue3.js.map +1 -1
  86. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  87. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +11 -0
  88. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  89. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +112 -88
  90. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  91. package/dist/esm/components/CnRevealField/CnRevealField.vue.js +9 -0
  92. package/dist/esm/components/CnRevealField/CnRevealField.vue.js.map +1 -0
  93. package/dist/esm/components/CnRevealField/CnRevealField.vue2.js +157 -0
  94. package/dist/esm/components/CnRevealField/CnRevealField.vue2.js.map +1 -0
  95. package/dist/esm/components/CnRevealField/CnRevealField.vue3.js +116 -0
  96. package/dist/esm/components/CnRevealField/CnRevealField.vue3.js.map +1 -0
  97. package/dist/esm/components/CnTextWidget/CnTextWidget.vue.js +1 -1
  98. package/dist/esm/components/CnTextWidget/CnTextWidget.vue2.js +43 -3
  99. package/dist/esm/components/CnTextWidget/CnTextWidget.vue2.js.map +1 -1
  100. package/dist/esm/components/CnTextWidget/CnTextWidget.vue3.js +19 -12
  101. package/dist/esm/components/CnTextWidget/CnTextWidget.vue3.js.map +1 -1
  102. package/dist/esm/components/CnTransferCard/CnTransferCard.vue.js +9 -0
  103. package/dist/esm/components/CnTransferCard/CnTransferCard.vue.js.map +1 -0
  104. package/dist/esm/components/CnTransferCard/CnTransferCard.vue2.js +87 -0
  105. package/dist/esm/components/CnTransferCard/CnTransferCard.vue2.js.map +1 -0
  106. package/dist/esm/components/CnTransferCard/CnTransferCard.vue3.js +126 -0
  107. package/dist/esm/components/CnTransferCard/CnTransferCard.vue3.js.map +1 -0
  108. package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
  109. package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js +66 -1
  110. package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
  111. package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +129 -29
  112. package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js.map +1 -1
  113. package/dist/esm/components/CnTreeView/CnTreeView.vue.js +1 -1
  114. package/dist/esm/components/CnTreeView/CnTreeView.vue2.js +158 -6
  115. package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
  116. package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +100 -39
  117. package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
  118. package/dist/esm/index.js +8 -0
  119. package/dist/esm/index.js.map +1 -1
  120. package/dist/esm/l10n/en.json.js +63 -1
  121. package/dist/esm/l10n/en.json.js.map +1 -1
  122. package/dist/esm/l10n/nl.json.js +63 -1
  123. package/dist/esm/l10n/nl.json.js.map +1 -1
  124. package/dist/esm/library-style.js +1 -1
  125. package/dist/esm/nextcloud-vue.css +1134 -499
  126. package/dist/esm/node_modules/vuedraggable/dist/vuedraggable.umd.js +2 -2
  127. package/dist/esm/utils/captureLocation.js +32 -0
  128. package/dist/esm/utils/captureLocation.js.map +1 -0
  129. package/dist/esm/utils/childRecordTotals.js +157 -0
  130. package/dist/esm/utils/childRecordTotals.js.map +1 -0
  131. package/dist/esm/utils/isoDuration.js +51 -1
  132. package/dist/esm/utils/isoDuration.js.map +1 -1
  133. package/dist/esm/utils/qr.js +649 -0
  134. package/dist/esm/utils/qr.js.map +1 -0
  135. package/dist/esm/utils/schema.js +3 -0
  136. package/dist/esm/utils/schema.js.map +1 -1
  137. package/dist/esm/utils/templateVariables.js +54 -0
  138. package/dist/esm/utils/templateVariables.js.map +1 -0
  139. package/dist/nextcloud-vue.cjs.js +20307 -14544
  140. package/dist/nextcloud-vue.cjs.js.map +2 -2
  141. package/dist/nextcloud-vue.css +1134 -499
  142. package/l10n/en.json +63 -1
  143. package/l10n/nl.json +63 -1
  144. package/package.json +1 -1
  145. package/src/components/CnActionDialog/CnActionDialog.vue +156 -9
  146. package/src/components/CnBlockListEditor/CnBlockListEditor.vue +615 -0
  147. package/src/components/CnBlockListEditor/index.js +9 -0
  148. package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +311 -10
  149. package/src/components/CnChildRecordsField/CnChildRecordsField.vue +306 -15
  150. package/src/components/CnChoiceMatrix/CnChoiceMatrix.vue +710 -0
  151. package/src/components/CnChoiceMatrix/index.js +9 -0
  152. package/src/components/CnCountdownWidget/CnCountdownWidget.vue +223 -28
  153. package/src/components/CnCreateFormWidget/CnCreateFormWidget.vue +97 -6
  154. package/src/components/CnDataMatrix/CnDataMatrix.vue +199 -13
  155. package/src/components/CnDisplayScreen/CnDisplayScreen.vue +308 -0
  156. package/src/components/CnDisplayScreen/index.js +9 -0
  157. package/src/components/CnDurationField/CnDurationField.vue +330 -5
  158. package/src/components/CnFormDialog/CnFormDialog.vue +4 -0
  159. package/src/components/CnGeoCaptureField/CnGeoCaptureField.vue +148 -0
  160. package/src/components/CnGeoCaptureField/index.js +9 -0
  161. package/src/components/CnMarkdownEditor/CnMarkdownEditor.vue +139 -1
  162. package/src/components/CnQrCode/CnQrCode.vue +321 -0
  163. package/src/components/CnQrCode/index.js +9 -0
  164. package/src/components/CnReadinessChecklist/CnReadinessChecklist.vue +80 -3
  165. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +34 -1
  166. package/src/components/CnRevealField/CnRevealField.vue +273 -0
  167. package/src/components/CnRevealField/index.js +9 -0
  168. package/src/components/CnTextWidget/CnTextWidget.vue +62 -3
  169. package/src/components/CnTransferCard/CnTransferCard.vue +205 -0
  170. package/src/components/CnTransferCard/index.js +9 -0
  171. package/src/components/CnTreeView/CnTreeNode.vue +145 -2
  172. package/src/components/CnTreeView/CnTreeView.vue +210 -6
  173. package/src/components/index.js +7 -0
  174. package/src/index.js +8 -0
  175. package/src/utils/captureLocation.js +29 -0
  176. package/src/utils/childRecordTotals.js +153 -0
  177. package/src/utils/isoDuration.js +50 -0
  178. package/src/utils/qr.js +681 -0
  179. package/src/utils/schema.js +3 -0
  180. package/src/utils/templateVariables.js +51 -0
@@ -1,29 +1,33 @@
1
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, mergeProps, withModifiers, toDisplayString, createCommentVNode, renderSlot, createTextVNode, Fragment, renderList, createBlock, createSlots, withCtx } from 'vue';
1
+ import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, mergeProps, Fragment, renderList, withModifiers, createVNode, toDisplayString, createCommentVNode, renderSlot, createTextVNode, withCtx, createBlock, createSlots, normalizeProps, guardReactiveProps } from 'vue';
2
2
 
3
3
  const _hoisted_1 = ["data-node-id", "aria-expanded", "aria-selected"];
4
4
  const _hoisted_2 = ["tabindex"];
5
- const _hoisted_3 = ["aria-label"];
6
- const _hoisted_4 = {
5
+ const _hoisted_3 = ["title"];
6
+ const _hoisted_4 = ["aria-label"];
7
+ const _hoisted_5 = {
7
8
  key: 1,
8
9
  class: "cn-tree-node__toggle cn-tree-node__toggle--leaf"
9
10
  };
10
- const _hoisted_5 = {
11
+ const _hoisted_6 = {
11
12
  key: 2,
12
13
  class: "cn-tree-node__icon"
13
14
  };
14
- const _hoisted_6 = { class: "cn-tree-node__label" };
15
- const _hoisted_7 = {
15
+ const _hoisted_7 = { class: "cn-tree-node__label" };
16
+ const _hoisted_8 = {
16
17
  key: 3,
17
18
  class: "cn-tree-node__badge"
18
19
  };
19
- const _hoisted_8 = {
20
- key: 0,
20
+ const _hoisted_9 = {
21
+ key: 1,
21
22
  class: "cn-tree-node__children",
22
23
  role: "group"
23
24
  };
24
25
 
25
26
  function render(_ctx, _cache, $props, $setup, $data, $options) {
27
+ const _component_DragVertical = resolveComponent("DragVertical");
28
+ const _component_NcButton = resolveComponent("NcButton");
26
29
  const _component_CnTreeNode = resolveComponent("CnTreeNode", true);
30
+ const _component_Draggable = resolveComponent("Draggable");
27
31
 
28
32
  return (openBlock(), createElementBlock("li", {
29
33
  class: normalizeClass(["cn-tree-node", {
@@ -38,9 +42,20 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
38
42
  createElementVNode("div", mergeProps({ class: "cn-tree-node__row" }, $options.extraRowAttrs, {
39
43
  style: { paddingLeft: ($props.depth * $props.indent) + 'px' },
40
44
  tabindex: $props.focusableRows ? 0 : undefined,
41
- onClick: _cache[1] || (_cache[1] = (...args) => ($options.onRowClick && $options.onRowClick(...args))),
42
- onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onRowKeydown && $options.onRowKeydown(...args)))
45
+ onClick: _cache[5] || (_cache[5] = (...args) => ($options.onRowClick && $options.onRowClick(...args))),
46
+ onKeydown: _cache[6] || (_cache[6] = (...args) => ($options.onRowKeydown && $options.onRowKeydown(...args)))
43
47
  }), [
48
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.reorderSlots, (key) => {
49
+ return (openBlock(), createElementBlock("span", {
50
+ key: key,
51
+ class: "cn-tree-node__handle",
52
+ title: $props.reorderLabels.drag,
53
+ "aria-hidden": "true",
54
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
55
+ }, [
56
+ createVNode(_component_DragVertical, { size: 18 })
57
+ ], 8 /* PROPS */, _hoisted_3))
58
+ }), 128 /* KEYED_FRAGMENT */)),
44
59
  ($options.hasChildren)
45
60
  ? (openBlock(), createElementBlock("button", mergeProps({
46
61
  key: 0,
@@ -48,17 +63,17 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
48
63
  }, $options.extraToggleAttrs, {
49
64
  class: "cn-tree-node__toggle",
50
65
  "aria-label": $options.toggleLabel,
51
- onClick: _cache[0] || (_cache[0] = withModifiers((...args) => ($options.toggle && $options.toggle(...args)), ["stop"]))
66
+ onClick: _cache[1] || (_cache[1] = withModifiers((...args) => ($options.toggle && $options.toggle(...args)), ["stop"]))
52
67
  }), [
53
68
  createElementVNode("span", {
54
69
  class: normalizeClass(["cn-tree-node__caret", { 'cn-tree-node__caret--open': $options.isExpanded }])
55
70
  }, "▸", 2 /* CLASS */)
56
- ], 16 /* FULL_PROPS */, _hoisted_3))
57
- : (openBlock(), createElementBlock("span", _hoisted_4)),
71
+ ], 16 /* FULL_PROPS */, _hoisted_4))
72
+ : (openBlock(), createElementBlock("span", _hoisted_5)),
58
73
  ($props.node.icon)
59
- ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString($props.node.icon), 1 /* TEXT */))
74
+ ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString($props.node.icon), 1 /* TEXT */))
60
75
  : createCommentVNode("v-if", true),
61
- createElementVNode("span", _hoisted_6, [
76
+ createElementVNode("span", _hoisted_7, [
62
77
  renderSlot(_ctx.$slots, "label", {
63
78
  node: $props.node,
64
79
  depth: $props.depth,
@@ -68,18 +83,58 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
68
83
  ])
69
84
  ]),
70
85
  ($props.node.badge !== undefined)
71
- ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString($props.node.badge), 1 /* TEXT */))
86
+ ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString($props.node.badge), 1 /* TEXT */))
72
87
  : createCommentVNode("v-if", true),
88
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.reorderSlots, (key) => {
89
+ return (openBlock(), createElementBlock("span", {
90
+ key: key,
91
+ class: "cn-tree-node__move",
92
+ onClick: _cache[4] || (_cache[4] = withModifiers(() => {}, ["stop"]))
93
+ }, [
94
+ createVNode(_component_NcButton, {
95
+ variant: "tertiary",
96
+ disabled: $props.siblingIndex === 0,
97
+ "aria-label": $options.moveName($props.reorderLabels.moveUp),
98
+ "data-move": "up",
99
+ onClick: _cache[2] || (_cache[2] = $event => ($options.moveBy(-1)))
100
+ }, {
101
+ default: withCtx(() => [
102
+ createTextVNode(toDisplayString($props.reorderLabels.moveUp), 1 /* TEXT */)
103
+ ]),
104
+ _: 1 /* STABLE */
105
+ }, 8 /* PROPS */, ["disabled", "aria-label"]),
106
+ createVNode(_component_NcButton, {
107
+ variant: "tertiary",
108
+ disabled: $props.siblingIndex >= $props.siblingCount - 1,
109
+ "aria-label": $options.moveName($props.reorderLabels.moveDown),
110
+ "data-move": "down",
111
+ onClick: _cache[3] || (_cache[3] = $event => ($options.moveBy(1)))
112
+ }, {
113
+ default: withCtx(() => [
114
+ createTextVNode(toDisplayString($props.reorderLabels.moveDown), 1 /* TEXT */)
115
+ ]),
116
+ _: 1 /* STABLE */
117
+ }, 8 /* PROPS */, ["disabled", "aria-label"])
118
+ ]))
119
+ }), 128 /* KEYED_FRAGMENT */)),
73
120
  renderSlot(_ctx.$slots, "actions", {
74
121
  node: $props.node,
75
122
  depth: $props.depth
76
123
  })
77
124
  ], 16 /* FULL_PROPS */, _hoisted_2),
78
- ($options.hasChildren && $options.isExpanded)
79
- ? (openBlock(), createElementBlock("ul", _hoisted_8, [
80
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.node[$props.childrenKey], (child) => {
81
- return (openBlock(), createBlock(_component_CnTreeNode, {
82
- key: child[$props.idKey],
125
+ ($props.reorderable && $options.hasChildren && $options.isExpanded)
126
+ ? (openBlock(), createBlock(_component_Draggable, {
127
+ key: 0,
128
+ modelValue: $props.node[$props.childrenKey],
129
+ itemKey: $props.idKey,
130
+ tag: "ul",
131
+ class: "cn-tree-node__children",
132
+ role: "group",
133
+ handle: ".cn-tree-node__handle",
134
+ onChange: $options.onDragChange
135
+ }, {
136
+ item: withCtx(({ element: child, index }) => [
137
+ createVNode(_component_CnTreeNode, {
83
138
  node: child,
84
139
  depth: $props.depth + 1,
85
140
  indent: $props.indent,
@@ -93,11 +148,17 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
93
148
  toggleAttrs: $props.toggleAttrs,
94
149
  rowAttrs: $props.rowAttrs,
95
150
  focusableRows: $props.focusableRows,
96
- onToggle: _cache[3] || (_cache[3] = $event => (_ctx.$emit('toggle', $event))),
97
- onSelect: _cache[4] || (_cache[4] = $event => (_ctx.$emit('select', $event)))
151
+ reorderable: "",
152
+ reorderLabels: $props.reorderLabels,
153
+ parentId: $props.node[$props.idKey],
154
+ siblingIndex: index,
155
+ siblingCount: $props.node[$props.childrenKey].length,
156
+ onToggle: _cache[7] || (_cache[7] = $event => (_ctx.$emit('toggle', $event))),
157
+ onSelect: _cache[8] || (_cache[8] = $event => (_ctx.$emit('select', $event))),
158
+ onMove: _cache[9] || (_cache[9] = $event => (_ctx.$emit('move', $event)))
98
159
  }, createSlots({
99
160
  actions: withCtx((scope) => [
100
- renderSlot(_ctx.$slots, "actions", mergeProps({ ref_for: true }, scope))
161
+ renderSlot(_ctx.$slots, "actions", normalizeProps(guardReactiveProps(scope)))
101
162
  ]),
102
163
  _: 2 /* DYNAMIC */
103
164
  }, [
@@ -105,15 +166,54 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
105
166
  ? {
106
167
  name: "label",
107
168
  fn: withCtx((scope) => [
108
- renderSlot(_ctx.$slots, "label", mergeProps({ ref_for: true }, scope))
169
+ renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps(scope)))
109
170
  ]),
110
171
  key: "0"
111
172
  }
112
173
  : undefined
113
- ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["node", "depth", "indent", "expandedIds", "selectedId", "idKey", "labelKey", "childrenKey", "expandLabel", "collapseLabel", "toggleAttrs", "rowAttrs", "focusableRows"]))
114
- }), 128 /* KEYED_FRAGMENT */))
115
- ]))
116
- : createCommentVNode("v-if", true)
174
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["node", "depth", "indent", "expandedIds", "selectedId", "idKey", "labelKey", "childrenKey", "expandLabel", "collapseLabel", "toggleAttrs", "rowAttrs", "focusableRows", "reorderLabels", "parentId", "siblingIndex", "siblingCount"])
175
+ ]),
176
+ _: 3 /* FORWARDED */
177
+ }, 8 /* PROPS */, ["modelValue", "itemKey", "onChange"]))
178
+ : ($options.hasChildren && $options.isExpanded)
179
+ ? (openBlock(), createElementBlock("ul", _hoisted_9, [
180
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.node[$props.childrenKey], (child) => {
181
+ return (openBlock(), createBlock(_component_CnTreeNode, {
182
+ key: child[$props.idKey],
183
+ node: child,
184
+ depth: $props.depth + 1,
185
+ indent: $props.indent,
186
+ expandedIds: $props.expandedIds,
187
+ selectedId: $props.selectedId,
188
+ idKey: $props.idKey,
189
+ labelKey: $props.labelKey,
190
+ childrenKey: $props.childrenKey,
191
+ expandLabel: $props.expandLabel,
192
+ collapseLabel: $props.collapseLabel,
193
+ toggleAttrs: $props.toggleAttrs,
194
+ rowAttrs: $props.rowAttrs,
195
+ focusableRows: $props.focusableRows,
196
+ onToggle: _cache[10] || (_cache[10] = $event => (_ctx.$emit('toggle', $event))),
197
+ onSelect: _cache[11] || (_cache[11] = $event => (_ctx.$emit('select', $event)))
198
+ }, createSlots({
199
+ actions: withCtx((scope) => [
200
+ renderSlot(_ctx.$slots, "actions", mergeProps({ ref_for: true }, scope))
201
+ ]),
202
+ _: 2 /* DYNAMIC */
203
+ }, [
204
+ (_ctx.$slots.label)
205
+ ? {
206
+ name: "label",
207
+ fn: withCtx((scope) => [
208
+ renderSlot(_ctx.$slots, "label", mergeProps({ ref_for: true }, scope))
209
+ ]),
210
+ key: "0"
211
+ }
212
+ : undefined
213
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["node", "depth", "indent", "expandedIds", "selectedId", "idKey", "labelKey", "childrenKey", "expandLabel", "collapseLabel", "toggleAttrs", "rowAttrs", "focusableRows"]))
214
+ }), 128 /* KEYED_FRAGMENT */))
215
+ ]))
216
+ : createCommentVNode("v-if", true)
117
217
  ], 10 /* CLASS, PROPS */, _hoisted_1))
118
218
  }
119
219
 
@@ -1 +1 @@
1
- {"version":3,"file":"CnTreeNode.vue3.js","sources":["../../../../src/components/CnTreeView/CnTreeNode.vue?vue&type=template&id=aba6ea88&lang.js"],"sourcesContent":["<template>\n\t<li class=\"cn-tree-node\"\n\t\t:class=\"{\n\t\t\t'cn-tree-node--selected': isSelected,\n\t\t\t'cn-tree-node--expanded': isExpanded,\n\t\t}\"\n\t\t:data-node-id=\"node[idKey]\"\n\t\trole=\"treeitem\"\n\t\t:aria-expanded=\"hasChildren ? isExpanded : undefined\"\n\t\t:aria-selected=\"isSelected\">\n\t\t<div class=\"cn-tree-node__row\"\n\t\t\tv-bind=\"extraRowAttrs\"\n\t\t\t:style=\"{ paddingLeft: (depth * indent) + 'px' }\"\n\t\t\t:tabindex=\"focusableRows ? 0 : undefined\"\n\t\t\t@click=\"onRowClick\"\n\t\t\t@keydown=\"onRowKeydown\">\n\t\t\t<button v-if=\"hasChildren\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tv-bind=\"extraToggleAttrs\"\n\t\t\t\tclass=\"cn-tree-node__toggle\"\n\t\t\t\t:aria-label=\"toggleLabel\"\n\t\t\t\t@click.stop=\"toggle\">\n\t\t\t\t<span class=\"cn-tree-node__caret\" :class=\"{ 'cn-tree-node__caret--open': isExpanded }\">▸</span>\n\t\t\t</button>\n\t\t\t<span v-else class=\"cn-tree-node__toggle cn-tree-node__toggle--leaf\" />\n\n\t\t\t<span v-if=\"node.icon\" class=\"cn-tree-node__icon\">{{ node.icon }}</span>\n\t\t\t<span class=\"cn-tree-node__label\">\n\t\t\t\t<!-- @slot label The row's label. Scope: { node, depth, expanded }. Defaults to the node's label text. -->\n\t\t\t\t<slot name=\"label\"\n\t\t\t\t\t:node=\"node\"\n\t\t\t\t\t:depth=\"depth\"\n\t\t\t\t\t:expanded=\"isExpanded\">{{ node[labelKey] }}</slot>\n\t\t\t</span>\n\t\t\t<span v-if=\"node.badge !== undefined\" class=\"cn-tree-node__badge\">{{ node.badge }}</span>\n\n\t\t\t<!-- @slot actions Inline per-row actions slot. Scope:\n\t\t\t { node, depth }. -->\n\t\t\t<slot name=\"actions\" :node=\"node\" :depth=\"depth\" />\n\t\t</div>\n\n\t\t<ul v-if=\"hasChildren && isExpanded\" class=\"cn-tree-node__children\" role=\"group\">\n\t\t\t<CnTreeNode v-for=\"child in node[childrenKey]\"\n\t\t\t\t:key=\"child[idKey]\"\n\t\t\t\t:node=\"child\"\n\t\t\t\t:depth=\"depth + 1\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedIds\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t:toggleAttrs=\"toggleAttrs\"\n\t\t\t\t:rowAttrs=\"rowAttrs\"\n\t\t\t\t:focusableRows=\"focusableRows\"\n\t\t\t\t@toggle=\"$emit('toggle', $event)\"\n\t\t\t\t@select=\"$emit('select', $event)\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</li>\n</template>\n\n<script>\n/**\n * CnTreeNode — Recursive tree row used inside CnTreeView. Renders\n * its own row + recurses for children when expanded. Not exported\n * as a separate barrel entry — consumers use CnTreeView and the\n * recursion is internal.\n */\nexport default {\n\tname: 'CnTreeNode',\n\tprops: {\n\t\t/** The node data. */\n\t\tnode: { type: Object, required: true },\n\t\t/** Depth (drives indent). */\n\t\tdepth: { type: Number, default: 0 },\n\t\t/** Pixels of padding per depth level. */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Set of expanded node ids. */\n\t\texpandedIds: { type: Object, required: true },\n\t\t/** Currently selected node id, read off `node[idKey]` (or null). */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Node-field key for the id. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Node-field key for the display label. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Node-field key for the children array. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** A11y label for the expand button, or `(node) => string`. */\n\t\texpandLabel: { type: [String, Function], default: 'Expand' },\n\t\t/** A11y label for the collapse button, or `(node) => string`. */\n\t\tcollapseLabel: { type: [String, Function], default: 'Collapse' },\n\t\t/** Extra expand-button attributes per node, `(node, depth) => object`. */\n\t\ttoggleAttrs: { type: Function, default: null },\n\t\t/** Extra row attributes per node, `(node, depth) => object`. */\n\t\trowAttrs: { type: Function, default: null },\n\t\t/** Rows take focus and select on Enter or Space. */\n\t\tfocusableRows: { type: Boolean, default: false },\n\t},\n\n\temits: ['select', 'toggle'],\n\tcomputed: {\n\t\t/**\n\t\t * Whether this node has any children at all.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\thasChildren() {\n\t\t\tconst c = this.node[this.childrenKey]\n\t\t\treturn Array.isArray(c) && c.length > 0\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is currently expanded.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisExpanded() {\n\t\t\treturn Boolean(this.expandedIds[this.node[this.idKey]])\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is the currently-selected one.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelected() {\n\t\t\treturn this.selectedId === this.node[this.idKey]\n\t\t},\n\n\t\t/**\n\t\t * The expand button's accessible name for this node.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\ttoggleLabel() {\n\t\t\tconst label = this.isExpanded ? this.collapseLabel : this.expandLabel\n\t\t\treturn typeof label === 'function' ? label(this.node) : label\n\t\t},\n\n\t\t/**\n\t\t * The host's extra attributes for this row.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\textraRowAttrs() {\n\t\t\treturn this.rowAttrs ? this.rowAttrs(this.node, this.depth) : {}\n\t\t},\n\n\t\t/**\n\t\t * The host's extra attributes for this row's expand button.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\textraToggleAttrs() {\n\t\t\treturn this.toggleAttrs ? this.toggleAttrs(this.node, this.depth) : {}\n\t\t},\n\t},\n\n\tmethods: {\n\t\ttoggle() {\n\t\t\tthis.$emit('toggle', this.node[this.idKey])\n\t\t},\n\n\t\tonRowClick() {\n\t\t\tthis.$emit('select', this.node)\n\t\t},\n\n\t\t/**\n\t\t * Enter or Space on a focusable row selects its node. Keys pressed on\n\t\t * the expand button or an action inside the row are theirs.\n\t\t *\n\t\t * @param {KeyboardEvent} event The key event.\n\t\t */\n\t\tonRowKeydown(event) {\n\t\t\tif (!this.focusableRows || event.target !== event.currentTarget) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.key === 'Enter' || event.key === ' ') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.$emit('select', this.node)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-node {\n\tlist-style: none;\n}\n\n.cn-tree-node__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 4px 6px;\n\tborder-radius: var(--border-radius);\n\tcursor: pointer;\n}\n\n.cn-tree-node__row:hover {\n\tbackground: var(--color-background-hover);\n}\n\n/* A row made focusable by `focusableRows` shows where keyboard focus is (WCAG 2.4.7). */\n.cn-tree-node__row[tabindex]:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: -2px;\n}\n\n.cn-tree-node--selected > .cn-tree-node__row {\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__toggle {\n\tbackground: none;\n\tborder: none;\n\tcursor: pointer;\n\tpadding: 0;\n\twidth: 18px;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.cn-tree-node__toggle--leaf {\n\tcursor: default;\n}\n\n.cn-tree-node__caret {\n\tdisplay: inline-block;\n\ttransition: transform 0.15s ease;\n\tfont-size: 0.9em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__caret--open {\n\ttransform: rotate(90deg);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__icon {\n\tfont-size: 0.9em;\n}\n\n.cn-tree-node__label {\n\tflex: 1 1 auto;\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-tree-node__badge {\n\tfont-size: 0.8em;\n\tpadding: 1px 6px;\n\tborder-radius: 9999px;\n\tbackground: var(--color-background-hover);\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__children {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":["_createElementBlock","_createElementVNode","_mergeProps","_openBlock","_normalizeClass","_toDisplayString","_renderSlot","_createTextVNode","_Fragment","_renderList","_createBlock","_withCtx"],"mappings":";;;;;;;AAwBgB,EAAA,KAAK,EAAC;;;;AAEI,EAAA,KAAK,EAAC,oBAAoB;;AAC3C,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,qBAAqB,GAAA;;;AAOK,EAAA,KAAK,EAAC,qBAAqB;;;;AAO7B,EAAA,KAAK,EAAC,wBAAuB;AAAE,EAAA,IAAI,EAAC,OAAO;;;;;;uBAxCjFA,kBAkEI,CAAA,IAAA,EAAA;AAlEA,IAAA,KAAK,kBAAC,cAAa,EAAA;6BACd,QAAA,CAAA,UAAA;6BAAA,QAAA,CAAA,UAAA;;IAIP,cAAY,EAAE,MAAI,CAAA,IAAA,CAAC,MAAK,CAAA,KAAA,CAAA;AACzB,IAAA,IAAI,EAAC,UAAS;AACb,IAAA,eAAa,EAAE,QAAA,CAAA,WAAU,GAAI,QAAA,CAAA,UAAW,GAAE,SAAS;AACnD,IAAA,eAAa,EAAE,QAAU,CAAA,UAAA;;AAC1B,IAAAC,kBAAA,CA6BK,OA7BLC,UA6BK,CAAA,EA7BA,KAAK,EAAC,mBAAkB,IACpB,QAAa,CAAA,aAAA,EAAA;MACpB,KAAK,EAAA,EAAA,WAAA,EAAA,CAAkB,MAAM,CAAA,KAAA,GAAE,MAAM,CAAA,MAAA,IAAA,IAAA,EAAA;MACrC,QAAQ,EAAE,MAAY,CAAA,aAAA,GAAA,CAAA,GAAQ,SAAS;AACvC,MAAA,OAAK,0CAAE,QAAU,CAAA,UAAA,IAAA,QAAA,CAAA,UAAA,CAAA,GAAA,IAAA,CAAA,CAAA,CAAA;AACjB,MAAA,SAAO,0CAAE,QAAY,CAAA,YAAA,IAAA,QAAA,CAAA,YAAA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AA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAE,IAAK,CAAA,KAAA,CAAA,QAAA,EAAW,MAAM,CAAA,CAAA,CAAA;cAC9B,QAAM,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAE,IAAK,CAAA,KAAA,CAAA,QAAA,EAAW,MAAM,CAAA,CAAA,CAAA;;cACpB,OAAO,EAAAC,OAAA,CACjB,CAAqC,KADb,KAAA;gBACxBL,UAAqC,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAArCJ,UAAqC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;AAEnB,cAAA,CAAA,IAAA,CAAA,MAAM,CAAC,KAAK;;0BAAG,OAAK;AACnC,oBAAA,EAAA,EAAAS,OAAA,CAAA,CADqC,KAAK,KAAA;sBAC1CL,UAAmC,CAAA,IAAA,CAAA,MAAA,EAAA,OAAA,EAAnCJ,UAAmC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnTreeNode.vue3.js","sources":["../../../../src/components/CnTreeView/CnTreeNode.vue?vue&type=template&id=367653e6&lang.js"],"sourcesContent":["<template>\n\t<li class=\"cn-tree-node\"\n\t\t:class=\"{\n\t\t\t'cn-tree-node--selected': isSelected,\n\t\t\t'cn-tree-node--expanded': isExpanded,\n\t\t}\"\n\t\t:data-node-id=\"node[idKey]\"\n\t\trole=\"treeitem\"\n\t\t:aria-expanded=\"hasChildren ? isExpanded : undefined\"\n\t\t:aria-selected=\"isSelected\">\n\t\t<div class=\"cn-tree-node__row\"\n\t\t\tv-bind=\"extraRowAttrs\"\n\t\t\t:style=\"{ paddingLeft: (depth * indent) + 'px' }\"\n\t\t\t:tabindex=\"focusableRows ? 0 : undefined\"\n\t\t\t@click=\"onRowClick\"\n\t\t\t@keydown=\"onRowKeydown\">\n\t\t\t<span v-for=\"key in reorderSlots\"\n\t\t\t\t:key=\"key\"\n\t\t\t\tclass=\"cn-tree-node__handle\"\n\t\t\t\t:title=\"reorderLabels.drag\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\t@click.stop>\n\t\t\t\t<DragVertical :size=\"18\" />\n\t\t\t</span>\n\t\t\t<button v-if=\"hasChildren\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tv-bind=\"extraToggleAttrs\"\n\t\t\t\tclass=\"cn-tree-node__toggle\"\n\t\t\t\t:aria-label=\"toggleLabel\"\n\t\t\t\t@click.stop=\"toggle\">\n\t\t\t\t<span class=\"cn-tree-node__caret\" :class=\"{ 'cn-tree-node__caret--open': isExpanded }\">▸</span>\n\t\t\t</button>\n\t\t\t<span v-else class=\"cn-tree-node__toggle cn-tree-node__toggle--leaf\" />\n\n\t\t\t<span v-if=\"node.icon\" class=\"cn-tree-node__icon\">{{ node.icon }}</span>\n\t\t\t<span class=\"cn-tree-node__label\">\n\t\t\t\t<!-- @slot label The row's label. Scope: { node, depth, expanded }. Defaults to the node's label text. -->\n\t\t\t\t<slot name=\"label\"\n\t\t\t\t\t:node=\"node\"\n\t\t\t\t\t:depth=\"depth\"\n\t\t\t\t\t:expanded=\"isExpanded\">{{ node[labelKey] }}</slot>\n\t\t\t</span>\n\t\t\t<span v-if=\"node.badge !== undefined\" class=\"cn-tree-node__badge\">{{ node.badge }}</span>\n\n\t\t\t<span v-for=\"key in reorderSlots\"\n\t\t\t\t:key=\"key\"\n\t\t\t\tclass=\"cn-tree-node__move\"\n\t\t\t\t@click.stop>\n\t\t\t\t<NcButton variant=\"tertiary\"\n\t\t\t\t\t:disabled=\"siblingIndex === 0\"\n\t\t\t\t\t:aria-label=\"moveName(reorderLabels.moveUp)\"\n\t\t\t\t\tdata-move=\"up\"\n\t\t\t\t\t@click=\"moveBy(-1)\">\n\t\t\t\t\t{{ reorderLabels.moveUp }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton variant=\"tertiary\"\n\t\t\t\t\t:disabled=\"siblingIndex >= siblingCount - 1\"\n\t\t\t\t\t:aria-label=\"moveName(reorderLabels.moveDown)\"\n\t\t\t\t\tdata-move=\"down\"\n\t\t\t\t\t@click=\"moveBy(1)\">\n\t\t\t\t\t{{ reorderLabels.moveDown }}\n\t\t\t\t</NcButton>\n\t\t\t</span>\n\n\t\t\t<!-- @slot actions Inline per-row actions slot. Scope:\n\t\t\t { node, depth }. -->\n\t\t\t<slot name=\"actions\" :node=\"node\" :depth=\"depth\" />\n\t\t</div>\n\n\t\t<Draggable v-if=\"reorderable && hasChildren && isExpanded\"\n\t\t\t:modelValue=\"node[childrenKey]\"\n\t\t\t:itemKey=\"idKey\"\n\t\t\ttag=\"ul\"\n\t\t\tclass=\"cn-tree-node__children\"\n\t\t\trole=\"group\"\n\t\t\thandle=\".cn-tree-node__handle\"\n\t\t\t@change=\"onDragChange\">\n\t\t\t<template #item=\"{ element: child, index }\">\n\t\t\t\t<CnTreeNode :node=\"child\"\n\t\t\t\t\t:depth=\"depth + 1\"\n\t\t\t\t\t:indent=\"indent\"\n\t\t\t\t\t:expandedIds=\"expandedIds\"\n\t\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t\t:toggleAttrs=\"toggleAttrs\"\n\t\t\t\t\t:rowAttrs=\"rowAttrs\"\n\t\t\t\t\t:focusableRows=\"focusableRows\"\n\t\t\t\t\treorderable\n\t\t\t\t\t:reorderLabels=\"reorderLabels\"\n\t\t\t\t\t:parentId=\"node[idKey]\"\n\t\t\t\t\t:siblingIndex=\"index\"\n\t\t\t\t\t:siblingCount=\"node[childrenKey].length\"\n\t\t\t\t\t@toggle=\"$emit('toggle', $event)\"\n\t\t\t\t\t@select=\"$emit('select', $event)\"\n\t\t\t\t\t@move=\"$emit('move', $event)\">\n\t\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t\t</template>\n\t\t\t\t</CnTreeNode>\n\t\t\t</template>\n\t\t</Draggable>\n\t\t<ul v-else-if=\"hasChildren && isExpanded\" class=\"cn-tree-node__children\" role=\"group\">\n\t\t\t<CnTreeNode v-for=\"child in node[childrenKey]\"\n\t\t\t\t:key=\"child[idKey]\"\n\t\t\t\t:node=\"child\"\n\t\t\t\t:depth=\"depth + 1\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedIds\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t:toggleAttrs=\"toggleAttrs\"\n\t\t\t\t:rowAttrs=\"rowAttrs\"\n\t\t\t\t:focusableRows=\"focusableRows\"\n\t\t\t\t@toggle=\"$emit('toggle', $event)\"\n\t\t\t\t@select=\"$emit('select', $event)\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</li>\n</template>\n\n<script>\nimport { NcButton } from '@nextcloud/vue'\nimport Draggable from 'vuedraggable'\nimport DragVertical from 'vue-material-design-icons/DragVertical.vue'\n\n/**\n * CnTreeNode — Recursive tree row used inside CnTreeView. Renders\n * its own row + recurses for children when expanded. Not exported\n * as a separate barrel entry — consumers use CnTreeView and the\n * recursion is internal.\n */\nexport default {\n\tname: 'CnTreeNode',\n\tcomponents: { Draggable, DragVertical, NcButton },\n\tprops: {\n\t\t/** The node data. */\n\t\tnode: { type: Object, required: true },\n\t\t/** Depth (drives indent). */\n\t\tdepth: { type: Number, default: 0 },\n\t\t/** Pixels of padding per depth level. */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Set of expanded node ids. */\n\t\texpandedIds: { type: Object, required: true },\n\t\t/** Currently selected node id, read off `node[idKey]` (or null). */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Node-field key for the id. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Node-field key for the display label. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Node-field key for the children array. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** A11y label for the expand button, or `(node) => string`. */\n\t\texpandLabel: { type: [String, Function], default: 'Expand' },\n\t\t/** A11y label for the collapse button, or `(node) => string`. */\n\t\tcollapseLabel: { type: [String, Function], default: 'Collapse' },\n\t\t/** Extra expand-button attributes per node, `(node, depth) => object`. */\n\t\ttoggleAttrs: { type: Function, default: null },\n\t\t/** Extra row attributes per node, `(node, depth) => object`. */\n\t\trowAttrs: { type: Function, default: null },\n\t\t/** Rows take focus and select on Enter or Space. */\n\t\tfocusableRows: { type: Boolean, default: false },\n\t\t/** Rows can be moved among their siblings. */\n\t\treorderable: { type: Boolean, default: false },\n\t\t/** The texts of the move controls, resolved by CnTreeView. */\n\t\treorderLabels: { type: Object, default: () => ({}) },\n\t\t/** The parent's id, or null at the root. */\n\t\tparentId: { type: [String, Number], default: null },\n\t\t/** This node's index among its siblings. */\n\t\tsiblingIndex: { type: Number, default: 0 },\n\t\t/** How many siblings there are, itself included. */\n\t\tsiblingCount: { type: Number, default: 1 },\n\t},\n\n\temits: ['select', 'toggle', 'move'],\n\tcomputed: {\n\t\t/**\n\t\t * One entry when the row draws its move controls. A `v-for` leaves no\n\t\t * placeholder in the markup when off, which `v-if` would.\n\t\t *\n\t\t * @return {string[]} The keys.\n\t\t */\n\t\treorderSlots() {\n\t\t\treturn this.reorderable ? ['reorder'] : []\n\t\t},\n\n\t\t/**\n\t\t * Whether this node has any children at all.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\thasChildren() {\n\t\t\tconst c = this.node[this.childrenKey]\n\t\t\treturn Array.isArray(c) && c.length > 0\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is currently expanded.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisExpanded() {\n\t\t\treturn Boolean(this.expandedIds[this.node[this.idKey]])\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is the currently-selected one.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelected() {\n\t\t\treturn this.selectedId === this.node[this.idKey]\n\t\t},\n\n\t\t/**\n\t\t * The expand button's accessible name for this node.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\ttoggleLabel() {\n\t\t\tconst label = this.isExpanded ? this.collapseLabel : this.expandLabel\n\t\t\treturn typeof label === 'function' ? label(this.node) : label\n\t\t},\n\n\t\t/**\n\t\t * The host's extra attributes for this row.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\textraRowAttrs() {\n\t\t\treturn this.rowAttrs ? this.rowAttrs(this.node, this.depth) : {}\n\t\t},\n\n\t\t/**\n\t\t * The host's extra attributes for this row's expand button.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\textraToggleAttrs() {\n\t\t\treturn this.toggleAttrs ? this.toggleAttrs(this.node, this.depth) : {}\n\t\t},\n\t},\n\n\tmethods: {\n\t\ttoggle() {\n\t\t\tthis.$emit('toggle', this.node[this.idKey])\n\t\t},\n\n\t\t/**\n\t\t * The accessible name of a move button: its visible label and the node's.\n\t\t *\n\t\t * @param {string} action The visible label.\n\t\t * @return {string} The name.\n\t\t */\n\t\tmoveName(action) {\n\t\t\treturn this.reorderLabels.controlName\n\t\t\t\t.replace('{action}', action)\n\t\t\t\t.replace('{label}', String(this.node[this.labelKey] ?? ''))\n\t\t},\n\n\t\t/**\n\t\t * Move this node one place among its siblings, with a button.\n\t\t *\n\t\t * @param {number} delta -1 up, 1 down.\n\t\t * @return {void}\n\t\t */\n\t\tmoveBy(delta) {\n\t\t\tthis.$emit('move', {\n\t\t\t\tnode: this.node,\n\t\t\t\tparentId: this.parentId,\n\t\t\t\tfrom: this.siblingIndex,\n\t\t\t\tto: this.siblingIndex + delta,\n\t\t\t\tbyButton: true,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * A child was dragged to another place.\n\t\t *\n\t\t * @param {{moved?: {element: object, oldIndex: number, newIndex: number}}} change What the drag changed.\n\t\t * @return {void}\n\t\t */\n\t\tonDragChange({ moved } = {}) {\n\t\t\tif (moved) {\n\t\t\t\tthis.$emit('move', { node: moved.element, parentId: this.node[this.idKey], from: moved.oldIndex, to: moved.newIndex })\n\t\t\t}\n\t\t},\n\n\t\tonRowClick() {\n\t\t\tthis.$emit('select', this.node)\n\t\t},\n\n\t\t/**\n\t\t * Enter or Space on a focusable row selects its node. Keys pressed on\n\t\t * the expand button or an action inside the row are theirs.\n\t\t *\n\t\t * @param {KeyboardEvent} event The key event.\n\t\t */\n\t\tonRowKeydown(event) {\n\t\t\tif (!this.focusableRows || event.target !== event.currentTarget) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.key === 'Enter' || event.key === ' ') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.$emit('select', this.node)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-node {\n\tlist-style: none;\n}\n\n.cn-tree-node__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 4px 6px;\n\tborder-radius: var(--border-radius);\n\tcursor: pointer;\n}\n\n.cn-tree-node__row:hover {\n\tbackground: var(--color-background-hover);\n}\n\n/* A row made focusable by `focusableRows` shows where keyboard focus is (WCAG 2.4.7). */\n.cn-tree-node__row[tabindex]:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: -2px;\n}\n\n.cn-tree-node--selected > .cn-tree-node__row {\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__toggle {\n\tbackground: none;\n\tborder: none;\n\tcursor: pointer;\n\tpadding: 0;\n\twidth: 18px;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.cn-tree-node__toggle--leaf {\n\tcursor: default;\n}\n\n.cn-tree-node__caret {\n\tdisplay: inline-block;\n\ttransition: transform 0.15s ease;\n\tfont-size: 0.9em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__caret--open {\n\ttransform: rotate(90deg);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__icon {\n\tfont-size: 0.9em;\n}\n\n.cn-tree-node__label {\n\tflex: 1 1 auto;\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-tree-node__handle {\n\tcolor: var(--color-text-maxcontrast);\n\tcursor: grab;\n\tdisplay: inline-flex;\n}\n\n.cn-tree-node__move {\n\tdisplay: inline-flex;\n\tgap: 4px;\n}\n\n.cn-tree-node__badge {\n\tfont-size: 0.8em;\n\tpadding: 1px 6px;\n\tborder-radius: 9999px;\n\tbackground: var(--color-background-hover);\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__children {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":["_createElementBlock","_createElementVNode","_mergeProps","_Fragment","_renderList","_createVNode","_openBlock","_normalizeClass","_toDisplayString","_renderSlot","_createTextVNode","_createBlock","_withCtx"],"mappings":";;;;;;;;AAgCgB,EAAA,KAAK,EAAC;;;;AAEI,EAAA,KAAK,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kBACxBH,UAAqC,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAArCP,UAAqC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;AAEnB,gBAAA,CAAA,IAAA,CAAA,MAAM,CAAC,KAAK;;4BAAG,OAAK;AACnC,sBAAA,EAAA,EAAAU,OAAA,CAAA,CADqC,KAAK,KAAA;wBAC1CH,UAAmC,CAAA,IAAA,CAAA,MAAA,EAAA,OAAA,EAAnCP,UAAmC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnTreeView.vue2.js';
2
2
  import { render } from './CnTreeView.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-790ecd66";
5
+ script.__scopeId = "data-v-5e1d084c";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -1,3 +1,5 @@
1
+ import { translate } from '@nextcloud/l10n';
2
+ import Draggable from '../../node_modules/vuedraggable/dist/vuedraggable.umd.js';
1
3
  import __sfc_main from './CnTreeNode.vue.js';
2
4
 
3
5
  /**
@@ -5,10 +7,11 @@ import __sfc_main from './CnTreeNode.vue.js';
5
7
  * nodes with click-to-expand carets, optional badges + icons,
6
8
  * inline per-row actions slot, and select-on-click semantics.
7
9
  *
8
- * Drag-drop reorder is intentionally a follow-up (issue #278).
9
- * The widget's public contract (props, events, selection model)
10
- * is forward-compatible — adding `draggable: true` later won't
11
- * touch existing v-model bindings.
10
+ * With `reorderable` a row moves among its siblings by dragging or with Move
11
+ * up and Move down. Both say the new position, and the buttons keep focus, so
12
+ * the tree works without a pointer (WCAG 2.2 SC 2.1.1, 2.5.7). Moving between
13
+ * parents is not offered. The host owns the tree through `v-model:nodes`, and
14
+ * saves on `move`.
12
15
  *
13
16
  * ```vue
14
17
  * <CnTreeView
@@ -42,7 +45,7 @@ import __sfc_main from './CnTreeNode.vue.js';
42
45
  */
43
46
  var script = {
44
47
  name: 'CnTreeView',
45
- components: { CnTreeNode: __sfc_main },
48
+ components: { CnTreeNode: __sfc_main, Draggable },
46
49
  props: {
47
50
  /**
48
51
  * Tree nodes (root level). Each node:
@@ -108,12 +111,55 @@ var script = {
108
111
  * the row selects its node, like a click. Off, rows are click-only.
109
112
  */
110
113
  focusableRows: { type: Boolean, default: false },
114
+ /** Rows can be moved among their siblings: a drag handle, Move up and Move down. */
115
+ reorderable: { type: Boolean, default: false },
116
+ /**
117
+ * Replacement texts for reordering, already translated: `moveUp`, `moveDown`, `drag`,
118
+ * `controlName` (`{action}`, `{label}`), `moved` (`{label}`, `{position}`, `{total}`).
119
+ */
120
+ reorderLabels: { type: Object, default: () => ({}) },
121
+ /** A status the host sets after saving a move, such as "Saved"; it replaces the spoken position. */
122
+ moveStatus: { type: String, default: '' },
111
123
  /** Expand all nodes on mount. */
112
124
  expandAllOnMount: { type: Boolean, default: false },
113
125
  },
114
126
 
115
- emits: ['select', 'update:expanded-ids', 'update:selected-id'],
127
+ emits: ['select', 'update:expanded-ids', 'update:selected-id', 'update:nodes', 'move'],
128
+
129
+ data() {
130
+ return {
131
+ announcement: '',
132
+ }
133
+ },
134
+
116
135
  computed: {
136
+ /** @return {object} The texts of the move controls, with library defaults. */
137
+ reorderTexts() {
138
+ return {
139
+ moveUp: translate('nextcloud-vue', 'Move up'),
140
+ moveDown: translate('nextcloud-vue', 'Move down'),
141
+ drag: translate('nextcloud-vue', 'Drag to reorder'),
142
+ controlName: translate('nextcloud-vue', '{action}: {label}'),
143
+ moved: translate('nextcloud-vue', '{label} moved to position {position} of {total}.'),
144
+ ...this.reorderLabels,
145
+ }
146
+ },
147
+
148
+ /**
149
+ * One entry when the status line shows. A `v-for` leaves no placeholder in the
150
+ * markup when off, which `v-if` would.
151
+ *
152
+ * @return {string[]} The keys.
153
+ */
154
+ statusSlots() {
155
+ return this.reorderable ? ['status'] : []
156
+ },
157
+
158
+ /** @return {string} What the status line says. */
159
+ statusText() {
160
+ return this.moveStatus || this.announcement
161
+ },
162
+
117
163
  /**
118
164
  * The `nodes` prop coerced to a real array. Guards against a parent
119
165
  * that passes `null` / `undefined` (or a non-array) while its data is
@@ -194,6 +240,112 @@ var script = {
194
240
  this.$emit('update:expanded-ids', next);
195
241
  },
196
242
 
243
+ /**
244
+ * A row at the root was dragged to another place.
245
+ *
246
+ * @param {{moved?: {element: object, oldIndex: number, newIndex: number}}} change What the drag changed.
247
+ * @return {void}
248
+ */
249
+ onRootDragChange({ moved } = {}) {
250
+ if (moved) {
251
+ this.moveNode({ node: moved.element, parentId: null, from: moved.oldIndex, to: moved.newIndex });
252
+ }
253
+ },
254
+
255
+ /**
256
+ * The nodes with one list of siblings in its new order. Only the path to
257
+ * that list is copied.
258
+ *
259
+ * @param {Array<object>} list The nodes at this level.
260
+ * @param {{parentId: string|number|null, from: number, to: number}} move The move.
261
+ * @return {Array<object>} The new nodes.
262
+ */
263
+ movedIn(list, { parentId, from, to }) {
264
+ if (parentId === null) {
265
+ const next = [...list];
266
+ next.splice(to, 0, next.splice(from, 1)[0]);
267
+ return next
268
+ }
269
+ return list.map((node) => {
270
+ const children = node[this.childrenKey];
271
+ if (!Array.isArray(children)) {
272
+ return node
273
+ }
274
+ const reordered = node[this.idKey] === parentId
275
+ ? this.movedIn(children, { parentId: null, from, to })
276
+ : this.movedIn(children, { parentId, from, to });
277
+ return { ...node, [this.childrenKey]: reordered }
278
+ })
279
+ },
280
+
281
+ /**
282
+ * The list of siblings a parent holds.
283
+ *
284
+ * @param {Array<object>} list The nodes to look in.
285
+ * @param {string|number|null} parentId The parent, or null for the root.
286
+ * @return {Array<object>|null} Its children.
287
+ */
288
+ siblingsOf(list, parentId) {
289
+ if (parentId === null) {
290
+ return list
291
+ }
292
+ for (const node of list) {
293
+ const children = node[this.childrenKey];
294
+ if (Array.isArray(children)) {
295
+ const found = node[this.idKey] === parentId ? children : this.siblingsOf(children, parentId);
296
+ if (found) {
297
+ return found
298
+ }
299
+ }
300
+ }
301
+ return null
302
+ },
303
+
304
+ /**
305
+ * Apply a move: give the host the new tree, say where the node landed, and
306
+ * after a button keep focus on that button, or on the other one at the end.
307
+ *
308
+ * @param {{node: object, parentId: string|number|null, from: number, to: number, byButton?: boolean}} move The move.
309
+ * @return {void}
310
+ */
311
+ moveNode({ node, parentId, from, to, byButton }) {
312
+ const nodes = this.movedIn(this.safeNodes, { parentId, from, to });
313
+ const siblings = this.siblingsOf(nodes, parentId);
314
+ if (!siblings || to < 0 || to >= siblings.length) {
315
+ return
316
+ }
317
+ this.$emit('update:nodes', nodes);
318
+ /**
319
+ * @event move A row moved. Save the order here.
320
+ * @type {{node: object, parentId: string|number|null, from: number, to: number, siblings: Array<object>}}
321
+ */
322
+ this.$emit('move', { node, parentId, from, to, siblings });
323
+ this.announcement = this.reorderTexts.moved
324
+ .replace('{label}', String(node[this.labelKey] ?? ''))
325
+ .replace('{position}', String(to + 1))
326
+ .replace('{total}', String(siblings.length));
327
+ if (byButton) {
328
+ this.$nextTick(() => this.focusMoveButton(node[this.idKey], to < from ? 'up' : 'down'));
329
+ }
330
+ },
331
+
332
+ /**
333
+ * Focus a row's move button, or its other one when that is disabled.
334
+ *
335
+ * @param {string|number} id The node.
336
+ * @param {string} direction `up` or `down`.
337
+ * @return {void}
338
+ */
339
+ focusMoveButton(id, direction) {
340
+ const row = [...this.$el.querySelectorAll('.cn-tree-node')]
341
+ .find((element) => element.dataset.nodeId === String(id))
342
+ ?.querySelector(':scope > .cn-tree-node__row');
343
+ const used = row?.querySelector(`[data-move="${direction}"]`);
344
+ const other = row?.querySelector(`[data-move="${direction === 'up' ? 'down' : 'up'}"]`);
345
+ const target = used && !used.disabled ? used : other;
346
+ target?.focus();
347
+ },
348
+
197
349
  /**
198
350
  * Select a node. Emits `@select` + `update:selected-id`.
199
351
  *
@@ -1 +1 @@
1
- {"version":3,"file":"CnTreeView.vue2.js","sources":["../../../../src/components/CnTreeView/CnTreeView.vue"],"sourcesContent":["<template>\n\t<div class=\"cn-tree-view\" data-testid=\"cn-tree-view\">\n\t\t<header v-if=\"title || description\" class=\"cn-tree-view__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-tree-view__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-tree-view__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<p v-if=\"safeNodes.length === 0\" class=\"cn-tree-view__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\n\t\t<ul v-else class=\"cn-tree-view__root\" role=\"tree\">\n\t\t\t<CnTreeNode v-for=\"node in safeNodes\"\n\t\t\t\t:key=\"node[idKey]\"\n\t\t\t\t:node=\"node\"\n\t\t\t\t:depth=\"0\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedMap\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t:toggleAttrs=\"toggleAttrs\"\n\t\t\t\t:rowAttrs=\"rowAttrs\"\n\t\t\t\t:focusableRows=\"focusableRows\"\n\t\t\t\t@toggle=\"toggleNode\"\n\t\t\t\t@select=\"selectNode\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<!-- @slot actions Per-row actions. Scope:\n\t\t\t\t\t { node, depth }. -->\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<!-- @slot label Replaces the label text of every row. Scope:\n\t\t\t\t\t { node, depth, expanded }. Unused, the row shows\n\t\t\t\t\t `node[labelKey]`. -->\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport CnTreeNode from './CnTreeNode.vue'\n\n/**\n * CnTreeView — Recursive hierarchical tree widget. Renders nested\n * nodes with click-to-expand carets, optional badges + icons,\n * inline per-row actions slot, and select-on-click semantics.\n *\n * Drag-drop reorder is intentionally a follow-up (issue #278).\n * The widget's public contract (props, events, selection model)\n * is forward-compatible — adding `draggable: true` later won't\n * touch existing v-model bindings.\n *\n * ```vue\n * <CnTreeView\n * :nodes=\"[\n * { id: 1, label: 'Knowledge base', children: [\n * { id: 2, label: 'How-tos', children: [\n * { id: 3, label: 'Reset password' },\n * ] },\n * { id: 4, label: 'Reference' },\n * ] },\n * ]\"\n * v-model:expanded-ids=\"expanded\"\n * v-model:selected-id=\"selected\"\n * @select=\"onSelect\" />\n * ```\n *\n * Slots:\n * - `#actions` — inline per-row actions (e.g. edit / delete\n * buttons). Scope: `{ node, depth }`.\n * - `#label` — the label of every row, for an icon, a marker or a test id\n * next to the text. Scope: `{ node, depth, expanded }`. Unused, the row\n * shows `node[labelKey]`.\n *\n * Per-node hooks, all off by default:\n * - `expandLabel` / `collapseLabel` take a function `(node) => string` for a\n * name per row, e.g. \"Expand {name}\".\n * - `toggleAttrs` and `rowAttrs` add attributes per node to the expand button\n * and the row (test ids, `data-*`, an active class, a role).\n * - `focusableRows` lets keyboard users reach a row and select it with\n * Enter or Space.\n */\nexport default {\n\tname: 'CnTreeView',\n\tcomponents: { CnTreeNode },\n\tprops: {\n\t\t/**\n\t\t * Tree nodes (root level). Each node:\n\t\t * `{ id, label, children?, icon?, badge? }`. The keys\n\t\t * `id`, `label`, `children` are configurable via the\n\t\t * `*Key` props.\n\t\t *\n\t\t * Defaults to an empty array and is null-guarded (see `safeNodes`)\n\t\t * so a parent that hasn't loaded its data yet — passing `undefined`\n\t\t * or `null` — renders the empty state instead of throwing on\n\t\t * `nodes.length` during render (ADR-062: never crash a detail page).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tnodes: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Set of currently-expanded node ids. Pass with `.sync`\n\t\t * (or `:expanded-ids` + `@update:expanded-ids`) to control\n\t\t * expansion state from the parent.\n\t\t *\n\t\t * @type {Array<string|number>}\n\t\t */\n\t\texpandedIds: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Currently-selected node id (or null). Node ids are read off\n\t\t * `node[idKey]`, so the same `string | number` domain as `expandedIds`.\n\t\t * Pass with `.sync`.\n\t\t *\n\t\t * @type {string|number|null}\n\t\t */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Override the `id` key on node objects. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Override the `label` key. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Override the `children` key. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** Indent per depth (px). */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Optional title rendered above the tree. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Optional description rendered under the title. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Empty-state text when nodes[] is empty. */\n\t\temptyLabel: { type: String, default: 'No items.' },\n\t\t/** A11y label for the expand button, or `(node) => string` for a name per row. */\n\t\texpandLabel: { type: [String, Function], default: 'Expand' },\n\t\t/** A11y label for the collapse button, or `(node) => string` for a name per row. */\n\t\tcollapseLabel: { type: [String, Function], default: 'Collapse' },\n\t\t/**\n\t\t * Extra attributes for each row's expand button, as `(node, depth) => object`,\n\t\t * e.g. a test id per node. Null adds none.\n\t\t */\n\t\ttoggleAttrs: { type: Function, default: null },\n\t\t/**\n\t\t * Extra attributes for each row, as `(node, depth) => object`: a class,\n\t\t * `data-*` attributes, or a `role` and `aria-label`. `class` and `style`\n\t\t * merge with the row's own. Null adds none.\n\t\t */\n\t\trowAttrs: { type: Function, default: null },\n\t\t/**\n\t\t * Makes each row reachable with Tab (`tabindex=\"0\"`); Enter or Space on\n\t\t * the row selects its node, like a click. Off, rows are click-only.\n\t\t */\n\t\tfocusableRows: { type: Boolean, default: false },\n\t\t/** Expand all nodes on mount. */\n\t\texpandAllOnMount: { type: Boolean, default: false },\n\t},\n\n\temits: ['select', 'update:expanded-ids', 'update:selected-id'],\n\tcomputed: {\n\t\t/**\n\t\t * The `nodes` prop coerced to a real array. Guards against a parent\n\t\t * that passes `null` / `undefined` (or a non-array) while its data is\n\t\t * still loading — Vue only applies the prop default for `undefined`,\n\t\t * so an explicit `null` would otherwise reach `nodes.length` and throw\n\t\t * during render.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tsafeNodes() {\n\t\t\treturn Array.isArray(this.nodes) ? this.nodes : []\n\t\t},\n\n\t\t/**\n\t\t * `expandedIds[]` lifted to an object map for O(1) lookups\n\t\t * inside the recursive node.\n\t\t *\n\t\t * @return {Record<string,true>}\n\t\t */\n\t\texpandedMap() {\n\t\t\tconst out = {}\n\t\t\tfor (const id of this.expandedIds) {\n\t\t\t\tout[id] = true\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (this.expandAllOnMount) {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Toggle a node's expanded state by id. Emits\n\t\t * `update:expanded-ids` with the new array.\n\t\t *\n\t\t * @param {string|number} id Node id.\n\t\t * @return {void}\n\t\t */\n\t\ttoggleNode(id) {\n\t\t\tconst next = [...this.expandedIds]\n\t\t\tconst idx = next.indexOf(id)\n\t\t\tif (idx >= 0) {\n\t\t\t\tnext.splice(idx, 1)\n\t\t\t} else {\n\t\t\t\tnext.push(id)\n\t\t\t}\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', next)\n\t\t},\n\n\t\t/**\n\t\t * Select a node. Emits `@select` + `update:selected-id`.\n\t\t *\n\t\t * @param {object} node The node.\n\t\t * @return {void}\n\t\t */\n\t\tselectNode(node) {\n\t\t\t// Description above the tag — see the note on `update:expanded-ids`.\n\t\t\t/**\n\t\t\t * `v-model:selected-id` counterpart. Payload is the new id (or null).\n\t\t\t *\n\t\t\t * @event update:selected-id\n\t\t\t */\n\t\t\tthis.$emit('update:selected-id', node[this.idKey])\n\t\t\t/**\n\t\t\t * @event select Emitted on row click. Payload is the\n\t\t\t * selected node object.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('select', node)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically expand every node in the tree.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\texpandAll() {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically collapse every node.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcollapseAll() {\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', [])\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-view {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-tree-view__title {\n\tmargin: 0;\n\tfont-size: 1.1em;\n}\n\n.cn-tree-view__description {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-view__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tmargin: 16px 0;\n\ttext-align: center;\n}\n\n.cn-tree-view__root {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":["CnTreeNode"],"mappings":";;AAoDA;;;;AAIC;;;;;AAKA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;;;;;AAKD,aAAe;AACd,CAAA,IAAI,EAAE,YAAY;CAClB,UAAU,EAAE,c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;;;AAKb;;AAEC;;;AAGD,GAAA,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,EAAE,EAAA;GACpC;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnTreeView.vue2.js","sources":["../../../../src/components/CnTreeView/CnTreeView.vue"],"sourcesContent":["<template>\n\t<div class=\"cn-tree-view\" data-testid=\"cn-tree-view\">\n\t\t<header v-if=\"title || description\" class=\"cn-tree-view__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-tree-view__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-tree-view__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<p v-if=\"safeNodes.length === 0\" class=\"cn-tree-view__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\n\t\t<Draggable v-else-if=\"reorderable\"\n\t\t\t:modelValue=\"safeNodes\"\n\t\t\t:itemKey=\"idKey\"\n\t\t\ttag=\"ul\"\n\t\t\tclass=\"cn-tree-view__root\"\n\t\t\trole=\"tree\"\n\t\t\thandle=\".cn-tree-node__handle\"\n\t\t\t@change=\"onRootDragChange\">\n\t\t\t<template #item=\"{ element: node, index }\">\n\t\t\t\t<CnTreeNode :node=\"node\"\n\t\t\t\t\t:depth=\"0\"\n\t\t\t\t\t:indent=\"indent\"\n\t\t\t\t\t:expandedIds=\"expandedMap\"\n\t\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t\t:toggleAttrs=\"toggleAttrs\"\n\t\t\t\t\t:rowAttrs=\"rowAttrs\"\n\t\t\t\t\t:focusableRows=\"focusableRows\"\n\t\t\t\t\treorderable\n\t\t\t\t\t:reorderLabels=\"reorderTexts\"\n\t\t\t\t\t:siblingIndex=\"index\"\n\t\t\t\t\t:siblingCount=\"safeNodes.length\"\n\t\t\t\t\t@toggle=\"toggleNode\"\n\t\t\t\t\t@select=\"selectNode\"\n\t\t\t\t\t@move=\"moveNode\">\n\t\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t\t</template>\n\t\t\t\t</CnTreeNode>\n\t\t\t</template>\n\t\t</Draggable>\n\t\t<ul v-else class=\"cn-tree-view__root\" role=\"tree\">\n\t\t\t<CnTreeNode v-for=\"node in safeNodes\"\n\t\t\t\t:key=\"node[idKey]\"\n\t\t\t\t:node=\"node\"\n\t\t\t\t:depth=\"0\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedMap\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t:toggleAttrs=\"toggleAttrs\"\n\t\t\t\t:rowAttrs=\"rowAttrs\"\n\t\t\t\t:focusableRows=\"focusableRows\"\n\t\t\t\t@toggle=\"toggleNode\"\n\t\t\t\t@select=\"selectNode\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<!-- @slot actions Per-row actions. Scope:\n\t\t\t\t\t { node, depth }. -->\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<!-- @slot label Replaces the label text of every row. Scope:\n\t\t\t\t\t { node, depth, expanded }. Unused, the row shows\n\t\t\t\t\t `node[labelKey]`. -->\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\n\t\t<p v-for=\"key in statusSlots\"\n\t\t\t:key=\"key\"\n\t\t\tclass=\"cn-tree-view__status\"\n\t\t\t:class=\"{ 'hidden-visually': !statusText }\"\n\t\t\trole=\"status\"\n\t\t\tdata-testid=\"cn-tree-view-status\">\n\t\t\t{{ statusText }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport Draggable from 'vuedraggable'\nimport CnTreeNode from './CnTreeNode.vue'\n\n/**\n * CnTreeView — Recursive hierarchical tree widget. Renders nested\n * nodes with click-to-expand carets, optional badges + icons,\n * inline per-row actions slot, and select-on-click semantics.\n *\n * With `reorderable` a row moves among its siblings by dragging or with Move\n * up and Move down. Both say the new position, and the buttons keep focus, so\n * the tree works without a pointer (WCAG 2.2 SC 2.1.1, 2.5.7). Moving between\n * parents is not offered. The host owns the tree through `v-model:nodes`, and\n * saves on `move`.\n *\n * ```vue\n * <CnTreeView\n * :nodes=\"[\n * { id: 1, label: 'Knowledge base', children: [\n * { id: 2, label: 'How-tos', children: [\n * { id: 3, label: 'Reset password' },\n * ] },\n * { id: 4, label: 'Reference' },\n * ] },\n * ]\"\n * v-model:expanded-ids=\"expanded\"\n * v-model:selected-id=\"selected\"\n * @select=\"onSelect\" />\n * ```\n *\n * Slots:\n * - `#actions` — inline per-row actions (e.g. edit / delete\n * buttons). Scope: `{ node, depth }`.\n * - `#label` — the label of every row, for an icon, a marker or a test id\n * next to the text. Scope: `{ node, depth, expanded }`. Unused, the row\n * shows `node[labelKey]`.\n *\n * Per-node hooks, all off by default:\n * - `expandLabel` / `collapseLabel` take a function `(node) => string` for a\n * name per row, e.g. \"Expand {name}\".\n * - `toggleAttrs` and `rowAttrs` add attributes per node to the expand button\n * and the row (test ids, `data-*`, an active class, a role).\n * - `focusableRows` lets keyboard users reach a row and select it with\n * Enter or Space.\n */\nexport default {\n\tname: 'CnTreeView',\n\tcomponents: { CnTreeNode, Draggable },\n\tprops: {\n\t\t/**\n\t\t * Tree nodes (root level). Each node:\n\t\t * `{ id, label, children?, icon?, badge? }`. The keys\n\t\t * `id`, `label`, `children` are configurable via the\n\t\t * `*Key` props.\n\t\t *\n\t\t * Defaults to an empty array and is null-guarded (see `safeNodes`)\n\t\t * so a parent that hasn't loaded its data yet — passing `undefined`\n\t\t * or `null` — renders the empty state instead of throwing on\n\t\t * `nodes.length` during render (ADR-062: never crash a detail page).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tnodes: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Set of currently-expanded node ids. Pass with `.sync`\n\t\t * (or `:expanded-ids` + `@update:expanded-ids`) to control\n\t\t * expansion state from the parent.\n\t\t *\n\t\t * @type {Array<string|number>}\n\t\t */\n\t\texpandedIds: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Currently-selected node id (or null). Node ids are read off\n\t\t * `node[idKey]`, so the same `string | number` domain as `expandedIds`.\n\t\t * Pass with `.sync`.\n\t\t *\n\t\t * @type {string|number|null}\n\t\t */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Override the `id` key on node objects. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Override the `label` key. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Override the `children` key. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** Indent per depth (px). */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Optional title rendered above the tree. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Optional description rendered under the title. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Empty-state text when nodes[] is empty. */\n\t\temptyLabel: { type: String, default: 'No items.' },\n\t\t/** A11y label for the expand button, or `(node) => string` for a name per row. */\n\t\texpandLabel: { type: [String, Function], default: 'Expand' },\n\t\t/** A11y label for the collapse button, or `(node) => string` for a name per row. */\n\t\tcollapseLabel: { type: [String, Function], default: 'Collapse' },\n\t\t/**\n\t\t * Extra attributes for each row's expand button, as `(node, depth) => object`,\n\t\t * e.g. a test id per node. Null adds none.\n\t\t */\n\t\ttoggleAttrs: { type: Function, default: null },\n\t\t/**\n\t\t * Extra attributes for each row, as `(node, depth) => object`: a class,\n\t\t * `data-*` attributes, or a `role` and `aria-label`. `class` and `style`\n\t\t * merge with the row's own. Null adds none.\n\t\t */\n\t\trowAttrs: { type: Function, default: null },\n\t\t/**\n\t\t * Makes each row reachable with Tab (`tabindex=\"0\"`); Enter or Space on\n\t\t * the row selects its node, like a click. Off, rows are click-only.\n\t\t */\n\t\tfocusableRows: { type: Boolean, default: false },\n\t\t/** Rows can be moved among their siblings: a drag handle, Move up and Move down. */\n\t\treorderable: { type: Boolean, default: false },\n\t\t/**\n\t\t * Replacement texts for reordering, already translated: `moveUp`, `moveDown`, `drag`,\n\t\t * `controlName` (`{action}`, `{label}`), `moved` (`{label}`, `{position}`, `{total}`).\n\t\t */\n\t\treorderLabels: { type: Object, default: () => ({}) },\n\t\t/** A status the host sets after saving a move, such as \"Saved\"; it replaces the spoken position. */\n\t\tmoveStatus: { type: String, default: '' },\n\t\t/** Expand all nodes on mount. */\n\t\texpandAllOnMount: { type: Boolean, default: false },\n\t},\n\n\temits: ['select', 'update:expanded-ids', 'update:selected-id', 'update:nodes', 'move'],\n\n\tdata() {\n\t\treturn {\n\t\t\tannouncement: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The texts of the move controls, with library defaults. */\n\t\treorderTexts() {\n\t\t\treturn {\n\t\t\t\tmoveUp: t('nextcloud-vue', 'Move up'),\n\t\t\t\tmoveDown: t('nextcloud-vue', 'Move down'),\n\t\t\t\tdrag: t('nextcloud-vue', 'Drag to reorder'),\n\t\t\t\tcontrolName: t('nextcloud-vue', '{action}: {label}'),\n\t\t\t\tmoved: t('nextcloud-vue', '{label} moved to position {position} of {total}.'),\n\t\t\t\t...this.reorderLabels,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * One entry when the status line shows. A `v-for` leaves no placeholder in the\n\t\t * markup when off, which `v-if` would.\n\t\t *\n\t\t * @return {string[]} The keys.\n\t\t */\n\t\tstatusSlots() {\n\t\t\treturn this.reorderable ? ['status'] : []\n\t\t},\n\n\t\t/** @return {string} What the status line says. */\n\t\tstatusText() {\n\t\t\treturn this.moveStatus || this.announcement\n\t\t},\n\n\t\t/**\n\t\t * The `nodes` prop coerced to a real array. Guards against a parent\n\t\t * that passes `null` / `undefined` (or a non-array) while its data is\n\t\t * still loading — Vue only applies the prop default for `undefined`,\n\t\t * so an explicit `null` would otherwise reach `nodes.length` and throw\n\t\t * during render.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tsafeNodes() {\n\t\t\treturn Array.isArray(this.nodes) ? this.nodes : []\n\t\t},\n\n\t\t/**\n\t\t * `expandedIds[]` lifted to an object map for O(1) lookups\n\t\t * inside the recursive node.\n\t\t *\n\t\t * @return {Record<string,true>}\n\t\t */\n\t\texpandedMap() {\n\t\t\tconst out = {}\n\t\t\tfor (const id of this.expandedIds) {\n\t\t\t\tout[id] = true\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (this.expandAllOnMount) {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Toggle a node's expanded state by id. Emits\n\t\t * `update:expanded-ids` with the new array.\n\t\t *\n\t\t * @param {string|number} id Node id.\n\t\t * @return {void}\n\t\t */\n\t\ttoggleNode(id) {\n\t\t\tconst next = [...this.expandedIds]\n\t\t\tconst idx = next.indexOf(id)\n\t\t\tif (idx >= 0) {\n\t\t\t\tnext.splice(idx, 1)\n\t\t\t} else {\n\t\t\t\tnext.push(id)\n\t\t\t}\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', next)\n\t\t},\n\n\t\t/**\n\t\t * A row at the root was dragged to another place.\n\t\t *\n\t\t * @param {{moved?: {element: object, oldIndex: number, newIndex: number}}} change What the drag changed.\n\t\t * @return {void}\n\t\t */\n\t\tonRootDragChange({ moved } = {}) {\n\t\t\tif (moved) {\n\t\t\t\tthis.moveNode({ node: moved.element, parentId: null, from: moved.oldIndex, to: moved.newIndex })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The nodes with one list of siblings in its new order. Only the path to\n\t\t * that list is copied.\n\t\t *\n\t\t * @param {Array<object>} list The nodes at this level.\n\t\t * @param {{parentId: string|number|null, from: number, to: number}} move The move.\n\t\t * @return {Array<object>} The new nodes.\n\t\t */\n\t\tmovedIn(list, { parentId, from, to }) {\n\t\t\tif (parentId === null) {\n\t\t\t\tconst next = [...list]\n\t\t\t\tnext.splice(to, 0, next.splice(from, 1)[0])\n\t\t\t\treturn next\n\t\t\t}\n\t\t\treturn list.map((node) => {\n\t\t\t\tconst children = node[this.childrenKey]\n\t\t\t\tif (!Array.isArray(children)) {\n\t\t\t\t\treturn node\n\t\t\t\t}\n\t\t\t\tconst reordered = node[this.idKey] === parentId\n\t\t\t\t\t? this.movedIn(children, { parentId: null, from, to })\n\t\t\t\t\t: this.movedIn(children, { parentId, from, to })\n\t\t\t\treturn { ...node, [this.childrenKey]: reordered }\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The list of siblings a parent holds.\n\t\t *\n\t\t * @param {Array<object>} list The nodes to look in.\n\t\t * @param {string|number|null} parentId The parent, or null for the root.\n\t\t * @return {Array<object>|null} Its children.\n\t\t */\n\t\tsiblingsOf(list, parentId) {\n\t\t\tif (parentId === null) {\n\t\t\t\treturn list\n\t\t\t}\n\t\t\tfor (const node of list) {\n\t\t\t\tconst children = node[this.childrenKey]\n\t\t\t\tif (Array.isArray(children)) {\n\t\t\t\t\tconst found = node[this.idKey] === parentId ? children : this.siblingsOf(children, parentId)\n\t\t\t\t\tif (found) {\n\t\t\t\t\t\treturn found\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t},\n\n\t\t/**\n\t\t * Apply a move: give the host the new tree, say where the node landed, and\n\t\t * after a button keep focus on that button, or on the other one at the end.\n\t\t *\n\t\t * @param {{node: object, parentId: string|number|null, from: number, to: number, byButton?: boolean}} move The move.\n\t\t * @return {void}\n\t\t */\n\t\tmoveNode({ node, parentId, from, to, byButton }) {\n\t\t\tconst nodes = this.movedIn(this.safeNodes, { parentId, from, to })\n\t\t\tconst siblings = this.siblingsOf(nodes, parentId)\n\t\t\tif (!siblings || to < 0 || to >= siblings.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.$emit('update:nodes', nodes)\n\t\t\t/**\n\t\t\t * @event move A row moved. Save the order here.\n\t\t\t * @type {{node: object, parentId: string|number|null, from: number, to: number, siblings: Array<object>}}\n\t\t\t */\n\t\t\tthis.$emit('move', { node, parentId, from, to, siblings })\n\t\t\tthis.announcement = this.reorderTexts.moved\n\t\t\t\t.replace('{label}', String(node[this.labelKey] ?? ''))\n\t\t\t\t.replace('{position}', String(to + 1))\n\t\t\t\t.replace('{total}', String(siblings.length))\n\t\t\tif (byButton) {\n\t\t\t\tthis.$nextTick(() => this.focusMoveButton(node[this.idKey], to < from ? 'up' : 'down'))\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Focus a row's move button, or its other one when that is disabled.\n\t\t *\n\t\t * @param {string|number} id The node.\n\t\t * @param {string} direction `up` or `down`.\n\t\t * @return {void}\n\t\t */\n\t\tfocusMoveButton(id, direction) {\n\t\t\tconst row = [...this.$el.querySelectorAll('.cn-tree-node')]\n\t\t\t\t.find((element) => element.dataset.nodeId === String(id))\n\t\t\t\t?.querySelector(':scope > .cn-tree-node__row')\n\t\t\tconst used = row?.querySelector(`[data-move=\"${direction}\"]`)\n\t\t\tconst other = row?.querySelector(`[data-move=\"${direction === 'up' ? 'down' : 'up'}\"]`)\n\t\t\tconst target = used && !used.disabled ? used : other\n\t\t\ttarget?.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select a node. Emits `@select` + `update:selected-id`.\n\t\t *\n\t\t * @param {object} node The node.\n\t\t * @return {void}\n\t\t */\n\t\tselectNode(node) {\n\t\t\t// Description above the tag — see the note on `update:expanded-ids`.\n\t\t\t/**\n\t\t\t * `v-model:selected-id` counterpart. Payload is the new id (or null).\n\t\t\t *\n\t\t\t * @event update:selected-id\n\t\t\t */\n\t\t\tthis.$emit('update:selected-id', node[this.idKey])\n\t\t\t/**\n\t\t\t * @event select Emitted on row click. Payload is the\n\t\t\t * selected node object.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('select', node)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically expand every node in the tree.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\texpandAll() {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically collapse every node.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcollapseAll() {\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', [])\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-view {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-tree-view__title {\n\tmargin: 0;\n\tfont-size: 1.1em;\n}\n\n.cn-tree-view__description {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-view__status {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin: 8px 0 0;\n}\n\n.cn-tree-view__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tmargin: 16px 0;\n\ttext-align: center;\n}\n\n.cn-tree-view__root {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":["CnTreeNode","t"],"mappings":";;;;AAqGA;;;;A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