@dialpad/dialtone 9.72.3 → 9.73.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dialtone-default-theme.css +635 -48
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +263 -24
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/doc.json +10888 -10888
- package/dist/vue2/common/sr_only_close_button.vue.cjs +3 -3
- package/dist/vue2/common/sr_only_close_button.vue.cjs.map +1 -1
- package/dist/vue2/common/sr_only_close_button.vue.js +3 -3
- package/dist/vue2/common/sr_only_close_button.vue.js.map +1 -1
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/components/avatar/avatar.vue.cjs +13 -24
- package/dist/vue2/components/avatar/avatar.vue.cjs.map +1 -1
- package/dist/vue2/components/avatar/avatar.vue.js +13 -24
- package/dist/vue2/components/avatar/avatar.vue.js.map +1 -1
- package/dist/vue2/components/badge/badge.vue.cjs +13 -34
- package/dist/vue2/components/badge/badge.vue.cjs.map +1 -1
- package/dist/vue2/components/badge/badge.vue.js +13 -34
- package/dist/vue2/components/badge/badge.vue.js.map +1 -1
- package/dist/vue2/components/chip/chip.vue.cjs +4 -4
- package/dist/vue2/components/chip/chip.vue.cjs.map +1 -1
- package/dist/vue2/components/chip/chip.vue.js +4 -4
- package/dist/vue2/components/chip/chip.vue.js.map +1 -1
- package/dist/vue2/components/collapsible/collapsible.vue.cjs +4 -3
- package/dist/vue2/components/collapsible/collapsible.vue.cjs.map +1 -1
- package/dist/vue2/components/collapsible/collapsible.vue.js +4 -3
- package/dist/vue2/components/collapsible/collapsible.vue.js.map +1 -1
- package/dist/vue2/components/datepicker/modules/month-year-picker.vue.cjs +14 -6
- package/dist/vue2/components/datepicker/modules/month-year-picker.vue.cjs.map +1 -1
- package/dist/vue2/components/datepicker/modules/month-year-picker.vue.js +14 -6
- package/dist/vue2/components/datepicker/modules/month-year-picker.vue.js.map +1 -1
- package/dist/vue2/components/emoji_picker/modules/emoji_search.vue.cjs +6 -5
- package/dist/vue2/components/emoji_picker/modules/emoji_search.vue.cjs.map +1 -1
- package/dist/vue2/components/emoji_picker/modules/emoji_search.vue.js +6 -5
- package/dist/vue2/components/emoji_picker/modules/emoji_search.vue.js.map +1 -1
- package/dist/vue2/components/emoji_picker/modules/emoji_tabset.vue.cjs +23 -14
- package/dist/vue2/components/emoji_picker/modules/emoji_tabset.vue.cjs.map +1 -1
- package/dist/vue2/components/emoji_picker/modules/emoji_tabset.vue.js +23 -14
- package/dist/vue2/components/emoji_picker/modules/emoji_tabset.vue.js.map +1 -1
- package/dist/vue2/components/empty_state/empty_state.vue.cjs +20 -80
- package/dist/vue2/components/empty_state/empty_state.vue.cjs.map +1 -1
- package/dist/vue2/components/empty_state/empty_state.vue.js +21 -81
- package/dist/vue2/components/empty_state/empty_state.vue.js.map +1 -1
- package/dist/vue2/components/empty_state/empty_state_constants.cjs +18 -0
- package/dist/vue2/components/empty_state/empty_state_constants.cjs.map +1 -1
- package/dist/vue2/components/empty_state/empty_state_constants.js +18 -0
- package/dist/vue2/components/empty_state/empty_state_constants.js.map +1 -1
- package/dist/vue2/components/icon/icon.vue.cjs +2 -2
- package/dist/vue2/components/icon/icon.vue.js +2 -2
- package/dist/vue2/components/illustration/illustration.vue.cjs +2 -2
- package/dist/vue2/components/illustration/illustration.vue.js +2 -2
- package/dist/vue2/components/image_viewer/image_viewer.vue.cjs +4 -4
- package/dist/vue2/components/image_viewer/image_viewer.vue.cjs.map +1 -1
- package/dist/vue2/components/image_viewer/image_viewer.vue.js +4 -4
- package/dist/vue2/components/image_viewer/image_viewer.vue.js.map +1 -1
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.cjs +24 -9
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.cjs.map +1 -1
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.js +22 -7
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.js.map +1 -1
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut_constants.cjs +8 -14
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut_constants.cjs.map +1 -1
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut_constants.js +9 -15
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut_constants.js.map +1 -1
- package/dist/vue2/components/list_item/list_item.vue.cjs +3 -3
- package/dist/vue2/components/list_item/list_item.vue.cjs.map +1 -1
- package/dist/vue2/components/list_item/list_item.vue.js +3 -3
- package/dist/vue2/components/list_item/list_item.vue.js.map +1 -1
- package/dist/vue2/components/modal/modal.vue.cjs +4 -4
- package/dist/vue2/components/modal/modal.vue.cjs.map +1 -1
- package/dist/vue2/components/modal/modal.vue.js +4 -4
- package/dist/vue2/components/modal/modal.vue.js.map +1 -1
- package/dist/vue2/components/notice/notice_action.vue.cjs +4 -4
- package/dist/vue2/components/notice/notice_action.vue.cjs.map +1 -1
- package/dist/vue2/components/notice/notice_action.vue.js +4 -4
- package/dist/vue2/components/notice/notice_action.vue.js.map +1 -1
- package/dist/vue2/components/notice/notice_icon.vue.cjs +12 -8
- package/dist/vue2/components/notice/notice_icon.vue.cjs.map +1 -1
- package/dist/vue2/components/notice/notice_icon.vue.js +12 -8
- package/dist/vue2/components/notice/notice_icon.vue.js.map +1 -1
- package/dist/vue2/components/pagination/pagination.vue.cjs +11 -5
- package/dist/vue2/components/pagination/pagination.vue.cjs.map +1 -1
- package/dist/vue2/components/pagination/pagination.vue.js +11 -5
- package/dist/vue2/components/pagination/pagination.vue.js.map +1 -1
- package/dist/vue2/components/popover/popover_header_footer.vue.cjs +4 -4
- package/dist/vue2/components/popover/popover_header_footer.vue.cjs.map +1 -1
- package/dist/vue2/components/popover/popover_header_footer.vue.js +4 -4
- package/dist/vue2/components/popover/popover_header_footer.vue.js.map +1 -1
- package/dist/vue2/dialtone-vue.cjs +0 -3
- package/dist/vue2/dialtone-vue.cjs.map +1 -1
- package/dist/vue2/dialtone-vue.js +2 -5
- package/dist/vue2/lib/general-row.cjs +0 -1
- package/dist/vue2/lib/general-row.cjs.map +1 -1
- package/dist/vue2/lib/general-row.js +1 -2
- package/dist/vue2/lib/keyboard-shortcut.cjs +0 -2
- package/dist/vue2/lib/keyboard-shortcut.cjs.map +1 -1
- package/dist/vue2/lib/keyboard-shortcut.js +2 -4
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs +5 -5
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js +5 -5
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js.map +1 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.cjs +25 -5
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.cjs.map +1 -1
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.js +26 -6
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.cjs +5 -4
- package/dist/vue2/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.js +5 -4
- package/dist/vue2/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.cjs +3 -3
- package/dist/vue2/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.js +3 -3
- package/dist/vue2/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs +35 -22
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.js +35 -22
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs +7 -6
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.js +7 -6
- package/dist/vue2/recipes/conversation_view/feed_item_row/feed_item_row.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_pill/feed_item_pill.vue.cjs +9 -17
- package/dist/vue2/recipes/conversation_view/feed_pill/feed_item_pill.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/feed_pill/feed_item_pill.vue.js +9 -17
- package/dist/vue2/recipes/conversation_view/feed_pill/feed_item_pill.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.cjs +6 -5
- package/dist/vue2/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.js +6 -5
- package/dist/vue2/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs +22 -11
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js +22 -11
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
- package/dist/vue2/recipes/header/settings_menu_button/settings_menu_button.vue.cjs +6 -6
- package/dist/vue2/recipes/header/settings_menu_button/settings_menu_button.vue.cjs.map +1 -1
- package/dist/vue2/recipes/header/settings_menu_button/settings_menu_button.vue.js +6 -6
- package/dist/vue2/recipes/header/settings_menu_button/settings_menu_button.vue.js.map +1 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.cjs +14 -10
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.cjs.map +1 -1
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.js +14 -10
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue2/recipes/leftbar/callbox/callbox.vue.cjs +6 -3
- package/dist/vue2/recipes/leftbar/callbox/callbox.vue.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/callbox/callbox.vue.js +6 -3
- package/dist/vue2/recipes/leftbar/callbox/callbox.vue.js.map +1 -1
- package/dist/vue2/recipes/leftbar/contact_row/contact_row.vue.cjs +6 -5
- package/dist/vue2/recipes/leftbar/contact_row/contact_row.vue.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/contact_row/contact_row.vue.js +6 -5
- package/dist/vue2/recipes/leftbar/contact_row/contact_row.vue.js.map +1 -1
- package/dist/vue2/recipes/leftbar/general_row/general_row.vue.cjs +8 -7
- package/dist/vue2/recipes/leftbar/general_row/general_row.vue.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/general_row/general_row.vue.js +8 -7
- package/dist/vue2/recipes/leftbar/general_row/general_row.vue.js.map +1 -1
- package/dist/vue2/recipes/leftbar/general_row/general_row_constants.cjs +0 -17
- package/dist/vue2/recipes/leftbar/general_row/general_row_constants.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/general_row/general_row_constants.js +0 -17
- package/dist/vue2/recipes/leftbar/general_row/general_row_constants.js.map +1 -1
- package/dist/vue2/recipes/leftbar/general_row/leftbar_general_row_icon.vue.cjs +36 -4
- package/dist/vue2/recipes/leftbar/general_row/leftbar_general_row_icon.vue.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/general_row/leftbar_general_row_icon.vue.js +37 -5
- package/dist/vue2/recipes/leftbar/general_row/leftbar_general_row_icon.vue.js.map +1 -1
- package/dist/vue2/recipes/leftbar/group_row/group_row.vue.cjs +3 -3
- package/dist/vue2/recipes/leftbar/group_row/group_row.vue.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/group_row/group_row.vue.js +3 -3
- package/dist/vue2/recipes/leftbar/group_row/group_row.vue.js.map +1 -1
- package/dist/vue2/recipes/leftbar/unread_pill/unread_pill.vue.cjs +4 -3
- package/dist/vue2/recipes/leftbar/unread_pill/unread_pill.vue.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/unread_pill/unread_pill.vue.js +4 -3
- package/dist/vue2/recipes/leftbar/unread_pill/unread_pill.vue.js.map +1 -1
- package/dist/vue2/style.css +127 -124
- package/dist/vue2/types/components/avatar/avatar.vue.d.ts +4 -34
- package/dist/vue2/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/badge/badge.vue.d.ts +16 -45
- package/dist/vue2/types/components/badge/badge.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/chip/chip.vue.d.ts +1 -1
- package/dist/vue2/types/components/collapsible/collapsible.vue.d.ts +1 -1
- package/dist/vue2/types/components/collapsible/collapsible.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/emoji_picker/modules/emoji_tabset.vue.d.ts +1 -67
- package/dist/vue2/types/components/empty_state/empty_state_constants.d.ts +27 -0
- package/dist/vue2/types/components/keyboard_shortcut/index.d.ts +1 -1
- package/dist/vue2/types/components/keyboard_shortcut/keyboard_shortcut.vue.d.ts +7 -15
- package/dist/vue2/types/components/keyboard_shortcut/keyboard_shortcut.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/keyboard_shortcut/keyboard_shortcut_constants.d.ts +0 -11
- package/dist/vue2/types/components/keyboard_shortcut/keyboard_shortcut_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/modal/modal.vue.d.ts +4 -6
- package/dist/vue2/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/notice/notice_action.vue.d.ts +5 -4
- package/dist/vue2/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/notice/notice_icon.vue.d.ts +1 -1
- package/dist/vue2/types/components/notice/notice_icon.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/split_button/split_button-omega.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts +8 -8
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +0 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_pill/feed_item_pill.vue.d.ts +2 -16
- package/dist/vue2/types/recipes/conversation_view/feed_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +4 -6
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/item_layout/contact_info/contact_info.vue.d.ts +3 -16
- package/dist/vue2/types/recipes/item_layout/contact_info/contact_info.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/callbox/callbox.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +0 -1
- 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 +1 -1
- package/dist/vue2/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/general_row/general_row_constants.d.ts +0 -6
- package/dist/vue2/types/recipes/leftbar/general_row/general_row_constants.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/general_row/index.d.ts +1 -1
- package/dist/vue2/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
- package/dist/vue3/common/sr_only_close_button.vue.cjs +4 -4
- package/dist/vue3/common/sr_only_close_button.vue.cjs.map +1 -1
- package/dist/vue3/common/sr_only_close_button.vue.js +4 -4
- package/dist/vue3/common/sr_only_close_button.vue.js.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/components/avatar/avatar.vue.cjs +30 -41
- package/dist/vue3/components/avatar/avatar.vue.cjs.map +1 -1
- package/dist/vue3/components/avatar/avatar.vue.js +32 -43
- package/dist/vue3/components/avatar/avatar.vue.js.map +1 -1
- package/dist/vue3/components/badge/badge.vue.cjs +22 -39
- package/dist/vue3/components/badge/badge.vue.cjs.map +1 -1
- package/dist/vue3/components/badge/badge.vue.js +23 -40
- package/dist/vue3/components/badge/badge.vue.js.map +1 -1
- package/dist/vue3/components/chip/chip.vue.cjs +4 -7
- package/dist/vue3/components/chip/chip.vue.cjs.map +1 -1
- package/dist/vue3/components/chip/chip.vue.js +4 -7
- package/dist/vue3/components/chip/chip.vue.js.map +1 -1
- package/dist/vue3/components/collapsible/collapsible.vue.cjs +12 -6
- package/dist/vue3/components/collapsible/collapsible.vue.cjs.map +1 -1
- package/dist/vue3/components/collapsible/collapsible.vue.js +12 -6
- package/dist/vue3/components/collapsible/collapsible.vue.js.map +1 -1
- package/dist/vue3/components/datepicker/modules/month-year-picker.vue.cjs +5 -17
- package/dist/vue3/components/datepicker/modules/month-year-picker.vue.cjs.map +1 -1
- package/dist/vue3/components/datepicker/modules/month-year-picker.vue.js +5 -17
- package/dist/vue3/components/datepicker/modules/month-year-picker.vue.js.map +1 -1
- package/dist/vue3/components/emoji_picker/modules/emoji_search.vue.cjs +4 -9
- package/dist/vue3/components/emoji_picker/modules/emoji_search.vue.cjs.map +1 -1
- package/dist/vue3/components/emoji_picker/modules/emoji_search.vue.js +5 -10
- package/dist/vue3/components/emoji_picker/modules/emoji_search.vue.js.map +1 -1
- package/dist/vue3/components/emoji_picker/modules/emoji_tabset.vue.cjs +11 -14
- package/dist/vue3/components/emoji_picker/modules/emoji_tabset.vue.cjs.map +1 -1
- package/dist/vue3/components/emoji_picker/modules/emoji_tabset.vue.js +12 -15
- package/dist/vue3/components/emoji_picker/modules/emoji_tabset.vue.js.map +1 -1
- package/dist/vue3/components/empty_state/empty_state.vue.cjs +19 -92
- package/dist/vue3/components/empty_state/empty_state.vue.cjs.map +1 -1
- package/dist/vue3/components/empty_state/empty_state.vue.js +20 -93
- package/dist/vue3/components/empty_state/empty_state.vue.js.map +1 -1
- package/dist/vue3/components/empty_state/empty_state_constants.cjs +18 -0
- package/dist/vue3/components/empty_state/empty_state_constants.cjs.map +1 -1
- package/dist/vue3/components/empty_state/empty_state_constants.js +18 -0
- package/dist/vue3/components/empty_state/empty_state_constants.js.map +1 -1
- package/dist/vue3/components/icon/icon.vue.cjs +2 -2
- package/dist/vue3/components/icon/icon.vue.js +2 -2
- package/dist/vue3/components/illustration/illustration.vue.cjs +2 -2
- package/dist/vue3/components/illustration/illustration.vue.js +2 -2
- package/dist/vue3/components/image_viewer/image_viewer.vue.cjs +4 -5
- package/dist/vue3/components/image_viewer/image_viewer.vue.cjs.map +1 -1
- package/dist/vue3/components/image_viewer/image_viewer.vue.js +4 -5
- package/dist/vue3/components/image_viewer/image_viewer.vue.js.map +1 -1
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.cjs +24 -11
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.cjs.map +1 -1
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.js +23 -10
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.js.map +1 -1
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut_constants.cjs +8 -14
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut_constants.cjs.map +1 -1
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut_constants.js +9 -15
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut_constants.js.map +1 -1
- package/dist/vue3/components/list_item/list_item.vue.cjs +4 -5
- package/dist/vue3/components/list_item/list_item.vue.cjs.map +1 -1
- package/dist/vue3/components/list_item/list_item.vue.js +4 -5
- package/dist/vue3/components/list_item/list_item.vue.js.map +1 -1
- package/dist/vue3/components/modal/modal.vue.cjs +4 -7
- package/dist/vue3/components/modal/modal.vue.cjs.map +1 -1
- package/dist/vue3/components/modal/modal.vue.js +4 -7
- package/dist/vue3/components/modal/modal.vue.js.map +1 -1
- package/dist/vue3/components/notice/notice_action.vue.cjs +4 -7
- package/dist/vue3/components/notice/notice_action.vue.cjs.map +1 -1
- package/dist/vue3/components/notice/notice_action.vue.js +4 -7
- package/dist/vue3/components/notice/notice_action.vue.js.map +1 -1
- package/dist/vue3/components/notice/notice_icon.vue.cjs +12 -12
- package/dist/vue3/components/notice/notice_icon.vue.cjs.map +1 -1
- package/dist/vue3/components/notice/notice_icon.vue.js +13 -13
- package/dist/vue3/components/notice/notice_icon.vue.js.map +1 -1
- package/dist/vue3/components/pagination/pagination.vue.cjs +10 -15
- package/dist/vue3/components/pagination/pagination.vue.cjs.map +1 -1
- package/dist/vue3/components/pagination/pagination.vue.js +10 -15
- package/dist/vue3/components/pagination/pagination.vue.js.map +1 -1
- package/dist/vue3/components/popover/popover_header_footer.vue.cjs +4 -7
- package/dist/vue3/components/popover/popover_header_footer.vue.cjs.map +1 -1
- package/dist/vue3/components/popover/popover_header_footer.vue.js +4 -7
- package/dist/vue3/components/popover/popover_header_footer.vue.js.map +1 -1
- package/dist/vue3/dialtone-vue.cjs +0 -3
- package/dist/vue3/dialtone-vue.cjs.map +1 -1
- package/dist/vue3/dialtone-vue.js +2 -5
- package/dist/vue3/lib/general-row.cjs +0 -1
- package/dist/vue3/lib/general-row.cjs.map +1 -1
- package/dist/vue3/lib/general-row.js +1 -2
- package/dist/vue3/lib/keyboard-shortcut.cjs +0 -2
- package/dist/vue3/lib/keyboard-shortcut.cjs.map +1 -1
- package/dist/vue3/lib/keyboard-shortcut.js +2 -4
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs +4 -5
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js +4 -5
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js.map +1 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.cjs +27 -11
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.cjs.map +1 -1
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.js +29 -13
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.cjs +7 -11
- package/dist/vue3/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.js +7 -11
- package/dist/vue3/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.cjs +4 -7
- package/dist/vue3/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.js +4 -7
- package/dist/vue3/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs +33 -25
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.js +34 -26
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs +14 -7
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.js +15 -8
- package/dist/vue3/recipes/conversation_view/feed_item_row/feed_item_row.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_pill/feed_item_pill.vue.cjs +23 -25
- package/dist/vue3/recipes/conversation_view/feed_pill/feed_item_pill.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/feed_pill/feed_item_pill.vue.js +24 -26
- package/dist/vue3/recipes/conversation_view/feed_pill/feed_item_pill.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.cjs +8 -12
- package/dist/vue3/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.js +8 -12
- package/dist/vue3/recipes/conversation_view/message_input/meeting_pill/MeetingPill.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs +29 -18
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js +29 -18
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
- package/dist/vue3/recipes/header/settings_menu_button/settings_menu_button.vue.cjs +6 -12
- package/dist/vue3/recipes/header/settings_menu_button/settings_menu_button.vue.cjs.map +1 -1
- package/dist/vue3/recipes/header/settings_menu_button/settings_menu_button.vue.js +6 -12
- package/dist/vue3/recipes/header/settings_menu_button/settings_menu_button.vue.js.map +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.cjs +33 -13
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.cjs.map +1 -1
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js +34 -14
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.cjs +13 -4
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.js +14 -5
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.cjs +13 -7
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.js +14 -8
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/general_row.vue.cjs +9 -13
- package/dist/vue3/recipes/leftbar/general_row/general_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/general_row.vue.js +9 -13
- package/dist/vue3/recipes/leftbar/general_row/general_row.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/general_row_constants.cjs +0 -17
- package/dist/vue3/recipes/leftbar/general_row/general_row_constants.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/general_row_constants.js +0 -17
- package/dist/vue3/recipes/leftbar/general_row/general_row_constants.js.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.cjs +39 -11
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.js +41 -13
- package/dist/vue3/recipes/leftbar/general_row/leftbar_general_row_icon.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/group_row/group_row.vue.cjs +4 -7
- package/dist/vue3/recipes/leftbar/group_row/group_row.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/group_row/group_row.vue.js +4 -7
- package/dist/vue3/recipes/leftbar/group_row/group_row.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/unread_pill/unread_pill.vue.cjs +11 -6
- package/dist/vue3/recipes/leftbar/unread_pill/unread_pill.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/unread_pill/unread_pill.vue.js +12 -7
- package/dist/vue3/recipes/leftbar/unread_pill/unread_pill.vue.js.map +1 -1
- package/dist/vue3/style.css +127 -124
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts +5 -33
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/badge/badge.vue.d.ts +17 -34
- package/dist/vue3/types/components/badge/badge.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/chip/chip.vue.d.ts +1 -1
- package/dist/vue3/types/components/collapsible/collapsible.vue.d.ts +1 -1
- package/dist/vue3/types/components/collapsible/collapsible.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/emoji_picker/modules/emoji_tabset.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/empty_state/empty_state.vue.d.ts +4 -0
- package/dist/vue3/types/components/empty_state/empty_state.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/empty_state/empty_state_constants.d.ts +27 -0
- package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/keyboard_shortcut/index.d.ts +1 -1
- package/dist/vue3/types/components/keyboard_shortcut/keyboard_shortcut.vue.d.ts +210 -15
- package/dist/vue3/types/components/keyboard_shortcut/keyboard_shortcut.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/keyboard_shortcut/keyboard_shortcut_constants.d.ts +0 -11
- package/dist/vue3/types/components/keyboard_shortcut/keyboard_shortcut_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/list_item/list_item.vue.d.ts +2 -8
- package/dist/vue3/types/components/list_item/list_item.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/notice/notice_action.vue.d.ts +5 -4
- package/dist/vue3/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/notice/notice_icon.vue.d.ts +30 -1
- package/dist/vue3/types/components/notice/notice_icon.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/split_button/split_button-omega.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +30 -1
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts +240 -8
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +0 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_pill/feed_item_pill.vue.d.ts +31 -16
- package/dist/vue3/types/recipes/conversation_view/feed_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +4 -6
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/item_layout/contact_info/contact_info.vue.d.ts +3 -16
- package/dist/vue3/types/recipes/item_layout/contact_info/contact_info.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/callbox/callbox.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +0 -1
- package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row_constants.d.ts +0 -6
- package/dist/vue3/types/recipes/leftbar/general_row/general_row_constants.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/index.d.ts +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +30 -1
- package/dist/vue3/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/vue2/common/storybook_utils.cjs +0 -8
- package/dist/vue2/common/storybook_utils.cjs.map +0 -1
- package/dist/vue2/common/storybook_utils.js +0 -8
- package/dist/vue2/common/storybook_utils.js.map +0 -1
- package/dist/vue2/types/common/storybook_utils.d.ts +0 -35
- package/dist/vue2/types/common/storybook_utils.d.ts.map +0 -1
- package/dist/vue3/common/storybook_utils.cjs +0 -8
- package/dist/vue3/common/storybook_utils.cjs.map +0 -1
- package/dist/vue3/common/storybook_utils.js +0 -8
- package/dist/vue3/common/storybook_utils.js.map +0 -1
- package/dist/vue3/types/common/storybook_utils.d.ts +0 -25
- package/dist/vue3/types/common/storybook_utils.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.vue.cjs","sources":["../../../components/modal/modal.vue"],"sourcesContent":["<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && (hasSlotContent($slots.banner) || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon\n name=\"close\"\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIcon,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n hasSlotContent,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["DtLazyShow","DtButton","DtIcon","SrOnlyCloseButton","Modal","SrOnlyCloseButtonMixin","getUniqueString","MODAL_KIND_MODIFIERS","MODAL_SIZE_MODIFIERS","NOTICE_KINDS","MODAL_BANNER_KINDS","EVENT_KEYNAMES","hasSlotContent","_openBlock","_createBlock","_mergeProps","_toHandlers","_createElementBlock","_normalizeClass","_renderSlot","_createVNode","_Transition","_createElementVNode"],"mappings":";;;;;;;;;;;;;AA0IA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,gBACVA;AAAAA,IACA,UAAAC;AAAAA,IACA,QAAAC;AAAAA,IACA,mBAAAC;AAAAA,EACD;AAAA,EAED,QAAQ,CAACC,SAAOC,sBAAsB;AAAA,EAEtC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAAC,UAAU;AACpB,eAAO,CAAC,CAAC,MAAM;AAAA,MAChB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS,WAAY;AAAE,eAAOC,aA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AM;AAAA,cACN,WAAQ;AAAA,mCAEL,OAAK,KAAA,GAAA,GAAA,UAAA;AAAA,YAGF,MAAc,eAAC,KAAM,OAAC,OAAO,sBADrCA,IAUM,mBAAA,OAAA;AAAA;cARH,OAAKC,IAAAA,eAAA;AAAA;gBAAgD,OAAY;AAAA;cAIlE,WAAQ;AAAA;cAGRC,eAAQ,KAAA,QAAA,SAAA;AAAA,uCAEVF,IASI,mBAAA,KAAA;AAAA;cAPD,OAAKC,IAAAA,eAAA;AAAA;gBAAgD,OAAY;AAAA;cAIlE,WAAQ;AAAA,mCAEL,OAAI,IAAA,GAAA,CAAA;AAAA,YAGD,SAAa,iBADrBL,IAAAA,aAAAI,IAAAA,mBAMS,UANT,YAMS;AAAA,cADPE,eAAsB,KAAA,QAAA,QAAA;AAAA;aAGf,OAAS,aADlBN,IAAAA,aAAAC,IAAAA,YAgBY,sBAhBZC,eAgBY;AAAA;cAdV,OAAM;AAAA,cACN,QAAA;AAAA,cACA,MAAK;AAAA,cACL,YAAW;AAAA,cACV,cAAY,OAAgB,iBAAC;AAAA,eACtB,OAAgB,kBAAA,EACvB,SAAO,SAAK,MAAA,CAAA,GAAA;AAAA,cAEF,kBACT,MAGE;AAAA,gBAHFK,IAAAA,YAGE,oBAAA;AAAA,kBAFA,MAAK;AAAA,kBACL,MAAK;AAAA;;;;YAKH,KAAuB,4CAD/BN,IAIE,YAAA,iCAAA;AAAA;cAFC,+BAA6B,KAAwB;AAAA,cACrD,SAAO,SAAK;AAAA;;wBA5EP,OAAI,IAAA;AAAA;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"modal.vue.cjs","sources":["../../../components/modal/modal.vue"],"sourcesContent":["<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && (hasSlotContent($slots.banner) || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue3';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n hasSlotContent,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["DtLazyShow","DtButton","DtIconClose","SrOnlyCloseButton","Modal","SrOnlyCloseButtonMixin","getUniqueString","MODAL_KIND_MODIFIERS","MODAL_SIZE_MODIFIERS","NOTICE_KINDS","MODAL_BANNER_KINDS","EVENT_KEYNAMES","hasSlotContent","_openBlock","_createBlock","_mergeProps","_toHandlers","_createElementBlock","_normalizeClass","_renderSlot","_createVNode","_Transition","_createElementVNode"],"mappings":";;;;;;;;;;;;;AAyIA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,gBACVA;AAAAA,IACA,UAAAC;AAAAA,iBACAC,KAAW;AAAA,IACX,mBAAAC;AAAAA,EACD;AAAA,EAED,QAAQ,CAACC,SAAOC,sBAAsB;AAAA,EAEtC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAAC,UAAU;AACpB,eAAO,CAAC,CAAC,MAAM;AAAA,MAChB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,eAAe;AA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IERS, MODAL_SIZE_MODIFIERS, MODAL_BANNER_KINDS } from "./modal_constants.js";
|
|
3
4
|
import { getUniqueString, hasSlotContent } from "../../common/utils.js";
|
|
@@ -8,14 +9,13 @@ import { resolveComponent, openBlock, createBlock, mergeProps, toHandlers, withC
|
|
|
8
9
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
9
10
|
import DtLazyShow from "../lazy_show/lazy_show.vue.js";
|
|
10
11
|
import DtButton from "../button/button.vue.js";
|
|
11
|
-
import DtIcon from "../icon/icon.vue.js";
|
|
12
12
|
import { NOTICE_KINDS } from "../notice/notice_constants.js";
|
|
13
13
|
const _sfc_main = {
|
|
14
14
|
name: "DtModal",
|
|
15
15
|
components: {
|
|
16
16
|
DtLazyShow,
|
|
17
17
|
DtButton,
|
|
18
|
-
|
|
18
|
+
DtIconClose,
|
|
19
19
|
SrOnlyCloseButton
|
|
20
20
|
},
|
|
21
21
|
mixins: [Modal, SrOnlyCloseButtonMixin],
|
|
@@ -307,7 +307,7 @@ const _hoisted_4 = {
|
|
|
307
307
|
class: "d-modal__footer"
|
|
308
308
|
};
|
|
309
309
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
310
|
-
const
|
|
310
|
+
const _component_dt_icon_close = resolveComponent("dt-icon-close");
|
|
311
311
|
const _component_dt_button = resolveComponent("dt-button");
|
|
312
312
|
const _component_sr_only_close_button = resolveComponent("sr-only-close-button");
|
|
313
313
|
const _component_dt_lazy_show = resolveComponent("dt-lazy-show");
|
|
@@ -395,10 +395,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
395
395
|
"aria-label": $props.closeButtonProps.ariaLabel
|
|
396
396
|
}, $props.closeButtonProps, { onClick: $options.close }), {
|
|
397
397
|
icon: withCtx(() => [
|
|
398
|
-
createVNode(
|
|
399
|
-
name: "close",
|
|
400
|
-
size: "400"
|
|
401
|
-
})
|
|
398
|
+
createVNode(_component_dt_icon_close, { size: "400" })
|
|
402
399
|
]),
|
|
403
400
|
_: 1
|
|
404
401
|
}, 16, ["aria-label", "onClick"])) : createCommentVNode("", true),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.vue.js","sources":["../../../components/modal/modal.vue"],"sourcesContent":["<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && (hasSlotContent($slots.banner) || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon\n name=\"close\"\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIcon,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n hasSlotContent,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["_openBlock","_createBlock","_mergeProps","_toHandlers","_createElementBlock","_normalizeClass","_renderSlot","_createVNode","_Transition","_createElementVNode"],"mappings":";;;;;;;;;;;;AA0IA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,QAAQ,CAAC,OAAO,sBAAsB;AAAA,EAEtC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAAC,UAAU;AACpB,eAAO,CAAC,CAAC,MAAM;AAAA,M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AAA,QAAA;AAAA,+CAExBF,mBAOK,MAAA;AAAA;cALF,IAAI,OAAY;AAAA,cACjB,OAAM;AAAA,cACN,WAAQ;AAAA,+BAEL,OAAK,KAAA,GAAA,GAAA,UAAA;AAAA,YAGF,MAAc,eAAC,KAAM,OAAC,OAAO,kBADrCA,mBAUM,OAAA;AAAA;cARH,OAAKC,eAAA;AAAA;gBAAgD,OAAY;AAAA;cAIlE,WAAQ;AAAA;cAGRC,WAAQ,KAAA,QAAA,SAAA;AAAA,mCAEVF,mBASI,KAAA;AAAA;cAPD,OAAKC,eAAA;AAAA;gBAAgD,OAAY;AAAA;cAIlE,WAAQ;AAAA,+BAEL,OAAI,IAAA,GAAA,CAAA;AAAA,YAGD,SAAa,iBADrBL,aAAAI,mBAMS,UANT,YAMS;AAAA,cADPE,WAAsB,KAAA,QAAA,QAAA;AAAA;aAGf,OAAS,aADlBN,aAAAC,YAgBY,sBAhBZC,WAgBY;AAAA;cAdV,OAAM;AAAA,cACN,QAAA;AAAA,cACA,MAAK;AAAA,cACL,YAAW;AAAA,cACV,cAAY,OAAgB,iBAAC;AAAA,eACtB,OAAgB,kBAAA,EACvB,SAAO,SAAK,MAAA,CAAA,GAAA;AAAA,cAEF,cACT,MAGE;AAAA,gBAHFK,YAGE,oBAAA;AAAA,kBAFA,MAAK;AAAA,kBACL,MAAK;AAAA;;;;YAKH,KAAuB,wCAD/BN,YAIE,iCAAA;AAAA;cAFC,+BAA6B,KAAwB;AAAA,cACrD,SAAO,SAAK;AAAA;;oBA5EP,OAAI,IAAA;AAAA;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"modal.vue.js","sources":["../../../components/modal/modal.vue"],"sourcesContent":["<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && (hasSlotContent($slots.banner) || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue3';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n hasSlotContent,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["_openBlock","_createBlock","_mergeProps","_toHandlers","_createElementBlock","_normalizeClass","_renderSlot","_createVNode","_Transition","_createElementVNode"],"mappings":";;;;;;;;;;;;AAyIA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,QAAQ,CAAC,OAAO,sBAAsB;AAAA,EAEtC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAAC,UAAU;AACpB,eAAO,CAAC,CAAC,MAAM;AAAA,MAChB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS,WAAY;AAAE,eAAO,gBAAe;AAAA,MAAK;AAAA,IACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,I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,OAAKC,eAAA;AAAA;gBAAgD,OAAY;AAAA;cAIlE,WAAQ;AAAA,+BAEL,OAAI,IAAA,GAAA,CAAA;AAAA,YAGD,SAAa,iBADrBL,aAAAI,mBAMS,UANT,YAMS;AAAA,cADPE,WAAsB,KAAA,QAAA,QAAA;AAAA;aAGf,OAAS,aADlBN,aAAAC,YAeY,sBAfZC,WAeY;AAAA;cAbV,OAAM;AAAA,cACN,QAAA;AAAA,cACA,MAAK;AAAA,cACL,YAAW;AAAA,cACV,cAAY,OAAgB,iBAAC;AAAA,eACtB,OAAgB,kBAAA,EACvB,SAAO,SAAK,MAAA,CAAA,GAAA;AAAA,cAEF,cACT,MAEE;AAAA,gBAFFK,YAEE,0BAAA,EADA,MAAK,MAAK,CAAA;AAAA;;;YAKR,KAAuB,wCAD/BN,YAIE,iCAAA;AAAA;cAFC,+BAA6B,KAAwB;AAAA,cACrD,SAAO,SAAK;AAAA;;oBA3EP,OAAI,IAAA;AAAA;;;;;;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
const vue3 = require("@dialpad/dialtone-icons/vue3");
|
|
2
3
|
const sr_only_close_button$1 = require("../../common/mixins/sr_only_close_button.cjs");
|
|
3
4
|
const sr_only_close_button = require("../../common/sr_only_close_button.vue.cjs");
|
|
4
5
|
const vue = require("vue");
|
|
5
6
|
const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.cjs");
|
|
6
|
-
const icon = require("../icon/icon.vue.cjs");
|
|
7
7
|
const button = require("../button/button.vue.cjs");
|
|
8
8
|
const _sfc_main = {
|
|
9
9
|
name: "DtNoticeAction",
|
|
10
10
|
components: {
|
|
11
|
-
|
|
11
|
+
DtIconClose: vue3.DtIconClose,
|
|
12
12
|
DtButton: button,
|
|
13
13
|
SrOnlyCloseButton: sr_only_close_button
|
|
14
14
|
},
|
|
@@ -71,7 +71,7 @@ const _hoisted_1 = {
|
|
|
71
71
|
"data-qa": "notice-content-actions"
|
|
72
72
|
};
|
|
73
73
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
74
|
-
const
|
|
74
|
+
const _component_dt_icon_close = vue.resolveComponent("dt-icon-close");
|
|
75
75
|
const _component_dt_button = vue.resolveComponent("dt-button");
|
|
76
76
|
const _component_sr_only_close_button = vue.resolveComponent("sr-only-close-button");
|
|
77
77
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
@@ -86,10 +86,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
86
86
|
"aria-label": $props.closeButtonProps.ariaLabel ? $props.closeButtonProps.ariaLabel : "Close"
|
|
87
87
|
}, $props.closeButtonProps, { onClick: $options.close }), {
|
|
88
88
|
icon: vue.withCtx(() => [
|
|
89
|
-
vue.createVNode(
|
|
90
|
-
name: "close",
|
|
91
|
-
size: "200"
|
|
92
|
-
})
|
|
89
|
+
vue.createVNode(_component_dt_icon_close, { size: "200" })
|
|
93
90
|
]),
|
|
94
91
|
_: 1
|
|
95
92
|
}, 16, ["aria-label", "onClick"])) : vue.createCommentVNode("", true),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice_action.vue.cjs","sources":["../../../components/notice/notice_action.vue"],"sourcesContent":["<template>\n <div\n class=\"d-notice__actions\"\n data-qa=\"notice-content-actions\"\n >\n <!-- @slot Slot for main content -->\n <slot v-if=\"!hideAction\" />\n <dt-button\n v-if=\"!hideClose\"\n ref=\"closeButton\"\n data-qa=\"dt-notice-action-close-button\"\n size=\"sm\"\n importance=\"clear\"\n circle\n :aria-label=\"closeButtonProps.ariaLabel ? closeButtonProps.ariaLabel : 'Close'\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon
|
|
1
|
+
{"version":3,"file":"notice_action.vue.cjs","sources":["../../../components/notice/notice_action.vue"],"sourcesContent":["<template>\n <div\n class=\"d-notice__actions\"\n data-qa=\"notice-content-actions\"\n >\n <!-- @slot Slot for main content -->\n <slot v-if=\"!hideAction\" />\n <dt-button\n v-if=\"!hideClose\"\n ref=\"closeButton\"\n data-qa=\"dt-notice-action-close-button\"\n size=\"sm\"\n importance=\"clear\"\n circle\n :aria-label=\"closeButtonProps.ariaLabel ? closeButtonProps.ariaLabel : 'Close'\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"200\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n</template>\n\n<script>\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue3';\nimport { DtButton } from '@/components/button';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\nexport default {\n name: 'DtNoticeAction',\n\n components: {\n DtIconClose,\n DtButton,\n SrOnlyCloseButton,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * Props for the notice close button.\n */\n closeButtonProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Hides the close button from the notice\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Hides the action from the notice\n * @values true, false\n */\n hideAction: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n ],\n\n created () {\n if (!this.hideClose && !this.closeButtonProps.ariaLabel) {\n console.error('Invalid props: you must pass in closeButtonProps.ariaLabel if the close button is displayed.');\n }\n },\n\n mounted () {\n if (!this.hideClose) {\n this.lastFocusedElement = document.activeElement;\n }\n },\n\n beforeUnmount () {\n this.lastFocusedElement?.focus();\n },\n\n methods: {\n close () {\n this.$emit('close');\n },\n },\n};\n</script>\n"],"names":["DtIconClose","DtButton","SrOnlyCloseButton","SrOnlyCloseButtonMixin","_openBlock","_createElementBlock","_renderSlot","_createBlock","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QAAA;AAAA,MACC,cAAY,OAAgB,iBAAC,YAAY,OAAA,iBAAiB,YAAS;AAAA,OAC5D,OAAgB,kBAAA,EACvB,SAAO,SAAK,MAAA,CAAA,GAAA;AAAA,MAEF,kBACT,MAEE;AAAA,QAFFC,IAAAA,YAEE,0BAAA,EADA,MAAK,MAAK,CAAA;AAAA;;;IAKR,KAAuB,4CAD/BF,IAIE,YAAA,iCAAA;AAAA;MAFC,+BAA6B,KAAwB;AAAA,MACrD,SAAO,SAAK;AAAA;;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { DtIconClose } from "@dialpad/dialtone-icons/vue3";
|
|
1
2
|
import SrOnlyCloseButtonMixin from "../../common/mixins/sr_only_close_button.js";
|
|
2
3
|
import SrOnlyCloseButton from "../../common/sr_only_close_button.vue.js";
|
|
3
4
|
import { resolveComponent, openBlock, createElementBlock, renderSlot, createCommentVNode, createBlock, mergeProps, withCtx, createVNode } from "vue";
|
|
4
5
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
import DtIcon from "../icon/icon.vue.js";
|
|
6
6
|
import DtButton from "../button/button.vue.js";
|
|
7
7
|
const _sfc_main = {
|
|
8
8
|
name: "DtNoticeAction",
|
|
9
9
|
components: {
|
|
10
|
-
|
|
10
|
+
DtIconClose,
|
|
11
11
|
DtButton,
|
|
12
12
|
SrOnlyCloseButton
|
|
13
13
|
},
|
|
@@ -70,7 +70,7 @@ const _hoisted_1 = {
|
|
|
70
70
|
"data-qa": "notice-content-actions"
|
|
71
71
|
};
|
|
72
72
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
73
|
-
const
|
|
73
|
+
const _component_dt_icon_close = resolveComponent("dt-icon-close");
|
|
74
74
|
const _component_dt_button = resolveComponent("dt-button");
|
|
75
75
|
const _component_sr_only_close_button = resolveComponent("sr-only-close-button");
|
|
76
76
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -85,10 +85,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
85
85
|
"aria-label": $props.closeButtonProps.ariaLabel ? $props.closeButtonProps.ariaLabel : "Close"
|
|
86
86
|
}, $props.closeButtonProps, { onClick: $options.close }), {
|
|
87
87
|
icon: withCtx(() => [
|
|
88
|
-
createVNode(
|
|
89
|
-
name: "close",
|
|
90
|
-
size: "200"
|
|
91
|
-
})
|
|
88
|
+
createVNode(_component_dt_icon_close, { size: "200" })
|
|
92
89
|
]),
|
|
93
90
|
_: 1
|
|
94
91
|
}, 16, ["aria-label", "onClick"])) : createCommentVNode("", true),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice_action.vue.js","sources":["../../../components/notice/notice_action.vue"],"sourcesContent":["<template>\n <div\n class=\"d-notice__actions\"\n data-qa=\"notice-content-actions\"\n >\n <!-- @slot Slot for main content -->\n <slot v-if=\"!hideAction\" />\n <dt-button\n v-if=\"!hideClose\"\n ref=\"closeButton\"\n data-qa=\"dt-notice-action-close-button\"\n size=\"sm\"\n importance=\"clear\"\n circle\n :aria-label=\"closeButtonProps.ariaLabel ? closeButtonProps.ariaLabel : 'Close'\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon
|
|
1
|
+
{"version":3,"file":"notice_action.vue.js","sources":["../../../components/notice/notice_action.vue"],"sourcesContent":["<template>\n <div\n class=\"d-notice__actions\"\n data-qa=\"notice-content-actions\"\n >\n <!-- @slot Slot for main content -->\n <slot v-if=\"!hideAction\" />\n <dt-button\n v-if=\"!hideClose\"\n ref=\"closeButton\"\n data-qa=\"dt-notice-action-close-button\"\n size=\"sm\"\n importance=\"clear\"\n circle\n :aria-label=\"closeButtonProps.ariaLabel ? closeButtonProps.ariaLabel : 'Close'\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"200\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n</template>\n\n<script>\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue3';\nimport { DtButton } from '@/components/button';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\nexport default {\n name: 'DtNoticeAction',\n\n components: {\n DtIconClose,\n DtButton,\n SrOnlyCloseButton,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * Props for the notice close button.\n */\n closeButtonProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Hides the close button from the notice\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Hides the action from the notice\n * @values true, false\n */\n hideAction: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n ],\n\n created () {\n if (!this.hideClose && !this.closeButtonProps.ariaLabel) {\n console.error('Invalid props: you must pass in closeButtonProps.ariaLabel if the close button is displayed.');\n }\n },\n\n mounted () {\n if (!this.hideClose) {\n this.lastFocusedElement = document.activeElement;\n }\n },\n\n beforeUnmount () {\n this.lastFocusedElement?.focus();\n },\n\n methods: {\n close () {\n this.$emit('close');\n },\n },\n};\n</script>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_createBlock","_mergeProps","_createVNode"],"mappings":";;;;;;AAsCA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,QAAQ,CAAC,sBAAsB;AAAA,EAE/B,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS,OAAO,CAAA;AAAA,IACjB;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACV;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const notice_constants = require("./notice_constants.cjs");
|
|
3
4
|
const common_utils = require("../../common/utils.cjs");
|
|
4
5
|
const vue = require("vue");
|
|
5
6
|
const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.cjs");
|
|
6
|
-
const icon = require("../icon/icon.vue.cjs");
|
|
7
7
|
const kindToIcon = /* @__PURE__ */ new Map([
|
|
8
|
-
["info",
|
|
9
|
-
["success",
|
|
10
|
-
["warning",
|
|
11
|
-
["error",
|
|
12
|
-
["base",
|
|
8
|
+
["info", vue3.DtIconInfo],
|
|
9
|
+
["success", vue3.DtIconCheckCircle],
|
|
10
|
+
["warning", vue3.DtIconAlertTriangle],
|
|
11
|
+
["error", vue3.DtIconAlertCircle],
|
|
12
|
+
["base", vue3.DtIconBell]
|
|
13
13
|
]);
|
|
14
14
|
const _sfc_main = {
|
|
15
15
|
name: "DtNoticeIcon",
|
|
16
16
|
components: {
|
|
17
|
-
|
|
17
|
+
DtIconInfo: vue3.DtIconInfo,
|
|
18
|
+
DtIconCheckCircle: vue3.DtIconCheckCircle,
|
|
19
|
+
DtIconAlertTriangle: vue3.DtIconAlertTriangle,
|
|
20
|
+
DtIconAlertCircle: vue3.DtIconAlertCircle,
|
|
21
|
+
DtIconBell: vue3.DtIconBell
|
|
18
22
|
},
|
|
19
23
|
props: {
|
|
20
24
|
/**
|
|
@@ -46,13 +50,9 @@ const _hoisted_1 = {
|
|
|
46
50
|
class: "d-notice__icon"
|
|
47
51
|
};
|
|
48
52
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
49
|
-
const _component_dt_icon = vue.resolveComponent("dt-icon");
|
|
50
53
|
return $options.defaultIcon || $data.hasSlotContent(_ctx.$slots.default) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
51
54
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
52
|
-
vue.
|
|
53
|
-
name: $options.defaultIcon,
|
|
54
|
-
size: "400"
|
|
55
|
-
}, null, 8, ["name"])
|
|
55
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($options.defaultIcon), { size: "400" }))
|
|
56
56
|
])
|
|
57
57
|
])) : vue.createCommentVNode("", true);
|
|
58
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice_icon.vue.cjs","sources":["../../../components/notice/notice_icon.vue"],"sourcesContent":["<template>\n <div\n v-if=\"defaultIcon || hasSlotContent($slots.default)\"\n aria-hidden=\"true\"\n class=\"d-notice__icon\"\n >\n <!-- @slot Slot for the main content -->\n <slot>\n <
|
|
1
|
+
{"version":3,"file":"notice_icon.vue.cjs","sources":["../../../components/notice/notice_icon.vue"],"sourcesContent":["<template>\n <div\n v-if=\"defaultIcon || hasSlotContent($slots.default)\"\n aria-hidden=\"true\"\n class=\"d-notice__icon\"\n >\n <!-- @slot Slot for the main content -->\n <slot>\n <component\n :is=\"defaultIcon\"\n size=\"400\"\n />\n </slot>\n </div>\n</template>\n\n<script>\nimport {\n DtIconInfo,\n DtIconCheckCircle,\n DtIconAlertTriangle,\n DtIconAlertCircle,\n DtIconBell,\n} from '@dialpad/dialtone-icons/vue3';\nimport { NOTICE_KINDS } from './notice_constants.js';\nimport { hasSlotContent } from '@/common/utils';\n\nconst kindToIcon = new Map([\n ['info', DtIconInfo],\n ['success', DtIconCheckCircle],\n ['warning', DtIconAlertTriangle],\n ['error', DtIconAlertCircle],\n ['base', DtIconBell],\n]);\n\nexport default {\n name: 'DtNoticeIcon',\n\n components: {\n DtIconInfo,\n DtIconCheckCircle,\n DtIconAlertTriangle,\n DtIconAlertCircle,\n DtIconBell,\n },\n\n props: {\n /**\n * Kind of icon\n * @values base, error, info, success, warning\n */\n kind: {\n type: String,\n default: 'base',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n },\n\n data () {\n return {\n hasSlotContent,\n };\n },\n\n computed: {\n defaultIcon () {\n return kindToIcon.get(this.kind);\n },\n },\n};\n</script>\n"],"names":["DtIconInfo","DtIconCheckCircle","DtIconAlertTriangle","DtIconAlertCircle","DtIconBell","NOTICE_KINDS","hasSlotContent","_openBlock","_createElementBlock","_renderSlot","_createBlock","_resolveDynamicComponent"],"mappings":";;;;;;AA2BA,MAAM,aAAa,oBAAI,IAAI;AAAA,EACzB,CAAC,QAAQA,KAAAA,UAAU;AAAA,EACnB,CAAC,WAAWC,KAAAA,iBAAiB;AAAA,EAC7B,CAAC,WAAWC,KAAAA,mBAAmB;AAAA,EAC/B,CAAC,SAASC,KAAAA,iBAAiB;AAAA,EAC3B,CAAC,QAAQC,KAAAA,UAAU;AACrB,CAAC;AAED,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,gBACVJ,KAAU;AAAA,IACV,mBAAAC,KAAiB;AAAA,IACjB,qBAAAC,KAAmB;AAAA,IACnB,mBAAAC,KAAiB;AAAA,gBACjBC,KAAU;AAAA,EACX;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAU,MAAM;AACd,eAAOC,iBAAY,aAAC,SAAS,IAAI;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AAAA,EAED,OAAQ;AACN,WAAO;AAAA,MACL,gBAAAC,aAAc;AAAA;EAEjB;AAAA,EAED,UAAU;AAAA,IACR,cAAe;AACb,aAAO,WAAW,IAAI,KAAK,IAAI;AAAA,IAChC;AAAA,EACF;AACH;;;EApEI,eAAY;AAAA,EACZ,OAAM;;;AAFA,SAAA,SAAA,eAAe,MAAA,eAAe,KAAA,OAAO,OAAO,KADpDC,IAAAA,aAAAC,IAAAA,mBAYM,OAZN,YAYM;AAAA,IANJC,IAAAA,WAKO,4BALP,MAKO;AAAA,OAJLF,cAAA,GAAAG,IAAA,YAGEC,4BAFK,SAAA,WAAW,GAChB,EAAA,MAAK,OAAK;AAAA;;;;;"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
+
import { DtIconInfo, DtIconCheckCircle, DtIconAlertTriangle, DtIconAlertCircle, DtIconBell } from "@dialpad/dialtone-icons/vue3";
|
|
1
2
|
import { NOTICE_KINDS } from "./notice_constants.js";
|
|
2
3
|
import { hasSlotContent } from "../../common/utils.js";
|
|
3
|
-
import {
|
|
4
|
+
import { openBlock, createElementBlock, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode } from "vue";
|
|
4
5
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
import DtIcon from "../icon/icon.vue.js";
|
|
6
6
|
const kindToIcon = /* @__PURE__ */ new Map([
|
|
7
|
-
["info",
|
|
8
|
-
["success",
|
|
9
|
-
["warning",
|
|
10
|
-
["error",
|
|
11
|
-
["base",
|
|
7
|
+
["info", DtIconInfo],
|
|
8
|
+
["success", DtIconCheckCircle],
|
|
9
|
+
["warning", DtIconAlertTriangle],
|
|
10
|
+
["error", DtIconAlertCircle],
|
|
11
|
+
["base", DtIconBell]
|
|
12
12
|
]);
|
|
13
13
|
const _sfc_main = {
|
|
14
14
|
name: "DtNoticeIcon",
|
|
15
15
|
components: {
|
|
16
|
-
|
|
16
|
+
DtIconInfo,
|
|
17
|
+
DtIconCheckCircle,
|
|
18
|
+
DtIconAlertTriangle,
|
|
19
|
+
DtIconAlertCircle,
|
|
20
|
+
DtIconBell
|
|
17
21
|
},
|
|
18
22
|
props: {
|
|
19
23
|
/**
|
|
@@ -45,13 +49,9 @@ const _hoisted_1 = {
|
|
|
45
49
|
class: "d-notice__icon"
|
|
46
50
|
};
|
|
47
51
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
48
|
-
const _component_dt_icon = resolveComponent("dt-icon");
|
|
49
52
|
return $options.defaultIcon || $data.hasSlotContent(_ctx.$slots.default) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
50
53
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
51
|
-
|
|
52
|
-
name: $options.defaultIcon,
|
|
53
|
-
size: "400"
|
|
54
|
-
}, null, 8, ["name"])
|
|
54
|
+
(openBlock(), createBlock(resolveDynamicComponent($options.defaultIcon), { size: "400" }))
|
|
55
55
|
])
|
|
56
56
|
])) : createCommentVNode("", true);
|
|
57
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice_icon.vue.js","sources":["../../../components/notice/notice_icon.vue"],"sourcesContent":["<template>\n <div\n v-if=\"defaultIcon || hasSlotContent($slots.default)\"\n aria-hidden=\"true\"\n class=\"d-notice__icon\"\n >\n <!-- @slot Slot for the main content -->\n <slot>\n <
|
|
1
|
+
{"version":3,"file":"notice_icon.vue.js","sources":["../../../components/notice/notice_icon.vue"],"sourcesContent":["<template>\n <div\n v-if=\"defaultIcon || hasSlotContent($slots.default)\"\n aria-hidden=\"true\"\n class=\"d-notice__icon\"\n >\n <!-- @slot Slot for the main content -->\n <slot>\n <component\n :is=\"defaultIcon\"\n size=\"400\"\n />\n </slot>\n </div>\n</template>\n\n<script>\nimport {\n DtIconInfo,\n DtIconCheckCircle,\n DtIconAlertTriangle,\n DtIconAlertCircle,\n DtIconBell,\n} from '@dialpad/dialtone-icons/vue3';\nimport { NOTICE_KINDS } from './notice_constants.js';\nimport { hasSlotContent } from '@/common/utils';\n\nconst kindToIcon = new Map([\n ['info', DtIconInfo],\n ['success', DtIconCheckCircle],\n ['warning', DtIconAlertTriangle],\n ['error', DtIconAlertCircle],\n ['base', DtIconBell],\n]);\n\nexport default {\n name: 'DtNoticeIcon',\n\n components: {\n DtIconInfo,\n DtIconCheckCircle,\n DtIconAlertTriangle,\n DtIconAlertCircle,\n DtIconBell,\n },\n\n props: {\n /**\n * Kind of icon\n * @values base, error, info, success, warning\n */\n kind: {\n type: String,\n default: 'base',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n },\n\n data () {\n return {\n hasSlotContent,\n };\n },\n\n computed: {\n defaultIcon () {\n return kindToIcon.get(this.kind);\n },\n },\n};\n</script>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_createBlock","_resolveDynamicComponent"],"mappings":";;;;;AA2BA,MAAM,aAAa,oBAAI,IAAI;AAAA,EACzB,CAAC,QAAQ,UAAU;AAAA,EACnB,CAAC,WAAW,iBAAiB;AAAA,EAC7B,CAAC,WAAW,mBAAmB;AAAA,EAC/B,CAAC,SAAS,iBAAiB;AAAA,EAC3B,CAAC,QAAQ,UAAU;AACrB,CAAC;AAED,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAU,MAAM;AACd,eAAO,aAAa,SAAS,IAAI;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AAAA,EAED,OAAQ;AACN,WAAO;AAAA,MACL;AAAA;EAEH;AAAA,EAED,UAAU;AAAA,IACR,cAAe;AACb,aAAO,WAAW,IAAI,KAAK,IAAI;AAAA,IAChC;AAAA,EACF;AACH;;;EApEI,eAAY;AAAA,EACZ,OAAM;;;AAFA,SAAA,SAAA,eAAe,MAAA,eAAe,KAAA,OAAO,OAAO,KADpDA,aAAAC,mBAYM,OAZN,YAYM;AAAA,IANJC,WAKO,4BALP,MAKO;AAAA,OAJLF,UAAA,GAAAG,YAGEC,wBAFK,SAAA,WAAW,GAChB,EAAA,MAAK,OAAK;AAAA;;;;"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
const vue3 = require("@dialpad/dialtone-icons/vue3");
|
|
2
3
|
const vue = require("vue");
|
|
3
4
|
const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.cjs");
|
|
4
5
|
const button = require("../button/button.vue.cjs");
|
|
5
|
-
const icon = require("../icon/icon.vue.cjs");
|
|
6
6
|
const _sfc_main = {
|
|
7
7
|
name: "DtPagination",
|
|
8
8
|
components: {
|
|
9
9
|
DtButton: button,
|
|
10
|
-
|
|
10
|
+
DtIconChevronLeft: vue3.DtIconChevronLeft,
|
|
11
|
+
DtIconChevronRight: vue3.DtIconChevronRight,
|
|
12
|
+
DtIconMoreHorizontal: vue3.DtIconMoreHorizontal
|
|
11
13
|
},
|
|
12
14
|
props: {
|
|
13
15
|
/**
|
|
@@ -127,8 +129,10 @@ const _hoisted_2 = {
|
|
|
127
129
|
"data-qa": "dt-pagination-separator"
|
|
128
130
|
};
|
|
129
131
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
130
|
-
const
|
|
132
|
+
const _component_dt_icon_chevron_left = vue.resolveComponent("dt-icon-chevron-left");
|
|
131
133
|
const _component_dt_button = vue.resolveComponent("dt-button");
|
|
134
|
+
const _component_dt_icon_more_horizontal = vue.resolveComponent("dt-icon-more-horizontal");
|
|
135
|
+
const _component_dt_icon_chevron_right = vue.resolveComponent("dt-icon-chevron-right");
|
|
132
136
|
return vue.openBlock(), vue.createElementBlock("nav", {
|
|
133
137
|
"aria-label": $props.ariaLabel,
|
|
134
138
|
class: "d-pagination"
|
|
@@ -143,10 +147,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
143
147
|
onClick: _cache[0] || (_cache[0] = ($event) => $options.changePage($data.currentPage - 1))
|
|
144
148
|
}, {
|
|
145
149
|
icon: vue.withCtx(() => [
|
|
146
|
-
vue.createVNode(
|
|
147
|
-
name: "chevron-left",
|
|
148
|
-
size: "300"
|
|
149
|
-
})
|
|
150
|
+
vue.createVNode(_component_dt_icon_chevron_left, { size: "300" })
|
|
150
151
|
]),
|
|
151
152
|
_: 1
|
|
152
153
|
}, 8, ["aria-label", "kind", "importance", "disabled", "class"]),
|
|
@@ -156,10 +157,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
156
157
|
class: vue.normalizeClass({ "d-pagination__separator": isNaN(Number(page)) })
|
|
157
158
|
}, [
|
|
158
159
|
isNaN(Number(page)) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
159
|
-
vue.createVNode(
|
|
160
|
-
name: "more-horizontal",
|
|
161
|
-
size: "300"
|
|
162
|
-
})
|
|
160
|
+
vue.createVNode(_component_dt_icon_more_horizontal, { size: "300" })
|
|
163
161
|
])) : (vue.openBlock(), vue.createBlock(_component_dt_button, {
|
|
164
162
|
key: 1,
|
|
165
163
|
"aria-label": $props.pageNumberAriaLabel(page),
|
|
@@ -185,10 +183,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
185
183
|
onClick: _cache[1] || (_cache[1] = ($event) => $options.changePage($data.currentPage + 1))
|
|
186
184
|
}, {
|
|
187
185
|
icon: vue.withCtx(() => [
|
|
188
|
-
vue.createVNode(
|
|
189
|
-
name: "chevron-right",
|
|
190
|
-
size: "300"
|
|
191
|
-
})
|
|
186
|
+
vue.createVNode(_component_dt_icon_chevron_right, { size: "300" })
|
|
192
187
|
]),
|
|
193
188
|
_: 1
|
|
194
189
|
}, 8, ["aria-label", "disabled", "importance", "class"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.vue.cjs","sources":["../../../components/pagination/pagination.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel\"\n class=\"d-pagination\"\n >\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-prev\"\n :aria-label=\"prevAriaLabel\"\n :kind=\"isFirstPage ? 'default' : 'muted'\"\n :importance=\"isFirstPage ? 'primary' : 'clear'\"\n :disabled=\"isFirstPage\"\n :class=\"isFirstPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage - 1)\"\n >\n <template #icon>\n <dt-icon
|
|
1
|
+
{"version":3,"file":"pagination.vue.cjs","sources":["../../../components/pagination/pagination.vue"],"sourcesContent":["<template>\n <nav\n :aria-label=\"ariaLabel\"\n class=\"d-pagination\"\n >\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-prev\"\n :aria-label=\"prevAriaLabel\"\n :kind=\"isFirstPage ? 'default' : 'muted'\"\n :importance=\"isFirstPage ? 'primary' : 'clear'\"\n :disabled=\"isFirstPage\"\n :class=\"isFirstPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage - 1)\"\n >\n <template #icon>\n <dt-icon-chevron-left\n size=\"300\"\n />\n </template>\n </dt-button>\n <div\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page}-${index}`\"\n :class=\"{ 'd-pagination__separator': isNaN(Number(page)) }\"\n >\n <!-- eslint-disable vue/no-bare-strings-in-template -->\n <div\n v-if=\"isNaN(Number(page))\"\n class=\"d-pagination__separator-icon\"\n data-qa=\"dt-pagination-separator\"\n >\n <dt-icon-more-horizontal\n size=\"300\"\n />\n <!-- … -->\n </div>\n <!-- eslint-enable vue/no-bare-strings-in-template -->\n <dt-button\n v-else\n :aria-label=\"pageNumberAriaLabel(page)\"\n :kind=\"currentPage === page ? 'default' : 'muted'\"\n :importance=\"currentPage === page ? 'primary' : 'clear'\"\n label-class=\"\"\n @click=\"changePage(page)\"\n >\n {{ page }}\n </dt-button>\n </div>\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-next\"\n :aria-label=\"nextAriaLabel\"\n :disabled=\"isLastPage\"\n kind=\"muted\"\n :importance=\"isLastPage ? 'primary' : 'clear'\"\n :class=\"isLastPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage + 1)\"\n >\n <template #icon>\n <dt-icon-chevron-right\n size=\"300\"\n />\n </template>\n </dt-button>\n </nav>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtIconChevronLeft, DtIconChevronRight, DtIconMoreHorizontal } from '@dialpad/dialtone-icons/vue3';\n\n/**\n * Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.\n * @see https://dialtone.dialpad.com/components/pagination.html\n */\nexport default {\n name: 'DtPagination',\n\n components: {\n DtButton,\n DtIconChevronLeft,\n DtIconChevronRight,\n DtIconMoreHorizontal,\n },\n\n props: {\n /**\n * Descriptive label for the pagination content.\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * The total number of the pages\n */\n totalPages: {\n type: Number,\n required: true,\n },\n\n /**\n * Descriptive label for the previous button.\n */\n prevAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Descriptive label for the next button.\n */\n nextAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * A method that will be called to get the aria label of each page.\n */\n pageNumberAriaLabel: {\n type: Function,\n required: true,\n },\n\n /**\n * The active current page in the list of pages, defaults to the first page\n */\n activePage: {\n type: Number,\n default: 1,\n },\n\n /**\n * Determines the max pages to be shown in the list. Using an odd number is recommended.\n * If an even number is given, then it will be rounded down to the nearest odd number to always\n * keep current page in the middle when current page is in the mid-range.\n */\n maxVisible: {\n type: Number,\n default: 5,\n },\n },\n\n emits: [\n /**\n * Page change event\n *\n * @event change\n * @type {Number}\n */\n 'change',\n ],\n\n data () {\n return {\n currentPage: this.activePage,\n };\n },\n\n computed: {\n isFirstPage () {\n return this.currentPage === 1;\n },\n\n isLastPage () {\n return this.currentPage === this.totalPages;\n },\n\n pages () {\n if (this.maxVisible === 0) {\n return [];\n }\n if (this.totalPages <= this.maxVisible) {\n return this.range(1, this.totalPages);\n }\n\n const start = this.maxVisible - 1;\n const end = this.totalPages - start + 1;\n\n if (this.currentPage < start) {\n return [...this.range(1, start), '...', this.totalPages];\n }\n\n if (this.currentPage > end) {\n return [1, '...', ...this.range(end, this.totalPages)];\n }\n\n // rounding to the nearest odd according to the maxlength to always show the page number in the middle.\n const total = this.maxVisible - (3 - this.maxVisible % 2);\n const centerIndex = Math.floor(total / 2);\n const left = this.currentPage - centerIndex;\n const right = this.currentPage + centerIndex;\n return [1, '...', ...this.range(left, right), '...', this.totalPages];\n },\n },\n\n methods: {\n range (from, to) {\n const range = [];\n from = from > 0 ? from : 1;\n for (let i = from; i <= to; i++) {\n range.push(i);\n }\n return range;\n },\n\n changePage (page) {\n this.currentPage = page;\n this.$emit('change', this.currentPage);\n },\n },\n};\n</script>\n"],"names":["DtButton","DtIconChevronLeft","DtIconChevronRight","DtIconMoreHorizontal","_createElementBlock","_createVNode","_normalizeClass","_openBlock","_Fragment","_renderList","_createBlock"],"mappings":";;;;;AA4EA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,UAAAA;AAAAA,IACA,mBAAAC,KAAiB;AAAA,IACjB,oBAAAC,KAAkB;AAAA,IAClB,sBAAAC,KAAoB;AAAA,EACrB;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,WAAW;AAAA,MACT,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA,IAKD,YAAY;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA,IAKD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA,IAKD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA,IAKD,qBAAqB;AAAA,MACnB,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA,IAKD,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACF;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL;AAAA,EACD;AAAA,EAED,OAAQ;AACN,WAAO;AAAA,MACL,aAAa,KAAK;AAAA;EAErB;AAAA,EAED,UAAU;AAAA,IACR,cAAe;A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