@dialpad/dialtone 9.130.0 → 9.131.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/css/dialtone-default-theme.css +8 -2
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone-docs.json +1 -1
- package/dist/css/dialtone.css +8 -2
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/doc.json +32694 -32694
- package/dist/vue2/common/constants/index.cjs.map +1 -1
- package/dist/vue2/common/constants/index.js.map +1 -1
- package/dist/vue2/common/dates/index.cjs.map +1 -1
- package/dist/vue2/common/dates/index.js +3 -3
- package/dist/vue2/common/dates/index.js.map +1 -1
- package/dist/vue2/common/emoji/index.cjs.map +1 -1
- package/dist/vue2/common/emoji/index.js.map +1 -1
- package/dist/vue2/common/mixins/dom.cjs.map +1 -1
- package/dist/vue2/common/mixins/dom.js.map +1 -1
- package/dist/vue2/common/mixins/input-group.cjs.map +1 -1
- package/dist/vue2/common/mixins/input-group.js +5 -5
- package/dist/vue2/common/mixins/input-group.js.map +1 -1
- package/dist/vue2/common/mixins/input.cjs.map +1 -1
- package/dist/vue2/common/mixins/input.js.map +1 -1
- package/dist/vue2/common/mixins/keyboard-list-navigation.cjs.map +1 -1
- package/dist/vue2/common/mixins/keyboard-list-navigation.js.map +1 -1
- package/dist/vue2/common/mixins/modal.cjs.map +1 -1
- package/dist/vue2/common/mixins/modal.js.map +1 -1
- package/dist/vue2/common/mixins/skeleton.cjs.map +1 -1
- package/dist/vue2/common/mixins/skeleton.js.map +1 -1
- package/dist/vue2/common/utils/index.cjs.map +1 -1
- package/dist/vue2/common/utils/index.js +0 -1
- package/dist/vue2/common/utils/index.js.map +1 -1
- package/dist/vue2/common/validators/index.cjs.map +1 -1
- package/dist/vue2/common/validators/index.js.map +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs.map +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.js +4 -4
- package/dist/vue2/lib/avatar/avatar-constants.cjs.map +1 -1
- package/dist/vue2/lib/avatar/avatar-constants.js.map +1 -1
- package/dist/vue2/lib/avatar/avatar.cjs.map +1 -1
- package/dist/vue2/lib/avatar/avatar.js +11 -11
- package/dist/vue2/lib/avatar/avatar.js.map +1 -1
- package/dist/vue2/lib/avatar/utils.cjs.map +1 -1
- package/dist/vue2/lib/avatar/utils.js.map +1 -1
- package/dist/vue2/lib/badge/badge.cjs.map +1 -1
- package/dist/vue2/lib/badge/badge.js +7 -7
- package/dist/vue2/lib/badge/badge.js.map +1 -1
- package/dist/vue2/lib/banner/banner.cjs +1 -1
- package/dist/vue2/lib/banner/banner.cjs.map +1 -1
- package/dist/vue2/lib/banner/banner.js +4 -4
- package/dist/vue2/lib/breadcrumbs/breadcrumb-item.cjs.map +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.cjs.map +1 -1
- package/dist/vue2/lib/button/button-constants.cjs.map +1 -1
- package/dist/vue2/lib/button/button-constants.js.map +1 -1
- package/dist/vue2/lib/button/button.cjs +1 -1
- package/dist/vue2/lib/button/button.cjs.map +1 -1
- package/dist/vue2/lib/button/button.js +14 -14
- package/dist/vue2/lib/button/button.js.map +1 -1
- package/dist/vue2/lib/button-group/button-group.cjs.map +1 -1
- package/dist/vue2/lib/button-group/buttons-decorator.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button/callbar-button-constants.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button/callbar-button-constants.js.map +1 -1
- package/dist/vue2/lib/callbar-button/callbar-button.cjs +1 -1
- package/dist/vue2/lib/callbar-button/callbar-button.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button/callbar-button.js +3 -3
- package/dist/vue2/lib/callbar-button/callbar-button.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +6 -6
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js +6 -6
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js.map +1 -1
- package/dist/vue2/lib/callbox/callbox-constants.cjs.map +1 -1
- package/dist/vue2/lib/callbox/callbox-constants.js.map +1 -1
- package/dist/vue2/lib/callbox/callbox.cjs.map +1 -1
- package/dist/vue2/lib/callbox/callbox.js +5 -5
- package/dist/vue2/lib/checkbox/checkbox-constants.cjs.map +1 -1
- package/dist/vue2/lib/checkbox/checkbox-constants.js.map +1 -1
- package/dist/vue2/lib/checkbox/checkbox.cjs.map +1 -1
- package/dist/vue2/lib/checkbox-group/checkbox-group.cjs.map +1 -1
- package/dist/vue2/lib/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/vue2/lib/checkbox-group/checkboxes-decorator.cjs.map +1 -1
- package/dist/vue2/lib/chip/chip-constants.cjs.map +1 -1
- package/dist/vue2/lib/chip/chip-constants.js.map +1 -1
- package/dist/vue2/lib/chip/chip.cjs.map +1 -1
- package/dist/vue2/lib/chip/chip.js +3 -3
- package/dist/vue2/lib/collapsible/collapsible.cjs +1 -1
- package/dist/vue2/lib/collapsible/collapsible.cjs.map +1 -1
- package/dist/vue2/lib/collapsible/collapsible.js +7 -7
- package/dist/vue2/lib/combobox/combobox-constants.cjs.map +1 -1
- package/dist/vue2/lib/combobox/combobox-constants.js.map +1 -1
- package/dist/vue2/lib/combobox/combobox-empty-list.cjs.map +1 -1
- package/dist/vue2/lib/combobox/combobox-loading-list.cjs +1 -1
- package/dist/vue2/lib/combobox/combobox-loading-list.cjs.map +1 -1
- package/dist/vue2/lib/combobox/combobox-loading-list.js +3 -3
- package/dist/vue2/lib/combobox/combobox.cjs +1 -1
- package/dist/vue2/lib/combobox/combobox.cjs.map +1 -1
- package/dist/vue2/lib/combobox/combobox.js +1 -1
- package/dist/vue2/lib/combobox/combobox.js.map +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select-constants.cjs.map +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select-constants.js.map +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select-story-constants.cjs.map +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select-story-constants.js.map +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.js +4 -4
- package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
- package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.js +9 -9
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.cjs +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.cjs.map +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.js +7 -7
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.js.map +1 -1
- package/dist/vue2/lib/contact-info/contact-info.cjs.map +1 -1
- package/dist/vue2/lib/contact-row/contact-row.cjs +1 -1
- package/dist/vue2/lib/contact-row/contact-row.cjs.map +1 -1
- package/dist/vue2/lib/contact-row/contact-row.js +4 -4
- package/dist/vue2/lib/datepicker/datepicker.cjs +1 -1
- package/dist/vue2/lib/datepicker/datepicker.cjs.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker.js +83 -83
- package/dist/vue2/lib/datepicker/datepicker.js.map +1 -1
- package/dist/vue2/lib/datepicker/formatUtils.cjs.map +1 -1
- package/dist/vue2/lib/datepicker/formatUtils.js.map +1 -1
- package/dist/vue2/lib/datepicker/utils.cjs.map +1 -1
- package/dist/vue2/lib/datepicker/utils.js.map +1 -1
- package/dist/vue2/lib/description-list/description-list.cjs.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown-constants.cjs.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown-constants.js.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown-story-constants.cjs.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown-story-constants.js.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown.cjs +1 -1
- package/dist/vue2/lib/dropdown/dropdown.cjs.map +1 -1
- package/dist/vue2/lib/dropdown/dropdown.js +1 -1
- package/dist/vue2/lib/dropdown/dropdown.js.map +1 -1
- package/dist/vue2/lib/editor/editor-constants.cjs.map +1 -1
- package/dist/vue2/lib/editor/editor-constants.js.map +1 -1
- package/dist/vue2/lib/editor/editor.cjs +1 -1
- package/dist/vue2/lib/editor/editor.cjs.map +1 -1
- package/dist/vue2/lib/editor/editor.js +44 -44
- package/dist/vue2/lib/editor/editor.js.map +1 -1
- package/dist/vue2/lib/emoji/emoji.cjs.map +1 -1
- package/dist/vue2/lib/emoji/emoji.js +4 -4
- package/dist/vue2/lib/emoji-picker/emoji-picker-constants.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker-constants.js.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.js +9 -9
- package/dist/vue2/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row-constants.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row-constants.js.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js +5 -5
- package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue2/lib/emoji-text-wrapper/emoji-text-wrapper.cjs +1 -1
- package/dist/vue2/lib/emoji-text-wrapper/emoji-text-wrapper.cjs.map +1 -1
- package/dist/vue2/lib/emoji-text-wrapper/emoji-text-wrapper.js +1 -1
- package/dist/vue2/lib/emoji-text-wrapper/emoji-text-wrapper.js.map +1 -1
- package/dist/vue2/lib/empty-state/empty-state-constants.cjs.map +1 -1
- package/dist/vue2/lib/empty-state/empty-state-constants.js.map +1 -1
- package/dist/vue2/lib/empty-state/empty-state.cjs.map +1 -1
- package/dist/vue2/lib/empty-state/empty-state.js +3 -3
- package/dist/vue2/lib/empty-state/empty-state.js.map +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill-constants.cjs.map +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill-constants.js.map +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.cjs +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.cjs.map +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.js +3 -3
- package/dist/vue2/lib/feed-item-row/feed-item-row-constants.cjs.map +1 -1
- package/dist/vue2/lib/feed-item-row/feed-item-row-constants.js.map +1 -1
- package/dist/vue2/lib/feed-item-row/feed-item-row.cjs +1 -1
- package/dist/vue2/lib/feed-item-row/feed-item-row.cjs.map +1 -1
- package/dist/vue2/lib/feed-item-row/feed-item-row.js +9 -9
- package/dist/vue2/lib/feed-item-row/feed-item-row.js.map +1 -1
- package/dist/vue2/lib/general-row/general-row-constants.cjs.map +1 -1
- package/dist/vue2/lib/general-row/general-row-constants.js.map +1 -1
- package/dist/vue2/lib/general-row/general-row.cjs +1 -1
- package/dist/vue2/lib/general-row/general-row.cjs.map +1 -1
- package/dist/vue2/lib/general-row/general-row.js +14 -14
- package/dist/vue2/lib/general-row/general-row.js.map +1 -1
- package/dist/vue2/lib/general-row/leftbar-general-row-icon.cjs.map +1 -1
- package/dist/vue2/lib/general-row/leftbar-general-row-icon.js +30 -30
- package/dist/vue2/lib/group-row/group-row.cjs.map +1 -1
- package/dist/vue2/lib/grouped-chip/grouped-chip.cjs.map +1 -1
- package/dist/vue2/lib/hovercard/hovercard.cjs +1 -1
- package/dist/vue2/lib/hovercard/hovercard.cjs.map +1 -1
- package/dist/vue2/lib/hovercard/hovercard.js +7 -7
- package/dist/vue2/lib/hovercard/hovercard.js.map +1 -1
- package/dist/vue2/lib/icon/icon-constants.cjs.map +1 -1
- package/dist/vue2/lib/icon/icon-constants.js.map +1 -1
- package/dist/vue2/lib/icon/icon.js +3 -3
- package/dist/vue2/lib/illustration/illustration-constants.cjs.map +1 -1
- package/dist/vue2/lib/illustration/illustration-constants.js.map +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.cjs.map +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.js.map +1 -1
- package/dist/vue2/lib/input/input-constants.cjs.map +1 -1
- package/dist/vue2/lib/input/input-constants.js.map +1 -1
- package/dist/vue2/lib/input/input.cjs.map +1 -1
- package/dist/vue2/lib/input/input.js +8 -8
- package/dist/vue2/lib/input/input.js.map +1 -1
- package/dist/vue2/lib/input-group/input-group.cjs.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node-constants.cjs.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node-constants.js.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.cjs +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.cjs.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.js +27 -27
- package/dist/vue2/lib/keyboard-shortcut/keyboard-shortcut.cjs.map +1 -1
- package/dist/vue2/lib/keyboard-shortcut/keyboard-shortcut.js +13 -13
- package/dist/vue2/lib/link/link-constants.cjs.map +1 -1
- package/dist/vue2/lib/link/link-constants.js.map +1 -1
- package/dist/vue2/lib/link/link.cjs.map +1 -1
- package/dist/vue2/lib/link/link.js +3 -3
- package/dist/vue2/lib/list-item/list-item-constants.cjs.map +1 -1
- package/dist/vue2/lib/list-item/list-item-constants.js.map +1 -1
- package/dist/vue2/lib/list-item/list-item.cjs.map +1 -1
- package/dist/vue2/lib/list-item/list-item.js +1 -1
- package/dist/vue2/lib/list-item/list-item.js.map +1 -1
- package/dist/vue2/lib/list-item-group/list-item-group-constants.cjs.map +1 -1
- package/dist/vue2/lib/list-item-group/list-item-group-constants.js.map +1 -1
- package/dist/vue2/lib/list-item-group/list-item-group.cjs.map +1 -1
- package/dist/vue2/lib/loader/loader.cjs.map +1 -1
- package/dist/vue2/lib/message-input/last-active-nodes.cjs +1 -1
- package/dist/vue2/lib/message-input/last-active-nodes.cjs.map +1 -1
- package/dist/vue2/lib/message-input/last-active-nodes.js +22 -22
- package/dist/vue2/lib/message-input/last-active-nodes.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-button.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-button.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input-button.js +8 -8
- package/dist/vue2/lib/message-input/message-input-constants.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input-constants.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-link.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-link.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input-link.js +8 -8
- package/dist/vue2/lib/message-input/message-input-topbar.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.js +9 -9
- package/dist/vue2/lib/message-input/message-input.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input.js +27 -28
- package/dist/vue2/lib/message-input/message-input.js.map +1 -1
- package/dist/vue2/lib/modal/modal.cjs +1 -1
- package/dist/vue2/lib/modal/modal.cjs.map +1 -1
- package/dist/vue2/lib/modal/modal.js +12 -12
- package/dist/vue2/lib/modal/modal.js.map +1 -1
- package/dist/vue2/lib/notice/notice-action.cjs.map +1 -1
- package/dist/vue2/lib/notice/notice-constants.cjs.map +1 -1
- package/dist/vue2/lib/notice/notice-constants.js.map +1 -1
- package/dist/vue2/lib/notice/notice-icon.cjs.map +1 -1
- package/dist/vue2/lib/notice/notice-icon.js +9 -9
- package/dist/vue2/lib/notice/notice.cjs.map +1 -1
- package/dist/vue2/lib/notice/notice.js +3 -3
- package/dist/vue2/lib/pagination/pagination.cjs.map +1 -1
- package/dist/vue2/lib/pagination/pagination.js +3 -3
- package/dist/vue2/lib/pagination/pagination.js.map +1 -1
- package/dist/vue2/lib/popover/popover-constants.cjs.map +1 -1
- package/dist/vue2/lib/popover/popover-constants.js.map +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.cjs.map +1 -1
- package/dist/vue2/lib/popover/popover.cjs +1 -1
- package/dist/vue2/lib/popover/popover.cjs.map +1 -1
- package/dist/vue2/lib/popover/popover.js +16 -16
- package/dist/vue2/lib/popover/popover.js.map +1 -1
- package/dist/vue2/lib/popover/tippy-utils.cjs +1 -1
- package/dist/vue2/lib/popover/tippy-utils.cjs.map +1 -1
- package/dist/vue2/lib/popover/tippy-utils.js +16 -18
- package/dist/vue2/lib/popover/tippy-utils.js.map +1 -1
- package/dist/vue2/lib/presence/presence.cjs.map +1 -1
- package/dist/vue2/lib/radio/radio-constants.cjs.map +1 -1
- package/dist/vue2/lib/radio/radio-constants.js.map +1 -1
- package/dist/vue2/lib/radio/radio.cjs.map +1 -1
- package/dist/vue2/lib/radio-group/radio-group.cjs.map +1 -1
- package/dist/vue2/lib/radio-group/radios-decorator.cjs.map +1 -1
- package/dist/vue2/lib/recipes/eslint.config.cjs +2 -0
- package/dist/vue2/lib/recipes/eslint.config.cjs.map +1 -0
- package/dist/vue2/lib/recipes/eslint.config.js +12 -0
- package/dist/vue2/lib/recipes/eslint.config.js.map +1 -0
- package/dist/vue2/lib/rich-text-editor/channel-suggestion.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/channel-suggestion.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/mention-suggestion.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/mention-suggestion.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor-constants.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor-constants.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +2 -2
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +63 -63
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/slash-command-suggestion.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/slash-command-suggestion.js.map +1 -1
- package/dist/vue2/lib/root-layout/root-layout-constants.cjs.map +1 -1
- package/dist/vue2/lib/root-layout/root-layout-constants.js.map +1 -1
- package/dist/vue2/lib/root-layout/root-layout.cjs.map +1 -1
- package/dist/vue2/lib/root-layout/root-layout.js +1 -1
- package/dist/vue2/lib/scrollbar-directive/scrollbar.cjs.map +1 -1
- package/dist/vue2/lib/scrollbar-directive/scrollbar.js.map +1 -1
- package/dist/vue2/lib/select-menu/select-menu-constants.cjs.map +1 -1
- package/dist/vue2/lib/select-menu/select-menu-constants.js.map +1 -1
- package/dist/vue2/lib/select-menu/select-menu.cjs.map +1 -1
- package/dist/vue2/lib/select-menu/select-menu.js +7 -7
- package/dist/vue2/lib/settings-menu-button/settings-menu-button.cjs.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-constants.cjs.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-constants.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-list-item.cjs.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-paragraph.cjs.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-paragraph.js.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-shape.cjs.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton-shape.js +1 -1
- package/dist/vue2/lib/skeleton/skeleton-text.cjs.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton.cjs +1 -1
- package/dist/vue2/lib/skeleton/skeleton.cjs.map +1 -1
- package/dist/vue2/lib/skeleton/skeleton.js +1 -1
- package/dist/vue2/lib/skeleton/skeleton.js.map +1 -1
- package/dist/vue2/lib/split-button/split-button-alpha.cjs.map +1 -1
- package/dist/vue2/lib/split-button/split-button-constants.cjs.map +1 -1
- package/dist/vue2/lib/split-button/split-button-constants.js.map +1 -1
- package/dist/vue2/lib/split-button/split-button-omega.cjs.map +1 -1
- package/dist/vue2/lib/split-button/split-button.cjs.map +1 -1
- package/dist/vue2/lib/split-button/split-button.js +5 -5
- package/dist/vue2/lib/split-button/split-button.js.map +1 -1
- package/dist/vue2/lib/stack/stack-constants.cjs.map +1 -1
- package/dist/vue2/lib/stack/stack-constants.js.map +1 -1
- package/dist/vue2/lib/stack/stack.cjs.map +1 -1
- package/dist/vue2/lib/stack/stack.js +9 -9
- package/dist/vue2/lib/stack/utils.cjs.map +1 -1
- package/dist/vue2/lib/stack/utils.js.map +1 -1
- package/dist/vue2/lib/stack/validators.cjs.map +1 -1
- package/dist/vue2/lib/stack/validators.js.map +1 -1
- package/dist/vue2/lib/tab/tab-group.cjs.map +1 -1
- package/dist/vue2/lib/tab/tab-group.js +5 -5
- package/dist/vue2/lib/tab/tab-group.js.map +1 -1
- package/dist/vue2/lib/tab/tab.cjs.map +1 -1
- package/dist/vue2/lib/toast/toast-constants.cjs.map +1 -1
- package/dist/vue2/lib/toast/toast-constants.js.map +1 -1
- package/dist/vue2/lib/toast/toast.cjs +1 -1
- package/dist/vue2/lib/toast/toast.cjs.map +1 -1
- package/dist/vue2/lib/toast/toast.js +11 -11
- package/dist/vue2/lib/toggle/toggle-constants.cjs.map +1 -1
- package/dist/vue2/lib/toggle/toggle-constants.js.map +1 -1
- package/dist/vue2/lib/toggle/toggle.cjs +1 -1
- package/dist/vue2/lib/toggle/toggle.cjs.map +1 -1
- package/dist/vue2/lib/toggle/toggle.js +1 -1
- package/dist/vue2/lib/toggle/toggle.js.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip-constants.cjs.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip-constants.js.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.js +63 -64
- package/dist/vue2/lib/tooltip/tooltip.js.map +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue2/lib/top-banner-info/top-banner-info-constants.cjs.map +1 -1
- package/dist/vue2/lib/top-banner-info/top-banner-info-constants.js.map +1 -1
- package/dist/vue2/lib/top-banner-info/top-banner-info.cjs.map +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill-constants.cjs.map +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill-constants.js.map +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.cjs.map +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.js +6 -6
- package/dist/vue2/lib/validation-messages/validation-messages.cjs.map +1 -1
- package/dist/vue2/lib/validation-messages/validation-messages.js +3 -3
- package/dist/vue2/localization/de-DE.cjs.map +1 -1
- package/dist/vue2/localization/de-DE.js.map +1 -1
- package/dist/vue2/localization/en-US.cjs.map +1 -1
- package/dist/vue2/localization/en-US.js.map +1 -1
- package/dist/vue2/localization/es-LA.cjs.map +1 -1
- package/dist/vue2/localization/es-LA.js.map +1 -1
- package/dist/vue2/localization/fr-FR.cjs.map +1 -1
- package/dist/vue2/localization/fr-FR.js.map +1 -1
- package/dist/vue2/localization/index.cjs.map +1 -1
- package/dist/vue2/localization/index.js.map +1 -1
- package/dist/vue2/localization/it-IT.cjs.map +1 -1
- package/dist/vue2/localization/it-IT.js.map +1 -1
- package/dist/vue2/localization/ja-JP.cjs.map +1 -1
- package/dist/vue2/localization/ja-JP.js.map +1 -1
- package/dist/vue2/localization/nl-NL.cjs.map +1 -1
- package/dist/vue2/localization/nl-NL.js.map +1 -1
- package/dist/vue2/localization/pt-BR.cjs.map +1 -1
- package/dist/vue2/localization/pt-BR.js.map +1 -1
- package/dist/vue2/localization/ru-RU.cjs.map +1 -1
- package/dist/vue2/localization/ru-RU.js.map +1 -1
- package/dist/vue2/localization/zh-CN.cjs.map +1 -1
- package/dist/vue2/localization/zh-CN.js.map +1 -1
- package/dist/vue2/node_modules/@linusborg/vue-simple-portal.cjs.map +1 -1
- package/dist/vue2/node_modules/@linusborg/vue-simple-portal.js.map +1 -1
- package/dist/vue2/node_modules/@tiptap/vue-2.cjs.map +1 -1
- package/dist/vue2/node_modules/@tiptap/vue-2.js.map +1 -1
- package/dist/vue2/shared/sr_only_close_button.cjs.map +1 -1
- package/dist/vue2/types/common/constants/index.d.ts.map +1 -1
- package/dist/vue2/types/common/dates/index.d.ts.map +1 -1
- package/dist/vue2/types/common/emoji/index.d.ts.map +1 -1
- package/dist/vue2/types/common/mixins/dom.d.ts.map +1 -1
- package/dist/vue2/types/common/mixins/input.d.ts +7 -7
- package/dist/vue2/types/common/mixins/input.d.ts.map +1 -1
- package/dist/vue2/types/common/mixins/input_group.d.ts +3 -3
- package/dist/vue2/types/common/mixins/modal.d.ts.map +1 -1
- package/dist/vue2/types/common/utils/index.d.ts.map +1 -1
- package/dist/vue2/types/components/avatar/avatar.vue.d.ts +8 -8
- package/dist/vue2/types/components/badge/badge.vue.d.ts +3 -3
- package/dist/vue2/types/components/banner/banner.vue.d.ts +2 -2
- package/dist/vue2/types/components/banner/banner.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/breadcrumbs/breadcrumbs.vue.d.ts +1 -1
- package/dist/vue2/types/components/breadcrumbs/breadcrumbs_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/button/button.vue.d.ts +2 -2
- package/dist/vue2/types/components/button/button_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/card/card.vue.d.ts +8 -8
- package/dist/vue2/types/components/checkbox/checkbox.vue.d.ts +7 -7
- package/dist/vue2/types/components/checkbox_group/checkbox_group.vue.d.ts +3 -3
- package/dist/vue2/types/components/chip/chip.vue.d.ts +5 -5
- package/dist/vue2/types/components/collapsible/collapsible.vue.d.ts +4 -4
- package/dist/vue2/types/components/combobox/combobox.vue.d.ts +3 -3
- package/dist/vue2/types/components/combobox/combobox_empty-list.vue.d.ts +2 -2
- package/dist/vue2/types/components/datepicker/datepicker_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/datepicker/formatUtils.d.ts +5 -5
- package/dist/vue2/types/components/datepicker/formatUtils.d.ts.map +1 -1
- package/dist/vue2/types/components/datepicker/modules/calendar.vue.d.ts +1 -1
- package/dist/vue2/types/components/description_list/description_list.vue.d.ts +4 -4
- package/dist/vue2/types/components/dropdown/dropdown.vue.d.ts +8 -8
- package/dist/vue2/types/components/emoji/emoji.vue.d.ts +2 -2
- package/dist/vue2/types/components/emoji_picker/emoji_picker_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/emoji_text_wrapper/emoji_text_wrapper.vue.d.ts +1 -1
- package/dist/vue2/types/components/emoji_text_wrapper/emoji_text_wrapper.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/eslint.config.d.ts +8 -0
- package/dist/vue2/types/components/eslint.config.d.ts.map +1 -0
- package/dist/vue2/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/input/input.vue.d.ts +7 -7
- package/dist/vue2/types/components/input_group/input_group.vue.d.ts +3 -3
- package/dist/vue2/types/components/item_layout/item_layout.vue.d.ts +1 -1
- package/dist/vue2/types/components/link/link_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/list_item/list_item.vue.d.ts +2 -2
- package/dist/vue2/types/components/list_item_group/list_item_group.vue.d.ts +4 -4
- package/dist/vue2/types/components/modal/modal.vue.d.ts +13 -13
- package/dist/vue2/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/notice/notice.vue.d.ts +2 -2
- package/dist/vue2/types/components/popover/popover.vue.d.ts +22 -22
- package/dist/vue2/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/popover/popover_header_footer.vue.d.ts +2 -2
- package/dist/vue2/types/components/popover/tippy_utils.d.ts +2 -3
- package/dist/vue2/types/components/popover/tippy_utils.d.ts.map +1 -1
- package/dist/vue2/types/components/radio/radio.vue.d.ts +7 -7
- package/dist/vue2/types/components/radio_group/radio_group.vue.d.ts +3 -3
- package/dist/vue2/types/components/rich_text_editor/extensions/slash_command/slash_command.d.ts +1 -1
- package/dist/vue2/types/components/rich_text_editor/extensions/slash_command/slash_command.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +12 -17
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/root_layout/root_layout.vue.d.ts +8 -8
- package/dist/vue2/types/components/select_menu/select_menu.vue.d.ts +10 -10
- package/dist/vue2/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
- package/dist/vue2/types/components/skeleton/skeleton-paragraph.vue.d.ts +1 -1
- package/dist/vue2/types/components/skeleton/skeleton-shape.vue.d.ts +3 -3
- package/dist/vue2/types/components/skeleton/skeleton-text.vue.d.ts +1 -1
- package/dist/vue2/types/components/skeleton/skeleton.vue.d.ts +7 -7
- package/dist/vue2/types/components/skeleton/skeleton_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/split_button/split_button-alpha.vue.d.ts +3 -3
- package/dist/vue2/types/components/split_button/split_button-omega.vue.d.ts +1 -1
- package/dist/vue2/types/components/split_button/split_button.vue.d.ts +2 -2
- package/dist/vue2/types/components/tab/tab.vue.d.ts +2 -2
- package/dist/vue2/types/components/tab/tab_group.vue.d.ts +2 -2
- package/dist/vue2/types/components/tab/tab_panel.vue.d.ts +2 -2
- package/dist/vue2/types/components/tab/tab_panel.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/toast/layouts/toast_layout_alternate.vue.d.ts +2 -2
- package/dist/vue2/types/components/toast/layouts/toast_layout_default.vue.d.ts +2 -2
- package/dist/vue2/types/components/toast/toast.vue.d.ts +7 -7
- package/dist/vue2/types/components/toast/toast_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/toggle/toggle.vue.d.ts +5 -5
- package/dist/vue2/types/components/tooltip/tooltip.vue.d.ts +8 -8
- package/dist/vue2/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/tooltip/tooltip_constants.d.ts.map +1 -1
- package/dist/vue2/types/components/validation_messages/validation_messages.vue.d.ts +0 -1
- package/dist/vue2/types/components/validation_messages/validation_messages.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +6 -6
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +5 -5
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +6 -6
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node_constants.d.ts.map +1 -1
- package/dist/vue2/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +7 -7
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts +3 -3
- package/dist/vue2/types/recipes/conversation_view/editor/editor_constants.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +4 -4
- package/dist/vue2/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_row/feed_item_row_constants.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/last_active_nodes.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +15 -15
- package/dist/vue2/types/recipes/eslint.config.d.ts +8 -0
- package/dist/vue2/types/recipes/eslint.config.d.ts.map +1 -0
- package/dist/vue2/types/recipes/item_layout/contact_info/contact_info.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/leftbar/callbox/callbox.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +1 -1
- package/dist/vue2/types/recipes/leftbar/general_row/general_row.vue.d.ts +1 -1
- package/dist/vue3/common/constants/index.cjs.map +1 -1
- package/dist/vue3/common/constants/index.js.map +1 -1
- package/dist/vue3/common/dates/index.cjs.map +1 -1
- package/dist/vue3/common/dates/index.js +3 -3
- package/dist/vue3/common/dates/index.js.map +1 -1
- package/dist/vue3/common/emoji/index.cjs.map +1 -1
- package/dist/vue3/common/emoji/index.js.map +1 -1
- package/dist/vue3/common/mixins/dom.cjs.map +1 -1
- package/dist/vue3/common/mixins/dom.js.map +1 -1
- package/dist/vue3/common/mixins/input-group.cjs.map +1 -1
- package/dist/vue3/common/mixins/input-group.js +5 -5
- package/dist/vue3/common/mixins/input-group.js.map +1 -1
- package/dist/vue3/common/mixins/input.cjs.map +1 -1
- package/dist/vue3/common/mixins/input.js.map +1 -1
- package/dist/vue3/common/mixins/keyboard-list-navigation.cjs.map +1 -1
- package/dist/vue3/common/mixins/keyboard-list-navigation.js.map +1 -1
- package/dist/vue3/common/mixins/modal.cjs.map +1 -1
- package/dist/vue3/common/mixins/modal.js.map +1 -1
- package/dist/vue3/common/mixins/skeleton.cjs.map +1 -1
- package/dist/vue3/common/mixins/skeleton.js.map +1 -1
- package/dist/vue3/common/utils/index.cjs.map +1 -1
- package/dist/vue3/common/utils/index.js +3 -3
- package/dist/vue3/common/utils/index.js.map +1 -1
- package/dist/vue3/common/validators/index.cjs.map +1 -1
- package/dist/vue3/common/validators/index.js.map +1 -1
- package/dist/vue3/lib/attachment-carousel/attachment-carousel.cjs +1 -1
- package/dist/vue3/lib/attachment-carousel/attachment-carousel.cjs.map +1 -1
- package/dist/vue3/lib/attachment-carousel/attachment-carousel.js +5 -5
- package/dist/vue3/lib/attachment-carousel/attachment-carousel.js.map +1 -1
- package/dist/vue3/lib/avatar/avatar-constants.cjs.map +1 -1
- package/dist/vue3/lib/avatar/avatar-constants.js.map +1 -1
- package/dist/vue3/lib/avatar/avatar.cjs.map +1 -1
- package/dist/vue3/lib/avatar/avatar.js +11 -11
- package/dist/vue3/lib/avatar/avatar.js.map +1 -1
- package/dist/vue3/lib/avatar/utils.cjs.map +1 -1
- package/dist/vue3/lib/avatar/utils.js.map +1 -1
- package/dist/vue3/lib/badge/badge.cjs.map +1 -1
- package/dist/vue3/lib/badge/badge.js +12 -12
- package/dist/vue3/lib/badge/badge.js.map +1 -1
- package/dist/vue3/lib/banner/banner.cjs +1 -1
- package/dist/vue3/lib/banner/banner.cjs.map +1 -1
- package/dist/vue3/lib/banner/banner.js +7 -7
- package/dist/vue3/lib/banner/banner.js.map +1 -1
- package/dist/vue3/lib/breadcrumbs/breadcrumb-item.cjs.map +1 -1
- package/dist/vue3/lib/breadcrumbs/breadcrumb-item.js +5 -5
- package/dist/vue3/lib/breadcrumbs/breadcrumb-item.js.map +1 -1
- package/dist/vue3/lib/breadcrumbs/breadcrumbs.cjs.map +1 -1
- package/dist/vue3/lib/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/vue3/lib/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/vue3/lib/button/button-constants.cjs.map +1 -1
- package/dist/vue3/lib/button/button-constants.js.map +1 -1
- package/dist/vue3/lib/button/button.cjs.map +1 -1
- package/dist/vue3/lib/button/button.js +22 -22
- package/dist/vue3/lib/button/button.js.map +1 -1
- package/dist/vue3/lib/button-group/button-group.cjs.map +1 -1
- package/dist/vue3/lib/button-group/button-group.js +2 -2
- package/dist/vue3/lib/button-group/button-group.js.map +1 -1
- package/dist/vue3/lib/button-group/buttons-decorator.cjs.map +1 -1
- package/dist/vue3/lib/button-group/buttons-decorator.js +2 -2
- package/dist/vue3/lib/button-group/buttons-decorator.js.map +1 -1
- package/dist/vue3/lib/callbar-button/callbar-button-constants.cjs.map +1 -1
- package/dist/vue3/lib/callbar-button/callbar-button-constants.js.map +1 -1
- package/dist/vue3/lib/callbar-button/callbar-button.cjs +1 -1
- package/dist/vue3/lib/callbar-button/callbar-button.cjs.map +1 -1
- package/dist/vue3/lib/callbar-button/callbar-button.js +13 -13
- package/dist/vue3/lib/callbar-button/callbar-button.js.map +1 -1
- package/dist/vue3/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +1 -1
- package/dist/vue3/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs.map +1 -1
- package/dist/vue3/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +13 -13
- package/dist/vue3/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js.map +1 -1
- package/dist/vue3/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +1 -1
- package/dist/vue3/lib/callbar-button-with-popover/callbar-button-with-popover.cjs.map +1 -1
- package/dist/vue3/lib/callbar-button-with-popover/callbar-button-with-popover.js +13 -13
- package/dist/vue3/lib/callbar-button-with-popover/callbar-button-with-popover.js.map +1 -1
- package/dist/vue3/lib/callbox/callbox-constants.cjs.map +1 -1
- package/dist/vue3/lib/callbox/callbox-constants.js.map +1 -1
- package/dist/vue3/lib/callbox/callbox.cjs.map +1 -1
- package/dist/vue3/lib/callbox/callbox.js +6 -6
- package/dist/vue3/lib/callbox/callbox.js.map +1 -1
- package/dist/vue3/lib/card/card.cjs.map +1 -1
- package/dist/vue3/lib/card/card.js +4 -4
- package/dist/vue3/lib/card/card.js.map +1 -1
- package/dist/vue3/lib/checkbox/checkbox-constants.cjs.map +1 -1
- package/dist/vue3/lib/checkbox/checkbox-constants.js.map +1 -1
- package/dist/vue3/lib/checkbox/checkbox.cjs.map +1 -1
- package/dist/vue3/lib/checkbox/checkbox.js +8 -8
- package/dist/vue3/lib/checkbox/checkbox.js.map +1 -1
- package/dist/vue3/lib/checkbox-group/checkbox-group.cjs.map +1 -1
- package/dist/vue3/lib/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/vue3/lib/checkbox-group/checkboxes-decorator.cjs.map +1 -1
- package/dist/vue3/lib/checkbox-group/checkboxes-decorator.js +1 -1
- package/dist/vue3/lib/checkbox-group/checkboxes-decorator.js.map +1 -1
- package/dist/vue3/lib/chip/chip-constants.cjs.map +1 -1
- package/dist/vue3/lib/chip/chip-constants.js.map +1 -1
- package/dist/vue3/lib/chip/chip.cjs.map +1 -1
- package/dist/vue3/lib/chip/chip.js +13 -13
- package/dist/vue3/lib/chip/chip.js.map +1 -1
- package/dist/vue3/lib/codeblock/codeblock.cjs.map +1 -1
- package/dist/vue3/lib/codeblock/codeblock.js +2 -2
- package/dist/vue3/lib/codeblock/codeblock.js.map +1 -1
- package/dist/vue3/lib/collapsible/collapsible-lazy-show.cjs.map +1 -1
- package/dist/vue3/lib/collapsible/collapsible-lazy-show.js +3 -3
- package/dist/vue3/lib/collapsible/collapsible-lazy-show.js.map +1 -1
- package/dist/vue3/lib/collapsible/collapsible.cjs +1 -1
- package/dist/vue3/lib/collapsible/collapsible.cjs.map +1 -1
- package/dist/vue3/lib/collapsible/collapsible.js +18 -18
- package/dist/vue3/lib/collapsible/collapsible.js.map +1 -1
- package/dist/vue3/lib/combobox/combobox-constants.cjs.map +1 -1
- package/dist/vue3/lib/combobox/combobox-constants.js.map +1 -1
- package/dist/vue3/lib/combobox/combobox-empty-list.cjs.map +1 -1
- package/dist/vue3/lib/combobox/combobox-empty-list.js +2 -2
- package/dist/vue3/lib/combobox/combobox-empty-list.js.map +1 -1
- package/dist/vue3/lib/combobox/combobox-loading-list.cjs +1 -1
- package/dist/vue3/lib/combobox/combobox-loading-list.cjs.map +1 -1
- package/dist/vue3/lib/combobox/combobox-loading-list.js +6 -6
- package/dist/vue3/lib/combobox/combobox-loading-list.js.map +1 -1
- package/dist/vue3/lib/combobox/combobox.cjs +1 -1
- package/dist/vue3/lib/combobox/combobox.cjs.map +1 -1
- package/dist/vue3/lib/combobox/combobox.js +8 -8
- package/dist/vue3/lib/combobox/combobox.js.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select-constants.cjs.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select-constants.js.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select-story-constants.cjs.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select-story-constants.js.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js +16 -16
- package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/vue3/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/vue3/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
- package/dist/vue3/lib/combobox-with-popover/combobox-with-popover.js +13 -13
- package/dist/vue3/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
- package/dist/vue3/lib/contact-centers-row/contact-centers-row.cjs +1 -1
- package/dist/vue3/lib/contact-centers-row/contact-centers-row.cjs.map +1 -1
- package/dist/vue3/lib/contact-centers-row/contact-centers-row.js +19 -19
- package/dist/vue3/lib/contact-centers-row/contact-centers-row.js.map +1 -1
- package/dist/vue3/lib/contact-info/contact-info.cjs.map +1 -1
- package/dist/vue3/lib/contact-info/contact-info.js +1 -1
- package/dist/vue3/lib/contact-info/contact-info.js.map +1 -1
- package/dist/vue3/lib/contact-row/contact-row.cjs +1 -1
- package/dist/vue3/lib/contact-row/contact-row.cjs.map +1 -1
- package/dist/vue3/lib/contact-row/contact-row.js +12 -12
- package/dist/vue3/lib/contact-row/contact-row.js.map +1 -1
- package/dist/vue3/lib/datepicker/datepicker.cjs +1 -1
- package/dist/vue3/lib/datepicker/datepicker.cjs.map +1 -1
- package/dist/vue3/lib/datepicker/datepicker.js +139 -139
- package/dist/vue3/lib/datepicker/datepicker.js.map +1 -1
- package/dist/vue3/lib/datepicker/formatUtils.cjs.map +1 -1
- package/dist/vue3/lib/datepicker/formatUtils.js.map +1 -1
- package/dist/vue3/lib/datepicker/utils.cjs.map +1 -1
- package/dist/vue3/lib/datepicker/utils.js.map +1 -1
- package/dist/vue3/lib/description-list/description-list.cjs.map +1 -1
- package/dist/vue3/lib/description-list/description-list.js +3 -3
- package/dist/vue3/lib/description-list/description-list.js.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown-constants.cjs.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown-constants.js.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown-list.cjs.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown-list.js +5 -5
- package/dist/vue3/lib/dropdown/dropdown-list.js.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown-separator.cjs.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown-separator.js +2 -2
- package/dist/vue3/lib/dropdown/dropdown-separator.js.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown-story-constants.cjs.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown-story-constants.js.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown.cjs +1 -1
- package/dist/vue3/lib/dropdown/dropdown.cjs.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown.js +3 -3
- package/dist/vue3/lib/dropdown/dropdown.js.map +1 -1
- package/dist/vue3/lib/editor/editor-constants.cjs.map +1 -1
- package/dist/vue3/lib/editor/editor-constants.js.map +1 -1
- package/dist/vue3/lib/editor/editor.cjs +1 -1
- package/dist/vue3/lib/editor/editor.cjs.map +1 -1
- package/dist/vue3/lib/editor/editor.js +48 -48
- package/dist/vue3/lib/editor/editor.js.map +1 -1
- package/dist/vue3/lib/emoji/emoji.cjs.map +1 -1
- package/dist/vue3/lib/emoji/emoji.js +6 -6
- package/dist/vue3/lib/emoji/emoji.js.map +1 -1
- package/dist/vue3/lib/emoji-picker/emoji-picker-constants.cjs.map +1 -1
- package/dist/vue3/lib/emoji-picker/emoji-picker-constants.js.map +1 -1
- package/dist/vue3/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/vue3/lib/emoji-picker/emoji-picker.js +2 -2
- package/dist/vue3/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row-constants.cjs.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row-constants.js.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.js +10 -10
- package/dist/vue3/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue3/lib/emoji-text-wrapper/emoji-text-wrapper.cjs +1 -1
- package/dist/vue3/lib/emoji-text-wrapper/emoji-text-wrapper.cjs.map +1 -1
- package/dist/vue3/lib/emoji-text-wrapper/emoji-text-wrapper.js +1 -1
- package/dist/vue3/lib/emoji-text-wrapper/emoji-text-wrapper.js.map +1 -1
- package/dist/vue3/lib/empty-state/empty-state-constants.cjs.map +1 -1
- package/dist/vue3/lib/empty-state/empty-state-constants.js.map +1 -1
- package/dist/vue3/lib/empty-state/empty-state.cjs.map +1 -1
- package/dist/vue3/lib/empty-state/empty-state.js +7 -7
- package/dist/vue3/lib/feed-item-pill/feed-item-pill-constants.cjs.map +1 -1
- package/dist/vue3/lib/feed-item-pill/feed-item-pill-constants.js.map +1 -1
- package/dist/vue3/lib/feed-item-pill/feed-item-pill.cjs +1 -1
- package/dist/vue3/lib/feed-item-pill/feed-item-pill.cjs.map +1 -1
- package/dist/vue3/lib/feed-item-pill/feed-item-pill.js +6 -6
- package/dist/vue3/lib/feed-item-pill/feed-item-pill.js.map +1 -1
- package/dist/vue3/lib/feed-item-row/feed-item-row-constants.cjs.map +1 -1
- package/dist/vue3/lib/feed-item-row/feed-item-row-constants.js.map +1 -1
- package/dist/vue3/lib/feed-item-row/feed-item-row.cjs +1 -1
- package/dist/vue3/lib/feed-item-row/feed-item-row.cjs.map +1 -1
- package/dist/vue3/lib/feed-item-row/feed-item-row.js +56 -56
- package/dist/vue3/lib/feed-item-row/feed-item-row.js.map +1 -1
- package/dist/vue3/lib/general-row/general-row-constants.cjs.map +1 -1
- package/dist/vue3/lib/general-row/general-row-constants.js.map +1 -1
- package/dist/vue3/lib/general-row/general-row.cjs +1 -1
- package/dist/vue3/lib/general-row/general-row.cjs.map +1 -1
- package/dist/vue3/lib/general-row/general-row.js +30 -30
- package/dist/vue3/lib/general-row/general-row.js.map +1 -1
- package/dist/vue3/lib/general-row/leftbar-general-row-icon.cjs.map +1 -1
- package/dist/vue3/lib/general-row/leftbar-general-row-icon.js +35 -35
- package/dist/vue3/lib/general-row/leftbar-general-row-icon.js.map +1 -1
- package/dist/vue3/lib/group-row/group-row.cjs.map +1 -1
- package/dist/vue3/lib/group-row/group-row.js +3 -3
- package/dist/vue3/lib/group-row/group-row.js.map +1 -1
- package/dist/vue3/lib/grouped-chip/grouped-chip.cjs.map +1 -1
- package/dist/vue3/lib/grouped-chip/grouped-chip.js +14 -14
- package/dist/vue3/lib/grouped-chip/grouped-chip.js.map +1 -1
- package/dist/vue3/lib/hovercard/hovercard.cjs +1 -1
- package/dist/vue3/lib/hovercard/hovercard.cjs.map +1 -1
- package/dist/vue3/lib/hovercard/hovercard.js +6 -6
- package/dist/vue3/lib/hovercard/hovercard.js.map +1 -1
- package/dist/vue3/lib/icon/icon-constants.cjs.map +1 -1
- package/dist/vue3/lib/icon/icon-constants.js.map +1 -1
- package/dist/vue3/lib/icon/icon.cjs.map +1 -1
- package/dist/vue3/lib/icon/icon.js +6 -6
- package/dist/vue3/lib/icon/icon.js.map +1 -1
- package/dist/vue3/lib/illustration/illustration-constants.cjs.map +1 -1
- package/dist/vue3/lib/illustration/illustration-constants.js.map +1 -1
- package/dist/vue3/lib/illustration/illustration.cjs.map +1 -1
- package/dist/vue3/lib/illustration/illustration.js +3 -3
- package/dist/vue3/lib/image-viewer/image-viewer.cjs.map +1 -1
- package/dist/vue3/lib/image-viewer/image-viewer.js +12 -12
- package/dist/vue3/lib/image-viewer/image-viewer.js.map +1 -1
- package/dist/vue3/lib/input/input-constants.cjs.map +1 -1
- package/dist/vue3/lib/input/input-constants.js.map +1 -1
- package/dist/vue3/lib/input/input.cjs.map +1 -1
- package/dist/vue3/lib/input/input.js +20 -20
- package/dist/vue3/lib/input/input.js.map +1 -1
- package/dist/vue3/lib/input-group/input-group.cjs.map +1 -1
- package/dist/vue3/lib/input-group/input-group.js +8 -8
- package/dist/vue3/lib/input-group/input-group.js.map +1 -1
- package/dist/vue3/lib/item-layout/item-layout.cjs.map +1 -1
- package/dist/vue3/lib/item-layout/item-layout.js +13 -13
- package/dist/vue3/lib/item-layout/item-layout.js.map +1 -1
- package/dist/vue3/lib/ivr-node/ivr-node-constants.cjs.map +1 -1
- package/dist/vue3/lib/ivr-node/ivr-node-constants.js.map +1 -1
- package/dist/vue3/lib/ivr-node/ivr-node.cjs +1 -1
- package/dist/vue3/lib/ivr-node/ivr-node.cjs.map +1 -1
- package/dist/vue3/lib/ivr-node/ivr-node.js +36 -36
- package/dist/vue3/lib/ivr-node/ivr-node.js.map +1 -1
- package/dist/vue3/lib/keyboard-shortcut/keyboard-shortcut.cjs.map +1 -1
- package/dist/vue3/lib/keyboard-shortcut/keyboard-shortcut.js +15 -15
- package/dist/vue3/lib/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/dist/vue3/lib/lazy-show/lazy-show.cjs.map +1 -1
- package/dist/vue3/lib/lazy-show/lazy-show.js +2 -2
- package/dist/vue3/lib/lazy-show/lazy-show.js.map +1 -1
- package/dist/vue3/lib/link/link-constants.cjs.map +1 -1
- package/dist/vue3/lib/link/link-constants.js.map +1 -1
- package/dist/vue3/lib/link/link.cjs.map +1 -1
- package/dist/vue3/lib/link/link.js +5 -5
- package/dist/vue3/lib/link/link.js.map +1 -1
- package/dist/vue3/lib/list-item/list-item-constants.cjs.map +1 -1
- package/dist/vue3/lib/list-item/list-item-constants.js.map +1 -1
- package/dist/vue3/lib/list-item/list-item.cjs.map +1 -1
- package/dist/vue3/lib/list-item/list-item.js +4 -4
- package/dist/vue3/lib/list-item/list-item.js.map +1 -1
- package/dist/vue3/lib/list-item-group/list-item-group-constants.cjs.map +1 -1
- package/dist/vue3/lib/list-item-group/list-item-group-constants.js.map +1 -1
- package/dist/vue3/lib/list-item-group/list-item-group.cjs.map +1 -1
- package/dist/vue3/lib/list-item-group/list-item-group.js +5 -5
- package/dist/vue3/lib/list-item-group/list-item-group.js.map +1 -1
- package/dist/vue3/lib/loader/loader.cjs.map +1 -1
- package/dist/vue3/lib/loader/loader.js +2 -2
- package/dist/vue3/lib/loader/loader.js.map +1 -1
- package/dist/vue3/lib/message-input/last-active-nodes.cjs +1 -1
- package/dist/vue3/lib/message-input/last-active-nodes.cjs.map +1 -1
- package/dist/vue3/lib/message-input/last-active-nodes.js +22 -22
- package/dist/vue3/lib/message-input/last-active-nodes.js.map +1 -1
- package/dist/vue3/lib/message-input/message-input-button.cjs +1 -1
- package/dist/vue3/lib/message-input/message-input-button.cjs.map +1 -1
- package/dist/vue3/lib/message-input/message-input-button.js +14 -14
- package/dist/vue3/lib/message-input/message-input-button.js.map +1 -1
- package/dist/vue3/lib/message-input/message-input-constants.cjs.map +1 -1
- package/dist/vue3/lib/message-input/message-input-constants.js.map +1 -1
- package/dist/vue3/lib/message-input/message-input-link.cjs +1 -1
- package/dist/vue3/lib/message-input/message-input-link.cjs.map +1 -1
- package/dist/vue3/lib/message-input/message-input-link.js +10 -10
- package/dist/vue3/lib/message-input/message-input-link.js.map +1 -1
- package/dist/vue3/lib/message-input/message-input-topbar.cjs.map +1 -1
- package/dist/vue3/lib/message-input/message-input-topbar.js +11 -11
- package/dist/vue3/lib/message-input/message-input-topbar.js.map +1 -1
- package/dist/vue3/lib/message-input/message-input.cjs +1 -1
- package/dist/vue3/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue3/lib/message-input/message-input.js +31 -31
- package/dist/vue3/lib/message-input/message-input.js.map +1 -1
- package/dist/vue3/lib/modal/modal.cjs +1 -1
- package/dist/vue3/lib/modal/modal.cjs.map +1 -1
- package/dist/vue3/lib/modal/modal.js +14 -14
- package/dist/vue3/lib/modal/modal.js.map +1 -1
- package/dist/vue3/lib/notice/notice-action.cjs.map +1 -1
- package/dist/vue3/lib/notice/notice-action.js +1 -1
- package/dist/vue3/lib/notice/notice-action.js.map +1 -1
- package/dist/vue3/lib/notice/notice-constants.cjs.map +1 -1
- package/dist/vue3/lib/notice/notice-constants.js.map +1 -1
- package/dist/vue3/lib/notice/notice-content.cjs.map +1 -1
- package/dist/vue3/lib/notice/notice-content.js +6 -6
- package/dist/vue3/lib/notice/notice-content.js.map +1 -1
- package/dist/vue3/lib/notice/notice-icon.cjs.map +1 -1
- package/dist/vue3/lib/notice/notice-icon.js +13 -13
- package/dist/vue3/lib/notice/notice-icon.js.map +1 -1
- package/dist/vue3/lib/notice/notice.cjs.map +1 -1
- package/dist/vue3/lib/notice/notice.js +4 -4
- package/dist/vue3/lib/notice/notice.js.map +1 -1
- package/dist/vue3/lib/pagination/pagination.cjs.map +1 -1
- package/dist/vue3/lib/pagination/pagination.js +4 -4
- package/dist/vue3/lib/pagination/pagination.js.map +1 -1
- package/dist/vue3/lib/popover/popover-constants.cjs.map +1 -1
- package/dist/vue3/lib/popover/popover-constants.js.map +1 -1
- package/dist/vue3/lib/popover/popover-header-footer.cjs.map +1 -1
- package/dist/vue3/lib/popover/popover-header-footer.js +6 -6
- package/dist/vue3/lib/popover/popover-header-footer.js.map +1 -1
- package/dist/vue3/lib/popover/popover.cjs +1 -1
- package/dist/vue3/lib/popover/popover.cjs.map +1 -1
- package/dist/vue3/lib/popover/popover.js +17 -17
- package/dist/vue3/lib/popover/popover.js.map +1 -1
- package/dist/vue3/lib/popover/tippy-utils.cjs +1 -1
- package/dist/vue3/lib/popover/tippy-utils.cjs.map +1 -1
- package/dist/vue3/lib/popover/tippy-utils.js +16 -18
- package/dist/vue3/lib/popover/tippy-utils.js.map +1 -1
- package/dist/vue3/lib/presence/presence.cjs.map +1 -1
- package/dist/vue3/lib/presence/presence.js +4 -4
- package/dist/vue3/lib/presence/presence.js.map +1 -1
- package/dist/vue3/lib/radio/radio-constants.cjs.map +1 -1
- package/dist/vue3/lib/radio/radio-constants.js.map +1 -1
- package/dist/vue3/lib/radio/radio.cjs.map +1 -1
- package/dist/vue3/lib/radio/radio.js +13 -13
- package/dist/vue3/lib/radio/radio.js.map +1 -1
- package/dist/vue3/lib/radio-group/radio-group.cjs.map +1 -1
- package/dist/vue3/lib/radio-group/radio-group.js.map +1 -1
- package/dist/vue3/lib/radio-group/radios-decorator.cjs.map +1 -1
- package/dist/vue3/lib/radio-group/radios-decorator.js +1 -1
- package/dist/vue3/lib/radio-group/radios-decorator.js.map +1 -1
- package/dist/vue3/lib/recipes/eslint.config.cjs +2 -0
- package/dist/vue3/lib/recipes/eslint.config.cjs.map +1 -0
- package/dist/vue3/lib/recipes/eslint.config.js +12 -0
- package/dist/vue3/lib/recipes/eslint.config.js.map +1 -0
- package/dist/vue3/lib/rich-text-editor/channel-suggestion.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/channel-suggestion.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/mention-suggestion.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/mention-suggestion.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor-constants.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor-constants.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +3 -3
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +52 -52
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/slash-command-suggestion.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/slash-command-suggestion.js.map +1 -1
- package/dist/vue3/lib/root-layout/root-layout-constants.cjs.map +1 -1
- package/dist/vue3/lib/root-layout/root-layout-constants.js.map +1 -1
- package/dist/vue3/lib/root-layout/root-layout.cjs.map +1 -1
- package/dist/vue3/lib/root-layout/root-layout.js +3 -3
- package/dist/vue3/lib/root-layout/root-layout.js.map +1 -1
- package/dist/vue3/lib/scrollbar-directive/scrollbar.cjs.map +1 -1
- package/dist/vue3/lib/scrollbar-directive/scrollbar.js.map +1 -1
- package/dist/vue3/lib/scroller/scroller.cjs +1 -1
- package/dist/vue3/lib/scroller/scroller.cjs.map +1 -1
- package/dist/vue3/lib/scroller/scroller.js +2 -2
- package/dist/vue3/lib/scroller/scroller.js.map +1 -1
- package/dist/vue3/lib/select-menu/select-menu-constants.cjs.map +1 -1
- package/dist/vue3/lib/select-menu/select-menu-constants.js.map +1 -1
- package/dist/vue3/lib/select-menu/select-menu.cjs.map +1 -1
- package/dist/vue3/lib/select-menu/select-menu.js +21 -21
- package/dist/vue3/lib/select-menu/select-menu.js.map +1 -1
- package/dist/vue3/lib/settings-menu-button/settings-menu-button.cjs.map +1 -1
- package/dist/vue3/lib/settings-menu-button/settings-menu-button.js +3 -3
- package/dist/vue3/lib/settings-menu-button/settings-menu-button.js.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton-constants.cjs.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton-constants.js.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton-list-item.cjs.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton-list-item.js +2 -2
- package/dist/vue3/lib/skeleton/skeleton-list-item.js.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton-paragraph.cjs.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton-paragraph.js +1 -1
- package/dist/vue3/lib/skeleton/skeleton-paragraph.js.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton-shape.cjs.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton-shape.js +5 -5
- package/dist/vue3/lib/skeleton/skeleton-shape.js.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton-text.cjs.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton-text.js +7 -7
- package/dist/vue3/lib/skeleton/skeleton-text.js.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton.cjs +1 -1
- package/dist/vue3/lib/skeleton/skeleton.cjs.map +1 -1
- package/dist/vue3/lib/skeleton/skeleton.js +11 -11
- package/dist/vue3/lib/skeleton/skeleton.js.map +1 -1
- package/dist/vue3/lib/split-button/split-button-alpha.cjs.map +1 -1
- package/dist/vue3/lib/split-button/split-button-alpha.js +2 -2
- package/dist/vue3/lib/split-button/split-button-alpha.js.map +1 -1
- package/dist/vue3/lib/split-button/split-button-constants.cjs.map +1 -1
- package/dist/vue3/lib/split-button/split-button-constants.js.map +1 -1
- package/dist/vue3/lib/split-button/split-button-omega.cjs.map +1 -1
- package/dist/vue3/lib/split-button/split-button-omega.js +2 -2
- package/dist/vue3/lib/split-button/split-button-omega.js.map +1 -1
- package/dist/vue3/lib/split-button/split-button.cjs.map +1 -1
- package/dist/vue3/lib/split-button/split-button.js +19 -19
- package/dist/vue3/lib/split-button/split-button.js.map +1 -1
- package/dist/vue3/lib/stack/stack-constants.cjs.map +1 -1
- package/dist/vue3/lib/stack/stack-constants.js.map +1 -1
- package/dist/vue3/lib/stack/stack.cjs.map +1 -1
- package/dist/vue3/lib/stack/stack.js +11 -11
- package/dist/vue3/lib/stack/stack.js.map +1 -1
- package/dist/vue3/lib/stack/utils.cjs.map +1 -1
- package/dist/vue3/lib/stack/utils.js.map +1 -1
- package/dist/vue3/lib/stack/validators.cjs.map +1 -1
- package/dist/vue3/lib/stack/validators.js +5 -5
- package/dist/vue3/lib/stack/validators.js.map +1 -1
- package/dist/vue3/lib/tab/tab-group.cjs.map +1 -1
- package/dist/vue3/lib/tab/tab-group.js +7 -7
- package/dist/vue3/lib/tab/tab-group.js.map +1 -1
- package/dist/vue3/lib/tab/tab-panel.cjs.map +1 -1
- package/dist/vue3/lib/tab/tab-panel.js +2 -2
- package/dist/vue3/lib/tab/tab-panel.js.map +1 -1
- package/dist/vue3/lib/tab/tab.cjs.map +1 -1
- package/dist/vue3/lib/tab/tab.js +2 -2
- package/dist/vue3/lib/tab/tab.js.map +1 -1
- package/dist/vue3/lib/time-pill/time-pill.cjs.map +1 -1
- package/dist/vue3/lib/time-pill/time-pill.js +2 -2
- package/dist/vue3/lib/time-pill/time-pill.js.map +1 -1
- package/dist/vue3/lib/toast/toast-constants.cjs.map +1 -1
- package/dist/vue3/lib/toast/toast-constants.js.map +1 -1
- package/dist/vue3/lib/toast/toast.cjs +1 -1
- package/dist/vue3/lib/toast/toast.cjs.map +1 -1
- package/dist/vue3/lib/toast/toast.js +12 -12
- package/dist/vue3/lib/toast/toast.js.map +1 -1
- package/dist/vue3/lib/toggle/toggle-constants.cjs.map +1 -1
- package/dist/vue3/lib/toggle/toggle-constants.js.map +1 -1
- package/dist/vue3/lib/toggle/toggle.cjs +1 -1
- package/dist/vue3/lib/toggle/toggle.cjs.map +1 -1
- package/dist/vue3/lib/toggle/toggle.js +14 -14
- package/dist/vue3/lib/toggle/toggle.js.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip-constants.cjs.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip-constants.js.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip.cjs +1 -1
- package/dist/vue3/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip.js +20 -22
- package/dist/vue3/lib/tooltip/tooltip.js.map +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.js +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue3/lib/top-banner-info/top-banner-info-constants.cjs.map +1 -1
- package/dist/vue3/lib/top-banner-info/top-banner-info-constants.js.map +1 -1
- package/dist/vue3/lib/top-banner-info/top-banner-info.cjs.map +1 -1
- package/dist/vue3/lib/top-banner-info/top-banner-info.js +2 -2
- package/dist/vue3/lib/top-banner-info/top-banner-info.js.map +1 -1
- package/dist/vue3/lib/unread-pill/unread-pill-constants.cjs.map +1 -1
- package/dist/vue3/lib/unread-pill/unread-pill-constants.js.map +1 -1
- package/dist/vue3/lib/unread-pill/unread-pill.cjs.map +1 -1
- package/dist/vue3/lib/unread-pill/unread-pill.js +7 -7
- package/dist/vue3/lib/unread-pill/unread-pill.js.map +1 -1
- package/dist/vue3/lib/validation-messages/validation-messages.cjs.map +1 -1
- package/dist/vue3/lib/validation-messages/validation-messages.js +9 -9
- package/dist/vue3/lib/validation-messages/validation-messages.js.map +1 -1
- package/dist/vue3/localization/de-DE.cjs.map +1 -1
- package/dist/vue3/localization/de-DE.js.map +1 -1
- package/dist/vue3/localization/en-US.cjs.map +1 -1
- package/dist/vue3/localization/en-US.js.map +1 -1
- package/dist/vue3/localization/es-LA.cjs.map +1 -1
- package/dist/vue3/localization/es-LA.js.map +1 -1
- package/dist/vue3/localization/fr-FR.cjs.map +1 -1
- package/dist/vue3/localization/fr-FR.js.map +1 -1
- package/dist/vue3/localization/index.cjs.map +1 -1
- package/dist/vue3/localization/index.js.map +1 -1
- package/dist/vue3/localization/it-IT.cjs.map +1 -1
- package/dist/vue3/localization/it-IT.js.map +1 -1
- package/dist/vue3/localization/ja-JP.cjs.map +1 -1
- package/dist/vue3/localization/ja-JP.js.map +1 -1
- package/dist/vue3/localization/nl-NL.cjs.map +1 -1
- package/dist/vue3/localization/nl-NL.js.map +1 -1
- package/dist/vue3/localization/pt-BR.cjs.map +1 -1
- package/dist/vue3/localization/pt-BR.js.map +1 -1
- package/dist/vue3/localization/ru-RU.cjs.map +1 -1
- package/dist/vue3/localization/ru-RU.js.map +1 -1
- package/dist/vue3/localization/zh-CN.cjs.map +1 -1
- package/dist/vue3/localization/zh-CN.js.map +1 -1
- package/dist/vue3/node_modules/@tiptap/vue-3.cjs.map +1 -1
- package/dist/vue3/node_modules/@tiptap/vue-3.js +3 -3
- package/dist/vue3/node_modules/@tiptap/vue-3.js.map +1 -1
- package/dist/vue3/shared/sr_only_close_button.cjs.map +1 -1
- package/dist/vue3/shared/sr_only_close_button.js +2 -2
- package/dist/vue3/shared/sr_only_close_button.js.map +1 -1
- package/dist/vue3/types/common/constants/index.d.ts.map +1 -1
- package/dist/vue3/types/common/dates/index.d.ts.map +1 -1
- package/dist/vue3/types/common/emoji/index.d.ts.map +1 -1
- package/dist/vue3/types/common/mixins/dom.d.ts.map +1 -1
- package/dist/vue3/types/common/mixins/input.d.ts +6 -6
- package/dist/vue3/types/common/mixins/input.d.ts.map +1 -1
- package/dist/vue3/types/common/mixins/input_group.d.ts +2 -2
- package/dist/vue3/types/common/mixins/modal.d.ts.map +1 -1
- package/dist/vue3/types/common/utils/index.d.ts.map +1 -1
- package/dist/vue3/types/components/avatar/avatar.vue.d.ts +12 -12
- package/dist/vue3/types/components/badge/badge.vue.d.ts +4 -4
- package/dist/vue3/types/components/banner/banner.vue.d.ts +1 -1
- package/dist/vue3/types/components/banner/banner.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/breadcrumbs/breadcrumbs_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/button/button.vue.d.ts +3 -3
- package/dist/vue3/types/components/button/button_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/card/card.vue.d.ts +12 -12
- package/dist/vue3/types/components/checkbox/checkbox.vue.d.ts +6 -6
- package/dist/vue3/types/components/checkbox_group/checkbox_group.vue.d.ts +2 -2
- package/dist/vue3/types/components/chip/chip.vue.d.ts +6 -6
- package/dist/vue3/types/components/collapsible/collapsible.vue.d.ts +6 -6
- package/dist/vue3/types/components/combobox/combobox.vue.d.ts +4 -4
- package/dist/vue3/types/components/combobox/combobox_empty-list.vue.d.ts +3 -3
- package/dist/vue3/types/components/datepicker/datepicker_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/datepicker/formatUtils.d.ts +5 -5
- package/dist/vue3/types/components/datepicker/formatUtils.d.ts.map +1 -1
- package/dist/vue3/types/components/datepicker/modules/calendar.vue.d.ts +1 -1
- package/dist/vue3/types/components/datepicker/modules/month-year-picker.vue.d.ts +1 -1
- package/dist/vue3/types/components/description_list/description_list.vue.d.ts +6 -6
- package/dist/vue3/types/components/dropdown/dropdown.vue.d.ts +10 -10
- package/dist/vue3/types/components/emoji/emoji.vue.d.ts +3 -3
- package/dist/vue3/types/components/emoji_picker/emoji_picker_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/emoji_picker/modules/emoji_search.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/emoji_picker/modules/emoji_selector.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/emoji_picker/modules/emoji_skin_selector.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/emoji_picker/modules/emoji_tabset.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/emoji_text_wrapper/emoji_text_wrapper.vue.d.ts +1 -1
- package/dist/vue3/types/components/emoji_text_wrapper/emoji_text_wrapper.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/empty_state/empty_state.vue.d.ts +7 -11
- package/dist/vue3/types/components/empty_state/empty_state.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/eslint.config.d.ts +8 -0
- package/dist/vue3/types/components/eslint.config.d.ts.map +1 -0
- package/dist/vue3/types/components/hovercard/hovercard.vue.d.ts +686 -11
- package/dist/vue3/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/input/input.vue.d.ts +8 -8
- package/dist/vue3/types/components/input_group/input_group.vue.d.ts +2 -2
- package/dist/vue3/types/components/item_layout/item_layout.vue.d.ts +1 -1
- package/dist/vue3/types/components/keyboard_shortcut/keyboard_shortcut.vue.d.ts +7 -210
- package/dist/vue3/types/components/lazy_show/lazy_show.vue.d.ts +1 -1
- package/dist/vue3/types/components/link/link_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/list_item/list_item.vue.d.ts +3 -3
- package/dist/vue3/types/components/list_item_group/list_item_group.vue.d.ts +6 -6
- package/dist/vue3/types/components/modal/modal.vue.d.ts +16 -16
- package/dist/vue3/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/notice/notice.vue.d.ts +1 -1
- package/dist/vue3/types/components/notice/notice_icon.vue.d.ts +1 -30
- package/dist/vue3/types/components/notice/notice_icon.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/popover/popover.vue.d.ts +26 -26
- package/dist/vue3/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/popover/popover_header_footer.vue.d.ts +3 -3
- package/dist/vue3/types/components/popover/tippy_utils.d.ts +2 -3
- package/dist/vue3/types/components/popover/tippy_utils.d.ts.map +1 -1
- package/dist/vue3/types/components/radio/radio.vue.d.ts +6 -6
- package/dist/vue3/types/components/radio_group/radio_group.vue.d.ts +2 -2
- package/dist/vue3/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +22 -22
- package/dist/vue3/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +22 -22
- package/dist/vue3/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +22 -22
- package/dist/vue3/types/components/rich_text_editor/extensions/slash_command/SlashCommandComponent.vue.d.ts +22 -22
- package/dist/vue3/types/components/rich_text_editor/extensions/slash_command/slash_command.d.ts +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/slash_command/slash_command.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +7 -12
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/root_layout/root_layout.vue.d.ts +15 -15
- package/dist/vue3/types/components/scroller/modules/core_scroller.vue.d.ts +26 -16
- package/dist/vue3/types/components/scroller/modules/core_scroller.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/scroller/modules/scroller_item.vue.d.ts +1 -1
- package/dist/vue3/types/components/scroller/scroller.vue.d.ts +245 -12
- package/dist/vue3/types/components/scroller/scroller.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/select_menu/select_menu.vue.d.ts +13 -13
- package/dist/vue3/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
- package/dist/vue3/types/components/skeleton/skeleton-paragraph.vue.d.ts +3 -3
- package/dist/vue3/types/components/skeleton/skeleton-shape.vue.d.ts +4 -4
- package/dist/vue3/types/components/skeleton/skeleton-text.vue.d.ts +1 -1
- package/dist/vue3/types/components/skeleton/skeleton.vue.d.ts +1 -1
- package/dist/vue3/types/components/skeleton/skeleton_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/split_button/split_button-alpha.vue.d.ts +3 -3
- package/dist/vue3/types/components/split_button/split_button.vue.d.ts +3 -3
- package/dist/vue3/types/components/tab/tab.vue.d.ts +3 -3
- package/dist/vue3/types/components/tab/tab_group.vue.d.ts +3 -3
- package/dist/vue3/types/components/tab/tab_panel.vue.d.ts +3 -3
- package/dist/vue3/types/components/tab/tab_panel.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/toast/layouts/toast_layout_alternate.vue.d.ts +1 -1
- package/dist/vue3/types/components/toast/layouts/toast_layout_alternate_icon.vue.d.ts +1 -30
- package/dist/vue3/types/components/toast/layouts/toast_layout_default.vue.d.ts +1 -1
- package/dist/vue3/types/components/toast/toast.vue.d.ts +4 -4
- package/dist/vue3/types/components/toast/toast_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/toggle/toggle.vue.d.ts +7 -7
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts +10 -10
- package/dist/vue3/types/components/tooltip/tooltip_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/validation_messages/validation_messages.vue.d.ts +0 -1
- package/dist/vue3/types/components/validation_messages/validation_messages.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +7 -7
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +7 -7
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +9 -9
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +1 -30
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node_constants.d.ts.map +1 -1
- package/dist/vue3/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +9 -9
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts +9 -241
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/editor/editor_constants.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +7 -36
- package/dist/vue3/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row_constants.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +22 -22
- package/dist/vue3/types/recipes/conversation_view/message_input/last_active_nodes.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +7 -7
- package/dist/vue3/types/recipes/eslint.config.d.ts +8 -0
- package/dist/vue3/types/recipes/eslint.config.d.ts.map +1 -0
- package/dist/vue3/types/recipes/item_layout/contact_info/contact_info.vue.d.ts +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +1 -30
- package/package.json +7 -6
- package/dist/vue2/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +0 -47
- package/dist/vue2/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts.map +0 -1
- package/dist/vue2/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +0 -47
- package/dist/vue2/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts.map +0 -1
- package/dist/vue2/types/components/rich_text_editor/extensions/slash_command/SlashCommandComponent.vue.d.ts +0 -47
- package/dist/vue2/types/components/rich_text_editor/extensions/slash_command/SlashCommandComponent.vue.d.ts.map +0 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +0 -52
- package/dist/vue2/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-list-navigation.cjs","sources":["../../../common/mixins/keyboard_list_navigation.js"],"sourcesContent":["import Dom from './dom';\n\nconst ERROR_INVALID_LIST_ELEMENT = (\n 'listElementKey is required or the referenced ' +\n 'element doesn\\'t exist. Received listElement: '\n);\n\n/**\n * Usage: `mixins: [keyboardNavigationMixin(options)]`\n *\n * This mixin provides some common data and methods to navigate a list of items\n * (such as a dropdown or select menu) by keyboard.\n *\n * To be effective, you must bind the onUpKey and onDownKey events, usually to\n * the root element of the component.\n *\n * @param listItemRole\n * @param indexKey\n * @param idKey\n * @param listElementKey\n * @param activeItemKey\n * @param openMethod\n * @param afterHighlightMethod\n * @param beginningOfListMethod\n * @param endOfListMethod\n * @param scrollToOnHighlight\n * @param focusOnKeyboardNavigation\n * @displayName Keyboard Navigation Mixin\n */\nexport default ({\n // Role of the list items in the component. This is used to identify the list items\n // so you must update this if the role of your list items is anything other than 'option'\n listItemRole = 'option',\n // Key of the data prop that will be added to the component.\n indexKey = 'highlightIndex',\n idKey = 'highlightId',\n // Key of the method that references the list element.\n listElementKey = 'listRef',\n // Optional, Key of the computed prop that references the currently active item element.\n activeItemKey = '',\n // Optional, name of the method that toggles the list visibility. Used for\n // opening the list when up or down is pressed.\n openMethod = null,\n // Optional, method to call when the highlightIndex is changed.\n afterHighlightMethod = null,\n // Optional, method to call when the highlightIndex goes past the beginning of the list.\n beginningOfListMethod = null,\n // Optional, method to call when the highlightIndex goes past the end of the list.\n endOfListMethod = null,\n // Scroll the active element into view when highlighted by a keyboard event.\n scrollToOnHighlight = true,\n // Focus the active element on keyboard navigation.\n focusOnKeyboardNavigation = false,\n} = {}) => ({\n mixins: [Dom],\n\n data () {\n return {\n [indexKey]: -1,\n [idKey]: '',\n scrollToOnHighlight,\n focusOnKeyboardNavigation,\n };\n },\n\n provide () {\n return {\n highlightId: () => this[idKey],\n };\n },\n\n methods: {\n // Returns the list element\n // this[listElement]() can return a Vue component, in which case we need to target\n // the $el property, or it can simply be an html element.\n _getListElement () {\n return this[listElementKey]()?.$el || this[listElementKey]();\n },\n\n // Gets the length of all the items in the list, uses the listItemRole param to determine\n // whether an element is a list item.\n _itemsLength () {\n const listItems = this._getListItemNodes();\n\n if (listItems === null) {\n return 0;\n }\n\n return listItems.length;\n },\n\n // Gets all the list item nodes within the list element\n _getListItemNodes () {\n const listElement = this._getListElement();\n\n if (!listElement) {\n console.error(ERROR_INVALID_LIST_ELEMENT, listElement);\n return null;\n }\n\n return Array.from(listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`));\n },\n\n onUpKey () {\n if (openMethod) {\n this[openMethod](true);\n }\n if (this[indexKey] > 0) {\n this.setHighlightIndex(this[indexKey] - 1);\n } else if (beginningOfListMethod) {\n this[beginningOfListMethod]();\n }\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onDownKey () {\n if (openMethod) {\n this[openMethod](true);\n }\n if (this[indexKey] < this._itemsLength() - 1) {\n this.setHighlightIndex(this[indexKey] + 1);\n } else if (endOfListMethod) {\n this[endOfListMethod]();\n }\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onHomeKey () {\n this.jumpToBeginning();\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onEndKey () {\n this.jumpToEnd();\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onNavigationKey (key) {\n const listItems = this._getListItemNodes();\n\n const matchingItems = listItems.filter(item => {\n const content = item.textContent.trim().toLowerCase();\n return content.startsWith(key.toLowerCase());\n });\n\n if (matchingItems.length <= 0) {\n return;\n }\n\n const highlightedMatchingItemIndex = matchingItems.findIndex(item => {\n return this[indexKey] === listItems.indexOf(item);\n });\n\n const nextHighlightedItemIndex = listItems.indexOf(\n highlightedMatchingItemIndex < matchingItems.length - 1\n ? matchingItems[highlightedMatchingItemIndex + 1]\n : matchingItems[0],\n );\n\n this.setHighlightIndex(nextHighlightedItemIndex);\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n isValidLetter (key) {\n if (key.length > 1) {\n return false;\n }\n\n return (key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z');\n },\n\n jumpToBeginning () {\n this.setHighlightIndex(0);\n },\n\n jumpToEnd () {\n this.setHighlightIndex(this._itemsLength() - 1);\n },\n\n setHighlightIndex (num) {\n this[indexKey] = num;\n this[idKey] = this._getItemId(num);\n\n if (this._itemsLength() && afterHighlightMethod) {\n this[afterHighlightMethod](num);\n }\n },\n\n setHighlightId (id) {\n this[idKey] = id;\n this[indexKey] = this._getItemIndex(id);\n\n if (this._itemsLength() && afterHighlightMethod) {\n this[afterHighlightMethod](this._getItemIndex(id));\n }\n },\n\n _getItemIndex (id) {\n const listElement = this._getListElement();\n if (!listElement) {\n return;\n }\n\n const listItems = Array.from(listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`));\n return listItems.indexOf(listElement.querySelector(`#${id}`));\n },\n\n _getItemId (index) {\n const listElement = this._getListElement();\n if (!listElement) {\n return;\n }\n\n return listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`)[index]?.id;\n },\n\n scrollActiveItemIntoViewIfNeeded () {\n if (!this.scrollToOnHighlight) {\n return;\n }\n const activeItemEl = this[activeItemKey];\n if (activeItemEl) {\n // When listElementKey is not passed,\n // scrollElementIntoViewIfNeeded will default to the immediate wrapper of the item.\n const listElement = this._getListElement();\n this.scrollElementIntoViewIfNeeded(activeItemEl, null, null, listElement);\n }\n },\n\n focusActiveItemIfNeeded () {\n if (!this.focusOnKeyboardNavigation) {\n return;\n }\n const activeItemEl = this[activeItemKey];\n if (activeItemEl) {\n activeItemEl.focus();\n }\n },\n },\n});\n"],"names":["ERROR_INVALID_LIST_ELEMENT","KeyboardNavigation","listItemRole","indexKey","idKey","listElementKey","activeItemKey","openMethod","afterHighlightMethod","beginningOfListMethod","endOfListMethod","scrollToOnHighlight","focusOnKeyboardNavigation","Dom","_a","listItems","listElement","key","matchingItems","item","highlightedMatchingItemIndex","nextHighlightedItemIndex","num","id","index","activeItemEl"],"mappings":"yIAEMA,EACJ,6FA0BFC,EAAe,CAAC,CAGd,aAAAC,EAAe,SAEf,SAAAC,EAAW,iBACX,MAAAC,EAAQ,cAER,eAAAC,EAAiB,UAEjB,cAAAC,EAAgB,GAGhB,WAAAC,EAAa,KAEb,qBAAAC,EAAuB,KAEvB,sBAAAC,EAAwB,KAExB,gBAAAC,EAAkB,KAElB,oBAAAC,EAAsB,GAEtB,0BAAAC,EAA4B,EAC9B,EAAI,MAAQ,CACV,OAAQ,CAACC,EAAAA,OAAG,EAEZ,MAAQ,CACN,MAAO,CACL,CAACV,CAAQ,EAAG,GACZ,CAACC,CAAK,EAAG,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B,EAAc,CAGhB,MAAMT,EAAc,KAAK,kBACzB,KAAK,8BAA8BS,EAAc,KAAM,KAAMT,CAAW,CACzE,CACF,EAED,yBAA2B,CACzB,GAAI,CAAC,KAAK,0BACR,OAEF,MAAMS,EAAe,KAAKnB,CAAa,EACnCmB,GACFA,EAAa,MAAK,CAErB,CACF,CACH"}
|
|
1
|
+
{"version":3,"file":"keyboard-list-navigation.cjs","sources":["../../../common/mixins/keyboard_list_navigation.js"],"sourcesContent":["import Dom from './dom';\n\nconst ERROR_INVALID_LIST_ELEMENT = (\n 'listElementKey is required or the referenced ' +\n 'element doesn\\'t exist. Received listElement: '\n);\n\n/**\n * Usage: `mixins: [keyboardNavigationMixin(options)]`\n *\n * This mixin provides some common data and methods to navigate a list of items\n * (such as a dropdown or select menu) by keyboard.\n *\n * To be effective, you must bind the onUpKey and onDownKey events, usually to\n * the root element of the component.\n *\n * @param listItemRole\n * @param indexKey\n * @param idKey\n * @param listElementKey\n * @param activeItemKey\n * @param openMethod\n * @param afterHighlightMethod\n * @param beginningOfListMethod\n * @param endOfListMethod\n * @param scrollToOnHighlight\n * @param focusOnKeyboardNavigation\n * @displayName Keyboard Navigation Mixin\n */\nexport default ({\n // Role of the list items in the component. This is used to identify the list items\n // so you must update this if the role of your list items is anything other than 'option'\n listItemRole = 'option',\n // Key of the data prop that will be added to the component.\n indexKey = 'highlightIndex',\n idKey = 'highlightId',\n // Key of the method that references the list element.\n listElementKey = 'listRef',\n // Optional, Key of the computed prop that references the currently active item element.\n activeItemKey = '',\n // Optional, name of the method that toggles the list visibility. Used for\n // opening the list when up or down is pressed.\n openMethod = null,\n // Optional, method to call when the highlightIndex is changed.\n afterHighlightMethod = null,\n // Optional, method to call when the highlightIndex goes past the beginning of the list.\n beginningOfListMethod = null,\n // Optional, method to call when the highlightIndex goes past the end of the list.\n endOfListMethod = null,\n // Scroll the active element into view when highlighted by a keyboard event.\n scrollToOnHighlight = true,\n // Focus the active element on keyboard navigation.\n focusOnKeyboardNavigation = false,\n} = {}) => ({\n mixins: [Dom],\n\n data () {\n return {\n [indexKey]: -1,\n [idKey]: '',\n scrollToOnHighlight,\n focusOnKeyboardNavigation,\n };\n },\n\n provide () {\n return {\n highlightId: () => this[idKey],\n };\n },\n\n methods: {\n // Returns the list element\n // this[listElement]() can return a Vue component, in which case we need to target\n // the $el property, or it can simply be an html element.\n _getListElement () {\n return this[listElementKey]()?.$el || this[listElementKey]();\n },\n\n // Gets the length of all the items in the list, uses the listItemRole param to determine\n // whether an element is a list item.\n _itemsLength () {\n const listItems = this._getListItemNodes();\n\n if (listItems === null) {\n return 0;\n }\n\n return listItems.length;\n },\n\n // Gets all the list item nodes within the list element\n _getListItemNodes () {\n const listElement = this._getListElement();\n\n if (!listElement) {\n console.error(ERROR_INVALID_LIST_ELEMENT, listElement);\n return null;\n }\n\n return Array.from(listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`));\n },\n\n onUpKey () {\n if (openMethod) {\n this[openMethod](true);\n }\n if (this[indexKey] > 0) {\n this.setHighlightIndex(this[indexKey] - 1);\n } else if (beginningOfListMethod) {\n this[beginningOfListMethod]();\n }\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onDownKey () {\n if (openMethod) {\n this[openMethod](true);\n }\n if (this[indexKey] < this._itemsLength() - 1) {\n this.setHighlightIndex(this[indexKey] + 1);\n } else if (endOfListMethod) {\n this[endOfListMethod]();\n }\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onHomeKey () {\n this.jumpToBeginning();\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onEndKey () {\n this.jumpToEnd();\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onNavigationKey (key) {\n const listItems = this._getListItemNodes();\n\n const matchingItems = listItems.filter(item => {\n const content = item.textContent.trim().toLowerCase();\n return content.startsWith(key.toLowerCase());\n });\n\n if (matchingItems.length <= 0) {\n return;\n }\n\n const highlightedMatchingItemIndex = matchingItems.findIndex(item => {\n return this[indexKey] === listItems.indexOf(item);\n });\n\n const nextHighlightedItemIndex = listItems.indexOf(\n highlightedMatchingItemIndex < matchingItems.length - 1\n ? matchingItems[highlightedMatchingItemIndex + 1]\n : matchingItems[0],\n );\n\n this.setHighlightIndex(nextHighlightedItemIndex);\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n isValidLetter (key) {\n if (key.length > 1) {\n return false;\n }\n\n return (key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z');\n },\n\n jumpToBeginning () {\n this.setHighlightIndex(0);\n },\n\n jumpToEnd () {\n this.setHighlightIndex(this._itemsLength() - 1);\n },\n\n setHighlightIndex (num) {\n this[indexKey] = num;\n this[idKey] = this._getItemId(num);\n\n if (this._itemsLength() && afterHighlightMethod) {\n this[afterHighlightMethod](num);\n }\n },\n\n setHighlightId (id) {\n this[idKey] = id;\n this[indexKey] = this._getItemIndex(id);\n\n if (this._itemsLength() && afterHighlightMethod) {\n this[afterHighlightMethod](this._getItemIndex(id));\n }\n },\n\n _getItemIndex (id) {\n const listElement = this._getListElement();\n if (!listElement) {\n return;\n }\n\n const listItems = Array.from(listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`));\n return listItems.indexOf(listElement.querySelector(`#${id}`));\n },\n\n _getItemId (index) {\n const listElement = this._getListElement();\n if (!listElement) {\n return;\n }\n\n return listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`)[index]?.id;\n },\n\n scrollActiveItemIntoViewIfNeeded () {\n if (!this.scrollToOnHighlight) {\n return;\n }\n const activeItemEl = this[activeItemKey];\n if (activeItemEl) {\n // When listElementKey is not passed,\n // scrollElementIntoViewIfNeeded will default to the immediate wrapper of the item.\n const listElement = this._getListElement();\n this.scrollElementIntoViewIfNeeded(activeItemEl, null, null, listElement);\n }\n },\n\n focusActiveItemIfNeeded () {\n if (!this.focusOnKeyboardNavigation) {\n return;\n }\n const activeItemEl = this[activeItemKey];\n if (activeItemEl) {\n activeItemEl.focus();\n }\n },\n },\n});\n"],"names":["ERROR_INVALID_LIST_ELEMENT","KeyboardNavigation","listItemRole","indexKey","idKey","listElementKey","activeItemKey","openMethod","afterHighlightMethod","beginningOfListMethod","endOfListMethod","scrollToOnHighlight","focusOnKeyboardNavigation","Dom","_a","listItems","listElement","key","matchingItems","item","highlightedMatchingItemIndex","nextHighlightedItemIndex","num","id","index","activeItemEl"],"mappings":"yIAEMA,EACJ,6FA0BFC,EAAe,CAAC,CAGd,aAAAC,EAAe,SAEf,SAAAC,EAAW,iBACX,MAAAC,EAAQ,cAER,eAAAC,EAAiB,UAEjB,cAAAC,EAAgB,GAGhB,WAAAC,EAAa,KAEb,qBAAAC,EAAuB,KAEvB,sBAAAC,EAAwB,KAExB,gBAAAC,EAAkB,KAElB,oBAAAC,EAAsB,GAEtB,0BAAAC,EAA4B,EAC9B,EAAI,MAAQ,CACV,OAAQ,CAACC,EAAAA,OAAG,EAEZ,MAAQ,CACN,MAAO,CACL,CAACV,CAAQ,EAAG,GACZ,CAACC,CAAK,EAAG,GACT,oBAAAO,EACA,0BAAAC,CACN,CACE,EAEA,SAAW,CACT,MAAO,CACL,YAAa,IAAM,KAAKR,CAAK,CACnC,CACE,EAEA,QAAS,CAIP,iBAAmB,OACjB,QAAOU,EAAA,KAAKT,CAAc,EAAC,IAApB,YAAAS,EAAwB,MAAO,KAAKT,CAAc,EAAC,CAC5D,EAIA,cAAgB,CACd,MAAMU,EAAY,KAAK,kBAAiB,EAExC,OAAIA,IAAc,KACT,EAGFA,EAAU,MACnB,EAGA,mBAAqB,CACnB,MAAMC,EAAc,KAAK,gBAAe,EAExC,OAAKA,EAKE,MAAM,KAAKA,EAAY,iBAAiB,UAAUd,CAAY,2BAA2B,CAAC,GAJ/F,QAAQ,MAAMF,EAA4BgB,CAAW,EAC9C,KAIX,EAEA,SAA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AY,EAAK,CAAC,CAChD,EAEA,kBAAmBK,EAAK,CACtB,KAAKnB,CAAQ,EAAImB,EACjB,KAAKlB,CAAK,EAAI,KAAK,WAAWkB,CAAG,EAE7B,KAAK,aAAY,GAAMd,GACzB,KAAKA,CAAoB,EAAEc,CAAG,CAElC,EAEA,eAAgBC,EAAI,CAClB,KAAKnB,CAAK,EAAImB,EACd,KAAKpB,CAAQ,EAAI,KAAK,cAAcoB,CAAE,EAElC,KAAK,aAAY,GAAMf,GACzB,KAAKA,CAAoB,EAAE,KAAK,cAAce,CAAE,CAAC,CAErD,EAEA,cAAeA,EAAI,CACjB,MAAMP,EAAc,KAAK,gBAAe,EACxC,OAAKA,EAIa,MAAM,KAAKA,EAAY,iBAAiB,UAAUd,CAAY,2BAA2B,CAAC,EAC3F,QAAQc,EAAY,cAAc,IAAIO,CAAE,EAAE,CAAC,EAJ1D,MAKJ,EAEA,WAAYC,EAAO,OACjB,MAAMR,EAAc,KAAK,gBAAe,EACxC,GAAKA,EAIL,OAAOF,EAAAE,EAAY,iBAAiB,UAAUd,CAAY,2BAA2B,EAAEsB,CAAK,IAArF,YAAAV,EAAwF,EACjG,EAEA,kCAAoC,CAClC,GAAI,CAAC,KAAK,oBACR,OAEF,MAAMW,EAAe,KAAKnB,CAAa,EACvC,GAAImB,EAAc,CAGhB,MAAMT,EAAc,KAAK,gBAAe,EACxC,KAAK,8BAA8BS,EAAc,KAAM,KAAMT,CAAW,CAC1E,CACF,EAEA,yBAA2B,CACzB,GAAI,CAAC,KAAK,0BACR,OAEF,MAAMS,EAAe,KAAKnB,CAAa,EACnCmB,GACFA,EAAa,MAAK,CAEtB,CACJ,CACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-list-navigation.js","sources":["../../../common/mixins/keyboard_list_navigation.js"],"sourcesContent":["import Dom from './dom';\n\nconst ERROR_INVALID_LIST_ELEMENT = (\n 'listElementKey is required or the referenced ' +\n 'element doesn\\'t exist. Received listElement: '\n);\n\n/**\n * Usage: `mixins: [keyboardNavigationMixin(options)]`\n *\n * This mixin provides some common data and methods to navigate a list of items\n * (such as a dropdown or select menu) by keyboard.\n *\n * To be effective, you must bind the onUpKey and onDownKey events, usually to\n * the root element of the component.\n *\n * @param listItemRole\n * @param indexKey\n * @param idKey\n * @param listElementKey\n * @param activeItemKey\n * @param openMethod\n * @param afterHighlightMethod\n * @param beginningOfListMethod\n * @param endOfListMethod\n * @param scrollToOnHighlight\n * @param focusOnKeyboardNavigation\n * @displayName Keyboard Navigation Mixin\n */\nexport default ({\n // Role of the list items in the component. This is used to identify the list items\n // so you must update this if the role of your list items is anything other than 'option'\n listItemRole = 'option',\n // Key of the data prop that will be added to the component.\n indexKey = 'highlightIndex',\n idKey = 'highlightId',\n // Key of the method that references the list element.\n listElementKey = 'listRef',\n // Optional, Key of the computed prop that references the currently active item element.\n activeItemKey = '',\n // Optional, name of the method that toggles the list visibility. Used for\n // opening the list when up or down is pressed.\n openMethod = null,\n // Optional, method to call when the highlightIndex is changed.\n afterHighlightMethod = null,\n // Optional, method to call when the highlightIndex goes past the beginning of the list.\n beginningOfListMethod = null,\n // Optional, method to call when the highlightIndex goes past the end of the list.\n endOfListMethod = null,\n // Scroll the active element into view when highlighted by a keyboard event.\n scrollToOnHighlight = true,\n // Focus the active element on keyboard navigation.\n focusOnKeyboardNavigation = false,\n} = {}) => ({\n mixins: [Dom],\n\n data () {\n return {\n [indexKey]: -1,\n [idKey]: '',\n scrollToOnHighlight,\n focusOnKeyboardNavigation,\n };\n },\n\n provide () {\n return {\n highlightId: () => this[idKey],\n };\n },\n\n methods: {\n // Returns the list element\n // this[listElement]() can return a Vue component, in which case we need to target\n // the $el property, or it can simply be an html element.\n _getListElement () {\n return this[listElementKey]()?.$el || this[listElementKey]();\n },\n\n // Gets the length of all the items in the list, uses the listItemRole param to determine\n // whether an element is a list item.\n _itemsLength () {\n const listItems = this._getListItemNodes();\n\n if (listItems === null) {\n return 0;\n }\n\n return listItems.length;\n },\n\n // Gets all the list item nodes within the list element\n _getListItemNodes () {\n const listElement = this._getListElement();\n\n if (!listElement) {\n console.error(ERROR_INVALID_LIST_ELEMENT, listElement);\n return null;\n }\n\n return Array.from(listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`));\n },\n\n onUpKey () {\n if (openMethod) {\n this[openMethod](true);\n }\n if (this[indexKey] > 0) {\n this.setHighlightIndex(this[indexKey] - 1);\n } else if (beginningOfListMethod) {\n this[beginningOfListMethod]();\n }\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onDownKey () {\n if (openMethod) {\n this[openMethod](true);\n }\n if (this[indexKey] < this._itemsLength() - 1) {\n this.setHighlightIndex(this[indexKey] + 1);\n } else if (endOfListMethod) {\n this[endOfListMethod]();\n }\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onHomeKey () {\n this.jumpToBeginning();\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onEndKey () {\n this.jumpToEnd();\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onNavigationKey (key) {\n const listItems = this._getListItemNodes();\n\n const matchingItems = listItems.filter(item => {\n const content = item.textContent.trim().toLowerCase();\n return content.startsWith(key.toLowerCase());\n });\n\n if (matchingItems.length <= 0) {\n return;\n }\n\n const highlightedMatchingItemIndex = matchingItems.findIndex(item => {\n return this[indexKey] === listItems.indexOf(item);\n });\n\n const nextHighlightedItemIndex = listItems.indexOf(\n highlightedMatchingItemIndex < matchingItems.length - 1\n ? matchingItems[highlightedMatchingItemIndex + 1]\n : matchingItems[0],\n );\n\n this.setHighlightIndex(nextHighlightedItemIndex);\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n isValidLetter (key) {\n if (key.length > 1) {\n return false;\n }\n\n return (key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z');\n },\n\n jumpToBeginning () {\n this.setHighlightIndex(0);\n },\n\n jumpToEnd () {\n this.setHighlightIndex(this._itemsLength() - 1);\n },\n\n setHighlightIndex (num) {\n this[indexKey] = num;\n this[idKey] = this._getItemId(num);\n\n if (this._itemsLength() && afterHighlightMethod) {\n this[afterHighlightMethod](num);\n }\n },\n\n setHighlightId (id) {\n this[idKey] = id;\n this[indexKey] = this._getItemIndex(id);\n\n if (this._itemsLength() && afterHighlightMethod) {\n this[afterHighlightMethod](this._getItemIndex(id));\n }\n },\n\n _getItemIndex (id) {\n const listElement = this._getListElement();\n if (!listElement) {\n return;\n }\n\n const listItems = Array.from(listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`));\n return listItems.indexOf(listElement.querySelector(`#${id}`));\n },\n\n _getItemId (index) {\n const listElement = this._getListElement();\n if (!listElement) {\n return;\n }\n\n return listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`)[index]?.id;\n },\n\n scrollActiveItemIntoViewIfNeeded () {\n if (!this.scrollToOnHighlight) {\n return;\n }\n const activeItemEl = this[activeItemKey];\n if (activeItemEl) {\n // When listElementKey is not passed,\n // scrollElementIntoViewIfNeeded will default to the immediate wrapper of the item.\n const listElement = this._getListElement();\n this.scrollElementIntoViewIfNeeded(activeItemEl, null, null, listElement);\n }\n },\n\n focusActiveItemIfNeeded () {\n if (!this.focusOnKeyboardNavigation) {\n return;\n }\n const activeItemEl = this[activeItemKey];\n if (activeItemEl) {\n activeItemEl.focus();\n }\n },\n },\n});\n"],"names":["ERROR_INVALID_LIST_ELEMENT","KeyboardNavigation","listItemRole","indexKey","idKey","listElementKey","activeItemKey","openMethod","afterHighlightMethod","beginningOfListMethod","endOfListMethod","scrollToOnHighlight","focusOnKeyboardNavigation","Dom","_a","listItems","listElement","key","matchingItems","item","highlightedMatchingItemIndex","nextHighlightedItemIndex","num","id","index","activeItemEl"],"mappings":";AAEA,MAAMA,IACJ,8FA0BFC,IAAe,CAAC;AAA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AED,kBAAmBK,GAAK;AACtB,WAAKnB,CAAQ,IAAImB,GACjB,KAAKlB,CAAK,IAAI,KAAK,WAAWkB,CAAG,GAE7B,KAAK,aAAc,KAAId,KACzB,KAAKA,CAAoB,EAAEc,CAAG;AAAA,IAEjC;AAAA,IAED,eAAgBC,GAAI;AAClB,WAAKnB,CAAK,IAAImB,GACd,KAAKpB,CAAQ,IAAI,KAAK,cAAcoB,CAAE,GAElC,KAAK,aAAc,KAAIf,KACzB,KAAKA,CAAoB,EAAE,KAAK,cAAce,CAAE,CAAC;AAAA,IAEpD;AAAA,IAED,cAAeA,GAAI;AACjB,YAAMP,IAAc,KAAK;AACzB,aAAKA,IAIa,MAAM,KAAKA,EAAY,iBAAiB,UAAUd,CAAY,2BAA2B,CAAC,EAC3F,QAAQc,EAAY,cAAc,IAAIO,CAAE,EAAE,CAAC,IAJ1D;AAAA,IAKH;AAAA,IAED,WAAYC,GAAO;;AACjB,YAAMR,IAAc,KAAK;AACzB,UAAKA;AAIL,gBAAOF,IAAAE,EAAY,iBAAiB,UAAUd,CAAY,2BAA2B,EAAEsB,CAAK,MAArF,gBAAAV,EAAwF;AAAA,IAChG;AAAA,IAED,mCAAoC;AAClC,UAAI,CAAC,KAAK;AACR;AAEF,YAAMW,IAAe,KAAKnB,CAAa;AACvC,UAAImB,GAAc;AAGhB,cAAMT,IAAc,KAAK;AACzB,aAAK,8BAA8BS,GAAc,MAAM,MAAMT,CAAW;AAAA,MACzE;AAAA,IACF;AAAA,IAED,0BAA2B;AACzB,UAAI,CAAC,KAAK;AACR;AAEF,YAAMS,IAAe,KAAKnB,CAAa;AACvC,MAAImB,KACFA,EAAa,MAAK;AAAA,IAErB;AAAA,EACF;AACH;"}
|
|
1
|
+
{"version":3,"file":"keyboard-list-navigation.js","sources":["../../../common/mixins/keyboard_list_navigation.js"],"sourcesContent":["import Dom from './dom';\n\nconst ERROR_INVALID_LIST_ELEMENT = (\n 'listElementKey is required or the referenced ' +\n 'element doesn\\'t exist. Received listElement: '\n);\n\n/**\n * Usage: `mixins: [keyboardNavigationMixin(options)]`\n *\n * This mixin provides some common data and methods to navigate a list of items\n * (such as a dropdown or select menu) by keyboard.\n *\n * To be effective, you must bind the onUpKey and onDownKey events, usually to\n * the root element of the component.\n *\n * @param listItemRole\n * @param indexKey\n * @param idKey\n * @param listElementKey\n * @param activeItemKey\n * @param openMethod\n * @param afterHighlightMethod\n * @param beginningOfListMethod\n * @param endOfListMethod\n * @param scrollToOnHighlight\n * @param focusOnKeyboardNavigation\n * @displayName Keyboard Navigation Mixin\n */\nexport default ({\n // Role of the list items in the component. This is used to identify the list items\n // so you must update this if the role of your list items is anything other than 'option'\n listItemRole = 'option',\n // Key of the data prop that will be added to the component.\n indexKey = 'highlightIndex',\n idKey = 'highlightId',\n // Key of the method that references the list element.\n listElementKey = 'listRef',\n // Optional, Key of the computed prop that references the currently active item element.\n activeItemKey = '',\n // Optional, name of the method that toggles the list visibility. Used for\n // opening the list when up or down is pressed.\n openMethod = null,\n // Optional, method to call when the highlightIndex is changed.\n afterHighlightMethod = null,\n // Optional, method to call when the highlightIndex goes past the beginning of the list.\n beginningOfListMethod = null,\n // Optional, method to call when the highlightIndex goes past the end of the list.\n endOfListMethod = null,\n // Scroll the active element into view when highlighted by a keyboard event.\n scrollToOnHighlight = true,\n // Focus the active element on keyboard navigation.\n focusOnKeyboardNavigation = false,\n} = {}) => ({\n mixins: [Dom],\n\n data () {\n return {\n [indexKey]: -1,\n [idKey]: '',\n scrollToOnHighlight,\n focusOnKeyboardNavigation,\n };\n },\n\n provide () {\n return {\n highlightId: () => this[idKey],\n };\n },\n\n methods: {\n // Returns the list element\n // this[listElement]() can return a Vue component, in which case we need to target\n // the $el property, or it can simply be an html element.\n _getListElement () {\n return this[listElementKey]()?.$el || this[listElementKey]();\n },\n\n // Gets the length of all the items in the list, uses the listItemRole param to determine\n // whether an element is a list item.\n _itemsLength () {\n const listItems = this._getListItemNodes();\n\n if (listItems === null) {\n return 0;\n }\n\n return listItems.length;\n },\n\n // Gets all the list item nodes within the list element\n _getListItemNodes () {\n const listElement = this._getListElement();\n\n if (!listElement) {\n console.error(ERROR_INVALID_LIST_ELEMENT, listElement);\n return null;\n }\n\n return Array.from(listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`));\n },\n\n onUpKey () {\n if (openMethod) {\n this[openMethod](true);\n }\n if (this[indexKey] > 0) {\n this.setHighlightIndex(this[indexKey] - 1);\n } else if (beginningOfListMethod) {\n this[beginningOfListMethod]();\n }\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onDownKey () {\n if (openMethod) {\n this[openMethod](true);\n }\n if (this[indexKey] < this._itemsLength() - 1) {\n this.setHighlightIndex(this[indexKey] + 1);\n } else if (endOfListMethod) {\n this[endOfListMethod]();\n }\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onHomeKey () {\n this.jumpToBeginning();\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onEndKey () {\n this.jumpToEnd();\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n onNavigationKey (key) {\n const listItems = this._getListItemNodes();\n\n const matchingItems = listItems.filter(item => {\n const content = item.textContent.trim().toLowerCase();\n return content.startsWith(key.toLowerCase());\n });\n\n if (matchingItems.length <= 0) {\n return;\n }\n\n const highlightedMatchingItemIndex = matchingItems.findIndex(item => {\n return this[indexKey] === listItems.indexOf(item);\n });\n\n const nextHighlightedItemIndex = listItems.indexOf(\n highlightedMatchingItemIndex < matchingItems.length - 1\n ? matchingItems[highlightedMatchingItemIndex + 1]\n : matchingItems[0],\n );\n\n this.setHighlightIndex(nextHighlightedItemIndex);\n this.scrollActiveItemIntoViewIfNeeded();\n this.focusActiveItemIfNeeded();\n },\n\n isValidLetter (key) {\n if (key.length > 1) {\n return false;\n }\n\n return (key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z');\n },\n\n jumpToBeginning () {\n this.setHighlightIndex(0);\n },\n\n jumpToEnd () {\n this.setHighlightIndex(this._itemsLength() - 1);\n },\n\n setHighlightIndex (num) {\n this[indexKey] = num;\n this[idKey] = this._getItemId(num);\n\n if (this._itemsLength() && afterHighlightMethod) {\n this[afterHighlightMethod](num);\n }\n },\n\n setHighlightId (id) {\n this[idKey] = id;\n this[indexKey] = this._getItemIndex(id);\n\n if (this._itemsLength() && afterHighlightMethod) {\n this[afterHighlightMethod](this._getItemIndex(id));\n }\n },\n\n _getItemIndex (id) {\n const listElement = this._getListElement();\n if (!listElement) {\n return;\n }\n\n const listItems = Array.from(listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`));\n return listItems.indexOf(listElement.querySelector(`#${id}`));\n },\n\n _getItemId (index) {\n const listElement = this._getListElement();\n if (!listElement) {\n return;\n }\n\n return listElement.querySelectorAll(`[role=\"${listItemRole}\"], #sr-only-close-button`)[index]?.id;\n },\n\n scrollActiveItemIntoViewIfNeeded () {\n if (!this.scrollToOnHighlight) {\n return;\n }\n const activeItemEl = this[activeItemKey];\n if (activeItemEl) {\n // When listElementKey is not passed,\n // scrollElementIntoViewIfNeeded will default to the immediate wrapper of the item.\n const listElement = this._getListElement();\n this.scrollElementIntoViewIfNeeded(activeItemEl, null, null, listElement);\n }\n },\n\n focusActiveItemIfNeeded () {\n if (!this.focusOnKeyboardNavigation) {\n return;\n }\n const activeItemEl = this[activeItemKey];\n if (activeItemEl) {\n activeItemEl.focus();\n }\n },\n },\n});\n"],"names":["ERROR_INVALID_LIST_ELEMENT","KeyboardNavigation","listItemRole","indexKey","idKey","listElementKey","activeItemKey","openMethod","afterHighlightMethod","beginningOfListMethod","endOfListMethod","scrollToOnHighlight","focusOnKeyboardNavigation","Dom","_a","listItems","listElement","key","matchingItems","item","highlightedMatchingItemIndex","nextHighlightedItemIndex","num","id","index","activeItemEl"],"mappings":";AAEA,MAAMA,IACJ,8FA0BFC,IAAe,C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.js"],"sourcesContent":["const focusableAttrs = ':not(:disabled):not([aria-disabled=\"true\"]):not([role=\"presentation\"])';\nconst tabbableAttrs = `${focusableAttrs}:not([tabindex=\"-1\"])`;\nconst focusableElementsList = `button,[href],input,select,textarea,details,[tabindex]`;\n\n/**\n * This mixin provides the methods to automatically trap tab focus within\n * the component this mixin is on, meaning it is not possible to tab out\n * of the component without dismissing it.\n *\n * Useful for accessibility reasons on things like important actionable alerts.\n *\n * Use focusFirstElement to focus on the first tabbable element within your component, and call\n * focusTrappedTabPress every time tab is pressed to trap tab within this\n * component.\n *\n * Note that focusFirstElement WILL focus elements with tabindex=\"-1\",\n * however focusTrappedTabPress will not.\n * @displayName Modal Mixin\n */\nexport default {\n methods: {\n /**\n * get the first focusable element in your component, includes tabindex=\"-1\".\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n async getFirstFocusableElement (el) {\n await this.$nextTick();\n const focusableElements = this._getFocusableElements(el, true);\n return this._getFirstFocusElement(focusableElements);\n },\n\n /**\n * set focus to the first focusable element in your component, includes tabindex=\"-1\".\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n async focusFirstElement (el = this.$el) {\n const elToFocus = await this.getFirstFocusableElement(el);\n elToFocus?.focus({ preventScroll: true });\n },\n\n async focusElementById (elementId) {\n await this.$nextTick();\n const result = this.$el?.querySelector(elementId);\n if (result) {\n result.focus();\n return;\n }\n\n // eslint-disable-next-line no-console\n console.warn('Could not find the element specified in dt-modal prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the first element.');\n await this.focusFirstElement();\n },\n\n /**\n * internal use only.\n *\n * @param focusableElements - list of focusable elements\n * @returns {*} - first DOM element that is focusable.\n * @private\n */\n _getFirstFocusElement (focusableElements) {\n if (!focusableElements.length) {\n return;\n }\n let firstFocusEl = focusableElements[0];\n // If first element is a checkbox, put focus on the selected checkbox or the first checkbox if none are selected.\n if (firstFocusEl.matches('[type=\"radio\"]:not(:checked)')) {\n firstFocusEl = focusableElements.find(el => el.checked && el.name === firstFocusEl.name) || firstFocusEl;\n }\n return firstFocusEl;\n },\n\n /**\n * internal use only.\n *\n * gets all the focusable elements within the component\n * and sets the first and last of those elements.\n *\n * @param {object} el - the root dom element to find focusable elements in.\n * @param {bool} includeNegativeTabIndex - will include tabindex=\"-1\" in the list of focusable elements.\n */\n _getFocusableElements (el = this.$el, includeNegativeTabIndex = false) {\n if (!el) return [];\n const focusableContent = [...el.querySelectorAll(focusableElementsList)];\n return focusableContent.filter((fc) => {\n const style = window.getComputedStyle(fc);\n return style.getPropertyValue('display') !== 'none' &&\n style.getPropertyValue('visibility') !== 'hidden' &&\n fc.matches(includeNegativeTabIndex ? focusableAttrs : tabbableAttrs);\n });\n },\n\n /**\n * tabs to the next element contained within your component, does not include tabindex=\"-1\".\n * @param {object} e - keypress event\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n focusTrappedTabPress (e, el) {\n const isTabPressed = e.key === 'Tab';\n\n if (!isTabPressed) {\n return;\n }\n\n const focusableElements = this._getFocusableElements(el);\n if (!focusableElements.length) {\n e.preventDefault();\n return;\n }\n\n const firstFocusableElement = this._getFirstFocusElement(focusableElements);\n const lastFocusableElement = focusableElements[focusableElements.length - 1];\n\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableElement) {\n lastFocusableElement.focus();\n e.preventDefault();\n }\n } else {\n if (document.activeElement === lastFocusableElement) {\n firstFocusableElement.focus();\n e.preventDefault();\n }\n }\n },\n },\n};\n"],"names":["focusableAttrs","tabbableAttrs","focusableElementsList","Modal","el","focusableElements","elToFocus","elementId","result","_a","firstFocusEl","includeNegativeTabIndex","fc","style","firstFocusableElement","lastFocusableElement"],"mappings":"4GAAA,MAAMA,EAAiB,yEACjBC,EAAgB,GAAGD,CAAc,wBACjCE,EAAwB,
|
|
1
|
+
{"version":3,"file":"modal.cjs","sources":["../../../common/mixins/modal.js"],"sourcesContent":["const focusableAttrs = ':not(:disabled):not([aria-disabled=\"true\"]):not([role=\"presentation\"])';\nconst tabbableAttrs = `${focusableAttrs}:not([tabindex=\"-1\"])`;\nconst focusableElementsList = `button,[href],input,select,textarea,details,[tabindex]`;\n\n/**\n * This mixin provides the methods to automatically trap tab focus within\n * the component this mixin is on, meaning it is not possible to tab out\n * of the component without dismissing it.\n *\n * Useful for accessibility reasons on things like important actionable alerts.\n *\n * Use focusFirstElement to focus on the first tabbable element within your component, and call\n * focusTrappedTabPress every time tab is pressed to trap tab within this\n * component.\n *\n * Note that focusFirstElement WILL focus elements with tabindex=\"-1\",\n * however focusTrappedTabPress will not.\n * @displayName Modal Mixin\n */\nexport default {\n methods: {\n /**\n * get the first focusable element in your component, includes tabindex=\"-1\".\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n async getFirstFocusableElement (el) {\n await this.$nextTick();\n const focusableElements = this._getFocusableElements(el, true);\n return this._getFirstFocusElement(focusableElements);\n },\n\n /**\n * set focus to the first focusable element in your component, includes tabindex=\"-1\".\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n async focusFirstElement (el = this.$el) {\n const elToFocus = await this.getFirstFocusableElement(el);\n elToFocus?.focus({ preventScroll: true });\n },\n\n async focusElementById (elementId) {\n await this.$nextTick();\n const result = this.$el?.querySelector(elementId);\n if (result) {\n result.focus();\n return;\n }\n\n // eslint-disable-next-line no-console\n console.warn('Could not find the element specified in dt-modal prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the first element.');\n await this.focusFirstElement();\n },\n\n /**\n * internal use only.\n *\n * @param focusableElements - list of focusable elements\n * @returns {*} - first DOM element that is focusable.\n * @private\n */\n _getFirstFocusElement (focusableElements) {\n if (!focusableElements.length) {\n return;\n }\n let firstFocusEl = focusableElements[0];\n // If first element is a checkbox, put focus on the selected checkbox or the first checkbox if none are selected.\n if (firstFocusEl.matches('[type=\"radio\"]:not(:checked)')) {\n firstFocusEl = focusableElements.find(el => el.checked && el.name === firstFocusEl.name) || firstFocusEl;\n }\n return firstFocusEl;\n },\n\n /**\n * internal use only.\n *\n * gets all the focusable elements within the component\n * and sets the first and last of those elements.\n *\n * @param {object} el - the root dom element to find focusable elements in.\n * @param {bool} includeNegativeTabIndex - will include tabindex=\"-1\" in the list of focusable elements.\n */\n _getFocusableElements (el = this.$el, includeNegativeTabIndex = false) {\n if (!el) return [];\n const focusableContent = [...el.querySelectorAll(focusableElementsList)];\n return focusableContent.filter((fc) => {\n const style = window.getComputedStyle(fc);\n return style.getPropertyValue('display') !== 'none' &&\n style.getPropertyValue('visibility') !== 'hidden' &&\n fc.matches(includeNegativeTabIndex ? focusableAttrs : tabbableAttrs);\n });\n },\n\n /**\n * tabs to the next element contained within your component, does not include tabindex=\"-1\".\n * @param {object} e - keypress event\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n focusTrappedTabPress (e, el) {\n const isTabPressed = e.key === 'Tab';\n\n if (!isTabPressed) {\n return;\n }\n\n const focusableElements = this._getFocusableElements(el);\n if (!focusableElements.length) {\n e.preventDefault();\n return;\n }\n\n const firstFocusableElement = this._getFirstFocusElement(focusableElements);\n const lastFocusableElement = focusableElements[focusableElements.length - 1];\n\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableElement) {\n lastFocusableElement.focus();\n e.preventDefault();\n }\n } else {\n if (document.activeElement === lastFocusableElement) {\n firstFocusableElement.focus();\n e.preventDefault();\n }\n }\n },\n },\n};\n"],"names":["focusableAttrs","tabbableAttrs","focusableElementsList","Modal","el","focusableElements","elToFocus","elementId","result","_a","firstFocusEl","includeNegativeTabIndex","fc","style","firstFocusableElement","lastFocusableElement"],"mappings":"4GAAA,MAAMA,EAAiB,yEACjBC,EAAgB,GAAGD,CAAc,wBACjCE,EAAwB,yDAiB9BC,EAAe,CACb,QAAS,CAMP,MAAM,yBAA0BC,EAAI,CAClC,MAAM,KAAK,UAAS,EACpB,MAAMC,EAAoB,KAAK,sBAAsBD,EAAI,EAAI,E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S,IAC7BC,EAAqB,MAAK,EAC1B,EAAE,eAAc,GAGd,SAAS,gBAAkBA,IAC7BD,EAAsB,MAAK,EAC3B,EAAE,eAAc,EAGtB,CACJ,CACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sources":["../../../common/mixins/modal.js"],"sourcesContent":["const focusableAttrs = ':not(:disabled):not([aria-disabled=\"true\"]):not([role=\"presentation\"])';\nconst tabbableAttrs = `${focusableAttrs}:not([tabindex=\"-1\"])`;\nconst focusableElementsList = `button,[href],input,select,textarea,details,[tabindex]`;\n\n/**\n * This mixin provides the methods to automatically trap tab focus within\n * the component this mixin is on, meaning it is not possible to tab out\n * of the component without dismissing it.\n *\n * Useful for accessibility reasons on things like important actionable alerts.\n *\n * Use focusFirstElement to focus on the first tabbable element within your component, and call\n * focusTrappedTabPress every time tab is pressed to trap tab within this\n * component.\n *\n * Note that focusFirstElement WILL focus elements with tabindex=\"-1\",\n * however focusTrappedTabPress will not.\n * @displayName Modal Mixin\n */\nexport default {\n methods: {\n /**\n * get the first focusable element in your component, includes tabindex=\"-1\".\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n async getFirstFocusableElement (el) {\n await this.$nextTick();\n const focusableElements = this._getFocusableElements(el, true);\n return this._getFirstFocusElement(focusableElements);\n },\n\n /**\n * set focus to the first focusable element in your component, includes tabindex=\"-1\".\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n async focusFirstElement (el = this.$el) {\n const elToFocus = await this.getFirstFocusableElement(el);\n elToFocus?.focus({ preventScroll: true });\n },\n\n async focusElementById (elementId) {\n await this.$nextTick();\n const result = this.$el?.querySelector(elementId);\n if (result) {\n result.focus();\n return;\n }\n\n // eslint-disable-next-line no-console\n console.warn('Could not find the element specified in dt-modal prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the first element.');\n await this.focusFirstElement();\n },\n\n /**\n * internal use only.\n *\n * @param focusableElements - list of focusable elements\n * @returns {*} - first DOM element that is focusable.\n * @private\n */\n _getFirstFocusElement (focusableElements) {\n if (!focusableElements.length) {\n return;\n }\n let firstFocusEl = focusableElements[0];\n // If first element is a checkbox, put focus on the selected checkbox or the first checkbox if none are selected.\n if (firstFocusEl.matches('[type=\"radio\"]:not(:checked)')) {\n firstFocusEl = focusableElements.find(el => el.checked && el.name === firstFocusEl.name) || firstFocusEl;\n }\n return firstFocusEl;\n },\n\n /**\n * internal use only.\n *\n * gets all the focusable elements within the component\n * and sets the first and last of those elements.\n *\n * @param {object} el - the root dom element to find focusable elements in.\n * @param {bool} includeNegativeTabIndex - will include tabindex=\"-1\" in the list of focusable elements.\n */\n _getFocusableElements (el = this.$el, includeNegativeTabIndex = false) {\n if (!el) return [];\n const focusableContent = [...el.querySelectorAll(focusableElementsList)];\n return focusableContent.filter((fc) => {\n const style = window.getComputedStyle(fc);\n return style.getPropertyValue('display') !== 'none' &&\n style.getPropertyValue('visibility') !== 'hidden' &&\n fc.matches(includeNegativeTabIndex ? focusableAttrs : tabbableAttrs);\n });\n },\n\n /**\n * tabs to the next element contained within your component, does not include tabindex=\"-1\".\n * @param {object} e - keypress event\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n focusTrappedTabPress (e, el) {\n const isTabPressed = e.key === 'Tab';\n\n if (!isTabPressed) {\n return;\n }\n\n const focusableElements = this._getFocusableElements(el);\n if (!focusableElements.length) {\n e.preventDefault();\n return;\n }\n\n const firstFocusableElement = this._getFirstFocusElement(focusableElements);\n const lastFocusableElement = focusableElements[focusableElements.length - 1];\n\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableElement) {\n lastFocusableElement.focus();\n e.preventDefault();\n }\n } else {\n if (document.activeElement === lastFocusableElement) {\n firstFocusableElement.focus();\n e.preventDefault();\n }\n }\n },\n },\n};\n"],"names":["focusableAttrs","tabbableAttrs","focusableElementsList","Modal","el","focusableElements","elToFocus","elementId","_a","result","firstFocusEl","includeNegativeTabIndex","fc","style","firstFocusableElement","lastFocusableElement"],"mappings":"AAAA,MAAMA,IAAiB,0EACjBC,IAAgB,GAAGD,CAAc,yBACjCE,IAAwB,
|
|
1
|
+
{"version":3,"file":"modal.js","sources":["../../../common/mixins/modal.js"],"sourcesContent":["const focusableAttrs = ':not(:disabled):not([aria-disabled=\"true\"]):not([role=\"presentation\"])';\nconst tabbableAttrs = `${focusableAttrs}:not([tabindex=\"-1\"])`;\nconst focusableElementsList = `button,[href],input,select,textarea,details,[tabindex]`;\n\n/**\n * This mixin provides the methods to automatically trap tab focus within\n * the component this mixin is on, meaning it is not possible to tab out\n * of the component without dismissing it.\n *\n * Useful for accessibility reasons on things like important actionable alerts.\n *\n * Use focusFirstElement to focus on the first tabbable element within your component, and call\n * focusTrappedTabPress every time tab is pressed to trap tab within this\n * component.\n *\n * Note that focusFirstElement WILL focus elements with tabindex=\"-1\",\n * however focusTrappedTabPress will not.\n * @displayName Modal Mixin\n */\nexport default {\n methods: {\n /**\n * get the first focusable element in your component, includes tabindex=\"-1\".\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n async getFirstFocusableElement (el) {\n await this.$nextTick();\n const focusableElements = this._getFocusableElements(el, true);\n return this._getFirstFocusElement(focusableElements);\n },\n\n /**\n * set focus to the first focusable element in your component, includes tabindex=\"-1\".\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n async focusFirstElement (el = this.$el) {\n const elToFocus = await this.getFirstFocusableElement(el);\n elToFocus?.focus({ preventScroll: true });\n },\n\n async focusElementById (elementId) {\n await this.$nextTick();\n const result = this.$el?.querySelector(elementId);\n if (result) {\n result.focus();\n return;\n }\n\n // eslint-disable-next-line no-console\n console.warn('Could not find the element specified in dt-modal prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the first element.');\n await this.focusFirstElement();\n },\n\n /**\n * internal use only.\n *\n * @param focusableElements - list of focusable elements\n * @returns {*} - first DOM element that is focusable.\n * @private\n */\n _getFirstFocusElement (focusableElements) {\n if (!focusableElements.length) {\n return;\n }\n let firstFocusEl = focusableElements[0];\n // If first element is a checkbox, put focus on the selected checkbox or the first checkbox if none are selected.\n if (firstFocusEl.matches('[type=\"radio\"]:not(:checked)')) {\n firstFocusEl = focusableElements.find(el => el.checked && el.name === firstFocusEl.name) || firstFocusEl;\n }\n return firstFocusEl;\n },\n\n /**\n * internal use only.\n *\n * gets all the focusable elements within the component\n * and sets the first and last of those elements.\n *\n * @param {object} el - the root dom element to find focusable elements in.\n * @param {bool} includeNegativeTabIndex - will include tabindex=\"-1\" in the list of focusable elements.\n */\n _getFocusableElements (el = this.$el, includeNegativeTabIndex = false) {\n if (!el) return [];\n const focusableContent = [...el.querySelectorAll(focusableElementsList)];\n return focusableContent.filter((fc) => {\n const style = window.getComputedStyle(fc);\n return style.getPropertyValue('display') !== 'none' &&\n style.getPropertyValue('visibility') !== 'hidden' &&\n fc.matches(includeNegativeTabIndex ? focusableAttrs : tabbableAttrs);\n });\n },\n\n /**\n * tabs to the next element contained within your component, does not include tabindex=\"-1\".\n * @param {object} e - keypress event\n * @param {object} el - optional - ref of dom element to trap focus on.\n * will default to the root node of the vue component\n */\n focusTrappedTabPress (e, el) {\n const isTabPressed = e.key === 'Tab';\n\n if (!isTabPressed) {\n return;\n }\n\n const focusableElements = this._getFocusableElements(el);\n if (!focusableElements.length) {\n e.preventDefault();\n return;\n }\n\n const firstFocusableElement = this._getFirstFocusElement(focusableElements);\n const lastFocusableElement = focusableElements[focusableElements.length - 1];\n\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableElement) {\n lastFocusableElement.focus();\n e.preventDefault();\n }\n } else {\n if (document.activeElement === lastFocusableElement) {\n firstFocusableElement.focus();\n e.preventDefault();\n }\n }\n },\n },\n};\n"],"names":["focusableAttrs","tabbableAttrs","focusableElementsList","Modal","el","focusableElements","elToFocus","elementId","_a","result","firstFocusEl","includeNegativeTabIndex","fc","style","firstFocusableElement","lastFocusableElement"],"mappings":"AA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iBAAiBD,CAAE;AACxC,eAAOC,EAAM,iBAAiB,SAAS,MAAM,UAC3CA,EAAM,iBAAiB,YAAY,MAAM,YACzCD,EAAG,QAAQD,IAA0BX,IAAiBC,CAAa;AAAA,MACvE,CAAC,IAPe,CAAA;AAAA,IAQlB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,qBAAsB,GAAGG,GAAI;AAG3B,UAAI,EAFiB,EAAE,QAAQ;AAG7B;AAGF,YAAMC,IAAoB,KAAK,sBAAsBD,CAAE;AACvD,UAAI,CAACC,EAAkB,QAAQ;AAC7B,UAAE,eAAc;AAChB;AAAA,MACF;AAEA,YAAMS,IAAwB,KAAK,sBAAsBT,CAAiB,GACpEU,IAAuBV,EAAkBA,EAAkB,SAAS,CAAC;AAE3E,MAAI,EAAE,WACA,SAAS,kBAAkBS,MAC7BC,EAAqB,MAAK,GAC1B,EAAE,eAAc,KAGd,SAAS,kBAAkBA,MAC7BD,EAAsB,MAAK,GAC3B,EAAE,eAAc;AAAA,IAGtB;AAAA,EACJ;AACA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.cjs","sources":["../../../common/mixins/skeleton.js"],"sourcesContent":["import { SKELETON_RIPPLE_DURATION } from '@/components/skeleton/skeleton_constants';\n\n/**\n * @displayName Skeleton Animation Mixin\n */\nexport default {\n computed: {\n skeletonOffset () {\n const skeletonText = this.$refs.skeleton;\n if (!skeletonText) { return this.offset; }\n const { top, height } = skeletonText.getBoundingClientRect();\n return top + (height / 2);\n },\n\n skeletonStyle () {\n const style = {};\n\n if (this.skeletonOffset === -1 || (!this.animate && this.animationDuration === -1)) {\n return style;\n }\n const animationDelay = this.skeletonOffset * SKELETON_RIPPLE_DURATION / 1000;\n const animationDuration = this.animationDuration === -1 ? 1000 : this.animationDuration;\n style.animationDelay = `${animationDelay}ms`;\n style.animationDuration = `${animationDuration}ms`;\n return style;\n },\n },\n};\n"],"names":["SkeletonAnimation","skeletonText","top","height","style","animationDelay","SKELETON_RIPPLE_DURATION","animationDuration"],"mappings":"
|
|
1
|
+
{"version":3,"file":"skeleton.cjs","sources":["../../../common/mixins/skeleton.js"],"sourcesContent":["import { SKELETON_RIPPLE_DURATION } from '@/components/skeleton/skeleton_constants';\n\n/**\n * @displayName Skeleton Animation Mixin\n */\nexport default {\n computed: {\n skeletonOffset () {\n const skeletonText = this.$refs.skeleton;\n if (!skeletonText) { return this.offset; }\n const { top, height } = skeletonText.getBoundingClientRect();\n return top + (height / 2);\n },\n\n skeletonStyle () {\n const style = {};\n\n if (this.skeletonOffset === -1 || (!this.animate && this.animationDuration === -1)) {\n return style;\n }\n const animationDelay = this.skeletonOffset * SKELETON_RIPPLE_DURATION / 1000;\n const animationDuration = this.animationDuration === -1 ? 1000 : this.animationDuration;\n style.animationDelay = `${animationDelay}ms`;\n style.animationDuration = `${animationDuration}ms`;\n return style;\n },\n },\n};\n"],"names":["SkeletonAnimation","skeletonText","top","height","style","animationDelay","SKELETON_RIPPLE_DURATION","animationDuration"],"mappings":"yKAKAA,EAAe,CACb,SAAU,CACR,gBAAkB,CAChB,MAAMC,EAAe,KAAK,MAAM,SAChC,GAAI,CAACA,EAAgB,OAAO,KAAK,OACjC,KAAM,CAAE,IAAAC,EAAK,OAAAC,GAAWF,EAAa,sBAAqB,EAC1D,OAAOC,EAAOC,EAAS,CACzB,EAEA,eAAiB,CACf,MAAMC,EAAQ,CAAA,EAEd,GAAI,KAAK,iBAAmB,IAAO,CAAC,KAAK,SAAW,KAAK,oBAAsB,GAC7E,OAAOA,EAET,MAAMC,EAAiB,KAAK,eAAiBC,EAAAA,yBAA2B,IAClEC,EAAoB,KAAK,oBAAsB,GAAK,IAAO,KAAK,kBACtE,OAAAH,EAAM,eAAiB,GAAGC,CAAc,KACxCD,EAAM,kBAAoB,GAAGG,CAAiB,KACvCH,CACT,CACJ,CACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","sources":["../../../common/mixins/skeleton.js"],"sourcesContent":["import { SKELETON_RIPPLE_DURATION } from '@/components/skeleton/skeleton_constants';\n\n/**\n * @displayName Skeleton Animation Mixin\n */\nexport default {\n computed: {\n skeletonOffset () {\n const skeletonText = this.$refs.skeleton;\n if (!skeletonText) { return this.offset; }\n const { top, height } = skeletonText.getBoundingClientRect();\n return top + (height / 2);\n },\n\n skeletonStyle () {\n const style = {};\n\n if (this.skeletonOffset === -1 || (!this.animate && this.animationDuration === -1)) {\n return style;\n }\n const animationDelay = this.skeletonOffset * SKELETON_RIPPLE_DURATION / 1000;\n const animationDuration = this.animationDuration === -1 ? 1000 : this.animationDuration;\n style.animationDelay = `${animationDelay}ms`;\n style.animationDuration = `${animationDuration}ms`;\n return style;\n },\n },\n};\n"],"names":["SkeletonAnimation","skeletonText","top","height","style","animationDelay","SKELETON_RIPPLE_DURATION","animationDuration"],"mappings":";AAKA,
|
|
1
|
+
{"version":3,"file":"skeleton.js","sources":["../../../common/mixins/skeleton.js"],"sourcesContent":["import { SKELETON_RIPPLE_DURATION } from '@/components/skeleton/skeleton_constants';\n\n/**\n * @displayName Skeleton Animation Mixin\n */\nexport default {\n computed: {\n skeletonOffset () {\n const skeletonText = this.$refs.skeleton;\n if (!skeletonText) { return this.offset; }\n const { top, height } = skeletonText.getBoundingClientRect();\n return top + (height / 2);\n },\n\n skeletonStyle () {\n const style = {};\n\n if (this.skeletonOffset === -1 || (!this.animate && this.animationDuration === -1)) {\n return style;\n }\n const animationDelay = this.skeletonOffset * SKELETON_RIPPLE_DURATION / 1000;\n const animationDuration = this.animationDuration === -1 ? 1000 : this.animationDuration;\n style.animationDelay = `${animationDelay}ms`;\n style.animationDuration = `${animationDuration}ms`;\n return style;\n },\n },\n};\n"],"names":["SkeletonAnimation","skeletonText","top","height","style","animationDelay","SKELETON_RIPPLE_DURATION","animationDuration"],"mappings":";AAKA,MAAAA,IAAe;AAAA,EACb,UAAU;AAAA,IACR,iBAAkB;AAChB,YAAMC,IAAe,KAAK,MAAM;AAChC,UAAI,CAACA;AAAgB,eAAO,KAAK;AACjC,YAAM,EAAE,KAAAC,GAAK,QAAAC,MAAWF,EAAa,sBAAqB;AAC1D,aAAOC,IAAOC,IAAS;AAAA,IACzB;AAAA,IAEA,gBAAiB;AACf,YAAMC,IAAQ,CAAA;AAEd,UAAI,KAAK,mBAAmB,MAAO,CAAC,KAAK,WAAW,KAAK,sBAAsB;AAC7E,eAAOA;AAET,YAAMC,IAAiB,KAAK,iBAAiBC,IAA2B,KAClEC,IAAoB,KAAK,sBAAsB,KAAK,MAAO,KAAK;AACtE,aAAAH,EAAM,iBAAiB,GAAGC,CAAc,MACxCD,EAAM,oBAAoB,GAAGG,CAAiB,MACvCH;AAAA,IACT;AAAA,EACJ;AACA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","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 Vue 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 as flows: 'error' > 'warning' > 'success'.\n * If any message of type 'error' is present in messages, the input state is considered\n * to be 'error', then 'warning' and lastly 'success'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.ERROR)) {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.SUCCESS)) {\n return VALIDATION_MESSAGE_TYPES.SUCCESS;\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 = {\n name: 'html-fragment',\n functional: true,\n props: ['html'],\n render (h, ctx) {\n return new Vue({\n // eslint-disable-next-line vue/multi-word-component-names\n name: 'Inner',\n beforeCreate () { this.$createElement = h; },\n template: `<div>${ctx.props.html}</div>`,\n }).$mount()._vnode.children;\n },\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\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* 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:9010\" 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 (e) {\n // eslint-disable-next-line no-console\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// eslint-disable-next-line complexity\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 debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n disableRootScrolling,\n enableRootScrolling,\n};\n"],"names":["UNIQUE_ID_COUNTER","TIMER","FOCUSABLE_SELECTOR_NOT_HIDDEN","FOCUSABLE_SELECTOR_NOT_DISABLED","FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED","FOCUSABLE_SELECTOR","scheduler","getUniqueString","prefix","DEFAULT_PREFIX","getRandomElement","array","seed","hash","javaHashCode","getRandomInt","str","h","i","max","formatMessages","messages","message","DEFAULT_VALIDATION_MESSAGE_TYPE","filterFormattedMessages","formattedMessages","validationState","getValidationState","hasFormattedMessageOfType","VALIDATION_MESSAGE_TYPES","messageType","findFirstFocusableNode","element","htmlFragment","ctx","Vue","flushPromises","resolve","kebabCaseToPascalCase","string","word","pascalCaseToKebabCase","x","y","debounce","func","timeout","isOutOfViewPort","bounding","isOut","val","domainNameRegex","tldRegerx","ipv4Regex","hostnameOrIpRegex","urlPathRegex","urlQueryOrFragmentRegex","urlWithoutProtocolRegex","urlWithProtocolRegex","emailAddressRegex","getPhoneNumberRegex","minLength","maxLength","phoneNumberRegex","linkRegex","isPhoneNumber","input","_a","isURL","_b","isEmailAddress","safeConcatStrings","elements","capitalizeFirstLetter","locale","char","warnIfUnmounted","componentRef","componentName","isDtScrollbarInUse","rootElement","disableRootScrolling","enableRootScrolling","toFluentKeyString","text","utils"],"mappings":"uKAOA,IAAIA,EAAoB,EACpBC,EAGJ,MAAMC,EAAgC,0CAEhCC,EAAkC,sEAElCC,EAAyC,GAAGF,CAA6B,IAAIC,CAA+B,GAE5GE,EAAqB,kBAAkBD,CAAsC,eAE7EE,EAAY,OAAO,cAAiB,WAAa,aAAe,WAE/D,SAASC,EAAiBC,EAASC,iBAAgB,CACxD,MAAO,GAAGD,CAAM,GAAGR,GAAmB,EACxC,CASO,SAASU,EAAkBC,EAAOC,EAAM,CAC7C,GAAIA,EAAM,CACR,MAAMC,EAAOC,EAAaF,CAAI,EAC9B,OAAOD,EAAM,KAAK,IAAIE,CAAI,EAAIF,EAAM,MAAM,CAC9C,KACI,QAAOA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AAK0D,EAAS,QAAS,CAC5D,OAAO1D,EAAI,QAAQ,0BAAW,EAAE2D,GAAQA,EAAK,kBAAkBD,CAAM,CAAC,CACxE,CAQO,SAASE,EAAiBC,EAAcC,EAAe,CACxD,OAAO,QAAY,KACnB,QAAQ,IAAI,WAAa,SACzB,CAACD,GAAgB,EAAEA,aAAwB,cAAgB,EAAC,yBAAU,OACrE,SAAS,KAAK,SAASA,CAAY,GACtC,QAAQ,KAAK,OAAOC,CAAa,yEAAyE,EAE9G,CAOA,SAASC,EAAoBC,EAAc,SAAS,gBAAiB,CACnE,MAAI,EAAAA,EAAY,aAAa,wBAAwB,CAIvD,CAMO,SAASC,EAAsBD,EAAc,SAAS,gBAAiB,CACxED,EAAmBC,CAAW,EAChCA,EAAY,UAAU,IAAI,sBAAsB,EAEhDA,EAAY,UAAU,IAAI,aAAa,CAE3C,CAMO,SAASE,EAAqBF,EAAc,SAAS,gBAAiB,CACvED,EAAmBC,CAAW,EAChCA,EAAY,UAAU,OAAO,sBAAsB,EAEnDA,EAAY,UAAU,OAAO,aAAa,CAE9C,CAQO,SAASG,EAAmBC,EAAM,CACvC,OAAOA,EACJ,WAAW,QAAS,GAAG,EACvB,WAAW,MAAO,EAAE,EACpB,aACL,CAEA,MAAeC,EAAA,CACb,gBAAA9E,EACA,iBAAAG,EACA,aAAAK,EACA,eAAAK,EACA,wBAAAI,EACA,0BAAAI,EACA,mBAAAD,EACA,aAAAM,EACA,cAAAG,EACA,sBAAAE,EACA,SAAAM,EACA,gBAAAG,EACA,oBAAAa,EACA,UAAAI,EACA,eAAAM,EACA,cAAAL,EACA,MAAAG,EACA,kBAAAG,EACA,sBAAAE,EACA,qBAAAQ,EACA,oBAAAC,CACF"}
|
|
1
|
+
{"version":3,"file":"index.cjs","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 Vue 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 as flows: 'error' > 'warning' > 'success'.\n * If any message of type 'error' is present in messages, the input state is considered\n * to be 'error', then 'warning' and lastly 'success'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.ERROR)) {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.SUCCESS)) {\n return VALIDATION_MESSAGE_TYPES.SUCCESS;\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 = {\n name: 'html-fragment',\n functional: true,\n props: ['html'],\n render (h, ctx) {\n return new Vue({\n\n name: 'Inner',\n beforeCreate () { this.$createElement = h; },\n template: `<div>${ctx.props.html}</div>`,\n }).$mount()._vnode.children;\n },\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\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* 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:9010\" 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 // eslint-disable-next-line no-console\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// eslint-disable-next-line complexity\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 debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n disableRootScrolling,\n enableRootScrolling,\n};\n"],"names":["UNIQUE_ID_COUNTER","TIMER","FOCUSABLE_SELECTOR_NOT_HIDDEN","FOCUSABLE_SELECTOR_NOT_DISABLED","FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED","FOCUSABLE_SELECTOR","scheduler","getUniqueString","prefix","DEFAULT_PREFIX","getRandomElement","array","seed","hash","javaHashCode","getRandomInt","str","h","i","max","formatMessages","messages","message","DEFAULT_VALIDATION_MESSAGE_TYPE","filterFormattedMessages","formattedMessages","validationState","getValidationState","hasFormattedMessageOfType","VALIDATION_MESSAGE_TYPES","messageType","findFirstFocusableNode","element","htmlFragment","ctx","Vue","flushPromises","resolve","kebabCaseToPascalCase","string","word","pascalCaseToKebabCase","x","y","debounce","func","timeout","isOutOfViewPort","bounding","isOut","val","domainNameRegex","tldRegerx","ipv4Regex","hostnameOrIpRegex","urlPathRegex","urlQueryOrFragmentRegex","urlWithoutProtocolRegex","urlWithProtocolRegex","emailAddressRegex","getPhoneNumberRegex","minLength","maxLength","phoneNumberRegex","linkRegex","isPhoneNumber","input","_a","isURL","_b","isEmailAddress","safeConcatStrings","elements","capitalizeFirstLetter","locale","char","warnIfUnmounted","componentRef","componentName","isDtScrollbarInUse","rootElement","disableRootScrolling","enableRootScrolling","toFluentKeyString","text","utils"],"mappings":"uKAOA,IAAIA,EAAoB,EACpBC,EAGJ,MAAMC,EAAgC,0CAEhCC,EAAkC,sEAElCC,EAAyC,GAAGF,CAA6B,IAAIC,CAA+B,GAE5GE,EAAqB,kBAAkBD,CAAsC,eAE7EE,EAAY,OAAO,cAAiB,WAAa,aAAe,WAE/D,SAASC,EAAiBC,EAASC,iBAAgB,CACxD,MAAO,GAAGD,CAAM,GAAGR,GAAmB,EACxC,CASO,SAASU,EAAkBC,EAAOC,EAAM,CAC7C,GAAIA,EAAM,CACR,MAAMC,EAAOC,EAAaF,CAAI,EAC9B,OAAOD,EAAM,KAAK,IAAIE,CAAI,EAAIF,EAAM,MAAM,CAC5C,KACE,QAAOA,EAAMI,EAAaJ,EAAM,MAAM,CAAC,CAE3C,CAiBO,SAASG,EAAcE,EAAK,CACjC,IAAIC,EACJ,QAASC,EAAI,EAAGA,EAAIF,EAAI,OAAQE,IAC9BD,EAAI,KAAK,KAAK,GAAIA,CAAC,EAAID,EAAI,WAAWE,CAAC,EAAI,EAG7C,OAAOD,CACT,CAOO,SAASF,EAAcI,EAAK,CACjC,OAAO,KAAK,MAAM,KAAK,OAAM,EAAKA,CAAG,CACvC,CAEO,SAASC,EAAgBC,EAAU,CACxC,OAAKA,EAIEA,EAAS,IAAIC,GACd,OAAOA,GAAY,SACd,CACL,QAAAA,EACA,KAAMC,EAAAA,+BACd,EAGWD,CACR,EAZQ,CAAA,CAaX,CAEO,SAASE,EAAyBC,EAAmB,CAC1D,MAAMC,EAAkBC,EAAmBF,CAAiB,EAE5D,MAAI,CAACA,GAAqB,CAACC,EAClB,CAAA,EAGFD,EAAkB,OAAOH,GAAW,CAAC,CAACA,EAAQ,SAAWA,EAAQ,OAASI,CAAe,CAClG,CAOO,SAASC,EAAoBF,EAAmB,CACrD,OAAKA,EAIDG,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AO,aAAa,CAE9C,CAQO,SAASG,EAAmBC,EAAM,CACvC,OAAOA,EACJ,WAAW,QAAS,GAAG,EACvB,WAAW,MAAO,EAAE,EACpB,YAAW,CAChB,CAEA,MAAAC,EAAe,CACb,gBAAA9E,EACA,iBAAAG,EACA,aAAAK,EACA,eAAAK,EACA,wBAAAI,EACA,0BAAAI,EACA,mBAAAD,EACA,aAAAM,EACA,cAAAG,EACA,sBAAAE,EACA,SAAAM,EACA,gBAAAG,EACA,oBAAAa,EACA,UAAAI,EACA,eAAAM,EACA,cAAAL,EACA,MAAAG,EACA,kBAAAG,EACA,sBAAAE,EACA,qBAAAQ,EACA,oBAAAC,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","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 Vue 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 as flows: 'error' > 'warning' > 'success'.\n * If any message of type 'error' is present in messages, the input state is considered\n * to be 'error', then 'warning' and lastly 'success'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.ERROR)) {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.SUCCESS)) {\n return VALIDATION_MESSAGE_TYPES.SUCCESS;\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 = {\n name: 'html-fragment',\n functional: true,\n props: ['html'],\n render (h, ctx) {\n return new Vue({\n // eslint-disable-next-line vue/multi-word-component-names\n name: 'Inner',\n beforeCreate () { this.$createElement = h; },\n template: `<div>${ctx.props.html}</div>`,\n }).$mount()._vnode.children;\n },\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\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* 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:9010\" 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 (e) {\n // eslint-disable-next-line no-console\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// eslint-disable-next-line complexity\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 debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n disableRootScrolling,\n enableRootScrolling,\n};\n"],"names":["UNIQUE_ID_COUNTER","TIMER","FOCUSABLE_SELECTOR_NOT_HIDDEN","FOCUSABLE_SELECTOR_NOT_DISABLED","FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED","FOCUSABLE_SELECTOR","scheduler","getUniqueString","prefix","DEFAULT_PREFIX","getRandomElement","array","seed","hash","javaHashCode","getRandomInt","str","h","i","max","formatMessages","messages","message","DEFAULT_VALIDATION_MESSAGE_TYPE","filterFormattedMessages","formattedMessages","validationState","getValidationState","hasFormattedMessageOfType","VALIDATION_MESSAGE_TYPES","messageType","findFirstFocusableNode","element","htmlFragment","ctx","Vue","flushPromises","resolve","kebabCaseToPascalCase","string","word","pascalCaseToKebabCase","x","y","debounce","func","timeout","isOutOfViewPort","bounding","isOut","val","domainNameRegex","tldRegerx","ipv4Regex","hostnameOrIpRegex","urlPathRegex","urlQueryOrFragmentRegex","urlWithoutProtocolRegex","urlWithProtocolRegex","emailAddressRegex","getPhoneNumberRegex","minLength","maxLength","phoneNumberRegex","linkRegex","isPhoneNumber","input","_a","isURL","_b","isEmailAddress","safeConcatStrings","elements","capitalizeFirstLetter","locale","char","warnIfUnmounted","componentRef","componentName","isDtScrollbarInUse","rootElement","disableRootScrolling","enableRootScrolling","toFluentKeyString","text","utils"],"mappings":";;AAOA,IAAIA,IAAoB,GACpBC;AAGJ,MAAMC,IAAgC,2CAEhCC,IAAkC,uEAElCC,IAAyC,GAAGF,CAA6B,IAAIC,CAA+B,IAE5GE,IAAqB,kBAAkBD,CAAsC,gBAE7EE,IAAY,OAAO,gBAAiB,aAAa,eAAe;AAE/D,SAASC,EAAiBC,IAASC,GAAgB;AACxD,SAAO,GAAGD,CAAM,GAAGR,GAAmB;AACxC;AASO,SAASU,EAAkBC,GAAOC,GAAM;AAC7C,MAAIA,GAAM;AACR,UAAMC,IAAOC,EAAaF,CAAI;AAC9B,WAAOD,EAAM,KAAK,IAAIE,CAAI,IAAIF,EAAM,MAAM;AAAA,EAC9C;AACI,WAAOA,EAAMI,EAAaJ,EAAM,MAAM,CAAC;AAE3C;AAiB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;AAAA,EACA,cAAAM;AAAA,EACA,eAAAG;AAAA,EACA,uBAAAE;AAAA,EACA,UAAAM;AAAA,EACA,iBAAAG;AAAA,EACA,qBAAAa;AAAA,EACA,WAAAI;AAAA,EACA,gBAAAM;AAAA,EACA,eAAAL;AAAA,EACA,OAAAG;AAAA,EACA,mBAAAG;AAAA,EACA,uBAAAE;AAAA,EACA,sBAAAQ;AAAA,EACA,qBAAAC;AACF;"}
|
|
1
|
+
{"version":3,"file":"index.js","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 Vue 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 as flows: 'error' > 'warning' > 'success'.\n * If any message of type 'error' is present in messages, the input state is considered\n * to be 'error', then 'warning' and lastly 'success'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.ERROR)) {\n return VALIDATION_MESSAGE_TYPES.ERROR;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.SUCCESS)) {\n return VALIDATION_MESSAGE_TYPES.SUCCESS;\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 = {\n name: 'html-fragment',\n functional: true,\n props: ['html'],\n render (h, ctx) {\n return new Vue({\n\n name: 'Inner',\n beforeCreate () { this.$createElement = h; },\n template: `<div>${ctx.props.html}</div>`,\n }).$mount()._vnode.children;\n },\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\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* 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:9010\" 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 // eslint-disable-next-line no-console\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// eslint-disable-next-line complexity\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 debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n disableRootScrolling,\n enableRootScrolling,\n};\n"],"names":["UNIQUE_ID_COUNTER","TIMER","FOCUSABLE_SELECTOR_NOT_HIDDEN","FOCUSABLE_SELECTOR_NOT_DISABLED","FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED","FOCUSABLE_SELECTOR","scheduler","getUniqueString","prefix","DEFAULT_PREFIX","getRandomElement","array","seed","hash","javaHashCode","getRandomInt","str","h","i","max","formatMessages","messages","message","DEFAULT_VALIDATION_MESSAGE_TYPE","filterFormattedMessages","formattedMessages","validationState","getValidationState","hasFormattedMessageOfType","VALIDATION_MESSAGE_TYPES","messageType","findFirstFocusableNode","element","htmlFragment","ctx","Vue","flushPromises","resolve","kebabCaseToPascalCase","string","word","pascalCaseToKebabCase","x","y","debounce","func","timeout","isOutOfViewPort","bounding","isOut","val","domainNameRegex","tldRegerx","ipv4Regex","hostnameOrIpRegex","urlPathRegex","urlQueryOrFragmentRegex","urlWithoutProtocolRegex","urlWithProtocolRegex","emailAddressRegex","getPhoneNumberRegex","minLength","maxLength","phoneNumberRegex","linkRegex","isPhoneNumber","input","_a","isURL","_b","isEmailAddress","safeConcatStrings","elements","capitalizeFirstLetter","locale","char","warnIfUnmounted","componentRef","componentName","isDtScrollbarInUse","rootElement","disableRootScrolling","enableRootScrolling","toFluentKeyString","text","utils"],"mappings":";;AAOA,IAAIA,IAAoB,GACpBC;AAGJ,MAAMC,IAAgC,2CAEhCC,IAAkC,uEAElCC,IAAyC,GAAGF,CAA6B,IAAIC,CAA+B,IAE5GE,IAAqB,kBAAkBD,CAAsC,gBAE7EE,IAAY,OAAO,gBAAiB,aAAa,eAAe;AAE/D,SAASC,EAAiBC,IAASC,GAAgB;AACxD,SAAO,GAAGD,CAAM,GAAGR,GAAmB;AACxC;AASO,SAASU,EAAkBC,GAAOC,GAAM;AAC7C,MAAIA,GAAM;AACR,UAAMC,IAAOC,EAAaF,CAAI;AAC9B,WAAOD,EAAM,KAAK,IAAIE,CAAI,IAAIF,EAAM,MAAM;AAAA,EAC5C;AACE,WAAOA,EAAMI,EAAaJ,EAAM,MAAM,CAAC;AAE3C;AAiBO,SAASG,EAAcE,GAAK;AACjC,MAAIC;AACJ,WAASC,IAAI,GAAGA,IAAIF,EAAI,QAAQE;AAC9B,IAAAD,IAAI,KAAK,KAAK,IAAIA,CAAC,IAAID,EAAI,WAAWE,CAAC,IAAI;AAG7C,SAAOD;AACT;AAOO,SAASF,EAAcI,G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AAAL;AAAA,EACA,OAAAG;AAAA,EACA,mBAAAG;AAAA,EACA,uBAAAE;AAAA,EACA,sBAAAQ;AAAA,EACA,qBAAAC;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../common/validators/index.js"],"sourcesContent":["import {\n VALIDATION_MESSAGE_TYPES,\n} from '@/common/constants';\n\nexport function validationMessageValidator (rawMessages) {\n if (!rawMessages) {\n return true;\n }\n\n return rawMessages.every(message => {\n if (typeof message === 'string') {\n return true;\n }\n\n if (typeof message === 'object') {\n return Object.values(VALIDATION_MESSAGE_TYPES).includes(message?.type);\n }\n\n return false;\n });\n}\n\nexport default {\n validationMessageValidator,\n};\n"],"names":["validationMessageValidator","rawMessages","message","VALIDATION_MESSAGE_TYPES","index"],"mappings":"sJAIO,SAASA,EAA4BC,EAAa,CACvD,OAAKA,EAIEA,EAAY,MAAMC,GACnB,OAAOA,GAAY,SACd,GAGL,OAAOA,GAAY,SACd,OAAO,OAAOC,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../common/validators/index.js"],"sourcesContent":["import {\n VALIDATION_MESSAGE_TYPES,\n} from '@/common/constants';\n\nexport function validationMessageValidator (rawMessages) {\n if (!rawMessages) {\n return true;\n }\n\n return rawMessages.every(message => {\n if (typeof message === 'string') {\n return true;\n }\n\n if (typeof message === 'object') {\n return Object.values(VALIDATION_MESSAGE_TYPES).includes(message?.type);\n }\n\n return false;\n });\n}\n\nexport default {\n validationMessageValidator,\n};\n"],"names":["validationMessageValidator","rawMessages","message","VALIDATION_MESSAGE_TYPES","index"],"mappings":"sJAIO,SAASA,EAA4BC,EAAa,CACvD,OAAKA,EAIEA,EAAY,MAAMC,GACnB,OAAOA,GAAY,SACd,GAGL,OAAOA,GAAY,SACd,OAAO,OAAOC,EAAAA,wBAAwB,EAAE,SAASD,GAAA,YAAAA,EAAS,IAAI,EAGhE,EACR,EAbQ,EAcX,CAEA,MAAAE,EAAe,CACb,2BAAAJ,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../common/validators/index.js"],"sourcesContent":["import {\n VALIDATION_MESSAGE_TYPES,\n} from '@/common/constants';\n\nexport function validationMessageValidator (rawMessages) {\n if (!rawMessages) {\n return true;\n }\n\n return rawMessages.every(message => {\n if (typeof message === 'string') {\n return true;\n }\n\n if (typeof message === 'object') {\n return Object.values(VALIDATION_MESSAGE_TYPES).includes(message?.type);\n }\n\n return false;\n });\n}\n\nexport default {\n validationMessageValidator,\n};\n"],"names":["validationMessageValidator","rawMessages","message","VALIDATION_MESSAGE_TYPES","index"],"mappings":";AAIO,SAASA,EAA4BC,GAAa;AACvD,SAAKA,IAIEA,EAAY,MAAM,CAAAC,MACnB,OAAOA,KAAY,WACd,KAGL,OAAOA,KAAY,WACd,OAAO,OAAOC,CAAwB,EAAE,SAASD,KAAA,gBAAAA,EAAS,IAAI,IAGhE,EACR,IAbQ;AAcX;AAEA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../common/validators/index.js"],"sourcesContent":["import {\n VALIDATION_MESSAGE_TYPES,\n} from '@/common/constants';\n\nexport function validationMessageValidator (rawMessages) {\n if (!rawMessages) {\n return true;\n }\n\n return rawMessages.every(message => {\n if (typeof message === 'string') {\n return true;\n }\n\n if (typeof message === 'object') {\n return Object.values(VALIDATION_MESSAGE_TYPES).includes(message?.type);\n }\n\n return false;\n });\n}\n\nexport default {\n validationMessageValidator,\n};\n"],"names":["validationMessageValidator","rawMessages","message","VALIDATION_MESSAGE_TYPES","index"],"mappings":";AAIO,SAASA,EAA4BC,GAAa;AACvD,SAAKA,IAIEA,EAAY,MAAM,CAAAC,MACnB,OAAOA,KAAY,WACd,KAGL,OAAOA,KAAY,WACd,OAAO,OAAOC,CAAwB,EAAE,SAASD,KAAA,gBAAAA,EAAS,IAAI,IAGhE,EACR,IAbQ;AAcX;AAEA,MAAAE,IAAe;AAAA,EACb,4BAAAJ;AACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@dialpad/dialtone-icons/vue2"),c=require("../../localization/index.cjs"),i=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@dialpad/dialtone-icons/vue2"),c=require("../../localization/index.cjs"),i=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),n=require("../button/button.cjs"),l=require("../image-viewer/image-viewer.cjs"),u={name:"DtProgressBar",props:{ariaLabel:{type:String,required:!0},progress:{type:Number,default:20}},data:()=>({circleCircumference:50}),computed:{cssVars(){return{"--stroke-dashoffset":this.circleCircumference-this.circleCircumference*this.progress/100,"--stroke-dasharray":this.circleCircumference}}},mounted(){this.circleCircumference=this.$refs.progressbarCircle.getTotalLength()}};var m=function(){var e=this,r=e._self._c;return r("div",{attrs:{role:"progressbar","aria-label":e.ariaLabel,tabindex:"-1","aria-valuenow":e.progress,"aria-valuemin":"0","aria-valuemax":"100"}},[r("svg",{staticClass:"d-recipe-attachment-carousel__progress-bar",style:e.cssVars},[r("circle",{ref:"progressbarCircle",staticClass:"d-recipe-attachment-carousel__progress-bar-circle",attrs:{r:"8",cx:"12",cy:"12"}}),r("circle",{staticClass:"d-recipe-attachment-carousel__progress-bar-circle",attrs:{r:"8",cx:"12",cy:"12"}})])])},_=[],d=i.n(u,m,_);const h=d.exports,f={name:"DtImageCarousel",components:{DtImageViewer:l.default,DtButton:n.default,DtIconClose:o.DtIconClose,DtProgressBar:h},props:{mediaItem:{type:Object,required:!0},index:{type:Number,required:!0}},emits:["remove-media"],data(){return{i18n:new c.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},methods:{removeMediaItem(t){this.$emit("remove-media",t)}}};var p=function(){var e=this,r=e._self._c;return r("li",{staticClass:"d-recipe-attachment-carousel__image"},[r("dt-image-viewer",{attrs:{"image-button-class":"d-recipe-attachment-carousel__image-viewer","image-src":e.mediaItem.path,"image-alt":e.mediaItem.altText,"aria-label":e.i18n.$t("DIALTONE_IMAGE_CAROUSEL_CLICK_TO_OPEN_ARIA_LABEL")}}),r("div",{staticClass:"d-recipe-attachment-carousel__image-top-right"},[e.mediaItem.isUploading?r("dt-progress-bar",{staticClass:"d-recipe-attachment-carousel__image-progress-bar",attrs:{progress:e.mediaItem.progress,"aria-label":e.i18n.$t("DIALTONE_IMAGE_CAROUSEL_PROGRESS_BAR_ARIA_LABEL")}}):e._e(),r("dt-button",{staticClass:"d-recipe-attachment-carousel__image-close-button",attrs:{id:`closeButton-${e.index}`,tabindex:"0",circle:"",size:"xs",importance:"clear","aria-label":e.closeButtonTitle,title:e.closeButtonTitle},on:{click:function(s){return e.removeMediaItem(e.index)}},scopedSlots:e._u([{key:"icon",fn:function(){return[r("dt-icon-close",{attrs:{size:"200"}})]},proxy:!0}])})],1)],1)},g=[],w=i.n(f,p,g);const v=w.exports,A=64,L={name:"DtRecipeAttachmentCarousel",components:{DtButton:n.default,DtIconArrowRight:o.DtIconArrowRight,DtIconArrowLeft:o.DtIconArrowLeft,DtImageCarousel:v},props:{mediaList:{type:Array,default:()=>[]}},emits:["remove-media"],data(){return{showCloseButton:{},showRightArrow:!0,showLeftArrow:!1,isMounted:!1,i18n:new c.DialtoneLocalization}},computed:{filteredMediaList(){return this.mediaList.filter(t=>t.type==="image"||t.type==="video")}},mounted:function(){this.showLeftArrow=this.$refs.carousel.scrollLeft>0,this.showRightArrow=this.$refs.carousel.scrollWidth>this.$refs.carousel.clientWidth},methods:{onItemFocus(t){t.currentTarget.scrollIntoView({behavior:"smooth"})},mediaComponent(t){switch(t){case"image":return"dt-image-carousel";default:return null}},removeMediaItem(t){this.showRightArrow=this.$refs.carousel.scrollWidth>this.$refs.carousel.clientWidth+A,this.$emit("remove-media",t)},closeButton(t,e){this.showCloseButton[e]=t},handleScroll(){const t=this.$refs.carousel;this.showLeftArrow=t.scrollLeft>0,this.showRightArrow=t.scrollLeft+t.clientWidth!==t.scrollWidth},leftScroll(){this.$refs.carousel.scrollTo({left:this.$refs.carousel.scrollLeft-100,behavior:"smooth"})},rightScroll(){this.$refs.carousel.scrollTo({left:this.$refs.carousel.scrollLeft+100,behavior:"smooth"})}}};var b=function(){var e=this,r=e._self._c;return r("div",{staticClass:"d-recipe-attachment-carousel",attrs:{role:"presentation"}},[e.mediaList.length>0?r("ul",{ref:"carousel",staticClass:"d-recipe-attachment-carousel__media-list",on:{scroll:e.handleScroll}},e._l(e.filteredMediaList,function(s,a){return r(e.mediaComponent(s.type),{key:`media-${a}`,tag:"component",attrs:{index:a,"media-item":s},on:{"remove-media":function(R){return e.removeMediaItem(a)},focusin:e.onItemFocus}})}),1):e._e(),r("dt-button",{directives:[{name:"show",rawName:"v-show",value:e.showLeftArrow,expression:"showLeftArrow"}],staticClass:"d-recipe-attachment-carousel__arrow d-recipe-attachment-carousel__arrow--left",attrs:{tabindex:"-1","aria-label":e.i18n.$t("DIALTONE_ATTACHMENT_CAROUSEL_LEFT_ARROW_ARIA_LABEL"),circle:"",size:"xs",importance:"clear"},on:{click:e.leftScroll},scopedSlots:e._u([{key:"icon",fn:function(){return[r("dt-icon-arrow-left",{attrs:{size:"100"}})]},proxy:!0}])}),r("dt-button",{directives:[{name:"show",rawName:"v-show",value:e.showRightArrow,expression:"showRightArrow"}],staticClass:"d-recipe-attachment-carousel__arrow d-recipe-attachment-carousel__arrow--right",attrs:{tabindex:"-1","aria-label":e.i18n.$t("DIALTONE_ATTACHMENT_CAROUSEL_RIGHT_ARROW_ARIA_LABEL"),circle:"",size:"xs",importance:"clear"},on:{click:e.rightScroll},scopedSlots:e._u([{key:"icon",fn:function(){return[r("dt-icon-arrow-right",{attrs:{size:"100"}})]},proxy:!0}])})],1)},C=[],I=i.n(L,b,C);const $=I.exports;exports.default=$;
|
|
2
2
|
//# sourceMappingURL=attachment-carousel.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-carousel.cjs","sources":["../../../recipes/conversation_view/attachment_carousel/media_components/progress_bar.vue","../../../recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue","../../../recipes/conversation_view/attachment_carousel/attachment_carousel.vue"],"sourcesContent":["<script>\nexport default {\n name: 'DtProgressBar',\n props: {\n ariaLabel: {\n type: String,\n required: true,\n },\n\n progress: {\n type: Number,\n default: 20,\n },\n },\n\n data: () => ({\n circleCircumference: 50,\n }),\n\n computed: {\n cssVars () {\n return {\n '--stroke-dashoffset':\n (this.circleCircumference - (this.circleCircumference * this.progress / 100)),\n\n '--stroke-dasharray': this.circleCircumference,\n };\n },\n },\n\n mounted () {\n this.circleCircumference = this.$refs.progressbarCircle.getTotalLength();\n },\n};\n</script>\n\n<template>\n <div\n role=\"progressbar\"\n :aria-label=\"ariaLabel\"\n tabindex=\"-1\"\n :aria-valuenow=\"progress\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n >\n <svg\n class=\"d-recipe-attachment-carousel__progress-bar\"\n :style=\"cssVars\"\n >\n <circle\n ref=\"progressbarCircle\"\n r=\"8\"\n cx=\"12\"\n cy=\"12\"\n class=\"d-recipe-attachment-carousel__progress-bar-circle\"\n />\n <circle\n r=\"8\"\n cx=\"12\"\n cy=\"12\"\n class=\"d-recipe-attachment-carousel__progress-bar-circle\"\n />\n </svg>\n </div>\n</template>\n","<template>\n <li\n class=\"d-recipe-attachment-carousel__image\"\n >\n <dt-image-viewer\n image-button-class=\"d-recipe-attachment-carousel__image-viewer\"\n :image-src=\"mediaItem.path\"\n :image-alt=\"mediaItem.altText\"\n :aria-label=\"i18n.$t('DIALTONE_IMAGE_CAROUSEL_CLICK_TO_OPEN_ARIA_LABEL')\"\n />\n\n <!-- Loader / Close button -->\n <div\n class=\"d-recipe-attachment-carousel__image-top-right\"\n >\n <dt-progress-bar\n v-if=\"mediaItem.isUploading\"\n class=\"d-recipe-attachment-carousel__image-progress-bar\"\n :progress=\"mediaItem.progress\"\n :aria-label=\"i18n.$t('DIALTONE_IMAGE_CAROUSEL_PROGRESS_BAR_ARIA_LABEL')\"\n />\n <dt-button\n :id=\"`closeButton-${index}`\"\n tabindex=\"0\"\n class=\"d-recipe-attachment-carousel__image-close-button\"\n circle\n size=\"xs\"\n importance=\"clear\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"removeMediaItem(index)\"\n >\n <template #icon>\n <dt-icon-close\n size=\"200\"\n />\n </template>\n </dt-button>\n </div>\n </li>\n</template>\n\n<script>\nimport { DtImageViewer } from '@/components/image_viewer';\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue2';\nimport { DialtoneLocalization } from '@/localization';\n\nimport DtProgressBar from './progress_bar.vue';\n\nexport default {\n name: 'DtImageCarousel',\n\n components: {\n DtImageViewer,\n DtButton,\n DtIconClose,\n DtProgressBar,\n },\n\n props: {\n mediaItem: {\n type: Object,\n required: true,\n },\n\n index: {\n type: Number,\n required: true,\n },\n },\n\n emits: [\n /**\n * Emitted when media close button is clicked to remove the image\n *\n * @event remove-media\n * @type {Number}\n */\n 'remove-media',\n ],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n removeMediaItem (index) {\n this.$emit('remove-media', index);\n },\n },\n};\n</script>\n","<template>\n <div\n class=\"d-recipe-attachment-carousel\"\n role=\"presentation\"\n >\n <ul\n v-if=\"mediaList.length > 0\"\n ref=\"carousel\"\n class=\"d-recipe-attachment-carousel__media-list\"\n @scroll=\"handleScroll\"\n >\n <!-- media list -->\n <component\n :is=\"mediaComponent(mediaItem.type)\"\n v-for=\"(mediaItem, index) in filteredMediaList\"\n :key=\"`media-${index}`\"\n :index=\"index\"\n :media-item=\"mediaItem\"\n @remove-media=\"removeMediaItem(index)\"\n @focusin=\"onItemFocus\"\n />\n </ul>\n\n <!-- Carousel Arrows -->\n <dt-button\n v-show=\"showLeftArrow\"\n tabindex=\"-1\"\n :aria-label=\"i18n.$t('DIALTONE_ATTACHMENT_CAROUSEL_LEFT_ARROW_ARIA_LABEL')\"\n class=\"d-recipe-attachment-carousel__arrow d-recipe-attachment-carousel__arrow--left\"\n circle\n size=\"xs\"\n importance=\"clear\"\n @click=\"leftScroll\"\n >\n <template #icon>\n <dt-icon-arrow-left\n size=\"100\"\n />\n </template>\n </dt-button>\n <dt-button\n v-show=\"showRightArrow\"\n tabindex=\"-1\"\n :aria-label=\"i18n.$t('DIALTONE_ATTACHMENT_CAROUSEL_RIGHT_ARROW_ARIA_LABEL')\"\n class=\"d-recipe-attachment-carousel__arrow d-recipe-attachment-carousel__arrow--right\"\n circle\n size=\"xs\"\n importance=\"clear\"\n @click=\"rightScroll\"\n >\n <template #icon>\n <dt-icon-arrow-right\n size=\"100\"\n />\n </template>\n </dt-button>\n </div>\n</template>\n\n<script>\nimport { DtIconArrowRight, DtIconArrowLeft } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { DialtoneLocalization } from '@/localization';\n\nimport DtImageCarousel from './media_components/image_carousel.vue';\n\nconst MEDIA_ITEM_WIDTH = 64;\n\nexport default {\n name: 'DtRecipeAttachmentCarousel',\n\n components: {\n DtButton,\n DtIconArrowRight,\n DtIconArrowLeft,\n DtImageCarousel,\n },\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n // inheritAttrs: false,\n\n props: {\n /**\n * media - object array of media objects\n * @type {Array}\n *\n * Object: {\n * path: String,\n * altText: String | null,\n * }\n */\n mediaList: {\n type: Array,\n default: () => [],\n },\n },\n\n emits: [\n /**\n * Emitted when popover is shown or hidden\n *\n * @event remove-media\n * @type {Number}\n */\n 'remove-media',\n ],\n\n data () {\n return {\n showCloseButton: {},\n showRightArrow: true,\n showLeftArrow: false,\n isMounted: false,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n filteredMediaList () {\n return this.mediaList.filter((mediaItem) => mediaItem.type === 'image' || mediaItem.type === 'video');\n },\n },\n\n mounted: function () {\n this.showLeftArrow = this.$refs.carousel.scrollLeft > 0;\n this.showRightArrow = this.$refs.carousel.scrollWidth > this.$refs.carousel.clientWidth;\n },\n\n methods: {\n onItemFocus (e) {\n e.currentTarget.scrollIntoView({ behavior: 'smooth' });\n },\n\n mediaComponent (type) {\n switch (type) {\n case 'image':\n return 'dt-image-carousel';\n default:\n // unknown media type\n return null;\n }\n },\n\n removeMediaItem (index) {\n // make sure the carousel arrows is updated. 64 is the width of each media item\n this.showRightArrow = this.$refs.carousel.scrollWidth > (this.$refs.carousel.clientWidth + MEDIA_ITEM_WIDTH);\n this.$emit('remove-media', index);\n },\n\n closeButton (val, index) {\n this.showCloseButton[index] = val;\n },\n\n handleScroll () {\n const carousel = this.$refs.carousel;\n this.showLeftArrow = carousel.scrollLeft > 0;\n this.showRightArrow = !((carousel.scrollLeft + carousel.clientWidth) === carousel.scrollWidth);\n },\n\n leftScroll () {\n this.$refs.carousel.scrollTo({\n left: this.$refs.carousel.scrollLeft - 100,\n behavior: 'smooth',\n });\n },\n\n rightScroll () {\n this.$refs.carousel.scrollTo({\n left: this.$refs.carousel.scrollLeft + 100,\n behavior: 'smooth',\n });\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtImageViewer","DtButton","DtIconClose","DtProgressBar","DialtoneLocalization","index","MEDIA_ITEM_WIDTH","DtIconArrowRight","DtIconArrowLeft","DtImageCarousel","mediaItem","e","type","val","carousel"],"mappings":"8UACAA,EAAA,CACA,KAAA,gBACA,MAAA,CACA,UAAA,CACA,KAAA,OACA,SAAA,EACA,EAEA,SAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,EAEA,KAAA,KAAA,CACA,o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AA,eAAA,CAAA,SAAA,QAAA,CAAA,CACA,EAEA,eAAAC,EAAA,CACA,OAAAA,EAAA,CACA,IAAA,QACA,MAAA,oBACA,QAEA,OAAA,IACA,CACA,EAEA,gBAAAP,EAAA,CAEA,KAAA,eAAA,KAAA,MAAA,SAAA,YAAA,KAAA,MAAA,SAAA,YAAAC,EACA,KAAA,MAAA,eAAAD,CAAA,CACA,EAEA,YAAAQ,EAAAR,EAAA,CACA,KAAA,gBAAAA,CAAA,EAAAQ,CACA,EAEA,cAAA,CACA,MAAAC,EAAA,KAAA,MAAA,SACA,KAAA,cAAAA,EAAA,WAAA,EACA,KAAA,eAAAA,EAAA,WAAAA,EAAA,cAAAA,EAAA,WACA,EAEA,YAAA,CACA,KAAA,MAAA,SAAA,SAAA,CACA,KAAA,KAAA,MAAA,SAAA,WAAA,IACA,SAAA,QACA,CAAA,CACA,EAEA,aAAA,CACA,KAAA,MAAA,SAAA,SAAA,CACA,KAAA,KAAA,MAAA,SAAA,WAAA,IACA,SAAA,QACA,CAAA,CACA,CACA,CACA"}
|
|
1
|
+
{"version":3,"file":"attachment-carousel.cjs","sources":["../../../recipes/conversation_view/attachment_carousel/media_components/progress_bar.vue","../../../recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue","../../../recipes/conversation_view/attachment_carousel/attachment_carousel.vue"],"sourcesContent":["<script>\nexport default {\n name: 'DtProgressBar',\n props: {\n ariaLabel: {\n type: String,\n required: true,\n },\n\n progress: {\n type: Number,\n default: 20,\n },\n },\n\n data: () => ({\n circleCircumference: 50,\n }),\n\n computed: {\n cssVars () {\n return {\n '--stroke-dashoffset':\n (this.circleCircumference - (this.circleCircumference * this.progress / 100)),\n\n '--stroke-dasharray': this.circleCircumference,\n };\n },\n },\n\n mounted () {\n this.circleCircumference = this.$refs.progressbarCircle.getTotalLength();\n },\n};\n</script>\n\n<template>\n <div\n role=\"progressbar\"\n :aria-label=\"ariaLabel\"\n tabindex=\"-1\"\n :aria-valuenow=\"progress\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n >\n <svg\n class=\"d-recipe-attachment-carousel__progress-bar\"\n :style=\"cssVars\"\n >\n <circle\n ref=\"progressbarCircle\"\n r=\"8\"\n cx=\"12\"\n cy=\"12\"\n class=\"d-recipe-attachment-carousel__progress-bar-circle\"\n />\n <circle\n r=\"8\"\n cx=\"12\"\n cy=\"12\"\n class=\"d-recipe-attachment-carousel__progress-bar-circle\"\n />\n </svg>\n </div>\n</template>\n","<template>\n <li\n class=\"d-recipe-attachment-carousel__image\"\n >\n <dt-image-viewer\n image-button-class=\"d-recipe-attachment-carousel__image-viewer\"\n :image-src=\"mediaItem.path\"\n :image-alt=\"mediaItem.altText\"\n :aria-label=\"i18n.$t('DIALTONE_IMAGE_CAROUSEL_CLICK_TO_OPEN_ARIA_LABEL')\"\n />\n\n <!-- Loader / Close button -->\n <div\n class=\"d-recipe-attachment-carousel__image-top-right\"\n >\n <dt-progress-bar\n v-if=\"mediaItem.isUploading\"\n class=\"d-recipe-attachment-carousel__image-progress-bar\"\n :progress=\"mediaItem.progress\"\n :aria-label=\"i18n.$t('DIALTONE_IMAGE_CAROUSEL_PROGRESS_BAR_ARIA_LABEL')\"\n />\n <dt-button\n :id=\"`closeButton-${index}`\"\n tabindex=\"0\"\n class=\"d-recipe-attachment-carousel__image-close-button\"\n circle\n size=\"xs\"\n importance=\"clear\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"removeMediaItem(index)\"\n >\n <template #icon>\n <dt-icon-close\n size=\"200\"\n />\n </template>\n </dt-button>\n </div>\n </li>\n</template>\n\n<script>\nimport { DtImageViewer } from '@/components/image_viewer';\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue2';\nimport { DialtoneLocalization } from '@/localization';\n\nimport DtProgressBar from './progress_bar.vue';\n\nexport default {\n name: 'DtImageCarousel',\n\n components: {\n DtImageViewer,\n DtButton,\n DtIconClose,\n DtProgressBar,\n },\n\n props: {\n mediaItem: {\n type: Object,\n required: true,\n },\n\n index: {\n type: Number,\n required: true,\n },\n },\n\n emits: [\n /**\n * Emitted when media close button is clicked to remove the image\n *\n * @event remove-media\n * @type {Number}\n */\n 'remove-media',\n ],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n removeMediaItem (index) {\n this.$emit('remove-media', index);\n },\n },\n};\n</script>\n","<template>\n <div\n class=\"d-recipe-attachment-carousel\"\n role=\"presentation\"\n >\n <ul\n v-if=\"mediaList.length > 0\"\n ref=\"carousel\"\n class=\"d-recipe-attachment-carousel__media-list\"\n @scroll=\"handleScroll\"\n >\n <!-- media list -->\n <component\n :is=\"mediaComponent(mediaItem.type)\"\n v-for=\"(mediaItem, index) in filteredMediaList\"\n :key=\"`media-${index}`\"\n :index=\"index\"\n :media-item=\"mediaItem\"\n @remove-media=\"removeMediaItem(index)\"\n @focusin=\"onItemFocus\"\n />\n </ul>\n\n <!-- Carousel Arrows -->\n <dt-button\n v-show=\"showLeftArrow\"\n tabindex=\"-1\"\n :aria-label=\"i18n.$t('DIALTONE_ATTACHMENT_CAROUSEL_LEFT_ARROW_ARIA_LABEL')\"\n class=\"d-recipe-attachment-carousel__arrow d-recipe-attachment-carousel__arrow--left\"\n circle\n size=\"xs\"\n importance=\"clear\"\n @click=\"leftScroll\"\n >\n <template #icon>\n <dt-icon-arrow-left\n size=\"100\"\n />\n </template>\n </dt-button>\n <dt-button\n v-show=\"showRightArrow\"\n tabindex=\"-1\"\n :aria-label=\"i18n.$t('DIALTONE_ATTACHMENT_CAROUSEL_RIGHT_ARROW_ARIA_LABEL')\"\n class=\"d-recipe-attachment-carousel__arrow d-recipe-attachment-carousel__arrow--right\"\n circle\n size=\"xs\"\n importance=\"clear\"\n @click=\"rightScroll\"\n >\n <template #icon>\n <dt-icon-arrow-right\n size=\"100\"\n />\n </template>\n </dt-button>\n </div>\n</template>\n\n<script>\nimport { DtIconArrowRight, DtIconArrowLeft } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { DialtoneLocalization } from '@/localization';\n\nimport DtImageCarousel from './media_components/image_carousel.vue';\n\nconst MEDIA_ITEM_WIDTH = 64;\n\nexport default {\n name: 'DtRecipeAttachmentCarousel',\n\n components: {\n DtButton,\n DtIconArrowRight,\n DtIconArrowLeft,\n DtImageCarousel,\n },\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n // inheritAttrs: false,\n\n props: {\n /**\n * media - object array of media objects\n * @type {Array}\n *\n * Object: {\n * path: String,\n * altText: String | null,\n * }\n */\n mediaList: {\n type: Array,\n default: () => [],\n },\n },\n\n emits: [\n /**\n * Emitted when popover is shown or hidden\n *\n * @event remove-media\n * @type {Number}\n */\n 'remove-media',\n ],\n\n data () {\n return {\n showCloseButton: {},\n showRightArrow: true,\n showLeftArrow: false,\n isMounted: false,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n filteredMediaList () {\n return this.mediaList.filter((mediaItem) => mediaItem.type === 'image' || mediaItem.type === 'video');\n },\n },\n\n mounted: function () {\n this.showLeftArrow = this.$refs.carousel.scrollLeft > 0;\n this.showRightArrow = this.$refs.carousel.scrollWidth > this.$refs.carousel.clientWidth;\n },\n\n methods: {\n onItemFocus (e) {\n e.currentTarget.scrollIntoView({ behavior: 'smooth' });\n },\n\n mediaComponent (type) {\n switch (type) {\n case 'image':\n return 'dt-image-carousel';\n default:\n // unknown media type\n return null;\n }\n },\n\n removeMediaItem (index) {\n // make sure the carousel arrows is updated. 64 is the width of each media item\n this.showRightArrow = this.$refs.carousel.scrollWidth > (this.$refs.carousel.clientWidth + MEDIA_ITEM_WIDTH);\n this.$emit('remove-media', index);\n },\n\n closeButton (val, index) {\n this.showCloseButton[index] = val;\n },\n\n handleScroll () {\n const carousel = this.$refs.carousel;\n this.showLeftArrow = carousel.scrollLeft > 0;\n this.showRightArrow = !((carousel.scrollLeft + carousel.clientWidth) === carousel.scrollWidth);\n },\n\n leftScroll () {\n this.$refs.carousel.scrollTo({\n left: this.$refs.carousel.scrollLeft - 100,\n behavior: 'smooth',\n });\n },\n\n rightScroll () {\n this.$refs.carousel.scrollTo({\n left: this.$refs.carousel.scrollLeft + 100,\n behavior: 'smooth',\n });\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtImageViewer","DtButton","DtIconClose","DtProgressBar","DialtoneLocalization","index","MEDIA_ITEM_WIDTH","DtIconArrowRight","DtIconArrowLeft","DtImageCarousel","mediaItem","e","type","val","carousel"],"mappings":"8UACAA,EAAA,CACA,KAAA,gBACA,MAAA,CACA,UAAA,CACA,KAAA,OACA,SAAA,EACA,EAEA,SAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,EAEA,KAAA,KAAA,CACA,oBAAA,EACA,GAEA,SAAA,CACA,SAAA,CACA,MAAA,CACA,sBACA,KAAA,oBAAA,KAAA,oBAAA,KAAA,SAAA,IAEA,qBAAA,KAAA,mBACA,CACA,CACA,EAEA,SAAA,CACA,KAAA,oBAAA,KAAA,MAAA,kBAAA,eAAA,CACA,CACA,ijBCiBAA,EAAA,CACA,KAAA,kBAEA,WAAA,CACA,cAAAC,EAAAA,QACA,SAAAC,EAAAA,QACA,YAAAC,EAAAA,YACA,cAAAC,CACA,EAEA,MAAA,CACA,UAAA,CACA,KAAA,OACA,SAAA,EACA,EAEA,MAAA,CACA,KAAA,OACA,SAAA,EACA,CACA,EAEA,MAAA,CAOA,cACA,EAEA,MAAA,CACA,MAAA,CACA,KAAA,IAAAC,EAAAA,oBACA,CACA,EAEA,SAAA,CACA,kBAAA,CACA,OAAA,KAAA,KAAA,GAAA,uBAAA,CACA,CACA,EAEA,QAAA,CACA,gBAAAC,EAAA,CACA,KAAA,MAAA,eAAAA,CAAA,CACA,CACA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AA,IACA,SAAA,QACA,CAAA,CACA,CACA,CACA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DtIconClose as n,
|
|
1
|
+
import { DtIconClose as n, DtIconArrowLeft as l, DtIconArrowRight as m } from "@dialpad/dialtone-icons/vue2";
|
|
2
2
|
import { DialtoneLocalization as i } from "../../localization/index.js";
|
|
3
3
|
import { n as o } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
4
|
-
import u from "../image-viewer/image-viewer.js";
|
|
5
4
|
import c from "../button/button.js";
|
|
5
|
+
import u from "../image-viewer/image-viewer.js";
|
|
6
6
|
const _ = {
|
|
7
7
|
name: "DtProgressBar",
|
|
8
8
|
props: {
|
|
@@ -97,8 +97,8 @@ const L = v.exports, C = 64, I = {
|
|
|
97
97
|
name: "DtRecipeAttachmentCarousel",
|
|
98
98
|
components: {
|
|
99
99
|
DtButton: c,
|
|
100
|
-
DtIconArrowRight:
|
|
101
|
-
DtIconArrowLeft:
|
|
100
|
+
DtIconArrowRight: m,
|
|
101
|
+
DtIconArrowLeft: l,
|
|
102
102
|
DtImageCarousel: L
|
|
103
103
|
},
|
|
104
104
|
/* inheritAttrs: false is generally an option we want to set on library
|