@dialpad/dialtone-vue 3.223.0-next.2 → 3.223.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Combobox-CYEmi3dv.cjs +3 -0
- package/dist/Combobox-CYEmi3dv.cjs.map +1 -0
- package/dist/{Combobox-By01ETlj.js → Combobox-D8nQeBIf.js} +33 -32
- package/dist/Combobox-D8nQeBIf.js.map +1 -0
- package/dist/MarkdownRenderer-D5XWsyQk.cjs.map +1 -1
- package/dist/{MarkdownRenderer-C3MZDB2I.js → MarkdownRenderer-NSSny0ID.js} +2 -2
- package/dist/{MarkdownRenderer-C3MZDB2I.js.map → MarkdownRenderer-NSSny0ID.js.map} +1 -1
- package/dist/{RichTextEditor-BX-5tCOx.cjs → RichTextEditor-B9NGgB03.cjs} +2 -2
- package/dist/{RichTextEditor-BX-5tCOx.cjs.map → RichTextEditor-B9NGgB03.cjs.map} +1 -1
- package/dist/{RichTextEditor-D8Kas5A3.js → RichTextEditor-DxbZSRop.js} +4 -4
- package/dist/{RichTextEditor-D8Kas5A3.js.map → RichTextEditor-DxbZSRop.js.map} +1 -1
- package/dist/TextList-B6XFfQfD.js +88 -0
- package/dist/TextList-B6XFfQfD.js.map +1 -0
- package/dist/TextList-Dd-ROFiI.cjs +2 -0
- package/dist/TextList-Dd-ROFiI.cjs.map +1 -0
- package/dist/TextListItem-DIlrCkaM.cjs +2 -0
- package/dist/TextListItem-DIlrCkaM.cjs.map +1 -0
- package/dist/TextListItem-ImUi_FWh.js +62 -0
- package/dist/TextListItem-ImUi_FWh.js.map +1 -0
- package/dist/{Toast-CHbVmbBg.js → Toast-BIHkIpZP.js} +95 -94
- package/dist/Toast-BIHkIpZP.js.map +1 -0
- package/dist/Toast-D8ARDEgT.cjs +2 -0
- package/dist/Toast-D8ARDEgT.cjs.map +1 -0
- package/dist/{attachment_carousel-BFIAXWOZ.js → attachment_carousel-CyiexPBk.js} +1 -1
- package/dist/{attachment_carousel-BFIAXWOZ.js.map → attachment_carousel-CyiexPBk.js.map} +1 -1
- package/dist/{attachment_carousel-BJxqNJ5T.cjs → attachment_carousel-DJqILY7f.cjs} +1 -1
- package/dist/{attachment_carousel-BJxqNJ5T.cjs.map → attachment_carousel-DJqILY7f.cjs.map} +1 -1
- package/dist/common/mixins/input.d.ts +4 -4
- package/dist/common/mixins/input_group.d.ts +2 -2
- package/dist/common/sr_only_close_button.vue.d.ts +30 -30
- package/dist/common/sr_only_close_button.vue.d.ts.map +1 -1
- package/dist/common/validators/index.cjs +1 -1
- package/dist/common/validators/index.cjs.map +1 -1
- package/dist/common/validators/index.d.ts +2 -0
- package/dist/common/validators/index.d.ts.map +1 -1
- package/dist/common/validators/index.js +9 -2
- package/dist/common/validators/index.js.map +1 -1
- package/dist/component-documentation.json +1 -1
- package/dist/components/Avatar/Avatar.vue.d.ts +10 -10
- package/dist/components/Avatar/Avatar.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.vue.d.ts +13 -13
- package/dist/components/Banner/Banner.vue.d.ts +142 -107
- package/dist/components/Banner/Banner.vue.d.ts.map +1 -1
- package/dist/components/Box/Box.vue.d.ts +18 -0
- package/dist/components/Box/Box.vue.d.ts.map +1 -1
- package/dist/components/Box/BoxConstants.d.ts +4 -0
- package/dist/components/Box/BoxConstants.d.ts.map +1 -1
- package/dist/components/Box/Validators.d.ts +4 -0
- package/dist/components/Box/Validators.d.ts.map +1 -1
- package/dist/components/Box/index.d.ts +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +1 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +3 -2
- package/dist/components/Button/Button.vue.d.ts +25 -25
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Card/Card.vue.d.ts +6 -6
- package/dist/components/Checkbox/Checkbox.vue.d.ts +62 -27
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +82 -47
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts.map +1 -1
- package/dist/components/Chip/Chip.vue.d.ts +40 -40
- package/dist/components/Chip/Chip.vue.d.ts.map +1 -1
- package/dist/components/Codeblock/Codeblock.vue.d.ts +2 -2
- package/dist/components/Collapsible/Collapsible.vue.d.ts +39 -39
- package/dist/components/Collapsible/Collapsible.vue.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.vue.d.ts +66 -66
- package/dist/components/Combobox/Combobox.vue.d.ts.map +1 -1
- package/dist/components/Combobox/ComboboxEmptyList.vue.d.ts +29 -29
- package/dist/components/Combobox/ComboboxEmptyList.vue.d.ts.map +1 -1
- package/dist/components/Combobox/ComboboxLoadingList.vue.d.ts +35 -35
- package/dist/components/Combobox/ComboboxLoadingList.vue.d.ts.map +1 -1
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts +216 -216
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.vue.d.ts +4 -4
- package/dist/components/Dropdown/Dropdown.vue.d.ts +82 -82
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/Emoji/Emoji.vue.d.ts +17 -17
- package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts +73 -38
- package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts.map +1 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts +73 -38
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts.map +1 -1
- package/dist/components/EmojiTextWrapper/EmojiTextWrapper.vue.d.ts +24 -24
- package/dist/components/EmojiTextWrapper/EmojiTextWrapper.vue.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPill.vue.d.ts +380 -310
- package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
- package/dist/components/Hovercard/Hovercard.vue.d.ts +156 -156
- package/dist/components/Hovercard/Hovercard.vue.d.ts.map +1 -1
- package/dist/components/Icon/Icon.vue.d.ts +7 -7
- package/dist/components/ImageViewer/ImageViewer.vue.d.ts +60 -60
- package/dist/components/ImageViewer/ImageViewer.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +73 -38
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts +82 -47
- package/dist/components/InputGroup/InputGroup.vue.d.ts.map +1 -1
- package/dist/components/ItemLayout/ItemLayout.vue.d.ts +20 -20
- package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts +116 -81
- package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts.map +1 -1
- package/dist/components/Link/Link.vue.d.ts +1 -0
- package/dist/components/Link/LinkConstants.d.ts +3 -0
- package/dist/components/Link/LinkConstants.d.ts.map +1 -1
- package/dist/components/ListItem/ListItem.vue.d.ts +27 -27
- package/dist/components/ListItem/ListItem.vue.d.ts.map +1 -1
- package/dist/components/ListItemGroup/ListItemGroup.vue.d.ts +4 -4
- package/dist/components/Loader/Loader.vue.d.ts +7 -7
- package/dist/components/Modal/Modal.vue.d.ts +115 -86
- package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
- package/dist/components/Modal/ModalConstants.d.ts +0 -5
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Notice/Notice.vue.d.ts +142 -107
- package/dist/components/Notice/Notice.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeAction.vue.d.ts +62 -62
- package/dist/components/Notice/NoticeAction.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts +40 -5
- package/dist/components/Notice/NoticeContent.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeIcon.vue.d.ts +32 -32
- package/dist/components/Notice/NoticeIcon.vue.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.vue.d.ts +40 -40
- package/dist/components/Pagination/Pagination.vue.d.ts.map +1 -1
- package/dist/components/Popover/Popover.vue.d.ts +78 -78
- package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
- package/dist/components/Popover/PopoverHeaderFooter.vue.d.ts +34 -34
- package/dist/components/Popover/PopoverHeaderFooter.vue.d.ts.map +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.vue.d.ts +7 -7
- package/dist/components/Prose/Prose.vue.d.ts.map +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +62 -27
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts +82 -47
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Channels/ChannelComponent.vue.d.ts +6 -5
- package/dist/components/RichTextEditor/Extensions/Channels/ChannelComponent.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Channels/ChannelSuggestion.vue.d.ts +10 -10
- package/dist/components/RichTextEditor/Extensions/Channels/ChannelSuggestion.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Emoji/EmojiComponent.vue.d.ts +17 -17
- package/dist/components/RichTextEditor/Extensions/Emoji/EmojiSuggestion.vue.d.ts +17 -17
- package/dist/components/RichTextEditor/Extensions/Mentions/MentionComponent.vue.d.ts +1 -0
- package/dist/components/RichTextEditor/Extensions/Mentions/MentionSuggestion.vue.d.ts +46 -11
- package/dist/components/RichTextEditor/Extensions/SlashCommand/SlashCommandSuggestion.vue.d.ts +36 -1
- package/dist/components/RichTextEditor/Extensions/Suggestion/SuggestionList.vue.d.ts +27 -27
- package/dist/components/RichTextEditor/Extensions/Suggestion/SuggestionList.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +189 -154
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts.map +1 -1
- package/dist/components/RootLayout/RootLayout.vue.d.ts +10 -10
- package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts.map +1 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts +69 -34
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.vue.d.ts +8 -8
- package/dist/components/Skeleton/SkeletonListItem.vue.d.ts +4 -4
- package/dist/components/Skeleton/SkeletonParagraph.vue.d.ts +2 -2
- package/dist/components/Skeleton/SkeletonShape.vue.d.ts +2 -2
- package/dist/components/SplitButton/SplitButton.vue.d.ts +157 -157
- package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButtonEnd.vue.d.ts +30 -30
- package/dist/components/SplitButton/SplitButtonEnd.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButtonStart.vue.d.ts +31 -31
- package/dist/components/Tab/Tab.vue.d.ts +33 -33
- package/dist/components/Tab/TabGroup.vue.d.ts +6 -6
- package/dist/components/Tab/TabPanel.vue.d.ts +2 -2
- package/dist/components/Text/Text.vue.d.ts +36 -1
- package/dist/components/Text/Text.vue.d.ts.map +1 -1
- package/dist/components/Text/TextConstants.d.ts +53 -0
- package/dist/components/Text/TextConstants.d.ts.map +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/TextList/TextList.vue.d.ts +87 -0
- package/dist/components/TextList/TextList.vue.d.ts.map +1 -0
- package/dist/components/TextList/TextListConstants.d.ts +20 -0
- package/dist/components/TextList/TextListConstants.d.ts.map +1 -0
- package/dist/components/TextList/TextListItem.vue.d.ts +60 -0
- package/dist/components/TextList/TextListItem.vue.d.ts.map +1 -0
- package/dist/components/TextList/Validators.d.ts +5 -0
- package/dist/components/TextList/Validators.d.ts.map +1 -0
- package/dist/components/TextList/index.d.ts +4 -0
- package/dist/components/TextList/index.d.ts.map +1 -0
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts +144 -109
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts.map +1 -1
- package/dist/components/Toast/Layouts/ToastLayoutAlternateIcon.vue.d.ts +34 -34
- package/dist/components/Toast/Layouts/ToastLayoutAlternateIcon.vue.d.ts.map +1 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts +142 -107
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +580 -440
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.vue.d.ts +4 -4
- package/dist/components/Toggle/Toggle.vue.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.vue.d.ts +4 -4
- package/dist/components/ValidationMessages/ValidationMessages.vue.d.ts +22 -22
- package/dist/components/ValidationMessages/ValidationMessages.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +146 -142
- package/dist/index.d.ts +1 -0
- package/dist/lib/attachment-carousel/attachment-carousel.cjs +1 -1
- package/dist/lib/attachment-carousel/attachment-carousel.js +1 -1
- package/dist/lib/attachment-carousel/index.cjs +1 -1
- package/dist/lib/attachment-carousel/index.js +1 -1
- package/dist/lib/avatar/avatar.cjs +1 -1
- package/dist/lib/avatar/avatar.cjs.map +1 -1
- package/dist/lib/avatar/avatar.js +55 -54
- package/dist/lib/avatar/avatar.js.map +1 -1
- package/dist/lib/badge/badge.cjs +1 -1
- package/dist/lib/badge/badge.cjs.map +1 -1
- package/dist/lib/badge/badge.js +36 -35
- package/dist/lib/badge/badge.js.map +1 -1
- package/dist/lib/box/box-constants.cjs +1 -1
- package/dist/lib/box/box-constants.cjs.map +1 -1
- package/dist/lib/box/box-constants.js +34 -7
- package/dist/lib/box/box-constants.js.map +1 -1
- package/dist/lib/box/box.cjs +1 -1
- package/dist/lib/box/box.cjs.map +1 -1
- package/dist/lib/box/box.js +93 -34
- package/dist/lib/box/box.js.map +1 -1
- package/dist/lib/box/index.cjs +1 -1
- package/dist/lib/box/index.js +3 -3
- package/dist/lib/box/validators.cjs +1 -1
- package/dist/lib/box/validators.cjs.map +1 -1
- package/dist/lib/box/validators.js +4 -4
- package/dist/lib/box/validators.js.map +1 -1
- package/dist/lib/button/button.cjs +1 -1
- package/dist/lib/button/button.cjs.map +1 -1
- package/dist/lib/button/button.js +69 -68
- package/dist/lib/button/button.js.map +1 -1
- package/dist/lib/chip/chip.cjs +1 -1
- package/dist/lib/chip/chip.cjs.map +1 -1
- package/dist/lib/chip/chip.js +36 -35
- package/dist/lib/chip/chip.js.map +1 -1
- package/dist/lib/codeblock/codeblock.cjs +1 -1
- package/dist/lib/codeblock/codeblock.cjs.map +1 -1
- package/dist/lib/codeblock/codeblock.js +11 -10
- package/dist/lib/codeblock/codeblock.js.map +1 -1
- package/dist/lib/combobox/combobox.cjs +1 -1
- package/dist/lib/combobox/combobox.js +1 -1
- package/dist/lib/combobox/index.cjs +1 -1
- package/dist/lib/combobox/index.js +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.js +53 -53
- package/dist/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.js +48 -47
- package/dist/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
- package/dist/lib/editor/editor.cjs +1 -1
- package/dist/lib/editor/editor.js +2 -2
- package/dist/lib/emoji/emoji.cjs +1 -1
- package/dist/lib/emoji/emoji.cjs.map +1 -1
- package/dist/lib/emoji/emoji.js +25 -24
- package/dist/lib/emoji/emoji.js.map +1 -1
- package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.cjs +1 -1
- package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.cjs.map +1 -1
- package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.js +20 -19
- package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.js.map +1 -1
- package/dist/lib/empty-state/empty-state.cjs +1 -1
- package/dist/lib/empty-state/empty-state.cjs.map +1 -1
- package/dist/lib/empty-state/empty-state.js +31 -30
- package/dist/lib/empty-state/empty-state.js.map +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs.map +1 -1
- package/dist/lib/filter-pill/filter-pill.js +73 -72
- package/dist/lib/filter-pill/filter-pill.js.map +1 -1
- package/dist/lib/icon/icon.cjs +1 -1
- package/dist/lib/icon/icon.cjs.map +1 -1
- package/dist/lib/icon/icon.js +16 -15
- package/dist/lib/icon/icon.js.map +1 -1
- package/dist/lib/input/input.cjs +1 -1
- package/dist/lib/input/input.cjs.map +1 -1
- package/dist/lib/input/input.js +64 -63
- package/dist/lib/input/input.js.map +1 -1
- package/dist/lib/link/link-constants.cjs +1 -1
- package/dist/lib/link/link-constants.cjs.map +1 -1
- package/dist/lib/link/link-constants.js +11 -9
- package/dist/lib/link/link-constants.js.map +1 -1
- package/dist/lib/link/link.cjs +1 -1
- package/dist/lib/link/link.cjs.map +1 -1
- package/dist/lib/link/link.js +17 -14
- package/dist/lib/link/link.js.map +1 -1
- package/dist/lib/loader/loader.cjs +3 -3
- package/dist/lib/loader/loader.cjs.map +1 -1
- package/dist/lib/loader/loader.js +21 -20
- package/dist/lib/loader/loader.js.map +1 -1
- package/dist/lib/message-input/index.cjs +1 -1
- package/dist/lib/message-input/index.js +1 -1
- package/dist/lib/message-input/message-input.cjs +1 -1
- package/dist/lib/message-input/message-input.js +1 -1
- package/dist/lib/modal/index.cjs +1 -1
- package/dist/lib/modal/index.js +3 -3
- package/dist/lib/modal/modal-constants.cjs +1 -1
- package/dist/lib/modal/modal-constants.cjs.map +1 -1
- package/dist/lib/modal/modal-constants.js +1 -4
- package/dist/lib/modal/modal-constants.js.map +1 -1
- package/dist/lib/modal/modal.cjs +1 -1
- package/dist/lib/modal/modal.cjs.map +1 -1
- package/dist/lib/modal/modal.js +40 -42
- package/dist/lib/modal/modal.js.map +1 -1
- package/dist/lib/popover/popover.cjs +1 -1
- package/dist/lib/popover/popover.cjs.map +1 -1
- package/dist/lib/popover/popover.js +1 -1
- package/dist/lib/popover/popover.js.map +1 -1
- package/dist/lib/progress-circle/progress-circle.cjs +1 -1
- package/dist/lib/progress-circle/progress-circle.cjs.map +1 -1
- package/dist/lib/progress-circle/progress-circle.js +33 -32
- package/dist/lib/progress-circle/progress-circle.js.map +1 -1
- package/dist/lib/prose/prose.cjs +1 -1
- package/dist/lib/prose/prose.cjs.map +1 -1
- package/dist/lib/prose/prose.js +23 -22
- package/dist/lib/prose/prose.js.map +1 -1
- package/dist/lib/rich-text-editor/index.cjs +1 -1
- package/dist/lib/rich-text-editor/index.js +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.js +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/lib/segmented-control/segmented-control.cjs +1 -1
- package/dist/lib/segmented-control/segmented-control.cjs.map +1 -1
- package/dist/lib/segmented-control/segmented-control.js +42 -41
- package/dist/lib/segmented-control/segmented-control.js.map +1 -1
- package/dist/lib/select-menu/select-menu.cjs +1 -1
- package/dist/lib/select-menu/select-menu.cjs.map +1 -1
- package/dist/lib/select-menu/select-menu.js +48 -47
- package/dist/lib/select-menu/select-menu.js.map +1 -1
- package/dist/lib/split-button/split-button.cjs +1 -1
- package/dist/lib/split-button/split-button.cjs.map +1 -1
- package/dist/lib/split-button/split-button.js +45 -44
- package/dist/lib/split-button/split-button.js.map +1 -1
- package/dist/lib/tab/tab-group.cjs +1 -1
- package/dist/lib/tab/tab-group.cjs.map +1 -1
- package/dist/lib/tab/tab-group.js +34 -35
- package/dist/lib/tab/tab-group.js.map +1 -1
- package/dist/lib/text/index.cjs +1 -1
- package/dist/lib/text/index.js +3 -3
- package/dist/lib/text/text-constants.cjs +1 -1
- package/dist/lib/text/text-constants.cjs.map +1 -1
- package/dist/lib/text/text-constants.js +70 -21
- package/dist/lib/text/text-constants.js.map +1 -1
- package/dist/lib/text/text.cjs +1 -1
- package/dist/lib/text/text.cjs.map +1 -1
- package/dist/lib/text/text.js +72 -37
- package/dist/lib/text/text.js.map +1 -1
- package/dist/lib/text-list/index.cjs +1 -0
- package/dist/lib/text-list/index.js +4 -0
- package/dist/lib/text-list/text-list-constants.cjs +2 -0
- package/dist/lib/text-list/text-list-constants.cjs.map +1 -0
- package/dist/lib/text-list/text-list-constants.js +31 -0
- package/dist/lib/text-list/text-list-constants.js.map +1 -0
- package/dist/lib/text-list/text-list-item.cjs +1 -0
- package/dist/lib/text-list/text-list-item.js +2 -0
- package/dist/lib/text-list/text-list.cjs +1 -0
- package/dist/lib/text-list/text-list.js +2 -0
- package/dist/lib/text-list/validators.cjs +2 -0
- package/dist/lib/text-list/validators.cjs.map +1 -0
- package/dist/lib/text-list/validators.js +10 -0
- package/dist/lib/text-list/validators.js.map +1 -0
- package/dist/lib/toast/index.cjs +1 -1
- package/dist/lib/toast/index.js +1 -1
- package/dist/lib/toast/toast.cjs +1 -1
- package/dist/lib/toast/toast.js +1 -1
- package/dist/lib/toggle/toggle.cjs +1 -1
- package/dist/lib/toggle/toggle.cjs.map +1 -1
- package/dist/lib/toggle/toggle.js +23 -22
- package/dist/lib/toggle/toggle.js.map +1 -1
- package/dist/{message_input-CbQCd07F.js → message_input-C6BcWqr8.js} +2 -2
- package/dist/{message_input-CbQCd07F.js.map → message_input-C6BcWqr8.js.map} +1 -1
- package/dist/{message_input-dBQwgyjI.cjs → message_input-ftx8f8wC.cjs} +2 -2
- package/dist/{message_input-dBQwgyjI.cjs.map → message_input-ftx8f8wC.cjs.map} +1 -1
- package/dist/node_modules/@tiptap/vue-3.cjs.map +1 -1
- package/dist/node_modules/@tiptap/vue-3.js +1 -1
- package/dist/node_modules/@tiptap/vue-3.js.map +1 -1
- package/dist/recipes/buttons/callbar_button/callbar_button.vue.d.ts +33 -33
- package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +149 -149
- package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
- package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +147 -147
- package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts +173 -173
- package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/recipes/chips/grouped_chip/grouped_chip.vue.d.ts +40 -40
- package/dist/recipes/chips/grouped_chip/grouped_chip.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +132 -132
- package/dist/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +97 -97
- package/dist/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/editor/EditorToolbarButton.vue.d.ts +25 -25
- package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts +107 -107
- package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts +103 -103
- package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/editor/editor.vue.d.ts +672 -637
- package/dist/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +70 -70
- package/dist/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +66 -66
- package/dist/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +55 -55
- package/dist/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +55 -55
- package/dist/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts +784 -609
- package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input_button.vue.d.ts +145 -110
- package/dist/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts +326 -256
- package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +185 -150
- package/dist/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
- package/dist/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts +30 -30
- package/dist/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts.map +1 -1
- package/dist/recipes/item_layout/contact_info/contact_info.vue.d.ts +30 -30
- package/dist/recipes/leftbar/callbox/callbox.vue.d.ts +28 -28
- package/dist/recipes/leftbar/callbox/callbox.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +72 -72
- package/dist/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/contact_row/contact_row.vue.d.ts +215 -215
- package/dist/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/general_row/general_row.vue.d.ts +176 -176
- package/dist/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +80 -80
- package/dist/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/group_row/group_row.vue.d.ts +181 -181
- package/dist/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +10 -10
- package/dist/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/Combobox-By01ETlj.js.map +0 -1
- package/dist/Combobox-D4hc1-41.cjs +0 -3
- package/dist/Combobox-D4hc1-41.cjs.map +0 -1
- package/dist/Toast-CHbVmbBg.js.map +0 -1
- package/dist/Toast-DX-REYXG.cjs +0 -2
- package/dist/Toast-DX-REYXG.cjs.map +0 -1
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { HTML_ELEMENT_TYPE as e } from "../../common/constants/index.js";
|
|
2
|
-
import { t } from "../../
|
|
3
|
-
import { t as n } from "../../
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import o from "
|
|
7
|
-
import s from "../
|
|
8
|
-
import c from "../checkbox
|
|
9
|
-
import l from "../
|
|
10
|
-
import u from "../
|
|
11
|
-
import
|
|
12
|
-
import p from "../popover/popover.js";
|
|
13
|
-
import m from "../
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
2
|
+
import { ordinalSizeValidator as t } from "../../common/validators/index.js";
|
|
3
|
+
import { t as n } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
4
|
+
import { t as r } from "../../mode_constants-tb7TL85q.js";
|
|
5
|
+
import { BUTTON_ICON_SIZES as i, BUTTON_SIZE_MODIFIERS as a } from "../button/button-constants.js";
|
|
6
|
+
import { DialtoneLocalization as o } from "../../localization/index.js";
|
|
7
|
+
import s from "../button/button.js";
|
|
8
|
+
import c from "../checkbox/checkbox.js";
|
|
9
|
+
import l from "../checkbox-group/checkbox-group.js";
|
|
10
|
+
import u from "../list-item/list-item.js";
|
|
11
|
+
import d from "../stack/stack.js";
|
|
12
|
+
import { POPOVER_APPEND_TO_VALUES as f, POPOVER_PADDING_CLASSES as p } from "../popover/popover-constants.js";
|
|
13
|
+
import m from "../popover/popover.js";
|
|
14
|
+
import h from "../dropdown/dropdown.js";
|
|
15
|
+
import { Fragment as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createSlots as x, createTextVNode as S, createVNode as C, mergeProps as w, normalizeClass as T, openBlock as E, renderList as D, renderSlot as O, resolveComponent as k, resolveDirective as A, resolveDynamicComponent as j, toDisplayString as M, withCtx as N, withDirectives as P, withKeys as F, withModifiers as I } from "vue";
|
|
16
|
+
import { DtIconChevronDown as L, DtIconClose as R } from "@dialpad/dialtone-icons/vue";
|
|
16
17
|
//#region components/FilterPill/FilterPill.vue
|
|
17
|
-
var
|
|
18
|
+
var z = {
|
|
18
19
|
name: "DtFilterPill",
|
|
19
20
|
components: {
|
|
20
|
-
DtCheckboxGroup:
|
|
21
|
-
DtCheckbox:
|
|
22
|
-
DtPopover:
|
|
23
|
-
DtButton:
|
|
24
|
-
DtIconClose:
|
|
25
|
-
DtIconChevronDown:
|
|
26
|
-
DtDropdown:
|
|
27
|
-
DtListItem:
|
|
28
|
-
DtStack:
|
|
21
|
+
DtCheckboxGroup: l,
|
|
22
|
+
DtCheckbox: c,
|
|
23
|
+
DtPopover: m,
|
|
24
|
+
DtButton: s,
|
|
25
|
+
DtIconClose: R,
|
|
26
|
+
DtIconChevronDown: L,
|
|
27
|
+
DtDropdown: h,
|
|
28
|
+
DtListItem: u,
|
|
29
|
+
DtStack: d
|
|
29
30
|
},
|
|
30
31
|
props: {
|
|
31
32
|
useDropdown: {
|
|
@@ -67,7 +68,7 @@ var R = {
|
|
|
67
68
|
popoverAppendTo: {
|
|
68
69
|
type: [e, String],
|
|
69
70
|
default: "body",
|
|
70
|
-
validator: (e) =>
|
|
71
|
+
validator: (e) => f.includes(e) || e instanceof HTMLElement
|
|
71
72
|
},
|
|
72
73
|
popoverFallbackPlacements: {
|
|
73
74
|
type: Array,
|
|
@@ -84,7 +85,7 @@ var R = {
|
|
|
84
85
|
popoverPadding: {
|
|
85
86
|
type: String,
|
|
86
87
|
default: "large",
|
|
87
|
-
validator: (e) => Object.keys(
|
|
88
|
+
validator: (e) => Object.keys(p).some((t) => t === e)
|
|
88
89
|
},
|
|
89
90
|
popoverPlacement: {
|
|
90
91
|
type: String,
|
|
@@ -138,11 +139,11 @@ var R = {
|
|
|
138
139
|
],
|
|
139
140
|
default: ""
|
|
140
141
|
},
|
|
141
|
-
contentMode:
|
|
142
|
+
contentMode: r,
|
|
142
143
|
size: {
|
|
143
144
|
type: [String, Number],
|
|
144
145
|
default: 200,
|
|
145
|
-
validator: (
|
|
146
|
+
validator: t(a)
|
|
146
147
|
}
|
|
147
148
|
},
|
|
148
149
|
emits: [
|
|
@@ -154,7 +155,7 @@ var R = {
|
|
|
154
155
|
data() {
|
|
155
156
|
return {
|
|
156
157
|
isOpen: !1,
|
|
157
|
-
i18n: new
|
|
158
|
+
i18n: new o(),
|
|
158
159
|
filters: this.modelValue,
|
|
159
160
|
pendingFilters: null
|
|
160
161
|
};
|
|
@@ -214,7 +215,7 @@ var R = {
|
|
|
214
215
|
return this.i18n.$t("DIALTONE_FILTER_PILL_APPLY_BUTTON_LABEL");
|
|
215
216
|
},
|
|
216
217
|
clearIconSize() {
|
|
217
|
-
return String(this.size) === "100" ? "100" :
|
|
218
|
+
return String(this.size) === "100" ? "100" : i[String(this.size)];
|
|
218
219
|
}
|
|
219
220
|
},
|
|
220
221
|
watch: {
|
|
@@ -252,17 +253,17 @@ var R = {
|
|
|
252
253
|
this.isOpen = !1;
|
|
253
254
|
}
|
|
254
255
|
}
|
|
255
|
-
},
|
|
256
|
-
function
|
|
257
|
-
let o =
|
|
258
|
-
return
|
|
259
|
-
class:
|
|
256
|
+
}, B = ["title", "textContent"], V = ["title", "textContent"], H = ["title", "textContent"];
|
|
257
|
+
function U(e, t, n, r, i, a) {
|
|
258
|
+
let o = k("dt-icon-chevron-down"), s = k("dt-button"), c = k("dt-checkbox"), l = k("dt-checkbox-group"), u = k("dt-stack"), d = k("dt-list-item"), f = k("dt-icon-close"), p = A("dt-tooltip");
|
|
259
|
+
return E(), y("div", {
|
|
260
|
+
class: T(["d-filter-pill", { "d-filter-pill--read-only": n.readOnly }]),
|
|
260
261
|
"data-qa": "dt-filter-pill"
|
|
261
|
-
}, [(
|
|
262
|
+
}, [(E(), _(j(a.overlayComponent), w({
|
|
262
263
|
open: i.isOpen,
|
|
263
264
|
"onUpdate:open": t[0] || (t[0] = (e) => i.isOpen = e)
|
|
264
|
-
}, a.overlayProps, { "content-mode": n.contentMode }),
|
|
265
|
-
anchor:
|
|
265
|
+
}, a.overlayProps, { "content-mode": n.contentMode }), x({
|
|
266
|
+
anchor: N((t) => [P((E(), _(s, w(n.useDropdown ? t : t.attrs, {
|
|
266
267
|
active: a.isActive,
|
|
267
268
|
"aria-disabled": n.readOnly || void 0,
|
|
268
269
|
class: ["d-filter-pill__primary", { "d-filter-pill--selected": a.isActive }],
|
|
@@ -272,41 +273,41 @@ function H(e, t, n, r, i, a) {
|
|
|
272
273
|
"data-qa": "dt-filter-pill__button",
|
|
273
274
|
importance: "outlined",
|
|
274
275
|
onClick: a.openPopover,
|
|
275
|
-
onKeydown:
|
|
276
|
-
}),
|
|
277
|
-
default:
|
|
276
|
+
onKeydown: F(I(a.openPopover, ["prevent"]), ["up", "down"])
|
|
277
|
+
}), x({
|
|
278
|
+
default: N(() => [b("span", { class: T(["d-filter-pill__label", n.labelClass]) }, [O(e.$slots, "default", {
|
|
278
279
|
label: n.label,
|
|
279
280
|
filters: i.filters,
|
|
280
281
|
activeFilters: a.activeFilters,
|
|
281
282
|
activeFilterList: a.activeFilterList,
|
|
282
283
|
activeFilterOverflow: a.activeFilterOverflow
|
|
283
284
|
}, () => [
|
|
284
|
-
|
|
285
|
+
b("span", {
|
|
285
286
|
class: "d-filter-pill__label-start",
|
|
286
287
|
title: n.label,
|
|
287
|
-
textContent:
|
|
288
|
-
}, null, 8,
|
|
289
|
-
a.activeFilterList ? (
|
|
288
|
+
textContent: M(n.label)
|
|
289
|
+
}, null, 8, B),
|
|
290
|
+
a.activeFilterList ? (E(), y("span", {
|
|
290
291
|
key: 0,
|
|
291
292
|
class: "d-filter-pill__label-end",
|
|
292
293
|
title: a.activeFilterList,
|
|
293
|
-
textContent:
|
|
294
|
-
}, null, 8,
|
|
295
|
-
a.activeFilterOverflow ? (
|
|
294
|
+
textContent: M(a.activeFilterList)
|
|
295
|
+
}, null, 8, V)) : v("", !0),
|
|
296
|
+
a.activeFilterOverflow ? (E(), y("span", {
|
|
296
297
|
key: 1,
|
|
297
298
|
class: "d-filter-pill__label-end-overflow",
|
|
298
299
|
title: `plus ${a.activeFilters.length - 1} others`,
|
|
299
|
-
textContent:
|
|
300
|
-
}, null, 8,
|
|
300
|
+
textContent: M(a.activeFilterOverflow)
|
|
301
|
+
}, null, 8, H)) : v("", !0)
|
|
301
302
|
])], 2)]),
|
|
302
303
|
_: 2
|
|
303
304
|
}, [e.$slots.startIcon ? {
|
|
304
305
|
name: "startIcon",
|
|
305
|
-
fn:
|
|
306
|
+
fn: N(({ iconSize: t }) => [O(e.$slots, "startIcon", { iconSize: t })]),
|
|
306
307
|
key: "0"
|
|
307
308
|
} : void 0, n.readOnly ? void 0 : {
|
|
308
309
|
name: "endIcon",
|
|
309
|
-
fn:
|
|
310
|
+
fn: N(({ iconSize: e }) => [C(o, {
|
|
310
311
|
size: e,
|
|
311
312
|
class: "d-filter-pill__icon",
|
|
312
313
|
"data-qa": "dt-filter-pill__icon"
|
|
@@ -326,18 +327,18 @@ function H(e, t, n, r, i, a) {
|
|
|
326
327
|
}, [
|
|
327
328
|
n.useDropdown ? void 0 : {
|
|
328
329
|
name: "content",
|
|
329
|
-
fn:
|
|
330
|
+
fn: N(({ close: t }) => [O(e.$slots, "content", {
|
|
330
331
|
close: t,
|
|
331
332
|
apply: a.applySelection,
|
|
332
333
|
cancel: a.cancelSelection,
|
|
333
334
|
pendingFilters: i.pendingFilters
|
|
334
|
-
}, () => [n.modelValue?.length ? (
|
|
335
|
+
}, () => [n.modelValue?.length ? (E(), _(l, {
|
|
335
336
|
key: 0,
|
|
336
337
|
"model-value": n.deferSelection ? a.pendingActiveFilters : a.activeFilters,
|
|
337
338
|
"aria-label": n.label,
|
|
338
339
|
name: n.label || "filter-pill"
|
|
339
340
|
}, {
|
|
340
|
-
default:
|
|
341
|
+
default: N(() => [(E(!0), y(g, null, D(a.displayFilters, (e) => (E(), _(c, {
|
|
341
342
|
key: e.name,
|
|
342
343
|
label: e.name,
|
|
343
344
|
value: e.name,
|
|
@@ -352,68 +353,68 @@ function H(e, t, n, r, i, a) {
|
|
|
352
353
|
"model-value",
|
|
353
354
|
"aria-label",
|
|
354
355
|
"name"
|
|
355
|
-
])) :
|
|
356
|
+
])) : v("", !0)])]),
|
|
356
357
|
key: "0"
|
|
357
358
|
},
|
|
358
359
|
!n.useDropdown && e.$slots.headerContent ? {
|
|
359
360
|
name: "headerContent",
|
|
360
|
-
fn:
|
|
361
|
+
fn: N(({ close: t }) => [O(e.$slots, "headerContent", { close: t })]),
|
|
361
362
|
key: "1"
|
|
362
363
|
} : void 0,
|
|
363
364
|
!n.useDropdown && (n.deferSelection || e.$slots.footerContent) ? {
|
|
364
365
|
name: "footerContent",
|
|
365
|
-
fn:
|
|
366
|
+
fn: N(({ close: t }) => [O(e.$slots, "footerContent", {
|
|
366
367
|
close: t,
|
|
367
368
|
apply: a.applySelection,
|
|
368
369
|
cancel: a.cancelSelection
|
|
369
|
-
}, () => [n.deferSelection ? (
|
|
370
|
+
}, () => [n.deferSelection ? (E(), _(u, {
|
|
370
371
|
key: 0,
|
|
371
372
|
direction: "row",
|
|
372
373
|
gap: "400",
|
|
373
374
|
justify: "end",
|
|
374
375
|
"data-qa": "dt-filter-pill__deferred-footer"
|
|
375
376
|
}, {
|
|
376
|
-
default:
|
|
377
|
+
default: N(() => [C(s, {
|
|
377
378
|
importance: "clear",
|
|
378
379
|
kind: "muted",
|
|
379
380
|
size: 200,
|
|
380
381
|
"data-qa": "dt-filter-pill__cancel-button",
|
|
381
382
|
onClick: a.cancelSelection
|
|
382
383
|
}, {
|
|
383
|
-
default:
|
|
384
|
+
default: N(() => [S(M(a.cancelButtonLabel), 1)]),
|
|
384
385
|
_: 1
|
|
385
|
-
}, 8, ["onClick"]),
|
|
386
|
+
}, 8, ["onClick"]), C(s, {
|
|
386
387
|
importance: "primary",
|
|
387
388
|
size: 200,
|
|
388
389
|
"data-qa": "dt-filter-pill__apply-button",
|
|
389
390
|
onClick: a.applySelection
|
|
390
391
|
}, {
|
|
391
|
-
default:
|
|
392
|
+
default: N(() => [S(M(a.applyButtonLabel), 1)]),
|
|
392
393
|
_: 1
|
|
393
394
|
}, 8, ["onClick"])]),
|
|
394
395
|
_: 1
|
|
395
|
-
})) :
|
|
396
|
+
})) : v("", !0)])]),
|
|
396
397
|
key: "2"
|
|
397
398
|
} : void 0,
|
|
398
399
|
n.useDropdown ? {
|
|
399
400
|
name: "list",
|
|
400
|
-
fn:
|
|
401
|
+
fn: N(({ close: t }) => [O(e.$slots, "content", { close: t }, () => [(E(!0), y(g, null, D(i.filters, (e) => (E(), _(d, {
|
|
401
402
|
key: e.name,
|
|
402
403
|
role: "menuitem",
|
|
403
404
|
"navigation-type": "arrow-keys",
|
|
404
405
|
selected: e.active,
|
|
405
406
|
onClick: (n) => a.selectFilter(e, t)
|
|
406
407
|
}, {
|
|
407
|
-
default:
|
|
408
|
+
default: N(() => [S(M(e.name), 1)]),
|
|
408
409
|
_: 2
|
|
409
410
|
}, 1032, ["selected", "onClick"]))), 128))])]),
|
|
410
411
|
key: "3"
|
|
411
412
|
} : void 0
|
|
412
|
-
]), 1040, ["open", "content-mode"])), a.hasClear ?
|
|
413
|
+
]), 1040, ["open", "content-mode"])), a.hasClear ? P((E(), _(s, {
|
|
413
414
|
key: 0,
|
|
414
415
|
active: a.isActive,
|
|
415
416
|
"aria-label": a.clearButtonAriaLabel,
|
|
416
|
-
class:
|
|
417
|
+
class: T(["d-filter-pill__clear", { "d-filter-pill__clear--selected": a.isActive }]),
|
|
417
418
|
disabled: n.disabled,
|
|
418
419
|
kind: a.buttonKind,
|
|
419
420
|
size: n.size,
|
|
@@ -422,7 +423,7 @@ function H(e, t, n, r, i, a) {
|
|
|
422
423
|
importance: "outlined",
|
|
423
424
|
onClick: a.clearFilter
|
|
424
425
|
}, {
|
|
425
|
-
icon:
|
|
426
|
+
icon: N(() => [C(f, { size: a.clearIconSize }, null, 8, ["size"])]),
|
|
426
427
|
_: 1
|
|
427
428
|
}, 8, [
|
|
428
429
|
"active",
|
|
@@ -433,10 +434,10 @@ function H(e, t, n, r, i, a) {
|
|
|
433
434
|
"size",
|
|
434
435
|
"title",
|
|
435
436
|
"onClick"
|
|
436
|
-
])), [[p, n.endTooltipText]]) :
|
|
437
|
+
])), [[p, n.endTooltipText]]) : v("", !0)], 2);
|
|
437
438
|
}
|
|
438
|
-
var
|
|
439
|
+
var W = /* @__PURE__ */ n(z, [["render", U]]);
|
|
439
440
|
//#endregion
|
|
440
|
-
export {
|
|
441
|
+
export { W as default };
|
|
441
442
|
|
|
442
443
|
//# sourceMappingURL=filter-pill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-pill.js","names":[],"sources":["../../../components/FilterPill/FilterPill.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'd-filter-pill',\n { 'd-filter-pill--read-only': readOnly },\n ]\"\n data-qa=\"dt-filter-pill\"\n >\n <component\n :is=\"overlayComponent\"\n v-model:open=\"isOpen\"\n v-bind=\"overlayProps\"\n :content-mode=\"contentMode\"\n >\n <template #anchor=\"slotData\">\n <dt-button\n v-dt-tooltip=\"resolvedStartTooltipText\"\n v-bind=\"useDropdown ? slotData : slotData.attrs\"\n :active=\"isActive\"\n :aria-disabled=\"readOnly || undefined\"\n :class=\"[\n 'd-filter-pill__primary',\n {\n 'd-filter-pill--selected': isActive,\n },\n ]\"\n :disabled=\"disabled\"\n :kind=\"buttonKind\"\n :size=\"size\"\n data-qa=\"dt-filter-pill__button\"\n importance=\"outlined\"\n @click=\"openPopover\"\n @keydown.up.down.prevent=\"openPopover\"\n >\n <template\n v-if=\"$slots.startIcon\"\n #startIcon=\"{ iconSize }\"\n >\n <!-- @slot Icon displayed before the label -->\n <slot\n name=\"startIcon\"\n :icon-size=\"iconSize\"\n />\n </template>\n <span :class=\"['d-filter-pill__label', labelClass]\">\n <!-- @slot Allows you to customize the label slot -->\n <slot\n :label=\"label\"\n :filters=\"filters\"\n :active-filters=\"activeFilters\"\n :active-filter-list=\"activeFilterList\"\n :active-filter-overflow=\"activeFilterOverflow\"\n >\n <span\n class=\"d-filter-pill__label-start\"\n :title=\"label\"\n v-text=\"label\"\n />\n <span\n v-if=\"activeFilterList\"\n class=\"d-filter-pill__label-end\"\n :title=\"activeFilterList\"\n v-text=\"activeFilterList\"\n />\n <span\n v-if=\"activeFilterOverflow\"\n class=\"d-filter-pill__label-end-overflow\"\n :title=\"`plus ${activeFilters.length - 1} others`\"\n v-text=\"activeFilterOverflow\"\n />\n </slot>\n </span>\n <template\n v-if=\"!readOnly\"\n #endIcon=\"{ iconSize }\"\n >\n <dt-icon-chevron-down\n :size=\"iconSize\"\n class=\"d-filter-pill__icon\"\n data-qa=\"dt-filter-pill__icon\"\n />\n </template>\n </dt-button>\n </template>\n <template\n v-if=\"!useDropdown\"\n #content=\"{ close }\"\n >\n <!-- @slot Allows you to override the popover content, only use this if you need custom behavior -->\n <slot\n :close=\"close\"\n :apply=\"applySelection\"\n :cancel=\"cancelSelection\"\n :pending-filters=\"pendingFilters\"\n name=\"content\"\n >\n <dt-checkbox-group\n v-if=\"modelValue?.length\"\n :model-value=\"deferSelection ? pendingActiveFilters : activeFilters\"\n :aria-label=\"label\"\n :name=\"label || 'filter-pill'\"\n >\n <dt-checkbox\n v-for=\"filter in displayFilters\"\n :key=\"filter.name\"\n :label=\"filter.name\"\n :value=\"filter.name\"\n @update:model-value=\"($event) => filter.active = $event\"\n />\n </dt-checkbox-group>\n </slot>\n </template>\n <template\n v-if=\"!useDropdown && $slots.headerContent\"\n #headerContent=\"{ close }\"\n >\n <!-- @slot Allows you to customize the popover header -->\n <slot\n name=\"headerContent\"\n :close=\"close\"\n />\n </template>\n <template\n v-if=\"!useDropdown && (deferSelection || $slots.footerContent)\"\n #footerContent=\"{ close }\"\n >\n <!-- @slot Allows you to customize the popover footer. Receives { close, apply, cancel } bindings. -->\n <slot\n name=\"footerContent\"\n :close=\"close\"\n :apply=\"applySelection\"\n :cancel=\"cancelSelection\"\n >\n <dt-stack\n v-if=\"deferSelection\"\n direction=\"row\"\n gap=\"400\"\n justify=\"end\"\n data-qa=\"dt-filter-pill__deferred-footer\"\n >\n <dt-button\n importance=\"clear\"\n kind=\"muted\"\n :size=\"200\"\n data-qa=\"dt-filter-pill__cancel-button\"\n @click=\"cancelSelection\"\n >\n {{ cancelButtonLabel }}\n </dt-button>\n <dt-button\n importance=\"primary\"\n :size=\"200\"\n data-qa=\"dt-filter-pill__apply-button\"\n @click=\"applySelection\"\n >\n {{ applyButtonLabel }}\n </dt-button>\n </dt-stack>\n </slot>\n </template>\n <template\n v-if=\"useDropdown\"\n #list=\"{ close }\"\n >\n <!-- @slot Allows you to override the dropdown content -->\n <slot\n :close=\"close\"\n name=\"content\"\n >\n <dt-list-item\n v-for=\"filter in filters\"\n :key=\"filter.name\"\n role=\"menuitem\"\n navigation-type=\"arrow-keys\"\n :selected=\"filter.active\"\n @click=\"selectFilter(filter, close)\"\n >\n {{ filter.name }}\n </dt-list-item>\n </slot>\n </template>\n </component>\n <dt-button\n v-if=\"hasClear\"\n v-dt-tooltip=\"endTooltipText\"\n :active=\"isActive\"\n :aria-label=\"clearButtonAriaLabel\"\n :class=\"[\n 'd-filter-pill__clear',\n { 'd-filter-pill__clear--selected': isActive },\n ]\"\n :disabled=\"disabled\"\n :kind=\"buttonKind\"\n :size=\"size\"\n :title=\"clearButtonTitle\"\n data-qa=\"dt-filter-pill__clear-button\"\n importance=\"outlined\"\n @click=\"clearFilter\"\n >\n <template #icon>\n <dt-icon-close :size=\"clearIconSize\" />\n </template>\n </dt-button>\n </div>\n</template>\n\n<script>\nimport { DtPopover, POPOVER_APPEND_TO_VALUES, POPOVER_PADDING_CLASSES } from '@/components/Popover';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { CONTENT_MODE_PROP } from '@/common/mode_constants';\nimport { BUTTON_SIZE_MODIFIERS, BUTTON_ICON_SIZES, DtButton } from '@/components/Button';\nimport { DtIconChevronDown, DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport { DialtoneLocalization } from '@/localization';\nimport { DtCheckbox } from '@/components/Checkbox';\nimport { DtCheckboxGroup } from '@/components/CheckboxGroup';\nimport { DtDropdown } from '@/components/Dropdown';\nimport { DtListItem } from '@/components/ListItem';\nimport { DtStack } from '@/components/Stack';\n\nexport default {\n name: 'DtFilterPill',\n\n components: {\n DtCheckboxGroup,\n DtCheckbox,\n DtPopover,\n DtButton,\n DtIconClose,\n DtIconChevronDown,\n DtDropdown,\n DtListItem,\n DtStack,\n },\n\n props: {\n /**\n * When true, uses DtDropdown instead of DtPopover as the overlay.\n * Provides keyboard navigation (arrow keys) for list items.\n * Default content renders DtListItem elements (single-select)\n * instead of checkboxes (multi-select).\n */\n useDropdown: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, checkbox changes are held in a pending state until the user\n * clicks Apply. Cancel or closing the popover discards pending changes.\n * Only applies to popover mode (not useDropdown).\n */\n deferSelection: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Array of filters to display in the popover,\n * should be an array of objects with `name` and `active` properties\n */\n modelValue: {\n type: Array,\n default: () => [],\n },\n\n /**\n * Text shown in tooltip when you hover the start button,\n * required if no content is passed to default slot\n */\n startTooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * HTML disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, the pill cannot be interacted with but does not\n * receive disabled visual styling. Adds `d-filter-pill--read-only`\n * class and hides the chevron icon. The clear button is suppressed\n * and the tooltip falls back to a read-only message when\n * startTooltipText is not provided.\n */\n readOnly: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows the clear button when a filter is active\n * @values true, false\n */\n showClear: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Label of the button\n */\n label: {\n type: String,\n default: undefined,\n },\n\n /**\n * Text shown in tooltip when you hover the end button,\n * required as it is an icon only button\n */\n endTooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * Sets the element to which the\n * <a class=\"d-link\" href=\"https://dialtone.dialpad.com/components/popover.html#vue-api\" target=\"_blank\">popover component</a>\n * is going to append to\n * @values body, parent, root, HTMLElement\n */\n popoverAppendTo: {\n type: [HTML_ELEMENT_TYPE, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * If the dropdown does not fit in the direction described by \"popoverPlacement\",\n * it will attempt to change it's direction to the \"popoverFallbackPlacements\".\n *\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n * */\n popoverFallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n popoverMaxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n popoverMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n popoverPadding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a class=\"d-link\" href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\" target=\"_blank\">Tippy.js docs</a>\n * @values top, top-start, top-end, right, right-start, right-end, left, left-start, left-end, bottom, bottom-start, bottom-end, auto, auto-start, auto-end\n */\n popoverPlacement: {\n type: String,\n default: 'bottom-start',\n },\n\n /**\n * Additional CSS class(es) applied to the label wrapper element.\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the popover content area.\n * Only applies when useDropdown is false.\n */\n popoverContentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the outer popover header element (`d-popover__header`).\n * Only applies when useDropdown is false.\n */\n popoverHeaderClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the outer popover footer element (`d-popover__footer`).\n * Only applies when useDropdown is false.\n */\n popoverFooterClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the popover dialog element.\n * Only applies when useDropdown is false.\n */\n popoverDialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the dropdown list wrapper.\n * Only applies when useDropdown is true.\n */\n dropdownListClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Applies a color mode to the positioned content element.\n * @values light, dark, invert\n */\n contentMode: CONTENT_MODE_PROP,\n\n /**\n * The size of the button.\n * @values 100, 200, 300, 400, 500\n */\n size: {\n type: [String, Number],\n default: 200,\n validator: (s) => Object.keys(BUTTON_SIZE_MODIFIERS).includes(String(s)),\n },\n },\n\n emits: [\n /**\n * Emitted when clicking the clear button\n *\n * @event clear\n * @type {Boolean | Array}\n */\n 'clear',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'open',\n\n /**\n * Emitted when the active filters change\n * @type {Array}\n */\n 'update:modelValue',\n\n /**\n * Emitted when deferred selection is applied\n *\n * @event apply\n */\n 'apply',\n ],\n\n data () {\n return {\n isOpen: false,\n i18n: new DialtoneLocalization(),\n filters: this.modelValue,\n pendingFilters: null,\n };\n },\n\n computed: {\n overlayComponent () {\n return this.useDropdown ? 'dt-dropdown' : 'dt-popover';\n },\n\n overlayProps () {\n const props = {\n 'append-to': this.popoverAppendTo,\n 'fallback-placements': this.popoverFallbackPlacements,\n 'max-height': this.popoverMaxHeight,\n 'max-width': this.popoverMaxWidth,\n modal: true,\n placement: this.popoverPlacement,\n };\n if (this.useDropdown) {\n props['list-class'] = this.dropdownListClass;\n } else {\n props.padding = this.popoverPadding;\n props['content-class'] = this.popoverContentClass;\n props['header-wrapper-class'] = this.popoverHeaderClass;\n props['footer-wrapper-class'] = this.popoverFooterClass;\n props['dialog-class'] = this.popoverDialogClass;\n }\n return props;\n },\n\n buttonKind () {\n return (this.isActive && !this.disabled) ? 'default' : 'muted';\n },\n\n resolvedStartTooltipText () {\n if (this.readOnly) return this.startTooltipText || this.i18n.$t('DIALTONE_FILTER_PILL_READ_ONLY_TOOLTIP');\n return this.startTooltipText;\n },\n\n clearButtonAriaLabel () {\n return this.endTooltipText || this.i18n.$t('DIALTONE_FILTER_PILL_CLEAR_BUTTON_LABEL');\n },\n\n clearButtonTitle () {\n if (this.endTooltipText) return;\n\n return this.clearButtonAriaLabel\n },\n\n activeFilters () {\n return this.filters.filter(filter => filter.active).map(filter => filter.name);\n },\n\n activeFilterList () {\n if (this.activeFilters.length === this.filters.length && this.filters.length > 1) {\n return 'All';\n }\n\n return this.activeFilters[0] ?? '';\n },\n\n activeFilterOverflow () {\n if (this.activeFilters.length <= 1) return '';\n if (this.activeFilters.length === this.filters.length && this.filters.length > 1) return '';\n\n return '+' + (this.activeFilters.length - 1);\n },\n\n isActive () {\n return this.activeFilterList.length > 0;\n },\n\n hasClear () {\n return !this.readOnly && this.showClear && this.activeFilterList.length > 0;\n },\n\n displayFilters () {\n return (this.deferSelection && this.pendingFilters) ? this.pendingFilters : this.filters;\n },\n\n pendingActiveFilters () {\n if (!this.pendingFilters) return [];\n return this.pendingFilters.filter(f => f.active).map(f => f.name);\n },\n\n cancelButtonLabel () {\n return this.i18n.$t('DIALTONE_FILTER_PILL_CANCEL_BUTTON_LABEL');\n },\n\n applyButtonLabel () {\n return this.i18n.$t('DIALTONE_FILTER_PILL_APPLY_BUTTON_LABEL');\n },\n\n clearIconSize () {\n if (String(this.size) === '100') return '100';\n return BUTTON_ICON_SIZES[String(this.size)];\n },\n },\n\n watch: {\n isOpen (isOpen) {\n this.$emit('open', isOpen);\n if (this.deferSelection) {\n if (isOpen) {\n this.pendingFilters = JSON.parse(JSON.stringify(this.filters));\n } else {\n this.pendingFilters = null;\n }\n }\n },\n\n filters: {\n deep: true,\n handler (filters) {\n this.$emit('update:modelValue', filters);\n },\n },\n },\n\n mounted () {\n if (!(this.modelValue?.length || (this.$slots.content && this.$slots.content()))) {\n console.warn('Please provide content through the v-model or the \"content\" slot.');\n }\n if (this.deferSelection && this.useDropdown) {\n console.warn('deferSelection has no effect when useDropdown is true.');\n }\n },\n\n methods: {\n clearFilter ($event) {\n this.filters.forEach(filter => delete filter.active);\n this.$emit('clear', $event)\n },\n\n openPopover () {\n if (this.readOnly) return;\n this.isOpen = true;\n },\n\n selectFilter (selectedFilter, close) {\n this.filters.forEach(filter => {\n filter.active = filter === selectedFilter;\n });\n close();\n },\n\n applySelection () {\n if (!this.pendingFilters) return;\n this.filters.forEach((filter, i) => {\n if (this.pendingFilters[i]) {\n filter.active = this.pendingFilters[i].active;\n } else {\n delete filter.active;\n }\n });\n this.$emit('apply');\n this.isOpen = false;\n },\n\n cancelSelection () {\n this.isOpen = false;\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;AA2NA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,iBAAA;EACA,YAAA;EACA,WAAA;EACA,UAAA;EACA;EACA;EACA,YAAA;EACA,YAAA;EACA,SAAA;EACD;CAED,OAAO;EAO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"file":"filter-pill.js","names":[],"sources":["../../../components/FilterPill/FilterPill.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'd-filter-pill',\n { 'd-filter-pill--read-only': readOnly },\n ]\"\n data-qa=\"dt-filter-pill\"\n >\n <component\n :is=\"overlayComponent\"\n v-model:open=\"isOpen\"\n v-bind=\"overlayProps\"\n :content-mode=\"contentMode\"\n >\n <template #anchor=\"slotData\">\n <dt-button\n v-dt-tooltip=\"resolvedStartTooltipText\"\n v-bind=\"useDropdown ? slotData : slotData.attrs\"\n :active=\"isActive\"\n :aria-disabled=\"readOnly || undefined\"\n :class=\"[\n 'd-filter-pill__primary',\n {\n 'd-filter-pill--selected': isActive,\n },\n ]\"\n :disabled=\"disabled\"\n :kind=\"buttonKind\"\n :size=\"size\"\n data-qa=\"dt-filter-pill__button\"\n importance=\"outlined\"\n @click=\"openPopover\"\n @keydown.up.down.prevent=\"openPopover\"\n >\n <template\n v-if=\"$slots.startIcon\"\n #startIcon=\"{ iconSize }\"\n >\n <!-- @slot Icon displayed before the label -->\n <slot\n name=\"startIcon\"\n :icon-size=\"iconSize\"\n />\n </template>\n <span :class=\"['d-filter-pill__label', labelClass]\">\n <!-- @slot Allows you to customize the label slot -->\n <slot\n :label=\"label\"\n :filters=\"filters\"\n :active-filters=\"activeFilters\"\n :active-filter-list=\"activeFilterList\"\n :active-filter-overflow=\"activeFilterOverflow\"\n >\n <span\n class=\"d-filter-pill__label-start\"\n :title=\"label\"\n v-text=\"label\"\n />\n <span\n v-if=\"activeFilterList\"\n class=\"d-filter-pill__label-end\"\n :title=\"activeFilterList\"\n v-text=\"activeFilterList\"\n />\n <span\n v-if=\"activeFilterOverflow\"\n class=\"d-filter-pill__label-end-overflow\"\n :title=\"`plus ${activeFilters.length - 1} others`\"\n v-text=\"activeFilterOverflow\"\n />\n </slot>\n </span>\n <template\n v-if=\"!readOnly\"\n #endIcon=\"{ iconSize }\"\n >\n <dt-icon-chevron-down\n :size=\"iconSize\"\n class=\"d-filter-pill__icon\"\n data-qa=\"dt-filter-pill__icon\"\n />\n </template>\n </dt-button>\n </template>\n <template\n v-if=\"!useDropdown\"\n #content=\"{ close }\"\n >\n <!-- @slot Allows you to override the popover content, only use this if you need custom behavior -->\n <slot\n :close=\"close\"\n :apply=\"applySelection\"\n :cancel=\"cancelSelection\"\n :pending-filters=\"pendingFilters\"\n name=\"content\"\n >\n <dt-checkbox-group\n v-if=\"modelValue?.length\"\n :model-value=\"deferSelection ? pendingActiveFilters : activeFilters\"\n :aria-label=\"label\"\n :name=\"label || 'filter-pill'\"\n >\n <dt-checkbox\n v-for=\"filter in displayFilters\"\n :key=\"filter.name\"\n :label=\"filter.name\"\n :value=\"filter.name\"\n @update:model-value=\"($event) => filter.active = $event\"\n />\n </dt-checkbox-group>\n </slot>\n </template>\n <template\n v-if=\"!useDropdown && $slots.headerContent\"\n #headerContent=\"{ close }\"\n >\n <!-- @slot Allows you to customize the popover header -->\n <slot\n name=\"headerContent\"\n :close=\"close\"\n />\n </template>\n <template\n v-if=\"!useDropdown && (deferSelection || $slots.footerContent)\"\n #footerContent=\"{ close }\"\n >\n <!-- @slot Allows you to customize the popover footer. Receives { close, apply, cancel } bindings. -->\n <slot\n name=\"footerContent\"\n :close=\"close\"\n :apply=\"applySelection\"\n :cancel=\"cancelSelection\"\n >\n <dt-stack\n v-if=\"deferSelection\"\n direction=\"row\"\n gap=\"400\"\n justify=\"end\"\n data-qa=\"dt-filter-pill__deferred-footer\"\n >\n <dt-button\n importance=\"clear\"\n kind=\"muted\"\n :size=\"200\"\n data-qa=\"dt-filter-pill__cancel-button\"\n @click=\"cancelSelection\"\n >\n {{ cancelButtonLabel }}\n </dt-button>\n <dt-button\n importance=\"primary\"\n :size=\"200\"\n data-qa=\"dt-filter-pill__apply-button\"\n @click=\"applySelection\"\n >\n {{ applyButtonLabel }}\n </dt-button>\n </dt-stack>\n </slot>\n </template>\n <template\n v-if=\"useDropdown\"\n #list=\"{ close }\"\n >\n <!-- @slot Allows you to override the dropdown content -->\n <slot\n :close=\"close\"\n name=\"content\"\n >\n <dt-list-item\n v-for=\"filter in filters\"\n :key=\"filter.name\"\n role=\"menuitem\"\n navigation-type=\"arrow-keys\"\n :selected=\"filter.active\"\n @click=\"selectFilter(filter, close)\"\n >\n {{ filter.name }}\n </dt-list-item>\n </slot>\n </template>\n </component>\n <dt-button\n v-if=\"hasClear\"\n v-dt-tooltip=\"endTooltipText\"\n :active=\"isActive\"\n :aria-label=\"clearButtonAriaLabel\"\n :class=\"[\n 'd-filter-pill__clear',\n { 'd-filter-pill__clear--selected': isActive },\n ]\"\n :disabled=\"disabled\"\n :kind=\"buttonKind\"\n :size=\"size\"\n :title=\"clearButtonTitle\"\n data-qa=\"dt-filter-pill__clear-button\"\n importance=\"outlined\"\n @click=\"clearFilter\"\n >\n <template #icon>\n <dt-icon-close :size=\"clearIconSize\" />\n </template>\n </dt-button>\n </div>\n</template>\n\n<script>\nimport { DtPopover, POPOVER_APPEND_TO_VALUES, POPOVER_PADDING_CLASSES } from '@/components/Popover';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { CONTENT_MODE_PROP } from '@/common/mode_constants';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport { BUTTON_SIZE_MODIFIERS, BUTTON_ICON_SIZES, DtButton } from '@/components/Button';\nimport { DtIconChevronDown, DtIconClose } from '@dialpad/dialtone-icons/vue';\nimport { DialtoneLocalization } from '@/localization';\nimport { DtCheckbox } from '@/components/Checkbox';\nimport { DtCheckboxGroup } from '@/components/CheckboxGroup';\nimport { DtDropdown } from '@/components/Dropdown';\nimport { DtListItem } from '@/components/ListItem';\nimport { DtStack } from '@/components/Stack';\n\nexport default {\n name: 'DtFilterPill',\n\n components: {\n DtCheckboxGroup,\n DtCheckbox,\n DtPopover,\n DtButton,\n DtIconClose,\n DtIconChevronDown,\n DtDropdown,\n DtListItem,\n DtStack,\n },\n\n props: {\n /**\n * When true, uses DtDropdown instead of DtPopover as the overlay.\n * Provides keyboard navigation (arrow keys) for list items.\n * Default content renders DtListItem elements (single-select)\n * instead of checkboxes (multi-select).\n */\n useDropdown: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, checkbox changes are held in a pending state until the user\n * clicks Apply. Cancel or closing the popover discards pending changes.\n * Only applies to popover mode (not useDropdown).\n */\n deferSelection: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Array of filters to display in the popover,\n * should be an array of objects with `name` and `active` properties\n */\n modelValue: {\n type: Array,\n default: () => [],\n },\n\n /**\n * Text shown in tooltip when you hover the start button,\n * required if no content is passed to default slot\n */\n startTooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * HTML disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When true, the pill cannot be interacted with but does not\n * receive disabled visual styling. Adds `d-filter-pill--read-only`\n * class and hides the chevron icon. The clear button is suppressed\n * and the tooltip falls back to a read-only message when\n * startTooltipText is not provided.\n */\n readOnly: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows the clear button when a filter is active\n * @values true, false\n */\n showClear: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Label of the button\n */\n label: {\n type: String,\n default: undefined,\n },\n\n /**\n * Text shown in tooltip when you hover the end button,\n * required as it is an icon only button\n */\n endTooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * Sets the element to which the\n * <a class=\"d-link\" href=\"https://dialtone.dialpad.com/components/popover.html#vue-api\" target=\"_blank\">popover component</a>\n * is going to append to\n * @values body, parent, root, HTMLElement\n */\n popoverAppendTo: {\n type: [HTML_ELEMENT_TYPE, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * If the dropdown does not fit in the direction described by \"popoverPlacement\",\n * it will attempt to change it's direction to the \"popoverFallbackPlacements\".\n *\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n * */\n popoverFallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n popoverMaxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n popoverMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n popoverPadding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a class=\"d-link\" href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\" target=\"_blank\">Tippy.js docs</a>\n * @values top, top-start, top-end, right, right-start, right-end, left, left-start, left-end, bottom, bottom-start, bottom-end, auto, auto-start, auto-end\n */\n popoverPlacement: {\n type: String,\n default: 'bottom-start',\n },\n\n /**\n * Additional CSS class(es) applied to the label wrapper element.\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the popover content area.\n * Only applies when useDropdown is false.\n */\n popoverContentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the outer popover header element (`d-popover__header`).\n * Only applies when useDropdown is false.\n */\n popoverHeaderClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the outer popover footer element (`d-popover__footer`).\n * Only applies when useDropdown is false.\n */\n popoverFooterClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the popover dialog element.\n * Only applies when useDropdown is false.\n */\n popoverDialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional CSS class(es) applied to the dropdown list wrapper.\n * Only applies when useDropdown is true.\n */\n dropdownListClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Applies a color mode to the positioned content element.\n * @values light, dark, invert\n */\n contentMode: CONTENT_MODE_PROP,\n\n /**\n * The size of the button.\n * @values 100, 200, 300, 400, 500\n */\n size: {\n type: [String, Number],\n default: 200,\n validator: ordinalSizeValidator(BUTTON_SIZE_MODIFIERS),\n },\n },\n\n emits: [\n /**\n * Emitted when clicking the clear button\n *\n * @event clear\n * @type {Boolean | Array}\n */\n 'clear',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'open',\n\n /**\n * Emitted when the active filters change\n * @type {Array}\n */\n 'update:modelValue',\n\n /**\n * Emitted when deferred selection is applied\n *\n * @event apply\n */\n 'apply',\n ],\n\n data () {\n return {\n isOpen: false,\n i18n: new DialtoneLocalization(),\n filters: this.modelValue,\n pendingFilters: null,\n };\n },\n\n computed: {\n overlayComponent () {\n return this.useDropdown ? 'dt-dropdown' : 'dt-popover';\n },\n\n overlayProps () {\n const props = {\n 'append-to': this.popoverAppendTo,\n 'fallback-placements': this.popoverFallbackPlacements,\n 'max-height': this.popoverMaxHeight,\n 'max-width': this.popoverMaxWidth,\n modal: true,\n placement: this.popoverPlacement,\n };\n if (this.useDropdown) {\n props['list-class'] = this.dropdownListClass;\n } else {\n props.padding = this.popoverPadding;\n props['content-class'] = this.popoverContentClass;\n props['header-wrapper-class'] = this.popoverHeaderClass;\n props['footer-wrapper-class'] = this.popoverFooterClass;\n props['dialog-class'] = this.popoverDialogClass;\n }\n return props;\n },\n\n buttonKind () {\n return (this.isActive && !this.disabled) ? 'default' : 'muted';\n },\n\n resolvedStartTooltipText () {\n if (this.readOnly) return this.startTooltipText || this.i18n.$t('DIALTONE_FILTER_PILL_READ_ONLY_TOOLTIP');\n return this.startTooltipText;\n },\n\n clearButtonAriaLabel () {\n return this.endTooltipText || this.i18n.$t('DIALTONE_FILTER_PILL_CLEAR_BUTTON_LABEL');\n },\n\n clearButtonTitle () {\n if (this.endTooltipText) return;\n\n return this.clearButtonAriaLabel\n },\n\n activeFilters () {\n return this.filters.filter(filter => filter.active).map(filter => filter.name);\n },\n\n activeFilterList () {\n if (this.activeFilters.length === this.filters.length && this.filters.length > 1) {\n return 'All';\n }\n\n return this.activeFilters[0] ?? '';\n },\n\n activeFilterOverflow () {\n if (this.activeFilters.length <= 1) return '';\n if (this.activeFilters.length === this.filters.length && this.filters.length > 1) return '';\n\n return '+' + (this.activeFilters.length - 1);\n },\n\n isActive () {\n return this.activeFilterList.length > 0;\n },\n\n hasClear () {\n return !this.readOnly && this.showClear && this.activeFilterList.length > 0;\n },\n\n displayFilters () {\n return (this.deferSelection && this.pendingFilters) ? this.pendingFilters : this.filters;\n },\n\n pendingActiveFilters () {\n if (!this.pendingFilters) return [];\n return this.pendingFilters.filter(f => f.active).map(f => f.name);\n },\n\n cancelButtonLabel () {\n return this.i18n.$t('DIALTONE_FILTER_PILL_CANCEL_BUTTON_LABEL');\n },\n\n applyButtonLabel () {\n return this.i18n.$t('DIALTONE_FILTER_PILL_APPLY_BUTTON_LABEL');\n },\n\n clearIconSize () {\n if (String(this.size) === '100') return '100';\n return BUTTON_ICON_SIZES[String(this.size)];\n },\n },\n\n watch: {\n isOpen (isOpen) {\n this.$emit('open', isOpen);\n if (this.deferSelection) {\n if (isOpen) {\n this.pendingFilters = JSON.parse(JSON.stringify(this.filters));\n } else {\n this.pendingFilters = null;\n }\n }\n },\n\n filters: {\n deep: true,\n handler (filters) {\n this.$emit('update:modelValue', filters);\n },\n },\n },\n\n mounted () {\n if (!(this.modelValue?.length || (this.$slots.content && this.$slots.content()))) {\n console.warn('Please provide content through the v-model or the \"content\" slot.');\n }\n if (this.deferSelection && this.useDropdown) {\n console.warn('deferSelection has no effect when useDropdown is true.');\n }\n },\n\n methods: {\n clearFilter ($event) {\n this.filters.forEach(filter => delete filter.active);\n this.$emit('clear', $event)\n },\n\n openPopover () {\n if (this.readOnly) return;\n this.isOpen = true;\n },\n\n selectFilter (selectedFilter, close) {\n this.filters.forEach(filter => {\n filter.active = filter === selectedFilter;\n });\n close();\n },\n\n applySelection () {\n if (!this.pendingFilters) return;\n this.filters.forEach((filter, i) => {\n if (this.pendingFilters[i]) {\n filter.active = this.pendingFilters[i].active;\n } else {\n delete filter.active;\n }\n });\n this.$emit('apply');\n this.isOpen = false;\n },\n\n cancelSelection () {\n this.isOpen = false;\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;AA4NA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,iBAAA;EACA,YAAA;EACA,WAAA;EACA,UAAA;EACA;EACA;EACA,YAAA;EACA,YAAA;EACA,SAAA;EACD;CAED,OAAO;EAOL,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAOD,gBAAgB;GACd,MAAM;GACN,SAAS;GACV;EAMD,YAAY;GACV,MAAM;GACN,eAAe,EAAE;GAClB;EAMD,kBAAkB;GAChB,MAAM;GACN,SAAS;GACV;EAKD,UAAU;GACR,MAAM;GACN,SAAS;GACV;EASD,UAAU;GACR,MAAM;GACN,SAAS;GACV;EAMD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAKD,OAAO;GACL,MAAM;GACN,SAAS,KAAA;GACV;EAMD,gBAAgB;GACd,MAAM;GACN,SAAS;GACV;EAQD,iBAAiB;GACf,MAAM,CAAC,GAAmB,OAAO;GACjC,SAAS;GACT,YAAW,MACF,EAAyB,SAAS,EAAQ,IAC9C,aAAoB;GAE1B;EAYD,2BAA2B;GACzB,MAAM;GACN,eACS,CAAC,OAAO;GAElB;EAMD,kBAAkB;GAChB,MAAM;GACN,SAAS;GACV;EAMD,iBAAiB;GACf,MAAM;GACN,SAAS;GACV;EAMD,gBAAgB;GACd,MAAM;GACN,SAAS;GACT,YAAY,MACH,OAAO,KAAK,EAAwB,CAAC,MAAM,MAAS,MAAS,EAAQ;GAE/E;EAOD,kBAAkB;GAChB,MAAM;GACN,SAAS;GACV;EAKD,YAAY;GACV,MAAM;IAAC;IAAQ;IAAO;IAAO;GAC7B,SAAS;GACV;EAMD,qBAAqB;GACnB,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CAAA;EAI7F,UAAU,EAAA;EACV,MAAM,EAAA;EACN,MAAM,EAAA;EACN,OAAO,EAAA;EACR,WAAQ;EACR,YAAW;EACV,SAAO,EAAA;;EAEG,MAAI,QAC0B,CAAvC,EAAuC,GAAA,EAAvB,MAAM,EAAA,eAAa,EAAA,MAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA;;;;;;;;;;;WAhBvB,EAAA,eAAc,CAAA,CAAA,GAAA,EAAA,IAAA,GAAA,CAAA,EAAA,EAAA"}
|
package/dist/lib/icon/icon.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/validators/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`./icon-constants.cjs`);let r=require(`vue`),i=require(`@dialpad/dialtone-icons/vue`);var a={name:`DtIcon`,props:{size:{type:[String,Number],default:500,validator:e.ordinalSizeValidator(n.ICON_SIZE_MODIFIERS)},name:{type:String,required:!0,validator:e=>n.ICON_NAMES.includes(e)},ariaLabel:{type:String,default:void 0}},data(){return{}},computed:{icon(){return i.icons[`./src/icons/${this.name}.vue`]},iconAriaLabel(){return this.ariaLabel}}};function o(e,t,n,i,a,o){return o.icon?((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(o.icon),{key:0,size:n.size,"aria-label":o.iconAriaLabel,"data-qa":e.$attrs[`data-qa`]??`dt-icon`},null,8,[`size`,`aria-label`,`data-qa`])):(0,r.createCommentVNode)(``,!0)}var s=t.t(a,[[`render`,o]]);exports.default=s;
|
|
2
2
|
//# sourceMappingURL=icon.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.cjs","names":[],"sources":["../../../components/Icon/Icon.vue"],"sourcesContent":["<template>\n <component\n :is=\"icon\"\n v-if=\"icon\"\n :size=\"size\"\n :aria-label=\"iconAriaLabel\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-icon'\"\n />\n</template>\n\n<script>\nimport { icons } from '@dialpad/dialtone-icons/vue';\nimport { ICON_SIZE_MODIFIERS, ICON_NAMES } from './IconConstants';\n// import { DialtoneLocalization } from '@/localization';\n// import { toFluentKeyString } from '@/common/utils';\n\n/**\n * The Icon component provides a set of glyphs and sizes to provide context your application.\n * @see https://dialtone.dialpad.com/components/icon.html\n */\nexport default {\n name: 'DtIcon',\n\n props: {\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default:
|
|
1
|
+
{"version":3,"file":"icon.cjs","names":[],"sources":["../../../components/Icon/Icon.vue"],"sourcesContent":["<template>\n <component\n :is=\"icon\"\n v-if=\"icon\"\n :size=\"size\"\n :aria-label=\"iconAriaLabel\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-icon'\"\n />\n</template>\n\n<script>\nimport { icons } from '@dialpad/dialtone-icons/vue';\nimport { ICON_SIZE_MODIFIERS, ICON_NAMES } from './IconConstants';\nimport { ordinalSizeValidator } from '@/common/validators';\n// import { DialtoneLocalization } from '@/localization';\n// import { toFluentKeyString } from '@/common/utils';\n\n/**\n * The Icon component provides a set of glyphs and sizes to provide context your application.\n * @see https://dialtone.dialpad.com/components/icon.html\n */\nexport default {\n name: 'DtIcon',\n\n props: {\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: [String, Number],\n default: 500,\n validator: ordinalSizeValidator(ICON_SIZE_MODIFIERS),\n },\n\n /**\n * The icon name in kebab-case\n */\n name: {\n type: String,\n required: true,\n validator: (name) => ICON_NAMES.includes(name),\n },\n\n /**\n * The label of the icon as read out by a screen-reader. Leave this unset if your icon is purely presentational\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n },\n\n data () {\n return {\n // i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n icon () {\n return icons[`./src/icons/${this.name}.vue`];\n },\n\n iconAriaLabel () {\n // const fluentKey = toFluentKeyString(this.name);\n // return this.ariaLabel || this.i18n.$t(`DIALTONE_ICON_${fluentKey}`);\n return this.ariaLabel;\n },\n },\n};\n</script>\n"],"mappings":"kVAqBA,IAAK,EAAU,CACb,KAAM,SAEN,MAAO,CAKL,KAAM,CACJ,KAAM,CAAC,OAAQ,OAAO,CACtB,QAAS,IACT,UAAW,EAAA,qBAAqB,EAAA,oBAAoB,CACrD,CAKD,KAAM,CACJ,KAAM,OACN,SAAU,GACV,UAAY,GAAS,EAAA,WAAW,SAAS,EAAK,CAC/C,CAKD,UAAW,CACT,KAAM,OACN,QAAS,IAAA,GACV,CACF,CAED,MAAQ,CACN,MAAO,EAEN,EAGH,SAAU,CACR,MAAQ,CACN,OAAO,EAAA,MAAM,eAAe,KAAK,KAAK,QAGxC,eAAiB,CAGf,OAAO,KAAK,WAEf,CACF,gCAnES,EAAA,OAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,cAAA,EAAA,EAAA,yBADD,EAAA,KAAI,CAAA,OAER,KAAM,EAAA,KACN,aAAY,EAAA,cACZ,UAAS,EAAA,OAAM,YAAA"}
|
package/dist/lib/icon/icon.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { ordinalSizeValidator as e } from "../../common/validators/index.js";
|
|
2
|
+
import { t } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
3
|
+
import { ICON_NAMES as n, ICON_SIZE_MODIFIERS as r } from "./icon-constants.js";
|
|
4
|
+
import { createBlock as i, createCommentVNode as a, openBlock as o, resolveDynamicComponent as s } from "vue";
|
|
5
|
+
import { icons as c } from "@dialpad/dialtone-icons/vue";
|
|
5
6
|
//#region components/Icon/Icon.vue
|
|
6
|
-
var
|
|
7
|
+
var l = {
|
|
7
8
|
name: "DtIcon",
|
|
8
9
|
props: {
|
|
9
10
|
size: {
|
|
10
|
-
type: String,
|
|
11
|
-
default:
|
|
12
|
-
validator:
|
|
11
|
+
type: [String, Number],
|
|
12
|
+
default: 500,
|
|
13
|
+
validator: e(r)
|
|
13
14
|
},
|
|
14
15
|
name: {
|
|
15
16
|
type: String,
|
|
16
17
|
required: !0,
|
|
17
|
-
validator: (e) =>
|
|
18
|
+
validator: (e) => n.includes(e)
|
|
18
19
|
},
|
|
19
20
|
ariaLabel: {
|
|
20
21
|
type: String,
|
|
@@ -26,15 +27,15 @@ var c = {
|
|
|
26
27
|
},
|
|
27
28
|
computed: {
|
|
28
29
|
icon() {
|
|
29
|
-
return
|
|
30
|
+
return c[`./src/icons/${this.name}.vue`];
|
|
30
31
|
},
|
|
31
32
|
iconAriaLabel() {
|
|
32
33
|
return this.ariaLabel;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
|
-
function
|
|
37
|
-
return l.icon ? (
|
|
37
|
+
function u(e, t, n, r, c, l) {
|
|
38
|
+
return l.icon ? (o(), i(s(l.icon), {
|
|
38
39
|
key: 0,
|
|
39
40
|
size: n.size,
|
|
40
41
|
"aria-label": l.iconAriaLabel,
|
|
@@ -43,10 +44,10 @@ function l(e, t, n, s, c, l) {
|
|
|
43
44
|
"size",
|
|
44
45
|
"aria-label",
|
|
45
46
|
"data-qa"
|
|
46
|
-
])) :
|
|
47
|
+
])) : a("", !0);
|
|
47
48
|
}
|
|
48
|
-
var
|
|
49
|
+
var d = /* @__PURE__ */ t(l, [["render", u]]);
|
|
49
50
|
//#endregion
|
|
50
|
-
export {
|
|
51
|
+
export { d as default };
|
|
51
52
|
|
|
52
53
|
//# sourceMappingURL=icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","names":[],"sources":["../../../components/Icon/Icon.vue"],"sourcesContent":["<template>\n <component\n :is=\"icon\"\n v-if=\"icon\"\n :size=\"size\"\n :aria-label=\"iconAriaLabel\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-icon'\"\n />\n</template>\n\n<script>\nimport { icons } from '@dialpad/dialtone-icons/vue';\nimport { ICON_SIZE_MODIFIERS, ICON_NAMES } from './IconConstants';\n// import { DialtoneLocalization } from '@/localization';\n// import { toFluentKeyString } from '@/common/utils';\n\n/**\n * The Icon component provides a set of glyphs and sizes to provide context your application.\n * @see https://dialtone.dialpad.com/components/icon.html\n */\nexport default {\n name: 'DtIcon',\n\n props: {\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default:
|
|
1
|
+
{"version":3,"file":"icon.js","names":[],"sources":["../../../components/Icon/Icon.vue"],"sourcesContent":["<template>\n <component\n :is=\"icon\"\n v-if=\"icon\"\n :size=\"size\"\n :aria-label=\"iconAriaLabel\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-icon'\"\n />\n</template>\n\n<script>\nimport { icons } from '@dialpad/dialtone-icons/vue';\nimport { ICON_SIZE_MODIFIERS, ICON_NAMES } from './IconConstants';\nimport { ordinalSizeValidator } from '@/common/validators';\n// import { DialtoneLocalization } from '@/localization';\n// import { toFluentKeyString } from '@/common/utils';\n\n/**\n * The Icon component provides a set of glyphs and sizes to provide context your application.\n * @see https://dialtone.dialpad.com/components/icon.html\n */\nexport default {\n name: 'DtIcon',\n\n props: {\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: [String, Number],\n default: 500,\n validator: ordinalSizeValidator(ICON_SIZE_MODIFIERS),\n },\n\n /**\n * The icon name in kebab-case\n */\n name: {\n type: String,\n required: true,\n validator: (name) => ICON_NAMES.includes(name),\n },\n\n /**\n * The label of the icon as read out by a screen-reader. Leave this unset if your icon is purely presentational\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n },\n\n data () {\n return {\n // i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n icon () {\n return icons[`./src/icons/${this.name}.vue`];\n },\n\n iconAriaLabel () {\n // const fluentKey = toFluentKeyString(this.name);\n // return this.ariaLabel || this.i18n.$t(`DIALTONE_ICON_${fluentKey}`);\n return this.ariaLabel;\n },\n },\n};\n</script>\n"],"mappings":";;;;;;AAqBA,IAAK,IAAU;CACb,MAAM;CAEN,OAAO;EAKL,MAAM;GACJ,MAAM,CAAC,QAAQ,OAAO;GACtB,SAAS;GACT,WAAW,EAAqB,EAAoB;GACrD;EAKD,MAAM;GACJ,MAAM;GACN,UAAU;GACV,YAAY,MAAS,EAAW,SAAS,EAAK;GAC/C;EAKD,WAAW;GACT,MAAM;GACN,SAAS,KAAA;GACV;EACF;CAED,OAAQ;AACN,SAAO,EAEN;;CAGH,UAAU;EACR,OAAQ;AACN,UAAO,EAAM,eAAe,KAAK,KAAK;;EAGxC,gBAAiB;AAGf,UAAO,KAAK;;EAEf;CACF;;QAnES,EAAA,QAAA,GAAA,EAFR,EAME,EALK,EAAA,KAAI,EAAA;;EAER,MAAM,EAAA;EACN,cAAY,EAAA;EACZ,WAAS,EAAA,OAAM,cAAA"}
|
package/dist/lib/input/input.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/index.cjs`),t=require(`../../common/utils/index.cjs`),n=require(`../../common/mixins/input.cjs`),r=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),i=require(`../validation-messages/validation-messages.cjs`),a=require(`../text/text-constants.cjs`),o=require(`../text/text.cjs`),s=require(`./input-constants.cjs`);let c=require(`vue`);var l={name:`DtInput`,components:{DtValidationMessages:i.default,DtText:o.default},mixins:[n.MessagesMixin],inheritAttrs:!1,props:{name:{type:String,default:``},type:{type:String,default:s.INPUT_TYPES.TEXT,validator:e=>Object.values(s.INPUT_TYPES).includes(e)},modelValue:{type:[String,Number],default:``},disabled:{type:Boolean,default:!1},label:{type:String,default:``},showLabel:{type:Boolean,default:!0},description:{type:String,default:``},descriptionClass:{type:[String,Array,Object],default:``},size:{type:[String,Number],default:300,validator:e=>Object.keys(s.INPUT_ICON_SIZES).includes(String(e))},inputClass:{type:[String,Object,Array],default:``},inputWrapperClass:{type:[String,Object,Array],default:``},currentLength:{type:Number,default:null},retainWarning:{type:Boolean,default:!1},validate:{type:Object,default:null},hidden:{type:Boolean,default:!1},labelSize:{type:[String,Number],default:null,validator:e=>a.TEXT_SIZE_MODIFIERS.label.includes(String(e))},labelStrength:{type:String,default:null,validator:e=>Object.keys(a.TEXT_STRENGTH_MODIFIERS).includes(e)},labelClass:{type:[String,Array,Object],default:``},startIconClass:{type:[String,Array,Object],default:``},endIconClass:{type:[String,Array,Object],default:``}},emits:[`blur`,`clear`,`focus`,`focusin`,`focusout`,`update:modelValue`,`update:length`,`update:invalid`],data(){return{isInputFocused:!1,isInvalid:!1,defaultLength:0,hasSlotContent:t.hasSlotContent,isComposing:!1,justEndedComposition:!1,messagesId:t.getUniqueString()}},computed:{isTextarea(){return this.type===s.INPUT_TYPES.TEXTAREA},isDefaultSize(){return String(this.size)===s.INPUT_SIZES.DEFAULT||String(this.size)===`300`},iconSize(){return s.INPUT_ICON_SIZES[String(this.size)]},isValidSize(){return Object.keys(s.INPUT_ICON_SIZES).includes(String(this.size))},isValidDescriptionSize(){return Object.values(e.DESCRIPTION_SIZE_TYPES).includes(this.size)},inputComponent(){return this.isTextarea?`textarea`:`input`},inputListeners(){return{compositionstart:()=>{this.isComposing=!0},compositionend:()=>{this.isComposing=!1,this.justEndedComposition=!0;let e=this.$refs.input.value;this.$emit(`update:modelValue`,e),Promise.resolve().then(()=>{this.justEndedComposition=!1})},input:async e=>{if(this.isComposing||this.justEndedComposition)return;let t=e.target.value;this.type===s.INPUT_TYPES.FILE&&(t=Array.from(e.target.files).map(e=>e.name)),this.$emit(`update:modelValue`,t)},blur:e=>{this.isInputFocused=!1,this.onBlur(e)},focus:e=>{this.isInputFocused=!0,this.$emit(`focus`,e)},focusin:e=>this.$emit(`focusin`,e),focusout:e=>this.$emit(`focusout`,e)}},descriptionKey(){return`input-description-${t.getUniqueString()}`},inputState(){return t.getValidationState(this.validationMessages)},ariaInvalid(){return this.inputState===e.VALIDATION_MESSAGE_TYPES.CRITICAL?`true`:void 0},ariaDescribedBy(){return this.showMessages&&this.validationMessages.length>0?this.messagesId:void 0},defaultLengthCalculation(){return this.calculateLength(this.modelValue)},validationProps(){return{length:{description:this?.validate?.length?.description,max:this?.validate?.length?.max,warn:this?.validate?.length?.warn,message:this?.validate?.length?.message,limitMaxLength:this?.validate?.length?.limitMaxLength?this.validate.length.limitMaxLength:!1}}},validationMessages(){return this.showLengthLimitValidation?this.formattedMessages.concat([this.inputLengthErrorMessage()]):this.formattedMessages},showInputState(){return this.showMessages&&this.inputState},inputLength(){return this.currentLength?this.currentLength:this.defaultLengthCalculation},inputLengthState(){return this.inputLength<this.validationProps.length.warn?null:this.inputLength<=this.validationProps.length.max?this.validationProps.length.warn?e.VALIDATION_MESSAGE_TYPES.WARNING:null:e.VALIDATION_MESSAGE_TYPES.CRITICAL},shouldValidateLength(){return!!(this.validationProps.length.description&&this.validationProps.length.max)},shouldLimitMaxLength(){return this.shouldValidateLength&&this.validationProps.length.limitMaxLength},showLengthLimitValidation(){return this.shouldValidateLength&&this.inputLengthState!==null&&this.validationProps.length.message&&(this.retainWarning||this.isInputFocused||this.isInvalid)},resolvedLabelSize(){if(this.labelSize!=null)return this.labelSize;let e=String(this.size);return e===`xl`||e===`500`?e===`500`?`400`:`lg`:this.size},resolvedDescriptionSize(){return{100:`xs`,200:`xs`,300:`sm`,400:`sm`,500:`md`,xs:`xs`,sm:`xs`,md:`sm`,lg:`sm`,xl:`md`}[String(this.size)]||`sm`},resolvedDescriptionDensity(){let e=String(this.size);return e===`xl`||e===`500`?`300`:void 0},sizeModifierClass(){return this.isDefaultSize||!this.isValidSize?``:s.INPUT_SIZE_CLASSES[this.inputComponent][String(this.size)]},stateClass(){return[s.INPUT_STATE_CLASSES[this.inputState]]}},watch:{isInvalid(e){this.$emit(`update:invalid`,e)},modelValue:{immediate:!0,handler(e){this.shouldValidateLength&&this.validateLength(this.inputLength),this.currentLength??this.$emit(`update:length`,this.calculateLength(e)),this.isTextarea&&!this.isComposing&&this.$refs.input&&this.$refs.input.value!==e&&(this.$refs.input.value=e)}}},mounted(){this.isTextarea&&this.$refs.input&&(this.$refs.input.value=this.modelValue),this.runValidations()},methods:{removeClassStyleAttrs:t.removeClassStyleAttrs,inputClasses(){return[`d-input__input`,this.inputComponent===`input`?`d-input`:`d-textarea`,{[this.stateClass]:this.showInputState,"d-input-icon--left":this.$slots.startIcon||this.$slots.leftIcon,"d-input-icon--right":this.$slots.endIcon||this.$slots.rightIcon},this.sizeModifierClass,this.inputClass]},inputWrapperClasses(){return this.hidden?[]:[`d-input__wrapper`,{[this.stateClass]:this.showInputState},this.inputWrapperClass]},calculateLength(e){return typeof e==`string`?[...e].length:0},inputLengthErrorMessage(){return{message:this.validationProps.length.message,type:this.inputLengthState}},onBlur(e){this.$refs.container?.contains(e.relatedTarget)||this.$emit(`blur`,e)},emitClearEvents(){this.$emit(`clear`),this.$emit(`update:modelValue`,``)},blur(){this.$refs.input.blur()},focus(){this.$refs.input.focus()},select(){this.$refs.input.select()},getMessageKey(e,t){return`message-${e}-${t}`},validateLength(e){this.isInvalid=e>this.validationProps.length.max},clearInput(){this.$refs.input.value=``,this.$refs.input.focus(),this.emitClearEvents()},runValidations(){!this.label&&!this.$attrs[`aria-label`]&&console.info(`[Dialtone] A label is required for accessibility. Provide a label prop and use show-label="false" to hide it visually.`)}}},u=[`aria-details`],d={key:0},f={key:1,"data-qa":`dt-input-length-description`,class:`d-input__length-description`},p=[`read-only`],m=[`name`,`disabled`,`autocomplete`,`maxlength`,`aria-label`,`aria-invalid`,`aria-describedby`],h=[`value`,`name`,`type`,`disabled`,`autocomplete`,`maxlength`,`aria-label`,`aria-invalid`,`aria-describedby`];function g(e,t,n,r,i,a){let o=(0,c.resolveComponent)(`dt-text`),s=(0,c.resolveComponent)(`dt-validation-messages`);return(0,c.openBlock)(),(0,c.createElementBlock)(`div`,{ref:`container`,class:(0,c.normalizeClass)([`d-input__root`,{"d-input--hidden":n.hidden},e.$attrs.class]),style:(0,c.normalizeStyle)(e.$attrs.style),"data-qa":`dt-input`},[(0,c.createElementVNode)(`label`,{class:`d-input__label`,"aria-details":e.$slots.description||n.description?a.descriptionKey:void 0,"data-qa":`dt-input-label-wrapper`},[(0,c.renderSlot)(e.$slots,`label`,{},()=>[n.showLabel&&n.label?((0,c.openBlock)(),(0,c.createBlock)(o,{key:0,ref:`label`,"data-qa":`dt-input-label`,kind:`label`,size:a.resolvedLabelSize,strength:n.labelStrength,tone:`secondary`,class:(0,c.normalizeClass)([`d-input__label-text`,n.labelClass])},{default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)(n.label),1)]),_:1},8,[`size`,`strength`,`class`])):(0,c.createCommentVNode)(``,!0)]),i.hasSlotContent(e.$slots.description)||n.description||a.shouldValidateLength?((0,c.openBlock)(),(0,c.createBlock)(o,{key:0,id:a.descriptionKey,ref:`description`,kind:`body`,size:a.resolvedDescriptionSize,tone:`tertiary`,density:a.resolvedDescriptionDensity,as:`div`,class:(0,c.normalizeClass)([`d-input__description`,`d-description`,n.descriptionClass]),"data-qa":`dt-input-description`},{default:(0,c.withCtx)(()=>[i.hasSlotContent(e.$slots.description)||n.description?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,d,[(0,c.renderSlot)(e.$slots,`description`,{},()=>[(0,c.createTextVNode)((0,c.toDisplayString)(n.description),1)])])):(0,c.createCommentVNode)(``,!0),a.shouldValidateLength?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,f,(0,c.toDisplayString)(a.validationProps.length.description),1)):(0,c.createCommentVNode)(``,!0)]),_:3},8,[`id`,`size`,`density`,`class`])):(0,c.createCommentVNode)(``,!0),(0,c.createElementVNode)(`div`,{class:(0,c.normalizeClass)(a.inputWrapperClasses()),"read-only":n.disabled===!0?!0:void 0},[(0,c.createElementVNode)(`span`,{class:(0,c.normalizeClass)([`d-input-icon`,`d-input-icon--left`,n.startIconClass]),"data-qa":`dt-input-left-icon-wrapper`,onFocusout:t[0]||(t[0]=(...e)=>a.onBlur&&a.onBlur(...e))},[e.$slots.startIcon?(0,c.renderSlot)(e.$slots,`startIcon`,{key:0,iconSize:a.iconSize}):(0,c.renderSlot)(e.$slots,`leftIcon`,{key:1,iconSize:a.iconSize})],34),a.isTextarea?((0,c.openBlock)(),(0,c.createElementBlock)(`textarea`,(0,c.mergeProps)({key:0,ref:`input`,name:n.name,disabled:n.disabled,autocomplete:e.$attrs.autocomplete??`off`,class:a.inputClasses(),maxlength:a.shouldLimitMaxLength?a.validationProps.length.max:null,"aria-label":!n.showLabel&&n.label?n.label:void 0,"aria-invalid":a.ariaInvalid,"aria-describedby":a.ariaDescribedBy,"data-qa":`dt-input-input`},a.removeClassStyleAttrs(e.$attrs),(0,c.toHandlers)(a.inputListeners,!0)),null,16,m)):((0,c.openBlock)(),(0,c.createElementBlock)(`input`,(0,c.mergeProps)({key:1,ref:`input`,value:n.modelValue,name:n.name,type:n.type,disabled:n.disabled,autocomplete:e.$attrs.autocomplete??`off`,class:a.inputClasses(),maxlength:a.shouldLimitMaxLength?a.validationProps.length.max:null,"aria-label":!n.showLabel&&n.label?n.label:void 0,"aria-invalid":a.ariaInvalid,"aria-describedby":a.ariaDescribedBy,"data-qa":`dt-input-input`},a.removeClassStyleAttrs(e.$attrs),(0,c.toHandlers)(a.inputListeners,!0)),null,16,h)),(0,c.createElementVNode)(`span`,{class:(0,c.normalizeClass)([`d-input-icon`,`d-input-icon--right`,n.endIconClass]),"data-qa":`dt-input-right-icon-wrapper`,onFocusout:t[1]||(t[1]=(...e)=>a.onBlur&&a.onBlur(...e))},[e.$slots.endIcon?(0,c.renderSlot)(e.$slots,`endIcon`,{key:0,iconSize:a.iconSize,clear:a.clearInput}):(0,c.renderSlot)(e.$slots,`rightIcon`,{key:1,iconSize:a.iconSize,clear:a.clearInput})],34)],10,p)],8,u),(0,c.createVNode)(s,(0,c.mergeProps)(e.messagesChildProps,{id:i.messagesId,"validation-messages":a.validationMessages,"show-messages":e.showMessages,class:e.messagesClass,"data-qa":`dt-input-messages`}),null,16,[`id`,`validation-messages`,`show-messages`,`class`])],6)}var _=r.t(l,[[`render`,g]]);exports.default=_;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/index.cjs`),t=require(`../../common/validators/index.cjs`),n=require(`../../common/utils/index.cjs`),r=require(`../../common/mixins/input.cjs`),i=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),a=require(`../validation-messages/validation-messages.cjs`),o=require(`../text/text-constants.cjs`),s=require(`../text/text.cjs`),c=require(`./input-constants.cjs`);let l=require(`vue`);var u=t.ordinalSizeValidator(c.INPUT_ICON_SIZES),d={name:`DtInput`,components:{DtValidationMessages:a.default,DtText:s.default},mixins:[r.MessagesMixin],inheritAttrs:!1,props:{name:{type:String,default:``},type:{type:String,default:c.INPUT_TYPES.TEXT,validator:e=>Object.values(c.INPUT_TYPES).includes(e)},modelValue:{type:[String,Number],default:``},disabled:{type:Boolean,default:!1},label:{type:String,default:``},showLabel:{type:Boolean,default:!0},description:{type:String,default:``},descriptionClass:{type:[String,Array,Object],default:``},size:{type:[String,Number],default:300,validator:u},inputClass:{type:[String,Object,Array],default:``},inputWrapperClass:{type:[String,Object,Array],default:``},currentLength:{type:Number,default:null},retainWarning:{type:Boolean,default:!1},validate:{type:Object,default:null},hidden:{type:Boolean,default:!1},labelSize:{type:[String,Number],default:null,validator:e=>o.TEXT_SIZE_MODIFIERS.label.includes(String(e))},labelStrength:{type:String,default:null,validator:e=>Object.keys(o.TEXT_STRENGTH_MODIFIERS).includes(e)},labelClass:{type:[String,Array,Object],default:``},startIconClass:{type:[String,Array,Object],default:``},endIconClass:{type:[String,Array,Object],default:``}},emits:[`blur`,`clear`,`focus`,`focusin`,`focusout`,`update:modelValue`,`update:length`,`update:invalid`],data(){return{isInputFocused:!1,isInvalid:!1,defaultLength:0,hasSlotContent:n.hasSlotContent,isComposing:!1,justEndedComposition:!1,messagesId:n.getUniqueString()}},computed:{isTextarea(){return this.type===c.INPUT_TYPES.TEXTAREA},isDefaultSize(){return String(this.size)===c.INPUT_SIZES.DEFAULT||String(this.size)===`300`},iconSize(){return c.INPUT_ICON_SIZES[String(this.size)]},isValidSize(){return u(this.size)},isValidDescriptionSize(){return Object.values(e.DESCRIPTION_SIZE_TYPES).includes(this.size)},inputComponent(){return this.isTextarea?`textarea`:`input`},inputListeners(){return{compositionstart:()=>{this.isComposing=!0},compositionend:()=>{this.isComposing=!1,this.justEndedComposition=!0;let e=this.$refs.input.value;this.$emit(`update:modelValue`,e),Promise.resolve().then(()=>{this.justEndedComposition=!1})},input:async e=>{if(this.isComposing||this.justEndedComposition)return;let t=e.target.value;this.type===c.INPUT_TYPES.FILE&&(t=Array.from(e.target.files).map(e=>e.name)),this.$emit(`update:modelValue`,t)},blur:e=>{this.isInputFocused=!1,this.onBlur(e)},focus:e=>{this.isInputFocused=!0,this.$emit(`focus`,e)},focusin:e=>this.$emit(`focusin`,e),focusout:e=>this.$emit(`focusout`,e)}},descriptionKey(){return`input-description-${n.getUniqueString()}`},inputState(){return n.getValidationState(this.validationMessages)},ariaInvalid(){return this.inputState===e.VALIDATION_MESSAGE_TYPES.CRITICAL?`true`:void 0},ariaDescribedBy(){return this.showMessages&&this.validationMessages.length>0?this.messagesId:void 0},defaultLengthCalculation(){return this.calculateLength(this.modelValue)},validationProps(){return{length:{description:this?.validate?.length?.description,max:this?.validate?.length?.max,warn:this?.validate?.length?.warn,message:this?.validate?.length?.message,limitMaxLength:this?.validate?.length?.limitMaxLength?this.validate.length.limitMaxLength:!1}}},validationMessages(){return this.showLengthLimitValidation?this.formattedMessages.concat([this.inputLengthErrorMessage()]):this.formattedMessages},showInputState(){return this.showMessages&&this.inputState},inputLength(){return this.currentLength?this.currentLength:this.defaultLengthCalculation},inputLengthState(){return this.inputLength<this.validationProps.length.warn?null:this.inputLength<=this.validationProps.length.max?this.validationProps.length.warn?e.VALIDATION_MESSAGE_TYPES.WARNING:null:e.VALIDATION_MESSAGE_TYPES.CRITICAL},shouldValidateLength(){return!!(this.validationProps.length.description&&this.validationProps.length.max)},shouldLimitMaxLength(){return this.shouldValidateLength&&this.validationProps.length.limitMaxLength},showLengthLimitValidation(){return this.shouldValidateLength&&this.inputLengthState!==null&&this.validationProps.length.message&&(this.retainWarning||this.isInputFocused||this.isInvalid)},resolvedLabelSize(){if(this.labelSize!=null)return this.labelSize;let e=String(this.size);return e===`xl`||e===`500`?e===`500`?`400`:`lg`:this.size},resolvedDescriptionSize(){return{100:`xs`,200:`xs`,300:`sm`,400:`sm`,500:`md`,xs:`xs`,sm:`xs`,md:`sm`,lg:`sm`,xl:`md`}[String(this.size)]||`sm`},resolvedDescriptionDensity(){let e=String(this.size);return e===`xl`||e===`500`?`300`:void 0},sizeModifierClass(){return this.isDefaultSize||!this.isValidSize?``:c.INPUT_SIZE_CLASSES[this.inputComponent][String(this.size)]},stateClass(){return[c.INPUT_STATE_CLASSES[this.inputState]]}},watch:{isInvalid(e){this.$emit(`update:invalid`,e)},modelValue:{immediate:!0,handler(e){this.shouldValidateLength&&this.validateLength(this.inputLength),this.currentLength??this.$emit(`update:length`,this.calculateLength(e)),this.isTextarea&&!this.isComposing&&this.$refs.input&&this.$refs.input.value!==e&&(this.$refs.input.value=e)}}},mounted(){this.isTextarea&&this.$refs.input&&(this.$refs.input.value=this.modelValue),this.runValidations()},methods:{removeClassStyleAttrs:n.removeClassStyleAttrs,inputClasses(){return[`d-input__input`,this.inputComponent===`input`?`d-input`:`d-textarea`,{[this.stateClass]:this.showInputState,"d-input-icon--left":this.$slots.startIcon||this.$slots.leftIcon,"d-input-icon--right":this.$slots.endIcon||this.$slots.rightIcon},this.sizeModifierClass,this.inputClass]},inputWrapperClasses(){return this.hidden?[]:[`d-input__wrapper`,{[this.stateClass]:this.showInputState},this.inputWrapperClass]},calculateLength(e){return typeof e==`string`?[...e].length:0},inputLengthErrorMessage(){return{message:this.validationProps.length.message,type:this.inputLengthState}},onBlur(e){this.$refs.container?.contains(e.relatedTarget)||this.$emit(`blur`,e)},emitClearEvents(){this.$emit(`clear`),this.$emit(`update:modelValue`,``)},blur(){this.$refs.input.blur()},focus(){this.$refs.input.focus()},select(){this.$refs.input.select()},getMessageKey(e,t){return`message-${e}-${t}`},validateLength(e){this.isInvalid=e>this.validationProps.length.max},clearInput(){this.$refs.input.value=``,this.$refs.input.focus(),this.emitClearEvents()},runValidations(){!this.label&&!this.$attrs[`aria-label`]&&console.info(`[Dialtone] A label is required for accessibility. Provide a label prop and use show-label="false" to hide it visually.`)}}},f=[`aria-details`],p={key:0},m={key:1,"data-qa":`dt-input-length-description`,class:`d-input__length-description`},h=[`read-only`],g=[`name`,`disabled`,`autocomplete`,`maxlength`,`aria-label`,`aria-invalid`,`aria-describedby`],_=[`value`,`name`,`type`,`disabled`,`autocomplete`,`maxlength`,`aria-label`,`aria-invalid`,`aria-describedby`];function v(e,t,n,r,i,a){let o=(0,l.resolveComponent)(`dt-text`),s=(0,l.resolveComponent)(`dt-validation-messages`);return(0,l.openBlock)(),(0,l.createElementBlock)(`div`,{ref:`container`,class:(0,l.normalizeClass)([`d-input__root`,{"d-input--hidden":n.hidden},e.$attrs.class]),style:(0,l.normalizeStyle)(e.$attrs.style),"data-qa":`dt-input`},[(0,l.createElementVNode)(`label`,{class:`d-input__label`,"aria-details":e.$slots.description||n.description?a.descriptionKey:void 0,"data-qa":`dt-input-label-wrapper`},[(0,l.renderSlot)(e.$slots,`label`,{},()=>[n.showLabel&&n.label?((0,l.openBlock)(),(0,l.createBlock)(o,{key:0,ref:`label`,"data-qa":`dt-input-label`,kind:`label`,size:a.resolvedLabelSize,strength:n.labelStrength,tone:`secondary`,class:(0,l.normalizeClass)([`d-input__label-text`,n.labelClass])},{default:(0,l.withCtx)(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(n.label),1)]),_:1},8,[`size`,`strength`,`class`])):(0,l.createCommentVNode)(``,!0)]),i.hasSlotContent(e.$slots.description)||n.description||a.shouldValidateLength?((0,l.openBlock)(),(0,l.createBlock)(o,{key:0,id:a.descriptionKey,ref:`description`,kind:`body`,size:a.resolvedDescriptionSize,tone:`tertiary`,density:a.resolvedDescriptionDensity,as:`div`,class:(0,l.normalizeClass)([`d-input__description`,`d-description`,n.descriptionClass]),"data-qa":`dt-input-description`},{default:(0,l.withCtx)(()=>[i.hasSlotContent(e.$slots.description)||n.description?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,p,[(0,l.renderSlot)(e.$slots,`description`,{},()=>[(0,l.createTextVNode)((0,l.toDisplayString)(n.description),1)])])):(0,l.createCommentVNode)(``,!0),a.shouldValidateLength?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,m,(0,l.toDisplayString)(a.validationProps.length.description),1)):(0,l.createCommentVNode)(``,!0)]),_:3},8,[`id`,`size`,`density`,`class`])):(0,l.createCommentVNode)(``,!0),(0,l.createElementVNode)(`div`,{class:(0,l.normalizeClass)(a.inputWrapperClasses()),"read-only":n.disabled===!0?!0:void 0},[(0,l.createElementVNode)(`span`,{class:(0,l.normalizeClass)([`d-input-icon`,`d-input-icon--left`,n.startIconClass]),"data-qa":`dt-input-left-icon-wrapper`,onFocusout:t[0]||(t[0]=(...e)=>a.onBlur&&a.onBlur(...e))},[e.$slots.startIcon?(0,l.renderSlot)(e.$slots,`startIcon`,{key:0,iconSize:a.iconSize}):(0,l.renderSlot)(e.$slots,`leftIcon`,{key:1,iconSize:a.iconSize})],34),a.isTextarea?((0,l.openBlock)(),(0,l.createElementBlock)(`textarea`,(0,l.mergeProps)({key:0,ref:`input`,name:n.name,disabled:n.disabled,autocomplete:e.$attrs.autocomplete??`off`,class:a.inputClasses(),maxlength:a.shouldLimitMaxLength?a.validationProps.length.max:null,"aria-label":!n.showLabel&&n.label?n.label:void 0,"aria-invalid":a.ariaInvalid,"aria-describedby":a.ariaDescribedBy,"data-qa":`dt-input-input`},a.removeClassStyleAttrs(e.$attrs),(0,l.toHandlers)(a.inputListeners,!0)),null,16,g)):((0,l.openBlock)(),(0,l.createElementBlock)(`input`,(0,l.mergeProps)({key:1,ref:`input`,value:n.modelValue,name:n.name,type:n.type,disabled:n.disabled,autocomplete:e.$attrs.autocomplete??`off`,class:a.inputClasses(),maxlength:a.shouldLimitMaxLength?a.validationProps.length.max:null,"aria-label":!n.showLabel&&n.label?n.label:void 0,"aria-invalid":a.ariaInvalid,"aria-describedby":a.ariaDescribedBy,"data-qa":`dt-input-input`},a.removeClassStyleAttrs(e.$attrs),(0,l.toHandlers)(a.inputListeners,!0)),null,16,_)),(0,l.createElementVNode)(`span`,{class:(0,l.normalizeClass)([`d-input-icon`,`d-input-icon--right`,n.endIconClass]),"data-qa":`dt-input-right-icon-wrapper`,onFocusout:t[1]||(t[1]=(...e)=>a.onBlur&&a.onBlur(...e))},[e.$slots.endIcon?(0,l.renderSlot)(e.$slots,`endIcon`,{key:0,iconSize:a.iconSize,clear:a.clearInput}):(0,l.renderSlot)(e.$slots,`rightIcon`,{key:1,iconSize:a.iconSize,clear:a.clearInput})],34)],10,h)],8,f),(0,l.createVNode)(s,(0,l.mergeProps)(e.messagesChildProps,{id:i.messagesId,"validation-messages":a.validationMessages,"show-messages":e.showMessages,class:e.messagesClass,"data-qa":`dt-input-messages`}),null,16,[`id`,`validation-messages`,`show-messages`,`class`])],6)}var y=i.t(d,[[`render`,v]]);exports.default=y;
|
|
2
2
|
//# sourceMappingURL=input.cjs.map
|