@dialpad/dialtone-vue 2.127.0 → 2.127.2

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 (422) hide show
  1. package/dist/chunks/_plugin-vue2_normalizer-1aBeR4AK.js +59 -0
  2. package/dist/chunks/_plugin-vue2_normalizer-1aBeR4AK.js.map +1 -0
  3. package/dist/chunks/_plugin-vue2_normalizer-sOSkiPF3.js +60 -0
  4. package/dist/chunks/_plugin-vue2_normalizer-sOSkiPF3.js.map +1 -0
  5. package/dist/chunks/{dropdown-SMWaTWyF.js → dropdown-DTtcQEFC.js} +131 -84
  6. package/dist/chunks/{dropdown-SMWaTWyF.js.map → dropdown-DTtcQEFC.js.map} +1 -1
  7. package/dist/chunks/dropdown-IaLNHmVd.js +403 -0
  8. package/dist/chunks/{dropdown-zhMEz3bn.js.map → dropdown-IaLNHmVd.js.map} +1 -1
  9. package/dist/chunks/dropdown_constants-2pGCXy7m.js +8 -0
  10. package/dist/chunks/dropdown_constants-2pGCXy7m.js.map +1 -0
  11. package/dist/chunks/dropdown_constants-w1MXGC3Z.js +9 -0
  12. package/dist/chunks/dropdown_constants-w1MXGC3Z.js.map +1 -0
  13. package/dist/chunks/{icon_constants-OpYAAKwF.js → icon_constants-Dy4MEUJL.js} +7 -6
  14. package/dist/chunks/{icon_constants-2S_OSQ1t.js.map → icon_constants-Dy4MEUJL.js.map} +1 -1
  15. package/dist/chunks/icon_constants-QYpmdE0R.js +16 -0
  16. package/dist/chunks/{icon_constants-OpYAAKwF.js.map → icon_constants-QYpmdE0R.js.map} +1 -1
  17. package/dist/chunks/index-eJ-WWRdf.js +442 -0
  18. package/dist/chunks/{index-2jPosQBn.js.map → index-eJ-WWRdf.js.map} +1 -1
  19. package/dist/chunks/index-gj1jEXP4.js +441 -0
  20. package/dist/chunks/{index-nIyl_PL6.js.map → index-gj1jEXP4.js.map} +1 -1
  21. package/dist/chunks/{input-1tm09l_-.js → input-6kbd8Pju.js} +83 -60
  22. package/dist/chunks/{input-o-fc1X4b.js.map → input-6kbd8Pju.js.map} +1 -1
  23. package/dist/chunks/input-Axw-wFj2.js +295 -0
  24. package/dist/chunks/{input-1tm09l_-.js.map → input-Axw-wFj2.js.map} +1 -1
  25. package/dist/chunks/input_group-m3cWYUfI.js +143 -0
  26. package/dist/chunks/{input_group-zcAq3DQl.js.map → input_group-m3cWYUfI.js.map} +1 -1
  27. package/dist/chunks/{input_group-zcAq3DQl.js → input_group-qVZaS5Bb.js} +27 -24
  28. package/dist/chunks/{input_group-j2gTtc1C.js.map → input_group-qVZaS5Bb.js.map} +1 -1
  29. package/dist/chunks/keyboard_list_navigation-ScXhrxya.js +284 -0
  30. package/dist/chunks/{keyboard_list_navigation-N74Bpdq7.js.map → keyboard_list_navigation-ScXhrxya.js.map} +1 -1
  31. package/dist/chunks/keyboard_list_navigation-fJnl_Iox.js +283 -0
  32. package/dist/chunks/{keyboard_list_navigation-F0O8nht0.js.map → keyboard_list_navigation-fJnl_Iox.js.map} +1 -1
  33. package/dist/chunks/link_constants-Huj7D_hm.js +22 -0
  34. package/dist/chunks/{link_constants-Kn6kP4i1.js.map → link_constants-Huj7D_hm.js.map} +1 -1
  35. package/dist/chunks/link_constants-nWVlXQBs.js +23 -0
  36. package/dist/chunks/{link_constants-vIUB92L4.js.map → link_constants-nWVlXQBs.js.map} +1 -1
  37. package/dist/chunks/list_item_constants-EiqkqZvP.js +13 -0
  38. package/dist/chunks/{list_item_constants-Tsz5CO1m.js.map → list_item_constants-EiqkqZvP.js.map} +1 -1
  39. package/dist/chunks/list_item_constants-u1xcN9Dd.js +14 -0
  40. package/dist/chunks/{list_item_constants-LTUc74pD.js.map → list_item_constants-u1xcN9Dd.js.map} +1 -1
  41. package/dist/chunks/modal-VgxXAQFP.js +105 -0
  42. package/dist/chunks/{modal-qEzlo0Sj.js.map → modal-VgxXAQFP.js.map} +1 -1
  43. package/dist/chunks/modal-XOr4kiNZ.js +106 -0
  44. package/dist/chunks/{modal-VuMFkZFH.js.map → modal-XOr4kiNZ.js.map} +1 -1
  45. package/dist/chunks/notice_action-IRUoLX2d.js +196 -0
  46. package/dist/chunks/{notice_action-u3ZKIhit.js.map → notice_action-IRUoLX2d.js.map} +1 -1
  47. package/dist/chunks/notice_action-P6uDyE9x.js +195 -0
  48. package/dist/chunks/{notice_action-9NmtQRai.js.map → notice_action-P6uDyE9x.js.map} +1 -1
  49. package/dist/chunks/notice_constants-7Qt2CQEY.js +7 -0
  50. package/dist/chunks/{notice_constants-mC6al2Dm.js.map → notice_constants-7Qt2CQEY.js.map} +1 -1
  51. package/dist/chunks/notice_constants-UXo9e3bS.js +6 -0
  52. package/dist/chunks/{notice_constants-c--hBFQw.js.map → notice_constants-UXo9e3bS.js.map} +1 -1
  53. package/dist/chunks/popover_constants-JwBF9h1Z.js +143 -0
  54. package/dist/chunks/{popover_constants-hOEhklvr.js.map → popover_constants-JwBF9h1Z.js.map} +1 -1
  55. package/dist/chunks/popover_constants-Qkpb0yh2.js +144 -0
  56. package/dist/chunks/{popover_constants-qjlEkroB.js.map → popover_constants-Qkpb0yh2.js.map} +1 -1
  57. package/dist/chunks/sr_only_close_button-81bHIpPu.js +95 -0
  58. package/dist/chunks/{sr_only_close_button-ErijKGYR.js.map → sr_only_close_button-81bHIpPu.js.map} +1 -1
  59. package/dist/chunks/sr_only_close_button-ZaGdAHz7.js +94 -0
  60. package/dist/chunks/{sr_only_close_button-JGole5Xi.js.map → sr_only_close_button-ZaGdAHz7.js.map} +1 -1
  61. package/dist/chunks/stack_constants-HraCekPm.js +15 -0
  62. package/dist/chunks/{stack_constants-m9Ickqw0.js.map → stack_constants-HraCekPm.js.map} +1 -1
  63. package/dist/chunks/stack_constants-SMzMWnAQ.js +14 -0
  64. package/dist/chunks/{stack_constants-u7tNqGtc.js.map → stack_constants-SMzMWnAQ.js.map} +1 -1
  65. package/dist/chunks/tab-FcsV5VmK.js +386 -0
  66. package/dist/chunks/{tab-7hJQSLFx.js.map → tab-FcsV5VmK.js.map} +1 -1
  67. package/dist/chunks/tab-V4cb44Ry.js +387 -0
  68. package/dist/chunks/{tab-Qm9LVkYj.js.map → tab-V4cb44Ry.js.map} +1 -1
  69. package/dist/common/constants.cjs +60 -0
  70. package/dist/{lib → common}/constants.cjs.map +1 -1
  71. package/dist/{lib → common}/constants.js +25 -18
  72. package/dist/{lib → common}/constants.js.map +1 -1
  73. package/dist/common/dates.cjs +72 -0
  74. package/dist/{lib → common}/dates.cjs.map +1 -1
  75. package/dist/common/dates.js +72 -0
  76. package/dist/{lib → common}/dates.js.map +1 -1
  77. package/dist/common/emoji.cjs +163 -0
  78. package/dist/common/emoji.cjs.map +1 -0
  79. package/dist/common/emoji.js +168 -0
  80. package/dist/common/emoji.js.map +1 -0
  81. package/dist/common/mixins.cjs +17 -0
  82. package/dist/{lib → common}/mixins.cjs.map +1 -1
  83. package/dist/common/mixins.js +17 -0
  84. package/dist/common/utils.cjs +237 -0
  85. package/dist/{lib → common}/utils.cjs.map +1 -1
  86. package/dist/common/utils.js +237 -0
  87. package/dist/{lib → common}/utils.js.map +1 -1
  88. package/dist/common/validators.cjs +23 -0
  89. package/dist/{lib → common}/validators.cjs.map +1 -1
  90. package/dist/common/validators.js +23 -0
  91. package/dist/{lib → common}/validators.js.map +1 -1
  92. package/dist/dialtone-vue.cjs +372 -1
  93. package/dist/dialtone-vue.cjs.map +1 -1
  94. package/dist/dialtone-vue.js +325 -324
  95. package/dist/dialtone-vue.js.map +1 -1
  96. package/dist/lib/attachment-carousel.cjs +260 -1
  97. package/dist/lib/attachment-carousel.cjs.map +1 -1
  98. package/dist/lib/attachment-carousel.js +96 -84
  99. package/dist/lib/attachment-carousel.js.map +1 -1
  100. package/dist/lib/avatar.cjs +399 -1
  101. package/dist/lib/avatar.cjs.map +1 -1
  102. package/dist/lib/avatar.js +111 -79
  103. package/dist/lib/avatar.js.map +1 -1
  104. package/dist/lib/badge.cjs +182 -1
  105. package/dist/lib/badge.cjs.map +1 -1
  106. package/dist/lib/badge.js +53 -38
  107. package/dist/lib/badge.js.map +1 -1
  108. package/dist/lib/banner.cjs +209 -2
  109. package/dist/lib/banner.cjs.map +1 -1
  110. package/dist/lib/banner.js +58 -47
  111. package/dist/lib/banner.js.map +1 -1
  112. package/dist/lib/breadcrumbs.cjs +146 -1
  113. package/dist/lib/breadcrumbs.cjs.map +1 -1
  114. package/dist/lib/breadcrumbs.js +57 -48
  115. package/dist/lib/breadcrumbs.js.map +1 -1
  116. package/dist/lib/button-group.cjs +47 -1
  117. package/dist/lib/button-group.cjs.map +1 -1
  118. package/dist/lib/button-group.js +21 -18
  119. package/dist/lib/button-group.js.map +1 -1
  120. package/dist/lib/button.cjs +349 -1
  121. package/dist/lib/button.cjs.map +1 -1
  122. package/dist/lib/button.js +98 -76
  123. package/dist/lib/button.js.map +1 -1
  124. package/dist/lib/callbar-button-with-popover.cjs +249 -1
  125. package/dist/lib/callbar-button-with-popover.cjs.map +1 -1
  126. package/dist/lib/callbar-button-with-popover.js +66 -50
  127. package/dist/lib/callbar-button-with-popover.js.map +1 -1
  128. package/dist/lib/callbar-button.cjs +182 -1
  129. package/dist/lib/callbar-button.cjs.map +1 -1
  130. package/dist/lib/callbar-button.js +42 -34
  131. package/dist/lib/callbar-button.js.map +1 -1
  132. package/dist/lib/callbox.cjs +146 -1
  133. package/dist/lib/callbox.cjs.map +1 -1
  134. package/dist/lib/callbox.js +38 -32
  135. package/dist/lib/callbox.js.map +1 -1
  136. package/dist/lib/card.cjs +73 -1
  137. package/dist/lib/card.cjs.map +1 -1
  138. package/dist/lib/card.js +22 -20
  139. package/dist/lib/card.js.map +1 -1
  140. package/dist/lib/checkbox-group.cjs +129 -1
  141. package/dist/lib/checkbox-group.cjs.map +1 -1
  142. package/dist/lib/checkbox-group.js +42 -29
  143. package/dist/lib/checkbox-group.js.map +1 -1
  144. package/dist/lib/checkbox.cjs +127 -1
  145. package/dist/lib/checkbox.cjs.map +1 -1
  146. package/dist/lib/checkbox.js +46 -35
  147. package/dist/lib/checkbox.js.map +1 -1
  148. package/dist/lib/chip.cjs +198 -1
  149. package/dist/lib/chip.cjs.map +1 -1
  150. package/dist/lib/chip.js +59 -45
  151. package/dist/lib/chip.js.map +1 -1
  152. package/dist/lib/codeblock.cjs +29 -2
  153. package/dist/lib/codeblock.cjs.map +1 -1
  154. package/dist/lib/codeblock.js +15 -14
  155. package/dist/lib/codeblock.js.map +1 -1
  156. package/dist/lib/collapsible.cjs +334 -1
  157. package/dist/lib/collapsible.cjs.map +1 -1
  158. package/dist/lib/collapsible.js +91 -68
  159. package/dist/lib/collapsible.js.map +1 -1
  160. package/dist/lib/combobox-multi-select.cjs +519 -1
  161. package/dist/lib/combobox-multi-select.cjs.map +1 -1
  162. package/dist/lib/combobox-multi-select.js +223 -136
  163. package/dist/lib/combobox-multi-select.js.map +1 -1
  164. package/dist/lib/combobox-with-popover.cjs +384 -1
  165. package/dist/lib/combobox-with-popover.cjs.map +1 -1
  166. package/dist/lib/combobox-with-popover.js +130 -86
  167. package/dist/lib/combobox-with-popover.js.map +1 -1
  168. package/dist/lib/combobox.cjs +18 -1
  169. package/dist/lib/combobox.cjs.map +1 -1
  170. package/dist/lib/combobox.js +9 -9
  171. package/dist/lib/contact-info.cjs +145 -1
  172. package/dist/lib/contact-info.cjs.map +1 -1
  173. package/dist/lib/contact-info.js +34 -32
  174. package/dist/lib/contact-info.js.map +1 -1
  175. package/dist/lib/contact-row.cjs +205 -1
  176. package/dist/lib/contact-row.cjs.map +1 -1
  177. package/dist/lib/contact-row.js +42 -39
  178. package/dist/lib/contact-row.js.map +1 -1
  179. package/dist/lib/datepicker.cjs +662 -1
  180. package/dist/lib/datepicker.cjs.map +1 -1
  181. package/dist/lib/datepicker.js +330 -218
  182. package/dist/lib/datepicker.js.map +1 -1
  183. package/dist/lib/description-list.cjs +114 -1
  184. package/dist/lib/description-list.cjs.map +1 -1
  185. package/dist/lib/description-list.js +51 -19
  186. package/dist/lib/description-list.js.map +1 -1
  187. package/dist/lib/dropdown.cjs +45 -1
  188. package/dist/lib/dropdown.cjs.map +1 -1
  189. package/dist/lib/dropdown.js +27 -25
  190. package/dist/lib/dropdown.js.map +1 -1
  191. package/dist/lib/editor.cjs +555 -1
  192. package/dist/lib/editor.cjs.map +1 -1
  193. package/dist/lib/editor.js +191 -162
  194. package/dist/lib/editor.js.map +1 -1
  195. package/dist/lib/emoji-picker.cjs +1063 -1
  196. package/dist/lib/emoji-picker.cjs.map +1 -1
  197. package/dist/lib/emoji-picker.js +638 -374
  198. package/dist/lib/emoji-picker.js.map +1 -1
  199. package/dist/lib/emoji-row.cjs +88 -1
  200. package/dist/lib/emoji-row.cjs.map +1 -1
  201. package/dist/lib/emoji-row.js +46 -40
  202. package/dist/lib/emoji-row.js.map +1 -1
  203. package/dist/lib/emoji-text-wrapper.cjs +109 -1
  204. package/dist/lib/emoji-text-wrapper.cjs.map +1 -1
  205. package/dist/lib/emoji-text-wrapper.js +49 -35
  206. package/dist/lib/emoji-text-wrapper.js.map +1 -1
  207. package/dist/lib/emoji.cjs +145 -1
  208. package/dist/lib/emoji.cjs.map +1 -1
  209. package/dist/lib/emoji.js +140 -5
  210. package/dist/lib/emoji.js.map +1 -1
  211. package/dist/lib/feed-item-row.cjs +213 -1
  212. package/dist/lib/feed-item-row.cjs.map +1 -1
  213. package/dist/lib/feed-item-row.js +71 -63
  214. package/dist/lib/feed-item-row.js.map +1 -1
  215. package/dist/lib/feed-pill.cjs +149 -1
  216. package/dist/lib/feed-pill.cjs.map +1 -1
  217. package/dist/lib/feed-pill.js +60 -51
  218. package/dist/lib/feed-pill.js.map +1 -1
  219. package/dist/lib/general-row.cjs +405 -1
  220. package/dist/lib/general-row.cjs.map +1 -1
  221. package/dist/lib/general-row.js +133 -106
  222. package/dist/lib/general-row.js.map +1 -1
  223. package/dist/lib/group-row.cjs +117 -1
  224. package/dist/lib/group-row.cjs.map +1 -1
  225. package/dist/lib/group-row.js +33 -30
  226. package/dist/lib/group-row.js.map +1 -1
  227. package/dist/lib/grouped-chip.cjs +45 -1
  228. package/dist/lib/grouped-chip.cjs.map +1 -1
  229. package/dist/lib/grouped-chip.js +28 -26
  230. package/dist/lib/grouped-chip.js.map +1 -1
  231. package/dist/lib/hovercard.cjs +227 -1
  232. package/dist/lib/hovercard.cjs.map +1 -1
  233. package/dist/lib/hovercard.js +98 -63
  234. package/dist/lib/hovercard.js.map +1 -1
  235. package/dist/lib/icon.cjs +59 -1
  236. package/dist/lib/icon.cjs.map +1 -1
  237. package/dist/lib/icon.js +22 -20
  238. package/dist/lib/icon.js.map +1 -1
  239. package/dist/lib/image-viewer.cjs +190 -1
  240. package/dist/lib/image-viewer.cjs.map +1 -1
  241. package/dist/lib/image-viewer.js +83 -62
  242. package/dist/lib/image-viewer.js.map +1 -1
  243. package/dist/lib/input-group.cjs +91 -1
  244. package/dist/lib/input-group.cjs.map +1 -1
  245. package/dist/lib/input-group.js +29 -27
  246. package/dist/lib/input-group.js.map +1 -1
  247. package/dist/lib/input.cjs +492 -1
  248. package/dist/lib/input.cjs.map +1 -1
  249. package/dist/lib/input.js +127 -89
  250. package/dist/lib/input.js.map +1 -1
  251. package/dist/lib/item-layout.cjs +40 -1
  252. package/dist/lib/item-layout.cjs.map +1 -1
  253. package/dist/lib/item-layout.js +15 -13
  254. package/dist/lib/item-layout.js.map +1 -1
  255. package/dist/lib/ivr-node.cjs +209 -1
  256. package/dist/lib/ivr-node.cjs.map +1 -1
  257. package/dist/lib/ivr-node.js +115 -99
  258. package/dist/lib/ivr-node.js.map +1 -1
  259. package/dist/lib/keyboard-shortcut.cjs +106 -1
  260. package/dist/lib/keyboard-shortcut.cjs.map +1 -1
  261. package/dist/lib/keyboard-shortcut.js +42 -34
  262. package/dist/lib/keyboard-shortcut.js.map +1 -1
  263. package/dist/lib/lazy-show.cjs +80 -1
  264. package/dist/lib/lazy-show.cjs.map +1 -1
  265. package/dist/lib/lazy-show.js +20 -16
  266. package/dist/lib/lazy-show.js.map +1 -1
  267. package/dist/lib/link.cjs +70 -1
  268. package/dist/lib/link.cjs.map +1 -1
  269. package/dist/lib/link.js +22 -20
  270. package/dist/lib/link.js.map +1 -1
  271. package/dist/lib/list-item-group.cjs +60 -1
  272. package/dist/lib/list-item-group.cjs.map +1 -1
  273. package/dist/lib/list-item-group.js +19 -17
  274. package/dist/lib/list-item-group.js.map +1 -1
  275. package/dist/lib/list-item.cjs +204 -1
  276. package/dist/lib/list-item.cjs.map +1 -1
  277. package/dist/lib/list-item.js +67 -56
  278. package/dist/lib/list-item.js.map +1 -1
  279. package/dist/lib/message-input.cjs +554 -1
  280. package/dist/lib/message-input.cjs.map +1 -1
  281. package/dist/lib/message-input.js +174 -152
  282. package/dist/lib/message-input.js.map +1 -1
  283. package/dist/lib/modal.cjs +350 -2
  284. package/dist/lib/modal.cjs.map +1 -1
  285. package/dist/lib/modal.js +118 -90
  286. package/dist/lib/modal.js.map +1 -1
  287. package/dist/lib/notice.cjs +159 -1
  288. package/dist/lib/notice.cjs.map +1 -1
  289. package/dist/lib/notice.js +46 -43
  290. package/dist/lib/notice.js.map +1 -1
  291. package/dist/lib/pagination.cjs +152 -1
  292. package/dist/lib/pagination.cjs.map +1 -1
  293. package/dist/lib/pagination.js +60 -48
  294. package/dist/lib/pagination.js.map +1 -1
  295. package/dist/lib/popover.cjs +956 -1
  296. package/dist/lib/popover.cjs.map +1 -1
  297. package/dist/lib/popover.js +401 -221
  298. package/dist/lib/popover.js.map +1 -1
  299. package/dist/lib/presence.cjs +65 -1
  300. package/dist/lib/presence.cjs.map +1 -1
  301. package/dist/lib/presence.js +32 -26
  302. package/dist/lib/presence.js.map +1 -1
  303. package/dist/lib/radio-group.cjs +98 -1
  304. package/dist/lib/radio-group.cjs.map +1 -1
  305. package/dist/lib/radio-group.js +24 -22
  306. package/dist/lib/radio-group.js.map +1 -1
  307. package/dist/lib/radio.cjs +118 -1
  308. package/dist/lib/radio.cjs.map +1 -1
  309. package/dist/lib/radio.js +43 -35
  310. package/dist/lib/radio.js.map +1 -1
  311. package/dist/lib/rich-text-editor.cjs +1138 -1
  312. package/dist/lib/rich-text-editor.cjs.map +1 -1
  313. package/dist/lib/rich-text-editor.js +574 -387
  314. package/dist/lib/rich-text-editor.js.map +1 -1
  315. package/dist/lib/root-layout.cjs +130 -1
  316. package/dist/lib/root-layout.cjs.map +1 -1
  317. package/dist/lib/root-layout.js +28 -24
  318. package/dist/lib/root-layout.js.map +1 -1
  319. package/dist/lib/select-menu.cjs +282 -1
  320. package/dist/lib/select-menu.cjs.map +1 -1
  321. package/dist/lib/select-menu.js +101 -61
  322. package/dist/lib/select-menu.js.map +1 -1
  323. package/dist/lib/settings-menu-button.cjs +65 -1
  324. package/dist/lib/settings-menu-button.cjs.map +1 -1
  325. package/dist/lib/settings-menu-button.js +26 -24
  326. package/dist/lib/settings-menu-button.js.map +1 -1
  327. package/dist/lib/skeleton.cjs +612 -1
  328. package/dist/lib/skeleton.cjs.map +1 -1
  329. package/dist/lib/skeleton.js +174 -135
  330. package/dist/lib/skeleton.js.map +1 -1
  331. package/dist/lib/stack.cjs +127 -1
  332. package/dist/lib/stack.cjs.map +1 -1
  333. package/dist/lib/stack.js +66 -56
  334. package/dist/lib/stack.js.map +1 -1
  335. package/dist/lib/tabs.cjs +99 -1
  336. package/dist/lib/tabs.cjs.map +1 -1
  337. package/dist/lib/tabs.js +42 -35
  338. package/dist/lib/tabs.js.map +1 -1
  339. package/dist/lib/time-pill.cjs +47 -1
  340. package/dist/lib/time-pill.cjs.map +1 -1
  341. package/dist/lib/time-pill.js +21 -16
  342. package/dist/lib/time-pill.js.map +1 -1
  343. package/dist/lib/toast.cjs +247 -1
  344. package/dist/lib/toast.cjs.map +1 -1
  345. package/dist/lib/toast.js +78 -55
  346. package/dist/lib/toast.js.map +1 -1
  347. package/dist/lib/toggle.cjs +177 -1
  348. package/dist/lib/toggle.cjs.map +1 -1
  349. package/dist/lib/toggle.js +46 -37
  350. package/dist/lib/toggle.js.map +1 -1
  351. package/dist/lib/tooltip-directive.cjs +87 -1
  352. package/dist/lib/tooltip-directive.cjs.map +1 -1
  353. package/dist/lib/tooltip-directive.js +55 -41
  354. package/dist/lib/tooltip-directive.js.map +1 -1
  355. package/dist/lib/tooltip.cjs +436 -1
  356. package/dist/lib/tooltip.cjs.map +1 -1
  357. package/dist/lib/tooltip.js +152 -90
  358. package/dist/lib/tooltip.js.map +1 -1
  359. package/dist/lib/top-banner-info.cjs +63 -1
  360. package/dist/lib/top-banner-info.cjs.map +1 -1
  361. package/dist/lib/top-banner-info.js +22 -18
  362. package/dist/lib/top-banner-info.js.map +1 -1
  363. package/dist/lib/unread-pill.cjs +63 -1
  364. package/dist/lib/unread-pill.cjs.map +1 -1
  365. package/dist/lib/unread-pill.js +25 -21
  366. package/dist/lib/unread-pill.js.map +1 -1
  367. package/dist/lib/validation-messages.cjs +85 -1
  368. package/dist/lib/validation-messages.cjs.map +1 -1
  369. package/dist/lib/validation-messages.js +32 -29
  370. package/dist/lib/validation-messages.js.map +1 -1
  371. package/dist/style.css +1214 -1
  372. package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +2 -2
  373. package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +2 -2
  374. package/package.json +31 -30
  375. package/dist/chunks/_plugin-vue2_normalizer-ZK80B3OL.js +0 -2
  376. package/dist/chunks/_plugin-vue2_normalizer-ZK80B3OL.js.map +0 -1
  377. package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js +0 -33
  378. package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js.map +0 -1
  379. package/dist/chunks/dropdown-zhMEz3bn.js +0 -2
  380. package/dist/chunks/dropdown_constants-EUcDxBrX.js +0 -9
  381. package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +0 -1
  382. package/dist/chunks/dropdown_constants-KHFvVI2L.js +0 -2
  383. package/dist/chunks/dropdown_constants-KHFvVI2L.js.map +0 -1
  384. package/dist/chunks/icon_constants-2S_OSQ1t.js +0 -2
  385. package/dist/chunks/index-2jPosQBn.js +0 -3
  386. package/dist/chunks/index-YkSDT8-g.js +0 -244
  387. package/dist/chunks/index-YkSDT8-g.js.map +0 -1
  388. package/dist/chunks/index-nIyl_PL6.js +0 -372
  389. package/dist/chunks/index-sdfB7Aok.js +0 -2
  390. package/dist/chunks/index-sdfB7Aok.js.map +0 -1
  391. package/dist/chunks/input-o-fc1X4b.js +0 -2
  392. package/dist/chunks/input_group-j2gTtc1C.js +0 -2
  393. package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +0 -197
  394. package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js +0 -2
  395. package/dist/chunks/link_constants-Kn6kP4i1.js +0 -2
  396. package/dist/chunks/link_constants-vIUB92L4.js +0 -16
  397. package/dist/chunks/list_item_constants-LTUc74pD.js +0 -13
  398. package/dist/chunks/list_item_constants-Tsz5CO1m.js +0 -2
  399. package/dist/chunks/modal-VuMFkZFH.js +0 -82
  400. package/dist/chunks/modal-qEzlo0Sj.js +0 -2
  401. package/dist/chunks/notice_action-9NmtQRai.js +0 -182
  402. package/dist/chunks/notice_action-u3ZKIhit.js +0 -2
  403. package/dist/chunks/notice_constants-c--hBFQw.js +0 -6
  404. package/dist/chunks/notice_constants-mC6al2Dm.js +0 -2
  405. package/dist/chunks/popover_constants-hOEhklvr.js +0 -2
  406. package/dist/chunks/popover_constants-qjlEkroB.js +0 -114
  407. package/dist/chunks/sr_only_close_button-ErijKGYR.js +0 -3
  408. package/dist/chunks/sr_only_close_button-JGole5Xi.js +0 -86
  409. package/dist/chunks/stack_constants-m9Ickqw0.js +0 -2
  410. package/dist/chunks/stack_constants-u7tNqGtc.js +0 -13
  411. package/dist/chunks/tab-7hJQSLFx.js +0 -2
  412. package/dist/chunks/tab-Qm9LVkYj.js +0 -346
  413. package/dist/lib/constants.cjs +0 -2
  414. package/dist/lib/dates.cjs +0 -2
  415. package/dist/lib/dates.js +0 -57
  416. package/dist/lib/mixins.cjs +0 -2
  417. package/dist/lib/mixins.js +0 -17
  418. package/dist/lib/utils.cjs +0 -2
  419. package/dist/lib/utils.js +0 -175
  420. package/dist/lib/validators.cjs +0 -2
  421. package/dist/lib/validators.js +0 -12
  422. /package/dist/{lib → common}/mixins.js.map +0 -0
