@dialpad/dialtone-vue 3.120.0 → 3.120.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.
- package/dist/chunks/_plugin-vue_export-helper-caHeSgYY.js +11 -0
- package/dist/chunks/_plugin-vue_export-helper-caHeSgYY.js.map +1 -0
- package/dist/chunks/_plugin-vue_export-helper-fhnQq0tA.js +10 -0
- package/dist/chunks/_plugin-vue_export-helper-fhnQq0tA.js.map +1 -0
- package/dist/chunks/{dropdown-eWOvBvwq.js → dropdown-Hn-TeTvZ.js} +151 -104
- package/dist/chunks/{dropdown-UO3UJalk.js.map → dropdown-Hn-TeTvZ.js.map} +1 -1
- package/dist/chunks/dropdown-w8Do29L5.js +442 -0
- package/dist/chunks/{dropdown-eWOvBvwq.js.map → dropdown-w8Do29L5.js.map} +1 -1
- 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-2S_OSQ1t.js.map → icon_constants-Dy4MEUJL.js.map} +1 -1
- package/dist/chunks/icon_constants-QYpmdE0R.js +16 -0
- package/dist/chunks/{icon_constants-OpYAAKwF.js.map → icon_constants-QYpmdE0R.js.map} +1 -1
- package/dist/chunks/index-4qgKeErp.js +446 -0
- package/dist/chunks/{index-b4iXYvId.js.map → index-4qgKeErp.js.map} +1 -1
- package/dist/chunks/index-b_MgDylR.js +447 -0
- package/dist/chunks/{index-6tYeqbgP.js.map → index-b_MgDylR.js.map} +1 -1
- package/dist/chunks/{input-4UQWegUk.js → input-NmYDD5bn.js} +83 -60
- package/dist/chunks/{input-0Uksk4DP.js.map → input-NmYDD5bn.js.map} +1 -1
- package/dist/chunks/input-ttnte8zB.js +295 -0
- package/dist/chunks/{input-4UQWegUk.js.map → input-ttnte8zB.js.map} +1 -1
- package/dist/chunks/input_group-M-D25pOJ.js +152 -0
- package/dist/chunks/{input_group-bBKaq3Wi.js.map → input_group-M-D25pOJ.js.map} +1 -1
- package/dist/chunks/{input_group-bBKaq3Wi.js → input_group-jWnq2DJT.js} +27 -24
- package/dist/chunks/{input_group-AS760Cp7.js.map → input_group-jWnq2DJT.js.map} +1 -1
- package/dist/chunks/keyboard_list_navigation-ScXhrxya.js +284 -0
- package/dist/chunks/{keyboard_list_navigation-N74Bpdq7.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-F0O8nht0.js.map → keyboard_list_navigation-fJnl_Iox.js.map} +1 -1
- package/dist/chunks/link_constants-Huj7D_hm.js +22 -0
- package/dist/chunks/{link_constants-Kn6kP4i1.js.map → link_constants-Huj7D_hm.js.map} +1 -1
- package/dist/chunks/link_constants-nWVlXQBs.js +23 -0
- package/dist/chunks/{link_constants-vIUB92L4.js.map → link_constants-nWVlXQBs.js.map} +1 -1
- package/dist/chunks/list_item_constants-EiqkqZvP.js +13 -0
- package/dist/chunks/{list_item_constants-Tsz5CO1m.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-LTUc74pD.js.map → list_item_constants-u1xcN9Dd.js.map} +1 -1
- package/dist/chunks/modal-VgxXAQFP.js +105 -0
- package/dist/chunks/{modal-qEzlo0Sj.js.map → modal-VgxXAQFP.js.map} +1 -1
- package/dist/chunks/modal-XOr4kiNZ.js +106 -0
- package/dist/chunks/{modal-VuMFkZFH.js.map → modal-XOr4kiNZ.js.map} +1 -1
- package/dist/chunks/notice_action-WTucGhvr.js +222 -0
- package/dist/chunks/{notice_action-tJfD5Qw1.js.map → notice_action-WTucGhvr.js.map} +1 -1
- package/dist/chunks/notice_action-p-ePanW_.js +223 -0
- package/dist/chunks/{notice_action-jO199emq.js.map → notice_action-p-ePanW_.js.map} +1 -1
- package/dist/chunks/notice_constants-7Qt2CQEY.js +7 -0
- package/dist/chunks/{notice_constants-mC6al2Dm.js.map → notice_constants-7Qt2CQEY.js.map} +1 -1
- package/dist/chunks/notice_constants-UXo9e3bS.js +6 -0
- package/dist/chunks/{notice_constants-c--hBFQw.js.map → notice_constants-UXo9e3bS.js.map} +1 -1
- package/dist/chunks/popover_constants-JwBF9h1Z.js +143 -0
- package/dist/chunks/{popover_constants-hOEhklvr.js.map → popover_constants-JwBF9h1Z.js.map} +1 -1
- package/dist/chunks/popover_constants-Qkpb0yh2.js +144 -0
- package/dist/chunks/{popover_constants-qjlEkroB.js.map → popover_constants-Qkpb0yh2.js.map} +1 -1
- package/dist/chunks/{sr_only_close_button-7O-Ev8uM.js → sr_only_close_button-3EdsV-dH.js} +28 -24
- package/dist/chunks/{sr_only_close_button-iD7s1Pbj.js.map → sr_only_close_button-3EdsV-dH.js.map} +1 -1
- package/dist/chunks/sr_only_close_button-xGrHFjwA.js +91 -0
- package/dist/chunks/{sr_only_close_button-7O-Ev8uM.js.map → sr_only_close_button-xGrHFjwA.js.map} +1 -1
- package/dist/chunks/stack_constants-HraCekPm.js +15 -0
- package/dist/chunks/{stack_constants-m9Ickqw0.js.map → stack_constants-HraCekPm.js.map} +1 -1
- package/dist/chunks/stack_constants-SMzMWnAQ.js +14 -0
- package/dist/chunks/{stack_constants-u7tNqGtc.js.map → stack_constants-SMzMWnAQ.js.map} +1 -1
- package/dist/chunks/tab-RTDgnD9-.js +391 -0
- package/dist/chunks/{tab-at7WWglk.js.map → tab-RTDgnD9-.js.map} +1 -1
- package/dist/chunks/tab-qc3f42Yp.js +390 -0
- package/dist/chunks/{tab-GQZFMq83.js.map → tab-qc3f42Yp.js.map} +1 -1
- package/dist/common/constants.cjs +60 -0
- package/dist/{lib → common}/constants.cjs.map +1 -1
- 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/{lib → common}/dates.cjs.map +1 -1
- 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/{lib → common}/mixins.cjs.map +1 -1
- package/dist/common/mixins.js +17 -0
- package/dist/common/utils.cjs +243 -0
- package/dist/{lib → common}/utils.cjs.map +1 -1
- package/dist/common/utils.js +243 -0
- package/dist/{lib → common}/utils.js.map +1 -1
- package/dist/common/validators.cjs +23 -0
- package/dist/{lib → common}/validators.cjs.map +1 -1
- package/dist/common/validators.js +23 -0
- package/dist/{lib → common}/validators.js.map +1 -1
- package/dist/dialtone-vue.cjs +373 -1
- package/dist/dialtone-vue.cjs.map +1 -1
- package/dist/dialtone-vue.js +328 -327
- package/dist/dialtone-vue.js.map +1 -1
- package/dist/lib/attachment-carousel.cjs +345 -1
- package/dist/lib/attachment-carousel.cjs.map +1 -1
- package/dist/lib/attachment-carousel.js +126 -108
- package/dist/lib/attachment-carousel.js.map +1 -1
- package/dist/lib/avatar.cjs +447 -1
- package/dist/lib/avatar.cjs.map +1 -1
- package/dist/lib/avatar.js +135 -101
- package/dist/lib/avatar.js.map +1 -1
- package/dist/lib/badge.cjs +206 -1
- package/dist/lib/badge.cjs.map +1 -1
- package/dist/lib/badge.js +64 -48
- package/dist/lib/badge.js.map +1 -1
- package/dist/lib/banner.cjs +242 -2
- package/dist/lib/banner.cjs.map +1 -1
- package/dist/lib/banner.js +81 -71
- package/dist/lib/banner.js.map +1 -1
- package/dist/lib/breadcrumbs.cjs +150 -1
- package/dist/lib/breadcrumbs.cjs.map +1 -1
- package/dist/lib/breadcrumbs.js +60 -52
- package/dist/lib/breadcrumbs.js.map +1 -1
- package/dist/lib/button-group.cjs +41 -1
- package/dist/lib/button-group.cjs.map +1 -1
- package/dist/lib/button-group.js +15 -14
- package/dist/lib/button-group.js.map +1 -1
- package/dist/lib/button.cjs +356 -1
- package/dist/lib/button.cjs.map +1 -1
- package/dist/lib/button.js +108 -88
- package/dist/lib/button.js.map +1 -1
- package/dist/lib/callbar-button-with-popover.cjs +322 -1
- package/dist/lib/callbar-button-with-popover.cjs.map +1 -1
- package/dist/lib/callbar-button-with-popover.js +101 -83
- package/dist/lib/callbar-button-with-popover.js.map +1 -1
- package/dist/lib/callbar-button.cjs +200 -1
- package/dist/lib/callbar-button.cjs.map +1 -1
- package/dist/lib/callbar-button.js +52 -45
- package/dist/lib/callbar-button.js.map +1 -1
- package/dist/lib/callbox.cjs +217 -1
- package/dist/lib/callbox.cjs.map +1 -1
- package/dist/lib/callbox.js +80 -67
- package/dist/lib/callbox.js.map +1 -1
- package/dist/lib/card.cjs +91 -1
- package/dist/lib/card.cjs.map +1 -1
- package/dist/lib/card.js +27 -27
- package/dist/lib/card.js.map +1 -1
- package/dist/lib/checkbox-group.cjs +115 -1
- package/dist/lib/checkbox-group.cjs.map +1 -1
- package/dist/lib/checkbox-group.js +34 -23
- package/dist/lib/checkbox-group.js.map +1 -1
- package/dist/lib/checkbox.cjs +156 -1
- package/dist/lib/checkbox.cjs.map +1 -1
- package/dist/lib/checkbox.js +72 -60
- package/dist/lib/checkbox.js.map +1 -1
- package/dist/lib/chip.cjs +235 -1
- package/dist/lib/chip.cjs.map +1 -1
- package/dist/lib/chip.js +84 -67
- package/dist/lib/chip.js.map +1 -1
- package/dist/lib/codeblock.cjs +23 -2
- package/dist/lib/codeblock.cjs.map +1 -1
- package/dist/lib/codeblock.js +13 -13
- package/dist/lib/codeblock.js.map +1 -1
- package/dist/lib/collapsible.cjs +398 -1
- package/dist/lib/collapsible.cjs.map +1 -1
- package/dist/lib/collapsible.js +123 -100
- package/dist/lib/collapsible.js.map +1 -1
- package/dist/lib/combobox-multi-select.cjs +589 -1
- package/dist/lib/combobox-multi-select.cjs.map +1 -1
- package/dist/lib/combobox-multi-select.js +270 -177
- package/dist/lib/combobox-multi-select.js.map +1 -1
- package/dist/lib/combobox-with-popover.cjs +452 -1
- package/dist/lib/combobox-with-popover.cjs.map +1 -1
- package/dist/lib/combobox-with-popover.js +172 -127
- package/dist/lib/combobox-with-popover.js.map +1 -1
- package/dist/lib/combobox.cjs +18 -1
- package/dist/lib/combobox.cjs.map +1 -1
- package/dist/lib/combobox.js +9 -9
- package/dist/lib/contact-info.cjs +205 -1
- package/dist/lib/contact-info.cjs.map +1 -1
- package/dist/lib/contact-info.js +69 -60
- package/dist/lib/contact-info.js.map +1 -1
- package/dist/lib/contact-row.cjs +246 -1
- package/dist/lib/contact-row.cjs.map +1 -1
- package/dist/lib/contact-row.js +67 -63
- package/dist/lib/contact-row.js.map +1 -1
- package/dist/lib/datepicker.cjs +854 -1
- package/dist/lib/datepicker.cjs.map +1 -1
- package/dist/lib/datepicker.js +585 -441
- package/dist/lib/datepicker.js.map +1 -1
- package/dist/lib/description-list.cjs +116 -1
- package/dist/lib/description-list.cjs.map +1 -1
- package/dist/lib/description-list.js +56 -24
- package/dist/lib/description-list.js.map +1 -1
- package/dist/lib/dropdown.cjs +36 -1
- package/dist/lib/dropdown.cjs.map +1 -1
- package/dist/lib/dropdown.js +22 -21
- package/dist/lib/dropdown.js.map +1 -1
- package/dist/lib/editor.cjs +711 -1
- package/dist/lib/editor.cjs.map +1 -1
- package/dist/lib/editor.js +271 -235
- package/dist/lib/editor.js.map +1 -1
- package/dist/lib/emoji-picker.cjs +1277 -1
- package/dist/lib/emoji-picker.cjs.map +1 -1
- package/dist/lib/emoji-picker.js +859 -569
- package/dist/lib/emoji-picker.js.map +1 -1
- package/dist/lib/emoji-row.cjs +128 -1
- package/dist/lib/emoji-row.cjs.map +1 -1
- package/dist/lib/emoji-row.js +89 -75
- package/dist/lib/emoji-row.js.map +1 -1
- package/dist/lib/emoji-text-wrapper.cjs +102 -1
- package/dist/lib/emoji-text-wrapper.cjs.map +1 -1
- package/dist/lib/emoji-text-wrapper.js +42 -31
- package/dist/lib/emoji-text-wrapper.js.map +1 -1
- package/dist/lib/emoji.cjs +158 -1
- package/dist/lib/emoji.cjs.map +1 -1
- package/dist/lib/emoji.js +153 -6
- package/dist/lib/emoji.js.map +1 -1
- package/dist/lib/feed-item-row.cjs +296 -1
- package/dist/lib/feed-item-row.cjs.map +1 -1
- package/dist/lib/feed-item-row.js +119 -100
- package/dist/lib/feed-item-row.js.map +1 -1
- package/dist/lib/feed-pill.cjs +173 -1
- package/dist/lib/feed-pill.cjs.map +1 -1
- package/dist/lib/feed-pill.js +70 -57
- package/dist/lib/feed-pill.js.map +1 -1
- package/dist/lib/general-row.cjs +518 -1
- package/dist/lib/general-row.cjs.map +1 -1
- package/dist/lib/general-row.js +186 -148
- package/dist/lib/general-row.js.map +1 -1
- package/dist/lib/group-row.cjs +116 -1
- package/dist/lib/group-row.cjs.map +1 -1
- package/dist/lib/group-row.js +37 -35
- package/dist/lib/group-row.js.map +1 -1
- package/dist/lib/grouped-chip.cjs +96 -1
- package/dist/lib/grouped-chip.cjs.map +1 -1
- package/dist/lib/grouped-chip.js +51 -46
- package/dist/lib/grouped-chip.js.map +1 -1
- package/dist/lib/hovercard.cjs +223 -1
- package/dist/lib/hovercard.cjs.map +1 -1
- package/dist/lib/hovercard.js +115 -80
- package/dist/lib/hovercard.js.map +1 -1
- package/dist/lib/icon.cjs +58 -1
- package/dist/lib/icon.cjs.map +1 -1
- package/dist/lib/icon.js +20 -20
- package/dist/lib/icon.js.map +1 -1
- package/dist/lib/image-viewer.cjs +243 -1
- package/dist/lib/image-viewer.cjs.map +1 -1
- package/dist/lib/image-viewer.js +104 -80
- package/dist/lib/image-viewer.js.map +1 -1
- package/dist/lib/input-group.cjs +91 -1
- package/dist/lib/input-group.cjs.map +1 -1
- package/dist/lib/input-group.js +41 -39
- package/dist/lib/input-group.js.map +1 -1
- package/dist/lib/input.cjs +578 -1
- package/dist/lib/input.cjs.map +1 -1
- package/dist/lib/input.js +185 -137
- package/dist/lib/input.js.map +1 -1
- package/dist/lib/item-layout.cjs +91 -1
- package/dist/lib/item-layout.cjs.map +1 -1
- package/dist/lib/item-layout.js +45 -39
- package/dist/lib/item-layout.js.map +1 -1
- package/dist/lib/ivr-node.cjs +263 -1
- package/dist/lib/ivr-node.cjs.map +1 -1
- package/dist/lib/ivr-node.js +130 -112
- package/dist/lib/ivr-node.js.map +1 -1
- package/dist/lib/keyboard-shortcut.cjs +119 -1
- package/dist/lib/keyboard-shortcut.cjs.map +1 -1
- package/dist/lib/keyboard-shortcut.js +58 -48
- package/dist/lib/keyboard-shortcut.js.map +1 -1
- package/dist/lib/lazy-show.cjs +82 -1
- package/dist/lib/lazy-show.cjs.map +1 -1
- package/dist/lib/lazy-show.js +21 -19
- package/dist/lib/lazy-show.js.map +1 -1
- package/dist/lib/link.cjs +43 -1
- package/dist/lib/link.cjs.map +1 -1
- package/dist/lib/link.js +20 -19
- package/dist/lib/link.js.map +1 -1
- package/dist/lib/list-item-group.cjs +67 -1
- package/dist/lib/list-item-group.cjs.map +1 -1
- package/dist/lib/list-item-group.js +24 -22
- package/dist/lib/list-item-group.js.map +1 -1
- package/dist/lib/list-item.cjs +216 -1
- package/dist/lib/list-item.cjs.map +1 -1
- package/dist/lib/list-item.js +71 -60
- package/dist/lib/list-item.js.map +1 -1
- package/dist/lib/message-input.cjs +708 -1
- package/dist/lib/message-input.cjs.map +1 -1
- package/dist/lib/message-input.js +232 -206
- package/dist/lib/message-input.js.map +1 -1
- package/dist/lib/modal.cjs +444 -2
- package/dist/lib/modal.cjs.map +1 -1
- package/dist/lib/modal.js +153 -120
- package/dist/lib/modal.js.map +1 -1
- package/dist/lib/notice.cjs +197 -1
- package/dist/lib/notice.cjs.map +1 -1
- package/dist/lib/notice.js +66 -63
- package/dist/lib/notice.js.map +1 -1
- package/dist/lib/pagination.cjs +205 -1
- package/dist/lib/pagination.cjs.map +1 -1
- package/dist/lib/pagination.js +96 -81
- package/dist/lib/pagination.js.map +1 -1
- package/dist/lib/popover.cjs +1080 -1
- package/dist/lib/popover.cjs.map +1 -1
- package/dist/lib/popover.js +447 -267
- package/dist/lib/popover.js.map +1 -1
- package/dist/lib/presence.cjs +70 -1
- package/dist/lib/presence.cjs.map +1 -1
- package/dist/lib/presence.js +33 -27
- package/dist/lib/presence.js.map +1 -1
- package/dist/lib/radio-group.cjs +88 -1
- package/dist/lib/radio-group.cjs.map +1 -1
- package/dist/lib/radio-group.js +18 -18
- package/dist/lib/radio-group.js.map +1 -1
- package/dist/lib/radio.cjs +162 -1
- package/dist/lib/radio.cjs.map +1 -1
- package/dist/lib/radio.js +66 -57
- package/dist/lib/radio.js.map +1 -1
- package/dist/lib/rich-text-editor.cjs +1137 -1
- package/dist/lib/rich-text-editor.cjs.map +1 -1
- package/dist/lib/rich-text-editor.js +567 -386
- package/dist/lib/rich-text-editor.js.map +1 -1
- package/dist/lib/root-layout.cjs +158 -1
- package/dist/lib/root-layout.cjs.map +1 -1
- package/dist/lib/root-layout.js +33 -31
- package/dist/lib/root-layout.js.map +1 -1
- package/dist/lib/scroller.cjs +1090 -1
- package/dist/lib/scroller.cjs.map +1 -1
- package/dist/lib/scroller.js +668 -345
- package/dist/lib/scroller.js.map +1 -1
- package/dist/lib/select-menu.cjs +312 -1
- package/dist/lib/select-menu.cjs.map +1 -1
- package/dist/lib/select-menu.js +124 -79
- package/dist/lib/select-menu.js.map +1 -1
- package/dist/lib/settings-menu-button.cjs +77 -1
- package/dist/lib/settings-menu-button.cjs.map +1 -1
- package/dist/lib/settings-menu-button.js +31 -30
- package/dist/lib/settings-menu-button.js.map +1 -1
- package/dist/lib/skeleton.cjs +635 -1
- package/dist/lib/skeleton.cjs.map +1 -1
- package/dist/lib/skeleton.js +189 -152
- package/dist/lib/skeleton.js.map +1 -1
- package/dist/lib/stack.cjs +123 -1
- package/dist/lib/stack.cjs.map +1 -1
- package/dist/lib/stack.js +61 -53
- package/dist/lib/stack.js.map +1 -1
- package/dist/lib/tabs.cjs +102 -1
- package/dist/lib/tabs.cjs.map +1 -1
- package/dist/lib/tabs.js +47 -41
- package/dist/lib/tabs.js.map +1 -1
- package/dist/lib/time-pill.cjs +41 -1
- package/dist/lib/time-pill.cjs.map +1 -1
- package/dist/lib/time-pill.js +18 -14
- package/dist/lib/time-pill.js.map +1 -1
- package/dist/lib/toast.cjs +281 -1
- package/dist/lib/toast.cjs.map +1 -1
- package/dist/lib/toast.js +96 -74
- package/dist/lib/toast.js.map +1 -1
- package/dist/lib/toggle.cjs +192 -1
- package/dist/lib/toggle.cjs.map +1 -1
- package/dist/lib/toggle.js +60 -49
- package/dist/lib/toggle.js.map +1 -1
- package/dist/lib/tooltip-directive.cjs +84 -1
- package/dist/lib/tooltip-directive.cjs.map +1 -1
- package/dist/lib/tooltip-directive.js +56 -42
- package/dist/lib/tooltip-directive.js.map +1 -1
- package/dist/lib/tooltip.cjs +460 -1
- package/dist/lib/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip.js +162 -103
- package/dist/lib/tooltip.js.map +1 -1
- package/dist/lib/top-banner-info.cjs +71 -1
- package/dist/lib/top-banner-info.cjs.map +1 -1
- package/dist/lib/top-banner-info.js +27 -22
- package/dist/lib/top-banner-info.js.map +1 -1
- package/dist/lib/unread-pill.cjs +73 -1
- package/dist/lib/unread-pill.cjs.map +1 -1
- package/dist/lib/unread-pill.js +28 -25
- package/dist/lib/unread-pill.js.map +1 -1
- package/dist/lib/validation-messages.cjs +89 -1
- package/dist/lib/validation-messages.cjs.map +1 -1
- package/dist/lib/validation-messages.js +41 -36
- package/dist/lib/validation-messages.js.map +1 -1
- package/dist/style.css +1257 -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/package.json +30 -29
- package/dist/chunks/_plugin-vue_export-helper-6_y-gaV6.js +0 -2
- package/dist/chunks/_plugin-vue_export-helper-6_y-gaV6.js.map +0 -1
- package/dist/chunks/_plugin-vue_export-helper-hUChTQA_.js +0 -10
- package/dist/chunks/_plugin-vue_export-helper-hUChTQA_.js.map +0 -1
- package/dist/chunks/dropdown-UO3UJalk.js +0 -2
- package/dist/chunks/dropdown_constants-EUcDxBrX.js +0 -9
- package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +0 -1
- package/dist/chunks/dropdown_constants-KHFvVI2L.js +0 -2
- package/dist/chunks/dropdown_constants-KHFvVI2L.js.map +0 -1
- package/dist/chunks/icon_constants-2S_OSQ1t.js +0 -2
- package/dist/chunks/index-6tYeqbgP.js +0 -3
- package/dist/chunks/index-IBtQ5jRJ.js +0 -2
- package/dist/chunks/index-IBtQ5jRJ.js.map +0 -1
- package/dist/chunks/index-b4iXYvId.js +0 -399
- package/dist/chunks/index-mRmwpCBG.js +0 -256
- package/dist/chunks/index-mRmwpCBG.js.map +0 -1
- package/dist/chunks/input-0Uksk4DP.js +0 -2
- package/dist/chunks/input_group-AS760Cp7.js +0 -2
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +0 -197
- package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js +0 -2
- package/dist/chunks/link_constants-Kn6kP4i1.js +0 -2
- package/dist/chunks/link_constants-vIUB92L4.js +0 -16
- package/dist/chunks/list_item_constants-LTUc74pD.js +0 -13
- package/dist/chunks/list_item_constants-Tsz5CO1m.js +0 -2
- package/dist/chunks/modal-VuMFkZFH.js +0 -82
- package/dist/chunks/modal-qEzlo0Sj.js +0 -2
- package/dist/chunks/notice_action-jO199emq.js +0 -2
- package/dist/chunks/notice_action-tJfD5Qw1.js +0 -209
- package/dist/chunks/notice_constants-c--hBFQw.js +0 -6
- package/dist/chunks/notice_constants-mC6al2Dm.js +0 -2
- package/dist/chunks/popover_constants-hOEhklvr.js +0 -2
- package/dist/chunks/popover_constants-qjlEkroB.js +0 -114
- package/dist/chunks/sr_only_close_button-iD7s1Pbj.js +0 -3
- package/dist/chunks/stack_constants-m9Ickqw0.js +0 -2
- package/dist/chunks/stack_constants-u7tNqGtc.js +0 -13
- package/dist/chunks/tab-GQZFMq83.js +0 -367
- package/dist/chunks/tab-at7WWglk.js +0 -2
- package/dist/lib/constants.cjs +0 -2
- package/dist/lib/dates.cjs +0 -2
- package/dist/lib/dates.js +0 -57
- package/dist/lib/mixins.cjs +0 -2
- package/dist/lib/mixins.js +0 -17
- package/dist/lib/utils.cjs +0 -2
- package/dist/lib/utils.js +0 -171
- package/dist/lib/validators.cjs +0 -2
- package/dist/lib/validators.js +0 -12
- /package/dist/{lib → common}/mixins.js.map +0 -0
package/dist/lib/toast.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.cjs","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 >\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 >\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 @close=\"closeToast\"\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 `v-model` with this prop to update\n * the data in your component.\n * Supports v-model\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 * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\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 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 unmounted () {\n clearTimeout(this.displayTimer);\n },\n\n methods: {\n closeToast (event) {\n this.$emit('update:show', false);\n this.$emit('close', event);\n },\n\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","show","event","_hoisted_2","$data","_createElementBlock","_normalizeClass","$options","$props","_createElementVNode","_createBlock","_component_dt_notice_icon","_renderSlot","_ctx","_createVNode","_component_dt_notice_content","_component_dt_notice_action"],"mappings":"ylBAAY,MAACA,EAAc,CAAC,SAAU,OAAO,EAChCC,EAAqB,IC4D7BC,EAAU,CACb,KAAM,UAEN,WAAY,cACVC,EAAY,EACZ,gBAAAC,EAAe,EACf,eAAAC,EAAc,CACf,EAED,OAAQ,CAACC,EAAAA,CAAsB,EAE/B,MAAO,CAKL,QAAS,CACP,KAAM,OACN,SAAW,CAAE,OAAOC,UAAM,gBAAiB,CAAG,CAC/C,EAMD,UAAW,CACT,KAAM,OACN,SAAW,CAAE,OAAOA,UAAM,gBAAiB,CAAG,CAC/C,EAKD,MAAO,CACL,KAAM,OACN,QAAS,EACV,EAKD,QAAS,CACP,KAAM,OACN,QAAS,EACV,EAOD,KAAM,CACJ,KAAM,OACN,QAAS,SACT,UAAYC,GACHR,EAAY,SAASQ,CAAI,CAEnC,EAMD,KAAM,CACJ,KAAM,OACN,QAAS,OACT,UAAYC,GACHC,EAAY,EAAC,SAASD,CAAI,CAEpC,EAMD,UAAW,CACT,KAAM,QACN,QAAS,EACV,EASD,KAAM,CACJ,KAAM,QACN,QAAS,EACV,EAKD,iBAAkB,CAChB,KAAM,OACN,QAAS,KAAO,CAAA,EACjB,EAMD,UAAW,CACT,KAAM,QACN,QAAS,EACV,EAMD,SAAU,CACR,KAAM,QACN,QAAS,EACV,EAMD,WAAY,CACV,KAAM,QACN,QAAS,EACV,EAOD,SAAU,CACR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B,CAA7BI,aAA6BC,EAAA,OAAA,eAAA,sBAG/B,IAEO,CAFPD,EAAAA,WAEOC,sBAFP,IAEO,qCADFL,EAAO,OAAA,EAAA,CAAA,uDAGdM,EAAAA,YAUmBE,EAAA,CAThB,cAAaR,EAAU,WACvB,aAAYA,EAAS,UACrB,qBAAoBA,EAAgB,iBACpC,wBAAuBK,EAAmB,oBAC1C,8BAA6BA,EAAwB,yBACrD,QAAON,EAAU,+BAGlB,IAAsB,CAAtBK,aAAsBC,EAAA,OAAA,QAAA"}
|
|
1
|
+
{"version":3,"file":"toast.cjs","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 >\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 >\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 @close=\"closeToast\"\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 `v-model` with this prop to update\n * the data in your component.\n * Supports v-model\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 * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\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 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 unmounted () {\n clearTimeout(this.displayTimer);\n },\n\n methods: {\n closeToast (event) {\n this.$emit('update:show', false);\n this.$emit('close', event);\n },\n\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":["DtNoticeIcon","DtNoticeContent","DtNoticeAction","SrOnlyCloseButtonMixin","utils","NOTICE_KINDS","_createElementBlock","_normalizeClass","_createElementVNode","_createBlock","_renderSlot","_createVNode"],"mappings":";;;;;;;;;;;;;;;AAAY,MAAC,cAAc,CAAC,UAAU,OAAO;AACjC,MAAC,qBAAqB;AC4DlC,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,kBACVA,cAAY;AAAA,IACZ,iBAAAC,cAAe;AAAA,IACf,gBAAAC,cAAc;AAAA,EACf;AAAA,EAED,QAAQ,CAACC,qBAAAA,sBAAsB;AAAA,EAE/B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,UAAW;AAAE,eAAOC,qBAAM,gBAAiB;AAAA,MAAG;AAAA,IAC/C;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,UAAW;AAAE,eAAOA,qBAAM,gBAAiB;AAAA,MAAG;AAAA,IAC/C;AAAA;AAAA;AAAA;AAAA,IAKD,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAAC,SAAS;AACnB,eAAO,YAAY,SAAS,IAAI;AAAA,MACjC;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAAC,SAAS;AACnB,eAAOC,iBAAY,aAAC,SAAS,IAAI;AAAA,MAClC;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,I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AThB,eAAa,OAAU;AAAA,QACvB,cAAY,OAAS;AAAA,QACrB,sBAAoB,OAAgB;AAAA,QACpC,yBAAuB,KAAmB;AAAA,QAC1C,+BAA6B,KAAwB;AAAA,QACrD,SAAO,SAAU;AAAA;6BAGlB,MAAsB;AAAA,UAAtBD,eAAsB,KAAA,QAAA,QAAA;AAAA;;;;;;;;;;"}
|
package/dist/lib/toast.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { resolveComponent
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "
|
|
1
|
+
import utils from "../common/utils.js";
|
|
2
|
+
import { SrOnlyCloseButtonMixin } from "../chunks/sr_only_close_button-3EdsV-dH.js";
|
|
3
|
+
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, withCtx, renderSlot, createCommentVNode, createVNode, createTextVNode, toDisplayString } from "vue";
|
|
4
|
+
import { _export_sfc } from "../chunks/_plugin-vue_export-helper-caHeSgYY.js";
|
|
5
|
+
import { DtNoticeIcon, DtNoticeContent, DtNoticeAction } from "../chunks/notice_action-p-ePanW_.js";
|
|
6
|
+
import { NOTICE_KINDS } from "../chunks/notice_constants-7Qt2CQEY.js";
|
|
7
|
+
import "../common/constants.js";
|
|
8
8
|
import "./icon.js";
|
|
9
9
|
import "@dialpad/dialtone-icons/vue3";
|
|
10
|
-
import "../chunks/icon_constants-
|
|
10
|
+
import "../chunks/icon_constants-Dy4MEUJL.js";
|
|
11
11
|
import "@dialpad/dialtone-icons/icons.json";
|
|
12
12
|
import "./button.js";
|
|
13
|
-
import "../chunks/link_constants-
|
|
14
|
-
const
|
|
13
|
+
import "../chunks/link_constants-nWVlXQBs.js";
|
|
14
|
+
const TOAST_ROLES = ["status", "alert"];
|
|
15
|
+
const TOAST_MIN_DURATION = 6e3;
|
|
16
|
+
const _sfc_main = {
|
|
15
17
|
name: "DtToast",
|
|
16
18
|
components: {
|
|
17
|
-
DtNoticeIcon
|
|
18
|
-
DtNoticeContent
|
|
19
|
-
DtNoticeAction
|
|
19
|
+
DtNoticeIcon,
|
|
20
|
+
DtNoticeContent,
|
|
21
|
+
DtNoticeAction
|
|
20
22
|
},
|
|
21
|
-
mixins: [
|
|
23
|
+
mixins: [SrOnlyCloseButtonMixin],
|
|
22
24
|
props: {
|
|
23
25
|
/**
|
|
24
26
|
* Sets an ID on the title element of the component. Useful for aria-describedby
|
|
@@ -27,7 +29,7 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
27
29
|
titleId: {
|
|
28
30
|
type: String,
|
|
29
31
|
default() {
|
|
30
|
-
return
|
|
32
|
+
return utils.getUniqueString();
|
|
31
33
|
}
|
|
32
34
|
},
|
|
33
35
|
/**
|
|
@@ -37,7 +39,7 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
37
39
|
contentId: {
|
|
38
40
|
type: String,
|
|
39
41
|
default() {
|
|
40
|
-
return
|
|
42
|
+
return utils.getUniqueString();
|
|
41
43
|
}
|
|
42
44
|
},
|
|
43
45
|
/**
|
|
@@ -62,7 +64,9 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
62
64
|
role: {
|
|
63
65
|
type: String,
|
|
64
66
|
default: "status",
|
|
65
|
-
validator: (
|
|
67
|
+
validator: (role) => {
|
|
68
|
+
return TOAST_ROLES.includes(role);
|
|
69
|
+
}
|
|
66
70
|
},
|
|
67
71
|
/**
|
|
68
72
|
* Severity level of the toast, sets the icon and background
|
|
@@ -71,7 +75,9 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
71
75
|
kind: {
|
|
72
76
|
type: String,
|
|
73
77
|
default: "base",
|
|
74
|
-
validator: (
|
|
78
|
+
validator: (kind) => {
|
|
79
|
+
return NOTICE_KINDS.includes(kind);
|
|
80
|
+
}
|
|
75
81
|
},
|
|
76
82
|
/**
|
|
77
83
|
* Used in scenarios where the message needs to visually dominate the screen.
|
|
@@ -79,7 +85,7 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
79
85
|
*/
|
|
80
86
|
important: {
|
|
81
87
|
type: Boolean,
|
|
82
|
-
default:
|
|
88
|
+
default: false
|
|
83
89
|
},
|
|
84
90
|
/**
|
|
85
91
|
* Controls whether the toast is shown. If a valid duration is provided, the toast will disappear
|
|
@@ -90,7 +96,7 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
90
96
|
*/
|
|
91
97
|
show: {
|
|
92
98
|
type: Boolean,
|
|
93
|
-
default:
|
|
99
|
+
default: false
|
|
94
100
|
},
|
|
95
101
|
/**
|
|
96
102
|
* Props for the toast close button.
|
|
@@ -105,7 +111,7 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
105
111
|
*/
|
|
106
112
|
hideClose: {
|
|
107
113
|
type: Boolean,
|
|
108
|
-
default:
|
|
114
|
+
default: false
|
|
109
115
|
},
|
|
110
116
|
/**
|
|
111
117
|
* Hides the icon from the notice
|
|
@@ -113,7 +119,7 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
113
119
|
*/
|
|
114
120
|
hideIcon: {
|
|
115
121
|
type: Boolean,
|
|
116
|
-
default:
|
|
122
|
+
default: false
|
|
117
123
|
},
|
|
118
124
|
/**
|
|
119
125
|
* Hides the action from the notice
|
|
@@ -121,7 +127,7 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
121
127
|
*/
|
|
122
128
|
hideAction: {
|
|
123
129
|
type: Boolean,
|
|
124
|
-
default:
|
|
130
|
+
default: false
|
|
125
131
|
},
|
|
126
132
|
/**
|
|
127
133
|
* The duration in ms the toast will display before disappearing.
|
|
@@ -131,7 +137,9 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
131
137
|
duration: {
|
|
132
138
|
type: Number,
|
|
133
139
|
default: null,
|
|
134
|
-
validator: (
|
|
140
|
+
validator: (duration) => {
|
|
141
|
+
return duration >= TOAST_MIN_DURATION;
|
|
142
|
+
}
|
|
135
143
|
}
|
|
136
144
|
},
|
|
137
145
|
emits: [
|
|
@@ -157,19 +165,20 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
157
165
|
],
|
|
158
166
|
data() {
|
|
159
167
|
return {
|
|
160
|
-
isShown:
|
|
161
|
-
minDuration:
|
|
168
|
+
isShown: false,
|
|
169
|
+
minDuration: TOAST_MIN_DURATION
|
|
162
170
|
};
|
|
163
171
|
},
|
|
164
172
|
computed: {
|
|
165
173
|
kindClass() {
|
|
166
|
-
|
|
174
|
+
const kindClasses = {
|
|
167
175
|
error: "d-toast--error",
|
|
168
176
|
info: "d-toast--info",
|
|
169
177
|
success: "d-toast--success",
|
|
170
178
|
warning: "d-toast--warning",
|
|
171
179
|
base: "d-toast--base"
|
|
172
|
-
}
|
|
180
|
+
};
|
|
181
|
+
return kindClasses[this.kind];
|
|
173
182
|
},
|
|
174
183
|
shouldSetTimeout() {
|
|
175
184
|
return !!this.duration && this.duration >= this.minDuration;
|
|
@@ -177,84 +186,97 @@ const B = ["status", "alert"], u = 6e3, D = {
|
|
|
177
186
|
},
|
|
178
187
|
watch: {
|
|
179
188
|
show: {
|
|
180
|
-
handler: function(
|
|
181
|
-
this.isShown =
|
|
189
|
+
handler: function(show) {
|
|
190
|
+
this.isShown = show;
|
|
191
|
+
if (show) {
|
|
192
|
+
this.setTimeout();
|
|
193
|
+
} else {
|
|
194
|
+
clearTimeout(this.displayTimer);
|
|
195
|
+
}
|
|
182
196
|
},
|
|
183
|
-
immediate:
|
|
197
|
+
immediate: true
|
|
184
198
|
}
|
|
185
199
|
},
|
|
186
200
|
unmounted() {
|
|
187
201
|
clearTimeout(this.displayTimer);
|
|
188
202
|
},
|
|
189
203
|
methods: {
|
|
190
|
-
closeToast(
|
|
191
|
-
this.$emit("update:show",
|
|
204
|
+
closeToast(event) {
|
|
205
|
+
this.$emit("update:show", false);
|
|
206
|
+
this.$emit("close", event);
|
|
192
207
|
},
|
|
193
208
|
setTimeout() {
|
|
194
|
-
|
|
195
|
-
this.
|
|
196
|
-
|
|
209
|
+
if (this.shouldSetTimeout) {
|
|
210
|
+
this.displayTimer = setTimeout(() => {
|
|
211
|
+
this.isShown = false;
|
|
212
|
+
this.$emit("update:show", false);
|
|
213
|
+
}, this.duration);
|
|
214
|
+
}
|
|
197
215
|
}
|
|
198
216
|
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
217
|
+
};
|
|
218
|
+
const _hoisted_1 = ["aria-hidden"];
|
|
219
|
+
const _hoisted_2 = { class: "d-toast__dialog" };
|
|
220
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
221
|
+
const _component_dt_notice_icon = resolveComponent("dt-notice-icon");
|
|
222
|
+
const _component_dt_notice_content = resolveComponent("dt-notice-content");
|
|
223
|
+
const _component_dt_notice_action = resolveComponent("dt-notice-action");
|
|
224
|
+
return $data.isShown ? (openBlock(), createElementBlock("div", {
|
|
203
225
|
key: 0,
|
|
204
|
-
class:
|
|
226
|
+
class: normalizeClass([
|
|
205
227
|
"d-toast",
|
|
206
|
-
|
|
207
|
-
{ "d-toast--important":
|
|
228
|
+
$options.kindClass,
|
|
229
|
+
{ "d-toast--important": $props.important }
|
|
208
230
|
]),
|
|
209
231
|
"data-qa": "dt-toast",
|
|
210
|
-
"aria-hidden": (
|
|
232
|
+
"aria-hidden": (!$data.isShown).toString()
|
|
211
233
|
}, [
|
|
212
|
-
|
|
213
|
-
|
|
234
|
+
createElementVNode("div", _hoisted_2, [
|
|
235
|
+
!$props.hideIcon ? (openBlock(), createBlock(_component_dt_notice_icon, {
|
|
214
236
|
key: 0,
|
|
215
|
-
kind:
|
|
237
|
+
kind: $props.kind
|
|
216
238
|
}, {
|
|
217
|
-
default:
|
|
218
|
-
|
|
239
|
+
default: withCtx(() => [
|
|
240
|
+
renderSlot(_ctx.$slots, "icon")
|
|
219
241
|
]),
|
|
220
242
|
_: 3
|
|
221
|
-
}, 8, ["kind"])),
|
|
222
|
-
|
|
223
|
-
"title-id":
|
|
224
|
-
"content-id":
|
|
225
|
-
title:
|
|
226
|
-
role:
|
|
243
|
+
}, 8, ["kind"])) : createCommentVNode("", true),
|
|
244
|
+
createVNode(_component_dt_notice_content, {
|
|
245
|
+
"title-id": $props.titleId,
|
|
246
|
+
"content-id": $props.contentId,
|
|
247
|
+
title: $props.title,
|
|
248
|
+
role: $props.role
|
|
227
249
|
}, {
|
|
228
|
-
titleOverride:
|
|
229
|
-
|
|
250
|
+
titleOverride: withCtx(() => [
|
|
251
|
+
renderSlot(_ctx.$slots, "titleOverride")
|
|
230
252
|
]),
|
|
231
|
-
default:
|
|
232
|
-
|
|
233
|
-
|
|
253
|
+
default: withCtx(() => [
|
|
254
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
255
|
+
createTextVNode(toDisplayString($props.message), 1)
|
|
234
256
|
])
|
|
235
257
|
]),
|
|
236
258
|
_: 3
|
|
237
259
|
}, 8, ["title-id", "content-id", "title", "role"]),
|
|
238
|
-
|
|
239
|
-
"hide-action":
|
|
240
|
-
"hide-close":
|
|
241
|
-
"close-button-props":
|
|
242
|
-
"visually-hidden-close":
|
|
243
|
-
"visually-hidden-close-label":
|
|
244
|
-
onClose:
|
|
260
|
+
createVNode(_component_dt_notice_action, {
|
|
261
|
+
"hide-action": $props.hideAction,
|
|
262
|
+
"hide-close": $props.hideClose,
|
|
263
|
+
"close-button-props": $props.closeButtonProps,
|
|
264
|
+
"visually-hidden-close": _ctx.visuallyHiddenClose,
|
|
265
|
+
"visually-hidden-close-label": _ctx.visuallyHiddenCloseLabel,
|
|
266
|
+
onClose: $options.closeToast
|
|
245
267
|
}, {
|
|
246
|
-
default:
|
|
247
|
-
|
|
268
|
+
default: withCtx(() => [
|
|
269
|
+
renderSlot(_ctx.$slots, "action")
|
|
248
270
|
]),
|
|
249
271
|
_: 3
|
|
250
272
|
}, 8, ["hide-action", "hide-close", "close-button-props", "visually-hidden-close", "visually-hidden-close-label", "onClose"])
|
|
251
273
|
])
|
|
252
|
-
], 10,
|
|
274
|
+
], 10, _hoisted_1)) : createCommentVNode("", true);
|
|
253
275
|
}
|
|
254
|
-
const
|
|
276
|
+
const toast = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
255
277
|
export {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
278
|
+
toast as DtToast,
|
|
279
|
+
TOAST_MIN_DURATION,
|
|
280
|
+
TOAST_ROLES
|
|
259
281
|
};
|
|
260
282
|
//# 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 >\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 >\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 @close=\"closeToast\"\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 `v-model` with this prop to update\n * the data in your component.\n * Supports v-model\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 * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\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 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 unmounted () {\n clearTimeout(this.displayTimer);\n },\n\n methods: {\n closeToast (event) {\n this.$emit('update:show', false);\n this.$emit('close', event);\n },\n\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","show","event","_hoisted_2","$data","_createElementBlock","_normalizeClass","$options","$props","_createElementVNode","_createBlock","_component_dt_notice_icon","_renderSlot","_ctx","_createVNode","_component_dt_notice_content","_component_dt_notice_action"],"mappings":";;;;;;;;;;;;;AAAY,MAACA,IAAc,CAAC,UAAU,OAAO,GAChCC,IAAqB,KC4D7BC,IAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,gBAAAC;AAAA,EACD;AAAA,EAED,QAAQ,CAACC,CAAsB;AAAA,EAE/B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,UAAW;AAAE,eAAOC,EAAM,gBAAiB;AAAA,MAAG;AAAA,IAC/C;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,UAAW;AAAE,eAAOA,EAAM,gBAAiB;AAAA,MAAG;AAAA,IAC/C;AAAA;AAAA;AAAA;AAAA,IAKD,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MACHR,EAAY,SAASQ,CAAI;AAAA,IAEnC;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MACHC,EAAa,SAASD,CAAI;AAAA,IAEpC;AAAA;AAAA;AA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rB,sBAAoBA,EAAgB;AAAA,QACpC,yBAAuBK,EAAmB;AAAA,QAC1C,+BAA6BA,EAAwB;AAAA,QACrD,SAAON,EAAU;AAAA;mBAGlB,MAAsB;AAAA,UAAtBK,EAAsBC,EAAA,QAAA,QAAA;AAAA;;;;;;;"}
|
|
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 >\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 >\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 @close=\"closeToast\"\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 `v-model` with this prop to update\n * the data in your component.\n * Supports v-model\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 * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\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 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 unmounted () {\n clearTimeout(this.displayTimer);\n },\n\n methods: {\n closeToast (event) {\n this.$emit('update:show', false);\n this.$emit('close', event);\n },\n\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":["_createElementBlock","_normalizeClass","_createElementVNode","_createBlock","_renderSlot","_createVNode"],"mappings":";;;;;;;;;;;;;AAAY,MAAC,cAAc,CAAC,UAAU,OAAO;AACjC,MAAC,qBAAqB;AC4DlC,MAAK,YAAU;AAA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
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const common_utils = require("../common/utils.cjs");
|
|
5
|
+
const _pluginVue_exportHelper = require("../chunks/_plugin-vue_export-helper-fhnQq0tA.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.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
|
+
hasSlotContent: common_utils.hasSlotContent
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
computed: {
|
|
105
|
+
inputListeners() {
|
|
106
|
+
return {
|
|
107
|
+
...this.$attrs,
|
|
108
|
+
onClick: (_) => this.toggleCheckedValue()
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
isIndeterminate() {
|
|
112
|
+
return this.internalChecked === "mixed";
|
|
113
|
+
},
|
|
114
|
+
toggleRole() {
|
|
115
|
+
return this.isIndeterminate ? "checkbox" : "switch";
|
|
116
|
+
},
|
|
117
|
+
toggleClasses() {
|
|
118
|
+
return [
|
|
119
|
+
"d-toggle",
|
|
120
|
+
TOGGLE_SIZE_MODIFIERS[this.size],
|
|
121
|
+
{
|
|
122
|
+
"d-toggle--checked": this.internalChecked === true,
|
|
123
|
+
"d-toggle--disabled": this.disabled,
|
|
124
|
+
"d-toggle--indeterminate": this.isIndeterminate
|
|
125
|
+
}
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
watch: {
|
|
130
|
+
checked(newChecked) {
|
|
131
|
+
this.internalChecked = newChecked;
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
mounted() {
|
|
135
|
+
this.runValidations();
|
|
136
|
+
},
|
|
137
|
+
methods: {
|
|
138
|
+
toggleCheckedValue() {
|
|
139
|
+
this.$emit("change", !this.internalChecked);
|
|
140
|
+
if (this.toggleOnClick) {
|
|
141
|
+
this.internalChecked = !this.internalChecked;
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
hasSlotLabel() {
|
|
145
|
+
return !!this.$slots.default;
|
|
146
|
+
},
|
|
147
|
+
runValidations() {
|
|
148
|
+
this.validateInputLabels(this.hasSlotLabel(), this.$attrs["aria-label"]);
|
|
149
|
+
},
|
|
150
|
+
validateInputLabels(hasLabel, ariaLabel) {
|
|
151
|
+
if (!hasLabel && !ariaLabel) {
|
|
152
|
+
vue.warn(
|
|
153
|
+
"You must provide an aria-label when there is no label passed",
|
|
154
|
+
this
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const _hoisted_1 = { class: "d-toggle-wrapper" };
|
|
161
|
+
const _hoisted_2 = ["for"];
|
|
162
|
+
const _hoisted_3 = ["id", "role", "aria-checked", "disabled", "aria-disabled"];
|
|
163
|
+
const _hoisted_4 = {
|
|
164
|
+
key: 0,
|
|
165
|
+
class: "d-toggle__inner"
|
|
166
|
+
};
|
|
167
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
168
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
169
|
+
$data.hasSlotContent(_ctx.$slots.default) ? (vue.openBlock(), vue.createElementBlock("label", vue.mergeProps({
|
|
170
|
+
key: 0,
|
|
171
|
+
class: $props.labelClass,
|
|
172
|
+
for: $props.id
|
|
173
|
+
}, $props.labelChildProps, { "data-qa": "toggle-label" }), [
|
|
174
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
175
|
+
], 16, _hoisted_2)) : vue.createCommentVNode("", true),
|
|
176
|
+
vue.createElementVNode("button", vue.mergeProps({
|
|
177
|
+
id: $props.id,
|
|
178
|
+
role: $options.toggleRole,
|
|
179
|
+
type: "button",
|
|
180
|
+
"aria-checked": $data.internalChecked.toString(),
|
|
181
|
+
disabled: $props.disabled,
|
|
182
|
+
"aria-disabled": $props.disabled.toString(),
|
|
183
|
+
class: $options.toggleClasses
|
|
184
|
+
}, $options.inputListeners), [
|
|
185
|
+
$props.showIcon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4)) : vue.createCommentVNode("", true)
|
|
186
|
+
], 16, _hoisted_3)
|
|
187
|
+
]);
|
|
188
|
+
}
|
|
189
|
+
const toggle = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
190
|
+
exports.DtToggle = toggle;
|
|
191
|
+
exports.TOGGLE_CHECKED_VALUES = TOGGLE_CHECKED_VALUES;
|
|
192
|
+
exports.TOGGLE_SIZE_MODIFIERS = TOGGLE_SIZE_MODIFIERS;
|
|
2
193
|
//# sourceMappingURL=toggle.cjs.map
|