@dialpad/dialtone-vue 4.9.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-WsLvegw6.js → Combobox-BKj61IcR.js} +5 -5
- package/dist/{Combobox-WsLvegw6.js.map → Combobox-BKj61IcR.js.map} +1 -1
- package/dist/Combobox-BOGcBq-6.cjs +3 -0
- package/dist/{Combobox-96zAPv6d.cjs.map → Combobox-BOGcBq-6.cjs.map} +1 -1
- package/dist/{Datepicker-D-Lgvthq.js → Datepicker-DOSIyo8a.js} +39 -39
- package/dist/{Datepicker-D-Lgvthq.js.map → Datepicker-DOSIyo8a.js.map} +1 -1
- package/dist/Datepicker-DfdVsVb9.cjs +2 -0
- package/dist/{Datepicker-DmKOuf5y.cjs.map → Datepicker-DfdVsVb9.cjs.map} +1 -1
- package/dist/{EmojiPicker-D46lLRMp.js → EmojiPicker-B_ZVTdOY.js} +2 -2
- package/dist/{EmojiPicker-D46lLRMp.js.map → EmojiPicker-B_ZVTdOY.js.map} +1 -1
- package/dist/EmojiPicker-DS8XmAHV.cjs +2 -0
- package/dist/{EmojiPicker-CXFd-iVj.cjs.map → EmojiPicker-DS8XmAHV.cjs.map} +1 -1
- package/dist/FilterPill-BmYe_SsY.cjs +2 -0
- package/dist/{FilterPill-DY9T19XB.cjs.map → FilterPill-BmYe_SsY.cjs.map} +1 -1
- package/dist/{FilterPill-IBlswKiK.js → FilterPill-C4TXD8Tl.js} +5 -5
- package/dist/{FilterPill-IBlswKiK.js.map → FilterPill-C4TXD8Tl.js.map} +1 -1
- package/dist/{ForceLinkify-DhmBEXhe.cjs → ForceLinkify-BMmlUc8Q.cjs} +1 -1
- package/dist/{ForceLinkify-DhmBEXhe.cjs.map → ForceLinkify-BMmlUc8Q.cjs.map} +1 -1
- package/dist/{ForceLinkify-53Zegx7z.js → ForceLinkify-Cw3Q1Nn7.js} +1 -1
- package/dist/{ForceLinkify-53Zegx7z.js.map → ForceLinkify-Cw3Q1Nn7.js.map} +1 -1
- package/dist/{MarkdownRenderer-Cnbn7gje.js → MarkdownRenderer-BR-fbldH.js} +1 -1
- package/dist/{MarkdownRenderer-Cnbn7gje.js.map → MarkdownRenderer-BR-fbldH.js.map} +1 -1
- package/dist/{MarkdownRenderer-a12waV7r.cjs → MarkdownRenderer-CH4L8Evn.cjs} +1 -1
- package/dist/{MarkdownRenderer-a12waV7r.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-Ddsm-H14.js → Resizable-BkijqucD.js} +3 -3
- package/dist/{Resizable-Ddsm-H14.js.map → Resizable-BkijqucD.js.map} +1 -1
- package/dist/{Resizable-DdP6uPio.cjs → Resizable-DQoUk81S.cjs} +2 -2
- package/dist/{Resizable-DdP6uPio.cjs.map → Resizable-DQoUk81S.cjs.map} +1 -1
- package/dist/{ResizableHandle-_ldmhyEw.cjs → ResizableHandle-D2gZ6dg5.cjs} +2 -2
- package/dist/{ResizableHandle-_ldmhyEw.cjs.map → ResizableHandle-D2gZ6dg5.cjs.map} +1 -1
- package/dist/{ResizableHandle-DQduVxrG.js → ResizableHandle-MDdaNR_t.js} +3 -3
- package/dist/{ResizableHandle-DQduVxrG.js.map → ResizableHandle-MDdaNR_t.js.map} +1 -1
- package/dist/{ResizableUtils-BptSHmLg.cjs → ResizableUtils-CXU7o9pL.cjs} +1 -1
- package/dist/{ResizableUtils-BptSHmLg.cjs.map → ResizableUtils-CXU7o9pL.cjs.map} +1 -1
- package/dist/{ResizableUtils-BIRNCdKB.js → ResizableUtils-ChIk3Blc.js} +1 -1
- package/dist/{ResizableUtils-BIRNCdKB.js.map → ResizableUtils-ChIk3Blc.js.map} +1 -1
- package/dist/{RichTextEditor-DhNhx5AH.js → RichTextEditor-BIcaFJQp.js} +15 -15
- package/dist/{RichTextEditor-DhNhx5AH.js.map → RichTextEditor-BIcaFJQp.js.map} +1 -1
- package/dist/RichTextEditor-D6kCBnLJ.cjs +11 -0
- package/dist/{RichTextEditor-CjyvDYID.cjs.map → RichTextEditor-D6kCBnLJ.cjs.map} +1 -1
- package/dist/{Scroller-D7MjyXun.js → Scroller-D6LZtmkL.js} +3 -3
- package/dist/{Scroller-D7MjyXun.js.map → Scroller-D6LZtmkL.js.map} +1 -1
- package/dist/Scroller-eXc7l23J.cjs +2 -0
- package/dist/{Scroller-Bt8TUghI.cjs.map → Scroller-eXc7l23J.cjs.map} +1 -1
- package/dist/Slider-B7O2M5_S.cjs +2 -0
- package/dist/{Slider-CfvbLBv5.cjs.map → Slider-B7O2M5_S.cjs.map} +1 -1
- package/dist/{Slider-Xd5Aj9nS.js → Slider-oJROUIMS.js} +7 -7
- package/dist/{Slider-Xd5Aj9nS.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-CfiPqjL0.js +404 -0
- package/dist/Text-CfiPqjL0.js.map +1 -0
- package/dist/{TextList-DUL3NwQp.cjs → TextList-D3HHK2DW.cjs} +1 -1
- package/dist/{TextList-DUL3NwQp.cjs.map → TextList-D3HHK2DW.cjs.map} +1 -1
- package/dist/{TextList-CkY7OAl2.js → TextList-DXEov7Ls.js} +1 -1
- package/dist/{TextList-CkY7OAl2.js.map → TextList-DXEov7Ls.js.map} +1 -1
- package/dist/TextListItem-C2Vc8Gnu.cjs +2 -0
- package/dist/{TextListItem-BI9M_J8Y.cjs.map → TextListItem-C2Vc8Gnu.cjs.map} +1 -1
- package/dist/{TextListItem-D96feMQf.js → TextListItem-CaFTtZ3G.js} +2 -2
- package/dist/{TextListItem-D96feMQf.js.map → TextListItem-CaFTtZ3G.js.map} +1 -1
- package/dist/{Toast-DmzQrYtG.js → Toast-AGiQccuG.js} +3 -3
- package/dist/{Toast-DmzQrYtG.js.map → Toast-AGiQccuG.js.map} +1 -1
- package/dist/Toast-DImJ0PkZ.cjs +2 -0
- package/dist/{Toast-BXvUrvd_.cjs.map → Toast-DImJ0PkZ.cjs.map} +1 -1
- package/dist/{UseResizableCalculations-BNcxJfef.cjs → UseResizableCalculations-D4xVxWje.cjs} +2 -2
- package/dist/{UseResizableCalculations-BNcxJfef.cjs.map → UseResizableCalculations-D4xVxWje.cjs.map} +1 -1
- package/dist/{UseResizableCalculations-k6TSRlpa.js → UseResizableCalculations-DTxD7NKO.js} +2 -2
- package/dist/{UseResizableCalculations-k6TSRlpa.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/Banner/Banner.vue.d.ts +53 -1
- package/dist/components/Banner/Banner.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +53 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +53 -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 -3
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts +53 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts +53 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPill.vue.d.ts +161 -6
- 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/Input/Input.vue.d.ts +53 -1
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts +53 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts.map +1 -1
- package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts +53 -1
- package/dist/components/Modal/Modal.vue.d.ts +53 -1
- package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
- package/dist/components/Notice/Notice.vue.d.ts +53 -1
- package/dist/components/Notice/Notice.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts +53 -1
- package/dist/components/Notice/NoticeContent.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/Radio/Radio.vue.d.ts +53 -1
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/Mentions/MentionSuggestion.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/SlashCommand/SlashCommandSuggestion.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +54 -1
- 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/SelectMenu/SelectMenu.vue.d.ts +53 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButton.vue.d.ts +1 -3
- 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/Text.vue.d.ts +53 -1
- package/dist/components/Text/Text.vue.d.ts.map +1 -1
- package/dist/components/Text/TextConstants.d.ts +2 -0
- package/dist/components/Text/TextConstants.d.ts.map +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Text/modules/SlideViewport.vue.d.ts +38 -0
- package/dist/components/Text/modules/SlideViewport.vue.d.ts.map +1 -0
- package/dist/components/Text/modules/slide.d.ts +19 -0
- package/dist/components/Text/modules/slide.d.ts.map +1 -0
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts +53 -1
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts.map +1 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts +53 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +212 -4
- package/dist/components/Toast/Toast.vue.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 +62 -61
- package/dist/{floating-ui.dom-BUeA6pp4.js → floating-ui.dom-CuL5LTgX.js} +1 -1
- package/dist/{floating-ui.dom-BUeA6pp4.js.map → floating-ui.dom-CuL5LTgX.js.map} +1 -1
- package/dist/{floating-ui.dom-DF2uE3n8.cjs → floating-ui.dom-S7QIcAlj.cjs} +1 -1
- package/dist/{floating-ui.dom-DF2uE3n8.cjs.map → floating-ui.dom-S7QIcAlj.cjs.map} +1 -1
- package/dist/index.d.ts +1 -1
- 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.cjs.map +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 +8 -18
- 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.cjs.map +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.cjs.map +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 +101 -83
- 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 +3 -3
- package/dist/lib/text/text-constants.cjs +1 -1
- package/dist/lib/text/text-constants.cjs.map +1 -1
- package/dist/lib/text/text-constants.js +5 -4
- package/dist/lib/text/text-constants.js.map +1 -1
- package/dist/lib/text/text.cjs +1 -2
- package/dist/lib/text/text.js +2 -184
- 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 +11 -6
- package/dist/Combobox-96zAPv6d.cjs +0 -3
- package/dist/Datepicker-DmKOuf5y.cjs +0 -2
- package/dist/EmojiPicker-CXFd-iVj.cjs +0 -2
- package/dist/FilterPill-DY9T19XB.cjs +0 -2
- package/dist/RichTextEditor-CjyvDYID.cjs +0 -11
- package/dist/Scroller-Bt8TUghI.cjs +0 -2
- package/dist/Slider-CfvbLBv5.cjs +0 -2
- package/dist/TextListItem-BI9M_J8Y.cjs +0 -2
- package/dist/Toast-BXvUrvd_.cjs +0 -2
- package/dist/common/utils/index.cjs.map +0 -1
- package/dist/lib/text/text.cjs.map +0 -1
- package/dist/lib/text/text.js.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
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { DEFAULT_VALIDATION_MESSAGE_TYPE as e, VALIDATION_MESSAGE_TYPES as t } from "./common/constants/index.js";
|
|
2
|
+
import { Comment as n, Text as r, h as ee } from "vue";
|
|
3
|
+
//#region common/owned_classes.js
|
|
4
|
+
var i = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
function a(e, t, n) {
|
|
6
|
+
let r = i.get(e);
|
|
7
|
+
r || (r = /* @__PURE__ */ new Map(), i.set(e, r)), !r.has(n) && (r.set(n, t), e.classList.add(t));
|
|
8
|
+
}
|
|
9
|
+
function o(e, t) {
|
|
10
|
+
let n = i.get(e), r = n?.get(t);
|
|
11
|
+
if (r) {
|
|
12
|
+
n.delete(t), n.size || i.delete(e);
|
|
13
|
+
for (let e of n.values()) if (e === r) return;
|
|
14
|
+
e.classList.remove(r);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function s(e) {
|
|
18
|
+
return i.has(e);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region common/utils/index.js
|
|
22
|
+
var c = 0, l, u = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]", d = typeof setImmediate == "function" ? setImmediate : setTimeout;
|
|
23
|
+
function f(e = "dt") {
|
|
24
|
+
return `${e}${c++}`;
|
|
25
|
+
}
|
|
26
|
+
function p(e, t) {
|
|
27
|
+
if (t) {
|
|
28
|
+
let n = m(t);
|
|
29
|
+
return e[Math.abs(n) % e.length];
|
|
30
|
+
} else return e[h(e.length)];
|
|
31
|
+
}
|
|
32
|
+
function m(e) {
|
|
33
|
+
let t;
|
|
34
|
+
for (let n = 0; n < e.length; n++) t = Math.imul(31, t) + e.charCodeAt(n) | 0;
|
|
35
|
+
return t;
|
|
36
|
+
}
|
|
37
|
+
function h(e) {
|
|
38
|
+
return Math.floor(Math.random() * e);
|
|
39
|
+
}
|
|
40
|
+
function g(t) {
|
|
41
|
+
return t ? t.map((t) => typeof t == "string" ? {
|
|
42
|
+
message: t,
|
|
43
|
+
type: e
|
|
44
|
+
} : t) : [];
|
|
45
|
+
}
|
|
46
|
+
function _(e) {
|
|
47
|
+
let t = v(e);
|
|
48
|
+
return !e || !t ? [] : e.filter((e) => !!e.message && e.type === t);
|
|
49
|
+
}
|
|
50
|
+
function v(e) {
|
|
51
|
+
return e ? y(e, t.CRITICAL) ? t.CRITICAL : y(e, t.WARNING) ? t.WARNING : y(e, t.POSITIVE) ? t.POSITIVE : y(e, t.INFO) ? t.INFO : null : null;
|
|
52
|
+
}
|
|
53
|
+
function y(e, t) {
|
|
54
|
+
return !e || !t ? !1 : e.some((e) => e?.type === t);
|
|
55
|
+
}
|
|
56
|
+
function b(e) {
|
|
57
|
+
return e?.querySelector(u);
|
|
58
|
+
}
|
|
59
|
+
var x = (e) => ee("div", { innerHTML: e.html }), S = () => new Promise((e) => {
|
|
60
|
+
d(e);
|
|
61
|
+
});
|
|
62
|
+
function C(e, t = {}) {
|
|
63
|
+
return e ? e(t).some((e) => e.type === n || Array.isArray(e.children) && !e.children.length ? !1 : e.type !== r || typeof e.children == "string" && e.children.trim() !== "") : !1;
|
|
64
|
+
}
|
|
65
|
+
var w = (e) => e?.toLowerCase().split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(""), te = (e) => e.replace(/\.?([A-Z0-9]+)/g, (e, t) => "-" + t.toLowerCase()).replace(/^-/, ""), T = (e) => {
|
|
66
|
+
let t = Object.entries(e).filter(([e]) => e.match(/on[A-Z]/));
|
|
67
|
+
return Object.fromEntries(t);
|
|
68
|
+
}, E = (e) => {
|
|
69
|
+
let t = Object.entries(e).filter(([e]) => !e.match(/on[A-Z]/));
|
|
70
|
+
return Object.fromEntries(t);
|
|
71
|
+
}, D = (e) => e?.nodeType === Node.ELEMENT_NODE ? e : e?.nodeType ? D(e?.nextSibling) : null;
|
|
72
|
+
function O(e) {
|
|
73
|
+
let t = Object.entries(e).filter(([e]) => !["class", "style"].includes(e));
|
|
74
|
+
return Object.fromEntries(t);
|
|
75
|
+
}
|
|
76
|
+
function k(e, t = 300) {
|
|
77
|
+
clearTimeout(l), l = setTimeout(e, t);
|
|
78
|
+
}
|
|
79
|
+
function A(e) {
|
|
80
|
+
let t = e.getBoundingClientRect(), n = {
|
|
81
|
+
top: t.top < 0,
|
|
82
|
+
left: t.left < 0,
|
|
83
|
+
bottom: t.bottom > (window.innerHeight || document.documentElement.clientHeight),
|
|
84
|
+
right: t.right > (window.innerWidth || document.documentElement.clientWidth)
|
|
85
|
+
};
|
|
86
|
+
return n.any = Object.values(n).some((e) => e), n.all = Object.values(n).every((e) => e), n;
|
|
87
|
+
}
|
|
88
|
+
var j = /(?:(?:[^\s!@#$%^&*()_=+[\]{}\\|;:'",.<>/?]+)\.)/, M = /* @__PURE__ */ RegExp("(?:com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|ae|ph|online|ng|ee|ws|ve|cat)"), N = /* @__PURE__ */ RegExp("(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])"), P = RegExp("(?:" + [[j.source, M.source].join("+"), N.source].join("|") + ")"), F = /(?:(?:[;/][^#?<>\s]*)?)/, I = /(?:(?:\?[^#<>\s]+)?(?:#[^<>\s]+)?)/, L = RegExp("\\b" + [
|
|
89
|
+
P.source,
|
|
90
|
+
F.source,
|
|
91
|
+
I.source,
|
|
92
|
+
"(?!\\w)"
|
|
93
|
+
].join("+")), R = /\b[a-z\d.-]+:\/\/[^<>\s]+/, z = RegExp("(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + [P.source, I.source].join("+") + "(?!\\w)");
|
|
94
|
+
function B(e = 7, t = 15) {
|
|
95
|
+
try {
|
|
96
|
+
return RegExp(`(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|\$)|\\s|\$)`);
|
|
97
|
+
} catch {
|
|
98
|
+
console.warn("This browser doesn't support regex lookahead/lookbehind");
|
|
99
|
+
}
|
|
100
|
+
return RegExp(`(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|\$)|\\s|\$)`);
|
|
101
|
+
}
|
|
102
|
+
var V = B(), H = new RegExp([
|
|
103
|
+
L.source,
|
|
104
|
+
R.source,
|
|
105
|
+
z.source,
|
|
106
|
+
V.source
|
|
107
|
+
].join("|"), "gi");
|
|
108
|
+
function U(e) {
|
|
109
|
+
return !e || !["string", "number"].includes(typeof e) ? !1 : (e = e.toString(), V.exec(e)?.[0] === e);
|
|
110
|
+
}
|
|
111
|
+
function W(e) {
|
|
112
|
+
return !e || typeof e != "string" ? !1 : L.exec(e)?.[0] === e || R.exec(e)?.[0] === e;
|
|
113
|
+
}
|
|
114
|
+
function G(e) {
|
|
115
|
+
return !e || typeof e != "string" ? !1 : z.exec(e)?.[0] === e;
|
|
116
|
+
}
|
|
117
|
+
function K(e) {
|
|
118
|
+
return e.filter((e) => !!e).join(", ");
|
|
119
|
+
}
|
|
120
|
+
function q(e, t = "en-US") {
|
|
121
|
+
return e.replace(/^\p{CWU}/u, (e) => e.toLocaleUpperCase(t));
|
|
122
|
+
}
|
|
123
|
+
function J(e, t) {
|
|
124
|
+
typeof process > "u" || process.env.NODE_ENV === "test" && (!e || !(e instanceof HTMLElement) || !document?.body || document.body.contains(e) || console.warn(`The ${t} component is not attached to the document body. This may cause issues.`));
|
|
125
|
+
}
|
|
126
|
+
function Y(e = document.documentElement) {
|
|
127
|
+
return !!e.hasAttribute("data-overlayscrollbars");
|
|
128
|
+
}
|
|
129
|
+
var X = Symbol("legacyScrollLockOwner");
|
|
130
|
+
function Z(e) {
|
|
131
|
+
return Y(e) ? "d-scrollbar-disabled" : "d-of-hidden";
|
|
132
|
+
}
|
|
133
|
+
function Q(e = document.documentElement, t = X) {
|
|
134
|
+
a(e, Z(e), t);
|
|
135
|
+
}
|
|
136
|
+
function $(e = document.documentElement, t = X) {
|
|
137
|
+
s(e) ? o(e, t) : t === X && e.classList.remove(Z(e));
|
|
138
|
+
}
|
|
139
|
+
function ne(e) {
|
|
140
|
+
return e.replaceAll(/[ -]/g, "_").replaceAll(/\W/g, "").toUpperCase();
|
|
141
|
+
}
|
|
142
|
+
var re = {
|
|
143
|
+
getUniqueString: f,
|
|
144
|
+
getRandomElement: p,
|
|
145
|
+
getRandomInt: h,
|
|
146
|
+
formatMessages: g,
|
|
147
|
+
filterFormattedMessages: _,
|
|
148
|
+
hasFormattedMessageOfType: y,
|
|
149
|
+
getValidationState: v,
|
|
150
|
+
htmlFragment: x,
|
|
151
|
+
flushPromises: S,
|
|
152
|
+
kebabCaseToPascalCase: w,
|
|
153
|
+
extractVueListeners: T,
|
|
154
|
+
extractNonListeners: E,
|
|
155
|
+
removeClassStyleAttrs: O,
|
|
156
|
+
returnFirstEl: D,
|
|
157
|
+
debounce: k,
|
|
158
|
+
isOutOfViewPort: A,
|
|
159
|
+
getPhoneNumberRegex: B,
|
|
160
|
+
linkRegex: H,
|
|
161
|
+
isEmailAddress: G,
|
|
162
|
+
isPhoneNumber: U,
|
|
163
|
+
isURL: W,
|
|
164
|
+
safeConcatStrings: K,
|
|
165
|
+
capitalizeFirstLetter: q,
|
|
166
|
+
disableRootScrolling: Q,
|
|
167
|
+
enableRootScrolling: $
|
|
168
|
+
};
|
|
169
|
+
//#endregion
|
|
170
|
+
export { ne as A, m as C, O as D, te as E, J as M, a as N, D as O, o as P, W as S, H as T, C as _, E as a, A as b, b as c, B as d, p as f, y as g, v as h, $ as i, re as j, K as k, S as l, f as m, k as n, T as o, h as p, Q as r, _ as s, q as t, g as u, x as v, w, U as x, G as y };
|
|
171
|
+
|
|
172
|
+
//# sourceMappingURL=utils-BL_SrwnF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-BL_SrwnF.js","names":[],"sources":["../common/owned_classes.js","../common/utils/index.js"],"sourcesContent":["// Element -> Map(owner -> class that owner added).\nconst classOwners = new WeakMap();\n\n/**\n * Adds a class to an element on behalf of an owner. Adding again for the same owner does nothing.\n * @param element {HTMLElement}\n * @param className {string}\n * @param owner {*}\n */\nexport function addOwnedClass (element, className, owner) {\n let owners = classOwners.get(element);\n if (!owners) {\n owners = new Map();\n classOwners.set(element, owners);\n }\n if (owners.has(owner)) return;\n owners.set(owner, className);\n element.classList.add(className);\n}\n\n/**\n * Releases the class an owner added. The class is removed once no remaining owner holds it.\n * @param element {HTMLElement}\n * @param owner {*}\n */\nexport function removeOwnedClass (element, owner) {\n const owners = classOwners.get(element);\n const className = owners?.get(owner);\n if (!className) return;\n owners.delete(owner);\n if (!owners.size) classOwners.delete(element);\n for (const remainingClassName of owners.values()) {\n if (remainingClassName === className) return;\n }\n element.classList.remove(className);\n}\n\n/**\n * @param element {HTMLElement}\n * @returns {boolean} whether any owner holds a class on the element.\n */\nexport function hasClassOwners (element) {\n return classOwners.has(element);\n}\n","import {\n DEFAULT_PREFIX,\n DEFAULT_VALIDATION_MESSAGE_TYPE,\n VALIDATION_MESSAGE_TYPES,\n} from '../constants/index.js';\nimport {\n h,\n Comment,\n Text,\n} from 'vue';\nimport { addOwnedClass, hasClassOwners, removeOwnedClass } from '../owned_classes.js';\n\nlet UNIQUE_ID_COUNTER = 0;\nlet TIMER;\n\n// selector to find focusable not hidden inputs\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN = 'input:not([type=hidden]):not(:disabled)';\n// selector to find focusable not disables elements\nconst FOCUSABLE_SELECTOR_NOT_DISABLED = 'select:not(:disabled),textarea:not(:disabled),button:not(:disabled)';\n// // selector to find focusable not hidden and disabled elements\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED = `${FOCUSABLE_SELECTOR_NOT_HIDDEN},${FOCUSABLE_SELECTOR_NOT_DISABLED}`;\n// selector to find focusable elements\nconst FOCUSABLE_SELECTOR = `a,frame,iframe,${FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED},*[tabindex]`;\n\nconst scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;\n\nexport function getUniqueString (prefix = DEFAULT_PREFIX) {\n return `${prefix}${UNIQUE_ID_COUNTER++}`;\n}\n\n/**\n * Returns a random element from array\n * @param array - the array to return a random element from\n * @param {string} seed - use a string to seed the randomization, so it returns the same element each time\n * based on that string.\n * @returns {*} - the random element\n */\nexport function getRandomElement (array, seed) {\n if (seed) {\n const hash = javaHashCode(seed);\n return array[Math.abs(hash) % array.length];\n } else {\n return array[getRandomInt(array.length)];\n }\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n * We use this algo to be in sync with android.\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} str a string\n * @return {number} a hash code value for the given string.\n */\nexport function javaHashCode (str) {\n let h;\n for (let i = 0; i < str.length; i++) {\n h = Math.imul(31, h) + str.charCodeAt(i) | 0;\n }\n\n return h;\n}\n\n/**\n * Generate a random integer\n * @param {number} max - max range of integer to generate\n * @returns {number} randomly generated integer between 0 and max\n */\nexport function getRandomInt (max) {\n return Math.floor(Math.random() * max);\n}\n\nexport function formatMessages (messages) {\n if (!messages) {\n return [];\n }\n\n return messages.map(message => {\n if (typeof message === 'string') {\n return {\n message,\n type: DEFAULT_VALIDATION_MESSAGE_TYPE,\n };\n }\n\n return message;\n });\n}\n\nexport function filterFormattedMessages (formattedMessages) {\n const validationState = getValidationState(formattedMessages);\n\n if (!formattedMessages || !validationState) {\n return [];\n }\n\n return formattedMessages.filter(message => !!message.message && message.type === validationState);\n}\n\n/*\n * The priority order of message types is: 'critical' > 'warning' > 'positive' > 'info'.\n * If any message of type 'critical' is present in messages, the input state is considered\n * to be 'critical', then 'warning', then 'positive', and lastly 'info'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.CRITICAL)) {\n return VALIDATION_MESSAGE_TYPES.CRITICAL;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.POSITIVE)) {\n return VALIDATION_MESSAGE_TYPES.POSITIVE;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.INFO)) {\n return VALIDATION_MESSAGE_TYPES.INFO;\n }\n\n return null;\n}\n\nexport function hasFormattedMessageOfType (formattedMessages, messageType) {\n if (!formattedMessages || !messageType) {\n return false;\n }\n\n return formattedMessages.some(message => message?.type === messageType);\n}\n\nexport function findFirstFocusableNode (element) {\n return element?.querySelector(FOCUSABLE_SELECTOR);\n}\n\n/* html-fragment component:\n * To render html without wrapping in another element as when using v-html.\n * props: html\n */\nexport const htmlFragment = (props) => {\n return h('div', { innerHTML: props.html });\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/*\n It is very cumbersome to check if a slot is empty in vue 3. Copied this method from the following thread\n https://github.com/vuejs/core/issues/4733. There is an RFC to fix this but not yet being worked on.\n https://github.com/vuejs/rfcs/discussions/453\n*/\nexport function hasSlotContent (slot, slotProps = {}) {\n if (!slot) return false;\n\n\n return slot(slotProps).some((vnode) => {\n if (vnode.type === Comment) return false;\n\n if (Array.isArray(vnode.children) && !vnode.children.length) return false;\n\n return (\n vnode.type !== Text ||\n (typeof vnode.children === 'string' && vnode.children.trim() !== '')\n );\n });\n}\n\n/**\n * Transform a string from kebab-case to PascalCase\n * @param string\n * @returns {string}\n */\nexport const kebabCaseToPascalCase = (string) => {\n return string?.toLowerCase()\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n};\n\n/**\n * Transform a string from PascalCase to kebab-case\n * @param string\n * @returns {string}\n */\nexport const pascalCaseToKebabCase = (string) => {\n return string\n .replace(/\\.?([A-Z0-9]+)/g, (x, y) => '-' + y.toLowerCase())\n .replace(/^-/, '');\n};\n\n/**\n * Extracts Vue event listeners from attributes object\n * @param {Object} attrs - The attributes object to extract listeners from\n * @returns {Object} Object containing only Vue event listeners (keys matching on[A-Z])\n */\nexport const extractVueListeners = (attrs) => {\n const listeners = Object.entries(attrs)\n .filter(([key]) => key.match(/on[A-Z]/));\n return Object.fromEntries(listeners);\n};\n\n/**\n * Extracts non-listener attributes from attributes object\n * @param {Object} attrs - The attributes object to extract non-listeners from\n * @returns {Object} Object containing only non-listener attributes (keys not matching on[A-Z])\n */\nexport const extractNonListeners = (attrs) => {\n const nonListeners = Object.entries(attrs)\n .filter(([key]) => !key.match(/on[A-Z]/));\n return Object.fromEntries(nonListeners);\n};\n\n/**\n * $el works very differently than in vue 2, if the first node in the template is a text node\n * such as a comment it will return that instead of the first actual element. This function\n * will recursively return the first element in the template instead of the first node.\n * @param el\n * @returns {HTMLElement} The first element in the template\n */\nexport const returnFirstEl = (el) => {\n if (el?.nodeType === Node.ELEMENT_NODE) {\n return el;\n } else if (!el?.nodeType) {\n return null;\n } else {\n return returnFirstEl(el?.nextSibling);\n }\n};\n\n/**\n In Vue 3, $attrs includes class and style attributes, but when using inheritAttrs: false\n and manually binding :class=\"$attrs.class\" and :style=\"$attrs.style\" to the root element,\n we need to prevent class/style from being passed to inner elements via v-bind=\"removeClassStyleAttrs($attrs)\".\n This function removes class and style attributes from the attrs object.\n*/\nexport function removeClassStyleAttrs (attrs) {\n const listeners = Object.entries(attrs)\n .filter(([key]) => !['class', 'style'].includes(key));\n return Object.fromEntries(listeners);\n}\n\n\n/*\n* Set's a global timer to debounce the execution of a function.\n* @param { object } func - the function that is going to be called after timeout\n* @param { number } [timeout=300] timeout\n* */\nexport function debounce (func, timeout = 300) {\n clearTimeout(TIMER);\n TIMER = setTimeout(func, timeout);\n}\n\n/**\n * Checks if the element is out of the viewport\n * https://gomakethings.com/how-to-check-if-any-part-of-an-element-is-out-of-the-viewport-with-vanilla-js/\n * @param {HTMLElement} element The element to check\n * @return {Object} A set of booleans for each side of the element\n */\n\nexport function isOutOfViewPort (element) {\n const bounding = element.getBoundingClientRect();\n\n const isOut = {\n top: bounding.top < 0,\n left: bounding.left < 0,\n bottom: bounding.bottom > (window.innerHeight || document.documentElement.clientHeight),\n right: bounding.right > (window.innerWidth || document.documentElement.clientWidth),\n };\n isOut.any = Object.values(isOut).some(val => val);\n isOut.all = Object.values(isOut).every(val => val);\n return isOut;\n}\n\n// match valid characters for a domain name followed by a dot, e.g. \"dialpad.\"\nconst domainNameRegex = /(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)/;\n\n// match valid TLDs for a hostname (outdated list from ~2017)\nconst tldRegerx = new RegExp(\n '(?:' +\n 'com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|' +\n 'za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|' +\n 'il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|' +\n 'ae|ph|online|ng|ee|ws|ve|cat' +\n ')',\n);\n\n// match valid IPv4 addresses, e.g. \"192.158.1.38\"\nconst ipv4Regex = new RegExp(\n '(?:(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])\\\\.){3}' +\n '(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])',\n);\n\n// match hostnames OR IPv4 addresses, e.g. \"dialpad.com\" or \"192.158.1.38\"\nconst hostnameOrIpRegex = new RegExp(\n '(?:' +\n [\n [\n domainNameRegex.source,\n tldRegerx.source,\n ].join('+'),\n ipv4Regex.source,\n ].join('|') +\n ')',\n);\n\n// match URL paths, e.g. \"/news\"\nconst urlPathRegex = /(?:(?:[;/][^#?<>\\s]*)?)/;\n\n// match URL queries and fragments, e.g. \"?cache=1&new=true\" or \"#heading1\"\nconst urlQueryOrFragmentRegex = /(?:(?:\\?[^#<>\\s]+)?(?:#[^<>\\s]+)?)/;\n\n// match complete hostnames or IPv4 addresses without a protocol and with optional\n// URL paths, queries and fragments e.g. \"dialpad.com/news?cache=1#heading1\"\nconst urlWithoutProtocolRegex = new RegExp(\n '\\\\b' +\n [\n hostnameOrIpRegex.source,\n urlPathRegex.source,\n urlQueryOrFragmentRegex.source,\n '(?!\\\\w)',\n ].join('+'),\n);\n\n// match complete hostnames with protocols and optional URL paths, queries and fragments,\n// e.g. \"ws://localhost:9011\" or \"https://dialpad.com/news?cache=1#heading1\"\nconst urlWithProtocolRegex = /\\b[a-z\\d.-]+:\\/\\/[^<>\\s]+/;\n\n// match email addresses with an optional \"mailto:\" prefix and URL queries, e.g.\n// \"hey@dialpad.com\" or \"mailto:hey@dialpad.com?subject=Hi&body=Hey%20there\"\nconst emailAddressRegex = new RegExp(\n '(?:mailto:)?' +\n '[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n [\n hostnameOrIpRegex.source,\n urlQueryOrFragmentRegex.source,\n ].join('+') +\n '(?!\\\\w)',\n);\n\n/**\n * Match phone numbers, e.g. \"765-8813\", \"(778) 765-8813\" or \"+17787658813\".\n * @param {number} minLength\n * @param {number} maxLength\n * @returns {RegExp}\n */\nexport function getPhoneNumberRegex (minLength = 7, maxLength = 15) {\n // Some older browser versions don't support lookbehind, so provide a RegExp\n // version without it. It fails just one test case, so IMO it's still good\n // enough to use. https://caniuse.com/js-regexp-lookbehind\n try {\n return new RegExp(\n '(?:^|(?<=\\\\W))' +\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n } catch {\n \n console.warn('This browser doesn\\'t support regex lookahead/lookbehind');\n }\n\n return new RegExp(\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n}\n\nconst phoneNumberRegex = getPhoneNumberRegex();\n\n// match all link types\nexport const linkRegex = new RegExp(\n [\n urlWithoutProtocolRegex.source,\n urlWithProtocolRegex.source,\n emailAddressRegex.source,\n phoneNumberRegex.source,\n ].join('|'),\n 'gi',\n);\n\n/**\n * Check if a string is a phone number. Validates only exact matches.\n * @param {string|number} input\n * @returns {boolean}\n */\nexport function isPhoneNumber (input) {\n if (!input || (!['string', 'number'].includes(typeof input))) return false;\n input = input.toString();\n return phoneNumberRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an URL. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isURL (input) {\n if (!input || typeof input !== 'string') return false;\n return urlWithoutProtocolRegex.exec(input)?.[0] === input ||\n urlWithProtocolRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an email address. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isEmailAddress (input) {\n if (!input || typeof input !== 'string') return false;\n return emailAddressRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Concatenate a string removing null or undefined elements\n * avoiding parsing them as string with template strings\n * @param {Array} elements\n * @returns {String}\n */\nexport function safeConcatStrings (elements) {\n return elements.filter(str => !!str).join(', ');\n}\n\n/**\n * Locale safe function to capitalize the first letter of a string.\n * @param {string} str the string to capitalize the first letter of\n * @param {string} locale a string representing the locale to be used. Defaults to 'en-US'\n * @returns The passed in string with the first letter capitalized\n */\nexport function capitalizeFirstLetter (str, locale = 'en-US') {\n return str.replace(/^\\p{CWU}/u, char => char.toLocaleUpperCase(locale));\n}\n\n/**\n * Warns if the component is not mounted properly. Useful for tests.\n * @param {HTMLElement} componentRef - the component reference\n * @param {string} componentName - the component name\n */\n\nexport function warnIfUnmounted (componentRef, componentName) {\n if (typeof process === 'undefined') return;\n if (process.env.NODE_ENV !== 'test') return;\n if (!componentRef || !(componentRef instanceof HTMLElement) || !document?.body) return;\n if (!document.body.contains(componentRef)) {\n console.warn(`The ${componentName} component is not attached to the document body. This may cause issues.`);\n }\n}\n\n/**\n * checks whether the dt-scrollbar is being used on the root element.\n * @param rootElement {HTMLElement}\n * @returns {boolean}\n */\nfunction isDtScrollbarInUse (rootElement = document.documentElement) {\n if (rootElement.hasAttribute('data-overlayscrollbars')) {\n return true;\n }\n return false;\n}\n\n// Shared by ownerless callers, so a legacy disable/enable pair still acts as one owner.\nconst LEGACY_SCROLL_LOCK_OWNER = Symbol('legacyScrollLockOwner');\n\nfunction getRootScrollLockClass (rootElement) {\n return isDtScrollbarInUse(rootElement) ? 'd-scrollbar-disabled' : 'd-of-hidden';\n}\n\n/**\n * This will disable scrolling on the root element regardless of whether you are using dt-scrollbar or not.\n * Each owner holds its own lock; scrolling stays disabled until every owner has called enableRootScrolling.\n * @param rootElement {HTMLElement}\n * @param owner {*} identifies the caller's lock. Ownerless callers share a single owner.\n */\nexport function disableRootScrolling (rootElement = document.documentElement, owner = LEGACY_SCROLL_LOCK_OWNER) {\n addOwnedClass(rootElement, getRootScrollLockClass(rootElement), owner);\n}\n\n/**\n * This will release the owner's scroll lock on the root element regardless of whether you are using dt-scrollbar\n * or not. The class that owner added is removed only when no other owner still holds it.\n * @param rootElement {HTMLElement}\n * @param owner {*} the owner passed to disableRootScrolling. Ownerless callers share a single owner.\n */\nexport function enableRootScrolling (rootElement = document.documentElement, owner = LEGACY_SCROLL_LOCK_OWNER) {\n if (hasClassOwners(rootElement)) {\n removeOwnedClass(rootElement, owner);\n } else if (owner === LEGACY_SCROLL_LOCK_OWNER) {\n // No tracked lock: keep the previous unconditional behavior for ownerless callers.\n rootElement.classList.remove(getRootScrollLockClass(rootElement));\n }\n}\n\n/**\n * This will take a text string e.g \"accessibility-mac\"\n * and convert it to our Fluent Key standard format \"ACCESSIBILITY_MAC\"\n * @param text\n * @returns {string}\n */\nexport function toFluentKeyString (text) {\n return text\n .replaceAll(/[ -]/g, '_')\n .replaceAll(/\\W/g, '')\n .toUpperCase();\n}\n\nexport default {\n getUniqueString,\n getRandomElement,\n getRandomInt,\n formatMessages,\n filterFormattedMessages,\n hasFormattedMessageOfType,\n getValidationState,\n htmlFragment,\n flushPromises,\n kebabCaseToPascalCase,\n extractVueListeners,\n extractNonListeners,\n removeClassStyleAttrs,\n returnFirstEl,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n disableRootScrolling,\n enableRootScrolling,\n};\n\n"],"mappings":";;;AACA,IAAM,oBAAc,IAAI,SAAS;AAQjC,SAAgB,EAAe,GAAS,GAAW,GAAO;CACxD,IAAI,IAAS,EAAY,IAAI,EAAQ;AACrC,CAAK,MACH,oBAAS,IAAI,KAAK,EAClB,EAAY,IAAI,GAAS,EAAO,GAE9B,GAAO,IAAI,EAAM,KACrB,EAAO,IAAI,GAAO,EAAU,EAC5B,EAAQ,UAAU,IAAI,EAAU;;AAQlC,SAAgB,EAAkB,GAAS,GAAO;CAChD,IAAM,IAAS,EAAY,IAAI,EAAQ,EACjC,IAAY,GAAQ,IAAI,EAAM;AAC/B,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AAG,yBAAyB;;AASpE,SAAgB,EAAsB,IAAc,SAAS,iBAAiB,IAAQ,GAA0B;AAC9G,GAAc,GAAa,EAAuB,EAAY,EAAE,EAAM;;AASxE,SAAgB,EAAqB,IAAc,SAAS,iBAAiB,IAAQ,GAA0B;AAC7G,CAAI,EAAe,EAAY,GAC7B,EAAiB,GAAa,EAAM,GAC3B,MAAU,KAEnB,EAAY,UAAU,OAAO,EAAuB,EAAY,CAAC;;AAUrE,SAAgB,GAAmB,GAAM;AACvC,QAAO,EACJ,WAAW,SAAS,IAAI,CACxB,WAAW,OAAO,GAAG,CACrB,aAAa;;AAGlB,IAAA,KAAe;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/constants/index.cjs`);let t=require(`vue`);var n=new WeakMap;function r(e,t,r){let i=n.get(e);i||(i=new Map,n.set(e,i)),!i.has(r)&&(i.set(r,t),e.classList.add(t))}function i(e,t){let r=n.get(e),i=r?.get(t);if(i){r.delete(t),r.size||n.delete(e);for(let e of r.values())if(e===i)return;e.classList.remove(i)}}function a(e){return n.has(e)}var o=0,s,c=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`,l=typeof setImmediate==`function`?setImmediate:setTimeout;function u(e=`dt`){return`${e}${o++}`}function d(e,t){if(t){let n=f(t);return e[Math.abs(n)%e.length]}else return e[p(e.length)]}function f(e){let t;for(let n=0;n<e.length;n++)t=Math.imul(31,t)+e.charCodeAt(n)|0;return t}function p(e){return Math.floor(Math.random()*e)}function m(t){return t?t.map(t=>typeof t==`string`?{message:t,type:e.DEFAULT_VALIDATION_MESSAGE_TYPE}:t):[]}function h(e){let t=g(e);return!e||!t?[]:e.filter(e=>!!e.message&&e.type===t)}function g(t){return t?_(t,e.VALIDATION_MESSAGE_TYPES.CRITICAL)?e.VALIDATION_MESSAGE_TYPES.CRITICAL:_(t,e.VALIDATION_MESSAGE_TYPES.WARNING)?e.VALIDATION_MESSAGE_TYPES.WARNING:_(t,e.VALIDATION_MESSAGE_TYPES.POSITIVE)?e.VALIDATION_MESSAGE_TYPES.POSITIVE:_(t,e.VALIDATION_MESSAGE_TYPES.INFO)?e.VALIDATION_MESSAGE_TYPES.INFO:null:null}function _(e,t){return!e||!t?!1:e.some(e=>e?.type===t)}function v(e){return e?.querySelector(c)}var y=e=>(0,t.h)(`div`,{innerHTML:e.html}),b=()=>new Promise(e=>{l(e)});function x(e,n={}){return e?e(n).some(e=>e.type===t.Comment||Array.isArray(e.children)&&!e.children.length?!1:e.type!==t.Text||typeof e.children==`string`&&e.children.trim()!==``):!1}var S=e=>e?.toLowerCase().split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``),C=e=>e.replace(/\.?([A-Z0-9]+)/g,(e,t)=>`-`+t.toLowerCase()).replace(/^-/,``),w=e=>{let t=Object.entries(e).filter(([e])=>e.match(/on[A-Z]/));return Object.fromEntries(t)},T=e=>{let t=Object.entries(e).filter(([e])=>!e.match(/on[A-Z]/));return Object.fromEntries(t)},E=e=>e?.nodeType===Node.ELEMENT_NODE?e:e?.nodeType?E(e?.nextSibling):null;function D(e){let t=Object.entries(e).filter(([e])=>![`class`,`style`].includes(e));return Object.fromEntries(t)}function O(e,t=300){clearTimeout(s),s=setTimeout(e,t)}function k(e){let t=e.getBoundingClientRect(),n={top:t.top<0,left:t.left<0,bottom:t.bottom>(window.innerHeight||document.documentElement.clientHeight),right:t.right>(window.innerWidth||document.documentElement.clientWidth)};return n.any=Object.values(n).some(e=>e),n.all=Object.values(n).every(e=>e),n}var A=/(?:(?:[^\s!@#$%^&*()_=+[\]{}\\|;:'",.<>/?]+)\.)/,j=RegExp(`(?:com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|ae|ph|online|ng|ee|ws|ve|cat)`),M=RegExp(`(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])`),N=RegExp(`(?:`+[[A.source,j.source].join(`+`),M.source].join(`|`)+`)`),P=/(?:(?:[;/][^#?<>\s]*)?)/,F=/(?:(?:\?[^#<>\s]+)?(?:#[^<>\s]+)?)/,I=RegExp(`\\b`+[N.source,P.source,F.source,`(?!\\w)`].join(`+`)),L=/\b[a-z\d.-]+:\/\/[^<>\s]+/,R=RegExp("(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+[N.source,F.source].join(`+`)+`(?!\\w)`);function z(e=7,t=15){try{return RegExp(`(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|\$)|\\s|\$)`)}catch{console.warn(`This browser doesn't support regex lookahead/lookbehind`)}return RegExp(`(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|\$)|\\s|\$)`)}var B=z(),V=new RegExp([I.source,L.source,R.source,B.source].join(`|`),`gi`);function H(e){return!e||![`string`,`number`].includes(typeof e)?!1:(e=e.toString(),B.exec(e)?.[0]===e)}function U(e){return!e||typeof e!=`string`?!1:I.exec(e)?.[0]===e||L.exec(e)?.[0]===e}function W(e){return!e||typeof e!=`string`?!1:R.exec(e)?.[0]===e}function G(e){return e.filter(e=>!!e).join(`, `)}function K(e,t=`en-US`){return e.replace(/^\p{CWU}/u,e=>e.toLocaleUpperCase(t))}function q(e,t){typeof process>`u`||process.env.NODE_ENV===`test`&&(!e||!(e instanceof HTMLElement)||!document?.body||document.body.contains(e)||console.warn(`The ${t} component is not attached to the document body. This may cause issues.`))}function J(e=document.documentElement){return!!e.hasAttribute(`data-overlayscrollbars`)}var Y=Symbol(`legacyScrollLockOwner`);function X(e){return J(e)?`d-scrollbar-disabled`:`d-of-hidden`}function Z(e=document.documentElement,t=Y){r(e,X(e),t)}function Q(e=document.documentElement,t=Y){a(e)?i(e,t):t===Y&&e.classList.remove(X(e))}function $(e){return e.replaceAll(/[ -]/g,`_`).replaceAll(/\W/g,``).toUpperCase()}var ee={getUniqueString:u,getRandomElement:d,getRandomInt:p,formatMessages:m,filterFormattedMessages:h,hasFormattedMessageOfType:_,getValidationState:g,htmlFragment:y,flushPromises:b,kebabCaseToPascalCase:S,extractVueListeners:w,extractNonListeners:T,removeClassStyleAttrs:D,returnFirstEl:E,debounce:O,isOutOfViewPort:k,getPhoneNumberRegex:z,linkRegex:V,isEmailAddress:W,isPhoneNumber:H,isURL:U,safeConcatStrings:G,capitalizeFirstLetter:K,disableRootScrolling:Z,enableRootScrolling:Q};Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return W}});
|
|
2
|
+
//# sourceMappingURL=utils-GofHWJKi.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../common/utils/index.js"],"sourcesContent":["import {\n DEFAULT_PREFIX,\n DEFAULT_VALIDATION_MESSAGE_TYPE,\n VALIDATION_MESSAGE_TYPES,\n} from '../constants/index.js';\nimport {\n h,\n Comment,\n Text,\n} from 'vue';\n\nlet UNIQUE_ID_COUNTER = 0;\nlet TIMER;\n\n// selector to find focusable not hidden inputs\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN = 'input:not([type=hidden]):not(:disabled)';\n// selector to find focusable not disables elements\nconst FOCUSABLE_SELECTOR_NOT_DISABLED = 'select:not(:disabled),textarea:not(:disabled),button:not(:disabled)';\n// // selector to find focusable not hidden and disabled elements\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED = `${FOCUSABLE_SELECTOR_NOT_HIDDEN},${FOCUSABLE_SELECTOR_NOT_DISABLED}`;\n// selector to find focusable elements\nconst FOCUSABLE_SELECTOR = `a,frame,iframe,${FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED},*[tabindex]`;\n\nconst scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;\n\nexport function getUniqueString (prefix = DEFAULT_PREFIX) {\n return `${prefix}${UNIQUE_ID_COUNTER++}`;\n}\n\n/**\n * Returns a random element from array\n * @param array - the array to return a random element from\n * @param {string} seed - use a string to seed the randomization, so it returns the same element each time\n * based on that string.\n * @returns {*} - the random element\n */\nexport function getRandomElement (array, seed) {\n if (seed) {\n const hash = javaHashCode(seed);\n return array[Math.abs(hash) % array.length];\n } else {\n return array[getRandomInt(array.length)];\n }\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n * We use this algo to be in sync with android.\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} str a string\n * @return {number} a hash code value for the given string.\n */\nexport function javaHashCode (str) {\n let h;\n for (let i = 0; i < str.length; i++) {\n h = Math.imul(31, h) + str.charCodeAt(i) | 0;\n }\n\n return h;\n}\n\n/**\n * Generate a random integer\n * @param {number} max - max range of integer to generate\n * @returns {number} randomly generated integer between 0 and max\n */\nexport function getRandomInt (max) {\n return Math.floor(Math.random() * max);\n}\n\nexport function formatMessages (messages) {\n if (!messages) {\n return [];\n }\n\n return messages.map(message => {\n if (typeof message === 'string') {\n return {\n message,\n type: DEFAULT_VALIDATION_MESSAGE_TYPE,\n };\n }\n\n return message;\n });\n}\n\nexport function filterFormattedMessages (formattedMessages) {\n const validationState = getValidationState(formattedMessages);\n\n if (!formattedMessages || !validationState) {\n return [];\n }\n\n return formattedMessages.filter(message => !!message.message && message.type === validationState);\n}\n\n/*\n * The priority order of message types is: 'critical' > 'warning' > 'positive' > 'info'.\n * If any message of type 'critical' is present in messages, the input state is considered\n * to be 'critical', then 'warning', then 'positive', and lastly 'info'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.CRITICAL)) {\n return VALIDATION_MESSAGE_TYPES.CRITICAL;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.POSITIVE)) {\n return VALIDATION_MESSAGE_TYPES.POSITIVE;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.INFO)) {\n return VALIDATION_MESSAGE_TYPES.INFO;\n }\n\n return null;\n}\n\nexport function hasFormattedMessageOfType (formattedMessages, messageType) {\n if (!formattedMessages || !messageType) {\n return false;\n }\n\n return formattedMessages.some(message => message?.type === messageType);\n}\n\nexport function findFirstFocusableNode (element) {\n return element?.querySelector(FOCUSABLE_SELECTOR);\n}\n\n/* html-fragment component:\n * To render html without wrapping in another element as when using v-html.\n * props: html\n */\nexport const htmlFragment = (props) => {\n return h('div', { innerHTML: props.html });\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/*\n It is very cumbersome to check if a slot is empty in vue 3. Copied this method from the following thread\n https://github.com/vuejs/core/issues/4733. There is an RFC to fix this but not yet being worked on.\n https://github.com/vuejs/rfcs/discussions/453\n*/\nexport function hasSlotContent (slot, slotProps = {}) {\n if (!slot) return false;\n\n\n return slot(slotProps).some((vnode) => {\n if (vnode.type === Comment) return false;\n\n if (Array.isArray(vnode.children) && !vnode.children.length) return false;\n\n return (\n vnode.type !== Text ||\n (typeof vnode.children === 'string' && vnode.children.trim() !== '')\n );\n });\n}\n\n/**\n * Transform a string from kebab-case to PascalCase\n * @param string\n * @returns {string}\n */\nexport const kebabCaseToPascalCase = (string) => {\n return string?.toLowerCase()\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n};\n\n/**\n * Transform a string from PascalCase to kebab-case\n * @param string\n * @returns {string}\n */\nexport const pascalCaseToKebabCase = (string) => {\n return string\n .replace(/\\.?([A-Z0-9]+)/g, (x, y) => '-' + y.toLowerCase())\n .replace(/^-/, '');\n};\n\n/**\n * Extracts Vue event listeners from attributes object\n * @param {Object} attrs - The attributes object to extract listeners from\n * @returns {Object} Object containing only Vue event listeners (keys matching on[A-Z])\n */\nexport const extractVueListeners = (attrs) => {\n const listeners = Object.entries(attrs)\n .filter(([key]) => key.match(/on[A-Z]/));\n return Object.fromEntries(listeners);\n};\n\n/**\n * Extracts non-listener attributes from attributes object\n * @param {Object} attrs - The attributes object to extract non-listeners from\n * @returns {Object} Object containing only non-listener attributes (keys not matching on[A-Z])\n */\nexport const extractNonListeners = (attrs) => {\n const nonListeners = Object.entries(attrs)\n .filter(([key]) => !key.match(/on[A-Z]/));\n return Object.fromEntries(nonListeners);\n};\n\n/**\n * $el works very differently than in vue 2, if the first node in the template is a text node\n * such as a comment it will return that instead of the first actual element. This function\n * will recursively return the first element in the template instead of the first node.\n * @param el\n * @returns {HTMLElement} The first element in the template\n */\nexport const returnFirstEl = (el) => {\n if (el?.nodeType === Node.ELEMENT_NODE) {\n return el;\n } else if (!el?.nodeType) {\n return null;\n } else {\n return returnFirstEl(el?.nextSibling);\n }\n};\n\n/**\n In Vue 3, $attrs includes class and style attributes, but when using inheritAttrs: false\n and manually binding :class=\"$attrs.class\" and :style=\"$attrs.style\" to the root element,\n we need to prevent class/style from being passed to inner elements via v-bind=\"removeClassStyleAttrs($attrs)\".\n This function removes class and style attributes from the attrs object.\n*/\nexport function removeClassStyleAttrs (attrs) {\n const listeners = Object.entries(attrs)\n .filter(([key]) => !['class', 'style'].includes(key));\n return Object.fromEntries(listeners);\n}\n\n\n/*\n* Set's a global timer to debounce the execution of a function.\n* @param { object } func - the function that is going to be called after timeout\n* @param { number } [timeout=300] timeout\n* */\nexport function debounce (func, timeout = 300) {\n clearTimeout(TIMER);\n TIMER = setTimeout(func, timeout);\n}\n\n/**\n * Checks if the element is out of the viewport\n * https://gomakethings.com/how-to-check-if-any-part-of-an-element-is-out-of-the-viewport-with-vanilla-js/\n * @param {HTMLElement} element The element to check\n * @return {Object} A set of booleans for each side of the element\n */\n\nexport function isOutOfViewPort (element) {\n const bounding = element.getBoundingClientRect();\n\n const isOut = {\n top: bounding.top < 0,\n left: bounding.left < 0,\n bottom: bounding.bottom > (window.innerHeight || document.documentElement.clientHeight),\n right: bounding.right > (window.innerWidth || document.documentElement.clientWidth),\n };\n isOut.any = Object.values(isOut).some(val => val);\n isOut.all = Object.values(isOut).every(val => val);\n return isOut;\n}\n\n// match valid characters for a domain name followed by a dot, e.g. \"dialpad.\"\nconst domainNameRegex = /(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)/;\n\n// match valid TLDs for a hostname (outdated list from ~2017)\nconst tldRegerx = new RegExp(\n '(?:' +\n 'com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|' +\n 'za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|' +\n 'il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|' +\n 'ae|ph|online|ng|ee|ws|ve|cat' +\n ')',\n);\n\n// match valid IPv4 addresses, e.g. \"192.158.1.38\"\nconst ipv4Regex = new RegExp(\n '(?:(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])\\\\.){3}' +\n '(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])',\n);\n\n// match hostnames OR IPv4 addresses, e.g. \"dialpad.com\" or \"192.158.1.38\"\nconst hostnameOrIpRegex = new RegExp(\n '(?:' +\n [\n [\n domainNameRegex.source,\n tldRegerx.source,\n ].join('+'),\n ipv4Regex.source,\n ].join('|') +\n ')',\n);\n\n// match URL paths, e.g. \"/news\"\nconst urlPathRegex = /(?:(?:[;/][^#?<>\\s]*)?)/;\n\n// match URL queries and fragments, e.g. \"?cache=1&new=true\" or \"#heading1\"\nconst urlQueryOrFragmentRegex = /(?:(?:\\?[^#<>\\s]+)?(?:#[^<>\\s]+)?)/;\n\n// match complete hostnames or IPv4 addresses without a protocol and with optional\n// URL paths, queries and fragments e.g. \"dialpad.com/news?cache=1#heading1\"\nconst urlWithoutProtocolRegex = new RegExp(\n '\\\\b' +\n [\n hostnameOrIpRegex.source,\n urlPathRegex.source,\n urlQueryOrFragmentRegex.source,\n '(?!\\\\w)',\n ].join('+'),\n);\n\n// match complete hostnames with protocols and optional URL paths, queries and fragments,\n// e.g. \"ws://localhost:9011\" or \"https://dialpad.com/news?cache=1#heading1\"\nconst urlWithProtocolRegex = /\\b[a-z\\d.-]+:\\/\\/[^<>\\s]+/;\n\n// match email addresses with an optional \"mailto:\" prefix and URL queries, e.g.\n// \"hey@dialpad.com\" or \"mailto:hey@dialpad.com?subject=Hi&body=Hey%20there\"\nconst emailAddressRegex = new RegExp(\n '(?:mailto:)?' +\n '[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n [\n hostnameOrIpRegex.source,\n urlQueryOrFragmentRegex.source,\n ].join('+') +\n '(?!\\\\w)',\n);\n\n/**\n * Match phone numbers, e.g. \"765-8813\", \"(778) 765-8813\" or \"+17787658813\".\n * @param {number} minLength\n * @param {number} maxLength\n * @returns {RegExp}\n */\nexport function getPhoneNumberRegex (minLength = 7, maxLength = 15) {\n // Some older browser versions don't support lookbehind, so provide a RegExp\n // version without it. It fails just one test case, so IMO it's still good\n // enough to use. https://caniuse.com/js-regexp-lookbehind\n try {\n return new RegExp(\n '(?:^|(?<=\\\\W))' +\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n } catch {\n \n console.warn('This browser doesn\\'t support regex lookahead/lookbehind');\n }\n\n return new RegExp(\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n}\n\nconst phoneNumberRegex = getPhoneNumberRegex();\n\n// match all link types\nexport const linkRegex = new RegExp(\n [\n urlWithoutProtocolRegex.source,\n urlWithProtocolRegex.source,\n emailAddressRegex.source,\n phoneNumberRegex.source,\n ].join('|'),\n 'gi',\n);\n\n/**\n * Check if a string is a phone number. Validates only exact matches.\n * @param {string|number} input\n * @returns {boolean}\n */\nexport function isPhoneNumber (input) {\n if (!input || (!['string', 'number'].includes(typeof input))) return false;\n input = input.toString();\n return phoneNumberRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an URL. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isURL (input) {\n if (!input || typeof input !== 'string') return false;\n return urlWithoutProtocolRegex.exec(input)?.[0] === input ||\n urlWithProtocolRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an email address. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isEmailAddress (input) {\n if (!input || typeof input !== 'string') return false;\n return emailAddressRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Concatenate a string removing null or undefined elements\n * avoiding parsing them as string with template strings\n * @param {Array} elements\n * @returns {String}\n */\nexport function safeConcatStrings (elements) {\n return elements.filter(str => !!str).join(', ');\n}\n\n/**\n * Locale safe function to capitalize the first letter of a string.\n * @param {string} str the string to capitalize the first letter of\n * @param {string} locale a string representing the locale to be used. Defaults to 'en-US'\n * @returns The passed in string with the first letter capitalized\n */\nexport function capitalizeFirstLetter (str, locale = 'en-US') {\n return str.replace(/^\\p{CWU}/u, char => char.toLocaleUpperCase(locale));\n}\n\n/**\n * Warns if the component is not mounted properly. Useful for tests.\n * @param {HTMLElement} componentRef - the component reference\n * @param {string} componentName - the component name\n */\n\nexport function warnIfUnmounted (componentRef, componentName) {\n if (typeof process === 'undefined') return;\n if (process.env.NODE_ENV !== 'test') return;\n if (!componentRef || !(componentRef instanceof HTMLElement) || !document?.body) return;\n if (!document.body.contains(componentRef)) {\n console.warn(`The ${componentName} component is not attached to the document body. This may cause issues.`);\n }\n}\n\n/**\n * checks whether the dt-scrollbar is being used on the root element.\n * @param rootElement {HTMLElement}\n * @returns {boolean}\n */\nfunction isDtScrollbarInUse (rootElement = document.documentElement) {\n if (rootElement.hasAttribute('data-overlayscrollbars')) {\n return true;\n }\n return false;\n}\n\n/**\n * This will disable scrolling on the root element regardless of whether you are using dt-scrollbar or not.\n * @param rootElement {HTMLElement}\n */\nexport function disableRootScrolling (rootElement = document.documentElement) {\n if (isDtScrollbarInUse(rootElement)) {\n rootElement.classList.add('d-scrollbar-disabled');\n } else {\n rootElement.classList.add('d-of-hidden');\n }\n}\n\n/**\n * This will enable scrolling on the root element regardless of whether you are using dt-scrollbar or not.\n * @param rootElement {HTMLElement}\n */\nexport function enableRootScrolling (rootElement = document.documentElement) {\n if (isDtScrollbarInUse(rootElement)) {\n rootElement.classList.remove('d-scrollbar-disabled');\n } else {\n rootElement.classList.remove('d-of-hidden');\n }\n}\n\n/**\n * This will take a text string e.g \"accessibility-mac\"\n * and convert it to our Fluent Key standard format \"ACCESSIBILITY_MAC\"\n * @param text\n * @returns {string}\n */\nexport function toFluentKeyString (text) {\n return text\n .replaceAll(/[ -]/g, '_')\n .replaceAll(/\\W/g, '')\n .toUpperCase();\n}\n\nexport default {\n getUniqueString,\n getRandomElement,\n getRandomInt,\n formatMessages,\n filterFormattedMessages,\n hasFormattedMessageOfType,\n getValidationState,\n htmlFragment,\n flushPromises,\n kebabCaseToPascalCase,\n extractVueListeners,\n extractNonListeners,\n removeClassStyleAttrs,\n returnFirstEl,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n disableRootScrolling,\n enableRootScrolling,\n};\n\n"],"mappings":";;;AAWA,IAAI,IAAoB,GACpB,GASE,IAAqB,0IAErB,IAAY,OAAO,gBAAiB,aAAa,eAAe;AAEtE,SAAgB,EAAiB,IAAA,MAAyB;AACxD,QAAO,GAAG,IAAS;;AAUrB,SAAgB,EAAkB,GAAO,GAAM;AAC7C,KAAI,GAAM;EACR,IAAM,IAAO,EAAa,EAAK;AAC/B,SAAO,EAAM,KAAK,IAAI,EAAK,GAAG,EAAM;OAEpC,QAAO,EAAM,EAAa,EAAM,OAAO;;AAmB3C,SAAgB,EAAc,GAAK;CACjC,IAAI;AACJ,MAAK,IAAI,IAAI,GAAG,IAAI,EAAI,QAAQ,IAC9B,KAAI,KAAK,KAAK,IAAI,EAAE,GAAG,EAAI,WAAW,EAAE,GAAG;AAG7C,QAAO;;AAQT,SAAgB,EAAc,GAAK;AACjC,QAAO,KAAK,MAAM,KAAK,QAAQ,GAAG,EAAI;;AAGxC,SAAgB,EAAgB,GAAU;AAKxC,QAJK,IAIE,EAAS,KAAI,MAC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AkB,EAAO,CAAC;;AASzE,SAAgB,EAAiB,GAAc,GAAe;AACxD,QAAO,UAAY,OACvB,QAAA,IAAA,aAA6B,WACzB,CAAC,KAAgB,EAAE,aAAwB,gBAAgB,CAAC,UAAU,QACrE,SAAS,KAAK,SAAS,EAAa,IACvC,QAAQ,KAAK,OAAO,EAAc,yEAAyE;;AAS/G,SAAS,EAAoB,IAAc,SAAS,iBAAiB;AAInE,QAHA,EAAI,EAAY,aAAa,yBAAyB;;AAUxD,SAAgB,EAAsB,IAAc,SAAS,iBAAiB;AAC5E,CAAI,EAAmB,EAAY,GACjC,EAAY,UAAU,IAAI,uBAAuB,GAEjD,EAAY,UAAU,IAAI,cAAc;;AAQ5C,SAAgB,EAAqB,IAAc,SAAS,iBAAiB;AAC3E,CAAI,EAAmB,EAAY,GACjC,EAAY,UAAU,OAAO,uBAAuB,GAEpD,EAAY,UAAU,OAAO,cAAc;;AAU/C,SAAgB,EAAmB,GAAM;AACvC,QAAO,EACJ,WAAW,SAAS,IAAI,CACxB,WAAW,OAAO,GAAG,CACrB,aAAa;;AAGlB,IAAA,IAAe;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
1
|
+
{"version":3,"file":"utils-GofHWJKi.cjs","names":["DEFAULT_VALIDATION_MESSAGE_TYPE","VALIDATION_MESSAGE_TYPES","Comment","Text"],"sources":["../common/owned_classes.js","../common/utils/index.js"],"sourcesContent":["// Element -> Map(owner -> class that owner added).\nconst classOwners = new WeakMap();\n\n/**\n * Adds a class to an element on behalf of an owner. Adding again for the same owner does nothing.\n * @param element {HTMLElement}\n * @param className {string}\n * @param owner {*}\n */\nexport function addOwnedClass (element, className, owner) {\n let owners = classOwners.get(element);\n if (!owners) {\n owners = new Map();\n classOwners.set(element, owners);\n }\n if (owners.has(owner)) return;\n owners.set(owner, className);\n element.classList.add(className);\n}\n\n/**\n * Releases the class an owner added. The class is removed once no remaining owner holds it.\n * @param element {HTMLElement}\n * @param owner {*}\n */\nexport function removeOwnedClass (element, owner) {\n const owners = classOwners.get(element);\n const className = owners?.get(owner);\n if (!className) return;\n owners.delete(owner);\n if (!owners.size) classOwners.delete(element);\n for (const remainingClassName of owners.values()) {\n if (remainingClassName === className) return;\n }\n element.classList.remove(className);\n}\n\n/**\n * @param element {HTMLElement}\n * @returns {boolean} whether any owner holds a class on the element.\n */\nexport function hasClassOwners (element) {\n return classOwners.has(element);\n}\n","import {\n DEFAULT_PREFIX,\n DEFAULT_VALIDATION_MESSAGE_TYPE,\n VALIDATION_MESSAGE_TYPES,\n} from '../constants/index.js';\nimport {\n h,\n Comment,\n Text,\n} from 'vue';\nimport { addOwnedClass, hasClassOwners, removeOwnedClass } from '../owned_classes.js';\n\nlet UNIQUE_ID_COUNTER = 0;\nlet TIMER;\n\n// selector to find focusable not hidden inputs\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN = 'input:not([type=hidden]):not(:disabled)';\n// selector to find focusable not disables elements\nconst FOCUSABLE_SELECTOR_NOT_DISABLED = 'select:not(:disabled),textarea:not(:disabled),button:not(:disabled)';\n// // selector to find focusable not hidden and disabled elements\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED = `${FOCUSABLE_SELECTOR_NOT_HIDDEN},${FOCUSABLE_SELECTOR_NOT_DISABLED}`;\n// selector to find focusable elements\nconst FOCUSABLE_SELECTOR = `a,frame,iframe,${FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED},*[tabindex]`;\n\nconst scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;\n\nexport function getUniqueString (prefix = DEFAULT_PREFIX) {\n return `${prefix}${UNIQUE_ID_COUNTER++}`;\n}\n\n/**\n * Returns a random element from array\n * @param array - the array to return a random element from\n * @param {string} seed - use a string to seed the randomization, so it returns the same element each time\n * based on that string.\n * @returns {*} - the random element\n */\nexport function getRandomElement (array, seed) {\n if (seed) {\n const hash = javaHashCode(seed);\n return array[Math.abs(hash) % array.length];\n } else {\n return array[getRandomInt(array.length)];\n }\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n * We use this algo to be in sync with android.\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} str a string\n * @return {number} a hash code value for the given string.\n */\nexport function javaHashCode (str) {\n let h;\n for (let i = 0; i < str.length; i++) {\n h = Math.imul(31, h) + str.charCodeAt(i) | 0;\n }\n\n return h;\n}\n\n/**\n * Generate a random integer\n * @param {number} max - max range of integer to generate\n * @returns {number} randomly generated integer between 0 and max\n */\nexport function getRandomInt (max) {\n return Math.floor(Math.random() * max);\n}\n\nexport function formatMessages (messages) {\n if (!messages) {\n return [];\n }\n\n return messages.map(message => {\n if (typeof message === 'string') {\n return {\n message,\n type: DEFAULT_VALIDATION_MESSAGE_TYPE,\n };\n }\n\n return message;\n });\n}\n\nexport function filterFormattedMessages (formattedMessages) {\n const validationState = getValidationState(formattedMessages);\n\n if (!formattedMessages || !validationState) {\n return [];\n }\n\n return formattedMessages.filter(message => !!message.message && message.type === validationState);\n}\n\n/*\n * The priority order of message types is: 'critical' > 'warning' > 'positive' > 'info'.\n * If any message of type 'critical' is present in messages, the input state is considered\n * to be 'critical', then 'warning', then 'positive', and lastly 'info'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.CRITICAL)) {\n return VALIDATION_MESSAGE_TYPES.CRITICAL;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.POSITIVE)) {\n return VALIDATION_MESSAGE_TYPES.POSITIVE;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.INFO)) {\n return VALIDATION_MESSAGE_TYPES.INFO;\n }\n\n return null;\n}\n\nexport function hasFormattedMessageOfType (formattedMessages, messageType) {\n if (!formattedMessages || !messageType) {\n return false;\n }\n\n return formattedMessages.some(message => message?.type === messageType);\n}\n\nexport function findFirstFocusableNode (element) {\n return element?.querySelector(FOCUSABLE_SELECTOR);\n}\n\n/* html-fragment component:\n * To render html without wrapping in another element as when using v-html.\n * props: html\n */\nexport const htmlFragment = (props) => {\n return h('div', { innerHTML: props.html });\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/*\n It is very cumbersome to check if a slot is empty in vue 3. Copied this method from the following thread\n https://github.com/vuejs/core/issues/4733. There is an RFC to fix this but not yet being worked on.\n https://github.com/vuejs/rfcs/discussions/453\n*/\nexport function hasSlotContent (slot, slotProps = {}) {\n if (!slot) return false;\n\n\n return slot(slotProps).some((vnode) => {\n if (vnode.type === Comment) return false;\n\n if (Array.isArray(vnode.children) && !vnode.children.length) return false;\n\n return (\n vnode.type !== Text ||\n (typeof vnode.children === 'string' && vnode.children.trim() !== '')\n );\n });\n}\n\n/**\n * Transform a string from kebab-case to PascalCase\n * @param string\n * @returns {string}\n */\nexport const kebabCaseToPascalCase = (string) => {\n return string?.toLowerCase()\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n};\n\n/**\n * Transform a string from PascalCase to kebab-case\n * @param string\n * @returns {string}\n */\nexport const pascalCaseToKebabCase = (string) => {\n return string\n .replace(/\\.?([A-Z0-9]+)/g, (x, y) => '-' + y.toLowerCase())\n .replace(/^-/, '');\n};\n\n/**\n * Extracts Vue event listeners from attributes object\n * @param {Object} attrs - The attributes object to extract listeners from\n * @returns {Object} Object containing only Vue event listeners (keys matching on[A-Z])\n */\nexport const extractVueListeners = (attrs) => {\n const listeners = Object.entries(attrs)\n .filter(([key]) => key.match(/on[A-Z]/));\n return Object.fromEntries(listeners);\n};\n\n/**\n * Extracts non-listener attributes from attributes object\n * @param {Object} attrs - The attributes object to extract non-listeners from\n * @returns {Object} Object containing only non-listener attributes (keys not matching on[A-Z])\n */\nexport const extractNonListeners = (attrs) => {\n const nonListeners = Object.entries(attrs)\n .filter(([key]) => !key.match(/on[A-Z]/));\n return Object.fromEntries(nonListeners);\n};\n\n/**\n * $el works very differently than in vue 2, if the first node in the template is a text node\n * such as a comment it will return that instead of the first actual element. This function\n * will recursively return the first element in the template instead of the first node.\n * @param el\n * @returns {HTMLElement} The first element in the template\n */\nexport const returnFirstEl = (el) => {\n if (el?.nodeType === Node.ELEMENT_NODE) {\n return el;\n } else if (!el?.nodeType) {\n return null;\n } else {\n return returnFirstEl(el?.nextSibling);\n }\n};\n\n/**\n In Vue 3, $attrs includes class and style attributes, but when using inheritAttrs: false\n and manually binding :class=\"$attrs.class\" and :style=\"$attrs.style\" to the root element,\n we need to prevent class/style from being passed to inner elements via v-bind=\"removeClassStyleAttrs($attrs)\".\n This function removes class and style attributes from the attrs object.\n*/\nexport function removeClassStyleAttrs (attrs) {\n const listeners = Object.entries(attrs)\n .filter(([key]) => !['class', 'style'].includes(key));\n return Object.fromEntries(listeners);\n}\n\n\n/*\n* Set's a global timer to debounce the execution of a function.\n* @param { object } func - the function that is going to be called after timeout\n* @param { number } [timeout=300] timeout\n* */\nexport function debounce (func, timeout = 300) {\n clearTimeout(TIMER);\n TIMER = setTimeout(func, timeout);\n}\n\n/**\n * Checks if the element is out of the viewport\n * https://gomakethings.com/how-to-check-if-any-part-of-an-element-is-out-of-the-viewport-with-vanilla-js/\n * @param {HTMLElement} element The element to check\n * @return {Object} A set of booleans for each side of the element\n */\n\nexport function isOutOfViewPort (element) {\n const bounding = element.getBoundingClientRect();\n\n const isOut = {\n top: bounding.top < 0,\n left: bounding.left < 0,\n bottom: bounding.bottom > (window.innerHeight || document.documentElement.clientHeight),\n right: bounding.right > (window.innerWidth || document.documentElement.clientWidth),\n };\n isOut.any = Object.values(isOut).some(val => val);\n isOut.all = Object.values(isOut).every(val => val);\n return isOut;\n}\n\n// match valid characters for a domain name followed by a dot, e.g. \"dialpad.\"\nconst domainNameRegex = /(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)/;\n\n// match valid TLDs for a hostname (outdated list from ~2017)\nconst tldRegerx = new RegExp(\n '(?:' +\n 'com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|' +\n 'za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|' +\n 'il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|' +\n 'ae|ph|online|ng|ee|ws|ve|cat' +\n ')',\n);\n\n// match valid IPv4 addresses, e.g. \"192.158.1.38\"\nconst ipv4Regex = new RegExp(\n '(?:(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])\\\\.){3}' +\n '(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])',\n);\n\n// match hostnames OR IPv4 addresses, e.g. \"dialpad.com\" or \"192.158.1.38\"\nconst hostnameOrIpRegex = new RegExp(\n '(?:' +\n [\n [\n domainNameRegex.source,\n tldRegerx.source,\n ].join('+'),\n ipv4Regex.source,\n ].join('|') +\n ')',\n);\n\n// match URL paths, e.g. \"/news\"\nconst urlPathRegex = /(?:(?:[;/][^#?<>\\s]*)?)/;\n\n// match URL queries and fragments, e.g. \"?cache=1&new=true\" or \"#heading1\"\nconst urlQueryOrFragmentRegex = /(?:(?:\\?[^#<>\\s]+)?(?:#[^<>\\s]+)?)/;\n\n// match complete hostnames or IPv4 addresses without a protocol and with optional\n// URL paths, queries and fragments e.g. \"dialpad.com/news?cache=1#heading1\"\nconst urlWithoutProtocolRegex = new RegExp(\n '\\\\b' +\n [\n hostnameOrIpRegex.source,\n urlPathRegex.source,\n urlQueryOrFragmentRegex.source,\n '(?!\\\\w)',\n ].join('+'),\n);\n\n// match complete hostnames with protocols and optional URL paths, queries and fragments,\n// e.g. \"ws://localhost:9011\" or \"https://dialpad.com/news?cache=1#heading1\"\nconst urlWithProtocolRegex = /\\b[a-z\\d.-]+:\\/\\/[^<>\\s]+/;\n\n// match email addresses with an optional \"mailto:\" prefix and URL queries, e.g.\n// \"hey@dialpad.com\" or \"mailto:hey@dialpad.com?subject=Hi&body=Hey%20there\"\nconst emailAddressRegex = new RegExp(\n '(?:mailto:)?' +\n '[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n [\n hostnameOrIpRegex.source,\n urlQueryOrFragmentRegex.source,\n ].join('+') +\n '(?!\\\\w)',\n);\n\n/**\n * Match phone numbers, e.g. \"765-8813\", \"(778) 765-8813\" or \"+17787658813\".\n * @param {number} minLength\n * @param {number} maxLength\n * @returns {RegExp}\n */\nexport function getPhoneNumberRegex (minLength = 7, maxLength = 15) {\n // Some older browser versions don't support lookbehind, so provide a RegExp\n // version without it. It fails just one test case, so IMO it's still good\n // enough to use. https://caniuse.com/js-regexp-lookbehind\n try {\n return new RegExp(\n '(?:^|(?<=\\\\W))' +\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n } catch {\n \n console.warn('This browser doesn\\'t support regex lookahead/lookbehind');\n }\n\n return new RegExp(\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n}\n\nconst phoneNumberRegex = getPhoneNumberRegex();\n\n// match all link types\nexport const linkRegex = new RegExp(\n [\n urlWithoutProtocolRegex.source,\n urlWithProtocolRegex.source,\n emailAddressRegex.source,\n phoneNumberRegex.source,\n ].join('|'),\n 'gi',\n);\n\n/**\n * Check if a string is a phone number. Validates only exact matches.\n * @param {string|number} input\n * @returns {boolean}\n */\nexport function isPhoneNumber (input) {\n if (!input || (!['string', 'number'].includes(typeof input))) return false;\n input = input.toString();\n return phoneNumberRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an URL. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isURL (input) {\n if (!input || typeof input !== 'string') return false;\n return urlWithoutProtocolRegex.exec(input)?.[0] === input ||\n urlWithProtocolRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an email address. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isEmailAddress (input) {\n if (!input || typeof input !== 'string') return false;\n return emailAddressRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Concatenate a string removing null or undefined elements\n * avoiding parsing them as string with template strings\n * @param {Array} elements\n * @returns {String}\n */\nexport function safeConcatStrings (elements) {\n return elements.filter(str => !!str).join(', ');\n}\n\n/**\n * Locale safe function to capitalize the first letter of a string.\n * @param {string} str the string to capitalize the first letter of\n * @param {string} locale a string representing the locale to be used. Defaults to 'en-US'\n * @returns The passed in string with the first letter capitalized\n */\nexport function capitalizeFirstLetter (str, locale = 'en-US') {\n return str.replace(/^\\p{CWU}/u, char => char.toLocaleUpperCase(locale));\n}\n\n/**\n * Warns if the component is not mounted properly. Useful for tests.\n * @param {HTMLElement} componentRef - the component reference\n * @param {string} componentName - the component name\n */\n\nexport function warnIfUnmounted (componentRef, componentName) {\n if (typeof process === 'undefined') return;\n if (process.env.NODE_ENV !== 'test') return;\n if (!componentRef || !(componentRef instanceof HTMLElement) || !document?.body) return;\n if (!document.body.contains(componentRef)) {\n console.warn(`The ${componentName} component is not attached to the document body. This may cause issues.`);\n }\n}\n\n/**\n * checks whether the dt-scrollbar is being used on the root element.\n * @param rootElement {HTMLElement}\n * @returns {boolean}\n */\nfunction isDtScrollbarInUse (rootElement = document.documentElement) {\n if (rootElement.hasAttribute('data-overlayscrollbars')) {\n return true;\n }\n return false;\n}\n\n// Shared by ownerless callers, so a legacy disable/enable pair still acts as one owner.\nconst LEGACY_SCROLL_LOCK_OWNER = Symbol('legacyScrollLockOwner');\n\nfunction getRootScrollLockClass (rootElement) {\n return isDtScrollbarInUse(rootElement) ? 'd-scrollbar-disabled' : 'd-of-hidden';\n}\n\n/**\n * This will disable scrolling on the root element regardless of whether you are using dt-scrollbar or not.\n * Each owner holds its own lock; scrolling stays disabled until every owner has called enableRootScrolling.\n * @param rootElement {HTMLElement}\n * @param owner {*} identifies the caller's lock. Ownerless callers share a single owner.\n */\nexport function disableRootScrolling (rootElement = document.documentElement, owner = LEGACY_SCROLL_LOCK_OWNER) {\n addOwnedClass(rootElement, getRootScrollLockClass(rootElement), owner);\n}\n\n/**\n * This will release the owner's scroll lock on the root element regardless of whether you are using dt-scrollbar\n * or not. The class that owner added is removed only when no other owner still holds it.\n * @param rootElement {HTMLElement}\n * @param owner {*} the owner passed to disableRootScrolling. Ownerless callers share a single owner.\n */\nexport function enableRootScrolling (rootElement = document.documentElement, owner = LEGACY_SCROLL_LOCK_OWNER) {\n if (hasClassOwners(rootElement)) {\n removeOwnedClass(rootElement, owner);\n } else if (owner === LEGACY_SCROLL_LOCK_OWNER) {\n // No tracked lock: keep the previous unconditional behavior for ownerless callers.\n rootElement.classList.remove(getRootScrollLockClass(rootElement));\n }\n}\n\n/**\n * This will take a text string e.g \"accessibility-mac\"\n * and convert it to our Fluent Key standard format \"ACCESSIBILITY_MAC\"\n * @param text\n * @returns {string}\n */\nexport function toFluentKeyString (text) {\n return text\n .replaceAll(/[ -]/g, '_')\n .replaceAll(/\\W/g, '')\n .toUpperCase();\n}\n\nexport default {\n getUniqueString,\n getRandomElement,\n getRandomInt,\n formatMessages,\n filterFormattedMessages,\n hasFormattedMessageOfType,\n getValidationState,\n htmlFragment,\n flushPromises,\n kebabCaseToPascalCase,\n extractVueListeners,\n extractNonListeners,\n removeClassStyleAttrs,\n returnFirstEl,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n disableRootScrolling,\n enableRootScrolling,\n};\n\n"],"mappings":"qGACA,IAAM,EAAc,IAAI,QAQxB,SAAgB,EAAe,EAAS,EAAW,EAAO,CACxD,IAAI,EAAS,EAAY,IAAI,EAAQ,CAChC,IACH,EAAS,IAAI,IACb,EAAY,IAAI,EAAS,EAAO,EAE9B,GAAO,IAAI,EAAM,GACrB,EAAO,IAAI,EAAO,EAAU,CAC5B,EAAQ,UAAU,IAAI,EAAU,EAQlC,SAAgB,EAAkB,EAAS,EAAO,CAChD,IAAM,EAAS,EAAY,IAAI,EAAQ,CACjC,EAAY,GAAQ,IAAI,EAAM,CAC/B,KAEL,CADA,EAAO,OAAO,EAAM,CACf,EAAO,MAAM,EAAY,OAAO,EAAQ,CAC7C,IAAK,IAAM,KAAsB,EAAO,QAAQ,CAC9C,GAAI,IAAuB,EAAW,OAExC,EAAQ,UAAU,OAAO,EAAU,EAOrC,SAAgB,EAAgB,EAAS,CACvC,OAAO,EAAY,IAAI,EAAQ,CC9BjC,IAAI,EAAoB,EACpB,EASE,EAAqB,yIAErB,EAAY,OAAO,cAAiB,WAAa,aAAe,WAEtE,SAAgB,EAAiB,EAAA,KAAyB,CACxD,MAAO,GAAG,IAAS,MAUrB,SAAgB,EAAkB,EAAO,EAAM,CAC7C,GAAI,EAAM,CACR,IAAM,EAAO,EAAa,EAAK,CAC/B,OAAO,EAAM,KAAK,IAAI,EAAK,CAAG,EAAM,aAEpC,OAAO,EAAM,EAAa,EAAM,OAAO,EAmB3C,SAAgB,EAAc,EA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BACA,YACA,iBACA,gBACA,QACA,oBACA,wBACA,uBACA,sBACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dialpad/dialtone-vue",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.11.0",
|
|
4
4
|
"description": "Vue component library for Dialpad's design system Dialtone",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"overlayscrollbars": "2.10.0",
|
|
48
48
|
"regex-combined-emojis": "1.6.0",
|
|
49
49
|
"tippy.js": "6.3.7",
|
|
50
|
-
"@dialpad/dialtone-
|
|
51
|
-
"@dialpad/dialtone-
|
|
50
|
+
"@dialpad/dialtone-icons": "5.5.1",
|
|
51
|
+
"@dialpad/dialtone-emojis": "1.3.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@storybook/addon-a11y": "10.3.0",
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
"react": "19.2.4",
|
|
63
63
|
"storybook": "10.3.0",
|
|
64
64
|
"vue": "^3.3.4",
|
|
65
|
-
"@dialpad/dialtone
|
|
66
|
-
"@dialpad/
|
|
65
|
+
"@dialpad/generator-dialtone": "0.1.0",
|
|
66
|
+
"@dialpad/dialtone-css": "9.9.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"vue": ">=3.2",
|
|
70
|
-
"@dialpad/dialtone-css": "^9.
|
|
70
|
+
"@dialpad/dialtone-css": "^9.9.0"
|
|
71
71
|
},
|
|
72
72
|
"bugs": {
|
|
73
73
|
"email": "dialtone@dialpad.com"
|
|
@@ -113,6 +113,11 @@
|
|
|
113
113
|
"import": "./dist/lib/*/index.js",
|
|
114
114
|
"require": "./dist/lib/*/index.cjs"
|
|
115
115
|
},
|
|
116
|
+
"./phone": {
|
|
117
|
+
"types": "./dist/common/phone/index.d.ts",
|
|
118
|
+
"import": "./dist/common/phone/index.js",
|
|
119
|
+
"require": "./dist/common/phone/index.cjs"
|
|
120
|
+
},
|
|
116
121
|
"./component-documentation.json": "./dist/component-documentation.json",
|
|
117
122
|
"./*": "./dist/*"
|
|
118
123
|
},
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/constants/sizes.cjs`),t=require(`./common/validators/index.cjs`),n=require(`./common/utils/index.cjs`),r=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`),i=require(`./common/mixins/keyboard-list-navigation.cjs`),a=require(`./lib/combobox/combobox-loading-list.cjs`),o=require(`./lib/combobox/combobox-empty-list.cjs`),s=require(`./lib/combobox/combobox-constants.cjs`);let c=require(`vue`);var l={name:`DtCombobox`,components:{ComboboxLoadingList:a.default,ComboboxEmptyList:o.default},mixins:[i.default({indexKey:`highlightIndex`,idKey:`highlightId`,listElementKey:`getListElement`,afterHighlightMethod:`afterHighlight`,beginningOfListMethod:`beginningOfListMethod`,endOfListMethod:`endOfListMethod`,activeItemKey:`activeItemEl`})],props:{label:{type:String,required:!0},showLabel:{type:Boolean,default:!0},size:{type:[String,Number],default:null,validator:n=>n===null||Object.values(s.COMBOBOX_LABEL_SIZES).includes(n)||t.ordinalSizeValidator(e.COMPONENT_SIZES)(n)},description:{type:String,default:``},listId:{type:String,default(){return n.getUniqueString()}},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},showList:{type:Boolean,default:!1},listRenderedOutside:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyList:{type:Boolean,default:!1},emptyStateMessage:{type:String,default:``},emptyStateClass:{type:[String,Object,Array],default:``},clickOnSelect:{type:Boolean,default:!1}},emits:[`select`,`escape`,`highlight`,`opened`],data(){return{outsideRenderedListRef:null,hasSlotContent:n.hasSlotContent}},computed:{inputProps(){return{label:this.label,showLabel:this.showLabel,size:this.size,description:this.description,role:`combobox`,"aria-label":this.label,"aria-expanded":this.showList.toString(),"aria-owns":this.listId,"aria-haspopup":`listbox`,"aria-activedescendant":this.activeItemId,"aria-controls":this.listId}},listProps(){return{role:`listbox`,id:this.listId,class:`d-ps-relative`,"aria-label":this.label}},beginningOfListMethod(){return this.onBeginningOfList||this.jumpToEnd},endOfListMethod(){return this.onEndOfList||this.jumpToBeginning},activeItemId(){if(!(!this.showList||this.highlightIndex<0||this.loading))return this.highlightId},activeItemEl(){return this.highlightId?this.getListElement().querySelector(`#`+this.highlightId):``}},watch:{showList(e){this.listRenderedOutside||(this.setInitialHighlightIndex(),this.$emit(`opened`,e)),!e&&this.outsideRenderedListRef&&(this.outsideRenderedListRef.removeEventListener(`mousemove`,this.onMouseHighlight),this.outsideRenderedListRef=null)},loading(){this.$nextTick(()=>{this.setInitialHighlightIndex()})},$props:{deep:!0,immediate:!0,handler(){this.validateEmptyListProps()}}},created(){this.validateEmptyListProps()},methods:{onMouseHighlight(e){if(this.loading)return;let t=e.target.closest(`li`);t&&this.highlightId!==t.id&&this.setHighlightId(t.id)},getListElement(){return this.outsideRenderedListRef??this.$refs.listWrapper?.querySelector(`#${this.listId}`)},clearHighlightIndex(){this.showList&&this.getListElement()&&this.setHighlightIndex(-1)},afterHighlight(){this.loading||this.$emit(`highlight`,this.highlightIndex)},onEnterKey(){this.loading||this.emptyList||this.highlightIndex>=0&&(this.$emit(`select`,this.highlightIndex),this.clickOnSelect&&this.activeItemEl?.click())},onEscapeKey(){this.$emit(`escape`)},onOpen(e,t){this.outsideRenderedListRef=t,this.outsideRenderedListRef?.addEventListener(`mousemove`,this.onMouseHighlight),this.$emit(`opened`,e),e&&this.setInitialHighlightIndex()},onKeyValidation(e,t){!this.showList||!this.getListElement()||this[t](e)},setInitialHighlightIndex(){this.showList&&this.$nextTick(()=>{!this.showList||!this.getListElement()||this.setHighlightIndex(this.loading?-1:0)})},validateEmptyListProps(){this.$slots.emptyListItem||this.emptyList&&!this.emptyStateMessage&&console.error(`Invalid props: you must pass both props emptyList and emptyStateMessage to show the
|
|
2
|
-
empty message.`)}}},u={"data-qa":`dt-combobox-input-wrapper`};function d(e,t,n,r,i,a){let o=(0,c.resolveComponent)(`combobox-loading-list`),s=(0,c.resolveComponent)(`combobox-empty-list`);return(0,c.openBlock)(),(0,c.createElementBlock)(`div`,{onKeydown:[t[3]||(t[3]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onEscapeKey`),[`stop`]),[`esc`])),t[4]||(t[4]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onEnterKey`),[`exact`]),[`enter`])),t[5]||(t[5]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onUpKey`),[`stop`,`prevent`]),[`up`])),t[6]||(t[6]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onDownKey`),[`stop`,`prevent`]),[`down`])),t[7]||(t[7]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onHomeKey`),[`stop`,`prevent`]),[`home`])),t[8]||(t[8]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onEndKey`),[`stop`,`prevent`]),[`end`]))]},[(0,c.createElementVNode)(`div`,u,[(0,c.renderSlot)(e.$slots,`input`,{inputProps:a.inputProps})]),n.showList?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{key:0,ref:`listWrapper`,"data-qa":`dt-combobox-list-wrapper`,onMouseleave:t[0]||(t[0]=(...e)=>a.clearHighlightIndex&&a.clearHighlightIndex(...e)),onFocusout:t[1]||(t[1]=(...e)=>a.clearHighlightIndex&&a.clearHighlightIndex(...e)),onMousemoveCapture:t[2]||(t[2]=(...e)=>a.onMouseHighlight&&a.onMouseHighlight(...e))},[n.loading&&!n.listRenderedOutside?((0,c.openBlock)(),(0,c.createBlock)(o,(0,c.normalizeProps)((0,c.mergeProps)({key:0},a.listProps)),null,16)):n.emptyList&&(n.emptyStateMessage||i.hasSlotContent(e.$slots.emptyListItem))&&!n.listRenderedOutside?((0,c.openBlock)(),(0,c.createBlock)(s,(0,c.mergeProps)({key:1},a.listProps,{message:n.emptyStateMessage,"item-class":n.emptyStateClass}),{default:(0,c.withCtx)(()=>[(0,c.renderSlot)(e.$slots,`emptyListItem`)]),_:3},16,[`message`,`item-class`])):(0,c.renderSlot)(e.$slots,`list`,{key:2,listProps:a.listProps,opened:a.onOpen,clearHighlightIndex:a.clearHighlightIndex})],544)):(0,c.createCommentVNode)(``,!0)],32)}var f=r.t(l,[[`render`,d]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|
|
3
|
-
//# sourceMappingURL=Combobox-96zAPv6d.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./localization/index.cjs`),n=require(`./lib/button/button.cjs`),r=require(`./lib/stack/stack.cjs`),i=require(`./lib/tooltip/tooltip.cjs`),a=require(`./lib/datepicker/datepicker-constants.cjs`),o=require(`./lib/datepicker/utils.cjs`);let s=require(`vue`),c=require(`@dialpad/dialtone-icons/vue`),l=require(`date-fns`);function u(n,r){let i=(0,s.ref)((0,l.getMonth)(n.selectedDate)),c=(0,s.ref)((0,l.getYear)(n.selectedDate)),u=(0,s.ref)(null),d=(0,s.ref)(0),f=(0,s.ref)([]),p=new t.DialtoneLocalization,m=(0,s.computed)(()=>o.getCalendarDays(i.value,c.value,u.value,n.minDate,n.maxDate,n.weekStartsOn)),h=(0,s.computed)(()=>n.minDate?(0,l.endOfMonth)((0,l.subMonths)(new Date(c.value,i.value,1),1))<(0,l.startOfDay)(n.minDate):!1),g=(0,s.computed)(()=>n.maxDate?(0,l.startOfMonth)((0,l.addMonths)(new Date(c.value,i.value,1),1))>(0,l.startOfDay)(n.maxDate):!1),_=(0,s.computed)(()=>n.minDate?(0,l.endOfMonth)(new Date(c.value-1,i.value,1))<(0,l.startOfDay)(n.minDate):!1),v=(0,s.computed)(()=>n.maxDate?(0,l.startOfMonth)(new Date(c.value+1,i.value,1))>(0,l.startOfDay)(n.maxDate):!1);(0,s.watch)(i,()=>{C(),r(`calendar-days`,m.value)},{immediate:!0}),(0,s.watch)(c,()=>{C(),r(`calendar-days`,m.value)},{immediate:!0}),(0,s.watch)(()=>n.minDate,()=>{r(`calendar-days`,m.value)}),(0,s.watch)(()=>n.maxDate,()=>{r(`calendar-days`,m.value)});function y(e){return o.formatMonth(e,a.INTL_MONTH_FORMAT,p.currentLocale)}function b(e){f.value.includes(e)||f.value.push(e)}function x(){e.returnFirstEl(f.value[0].$el).focus()}function S(t){switch(t.key){case`ArrowLeft`:t.preventDefault(),d.value===0?(d.value=3,e.returnFirstEl(f.value[d.value].$el).focus()):(d.value--,e.returnFirstEl(f.value[d.value].$el).focus());break;case`ArrowRight`:t.preventDefault(),d.value===3?(d.value=0,e.returnFirstEl(f.value[d.value].$el).focus()):(d.value++,e.returnFirstEl(f.value[d.value].$el).focus());break;case`ArrowDown`:t.preventDefault(),r(`focus-first-day`);break;case`Tab`:t.preventDefault(),r(`focus-first-day`);break;case`Escape`:r(`close-datepicker`);break}}function C(){let e=(0,l.getYear)(n.selectedDate),t=(0,l.getMonth)(n.selectedDate);e!==c.value||t!==i.value?u.value=null:u.value=(0,l.getDate)(n.selectedDate)}function w(e){if(e===-1&&h.value||e===1&&g.value)return;(i.value===0&&e===-1||i.value===11&&e===1)&&(c.value+=e);let t=(0,l.set)(n.selectedDate,{month:i.value,year:c.value});i.value=(0,l.getMonth)(e===1?(0,l.addMonths)(t,1):(0,l.subMonths)(t,1))}function T(e){e===-1&&_.value||e===1&&v.value||(c.value+=e)}function E(){w(1)}function D(){w(-1)}function O(){return`${p.$t(`DIALTONE_DATEPICKER_CHANGE_TO`)} ${p.$t(`DIALTONE_DATEPICKER_PREVIOUS_YEAR`)} ${c.value-1}`}function k(){return`${p.$t(`DIALTONE_DATEPICKER_CHANGE_TO`)} ${p.$t(`DIALTONE_DATEPICKER_PREVIOUS_MONTH`)} ${y(i.value-1)}`}function A(){return`${p.$t(`DIALTONE_DATEPICKER_CHANGE_TO`)} ${p.$t(`DIALTONE_DATEPICKER_NEXT_YEAR`)} ${c.value+1}`}function j(){return`${p.$t(`DIALTONE_DATEPICKER_CHANGE_TO`)} ${p.$t(`DIALTONE_DATEPICKER_NEXT_MONTH`)} ${y(i.value+1)}`}return{selectMonth:i,selectYear:c,formattedMonth:y,setDayRef:b,focusMonthYearPicker:x,handleKeyDown:S,changeMonth:w,changeYear:T,goToNextMonth:E,goToPrevMonth:D,isPrevMonthDisabled:h,isNextMonthDisabled:g,isPrevYearDisabled:_,isNextYearDisabled:v,previousYearAriaLabel:O,previousMonthAriaLabel:k,nextYearAriaLabel:A,nextMonthAriaLabel:j}}var d={id:`calendar-heading`,class:`d-datepicker__month-year-title`,"data-qa":`dt-datepicker-heading`},f={__name:`MonthYearPicker`,props:{selectedDate:{type:Date,required:!0},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},weekStartsOn:{type:Number,default:0,validator:e=>Number.isInteger(e)&&e>=0&&e<=6}},emits:[`calendar-days`,`focus-first-day`,`focus-last-day`,`close-datepicker`],setup(e,{expose:a,emit:o}){let l=e,f=o,p=new t.DialtoneLocalization,{selectMonth:m,selectYear:h,formattedMonth:g,setDayRef:_,focusMonthYearPicker:v,handleKeyDown:y,changeMonth:b,changeYear:x,goToNextMonth:S,goToPrevMonth:C,isPrevMonthDisabled:w,isNextMonthDisabled:T,isPrevYearDisabled:E,isNextYearDisabled:D,previousYearAriaLabel:O,previousMonthAriaLabel:k,nextMonthAriaLabel:A,nextYearAriaLabel:j}=u(l,f);return(0,s.onMounted)(()=>{v()}),a({focusMonthYearPicker:v,goToNextMonth:S,goToPrevMonth:C}),(e,t)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(r.default),{class:`d-datepicker__month-year`,direction:`row`,gap:`50`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(r.default),{as:`nav`,class:`d-datepicker__nav`,direction:`row`,gap:`25`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(i.default),{"fallback-placements":[`top-start`,`auto`],message:(0,s.unref)(p).$t(`DIALTONE_DATEPICKER_PREVIOUS_YEAR`),placement:`top`},{anchor:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(n.default),{id:`prevYearButton`,ref:e=>{e&&(0,s.unref)(_)(e)},"aria-label":(0,s.unref)(O)(),disabled:(0,s.unref)(E),kind:`muted`,class:`d-datepicker__nav-btn`,importance:`clear`,size:100,type:`button`,onClick:t[0]||(t[0]=e=>(0,s.unref)(x)(-1)),onKeydown:t[1]||(t[1]=e=>(0,s.unref)(y)(e))},{icon:(0,s.withCtx)(({iconSize:e})=>[(0,s.createVNode)((0,s.unref)(c.DtIconChevronsLeft),{size:e},null,8,[`size`])]),_:1},8,[`aria-label`,`disabled`])]),_:1},8,[`message`]),(0,s.createVNode)((0,s.unref)(i.default),{"fallback-placements":[`top-start`,`auto`],message:(0,s.unref)(p).$t(`DIALTONE_DATEPICKER_PREVIOUS_MONTH`),placement:`top`},{anchor:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(n.default),{id:`prevMonthButton`,ref:e=>{e&&(0,s.unref)(_)(e)},"aria-label":(0,s.unref)(k)(),disabled:(0,s.unref)(w),class:`d-datepicker__nav-btn`,importance:`clear`,kind:`muted`,size:100,type:`button`,onClick:t[2]||(t[2]=e=>(0,s.unref)(b)(-1)),onKeydown:t[3]||(t[3]=e=>(0,s.unref)(y)(e))},{icon:(0,s.withCtx)(({iconSize:e})=>[(0,s.createVNode)((0,s.unref)(c.DtIconChevronLeft),{size:e},null,8,[`size`])]),_:1},8,[`aria-label`,`disabled`])]),_:1},8,[`message`])]),_:1}),(0,s.createElementVNode)(`div`,d,(0,s.toDisplayString)((0,s.unref)(g)((0,s.unref)(m)))+` `+(0,s.toDisplayString)((0,s.unref)(h)),1),(0,s.createVNode)((0,s.unref)(r.default),{as:`nav`,class:`d-datepicker__nav`,direction:`row`,gap:`25`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(i.default),{"fallback-placements":[`top-end`,`auto`],message:(0,s.unref)(p).$t(`DIALTONE_DATEPICKER_NEXT_MONTH`),placement:`top`},{anchor:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(n.default),{id:`nextMonthButton`,ref:e=>{e&&(0,s.unref)(_)(e)},"aria-label":(0,s.unref)(A)(),disabled:(0,s.unref)(T),class:`d-datepicker__nav-btn`,importance:`clear`,kind:`muted`,size:100,type:`button`,onClick:t[4]||(t[4]=e=>(0,s.unref)(b)(1)),onKeydown:t[5]||(t[5]=e=>(0,s.unref)(y)(e))},{icon:(0,s.withCtx)(({iconSize:e})=>[(0,s.createVNode)((0,s.unref)(c.DtIconChevronRight),{size:e},null,8,[`size`])]),_:1},8,[`aria-label`,`disabled`])]),_:1},8,[`message`]),(0,s.createVNode)((0,s.unref)(i.default),{"fallback-placements":[`top-end`,`auto`],message:(0,s.unref)(p).$t(`DIALTONE_DATEPICKER_NEXT_YEAR`),placement:`top`},{anchor:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(n.default),{id:`nextYearButton`,ref:e=>{e&&(0,s.unref)(_)(e)},"aria-label":(0,s.unref)(j)(),disabled:(0,s.unref)(D),class:`d-datepicker__nav-btn`,importance:`clear`,kind:`muted`,size:100,type:`button`,onClick:t[6]||(t[6]=e=>(0,s.unref)(x)(1)),onKeydown:t[7]||(t[7]=e=>(0,s.unref)(y)(e))},{icon:(0,s.withCtx)(({iconSize:e})=>[(0,s.createVNode)((0,s.unref)(c.DtIconChevronsRight),{size:e},null,8,[`size`])]),_:1},8,[`aria-label`,`disabled`])]),_:1},8,[`message`])]),_:1})]),_:1}))}};function p(n,r){let i=(0,s.ref)(null),c=(0,s.ref)(0),l=(0,s.ref)([]),u=new t.DialtoneLocalization,d=(0,s.computed)(()=>o.getWeekDayNames(u.currentLocale,n.weekStartsOn));(0,s.watch)(()=>n.calendarDays,()=>{c.value=0,l.value=[],i.value=null});function f(e){return u.$t(`DIALTONE_DATEPICKER_SELECT_DAY`)+` ${o.formatDate(e.value,a.INTL_MONTH_FORMAT,u.currentLocale)}`}function p(e,t){!l.value.some(t=>t.el===e)&&!t.disabled&&l.value.push({el:e,day:t})}function m(t){switch(t.key){case`ArrowUp`:t.preventDefault(),c.value-=7;try{e.returnFirstEl(l.value[c.value].el.$el).focus()}catch{let t=o.calculatePrevFocusDate(l.value[c.value+7].day.value);r(`go-to-prev-month`),(0,s.nextTick)(()=>{e.returnFirstEl(l.value[t-1].el.$el).focus(),c.value+=t-1})}break;case`ArrowDown`:t.preventDefault(),c.value+=7;try{e.returnFirstEl(l.value[c.value].el.$el).focus()}catch{let t=o.calculateNextFocusDate(l.value[c.value-7].day.value);r(`go-to-next-month`),(0,s.nextTick)(()=>{e.returnFirstEl(l.value[t-1].el.$el).focus(),c.value+=t-1})}break;case`ArrowLeft`:t.preventDefault(),c.value>0?(--c.value,e.returnFirstEl(l.value[c.value].el.$el).focus()):(r(`go-to-prev-month`),g());break;case`ArrowRight`:t.preventDefault(),c.value<l.value.length-1?(c.value+=1,e.returnFirstEl(l.value[c.value].el.$el).focus()):(r(`go-to-next-month`),h());break;case`Tab`:t.preventDefault(),r(`focus-month-year-picker`);break;case`Escape`:r(`close-datepicker`);break}}function h(){c.value=0,(0,s.nextTick)(()=>{e.returnFirstEl(l.value[c.value].el.$el).focus()})}function g(){(0,s.nextTick)(()=>{c.value=l.value.length-1,e.returnFirstEl(l.value[c.value].el.$el).focus()})}function _(e){e.disabled||(i.value=e.text,r(`select-date`,e.value))}return{selectedDay:i,weekDays:d,dayAriaLabel:f,setDayRef:p,handleKeyDown:m,focusFirstDay:h,selectDay:_}}var m={class:`d-datepicker__calendar`,"aria-labelledby":`calendar-heading`,"data-qa":`dt-datepicker-calendar`},h=[`title`,`aria-label`],g={__name:`Calendar`,props:{calendarDays:{type:Array,required:!0},weekStartsOn:{type:Number,default:0,validator:e=>Number.isInteger(e)&&e>=0&&e<=6}},emits:[`select-date`,`focus-month-year-picker`,`close-datepicker`,`go-to-next-month`,`go-to-prev-month`],setup(e,{expose:t,emit:r}){let{selectedDay:i,weekDays:a,dayAriaLabel:o,setDayRef:c,handleKeyDown:l,focusFirstDay:u,selectDay:d}=p(e,r);return t({focusFirstDay:u}),(t,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(`table`,m,[(0,s.createElementVNode)(`thead`,null,[(0,s.createElementVNode)(`tr`,null,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(a),e=>((0,s.openBlock)(),(0,s.createElementBlock)(`th`,{key:e,scope:`col`,class:`d-datepicker__cell d-datepicker__cell--header`},[(0,s.createElementVNode)(`span`,{class:`d-datepicker__weekday`,"data-qa":`dt-datepicker-weekday`,title:e,"aria-label":e},(0,s.toDisplayString)(e),9,h)]))),128))])]),(0,s.createElementVNode)(`tbody`,null,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.calendarDays,(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`tr`,{key:t,"data-qa":`dt-datepicker-week`},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.days,(e,a)=>((0,s.openBlock)(),(0,s.createElementBlock)(`td`,{key:t+a,class:`d-datepicker__cell`,role:`listbox`},[(0,s.createVNode)((0,s.unref)(n.default),{ref_for:!0,ref:t=>{t&&(0,s.unref)(c)(t,e)},class:(0,s.normalizeClass)([`d-datepicker__day`,{"d-datepicker__day--disabled":e.disabled,"d-datepicker__day--selected":(0,s.unref)(i)?e.text===(0,s.unref)(i)&&!e.disabled:e.selected}]),size:200,kind:`muted`,importance:`clear`,disabled:e.disabled,type:`button`,"aria-selected":(0,s.unref)(i)?e.text===(0,s.unref)(i)&&!e.disabled:e.selected,"aria-label":(0,s.unref)(o)(e),role:`option`,onClick:t=>(0,s.unref)(d)(e),onKeydown:r[0]||(r[0]=e=>(0,s.unref)(l)(e))},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(e.text),1)]),_:2},1032,[`disabled`,`class`,`aria-selected`,`aria-label`,`onClick`])]))),128))]))),128))])]))}},_={class:`d-datepicker__hd`,"data-qa":`dt-datepicker-header`},v={class:`d-datepicker__bd`,"data-qa":`dt-datepicker-body`},y=Object.assign({name:`DtDatepicker`},{__name:`Datepicker`,props:{selectedDate:{type:Date,default:()=>new Date},minDate:{type:Date,default:null},maxDate:{type:Date,default:null,validator:(e,t)=>e&&t.minDate&&e<t.minDate?(console.warn(`[DtDatepicker]: maxDate must be after or equal to minDate.`),!1):!0},weekStartsOn:{type:Number,default:0,validator:e=>Number.isInteger(e)&&e>=0&&e<=6}},emits:[`selected-date`,`close-datepicker`],setup(t){let n=(0,s.ref)([]);function i(e){n.value=e}return(0,s.onMounted)(()=>{e.warnIfUnmounted(e.returnFirstEl((0,s.getCurrentInstance)().proxy.$el),`datepicker`)}),(e,a)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(r.default),{class:`d-datepicker`,gap:`100`},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,_,[(0,s.createVNode)(f,{ref:`monthYearPicker`,"selected-date":t.selectedDate,"min-date":t.minDate,"max-date":t.maxDate,"week-starts-on":t.weekStartsOn,onCalendarDays:i,onFocusFirstDay:a[0]||(a[0]=t=>e.$refs.calendar.focusFirstDay()),onFocusLastDay:a[1]||(a[1]=t=>e.$refs.calendar.focusLastDay()),onCloseDatepicker:a[2]||(a[2]=t=>e.$emit(`close-datepicker`))},null,8,[`selected-date`,`min-date`,`max-date`,`week-starts-on`])]),(0,s.createElementVNode)(`div`,v,[(0,s.createVNode)(g,{ref:`calendar`,"calendar-days":n.value,"week-starts-on":t.weekStartsOn,onSelectDate:a[3]||(a[3]=t=>e.$emit(`selected-date`,t)),onFocusMonthYearPicker:a[4]||(a[4]=t=>e.$refs.monthYearPicker.focusMonthYearPicker()),onCloseDatepicker:a[5]||(a[5]=t=>e.$emit(`close-datepicker`)),onGoToNextMonth:a[6]||(a[6]=t=>e.$refs.monthYearPicker.goToNextMonth()),onGoToPrevMonth:a[7]||(a[7]=t=>e.$refs.monthYearPicker.goToPrevMonth())},null,8,[`calendar-days`,`week-starts-on`])])]),_:1}))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return y}});
|
|
2
|
-
//# sourceMappingURL=Datepicker-DmKOuf5y.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./localization/index.cjs`),n=require(`./lib/button/button.cjs`),r=require(`./lib/tooltip/tooltip.cjs`),i=require(`./lib/input/input.cjs`),a=require(`./lib/tab/tab-group.cjs`),o=require(`./lib/tab/tab.cjs`),s=require(`./lib/emoji-picker/emoji-picker-constants.cjs`);let c=require(`vue`),l=require(`@dialpad/dialtone-icons/vue`),u=require(`@dialpad/dialtone-emojis`);var d={class:`d-emoji-picker__search d-emoji-picker__alignment`,"data-qa":`dt-emoji-picker-search`},f={__name:`EmojiSearch`,props:{searchPlaceholderLabel:{type:String,required:!0},modelValue:{type:String,default:``}},emits:[`update:modelValue`,`focus-emoji-selector`,`focus-tabset`,`select-first-emoji`],setup(e,{expose:t,emit:r}){let a=r,o=(0,c.ref)(null);function s(){a(`update:modelValue`,``),u()}function u(){o.value.focus()}return(0,c.onMounted)(()=>{u()}),t({focusSearchInput:u}),(t,r)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,d,[(0,c.createVNode)((0,c.unref)(i.default),{id:`searchInput`,ref_key:`searchInput`,ref:o,placeholder:e.searchPlaceholderLabel,"model-value":e.modelValue,"onUpdate:modelValue":r[0]||(r[0]=e=>t.$emit(`update:modelValue`,e)),onKeydown:[r[1]||(r[1]=(0,c.withKeys)(e=>t.$emit(`focus-tabset`),[`up`])),r[2]||(r[2]=(0,c.withKeys)((0,c.withModifiers)(e=>t.$emit(`focus-emoji-selector`),[`prevent`]),[`down`])),r[3]||(r[3]=(0,c.withKeys)(e=>t.$emit(`select-first-emoji`),[`enter`]))]},(0,c.createSlots)({startIcon:(0,c.withCtx)(()=>[(0,c.createVNode)((0,c.unref)(l.DtIconSearch),{size:`200`})]),_:2},[e.modelValue.length>0?{name:`endIcon`,fn:(0,c.withCtx)(()=>[(0,c.createVNode)((0,c.unref)(n.default),{importance:`clear`,size:100,class:`d-emoji-picker__search-x-button`,circle:``,kind:`muted`,onClick:s},{icon:(0,c.withCtx)(()=>[(0,c.createVNode)((0,c.unref)(l.DtIconClose),{size:`200`})]),_:1})]),key:`0`}:void 0]),1032,[`placeholder`,`model-value`])]))}},p={class:`d-emoji-picker__tabset`,"data-qa":`dt-emoji-picker-tabset`},m={__name:`EmojiTabset`,props:{showRecentlyUsedTab:{type:Boolean,default:!1},showCustomEmojisTab:{type:Boolean,default:!1},scrollIntoTab:{type:Number,required:!0},emojiFilter:{type:String,default:``},tabSetLabels:{type:Array,required:!0}},emits:[`selected-tabset`,`focus-search-input`,`focus-skin-selector`],setup(t,{expose:n,emit:r}){let i=t,s=r,u=[{label:i.tabSetLabels[0],icon:l.DtIconClock},{label:i.tabSetLabels[1],icon:l.DtIconSatisfied},{label:i.tabSetLabels[2],icon:l.DtIconLivingThing},{label:i.tabSetLabels[3],icon:l.DtIconFood},{label:i.tabSetLabels[4],icon:l.DtIconObject},{label:i.tabSetLabels[5],icon:l.DtIconTransportation},{label:i.tabSetLabels[6],icon:l.DtIconLightbulb},{label:i.tabSetLabels[7],icon:l.DtIconHeart},{label:i.tabSetLabels[8],icon:l.DtIconFlag},{label:i.tabSetLabels[9],icon:l.DtIconDialpadStar}],d=(0,c.computed)(()=>{let e=i.showRecentlyUsedTab?u:u.slice(1);return i.showCustomEmojisTab||e.pop(),e.map((e,t)=>({...e,id:(t+1).toString(),panelId:(t+1).toString()}))}),f=(0,c.computed)(()=>i.emojiFilter.length>0),m=(0,c.ref)(`1`),h=(0,c.ref)([]);(0,c.watch)(()=>i.scrollIntoTab,()=>{f.value||(m.value=(i.scrollIntoTab+1).toString())}),(0,c.watch)(f,()=>{f.value&&(m.value=null)});function g(e){let t=parseInt(e);m.value=e,s(`selected-tabset`,t)}function _(t){h.value.push(e.returnFirstEl(t.$el))}function v(){h.value[0].focus()}function y(e,t){e.key===`Enter`&&(g(t),h.value[t-1].blur()),e.key===`Tab`&&(e.preventDefault(),e.shiftKey?s(`focus-skin-selector`):s(`focus-search-input`)),e.key===`ArrowDown`&&s(`focus-search-input`)}return n({focusTabset:v}),(e,t)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,p,[(0,c.createVNode)((0,c.unref)(a.default),{selected:m.value,size:200,spread:`equal`,"tab-list-class":`d-emoji-picker__tabset-list`},{tabs:(0,c.withCtx)(()=>[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(d.value,(e,t)=>((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(o.default),{id:e.id,key:e.id,ref_for:!0,ref:e=>{e&&_(e)},label:e.label,"panel-id":e.panelId,tabindex:t+1,"aria-controls":`d-emoji-picker-list`,onKeydown:t=>y(t,e.id),onClickCapture:(0,c.withModifiers)(t=>g(e.id),[`stop`])},{default:(0,c.withCtx)(()=>[((0,c.openBlock)(),(0,c.createBlock)((0,c.resolveDynamicComponent)(e.icon),{size:`400`}))]),_:2},1032,[`id`,`label`,`panel-id`,`tabindex`,`onKeydown`,`onClickCapture`]))),128))]),_:1},8,[`selected`])]))}};function h(){let e=(0,c.ref)([]),t=(0,c.ref)([]),n=(0,c.ref)(!1),r=(0,c.ref)(!0);function i(t,n){d(t,n-1)||(e.value[t-1]?d(t-1,e.value[t-1].length-1):d(e.value.length-1,e.value[e.value.length-1].length-1))}function a(e,t){d(e,t+1)||d(e+1,0)||d(0,0)}function o(e,n){d(0,n-1)||d(0,t.value.length-1)}function l(e,t){d(0,t+1)||d(0,0)}function u(e,t,r){n.value?e===`left`?o(t,r):e===`right`&&l(t,r):e===`left`?i(t,r):e===`right`&&a(t,r)}function d(r,i){let a=n.value?t.value?.[i]:e.value?.[r]?.[i];return a?(a.focus(),!0):!1}function f(t,n,r){e.value[n]||(e.value[n]=[]),e.value[n][r]=t}function p(e,n){t.value[n]=e}function m(e,n){if(r.value=!1,e===s.ARROW_KEYS.ARROW_UP){let e=n%9;if(!d(0,n-9)){let n=t.value.length-t.value.length%9+e;d(0,n),d(0,n)||d(0,t.value.length-1)}}if(e===s.ARROW_KEYS.ARROW_DOWN&&!d(0,n+9)){let e=n%9;t.value?.[n+(9-e)]?d(0,t.value.length-1):d(0,e)}e===s.ARROW_KEYS.ARROW_LEFT&&u(`left`,0,n),e===s.ARROW_KEYS.ARROW_RIGHT&&u(`right`,0,n)}function h(t,n,r){if(t===`ArrowUp`){let t=r%9;if(n===0){let n=9-e.value[e.value.length-1].length%9,r=e.value[e.value.length-1].length+n-(9-t);d(e.value.length-1,r)||d(e.value.length-1,e.value[e.value.length-1].length-1);return}if(!d(n,r-9)){let r=n-1<0?0:n-1,i=e.value[r].length;d(r,i-i%9+t)||d(n-1,e.value[n-1].length-1)}}if(t===`ArrowDown`&&!d(n,r+9)){let t=r%9;e.value?.[n]?.[r+(9-t)]?d(n,e.value[n].length-1):d(n+1,t)||d(0,t)||d(0,e.value[0].length-1)}t===`ArrowLeft`&&u(`left`,n,r),t===`ArrowRight`&&u(`right`,n,r)}return{emojiFilteredRefs:t,isFiltering:n,hoverFirstEmoji:r,setEmojiRef:f,setFilteredRef:p,focusEmoji:d,handleArrowNavigationFiltered:m,handleArrowNavigation:h}}var g={class:`d-emoji-picker__selector`,"data-qa":`dt-emoji-picker-selector`},_={key:0,class:`d-emoji-picker__search-label d-emoji-picker__alignment`,"data-qa":`dt-emoji-picker-search-results-label`},v={"data-qa":`dt-emoji-picker-sticky-label`},y={key:0},b={class:`d-emoji-picker__tab`},x=[`aria-label`,`onClick`,`onFocusin`,`onMouseover`,`onKeydown`],S=[`alt`,`aria-label`,`title`,`src`],C={key:2,class:`d-emoji-picker__alignment`},w={class:`d-emoji-picker__tab`,"data-qa":`filtered-emojis`},T=[`aria-label`,`onClick`,`onFocusin`,`onMouseover`,`onKeydown`],E=[`alt`,`aria-label`,`title`,`src`],D={__name:`EmojiSelector`,props:{emojiFilter:{type:String,default:``},skinTone:{type:String,required:!0},tabsetLabels:{type:Array,required:!0},selectedTabset:{type:Object,required:!0},searchResultsLabel:{type:String,required:!0},searchNoResultsLabel:{type:String,required:!0},recentlyUsedEmojis:{type:Array,default:()=>[]},customEmojis:{type:Array,default:()=>[]}},emits:[`highlighted-emoji`,`selected-emoji`,`scroll-into-tab`,`scroll-bottom-reached`,`focus-skin-selector`,`focus-search-input`],setup(e,{expose:t,emit:n}){let r=e,i=n,{emojiFilteredRefs:a,isFiltering:o,hoverFirstEmoji:l,setEmojiRef:d,setFilteredRef:f,focusEmoji:p,handleArrowNavigationFiltered:m,handleArrowNavigation:D}=h(),O=(0,c.ref)(null),k=(0,c.ref)(null),A=(0,c.ref)(null),j=[`Recently used`,`People`,`Nature`,`Food`,`Activity`,`Travel`,`Objects`,`Symbols`,`Flags`,`Custom`],M=(0,c.computed)(()=>{let e=r.tabsetLabels.map(e=>({label:e,ref:(0,c.ref)(null)}));return r.recentlyUsedEmojis&&!r.recentlyUsedEmojis.length&&(e=r.tabsetLabels.slice(1).map(e=>({label:e,ref:(0,c.ref)(null)}))),r.customEmojis&&!r.customEmojis.length&&e.pop(),e}),N=(0,c.ref)(M.value[0].label),P=(0,c.computed)(()=>{let e=r.recentlyUsedEmojis.length?j.slice():j.slice(1);return r.customEmojis&&!r.customEmojis.length&&e.pop(),e}),F=(0,c.ref)([]),I=(0,c.computed)(()=>[...u.emojisGrouped[`People${r.skinTone}`],...u.emojisGrouped.Nature,...u.emojisGrouped.Food,...u.emojisGrouped[`Activity${r.skinTone}`],...u.emojisGrouped.Travel,...u.emojisGrouped[`Objects${r.skinTone}`],...u.emojisGrouped.Symbols,...u.emojisGrouped.Flags]),L=V(()=>{a.value=[],B()}),R=()=>{let e=k.value;e.scrollTop+e.clientHeight>=e.scrollHeight&&i(`scroll-bottom-reached`)};(0,c.watch)(I,()=>{B()},{immediate:!0}),(0,c.watch)(()=>r.recentlyUsedEmojis,()=>{u.emojisGrouped[`Recently used`]=r.recentlyUsedEmojis},{immediate:!0}),(0,c.watch)(()=>r.customEmojis,()=>{u.emojisGrouped.Custom=r.customEmojis},{immediate:!0}),(0,c.watch)(()=>r.emojiFilter,()=>{G(),r.emojiFilter?o.value=!0:(o.value=!1,Z(null)),L()}),(0,c.watch)(()=>r.selectedTabset,e=>{W(e.tabId)},{deep:!0});function z(e,t=!1){l.value=t,i(`highlighted-emoji`,e)}function B(){let e=r.emojiFilter.toLowerCase();F.value=I.value.filter(t=>{let n=t.name.toLowerCase().includes(e),r=t.keywords.some(t=>t.toLowerCase().includes(e));return n||r}),(0,c.nextTick)(()=>{e&&z(F.value[0],!0)})}function V(e,t=300){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}function H(e){return e.date_added?e.image:s.CDN_URL+e.unicode_character+`.png`}function U(e){e.target.parentNode.style.display=`none`}function W(e,t=!0){let n=M.value[e-1].ref.value[0];(0,c.nextTick)(()=>{let r=k.value;r.scrollTop=e===1?0:n.offsetTop-15,t&&p(e-1,0)})}function G(){let e=k.value;e.scrollTop=0}function K(){k.value.addEventListener(`scroll`,R)}function q(){A.value=new IntersectionObserver(async e=>{e.forEach(e=>{let{target:t}=e,n=parseInt(t.dataset.index);e.isIntersecting&&t.offsetTop<=O.value.offsetTop+50?(N.value=M.value[n-1]?.label??M.value[0]?.label,i(`scroll-into-tab`,n-1)):e.boundingClientRect.bottom<=O.value?.getBoundingClientRect().bottom?(i(`scroll-into-tab`,n),N.value=M.value[n]?.label):n===1&&(i(`scroll-into-tab`,n),N.value=M.value[0]?.label)})}),A.value.observe(O.value),Array.from(k.value.children).forEach((e,t)=>{A.value.observe(e),e.dataset.index=t})}let J=(e,t,n)=>{if(e.preventDefault(),Object.values(s.ARROW_KEYS).includes(e.key)){m(e.key,t);return}switch(e.key){case`Tab`:i(`focus-skin-selector`);break;case`Enter`:X(n,e);break;default:break}},Y=(e,t,n,r)=>{if(e.preventDefault(),Object.values(s.ARROW_KEYS).includes(e.key)){D(e.key,t,n);return}switch(e.key){case`Tab`:e.shiftKey?p(t,0)&&t>0?W(t,!0):(W(1,!1),i(`focus-search-input`)):p(t+1,0)?W(t+1+1,!1):i(`focus-skin-selector`);break;case`Enter`:X(r,e);break;default:break}};function X(e,t){i(`selected-emoji`,{...e,shift_key:t.shiftKey})}function Z(e){i(`highlighted-emoji`,e)}function Q(){p(0,0)}function $(){W(P.value.length,!0)}return(0,c.onMounted)(()=>{q(),K()}),(0,c.onBeforeUnmount)(()=>{A.value.disconnect(),k.value.removeEventListener(`scroll`,R)}),t({focusEmojiSelector:Q,focusLastEmoji:$}),(t,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,g,[(0,c.createElementVNode)(`div`,{id:`d-emoji-picker-list`,ref_key:`listRef`,ref:k,class:`d-emoji-picker__list`},[e.emojiFilter?((0,c.openBlock)(),(0,c.createElementBlock)(`p`,_,(0,c.toDisplayString)(F.value.length>0?e.searchResultsLabel:e.searchNoResultsLabel),1)):((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{key:1,ref_key:`tabCategoryRef`,ref:O,class:`d-emoji-picker__category d-emoji-picker__alignment`},[(0,c.createElementVNode)(`p`,v,(0,c.toDisplayString)(N.value),1)],512)),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(M.value,(t,r)=>(0,c.withDirectives)(((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{key:r,ref_for:!0,ref:t.ref,"data-qa":`dt-emoji-picker-group`,class:`d-emoji-picker__alignment`},[r?((0,c.openBlock)(),(0,c.createElementBlock)(`p`,y,(0,c.toDisplayString)(t.label),1)):(0,c.createCommentVNode)(``,!0),(0,c.createElementVNode)(`div`,b,[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)((0,c.unref)(u.emojisGrouped)[P.value[r]+e.skinTone]?(0,c.unref)(u.emojisGrouped)[P.value[r]+e.skinTone]:(0,c.unref)(u.emojisGrouped)[P.value[r]],(e,t)=>((0,c.openBlock)(),(0,c.createElementBlock)(`button`,{key:e.shortname,ref_for:!0,ref:e=>{e&&(0,c.unref)(d)(e,r,t)},"data-qa":`dt-emoji-picker-emoji`,type:`button`,"aria-label":e.name,onClick:t=>X(e,t),onFocusin:t=>Z(e),onFocusout:n[0]||(n[0]=e=>Z(null)),onMouseover:t=>Z(e),onMouseleave:n[1]||(n[1]=e=>Z(null)),onKeydown:n=>Y(n,r,t,e)},[(0,c.createElementVNode)(`img`,{class:`d-icon d-icon--size-500`,alt:e.name,"aria-label":e.name,title:e.name,src:H(e),onError:U},null,40,S)],40,x))),128))])])),[[c.vShow,!e.emojiFilter]])),128)),e.emojiFilter?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,C,[(0,c.createElementVNode)(`div`,w,[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(F.value,(e,t)=>((0,c.openBlock)(),(0,c.createElementBlock)(`button`,{key:e.shortname,ref_for:!0,ref:e=>{e&&(0,c.unref)(f)(e,t)},"data-qa":`dt-emoji-picker-emoji`,type:`button`,"aria-label":e.name,class:(0,c.normalizeClass)({"hover-emoji":t===0&&(0,c.unref)(l)}),onClick:t=>X(e,t),onFocusin:t=>Z(e),onFocusout:n[2]||(n[2]=e=>Z(null)),onMouseover:t=>z(e),onMouseleave:n[3]||(n[3]=e=>z(null)),onKeydown:n=>J(n,t,e)},[(0,c.createElementVNode)(`img`,{class:`d-icon d-icon--size-500`,alt:e.name,"aria-label":e.name,title:e.name,src:`${(0,c.unref)(s.CDN_URL)+e.unicode_character}.png`},null,8,E)],42,T))),128))])])):(0,c.createCommentVNode)(``,!0)],512)]))}},O={"data-qa":`skin-selector`},k={class:`d-emoji-picker__skin-list`,"data-qa":`dt-emoji-picker-skin-list`},A=[`onKeydown`,`onClick`],j=[`alt`,`aria-label`,`title`,`src`],M={class:`d-emoji-picker__skin-selected`},N=[`aria-label`],P=[`alt`,`aria-label`,`title`,`src`],F={__name:`EmojiSkinSelector`,props:{skinTone:{type:String,required:!0},isHovering:{type:Boolean,default:!1},skinSelectorButtonTooltipLabel:{type:String,required:!0}},emits:[`skin-tone`,`focus-tabset`,`focus-last-emoji`],setup(e,{expose:t,emit:n}){let i=e,a=n,o=[{name:`:wave_tone1:`,unicode_output:`1f44b-1f3fb`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.LIGHT,skinCode:`_tone1`},{name:`:wave_tone2:`,unicode_output:`1f44b-1f3fc`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.MEDIUM_LIGHT,skinCode:`_tone2`},{name:`:wave_tone3:`,unicode_output:`1f44b-1f3fd`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.MEDIUM,skinCode:`_tone3`},{name:`:wave_tone4:`,unicode_output:`1f44b-1f3fe`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.MEDIUM_DARK,skinCode:`_tone4`},{name:`:wave_tone5:`,unicode_output:`1f44b-1f3ff`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.DARK,skinCode:`_tone5`},{name:`:wave:`,unicode_output:`1f44b`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.DEFAULT,skinCode:``}],l=(0,c.ref)(!1),u=(0,c.ref)(null),d=(0,c.ref)([]);(0,c.watchEffect)(()=>i.isHovering&&(l.value=!1));let f=(0,c.computed)(()=>o.find(e=>e.skinTone===i.skinTone)),p=(0,c.ref)(f.value);(0,c.watchEffect)(()=>f.value&&(p.value=f.value));function m(e){d.value.push(e)}function h(){u.value.focus()}function g(e){p.value=e,l.value=!1,a(`skin-tone`,e.skinTone),(0,c.nextTick)(()=>h())}let _=(e,t,n)=>{e.preventDefault(),e.key===`ArrowLeft`&&(n===0&&d.value[d.value.length-1]?.focus(),d.value[n-1]?.focus()),e.key===`ArrowRight`&&d.value[n+1]?.focus(),e.key===`Enter`&&(t?g(t):v()),e.key===`Tab`&&(e.shiftKey?a(`focus-last-emoji`):a(`focus-tabset`))};function v(){l.value=!l.value,(0,c.nextTick)(()=>d.value[0].focus())}return t({focusSkinSelector:h}),(t,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,O,[(0,c.withDirectives)((0,c.createElementVNode)(`div`,k,[((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(o,(e,t)=>(0,c.createElementVNode)(`button`,{ref_for:!0,ref:e=>{e&&m(e)},key:e.name,"data-qa":`dt-emoji-picker-skin-option`,class:(0,c.normalizeClass)({selected:p.value.skinCode===e.skinCode}),onKeydown:n=>_(n,e,t),onClick:t=>g(e)},[(0,c.createElementVNode)(`img`,{class:`d-icon d-icon--size-500`,alt:e.name,"aria-label":e.name,title:e.name,src:`${(0,c.unref)(s.CDN_URL)+e.unicode_output}.png`},null,8,j)],42,A)),64))],512),[[c.vShow,l.value]]),(0,c.withDirectives)((0,c.createElementVNode)(`div`,M,[(0,c.createVNode)((0,c.unref)(r.default),{placement:`top-end`},{anchor:(0,c.withCtx)(()=>[(0,c.createElementVNode)(`button`,{ref_key:`skinSelectorRef`,ref:u,"data-qa":`dt-emoji-picker-skin-toggle`,"aria-label":e.skinSelectorButtonTooltipLabel,tabindex:`-1`,onClick:v,onKeydown:n[0]||(n[0]=e=>_(e))},[(0,c.createElementVNode)(`img`,{class:`d-icon d-icon--size-500`,alt:p.value.name,"aria-label":p.value.name,title:p.value.name,src:`${(0,c.unref)(s.CDN_URL)+p.value.unicode_output}.png`,"data-qa":`dt-emoji-picker-skin-image`},null,8,P)],40,N)]),default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)(e.skinSelectorButtonTooltipLabel)+` `,1)]),_:1})],512),[[c.vShow,!l.value]])]))}},I={class:`d-emoji-picker__data`,"data-qa":`dt-emoji-picker-description`},L=[`alt`,`aria-label`,`title`,`src`],R={__name:`EmojiDescription`,props:{emoji:{type:Object,default:null}},setup(e){function t(e){return e.date_added?e.image:`${s.CDN_URL+e.unicode_character}.png`}return(n,r)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,I,[e.emoji?((0,c.openBlock)(),(0,c.createElementBlock)(`img`,{key:0,class:`d-icon d-icon--size-500`,alt:e.emoji.name,"aria-label":e.emoji.name,title:e.emoji.name,src:t(e.emoji)},null,8,L)):(0,c.createCommentVNode)(``,!0),(0,c.createElementVNode)(`div`,null,(0,c.toDisplayString)(e.emoji?.name),1)]))}},z={class:`d-emoji-picker`,"data-qa":`dt-emoji-picker`},B={class:`d-emoji-picker--header`,"data-qa":`dt-emoji-picker-header`},V={class:`d-emoji-picker--body`,"data-qa":`dt-emoji-picker-body`},H={class:`d-emoji-picker--footer`,"data-qa":`dt-emoji-picker-footer`},U=Object.assign({name:`DtEmojiPicker`},{__name:`EmojiPicker`,props:{recentlyUsedEmojis:{type:Array,default:()=>[]},customEmojis:{type:Array},skinTone:{type:String,default:`Default`},searchQuery:{type:String,default:``},showSearch:{type:Boolean,default:!0},showAddEmojiButton:{type:Boolean,default:!1}},emits:[`selected-emoji`,`scroll-bottom-reached`,`skin-tone`,`close`,`add-emoji`],setup(e,{emit:r}){let i=e,a=r,o=(0,c.ref)(i.searchQuery.value),s=(0,c.ref)(null),l=(0,c.ref)({}),u=(0,c.ref)(0),d=(0,c.computed)(()=>i.recentlyUsedEmojis?.length>0),p=(0,c.computed)(()=>i.customEmojis?.length>0),h=new t.DialtoneLocalization,g=[h.$t(`DIALTONE_EMOJI_PICKER_TABSET_RECENTLY_USED_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_SMILEYS_AND_PEOPLE_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_NATURE_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_FOOD_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_ACTIVITY_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_TRAVEL_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_OBJECTS_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_SYMBOLS_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_FLAGS_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_CUSTOM_LABEL`)],_=h.$t(`DIALTONE_EMOJI_PICKER_SEARCH_PLACEHOLDER_LABEL`),v=h.$t(`DIALTONE_EMOJI_PICKER_SEARCH_RESULTS_LABEL`),y=h.$t(`DIALTONE_EMOJI_PICKER_SEARCH_NO_RESULTS_LABEL`),b=h.$t(`DIALTONE_EMOJI_PICKER_SKIN_SELECTOR_BUTTON_TOOLTIP_LABEL`),x=h.$t(`DIALTONE_EMOJI_PICKER_ADD_EMOJI_LABEL`);(0,c.watch)(()=>i.searchQuery,e=>{o.value=e});function S(e){o.value=``,l.value={...l.value,tabId:e}}function C(e){u.value=e}function w(e){s.value=e}return(t,r)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,z,[(0,c.createElementVNode)(`div`,B,[(0,c.createVNode)(m,{ref:`tabsetRef`,"emoji-filter":o.value,"show-custom-emojis-tab":p.value,"show-recently-used-tab":d.value,"scroll-into-tab":u.value,"tab-set-labels":g,onFocusSkinSelector:r[0]||(r[0]=e=>t.$refs.skinSelectorRef.focusSkinSelector()),onFocusSearchInput:r[1]||(r[1]=n=>e.showSearch?t.$refs.searchInputRef.focusSearchInput():t.$refs.emojiSelectorRef.focusEmojiSelector()),onSelectedTabset:S,onKeydown:r[2]||(r[2]=(0,c.withKeys)(e=>a(`close`),[`esc`]))},null,8,[`emoji-filter`,`show-custom-emojis-tab`,`show-recently-used-tab`,`scroll-into-tab`])]),(0,c.createElementVNode)(`div`,V,[e.showSearch?((0,c.openBlock)(),(0,c.createBlock)(f,{key:0,ref:`searchInputRef`,modelValue:o.value,"onUpdate:modelValue":r[3]||(r[3]=e=>o.value=e),"search-placeholder-label":(0,c.unref)(_),onSelectFirstEmoji:r[4]||(r[4]=e=>a(`selected-emoji`,s.value)),onFocusTabset:r[5]||(r[5]=e=>t.$refs.tabsetRef.focusTabset()),onFocusEmojiSelector:r[6]||(r[6]=e=>t.$refs.emojiSelectorRef.focusEmojiSelector()),onKeydown:r[7]||(r[7]=(0,c.withKeys)(e=>a(`close`),[`esc`]))},null,8,[`modelValue`,`search-placeholder-label`])):(0,c.createCommentVNode)(``,!0),(0,c.createVNode)(D,{ref:`emojiSelectorRef`,"emoji-filter":o.value,"skin-tone":e.skinTone,"tabset-labels":g,"search-results-label":(0,c.unref)(v),"search-no-results-label":(0,c.unref)(y),"recently-used-emojis":e.recentlyUsedEmojis,"custom-emojis":e.customEmojis,"selected-tabset":l.value,onScrollIntoTab:C,onHighlightedEmoji:w,onSelectedEmoji:r[8]||(r[8]=e=>a(`selected-emoji`,e)),onFocusSkinSelector:r[9]||(r[9]=e=>t.$refs.skinSelectorRef.focusSkinSelector()),onFocusSearchInput:r[10]||(r[10]=n=>e.showSearch?t.$refs.searchInputRef.focusSearchInput():t.$refs.tabsetRef.focusTabset()),onKeydown:r[11]||(r[11]=(0,c.withKeys)(e=>a(`close`),[`esc`])),onScrollBottomReached:r[12]||(r[12]=e=>a(`scroll-bottom-reached`))},null,8,[`emoji-filter`,`skin-tone`,`search-results-label`,`search-no-results-label`,`recently-used-emojis`,`custom-emojis`,`selected-tabset`])]),(0,c.createElementVNode)(`div`,H,[e.showAddEmojiButton&&!s.value?((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(n.default),{key:0,importance:`outlined`,"aria-label":(0,c.unref)(x),class:`d-emoji-picker__add-emoji`,onClick:r[13]||(r[13]=e=>a(`add-emoji`))},{default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)((0,c.unref)(x)),1)]),_:1},8,[`aria-label`])):(0,c.createCommentVNode)(``,!0),(0,c.createVNode)(R,{emoji:s.value},null,8,[`emoji`]),(0,c.createVNode)(F,{ref:`skinSelectorRef`,"is-hovering":!!s.value,"skin-selector-button-tooltip-label":(0,c.unref)(b),"skin-tone":e.skinTone,onSkinTone:r[14]||(r[14]=e=>a(`skin-tone`,e)),onFocusTabset:r[15]||(r[15]=e=>t.$refs.tabsetRef.focusTabset()),onFocusLastEmoji:r[16]||(r[16]=e=>t.$refs.emojiSelectorRef.focusLastEmoji()),onKeydown:r[17]||(r[17]=(0,c.withKeys)(e=>a(`close`),[`esc`]))},null,8,[`is-hovering`,`skin-selector-button-tooltip-label`,`skin-tone`])])]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return U}});
|
|
2
|
-
//# sourceMappingURL=EmojiPicker-CXFd-iVj.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/constants/index.cjs`),t=require(`./common/validators/index.cjs`),n=require(`./common/utils/index.cjs`),r=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`),i=require(`./mode_constants-CzYJW9ua.cjs`),a=require(`./lib/text/text.cjs`),o=require(`./localization/index.cjs`),s=require(`./lib/button/button-constants.cjs`),c=require(`./lib/button/button.cjs`),l=require(`./lib/checkbox/checkbox.cjs`),u=require(`./lib/checkbox-group/checkbox-group.cjs`),d=require(`./lib/list-item/list-item.cjs`),f=require(`./lib/stack/stack.cjs`),p=require(`./lib/popover/popover-constants.cjs`),m=require(`./lib/popover/popover.cjs`),h=require(`./lib/dropdown/dropdown.cjs`),g=require(`./lib/filter-pill/filter-pill-constants.cjs`),_=require(`./lib/filter-pill/filter-pill-controlled.cjs`),v=require(`./lib/list-item-group/list-item-group.cjs`);let y=require(`vue`),b=require(`@dialpad/dialtone-icons/vue`);var x={key:0,role:`none`,class:`d-filter-pill__menu-group`},S=(0,y.defineComponent)({name:`DtFilterPillOptionGroup`,__name:`FilterPillOptionGroup`,props:{heading:{type:String,default:null}},setup(e){return(t,n)=>e.heading?((0,y.openBlock)(),(0,y.createElementBlock)(`li`,x,[(0,y.createVNode)((0,y.unref)(v.default),{heading:e.heading,"heading-class":`d-filter-pill__menu-heading`},{heading:(0,y.withCtx)(()=>[(0,y.createVNode)((0,y.unref)(a.default),{variant:`label-xs`,size:100,strength:`medium`,tone:`tertiary`,density:500},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(e.heading),1)]),_:1})]),default:(0,y.withCtx)(()=>[(0,y.renderSlot)(t.$slots,`default`)]),_:3},8,[`heading`])])):(0,y.renderSlot)(t.$slots,`default`,{key:1})}}),C={name:`DtFilterPill`,components:{DtCheckboxGroup:u.default,DtCheckbox:l.default,DtPopover:m.default,DtButton:c.default,DtIconClose:b.DtIconClose,DtIconCheck:b.DtIconCheck,DtIconChevronDown:b.DtIconChevronDown,DtDropdown:h.default,DtFilterPillOptionGroup:S,DtListItem:d.default,DtStack:f.default,DtText:a.default},mixins:[_.default],props:{options:{type:Array,default:void 0},selected:{type:[String,Array],default:void 0},neutralValue:{type:String,default:void 0},open:{type:[Boolean,null],default:null},anchorEndClass:{type:[String,Array,Object],default:``},optionEndClass:{type:[String,Array,Object],default:``},headerContentClass:{type:[String,Array,Object],default:``},useDropdown:{type:Boolean,default:!1},deferSelection:{type:Boolean,default:!1},modelValue:{type:Array,default:()=>[]},startTooltipText:{type:String,default:``},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},showClear:{type:Boolean,default:!0},label:{type:String,default:void 0},endTooltipText:{type:String,default:``},popoverAppendTo:{type:[e.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>p.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},popoverFallbackPlacements:{type:Array,default:()=>[`auto`]},popoverMaxHeight:{type:String,default:``},overlayMinInlineSize:{type:String,default:`anchor`,validator:t.ordinalSizeValidator(g.FILTER_PILL_OVERLAY_MIN_INLINE_SIZE_VALUES)},popoverMaxWidth:{type:String,default:``},popoverPadding:{type:String,default:void 0,validator:e=>Object.keys(p.POPOVER_PADDING_CLASSES).some(t=>t===e)},popoverPlacement:{type:String,default:`bottom-start`},labelClass:{type:[String,Array,Object],default:``},popoverContentClass:{type:[String,Array,Object],default:``},popoverHeaderClass:{type:[String,Array,Object],default:``},popoverFooterClass:{type:[String,Array,Object],default:``},popoverDialogClass:{type:[String,Array,Object],default:``},dropdownListClass:{type:[String,Array,Object],default:``},contentMode:i.t,size:{type:[String,Number],default:200,validator:t.ordinalSizeValidator(s.BUTTON_SIZE_MODIFIERS)}},emits:[`update:selected`,`selection-change`,`update:open`,`opened`,`clear`,`open`,`update:modelValue`,`apply`],data(){return{isOpen:!1,i18n:new o.DialtoneLocalization,filters:Array.isArray(this.options)?[]:this.modelValue,pendingFilters:null,overlayResizeObserver:null}},computed:{overlayUseDropdown(){return this.controlledAtBirth?this.controlledDropdown:this.useDropdown},overlayComponent(){return this.overlayUseDropdown?`dt-dropdown`:`dt-popover`},overlayProps(){let e={"append-to":this.popoverAppendTo,"fallback-placements":this.popoverFallbackPlacements,"max-height":this.popoverMaxHeight,"max-width":this.popoverMaxWidth,modal:!0,placement:this.popoverPlacement};if(this.controlledAtBirth&&(e.visibilityChangeCallback=this.onControlledVisibility,e.forwardAnchorArrowKeys=!0),this.overlayUseDropdown)e[`list-class`]=this.dropdownListClass;else{let t=this.popoverPadding===void 0;e.padding=t?`none`:this.popoverPadding,e[`content-class`]=t?[`d-filter-pill__popover-content`,this.popoverContentClass]:this.popoverContentClass,e[`header-wrapper-class`]=t?[p.POPOVER_HEADER_FOOTER_PADDING_CLASSES.large,this.popoverHeaderClass]:this.popoverHeaderClass,e[`header-class`]=this.headerContentClass,e[`footer-wrapper-class`]=t?[p.POPOVER_HEADER_FOOTER_PADDING_CLASSES.large,this.popoverFooterClass]:this.popoverFooterClass,e[`dialog-class`]=this.popoverDialogClass}return e},buttonKind(){return this.isActive&&!this.disabled?`default`:`muted`},resolvedStartTooltipText(){return this.readOnly?this.startTooltipText||this.i18n.$t(`DIALTONE_FILTER_PILL_READ_ONLY_TOOLTIP`):this.startTooltipText},clearButtonAriaLabel(){return this.endTooltipText||this.i18n.$t(`DIALTONE_FILTER_PILL_CLEAR_BUTTON_LABEL`)},clearButtonTitle(){if(!this.endTooltipText)return this.clearButtonAriaLabel},activeFilters(){return this.filters.filter(e=>e.active).map(e=>e.name)},allFiltersActive(){return this.filters.length>1&&this.activeFilters.length===this.filters.length},activeFilterList(){return this.allFiltersActive?`All`:this.activeFilters[0]??``},activeFilterLabel(){return this.allFiltersActive?this.i18n.$t(`DIALTONE_FILTER_PILL_ALL_LABEL`):this.activeFilterList},activeFilterOverflowTitle(){let e=this.controlledAtBirth?this.controlledState.values.length-1:this.activeFilters.length-1;return this.i18n.$t(`DIALTONE_FILTER_PILL_OVERFLOW_TITLE`,{count:e})},activeFilterOverflow(){return this.activeFilters.length<=1||this.allFiltersActive?``:`+`+(this.activeFilters.length-1)},isActive(){return this.controlledAtBirth?this.controlledState.valid&&this.controlledState.isActive:this.activeFilterList.length>0},hasClear(){return this.controlledAtBirth?!this.readOnly&&this.showClear&&this.controlledContractValid&&this.controlledState.valid&&this.isActive:!this.readOnly&&this.showClear&&this.activeFilterList.length>0},displayFilters(){return this.deferSelection&&this.pendingFilters?this.pendingFilters:this.filters},pendingActiveFilters(){return this.pendingFilters?this.pendingFilters.filter(e=>e.active).map(e=>e.name):[]},cancelButtonLabel(){return this.i18n.$t(`DIALTONE_FILTER_PILL_CANCEL_BUTTON_LABEL`)},applyButtonLabel(){return this.i18n.$t(`DIALTONE_FILTER_PILL_APPLY_BUTTON_LABEL`)},clearIconSize(){return String(this.size)===`100`?`100`:s.BUTTON_ICON_SIZES[String(this.size)]}},watch:{overlayMinInlineSize:{handler:`observeOverlayAnchor`,flush:`post`},overlayUseDropdown:{handler:`observeOverlayAnchor`,flush:`post`},hasClear:{handler:`observeOverlayAnchor`,flush:`post`},popoverMaxWidth:{handler:`syncOverlayMinInlineSize`,flush:`post`},isOpen:[{handler:`syncOverlayMinInlineSize`,flush:`post`},function(e){this.controlledAtBirth||(this.$emit(`open`,e),this.deferSelection&&(e?this.pendingFilters=JSON.parse(JSON.stringify(this.filters)):this.pendingFilters=null))}],filters:{deep:!0,handler(e){this.controlledAtBirth||this.$emit(`update:modelValue`,e)}}},mounted(){this.observeOverlayAnchor(),!this.controlledAtBirth&&!(this.modelValue?.length||this.$slots.content)&&console.warn(`Please provide content through the v-model or the "content" slot.`),this.deferSelection&&this.useDropdown&&console.warn(`deferSelection has no effect when useDropdown is true.`)},beforeUnmount(){this.overlayResizeObserver?.disconnect()},methods:{hasSlotContent:n.hasSlotContent,observeOverlayAnchor(){this.overlayResizeObserver?.disconnect(),this.overlayResizeObserver=null,this.overlayMinInlineSize===`anchor`&&typeof ResizeObserver<`u`&&(this.overlayResizeObserver=new ResizeObserver(()=>this.syncOverlayMinInlineSize()),[this.$el,...this.getAnchorControls()].forEach(e=>this.overlayResizeObserver.observe(e))),this.syncOverlayMinInlineSize()},getAnchorControls(){return[this.$el.querySelector(`[data-qa="dt-filter-pill__button"]`),this.$refs.clearButton?.$el].filter(Boolean)},measureAnchorInlineSize(){let e=this.getAnchorControls();if(!e.length)return 0;let[t,n]=/^(vertical|sideways)/.test(getComputedStyle(this.$el).writingMode)?[`top`,`bottom`]:[`left`,`right`],r=e.map(e=>e.getBoundingClientRect());return Math.max(...r.map(e=>e[n]))-Math.min(...r.map(e=>e[t]))},resolveOverlayMinInlineSize(){let e=String(this.overlayMinInlineSize??`0`);return e=e===`anchor`?`${this.measureAnchorInlineSize()}px`:e===`0`?`0px`:`var(--dt-layout-${e})`,e&&this.popoverMaxWidth&&this.popoverMaxWidth!==`none`?`min(${e}, ${this.popoverMaxWidth})`:e},syncOverlayMinInlineSize(){let e=this.$refs.overlay;if(!e)return;let t=this.overlayUseDropdown?e.$refs.popover:e,n=t?.popoverContentEl;if(!n)return;let r=this.resolveOverlayMinInlineSize();n.style.minInlineSize!==r&&(n.style.minInlineSize=r,t.tip?.popperInstance?.update())},clearFilter(e){if(this.controlledAtBirth){let t=this.controlledDropdown?this.neutralValue??null:[];this.controlledDraft=null,this.commitControlled(t,`clear`,!0,e),this.reconcileCheckboxes();return}this.filters.forEach(e=>delete e.active),this.$emit(`clear`,e)},openPopover(){if(this.controlledAtBirth){this.requestControlledOpen(!0);return}this.readOnly||(this.isOpen=!0)},selectFilter(e,t){this.filters.forEach(t=>{t.active=t===e}),t()},applySelection(){if(this.controlledAtBirth)return this.applyControlledSelection();this.pendingFilters&&(this.filters.forEach((e,t)=>{this.pendingFilters[t]?e.active=this.pendingFilters[t].active:delete e.active}),this.$emit(`apply`),this.isOpen=!1)},cancelSelection(){if(this.controlledAtBirth){this.closeControlled();return}this.isOpen=!1}}},w={class:`sr-only`,"data-qa":`dt-filter-pill__accessible-label`},T={key:0,class:`d-filter-pill__label-start`,"data-qa":`dt-filter-pill__label-start`,"aria-hidden":`true`},E=[`title`],D=[`title`,`textContent`],O=[`title`,`textContent`],k=[`title`,`textContent`],A=[`id`];function j(e,t,n,r,i,a){let o=(0,y.resolveComponent)(`dt-icon-chevron-down`),s=(0,y.resolveComponent)(`dt-button`),c=(0,y.resolveComponent)(`dt-checkbox`),l=(0,y.resolveComponent)(`dt-checkbox-group`),u=(0,y.resolveComponent)(`dt-stack`),d=(0,y.resolveComponent)(`dt-text`),f=(0,y.resolveComponent)(`dt-icon-check`),p=(0,y.resolveComponent)(`dt-list-item`),m=(0,y.resolveComponent)(`dt-filter-pill-option-group`),h=(0,y.resolveComponent)(`dt-icon-close`),g=(0,y.resolveDirective)(`dt-tooltip`);return(0,y.openBlock)(),(0,y.createElementBlock)(`div`,(0,y.mergeProps)({class:[`d-filter-pill`,{"d-filter-pill--read-only":n.readOnly}]},e.legacyRootAttrs(),{"data-qa":`dt-filter-pill`}),[((0,y.openBlock)(),(0,y.createBlock)((0,y.resolveDynamicComponent)(a.overlayComponent),(0,y.mergeProps)({ref:`overlay`,open:i.isOpen},a.overlayProps,{"aria-label":e.controlledAtBirth&&!e.$slots.content?n.label:void 0,"content-mode":n.contentMode,"onUpdate:open":e.onOverlayTerminalOpen,onOpened:e.onOverlayOpened,onKeydown:e.onOverlayKeydown}),(0,y.createSlots)({anchor:(0,y.withCtx)(t=>[(0,y.withDirectives)(((0,y.openBlock)(),(0,y.createBlock)(s,(0,y.mergeProps)({ref:`primaryButton`},e.anchorAttributes(t),{active:a.isActive,"aria-disabled":n.readOnly||void 0,class:[`d-filter-pill__primary`,{"d-filter-pill--selected":a.isActive}],disabled:n.disabled,kind:a.buttonKind,size:n.size,"data-qa":`dt-filter-pill__button`,importance:`outlined`,onClick:a.openPopover,onKeydown:(0,y.withKeys)((0,y.withModifiers)(e.onAnchorArrow,[`prevent`]),[`up`,`down`])}),(0,y.createSlots)({default:(0,y.withCtx)(()=>[(0,y.createElementVNode)(`span`,{class:(0,y.normalizeClass)([`d-filter-pill__label`,n.labelClass]),"data-qa":`dt-filter-pill__label`},[e.controlledAtBirth?(0,y.renderSlot)(e.$slots,`default`,(0,y.normalizeProps)((0,y.mergeProps)({key:0},e.controlledAnchorBindings)),()=>[(0,y.createElementVNode)(`span`,w,(0,y.toDisplayString)(e.controlledAccessibleLabel),1),e.controlledDropdown||!a.isActive||n.label?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,T,(0,y.toDisplayString)(e.controlledDropdown||!a.isActive?e.controlledDisplayLabel:n.label),1)):(0,y.createCommentVNode)(``,!0),!e.controlledDropdown&&a.isActive?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:1,class:(0,y.normalizeClass)([`d-filter-pill__label-end`,{"d-filter-pill__label-end--standalone":!n.label}]),"data-qa":`dt-filter-pill__label-end`,"aria-hidden":`true`},(0,y.toDisplayString)(e.controlledDisplayLabel),3)):(0,y.createCommentVNode)(``,!0),e.controlledOverflow?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:2,class:`d-filter-pill__label-end-overflow`,"data-qa":`dt-filter-pill__overflow`,title:a.activeFilterOverflowTitle},(0,y.toDisplayString)(e.controlledOverflow),9,E)):(0,y.createCommentVNode)(``,!0),a.hasSlotContent(e.$slots.anchorEnd,e.controlledAnchorBindings)?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:3,class:(0,y.normalizeClass)([`d-filter-pill__anchor-end`,n.anchorEndClass]),"data-qa":`dt-filter-pill__anchor-end`},[(0,y.renderSlot)(e.$slots,`anchorEnd`,(0,y.normalizeProps)((0,y.guardReactiveProps)(e.controlledAnchorBindings)))],2)):(0,y.createCommentVNode)(``,!0)]):(0,y.renderSlot)(e.$slots,`default`,{key:1,label:n.label,filters:i.filters,activeFilters:a.activeFilters,activeFilterList:a.activeFilterList,activeFilterOverflow:a.activeFilterOverflow},()=>[(0,y.createElementVNode)(`span`,{class:`d-filter-pill__label-start`,title:n.label,textContent:(0,y.toDisplayString)(n.label)},null,8,D),a.activeFilterList?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:0,class:`d-filter-pill__label-end`,title:a.activeFilterLabel,textContent:(0,y.toDisplayString)(a.activeFilterLabel)},null,8,O)):(0,y.createCommentVNode)(``,!0),a.activeFilterOverflow?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:1,class:`d-filter-pill__label-end-overflow`,title:a.activeFilterOverflowTitle,textContent:(0,y.toDisplayString)(a.activeFilterOverflow)},null,8,k)):(0,y.createCommentVNode)(``,!0)])],2)]),_:2},[e.$slots.startIcon?{name:`startIcon`,fn:(0,y.withCtx)(({iconSize:t})=>[(0,y.renderSlot)(e.$slots,`startIcon`,{iconSize:t})]),key:`0`}:void 0,n.readOnly?void 0:{name:`endIcon`,fn:(0,y.withCtx)(({iconSize:e})=>[(0,y.createVNode)(o,{size:e,class:`d-filter-pill__icon`,"data-qa":`dt-filter-pill__icon`},null,8,[`size`])]),key:`1`}]),1040,[`active`,`aria-disabled`,`class`,`disabled`,`kind`,`size`,`onClick`,`onKeydown`])),[[g,a.resolvedStartTooltipText]])]),_:2},[a.overlayUseDropdown?void 0:{name:`content`,fn:(0,y.withCtx)(({close:t})=>[e.controlledAtBirth?(0,y.renderSlot)(e.$slots,`content`,(0,y.normalizeProps)((0,y.mergeProps)({key:0},e.controlledContentBindings)),()=>[(0,y.createVNode)(l,{"model-value":e.checkboxRenderValues,"aria-label":n.label,name:n.label||`filter-pill`,disabled:!e.controlledCanSelect},{default:(0,y.withCtx)(()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(e.controlledState.options,t=>((0,y.openBlock)(),(0,y.createBlock)(c,{id:e.controlledOptionId(t.value),key:t.value,label:t.label,value:t.value,"data-qa":`dt-filter-pill__checkbox`,"onUpdate:modelValue":n=>e.toggleControlledOption(t.value,n)},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(t.label)+` `,1),e.$slots.optionEnd?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:0,class:(0,y.normalizeClass)([`d-filter-pill__option-end`,n.optionEndClass])},[(0,y.renderSlot)(e.$slots,`optionEnd`,{option:t,selected:e.controlledRowSelected(t.value)})],2)):(0,y.createCommentVNode)(``,!0)]),_:2},1032,[`id`,`label`,`value`,`onUpdate:modelValue`]))),128))]),_:3},8,[`model-value`,`aria-label`,`name`,`disabled`])]):(0,y.renderSlot)(e.$slots,`content`,{key:1,close:t,apply:a.applySelection,cancel:a.cancelSelection,pendingFilters:i.pendingFilters},()=>[n.modelValue?.length?((0,y.openBlock)(),(0,y.createBlock)(l,{key:0,"model-value":n.deferSelection?a.pendingActiveFilters:a.activeFilters,"aria-label":n.label,name:n.label||`filter-pill`},{default:(0,y.withCtx)(()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(a.displayFilters,e=>((0,y.openBlock)(),(0,y.createBlock)(c,{key:e.name,label:e.name,value:e.name,"onUpdate:modelValue":t=>e.active=t},null,8,[`label`,`value`,`onUpdate:modelValue`]))),128))]),_:1},8,[`model-value`,`aria-label`,`name`])):(0,y.createCommentVNode)(``,!0)])]),key:`0`},!a.overlayUseDropdown&&e.$slots.headerContent?{name:`headerContent`,fn:(0,y.withCtx)(({close:t})=>[(0,y.renderSlot)(e.$slots,`headerContent`,{close:e.controlledAtBirth?e.closeControlled:t})]),key:`1`}:void 0,!a.overlayUseDropdown&&(n.deferSelection||e.$slots.footerContent)?{name:`footerContent`,fn:(0,y.withCtx)(({close:t})=>[(0,y.renderSlot)(e.$slots,`footerContent`,{close:e.controlledAtBirth?e.closeControlled:t,apply:a.applySelection,cancel:a.cancelSelection},()=>[n.deferSelection?((0,y.openBlock)(),(0,y.createBlock)(u,{key:0,direction:`row`,gap:`400`,justify:`end`,"data-qa":`dt-filter-pill__deferred-footer`},{default:(0,y.withCtx)(()=>[(0,y.createVNode)(s,{importance:`clear`,kind:`muted`,size:200,"data-qa":`dt-filter-pill__cancel-button`,onClick:a.cancelSelection},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(a.cancelButtonLabel),1)]),_:1},8,[`onClick`]),(0,y.createVNode)(s,{importance:`primary`,size:200,"data-qa":`dt-filter-pill__apply-button`,onClick:a.applySelection},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(a.applyButtonLabel),1)]),_:1},8,[`onClick`])]),_:1})):(0,y.createCommentVNode)(``,!0)])]),key:`2`}:void 0,a.overlayUseDropdown?{name:`list`,fn:(0,y.withCtx)(({close:t})=>[e.controlledAtBirth?(0,y.renderSlot)(e.$slots,`content`,(0,y.normalizeProps)((0,y.mergeProps)({key:0},e.controlledContentBindings)),()=>[e.$slots.headerContent?((0,y.openBlock)(),(0,y.createElementBlock)(`li`,{key:0,role:`presentation`,class:(0,y.normalizeClass)([`d-filter-pill__menu-heading`,n.headerContentClass])},[(0,y.createVNode)(d,{variant:`label-xs`,size:100,strength:`medium`,tone:`tertiary`,density:500},{default:(0,y.withCtx)(()=>[(0,y.renderSlot)(e.$slots,`headerContent`)]),_:3})],2)):(0,y.createCommentVNode)(``,!0),((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(e.controlledState.sections,(t,r)=>((0,y.openBlock)(),(0,y.createBlock)(m,{key:r,heading:t.group},{default:(0,y.withCtx)(()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(t.rows,t=>((0,y.openBlock)(),(0,y.createBlock)(p,{id:e.controlledOptionId(t.option.value),key:t.option.value,role:`menuitemradio`,"data-qa":`dt-filter-pill__option`,"navigation-type":`arrow-keys`,selected:e.controlledRowSelected(t.option.value),disabled:!e.controlledCanSelect||t.disabled,"aria-describedby":t.description?e.controlledDescriptionId(t.option.value):void 0,onClick:n=>e.selectControlledOption(t.option.value)},(0,y.createSlots)({selected:(0,y.withCtx)(()=>[(0,y.createVNode)(f,{size:`200`,class:(0,y.normalizeClass)({"d-filter-pill__selection-indicator--hidden":!e.controlledRowSelected(t.option.value)}),"aria-hidden":`true`,"data-qa":`dt-filter-pill__selection-indicator`},null,8,[`class`])]),default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(t.option.label)+` `,1)]),_:2},[t.description?{name:`subtitle`,fn:(0,y.withCtx)(()=>[(0,y.createElementVNode)(`span`,{id:e.controlledDescriptionId(t.option.value),"aria-hidden":`true`,"data-qa":`dt-filter-pill__option-description`},(0,y.toDisplayString)(t.description),9,A)]),key:`0`}:void 0,e.$slots.optionEnd?{name:`end`,fn:(0,y.withCtx)(()=>[(0,y.createElementVNode)(`span`,{class:(0,y.normalizeClass)([`d-filter-pill__option-end`,n.optionEndClass])},[(0,y.renderSlot)(e.$slots,`optionEnd`,{option:t.option,selected:e.controlledRowSelected(t.option.value)})],2)]),key:`1`}:void 0]),1032,[`id`,`selected`,`disabled`,`aria-describedby`,`onClick`]))),128))]),_:2},1032,[`heading`]))),128))]):(0,y.renderSlot)(e.$slots,`content`,{key:1,close:t},()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(i.filters,e=>((0,y.openBlock)(),(0,y.createBlock)(p,{key:e.name,role:`menuitem`,"navigation-type":`arrow-keys`,selected:e.active,onClick:n=>a.selectFilter(e,t)},{selected:(0,y.withCtx)(()=>[(0,y.createVNode)(f,{size:`200`,class:(0,y.normalizeClass)({"d-filter-pill__selection-indicator--hidden":!e.active}),"aria-hidden":`true`,"data-qa":`dt-filter-pill__selection-indicator`},null,8,[`class`])]),default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(e.name)+` `,1)]),_:2},1032,[`selected`,`onClick`]))),128))])]),key:`3`}:void 0]),1040,[`open`,`aria-label`,`content-mode`,`onUpdate:open`,`onOpened`,`onKeydown`])),a.hasClear?(0,y.withDirectives)(((0,y.openBlock)(),(0,y.createBlock)(s,{key:0,ref:`clearButton`,active:a.isActive,"aria-label":a.clearButtonAriaLabel,class:(0,y.normalizeClass)([`d-filter-pill__clear`,{"d-filter-pill__clear--selected":a.isActive}]),disabled:n.disabled,kind:a.buttonKind,size:n.size,title:a.clearButtonTitle,"data-qa":`dt-filter-pill__clear-button`,importance:`outlined`,onClick:a.clearFilter},{icon:(0,y.withCtx)(()=>[(0,y.createVNode)(h,{size:a.clearIconSize},null,8,[`size`])]),_:1},8,[`active`,`aria-label`,`class`,`disabled`,`kind`,`size`,`title`,`onClick`])),[[g,n.endTooltipText]]):(0,y.createCommentVNode)(``,!0)],16)}var M=r.t(C,[[`render`,j]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return M}});
|
|
2
|
-
//# sourceMappingURL=FilterPill-DY9T19XB.cjs.map
|