vueless 0.0.474 → 0.0.475
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/adatper.locale/locales/en.d.ts +289 -0
- package/adatper.locale/vue-i18n.d.ts +9 -0
- package/adatper.locale/vueless.d.ts +11 -0
- package/composables/useAutoPosition.d.ts +15 -0
- package/composables/useBreakpoint.d.ts +7 -0
- package/composables/useBreakpoint.js +1 -1
- package/composables/useLocale.d.ts +3 -0
- package/composables/useMutationObserver.d.ts +7 -0
- package/composables/useUI.d.ts +17 -0
- package/composablesTs/useAutoPosition.d.ts +28 -0
- package/composablesTs/useAutoPosition.ts +115 -0
- package/composablesTs/useBreakpoint.d.ts +7 -0
- package/composablesTs/useBreakpoint.ts +106 -0
- package/composablesTs/useLocale.d.ts +3 -0
- package/composablesTs/useLocale.ts +25 -0
- package/composablesTs/useMutationObserver.d.ts +8 -0
- package/composablesTs/useMutationObserver.ts +50 -0
- package/composablesTs/useUI.d.ts +68 -0
- package/composablesTs/useUI.ts +566 -0
- package/constants.d.ts +42 -0
- package/constants.js +1 -1
- package/constants.ts +73 -0
- package/directives/clickOutside/storybook/stories.d.ts +653 -0
- package/directives/clickOutside/vClickOutside.d.ts +6 -0
- package/directives/clickOutside/vClickOutside.js +2 -2
- package/directives/index.d.ts +2 -0
- package/directives/tooltip/storybook/stories.d.ts +252 -0
- package/directives/tooltip/storybook/stories.js +5 -5
- package/directives/tooltip/vTooltip.d.ts +6 -0
- package/index.d.ts +15 -0
- package/{index.js → index.ts} +9 -6
- package/package.json +28 -17
- package/preset.tailwind.d.ts +116 -0
- package/{preset.tailwind.js → preset.tailwind.ts} +30 -22
- package/types.d.ts +131 -0
- package/types.ts +218 -0
- package/ui.button/UButton.vue.d.ts +73 -0
- package/ui.button/config.d.ts +130 -0
- package/ui.button/constants.d.ts +1 -0
- package/ui.button/storybook/stories.d.ts +3062 -0
- package/ui.button/useAttrs.d.ts +11 -0
- package/ui.button-link/ULink.vue +1 -1
- package/ui.button-link/ULink.vue.d.ts +66 -0
- package/ui.button-link/config.d.ts +101 -0
- package/ui.button-link/constants.d.ts +1 -0
- package/ui.button-link/storybook/stories.d.ts +4567 -0
- package/ui.button-link/useAttrs.d.ts +14 -0
- package/ui.button-toggle/UToggle.vue.d.ts +50 -0
- package/ui.button-toggle/config.d.ts +65 -0
- package/ui.button-toggle/constants.d.ts +3 -0
- package/ui.button-toggle/storybook/stories.d.ts +2683 -0
- package/ui.button-toggle/useAttrs.d.ts +11 -0
- package/ui.button-toggle-item/UToggleItem.vue.d.ts +36 -0
- package/ui.button-toggle-item/config.d.ts +41 -0
- package/ui.button-toggle-item/constants.d.ts +1 -0
- package/ui.button-toggle-item/storybook/stories.d.ts +495 -0
- package/ui.button-toggle-item/useAttrs.d.ts +15 -0
- package/ui.container-accordion/UAccordion.vue.d.ts +32 -0
- package/ui.container-accordion/config.d.ts +40 -0
- package/ui.container-accordion/constants.d.ts +1 -0
- package/ui.container-accordion/storybook/stories.d.ts +732 -0
- package/ui.container-accordion/useAttrs.d.ts +13 -0
- package/ui.container-card/UCard.vue.d.ts +31 -0
- package/ui.container-card/config.d.ts +13 -0
- package/ui.container-card/constants.d.ts +1 -0
- package/ui.container-card/storybook/stories.d.ts +3906 -0
- package/ui.container-card/useAttrs.d.ts +11 -0
- package/ui.container-col/UCol.vue.d.ts +33 -0
- package/ui.container-col/config.d.ts +81 -0
- package/ui.container-col/constants.d.ts +1 -0
- package/ui.container-col/storybook/stories.d.ts +840 -0
- package/ui.container-col/useAttrs.d.ts +11 -0
- package/ui.container-divider/UDivider.vue.d.ts +25 -0
- package/ui.container-divider/config.d.ts +102 -0
- package/ui.container-divider/constants.d.ts +1 -0
- package/ui.container-divider/storybook/stories.d.ts +577 -0
- package/ui.container-divider/useAttrs.d.ts +11 -0
- package/ui.container-group/UGroup.vue.d.ts +33 -0
- package/ui.container-group/config.d.ts +38 -0
- package/ui.container-group/constants.d.ts +1 -0
- package/ui.container-group/storybook/stories.d.ts +2869 -0
- package/ui.container-group/useAttrs.d.ts +11 -0
- package/ui.container-modal/UModal.vue.d.ts +59 -0
- package/ui.container-modal/config.d.ts +77 -0
- package/ui.container-modal/constants.d.ts +1 -0
- package/ui.container-modal/storybook/stories.d.ts +8377 -0
- package/ui.container-modal/useAttrs.d.ts +11 -0
- package/ui.container-modal-confirm/UModalConfirm.vue.d.ts +59 -0
- package/ui.container-modal-confirm/config.d.ts +23 -0
- package/ui.container-modal-confirm/constants.d.ts +1 -0
- package/ui.container-modal-confirm/storybook/stories.d.ts +4494 -0
- package/ui.container-modal-confirm/useAttrs.d.ts +11 -0
- package/ui.container-page/UPage.vue.d.ts +47 -0
- package/ui.container-page/config.d.ts +85 -0
- package/ui.container-page/constants.d.ts +1 -0
- package/ui.container-page/storybook/stories.d.ts +8723 -0
- package/ui.container-page/useAttrs.d.ts +13 -0
- package/ui.container-row/URow.vue.d.ts +35 -0
- package/ui.container-row/config.d.ts +85 -0
- package/ui.container-row/constants.d.ts +1 -0
- package/ui.container-row/storybook/stories.d.ts +2619 -0
- package/ui.container-row/useAttrs.d.ts +11 -0
- package/ui.data-list/UDataList.vue +4 -4
- package/ui.data-list/UDataList.vue.d.ts +74 -0
- package/ui.data-list/config.d.ts +48 -0
- package/ui.data-list/constants.d.ts +1 -0
- package/ui.data-list/storybook/stories.d.ts +3342 -0
- package/ui.data-list/useAttrs.d.ts +11 -0
- package/ui.data-table/UTable.vue.d.ts +90 -0
- package/ui.data-table/UTableRow.vue.d.ts +61 -0
- package/ui.data-table/config.d.ts +128 -0
- package/ui.data-table/constants.d.ts +1 -0
- package/ui.data-table/storybook/stories.d.ts +13069 -0
- package/ui.data-table/useAttrs.d.ts +17 -0
- package/ui.data-table/utilTable.d.ts +9 -0
- package/ui.dropdown-badge/UDropdownBadge.vue.d.ts +145 -0
- package/ui.dropdown-badge/config.d.ts +39 -0
- package/ui.dropdown-badge/constants.d.ts +1 -0
- package/ui.dropdown-badge/storybook/stories.d.ts +1246 -0
- package/ui.dropdown-badge/useAttrs.d.ts +13 -0
- package/ui.dropdown-button/UDropdownButton.vue.d.ts +151 -0
- package/ui.dropdown-button/config.d.ts +52 -0
- package/ui.dropdown-button/constants.d.ts +4 -0
- package/ui.dropdown-button/storybook/stories.d.ts +1912 -0
- package/ui.dropdown-button/useAttrs.d.ts +13 -0
- package/ui.dropdown-link/UDropdownLink.vue.d.ts +149 -0
- package/ui.dropdown-link/config.d.ts +37 -0
- package/ui.dropdown-link/constants.d.ts +1 -0
- package/ui.dropdown-link/storybook/stories.d.ts +1333 -0
- package/ui.dropdown-link/useAttrs.d.ts +13 -0
- package/ui.dropdown-list/UDropdownList.vue.d.ts +59 -0
- package/ui.dropdown-list/config.d.ts +77 -0
- package/ui.dropdown-list/constants.d.ts +1 -0
- package/ui.dropdown-list/storybook/stories.d.ts +783 -0
- package/ui.dropdown-list/useAttrs.d.ts +11 -0
- package/ui.dropdown-list/usePointer.d.ts +8 -0
- package/ui.form-calendar/UCalendar.vue.d.ts +31 -0
- package/ui.form-calendar/UCalendarDayView.vue.d.ts +26 -0
- package/ui.form-calendar/UCalendarMonthView.vue.d.ts +26 -0
- package/ui.form-calendar/UCalendarYearView.vue.d.ts +26 -0
- package/ui.form-calendar/config.d.ts +207 -0
- package/ui.form-calendar/constants.d.ts +66 -0
- package/ui.form-calendar/storybook/stories.d.ts +262 -0
- package/ui.form-calendar/useAttrs.d.ts +11 -0
- package/ui.form-calendar/utilCalendar.d.ts +8 -0
- package/ui.form-calendar/utilDate.d.ts +30 -0
- package/ui.form-calendar/utilFormatting.d.ts +68 -0
- package/ui.form-checkbox/UCheckbox.vue.d.ts +50 -0
- package/ui.form-checkbox/config.d.ts +67 -0
- package/ui.form-checkbox/constants.d.ts +1 -0
- package/ui.form-checkbox/storybook/stories.d.ts +1589 -0
- package/ui.form-checkbox/useAttrs.d.ts +14 -0
- package/ui.form-checkbox-group/UCheckboxGroup.vue.d.ts +40 -0
- package/ui.form-checkbox-group/config.d.ts +21 -0
- package/ui.form-checkbox-group/constants.d.ts +1 -0
- package/ui.form-checkbox-group/storybook/stories.d.ts +2441 -0
- package/ui.form-checkbox-group/useAttrs.d.ts +11 -0
- package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue.d.ts +24 -0
- package/ui.form-checkbox-multi-state/config.d.ts +10 -0
- package/ui.form-checkbox-multi-state/constants.d.ts +1 -0
- package/ui.form-checkbox-multi-state/storybook/stories.d.ts +187 -0
- package/ui.form-checkbox-multi-state/useAttrs.d.ts +13 -0
- package/ui.form-color-picker/UColorPicker.vue.d.ts +28 -0
- package/ui.form-color-picker/config.d.ts +42 -0
- package/ui.form-color-picker/constants.d.ts +1 -0
- package/ui.form-color-picker/storybook/stories.d.ts +316 -0
- package/ui.form-color-picker/useAttrs.d.ts +11 -0
- package/ui.form-date-picker/UDatePicker.vue.d.ts +135 -0
- package/ui.form-date-picker/config.d.ts +184 -0
- package/ui.form-date-picker/constants.d.ts +1 -0
- package/ui.form-date-picker/index.d.ts +1 -0
- package/ui.form-date-picker/storybook/stories.d.ts +3242 -0
- package/ui.form-date-picker/useAttrs.d.ts +14 -0
- package/ui.form-date-picker-range/UDatePickerRange.vue.d.ts +545 -0
- package/ui.form-date-picker-range/UDatePickerRangeInputs.vue.d.ts +6 -0
- package/ui.form-date-picker-range/UDatePickerRangePeriodMenu.vue.d.ts +7 -0
- package/ui.form-date-picker-range/config.d.ts +265 -0
- package/ui.form-date-picker-range/constants.d.ts +20 -0
- package/ui.form-date-picker-range/storybook/stories.d.ts +5545 -0
- package/ui.form-date-picker-range/useAttrs.d.ts +17 -0
- package/ui.form-date-picker-range/useUserFormat.d.ts +3 -0
- package/ui.form-date-picker-range/utilDateRange.d.ts +20 -0
- package/ui.form-date-picker-range/utilValidation.d.ts +3 -0
- package/ui.form-input/UInput.vue +1 -1
- package/ui.form-input/UInput.vue.d.ts +59 -0
- package/ui.form-input/config.d.ts +59 -0
- package/ui.form-input/constants.d.ts +1 -0
- package/ui.form-input/storybook/stories.d.ts +5734 -0
- package/ui.form-input/useAttrs.d.ts +11 -0
- package/ui.form-input-file/UInputFile.vue.d.ts +57 -0
- package/ui.form-input-file/config.d.ts +94 -0
- package/ui.form-input-file/constants.d.ts +1 -0
- package/ui.form-input-file/storybook/stories.d.ts +1116 -0
- package/ui.form-input-file/useAttrs.d.ts +11 -0
- package/ui.form-input-file/utilFileForm.d.ts +1 -0
- package/ui.form-input-money/UInputMoney.vue.d.ts +183 -0
- package/ui.form-input-money/config.d.ts +17 -0
- package/ui.form-input-money/constants.d.ts +1 -0
- package/ui.form-input-money/storybook/stories.d.ts +7519 -0
- package/ui.form-input-money/useAttrs.d.ts +11 -0
- package/ui.form-input-money/useFormatCurrency.d.ts +5 -0
- package/ui.form-input-money/useFormatCurrency.js +1 -1
- package/ui.form-input-money/utilFormat.d.ts +7 -0
- package/ui.form-input-number/UInputNumber.vue +4 -3
- package/ui.form-input-number/UInputNumber.vue.d.ts +30 -0
- package/ui.form-input-number/config.d.ts +40 -0
- package/ui.form-input-number/constants.d.ts +1 -0
- package/ui.form-input-number/storybook/stories.d.ts +363 -0
- package/ui.form-input-number/useAttrs.d.ts +11 -0
- package/ui.form-input-rating/UInputRating.vue.d.ts +49 -0
- package/ui.form-input-rating/config.d.ts +56 -0
- package/ui.form-input-rating/constants.d.ts +1 -0
- package/ui.form-input-rating/storybook/stories.d.ts +1336 -0
- package/ui.form-input-rating/useAttrs.d.ts +11 -0
- package/ui.form-input-search/UInputSearch.vue.d.ts +177 -0
- package/ui.form-input-search/config.d.ts +21 -0
- package/ui.form-input-search/constants.d.ts +1 -0
- package/ui.form-input-search/storybook/stories.d.ts +3325 -0
- package/ui.form-input-search/useAttrs.d.ts +11 -0
- package/ui.form-label/ULabel.vue.d.ts +46 -0
- package/ui.form-label/config.d.ts +139 -0
- package/ui.form-label/config.js +2 -2
- package/ui.form-label/constants.d.ts +8 -0
- package/ui.form-label/storybook/stories.d.ts +1133 -0
- package/ui.form-label/useAttrs.d.ts +11 -0
- package/ui.form-radio/URadio.vue.d.ts +46 -0
- package/ui.form-radio/config.d.ts +30 -0
- package/ui.form-radio/constants.d.ts +1 -0
- package/ui.form-radio/storybook/stories.d.ts +1270 -0
- package/ui.form-radio/useAttrs.d.ts +14 -0
- package/ui.form-radio-group/URadioGroup.vue.d.ts +40 -0
- package/ui.form-radio-group/config.d.ts +21 -0
- package/ui.form-radio-group/constants.d.ts +1 -0
- package/ui.form-radio-group/storybook/stories.d.ts +1239 -0
- package/ui.form-radio-group/useAttrs.d.ts +11 -0
- package/ui.form-select/USelect.vue.d.ts +405 -0
- package/ui.form-select/config.d.ts +146 -0
- package/ui.form-select/constants.d.ts +13 -0
- package/ui.form-select/storybook/stories.d.ts +19025 -0
- package/ui.form-select/useAttrs.d.ts +15 -0
- package/ui.form-select/utilSelect.d.ts +11 -0
- package/ui.form-switch/USwitch.vue.d.ts +30 -0
- package/ui.form-switch/config.d.ts +106 -0
- package/ui.form-switch/constants.d.ts +1 -0
- package/ui.form-switch/storybook/stories.d.ts +703 -0
- package/ui.form-switch/useAttrs.d.ts +13 -0
- package/ui.form-switch/utilVariant.d.ts +169 -0
- package/ui.form-textarea/UTextarea.vue.d.ts +132 -0
- package/ui.form-textarea/config.d.ts +55 -0
- package/ui.form-textarea/constants.d.ts +1 -0
- package/ui.form-textarea/storybook/stories.d.ts +2175 -0
- package/ui.form-textarea/useAttrs.d.ts +11 -0
- package/ui.image-avatar/UAvatar.vue.d.ts +40 -0
- package/ui.image-avatar/config.d.ts +51 -0
- package/ui.image-avatar/constants.d.ts +1 -0
- package/ui.image-avatar/storybook/stories.d.ts +1640 -0
- package/ui.image-avatar/useAttrs.d.ts +11 -0
- package/ui.image-icon/UIcon.vue.d.ts +28 -0
- package/ui.image-icon/config.d.ts +52 -0
- package/ui.image-icon/constants.d.ts +1 -0
- package/ui.image-icon/storybook/stories.d.ts +516 -0
- package/ui.image-icon/useAttrs.d.ts +11 -0
- package/ui.loader/ULoader.vue.d.ts +23 -0
- package/ui.loader/config.d.ts +49 -0
- package/ui.loader/constants.d.ts +2 -0
- package/ui.loader/storybook/stories.d.ts +655 -0
- package/ui.loader/useAttrs.d.ts +11 -0
- package/ui.loader-overlay/ULoaderOverlay.vue.d.ts +21 -0
- package/ui.loader-overlay/config.d.ts +25 -0
- package/ui.loader-overlay/constants.d.ts +1 -0
- package/ui.loader-overlay/storybook/stories.d.ts +362 -0
- package/ui.loader-overlay/useAttrs.d.ts +11 -0
- package/ui.loader-overlay/useLoaderOverlay.d.ts +10 -0
- package/ui.loader-overlay/utilLoaderOverlay.d.ts +2 -0
- package/ui.loader-progress/ULoaderProgress.vue.d.ts +11 -0
- package/ui.loader-progress/config.d.ts +24 -0
- package/ui.loader-progress/constants.d.ts +3 -0
- package/ui.loader-progress/storybook/stories.d.ts +742 -0
- package/ui.loader-progress/useAttrs.d.ts +11 -0
- package/ui.loader-progress/useLoaderProgress.d.ts +15 -0
- package/ui.loader-progress/utilLoaderProgress.d.ts +5 -0
- package/ui.navigation-pagination/UPagination.vue.d.ts +54 -0
- package/ui.navigation-pagination/config.d.ts +41 -0
- package/ui.navigation-pagination/constants.d.ts +1 -0
- package/ui.navigation-pagination/storybook/stories.d.ts +1033 -0
- package/ui.navigation-pagination/useAttrs.d.ts +11 -0
- package/ui.navigation-progress/StepperProgress.vue.d.ts +15 -0
- package/ui.navigation-progress/UProgress.vue.d.ts +41 -0
- package/ui.navigation-progress/config.d.ts +139 -0
- package/ui.navigation-progress/constants.d.ts +5 -0
- package/ui.navigation-progress/storybook/stories.d.ts +2827 -0
- package/ui.navigation-progress/useAttrs.d.ts +11 -0
- package/ui.navigation-tab/UTab.vue.d.ts +27 -0
- package/ui.navigation-tab/config.d.ts +24 -0
- package/ui.navigation-tab/constants.d.ts +1 -0
- package/ui.navigation-tab/storybook/stories.d.ts +316 -0
- package/ui.navigation-tab/useAttrs.d.ts +14 -0
- package/ui.navigation-tabs/UTabs.vue.d.ts +30 -0
- package/ui.navigation-tabs/config.d.ts +24 -0
- package/ui.navigation-tabs/constants.d.ts +1 -0
- package/ui.navigation-tabs/storybook/stories.d.ts +354 -0
- package/ui.navigation-tabs/useAttrs.d.ts +11 -0
- package/ui.other-dot/UDot.vue.d.ts +13 -0
- package/ui.other-dot/config.d.ts +28 -0
- package/ui.other-dot/constants.d.ts +1 -0
- package/ui.other-dot/storybook/stories.d.ts +645 -0
- package/ui.other-dot/useAttrs.d.ts +11 -0
- package/ui.text-alert/UAlert.vue.d.ts +53 -0
- package/ui.text-alert/config.d.ts +75 -0
- package/ui.text-alert/constants.d.ts +1 -0
- package/ui.text-alert/storybook/stories.d.ts +4845 -0
- package/ui.text-alert/useAttrs.d.ts +11 -0
- package/ui.text-badge/UBadge.vue.d.ts +60 -0
- package/ui.text-badge/config.d.ts +102 -0
- package/ui.text-badge/constants.d.ts +1 -0
- package/ui.text-badge/storybook/stories.d.ts +1869 -0
- package/ui.text-badge/useAttrs.d.ts +11 -0
- package/ui.text-block/UText.vue +18 -62
- package/ui.text-block/UText.vue.d.ts +21 -0
- package/ui.text-block/config.d.ts +27 -0
- package/ui.text-block/constants.d.ts +1 -0
- package/ui.text-block/storybook/Docs.mdx +2 -2
- package/ui.text-block/storybook/stories.d.ts +12 -0
- package/ui.text-block/storybook/{stories.js → stories.ts} +12 -7
- package/ui.text-block/types.d.ts +9 -0
- package/ui.text-block/types.ts +33 -0
- package/ui.text-block/useAttrs.d.ts +3 -0
- package/ui.text-block/useAttrs.ts +18 -0
- package/ui.text-empty/UEmpty.vue.d.ts +29 -0
- package/ui.text-empty/config.d.ts +55 -0
- package/ui.text-empty/constants.d.ts +1 -0
- package/ui.text-empty/storybook/stories.d.ts +1212 -0
- package/ui.text-empty/useAttrs.d.ts +11 -0
- package/ui.text-file/UFile.vue +12 -14
- package/ui.text-file/UFile.vue.d.ts +57 -0
- package/ui.text-file/config.d.ts +42 -0
- package/ui.text-file/config.js +12 -2
- package/ui.text-file/constants.d.ts +1 -0
- package/ui.text-file/storybook/stories.d.ts +136 -0
- package/ui.text-file/useAttrs.d.ts +11 -0
- package/ui.text-files/UFiles.vue.d.ts +52 -0
- package/ui.text-files/config.d.ts +10 -0
- package/ui.text-files/config.js +1 -1
- package/ui.text-files/constants.d.ts +1 -0
- package/ui.text-files/storybook/stories.d.ts +131 -0
- package/ui.text-files/useAttrs.d.ts +11 -0
- package/ui.text-header/UHeader.vue.d.ts +33 -0
- package/ui.text-header/config.d.ts +54 -0
- package/ui.text-header/constants.d.ts +1 -0
- package/ui.text-header/storybook/stories.d.ts +694 -0
- package/ui.text-header/useAttrs.d.ts +11 -0
- package/ui.text-money/UMoney.vue.d.ts +48 -0
- package/ui.text-money/config.d.ts +77 -0
- package/ui.text-money/constants.d.ts +1 -0
- package/ui.text-money/storybook/stories.d.ts +2090 -0
- package/ui.text-money/useAttrs.d.ts +11 -0
- package/ui.text-money/utilMoney.d.ts +14 -0
- package/ui.text-money/utilMoney.js +2 -2
- package/ui.text-notify/UNotify.vue.d.ts +13 -0
- package/ui.text-notify/config.d.ts +58 -0
- package/ui.text-notify/constants.d.ts +20 -0
- package/ui.text-notify/storybook/stories.d.ts +653 -0
- package/ui.text-notify/useAttrs.d.ts +11 -0
- package/ui.text-notify/utilNotify.d.ts +7 -0
- package/utils/utilHelper.d.ts +9 -0
- package/utils/utilPlatform.d.ts +6 -0
- package/utils/utilStorybook.d.ts +15 -0
- package/utils/utilUI.d.ts +68 -0
- package/utilsTs/utilHelper.d.ts +9 -0
- package/utilsTs/utilHelper.ts +70 -0
- package/utilsTs/utilPlatform.d.ts +7 -0
- package/utilsTs/utilPlatform.ts +53 -0
- package/utilsTs/utilStorybook.d.ts +24 -0
- package/utilsTs/utilStorybook.ts +292 -0
- package/utilsTs/utilTailwind.d.ts +1 -0
- package/utilsTs/utilTailwind.ts +38 -0
- package/utilsTs/utilTheme.d.ts +8 -0
- package/{utils/utilTheme.js → utilsTs/utilTheme.ts} +31 -27
- package/utilsTs/utilUI.d.ts +67 -0
- package/utilsTs/utilUI.ts +142 -0
- package/web-types.json +30 -120
- package/ui.text-block/useAttrs.js +0 -15
- /package/ui.text-block/{config.js → config.ts} +0 -0
- /package/ui.text-block/{constants.js → constants.ts} +0 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let USelect: {
|
|
3
|
+
listIsEmpty: string;
|
|
4
|
+
noDataToShow: string;
|
|
5
|
+
clear: string;
|
|
6
|
+
addMore: string;
|
|
7
|
+
};
|
|
8
|
+
let USwitch: {
|
|
9
|
+
inactive: string;
|
|
10
|
+
active: string;
|
|
11
|
+
};
|
|
12
|
+
let UInputFile: {
|
|
13
|
+
sizeError: string;
|
|
14
|
+
formatError: string;
|
|
15
|
+
noFile: string;
|
|
16
|
+
uploadFile: string;
|
|
17
|
+
};
|
|
18
|
+
let UDropdownList: {
|
|
19
|
+
noDataToShow: string;
|
|
20
|
+
add: string;
|
|
21
|
+
};
|
|
22
|
+
let UModalConfirm: {
|
|
23
|
+
confirm: string;
|
|
24
|
+
cancel: string;
|
|
25
|
+
};
|
|
26
|
+
let UTable: {
|
|
27
|
+
noData: string;
|
|
28
|
+
};
|
|
29
|
+
let UCalendar: {
|
|
30
|
+
weekdays: {
|
|
31
|
+
shorthand: {
|
|
32
|
+
sunday: string;
|
|
33
|
+
monday: string;
|
|
34
|
+
tuesday: string;
|
|
35
|
+
wednesday: string;
|
|
36
|
+
thursday: string;
|
|
37
|
+
friday: string;
|
|
38
|
+
saturday: string;
|
|
39
|
+
};
|
|
40
|
+
longhand: {
|
|
41
|
+
sunday: string;
|
|
42
|
+
monday: string;
|
|
43
|
+
tuesday: string;
|
|
44
|
+
wednesday: string;
|
|
45
|
+
thursday: string;
|
|
46
|
+
friday: string;
|
|
47
|
+
saturday: string;
|
|
48
|
+
};
|
|
49
|
+
userFormat: {
|
|
50
|
+
sunday: string;
|
|
51
|
+
monday: string;
|
|
52
|
+
tuesday: string;
|
|
53
|
+
wednesday: string;
|
|
54
|
+
thursday: string;
|
|
55
|
+
friday: string;
|
|
56
|
+
saturday: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
months: {
|
|
60
|
+
shorthand: {
|
|
61
|
+
january: string;
|
|
62
|
+
february: string;
|
|
63
|
+
march: string;
|
|
64
|
+
april: string;
|
|
65
|
+
may: string;
|
|
66
|
+
june: string;
|
|
67
|
+
july: string;
|
|
68
|
+
august: string;
|
|
69
|
+
september: string;
|
|
70
|
+
october: string;
|
|
71
|
+
november: string;
|
|
72
|
+
december: string;
|
|
73
|
+
};
|
|
74
|
+
longhand: {
|
|
75
|
+
january: string;
|
|
76
|
+
february: string;
|
|
77
|
+
march: string;
|
|
78
|
+
april: string;
|
|
79
|
+
may: string;
|
|
80
|
+
june: string;
|
|
81
|
+
july: string;
|
|
82
|
+
august: string;
|
|
83
|
+
september: string;
|
|
84
|
+
october: string;
|
|
85
|
+
november: string;
|
|
86
|
+
december: string;
|
|
87
|
+
};
|
|
88
|
+
userFormat: {
|
|
89
|
+
january: string;
|
|
90
|
+
february: string;
|
|
91
|
+
march: string;
|
|
92
|
+
april: string;
|
|
93
|
+
may: string;
|
|
94
|
+
june: string;
|
|
95
|
+
july: string;
|
|
96
|
+
august: string;
|
|
97
|
+
september: string;
|
|
98
|
+
october: string;
|
|
99
|
+
november: string;
|
|
100
|
+
december: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
timeLabel: string;
|
|
104
|
+
okLabel: string;
|
|
105
|
+
};
|
|
106
|
+
let UDatePicker: {
|
|
107
|
+
today: string;
|
|
108
|
+
yesterday: string;
|
|
109
|
+
tomorrow: string;
|
|
110
|
+
weekdays: {
|
|
111
|
+
shorthand: {
|
|
112
|
+
sunday: string;
|
|
113
|
+
monday: string;
|
|
114
|
+
tuesday: string;
|
|
115
|
+
wednesday: string;
|
|
116
|
+
thursday: string;
|
|
117
|
+
friday: string;
|
|
118
|
+
saturday: string;
|
|
119
|
+
};
|
|
120
|
+
longhand: {
|
|
121
|
+
sunday: string;
|
|
122
|
+
monday: string;
|
|
123
|
+
tuesday: string;
|
|
124
|
+
wednesday: string;
|
|
125
|
+
thursday: string;
|
|
126
|
+
friday: string;
|
|
127
|
+
saturday: string;
|
|
128
|
+
};
|
|
129
|
+
userFormat: {
|
|
130
|
+
sunday: string;
|
|
131
|
+
monday: string;
|
|
132
|
+
tuesday: string;
|
|
133
|
+
wednesday: string;
|
|
134
|
+
thursday: string;
|
|
135
|
+
friday: string;
|
|
136
|
+
saturday: string;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
months: {
|
|
140
|
+
shorthand: {
|
|
141
|
+
january: string;
|
|
142
|
+
february: string;
|
|
143
|
+
march: string;
|
|
144
|
+
april: string;
|
|
145
|
+
may: string;
|
|
146
|
+
june: string;
|
|
147
|
+
july: string;
|
|
148
|
+
august: string;
|
|
149
|
+
september: string;
|
|
150
|
+
october: string;
|
|
151
|
+
november: string;
|
|
152
|
+
december: string;
|
|
153
|
+
};
|
|
154
|
+
longhand: {
|
|
155
|
+
january: string;
|
|
156
|
+
february: string;
|
|
157
|
+
march: string;
|
|
158
|
+
april: string;
|
|
159
|
+
may: string;
|
|
160
|
+
june: string;
|
|
161
|
+
july: string;
|
|
162
|
+
august: string;
|
|
163
|
+
september: string;
|
|
164
|
+
october: string;
|
|
165
|
+
november: string;
|
|
166
|
+
december: string;
|
|
167
|
+
};
|
|
168
|
+
userFormat: {
|
|
169
|
+
january: string;
|
|
170
|
+
february: string;
|
|
171
|
+
march: string;
|
|
172
|
+
april: string;
|
|
173
|
+
may: string;
|
|
174
|
+
june: string;
|
|
175
|
+
july: string;
|
|
176
|
+
august: string;
|
|
177
|
+
september: string;
|
|
178
|
+
october: string;
|
|
179
|
+
november: string;
|
|
180
|
+
december: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
timeLabel: string;
|
|
184
|
+
okLabel: string;
|
|
185
|
+
};
|
|
186
|
+
let UDatePickerRange: {
|
|
187
|
+
ownRange: string;
|
|
188
|
+
week: string;
|
|
189
|
+
month: string;
|
|
190
|
+
quarter: string;
|
|
191
|
+
year: string;
|
|
192
|
+
dateFormatWithDot: string;
|
|
193
|
+
notCorrectMonthNumber: string;
|
|
194
|
+
notCorrectDayNumber: string;
|
|
195
|
+
fromDateGraterThanSecond: string;
|
|
196
|
+
toDateSmallerThanFirst: string;
|
|
197
|
+
weekdays: {
|
|
198
|
+
shorthand: {
|
|
199
|
+
sunday: string;
|
|
200
|
+
monday: string;
|
|
201
|
+
tuesday: string;
|
|
202
|
+
wednesday: string;
|
|
203
|
+
thursday: string;
|
|
204
|
+
friday: string;
|
|
205
|
+
saturday: string;
|
|
206
|
+
};
|
|
207
|
+
longhand: {
|
|
208
|
+
sunday: string;
|
|
209
|
+
monday: string;
|
|
210
|
+
tuesday: string;
|
|
211
|
+
wednesday: string;
|
|
212
|
+
thursday: string;
|
|
213
|
+
friday: string;
|
|
214
|
+
saturday: string;
|
|
215
|
+
};
|
|
216
|
+
userFormat: {
|
|
217
|
+
sunday: string;
|
|
218
|
+
monday: string;
|
|
219
|
+
tuesday: string;
|
|
220
|
+
wednesday: string;
|
|
221
|
+
thursday: string;
|
|
222
|
+
friday: string;
|
|
223
|
+
saturday: string;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
months: {
|
|
227
|
+
shorthand: {
|
|
228
|
+
january: string;
|
|
229
|
+
february: string;
|
|
230
|
+
march: string;
|
|
231
|
+
april: string;
|
|
232
|
+
may: string;
|
|
233
|
+
june: string;
|
|
234
|
+
july: string;
|
|
235
|
+
august: string;
|
|
236
|
+
september: string;
|
|
237
|
+
october: string;
|
|
238
|
+
november: string;
|
|
239
|
+
december: string;
|
|
240
|
+
};
|
|
241
|
+
longhand: {
|
|
242
|
+
january: string;
|
|
243
|
+
february: string;
|
|
244
|
+
march: string;
|
|
245
|
+
april: string;
|
|
246
|
+
may: string;
|
|
247
|
+
june: string;
|
|
248
|
+
july: string;
|
|
249
|
+
august: string;
|
|
250
|
+
september: string;
|
|
251
|
+
october: string;
|
|
252
|
+
november: string;
|
|
253
|
+
december: string;
|
|
254
|
+
};
|
|
255
|
+
userFormat: {
|
|
256
|
+
january: string;
|
|
257
|
+
february: string;
|
|
258
|
+
march: string;
|
|
259
|
+
april: string;
|
|
260
|
+
may: string;
|
|
261
|
+
june: string;
|
|
262
|
+
july: string;
|
|
263
|
+
august: string;
|
|
264
|
+
september: string;
|
|
265
|
+
october: string;
|
|
266
|
+
november: string;
|
|
267
|
+
december: string;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
let UDataList: {
|
|
272
|
+
edit: string;
|
|
273
|
+
delete: string;
|
|
274
|
+
emptyTitle: string;
|
|
275
|
+
emptyDescription: string;
|
|
276
|
+
};
|
|
277
|
+
let UNotify: {
|
|
278
|
+
success: {
|
|
279
|
+
default: string;
|
|
280
|
+
};
|
|
281
|
+
warning: {
|
|
282
|
+
default: string;
|
|
283
|
+
};
|
|
284
|
+
error: {
|
|
285
|
+
default: string;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default function createVuelessAdapter(options: any): {
|
|
2
|
+
name: string;
|
|
3
|
+
locale: import("vue").ShallowRef<any>;
|
|
4
|
+
fallback: import("vue").ShallowRef<any>;
|
|
5
|
+
messages: import("vue").Ref<any, any>;
|
|
6
|
+
t: (key: any, ...params: any[]) => any;
|
|
7
|
+
tm: (key: any) => any;
|
|
8
|
+
n: (value: any, options: any) => string;
|
|
9
|
+
};
|
|
10
|
+
export function getObjectValueByPath(obj: any, path: any, fallback: any): any;
|
|
11
|
+
export function getNestedValue(obj: any, path: any, fallback: any): any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function useAutoPosition(anchorElement: any, targetElement: any, position: any, preferredPosition: any): {
|
|
2
|
+
isTop: import("vue").ComputedRef<boolean>;
|
|
3
|
+
isRight: import("vue").ComputedRef<boolean>;
|
|
4
|
+
isBottom: import("vue").ComputedRef<boolean>;
|
|
5
|
+
isLeft: import("vue").ComputedRef<boolean>;
|
|
6
|
+
adjustPositionY: () => void;
|
|
7
|
+
adjustPositionX: () => void;
|
|
8
|
+
};
|
|
9
|
+
export namespace POSITION {
|
|
10
|
+
let left: string;
|
|
11
|
+
let right: string;
|
|
12
|
+
let top: string;
|
|
13
|
+
let bottom: string;
|
|
14
|
+
let auto: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export default function useBreakpoint(): {
|
|
2
|
+
isLaptopBreakpoint: import("vue").ComputedRef<boolean>;
|
|
3
|
+
isTabletBreakpoint: import("vue").ComputedRef<boolean>;
|
|
4
|
+
isMobileBreakpoint: import("vue").ComputedRef<boolean>;
|
|
5
|
+
isPortableBreakpoint: import("vue").ComputedRef<boolean>;
|
|
6
|
+
elementSize: import("vue").ComputedRef<string>;
|
|
7
|
+
};
|
|
@@ -59,7 +59,7 @@ export default function useBreakpoint() {
|
|
|
59
59
|
onBeforeUnmount(() => {
|
|
60
60
|
if (isSSR) return;
|
|
61
61
|
|
|
62
|
-
window.removeEventListener("resize", resizeListener
|
|
62
|
+
window.removeEventListener("resize", resizeListener);
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
watch(windowWidth, setBreakpoint, { immediate: true });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default function useUI(defaultConfig: {} | undefined, propsConfigGetter: null | undefined, topLevelClassKey: any): {
|
|
2
|
+
config: import("vue").Ref<{}, {}>;
|
|
3
|
+
setColor: typeof setColor;
|
|
4
|
+
getColor: typeof getColor;
|
|
5
|
+
getAttrs: (configKey: string, options: Object) => Object;
|
|
6
|
+
getKeysAttrs: (mutatedProps?: {}, extendingKeys?: any[], keysToExtendConfig?: {}) => Object;
|
|
7
|
+
getExtendingKeysClasses: (extendingKeys: any[], mutatedProps?: Object) => Object;
|
|
8
|
+
isCVA: typeof isCVA;
|
|
9
|
+
isSystemKey: typeof isSystemKey;
|
|
10
|
+
hasSlotContent: typeof hasSlotContent;
|
|
11
|
+
};
|
|
12
|
+
import { setColor } from "../utils/utilUI.js";
|
|
13
|
+
import { getColor } from "../utils/utilUI.js";
|
|
14
|
+
declare function isCVA(config: Object | string): boolean;
|
|
15
|
+
declare function isSystemKey(key: string): boolean;
|
|
16
|
+
declare function hasSlotContent(slot: any, props?: {}): boolean;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Ref, ComputedRef } from "vue";
|
|
2
|
+
interface PositionXY {
|
|
3
|
+
x: Position;
|
|
4
|
+
y: Position;
|
|
5
|
+
}
|
|
6
|
+
export declare enum Position {
|
|
7
|
+
Left = "left",
|
|
8
|
+
Right = "right",
|
|
9
|
+
Top = "top",
|
|
10
|
+
Bottom = "bottom",
|
|
11
|
+
Auto = "auto"
|
|
12
|
+
}
|
|
13
|
+
export declare const POSITION: {
|
|
14
|
+
left: string;
|
|
15
|
+
right: string;
|
|
16
|
+
top: string;
|
|
17
|
+
bottom: string;
|
|
18
|
+
auto: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function useAutoPosition(anchorElement: Ref<HTMLElement | null>, targetElement: Ref<HTMLElement | null>, position: PositionXY | ComputedRef<PositionXY>, preferredPosition: PositionXY | ComputedRef<PositionXY>): {
|
|
21
|
+
isTop: ComputedRef<boolean>;
|
|
22
|
+
isRight: ComputedRef<boolean>;
|
|
23
|
+
isBottom: ComputedRef<boolean>;
|
|
24
|
+
isLeft: ComputedRef<boolean>;
|
|
25
|
+
adjustPositionY: () => void;
|
|
26
|
+
adjustPositionX: () => void;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { computed, toValue, ref } from "vue";
|
|
2
|
+
import { isSSR } from "../utils/utilHelper.js";
|
|
3
|
+
|
|
4
|
+
import type { Ref, ComputedRef } from "vue";
|
|
5
|
+
|
|
6
|
+
interface PositionXY {
|
|
7
|
+
x: Position;
|
|
8
|
+
y: Position;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum Position {
|
|
12
|
+
Left = "left",
|
|
13
|
+
Right = "right",
|
|
14
|
+
Top = "top",
|
|
15
|
+
Bottom = "bottom",
|
|
16
|
+
Auto = "auto",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// TODO: Remove after full TS migration, use enum instead.
|
|
20
|
+
export const POSITION = {
|
|
21
|
+
left: "left",
|
|
22
|
+
right: "right",
|
|
23
|
+
top: "top",
|
|
24
|
+
bottom: "bottom",
|
|
25
|
+
auto: "auto",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export function useAutoPosition(
|
|
29
|
+
anchorElement: Ref<HTMLElement | null>,
|
|
30
|
+
targetElement: Ref<HTMLElement | null>,
|
|
31
|
+
position: PositionXY | ComputedRef<PositionXY>,
|
|
32
|
+
preferredPosition: PositionXY | ComputedRef<PositionXY>,
|
|
33
|
+
) {
|
|
34
|
+
const localAnchorElement = computed(() => toValue(anchorElement));
|
|
35
|
+
const localTargetElement = computed(() => toValue(targetElement));
|
|
36
|
+
const localPosition = computed(() => toValue(position));
|
|
37
|
+
const localPreferredPosition = computed(() => toValue(preferredPosition));
|
|
38
|
+
|
|
39
|
+
const preferredOpenDirectionY = ref(localPreferredPosition.value?.y || Position.Bottom);
|
|
40
|
+
const preferredOpenDirectionX = ref(localPreferredPosition.value?.x || Position.Left);
|
|
41
|
+
|
|
42
|
+
const isTop = computed(() => {
|
|
43
|
+
if (localPosition.value.y !== Position.Auto) {
|
|
44
|
+
return localPosition.value.y === Position.Top;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return preferredOpenDirectionY.value === Position.Top;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const isLeft = computed(() => {
|
|
51
|
+
if (localPosition.value.x !== Position.Auto) {
|
|
52
|
+
return localPosition.value.x === Position.Left;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return preferredOpenDirectionX.value === Position.Left;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const isBottom = computed(() => {
|
|
59
|
+
if (localPosition.value.y !== Position.Auto) {
|
|
60
|
+
return localPosition.value.y === Position.Bottom;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return preferredOpenDirectionY.value === Position.Bottom;
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const isRight = computed(() => {
|
|
67
|
+
if (localPosition.value.x !== Position.Auto) {
|
|
68
|
+
return localPosition.value.x === Position.Right;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return preferredOpenDirectionX.value === Position.Right;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
function adjustPositionY(): void {
|
|
75
|
+
if (isSSR || !localAnchorElement.value || !localTargetElement.value) return;
|
|
76
|
+
|
|
77
|
+
const spaceAbove = localAnchorElement.value.getBoundingClientRect().top;
|
|
78
|
+
const spaceBelow = window.innerHeight - localAnchorElement.value.getBoundingClientRect().bottom;
|
|
79
|
+
const hasEnoughSpaceBelow =
|
|
80
|
+
spaceBelow > localTargetElement.value.getBoundingClientRect().height;
|
|
81
|
+
const hasEnoughSpaceAbove =
|
|
82
|
+
spaceAbove > localTargetElement.value.getBoundingClientRect().height;
|
|
83
|
+
|
|
84
|
+
if (localPreferredPosition.value.y === Position.Bottom) {
|
|
85
|
+
preferredOpenDirectionY.value =
|
|
86
|
+
hasEnoughSpaceBelow || spaceBelow > spaceAbove ? Position.Bottom : Position.Top;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (localPreferredPosition.value.y === Position.Top) {
|
|
90
|
+
preferredOpenDirectionY.value =
|
|
91
|
+
hasEnoughSpaceAbove || spaceAbove > spaceBelow ? Position.Top : Position.Bottom;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function adjustPositionX(): void {
|
|
96
|
+
if (isSSR || !localAnchorElement.value || !localTargetElement.value) return;
|
|
97
|
+
|
|
98
|
+
const spaceRight = localAnchorElement.value.getBoundingClientRect().right;
|
|
99
|
+
const spaceLeft = window.innerWidth - localAnchorElement.value.getBoundingClientRect().left;
|
|
100
|
+
const hasEnoughSpaceLeft = spaceLeft > localTargetElement.value.getBoundingClientRect().width;
|
|
101
|
+
const hasEnoughSpaceRight = spaceRight > localTargetElement.value.getBoundingClientRect().width;
|
|
102
|
+
|
|
103
|
+
if (localPreferredPosition.value.x === Position.Right) {
|
|
104
|
+
preferredOpenDirectionX.value =
|
|
105
|
+
hasEnoughSpaceRight || spaceRight > spaceLeft ? Position.Right : Position.Left;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (localPreferredPosition.value.x === Position.Left) {
|
|
109
|
+
preferredOpenDirectionX.value =
|
|
110
|
+
hasEnoughSpaceLeft || spaceLeft > spaceRight ? Position.Left : Position.Right;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return { isTop, isRight, isBottom, isLeft, adjustPositionY, adjustPositionX };
|
|
115
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export default function useBreakpoint(): {
|
|
2
|
+
isLaptopBreakpoint: import("vue").ComputedRef<boolean>;
|
|
3
|
+
isTabletBreakpoint: import("vue").ComputedRef<boolean>;
|
|
4
|
+
isMobileBreakpoint: import("vue").ComputedRef<boolean>;
|
|
5
|
+
isPortableBreakpoint: import("vue").ComputedRef<boolean>;
|
|
6
|
+
elementSize: import("vue").ComputedRef<string>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { onMounted, ref, watch, computed, onBeforeUnmount } from "vue";
|
|
2
|
+
import { isSSR } from "../utils/utilHelper.js";
|
|
3
|
+
|
|
4
|
+
import type { Ref } from "vue";
|
|
5
|
+
|
|
6
|
+
const BREAKPOINT_NAME = {
|
|
7
|
+
xs: "xs",
|
|
8
|
+
sm: "sm",
|
|
9
|
+
md: "md",
|
|
10
|
+
lg: "lg",
|
|
11
|
+
xl: "xl",
|
|
12
|
+
"2xl": "2xl",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const BREAKPOINT = {
|
|
16
|
+
xs: 0,
|
|
17
|
+
sm: 640,
|
|
18
|
+
md: 768,
|
|
19
|
+
lg: 1024,
|
|
20
|
+
xl: 1280,
|
|
21
|
+
"2xl": 1536,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const mobileDevices = ["xs", "sm"];
|
|
25
|
+
const portableDevices = ["xs", "sm", "md"];
|
|
26
|
+
|
|
27
|
+
export default function useBreakpoint() {
|
|
28
|
+
let timeout: number;
|
|
29
|
+
|
|
30
|
+
const windowWidth: Ref<number | undefined> = ref(undefined);
|
|
31
|
+
const currentBreakpoint = ref(BREAKPOINT_NAME.xs);
|
|
32
|
+
|
|
33
|
+
const isMobileBreakpoint = computed(() => {
|
|
34
|
+
return mobileDevices.includes(currentBreakpoint.value);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const isTabletBreakpoint = computed(() => {
|
|
38
|
+
return mobileDevices.includes(currentBreakpoint.value);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const isLaptopBreakpoint = computed(() => {
|
|
42
|
+
return currentBreakpoint.value === BREAKPOINT_NAME.lg;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const isPortableBreakpoint = computed(() => {
|
|
46
|
+
return portableDevices.includes(currentBreakpoint.value);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const elementSize = computed(() => {
|
|
50
|
+
return isMobileBreakpoint.value ? BREAKPOINT_NAME.md : BREAKPOINT_NAME.lg;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
onMounted(() => {
|
|
54
|
+
if (isSSR) return;
|
|
55
|
+
|
|
56
|
+
windowWidth.value = window.innerWidth;
|
|
57
|
+
|
|
58
|
+
window.addEventListener("resize", resizeListener, { passive: true });
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
onBeforeUnmount(() => {
|
|
62
|
+
if (isSSR) return;
|
|
63
|
+
|
|
64
|
+
window.removeEventListener("resize", resizeListener);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
watch(windowWidth, setBreakpoint, { immediate: true });
|
|
68
|
+
|
|
69
|
+
function resizeListener() {
|
|
70
|
+
if (isSSR) return;
|
|
71
|
+
|
|
72
|
+
if (timeout) {
|
|
73
|
+
window.cancelAnimationFrame(timeout);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
timeout = window.requestAnimationFrame(() => {
|
|
77
|
+
windowWidth.value = window.innerWidth;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function setBreakpoint(newWindowWidth: number | undefined) {
|
|
82
|
+
if (newWindowWidth === undefined) return;
|
|
83
|
+
|
|
84
|
+
currentBreakpoint.value = "xs";
|
|
85
|
+
|
|
86
|
+
if (newWindowWidth >= BREAKPOINT.sm && newWindowWidth < BREAKPOINT.md) {
|
|
87
|
+
currentBreakpoint.value = "sm";
|
|
88
|
+
} else if (newWindowWidth >= BREAKPOINT.md && newWindowWidth < BREAKPOINT.lg) {
|
|
89
|
+
currentBreakpoint.value = "md";
|
|
90
|
+
} else if (newWindowWidth >= BREAKPOINT.lg && newWindowWidth < BREAKPOINT.xl) {
|
|
91
|
+
currentBreakpoint.value = "lg";
|
|
92
|
+
} else if (newWindowWidth >= BREAKPOINT.xl && newWindowWidth < BREAKPOINT["2xl"]) {
|
|
93
|
+
currentBreakpoint.value = "xl";
|
|
94
|
+
} else if (newWindowWidth >= BREAKPOINT["2xl"]) {
|
|
95
|
+
currentBreakpoint.value = "2xl";
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
isLaptopBreakpoint,
|
|
101
|
+
isTabletBreakpoint,
|
|
102
|
+
isMobileBreakpoint,
|
|
103
|
+
isPortableBreakpoint,
|
|
104
|
+
elementSize,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { inject } from "vue";
|
|
2
|
+
import createVuelessAdapter from "../adatper.locale/vueless.js";
|
|
3
|
+
|
|
4
|
+
export const LocaleSymbol = Symbol.for("vueless:locale");
|
|
5
|
+
|
|
6
|
+
function isLocaleInstance(obj): boolean {
|
|
7
|
+
return obj.name !== null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function createLocale(options) {
|
|
11
|
+
const i18n =
|
|
12
|
+
options?.adapter && isLocaleInstance(options?.adapter)
|
|
13
|
+
? options?.adapter
|
|
14
|
+
: createVuelessAdapter(options);
|
|
15
|
+
|
|
16
|
+
return { ...i18n };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function useLocale() {
|
|
20
|
+
const locale = inject(LocaleSymbol);
|
|
21
|
+
|
|
22
|
+
if (!locale) throw new Error("[vueless] Could not find injected locale instance");
|
|
23
|
+
|
|
24
|
+
return locale;
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Ref } from "vue";
|
|
2
|
+
export declare function useMutationObserver(target: Ref<HTMLElement | null>, callBack: () => void, config?: {
|
|
3
|
+
childList: boolean;
|
|
4
|
+
attributes: boolean;
|
|
5
|
+
characterData: boolean;
|
|
6
|
+
}): {
|
|
7
|
+
observer: MutationObserver;
|
|
8
|
+
} | undefined;
|