@vc-shell/framework 1.0.53 → 1.0.54
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/core/composables/index.ts +0 -1
- package/core/composables/useApiClient/index.ts +1 -4
- package/core/composables/useAsync/index.ts +2 -6
- package/core/composables/useAutosave/index.ts +1 -3
- package/core/composables/useFunctions/debounce.ts +1 -4
- package/core/composables/useFunctions/delay.ts +1 -4
- package/core/composables/useFunctions/once.ts +1 -3
- package/core/composables/useFunctions/throttle.ts +1 -4
- package/core/composables/useI18n/index.ts +3 -24
- package/core/composables/useLoading/index.ts +1 -3
- package/core/composables/useNotifications/index.ts +5 -12
- package/core/composables/useSettings/index.ts +2 -3
- package/core/composables/useUser/index.ts +25 -64
- package/core/plugins/i18n/index.ts +8 -0
- package/core/plugins/index.ts +3 -1
- package/core/plugins/modularity/index.ts +32 -0
- package/core/plugins/moment/humanize.ts +1 -4
- package/core/plugins/validation/index.ts +11 -1
- package/core/plugins/validation/rules.ts +48 -170
- package/core/types/index.ts +3 -5
- package/dist/core/composables/index.d.ts +0 -1
- package/dist/core/composables/index.d.ts.map +1 -1
- package/dist/core/composables/useApiClient/index.d.ts.map +1 -1
- package/dist/core/composables/useAsync/index.d.ts.map +1 -1
- package/dist/core/composables/useAutosave/index.d.ts.map +1 -1
- package/dist/core/composables/useFunctions/debounce.d.ts.map +1 -1
- package/dist/core/composables/useFunctions/delay.d.ts.map +1 -1
- package/dist/core/composables/useFunctions/once.d.ts.map +1 -1
- package/dist/core/composables/useFunctions/throttle.d.ts.map +1 -1
- package/dist/core/composables/useI18n/index.d.ts +2 -4
- package/dist/core/composables/useI18n/index.d.ts.map +1 -1
- package/dist/core/composables/useLoading/index.d.ts.map +1 -1
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/useSettings/index.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/plugins/i18n/index.d.ts +3 -0
- package/dist/core/plugins/i18n/index.d.ts.map +1 -0
- package/dist/core/plugins/index.d.ts +3 -1
- package/dist/core/plugins/index.d.ts.map +1 -1
- package/dist/core/plugins/modularity/index.d.ts +8 -0
- package/dist/core/plugins/modularity/index.d.ts.map +1 -0
- package/dist/core/plugins/moment/humanize.d.ts.map +1 -1
- package/dist/core/plugins/validation/index.d.ts +3 -1
- package/dist/core/plugins/validation/index.d.ts.map +1 -1
- package/dist/core/plugins/validation/rules.d.ts +32 -11
- package/dist/core/plugins/validation/rules.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +0 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.esm.js +42553 -0
- package/dist/framework.js +77 -75
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
- package/dist/shared/app-switcher/index.d.ts +2 -3
- package/dist/shared/app-switcher/index.d.ts.map +1 -1
- package/dist/shared/assets/components/index.d.ts +1 -1
- package/dist/shared/assets/components/index.d.ts.map +1 -1
- package/dist/shared/assets/index.d.ts +2 -3
- package/dist/shared/assets/index.d.ts.map +1 -1
- package/dist/shared/blade-navigation/composables/index.d.ts +1 -1
- package/dist/shared/blade-navigation/composables/index.d.ts.map +1 -1
- package/dist/shared/blade-navigation/composables/useBladeNavigation/index.d.ts +1 -1
- package/dist/shared/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
- package/dist/shared/blade-navigation/index.d.ts +2 -3
- package/dist/shared/blade-navigation/index.d.ts.map +1 -1
- package/dist/shared/index.d.ts +4 -1
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-badge/index.d.ts +2 -2
- package/dist/ui/components/atoms/vc-badge/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge-model.d.ts +20 -15
- package/dist/ui/components/atoms/vc-badge/vc-badge-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/index.d.ts +2 -2
- package/dist/ui/components/atoms/vc-button/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/vc-button-model.d.ts +30 -10
- package/dist/ui/components/atoms/vc-button/vc-button-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/index.d.ts +2 -2
- package/dist/ui/components/atoms/vc-card/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/vc-card-model.d.ts +28 -11
- package/dist/ui/components/atoms/vc-card/vc-card-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-checkbox/index.d.ts +2 -2
- package/dist/ui/components/atoms/vc-checkbox/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox-model.d.ts +25 -8
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-col/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-col/vc-col-model.d.ts +8 -3
- package/dist/ui/components/atoms/vc-col/vc-col-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-container/index.d.ts +2 -2
- package/dist/ui/components/atoms/vc-container/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-container/vc-container-model.d.ts +20 -6
- package/dist/ui/components/atoms/vc-container/vc-container-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-hint/vc-hint-model.d.ts +5 -0
- package/dist/ui/components/atoms/vc-hint/vc-hint-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon-model.d.ts +13 -5
- package/dist/ui/components/atoms/vc-icon/vc-icon-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-image/index.d.ts +2 -2
- package/dist/ui/components/atoms/vc-image/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-image/vc-image-model.d.ts +34 -11
- package/dist/ui/components/atoms/vc-image/vc-image-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-image/vc-image.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-info-row/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-info-row/vc-info-row-model.d.ts +21 -7
- package/dist/ui/components/atoms/vc-info-row/vc-info-row-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-label/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-label/vc-label-model.d.ts +12 -4
- package/dist/ui/components/atoms/vc-label/vc-label-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-link/index.d.ts +2 -2
- package/dist/ui/components/atoms/vc-link/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-link/vc-link-model.d.ts +16 -5
- package/dist/ui/components/atoms/vc-link/vc-link-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-loading/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-loading/vc-loading-model.d.ts +8 -3
- package/dist/ui/components/atoms/vc-loading/vc-loading-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-progress/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-progress/vc-progress-model.d.ts +13 -5
- package/dist/ui/components/atoms/vc-progress/vc-progress-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status/vc-status-model.d.ts +17 -6
- package/dist/ui/components/atoms/vc-status/vc-status-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status-icon/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status-icon/vc-status-icon-model.d.ts +8 -3
- package/dist/ui/components/atoms/vc-status-icon/vc-status-icon-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-switch/index.d.ts +2 -2
- package/dist/ui/components/atoms/vc-switch/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-switch/vc-switch-model.d.ts +25 -8
- package/dist/ui/components/atoms/vc-switch/vc-switch-model.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-widget/index.d.ts +2 -2
- package/dist/ui/components/atoms/vc-widget/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-widget/vc-widget-model.d.ts +15 -7
- package/dist/ui/components/atoms/vc-widget/vc-widget-model.d.ts.map +1 -1
- package/dist/ui/components/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs-model.d.ts +15 -10
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/index.d.ts +2 -2
- package/dist/ui/components/molecules/vc-editor/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/vc-editor-model.d.ts +28 -11
- package/dist/ui/components/molecules/vc-editor/vc-editor-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts +2 -2
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload-model.d.ts +30 -10
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-form/vc-form-model.d.ts +5 -0
- package/dist/ui/components/molecules/vc-form/vc-form-model.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-input/index.d.ts +2 -2
- package/dist/ui/components/molecules/vc-input/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input/vc-input-model.d.ts +48 -25
- package/dist/ui/components/molecules/vc-input/vc-input-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/index.d.ts +2 -2
- package/dist/ui/components/molecules/vc-input-currency/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency-model.d.ts +36 -28
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-notification/index.d.ts +2 -2
- package/dist/ui/components/molecules/vc-notification/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-notification/vc-notification-model.d.ts +13 -5
- package/dist/ui/components/molecules/vc-notification/vc-notification-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-pagination/index.d.ts +2 -2
- package/dist/ui/components/molecules/vc-pagination/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-pagination/vc-pagination-model.d.ts +20 -6
- package/dist/ui/components/molecules/vc-pagination/vc-pagination-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-rating/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-rating/vc-rating-model.d.ts +17 -9
- package/dist/ui/components/molecules/vc-rating/vc-rating-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/index.d.ts +2 -2
- package/dist/ui/components/molecules/vc-select/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select-model.d.ts +67 -32
- package/dist/ui/components/molecules/vc-select/vc-select-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-slider/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-slider/vc-slider-model.d.ts +25 -8
- package/dist/ui/components/molecules/vc-slider/vc-slider-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-textarea/index.d.ts +2 -2
- package/dist/ui/components/molecules/vc-textarea/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-textarea/vc-textarea-model.d.ts +32 -12
- package/dist/ui/components/molecules/vc-textarea/vc-textarea-model.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/index.d.ts +2 -2
- package/dist/ui/components/organisms/vc-app/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app-model.d.ts +52 -17
- package/dist/ui/components/organisms/vc-app/vc-app-model.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/index.d.ts +2 -2
- package/dist/ui/components/organisms/vc-blade/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade-model.d.ts +28 -11
- package/dist/ui/components/organisms/vc-blade/vc-blade-model.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.stories.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-dynamic-property/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property-model.d.ts +39 -10
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property-model.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/index.d.ts +2 -2
- package/dist/ui/components/organisms/vc-gallery/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/vc-gallery-model.d.ts +69 -27
- package/dist/ui/components/organisms/vc-gallery/vc-gallery-model.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-login-form/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-login-form/vc-login-form-model.d.ts +10 -5
- package/dist/ui/components/organisms/vc-login-form/vc-login-form-model.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/index.d.ts +2 -2
- package/dist/ui/components/organisms/vc-popup/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup-model.d.ts +18 -7
- package/dist/ui/components/organisms/vc-popup/vc-popup-model.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/index.d.ts +2 -2
- package/dist/ui/components/organisms/vc-table/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table-model.d.ts +103 -34
- package/dist/ui/components/organisms/vc-table/vc-table-model.d.ts.map +1 -1
- package/dist/ui/types/index.d.ts +48 -46
- package/dist/ui/types/index.d.ts.map +1 -1
- package/dist/ui/types/ts-helpers.d.ts +14 -4
- package/dist/ui/types/ts-helpers.d.ts.map +1 -1
- package/dist/ui/utils/index.d.ts +2 -0
- package/dist/ui/utils/index.d.ts.map +1 -0
- package/dist/ui/utils/types.d.ts +3 -0
- package/dist/ui/utils/types.d.ts.map +1 -0
- package/dist/vite.config.d.ts +1 -1
- package/dist/vite.config.d.ts.map +1 -1
- package/package.json +8 -11
- package/shared/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +2 -5
- package/shared/app-switcher/composables/useAppSwitcher/index.ts +2 -7
- package/shared/app-switcher/index.ts +3 -10
- package/shared/assets/components/assets-details/assets-details.vue +7 -28
- package/shared/assets/components/index.ts +1 -1
- package/shared/assets/index.ts +3 -15
- package/shared/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +2 -7
- package/shared/blade-navigation/composables/index.ts +1 -1
- package/shared/blade-navigation/composables/useBladeNavigation/index.ts +7 -36
- package/shared/blade-navigation/index.ts +3 -10
- package/shared/index.ts +9 -11
- package/ui/components/atoms/vc-badge/index.ts +4 -4
- package/ui/components/atoms/vc-badge/vc-badge-model.ts +22 -15
- package/ui/components/atoms/vc-badge/vc-badge.vue +5 -10
- package/ui/components/atoms/vc-button/index.ts +4 -4
- package/ui/components/atoms/vc-button/vc-button-model.ts +32 -17
- package/ui/components/atoms/vc-button/vc-button.vue +8 -13
- package/ui/components/atoms/vc-card/index.ts +3 -4
- package/ui/components/atoms/vc-card/vc-card-model.ts +31 -11
- package/ui/components/atoms/vc-card/vc-card.vue +20 -11
- package/ui/components/atoms/vc-checkbox/index.ts +3 -2
- package/ui/components/atoms/vc-checkbox/vc-checkbox-model.ts +28 -8
- package/ui/components/atoms/vc-checkbox/vc-checkbox.vue +15 -11
- package/ui/components/atoms/vc-col/index.ts +1 -2
- package/ui/components/atoms/vc-col/vc-col-model.ts +9 -3
- package/ui/components/atoms/vc-col/vc-col.vue +2 -4
- package/ui/components/atoms/vc-container/index.ts +3 -2
- package/ui/components/atoms/vc-container/vc-container-model.ts +24 -8
- package/ui/components/atoms/vc-container/vc-container.vue +6 -14
- package/ui/components/atoms/vc-hint/vc-hint-model.ts +5 -0
- package/ui/components/atoms/vc-icon/index.ts +1 -3
- package/ui/components/atoms/vc-icon/vc-icon-model.ts +15 -6
- package/ui/components/atoms/vc-icon/vc-icon.vue +2 -5
- package/ui/components/atoms/vc-image/index.ts +4 -4
- package/ui/components/atoms/vc-image/vc-image-model.ts +36 -22
- package/ui/components/atoms/vc-image/vc-image.stories.ts +1 -2
- package/ui/components/atoms/vc-image/vc-image.vue +13 -17
- package/ui/components/atoms/vc-info-row/index.ts +1 -3
- package/ui/components/atoms/vc-info-row/vc-info-row-model.ts +22 -7
- package/ui/components/atoms/vc-info-row/vc-info-row.vue +13 -9
- package/ui/components/atoms/vc-label/index.ts +1 -3
- package/ui/components/atoms/vc-label/vc-label-model.ts +13 -4
- package/ui/components/atoms/vc-label/vc-label.vue +6 -6
- package/ui/components/atoms/vc-link/index.ts +3 -4
- package/ui/components/atoms/vc-link/vc-link-model.ts +18 -5
- package/ui/components/atoms/vc-link/vc-link.vue +4 -6
- package/ui/components/atoms/vc-loading/index.ts +1 -3
- package/ui/components/atoms/vc-loading/vc-loading-model.ts +9 -3
- package/ui/components/atoms/vc-loading/vc-loading.vue +4 -9
- package/ui/components/atoms/vc-progress/index.ts +1 -3
- package/ui/components/atoms/vc-progress/vc-progress-model.ts +14 -5
- package/ui/components/atoms/vc-progress/vc-progress.vue +4 -13
- package/ui/components/atoms/vc-status/index.ts +1 -3
- package/ui/components/atoms/vc-status/vc-status-model.ts +18 -12
- package/ui/components/atoms/vc-status/vc-status.vue +3 -11
- package/ui/components/atoms/vc-status-icon/index.ts +1 -3
- package/ui/components/atoms/vc-status-icon/vc-status-icon-model.ts +9 -3
- package/ui/components/atoms/vc-status-icon/vc-status-icon.vue +2 -4
- package/ui/components/atoms/vc-switch/index.ts +4 -4
- package/ui/components/atoms/vc-switch/vc-switch-model.ts +28 -8
- package/ui/components/atoms/vc-switch/vc-switch.vue +12 -10
- package/ui/components/atoms/vc-widget/index.ts +4 -4
- package/ui/components/atoms/vc-widget/vc-widget-model.ts +17 -7
- package/ui/components/atoms/vc-widget/vc-widget.vue +16 -7
- package/ui/components/index.ts +1 -1
- package/ui/components/molecules/vc-breadcrumbs/index.ts +1 -3
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs-model.ts +18 -10
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +6 -5
- package/ui/components/molecules/vc-editor/index.ts +4 -4
- package/ui/components/molecules/vc-editor/vc-editor-model.ts +31 -11
- package/ui/components/molecules/vc-editor/vc-editor.vue +17 -11
- package/ui/components/molecules/vc-file-upload/index.ts +3 -2
- package/ui/components/molecules/vc-file-upload/vc-file-upload-model.ts +33 -11
- package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +10 -14
- package/ui/components/molecules/vc-form/vc-form-model.ts +5 -0
- package/ui/components/molecules/vc-input/index.ts +4 -5
- package/ui/components/molecules/vc-input/vc-input-model.ts +53 -35
- package/ui/components/molecules/vc-input/vc-input.vue +41 -29
- package/ui/components/molecules/vc-input-currency/index.ts +3 -2
- package/ui/components/molecules/vc-input-currency/vc-input-currency-model.ts +42 -32
- package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +12 -7
- package/ui/components/molecules/vc-notification/index.ts +4 -3
- package/ui/components/molecules/vc-notification/vc-notification-model.ts +15 -5
- package/ui/components/molecules/vc-notification/vc-notification.vue +3 -5
- package/ui/components/molecules/vc-pagination/index.ts +4 -3
- package/ui/components/molecules/vc-pagination/vc-pagination-model.ts +23 -6
- package/ui/components/molecules/vc-pagination/vc-pagination.vue +19 -11
- package/ui/components/molecules/vc-rating/index.ts +2 -4
- package/ui/components/molecules/vc-rating/vc-rating-model.ts +18 -9
- package/ui/components/molecules/vc-rating/vc-rating.vue +10 -4
- package/ui/components/molecules/vc-select/index.ts +5 -5
- package/ui/components/molecules/vc-select/vc-select-model.ts +74 -44
- package/ui/components/molecules/vc-select/vc-select.vue +126 -171
- package/ui/components/molecules/vc-slider/index.ts +2 -4
- package/ui/components/molecules/vc-slider/vc-slider-model.ts +30 -11
- package/ui/components/molecules/vc-slider/vc-slider.vue +2 -8
- package/ui/components/molecules/vc-textarea/index.ts +4 -3
- package/ui/components/molecules/vc-textarea/vc-textarea-model.ts +35 -12
- package/ui/components/molecules/vc-textarea/vc-textarea.vue +16 -12
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +13 -9
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +12 -3
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +18 -16
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +8 -2
- package/ui/components/organisms/vc-app/index.ts +4 -4
- package/ui/components/organisms/vc-app/vc-app-model.ts +55 -17
- package/ui/components/organisms/vc-app/vc-app.vue +8 -25
- package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +22 -7
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +19 -13
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +13 -11
- package/ui/components/organisms/vc-blade/index.ts +5 -5
- package/ui/components/organisms/vc-blade/vc-blade-model.ts +30 -11
- package/ui/components/organisms/vc-blade/vc-blade.stories.ts +1 -2
- package/ui/components/organisms/vc-blade/vc-blade.vue +12 -14
- package/ui/components/organisms/vc-dynamic-property/index.ts +2 -4
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property-model.ts +53 -20
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +41 -37
- package/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue +9 -2
- package/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +14 -9
- package/ui/components/organisms/vc-gallery/index.ts +4 -3
- package/ui/components/organisms/vc-gallery/vc-gallery-model.ts +72 -27
- package/ui/components/organisms/vc-gallery/vc-gallery.vue +7 -20
- package/ui/components/organisms/vc-login-form/index.ts +2 -4
- package/ui/components/organisms/vc-login-form/vc-login-form-model.ts +10 -5
- package/ui/components/organisms/vc-login-form/vc-login-form.vue +2 -4
- package/ui/components/organisms/vc-popup/index.ts +5 -5
- package/ui/components/organisms/vc-popup/vc-popup-model.ts +20 -7
- package/ui/components/organisms/vc-popup/vc-popup.vue +7 -7
- package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +19 -25
- package/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue +2 -6
- package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +8 -2
- package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +27 -39
- package/ui/components/organisms/vc-table/index.ts +5 -5
- package/ui/components/organisms/vc-table/vc-table-model.ts +98 -38
- package/ui/components/organisms/vc-table/vc-table.vue +105 -103
- package/ui/types/index.ts +64 -160
- package/ui/types/ts-helpers.ts +23 -3
- package/ui/utils/index.ts +1 -0
- package/ui/utils/types.ts +2 -0
- package/core/composables/useLogger/index.ts +0 -24
- package/dist/core/composables/useLogger/index.d.ts +0 -5
- package/dist/core/composables/useLogger/index.d.ts.map +0 -1
|
@@ -2,6 +2,4 @@ import { ComponentPublicInstance } from "vue";
|
|
|
2
2
|
import { VcStatusIconProps } from "./vc-status-icon-model";
|
|
3
3
|
import { ComponentConstructor } from "./../../../types/ts-helpers";
|
|
4
4
|
import StatusIcon from "./vc-status-icon.vue";
|
|
5
|
-
export const VcStatusIcon: ComponentConstructor<
|
|
6
|
-
ComponentPublicInstance<VcStatusIconProps>
|
|
7
|
-
> = StatusIcon;
|
|
5
|
+
export const VcStatusIcon: ComponentConstructor<ComponentPublicInstance<VcStatusIconProps>> = StatusIcon;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { VNode } from "vue";
|
|
2
|
+
import { ExtractTypes } from "./../../../types/ts-helpers";
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
-
status
|
|
5
|
-
|
|
4
|
+
export const statusIconProps = {
|
|
5
|
+
status: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: false,
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type VcStatusIconProps = ExtractTypes<typeof statusIconProps>;
|
|
6
12
|
|
|
7
13
|
export interface VcStatusIconSlots {
|
|
8
14
|
default: () => VNode[];
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
<script lang="ts" setup>
|
|
19
19
|
import { VcIcon } from "./../../../components";
|
|
20
|
-
import {
|
|
20
|
+
import { statusIconProps } from "./vc-status-icon-model";
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
status: false,
|
|
24
|
-
});
|
|
22
|
+
defineProps(statusIconProps);
|
|
25
23
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentPublicInstance } from "vue";
|
|
2
|
-
import { VcSwitchProps } from "./vc-switch-model";
|
|
2
|
+
import { VcSwitchEmits, VcSwitchProps } from "./vc-switch-model";
|
|
3
3
|
import { ComponentConstructor } from "./../../../types/ts-helpers";
|
|
4
4
|
import Switch from "./vc-switch.vue";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
export const VcSwitch: ComponentConstructor<ComponentPublicInstance<VcSwitchProps, any, any, any, any, VcSwitchEmits>> =
|
|
7
|
+
Switch;
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
import { VNode } from "vue";
|
|
2
|
+
import { ExtractTypes } from "./../../../types/ts-helpers";
|
|
3
|
+
import { isBoolean } from "./../../../utils";
|
|
2
4
|
|
|
3
|
-
export
|
|
4
|
-
modelValue
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export const switchProps = {
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false,
|
|
9
|
+
},
|
|
10
|
+
disabled: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
tooltip: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "",
|
|
17
|
+
},
|
|
18
|
+
required: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
label: String,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const switchEmits = {
|
|
26
|
+
"update:modelValue": (value: boolean) => isBoolean(value),
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type VcSwitchProps = ExtractTypes<typeof switchProps>;
|
|
30
|
+
export type VcSwitchEmits = typeof switchEmits;
|
|
11
31
|
|
|
12
32
|
export interface VcSwitchSlots {
|
|
13
33
|
default: () => VNode[];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<!-- Switch label -->
|
|
4
|
-
<VcLabel
|
|
4
|
+
<VcLabel
|
|
5
|
+
v-if="label"
|
|
6
|
+
class="tw-mb-2"
|
|
7
|
+
:required="required"
|
|
8
|
+
>
|
|
5
9
|
<span>{{ label }}</span>
|
|
6
10
|
</VcLabel>
|
|
7
11
|
<div class="tw-relative tw-inline-block tw-w-[54px] tw-h-[18px]">
|
|
@@ -15,7 +19,10 @@
|
|
|
15
19
|
/>
|
|
16
20
|
<span class="vc-switch__slider"></span>
|
|
17
21
|
</label>
|
|
18
|
-
<VcHint
|
|
22
|
+
<VcHint
|
|
23
|
+
class="tw-mt-2 tw-w-max"
|
|
24
|
+
v-if="tooltip"
|
|
25
|
+
>
|
|
19
26
|
{{ tooltip }}
|
|
20
27
|
</VcHint>
|
|
21
28
|
</div>
|
|
@@ -23,16 +30,11 @@
|
|
|
23
30
|
</template>
|
|
24
31
|
|
|
25
32
|
<script lang="ts" setup>
|
|
26
|
-
import {
|
|
33
|
+
import { switchEmits, switchProps } from "./vc-switch-model";
|
|
27
34
|
|
|
28
|
-
|
|
29
|
-
modelValue: false,
|
|
30
|
-
disabled: false,
|
|
31
|
-
tooltip: "",
|
|
32
|
-
required: false,
|
|
33
|
-
});
|
|
35
|
+
defineProps(switchProps);
|
|
34
36
|
|
|
35
|
-
const emit = defineEmits(
|
|
37
|
+
const emit = defineEmits(switchEmits);
|
|
36
38
|
|
|
37
39
|
function onInput(e: InputEvent) {
|
|
38
40
|
const newValue = (e.target as HTMLInputElement).checked;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentPublicInstance } from "vue";
|
|
2
|
-
import { VcWidgetProps } from "./vc-widget-model";
|
|
2
|
+
import { VcWidgetEmits, VcWidgetProps } from "./vc-widget-model";
|
|
3
3
|
import { ComponentConstructor } from "./../../../types/ts-helpers";
|
|
4
4
|
import Widget from "./vc-widget.vue";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
export const VcWidget: ComponentConstructor<ComponentPublicInstance<VcWidgetProps, any, any, any, any, VcWidgetEmits>> =
|
|
7
|
+
Widget;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { VNode } from "vue";
|
|
2
|
+
import { ExtractTypes } from "./../../../types/ts-helpers";
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
-
icon
|
|
5
|
-
title
|
|
6
|
-
value
|
|
7
|
-
disabled
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export const widgetProps = {
|
|
5
|
+
icon: String,
|
|
6
|
+
title: String,
|
|
7
|
+
value: [String, Number],
|
|
8
|
+
disabled: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: false,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const widgetEmits = {
|
|
15
|
+
click: () => true,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type VcWidgetProps = ExtractTypes<typeof widgetProps>;
|
|
19
|
+
export type VcWidgetEmits = typeof widgetEmits;
|
|
10
20
|
|
|
11
21
|
export interface VcWidgetSlots {
|
|
12
22
|
default: () => VNode[];
|
|
@@ -10,18 +10,27 @@
|
|
|
10
10
|
:icon="icon"
|
|
11
11
|
size="xxl"
|
|
12
12
|
></VcIcon>
|
|
13
|
-
<div
|
|
14
|
-
|
|
13
|
+
<div
|
|
14
|
+
v-if="title"
|
|
15
|
+
class="vc-widget__title"
|
|
16
|
+
>
|
|
17
|
+
{{ title }}
|
|
18
|
+
</div>
|
|
19
|
+
<div
|
|
20
|
+
v-if="value !== undefined"
|
|
21
|
+
class="vc-widget__value"
|
|
22
|
+
>
|
|
23
|
+
{{ value }}
|
|
24
|
+
</div>
|
|
15
25
|
</div>
|
|
16
26
|
</template>
|
|
17
27
|
|
|
18
28
|
<script lang="ts" setup>
|
|
19
|
-
import {
|
|
29
|
+
import { widgetEmits, widgetProps } from "./vc-widget-model";
|
|
20
30
|
|
|
21
|
-
const props =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const emit = defineEmits(["click"]);
|
|
31
|
+
const props = defineProps(widgetProps);
|
|
32
|
+
|
|
33
|
+
const emit = defineEmits(widgetEmits);
|
|
25
34
|
|
|
26
35
|
function onClick() {
|
|
27
36
|
if (!props.disabled) {
|
package/ui/components/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Atoms */
|
|
2
2
|
export { VcBadge } from "./atoms/vc-badge";
|
|
3
|
-
export {VcButton } from "./atoms/vc-button";
|
|
3
|
+
export { VcButton } from "./atoms/vc-button";
|
|
4
4
|
export { VcCard } from "./atoms/vc-card";
|
|
5
5
|
export { VcCheckbox } from "./atoms/vc-checkbox";
|
|
6
6
|
export { VcCol } from "./atoms/vc-col";
|
|
@@ -2,6 +2,4 @@ import { ComponentPublicInstance } from "vue";
|
|
|
2
2
|
import { VcBreadcrumbsProps } from "./vc-breadcrumbs-model";
|
|
3
3
|
import { ComponentConstructor } from "./../../../types/ts-helpers";
|
|
4
4
|
import Breadcrumbs from "./vc-breadcrumbs.vue";
|
|
5
|
-
export const VcBreadcrumbs: ComponentConstructor<
|
|
6
|
-
ComponentPublicInstance<VcBreadcrumbsProps>
|
|
7
|
-
> = Breadcrumbs;
|
|
5
|
+
export const VcBreadcrumbs: ComponentConstructor<ComponentPublicInstance<VcBreadcrumbsProps>> = Breadcrumbs;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { VNode } from "vue";
|
|
1
|
+
import { PropType, VNode } from "vue";
|
|
2
|
+
import { ExtractTypes } from "./../../../types/ts-helpers";
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
-
items
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
export const breadcrumbsProps = {
|
|
5
|
+
items: {
|
|
6
|
+
type: Array as PropType<
|
|
7
|
+
{
|
|
8
|
+
current: boolean;
|
|
9
|
+
icon: string;
|
|
10
|
+
title: string;
|
|
11
|
+
clickHandler: () => void;
|
|
12
|
+
id: string;
|
|
13
|
+
}[]
|
|
14
|
+
>,
|
|
15
|
+
default: () => [],
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type VcBreadcrumbsProps = ExtractTypes<typeof breadcrumbsProps>;
|
|
12
20
|
|
|
13
21
|
export interface VcBreadcrumbsSlots {
|
|
14
22
|
default: () => VNode[];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
v-if="items"
|
|
4
|
+
class="tw-flex tw-items-center tw-flex-nowrap"
|
|
5
|
+
>
|
|
3
6
|
<VcBreadcrumbsItem
|
|
4
7
|
v-for="(item, i) in items"
|
|
5
8
|
:key="item.id"
|
|
@@ -11,9 +14,7 @@
|
|
|
11
14
|
|
|
12
15
|
<script lang="ts" setup>
|
|
13
16
|
import VcBreadcrumbsItem from "./_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue";
|
|
14
|
-
import {
|
|
17
|
+
import { breadcrumbsProps } from "./vc-breadcrumbs-model";
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
items: () => [],
|
|
18
|
-
});
|
|
19
|
+
defineProps(breadcrumbsProps);
|
|
19
20
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentPublicInstance } from "vue";
|
|
2
|
-
import { VcEditorProps } from "./vc-editor-model";
|
|
2
|
+
import { VcEditorEmits, VcEditorProps } from "./vc-editor-model";
|
|
3
3
|
import { ComponentConstructor } from "./../../../types/ts-helpers";
|
|
4
4
|
import Editor from "./vc-editor.vue";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
export const VcEditor: ComponentConstructor<ComponentPublicInstance<VcEditorProps, any, any, any, any, VcEditorEmits>> =
|
|
7
|
+
Editor;
|
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
import { VNode } from "vue";
|
|
2
|
+
import { ExtractTypes } from "./../../../types/ts-helpers";
|
|
3
|
+
import { isString, isNumber, isDate } from "./../../../utils";
|
|
2
4
|
|
|
3
|
-
export
|
|
4
|
-
placeholder
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
export const editorProps = {
|
|
6
|
+
placeholder: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "",
|
|
9
|
+
},
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [String, Number, Date],
|
|
12
|
+
default: null,
|
|
13
|
+
},
|
|
14
|
+
required: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
18
|
+
disabled: Boolean,
|
|
19
|
+
label: String,
|
|
20
|
+
tooltip: String,
|
|
21
|
+
name: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "Field",
|
|
24
|
+
},
|
|
25
|
+
errorMessage: String,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const editorEmits = {
|
|
29
|
+
"update:modelValue": (value: string | number | Date) => isString(value) || isNumber(value) || isDate(value),
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type VcEditorProps = ExtractTypes<typeof editorProps>;
|
|
33
|
+
export type VcEditorEmits = typeof editorEmits;
|
|
14
34
|
|
|
15
35
|
export interface VcEditorSlots {
|
|
16
36
|
error: () => VNode[];
|
|
@@ -9,9 +9,17 @@
|
|
|
9
9
|
]"
|
|
10
10
|
>
|
|
11
11
|
<!-- Editor label -->
|
|
12
|
-
<VcLabel
|
|
12
|
+
<VcLabel
|
|
13
|
+
v-if="label"
|
|
14
|
+
class="tw-mb-2"
|
|
15
|
+
:required="required"
|
|
16
|
+
>
|
|
13
17
|
<span>{{ label }}</span>
|
|
14
|
-
<template
|
|
18
|
+
<template
|
|
19
|
+
v-if="tooltip"
|
|
20
|
+
v-slot:tooltip
|
|
21
|
+
>{{ tooltip }}</template
|
|
22
|
+
>
|
|
15
23
|
</VcLabel>
|
|
16
24
|
|
|
17
25
|
<!-- Editor field -->
|
|
@@ -22,7 +30,10 @@
|
|
|
22
30
|
theme="chrome"
|
|
23
31
|
@input="onInput"
|
|
24
32
|
/>
|
|
25
|
-
<slot
|
|
33
|
+
<slot
|
|
34
|
+
v-if="errorMessage"
|
|
35
|
+
name="error"
|
|
36
|
+
>
|
|
26
37
|
<VcHint class="vc-editor__error">
|
|
27
38
|
{{ errorMessage }}
|
|
28
39
|
</VcHint>
|
|
@@ -35,16 +46,11 @@ import { VAceEditor } from "vue3-ace-editor";
|
|
|
35
46
|
import "ace-builds/src-noconflict/mode-html";
|
|
36
47
|
import "ace-builds/src-noconflict/theme-chrome";
|
|
37
48
|
import { ref, unref, watch } from "vue";
|
|
38
|
-
import {
|
|
49
|
+
import { editorEmits, editorProps } from "./vc-editor-model";
|
|
39
50
|
|
|
40
|
-
const props =
|
|
41
|
-
placeholder: "",
|
|
42
|
-
modelValue: null,
|
|
43
|
-
required: false,
|
|
44
|
-
name: "Field",
|
|
45
|
-
});
|
|
51
|
+
const props = defineProps(editorProps);
|
|
46
52
|
|
|
47
|
-
const emit = defineEmits(
|
|
53
|
+
const emit = defineEmits(editorEmits);
|
|
48
54
|
const content = ref();
|
|
49
55
|
|
|
50
56
|
watch(
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ComponentPublicInstance } from "vue";
|
|
2
|
-
import { VcFileUploadProps } from "./vc-file-upload-model";
|
|
2
|
+
import { VcFileUploadEmits, VcFileUploadProps } from "./vc-file-upload-model";
|
|
3
3
|
import { ComponentConstructor } from "./../../../types/ts-helpers";
|
|
4
4
|
import FileUpload from "./vc-file-upload.vue";
|
|
5
5
|
export const VcFileUpload: ComponentConstructor<
|
|
6
|
-
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
ComponentPublicInstance<VcFileUploadProps, any, any, any, any, VcFileUploadEmits>
|
|
7
8
|
> = FileUpload;
|
|
@@ -1,14 +1,36 @@
|
|
|
1
|
-
import { VNode } from "vue";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { PropType, VNode } from "vue";
|
|
2
|
+
import { ExtractTypes } from "./../../../types/ts-helpers";
|
|
3
|
+
|
|
4
|
+
export const fileUploadProps = {
|
|
5
|
+
variant: {
|
|
6
|
+
type: String as PropType<"gallery" | "file-upload">,
|
|
7
|
+
default: "gallery",
|
|
8
|
+
},
|
|
9
|
+
loading: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false,
|
|
12
|
+
},
|
|
13
|
+
accept: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ".jpg, .png, .jpeg",
|
|
16
|
+
},
|
|
17
|
+
multiple: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
rules: [String, Object] as PropType<string | Record<string, unknown>>,
|
|
22
|
+
name: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "Gallery",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const fileUploadEmits = {
|
|
29
|
+
upload: (files: FileList) => !!files,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type VcFileUploadProps = ExtractTypes<typeof fileUploadProps>;
|
|
33
|
+
export type VcFileUploadEmits = typeof fileUploadEmits;
|
|
12
34
|
|
|
13
35
|
export interface VcFileUploadSlots {
|
|
14
36
|
error: () => VNode[];
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
size="xxl"
|
|
19
19
|
></VcIcon>
|
|
20
20
|
|
|
21
|
-
<div
|
|
22
|
-
class="tw-text-[#9db0be] tw-text-center tw-text-lg tw-leading-lg tw-mt-4"
|
|
23
|
-
>
|
|
21
|
+
<div class="tw-text-[#9db0be] tw-text-center tw-text-lg tw-leading-lg tw-mt-4">
|
|
24
22
|
<span>Drag and drop file here or</span>
|
|
25
23
|
<br />
|
|
26
24
|
<VcLink @click="toggleUploader">browse your files</VcLink>
|
|
@@ -36,7 +34,10 @@
|
|
|
36
34
|
:name="name"
|
|
37
35
|
/>
|
|
38
36
|
</div>
|
|
39
|
-
<slot
|
|
37
|
+
<slot
|
|
38
|
+
v-if="errorMessage"
|
|
39
|
+
name="error"
|
|
40
|
+
>
|
|
40
41
|
<VcHint class="vc-input__error">
|
|
41
42
|
{{ errorMessage }}
|
|
42
43
|
</VcHint>
|
|
@@ -47,23 +48,18 @@
|
|
|
47
48
|
<script lang="ts" setup>
|
|
48
49
|
import { getCurrentInstance, ref, unref } from "vue";
|
|
49
50
|
import { useField } from "vee-validate";
|
|
50
|
-
import {
|
|
51
|
+
import { fileUploadEmits, fileUploadProps } from "./vc-file-upload-model";
|
|
52
|
+
|
|
53
|
+
const props = defineProps(fileUploadProps);
|
|
51
54
|
|
|
52
|
-
const
|
|
53
|
-
variant: "gallery",
|
|
54
|
-
loading: false,
|
|
55
|
-
accept: ".jpg, .png, .jpeg",
|
|
56
|
-
multiple: false,
|
|
57
|
-
name: "Gallery",
|
|
58
|
-
});
|
|
55
|
+
const emit = defineEmits(fileUploadEmits);
|
|
59
56
|
|
|
60
|
-
const emit = defineEmits(["upload"]);
|
|
61
57
|
const instance = getCurrentInstance();
|
|
62
58
|
// Prepare validation rules using required and rules props combination
|
|
63
59
|
let internalRules = unref(props.rules) || "";
|
|
64
60
|
|
|
65
61
|
// Prepare field-level validation
|
|
66
|
-
const { errorMessage, handleChange,
|
|
62
|
+
const { errorMessage, handleChange, validate } = useField(
|
|
67
63
|
`${props.name === "Gallery" ? instance?.uid : props.name}`,
|
|
68
64
|
internalRules
|
|
69
65
|
);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ComponentPublicInstance } from "vue";
|
|
2
2
|
import { ComponentConstructor } from "./../../../types/ts-helpers";
|
|
3
3
|
import Input from "./vc-input.vue";
|
|
4
|
-
import { VcInputProps } from "./vc-input-model";
|
|
5
|
-
|
|
6
|
-
export const VcInput: ComponentConstructor<
|
|
7
|
-
|
|
8
|
-
> = Input;
|
|
4
|
+
import { VcInputEmits, VcInputProps } from "./vc-input-model";
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
export const VcInput: ComponentConstructor<ComponentPublicInstance<VcInputProps, any, any, any, any, VcInputEmits>> =
|
|
7
|
+
Input;
|