vueless 0.0.3 → 0.0.5
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/.browserslistrc +4 -0
- package/.editorconfig +12 -0
- package/.eslintignore +7 -0
- package/.eslintrc.js +59 -0
- package/.storybook/configs/main.config.js +20 -0
- package/.storybook/decorators/vue3SourceDecorator.js +119 -0
- package/.storybook/main.js +20 -0
- package/.storybook/manager-head.html +10 -0
- package/.storybook/manager.js +6 -0
- package/.storybook/preview-head.html +72 -0
- package/.storybook/preview.js +50 -0
- package/.storybook/themes/vueless.docs.theme.js +41 -0
- package/.storybook/themes/vueless.theme.js +45 -0
- package/.web-types-gen/lib/config.js +32 -0
- package/LICENSE +21 -0
- package/README.md +174 -0
- package/index.pcss +3 -0
- package/package.json +53 -36
- package/postcss.config.js +9 -0
- package/public/images/logo.png +0 -0
- package/{composable.ui → src/composable.ui}/index.js +4 -1
- package/src/library.web-types-gen/index.js +17 -0
- package/src/library.web-types-gen/lib/build.js +252 -0
- package/src/library.web-types-gen/package.json +3 -0
- package/{plugin.vite → src/plugin.vite}/services/iconResolver.service.js +1 -1
- package/{plugin.vite → src/plugin.vite}/services/tailwindSafelist.service.js +0 -2
- package/{service.tailwind → src/service.tailwind}/index.js +2 -0
- package/{service.ui → src/service.ui}/index.js +1 -1
- package/{ui.button-toggle-item → src/ui.button}/Docs.mdx +1 -1
- package/{ui.button → src/ui.button}/composables/attrs.composable.js +2 -2
- package/{ui.button → src/ui.button}/configs/default.config.js +1 -0
- package/{ui.button → src/ui.button}/index.stories.js +5 -5
- package/{ui.button → src/ui.button}/index.vue +3 -4
- package/{ui.button-toggle → src/ui.button-link}/Docs.mdx +1 -1
- package/{ui.button-link → src/ui.button-link}/composables/attrs.composable.js +2 -2
- package/{ui.button-link → src/ui.button-link}/configs/default.config.js +2 -2
- package/{ui.button-link → src/ui.button-link}/index.stories.js +4 -4
- package/{ui.button-link → src/ui.button-link}/index.vue +3 -3
- package/{ui.button-link → src/ui.button-toggle}/Docs.mdx +1 -1
- package/{ui.button-toggle → src/ui.button-toggle}/composables/attrs.composable.js +1 -1
- package/{ui.button-toggle → src/ui.button-toggle}/index.stories.js +5 -5
- package/{ui.button-toggle → src/ui.button-toggle}/index.vue +2 -2
- package/{ui.button → src/ui.button-toggle-item}/Docs.mdx +1 -1
- package/{ui.button-toggle-item → src/ui.button-toggle-item}/composables/attrs.composable.js +2 -2
- package/{ui.button-toggle-item → src/ui.button-toggle-item}/index.stories.js +3 -3
- package/{ui.button-toggle-item → src/ui.button-toggle-item}/index.vue +2 -2
- package/{ui.container-accordion → src/ui.container-accordion}/composables/attrs.composable.js +2 -2
- package/{ui.container-accordion → src/ui.container-accordion}/index.stories.js +4 -4
- package/{ui.container-accordion → src/ui.container-accordion}/index.vue +2 -2
- package/src/ui.container-card/Docs.mdx +16 -0
- package/{ui.container-card → src/ui.container-card}/composable/attrs.composable.js +2 -2
- package/{ui.container-card → src/ui.container-card}/index.stories.js +7 -7
- package/{ui.container-card → src/ui.container-card}/index.vue +3 -3
- package/src/ui.container-divider/Docs.mdx +16 -0
- package/{ui.container-divider → src/ui.container-divider}/composables/attrs.composable.js +2 -2
- package/{ui.container-divider → src/ui.container-divider}/index.stories.js +3 -3
- package/{ui.container-divider → src/ui.container-divider}/index.vue +1 -1
- package/src/ui.container-group/Docs.mdx +16 -0
- package/{ui.container-group → src/ui.container-group}/composables/attrs.composable.js +2 -2
- package/{ui.container-group → src/ui.container-group}/index.stories.js +4 -4
- package/{ui.container-group → src/ui.container-group}/index.vue +3 -3
- package/src/ui.container-groups/Docs.mdx +16 -0
- package/{ui.container-groups → src/ui.container-groups}/composables/attrs.composable.js +1 -1
- package/{ui.container-groups → src/ui.container-groups}/index.stories.js +4 -4
- package/src/ui.container-modal/Docs.mdx +16 -0
- package/{ui.container-modal → src/ui.container-modal}/composables/attrs.composable.js +2 -2
- package/{ui.container-modal → src/ui.container-modal}/index.stories.js +9 -9
- package/{ui.container-modal → src/ui.container-modal}/index.vue +4 -4
- package/src/ui.container-modal-confirm/Docs.mdx +16 -0
- package/{ui.container-modal-confirm → src/ui.container-modal-confirm}/composable/attrs.composable.js +3 -2
- package/{ui.container-modal-confirm → src/ui.container-modal-confirm}/configs/default.config.js +3 -0
- package/{ui.container-modal-confirm → src/ui.container-modal-confirm}/index.stories.js +6 -6
- package/{ui.container-modal-confirm → src/ui.container-modal-confirm}/index.vue +5 -19
- package/src/ui.container-page/Docs.mdx +16 -0
- package/{ui.container-page → src/ui.container-page}/composables/attrs.composable.js +2 -2
- package/{ui.container-page → src/ui.container-page}/index.stories.js +10 -10
- package/{ui.container-page → src/ui.container-page}/index.vue +1 -1
- package/src/ui.container-row/Docs.mdx +16 -0
- package/{ui.container-row → src/ui.container-row}/composables/attrs.composable.js +2 -2
- package/{ui.container-row → src/ui.container-row}/index.stories.js +3 -3
- package/{ui.container-row → src/ui.container-row}/index.vue +1 -1
- package/{ui.data-list → src/ui.data-list}/composables/attrs.composable.js +2 -2
- package/{ui.data-list → src/ui.data-list}/index.stories.js +3 -3
- package/{ui.data-list → src/ui.data-list}/index.vue +3 -3
- package/src/ui.data-table/Docs.mdx +16 -0
- package/{ui.data-table → src/ui.data-table}/composables/attrs.composable.js +10 -10
- package/{ui.data-table → src/ui.data-table}/configs/default.config.js +6 -0
- package/{ui.data-table → src/ui.data-table}/index.stories.js +8 -8
- package/{ui.data-table → src/ui.data-table}/index.vue +20 -35
- package/{ui.data-table-cell → src/ui.data-table-cell}/composables/attrs.composable.js +2 -2
- package/{ui.data-table-cell → src/ui.data-table-cell}/index.vue +1 -1
- package/src/ui.dropdown-badge/Docs.mdx +16 -0
- package/{ui.dropdown-badge → src/ui.dropdown-badge}/composables/attrs.composable.js +2 -2
- package/{ui.dropdown-badge → src/ui.dropdown-badge}/index.stories.js +4 -4
- package/{ui.dropdown-badge → src/ui.dropdown-badge}/index.vue +4 -4
- package/src/ui.dropdown-button/Docs.mdx +16 -0
- package/{ui.dropdown-button → src/ui.dropdown-button}/composables/attrs.composable.js +2 -2
- package/{ui.dropdown-button → src/ui.dropdown-button}/index.stories.js +5 -5
- package/{ui.dropdown-button → src/ui.dropdown-button}/index.vue +5 -5
- package/src/ui.dropdown-item/Docs.mdx +16 -0
- package/{ui.dropdown-item → src/ui.dropdown-item}/composables/attrs.composable.js +1 -1
- package/{ui.dropdown-item → src/ui.dropdown-item}/index.stories.js +2 -2
- package/src/ui.dropdown-link/Docs.mdx +16 -0
- package/{ui.dropdown-link → src/ui.dropdown-link}/composables/attrs.composable.js +2 -2
- package/{ui.dropdown-link → src/ui.dropdown-link}/index.stories.js +4 -4
- package/{ui.dropdown-link → src/ui.dropdown-link}/index.vue +4 -4
- package/src/ui.dropdown-list/Docs.mdx +16 -0
- package/{ui.dropdown-list → src/ui.dropdown-list}/composables/attrs.composable.js +4 -2
- package/{ui.dropdown-list → src/ui.dropdown-list}/configs/default.config.js +6 -0
- package/{ui.dropdown-list → src/ui.dropdown-list}/index.stories.js +3 -3
- package/{ui.dropdown-list → src/ui.dropdown-list}/index.vue +9 -25
- package/{ui.form-calendar → src/ui.form-calendar}/Docs.mdx +2 -2
- package/{ui.form-calendar → src/ui.form-calendar}/components/DayView.vue +39 -1
- package/{ui.form-calendar → src/ui.form-calendar}/composables/attrs.composable.js +21 -2
- package/{ui.form-calendar → src/ui.form-calendar}/configs/default.config.js +12 -2
- package/{ui.form-calendar → src/ui.form-calendar}/constants/index.js +2 -0
- package/{ui.form-calendar → src/ui.form-calendar}/index.stories.js +11 -2
- package/{ui.form-calendar → src/ui.form-calendar}/index.vue +155 -45
- package/{ui.form-calendar → src/ui.form-calendar}/services/calendar.service.js +3 -15
- package/src/ui.form-calendar/services/date.service.js +282 -0
- package/src/ui.form-checkbox/Docs.mdx +16 -0
- package/{ui.form-checkbox → src/ui.form-checkbox}/composables/attrs.composable.js +2 -2
- package/{ui.form-checkbox → src/ui.form-checkbox}/configs/default.config.js +1 -1
- package/{ui.form-checkbox → src/ui.form-checkbox}/index.stories.js +5 -5
- package/{ui.form-checkbox → src/ui.form-checkbox}/index.vue +3 -3
- package/src/ui.form-checkbox-group/Docs.mdx +16 -0
- package/{ui.form-checkbox-group → src/ui.form-checkbox-group}/composables/attrs.composable.js +1 -1
- package/{ui.form-checkbox-group → src/ui.form-checkbox-group}/index.stories.js +2 -2
- package/{ui.form-checkbox-group → src/ui.form-checkbox-group}/index.vue +3 -3
- package/src/ui.form-checkbox-multi-state/Docs.mdx +16 -0
- package/{ui.form-checkbox-multi-state → src/ui.form-checkbox-multi-state}/composables/attrs.composable.js +1 -1
- package/{ui.form-checkbox-multi-state → src/ui.form-checkbox-multi-state}/index.stories.js +3 -3
- package/{ui.form-checkbox-multi-state → src/ui.form-checkbox-multi-state}/index.vue +1 -1
- package/{ui.form-color-picker → src/ui.form-color-picker}/composables/attrs.composable.js +2 -2
- package/{ui.form-color-picker → src/ui.form-color-picker}/index.stories.js +3 -3
- package/{ui.form-color-picker → src/ui.form-color-picker}/index.vue +1 -1
- package/{ui.form-date-picker → src/ui.form-date-picker}/Docs.mdx +3 -3
- package/{ui.form-date-picker → src/ui.form-date-picker}/composables/attrs.composable.js +1 -1
- package/{ui.form-date-picker → src/ui.form-date-picker}/configs/default.config.js +0 -1
- package/{ui.form-date-picker → src/ui.form-date-picker}/index.stories.js +4 -4
- package/{ui.form-date-picker → src/ui.form-date-picker}/index.vue +2 -3
- package/src/ui.form-date-picker-range/composables/attrs.composable.js +100 -0
- package/src/ui.form-date-picker-range/configs/default.config.js +172 -0
- package/src/ui.form-date-picker-range/constants/index.js +23 -0
- package/src/ui.form-date-picker-range/index.stories.js +135 -0
- package/src/ui.form-date-picker-range/index.vue +929 -0
- package/src/ui.form-date-picker-range/services/dateRange.service.js +116 -0
- package/src/ui.form-date-picker-range/services/validation.service.js +22 -0
- package/src/ui.form-input/Docs.mdx +16 -0
- package/{ui.form-input → src/ui.form-input}/composables/attrs.composable.js +2 -2
- package/{ui.form-input → src/ui.form-input}/index.stories.js +5 -5
- package/{ui.form-input → src/ui.form-input}/index.vue +2 -2
- package/{ui.form-input-file → src/ui.form-input-file}/composables/attrs.composable.js +2 -2
- package/{ui.form-input-file → src/ui.form-input-file}/configs/default.config.js +9 -1
- package/{ui.form-input-file → src/ui.form-input-file}/index.stories.js +4 -4
- package/{ui.form-input-file → src/ui.form-input-file}/index.vue +14 -47
- package/src/ui.form-input-money/Docs.mdx +16 -0
- package/{ui.form-input-money → src/ui.form-input-money}/composables/attrs.composable.js +1 -1
- package/{ui.form-input-money → src/ui.form-input-money}/index.stories.js +4 -4
- package/{ui.form-input-money → src/ui.form-input-money}/index.vue +2 -2
- package/src/ui.form-input-number/Docs.mdx +16 -0
- package/{ui.form-input-number → src/ui.form-input-number}/composables/attrs.composable.js +2 -2
- package/{ui.form-input-number → src/ui.form-input-number}/index.stories.js +3 -3
- package/{ui.form-input-number → src/ui.form-input-number}/index.vue +1 -1
- package/{ui.form-input-rating → src/ui.form-input-rating}/composables/attrs.composable.js +2 -2
- package/{ui.form-input-rating → src/ui.form-input-rating}/index.stories.js +3 -3
- package/{ui.form-input-rating → src/ui.form-input-rating}/index.vue +2 -2
- package/{ui.form-input-search → src/ui.form-input-search}/composables/attrs.composable.js +1 -1
- package/{ui.form-input-search → src/ui.form-input-search}/index.stories.js +4 -4
- package/{ui.form-input-search → src/ui.form-input-search}/index.vue +1 -2
- package/src/ui.form-label/Docs.mdx +16 -0
- package/{ui.form-label → src/ui.form-label}/composables/attrs.composable.js +2 -2
- package/{ui.form-label → src/ui.form-label}/index.stories.js +5 -5
- package/{ui.form-label → src/ui.form-label}/index.vue +1 -1
- package/src/ui.form-radio/Docs.mdx +16 -0
- package/{ui.form-radio → src/ui.form-radio}/composables/attrs.composable.js +2 -2
- package/{ui.form-radio → src/ui.form-radio}/index.stories.js +3 -3
- package/{ui.form-radio → src/ui.form-radio}/index.vue +1 -1
- package/src/ui.form-radio-card/Docs.mdx +16 -0
- package/{ui.form-radio-card → src/ui.form-radio-card}/composables/attrs.composable.js +8 -3
- package/{ui.form-radio-card → src/ui.form-radio-card}/configs/default.config.js +1 -1
- package/{ui.form-radio-card → src/ui.form-radio-card}/index.stories.js +3 -3
- package/{ui.form-radio-card → src/ui.form-radio-card}/index.vue +11 -21
- package/{ui.form-radio-card → src/ui.form-radio-card}/services/variant.service.js +1 -1
- package/src/ui.form-radio-group/Docs.mdx +16 -0
- package/{ui.form-radio-group → src/ui.form-radio-group}/composables/attrs.composable.js +2 -2
- package/{ui.form-radio-group → src/ui.form-radio-group}/index.stories.js +3 -3
- package/{ui.form-radio-group → src/ui.form-radio-group}/index.vue +1 -1
- package/src/ui.form-select/Docs.mdx +16 -0
- package/{ui.form-select → src/ui.form-select}/composables/attrs.composable.js +2 -2
- package/{ui.form-select → src/ui.form-select}/configs/default.config.js +7 -0
- package/{ui.form-select → src/ui.form-select}/index.stories.js +4 -4
- package/{ui.form-select → src/ui.form-select}/index.vue +38 -72
- package/{ui.form-switch → src/ui.form-switch}/composables/attrs.composable.js +2 -2
- package/{ui.form-switch → src/ui.form-switch}/configs/default.config.js +4 -0
- package/{ui.form-switch → src/ui.form-switch}/index.stories.js +4 -4
- package/{ui.form-switch → src/ui.form-switch}/index.vue +3 -23
- package/{ui.form-switch → src/ui.form-switch}/services/variant.service.js +1 -1
- package/src/ui.form-textarea/Docs.mdx +16 -0
- package/{ui.form-textarea → src/ui.form-textarea}/composables/attrs.composable.js +2 -2
- package/{ui.form-textarea → src/ui.form-textarea}/index.stories.js +5 -5
- package/{ui.form-textarea → src/ui.form-textarea}/index.vue +2 -2
- package/{ui.image-avatar → src/ui.image-avatar}/composables/attrs.composable.js +2 -2
- package/{ui.image-avatar → src/ui.image-avatar}/index.stories.js +3 -3
- package/{ui.image-avatar → src/ui.image-avatar}/index.vue +1 -1
- package/src/ui.image-icon/Docs.mdx +16 -0
- package/{ui.image-icon → src/ui.image-icon}/composables/attrs.composable.js +2 -2
- package/{ui.image-icon → src/ui.image-icon}/index.stories.js +3 -3
- package/{ui.image-icon → src/ui.image-icon}/index.vue +1 -1
- package/{ui.image-logo → src/ui.image-logo}/composables/attrs.composable.js +2 -2
- package/{ui.image-logo → src/ui.image-logo}/index.stories.js +3 -3
- package/{ui.image-logo → src/ui.image-logo}/index.vue +1 -1
- package/src/ui.loader-rendering/index.vue +72 -0
- package/src/ui.loader-rendering/store/index.js +17 -0
- package/src/ui.loader-top/components/TopProgress.vue +277 -0
- package/src/ui.loader-top/index.vue +221 -0
- package/src/ui.loader-top/store/index.js +59 -0
- package/{ui.navigation-pagination → src/ui.navigation-pagination}/composables/attrs.composable.js +2 -2
- package/{ui.navigation-pagination → src/ui.navigation-pagination}/index.stories.js +2 -2
- package/{ui.navigation-pagination → src/ui.navigation-pagination}/index.vue +2 -2
- package/{ui.navigation-stepper → src/ui.navigation-stepper}/composables/attrs.composable.js +1 -1
- package/{ui.navigation-stepper → src/ui.navigation-stepper}/index.stories.js +2 -2
- package/{ui.navigation-stepper → src/ui.navigation-stepper}/index.vue +2 -2
- package/{ui.navigation-tab → src/ui.navigation-tab}/composables/attrs.composable.js +2 -2
- package/{ui.navigation-tab → src/ui.navigation-tab}/index.stories.js +3 -3
- package/{ui.navigation-tab → src/ui.navigation-tab}/index.vue +1 -1
- package/{ui.navigation-tabs → src/ui.navigation-tabs}/composables/attrs.composable.js +2 -2
- package/{ui.navigation-tabs → src/ui.navigation-tabs}/index.stories.js +2 -2
- package/{ui.navigation-tabs → src/ui.navigation-tabs}/index.vue +2 -2
- package/src/ui.notify/index.stories.js +102 -0
- package/src/ui.notify/index.vue +248 -0
- package/src/ui.notify/services/index.js +87 -0
- package/{ui.other-dot → src/ui.other-dot}/composables/attrs.composable.js +2 -2
- package/{ui.other-dot → src/ui.other-dot}/index.stories.js +3 -3
- package/{ui.other-dot → src/ui.other-dot}/index.vue +1 -1
- package/{ui.other-loader → src/ui.other-loader}/composables/attrs.composable.js +2 -2
- package/{ui.other-loader → src/ui.other-loader}/index.stories.js +3 -3
- package/{ui.other-loader → src/ui.other-loader}/index.vue +1 -1
- package/{ui.text-alert → src/ui.text-alert}/composables/attrs.composable.js +2 -2
- package/{ui.text-alert → src/ui.text-alert}/configs/default.config.js +1 -1
- package/{ui.text-alert → src/ui.text-alert}/index.stories.js +3 -3
- package/{ui.text-alert → src/ui.text-alert}/index.vue +2 -2
- package/src/ui.text-badge/Docs.mdx +16 -0
- package/{ui.text-badge → src/ui.text-badge}/composables/attrs.composable.js +2 -2
- package/{ui.text-badge → src/ui.text-badge}/index.stories.js +5 -5
- package/{ui.text-badge → src/ui.text-badge}/index.vue +1 -1
- package/{ui.text-block → src/ui.text-block}/composables/attrs.composable.js +2 -2
- package/{ui.text-block → src/ui.text-block}/index.stories.js +3 -3
- package/{ui.text-block → src/ui.text-block}/index.vue +1 -1
- package/src/ui.text-empty/Docs.mdx +16 -0
- package/{ui.text-empty → src/ui.text-empty}/composables/attrs.composable.js +2 -2
- package/{ui.text-empty → src/ui.text-empty}/index.stories.js +5 -5
- package/{ui.text-empty → src/ui.text-empty}/index.vue +1 -1
- package/{ui.text-file → src/ui.text-file}/composables/attrs.composable.js +2 -2
- package/{ui.text-file → src/ui.text-file}/index.stories.js +2 -2
- package/{ui.text-file → src/ui.text-file}/index.vue +3 -3
- package/{ui.text-files → src/ui.text-files}/composables/attrs.composable.js +1 -1
- package/{ui.text-files → src/ui.text-files}/index.stories.js +2 -2
- package/{ui.text-files → src/ui.text-files}/index.vue +2 -2
- package/src/ui.text-header/Docs.mdx +16 -0
- package/{ui.text-header → src/ui.text-header}/composables/attrs.composable.js +2 -2
- package/{ui.text-header → src/ui.text-header}/index.stories.js +3 -3
- package/{ui.text-header → src/ui.text-header}/index.vue +1 -1
- package/src/ui.text-money/Docs.mdx +16 -0
- package/{ui.text-money → src/ui.text-money}/composables/attrs.composable.js +2 -2
- package/{ui.text-money → src/ui.text-money}/index.stories.js +6 -6
- package/{ui.text-money → src/ui.text-money}/index.vue +1 -1
- package/src/ui.viewport/index.vue +78 -0
- package/src/ui.viewport/store/index.js +47 -0
- package/tailwind.config.js +69 -0
- package/vite.config.mjs +39 -0
- package/vueless.config.js +7 -0
- package/web-types.json +7187 -0
- package/library.vue-tailwind-3/TDatepicker/components/t-date-trigger.js +0 -257
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-navigator.js +0 -600
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-time-selector.js +0 -522
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-views-view-calendar-days-day.js +0 -289
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-views-view-calendar-days.js +0 -236
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-views-view-calendar-headers.js +0 -64
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-views-view-calendar.js +0 -159
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-views-view-months-month.js +0 -106
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-views-view-months.js +0 -97
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-views-view-years-year.js +0 -117
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-views-view-years.js +0 -104
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-views-view.js +0 -294
- package/library.vue-tailwind-3/TDatepicker/components/t-datepicker-views.js +0 -212
- package/library.vue-tailwind-3/TDatepicker/components/t-toggle.js +0 -323
- package/library.vue-tailwind-3/TDatepicker/index.js +0 -1051
- package/library.vue-tailwind-3/base/Component.js +0 -126
- package/library.vue-tailwind-3/base/HtmlInput.js +0 -38
- package/library.vue-tailwind-3/base/TextInput.js +0 -102
- package/library.vue-tailwind-3/index.js +0 -7
- package/library.vue-tailwind-3/l10n/ar.js +0 -27
- package/library.vue-tailwind-3/l10n/at.js +0 -29
- package/library.vue-tailwind-3/l10n/az.js +0 -40
- package/library.vue-tailwind-3/l10n/be.js +0 -35
- package/library.vue-tailwind-3/l10n/bg.js +0 -41
- package/library.vue-tailwind-3/l10n/bn.js +0 -39
- package/library.vue-tailwind-3/l10n/bs.js +0 -28
- package/library.vue-tailwind-3/l10n/cat.js +0 -59
- package/library.vue-tailwind-3/l10n/cs.js +0 -35
- package/library.vue-tailwind-3/l10n/cy.js +0 -68
- package/library.vue-tailwind-3/l10n/da.js +0 -31
- package/library.vue-tailwind-3/l10n/de.js +0 -30
- package/library.vue-tailwind-3/l10n/default.js +0 -54
- package/library.vue-tailwind-3/l10n/eo.js +0 -31
- package/library.vue-tailwind-3/l10n/es.js +0 -32
- package/library.vue-tailwind-3/l10n/et.js +0 -46
- package/library.vue-tailwind-3/l10n/fa.js +0 -41
- package/library.vue-tailwind-3/l10n/fi.js +0 -50
- package/library.vue-tailwind-3/l10n/fo.js +0 -40
- package/library.vue-tailwind-3/l10n/fr.js +0 -48
- package/library.vue-tailwind-3/l10n/ga.js +0 -36
- package/library.vue-tailwind-3/l10n/gr.js +0 -33
- package/library.vue-tailwind-3/l10n/he.js +0 -41
- package/library.vue-tailwind-3/l10n/hi.js +0 -39
- package/library.vue-tailwind-3/l10n/hr.js +0 -41
- package/library.vue-tailwind-3/l10n/hu.js +0 -46
- package/library.vue-tailwind-3/l10n/id.js +0 -30
- package/library.vue-tailwind-3/l10n/index.js +0 -127
- package/library.vue-tailwind-3/l10n/is.js +0 -40
- package/library.vue-tailwind-3/l10n/it.js +0 -31
- package/library.vue-tailwind-3/l10n/ja.js +0 -42
- package/library.vue-tailwind-3/l10n/ka.js +0 -35
- package/library.vue-tailwind-3/l10n/km.js +0 -45
- package/library.vue-tailwind-3/l10n/ko.js +0 -41
- package/library.vue-tailwind-3/l10n/kz.js +0 -34
- package/library.vue-tailwind-3/l10n/lt.js +0 -41
- package/library.vue-tailwind-3/l10n/lv.js +0 -37
- package/library.vue-tailwind-3/l10n/mk.js +0 -30
- package/library.vue-tailwind-3/l10n/mn.js +0 -42
- package/library.vue-tailwind-3/l10n/ms.js +0 -28
- package/library.vue-tailwind-3/l10n/my.js +0 -42
- package/library.vue-tailwind-3/l10n/nl.js +0 -48
- package/library.vue-tailwind-3/l10n/no.js +0 -31
- package/library.vue-tailwind-3/l10n/pa.js +0 -27
- package/library.vue-tailwind-3/l10n/pl.js +0 -31
- package/library.vue-tailwind-3/l10n/pt.js +0 -36
- package/library.vue-tailwind-3/l10n/ro.js +0 -29
- package/library.vue-tailwind-3/l10n/ru.js +0 -48
- package/library.vue-tailwind-3/l10n/si.js +0 -40
- package/library.vue-tailwind-3/l10n/sk.js +0 -32
- package/library.vue-tailwind-3/l10n/sl.js +0 -32
- package/library.vue-tailwind-3/l10n/sq.js +0 -27
- package/library.vue-tailwind-3/l10n/sr-cyr.js +0 -29
- package/library.vue-tailwind-3/l10n/sr.js +0 -30
- package/library.vue-tailwind-3/l10n/sv.js +0 -30
- package/library.vue-tailwind-3/l10n/th.js +0 -43
- package/library.vue-tailwind-3/l10n/tr.js +0 -32
- package/library.vue-tailwind-3/l10n/uk.js +0 -28
- package/library.vue-tailwind-3/l10n/uz.js +0 -35
- package/library.vue-tailwind-3/l10n/uz_latn.js +0 -48
- package/library.vue-tailwind-3/l10n/vn.js +0 -41
- package/library.vue-tailwind-3/l10n/zh-tw.js +0 -41
- package/library.vue-tailwind-3/l10n/zh.js +0 -41
- package/library.vue-tailwind-3/services/date.service.js +0 -294
- package/library.vue-tailwind-3/services/formatting.service.js +0 -205
- package/library.vue-tailwind-3/services/vueTailwind.service.js +0 -41
- package/library.vue-tailwind-3/t-alert.js +0 -151
- package/library.vue-tailwind-3/t-button.js +0 -243
- package/library.vue-tailwind-3/t-card.js +0 -98
- package/library.vue-tailwind-3/t-checkbox.js +0 -292
- package/library.vue-tailwind-3/t-dropdown.js +0 -322
- package/library.vue-tailwind-3/t-radio.js +0 -301
- package/ui.container-card/Docs.mdx +0 -16
- package/ui.container-divider/Docs.mdx +0 -16
- package/ui.container-group/Docs.mdx +0 -16
- package/ui.container-groups/Docs.mdx +0 -16
- package/ui.container-modal/Docs.mdx +0 -16
- package/ui.container-modal-confirm/Docs.mdx +0 -16
- package/ui.container-page/Docs.mdx +0 -16
- package/ui.container-row/Docs.mdx +0 -16
- package/ui.data-table/Docs.mdx +0 -16
- package/ui.dropdown-badge/Docs.mdx +0 -16
- package/ui.dropdown-button/Docs.mdx +0 -16
- package/ui.dropdown-item/Docs.mdx +0 -16
- package/ui.dropdown-link/Docs.mdx +0 -16
- package/ui.dropdown-list/Docs.mdx +0 -16
- package/ui.form-calendar/services/date.service.js +0 -121
- package/ui.form-checkbox/Docs.mdx +0 -16
- package/ui.form-checkbox-group/Docs.mdx +0 -16
- package/ui.form-checkbox-multi-state/Docs.mdx +0 -16
- package/ui.form-input/Docs.mdx +0 -16
- package/ui.form-input-money/Docs.mdx +0 -16
- package/ui.form-input-number/Docs.mdx +0 -16
- package/ui.form-label/Docs.mdx +0 -16
- package/ui.form-radio/Docs.mdx +0 -16
- package/ui.form-radio-card/Docs.mdx +0 -16
- package/ui.form-radio-group/Docs.mdx +0 -16
- package/ui.form-select/Docs.mdx +0 -16
- package/ui.form-textarea/Docs.mdx +0 -16
- package/ui.image-icon/Docs.mdx +0 -16
- package/ui.text-badge/Docs.mdx +0 -16
- package/ui.text-empty/Docs.mdx +0 -16
- package/ui.text-header/Docs.mdx +0 -16
- package/ui.text-money/Docs.mdx +0 -16
- /package/{library.web-types-gen → .web-types-gen}/index.js +0 -0
- /package/{library.web-types-gen → .web-types-gen}/lib/build.js +0 -0
- /package/{library.web-types-gen → .web-types-gen}/package.json +0 -0
- /package/{_readme → readme}/README.md +0 -0
- /package/{_readme → readme}/UGroup.md +0 -0
- /package/{_readme → readme}/UNotify.md +0 -0
- /package/{_readme → readme}/UPage.md +0 -0
- /package/{_readme → readme}/UTopLoader.md +0 -0
- /package/{_readme → readme}/customization.md +0 -0
- /package/{_readme → readme}/installation.md +0 -0
- /package/{_readme → readme}/storybook-pages/Customisation.mdx +0 -0
- /package/{_readme → readme}/storybook-pages/Installation.mdx +0 -0
- /package/{library.web-types-gen → src/library.web-types-gen}/lib/config.js +0 -0
- /package/{plugin.vite → src/plugin.vite}/index.js +0 -0
- /package/{plugin.vite → src/plugin.vite}/services/svgLoader.service.js +0 -0
- /package/{plugin.vite → src/plugin.vite}/services/unpluginComponentsResolver.js +0 -0
- /package/{service.storybook → src/service.storybook}/index.js +0 -0
- /package/{ui.button → src/ui.button}/constants/index.js +0 -0
- /package/{ui.button-link → src/ui.button-link}/constants/index.js +0 -0
- /package/{ui.button-toggle → src/ui.button-toggle}/configs/default.config.js +0 -0
- /package/{ui.button-toggle → src/ui.button-toggle}/constants/index.js +0 -0
- /package/{ui.button-toggle-item → src/ui.button-toggle-item}/configs/default.config.js +0 -0
- /package/{ui.button-toggle-item → src/ui.button-toggle-item}/constants/index.js +0 -0
- /package/{ui.container-accordion → src/ui.container-accordion}/configs/default.config.js +0 -0
- /package/{ui.container-accordion → src/ui.container-accordion}/constants/index.js +0 -0
- /package/{ui.container-card → src/ui.container-card}/configs/default.config.js +0 -0
- /package/{ui.container-card → src/ui.container-card}/constants/index.js +0 -0
- /package/{ui.container-divider → src/ui.container-divider}/configs/default.config.js +0 -0
- /package/{ui.container-divider → src/ui.container-divider}/constants/index.js +0 -0
- /package/{ui.container-group → src/ui.container-group}/configs/default.config.js +0 -0
- /package/{ui.container-group → src/ui.container-group}/constants/index.js +0 -0
- /package/{ui.container-groups → src/ui.container-groups}/configs/default.config.js +0 -0
- /package/{ui.container-groups → src/ui.container-groups}/index.vue +0 -0
- /package/{ui.container-modal → src/ui.container-modal}/configs/default.config.js +0 -0
- /package/{ui.container-modal → src/ui.container-modal}/constants/index.js +0 -0
- /package/{ui.container-modal-confirm → src/ui.container-modal-confirm}/constants/index.js +0 -0
- /package/{ui.container-page → src/ui.container-page}/configs/default.config.js +0 -0
- /package/{ui.container-page → src/ui.container-page}/constants/index.js +0 -0
- /package/{ui.container-row → src/ui.container-row}/configs/default.config.js +0 -0
- /package/{ui.container-row → src/ui.container-row}/constants/index.js +0 -0
- /package/{ui.data-list → src/ui.data-list}/configs/default.config.js +0 -0
- /package/{ui.data-list → src/ui.data-list}/constants/index.js +0 -0
- /package/{ui.data-table → src/ui.data-table}/constants/index.js +0 -0
- /package/{ui.data-table → src/ui.data-table}/services/table.service.js +0 -0
- /package/{ui.data-table-cell → src/ui.data-table-cell}/configs/default.config.js +0 -0
- /package/{ui.data-table-cell → src/ui.data-table-cell}/constants/index.js +0 -0
- /package/{ui.dropdown-badge → src/ui.dropdown-badge}/configs/default.config.js +0 -0
- /package/{ui.dropdown-badge → src/ui.dropdown-badge}/constants/index.js +0 -0
- /package/{ui.dropdown-button → src/ui.dropdown-button}/configs/default.config.js +0 -0
- /package/{ui.dropdown-button → src/ui.dropdown-button}/constants/index.js +0 -0
- /package/{ui.dropdown-item → src/ui.dropdown-item}/configs/default.config.js +0 -0
- /package/{ui.dropdown-item → src/ui.dropdown-item}/index.vue +0 -0
- /package/{ui.dropdown-link → src/ui.dropdown-link}/configs/default.config.js +0 -0
- /package/{ui.dropdown-link → src/ui.dropdown-link}/constants/index.js +0 -0
- /package/{ui.dropdown-list → src/ui.dropdown-list}/composables/usePointer.js +0 -0
- /package/{ui.dropdown-list → src/ui.dropdown-list}/constants/index.js +0 -0
- /package/{ui.form-calendar → src/ui.form-calendar}/components/MonthView.vue +0 -0
- /package/{ui.form-calendar → src/ui.form-calendar}/components/YearView.vue +0 -0
- /package/{ui.form-calendar → src/ui.form-calendar}/services/formatting.service.js +0 -0
- /package/{ui.form-checkbox → src/ui.form-checkbox}/constants/index.js +0 -0
- /package/{ui.form-checkbox-group → src/ui.form-checkbox-group}/configs/default.config.js +0 -0
- /package/{ui.form-checkbox-group → src/ui.form-checkbox-group}/constants/index.js +0 -0
- /package/{ui.form-checkbox-multi-state → src/ui.form-checkbox-multi-state}/configs/default.config.js +0 -0
- /package/{ui.form-checkbox-multi-state → src/ui.form-checkbox-multi-state}/constants/index.js +0 -0
- /package/{ui.form-color-picker → src/ui.form-color-picker}/configs/default.config.js +0 -0
- /package/{ui.form-color-picker → src/ui.form-color-picker}/constants/index.js +0 -0
- /package/{ui.form-date-picker → src/ui.form-date-picker}/constants/index.js +0 -0
- /package/{ui.form-input → src/ui.form-input}/assets/fonts/text-security-disc.woff +0 -0
- /package/{ui.form-input → src/ui.form-input}/configs/default.config.js +0 -0
- /package/{ui.form-input → src/ui.form-input}/constants/index.js +0 -0
- /package/{ui.form-input-file → src/ui.form-input-file}/constants/index.js +0 -0
- /package/{ui.form-input-money → src/ui.form-input-money}/composables/useFormatCurrency.js +0 -0
- /package/{ui.form-input-money → src/ui.form-input-money}/configs/default.config.js +0 -0
- /package/{ui.form-input-money → src/ui.form-input-money}/constants/index.js +0 -0
- /package/{ui.form-input-money → src/ui.form-input-money}/services/format.service.js +0 -0
- /package/{ui.form-input-number → src/ui.form-input-number}/configs/default.config.js +0 -0
- /package/{ui.form-input-number → src/ui.form-input-number}/constants/index.js +0 -0
- /package/{ui.form-input-rating → src/ui.form-input-rating}/configs/default.config.js +0 -0
- /package/{ui.form-input-rating → src/ui.form-input-rating}/constants/index.js +0 -0
- /package/{ui.form-input-search → src/ui.form-input-search}/configs/default.config.js +0 -0
- /package/{ui.form-input-search → src/ui.form-input-search}/constants/index.js +0 -0
- /package/{ui.form-label → src/ui.form-label}/configs/default.config.js +0 -0
- /package/{ui.form-label → src/ui.form-label}/constants/index.js +0 -0
- /package/{ui.form-radio → src/ui.form-radio}/configs/default.config.js +0 -0
- /package/{ui.form-radio → src/ui.form-radio}/constants/index.js +0 -0
- /package/{ui.form-radio-card → src/ui.form-radio-card}/constants/index.js +0 -0
- /package/{ui.form-radio-group → src/ui.form-radio-group}/configs/default.config.js +0 -0
- /package/{ui.form-radio-group → src/ui.form-radio-group}/constants/index.js +0 -0
- /package/{ui.form-select → src/ui.form-select}/constants/index.js +0 -0
- /package/{ui.form-select → src/ui.form-select}/services/select.service.js +0 -0
- /package/{ui.form-switch → src/ui.form-switch}/constants/index.js +0 -0
- /package/{ui.form-textarea → src/ui.form-textarea}/configs/default.config.js +0 -0
- /package/{ui.form-textarea → src/ui.form-textarea}/constants/index.js +0 -0
- /package/{ui.image-avatar → src/ui.image-avatar}/configs/default.config.js +0 -0
- /package/{ui.image-avatar → src/ui.image-avatar}/constants/index.js +0 -0
- /package/{ui.image-avatar → src/ui.image-avatar}/default-avatar.png +0 -0
- /package/{ui.image-icon → src/ui.image-icon}/configs/default.config.js +0 -0
- /package/{ui.image-icon → src/ui.image-icon}/constants/index.js +0 -0
- /package/{ui.image-logo → src/ui.image-logo}/configs/default.config.js +0 -0
- /package/{ui.image-logo → src/ui.image-logo}/constants/index.js +0 -0
- /package/{ui.navigation-pagination → src/ui.navigation-pagination}/configs/default.config.js +0 -0
- /package/{ui.navigation-pagination → src/ui.navigation-pagination}/constants/index.js +0 -0
- /package/{ui.navigation-stepper → src/ui.navigation-stepper}/configs/default.config.js +0 -0
- /package/{ui.navigation-stepper → src/ui.navigation-stepper}/constants/index.js +0 -0
- /package/{ui.navigation-tab → src/ui.navigation-tab}/configs/default.config.js +0 -0
- /package/{ui.navigation-tab → src/ui.navigation-tab}/constants/index.js +0 -0
- /package/{ui.navigation-tabs → src/ui.navigation-tabs}/configs/default.config.js +0 -0
- /package/{ui.navigation-tabs → src/ui.navigation-tabs}/constants/index.js +0 -0
- /package/{ui.other-dot → src/ui.other-dot}/configs/default.config.js +0 -0
- /package/{ui.other-dot → src/ui.other-dot}/constants/index.js +0 -0
- /package/{ui.other-loader → src/ui.other-loader}/configs/default.config.js +0 -0
- /package/{ui.other-loader → src/ui.other-loader}/constants/index.js +0 -0
- /package/{ui.text-alert → src/ui.text-alert}/constatns/index.js +0 -0
- /package/{ui.text-badge → src/ui.text-badge}/configs/default.config.js +0 -0
- /package/{ui.text-badge → src/ui.text-badge}/constants/index.js +0 -0
- /package/{ui.text-block → src/ui.text-block}/configs/default.config.js +0 -0
- /package/{ui.text-block → src/ui.text-block}/constatns/index.js +0 -0
- /package/{ui.text-empty → src/ui.text-empty}/configs/default.config.js +0 -0
- /package/{ui.text-empty → src/ui.text-empty}/constants/index.js +0 -0
- /package/{ui.text-file → src/ui.text-file}/configs/default.config.js +0 -0
- /package/{ui.text-files → src/ui.text-files}/configs/default.config.js +0 -0
- /package/{ui.text-files → src/ui.text-files}/constants/index.js +0 -0
- /package/{ui.text-header → src/ui.text-header}/configs/default.config.js +0 -0
- /package/{ui.text-header → src/ui.text-header}/constants/index.js +0 -0
- /package/{ui.text-money → src/ui.text-money}/assets/credit.svg +0 -0
- /package/{ui.text-money → src/ui.text-money}/assets/debit.svg +0 -0
- /package/{ui.text-money → src/ui.text-money}/configs/default.config.js +0 -0
- /package/{ui.text-money → src/ui.text-money}/constants/index.js +0 -0
- /package/{ui.text-money → src/ui.text-money}/services/money.services.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getArgTypes } from "
|
|
1
|
+
import { getArgTypes } from "../service.storybook";
|
|
2
2
|
|
|
3
|
-
import UDropdownList from "
|
|
4
|
-
import URow from "
|
|
3
|
+
import UDropdownList from "../ui.dropdown-list";
|
|
4
|
+
import URow from "../ui.container-row";
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
id: "2050",
|
|
@@ -30,7 +30,11 @@
|
|
|
30
30
|
<slot :option="option" name="before-option" />
|
|
31
31
|
|
|
32
32
|
<slot name="option" :option="option" :index="index">
|
|
33
|
-
<span
|
|
33
|
+
<span
|
|
34
|
+
:style="getMarginForSubCategory(option.level)"
|
|
35
|
+
v-bind="optionContentAttrs"
|
|
36
|
+
v-text="option[labelKey]"
|
|
37
|
+
/>
|
|
34
38
|
</slot>
|
|
35
39
|
|
|
36
40
|
<!-- @slot Use it to add something after option. -->
|
|
@@ -61,7 +65,7 @@
|
|
|
61
65
|
:empty-styles="optionClasses"
|
|
62
66
|
>
|
|
63
67
|
<span v-bind="optionAttrs()">
|
|
64
|
-
<span
|
|
68
|
+
<span v-text="config.i18n.noDataToShow" />
|
|
65
69
|
</span>
|
|
66
70
|
</slot>
|
|
67
71
|
|
|
@@ -69,7 +73,7 @@
|
|
|
69
73
|
<template v-if="addOption">
|
|
70
74
|
<div v-bind="addTitleWrapperAttrs" @click="onClickAddOption">
|
|
71
75
|
<div v-bind="addTitleAttrs">
|
|
72
|
-
{{ i18n.add }}
|
|
76
|
+
{{ config.i18n.add }}
|
|
73
77
|
<span v-bind="addTitleHotkeyAttrs" v-text="addOptionKeyCombination" />
|
|
74
78
|
</div>
|
|
75
79
|
</div>
|
|
@@ -87,8 +91,7 @@ import { computed, ref } from "vue";
|
|
|
87
91
|
import usePointer from "./composables/usePointer";
|
|
88
92
|
import useAttrs from "./composables/attrs.composable";
|
|
89
93
|
|
|
90
|
-
import
|
|
91
|
-
import UIService, { getRandomId, isMac } from "vueless/service.ui";
|
|
94
|
+
import UIService, { getRandomId, isMac } from "../service.ui";
|
|
92
95
|
|
|
93
96
|
import defaultConfig from "./configs/default.config.js";
|
|
94
97
|
|
|
@@ -205,7 +208,6 @@ const wrapperRef = ref(null);
|
|
|
205
208
|
|
|
206
209
|
const { pointer, pointerDirty, pointerSet, pointerBackward, pointerForward, pointerReset } =
|
|
207
210
|
usePointer(props.options, props.optionHeight, wrapperRef);
|
|
208
|
-
const { getTranslation } = new I18nServiceDefault();
|
|
209
211
|
|
|
210
212
|
const {
|
|
211
213
|
config,
|
|
@@ -222,17 +224,11 @@ const {
|
|
|
222
224
|
subGroupLabelAttrs,
|
|
223
225
|
groupLabelAttrs,
|
|
224
226
|
optionClasses,
|
|
227
|
+
optionContentAttrs,
|
|
225
228
|
} = useAttrs(props);
|
|
226
229
|
|
|
227
230
|
defineExpose({ pointerSet, pointerBackward, pointerForward, pointerReset, addPointerElement });
|
|
228
231
|
|
|
229
|
-
const i18n = computed(() => {
|
|
230
|
-
return {
|
|
231
|
-
noDataToShow: getTranslation("noDataToShow"),
|
|
232
|
-
add: getTranslation("add"),
|
|
233
|
-
};
|
|
234
|
-
});
|
|
235
|
-
|
|
236
232
|
const addOptionKeyCombination = computed(() => {
|
|
237
233
|
return isMac ? "(⌘ + Enter)" : "(Ctrl + Enter)";
|
|
238
234
|
});
|
|
@@ -284,15 +280,3 @@ function addPointerElement({ key } = "Enter") {
|
|
|
284
280
|
pointerReset();
|
|
285
281
|
}
|
|
286
282
|
</script>
|
|
287
|
-
|
|
288
|
-
<i18n>
|
|
289
|
-
en:
|
|
290
|
-
noDataToShow: "No data to show."
|
|
291
|
-
add: Add
|
|
292
|
-
ru:
|
|
293
|
-
noDataToShow: "Нет данных."
|
|
294
|
-
add: Добавить
|
|
295
|
-
ua:
|
|
296
|
-
noDataToShow: "Дані відсутні."
|
|
297
|
-
add: Додати
|
|
298
|
-
</i18n>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source, Markdown } from "@storybook/blocks";
|
|
2
|
-
import { getSource } from "
|
|
2
|
+
import { getSource } from "../service.storybook";
|
|
3
3
|
|
|
4
4
|
import * as stories from "./index.stories";
|
|
5
5
|
import defaultConfig from "./configs/default.config?raw"
|
|
@@ -49,4 +49,4 @@ Each character in the table below can be used in `dateFormat` and `userFormat` o
|
|
|
49
49
|
## Escaping Formatting Tokens
|
|
50
50
|
You may escape formatting tokens using \\\\.
|
|
51
51
|
|
|
52
|
-
<Source code={`dateFormat: "Y-m-d\\Z", // Displays: 2017-01-22Z`} language="jsx" dark />
|
|
52
|
+
<Source code={`dateFormat: "Y-m-d\\Z", // Displays: 2017-01-22Z`} language="jsx" dark />
|
|
@@ -40,6 +40,11 @@ const props = defineProps({
|
|
|
40
40
|
required: true,
|
|
41
41
|
},
|
|
42
42
|
|
|
43
|
+
selectedDateTo: {
|
|
44
|
+
type: [Date, null],
|
|
45
|
+
default: undefined,
|
|
46
|
+
},
|
|
47
|
+
|
|
43
48
|
activeDate: {
|
|
44
49
|
type: [Date, null],
|
|
45
50
|
required: true,
|
|
@@ -60,6 +65,11 @@ const props = defineProps({
|
|
|
60
65
|
required: true,
|
|
61
66
|
},
|
|
62
67
|
|
|
68
|
+
range: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false,
|
|
71
|
+
},
|
|
72
|
+
|
|
63
73
|
maxDate: {
|
|
64
74
|
type: [Date, String],
|
|
65
75
|
default: undefined,
|
|
@@ -88,6 +98,9 @@ const {
|
|
|
88
98
|
currentDayAttrs,
|
|
89
99
|
anotherMonthDayAttrs,
|
|
90
100
|
dayAttrs,
|
|
101
|
+
inRangeFirstDayAttrs,
|
|
102
|
+
inRangeLastDayAttrs,
|
|
103
|
+
inRangeDayAttrs,
|
|
91
104
|
} = useAttrs(props);
|
|
92
105
|
|
|
93
106
|
const localSelectedDate = computed(() => {
|
|
@@ -201,6 +214,23 @@ function getDayClasses(day) {
|
|
|
201
214
|
return [currentDayAttrs.value.class];
|
|
202
215
|
}
|
|
203
216
|
|
|
217
|
+
if (props.range && isSelectedDay(day)) {
|
|
218
|
+
return [inRangeFirstDayAttrs.value.class];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (props.range && isSelectedToDay(day)) {
|
|
222
|
+
return [inRangeLastDayAttrs.value.class];
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (
|
|
226
|
+
props.range &&
|
|
227
|
+
localSelectedDate.value &&
|
|
228
|
+
props.selectedDateTo &&
|
|
229
|
+
!dateIsOutOfRange(day, props.selectedDate, props.selectedDateTo, props.locale, props.dateFormat)
|
|
230
|
+
) {
|
|
231
|
+
return [inRangeDayAttrs.value.class];
|
|
232
|
+
}
|
|
233
|
+
|
|
204
234
|
if (isSelectedDay(day)) {
|
|
205
235
|
return [selectedDayAttrs.value.class];
|
|
206
236
|
}
|
|
@@ -218,8 +248,16 @@ function isSelectedDay(day) {
|
|
|
218
248
|
return isSameDay(day, localSelectedDate.value);
|
|
219
249
|
}
|
|
220
250
|
|
|
251
|
+
function isSelectedToDay(day) {
|
|
252
|
+
return isSameDay(day, props.selectedDateTo);
|
|
253
|
+
}
|
|
254
|
+
|
|
221
255
|
function onClickDay(day) {
|
|
222
|
-
|
|
256
|
+
const isSameDay = isSelectedDay(day) && props.selectedDate !== null;
|
|
257
|
+
const isSameDayInRange =
|
|
258
|
+
isSelectedDay(day) && props.selectedDate !== null && props.selectedDateTo && props.range;
|
|
259
|
+
|
|
260
|
+
if (isSameDay || isSameDayInRange) {
|
|
223
261
|
emit("input", null);
|
|
224
262
|
|
|
225
263
|
return;
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import useUI from "
|
|
1
|
+
import useUI from "../../composable.ui";
|
|
2
|
+
import { cva } from "../../service.ui";
|
|
3
|
+
|
|
4
|
+
import { computed } from "vue";
|
|
2
5
|
|
|
3
6
|
import defaultConfig from "../configs/default.config";
|
|
4
7
|
|
|
5
8
|
export default function useAttrs(props) {
|
|
6
9
|
const { config, getAttrs } = useUI(defaultConfig, () => props.config);
|
|
10
|
+
const { nextPrevWrapper } = config.value;
|
|
11
|
+
|
|
12
|
+
const cvaNextPrevWrapper = cva({
|
|
13
|
+
base: nextPrevWrapper.base,
|
|
14
|
+
variants: nextPrevWrapper.variants,
|
|
15
|
+
compoundVariants: nextPrevWrapper.compoundVariants,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const optionClasses = computed(() => cvaNextPrevWrapper({ range: props.range }));
|
|
7
19
|
|
|
8
20
|
const wrapperAttrs = getAttrs("wrapper");
|
|
9
21
|
const navigationAttrs = getAttrs("navigation");
|
|
@@ -21,6 +33,9 @@ export default function useAttrs(props) {
|
|
|
21
33
|
const activeDayAttrs = getAttrs("activeDay");
|
|
22
34
|
const selectedDayAttrs = getAttrs("selectedDay");
|
|
23
35
|
const currentDayAttrs = getAttrs("currentDay");
|
|
36
|
+
const inRangeDayAttrs = getAttrs("inRangeDay");
|
|
37
|
+
const inRangeFirstDayAttrs = getAttrs("inRangeFirstDay");
|
|
38
|
+
const inRangeLastDayAttrs = getAttrs("inRangeLastDay");
|
|
24
39
|
const anotherMonthDayAttrs = getAttrs("anotherMonthDay");
|
|
25
40
|
const monthViewWrapperAttrs = getAttrs("monthViewWrapper");
|
|
26
41
|
const selectedMonthAttrs = getAttrs("selectedMonth");
|
|
@@ -34,7 +49,8 @@ export default function useAttrs(props) {
|
|
|
34
49
|
const timepickerLeftInputAttrs = getAttrs("timepickerLeftInput");
|
|
35
50
|
const timepickerRightInputAttrs = getAttrs("timepickerRightInput");
|
|
36
51
|
const submitButtonAttrs = getAttrs("submitButton");
|
|
37
|
-
|
|
52
|
+
|
|
53
|
+
const nextPrevWrapperAttrs = getAttrs("nextPrevWrapper", { classes: optionClasses.value });
|
|
38
54
|
|
|
39
55
|
const dayAttrs = (classes = []) => {
|
|
40
56
|
return getAttrs("day", { classes }).value;
|
|
@@ -68,6 +84,9 @@ export default function useAttrs(props) {
|
|
|
68
84
|
currentDayAttrs,
|
|
69
85
|
anotherMonthDayAttrs,
|
|
70
86
|
dayAttrs,
|
|
87
|
+
inRangeDayAttrs,
|
|
88
|
+
inRangeFirstDayAttrs,
|
|
89
|
+
inRangeLastDayAttrs,
|
|
71
90
|
monthViewWrapperAttrs,
|
|
72
91
|
selectedMonthAttrs,
|
|
73
92
|
activeMonthAttrs,
|
|
@@ -6,7 +6,14 @@ export default /*tw*/ {
|
|
|
6
6
|
dayViewSwitchLabelMonth: "text-gray-900",
|
|
7
7
|
dayViewSwitchLabelIcon: "",
|
|
8
8
|
dayViewSwitchLabelIconName: "keyboard_arrow_right",
|
|
9
|
-
nextPrevWrapper:
|
|
9
|
+
nextPrevWrapper: {
|
|
10
|
+
base: "flex",
|
|
11
|
+
variants: {
|
|
12
|
+
range: {
|
|
13
|
+
true: "justify-between items-center w-full",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
10
17
|
nextPrevButton: "",
|
|
11
18
|
nextIcon: "",
|
|
12
19
|
nextIconName: "keyboard_arrow_right",
|
|
@@ -16,8 +23,11 @@ export default /*tw*/ {
|
|
|
16
23
|
weekDaysWrapper: "grid grid-cols-7",
|
|
17
24
|
weekDay: "flex size-8 items-center justify-center text-xs uppercase text-gray-500",
|
|
18
25
|
daysWrapper: "grid grid-cols-7",
|
|
19
|
-
day: "mx-auto
|
|
26
|
+
day: "mx-auto w-full h-8 rounded-lg text-sm hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
20
27
|
activeDay: "bg-gray-100 hover:bg-gray-100",
|
|
28
|
+
inRangeFirstDay: "rounded-none rounded-l-lg bg-gray-200 text-gray-900",
|
|
29
|
+
inRangeLastDay: "rounded-none rounded-r-lg bg-gray-200 text-gray-900",
|
|
30
|
+
inRangeDay: "bg-gray-100 text-gray-900 hover:bg-gray-100 rounded-none",
|
|
21
31
|
selectedDay: "bg-gray-900 text-white hover:bg-gray-900",
|
|
22
32
|
currentDay: "hover:bg-gray-100 border-2 border-gray-900",
|
|
23
33
|
anotherMonthDay: "hover:bg-gray-100 text-gray-400",
|
|
@@ -8,6 +8,8 @@ export const YEARS_PER_VIEW = 12;
|
|
|
8
8
|
export const MONTHS_PER_VIEW = 12;
|
|
9
9
|
export const START_WEEK = 1;
|
|
10
10
|
export const DAYS_IN_WEEK = 7;
|
|
11
|
+
export const SECONDS_IN_MINUTES = 60;
|
|
12
|
+
export const MILLISECONDS_IN_MINUTE = 60_000;
|
|
11
13
|
|
|
12
14
|
export const MAX_HOURS = 23;
|
|
13
15
|
export const MIN_HOURS = 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames } from "
|
|
1
|
+
import { getArgTypes, getSlotNames } from "../service.storybook";
|
|
2
2
|
|
|
3
|
-
import UCalendar from "
|
|
3
|
+
import UCalendar from "../ui.form-calendar";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
id: "3171",
|
|
@@ -40,6 +40,15 @@ const DefaultTemplate = (args) => ({
|
|
|
40
40
|
export const Default = DefaultTemplate.bind({});
|
|
41
41
|
Default.args = {};
|
|
42
42
|
|
|
43
|
+
export const Range = DefaultTemplate.bind({});
|
|
44
|
+
Range.args = {
|
|
45
|
+
range: true,
|
|
46
|
+
value: {
|
|
47
|
+
from: 1651813634,
|
|
48
|
+
to: 1654492034,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
43
52
|
export const Timepicker = DefaultTemplate.bind({});
|
|
44
53
|
Timepicker.args = { value: 1645653600, timepicker: true };
|
|
45
54
|
|
|
@@ -1,33 +1,40 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div ref="wrapperRef" tabindex="1" v-bind="wrapperAttrs" @keydown="onKeydown">
|
|
3
3
|
<div v-bind="navigationAttrs">
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
square
|
|
9
|
-
variant="thirdary"
|
|
10
|
-
v-bind="navigationSwitchViewButtonAttrs"
|
|
11
|
-
@click="onClickViewSwitch"
|
|
12
|
-
@mousedown.prevent.capture
|
|
4
|
+
<Teleport
|
|
5
|
+
v-if="rangeSwitchViewContainerRef"
|
|
6
|
+
:to="rangeSwitchViewContainerRef"
|
|
7
|
+
:disabled="!range"
|
|
13
8
|
>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/>
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
<UButton
|
|
10
|
+
size="sm"
|
|
11
|
+
color="gray"
|
|
12
|
+
pill
|
|
13
|
+
square
|
|
14
|
+
variant="thirdary"
|
|
15
|
+
v-bind="navigationSwitchViewButtonAttrs"
|
|
16
|
+
@click="onClickViewSwitch"
|
|
17
|
+
@mousedown.prevent.capture
|
|
18
|
+
>
|
|
19
|
+
<span v-if="isCurrentView.day" v-bind="dayViewSwitchLabelAttrs">
|
|
20
|
+
<span v-bind="dayViewSwitchLabelMonthAttrs" v-text="viewSwitchLabel.month" />
|
|
21
|
+
<span v-text="viewSwitchLabel.year" />
|
|
22
|
+
</span>
|
|
23
|
+
<span v-if="isCurrentView.month" v-text="viewSwitchLabel.year" />
|
|
24
|
+
<span v-if="isCurrentView.year" v-text="viewSwitchLabel.yearsRange" />
|
|
25
|
+
|
|
26
|
+
<template #right>
|
|
27
|
+
<UIcon
|
|
28
|
+
v-if="!range"
|
|
29
|
+
size="sm"
|
|
30
|
+
color="gray"
|
|
31
|
+
variant="light"
|
|
32
|
+
:name="config.dayViewSwitchLabelIconName"
|
|
33
|
+
v-bind="dayViewSwitchLabelIconAttrs"
|
|
34
|
+
/>
|
|
35
|
+
</template>
|
|
36
|
+
</UButton>
|
|
37
|
+
</Teleport>
|
|
31
38
|
|
|
32
39
|
<div v-bind="nextPrevWrapperAttrs">
|
|
33
40
|
<UButton
|
|
@@ -48,6 +55,8 @@
|
|
|
48
55
|
/>
|
|
49
56
|
</UButton>
|
|
50
57
|
|
|
58
|
+
<div ref="rangeSwitchViewContainerRef" />
|
|
59
|
+
|
|
51
60
|
<UButton
|
|
52
61
|
pill
|
|
53
62
|
size="sm"
|
|
@@ -71,6 +80,8 @@
|
|
|
71
80
|
<DayView
|
|
72
81
|
v-if="isCurrentView.day"
|
|
73
82
|
:selected-date="selectedDate"
|
|
83
|
+
:selected-date-to="selectedDateTo"
|
|
84
|
+
:range="range"
|
|
74
85
|
:active-month="activeMonth"
|
|
75
86
|
:active-date="activeDate"
|
|
76
87
|
:min-date="minDate"
|
|
@@ -107,8 +118,8 @@
|
|
|
107
118
|
@input="onInput"
|
|
108
119
|
/>
|
|
109
120
|
|
|
110
|
-
<div v-if="
|
|
111
|
-
<span v-bind="timepickerLabelAttrs" v-text="
|
|
121
|
+
<div v-if="isTimepickerEnabled" v-bind="timepickerWrapperAttrs">
|
|
122
|
+
<span v-bind="timepickerLabelAttrs" v-text="locale.timeLabel" />
|
|
112
123
|
|
|
113
124
|
<div v-bind="timepickerInputWrapperAttrs">
|
|
114
125
|
<input
|
|
@@ -153,7 +164,7 @@ import {
|
|
|
153
164
|
addYears,
|
|
154
165
|
getSortedLocale,
|
|
155
166
|
} from "./services/date.service";
|
|
156
|
-
import UIService from "
|
|
167
|
+
import UIService from "../service.ui";
|
|
157
168
|
|
|
158
169
|
import useAttrs from "./composables/attrs.composable";
|
|
159
170
|
|
|
@@ -184,7 +195,7 @@ const props = defineProps({
|
|
|
184
195
|
* Calendar value (timestamp).
|
|
185
196
|
*/
|
|
186
197
|
modelValue: {
|
|
187
|
-
type: Number,
|
|
198
|
+
type: [Number, Object],
|
|
188
199
|
default: null,
|
|
189
200
|
},
|
|
190
201
|
|
|
@@ -199,7 +210,6 @@ const props = defineProps({
|
|
|
199
210
|
|
|
200
211
|
/**
|
|
201
212
|
* Enable range selection.
|
|
202
|
-
* TODO: Make it work
|
|
203
213
|
*/
|
|
204
214
|
range: {
|
|
205
215
|
type: Boolean,
|
|
@@ -296,15 +306,28 @@ const {
|
|
|
296
306
|
const wrapperRef = ref(null);
|
|
297
307
|
const hoursRef = ref(null);
|
|
298
308
|
const minutesRef = ref(null);
|
|
309
|
+
const rangeSwitchViewContainerRef = ref(null);
|
|
299
310
|
|
|
300
311
|
const activeDate = ref(null);
|
|
301
312
|
const activeMonth = ref(null);
|
|
302
313
|
|
|
303
314
|
defineExpose({ wrapperRef });
|
|
304
315
|
|
|
305
|
-
const currentView =
|
|
306
|
-
|
|
307
|
-
|
|
316
|
+
const currentView = ref(props.view);
|
|
317
|
+
|
|
318
|
+
watch(
|
|
319
|
+
() => props.view,
|
|
320
|
+
() => {
|
|
321
|
+
if (props.view !== currentView.value) {
|
|
322
|
+
currentView.value = props.view;
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
watch(currentView, () => {
|
|
328
|
+
if (props.view !== currentView.value) {
|
|
329
|
+
emit("update:view", currentView.value);
|
|
330
|
+
}
|
|
308
331
|
});
|
|
309
332
|
|
|
310
333
|
const isCurrentView = computed(() => ({
|
|
@@ -330,17 +353,46 @@ const locale = computed(() => {
|
|
|
330
353
|
return formattedLocale;
|
|
331
354
|
});
|
|
332
355
|
|
|
356
|
+
const isTimepickerEnabled = computed(() => {
|
|
357
|
+
return props.timepicker && !props.range;
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
const isModelRangeType = computed(() => {
|
|
361
|
+
return (
|
|
362
|
+
props.modelValue !== null &&
|
|
363
|
+
!isNumeric(props.modelValue) &&
|
|
364
|
+
typeof props.modelValue === "object"
|
|
365
|
+
);
|
|
366
|
+
});
|
|
367
|
+
|
|
333
368
|
const localValue = computed({
|
|
334
|
-
get: () =>
|
|
369
|
+
get: () => {
|
|
370
|
+
if (props.range) {
|
|
371
|
+
const from = isModelRangeType.value ? props.modelValue.from : props.modelValue || null;
|
|
372
|
+
|
|
373
|
+
const to = isModelRangeType.value ? props.modelValue.to : null;
|
|
374
|
+
|
|
375
|
+
return { from, to };
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return isModelRangeType.value ? props.modelValue.from : props.modelValue;
|
|
379
|
+
},
|
|
335
380
|
set(value) {
|
|
336
|
-
|
|
381
|
+
value = getCurrentValueType(value);
|
|
382
|
+
|
|
383
|
+
const parsedDate = parseDate(props.range ? value.from : value, props.dateFormat, locale.value);
|
|
384
|
+
const parsedDateTo =
|
|
385
|
+
isModelRangeType.value && props.range
|
|
386
|
+
? parseDate(value.to, props.dateFormat, locale.value)
|
|
387
|
+
: undefined;
|
|
337
388
|
|
|
338
|
-
if (parsedDate &&
|
|
389
|
+
if (parsedDate && isTimepickerEnabled.value) {
|
|
339
390
|
parsedDate.setHours(Number(hoursRef.value.value));
|
|
340
391
|
parsedDate.setMinutes(Number(minutesRef.value.value));
|
|
341
392
|
}
|
|
342
393
|
|
|
343
394
|
const timestamp = parsedDate ? getUnixTimestampFromDate(parsedDate) : null;
|
|
395
|
+
const timestampTo = parsedDateTo ? getUnixTimestampFromDate(parsedDateTo) : null;
|
|
344
396
|
|
|
345
397
|
const isOutOfRange = dateIsOutOfRange(
|
|
346
398
|
parsedDate || new Date(),
|
|
@@ -354,9 +406,9 @@ const localValue = computed({
|
|
|
354
406
|
return;
|
|
355
407
|
}
|
|
356
408
|
|
|
357
|
-
emit("update:modelValue", timestamp);
|
|
409
|
+
emit("update:modelValue", props.range ? { from: timestamp, to: timestampTo } : timestamp);
|
|
358
410
|
|
|
359
|
-
if (parsedDate === null &&
|
|
411
|
+
if (parsedDate === null && isTimepickerEnabled.value) {
|
|
360
412
|
const currentDate = new Date();
|
|
361
413
|
|
|
362
414
|
hoursRef.value.value = String(currentDate.getHours()).padStart(2, "0");
|
|
@@ -366,7 +418,15 @@ const localValue = computed({
|
|
|
366
418
|
});
|
|
367
419
|
|
|
368
420
|
const selectedDate = computed(() => {
|
|
369
|
-
return parseDate(
|
|
421
|
+
return parseDate(
|
|
422
|
+
props.range ? localValue.value.from : localValue.value,
|
|
423
|
+
props.dateFormat,
|
|
424
|
+
locale.value,
|
|
425
|
+
);
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
const selectedDateTo = computed(() => {
|
|
429
|
+
return props.range ? parseDate(localValue.value.to, props.dateFormat, locale.value) : undefined;
|
|
370
430
|
});
|
|
371
431
|
|
|
372
432
|
const formattedDate = computed(() => {
|
|
@@ -374,6 +434,8 @@ const formattedDate = computed(() => {
|
|
|
374
434
|
});
|
|
375
435
|
|
|
376
436
|
const formattedTime = computed(() => {
|
|
437
|
+
if (!isTimepickerEnabled.value) return undefined;
|
|
438
|
+
|
|
377
439
|
const hours = String(selectedDate.value?.getHours()).padStart(2, "0");
|
|
378
440
|
const minutes = String(selectedDate.value?.getMinutes()).padStart(2, "0");
|
|
379
441
|
|
|
@@ -382,10 +444,15 @@ const formattedTime = computed(() => {
|
|
|
382
444
|
|
|
383
445
|
const userFormattedDate = computed(() => {
|
|
384
446
|
const date = formatDate(selectedDate.value, props.userFormat, locale.value);
|
|
447
|
+
const dateTo = props.range
|
|
448
|
+
? formatDate(selectedDateTo.value, props.userFormat, locale.value)
|
|
449
|
+
: undefined;
|
|
450
|
+
|
|
451
|
+
if (isTimepickerEnabled.value && selectedDate.value) {
|
|
452
|
+
return `${date} ${SEPARATOR} ${formattedTime.value}`;
|
|
453
|
+
}
|
|
385
454
|
|
|
386
|
-
return props.
|
|
387
|
-
? `${date} ${SEPARATOR} ${formattedTime.value}`
|
|
388
|
-
: date;
|
|
455
|
+
return props.range ? `${date} ${SEPARATOR} ${dateTo}` : date;
|
|
389
456
|
});
|
|
390
457
|
|
|
391
458
|
const viewSwitchLabel = computed(() => {
|
|
@@ -407,8 +474,18 @@ watch(formattedDate, () => {
|
|
|
407
474
|
emit("formattedDateChange", userFormattedDate.value);
|
|
408
475
|
});
|
|
409
476
|
|
|
477
|
+
// This watcher force updates value when range props changed
|
|
478
|
+
watch(
|
|
479
|
+
() => props.range,
|
|
480
|
+
(newValue, oldValue) => {
|
|
481
|
+
if (newValue !== oldValue) {
|
|
482
|
+
localValue.value = getCurrentValueType(localValue.value);
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
);
|
|
486
|
+
|
|
410
487
|
onMounted(() => {
|
|
411
|
-
if (selectedDate.value &&
|
|
488
|
+
if (selectedDate.value && isTimepickerEnabled.value) {
|
|
412
489
|
hoursRef.value.value = String(selectedDate.value.getHours()).padStart(2, "0");
|
|
413
490
|
minutesRef.value.value = String(selectedDate.value.getMinutes()).padStart(2, "0");
|
|
414
491
|
}
|
|
@@ -417,6 +494,22 @@ onMounted(() => {
|
|
|
417
494
|
emit("formattedDateChange", userFormattedDate.value);
|
|
418
495
|
});
|
|
419
496
|
|
|
497
|
+
function getCurrentValueType(value) {
|
|
498
|
+
if (props.range && value === null) {
|
|
499
|
+
value = { from: null, to: null };
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
if (isModelRangeType.value && !props.range) {
|
|
503
|
+
value = value.from || value;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
if (typeof value !== "object" && value !== null && props.range) {
|
|
507
|
+
value = { from: value, to: null };
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
return value;
|
|
511
|
+
}
|
|
512
|
+
|
|
420
513
|
function onInputDate(newDate) {
|
|
421
514
|
if (newDate === null) {
|
|
422
515
|
localValue.value = newDate;
|
|
@@ -431,7 +524,18 @@ function onInputDate(newDate) {
|
|
|
431
524
|
|
|
432
525
|
const date = new Date(newDate.valueOf());
|
|
433
526
|
|
|
434
|
-
|
|
527
|
+
if (props.range) {
|
|
528
|
+
const isFullReset =
|
|
529
|
+
localValue.value.to ||
|
|
530
|
+
!localValue.value.from ||
|
|
531
|
+
getUnixTimestampFromDate(date) <= localValue.value.from;
|
|
532
|
+
|
|
533
|
+
localValue.value = isFullReset
|
|
534
|
+
? { from: date, to: null }
|
|
535
|
+
: { from: localValue.value.from, to: date };
|
|
536
|
+
} else {
|
|
537
|
+
localValue.value = date;
|
|
538
|
+
}
|
|
435
539
|
|
|
436
540
|
activeDate.value = null;
|
|
437
541
|
activeMonth.value = null;
|
|
@@ -442,6 +546,12 @@ function onInputDate(newDate) {
|
|
|
442
546
|
}
|
|
443
547
|
|
|
444
548
|
function onKeydown(event) {
|
|
549
|
+
if (props.range) {
|
|
550
|
+
emit("keydown", event);
|
|
551
|
+
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
|
|
445
555
|
if ([KEY_CODE.left, KEY_CODE.up, KEY_CODE.right, KEY_CODE.down].includes(event.keyCode)) {
|
|
446
556
|
arrowKeyHandler(event);
|
|
447
557
|
|
|
@@ -155,25 +155,13 @@ export function dayIsPartOfTheConditions(day, condition, dateParser, dateFormat)
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
export function dateIsOutOfRange(date, min, max, locale, dateFormat = null) {
|
|
158
|
-
if (!dateFormat) {
|
|
158
|
+
if ((!dateFormat && typeof min === "string") || (!dateFormat && typeof max === "string")) {
|
|
159
159
|
throw new Error("strings needs a date format");
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
const minDate = typeof min === "string" ? parseDate(min, dateFormat, locale) : min;
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
minDate = parseDate(min, dateFormat, locale);
|
|
166
|
-
} else {
|
|
167
|
-
minDate = min;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
let maxDate;
|
|
171
|
-
|
|
172
|
-
if (typeof max === "string" || max instanceof String) {
|
|
173
|
-
maxDate = parseDate(max, dateFormat, locale);
|
|
174
|
-
} else {
|
|
175
|
-
maxDate = max;
|
|
176
|
-
}
|
|
164
|
+
const maxDate = typeof max === "string" ? parseDate(max, dateFormat, locale) : max;
|
|
177
165
|
|
|
178
166
|
const time = date.getTime();
|
|
179
167
|
|