@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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { default as useFunctions } from "./useFunctions";
|
|
2
2
|
export { default as useI18n } from "./useI18n";
|
|
3
|
-
export { default as useLogger } from "./useLogger";
|
|
4
3
|
export { default as useUser } from "./useUser";
|
|
5
4
|
export { default as useNotifications } from "./useNotifications";
|
|
6
5
|
export { default as useSettings } from "./useSettings";
|
|
@@ -11,10 +11,7 @@ interface UseApiClient<ApiClient extends IAuthApiBase> {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function useApiClient<ApiClient extends IAuthApiBase>(
|
|
14
|
-
c: new (
|
|
15
|
-
baseUrl?: string,
|
|
16
|
-
http?: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> }
|
|
17
|
-
) => ApiClient
|
|
14
|
+
c: new (baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> }) => ApiClient
|
|
18
15
|
): UseApiClient<ApiClient> {
|
|
19
16
|
const { getAccessToken } = useUser();
|
|
20
17
|
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { readonly, ref } from "vue";
|
|
2
2
|
import { HasLoading } from "../useLoading";
|
|
3
|
-
import useLogger from "../useLogger";
|
|
4
3
|
|
|
5
|
-
export type AsyncAction<Payload = void, Result = void> = (
|
|
6
|
-
payload?: Payload
|
|
7
|
-
) => Promise<Result>;
|
|
4
|
+
export type AsyncAction<Payload = void, Result = void> = (payload?: Payload) => Promise<Result>;
|
|
8
5
|
|
|
9
6
|
export interface UseAsync<Payload = void, Result = void> extends HasLoading {
|
|
10
7
|
action: AsyncAction<Payload, Result>;
|
|
@@ -13,7 +10,6 @@ export interface UseAsync<Payload = void, Result = void> extends HasLoading {
|
|
|
13
10
|
export function useAsync<Payload = void, Result = void>(
|
|
14
11
|
innerAction: AsyncAction<Payload, Result>
|
|
15
12
|
): UseAsync<Payload, Result> {
|
|
16
|
-
const logger = useLogger();
|
|
17
13
|
const loading = ref(false);
|
|
18
14
|
|
|
19
15
|
async function action(payload?: Payload): Promise<Result> {
|
|
@@ -21,7 +17,7 @@ export function useAsync<Payload = void, Result = void>(
|
|
|
21
17
|
try {
|
|
22
18
|
return await innerAction(payload);
|
|
23
19
|
} catch (e) {
|
|
24
|
-
|
|
20
|
+
console.error(e);
|
|
25
21
|
throw e;
|
|
26
22
|
} finally {
|
|
27
23
|
loading.value = false;
|
|
@@ -8,9 +8,7 @@ interface IUseAutosave {
|
|
|
8
8
|
|
|
9
9
|
export default (data, modified, defaultName: string): IUseAutosave => {
|
|
10
10
|
const rawValue = computed(() => (isRef(data) ? unref(data) : data));
|
|
11
|
-
const isModified = computed(() =>
|
|
12
|
-
isRef(modified) ? unref(modified) : modified
|
|
13
|
-
);
|
|
11
|
+
const isModified = computed(() => (isRef(modified) ? unref(modified) : modified));
|
|
14
12
|
const savedValue = ref();
|
|
15
13
|
|
|
16
14
|
const isSaving = ref(false);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export default function debounce(
|
|
2
|
-
func: (...args: unknown[]) => void,
|
|
3
|
-
delay: number
|
|
4
|
-
): (...args: unknown[]) => void {
|
|
1
|
+
export default function debounce(func: (...args: unknown[]) => void, delay: number): (...args: unknown[]) => void {
|
|
5
2
|
console.debug(`[@vc-shell/framework#useFunctions:debounce] - Entry point`);
|
|
6
3
|
let timer: number | null = null;
|
|
7
4
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export default function delay(
|
|
2
|
-
func: (...args: unknown[]) => void,
|
|
3
|
-
delay = 0
|
|
4
|
-
): void {
|
|
1
|
+
export default function delay(func: (...args: unknown[]) => void, delay = 0): void {
|
|
5
2
|
console.debug(`[@vc-shell/framework#useFunctions:delay] - Entry point`);
|
|
6
3
|
setTimeout(func, delay);
|
|
7
4
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
const resultsMap = new WeakMap();
|
|
2
2
|
|
|
3
|
-
export default function once(
|
|
4
|
-
func: (...args: unknown[]) => void
|
|
5
|
-
): (...args: unknown[]) => unknown {
|
|
3
|
+
export default function once(func: (...args: unknown[]) => void): (...args: unknown[]) => unknown {
|
|
6
4
|
console.debug(`[@vc-shell/framework#useFunctions:once] - Entry point`);
|
|
7
5
|
return function (...args: unknown[]): unknown {
|
|
8
6
|
if (!resultsMap.has(func)) {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export default function throttle(
|
|
2
|
-
func: (...args: unknown[]) => void,
|
|
3
|
-
delay: number
|
|
4
|
-
): (...args: unknown[]) => void {
|
|
1
|
+
export default function throttle(func: (...args: unknown[]) => void, delay: number): (...args: unknown[]) => void {
|
|
5
2
|
console.debug(`[@vc-shell/framework#useFunctions:throttle] - Entry point`);
|
|
6
3
|
let wasThrottled = false;
|
|
7
4
|
|
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {Composer, createI18n, useI18n as VueUseI18n, VueMessageType} from "vue-i18n";
|
|
1
|
+
import { useI18n as VueUseI18n } from "vue-i18n";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const i18nPlugin = createI18n({
|
|
7
|
-
legacy: false,
|
|
8
|
-
globalInjection: true,
|
|
9
|
-
locale: "en",
|
|
10
|
-
fallbackLocale: "en",
|
|
11
|
-
});
|
|
12
|
-
app.use(i18nPlugin);
|
|
13
|
-
|
|
14
|
-
app.config.globalProperties.$mergeLocaleMessage =
|
|
15
|
-
i18nPlugin.global.mergeLocaleMessage;
|
|
16
|
-
|
|
17
|
-
return app;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default function useI18n(): Composer<
|
|
21
|
-
unknown,
|
|
22
|
-
unknown,
|
|
23
|
-
unknown,
|
|
24
|
-
{}
|
|
25
|
-
> {
|
|
3
|
+
/** @deprecated use `useI18n({ useScope: "global" })` directly from `vue-i18n` */
|
|
4
|
+
export default function useI18n() {
|
|
26
5
|
console.debug(`[@vc-shell/framework#useI18n] - Entry point`);
|
|
27
6
|
return VueUseI18n({ useScope: "global" });
|
|
28
7
|
}
|
|
@@ -4,8 +4,6 @@ export interface HasLoading {
|
|
|
4
4
|
loading: Readonly<Ref<boolean>>;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export function useLoading(
|
|
8
|
-
...args: Readonly<Ref<boolean>>[]
|
|
9
|
-
): ComputedRef<boolean> {
|
|
7
|
+
export function useLoading(...args: Readonly<Ref<boolean>>[]): ComputedRef<boolean> {
|
|
10
8
|
return computed(() => args.some((item) => item.value));
|
|
11
9
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PushNotification, PushNotificationClient } from "./../../../core/api";
|
|
2
2
|
import useUser from "../useUser";
|
|
3
3
|
import { computed, ComputedRef, readonly, ref } from "vue";
|
|
4
|
-
import useLogger from "../useLogger";
|
|
5
4
|
import { orderBy, remove } from "lodash-es";
|
|
6
5
|
|
|
7
6
|
const notificationsClient = new PushNotificationClient();
|
|
@@ -22,7 +21,6 @@ const popupNotifications = ref<PushNotification[]>([]);
|
|
|
22
21
|
|
|
23
22
|
export default (): INotifications => {
|
|
24
23
|
const { getAccessToken } = useUser();
|
|
25
|
-
const logger = useLogger();
|
|
26
24
|
|
|
27
25
|
async function loadFromHistory(take = 10) {
|
|
28
26
|
const token = await getAccessToken();
|
|
@@ -41,11 +39,10 @@ export default (): INotifications => {
|
|
|
41
39
|
});
|
|
42
40
|
|
|
43
41
|
result.text().then((response) => {
|
|
44
|
-
notifications.value =
|
|
45
|
-
<PushNotification[]>JSON.parse(response).notifyEvents ?? [];
|
|
42
|
+
notifications.value = <PushNotification[]>JSON.parse(response).notifyEvents ?? [];
|
|
46
43
|
});
|
|
47
44
|
} catch (e) {
|
|
48
|
-
|
|
45
|
+
console.error(e);
|
|
49
46
|
throw e;
|
|
50
47
|
}
|
|
51
48
|
}
|
|
@@ -53,9 +50,7 @@ export default (): INotifications => {
|
|
|
53
50
|
|
|
54
51
|
function addNotification(message: PushNotification) {
|
|
55
52
|
if (message.notifyType !== "IndexProgressPushNotification") {
|
|
56
|
-
const existsNotification = notifications.value.find(
|
|
57
|
-
(x) => x.id == message.id
|
|
58
|
-
);
|
|
53
|
+
const existsNotification = notifications.value.find((x) => x.id == message.id);
|
|
59
54
|
|
|
60
55
|
if (existsNotification) {
|
|
61
56
|
message.isNew = existsNotification.isNew;
|
|
@@ -95,16 +90,14 @@ export default (): INotifications => {
|
|
|
95
90
|
return x;
|
|
96
91
|
});
|
|
97
92
|
} catch (e) {
|
|
98
|
-
|
|
93
|
+
console.error(e);
|
|
99
94
|
throw e;
|
|
100
95
|
}
|
|
101
96
|
}
|
|
102
97
|
}
|
|
103
98
|
|
|
104
99
|
return {
|
|
105
|
-
notifications: computed(() =>
|
|
106
|
-
readonly(orderBy(notifications.value, ["created"], ["desc"]))
|
|
107
|
-
),
|
|
100
|
+
notifications: computed(() => readonly(orderBy(notifications.value, ["created"], ["desc"]))),
|
|
108
101
|
popupNotifications: computed(() => readonly(popupNotifications.value)),
|
|
109
102
|
loadFromHistory,
|
|
110
103
|
addNotification,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useUser
|
|
1
|
+
import { useUser } from "./../../../core/composables";
|
|
2
2
|
import { computed, Ref, ref } from "vue";
|
|
3
3
|
import { SettingClient } from "./../../../core/api";
|
|
4
4
|
|
|
@@ -20,7 +20,6 @@ const uiSettings = ref<IUISetting>({
|
|
|
20
20
|
});
|
|
21
21
|
export default (): IUseSettings => {
|
|
22
22
|
const { getAccessToken } = useUser();
|
|
23
|
-
const logger = useLogger();
|
|
24
23
|
|
|
25
24
|
async function getApiClient() {
|
|
26
25
|
const client = new SettingClient();
|
|
@@ -41,7 +40,7 @@ export default (): IUseSettings => {
|
|
|
41
40
|
title: settings.title,
|
|
42
41
|
};
|
|
43
42
|
} catch (e) {
|
|
44
|
-
|
|
43
|
+
console.error(e);
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
|
|
@@ -32,25 +32,13 @@ interface IUseUser {
|
|
|
32
32
|
signOut: () => Promise<void>;
|
|
33
33
|
validateToken: (userId: string, token: string) => Promise<boolean>;
|
|
34
34
|
validatePassword: (password: string) => Promise<IdentityResult>;
|
|
35
|
-
resetPasswordByToken: (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
token: string
|
|
39
|
-
) => Promise<SecurityResult>;
|
|
40
|
-
requestPasswordReset: (
|
|
41
|
-
loginOrEmail: string
|
|
42
|
-
) => Promise<RequestPasswordResult>;
|
|
43
|
-
changeUserPassword: (
|
|
44
|
-
oldPassword: string,
|
|
45
|
-
newPassword: string
|
|
46
|
-
) => Promise<SecurityResult>;
|
|
35
|
+
resetPasswordByToken: (userId: string, password: string, token: string) => Promise<SecurityResult>;
|
|
36
|
+
requestPasswordReset: (loginOrEmail: string) => Promise<RequestPasswordResult>;
|
|
37
|
+
changeUserPassword: (oldPassword: string, newPassword: string) => Promise<SecurityResult>;
|
|
47
38
|
}
|
|
48
39
|
|
|
49
40
|
export default (): IUseUser => {
|
|
50
|
-
async function validateToken(
|
|
51
|
-
userId: string,
|
|
52
|
-
token: string
|
|
53
|
-
): Promise<boolean> {
|
|
41
|
+
async function validateToken(userId: string, token: string): Promise<boolean> {
|
|
54
42
|
let result = false;
|
|
55
43
|
try {
|
|
56
44
|
loading.value = true;
|
|
@@ -69,21 +57,14 @@ export default (): IUseUser => {
|
|
|
69
57
|
return securityClient.validatePassword(password);
|
|
70
58
|
}
|
|
71
59
|
|
|
72
|
-
async function resetPasswordByToken(
|
|
73
|
-
userId: string,
|
|
74
|
-
password: string,
|
|
75
|
-
token: string
|
|
76
|
-
): Promise<SecurityResult> {
|
|
60
|
+
async function resetPasswordByToken(userId: string, password: string, token: string): Promise<SecurityResult> {
|
|
77
61
|
return securityClient.resetPasswordByToken(userId, {
|
|
78
62
|
newPassword: password,
|
|
79
63
|
token,
|
|
80
64
|
} as ResetPasswordConfirmRequest);
|
|
81
65
|
}
|
|
82
66
|
|
|
83
|
-
async function signIn(
|
|
84
|
-
username: string,
|
|
85
|
-
password: string
|
|
86
|
-
): Promise<SignInResults> {
|
|
67
|
+
async function signIn(username: string, password: string): Promise<SignInResults> {
|
|
87
68
|
console.debug(`[@vc-shell/framework#useUser:signIn] - Entry point`);
|
|
88
69
|
let token = undefined;
|
|
89
70
|
try {
|
|
@@ -103,10 +84,7 @@ export default (): IUseUser => {
|
|
|
103
84
|
expiresAt: addOffsetToCurrentDate(Number(token.data["expires_in"])),
|
|
104
85
|
userName: username,
|
|
105
86
|
};
|
|
106
|
-
console.log(
|
|
107
|
-
"[userUsers]: an access token has been obtained successfully",
|
|
108
|
-
authData.value
|
|
109
|
-
);
|
|
87
|
+
console.log("[userUsers]: an access token has been obtained successfully", authData.value);
|
|
110
88
|
|
|
111
89
|
storeAuthData(authData.value);
|
|
112
90
|
await loadUser();
|
|
@@ -153,9 +131,7 @@ export default (): IUseUser => {
|
|
|
153
131
|
authData.value.refreshToken ?? "",
|
|
154
132
|
{}
|
|
155
133
|
);
|
|
156
|
-
console.log(
|
|
157
|
-
"[userUsers]: an access token is expired, using refresh token to receive a new"
|
|
158
|
-
);
|
|
134
|
+
console.log("[userUsers]: an access token is expired, using refresh token to receive a new");
|
|
159
135
|
try {
|
|
160
136
|
const newToken = await token.refresh();
|
|
161
137
|
if (newToken) {
|
|
@@ -164,9 +140,7 @@ export default (): IUseUser => {
|
|
|
164
140
|
accessToken: newToken.accessToken,
|
|
165
141
|
token: newToken.accessToken,
|
|
166
142
|
refreshToken: newToken.refreshToken,
|
|
167
|
-
expiresAt: addOffsetToCurrentDate(
|
|
168
|
-
Number(newToken.data["expires_in"])
|
|
169
|
-
),
|
|
143
|
+
expiresAt: addOffsetToCurrentDate(Number(newToken.data["expires_in"])),
|
|
170
144
|
};
|
|
171
145
|
storeAuthData(authData.value);
|
|
172
146
|
}
|
|
@@ -179,24 +153,17 @@ export default (): IUseUser => {
|
|
|
179
153
|
}
|
|
180
154
|
|
|
181
155
|
function storeAuthData(authData: AuthData) {
|
|
182
|
-
localStorage.setItem(
|
|
183
|
-
VC_AUTH_DATA_KEY,
|
|
184
|
-
JSON.stringify({ ...(authData || {}) })
|
|
185
|
-
);
|
|
156
|
+
localStorage.setItem(VC_AUTH_DATA_KEY, JSON.stringify({ ...(authData || {}) }));
|
|
186
157
|
}
|
|
187
158
|
function readAuthData(): AuthData {
|
|
188
|
-
return JSON.parse(
|
|
189
|
-
localStorage.getItem(VC_AUTH_DATA_KEY) || "{}"
|
|
190
|
-
) as AuthData;
|
|
159
|
+
return JSON.parse(localStorage.getItem(VC_AUTH_DATA_KEY) || "{}") as AuthData;
|
|
191
160
|
}
|
|
192
161
|
|
|
193
162
|
function addOffsetToCurrentDate(offsetInSeconds: number): number {
|
|
194
163
|
return Date.now() + offsetInSeconds * 1000;
|
|
195
164
|
}
|
|
196
165
|
|
|
197
|
-
async function requestPasswordReset(
|
|
198
|
-
loginOrEmail: string
|
|
199
|
-
): Promise<RequestPasswordResult> {
|
|
166
|
+
async function requestPasswordReset(loginOrEmail: string): Promise<RequestPasswordResult> {
|
|
200
167
|
try {
|
|
201
168
|
loading.value = true;
|
|
202
169
|
await securityClient.requestPasswordReset(loginOrEmail);
|
|
@@ -209,10 +176,7 @@ export default (): IUseUser => {
|
|
|
209
176
|
}
|
|
210
177
|
}
|
|
211
178
|
|
|
212
|
-
async function changeUserPassword(
|
|
213
|
-
oldPassword: string,
|
|
214
|
-
newPassword: string
|
|
215
|
-
): Promise<SecurityResult> {
|
|
179
|
+
async function changeUserPassword(oldPassword: string, newPassword: string): Promise<SecurityResult> {
|
|
216
180
|
const token = await getAccessToken();
|
|
217
181
|
let result;
|
|
218
182
|
|
|
@@ -220,21 +184,18 @@ export default (): IUseUser => {
|
|
|
220
184
|
if (token) {
|
|
221
185
|
try {
|
|
222
186
|
loading.value = true;
|
|
223
|
-
const res = await fetch(
|
|
224
|
-
"
|
|
225
|
-
{
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}),
|
|
236
|
-
}
|
|
237
|
-
);
|
|
187
|
+
const res = await fetch("/api/platform/security/currentuser/changepassword", {
|
|
188
|
+
method: "POST",
|
|
189
|
+
headers: {
|
|
190
|
+
"Content-Type": "application/json-patch+json",
|
|
191
|
+
Accept: "text/plain",
|
|
192
|
+
authorization: `Bearer ${token}`,
|
|
193
|
+
},
|
|
194
|
+
body: JSON.stringify({
|
|
195
|
+
oldPassword,
|
|
196
|
+
newPassword,
|
|
197
|
+
}),
|
|
198
|
+
});
|
|
238
199
|
if (res.status !== 500) {
|
|
239
200
|
result = await res.text().then((response) => {
|
|
240
201
|
return JSON.parse(response);
|
package/core/plugins/index.ts
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { App } from "vue";
|
|
2
|
+
import { default as i18n } from "../i18n";
|
|
3
|
+
|
|
4
|
+
export const createModule = (components: unknown, locales?: unknown) => ({
|
|
5
|
+
install(app: App): void {
|
|
6
|
+
// Register components
|
|
7
|
+
Object.entries(components).forEach(([componentName, component]) => {
|
|
8
|
+
app.component(componentName, component);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// Load locales
|
|
12
|
+
if (locales) {
|
|
13
|
+
Object.entries(locales).forEach(([key, message]) => {
|
|
14
|
+
i18n.global.mergeLocaleMessage(key, message);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const createAppModule = (pages: unknown, locales?: unknown) => {
|
|
21
|
+
const module = createModule(pages, locales);
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
install(app: App): void {
|
|
25
|
+
// Register pages
|
|
26
|
+
Object.entries(pages).forEach(([, page]) => {
|
|
27
|
+
app.config.globalProperties.pages?.push(page);
|
|
28
|
+
});
|
|
29
|
+
module.install(app);
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
import { default as moment, Duration, RelativeTimeKey } from "moment";
|
|
3
3
|
|
|
4
|
-
type momentUnit = Extract<
|
|
5
|
-
moment.RelativeTimeKey,
|
|
6
|
-
"s" | "m" | "h" | "d" | "w" | "M" | "y"
|
|
7
|
-
>;
|
|
4
|
+
type momentUnit = Extract<moment.RelativeTimeKey, "s" | "m" | "h" | "d" | "w" | "M" | "y">;
|
|
8
5
|
|
|
9
6
|
const momentUnits: momentUnit[] = ["s", "m", "h", "d", "w", "M", "y"];
|
|
10
7
|
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
import { localize } from "@vee-validate/i18n";
|
|
2
|
+
import en from "@vee-validate/i18n/dist/locale/en.json";
|
|
3
|
+
import * as veeValidate from "vee-validate";
|
|
4
|
+
|
|
5
|
+
veeValidate.configure({
|
|
6
|
+
generateMessage: localize({ en }),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
/** @deprecated Use `useForm` directly from `vee-validate` */
|
|
10
|
+
export const useForm = veeValidate.useForm;
|
|
11
|
+
|
|
1
12
|
export * from "./rules";
|
|
2
|
-
export { useForm } from "vee-validate";
|