@volverjs/ui-vue 0.0.13 → 0.0.15
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/Volver.d.ts +121 -0
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +68 -0
- package/dist/components/VvAccordion/index.d.ts +47 -0
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +98 -0
- package/dist/components/VvAccordionGroup/index.d.ts +54 -0
- package/dist/components/VvAction/VvAction.es.js +26 -26
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +110 -0
- package/dist/components/VvAction/index.d.ts +2 -0
- package/dist/components/VvAlert/VvAlert.es.js +43 -44
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +124 -0
- package/dist/components/VvAlert/index.d.ts +104 -0
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +54 -55
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +97 -0
- package/dist/components/VvAlertGroup/index.d.ts +47 -0
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +24 -0
- package/dist/components/VvAvatar/index.d.ts +10 -0
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +50 -0
- package/dist/components/VvAvatarGroup/index.d.ts +28 -0
- package/dist/components/VvBadge/VvBadge.vue.d.ts +24 -0
- package/dist/components/VvBadge/index.d.ts +7 -0
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +34 -34
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +39 -0
- package/dist/components/VvBreadcrumb/index.d.ts +8 -0
- package/dist/components/VvButton/VvButton.es.js +186 -187
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +221 -0
- package/dist/components/VvButton/index.d.ts +131 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +84 -0
- package/dist/components/VvButtonGroup/index.d.ts +37 -0
- package/dist/components/VvCard/VvCard.vue.d.ts +30 -0
- package/dist/components/VvCard/index.d.ts +7 -0
- package/dist/components/VvCheckbox/VvCheckbox.es.js +215 -217
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +187 -0
- package/dist/components/VvCheckbox/index.d.ts +94 -0
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +235 -237
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +212 -0
- package/dist/components/VvCheckboxGroup/index.d.ts +2 -0
- package/dist/components/VvCombobox/VvCombobox.es.js +810 -813
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +346 -0
- package/dist/components/VvCombobox/index.d.ts +694 -0
- package/dist/components/VvDialog/VvDialog.vue.d.ts +73 -0
- package/dist/components/VvDialog/index.d.ts +45 -0
- package/dist/components/VvDropdown/VvDropdown.es.js +4 -4
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +258 -0
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +118 -0
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +22 -0
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +22 -0
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +82 -0
- package/dist/components/VvDropdown/index.d.ts +120 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +50 -50
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +30 -31
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +6 -0
- package/dist/components/VvIcon/index.d.ts +86 -0
- package/dist/components/VvInputFile/VvInputFile.es.js +415 -418
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +361 -0
- package/dist/components/VvInputFile/index.d.ts +204 -0
- package/dist/components/VvInputText/VvInputText.es.js +595 -588
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +524 -0
- package/dist/components/VvInputText/VvInputTextActions.d.ts +4 -0
- package/dist/components/VvInputText/index.d.ts +313 -0
- package/dist/components/VvNav/VvNav.es.js +63 -63
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +48 -0
- package/dist/components/VvNav/VvNavItem.vue.d.ts +14 -0
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +3 -0
- package/dist/components/VvNav/index.d.ts +11 -0
- package/dist/components/VvNavItem/VvNavItem.es.js +41 -41
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +38 -0
- package/dist/components/VvProgress/index.d.ts +33 -0
- package/dist/components/VvRadio/VvRadio.es.js +222 -224
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +179 -0
- package/dist/components/VvRadio/index.d.ts +80 -0
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +234 -236
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +212 -0
- package/dist/components/VvRadioGroup/index.d.ts +2 -0
- package/dist/components/VvSelect/VvSelect.es.js +200 -203
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +183 -0
- package/dist/components/VvSelect/index.d.ts +298 -0
- package/dist/components/VvTab/VvTab.es.js +35 -35
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +64 -0
- package/dist/components/VvTab/index.d.ts +19 -0
- package/dist/components/VvTextarea/VvTextarea.es.js +341 -344
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +384 -0
- package/dist/components/VvTextarea/index.d.ts +190 -0
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +37 -0
- package/dist/components/VvTooltip/index.d.ts +19 -0
- package/dist/components/VvVirtualScroll/VvVirtualScroll.vue.d.ts +51 -0
- package/dist/components/common/HintSlot.d.ts +57 -0
- package/dist/components/common/VvInputClearAction.d.ts +52 -0
- package/dist/components/common/VvInputPasswordAction.d.ts +71 -0
- package/dist/components/common/VvInputStepAction.d.ts +50 -0
- package/dist/components/index.d.ts +34 -0
- package/dist/components/index.es.js +1965 -1958
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlerInject.d.ts +4 -0
- package/dist/composables/alert/useAlert.d.ts +92 -0
- package/dist/composables/alert/useAlertProvide.d.ts +10 -0
- package/dist/composables/dropdown/useDropdownContextmenu.d.ts +18 -0
- package/dist/composables/dropdown/useDropdownInject.d.ts +12 -0
- package/dist/composables/dropdown/useDropdownProvide.d.ts +40 -0
- package/dist/composables/dropdown/useDropdownVirtualElement.d.ts +17 -0
- package/dist/composables/group/useGroupStateInject.d.ts +9 -0
- package/dist/composables/group/useGroupStateProvide.d.ts +6 -0
- package/dist/composables/index.d.ts +5 -0
- package/dist/composables/index.es.js +34 -34
- package/dist/composables/index.umd.js +2 -2
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentFocus.d.ts +4 -0
- package/dist/composables/useComponentIcon.d.ts +11 -0
- package/dist/composables/useDebouncedInput.d.ts +5 -0
- package/dist/composables/useDefaults.d.ts +2 -0
- package/dist/composables/useModifiers.d.ts +2 -0
- package/dist/composables/useOptions.d.ts +8 -0
- package/dist/composables/usePersistence.d.ts +3 -0
- package/dist/composables/useTextCount.d.ts +10 -0
- package/dist/composables/useUniqueId.d.ts +2 -0
- package/dist/composables/useVirtualScroll.d.ts +35 -0
- package/dist/composables/useVolver.d.ts +4 -0
- package/dist/constants.d.ts +104 -0
- package/dist/directives/index.d.ts +3 -0
- package/dist/directives/index.es.js +22 -22
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.d.ts +3 -0
- package/dist/directives/v-contextmenu.es.js +13 -13
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/directives/v-tooltip.d.ts +3 -0
- package/dist/icons.d.ts +1889 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.es.js +19 -19
- package/dist/index.umd.js +1 -1
- package/dist/json-render/catalog.d.ts +395 -0
- package/dist/json-render/components.d.ts +111 -0
- package/dist/json-render/definitions.d.ts +697 -0
- package/dist/json-render/index.d.ts +55 -0
- package/dist/json-render/index.es.js +1877 -1870
- package/dist/json-render/index.umd.js +1 -1
- package/dist/json-render/registry.d.ts +34 -0
- package/dist/props/index.d.ts +959 -0
- package/dist/resolvers/unplugin.d.ts +38 -0
- package/dist/resolvers/unplugin.es.js +28 -28
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Accordion/Accordion.settings.d.ts +9 -0
- package/dist/stories/Accordion/Accordion.stories.d.ts +7 -0
- package/dist/stories/Accordion/Accordion.test.d.ts +2 -0
- package/dist/stories/Accordion/AccordionSlots.stories.d.ts +7 -0
- package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +13 -0
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +9 -0
- package/dist/stories/AccordionGroup/AccordionGroup.test.d.ts +2 -0
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1788 -0
- package/dist/stories/Alert/Alert.settings.d.ts +4 -0
- package/dist/stories/Alert/Alert.stories.d.ts +9 -0
- package/dist/stories/Alert/Alert.test.d.ts +2 -0
- package/dist/stories/Alert/AlertModifiers.stories.d.ts +13 -0
- package/dist/stories/Alert/AlertSlots.stories.d.ts +10 -0
- package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +14 -0
- package/dist/stories/AlertGroup/AlertGroup.stories.d.ts +8 -0
- package/dist/stories/AlertGroup/AlertGroup.test.d.ts +2 -0
- package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +14 -0
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +8 -0
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +4 -0
- package/dist/stories/Avatar/Avatar.settings.d.ts +5 -0
- package/dist/stories/Avatar/Avatar.stories.d.ts +7 -0
- package/dist/stories/Avatar/Avatar.test.d.ts +2 -0
- package/dist/stories/Avatar/AvatarBadge.stories.d.ts +6 -0
- package/dist/stories/Avatar/AvatarModifiers.stories.d.ts +13 -0
- package/dist/stories/Avatar/AvatarSlots.stories.d.ts +6 -0
- package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +14 -0
- package/dist/stories/AvatarGroup/AvatarGroup.stories.d.ts +6 -0
- package/dist/stories/AvatarGroup/AvatarGroup.test.d.ts +2 -0
- package/dist/stories/AvatarGroup/AvatarGroupModifiers.stories.d.ts +7 -0
- package/dist/stories/AvatarGroup/AvatarGroupSlotDefault.stories.d.ts +6 -0
- package/dist/stories/Badge/Badge.settings.d.ts +5 -0
- package/dist/stories/Badge/Badge.stories.d.ts +7 -0
- package/dist/stories/Badge/Badge.test.d.ts +2 -0
- package/dist/stories/Badge/BadgeSlots.stories.d.ts +6 -0
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Breadcrumb/Breadcrumb.settings.d.ts +13 -0
- package/dist/stories/Breadcrumb/Breadcrumb.stories.d.ts +7 -0
- package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +2 -0
- package/dist/stories/Breadcrumb/BreadcrumbSlots.stories.d.ts +6 -0
- package/dist/stories/Button/Button.settings.d.ts +4 -0
- package/dist/stories/Button/Button.stories.d.ts +6 -0
- package/dist/stories/Button/Button.test.d.ts +2 -0
- package/dist/stories/Button/ButtonIcon.stories.d.ts +10 -0
- package/dist/stories/Button/ButtonLink.stories.d.ts +7 -0
- package/dist/stories/Button/ButtonLoading.stories.d.ts +8 -0
- package/dist/stories/Button/ButtonModifiers.stories.d.ts +17 -0
- package/dist/stories/Button/ButtonSlots.stories.d.ts +9 -0
- package/dist/stories/Button/ButtonState.stories.d.ts +8 -0
- package/dist/stories/Button/ButtonToggle.stories.d.ts +9 -0
- package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +5 -0
- package/dist/stories/ButtonGroup/ButtonGroup.stories.d.ts +6 -0
- package/dist/stories/ButtonGroup/ButtonGroup.test.d.ts +2 -0
- package/dist/stories/ButtonGroup/ButtonGroupModifiers.stories.d.ts +8 -0
- package/dist/stories/ButtonGroup/ButtonGroupSlots.stories.d.ts +6 -0
- package/dist/stories/ButtonGroup/ButtonGroupToggle.stories.d.ts +8 -0
- package/dist/stories/Card/Card.settings.d.ts +6 -0
- package/dist/stories/Card/Card.stories.d.ts +6 -0
- package/dist/stories/Card/Card.test.d.ts +2 -0
- package/dist/stories/Card/CardSlots.stories.d.ts +9 -0
- package/dist/stories/Checkbox/Checkbox.settings.d.ts +15 -0
- package/dist/stories/Checkbox/Checkbox.stories.d.ts +13 -0
- package/dist/stories/Checkbox/Checkbox.test.d.ts +2 -0
- package/dist/stories/Checkbox/CheckboxBinary.stories.d.ts +7 -0
- package/dist/stories/Checkbox/CheckboxSlots.stories.d.ts +7 -0
- package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +12 -0
- package/dist/stories/CheckboxGroup/CheckboxGroup.stories.d.ts +12 -0
- package/dist/stories/CheckboxGroup/CheckboxGroup.test.d.ts +2 -0
- package/dist/stories/CheckboxGroup/CheckboxGroupOptions.stories.d.ts +8 -0
- package/dist/stories/CheckboxGroup/CheckboxGroupSlots.stories.d.ts +7 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +4 -0
- package/dist/stories/Combobox/Combobox.stories.d.ts +24 -0
- package/dist/stories/Combobox/Combobox.test.d.ts +2 -0
- package/dist/stories/Combobox/ComboboxIconPosition.stories.d.ts +8 -0
- package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +9 -0
- package/dist/stories/Combobox/ComboboxOptions.stories.d.ts +11 -0
- package/dist/stories/Combobox/ComboboxSlots.stories.d.ts +10 -0
- package/dist/stories/Dialog/Dialog.settings.d.ts +10 -0
- package/dist/stories/Dialog/Dialog.stories.d.ts +7 -0
- package/dist/stories/Dialog/Dialog.test.d.ts +2 -0
- package/dist/stories/Dialog/DialogModifiers.stories.d.ts +8 -0
- package/dist/stories/Dialog/DialogSlots.stories.d.ts +8 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +5 -0
- package/dist/stories/Dropdown/Dropdown.stories.d.ts +9 -0
- package/dist/stories/Dropdown/Dropdown.test.d.ts +2 -0
- package/dist/stories/Dropdown/DropdownContextmenuDirective.stories.d.ts +6 -0
- package/dist/stories/Dropdown/DropdownMultilevel.stories.d.ts +6 -0
- package/dist/stories/Dropdown/DropdownSlots.stories.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +7 -0
- package/dist/stories/Icon/Icon.stories.d.ts +8 -0
- package/dist/stories/Icon/IconsCollection.stories.d.ts +6 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +6 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +13 -0
- package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
- package/dist/stories/InputText/InputText.settings.d.ts +11 -0
- package/dist/stories/InputText/InputText.stories.d.ts +16 -0
- package/dist/stories/InputText/InputText.test.d.ts +5 -0
- package/dist/stories/InputText/InputTextIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputText/InputTextIso.stories.d.ts +10 -0
- package/dist/stories/InputText/InputTextLength.stories.d.ts +10 -0
- package/dist/stories/InputText/InputTextMask.stories.d.ts +12 -0
- package/dist/stories/InputText/InputTextMinMax.stories.d.ts +9 -0
- package/dist/stories/InputText/InputTextSlots.stories.d.ts +8 -0
- package/dist/stories/InputText/InputTextSuggestions.stories.d.ts +8 -0
- package/dist/stories/InputText/InputTextType.stories.d.ts +18 -0
- package/dist/stories/Nav/Nav.settings.d.ts +4 -0
- package/dist/stories/Nav/Nav.stories.d.ts +6 -0
- package/dist/stories/Nav/Nav.test.d.ts +2 -0
- package/dist/stories/Nav/NavModifiers.stories.d.ts +9 -0
- package/dist/stories/Progress/Progress.settings.d.ts +7 -0
- package/dist/stories/Progress/Progress.stories.d.ts +7 -0
- package/dist/stories/Progress/Progress.test.d.ts +2 -0
- package/dist/stories/Radio/Radio.settings.d.ts +12 -0
- package/dist/stories/Radio/Radio.stories.d.ts +11 -0
- package/dist/stories/Radio/Radio.test.d.ts +2 -0
- package/dist/stories/Radio/RadioSlots.stories.d.ts +7 -0
- package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +12 -0
- package/dist/stories/RadioGroup/RadioGroup.stories.d.ts +12 -0
- package/dist/stories/RadioGroup/RadioGroup.test.d.ts +2 -0
- package/dist/stories/RadioGroup/RadioGroupOptions.stories.d.ts +8 -0
- package/dist/stories/RadioGroup/RadioGroupSlots.stories.d.ts +7 -0
- package/dist/stories/Select/Select.settings.d.ts +8 -0
- package/dist/stories/Select/Select.stories.d.ts +16 -0
- package/dist/stories/Select/Select.test.d.ts +2 -0
- package/dist/stories/Select/SelectIconPosition.stories.d.ts +8 -0
- package/dist/stories/Select/SelectOptions.stories.d.ts +9 -0
- package/dist/stories/Select/SelectSlots.stories.d.ts +8 -0
- package/dist/stories/Tab/Tab.settings.d.ts +4 -0
- package/dist/stories/Tab/Tab.stories.d.ts +6 -0
- package/dist/stories/Tab/Tab.test.d.ts +2 -0
- package/dist/stories/Textarea/Textarea.settings.d.ts +9 -0
- package/dist/stories/Textarea/Textarea.stories.d.ts +14 -0
- package/dist/stories/Textarea/Textarea.test.d.ts +2 -0
- package/dist/stories/Textarea/TextareaLength.stories.d.ts +10 -0
- package/dist/stories/Textarea/TextareaSlots.stories.d.ts +8 -0
- package/dist/stories/Textarea/TextareatIconPosition.stories.d.ts +8 -0
- package/dist/stories/Tooltip/Tooltip.settings.d.ts +5 -0
- package/dist/stories/Tooltip/Tooltip.stories.d.ts +6 -0
- package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
- package/dist/stories/Tooltip/TooltipDirective.stories.d.ts +10 -0
- package/dist/stories/VirtualScroll/VirtualScroll.settings.d.ts +5 -0
- package/dist/stories/VirtualScroll/VirtualScroll.stories.d.ts +7 -0
- package/dist/stories/VirtualScroll/VirtualScroll.test.d.ts +2 -0
- package/dist/stories/VirtualScroll/VirtualScrollWithComposable.stories.d.ts +4 -0
- package/dist/stories/argTypes.d.ts +56 -0
- package/dist/test/expect.d.ts +18 -0
- package/dist/test/options.d.ts +1 -0
- package/dist/test/sleep.d.ts +1 -0
- package/dist/types/alert.d.ts +15 -0
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/floating-ui.d.ts +15 -0
- package/dist/types/generic.d.ts +4 -0
- package/dist/types/group.d.ts +59 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +9 -0
- package/dist/types/nav.d.ts +17 -0
- package/dist/utils/DateUtilities.d.ts +14 -0
- package/dist/utils/DomUtilities.d.ts +1 -0
- package/dist/utils/FileUtilities.d.ts +14 -0
- package/dist/utils/ObjectUtilities.d.ts +76 -0
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +3 -2
- package/src/Volver.ts +8 -6
- package/src/components/VvAction/index.ts +1 -3
- package/src/components/VvButton/VvButton.vue +1 -1
- package/src/components/VvCheckboxGroup/index.ts +1 -3
- package/src/components/VvCombobox/VvCombobox.vue +3 -3
- package/src/components/VvDropdown/VvDropdown.vue +8 -8
- package/src/components/VvIcon/VvIcon.vue +3 -6
- package/src/components/VvInputFile/VvInputFile.vue +6 -6
- package/src/components/VvInputText/VvInputText.vue +95 -78
- package/src/components/VvRadioGroup/index.ts +1 -3
- package/src/composables/useBlurhash.ts +1 -1
- package/src/composables/useDebouncedInput.ts +1 -1
- package/src/composables/useDefaults.ts +55 -44
- package/src/composables/useModifiers.ts +1 -1
- package/src/index.ts +2 -2
- package/src/resolvers/unplugin.ts +6 -6
- package/src/types/alert.ts +1 -1
- package/src/types/nav.ts +1 -1
- package/src/utils/DateUtilities.ts +3 -3
- package/src/utils/DomUtilities.ts +7 -1
- package/src/utils/ObjectUtilities.ts +60 -59
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
} from '../VvInputText'
|
|
21
21
|
import VvInputTextActionsFactory from '../VvInputText/VvInputTextActions'
|
|
22
22
|
|
|
23
|
+
type SuggestionValue = string | number | Date
|
|
24
|
+
|
|
23
25
|
// props, emit, slots and attrs
|
|
24
26
|
const props = defineProps(VvInputTextProps)
|
|
25
27
|
|
|
@@ -117,80 +119,14 @@ const { el, mask, typed, masked, unmasked } = useIMask(
|
|
|
117
119
|
}
|
|
118
120
|
emit('update:masked', masked.value)
|
|
119
121
|
if (type.value === INPUT_TYPES.NUMBER) {
|
|
120
|
-
|
|
121
|
-
if (
|
|
122
|
-
localModelValue.value === null
|
|
123
|
-
|| localModelValue.value === undefined
|
|
124
|
-
) {
|
|
125
|
-
return
|
|
126
|
-
}
|
|
127
|
-
localModelValue.value = undefined
|
|
128
|
-
return
|
|
129
|
-
}
|
|
130
|
-
if (NEGATIVE_ZERO_REGEX.test(unmasked.value)) {
|
|
131
|
-
localModelValue.value = 0
|
|
132
|
-
return
|
|
133
|
-
}
|
|
134
|
-
if (typeof typed.value !== 'number') {
|
|
135
|
-
localModelValue.value = Number(typed.value)
|
|
136
|
-
return
|
|
137
|
-
}
|
|
138
|
-
localModelValue.value = typed.value
|
|
122
|
+
handleNumberAccept()
|
|
139
123
|
return
|
|
140
124
|
}
|
|
141
125
|
if (type.value === INPUT_TYPES.DATETIME_LOCAL
|
|
142
126
|
|| type.value === INPUT_TYPES.DATE
|
|
143
127
|
|| type.value === INPUT_TYPES.TIME
|
|
144
128
|
|| type.value === INPUT_TYPES.MONTH) {
|
|
145
|
-
|
|
146
|
-
if (!localModelValue.value) {
|
|
147
|
-
return
|
|
148
|
-
}
|
|
149
|
-
if (modelValueDate.value) {
|
|
150
|
-
localModelValue.value = undefined
|
|
151
|
-
return
|
|
152
|
-
}
|
|
153
|
-
localModelValue.value = ''
|
|
154
|
-
return
|
|
155
|
-
}
|
|
156
|
-
if (!(typed.value instanceof Date) && !modelValueDate.value && !modelValueDateIsoString.value) {
|
|
157
|
-
localModelValue.value = typed.value
|
|
158
|
-
return
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
let date = typed.value
|
|
162
|
-
if (!(date instanceof Date)) {
|
|
163
|
-
date = getDateFromInputValue(typed.value, type.value)
|
|
164
|
-
}
|
|
165
|
-
if (modelValueDate.value || modelValueDateIsoString.value) {
|
|
166
|
-
const toReturn = new Date(modelValueDate.value || modelValueDateIsoString.value as string)
|
|
167
|
-
if (type.value === INPUT_TYPES.DATETIME_LOCAL
|
|
168
|
-
|| type.value === INPUT_TYPES.DATE
|
|
169
|
-
|| type.value === INPUT_TYPES.MONTH) {
|
|
170
|
-
toReturn.setFullYear(date.getFullYear())
|
|
171
|
-
toReturn.setMonth(date.getMonth())
|
|
172
|
-
}
|
|
173
|
-
if (type.value === INPUT_TYPES.DATETIME_LOCAL
|
|
174
|
-
|| type.value === INPUT_TYPES.DATE) {
|
|
175
|
-
toReturn.setDate(date.getDate())
|
|
176
|
-
}
|
|
177
|
-
if (type.value === INPUT_TYPES.DATETIME_LOCAL
|
|
178
|
-
|| type.value === INPUT_TYPES.TIME) {
|
|
179
|
-
toReturn.setHours(date.getHours())
|
|
180
|
-
toReturn.setMinutes(date.getMinutes())
|
|
181
|
-
toReturn.setSeconds(date.getSeconds())
|
|
182
|
-
}
|
|
183
|
-
if (modelValueDate.value instanceof Date) {
|
|
184
|
-
if (localModelValue.value?.getTime() === toReturn.getTime()) {
|
|
185
|
-
return
|
|
186
|
-
}
|
|
187
|
-
localModelValue.value = toReturn
|
|
188
|
-
return
|
|
189
|
-
}
|
|
190
|
-
localModelValue.value = toReturn.toISOString()
|
|
191
|
-
return
|
|
192
|
-
}
|
|
193
|
-
localModelValue.value = getInputValueFromDate(date, type.value, hasSeconds.value)
|
|
129
|
+
handleDateAccept()
|
|
194
130
|
return
|
|
195
131
|
}
|
|
196
132
|
if (!localModelValue.value && !unmasked.value) {
|
|
@@ -200,7 +136,88 @@ const { el, mask, typed, masked, unmasked } = useIMask(
|
|
|
200
136
|
},
|
|
201
137
|
},
|
|
202
138
|
)
|
|
203
|
-
|
|
139
|
+
|
|
140
|
+
function handleNumberAccept() {
|
|
141
|
+
if (MASK_NUMBER_REGEX.test(unmasked.value)) {
|
|
142
|
+
if (
|
|
143
|
+
localModelValue.value === null
|
|
144
|
+
|| localModelValue.value === undefined
|
|
145
|
+
) {
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
|
+
localModelValue.value = undefined
|
|
149
|
+
return
|
|
150
|
+
}
|
|
151
|
+
if (NEGATIVE_ZERO_REGEX.test(unmasked.value)) {
|
|
152
|
+
localModelValue.value = 0
|
|
153
|
+
return
|
|
154
|
+
}
|
|
155
|
+
if (typeof typed.value !== 'number') {
|
|
156
|
+
localModelValue.value = Number(typed.value)
|
|
157
|
+
return
|
|
158
|
+
}
|
|
159
|
+
localModelValue.value = typed.value
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function mergeDateIntoModelValue(date: Date) {
|
|
163
|
+
const toReturn = new Date(modelValueDate.value || modelValueDateIsoString.value as string)
|
|
164
|
+
if (type.value === INPUT_TYPES.DATETIME_LOCAL
|
|
165
|
+
|| type.value === INPUT_TYPES.DATE
|
|
166
|
+
|| type.value === INPUT_TYPES.MONTH) {
|
|
167
|
+
toReturn.setFullYear(date.getFullYear())
|
|
168
|
+
toReturn.setMonth(date.getMonth())
|
|
169
|
+
}
|
|
170
|
+
if (type.value === INPUT_TYPES.DATETIME_LOCAL
|
|
171
|
+
|| type.value === INPUT_TYPES.DATE) {
|
|
172
|
+
toReturn.setDate(date.getDate())
|
|
173
|
+
}
|
|
174
|
+
if (type.value === INPUT_TYPES.DATETIME_LOCAL
|
|
175
|
+
|| type.value === INPUT_TYPES.TIME) {
|
|
176
|
+
toReturn.setHours(date.getHours())
|
|
177
|
+
toReturn.setMinutes(date.getMinutes())
|
|
178
|
+
toReturn.setSeconds(date.getSeconds())
|
|
179
|
+
}
|
|
180
|
+
if (modelValueDate.value instanceof Date) {
|
|
181
|
+
if (localModelValue.value?.getTime() === toReturn.getTime()) {
|
|
182
|
+
return
|
|
183
|
+
}
|
|
184
|
+
localModelValue.value = toReturn
|
|
185
|
+
return
|
|
186
|
+
}
|
|
187
|
+
localModelValue.value = toReturn.toISOString()
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function handleDateAccept() {
|
|
191
|
+
// onAccept only calls this for date-like input types
|
|
192
|
+
const dateType = type.value as 'date' | 'time' | 'month' | 'datetime-local'
|
|
193
|
+
if (!typed.value) {
|
|
194
|
+
if (!localModelValue.value) {
|
|
195
|
+
return
|
|
196
|
+
}
|
|
197
|
+
if (modelValueDate.value) {
|
|
198
|
+
localModelValue.value = undefined
|
|
199
|
+
return
|
|
200
|
+
}
|
|
201
|
+
localModelValue.value = ''
|
|
202
|
+
return
|
|
203
|
+
}
|
|
204
|
+
if (!(typed.value instanceof Date) && !modelValueDate.value && !modelValueDateIsoString.value) {
|
|
205
|
+
localModelValue.value = typed.value
|
|
206
|
+
return
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let date = typed.value
|
|
210
|
+
if (!(date instanceof Date)) {
|
|
211
|
+
date = getDateFromInputValue(typed.value, dateType)
|
|
212
|
+
}
|
|
213
|
+
if (modelValueDate.value || modelValueDateIsoString.value) {
|
|
214
|
+
mergeDateIntoModelValue(date)
|
|
215
|
+
return
|
|
216
|
+
}
|
|
217
|
+
localModelValue.value = getInputValueFromDate(date, dateType, hasSeconds.value)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function updateMaskValue(newValue: SuggestionValue | undefined | null) {
|
|
204
221
|
// Handle empty values
|
|
205
222
|
if (newValue === undefined || newValue === null) {
|
|
206
223
|
typed.value = ''
|
|
@@ -439,13 +456,13 @@ const isInvalid = computed(() => {
|
|
|
439
456
|
|
|
440
457
|
// suggestions
|
|
441
458
|
const storageKey = computed(() => props.storageKey ?? (volver?.experimentalFeatures.forceInputSuggestions ? props.name : undefined))
|
|
442
|
-
const storageSuggestions = usePersistence<Set<
|
|
459
|
+
const storageSuggestions = usePersistence<Set<SuggestionValue>>(
|
|
443
460
|
storageKey,
|
|
444
461
|
storageType,
|
|
445
462
|
new Set(),
|
|
446
463
|
)
|
|
447
464
|
const allSuggestions = computed(() => {
|
|
448
|
-
const merged = new Map<
|
|
465
|
+
const merged = new Map<SuggestionValue, { isFromStorage: boolean }>()
|
|
449
466
|
|
|
450
467
|
// Add storage suggestions
|
|
451
468
|
if (storageSuggestions.value) {
|
|
@@ -483,12 +500,12 @@ const hasSuggestions = computed(
|
|
|
483
500
|
() =>
|
|
484
501
|
allSuggestions.value.size > 0,
|
|
485
502
|
)
|
|
486
|
-
function onSuggestionSelect(suggestion:
|
|
503
|
+
function onSuggestionSelect(suggestion: SuggestionValue) {
|
|
487
504
|
localModelValue.value = suggestion
|
|
488
505
|
suggestionsDropdownEl.value?.hide()
|
|
489
506
|
emit('suggestion:selected', suggestion)
|
|
490
507
|
}
|
|
491
|
-
function onSuggestionRemove(suggestion:
|
|
508
|
+
function onSuggestionRemove(suggestion: SuggestionValue) {
|
|
492
509
|
// Only remove from storage if it came from storage
|
|
493
510
|
if (allSuggestions.value.get(suggestion)?.isFromStorage) {
|
|
494
511
|
storageSuggestions.value?.delete(suggestion)
|
|
@@ -588,8 +605,8 @@ const hasAttrs = computed(() => {
|
|
|
588
605
|
max = '9999-12-31'
|
|
589
606
|
}
|
|
590
607
|
toReturn.step = props.step
|
|
591
|
-
toReturn.max = max
|
|
592
|
-
toReturn.min = props.min
|
|
608
|
+
toReturn.max = max === undefined ? undefined : String(max)
|
|
609
|
+
toReturn.min = props.min === undefined ? undefined : String(props.min)
|
|
593
610
|
}
|
|
594
611
|
|
|
595
612
|
// Text-like types with placeholder
|
|
@@ -657,9 +674,9 @@ const hasStyle = computed(() => {
|
|
|
657
674
|
return undefined
|
|
658
675
|
}
|
|
659
676
|
return {
|
|
660
|
-
width: localModelValue.value
|
|
661
|
-
?
|
|
662
|
-
:
|
|
677
|
+
width: localModelValue.value === undefined
|
|
678
|
+
? undefined
|
|
679
|
+
: `${String(localModelValue.value).length + 1}ch`,
|
|
663
680
|
}
|
|
664
681
|
})
|
|
665
682
|
|
|
@@ -16,7 +16,7 @@ function loadImage(src: string): Promise<CanvasImageSource> {
|
|
|
16
16
|
return new Promise((resolve, reject) => {
|
|
17
17
|
const img = new Image()
|
|
18
18
|
img.onload = () => resolve(img)
|
|
19
|
-
img.onerror = (
|
|
19
|
+
img.onerror = () => reject(new Error(`Failed to load image: ${src}`))
|
|
20
20
|
img.src = src
|
|
21
21
|
})
|
|
22
22
|
}
|
|
@@ -10,6 +10,53 @@ type VueProp
|
|
|
10
10
|
| BooleanConstructor
|
|
11
11
|
| PropType<unknown>
|
|
12
12
|
|
|
13
|
+
type PropDefinition
|
|
14
|
+
= | VueProp
|
|
15
|
+
| VueProp[]
|
|
16
|
+
| { type: VueProp | VueProp[], default?: unknown }
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Returns the value a prop should take: either the provided `propValue` or the
|
|
20
|
+
* `componentDefault` when `propValue` still matches the prop definition default.
|
|
21
|
+
* The three checks are intentionally independent (an array definition satisfies
|
|
22
|
+
* both `Array.isArray` and `typeof === 'object'`).
|
|
23
|
+
*/
|
|
24
|
+
function resolveDefaultedProp(
|
|
25
|
+
definition: PropDefinition,
|
|
26
|
+
propValue: unknown,
|
|
27
|
+
componentDefault: unknown,
|
|
28
|
+
): unknown {
|
|
29
|
+
let value = propValue
|
|
30
|
+
// array of types
|
|
31
|
+
if (Array.isArray(definition) && definition.length) {
|
|
32
|
+
const typeFunction = definition[0] as <T>() => T
|
|
33
|
+
if (typeFunction() === propValue) {
|
|
34
|
+
value = componentDefault
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// single type
|
|
38
|
+
if (typeof definition === 'function') {
|
|
39
|
+
const typeFunction = definition as <T>() => T
|
|
40
|
+
if (typeFunction() === propValue) {
|
|
41
|
+
value = componentDefault
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// object with type and default
|
|
45
|
+
if (typeof definition === 'object') {
|
|
46
|
+
let defaultValue = (definition as { default: unknown }).default
|
|
47
|
+
if (typeof defaultValue === 'function') {
|
|
48
|
+
defaultValue = defaultValue()
|
|
49
|
+
}
|
|
50
|
+
const matches = typeof defaultValue === 'object'
|
|
51
|
+
? JSON.stringify(defaultValue) === JSON.stringify(propValue)
|
|
52
|
+
: defaultValue === propValue
|
|
53
|
+
if (matches) {
|
|
54
|
+
value = componentDefault
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return value
|
|
58
|
+
}
|
|
59
|
+
|
|
13
60
|
export function useDefaults<Definition>(
|
|
14
61
|
componentName: string,
|
|
15
62
|
propsDefinition: Definition,
|
|
@@ -18,7 +65,7 @@ export function useDefaults<Definition>(
|
|
|
18
65
|
const volver = useVolver()
|
|
19
66
|
|
|
20
67
|
const volverComponentDefaults = computed(() => {
|
|
21
|
-
if (!volver
|
|
68
|
+
if (!volver?.defaults.value?.[componentName]) {
|
|
22
69
|
return undefined
|
|
23
70
|
}
|
|
24
71
|
return volver.defaults.value[componentName]
|
|
@@ -38,49 +85,13 @@ export function useDefaults<Definition>(
|
|
|
38
85
|
const simplifiedProps = props as Record<string, unknown>
|
|
39
86
|
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
40
87
|
const propValue = simplifiedProps[key]
|
|
41
|
-
acc[key] =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (typeArray.length) {
|
|
49
|
-
const typeFunction = typeArray[0] as <T>() => T
|
|
50
|
-
if (typeFunction === propValue) {
|
|
51
|
-
acc[key] = componentDefaults[key]
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// single type
|
|
56
|
-
if (typeof simplifiedPropsDefinition[key] === 'function') {
|
|
57
|
-
const typeFunction = simplifiedPropsDefinition[key] as <
|
|
58
|
-
T,
|
|
59
|
-
>() => T
|
|
60
|
-
if (typeFunction() === propValue) {
|
|
61
|
-
acc[key] = componentDefaults[key]
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
// object with type and default
|
|
65
|
-
if (typeof simplifiedPropsDefinition[key] === 'object') {
|
|
66
|
-
let defaultValue = (
|
|
67
|
-
simplifiedPropsDefinition[key] as { default: unknown }
|
|
68
|
-
).default
|
|
69
|
-
if (typeof defaultValue === 'function') {
|
|
70
|
-
defaultValue = defaultValue()
|
|
71
|
-
}
|
|
72
|
-
if (typeof defaultValue === 'object') {
|
|
73
|
-
if (
|
|
74
|
-
JSON.stringify(defaultValue)
|
|
75
|
-
=== JSON.stringify(propValue)
|
|
76
|
-
) {
|
|
77
|
-
acc[key] = componentDefaults[key]
|
|
78
|
-
}
|
|
79
|
-
} else if (defaultValue === propValue) {
|
|
80
|
-
acc[key] = componentDefaults[key]
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
88
|
+
acc[key] = key in componentDefaults
|
|
89
|
+
? resolveDefaultedProp(
|
|
90
|
+
simplifiedPropsDefinition[key],
|
|
91
|
+
propValue,
|
|
92
|
+
componentDefaults[key],
|
|
93
|
+
)
|
|
94
|
+
: propValue
|
|
84
95
|
return acc
|
|
85
96
|
}, {} as Record<string, unknown>) as Readonly<
|
|
86
97
|
ExtractPropTypes<Definition>
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Volver
|
|
1
|
+
import type { Volver } from './Volver'
|
|
2
2
|
import VolverPlugin from './Volver'
|
|
3
3
|
|
|
4
4
|
export { VolverPlugin }
|
|
5
5
|
export * from './types'
|
|
6
|
-
export type { Volver, VolverOptions }
|
|
6
|
+
export type { Volver, VolverOptions } from './Volver'
|
|
7
7
|
|
|
8
8
|
// https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties
|
|
9
9
|
// Add custom property and extend vue type definition
|
|
@@ -35,12 +35,12 @@ export interface VolverResolverOptions {
|
|
|
35
35
|
cherryPick?: boolean
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const STYLE_EXCLUDE = ['vv-icon', 'vv-action']
|
|
38
|
+
const STYLE_EXCLUDE = new Set(['vv-icon', 'vv-action'])
|
|
39
39
|
const VOLVER_PREFIX = 'vv'
|
|
40
|
-
const DIRECTIVES = ['v-tooltip', 'v-contextmenu']
|
|
40
|
+
const DIRECTIVES = new Set(['v-tooltip', 'v-contextmenu'])
|
|
41
41
|
|
|
42
42
|
export function getStyleNames(kebabName: string) {
|
|
43
|
-
if (STYLE_EXCLUDE.
|
|
43
|
+
if (STYLE_EXCLUDE.has(kebabName)) {
|
|
44
44
|
return undefined
|
|
45
45
|
}
|
|
46
46
|
if (kebabName === 'vv-dropdown') {
|
|
@@ -125,7 +125,7 @@ export function VolverResolver({
|
|
|
125
125
|
`${VOLVER_PREFIX}-`,
|
|
126
126
|
)
|
|
127
127
|
|
|
128
|
-
if (ignore
|
|
128
|
+
if (ignore?.includes(kebabName)) {
|
|
129
129
|
return
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -153,11 +153,11 @@ export function VolverResolver({
|
|
|
153
153
|
const kebabName = `v-${kebabCase(name)}`
|
|
154
154
|
|
|
155
155
|
// filter directive
|
|
156
|
-
if (!DIRECTIVES.
|
|
156
|
+
if (!DIRECTIVES.has(kebabName)) {
|
|
157
157
|
return
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
if (ignore
|
|
160
|
+
if (ignore?.includes(kebabName)) {
|
|
161
161
|
return
|
|
162
162
|
}
|
|
163
163
|
|
package/src/types/alert.ts
CHANGED
package/src/types/nav.ts
CHANGED
|
@@ -12,14 +12,14 @@ const padTwoDigits = (num: number) => num.toString().padStart(2, '0')
|
|
|
12
12
|
* @param dateString
|
|
13
13
|
* @returns True if valid ISO date string
|
|
14
14
|
* @example
|
|
15
|
-
* isDateIsoString('2021-12-31T23:59:59') // true
|
|
15
|
+
* isDateIsoString('2021-12-31T23:59:59.000Z') // true
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
// Canonical UTC form, matching what `Date.prototype.toISOString()` produces.
|
|
18
|
+
const ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/
|
|
18
19
|
export function isDateIsoString(dateString: unknown) {
|
|
19
20
|
if (typeof dateString !== 'string') {
|
|
20
21
|
return false
|
|
21
22
|
}
|
|
22
|
-
// Support both with/without milliseconds and timezone variations
|
|
23
23
|
if (!ISO_DATE_REGEX.test(dateString)) {
|
|
24
24
|
return false
|
|
25
25
|
}
|
|
@@ -2,9 +2,15 @@ export function findScrollContainer(element: HTMLElement | null) {
|
|
|
2
2
|
if (!element) {
|
|
3
3
|
return undefined
|
|
4
4
|
}
|
|
5
|
+
if (
|
|
6
|
+
typeof globalThis.getComputedStyle !== 'function'
|
|
7
|
+
|| typeof document === 'undefined'
|
|
8
|
+
) {
|
|
9
|
+
return undefined
|
|
10
|
+
}
|
|
5
11
|
let parent = element.parentElement
|
|
6
12
|
while (parent) {
|
|
7
|
-
const { overflow } =
|
|
13
|
+
const { overflow } = globalThis.getComputedStyle(parent)
|
|
8
14
|
if (overflow.split(' ').every(item => item === 'auto' || item === 'scroll')) {
|
|
9
15
|
return parent
|
|
10
16
|
}
|
|
@@ -22,67 +22,69 @@ export function equals(obj1: any, obj2: any, field?: string) {
|
|
|
22
22
|
* @returns {boolean}
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
if (a
|
|
27
|
-
return
|
|
25
|
+
function deepEqualsArray(a: any[], b: any[]) {
|
|
26
|
+
if (a.length !== b.length)
|
|
27
|
+
return false
|
|
28
|
+
for (let i = a.length; i-- !== 0;) {
|
|
29
|
+
if (!deepEquals(a[i], b[i]))
|
|
30
|
+
return false
|
|
31
|
+
}
|
|
32
|
+
return true
|
|
33
|
+
}
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let i, length, key
|
|
33
|
-
|
|
34
|
-
if (arrA && arrB) {
|
|
35
|
-
length = a.length
|
|
36
|
-
if (length !== b.length)
|
|
37
|
-
return false
|
|
38
|
-
for (i = length; i-- !== 0;) {
|
|
39
|
-
if (!deepEquals(a[i], b[i]))
|
|
40
|
-
return false
|
|
41
|
-
}
|
|
35
|
+
function deepEqualsObject(a: any, b: any) {
|
|
36
|
+
const keys = Object.keys(a)
|
|
37
|
+
const { length } = keys
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
if (length !== Object.keys(b).length)
|
|
40
|
+
return false
|
|
45
41
|
|
|
46
|
-
|
|
42
|
+
for (let i = length; i-- !== 0;) {
|
|
43
|
+
if (!Object.hasOwn(b, keys[i]))
|
|
47
44
|
return false
|
|
45
|
+
}
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
if (dateA !== dateB)
|
|
47
|
+
for (let i = length; i-- !== 0;) {
|
|
48
|
+
const key = keys[i]
|
|
49
|
+
if (!deepEquals(a[key], b[key]))
|
|
53
50
|
return false
|
|
54
|
-
|
|
55
|
-
return a.getTime() === b.getTime()
|
|
51
|
+
}
|
|
56
52
|
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
return true
|
|
54
|
+
}
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return a.toString() === b.toString()
|
|
56
|
+
export function deepEquals(a: any, b: any) {
|
|
57
|
+
if (a === b)
|
|
58
|
+
return true
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
if (!a || !b || typeof a !== 'object' || typeof b !== 'object')
|
|
61
|
+
return Number.isNaN(a) && Number.isNaN(b)
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
const arrA = Array.isArray(a)
|
|
64
|
+
const arrB = Array.isArray(b)
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
if (arrA !== arrB)
|
|
67
|
+
return false
|
|
68
|
+
if (arrA && arrB)
|
|
69
|
+
return deepEqualsArray(a, b)
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return false
|
|
75
|
-
}
|
|
71
|
+
const dateA = a instanceof Date
|
|
72
|
+
const dateB = b instanceof Date
|
|
76
73
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
74
|
+
if (dateA !== dateB)
|
|
75
|
+
return false
|
|
76
|
+
if (dateA && dateB)
|
|
77
|
+
return a.getTime() === b.getTime()
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
const regexpA = a instanceof RegExp
|
|
80
|
+
const regexpB = b instanceof RegExp
|
|
81
|
+
|
|
82
|
+
if (regexpA !== regexpB)
|
|
83
|
+
return false
|
|
84
|
+
if (regexpA && regexpB)
|
|
85
|
+
return a.toString() === b.toString()
|
|
86
|
+
|
|
87
|
+
return deepEqualsObject(a, b)
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
/**
|
|
@@ -95,20 +97,19 @@ export function resolveFieldData(data: Record<string, unknown>, field: string) {
|
|
|
95
97
|
if (data && Object.keys(data).length && field) {
|
|
96
98
|
if (!field.includes('.')) {
|
|
97
99
|
return data[field]
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
103
|
-
if (data == null) {
|
|
104
|
-
return null
|
|
105
|
-
}
|
|
100
|
+
}
|
|
101
|
+
const fields = field.split('.')
|
|
102
|
+
let value = data
|
|
106
103
|
|
|
107
|
-
|
|
104
|
+
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
105
|
+
if (value == null) {
|
|
106
|
+
return null
|
|
108
107
|
}
|
|
109
108
|
|
|
110
|
-
|
|
109
|
+
value = value[fields[i]] as Record<string, unknown>
|
|
111
110
|
}
|
|
111
|
+
|
|
112
|
+
return value
|
|
112
113
|
} else {
|
|
113
114
|
return null
|
|
114
115
|
}
|
|
@@ -120,7 +121,7 @@ export function resolveFieldData(data: Record<string, unknown>, field: string) {
|
|
|
120
121
|
*/
|
|
121
122
|
|
|
122
123
|
export function isFunction(obj: any) {
|
|
123
|
-
return !!(obj
|
|
124
|
+
return !!(obj?.constructor && obj.call && obj.apply)
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
/**
|
|
@@ -151,7 +152,7 @@ export function findIndexInList<Type = unknown>(value: Type, list: Type[]) {
|
|
|
151
152
|
* @returns {boolean} the index
|
|
152
153
|
*/
|
|
153
154
|
export function contains<Type = unknown>(value: Type, list: Type[]) {
|
|
154
|
-
if (value != null && list
|
|
155
|
+
if (value != null && list?.length) {
|
|
155
156
|
for (const val of list) {
|
|
156
157
|
if (equals(value, val)) {
|
|
157
158
|
return true
|