@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-165fce0e.css";
2
- import { N as i } from "../chunks/index-6c221fa0.mjs";
1
+ import "../assets/index-e7eadba7.css";
2
+ import { N as i } from "../chunks/index-fb2ee22c.mjs";
3
3
  import o from "./NcActions.mjs";
4
4
  import l from "./NcActionButton.mjs";
5
- import { n as c } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
6
- const u = {
5
+ import { n as u } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
6
+ const c = {
7
7
  name: "NcDashboardWidgetItem",
8
8
  components: {
9
9
  NcAvatar: i,
@@ -118,7 +118,7 @@ var m = function() {
118
118
  t.hovered = !0;
119
119
  }, mouseleave: function(a) {
120
120
  t.hovered = !1;
121
- } } }, [e(t.targetUrl ? "a" : "div", { tag: "component", class: { "item-list__entry": !0, "item-list__entry--has-actions-menu": t.gotMenu }, attrs: { href: t.targetUrl, target: t.targetUrl ? "_blank" : void 0 }, on: { click: t.onLinkClick } }, [t._t("avatar", function() {
121
+ } } }, [e(t.targetUrl ? "a" : "div", { tag: "component", class: { "item-list__entry": !0, "item-list__entry--has-actions-menu": t.gotMenu }, attrs: { href: t.targetUrl || void 0, target: t.targetUrl ? "_blank" : void 0 }, on: { click: t.onLinkClick } }, [t._t("avatar", function() {
122
122
  return [e("NcAvatar", { staticClass: "item-avatar", attrs: { size: 44, url: t.avatarUrl, user: t.avatarUsername, "is-no-user": t.avatarIsNoUser, "show-user-status": !t.gotOverlayIcon } })];
123
123
  }, { avatarUrl: t.avatarUrl, avatarUsername: t.avatarUsername }), t.overlayIconUrl ? e("img", { staticClass: "item-icon", attrs: { alt: "", src: t.overlayIconUrl } }) : t._e(), e("div", { staticClass: "item__details" }, [e("h3", { attrs: { title: t.mainText } }, [t._v(" " + t._s(t.mainText) + " ")]), e("span", { staticClass: "message", attrs: { title: t.subText } }, [t._v(" " + t._s(t.subText) + " ")])]), t.gotMenu ? e("NcActions", { attrs: { "force-menu": t.forceMenu } }, [t._t("actions", function() {
124
124
  return t._l(t.itemMenu, function(a, n) {
@@ -127,17 +127,17 @@ var m = function() {
127
127
  } } }, [t._v(" " + t._s(a.text) + " ")]);
128
128
  });
129
129
  })], 2) : t._e()], 2)], 1);
130
- }, d = [], f = /* @__PURE__ */ c(
131
- u,
130
+ }, d = [], v = /* @__PURE__ */ u(
131
+ c,
132
132
  m,
133
133
  d,
134
134
  !1,
135
135
  null,
136
- "2ff3cd9a",
136
+ "00e861ef",
137
137
  null,
138
138
  null
139
139
  );
