@nextcloud/vue 8.0.0-beta.8 → 8.0.0-beta.9

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 (223) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/Components/NcActionButton.cjs +8 -8
  3. package/dist/Components/NcActionButton.cjs.map +1 -1
  4. package/dist/Components/NcActionButton.mjs +10 -10
  5. package/dist/Components/NcActionButton.mjs.map +1 -1
  6. package/dist/Components/NcActionInput.cjs +23 -18
  7. package/dist/Components/NcActionInput.cjs.map +1 -1
  8. package/dist/Components/NcActionInput.mjs +20 -14
  9. package/dist/Components/NcActionInput.mjs.map +1 -1
  10. package/dist/Components/NcActionLink.cjs +7 -7
  11. package/dist/Components/NcActionLink.cjs.map +1 -1
  12. package/dist/Components/NcActionLink.mjs +4 -4
  13. package/dist/Components/NcActionLink.mjs.map +1 -1
  14. package/dist/Components/NcActionRouter.cjs +8 -8
  15. package/dist/Components/NcActionRouter.cjs.map +1 -1
  16. package/dist/Components/NcActionRouter.mjs +4 -4
  17. package/dist/Components/NcActionRouter.mjs.map +1 -1
  18. package/dist/Components/NcActionText.cjs +10 -10
  19. package/dist/Components/NcActionText.cjs.map +1 -1
  20. package/dist/Components/NcActionText.mjs +11 -11
  21. package/dist/Components/NcActionText.mjs.map +1 -1
  22. package/dist/Components/NcActionTextEditable.cjs +1 -1
  23. package/dist/Components/NcActionTextEditable.mjs +1 -1
  24. package/dist/Components/NcActions.cjs +67 -63
  25. package/dist/Components/NcActions.cjs.map +1 -1
  26. package/dist/Components/NcActions.mjs +75 -71
  27. package/dist/Components/NcActions.mjs.map +1 -1
  28. package/dist/Components/NcAppContent.cjs +1 -1
  29. package/dist/Components/NcAppContent.mjs +1 -1
  30. package/dist/Components/NcAppNavigation.cjs +1 -1
  31. package/dist/Components/NcAppNavigation.mjs +1 -1
  32. package/dist/Components/NcAppNavigationItem.cjs +12 -12
  33. package/dist/Components/NcAppNavigationItem.cjs.map +1 -1
  34. package/dist/Components/NcAppNavigationItem.mjs +15 -15
  35. package/dist/Components/NcAppNavigationItem.mjs.map +1 -1
  36. package/dist/Components/NcAppNavigationNewItem.cjs +1 -1
  37. package/dist/Components/NcAppNavigationNewItem.mjs +1 -1
  38. package/dist/Components/NcAppNavigationSettings.cjs +1 -1
  39. package/dist/Components/NcAppNavigationSettings.mjs +1 -1
  40. package/dist/Components/NcAppNavigationToggle.cjs +1 -1
  41. package/dist/Components/NcAppNavigationToggle.mjs +1 -1
  42. package/dist/Components/NcAppSettingsDialog.cjs +57 -108
  43. package/dist/Components/NcAppSettingsDialog.cjs.map +1 -1
  44. package/dist/Components/NcAppSettingsDialog.mjs +59 -110
  45. package/dist/Components/NcAppSettingsDialog.mjs.map +1 -1
  46. package/dist/Components/NcAppSidebar.cjs +5 -5
  47. package/dist/Components/NcAppSidebar.cjs.map +1 -1
  48. package/dist/Components/NcAppSidebar.mjs +5 -5
  49. package/dist/Components/NcAppSidebar.mjs.map +1 -1
  50. package/dist/Components/NcAppSidebarTab.cjs +3 -3
  51. package/dist/Components/NcAppSidebarTab.cjs.map +1 -1
  52. package/dist/Components/NcAppSidebarTab.mjs +5 -5
  53. package/dist/Components/NcAppSidebarTab.mjs.map +1 -1
  54. package/dist/Components/NcAvatar.cjs +1 -1
  55. package/dist/Components/NcAvatar.mjs +1 -1
  56. package/dist/Components/NcBreadcrumbs.cjs +2 -2
  57. package/dist/Components/NcBreadcrumbs.cjs.map +1 -1
  58. package/dist/Components/NcBreadcrumbs.mjs +2 -2
  59. package/dist/Components/NcBreadcrumbs.mjs.map +1 -1
  60. package/dist/Components/NcCheckboxRadioSwitch.cjs +157 -42
  61. package/dist/Components/NcCheckboxRadioSwitch.cjs.map +1 -1
  62. package/dist/Components/NcCheckboxRadioSwitch.mjs +168 -53
  63. package/dist/Components/NcCheckboxRadioSwitch.mjs.map +1 -1
  64. package/dist/Components/NcColorPicker.cjs +1 -1
  65. package/dist/Components/NcColorPicker.mjs +1 -1
  66. package/dist/Components/NcDashboardWidget.cjs +1 -1
  67. package/dist/Components/NcDashboardWidget.mjs +2 -2
  68. package/dist/Components/NcDashboardWidgetItem.cjs +11 -11
  69. package/dist/Components/NcDashboardWidgetItem.cjs.map +1 -1
  70. package/dist/Components/NcDashboardWidgetItem.mjs +9 -9
  71. package/dist/Components/NcDashboardWidgetItem.mjs.map +1 -1
  72. package/dist/Components/NcDateTime.cjs +1 -1
  73. package/dist/Components/NcDateTime.mjs +1 -1
  74. package/dist/Components/NcDateTimePicker.cjs +2 -2
  75. package/dist/Components/NcDateTimePicker.mjs +4 -4
  76. package/dist/Components/NcDateTimePickerNative.cjs +1 -1
  77. package/dist/Components/NcDateTimePickerNative.mjs +1 -1
  78. package/dist/Components/NcDialog.cjs +171 -0
  79. package/dist/Components/NcDialog.cjs.map +1 -0
  80. package/dist/Components/NcDialog.mjs +177 -0
  81. package/dist/Components/NcDialog.mjs.map +1 -0
  82. package/dist/Components/NcDialogButton.cjs +69 -0
  83. package/dist/Components/NcDialogButton.cjs.map +1 -0
  84. package/dist/Components/NcDialogButton.mjs +74 -0
  85. package/dist/Components/NcDialogButton.mjs.map +1 -0
  86. package/dist/Components/NcEmojiPicker.cjs +1 -1
  87. package/dist/Components/NcEmojiPicker.mjs +1 -1
  88. package/dist/Components/NcIconSvgWrapper.cjs +29 -14
  89. package/dist/Components/NcIconSvgWrapper.cjs.map +1 -1
  90. package/dist/Components/NcIconSvgWrapper.mjs +32 -17
  91. package/dist/Components/NcIconSvgWrapper.mjs.map +1 -1
  92. package/dist/Components/NcListItem.cjs +3 -3
  93. package/dist/Components/NcListItem.cjs.map +1 -1
  94. package/dist/Components/NcListItem.mjs +3 -3
  95. package/dist/Components/NcListItem.mjs.map +1 -1
  96. package/dist/Components/NcListItemIcon.cjs +20 -12
  97. package/dist/Components/NcListItemIcon.cjs.map +1 -1
  98. package/dist/Components/NcListItemIcon.mjs +21 -13
  99. package/dist/Components/NcListItemIcon.mjs.map +1 -1
  100. package/dist/Components/NcModal.cjs +24 -26
  101. package/dist/Components/NcModal.cjs.map +1 -1
  102. package/dist/Components/NcModal.mjs +54 -56
  103. package/dist/Components/NcModal.mjs.map +1 -1
  104. package/dist/Components/NcNoteCard.cjs +4 -4
  105. package/dist/Components/NcNoteCard.cjs.map +1 -1
  106. package/dist/Components/NcNoteCard.mjs +3 -3
  107. package/dist/Components/NcNoteCard.mjs.map +1 -1
  108. package/dist/Components/NcPasswordField.cjs +49 -38
  109. package/dist/Components/NcPasswordField.cjs.map +1 -1
  110. package/dist/Components/NcPasswordField.mjs +59 -48
  111. package/dist/Components/NcPasswordField.mjs.map +1 -1
  112. package/dist/Components/NcRelatedResourcesPanel.cjs +29 -13
  113. package/dist/Components/NcRelatedResourcesPanel.cjs.map +1 -1
  114. package/dist/Components/NcRelatedResourcesPanel.mjs +41 -25
  115. package/dist/Components/NcRelatedResourcesPanel.mjs.map +1 -1
  116. package/dist/Components/NcRichContenteditable.cjs +2 -2
  117. package/dist/Components/NcRichContenteditable.mjs +2 -2
  118. package/dist/Components/NcRichText.cjs +1 -1
  119. package/dist/Components/NcRichText.mjs +3 -3
  120. package/dist/Components/NcSelect.cjs +34 -29
  121. package/dist/Components/NcSelect.cjs.map +1 -1
  122. package/dist/Components/NcSelect.mjs +48 -43
  123. package/dist/Components/NcSelect.mjs.map +1 -1
  124. package/dist/Components/NcSelectTags.cjs +1 -1
  125. package/dist/Components/NcSelectTags.mjs +1 -1
  126. package/dist/Components/NcSettingsInputText.cjs +1 -1
  127. package/dist/Components/NcSettingsInputText.mjs +1 -1
  128. package/dist/Components/NcSettingsSection.cjs +1 -1
  129. package/dist/Components/NcSettingsSection.mjs +1 -1
  130. package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
  131. package/dist/Components/NcSettingsSelectGroup.mjs +1 -1
  132. package/dist/Components/NcTextArea.cjs +167 -0
  133. package/dist/Components/NcTextArea.cjs.map +1 -0
  134. package/dist/Components/NcTextArea.mjs +172 -0
  135. package/dist/Components/NcTextArea.mjs.map +1 -0
  136. package/dist/Components/NcTextField.cjs +37 -13
  137. package/dist/Components/NcTextField.cjs.map +1 -1
  138. package/dist/Components/NcTextField.mjs +45 -21
  139. package/dist/Components/NcTextField.mjs.map +1 -1
  140. package/dist/Components/NcTimezonePicker.cjs +1 -1
  141. package/dist/Components/NcTimezonePicker.mjs +1 -1
  142. package/dist/Components/NcUserBubble.cjs +4 -4
  143. package/dist/Components/NcUserBubble.cjs.map +1 -1
  144. package/dist/Components/NcUserBubble.mjs +4 -4
  145. package/dist/Components/NcUserBubble.mjs.map +1 -1
  146. package/dist/assets/index-236620b0.css +150 -0
  147. package/dist/assets/{index-03ec5f40.css → index-400b48a6.css} +7 -7
  148. package/dist/assets/{index-33da80f0.css → index-4611417f.css} +8 -9
  149. package/dist/assets/{index-01e5adf4.css → index-4b75fe20.css} +11 -11
  150. package/dist/assets/{index-294382c8.css → index-574438d6.css} +43 -38
  151. package/dist/assets/{index-c7905a53.css → index-57b305d3.css} +3 -3
  152. package/dist/assets/{index-de0326c7.css → index-5ee8a575.css} +69 -78
  153. package/dist/assets/{index-9354264c.css → index-6f721577.css} +16 -16
  154. package/dist/assets/{index-fec4bb7b.css → index-73867d38.css} +17 -16
  155. package/dist/assets/{index-becfbea7.css → index-8304db49.css} +23 -22
  156. package/dist/assets/{index-5eff69c7.css → index-9dcf6260.css} +32 -30
  157. package/dist/assets/{index-23e64bbb.css → index-9e44e336.css} +9 -9
  158. package/dist/assets/{index-0557f12a.css → index-9e9587e1.css} +4 -4
  159. package/dist/assets/index-abb90c97.css +164 -0
  160. package/dist/assets/{index-5072b6ee.css → index-af72a30b.css} +11 -10
  161. package/dist/assets/{index-194e9415.css → index-c06ad941.css} +70 -58
  162. package/dist/assets/{index-fbdeb5ab.css → index-c5ae3bc4.css} +11 -11
  163. package/dist/assets/index-dc612aa3.css +112 -0
  164. package/dist/assets/{index-376d2dec.css → index-e7c55791.css} +67 -67
  165. package/dist/assets/{index-165fce0e.css → index-e7eadba7.css} +13 -13
  166. package/dist/assets/{index-6405cd50.css → index-e828b286.css} +4 -4
  167. package/dist/assets/{index-0ab8e182.css → index-eea65531.css} +23 -22
  168. package/dist/assets/{index-1cf8eeb4.css → index-f85aa003.css} +13 -32
  169. package/dist/assets/{referencePickerModal-0acecb5e.css → referencePickerModal-3a127978.css} +55 -55
  170. package/dist/chunks/{NcAppNavigationToggle-960658a0.cjs → NcAppNavigationToggle-841d3015.cjs} +1 -1
  171. package/dist/chunks/{NcAppNavigationToggle-960658a0.cjs.map → NcAppNavigationToggle-841d3015.cjs.map} +1 -1
  172. package/dist/chunks/{NcAppNavigationToggle-d868f651.mjs → NcAppNavigationToggle-e358aa47.mjs} +1 -1
  173. package/dist/chunks/{NcAppNavigationToggle-d868f651.mjs.map → NcAppNavigationToggle-e358aa47.mjs.map} +1 -1
  174. package/dist/chunks/{NcInputConfirmCancel-f881168d.mjs → NcInputConfirmCancel-44052477.mjs} +16 -9
  175. package/dist/chunks/NcInputConfirmCancel-44052477.mjs.map +1 -0
  176. package/dist/chunks/{NcInputConfirmCancel-0c4bee9a.cjs → NcInputConfirmCancel-6bea0fdc.cjs} +11 -4
  177. package/dist/chunks/NcInputConfirmCancel-6bea0fdc.cjs.map +1 -0
  178. package/dist/chunks/{NcRichText-d385dc10.cjs → NcRichText-332fe454.cjs} +2 -2
  179. package/dist/chunks/{NcRichText-1c3d2654.mjs.map → NcRichText-332fe454.cjs.map} +1 -1
  180. package/dist/chunks/{NcRichText-1c3d2654.mjs → NcRichText-8fda53c8.mjs} +9 -9
  181. package/dist/chunks/{NcRichText-d385dc10.cjs.map → NcRichText-8fda53c8.mjs.map} +1 -1
  182. package/dist/chunks/{NcSettingsSelectGroup-47d9c113.cjs → NcSettingsSelectGroup-a5ff8c36.cjs} +1 -1
  183. package/dist/chunks/{NcSettingsSelectGroup-47d9c113.cjs.map → NcSettingsSelectGroup-a5ff8c36.cjs.map} +1 -1
  184. package/dist/chunks/{NcSettingsSelectGroup-0f4a0f94.mjs → NcSettingsSelectGroup-fdd3309c.mjs} +2 -2
  185. package/dist/chunks/{NcSettingsSelectGroup-0f4a0f94.mjs.map → NcSettingsSelectGroup-fdd3309c.mjs.map} +1 -1
  186. package/dist/chunks/{ScopeComponent-97a014a1.mjs → ScopeComponent-9519afcc.mjs} +1 -1
  187. package/dist/chunks/{ScopeComponent-97a014a1.mjs.map → ScopeComponent-9519afcc.mjs.map} +1 -1
  188. package/dist/chunks/{ScopeComponent-1c75ec38.cjs → ScopeComponent-e060526a.cjs} +1 -1
  189. package/dist/chunks/{ScopeComponent-1c75ec38.cjs.map → ScopeComponent-e060526a.cjs.map} +1 -1
  190. package/dist/chunks/{actionText-b0bd6eb7.cjs → actionText-54bc24a6.cjs} +1 -1
  191. package/dist/chunks/{actionText-9f5c55bd.mjs.map → actionText-54bc24a6.cjs.map} +1 -1
  192. package/dist/chunks/{actionText-9f5c55bd.mjs → actionText-a64be267.mjs} +1 -1
  193. package/dist/chunks/{actionText-b0bd6eb7.cjs.map → actionText-a64be267.mjs.map} +1 -1
  194. package/dist/chunks/{index-2a5b8ace.cjs → index-032137a6.cjs} +63 -29
  195. package/dist/chunks/index-032137a6.cjs.map +1 -0
  196. package/dist/chunks/{index-6c221fa0.mjs → index-fb2ee22c.mjs} +72 -38
  197. package/dist/chunks/index-fb2ee22c.mjs.map +1 -0
  198. package/dist/chunks/l10n-05a09c66.mjs +31 -0
  199. package/dist/chunks/l10n-05a09c66.mjs.map +1 -0
  200. package/dist/chunks/{l10n-c5f5f001.mjs → l10n-9aa6482d.mjs} +1 -1
  201. package/dist/chunks/{l10n-c5f5f001.mjs.map → l10n-9aa6482d.mjs.map} +1 -1
  202. package/dist/chunks/l10n-b1d264c7.cjs +29 -0
  203. package/dist/chunks/l10n-b1d264c7.cjs.map +1 -0
  204. package/dist/chunks/{l10n-4326316a.cjs → l10n-c7bd0ea6.cjs} +1 -1
  205. package/dist/chunks/{l10n-4326316a.cjs.map → l10n-c7bd0ea6.cjs.map} +1 -1
  206. package/dist/chunks/{referencePickerModal-9b4ff88d.cjs → referencePickerModal-279a483d.cjs} +2 -2
  207. package/dist/chunks/{referencePickerModal-9b4ff88d.cjs.map → referencePickerModal-279a483d.cjs.map} +1 -1
  208. package/dist/chunks/{referencePickerModal-0fde503d.mjs → referencePickerModal-443a4c57.mjs} +2 -2
  209. package/dist/chunks/{referencePickerModal-0fde503d.mjs.map → referencePickerModal-443a4c57.mjs.map} +1 -1
  210. package/dist/index.cjs +105 -99
  211. package/dist/index.cjs.map +1 -1
  212. package/dist/index.mjs +138 -129
  213. package/dist/index.mjs.map +1 -1
  214. package/package.json +6 -3
  215. package/dist/assets/index-7768d5e5.css +0 -148
  216. package/dist/chunks/NcInputConfirmCancel-0c4bee9a.cjs.map +0 -1
  217. package/dist/chunks/NcInputConfirmCancel-f881168d.mjs.map +0 -1
  218. package/dist/chunks/index-2a5b8ace.cjs.map +0 -1
  219. package/dist/chunks/index-6c221fa0.mjs.map +0 -1
  220. package/dist/chunks/l10n-27a75c40.mjs +0 -31
  221. package/dist/chunks/l10n-27a75c40.mjs.map +0 -1
  222. package/dist/chunks/l10n-903083c4.cjs +0 -29
  223. package/dist/chunks/l10n-903083c4.cjs.map +0 -1
