@dialpad/dialtone-vue 4.10.0 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Combobox-DP8tbe6x.js → Combobox-BKj61IcR.js} +5 -5
- package/dist/{Combobox-DP8tbe6x.js.map → Combobox-BKj61IcR.js.map} +1 -1
- package/dist/Combobox-BOGcBq-6.cjs +3 -0
- package/dist/{Combobox-DdBIRmeH.cjs.map → Combobox-BOGcBq-6.cjs.map} +1 -1
- package/dist/{Datepicker-CNFVUyyK.js → Datepicker-DOSIyo8a.js} +39 -39
- package/dist/{Datepicker-CNFVUyyK.js.map → Datepicker-DOSIyo8a.js.map} +1 -1
- package/dist/Datepicker-DfdVsVb9.cjs +2 -0
- package/dist/{Datepicker-Df6uR0r_.cjs.map → Datepicker-DfdVsVb9.cjs.map} +1 -1
- package/dist/{EmojiPicker-B7AKJlAM.js → EmojiPicker-B_ZVTdOY.js} +2 -2
- package/dist/{EmojiPicker-B7AKJlAM.js.map → EmojiPicker-B_ZVTdOY.js.map} +1 -1
- package/dist/EmojiPicker-DS8XmAHV.cjs +2 -0
- package/dist/{EmojiPicker-KbIfc-GH.cjs.map → EmojiPicker-DS8XmAHV.cjs.map} +1 -1
- package/dist/FilterPill-BmYe_SsY.cjs +2 -0
- package/dist/{FilterPill-DwapR9JK.cjs.map → FilterPill-BmYe_SsY.cjs.map} +1 -1
- package/dist/{FilterPill-BR7FAmMG.js → FilterPill-C4TXD8Tl.js} +5 -5
- package/dist/{FilterPill-BR7FAmMG.js.map → FilterPill-C4TXD8Tl.js.map} +1 -1
- package/dist/{ForceLinkify-D4FBhBxD.cjs → ForceLinkify-BMmlUc8Q.cjs} +1 -1
- package/dist/{ForceLinkify-D4FBhBxD.cjs.map → ForceLinkify-BMmlUc8Q.cjs.map} +1 -1
- package/dist/{ForceLinkify-wTXS_wJS.js → ForceLinkify-Cw3Q1Nn7.js} +1 -1
- package/dist/{ForceLinkify-wTXS_wJS.js.map → ForceLinkify-Cw3Q1Nn7.js.map} +1 -1
- package/dist/{MarkdownRenderer-3CVbodrq.js → MarkdownRenderer-BR-fbldH.js} +1 -1
- package/dist/{MarkdownRenderer-3CVbodrq.js.map → MarkdownRenderer-BR-fbldH.js.map} +1 -1
- package/dist/{MarkdownRenderer-CaBjENW6.cjs → MarkdownRenderer-CH4L8Evn.cjs} +1 -1
- package/dist/{MarkdownRenderer-CaBjENW6.cjs.map → MarkdownRenderer-CH4L8Evn.cjs.map} +1 -1
- package/dist/{Presence-CGgyodnC.js → Presence-BkPCvddH.js} +2 -2
- package/dist/{Presence-CGgyodnC.js.map → Presence-BkPCvddH.js.map} +1 -1
- package/dist/{Presence-DLM3JR-n.cjs → Presence-DG9Kvu5J.cjs} +2 -2
- package/dist/{Presence-DLM3JR-n.cjs.map → Presence-DG9Kvu5J.cjs.map} +1 -1
- package/dist/ProgressBar-BMycZBZE.cjs +2 -0
- package/dist/ProgressBar-BMycZBZE.cjs.map +1 -0
- package/dist/ProgressBar-Cj8xqPc0.js +77 -0
- package/dist/ProgressBar-Cj8xqPc0.js.map +1 -0
- package/dist/{Resizable-F6PU5oKB.js → Resizable-BkijqucD.js} +3 -3
- package/dist/{Resizable-F6PU5oKB.js.map → Resizable-BkijqucD.js.map} +1 -1
- package/dist/{Resizable-BQsHIvDC.cjs → Resizable-DQoUk81S.cjs} +2 -2
- package/dist/{Resizable-BQsHIvDC.cjs.map → Resizable-DQoUk81S.cjs.map} +1 -1
- package/dist/{ResizableHandle-VBoudEYy.cjs → ResizableHandle-D2gZ6dg5.cjs} +2 -2
- package/dist/{ResizableHandle-VBoudEYy.cjs.map → ResizableHandle-D2gZ6dg5.cjs.map} +1 -1
- package/dist/{ResizableHandle-CqIIQvza.js → ResizableHandle-MDdaNR_t.js} +3 -3
- package/dist/{ResizableHandle-CqIIQvza.js.map → ResizableHandle-MDdaNR_t.js.map} +1 -1
- package/dist/{ResizableUtils-CZdVSd6q.cjs → ResizableUtils-CXU7o9pL.cjs} +1 -1
- package/dist/{ResizableUtils-CZdVSd6q.cjs.map → ResizableUtils-CXU7o9pL.cjs.map} +1 -1
- package/dist/{ResizableUtils-CrBOa8js.js → ResizableUtils-ChIk3Blc.js} +1 -1
- package/dist/{ResizableUtils-CrBOa8js.js.map → ResizableUtils-ChIk3Blc.js.map} +1 -1
- package/dist/{RichTextEditor-DLiJCPI6.js → RichTextEditor-BIcaFJQp.js} +15 -15
- package/dist/{RichTextEditor-DLiJCPI6.js.map → RichTextEditor-BIcaFJQp.js.map} +1 -1
- package/dist/RichTextEditor-D6kCBnLJ.cjs +11 -0
- package/dist/{RichTextEditor-ECmStZDK.cjs.map → RichTextEditor-D6kCBnLJ.cjs.map} +1 -1
- package/dist/{Scroller-D6f0HvIT.js → Scroller-D6LZtmkL.js} +3 -3
- package/dist/{Scroller-D6f0HvIT.js.map → Scroller-D6LZtmkL.js.map} +1 -1
- package/dist/Scroller-eXc7l23J.cjs +2 -0
- package/dist/{Scroller-EIHN3a26.cjs.map → Scroller-eXc7l23J.cjs.map} +1 -1
- package/dist/Slider-B7O2M5_S.cjs +2 -0
- package/dist/{Slider-BDgY7gNR.cjs.map → Slider-B7O2M5_S.cjs.map} +1 -1
- package/dist/{Slider-Bg9KspmL.js → Slider-oJROUIMS.js} +7 -7
- package/dist/{Slider-Bg9KspmL.js.map → Slider-oJROUIMS.js.map} +1 -1
- package/dist/Text-BDgOWPw7.cjs +2 -0
- package/dist/Text-BDgOWPw7.cjs.map +1 -0
- package/dist/{Text-5MobHF6z.js → Text-CfiPqjL0.js} +4 -4
- package/dist/Text-CfiPqjL0.js.map +1 -0
- package/dist/{TextList-1_ZM5zE3.cjs → TextList-D3HHK2DW.cjs} +1 -1
- package/dist/{TextList-1_ZM5zE3.cjs.map → TextList-D3HHK2DW.cjs.map} +1 -1
- package/dist/{TextList-DIj84CPZ.js → TextList-DXEov7Ls.js} +1 -1
- package/dist/{TextList-DIj84CPZ.js.map → TextList-DXEov7Ls.js.map} +1 -1
- package/dist/TextListItem-C2Vc8Gnu.cjs +2 -0
- package/dist/{TextListItem-CVjrHr2_.cjs.map → TextListItem-C2Vc8Gnu.cjs.map} +1 -1
- package/dist/{TextListItem-BhmijfFO.js → TextListItem-CaFTtZ3G.js} +2 -2
- package/dist/{TextListItem-BhmijfFO.js.map → TextListItem-CaFTtZ3G.js.map} +1 -1
- package/dist/{Toast-4nsu1oxP.js → Toast-AGiQccuG.js} +3 -3
- package/dist/{Toast-4nsu1oxP.js.map → Toast-AGiQccuG.js.map} +1 -1
- package/dist/Toast-DImJ0PkZ.cjs +2 -0
- package/dist/{Toast--W8p7jzA.cjs.map → Toast-DImJ0PkZ.cjs.map} +1 -1
- package/dist/{UseResizableCalculations-CahDXDOn.cjs → UseResizableCalculations-D4xVxWje.cjs} +2 -2
- package/dist/{UseResizableCalculations-CahDXDOn.cjs.map → UseResizableCalculations-D4xVxWje.cjs.map} +1 -1
- package/dist/{UseResizableCalculations-B-yTU9ZI.js → UseResizableCalculations-DTxD7NKO.js} +2 -2
- package/dist/{UseResizableCalculations-B-yTU9ZI.js.map → UseResizableCalculations-DTxD7NKO.js.map} +1 -1
- package/dist/common/composables/use-accessible-name-warning.cjs +2 -0
- package/dist/common/composables/use-accessible-name-warning.cjs.map +1 -0
- package/dist/common/composables/use-accessible-name-warning.js +11 -0
- package/dist/common/composables/use-accessible-name-warning.js.map +1 -0
- package/dist/common/composables/use-indicator-animation.cjs +1 -1
- package/dist/common/composables/use-indicator-animation.cjs.map +1 -1
- package/dist/common/composables/use-indicator-animation.js +14 -14
- package/dist/common/composables/use-indicator-animation.js.map +1 -1
- package/dist/common/composables/useAccessibleNameWarning.d.ts +2 -0
- package/dist/common/composables/useAccessibleNameWarning.d.ts.map +1 -0
- package/dist/common/composables/useIndicatorAnimation.d.ts +2 -1
- package/dist/common/composables/useIndicatorAnimation.d.ts.map +1 -1
- package/dist/common/dates/index.cjs +1 -1
- package/dist/common/dates/index.cjs.map +1 -1
- package/dist/common/dates/index.js +1 -1
- package/dist/common/mixins/input-group.cjs +1 -1
- package/dist/common/mixins/input-group.cjs.map +1 -1
- package/dist/common/mixins/input-group.js +5 -5
- package/dist/common/mixins/input.cjs +1 -1
- package/dist/common/mixins/input.cjs.map +1 -1
- package/dist/common/mixins/input.js +1 -1
- package/dist/common/mixins/keyboard-list-navigation.cjs +1 -1
- package/dist/common/mixins/keyboard-list-navigation.cjs.map +1 -1
- package/dist/common/mixins/keyboard-list-navigation.js +1 -1
- package/dist/common/mixins/modal.cjs +1 -1
- package/dist/common/mixins/modal.cjs.map +1 -1
- package/dist/common/mixins/modal.js +1 -1
- package/dist/common/mixins/mode.cjs +1 -1
- package/dist/common/mixins/mode.js +1 -1
- package/dist/common/owned_classes.d.ts +4 -0
- package/dist/common/owned_classes.d.ts.map +1 -0
- package/dist/common/utils/index.cjs +1 -2
- package/dist/common/utils/index.d.ts +2 -2
- package/dist/common/utils/index.d.ts.map +1 -1
- package/dist/common/utils/index.js +2 -150
- package/dist/component-documentation.json +1 -1
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts +1 -0
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPill.vue.d.ts +2 -0
- package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
- package/dist/components/Hovercard/Hovercard.vue.d.ts +4 -0
- package/dist/components/Hovercard/Hovercard.vue.d.ts.map +1 -1
- package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
- package/dist/components/Popover/Popover.vue.d.ts +1 -0
- package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.vue.d.ts +66 -0
- package/dist/components/ProgressBar/ProgressBar.vue.d.ts.map +1 -0
- package/dist/components/ProgressBar/ProgressBarConstants.d.ts +18 -0
- package/dist/components/ProgressBar/ProgressBarConstants.d.ts.map +1 -0
- package/dist/components/ProgressBar/index.d.ts +3 -0
- package/dist/components/ProgressBar/index.d.ts.map +1 -0
- package/dist/components/ProgressCircle/ProgressCircle.vue.d.ts +41 -9
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +1 -0
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControlItem.vue.d.ts +10 -0
- package/dist/components/SegmentedControl/SegmentedControlItem.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButton.vue.d.ts +1 -0
- package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
- package/dist/components/Tab/Tab.vue.d.ts +18 -0
- package/dist/components/Tab/Tab.vue.d.ts.map +1 -1
- package/dist/components/Tab/TabGroup.vue.d.ts +3 -1
- package/dist/components/Tab/TabGroup.vue.d.ts.map +1 -1
- package/dist/components/Text/modules/slide.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +51 -49
- package/dist/{floating-ui.dom-Cqf6X2Wc.js → floating-ui.dom-CuL5LTgX.js} +1 -1
- package/dist/{floating-ui.dom-Cqf6X2Wc.js.map → floating-ui.dom-CuL5LTgX.js.map} +1 -1
- package/dist/{floating-ui.dom-n1CheoWj.cjs → floating-ui.dom-S7QIcAlj.cjs} +1 -1
- package/dist/{floating-ui.dom-n1CheoWj.cjs.map → floating-ui.dom-S7QIcAlj.cjs.map} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/lib/avatar/avatar.cjs +1 -1
- package/dist/lib/avatar/avatar.cjs.map +1 -1
- package/dist/lib/avatar/avatar.js +7 -7
- package/dist/lib/badge/badge.cjs +1 -1
- package/dist/lib/badge/badge.cjs.map +1 -1
- package/dist/lib/badge/badge.js +2 -2
- package/dist/lib/banner/banner.cjs +1 -1
- package/dist/lib/banner/banner.cjs.map +1 -1
- package/dist/lib/banner/banner.js +2 -2
- package/dist/lib/breadcrumbs/breadcrumb-item.cjs +1 -1
- package/dist/lib/breadcrumbs/breadcrumb-item.cjs.map +1 -1
- package/dist/lib/breadcrumbs/breadcrumb-item.js +2 -2
- package/dist/lib/breadcrumbs/breadcrumbs.cjs +1 -1
- package/dist/lib/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/lib/button/button.cjs +1 -1
- package/dist/lib/button/button.cjs.map +1 -1
- package/dist/lib/button/button.js +6 -6
- package/dist/lib/button/button.js.map +1 -1
- package/dist/lib/button-group/button-group.cjs +1 -1
- package/dist/lib/button-group/button-group.js +1 -1
- package/dist/lib/button-group/buttons-decorator.cjs +1 -1
- package/dist/lib/button-group/buttons-decorator.js +1 -1
- package/dist/lib/card/card.cjs +1 -1
- package/dist/lib/card/card.cjs.map +1 -1
- package/dist/lib/card/card.js +2 -2
- package/dist/lib/checkbox/checkbox.cjs +1 -1
- package/dist/lib/checkbox/checkbox.cjs.map +1 -1
- package/dist/lib/checkbox/checkbox.js +5 -5
- package/dist/lib/checkbox-group/checkboxes-decorator.cjs +1 -1
- package/dist/lib/checkbox-group/checkboxes-decorator.js +1 -1
- package/dist/lib/chip/chip.cjs +1 -1
- package/dist/lib/chip/chip.cjs.map +1 -1
- package/dist/lib/chip/chip.js +4 -4
- package/dist/lib/codeblock/codeblock.cjs +1 -1
- package/dist/lib/codeblock/codeblock.js +1 -1
- package/dist/lib/collapsible/collapsible-lazy-show.cjs +1 -1
- package/dist/lib/collapsible/collapsible-lazy-show.js +1 -1
- package/dist/lib/collapsible/collapsible.cjs +1 -1
- package/dist/lib/collapsible/collapsible.cjs.map +1 -1
- package/dist/lib/collapsible/collapsible.js +4 -4
- package/dist/lib/combobox/combobox-empty-list.cjs +1 -1
- package/dist/lib/combobox/combobox-empty-list.js +1 -1
- package/dist/lib/combobox/combobox-loading-list.cjs +1 -1
- package/dist/lib/combobox/combobox-loading-list.js +1 -1
- package/dist/lib/combobox/combobox.cjs +1 -1
- package/dist/lib/combobox/combobox.js +1 -1
- package/dist/lib/combobox/index.cjs +1 -1
- package/dist/lib/combobox/index.js +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.js +8 -8
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.js +7 -7
- package/dist/lib/datepicker/datepicker.cjs +1 -1
- package/dist/lib/datepicker/datepicker.js +1 -1
- package/dist/lib/datepicker/index.cjs +1 -1
- package/dist/lib/datepicker/index.js +1 -1
- package/dist/lib/description-list/description-list.cjs +1 -1
- package/dist/lib/description-list/description-list.js +1 -1
- package/dist/lib/dropdown/dropdown-list.cjs +1 -1
- package/dist/lib/dropdown/dropdown-list.js +2 -2
- package/dist/lib/dropdown/dropdown-separator.cjs +1 -1
- package/dist/lib/dropdown/dropdown-separator.js +1 -1
- package/dist/lib/dropdown/dropdown.cjs +1 -1
- package/dist/lib/dropdown/dropdown.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown.js +3 -3
- package/dist/lib/dropdown/dropdown.js.map +1 -1
- package/dist/lib/emoji/emoji.cjs +1 -1
- package/dist/lib/emoji/emoji.js +1 -1
- package/dist/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/lib/emoji-picker/emoji-picker.js +1 -1
- package/dist/lib/emoji-picker/index.cjs +1 -1
- package/dist/lib/emoji-picker/index.js +1 -1
- package/dist/lib/empty-state/empty-state.cjs +1 -1
- package/dist/lib/empty-state/empty-state.cjs.map +1 -1
- package/dist/lib/empty-state/empty-state.js +2 -2
- package/dist/lib/filter-pill/filter-pill-controlled.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill-controlled.cjs.map +1 -1
- package/dist/lib/filter-pill/filter-pill-controlled.js +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill.js +1 -1
- package/dist/lib/filter-pill/index.cjs +1 -1
- package/dist/lib/filter-pill/index.js +1 -1
- package/dist/lib/hovercard/hovercard.cjs +1 -1
- package/dist/lib/hovercard/hovercard.cjs.map +1 -1
- package/dist/lib/hovercard/hovercard.js +2 -2
- package/dist/lib/icon/icon.cjs +1 -1
- package/dist/lib/icon/icon.js +1 -1
- package/dist/lib/image-viewer/image-viewer.cjs +1 -1
- package/dist/lib/image-viewer/image-viewer.cjs.map +1 -1
- package/dist/lib/image-viewer/image-viewer.js +2 -2
- package/dist/lib/input/input.cjs +1 -1
- package/dist/lib/input/input.cjs.map +1 -1
- package/dist/lib/input/input.js +8 -8
- package/dist/lib/input-group/input-group.cjs +1 -1
- package/dist/lib/input-group/input-group.cjs.map +1 -1
- package/dist/lib/input-group/input-group.js +5 -5
- package/dist/lib/item-layout/item-layout.cjs +2 -2
- package/dist/lib/item-layout/item-layout.cjs.map +1 -1
- package/dist/lib/item-layout/item-layout.js +2 -2
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.cjs +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.js +2 -2
- package/dist/lib/kitchen-sink/kitchen-sink-view.cjs +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.js +2 -2
- package/dist/lib/lazy-show/lazy-show.cjs +1 -1
- package/dist/lib/lazy-show/lazy-show.js +1 -1
- package/dist/lib/link/link.cjs +1 -1
- package/dist/lib/link/link.js +1 -1
- package/dist/lib/list-item/list-item.cjs +1 -1
- package/dist/lib/list-item/list-item.cjs.map +1 -1
- package/dist/lib/list-item/list-item.js +2 -2
- package/dist/lib/list-item-group/list-item-group.cjs +1 -1
- package/dist/lib/list-item-group/list-item-group.cjs.map +1 -1
- package/dist/lib/list-item-group/list-item-group.js +2 -2
- package/dist/lib/loader/loader.cjs +1 -1
- package/dist/lib/loader/loader.js +1 -1
- package/dist/lib/modal/modal.cjs +1 -1
- package/dist/lib/modal/modal.cjs.map +1 -1
- package/dist/lib/modal/modal.js +9 -9
- package/dist/lib/modal/modal.js.map +1 -1
- package/dist/lib/mode-directive/mode.cjs +1 -1
- package/dist/lib/mode-directive/mode.js +1 -1
- package/dist/lib/mode-island/mode-island.cjs +1 -1
- package/dist/lib/mode-island/mode-island.js +1 -1
- package/dist/lib/motion-text/motion-text.cjs +1 -1
- package/dist/lib/motion-text/motion-text.js +1 -1
- package/dist/lib/notice/notice-action.cjs +1 -1
- package/dist/lib/notice/notice-action.js +1 -1
- package/dist/lib/notice/notice-content.cjs +1 -1
- package/dist/lib/notice/notice-content.cjs.map +1 -1
- package/dist/lib/notice/notice-content.js +3 -3
- package/dist/lib/notice/notice-icon.cjs +1 -1
- package/dist/lib/notice/notice-icon.cjs.map +1 -1
- package/dist/lib/notice/notice-icon.js +2 -2
- package/dist/lib/notice/notice.cjs +1 -1
- package/dist/lib/notice/notice.js +1 -1
- package/dist/lib/pagination/pagination.cjs +1 -1
- package/dist/lib/pagination/pagination.js +1 -1
- package/dist/lib/popover/popover-header-footer.cjs +1 -1
- package/dist/lib/popover/popover-header-footer.cjs.map +1 -1
- package/dist/lib/popover/popover-header-footer.js +4 -4
- package/dist/lib/popover/popover.cjs +1 -1
- package/dist/lib/popover/popover.cjs.map +1 -1
- package/dist/lib/popover/popover.js +95 -82
- package/dist/lib/popover/popover.js.map +1 -1
- package/dist/lib/presence/index.cjs +1 -1
- package/dist/lib/presence/index.js +1 -1
- package/dist/lib/presence/presence.cjs +1 -1
- package/dist/lib/presence/presence.js +1 -1
- package/dist/lib/progress-bar/index.cjs +1 -0
- package/dist/lib/progress-bar/index.js +2 -0
- package/dist/lib/progress-bar/progress-bar.cjs +1 -0
- package/dist/lib/progress-bar/progress-bar.js +2 -0
- package/dist/lib/progress-circle/progress-circle.cjs +1 -1
- package/dist/lib/progress-circle/progress-circle.cjs.map +1 -1
- package/dist/lib/progress-circle/progress-circle.js +81 -42
- package/dist/lib/progress-circle/progress-circle.js.map +1 -1
- package/dist/lib/radio/radio.cjs +1 -1
- package/dist/lib/radio/radio.cjs.map +1 -1
- package/dist/lib/radio/radio.js +7 -7
- package/dist/lib/radio-group/radios-decorator.cjs +1 -1
- package/dist/lib/radio-group/radios-decorator.js +1 -1
- package/dist/lib/resizable/index.cjs +1 -1
- package/dist/lib/resizable/index.js +3 -3
- package/dist/lib/resizable/resizable-handle.cjs +1 -1
- package/dist/lib/resizable/resizable-handle.js +1 -1
- package/dist/lib/resizable/resizable-panel.cjs +1 -1
- package/dist/lib/resizable/resizable-panel.js +1 -1
- package/dist/lib/resizable/resizable.cjs +1 -1
- package/dist/lib/resizable/resizable.js +1 -1
- package/dist/lib/rich-text-editor/force-linkify.cjs +1 -1
- package/dist/lib/rich-text-editor/force-linkify.js +1 -1
- package/dist/lib/rich-text-editor/index.cjs +1 -1
- package/dist/lib/rich-text-editor/index.js +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.cjs +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.js +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/lib/root-layout/root-layout.cjs +1 -1
- package/dist/lib/root-layout/root-layout.js +1 -1
- package/dist/lib/scroller/index.cjs +1 -1
- package/dist/lib/scroller/index.js +1 -1
- package/dist/lib/scroller/scroller.cjs +1 -1
- package/dist/lib/scroller/scroller.js +1 -1
- package/dist/lib/segmented-control/segmented-control-item.cjs +1 -1
- package/dist/lib/segmented-control/segmented-control-item.cjs.map +1 -1
- package/dist/lib/segmented-control/segmented-control-item.js +34 -4
- package/dist/lib/segmented-control/segmented-control-item.js.map +1 -1
- package/dist/lib/segmented-control/segmented-control.cjs +1 -1
- package/dist/lib/segmented-control/segmented-control.cjs.map +1 -1
- package/dist/lib/segmented-control/segmented-control.js +1 -1
- package/dist/lib/select-menu/select-menu.cjs +1 -1
- package/dist/lib/select-menu/select-menu.cjs.map +1 -1
- package/dist/lib/select-menu/select-menu.js +8 -8
- package/dist/lib/skeleton/skeleton-list-item.cjs +1 -1
- package/dist/lib/skeleton/skeleton-list-item.js +1 -1
- package/dist/lib/skeleton/skeleton-paragraph.cjs +1 -1
- package/dist/lib/skeleton/skeleton-paragraph.js +1 -1
- package/dist/lib/skeleton/skeleton-shape.cjs +1 -1
- package/dist/lib/skeleton/skeleton-shape.js +1 -1
- package/dist/lib/skeleton/skeleton-text.cjs +1 -1
- package/dist/lib/skeleton/skeleton-text.js +1 -1
- package/dist/lib/skeleton/skeleton.cjs +1 -1
- package/dist/lib/skeleton/skeleton.js +1 -1
- package/dist/lib/slider/index.cjs +1 -1
- package/dist/lib/slider/index.js +1 -1
- package/dist/lib/slider/slider.cjs +1 -1
- package/dist/lib/slider/slider.js +1 -1
- package/dist/lib/split-button/split-button-end.cjs +1 -1
- package/dist/lib/split-button/split-button-end.cjs.map +1 -1
- package/dist/lib/split-button/split-button-end.js +2 -2
- package/dist/lib/split-button/split-button-start.cjs +1 -1
- package/dist/lib/split-button/split-button-start.js +1 -1
- package/dist/lib/split-button/split-button.cjs +1 -1
- package/dist/lib/split-button/split-button.cjs.map +1 -1
- package/dist/lib/split-button/split-button.js +5 -5
- package/dist/lib/stack/stack.cjs +1 -1
- package/dist/lib/stack/stack.js +1 -1
- package/dist/lib/tab/tab-group.cjs +1 -1
- package/dist/lib/tab/tab-group.cjs.map +1 -1
- package/dist/lib/tab/tab-group.js +12 -4
- package/dist/lib/tab/tab-group.js.map +1 -1
- package/dist/lib/tab/tab-panel.cjs +1 -1
- package/dist/lib/tab/tab-panel.cjs.map +1 -1
- package/dist/lib/tab/tab-panel.js +2 -2
- package/dist/lib/tab/tab.cjs +1 -1
- package/dist/lib/tab/tab.cjs.map +1 -1
- package/dist/lib/tab/tab.js +36 -6
- package/dist/lib/tab/tab.js.map +1 -1
- package/dist/lib/text/index.cjs +1 -1
- package/dist/lib/text/index.js +1 -1
- package/dist/lib/text/text.cjs +1 -1
- package/dist/lib/text/text.js +1 -1
- package/dist/lib/text-list/index.cjs +1 -1
- package/dist/lib/text-list/index.js +2 -2
- package/dist/lib/text-list/text-list-item.cjs +1 -1
- package/dist/lib/text-list/text-list-item.js +1 -1
- package/dist/lib/text-list/text-list.cjs +1 -1
- package/dist/lib/text-list/text-list.js +1 -1
- package/dist/lib/toast/index.cjs +1 -1
- package/dist/lib/toast/index.js +1 -1
- package/dist/lib/toast/toast.cjs +1 -1
- package/dist/lib/toast/toast.js +1 -1
- package/dist/lib/toggle/toggle.cjs +1 -1
- package/dist/lib/toggle/toggle.cjs.map +1 -1
- package/dist/lib/toggle/toggle.js +4 -4
- package/dist/lib/tooltip/tooltip.cjs +1 -1
- package/dist/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip/tooltip.js +6 -6
- package/dist/lib/tooltip/tooltip.js.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.js +2 -2
- package/dist/lib/validation-messages/validation-messages.cjs +1 -1
- package/dist/lib/validation-messages/validation-messages.cjs.map +1 -1
- package/dist/lib/validation-messages/validation-messages.js +4 -4
- package/dist/{mode_constants-tb7TL85q.js → mode_constants-B8_1b5T8.js} +1 -1
- package/dist/{mode_constants-tb7TL85q.js.map → mode_constants-B8_1b5T8.js.map} +1 -1
- package/dist/{mode_constants-CzYJW9ua.cjs → mode_constants-DM0SVbFM.cjs} +1 -1
- package/dist/{mode_constants-CzYJW9ua.cjs.map → mode_constants-DM0SVbFM.cjs.map} +1 -1
- package/dist/shared/sr_only_close_button.cjs +1 -1
- package/dist/shared/sr_only_close_button.js +1 -1
- package/dist/utils-BL_SrwnF.js +172 -0
- package/dist/utils-BL_SrwnF.js.map +1 -0
- package/dist/utils-GofHWJKi.cjs +2 -0
- package/dist/{common/utils/index.js.map → utils-GofHWJKi.cjs.map} +1 -1
- package/package.json +6 -6
- package/dist/Combobox-DdBIRmeH.cjs +0 -3
- package/dist/Datepicker-Df6uR0r_.cjs +0 -2
- package/dist/EmojiPicker-KbIfc-GH.cjs +0 -2
- package/dist/FilterPill-DwapR9JK.cjs +0 -2
- package/dist/RichTextEditor-ECmStZDK.cjs +0 -11
- package/dist/Scroller-EIHN3a26.cjs +0 -2
- package/dist/Slider-BDgY7gNR.cjs +0 -2
- package/dist/Text-5MobHF6z.js.map +0 -1
- package/dist/Text-DNVNZree.cjs +0 -2
- package/dist/Text-DNVNZree.cjs.map +0 -1
- package/dist/TextListItem-CVjrHr2_.cjs +0 -2
- package/dist/Toast--W8p7jzA.cjs +0 -2
- package/dist/common/utils/index.cjs.map +0 -1
- /package/dist/{_plugin-vue_export-helper-BTgDAbhb.js → _plugin-vue_export-helper-BecorN_g.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-D8jCH6HB.cjs → _plugin-vue_export-helper-CX7YVcP6.cjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.cjs","names":[],"sources":["../../../components/Modal/Modal.vue"],"sourcesContent":["<template>\n <teleport\n :disabled=\"!appendTo && !autoTeleportTarget\"\n :to=\"appendTo || autoTeleportTarget\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <dialog\n ref=\"dialogEl\"\n v-dt-focustrap=\"{ active: open, initialFocus: false, restoreFocus: false }\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n { 'd-modal--full': fullscreen },\n { 'd-modal--transparent-backdrop': transparentBackdrop },\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-modal=\"modal ? 'true' : undefined\"\n :aria-describedby=\"describedById || undefined\"\n :aria-labelledby=\"labelledById\"\n v-bind=\"modeAttrs\"\n @cancel.prevent=\"close\"\n @mousedown=\"onBackdropMousedown\"\n @mouseup=\"onBackdropMouseup\"\n @click=\"onBackdropClick\"\n @keydown=\"onKeydown\"\n >\n <div\n v-if=\"open && (hasSlotContent($slots.banner) || bannerHeaderText)\"\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 bannerHeaderText prop -->\n <slot name=\"banner\">\n {{ bannerHeaderText }}\n </slot>\n </div>\n <transition\n :appear=\"open\"\n name=\"d-modal__dialog\"\n @after-enter=\"onAfterEnter\"\n @after-leave=\"onAfterLeave\"\n >\n <div\n v-show=\"open\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"headerText\" text prop -->\n <slot name=\"header\" />\n </div>\n <dt-text\n v-else\n :id=\"labelledById\"\n kind=\"headline\"\n :size=\"600\"\n strength=\"medium\"\n density=\"100\"\n text-box-trim=\"start\"\n as=\"h2\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n {{ headerText }}\n </dt-text>\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', footerClass]\"\n data-qa=\"dt-modal-footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <sr-only-close-button\n v-if=\"!showClose\"\n @close=\"close\"\n />\n <dt-button\n v-else\n class=\"d-modal__close\"\n data-qa=\"dt-modal-close-button\"\n :size=\"300\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon=\"{ iconSize }\">\n <dt-icon-close\n :size=\"iconSize\"\n />\n </template>\n </dt-button>\n </div>\n </transition>\n </dialog>\n </teleport>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/Button';\nimport { DtText } from '@/components/Text';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport ModeMixin from '@/common/mixins/mode';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n} from './ModalConstants';\nimport { getUniqueString, hasSlotContent, returnFirstEl, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/Notice';\nimport { DialtoneLocalization } from '@/localization';\n\nconst focusableSelector = 'button:not(:disabled),[href],input:not(:disabled),select:not(:disabled),' +\n 'textarea:not(:disabled),details,[tabindex]:not([tabindex=\"-1\"]):not(:disabled):not([aria-disabled=\"true\"])';\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 DtButton,\n DtText,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [ModeMixin],\n\n props: {\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 open: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Header text to display in the modal header.\n */\n headerText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Header text to display in the modal banner.\n */\n bannerHeaderText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The theme of the modal.\n * @values default, critical\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Whether the modal fills the viewport instead of rendering at its default size.\n * @values true, false\n */\n fullscreen: {\n type: Boolean,\n default: false,\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, critical, info, positive, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validator (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 * Additional class name for the header 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 headerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the footer 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 footerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Shows the close button on the modal\n * @values true, false\n */\n showClose: {\n type: Boolean,\n default: true,\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, HTML_ELEMENT_TYPE],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * A CSS selector string for the element to portal the modal to. If not provided, the modal will be rendered in its default location.\n */\n appendTo: {\n type: String,\n default: undefined,\n },\n\n /**\n * When true, the surrounding backdrop is rendered fully transparent\n * instead of the default dimming overlay. The dialog box itself\n * remains opaque. Useful when the underlying UI should remain visible.\n * @values true, false\n */\n transparentBackdrop: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, the dialog opens with showModal(), which promotes it to the browser\n * top layer. Nothing outside the top layer can paint above it regardless of\n * z-index, so application surfaces such as toasts and call notifications end up\n * behind it. When false, it opens with show() and stays in the normal stacking\n * order, where the Dialtone z-index scale applies and --zi-notification (700)\n * outranks --zi-modal (600) as documented.\n *\n * Focus trapping, scroll locking and Esc-to-close behave identically in both\n * modes. Background inertness does not: only the top layer provides it, so with\n * modal unset the page outside the dialog stays reachable. That is deliberate —\n * it is what lets an application's own overlays remain usable above a modal —\n * and keyboard containment still comes from the focus trap.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native 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:open\n * @type {Boolean}\n */\n 'update:open',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_BANNER_KINDS,\n hasSlotContent,\n i18n: new DialtoneLocalization(),\n autoTeleportTarget: null,\n mousedownOnBackdrop: false,\n mouseupOnBackdrop: false,\n };\n },\n\n computed: {\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n watch: {\n open (isShowing) {\n this.syncDialogState(isShowing);\n },\n },\n\n mounted () {\n if (!this.appendTo) {\n const root = this.$el?.getRootNode();\n if (root instanceof ShadowRoot) {\n this.autoTeleportTarget = root;\n // Defer syncDialogState so the teleport renders inside the shadow root first.\n if (this.open) this.$nextTick(() => { if (this.open) this.syncDialogState(true); });\n return;\n }\n }\n if (this.open) {\n this.syncDialogState(true);\n }\n },\n\n beforeUnmount () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) {\n dialogEl.close();\n enableRootScrolling(this.getScrollRoot());\n }\n this.previousActiveElement = null;\n },\n\n methods: {\n // Reads $slots, which is not reactive, so it must not be cached as a computed.\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n getScrollRoot () {\n return returnFirstEl(this.$refs.dialogEl)?.getRootNode()?.host;\n },\n\n syncDialogState (isShowing) {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n if (isShowing) {\n this.previousActiveElement = document.activeElement;\n if (!dialogEl.open) {\n // show() leaves the dialog in the normal stacking order instead of the\n // top layer, where the z-index scale still applies.\n if (this.modal) dialogEl.showModal(); else dialogEl.show();\n }\n disableRootScrolling(this.getScrollRoot());\n } else if (dialogEl.open) {\n // Leave transition plays via v-show on inner content.\n // close() is called in onAfterLeave when transition completes.\n enableRootScrolling(this.getScrollRoot());\n }\n },\n\n\n\n close () {\n this.$emit('update:open', false);\n },\n\n onBackdropMousedown (event) {\n this.mousedownOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropMouseup (event) {\n this.mouseupOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropClick (event) {\n const pressedAndReleasedOnBackdrop = this.mousedownOnBackdrop && this.mouseupOnBackdrop;\n if (this.closeOnClick && event.target === event.currentTarget && pressedAndReleasedOnBackdrop) {\n this.close();\n }\n this.$emit('click', event);\n },\n\n onKeydown (event) {\n // The native cancel event only fires for dialogs opened with showModal(), so\n // Esc has to be handled explicitly to keep dismissal identical in both modes.\n // defaultPrevented means a nested widget (dropdown, combobox) already consumed\n // it to close itself, and the modal must not close out from under it.\n if (!this.modal && event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault();\n this.close();\n }\n this.$emit('keydown', event);\n },\n\n async onAfterEnter () {\n this.$emit('update:open', true);\n await this.setFocusAfterTransition();\n },\n\n onAfterLeave () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) {\n dialogEl.close();\n }\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n },\n\n focusFirstTabbable (container) {\n const focusable = [...container.querySelectorAll(focusableSelector)];\n if (!focusable.length) return;\n let target = focusable[0];\n // If first focusable is an unchecked radio, prefer the checked radio in the same group.\n if (target.matches('[type=\"radio\"]:not(:checked)')) {\n target = focusable.find(el => el.checked && el.name === target.name) || target;\n }\n target.focus({ preventScroll: true });\n },\n\n async setFocusAfterTransition () {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n await this.$nextTick();\n\n if (this.initialFocusElement === 'first') {\n this.focusFirstTabbable(dialogEl);\n } else if (typeof this.initialFocusElement === 'string' && this.initialFocusElement.startsWith('#')) {\n const el = dialogEl.querySelector(this.initialFocusElement);\n if (el) {\n el.focus();\n } else {\n // eslint-disable-next-line no-console\n console.warn('Could not find the element specified in dt-modal prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the first element.');\n this.focusFirstTabbable(dialogEl);\n }\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n },\n};\n</script>\n"],"mappings":"snBAsJA,IAAM,EAAoB,qLAQrB,EAAU,CACb,KAAM,UAEN,WAAY,CACV,SAAA,EAAA,QACA,OAAA,EAAA,EACA,YAAA,EAAA,YACA,kBAAA,EAAA,QACD,CAED,OAAQ,CAAC,EAAA,QAAU,CAEnB,MAAO,CAIL,KAAM,CACJ,KAAM,OACN,QAAS,GACV,CAOD,cAAe,CACb,KAAM,OACN,QAAS,GACV,CAKD,aAAc,CACZ,KAAM,OACN,QAAS,UAAY,CAAE,OAAO,EAAA,iBAAiB,EAChD,CAOD,KAAM,CACJ,KAAM,QACN,QAAS,GACV,CAKD,WAAY,CACV,KAAM,OACN,QAAS,IAAA,GACV,CAKD,iBAAkB,CAChB,KAAM,OACN,QAAS,IAAA,GACV,CAMD,KAAM,CACJ,KAAM,OACN,QAAS,UACT,UAAY,GAAM,OAAO,KAAK,EAAA,qBAAqB,CAAC,SAAS,EAAE,CAChE,CAMD,WAAY,CACV,KAAM,QACN,QAAS,GACV,CAOD,WAAY,CACV,KAAM,CAAC,OAAQ,OAAQ,MAAM,CAC7B,QAAS,GACV,CAOD,YAAa,CACX,KAAM,CAAC,OAAQ,OAAQ,MAAM,CAC7B,QAAS,GACV,CAOD,aAAc,CACZ,KAAM,CAAC,OAAQ,OAAQ,MAAM,CAC7B,QAAS,GACV,CAMD,WAAY,CACV,KAAM,OACN,QAAS,UACT,UAAW,EAAM,CACf,OAAO,EAAA,aAAa,SAAS,EAAK,EAErC,CAOD,YAAa,CACX,KAAM,CAAC,OAAQ,OAAQ,MAAM,CAC7B,QAAS,GACV,CAOD,YAAa,CACX,KAAM,CAAC,OAAQ,OAAQ,MAAM,CAC7B,QAAS,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AA,YAAA,EAAA,EAAA,EAAA,oBAS/B,MAAA,OARH,OAAA,EAAA,EAAA,gBAAK,CAAA,mBAAoD,EAAA,aAAA,CAAA,CAI1D,UAAQ,mCAGA,EAAA,OAAA,UAAA,CAAA,CAAA,EAAA,IAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAWN,IAAA,OAPD,OAAA,EAAA,EAAA,gBAAK,CAAA,mBAAoD,EAAA,aAAA,CAAA,CAI1D,UAAQ,uCAEL,EAAA,KAAI,CAAA,EAAA,EAGD,EAAA,eAAa,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAMZ,SAAA,OALN,OAAA,EAAA,EAAA,gBAAK,CAAA,kBAAsB,EAAA,YAAW,CAAA,CACvC,UAAQ,qCAGc,EAAA,OAAA,SAAA,CAAA,CAAA,EAAA,GAAA,EAAA,EAAA,oBAAA,GAAA,GAAA,CAGf,EAAA,+CAmBG,EAAA,OAdV,MAAM,iBACN,UAAQ,wBACP,KAAM,IACP,KAAK,QACL,WAAW,QACV,aAAY,EAAA,iBACZ,MAAO,EAAA,iBACP,QAAO,EAAA,QAEG,MAAA,EAAA,EAAA,UAGP,CAHe,cAAQ,EAAA,EAAA,EAAA,aAGvB,EAAA,CADC,KAAM,EAAQ,CAAA,KAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA,6CAhBZ,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAEP,EAAA,OADC,QAAO,EAAA,0CA7DF,EAAA,KAAI,CAAA,CAAA,CAAA,CAAA,sEAxCU,EAAA,KAAI,aAAA,GAAA,aAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,WAAA,KAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"modal.cjs","names":[],"sources":["../../../components/Modal/Modal.vue"],"sourcesContent":["<template>\n <teleport\n :disabled=\"!appendTo && !autoTeleportTarget\"\n :to=\"appendTo || autoTeleportTarget\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <dialog\n ref=\"dialogEl\"\n v-dt-focustrap=\"{ active: open, initialFocus: false, restoreFocus: false }\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n { 'd-modal--full': fullscreen },\n { 'd-modal--transparent-backdrop': transparentBackdrop },\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-modal=\"modal ? 'true' : undefined\"\n :aria-describedby=\"describedById || undefined\"\n :aria-labelledby=\"labelledById\"\n v-bind=\"modeAttrs\"\n @cancel.prevent=\"close\"\n @mousedown=\"onBackdropMousedown\"\n @mouseup=\"onBackdropMouseup\"\n @click=\"onBackdropClick\"\n @keydown=\"onKeydown\"\n >\n <div\n v-if=\"open && (hasSlotContent($slots.banner) || bannerHeaderText)\"\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 bannerHeaderText prop -->\n <slot name=\"banner\">\n {{ bannerHeaderText }}\n </slot>\n </div>\n <transition\n :appear=\"open\"\n name=\"d-modal__dialog\"\n @after-enter=\"onAfterEnter\"\n @after-leave=\"onAfterLeave\"\n >\n <div\n v-show=\"open\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"headerText\" text prop -->\n <slot name=\"header\" />\n </div>\n <dt-text\n v-else\n :id=\"labelledById\"\n kind=\"headline\"\n :size=\"600\"\n strength=\"medium\"\n density=\"100\"\n text-box-trim=\"start\"\n as=\"h2\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n {{ headerText }}\n </dt-text>\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', footerClass]\"\n data-qa=\"dt-modal-footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <sr-only-close-button\n v-if=\"!showClose\"\n @close=\"close\"\n />\n <dt-button\n v-else\n class=\"d-modal__close\"\n data-qa=\"dt-modal-close-button\"\n :size=\"300\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon=\"{ iconSize }\">\n <dt-icon-close\n :size=\"iconSize\"\n />\n </template>\n </dt-button>\n </div>\n </transition>\n </dialog>\n </teleport>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/Button';\nimport { DtText } from '@/components/Text';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport ModeMixin from '@/common/mixins/mode';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n} from './ModalConstants';\nimport { getUniqueString, hasSlotContent, returnFirstEl, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/Notice';\nimport { DialtoneLocalization } from '@/localization';\n\nconst focusableSelector = 'button:not(:disabled),[href],input:not(:disabled),select:not(:disabled),' +\n 'textarea:not(:disabled),details,[tabindex]:not([tabindex=\"-1\"]):not(:disabled):not([aria-disabled=\"true\"])';\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 DtButton,\n DtText,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [ModeMixin],\n\n props: {\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 open: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Header text to display in the modal header.\n */\n headerText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Header text to display in the modal banner.\n */\n bannerHeaderText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The theme of the modal.\n * @values default, critical\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Whether the modal fills the viewport instead of rendering at its default size.\n * @values true, false\n */\n fullscreen: {\n type: Boolean,\n default: false,\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, critical, info, positive, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validator (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 * Additional class name for the header 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 headerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the footer 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 footerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Shows the close button on the modal\n * @values true, false\n */\n showClose: {\n type: Boolean,\n default: true,\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, HTML_ELEMENT_TYPE],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * A CSS selector string for the element to portal the modal to. If not provided, the modal will be rendered in its default location.\n */\n appendTo: {\n type: String,\n default: undefined,\n },\n\n /**\n * When true, the surrounding backdrop is rendered fully transparent\n * instead of the default dimming overlay. The dialog box itself\n * remains opaque. Useful when the underlying UI should remain visible.\n * @values true, false\n */\n transparentBackdrop: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, the dialog opens with showModal(), which promotes it to the browser\n * top layer. Nothing outside the top layer can paint above it regardless of\n * z-index, so application surfaces such as toasts and call notifications end up\n * behind it. When false, it opens with show() and stays in the normal stacking\n * order, where the Dialtone z-index scale applies and --zi-notification (700)\n * outranks --zi-modal (600) as documented.\n *\n * Focus trapping, scroll locking and Esc-to-close behave identically in both\n * modes. Background inertness does not: only the top layer provides it, so with\n * modal unset the page outside the dialog stays reachable. That is deliberate —\n * it is what lets an application's own overlays remain usable above a modal —\n * and keyboard containment still comes from the focus trap.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native 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:open\n * @type {Boolean}\n */\n 'update:open',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_BANNER_KINDS,\n hasSlotContent,\n i18n: new DialtoneLocalization(),\n autoTeleportTarget: null,\n mousedownOnBackdrop: false,\n mouseupOnBackdrop: false,\n };\n },\n\n computed: {\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n watch: {\n open (isShowing) {\n this.syncDialogState(isShowing);\n },\n },\n\n mounted () {\n if (!this.appendTo) {\n const root = this.$el?.getRootNode();\n if (root instanceof ShadowRoot) {\n this.autoTeleportTarget = root;\n // Defer syncDialogState so the teleport renders inside the shadow root first.\n if (this.open) this.$nextTick(() => { if (this.open) this.syncDialogState(true); });\n return;\n }\n }\n if (this.open) {\n this.syncDialogState(true);\n }\n },\n\n beforeUnmount () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) dialogEl.close();\n enableRootScrolling(this._scrollLockRoot, this);\n this.previousActiveElement = null;\n },\n\n methods: {\n // Reads $slots, which is not reactive, so it must not be cached as a computed.\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n getScrollRoot () {\n return returnFirstEl(this.$refs.dialogEl)?.getRootNode()?.host;\n },\n\n syncDialogState (isShowing) {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n if (isShowing) {\n this.previousActiveElement = document.activeElement;\n if (!dialogEl.open) {\n // show() leaves the dialog in the normal stacking order instead of the\n // top layer, where the z-index scale still applies.\n if (this.modal) dialogEl.showModal(); else dialogEl.show();\n }\n // Release from the root locked here, even if the dialog has since been teleported elsewhere.\n this._scrollLockRoot = this.getScrollRoot();\n disableRootScrolling(this._scrollLockRoot, this);\n } else {\n // Leave transition plays via v-show on inner content.\n // close() is called in onAfterLeave when transition completes.\n // Release even if the dialog was already closed natively (e.g. a method=\"dialog\" form).\n enableRootScrolling(this._scrollLockRoot, this);\n }\n },\n\n\n\n close () {\n this.$emit('update:open', false);\n },\n\n onBackdropMousedown (event) {\n this.mousedownOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropMouseup (event) {\n this.mouseupOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropClick (event) {\n const pressedAndReleasedOnBackdrop = this.mousedownOnBackdrop && this.mouseupOnBackdrop;\n if (this.closeOnClick && event.target === event.currentTarget && pressedAndReleasedOnBackdrop) {\n this.close();\n }\n this.$emit('click', event);\n },\n\n onKeydown (event) {\n // The native cancel event only fires for dialogs opened with showModal(), so\n // Esc has to be handled explicitly to keep dismissal identical in both modes.\n // defaultPrevented means a nested widget (dropdown, combobox) already consumed\n // it to close itself, and the modal must not close out from under it.\n if (!this.modal && event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault();\n this.close();\n }\n this.$emit('keydown', event);\n },\n\n async onAfterEnter () {\n this.$emit('update:open', true);\n await this.setFocusAfterTransition();\n },\n\n onAfterLeave () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) {\n dialogEl.close();\n }\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n },\n\n focusFirstTabbable (container) {\n const focusable = [...container.querySelectorAll(focusableSelector)];\n if (!focusable.length) return;\n let target = focusable[0];\n // If first focusable is an unchecked radio, prefer the checked radio in the same group.\n if (target.matches('[type=\"radio\"]:not(:checked)')) {\n target = focusable.find(el => el.checked && el.name === target.name) || target;\n }\n target.focus({ preventScroll: true });\n },\n\n async setFocusAfterTransition () {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n await this.$nextTick();\n\n if (this.initialFocusElement === 'first') {\n this.focusFirstTabbable(dialogEl);\n } else if (typeof this.initialFocusElement === 'string' && this.initialFocusElement.startsWith('#')) {\n const el = dialogEl.querySelector(this.initialFocusElement);\n if (el) {\n el.focus();\n } else {\n // eslint-disable-next-line no-console\n console.warn('Could not find the element specified in dt-modal prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the first element.');\n this.focusFirstTabbable(dialogEl);\n }\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n },\n};\n</script>\n"],"mappings":"knBAsJA,IAAM,EAAoB,qLAQrB,EAAU,CACb,KAAM,UAEN,WAAY,CACV,SAAA,EAAA,QACA,OAAA,EAAA,EACA,YAAA,EAAA,YACA,kBAAA,EAAA,QACD,CAED,OAAQ,CAAC,EAAA,QAAU,CAEnB,MAAO,CAIL,KAAM,CACJ,KAAM,OACN,QAAS,GACV,CAOD,cAAe,CACb,KAAM,OACN,QAAS,GACV,CAKD,aAAc,CACZ,KAAM,OACN,QAAS,UAAY,CAAE,OAAO,EAAA,GAAiB,EAChD,CAOD,KAAM,CACJ,KAAM,QACN,QAAS,GACV,CAKD,WAAY,CACV,KAAM,OACN,QAAS,IAAA,GACV,CAKD,iBAAkB,CAChB,KAAM,OACN,QAAS,IAAA,GACV,CAMD,KAAM,CACJ,KAAM,OACN,QAAS,UACT,UAAY,GAAM,O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AA,QAEG,MAAA,EAAA,EAAA,UAGP,CAHe,cAAQ,EAAA,EAAA,EAAA,aAGvB,EAAA,CADC,KAAM,EAAQ,CAAA,KAAA,EAAA,CAAA,OAAA,CAAA,CAAA,CAAA,6CAhBZ,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,aAEP,EAAA,OADC,QAAO,EAAA,0CA7DF,EAAA,KAAI,CAAA,CAAA,CAAA,CAAA,sEAxCU,EAAA,KAAI,aAAA,GAAA,aAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,WAAA,KAAA,CAAA"}
|
package/dist/lib/modal/modal.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { HTML_ELEMENT_TYPE as e } from "../../common/constants/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as o } from "../../_plugin-vue_export-helper-
|
|
2
|
+
import { O as t, _ as n, i as r, m as i, r as a } from "../../utils-BL_SrwnF.js";
|
|
3
|
+
import { t as o } from "../../_plugin-vue_export-helper-BecorN_g.js";
|
|
4
4
|
import s from "../../common/mixins/mode.js";
|
|
5
5
|
import { NOTICE_KINDS as c } from "../notice/notice-constants.js";
|
|
6
|
-
import { t as l } from "../../Text-
|
|
6
|
+
import { t as l } from "../../Text-CfiPqjL0.js";
|
|
7
7
|
import { DialtoneLocalization as u } from "../../localization/index.js";
|
|
8
8
|
import d from "../button/button.js";
|
|
9
9
|
import f from "../../shared/sr_only_close_button.js";
|
|
@@ -32,7 +32,7 @@ var F = "button:not(:disabled),[href],input:not(:disabled),select:not(:disabled)
|
|
|
32
32
|
labelledById: {
|
|
33
33
|
type: String,
|
|
34
34
|
default: function() {
|
|
35
|
-
return
|
|
35
|
+
return i();
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
open: {
|
|
@@ -150,7 +150,7 @@ var F = "button:not(:disabled),[href],input:not(:disabled),select:not(:disabled)
|
|
|
150
150
|
return {
|
|
151
151
|
MODAL_KIND_MODIFIERS: m,
|
|
152
152
|
MODAL_BANNER_KINDS: p,
|
|
153
|
-
hasSlotContent:
|
|
153
|
+
hasSlotContent: n,
|
|
154
154
|
i18n: new u(),
|
|
155
155
|
autoTeleportTarget: null,
|
|
156
156
|
mousedownOnBackdrop: !1,
|
|
@@ -182,18 +182,18 @@ var F = "button:not(:disabled),[href],input:not(:disabled),select:not(:disabled)
|
|
|
182
182
|
},
|
|
183
183
|
beforeUnmount() {
|
|
184
184
|
let e = this.$refs.dialogEl;
|
|
185
|
-
e?.open &&
|
|
185
|
+
e?.open && e.close(), r(this._scrollLockRoot, this), this.previousActiveElement = null;
|
|
186
186
|
},
|
|
187
187
|
methods: {
|
|
188
188
|
hasFooterSlot() {
|
|
189
189
|
return !!this.$slots.footer;
|
|
190
190
|
},
|
|
191
191
|
getScrollRoot() {
|
|
192
|
-
return
|
|
192
|
+
return t(this.$refs.dialogEl)?.getRootNode()?.host;
|
|
193
193
|
},
|
|
194
194
|
syncDialogState(e) {
|
|
195
|
-
let
|
|
196
|
-
|
|
195
|
+
let t = this.$refs.dialogEl;
|
|
196
|
+
t && (e ? (this.previousActiveElement = document.activeElement, t.open || (this.modal ? t.showModal() : t.show()), this._scrollLockRoot = this.getScrollRoot(), a(this._scrollLockRoot, this)) : r(this._scrollLockRoot, this));
|
|
197
197
|
},
|
|
198
198
|
close() {
|
|
199
199
|
this.$emit("update:open", !1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","names":[],"sources":["../../../components/Modal/Modal.vue"],"sourcesContent":["<template>\n <teleport\n :disabled=\"!appendTo && !autoTeleportTarget\"\n :to=\"appendTo || autoTeleportTarget\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <dialog\n ref=\"dialogEl\"\n v-dt-focustrap=\"{ active: open, initialFocus: false, restoreFocus: false }\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n { 'd-modal--full': fullscreen },\n { 'd-modal--transparent-backdrop': transparentBackdrop },\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-modal=\"modal ? 'true' : undefined\"\n :aria-describedby=\"describedById || undefined\"\n :aria-labelledby=\"labelledById\"\n v-bind=\"modeAttrs\"\n @cancel.prevent=\"close\"\n @mousedown=\"onBackdropMousedown\"\n @mouseup=\"onBackdropMouseup\"\n @click=\"onBackdropClick\"\n @keydown=\"onKeydown\"\n >\n <div\n v-if=\"open && (hasSlotContent($slots.banner) || bannerHeaderText)\"\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 bannerHeaderText prop -->\n <slot name=\"banner\">\n {{ bannerHeaderText }}\n </slot>\n </div>\n <transition\n :appear=\"open\"\n name=\"d-modal__dialog\"\n @after-enter=\"onAfterEnter\"\n @after-leave=\"onAfterLeave\"\n >\n <div\n v-show=\"open\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"headerText\" text prop -->\n <slot name=\"header\" />\n </div>\n <dt-text\n v-else\n :id=\"labelledById\"\n kind=\"headline\"\n :size=\"600\"\n strength=\"medium\"\n density=\"100\"\n text-box-trim=\"start\"\n as=\"h2\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n {{ headerText }}\n </dt-text>\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', footerClass]\"\n data-qa=\"dt-modal-footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <sr-only-close-button\n v-if=\"!showClose\"\n @close=\"close\"\n />\n <dt-button\n v-else\n class=\"d-modal__close\"\n data-qa=\"dt-modal-close-button\"\n :size=\"300\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon=\"{ iconSize }\">\n <dt-icon-close\n :size=\"iconSize\"\n />\n </template>\n </dt-button>\n </div>\n </transition>\n </dialog>\n </teleport>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/Button';\nimport { DtText } from '@/components/Text';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport ModeMixin from '@/common/mixins/mode';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n} from './ModalConstants';\nimport { getUniqueString, hasSlotContent, returnFirstEl, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/Notice';\nimport { DialtoneLocalization } from '@/localization';\n\nconst focusableSelector = 'button:not(:disabled),[href],input:not(:disabled),select:not(:disabled),' +\n 'textarea:not(:disabled),details,[tabindex]:not([tabindex=\"-1\"]):not(:disabled):not([aria-disabled=\"true\"])';\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 DtButton,\n DtText,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [ModeMixin],\n\n props: {\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 open: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Header text to display in the modal header.\n */\n headerText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Header text to display in the modal banner.\n */\n bannerHeaderText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The theme of the modal.\n * @values default, critical\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Whether the modal fills the viewport instead of rendering at its default size.\n * @values true, false\n */\n fullscreen: {\n type: Boolean,\n default: false,\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, critical, info, positive, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validator (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 * Additional class name for the header 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 headerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the footer 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 footerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Shows the close button on the modal\n * @values true, false\n */\n showClose: {\n type: Boolean,\n default: true,\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, HTML_ELEMENT_TYPE],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * A CSS selector string for the element to portal the modal to. If not provided, the modal will be rendered in its default location.\n */\n appendTo: {\n type: String,\n default: undefined,\n },\n\n /**\n * When true, the surrounding backdrop is rendered fully transparent\n * instead of the default dimming overlay. The dialog box itself\n * remains opaque. Useful when the underlying UI should remain visible.\n * @values true, false\n */\n transparentBackdrop: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, the dialog opens with showModal(), which promotes it to the browser\n * top layer. Nothing outside the top layer can paint above it regardless of\n * z-index, so application surfaces such as toasts and call notifications end up\n * behind it. When false, it opens with show() and stays in the normal stacking\n * order, where the Dialtone z-index scale applies and --zi-notification (700)\n * outranks --zi-modal (600) as documented.\n *\n * Focus trapping, scroll locking and Esc-to-close behave identically in both\n * modes. Background inertness does not: only the top layer provides it, so with\n * modal unset the page outside the dialog stays reachable. That is deliberate —\n * it is what lets an application's own overlays remain usable above a modal —\n * and keyboard containment still comes from the focus trap.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native 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:open\n * @type {Boolean}\n */\n 'update:open',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_BANNER_KINDS,\n hasSlotContent,\n i18n: new DialtoneLocalization(),\n autoTeleportTarget: null,\n mousedownOnBackdrop: false,\n mouseupOnBackdrop: false,\n };\n },\n\n computed: {\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n watch: {\n open (isShowing) {\n this.syncDialogState(isShowing);\n },\n },\n\n mounted () {\n if (!this.appendTo) {\n const root = this.$el?.getRootNode();\n if (root instanceof ShadowRoot) {\n this.autoTeleportTarget = root;\n // Defer syncDialogState so the teleport renders inside the shadow root first.\n if (this.open) this.$nextTick(() => { if (this.open) this.syncDialogState(true); });\n return;\n }\n }\n if (this.open) {\n this.syncDialogState(true);\n }\n },\n\n beforeUnmount () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) {\n dialogEl.close();\n enableRootScrolling(this.getScrollRoot());\n }\n this.previousActiveElement = null;\n },\n\n methods: {\n // Reads $slots, which is not reactive, so it must not be cached as a computed.\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n getScrollRoot () {\n return returnFirstEl(this.$refs.dialogEl)?.getRootNode()?.host;\n },\n\n syncDialogState (isShowing) {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n if (isShowing) {\n this.previousActiveElement = document.activeElement;\n if (!dialogEl.open) {\n // show() leaves the dialog in the normal stacking order instead of the\n // top layer, where the z-index scale still applies.\n if (this.modal) dialogEl.showModal(); else dialogEl.show();\n }\n disableRootScrolling(this.getScrollRoot());\n } else if (dialogEl.open) {\n // Leave transition plays via v-show on inner content.\n // close() is called in onAfterLeave when transition completes.\n enableRootScrolling(this.getScrollRoot());\n }\n },\n\n\n\n close () {\n this.$emit('update:open', false);\n },\n\n onBackdropMousedown (event) {\n this.mousedownOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropMouseup (event) {\n this.mouseupOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropClick (event) {\n const pressedAndReleasedOnBackdrop = this.mousedownOnBackdrop && this.mouseupOnBackdrop;\n if (this.closeOnClick && event.target === event.currentTarget && pressedAndReleasedOnBackdrop) {\n this.close();\n }\n this.$emit('click', event);\n },\n\n onKeydown (event) {\n // The native cancel event only fires for dialogs opened with showModal(), so\n // Esc has to be handled explicitly to keep dismissal identical in both modes.\n // defaultPrevented means a nested widget (dropdown, combobox) already consumed\n // it to close itself, and the modal must not close out from under it.\n if (!this.modal && event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault();\n this.close();\n }\n this.$emit('keydown', event);\n },\n\n async onAfterEnter () {\n this.$emit('update:open', true);\n await this.setFocusAfterTransition();\n },\n\n onAfterLeave () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) {\n dialogEl.close();\n }\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n },\n\n focusFirstTabbable (container) {\n const focusable = [...container.querySelectorAll(focusableSelector)];\n if (!focusable.length) return;\n let target = focusable[0];\n // If first focusable is an unchecked radio, prefer the checked radio in the same group.\n if (target.matches('[type=\"radio\"]:not(:checked)')) {\n target = focusable.find(el => el.checked && el.name === target.name) || target;\n }\n target.focus({ preventScroll: true });\n },\n\n async setFocusAfterTransition () {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n await this.$nextTick();\n\n if (this.initialFocusElement === 'first') {\n this.focusFirstTabbable(dialogEl);\n } else if (typeof this.initialFocusElement === 'string' && this.initialFocusElement.startsWith('#')) {\n const el = dialogEl.querySelector(this.initialFocusElement);\n if (el) {\n el.focus();\n } else {\n // eslint-disable-next-line no-console\n console.warn('Could not find the element specified in dt-modal prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the first element.');\n this.focusFirstTabbable(dialogEl);\n }\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;;;AAsJA,IAAM,IAAoB,0LAQrB,IAAU;CACb,MAAM;CAEN,YAAY;EACV,UAAA;EACA,QAAA;EACA;EACA,mBAAA;EACD;CAED,QAAQ,CAAC,EAAU;CAEnB,OAAO;EAIL,MAAM;GACJ,MAAM;GACN,SAAS;GACV;EAOD,eAAe;GACb,MAAM;GACN,SAAS;GACV;EAKD,cAAc;GACZ,MAAM;GACN,SAAS,WAAY;AAAE,WAAO,GAAiB;;GAChD;EAOD,MAAM;GACJ,MAAM;GACN,SAAS;GACV;EAKD,YAAY;GACV,MAAM;GACN,SAAS,KAAA;GACV;EAKD,kBAAkB;GAChB,MAAM;GACN,SAAS,KAAA;GACV;EAMD,MAAM;GACJ,MAAM;GACN,SAAS;GACT,YAAY,MAAM,OAAO,KAAK,EAAqB,CAAC,SAAS,EAAE;GAChE;EAMD,YAAY;GACV,MAAM;GACN,SAAS;GACV;EAOD,YAAY;GACV,MAAM;IAAC;IAAQ;IAAQ;IAAM;GAC7B,SAAS;GACV;EAOD,aAAa;GACX,MAAM;IAAC;IAAQ;IAAQ;IAAM;GAC7B,SAAS;GACV;EAOD,cAAc;GACZ,MAAM;IAAC;IAAQ;IAAQ;IAAM;GAC7B,SAAS;GACV;EAMD,YAAY;GACV,MAAM;GACN,SA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K,EAAA,CAAA,oBAAoD,EAAA,aAAA,CAAA;IAI1D,WAAQ;OAGR,EAAQ,EAAA,QAAA,UAAA,CAAA,EAAA,EAAA,KAAA,GAAA,EAEV,EASI,KAAA;;IAPD,OAAK,EAAA,CAAA,oBAAoD,EAAA,aAAA,CAAA;IAI1D,WAAQ;QAEL,EAAA,KAAI,EAAA,EAAA;GAGD,EAAA,eAAa,IAAA,GAAA,EADrB,EAOS,UAAA;;IALN,OAAK,EAAA,CAAA,mBAAsB,EAAA,YAAW,CAAA;IACvC,WAAQ;OAGR,EAAsB,EAAA,QAAA,SAAA,CAAA,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA;GAGf,EAAA,kBAGT,EAgBY,GAAA;;IAdV,OAAM;IACN,WAAQ;IACP,MAAM;IACP,MAAK;IACL,YAAW;IACV,cAAY,EAAA;IACZ,OAAO,EAAA;IACP,SAAO,EAAA;;IAEG,MAAI,GAGX,EAHe,kBAAQ,CACzB,EAEE,GAAA,EADC,MAAM,GAAQ,EAAA,MAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;;;;;UAhBZ,GAAA,EADT,EAGE,GAAA;;IADC,SAAO,EAAA;;cA7DF,EAAA,KAAI,CAAA,CAAA,CAAA,CAAA;;;;;;;UAxCU,EAAA;EAAI,cAAA;EAAA,cAAA;EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA,CAAA,YAAA,KAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"modal.js","names":[],"sources":["../../../components/Modal/Modal.vue"],"sourcesContent":["<template>\n <teleport\n :disabled=\"!appendTo && !autoTeleportTarget\"\n :to=\"appendTo || autoTeleportTarget\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <dialog\n ref=\"dialogEl\"\n v-dt-focustrap=\"{ active: open, initialFocus: false, restoreFocus: false }\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n { 'd-modal--full': fullscreen },\n { 'd-modal--transparent-backdrop': transparentBackdrop },\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-modal=\"modal ? 'true' : undefined\"\n :aria-describedby=\"describedById || undefined\"\n :aria-labelledby=\"labelledById\"\n v-bind=\"modeAttrs\"\n @cancel.prevent=\"close\"\n @mousedown=\"onBackdropMousedown\"\n @mouseup=\"onBackdropMouseup\"\n @click=\"onBackdropClick\"\n @keydown=\"onKeydown\"\n >\n <div\n v-if=\"open && (hasSlotContent($slots.banner) || bannerHeaderText)\"\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 bannerHeaderText prop -->\n <slot name=\"banner\">\n {{ bannerHeaderText }}\n </slot>\n </div>\n <transition\n :appear=\"open\"\n name=\"d-modal__dialog\"\n @after-enter=\"onAfterEnter\"\n @after-leave=\"onAfterLeave\"\n >\n <div\n v-show=\"open\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"headerText\" text prop -->\n <slot name=\"header\" />\n </div>\n <dt-text\n v-else\n :id=\"labelledById\"\n kind=\"headline\"\n :size=\"600\"\n strength=\"medium\"\n density=\"100\"\n text-box-trim=\"start\"\n as=\"h2\"\n :class=\"['d-modal__header', headerClass]\"\n data-qa=\"dt-modal-title\"\n >\n {{ headerText }}\n </dt-text>\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', footerClass]\"\n data-qa=\"dt-modal-footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <sr-only-close-button\n v-if=\"!showClose\"\n @close=\"close\"\n />\n <dt-button\n v-else\n class=\"d-modal__close\"\n data-qa=\"dt-modal-close-button\"\n :size=\"300\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon=\"{ iconSize }\">\n <dt-icon-close\n :size=\"iconSize\"\n />\n </template>\n </dt-button>\n </div>\n </transition>\n </dialog>\n </teleport>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/Button';\nimport { DtText } from '@/components/Text';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport ModeMixin from '@/common/mixins/mode';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n} from './ModalConstants';\nimport { getUniqueString, hasSlotContent, returnFirstEl, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/Notice';\nimport { DialtoneLocalization } from '@/localization';\n\nconst focusableSelector = 'button:not(:disabled),[href],input:not(:disabled),select:not(:disabled),' +\n 'textarea:not(:disabled),details,[tabindex]:not([tabindex=\"-1\"]):not(:disabled):not([aria-disabled=\"true\"])';\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 DtButton,\n DtText,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [ModeMixin],\n\n props: {\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 open: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Header text to display in the modal header.\n */\n headerText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Header text to display in the modal banner.\n */\n bannerHeaderText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The theme of the modal.\n * @values default, critical\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Whether the modal fills the viewport instead of rendering at its default size.\n * @values true, false\n */\n fullscreen: {\n type: Boolean,\n default: false,\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, critical, info, positive, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validator (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 * Additional class name for the header 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 headerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the footer 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 footerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Shows the close button on the modal\n * @values true, false\n */\n showClose: {\n type: Boolean,\n default: true,\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, HTML_ELEMENT_TYPE],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * A CSS selector string for the element to portal the modal to. If not provided, the modal will be rendered in its default location.\n */\n appendTo: {\n type: String,\n default: undefined,\n },\n\n /**\n * When true, the surrounding backdrop is rendered fully transparent\n * instead of the default dimming overlay. The dialog box itself\n * remains opaque. Useful when the underlying UI should remain visible.\n * @values true, false\n */\n transparentBackdrop: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, the dialog opens with showModal(), which promotes it to the browser\n * top layer. Nothing outside the top layer can paint above it regardless of\n * z-index, so application surfaces such as toasts and call notifications end up\n * behind it. When false, it opens with show() and stays in the normal stacking\n * order, where the Dialtone z-index scale applies and --zi-notification (700)\n * outranks --zi-modal (600) as documented.\n *\n * Focus trapping, scroll locking and Esc-to-close behave identically in both\n * modes. Background inertness does not: only the top layer provides it, so with\n * modal unset the page outside the dialog stays reachable. That is deliberate —\n * it is what lets an application's own overlays remain usable above a modal —\n * and keyboard containment still comes from the focus trap.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native 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:open\n * @type {Boolean}\n */\n 'update:open',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_BANNER_KINDS,\n hasSlotContent,\n i18n: new DialtoneLocalization(),\n autoTeleportTarget: null,\n mousedownOnBackdrop: false,\n mouseupOnBackdrop: false,\n };\n },\n\n computed: {\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n watch: {\n open (isShowing) {\n this.syncDialogState(isShowing);\n },\n },\n\n mounted () {\n if (!this.appendTo) {\n const root = this.$el?.getRootNode();\n if (root instanceof ShadowRoot) {\n this.autoTeleportTarget = root;\n // Defer syncDialogState so the teleport renders inside the shadow root first.\n if (this.open) this.$nextTick(() => { if (this.open) this.syncDialogState(true); });\n return;\n }\n }\n if (this.open) {\n this.syncDialogState(true);\n }\n },\n\n beforeUnmount () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) dialogEl.close();\n enableRootScrolling(this._scrollLockRoot, this);\n this.previousActiveElement = null;\n },\n\n methods: {\n // Reads $slots, which is not reactive, so it must not be cached as a computed.\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n getScrollRoot () {\n return returnFirstEl(this.$refs.dialogEl)?.getRootNode()?.host;\n },\n\n syncDialogState (isShowing) {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n if (isShowing) {\n this.previousActiveElement = document.activeElement;\n if (!dialogEl.open) {\n // show() leaves the dialog in the normal stacking order instead of the\n // top layer, where the z-index scale still applies.\n if (this.modal) dialogEl.showModal(); else dialogEl.show();\n }\n // Release from the root locked here, even if the dialog has since been teleported elsewhere.\n this._scrollLockRoot = this.getScrollRoot();\n disableRootScrolling(this._scrollLockRoot, this);\n } else {\n // Leave transition plays via v-show on inner content.\n // close() is called in onAfterLeave when transition completes.\n // Release even if the dialog was already closed natively (e.g. a method=\"dialog\" form).\n enableRootScrolling(this._scrollLockRoot, this);\n }\n },\n\n\n\n close () {\n this.$emit('update:open', false);\n },\n\n onBackdropMousedown (event) {\n this.mousedownOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropMouseup (event) {\n this.mouseupOnBackdrop = event.target === event.currentTarget;\n },\n\n onBackdropClick (event) {\n const pressedAndReleasedOnBackdrop = this.mousedownOnBackdrop && this.mouseupOnBackdrop;\n if (this.closeOnClick && event.target === event.currentTarget && pressedAndReleasedOnBackdrop) {\n this.close();\n }\n this.$emit('click', event);\n },\n\n onKeydown (event) {\n // The native cancel event only fires for dialogs opened with showModal(), so\n // Esc has to be handled explicitly to keep dismissal identical in both modes.\n // defaultPrevented means a nested widget (dropdown, combobox) already consumed\n // it to close itself, and the modal must not close out from under it.\n if (!this.modal && event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault();\n this.close();\n }\n this.$emit('keydown', event);\n },\n\n async onAfterEnter () {\n this.$emit('update:open', true);\n await this.setFocusAfterTransition();\n },\n\n onAfterLeave () {\n const dialogEl = this.$refs.dialogEl;\n if (dialogEl?.open) {\n dialogEl.close();\n }\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n },\n\n focusFirstTabbable (container) {\n const focusable = [...container.querySelectorAll(focusableSelector)];\n if (!focusable.length) return;\n let target = focusable[0];\n // If first focusable is an unchecked radio, prefer the checked radio in the same group.\n if (target.matches('[type=\"radio\"]:not(:checked)')) {\n target = focusable.find(el => el.checked && el.name === target.name) || target;\n }\n target.focus({ preventScroll: true });\n },\n\n async setFocusAfterTransition () {\n const dialogEl = this.$refs.dialogEl;\n if (!dialogEl) return;\n\n await this.$nextTick();\n\n if (this.initialFocusElement === 'first') {\n this.focusFirstTabbable(dialogEl);\n } else if (typeof this.initialFocusElement === 'string' && this.initialFocusElement.startsWith('#')) {\n const el = dialogEl.querySelector(this.initialFocusElement);\n if (el) {\n el.focus();\n } else {\n // eslint-disable-next-line no-console\n console.warn('Could not find the element specified in dt-modal prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the first element.');\n this.focusFirstTabbable(dialogEl);\n }\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;;;AAsJA,IAAM,IAAoB,0LAQrB,IAAU;CACb,MAAM;CAEN,YAAY;EACV,UAAA;EACA,QAAA;EACA;EACA,mBAAA;EACD;CAED,QAAQ,CAAC,EAAU;CAEnB,OAAO;EAIL,MAAM;GACJ,MAAM;GACN,SAAS;GACV;EAOD,eAAe;GACb,MAAM;GACN,SAAS;GACV;EAKD,cAAc;GACZ,MAAM;GACN,SAAS,WAAY;AAAE,WAAO,GAAiB;;GAChD;EAOD,MAAM;GACJ,MAAM;GACN,SAAS;GACV;EAKD,YAAY;GACV,MAAM;GACN,SAAS,KAAA;GACV;EAKD,kBAAkB;GAChB,MAAM;GACN,SAAS,KAAA;GACV;EAMD,MAAM;GACJ,MAAM;GACN,SAAS;GACT,YAAY,MAAM,OAAO,KAAK,EAAqB,CAAC,SAAS,EAAE;GAChE;EAMD,YAAY;GACV,MAAM;GACN,SAAS;GACV;EAOD,YAAY;GACV,MAAM;IAAC;IAAQ;IAAQ;IAAM;GAC7B,SAAS;GACV;EAOD,aAAa;GACX,MAAM;IAAC;IAAQ;IAAQ;IAAM;GAC7B,SA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Q,CAAA,EAAA,EAAb,EAAA,WAAU,EAAA,EAAA,CAAA,CAAA;;;GAGP,EAAA,eAAe,EAAA,OAAO,QAAO,IAAA,GAAA,EADrC,EAUM,OAAA;;IARH,OAAK,EAAA,CAAA,oBAAoD,EAAA,aAAA,CAAA;IAI1D,WAAQ;OAGR,EAAQ,EAAA,QAAA,UAAA,CAAA,EAAA,EAAA,KAAA,GAAA,EAEV,EASI,KAAA;;IAPD,OAAK,EAAA,CAAA,oBAAoD,EAAA,aAAA,CAAA;IAI1D,WAAQ;QAEL,EAAA,KAAI,EAAA,EAAA;GAGD,EAAA,eAAa,IAAA,GAAA,EADrB,EAOS,UAAA;;IALN,OAAK,EAAA,CAAA,mBAAsB,EAAA,YAAW,CAAA;IACvC,WAAQ;OAGR,EAAsB,EAAA,QAAA,SAAA,CAAA,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA;GAGf,EAAA,kBAGT,EAgBY,GAAA;;IAdV,OAAM;IACN,WAAQ;IACP,MAAM;IACP,MAAK;IACL,YAAW;IACV,cAAY,EAAA;IACZ,OAAO,EAAA;IACP,SAAO,EAAA;;IAEG,MAAI,GAGX,EAHe,kBAAQ,CACzB,EAEE,GAAA,EADC,MAAM,GAAQ,EAAA,MAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;;;;;UAhBZ,GAAA,EADT,EAGE,GAAA;;IADC,SAAO,EAAA;;cA7DF,EAAA,KAAI,CAAA,CAAA,CAAA,CAAA;;;;;;;UAxCU,EAAA;EAAI,cAAA;EAAA,cAAA;EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA,CAAA,YAAA,KAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../mode_constants-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../mode_constants-DM0SVbFM.cjs`),t=require(`../mode-island/utils.cjs`);var n=e.n,r={inverted:`invert`},i={name:`dt-mode-directive`,install(e){let i=new WeakMap;e.directive(`dt-mode`,{mounted(e,t){if(t.value===!1)return;let n=o(e,a(t.arg));i.set(e,n)},updated(e,t){let n=i.get(e),r=t.value!==t.oldValue,l=a(t.arg),u=l!==n?.arg;if(!r&&!u||(c(n),s(e),i.delete(e),t.value===!1))return;let d=o(e,l);i.set(e,d)},unmounted(e){c(i.get(e)),s(e),i.delete(e)}});function a(e){return e?n.includes(e)?e:r[e]?(console.warn(`[DtModeDirective] Invalid mode "${e}". Did you mean "${r[e]}"? Falling back to "${r[e]}".`),r[e]):(console.warn(`[DtModeDirective] Invalid mode "${e}". Valid modes: ${n.join(`, `)}. Falling back to "invert".`),`invert`):`invert`}function o(e,n){let r={arg:n,contrastObserver:null,materialObserver:null,modeObserver:null};if(e.setAttribute(`data-dt-contrast`,t.getRootContrast()),r.contrastObserver=new MutationObserver(()=>{e.setAttribute(`data-dt-contrast`,t.getRootContrast())}),r.contrastObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-dt-contrast`]}),e.setAttribute(`data-dt-material`,t.getRootMaterial()),r.materialObserver=new MutationObserver(()=>{e.setAttribute(`data-dt-material`,t.getRootMaterial())}),r.materialObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-dt-material`]}),n===`light`||n===`dark`)e.setAttribute(`data-dt-mode`,n);else{let n=t.findParentMode(e);e.setAttribute(`data-dt-mode`,t.getOppositeMode(n));let i={attributes:!0,attributeFilter:[`data-dt-mode`],subtree:!1};r.modeObserver=new MutationObserver(()=>{let n=t.findParentMode(e);e.setAttribute(`data-dt-mode`,t.getOppositeMode(n))}),r.modeObserver.observe(document.documentElement,i);let a=e.parentElement;for(;a&&a!==document.documentElement;)r.modeObserver.observe(a,i),a=a.parentElement}return r}function s(e){e.removeAttribute(`data-dt-mode`),e.removeAttribute(`data-dt-contrast`),e.removeAttribute(`data-dt-material`)}function c(e){e&&(e.contrastObserver&&(e.contrastObserver.disconnect(),e.contrastObserver=null),e.materialObserver&&(e.materialObserver.disconnect(),e.materialObserver=null),e.modeObserver&&(e.modeObserver.disconnect(),e.modeObserver=null))}}};exports.DtModeDirective=i,exports.default=i;
|
|
2
2
|
//# sourceMappingURL=mode.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e } from "../../mode_constants-
|
|
1
|
+
import { n as e } from "../../mode_constants-B8_1b5T8.js";
|
|
2
2
|
import { findParentMode as t, getOppositeMode as n, getRootContrast as r, getRootMaterial as i } from "../mode-island/utils.js";
|
|
3
3
|
//#region directives/mode_directive/mode.js
|
|
4
4
|
var a = e, o = { inverted: "invert" }, s = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-CX7YVcP6.cjs`),t=require(`./utils.cjs`),n=require(`./mode-island-constants.cjs`),r=require(`./validators.cjs`);let i=require(`vue`);var a={name:`DtModeIsland`,provide(){return{dtModeIslandMode:()=>this.computedMode}},inject:{parentModeIslandMode:{from:`dtModeIslandMode`,default:null}},props:{as:{type:String,default:`div`},mode:{type:String,default:n.DT_MODE_ISLAND_TYPES.INVERTED,validator:r.modeValidator}},data(){return{currentContrast:t.getRootContrast(),currentMaterial:t.getRootMaterial(),contrastObserver:null,materialObserver:null,modeObserver:null,elementRef:null,calculatedMode:null}},computed:{isInverted(){return this.mode===n.DT_MODE_ISLAND_TYPES.INVERTED},invertedAttribute(){return this.isInverted?``:null},computedMode(){return this.mode===n.DT_MODE_ISLAND_TYPES.LIGHT||this.mode===n.DT_MODE_ISLAND_TYPES.DARK?this.mode:this.mode===n.DT_MODE_ISLAND_TYPES.INVERTED&&this.calculatedMode?this.calculatedMode:this.calculateInvertedMode()}},beforeCreate(){if(this.$attrs&&this.$attrs[`data-dt-brand`])throw Error(`[DtModeIsland] The data-dt-brand attribute is not allowed on mode islands. Brand should only be set at the root level.`)},mounted(){this.elementRef=this.$el,this.setupContrastObserver(),this.setupMaterialObserver(),this.isInverted&&(this.calculatedMode=this.calculateInvertedMode(),this.setupModeObserver()),this.currentContrast=t.getRootContrast(),this.currentMaterial=t.getRootMaterial()},beforeUnmount(){this.contrastObserver&&(this.contrastObserver.disconnect(),this.contrastObserver=null),this.materialObserver&&(this.materialObserver.disconnect(),this.materialObserver=null),this.modeObserver&&(this.modeObserver.disconnect(),this.modeObserver=null)},methods:{calculateInvertedMode(){return this.parentModeIslandMode?t.getOppositeMode(typeof this.parentModeIslandMode==`function`?this.parentModeIslandMode():this.parentModeIslandMode):this.elementRef?t.getOppositeMode(t.findParentMode(this.elementRef)):t.getOppositeMode(t.getRootMode())},setupContrastObserver(){this.contrastObserver=new MutationObserver(e=>{for(let n of e)n.type===`attributes`&&n.attributeName===`data-dt-contrast`&&(this.currentContrast=t.getRootContrast())}),this.contrastObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-dt-contrast`]})},setupMaterialObserver(){this.materialObserver=new MutationObserver(e=>{for(let n of e)n.type===`attributes`&&n.attributeName===`data-dt-material`&&(this.currentMaterial=t.getRootMaterial())}),this.materialObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-dt-material`]})},setupModeObserver(){let e={attributes:!0,attributeFilter:[`data-dt-mode`],subtree:!1};this.modeObserver=new MutationObserver(e=>{for(let t of e)t.type===`attributes`&&t.attributeName===`data-dt-mode`&&(this.calculatedMode=this.calculateInvertedMode())}),this.modeObserver.observe(document.documentElement,e);let t=this.elementRef?.parentElement;for(;t;)t.hasAttribute(`data-dt-mode`)&&this.modeObserver.observe(t,e),t=t.parentElement}}};function o(e,t,n,r,a,o){return(0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(n.as),{class:`d-mode-island`,"data-qa":`dt-mode-island`,"data-dt-mode":o.computedMode,"data-mode-island-inverted":o.invertedAttribute,"data-dt-contrast":a.currentContrast,"data-dt-material":a.currentMaterial},{default:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),_:3},8,[`data-dt-mode`,`data-mode-island-inverted`,`data-dt-contrast`,`data-dt-material`])}var s=e.t(a,[[`render`,o]]);exports.default=s;
|
|
2
2
|
//# sourceMappingURL=mode-island.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../_plugin-vue_export-helper-
|
|
1
|
+
import { t as e } from "../../_plugin-vue_export-helper-BecorN_g.js";
|
|
2
2
|
import { findParentMode as t, getOppositeMode as n, getRootContrast as r, getRootMaterial as i, getRootMode as a } from "./utils.js";
|
|
3
3
|
import { DT_MODE_ISLAND_TYPES as o } from "./mode-island-constants.js";
|
|
4
4
|
import { modeValidator as s } from "./validators.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-CX7YVcP6.cjs`),t=require(`./motion-text-constants.cjs`),n=require(`./utils.cjs`);let r=require(`vue`);var i=t.MOTION_TEXT_TIMING_PRESETS[300],a={tracks:[],gradient:!1,loopHold:0},o={name:`DtMotionText`,props:{text:{type:String,default:``},animationMode:{type:String,default:`gradient-in`,validator:e=>t.MOTION_TEXT_ANIMATION_MODES.includes(e)},speed:{type:[String,Number],default:300,validator:e=>t.MOTION_TEXT_SPEEDS.includes(String(e))},autoStart:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},respectsReducedMotion:{type:Boolean,default:!0},screenReaderText:{type:String,default:``}},emits:[`start`,`complete`,`progress`,`pause`,`resume`],data(){return{words:n.splitWords(this.text),wordWidths:[],isRtl:!1,isAnimating:!1,isPaused:!1,isComplete:!1,isRestarting:!1,isLooped:!1,isUnmounted:!1,animationTimeouts:[],timelineStartedAt:0,timelineElapsed:0,prefersReducedMotion:!1,animationKey:0,cssIterations:1}},computed:{modeSettings(){return t.MOTION_TEXT_MODE_SETTINGS[this.animationMode]??a},isWholeText(){return!!this.modeSettings.wholeText},speedScale(){return(t.MOTION_TEXT_TIMING_PRESETS[String(this.speed)]??i).duration/i.duration},componentStyles(){let e={};return this.modeSettings.tracks.forEach(n=>{Object.entries(t.MOTION_TEXT_TRACKS[n]).forEach(([t,r])=>{e[`--d-motion-text-${n}-${t}`]=`${Math.round(r*this.speedScale)}ms`})}),e},wordStyles(){let e=this.modeSettings.gradient?n.getGradientSlices(this.wordWidths,this.isRtl):[];return this.words.map((t,n)=>{let r=e[n];return{"--d-motion-text-word-index":n,...r&&{"--d-motion-text-gradient-size":r.size,"--d-motion-text-gradient-position":r.position}}})},wordEndTimes(){return this.words.map((e,n)=>{let r=this.modeSettings.tracks.map(e=>{let{delay:r,stagger:i,duration:a}=t.MOTION_TEXT_TRACKS[e];return r+i*n+a});return Math.max(0,...r)*this.speedScale})},cycleDuration(){if(!this.isWholeText)return Math.max(0,...this.wordEndTimes);let e=this.modeSettings.tracks.map(e=>{let{delay:n,duration:r}=t.MOTION_TEXT_TRACKS[e];return n+r});return Math.max(0,...e)*this.speedScale*this.cssIterations},motionTextClasses(){return[`d-motion-text`,`d-motion-text--${this.animationMode}`,{"d-motion-text--animating":this.isAnimating,"d-motion-text--paused":this.isPaused,"d-motion-text--complete":this.isComplete,"d-motion-text--restarting":this.isRestarting,"d-motion-text--looped":this.isLooped,"d-motion-text--respects-reduced-motion":this.respectsReducedMotion}]}},watch:{text(){if(this.isWholeText){this.words=n.splitWords(this.text),this.isComplete&&this.autoStart&&!this.loop&&(this.reset(),this.$nextTick(()=>this.start()));return}if(this.reset(),this.text){this.initializeContent();return}this.words=[],this.$nextTick(()=>this.initializeContent())},animationMode(e,r){let i=!!t.MOTION_TEXT_MODE_SETTINGS[r]?.wholeText;if(!this.text&&i!==this.isWholeText){let e=this.isAnimating;this.reset(),this.words=[],this.$nextTick(()=>{this.words=n.splitWords(this.getSlotText()),this.wordWidths=[],e&&this.$nextTick(()=>this.start())});return}this.restartIfAnimating()},autoStart(e){e&&!this.isAnimating&&(this.isWholeText||this.words.length)&&this.$nextTick(()=>this.start())},speed(){this.restartIfAnimating()},loop:{handler(e){this.isLooped=e,this.isAnimating&&!this.isPaused&&(this.timelineElapsed=Date.now()-this.timelineStartedAt,this.clearTimeouts(),this.runTimeline())},immediate:!0}},mounted(){this.initWatchReducedMotion(),this.initializeContent(),document.fonts?.ready.then(()=>{!this.isUnmounted&&this.isAnimating&&this.measureWords()})},beforeUnmount(){this.isUnmounted=!0,this.clearTimeouts(),this.stopWatchingReducedMotion?.()},methods:{getSlotText(){return this.$refs.slotRef?.textContent||``},initWatchReducedMotion(){if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=e=>{this.prefersReducedMotion=e.matches,e.matches&&this.respectsReducedMotion&&this.isAnimating&&this.skipToEnd()};this.prefersReducedMotion=e.matches,e.addEventListener?.(`change`,t),this.stopWatchingReducedMotion=()=>e.removeEventListener?.(`change`,t)},measureWords(){if(!this.modeSettings.gradient)return;let e=this.$refs.contentRef?.querySelectorAll(`.d-motion-text__word`)||[],t=Array.from(e,e=>e.getBoundingClientRect().width);this.isRtl=window.getComputedStyle(this.$el).direction===`rtl`,this.wordWidths=t.length===this.words.length&&t.every(e=>e>0)?t:this.words.map(e=>e.text.length)},clearTimeouts(){this.animationTimeouts.forEach(e=>clearTimeout(e)),this.animationTimeouts=[]},schedule(e,t){this.animationTimeouts.push(setTimeout(t,Math.max(0,e)))},runTimeline(){let e=this.timelineElapsed,t=this.words.length,n=this.cycleDuration;if(this.timelineStartedAt=Date.now()-e,(this.isWholeText?[]:this.wordEndTimes).forEach((n,r)=>{n<=e||this.schedule(n-e,()=>{this.$emit(`progress`,{wordsComplete:r+1,totalWords:t,progress:(r+1)/t})})}),n>e&&this.schedule(n-e,()=>this.completeAnimation()),this.loop){let t=n+this.modeSettings.loopHold*this.speedScale;this.schedule(t-e,()=>this.restartCycle())}else n<=e&&this.finishAnimation()},start(){if(!(this.isAnimating||this.isUnmounted)){if(this.clearTimeouts(),this.isAnimating=!0,this.isPaused=!1,this.isComplete=!1,this.$emit(`start`),this.respectsReducedMotion&&this.prefersReducedMotion){this.showAllContent();return}if(!this.modeSettings.tracks.length||!this.isWholeText&&!this.words.length){this.showAllContent();return}this.measureWords(),this.cssIterations=this.readCssIterations(),this.timelineElapsed=0,this.runTimeline()}},readCssIterations(){if(!this.isWholeText||this.loop)return 1;let e=parseFloat(window.getComputedStyle(this.$el).animationIterationCount);return Number.isFinite(e)&&e>1?e:1},pause(){!this.isAnimating||this.isPaused||(this.timelineElapsed=Date.now()-this.timelineStartedAt,this.clearTimeouts(),this.isPaused=!0,this.$emit(`pause`))},resume(){this.isPaused&&(this.isPaused=!1,this.$emit(`resume`),this.runTimeline())},reset(){this.clearTimeouts(),this.isAnimating=!1,this.isPaused=!1,this.isComplete=!1,this.timelineElapsed=0,this.animationKey++,this.replayAnimations()},skipToEnd(){this.showAllContent()},showAllContent(){this.finishAnimation(),this.isPaused=!1,this.schedule(0,()=>this.$emit(`complete`))},finishAnimation(){this.clearTimeouts(),this.isAnimating=!1,this.isComplete=!0},restartIfAnimating(){this.isAnimating&&(this.reset(),this.$nextTick(()=>this.start()))},completeAnimation(){this.$emit(`complete`),this.loop||this.finishAnimation()},replayAnimations(e){this.isRestarting=!0,this.$nextTick(()=>{this.$el?.getBoundingClientRect?.(),this.isRestarting=!1,e?.()})},restartCycle(){this.isUnmounted||(this.clearTimeouts(),this.replayAnimations(()=>{this.measureWords(),this.timelineElapsed=0,this.$emit(`start`),this.runTimeline()}))},initializeContent(){this.words=n.splitWords(this.text||this.getSlotText()),this.wordWidths=[],this.autoStart&&(this.isWholeText||this.words.length>0)&&this.$nextTick(()=>this.start())}}},s=[`aria-live`,`aria-label`],c={key:0,"data-qa":`dt-motion-text-sr-only`,class:`d-motion-text__sr-only`},l=[`aria-hidden`],u=[`aria-hidden`],d={key:3,ref:`slotRef`,class:`d-motion-text__fallback`};function f(e,t,n,i,a,o){return(0,r.openBlock)(),(0,r.createElementBlock)(`span`,{"data-qa":`dt-motion-text`,class:(0,r.normalizeClass)(o.motionTextClasses),style:(0,r.normalizeStyle)(o.componentStyles),"aria-live":a.isAnimating?`polite`:`off`,"aria-label":n.screenReaderText||void 0},[n.screenReaderText?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,c,(0,r.toDisplayString)(n.screenReaderText),1)):(0,r.createCommentVNode)(``,!0),o.isWholeText?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:1,ref:`slotRef`,"data-qa":`dt-motion-text-content`,class:`d-motion-text__content`,"aria-hidden":n.screenReaderText?`true`:void 0},[(0,r.createTextVNode)((0,r.toDisplayString)(n.text),1),n.text?(0,r.createCommentVNode)(``,!0):(0,r.renderSlot)(e.$slots,`default`,{key:0})],8,l)):a.words.length?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{ref:`contentRef`,key:a.animationKey,"data-qa":`dt-motion-text-content`,class:`d-motion-text__content`,"aria-hidden":n.screenReaderText?`true`:void 0},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(a.words,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:`${a.animationKey}-${t}`},[(0,r.createElementVNode)(`span`,{"data-qa":`dt-motion-text-word`,class:`d-motion-text__word`,style:(0,r.normalizeStyle)(o.wordStyles[t])},(0,r.toDisplayString)(e.text),5),(0,r.createTextVNode)((0,r.toDisplayString)(e.space),1)],64))),128))],8,u)):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,d,[(0,r.renderSlot)(e.$slots,`default`)],512))],14,s)}var p=e.t(o,[[`render`,f]]);exports.default=p;
|
|
2
2
|
//# sourceMappingURL=motion-text.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../_plugin-vue_export-helper-
|
|
1
|
+
import { t as e } from "../../_plugin-vue_export-helper-BecorN_g.js";
|
|
2
2
|
import { MOTION_TEXT_ANIMATION_MODES as t, MOTION_TEXT_MODE_SETTINGS as n, MOTION_TEXT_SPEEDS as r, MOTION_TEXT_TIMING_PRESETS as i, MOTION_TEXT_TRACKS as a } from "./motion-text-constants.js";
|
|
3
3
|
import { getGradientSlices as o, splitWords as s } from "./utils.js";
|
|
4
4
|
import { Fragment as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, normalizeClass as p, normalizeStyle as m, openBlock as h, renderList as g, renderSlot as _, toDisplayString as v } from "vue";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-CX7YVcP6.cjs`),t=require(`../../localization/index.cjs`),n=require(`../button/button.cjs`),r=require(`../../shared/sr_only_close_button.cjs`);let i=require(`vue`);var a={name:`DtNoticeAction`,components:{DtIconClose:require(`@dialpad/dialtone-icons/vue`).DtIconClose,DtButton:n.default,SrOnlyCloseButton:r.default},props:{showClose:{type:Boolean,default:!0},showAction:{type:Boolean,default:!0},actionClass:{type:[String,Array,Object],default:``}},emits:[`close`],data(){return{i18n:new t.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t(`DIALTONE_CLOSE_BUTTON`)}},mounted(){this.showClose&&(this.lastFocusedElement=document.activeElement)},beforeUnmount(){this.lastFocusedElement?.focus()},methods:{close(){this.$emit(`close`)}}};function o(e,t,n,r,a,o){let s=(0,i.resolveComponent)(`dt-icon-close`),c=(0,i.resolveComponent)(`dt-button`),l=(0,i.resolveComponent)(`sr-only-close-button`);return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,{class:(0,i.normalizeClass)([`d-notice__actions`,n.actionClass]),"data-qa":`notice-content-actions`},[n.showAction?(0,i.renderSlot)(e.$slots,`default`,{key:0}):(0,i.createCommentVNode)(``,!0),n.showClose?((0,i.openBlock)(),(0,i.createBlock)(c,{key:1,ref:`closeButton`,"data-qa":`dt-notice-action-close-button`,importance:`clear`,kind:`muted`,size:200,"aria-label":o.closeButtonTitle,title:o.closeButtonTitle,onClick:o.close},{startIcon:(0,i.withCtx)(()=>[(0,i.createVNode)(s,{size:`200`})]),_:1},8,[`aria-label`,`title`,`onClick`])):((0,i.openBlock)(),(0,i.createBlock)(l,{key:2,onClose:o.close},null,8,[`onClose`]))],2)}var s=e.t(a,[[`render`,o]]);exports.default=s;
|
|
2
2
|
//# sourceMappingURL=notice-action.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../_plugin-vue_export-helper-
|
|
1
|
+
import { t as e } from "../../_plugin-vue_export-helper-BecorN_g.js";
|
|
2
2
|
import { DialtoneLocalization as t } from "../../localization/index.js";
|
|
3
3
|
import n from "../button/button.js";
|
|
4
4
|
import r from "../../shared/sr_only_close_button.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../utils-GofHWJKi.cjs`),t=require(`../../_plugin-vue_export-helper-CX7YVcP6.cjs`),n=require(`../../Text-BDgOWPw7.cjs`);let r=require(`vue`);var i={name:`DtNoticeContent`,components:{DtText:n.t},props:{headerText:{type:String,default:void 0},message:{type:String,default:void 0},headerId:{type:String,default:void 0},contentId:{type:String,default:void 0},headerClass:{type:[String,Array,Object],default:``},contentClass:{type:[String,Array,Object],default:``}},data(){return{hasSlotContent:e._}}};function a(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`dt-text`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)([`d-notice__content`,n.contentClass]),"data-qa":`notice-content`},[n.headerText||a.hasSlotContent(e.$slots.header)?((0,r.openBlock)(),(0,r.createBlock)(s,{key:0,id:n.headerId,kind:`headline`,size:300,density:`200`,wrap:`pretty`,as:`p`,class:(0,r.normalizeClass)([`d-notice__title`,n.headerClass]),"data-qa":`notice-content-title`},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(e.$slots,`header`,{},()=>[(0,r.createTextVNode)((0,r.toDisplayString)(n.headerText),1)])]),_:3},8,[`id`,`class`])):(0,r.createCommentVNode)(``,!0),n.message||a.hasSlotContent(e.$slots.default)?((0,r.openBlock)(),(0,r.createBlock)(s,{key:1,id:n.contentId,kind:`body`,size:200,wrap:`pretty`,as:`p`,class:`d-notice__message`,"data-qa":`notice-content-message`},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(e.$slots,`default`,{},()=>[(0,r.createTextVNode)((0,r.toDisplayString)(n.message),1)])]),_:3},8,[`id`])):(0,r.createCommentVNode)(``,!0)],2)}var o=t.t(i,[[`render`,a]]);exports.default=o;
|
|
2
2
|
//# sourceMappingURL=notice-content.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice-content.cjs","names":[],"sources":["../../../components/Notice/NoticeContent.vue"],"sourcesContent":["<template>\n <div\n :class=\"['d-notice__content', contentClass]\"\n data-qa=\"notice-content\"\n >\n <dt-text\n v-if=\"headerText || hasSlotContent($slots.header)\"\n :id=\"headerId\"\n kind=\"headline\"\n :size=\"300\"\n density=\"200\"\n wrap=\"pretty\"\n as=\"p\"\n :class=\"['d-notice__title', headerClass]\"\n data-qa=\"notice-content-title\"\n >\n <!-- @slot Slot for the header -->\n <slot name=\"header\">\n {{ headerText }}\n </slot>\n </dt-text>\n <dt-text\n v-if=\"message || hasSlotContent($slots.default)\"\n :id=\"contentId\"\n kind=\"body\"\n :size=\"200\"\n wrap=\"pretty\"\n as=\"p\"\n class=\"d-notice__message\"\n data-qa=\"notice-content-message\"\n >\n <!-- @slot Slot for main content -->\n <slot>\n {{ message }}\n </slot>\n </dt-text>\n </div>\n</template>\n\n<script>\nimport { hasSlotContent } from '@/common/utils';\nimport { DtText } from '@/components/Text';\n\nexport default {\n name: 'DtNoticeContent',\n\n components: { DtText },\n\n props: {\n /**\n * Header text of the notice. This can be left blank to remove the header from the notice entirely.\n * Can also be overridden with the header slot.\n */\n headerText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The main textual content of the notice. Rendered as the fallback of the default slot so\n * that, like headerText, an absent or empty value leaves the slot empty and the message\n * paragraph is not rendered at all.\n */\n message: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID for the header element of the component. Useful for aria-describedby\n * or aria-labelledby or any other reason you may need an id to refer to the header.\n */\n headerId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID for the content element of the component. Useful for aria-describedby\n * or aria-labelledby or any other reason you may need an id to refer to the content.\n */\n contentId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n },\n\n data () {\n return {\n hasSlotContent,\n };\n },\n};\n</script>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"notice-content.cjs","names":[],"sources":["../../../components/Notice/NoticeContent.vue"],"sourcesContent":["<template>\n <div\n :class=\"['d-notice__content', contentClass]\"\n data-qa=\"notice-content\"\n >\n <dt-text\n v-if=\"headerText || hasSlotContent($slots.header)\"\n :id=\"headerId\"\n kind=\"headline\"\n :size=\"300\"\n density=\"200\"\n wrap=\"pretty\"\n as=\"p\"\n :class=\"['d-notice__title', headerClass]\"\n data-qa=\"notice-content-title\"\n >\n <!-- @slot Slot for the header -->\n <slot name=\"header\">\n {{ headerText }}\n </slot>\n </dt-text>\n <dt-text\n v-if=\"message || hasSlotContent($slots.default)\"\n :id=\"contentId\"\n kind=\"body\"\n :size=\"200\"\n wrap=\"pretty\"\n as=\"p\"\n class=\"d-notice__message\"\n data-qa=\"notice-content-message\"\n >\n <!-- @slot Slot for main content -->\n <slot>\n {{ message }}\n </slot>\n </dt-text>\n </div>\n</template>\n\n<script>\nimport { hasSlotContent } from '@/common/utils';\nimport { DtText } from '@/components/Text';\n\nexport default {\n name: 'DtNoticeContent',\n\n components: { DtText },\n\n props: {\n /**\n * Header text of the notice. This can be left blank to remove the header from the notice entirely.\n * Can also be overridden with the header slot.\n */\n headerText: {\n type: String,\n default: undefined,\n },\n\n /**\n * The main textual content of the notice. Rendered as the fallback of the default slot so\n * that, like headerText, an absent or empty value leaves the slot empty and the message\n * paragraph is not rendered at all.\n */\n message: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID for the header element of the component. Useful for aria-describedby\n * or aria-labelledby or any other reason you may need an id to refer to the header.\n */\n headerId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID for the content element of the component. Useful for aria-describedby\n * or aria-labelledby or any other reason you may need an id to refer to the content.\n */\n contentId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n },\n\n data () {\n return {\n hasSlotContent,\n };\n },\n};\n</script>\n"],"mappings":"mSA2CA,IAAK,EAAU,CACb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AO,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../_plugin-vue_export-helper-
|
|
3
|
-
import { t as n } from "../../Text-
|
|
1
|
+
import { _ as e } from "../../utils-BL_SrwnF.js";
|
|
2
|
+
import { t } from "../../_plugin-vue_export-helper-BecorN_g.js";
|
|
3
|
+
import { t as n } from "../../Text-CfiPqjL0.js";
|
|
4
4
|
import { createBlock as r, createCommentVNode as i, createElementBlock as a, createTextVNode as o, normalizeClass as s, openBlock as c, renderSlot as l, resolveComponent as u, toDisplayString as d, withCtx as f } from "vue";
|
|
5
5
|
//#region components/Notice/NoticeContent.vue
|
|
6
6
|
var p = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../utils-GofHWJKi.cjs`),t=require(`../../_plugin-vue_export-helper-CX7YVcP6.cjs`),n=require(`./notice-constants.cjs`);let r=require(`vue`),i=require(`@dialpad/dialtone-icons/vue`);var a=new Map([[`info`,i.DtIconInfo],[`positive`,i.DtIconCheckCircle],[`warning`,i.DtIconAlertTriangle],[`critical`,i.DtIconAlertCircle],[`base`,i.DtIconBell]]),o={name:`DtNoticeIcon`,components:{DtIconInfo:i.DtIconInfo,DtIconCheckCircle:i.DtIconCheckCircle,DtIconAlertTriangle:i.DtIconAlertTriangle,DtIconAlertCircle:i.DtIconAlertCircle,DtIconBell:i.DtIconBell},props:{kind:{type:String,default:`base`,validator(e){return n.NOTICE_KINDS.includes(e)}},iconClass:{type:[String,Array,Object],default:``}},data(){return{hasSlotContent:e._}},computed:{defaultIcon(){return a.get(this.kind)}}};function s(e,t,n,i,a,o){return o.defaultIcon||a.hasSlotContent(e.$slots.default)?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,"aria-hidden":`true`,class:(0,r.normalizeClass)([`d-notice__icon`,n.iconClass])},[(0,r.renderSlot)(e.$slots,`default`,{},()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(o.defaultIcon),{size:`400`}))])],2)):(0,r.createCommentVNode)(``,!0)}var c=t.t(o,[[`render`,s]]);exports.default=c;
|
|
2
2
|
//# sourceMappingURL=notice-icon.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice-icon.cjs","names":[],"sources":["../../../components/Notice/NoticeIcon.vue"],"sourcesContent":["<template>\n <div\n v-if=\"defaultIcon || hasSlotContent($slots.default)\"\n aria-hidden=\"true\"\n :class=\"['d-notice__icon', iconClass]\"\n >\n <!-- @slot Slot for the main content -->\n <slot>\n <component\n :is=\"defaultIcon\"\n size=\"400\"\n />\n </slot>\n </div>\n</template>\n\n<script>\nimport {\n DtIconInfo,\n DtIconCheckCircle,\n DtIconAlertTriangle,\n DtIconAlertCircle,\n DtIconBell,\n} from '@dialpad/dialtone-icons/vue';\nimport { NOTICE_KINDS } from './NoticeConstants.js';\nimport { hasSlotContent } from '@/common/utils';\n\nconst kindToIcon = new Map([\n ['info', DtIconInfo],\n ['positive', DtIconCheckCircle],\n ['warning', DtIconAlertTriangle],\n ['critical', DtIconAlertCircle],\n ['base', DtIconBell],\n]);\n\nexport default {\n name: 'DtNoticeIcon',\n\n components: {\n DtIconInfo,\n DtIconCheckCircle,\n DtIconAlertTriangle,\n DtIconAlertCircle,\n DtIconBell,\n },\n\n props: {\n /**\n * Kind of icon\n * @values base, critical, info, positive, warning\n */\n kind: {\n type: String,\n default: 'base',\n validator (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the icon wrapper element.\n */\n iconClass: {\n type: [String, Array, Object],\n default: '',\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"],"mappings":"
|
|
1
|
+
{"version":3,"file":"notice-icon.cjs","names":[],"sources":["../../../components/Notice/NoticeIcon.vue"],"sourcesContent":["<template>\n <div\n v-if=\"defaultIcon || hasSlotContent($slots.default)\"\n aria-hidden=\"true\"\n :class=\"['d-notice__icon', iconClass]\"\n >\n <!-- @slot Slot for the main content -->\n <slot>\n <component\n :is=\"defaultIcon\"\n size=\"400\"\n />\n </slot>\n </div>\n</template>\n\n<script>\nimport {\n DtIconInfo,\n DtIconCheckCircle,\n DtIconAlertTriangle,\n DtIconAlertCircle,\n DtIconBell,\n} from '@dialpad/dialtone-icons/vue';\nimport { NOTICE_KINDS } from './NoticeConstants.js';\nimport { hasSlotContent } from '@/common/utils';\n\nconst kindToIcon = new Map([\n ['info', DtIconInfo],\n ['positive', DtIconCheckCircle],\n ['warning', DtIconAlertTriangle],\n ['critical', DtIconAlertCircle],\n ['base', DtIconBell],\n]);\n\nexport default {\n name: 'DtNoticeIcon',\n\n components: {\n DtIconInfo,\n DtIconCheckCircle,\n DtIconAlertTriangle,\n DtIconAlertCircle,\n DtIconBell,\n },\n\n props: {\n /**\n * Kind of icon\n * @values base, critical, info, positive, warning\n */\n kind: {\n type: String,\n default: 'base',\n validator (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the icon wrapper element.\n */\n iconClass: {\n type: [String, Array, Object],\n default: '',\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"],"mappings":"2UA2BA,IAAM,EAAa,IAAI,IAAI,CACzB,CAAC,OAAQ,EAAA,WAAW,CACpB,CAAC,WAAY,EAAA,kBAAkB,CAC/B,CAAC,UAAW,EAAA,oBAAoB,CAChC,CAAC,WAAY,EAAA,kBAAkB,CAC/B,CAAC,OAAQ,EAAA,WAAW,CACrB,CAAC,CAEG,EAAU,CACb,KAAM,eAEN,WAAY,CACV,WAAA,EAAA,WACA,kBAAA,EAAA,kBACA,oBAAA,EAAA,oBACA,kBAAA,EAAA,kBACA,WAAA,EAAA,WACD,CAED,MAAO,CAKL,KAAM,CACJ,KAAM,OACN,QAAS,OACT,UAAW,EAAM,CACf,OAAO,EAAA,aAAa,SAAS,EAAK,EAErC,CAKD,UAAW,CACT,KAAM,CAAC,OAAQ,MAAO,OAAO,CAC7B,QAAS,GACV,CACF,CAED,MAAQ,CACN,MAAO,CACL,eAAA,EAAA,EACD,EAGH,SAAU,CACR,aAAe,CACb,OAAO,EAAW,IAAI,KAAK,KAAK,EAEnC,CACF,gCA7ES,EAAA,aAAe,EAAA,eAAe,EAAA,OAAO,QAAO,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAW9C,MAAA,OAVJ,cAAY,OACX,OAAA,EAAA,EAAA,gBAAK,CAAA,iBAAqB,EAAA,UAAS,CAAA,oBAQ7B,EAAA,OAAA,UAAA,EAAA,KAAA,GAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,cAAA,EAAA,EAAA,yBAHE,EAAA,YAAW,CAAA,CAChB,KAAK,MAAK,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,GAAA,EAAA,EAAA,oBAAA,GAAA,GAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../_plugin-vue_export-helper-
|
|
1
|
+
import { _ as e } from "../../utils-BL_SrwnF.js";
|
|
2
|
+
import { t } from "../../_plugin-vue_export-helper-BecorN_g.js";
|
|
3
3
|
import { NOTICE_KINDS as n } from "./notice-constants.js";
|
|
4
4
|
import { createBlock as r, createCommentVNode as i, createElementBlock as a, normalizeClass as o, openBlock as s, renderSlot as c, resolveDynamicComponent as l } from "vue";
|
|
5
5
|
import { DtIconAlertCircle as u, DtIconAlertTriangle as d, DtIconBell as f, DtIconCheckCircle as p, DtIconInfo as m } from "@dialpad/dialtone-icons/vue";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-CX7YVcP6.cjs`),t=require(`./notice-constants.cjs`),n=require(`./notice-icon.cjs`),r=require(`./notice-content.cjs`),i=require(`./notice-action.cjs`);let a=require(`vue`);var o={name:`DtNotice`,components:{DtNoticeIcon:n.default,DtNoticeContent:r.default,DtNoticeAction:i.default},props:{headerId:{type:String,default:void 0},contentId:{type:String,default:void 0},headerText:{type:String,default:void 0},role:{type:String,default:`status`,validate(e){return t.NOTICE_ROLES.includes(e)}},important:{type:Boolean,default:!1},kind:{type:String,default:`base`,validator(e){return t.NOTICE_KINDS.includes(e)}},showClose:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},showAction:{type:Boolean,default:!0},truncateText:{type:Boolean,default:!1},iconClass:{type:[String,Array,Object],default:``},headerClass:{type:[String,Array,Object],default:``},contentClass:{type:[String,Array,Object],default:``},actionClass:{type:[String,Array,Object],default:``}},emits:[`close`,`click`],computed:{noticeClass(){return[`d-notice`,{critical:`d-notice--critical`,info:`d-notice--info`,positive:`d-notice--positive`,warning:`d-notice--warning`,base:`d-notice--base`}[this.kind],{"d-notice--important":this.important,"d-notice--truncate":this.truncateText}]}}};function s(e,t,n,r,i,o){let s=(0,a.resolveComponent)(`dt-notice-icon`),c=(0,a.resolveComponent)(`dt-notice-content`),l=(0,a.resolveComponent)(`dt-notice-action`);return(0,a.openBlock)(),(0,a.createElementBlock)(`aside`,{class:(0,a.normalizeClass)(o.noticeClass),"data-qa":`notice`},[n.showIcon?((0,a.openBlock)(),(0,a.createBlock)(s,{key:0,kind:n.kind,"icon-class":n.iconClass,class:(0,a.normalizeClass)({"d-notice__icon--has-title":n.headerText||e.$slots.header})},{default:(0,a.withCtx)(()=>[(0,a.renderSlot)(e.$slots,`icon`)]),_:3},8,[`kind`,`icon-class`,`class`])):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)(c,{"header-id":n.headerId,"content-id":n.contentId,"header-text":n.headerText,"header-class":n.headerClass,"content-class":n.contentClass,role:n.role},{header:(0,a.withCtx)(()=>[(0,a.renderSlot)(e.$slots,`header`)]),default:(0,a.withCtx)(()=>[(0,a.renderSlot)(e.$slots,`default`)]),_:3},8,[`header-id`,`content-id`,`header-text`,`header-class`,`content-class`,`role`]),(0,a.createVNode)(l,{"show-action":n.showAction,"show-close":n.showClose,"action-class":n.actionClass,onClose:t[0]||(t[0]=t=>e.$emit(`close`))},{default:(0,a.withCtx)(()=>[(0,a.renderSlot)(e.$slots,`action`)]),_:3},8,[`show-action`,`show-close`,`action-class`])],2)}var c=e.t(o,[[`render`,s]]);exports.default=c;
|
|
2
2
|
//# sourceMappingURL=notice.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../_plugin-vue_export-helper-
|
|
1
|
+
import { t as e } from "../../_plugin-vue_export-helper-BecorN_g.js";
|
|
2
2
|
import { NOTICE_KINDS as t, NOTICE_ROLES as n } from "./notice-constants.js";
|
|
3
3
|
import r from "./notice-icon.js";
|
|
4
4
|
import i from "./notice-content.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-CX7YVcP6.cjs`),t=require(`../../localization/index.cjs`),n=require(`../button/button.cjs`);let r=require(`vue`),i=require(`@dialpad/dialtone-icons/vue`);var a={name:`DtPagination`,components:{DtButton:n.default,DtIconChevronLeft:i.DtIconChevronLeft,DtIconChevronRight:i.DtIconChevronRight,DtIconMoreHorizontal:i.DtIconMoreHorizontal},props:{ariaLabel:{type:String,required:!0},totalPages:{type:Number,required:!0},activePage:{type:Number,default:1},maxVisible:{type:Number,default:5},showEdges:{type:Boolean,default:!0}},emits:[`change`],data(){return{currentPage:this.activePage,i18n:new t.DialtoneLocalization}},computed:{isFirstPage(){return this.currentPage===1},isLastPage(){return this.currentPage===this.totalPages},pages(){if(this.maxVisible===0)return[];if(this.totalPages<=this.maxVisible)return this.range(1,this.totalPages);let e=this.maxVisible-1,t=this.totalPages-e+1;if(this.showEdges||(e+=1,--t),this.currentPage<e){let t=[...this.range(1,e),`...`];return this.showEdges&&t.push(this.totalPages),t}if(this.currentPage>t){let e=[`...`,...this.range(t,this.totalPages)];return this.showEdges&&e.unshift(1),e}let n=this.maxVisible-(3-this.maxVisible%2),r=Math.floor(n/2),i=this.currentPage-r,a=this.currentPage+r;this.showEdges||(--i,a+=1);let o=[`...`,...this.range(i,a),`...`];return this.showEdges?[1,...o,this.totalPages]:o},prevAriaLabel(){return this.isFirstPage?this.i18n.$t(`DIALTONE_PAGINATION_FIRST_PAGE`):this.i18n.$t(`DIALTONE_PAGINATION_PREVIOUS_PAGE`)},nextAriaLabel(){return this.isLastPage?this.i18n.$t(`DIALTONE_PAGINATION_LAST_PAGE`):this.i18n.$t(`DIALTONE_PAGINATION_NEXT_PAGE`)},pageNumberAriaLabel(){return e=>e===this.totalPages?`${this.i18n.$t(`DIALTONE_PAGINATION_LAST_PAGE`)} ${e}`:`${this.i18n.$t(`DIALTONE_PAGINATION_PAGE_NUMBER`,{page:e})}`}},watch:{activePage(){this.currentPage=this.activePage},totalPages(e){(this.currentPage>e||this.currentPage<=0)&&(this.currentPage=e)}},methods:{range(e,t){let n=[];e=e>0?e:1;for(let r=e;r<=t;r++)n.push(r);return n},changePage(e){this.currentPage=e,this.$emit(`change`,this.currentPage)}}},o=[`aria-label`],s={key:0,class:`d-pagination__separator-icon`,"data-qa":`dt-pagination-separator`};function c(e,t,n,i,a,c){let l=(0,r.resolveComponent)(`dt-icon-chevron-left`),u=(0,r.resolveComponent)(`dt-button`),d=(0,r.resolveComponent)(`dt-icon-more-horizontal`),f=(0,r.resolveComponent)(`dt-icon-chevron-right`);return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createElementBlock)(`nav`,{"aria-label":n.ariaLabel,class:`d-pagination`},[(0,r.createVNode)(u,{class:`d-pagination__button`,"data-qa":`dt-pagination-prev`,"aria-label":c.prevAriaLabel,kind:`muted`,importance:`clear`,disabled:c.isFirstPage,onClick:t[0]||(t[0]=e=>c.changePage(a.currentPage-1))},{startIcon:(0,r.withCtx)(()=>[(0,r.createVNode)(l,{size:`300`})]),_:1},8,[`aria-label`,`disabled`]),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(c.pages,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`page-${e}-${t}`,class:(0,r.normalizeClass)({"d-pagination__separator":isNaN(Number(e))})},[isNaN(Number(e))?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,s,[(0,r.createVNode)(d,{size:`300`})])):((0,r.openBlock)(),(0,r.createBlock)(u,{key:1,class:`d-pagination__item`,"aria-label":c.pageNumberAriaLabel(e),kind:a.currentPage===e?`default`:`muted`,importance:a.currentPage===e?`primary`:`clear`,"label-class":`d-pagination__item-label`,onClick:t=>c.changePage(e)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e),1)]),_:2},1032,[`aria-label`,`kind`,`importance`,`onClick`]))],2))),128)),(0,r.createVNode)(u,{class:`d-pagination__button`,"data-qa":`dt-pagination-next`,"aria-label":c.nextAriaLabel,disabled:c.isLastPage,kind:`muted`,importance:`clear`,onClick:t[1]||(t[1]=e=>c.changePage(a.currentPage+1))},{startIcon:(0,r.withCtx)(()=>[(0,r.createVNode)(f,{size:`300`})]),_:1},8,[`aria-label`,`disabled`])],8,o)),[[r.vShow,n.totalPages>0]])}var l=e.t(a,[[`render`,c]]);exports.default=l;
|
|
2
2
|
//# sourceMappingURL=pagination.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../_plugin-vue_export-helper-
|
|
1
|
+
import { t as e } from "../../_plugin-vue_export-helper-BecorN_g.js";
|
|
2
2
|
import { DialtoneLocalization as t } from "../../localization/index.js";
|
|
3
3
|
import n from "../button/button.js";
|
|
4
4
|
import { Fragment as r, createBlock as i, createElementBlock as a, createTextVNode as o, createVNode as s, normalizeClass as c, openBlock as l, renderList as u, resolveComponent as d, toDisplayString as f, vShow as p, withCtx as m, withDirectives as h } from "vue";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../utils-GofHWJKi.cjs`),t=require(`../../_plugin-vue_export-helper-CX7YVcP6.cjs`),n=require(`../../localization/index.cjs`),r=require(`../button/button.cjs`);let i=require(`vue`),a=require(`@dialpad/dialtone-icons/vue`);var o={name:`PopoverHeaderFooter`,components:{DtButton:r.default,DtIconClose:a.DtIconClose},props:{type:{type:String,validator:function(e){return[`header`,`footer`].includes(e)}},wrapperClass:{type:[String,Array,Object],default:``},contentClass:{type:[String,Array,Object],default:``},closeRole:{type:String,default:void 0},showCloseButton:{type:Boolean,default:!1}},emits:[`close`],data(){return{hasSlotContent:e._,i18n:new n.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t(`DIALTONE_CLOSE_BUTTON`)}},methods:{focusCloseButton(){e.O(this.$refs[`popover__close-button`]?.$el)?.focus()}}};function s(e,t,n,r,a,o){let s=(0,i.resolveComponent)(`dt-icon-close`),c=(0,i.resolveComponent)(`dt-button`);return(0,i.openBlock)(),(0,i.createElementBlock)(`div`,{"data-qa":`dt-popover-header-footer`,class:(0,i.normalizeClass)([{"d-popover__header":n.type===`header`,"d-popover__footer":n.type===`footer`},n.wrapperClass])},[a.hasSlotContent(e.$slots.content)?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:0,"data-qa":`dt-popover-header-footer-content`,class:(0,i.normalizeClass)([{"d-popover__header__content":n.type===`header`,"d-popover__footer__content":n.type===`footer`},n.contentClass])},[(0,i.renderSlot)(e.$slots,`content`)],2)):(0,i.createCommentVNode)(``,!0),n.showCloseButton?((0,i.openBlock)(),(0,i.createBlock)(c,{key:1,ref:`popover__close-button`,"data-qa":`dt-popover-close`,class:(0,i.normalizeClass)({"d-popover__header__close-button":n.type===`header`,"d-popover__footer__close-button":n.type===`footer`}),importance:`outlined`,kind:`muted`,circle:``,"aria-label":o.closeButtonTitle,title:o.closeButtonTitle,role:n.closeRole,onClick:t[0]||(t[0]=t=>e.$emit(`close`))},{icon:(0,i.withCtx)(()=>[(0,i.createVNode)(s,{size:`300`})]),_:1},8,[`class`,`aria-label`,`title`,`role`])):(0,i.createCommentVNode)(``,!0)],2)}var c=t.t(o,[[`render`,s]]);exports.default=c;
|
|
2
2
|
//# sourceMappingURL=popover-header-footer.cjs.map
|