140
- const y = f.exports;
140
+ const y = v.exports;
141
141
  export {
142
142
  y as default
143
143
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NcDashboardWidgetItem.mjs","sources":["../../src/components/NcDashboardWidgetItem/NcDashboardWidgetItem.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Julien Veyssier <eneiluj@posteo.net>\n -\n - @author Julien Veyssier <eneiluj@posteo.net>\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>\n\n### General description\n\nThis component is meant to be used inside a DashboardWidget component.\n\n</docs>\n\n<template>\n\t<div @mouseover=\"hovered = true\" @mouseleave=\"hovered = false\">\n\t\t<component :is=\"targetUrl ? 'a' : 'div'\"\n\t\t\t:href=\"targetUrl\"\n\t\t\t:target=\"targetUrl ? '_blank' : undefined\"\n\t\t\t:class=\"{ 'item-list__entry': true, 'item-list__entry--has-actions-menu': gotMenu }\"\n\t\t\t@click=\"onLinkClick\">\n\t\t\t<!-- @slot Slot for passing a user avatar. -->\n\t\t\t<slot name=\"avatar\" :avatar-url=\"avatarUrl\" :avatar-username=\"avatarUsername\">\n\t\t\t\t<NcAvatar class=\"item-avatar\"\n\t\t\t\t\t:size=\"44\"\n\t\t\t\t\t:url=\"avatarUrl\"\n\t\t\t\t\t:user=\"avatarUsername\"\n\t\t\t\t\t:is-no-user=\"avatarIsNoUser\"\n\t\t\t\t\t:show-user-status=\"!gotOverlayIcon\" />\n\t\t\t</slot>\n\t\t\t<img v-if=\"overlayIconUrl\"\n\t\t\t\tclass=\"item-icon\"\n\t\t\t\talt=\"\"\n\t\t\t\t:src=\"overlayIconUrl\">\n\t\t\t<div class=\"item__details\">\n\t\t\t\t<h3 :title=\"mainText\">\n\t\t\t\t\t{{ mainText }}\n\t\t\t\t</h3>\n\t\t\t\t<span class=\"message\" :title=\"subText\">\n\t\t\t\t\t{{ subText }}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<NcActions v-if=\"gotMenu\" :force-menu=\"forceMenu\">\n\t\t\t\t<!-- @slot This slot can be used to provide actions for each dashboard widget item. -->\n\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t<NcActionButton v-for=\"(m, menuItemId) in itemMenu\"\n\t\t\t\t\t\t:key=\"menuItemId\"\n\t\t\t\t\t\t:icon=\"m.icon\"\n\t\t\t\t\t\t:close-after-click=\"true\"\n\t\t\t\t\t\t@click.prevent.stop=\"$emit(menuItemId, item)\">\n\t\t\t\t\t\t{{ m.text }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</slot>\n\t\t\t</NcActions>\n\t\t</component>\n\t</div>\n</template>\n\n<script>\nimport NcAvatar from '../NcAvatar/index.js'\nimport NcActions from '../NcActions/index.js'\nimport NcActionButton from '../NcActionButton/index.js'\n\nexport default {\n\tname: 'NcDashboardWidgetItem',\n\tcomponents: {\n\t\tNcAvatar,\n\t\tNcActions,\n\t\tNcActionButton,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The item id (optional)\n\t\t */\n\t\tid: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * The item element is a link to this URL (optional)\n\t\t */\n\t\ttargetUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Where to get the avatar image. (optional) Used if avatarUsername is not defined.\n\t\t */\n\t\tavatarUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Name to provide to the Avatar. (optional) Used if avatarUrl is not defined.\n\t\t */\n\t\tavatarUsername: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Is the avatarUsername not a user's name? (optional, false by default)\n\t\t */\n\t\tavatarIsNoUser: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Small icon to display on the bottom-right corner of the avatar (optional)\n\t\t */\n\t\toverlayIconUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Item main text (mandatory)\n\t\t */\n\t\tmainText: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Item subline text (optional)\n\t\t */\n\t\tsubText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * An object containing context menu entries that will be displayed for each items (optional)\n\t\t */\n\t\titemMenu: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => { return {} },\n\t\t},\n\n\t\t/**\n\t\t * Specify whether the 3 dot menu is forced when only one action is present\n\t\t */\n\t\tforceMenu: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\thovered: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\titem() {\n\t\t\treturn {\n\t\t\t\tid: this.id,\n\t\t\t\ttargetUrl: this.targetUrl,\n\t\t\t\tavatarUrl: this.avatarUrl,\n\t\t\t\tavatarUsername: this.avatarUsername,\n\t\t\t\toverlayIconUrl: this.overlayIconUrl,\n\t\t\t\tmainText: this.mainText,\n\t\t\t\tsubText: this.subText,\n\t\t\t}\n\t\t},\n\t\tgotMenu() {\n\t\t\treturn Object.keys(this.itemMenu).length !== 0 || !!this.$slots.actions\n\t\t},\n\t\tgotOverlayIcon() {\n\t\t\treturn this.overlayIconUrl && this.overlayIconUrl !== ''\n\t\t},\n\t},\n\n\tmethods: {\n\t\tonLinkClick(event) {\n\t\t\tif (event.target.closest('.action-item')) {\n\t\t\t\tevent.preventDefault()\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.item-list__entry {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tposition: relative;\n\tpadding: 8px;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: var(--color-background-hover);\n\t\tborder-radius: var(--border-radius-large);\n\t}\n\t.item-avatar {\n\t\tposition: relative;\n\t\tmargin-top: auto;\n\t\tmargin-bottom: auto;\n\t}\n\t.item__details {\n\t\tpadding-left: 8px;\n\t\tmax-height: 44px;\n\t\tflex-grow: 1;\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\th3,\n\t\t.message {\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.message span {\n\t\t\twidth: 10px;\n\t\t\tdisplay: inline-block;\n\t\t\tmargin-bottom: -3px;\n\t\t}\n\t\th3 {\n\t\t\tfont-size: 100%;\n\t\t\tmargin: 0;\n\t\t}\n\t\t.message {\n\t\t\twidth: 100%;\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\n\t.item-icon {\n\t\tposition: relative;\n\t\twidth: 14px;\n\t\theight: 14px;\n\t\tmargin: 27px -3px 0px -7px;\n\t}\n\n\tbutton.primary {\n\t\tpadding: 21px;\n\t\tmargin: 0;\n\t}\n}\n/*\n.content-popover {\n\theight: 0px;\n\twidth: 0px;\n\tmargin-left: auto;\n\tmargin-right: auto;\n}\n.popover-container {\n\twidth: 100%;\n\theight: 0px;\n}\n*/\n</style>\n"],"names":["_sfc_main","NcAvatar","NcActions","NcActionButton","event"],"mappings":";;;;;AA+EA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,OAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,OAAA;AACA,aAAA;AAAA,QACA,IAAA,KAAA;AAAA,QACA,WAAA,KAAA;AAAA,QACA,WAAA,KAAA;AAAA,QACA,gBAAA,KAAA;AAAA,QACA,gBAAA,KAAA;AAAA,QACA,UAAA,KAAA;AAAA,QACA,SAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IACA,UAAA;AACA,aAAA,OAAA,KAAA,KAAA,QAAA,EAAA,WAAA,KAAA,CAAA,CAAA,KAAA,OAAA;AAAA,IACA;AAAA,IACA,iBAAA;AACA,aAAA,KAAA,kBAAA,KAAA,mBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,YAAAC,GAAA;AACA,MAAAA,EAAA,OAAA,QAAA,cAAA,KACAA,EAAA,eAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcDashboardWidgetItem.mjs","sources":["../../src/components/NcDashboardWidgetItem/NcDashboardWidgetItem.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 Julien Veyssier <eneiluj@posteo.net>\n -\n - @author Julien Veyssier <eneiluj@posteo.net>\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>\n\n### General description\n\nThis component is meant to be used inside a DashboardWidget component.\n\n</docs>\n\n<template>\n\t<div @mouseover=\"hovered = true\" @mouseleave=\"hovered = false\">\n\t\t<component :is=\"targetUrl ? 'a' : 'div'\"\n\t\t\t:href=\"targetUrl || undefined\"\n\t\t\t:target=\"targetUrl ? '_blank' : undefined\"\n\t\t\t:class=\"{ 'item-list__entry': true, 'item-list__entry--has-actions-menu': gotMenu }\"\n\t\t\t@click=\"onLinkClick\">\n\t\t\t<!-- @slot Slot for passing a user avatar. -->\n\t\t\t<slot name=\"avatar\" :avatar-url=\"avatarUrl\" :avatar-username=\"avatarUsername\">\n\t\t\t\t<NcAvatar class=\"item-avatar\"\n\t\t\t\t\t:size=\"44\"\n\t\t\t\t\t:url=\"avatarUrl\"\n\t\t\t\t\t:user=\"avatarUsername\"\n\t\t\t\t\t:is-no-user=\"avatarIsNoUser\"\n\t\t\t\t\t:show-user-status=\"!gotOverlayIcon\" />\n\t\t\t</slot>\n\t\t\t<img v-if=\"overlayIconUrl\"\n\t\t\t\tclass=\"item-icon\"\n\t\t\t\talt=\"\"\n\t\t\t\t:src=\"overlayIconUrl\">\n\t\t\t<div class=\"item__details\">\n\t\t\t\t<h3 :title=\"mainText\">\n\t\t\t\t\t{{ mainText }}\n\t\t\t\t</h3>\n\t\t\t\t<span class=\"message\" :title=\"subText\">\n\t\t\t\t\t{{ subText }}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<NcActions v-if=\"gotMenu\" :force-menu=\"forceMenu\">\n\t\t\t\t<!-- @slot This slot can be used to provide actions for each dashboard widget item. -->\n\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t<NcActionButton v-for=\"(m, menuItemId) in itemMenu\"\n\t\t\t\t\t\t:key=\"menuItemId\"\n\t\t\t\t\t\t:icon=\"m.icon\"\n\t\t\t\t\t\t:close-after-click=\"true\"\n\t\t\t\t\t\t@click.prevent.stop=\"$emit(menuItemId, item)\">\n\t\t\t\t\t\t{{ m.text }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</slot>\n\t\t\t</NcActions>\n\t\t</component>\n\t</div>\n</template>\n\n<script>\nimport NcAvatar from '../NcAvatar/index.js'\nimport NcActions from '../NcActions/index.js'\nimport NcActionButton from '../NcActionButton/index.js'\n\nexport default {\n\tname: 'NcDashboardWidgetItem',\n\tcomponents: {\n\t\tNcAvatar,\n\t\tNcActions,\n\t\tNcActionButton,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The item id (optional)\n\t\t */\n\t\tid: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * The item element is a link to this URL (optional)\n\t\t */\n\t\ttargetUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Where to get the avatar image. (optional) Used if avatarUsername is not defined.\n\t\t */\n\t\tavatarUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Name to provide to the Avatar. (optional) Used if avatarUrl is not defined.\n\t\t */\n\t\tavatarUsername: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Is the avatarUsername not a user's name? (optional, false by default)\n\t\t */\n\t\tavatarIsNoUser: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Small icon to display on the bottom-right corner of the avatar (optional)\n\t\t */\n\t\toverlayIconUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Item main text (mandatory)\n\t\t */\n\t\tmainText: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Item subline text (optional)\n\t\t */\n\t\tsubText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\t/**\n\t\t * An object containing context menu entries that will be displayed for each items (optional)\n\t\t */\n\t\titemMenu: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => { return {} },\n\t\t},\n\n\t\t/**\n\t\t * Specify whether the 3 dot menu is forced when only one action is present\n\t\t */\n\t\tforceMenu: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\thovered: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\titem() {\n\t\t\treturn {\n\t\t\t\tid: this.id,\n\t\t\t\ttargetUrl: this.targetUrl,\n\t\t\t\tavatarUrl: this.avatarUrl,\n\t\t\t\tavatarUsername: this.avatarUsername,\n\t\t\t\toverlayIconUrl: this.overlayIconUrl,\n\t\t\t\tmainText: this.mainText,\n\t\t\t\tsubText: this.subText,\n\t\t\t}\n\t\t},\n\t\tgotMenu() {\n\t\t\treturn Object.keys(this.itemMenu).length !== 0 || !!this.$slots.actions\n\t\t},\n\t\tgotOverlayIcon() {\n\t\t\treturn this.overlayIconUrl && this.overlayIconUrl !== ''\n\t\t},\n\t},\n\n\tmethods: {\n\t\tonLinkClick(event) {\n\t\t\tif (event.target.closest('.action-item')) {\n\t\t\t\tevent.preventDefault()\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.item-list__entry {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tposition: relative;\n\tpadding: 8px;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: var(--color-background-hover);\n\t\tborder-radius: var(--border-radius-large);\n\t}\n\t.item-avatar {\n\t\tposition: relative;\n\t\tmargin-top: auto;\n\t\tmargin-bottom: auto;\n\t}\n\t.item__details {\n\t\tpadding-left: 8px;\n\t\tmax-height: 44px;\n\t\tflex-grow: 1;\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\th3,\n\t\t.message {\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.message span {\n\t\t\twidth: 10px;\n\t\t\tdisplay: inline-block;\n\t\t\tmargin-bottom: -3px;\n\t\t}\n\t\th3 {\n\t\t\tfont-size: 100%;\n\t\t\tmargin: 0;\n\t\t}\n\t\t.message {\n\t\t\twidth: 100%;\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\t}\n\n\t.item-icon {\n\t\tposition: relative;\n\t\twidth: 14px;\n\t\theight: 14px;\n\t\tmargin: 27px -3px 0px -7px;\n\t}\n\n\tbutton.primary {\n\t\tpadding: 21px;\n\t\tmargin: 0;\n\t}\n}\n/*\n.content-popover {\n\theight: 0px;\n\twidth: 0px;\n\tmargin-left: auto;\n\tmargin-right: auto;\n}\n.popover-container {\n\twidth: 100%;\n\theight: 0px;\n}\n*/\n</style>\n"],"names":["_sfc_main","NcAvatar","NcActions","NcActionButton","event"],"mappings":";;;;;AA+EA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,OAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,OAAA;AACA,aAAA;AAAA,QACA,IAAA,KAAA;AAAA,QACA,WAAA,KAAA;AAAA,QACA,WAAA,KAAA;AAAA,QACA,gBAAA,KAAA;AAAA,QACA,gBAAA,KAAA;AAAA,QACA,UAAA,KAAA;AAAA,QACA,SAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IACA,UAAA;AACA,aAAA,OAAA,KAAA,KAAA,QAAA,EAAA,WAAA,KAAA,CAAA,CAAA,KAAA,OAAA;AAAA,IACA;AAAA,IACA,iBAAA;AACA,aAAA,KAAA,kBAAA,KAAA,mBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,YAAAC,GAAA;AACA,MAAAA,EAAA,OAAA,QAAA,cAAA,KACAA,EAAA,eAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const l = require("@nextcloud/l10n"), s = require("../chunks/l10n-903083c4.cjs"), m = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), d = {
2
+ const l = require("@nextcloud/l10n"), s = require("../chunks/l10n-b1d264c7.cjs"), m = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), d = {
3
3
  long: s.t("a few seconds ago"),
4
4
  short: s.t("seconds ago"),
5
5
  // FOR TRANSLATORS: Shorter version of 'a few seconds ago'
@@ -1,5 +1,5 @@
1
1
  import { getCanonicalLocale as m } from "@nextcloud/l10n";
2
- import { t as o } from "../chunks/l10n-27a75c40.mjs";
2
+ import { t as o } from "../chunks/l10n-05a09c66.mjs";
3
3
  import { n as l } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
4
4
  const d = {
5
5
  long: o("a few seconds ago"),
@@ -1,5 +1,5 @@
1
- var T = require("../assets/index-294382c8.css");
2
- const o = require("../chunks/l10n-903083c4.cjs"), p = require("./NcTimezonePicker.cjs"), d = require("./NcPopover.cjs"), m = require("../chunks/l10n-4326316a.cjs"), f = require("vue-material-design-icons/CalendarBlank.vue"), h = require("vue-material-design-icons/Web.vue"), r = require("@nextcloud/l10n"), _ = require("vue2-datepicker"), y = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), k = require("../chunks/ScopeComponent-1c75ec38.cjs"), l = (t) => t && t.__esModule ? t : { default: t }, v = /* @__PURE__ */ l(f), g = /* @__PURE__ */ l(h), w = /* @__PURE__ */ l(_);
1
+ var T = require("../assets/index-574438d6.css");
2
+ const o = require("../chunks/l10n-b1d264c7.cjs"), p = require("./NcTimezonePicker.cjs"), d = require("./NcPopover.cjs"), m = require("../chunks/l10n-c7bd0ea6.cjs"), f = require("vue-material-design-icons/CalendarBlank.vue"), h = require("vue-material-design-icons/Web.vue"), r = require("@nextcloud/l10n"), _ = require("vue2-datepicker"), y = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), k = require("../chunks/ScopeComponent-e060526a.cjs"), l = (t) => t && t.__esModule ? t : { default: t }, v = /* @__PURE__ */ l(f), g = /* @__PURE__ */ l(h), w = /* @__PURE__ */ l(_);
3
3
  const s = {
4
4
  date: "YYYY-MM-DD",
5
5
  datetime: "YYYY-MM-DD H:mm:ss",
@@ -1,14 +1,14 @@
1
- import "../assets/index-294382c8.css";
2
- import { t as r } from "../chunks/l10n-27a75c40.mjs";
1
+ import "../assets/index-574438d6.css";
2
+ import { t as r } from "../chunks/l10n-05a09c66.mjs";
3
3
  import s from "./NcTimezonePicker.mjs";
4
4
  import p from "./NcPopover.mjs";
5
- import { l as c } from "../chunks/l10n-c5f5f001.mjs";
5
+ import { l as c } from "../chunks/l10n-9aa6482d.mjs";
6
6
  import m from "vue-material-design-icons/CalendarBlank.vue";
7
7
  import u from "vue-material-design-icons/Web.vue";
8
8
  import { getMonthNames as d, getMonthNamesShort as f, getDayNames as h, getDayNamesShort as y, getDayNamesMin as _, getFirstDay as k } from "@nextcloud/l10n";
9
9
  import v from "vue2-datepicker";
10
10
  import { n as g } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
11
- import { S as w } from "../chunks/ScopeComponent-97a014a1.mjs";
11
+ import { S as w } from "../chunks/ScopeComponent-9519afcc.mjs";
12
12
  const l = {
13
13
  date: "YYYY-MM-DD",
14
14
  datetime: "YYYY-MM-DD H:mm:ss",
@@ -1,5 +1,5 @@
1
1
  var D = require("../assets/index-2d4de2fc.css");
2
- const p = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), h = require("../chunks/ScopeComponent-1c75ec38.cjs");
2
+ const p = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), h = require("../chunks/ScopeComponent-e060526a.cjs");
3
3
  const f = ["date", "datetime-local", "month", "time", "week"], y = {
4
4
  name: "NcDateTimePickerNative",
5
5
  inheritAttrs: !1,
@@ -1,6 +1,6 @@
1
1
  import "../assets/index-2d4de2fc.css";
2
2
  import { n as p } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
3
- import { S as c } from "../chunks/ScopeComponent-97a014a1.mjs";
3
+ import { S as c } from "../chunks/ScopeComponent-9519afcc.mjs";
4
4
  const f = ["date", "datetime-local", "month", "time", "week"], h = {
5
5
  name: "NcDateTimePickerNative",
6
6
  inheritAttrs: !1,
@@ -0,0 +1,171 @@
1
+ var b = require("../assets/index-dc612aa3.css");
2
+ const p = require("@vueuse/core"), n = require("vue"), f = require("./NcModal.cjs"), g = require("./NcDialogButton.cjs"), y = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs");
3
+ const v = n.defineComponent({
4
+ name: "NcDialog",
5
+ components: {
6
+ NcDialogButton: g,
7
+ NcModal: f
8
+ },
9
+ props: {
10
+ /** Name of the dialog (the heading) */
11
+ name: {
12
+ type: String,
13
+ required: !0
14
+ },
15
+ /** Text of the dialog */
16
+ message: {
17
+ type: String,
18
+ default: ""
19
+ },
20
+ /** Additional elements to add to the focus trap */
21
+ additionalTrapElements: {
22
+ type: Array,
23
+ validator: (a) => Array.isArray(a) && a.every((e) => typeof e == "string"),
24
+ default: () => []
25
+ },
26
+ /**
27
+ * The element where to mount the dialog, if `null` is passed the dialog is mounted in place
28
+ * @default 'body'
29
+ */
30
+ container: {
31
+ type: String,
32
+ required: !1,
33
+ default: "body"
34
+ },
35
+ /**
36
+ * Whether the dialog should be shown
37
+ * @default true
38
+ */
39
+ open: {
40
+ type: Boolean,
41
+ default: !0
42
+ },
43
+ /**
44
+ * Size of the underlying NcModal
45
+ * @default 'small'
46
+ * @values 'small', 'normal', 'large', 'full'
47
+ */
48
+ size: {
49
+ type: String,
50
+ required: !1,
51
+ default: "small",
52
+ validator: (a) => typeof a == "string" && ["small", "normal", "large", "full"].includes(a)
53
+ },
54
+ /**
55
+ * Buttons to display
56
+ * @default []
57
+ */
58
+ buttons: {
59
+ type: Array,
60
+ required: !1,
61
+ default: () => [],
62
+ validator: (a) => Array.isArray(a) && a.every((e) => typeof e == "object")
63
+ },
64
+ /**
65
+ * Set to false to no show a close button on the dialog
66
+ * @default true
67
+ */
68
+ canClose: {
69
+ type: Boolean,
70
+ default: !0
71
+ },
72
+ /**
73
+ * Declare if hiding the modal should be animated
74
+ * @default false
75
+ */
76
+ outTransition: {
77
+ type: Boolean,
78
+ default: !1
79
+ },
80
+ /**
81
+ * Optionally pass additionaly classes which will be set on the navigation for custom styling
82
+ * @default ''
83
+ * @example
84
+ * ```html
85
+ * <DialogBase :navigation-classes="['mydialog-navigation']"><!-- --></DialogBase>
86
+ * <!-- ... -->
87
+ * <style lang="scss">
88
+ * :deep(.mydialog-navigation) {
89
+ * flex-direction: row-reverse;
90
+ * }
91
+ * </style>
92
+ * ```
93
+ */
94
+ navigationClasses: {
95
+ type: [String, Array, Object],
96
+ required: !1,
97
+ default: ""
98
+ },
99
+ /**
100
+ * Optionally pass additionaly classes which will be set on the content wrapper for custom styling
101
+ * @default ''
102
+ */
103
+ contentClasses: {
104
+ type: [String, Array, Object],
105
+ required: !1,
106
+ default: ""
107
+ },
108
+ /**
109
+ * Optionally pass additionaly classes which will be set on the dialog itself
110
+ * (the default `class` attribute will be set on the modal wrapper)
111
+ * @default ''
112
+ */
113
+ dialogClasses: {
114
+ type: [String, Array, Object],
115
+ required: !1,
116
+ default: ""
117
+ }
118
+ },
119
+ emits: ["closing", "update:open"],
120
+ setup(a, { emit: e, slots: t }) {
121
+ const o = n.ref(), { width: s } = p.useElementSize(o), c = n.computed(() => s.value < 876), d = n.computed(() => (t == null ? void 0 : t.navigation) !== void 0), l = n.ref(!0), u = () => {
122
+ i(), window.setTimeout(() => r(), 300);
123
+ }, i = () => {
124
+ l.value = !1, e("closing");
125
+ }, r = () => {
126
+ l.value = !0, e("update:open", !1);
127
+ }, _ = n.computed(() => ({
128
+ canClose: a.canClose,
129
+ container: a.container === void 0 ? "body" : a.container,
130
+ // we do not pass the name as we already have the name as the headline
131
+ // name: props.name,
132
+ size: a.size,
133
+ show: a.open && l.value,
134
+ outTransition: a.outTransition,
135
+ class: "dialog__modal",
136
+ closeOnClickOutside: !1,
137
+ enableSlideshow: !1,
138
+ enableSwipe: !1
139
+ }));
140
+ return {
141
+ handleButtonClose: u,
142
+ handleClosing: i,
143
+ handleClosed: r,
144
+ hasNavigation: d,
145
+ isNavigationCollapsed: c,
146
+ modalProps: _,
147
+ wrapper: o
148
+ };
149
+ }
150
+ });
151
+ var m = function() {
152
+ var e = this, t = e._self._c;
153
+ return e._self._setupProxy, e.open ? t("NcModal", e._b({ on: { close: e.handleClosed, "update:show": e.handleClosing } }, "NcModal", e.modalProps, !1), [t("h2", { staticClass: "dialog__name", domProps: { textContent: e._s(e.name) } }), t("div", { staticClass: "dialog", class: e.dialogClasses }, [t("div", { ref: "wrapper", class: ["dialog__wrapper", { "dialog__wrapper--collapsed": e.isNavigationCollapsed }] }, [e.hasNavigation ? t("nav", { staticClass: "dialog__navigation", class: e.navigationClasses }, [e._t("navigation", null, { isCollapsed: e.isNavigationCollapsed })], 2) : e._e(), t("div", { staticClass: "dialog__content", class: e.contentClasses }, [e._t("default", function() {
154
+ return [t("p", [e._v(e._s(e.message))])];
155
+ })], 2)]), t("div", { staticClass: "dialog__actions" }, [e._t("actions", function() {
156
+ return e._l(e.buttons, function(o, s) {
157
+ return t("NcDialogButton", e._b({ key: s, on: { click: e.handleButtonClose } }, "NcDialogButton", o, !1));
158
+ });
159
+ })], 2)])]) : e._e();
160
+ }, C = [], N = /* @__PURE__ */ y.normalizeComponent(
161
+ v,
162
+ m,
163
+ C,
164
+ !1,
165
+ null,
166
+ "cf1c45bf",
167
+ null,
168
+ null
169
+ );
170
+ const h = N.exports;
171
+ module.exports = h;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NcDialog.cjs","sources":["../../src/components/NcDialog/NcDialog.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2023 Ferdinand Thiessen\n -\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n### General description\n\nThis component uses the `NcModal` under the hood for allowing users to create generic dialogs.\n\n### Basic example\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showDialog = true\">Show dialog</NcButton>\n\t\t<NcDialog :open.sync=\"showDialog\" name=\"Confirmation\" message=\"Are you sure to proceed?\" :buttons=\"buttons\" />\n\t\t<p>Last response: {{ lastResponse }}</p>\n\t</div>\n</template>\n<script>\nimport IconCancel from '@mdi/svg/svg/cancel.svg?raw'\nimport IconCheck from '@mdi/svg/svg/check.svg?raw'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t\tlastResponse: 'None',\n\t\t\tbuttons: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Ok',\n\t\t\t\t\ttype: 'primary',\n\t\t\t\t\ticon: IconCheck,\n\t\t\t\t\tcallback: () => { this.lastResponse = 'Pressed \"Ok\"' },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Cancel',\n\t\t\t\t\ticon: IconCancel,\n\t\t\t\t\tcallback: () => { this.lastResponse = 'Pressed \"Cancel\"' },\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t},\n}\n</script>\n```\n\n### Use custom actions and content\nInstead of using the buttons property, you can also inject your custom actions using a named slot.\nYou can also use the default slot to inject custom content.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showDialog = true\">Show dialog</NcButton>\n\t\t<NcDialog v-if=\"showDialog\" name=\"Warning\" :can-close=\"false\">\n\t\t\t<template #actions>\n\t\t\t\t<NcButton @click=\"showDialog = false\">Ok</NcButton>\n\t\t\t</template>\n\t\t\t<div style=\"color: red; font-weight: bold;\">This is serious</div>\n\t\t</NcDialog>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcModal v-if=\"open\"\n\t\tv-bind=\"modalProps\"\n\t\t@close=\"handleClosed\"\n\t\t@update:show=\"handleClosing\">\n\t\t<!-- The dialog name / header -->\n\t\t<h2 class=\"dialog__name\" v-text=\"name\" />\n\t\t<div class=\"dialog\" :class=\"dialogClasses\">\n\t\t\t<div ref=\"wrapper\" :class=\"['dialog__wrapper', { 'dialog__wrapper--collapsed': isNavigationCollapsed }]\">\n\t\t\t\t<!-- When the navigation is collapsed (too small dialog) it is displayed above the main content, otherwise on the inline start -->\n\t\t\t\t<nav v-if=\"hasNavigation\" class=\"dialog__navigation\" :class=\"navigationClasses\">\n\t\t\t\t\t<slot name=\"navigation\" :is-collapsed=\"isNavigationCollapsed\" />\n\t\t\t\t</nav>\n\t\t\t\t<!-- Main dialog content -->\n\t\t\t\t<div class=\"dialog__content\" :class=\"contentClasses\">\n\t\t\t\t\t<slot>\n\t\t\t\t\t\t<p>{{ message }}</p>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!-- The dialog actions aka the buttons -->\n\t\t\t<div class=\"dialog__actions\">\n\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t<NcDialogButton v-for=\"(button, idx) in buttons\"\n\t\t\t\t\t\t:key=\"idx\"\n\t\t\t\t\t\tv-bind=\"button\"\n\t\t\t\t\t\t@click=\"handleButtonClose\" />\n\t\t\t\t</slot>\n\t\t\t</div>\n\t\t</div>\n\t</NcModal>\n</template>\n\n<script>\nimport { useElementSize } from '@vueuse/core'\nimport { computed, defineComponent, ref } from 'vue'\n\nimport NcModal from '../NcModal/index.js'\nimport NcDialogButton from '../NcDialogButton/index.js'\n\nexport default defineComponent({\n\tname: 'NcDialog',\n\n\tcomponents: {\n\t\tNcDialogButton,\n\t\tNcModal,\n\t},\n\n\tprops: {\n\t\t/** Name of the dialog (the heading) */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Text of the dialog */\n\t\tmessage: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Additional elements to add to the focus trap */\n\t\tadditionalTrapElements: {\n\t\t\ttype: Array,\n\t\t\tvalidator: (arr) => Array.isArray(arr) && arr.every((element) => typeof element === 'string'),\n\t\t\tdefault: () => ([]),\n\t\t},\n\n\t\t/**\n\t\t * The element where to mount the dialog, if `null` is passed the dialog is mounted in place\n\t\t * @default 'body'\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Whether the dialog should be shown\n\t\t * @default true\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Size of the underlying NcModal\n\t\t * @default 'small'\n\t\t * @values 'small', 'normal', 'large', 'full'\n\t\t */\n\t\tsize: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: 'small',\n\t\t\tvalidator: (value) => typeof value === 'string' && ['small', 'normal', 'large', 'full'].includes(value),\n\t\t},\n\n\t\t/**\n\t\t * Buttons to display\n\t\t * @default []\n\t\t */\n\t\tbuttons: {\n\t\t\ttype: Array,\n\t\t\trequired: false,\n\t\t\tdefault: () => ([]),\n\t\t\tvalidator: (value) => Array.isArray(value) && value.every((element) => typeof element === 'object'),\n\t\t},\n\n\t\t/**\n\t\t * Set to false to no show a close button on the dialog\n\t\t * @default true\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 * Declare if hiding the modal should be animated\n\t\t * @default false\n\t\t */\n\t\toutTransition: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Optionally pass additionaly classes which will be set on the navigation for custom styling\n\t\t * @default ''\n\t\t * @example\n\t\t * ```html\n\t\t * <DialogBase :navigation-classes=\"['mydialog-navigation']\"><!-- --></DialogBase>\n\t\t * <!-- ... -->\n\t\t * <style lang=\"scss\">\n\t\t * :deep(.mydialog-navigation) {\n\t\t * flex-direction: row-reverse;\n\t\t * }\n\t\t * </style>\n\t\t * ```\n\t\t */\n\t\tnavigationClasses: {\n\t\t\ttype: [String, Array, Object],\n\t\t\trequired: false,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Optionally pass additionaly classes which will be set on the content wrapper for custom styling\n\t\t * @default ''\n\t\t */\n\t\tcontentClasses: {\n\t\t\ttype: [String, Array, Object],\n\t\t\trequired: false,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Optionally pass additionaly classes which will be set on the dialog itself\n\t\t * (the default `class` attribute will be set on the modal wrapper)\n\t\t * @default ''\n\t\t */\n\t\tdialogClasses: {\n\t\t\ttype: [String, Array, Object],\n\t\t\trequired: false,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['closing', 'update:open'],\n\n\tsetup(props, { emit, slots }) {\n\t\t/**\n\t\t * The dialog wrapper element\n\t\t * @type {import('vue').Ref<HTMLDivElement>}\n\t\t */\n\t\tconst wrapper = ref()\n\n\t\t/**\n\t\t * We use the dialog width to decide if we collapse the navigation (flex direction row)\n\t\t */\n\t\tconst { width: dialogWidth } = useElementSize(wrapper)\n\n\t\t/**\n\t\t * Whether the navigation is collapsed due to dialog and window size\n\t\t * (collapses when modal is below: 900px modal width - 2x 12px margin)\n\t\t */\n\t\tconst isNavigationCollapsed = computed(() => dialogWidth.value < 876)\n\n\t\t/**\n\t\t * Whether a navigation was passed and the element should be displayed\n\t\t */\n\t\tconst hasNavigation = computed(() => slots?.navigation !== undefined)\n\n\t\t/**\n\t\t * If the underlaying modal is shown\n\t\t */\n\t\tconst showModal = ref(true)\n\n\t\t// Because NcModal does not emit `close` when show prop is changed\n\t\t/**\n\t\t * Handle clicking a dialog button -> should close\n\t\t */\n\t\tconst handleButtonClose = () => {\n\t\t\thandleClosing()\n\t\t\twindow.setTimeout(() => handleClosed(), 300)\n\t\t}\n\n\t\t/**\n\t\t * Handle closing the dialog, optional out transition did not run yet\n\t\t */\n\t\tconst handleClosing = () => {\n\t\t\tshowModal.value = false\n\t\t\t/**\n\t\t\t * Emitted when the dialog is closing, so the out transition did not finish yet\n\t\t\t */\n\t\t\temit('closing')\n\t\t}\n\n\t\t/**\n\t\t * Handle dialog closed (out transition finished)\n\t\t */\n\t\tconst handleClosed = () => {\n\t\t\tshowModal.value = true\n\t\t\t/**\n\t\t\t * Emitted then the dialog is fully closed and the out transition run\n\t\t\t */\n\t\t\temit('update:open', false)\n\t\t}\n\n\t\t/**\n\t\t * Properties to pass to the underlying NcModal\n\t\t */\n\t\tconst modalProps = computed(() => ({\n\t\t\tcanClose: props.canClose,\n\t\t\tcontainer: props.container === undefined ? 'body' : props.container,\n\t\t\t// we do not pass the name as we already have the name as the headline\n\t\t\t// name: props.name,\n\t\t\tsize: props.size,\n\t\t\tshow: props.open && showModal.value,\n\t\t\toutTransition: props.outTransition,\n\t\t\tclass: 'dialog__modal',\n\t\t\tcloseOnClickOutside: false,\n\t\t\tenableSlideshow: false,\n\t\t\tenableSwipe: false,\n\t\t}))\n\n\t\treturn {\n\t\t\thandleButtonClose,\n\t\t\thandleClosing,\n\t\t\thandleClosed,\n\t\t\thasNavigation,\n\t\t\tisNavigationCollapsed,\n\t\t\tmodalProps,\n\t\t\twrapper,\n\t\t}\n\t},\n})\n</script>\n\n<style lang=\"scss\">\n/** When having the small dialog style we override the modal styling so dialogs look more dialog like */\n@media only screen and (max-width: math.div($breakpoint-mobile, 2)) {\n\t.dialog__modal .modal-wrapper--small .modal-container {\n\t\twidth: fit-content;\n\t\theight: unset;\n\t\tmax-height: 90%;\n\t\tposition: relative;\n\t\ttop: unset;\n\t\tborder-radius: var(--border-radius-large);\n\t}\n}\n</style>\n\n<style lang=\"scss\" scoped>\n.dialog {\n\theight: 100%;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\toverflow: hidden;\n\n\t&__modal {\n\t\t:deep(.modal-container) {\n\t\t\tdisplay: flex !important;\n\t\t\tpadding-block: 4px 8px; // 4px to align with close button, 8px block-end to allow the actions a margin of 4px for the focus visible outline\n\t\t\tpadding-inline: 12px 8px; // Same as with padding-block, we need the actions to have a margin of 4px for the button outline\n\t\t}\n\t\t:deep(.modal-container__content) {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t}\n\t}\n\n\t&__wrapper {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\t// Auto scale to fit\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: hidden;\n\t\t// see modal-container padding, this aligns with the padding-inline-start (8px + 4px = 12px)\n\t\tpadding-inline-end: 4px;\n\n\t\t&--collapsed {\n\t\t\tflex-direction: column;\n\t\t}\n\t}\n\n\t&__navigation {\n\t\tdisplay: flex;\n\t\tflex-shrink: 0;\n\t}\n\n\t// Navigation styling when side-by-side with content\n\t&__wrapper:not(&__wrapper--collapsed) &__navigation {\n\t\tflex-direction: column;\n\n\t\toverflow: hidden auto;\n\t\theight: 100%;\n\t\tmin-width: 200px;\n\t\tmargin-inline-end: 20px;\n\t}\n\n\t// Navigation styling when on top of content\n\t&__wrapper#{&}__wrapper--collapsed &__navigation {\n\t\tflex-direction: row;\n\t\tjustify-content: space-between;\n\n\t\toverflow: auto hidden;\n\t\twidth: 100%;\n\t\tmin-width: 100%;\n\t}\n\n\t&__name {\n\t\t// Same as the NcAppSettingsDialog\n\t\ttext-align: center;\n\t\theight: var(--default-clickable-area);\n\t\tmin-height: var(--default-clickable-area);\n\t\tline-height: var(--default-clickable-area);\n\t\tmargin-block-end: 12px;\n\t}\n\n\t&__content {\n\t\t// Auto fit\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: auto;\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t\talign-content: center;\n\t\twidth: fit-content;\n\t\tmargin-inline: auto 4px; // 4px to align with the overall modal padding, we need this here for the buttons to have their 4px focus-visible outline\n\t\tmargin-block: 6px 4px; // 4px block-end see reason above\n\t}\n}\n</style>\n"],"names":["_sfc_main","Vue","Components_NcDialogButton","Components_NcModal","arr","element","value","props","emit","slots","wrapper","dialogWidth","core","isNavigationCollapsed","hasNavigation","showModal","handleButtonClose","handleClosing","handleClosed","modalProps"],"mappings":"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"}
@@ -0,0 +1,177 @@
1
+ import "../assets/index-dc612aa3.css";
2
+ import { useElementSize as p } from "@vueuse/core";
3
+ import { defineComponent as g, ref as d, computed as s } from "vue";
4
+ import m from "./NcModal.mjs";
5
+ import y from "./NcDialogButton.mjs";
6
+ import { n as v } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
7
+ const C = g({
8
+ name: "NcDialog",
9
+ components: {
10
+ NcDialogButton: y,
11
+ NcModal: m
12
+ },
13
+ props: {
14
+ /** Name of the dialog (the heading) */
15
+ name: {
16
+ type: String,
17
+ required: !0
18
+ },
19
+ /** Text of the dialog */
20
+ message: {
21
+ type: String,
22
+ default: ""
23
+ },
24
+ /** Additional elements to add to the focus trap */
25
+ additionalTrapElements: {
26
+ type: Array,
27
+ validator: (a) => Array.isArray(a) && a.every((e) => typeof e == "string"),
28
+ default: () => []
29
+ },
30
+ /**
31
+ * The element where to mount the dialog, if `null` is passed the dialog is mounted in place
32
+ * @default 'body'
33
+ */
34
+ container: {
35
+ type: String,
36
+ required: !1,
37
+ default: "body"
38
+ },
39
+ /**
40
+ * Whether the dialog should be shown
41
+ * @default true
42
+ */
43
+ open: {
44
+ type: Boolean,
45
+ default: !0
46
+ },
47
+ /**
48
+ * Size of the underlying NcModal
49
+ * @default 'small'
50
+ * @values 'small', 'normal', 'large', 'full'
51
+ */
52
+ size: {
53
+ type: String,
54
+ required: !1,
55
+ default: "small",
56
+ validator: (a) => typeof a == "string" && ["small", "normal", "large", "full"].includes(a)
57
+ },
58
+ /**
59
+ * Buttons to display
60
+ * @default []
61
+ */
62
+ buttons: {
63
+ type: Array,
64
+ required: !1,
65
+ default: () => [],
66
+ validator: (a) => Array.isArray(a) && a.every((e) => typeof e == "object")
67
+ },
68
+ /**
69
+ * Set to false to no show a close button on the dialog
70
+ * @default true
71
+ */
72
+ canClose: {
73
+ type: Boolean,
74
+ default: !0
75
+ },
76
+ /**
77
+ * Declare if hiding the modal should be animated
78
+ * @default false
79
+ */
80
+ outTransition: {
81
+ type: Boolean,
82
+ default: !1
83
+ },
84
+ /**
85
+ * Optionally pass additionaly classes which will be set on the navigation for custom styling
86
+ * @default ''
87
+ * @example
88
+ * ```html
89
+ * <DialogBase :navigation-classes="['mydialog-navigation']"><!-- --></DialogBase>
90
+ * <!-- ... -->
91
+ * <style lang="scss">
92
+ * :deep(.mydialog-navigation) {
93
+ * flex-direction: row-reverse;
94
+ * }
95
+ * </style>
96
+ * ```
97
+ */
98
+ navigationClasses: {
99
+ type: [String, Array, Object],
100
+ required: !1,
101
+ default: ""
102
+ },
103
+ /**
104
+ * Optionally pass additionaly classes which will be set on the content wrapper for custom styling
105
+ * @default ''
106
+ */
107
+ contentClasses: {
108
+ type: [String, Array, Object],
109
+ required: !1,
110
+ default: ""
111
+ },
112
+ /**
113
+ * Optionally pass additionaly classes which will be set on the dialog itself
114
+ * (the default `class` attribute will be set on the modal wrapper)
115
+ * @default ''
116
+ */
117
+ dialogClasses: {
118
+ type: [String, Array, Object],
119
+ required: !1,
120
+ default: ""
121
+ }
122
+ },
123
+ emits: ["closing", "update:open"],
124
+ setup(a, { emit: e, slots: t }) {
125
+ const n = d(), { width: o } = p(n), c = s(() => o.value < 876), u = s(() => (t == null ? void 0 : t.navigation) !== void 0), l = d(!0), _ = () => {
126
+ i(), window.setTimeout(() => r(), 300);
127
+ }, i = () => {
128
+ l.value = !1, e("closing");
129
+ }, r = () => {
130
+ l.value = !0, e("update:open", !1);
131
+ }, f = s(() => ({
132
+ canClose: a.canClose,
133
+ container: a.container === void 0 ? "body" : a.container,
134
+ // we do not pass the name as we already have the name as the headline
135
+ // name: props.name,
136
+ size: a.size,
137
+ show: a.open && l.value,
138
+ outTransition: a.outTransition,
139
+ class: "dialog__modal",
140
+ closeOnClickOutside: !1,
141
+ enableSlideshow: !1,
142
+ enableSwipe: !1
143
+ }));
144
+ return {
145
+ handleButtonClose: _,
146
+ handleClosing: i,
147
+ handleClosed: r,
148
+ hasNavigation: u,
149
+ isNavigationCollapsed: c,
150
+ modalProps: f,
151
+ wrapper: n
152
+ };
153
+ }
154
+ });
155
+ var h = function() {
156
+ var e = this, t = e._self._c;
157
+ return e._self._setupProxy, e.open ? t("NcModal", e._b({ on: { close: e.handleClosed, "update:show": e.handleClosing } }, "NcModal", e.modalProps, !1), [t("h2", { staticClass: "dialog__name", domProps: { textContent: e._s(e.name) } }), t("div", { staticClass: "dialog", class: e.dialogClasses }, [t("div", { ref: "wrapper", class: ["dialog__wrapper", { "dialog__wrapper--collapsed": e.isNavigationCollapsed }] }, [e.hasNavigation ? t("nav", { staticClass: "dialog__navigation", class: e.navigationClasses }, [e._t("navigation", null, { isCollapsed: e.isNavigationCollapsed })], 2) : e._e(), t("div", { staticClass: "dialog__content", class: e.contentClasses }, [e._t("default", function() {
158
+ return [t("p", [e._v(e._s(e.message))])];
159
+ })], 2)]), t("div", { staticClass: "dialog__actions" }, [e._t("actions", function() {
160
+ return e._l(e.buttons, function(n, o) {
161
+ return t("NcDialogButton", e._b({ key: o, on: { click: e.handleButtonClose } }, "NcDialogButton", n, !1));
162
+ });
163
+ })], 2)])]) : e._e();
164
+ }, N = [], b = /* @__PURE__ */ v(
165
+ C,
166
+ h,
167
+ N,
168
+ !1,
169
+ null,
170
+ "cf1c45bf",
171
+ null,
172
+ null
173
+ );
174
+ const x = b.exports;
175
+ export {
176
+ x as default
177
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NcDialog.mjs","sources":["../../src/components/NcDialog/NcDialog.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2023 Ferdinand Thiessen\n -\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n### General description\n\nThis component uses the `NcModal` under the hood for allowing users to create generic dialogs.\n\n### Basic example\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showDialog = true\">Show dialog</NcButton>\n\t\t<NcDialog :open.sync=\"showDialog\" name=\"Confirmation\" message=\"Are you sure to proceed?\" :buttons=\"buttons\" />\n\t\t<p>Last response: {{ lastResponse }}</p>\n\t</div>\n</template>\n<script>\nimport IconCancel from '@mdi/svg/svg/cancel.svg?raw'\nimport IconCheck from '@mdi/svg/svg/check.svg?raw'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t\tlastResponse: 'None',\n\t\t\tbuttons: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Ok',\n\t\t\t\t\ttype: 'primary',\n\t\t\t\t\ticon: IconCheck,\n\t\t\t\t\tcallback: () => { this.lastResponse = 'Pressed \"Ok\"' },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Cancel',\n\t\t\t\t\ticon: IconCancel,\n\t\t\t\t\tcallback: () => { this.lastResponse = 'Pressed \"Cancel\"' },\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t},\n}\n</script>\n```\n\n### Use custom actions and content\nInstead of using the buttons property, you can also inject your custom actions using a named slot.\nYou can also use the default slot to inject custom content.\n\n```vue\n<template>\n\t<div>\n\t\t<NcButton @click=\"showDialog = true\">Show dialog</NcButton>\n\t\t<NcDialog v-if=\"showDialog\" name=\"Warning\" :can-close=\"false\">\n\t\t\t<template #actions>\n\t\t\t\t<NcButton @click=\"showDialog = false\">Ok</NcButton>\n\t\t\t</template>\n\t\t\t<div style=\"color: red; font-weight: bold;\">This is serious</div>\n\t\t</NcDialog>\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tshowDialog: false,\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcModal v-if=\"open\"\n\t\tv-bind=\"modalProps\"\n\t\t@close=\"handleClosed\"\n\t\t@update:show=\"handleClosing\">\n\t\t<!-- The dialog name / header -->\n\t\t<h2 class=\"dialog__name\" v-text=\"name\" />\n\t\t<div class=\"dialog\" :class=\"dialogClasses\">\n\t\t\t<div ref=\"wrapper\" :class=\"['dialog__wrapper', { 'dialog__wrapper--collapsed': isNavigationCollapsed }]\">\n\t\t\t\t<!-- When the navigation is collapsed (too small dialog) it is displayed above the main content, otherwise on the inline start -->\n\t\t\t\t<nav v-if=\"hasNavigation\" class=\"dialog__navigation\" :class=\"navigationClasses\">\n\t\t\t\t\t<slot name=\"navigation\" :is-collapsed=\"isNavigationCollapsed\" />\n\t\t\t\t</nav>\n\t\t\t\t<!-- Main dialog content -->\n\t\t\t\t<div class=\"dialog__content\" :class=\"contentClasses\">\n\t\t\t\t\t<slot>\n\t\t\t\t\t\t<p>{{ message }}</p>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!-- The dialog actions aka the buttons -->\n\t\t\t<div class=\"dialog__actions\">\n\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t<NcDialogButton v-for=\"(button, idx) in buttons\"\n\t\t\t\t\t\t:key=\"idx\"\n\t\t\t\t\t\tv-bind=\"button\"\n\t\t\t\t\t\t@click=\"handleButtonClose\" />\n\t\t\t\t</slot>\n\t\t\t</div>\n\t\t</div>\n\t</NcModal>\n</template>\n\n<script>\nimport { useElementSize } from '@vueuse/core'\nimport { computed, defineComponent, ref } from 'vue'\n\nimport NcModal from '../NcModal/index.js'\nimport NcDialogButton from '../NcDialogButton/index.js'\n\nexport default defineComponent({\n\tname: 'NcDialog',\n\n\tcomponents: {\n\t\tNcDialogButton,\n\t\tNcModal,\n\t},\n\n\tprops: {\n\t\t/** Name of the dialog (the heading) */\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Text of the dialog */\n\t\tmessage: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Additional elements to add to the focus trap */\n\t\tadditionalTrapElements: {\n\t\t\ttype: Array,\n\t\t\tvalidator: (arr) => Array.isArray(arr) && arr.every((element) => typeof element === 'string'),\n\t\t\tdefault: () => ([]),\n\t\t},\n\n\t\t/**\n\t\t * The element where to mount the dialog, if `null` is passed the dialog is mounted in place\n\t\t * @default 'body'\n\t\t */\n\t\tcontainer: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: 'body',\n\t\t},\n\n\t\t/**\n\t\t * Whether the dialog should be shown\n\t\t * @default true\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Size of the underlying NcModal\n\t\t * @default 'small'\n\t\t * @values 'small', 'normal', 'large', 'full'\n\t\t */\n\t\tsize: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: 'small',\n\t\t\tvalidator: (value) => typeof value === 'string' && ['small', 'normal', 'large', 'full'].includes(value),\n\t\t},\n\n\t\t/**\n\t\t * Buttons to display\n\t\t * @default []\n\t\t */\n\t\tbuttons: {\n\t\t\ttype: Array,\n\t\t\trequired: false,\n\t\t\tdefault: () => ([]),\n\t\t\tvalidator: (value) => Array.isArray(value) && value.every((element) => typeof element === 'object'),\n\t\t},\n\n\t\t/**\n\t\t * Set to false to no show a close button on the dialog\n\t\t * @default true\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 * Declare if hiding the modal should be animated\n\t\t * @default false\n\t\t */\n\t\toutTransition: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Optionally pass additionaly classes which will be set on the navigation for custom styling\n\t\t * @default ''\n\t\t * @example\n\t\t * ```html\n\t\t * <DialogBase :navigation-classes=\"['mydialog-navigation']\"><!-- --></DialogBase>\n\t\t * <!-- ... -->\n\t\t * <style lang=\"scss\">\n\t\t * :deep(.mydialog-navigation) {\n\t\t * flex-direction: row-reverse;\n\t\t * }\n\t\t * </style>\n\t\t * ```\n\t\t */\n\t\tnavigationClasses: {\n\t\t\ttype: [String, Array, Object],\n\t\t\trequired: false,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Optionally pass additionaly classes which will be set on the content wrapper for custom styling\n\t\t * @default ''\n\t\t */\n\t\tcontentClasses: {\n\t\t\ttype: [String, Array, Object],\n\t\t\trequired: false,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Optionally pass additionaly classes which will be set on the dialog itself\n\t\t * (the default `class` attribute will be set on the modal wrapper)\n\t\t * @default ''\n\t\t */\n\t\tdialogClasses: {\n\t\t\ttype: [String, Array, Object],\n\t\t\trequired: false,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['closing', 'update:open'],\n\n\tsetup(props, { emit, slots }) {\n\t\t/**\n\t\t * The dialog wrapper element\n\t\t * @type {import('vue').Ref<HTMLDivElement>}\n\t\t */\n\t\tconst wrapper = ref()\n\n\t\t/**\n\t\t * We use the dialog width to decide if we collapse the navigation (flex direction row)\n\t\t */\n\t\tconst { width: dialogWidth } = useElementSize(wrapper)\n\n\t\t/**\n\t\t * Whether the navigation is collapsed due to dialog and window size\n\t\t * (collapses when modal is below: 900px modal width - 2x 12px margin)\n\t\t */\n\t\tconst isNavigationCollapsed = computed(() => dialogWidth.value < 876)\n\n\t\t/**\n\t\t * Whether a navigation was passed and the element should be displayed\n\t\t */\n\t\tconst hasNavigation = computed(() => slots?.navigation !== undefined)\n\n\t\t/**\n\t\t * If the underlaying modal is shown\n\t\t */\n\t\tconst showModal = ref(true)\n\n\t\t// Because NcModal does not emit `close` when show prop is changed\n\t\t/**\n\t\t * Handle clicking a dialog button -> should close\n\t\t */\n\t\tconst handleButtonClose = () => {\n\t\t\thandleClosing()\n\t\t\twindow.setTimeout(() => handleClosed(), 300)\n\t\t}\n\n\t\t/**\n\t\t * Handle closing the dialog, optional out transition did not run yet\n\t\t */\n\t\tconst handleClosing = () => {\n\t\t\tshowModal.value = false\n\t\t\t/**\n\t\t\t * Emitted when the dialog is closing, so the out transition did not finish yet\n\t\t\t */\n\t\t\temit('closing')\n\t\t}\n\n\t\t/**\n\t\t * Handle dialog closed (out transition finished)\n\t\t */\n\t\tconst handleClosed = () => {\n\t\t\tshowModal.value = true\n\t\t\t/**\n\t\t\t * Emitted then the dialog is fully closed and the out transition run\n\t\t\t */\n\t\t\temit('update:open', false)\n\t\t}\n\n\t\t/**\n\t\t * Properties to pass to the underlying NcModal\n\t\t */\n\t\tconst modalProps = computed(() => ({\n\t\t\tcanClose: props.canClose,\n\t\t\tcontainer: props.container === undefined ? 'body' : props.container,\n\t\t\t// we do not pass the name as we already have the name as the headline\n\t\t\t// name: props.name,\n\t\t\tsize: props.size,\n\t\t\tshow: props.open && showModal.value,\n\t\t\toutTransition: props.outTransition,\n\t\t\tclass: 'dialog__modal',\n\t\t\tcloseOnClickOutside: false,\n\t\t\tenableSlideshow: false,\n\t\t\tenableSwipe: false,\n\t\t}))\n\n\t\treturn {\n\t\t\thandleButtonClose,\n\t\t\thandleClosing,\n\t\t\thandleClosed,\n\t\t\thasNavigation,\n\t\t\tisNavigationCollapsed,\n\t\t\tmodalProps,\n\t\t\twrapper,\n\t\t}\n\t},\n})\n</script>\n\n<style lang=\"scss\">\n/** When having the small dialog style we override the modal styling so dialogs look more dialog like */\n@media only screen and (max-width: math.div($breakpoint-mobile, 2)) {\n\t.dialog__modal .modal-wrapper--small .modal-container {\n\t\twidth: fit-content;\n\t\theight: unset;\n\t\tmax-height: 90%;\n\t\tposition: relative;\n\t\ttop: unset;\n\t\tborder-radius: var(--border-radius-large);\n\t}\n}\n</style>\n\n<style lang=\"scss\" scoped>\n.dialog {\n\theight: 100%;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\toverflow: hidden;\n\n\t&__modal {\n\t\t:deep(.modal-container) {\n\t\t\tdisplay: flex !important;\n\t\t\tpadding-block: 4px 8px; // 4px to align with close button, 8px block-end to allow the actions a margin of 4px for the focus visible outline\n\t\t\tpadding-inline: 12px 8px; // Same as with padding-block, we need the actions to have a margin of 4px for the button outline\n\t\t}\n\t\t:deep(.modal-container__content) {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t}\n\t}\n\n\t&__wrapper {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\t// Auto scale to fit\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: hidden;\n\t\t// see modal-container padding, this aligns with the padding-inline-start (8px + 4px = 12px)\n\t\tpadding-inline-end: 4px;\n\n\t\t&--collapsed {\n\t\t\tflex-direction: column;\n\t\t}\n\t}\n\n\t&__navigation {\n\t\tdisplay: flex;\n\t\tflex-shrink: 0;\n\t}\n\n\t// Navigation styling when side-by-side with content\n\t&__wrapper:not(&__wrapper--collapsed) &__navigation {\n\t\tflex-direction: column;\n\n\t\toverflow: hidden auto;\n\t\theight: 100%;\n\t\tmin-width: 200px;\n\t\tmargin-inline-end: 20px;\n\t}\n\n\t// Navigation styling when on top of content\n\t&__wrapper#{&}__wrapper--collapsed &__navigation {\n\t\tflex-direction: row;\n\t\tjustify-content: space-between;\n\n\t\toverflow: auto hidden;\n\t\twidth: 100%;\n\t\tmin-width: 100%;\n\t}\n\n\t&__name {\n\t\t// Same as the NcAppSettingsDialog\n\t\ttext-align: center;\n\t\theight: var(--default-clickable-area);\n\t\tmin-height: var(--default-clickable-area);\n\t\tline-height: var(--default-clickable-area);\n\t\tmargin-block-end: 12px;\n\t}\n\n\t&__content {\n\t\t// Auto fit\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: auto;\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t\talign-content: center;\n\t\twidth: fit-content;\n\t\tmargin-inline: auto 4px; // 4px to align with the overall modal padding, we need this here for the buttons to have their 4px focus-visible outline\n\t\tmargin-block: 6px 4px; // 4px block-end see reason above\n\t}\n}\n</style>\n"],"names":["_sfc_main","defineComponent","NcDialogButton","NcModal","arr","element","value","props","emit","slots","wrapper","ref","dialogWidth","useElementSize","isNavigationCollapsed","computed","hasNavigation","showModal","handleButtonClose","handleClosing","handleClosed","modalProps"],"mappings":"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"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ const o = require("vue"), l = require("./NcButton.cjs"), i = require("./NcIconSvgWrapper.cjs"), u = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), a = o.defineComponent({
3
+ name: "NcDialogButton",
4
+ props: {
5
+ /**
6
+ * The function that will be called when the button is pressed
7
+ * @type {() => void}
8
+ */
9
+ callback: {
10
+ type: Function,
11
+ required: !0
12
+ },
13
+ /**
14
+ * The label of the button
15
+ */
16
+ label: {
17
+ type: String,
18
+ required: !0
19
+ },
20
+ /**
21
+ * Optional inline SVG icon for the button
22
+ */
23
+ icon: {
24
+ type: String,
25
+ required: !1,
26
+ default: void 0
27
+ },
28
+ /**
29
+ * The button type, see NcButton
30
+ * @values 'primary', 'secondary', 'error', 'warning', 'success'
31
+ */
32
+ type: {
33
+ type: String,
34
+ required: !1,
35
+ default: "secondary",
36
+ validator: (n) => typeof n == "string" && ["primary", "secondary", "error", "warning", "success"].includes(n)
37
+ }
38
+ },
39
+ emits: ["click"],
40
+ setup(n, { emit: e }) {
41
+ return {
42
+ NcButton: l,
43
+ NcIconSvgWrapper: i,
44
+ handleClick: (c) => {
45
+ var t;
46
+ (t = n.callback) == null || t.call(n), e("click", c);
47
+ }
48
+ };
49
+ }
50
+ });
51
+ var s = function() {
52
+ var e = this, r = e._self._c;
53
+ return e._self._setupProxy, r("NcButton", { attrs: { "aria-label": e.label, type: e.type }, on: { click: e.handleClick }, scopedSlots: e._u([{ key: "icon", fn: function() {
54
+ return [e._t("icon", function() {
55
+ return [e.icon !== void 0 ? r("NcIconSvgWrapper", { attrs: { svg: e.icon } }) : e._e()];
56
+ })];
57
+ }, proxy: !0 }], null, !0) }, [e._v(" " + e._s(e.label) + " ")]);
58
+ }, _ = [], d = /* @__PURE__ */ u.normalizeComponent(
59
+ a,
60
+ s,
61
+ _,
62
+ !1,
63
+ null,
64
+ null,
65
+ null,
66
+ null
67
+ );
68
+ const p = d.exports;
69
+ module.exports = p;