@@ -1,22 +1,22 @@
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";
1
+ import { DtNoticeIcon, DtNoticeContent, DtNoticeAction } from "../chunks/notice_action-IRUoLX2d.js";
2
+ import { NOTICE_ROLES, NOTICE_KINDS } from "../chunks/notice_constants-7Qt2CQEY.js";
3
+ import { SrOnlyCloseButtonMixin } from "../chunks/sr_only_close_button-81bHIpPu.js";
4
+ import { normalizeComponent } from "../chunks/_plugin-vue2_normalizer-sOSkiPF3.js";
5
5
  import "./icon.js";
6
6
  import "@dialpad/dialtone-icons/vue2";
7
- import "../chunks/icon_constants-OpYAAKwF.js";
7
+ import "../chunks/icon_constants-Dy4MEUJL.js";
8
8
  import "@dialpad/dialtone-icons/icons.json";
9
9
  import "./button.js";
10
10
  import "vue";
11
- import "../chunks/link_constants-vIUB92L4.js";
12
- const d = {
11
+ import "../chunks/link_constants-nWVlXQBs.js";
12
+ const _sfc_main = {
13
13
  name: "DtNotice",
14
14
  components: {
15
- DtNoticeIcon: i,
16
- DtNoticeContent: o,
17
- DtNoticeAction: s
15
+ DtNoticeIcon,
16
+ DtNoticeContent,
17
+ DtNoticeAction
18
18
  },
19
- mixins: [a],
19
+ mixins: [SrOnlyCloseButtonMixin],
20
20
  props: {
21
21
  /**
22
22
  * Sets an ID on the title element of the component. Useful for aria-describedby
@@ -50,8 +50,8 @@ const d = {
50
50
  role: {
51
51
  type: String,
52
52
  default: "status",
53
- validate(e) {
54
- return l.includes(e);
53
+ validate(role) {
54
+ return NOTICE_ROLES.includes(role);
55
55
  }
56
56
  },
57
57
  /**
@@ -61,7 +61,7 @@ const d = {
61
61
  */
62
62
  important: {
63
63
  type: Boolean,
64
- default: !1
64
+ default: false
65
65
  },
66
66
  /**
67
67
  * Severity level of the notice, sets the icon and background
@@ -70,8 +70,8 @@ const d = {
70
70
  kind: {
71
71
  type: String,
72
72
  default: "base",
73
- validate(e) {
74
- return r.includes(e);
73
+ validate(kind) {
74
+ return NOTICE_KINDS.includes(kind);
75
75
  }
76
76
  },
77
77
  /**
@@ -87,7 +87,7 @@ const d = {
87
87
  */
88
88
  hideClose: {
89
89
  type: Boolean,
90
- default: !1
90
+ default: false
91
91
  },
92
92
  /**
93
93
  * Hides the icon from the notice
@@ -95,7 +95,7 @@ const d = {
95
95
  */
96
96
  hideIcon: {
97
97
  type: Boolean,
98
- default: !1
98
+ default: false
99
99
  },
100
100
  /**
101
101
  * Hides the action from the notice
@@ -103,7 +103,7 @@ const d = {
103
103
  */
104
104
  hideAction: {
105
105
  type: Boolean,
106
- default: !1
106
+ default: false
107
107
  }
108
108
  },
109
109
  emits: [
@@ -116,42 +116,45 @@ const d = {
116
116
  ],
117
117
  computed: {
118
118
  noticeClass() {
119
+ const noticeKinds = {
120
+ error: "d-notice--error",
121
+ info: "d-notice--info",
122
+ success: "d-notice--success",
123
+ warning: "d-notice--warning",
124
+ base: "d-notice--base"
125
+ };
119
126
  return [
120
127
  "d-notice",
121
- {
122
- error: "d-notice--error",
123
- info: "d-notice--info",
124
- success: "d-notice--success",
125
- warning: "d-notice--warning",
126
- base: "d-notice--base"
127
- }[this.kind],
128
+ noticeKinds[this.kind],
128
129
  { "d-notice--important": this.important }
129
130
  ];
130
131
  }
131
132
  }
132
133
  };
133
- var u = function() {
134
- var t = this, n = t._self._c;
135
- 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() {
136
- return [t._t("titleOverride")];
137
- }, 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);
138
- }, p = [], f = /* @__PURE__ */ c(
139
- d,
140
- u,
141
- p,
142
- !1,
134
+ var _sfc_render = function render() {
135
+ var _vm = this, _c = _vm._self._c;
136
+ return _c("aside", { class: _vm.noticeClass, attrs: { "data-qa": "notice" } }, [!_vm.hideIcon ? _c("dt-notice-icon", { attrs: { "kind": _vm.kind } }, [_vm._t("icon")], 2) : _vm._e(), _c("dt-notice-content", _vm._g({ attrs: { "title-id": _vm.titleId, "content-id": _vm.contentId, "title": _vm.title, "role": _vm.role }, scopedSlots: _vm._u([{ key: "titleOverride", fn: function() {
137
+ return [_vm._t("titleOverride")];
138
+ }, proxy: true }], null, true) }, _vm.$listeners), [_vm._t("default")], 2), _c("dt-notice-action", _vm._g({ attrs: { "hide-action": _vm.hideAction, "hide-close": _vm.hideClose, "close-button-props": _vm.closeButtonProps, "visually-hidden-close": _vm.visuallyHiddenClose, "visually-hidden-close-label": _vm.visuallyHiddenCloseLabel } }, _vm.$listeners), [_vm._t("action")], 2)], 1);
139
+ };
140
+ var _sfc_staticRenderFns = [];
141
+ var __component__ = /* @__PURE__ */ normalizeComponent(
142
+ _sfc_main,
143
+ _sfc_render,
144
+ _sfc_staticRenderFns,
145
+ false,
143
146
  null,
144
147
  null,
145
148
  null,
146
149
  null
147
150
  );
148
- const B = f.exports;
151
+ const notice = __component__.exports;
149
152
  export {
150
- B as DtNotice,
151
- s as DtNoticeAction,
152
- o as DtNoticeContent,
153
- i as DtNoticeIcon,
154
- r as NOTICE_KINDS,
155
- l as NOTICE_ROLES
153
+ notice as DtNotice,
154
+ DtNoticeAction,
155
+ DtNoticeContent,
156
+ DtNoticeIcon,
157
+ NOTICE_KINDS,
158
+ NOTICE_ROLES
156
159
  };
157
160
  //# sourceMappingURL=notice.js.map
@@ -1 +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","DtNoticeI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AMA,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;;;;;;;;;;;;;;;;;"}
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":[],"mappings":";;;;;;;;;;;AAoDA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,QAAA,CAAA,sBAAA;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,SAAA,MAAA;AACA,eAAA,aAAA,SAAA,IAAA;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,SAAA,MAAA;AACA,eAAA,aAAA,SAAA,IAAA;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;AACA,YAAA,cAAA;AAAA,QACA,OAAA;AAAA,QACA,MAAA;AAAA,QACA,SAAA;AAAA,QACA,SAAA;AAAA,QACA,MAAA;AAAA,MACA;AACA,aAAA;AAAA,QACA;AAAA,QACA,YAAA,KAAA,IAAA;AAAA,QACA,EAAA,uBAAA,KAAA,UAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,153 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js"),c=require("./button.cjs"),o=require("./icon.cjs");require("vue");require("../chunks/link_constants-Kn6kP4i1.js");require("@dialpad/dialtone-icons/vue2");require("../chunks/icon_constants-2S_OSQ1t.js");require("@dialpad/dialtone-icons/icons.json");const u={name:"DtPagination",components:{DtButton:c.DtButton,DtIcon:o.DtIcon},props:{ariaLabel:{type:String,required:!0},totalPages:{type:Number,required:!0},prevAriaLabel:{type:String,required:!0},nextAriaLabel:{type:String,required:!0},pageNumberAriaLabel:{type:Function,required:!0},activePage:{type:Number,default:1},maxVisible:{type:Number,default:5}},emits:["change"],data(){return{currentPage:this.activePage}},computed:{isFirstPage(){return this.currentPage===1},isLastPage(){return this.currentPage===this.totalPages},pages(){if(this.maxVisible===0)return[];if(this.totalPages<=this.maxVisible)return this.range(1,this.totalPages);const r=this.maxVisible-1,t=this.totalPages-r+1;if(this.currentPage<r)return[...this.range(1,r),"...",this.totalPages];if(this.currentPage>t)return[1,"...",...this.range(t,this.totalPages)];const a=this.maxVisible-(3-this.maxVisible%2),e=Math.floor(a/2),i=this.currentPage-e,n=this.currentPage+e;return[1,"...",...this.range(i,n),"...",this.totalPages]}},methods:{range(r,t){const a=[];r=r>0?r:1;for(let e=r;e<=t;e++)a.push(e);return a},changePage(r){this.currentPage=r,this.$emit("change",this.currentPage)}}};var l=function(){var t=this,a=t._self._c;return a("nav",{staticClass:"d-pagination",attrs:{"aria-label":t.ariaLabel}},[a("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(e){return t.changePage(t.currentPage-1)}}},[a("template",{slot:"icon"},[a("dt-icon",{attrs:{name:"chevron-left",size:"300"}})],1)],2),t._l(t.pages,function(e,i){return a("div",{key:`page-${e}-${i}`,class:{"d-pagination__separator":isNaN(Number(e))}},[isNaN(Number(e))?a("div",{staticClass:"d-pagination__separator-icon",attrs:{"data-qa":"dt-pagination-separator"}},[a("dt-icon",{attrs:{name:"more-horizontal",size:"300"}})],1):a("dt-button",{attrs:{"aria-label":t.pageNumberAriaLabel(e),kind:t.currentPage===e?"default":"muted",importance:t.currentPage===e?"primary":"clear","label-class":""},on:{click:function(n){return t.changePage(e)}}},[t._v(" "+t._s(e)+" ")])],1)}),a("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(e){return t.changePage(t.currentPage+1)}}},[a("template",{slot:"icon"},[a("dt-icon",{attrs:{name:"chevron-right",size:"300"}})],1)],2)],2)},g=[],d=s.n(u,l,g,!1,null,null,null,null);const b=d.exports;exports.DtPagination=b;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const _pluginVue2_normalizer = require("../chunks/_plugin-vue2_normalizer-1aBeR4AK.js");
4
+ const lib_button = require("./button.cjs");
5
+ const lib_icon = require("./icon.cjs");
6
+ require("vue");
7
+ require("../chunks/link_constants-Huj7D_hm.js");
8
+ require("@dialpad/dialtone-icons/vue2");
9
+ require("../chunks/icon_constants-QYpmdE0R.js");
10
+ require("@dialpad/dialtone-icons/icons.json");
11
+ const _sfc_main = {
12
+ name: "DtPagination",
13
+ components: {
14
+ DtButton: lib_button.DtButton,
15
+ DtIcon: lib_icon.DtIcon
16
+ },
17
+ props: {
18
+ /**
19
+ * Descriptive label for the pagination content.
20
+ */
21
+ ariaLabel: {
22
+ type: String,
23
+ required: true
24
+ },
25
+ /**
26
+ * The total number of the pages
27
+ */
28
+ totalPages: {
29
+ type: Number,
30
+ required: true
31
+ },
32
+ /**
33
+ * Descriptive label for the previous button.
34
+ */
35
+ prevAriaLabel: {
36
+ type: String,
37
+ required: true
38
+ },
39
+ /**
40
+ * Descriptive label for the next button.
41
+ */
42
+ nextAriaLabel: {
43
+ type: String,
44
+ required: true
45
+ },
46
+ /**
47
+ * A method that will be called to get the aria label of each page.
48
+ */
49
+ pageNumberAriaLabel: {
50
+ type: Function,
51
+ required: true
52
+ },
53
+ /**
54
+ * The active current page in the list of pages, defaults to the first page
55
+ */
56
+ activePage: {
57
+ type: Number,
58
+ default: 1
59
+ },
60
+ /**
61
+ * Determines the max pages to be shown in the list. Using an odd number is recommended.
62
+ * If an even number is given, then it will be rounded down to the nearest odd number to always
63
+ * keep current page in the middle when current page is in the mid-range.
64
+ */
65
+ maxVisible: {
66
+ type: Number,
67
+ default: 5
68
+ }
69
+ },
70
+ emits: [
71
+ /**
72
+ * Page change event
73
+ *
74
+ * @event change
75
+ * @type {Number}
76
+ */
77
+ "change"
78
+ ],
79
+ data() {
80
+ return {
81
+ currentPage: this.activePage
82
+ };
83
+ },
84
+ computed: {
85
+ isFirstPage() {
86
+ return this.currentPage === 1;
87
+ },
88
+ isLastPage() {
89
+ return this.currentPage === this.totalPages;
90
+ },
91
+ pages() {
92
+ if (this.maxVisible === 0) {
93
+ return [];
94
+ }
95
+ if (this.totalPages <= this.maxVisible) {
96
+ return this.range(1, this.totalPages);
97
+ }
98
+ const start = this.maxVisible - 1;
99
+ const end = this.totalPages - start + 1;
100
+ if (this.currentPage < start) {
101
+ return [...this.range(1, start), "...", this.totalPages];
102
+ }
103
+ if (this.currentPage > end) {
104
+ return [1, "...", ...this.range(end, this.totalPages)];
105
+ }
106
+ const total = this.maxVisible - (3 - this.maxVisible % 2);
107
+ const centerIndex = Math.floor(total / 2);
108
+ const left = this.currentPage - centerIndex;
109
+ const right = this.currentPage + centerIndex;
110
+ return [1, "...", ...this.range(left, right), "...", this.totalPages];
111
+ }
112
+ },
113
+ methods: {
114
+ range(from, to) {
115
+ const range = [];
116
+ from = from > 0 ? from : 1;
117
+ for (let i = from; i <= to; i++) {
118
+ range.push(i);
119
+ }
120
+ return range;
121
+ },
122
+ changePage(page) {
123
+ this.currentPage = page;
124
+ this.$emit("change", this.currentPage);
125
+ }
126
+ }
127
+ };
128
+ var _sfc_render = function render() {
129
+ var _vm = this, _c = _vm._self._c;
130
+ return _c("nav", { staticClass: "d-pagination", attrs: { "aria-label": _vm.ariaLabel } }, [_c("dt-button", { staticClass: "d-pagination__button", class: _vm.isFirstPage ? "d-fc-black-300 d-bgc-transparent" : "d-fc-tertiary", attrs: { "data-qa": "dt-pagination-prev", "aria-label": _vm.prevAriaLabel, "kind": _vm.isFirstPage ? "default" : "muted", "importance": _vm.isFirstPage ? "primary" : "clear", "disabled": _vm.isFirstPage }, on: { "click": function($event) {
131
+ return _vm.changePage(_vm.currentPage - 1);
132
+ } } }, [_c("template", { slot: "icon" }, [_c("dt-icon", { attrs: { "name": "chevron-left", "size": "300" } })], 1)], 2), _vm._l(_vm.pages, function(page, index) {
133
+ return _c("div", { key: `page-${page}-${index}`, class: { "d-pagination__separator": isNaN(Number(page)) } }, [isNaN(Number(page)) ? _c("div", { staticClass: "d-pagination__separator-icon", attrs: { "data-qa": "dt-pagination-separator" } }, [_c("dt-icon", { attrs: { "name": "more-horizontal", "size": "300" } })], 1) : _c("dt-button", { attrs: { "aria-label": _vm.pageNumberAriaLabel(page), "kind": _vm.currentPage === page ? "default" : "muted", "importance": _vm.currentPage === page ? "primary" : "clear", "label-class": "" }, on: { "click": function($event) {
134
+ return _vm.changePage(page);
135
+ } } }, [_vm._v(" " + _vm._s(page) + " ")])], 1);
136
+ }), _c("dt-button", { staticClass: "d-pagination__button", class: _vm.isLastPage ? "d-fc-black-300 d-bgc-transparent" : "d-fc-tertiary", attrs: { "data-qa": "dt-pagination-next", "aria-label": _vm.nextAriaLabel, "disabled": _vm.isLastPage, "kind": "muted", "importance": _vm.isLastPage ? "primary" : "clear" }, on: { "click": function($event) {
137
+ return _vm.changePage(_vm.currentPage + 1);
138
+ } } }, [_c("template", { slot: "icon" }, [_c("dt-icon", { attrs: { "name": "chevron-right", "size": "300" } })], 1)], 2)], 2);
139
+ };
140
+ var _sfc_staticRenderFns = [];
141
+ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
142
+ _sfc_main,
143
+ _sfc_render,
144
+ _sfc_staticRenderFns,
145
+ false,
146
+ null,
147
+ null,
148
+ null,
149
+ null
150
+ );
151
+ const pagination = __component__.exports;
152
+ exports.DtPagination = pagination;
2
153
  //# sourceMappingURL=pagination.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.cjs","sources":["../../components/pagination/pagination.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel\"\n class=\"d-pagination\"\n >\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-prev\"\n :aria-label=\"prevAriaLabel\"\n :kind=\"isFirstPage ? 'default' : 'muted'\"\n :importance=\"isFirstPage ? 'primary' : 'clear'\"\n :disabled=\"isFirstPage\"\n :class=\"isFirstPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage - 1)\"\n >\n <template slot=\"icon\">\n <dt-icon\n name=\"chevron-left\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <div\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page}-${index}`\"\n :class=\"{ 'd-pagination__separator': isNaN(Number(page)) }\"\n >\n <!-- eslint-disable vue/no-bare-strings-in-template -->\n <div\n v-if=\"isNaN(Number(page))\"\n class=\"d-pagination__separator-icon\"\n data-qa=\"dt-pagination-separator\"\n >\n <dt-icon\n name=\"more-horizontal\"\n size=\"300\"\n />\n <!-- … -->\n </div>\n <!-- eslint-enable vue/no-bare-strings-in-template -->\n <dt-button\n v-else\n :aria-label=\"pageNumberAriaLabel(page)\"\n :kind=\"currentPage === page ? 'default' : 'muted'\"\n :importance=\"currentPage === page ? 'primary' : 'clear'\"\n label-class=\"\"\n @click=\"changePage(page)\"\n >\n {{ page }}\n </dt-button>\n </div>\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-next\"\n :aria-label=\"nextAriaLabel\"\n :disabled=\"isLastPage\"\n kind=\"muted\"\n :importance=\"isLastPage ? 'primary' : 'clear'\"\n :class=\"isLastPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage + 1)\"\n >\n <template slot=\"icon\">\n <dt-icon\n name=\"chevron-right\"\n size=\"300\"\n />\n </template>\n </dt-button>\n </nav>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\n\n/**\n * Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.\n * @see https://dialtone.dialpad.com/components/pagination.html\n */\nexport default {\n name: 'DtPagination',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n props: {\n /**\n * Descriptive label for the pagination content.\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * The total number of the pages\n */\n totalPages: {\n type: Number,\n required: true,\n },\n\n /**\n * Descriptive label for the previous button.\n */\n prevAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Descriptive label for the next button.\n */\n nextAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * A method that will be called to get the aria label of each page.\n */\n pageNumberAriaLabel: {\n type: Function,\n required: true,\n },\n\n /**\n * The active current page in the list of pages, defaults to the first page\n */\n activePage: {\n type: Number,\n default: 1,\n },\n\n /**\n * Determines the max pages to be shown in the list. Using an odd number is recommended.\n * If an even number is given, then it will be rounded down to the nearest odd number to always\n * keep current page in the middle when current page is in the mid-range.\n */\n maxVisible: {\n type: Number,\n default: 5,\n },\n },\n\n emits: [\n /**\n * Page change event\n *\n * @event change\n * @type {Number}\n */\n 'change',\n ],\n\n data () {\n return {\n currentPage: this.activePage,\n };\n },\n\n computed: {\n isFirstPage () {\n return this.currentPage === 1;\n },\n\n isLastPage () {\n return this.currentPage === this.totalPages;\n },\n\n pages () {\n if (this.maxVisible === 0) {\n return [];\n }\n if (this.totalPages <= this.maxVisible) {\n return this.range(1, this.totalPages);\n }\n\n const start = this.maxVisible - 1;\n const end = this.totalPages - start + 1;\n\n if (this.currentPage < start) {\n return [...this.range(1, start), '...', this.totalPages];\n }\n\n if (this.currentPage > end) {\n return [1, '...', ...this.range(end, this.totalPages)];\n }\n\n // rounding to the nearest odd according to the maxlength to always show the page number in the middle.\n const total = this.maxVisible - (3 - this.maxVisible % 2);\n const centerIndex = Math.floor(total / 2);\n const left = this.currentPage - centerIndex;\n const right = this.currentPage + centerIndex;\n return [1, '...', ...this.range(left, right), '...', this.totalPages];\n },\n },\n\n methods: {\n range (from, to) {\n const range = [];\n from = from > 0 ? from : 1;\n for (let i = from; i <= to; i++) {\n range.push(i);\n }\n return range;\n },\n\n changePage (page) {\n this.currentPage = page;\n this.$emit('change', this.currentPage);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIcon","start","end","total","centerIndex","left","right","from","to","range","i","page"],"mappings":"wYA+EA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A,EACA,QAAAG,EAAAH,EAAAG,GAAAF,EAAAE,IACAD,EAAA,KAAAC,CAAA,EAEA,OAAAD,CACA,EAEA,WAAAE,EAAA,CACA,KAAA,YAAAA,EACA,KAAA,MAAA,SAAA,KAAA,WAAA,CACA,CACA,CACA"}
