@vc-shell/framework 1.0.52 → 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 +9 -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 +6 -13
- package/core/composables/usePermissions/index.ts +1 -1
- package/core/composables/useSettings/index.ts +3 -4
- package/core/composables/useUser/index.ts +27 -66
- package/core/directives/permissions/index.ts +1 -1
- 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 +7 -9
- 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 +9 -3
- 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 +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 +2 -2
- 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 +5 -6
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.esm.js +42553 -0
- package/dist/framework.js +74 -72
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/app-switcher/composables/useAppSwitcher/index.d.ts +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 +2 -2
- 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/blade-navigation/types/index.d.ts +1 -1
- package/dist/shared/blade-navigation/types/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 +3 -3
- 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 -20
- 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 +3 -3
- 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 -24
- 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 +5 -0
- package/dist/ui/components/atoms/vc-card/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-card/vc-card-model.d.ts +33 -0
- package/dist/ui/components/atoms/vc-card/vc-card-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-checkbox/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-checkbox/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox-model.d.ts +31 -0
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-col/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-col/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-col/vc-col-model.d.ts +13 -0
- package/dist/ui/components/atoms/vc-col/vc-col-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-container/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-container/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-container/vc-container-model.d.ts +25 -0
- package/dist/ui/components/atoms/vc-container/vc-container-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-hint/index.d.ts +2 -0
- package/dist/ui/components/atoms/vc-hint/index.d.ts.map +1 -0
- 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 +5 -0
- package/dist/ui/components/atoms/vc-icon/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/vc-icon-model.d.ts +17 -0
- package/dist/ui/components/atoms/vc-icon/vc-icon-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-image/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-image/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-image/vc-image-model.d.ts +38 -0
- package/dist/ui/components/atoms/vc-image/vc-image-model.d.ts.map +1 -0
- 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 +5 -0
- package/dist/ui/components/atoms/vc-info-row/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-info-row/vc-info-row-model.d.ts +25 -0
- package/dist/ui/components/atoms/vc-info-row/vc-info-row-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-label/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-label/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-label/vc-label-model.d.ts +18 -0
- package/dist/ui/components/atoms/vc-label/vc-label-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-link/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-link/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-link/vc-link-model.d.ts +21 -0
- package/dist/ui/components/atoms/vc-link/vc-link-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-loading/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-loading/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-loading/vc-loading-model.d.ts +13 -0
- package/dist/ui/components/atoms/vc-loading/vc-loading-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-progress/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-progress/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-progress/vc-progress-model.d.ts +17 -0
- package/dist/ui/components/atoms/vc-progress/vc-progress-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-row/index.d.ts +2 -0
- package/dist/ui/components/atoms/vc-row/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-row/vc-row-model.d.ts +5 -0
- package/dist/ui/components/atoms/vc-row/vc-row-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-status/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-status/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-status/vc-status-model.d.ts +21 -0
- package/dist/ui/components/atoms/vc-status/vc-status-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-status-icon/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-status-icon/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-status-icon/vc-status-icon-model.d.ts +13 -0
- package/dist/ui/components/atoms/vc-status-icon/vc-status-icon-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-switch/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-switch/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-switch/vc-switch-model.d.ts +30 -0
- package/dist/ui/components/atoms/vc-switch/vc-switch-model.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-widget/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-widget/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-widget/vc-widget-model.d.ts +20 -0
- package/dist/ui/components/atoms/vc-widget/vc-widget-model.d.ts.map +1 -0
- package/dist/ui/components/index.d.ts +34 -34
- package/dist/ui/components/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/index.d.ts +5 -0
- package/dist/ui/components/molecules/vc-breadcrumbs/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs-model.d.ts +19 -0
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs-model.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-editor/index.d.ts +5 -0
- package/dist/ui/components/molecules/vc-editor/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-editor/vc-editor-model.d.ts +33 -0
- package/dist/ui/components/molecules/vc-editor/vc-editor-model.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts +5 -0
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload-model.d.ts +34 -0
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload-model.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-form/index.d.ts +2 -0
- package/dist/ui/components/molecules/vc-form/index.d.ts.map +1 -0
- 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 +3 -3
- 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 +3 -3
- 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 +5 -0
- package/dist/ui/components/molecules/vc-notification/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-notification/vc-notification-model.d.ts +18 -0
- package/dist/ui/components/molecules/vc-notification/vc-notification-model.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-pagination/index.d.ts +5 -0
- package/dist/ui/components/molecules/vc-pagination/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-pagination/vc-pagination-model.d.ts +25 -0
- package/dist/ui/components/molecules/vc-pagination/vc-pagination-model.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-rating/index.d.ts +5 -0
- package/dist/ui/components/molecules/vc-rating/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-rating/vc-rating-model.d.ts +21 -0
- package/dist/ui/components/molecules/vc-rating/vc-rating-model.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/index.d.ts +3 -3
- 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 +5 -0
- package/dist/ui/components/molecules/vc-slider/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-slider/vc-slider-model.d.ts +33 -0
- package/dist/ui/components/molecules/vc-slider/vc-slider-model.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-textarea/index.d.ts +5 -0
- package/dist/ui/components/molecules/vc-textarea/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-textarea/vc-textarea-model.d.ts +37 -0
- package/dist/ui/components/molecules/vc-textarea/vc-textarea-model.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/index.d.ts +5 -0
- package/dist/ui/components/organisms/vc-app/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/vc-app-model.d.ts +61 -0
- package/dist/ui/components/organisms/vc-app/vc-app-model.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/index.d.ts +5 -0
- package/dist/ui/components/organisms/vc-blade/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/vc-blade-model.d.ts +34 -0
- package/dist/ui/components/organisms/vc-blade/vc-blade-model.d.ts.map +1 -0
- 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 +5 -0
- package/dist/ui/components/organisms/vc-dynamic-property/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property-model.d.ts +43 -0
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property-model.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-gallery/index.d.ts +5 -0
- package/dist/ui/components/organisms/vc-gallery/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-gallery/vc-gallery-model.d.ts +74 -0
- package/dist/ui/components/organisms/vc-gallery/vc-gallery-model.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-login-form/index.d.ts +5 -0
- package/dist/ui/components/organisms/vc-login-form/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-login-form/vc-login-form-model.d.ts +15 -0
- package/dist/ui/components/organisms/vc-login-form/vc-login-form-model.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-popup/index.d.ts +5 -0
- package/dist/ui/components/organisms/vc-popup/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-popup/vc-popup-model.d.ts +22 -0
- package/dist/ui/components/organisms/vc-popup/vc-popup-model.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/index.d.ts +5 -0
- package/dist/ui/components/organisms/vc-table/index.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/vc-table-model.d.ts +135 -0
- package/dist/ui/components/organisms/vc-table/vc-table-model.d.ts.map +1 -0
- package/dist/ui/types/index.d.ts +76 -6
- 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 +9 -11
- package/shared/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +3 -6
- package/shared/app-switcher/composables/useAppSwitcher/index.ts +3 -8
- package/shared/app-switcher/index.ts +3 -10
- package/shared/assets/components/assets-details/assets-details.vue +10 -31
- 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 +8 -37
- package/shared/blade-navigation/index.ts +3 -10
- package/shared/blade-navigation/types/index.ts +1 -1
- package/shared/index.ts +9 -11
- package/ui/components/atoms/vc-badge/index.ts +5 -5
- package/ui/components/atoms/vc-badge/vc-badge-model.ts +21 -20
- package/ui/components/atoms/vc-badge/vc-badge.vue +5 -11
- package/ui/components/atoms/vc-button/index.ts +5 -5
- package/ui/components/atoms/vc-button/vc-button-model.ts +31 -24
- package/ui/components/atoms/vc-button/vc-button.vue +9 -38
- package/ui/components/atoms/vc-card/index.ts +6 -0
- package/ui/components/atoms/vc-card/vc-card-model.ts +37 -0
- package/ui/components/atoms/vc-card/vc-card.vue +20 -36
- package/ui/components/atoms/vc-checkbox/index.ts +8 -0
- package/ui/components/atoms/vc-checkbox/vc-checkbox-model.ts +35 -0
- package/ui/components/atoms/vc-checkbox/vc-checkbox.vue +15 -30
- package/ui/components/atoms/vc-col/index.ts +5 -0
- package/ui/components/atoms/vc-col/vc-col-model.ts +15 -0
- package/ui/components/atoms/vc-col/vc-col.vue +2 -6
- package/ui/components/atoms/vc-container/index.ts +8 -0
- package/ui/components/atoms/vc-container/vc-container-model.ts +28 -0
- package/ui/components/atoms/vc-container/vc-container.vue +11 -26
- package/ui/components/atoms/vc-hint/index.ts +2 -0
- package/ui/components/atoms/vc-hint/vc-hint-model.ts +5 -0
- package/ui/components/atoms/vc-icon/index.ts +5 -0
- package/ui/components/atoms/vc-icon/vc-icon-model.ts +19 -0
- package/ui/components/atoms/vc-icon/vc-icon.vue +2 -8
- package/ui/components/atoms/vc-image/index.ts +7 -0
- package/ui/components/atoms/vc-image/vc-image-model.ts +41 -0
- package/ui/components/atoms/vc-image/vc-image.stories.ts +1 -2
- package/ui/components/atoms/vc-image/vc-image.vue +12 -42
- package/ui/components/atoms/vc-info-row/index.ts +5 -0
- package/ui/components/atoms/vc-info-row/vc-info-row-model.ts +27 -0
- package/ui/components/atoms/vc-info-row/vc-info-row.vue +14 -24
- package/ui/components/atoms/vc-label/index.ts +5 -0
- package/ui/components/atoms/vc-label/vc-label-model.ts +20 -0
- package/ui/components/atoms/vc-label/vc-label.vue +11 -15
- package/ui/components/atoms/vc-link/index.ts +6 -0
- package/ui/components/atoms/vc-link/vc-link-model.ts +24 -0
- package/ui/components/atoms/vc-link/vc-link.vue +4 -11
- package/ui/components/atoms/vc-loading/index.ts +5 -0
- package/ui/components/atoms/vc-loading/vc-loading-model.ts +15 -0
- package/ui/components/atoms/vc-loading/vc-loading.vue +5 -11
- package/ui/components/atoms/vc-progress/index.ts +5 -0
- package/ui/components/atoms/vc-progress/vc-progress-model.ts +19 -0
- package/ui/components/atoms/vc-progress/vc-progress.vue +5 -20
- package/ui/components/atoms/vc-row/index.ts +2 -0
- package/ui/components/atoms/vc-row/vc-row-model.ts +5 -0
- package/ui/components/atoms/vc-status/index.ts +5 -0
- package/ui/components/atoms/vc-status/vc-status-model.ts +23 -0
- package/ui/components/atoms/vc-status/vc-status.vue +3 -21
- package/ui/components/atoms/vc-status-icon/index.ts +5 -0
- package/ui/components/atoms/vc-status-icon/vc-status-icon-model.ts +15 -0
- package/ui/components/atoms/vc-status-icon/vc-status-icon.vue +11 -9
- package/ui/components/atoms/vc-switch/index.ts +7 -0
- package/ui/components/atoms/vc-switch/vc-switch-model.ts +34 -0
- package/ui/components/atoms/vc-switch/vc-switch.vue +12 -28
- package/ui/components/atoms/vc-widget/index.ts +7 -0
- package/ui/components/atoms/vc-widget/vc-widget-model.ts +23 -0
- package/ui/components/atoms/vc-widget/vc-widget.vue +15 -22
- package/ui/components/index.ts +34 -34
- package/ui/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue +1 -1
- package/ui/components/molecules/vc-breadcrumbs/index.ts +5 -0
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs-model.ts +23 -0
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +6 -14
- package/ui/components/molecules/vc-editor/index.ts +7 -0
- package/ui/components/molecules/vc-editor/vc-editor-model.ts +37 -0
- package/ui/components/molecules/vc-editor/vc-editor.vue +25 -56
- package/ui/components/molecules/vc-file-upload/index.ts +8 -0
- package/ui/components/molecules/vc-file-upload/vc-file-upload-model.ts +37 -0
- package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +11 -36
- package/ui/components/molecules/vc-form/index.ts +2 -0
- package/ui/components/molecules/vc-form/vc-form-model.ts +5 -0
- package/ui/components/molecules/vc-input/index.ts +5 -6
- 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 +4 -3
- 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 +8 -0
- package/ui/components/molecules/vc-notification/vc-notification-model.ts +21 -0
- package/ui/components/molecules/vc-notification/vc-notification.vue +4 -13
- package/ui/components/molecules/vc-pagination/index.ts +8 -0
- package/ui/components/molecules/vc-pagination/vc-pagination-model.ts +29 -0
- package/ui/components/molecules/vc-pagination/vc-pagination.vue +21 -23
- package/ui/components/molecules/vc-rating/index.ts +5 -0
- package/ui/components/molecules/vc-rating/vc-rating-model.ts +23 -0
- package/ui/components/molecules/vc-rating/vc-rating.vue +11 -13
- 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 +128 -173
- package/ui/components/molecules/vc-slider/index.ts +5 -0
- package/ui/components/molecules/vc-slider/vc-slider-model.ts +34 -0
- package/ui/components/molecules/vc-slider/vc-slider.vue +2 -26
- package/ui/components/molecules/vc-textarea/index.ts +8 -0
- package/ui/components/molecules/vc-textarea/vc-textarea-model.ts +41 -0
- package/ui/components/molecules/vc-textarea/vc-textarea.vue +19 -53
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +16 -12
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +13 -4
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +18 -15
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +11 -5
- package/ui/components/organisms/vc-app/index.ts +6 -0
- package/ui/components/organisms/vc-app/vc-app-model.ts +65 -0
- package/ui/components/organisms/vc-app/vc-app.vue +10 -52
- package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +40 -40
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +20 -14
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +14 -12
- package/ui/components/organisms/vc-blade/index.ts +7 -0
- package/ui/components/organisms/vc-blade/vc-blade-model.ts +37 -0
- package/ui/components/organisms/vc-blade/vc-blade.stories.ts +1 -2
- package/ui/components/organisms/vc-blade/vc-blade.vue +13 -40
- package/ui/components/organisms/vc-dynamic-property/index.ts +5 -0
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property-model.ts +58 -0
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +101 -125
- package/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue +41 -24
- package/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +16 -11
- package/ui/components/organisms/vc-gallery/index.ts +8 -0
- package/ui/components/organisms/vc-gallery/vc-gallery-model.ts +78 -0
- package/ui/components/organisms/vc-gallery/vc-gallery.vue +11 -88
- package/ui/components/organisms/vc-login-form/index.ts +5 -0
- package/ui/components/organisms/vc-login-form/vc-login-form-model.ts +16 -0
- package/ui/components/organisms/vc-login-form/vc-login-form.vue +2 -15
- package/ui/components/organisms/vc-popup/index.ts +7 -0
- package/ui/components/organisms/vc-popup/vc-popup-model.ts +25 -0
- package/ui/components/organisms/vc-popup/vc-popup.vue +7 -18
- package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +21 -27
- 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 +9 -3
- package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +31 -43
- package/ui/components/organisms/vc-table/index.ts +7 -0
- package/ui/components/organisms/vc-table/vc-table-model.ts +116 -0
- package/ui/components/organisms/vc-table/vc-table.vue +108 -139
- package/ui/types/index.ts +106 -15
- 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,132 +1,162 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { VNode, PropType } from "vue";
|
|
3
|
+
import { ExtractTypes } from "./../../../types/ts-helpers";
|
|
4
|
+
import { isString } from "./../../../utils";
|
|
2
5
|
|
|
3
|
-
export type OptionProp =
|
|
4
|
-
| ((option: string | Record<string, unknown>) => string)
|
|
5
|
-
| string
|
|
6
|
-
| undefined;
|
|
6
|
+
export type OptionProp = ((option: string | Record<string, unknown>) => string) | string | undefined;
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export const selectProps = {
|
|
9
9
|
/**
|
|
10
10
|
* Name of select
|
|
11
11
|
*/
|
|
12
|
-
name
|
|
12
|
+
name: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "Field",
|
|
15
|
+
},
|
|
13
16
|
/**
|
|
14
17
|
* Model of the component; Must be Array if using 'multiple' prop; Use this property with a listener for 'update:modelValue' event OR use v-model directive
|
|
15
18
|
*/
|
|
16
|
-
modelValue:
|
|
19
|
+
modelValue: null,
|
|
17
20
|
/**
|
|
18
21
|
* Try to map labels of model from 'options' Array; If you are using emit-value you will probably need to use map-options to display the label text in the select field rather than the value;
|
|
19
22
|
* Default value: true
|
|
20
23
|
*/
|
|
21
|
-
mapOptions
|
|
24
|
+
mapOptions: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true,
|
|
27
|
+
},
|
|
22
28
|
/**
|
|
23
29
|
* Does field have validation errors?
|
|
24
30
|
*/
|
|
25
|
-
error
|
|
31
|
+
error: Boolean,
|
|
26
32
|
/**
|
|
27
33
|
* Validation error message (gets displayed only if 'error' is set to 'true')
|
|
28
34
|
*/
|
|
29
|
-
errorMessage
|
|
35
|
+
errorMessage: String,
|
|
30
36
|
/**
|
|
31
37
|
* Select label
|
|
32
38
|
*/
|
|
33
|
-
label
|
|
39
|
+
label: String,
|
|
34
40
|
/**
|
|
35
41
|
* Select description (hint) text below input component
|
|
36
42
|
*/
|
|
37
|
-
hint
|
|
43
|
+
hint: String,
|
|
38
44
|
/**
|
|
39
45
|
* Prefix
|
|
40
46
|
*/
|
|
41
|
-
prefix
|
|
47
|
+
prefix: String,
|
|
42
48
|
/**
|
|
43
49
|
* Suffix
|
|
44
50
|
*/
|
|
45
|
-
suffix
|
|
51
|
+
suffix: String,
|
|
46
52
|
/**
|
|
47
53
|
* Signals the user a process is in progress by displaying a spinner
|
|
48
54
|
*/
|
|
49
|
-
loading
|
|
55
|
+
loading: Boolean,
|
|
50
56
|
/**
|
|
51
57
|
* Appends clearable icon when a value is set;
|
|
52
58
|
* When clicked, model becomes null
|
|
53
59
|
*/
|
|
54
|
-
clearable
|
|
60
|
+
clearable: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true,
|
|
63
|
+
},
|
|
55
64
|
/**
|
|
56
65
|
* Put component in disabled mode
|
|
57
66
|
*/
|
|
58
|
-
disabled
|
|
67
|
+
disabled: Boolean,
|
|
59
68
|
/**
|
|
60
69
|
* Allow multiple selection; Model must be Array
|
|
61
70
|
*/
|
|
62
|
-
multiple
|
|
71
|
+
multiple: Boolean,
|
|
63
72
|
/**
|
|
64
73
|
* Available options that the user can select from.
|
|
65
74
|
* Default value: []
|
|
66
75
|
*/
|
|
67
|
-
options
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
options: {
|
|
77
|
+
type: [Function, Array] as PropType<
|
|
78
|
+
| ((
|
|
79
|
+
keyword?: string,
|
|
80
|
+
skip?: number,
|
|
81
|
+
ids?: string[]
|
|
82
|
+
) => Promise<{
|
|
83
|
+
results?: object[];
|
|
84
|
+
totalCount?: number;
|
|
85
|
+
}>)
|
|
86
|
+
| any[]
|
|
87
|
+
>,
|
|
88
|
+
default: () => [],
|
|
89
|
+
},
|
|
78
90
|
/**
|
|
79
91
|
* Property of option which holds the 'value'
|
|
80
92
|
* Default value: id
|
|
81
93
|
* @param option The current option being processed
|
|
82
94
|
* @returns Value of the current option
|
|
83
95
|
*/
|
|
84
|
-
optionValue
|
|
96
|
+
optionValue: { type: [Function, String] as PropType<OptionProp>, default: "id" },
|
|
85
97
|
/**
|
|
86
98
|
* Property of option which holds the 'label'
|
|
87
99
|
* Default value: title
|
|
88
100
|
* @param option The current option being processed
|
|
89
101
|
* @returns Label of the current option
|
|
90
102
|
*/
|
|
91
|
-
optionLabel
|
|
103
|
+
optionLabel: { type: [Function, String] as PropType<OptionProp>, default: "title" },
|
|
92
104
|
/**
|
|
93
105
|
* Update model with the value of the selected option instead of the whole option
|
|
94
106
|
*/
|
|
95
|
-
emitValue
|
|
107
|
+
emitValue: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: true,
|
|
110
|
+
},
|
|
96
111
|
/**
|
|
97
112
|
* Debounce the search input update with an amount of milliseconds
|
|
98
113
|
* Default value: 500
|
|
99
114
|
*/
|
|
100
|
-
debounce
|
|
115
|
+
debounce: {
|
|
116
|
+
type: [Number, String],
|
|
117
|
+
default: 500,
|
|
118
|
+
},
|
|
101
119
|
/**
|
|
102
120
|
* Input placeholder text
|
|
103
121
|
*/
|
|
104
|
-
placeholder
|
|
122
|
+
placeholder: String,
|
|
105
123
|
/**
|
|
106
124
|
* Input tooltip information
|
|
107
125
|
*/
|
|
108
|
-
tooltip
|
|
126
|
+
tooltip: String,
|
|
109
127
|
/**
|
|
110
128
|
* Input required state
|
|
111
129
|
*/
|
|
112
|
-
required
|
|
130
|
+
required: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: false,
|
|
133
|
+
},
|
|
113
134
|
/**
|
|
114
135
|
* Input search activation
|
|
115
136
|
*/
|
|
116
|
-
searchable
|
|
137
|
+
searchable: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
default: false,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const selectEmits = {
|
|
117
144
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"
|
|
145
|
+
* Emitted when the component needs to change the model; Is also used by v-model
|
|
146
|
+
*/
|
|
147
|
+
"update:modelValue": (inputValue: any) => !!inputValue,
|
|
121
148
|
/**
|
|
122
149
|
* Emitted when user wants to filter a value
|
|
123
150
|
*/
|
|
124
|
-
|
|
151
|
+
search: (inputValue: string) => isString(inputValue),
|
|
125
152
|
/**
|
|
126
153
|
* Emitted when the select options list is hidden
|
|
127
154
|
*/
|
|
128
|
-
|
|
129
|
-
}
|
|
155
|
+
close: () => true,
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export type VcSelectProps = ExtractTypes<typeof selectProps>;
|
|
159
|
+
export type VcSelectEmits = typeof selectEmits;
|
|
130
160
|
|
|
131
161
|
export interface VcSelectSlots {
|
|
132
162
|
/**
|
|
@@ -9,20 +9,31 @@
|
|
|
9
9
|
}"
|
|
10
10
|
>
|
|
11
11
|
<!-- Select 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
|
+
>
|
|
15
22
|
<span v-html="tooltip"></span>
|
|
16
23
|
</template>
|
|
17
24
|
</VcLabel>
|
|
18
25
|
|
|
19
26
|
<!-- Select field -->
|
|
20
|
-
<div
|
|
27
|
+
<div
|
|
28
|
+
class="tw-flex tw-flex-nowrap tw-items-start"
|
|
29
|
+
ref="dropdownToggleRef"
|
|
30
|
+
>
|
|
21
31
|
<div class="tw-flex tw-flex-auto tw-text-left tw-max-w-full">
|
|
22
|
-
<slot
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
<slot
|
|
33
|
+
name="control"
|
|
34
|
+
:toggleHandler="toggleDropdown"
|
|
35
|
+
>
|
|
36
|
+
<div class="tw-relative tw-flex tw-flex-auto tw-text-left tw-max-w-full">
|
|
26
37
|
<div
|
|
27
38
|
class="tw-flex tw-items-center tw-flex-nowrap tw-pr-3"
|
|
28
39
|
v-if="$slots['prepend']"
|
|
@@ -33,21 +44,15 @@
|
|
|
33
44
|
<div
|
|
34
45
|
class="tw-truncate vc-select__field-wrapper tw-relative tw-box-border tw-border tw-border-solid tw-border-[color:var(--select-border-color)] tw-rounded-[var(--select-border-radius)] tw-bg-[color:var(--select-background-color)] tw-flex tw-flex-col tw-flex-nowrap tw-flex-auto tw-items-stretch"
|
|
35
46
|
>
|
|
36
|
-
<div
|
|
37
|
-
class="tw-flex tw-flex-
|
|
38
|
-
>
|
|
39
|
-
<div
|
|
40
|
-
class="tw-flex tw-flex-nowrap tw-flex-auto tw-h-full tw-px-3"
|
|
41
|
-
>
|
|
47
|
+
<div class="tw-flex tw-flex-col tw-flex-nowrap tw-flex-auto tw-relative">
|
|
48
|
+
<div class="tw-flex tw-flex-nowrap tw-flex-auto tw-h-full tw-px-3">
|
|
42
49
|
<div
|
|
43
50
|
class="tw-flex tw-items-center tw-flex-nowrap tw-pr-3"
|
|
44
51
|
v-if="$slots['prepend-inner']"
|
|
45
52
|
>
|
|
46
53
|
<slot name="prepend-inner"></slot>
|
|
47
54
|
</div>
|
|
48
|
-
<div
|
|
49
|
-
class="tw-flex tw-flex-nowrap tw-flex-auto tw-h-full tw-truncate"
|
|
50
|
-
>
|
|
55
|
+
<div class="tw-flex tw-flex-nowrap tw-flex-auto tw-h-full tw-truncate">
|
|
51
56
|
<div
|
|
52
57
|
class="tw-flex tw-items-center tw-flex-wrap tw-pr-3 tw-pointer-events-none"
|
|
53
58
|
v-if="prefix"
|
|
@@ -58,14 +63,13 @@
|
|
|
58
63
|
class="tw-w-full tw-appearance-none tw-border-none tw-outline-none tw-min-h-[var(--select-height)] tw-flex tw-items-center tw-w-full tw-box-border tw-box-border tw-cursor-pointer invalid:tw-text-[color:var(--select-placeholder-color)] tw-truncate"
|
|
59
64
|
@click.stop="toggleDropdown"
|
|
60
65
|
>
|
|
61
|
-
<div
|
|
66
|
+
<div
|
|
67
|
+
v-if="!hasValue"
|
|
68
|
+
class="tw-text-[#a5a5a5]"
|
|
69
|
+
>
|
|
62
70
|
{{ placeholder }}
|
|
63
71
|
</div>
|
|
64
|
-
<template
|
|
65
|
-
v-else-if="
|
|
66
|
-
selectedScope && selectedScope.length && hasValue
|
|
67
|
-
"
|
|
68
|
-
>
|
|
72
|
+
<template v-else-if="selectedScope && selectedScope.length && hasValue">
|
|
69
73
|
<template v-if="$slots['selected-item']">
|
|
70
74
|
<slot
|
|
71
75
|
name="selected-item"
|
|
@@ -86,9 +90,7 @@
|
|
|
86
90
|
<div
|
|
87
91
|
class="tw-bg-[#fbfdfe] tw-border tw-border-solid tw-border-[color:#bdd1df] tw-rounded-[2px] tw-flex tw-items-center tw-h-[28px] tw-box-border tw-px-2"
|
|
88
92
|
>
|
|
89
|
-
<span>{{
|
|
90
|
-
getEmittingOptionValue(item.opt)
|
|
91
|
-
}}</span>
|
|
93
|
+
<span>{{ getEmittingOptionValue(item.opt) }}</span>
|
|
92
94
|
<VcIcon
|
|
93
95
|
v-if="!disabled"
|
|
94
96
|
class="tw-text-[#a9bfd2] tw-ml-2 tw-cursor-pointer hover:tw-text-[color:var(--select-clear-color-hover)]"
|
|
@@ -117,7 +119,10 @@
|
|
|
117
119
|
class="tw-cursor-pointer tw-flex tw-items-center tw-pl-3 tw-text-[color:var(--select-clear-color)] hover:tw-text-[color:var(--select-clear-color-hover)]"
|
|
118
120
|
@click="onReset"
|
|
119
121
|
>
|
|
120
|
-
<VcIcon
|
|
122
|
+
<VcIcon
|
|
123
|
+
size="s"
|
|
124
|
+
icon="fas fa-times"
|
|
125
|
+
></VcIcon>
|
|
121
126
|
</div>
|
|
122
127
|
</div>
|
|
123
128
|
<div
|
|
@@ -145,16 +150,20 @@
|
|
|
145
150
|
class="vc-select__chevron tw-cursor-pointer tw-flex-nowrap tw-text-[color:var(--select-chevron-color)] hover:tw-text-[color:var(--select-chevron-color-hover)]"
|
|
146
151
|
@click.stop="toggleDropdown"
|
|
147
152
|
>
|
|
148
|
-
<VcIcon
|
|
153
|
+
<VcIcon
|
|
154
|
+
size="s"
|
|
155
|
+
icon="fas fa-chevron-down"
|
|
156
|
+
></VcIcon>
|
|
149
157
|
</div>
|
|
150
158
|
</div>
|
|
151
159
|
</div>
|
|
152
160
|
</div>
|
|
153
161
|
</div>
|
|
154
|
-
<div
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
162
|
+
<div class="tw-absolute tw-translate-y-full tw-left-0 tw-right-0 tw-bottom-0 tw-min-h-[20px]">
|
|
163
|
+
<Transition
|
|
164
|
+
name="slide-up"
|
|
165
|
+
mode="out-in"
|
|
166
|
+
>
|
|
158
167
|
<div v-if="error">
|
|
159
168
|
<slot name="error">
|
|
160
169
|
<VcHint
|
|
@@ -203,7 +212,10 @@
|
|
|
203
212
|
@input="onInput"
|
|
204
213
|
/>
|
|
205
214
|
|
|
206
|
-
<VcContainer
|
|
215
|
+
<VcContainer
|
|
216
|
+
:no-padding="true"
|
|
217
|
+
ref="root"
|
|
218
|
+
>
|
|
207
219
|
<div
|
|
208
220
|
v-if="!(optionsList && optionsList.length)"
|
|
209
221
|
class="tw-w-full tw-h-full tw-box-border tw-flex tw-flex-col tw-items-center tw-justify-center"
|
|
@@ -220,9 +232,16 @@
|
|
|
220
232
|
@click="item.toggleOption(item.opt)"
|
|
221
233
|
:class="{ 'tw-bg-[#eff7fc]': item.selected }"
|
|
222
234
|
>
|
|
223
|
-
<slot
|
|
235
|
+
<slot
|
|
236
|
+
name="option"
|
|
237
|
+
v-bind="item"
|
|
238
|
+
>{{ item.label }}</slot
|
|
239
|
+
>
|
|
224
240
|
</div>
|
|
225
|
-
<span
|
|
241
|
+
<span
|
|
242
|
+
ref="el"
|
|
243
|
+
v-if="hasNextPage"
|
|
244
|
+
></span>
|
|
226
245
|
</VcContainer>
|
|
227
246
|
</div>
|
|
228
247
|
<!-- </teleport>-->
|
|
@@ -232,29 +251,16 @@
|
|
|
232
251
|
|
|
233
252
|
<script lang="ts" setup>
|
|
234
253
|
import { nextTick, ref, computed, watch, toRefs } from "vue";
|
|
235
|
-
import { VcIcon, VcLabel, VcContainer } from "
|
|
236
|
-
import { clickOutside as vClickOutside } from "
|
|
254
|
+
import { VcIcon, VcLabel, VcContainer } from "./../../../components";
|
|
255
|
+
import { clickOutside as vClickOutside } from "./../../../../core/directives";
|
|
237
256
|
import { createPopper, Instance, State } from "@popperjs/core";
|
|
238
|
-
import {
|
|
257
|
+
import { selectEmits, selectProps, OptionProp } from "./vc-select-model";
|
|
239
258
|
import { intersection, isEqual } from "lodash-es";
|
|
240
259
|
import { useIntersectionObserver } from "@vueuse/core";
|
|
241
260
|
|
|
242
|
-
const props =
|
|
243
|
-
optionValue: "id",
|
|
244
|
-
optionLabel: "title",
|
|
245
|
-
debounce: 500,
|
|
246
|
-
clearable: true,
|
|
247
|
-
name: "Field",
|
|
248
|
-
searchable: false,
|
|
249
|
-
required: false,
|
|
250
|
-
autofocus: true,
|
|
251
|
-
emitValue: true,
|
|
252
|
-
mapOptions: true,
|
|
253
|
-
placeholder: "Click to select...",
|
|
254
|
-
options: () => [],
|
|
255
|
-
});
|
|
261
|
+
const props = defineProps(selectProps);
|
|
256
262
|
|
|
257
|
-
const emit = defineEmits(
|
|
263
|
+
const emit = defineEmits(selectEmits);
|
|
258
264
|
|
|
259
265
|
const { modelValue, options } = toRefs(props);
|
|
260
266
|
|
|
@@ -312,17 +318,11 @@ watch(
|
|
|
312
318
|
const data = await props.options(
|
|
313
319
|
undefined,
|
|
314
320
|
undefined,
|
|
315
|
-
Array.isArray(props.modelValue)
|
|
316
|
-
? props.modelValue
|
|
317
|
-
: [props.modelValue]
|
|
318
|
-
);
|
|
319
|
-
defaultValue.value = data.results.filter(
|
|
320
|
-
(x) => x[props.optionValue as string] === props.modelValue
|
|
321
|
+
Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue]
|
|
321
322
|
);
|
|
323
|
+
defaultValue.value = data.results.filter((x) => x[props.optionValue as string] === props.modelValue);
|
|
322
324
|
} else if (props.options && Array.isArray(props.options)) {
|
|
323
|
-
defaultValue.value = props.options.filter(
|
|
324
|
-
(x) => x[props.optionValue as string] === props.modelValue
|
|
325
|
-
);
|
|
325
|
+
defaultValue.value = props.options.filter((x) => x[props.optionValue as string] === props.modelValue);
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -361,10 +361,7 @@ async function onLoadMore() {
|
|
|
361
361
|
if (props.options && typeof props.options === "function") {
|
|
362
362
|
try {
|
|
363
363
|
listLoading.value = true;
|
|
364
|
-
const data = await props.options(
|
|
365
|
-
filterString.value,
|
|
366
|
-
optionsList.value.length
|
|
367
|
-
);
|
|
364
|
+
const data = await props.options(filterString.value, optionsList.value.length);
|
|
368
365
|
optionsList.value.push(...data.results);
|
|
369
366
|
} finally {
|
|
370
367
|
listLoading.value = false;
|
|
@@ -376,36 +373,26 @@ const hasNextPage = computed(() => {
|
|
|
376
373
|
return optionsList.value.length < totalItems.value;
|
|
377
374
|
});
|
|
378
375
|
|
|
379
|
-
const getOptionValue = computed(() =>
|
|
380
|
-
getPropValueFn(props.optionValue, "value")
|
|
381
|
-
);
|
|
376
|
+
const getOptionValue = computed(() => getPropValueFn(props.optionValue, "value"));
|
|
382
377
|
|
|
383
|
-
const getOptionLabel = computed(() =>
|
|
384
|
-
getPropValueFn(props.optionLabel, "label")
|
|
385
|
-
);
|
|
378
|
+
const getOptionLabel = computed(() => getPropValueFn(props.optionLabel, "label"));
|
|
386
379
|
|
|
387
380
|
const innerValue = computed((): Record<string, unknown>[] | string[] => {
|
|
388
381
|
const mapNull = props.mapOptions === true && props.multiple !== true;
|
|
389
382
|
|
|
390
383
|
const val: Record<string, unknown>[] | string[] =
|
|
391
|
-
props.modelValue !== undefined &&
|
|
392
|
-
(props.modelValue !== null || mapNull === true)
|
|
384
|
+
props.modelValue !== undefined && (props.modelValue !== null || mapNull === true)
|
|
393
385
|
? props.multiple === true && Array.isArray(props.modelValue)
|
|
394
386
|
? props.modelValue
|
|
395
387
|
: [props.modelValue]
|
|
396
388
|
: [];
|
|
397
389
|
|
|
398
390
|
if (props.mapOptions === true && Array.isArray(optionsList.value) === true) {
|
|
399
|
-
const cache =
|
|
400
|
-
props.mapOptions === true && innerValueCache !== undefined
|
|
401
|
-
? innerValueCache
|
|
402
|
-
: [];
|
|
391
|
+
const cache = props.mapOptions === true && innerValueCache !== undefined ? innerValueCache : [];
|
|
403
392
|
|
|
404
393
|
const values = val.map((v) => getOption(v, cache));
|
|
405
394
|
|
|
406
|
-
return props.modelValue === null && mapNull === true
|
|
407
|
-
? values.filter((v) => v !== null)
|
|
408
|
-
: values;
|
|
395
|
+
return props.modelValue === null && mapNull === true ? values.filter((v) => v !== null) : values;
|
|
409
396
|
}
|
|
410
397
|
|
|
411
398
|
return val;
|
|
@@ -431,9 +418,7 @@ const selectedScope = computed(() => {
|
|
|
431
418
|
|
|
432
419
|
const hasValue = computed(() => fieldValueIsFilled(innerValue.value));
|
|
433
420
|
|
|
434
|
-
const innerOptionsValue = computed(() =>
|
|
435
|
-
innerValue.value.map((opt) => getOptionValue.value(opt))
|
|
436
|
-
);
|
|
421
|
+
const innerOptionsValue = computed(() => innerValue.value.map((opt) => getOptionValue.value(opt)));
|
|
437
422
|
|
|
438
423
|
const optionScope = computed(() => {
|
|
439
424
|
return optionsTemp.value.map((opt, i) => {
|
|
@@ -452,21 +437,12 @@ function getPropValueFn(propValue: OptionProp, defaultVal: OptionProp) {
|
|
|
452
437
|
|
|
453
438
|
return typeof val === "function"
|
|
454
439
|
? val
|
|
455
|
-
: (opt) =>
|
|
456
|
-
opt !== null && typeof opt === "object" && val in opt ? opt[val] : opt;
|
|
440
|
+
: (opt) => (opt !== null && typeof opt === "object" && val in opt ? opt[val] : opt);
|
|
457
441
|
}
|
|
458
442
|
|
|
459
|
-
function getOption(
|
|
460
|
-
value: Record<string, unknown> | string,
|
|
461
|
-
valueCache: Array<Record<string, unknown> | string>
|
|
462
|
-
) {
|
|
443
|
+
function getOption(value: Record<string, unknown> | string, valueCache: Array<Record<string, unknown> | string>) {
|
|
463
444
|
const fn = (opt) => isEqual(getOptionValue.value(opt), value);
|
|
464
|
-
return (
|
|
465
|
-
defaultValue.value.find(fn) ||
|
|
466
|
-
optionsList.value.find(fn) ||
|
|
467
|
-
valueCache.find(fn) ||
|
|
468
|
-
value
|
|
469
|
-
);
|
|
445
|
+
return defaultValue.value.find(fn) || optionsList.value.find(fn) || valueCache.find(fn) || value;
|
|
470
446
|
}
|
|
471
447
|
|
|
472
448
|
function fieldValueIsFilled(val: Record<string, unknown>[] | unknown[]) {
|
|
@@ -474,9 +450,7 @@ function fieldValueIsFilled(val: Record<string, unknown>[] | unknown[]) {
|
|
|
474
450
|
}
|
|
475
451
|
|
|
476
452
|
function getEmittingOptionValue(opt: Record<string, unknown>) {
|
|
477
|
-
return props.emitValue === true
|
|
478
|
-
? getOptionLabel.value(opt)
|
|
479
|
-
: getOptionValue.value(opt);
|
|
453
|
+
return props.emitValue === true ? getOptionLabel.value(opt) : getOptionValue.value(opt);
|
|
480
454
|
}
|
|
481
455
|
|
|
482
456
|
function removeAtIndex(index: number) {
|
|
@@ -523,78 +497,64 @@ async function toggleDropdown() {
|
|
|
523
497
|
|
|
524
498
|
await nextTick(() => {
|
|
525
499
|
searchRef?.value?.focus();
|
|
526
|
-
popper.value = createPopper(
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
500
|
+
popper.value = createPopper(dropdownToggleRef.value, dropdownRef.value, {
|
|
501
|
+
placement: "bottom",
|
|
502
|
+
modifiers: [
|
|
503
|
+
{
|
|
504
|
+
name: "flip",
|
|
505
|
+
options: {
|
|
506
|
+
fallbackPlacements: ["top", "bottom"],
|
|
507
|
+
},
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
name: "preventOverflow",
|
|
511
|
+
options: {
|
|
512
|
+
mainAxis: false,
|
|
537
513
|
},
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
name: "sameWidthChangeBorders",
|
|
517
|
+
enabled: true,
|
|
518
|
+
phase: "beforeWrite",
|
|
519
|
+
requires: ["computeStyles"],
|
|
520
|
+
fn: ({ state }: { state: State }) => {
|
|
521
|
+
const placement = state.placement;
|
|
522
|
+
if (placement === "top") {
|
|
523
|
+
state.styles.popper.borderTop = "1px solid var(--select-border-color)";
|
|
524
|
+
state.styles.popper.borderBottom = "1px solid var(--select-background-color)";
|
|
525
|
+
state.styles.popper.borderRadius = "var(--select-border-radius) var(--select-border-radius) 0 0";
|
|
526
|
+
} else {
|
|
527
|
+
state.styles.popper.borderBottom = "1px solid var(--select-border-color)";
|
|
528
|
+
state.styles.popper.borderTop = "1px solid var(--select-background-color)";
|
|
529
|
+
state.styles.popper.borderRadius = "0 0 var(--select-border-radius) var(--select-border-radius)";
|
|
530
|
+
}
|
|
531
|
+
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
543
532
|
},
|
|
544
|
-
{
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
state.styles.popper.borderBottom =
|
|
560
|
-
"1px solid var(--select-border-color)";
|
|
561
|
-
state.styles.popper.borderTop =
|
|
562
|
-
"1px solid var(--select-background-color)";
|
|
563
|
-
state.styles.popper.borderRadius =
|
|
564
|
-
"0 0 var(--select-border-radius) var(--select-border-radius)";
|
|
565
|
-
}
|
|
566
|
-
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
567
|
-
},
|
|
568
|
-
effect: ({ state }: { state: State }) => {
|
|
569
|
-
const ref = state.elements.reference as HTMLElement;
|
|
570
|
-
const placement = state.placement;
|
|
571
|
-
if (placement === "top") {
|
|
572
|
-
state.elements.popper.style.borderTop =
|
|
573
|
-
"1px solid var(--select-border-color)";
|
|
574
|
-
state.elements.popper.style.borderBottom =
|
|
575
|
-
"1px solid var(--select-background-color)";
|
|
576
|
-
state.elements.popper.style.borderRadius =
|
|
577
|
-
"var(--select-border-radius) var(--select-border-radius) 0 0";
|
|
578
|
-
} else {
|
|
579
|
-
state.elements.popper.style.borderBottom =
|
|
580
|
-
"1px solid var(--select-border-color)";
|
|
581
|
-
state.elements.popper.style.borderTop =
|
|
582
|
-
"1px solid var(--select-background-color)";
|
|
583
|
-
state.elements.popper.style.borderRadius =
|
|
584
|
-
"0 0 var(--select-border-radius) var(--select-border-radius)";
|
|
585
|
-
}
|
|
586
|
-
state.elements.popper.style.width = `${ref.offsetWidth}px`;
|
|
587
|
-
},
|
|
533
|
+
effect: ({ state }: { state: State }) => {
|
|
534
|
+
const ref = state.elements.reference as HTMLElement;
|
|
535
|
+
const placement = state.placement;
|
|
536
|
+
if (placement === "top") {
|
|
537
|
+
state.elements.popper.style.borderTop = "1px solid var(--select-border-color)";
|
|
538
|
+
state.elements.popper.style.borderBottom = "1px solid var(--select-background-color)";
|
|
539
|
+
state.elements.popper.style.borderRadius =
|
|
540
|
+
"var(--select-border-radius) var(--select-border-radius) 0 0";
|
|
541
|
+
} else {
|
|
542
|
+
state.elements.popper.style.borderBottom = "1px solid var(--select-border-color)";
|
|
543
|
+
state.elements.popper.style.borderTop = "1px solid var(--select-background-color)";
|
|
544
|
+
state.elements.popper.style.borderRadius =
|
|
545
|
+
"0 0 var(--select-border-radius) var(--select-border-radius)";
|
|
546
|
+
}
|
|
547
|
+
state.elements.popper.style.width = `${ref.offsetWidth}px`;
|
|
588
548
|
},
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "offset",
|
|
552
|
+
options: {
|
|
553
|
+
offset: [0, -2],
|
|
594
554
|
},
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
);
|
|
555
|
+
},
|
|
556
|
+
],
|
|
557
|
+
});
|
|
598
558
|
});
|
|
599
559
|
}
|
|
600
560
|
}
|
|
@@ -608,10 +568,7 @@ function toggleOption(opt: { [x: string]: string }) {
|
|
|
608
568
|
const optValue = getOptionValue.value(opt);
|
|
609
569
|
|
|
610
570
|
if (props.multiple !== true) {
|
|
611
|
-
if (
|
|
612
|
-
innerValue.value.length === 0 ||
|
|
613
|
-
isEqual(getOptionValue.value(innerValue.value[0]), optValue) !== true
|
|
614
|
-
) {
|
|
571
|
+
if (innerValue.value.length === 0 || isEqual(getOptionValue.value(innerValue.value[0]), optValue) !== true) {
|
|
615
572
|
emit("update:modelValue", props.emitValue === true ? optValue : opt);
|
|
616
573
|
isOpened.value = false;
|
|
617
574
|
}
|
|
@@ -652,9 +609,7 @@ async function onSearch(value: string) {
|
|
|
652
609
|
}
|
|
653
610
|
} else {
|
|
654
611
|
optionsTemp.value = optionsList.value.filter((x) => {
|
|
655
|
-
return x[props.optionLabel as string]
|
|
656
|
-
.toLowerCase()
|
|
657
|
-
.includes(filterString.value.toLowerCase());
|
|
612
|
+
return x[props.optionLabel as string].toLowerCase().includes(filterString.value.toLowerCase());
|
|
658
613
|
});
|
|
659
614
|
}
|
|
660
615
|
}
|