@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
- import "../assets/index-de0326c7.css";
2
- import { S as r } from "../chunks/ScopeComponent-97a014a1.mjs";
3
- import { g as l } from "../chunks/focusTrap-5d0f71d4.mjs";
4
- import { t as o } from "../chunks/l10n-27a75c40.mjs";
1
+ import "../assets/index-5ee8a575.css";
2
+ import { S as l } from "../chunks/ScopeComponent-9519afcc.mjs";
3
+ import { g as r } from "../chunks/focusTrap-5d0f71d4.mjs";
4
+ import { t as o } from "../chunks/l10n-05a09c66.mjs";
5
5
  import { G as u } from "../chunks/GenRandomId-cb9ccebe.mjs";
6
- import { l as c } from "../chunks/l10n-c5f5f001.mjs";
6
+ import { l as c } from "../chunks/l10n-9aa6482d.mjs";
7
7
  import d from "./NcActions.mjs";
8
8
  import h from "./NcButton.mjs";
9
9
  import "../Directives/Tooltip.mjs";
@@ -37,21 +37,21 @@ import { VTooltip as C } from "floating-vue";
37
37
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
38
38
  *
39
39
  */
40
- function T(t, e) {
41
- let s, a, n = e, i;
40
+ function T(s, e) {
41
+ let t, a, n = e, i;
42
42
  this.start = function() {
43
- i = !0, a = /* @__PURE__ */ new Date(), s = setTimeout(t, n);
43
+ i = !0, a = /* @__PURE__ */ new Date(), t = setTimeout(s, n);
44
44
  }, this.pause = function() {
45
- i = !1, clearTimeout(s), n -= /* @__PURE__ */ new Date() - a;
45
+ i = !1, clearTimeout(t), n -= /* @__PURE__ */ new Date() - a;
46
46
  }, this.clear = function() {
47
- i = !1, clearTimeout(s), n = 0;
47
+ i = !1, clearTimeout(t), n = 0;
48
48
  }, this.getTimeLeft = function() {
49
49
  return i && (this.pause(), this.start()), n;
50
50
  }, this.getStateRunning = function() {
51
51
  return i;
52
52
  }, this.start();
53
53
  }
54
- const b = {
54
+ const S = {
55
55
  name: "NcModal",
56
56
  components: {
57
57
  NcActions: d,
@@ -136,7 +136,7 @@ const b = {
136
136
  size: {
137
137
  type: String,
138
138
  default: "normal",
139
- validator: (t) => ["small", "normal", "large", "full"].includes(t)
139
+ validator: (s) => ["small", "normal", "large", "full"].includes(s)
140
140
  },
141
141
  /**
142
142
  * Declare if the modal can be closed
@@ -243,13 +243,13 @@ const b = {
243
243
  *
244
244
  * @param {boolean} paused is the player paused
245
245
  */
246
- slideshowPaused(t) {
247
- this.slideshowTimeout && (t ? this.slideshowTimeout.pause() : this.slideshowTimeout.start());
246
+ slideshowPaused(s) {
247
+ this.slideshowTimeout && (s ? this.slideshowTimeout.pause() : this.slideshowTimeout.start());
248
248
  },
249
- additionalTrapElements(t) {
249
+ additionalTrapElements(s) {
250
250
  if (this.focusTrap) {
251
251
  const e = this.$refs.mask;
252
- this.focusTrap.updateContainerElements([e, ...t]);
252
+ this.focusTrap.updateContainerElements([e, ...s]);
253
253
  }
254
254
  }
255
255
  },
@@ -269,15 +269,15 @@ const b = {
269
269
  },
270
270
  methods: {
271
271
  // Events emitters
272
- previous(t) {
273
- this.hasPrevious && (t && this.resetSlideshow(), this.$emit("previous", t));
272
+ previous(s) {
273
+ this.hasPrevious && (s && this.resetSlideshow(), this.$emit("previous", s));
274
274
  },
275
- next(t) {
276
- this.hasNext && (t && this.resetSlideshow(), this.$emit("next", t));
275
+ next(s) {
276
+ this.hasNext && (s && this.resetSlideshow(), this.$emit("next", s));
277
277
  },
278
- close(t) {
278
+ close(s) {
279
279
  this.canClose && (this.internalShow = !1, this.$emit("update:show", !1), setTimeout(() => {
280
- this.$emit("close", t);
280
+ this.$emit("close", s);
281
281
  }, 300));
282
282
  },
283
283
  /**
@@ -286,21 +286,23 @@ const b = {
286
286
  *
287
287
  * @param {MouseEvent} event The click event
288
288
  */
289
- handleClickModalWrapper(t) {
290
- this.closeOnClickOutside && this.close(t);
289
+ handleClickModalWrapper(s) {
290
+ this.closeOnClickOutside && this.close(s);
291
291
  },
292
292
  /**
293
293
  * @param {KeyboardEvent} event - keyboard event
294
294
  */
295
- handleKeydown(t) {
296
- if (t.key === "Escape")
297
- return this.close(t);
295
+ handleKeydown(s) {
296
+ if (s.key === "Escape") {
297
+ const t = r();
298
+ return t.length > 0 && t[t.length - 1] !== this.focusTrap ? void 0 : this.close(s);
299
+ }
298
300
  const e = {
299
301
  ArrowLeft: this.previous,
300
302
  ArrowRight: this.next
301
303
  };
302
- if (e[t.key])
303
- return document.activeElement && !this.$el.contains(document.activeElement) ? void 0 : e[t.key](t);
304
+ if (e[s.key])
305
+ return document.activeElement && !this.$el.contains(document.activeElement) ? void 0 : e[s.key](s);
304
306
  },
305
307
  /**
306
308
  * handle the swipe event
@@ -308,8 +310,8 @@ const b = {
308
310
  * @param {TouchEvent} e The touch event
309
311
  * @param {import('@vueuse/core').SwipeDirection} direction Swipe direction
310
312
  */
311
- handleSwipe(t, e) {
312
- this.enableSwipe && (e === "left" ? this.next(t) : e === "right" && this.previous(t));
313
+ handleSwipe(s, e) {
314
+ this.enableSwipe && (e === "left" ? this.next(s) : e === "right" && this.previous(s));
313
315
  },
314
316
  /**
315
317
  * Toggle the slideshow state
@@ -345,51 +347,47 @@ const b = {
345
347
  async useFocusTrap() {
346
348
  if (!this.showModal || this.focusTrap)
347
349
  return;
348
- const t = this.$refs.mask;
350
+ const s = this.$refs.mask;
349
351
  await this.$nextTick();
350
352
  const e = {
351
353
  allowOutsideClick: !0,
352
- fallbackFocus: t,
353
- trapStack: l(),
354
+ fallbackFocus: s,
355
+ trapStack: r(),
354
356
  // Esc can be used without stop in content or additionalTrapElements where it should not deacxtivate modal's focus trap.
355
357
  // Focus trap is deactivated on modal close anyway.
356
358
  escapeDeactivates: !1
357
359
  };
358
- this.focusTrap = v([t, ...this.additionalTrapElements], e), this.focusTrap.activate();
360
+ this.focusTrap = v([s, ...this.additionalTrapElements], e), this.focusTrap.activate();
359
361
  },
360
362
  clearFocusTrap() {
361
- var t;
362
- this.focusTrap && ((t = this.focusTrap) == null || t.deactivate(), this.focusTrap = null);
363
+ var s;
364
+ this.focusTrap && ((s = this.focusTrap) == null || s.deactivate(), this.focusTrap = null);
363
365
  }
364
366
  }
365
367
  };
366
- var S = function() {
367
- var e = this, s = e._self._c;
368
- return s("transition", { attrs: { name: "fade", appear: "" }, on: { "after-enter": e.useFocusTrap, "before-leave": e.clearFocusTrap } }, [s("div", { directives: [{ name: "show", rawName: "v-show", value: e.showModal, expression: "showModal" }], ref: "mask", staticClass: "modal-mask", class: { "modal-mask--dark": e.dark }, style: e.cssVariables, attrs: { role: "dialog", "aria-modal": "true", "aria-labelledby": "modal-name-" + e.randId, "aria-describedby": "modal-description-" + e.randId, tabindex: "-1" } }, [s("transition", { attrs: { name: "fade-visibility", appear: "" } }, [s("div", { staticClass: "modal-header" }, [e.name.trim() !== "" ? s("h2", { staticClass: "modal-name", attrs: { id: "modal-name-" + e.randId } }, [e._v(" " + e._s(e.name) + " ")]) : e._e(), s("div", { staticClass: "icons-menu" }, [e.hasNext && e.enableSlideshow ? s("button", { directives: [{ name: "tooltip", rawName: "v-tooltip.auto", value: e.playPauseName, expression: "playPauseName", modifiers: { auto: !0 } }], staticClass: "play-pause-icons", class: { "play-pause-icons--paused": e.slideshowPaused }, attrs: { type: "button" }, on: { click: e.togglePlayPause } }, [e.playing ? s("Pause", { staticClass: "play-pause-icons__pause", attrs: { size: e.iconSize } }) : s("Play", { staticClass: "play-pause-icons__play", attrs: { size: e.iconSize } }), s("span", { staticClass: "hidden-visually" }, [e._v(" " + e._s(e.playPauseName) + " ")]), e.playing ? s("svg", { staticClass: "progress-ring", attrs: { height: "50", width: "50" } }, [s("circle", { staticClass: "progress-ring__circle", attrs: { stroke: "white", "stroke-width": "2", fill: "transparent", r: "15", cx: "25", cy: "25" } })]) : e._e()], 1) : e._e(), s("NcActions", { staticClass: "header-actions", attrs: { inline: e.inlineActions } }, [e._t("actions")], 2), e.canClose && !e.closeButtonContained ? s("NcButton", { staticClass: "header-close", attrs: { "aria-label": e.closeButtonAriaLabel, type: "tertiary" }, on: { click: e.close }, scopedSlots: e._u([{ key: "icon", fn: function() {
369
- return [s("Close", { attrs: { size: e.iconSize } })];
370
- }, proxy: !0 }], null, !1, 1841713362) }) : e._e()], 1)])]), s("transition", { attrs: { name: e.modalTransitionName, appear: "" } }, [s("div", { directives: [{ name: "show", rawName: "v-show", value: e.showModal, expression: "showModal" }], staticClass: "modal-wrapper", class: [
368
+ var b = function() {
369
+ var e = this, t = e._self._c;
370
+ return t("transition", { attrs: { name: "fade", appear: "" }, on: { "after-enter": e.useFocusTrap, "before-leave": e.clearFocusTrap } }, [t("div", { directives: [{ name: "show", rawName: "v-show", value: e.showModal, expression: "showModal" }], ref: "mask", staticClass: "modal-mask", class: { "modal-mask--dark": e.dark }, style: e.cssVariables, attrs: { role: "dialog", "aria-modal": "true", "aria-labelledby": "modal-name-" + e.randId, "aria-describedby": "modal-description-" + e.randId, tabindex: "-1" } }, [t("transition", { attrs: { name: "fade-visibility", appear: "" } }, [t("div", { staticClass: "modal-header" }, [e.name.trim() !== "" ? t("h2", { staticClass: "modal-name", attrs: { id: "modal-name-" + e.randId } }, [e._v(" " + e._s(e.name) + " ")]) : e._e(), t("div", { staticClass: "icons-menu" }, [e.hasNext && e.enableSlideshow ? t("button", { directives: [{ name: "tooltip", rawName: "v-tooltip.auto", value: e.playPauseName, expression: "playPauseName", modifiers: { auto: !0 } }], staticClass: "play-pause-icons", class: { "play-pause-icons--paused": e.slideshowPaused }, attrs: { type: "button" }, on: { click: e.togglePlayPause } }, [e.playing ? t("Pause", { staticClass: "play-pause-icons__pause", attrs: { size: e.iconSize } }) : t("Play", { staticClass: "play-pause-icons__play", attrs: { size: e.iconSize } }), t("span", { staticClass: "hidden-visually" }, [e._v(" " + e._s(e.playPauseName) + " ")]), e.playing ? t("svg", { staticClass: "progress-ring", attrs: { height: "50", width: "50" } }, [t("circle", { staticClass: "progress-ring__circle", attrs: { stroke: "white", "stroke-width": "2", fill: "transparent", r: "15", cx: "25", cy: "25" } })]) : e._e()], 1) : e._e(), t("NcActions", { staticClass: "header-actions", attrs: { inline: e.inlineActions } }, [e._t("actions")], 2), e.canClose && !e.closeButtonContained ? t("NcButton", { staticClass: "header-close", attrs: { "aria-label": e.closeButtonAriaLabel, type: "tertiary" }, on: { click: e.close }, scopedSlots: e._u([{ key: "icon", fn: function() {
371
+ return [t("Close", { attrs: { size: e.iconSize } })];
372
+ }, proxy: !0 }], null, !1, 1841713362) }) : e._e()], 1)])]), t("transition", { attrs: { name: e.modalTransitionName, appear: "" } }, [t("div", { directives: [{ name: "show", rawName: "v-show", value: e.showModal, expression: "showModal" }], staticClass: "modal-wrapper", class: [
371
373
  `modal-wrapper--${e.size}`,
372
- e.spreadNavigation ? "modal-wrapper--spread-navigation" : ""
374
+ { "modal-wrapper--spread-navigation": e.spreadNavigation }
373
375
  ], on: { mousedown: function(a) {
374
376
  return a.target !== a.currentTarget ? null : e.handleClickModalWrapper.apply(null, arguments);
375
- } } }, [s("transition", { attrs: { name: "fade-visibility", appear: "" } }, [s("NcButton", { directives: [{ name: "show", rawName: "v-show", value: e.hasPrevious, expression: "hasPrevious" }], staticClass: "prev", class: {
376
- invisible: !e.hasPrevious
377
- }, attrs: { type: "tertiary-no-background", "aria-label": e.prevButtonAriaLabel }, on: { click: e.previous }, scopedSlots: e._u([{ key: "icon", fn: function() {
378
- return [s("ChevronLeft", { attrs: { size: 40 } })];
379
- }, proxy: !0 }]) })], 1), s("div", { staticClass: "modal-container", attrs: { id: "modal-description-" + e.randId } }, [e.canClose && e.closeButtonContained ? s("NcButton", { staticClass: "modal-container__close", attrs: { type: "tertiary", "aria-label": e.closeButtonAriaLabel }, on: { click: e.close }, scopedSlots: e._u([{ key: "icon", fn: function() {
380
- return [s("Close", { attrs: { size: 20 } })];
381
- }, proxy: !0 }], null, !1, 2121748766) }) : e._e(), s("div", { staticClass: "modal-container__content" }, [e._t("default")], 2)], 1), s("transition", { attrs: { name: "fade-visibility", appear: "" } }, [s("NcButton", { directives: [{ name: "show", rawName: "v-show", value: e.hasNext, expression: "hasNext" }], staticClass: "next", class: {
382
- invisible: !e.hasNext
383
- }, attrs: { type: "tertiary-no-background", "aria-label": e.nextButtonAriaLabel }, on: { click: e.next }, scopedSlots: e._u([{ key: "icon", fn: function() {
384
- return [s("ChevronRight", { attrs: { size: 40 } })];
377
+ } } }, [t("transition", { attrs: { name: "fade-visibility", appear: "" } }, [t("NcButton", { directives: [{ name: "show", rawName: "v-show", value: e.hasPrevious, expression: "hasPrevious" }], staticClass: "prev", attrs: { type: "tertiary-no-background", "aria-label": e.prevButtonAriaLabel }, on: { click: e.previous }, scopedSlots: e._u([{ key: "icon", fn: function() {
378
+ return [t("ChevronLeft", { attrs: { size: 40 } })];
379
+ }, proxy: !0 }]) })], 1), t("div", { staticClass: "modal-container", attrs: { id: "modal-description-" + e.randId } }, [e.canClose && e.closeButtonContained ? t("NcButton", { staticClass: "modal-container__close", attrs: { type: "tertiary", "aria-label": e.closeButtonAriaLabel }, on: { click: e.close }, scopedSlots: e._u([{ key: "icon", fn: function() {
380
+ return [t("Close", { attrs: { size: 20 } })];
381
+ }, proxy: !0 }], null, !1, 2121748766) }) : e._e(), t("div", { staticClass: "modal-container__content" }, [e._t("default")], 2)], 1), t("transition", { attrs: { name: "fade-visibility", appear: "" } }, [t("NcButton", { directives: [{ name: "show", rawName: "v-show", value: e.hasNext, expression: "hasNext" }], staticClass: "next", attrs: { type: "tertiary-no-background", "aria-label": e.nextButtonAriaLabel }, on: { click: e.next }, scopedSlots: e._u([{ key: "icon", fn: function() {
382
+ return [t("ChevronRight", { attrs: { size: 40 } })];
385
383
  }, proxy: !0 }]) })], 1)], 1)])], 1)]);
386
384
  }, k = [], x = /* @__PURE__ */ _(
387
- b,
388
385
  S,
386
+ b,
389
387
  k,
390
388
  !1,
391
389
  null,
392
- "27c27b41",
390
+ "45e668d9",
393
391
  null,
394
392
  null
395
393
  );
@@ -415,7 +413,7 @@ const N = x.exports;
415
413
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
416
414
  *
417
415
  */
418
- r(N);
416
+ l(N);
419
417
  export {
420
418
  N as default
421
419
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NcModal.mjs","sources":["../../src/utils/Timer.js","../../src/components/NcModal/NcModal.vue","../../src/components/NcModal/index.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\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\n/**\n * @param {Function} callback The function to call\n * @param {number} delay The time to wait\n */\nexport default function timer(callback, delay) {\n\tlet id\n\tlet started\n\tlet remaining = delay\n\tlet running\n\n\tthis.start = function() {\n\t\trunning = true\n\t\tstarted = new Date()\n\t\tid = setTimeout(callback, remaining)\n\t}\n\n\tthis.pause = function() {\n\t\trunning = false\n\t\tclearTimeout(id)\n\t\tremaining -= new Date() - started\n\t}\n\n\tthis.clear = function() {\n\t\trunning = false\n\t\tclearTimeout(id)\n\t\tremaining = 0\n\t}\n\n\tthis.getTimeLeft = function() {\n\t\tif (running) {\n\t\t\tthis.pause()\n\t\t\tthis.start()\n\t\t}\n\n\t\treturn remaining\n\t}\n\n\tthis.getStateRunning = function() {\n\t\treturn running\n\t}\n\n\tthis.start()\n}\n","<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.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\n<docs>\nFor showing the modal you can use either `:show.sync=\"showModal\"` or `v-if` on the `NcModal`,\ndepending on whether you require the Modal to stay within the DOM or not. Do not mix both, as this will break the out transition animation.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showModal\">Show Modal</NcButton>\n\t\t<NcModal\n\t\t\t:show.sync=\"modal\"\n\t\t\t@close=\"closeModal\"\n\t\t\tsize=\"small\"\n\t\t\tname=\"Name\"\n\t\t\t:outTransition=\"true\"\n\t\t\t:hasNext=\"true\"\n\t\t\t:hasPrevious=\"true\">\n\t\t\t<div class=\"modal__content\">Hello world</div>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tmodal: false\n\t\t}\n\t},\n\tmethods: {\n\t\tshowModal() {\n\t\t\tthis.modal = true\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.modal = false\n\t\t}\n\t}\n}\n</script>\n<style scoped>\n.modal__content {\n\tmargin: 50px;\n\ttext-align: center;\n}\n</style>\n```\n\n### Modal with more properties\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showModal\">Show Modal with fields</NcButton>\n\t\t<NcModal\n\t\t\tv-if=\"modal\"\n\t\t\tref=\"modalRef\"\n\t\t\t@close=\"closeModal\"\n\t\t\tname=\"Name inside modal\">\n\t\t\t<div class=\"modal__content\">\n\t\t\t\t<h2>Please enter your name</h2>\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<NcTextField label=\"First Name\" :value.sync=\"firstName\" />\n\t\t\t\t</div>\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<NcTextField label=\"Last Name\" :value.sync=\"lastName\" />\n\t\t\t\t</div>\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<label for=\"pizza\">What is the most important pizza item?</label>\n\t\t\t\t\t<NcSelect input-id=\"pizza\" :options=\"['Cheese', 'Tomatos', 'Pineapples']\" v-model=\"pizza\" />\n\t\t\t\t</div>\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<label for=\"emoji-trigger\">Select your favorite emoji</label>\n\t\t\t\t\t<NcEmojiPicker v-if=\"modalRef\" :container=\"modalRef.$el\">\n\t\t\t\t\t\t<NcButton id=\"emoji-trigger\">Select</NcButton>\n\t\t\t\t\t</NcEmojiPicker>\n\t\t\t\t</div>\n\n\t\t\t\t<NcButton\n\t\t\t\t\t:disabled=\"!firstName || !lastName || !pizza\"\n\t\t\t\t\t@click=\"closeModal\"\n\t\t\t\t\ttype=\"primary\">\n\t\t\t\t\tSubmit\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nimport { ref } from 'vue'\n\nexport default {\n\tsetup() {\n\t\treturn {\n\t\t\tmodalRef: ref(null),\n\t\t}\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tmodal: false,\n\t\t\tfirstName: '',\n\t\t\tlastName: '',\n\t\t\tpizza: [],\n\t\t}\n\t},\n\tmethods: {\n\t\tshowModal() {\n\t\t\tthis.firstName = ''\n\t\t\tthis.lastName = ''\n\t\t\tthis.modal = true\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.modal = false\n\t\t}\n\t}\n}\n</script>\n<style scoped>\n.modal__content {\n\tmargin: 50px;\n}\n\n.modal__content h2 {\n\ttext-align: center;\n}\n\n.form-group {\n\tmargin: calc(var(--default-grid-baseline) * 4) 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n}\n</style>\n```\n\n### Usage of popover in modal\n\n* Set container property to .modal-mask to inject popover context of the modal:\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showModal\">Show Modal</NcButton>\n\t\t<NcModal v-if=\"modal\" @close=\"closeModal\" size=\"small\" class=\"emoji-modal\">\n\t\t\t<NcEmojiPicker container=\".emoji-modal\" @select=\"select\">\n\t\t\t\t<NcButton>Select emoji {{ emoji }}</NcButton>\n\t\t\t</NcEmojiPicker>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\temoji: '😛',\n\t\t\tmodal: false\n\t\t}\n\t},\n\tmethods: {\n\t\tshowModal() {\n\t\t\tthis.modal = true\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.modal = false\n\t\t},\n\t\tselect(emoji) {\n\t\t\tthis.emoji = emoji\n\t\t},\n\t},\n}\n</script>\n<style scoped>\n.modal__content {\n\tmargin: 50px;\n\ttext-align: center;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<transition name=\"fade\"\n\t\tappear\n\t\t@after-enter=\"useFocusTrap\"\n\t\t@before-leave=\"clearFocusTrap\">\n\t\t<div v-show=\"showModal\"\n\t\t\tref=\"mask\"\n\t\t\tclass=\"modal-mask\"\n\t\t\t:class=\"{ 'modal-mask--dark': dark }\"\n\t\t\t:style=\"cssVariables\"\n\t\t\trole=\"dialog\"\n\t\t\taria-modal=\"true\"\n\t\t\t:aria-labelledby=\"'modal-name-' + randId\"\n\t\t\t:aria-describedby=\"'modal-description-' + randId\"\n\t\t\ttabindex=\"-1\">\n\t\t\t<!-- Header -->\n\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t<div class=\"modal-header\">\n\t\t\t\t\t<h2 v-if=\"name.trim() !== ''\"\n\t\t\t\t\t\t:id=\"'modal-name-' + randId\"\n\t\t\t\t\t\tclass=\"modal-name\">\n\t\t\t\t\t\t{{ name }}\n\t\t\t\t\t</h2>\n\t\t\t\t\t<div class=\"icons-menu\">\n\t\t\t\t\t\t<!-- Play-pause toggle -->\n\t\t\t\t\t\t<button v-if=\"hasNext && enableSlideshow\"\n\t\t\t\t\t\t\tv-tooltip.auto=\"playPauseName\"\n\t\t\t\t\t\t\t:class=\"{ 'play-pause-icons--paused': slideshowPaused }\"\n\t\t\t\t\t\t\tclass=\"play-pause-icons\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t@click=\"togglePlayPause\">\n\t\t\t\t\t\t\t<!-- Play/pause icons -->\n\t\t\t\t\t\t\t<Play v-if=\"!playing\"\n\t\t\t\t\t\t\t\t:size=\"iconSize\"\n\t\t\t\t\t\t\t\tclass=\"play-pause-icons__play\" />\n\t\t\t\t\t\t\t<Pause v-else\n\t\t\t\t\t\t\t\t:size=\"iconSize\"\n\t\t\t\t\t\t\t\tclass=\"play-pause-icons__pause\" />\n\t\t\t\t\t\t\t<span class=\"hidden-visually\">\n\t\t\t\t\t\t\t\t{{ playPauseName }}\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<!-- Progress circle, css animated -->\n\t\t\t\t\t\t\t<svg v-if=\"playing\"\n\t\t\t\t\t\t\t\tclass=\"progress-ring\"\n\t\t\t\t\t\t\t\theight=\"50\"\n\t\t\t\t\t\t\t\twidth=\"50\">\n\t\t\t\t\t\t\t\t<circle class=\"progress-ring__circle\"\n\t\t\t\t\t\t\t\t\tstroke=\"white\"\n\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t\tfill=\"transparent\"\n\t\t\t\t\t\t\t\t\tr=\"15\"\n\t\t\t\t\t\t\t\t\tcx=\"25\"\n\t\t\t\t\t\t\t\t\tcy=\"25\" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t<!-- Actions menu -->\n\t\t\t\t\t\t<NcActions class=\"header-actions\" :inline=\"inlineActions\">\n\t\t\t\t\t\t\t<!-- @slot List of actions to show -->\n\t\t\t\t\t\t\t<slot name=\"actions\" />\n\t\t\t\t\t\t</NcActions>\n\n\t\t\t\t\t\t<!-- Close modal -->\n\t\t\t\t\t\t<NcButton v-if=\"canClose && !closeButtonContained\"\n\t\t\t\t\t\t\t:aria-label=\"closeButtonAriaLabel\"\n\t\t\t\t\t\t\tclass=\"header-close\"\n\t\t\t\t\t\t\ttype=\"tertiary\"\n\t\t\t\t\t\t\t@click=\"close\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Close :size=\"iconSize\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</transition>\n\n\t\t\t<!-- Content wrapper -->\n\t\t\t<transition :name=\"modalTransitionName\" appear>\n\t\t\t\t<div v-show=\"showModal\"\n\t\t\t\t\t:class=\"[\n\t\t\t\t\t\t`modal-wrapper--${size}`,\n\t\t\t\t\t\tspreadNavigation ? 'modal-wrapper--spread-navigation' : ''\n\t\t\t\t\t]\"\n\t\t\t\t\tclass=\"modal-wrapper\"\n\t\t\t\t\t@mousedown.self=\"handleClickModalWrapper\">\n\t\t\t\t\t<!-- Navigation button -->\n\t\t\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t\t\t<NcButton v-show=\"hasPrevious\"\n\t\t\t\t\t\t\ttype=\"tertiary-no-background\"\n\t\t\t\t\t\t\tclass=\"prev\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\tinvisible: !hasPrevious\n\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t:aria-label=\"prevButtonAriaLabel\"\n\t\t\t\t\t\t\t@click=\"previous\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<ChevronLeft :size=\"40\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</transition>\n\n\t\t\t\t\t<!-- Content -->\n\t\t\t\t\t<div :id=\"'modal-description-' + randId\" class=\"modal-container\">\n\t\t\t\t\t\t<!-- Close modal -->\n\t\t\t\t\t\t<NcButton v-if=\"canClose && closeButtonContained\"\n\t\t\t\t\t\t\ttype=\"tertiary\"\n\t\t\t\t\t\t\tclass=\"modal-container__close\"\n\t\t\t\t\t\t\t:aria-label=\"closeButtonAriaLabel\"\n\t\t\t\t\t\t\t@click=\"close\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Close :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t<div class=\"modal-container__content\">\n\t\t\t\t\t\t\t<!-- @slot Modal content to render -->\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Navigation button -->\n\t\t\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t\t\t<NcButton v-show=\"hasNext\"\n\t\t\t\t\t\t\ttype=\"tertiary-no-background\"\n\t\t\t\t\t\t\tclass=\"next\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\tinvisible: !hasNext\n\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t:aria-label=\"nextButtonAriaLabel\"\n\t\t\t\t\t\t\t@click=\"next\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<ChevronRight :size=\"40\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</transition>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\t</transition>\n</template>\n\n<script>\nimport { getTrapStack } from '../../utils/focusTrap.js'\nimport { t } from '../../l10n.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\nimport l10n from '../../mixins/l10n.js'\nimport NcActions from '../NcActions/index.js'\nimport NcButton from '../../components/NcButton/index.js'\nimport Timer from '../../utils/Timer.js'\nimport Tooltip from '../../directives/Tooltip/index.js'\n\nimport ChevronLeft from 'vue-material-design-icons/ChevronLeft.vue'\nimport ChevronRight from 'vue-material-design-icons/ChevronRight.vue'\nimport Close from 'vue-material-design-icons/Close.vue'\nimport Pause from 'vue-material-design-icons/Pause.vue'\nimport Play from 'vue-material-design-icons/Play.vue'\n\nimport { createFocusTrap } from 'focus-trap'\nimport { useSwipe } from '@vueuse/core'\n\nexport default {\n\tname: 'NcModal',\n\n\tcomponents: {\n\t\tNcActions,\n\t\tChevronLeft,\n\t\tChevronRight,\n\t\tClose,\n\t\tPause,\n\t\tPlay,\n\t\tNcButton,\n\t},\n\n\tdirectives: {\n\t\ttooltip: Tooltip,\n\t},\n\n\tmixins: [l10n],\n\n\tprops: {\n\t\t/**\n\t\t * Name to be shown with the modal\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * Declare if a previous slide is available\n\t\t */\n\t\thasPrevious: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Declare if a next slide is available\n\t\t */\n\t\thasNext: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Declare if hiding the modal should be animated\n\t\t */\n\t\toutTransition: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Declare if the slideshow functionality should be enabled\n\t\t */\n\t\tenableSlideshow: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Declare the slide interval\n\t\t */\n\t\tslideshowDelay: {\n\t\t\ttype: Number,\n\t\t\tdefault: 5000,\n\t\t},\n\t\t/**\n\t\t * Allow to pause an ongoing slideshow\n\t\t */\n\t\tslideshowPaused: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Enable swipe between slides\n\t\t */\n\t\tenableSwipe: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\tspreadNavigation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Defines the modal size.\n\t\t * Default is 'normal'.\n\t\t * Available are 'small', 'normal', 'large' and 'full'.\n\t\t * All sizes except 'small' change automatically to full-screen on mobile.\n\t\t */\n\t\tsize: {\n\t\t\ttype: String,\n\t\t\tdefault: 'normal',\n\t\t\tvalidator: size => {\n\t\t\t\treturn ['small', 'normal', 'large', 'full'].includes(size)\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Declare if the modal can be closed\n\t\t */\n\t\tcanClose: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Close the modal if the user clicked outside of the modal\n\t\t * Only relevant if `canClose` is set to true.\n\t\t */\n\t\tcloseOnClickOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Makes the modal backdrop black if true */\n\t\tdark: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the modal container, pass `null` to prevent automatic container mounting\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: [String, null],\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Pass in false if you want the modal 'close' button to be displayed\n\t\t * outside the modal boundaries, in the top right corner of the window\n\t\t */\n\t\tcloseButtonContained: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\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\t/**\n\t\t * Display x items inline\n\t\t *\n\t\t * @see Actions component usage\n\t\t */\n\t\tinlineActions: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\tshow: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\temits: [\n\t\t'previous',\n\t\t'next',\n\t\t'close',\n\t\t'update:show',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tmc: null,\n\t\t\tplaying: false,\n\t\t\tslideshowTimeout: null,\n\t\t\ticonSize: 24,\n\t\t\tfocusTrap: null,\n\t\t\trandId: GenRandomId(),\n\t\t\tinternalShow: true,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tshowModal() {\n\t\t\treturn (this.show === undefined) ? this.internalShow : this.show\n\t\t},\n\t\tmodalTransitionName() {\n\t\t\treturn `modal-${this.outTransition ? 'out' : 'in'}`\n\t\t},\n\t\tplayPauseName() {\n\t\t\treturn this.playing ? t('Pause slideshow') : t('Start slideshow')\n\t\t},\n\t\tcssVariables() {\n\t\t\treturn {\n\t\t\t\t'--slideshow-duration': this.slideshowDelay + 'ms',\n\t\t\t\t'--icon-size': this.iconSize + 'px',\n\t\t\t}\n\t\t},\n\n\t\tcloseButtonAriaLabel() {\n\t\t\treturn t('Close modal')\n\t\t},\n\t\tprevButtonAriaLabel() {\n\t\t\treturn t('Previous')\n\t\t},\n\t\tnextButtonAriaLabel() {\n\t\t\treturn t('Next')\n\t\t},\n\t},\n\n\twatch: {\n\t\t/**\n\t\t * Handle play/pause of an ongoing slideshow\n\t\t *\n\t\t * @param {boolean} paused is the player paused\n\t\t */\n\t\tslideshowPaused(paused) {\n\t\t\tif (this.slideshowTimeout) {\n\t\t\t\tif (paused) {\n\t\t\t\t\tthis.slideshowTimeout.pause()\n\t\t\t\t} else {\n\t\t\t\t\tthis.slideshowTimeout.start()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tadditionalTrapElements(elements) {\n\t\t\tif (this.focusTrap) {\n\t\t\t\tconst contentContainer = this.$refs.mask\n\t\t\t\tthis.focusTrap.updateContainerElements([contentContainer, ...elements])\n\t\t\t}\n\t\t},\n\t},\n\n\tbeforeMount() {\n\t\twindow.addEventListener('keydown', this.handleKeydown)\n\t},\n\tbeforeDestroy() {\n\t\twindow.removeEventListener('keydown', this.handleKeydown)\n\t\tthis.mc.stop()\n\t},\n\tmounted() {\n\t\t// init clear view\n\t\tthis.useFocusTrap()\n\t\tthis.mc = useSwipe(this.$refs.mask, {\n\t\t\tonSwipeEnd: this.handleSwipe,\n\t\t})\n\n\t\tif (this.container) {\n\t\t\tif (this.container === 'body') {\n\t\t\t\t// force mount the component to body\n\t\t\t\tdocument.body.insertBefore(this.$el, document.body.lastChild)\n\t\t\t} else {\n\t\t\t\tconst container = document.querySelector(this.container)\n\t\t\t\tcontainer.appendChild(this.$el)\n\t\t\t}\n\t\t}\n\t},\n\tdestroyed() {\n\t\tthis.clearFocusTrap()\n\t\tthis.$el.remove()\n\t},\n\n\tmethods: {\n\t\t// Events emitters\n\t\tprevious(event) {\n\t\t\t// do not send the event if nothing is available\n\t\t\tif (this.hasPrevious) {\n\t\t\t\t// if data is set, then it's a user mouse event\n\t\t\t\t// and not the slideshow handler, therefore\n\t\t\t\t// we reset the timer\n\t\t\t\tif (event) {\n\t\t\t\t\tthis.resetSlideshow()\n\t\t\t\t}\n\t\t\t\tthis.$emit('previous', event)\n\t\t\t}\n\t\t},\n\t\tnext(event) {\n\t\t\t// do not send the event if nothing is available\n\t\t\tif (this.hasNext) {\n\t\t\t\t// if data is set, then it's a mouse event\n\t\t\t\t// and not the slideshow handler, therefore\n\t\t\t\t// we reset the timer\n\t\t\t\tif (event) {\n\t\t\t\t\tthis.resetSlideshow()\n\t\t\t\t}\n\t\t\t\tthis.$emit('next', event)\n\t\t\t}\n\t\t},\n\t\tclose(data) {\n\t\t\t// do not fire event if forbidden\n\t\t\tif (this.canClose) {\n\t\t\t\t// We set internalShow here, so the out transitions properly run before the component is destroyed\n\t\t\t\tthis.internalShow = false\n\t\t\t\tthis.$emit('update:show', false)\n\n\t\t\t\t// delay closing for animation\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t/**\n\t\t\t\t\t * Emitted when the closing animation is finished\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('close', data)\n\t\t\t\t}, 300)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle click on modal wrapper\n\t\t * If `closeOnClickOutside` is set the modal will be closed\n\t\t *\n\t\t * @param {MouseEvent} event The click event\n\t\t */\n\t\thandleClickModalWrapper(event) {\n\t\t\tif (this.closeOnClickOutside) {\n\t\t\t\tthis.close(event)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @param {KeyboardEvent} event - keyboard event\n\t\t */\n\t\thandleKeydown(event) {\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\treturn this.close(event)\n\t\t\t}\n\n\t\t\tconst arrowHandlers = {\n\t\t\t\tArrowLeft: this.previous,\n\t\t\t\tArrowRight: this.next,\n\t\t\t}\n\t\t\tif (arrowHandlers[event.key]) {\n\t\t\t\t// Ignore arrow navigation, if there is a current focus outside the modal.\n\t\t\t\t// For example, when the focus is in Sidebar or NcActions's items,\n\t\t\t\t// arrow navigation should not be intercept by modal slider\n\t\t\t\tif (document.activeElement && !this.$el.contains(document.activeElement)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\treturn arrowHandlers[event.key](event)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * handle the swipe event\n\t\t *\n\t\t * @param {TouchEvent} e The touch event\n\t\t * @param {import('@vueuse/core').SwipeDirection} direction Swipe direction\n\t\t */\n\t\thandleSwipe(e, direction) {\n\t\t\tif (this.enableSwipe) {\n\t\t\t\tif (direction === 'left') {\n\t\t\t\t\t// swiping to left to go to the next item\n\t\t\t\t\tthis.next(e)\n\t\t\t\t} else if (direction === 'right') {\n\t\t\t\t\t// swiping to right to go back to the previous item\n\t\t\t\t\tthis.previous(e)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Toggle the slideshow state\n\t\t */\n\t\ttogglePlayPause() {\n\t\t\tthis.playing = !this.playing\n\t\t\tif (this.playing) {\n\t\t\t\tthis.handleSlideshow()\n\t\t\t} else {\n\t\t\t\tthis.clearSlideshowTimeout()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Reset the slideshow timer and keep going if it was on\n\t\t */\n\t\tresetSlideshow() {\n\t\t\tthis.playing = !this.playing\n\t\t\tthis.clearSlideshowTimeout()\n\t\t\tthis.$nextTick(function() {\n\t\t\t\tthis.togglePlayPause()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Handle the slideshow timer and next event\n\t\t */\n\t\thandleSlideshow() {\n\t\t\tthis.playing = true\n\t\t\tif (this.hasNext) {\n\t\t\t\tthis.slideshowTimeout = new Timer(() => {\n\t\t\t\t\tthis.next()\n\t\t\t\t\tthis.handleSlideshow()\n\t\t\t\t}, this.slideshowDelay)\n\t\t\t} else {\n\t\t\t\tthis.playing = false\n\t\t\t\tthis.clearSlideshowTimeout()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Clear slideshowTimeout if ongoing\n\t\t */\n\t\tclearSlideshowTimeout() {\n\t\t\tif (this.slideshowTimeout) {\n\t\t\t\tthis.slideshowTimeout.clear()\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Add focus trap for accessibility.\n\t\t */\n\t\tasync useFocusTrap() {\n\t\t\t// Don't do anything if the modal is hidden,\n\t\t\t// or we have a focus trap already\n\t\t\tif (!this.showModal || this.focusTrap) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst contentContainer = this.$refs.mask\n\t\t\t// wait until all children are mounted and available in the DOM before focusTrap can be added\n\t\t\tawait this.$nextTick()\n\n\t\t\tconst options = {\n\t\t\t\tallowOutsideClick: true,\n\t\t\t\tfallbackFocus: contentContainer,\n\t\t\t\ttrapStack: getTrapStack(),\n\t\t\t\t// Esc can be used without stop in content or additionalTrapElements where it should not deacxtivate modal's focus trap.\n\t\t\t\t// Focus trap is deactivated on modal close anyway.\n\t\t\t\tescapeDeactivates: false,\n\t\t\t}\n\n\t\t\t// Init focus trap\n\t\t\tthis.focusTrap = createFocusTrap([contentContainer, ...this.additionalTrapElements], options)\n\t\t\tthis.focusTrap.activate()\n\t\t},\n\t\tclearFocusTrap() {\n\t\t\tif (!this.focusTrap) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.focusTrap?.deactivate()\n\t\t\tthis.focusTrap = null\n\t\t},\n\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\n.modal-mask {\n\tposition: fixed;\n\tz-index: 9998;\n\ttop: 0;\n\tleft: 0;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(0, 0, 0, .5);\n\t&--dark {\n\t\tbackground-color: rgba(0, 0, 0, .92);\n\t}\n}\n\n.modal-header {\n\tposition: absolute;\n\tz-index: 10001;\n\ttop: 0;\n\tright: 0;\n\tleft: 0;\n\t// prevent vue show to use display:none and reseting\n\t// the circle animation loop\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 100%;\n\theight: $header-height;\n\toverflow: hidden;\n\ttransition: opacity 250ms,\n\t\tvisibility 250ms;\n\n\t// replace display by visibility\n\t&.invisible[style*='display:none'],\n\t&.invisible[style*='display: none'] {\n\t\tvisibility: hidden;\n\t}\n\n\t.modal-name {\n\t\toverflow-x: hidden;\n\t\tbox-sizing: border-box;\n\t\twidth: 100%;\n\t\tpadding: 0 #{$clickable-area * 3} 0 12px; // maximum actions is 3\n\t\ttransition: padding ease 100ms;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\tcolor: #fff;\n\t\tfont-size: $icon-margin;\n\t\tmargin-bottom: 0;\n\t}\n\n\t// On wider screens the name can be centered\n\t@media only screen and (min-width: $breakpoint-mobile) {\n\t\t.modal-name {\n\t\t\tpadding-left: #{$clickable-area * 3}; // maximum actions is 3\n\t\t\ttext-align: center;\n\t\t}\n\t}\n\n\t.icons-menu {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\n\t\t.header-close {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbox-sizing: border-box;\n\t\t\tmargin: math.div($header-height - $clickable-area, 2);\n\t\t\tpadding: 0;\n\t\t}\n\n\t\t.play-pause-icons {\n\t\t\tposition: relative;\n\t\t\twidth: $header-height;\n\t\t\theight: $header-height;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tcursor: pointer;\n\t\t\tborder: none;\n\t\t\tbackground-color: transparent;\n\t\t\t&:hover,\n\t\t\t&:focus {\n\t\t\t\t.play-pause-icons__play,\n\t\t\t\t.play-pause-icons__pause {\n\t\t\t\t\topacity: $opacity_full;\n\t\t\t\t\tborder-radius: math.div($clickable-area, 2);\n\t\t\t\t\tbackground-color: $icon-focus-bg;\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__play,\n\t\t\t&__pause {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: $clickable-area;\n\t\t\t\theight: $clickable-area;\n\t\t\t\tmargin: math.div($header-height - $clickable-area, 2);\n\t\t\t\tcursor: pointer;\n\t\t\t\topacity: $opacity_normal;\n\t\t\t}\n\t\t}\n\n\t\t.header-actions {\n\t\t\tcolor: white;\n\t\t}\n\n\t\t&:deep() .action-item {\n\t\t\tmargin: math.div($header-height - $clickable-area, 2);\n\n\t\t\t&--single {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: $clickable-area;\n\t\t\t\theight: $clickable-area;\n\t\t\t\tcursor: pointer;\n\t\t\t\tbackground-position: center;\n\t\t\t\tbackground-size: 22px;\n\t\t\t}\n\t\t}\n\n\t\t:deep(button) {\n\t\t\t// force white instead of default main text\n\t\t\tcolor: #fff;\n\t\t}\n\n\t\t// Force the Actions menu icon to be the same size as other icons\n\t\t&:deep(.action-item__menutoggle) {\n\t\t\tpadding: 0;\n\t\t\tspan, svg {\n\t\t\t\twidth: var(--icon-size);\n\t\t\t\theight: var(--icon-size);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.modal-wrapper {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\theight: 100%;\n\n\t/* Navigation buttons */\n\t.prev,\n\t.next {\n\t\tz-index: 10000;\n\t\t// ignore display: none\n\t\tdisplay: flex !important;\n\t\theight: 35vh;\n\t\tmin-height: 300px;\n\t\tposition: absolute;\n\t\ttransition: opacity 250ms,\n\t\t\tvisibility 250ms;\n\t\t// hover the mask\n\t\tcolor: white;\n\n\t\t&:focus-visible {\n\t\t\t// Override NcButton focus styles\n\t\t\tbox-shadow: 0 0 0 2px var(--color-primary-element-text);\n\t\t\tbackground-color: var(--color-box-shadow);\n\t\t}\n\n\t\t// we want to keep the elements on page\n\t\t// even if hidden to avoid having a unbalanced\n\t\t// centered content\n\t\t// replace display by visibility\n\t\t&.invisible[style*='display:none'],\n\t\t&.invisible[style*='display: none'] {\n\t\t\tvisibility: hidden;\n\t\t}\n\t}\n\t.prev {\n\t\tleft: 2px;\n\t}\n\t.next {\n\t\tright: 2px;\n\t}\n\n\t/* Content */\n\t.modal-container {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tpadding: 0;\n\t\ttransition: transform 300ms ease;\n\t\tborder-radius: var(--border-radius-large);\n\t\tbackground-color: var(--color-main-background);\n\t\tcolor: var(--color-main-text);\n\t\tbox-shadow: 0 0 40px rgba(0, 0, 0, .2);\n\n\t\t&__close {\n\t\t\tposition: absolute;\n\t\t\ttop: 4px;\n\t\t\tright: 4px;\n\t\t}\n\n\t\t&__content {\n\t\t\twidth: 100%;\n\t\t\toverflow: auto; // avoids unecessary hacks if the content should be bigger than the modal\n\t\t}\n\t}\n\n\t// Sizing\n\t&--small {\n\t\t.modal-container {\n\t\t\twidth: 400px;\n\t\t\tmax-width: 90%;\n\t\t\tmax-height: 90%;\n\t\t}\n\t}\n\t&--normal {\n\t\t.modal-container {\n\t\t\tmax-width: 90%;\n\t\t\twidth: 600px;\n\t\t\tmax-height: 90%;\n\t\t}\n\t}\n\t&--large {\n\t\t.modal-container {\n\t\t\tmax-width: 90%;\n\t\t\twidth: 900px;\n\t\t\tmax-height: 90%;\n\t\t}\n\t}\n\t&--full {\n\t\t.modal-container {\n\t\t\twidth: 100%;\n\t\t\theight: calc(100% - var(--header-height));\n\t\t\tposition: absolute;\n\t\t\ttop: $header-height;\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n\n\t// Make modal full screen on mobile\n\t@media only screen and (max-width: math.div($breakpoint-mobile, 2)) {\n\t\t.modal-container {\n\t\t\tmax-width: initial;\n\t\t\twidth: 100%;\n\t\t\tmax-height: initial;\n\t\t\theight: calc(100% - var(--header-height));\n\t\t\tposition: absolute;\n\t\t\ttop: $header-height;\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n}\n\n/* TRANSITIONS */\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity 250ms;\n}\n\n.fade-enter,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.fade-visibility-enter,\n.fade-visibility-leave-to {\n\tvisibility: hidden;\n\topacity: 0;\n}\n\n.modal-in-enter-active,\n.modal-in-leave-active,\n.modal-out-enter-active,\n.modal-out-leave-active {\n\ttransition: opacity 250ms;\n}\n\n.modal-in-enter,\n.modal-in-leave-to,\n.modal-out-enter,\n.modal-out-leave-to {\n\topacity: 0;\n}\n\n.modal-in-enter .modal-container,\n.modal-in-leave-to .modal-container {\n\ttransform: scale(.9);\n}\n\n.modal-out-enter .modal-container,\n.modal-out-leave-to .modal-container {\n\ttransform: scale(1.1);\n}\n\n// animated circle\n$radius: 15;\n$pi: 3.14159265358979;\n\n.modal-mask .play-pause-icons {\n\t.progress-ring {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\ttransform: rotate(-90deg);\n\t\t.progress-ring__circle {\n\t\t\ttransition: 100ms stroke-dashoffset;\n\t\t\ttransform-origin: 50% 50%; // axis compensation\n\t\t\tanimation: progressring linear var(--slideshow-duration) infinite;\n\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-dashoffset: $radius * 2 * $pi; // radius * 2 * PI\n\t\t\tstroke-dasharray: $radius * 2 * $pi; // radius * 2 * PI\n\t\t}\n\t}\n\t&--paused {\n\t\t.icon-pause {\n\t\t\tanimation: breath 2s cubic-bezier(.4, 0, .2, 1) infinite;\n\t\t}\n\t\t.progress-ring__circle {\n\t\t\tanimation-play-state: paused !important;\n\t\t}\n\t}\n}\n\n// keyframes get scoped too and break the animation name, we need them unscoped\n@keyframes progressring {\n\tfrom {\n\t\tstroke-dashoffset: $radius * 2 * $pi; // radius * 2 * PI\n\t}\n\tto {\n\t\tstroke-dashoffset: 0;\n\t}\n}\n\n@keyframes breath {\n\t0% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n\n</style>\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\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 */\nimport ScopeComponent from '../../utils/ScopeComponent.js'\nimport NcModal from './NcModal.vue'\n\nScopeComponent(NcModal)\n\nexport default NcModal\n"],"names":["timer","callback","delay","id","started","remaining","running","_sfc_main","NcActions","ChevronLeft","ChevronRight","Close","Pause","Play","NcButton","VTooltip","l10n","size","GenRandomId","t","paused","elements","contentContainer","useSwipe","event","data","arrowHandlers","e","direction","options","getTrapStack","createFocusTrap","_a","ScopeComponent","NcModal"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0Be,SAAAA,EAAAC,GAAAC,GAAA;AACf,MAAAC,GACAC,GACAC,IAAAH,GACAI;AAEA,OAAA,QAAA,WAAA;AACA,IAAAA,IAAA,IACAF,IAAA,oBAAA,KAAA,GACAD,IAAA,WAAAF,GAAAI,CAAA;AAAA,EACA,GAEA,KAAA,QAAA,WAAA;AACA,IAAAC,IAAA,IACA,aAAAH,CAAA,GACAE,KAAA,oBAAA,KAAA,IAAAD;AAAA,EACA,GAEA,KAAA,QAAA,WAAA;AACA,IAAAE,IAAA,IACA,aAAAH,CAAA,GACAE,IAAA;AAAA,EACA,GAEA,KAAA,cAAA,WAAA;AACA,WAAAC,MACA,KAAA,MAAA,GACA,KAAA,MAAA,IAGAD;AAA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A3B,EAAA,MAAA;AACA,aAAA,KAAA,GACA,KAAA,gBAAA;AAAA,MACA,GAAA,KAAA,cAAA,KAEA,KAAA,UAAA,IACA,KAAA,sBAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAA;AACA,MAAA,KAAA,oBACA,KAAA,iBAAA,MAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA,eAAA;AAGA,UAAA,CAAA,KAAA,aAAA,KAAA;AACA;AAGA,YAAAsB,IAAA,KAAA,MAAA;AAEA,YAAA,KAAA,UAAA;AAEA,YAAAO,IAAA;AAAA,QACA,mBAAA;AAAA,QACA,eAAAP;AAAA,QACA,WAAAQ,EAAA;AAAA;AAAA;AAAA,QAGA,mBAAA;AAAA,MACA;AAGA,WAAA,YAAAC,EAAA,CAAAT,GAAA,GAAA,KAAA,sBAAA,GAAAO,CAAA,GACA,KAAA,UAAA,SAAA;AAAA,IACA;AAAA,IACA,iBAAA;;AACA,MAAA,KAAA,eAGAG,IAAA,KAAA,cAAA,QAAAA,EAAA,cACA,KAAA,YAAA;AAAA,IACA;AAAA,EAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3xBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBAC,EAAAC,CAAA;"}
1
+ {"version":3,"file":"NcModal.mjs","sources":["../../src/utils/Timer.js","../../src/components/NcModal/NcModal.vue","../../src/components/NcModal/index.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\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\n/**\n * @param {Function} callback The function to call\n * @param {number} delay The time to wait\n */\nexport default function timer(callback, delay) {\n\tlet id\n\tlet started\n\tlet remaining = delay\n\tlet running\n\n\tthis.start = function() {\n\t\trunning = true\n\t\tstarted = new Date()\n\t\tid = setTimeout(callback, remaining)\n\t}\n\n\tthis.pause = function() {\n\t\trunning = false\n\t\tclearTimeout(id)\n\t\tremaining -= new Date() - started\n\t}\n\n\tthis.clear = function() {\n\t\trunning = false\n\t\tclearTimeout(id)\n\t\tremaining = 0\n\t}\n\n\tthis.getTimeLeft = function() {\n\t\tif (running) {\n\t\t\tthis.pause()\n\t\t\tthis.start()\n\t\t}\n\n\t\treturn remaining\n\t}\n\n\tthis.getStateRunning = function() {\n\t\treturn running\n\t}\n\n\tthis.start()\n}\n","<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.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\n<docs>\nFor showing the modal you can use either `:show.sync=\"showModal\"` or `v-if` on the `NcModal`,\ndepending on whether you require the Modal to stay within the DOM or not. Do not mix both, as this will break the out transition animation.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showModal\">Show Modal</NcButton>\n\t\t<NcModal\n\t\t\t:show.sync=\"modal\"\n\t\t\t@close=\"closeModal\"\n\t\t\tsize=\"small\"\n\t\t\tname=\"Name\"\n\t\t\t:outTransition=\"true\"\n\t\t\t:hasNext=\"true\"\n\t\t\t:hasPrevious=\"true\">\n\t\t\t<div class=\"modal__content\">Hello world</div>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tmodal: false\n\t\t}\n\t},\n\tmethods: {\n\t\tshowModal() {\n\t\t\tthis.modal = true\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.modal = false\n\t\t}\n\t}\n}\n</script>\n<style scoped>\n.modal__content {\n\tmargin: 50px;\n\ttext-align: center;\n}\n</style>\n```\n\n### Modal with more properties\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showModal\">Show Modal with fields</NcButton>\n\t\t<NcModal\n\t\t\tv-if=\"modal\"\n\t\t\tref=\"modalRef\"\n\t\t\t@close=\"closeModal\"\n\t\t\tname=\"Name inside modal\">\n\t\t\t<div class=\"modal__content\">\n\t\t\t\t<h2>Please enter your name</h2>\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<NcTextField label=\"First Name\" :value.sync=\"firstName\" />\n\t\t\t\t</div>\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<NcTextField label=\"Last Name\" :value.sync=\"lastName\" />\n\t\t\t\t</div>\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<label for=\"pizza\">What is the most important pizza item?</label>\n\t\t\t\t\t<NcSelect input-id=\"pizza\" :options=\"['Cheese', 'Tomatos', 'Pineapples']\" v-model=\"pizza\" />\n\t\t\t\t</div>\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<label for=\"emoji-trigger\">Select your favorite emoji</label>\n\t\t\t\t\t<NcEmojiPicker v-if=\"modalRef\" :container=\"modalRef.$el\">\n\t\t\t\t\t\t<NcButton id=\"emoji-trigger\">Select</NcButton>\n\t\t\t\t\t</NcEmojiPicker>\n\t\t\t\t</div>\n\n\t\t\t\t<NcButton\n\t\t\t\t\t:disabled=\"!firstName || !lastName || !pizza\"\n\t\t\t\t\t@click=\"closeModal\"\n\t\t\t\t\ttype=\"primary\">\n\t\t\t\t\tSubmit\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nimport { ref } from 'vue'\n\nexport default {\n\tsetup() {\n\t\treturn {\n\t\t\tmodalRef: ref(null),\n\t\t}\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tmodal: false,\n\t\t\tfirstName: '',\n\t\t\tlastName: '',\n\t\t\tpizza: [],\n\t\t}\n\t},\n\tmethods: {\n\t\tshowModal() {\n\t\t\tthis.firstName = ''\n\t\t\tthis.lastName = ''\n\t\t\tthis.modal = true\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.modal = false\n\t\t}\n\t}\n}\n</script>\n<style scoped>\n.modal__content {\n\tmargin: 50px;\n}\n\n.modal__content h2 {\n\ttext-align: center;\n}\n\n.form-group {\n\tmargin: calc(var(--default-grid-baseline) * 4) 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n}\n</style>\n```\n\n### Usage of popover in modal\n\n* Set container property to .modal-mask to inject popover context of the modal:\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showModal\">Show Modal</NcButton>\n\t\t<NcModal v-if=\"modal\" @close=\"closeModal\" size=\"small\" class=\"emoji-modal\">\n\t\t\t<NcEmojiPicker container=\".emoji-modal\" @select=\"select\">\n\t\t\t\t<NcButton>Select emoji {{ emoji }}</NcButton>\n\t\t\t</NcEmojiPicker>\n\t\t</NcModal>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\temoji: '😛',\n\t\t\tmodal: false\n\t\t}\n\t},\n\tmethods: {\n\t\tshowModal() {\n\t\t\tthis.modal = true\n\t\t},\n\t\tcloseModal() {\n\t\t\tthis.modal = false\n\t\t},\n\t\tselect(emoji) {\n\t\t\tthis.emoji = emoji\n\t\t},\n\t},\n}\n</script>\n<style scoped>\n.modal__content {\n\tmargin: 50px;\n\ttext-align: center;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<transition name=\"fade\"\n\t\tappear\n\t\t@after-enter=\"useFocusTrap\"\n\t\t@before-leave=\"clearFocusTrap\">\n\t\t<div v-show=\"showModal\"\n\t\t\tref=\"mask\"\n\t\t\tclass=\"modal-mask\"\n\t\t\t:class=\"{ 'modal-mask--dark': dark }\"\n\t\t\t:style=\"cssVariables\"\n\t\t\trole=\"dialog\"\n\t\t\taria-modal=\"true\"\n\t\t\t:aria-labelledby=\"'modal-name-' + randId\"\n\t\t\t:aria-describedby=\"'modal-description-' + randId\"\n\t\t\ttabindex=\"-1\">\n\t\t\t<!-- Header -->\n\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t<div class=\"modal-header\">\n\t\t\t\t\t<h2 v-if=\"name.trim() !== ''\"\n\t\t\t\t\t\t:id=\"'modal-name-' + randId\"\n\t\t\t\t\t\tclass=\"modal-name\">\n\t\t\t\t\t\t{{ name }}\n\t\t\t\t\t</h2>\n\t\t\t\t\t<div class=\"icons-menu\">\n\t\t\t\t\t\t<!-- Play-pause toggle -->\n\t\t\t\t\t\t<button v-if=\"hasNext && enableSlideshow\"\n\t\t\t\t\t\t\tv-tooltip.auto=\"playPauseName\"\n\t\t\t\t\t\t\t:class=\"{ 'play-pause-icons--paused': slideshowPaused }\"\n\t\t\t\t\t\t\tclass=\"play-pause-icons\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t@click=\"togglePlayPause\">\n\t\t\t\t\t\t\t<!-- Play/pause icons -->\n\t\t\t\t\t\t\t<Play v-if=\"!playing\"\n\t\t\t\t\t\t\t\t:size=\"iconSize\"\n\t\t\t\t\t\t\t\tclass=\"play-pause-icons__play\" />\n\t\t\t\t\t\t\t<Pause v-else\n\t\t\t\t\t\t\t\t:size=\"iconSize\"\n\t\t\t\t\t\t\t\tclass=\"play-pause-icons__pause\" />\n\t\t\t\t\t\t\t<span class=\"hidden-visually\">\n\t\t\t\t\t\t\t\t{{ playPauseName }}\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<!-- Progress circle, css animated -->\n\t\t\t\t\t\t\t<svg v-if=\"playing\"\n\t\t\t\t\t\t\t\tclass=\"progress-ring\"\n\t\t\t\t\t\t\t\theight=\"50\"\n\t\t\t\t\t\t\t\twidth=\"50\">\n\t\t\t\t\t\t\t\t<circle class=\"progress-ring__circle\"\n\t\t\t\t\t\t\t\t\tstroke=\"white\"\n\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t\tfill=\"transparent\"\n\t\t\t\t\t\t\t\t\tr=\"15\"\n\t\t\t\t\t\t\t\t\tcx=\"25\"\n\t\t\t\t\t\t\t\t\tcy=\"25\" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t<!-- Actions menu -->\n\t\t\t\t\t\t<NcActions class=\"header-actions\" :inline=\"inlineActions\">\n\t\t\t\t\t\t\t<!-- @slot List of actions to show -->\n\t\t\t\t\t\t\t<slot name=\"actions\" />\n\t\t\t\t\t\t</NcActions>\n\n\t\t\t\t\t\t<!-- Close modal -->\n\t\t\t\t\t\t<NcButton v-if=\"canClose && !closeButtonContained\"\n\t\t\t\t\t\t\t:aria-label=\"closeButtonAriaLabel\"\n\t\t\t\t\t\t\tclass=\"header-close\"\n\t\t\t\t\t\t\ttype=\"tertiary\"\n\t\t\t\t\t\t\t@click=\"close\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Close :size=\"iconSize\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</transition>\n\n\t\t\t<!-- Content wrapper -->\n\t\t\t<transition :name=\"modalTransitionName\" appear>\n\t\t\t\t<div v-show=\"showModal\"\n\t\t\t\t\t:class=\"[\n\t\t\t\t\t\t`modal-wrapper--${size}`,\n\t\t\t\t\t\t{ 'modal-wrapper--spread-navigation': spreadNavigation },\n\t\t\t\t\t]\"\n\t\t\t\t\tclass=\"modal-wrapper\"\n\t\t\t\t\t@mousedown.self=\"handleClickModalWrapper\">\n\t\t\t\t\t<!-- Navigation button -->\n\t\t\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t\t\t<NcButton v-show=\"hasPrevious\"\n\t\t\t\t\t\t\ttype=\"tertiary-no-background\"\n\t\t\t\t\t\t\tclass=\"prev\"\n\t\t\t\t\t\t\t:aria-label=\"prevButtonAriaLabel\"\n\t\t\t\t\t\t\t@click=\"previous\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<ChevronLeft :size=\"40\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</transition>\n\n\t\t\t\t\t<!-- Content -->\n\t\t\t\t\t<div :id=\"'modal-description-' + randId\" class=\"modal-container\">\n\t\t\t\t\t\t<!-- Close modal -->\n\t\t\t\t\t\t<NcButton v-if=\"canClose && closeButtonContained\"\n\t\t\t\t\t\t\ttype=\"tertiary\"\n\t\t\t\t\t\t\tclass=\"modal-container__close\"\n\t\t\t\t\t\t\t:aria-label=\"closeButtonAriaLabel\"\n\t\t\t\t\t\t\t@click=\"close\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Close :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t<div class=\"modal-container__content\">\n\t\t\t\t\t\t\t<!-- @slot Modal content to render -->\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Navigation button -->\n\t\t\t\t\t<transition name=\"fade-visibility\" appear>\n\t\t\t\t\t\t<NcButton v-show=\"hasNext\"\n\t\t\t\t\t\t\ttype=\"tertiary-no-background\"\n\t\t\t\t\t\t\tclass=\"next\"\n\t\t\t\t\t\t\t:aria-label=\"nextButtonAriaLabel\"\n\t\t\t\t\t\t\t@click=\"next\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<ChevronRight :size=\"40\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</transition>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\t</transition>\n</template>\n\n<script>\nimport { getTrapStack } from '../../utils/focusTrap.js'\nimport { t } from '../../l10n.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\nimport l10n from '../../mixins/l10n.js'\nimport NcActions from '../NcActions/index.js'\nimport NcButton from '../../components/NcButton/index.js'\nimport Timer from '../../utils/Timer.js'\nimport Tooltip from '../../directives/Tooltip/index.js'\n\nimport ChevronLeft from 'vue-material-design-icons/ChevronLeft.vue'\nimport ChevronRight from 'vue-material-design-icons/ChevronRight.vue'\nimport Close from 'vue-material-design-icons/Close.vue'\nimport Pause from 'vue-material-design-icons/Pause.vue'\nimport Play from 'vue-material-design-icons/Play.vue'\n\nimport { createFocusTrap } from 'focus-trap'\nimport { useSwipe } from '@vueuse/core'\n\nexport default {\n\tname: 'NcModal',\n\n\tcomponents: {\n\t\tNcActions,\n\t\tChevronLeft,\n\t\tChevronRight,\n\t\tClose,\n\t\tPause,\n\t\tPlay,\n\t\tNcButton,\n\t},\n\n\tdirectives: {\n\t\ttooltip: Tooltip,\n\t},\n\n\tmixins: [l10n],\n\n\tprops: {\n\t\t/**\n\t\t * Name to be shown with the modal\n\t\t */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * Declare if a previous slide is available\n\t\t */\n\t\thasPrevious: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Declare if a next slide is available\n\t\t */\n\t\thasNext: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Declare if hiding the modal should be animated\n\t\t */\n\t\toutTransition: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Declare if the slideshow functionality should be enabled\n\t\t */\n\t\tenableSlideshow: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Declare the slide interval\n\t\t */\n\t\tslideshowDelay: {\n\t\t\ttype: Number,\n\t\t\tdefault: 5000,\n\t\t},\n\t\t/**\n\t\t * Allow to pause an ongoing slideshow\n\t\t */\n\t\tslideshowPaused: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Enable swipe between slides\n\t\t */\n\t\tenableSwipe: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\tspreadNavigation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Defines the modal size.\n\t\t * Default is 'normal'.\n\t\t * Available are 'small', 'normal', 'large' and 'full'.\n\t\t * All sizes except 'small' change automatically to full-screen on mobile.\n\t\t */\n\t\tsize: {\n\t\t\ttype: String,\n\t\t\tdefault: 'normal',\n\t\t\tvalidator: size => {\n\t\t\t\treturn ['small', 'normal', 'large', 'full'].includes(size)\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Declare if the modal can be closed\n\t\t */\n\t\tcanClose: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Close the modal if the user clicked outside of the modal\n\t\t * Only relevant if `canClose` is set to true.\n\t\t */\n\t\tcloseOnClickOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Makes the modal backdrop black if true */\n\t\tdark: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Selector for the modal container, pass `null` to prevent automatic container mounting\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: [String, null],\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Pass in false if you want the modal 'close' button to be displayed\n\t\t * outside the modal boundaries, in the top right corner of the window\n\t\t */\n\t\tcloseButtonContained: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\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\t/**\n\t\t * Display x items inline\n\t\t *\n\t\t * @see Actions component usage\n\t\t */\n\t\tinlineActions: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\tshow: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\temits: [\n\t\t'previous',\n\t\t'next',\n\t\t'close',\n\t\t'update:show',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tmc: null,\n\t\t\tplaying: false,\n\t\t\tslideshowTimeout: null,\n\t\t\ticonSize: 24,\n\t\t\tfocusTrap: null,\n\t\t\trandId: GenRandomId(),\n\t\t\tinternalShow: true,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tshowModal() {\n\t\t\treturn (this.show === undefined) ? this.internalShow : this.show\n\t\t},\n\t\tmodalTransitionName() {\n\t\t\treturn `modal-${this.outTransition ? 'out' : 'in'}`\n\t\t},\n\t\tplayPauseName() {\n\t\t\treturn this.playing ? t('Pause slideshow') : t('Start slideshow')\n\t\t},\n\t\tcssVariables() {\n\t\t\treturn {\n\t\t\t\t'--slideshow-duration': this.slideshowDelay + 'ms',\n\t\t\t\t'--icon-size': this.iconSize + 'px',\n\t\t\t}\n\t\t},\n\n\t\tcloseButtonAriaLabel() {\n\t\t\treturn t('Close modal')\n\t\t},\n\t\tprevButtonAriaLabel() {\n\t\t\treturn t('Previous')\n\t\t},\n\t\tnextButtonAriaLabel() {\n\t\t\treturn t('Next')\n\t\t},\n\t},\n\n\twatch: {\n\t\t/**\n\t\t * Handle play/pause of an ongoing slideshow\n\t\t *\n\t\t * @param {boolean} paused is the player paused\n\t\t */\n\t\tslideshowPaused(paused) {\n\t\t\tif (this.slideshowTimeout) {\n\t\t\t\tif (paused) {\n\t\t\t\t\tthis.slideshowTimeout.pause()\n\t\t\t\t} else {\n\t\t\t\t\tthis.slideshowTimeout.start()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tadditionalTrapElements(elements) {\n\t\t\tif (this.focusTrap) {\n\t\t\t\tconst contentContainer = this.$refs.mask\n\t\t\t\tthis.focusTrap.updateContainerElements([contentContainer, ...elements])\n\t\t\t}\n\t\t},\n\t},\n\n\tbeforeMount() {\n\t\twindow.addEventListener('keydown', this.handleKeydown)\n\t},\n\tbeforeDestroy() {\n\t\twindow.removeEventListener('keydown', this.handleKeydown)\n\t\tthis.mc.stop()\n\t},\n\tmounted() {\n\t\t// init clear view\n\t\tthis.useFocusTrap()\n\t\tthis.mc = useSwipe(this.$refs.mask, {\n\t\t\tonSwipeEnd: this.handleSwipe,\n\t\t})\n\n\t\tif (this.container) {\n\t\t\tif (this.container === 'body') {\n\t\t\t\t// force mount the component to body\n\t\t\t\tdocument.body.insertBefore(this.$el, document.body.lastChild)\n\t\t\t} else {\n\t\t\t\tconst container = document.querySelector(this.container)\n\t\t\t\tcontainer.appendChild(this.$el)\n\t\t\t}\n\t\t}\n\t},\n\tdestroyed() {\n\t\tthis.clearFocusTrap()\n\t\tthis.$el.remove()\n\t},\n\n\tmethods: {\n\t\t// Events emitters\n\t\tprevious(event) {\n\t\t\t// do not send the event if nothing is available\n\t\t\tif (this.hasPrevious) {\n\t\t\t\t// if data is set, then it's a user mouse event\n\t\t\t\t// and not the slideshow handler, therefore\n\t\t\t\t// we reset the timer\n\t\t\t\tif (event) {\n\t\t\t\t\tthis.resetSlideshow()\n\t\t\t\t}\n\t\t\t\tthis.$emit('previous', event)\n\t\t\t}\n\t\t},\n\t\tnext(event) {\n\t\t\t// do not send the event if nothing is available\n\t\t\tif (this.hasNext) {\n\t\t\t\t// if data is set, then it's a mouse event\n\t\t\t\t// and not the slideshow handler, therefore\n\t\t\t\t// we reset the timer\n\t\t\t\tif (event) {\n\t\t\t\t\tthis.resetSlideshow()\n\t\t\t\t}\n\t\t\t\tthis.$emit('next', event)\n\t\t\t}\n\t\t},\n\t\tclose(data) {\n\t\t\t// do not fire event if forbidden\n\t\t\tif (this.canClose) {\n\t\t\t\t// We set internalShow here, so the out transitions properly run before the component is destroyed\n\t\t\t\tthis.internalShow = false\n\t\t\t\tthis.$emit('update:show', false)\n\n\t\t\t\t// delay closing for animation\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t/**\n\t\t\t\t\t * Emitted when the closing animation is finished\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('close', data)\n\t\t\t\t}, 300)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle click on modal wrapper\n\t\t * If `closeOnClickOutside` is set the modal will be closed\n\t\t *\n\t\t * @param {MouseEvent} event The click event\n\t\t */\n\t\thandleClickModalWrapper(event) {\n\t\t\tif (this.closeOnClickOutside) {\n\t\t\t\tthis.close(event)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @param {KeyboardEvent} event - keyboard event\n\t\t */\n\t\thandleKeydown(event) {\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\tconst trapStack = getTrapStack()\n\t\t\t\t// Only close the most recent focus trap modal\n\t\t\t\tif (trapStack.length > 0 && trapStack[trapStack.length - 1] !== this.focusTrap) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\treturn this.close(event)\n\t\t\t}\n\n\t\t\tconst arrowHandlers = {\n\t\t\t\tArrowLeft: this.previous,\n\t\t\t\tArrowRight: this.next,\n\t\t\t}\n\t\t\tif (arrowHandlers[event.key]) {\n\t\t\t\t// Ignore arrow navigation, if there is a current focus outside the modal.\n\t\t\t\t// For example, when the focus is in Sidebar or NcActions's items,\n\t\t\t\t// arrow navigation should not be intercept by modal slider\n\t\t\t\tif (document.activeElement && !this.$el.contains(document.activeElement)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\treturn arrowHandlers[event.key](event)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * handle the swipe event\n\t\t *\n\t\t * @param {TouchEvent} e The touch event\n\t\t * @param {import('@vueuse/core').SwipeDirection} direction Swipe direction\n\t\t */\n\t\thandleSwipe(e, direction) {\n\t\t\tif (this.enableSwipe) {\n\t\t\t\tif (direction === 'left') {\n\t\t\t\t\t// swiping to left to go to the next item\n\t\t\t\t\tthis.next(e)\n\t\t\t\t} else if (direction === 'right') {\n\t\t\t\t\t// swiping to right to go back to the previous item\n\t\t\t\t\tthis.previous(e)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Toggle the slideshow state\n\t\t */\n\t\ttogglePlayPause() {\n\t\t\tthis.playing = !this.playing\n\t\t\tif (this.playing) {\n\t\t\t\tthis.handleSlideshow()\n\t\t\t} else {\n\t\t\t\tthis.clearSlideshowTimeout()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Reset the slideshow timer and keep going if it was on\n\t\t */\n\t\tresetSlideshow() {\n\t\t\tthis.playing = !this.playing\n\t\t\tthis.clearSlideshowTimeout()\n\t\t\tthis.$nextTick(function() {\n\t\t\t\tthis.togglePlayPause()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Handle the slideshow timer and next event\n\t\t */\n\t\thandleSlideshow() {\n\t\t\tthis.playing = true\n\t\t\tif (this.hasNext) {\n\t\t\t\tthis.slideshowTimeout = new Timer(() => {\n\t\t\t\t\tthis.next()\n\t\t\t\t\tthis.handleSlideshow()\n\t\t\t\t}, this.slideshowDelay)\n\t\t\t} else {\n\t\t\t\tthis.playing = false\n\t\t\t\tthis.clearSlideshowTimeout()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Clear slideshowTimeout if ongoing\n\t\t */\n\t\tclearSlideshowTimeout() {\n\t\t\tif (this.slideshowTimeout) {\n\t\t\t\tthis.slideshowTimeout.clear()\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Add focus trap for accessibility.\n\t\t */\n\t\tasync useFocusTrap() {\n\t\t\t// Don't do anything if the modal is hidden,\n\t\t\t// or we have a focus trap already\n\t\t\tif (!this.showModal || this.focusTrap) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst contentContainer = this.$refs.mask\n\t\t\t// wait until all children are mounted and available in the DOM before focusTrap can be added\n\t\t\tawait this.$nextTick()\n\n\t\t\tconst options = {\n\t\t\t\tallowOutsideClick: true,\n\t\t\t\tfallbackFocus: contentContainer,\n\t\t\t\ttrapStack: getTrapStack(),\n\t\t\t\t// Esc can be used without stop in content or additionalTrapElements where it should not deacxtivate modal's focus trap.\n\t\t\t\t// Focus trap is deactivated on modal close anyway.\n\t\t\t\tescapeDeactivates: false,\n\t\t\t}\n\n\t\t\t// Init focus trap\n\t\t\tthis.focusTrap = createFocusTrap([contentContainer, ...this.additionalTrapElements], options)\n\t\t\tthis.focusTrap.activate()\n\t\t},\n\t\tclearFocusTrap() {\n\t\t\tif (!this.focusTrap) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.focusTrap?.deactivate()\n\t\t\tthis.focusTrap = null\n\t\t},\n\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\n.modal-mask {\n\tposition: fixed;\n\tz-index: 9998;\n\ttop: 0;\n\tleft: 0;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(0, 0, 0, .5);\n\t&--dark {\n\t\tbackground-color: rgba(0, 0, 0, .92);\n\t}\n}\n\n.modal-header {\n\tposition: absolute;\n\tz-index: 10001;\n\ttop: 0;\n\tright: 0;\n\tleft: 0;\n\t// prevent vue show to use display:none and reseting\n\t// the circle animation loop\n\tdisplay: flex !important;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 100%;\n\theight: $header-height;\n\toverflow: hidden;\n\ttransition: opacity 250ms, visibility 250ms;\n\n\t.modal-name {\n\t\toverflow-x: hidden;\n\t\tbox-sizing: border-box;\n\t\twidth: 100%;\n\t\tpadding: 0 #{$clickable-area * 3} 0 12px; // maximum actions is 3\n\t\ttransition: padding ease 100ms;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\tcolor: #fff;\n\t\tfont-size: $icon-margin;\n\t\tmargin-bottom: 0;\n\t}\n\n\t// On wider screens the name can be centered\n\t@media only screen and (min-width: $breakpoint-mobile) {\n\t\t.modal-name {\n\t\t\tpadding-left: #{$clickable-area * 3}; // maximum actions is 3\n\t\t\ttext-align: center;\n\t\t}\n\t}\n\n\t.icons-menu {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\n\t\t.header-close {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbox-sizing: border-box;\n\t\t\tmargin: math.div($header-height - $clickable-area, 2);\n\t\t\tpadding: 0;\n\t\t}\n\n\t\t.play-pause-icons {\n\t\t\tposition: relative;\n\t\t\twidth: $header-height;\n\t\t\theight: $header-height;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tcursor: pointer;\n\t\t\tborder: none;\n\t\t\tbackground-color: transparent;\n\t\t\t&:hover,\n\t\t\t&:focus {\n\t\t\t\t.play-pause-icons__play,\n\t\t\t\t.play-pause-icons__pause {\n\t\t\t\t\topacity: $opacity_full;\n\t\t\t\t\tborder-radius: math.div($clickable-area, 2);\n\t\t\t\t\tbackground-color: $icon-focus-bg;\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__play,\n\t\t\t&__pause {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: $clickable-area;\n\t\t\t\theight: $clickable-area;\n\t\t\t\tmargin: math.div($header-height - $clickable-area, 2);\n\t\t\t\tcursor: pointer;\n\t\t\t\topacity: $opacity_normal;\n\t\t\t}\n\t\t}\n\n\t\t.header-actions {\n\t\t\tcolor: white;\n\t\t}\n\n\t\t&:deep() .action-item {\n\t\t\tmargin: math.div($header-height - $clickable-area, 2);\n\n\t\t\t&--single {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: $clickable-area;\n\t\t\t\theight: $clickable-area;\n\t\t\t\tcursor: pointer;\n\t\t\t\tbackground-position: center;\n\t\t\t\tbackground-size: 22px;\n\t\t\t}\n\t\t}\n\n\t\t:deep(button) {\n\t\t\t// force white instead of default main text\n\t\t\tcolor: #fff;\n\t\t}\n\n\t\t// Force the Actions menu icon to be the same size as other icons\n\t\t&:deep(.action-item__menutoggle) {\n\t\t\tpadding: 0;\n\t\t\tspan, svg {\n\t\t\t\twidth: var(--icon-size);\n\t\t\t\theight: var(--icon-size);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.modal-wrapper {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\theight: 100%;\n\n\t/* Navigation buttons */\n\t.prev,\n\t.next {\n\t\tz-index: 10000;\n\t\theight: 35vh;\n\t\tmin-height: 300px;\n\t\tposition: absolute;\n\t\ttransition: opacity 250ms;\n\t\t// hover the mask\n\t\tcolor: white;\n\n\t\t&:focus-visible {\n\t\t\t// Override NcButton focus styles\n\t\t\tbox-shadow: 0 0 0 2px var(--color-primary-element-text);\n\t\t\tbackground-color: var(--color-box-shadow);\n\t\t}\n\t}\n\n\t.prev {\n\t\tleft: 2px;\n\t}\n\t.next {\n\t\tright: 2px;\n\t}\n\n\t/* Content */\n\t.modal-container {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tpadding: 0;\n\t\ttransition: transform 300ms ease;\n\t\tborder-radius: var(--border-radius-large);\n\t\tbackground-color: var(--color-main-background);\n\t\tcolor: var(--color-main-text);\n\t\tbox-shadow: 0 0 40px rgba(0, 0, 0, .2);\n\n\t\t&__close {\n\t\t\t// Ensure the close button is always ontop of the content\n\t\t\tz-index: 1;\n\t\t\tposition: absolute;\n\t\t\ttop: 4px;\n\t\t\tright: 4px;\n\t\t}\n\n\t\t&__content {\n\t\t\twidth: 100%;\n\t\t\tmin-height: 52px; // At least the close button shall fit in\n\t\t\toverflow: auto; // avoids unecessary hacks if the content should be bigger than the modal\n\t\t}\n\t}\n\n\t// We allow 90% max-height, but we need to ensure the header does not overlap the modal\n\t// as the modal is centered, we need the space on top and bottom\n\t$max-modal-height: min(90%, calc(100% - 2 * $header-height));\n\n\t// Sizing\n\t&--small {\n\t\t.modal-container {\n\t\t\twidth: 400px;\n\t\t\tmax-width: 90%;\n\t\t\tmax-height: $max-modal-height;\n\t\t}\n\t}\n\t&--normal {\n\t\t.modal-container {\n\t\t\tmax-width: 90%;\n\t\t\twidth: 600px;\n\t\t\tmax-height: $max-modal-height;\n\t\t}\n\t}\n\t&--large {\n\t\t.modal-container {\n\t\t\tmax-width: 90%;\n\t\t\twidth: 900px;\n\t\t\tmax-height: $max-modal-height;\n\t\t}\n\t}\n\t&--full {\n\t\t.modal-container {\n\t\t\twidth: 100%;\n\t\t\theight: calc(100% - var(--header-height));\n\t\t\tposition: absolute;\n\t\t\ttop: $header-height;\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n\n\t// Make modal full screen on mobile\n\t@media only screen and (max-width: math.div($breakpoint-mobile, 2)) {\n\t\t.modal-container {\n\t\t\tmax-width: initial;\n\t\t\twidth: 100%;\n\t\t\tmax-height: initial;\n\t\t\theight: calc(100% - var(--header-height));\n\t\t\tposition: absolute;\n\t\t\ttop: $header-height;\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n}\n\n/* TRANSITIONS */\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity 250ms;\n}\n\n.fade-enter,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.fade-visibility-enter,\n.fade-visibility-leave-to {\n\tvisibility: hidden;\n\topacity: 0;\n}\n\n.modal-in-enter-active,\n.modal-in-leave-active,\n.modal-out-enter-active,\n.modal-out-leave-active {\n\ttransition: opacity 250ms;\n}\n\n.modal-in-enter,\n.modal-in-leave-to,\n.modal-out-enter,\n.modal-out-leave-to {\n\topacity: 0;\n}\n\n.modal-in-enter .modal-container,\n.modal-in-leave-to .modal-container {\n\ttransform: scale(.9);\n}\n\n.modal-out-enter .modal-container,\n.modal-out-leave-to .modal-container {\n\ttransform: scale(1.1);\n}\n\n// animated circle\n$radius: 15;\n$pi: 3.14159265358979;\n\n.modal-mask .play-pause-icons {\n\t.progress-ring {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\ttransform: rotate(-90deg);\n\t\t.progress-ring__circle {\n\t\t\ttransition: 100ms stroke-dashoffset;\n\t\t\ttransform-origin: 50% 50%; // axis compensation\n\t\t\tanimation: progressring linear var(--slideshow-duration) infinite;\n\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-dashoffset: $radius * 2 * $pi; // radius * 2 * PI\n\t\t\tstroke-dasharray: $radius * 2 * $pi; // radius * 2 * PI\n\t\t}\n\t}\n\t&--paused {\n\t\t.icon-pause {\n\t\t\tanimation: breath 2s cubic-bezier(.4, 0, .2, 1) infinite;\n\t\t}\n\t\t.progress-ring__circle {\n\t\t\tanimation-play-state: paused !important;\n\t\t}\n\t}\n}\n\n// keyframes get scoped too and break the animation name, we need them unscoped\n@keyframes progressring {\n\tfrom {\n\t\tstroke-dashoffset: $radius * 2 * $pi; // radius * 2 * PI\n\t}\n\tto {\n\t\tstroke-dashoffset: 0;\n\t}\n}\n\n@keyframes breath {\n\t0% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n\n</style>\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\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 */\nimport ScopeComponent from '../../utils/ScopeComponent.js'\nimport NcModal from './NcModal.vue'\n\nScopeComponent(NcModal)\n\nexport default NcModal\n"],"names":["timer","callback","delay","id","started","remaining","running","_sfc_main","NcActions","ChevronLeft","ChevronRight","Close","Pause","Play","NcButton","VTooltip","l10n","size","GenRandomId","t","paused","elements","contentContainer","useSwipe","event","data","trapStack","getTrapStack","arrowHandlers","e","direction","options","createFocusTrap","_a","ScopeComponent","NcModal"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0Be,SAAAA,EAAAC,GAAAC,GAAA;AACf,MAAAC,GACAC,GACAC,IAAAH,GACAI;AAEA,OAAA,QAAA,WAAA;AACA,IAAAA,IAAA,IACAF,IAAA,oBAAA,KAAA,GACAD,IAAA,WAAAF,GAAAI,CAAA;AAAA,EACA,GAEA,KAAA,QAAA,WAAA;AACA,IAAAC,IAAA,IACA,aAAAH,CAAA,GACAE,KAAA,oBAAA,KAAA,IAAAD;AAAA,EACA,GAEA,KAAA,QAAA,WAAA;AACA,IAAAE,IAAA,IACA,aAAAH,CAAA,GACAE,IAAA;AAAA,EACA,GAEA,KAAA,cAAA,WAAA;AACA,WAAAC,MACA,KAAA,MAAA,GACA,KAAA,MAAA,IAGAD;AA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;AAAA,MACA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,kBAAA;AACA,WAAA,UAAA,IACA,KAAA,UACA,KAAA,mBAAA,IAAA7B,EAAA,MAAA;AACA,aAAA,KAAA,GACA,KAAA,gBAAA;AAAA,MACA,GAAA,KAAA,cAAA,KAEA,KAAA,UAAA,IACA,KAAA,sBAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA,IAKA,wBAAA;AACA,MAAA,KAAA,oBACA,KAAA,iBAAA,MAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA,eAAA;AAGA,UAAA,CAAA,KAAA,aAAA,KAAA;AACA;AAGA,YAAAsB,IAAA,KAAA,MAAA;AAEA,YAAA,KAAA,UAAA;AAEA,YAAAS,IAAA;AAAA,QACA,mBAAA;AAAA,QACA,eAAAT;AAAA,QACA,WAAAK,EAAA;AAAA;AAAA;AAAA,QAGA,mBAAA;AAAA,MACA;AAGA,WAAA,YAAAK,EAAA,CAAAV,GAAA,GAAA,KAAA,sBAAA,GAAAS,CAAA,GACA,KAAA,UAAA,SAAA;AAAA,IACA;AAAA,IACA,iBAAA;;AACA,MAAA,KAAA,eAGAE,IAAA,KAAA,cAAA,QAAAA,EAAA,cACA,KAAA,YAAA;AAAA,IACA;AAAA,EAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1xBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBAC,EAAAC,CAAA;"}
@@ -1,5 +1,5 @@
1
- var m = require("../assets/index-03ec5f40.css");
2
- const o = require("vue-material-design-icons/CheckboxMarkedCircle.vue"), c = require("vue-material-design-icons/AlertDecagram.vue"), s = require("vue-material-design-icons/Alert.vue"), l = require("vue-material-design-icons/Information.vue"), i = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), n = (r) => r && r.__esModule ? r : { default: r }, u = /* @__PURE__ */ n(o), _ = /* @__PURE__ */ n(c), a = /* @__PURE__ */ n(s), d = /* @__PURE__ */ n(l);
1
+ var m = require("../assets/index-400b48a6.css");
2
+ const o = require("vue-material-design-icons/CheckboxMarkedCircle.vue"), s = require("vue-material-design-icons/AlertDecagram.vue"), c = require("vue-material-design-icons/Alert.vue"), l = require("vue-material-design-icons/Information.vue"), i = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), n = (r) => r && r.__esModule ? r : { default: r }, u = /* @__PURE__ */ n(o), _ = /* @__PURE__ */ n(s), a = /* @__PURE__ */ n(c), d = /* @__PURE__ */ n(l);
3
3
  const f = {
4
4
  name: "NcNoteCard",
5
5
  props: {
@@ -56,14 +56,14 @@ const f = {
56
56
  };
57
57
  var h = function() {
58
58
  var e = this, t = e._self._c;
59
- return t("div", { staticClass: "notecard", class: `notecard--${e.type}`, attrs: { role: e.shouldShowAlert ? "alert" : "" } }, [t(e.icon, { tag: "component", staticClass: "notecard__icon", class: { "notecard__icon--heading": e.heading }, attrs: { "fill-color": e.color } }), t("div", [e.heading ? t("h2", [e._v(" " + e._s(e.heading) + " ")]) : e._e(), e._t("default")], 2)], 1);
59
+ return t("div", { staticClass: "notecard", class: `notecard--${e.type}`, attrs: { role: e.shouldShowAlert ? "alert" : "note" } }, [t(e.icon, { tag: "component", staticClass: "notecard__icon", class: { "notecard__icon--heading": e.heading }, attrs: { "fill-color": e.color } }), t("div", [e.heading ? t("h2", [e._v(" " + e._s(e.heading) + " ")]) : e._e(), e._t("default")], 2)], 1);
60
60
  }, p = [], g = /* @__PURE__ */ i.normalizeComponent(
61
61
  f,
62
62
  h,
63
63
  p,
64
64
  !1,
65
65
  null,
66
- "a0360c76",
66
+ "3a409988",
67
67
  null,
68
68
  null
69
69
  );
@@ -1 +1 @@
1
- {"version":3,"file":"NcNoteCard.cjs","sources":["../../src/components/NcNoteCard/NcNoteCard.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2022 Carl Schwan <carl@carlschwan.eu>\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\n<docs>\nThis component is made to display additional information to the user. It is\navailable in four versions:\n\n- success: Display a successful message\n- info: Display an informational message\n- warning: Display a warning to the user. This indicate that the action they want\n- error: Display an error message. For example\n\nWhen using an error type,\n\n```vue\n<div>\n\t<NcNoteCard type=\"warning\">\n\t\t<p>This is dangerous</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"error\" heading=\"Error\">\n\t\t<p>The server is not happy and reported the following error</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"success\">\n\t\t<p>You won</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"info\">\n\t\t<p>For your information</p>\n\t</NcNoteCard>\n</div>\n```\n</docs>\n\n<template>\n\t<div class=\"notecard\"\n\t\t:class=\"`notecard--${type}`\"\n\t\t:role=\"shouldShowAlert ? 'alert' : ''\">\n\t\t<component :is=\"icon\"\n\t\t\tclass=\"notecard__icon\"\n\t\t\t:class=\"{'notecard__icon--heading': heading}\"\n\t\t\t:fill-color=\"color\" />\n\t\t<div>\n\t\t\t<h2 v-if=\"heading\">\n\t\t\t\t{{ heading }}\n\t\t\t</h2>\n\t\t\t<slot />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport CheckboxMarkedCircle from 'vue-material-design-icons/CheckboxMarkedCircle.vue'\nimport AlertDecagram from 'vue-material-design-icons/AlertDecagram.vue'\nimport Alert from 'vue-material-design-icons/Alert.vue'\nimport Information from 'vue-material-design-icons/Information.vue'\n\nexport default {\n\tname: 'NcNoteCard',\n\n\tprops: {\n\t\t/**\n\t\t * Type of the attribute\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'warning',\n\t\t\tvalidator: type => ['success', 'info', 'warning', 'error'].includes(type),\n\t\t},\n\t\tshowAlert: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\theading: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\tcomputed: {\n\t\tshouldShowAlert() {\n\t\t\treturn this.showAlert || this.type === 'error'\n\t\t},\n\t\ticon() {\n\t\t\tswitch (this.type) {\n\t\t\tcase 'error':\n\t\t\t\treturn AlertDecagram\n\t\t\tcase 'success':\n\t\t\t\treturn CheckboxMarkedCircle\n\t\t\tcase 'info':\n\t\t\t\treturn Information\n\t\t\tcase 'warning':\n\t\t\t\treturn Alert\n\t\t\tdefault:\n\t\t\t\treturn Alert\n\t\t\t}\n\t\t},\n\t\tcolor() {\n\t\t\tswitch (this.type) {\n\t\t\tcase 'error':\n\t\t\t\treturn 'var(--color-error)'\n\t\t\tcase 'success':\n\t\t\t\treturn 'var(--color-success)'\n\t\t\tcase 'info':\n\t\t\t\treturn 'var(--color-info)'\n\t\t\tcase 'warning':\n\t\t\t\treturn 'var(--color-warning)'\n\t\t\tdefault:\n\t\t\t\treturn 'var(--color-warning)'\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.notecard {\n\tcolor: var(--color-main-text) !important;\n\tbackground-color: var(--note-background) !important;\n\tborder-inline-start: 4px solid var(--note-theme);\n\tborder-radius: var(--border-radius);\n\tmargin: 1rem 0;\n\tmargin-top: 1rem;\n\tpadding: 1rem;\n\tdisplay: flex;\n\tflex-direction: row;\n\tgap: 1rem;\n\n\t&__icon--heading {\n\t\tmargin-bottom: auto;\n\t\tmargin-top: 0.3rem;\n\t}\n\n\t&--success {\n\t\t--note-background: rgba(var(--color-success-rgb), 0.1);\n\t\t--note-theme: var(--color-success);\n\t}\n\n\t&--info {\n\t\t--note-background: rgba(var(--color-info-rgb), 0.1);\n\t\t--note-theme: var(--color-info);\n\t}\n\n\t&--error {\n\t\t--note-background: rgba(var(--color-error-rgb), 0.1);\n\t\t--note-theme: var(--color-error);\n\t}\n\n\t&--warning {\n\t\t--note-background: rgba(var(--color-warning-rgb), 0.1);\n\t\t--note-theme: var(--color-warning);\n\t}\n}\n</style>\n"],"names":["_sfc_main","type","AlertDecagram__default","CheckboxMarkedCircle__default","Information__default","Alert__default"],"mappings":";;AA2EA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,WAAA,QAAA,WAAA,OAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;AAAA,IACA,kBAAA;AACA,aAAA,KAAA,aAAA,KAAA,SAAA;AAAA,IACA;AAAA,IACA,OAAA;AACA,cAAA,KAAA,MAAA;AAAA,QACA,KAAA;AACA,iBAAAC,EAAA;AAAA,QACA,KAAA;AACA,iBAAAC,EAAA;AAAA,QACA,KAAA;AACA,iBAAAC,EAAA;AAAA,QACA,KAAA;AACA,iBAAAC,EAAA;AAAA,QACA;AACA,iBAAAA,EAAA;AAAA,MACA;AAAA,IACA;AAAA,IACA,QAAA;AACA,cAAA,KAAA,MAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA;AACA,iBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcNoteCard.cjs","sources":["../../src/components/NcNoteCard/NcNoteCard.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2022 Carl Schwan <carl@carlschwan.eu>\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\n<docs>\nThis component is made to display additional information to the user. It is\navailable in four versions:\n\n- success: Display a successful message\n- info: Display an informational message\n- warning: Display a warning to the user. This indicate that the action they want\n- error: Display an error message. For example\n\nWhen using an error type,\n\n```vue\n<div>\n\t<NcNoteCard type=\"warning\">\n\t\t<p>This is dangerous</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"error\" heading=\"Error\">\n\t\t<p>The server is not happy and reported the following error</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"success\">\n\t\t<p>You won</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"info\">\n\t\t<p>For your information</p>\n\t</NcNoteCard>\n</div>\n```\n</docs>\n\n<template>\n\t<div class=\"notecard\"\n\t\t:class=\"`notecard--${type}`\"\n\t\t:role=\"shouldShowAlert ? 'alert' : 'note'\">\n\t\t<component :is=\"icon\"\n\t\t\tclass=\"notecard__icon\"\n\t\t\t:class=\"{'notecard__icon--heading': heading}\"\n\t\t\t:fill-color=\"color\" />\n\t\t<div>\n\t\t\t<h2 v-if=\"heading\">\n\t\t\t\t{{ heading }}\n\t\t\t</h2>\n\t\t\t<slot />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport CheckboxMarkedCircle from 'vue-material-design-icons/CheckboxMarkedCircle.vue'\nimport AlertDecagram from 'vue-material-design-icons/AlertDecagram.vue'\nimport Alert from 'vue-material-design-icons/Alert.vue'\nimport Information from 'vue-material-design-icons/Information.vue'\n\nexport default {\n\tname: 'NcNoteCard',\n\n\tprops: {\n\t\t/**\n\t\t * Type of the attribute\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'warning',\n\t\t\tvalidator: type => ['success', 'info', 'warning', 'error'].includes(type),\n\t\t},\n\t\tshowAlert: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\theading: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\tcomputed: {\n\t\tshouldShowAlert() {\n\t\t\treturn this.showAlert || this.type === 'error'\n\t\t},\n\t\ticon() {\n\t\t\tswitch (this.type) {\n\t\t\tcase 'error':\n\t\t\t\treturn AlertDecagram\n\t\t\tcase 'success':\n\t\t\t\treturn CheckboxMarkedCircle\n\t\t\tcase 'info':\n\t\t\t\treturn Information\n\t\t\tcase 'warning':\n\t\t\t\treturn Alert\n\t\t\tdefault:\n\t\t\t\treturn Alert\n\t\t\t}\n\t\t},\n\t\tcolor() {\n\t\t\tswitch (this.type) {\n\t\t\tcase 'error':\n\t\t\t\treturn 'var(--color-error)'\n\t\t\tcase 'success':\n\t\t\t\treturn 'var(--color-success)'\n\t\t\tcase 'info':\n\t\t\t\treturn 'var(--color-info)'\n\t\t\tcase 'warning':\n\t\t\t\treturn 'var(--color-warning)'\n\t\t\tdefault:\n\t\t\t\treturn 'var(--color-warning)'\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.notecard {\n\tcolor: var(--color-main-text) !important;\n\tbackground-color: var(--note-background) !important;\n\tborder-inline-start: 4px solid var(--note-theme);\n\tborder-radius: var(--border-radius);\n\tmargin: 1rem 0;\n\tmargin-top: 1rem;\n\tpadding: 1rem;\n\tdisplay: flex;\n\tflex-direction: row;\n\tgap: 1rem;\n\n\t&__icon--heading {\n\t\tmargin-bottom: auto;\n\t\tmargin-top: 0.3rem;\n\t}\n\n\t&--success {\n\t\t--note-background: rgba(var(--color-success-rgb), 0.1);\n\t\t--note-theme: var(--color-success);\n\t}\n\n\t&--info {\n\t\t--note-background: rgba(var(--color-info-rgb), 0.1);\n\t\t--note-theme: var(--color-info);\n\t}\n\n\t&--error {\n\t\t--note-background: rgba(var(--color-error-rgb), 0.1);\n\t\t--note-theme: var(--color-error);\n\t}\n\n\t&--warning {\n\t\t--note-background: rgba(var(--color-warning-rgb), 0.1);\n\t\t--note-theme: var(--color-warning);\n\t}\n}\n</style>\n"],"names":["_sfc_main","type","AlertDecagram__default","CheckboxMarkedCircle__default","Information__default","Alert__default"],"mappings":";;AA2EA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,WAAA,QAAA,WAAA,OAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;AAAA,IACA,kBAAA;AACA,aAAA,KAAA,aAAA,KAAA,SAAA;AAAA,IACA;AAAA,IACA,OAAA;AACA,cAAA,KAAA,MAAA;AAAA,QACA,KAAA;AACA,iBAAAC,EAAA;AAAA,QACA,KAAA;AACA,iBAAAC,EAAA;AAAA,QACA,KAAA;AACA,iBAAAC,EAAA;AAAA,QACA,KAAA;AACA,iBAAAC,EAAA;AAAA,QACA;AACA,iBAAAA,EAAA;AAAA,MACA;AAAA,IACA;AAAA,IACA,QAAA;AACA,cAAA,KAAA,MAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA;AACA,iBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import "../assets/index-03ec5f40.css";
1
+ import "../assets/index-400b48a6.css";
2
2
  import n from "vue-material-design-icons/CheckboxMarkedCircle.vue";
3
3
  import a from "vue-material-design-icons/AlertDecagram.vue";
4
4
  import o from "vue-material-design-icons/Alert.vue";
@@ -60,14 +60,14 @@ const i = {
60
60
  };
61
61
  var l = function() {
62
62
  var r = this, e = r._self._c;
63
- return e("div", { staticClass: "notecard", class: `notecard--${r.type}`, attrs: { role: r.shouldShowAlert ? "alert" : "" } }, [e(r.icon, { tag: "component", staticClass: "notecard__icon", class: { "notecard__icon--heading": r.heading }, attrs: { "fill-color": r.color } }), e("div", [r.heading ? e("h2", [r._v(" " + r._s(r.heading) + " ")]) : r._e(), r._t("default")], 2)], 1);
63
+ return e("div", { staticClass: "notecard", class: `notecard--${r.type}`, attrs: { role: r.shouldShowAlert ? "alert" : "note" } }, [e(r.icon, { tag: "component", staticClass: "notecard__icon", class: { "notecard__icon--heading": r.heading }, attrs: { "fill-color": r.color } }), e("div", [r.heading ? e("h2", [r._v(" " + r._s(r.heading) + " ")]) : r._e(), r._t("default")], 2)], 1);
64
64
  }, u = [], d = /* @__PURE__ */ c(
65
65
  i,
66
66
  l,
67
67
  u,
68
68
  !1,
69
69
  null,
70
- "a0360c76",
70
+ "3a409988",
71
71
  null,
72
72
  null
73
73
  );
@@ -1 +1 @@
1
- {"version":3,"file":"NcNoteCard.mjs","sources":["../../src/components/NcNoteCard/NcNoteCard.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2022 Carl Schwan <carl@carlschwan.eu>\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\n<docs>\nThis component is made to display additional information to the user. It is\navailable in four versions:\n\n- success: Display a successful message\n- info: Display an informational message\n- warning: Display a warning to the user. This indicate that the action they want\n- error: Display an error message. For example\n\nWhen using an error type,\n\n```vue\n<div>\n\t<NcNoteCard type=\"warning\">\n\t\t<p>This is dangerous</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"error\" heading=\"Error\">\n\t\t<p>The server is not happy and reported the following error</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"success\">\n\t\t<p>You won</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"info\">\n\t\t<p>For your information</p>\n\t</NcNoteCard>\n</div>\n```\n</docs>\n\n<template>\n\t<div class=\"notecard\"\n\t\t:class=\"`notecard--${type}`\"\n\t\t:role=\"shouldShowAlert ? 'alert' : ''\">\n\t\t<component :is=\"icon\"\n\t\t\tclass=\"notecard__icon\"\n\t\t\t:class=\"{'notecard__icon--heading': heading}\"\n\t\t\t:fill-color=\"color\" />\n\t\t<div>\n\t\t\t<h2 v-if=\"heading\">\n\t\t\t\t{{ heading }}\n\t\t\t</h2>\n\t\t\t<slot />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport CheckboxMarkedCircle from 'vue-material-design-icons/CheckboxMarkedCircle.vue'\nimport AlertDecagram from 'vue-material-design-icons/AlertDecagram.vue'\nimport Alert from 'vue-material-design-icons/Alert.vue'\nimport Information from 'vue-material-design-icons/Information.vue'\n\nexport default {\n\tname: 'NcNoteCard',\n\n\tprops: {\n\t\t/**\n\t\t * Type of the attribute\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'warning',\n\t\t\tvalidator: type => ['success', 'info', 'warning', 'error'].includes(type),\n\t\t},\n\t\tshowAlert: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\theading: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\tcomputed: {\n\t\tshouldShowAlert() {\n\t\t\treturn this.showAlert || this.type === 'error'\n\t\t},\n\t\ticon() {\n\t\t\tswitch (this.type) {\n\t\t\tcase 'error':\n\t\t\t\treturn AlertDecagram\n\t\t\tcase 'success':\n\t\t\t\treturn CheckboxMarkedCircle\n\t\t\tcase 'info':\n\t\t\t\treturn Information\n\t\t\tcase 'warning':\n\t\t\t\treturn Alert\n\t\t\tdefault:\n\t\t\t\treturn Alert\n\t\t\t}\n\t\t},\n\t\tcolor() {\n\t\t\tswitch (this.type) {\n\t\t\tcase 'error':\n\t\t\t\treturn 'var(--color-error)'\n\t\t\tcase 'success':\n\t\t\t\treturn 'var(--color-success)'\n\t\t\tcase 'info':\n\t\t\t\treturn 'var(--color-info)'\n\t\t\tcase 'warning':\n\t\t\t\treturn 'var(--color-warning)'\n\t\t\tdefault:\n\t\t\t\treturn 'var(--color-warning)'\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.notecard {\n\tcolor: var(--color-main-text) !important;\n\tbackground-color: var(--note-background) !important;\n\tborder-inline-start: 4px solid var(--note-theme);\n\tborder-radius: var(--border-radius);\n\tmargin: 1rem 0;\n\tmargin-top: 1rem;\n\tpadding: 1rem;\n\tdisplay: flex;\n\tflex-direction: row;\n\tgap: 1rem;\n\n\t&__icon--heading {\n\t\tmargin-bottom: auto;\n\t\tmargin-top: 0.3rem;\n\t}\n\n\t&--success {\n\t\t--note-background: rgba(var(--color-success-rgb), 0.1);\n\t\t--note-theme: var(--color-success);\n\t}\n\n\t&--info {\n\t\t--note-background: rgba(var(--color-info-rgb), 0.1);\n\t\t--note-theme: var(--color-info);\n\t}\n\n\t&--error {\n\t\t--note-background: rgba(var(--color-error-rgb), 0.1);\n\t\t--note-theme: var(--color-error);\n\t}\n\n\t&--warning {\n\t\t--note-background: rgba(var(--color-warning-rgb), 0.1);\n\t\t--note-theme: var(--color-warning);\n\t}\n}\n</style>\n"],"names":["_sfc_main","type","AlertDecagram","CheckboxMarkedCircle","Information","Alert"],"mappings":";;;;;;AA2EA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,WAAA,QAAA,WAAA,OAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;AAAA,IACA,kBAAA;AACA,aAAA,KAAA,aAAA,KAAA,SAAA;AAAA,IACA;AAAA,IACA,OAAA;AACA,cAAA,KAAA,MAAA;AAAA,QACA,KAAA;AACA,iBAAAC;AAAA,QACA,KAAA;AACA,iBAAAC;AAAA,QACA,KAAA;AACA,iBAAAC;AAAA,QACA,KAAA;AACA,iBAAAC;AAAA,QACA;AACA,iBAAAA;AAAA,MACA;AAAA,IACA;AAAA,IACA,QAAA;AACA,cAAA,KAAA,MAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA;AACA,iBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcNoteCard.mjs","sources":["../../src/components/NcNoteCard/NcNoteCard.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2022 Carl Schwan <carl@carlschwan.eu>\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\n<docs>\nThis component is made to display additional information to the user. It is\navailable in four versions:\n\n- success: Display a successful message\n- info: Display an informational message\n- warning: Display a warning to the user. This indicate that the action they want\n- error: Display an error message. For example\n\nWhen using an error type,\n\n```vue\n<div>\n\t<NcNoteCard type=\"warning\">\n\t\t<p>This is dangerous</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"error\" heading=\"Error\">\n\t\t<p>The server is not happy and reported the following error</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"success\">\n\t\t<p>You won</p>\n\t</NcNoteCard>\n\n\t<NcNoteCard type=\"info\">\n\t\t<p>For your information</p>\n\t</NcNoteCard>\n</div>\n```\n</docs>\n\n<template>\n\t<div class=\"notecard\"\n\t\t:class=\"`notecard--${type}`\"\n\t\t:role=\"shouldShowAlert ? 'alert' : 'note'\">\n\t\t<component :is=\"icon\"\n\t\t\tclass=\"notecard__icon\"\n\t\t\t:class=\"{'notecard__icon--heading': heading}\"\n\t\t\t:fill-color=\"color\" />\n\t\t<div>\n\t\t\t<h2 v-if=\"heading\">\n\t\t\t\t{{ heading }}\n\t\t\t</h2>\n\t\t\t<slot />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport CheckboxMarkedCircle from 'vue-material-design-icons/CheckboxMarkedCircle.vue'\nimport AlertDecagram from 'vue-material-design-icons/AlertDecagram.vue'\nimport Alert from 'vue-material-design-icons/Alert.vue'\nimport Information from 'vue-material-design-icons/Information.vue'\n\nexport default {\n\tname: 'NcNoteCard',\n\n\tprops: {\n\t\t/**\n\t\t * Type of the attribute\n\t\t */\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'warning',\n\t\t\tvalidator: type => ['success', 'info', 'warning', 'error'].includes(type),\n\t\t},\n\t\tshowAlert: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\theading: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\tcomputed: {\n\t\tshouldShowAlert() {\n\t\t\treturn this.showAlert || this.type === 'error'\n\t\t},\n\t\ticon() {\n\t\t\tswitch (this.type) {\n\t\t\tcase 'error':\n\t\t\t\treturn AlertDecagram\n\t\t\tcase 'success':\n\t\t\t\treturn CheckboxMarkedCircle\n\t\t\tcase 'info':\n\t\t\t\treturn Information\n\t\t\tcase 'warning':\n\t\t\t\treturn Alert\n\t\t\tdefault:\n\t\t\t\treturn Alert\n\t\t\t}\n\t\t},\n\t\tcolor() {\n\t\t\tswitch (this.type) {\n\t\t\tcase 'error':\n\t\t\t\treturn 'var(--color-error)'\n\t\t\tcase 'success':\n\t\t\t\treturn 'var(--color-success)'\n\t\t\tcase 'info':\n\t\t\t\treturn 'var(--color-info)'\n\t\t\tcase 'warning':\n\t\t\t\treturn 'var(--color-warning)'\n\t\t\tdefault:\n\t\t\t\treturn 'var(--color-warning)'\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.notecard {\n\tcolor: var(--color-main-text) !important;\n\tbackground-color: var(--note-background) !important;\n\tborder-inline-start: 4px solid var(--note-theme);\n\tborder-radius: var(--border-radius);\n\tmargin: 1rem 0;\n\tmargin-top: 1rem;\n\tpadding: 1rem;\n\tdisplay: flex;\n\tflex-direction: row;\n\tgap: 1rem;\n\n\t&__icon--heading {\n\t\tmargin-bottom: auto;\n\t\tmargin-top: 0.3rem;\n\t}\n\n\t&--success {\n\t\t--note-background: rgba(var(--color-success-rgb), 0.1);\n\t\t--note-theme: var(--color-success);\n\t}\n\n\t&--info {\n\t\t--note-background: rgba(var(--color-info-rgb), 0.1);\n\t\t--note-theme: var(--color-info);\n\t}\n\n\t&--error {\n\t\t--note-background: rgba(var(--color-error-rgb), 0.1);\n\t\t--note-theme: var(--color-error);\n\t}\n\n\t&--warning {\n\t\t--note-background: rgba(var(--color-warning-rgb), 0.1);\n\t\t--note-theme: var(--color-warning);\n\t}\n}\n</style>\n"],"names":["_sfc_main","type","AlertDecagram","CheckboxMarkedCircle","Information","Alert"],"mappings":";;;;;;AA2EA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,WAAA,QAAA,WAAA,OAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;AAAA,IACA,kBAAA;AACA,aAAA,KAAA,aAAA,KAAA,SAAA;AAAA,IACA;AAAA,IACA,OAAA;AACA,cAAA,KAAA,MAAA;AAAA,QACA,KAAA;AACA,iBAAAC;AAAA,QACA,KAAA;AACA,iBAAAC;AAAA,QACA,KAAA;AACA,iBAAAC;AAAA,QACA,KAAA;AACA,iBAAAC;AAAA,QACA;AACA,iBAAAA;AAAA,MACA;AAAA,IACA;AAAA,IACA,QAAA;AACA,cAAA,KAAA,MAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA;AACA,iBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}