@dialpad/dialtone-vue 2.125.0 → 2.125.1

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 (282) hide show
  1. package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js +33 -0
  2. package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js.map +1 -0
  3. package/dist/chunks/dropdown-SMWaTWyF.js +357 -0
  4. package/dist/chunks/dropdown-SMWaTWyF.js.map +1 -0
  5. package/dist/chunks/dropdown_constants-EUcDxBrX.js +9 -0
  6. package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +1 -0
  7. package/dist/chunks/icon_constants-OpYAAKwF.js +16 -0
  8. package/dist/chunks/icon_constants-OpYAAKwF.js.map +1 -0
  9. package/dist/chunks/index-nIyl_PL6.js +372 -0
  10. package/dist/chunks/index-nIyl_PL6.js.map +1 -0
  11. package/dist/chunks/index-o4OMWMuv.js +244 -0
  12. package/dist/chunks/index-o4OMWMuv.js.map +1 -0
  13. package/dist/chunks/input-1tm09l_-.js +273 -0
  14. package/dist/chunks/input-1tm09l_-.js.map +1 -0
  15. package/dist/chunks/input_group-zcAq3DQl.js +141 -0
  16. package/dist/chunks/input_group-zcAq3DQl.js.map +1 -0
  17. package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +197 -0
  18. package/dist/chunks/keyboard_list_navigation-F0O8nht0.js.map +1 -0
  19. package/dist/chunks/link_constants-vIUB92L4.js +16 -0
  20. package/dist/chunks/link_constants-vIUB92L4.js.map +1 -0
  21. package/dist/chunks/list_item_constants-LTUc74pD.js +13 -0
  22. package/dist/chunks/list_item_constants-LTUc74pD.js.map +1 -0
  23. package/dist/chunks/modal-VuMFkZFH.js +82 -0
  24. package/dist/chunks/modal-VuMFkZFH.js.map +1 -0
  25. package/dist/chunks/notice_action-9NmtQRai.js +182 -0
  26. package/dist/chunks/notice_action-9NmtQRai.js.map +1 -0
  27. package/dist/chunks/notice_constants-c--hBFQw.js +6 -0
  28. package/dist/chunks/notice_constants-c--hBFQw.js.map +1 -0
  29. package/dist/chunks/popover_constants-qjlEkroB.js +114 -0
  30. package/dist/chunks/popover_constants-qjlEkroB.js.map +1 -0
  31. package/dist/chunks/sr_only_close_button-JGole5Xi.js +86 -0
  32. package/dist/chunks/sr_only_close_button-JGole5Xi.js.map +1 -0
  33. package/dist/chunks/stack_constants-u7tNqGtc.js +13 -0
  34. package/dist/chunks/stack_constants-u7tNqGtc.js.map +1 -0
  35. package/dist/chunks/tab-Qm9LVkYj.js +346 -0
  36. package/dist/chunks/tab-Qm9LVkYj.js.map +1 -0
  37. package/dist/component-documentation.json +1 -1
  38. package/dist/dialtone-vue.js +354 -10368
  39. package/dist/dialtone-vue.js.map +1 -1
  40. package/dist/lib/attachment-carousel.js +250 -0
  41. package/dist/lib/attachment-carousel.js.map +1 -0
  42. package/dist/lib/avatar.js +369 -0
  43. package/dist/lib/avatar.js.map +1 -0
  44. package/dist/lib/badge.js +169 -0
  45. package/dist/lib/badge.js.map +1 -0
  46. package/dist/lib/banner.js +200 -0
  47. package/dist/lib/banner.js.map +1 -0
  48. package/dist/lib/breadcrumbs.js +138 -0
  49. package/dist/lib/breadcrumbs.js.map +1 -0
  50. package/dist/lib/button-group.js +45 -0
  51. package/dist/lib/button-group.js.map +1 -0
  52. package/dist/lib/button.js +328 -0
  53. package/dist/lib/button.js.map +1 -0
  54. package/dist/lib/callbar-button-with-popover.js +235 -0
  55. package/dist/lib/callbar-button-with-popover.js.map +1 -0
  56. package/dist/lib/callbar-button.js +175 -0
  57. package/dist/lib/callbar-button.js.map +1 -0
  58. package/dist/lib/callbox.js +142 -0
  59. package/dist/lib/callbox.js.map +1 -0
  60. package/dist/lib/card.js +72 -0
  61. package/dist/lib/card.js.map +1 -0
  62. package/dist/lib/checkbox-group.js +117 -0
  63. package/dist/lib/checkbox-group.js.map +1 -0
  64. package/dist/lib/checkbox.js +117 -0
  65. package/dist/lib/checkbox.js.map +1 -0
  66. package/dist/lib/chip.js +186 -0
  67. package/dist/lib/chip.js.map +1 -0
  68. package/dist/lib/codeblock.js +29 -0
  69. package/dist/lib/codeblock.js.map +1 -0
  70. package/dist/lib/collapsible.js +313 -0
  71. package/dist/lib/collapsible.js.map +1 -0
  72. package/dist/lib/combobox-multi-select.js +433 -0
  73. package/dist/lib/combobox-multi-select.js.map +1 -0
  74. package/dist/lib/combobox-with-popover.js +341 -0
  75. package/dist/lib/combobox-with-popover.js.map +1 -0
  76. package/dist/lib/combobox.js +19 -0
  77. package/dist/lib/combobox.js.map +1 -0
  78. package/dist/lib/constants.js +53 -0
  79. package/dist/lib/constants.js.map +1 -0
  80. package/dist/lib/contact-info.js +145 -0
  81. package/dist/lib/contact-info.js.map +1 -0
  82. package/dist/lib/contact-row.js +203 -0
  83. package/dist/lib/contact-row.js.map +1 -0
  84. package/dist/lib/datepicker.js +552 -0
  85. package/dist/lib/datepicker.js.map +1 -0
  86. package/dist/lib/dates.js +57 -0
  87. package/dist/lib/dates.js.map +1 -0
  88. package/dist/lib/description-list.js +83 -0
  89. package/dist/lib/description-list.js.map +1 -0
  90. package/dist/lib/dropdown.js +45 -0
  91. package/dist/lib/dropdown.js.map +1 -0
  92. package/dist/lib/editor.js +527 -0
  93. package/dist/lib/editor.js.map +1 -0
  94. package/dist/{emoji_picker-kiTOKaq8.js → lib/emoji-picker.js} +30 -12
  95. package/dist/lib/emoji-picker.js.map +1 -0
  96. package/dist/lib/emoji-row.js +83 -0
  97. package/dist/lib/emoji-row.js.map +1 -0
  98. package/dist/{emoji_text_wrapper-48ClwKvf.js → lib/emoji-text-wrapper.js} +19 -14
  99. package/dist/lib/emoji-text-wrapper.js.map +1 -0
  100. package/dist/lib/emoji.js +11 -0
  101. package/dist/{emoji.js.map → lib/emoji.js.map} +1 -1
  102. package/dist/lib/feed-item-row.js +207 -0
  103. package/dist/lib/feed-item-row.js.map +1 -0
  104. package/dist/lib/feed-pill.js +142 -0
  105. package/dist/lib/feed-pill.js.map +1 -0
  106. package/dist/lib/general-row.js +379 -0
  107. package/dist/lib/general-row.js.map +1 -0
  108. package/dist/lib/group-row.js +115 -0
  109. package/dist/lib/group-row.js.map +1 -0
  110. package/dist/lib/grouped-chip.js +45 -0
  111. package/dist/lib/grouped-chip.js.map +1 -0
  112. package/dist/lib/hovercard.js +194 -0
  113. package/dist/lib/hovercard.js.map +1 -0
  114. package/dist/lib/icon.js +82 -0
  115. package/dist/lib/icon.js.map +1 -0
  116. package/dist/lib/image-viewer.js +171 -0
  117. package/dist/lib/image-viewer.js.map +1 -0
  118. package/dist/lib/input-group.js +90 -0
  119. package/dist/lib/input-group.js.map +1 -0
  120. package/dist/lib/input.js +455 -0
  121. package/dist/lib/input.js.map +1 -0
  122. package/dist/lib/item-layout.js +39 -0
  123. package/dist/lib/item-layout.js.map +1 -0
  124. package/dist/lib/ivr-node.js +195 -0
  125. package/dist/lib/ivr-node.js.map +1 -0
  126. package/dist/lib/keyboard-shortcut.js +100 -0
  127. package/dist/lib/keyboard-shortcut.js.map +1 -0
  128. package/dist/lib/lazy-show.js +77 -0
  129. package/dist/lib/lazy-show.js.map +1 -0
  130. package/dist/lib/link.js +69 -0
  131. package/dist/lib/link.js.map +1 -0
  132. package/dist/lib/list-item-group.js +59 -0
  133. package/dist/lib/list-item-group.js.map +1 -0
  134. package/dist/lib/list-item.js +195 -0
  135. package/dist/lib/list-item.js.map +1 -0
  136. package/dist/{message_input.js → lib/message-input.js} +107 -56
  137. package/dist/lib/message-input.js.map +1 -0
  138. package/dist/lib/mixins.js +17 -0
  139. package/dist/lib/mixins.js.map +1 -0
  140. package/dist/lib/modal.js +324 -0
  141. package/dist/lib/modal.js.map +1 -0
  142. package/dist/lib/notice.js +158 -0
  143. package/dist/lib/notice.js.map +1 -0
  144. package/dist/lib/pagination.js +142 -0
  145. package/dist/lib/pagination.js.map +1 -0
  146. package/dist/lib/popover.js +779 -0
  147. package/dist/lib/popover.js.map +1 -0
  148. package/dist/lib/presence.js +60 -0
  149. package/dist/lib/presence.js.map +1 -0
  150. package/dist/lib/radio-group.js +97 -0
  151. package/dist/lib/radio-group.js.map +1 -0
  152. package/dist/lib/radio.js +111 -0
  153. package/dist/lib/radio.js.map +1 -0
  154. package/dist/lib/rich-text-editor.js +920 -0
  155. package/dist/lib/rich-text-editor.js.map +1 -0
  156. package/dist/lib/root-layout.js +127 -0
  157. package/dist/lib/root-layout.js.map +1 -0
  158. package/dist/lib/select-menu.js +243 -0
  159. package/dist/lib/select-menu.js.map +1 -0
  160. package/dist/lib/settings-menu-button.js +65 -0
  161. package/dist/lib/settings-menu-button.js.map +1 -0
  162. package/dist/lib/skeleton.js +574 -0
  163. package/dist/lib/skeleton.js.map +1 -0
  164. package/dist/lib/stack.js +118 -0
  165. package/dist/lib/stack.js.map +1 -0
  166. package/dist/lib/tabs.js +93 -0
  167. package/dist/lib/tabs.js.map +1 -0
  168. package/dist/lib/time-pill.js +43 -0
  169. package/dist/lib/time-pill.js.map +1 -0
  170. package/dist/lib/toast.js +226 -0
  171. package/dist/lib/toast.js.map +1 -0
  172. package/dist/lib/toggle.js +169 -0
  173. package/dist/lib/toggle.js.map +1 -0
  174. package/dist/{directives.js → lib/tooltip-directive.js} +24 -18
  175. package/dist/lib/tooltip-directive.js.map +1 -0
  176. package/dist/lib/tooltip.js +376 -0
  177. package/dist/lib/tooltip.js.map +1 -0
  178. package/dist/lib/top-banner-info.js +60 -0
  179. package/dist/lib/top-banner-info.js.map +1 -0
  180. package/dist/lib/unread-pill.js +61 -0
  181. package/dist/lib/unread-pill.js.map +1 -0
  182. package/dist/lib/utils.js +175 -0
  183. package/dist/lib/utils.js.map +1 -0
  184. package/dist/lib/validation-messages.js +83 -0
  185. package/dist/lib/validation-messages.js.map +1 -0
  186. package/dist/lib/validators.js +12 -0
  187. package/dist/lib/validators.js.map +1 -0
  188. package/dist/style.css +1 -1
  189. package/dist/types/common/{constants.d.ts → constants/index.d.ts} +1 -1
  190. package/dist/types/common/constants/index.d.ts.map +1 -0
  191. package/dist/types/common/{dates.d.ts → dates/index.d.ts} +1 -1
  192. package/dist/types/common/dates/index.d.ts.map +1 -0
  193. package/dist/types/common/{emoji.d.ts → emoji/index.d.ts} +1 -1
  194. package/dist/types/common/{emoji.d.ts.map → emoji/index.d.ts.map} +1 -1
  195. package/dist/types/common/{utils.d.ts → utils/index.d.ts} +1 -1
  196. package/dist/types/common/utils/index.d.ts.map +1 -0
  197. package/dist/types/common/{validators.d.ts → validators/index.d.ts} +1 -1
  198. package/dist/types/common/validators/index.d.ts.map +1 -0
  199. package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
  200. package/dist/types/components/button/button.vue.d.ts +2 -2
  201. package/dist/types/components/card/card.vue.d.ts +1 -1
  202. package/dist/types/components/checkbox/checkbox.vue.d.ts +7 -7
  203. package/dist/types/components/checkbox/checkbox.vue.d.ts.map +1 -1
  204. package/dist/types/components/chip/chip.vue.d.ts +2 -2
  205. package/dist/types/components/collapsible/collapsible.vue.d.ts +3 -3
  206. package/dist/types/components/combobox/combobox.vue.d.ts +7 -8
  207. package/dist/types/components/combobox/combobox.vue.d.ts.map +1 -1
  208. package/dist/types/components/dropdown/dropdown.vue.d.ts +1 -1
  209. package/dist/types/components/emoji/emoji.vue.d.ts +1 -1
  210. package/dist/types/components/emoji_picker/modules/emoji_selector.vue.d.ts +1 -219
  211. package/dist/types/components/icon/icon.vue.d.ts +20 -16
  212. package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
  213. package/dist/types/components/icon/icon_constants.d.ts +2 -0
  214. package/dist/types/components/icon/icon_constants.d.ts.map +1 -1
  215. package/dist/types/components/icon/index.d.ts +1 -1
  216. package/dist/types/components/input_group/input_group.vue.d.ts +15 -6
  217. package/dist/types/components/input_group/input_group.vue.d.ts.map +1 -1
  218. package/dist/types/components/list_item_group/list_item_group.vue.d.ts +1 -1
  219. package/dist/types/components/modal/modal.vue.d.ts +7 -2
  220. package/dist/types/components/modal/modal.vue.d.ts.map +1 -1
  221. package/dist/types/components/notice/notice_action.vue.d.ts +3 -1
  222. package/dist/types/components/notice/notice_action.vue.d.ts.map +1 -1
  223. package/dist/types/components/popover/popover_header_footer.vue.d.ts +1 -1
  224. package/dist/types/components/radio/radio.vue.d.ts +2 -12
  225. package/dist/types/components/radio/radio.vue.d.ts.map +1 -1
  226. package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
  227. package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts +3 -3
  228. package/dist/types/components/skeleton/skeleton-shape.vue.d.ts +2 -2
  229. package/dist/types/components/skeleton/skeleton-text.vue.d.ts +8 -3
  230. package/dist/types/components/skeleton/skeleton-text.vue.d.ts.map +1 -1
  231. package/dist/types/components/skeleton/skeleton.vue.d.ts +1 -1
  232. package/dist/types/components/toggle/toggle.vue.d.ts +1 -1
  233. package/dist/types/components/tooltip/tooltip.vue.d.ts +2 -2
  234. package/dist/types/index.d.ts +36 -29
  235. package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +1 -1
  236. package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +2 -2
  237. package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
  238. package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -2
  239. package/package.json +18 -58
  240. package/CHANGELOG.json +0 -1
  241. package/CHANGELOG.md +0 -2904
  242. package/dist/dialtone-vue.cjs +0 -6
  243. package/dist/dialtone-vue.cjs.map +0 -1
  244. package/dist/directives.cjs +0 -2
  245. package/dist/directives.cjs.map +0 -1
  246. package/dist/directives.js.map +0 -1
  247. package/dist/emoji.cjs +0 -2
  248. package/dist/emoji.cjs.map +0 -1
  249. package/dist/emoji.js +0 -36
  250. package/dist/emoji_picker-kiTOKaq8.js.map +0 -1
  251. package/dist/emoji_picker-njWWAm6V.cjs +0 -2
  252. package/dist/emoji_picker-njWWAm6V.cjs.map +0 -1
  253. package/dist/emoji_text_wrapper-48ClwKvf.js.map +0 -1
  254. package/dist/emoji_text_wrapper-ZlynvHnd.cjs +0 -2
  255. package/dist/emoji_text_wrapper-ZlynvHnd.cjs.map +0 -1
  256. package/dist/index-OF94C6nQ.js +0 -142834
  257. package/dist/index-OF94C6nQ.js.map +0 -1
  258. package/dist/index-Wx7Jagcr.cjs +0 -2
  259. package/dist/index-Wx7Jagcr.cjs.map +0 -1
  260. package/dist/message_input.cjs +0 -2
  261. package/dist/message_input.cjs.map +0 -1
  262. package/dist/message_input.js.map +0 -1
  263. package/dist/rich_text_editor-RVMsCB8N.cjs +0 -98
  264. package/dist/rich_text_editor-RVMsCB8N.cjs.map +0 -1
  265. package/dist/rich_text_editor-eMvTs_Gp.js +0 -16479
  266. package/dist/rich_text_editor-eMvTs_Gp.js.map +0 -1
  267. package/dist/tooltip-88U5vFMA.js +0 -2517
  268. package/dist/tooltip-88U5vFMA.js.map +0 -1
  269. package/dist/tooltip-i2wxFIIi.cjs +0 -22
  270. package/dist/tooltip-i2wxFIIi.cjs.map +0 -1
  271. package/dist/types/common/constants.d.ts.map +0 -1
  272. package/dist/types/common/dates.d.ts.map +0 -1
  273. package/dist/types/common/utils.d.ts.map +0 -1
  274. package/dist/types/common/validators.d.ts.map +0 -1
  275. package/dist/types/components/emoji_picker/emojis/index.d.ts +0 -50
  276. package/dist/types/components/emoji_picker/emojis/index.d.ts.map +0 -1
  277. package/dist/types/directives.d.ts +0 -2
  278. package/dist/types/directives.d.ts.map +0 -1
  279. package/dist/types/emoji.d.ts +0 -5
  280. package/dist/types/emoji.d.ts.map +0 -1
  281. package/dist/types/message_input.d.ts +0 -3
  282. package/dist/types/message_input.d.ts.map +0 -1
