@dialpad/dialtone-vue 2.126.0 → 2.127.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.
- package/dist/chunks/_plugin-vue2_normalizer-1aBeR4AK.js +59 -0
- package/dist/chunks/_plugin-vue2_normalizer-1aBeR4AK.js.map +1 -0
- package/dist/chunks/_plugin-vue2_normalizer-sOSkiPF3.js +60 -0
- package/dist/chunks/_plugin-vue2_normalizer-sOSkiPF3.js.map +1 -0
- package/dist/chunks/{dropdown-SMWaTWyF.js → dropdown-DTtcQEFC.js} +131 -84
- package/dist/chunks/{dropdown-SMWaTWyF.js.map → dropdown-DTtcQEFC.js.map} +1 -1
- package/dist/chunks/dropdown-IaLNHmVd.js +403 -0
- package/dist/chunks/dropdown-IaLNHmVd.js.map +1 -0
- package/dist/chunks/dropdown_constants-2pGCXy7m.js +8 -0
- package/dist/chunks/dropdown_constants-2pGCXy7m.js.map +1 -0
- package/dist/chunks/dropdown_constants-w1MXGC3Z.js +9 -0
- package/dist/chunks/dropdown_constants-w1MXGC3Z.js.map +1 -0
- package/dist/chunks/{icon_constants-OpYAAKwF.js → icon_constants-Dy4MEUJL.js} +7 -6
- package/dist/chunks/{icon_constants-OpYAAKwF.js.map → icon_constants-Dy4MEUJL.js.map} +1 -1
- package/dist/chunks/icon_constants-QYpmdE0R.js +16 -0
- package/dist/chunks/icon_constants-QYpmdE0R.js.map +1 -0
- package/dist/chunks/index-DUr1xHR0.js +442 -0
- package/dist/chunks/{index-nIyl_PL6.js.map → index-DUr1xHR0.js.map} +1 -1
- package/dist/chunks/index-IA-Z8fgm.js +441 -0
- package/dist/chunks/index-IA-Z8fgm.js.map +1 -0
- package/dist/chunks/{input-1tm09l_-.js → input-6kbd8Pju.js} +83 -60
- package/dist/chunks/{input-1tm09l_-.js.map → input-6kbd8Pju.js.map} +1 -1
- package/dist/chunks/input-Axw-wFj2.js +295 -0
- package/dist/chunks/input-Axw-wFj2.js.map +1 -0
- package/dist/chunks/input_group-m3cWYUfI.js +143 -0
- package/dist/chunks/{input_group-zcAq3DQl.js.map → input_group-m3cWYUfI.js.map} +1 -1
- package/dist/chunks/{input_group-zcAq3DQl.js → input_group-qVZaS5Bb.js} +27 -24
- package/dist/chunks/input_group-qVZaS5Bb.js.map +1 -0
- package/dist/chunks/keyboard_list_navigation-ScXhrxya.js +284 -0
- package/dist/chunks/{keyboard_list_navigation-F0O8nht0.js.map → keyboard_list_navigation-ScXhrxya.js.map} +1 -1
- package/dist/chunks/keyboard_list_navigation-fJnl_Iox.js +283 -0
- package/dist/chunks/keyboard_list_navigation-fJnl_Iox.js.map +1 -0
- package/dist/chunks/link_constants-Huj7D_hm.js +22 -0
- package/dist/chunks/{link_constants-vIUB92L4.js.map → link_constants-Huj7D_hm.js.map} +1 -1
- package/dist/chunks/link_constants-nWVlXQBs.js +23 -0
- package/dist/chunks/link_constants-nWVlXQBs.js.map +1 -0
- package/dist/chunks/list_item_constants-EiqkqZvP.js +13 -0
- package/dist/chunks/{list_item_constants-LTUc74pD.js.map → list_item_constants-EiqkqZvP.js.map} +1 -1
- package/dist/chunks/list_item_constants-u1xcN9Dd.js +14 -0
- package/dist/chunks/list_item_constants-u1xcN9Dd.js.map +1 -0
- package/dist/chunks/modal-VgxXAQFP.js +105 -0
- package/dist/chunks/{modal-VuMFkZFH.js.map → modal-VgxXAQFP.js.map} +1 -1
- package/dist/chunks/modal-XOr4kiNZ.js +106 -0
- package/dist/chunks/modal-XOr4kiNZ.js.map +1 -0
- package/dist/chunks/notice_action-IRUoLX2d.js +196 -0
- package/dist/chunks/{notice_action-9NmtQRai.js.map → notice_action-IRUoLX2d.js.map} +1 -1
- package/dist/chunks/notice_action-P6uDyE9x.js +195 -0
- package/dist/chunks/notice_action-P6uDyE9x.js.map +1 -0
- package/dist/chunks/notice_constants-7Qt2CQEY.js +7 -0
- package/dist/chunks/{notice_constants-c--hBFQw.js.map → notice_constants-7Qt2CQEY.js.map} +1 -1
- package/dist/chunks/notice_constants-UXo9e3bS.js +6 -0
- package/dist/chunks/notice_constants-UXo9e3bS.js.map +1 -0
- package/dist/chunks/popover_constants-JwBF9h1Z.js +143 -0
- package/dist/chunks/{popover_constants-qjlEkroB.js.map → popover_constants-JwBF9h1Z.js.map} +1 -1
- package/dist/chunks/popover_constants-Qkpb0yh2.js +144 -0
- package/dist/chunks/popover_constants-Qkpb0yh2.js.map +1 -0
- package/dist/chunks/sr_only_close_button-81bHIpPu.js +95 -0
- package/dist/chunks/{sr_only_close_button-JGole5Xi.js.map → sr_only_close_button-81bHIpPu.js.map} +1 -1
- package/dist/chunks/sr_only_close_button-ZaGdAHz7.js +94 -0
- package/dist/chunks/sr_only_close_button-ZaGdAHz7.js.map +1 -0
- package/dist/chunks/stack_constants-HraCekPm.js +15 -0
- package/dist/chunks/{stack_constants-u7tNqGtc.js.map → stack_constants-HraCekPm.js.map} +1 -1
- package/dist/chunks/stack_constants-SMzMWnAQ.js +14 -0
- package/dist/chunks/stack_constants-SMzMWnAQ.js.map +1 -0
- package/dist/chunks/tab-FcsV5VmK.js +386 -0
- package/dist/chunks/tab-FcsV5VmK.js.map +1 -0
- package/dist/chunks/tab-V4cb44Ry.js +387 -0
- package/dist/chunks/{tab-Qm9LVkYj.js.map → tab-V4cb44Ry.js.map} +1 -1
- package/dist/common/constants.cjs +60 -0
- package/dist/common/constants.cjs.map +1 -0
- package/dist/{lib → common}/constants.js +25 -18
- package/dist/{lib → common}/constants.js.map +1 -1
- package/dist/common/dates.cjs +72 -0
- package/dist/common/dates.cjs.map +1 -0
- package/dist/common/dates.js +72 -0
- package/dist/{lib → common}/dates.js.map +1 -1
- package/dist/common/emoji.cjs +163 -0
- package/dist/common/emoji.cjs.map +1 -0
- package/dist/common/emoji.js +168 -0
- package/dist/common/emoji.js.map +1 -0
- package/dist/common/mixins.cjs +17 -0
- package/dist/common/mixins.cjs.map +1 -0
- package/dist/common/mixins.js +17 -0
- package/dist/common/utils.cjs +237 -0
- package/dist/common/utils.cjs.map +1 -0
- package/dist/common/utils.js +237 -0
- package/dist/{lib → common}/utils.js.map +1 -1
- package/dist/common/validators.cjs +23 -0
- package/dist/common/validators.cjs.map +1 -0
- package/dist/common/validators.js +23 -0
- package/dist/{lib → common}/validators.js.map +1 -1
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.cjs +373 -0
- package/dist/dialtone-vue.cjs.map +1 -0
- package/dist/dialtone-vue.js +325 -324
- package/dist/dialtone-vue.js.map +1 -1
- package/dist/lib/attachment-carousel.cjs +261 -0
- package/dist/lib/attachment-carousel.cjs.map +1 -0
- package/dist/lib/attachment-carousel.js +96 -85
- package/dist/lib/attachment-carousel.js.map +1 -1
- package/dist/lib/avatar.cjs +400 -0
- package/dist/lib/avatar.cjs.map +1 -0
- package/dist/lib/avatar.js +111 -80
- package/dist/lib/avatar.js.map +1 -1
- package/dist/lib/badge.cjs +183 -0
- package/dist/lib/badge.cjs.map +1 -0
- package/dist/lib/badge.js +53 -39
- package/dist/lib/badge.js.map +1 -1
- package/dist/lib/banner.cjs +210 -0
- package/dist/lib/banner.cjs.map +1 -0
- package/dist/lib/banner.js +58 -48
- package/dist/lib/banner.js.map +1 -1
- package/dist/lib/breadcrumbs.cjs +147 -0
- package/dist/lib/breadcrumbs.cjs.map +1 -0
- package/dist/lib/breadcrumbs.js +57 -48
- package/dist/lib/breadcrumbs.js.map +1 -1
- package/dist/lib/button-group.cjs +48 -0
- package/dist/lib/button-group.cjs.map +1 -0
- package/dist/lib/button-group.js +21 -18
- package/dist/lib/button-group.js.map +1 -1
- package/dist/lib/button.cjs +350 -0
- package/dist/lib/button.cjs.map +1 -0
- package/dist/lib/button.js +98 -76
- package/dist/lib/button.js.map +1 -1
- package/dist/lib/callbar-button-with-popover.cjs +250 -0
- package/dist/lib/callbar-button-with-popover.cjs.map +1 -0
- package/dist/lib/callbar-button-with-popover.js +66 -51
- package/dist/lib/callbar-button-with-popover.js.map +1 -1
- package/dist/lib/callbar-button.cjs +183 -0
- package/dist/lib/callbar-button.cjs.map +1 -0
- package/dist/lib/callbar-button.js +42 -34
- package/dist/lib/callbar-button.js.map +1 -1
- package/dist/lib/callbox.cjs +147 -0
- package/dist/lib/callbox.cjs.map +1 -0
- package/dist/lib/callbox.js +38 -33
- package/dist/lib/callbox.js.map +1 -1
- package/dist/lib/card.cjs +74 -0
- package/dist/lib/card.cjs.map +1 -0
- package/dist/lib/card.js +22 -20
- package/dist/lib/card.js.map +1 -1
- package/dist/lib/checkbox-group.cjs +130 -0
- package/dist/lib/checkbox-group.cjs.map +1 -0
- package/dist/lib/checkbox-group.js +42 -29
- package/dist/lib/checkbox-group.js.map +1 -1
- package/dist/lib/checkbox.cjs +128 -0
- package/dist/lib/checkbox.cjs.map +1 -0
- package/dist/lib/checkbox.js +46 -35
- package/dist/lib/checkbox.js.map +1 -1
- package/dist/lib/chip.cjs +199 -0
- package/dist/lib/chip.cjs.map +1 -0
- package/dist/lib/chip.js +59 -46
- package/dist/lib/chip.js.map +1 -1
- package/dist/lib/codeblock.cjs +30 -0
- package/dist/lib/codeblock.cjs.map +1 -0
- package/dist/lib/codeblock.js +15 -14
- package/dist/lib/codeblock.js.map +1 -1
- package/dist/lib/collapsible.cjs +335 -0
- package/dist/lib/collapsible.cjs.map +1 -0
- package/dist/lib/collapsible.js +91 -69
- package/dist/lib/collapsible.js.map +1 -1
- package/dist/lib/combobox-multi-select.cjs +520 -0
- package/dist/lib/combobox-multi-select.cjs.map +1 -0
- package/dist/lib/combobox-multi-select.js +223 -136
- package/dist/lib/combobox-multi-select.js.map +1 -1
- package/dist/lib/combobox-with-popover.cjs +385 -0
- package/dist/lib/combobox-with-popover.cjs.map +1 -0
- package/dist/lib/combobox-with-popover.js +131 -87
- package/dist/lib/combobox-with-popover.js.map +1 -1
- package/dist/lib/combobox.cjs +19 -0
- package/dist/lib/combobox.cjs.map +1 -0
- package/dist/lib/combobox.js +9 -9
- package/dist/lib/contact-info.cjs +146 -0
- package/dist/lib/contact-info.cjs.map +1 -0
- package/dist/lib/contact-info.js +34 -33
- package/dist/lib/contact-info.js.map +1 -1
- package/dist/lib/contact-row.cjs +206 -0
- package/dist/lib/contact-row.cjs.map +1 -0
- package/dist/lib/contact-row.js +42 -39
- package/dist/lib/contact-row.js.map +1 -1
- package/dist/lib/datepicker.cjs +663 -0
- package/dist/lib/datepicker.cjs.map +1 -0
- package/dist/lib/datepicker.js +330 -219
- package/dist/lib/datepicker.js.map +1 -1
- package/dist/lib/description-list.cjs +115 -0
- package/dist/lib/description-list.cjs.map +1 -0
- package/dist/lib/description-list.js +51 -19
- package/dist/lib/description-list.js.map +1 -1
- package/dist/lib/dropdown.cjs +46 -0
- package/dist/lib/dropdown.cjs.map +1 -0
- package/dist/lib/dropdown.js +27 -26
- package/dist/lib/dropdown.js.map +1 -1
- package/dist/lib/editor.cjs +556 -0
- package/dist/lib/editor.cjs.map +1 -0
- package/dist/lib/editor.js +191 -162
- package/dist/lib/editor.js.map +1 -1
- package/dist/lib/emoji-picker.cjs +1064 -0
- package/dist/lib/emoji-picker.cjs.map +1 -0
- package/dist/lib/emoji-picker.js +638 -375
- package/dist/lib/emoji-picker.js.map +1 -1
- package/dist/lib/emoji-row.cjs +89 -0
- package/dist/lib/emoji-row.cjs.map +1 -0
- package/dist/lib/emoji-row.js +46 -40
- package/dist/lib/emoji-row.js.map +1 -1
- package/dist/lib/emoji-text-wrapper.cjs +110 -0
- package/dist/lib/emoji-text-wrapper.cjs.map +1 -0
- package/dist/lib/emoji-text-wrapper.js +49 -35
- package/dist/lib/emoji-text-wrapper.js.map +1 -1
- package/dist/lib/emoji.cjs +146 -0
- package/dist/lib/emoji.cjs.map +1 -0
- package/dist/lib/emoji.js +140 -5
- package/dist/lib/emoji.js.map +1 -1
- package/dist/lib/feed-item-row.cjs +214 -0
- package/dist/lib/feed-item-row.cjs.map +1 -0
- package/dist/lib/feed-item-row.js +71 -64
- package/dist/lib/feed-item-row.js.map +1 -1
- package/dist/lib/feed-pill.cjs +150 -0
- package/dist/lib/feed-pill.cjs.map +1 -0
- package/dist/lib/feed-pill.js +60 -52
- package/dist/lib/feed-pill.js.map +1 -1
- package/dist/lib/general-row.cjs +406 -0
- package/dist/lib/general-row.cjs.map +1 -0
- package/dist/lib/general-row.js +133 -106
- package/dist/lib/general-row.js.map +1 -1
- package/dist/lib/group-row.cjs +118 -0
- package/dist/lib/group-row.cjs.map +1 -0
- package/dist/lib/group-row.js +34 -31
- package/dist/lib/group-row.js.map +1 -1
- package/dist/lib/grouped-chip.cjs +46 -0
- package/dist/lib/grouped-chip.cjs.map +1 -0
- package/dist/lib/grouped-chip.js +28 -27
- package/dist/lib/grouped-chip.js.map +1 -1
- package/dist/lib/hovercard.cjs +228 -0
- package/dist/lib/hovercard.cjs.map +1 -0
- package/dist/lib/hovercard.js +98 -64
- package/dist/lib/hovercard.js.map +1 -1
- package/dist/lib/icon.cjs +60 -0
- package/dist/lib/icon.cjs.map +1 -0
- package/dist/lib/icon.js +22 -44
- package/dist/lib/icon.js.map +1 -1
- package/dist/lib/image-viewer.cjs +191 -0
- package/dist/lib/image-viewer.cjs.map +1 -0
- package/dist/lib/image-viewer.js +83 -63
- package/dist/lib/image-viewer.js.map +1 -1
- package/dist/lib/input-group.cjs +92 -0
- package/dist/lib/input-group.cjs.map +1 -0
- package/dist/lib/input-group.js +29 -27
- package/dist/lib/input-group.js.map +1 -1
- package/dist/lib/input.cjs +493 -0
- package/dist/lib/input.cjs.map +1 -0
- package/dist/lib/input.js +127 -89
- package/dist/lib/input.js.map +1 -1
- package/dist/lib/item-layout.cjs +41 -0
- package/dist/lib/item-layout.cjs.map +1 -0
- package/dist/lib/item-layout.js +15 -13
- package/dist/lib/item-layout.js.map +1 -1
- package/dist/lib/ivr-node.cjs +210 -0
- package/dist/lib/ivr-node.cjs.map +1 -0
- package/dist/lib/ivr-node.js +115 -100
- package/dist/lib/ivr-node.js.map +1 -1
- package/dist/lib/keyboard-shortcut.cjs +107 -0
- package/dist/lib/keyboard-shortcut.cjs.map +1 -0
- package/dist/lib/keyboard-shortcut.js +42 -35
- package/dist/lib/keyboard-shortcut.js.map +1 -1
- package/dist/lib/lazy-show.cjs +81 -0
- package/dist/lib/lazy-show.cjs.map +1 -0
- package/dist/lib/lazy-show.js +20 -16
- package/dist/lib/lazy-show.js.map +1 -1
- package/dist/lib/link.cjs +71 -0
- package/dist/lib/link.cjs.map +1 -0
- package/dist/lib/link.js +22 -20
- package/dist/lib/link.js.map +1 -1
- package/dist/lib/list-item-group.cjs +61 -0
- package/dist/lib/list-item-group.cjs.map +1 -0
- package/dist/lib/list-item-group.js +19 -17
- package/dist/lib/list-item-group.js.map +1 -1
- package/dist/lib/list-item.cjs +205 -0
- package/dist/lib/list-item.cjs.map +1 -0
- package/dist/lib/list-item.js +67 -57
- package/dist/lib/list-item.js.map +1 -1
- package/dist/lib/message-input.cjs +555 -0
- package/dist/lib/message-input.cjs.map +1 -0
- package/dist/lib/message-input.js +211 -147
- package/dist/lib/message-input.js.map +1 -1
- package/dist/lib/modal.cjs +351 -0
- package/dist/lib/modal.cjs.map +1 -0
- package/dist/lib/modal.js +118 -91
- package/dist/lib/modal.js.map +1 -1
- package/dist/lib/notice.cjs +160 -0
- package/dist/lib/notice.cjs.map +1 -0
- package/dist/lib/notice.js +46 -44
- package/dist/lib/notice.js.map +1 -1
- package/dist/lib/pagination.cjs +153 -0
- package/dist/lib/pagination.cjs.map +1 -0
- package/dist/lib/pagination.js +60 -49
- package/dist/lib/pagination.js.map +1 -1
- package/dist/lib/popover.cjs +957 -0
- package/dist/lib/popover.cjs.map +1 -0
- package/dist/lib/popover.js +401 -222
- package/dist/lib/popover.js.map +1 -1
- package/dist/lib/presence.cjs +66 -0
- package/dist/lib/presence.cjs.map +1 -0
- package/dist/lib/presence.js +32 -26
- package/dist/lib/presence.js.map +1 -1
- package/dist/lib/radio-group.cjs +99 -0
- package/dist/lib/radio-group.cjs.map +1 -0
- package/dist/lib/radio-group.js +24 -22
- package/dist/lib/radio-group.js.map +1 -1
- package/dist/lib/radio.cjs +119 -0
- package/dist/lib/radio.cjs.map +1 -0
- package/dist/lib/radio.js +43 -35
- package/dist/lib/radio.js.map +1 -1
- package/dist/lib/rich-text-editor.cjs +1139 -0
- package/dist/lib/rich-text-editor.cjs.map +1 -0
- package/dist/lib/rich-text-editor.js +611 -392
- package/dist/lib/rich-text-editor.js.map +1 -1
- package/dist/lib/root-layout.cjs +131 -0
- package/dist/lib/root-layout.cjs.map +1 -0
- package/dist/lib/root-layout.js +28 -24
- package/dist/lib/root-layout.js.map +1 -1
- package/dist/lib/select-menu.cjs +283 -0
- package/dist/lib/select-menu.cjs.map +1 -0
- package/dist/lib/select-menu.js +101 -61
- package/dist/lib/select-menu.js.map +1 -1
- package/dist/lib/settings-menu-button.cjs +66 -0
- package/dist/lib/settings-menu-button.cjs.map +1 -0
- package/dist/lib/settings-menu-button.js +26 -25
- package/dist/lib/settings-menu-button.js.map +1 -1
- package/dist/lib/skeleton.cjs +613 -0
- package/dist/lib/skeleton.cjs.map +1 -0
- package/dist/lib/skeleton.js +174 -135
- package/dist/lib/skeleton.js.map +1 -1
- package/dist/lib/stack.cjs +128 -0
- package/dist/lib/stack.cjs.map +1 -0
- package/dist/lib/stack.js +66 -56
- package/dist/lib/stack.js.map +1 -1
- package/dist/lib/tabs.cjs +100 -0
- package/dist/lib/tabs.cjs.map +1 -0
- package/dist/lib/tabs.js +42 -35
- package/dist/lib/tabs.js.map +1 -1
- package/dist/lib/time-pill.cjs +48 -0
- package/dist/lib/time-pill.cjs.map +1 -0
- package/dist/lib/time-pill.js +21 -16
- package/dist/lib/time-pill.js.map +1 -1
- package/dist/lib/toast.cjs +248 -0
- package/dist/lib/toast.cjs.map +1 -0
- package/dist/lib/toast.js +78 -56
- package/dist/lib/toast.js.map +1 -1
- package/dist/lib/toggle.cjs +178 -0
- package/dist/lib/toggle.cjs.map +1 -0
- package/dist/lib/toggle.js +46 -37
- package/dist/lib/toggle.js.map +1 -1
- package/dist/lib/tooltip-directive.cjs +88 -0
- package/dist/lib/tooltip-directive.cjs.map +1 -0
- package/dist/lib/tooltip-directive.js +55 -41
- package/dist/lib/tooltip-directive.js.map +1 -1
- package/dist/lib/tooltip.cjs +437 -0
- package/dist/lib/tooltip.cjs.map +1 -0
- package/dist/lib/tooltip.js +152 -90
- package/dist/lib/tooltip.js.map +1 -1
- package/dist/lib/top-banner-info.cjs +64 -0
- package/dist/lib/top-banner-info.cjs.map +1 -0
- package/dist/lib/top-banner-info.js +22 -18
- package/dist/lib/top-banner-info.js.map +1 -1
- package/dist/lib/unread-pill.cjs +64 -0
- package/dist/lib/unread-pill.cjs.map +1 -0
- package/dist/lib/unread-pill.js +25 -22
- package/dist/lib/unread-pill.js.map +1 -1
- package/dist/lib/validation-messages.cjs +86 -0
- package/dist/lib/validation-messages.cjs.map +1 -0
- package/dist/lib/validation-messages.js +32 -29
- package/dist/lib/validation-messages.js.map +1 -1
- package/dist/style.css +1214 -1
- package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
- package/dist/types/components/button/button.vue.d.ts +2 -2
- package/dist/types/components/card/card.vue.d.ts +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +1 -1
- package/dist/types/components/collapsible/collapsible.vue.d.ts +2 -2
- package/dist/types/components/combobox/combobox.vue.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts +1 -1
- package/dist/types/components/emoji/emoji.vue.d.ts +1 -1
- package/dist/types/components/icon/icon.vue.d.ts +2 -22
- package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
- package/dist/types/components/list_item_group/list_item_group.vue.d.ts +1 -1
- package/dist/types/components/modal/modal.vue.d.ts +2 -2
- package/dist/types/components/popover/popover_header_footer.vue.d.ts +1 -1
- package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +2 -2
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +2 -2
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts +91 -1
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
- package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts +3 -3
- package/dist/types/components/skeleton/skeleton-shape.vue.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton.vue.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.vue.d.ts +2 -2
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -2
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts +90 -0
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/general_row/general_row.vue.d.ts +1 -1
- package/dist/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +1 -1
- package/package.json +37 -35
- package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js +0 -33
- package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js.map +0 -1
- package/dist/chunks/dropdown_constants-EUcDxBrX.js +0 -9
- package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +0 -1
- package/dist/chunks/index-YkSDT8-g.js +0 -244
- package/dist/chunks/index-YkSDT8-g.js.map +0 -1
- package/dist/chunks/index-nIyl_PL6.js +0 -372
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +0 -197
- package/dist/chunks/link_constants-vIUB92L4.js +0 -16
- package/dist/chunks/list_item_constants-LTUc74pD.js +0 -13
- package/dist/chunks/modal-VuMFkZFH.js +0 -82
- package/dist/chunks/notice_action-9NmtQRai.js +0 -182
- package/dist/chunks/notice_constants-c--hBFQw.js +0 -6
- package/dist/chunks/popover_constants-qjlEkroB.js +0 -114
- package/dist/chunks/sr_only_close_button-JGole5Xi.js +0 -86
- package/dist/chunks/stack_constants-u7tNqGtc.js +0 -13
- package/dist/chunks/tab-Qm9LVkYj.js +0 -346
- package/dist/lib/dates.js +0 -57
- package/dist/lib/mixins.js +0 -17
- package/dist/lib/utils.js +0 -175
- package/dist/lib/validators.js +0 -12
- /package/dist/{lib → common}/mixins.js.map +0 -0
package/dist/lib/toast.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "
|
|
1
|
+
import utils from "../common/utils.js";
|
|
2
|
+
import { SrOnlyCloseButtonMixin } from "../chunks/sr_only_close_button-81bHIpPu.js";
|
|
3
|
+
import { normalizeComponent } from "../chunks/_plugin-vue2_normalizer-sOSkiPF3.js";
|
|
4
|
+
import { DtNoticeIcon, DtNoticeContent, DtNoticeAction } from "../chunks/notice_action-IRUoLX2d.js";
|
|
5
|
+
import { NOTICE_KINDS } from "../chunks/notice_constants-7Qt2CQEY.js";
|
|
6
|
+
import "../common/constants.js";
|
|
7
7
|
import "vue";
|
|
8
8
|
import "./icon.js";
|
|
9
9
|
import "@dialpad/dialtone-icons/vue2";
|
|
10
|
-
import "../chunks/icon_constants-
|
|
10
|
+
import "../chunks/icon_constants-Dy4MEUJL.js";
|
|
11
11
|
import "@dialpad/dialtone-icons/icons.json";
|
|
12
|
-
import "./skeleton.js";
|
|
13
12
|
import "./button.js";
|
|
14
|
-
import "../chunks/link_constants-
|
|
15
|
-
const
|
|
13
|
+
import "../chunks/link_constants-nWVlXQBs.js";
|
|
14
|
+
const TOAST_ROLES = ["status", "alert"];
|
|
15
|
+
const TOAST_MIN_DURATION = 6e3;
|
|
16
|
+
const _sfc_main = {
|
|
16
17
|
name: "DtToast",
|
|
17
18
|
components: {
|
|
18
|
-
DtNoticeIcon
|
|
19
|
-
DtNoticeContent
|
|
20
|
-
DtNoticeAction
|
|
19
|
+
DtNoticeIcon,
|
|
20
|
+
DtNoticeContent,
|
|
21
|
+
DtNoticeAction
|
|
21
22
|
},
|
|
22
|
-
mixins: [
|
|
23
|
+
mixins: [SrOnlyCloseButtonMixin],
|
|
23
24
|
props: {
|
|
24
25
|
/**
|
|
25
26
|
* Sets an ID on the title element of the component. Useful for aria-describedby
|
|
@@ -28,7 +29,7 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
28
29
|
titleId: {
|
|
29
30
|
type: String,
|
|
30
31
|
default() {
|
|
31
|
-
return
|
|
32
|
+
return utils.getUniqueString();
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
35
|
/**
|
|
@@ -38,7 +39,7 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
38
39
|
contentId: {
|
|
39
40
|
type: String,
|
|
40
41
|
default() {
|
|
41
|
-
return
|
|
42
|
+
return utils.getUniqueString();
|
|
42
43
|
}
|
|
43
44
|
},
|
|
44
45
|
/**
|
|
@@ -63,7 +64,9 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
63
64
|
role: {
|
|
64
65
|
type: String,
|
|
65
66
|
default: "status",
|
|
66
|
-
validator: (
|
|
67
|
+
validator: (role) => {
|
|
68
|
+
return TOAST_ROLES.includes(role);
|
|
69
|
+
}
|
|
67
70
|
},
|
|
68
71
|
/**
|
|
69
72
|
* Severity level of the toast, sets the icon and background
|
|
@@ -72,7 +75,9 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
72
75
|
kind: {
|
|
73
76
|
type: String,
|
|
74
77
|
default: "base",
|
|
75
|
-
validator: (
|
|
78
|
+
validator: (kind) => {
|
|
79
|
+
return NOTICE_KINDS.includes(kind);
|
|
80
|
+
}
|
|
76
81
|
},
|
|
77
82
|
/**
|
|
78
83
|
* Used in scenarios where the message needs to visually dominate the screen.
|
|
@@ -80,7 +85,7 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
80
85
|
*/
|
|
81
86
|
important: {
|
|
82
87
|
type: Boolean,
|
|
83
|
-
default:
|
|
88
|
+
default: false
|
|
84
89
|
},
|
|
85
90
|
/**
|
|
86
91
|
* Controls whether the toast is shown. If a valid duration is provided, the toast will disappear
|
|
@@ -91,7 +96,7 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
91
96
|
*/
|
|
92
97
|
show: {
|
|
93
98
|
type: Boolean,
|
|
94
|
-
default:
|
|
99
|
+
default: false
|
|
95
100
|
},
|
|
96
101
|
/**
|
|
97
102
|
* Props for the toast close button.
|
|
@@ -106,7 +111,7 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
106
111
|
*/
|
|
107
112
|
hideClose: {
|
|
108
113
|
type: Boolean,
|
|
109
|
-
default:
|
|
114
|
+
default: false
|
|
110
115
|
},
|
|
111
116
|
/**
|
|
112
117
|
* Hides the icon from the notice
|
|
@@ -114,7 +119,7 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
114
119
|
*/
|
|
115
120
|
hideIcon: {
|
|
116
121
|
type: Boolean,
|
|
117
|
-
default:
|
|
122
|
+
default: false
|
|
118
123
|
},
|
|
119
124
|
/**
|
|
120
125
|
* Hides the action from the notice
|
|
@@ -122,7 +127,7 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
122
127
|
*/
|
|
123
128
|
hideAction: {
|
|
124
129
|
type: Boolean,
|
|
125
|
-
default:
|
|
130
|
+
default: false
|
|
126
131
|
},
|
|
127
132
|
/**
|
|
128
133
|
* The duration in ms the toast will display before disappearing.
|
|
@@ -132,7 +137,9 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
132
137
|
duration: {
|
|
133
138
|
type: Number,
|
|
134
139
|
default: null,
|
|
135
|
-
validator: (
|
|
140
|
+
validator: (duration) => {
|
|
141
|
+
return duration >= TOAST_MIN_DURATION;
|
|
142
|
+
}
|
|
136
143
|
}
|
|
137
144
|
},
|
|
138
145
|
emits: [
|
|
@@ -151,25 +158,28 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
151
158
|
],
|
|
152
159
|
data() {
|
|
153
160
|
return {
|
|
154
|
-
isShown:
|
|
155
|
-
minDuration:
|
|
161
|
+
isShown: false,
|
|
162
|
+
minDuration: TOAST_MIN_DURATION
|
|
156
163
|
};
|
|
157
164
|
},
|
|
158
165
|
computed: {
|
|
159
166
|
kindClass() {
|
|
160
|
-
|
|
167
|
+
const kindClasses = {
|
|
161
168
|
error: "d-toast--error",
|
|
162
169
|
info: "d-toast--info",
|
|
163
170
|
success: "d-toast--success",
|
|
164
171
|
warning: "d-toast--warning",
|
|
165
172
|
base: "d-toast--base"
|
|
166
|
-
}
|
|
173
|
+
};
|
|
174
|
+
return kindClasses[this.kind];
|
|
167
175
|
},
|
|
168
176
|
noticeActionListeners() {
|
|
169
177
|
return {
|
|
170
178
|
...this.$listeners,
|
|
171
|
-
close: (
|
|
172
|
-
this.isShown =
|
|
179
|
+
close: (event) => {
|
|
180
|
+
this.isShown = false;
|
|
181
|
+
this.$emit("update:show", false);
|
|
182
|
+
this.$emit("close", event);
|
|
173
183
|
}
|
|
174
184
|
};
|
|
175
185
|
},
|
|
@@ -179,48 +189,60 @@ const c = ["status", "alert"], o = 6e3, m = {
|
|
|
179
189
|
},
|
|
180
190
|
watch: {
|
|
181
191
|
show: {
|
|
182
|
-
handler: function(
|
|
183
|
-
this.isShown =
|
|
192
|
+
handler: function(show) {
|
|
193
|
+
this.isShown = show;
|
|
194
|
+
if (show) {
|
|
195
|
+
this.setTimeout();
|
|
196
|
+
} else {
|
|
197
|
+
clearTimeout(this.displayTimer);
|
|
198
|
+
}
|
|
184
199
|
},
|
|
185
|
-
immediate:
|
|
200
|
+
immediate: true
|
|
186
201
|
}
|
|
187
202
|
},
|
|
188
203
|
destroyed() {
|
|
189
|
-
|
|
204
|
+
if (this.shouldSetTimeout) {
|
|
205
|
+
clearTimeout(this.displayTimer);
|
|
206
|
+
}
|
|
190
207
|
},
|
|
191
208
|
methods: {
|
|
192
209
|
setTimeout() {
|
|
193
|
-
|
|
194
|
-
this.
|
|
195
|
-
|
|
210
|
+
if (this.shouldSetTimeout) {
|
|
211
|
+
this.displayTimer = setTimeout(() => {
|
|
212
|
+
this.isShown = false;
|
|
213
|
+
this.$emit("update:show", false);
|
|
214
|
+
}, this.duration);
|
|
215
|
+
}
|
|
196
216
|
}
|
|
197
217
|
}
|
|
198
218
|
};
|
|
199
|
-
var
|
|
200
|
-
var
|
|
201
|
-
return
|
|
219
|
+
var _sfc_render = function render() {
|
|
220
|
+
var _vm = this, _c = _vm._self._c;
|
|
221
|
+
return _vm.isShown ? _c("div", { class: [
|
|
202
222
|
"d-toast",
|
|
203
|
-
|
|
204
|
-
{ "d-toast--important":
|
|
205
|
-
], attrs: { "data-qa": "dt-toast", "aria-hidden": (!
|
|
206
|
-
return [
|
|
207
|
-
}, proxy:
|
|
208
|
-
return [
|
|
209
|
-
})], 2),
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
223
|
+
_vm.kindClass,
|
|
224
|
+
{ "d-toast--important": _vm.important }
|
|
225
|
+
], attrs: { "data-qa": "dt-toast", "aria-hidden": (!_vm.isShown).toString() } }, [_c("div", { staticClass: "d-toast__dialog" }, [!_vm.hideIcon ? _c("dt-notice-icon", _vm._g({ attrs: { "kind": _vm.kind } }, _vm.$listeners), [_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() {
|
|
226
|
+
return [_vm._t("titleOverride")];
|
|
227
|
+
}, proxy: true }], null, true) }, _vm.$listeners), [_vm._t("default", function() {
|
|
228
|
+
return [_vm._v(" " + _vm._s(_vm.message) + " ")];
|
|
229
|
+
})], 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.noticeActionListeners), [_vm._t("action")], 2)], 1)]) : _vm._e();
|
|
230
|
+
};
|
|
231
|
+
var _sfc_staticRenderFns = [];
|
|
232
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
233
|
+
_sfc_main,
|
|
234
|
+
_sfc_render,
|
|
235
|
+
_sfc_staticRenderFns,
|
|
236
|
+
false,
|
|
215
237
|
null,
|
|
216
238
|
null,
|
|
217
239
|
null,
|
|
218
240
|
null
|
|
219
241
|
);
|
|
220
|
-
const
|
|
242
|
+
const toast = __component__.exports;
|
|
221
243
|
export {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
244
|
+
toast as DtToast,
|
|
245
|
+
TOAST_MIN_DURATION,
|
|
246
|
+
TOAST_ROLES
|
|
225
247
|
};
|
|
226
248
|
//# sourceMappingURL=toast.js.map
|
package/dist/lib/toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.js","sources":["../../components/toast/toast_constants.js","../../components/toast/toast.vue"],"sourcesContent":["export const TOAST_ROLES = ['status', 'alert'];\nexport const TOAST_MIN_DURATION = 6000;\n\nexport default {\n TOAST_ROLES,\n TOAST_MIN_DURATION,\n};\n","<template>\n <div\n v-if=\"isShown\"\n :class=\"[\n 'd-toast',\n kindClass,\n { 'd-toast--important': important },\n ]\"\n data-qa=\"dt-toast\"\n :aria-hidden=\"(!isShown).toString()\"\n >\n <div class=\"d-toast__dialog\">\n <dt-notice-icon\n v-if=\"!hideIcon\"\n :kind=\"kind\"\n v-on=\"$listeners\"\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 to override\n with something other than text. Otherwise use the \"title\" prop. -->\n <slot name=\"titleOverride\" />\n </template>\n <!-- @slot the main textual content of the toast -->\n <slot>\n {{ message }}\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=\"noticeActionListeners\"\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 </div>\n </div>\n</template>\n\n<script>\nimport { DtNoticeIcon, DtNoticeContent, DtNoticeAction, NOTICE_KINDS } from '@/components/notice';\nimport utils from '@/common/utils';\nimport { TOAST_ROLES, TOAST_MIN_DURATION } from './toast_constants.js';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\n\n/**\n * A toast notice, sometimes called a snackbar, is a time-based message that appears based on users' actions.\n * It contains at-a-glance information about outcomes and can be paired with actions.\n * @see https://dialtone.dialpad.com/components/toast.html\n */\nexport default {\n name: 'DtToast',\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 () { return utils.getUniqueString(); },\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 () { return utils.getUniqueString(); },\n },\n\n /**\n * Title header of the toast. This can be left blank to remove the title from the toast entirely.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Message of the toast. Overridden by default slot.\n */\n message: {\n type: String,\n default: '',\n },\n\n /**\n * Provides a role for the toast. 'status' is used by default to communicate a message. 'alert' is used to\n * communicate an important message like an error that does not contain any interactive elements.\n * @values status, alert\n */\n role: {\n type: String,\n default: 'status',\n validator: (role) => {\n return TOAST_ROLES.includes(role);\n },\n },\n\n /**\n * Severity level of the toast, sets the icon and background\n * @values base, error, info, success, warning\n */\n kind: {\n type: String,\n default: 'base',\n validator: (kind) => {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Used in scenarios where the message needs to visually dominate the screen.\n * @values true, false\n */\n important: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls whether the toast is shown. If a valid duration is provided, the toast will disappear\n * after reaching the duration time, so it's convenient to use `.sync` modifier with this prop to update\n * the data in your component.\n * Supports .sync modifier\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Props for the toast close button.\n */\n closeButtonProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Hides the close button from the toast\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 * The duration in ms the toast will display before disappearing.\n * The toast won't disappear if the duration is not provided.\n * If it's provided, it should be equal to or greater than 6000.\n */\n duration: {\n type: Number,\n default: null,\n validator: (duration) => {\n return duration >= TOAST_MIN_DURATION;\n },\n },\n },\n\n emits: [\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n\n /**\n * Sync show value\n *\n * @event update:show\n */\n 'update:show',\n ],\n\n data () {\n return {\n isShown: false,\n minDuration: TOAST_MIN_DURATION,\n };\n },\n\n computed: {\n kindClass () {\n const kindClasses = {\n error: 'd-toast--error',\n info: 'd-toast--info',\n success: 'd-toast--success',\n warning: 'd-toast--warning',\n base: 'd-toast--base',\n };\n\n return kindClasses[this.kind];\n },\n\n noticeActionListeners () {\n return {\n ...this.$listeners,\n\n close: event => {\n this.isShown = false;\n this.$emit('update:show', false);\n this.$emit('close', event);\n },\n };\n },\n\n shouldSetTimeout () {\n return !!this.duration && this.duration >= this.minDuration;\n },\n },\n\n watch: {\n show: {\n handler: function (show) {\n this.isShown = show;\n if (show) {\n this.setTimeout();\n } else {\n clearTimeout(this.displayTimer);\n }\n },\n\n immediate: true,\n },\n },\n\n destroyed () {\n if (this.shouldSetTimeout) {\n clearTimeout(this.displayTimer);\n }\n },\n\n methods: {\n setTimeout () {\n if (this.shouldSetTimeout) {\n this.displayTimer = setTimeout(() => {\n this.isShown = false;\n this.$emit('update:show', false);\n }, this.duration);\n }\n },\n },\n};\n</script>\n"],"names":["TOAST_ROLES","TOAST_MIN_DURATION","_sfc_main","DtNoticeIcon","DtNoticeContent","DtNoticeAction","SrOnlyCloseButtonMixin","utils","role","kind","NOTICE_KINDS","duration","event","show"],"mappings":";;;;;;;;;;;;;;AAAY,MAACA,IAAc,CAAC,UAAU,OAAO,GAChCC,IAAqB,KC8DlCC,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,UAAA;AAAA,eAAAC,EAAA,gBAAA;AAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,eAAAA,EAAA,gBAAA;AAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MACAR,EAAA,SAAAQ,CAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MACAC,EAAA,SAAAD,CAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;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;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAE,MACAA,KAAAV;AAAA,IAEA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,SAAA;AAAA,MACA,aAAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,YAAA;AASA,aARA;AAAA,QACA,OAAA;AAAA,QACA,MAAA;AAAA,QACA,SAAA;AAAA,QACA,SAAA;AAAA,QACA,MAAA;AAAA,MACA,EAEA,KAAA,IAAA;AAAA,IACA;AAAA,IAEA,wBAAA;AACA,aAAA;AAAA,QACA,GAAA,KAAA;AAAA,QAEA,OAAA,CAAAW,MAAA;AACA,eAAA,UAAA,IACA,KAAA,MAAA,eAAA,EAAA,GACA,KAAA,MAAA,SAAAA,CAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,mBAAA;AACA,aAAA,CAAA,CAAA,KAAA,YAAA,KAAA,YAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,SAAA,SAAAC,GAAA;AACA,aAAA,UAAAA,GACAA,IACA,KAAA,WAAA,IAEA,aAAA,KAAA,YAAA;AAAA,MAEA;AAAA,MAEA,WAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,YAAA;AACA,IAAA,KAAA,oBACA,aAAA,KAAA,YAAA;AAAA,EAEA;AAAA,EAEA,SAAA;AAAA,IACA,aAAA;AACA,MAAA,KAAA,qBACA,KAAA,eAAA,WAAA,MAAA;AACA,aAAA,UAAA,IACA,KAAA,MAAA,eAAA,EAAA;AAAA,MACA,GAAA,KAAA,QAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"toast.js","sources":["../../components/toast/toast_constants.js","../../components/toast/toast.vue"],"sourcesContent":["export const TOAST_ROLES = ['status', 'alert'];\nexport const TOAST_MIN_DURATION = 6000;\n\nexport default {\n TOAST_ROLES,\n TOAST_MIN_DURATION,\n};\n","<template>\n <div\n v-if=\"isShown\"\n :class=\"[\n 'd-toast',\n kindClass,\n { 'd-toast--important': important },\n ]\"\n data-qa=\"dt-toast\"\n :aria-hidden=\"(!isShown).toString()\"\n >\n <div class=\"d-toast__dialog\">\n <dt-notice-icon\n v-if=\"!hideIcon\"\n :kind=\"kind\"\n v-on=\"$listeners\"\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 to override\n with something other than text. Otherwise use the \"title\" prop. -->\n <slot name=\"titleOverride\" />\n </template>\n <!-- @slot the main textual content of the toast -->\n <slot>\n {{ message }}\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=\"noticeActionListeners\"\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 </div>\n </div>\n</template>\n\n<script>\nimport { DtNoticeIcon, DtNoticeContent, DtNoticeAction, NOTICE_KINDS } from '@/components/notice';\nimport utils from '@/common/utils';\nimport { TOAST_ROLES, TOAST_MIN_DURATION } from './toast_constants.js';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\n\n/**\n * A toast notice, sometimes called a snackbar, is a time-based message that appears based on users' actions.\n * It contains at-a-glance information about outcomes and can be paired with actions.\n * @see https://dialtone.dialpad.com/components/toast.html\n */\nexport default {\n name: 'DtToast',\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 () { return utils.getUniqueString(); },\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 () { return utils.getUniqueString(); },\n },\n\n /**\n * Title header of the toast. This can be left blank to remove the title from the toast entirely.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Message of the toast. Overridden by default slot.\n */\n message: {\n type: String,\n default: '',\n },\n\n /**\n * Provides a role for the toast. 'status' is used by default to communicate a message. 'alert' is used to\n * communicate an important message like an error that does not contain any interactive elements.\n * @values status, alert\n */\n role: {\n type: String,\n default: 'status',\n validator: (role) => {\n return TOAST_ROLES.includes(role);\n },\n },\n\n /**\n * Severity level of the toast, sets the icon and background\n * @values base, error, info, success, warning\n */\n kind: {\n type: String,\n default: 'base',\n validator: (kind) => {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Used in scenarios where the message needs to visually dominate the screen.\n * @values true, false\n */\n important: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls whether the toast is shown. If a valid duration is provided, the toast will disappear\n * after reaching the duration time, so it's convenient to use `.sync` modifier with this prop to update\n * the data in your component.\n * Supports .sync modifier\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Props for the toast close button.\n */\n closeButtonProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Hides the close button from the toast\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 * The duration in ms the toast will display before disappearing.\n * The toast won't disappear if the duration is not provided.\n * If it's provided, it should be equal to or greater than 6000.\n */\n duration: {\n type: Number,\n default: null,\n validator: (duration) => {\n return duration >= TOAST_MIN_DURATION;\n },\n },\n },\n\n emits: [\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n\n /**\n * Sync show value\n *\n * @event update:show\n */\n 'update:show',\n ],\n\n data () {\n return {\n isShown: false,\n minDuration: TOAST_MIN_DURATION,\n };\n },\n\n computed: {\n kindClass () {\n const kindClasses = {\n error: 'd-toast--error',\n info: 'd-toast--info',\n success: 'd-toast--success',\n warning: 'd-toast--warning',\n base: 'd-toast--base',\n };\n\n return kindClasses[this.kind];\n },\n\n noticeActionListeners () {\n return {\n ...this.$listeners,\n\n close: event => {\n this.isShown = false;\n this.$emit('update:show', false);\n this.$emit('close', event);\n },\n };\n },\n\n shouldSetTimeout () {\n return !!this.duration && this.duration >= this.minDuration;\n },\n },\n\n watch: {\n show: {\n handler: function (show) {\n this.isShown = show;\n if (show) {\n this.setTimeout();\n } else {\n clearTimeout(this.displayTimer);\n }\n },\n\n immediate: true,\n },\n },\n\n destroyed () {\n if (this.shouldSetTimeout) {\n clearTimeout(this.displayTimer);\n }\n },\n\n methods: {\n setTimeout () {\n if (this.shouldSetTimeout) {\n this.displayTimer = setTimeout(() => {\n this.isShown = false;\n this.$emit('update:show', false);\n }, this.duration);\n }\n },\n },\n};\n</script>\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const Vue = require("vue");
|
|
4
|
+
const common_utils = require("../common/utils.cjs");
|
|
5
|
+
const _pluginVue2_normalizer = require("../chunks/_plugin-vue2_normalizer-1aBeR4AK.js");
|
|
6
|
+
require("../common/constants.cjs");
|
|
7
|
+
const TOGGLE_SIZE_MODIFIERS = {
|
|
8
|
+
sm: "d-toggle--small",
|
|
9
|
+
md: ""
|
|
10
|
+
};
|
|
11
|
+
const TOGGLE_CHECKED_VALUES = [false, true, "mixed"];
|
|
12
|
+
const _sfc_main = {
|
|
13
|
+
name: "DtToggle",
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
model: {
|
|
16
|
+
prop: "checked",
|
|
17
|
+
event: "change"
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
/**
|
|
21
|
+
* The id of the toggle
|
|
22
|
+
*/
|
|
23
|
+
id: {
|
|
24
|
+
type: String,
|
|
25
|
+
default() {
|
|
26
|
+
return common_utils.default.getUniqueString();
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* Disables the toggle interactions
|
|
31
|
+
* @values true, false
|
|
32
|
+
*/
|
|
33
|
+
disabled: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Value of the toggle
|
|
39
|
+
* @model checked
|
|
40
|
+
* @values true, false, 'mixed'
|
|
41
|
+
*/
|
|
42
|
+
checked: {
|
|
43
|
+
type: [Boolean, String],
|
|
44
|
+
default: false,
|
|
45
|
+
validator: (v) => TOGGLE_CHECKED_VALUES.includes(v)
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Whether the component toggles on click. If you set this to false it means you will handle the toggling manually
|
|
49
|
+
* via the checked prop or v-model. Change events will still be triggered.
|
|
50
|
+
* @values true, false
|
|
51
|
+
*/
|
|
52
|
+
toggleOnClick: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* The size of the toggle.
|
|
58
|
+
* @values sm, md
|
|
59
|
+
*/
|
|
60
|
+
size: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: "md",
|
|
63
|
+
validator: (s) => Object.keys(TOGGLE_SIZE_MODIFIERS).includes(s)
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Shows the icon
|
|
67
|
+
* @values true, false
|
|
68
|
+
*/
|
|
69
|
+
showIcon: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: true
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Used to customize the label container
|
|
75
|
+
*/
|
|
76
|
+
labelClass: {
|
|
77
|
+
type: [String, Array, Object],
|
|
78
|
+
default: ""
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* A set of props that are passed into the label container
|
|
82
|
+
*/
|
|
83
|
+
labelChildProps: {
|
|
84
|
+
type: Object,
|
|
85
|
+
default: () => ({})
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
emits: [
|
|
89
|
+
/**
|
|
90
|
+
* Toggle change event
|
|
91
|
+
*
|
|
92
|
+
* @event change
|
|
93
|
+
* @type {Boolean}
|
|
94
|
+
* @model change
|
|
95
|
+
*/
|
|
96
|
+
"change"
|
|
97
|
+
],
|
|
98
|
+
data() {
|
|
99
|
+
return {
|
|
100
|
+
internalChecked: this.checked
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
computed: {
|
|
104
|
+
inputListeners() {
|
|
105
|
+
return {
|
|
106
|
+
...this.$listeners,
|
|
107
|
+
click: (_) => this.toggleCheckedValue()
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
isIndeterminate() {
|
|
111
|
+
return this.internalChecked === "mixed";
|
|
112
|
+
},
|
|
113
|
+
toggleRole() {
|
|
114
|
+
return this.isIndeterminate ? "checkbox" : "switch";
|
|
115
|
+
},
|
|
116
|
+
toggleClasses() {
|
|
117
|
+
return [
|
|
118
|
+
"d-toggle",
|
|
119
|
+
TOGGLE_SIZE_MODIFIERS[this.size],
|
|
120
|
+
{
|
|
121
|
+
"d-toggle--checked": this.internalChecked === true,
|
|
122
|
+
"d-toggle--disabled": this.disabled,
|
|
123
|
+
"d-toggle--indeterminate": this.isIndeterminate
|
|
124
|
+
}
|
|
125
|
+
];
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
watch: {
|
|
129
|
+
checked(newChecked) {
|
|
130
|
+
this.internalChecked = newChecked;
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
mounted() {
|
|
134
|
+
this.runValidations();
|
|
135
|
+
},
|
|
136
|
+
methods: {
|
|
137
|
+
toggleCheckedValue() {
|
|
138
|
+
this.$emit("change", !this.internalChecked);
|
|
139
|
+
if (this.toggleOnClick) {
|
|
140
|
+
this.internalChecked = !this.internalChecked;
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
hasSlotLabel() {
|
|
144
|
+
return !!this.$slots.default;
|
|
145
|
+
},
|
|
146
|
+
runValidations() {
|
|
147
|
+
this.validateInputLabels(this.hasSlotLabel(), this.$attrs["aria-label"]);
|
|
148
|
+
},
|
|
149
|
+
validateInputLabels(hasLabel, ariaLabel) {
|
|
150
|
+
if (!hasLabel && !ariaLabel) {
|
|
151
|
+
Vue.util.warn(
|
|
152
|
+
"You must provide an aria-label when there is no label passed",
|
|
153
|
+
this
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
var _sfc_render = function render() {
|
|
160
|
+
var _vm = this, _c = _vm._self._c;
|
|
161
|
+
return _c("div", { staticClass: "d-toggle-wrapper" }, [_vm.$slots.default ? _c("label", _vm._b({ class: _vm.labelClass, attrs: { "for": _vm.id, "data-qa": "toggle-label" } }, "label", _vm.labelChildProps, false), [_vm._t("default")], 2) : _vm._e(), _c("button", _vm._g(_vm._b({ class: _vm.toggleClasses, attrs: { "id": _vm.id, "role": _vm.toggleRole, "type": "button", "aria-checked": _vm.internalChecked.toString(), "disabled": _vm.disabled, "aria-disabled": _vm.disabled.toString() } }, "button", _vm.$attrs, false), _vm.inputListeners), [_vm.showIcon ? _c("span", { staticClass: "d-toggle__inner" }) : _vm._e()])]);
|
|
162
|
+
};
|
|
163
|
+
var _sfc_staticRenderFns = [];
|
|
164
|
+
var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
165
|
+
_sfc_main,
|
|
166
|
+
_sfc_render,
|
|
167
|
+
_sfc_staticRenderFns,
|
|
168
|
+
false,
|
|
169
|
+
null,
|
|
170
|
+
null,
|
|
171
|
+
null,
|
|
172
|
+
null
|
|
173
|
+
);
|
|
174
|
+
const toggle = __component__.exports;
|
|
175
|
+
exports.DtToggle = toggle;
|
|
176
|
+
exports.TOGGLE_CHECKED_VALUES = TOGGLE_CHECKED_VALUES;
|
|
177
|
+
exports.TOGGLE_SIZE_MODIFIERS = TOGGLE_SIZE_MODIFIERS;
|
|
178
|
+
//# sourceMappingURL=toggle.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.cjs","sources":["../../components/toggle/toggle_constants.js","../../components/toggle/toggle.vue"],"sourcesContent":["export const TOGGLE_SIZE_MODIFIERS = {\n sm: 'd-toggle--small',\n md: '',\n};\n\nexport const TOGGLE_CHECKED_VALUES = [false, true, 'mixed'];\n\nexport default {\n TOGGLE_SIZE_MODIFIERS,\n TOGGLE_CHECKED_VALUES,\n};\n","<template>\n <div class=\"d-toggle-wrapper\">\n <label\n v-if=\"$slots.default\"\n :class=\"labelClass\"\n :for=\"id\"\n v-bind=\"labelChildProps\"\n data-qa=\"toggle-label\"\n >\n <!-- @slot Slot for the main content -->\n <slot />\n </label>\n <button\n :id=\"id\"\n :role=\"toggleRole\"\n type=\"button\"\n :aria-checked=\"internalChecked.toString()\"\n :disabled=\"disabled\"\n :aria-disabled=\"disabled.toString()\"\n :class=\"toggleClasses\"\n v-bind=\"$attrs\"\n v-on=\"inputListeners\"\n >\n <span\n v-if=\"showIcon\"\n class=\"d-toggle__inner\"\n />\n </button>\n </div>\n</template>\n\n<script>\nimport Vue from 'vue';\nimport utils from '@/common/utils';\nimport { TOGGLE_CHECKED_VALUES, TOGGLE_SIZE_MODIFIERS } from '@/components/toggle/toggle_constants';\n\n/**\n * A toggle (or \"switch\") is a button control element that allows the user to make a binary (on/off) selection.\n * @see https://dialtone.dialpad.com/components/toggle.html\n */\nexport default {\n\n name: 'DtToggle',\n\n inheritAttrs: false,\n\n model: {\n prop: 'checked',\n event: 'change',\n },\n\n props: {\n\n /**\n * The id of the toggle\n */\n id: {\n type: String,\n default () { return utils.getUniqueString(); },\n },\n\n /**\n * Disables the toggle interactions\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Value of the toggle\n * @model checked\n * @values true, false, 'mixed'\n */\n checked: {\n type: [Boolean, String],\n default: false,\n validator: (v) => TOGGLE_CHECKED_VALUES.includes(v),\n },\n\n /**\n * Whether the component toggles on click. If you set this to false it means you will handle the toggling manually\n * via the checked prop or v-model. Change events will still be triggered.\n * @values true, false\n */\n toggleOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The size of the toggle.\n * @values sm, md\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(TOGGLE_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Shows the icon\n * @values true, false\n */\n showIcon: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * A set of props that are passed into the label container\n */\n labelChildProps: {\n type: Object,\n default: () => ({}),\n },\n },\n\n emits: [\n /**\n * Toggle change event\n *\n * @event change\n * @type {Boolean}\n * @model change\n */\n 'change',\n ],\n\n data () {\n return {\n internalChecked: this.checked,\n };\n },\n\n computed: {\n inputListeners () {\n return {\n ...this.$listeners,\n click: _ => this.toggleCheckedValue(),\n };\n },\n\n isIndeterminate () {\n return this.internalChecked === 'mixed';\n },\n\n toggleRole () {\n return this.isIndeterminate ? 'checkbox' : 'switch';\n },\n\n toggleClasses () {\n return [\n 'd-toggle',\n TOGGLE_SIZE_MODIFIERS[this.size],\n {\n 'd-toggle--checked': this.internalChecked === true,\n 'd-toggle--disabled': this.disabled,\n 'd-toggle--indeterminate': this.isIndeterminate,\n },\n ];\n },\n },\n\n watch: {\n checked (newChecked) {\n this.internalChecked = newChecked;\n },\n },\n\n mounted () {\n this.runValidations();\n },\n\n methods: {\n toggleCheckedValue () {\n this.$emit('change', !this.internalChecked);\n\n if (this.toggleOnClick) {\n this.internalChecked = !this.internalChecked;\n }\n },\n\n hasSlotLabel () {\n return !!(this.$slots.default);\n },\n\n runValidations () {\n this.validateInputLabels(this.hasSlotLabel(), this.$attrs['aria-label']);\n },\n\n validateInputLabels (hasLabel, ariaLabel) {\n if (!hasLabel && !ariaLabel) {\n Vue.util.warn(\n 'You must provide an aria-label when there is no label passed',\n this,\n );\n }\n },\n },\n};\n</script>\n"],"names":["utils"],"mappings":"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"}
|