@onereach/ui-components 7.0.0 → 7.0.1-beta.3529.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled/v2/components/OrBottomSheetV3/OrBottomSheet.js +1 -1
- package/dist/bundled/v2/components/OrBottomSheetV3/hooks/useBottomSheetSwipeState.js +1 -1
- package/dist/bundled/v2/components/OrCode/OrCode.js +1 -1
- package/dist/bundled/v2/components/OrColorPicker/OrColorPicker.js +1 -1
- package/dist/bundled/v2/components/OrConfirm/OrConfirm.js +1 -1
- package/dist/bundled/v2/components/OrConfirmV3/OrConfirm.js +1 -1
- package/dist/bundled/v2/components/OrDatePickerV3/OrDatePicker.js +2 -2
- package/dist/bundled/v2/components/OrDateTimePicker/OrDateTimePicker.js +1 -1
- package/dist/bundled/v2/components/OrDateTimePickerV3/OrDateTimePicker.js +3 -3
- package/dist/bundled/v2/components/OrDateTimePickerV3/index.js +3 -3
- package/dist/bundled/v2/components/OrInlineTextEdit/OrInlineTextEdit.js +1 -1
- package/dist/bundled/v2/components/OrLoaderV3/OrLoader.js +1 -1
- package/dist/bundled/v2/components/OrModal/OrModal.js +2 -2
- package/dist/bundled/v2/components/OrOverflowMenu/OrOverflowMenu.js +1 -1
- package/dist/bundled/v2/components/OrOverlayV3/OrOverlay.js +1 -1
- package/dist/bundled/v2/components/OrPassword/OrPassword.js +1 -1
- package/dist/bundled/v2/components/OrPopoverV3/OrPopover.js +1 -1
- package/dist/bundled/v2/components/OrProgressV3/OrProgress.js +1 -1
- package/dist/bundled/v2/components/OrResizeablePanelV3/OrResizeablePanel.js +1 -1
- package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.js +2 -2
- package/dist/bundled/v2/components/OrSelect/OrSelect.js +1 -1
- package/dist/bundled/v2/components/OrSelectV3/OrSelect.js +621 -137
- package/dist/bundled/v2/components/OrSelectV3/OrSelect.vue.d.ts +48 -29
- package/dist/bundled/v2/components/OrSelectV3/styles.js +1 -1
- package/dist/bundled/v2/components/OrSelectV3/types.d.ts +3 -1
- package/dist/bundled/v2/components/OrSidebar/OrSidebar.js +1 -1
- package/dist/bundled/v2/components/OrSlider/OrSlider.js +1 -1
- package/dist/bundled/v2/components/OrTabsV3/OrTabs.js +1 -1
- package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.js +138 -67
- package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.vue.d.ts +59 -14
- package/dist/bundled/v2/components/OrTagInputV3/styles.js +1 -1
- package/dist/bundled/v2/components/OrTagsV3/OrTags.js +56 -19
- package/dist/bundled/v2/components/OrTagsV3/OrTags.vue.d.ts +32 -12
- package/dist/bundled/v2/components/OrTagsV3/props.d.ts +3 -1
- package/dist/bundled/v2/components/OrTagsV3/props.js +4 -0
- package/dist/bundled/v2/components/OrTagsV3/styles.js +15 -5
- package/dist/bundled/v2/components/OrTagsV3/types.d.ts +6 -0
- package/dist/bundled/v2/components/OrTagsV3/types.js +1 -0
- package/dist/bundled/v2/components/OrTagsV3/utils/castToTag.d.ts +2 -0
- package/dist/bundled/v2/components/OrTagsV3/utils/castToTag.js +12 -0
- package/dist/bundled/v2/components/OrTimePickerV3/OrTimePicker.js +2 -2
- package/dist/bundled/v2/components/OrToast/composable/useToastEventBus.js +1 -1
- package/dist/bundled/v2/components/OrToastV3/composable/useToastEventBus.js +1 -1
- package/dist/bundled/v2/components/index.js +3 -3
- package/dist/bundled/v2/hooks/useOverflow.d.ts +4 -1
- package/dist/bundled/v2/hooks/useOverflow.js +10 -3
- package/dist/bundled/v2/hooks/useResponsive/useResponsive.js +1 -1
- package/dist/bundled/v2/{index-a488b35e.js → index-a77d7adf.js} +23 -1
- package/dist/bundled/v2/index.js +4 -4
- package/dist/bundled/v2/{useFocusTrap-44eded81.js → useFocusTrap-dad25115.js} +1 -1
- package/dist/bundled/v3/{OrBottomSheet.vue_vue_type_script_lang-37e2fc0e.js → OrBottomSheet.vue_vue_type_script_lang-5c209d34.js} +2 -2
- package/dist/bundled/v3/{OrButton.vue_vue_type_script_lang-bc25bb37.js → OrButton.vue_vue_type_script_lang-0f7bda53.js} +1 -1
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-77bcd3a8.js → OrCardCollection.vue_vue_type_script_lang-4bbd52e3.js} +1 -1
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-81901ad7.js → OrCardCollection.vue_vue_type_script_lang-832a6115.js} +3 -3
- package/dist/bundled/v3/{OrCheckboxGroup.vue_vue_type_script_lang-ada59489.js → OrCheckboxGroup.vue_vue_type_script_lang-850a6eba.js} +1 -1
- package/dist/bundled/v3/{OrCheckboxTree.vue_vue_type_script_lang-aea94f67.js → OrCheckboxTree.vue_vue_type_script_lang-daa18318.js} +2 -2
- package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-12e5e92d.js → OrCode.vue_vue_type_script_lang-3a6280cf.js} +2 -2
- package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-9008d0ff.js → OrCode.vue_vue_type_script_lang-e7e395eb.js} +2 -2
- package/dist/bundled/v3/{OrColorPicker.vue_vue_type_script_lang-5c6fd662.js → OrColorPicker.vue_vue_type_script_lang-ae778af6.js} +2 -2
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-22a73313.js → OrConfirm.vue_vue_type_script_lang-1c3c49c8.js} +6 -6
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-5dd6c37e.js → OrConfirm.vue_vue_type_script_lang-9ed9ba84.js} +4 -4
- package/dist/bundled/v3/{OrContextMenu.vue_vue_type_script_lang-4d5e445b.js → OrContextMenu.vue_vue_type_script_lang-6caa81c0.js} +1 -1
- package/dist/bundled/v3/{OrDatePicker.vue_vue_type_script_lang-eeb33130.js → OrDatePicker.vue_vue_type_script_lang-b2bdcc61.js} +4 -4
- package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-a75fb98f.js → OrDateTimePicker.vue_vue_type_script_lang-a4f4d0dd.js} +1 -1
- package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-3b26d48d.js → OrDateTimePicker.vue_vue_type_script_lang-fcacd5d0.js} +5 -5
- package/dist/bundled/v3/{OrDateTimePickerPopoverHeader-0c4c9bbc.js → OrDateTimePickerPopoverHeader-0ebbb959.js} +4 -4
- package/dist/bundled/v3/{OrDateTimePickerPopoverHeader.vue_vue_type_script_lang-f2f452de.js → OrDateTimePickerPopoverHeader.vue_vue_type_script_lang-c9eb540e.js} +1 -1
- package/dist/bundled/v3/{OrDateTimePickerTimeSelect-ca150449.js → OrDateTimePickerTimeSelect-934093b2.js} +1 -1
- package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-a35c30ce.js → OrIconButton.vue_vue_type_script_lang-6a53a819.js} +1 -1
- package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-df7eb768.js → OrInlineInput.vue_vue_type_script_lang-c5b3b8f5.js} +1 -1
- package/dist/bundled/v3/{OrInlineTextEdit.vue_vue_type_script_lang-70b79aec.js → OrInlineTextEdit.vue_vue_type_script_lang-3efb497c.js} +1 -1
- package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-4f7dfa64.js → OrInlineTextarea.vue_vue_type_script_lang-b36f6ddd.js} +1 -1
- package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-bea5b267.js → OrInput.vue_vue_type_script_lang-f558bdbb.js} +2 -2
- package/dist/bundled/v3/{OrLoader.vue_vue_type_script_lang-aefd49c2.js → OrLoader.vue_vue_type_script_lang-e4fbf869.js} +1 -1
- package/dist/bundled/v3/{OrMenu.vue_vue_type_script_lang-c4b4ca1b.js → OrMenu.vue_vue_type_script_lang-2ef9ec71.js} +1 -1
- package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-712e0986.js → OrModal.vue_vue_type_script_lang-a7ac4ac5.js} +2 -2
- package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-09c00129.js → OrModal.vue_vue_type_script_lang-c4d31fae.js} +2 -2
- package/dist/bundled/v3/{OrNotification.vue_vue_type_script_lang-b53d29af.js → OrNotification.vue_vue_type_script_lang-eaf4f467.js} +1 -1
- package/dist/bundled/v3/{OrOverflowMenu.vue_vue_type_script_lang-bba61b94.js → OrOverflowMenu.vue_vue_type_script_lang-fa75e033.js} +2 -2
- package/dist/bundled/v3/{OrOverlay.vue_vue_type_script_lang-a2afd31a.js → OrOverlay.vue_vue_type_script_lang-5b1f4a36.js} +1 -1
- package/dist/bundled/v3/{OrPagination.vue_vue_type_script_lang-5b33bd96.js → OrPagination.vue_vue_type_script_lang-8a01d103.js} +2 -2
- package/dist/bundled/v3/{OrPassword.vue_vue_type_script_lang-b36b869a.js → OrPassword.vue_vue_type_script_lang-5cacdf5e.js} +1 -1
- package/dist/bundled/v3/{OrPopover.vue_vue_type_script_lang-2462c31d.js → OrPopover.vue_vue_type_script_lang-d7c493af.js} +2 -2
- package/dist/bundled/v3/{OrProgress.vue_vue_type_script_lang-f2da8e58.js → OrProgress.vue_vue_type_script_lang-9f7dcc82.js} +1 -1
- package/dist/bundled/v3/{OrResizeablePanel.vue_vue_type_script_lang-6ff56926.js → OrResizeablePanel.vue_vue_type_script_lang-b521771e.js} +2 -2
- package/dist/bundled/v3/{OrRichTextEditor.vue_vue_type_script_lang-3e868b85.js → OrRichTextEditor.vue_vue_type_script_lang-88d8212b.js} +8 -8
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-44935ef1.js → OrSearch.vue_vue_type_script_lang-89527d71.js} +1 -1
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-12b1c76f.js → OrSearch.vue_vue_type_script_lang-e756d8a8.js} +2 -2
- package/dist/bundled/v3/OrSelect.vue_vue_type_script_lang-3c895f3a.js +746 -0
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-0ae0fd63.js → OrSelect.vue_vue_type_script_lang-a4d17559.js} +1 -1
- package/dist/bundled/v3/{OrSidebar.vue_vue_type_script_lang-509fb105.js → OrSidebar.vue_vue_type_script_lang-314721d5.js} +1 -1
- package/dist/bundled/v3/{OrSidebar.vue_vue_type_script_lang-696f6851.js → OrSidebar.vue_vue_type_script_lang-f69f92ca.js} +1 -1
- package/dist/bundled/v3/{OrSlider.vue_vue_type_script_lang-e0c33892.js → OrSlider.vue_vue_type_script_lang-207c0596.js} +1 -1
- package/dist/bundled/v3/{OrSorting.vue_vue_type_script_lang-9c054059.js → OrSorting.vue_vue_type_script_lang-257e1c8b.js} +2 -2
- package/dist/bundled/v3/{OrSwitch.vue_vue_type_script_lang-188b038b.js → OrSwitch.vue_vue_type_script_lang-032fd11a.js} +1 -1
- package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-c06d9565.js → OrTabs.vue_vue_type_script_lang-ddac6c54.js} +2 -2
- package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-e4811b42.js → OrTag.vue_vue_type_script_lang-6c0094be.js} +1 -1
- package/dist/bundled/v3/{OrTagInput.vue_vue_type_script_lang-c074503e.js → OrTagInput.vue_vue_type_script_lang-cef895f1.js} +71 -14
- package/dist/bundled/v3/{OrTags.vue_vue_type_script_lang-ffa6d728.js → OrTags.vue_vue_type_script_lang-ab2ccd23.js} +45 -10
- package/dist/bundled/v3/{OrTimePicker.vue_vue_type_script_lang-9f7d944b.js → OrTimePicker.vue_vue_type_script_lang-5c3cd13d.js} +4 -4
- package/dist/bundled/v3/{OrToastContainer.vue_vue_type_script_lang-2ae21641.js → OrToastContainer.vue_vue_type_script_lang-2905654d.js} +1 -1
- package/dist/bundled/v3/{OrToastContainer.vue_vue_type_script_lang-671d567d.js → OrToastContainer.vue_vue_type_script_lang-ccc99bf4.js} +1 -1
- package/dist/bundled/v3/{OrTooltip.vue_vue_type_script_lang-28b89a3e.js → OrTooltip.vue_vue_type_script_lang-dd0c252d.js} +1 -1
- package/dist/bundled/v3/{OrTree.vue_vue_type_script_lang-5f86b587.js → OrTree.vue_vue_type_script_lang-cd793811.js} +2 -2
- package/dist/bundled/v3/components/OrBottomSheetV3/OrBottomSheet.js +2 -2
- package/dist/bundled/v3/components/OrBottomSheetV3/hooks/useBottomSheetSwipeState.js +1 -1
- package/dist/bundled/v3/components/OrBottomSheetV3/index.js +1 -1
- package/dist/bundled/v3/components/OrButtonV3/OrButton.js +2 -2
- package/dist/bundled/v3/components/OrButtonV3/index.js +1 -1
- package/dist/bundled/v3/components/OrCardCollection/OrCardCollection.js +2 -2
- package/dist/bundled/v3/components/OrCardCollection/index.js +1 -1
- package/dist/bundled/v3/components/OrCardCollectionV3/OrCardCollection.js +2 -2
- package/dist/bundled/v3/components/OrCardCollectionV3/index.js +1 -1
- package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.js +2 -2
- package/dist/bundled/v3/components/OrCheckboxGroupV3/index.js +1 -1
- package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.js +2 -2
- package/dist/bundled/v3/components/OrCheckboxTreeV3/index.js +1 -1
- package/dist/bundled/v3/components/OrCode/OrCode.js +2 -2
- package/dist/bundled/v3/components/OrCode/index.js +1 -1
- package/dist/bundled/v3/components/OrCodeV3/OrCode.js +2 -2
- package/dist/bundled/v3/components/OrCodeV3/index.js +1 -1
- package/dist/bundled/v3/components/OrColorPicker/OrColorPicker.js +2 -2
- package/dist/bundled/v3/components/OrColorPicker/index.js +1 -1
- package/dist/bundled/v3/components/OrConfirm/OrConfirm.js +2 -2
- package/dist/bundled/v3/components/OrConfirm/index.js +1 -1
- package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.js +2 -2
- package/dist/bundled/v3/components/OrConfirmV3/index.js +1 -1
- package/dist/bundled/v3/components/OrContextMenuV3/OrContextMenu.js +2 -2
- package/dist/bundled/v3/components/OrContextMenuV3/index.js +1 -1
- package/dist/bundled/v3/components/OrDatePickerV3/OrDatePicker.js +2 -2
- package/dist/bundled/v3/components/OrDatePickerV3/index.js +1 -1
- package/dist/bundled/v3/components/OrDateTimePicker/OrDateTimePicker.js +2 -2
- package/dist/bundled/v3/components/OrDateTimePicker/index.js +1 -1
- package/dist/bundled/v3/components/OrDateTimePickerV3/OrDateTimePicker.js +2 -2
- package/dist/bundled/v3/components/OrDateTimePickerV3/index.js +4 -4
- package/dist/bundled/v3/components/OrExpansionPanelV3/OrExpansionPanel.js +2 -2
- package/dist/bundled/v3/components/OrExpansionPanelV3/index.js +1 -1
- package/dist/bundled/v3/components/OrIconButtonV3/OrIconButton.js +2 -2
- package/dist/bundled/v3/components/OrIconButtonV3/index.js +1 -1
- package/dist/bundled/v3/components/OrInlineInputV3/OrInlineInput.js +2 -2
- package/dist/bundled/v3/components/OrInlineInputV3/index.js +1 -1
- package/dist/bundled/v3/components/OrInlineTextEdit/OrInlineTextEdit.js +2 -2
- package/dist/bundled/v3/components/OrInlineTextEdit/index.js +1 -1
- package/dist/bundled/v3/components/OrInlineTextareaV3/OrInlineTextarea.js +2 -2
- package/dist/bundled/v3/components/OrInlineTextareaV3/index.js +1 -1
- package/dist/bundled/v3/components/OrInputV3/OrInput.js +2 -2
- package/dist/bundled/v3/components/OrInputV3/index.js +1 -1
- package/dist/bundled/v3/components/OrLoaderV3/OrLoader.js +2 -2
- package/dist/bundled/v3/components/OrLoaderV3/index.js +1 -1
- package/dist/bundled/v3/components/OrMenuV3/OrMenu.js +2 -2
- package/dist/bundled/v3/components/OrMenuV3/index.js +1 -1
- package/dist/bundled/v3/components/OrModal/OrModal.js +2 -2
- package/dist/bundled/v3/components/OrModal/index.js +1 -1
- package/dist/bundled/v3/components/OrModalV3/OrModal.js +2 -2
- package/dist/bundled/v3/components/OrModalV3/index.js +1 -1
- package/dist/bundled/v3/components/OrNotificationV3/OrNotification.js +2 -2
- package/dist/bundled/v3/components/OrNotificationV3/index.js +1 -1
- package/dist/bundled/v3/components/OrOverflowMenu/OrOverflowMenu.js +2 -2
- package/dist/bundled/v3/components/OrOverflowMenu/index.js +1 -1
- package/dist/bundled/v3/components/OrOverlayV3/OrOverlay.js +2 -2
- package/dist/bundled/v3/components/OrOverlayV3/index.js +1 -1
- package/dist/bundled/v3/components/OrPaginationV3/OrPagination.js +2 -2
- package/dist/bundled/v3/components/OrPaginationV3/index.js +1 -1
- package/dist/bundled/v3/components/OrPassword/OrPassword.js +2 -2
- package/dist/bundled/v3/components/OrPassword/index.js +1 -1
- package/dist/bundled/v3/components/OrPopoverV3/OrPopover.js +2 -2
- package/dist/bundled/v3/components/OrPopoverV3/index.js +1 -1
- package/dist/bundled/v3/components/OrProgressV3/OrProgress.js +2 -2
- package/dist/bundled/v3/components/OrProgressV3/index.js +1 -1
- package/dist/bundled/v3/components/OrResizeablePanelV3/OrResizeablePanel.js +2 -2
- package/dist/bundled/v3/components/OrResizeablePanelV3/index.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +2 -2
- package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +1 -1
- package/dist/bundled/v3/components/OrSearch/OrSearch.js +2 -2
- package/dist/bundled/v3/components/OrSearch/index.js +1 -1
- package/dist/bundled/v3/components/OrSearchV3/OrSearch.js +2 -2
- package/dist/bundled/v3/components/OrSearchV3/index.js +1 -1
- package/dist/bundled/v3/components/OrSelect/OrSelect.js +2 -2
- package/dist/bundled/v3/components/OrSelect/index.js +1 -1
- package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +52 -84
- package/dist/bundled/v3/components/OrSelectV3/OrSelect.vue.d.ts +21 -19
- package/dist/bundled/v3/components/OrSelectV3/index.js +1 -1
- package/dist/bundled/v3/components/OrSelectV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrSelectV3/types.d.ts +3 -1
- package/dist/bundled/v3/components/OrSidebar/OrSidebar.js +2 -2
- package/dist/bundled/v3/components/OrSidebar/index.js +1 -1
- package/dist/bundled/v3/components/OrSidebarV3/OrSidebar.js +2 -2
- package/dist/bundled/v3/components/OrSidebarV3/index.js +1 -1
- package/dist/bundled/v3/components/OrSlider/OrSlider.js +2 -2
- package/dist/bundled/v3/components/OrSlider/index.js +1 -1
- package/dist/bundled/v3/components/OrSortingV3/OrSorting.js +2 -2
- package/dist/bundled/v3/components/OrSortingV3/index.js +1 -1
- package/dist/bundled/v3/components/OrSwitchV3/OrSwitch.js +2 -2
- package/dist/bundled/v3/components/OrSwitchV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTabsV3/OrTabs.js +2 -2
- package/dist/bundled/v3/components/OrTabsV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.js +60 -39
- package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.vue.d.ts +31 -12
- package/dist/bundled/v3/components/OrTagInputV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTagInputV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrTagV3/OrTag.js +2 -2
- package/dist/bundled/v3/components/OrTagV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTagsV3/OrTags.js +22 -15
- package/dist/bundled/v3/components/OrTagsV3/OrTags.vue.d.ts +21 -7
- package/dist/bundled/v3/components/OrTagsV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTagsV3/props.d.ts +3 -1
- package/dist/bundled/v3/components/OrTagsV3/props.js +4 -0
- package/dist/bundled/v3/components/OrTagsV3/styles.js +15 -5
- package/dist/bundled/v3/components/OrTagsV3/types.d.ts +6 -0
- package/dist/bundled/v3/components/OrTagsV3/types.js +1 -0
- package/dist/bundled/v3/components/OrTagsV3/utils/castToTag.d.ts +2 -0
- package/dist/bundled/v3/components/OrTagsV3/utils/castToTag.js +12 -0
- package/dist/bundled/v3/components/OrTimePickerV3/OrTimePicker.js +2 -2
- package/dist/bundled/v3/components/OrTimePickerV3/index.js +1 -1
- package/dist/bundled/v3/components/OrToast/Timer.js +1 -1
- package/dist/bundled/v3/components/OrToast/composable/useToastEventBus.js +2 -2
- package/dist/bundled/v3/components/OrToast/index.js +1 -1
- package/dist/bundled/v3/components/OrToastContainer/OrToastContainer.js +2 -2
- package/dist/bundled/v3/components/OrToastContainer/index.js +1 -1
- package/dist/bundled/v3/components/OrToastContainerV3/OrToastContainer.js +2 -2
- package/dist/bundled/v3/components/OrToastContainerV3/index.js +1 -1
- package/dist/bundled/v3/components/OrToastV3/OrToast.js +2 -2
- package/dist/bundled/v3/components/OrToastV3/Timer.js +1 -1
- package/dist/bundled/v3/components/OrToastV3/composable/useToastEventBus.js +2 -2
- package/dist/bundled/v3/components/OrToastV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTooltipV3/OrTooltip.js +2 -2
- package/dist/bundled/v3/components/OrTooltipV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTreeV3/OrTree.js +2 -2
- package/dist/bundled/v3/components/OrTreeV3/index.js +1 -1
- package/dist/bundled/v3/components/index.js +55 -55
- package/dist/bundled/v3/hooks/useOverflow.d.ts +4 -1
- package/dist/bundled/v3/hooks/useOverflow.js +10 -3
- package/dist/bundled/v3/hooks/usePopoverState.js +1 -1
- package/dist/bundled/v3/hooks/useResponsive/useResponsive.js +1 -1
- package/dist/bundled/v3/{index-6c0c514a.js → index-0f230746.js} +1 -1
- package/dist/bundled/v3/{index-544e4b4e.js → index-6cbf1493.js} +1 -1
- package/dist/bundled/v3/{index-5baaa991.js → index-c5cda763.js} +24 -2
- package/dist/bundled/v3/index.js +56 -56
- package/dist/bundled/v3/{useFocusTrap-7acc7be5.js → useFocusTrap-aa5b17f6.js} +2 -2
- package/dist/esm/v2/{OrSelect-57af5b9a.js → OrSelect-578bcee2.js} +147 -197
- package/dist/esm/v2/OrSelectControlInput-28c226f8.js +140 -0
- package/dist/esm/v2/OrSelectMultipleControl-961d8d6a.js +209 -0
- package/dist/esm/v2/OrSelectPlaceholder-f36f4e40.js +69 -0
- package/dist/esm/v2/OrSelectSingleControl-76b29e0b.js +153 -0
- package/dist/esm/v2/{OrTagInput-51521313.js → OrTagInput-7f917d41.js} +140 -70
- package/dist/esm/v2/{OrTags-98807166.js → OrTags-ed4ddf4d.js} +86 -25
- package/dist/esm/v2/components/index.js +8 -4
- package/dist/esm/v2/components/or-select-v3/OrSelect.vue.d.ts +48 -29
- package/dist/esm/v2/components/or-select-v3/index.js +9 -3
- package/dist/esm/v2/components/or-select-v3/partials/index.d.ts +3 -0
- package/dist/esm/v2/components/or-select-v3/partials/index.js +32 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-control-input/OrSelectControlInput.vue.d.ts +73 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-control-input/index.d.ts +1 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-control-input/index.js +10 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-control-input/styles.d.ts +1 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-multiple-control/OrSelectMultipleControl.vue.d.ts +140 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-multiple-control/index.d.ts +1 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-multiple-control/index.js +31 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-multiple-control/styles.d.ts +1 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-multiple-control/utils/castToMultipleModel.d.ts +2 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-placeholder/index.d.ts +1 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-placeholder/index.js +3 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-single-control/OrSelectSingleControl.vue.d.ts +107 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-single-control/index.d.ts +1 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-single-control/index.js +13 -0
- package/dist/esm/v2/components/or-select-v3/partials/or-select-single-control/styles.d.ts +1 -0
- package/dist/esm/v2/components/or-select-v3/types.d.ts +3 -1
- package/dist/esm/v2/components/or-tag-input-v3/OrTagInput.vue.d.ts +59 -14
- package/dist/esm/v2/components/or-tag-input-v3/index.js +4 -4
- package/dist/esm/v2/components/or-tags-v3/OrTags.vue.d.ts +32 -12
- package/dist/esm/v2/components/or-tags-v3/index.js +2 -2
- package/dist/esm/v2/components/or-tags-v3/props.d.ts +3 -1
- package/dist/esm/v2/components/or-tags-v3/types.d.ts +6 -0
- package/dist/esm/v2/components/or-tags-v3/utils/castToTag.d.ts +2 -0
- package/dist/esm/v2/hooks/index.js +1 -1
- package/dist/esm/v2/hooks/useOverflow.d.ts +4 -1
- package/dist/esm/v2/index.js +8 -4
- package/dist/esm/v2/{useOverflow-ff9ae748.js → useOverflow-b482f3c9.js} +9 -2
- package/dist/esm/v3/{OrSelect-74c2c521.js → OrSelect-b359beb6.js} +134 -179
- package/dist/esm/v3/OrSelectControlInput-3297e30d.js +99 -0
- package/dist/esm/v3/OrSelectMultipleControl-3620b234.js +172 -0
- package/dist/esm/v3/OrSelectPlaceholder-10e3bf5e.js +44 -0
- package/dist/esm/v3/OrSelectSingleControl-f969c913.js +132 -0
- package/dist/esm/v3/{OrTagInput-851b05c8.js → OrTagInput-56ee7d0b.js} +129 -52
- package/dist/esm/v3/{OrTags-55b8c446.js → OrTags-52da64cd.js} +92 -26
- package/dist/esm/v3/components/index.js +8 -4
- package/dist/esm/v3/components/or-select-v3/OrSelect.vue.d.ts +21 -19
- package/dist/esm/v3/components/or-select-v3/index.js +9 -3
- package/dist/esm/v3/components/or-select-v3/partials/index.d.ts +3 -0
- package/dist/esm/v3/components/or-select-v3/partials/index.js +31 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-control-input/OrSelectControlInput.vue.d.ts +52 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-control-input/index.d.ts +1 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-control-input/index.js +10 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-control-input/styles.d.ts +1 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-multiple-control/OrSelectMultipleControl.vue.d.ts +94 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-multiple-control/index.d.ts +1 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-multiple-control/index.js +30 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-multiple-control/styles.d.ts +1 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-multiple-control/utils/castToMultipleModel.d.ts +2 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-placeholder/index.d.ts +1 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-placeholder/index.js +3 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-single-control/OrSelectSingleControl.vue.d.ts +73 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-single-control/index.d.ts +1 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-single-control/index.js +13 -0
- package/dist/esm/v3/components/or-select-v3/partials/or-select-single-control/styles.d.ts +1 -0
- package/dist/esm/v3/components/or-select-v3/types.d.ts +3 -1
- package/dist/esm/v3/components/or-tag-input-v3/OrTagInput.vue.d.ts +31 -12
- package/dist/esm/v3/components/or-tag-input-v3/index.js +4 -4
- package/dist/esm/v3/components/or-tags-v3/OrTags.vue.d.ts +21 -7
- package/dist/esm/v3/components/or-tags-v3/index.js +2 -2
- package/dist/esm/v3/components/or-tags-v3/props.d.ts +3 -1
- package/dist/esm/v3/components/or-tags-v3/types.d.ts +6 -0
- package/dist/esm/v3/components/or-tags-v3/utils/castToTag.d.ts +2 -0
- package/dist/esm/v3/hooks/index.js +1 -1
- package/dist/esm/v3/hooks/useOverflow.d.ts +4 -1
- package/dist/esm/v3/index.js +8 -4
- package/dist/esm/v3/{useOverflow-ff9ae748.js → useOverflow-b482f3c9.js} +9 -2
- package/package.json +2 -3
- package/src/components/or-select-v3/OrSelect.vue +107 -115
- package/src/components/or-select-v3/partials/index.ts +3 -0
- package/src/components/or-select-v3/partials/or-select-control-input/OrSelectControlInput.vue +88 -0
- package/src/components/or-select-v3/partials/or-select-control-input/index.ts +1 -0
- package/src/components/or-select-v3/partials/or-select-control-input/styles.ts +13 -0
- package/src/components/or-select-v3/partials/or-select-multiple-control/OrSelectMultipleControl.vue +161 -0
- package/src/components/or-select-v3/partials/or-select-multiple-control/index.ts +1 -0
- package/src/components/or-select-v3/partials/or-select-multiple-control/styles.ts +6 -0
- package/src/components/or-select-v3/partials/or-select-multiple-control/utils/castToMultipleModel.ts +10 -0
- package/src/components/or-select-v3/partials/or-select-placeholder/index.ts +1 -0
- package/src/components/or-select-v3/partials/or-select-single-control/OrSelectSingleControl.vue +131 -0
- package/src/components/or-select-v3/partials/or-select-single-control/index.ts +1 -0
- package/src/components/or-select-v3/partials/or-select-single-control/styles.ts +4 -0
- package/src/components/or-select-v3/styles.ts +1 -0
- package/src/components/or-select-v3/types.ts +5 -1
- package/src/components/or-tag-input-v3/OrTagInput.vue +121 -44
- package/src/components/or-tag-input-v3/styles.ts +1 -1
- package/src/components/or-tags-v3/OrTags.vue +67 -15
- package/src/components/or-tags-v3/props.ts +4 -0
- package/src/components/or-tags-v3/styles.ts +17 -2
- package/src/components/or-tags-v3/types.ts +6 -0
- package/src/components/or-tags-v3/utils/castToTag.ts +11 -0
- package/src/hooks/useOverflow.ts +13 -3
- package/dist/bundled/v3/OrSelect.vue_vue_type_script_lang-d1d57fd5.js +0 -352
- /package/dist/bundled/v2/{OrDateTimePickerMonthSelect-06eb6ce3.js → OrDateTimePickerMonthSelect-0dfe417f.js} +0 -0
- /package/dist/bundled/v2/{OrDateTimePickerPopoverHeader-fceb3125.js → OrDateTimePickerPopoverHeader-20b13137.js} +0 -0
- /package/dist/bundled/v2/{OrDateTimePickerTimeSelect-5ebd3f35.js → OrDateTimePickerTimeSelect-02a369fb.js} +0 -0
- /package/dist/bundled/v3/{OrExpansionPanel.vue_vue_type_script_lang-d7c2d142.js → OrExpansionPanel.vue_vue_type_script_lang-6efa4414.js} +0 -0
package/src/components/or-select-v3/partials/or-select-multiple-control/utils/castToMultipleModel.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SelectValue } from '../../../types';
|
|
2
|
+
import { isEmptyValue } from '../../../../../utils';
|
|
3
|
+
|
|
4
|
+
export function castToMultipleValue(value: SelectValue): SelectValue[] {
|
|
5
|
+
if (Array.isArray(value)) {
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return isEmptyValue(value) ? [] : [value];
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OrSelectPlaceholder } from './OrSelectPlaceholder.vue';
|
package/src/components/or-select-v3/partials/or-select-single-control/OrSelectSingleControl.vue
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="root"
|
|
4
|
+
:class="rootStyles"
|
|
5
|
+
>
|
|
6
|
+
<template v-if="!isEmpty">
|
|
7
|
+
<span class="truncate">
|
|
8
|
+
{{ selectionLabel }}
|
|
9
|
+
</span>
|
|
10
|
+
</template>
|
|
11
|
+
<template v-else>
|
|
12
|
+
<OrSelectControlInput
|
|
13
|
+
v-if="enableSearch"
|
|
14
|
+
ref="searchControl"
|
|
15
|
+
v-model="searchModelValue"
|
|
16
|
+
:placeholder="placeholder"
|
|
17
|
+
/>
|
|
18
|
+
<OrSelectPlaceholder
|
|
19
|
+
v-else
|
|
20
|
+
:disabled="disabled"
|
|
21
|
+
>
|
|
22
|
+
{{ placeholder }}
|
|
23
|
+
</OrSelectPlaceholder>
|
|
24
|
+
</template>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
import { computed, defineComponent, PropType, toRefs, ref } from 'vue-demi';
|
|
29
|
+
import { SelectOption, SelectValue } from '../../types';
|
|
30
|
+
import OrSelectPlaceholder from '../or-select-placeholder/OrSelectPlaceholder.vue';
|
|
31
|
+
import OrSelectControlInput from '../or-select-control-input/OrSelectControlInput.vue';
|
|
32
|
+
import { isEmptyValue } from '../../../../utils';
|
|
33
|
+
import { useProxyModelValue } from '../../../../hooks';
|
|
34
|
+
import { SelectSingleControlInput } from './styles';
|
|
35
|
+
|
|
36
|
+
export default defineComponent({
|
|
37
|
+
components: {
|
|
38
|
+
OrSelectPlaceholder,
|
|
39
|
+
OrSelectControlInput,
|
|
40
|
+
},
|
|
41
|
+
model: {
|
|
42
|
+
prop: 'modelValue',
|
|
43
|
+
event: 'update:modelValue',
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
modelValue: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: '',
|
|
49
|
+
},
|
|
50
|
+
model: {
|
|
51
|
+
type: [Object, String, Number, Array] as PropType<SelectValue>,
|
|
52
|
+
default: undefined,
|
|
53
|
+
},
|
|
54
|
+
placeholder: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: '',
|
|
57
|
+
},
|
|
58
|
+
options: {
|
|
59
|
+
type: Array as PropType<SelectOption[]>,
|
|
60
|
+
default: () => [],
|
|
61
|
+
},
|
|
62
|
+
enableSearch: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false,
|
|
65
|
+
},
|
|
66
|
+
disabled: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
emits: ['update:modelValue'],
|
|
72
|
+
expose: [
|
|
73
|
+
'root',
|
|
74
|
+
'focus',
|
|
75
|
+
'focused',
|
|
76
|
+
],
|
|
77
|
+
setup(props, context) {
|
|
78
|
+
// Refs
|
|
79
|
+
const root = ref<HTMLDivElement>();
|
|
80
|
+
const searchControl = ref<InstanceType<typeof OrSelectControlInput>>();
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
// Props
|
|
84
|
+
const { modelValue, model, options } = toRefs(props);
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
// State
|
|
88
|
+
const searchModelValue = useProxyModelValue(modelValue, context.emit);
|
|
89
|
+
const isEmpty = computed(() => {
|
|
90
|
+
return isEmptyValue(model.value);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const selection = computed(() => {
|
|
94
|
+
return options.value.find((option) => option.value === model.value);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const selectionLabel = computed(() => {
|
|
98
|
+
return selection.value?.label;
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const focused = computed(() => {
|
|
102
|
+
return searchControl.value?.focused;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// Styles
|
|
106
|
+
const rootStyles = computed(() => ([
|
|
107
|
+
'or-select-single-control-v3',
|
|
108
|
+
...SelectSingleControlInput,
|
|
109
|
+
]));
|
|
110
|
+
|
|
111
|
+
// Methods
|
|
112
|
+
function focus() {
|
|
113
|
+
if (searchControl.value) {
|
|
114
|
+
(searchControl.value.focus as () => void)();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
root,
|
|
120
|
+
rootStyles,
|
|
121
|
+
searchControl,
|
|
122
|
+
searchModelValue,
|
|
123
|
+
isEmpty,
|
|
124
|
+
selection,
|
|
125
|
+
selectionLabel,
|
|
126
|
+
focus,
|
|
127
|
+
focused,
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OrSelectSingleControl } from './OrSelectSingleControl.vue';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export interface SelectOption {
|
|
2
|
-
value:
|
|
2
|
+
value: RawValue;
|
|
3
3
|
label: string;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
export type RawValue = string | number | object;
|
|
7
|
+
|
|
6
8
|
export interface SelectSearchFunction {
|
|
7
9
|
(searchText: string, options: SelectOption[]): Promise<SelectOption[]>;
|
|
8
10
|
}
|
|
@@ -10,3 +12,5 @@ export interface SelectSearchFunction {
|
|
|
10
12
|
export interface SelectGroupByFunction {
|
|
11
13
|
(option: SelectOption): string;
|
|
12
14
|
}
|
|
15
|
+
|
|
16
|
+
export type SelectValue = RawValue | RawValue[] | undefined;
|
|
@@ -19,49 +19,65 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<OrInputBox
|
|
22
|
+
ref="inputBox"
|
|
22
23
|
:variant="disableDefaultStyles ? 'unstyled' : 'styled'"
|
|
23
|
-
:
|
|
24
|
+
:force-state="activated ? 'focus-within': undefined"
|
|
25
|
+
class="cursor-text"
|
|
24
26
|
:invalid="!!error"
|
|
25
27
|
:readonly="readonly"
|
|
26
28
|
:disabled="disabled"
|
|
29
|
+
tabindex="0"
|
|
30
|
+
@focus="activate"
|
|
27
31
|
>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
variant: readonly || disabled ? 'tag' : 'reset',
|
|
33
|
-
disabled: disabled
|
|
34
|
-
}"
|
|
35
|
-
@reset="remove($event)"
|
|
36
|
-
/>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<input
|
|
40
|
-
ref="control"
|
|
41
|
-
v-model="draftModelValue"
|
|
42
|
-
v-bind="controlAttributes"
|
|
43
|
-
:class="controlStyles"
|
|
44
|
-
:type="'text'"
|
|
45
|
-
:placeholder="proxyModelValue.length === 0 ? placeholder : undefined"
|
|
46
|
-
:readonly="readonly"
|
|
32
|
+
<OrTags
|
|
33
|
+
ref="tags"
|
|
34
|
+
:items="proxyModelValue"
|
|
35
|
+
class="grow"
|
|
47
36
|
:disabled="disabled"
|
|
48
|
-
:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
@
|
|
54
|
-
@focus="$emit('focus', $event)"
|
|
55
|
-
@blur="$emit('blur', $event)"
|
|
37
|
+
:tag-props="{
|
|
38
|
+
variant: readonly || disabled ? 'tag' : 'reset',
|
|
39
|
+
disabled: disabled
|
|
40
|
+
}"
|
|
41
|
+
:overflow="overflow"
|
|
42
|
+
@reset="remove($event)"
|
|
56
43
|
>
|
|
44
|
+
<template
|
|
45
|
+
v-if="showControl"
|
|
46
|
+
v-slot:tail
|
|
47
|
+
>
|
|
48
|
+
<div class="inline-flex w-fit max-w-full">
|
|
49
|
+
<input
|
|
50
|
+
ref="control"
|
|
51
|
+
v-model="draftModelValue"
|
|
52
|
+
v-bind="controlAttributes"
|
|
53
|
+
:class="controlStyles"
|
|
54
|
+
:style="controlInlineStyles"
|
|
55
|
+
:type="'text'"
|
|
56
|
+
:placeholder="proxyModelValue.length === 0 ? placeholder : undefined"
|
|
57
|
+
:readonly="readonly"
|
|
58
|
+
:disabled="disabled"
|
|
59
|
+
:autocomplete="'off'"
|
|
60
|
+
:minlength="undefined"
|
|
61
|
+
:maxlength="undefined"
|
|
62
|
+
@keydown.enter="add()"
|
|
63
|
+
@keydown="$emit('keydown', $event)"
|
|
64
|
+
@keyup="$emit('keyup', $event)"
|
|
65
|
+
@focus="activate"
|
|
66
|
+
>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
</OrTags>
|
|
57
70
|
|
|
58
|
-
<template
|
|
71
|
+
<template
|
|
72
|
+
v-if="enableClear && !readonly && !disabled"
|
|
73
|
+
v-slot:addon
|
|
74
|
+
>
|
|
59
75
|
<template v-if="proxyModelValue.length > 0 || draftModelValue">
|
|
60
76
|
<OrIconButton
|
|
61
77
|
:icon="'close'"
|
|
62
78
|
:color="'inherit'"
|
|
63
79
|
:disabled="readonly || disabled"
|
|
64
|
-
@click
|
|
80
|
+
@click="reset()"
|
|
65
81
|
/>
|
|
66
82
|
</template>
|
|
67
83
|
</template>
|
|
@@ -104,20 +120,18 @@
|
|
|
104
120
|
</template>
|
|
105
121
|
|
|
106
122
|
<script lang="ts">
|
|
107
|
-
import { PropType, computed, defineComponent, reactive, ref,
|
|
123
|
+
import { PropType, computed, defineComponent, reactive, ref, toRefs, nextTick, watch } from 'vue-demi';
|
|
124
|
+
import { MaybeElementRef, onClickOutside } from '@vueuse/core';
|
|
108
125
|
import { useControlAttributes, useIdAttribute, useProxyModelValue, useValidationAttributes } from '../../hooks';
|
|
109
126
|
import { OrErrorV3 as OrError } from '../or-error-v3';
|
|
110
127
|
import { OrHintV3 as OrHint } from '../or-hint-v3';
|
|
111
128
|
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
|
|
112
129
|
import { OrInputBoxV3 as OrInputBox } from '../or-input-box-v3';
|
|
113
130
|
import { OrLabelV3 as OrLabel } from '../or-label-v3';
|
|
114
|
-
import { OrTagsV3 as OrTags } from '../or-tags-v3';
|
|
115
|
-
import { TagInputSize } from './props';
|
|
131
|
+
import { OrTagsV3 as OrTags, TagsOverflow } from '../or-tags-v3';
|
|
116
132
|
import { TagInput, TagInputControl, TagInputItem } from './styles';
|
|
117
133
|
|
|
118
134
|
export default defineComponent({
|
|
119
|
-
name: 'OrTagInput',
|
|
120
|
-
|
|
121
135
|
components: {
|
|
122
136
|
OrError,
|
|
123
137
|
OrHint,
|
|
@@ -138,11 +152,6 @@ export default defineComponent({
|
|
|
138
152
|
default: () => [],
|
|
139
153
|
},
|
|
140
154
|
|
|
141
|
-
size: {
|
|
142
|
-
type: String as PropType<`${TagInputSize}`>,
|
|
143
|
-
default: TagInputSize.M,
|
|
144
|
-
},
|
|
145
|
-
|
|
146
155
|
label: {
|
|
147
156
|
type: String,
|
|
148
157
|
default: undefined,
|
|
@@ -182,6 +191,17 @@ export default defineComponent({
|
|
|
182
191
|
type: Boolean,
|
|
183
192
|
default: false,
|
|
184
193
|
},
|
|
194
|
+
|
|
195
|
+
overflow: {
|
|
196
|
+
type: String as PropType<`${TagsOverflow}`>,
|
|
197
|
+
default: TagsOverflow.Hidden,
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
// todo: review default state, disabling will breaking
|
|
201
|
+
enableClear: {
|
|
202
|
+
type: Boolean,
|
|
203
|
+
default: true,
|
|
204
|
+
},
|
|
185
205
|
},
|
|
186
206
|
|
|
187
207
|
emits: [
|
|
@@ -191,6 +211,7 @@ export default defineComponent({
|
|
|
191
211
|
'keyup',
|
|
192
212
|
'focus',
|
|
193
213
|
'blur',
|
|
214
|
+
'reset',
|
|
194
215
|
],
|
|
195
216
|
|
|
196
217
|
expose: [
|
|
@@ -204,6 +225,11 @@ export default defineComponent({
|
|
|
204
225
|
// Refs
|
|
205
226
|
const root = ref<HTMLElement>();
|
|
206
227
|
const control = ref<HTMLInputElement>();
|
|
228
|
+
const inputBox = ref<InstanceType<typeof OrInputBox>>();
|
|
229
|
+
const tags = ref<InstanceType<typeof OrTags>>();
|
|
230
|
+
|
|
231
|
+
// Props
|
|
232
|
+
const { modelValue, overflow, placeholder, disabled, readonly } = toRefs(props);
|
|
207
233
|
|
|
208
234
|
// Styles
|
|
209
235
|
const rootStyles = computed(() => [
|
|
@@ -226,12 +252,30 @@ export default defineComponent({
|
|
|
226
252
|
...useValidationAttributes(),
|
|
227
253
|
});
|
|
228
254
|
|
|
229
|
-
const
|
|
230
|
-
const
|
|
255
|
+
const activated = ref(false);
|
|
256
|
+
const proxyModelValue = useProxyModelValue(modelValue, context.emit);
|
|
257
|
+
const draftModelValue = ref<string>('');
|
|
231
258
|
|
|
232
259
|
const currentLength = computed(() => proxyModelValue.value?.length ?? 0);
|
|
233
260
|
const maxLength = computed(() => controlAttributes.maxlength);
|
|
234
261
|
|
|
262
|
+
const controlInlineStyles = computed(() => {
|
|
263
|
+
const chars = draftModelValue.value.length > 0
|
|
264
|
+
? draftModelValue.value.length
|
|
265
|
+
: currentLength.value === 0
|
|
266
|
+
? placeholder.value?.length ?? 0
|
|
267
|
+
: 0;
|
|
268
|
+
return {
|
|
269
|
+
width: `${Math.max(chars + 1 || 0, 3)}ch`,
|
|
270
|
+
};
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
const showControl = computed(() => {
|
|
274
|
+
return draftModelValue.value.length > 0
|
|
275
|
+
|| currentLength.value === 0
|
|
276
|
+
|| activated.value;
|
|
277
|
+
});
|
|
278
|
+
|
|
235
279
|
// Methods
|
|
236
280
|
function focus(): void {
|
|
237
281
|
control.value?.focus();
|
|
@@ -241,6 +285,19 @@ export default defineComponent({
|
|
|
241
285
|
control.value?.blur();
|
|
242
286
|
}
|
|
243
287
|
|
|
288
|
+
function deactivate() {
|
|
289
|
+
activated.value = false;
|
|
290
|
+
nextTick(() => blur());
|
|
291
|
+
context.emit('blur');
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function activate() {
|
|
295
|
+
if (disabled.value || readonly.value) return;
|
|
296
|
+
activated.value = true;
|
|
297
|
+
nextTick(() => focus());
|
|
298
|
+
context.emit('focus');
|
|
299
|
+
}
|
|
300
|
+
|
|
244
301
|
function add(): void {
|
|
245
302
|
const newItem = draftModelValue.value?.trim();
|
|
246
303
|
|
|
@@ -249,7 +306,7 @@ export default defineComponent({
|
|
|
249
306
|
if (maxLength.value && currentLength.value >= maxLength.value) return;
|
|
250
307
|
|
|
251
308
|
proxyModelValue.value = [...proxyModelValue.value, newItem];
|
|
252
|
-
draftModelValue.value =
|
|
309
|
+
draftModelValue.value = '';
|
|
253
310
|
}
|
|
254
311
|
|
|
255
312
|
function remove(value: string): void {
|
|
@@ -258,23 +315,43 @@ export default defineComponent({
|
|
|
258
315
|
|
|
259
316
|
function reset(): void {
|
|
260
317
|
proxyModelValue.value = [];
|
|
261
|
-
draftModelValue.value =
|
|
318
|
+
draftModelValue.value = '';
|
|
319
|
+
context.emit('reset');
|
|
262
320
|
}
|
|
263
321
|
|
|
322
|
+
// Effects
|
|
323
|
+
onClickOutside((inputBox as MaybeElementRef), () => {
|
|
324
|
+
if (activated.value === false || (tags.value?.overflowPopover as any)?.state === 'open') return;
|
|
325
|
+
deactivate();
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
watch(proxyModelValue, (items, prevItems) => {
|
|
329
|
+
if (items.length != prevItems.length && overflow.value === TagsOverflow.Scroll) {
|
|
330
|
+
(tags.value?.scrollToEnd as any)();
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
|
|
264
334
|
return {
|
|
265
335
|
root,
|
|
266
336
|
control,
|
|
337
|
+
inputBox,
|
|
338
|
+
tags,
|
|
267
339
|
rootStyles,
|
|
268
340
|
controlStyles,
|
|
269
341
|
itemStyles,
|
|
342
|
+
controlInlineStyles,
|
|
270
343
|
controlAttributes,
|
|
271
344
|
proxyModelValue,
|
|
272
345
|
draftModelValue,
|
|
273
346
|
currentLength,
|
|
274
347
|
maxLength,
|
|
348
|
+
activated,
|
|
349
|
+
showControl,
|
|
275
350
|
focus,
|
|
276
351
|
blur,
|
|
277
352
|
add,
|
|
353
|
+
activate,
|
|
354
|
+
deactivate,
|
|
278
355
|
remove,
|
|
279
356
|
reset,
|
|
280
357
|
};
|
|
@@ -4,27 +4,34 @@
|
|
|
4
4
|
:class="rootStyles"
|
|
5
5
|
>
|
|
6
6
|
<div
|
|
7
|
+
v-if="localItems.length > 0"
|
|
7
8
|
ref="container"
|
|
8
9
|
:class="containerStyles"
|
|
9
10
|
>
|
|
10
11
|
<OrTag
|
|
11
|
-
v-for="item in
|
|
12
|
+
v-for="item in localItems"
|
|
12
13
|
v-bind="tagProps"
|
|
13
|
-
:key="item"
|
|
14
|
-
|
|
14
|
+
:key="item.value"
|
|
15
|
+
class="max-w-full"
|
|
16
|
+
@reset="$emit('reset', item.value)"
|
|
15
17
|
>
|
|
16
|
-
{{ item }}
|
|
18
|
+
{{ item.label }}
|
|
17
19
|
</OrTag>
|
|
20
|
+
<slot
|
|
21
|
+
v-if="localOverflow === 'wrap'"
|
|
22
|
+
name="tail"
|
|
23
|
+
/>
|
|
18
24
|
</div>
|
|
19
25
|
|
|
20
|
-
<template v-if="overflowItems.length > 0">
|
|
26
|
+
<template v-if="localOverflow === 'hidden' && overflowItems.length > 0">
|
|
21
27
|
<OrButton
|
|
22
28
|
ref="overflowButton"
|
|
23
29
|
:class="overflowButtonStyles"
|
|
24
30
|
:type="'button'"
|
|
25
31
|
:variant="'link'"
|
|
26
32
|
:color="'inherit'"
|
|
27
|
-
|
|
33
|
+
:disabled="disabled"
|
|
34
|
+
@click.stop="togglePopover"
|
|
28
35
|
>
|
|
29
36
|
+{{ overflowItems.length }}
|
|
30
37
|
</OrButton>
|
|
@@ -37,25 +44,31 @@
|
|
|
37
44
|
<OrTag
|
|
38
45
|
v-for="item in overflowItems"
|
|
39
46
|
v-bind="tagProps"
|
|
40
|
-
:key="item"
|
|
41
|
-
@reset="$emit('reset', item)"
|
|
47
|
+
:key="item.value"
|
|
48
|
+
@reset="$emit('reset', item.value)"
|
|
42
49
|
>
|
|
43
|
-
{{ item }}
|
|
50
|
+
{{ item.label }}
|
|
44
51
|
</OrTag>
|
|
45
52
|
</div>
|
|
46
53
|
</OrPopover>
|
|
47
54
|
</template>
|
|
55
|
+
<slot
|
|
56
|
+
v-if="localOverflow != 'wrap' || items.length === 0"
|
|
57
|
+
name="tail"
|
|
58
|
+
/>
|
|
48
59
|
</div>
|
|
49
60
|
</template>
|
|
50
61
|
|
|
51
62
|
<script lang="ts">
|
|
52
|
-
import { PropType, computed, defineComponent, ref } from 'vue-demi';
|
|
63
|
+
import { PropType, computed, defineComponent, ref, toRefs, nextTick } from 'vue-demi';
|
|
53
64
|
import { useOverflow } from '../../hooks';
|
|
54
65
|
import { OrButtonV3 as OrButton } from '../or-button-v3';
|
|
55
66
|
import { OrPopoverV3 as OrPopover } from '../or-popover-v3';
|
|
56
67
|
import { OrTagV3 as OrTag } from '../or-tag-v3';
|
|
57
68
|
import { TagsOverflow } from './props';
|
|
58
69
|
import { Tags, TagsContainer, TagsContainerOverflows, TagsOverflowButton, TagsOverflowPopover } from './styles';
|
|
70
|
+
import { Tag } from './types';
|
|
71
|
+
import { castToTagObject } from './utils/castToTag';
|
|
59
72
|
|
|
60
73
|
export default defineComponent({
|
|
61
74
|
name: 'OrTags',
|
|
@@ -68,19 +81,24 @@ export default defineComponent({
|
|
|
68
81
|
|
|
69
82
|
props: {
|
|
70
83
|
items: {
|
|
71
|
-
type: Array as PropType<
|
|
84
|
+
type: Array as PropType<Tag[]>,
|
|
72
85
|
default: () => [],
|
|
73
86
|
},
|
|
74
87
|
|
|
75
88
|
overflow: {
|
|
76
89
|
type: String as PropType<`${TagsOverflow}`>,
|
|
77
|
-
default: TagsOverflow.
|
|
90
|
+
default: TagsOverflow.Hidden,
|
|
78
91
|
},
|
|
79
92
|
|
|
80
93
|
tagProps: {
|
|
81
94
|
type: Object as PropType<InstanceType<typeof OrTag>['$props']>,
|
|
82
95
|
default: undefined,
|
|
83
96
|
},
|
|
97
|
+
|
|
98
|
+
disabled: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: false,
|
|
101
|
+
},
|
|
84
102
|
},
|
|
85
103
|
|
|
86
104
|
emits: [
|
|
@@ -93,6 +111,9 @@ export default defineComponent({
|
|
|
93
111
|
|
|
94
112
|
expose: [
|
|
95
113
|
'root',
|
|
114
|
+
'container',
|
|
115
|
+
'overflowPopover',
|
|
116
|
+
'scrollToEnd',
|
|
96
117
|
],
|
|
97
118
|
|
|
98
119
|
setup(props) {
|
|
@@ -100,6 +121,15 @@ export default defineComponent({
|
|
|
100
121
|
const root = ref<HTMLElement>();
|
|
101
122
|
const container = ref<HTMLElement>();
|
|
102
123
|
|
|
124
|
+
// Props
|
|
125
|
+
const { items, overflow } = toRefs(props);
|
|
126
|
+
|
|
127
|
+
const localOverflow = computed(() => {
|
|
128
|
+
return overflow.value === TagsOverflow.Default
|
|
129
|
+
? TagsOverflow.Hidden
|
|
130
|
+
: overflow.value;
|
|
131
|
+
});
|
|
132
|
+
|
|
103
133
|
const overflowButton = ref<InstanceType<typeof OrButton>>();
|
|
104
134
|
const overflowButtonRoot = computed(() => overflowButton.value?.root);
|
|
105
135
|
|
|
@@ -114,7 +144,7 @@ export default defineComponent({
|
|
|
114
144
|
|
|
115
145
|
const containerStyles = computed(() => [
|
|
116
146
|
...TagsContainer,
|
|
117
|
-
...TagsContainerOverflows[
|
|
147
|
+
...TagsContainerOverflows[localOverflow.value],
|
|
118
148
|
]);
|
|
119
149
|
|
|
120
150
|
const overflowButtonStyles = computed(() => [
|
|
@@ -126,15 +156,35 @@ export default defineComponent({
|
|
|
126
156
|
]);
|
|
127
157
|
|
|
128
158
|
// State
|
|
129
|
-
const { innerItems } = useOverflow(container);
|
|
159
|
+
const { innerItems } = useOverflow(container, { hide: false });
|
|
160
|
+
|
|
161
|
+
const localItems = computed(() => {
|
|
162
|
+
return items.value.map(castToTagObject);
|
|
163
|
+
});
|
|
130
164
|
|
|
131
165
|
const overflowItems = computed(() => {
|
|
132
|
-
return
|
|
166
|
+
return localItems.value.slice(innerItems.value.length);
|
|
133
167
|
});
|
|
134
168
|
|
|
169
|
+
// Methods
|
|
170
|
+
function togglePopover() {
|
|
171
|
+
(overflowPopover.value!.toggle as () => void)();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function scrollToEnd() {
|
|
175
|
+
nextTick(() => {
|
|
176
|
+
container.value?.scrollTo({
|
|
177
|
+
left: container.value?.scrollWidth,
|
|
178
|
+
behavior: 'smooth',
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
135
183
|
return {
|
|
136
184
|
root,
|
|
137
185
|
container,
|
|
186
|
+
localOverflow,
|
|
187
|
+
localItems,
|
|
138
188
|
overflowButton,
|
|
139
189
|
overflowButtonRoot,
|
|
140
190
|
overflowPopover,
|
|
@@ -144,6 +194,8 @@ export default defineComponent({
|
|
|
144
194
|
overflowButtonStyles,
|
|
145
195
|
overflowPopoverStyles,
|
|
146
196
|
overflowItems,
|
|
197
|
+
togglePopover,
|
|
198
|
+
scrollToEnd,
|
|
147
199
|
};
|
|
148
200
|
},
|
|
149
201
|
});
|