@@ -0,0 +1,324 @@
1
+ import { M as i } from "../chunks/modal-VuMFkZFH.js";
2
+ import { getUniqueString as n } from "./utils.js";
3
+ import { EVENT_KEYNAMES as s } from "./constants.js";
4
+ import { S as d, a as c } from "../chunks/sr_only_close_button-JGole5Xi.js";
5
+ import { n as u } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
6
+ import { DtLazyShow as m } from "./lazy-show.js";
7
+ import { DtButton as f } from "./button.js";
8
+ import { DtIcon as p } from "./icon.js";
9
+ import { N as _ } from "../chunks/notice_constants-c--hBFQw.js";
10
+ import "vue";
11
+ import "../chunks/link_constants-vIUB92L4.js";
12
+ import "@dialpad/dialtone-icons/vue2";
13
+ import "../chunks/icon_constants-OpYAAKwF.js";
14
+ import "@dialpad/dialtone-icons/icons.json";
15
+ import "./skeleton.js";
16
+ const o = {
17
+ default: "",
18
+ danger: "d-modal--danger"
19
+ }, l = {
20
+ default: "",
21
+ full: "d-modal--full"
22
+ }, r = {
23
+ error: "d-modal__banner--critical",
24
+ info: "d-modal__banner--info",
25
+ success: "d-modal__banner--success",
26
+ warning: "d-modal__banner--warning",
27
+ base: "d-modal__banner--general"
28
+ }, h = {
29
+ name: "DtModal",
30
+ components: {
31
+ DtLazyShow: m,
32
+ DtButton: f,
33
+ DtIcon: p,
34
+ SrOnlyCloseButton: d
35
+ },
36
+ mixins: [i, c],
37
+ props: {
38
+ /**
39
+ * A set of props to be passed into the modal's close button.
40
+ * Requires an 'ariaLabel' property.
41
+ */
42
+ closeButtonProps: {
43
+ type: Object,
44
+ required: !0,
45
+ validator: (t) => !!t.ariaLabel
46
+ },
47
+ /**
48
+ * Body text to display as the modal's main content.
49
+ */
50
+ copy: {
51
+ type: String,
52
+ default: ""
53
+ },
54
+ /**
55
+ * Id to use for the dialog's aria-describedby.
56
+ * Recommended only if the dialog content itself isn't enough to give full context,
57
+ * as screen readers should recite the dialog contents by default before any aria-description.
58
+ */
59
+ describedById: {
60
+ type: String,
61
+ default: ""
62
+ },
63
+ /**
64
+ * Id to use for the dialog's aria-labelledby.
65
+ */
66
+ labelledById: {
67
+ type: String,
68
+ default: function() {
69
+ return n();
70
+ }
71
+ },
72
+ /**
73
+ * Whether the modal should be shown.
74
+ * Parent component can sync on this value to control the modal's visibility.
75
+ * @values true, false
76
+ */
77
+ show: {
78
+ type: Boolean,
79
+ default: !1
80
+ },
81
+ /**
82
+ * Title text to display in the modal header.
83
+ */
84
+ title: {
85
+ type: String,
86
+ default: ""
87
+ },
88
+ /**
89
+ * Title text to display in the modal banner.
90
+ */
91
+ bannerTitle: {
92
+ type: String,
93
+ default: ""
94
+ },
95
+ /**
96
+ * The theme of the modal. kind - default or danger,
97
+ * @values default, danger
98
+ */
99
+ kind: {
100
+ type: String,
101
+ default: "default",
102
+ validator: (t) => Object.keys(o).includes(t)
103
+ },
104
+ /**
105
+ * The size of the modal. size - default or full,
106
+ * @values default, full
107
+ */
108
+ size: {
109
+ type: String,
110
+ default: "default",
111
+ validator: (t) => Object.keys(l).includes(t)
112
+ },
113
+ /**
114
+ * Additional class name for the root modal element.
115
+ * Can accept String, Object, and Array, i.e. has the
116
+ * same API as Vue's built-in handling of the class attribute.
117
+ */
118
+ modalClass: {
119
+ type: [String, Object, Array],
120
+ default: ""
121
+ },
122
+ /**
123
+ * Additional class name for the dialog element within the modal.
124
+ * Can accept String, Object, and Array, i.e. has the
125
+ * same API as Vue's built-in handling of the class attribute.
126
+ */
127
+ dialogClass: {
128
+ type: [String, Object, Array],
129
+ default: ""
130
+ },
131
+ /**
132
+ * Additional class name for the content element within the modal.
133
+ * Can accept String, Object, and Array, i.e. has the
134
+ * same API as Vue's built-in handling of the class attribute.
135
+ */
136
+ contentClass: {
137
+ type: [String, Object, Array],
138
+ default: ""
139
+ },
140
+ /**
141
+ * Sets the color of the banner.
142
+ * @values base, error, info, success, warning
143
+ */
144
+ bannerKind: {
145
+ type: String,
146
+ default: "warning",
147
+ validate(t) {
148
+ return _.includes(t);
149
+ }
150
+ },
151
+ /**
152
+ * Additional class name for the banner element within the modal.
153
+ * Can accept String, Object, and Array, i.e. has the
154
+ * same API as Vue's built-in handling of the class attribute.
155
+ */
156
+ bannerClass: {
157
+ type: [String, Object, Array],
158
+ default: ""
159
+ },
160
+ /**
161
+ * Hides the close button on the modal
162
+ * @values true, false
163
+ */
164
+ hideClose: {
165
+ type: Boolean,
166
+ default: !1
167
+ },
168
+ /**
169
+ * Whether the modal will close when you click outside of the dialog on the overlay.
170
+ * @values true, false
171
+ */
172
+ closeOnClick: {
173
+ type: Boolean,
174
+ default: !0
175
+ },
176
+ /**
177
+ * Scrollable modal that allows scroll the modal content keeping the header and footer fixed
178
+ * @values true, false
179
+ */
180
+ fixedHeaderFooter: {
181
+ type: Boolean,
182
+ default: !0
183
+ },
184
+ /**
185
+ * The element that is focused when the modal is opened. This can be an
186
+ * HTMLElement within the modal, a string starting with '#' which will
187
+ * find the element by ID. 'first' which will automatically focus
188
+ * the first element, or 'dialog' which will focus the dialog window itself.
189
+ * If the dialog is modal this prop cannot be 'none'.
190
+ */
191
+ initialFocusElement: {
192
+ type: [String, HTMLElement],
193
+ default: "first",
194
+ validator: (t) => t === "first" || t instanceof HTMLElement || t.startsWith("#")
195
+ }
196
+ },
197
+ emits: [
198
+ /**
199
+ * The modal will emit a "false" boolean value for this event when the user performs a modal-closing action.
200
+ * Parent components can sync on this value to create a 2-way binding to control modal visibility.
201
+ *
202
+ * @event update:show
203
+ * @type {Boolean}
204
+ */
205
+ "update:show"
206
+ ],
207
+ data() {
208
+ return {
209
+ MODAL_KIND_MODIFIERS: o,
210
+ MODAL_SIZE_MODIFIERS: l,
211
+ MODAL_BANNER_KINDS: r,
212
+ EVENT_KEYNAMES: s
213
+ };
214
+ },
215
+ computed: {
216
+ modalListeners() {
217
+ return {
218
+ ...this.$listeners,
219
+ click: (t) => {
220
+ this.closeOnClick && (t.target === t.currentTarget && this.close(), this.$emit("click", t));
221
+ },
222
+ keydown: (t) => {
223
+ switch (t.code) {
224
+ case s.esc:
225
+ case s.escape:
226
+ this.close();
227
+ break;
228
+ case s.tab:
229
+ this.trapFocus(t);
230
+ break;
231
+ }
232
+ this.$emit("keydown", t);
233
+ },
234
+ "after-enter": (t) => {
235
+ this.$emit("update:show", !0), t.target === t.currentTarget && this.setFocusAfterTransition();
236
+ }
237
+ };
238
+ },
239
+ open() {
240
+ return `${!this.show}`;
241
+ },
242
+ hasFooterSlot() {
243
+ return !!this.$slots.footer;
244
+ },
245
+ bannerKindClass() {
246
+ return r[this.bannerKind];
247
+ }
248
+ },
249
+ watch: {
250
+ show: {
251
+ immediate: !0,
252
+ handler(t) {
253
+ var e;
254
+ t ? this.previousActiveElement = document.activeElement : ((e = this.previousActiveElement) == null || e.focus(), this.previousActiveElement = null);
255
+ }
256
+ },
257
+ $props: {
258
+ immediate: !0,
259
+ deep: !0,
260
+ handler() {
261
+ this.validateProps();
262
+ }
263
+ }
264
+ },
265
+ methods: {
266
+ close() {
267
+ this.$emit("update:show", !1);
268
+ },
269
+ setFocusAfterTransition() {
270
+ this.initialFocusElement === "first" ? this.focusFirstElement() : this.initialFocusElement.startsWith("#") ? this.focusElementById(this.initialFocusElement) : this.initialFocusElement instanceof HTMLElement && this.initialFocusElement.focus();
271
+ },
272
+ trapFocus(t) {
273
+ this.show && this.focusTrappedTabPress(t);
274
+ },
275
+ validateProps() {
276
+ this.hideClose && !this.visuallyHiddenClose && console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props
277
+ need to be set so the component always includes a close button`);
278
+ }
279
+ }
280
+ };
281
+ var b = function() {
282
+ var e = this, a = e._self._c;
283
+ return a("dt-lazy-show", e._g({ class: [
284
+ "d-modal",
285
+ e.MODAL_KIND_MODIFIERS[e.kind],
286
+ e.MODAL_SIZE_MODIFIERS[e.size],
287
+ e.modalClass
288
+ ], attrs: { transition: "d-zoom", show: e.show, "data-qa": "dt-modal", "aria-hidden": e.open } }, e.modalListeners), [e.show && (e.$slots.banner || e.bannerTitle) ? a("div", { class: [
289
+ "d-modal__banner",
290
+ e.bannerClass,
291
+ e.bannerKindClass
292
+ ], attrs: { "data-qa": "dt-modal-banner" } }, [e._t("banner", function() {
293
+ return [e._v(" " + e._s(e.bannerTitle) + " ")];
294
+ })], 2) : e._e(), a("transition", { attrs: { appear: "", name: "d-modal__dialog" } }, [a("div", { directives: [{ name: "show", rawName: "v-show", value: e.show, expression: "show" }], class: [
295
+ "d-modal__dialog",
296
+ { "d-modal__dialog--scrollable": e.fixedHeaderFooter },
297
+ e.dialogClass
298
+ ], attrs: { role: "dialog", "aria-modal": "true", "aria-describedby": e.describedById, "aria-labelledby": e.labelledById } }, [e.$slots.header ? a("div", { staticClass: "d-modal__header", attrs: { id: e.labelledById, "data-qa": "dt-modal-title" } }, [e._t("header")], 2) : a("h2", { staticClass: "d-modal__header", attrs: { id: e.labelledById, "data-qa": "dt-modal-title" } }, [e._v(" " + e._s(e.title) + " ")]), e.$slots.default ? a("div", { class: [
299
+ "d-modal__content",
300
+ e.contentClass
301
+ ], attrs: { "data-qa": "dt-modal-copy" } }, [e._t("default")], 2) : a("p", { class: [
302
+ "d-modal__content",
303
+ e.contentClass
304
+ ], attrs: { "data-qa": "dt-modal-copy" } }, [e._v(" " + e._s(e.copy) + " ")]), e.hasFooterSlot ? a("footer", { staticClass: "d-modal__footer" }, [e._t("footer")], 2) : e._e(), e.hideClose ? e._e() : a("dt-button", e._b({ staticClass: "d-modal__close", attrs: { circle: "", size: "lg", importance: "clear", "aria-label": e.closeButtonProps.ariaLabel }, on: { click: e.close }, scopedSlots: e._u([{ key: "icon", fn: function() {
305
+ return [a("dt-icon", { attrs: { name: "close", size: "400" } })];
306
+ }, proxy: !0 }], null, !1, 1709155279) }, "dt-button", e.closeButtonProps, !1)), e.showVisuallyHiddenClose ? a("sr-only-close-button", { attrs: { "visually-hidden-close-label": e.visuallyHiddenCloseLabel }, on: { close: e.close } }) : e._e()], 1)])], 1);
307
+ }, y = [], g = /* @__PURE__ */ u(
308
+ h,
309
+ b,
310
+ y,
311
+ !1,
312
+ null,
313
+ null,
314
+ null,
315
+ null
316
+ );
317
+ const N = g.exports;
318
+ export {
319
+ N as DtModal,
320
+ r as MODAL_BANNER_KINDS,
321
+ o as MODAL_KIND_MODIFIERS,
322
+ l as MODAL_SIZE_MODIFIERS
323
+ };
324
+ //# sourceMappingURL=modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.js","sources":["../../components/modal/modal_constants.js","../../components/modal/modal.vue"],"sourcesContent":["// Modal style modifiers\nexport const MODAL_KIND_MODIFIERS = {\n default: '',\n danger: 'd-modal--danger',\n};\n\n// Modal size modifiers\nexport const MODAL_SIZE_MODIFIERS = {\n default: '',\n full: 'd-modal--full',\n};\n\nexport const MODAL_BANNER_KINDS = {\n error: 'd-modal__banner--critical',\n info: 'd-modal__banner--info',\n success: 'd-modal__banner--success',\n warning: 'd-modal__banner--warning',\n base: 'd-modal__banner--general',\n};\n","<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && ($slots.banner || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"$slots.header\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"$slots.default\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon\n name=\"close\"\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIcon,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n ...this.$listeners,\n\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["MODAL_KIND_MODIFIERS","MODAL_SIZE_MODIFIERS","MODAL_BANNER_KINDS","_sfc_main","DtLazyShow","DtButton","DtIcon","SrOnlyCloseButton","Modal","SrOnlyCloseButtonMixin","props","getUniqueString","k","s","kind","NOTICE_KINDS","initialFocusElement","EVENT_KEYNAMES","event","isShowing","_a","e"],"mappings":";;;;;;;;;;;;;;;AACY,MAACA,IAAuB;AAAA,EAClC,SAAS;AAAA,EACT,QAAQ;AACV,GAGaC,IAAuB;AAAA,EAClC,SAAS;AAAA,EACT,MAAM;AACR,GAEaC,IAAqB;AAAA,EACh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EAAA;AAAA,IACA;AAAA,IAEA,0BAAA;AACA,MAAA,KAAA,wBAAA,UACA,KAAA,kBAAA,IACA,KAAA,oBAAA,WAAA,GAAA,IACA,KAAA,iBAAA,KAAA,mBAAA,IACA,KAAA,+BAAA,eACA,KAAA,oBAAA;IAEA;AAAA,IAEA,UAAAC,GAAA;AACA,MAAA,KAAA,QACA,KAAA,qBAAAA,CAAA;AAAA,IAEA;AAAA,IAEA,gBAAA;AACA,MAAA,KAAA,aAAA,CAAA,KAAA,uBACA,QAAA,MAAA;AAAA,uEACA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,158 @@
1
+ import { a as i, b as o, D as s } from "../chunks/notice_action-9NmtQRai.js";
2
+ import { a as l, N as r } from "../chunks/notice_constants-c--hBFQw.js";
3
+ import { a } from "../chunks/sr_only_close_button-JGole5Xi.js";
4
+ import { n as c } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
5
+ import "./icon.js";
6
+ import "@dialpad/dialtone-icons/vue2";
7
+ import "../chunks/icon_constants-OpYAAKwF.js";
8
+ import "@dialpad/dialtone-icons/icons.json";
9
+ import "./skeleton.js";
10
+ import "./button.js";
11
+ import "vue";
12
+ import "../chunks/link_constants-vIUB92L4.js";
13
+ const d = {
14
+ name: "DtNotice",
15
+ components: {
16
+ DtNoticeIcon: i,
17
+ DtNoticeContent: o,
18
+ DtNoticeAction: s
19
+ },
20
+ mixins: [a],
21
+ props: {
22
+ /**
23
+ * Sets an ID on the title element of the component. Useful for aria-describedby
24
+ * or aria-labelledby or any other reason you may need an id to refer to the title.
25
+ */
26
+ titleId: {
27
+ type: String,
28
+ default: void 0
29
+ },
30
+ /**
31
+ * Sets an ID on the content element of the component. Useful for aria-describedby
32
+ * or aria-labelledby or any other reason you may need an id to refer to the content.
33
+ */
34
+ contentId: {
35
+ type: String,
36
+ default: void 0
37
+ },
38
+ /**
39
+ * Title header of the notice. This can be left blank to remove the title from the notice entirely.
40
+ */
41
+ title: {
42
+ type: String,
43
+ default: ""
44
+ },
45
+ /**
46
+ * Provides a role for the notice. 'status' is used to communicate a message. 'alert' is used to communicate an
47
+ * important message that does not contain any interactive elements. 'alertdialog' is used to communicate an
48
+ * important message that does contain interactive elements.
49
+ * @values alert, alertdialog, status
50
+ */
51
+ role: {
52
+ type: String,
53
+ default: "status",
54
+ validate(e) {
55
+ return l.includes(e);
56
+ }
57
+ },
58
+ /**
59
+ * Used in scenarios where the message needs to visually dominate the screen.
60
+ * This will also change the aria role from status to alert.
61
+ * @values true, false
62
+ */
63
+ important: {
64
+ type: Boolean,
65
+ default: !1
66
+ },
67
+ /**
68
+ * Severity level of the notice, sets the icon and background
69
+ * @values base, error, info, success, warning
70
+ */
71
+ kind: {
72
+ type: String,
73
+ default: "base",
74
+ validate(e) {
75
+ return r.includes(e);
76
+ }
77
+ },
78
+ /**
79
+ * Props for the notice close button.
80
+ */
81
+ closeButtonProps: {
82
+ type: Object,
83
+ default: () => ({})
84
+ },
85
+ /**
86
+ * Hides the close button from the notice
87
+ * @values true, false
88
+ */
89
+ hideClose: {
90
+ type: Boolean,
91
+ default: !1
92
+ },
93
+ /**
94
+ * Hides the icon from the notice
95
+ * @values true, false
96
+ */
97
+ hideIcon: {
98
+ type: Boolean,
99
+ default: !1
100
+ },
101
+ /**
102
+ * Hides the action from the notice
103
+ * @values true, false
104
+ */
105
+ hideAction: {
106
+ type: Boolean,
107
+ default: !1
108
+ }
109
+ },
110
+ emits: [
111
+ /**
112
+ * Close button click event
113
+ *
114
+ * @event close
115
+ */
116
+ "close"
117
+ ],
118
+ computed: {
119
+ noticeClass() {
120
+ return [
121
+ "d-notice",
122
+ {
123
+ error: "d-notice--error",
124
+ info: "d-notice--info",
125
+ success: "d-notice--success",
126
+ warning: "d-notice--warning",
127
+ base: "d-notice--base"
128
+ }[this.kind],
129
+ { "d-notice--important": this.important }
130
+ ];
131
+ }
132
+ }
133
+ };
134
+ var u = function() {
135
+ var t = this, n = t._self._c;
136
+ return n("aside", { class: t.noticeClass, attrs: { "data-qa": "notice" } }, [t.hideIcon ? t._e() : n("dt-notice-icon", { attrs: { kind: t.kind } }, [t._t("icon")], 2), n("dt-notice-content", t._g({ attrs: { "title-id": t.titleId, "content-id": t.contentId, title: t.title, role: t.role }, scopedSlots: t._u([{ key: "titleOverride", fn: function() {
137
+ return [t._t("titleOverride")];
138
+ }, proxy: !0 }], null, !0) }, t.$listeners), [t._t("default")], 2), n("dt-notice-action", t._g({ attrs: { "hide-action": t.hideAction, "hide-close": t.hideClose, "close-button-props": t.closeButtonProps, "visually-hidden-close": t.visuallyHiddenClose, "visually-hidden-close-label": t.visuallyHiddenCloseLabel } }, t.$listeners), [t._t("action")], 2)], 1);
139
+ }, p = [], f = /* @__PURE__ */ c(
140
+ d,
141
+ u,
142
+ p,
143
+ !1,
144
+ null,
145
+ null,
146
+ null,
147
+ null
148
+ );
149
+ const D = f.exports;
150
+ export {
151
+ D as DtNotice,
152
+ s as DtNoticeAction,
153
+ o as DtNoticeContent,
154
+ i as DtNoticeIcon,
155
+ r as NOTICE_KINDS,
156
+ l as NOTICE_ROLES
157
+ };
158
+ //# sourceMappingURL=notice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notice.js","sources":["../../components/notice/notice.vue"],"sourcesContent":["<template>\n <aside\n :class=\"noticeClass\"\n data-qa=\"notice\"\n >\n <dt-notice-icon\n v-if=\"!hideIcon\"\n :kind=\"kind\"\n >\n <!-- @slot Slot for custom icon -->\n <slot name=\"icon\" />\n </dt-notice-icon>\n <dt-notice-content\n :title-id=\"titleId\"\n :content-id=\"contentId\"\n :title=\"title\"\n :role=\"role\"\n v-on=\"$listeners\"\n >\n <template #titleOverride>\n <!-- @slot Allows you to override the title, only use this if you need\n to override with something other than text. Otherwise use the \"title\" prop. -->\n <slot name=\"titleOverride\" />\n </template>\n <!-- @slot the main textual content of the notice -->\n <slot />\n </dt-notice-content>\n <dt-notice-action\n :hide-action=\"hideAction\"\n :hide-close=\"hideClose\"\n :close-button-props=\"closeButtonProps\"\n :visually-hidden-close=\"visuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n v-on=\"$listeners\"\n >\n <!-- @slot Enter a possible action for the user to take, such as a link to another page -->\n <slot name=\"action\" />\n </dt-notice-action>\n </aside>\n</template>\n\n<script>\nimport DtNoticeIcon from './notice_icon.vue';\nimport DtNoticeContent from './notice_content.vue';\nimport DtNoticeAction from './notice_action.vue';\nimport { NOTICE_KINDS, NOTICE_ROLES } from './notice_constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\n\n/**\n * A notice is an informational and assistive message that appears inline with content.\n * @see https://dialtone.dialpad.com/components/notice.html\n */\nexport default {\n name: 'DtNotice',\n\n components: {\n DtNoticeIcon,\n DtNoticeContent,\n DtNoticeAction,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * Sets an ID on the title element of the component. Useful for aria-describedby\n * or aria-labelledby or any other reason you may need an id to refer to the title.\n */\n titleId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Sets an ID on the content element of the component. Useful for aria-describedby\n * or aria-labelledby or any other reason you may need an id to refer to the content.\n */\n contentId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title header of the notice. This can be left blank to remove the title from the notice entirely.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Provides a role for the notice. 'status' is used to communicate a message. 'alert' is used to communicate an\n * important message that does not contain any interactive elements. 'alertdialog' is used to communicate an\n * important message that does contain interactive elements.\n * @values alert, alertdialog, status\n */\n role: {\n type: String,\n default: 'status',\n validate (role) {\n return NOTICE_ROLES.includes(role);\n },\n },\n\n /**\n * Used in scenarios where the message needs to visually dominate the screen.\n * This will also change the aria role from status to alert.\n * @values true, false\n */\n important: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Severity level of the notice, sets the icon and background\n * @values base, error, info, success, warning\n */\n kind: {\n type: String,\n default: 'base',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Props for the notice close button.\n */\n closeButtonProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Hides the close button from the notice\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Hides the icon from the notice\n * @values true, false\n */\n hideIcon: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Hides the action from the notice\n * @values true, false\n */\n hideAction: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n ],\n\n computed: {\n noticeClass () {\n const noticeKinds = {\n error: 'd-notice--error',\n info: 'd-notice--info',\n success: 'd-notice--success',\n warning: 'd-notice--warning',\n base: 'd-notice--base',\n };\n return [\n 'd-notice',\n noticeKinds[this.kind],\n { 'd-notice--important': this.important },\n ];\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtNoticeIcon","DtNoticeContent","DtNoticeAction","SrOnlyCloseButtonMixin","role","NOTICE_ROLES","kind","NOTICE_KINDS"],"mappings":";;;;;;;;;;;;AAoDA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,SAAAC,GAAA;AACA,eAAAC,EAAA,SAAAD,CAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,SAAAE,GAAA;AACA,eAAAC,EAAA,SAAAD,CAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,OAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,cAAA;AAQA,aAAA;AAAA,QACA;AAAA,QARA;AAAA,UACA,OAAA;AAAA,UACA,MAAA;AAAA,UACA,SAAA;AAAA,UACA,SAAA;AAAA,UACA,MAAA;AAAA,QACA,EAGA,KAAA,IAAA;AAAA,QACA,EAAA,uBAAA,KAAA,UAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,142 @@
1
+ import { n as s } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
2
+ import { DtButton as o } from "./button.js";
3
+ import { DtIcon as c } from "./icon.js";
4
+ import "vue";
5
+ import "../chunks/link_constants-vIUB92L4.js";
6
+ import "@dialpad/dialtone-icons/vue2";
7
+ import "../chunks/icon_constants-OpYAAKwF.js";
8
+ import "@dialpad/dialtone-icons/icons.json";
9
+ import "./skeleton.js";
10
+ const l = {
11
+ name: "DtPagination",
12
+ components: {
13
+ DtButton: o,
14
+ DtIcon: c
15
+ },
16
+ props: {
17
+ /**
18
+ * Descriptive label for the pagination content.
19
+ */
20
+ ariaLabel: {
21
+ type: String,
22
+ required: !0
23
+ },
24
+ /**
25
+ * The total number of the pages
26
+ */
27
+ totalPages: {
28
+ type: Number,
29
+ required: !0
30
+ },
31
+ /**
32
+ * Descriptive label for the previous button.
33
+ */
34
+ prevAriaLabel: {
35
+ type: String,
36
+ required: !0
37
+ },
38
+ /**
39
+ * Descriptive label for the next button.
40
+ */
41
+ nextAriaLabel: {
42
+ type: String,
43
+ required: !0
44
+ },
45
+ /**
46
+ * A method that will be called to get the aria label of each page.
47
+ */
48
+ pageNumberAriaLabel: {
49
+ type: Function,
50
+ required: !0
51
+ },
52
+ /**
53
+ * The active current page in the list of pages, defaults to the first page
54
+ */
55
+ activePage: {
56
+ type: Number,
57
+ default: 1
58
+ },
59
+ /**
60
+ * Determines the max pages to be shown in the list. Using an odd number is recommended.
61
+ * If an even number is given, then it will be rounded down to the nearest odd number to always
62
+ * keep current page in the middle when current page is in the mid-range.
63
+ */
64
+ maxVisible: {
65
+ type: Number,
66
+ default: 5
67
+ }
68
+ },
69
+ emits: [
70
+ /**
71
+ * Page change event
72
+ *
73
+ * @event change
74
+ * @type {Number}
75
+ */
76
+ "change"
77
+ ],
78
+ data() {
79
+ return {
80
+ currentPage: this.activePage
81
+ };
82
+ },
83
+ computed: {
84
+ isFirstPage() {
85
+ return this.currentPage === 1;
86
+ },
87
+ isLastPage() {
88
+ return this.currentPage === this.totalPages;
89
+ },
90
+ pages() {
91
+ if (this.maxVisible === 0)
92
+ return [];
93
+ if (this.totalPages <= this.maxVisible)
94
+ return this.range(1, this.totalPages);
95
+ const r = this.maxVisible - 1, t = this.totalPages - r + 1;
96
+ if (this.currentPage < r)
97
+ return [...this.range(1, r), "...", this.totalPages];
98
+ if (this.currentPage > t)
99
+ return [1, "...", ...this.range(t, this.totalPages)];
100
+ const e = this.maxVisible - (3 - this.maxVisible % 2), a = Math.floor(e / 2), i = this.currentPage - a, n = this.currentPage + a;
101
+ return [1, "...", ...this.range(i, n), "...", this.totalPages];
102
+ }
103
+ },
104
+ methods: {
105
+ range(r, t) {
106
+ const e = [];
107
+ r = r > 0 ? r : 1;
108
+ for (let a = r; a <= t; a++)
109
+ e.push(a);
110
+ return e;
111
+ },
112
+ changePage(r) {
113
+ this.currentPage = r, this.$emit("change", this.currentPage);
114
+ }
115
+ }
116
+ };
117
+ var u = function() {
118
+ var t = this, e = t._self._c;
119
+ return e("nav", { staticClass: "d-pagination", attrs: { "aria-label": t.ariaLabel } }, [e("dt-button", { staticClass: "d-pagination__button", class: t.isFirstPage ? "d-fc-black-300 d-bgc-transparent" : "d-fc-tertiary", attrs: { "data-qa": "dt-pagination-prev", "aria-label": t.prevAriaLabel, kind: t.isFirstPage ? "default" : "muted", importance: t.isFirstPage ? "primary" : "clear", disabled: t.isFirstPage }, on: { click: function(a) {
120
+ return t.changePage(t.currentPage - 1);
121
+ } } }, [e("template", { slot: "icon" }, [e("dt-icon", { attrs: { name: "chevron-left", size: "300" } })], 1)], 2), t._l(t.pages, function(a, i) {
122
+ return e("div", { key: `page-${a}-${i}`, class: { "d-pagination__separator": isNaN(Number(a)) } }, [isNaN(Number(a)) ? e("div", { staticClass: "d-pagination__separator-icon", attrs: { "data-qa": "dt-pagination-separator" } }, [e("dt-icon", { attrs: { name: "more-horizontal", size: "300" } })], 1) : e("dt-button", { attrs: { "aria-label": t.pageNumberAriaLabel(a), kind: t.currentPage === a ? "default" : "muted", importance: t.currentPage === a ? "primary" : "clear", "label-class": "" }, on: { click: function(n) {
123
+ return t.changePage(a);
124
+ } } }, [t._v(" " + t._s(a) + " ")])], 1);
125
+ }), e("dt-button", { staticClass: "d-pagination__button", class: t.isLastPage ? "d-fc-black-300 d-bgc-transparent" : "d-fc-tertiary", attrs: { "data-qa": "dt-pagination-next", "aria-label": t.nextAriaLabel, disabled: t.isLastPage, kind: "muted", importance: t.isLastPage ? "primary" : "clear" }, on: { click: function(a) {
126
+ return t.changePage(t.currentPage + 1);
127
+ } } }, [e("template", { slot: "icon" }, [e("dt-icon", { attrs: { name: "chevron-right", size: "300" } })], 1)], 2)], 2);
128
+ }, g = [], d = /* @__PURE__ */ s(
129
+ l,
130
+ u,
131
+ g,
132
+ !1,
133
+ null,
134
+ null,
135
+ null,
136
+ null
137
+ );
138
+ const x = d.exports;
139
+ export {
140
+ x as DtPagination
141
+ };
142
+ //# sourceMappingURL=pagination.js.map