1
+ {"version":3,"file":"pagination.cjs","sources":["../../components/pagination/pagination.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel\"\n class=\"d-pagination\"\n >\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-prev\"\n :aria-label=\"prevAriaLabel\"\n :kind=\"isFirstPage ? 'default' : 'muted'\"\n :importance=\"isFirstPage ? 'primary' : 'clear'\"\n :disabled=\"isFirstPage\"\n :class=\"isFirstPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage - 1)\"\n >\n <template slot=\"icon\">\n <dt-icon\n name=\"chevron-left\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <div\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page}-${index}`\"\n :class=\"{ 'd-pagination__separator': isNaN(Number(page)) }\"\n >\n <!-- eslint-disable vue/no-bare-strings-in-template -->\n <div\n v-if=\"isNaN(Number(page))\"\n class=\"d-pagination__separator-icon\"\n data-qa=\"dt-pagination-separator\"\n >\n <dt-icon\n name=\"more-horizontal\"\n size=\"300\"\n />\n <!-- … -->\n </div>\n <!-- eslint-enable vue/no-bare-strings-in-template -->\n <dt-button\n v-else\n :aria-label=\"pageNumberAriaLabel(page)\"\n :kind=\"currentPage === page ? 'default' : 'muted'\"\n :importance=\"currentPage === page ? 'primary' : 'clear'\"\n label-class=\"\"\n @click=\"changePage(page)\"\n >\n {{ page }}\n </dt-button>\n </div>\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-next\"\n :aria-label=\"nextAriaLabel\"\n :disabled=\"isLastPage\"\n kind=\"muted\"\n :importance=\"isLastPage ? 'primary' : 'clear'\"\n :class=\"isLastPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage + 1)\"\n >\n <template slot=\"icon\">\n <dt-icon\n name=\"chevron-right\"\n size=\"300\"\n />\n </template>\n </dt-button>\n </nav>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\n\n/**\n * Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.\n * @see https://dialtone.dialpad.com/components/pagination.html\n */\nexport default {\n name: 'DtPagination',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n props: {\n /**\n * Descriptive label for the pagination content.\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * The total number of the pages\n */\n totalPages: {\n type: Number,\n required: true,\n },\n\n /**\n * Descriptive label for the previous button.\n */\n prevAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Descriptive label for the next button.\n */\n nextAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * A method that will be called to get the aria label of each page.\n */\n pageNumberAriaLabel: {\n type: Function,\n required: true,\n },\n\n /**\n * The active current page in the list of pages, defaults to the first page\n */\n activePage: {\n type: Number,\n default: 1,\n },\n\n /**\n * Determines the max pages to be shown in the list. Using an odd number is recommended.\n * If an even number is given, then it will be rounded down to the nearest odd number to always\n * keep current page in the middle when current page is in the mid-range.\n */\n maxVisible: {\n type: Number,\n default: 5,\n },\n },\n\n emits: [\n /**\n * Page change event\n *\n * @event change\n * @type {Number}\n */\n 'change',\n ],\n\n data () {\n return {\n currentPage: this.activePage,\n };\n },\n\n computed: {\n isFirstPage () {\n return this.currentPage === 1;\n },\n\n isLastPage () {\n return this.currentPage === this.totalPages;\n },\n\n pages () {\n if (this.maxVisible === 0) {\n return [];\n }\n if (this.totalPages <= this.maxVisible) {\n return this.range(1, this.totalPages);\n }\n\n const start = this.maxVisible - 1;\n const end = this.totalPages - start + 1;\n\n if (this.currentPage < start) {\n return [...this.range(1, start), '...', this.totalPages];\n }\n\n if (this.currentPage > end) {\n return [1, '...', ...this.range(end, this.totalPages)];\n }\n\n // rounding to the nearest odd according to the maxlength to always show the page number in the middle.\n const total = this.maxVisible - (3 - this.maxVisible % 2);\n const centerIndex = Math.floor(total / 2);\n const left = this.currentPage - centerIndex;\n const right = this.currentPage + centerIndex;\n return [1, '...', ...this.range(left, right), '...', this.totalPages];\n },\n },\n\n methods: {\n range (from, to) {\n const range = [];\n from = from > 0 ? from : 1;\n for (let i = from; i <= to; i++) {\n range.push(i);\n }\n return range;\n },\n\n changePage (page) {\n this.currentPage = page;\n this.$emit('change', this.currentPage);\n },\n },\n};\n</script>\n"],"names":["DtButton","DtIcon"],"mappings":";;;;;;;;;;AA+EA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAA,WAAA;AAAA,IACA,QAAAC,SAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAAA,EAE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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";
1
+ import { normalizeComponent } from "../chunks/_plugin-vue2_normalizer-sOSkiPF3.js";
2
+ import { DtButton } from "./button.js";
3
+ import { DtIcon } from "./icon.js";
4
4
  import "vue";
5
- import "../chunks/link_constants-vIUB92L4.js";
5
+ import "../chunks/link_constants-nWVlXQBs.js";
6
6
  import "@dialpad/dialtone-icons/vue2";
7
- import "../chunks/icon_constants-OpYAAKwF.js";
7
+ import "../chunks/icon_constants-Dy4MEUJL.js";
8
8
  import "@dialpad/dialtone-icons/icons.json";
9
- const l = {
9
+ const _sfc_main = {
10
10
  name: "DtPagination",
11
11
  components: {
12
- DtButton: o,
13
- DtIcon: c
12
+ DtButton,
13
+ DtIcon
14
14
  },
15
15
  props: {
16
16
  /**
@@ -18,35 +18,35 @@ const l = {
18
18
  */
19
19
  ariaLabel: {
20
20
  type: String,
21
- required: !0
21
+ required: true
22
22
  },
23
23
  /**
24
24
  * The total number of the pages
25
25
  */
26
26
  totalPages: {
27
27
  type: Number,
28
- required: !0
28
+ required: true
29
29
  },
30
30
  /**
31
31
  * Descriptive label for the previous button.
32
32
  */
33
33
  prevAriaLabel: {
34
34
  type: String,
35
- required: !0
35
+ required: true
36
36
  },
37
37
  /**
38
38
  * Descriptive label for the next button.
39
39
  */
40
40
  nextAriaLabel: {
41
41
  type: String,
42
- required: !0
42
+ required: true
43
43
  },
44
44
  /**
45
45
  * A method that will be called to get the aria label of each page.
46
46
  */
47
47
  pageNumberAriaLabel: {
48
48
  type: Function,
49
- required: !0
49
+ required: true
50
50
  },
51
51
  /**
52
52
  * The active current page in the list of pages, defaults to the first page
@@ -87,55 +87,67 @@ const l = {
87
87
  return this.currentPage === this.totalPages;
88
88
  },
89
89
  pages() {
90
- if (this.maxVisible === 0)
90
+ if (this.maxVisible === 0) {
91
91
  return [];
92
- if (this.totalPages <= this.maxVisible)
92
+ }
93
+ if (this.totalPages <= this.maxVisible) {
93
94
  return this.range(1, this.totalPages);
94
- const r = this.maxVisible - 1, t = this.totalPages - r + 1;
95
- if (this.currentPage < r)
96
- return [...this.range(1, r), "...", this.totalPages];
97
- if (this.currentPage > t)
98
- return [1, "...", ...this.range(t, this.totalPages)];
99
- const e = this.maxVisible - (3 - this.maxVisible % 2), a = Math.floor(e / 2), i = this.currentPage - a, n = this.currentPage + a;
100
- return [1, "...", ...this.range(i, n), "...", this.totalPages];
95
+ }
96
+ const start = this.maxVisible - 1;
97
+ const end = this.totalPages - start + 1;
98
+ if (this.currentPage < start) {
99
+ return [...this.range(1, start), "...", this.totalPages];
100
+ }
101
+ if (this.currentPage > end) {
102
+ return [1, "...", ...this.range(end, this.totalPages)];
103
+ }
104
+ const total = this.maxVisible - (3 - this.maxVisible % 2);
105
+ const centerIndex = Math.floor(total / 2);
106
+ const left = this.currentPage - centerIndex;
107
+ const right = this.currentPage + centerIndex;
108
+ return [1, "...", ...this.range(left, right), "...", this.totalPages];
101
109
  }
102
110
  },
103
111
  methods: {
104
- range(r, t) {
105
- const e = [];
106
- r = r > 0 ? r : 1;
107
- for (let a = r; a <= t; a++)
108
- e.push(a);
109
- return e;
112
+ range(from, to) {
113
+ const range = [];
114
+ from = from > 0 ? from : 1;
115
+ for (let i = from; i <= to; i++) {
116
+ range.push(i);
117
+ }
118
+ return range;
110
119
  },
111
- changePage(r) {
112
- this.currentPage = r, this.$emit("change", this.currentPage);
120
+ changePage(page) {
121
+ this.currentPage = page;
122
+ this.$emit("change", this.currentPage);
113
123
  }
114
124
  }
115
125
  };
116
- var u = function() {
117
- var t = this, e = t._self._c;
118
- 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) {
119
- return t.changePage(t.currentPage - 1);
120
- } } }, [e("template", { slot: "icon" }, [e("dt-icon", { attrs: { name: "chevron-left", size: "300" } })], 1)], 2), t._l(t.pages, function(a, i) {
121
- 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) {
122
- return t.changePage(a);
123
- } } }, [t._v(" " + t._s(a) + " ")])], 1);
124
- }), 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) {
125
- return t.changePage(t.currentPage + 1);
126
- } } }, [e("template", { slot: "icon" }, [e("dt-icon", { attrs: { name: "chevron-right", size: "300" } })], 1)], 2)], 2);
127
- }, g = [], d = /* @__PURE__ */ s(
128
- l,
129
- u,
130
- g,
131
- !1,
126
+ var _sfc_render = function render() {
127
+ var _vm = this, _c = _vm._self._c;
128
+ return _c("nav", { staticClass: "d-pagination", attrs: { "aria-label": _vm.ariaLabel } }, [_c("dt-button", { staticClass: "d-pagination__button", class: _vm.isFirstPage ? "d-fc-black-300 d-bgc-transparent" : "d-fc-tertiary", attrs: { "data-qa": "dt-pagination-prev", "aria-label": _vm.prevAriaLabel, "kind": _vm.isFirstPage ? "default" : "muted", "importance": _vm.isFirstPage ? "primary" : "clear", "disabled": _vm.isFirstPage }, on: { "click": function($event) {
129
+ return _vm.changePage(_vm.currentPage - 1);
130
+ } } }, [_c("template", { slot: "icon" }, [_c("dt-icon", { attrs: { "name": "chevron-left", "size": "300" } })], 1)], 2), _vm._l(_vm.pages, function(page, index) {
131
+ return _c("div", { key: `page-${page}-${index}`, class: { "d-pagination__separator": isNaN(Number(page)) } }, [isNaN(Number(page)) ? _c("div", { staticClass: "d-pagination__separator-icon", attrs: { "data-qa": "dt-pagination-separator" } }, [_c("dt-icon", { attrs: { "name": "more-horizontal", "size": "300" } })], 1) : _c("dt-button", { attrs: { "aria-label": _vm.pageNumberAriaLabel(page), "kind": _vm.currentPage === page ? "default" : "muted", "importance": _vm.currentPage === page ? "primary" : "clear", "label-class": "" }, on: { "click": function($event) {
132
+ return _vm.changePage(page);
133
+ } } }, [_vm._v(" " + _vm._s(page) + " ")])], 1);
134
+ }), _c("dt-button", { staticClass: "d-pagination__button", class: _vm.isLastPage ? "d-fc-black-300 d-bgc-transparent" : "d-fc-tertiary", attrs: { "data-qa": "dt-pagination-next", "aria-label": _vm.nextAriaLabel, "disabled": _vm.isLastPage, "kind": "muted", "importance": _vm.isLastPage ? "primary" : "clear" }, on: { "click": function($event) {
135
+ return _vm.changePage(_vm.currentPage + 1);
136
+ } } }, [_c("template", { slot: "icon" }, [_c("dt-icon", { attrs: { "name": "chevron-right", "size": "300" } })], 1)], 2)], 2);
137
+ };
138
+ var _sfc_staticRenderFns = [];
139
+ var __component__ = /* @__PURE__ */ normalizeComponent(
140
+ _sfc_main,
141
+ _sfc_render,
142
+ _sfc_staticRenderFns,
143
+ false,
132
144
  null,
133
145
  null,
134
146
  null,
135
147
  null
136
148
  );
137
- const y = d.exports;
149
+ const pagination = __component__.exports;
138
150
  export {
139
- y as DtPagination
151
+ pagination as DtPagination
140
152
  };
141
153
  //# sourceMappingURL=pagination.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.js","sources":["../../components/pagination/pagination.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel\"\n class=\"d-pagination\"\n >\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-prev\"\n :aria-label=\"prevAriaLabel\"\n :kind=\"isFirstPage ? 'default' : 'muted'\"\n :importance=\"isFirstPage ? 'primary' : 'clear'\"\n :disabled=\"isFirstPage\"\n :class=\"isFirstPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage - 1)\"\n >\n <template slot=\"icon\">\n <dt-icon\n name=\"chevron-left\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <div\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page}-${index}`\"\n :class=\"{ 'd-pagination__separator': isNaN(Number(page)) }\"\n >\n <!-- eslint-disable vue/no-bare-strings-in-template -->\n <div\n v-if=\"isNaN(Number(page))\"\n class=\"d-pagination__separator-icon\"\n data-qa=\"dt-pagination-separator\"\n >\n <dt-icon\n name=\"more-horizontal\"\n size=\"300\"\n />\n <!-- … -->\n </div>\n <!-- eslint-enable vue/no-bare-strings-in-template -->\n <dt-button\n v-else\n :aria-label=\"pageNumberAriaLabel(page)\"\n :kind=\"currentPage === page ? 'default' : 'muted'\"\n :importance=\"currentPage === page ? 'primary' : 'clear'\"\n label-class=\"\"\n @click=\"changePage(page)\"\n >\n {{ page }}\n </dt-button>\n </div>\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-next\"\n :aria-label=\"nextAriaLabel\"\n :disabled=\"isLastPage\"\n kind=\"muted\"\n :importance=\"isLastPage ? 'primary' : 'clear'\"\n :class=\"isLastPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage + 1)\"\n >\n <template slot=\"icon\">\n <dt-icon\n name=\"chevron-right\"\n size=\"300\"\n />\n </template>\n </dt-button>\n </nav>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\n\n/**\n * Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.\n * @see https://dialtone.dialpad.com/components/pagination.html\n */\nexport default {\n name: 'DtPagination',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n props: {\n /**\n * Descriptive label for the pagination content.\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * The total number of the pages\n */\n totalPages: {\n type: Number,\n required: true,\n },\n\n /**\n * Descriptive label for the previous button.\n */\n prevAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Descriptive label for the next button.\n */\n nextAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * A method that will be called to get the aria label of each page.\n */\n pageNumberAriaLabel: {\n type: Function,\n required: true,\n },\n\n /**\n * The active current page in the list of pages, defaults to the first page\n */\n activePage: {\n type: Number,\n default: 1,\n },\n\n /**\n * Determines the max pages to be shown in the list. Using an odd number is recommended.\n * If an even number is given, then it will be rounded down to the nearest odd number to always\n * keep current page in the middle when current page is in the mid-range.\n */\n maxVisible: {\n type: Number,\n default: 5,\n },\n },\n\n emits: [\n /**\n * Page change event\n *\n * @event change\n * @type {Number}\n */\n 'change',\n ],\n\n data () {\n return {\n currentPage: this.activePage,\n };\n },\n\n computed: {\n isFirstPage () {\n return this.currentPage === 1;\n },\n\n isLastPage () {\n return this.currentPage === this.totalPages;\n },\n\n pages () {\n if (this.maxVisible === 0) {\n return [];\n }\n if (this.totalPages <= this.maxVisible) {\n return this.range(1, this.totalPages);\n }\n\n const start = this.maxVisible - 1;\n const end = this.totalPages - start + 1;\n\n if (this.currentPage < start) {\n return [...this.range(1, start), '...', this.totalPages];\n }\n\n if (this.currentPage > end) {\n return [1, '...', ...this.range(end, this.totalPages)];\n }\n\n // rounding to the nearest odd according to the maxlength to always show the page number in the middle.\n const total = this.maxVisible - (3 - this.maxVisible % 2);\n const centerIndex = Math.floor(total / 2);\n const left = this.currentPage - centerIndex;\n const right = this.currentPage + centerIndex;\n return [1, '...', ...this.range(left, right), '...', this.totalPages];\n },\n },\n\n methods: {\n range (from, to) {\n const range = [];\n from = from > 0 ? from : 1;\n for (let i = from; i <= to; i++) {\n range.push(i);\n }\n return range;\n },\n\n changePage (page) {\n this.currentPage = page;\n this.$emit('change', this.currentPage);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIcon","start","end","total","centerIndex","left","right","from","to","range","i","page"],"mappings":";;;;;;;;AA+EA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,aAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,cAAA;AACA,aAAA,KAAA,gBAAA;AAAA,IACA;AAAA,IAEA,aAAA;AACA,aAAA,KAAA,gBAAA,KAAA;AAAA,IACA;AAAA,IAEA,QAAA;AACA,UAAA,KAAA,eAAA;AACA,eAAA;AAEA,UAAA,KAAA,cAAA,KAAA;AACA,eAAA,KAAA,MAAA,GAAA,KAAA,UAAA;AAGA,YAAAC,IAAA,KAAA,aAAA,GACAC,IAAA,KAAA,aAAAD,IAAA;AAEA,UAAA,KAAA,cAAAA;AACA,eAAA,CAAA,GAAA,KAAA,MAAA,GAAAA,CAAA,GAAA,OAAA,KAAA,UAAA;AAGA,UAAA,KAAA,cAAAC;AACA,eAAA,CAAA,GAAA,OAAA,GAAA,KAAA,MAAAA,GAAA,KAAA,UAAA,CAAA;AAIA,YAAAC,IAAA,KAAA,cAAA,IAAA,KAAA,aAAA,IACAC,IAAA,KAAA,MAAAD,IAAA,CAAA,GACAE,IAAA,KAAA,cAAAD,GACAE,IAAA,KAAA,cAAAF;AACA,aAAA,CAAA,GAAA,OAAA,GAAA,KAAA,MAAAC,GAAAC,CAAA,GAAA,OAAA,KAAA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,MAAAC,GAAAC,GAAA;AACA,YAAAC,IAAA,CAAA;AACA,MAAAF,IAAAA,IAAA,IAAAA,IAAA;AACA,eAAAG,IAAAH,GAAAG,KAAAF,GAAAE;AACA,QAAAD,EAAA,KAAAC,CAAA;AAEA,aAAAD;AAAA,IACA;AAAA,IAEA,WAAAE,GAAA;AACA,WAAA,cAAAA,GACA,KAAA,MAAA,UAAA,KAAA,WAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"pagination.js","sources":["../../components/pagination/pagination.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel\"\n class=\"d-pagination\"\n >\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-prev\"\n :aria-label=\"prevAriaLabel\"\n :kind=\"isFirstPage ? 'default' : 'muted'\"\n :importance=\"isFirstPage ? 'primary' : 'clear'\"\n :disabled=\"isFirstPage\"\n :class=\"isFirstPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage - 1)\"\n >\n <template slot=\"icon\">\n <dt-icon\n name=\"chevron-left\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <div\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page}-${index}`\"\n :class=\"{ 'd-pagination__separator': isNaN(Number(page)) }\"\n >\n <!-- eslint-disable vue/no-bare-strings-in-template -->\n <div\n v-if=\"isNaN(Number(page))\"\n class=\"d-pagination__separator-icon\"\n data-qa=\"dt-pagination-separator\"\n >\n <dt-icon\n name=\"more-horizontal\"\n size=\"300\"\n />\n <!-- … -->\n </div>\n <!-- eslint-enable vue/no-bare-strings-in-template -->\n <dt-button\n v-else\n :aria-label=\"pageNumberAriaLabel(page)\"\n :kind=\"currentPage === page ? 'default' : 'muted'\"\n :importance=\"currentPage === page ? 'primary' : 'clear'\"\n label-class=\"\"\n @click=\"changePage(page)\"\n >\n {{ page }}\n </dt-button>\n </div>\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-next\"\n :aria-label=\"nextAriaLabel\"\n :disabled=\"isLastPage\"\n kind=\"muted\"\n :importance=\"isLastPage ? 'primary' : 'clear'\"\n :class=\"isLastPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage + 1)\"\n >\n <template slot=\"icon\">\n <dt-icon\n name=\"chevron-right\"\n size=\"300\"\n />\n </template>\n </dt-button>\n </nav>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\n\n/**\n * Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.\n * @see https://dialtone.dialpad.com/components/pagination.html\n */\nexport default {\n name: 'DtPagination',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n props: {\n /**\n * Descriptive label for the pagination content.\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * The total number of the pages\n */\n totalPages: {\n type: Number,\n required: true,\n },\n\n /**\n * Descriptive label for the previous button.\n */\n prevAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Descriptive label for the next button.\n */\n nextAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * A method that will be called to get the aria label of each page.\n */\n pageNumberAriaLabel: {\n type: Function,\n required: true,\n },\n\n /**\n * The active current page in the list of pages, defaults to the first page\n */\n activePage: {\n type: Number,\n default: 1,\n },\n\n /**\n * Determines the max pages to be shown in the list. Using an odd number is recommended.\n * If an even number is given, then it will be rounded down to the nearest odd number to always\n * keep current page in the middle when current page is in the mid-range.\n */\n maxVisible: {\n type: Number,\n default: 5,\n },\n },\n\n emits: [\n /**\n * Page change event\n *\n * @event change\n * @type {Number}\n */\n 'change',\n ],\n\n data () {\n return {\n currentPage: this.activePage,\n };\n },\n\n computed: {\n isFirstPage () {\n return this.currentPage === 1;\n },\n\n isLastPage () {\n return this.currentPage === this.totalPages;\n },\n\n pages () {\n if (this.maxVisible === 0) {\n return [];\n }\n if (this.totalPages <= this.maxVisible) {\n return this.range(1, this.totalPages);\n }\n\n const start = this.maxVisible - 1;\n const end = this.totalPages - start + 1;\n\n if (this.currentPage < start) {\n return [...this.range(1, start), '...', this.totalPages];\n }\n\n if (this.currentPage > end) {\n return [1, '...', ...this.range(end, this.totalPages)];\n }\n\n // rounding to the nearest odd according to the maxlength to always show the page number in the middle.\n const total = this.maxVisible - (3 - this.maxVisible % 2);\n const centerIndex = Math.floor(total / 2);\n const left = this.currentPage - centerIndex;\n const right = this.currentPage + centerIndex;\n return [1, '...', ...this.range(left, right), '...', this.totalPages];\n },\n },\n\n methods: {\n range (from, to) {\n const range = [];\n from = from > 0 ? from : 1;\n for (let i = from; i <= to; i++) {\n range.push(i);\n }\n return range;\n },\n\n changePage (page) {\n this.currentPage = page;\n this.$emit('change', this.currentPage);\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;AA+EA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA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