@dialpad/dialtone 9.73.0-beta.2 → 9.74.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tokens/doc.json +16912 -16912
- 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/common/storybook_utils.cjs +8 -0
- package/dist/vue2/common/storybook_utils.cjs.map +1 -0
- package/dist/vue2/common/storybook_utils.js +8 -0
- package/dist/vue2/common/storybook_utils.js.map +1 -0
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/components/avatar/avatar.vue.cjs +24 -13
- package/dist/vue2/components/avatar/avatar.vue.cjs.map +1 -1
- package/dist/vue2/components/avatar/avatar.vue.js +24 -13
- package/dist/vue2/components/avatar/avatar.vue.js.map +1 -1
- package/dist/vue2/components/badge/badge.vue.cjs +34 -13
- package/dist/vue2/components/badge/badge.vue.cjs.map +1 -1
- package/dist/vue2/components/badge/badge.vue.js +34 -13
- 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 +3 -4
- package/dist/vue2/components/collapsible/collapsible.vue.cjs.map +1 -1
- package/dist/vue2/components/collapsible/collapsible.vue.js +3 -4
- package/dist/vue2/components/collapsible/collapsible.vue.js.map +1 -1
- package/dist/vue2/components/datepicker/modules/month-year-picker.vue.cjs +6 -14
- 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 +6 -14
- 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 +5 -6
- 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 +5 -6
- 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 +14 -23
- 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 +14 -23
- package/dist/vue2/components/emoji_picker/modules/emoji_tabset.vue.js.map +1 -1
- package/dist/vue2/components/empty_state/empty_state.vue.cjs +80 -20
- package/dist/vue2/components/empty_state/empty_state.vue.cjs.map +1 -1
- package/dist/vue2/components/empty_state/empty_state.vue.js +81 -21
- package/dist/vue2/components/empty_state/empty_state.vue.js.map +1 -1
- package/dist/vue2/components/empty_state/empty_state_constants.cjs +0 -18
- package/dist/vue2/components/empty_state/empty_state_constants.cjs.map +1 -1
- package/dist/vue2/components/empty_state/empty_state_constants.js +0 -18
- 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 +9 -24
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.cjs.map +1 -1
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.js +7 -22
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut.vue.js.map +1 -1
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut_constants.cjs +14 -8
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut_constants.cjs.map +1 -1
- package/dist/vue2/components/keyboard_shortcut/keyboard_shortcut_constants.js +15 -9
- 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 +8 -12
- package/dist/vue2/components/notice/notice_icon.vue.cjs.map +1 -1
- package/dist/vue2/components/notice/notice_icon.vue.js +8 -12
- package/dist/vue2/components/notice/notice_icon.vue.js.map +1 -1
- package/dist/vue2/components/pagination/pagination.vue.cjs +5 -11
- package/dist/vue2/components/pagination/pagination.vue.cjs.map +1 -1
- package/dist/vue2/components/pagination/pagination.vue.js +5 -11
- 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/components/tooltip/tooltip.vue.cjs +13 -6
- package/dist/vue2/components/tooltip/tooltip.vue.cjs.map +1 -1
- package/dist/vue2/components/tooltip/tooltip.vue.js +14 -7
- package/dist/vue2/components/tooltip/tooltip.vue.js.map +1 -1
- package/dist/vue2/dialtone-vue.cjs +3 -0
- package/dist/vue2/dialtone-vue.cjs.map +1 -1
- package/dist/vue2/dialtone-vue.js +5 -2
- package/dist/vue2/lib/general-row.cjs +1 -0
- package/dist/vue2/lib/general-row.cjs.map +1 -1
- package/dist/vue2/lib/general-row.js +2 -1
- package/dist/vue2/lib/keyboard-shortcut.cjs +2 -0
- package/dist/vue2/lib/keyboard-shortcut.cjs.map +1 -1
- package/dist/vue2/lib/keyboard-shortcut.js +4 -2
- 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 +5 -25
- 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 +6 -26
- package/dist/vue2/recipes/cards/ivr_node/ivr_node.vue.js.map +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs +19 -6
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs.map +1 -1
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js +19 -6
- package/dist/vue2/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.cjs +4 -5
- 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 +4 -5
- 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 +22 -35
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/editor/editor.vue.js +22 -35
- 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 +6 -7
- 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 +6 -7
- 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 +17 -9
- 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 +17 -9
- 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 +5 -6
- 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 +5 -6
- 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 +11 -22
- 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 +11 -22
- 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 +10 -14
- 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 +10 -14
- package/dist/vue2/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue2/recipes/leftbar/callbox/callbox.vue.cjs +3 -6
- package/dist/vue2/recipes/leftbar/callbox/callbox.vue.cjs.map +1 -1
- package/dist/vue2/recipes/leftbar/callbox/callbox.vue.js +3 -6
- package/dist/vue2/recipes/leftbar/callbox/callbox.vue.js.map +1 -1
- package/dist/vue2/recipes/leftbar/contact_row/contact_row.vue.cjs +5 -6
- 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 +5 -6
- 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 +7 -8
- 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 +7 -8
- 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 +17 -0
- 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 +17 -0
- 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 +4 -36
- 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 +5 -37
- 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 +3 -4
- 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 +3 -4
- package/dist/vue2/recipes/leftbar/unread_pill/unread_pill.vue.js.map +1 -1
- package/dist/vue2/style.css +132 -135
- package/dist/vue2/types/common/storybook_utils.d.ts +35 -0
- package/dist/vue2/types/common/storybook_utils.d.ts.map +1 -0
- package/dist/vue2/types/components/avatar/avatar.vue.d.ts +34 -4
- package/dist/vue2/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/badge/badge.vue.d.ts +45 -16
- 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 +67 -1
- package/dist/vue2/types/components/empty_state/empty_state_constants.d.ts +0 -27
- package/dist/vue2/types/components/keyboard_shortcut/index.d.ts +1 -1
- package/dist/vue2/types/components/keyboard_shortcut/keyboard_shortcut.vue.d.ts +15 -7
- 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 +11 -0
- 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 +6 -4
- package/dist/vue2/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/notice/notice_action.vue.d.ts +4 -5
- 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/components/tooltip/tooltip.vue.d.ts +12 -24
- package/dist/vue2/types/components/tooltip/tooltip.vue.d.ts.map +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 +1 -0
- 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 +16 -2
- 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 +6 -4
- 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 +16 -3
- 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 +1 -0
- 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 +6 -0
- 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/common/storybook_utils.cjs +8 -0
- package/dist/vue3/common/storybook_utils.cjs.map +1 -0
- package/dist/vue3/common/storybook_utils.js +8 -0
- package/dist/vue3/common/storybook_utils.js.map +1 -0
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/components/avatar/avatar.vue.cjs +41 -30
- package/dist/vue3/components/avatar/avatar.vue.cjs.map +1 -1
- package/dist/vue3/components/avatar/avatar.vue.js +43 -32
- package/dist/vue3/components/avatar/avatar.vue.js.map +1 -1
- package/dist/vue3/components/badge/badge.vue.cjs +39 -22
- package/dist/vue3/components/badge/badge.vue.cjs.map +1 -1
- package/dist/vue3/components/badge/badge.vue.js +40 -23
- package/dist/vue3/components/badge/badge.vue.js.map +1 -1
- package/dist/vue3/components/chip/chip.vue.cjs +7 -4
- package/dist/vue3/components/chip/chip.vue.cjs.map +1 -1
- package/dist/vue3/components/chip/chip.vue.js +7 -4
- package/dist/vue3/components/chip/chip.vue.js.map +1 -1
- package/dist/vue3/components/collapsible/collapsible.vue.cjs +6 -12
- package/dist/vue3/components/collapsible/collapsible.vue.cjs.map +1 -1
- package/dist/vue3/components/collapsible/collapsible.vue.js +6 -12
- package/dist/vue3/components/collapsible/collapsible.vue.js.map +1 -1
- package/dist/vue3/components/datepicker/modules/month-year-picker.vue.cjs +17 -5
- 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 +17 -5
- 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 +9 -4
- 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 +10 -5
- 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 +14 -11
- 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 +15 -12
- package/dist/vue3/components/emoji_picker/modules/emoji_tabset.vue.js.map +1 -1
- package/dist/vue3/components/empty_state/empty_state.vue.cjs +92 -19
- package/dist/vue3/components/empty_state/empty_state.vue.cjs.map +1 -1
- package/dist/vue3/components/empty_state/empty_state.vue.js +93 -20
- package/dist/vue3/components/empty_state/empty_state.vue.js.map +1 -1
- package/dist/vue3/components/empty_state/empty_state_constants.cjs +0 -18
- package/dist/vue3/components/empty_state/empty_state_constants.cjs.map +1 -1
- package/dist/vue3/components/empty_state/empty_state_constants.js +0 -18
- 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 +5 -4
- package/dist/vue3/components/image_viewer/image_viewer.vue.cjs.map +1 -1
- package/dist/vue3/components/image_viewer/image_viewer.vue.js +5 -4
- package/dist/vue3/components/image_viewer/image_viewer.vue.js.map +1 -1
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.cjs +11 -24
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.cjs.map +1 -1
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.js +10 -23
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut.vue.js.map +1 -1
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut_constants.cjs +14 -8
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut_constants.cjs.map +1 -1
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut_constants.js +15 -9
- package/dist/vue3/components/keyboard_shortcut/keyboard_shortcut_constants.js.map +1 -1
- package/dist/vue3/components/list_item/list_item.vue.cjs +5 -4
- package/dist/vue3/components/list_item/list_item.vue.cjs.map +1 -1
- package/dist/vue3/components/list_item/list_item.vue.js +5 -4
- package/dist/vue3/components/list_item/list_item.vue.js.map +1 -1
- package/dist/vue3/components/modal/modal.vue.cjs +7 -4
- package/dist/vue3/components/modal/modal.vue.cjs.map +1 -1
- package/dist/vue3/components/modal/modal.vue.js +7 -4
- package/dist/vue3/components/modal/modal.vue.js.map +1 -1
- package/dist/vue3/components/notice/notice_action.vue.cjs +7 -4
- package/dist/vue3/components/notice/notice_action.vue.cjs.map +1 -1
- package/dist/vue3/components/notice/notice_action.vue.js +7 -4
- 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 +15 -10
- package/dist/vue3/components/pagination/pagination.vue.cjs.map +1 -1
- package/dist/vue3/components/pagination/pagination.vue.js +15 -10
- package/dist/vue3/components/pagination/pagination.vue.js.map +1 -1
- package/dist/vue3/components/popover/popover_header_footer.vue.cjs +7 -4
- package/dist/vue3/components/popover/popover_header_footer.vue.cjs.map +1 -1
- package/dist/vue3/components/popover/popover_header_footer.vue.js +7 -4
- package/dist/vue3/components/popover/popover_header_footer.vue.js.map +1 -1
- package/dist/vue3/components/tooltip/tooltip.vue.cjs +13 -6
- package/dist/vue3/components/tooltip/tooltip.vue.cjs.map +1 -1
- package/dist/vue3/components/tooltip/tooltip.vue.js +14 -7
- package/dist/vue3/components/tooltip/tooltip.vue.js.map +1 -1
- package/dist/vue3/dialtone-vue.cjs +3 -0
- package/dist/vue3/dialtone-vue.cjs.map +1 -1
- package/dist/vue3/dialtone-vue.js +5 -2
- package/dist/vue3/lib/general-row.cjs +1 -0
- package/dist/vue3/lib/general-row.cjs.map +1 -1
- package/dist/vue3/lib/general-row.js +2 -1
- package/dist/vue3/lib/keyboard-shortcut.cjs +2 -0
- package/dist/vue3/lib/keyboard-shortcut.cjs.map +1 -1
- package/dist/vue3/lib/keyboard-shortcut.js +4 -2
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs +5 -4
- 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 +5 -4
- 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 +11 -27
- 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 +13 -29
- package/dist/vue3/recipes/cards/ivr_node/ivr_node.vue.js.map +1 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs +19 -6
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.cjs.map +1 -1
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js +19 -6
- package/dist/vue3/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.cjs +11 -7
- 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 +11 -7
- 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 +7 -4
- 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 +7 -4
- 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 +25 -33
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/editor/editor.vue.js +26 -34
- 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 +7 -14
- 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 +8 -15
- 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 +25 -23
- 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 +26 -24
- 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 +12 -8
- 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 +12 -8
- 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 +18 -29
- 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 +18 -29
- 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 +12 -6
- 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 +12 -6
- 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 +13 -33
- 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 +14 -34
- package/dist/vue3/recipes/item_layout/contact_info/contact_info.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.cjs +4 -13
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.cjs.map +1 -1
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.js +5 -14
- package/dist/vue3/recipes/leftbar/callbox/callbox.vue.js.map +1 -1
- package/dist/vue3/recipes/leftbar/contact_row/contact_row.vue.cjs +7 -13
- 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 +8 -14
- 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 +13 -9
- 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 +13 -9
- 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 +17 -0
- 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 +17 -0
- 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 +11 -39
- 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 +13 -41
- 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 +7 -4
- 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 +7 -4
- 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 +6 -11
- 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 +7 -12
- package/dist/vue3/recipes/leftbar/unread_pill/unread_pill.vue.js.map +1 -1
- package/dist/vue3/style.css +132 -135
- package/dist/vue3/types/common/storybook_utils.d.ts +25 -0
- package/dist/vue3/types/common/storybook_utils.d.ts.map +1 -0
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts +33 -5
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/badge/badge.vue.d.ts +34 -17
- 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 +0 -4
- 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 +0 -27
- 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 +15 -210
- 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 +11 -0
- 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 +8 -2
- 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 +4 -5
- 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 +1 -30
- 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/components/tooltip/tooltip.vue.d.ts +2 -8
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts.map +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 +1 -30
- 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 +8 -240
- 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 +1 -0
- 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 +16 -31
- 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 +6 -4
- 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 +16 -3
- 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 +1 -0
- 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 +6 -0
- 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 +1 -30
- package/dist/vue3/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -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-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;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS,WAAY;AAAE,eAAOC,aAAe,gBAAA;AAAA,MAAK;AAAA,IACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,MAAM;AAAA,MACJ,M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,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,YAeY,sBAfZC,eAeY;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,kBACT,MAEE;AAAA,gBAFFK,IAAAA,YAEE,0BAAA,EADA,MAAK,MAAK,CAAA;AAAA;;;YAKR,KAAuB,4CAD/BN,IAIE,YAAA,iCAAA;AAAA;cAFC,+BAA6B,KAAwB;AAAA,cACrD,SAAO,SAAK;AAAA;;wBA3EP,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\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,aAAe,gBAAA;AAAA,MAAK;AAAA,IACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IA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AA,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,4 +1,3 @@
|
|
|
1
|
-
import { DtIconClose } from "@dialpad/dialtone-icons/vue3";
|
|
2
1
|
import Modal from "../../common/mixins/modal.js";
|
|
3
2
|
import { MODAL_KIND_MODIFIERS, MODAL_SIZE_MODIFIERS, MODAL_BANNER_KINDS } from "./modal_constants.js";
|
|
4
3
|
import { getUniqueString, hasSlotContent } from "../../common/utils.js";
|
|
@@ -9,13 +8,14 @@ import { resolveComponent, openBlock, createBlock, mergeProps, toHandlers, withC
|
|
|
9
8
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
10
9
|
import DtLazyShow from "../lazy_show/lazy_show.vue.js";
|
|
11
10
|
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
|
+
DtIcon,
|
|
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 = resolveComponent("dt-icon");
|
|
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,7 +395,10 @@ 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(
|
|
398
|
+
createVNode(_component_dt_icon, {
|
|
399
|
+
name: "close",
|
|
400
|
+
size: "400"
|
|
401
|
+
})
|
|
399
402
|
]),
|
|
400
403
|
_: 1
|
|
401
404
|
}, 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-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,IAOD,MAAM;AAA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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
|
+
{"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,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,IAOD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAAC,MAAM,OAAO,KAAK,oBAAoB,EAAE,SAAS,CAAC;AAAA,IAC/D;AAAA;AAAA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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,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vue3 = require("@dialpad/dialtone-icons/vue3");
|
|
3
2
|
const sr_only_close_button$1 = require("../../common/mixins/sr_only_close_button.cjs");
|
|
4
3
|
const sr_only_close_button = require("../../common/sr_only_close_button.vue.cjs");
|
|
5
4
|
const vue = require("vue");
|
|
6
5
|
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
|
+
DtIcon: icon,
|
|
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 = vue.resolveComponent("dt-icon");
|
|
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,7 +86,10 @@ 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(
|
|
89
|
+
vue.createVNode(_component_dt_icon, {
|
|
90
|
+
name: "close",
|
|
91
|
+
size: "200"
|
|
92
|
+
})
|
|
90
93
|
]),
|
|
91
94
|
_: 1
|
|
92
95
|
}, 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\n name=\"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 { DtIcon } from '@/components/icon';\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 DtIcon,\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":["DtIcon","DtButton","SrOnlyCloseButton","SrOnlyCloseButtonMixin","_openBlock","_createElementBlock","_renderSlot","_createBlock","_mergeProps","_createVNode"],"mappings":";;;;;;;AAuCA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,QAAAA;AAAAA,IACA,UAAAC;AAAAA,IACA,mBAAAC;AAAAA,EACD;AAAA,EAED,QAAQ,CAACC,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;AAAA;AAAA;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icons/vue3";
|
|
2
1
|
import SrOnlyCloseButtonMixin from "../../common/mixins/sr_only_close_button.js";
|
|
3
2
|
import SrOnlyCloseButton from "../../common/sr_only_close_button.vue.js";
|
|
4
3
|
import { resolveComponent, openBlock, createElementBlock, renderSlot, createCommentVNode, createBlock, mergeProps, withCtx, createVNode } from "vue";
|
|
5
4
|
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
|
+
DtIcon,
|
|
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 = resolveComponent("dt-icon");
|
|
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,7 +85,10 @@ 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(
|
|
88
|
+
createVNode(_component_dt_icon, {
|
|
89
|
+
name: "close",
|
|
90
|
+
size: "200"
|
|
91
|
+
})
|
|
89
92
|
]),
|
|
90
93
|
_: 1
|
|
91
94
|
}, 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\n name=\"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 { DtIcon } from '@/components/icon';\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 DtIcon,\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":";;;;;;AAuCA,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;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACF;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAML;AAAA,EACD;AAAA,EAED,UAAW;AACT,QAAI,CAAC,KAAK,aAAa,CAAC,KAAK,iBAAiB,WAAW;AACvD,cAAQ,MAAM,8FAA8F;AAAA,IAC9G;AAAA,EACD;AAAA,EAED,UAAW;AACT,QAAI,CAAC,KAAK,WAAW;AACnB,WAAK,qBAAqB,SAAS;AAAA,IACrC;AAAA,EACD;AAAA,EAED,gBAAiB;;AACf,eAAK,uBAAL,mBAAyB;AAAA,EAC1B;AAAA,EAED,SAAS;AAAA,IACP,QAAS;AACP,WAAK,MAAM,OAAO;AAAA,IACnB;AAAA,EACF;AACH;;EA1GI,OAAM;AAAA,EACN,WAAQ;;;;;;AAFV,SAAAA,UAAA,GAAAC,mBA6BM,OA7BN,YA6BM;AAAA,KAxBS,OAAU,aAAvBC,WAA2B,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA;KAElB,OAAS,aADlBF,aAAAG,YAiBY,sBAjBZC,WAiBY;AAAA;MAfV,KAAI;AAAA,MACJ,WAAQ;AAAA,MACR,MAAK;AAAA,MACL,YAAW;AAAA,MACX,QAAA;AAAA,MACC,cAAY,OAAgB,iBAAC,YAAY,OAAA,iBAAiB,YAAS;AAAA,OAC5D,OAAgB,kBAAA,EACvB,SAAO,SAAK,MAAA,CAAA,GAAA;AAAA,MAEF,cACT,MAGE;AAAA,QAHFC,YAGE,oBAAA;AAAA,UAFA,MAAK;AAAA,UACL,MAAK;AAAA;;;;IAKH,KAAuB,wCAD/BF,YAIE,iCAAA;AAAA;MAFC,+BAA6B,KAAwB;AAAA,MACrD,SAAO,SAAK;AAAA;;;;"}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vue3 = require("@dialpad/dialtone-icons/vue3");
|
|
3
2
|
const notice_constants = require("./notice_constants.cjs");
|
|
4
3
|
const common_utils = require("../../common/utils.cjs");
|
|
5
4
|
const vue = require("vue");
|
|
6
5
|
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", "info"],
|
|
9
|
+
["success", "check-circle"],
|
|
10
|
+
["warning", "alert-triangle"],
|
|
11
|
+
["error", "alert-circle"],
|
|
12
|
+
["base", "bell"]
|
|
13
13
|
]);
|
|
14
14
|
const _sfc_main = {
|
|
15
15
|
name: "DtNoticeIcon",
|
|
16
16
|
components: {
|
|
17
|
-
|
|
18
|
-
DtIconCheckCircle: vue3.DtIconCheckCircle,
|
|
19
|
-
DtIconAlertTriangle: vue3.DtIconAlertTriangle,
|
|
20
|
-
DtIconAlertCircle: vue3.DtIconAlertCircle,
|
|
21
|
-
DtIconBell: vue3.DtIconBell
|
|
17
|
+
DtIcon: icon
|
|
22
18
|
},
|
|
23
19
|
props: {
|
|
24
20
|
/**
|
|
@@ -50,9 +46,13 @@ const _hoisted_1 = {
|
|
|
50
46
|
class: "d-notice__icon"
|
|
51
47
|
};
|
|
52
48
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
49
|
+
const _component_dt_icon = vue.resolveComponent("dt-icon");
|
|
53
50
|
return $options.defaultIcon || $data.hasSlotContent(_ctx.$slots.default) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
54
51
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
55
|
-
|
|
52
|
+
vue.createVNode(_component_dt_icon, {
|
|
53
|
+
name: $options.defaultIcon,
|
|
54
|
+
size: "400"
|
|
55
|
+
}, null, 8, ["name"])
|
|
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 <dt-icon\n :name=\"defaultIcon\"\n size=\"400\"\n />\n </slot>\n </div>\n</template>\n\n<script>\nimport { DtIcon } from '@/components/icon';\nimport { NOTICE_KINDS } from './notice_constants.js';\nimport { hasSlotContent } from '@/common/utils';\n\nconst kindToIcon = new Map([\n ['info', 'info'],\n ['success', 'check-circle'],\n ['warning', 'alert-triangle'],\n ['error', 'alert-circle'],\n ['base', 'bell'],\n]);\n\nexport default {\n name: 'DtNoticeIcon',\n\n components: {\n DtIcon,\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":["DtIcon","NOTICE_KINDS","hasSlotContent","_openBlock","_createElementBlock","_renderSlot","_createVNode"],"mappings":";;;;;;AAqBA,MAAM,aAAa,oBAAI,IAAI;AAAA,EACzB,CAAC,QAAQ,MAAM;AAAA,EACf,CAAC,WAAW,cAAc;AAAA,EAC1B,CAAC,WAAW,gBAAgB;AAAA,EAC5B,CAAC,SAAS,cAAc;AAAA,EACxB,CAAC,QAAQ,MAAM;AACjB,CAAC;AAED,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,QAAAA;AAAAA,EACD;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;;;EA1DI,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,MAJLC,IAAAA,YAGE,oBAAA;AAAA,QAFC,MAAM,SAAW;AAAA,QAClB,MAAK;AAAA;;;;;;"}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import { DtIconInfo, DtIconCheckCircle, DtIconAlertTriangle, DtIconAlertCircle, DtIconBell } from "@dialpad/dialtone-icons/vue3";
|
|
2
1
|
import { NOTICE_KINDS } from "./notice_constants.js";
|
|
3
2
|
import { hasSlotContent } from "../../common/utils.js";
|
|
4
|
-
import { openBlock, createElementBlock, renderSlot,
|
|
3
|
+
import { resolveComponent, openBlock, createElementBlock, renderSlot, createVNode, createCommentVNode } from "vue";
|
|
5
4
|
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", "info"],
|
|
8
|
+
["success", "check-circle"],
|
|
9
|
+
["warning", "alert-triangle"],
|
|
10
|
+
["error", "alert-circle"],
|
|
11
|
+
["base", "bell"]
|
|
12
12
|
]);
|
|
13
13
|
const _sfc_main = {
|
|
14
14
|
name: "DtNoticeIcon",
|
|
15
15
|
components: {
|
|
16
|
-
|
|
17
|
-
DtIconCheckCircle,
|
|
18
|
-
DtIconAlertTriangle,
|
|
19
|
-
DtIconAlertCircle,
|
|
20
|
-
DtIconBell
|
|
16
|
+
DtIcon
|
|
21
17
|
},
|
|
22
18
|
props: {
|
|
23
19
|
/**
|
|
@@ -49,9 +45,13 @@ const _hoisted_1 = {
|
|
|
49
45
|
class: "d-notice__icon"
|
|
50
46
|
};
|
|
51
47
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
48
|
+
const _component_dt_icon = resolveComponent("dt-icon");
|
|
52
49
|
return $options.defaultIcon || $data.hasSlotContent(_ctx.$slots.default) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
53
50
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
54
|
-
(
|
|
51
|
+
createVNode(_component_dt_icon, {
|
|
52
|
+
name: $options.defaultIcon,
|
|
53
|
+
size: "400"
|
|
54
|
+
}, null, 8, ["name"])
|
|
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 <dt-icon\n :name=\"defaultIcon\"\n size=\"400\"\n />\n </slot>\n </div>\n</template>\n\n<script>\nimport { DtIcon } from '@/components/icon';\nimport { NOTICE_KINDS } from './notice_constants.js';\nimport { hasSlotContent } from '@/common/utils';\n\nconst kindToIcon = new Map([\n ['info', 'info'],\n ['success', 'check-circle'],\n ['warning', 'alert-triangle'],\n ['error', 'alert-circle'],\n ['base', 'bell'],\n]);\n\nexport default {\n name: 'DtNoticeIcon',\n\n components: {\n DtIcon,\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","_createVNode"],"mappings":";;;;;AAqBA,MAAM,aAAa,oBAAI,IAAI;AAAA,EACzB,CAAC,QAAQ,MAAM;AAAA,EACf,CAAC,WAAW,cAAc;AAAA,EAC1B,CAAC,WAAW,gBAAgB;AAAA,EAC5B,CAAC,SAAS,cAAc;AAAA,EACxB,CAAC,QAAQ,MAAM;AACjB,CAAC;AAED,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;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;;;EA1DI,eAAY;AAAA,EACZ,OAAM;;;;AAFA,SAAA,SAAA,eAAe,MAAA,eAAe,KAAA,OAAO,OAAO,KADpDA,aAAAC,mBAYM,OAZN,YAYM;AAAA,IANJC,WAKO,4BALP,MAKO;AAAA,MAJLC,YAGE,oBAAA;AAAA,QAFC,MAAM,SAAW;AAAA,QAClB,MAAK;AAAA;;;;;"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const vue3 = require("@dialpad/dialtone-icons/vue3");
|
|
3
2
|
const vue = require("vue");
|
|
4
3
|
const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.cjs");
|
|
5
4
|
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
|
-
|
|
11
|
-
DtIconChevronRight: vue3.DtIconChevronRight,
|
|
12
|
-
DtIconMoreHorizontal: vue3.DtIconMoreHorizontal
|
|
10
|
+
DtIcon: icon
|
|
13
11
|
},
|
|
14
12
|
props: {
|
|
15
13
|
/**
|
|
@@ -129,10 +127,8 @@ const _hoisted_2 = {
|
|
|
129
127
|
"data-qa": "dt-pagination-separator"
|
|
130
128
|
};
|
|
131
129
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
132
|
-
const
|
|
130
|
+
const _component_dt_icon = vue.resolveComponent("dt-icon");
|
|
133
131
|
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");
|
|
136
132
|
return vue.openBlock(), vue.createElementBlock("nav", {
|
|
137
133
|
"aria-label": $props.ariaLabel,
|
|
138
134
|
class: "d-pagination"
|
|
@@ -147,7 +143,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
147
143
|
onClick: _cache[0] || (_cache[0] = ($event) => $options.changePage($data.currentPage - 1))
|
|
148
144
|
}, {
|
|
149
145
|
icon: vue.withCtx(() => [
|
|
150
|
-
vue.createVNode(
|
|
146
|
+
vue.createVNode(_component_dt_icon, {
|
|
147
|
+
name: "chevron-left",
|
|
148
|
+
size: "300"
|
|
149
|
+
})
|
|
151
150
|
]),
|
|
152
151
|
_: 1
|
|
153
152
|
}, 8, ["aria-label", "kind", "importance", "disabled", "class"]),
|
|
@@ -157,7 +156,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
157
156
|
class: vue.normalizeClass({ "d-pagination__separator": isNaN(Number(page)) })
|
|
158
157
|
}, [
|
|
159
158
|
isNaN(Number(page)) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
160
|
-
vue.createVNode(
|
|
159
|
+
vue.createVNode(_component_dt_icon, {
|
|
160
|
+
name: "more-horizontal",
|
|
161
|
+
size: "300"
|
|
162
|
+
})
|
|
161
163
|
])) : (vue.openBlock(), vue.createBlock(_component_dt_button, {
|
|
162
164
|
key: 1,
|
|
163
165
|
"aria-label": $props.pageNumberAriaLabel(page),
|
|
@@ -183,7 +185,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
183
185
|
onClick: _cache[1] || (_cache[1] = ($event) => $options.changePage($data.currentPage + 1))
|
|
184
186
|
}, {
|
|
185
187
|
icon: vue.withCtx(() => [
|
|
186
|
-
vue.createVNode(
|
|
188
|
+
vue.createVNode(_component_dt_icon, {
|
|
189
|
+
name: "chevron-right",
|
|
190
|
+
size: "300"
|
|
191
|
+
})
|
|
187
192
|
]),
|
|
188
193
|
_: 1
|
|
189
194
|
}, 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\n name=\"chevron-left\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <div\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page}-${index}`\"\n :class=\"{ 'd-pagination__separator': isNaN(Number(page)) }\"\n >\n <!-- eslint-disable vue/no-bare-strings-in-template -->\n <div\n v-if=\"isNaN(Number(page))\"\n class=\"d-pagination__separator-icon\"\n data-qa=\"dt-pagination-separator\"\n >\n <dt-icon\n name=\"more-horizontal\"\n size=\"300\"\n />\n <!-- … -->\n </div>\n <!-- eslint-enable vue/no-bare-strings-in-template -->\n <dt-button\n v-else\n :aria-label=\"pageNumberAriaLabel(page)\"\n :kind=\"currentPage === page ? 'default' : 'muted'\"\n :importance=\"currentPage === page ? 'primary' : 'clear'\"\n label-class=\"\"\n @click=\"changePage(page)\"\n >\n {{ page }}\n </dt-button>\n </div>\n <dt-button\n class=\"d-pagination__button\"\n data-qa=\"dt-pagination-next\"\n :aria-label=\"nextAriaLabel\"\n :disabled=\"isLastPage\"\n kind=\"muted\"\n :importance=\"isLastPage ? 'primary' : 'clear'\"\n :class=\"isLastPage ? 'd-fc-black-300 d-bgc-transparent' : 'd-fc-tertiary'\"\n @click=\"changePage(currentPage + 1)\"\n >\n <template #icon>\n <dt-icon\n name=\"chevron-right\"\n size=\"300\"\n />\n </template>\n </dt-button>\n </nav>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\n\n/**\n * Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.\n * @see https://dialtone.dialpad.com/components/pagination.html\n */\nexport default {\n name: 'DtPagination',\n\n components: {\n DtButton,\n DtIcon,\n },\n\n props: {\n /**\n * Descriptive label for the pagination content.\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * The total number of the pages\n */\n totalPages: {\n type: Number,\n required: true,\n },\n\n /**\n * Descriptive label for the previous button.\n */\n prevAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * Descriptive label for the next button.\n */\n nextAriaLabel: {\n type: String,\n required: true,\n },\n\n /**\n * A method that will be called to get the aria label of each page.\n */\n pageNumberAriaLabel: {\n type: Function,\n required: true,\n },\n\n /**\n * The active current page in the list of pages, defaults to the first page\n */\n activePage: {\n type: Number,\n default: 1,\n },\n\n /**\n * Determines the max pages to be shown in the list. Using an odd number is recommended.\n * If an even number is given, then it will be rounded down to the nearest odd number to always\n * keep current page in the middle when current page is in the mid-range.\n */\n maxVisible: {\n type: Number,\n default: 5,\n },\n },\n\n emits: [\n /**\n * Page change event\n *\n * @event change\n * @type {Number}\n */\n 'change',\n ],\n\n data () {\n return {\n currentPage: this.activePage,\n };\n },\n\n computed: {\n isFirstPage () {\n return this.currentPage === 1;\n },\n\n isLastPage () {\n return this.currentPage === this.totalPages;\n },\n\n pages () {\n if (this.maxVisible === 0) {\n return [];\n }\n if (this.totalPages <= this.maxVisible) {\n return this.range(1, this.totalPages);\n }\n\n const start = this.maxVisible - 1;\n const end = this.totalPages - start + 1;\n\n if (this.currentPage < start) {\n return [...this.range(1, start), '...', this.totalPages];\n }\n\n if (this.currentPage > end) {\n return [1, '...', ...this.range(end, this.totalPages)];\n }\n\n // rounding to the nearest odd according to the maxlength to always show the page number in the middle.\n const total = this.maxVisible - (3 - this.maxVisible % 2);\n const centerIndex = Math.floor(total / 2);\n const left = this.currentPage - centerIndex;\n const right = this.currentPage + centerIndex;\n return [1, '...', ...this.range(left, right), '...', this.totalPages];\n },\n },\n\n methods: {\n range (from, to) {\n const range = [];\n from = from > 0 ? from : 1;\n for (let i = from; i <= to; i++) {\n range.push(i);\n }\n return range;\n },\n\n changePage (page) {\n this.currentPage = page;\n this.$emit('change', this.currentPage);\n },\n },\n};\n</script>\n"],"names":["DtButton","DtIcon","_createElementBlock","_createVNode","_normalizeClass","_openBlock","_Fragment","_renderList","_createBlock"],"mappings":";;;;;AA+EA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,UAAAA;AAAAA,IACA,QAAAC;AAAAA,EACD;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;AACb,aAAO,KAAK,gBAAgB;AAAA,IAC7B;AAAA,IAED,aAAc;AACZ,aAAO,KAAK,gBAAgB,KAAK;AAAA,IAClC;AAAA,IAED,QAAS;AACP,UAAI,KA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