@@ -1,9 +1,9 @@
1
- var N = require("../assets/index-1cf8eeb4.css");
2
- const r = require("./NcModal.cjs"), c = require("../Mixins/isMobile.cjs"), d = require("../chunks/l10n-903083c4.cjs"), u = require("debounce"), p = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), g = (t) => t && t.__esModule ? t : { default: t }, h = /* @__PURE__ */ g(u);
3
- const f = {
1
+ var N = require("../assets/index-f85aa003.css");
2
+ const r = require("./NcDialog.cjs"), c = require("../Mixins/isMobile.cjs"), d = require("../chunks/l10n-b1d264c7.cjs"), u = require("debounce"), p = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), g = (n) => n && n.__esModule ? n : { default: n }, f = /* @__PURE__ */ g(u);
3
+ const _ = {
4
4
  name: "NcAppSettingsDialog",
5
5
  components: {
6
- NcModal: r
6
+ NcDialog: r
7
7
  },
8
8
  mixins: [c],
9
9
  props: {
@@ -53,11 +53,25 @@ const f = {
53
53
  };
54
54
  },
55
55
  computed: {
56
+ dialogProperties() {
57
+ return {
58
+ additionalTrapElements: this.additionalTrapElements,
59
+ class: "app-settings",
60
+ container: this.container,
61
+ contentClasses: "app-settings__content",
62
+ size: "large",
63
+ name: this.name,
64
+ navigationClasses: "app-settings__navigation"
65
+ };
66
+ },
56
67
  hasNavigation() {
57
68
  return !(this.isMobile || !this.showNavigation);
58
69
  },
59
70
  settingsNavigationAriaLabel() {
60
71
  return d.t("Settings navigation");
72
+ },
73
+ getNavigationItems() {
74
+ return this.getSettingsNavigation(this.$slots.default);
61
75
  }
62
76
  },
63
77
  mounted() {
@@ -73,133 +87,68 @@ const f = {
73
87
  * @param {object} slots The default slots object passed from the render function.
74
88
  * @return {Array} the navigation items
75
89
  */
76
- getSettingsNavigation(t) {
77
- const n = t.filter((e) => e.componentOptions).map((e) => {
78
- var s, a;
90
+ getSettingsNavigation(n) {
91
+ const e = n.filter((t) => t.componentOptions).map((t) => {
92
+ var i, a;
79
93
  return {
80
- id: (s = e.componentOptions.propsData) == null ? void 0 : s.id,
81
- name: (a = e.componentOptions.propsData) == null ? void 0 : a.name
94
+ id: (i = t.componentOptions.propsData) == null ? void 0 : i.id,
95
+ name: (a = t.componentOptions.propsData) == null ? void 0 : a.name
82
96
  };
83
- }), o = t.map((e) => e.name), i = t.map((e) => e.id);
84
- return n.forEach((e, s) => {
85
- const a = [...o], l = [...i];
86
- if (a.splice(s, 1), l.splice(s, 1), a.includes(e.name))
87
- throw new Error(`Duplicate section name found: ${e}. Settings navigation sections must have unique section names.`);
88
- if (l.includes(e.id))
89
- throw new Error(`Duplicate section id found: ${e}. Settings navigation sections must have unique section ids.`);
90
- }), n;
97
+ }), s = n.map((t) => t.name), o = n.map((t) => t.id);
98
+ return e.forEach((t, i) => {
99
+ const a = [...s], l = [...o];
100
+ if (a.splice(i, 1), l.splice(i, 1), a.includes(t.name))
101
+ throw new Error(`Duplicate section name found: ${t}. Settings navigation sections must have unique section names.`);
102
+ if (l.includes(t.id))
103
+ throw new Error(`Duplicate section id found: ${t}. Settings navigation sections must have unique section ids.`);
104
+ }), e;
91
105
  },
92
106
  /**
93
107
  * Scrolls the content to the selected settings section.absolute
94
108
  *
95
109
  * @param {string} item the ID of the section
96
110
  */
97
- handleSettingsNavigationClick(t) {
98
- this.linkClicked = !0, document.getElementById("settings-section_" + t).scrollIntoView({
111
+ handleSettingsNavigationClick(n) {
112
+ this.linkClicked = !0, document.getElementById("settings-section_" + n).scrollIntoView({
99
113
  behavior: "smooth",
100
114
  inline: "nearest"
101
- }), this.selectedSection = t, setTimeout(() => {
115
+ }), this.selectedSection = n, setTimeout(() => {
102
116
  this.linkClicked = !1;
103
117
  }, 1e3);
104
118
  },
105
- handleCloseModal() {
106
- this.$emit("update:open", !1), this.scroller.removeEventListener("scroll", this.handleScroll), this.addedScrollListener = !1, this.scroller.scrollTop = 0;
119
+ handleCloseModal(n) {
120
+ n || (this.$emit("update:open", !1), this.scroller.removeEventListener("scroll", this.handleScroll), this.addedScrollListener = !1, this.scroller.scrollTop = 0);
107
121
  },
108
122
  handleScroll() {
109
123
  this.linkClicked || this.unfocusNavigationItem();
110
124
  },
111
125
  // Remove selected section once the user starts scrolling
112
- unfocusNavigationItem: h.default(function() {
126
+ unfocusNavigationItem: f.default(function() {
113
127
  this.selectedSection = "", document.activeElement.className.includes("navigation-list__link") && document.activeElement.blur();
114
- }, 300),
115
- handleLinkKeydown(t, n) {
116
- t.code === "Enter" && this.handleSettingsNavigationClick(n);
117
- }
118
- },
119
- render(t) {
120
- const n = () => this.hasNavigation ? [t("div", {
121
- attrs: {
122
- class: "app-settings__navigation",
123
- role: "tablist",
124
- "aria-label": this.settingsNavigationAriaLabel
125
- }
126
- }, [t("ul", {
127
- attrs: {
128
- class: "navigation-list",
129
- role: "tablist"
130
- }
131
- }, this.getSettingsNavigation(this.$slots.default).map((i) => o(i)))])] : [], o = (i) => t("li", {}, [t("a", {
132
- class: {
133
- "navigation-list__link": !0,
134
- "navigation-list__link--active": i.id === this.selectedSection
135
- },
136
- attrs: {
137
- role: "tab",
138
- "aria-selected": i.id === this.selectedSection,
139
- tabindex: "0"
140
- },
141
- on: {
142
- click: () => this.handleSettingsNavigationClick(i.id),
143
- keydown: () => this.handleLinkKeydown(event, i.id)
144
- }
145
- }, i.name)]);
146
- if (this.open)
147
- return t("NcModal", {
148
- class: [
149
- "app-settings-modal"
150
- ],
151
- attrs: {
152
- container: this.container,
153
- size: "large",
154
- additionalTrapElements: this.additionalTrapElements
155
- },
156
- on: {
157
- close: () => {
158
- this.handleCloseModal();
159
- }
160
- }
161
- }, [
162
- // main app-settings root element
163
- t("div", {
164
- attrs: {
165
- class: "app-settings"
166
- }
167
- }, [
168
- // app-settings name
169
- t("h2", {
170
- attrs: {
171
- class: "app-settings__name"
172
- }
173
- }, this.name),
174
- // app-settings navigation + content
175
- t(
176
- "div",
177
- {
178
- attrs: {
179
- class: "app-settings__wrapper"
180
- }
181
- },
182
- [
183
- ...n(),
184
- t("div", {
185
- attrs: {
186
- class: "app-settings__content"
187
- },
188
- ref: "settingsScroller"
189
- }, this.$slots.default)
190
- ]
191
- )
192
- ])
193
- ]);
128
+ }, 300)
194
129
  }
195
- }, m = null, _ = null;
196
- var v = /* @__PURE__ */ p.normalizeComponent(
197
- f,
198
- m,
130
+ };
131
+ var h = function() {
132
+ var e = this, s = e._self._c;
133
+ return e.open ? s("NcDialog", e._b({ on: { "update:open": e.handleCloseModal }, scopedSlots: e._u([{ key: "navigation", fn: function({ isCollapsed: o }) {
134
+ return [s("ul", { class: { "navigation-list": !0, "navigation-list--collapsed": o }, attrs: { "aria-label": e.settingsNavigationAriaLabel, role: "tablist" } }, e._l(e.getNavigationItems, function(t) {
135
+ return s("li", { key: t.id }, [s("a", { class: {
136
+ "navigation-list__link": !0,
137
+ "navigation-list__link--active": t.id === e.selectedSection
138
+ }, attrs: { "aria-selected": t.id === e.selectedSection, role: "tab", tabindex: "0" }, on: { click: function(i) {
139
+ return e.handleSettingsNavigationClick(t.id);
140
+ }, keydown: function(i) {
141
+ return !i.type.indexOf("key") && e._k(i.keyCode, "enter", 13, i.key, "Enter") ? null : e.handleSettingsNavigationClick(t.id);
142
+ } } }, [e._v(e._s(t.name))])]);
143
+ }), 0)];
144
+ } }], null, !1, 1246349142) }, "NcDialog", e.dialogProperties, !1), [s("div", { ref: "settingsScroller" }, [e._t("default")], 2)]) : e._e();
145
+ }, m = [], v = /* @__PURE__ */ p.normalizeComponent(
199
146
  _,
147
+ h,
148
+ m,
200
149
  !1,
201
150
  null,
202
- "0ff961d8",
151
+ "a4d36143",
203
152
  null,
204
153
  null
205
154
  );
@@ -1 +1 @@
1
- {"version":3,"file":"NcAppSettingsDialog.cjs","sources":["../../src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<docs>\nJust nest the `AppSettingSections` component into `NcAppSettingsDialog`,\nproviding the section's name prop. You can put your settings within each\n`NcAppSettingsSection` component.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"settingsOpen = true\">Show Settings</NcButton>\n\t\t<NcAppSettingsDialog :open.sync=\"settingsOpen\" :show-navigation=\"true\" name=\"Application settings\">\n\t\t\t<NcAppSettingsSection id=\"asci-name-1\" name=\"Example name 1\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-2\" name=\"Example name 2\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-3\" name=\"Example name 3\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-4\" name=\"Example name 4\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-5\" name=\"Example name 5\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-6\" name=\"Example name 6\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-7\" name=\"Example name 7\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-8\" name=\"Example name 8\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-9\" name=\"Example name 9\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-10\" name=\"Example name 10\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t</NcAppSettingsDialog>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsettingsOpen: false,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<script>\nimport NcModal from '../NcModal/index.js'\nimport isMobile from '../../mixins/isMobile/index.js'\nimport { t } from '../../l10n.js'\n\nimport debounce from 'debounce'\n\nexport default {\n\n\tname: 'NcAppSettingsDialog',\n\n\tcomponents: {\n\t\tNcModal,\n\t},\n\n\tmixins: [isMobile],\n\n\tprops: {\n\t\t/**\n\t\t * Determines the open / closed state of the modal\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Shows the navigation on desktop if true\n\t\t */\n\t\tshowNavigation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the popover container\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: String,\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Name of the settings\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Additional elements to add to the focus trap\n\t\t */\n\t\tadditionalTrapElements: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t},\n\n\temits: ['update:open'],\n\n\tdata() {\n\t\treturn {\n\t\t\tselectedSection: '',\n\t\t\tlinkClicked: false,\n\t\t\taddedScrollListener: false,\n\t\t\tscroller: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\n\t\thasNavigation() {\n\t\t\tif (this.isMobile || !this.showNavigation) {\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\treturn true\n\t\t\t}\n\t\t},\n\n\t\tsettingsNavigationAriaLabel() {\n\t\t\treturn t('Settings navigation')\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Select first settings section\n\t\tthis.selectedSection = this.$slots.default[0].componentOptions.propsData.id\n\t},\n\n\tupdated() {\n\t\t// Check that the scroller element has been mounted\n\t\tif (!this.$refs.settingsScroller) {\n\t\t\treturn\n\t\t}\n\t\t// Get the scroller element\n\t\tthis.scroller = this.$refs.settingsScroller\n\t\tif (!this.addedScrollListener) {\n\t\t\tthis.scroller.addEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = true\n\t\t}\n\n\t},\n\n\tmethods: {\n\n\t\t/**\n\t\t * Builds the settings navigation menu\n\t\t *\n\t\t * @param {object} slots The default slots object passed from the render function.\n\t\t * @return {Array} the navigation items\n\t\t */\n\t\tgetSettingsNavigation(slots) {\n\t\t\t// Array of navigationitems strings\n\t\t\tconst navigationItems = slots.filter(vNode => vNode.componentOptions).map(vNode => {\n\t\t\t\treturn {\n\t\t\t\t\tid: vNode.componentOptions.propsData?.id,\n\t\t\t\t\tname: vNode.componentOptions.propsData?.name,\n\t\t\t\t}\n\t\t\t})\n\t\t\tconst navigationNames = slots.map(item => item.name)\n\t\t\tconst navigationIds = slots.map(item => item.id)\n\n\t\t\t// Check for the uniqueness of section names\n\t\t\tnavigationItems.forEach((element, index) => {\n\t\t\t\tconst newNamesArray = [...navigationNames]\n\t\t\t\tconst newIdArray = [...navigationIds]\n\t\t\t\tnewNamesArray.splice(index, 1)\n\t\t\t\tnewIdArray.splice(index, 1)\n\t\t\t\tif (newNamesArray.includes(element.name)) {\n\t\t\t\t\tthrow new Error(`Duplicate section name found: ${element}. Settings navigation sections must have unique section names.`)\n\t\t\t\t}\n\t\t\t\tif (newIdArray.includes(element.id)) {\n\t\t\t\t\tthrow new Error(`Duplicate section id found: ${element}. Settings navigation sections must have unique section ids.`)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn navigationItems\n\t\t},\n\n\t\t/**\n\t\t * Scrolls the content to the selected settings section.absolute\n\t\t *\n\t\t * @param {string} item the ID of the section\n\t\t */\n\t\thandleSettingsNavigationClick(item) {\n\t\t\tthis.linkClicked = true\n\t\t\tdocument.getElementById('settings-section_' + item).scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tinline: 'nearest',\n\t\t\t})\n\t\t\tthis.selectedSection = item\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.linkClicked = false\n\t\t\t}, 1000)\n\t\t},\n\n\t\thandleCloseModal() {\n\t\t\tthis.$emit('update:open', false)\n\t\t\t// Remove scroll listener each time the modal is closed\n\t\t\tthis.scroller.removeEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = false\n\t\t\tthis.scroller.scrollTop = 0\n\t\t},\n\n\t\thandleScroll() {\n\t\t\tif (!this.linkClicked) {\n\t\t\t\tthis.unfocusNavigationItem()\n\t\t\t}\n\t\t},\n\n\t\t// Remove selected section once the user starts scrolling\n\t\tunfocusNavigationItem: debounce(function() {\n\t\t\tthis.selectedSection = ''\n\t\t\tif (document.activeElement.className.includes('navigation-list__link')) {\n\t\t\t\tdocument.activeElement.blur()\n\t\t\t}\n\t\t}, 300),\n\n\t\thandleLinkKeydown(keyDownEvent, item) {\n\t\t\tif (keyDownEvent.code === 'Enter') {\n\t\t\t\tthis.handleSettingsNavigationClick(item)\n\t\t\t}\n\t\t},\n\t},\n\n\trender(h) {\n\t\t/**\n\t\t * Build the navigation\n\t\t *\n\t\t * @return {object} the navigation\n\t\t */\n\t\tconst createAppSettingsNavigation = () => {\n\t\t\tif (this.hasNavigation) {\n\t\t\t\treturn [h('div', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'app-settings__navigation',\n\t\t\t\t\t\trole: 'tablist',\n\t\t\t\t\t\t'aria-label': this.settingsNavigationAriaLabel,\n\t\t\t\t\t},\n\t\t\t\t}, [h('ul', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'navigation-list',\n\t\t\t\t\t\trole: 'tablist',\n\t\t\t\t\t},\n\t\t\t\t}, this.getSettingsNavigation(this.$slots.default).map(item => {\n\t\t\t\t\treturn createListElement(item)\n\t\t\t\t}))])]\n\t\t\t} else {\n\t\t\t\treturn []\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Build each list element in the navigation\n\t\t *\n\t\t * @param {object} item the navigation item\n\t\t * @return {object} the list element\n\t\t */\n\t\tconst createListElement = (item) => h('li', {}, [h('a', {\n\t\t\tclass: {\n\t\t\t\t'navigation-list__link': true,\n\t\t\t\t'navigation-list__link--active': item.id === this.selectedSection,\n\t\t\t},\n\n\t\t\tattrs: {\n\t\t\t\trole: 'tab',\n\t\t\t\t'aria-selected': item.id === this.selectedSection,\n\t\t\t\ttabindex: '0',\n\t\t\t},\n\n\t\t\ton: {\n\t\t\t\tclick: () => this.handleSettingsNavigationClick(item.id),\n\t\t\t\tkeydown: () => this.handleLinkKeydown(event, item.id),\n\t\t\t},\n\t\t}, item.name)])\n\n\t\t// Return value of the render function\n\t\tif (this.open) {\n\t\t\treturn h('NcModal', {\n\t\t\t\tclass: [\n\t\t\t\t\t'app-settings-modal',\n\t\t\t\t],\n\t\t\t\tattrs: {\n\t\t\t\t\tcontainer: this.container,\n\t\t\t\t\tsize: 'large',\n\t\t\t\t\tadditionalTrapElements: this.additionalTrapElements,\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tclose: () => { this.handleCloseModal() },\n\t\t\t\t},\n\t\t\t}, [\n\t\t\t\t// main app-settings root element\n\t\t\t\th('div', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'app-settings',\n\t\t\t\t\t},\n\t\t\t\t}, [\n\t\t\t\t\t// app-settings name\n\t\t\t\t\th('h2', {\n\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\tclass: 'app-settings__name',\n\t\t\t\t\t\t},\n\t\t\t\t\t}, this.name),\n\n\t\t\t\t\t// app-settings navigation + content\n\t\t\t\t\th(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\t\tclass: 'app-settings__wrapper',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t...createAppSettingsNavigation(),\n\t\t\t\t\t\t\th('div', {\n\t\t\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\t\t\tclass: 'app-settings__content',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tref: 'settingsScroller',\n\t\t\t\t\t\t\t}, this.$slots.default),\n\t\t\t\t\t\t],\n\t\t\t\t\t),\n\t\t\t\t]),\n\t\t\t])\n\t\t} else {\n\t\t\treturn undefined\n\t\t}\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n\n.app-settings-modal :deep(.modal-wrapper .modal-container) {\n\tdisplay: flex;\n\toverflow: hidden;\n}\n\n.app-settings {\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-width: 0;\n\t&__name {\n\t\tmin-height: $clickable-area;\n\t\theight: $clickable-area;\n\t\tline-height: $clickable-area;\n\t\tpadding-top: 4px; // Same as the close button top spacing\n\t\ttext-align: center;\n\t}\n\t&__wrapper {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\toverflow: hidden;\n\t\theight: 100%;\n\t\tposition: relative;\n\t}\n\t&__navigation {\n\t\tmin-width: 200px;\n\t\tmargin-right: 20px;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\tposition: relative;\n\t\theight: 100%;\n\t}\n\t&__content {\n\t\tmax-width: 100vw;\n\t\toverflow-y: auto;\n\t\toverflow-x: hidden;\n\t\tpadding: 24px;\n\t\twidth: 100%;\n\t}\n}\n\n.navigation-list {\n\theight: 100%;\n\tbox-sizing: border-box;\n\toverflow-y: auto;\n\tpadding: 12px;\n\t&__link {\n\t\tdisplay: block;\n\t\tfont-size: 16px;\n\t\theight: $clickable-area;\n\t\tmargin: 4px 0;\n\t\tline-height: $clickable-area;\n\t\tborder-radius: var(--border-radius-pill);\n\t\tfont-weight: bold;\n\t\tpadding: 0 20px;\n\t\tcursor: pointer;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t}\n\t\t&--active {\n\t\t\tbackground-color: var(--color-primary-element-light) !important;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","Components_NcModal","Mixins_isMobile","l10n","slots","navigationItems","vNode","_a","_b","navigationNames","item","navigationIds","element","index","newNamesArray","newIdArray","debounce__default","keyDownEvent","h","createAppSettingsNavigation","createListElement"],"mappings":";;AAoFA,MAAAA,IAAA;AAAA,EAEA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,SAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,CAAA;AAAA,IACA;AAAA,EAEA;AAAA,EAEA,OAAA,CAAA,aAAA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,iBAAA;AAAA,MACA,aAAA;AAAA,MACA,qBAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IAEA,gBAAA;AACA,aAAA,OAAA,YAAA,CAAA,KAAA;AAAA,IAKA;AAAA,IAEA,8BAAA;AACA,aAAAC,EAAA,EAAA,qBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAEA,SAAA,kBAAA,KAAA,OAAA,QAAA,CAAA,EAAA,iBAAA,UAAA;AAAA,EACA;AAAA,EAEA,UAAA;AAEA,IAAA,KAAA,MAAA,qBAIA,KAAA,WAAA,KAAA,MAAA,kBACA,KAAA,wBACA,KAAA,SAAA,iBAAA,UAAA,KAAA,YAAA,GACA,KAAA,sBAAA;AAAA,EAGA;AAAA,EAEA,SAAA;AAAA;AAA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,wBAAA,KAAA;AAAA,QACA;AAAA,QACA,IAAA;AAAA,UACA,OAAA,MAAA;AAAA,iBAAA,iBAAA;AAAA,UAAA;AAAA,QACA;AAAA,MACA,GAAA;AAAA;AAAA,QAEAA,EAAA,OAAA;AAAA,UACA,OAAA;AAAA,YACA,OAAA;AAAA,UACA;AAAA,QACA,GAAA;AAAA;AAAA,UAEAA,EAAA,MAAA;AAAA,YACA,OAAA;AAAA,cACA,OAAA;AAAA,YACA;AAAA,UACA,GAAA,KAAA,IAAA;AAAA;AAAA,UAGAA;AAAA,YACA;AAAA,YACA;AAAA,cACA,OAAA;AAAA,gBACA,OAAA;AAAA,cACA;AAAA,YACA;AAAA,YACA;AAAA,cACA,GAAAC,EAAA;AAAA,cACAD,EAAA,OAAA;AAAA,gBACA,OAAA;AAAA,kBACA,OAAA;AAAA,gBACA;AAAA,gBACA,KAAA;AAAA,cACA,GAAA,KAAA,OAAA,OAAA;AAAA,YACA;AAAA,UACA;AAAA,QACA,CAAA;AAAA,MACA,CAAA;AAAA,EAIA;AACA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcAppSettingsDialog.cjs","sources":["../../src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<docs>\nJust nest the `AppSettingSections` component into `NcAppSettingsDialog`,\nproviding the section's name prop. You can put your settings within each\n`NcAppSettingsSection` component.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"settingsOpen = true\">Show Settings</NcButton>\n\t\t<NcAppSettingsDialog :open.sync=\"settingsOpen\" :show-navigation=\"true\" name=\"Application settings\">\n\t\t\t<NcAppSettingsSection id=\"asci-name-1\" name=\"Example name 1\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-2\" name=\"Example name 2\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-3\" name=\"Example name 3\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-4\" name=\"Example name 4\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-5\" name=\"Example name 5\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-6\" name=\"Example name 6\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-7\" name=\"Example name 7\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-8\" name=\"Example name 8\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-9\" name=\"Example name 9\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-10\" name=\"Example name 10\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t</NcAppSettingsDialog>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsettingsOpen: false,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcDialog v-if=\"open\"\n\t\tv-bind=\"dialogProperties\"\n\t\t@update:open=\"handleCloseModal\">\n\t\t<template #navigation=\"{ isCollapsed }\">\n\t\t\t<ul :aria-label=\"settingsNavigationAriaLabel\"\n\t\t\t\t:class=\"{ 'navigation-list': true, 'navigation-list--collapsed': isCollapsed }\"\n\t\t\t\trole=\"tablist\">\n\t\t\t\t<li v-for=\"item in getNavigationItems\" :key=\"item.id\">\n\t\t\t\t\t<a :aria-selected=\"item.id === selectedSection\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'navigation-list__link': true,\n\t\t\t\t\t\t\t'navigation-list__link--active': item.id === selectedSection,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t@click=\"handleSettingsNavigationClick(item.id)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSettingsNavigationClick(item.id)\">{{ item.name }}</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</template>\n\t\t<div ref=\"settingsScroller\">\n\t\t\t<slot />\n\t\t</div>\n\t</NcDialog>\n</template>\n\n<script>\nimport NcDialog from '../NcDialog/index.js'\nimport isMobile from '../../mixins/isMobile/index.js'\nimport { t } from '../../l10n.js'\n\nimport debounce from 'debounce'\n\nexport default {\n\n\tname: 'NcAppSettingsDialog',\n\n\tcomponents: {\n\t\tNcDialog,\n\t},\n\n\tmixins: [isMobile],\n\n\tprops: {\n\t\t/**\n\t\t * Determines the open / closed state of the modal\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Shows the navigation on desktop if true\n\t\t */\n\t\tshowNavigation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the popover container\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: String,\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Name of the settings\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Additional elements to add to the focus trap\n\t\t */\n\t\tadditionalTrapElements: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t},\n\n\temits: ['update:open'],\n\n\tdata() {\n\t\treturn {\n\t\t\tselectedSection: '',\n\t\t\tlinkClicked: false,\n\t\t\taddedScrollListener: false,\n\t\t\tscroller: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tdialogProperties() {\n\t\t\treturn {\n\t\t\t\tadditionalTrapElements: this.additionalTrapElements,\n\t\t\t\tclass: 'app-settings',\n\t\t\t\tcontainer: this.container,\n\t\t\t\tcontentClasses: 'app-settings__content',\n\t\t\t\tsize: 'large',\n\t\t\t\tname: this.name,\n\t\t\t\tnavigationClasses: 'app-settings__navigation',\n\t\t\t}\n\t\t},\n\n\t\thasNavigation() {\n\t\t\tif (this.isMobile || !this.showNavigation) {\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\treturn true\n\t\t\t}\n\t\t},\n\n\t\tsettingsNavigationAriaLabel() {\n\t\t\treturn t('Settings navigation')\n\t\t},\n\n\t\tgetNavigationItems() {\n\t\t\treturn this.getSettingsNavigation(this.$slots.default)\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Select first settings section\n\t\tthis.selectedSection = this.$slots.default[0].componentOptions.propsData.id\n\t},\n\n\tupdated() {\n\t\t// Check that the scroller element has been mounted\n\t\tif (!this.$refs.settingsScroller) {\n\t\t\treturn\n\t\t}\n\t\t// Get the scroller element\n\t\tthis.scroller = this.$refs.settingsScroller\n\t\tif (!this.addedScrollListener) {\n\t\t\tthis.scroller.addEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = true\n\t\t}\n\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Builds the settings navigation menu\n\t\t *\n\t\t * @param {object} slots The default slots object passed from the render function.\n\t\t * @return {Array} the navigation items\n\t\t */\n\t\tgetSettingsNavigation(slots) {\n\t\t\t// Array of navigationitems strings\n\t\t\tconst navigationItems = slots.filter(vNode => vNode.componentOptions).map(vNode => {\n\t\t\t\treturn {\n\t\t\t\t\tid: vNode.componentOptions.propsData?.id,\n\t\t\t\t\tname: vNode.componentOptions.propsData?.name,\n\t\t\t\t}\n\t\t\t})\n\t\t\tconst navigationNames = slots.map(item => item.name)\n\t\t\tconst navigationIds = slots.map(item => item.id)\n\n\t\t\t// Check for the uniqueness of section names\n\t\t\tnavigationItems.forEach((element, index) => {\n\t\t\t\tconst newNamesArray = [...navigationNames]\n\t\t\t\tconst newIdArray = [...navigationIds]\n\t\t\t\tnewNamesArray.splice(index, 1)\n\t\t\t\tnewIdArray.splice(index, 1)\n\t\t\t\tif (newNamesArray.includes(element.name)) {\n\t\t\t\t\tthrow new Error(`Duplicate section name found: ${element}. Settings navigation sections must have unique section names.`)\n\t\t\t\t}\n\t\t\t\tif (newIdArray.includes(element.id)) {\n\t\t\t\t\tthrow new Error(`Duplicate section id found: ${element}. Settings navigation sections must have unique section ids.`)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn navigationItems\n\t\t},\n\n\t\t/**\n\t\t * Scrolls the content to the selected settings section.absolute\n\t\t *\n\t\t * @param {string} item the ID of the section\n\t\t */\n\t\thandleSettingsNavigationClick(item) {\n\t\t\tthis.linkClicked = true\n\t\t\tdocument.getElementById('settings-section_' + item).scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tinline: 'nearest',\n\t\t\t})\n\t\t\tthis.selectedSection = item\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.linkClicked = false\n\t\t\t}, 1000)\n\t\t},\n\n\t\thandleCloseModal(isOpen) {\n\t\t\tif (isOpen) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.$emit('update:open', false)\n\t\t\t// Remove scroll listener each time the modal is closed\n\t\t\tthis.scroller.removeEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = false\n\t\t\tthis.scroller.scrollTop = 0\n\t\t},\n\n\t\thandleScroll() {\n\t\t\tif (!this.linkClicked) {\n\t\t\t\tthis.unfocusNavigationItem()\n\t\t\t}\n\t\t},\n\n\t\t// Remove selected section once the user starts scrolling\n\t\tunfocusNavigationItem: debounce(function() {\n\t\t\tthis.selectedSection = ''\n\t\t\tif (document.activeElement.className.includes('navigation-list__link')) {\n\t\t\t\tdocument.activeElement.blur()\n\t\t\t}\n\t\t}, 300),\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.app-settings {\n\t&__navigation {\n\t\tmin-width: 200px;\n\t\tmargin-right: 20px;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\tposition: relative;\n\t\theight: 100%;\n\t}\n\t&__content {\n\t\tmax-width: 100vw;\n\t\toverflow-y: auto;\n\t\toverflow-x: hidden;\n\t\tpadding: 24px;\n\t\twidth: 100%;\n\t}\n}\n\n.navigation-list {\n\theight: 100%;\n\tbox-sizing: border-box;\n\toverflow-y: auto;\n\tpadding: 12px;\n\n\t&--collapsed {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tgap: 6px;\n\t}\n\n\t&__link {\n\t\tdisplay: block;\n\t\tfont-size: 16px;\n\t\theight: $clickable-area;\n\t\tmargin: 4px 0;\n\t\tline-height: $clickable-area;\n\t\tborder-radius: var(--border-radius-pill);\n\t\tfont-weight: bold;\n\t\tpadding: 0 20px;\n\t\tcursor: pointer;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t}\n\t\t&--active {\n\t\t\tbackground-color: var(--color-primary-element-light) !important;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","Components_NcDialog","Mixins_isMobile","l10n","slots","navigationItems","vNode","_a","_b","navigationNames","item","navigationIds","element","index","newNamesArray","newIdArray","isOpen","debounce__default"],"mappings":";;AAgHA,MAAAA,IAAA;AAAA,EAEA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,CAAA;AAAA,IACA;AAAA,EAEA;AAAA,EAEA,OAAA,CAAA,aAAA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,iBAAA;AAAA,MACA,aAAA;AAAA,MACA,qBAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,mBAAA;AACA,aAAA;AAAA,QACA,wBAAA,KAAA;AAAA,QACA,OAAA;AAAA,QACA,WAAA,KAAA;AAAA,QACA,gBAAA;AAAA,QACA,MAAA;AAAA,QACA,MAAA,KAAA;AAAA,QACA,mBAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,aAAA,OAAA,YAAA,CAAA,KAAA;AAAA,IAKA;AAAA,IAEA,8BAAA;AACA,aAAAC,EAAA,EAAA,qBAAA;AAAA,IACA;AAAA,IAEA,qBAAA;AACA,aAAA,KAAA,sBAAA,KAAA,OAAA,OAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAA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A,WAAA,MAAA;AACA,aAAA,cAAA;AAAA,MACA,GAAA,GAAA;AAAA,IACA;AAAA,IAEA,iBAAAM,GAAA;AACA,MAAAA,MAIA,KAAA,MAAA,eAAA,EAAA,GAEA,KAAA,SAAA,oBAAA,UAAA,KAAA,YAAA,GACA,KAAA,sBAAA,IACA,KAAA,SAAA,YAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,MAAA,KAAA,eACA,KAAA,sBAAA;AAAA,IAEA;AAAA;AAAA,IAGA,uBAAAC,EAAA,QAAA,WAAA;AACA,WAAA,kBAAA,IACA,SAAA,cAAA,UAAA,SAAA,uBAAA,KACA,SAAA,cAAA,KAAA;AAAA,IAEA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,13 +1,13 @@
1
- import "../assets/index-1cf8eeb4.css";
2
- import r from "./NcModal.mjs";
1
+ import "../assets/index-f85aa003.css";
2
+ import r from "./NcDialog.mjs";
3
3
  import c from "../Mixins/isMobile.mjs";
4
- import { t as d } from "../chunks/l10n-27a75c40.mjs";
5
- import p from "debounce";
6
- import { n as u } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
4
+ import { t as d } from "../chunks/l10n-05a09c66.mjs";
5
+ import u from "debounce";
6
+ import { n as p } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
7
7
  const g = {
8
8
  name: "NcAppSettingsDialog",
9
9
  components: {
10
- NcModal: r
10
+ NcDialog: r
11
11
  },
12
12
  mixins: [c],
13
13
  props: {
@@ -57,11 +57,25 @@ const g = {
57
57
  };
58
58
  },
59
59
  computed: {
60
+ dialogProperties() {
61
+ return {
62
+ additionalTrapElements: this.additionalTrapElements,
63
+ class: "app-settings",
64
+ container: this.container,
65
+ contentClasses: "app-settings__content",
66
+ size: "large",
67
+ name: this.name,
68
+ navigationClasses: "app-settings__navigation"
69
+ };
70
+ },
60
71
  hasNavigation() {
61
72
  return !(this.isMobile || !this.showNavigation);
62
73
  },
63
74
  settingsNavigationAriaLabel() {
64
75
  return d("Settings navigation");
76
+ },
77
+ getNavigationItems() {
78
+ return this.getSettingsNavigation(this.$slots.default);
65
79
  }
66
80
  },
67
81
  mounted() {
@@ -77,137 +91,72 @@ const g = {
77
91
  * @param {object} slots The default slots object passed from the render function.
78
92
  * @return {Array} the navigation items
79
93
  */
80
- getSettingsNavigation(t) {
81
- const n = t.filter((e) => e.componentOptions).map((e) => {
82
- var s, a;
94
+ getSettingsNavigation(n) {
95
+ const e = n.filter((t) => t.componentOptions).map((t) => {
96
+ var i, s;
83
97
  return {
84
- id: (s = e.componentOptions.propsData) == null ? void 0 : s.id,
85
- name: (a = e.componentOptions.propsData) == null ? void 0 : a.name
98
+ id: (i = t.componentOptions.propsData) == null ? void 0 : i.id,
99
+ name: (s = t.componentOptions.propsData) == null ? void 0 : s.name
86
100
  };
87
- }), o = t.map((e) => e.name), i = t.map((e) => e.id);
88
- return n.forEach((e, s) => {
89
- const a = [...o], l = [...i];
90
- if (a.splice(s, 1), l.splice(s, 1), a.includes(e.name))
91
- throw new Error(`Duplicate section name found: ${e}. Settings navigation sections must have unique section names.`);
92
- if (l.includes(e.id))
93
- throw new Error(`Duplicate section id found: ${e}. Settings navigation sections must have unique section ids.`);
94
- }), n;
101
+ }), a = n.map((t) => t.name), o = n.map((t) => t.id);
102
+ return e.forEach((t, i) => {
103
+ const s = [...a], l = [...o];
104
+ if (s.splice(i, 1), l.splice(i, 1), s.includes(t.name))
105
+ throw new Error(`Duplicate section name found: ${t}. Settings navigation sections must have unique section names.`);
106
+ if (l.includes(t.id))
107
+ throw new Error(`Duplicate section id found: ${t}. Settings navigation sections must have unique section ids.`);
108
+ }), e;
95
109
  },
96
110
  /**
97
111
  * Scrolls the content to the selected settings section.absolute
98
112
  *
99
113
  * @param {string} item the ID of the section
100
114
  */
101
- handleSettingsNavigationClick(t) {
102
- this.linkClicked = !0, document.getElementById("settings-section_" + t).scrollIntoView({
115
+ handleSettingsNavigationClick(n) {
116
+ this.linkClicked = !0, document.getElementById("settings-section_" + n).scrollIntoView({
103
117
  behavior: "smooth",
104
118
  inline: "nearest"
105
- }), this.selectedSection = t, setTimeout(() => {
119
+ }), this.selectedSection = n, setTimeout(() => {
106
120
  this.linkClicked = !1;
107
121
  }, 1e3);
108
122
  },
109
- handleCloseModal() {
110
- this.$emit("update:open", !1), this.scroller.removeEventListener("scroll", this.handleScroll), this.addedScrollListener = !1, this.scroller.scrollTop = 0;
123
+ handleCloseModal(n) {
124
+ n || (this.$emit("update:open", !1), this.scroller.removeEventListener("scroll", this.handleScroll), this.addedScrollListener = !1, this.scroller.scrollTop = 0);
111
125
  },
112
126
  handleScroll() {
113
127
  this.linkClicked || this.unfocusNavigationItem();
114
128
  },
115
129
  // Remove selected section once the user starts scrolling
116
- unfocusNavigationItem: p(function() {
130
+ unfocusNavigationItem: u(function() {
117
131
  this.selectedSection = "", document.activeElement.className.includes("navigation-list__link") && document.activeElement.blur();
118
- }, 300),
119
- handleLinkKeydown(t, n) {
120
- t.code === "Enter" && this.handleSettingsNavigationClick(n);
121
- }
122
- },
123
- render(t) {
124
- const n = () => this.hasNavigation ? [t("div", {
125
- attrs: {
126
- class: "app-settings__navigation",
127
- role: "tablist",
128
- "aria-label": this.settingsNavigationAriaLabel
129
- }
130
- }, [t("ul", {
131
- attrs: {
132
- class: "navigation-list",
133
- role: "tablist"
134
- }
135
- }, this.getSettingsNavigation(this.$slots.default).map((i) => o(i)))])] : [], o = (i) => t("li", {}, [t("a", {
136
- class: {
137
- "navigation-list__link": !0,
138
- "navigation-list__link--active": i.id === this.selectedSection
139
- },
140
- attrs: {
141
- role: "tab",
142
- "aria-selected": i.id === this.selectedSection,
143
- tabindex: "0"
144
- },
145
- on: {
146
- click: () => this.handleSettingsNavigationClick(i.id),
147
- keydown: () => this.handleLinkKeydown(event, i.id)
148
- }
149
- }, i.name)]);
150
- if (this.open)
151
- return t("NcModal", {
152
- class: [
153
- "app-settings-modal"
154
- ],
155
- attrs: {
156
- container: this.container,
157
- size: "large",
158
- additionalTrapElements: this.additionalTrapElements
159
- },
160
- on: {
161
- close: () => {
162
- this.handleCloseModal();
163
- }
164
- }
165
- }, [
166
- // main app-settings root element
167
- t("div", {
168
- attrs: {
169
- class: "app-settings"
170
- }
171
- }, [
172
- // app-settings name
173
- t("h2", {
174
- attrs: {
175
- class: "app-settings__name"
176
- }
177
- }, this.name),
178
- // app-settings navigation + content
179
- t(
180
- "div",
181
- {
182
- attrs: {
183
- class: "app-settings__wrapper"
184
- }
185
- },
186
- [
187
- ...n(),
188
- t("div", {
189
- attrs: {
190
- class: "app-settings__content"
191
- },
192
- ref: "settingsScroller"
193
- }, this.$slots.default)
194
- ]
195
- )
196
- ])
197
- ]);
132
+ }, 300)
198
133
  }
199
- }, m = null, h = null;
200
- var f = /* @__PURE__ */ u(
134
+ };
135
+ var m = function() {
136
+ var e = this, a = e._self._c;
137
+ return e.open ? a("NcDialog", e._b({ on: { "update:open": e.handleCloseModal }, scopedSlots: e._u([{ key: "navigation", fn: function({ isCollapsed: o }) {
138
+ return [a("ul", { class: { "navigation-list": !0, "navigation-list--collapsed": o }, attrs: { "aria-label": e.settingsNavigationAriaLabel, role: "tablist" } }, e._l(e.getNavigationItems, function(t) {
139
+ return a("li", { key: t.id }, [a("a", { class: {
140
+ "navigation-list__link": !0,
141
+ "navigation-list__link--active": t.id === e.selectedSection
142
+ }, attrs: { "aria-selected": t.id === e.selectedSection, role: "tab", tabindex: "0" }, on: { click: function(i) {
143
+ return e.handleSettingsNavigationClick(t.id);
144
+ }, keydown: function(i) {
145
+ return !i.type.indexOf("key") && e._k(i.keyCode, "enter", 13, i.key, "Enter") ? null : e.handleSettingsNavigationClick(t.id);
146
+ } } }, [e._v(e._s(t.name))])]);
147
+ }), 0)];
148
+ } }], null, !1, 1246349142) }, "NcDialog", e.dialogProperties, !1), [a("div", { ref: "settingsScroller" }, [e._t("default")], 2)]) : e._e();
149
+ }, f = [], h = /* @__PURE__ */ p(
201
150
  g,
202
151
  m,
203
- h,
152
+ f,
204
153
  !1,
205
154
  null,
206
- "0ff961d8",
155
+ "a4d36143",
207
156
  null,
208
157
  null
209
158
  );
210
- const b = f.exports;
159
+ const b = h.exports;
211
160
  export {
212
161
  b as default
213
162
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NcAppSettingsDialog.mjs","sources":["../../src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<docs>\nJust nest the `AppSettingSections` component into `NcAppSettingsDialog`,\nproviding the section's name prop. You can put your settings within each\n`NcAppSettingsSection` component.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"settingsOpen = true\">Show Settings</NcButton>\n\t\t<NcAppSettingsDialog :open.sync=\"settingsOpen\" :show-navigation=\"true\" name=\"Application settings\">\n\t\t\t<NcAppSettingsSection id=\"asci-name-1\" name=\"Example name 1\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-2\" name=\"Example name 2\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-3\" name=\"Example name 3\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-4\" name=\"Example name 4\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-5\" name=\"Example name 5\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-6\" name=\"Example name 6\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-7\" name=\"Example name 7\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-8\" name=\"Example name 8\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-9\" name=\"Example name 9\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-10\" name=\"Example name 10\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t</NcAppSettingsDialog>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsettingsOpen: false,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<script>\nimport NcModal from '../NcModal/index.js'\nimport isMobile from '../../mixins/isMobile/index.js'\nimport { t } from '../../l10n.js'\n\nimport debounce from 'debounce'\n\nexport default {\n\n\tname: 'NcAppSettingsDialog',\n\n\tcomponents: {\n\t\tNcModal,\n\t},\n\n\tmixins: [isMobile],\n\n\tprops: {\n\t\t/**\n\t\t * Determines the open / closed state of the modal\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Shows the navigation on desktop if true\n\t\t */\n\t\tshowNavigation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the popover container\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: String,\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Name of the settings\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Additional elements to add to the focus trap\n\t\t */\n\t\tadditionalTrapElements: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t},\n\n\temits: ['update:open'],\n\n\tdata() {\n\t\treturn {\n\t\t\tselectedSection: '',\n\t\t\tlinkClicked: false,\n\t\t\taddedScrollListener: false,\n\t\t\tscroller: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\n\t\thasNavigation() {\n\t\t\tif (this.isMobile || !this.showNavigation) {\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\treturn true\n\t\t\t}\n\t\t},\n\n\t\tsettingsNavigationAriaLabel() {\n\t\t\treturn t('Settings navigation')\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Select first settings section\n\t\tthis.selectedSection = this.$slots.default[0].componentOptions.propsData.id\n\t},\n\n\tupdated() {\n\t\t// Check that the scroller element has been mounted\n\t\tif (!this.$refs.settingsScroller) {\n\t\t\treturn\n\t\t}\n\t\t// Get the scroller element\n\t\tthis.scroller = this.$refs.settingsScroller\n\t\tif (!this.addedScrollListener) {\n\t\t\tthis.scroller.addEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = true\n\t\t}\n\n\t},\n\n\tmethods: {\n\n\t\t/**\n\t\t * Builds the settings navigation menu\n\t\t *\n\t\t * @param {object} slots The default slots object passed from the render function.\n\t\t * @return {Array} the navigation items\n\t\t */\n\t\tgetSettingsNavigation(slots) {\n\t\t\t// Array of navigationitems strings\n\t\t\tconst navigationItems = slots.filter(vNode => vNode.componentOptions).map(vNode => {\n\t\t\t\treturn {\n\t\t\t\t\tid: vNode.componentOptions.propsData?.id,\n\t\t\t\t\tname: vNode.componentOptions.propsData?.name,\n\t\t\t\t}\n\t\t\t})\n\t\t\tconst navigationNames = slots.map(item => item.name)\n\t\t\tconst navigationIds = slots.map(item => item.id)\n\n\t\t\t// Check for the uniqueness of section names\n\t\t\tnavigationItems.forEach((element, index) => {\n\t\t\t\tconst newNamesArray = [...navigationNames]\n\t\t\t\tconst newIdArray = [...navigationIds]\n\t\t\t\tnewNamesArray.splice(index, 1)\n\t\t\t\tnewIdArray.splice(index, 1)\n\t\t\t\tif (newNamesArray.includes(element.name)) {\n\t\t\t\t\tthrow new Error(`Duplicate section name found: ${element}. Settings navigation sections must have unique section names.`)\n\t\t\t\t}\n\t\t\t\tif (newIdArray.includes(element.id)) {\n\t\t\t\t\tthrow new Error(`Duplicate section id found: ${element}. Settings navigation sections must have unique section ids.`)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn navigationItems\n\t\t},\n\n\t\t/**\n\t\t * Scrolls the content to the selected settings section.absolute\n\t\t *\n\t\t * @param {string} item the ID of the section\n\t\t */\n\t\thandleSettingsNavigationClick(item) {\n\t\t\tthis.linkClicked = true\n\t\t\tdocument.getElementById('settings-section_' + item).scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tinline: 'nearest',\n\t\t\t})\n\t\t\tthis.selectedSection = item\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.linkClicked = false\n\t\t\t}, 1000)\n\t\t},\n\n\t\thandleCloseModal() {\n\t\t\tthis.$emit('update:open', false)\n\t\t\t// Remove scroll listener each time the modal is closed\n\t\t\tthis.scroller.removeEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = false\n\t\t\tthis.scroller.scrollTop = 0\n\t\t},\n\n\t\thandleScroll() {\n\t\t\tif (!this.linkClicked) {\n\t\t\t\tthis.unfocusNavigationItem()\n\t\t\t}\n\t\t},\n\n\t\t// Remove selected section once the user starts scrolling\n\t\tunfocusNavigationItem: debounce(function() {\n\t\t\tthis.selectedSection = ''\n\t\t\tif (document.activeElement.className.includes('navigation-list__link')) {\n\t\t\t\tdocument.activeElement.blur()\n\t\t\t}\n\t\t}, 300),\n\n\t\thandleLinkKeydown(keyDownEvent, item) {\n\t\t\tif (keyDownEvent.code === 'Enter') {\n\t\t\t\tthis.handleSettingsNavigationClick(item)\n\t\t\t}\n\t\t},\n\t},\n\n\trender(h) {\n\t\t/**\n\t\t * Build the navigation\n\t\t *\n\t\t * @return {object} the navigation\n\t\t */\n\t\tconst createAppSettingsNavigation = () => {\n\t\t\tif (this.hasNavigation) {\n\t\t\t\treturn [h('div', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'app-settings__navigation',\n\t\t\t\t\t\trole: 'tablist',\n\t\t\t\t\t\t'aria-label': this.settingsNavigationAriaLabel,\n\t\t\t\t\t},\n\t\t\t\t}, [h('ul', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'navigation-list',\n\t\t\t\t\t\trole: 'tablist',\n\t\t\t\t\t},\n\t\t\t\t}, this.getSettingsNavigation(this.$slots.default).map(item => {\n\t\t\t\t\treturn createListElement(item)\n\t\t\t\t}))])]\n\t\t\t} else {\n\t\t\t\treturn []\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Build each list element in the navigation\n\t\t *\n\t\t * @param {object} item the navigation item\n\t\t * @return {object} the list element\n\t\t */\n\t\tconst createListElement = (item) => h('li', {}, [h('a', {\n\t\t\tclass: {\n\t\t\t\t'navigation-list__link': true,\n\t\t\t\t'navigation-list__link--active': item.id === this.selectedSection,\n\t\t\t},\n\n\t\t\tattrs: {\n\t\t\t\trole: 'tab',\n\t\t\t\t'aria-selected': item.id === this.selectedSection,\n\t\t\t\ttabindex: '0',\n\t\t\t},\n\n\t\t\ton: {\n\t\t\t\tclick: () => this.handleSettingsNavigationClick(item.id),\n\t\t\t\tkeydown: () => this.handleLinkKeydown(event, item.id),\n\t\t\t},\n\t\t}, item.name)])\n\n\t\t// Return value of the render function\n\t\tif (this.open) {\n\t\t\treturn h('NcModal', {\n\t\t\t\tclass: [\n\t\t\t\t\t'app-settings-modal',\n\t\t\t\t],\n\t\t\t\tattrs: {\n\t\t\t\t\tcontainer: this.container,\n\t\t\t\t\tsize: 'large',\n\t\t\t\t\tadditionalTrapElements: this.additionalTrapElements,\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tclose: () => { this.handleCloseModal() },\n\t\t\t\t},\n\t\t\t}, [\n\t\t\t\t// main app-settings root element\n\t\t\t\th('div', {\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\tclass: 'app-settings',\n\t\t\t\t\t},\n\t\t\t\t}, [\n\t\t\t\t\t// app-settings name\n\t\t\t\t\th('h2', {\n\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\tclass: 'app-settings__name',\n\t\t\t\t\t\t},\n\t\t\t\t\t}, this.name),\n\n\t\t\t\t\t// app-settings navigation + content\n\t\t\t\t\th(\n\t\t\t\t\t\t'div',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\t\tclass: 'app-settings__wrapper',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t...createAppSettingsNavigation(),\n\t\t\t\t\t\t\th('div', {\n\t\t\t\t\t\t\t\tattrs: {\n\t\t\t\t\t\t\t\t\tclass: 'app-settings__content',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tref: 'settingsScroller',\n\t\t\t\t\t\t\t}, this.$slots.default),\n\t\t\t\t\t\t],\n\t\t\t\t\t),\n\t\t\t\t]),\n\t\t\t])\n\t\t} else {\n\t\t\treturn undefined\n\t\t}\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n\n.app-settings-modal :deep(.modal-wrapper .modal-container) {\n\tdisplay: flex;\n\toverflow: hidden;\n}\n\n.app-settings {\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-width: 0;\n\t&__name {\n\t\tmin-height: $clickable-area;\n\t\theight: $clickable-area;\n\t\tline-height: $clickable-area;\n\t\tpadding-top: 4px; // Same as the close button top spacing\n\t\ttext-align: center;\n\t}\n\t&__wrapper {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\toverflow: hidden;\n\t\theight: 100%;\n\t\tposition: relative;\n\t}\n\t&__navigation {\n\t\tmin-width: 200px;\n\t\tmargin-right: 20px;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\tposition: relative;\n\t\theight: 100%;\n\t}\n\t&__content {\n\t\tmax-width: 100vw;\n\t\toverflow-y: auto;\n\t\toverflow-x: hidden;\n\t\tpadding: 24px;\n\t\twidth: 100%;\n\t}\n}\n\n.navigation-list {\n\theight: 100%;\n\tbox-sizing: border-box;\n\toverflow-y: auto;\n\tpadding: 12px;\n\t&__link {\n\t\tdisplay: block;\n\t\tfont-size: 16px;\n\t\theight: $clickable-area;\n\t\tmargin: 4px 0;\n\t\tline-height: $clickable-area;\n\t\tborder-radius: var(--border-radius-pill);\n\t\tfont-weight: bold;\n\t\tpadding: 0 20px;\n\t\tcursor: pointer;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t}\n\t\t&--active {\n\t\t\tbackground-color: var(--color-primary-element-light) !important;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","NcModal","isMobile","t","slots","navigationItems","vNode","_a","_b","navigationNames","item","navigationIds","element","index","newNamesArray","newIdArray","debounce","keyDownEvent","h","createAppSettingsNavigation","createListElement"],"mappings":";;;;;;AAoFA,MAAAA,IAAA;AAAA,EAEA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,SAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AA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A,cACA,OAAA;AAAA,gBACA,OAAA;AAAA,cACA;AAAA,YACA;AAAA,YACA;AAAA,cACA,GAAAC,EAAA;AAAA,cACAD,EAAA,OAAA;AAAA,gBACA,OAAA;AAAA,kBACA,OAAA;AAAA,gBACA;AAAA,gBACA,KAAA;AAAA,cACA,GAAA,KAAA,OAAA,OAAA;AAAA,YACA;AAAA,UACA;AAAA,QACA,CAAA;AAAA,MACA,CAAA;AAAA,EAIA;AACA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcAppSettingsDialog.mjs","sources":["../../src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@icloud.com>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<docs>\nJust nest the `AppSettingSections` component into `NcAppSettingsDialog`,\nproviding the section's name prop. You can put your settings within each\n`NcAppSettingsSection` component.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"settingsOpen = true\">Show Settings</NcButton>\n\t\t<NcAppSettingsDialog :open.sync=\"settingsOpen\" :show-navigation=\"true\" name=\"Application settings\">\n\t\t\t<NcAppSettingsSection id=\"asci-name-1\" name=\"Example name 1\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-2\" name=\"Example name 2\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-3\" name=\"Example name 3\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-4\" name=\"Example name 4\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-5\" name=\"Example name 5\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-6\" name=\"Example name 6\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-7\" name=\"Example name 7\">\n\t\t\t\tSome example content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-8\" name=\"Example name 8\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-9\" name=\"Example name 9\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t\t<NcAppSettingsSection id=\"asci-name-10\" name=\"Example name 10\">\n\t\t\t\tSome more content\n\t\t\t</NcAppSettingsSection>\n\t\t</NcAppSettingsDialog>\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tsettingsOpen: false,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcDialog v-if=\"open\"\n\t\tv-bind=\"dialogProperties\"\n\t\t@update:open=\"handleCloseModal\">\n\t\t<template #navigation=\"{ isCollapsed }\">\n\t\t\t<ul :aria-label=\"settingsNavigationAriaLabel\"\n\t\t\t\t:class=\"{ 'navigation-list': true, 'navigation-list--collapsed': isCollapsed }\"\n\t\t\t\trole=\"tablist\">\n\t\t\t\t<li v-for=\"item in getNavigationItems\" :key=\"item.id\">\n\t\t\t\t\t<a :aria-selected=\"item.id === selectedSection\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'navigation-list__link': true,\n\t\t\t\t\t\t\t'navigation-list__link--active': item.id === selectedSection,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t@click=\"handleSettingsNavigationClick(item.id)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSettingsNavigationClick(item.id)\">{{ item.name }}</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</template>\n\t\t<div ref=\"settingsScroller\">\n\t\t\t<slot />\n\t\t</div>\n\t</NcDialog>\n</template>\n\n<script>\nimport NcDialog from '../NcDialog/index.js'\nimport isMobile from '../../mixins/isMobile/index.js'\nimport { t } from '../../l10n.js'\n\nimport debounce from 'debounce'\n\nexport default {\n\n\tname: 'NcAppSettingsDialog',\n\n\tcomponents: {\n\t\tNcDialog,\n\t},\n\n\tmixins: [isMobile],\n\n\tprops: {\n\t\t/**\n\t\t * Determines the open / closed state of the modal\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Shows the navigation on desktop if true\n\t\t */\n\t\tshowNavigation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the popover container\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: String,\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Name of the settings\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Additional elements to add to the focus trap\n\t\t */\n\t\tadditionalTrapElements: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t},\n\n\temits: ['update:open'],\n\n\tdata() {\n\t\treturn {\n\t\t\tselectedSection: '',\n\t\t\tlinkClicked: false,\n\t\t\taddedScrollListener: false,\n\t\t\tscroller: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tdialogProperties() {\n\t\t\treturn {\n\t\t\t\tadditionalTrapElements: this.additionalTrapElements,\n\t\t\t\tclass: 'app-settings',\n\t\t\t\tcontainer: this.container,\n\t\t\t\tcontentClasses: 'app-settings__content',\n\t\t\t\tsize: 'large',\n\t\t\t\tname: this.name,\n\t\t\t\tnavigationClasses: 'app-settings__navigation',\n\t\t\t}\n\t\t},\n\n\t\thasNavigation() {\n\t\t\tif (this.isMobile || !this.showNavigation) {\n\t\t\t\treturn false\n\t\t\t} else {\n\t\t\t\treturn true\n\t\t\t}\n\t\t},\n\n\t\tsettingsNavigationAriaLabel() {\n\t\t\treturn t('Settings navigation')\n\t\t},\n\n\t\tgetNavigationItems() {\n\t\t\treturn this.getSettingsNavigation(this.$slots.default)\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Select first settings section\n\t\tthis.selectedSection = this.$slots.default[0].componentOptions.propsData.id\n\t},\n\n\tupdated() {\n\t\t// Check that the scroller element has been mounted\n\t\tif (!this.$refs.settingsScroller) {\n\t\t\treturn\n\t\t}\n\t\t// Get the scroller element\n\t\tthis.scroller = this.$refs.settingsScroller\n\t\tif (!this.addedScrollListener) {\n\t\t\tthis.scroller.addEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = true\n\t\t}\n\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Builds the settings navigation menu\n\t\t *\n\t\t * @param {object} slots The default slots object passed from the render function.\n\t\t * @return {Array} the navigation items\n\t\t */\n\t\tgetSettingsNavigation(slots) {\n\t\t\t// Array of navigationitems strings\n\t\t\tconst navigationItems = slots.filter(vNode => vNode.componentOptions).map(vNode => {\n\t\t\t\treturn {\n\t\t\t\t\tid: vNode.componentOptions.propsData?.id,\n\t\t\t\t\tname: vNode.componentOptions.propsData?.name,\n\t\t\t\t}\n\t\t\t})\n\t\t\tconst navigationNames = slots.map(item => item.name)\n\t\t\tconst navigationIds = slots.map(item => item.id)\n\n\t\t\t// Check for the uniqueness of section names\n\t\t\tnavigationItems.forEach((element, index) => {\n\t\t\t\tconst newNamesArray = [...navigationNames]\n\t\t\t\tconst newIdArray = [...navigationIds]\n\t\t\t\tnewNamesArray.splice(index, 1)\n\t\t\t\tnewIdArray.splice(index, 1)\n\t\t\t\tif (newNamesArray.includes(element.name)) {\n\t\t\t\t\tthrow new Error(`Duplicate section name found: ${element}. Settings navigation sections must have unique section names.`)\n\t\t\t\t}\n\t\t\t\tif (newIdArray.includes(element.id)) {\n\t\t\t\t\tthrow new Error(`Duplicate section id found: ${element}. Settings navigation sections must have unique section ids.`)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn navigationItems\n\t\t},\n\n\t\t/**\n\t\t * Scrolls the content to the selected settings section.absolute\n\t\t *\n\t\t * @param {string} item the ID of the section\n\t\t */\n\t\thandleSettingsNavigationClick(item) {\n\t\t\tthis.linkClicked = true\n\t\t\tdocument.getElementById('settings-section_' + item).scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tinline: 'nearest',\n\t\t\t})\n\t\t\tthis.selectedSection = item\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.linkClicked = false\n\t\t\t}, 1000)\n\t\t},\n\n\t\thandleCloseModal(isOpen) {\n\t\t\tif (isOpen) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.$emit('update:open', false)\n\t\t\t// Remove scroll listener each time the modal is closed\n\t\t\tthis.scroller.removeEventListener('scroll', this.handleScroll)\n\t\t\tthis.addedScrollListener = false\n\t\t\tthis.scroller.scrollTop = 0\n\t\t},\n\n\t\thandleScroll() {\n\t\t\tif (!this.linkClicked) {\n\t\t\t\tthis.unfocusNavigationItem()\n\t\t\t}\n\t\t},\n\n\t\t// Remove selected section once the user starts scrolling\n\t\tunfocusNavigationItem: debounce(function() {\n\t\t\tthis.selectedSection = ''\n\t\t\tif (document.activeElement.className.includes('navigation-list__link')) {\n\t\t\t\tdocument.activeElement.blur()\n\t\t\t}\n\t\t}, 300),\n\t},\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n.app-settings {\n\t&__navigation {\n\t\tmin-width: 200px;\n\t\tmargin-right: 20px;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\tposition: relative;\n\t\theight: 100%;\n\t}\n\t&__content {\n\t\tmax-width: 100vw;\n\t\toverflow-y: auto;\n\t\toverflow-x: hidden;\n\t\tpadding: 24px;\n\t\twidth: 100%;\n\t}\n}\n\n.navigation-list {\n\theight: 100%;\n\tbox-sizing: border-box;\n\toverflow-y: auto;\n\tpadding: 12px;\n\n\t&--collapsed {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tgap: 6px;\n\t}\n\n\t&__link {\n\t\tdisplay: block;\n\t\tfont-size: 16px;\n\t\theight: $clickable-area;\n\t\tmargin: 4px 0;\n\t\tline-height: $clickable-area;\n\t\tborder-radius: var(--border-radius-pill);\n\t\tfont-weight: bold;\n\t\tpadding: 0 20px;\n\t\tcursor: pointer;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\toverflow: hidden;\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t}\n\t\t&--active {\n\t\t\tbackground-color: var(--color-primary-element-light) !important;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","NcDialog","isMobile","t","slots","navigationItems","vNode","_a","_b","navigationNames","item","navigationIds","element","index","newNamesArray","newIdArray","isOpen","debounce"],"mappings":";;;;;;AAgHA,MAAAA,IAAA;AAAA,EAEA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IAC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A,KACA,SAAA,cAAA,KAAA;AAAA,IAEA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
- var D = require("../assets/index-fbdeb5ab.css");
1
+ var D = require("../assets/index-c5ae3bc4.css");
2
2
  const o = require("./NcVNodes.cjs"), l = require("./NcCheckboxRadioSwitch.cjs"), n = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), u = require("./NcActions.cjs"), c = require("./NcLoadingIcon.cjs"), d = require("./NcButton.cjs"), p = require("./NcEmptyContent.cjs"), f = require("../Directives/Focus.cjs"), b = require("../Directives/Linkify.cjs");
3
3
  require("../Directives/Tooltip.cjs");
4
- const r = require("../chunks/l10n-903083c4.cjs"), m = require("vue-material-design-icons/ArrowRight.vue"), h = require("vue-material-design-icons/Close.vue"), _ = require("vue-material-design-icons/Star.vue"), y = require("vue-material-design-icons/StarOutline.vue"), g = require("@vueuse/components"), k = require("floating-vue"), s = (i) => i && i.__esModule ? i : { default: i }, v = /* @__PURE__ */ s(m), C = /* @__PURE__ */ s(h), T = /* @__PURE__ */ s(_), S = /* @__PURE__ */ s(y);
4
+ const r = require("../chunks/l10n-b1d264c7.cjs"), m = require("vue-material-design-icons/ArrowRight.vue"), h = require("vue-material-design-icons/Close.vue"), _ = require("vue-material-design-icons/Star.vue"), y = require("vue-material-design-icons/StarOutline.vue"), g = require("@vueuse/components"), k = require("floating-vue"), s = (i) => i && i.__esModule ? i : { default: i }, v = /* @__PURE__ */ s(m), C = /* @__PURE__ */ s(h), T = /* @__PURE__ */ s(_), S = /* @__PURE__ */ s(y);
5
5
  const N = {
6
6
  name: "NcAppSidebarTabs",
7
7
  components: {
@@ -97,7 +97,7 @@ const N = {
97
97
  * Focus the current active tab
98
98
  */
99
99
  focusActiveTab() {
100
- this.$el.querySelector(`[data-id="${this.activeTab}"]`).focus();
100
+ this.$el.querySelector(`#tab-button-${this.activeTab}`).focus();
101
101
  },
102
102
  /**
103
103
  * Focus the content on tab
@@ -148,7 +148,7 @@ var x = function() {
148
148
  }, function(t) {
149
149
  return !t.type.indexOf("key") && t.keyCode !== 34 || t.ctrlKey || t.shiftKey || t.altKey || t.metaKey ? null : (t.preventDefault(), t.stopPropagation(), e.focusLastTab.apply(null, arguments));
150
150
  }] } }, e._l(e.tabs, function(t) {
151
- return a("NcCheckboxRadioSwitch", { key: t.id, staticClass: "app-sidebar-tabs__tab", class: { active: t.id === e.activeTab }, attrs: { "aria-controls": `tab-${t.id}`, "aria-selected": e.activeTab === t.id, "button-variant": !0, checked: e.activeTab === t.id, "data-id": t.id, tabindex: e.activeTab === t.id ? 0 : -1, "button-variant-grouped": "horizontal", role: "tab", type: "button" }, on: { "update:checked": function(O) {
151
+ return a("NcCheckboxRadioSwitch", { key: t.id, staticClass: "app-sidebar-tabs__tab", class: { active: t.id === e.activeTab }, attrs: { "aria-controls": `tab-${t.id}`, "aria-selected": String(e.activeTab === t.id), "button-variant": !0, checked: e.activeTab === t.id, "wrapper-id": `tab-button-${t.id}`, tabindex: e.activeTab === t.id ? 0 : -1, "button-variant-grouped": "horizontal", role: "tab", type: "button" }, on: { "update:checked": function(O) {
152
152
  return e.setActive(t.id);
153
153
  } }, scopedSlots: e._u([{ key: "icon", fn: function() {
154
154
  return [a("NcVNodes", { attrs: { vnodes: t.renderIcon() } }, [a("span", { staticClass: "app-sidebar-tabs__tab-icon", class: t.icon })])];
@@ -160,7 +160,7 @@ var x = function() {
160
160
  A,
161
161
  !1,
162
162
  null,
163
- "b4df3f5e",
163
+ "3b9aca31",
164
164
  null,
165
165
  null
166
166
  );