@dialpad/dialtone 9.123.2 → 9.125.0
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/README.md +12 -5
- package/dist/css/dialtone-default-theme.css +414 -77
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone-docs.json +1 -1
- package/dist/css/dialtone.css +188 -68
- package/dist/css/dialtone.min.css +1 -1
- package/dist/css/svg/spot/playlist.svg +1 -0
- package/dist/css/vue/spot/SpotPlaylist.vue +3 -0
- package/dist/tokens/doc.json +24348 -24348
- package/dist/vue2/common/mixins/index.cjs +1 -1
- package/dist/vue2/common/mixins/index.js +10 -10
- package/dist/vue2/common/mixins/localization.cjs +2 -0
- package/dist/vue2/common/mixins/localization.cjs.map +1 -0
- package/dist/vue2/common/mixins/localization.js +10 -0
- package/dist/vue2/common/mixins/localization.js.map +1 -0
- package/dist/vue2/common/utils/index.cjs +1 -1
- package/dist/vue2/common/utils/index.cjs.map +1 -1
- package/dist/vue2/common/utils/index.js +43 -39
- package/dist/vue2/common/utils/index.js.map +1 -1
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/dialtone-vue.cjs +1 -1
- package/dist/vue2/dialtone-vue.js +341 -340
- package/dist/vue2/dialtone-vue.js.map +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs.map +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.js +61 -86
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.js.map +1 -1
- package/dist/vue2/lib/banner/banner.cjs +2 -2
- package/dist/vue2/lib/banner/banner.cjs.map +1 -1
- package/dist/vue2/lib/banner/banner.js +25 -33
- package/dist/vue2/lib/banner/banner.js.map +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.cjs +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.cjs.map +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.js +14 -12
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/vue2/lib/button/button.cjs +1 -1
- package/dist/vue2/lib/button/button.cjs.map +1 -1
- package/dist/vue2/lib/button/button.js +11 -9
- package/dist/vue2/lib/button/button.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +19 -25
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js +18 -21
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js.map +1 -1
- package/dist/vue2/lib/chip/chip.cjs +1 -1
- package/dist/vue2/lib/chip/chip.cjs.map +1 -1
- package/dist/vue2/lib/chip/chip.js +24 -29
- package/dist/vue2/lib/chip/chip.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox-constants.cjs +1 -1
- package/dist/vue2/lib/combobox/combobox-constants.cjs.map +1 -1
- package/dist/vue2/lib/combobox/combobox-constants.js +2 -2
- package/dist/vue2/lib/combobox/combobox-constants.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox-empty-list.cjs.map +1 -1
- package/dist/vue2/lib/combobox/combobox-empty-list.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox-loading-list.cjs.map +1 -1
- package/dist/vue2/lib/combobox/combobox-loading-list.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox.cjs +2 -2
- package/dist/vue2/lib/combobox/combobox.cjs.map +1 -1
- package/dist/vue2/lib/combobox/combobox.js +12 -12
- package/dist/vue2/lib/combobox/combobox.js.map +1 -1
- package/dist/vue2/lib/combobox/index.cjs +1 -1
- package/dist/vue2/lib/combobox/index.js +3 -3
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.js +19 -20
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.js +22 -24
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.cjs +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.cjs.map +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.js +40 -36
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.js.map +1 -1
- package/dist/vue2/lib/contact-row/contact-row.cjs +1 -1
- package/dist/vue2/lib/contact-row/contact-row.cjs.map +1 -1
- package/dist/vue2/lib/contact-row/contact-row.js +11 -25
- package/dist/vue2/lib/contact-row/contact-row.js.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker-constants.cjs +1 -1
- package/dist/vue2/lib/datepicker/datepicker-constants.cjs.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker-constants.js +2 -3
- package/dist/vue2/lib/datepicker/datepicker-constants.js.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker.cjs +1 -1
- package/dist/vue2/lib/datepicker/datepicker.cjs.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker.js +143 -229
- package/dist/vue2/lib/datepicker/datepicker.js.map +1 -1
- package/dist/vue2/lib/datepicker/utils.cjs +1 -1
- package/dist/vue2/lib/datepicker/utils.cjs.map +1 -1
- package/dist/vue2/lib/datepicker/utils.js +12 -11
- package/dist/vue2/lib/datepicker/utils.js.map +1 -1
- package/dist/vue2/lib/description-list/description-list.cjs +1 -1
- package/dist/vue2/lib/description-list/description-list.cjs.map +1 -1
- package/dist/vue2/lib/description-list/description-list.js +8 -8
- package/dist/vue2/lib/description-list/description-list.js.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown.cjs +1 -1
- package/dist/vue2/lib/dropdown/dropdown.cjs.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown.js +48 -50
- package/dist/vue2/lib/dropdown/dropdown.js.map +1 -1
- package/dist/vue2/lib/editor/editor.cjs +1 -1
- package/dist/vue2/lib/editor/editor.cjs.map +1 -1
- package/dist/vue2/lib/editor/editor.js +78 -87
- package/dist/vue2/lib/editor/editor.js.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker-constants.cjs +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker-constants.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker-constants.js +6 -19
- package/dist/vue2/lib/emoji-picker/emoji-picker-constants.js.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.js +106 -145
- package/dist/vue2/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/vue2/lib/emoji-picker/index.cjs +1 -1
- package/dist/vue2/lib/emoji-picker/index.js +6 -7
- package/dist/vue2/lib/emoji-row/emoji-row-constants.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row-constants.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row-constants.js +5 -7
- package/dist/vue2/lib/emoji-row/emoji-row-constants.js.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js +31 -22
- package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.cjs +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.cjs.map +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.js +20 -22
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.js.map +1 -1
- package/dist/vue2/lib/general-row/general-row.cjs +1 -1
- package/dist/vue2/lib/general-row/general-row.cjs.map +1 -1
- package/dist/vue2/lib/general-row/general-row.js +63 -52
- package/dist/vue2/lib/general-row/general-row.js.map +1 -1
- package/dist/vue2/lib/group-row/group-row.cjs +1 -1
- package/dist/vue2/lib/group-row/group-row.cjs.map +1 -1
- package/dist/vue2/lib/group-row/group-row.js +43 -32
- package/dist/vue2/lib/group-row/group-row.js.map +1 -1
- package/dist/vue2/lib/icon/icon-constants.cjs.map +1 -1
- package/dist/vue2/lib/icon/icon-constants.js.map +1 -1
- package/dist/vue2/lib/icon/icon.cjs +1 -1
- package/dist/vue2/lib/icon/icon.cjs.map +1 -1
- package/dist/vue2/lib/icon/icon.js +12 -8
- package/dist/vue2/lib/icon/icon.js.map +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.cjs +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.cjs.map +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.js +30 -31
- package/dist/vue2/lib/image-viewer/image-viewer.js.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node-constants.cjs +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node-constants.cjs.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node-constants.js +24 -24
- package/dist/vue2/lib/ivr-node/ivr-node-constants.js.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.cjs +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.cjs.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.js +38 -36
- package/dist/vue2/lib/ivr-node/ivr-node.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-link.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-link.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input-link.js +48 -23
- package/dist/vue2/lib/message-input/message-input-link.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.js +50 -22
- package/dist/vue2/lib/message-input/message-input-topbar.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input.js +112 -143
- package/dist/vue2/lib/message-input/message-input.js.map +1 -1
- package/dist/vue2/lib/modal/modal.cjs +1 -2
- package/dist/vue2/lib/modal/modal.cjs.map +1 -1
- package/dist/vue2/lib/modal/modal.js +25 -42
- package/dist/vue2/lib/modal/modal.js.map +1 -1
- package/dist/vue2/lib/notice/notice-action.cjs +1 -1
- package/dist/vue2/lib/notice/notice-action.cjs.map +1 -1
- package/dist/vue2/lib/notice/notice-action.js +19 -26
- package/dist/vue2/lib/notice/notice-action.js.map +1 -1
- package/dist/vue2/lib/notice/notice.cjs +1 -1
- package/dist/vue2/lib/notice/notice.cjs.map +1 -1
- package/dist/vue2/lib/notice/notice.js +18 -27
- package/dist/vue2/lib/notice/notice.js.map +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs.map +1 -1
- package/dist/vue2/lib/pagination/pagination.js +49 -58
- package/dist/vue2/lib/pagination/pagination.js.map +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.cjs +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.cjs.map +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.js +24 -26
- package/dist/vue2/lib/popover/popover-header-footer.js.map +1 -1
- package/dist/vue2/lib/popover/popover.cjs +1 -1
- package/dist/vue2/lib/popover/popover.cjs.map +1 -1
- package/dist/vue2/lib/popover/popover.js +26 -35
- package/dist/vue2/lib/popover/popover.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +5 -5
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +330 -320
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue2/lib/settings-menu-button/settings-menu-button.cjs.map +1 -1
- package/dist/vue2/lib/settings-menu-button/settings-menu-button.js.map +1 -1
- package/dist/vue2/lib/time-pill/time-pill.cjs.map +1 -1
- package/dist/vue2/lib/time-pill/time-pill.js.map +1 -1
- package/dist/vue2/lib/toast/toast.cjs +1 -1
- package/dist/vue2/lib/toast/toast.cjs.map +1 -1
- package/dist/vue2/lib/toast/toast.js +64 -97
- package/dist/vue2/lib/toast/toast.js.map +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.cjs +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.cjs.map +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.js +27 -18
- package/dist/vue2/lib/unread-pill/unread-pill.js.map +1 -1
- package/dist/vue2/localization/en-US.cjs +185 -0
- package/dist/vue2/localization/en-US.cjs.map +1 -0
- package/dist/vue2/localization/en-US.js +188 -0
- package/dist/vue2/localization/en-US.js.map +1 -0
- package/dist/vue2/localization/es-LA.cjs +169 -0
- package/dist/vue2/localization/es-LA.cjs.map +1 -0
- package/dist/vue2/localization/es-LA.js +172 -0
- package/dist/vue2/localization/es-LA.js.map +1 -0
- package/dist/vue2/localization/index.cjs +1176 -0
- package/dist/vue2/localization/index.cjs.map +1 -0
- package/dist/vue2/localization/index.js +1239 -0
- package/dist/vue2/localization/index.js.map +1 -0
- package/dist/vue2/node_modules/@tiptap/vue-2.cjs.map +1 -1
- package/dist/vue2/node_modules/@tiptap/vue-2.js.map +1 -1
- package/dist/vue2/shared/sr_only_close_button.cjs +1 -1
- package/dist/vue2/shared/sr_only_close_button.cjs.map +1 -1
- package/dist/vue2/shared/sr_only_close_button.js +19 -22
- package/dist/vue2/shared/sr_only_close_button.js.map +1 -1
- package/dist/vue2/types/common/mixins/index.d.ts +1 -1
- package/dist/vue2/types/common/mixins/localization.d.ts +8 -0
- package/dist/vue2/types/common/mixins/localization.d.ts.map +1 -0
- package/dist/vue2/types/common/sr_only_close_button.vue.d.ts +7 -13
- package/dist/vue2/types/common/sr_only_close_button.vue.d.ts.map +1 -1
- package/dist/vue2/types/common/utils/index.d.ts +1 -0
- package/dist/vue2/types/common/utils/index.d.ts.map +1 -1
- package/dist/vue2/types/components/banner/banner.vue.d.ts +0 -33
- package/dist/vue2/types/components/banner/banner.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/breadcrumbs/breadcrumbs.vue.d.ts +5 -1
- package/dist/vue2/types/components/button/button.vue.d.ts +6 -2
- package/dist/vue2/types/components/chip/chip.vue.d.ts +8 -18
- package/dist/vue2/types/components/combobox/combobox_constants.d.ts +2 -2
- package/dist/vue2/types/components/combobox/index.d.ts +1 -1
- package/dist/vue2/types/components/datepicker/datepicker.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/datepicker/datepicker_constants.d.ts +0 -1
- package/dist/vue2/types/components/datepicker/datepicker_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/datepicker/modules/calendar.vue.d.ts +5 -17
- package/dist/vue2/types/components/datepicker/modules/month-year-picker.vue.d.ts +8 -48
- package/dist/vue2/types/components/datepicker/utils.d.ts +1 -0
- package/dist/vue2/types/components/datepicker/utils.d.ts.map +1 -1
- package/dist/vue2/types/components/dropdown/dropdown.vue.d.ts +0 -24
- package/dist/vue2/types/components/dropdown/dropdown.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/emoji_picker/emoji_picker.vue.d.ts +5 -1
- package/dist/vue2/types/components/emoji_picker/emoji_picker_constants.d.ts +0 -13
- package/dist/vue2/types/components/icon/icon.vue.d.ts +1 -0
- package/dist/vue2/types/components/icon/icon_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/image_viewer/image_viewer.vue.d.ts +5 -8
- package/dist/vue2/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/modal/modal.vue.d.ts +3 -33
- package/dist/vue2/types/components/notice/notice.vue.d.ts +1 -34
- package/dist/vue2/types/components/notice/notice.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/notice/notice_action.vue.d.ts +3 -31
- package/dist/vue2/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/pagination/pagination.vue.d.ts +9 -26
- package/dist/vue2/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/popover/popover.vue.d.ts +0 -33
- package/dist/vue2/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/popover/popover_header_footer.vue.d.ts +8 -11
- package/dist/vue2/types/components/popover/popover_header_footer.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +15 -2
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/toast/layouts/toast_layout_alternate.vue.d.ts +1 -43
- package/dist/vue2/types/components/toast/layouts/toast_layout_alternate.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/toast/layouts/toast_layout_default.vue.d.ts +1 -34
- package/dist/vue2/types/components/toast/layouts/toast_layout_default.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/toast/toast.vue.d.ts +3 -111
- package/dist/vue2/types/components/toast/toast.vue.d.ts.map +1 -1
- package/dist/vue2/types/index.d.ts +1 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +7 -13
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +7 -12
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +8 -10
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node_constants.d.ts +7 -7
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node_constants.d.ts.map +1 -1
- package/dist/vue2/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -25
- package/dist/vue2/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +1 -25
- package/dist/vue2/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +5 -41
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +8 -26
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/media_components/progress_bar.vue.d.ts +2 -2
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts +20 -61
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +6 -1
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row_constants.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +9 -12
- package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +8 -2
- package/dist/vue2/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +15 -90
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +14 -2
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +14 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +10 -11
- package/dist/vue2/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +0 -18
- package/dist/vue2/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/general_row/general_row.vue.d.ts +21 -37
- package/dist/vue2/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/group_row/group_row.vue.d.ts +9 -18
- package/dist/vue2/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +7 -1
- package/dist/vue2/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js +3 -2
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/package.json +4 -3
- package/dist/vue2/common/mixins/sr-only-close-button.cjs +0 -3
- package/dist/vue2/common/mixins/sr-only-close-button.cjs.map +0 -1
- package/dist/vue2/common/mixins/sr-only-close-button.js +0 -44
- package/dist/vue2/common/mixins/sr-only-close-button.js.map +0 -1
- package/dist/vue2/lib/contact-row/contact-row-constants.cjs +0 -2
- package/dist/vue2/lib/contact-row/contact-row-constants.cjs.map +0 -1
- package/dist/vue2/lib/contact-row/contact-row-constants.js +0 -5
- package/dist/vue2/lib/contact-row/contact-row-constants.js.map +0 -1
- package/dist/vue2/lib/emoji/emoji-constants.cjs +0 -2
- package/dist/vue2/lib/emoji/emoji-constants.cjs.map +0 -1
- package/dist/vue2/lib/emoji/emoji-constants.js +0 -5
- package/dist/vue2/lib/emoji/emoji-constants.js.map +0 -1
- package/dist/vue2/lib/group-row/group-row-constants.cjs +0 -2
- package/dist/vue2/lib/group-row/group-row-constants.cjs.map +0 -1
- package/dist/vue2/lib/group-row/group-row-constants.js +0 -8
- package/dist/vue2/lib/group-row/group-row-constants.js.map +0 -1
- package/dist/vue2/lib/time-pill/time-pill-constants.cjs +0 -2
- package/dist/vue2/lib/time-pill/time-pill-constants.cjs.map +0 -1
- package/dist/vue2/lib/time-pill/time-pill-constants.js +0 -8
- package/dist/vue2/lib/time-pill/time-pill-constants.js.map +0 -1
- package/dist/vue2/types/common/mixins/sr_only_close_button.d.ts +0 -30
- package/dist/vue2/types/common/mixins/sr_only_close_button.d.ts.map +0 -1
- package/dist/vue2/types/components/emoji/emoji_constants.d.ts +0 -3
- package/dist/vue2/types/components/emoji/emoji_constants.d.ts.map +0 -1
- package/dist/vue2/types/recipes/conversation_view/time_pill/time_pill_constants.d.ts +0 -6
- package/dist/vue2/types/recipes/conversation_view/time_pill/time_pill_constants.d.ts.map +0 -1
- package/dist/vue2/types/recipes/leftbar/contact_row/contact_row_constants.d.ts +0 -3
- package/dist/vue2/types/recipes/leftbar/contact_row/contact_row_constants.d.ts.map +0 -1
- package/dist/vue2/types/recipes/leftbar/group_row/group_row_constants.d.ts +0 -6
- package/dist/vue2/types/recipes/leftbar/group_row/group_row_constants.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./breadcrumbs-constants.cjs"),d=require("./breadcrumb-item.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./breadcrumbs-constants.cjs"),d=require("./breadcrumb-item.cjs"),i=require("../../common/utils/index.cjs"),s=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),c=require("../../common/mixins/localization.cjs"),_={name:"DtBreadcrumbs",components:{DtBreadcrumbItem:d.default},mixins:[c.default],props:{breadcrumbs:{type:Array,default:()=>[],validate(t){return t.every(({href:e,label:r})=>e!==void 0&&r!==void 0)}},inverted:{type:Boolean,default:!1},ariaLabel:{type:String,default:""}},data(){return{BREADCRUMBS_INVERTED_MODIFIER:u.BREADCRUMBS_INVERTED_MODIFIER}},methods:{getBreadcrumbItemKey(t){return`breadcrumbs-item-${t}-${i.default.getUniqueString()}`}}};var m=function(){var e=this,r=e._self._c;return r("nav",{class:["d-breadcrumbs",{[e.BREADCRUMBS_INVERTED_MODIFIER]:e.inverted}],attrs:{"aria-label":e.ariaLabel||e.i18n.$t("DIALTONE_BREADCRUMBS_ARIA_LABEL"),"data-qa":"dt-breadcrumbs"}},[r("ol",[e._t("default",function(){return e._l(e.breadcrumbs,function(a,n){return r("dt-breadcrumb-item",e._g(e._b({key:e.getBreadcrumbItemKey(n),attrs:{inverted:e.inverted}},"dt-breadcrumb-item",a,!1),e.$listeners))})})],2)])},b=[],l=s.n(_,m,b);const o=l.exports;exports.default=o;
|
|
2
2
|
//# sourceMappingURL=breadcrumbs.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumbs.cjs","sources":["../../../components/breadcrumbs/breadcrumbs.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel\"\n data-qa=\"dt-breadcrumbs\"\n :class=\"[\n 'd-breadcrumbs',\n { [BREADCRUMBS_INVERTED_MODIFIER]: inverted },\n ]\"\n >\n <ol>\n <!-- @slot default slot for breadcrumbs content -->\n <slot>\n <dt-breadcrumb-item\n v-for=\"(item, index) in breadcrumbs\"\n :key=\"getBreadcrumbItemKey(index)\"\n :inverted=\"inverted\"\n v-bind=\"item\"\n v-on=\"$listeners\"\n />\n </slot>\n </ol>\n </nav>\n</template>\n\n<script>\nimport { BREADCRUMBS_INVERTED_MODIFIER } from './breadcrumbs_constants';\nimport DtBreadcrumbItem from './breadcrumb_item.vue';\nimport utils from '@/common/utils';\n\n/**\n * Breadcrumbs are links used to provide context for the currently-viewed page\n * and where it is located within the overall site structure.\n * @see https://dialtone.dialpad.com/components/breadcrumbs.html\n */\nexport default {\n name: 'DtBreadcrumbs',\n\n components: {\n DtBreadcrumbItem,\n },\n\n props: {\n /**\n * A provided list of breadcrumbs. Overridden by default slot\n */\n breadcrumbs: {\n type: Array,\n default: () => [],\n validate (breadcrumbs) {\n return breadcrumbs.every(({ href, label }) => {\n return href !== undefined && label !== undefined;\n });\n },\n },\n\n /**\n * Passed through to link. If true, applies inverted styles to the link.\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the navigation content.\n */\n ariaLabel: {\n type: String,\n default: '
|
|
1
|
+
{"version":3,"file":"breadcrumbs.cjs","sources":["../../../components/breadcrumbs/breadcrumbs.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel || i18n.$t('DIALTONE_BREADCRUMBS_ARIA_LABEL')\"\n data-qa=\"dt-breadcrumbs\"\n :class=\"[\n 'd-breadcrumbs',\n { [BREADCRUMBS_INVERTED_MODIFIER]: inverted },\n ]\"\n >\n <ol>\n <!-- @slot default slot for breadcrumbs content -->\n <slot>\n <dt-breadcrumb-item\n v-for=\"(item, index) in breadcrumbs\"\n :key=\"getBreadcrumbItemKey(index)\"\n :inverted=\"inverted\"\n v-bind=\"item\"\n v-on=\"$listeners\"\n />\n </slot>\n </ol>\n </nav>\n</template>\n\n<script>\nimport { BREADCRUMBS_INVERTED_MODIFIER } from './breadcrumbs_constants';\nimport DtBreadcrumbItem from './breadcrumb_item.vue';\nimport utils from '@/common/utils';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\n/**\n * Breadcrumbs are links used to provide context for the currently-viewed page\n * and where it is located within the overall site structure.\n * @see https://dialtone.dialpad.com/components/breadcrumbs.html\n */\nexport default {\n name: 'DtBreadcrumbs',\n\n components: {\n DtBreadcrumbItem,\n },\n\n mixins: [DtLocalizationMixin],\n\n props: {\n /**\n * A provided list of breadcrumbs. Overridden by default slot\n */\n breadcrumbs: {\n type: Array,\n default: () => [],\n validate (breadcrumbs) {\n return breadcrumbs.every(({ href, label }) => {\n return href !== undefined && label !== undefined;\n });\n },\n },\n\n /**\n * Passed through to link. If true, applies inverted styles to the link.\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the navigation content.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n },\n\n data () {\n return {\n BREADCRUMBS_INVERTED_MODIFIER,\n };\n },\n\n methods: {\n getBreadcrumbItemKey (index) {\n return `breadcrumbs-item-${index}-${utils.getUniqueString()}`;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtBreadcrumbItem","DtLocalizationMixin","breadcrumbs","href","label","BREADCRUMBS_INVERTED_MODIFIER","index","utils"],"mappings":"kVAmCAA,EAAA,CACA,KAAA,gBAEA,WAAA,CACA,iBAAAC,EAAA,OACA,EAEA,OAAA,CAAAC,EAAAA,OAAA,EAEA,MAAA,CAIA,YAAA,CACA,KAAA,MACA,QAAA,IAAA,CAAA,EACA,SAAAC,EAAA,CACA,OAAAA,EAAA,MAAA,CAAA,CAAA,KAAAC,EAAA,MAAAC,CAAA,IACAD,IAAA,QAAAC,IAAA,MACA,CACA,CACA,EAMA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,UAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,8BAAAC,EAAA,6BACA,CACA,EAEA,QAAA,CACA,qBAAAC,EAAA,CACA,MAAA,oBAAAA,CAAA,IAAAC,EAAAA,QAAA,gBAAA,CAAA,EACA,CACA,CACA"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { BREADCRUMBS_INVERTED_MODIFIER as
|
|
1
|
+
import { BREADCRUMBS_INVERTED_MODIFIER as i } from "./breadcrumbs-constants.js";
|
|
2
2
|
import m from "./breadcrumb-item.js";
|
|
3
|
-
import
|
|
3
|
+
import d from "../../common/utils/index.js";
|
|
4
4
|
import { n as s } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
5
|
-
|
|
5
|
+
import o from "../../common/mixins/localization.js";
|
|
6
|
+
const u = {
|
|
6
7
|
name: "DtBreadcrumbs",
|
|
7
8
|
components: {
|
|
8
9
|
DtBreadcrumbItem: m
|
|
9
10
|
},
|
|
11
|
+
mixins: [o],
|
|
10
12
|
props: {
|
|
11
13
|
/**
|
|
12
14
|
* A provided list of breadcrumbs. Overridden by default slot
|
|
@@ -31,17 +33,17 @@ const i = {
|
|
|
31
33
|
*/
|
|
32
34
|
ariaLabel: {
|
|
33
35
|
type: String,
|
|
34
|
-
default: "
|
|
36
|
+
default: ""
|
|
35
37
|
}
|
|
36
38
|
},
|
|
37
39
|
data() {
|
|
38
40
|
return {
|
|
39
|
-
BREADCRUMBS_INVERTED_MODIFIER:
|
|
41
|
+
BREADCRUMBS_INVERTED_MODIFIER: i
|
|
40
42
|
};
|
|
41
43
|
},
|
|
42
44
|
methods: {
|
|
43
45
|
getBreadcrumbItemKey(t) {
|
|
44
|
-
return `breadcrumbs-item-${t}-${
|
|
46
|
+
return `breadcrumbs-item-${t}-${d.getUniqueString()}`;
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
};
|
|
@@ -50,18 +52,18 @@ var c = function() {
|
|
|
50
52
|
return r("nav", { class: [
|
|
51
53
|
"d-breadcrumbs",
|
|
52
54
|
{ [e.BREADCRUMBS_INVERTED_MODIFIER]: e.inverted }
|
|
53
|
-
], attrs: { "aria-label": e.ariaLabel, "data-qa": "dt-breadcrumbs" } }, [r("ol", [e._t("default", function() {
|
|
55
|
+
], attrs: { "aria-label": e.ariaLabel || e.i18n.$t("DIALTONE_BREADCRUMBS_ARIA_LABEL"), "data-qa": "dt-breadcrumbs" } }, [r("ol", [e._t("default", function() {
|
|
54
56
|
return e._l(e.breadcrumbs, function(a, n) {
|
|
55
57
|
return r("dt-breadcrumb-item", e._g(e._b({ key: e.getBreadcrumbItemKey(n), attrs: { inverted: e.inverted } }, "dt-breadcrumb-item", a, !1), e.$listeners));
|
|
56
58
|
});
|
|
57
59
|
})], 2)]);
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
+
}, _ = [], b = /* @__PURE__ */ s(
|
|
61
|
+
u,
|
|
60
62
|
c,
|
|
61
|
-
|
|
63
|
+
_
|
|
62
64
|
);
|
|
63
|
-
const
|
|
65
|
+
const R = b.exports;
|
|
64
66
|
export {
|
|
65
|
-
|
|
67
|
+
R as default
|
|
66
68
|
};
|
|
67
69
|
//# sourceMappingURL=breadcrumbs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumbs.js","sources":["../../../components/breadcrumbs/breadcrumbs.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel\"\n data-qa=\"dt-breadcrumbs\"\n :class=\"[\n 'd-breadcrumbs',\n { [BREADCRUMBS_INVERTED_MODIFIER]: inverted },\n ]\"\n >\n <ol>\n <!-- @slot default slot for breadcrumbs content -->\n <slot>\n <dt-breadcrumb-item\n v-for=\"(item, index) in breadcrumbs\"\n :key=\"getBreadcrumbItemKey(index)\"\n :inverted=\"inverted\"\n v-bind=\"item\"\n v-on=\"$listeners\"\n />\n </slot>\n </ol>\n </nav>\n</template>\n\n<script>\nimport { BREADCRUMBS_INVERTED_MODIFIER } from './breadcrumbs_constants';\nimport DtBreadcrumbItem from './breadcrumb_item.vue';\nimport utils from '@/common/utils';\n\n/**\n * Breadcrumbs are links used to provide context for the currently-viewed page\n * and where it is located within the overall site structure.\n * @see https://dialtone.dialpad.com/components/breadcrumbs.html\n */\nexport default {\n name: 'DtBreadcrumbs',\n\n components: {\n DtBreadcrumbItem,\n },\n\n props: {\n /**\n * A provided list of breadcrumbs. Overridden by default slot\n */\n breadcrumbs: {\n type: Array,\n default: () => [],\n validate (breadcrumbs) {\n return breadcrumbs.every(({ href, label }) => {\n return href !== undefined && label !== undefined;\n });\n },\n },\n\n /**\n * Passed through to link. If true, applies inverted styles to the link.\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the navigation content.\n */\n ariaLabel: {\n type: String,\n default: '
|
|
1
|
+
{"version":3,"file":"breadcrumbs.js","sources":["../../../components/breadcrumbs/breadcrumbs.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel || i18n.$t('DIALTONE_BREADCRUMBS_ARIA_LABEL')\"\n data-qa=\"dt-breadcrumbs\"\n :class=\"[\n 'd-breadcrumbs',\n { [BREADCRUMBS_INVERTED_MODIFIER]: inverted },\n ]\"\n >\n <ol>\n <!-- @slot default slot for breadcrumbs content -->\n <slot>\n <dt-breadcrumb-item\n v-for=\"(item, index) in breadcrumbs\"\n :key=\"getBreadcrumbItemKey(index)\"\n :inverted=\"inverted\"\n v-bind=\"item\"\n v-on=\"$listeners\"\n />\n </slot>\n </ol>\n </nav>\n</template>\n\n<script>\nimport { BREADCRUMBS_INVERTED_MODIFIER } from './breadcrumbs_constants';\nimport DtBreadcrumbItem from './breadcrumb_item.vue';\nimport utils from '@/common/utils';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\n/**\n * Breadcrumbs are links used to provide context for the currently-viewed page\n * and where it is located within the overall site structure.\n * @see https://dialtone.dialpad.com/components/breadcrumbs.html\n */\nexport default {\n name: 'DtBreadcrumbs',\n\n components: {\n DtBreadcrumbItem,\n },\n\n mixins: [DtLocalizationMixin],\n\n props: {\n /**\n * A provided list of breadcrumbs. Overridden by default slot\n */\n breadcrumbs: {\n type: Array,\n default: () => [],\n validate (breadcrumbs) {\n return breadcrumbs.every(({ href, label }) => {\n return href !== undefined && label !== undefined;\n });\n },\n },\n\n /**\n * Passed through to link. If true, applies inverted styles to the link.\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the navigation content.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n },\n\n data () {\n return {\n BREADCRUMBS_INVERTED_MODIFIER,\n };\n },\n\n methods: {\n getBreadcrumbItemKey (index) {\n return `breadcrumbs-item-${index}-${utils.getUniqueString()}`;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtBreadcrumbItem","DtLocalizationMixin","breadcrumbs","href","label","BREADCRUMBS_INVERTED_MODIFIER","index","utils"],"mappings":";;;;;AAmCA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,kBAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,CAAA;AAAA,MACA,SAAAC,GAAA;AACA,eAAAA,EAAA,MAAA,CAAA,EAAA,MAAAC,GAAA,OAAAC,EAAA,MACAD,MAAA,UAAAC,MAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,+BAAAC;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,qBAAAC,GAAA;AACA,aAAA,oBAAAA,CAAA,IAAAC,EAAA,gBAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),i=require("./button-constants.cjs"),o=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),a=require("../link/link-constants.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),i=require("./button-constants.cjs"),o=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),r=require("../../common/mixins/localization.cjs"),a=require("../link/link-constants.cjs"),u={name:"DtButton",mixins:[r.default],props:{circle:{type:Boolean,default:!1},iconPosition:{type:String,default:"left",validator:e=>Object.keys(i.ICON_POSITION_MODIFIERS).includes(e)},importance:{type:String,default:"primary",validator:e=>Object.keys(i.BUTTON_IMPORTANCE_MODIFIERS).includes(e)},link:{type:Boolean,default:!1},linkKind:{type:String,default:"default",validator:e=>Object.keys(a.LINK_KIND_MODIFIERS).includes(e)},linkInverted:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},type:{type:String,default:"button",validator:e=>i.BUTTON_TYPES.includes(e)},width:{type:String,default:null},size:{type:String,default:"md",validator:e=>Object.keys(i.BUTTON_SIZE_MODIFIERS).includes(e)},labelClass:{type:[String,Array,Object],default:""},loading:{type:Boolean,default:!1},kind:{type:String,default:"default",validator:e=>Object.keys(i.BUTTON_KIND_MODIFIERS).includes(e)},assertiveOnFocus:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},emits:["click","focusin","focusout"],data(){return{ICON_POSITION_MODIFIERS:i.ICON_POSITION_MODIFIERS,isInFocus:!1}},computed:{buttonListeners(){return this.assertiveOnFocus?{...this.$listeners,focusin:e=>{this.isInFocus=!0},focusout:e=>{this.isInFocus=!1}}:this.$listeners},computedAriaLive(){return this.assertiveOnFocus&&this.isInFocus?"assertive":this.$attrs.ariaLive},iconSize(){return i.BUTTON_ICON_SIZES[this.size]}},watch:{$props:{deep:!0,immediate:!0,handler(){process.env.NODE_ENV!=="production"&&(this.circle&&this.link&&l.util.warn("You cannot enable circle and link at the same time",this),this.isInvalidPropCombination(this.circle,this.kind,this.importance))}}},methods:{buttonClasses(){return this.link?["d-link",a.getLinkKindModifier(this.linkKind,this.linkInverted),i.BUTTON_SIZE_MODIFIERS[this.size]]:this.kind==="unstyled"?["d-btn--unstyled"]:["d-btn",i.BUTTON_IMPORTANCE_MODIFIERS[this.importance],i.BUTTON_KIND_MODIFIERS[this.kind],i.BUTTON_SIZE_MODIFIERS[this.size],{"d-btn--circle":this.circle,"d-btn--loading":this.loading,"d-btn--icon-only":this.isIconOnly(),"d-btn--vertical":this.isVerticalIconLayout(),"d-btn--active":this.active}]},isInvalidPropCombination(e,t,n){if(this.kind==="unstyled")return!0;for(const s of i.INVALID_COMBINATION)if(e===s.circle&&t===s.kind&&n===s.importance)return console.warn(s.message),!1;return!0},shouldRenderIcon(){return this.$scopedSlots.icon&&this.$scopedSlots.icon()&&!this.link},isIconOnly(){return this.shouldRenderIcon()&&!this.$slots.default},isVerticalIconLayout(){return!this.isIconOnly()&&["top","bottom"].includes(this.iconPosition)}}};var d=function(){var t=this,n=t._self._c;return n("button",t._g({class:["base-button__button",t.buttonClasses()],style:{width:t.width},attrs:{"data-qa":"dt-button",type:t.type,disabled:t.disabled,"aria-live":t.computedAriaLive,"aria-label":t.loading?t.i18n.$t("DIALTONE_BUTTON_LOADING"):t.$attrs["aria-label"]}},t.buttonListeners),[t.shouldRenderIcon()?n("span",{class:["base-button__icon",{"d-btn__icon":t.kind!=="unstyled",[t.ICON_POSITION_MODIFIERS[t.iconPosition]]:t.kind!=="unstyled"}],attrs:{"data-qa":"dt-button-icon"}},[t._t("icon",null,{iconSize:t.iconSize})],2):t._e(),t.$slots.default?n("span",{class:["base-button__label",{"d-btn__label":t.kind!=="unstyled"},t.labelClass],attrs:{"data-qa":"dt-button-label"}},[t._t("default")],2):t._e()])},c=[],_=o.n(u,d,c);const I=_.exports;exports.default=I;
|
|
2
2
|
//# sourceMappingURL=button.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.cjs","sources":["../../../components/button/button.vue"],"sourcesContent":["<template>\n <button\n :class=\"[\n 'base-button__button',\n buttonClasses(),\n ]\"\n data-qa=\"dt-button\"\n :type=\"type\"\n :disabled=\"disabled\"\n :style=\"{ width: width }\"\n :aria-live=\"computedAriaLive\"\n :aria-label=\"loading ? 'loading' : $attrs['aria-label']\"\n v-on=\"buttonListeners\"\n >\n <!-- NOTE(cormac): This span is needed since we can't apply styles to slots. -->\n <span\n v-if=\"shouldRenderIcon()\"\n data-qa=\"dt-button-icon\"\n :class=\"[\n 'base-button__icon',\n {\n 'd-btn__icon': kind !== 'unstyled',\n [ICON_POSITION_MODIFIERS[iconPosition]]: kind !== 'unstyled',\n },\n ]\"\n >\n <!-- @slot Button icon -->\n <slot\n name=\"icon\"\n :icon-size=\"iconSize\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n data-qa=\"dt-button-label\"\n :class=\"[\n 'base-button__label',\n { 'd-btn__label': kind !== 'unstyled' },\n labelClass,\n ]\"\n >\n <!-- @slot Content within button -->\n <slot />\n </span>\n </button>\n</template>\n\n<script>\nimport Vue from 'vue';\n\nimport {\n BUTTON_SIZE_MODIFIERS,\n BUTTON_KIND_MODIFIERS,\n BUTTON_IMPORTANCE_MODIFIERS,\n BUTTON_ICON_SIZES,\n BUTTON_TYPES,\n ICON_POSITION_MODIFIERS,\n INVALID_COMBINATION,\n} from './button_constants';\n\nimport { LINK_KIND_MODIFIERS, getLinkKindModifier } from '@/components/link';\n\n/**\n * A button is a UI element which allows users to take an action throughout the app.\n * It is important a button is identifiable, consistent, and communicates its actions clearly,\n * and is appropriately sized to its action.\n * @see https://dialtone.dialpad.com/components/button.html\n */\nexport default {\n name: 'DtButton',\n\n props: {\n /**\n * Whether the button is a circle or not.\n * @values true, false\n */\n circle: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of the icon slot within the button.\n * @values left, right, top, bottom\n */\n iconPosition: {\n type: String,\n default: 'left',\n validator: (position) => Object.keys(ICON_POSITION_MODIFIERS).includes(position),\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: 'primary',\n validator: (i) => Object.keys(BUTTON_IMPORTANCE_MODIFIERS).includes(i),\n },\n\n /**\n * Whether the button should be styled as a link or not.\n * @values true, false\n * @see DtLink\n */\n link: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The color of the link and button if the button is styled as a link.\n * @values default, warning, danger, success, muted\n * @see DtLink\n */\n linkKind: {\n type: String,\n default: 'default',\n validator: (lk) => Object.keys(LINK_KIND_MODIFIERS).includes(lk),\n },\n\n /**\n * Determines whether the link should have inverted styling if the button is styled as a link.\n * @values true, false\n * @see DtLink\n */\n linkInverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled\" target=\"_blank\"> (Reference) </a>\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button type attribute\n * <a\n * class=\"d-link\"\n * href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\"\n * target=\"_blank\"\n * >\n * (Reference)\n * </a>\n * @values button, submit, reset\n */\n type: {\n type: String,\n default: 'button',\n validator: (t) => BUTTON_TYPES.includes(t),\n },\n\n /**\n * Button width, accepts\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/width\" target=\"_blank\">\n * CSS width attribute\n * </a>\n * values\n */\n width: {\n type: String,\n default: null,\n },\n\n /**\n * The size of the button.\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(BUTTON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n * @values true, false\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The color of the button.\n * @values default, unstyled, muted, danger, positive, inverted\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(BUTTON_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button\n * is in focus. default is to not.\n * @values true, false\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n */\n active: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native button focus in event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native button focus out event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n ],\n\n data () {\n return {\n ICON_POSITION_MODIFIERS,\n // whether the button is currently in focus\n isInFocus: false,\n };\n },\n\n computed: {\n\n buttonListeners () {\n if (!this.assertiveOnFocus) {\n return this.$listeners;\n }\n return {\n ...this.$listeners,\n focusin: (e) => {\n this.isInFocus = true;\n },\n\n focusout: (e) => {\n this.isInFocus = false;\n },\n };\n },\n\n computedAriaLive () {\n return this.assertiveOnFocus && this.isInFocus ? 'assertive' : this.$attrs.ariaLive;\n },\n\n iconSize () {\n return BUTTON_ICON_SIZES[this.size];\n },\n },\n\n watch: {\n $props: {\n deep: true,\n immediate: true,\n handler () {\n if (process.env.NODE_ENV === 'production') return;\n\n if (this.circle && this.link) {\n Vue.util.warn('You cannot enable circle and link at the same time', this);\n }\n\n this.isInvalidPropCombination(this.circle, this.kind, this.importance);\n },\n },\n },\n\n methods: {\n buttonClasses () {\n if (this.link) {\n return [\n 'd-link',\n getLinkKindModifier(this.linkKind, this.linkInverted),\n BUTTON_SIZE_MODIFIERS[this.size],\n ];\n }\n if (this.kind === 'unstyled') {\n return ['d-btn--unstyled'];\n }\n return [\n 'd-btn',\n BUTTON_IMPORTANCE_MODIFIERS[this.importance],\n BUTTON_KIND_MODIFIERS[this.kind],\n BUTTON_SIZE_MODIFIERS[this.size],\n {\n 'd-btn--circle': this.circle,\n 'd-btn--loading': this.loading,\n 'd-btn--icon-only': this.isIconOnly(),\n 'd-btn--vertical': this.isVerticalIconLayout(),\n 'd-btn--active': this.active,\n },\n ];\n },\n\n isInvalidPropCombination (circle, kind, importance) {\n // Skip validation if unstyled is true\n if (this.kind === 'unstyled') {\n return true;\n }\n\n for (const row of INVALID_COMBINATION) {\n if (circle === row.circle && kind === row.kind && importance === row.importance) {\n console.warn(row.message);\n return false;\n }\n }\n return true;\n },\n\n shouldRenderIcon () {\n return this.$scopedSlots.icon && this.$scopedSlots.icon() && !this.link;\n },\n\n isIconOnly () {\n return this.shouldRenderIcon() && !this.$slots.default;\n },\n\n isVerticalIconLayout () {\n return !this.isIconOnly() && ['top', 'bottom'].includes(this.iconPosition);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","position","ICON_POSITION_MODIFIERS","i","BUTTON_IMPORTANCE_MODIFIERS","lk","LINK_KIND_MODIFIERS","t","BUTTON_TYPES","s","BUTTON_SIZE_MODIFIERS","k","BUTTON_KIND_MODIFIERS","BUTTON_ICON_SIZES","Vue","getLinkKindModifier","circle","kind","importance","row","INVALID_COMBINATION"],"mappings":"uQAoEAA,EAAA,CACA,KAAA,WAEA,MAAA,CAKA,OAAA,CACA,KAAA,QACA,QAAA,EACA,EAMA,aAAA,CACA,KAAA,OACA,QAAA,OACA,UAAAC,GAAA,OAAA,KAAAC,yBAAA,EAAA,SAAAD,CAAA,CACA,EAMA,WAAA,CACA,KAAA,OACA,QAAA,UACA,UAAAE,GAAA,OAAA,KAAAC,6BAAA,EAAA,SAAAD,CAAA,CACA,EAOA,KAAA,CACA,KAAA,QACA,QAAA,EACA,EAOA,SAAA,CACA,KAAA,OACA,QAAA,UACA,UAAAE,GAAA,OAAA,KAAAC,qBAAA,EAAA,SAAAD,CAAA,CACA,EAOA,aAAA,CACA,KAAA,QACA,QAAA,EACA,EAOA,SAAA,CACA,KAAA,QACA,QA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CACA,EAEA,KAAA,OAAA,WACA,CAAA,iBAAA,EAEA,CACA,QACAN,EAAA,4BAAA,KAAA,UAAA,EACAQ,EAAA,sBAAA,KAAA,IAAA,EACAF,EAAA,sBAAA,KAAA,IAAA,EACA,CACA,gBAAA,KAAA,OACA,iBAAA,KAAA,QACA,mBAAA,KAAA,WAAA,EACA,kBAAA,KAAA,qBAAA,EACA,gBAAA,KAAA,MACA,CACA,CACA,EAEA,yBAAAM,EAAAC,EAAAC,EAAA,CAEA,GAAA,KAAA,OAAA,WACA,MAAA,GAGA,UAAAC,KAAAC,sBACA,GAAAJ,IAAAG,EAAA,QAAAF,IAAAE,EAAA,MAAAD,IAAAC,EAAA,WACA,eAAA,KAAAA,EAAA,OAAA,EACA,GAGA,MAAA,EACA,EAEA,kBAAA,CACA,OAAA,KAAA,aAAA,MAAA,KAAA,aAAA,KAAA,GAAA,CAAA,KAAA,IACA,EAEA,YAAA,CACA,OAAA,KAAA,iBAAA,GAAA,CAAA,KAAA,OAAA,OACA,EAEA,sBAAA,CACA,MAAA,CAAA,KAAA,WAAA,GAAA,CAAA,MAAA,QAAA,EAAA,SAAA,KAAA,YAAA,CACA,CACA,CACA"}
|
|
1
|
+
{"version":3,"file":"button.cjs","sources":["../../../components/button/button.vue"],"sourcesContent":["<template>\n <button\n :class=\"[\n 'base-button__button',\n buttonClasses(),\n ]\"\n data-qa=\"dt-button\"\n :type=\"type\"\n :disabled=\"disabled\"\n :style=\"{ width: width }\"\n :aria-live=\"computedAriaLive\"\n :aria-label=\"loading ? i18n.$t('DIALTONE_BUTTON_LOADING') : $attrs['aria-label']\"\n v-on=\"buttonListeners\"\n >\n <!-- NOTE(cormac): This span is needed since we can't apply styles to slots. -->\n <span\n v-if=\"shouldRenderIcon()\"\n data-qa=\"dt-button-icon\"\n :class=\"[\n 'base-button__icon',\n {\n 'd-btn__icon': kind !== 'unstyled',\n [ICON_POSITION_MODIFIERS[iconPosition]]: kind !== 'unstyled',\n },\n ]\"\n >\n <!-- @slot Button icon -->\n <slot\n name=\"icon\"\n :icon-size=\"iconSize\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n data-qa=\"dt-button-label\"\n :class=\"[\n 'base-button__label',\n { 'd-btn__label': kind !== 'unstyled' },\n labelClass,\n ]\"\n >\n <!-- @slot Content within button -->\n <slot />\n </span>\n </button>\n</template>\n\n<script>\nimport Vue from 'vue';\n\nimport {\n BUTTON_SIZE_MODIFIERS,\n BUTTON_KIND_MODIFIERS,\n BUTTON_IMPORTANCE_MODIFIERS,\n BUTTON_ICON_SIZES,\n BUTTON_TYPES,\n ICON_POSITION_MODIFIERS,\n INVALID_COMBINATION,\n} from './button_constants';\n\nimport { LINK_KIND_MODIFIERS, getLinkKindModifier } from '@/components/link';\n\nimport { DtLocalizationMixin } from '@/common/mixins';\n\n/**\n * A button is a UI element which allows users to take an action throughout the app.\n * It is important a button is identifiable, consistent, and communicates its actions clearly,\n * and is appropriately sized to its action.\n * @see https://dialtone.dialpad.com/components/button.html\n */\nexport default {\n name: 'DtButton',\n\n mixins: [DtLocalizationMixin],\n\n props: {\n /**\n * Whether the button is a circle or not.\n * @values true, false\n */\n circle: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of the icon slot within the button.\n * @values left, right, top, bottom\n */\n iconPosition: {\n type: String,\n default: 'left',\n validator: (position) => Object.keys(ICON_POSITION_MODIFIERS).includes(position),\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: 'primary',\n validator: (i) => Object.keys(BUTTON_IMPORTANCE_MODIFIERS).includes(i),\n },\n\n /**\n * Whether the button should be styled as a link or not.\n * @values true, false\n * @see DtLink\n */\n link: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The color of the link and button if the button is styled as a link.\n * @values default, warning, danger, success, muted\n * @see DtLink\n */\n linkKind: {\n type: String,\n default: 'default',\n validator: (lk) => Object.keys(LINK_KIND_MODIFIERS).includes(lk),\n },\n\n /**\n * Determines whether the link should have inverted styling if the button is styled as a link.\n * @values true, false\n * @see DtLink\n */\n linkInverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled\" target=\"_blank\"> (Reference) </a>\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button type attribute\n * <a\n * class=\"d-link\"\n * href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\"\n * target=\"_blank\"\n * >\n * (Reference)\n * </a>\n * @values button, submit, reset\n */\n type: {\n type: String,\n default: 'button',\n validator: (t) => BUTTON_TYPES.includes(t),\n },\n\n /**\n * Button width, accepts\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/width\" target=\"_blank\">\n * CSS width attribute\n * </a>\n * values\n */\n width: {\n type: String,\n default: null,\n },\n\n /**\n * The size of the button.\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(BUTTON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n * @values true, false\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The color of the button.\n * @values default, unstyled, muted, danger, positive, inverted\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(BUTTON_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button\n * is in focus. default is to not.\n * @values true, false\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n */\n active: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native button focus in event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native button focus out event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n ],\n\n data () {\n return {\n ICON_POSITION_MODIFIERS,\n // whether the button is currently in focus\n isInFocus: false,\n };\n },\n\n computed: {\n\n buttonListeners () {\n if (!this.assertiveOnFocus) {\n return this.$listeners;\n }\n return {\n ...this.$listeners,\n focusin: (e) => {\n this.isInFocus = true;\n },\n\n focusout: (e) => {\n this.isInFocus = false;\n },\n };\n },\n\n computedAriaLive () {\n return this.assertiveOnFocus && this.isInFocus ? 'assertive' : this.$attrs.ariaLive;\n },\n\n iconSize () {\n return BUTTON_ICON_SIZES[this.size];\n },\n },\n\n watch: {\n $props: {\n deep: true,\n immediate: true,\n handler () {\n if (process.env.NODE_ENV === 'production') return;\n\n if (this.circle && this.link) {\n Vue.util.warn('You cannot enable circle and link at the same time', this);\n }\n\n this.isInvalidPropCombination(this.circle, this.kind, this.importance);\n },\n },\n },\n\n methods: {\n buttonClasses () {\n if (this.link) {\n return [\n 'd-link',\n getLinkKindModifier(this.linkKind, this.linkInverted),\n BUTTON_SIZE_MODIFIERS[this.size],\n ];\n }\n if (this.kind === 'unstyled') {\n return ['d-btn--unstyled'];\n }\n return [\n 'd-btn',\n BUTTON_IMPORTANCE_MODIFIERS[this.importance],\n BUTTON_KIND_MODIFIERS[this.kind],\n BUTTON_SIZE_MODIFIERS[this.size],\n {\n 'd-btn--circle': this.circle,\n 'd-btn--loading': this.loading,\n 'd-btn--icon-only': this.isIconOnly(),\n 'd-btn--vertical': this.isVerticalIconLayout(),\n 'd-btn--active': this.active,\n },\n ];\n },\n\n isInvalidPropCombination (circle, kind, importance) {\n // Skip validation if unstyled is true\n if (this.kind === 'unstyled') {\n return true;\n }\n\n for (const row of INVALID_COMBINATION) {\n if (circle === row.circle && kind === row.kind && importance === row.importance) {\n console.warn(row.message);\n return false;\n }\n }\n return true;\n },\n\n shouldRenderIcon () {\n return this.$scopedSlots.icon && this.$scopedSlots.icon() && !this.link;\n },\n\n isIconOnly () {\n return this.shouldRenderIcon() && !this.$slots.default;\n },\n\n isVerticalIconLayout () {\n return !this.isIconOnly() && ['top', 'bottom'].includes(this.iconPosition);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtLocalizationMixin","position","ICON_POSITION_MODIFIERS","i","BUTTON_IMPORTANCE_MODIFIERS","lk","LINK_KIND_MODIFIERS","t","BUTTON_TYPES","s","BUTTON_SIZE_MODIFIERS","k","BUTTON_KIND_MODIFIERS","BUTTON_ICON_SIZES","Vue","getLinkKindModifier","circle","kind","importance","row","INVALID_COMBINATION"],"mappings":"yTAsEAA,EAAA,CACA,KAAA,WAEA,OAAA,CAAAC,EAAAA,OAAA,EAEA,MAAA,CAKA,OAAA,CACA,KAAA,QACA,QAAA,EACA,EAMA,aAAA,CACA,KAAA,OACA,QAAA,OACA,UAAAC,GAAA,OAAA,KAAAC,yBAAA,EAAA,SAAAD,CAAA,CACA,EAMA,WAAA,CACA,KAAA,OACA,QAAA,UACA,UAAAE,GAAA,OAAA,KAAAC,6BAAA,EAAA,SAAAD,CAAA,CACA,EAOA,KAAA,CACA,KAAA,QACA,QAAA,EACA,EAOA,SAAA,CACA,KAAA,OACA,QAAA,UACA,UAAAE,GAAA,OAAA,KAAAC,qBAAA,EAAA,SAAAD,CAAA,CACA,EAOA,aAAA,CACA,KAAA,QACA,QAAA,EACA,EAOA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAaA,KAAA,CACA,KAAA,OACA,QAAA,SACA,UAAAE,GAAAC,eAAA,SAAAD,CAAA,CACA,EASA,MAAA,CACA,KAAA,OACA,QAAA,IACA,EAMA,KAAA,CACA,KAAA,OACA,QAAA,KACA,UAAAE,GAAA,OAAA,KAAAC,uBAAA,EAAA,SAAAD,CAAA,CACA,EAKA,WAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,EAMA,QAAA,CACA,KAAA,QACA,QAAA,EACA,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A,OAAA,WACA,MAAA,GAGA,UAAAC,KAAAC,sBACA,GAAAJ,IAAAG,EAAA,QAAAF,IAAAE,EAAA,MAAAD,IAAAC,EAAA,WACA,eAAA,KAAAA,EAAA,OAAA,EACA,GAGA,MAAA,EACA,EAEA,kBAAA,CACA,OAAA,KAAA,aAAA,MAAA,KAAA,aAAA,KAAA,GAAA,CAAA,KAAA,IACA,EAEA,YAAA,CACA,OAAA,KAAA,iBAAA,GAAA,CAAA,KAAA,OAAA,OACA,EAEA,sBAAA,CACA,MAAA,CAAA,KAAA,WAAA,GAAA,CAAA,MAAA,QAAA,EAAA,SAAA,KAAA,YAAA,CACA,CACA,CACA"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import r from "vue";
|
|
2
2
|
import { ICON_POSITION_MODIFIERS as a, BUTTON_IMPORTANCE_MODIFIERS as o, BUTTON_TYPES as d, BUTTON_SIZE_MODIFIERS as s, BUTTON_KIND_MODIFIERS as l, BUTTON_ICON_SIZES as u, INVALID_COMBINATION as c } from "./button-constants.js";
|
|
3
3
|
import { n as f } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
4
|
-
import
|
|
5
|
-
|
|
4
|
+
import p from "../../common/mixins/localization.js";
|
|
5
|
+
import { LINK_KIND_MODIFIERS as h, getLinkKindModifier as _ } from "../link/link-constants.js";
|
|
6
|
+
const I = {
|
|
6
7
|
name: "DtButton",
|
|
8
|
+
mixins: [p],
|
|
7
9
|
props: {
|
|
8
10
|
/**
|
|
9
11
|
* Whether the button is a circle or not.
|
|
@@ -210,7 +212,7 @@ const _ = {
|
|
|
210
212
|
buttonClasses() {
|
|
211
213
|
return this.link ? [
|
|
212
214
|
"d-link",
|
|
213
|
-
|
|
215
|
+
_(this.linkKind, this.linkInverted),
|
|
214
216
|
s[this.size]
|
|
215
217
|
] : this.kind === "unstyled" ? ["d-btn--unstyled"] : [
|
|
216
218
|
"d-btn",
|
|
@@ -250,7 +252,7 @@ var b = function() {
|
|
|
250
252
|
return i("button", t._g({ class: [
|
|
251
253
|
"base-button__button",
|
|
252
254
|
t.buttonClasses()
|
|
253
|
-
], style: { width: t.width }, attrs: { "data-qa": "dt-button", type: t.type, disabled: t.disabled, "aria-live": t.computedAriaLive, "aria-label": t.loading ? "
|
|
255
|
+
], style: { width: t.width }, attrs: { "data-qa": "dt-button", type: t.type, disabled: t.disabled, "aria-live": t.computedAriaLive, "aria-label": t.loading ? t.i18n.$t("DIALTONE_BUTTON_LOADING") : t.$attrs["aria-label"] } }, t.buttonListeners), [t.shouldRenderIcon() ? i("span", { class: [
|
|
254
256
|
"base-button__icon",
|
|
255
257
|
{
|
|
256
258
|
"d-btn__icon": t.kind !== "unstyled",
|
|
@@ -261,13 +263,13 @@ var b = function() {
|
|
|
261
263
|
{ "d-btn__label": t.kind !== "unstyled" },
|
|
262
264
|
t.labelClass
|
|
263
265
|
], attrs: { "data-qa": "dt-button-label" } }, [t._t("default")], 2) : t._e()]);
|
|
264
|
-
},
|
|
265
|
-
|
|
266
|
+
}, y = [], O = /* @__PURE__ */ f(
|
|
267
|
+
I,
|
|
266
268
|
b,
|
|
267
|
-
|
|
269
|
+
y
|
|
268
270
|
);
|
|
269
|
-
const
|
|
271
|
+
const T = O.exports;
|
|
270
272
|
export {
|
|
271
|
-
|
|
273
|
+
T as default
|
|
272
274
|
};
|
|
273
275
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../components/button/button.vue"],"sourcesContent":["<template>\n <button\n :class=\"[\n 'base-button__button',\n buttonClasses(),\n ]\"\n data-qa=\"dt-button\"\n :type=\"type\"\n :disabled=\"disabled\"\n :style=\"{ width: width }\"\n :aria-live=\"computedAriaLive\"\n :aria-label=\"loading ? 'loading' : $attrs['aria-label']\"\n v-on=\"buttonListeners\"\n >\n <!-- NOTE(cormac): This span is needed since we can't apply styles to slots. -->\n <span\n v-if=\"shouldRenderIcon()\"\n data-qa=\"dt-button-icon\"\n :class=\"[\n 'base-button__icon',\n {\n 'd-btn__icon': kind !== 'unstyled',\n [ICON_POSITION_MODIFIERS[iconPosition]]: kind !== 'unstyled',\n },\n ]\"\n >\n <!-- @slot Button icon -->\n <slot\n name=\"icon\"\n :icon-size=\"iconSize\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n data-qa=\"dt-button-label\"\n :class=\"[\n 'base-button__label',\n { 'd-btn__label': kind !== 'unstyled' },\n labelClass,\n ]\"\n >\n <!-- @slot Content within button -->\n <slot />\n </span>\n </button>\n</template>\n\n<script>\nimport Vue from 'vue';\n\nimport {\n BUTTON_SIZE_MODIFIERS,\n BUTTON_KIND_MODIFIERS,\n BUTTON_IMPORTANCE_MODIFIERS,\n BUTTON_ICON_SIZES,\n BUTTON_TYPES,\n ICON_POSITION_MODIFIERS,\n INVALID_COMBINATION,\n} from './button_constants';\n\nimport { LINK_KIND_MODIFIERS, getLinkKindModifier } from '@/components/link';\n\n/**\n * A button is a UI element which allows users to take an action throughout the app.\n * It is important a button is identifiable, consistent, and communicates its actions clearly,\n * and is appropriately sized to its action.\n * @see https://dialtone.dialpad.com/components/button.html\n */\nexport default {\n name: 'DtButton',\n\n props: {\n /**\n * Whether the button is a circle or not.\n * @values true, false\n */\n circle: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of the icon slot within the button.\n * @values left, right, top, bottom\n */\n iconPosition: {\n type: String,\n default: 'left',\n validator: (position) => Object.keys(ICON_POSITION_MODIFIERS).includes(position),\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: 'primary',\n validator: (i) => Object.keys(BUTTON_IMPORTANCE_MODIFIERS).includes(i),\n },\n\n /**\n * Whether the button should be styled as a link or not.\n * @values true, false\n * @see DtLink\n */\n link: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The color of the link and button if the button is styled as a link.\n * @values default, warning, danger, success, muted\n * @see DtLink\n */\n linkKind: {\n type: String,\n default: 'default',\n validator: (lk) => Object.keys(LINK_KIND_MODIFIERS).includes(lk),\n },\n\n /**\n * Determines whether the link should have inverted styling if the button is styled as a link.\n * @values true, false\n * @see DtLink\n */\n linkInverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled\" target=\"_blank\"> (Reference) </a>\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button type attribute\n * <a\n * class=\"d-link\"\n * href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\"\n * target=\"_blank\"\n * >\n * (Reference)\n * </a>\n * @values button, submit, reset\n */\n type: {\n type: String,\n default: 'button',\n validator: (t) => BUTTON_TYPES.includes(t),\n },\n\n /**\n * Button width, accepts\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/width\" target=\"_blank\">\n * CSS width attribute\n * </a>\n * values\n */\n width: {\n type: String,\n default: null,\n },\n\n /**\n * The size of the button.\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(BUTTON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n * @values true, false\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The color of the button.\n * @values default, unstyled, muted, danger, positive, inverted\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(BUTTON_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button\n * is in focus. default is to not.\n * @values true, false\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n */\n active: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native button focus in event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native button focus out event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n ],\n\n data () {\n return {\n ICON_POSITION_MODIFIERS,\n // whether the button is currently in focus\n isInFocus: false,\n };\n },\n\n computed: {\n\n buttonListeners () {\n if (!this.assertiveOnFocus) {\n return this.$listeners;\n }\n return {\n ...this.$listeners,\n focusin: (e) => {\n this.isInFocus = true;\n },\n\n focusout: (e) => {\n this.isInFocus = false;\n },\n };\n },\n\n computedAriaLive () {\n return this.assertiveOnFocus && this.isInFocus ? 'assertive' : this.$attrs.ariaLive;\n },\n\n iconSize () {\n return BUTTON_ICON_SIZES[this.size];\n },\n },\n\n watch: {\n $props: {\n deep: true,\n immediate: true,\n handler () {\n if (process.env.NODE_ENV === 'production') return;\n\n if (this.circle && this.link) {\n Vue.util.warn('You cannot enable circle and link at the same time', this);\n }\n\n this.isInvalidPropCombination(this.circle, this.kind, this.importance);\n },\n },\n },\n\n methods: {\n buttonClasses () {\n if (this.link) {\n return [\n 'd-link',\n getLinkKindModifier(this.linkKind, this.linkInverted),\n BUTTON_SIZE_MODIFIERS[this.size],\n ];\n }\n if (this.kind === 'unstyled') {\n return ['d-btn--unstyled'];\n }\n return [\n 'd-btn',\n BUTTON_IMPORTANCE_MODIFIERS[this.importance],\n BUTTON_KIND_MODIFIERS[this.kind],\n BUTTON_SIZE_MODIFIERS[this.size],\n {\n 'd-btn--circle': this.circle,\n 'd-btn--loading': this.loading,\n 'd-btn--icon-only': this.isIconOnly(),\n 'd-btn--vertical': this.isVerticalIconLayout(),\n 'd-btn--active': this.active,\n },\n ];\n },\n\n isInvalidPropCombination (circle, kind, importance) {\n // Skip validation if unstyled is true\n if (this.kind === 'unstyled') {\n return true;\n }\n\n for (const row of INVALID_COMBINATION) {\n if (circle === row.circle && kind === row.kind && importance === row.importance) {\n console.warn(row.message);\n return false;\n }\n }\n return true;\n },\n\n shouldRenderIcon () {\n return this.$scopedSlots.icon && this.$scopedSlots.icon() && !this.link;\n },\n\n isIconOnly () {\n return this.shouldRenderIcon() && !this.$slots.default;\n },\n\n isVerticalIconLayout () {\n return !this.isIconOnly() && ['top', 'bottom'].includes(this.iconPosition);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","position","ICON_POSITION_MODIFIERS","i","BUTTON_IMPORTANCE_MODIFIERS","lk","LINK_KIND_MODIFIERS","t","BUTTON_TYPES","s","BUTTON_SIZE_MODIFIERS","k","BUTTON_KIND_MODIFIERS","BUTTON_ICON_SIZES","Vue","getLinkKindModifier","circle","kind","importance","row","INVALID_COMBINATION"],"mappings":";;;;AAoEA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,KAAAC,CAAA,EAAA,SAAAD,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAE,MAAA,OAAA,KAAAC,CAAA,EAAA,SAAAD,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA;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,MAAA,OAAA,KAAAC,CAAA,EAAA,SAAAD,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AAAA,MACA,MAAA;AAAA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AAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,yBAAAM,GAAAC,GAAAC,GAAA;AAEA,UAAA,KAAA,SAAA;AACA,eAAA;AAGA,iBAAAC,KAAAC;AACA,YAAAJ,MAAAG,EAAA,UAAAF,MAAAE,EAAA,QAAAD,MAAAC,EAAA;AACA,yBAAA,KAAAA,EAAA,OAAA,GACA;AAGA,aAAA;AAAA,IACA;AAAA,IAEA,mBAAA;AACA,aAAA,KAAA,aAAA,QAAA,KAAA,aAAA,KAAA,KAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,aAAA;AACA,aAAA,KAAA,iBAAA,KAAA,CAAA,KAAA,OAAA;AAAA,IACA;AAAA,IAEA,uBAAA;AACA,aAAA,CAAA,KAAA,WAAA,KAAA,CAAA,OAAA,QAAA,EAAA,SAAA,KAAA,YAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../components/button/button.vue"],"sourcesContent":["<template>\n <button\n :class=\"[\n 'base-button__button',\n buttonClasses(),\n ]\"\n data-qa=\"dt-button\"\n :type=\"type\"\n :disabled=\"disabled\"\n :style=\"{ width: width }\"\n :aria-live=\"computedAriaLive\"\n :aria-label=\"loading ? i18n.$t('DIALTONE_BUTTON_LOADING') : $attrs['aria-label']\"\n v-on=\"buttonListeners\"\n >\n <!-- NOTE(cormac): This span is needed since we can't apply styles to slots. -->\n <span\n v-if=\"shouldRenderIcon()\"\n data-qa=\"dt-button-icon\"\n :class=\"[\n 'base-button__icon',\n {\n 'd-btn__icon': kind !== 'unstyled',\n [ICON_POSITION_MODIFIERS[iconPosition]]: kind !== 'unstyled',\n },\n ]\"\n >\n <!-- @slot Button icon -->\n <slot\n name=\"icon\"\n :icon-size=\"iconSize\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n data-qa=\"dt-button-label\"\n :class=\"[\n 'base-button__label',\n { 'd-btn__label': kind !== 'unstyled' },\n labelClass,\n ]\"\n >\n <!-- @slot Content within button -->\n <slot />\n </span>\n </button>\n</template>\n\n<script>\nimport Vue from 'vue';\n\nimport {\n BUTTON_SIZE_MODIFIERS,\n BUTTON_KIND_MODIFIERS,\n BUTTON_IMPORTANCE_MODIFIERS,\n BUTTON_ICON_SIZES,\n BUTTON_TYPES,\n ICON_POSITION_MODIFIERS,\n INVALID_COMBINATION,\n} from './button_constants';\n\nimport { LINK_KIND_MODIFIERS, getLinkKindModifier } from '@/components/link';\n\nimport { DtLocalizationMixin } from '@/common/mixins';\n\n/**\n * A button is a UI element which allows users to take an action throughout the app.\n * It is important a button is identifiable, consistent, and communicates its actions clearly,\n * and is appropriately sized to its action.\n * @see https://dialtone.dialpad.com/components/button.html\n */\nexport default {\n name: 'DtButton',\n\n mixins: [DtLocalizationMixin],\n\n props: {\n /**\n * Whether the button is a circle or not.\n * @values true, false\n */\n circle: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of the icon slot within the button.\n * @values left, right, top, bottom\n */\n iconPosition: {\n type: String,\n default: 'left',\n validator: (position) => Object.keys(ICON_POSITION_MODIFIERS).includes(position),\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: 'primary',\n validator: (i) => Object.keys(BUTTON_IMPORTANCE_MODIFIERS).includes(i),\n },\n\n /**\n * Whether the button should be styled as a link or not.\n * @values true, false\n * @see DtLink\n */\n link: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The color of the link and button if the button is styled as a link.\n * @values default, warning, danger, success, muted\n * @see DtLink\n */\n linkKind: {\n type: String,\n default: 'default',\n validator: (lk) => Object.keys(LINK_KIND_MODIFIERS).includes(lk),\n },\n\n /**\n * Determines whether the link should have inverted styling if the button is styled as a link.\n * @values true, false\n * @see DtLink\n */\n linkInverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled\" target=\"_blank\"> (Reference) </a>\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button type attribute\n * <a\n * class=\"d-link\"\n * href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\"\n * target=\"_blank\"\n * >\n * (Reference)\n * </a>\n * @values button, submit, reset\n */\n type: {\n type: String,\n default: 'button',\n validator: (t) => BUTTON_TYPES.includes(t),\n },\n\n /**\n * Button width, accepts\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/width\" target=\"_blank\">\n * CSS width attribute\n * </a>\n * values\n */\n width: {\n type: String,\n default: null,\n },\n\n /**\n * The size of the button.\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(BUTTON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n * @values true, false\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The color of the button.\n * @values default, unstyled, muted, danger, positive, inverted\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(BUTTON_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button\n * is in focus. default is to not.\n * @values true, false\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n */\n active: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native button focus in event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native button focus out event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n ],\n\n data () {\n return {\n ICON_POSITION_MODIFIERS,\n // whether the button is currently in focus\n isInFocus: false,\n };\n },\n\n computed: {\n\n buttonListeners () {\n if (!this.assertiveOnFocus) {\n return this.$listeners;\n }\n return {\n ...this.$listeners,\n focusin: (e) => {\n this.isInFocus = true;\n },\n\n focusout: (e) => {\n this.isInFocus = false;\n },\n };\n },\n\n computedAriaLive () {\n return this.assertiveOnFocus && this.isInFocus ? 'assertive' : this.$attrs.ariaLive;\n },\n\n iconSize () {\n return BUTTON_ICON_SIZES[this.size];\n },\n },\n\n watch: {\n $props: {\n deep: true,\n immediate: true,\n handler () {\n if (process.env.NODE_ENV === 'production') return;\n\n if (this.circle && this.link) {\n Vue.util.warn('You cannot enable circle and link at the same time', this);\n }\n\n this.isInvalidPropCombination(this.circle, this.kind, this.importance);\n },\n },\n },\n\n methods: {\n buttonClasses () {\n if (this.link) {\n return [\n 'd-link',\n getLinkKindModifier(this.linkKind, this.linkInverted),\n BUTTON_SIZE_MODIFIERS[this.size],\n ];\n }\n if (this.kind === 'unstyled') {\n return ['d-btn--unstyled'];\n }\n return [\n 'd-btn',\n BUTTON_IMPORTANCE_MODIFIERS[this.importance],\n BUTTON_KIND_MODIFIERS[this.kind],\n BUTTON_SIZE_MODIFIERS[this.size],\n {\n 'd-btn--circle': this.circle,\n 'd-btn--loading': this.loading,\n 'd-btn--icon-only': this.isIconOnly(),\n 'd-btn--vertical': this.isVerticalIconLayout(),\n 'd-btn--active': this.active,\n },\n ];\n },\n\n isInvalidPropCombination (circle, kind, importance) {\n // Skip validation if unstyled is true\n if (this.kind === 'unstyled') {\n return true;\n }\n\n for (const row of INVALID_COMBINATION) {\n if (circle === row.circle && kind === row.kind && importance === row.importance) {\n console.warn(row.message);\n return false;\n }\n }\n return true;\n },\n\n shouldRenderIcon () {\n return this.$scopedSlots.icon && this.$scopedSlots.icon() && !this.link;\n },\n\n isIconOnly () {\n return this.shouldRenderIcon() && !this.$slots.default;\n },\n\n isVerticalIconLayout () {\n return !this.isIconOnly() && ['top', 'bottom'].includes(this.iconPosition);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtLocalizationMixin","position","ICON_POSITION_MODIFIERS","i","BUTTON_IMPORTANCE_MODIFIERS","lk","LINK_KIND_MODIFIERS","t","BUTTON_TYPES","s","BUTTON_SIZE_MODIFIERS","k","BUTTON_KIND_MODIFIERS","BUTTON_ICON_SIZES","Vue","getLinkKindModifier","circle","kind","importance","row","INVALID_COMBINATION"],"mappings":";;;;;AAsEA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,KAAAC,CAAA,EAAA,SAAAD,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAE,MAAA,OAAA,KAAAC,CAAA,EAAA,SAAAD,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA;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,MAAA,OAAA,KAAAC,CAAA,EAAA,SAAAD,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AAA,QAAAD,MAAAC,EAAA;AACA,yBAAA,KAAAA,EAAA,OAAA,GACA;AAGA,aAAA;AAAA,IACA;AAAA,IAEA,mBAAA;AACA,aAAA,KAAA,aAAA,QAAA,KAAA,aAAA,KAAA,KAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,aAAA;AACA,aAAA,KAAA,iBAAA,KAAA,CAAA,KAAA,OAAA;AAAA,IACA;AAAA,IAEA,uBAAA;AACA,aAAA,CAAA,KAAA,WAAA,KAAA,CAAA,OAAA,QAAA,EAAA,SAAA,KAAA,YAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@dialpad/dialtone-icons/vue2"),n=require("../../common/utils/index.cjs"),a=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),i=require("../callbar-button/callbar-button.cjs"),s=require("../dropdown/dropdown.cjs"),d=require("../button/button.cjs"),u=require("../callbar-button/callbar-button-constants.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@dialpad/dialtone-icons/vue2"),n=require("../../common/utils/index.cjs"),a=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),i=require("../callbar-button/callbar-button.cjs"),s=require("../dropdown/dropdown.cjs"),d=require("../button/button.cjs"),u=require("../../common/mixins/localization.cjs"),c=require("../callbar-button/callbar-button-constants.cjs"),p={name:"DtRecipeCallbarButtonWithDropdown",components:{DtRecipeCallbarButton:i.default,DtDropdown:s.default,DtButton:d.default,DtIconChevronUp:l.DtIconChevronUp},mixins:[u.default],inheritAttrs:!1,props:{id:{type:String,default(){return n.default.getUniqueString()}},ariaLabel:{type:String,default:null,validator:e=>e||(void 0).$slots.default},placement:{type:String,default:"top"},fallbackPlacements:{type:Array,default:()=>["auto"]},disabled:{type:Boolean,default:!1},forceShowArrow:{type:Boolean,default:!1},active:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},buttonClass:{type:[String,Array,Object],default:""},textClass:{type:[String,Array,Object],default:""},buttonWidthSize:{type:String,default:"xl",validator:e=>c.CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(e)},invertedTooltip:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:null},tooltipText:{type:String,default:void 0},tooltipDelay:{type:Boolean,default:void 0}},emits:["arrow-click","click","opened"],data(){return{open:!1}},computed:{showArrowButton(){return this.forceShowArrow||!this.disabled},isCompactMode(){return this.buttonWidthSize==="sm"||this.buttonWidthSize==="md"},arrowButtonLabel(){return this.i18n.$ta("DIALTONE_CALLBAR_BUTTON_WITH_DROPDOWN_ARROW_BUTTON_LABEL")}},mounted(){n.warnIfUnmounted(this.$el,this.$options.name)},methods:{arrowClick(e){return this.$emit("arrow-click",e),this.toggleOpen()},toggleOpen(){return this.open=!this.open},syncOpenState(){this.open=this.openDropdown},buttonClick(e){this.$listeners.click?this.$emit("click",e):this.arrowClick(e)},onModalIsOpened(e){this.open=e,this.$emit("opened",e)}}};var f=function(){var t=this,o=t._self._c;return o("div",{staticClass:"dt-recipe--callbar-button-with-dropdown"},[o("dt-recipe-callbar-button",{staticClass:"dt-recipe--callbar-button-with-dropdown--main-button",attrs:{active:t.active,"aria-label":t.ariaLabel,"button-class":t.buttonClass,"button-width-size":t.buttonWidthSize,danger:t.danger,disabled:t.disabled,"inverted-tooltip":t.invertedTooltip,"show-tooltip":t.showTooltip,"text-class":t.textClass,"tooltip-delay":t.tooltipDelay,"tooltip-text":t.tooltipText},on:{click:t.buttonClick},scopedSlots:t._u([{key:"icon",fn:function(){return[t._t("icon")]},proxy:!0},{key:"tooltip",fn:function(){return[t._t("tooltip")]},proxy:!0}],null,!0)},[t._t("default")],2),t.showArrowButton?o("dt-dropdown",t._b({staticClass:"dt-recipe--callbar-button-with-dropdown--dropdown-wrapper",attrs:{id:t.id,modal:!1,"fallback-placements":t.fallbackPlacements,open:t.open,placement:t.placement,padding:"none"},on:{opened:t.onModalIsOpened},scopedSlots:t._u([{key:"anchor",fn:function(){return[o("dt-button",t._b({class:["dt-recipe--callbar-button-with-dropdown--arrow",{"dt-recipe--callbar-button-with-dropdown--arrow--large":!t.isCompactMode}],attrs:{active:t.open,circle:"",importance:"clear",size:"lg",width:"2rem"},on:{click:t.arrowClick},scopedSlots:t._u([{key:"icon",fn:function(){return[o("dt-icon-chevron-up",{staticClass:"dt-recipe--callbar-button-with-dropdown--arrow__icon",attrs:{size:"200"}})]},proxy:!0}],null,!1,887776886)},"dt-button",t.arrowButtonLabel,!1))]},proxy:!0},{key:"list",fn:function({close:r}){return[t._t("list",null,{close:r})]}}],null,!0)},"dt-dropdown",t.$attrs,!1)):t._e()],1)},b=[],_=a.n(p,f,b);const w=_.exports;exports.default=w;
|
|
2
2
|
//# sourceMappingURL=callbar-button-with-dropdown.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbar-button-with-dropdown.cjs","sources":["../../../recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue"],"sourcesContent":["<template>\n <div\n class=\"dt-recipe--callbar-button-with-dropdown\"\n >\n <dt-recipe-callbar-button\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :danger=\"danger\"\n :disabled=\"disabled\"\n :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :text-class=\"textClass\"\n :tooltip-delay=\"tooltipDelay\"\n :tooltip-text=\"tooltipText\"\n class=\"dt-recipe--callbar-button-with-dropdown--main-button\"\n @click=\"buttonClick\"\n >\n <template #icon>\n <slot name=\"icon\" />\n </template>\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n <slot />\n </dt-recipe-callbar-button>\n <dt-dropdown\n v-if=\"showArrowButton\"\n :id=\"id\"\n :modal=\"false\"\n :fallback-placements=\"fallbackPlacements\"\n :open=\"open\"\n :placement=\"placement\"\n class=\"dt-recipe--callbar-button-with-dropdown--dropdown-wrapper\"\n padding=\"none\"\n v-bind=\"$attrs\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n :active=\"open\"\n :aria-label=\"arrowButtonLabel\"\n :class=\"['dt-recipe--callbar-button-with-dropdown--arrow',\n { 'dt-recipe--callbar-button-with-dropdown--arrow--large': !isCompactMode }]\"\n circle\n importance=\"clear\"\n size=\"lg\"\n width=\"2rem\"\n @click=\"arrowClick\"\n >\n <template #icon>\n <dt-icon-chevron-up\n class=\"dt-recipe--callbar-button-with-dropdown--arrow__icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <template #list=\"{ close }\">\n <slot\n :close=\"close\"\n name=\"list\"\n />\n </template>\n </dt-dropdown>\n </div>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtDropdown } from '@/components/dropdown';\nimport { DtIconChevronUp } from '@dialpad/dialtone-icons/vue2';\nimport { DtRecipeCallbarButton, CALLBAR_BUTTON_VALID_WIDTH_SIZE } from '../callbar_button';\nimport utils, { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButtonWithDropdown',\n\n components: { DtRecipeCallbarButton, DtDropdown, DtButton, DtIconChevronUp },\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Aria label for the arrow. Cannot be empty.\n */\n arrowButtonLabel: {\n type: String,\n required: true,\n validator: (label) => {\n return !!label;\n },\n },\n\n /**\n * The direction the dropdown displays relative to the anchor.\n * @values 'bottom', 'bottom-start', 'bottom-end',\n * 'right', 'right-start', 'right-end',\n * 'left', 'left-start', 'left-end',\n * 'top', 'top-start', 'top-end'\n * @default 'top'\n */\n placement: {\n type: String,\n default: 'top',\n },\n\n /**\n * If the dropdown does not fit in the direction described by \"placement\",\n * it will attempt to change it's direction to the \"fallbackPlacements\".\n *\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Forces showing the arrow, even if the button is disabled.\n * default is false\n * @values true, false\n */\n forceShowArrow: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Whether there is a delay before the tooltip shows on hover/focus.\n * @values true, false\n */\n tooltipDelay: {\n type: Boolean,\n default: undefined,\n },\n },\n\n emits: [\n /**\n * Emitted when the arrow is clicked\n */\n 'arrow-click',\n\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Emitted when modal dropdown is opened or closed.\n */\n 'opened',\n ],\n\n data () {\n return {\n open: false,\n };\n },\n\n computed: {\n showArrowButton () {\n return this.forceShowArrow || !this.disabled;\n },\n\n isCompactMode () {\n return this.buttonWidthSize === 'sm' || this.buttonWidthSize === 'md';\n },\n\n showDropdown () {\n if (!this.openDropdown || this.open) {\n this.syncOpenState();\n return false;\n }\n\n return this.toggleOpen();\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n },\n\n methods: {\n arrowClick (ev) {\n this.$emit('arrow-click', ev);\n return this.toggleOpen();\n },\n\n toggleOpen () {\n return (this.open = !this.open);\n },\n\n syncOpenState () {\n this.open = this.openDropdown;\n },\n\n buttonClick (ev) {\n // If no listener for the click event, the button click opens the dropdown\n // the same as if the arrow was clicked.\n if (!this.$listeners.click) {\n this.arrowClick(ev);\n } else {\n this.$emit('click', ev);\n }\n },\n\n onModalIsOpened (isOpened) {\n this.open = isOpened;\n this.$emit('opened', isOpened);\n },\n },\n\n};\n</script>\n"],"names":["_sfc_main","DtRecipeCallbarButton","DtDropdown","DtButton","DtIconChevronUp","utils","label","this","size","CALLBAR_BUTTON_VALID_WIDTH_SIZE","warnIfUnmounted","ev","isOpened"],"mappings":"obA4EAA,EAAA,CACA,KAAA,oCAEA,WAAA,CAAA,sBAAAC,EAAA,QAAA,WAAAC,UAAAC,SAAAA,EAAAA,QAAAC,gBAAAA,EAAAA,eAAA,EAMA,aAAA,GAEA,MAAA,CAIA,GAAA,CACA,KAAA,OACA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AAA,YACA,EAEA,YAAA,CACA,OAAA,KAAA,KAAA,CAAA,KAAA,IACA,EAEA,eAAA,CACA,KAAA,KAAA,KAAA,YACA,EAEA,YAAAA,EAAA,CAGA,KAAA,WAAA,MAGA,KAAA,MAAA,QAAAA,CAAA,EAFA,KAAA,WAAAA,CAAA,CAIA,EAEA,gBAAAC,EAAA,CACA,KAAA,KAAAA,EACA,KAAA,MAAA,SAAAA,CAAA,CACA,CACA,CAEA"}
|
|
1
|
+
{"version":3,"file":"callbar-button-with-dropdown.cjs","sources":["../../../recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue"],"sourcesContent":["<template>\n <div\n class=\"dt-recipe--callbar-button-with-dropdown\"\n >\n <dt-recipe-callbar-button\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :danger=\"danger\"\n :disabled=\"disabled\"\n :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :text-class=\"textClass\"\n :tooltip-delay=\"tooltipDelay\"\n :tooltip-text=\"tooltipText\"\n class=\"dt-recipe--callbar-button-with-dropdown--main-button\"\n @click=\"buttonClick\"\n >\n <template #icon>\n <slot name=\"icon\" />\n </template>\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n <slot />\n </dt-recipe-callbar-button>\n <dt-dropdown\n v-if=\"showArrowButton\"\n :id=\"id\"\n :modal=\"false\"\n :fallback-placements=\"fallbackPlacements\"\n :open=\"open\"\n :placement=\"placement\"\n class=\"dt-recipe--callbar-button-with-dropdown--dropdown-wrapper\"\n padding=\"none\"\n v-bind=\"$attrs\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n :active=\"open\"\n :class=\"['dt-recipe--callbar-button-with-dropdown--arrow',\n { 'dt-recipe--callbar-button-with-dropdown--arrow--large': !isCompactMode }]\"\n circle\n importance=\"clear\"\n size=\"lg\"\n v-bind=\"arrowButtonLabel\"\n width=\"2rem\"\n @click=\"arrowClick\"\n >\n <template #icon>\n <dt-icon-chevron-up\n class=\"dt-recipe--callbar-button-with-dropdown--arrow__icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <template #list=\"{ close }\">\n <slot\n :close=\"close\"\n name=\"list\"\n />\n </template>\n </dt-dropdown>\n </div>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtDropdown } from '@/components/dropdown';\nimport { DtIconChevronUp } from '@dialpad/dialtone-icons/vue2';\nimport { DtRecipeCallbarButton, CALLBAR_BUTTON_VALID_WIDTH_SIZE } from '../callbar_button';\nimport utils, { warnIfUnmounted } from '@/common/utils';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\nexport default {\n name: 'DtRecipeCallbarButtonWithDropdown',\n\n components: { DtRecipeCallbarButton, DtDropdown, DtButton, DtIconChevronUp },\n\n mixins: [DtLocalizationMixin],\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * The direction the dropdown displays relative to the anchor.\n * @values 'bottom', 'bottom-start', 'bottom-end',\n * 'right', 'right-start', 'right-end',\n * 'left', 'left-start', 'left-end',\n * 'top', 'top-start', 'top-end'\n * @default 'top'\n */\n placement: {\n type: String,\n default: 'top',\n },\n\n /**\n * If the dropdown does not fit in the direction described by \"placement\",\n * it will attempt to change it's direction to the \"fallbackPlacements\".\n *\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Forces showing the arrow, even if the button is disabled.\n * default is false\n * @values true, false\n */\n forceShowArrow: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Whether there is a delay before the tooltip shows on hover/focus.\n * @values true, false\n */\n tooltipDelay: {\n type: Boolean,\n default: undefined,\n },\n },\n\n emits: [\n /**\n * Emitted when the arrow is clicked\n */\n 'arrow-click',\n\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Emitted when modal dropdown is opened or closed.\n */\n 'opened',\n ],\n\n data () {\n return {\n open: false,\n };\n },\n\n computed: {\n showArrowButton () {\n return this.forceShowArrow || !this.disabled;\n },\n\n isCompactMode () {\n return this.buttonWidthSize === 'sm' || this.buttonWidthSize === 'md';\n },\n\n arrowButtonLabel () {\n return this.i18n.$ta('DIALTONE_CALLBAR_BUTTON_WITH_DROPDOWN_ARROW_BUTTON_LABEL');\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n },\n\n methods: {\n arrowClick (ev) {\n this.$emit('arrow-click', ev);\n return this.toggleOpen();\n },\n\n toggleOpen () {\n return (this.open = !this.open);\n },\n\n syncOpenState () {\n this.open = this.openDropdown;\n },\n\n buttonClick (ev) {\n // If no listener for the click event, the button click opens the dropdown\n // the same as if the arrow was clicked.\n if (!this.$listeners.click) {\n this.arrowClick(ev);\n } else {\n this.$emit('click', ev);\n }\n },\n\n onModalIsOpened (isOpened) {\n this.open = isOpened;\n this.$emit('opened', isOpened);\n },\n },\n\n};\n</script>\n"],"names":["_sfc_main","DtRecipeCallbarButton","DtDropdown","DtButton","DtIconChevronUp","DtLocalizationMixin","utils","label","this","size","CALLBAR_BUTTON_VALID_WIDTH_SIZE","warnIfUnmounted","ev","isOpened"],"mappings":"seA6EAA,EAAA,CACA,KAAA,oCAEA,WAAA,CAAA,sBAAAC,EAAA,QAAA,WAAAC,UAAAC,SAAAA,EAAAA,QAAAC,gBAAAA,EAAAA,eAAA,EAEA,OAAA,CAAAC,EAAAA,OAAA,EAMA,aAAA,GAEA,MAAA,CAIA,GAAA,CACA,KAAA,OACA,SAAA,CACA,OAAAC,EAAAA,QAAA,iBACA,CACA,EAKA,UAAA,CACA,KAAA,OACA,QAAA,KACA,UAAAC,GACAA,GAAAC,SAAA,OAAA,OAEA,EAUA,UAAA,CACA,KAAA,OACA,QAAA,KACA,EAYA,mBAAA,CACA,KAAA,MACA,QAAA,IACA,CAAA,MAAA,CAEA,EAOA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAOA,eAAA,CACA,KAAA,QACA,QAAA,EACA,EAQA,OAAA,CACA,KAAA,QACA,QAAA,EACA,EAQA,OAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,YAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,EAKA,UAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,EAKA,gBAAA,CACA,KAAA,OACA,QAAA,KACA,UAAAC,GAAAC,kCAAA,SAAAD,CAAA,CACA,EAMA,gBAAA,CACA,KAAA,QACA,QAAA,EACA,EAOA,YAAA,CACA,KAAA,QACA,QAAA,IACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,MACA,EAMA,aAAA,CACA,KAAA,QACA,QAAA,MACA,CACA,EAEA,MAAA,CAIA,cAQA,QAKA,QACA,EAEA,MAAA,CACA,MAAA,CACA,KAAA,EACA,CACA,EAEA,SAAA,CACA,iBAAA,CACA,OAAA,KAAA,gBAAA,CAAA,KAAA,QACA,EAEA,eAAA,CACA,OAAA,KAAA,kBAAA,MAAA,KAAA,kBAAA,IACA,EAEA,kBAAA,CACA,OAAA,KAAA,KAAA,IAAA,0DAAA,CACA,CACA,EAEA,SAAA,CACAE,EAAA,gBAAA,KAAA,IAAA,KAAA,SAAA,IAAA,CACA,EAEA,QAAA,CACA,WAAAC,EAAA,CACA,YAAA,MAAA,cAAAA,CAAA,EACA,KAAA,YACA,EAEA,YAAA,CACA,OAAA,KAAA,KAAA,CAAA,KAAA,IACA,EAEA,eAAA,CACA,KAAA,KAAA,KAAA,YACA,EAEA,YAAAA,EAAA,CAGA,KAAA,WAAA,MAGA,KAAA,MAAA,QAAAA,CAAA,EAFA,KAAA,WAAAA,CAAA,CAIA,EAEA,gBAAAC,EAAA,CACA,KAAA,KAAAA,EACA,KAAA,MAAA,SAAAA,CAAA,CACA,CACA,CAEA"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { DtIconChevronUp as r } from "@dialpad/dialtone-icons/vue2";
|
|
2
|
-
import a, { warnIfUnmounted as
|
|
3
|
-
import { n as
|
|
2
|
+
import a, { warnIfUnmounted as i } from "../../common/utils/index.js";
|
|
3
|
+
import { n as l } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
4
4
|
import s from "../callbar-button/callbar-button.js";
|
|
5
5
|
import d from "../dropdown/dropdown.js";
|
|
6
6
|
import p from "../button/button.js";
|
|
7
|
-
import
|
|
8
|
-
|
|
7
|
+
import c from "../../common/mixins/localization.js";
|
|
8
|
+
import { CALLBAR_BUTTON_VALID_WIDTH_SIZE as u } from "../callbar-button/callbar-button-constants.js";
|
|
9
|
+
const f = {
|
|
9
10
|
name: "DtRecipeCallbarButtonWithDropdown",
|
|
10
11
|
components: { DtRecipeCallbarButton: s, DtDropdown: d, DtButton: p, DtIconChevronUp: r },
|
|
12
|
+
mixins: [c],
|
|
11
13
|
/* inheritAttrs: false is generally an option we want to set on library
|
|
12
14
|
components. This allows any attributes passed in that are not recognized
|
|
13
15
|
as props to be passed down to another element or component using v-bind:$attrs
|
|
@@ -31,14 +33,6 @@ const u = {
|
|
|
31
33
|
default: null,
|
|
32
34
|
validator: (e) => e || (void 0).$slots.default
|
|
33
35
|
},
|
|
34
|
-
/**
|
|
35
|
-
* Aria label for the arrow. Cannot be empty.
|
|
36
|
-
*/
|
|
37
|
-
arrowButtonLabel: {
|
|
38
|
-
type: String,
|
|
39
|
-
required: !0,
|
|
40
|
-
validator: (e) => !!e
|
|
41
|
-
},
|
|
42
36
|
/**
|
|
43
37
|
* The direction the dropdown displays relative to the anchor.
|
|
44
38
|
* @values 'bottom', 'bottom-start', 'bottom-end',
|
|
@@ -123,7 +117,7 @@ const u = {
|
|
|
123
117
|
buttonWidthSize: {
|
|
124
118
|
type: String,
|
|
125
119
|
default: "xl",
|
|
126
|
-
validator: (e) =>
|
|
120
|
+
validator: (e) => u.includes(e)
|
|
127
121
|
},
|
|
128
122
|
/**
|
|
129
123
|
* Whether the tooltip has an inverted background color.
|
|
@@ -187,12 +181,12 @@ const u = {
|
|
|
187
181
|
isCompactMode() {
|
|
188
182
|
return this.buttonWidthSize === "sm" || this.buttonWidthSize === "md";
|
|
189
183
|
},
|
|
190
|
-
|
|
191
|
-
return
|
|
184
|
+
arrowButtonLabel() {
|
|
185
|
+
return this.i18n.$ta("DIALTONE_CALLBAR_BUTTON_WITH_DROPDOWN_ARROW_BUTTON_LABEL");
|
|
192
186
|
}
|
|
193
187
|
},
|
|
194
188
|
mounted() {
|
|
195
|
-
|
|
189
|
+
i(this.$el, this.$options.name);
|
|
196
190
|
},
|
|
197
191
|
methods: {
|
|
198
192
|
arrowClick(e) {
|
|
@@ -212,29 +206,29 @@ const u = {
|
|
|
212
206
|
}
|
|
213
207
|
}
|
|
214
208
|
};
|
|
215
|
-
var
|
|
209
|
+
var b = function() {
|
|
216
210
|
var t = this, o = t._self._c;
|
|
217
211
|
return o("div", { staticClass: "dt-recipe--callbar-button-with-dropdown" }, [o("dt-recipe-callbar-button", { staticClass: "dt-recipe--callbar-button-with-dropdown--main-button", attrs: { active: t.active, "aria-label": t.ariaLabel, "button-class": t.buttonClass, "button-width-size": t.buttonWidthSize, danger: t.danger, disabled: t.disabled, "inverted-tooltip": t.invertedTooltip, "show-tooltip": t.showTooltip, "text-class": t.textClass, "tooltip-delay": t.tooltipDelay, "tooltip-text": t.tooltipText }, on: { click: t.buttonClick }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
218
212
|
return [t._t("icon")];
|
|
219
213
|
}, proxy: !0 }, { key: "tooltip", fn: function() {
|
|
220
214
|
return [t._t("tooltip")];
|
|
221
215
|
}, proxy: !0 }], null, !0) }, [t._t("default")], 2), t.showArrowButton ? o("dt-dropdown", t._b({ staticClass: "dt-recipe--callbar-button-with-dropdown--dropdown-wrapper", attrs: { id: t.id, modal: !1, "fallback-placements": t.fallbackPlacements, open: t.open, placement: t.placement, padding: "none" }, on: { opened: t.onModalIsOpened }, scopedSlots: t._u([{ key: "anchor", fn: function() {
|
|
222
|
-
return [o("dt-button", { class: [
|
|
216
|
+
return [o("dt-button", t._b({ class: [
|
|
223
217
|
"dt-recipe--callbar-button-with-dropdown--arrow",
|
|
224
218
|
{ "dt-recipe--callbar-button-with-dropdown--arrow--large": !t.isCompactMode }
|
|
225
|
-
], attrs: { active: t.open,
|
|
219
|
+
], attrs: { active: t.open, circle: "", importance: "clear", size: "lg", width: "2rem" }, on: { click: t.arrowClick }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
226
220
|
return [o("dt-icon-chevron-up", { staticClass: "dt-recipe--callbar-button-with-dropdown--arrow__icon", attrs: { size: "200" } })];
|
|
227
|
-
}, proxy: !0 }], null, !1, 887776886) })];
|
|
221
|
+
}, proxy: !0 }], null, !1, 887776886) }, "dt-button", t.arrowButtonLabel, !1))];
|
|
228
222
|
}, proxy: !0 }, { key: "list", fn: function({ close: n }) {
|
|
229
223
|
return [t._t("list", null, { close: n })];
|
|
230
224
|
} }], null, !0) }, "dt-dropdown", t.$attrs, !1)) : t._e()], 1);
|
|
231
|
-
},
|
|
232
|
-
u,
|
|
225
|
+
}, m = [], h = /* @__PURE__ */ l(
|
|
233
226
|
f,
|
|
234
|
-
|
|
227
|
+
b,
|
|
228
|
+
m
|
|
235
229
|
);
|
|
236
|
-
const
|
|
230
|
+
const v = h.exports;
|
|
237
231
|
export {
|
|
238
|
-
|
|
232
|
+
v as default
|
|
239
233
|
};
|
|
240
234
|
//# sourceMappingURL=callbar-button-with-dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbar-button-with-dropdown.js","sources":["../../../recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue"],"sourcesContent":["<template>\n <div\n class=\"dt-recipe--callbar-button-with-dropdown\"\n >\n <dt-recipe-callbar-button\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :danger=\"danger\"\n :disabled=\"disabled\"\n :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :text-class=\"textClass\"\n :tooltip-delay=\"tooltipDelay\"\n :tooltip-text=\"tooltipText\"\n class=\"dt-recipe--callbar-button-with-dropdown--main-button\"\n @click=\"buttonClick\"\n >\n <template #icon>\n <slot name=\"icon\" />\n </template>\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n <slot />\n </dt-recipe-callbar-button>\n <dt-dropdown\n v-if=\"showArrowButton\"\n :id=\"id\"\n :modal=\"false\"\n :fallback-placements=\"fallbackPlacements\"\n :open=\"open\"\n :placement=\"placement\"\n class=\"dt-recipe--callbar-button-with-dropdown--dropdown-wrapper\"\n padding=\"none\"\n v-bind=\"$attrs\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n :active=\"open\"\n :aria-label=\"arrowButtonLabel\"\n :class=\"['dt-recipe--callbar-button-with-dropdown--arrow',\n { 'dt-recipe--callbar-button-with-dropdown--arrow--large': !isCompactMode }]\"\n circle\n importance=\"clear\"\n size=\"lg\"\n width=\"2rem\"\n @click=\"arrowClick\"\n >\n <template #icon>\n <dt-icon-chevron-up\n class=\"dt-recipe--callbar-button-with-dropdown--arrow__icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <template #list=\"{ close }\">\n <slot\n :close=\"close\"\n name=\"list\"\n />\n </template>\n </dt-dropdown>\n </div>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtDropdown } from '@/components/dropdown';\nimport { DtIconChevronUp } from '@dialpad/dialtone-icons/vue2';\nimport { DtRecipeCallbarButton, CALLBAR_BUTTON_VALID_WIDTH_SIZE } from '../callbar_button';\nimport utils, { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButtonWithDropdown',\n\n components: { DtRecipeCallbarButton, DtDropdown, DtButton, DtIconChevronUp },\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Aria label for the arrow. Cannot be empty.\n */\n arrowButtonLabel: {\n type: String,\n required: true,\n validator: (label) => {\n return !!label;\n },\n },\n\n /**\n * The direction the dropdown displays relative to the anchor.\n * @values 'bottom', 'bottom-start', 'bottom-end',\n * 'right', 'right-start', 'right-end',\n * 'left', 'left-start', 'left-end',\n * 'top', 'top-start', 'top-end'\n * @default 'top'\n */\n placement: {\n type: String,\n default: 'top',\n },\n\n /**\n * If the dropdown does not fit in the direction described by \"placement\",\n * it will attempt to change it's direction to the \"fallbackPlacements\".\n *\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Forces showing the arrow, even if the button is disabled.\n * default is false\n * @values true, false\n */\n forceShowArrow: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Whether there is a delay before the tooltip shows on hover/focus.\n * @values true, false\n */\n tooltipDelay: {\n type: Boolean,\n default: undefined,\n },\n },\n\n emits: [\n /**\n * Emitted when the arrow is clicked\n */\n 'arrow-click',\n\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Emitted when modal dropdown is opened or closed.\n */\n 'opened',\n ],\n\n data () {\n return {\n open: false,\n };\n },\n\n computed: {\n showArrowButton () {\n return this.forceShowArrow || !this.disabled;\n },\n\n isCompactMode () {\n return this.buttonWidthSize === 'sm' || this.buttonWidthSize === 'md';\n },\n\n showDropdown () {\n if (!this.openDropdown || this.open) {\n this.syncOpenState();\n return false;\n }\n\n return this.toggleOpen();\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n },\n\n methods: {\n arrowClick (ev) {\n this.$emit('arrow-click', ev);\n return this.toggleOpen();\n },\n\n toggleOpen () {\n return (this.open = !this.open);\n },\n\n syncOpenState () {\n this.open = this.openDropdown;\n },\n\n buttonClick (ev) {\n // If no listener for the click event, the button click opens the dropdown\n // the same as if the arrow was clicked.\n if (!this.$listeners.click) {\n this.arrowClick(ev);\n } else {\n this.$emit('click', ev);\n }\n },\n\n onModalIsOpened (isOpened) {\n this.open = isOpened;\n this.$emit('opened', isOpened);\n },\n },\n\n};\n</script>\n"],"names":["_sfc_main","DtRecipeCallbarButton","DtDropdown","DtBut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EAAA,KAAA,KAAA,KAAA,SAAA,IAAA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,WAAAC,GAAA;AACA,kBAAA,MAAA,eAAAA,CAAA,GACA,KAAA;IACA;AAAA,IAEA,aAAA;AACA,aAAA,KAAA,OAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,OAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAAA,GAAA;AAGA,MAAA,KAAA,WAAA,QAGA,KAAA,MAAA,SAAAA,CAAA,IAFA,KAAA,WAAAA,CAAA;AAAA,IAIA;AAAA,IAEA,gBAAAC,GAAA;AACA,WAAA,OAAAA,GACA,KAAA,MAAA,UAAAA,CAAA;AAAA,IACA;AAAA,EACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"callbar-button-with-dropdown.js","sources":["../../../recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue"],"sourcesContent":["<template>\n <div\n class=\"dt-recipe--callbar-button-with-dropdown\"\n >\n <dt-recipe-callbar-button\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :danger=\"danger\"\n :disabled=\"disabled\"\n :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :text-class=\"textClass\"\n :tooltip-delay=\"tooltipDelay\"\n :tooltip-text=\"tooltipText\"\n class=\"dt-recipe--callbar-button-with-dropdown--main-button\"\n @click=\"buttonClick\"\n >\n <template #icon>\n <slot name=\"icon\" />\n </template>\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n <slot />\n </dt-recipe-callbar-button>\n <dt-dropdown\n v-if=\"showArrowButton\"\n :id=\"id\"\n :modal=\"false\"\n :fallback-placements=\"fallbackPlacements\"\n :open=\"open\"\n :placement=\"placement\"\n class=\"dt-recipe--callbar-button-with-dropdown--dropdown-wrapper\"\n padding=\"none\"\n v-bind=\"$attrs\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n :active=\"open\"\n :class=\"['dt-recipe--callbar-button-with-dropdown--arrow',\n { 'dt-recipe--callbar-button-with-dropdown--arrow--large': !isCompactMode }]\"\n circle\n importance=\"clear\"\n size=\"lg\"\n v-bind=\"arrowButtonLabel\"\n width=\"2rem\"\n @click=\"arrowClick\"\n >\n <template #icon>\n <dt-icon-chevron-up\n class=\"dt-recipe--callbar-button-with-dropdown--arrow__icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <template #list=\"{ close }\">\n <slot\n :close=\"close\"\n name=\"list\"\n />\n </template>\n </dt-dropdown>\n </div>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtDropdown } from '@/components/dropdown';\nimport { DtIconChevronUp } from '@dialpad/dialtone-icons/vue2';\nimport { DtRecipeCallbarButton, CALLBAR_BUTTON_VALID_WIDTH_SIZE } from '../callbar_button';\nimport utils, { warnIfUnmounted } from '@/common/utils';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\nexport default {\n name: 'DtRecipeCallbarButtonWithDropdown',\n\n components: { DtRecipeCallbarButton, DtDropdown, DtButton, DtIconChevronUp },\n\n mixins: [DtLocalizationMixin],\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * The direction the dropdown displays relative to the anchor.\n * @values 'bottom', 'bottom-start', 'bottom-end',\n * 'right', 'right-start', 'right-end',\n * 'left', 'left-start', 'left-end',\n * 'top', 'top-start', 'top-end'\n * @default 'top'\n */\n placement: {\n type: String,\n default: 'top',\n },\n\n /**\n * If the dropdown does not fit in the direction described by \"placement\",\n * it will attempt to change it's direction to the \"fallbackPlacements\".\n *\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Forces showing the arrow, even if the button is disabled.\n * default is false\n * @values true, false\n */\n forceShowArrow: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Whether there is a delay before the tooltip shows on hover/focus.\n * @values true, false\n */\n tooltipDelay: {\n type: Boolean,\n default: undefined,\n },\n },\n\n emits: [\n /**\n * Emitted when the arrow is clicked\n */\n 'arrow-click',\n\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Emitted when modal dropdown is opened or closed.\n */\n 'opened',\n ],\n\n data () {\n return {\n open: false,\n };\n },\n\n computed: {\n showArrowButton () {\n return this.forceShowArrow || !this.disabled;\n },\n\n isCompactMode () {\n return this.buttonWidthSize === 'sm' || this.buttonWidthSize === 'md';\n },\n\n arrowButtonLabel () {\n return this.i18n.$ta('DIALTONE_CALLBAR_BUTTON_WITH_DROPDOWN_ARROW_BUTTON_LABEL');\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n },\n\n methods: {\n arrowClick (ev) {\n this.$emit('arrow-click', ev);\n return this.toggleOpen();\n },\n\n toggleOpen () {\n return (this.open = !this.open);\n },\n\n syncOpenState () {\n this.open = this.openDropdown;\n },\n\n buttonClick (ev) {\n // If no listener for the click event, the button click opens the dropdown\n // the same as if the arrow was clicked.\n if (!this.$listeners.click) {\n this.arrowClick(ev);\n } else {\n this.$emit('click', ev);\n }\n },\n\n onModalIsOpened (isOpened) {\n this.open = isOpened;\n this.$emit('opened', isOpened);\n },\n },\n\n};\n</script>\n"],"names":["_sfc_main","DtRecipeCallbarButton","DtDropdown","DtButton","DtIconChevronUp","DtLocalizationMixin","utils","label","this","size","CALLBAR_BUTTON_VALID_WIDTH_SIZE","warnIfUnmounted","ev","isOpened"],"mappings":";;;;;;;;AA6EA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,uBAAAC,GAAA,YAAAC,GAAA,UAAAC,GAAA,iBAAAC,EAAA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AACA,eAAAC,EAAA;MACA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 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@dialpad/dialtone-icons/vue2"),n=require("../../common/utils/index.cjs"),r=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),a=require("../callbar-button/callbar-button.cjs"),i=require("../popover/popover.cjs"),s=require("../button/button.cjs"),p=require("../callbar-button/callbar-button-constants.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@dialpad/dialtone-icons/vue2"),n=require("../../common/utils/index.cjs"),r=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),a=require("../callbar-button/callbar-button.cjs"),i=require("../popover/popover.cjs"),s=require("../button/button.cjs"),p=require("../../common/mixins/localization.cjs"),u=require("../callbar-button/callbar-button-constants.cjs"),c={name:"DtRecipeCallbarButtonWithPopover",components:{DtRecipeCallbarButton:a.default,DtPopover:i.default,DtButton:s.default,DtIconChevronUp:l.DtIconChevronUp},mixins:[p.default],inheritAttrs:!1,props:{id:{type:String,default(){return n.default.getUniqueString()}},ariaLabel:{type:String,default:null,validator:e=>e||(void 0).$slots.default},placement:{type:String,default:"top"},offset:{type:Array,default:()=>[0,16]},initialFocusElement:{type:String,default:"first"},showCloseButton:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},forceShowArrow:{type:Boolean,default:!1},active:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},buttonClass:{type:[String,Array,Object],default:""},textClass:{type:[String,Array,Object],default:""},buttonWidthSize:{type:String,default:"xl",validator:e=>u.CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(e)},contentClass:{type:[String,Array,Object],default:""},openPopover:{type:Boolean,default:!1},invertedTooltip:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:null},tooltipText:{type:String,default:void 0},tooltipDelay:{type:Boolean,default:void 0}},emits:["arrow-click","click","opened"],data(){return{open:!1}},computed:{showArrowButton(){return this.forceShowArrow||!this.disabled},isCompactMode(){return this.buttonWidthSize==="sm"||this.buttonWidthSize==="md"},showPopover(){return!this.openPopover||this.open?(this.syncOpenState(),!1):this.toggleOpen()},arrowButtonLabel(){return this.i18n.$ta("DIALTONE_CALLBAR_BUTTON_WITH_POPOVER_ARROW_BUTTON_LABEL")}},mounted(){n.warnIfUnmounted(this.$el,this.$options.name)},methods:{arrowClick(e){return this.$emit("arrow-click",e),this.toggleOpen()},toggleOpen(){return this.open=!this.open},syncOpenState(){this.open=this.openPopover},buttonClick(e){this.$listeners.click?this.$emit("click",e):this.arrowClick(e)},onModalIsOpened(e){this.open=e,this.$emit("opened",e)}}};var d=function(){var t=this,o=t._self._c;return o("div",{staticClass:"d-recipe-callbar-button-with-popover"},[o("dt-recipe-callbar-button",{staticClass:"d-recipe-callbar-button-with-popover--main-button",attrs:{"aria-label":t.ariaLabel,disabled:t.disabled,active:t.active,danger:t.danger,"button-class":t.buttonClass,"button-width-size":t.buttonWidthSize,"text-class":t.textClass,"inverted-tooltip":t.invertedTooltip,"show-tooltip":t.showTooltip,"tooltip-text":t.tooltipText,"tooltip-delay":t.tooltipDelay},on:{click:t.buttonClick}},[t._t("icon",null,{slot:"icon"}),t._t("tooltip",null,{slot:"tooltip"}),t._t("default")],2),t.showArrowButton?o("dt-popover",t._b({staticClass:"d-recipe-callbar-button-with-popover__popover-wrapper",attrs:{id:t.id,modal:!1,open:t.open,placement:t.placement,"initial-focus-element":t.initialFocusElement,"show-close-button":t.showCloseButton,offset:t.offset,padding:"none","dialog-class":["d-recipe-callbar-button-with-popover__popover",t.contentClass],"open-popover":t.showPopover},on:{opened:t.onModalIsOpened},scopedSlots:t._u([{key:"anchor",fn:function(){return[o("dt-button",t._b({class:["d-recipe-callbar-button-with-popover__arrow",{"d-recipe-callbar-button-with-popover__arrow--large":!t.isCompactMode}],attrs:{active:t.open,circle:"",importance:"clear",size:"lg",width:"2rem"},on:{click:t.arrowClick},scopedSlots:t._u([{key:"icon",fn:function(){return[o("dt-icon-chevron-up",{staticClass:"d-recipe-callbar-button-with-popover__arrow-icon",attrs:{size:"200"}})]},proxy:!0}],null,!1,778999832)},"dt-button",t.arrowButtonLabel,!1))]},proxy:!0}],null,!1,2824568807)},"dt-popover",t.$attrs,!1),[t._t("content",null,{slot:"content"}),t._t("headerContent",null,{slot:"headerContent"}),t._t("footerContent",null,{slot:"footerContent"})],2):t._e()],1)},f=[],_=r.n(c,d,f);const b=_.exports;exports.default=b;
|
|
2
2
|
//# sourceMappingURL=callbar-button-with-popover.cjs.map
|