@vc-shell/framework 1.0.110 → 1.0.112
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/CHANGELOG.md +28 -0
- package/core/composables/useApiClient/index.ts +1 -1
- package/core/composables/useAsync/index.ts +2 -2
- package/core/composables/usePermissions/index.ts +7 -18
- package/core/composables/useUser/index.ts +13 -11
- package/core/directives/loading/index.ts +5 -27
- package/core/directives/loading/styles.css +38 -0
- package/core/plugins/modularity/index.ts +41 -14
- package/core/plugins/permissions/index.ts +3 -3
- package/core/types/index.ts +36 -3
- package/dist/core/composables/useApiClient/index.d.ts +1 -1
- package/dist/core/composables/useApiClient/index.d.ts.map +1 -1
- package/dist/core/composables/useAsync/index.d.ts +1 -1
- package/dist/core/composables/useAsync/index.d.ts.map +1 -1
- package/dist/core/composables/usePermissions/index.d.ts +1 -2
- package/dist/core/composables/usePermissions/index.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts +1 -0
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/directives/loading/index.d.ts +3 -2
- package/dist/core/directives/loading/index.d.ts.map +1 -1
- package/dist/core/plugins/modularity/index.d.ts +13 -4
- package/dist/core/plugins/modularity/index.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +41 -2
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.mjs +25840 -24070
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue.d.ts +14 -23
- package/dist/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts +28 -25
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/types/index.d.ts +5 -2
- package/dist/shared/components/blade-navigation/types/index.d.ts.map +1 -1
- package/dist/shared/components/change-password/change-password.vue.d.ts.map +1 -1
- package/dist/shared/components/error-interceptor/index.d.ts +3 -3
- package/dist/shared/components/language-selector/language-selector.vue.d.ts +41 -26
- package/dist/shared/components/language-selector/language-selector.vue.d.ts.map +1 -1
- package/dist/shared/components/notifications/components/notification-container/index.d.ts +12 -12
- package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
- package/dist/shared/components/notifications/composables/useContainer/index.d.ts.map +1 -1
- package/dist/shared/components/popup-handler/components/vc-popup-container/vc-popup-container.vue.d.ts.map +1 -1
- package/dist/shared/components/popup-handler/composables/usePopup/index.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/index.d.ts +11 -11
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts +35 -22
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -1
- package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts +39 -28
- package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts.map +1 -1
- package/dist/shared/modules/assets/components/assets-details/index.d.ts +13 -13
- package/dist/shared/modules/assets/index.d.ts +3 -1
- package/dist/shared/modules/assets/index.d.ts.map +1 -1
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +42 -29
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts.map +1 -1
- package/dist/shared/modules/assets-manager/components/assets-manager/index.d.ts +9 -9
- package/dist/shared/modules/assets-manager/index.d.ts +3 -1
- package/dist/shared/modules/assets-manager/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/FIELD_MAP.d.ts +2204 -0
- package/dist/shared/modules/dynamic/components/FIELD_MAP.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/SchemaRender.d.ts +220 -0
- package/dist/shared/modules/dynamic/components/SchemaRender.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/factories.d.ts +15 -0
- package/dist/shared/modules/dynamic/components/factories.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts +130 -0
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts +128 -0
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts +132 -0
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts +131 -0
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/ValidationField.d.ts +13 -0
- package/dist/shared/modules/dynamic/components/fields/ValidationField.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/fields/props.d.ts +124 -0
- package/dist/shared/modules/dynamic/components/fields/props.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/components/index.d.ts +4 -0
- package/dist/shared/modules/dynamic/components/index.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/composables/index.d.ts +2 -0
- package/dist/shared/modules/dynamic/composables/index.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/composables/useFilterBuilder/index.d.ts +35 -0
- package/dist/shared/modules/dynamic/composables/useFilterBuilder/index.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts +8 -0
- package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/factories/base/useListFactory.d.ts +22 -0
- package/dist/shared/modules/dynamic/factories/base/useListFactory.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/factories/index.d.ts +4 -0
- package/dist/shared/modules/dynamic/factories/index.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/factories/types/index.d.ts +101 -0
- package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/helpers/getters.d.ts +2 -0
- package/dist/shared/modules/dynamic/helpers/getters.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts +13 -0
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/helpers/override.d.ts +7 -0
- package/dist/shared/modules/dynamic/helpers/override.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/helpers/setters.d.ts +8 -0
- package/dist/shared/modules/dynamic/helpers/setters.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/helpers/toolbarReducer.d.ts +11 -0
- package/dist/shared/modules/dynamic/helpers/toolbarReducer.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/helpers/unrefNested.d.ts +2 -0
- package/dist/shared/modules/dynamic/helpers/unrefNested.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/helpers/unwrapInterpolation.d.ts +3 -0
- package/dist/shared/modules/dynamic/helpers/unwrapInterpolation.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/index.d.ts +32 -0
- package/dist/shared/modules/dynamic/index.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +68 -0
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +79 -0
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/pages/index.d.ts +4 -0
- package/dist/shared/modules/dynamic/pages/index.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/types/index.d.ts +252 -0
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -0
- package/dist/shared/modules/dynamic/types/models.d.ts +93 -0
- package/dist/shared/modules/dynamic/types/models.d.ts.map +1 -0
- package/dist/shared/modules/index.d.ts +1 -0
- package/dist/shared/modules/index.d.ts.map +1 -1
- package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
- package/dist/shared/pages/InvitePage/index.d.ts +0 -3
- package/dist/shared/pages/InvitePage/index.d.ts.map +1 -1
- package/dist/shared/pages/InvitePage/plugin.d.ts +4 -0
- package/dist/shared/pages/InvitePage/plugin.d.ts.map +1 -0
- package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts +45 -9
- package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts.map +1 -1
- package/dist/shared/pages/LoginPage/components/login/index.d.ts +14 -0
- package/dist/shared/pages/LoginPage/components/login/index.d.ts.map +1 -1
- package/dist/shared/pages/LoginPage/index.d.ts +0 -1
- package/dist/shared/pages/LoginPage/index.d.ts.map +1 -1
- package/dist/shared/pages/LoginPage/plugin.d.ts +1 -3
- package/dist/shared/pages/LoginPage/plugin.d.ts.map +1 -1
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
- package/dist/shared/pages/ResetPasswordPage/index.d.ts +0 -3
- package/dist/shared/pages/ResetPasswordPage/index.d.ts.map +1 -1
- package/dist/shared/pages/ResetPasswordPage/plugin.d.ts +4 -0
- package/dist/shared/pages/ResetPasswordPage/plugin.d.ts.map +1 -0
- package/dist/shared/pages/index.d.ts +0 -6
- package/dist/shared/pages/index.d.ts.map +1 -1
- package/dist/shared/pages/plugin.d.ts +4 -0
- package/dist/shared/pages/plugin.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-badge/index.d.ts +4 -4
- package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts +22 -11
- package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/index.d.ts +1 -208
- package/dist/ui/components/atoms/vc-button/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts +75 -27
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/index.d.ts +32 -38
- package/dist/ui/components/atoms/vc-card/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts +46 -27
- package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-checkbox/index.d.ts +72 -38
- package/dist/ui/components/atoms/vc-checkbox/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts +69 -28
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-col/index.d.ts +1 -1
- package/dist/ui/components/atoms/vc-col/vc-col.vue.d.ts +11 -22
- package/dist/ui/components/atoms/vc-col/vc-col.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-container/index.d.ts +5 -5
- package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts +22 -11
- package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-hint/index.d.ts +1 -1
- package/dist/ui/components/atoms/vc-hint/vc-hint.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/index.d.ts +13 -7
- package/dist/ui/components/atoms/vc-icon/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts +27 -25
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-image/index.d.ts +16 -16
- package/dist/ui/components/atoms/vc-image/vc-image.vue.d.ts +54 -29
- package/dist/ui/components/atoms/vc-image/vc-image.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-info-row/index.d.ts +9 -9
- package/dist/ui/components/atoms/vc-info-row/vc-info-row.vue.d.ts +30 -23
- package/dist/ui/components/atoms/vc-info-row/vc-info-row.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-label/index.d.ts +33 -39
- package/dist/ui/components/atoms/vc-label/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-label/vc-label.vue.d.ts +33 -26
- package/dist/ui/components/atoms/vc-label/vc-label.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-link/index.d.ts +4 -4
- package/dist/ui/components/atoms/vc-link/vc-link.vue.d.ts +22 -11
- package/dist/ui/components/atoms/vc-link/vc-link.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-loading/vc-loading.vue.d.ts +9 -10
- package/dist/ui/components/atoms/vc-loading/vc-loading.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-progress/index.d.ts +1 -1
- package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts +19 -24
- package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-row/index.d.ts +1 -1
- package/dist/ui/components/atoms/vc-row/vc-row.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status/index.d.ts +1 -142
- package/dist/ui/components/atoms/vc-status/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status/vc-status.vue.d.ts +29 -28
- package/dist/ui/components/atoms/vc-status/vc-status.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status-icon/vc-status-icon.vue.d.ts +9 -10
- package/dist/ui/components/atoms/vc-status-icon/vc-status-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-switch/vc-switch.vue.d.ts +36 -11
- package/dist/ui/components/atoms/vc-switch/vc-switch.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-video/index.d.ts +13 -13
- package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts +49 -24
- package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-widget/vc-widget.vue.d.ts +28 -11
- package/dist/ui/components/atoms/vc-widget/vc-widget.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue.d.ts +5 -3
- package/dist/ui/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts +23 -22
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-code-editor/index.d.ts +28 -28
- package/dist/ui/components/molecules/vc-code-editor/vc-code-editor.vue.d.ts +48 -23
- package/dist/ui/components/molecules/vc-code-editor/vc-code-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/index.d.ts +1 -226
- package/dist/ui/components/molecules/vc-editor/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +74 -28
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts +23 -23
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +46 -27
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-form/index.d.ts +1 -1
- package/dist/ui/components/molecules/vc-form/vc-form.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input/index.d.ts +1 -390
- package/dist/ui/components/molecules/vc-input/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +181 -41
- package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/index.d.ts +90 -90
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +143 -30
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/index.d.ts +74 -10
- package/dist/ui/components/molecules/vc-multivalue/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +74 -10
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-notification/vc-notification.vue.d.ts +51 -10
- package/dist/ui/components/molecules/vc-notification/vc-notification.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-pagination/index.d.ts +6 -6
- package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts +26 -25
- package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-rating/index.d.ts +19 -19
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts +46 -25
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/index.d.ts +65 -103
- package/dist/ui/components/molecules/vc-select/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +65 -479
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-slider/index.d.ts +21 -21
- package/dist/ui/components/molecules/vc-slider/vc-slider.vue.d.ts +39 -26
- package/dist/ui/components/molecules/vc-slider/vc-slider.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-textarea/index.d.ts +40 -40
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts +74 -25
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts +35 -12
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts +40 -23
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +47 -28
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts +31 -28
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/index.d.ts +67 -67
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +86 -37
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts +44 -11
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts +61 -34
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue.d.ts +13 -22
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/index.d.ts +39 -39
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +62 -31
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-dynamic-property/index.d.ts +1 -140
- 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.vue.d.ts +64 -75
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +58 -35
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts +22 -25
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/index.d.ts +37 -31
- package/dist/ui/components/organisms/vc-gallery/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +130 -46
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-login-form/index.d.ts +9 -9
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts +23 -22
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue.d.ts +28 -22
- package/dist/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-notification-dropdown/index.d.ts +0 -6
- package/dist/ui/components/organisms/vc-notification-dropdown/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue.d.ts +36 -10
- package/dist/ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-notification-template/index.d.ts +4 -4
- package/dist/ui/components/organisms/vc-notification-template/vc-notification-template.vue.d.ts +27 -10
- package/dist/ui/components/organisms/vc-notification-template/vc-notification-template.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/_internal/vc-popup-error/vc-popup-error.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/_internal/vc-popup-warning/vc-popup-warning.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +38 -31
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts +18 -9
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue.d.ts +12 -19
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts +23 -24
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts +29 -26
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.d.ts +14 -14
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/index.d.ts +1 -214
- package/dist/ui/components/organisms/vc-table/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +90 -105
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +8 -8
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +2 -2
- package/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +16 -14
- package/shared/components/blade-navigation/composables/useBladeNavigation/index.ts +37 -30
- package/shared/components/blade-navigation/types/index.ts +7 -3
- package/shared/components/notifications/composables/useContainer/index.ts +2 -5
- package/shared/components/popup-handler/composables/usePopup/index.ts +0 -2
- package/shared/modules/assets/components/assets-details/assets-details.vue +6 -6
- package/shared/modules/assets/index.ts +2 -2
- package/shared/modules/assets-manager/components/assets-manager/assets-manager.vue +3 -3
- package/shared/modules/assets-manager/index.ts +2 -2
- package/shared/modules/dynamic/components/FIELD_MAP.ts +27 -0
- package/shared/modules/dynamic/components/SchemaRender.ts +81 -0
- package/shared/modules/dynamic/components/factories.ts +159 -0
- package/shared/modules/dynamic/components/fields/Button.ts +31 -0
- package/shared/modules/dynamic/components/fields/Card.ts +86 -0
- package/shared/modules/dynamic/components/fields/Checkbox.ts +44 -0
- package/shared/modules/dynamic/components/fields/DynamicProperty.ts +99 -0
- package/shared/modules/dynamic/components/fields/EditorField.ts +43 -0
- package/shared/modules/dynamic/components/fields/Fieldset.ts +77 -0
- package/shared/modules/dynamic/components/fields/GalleryField.ts +121 -0
- package/shared/modules/dynamic/components/fields/InputCurrency.ts +49 -0
- package/shared/modules/dynamic/components/fields/InputField.ts +42 -0
- package/shared/modules/dynamic/components/fields/SelectField.ts +54 -0
- package/shared/modules/dynamic/components/fields/StatusField.ts +55 -0
- package/shared/modules/dynamic/components/fields/ValidationField.ts +53 -0
- package/shared/modules/dynamic/components/fields/props.ts +52 -0
- package/shared/modules/dynamic/components/index.ts +4 -0
- package/shared/modules/dynamic/composables/index.ts +1 -0
- package/shared/modules/dynamic/composables/useFilterBuilder/index.ts +235 -0
- package/shared/modules/dynamic/factories/base/useDetailsFactory.ts +83 -0
- package/shared/modules/dynamic/factories/base/useListFactory.ts +68 -0
- package/shared/modules/dynamic/factories/index.ts +4 -0
- package/shared/modules/dynamic/factories/types/index.ts +103 -0
- package/shared/modules/dynamic/helpers/getters.ts +10 -0
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +112 -0
- package/shared/modules/dynamic/helpers/override.ts +70 -0
- package/shared/modules/dynamic/helpers/setters.ts +15 -0
- package/shared/modules/dynamic/helpers/toolbarReducer.ts +41 -0
- package/shared/modules/dynamic/helpers/unrefNested.ts +14 -0
- package/shared/modules/dynamic/helpers/unwrapInterpolation.ts +15 -0
- package/shared/modules/dynamic/index.ts +163 -0
- package/shared/modules/dynamic/pages/dynamic-blade-form.vue +292 -0
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +467 -0
- package/shared/modules/dynamic/pages/index.ts +4 -0
- package/shared/modules/dynamic/types/index.ts +289 -0
- package/shared/modules/dynamic/types/models.ts +140 -0
- package/shared/modules/index.ts +1 -0
- package/shared/pages/InvitePage/index.ts +0 -6
- package/shared/pages/InvitePage/plugin.ts +5 -0
- package/shared/pages/LoginPage/components/login/Login.vue +5 -6
- package/shared/pages/LoginPage/index.ts +0 -1
- package/shared/pages/LoginPage/plugin.ts +1 -13
- package/shared/pages/ResetPasswordPage/index.ts +0 -6
- package/shared/pages/ResetPasswordPage/plugin.ts +5 -0
- package/shared/pages/index.ts +0 -9
- package/shared/pages/plugin.ts +3 -0
- package/ui/components/atoms/vc-button/index.ts +1 -10
- package/ui/components/atoms/vc-button/vc-button.vue +8 -2
- package/ui/components/atoms/vc-card/index.ts +1 -9
- package/ui/components/atoms/vc-card/vc-card.vue +6 -1
- package/ui/components/atoms/vc-checkbox/index.ts +1 -9
- package/ui/components/atoms/vc-checkbox/vc-checkbox.vue +32 -10
- package/ui/components/atoms/vc-icon/vc-icon.vue +13 -1
- package/ui/components/atoms/vc-label/index.ts +1 -9
- package/ui/components/atoms/vc-label/vc-label.vue +5 -0
- package/ui/components/atoms/vc-status/index.ts +1 -10
- package/ui/components/atoms/vc-status/vc-status.vue +5 -1
- package/ui/components/atoms/vc-video/vc-video.vue +2 -2
- package/ui/components/atoms/vc-widget/vc-widget.vue +1 -1
- package/ui/components/molecules/vc-editor/index.ts +1 -10
- package/ui/components/molecules/vc-editor/vc-editor.vue +15 -0
- package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +4 -4
- package/ui/components/molecules/vc-input/index.ts +1 -60
- package/ui/components/molecules/vc-input/vc-input.vue +112 -37
- package/ui/components/molecules/vc-input-currency/vc-input-currency.stories.ts +1 -1
- package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +21 -17
- package/ui/components/molecules/vc-select/index.ts +1 -1
- package/ui/components/molecules/vc-select/vc-select.stories.ts +1 -1
- package/ui/components/molecules/vc-select/vc-select.vue +11 -37
- package/ui/components/organisms/vc-dynamic-property/index.ts +1 -3
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +199 -257
- package/ui/components/organisms/vc-gallery/vc-gallery.vue +9 -7
- package/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue +10 -1
- package/ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue +1 -10
- package/ui/components/organisms/vc-table/index.ts +1 -3
- package/ui/components/organisms/vc-table/vc-table.stories.ts +3 -3
- package/ui/components/organisms/vc-table/vc-table.vue +30 -17
- package/core/api/catalog.ts +0 -8527
- package/dist/core/api/catalog.d.ts +0 -2522
- package/dist/core/api/catalog.d.ts.map +0 -1
- package/dist/typings/index.d.ts +0 -8
- package/dist/typings/index.d.ts.map +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ComputedRef, PropType, UnwrapNestedRefs, VNodeArrayChildren } from "vue";
|
|
2
|
+
import { DetailsBladeContext } from "../../factories";
|
|
3
|
+
import { IControlBaseOptions, IControlBaseProps } from "../../types/models";
|
|
4
|
+
import { ControlSchema } from "../../types";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
baseProps: {
|
|
8
|
+
type: Object as PropType<UnwrapNestedRefs<IControlBaseProps>>,
|
|
9
|
+
default: () => ({} as IControlBaseProps),
|
|
10
|
+
},
|
|
11
|
+
baseOptions: {
|
|
12
|
+
type: Object as PropType<UnwrapNestedRefs<IControlBaseOptions>>,
|
|
13
|
+
default: () => ({} as IControlBaseOptions),
|
|
14
|
+
},
|
|
15
|
+
element: {
|
|
16
|
+
type: Object as PropType<ControlSchema>,
|
|
17
|
+
default: () => ({} as ControlSchema),
|
|
18
|
+
},
|
|
19
|
+
bladeContext: {
|
|
20
|
+
type: Object as PropType<UnwrapNestedRefs<DetailsBladeContext>>,
|
|
21
|
+
default: () => ({} as DetailsBladeContext),
|
|
22
|
+
},
|
|
23
|
+
fields: {
|
|
24
|
+
type: Object as PropType<ComputedRef<VNodeArrayChildren>>,
|
|
25
|
+
default: () => ({} as ComputedRef<VNodeArrayChildren>),
|
|
26
|
+
},
|
|
27
|
+
formData: {
|
|
28
|
+
type: Object,
|
|
29
|
+
default: () => ({}),
|
|
30
|
+
},
|
|
31
|
+
fieldContext: {
|
|
32
|
+
type: Object,
|
|
33
|
+
default: undefined,
|
|
34
|
+
},
|
|
35
|
+
nodeBuilder: {
|
|
36
|
+
type: Function,
|
|
37
|
+
default: () => ({}),
|
|
38
|
+
},
|
|
39
|
+
currentLocale: {
|
|
40
|
+
type: String,
|
|
41
|
+
},
|
|
42
|
+
elIndex: {
|
|
43
|
+
type: Number,
|
|
44
|
+
},
|
|
45
|
+
rows: {
|
|
46
|
+
type: Number,
|
|
47
|
+
},
|
|
48
|
+
onSetModelData: {
|
|
49
|
+
type: Function,
|
|
50
|
+
default: () => ({}),
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useFilterBuilder } from "./useFilterBuilder";
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import {
|
|
2
|
+
h,
|
|
3
|
+
ref,
|
|
4
|
+
computed,
|
|
5
|
+
MaybeRef,
|
|
6
|
+
unref,
|
|
7
|
+
Component,
|
|
8
|
+
onMounted,
|
|
9
|
+
reactive,
|
|
10
|
+
RendererElement,
|
|
11
|
+
RendererNode,
|
|
12
|
+
VNode,
|
|
13
|
+
ComputedRef,
|
|
14
|
+
readonly,
|
|
15
|
+
} from "vue";
|
|
16
|
+
import * as _ from "lodash-es";
|
|
17
|
+
import { Checkbox, InputField } from "../../components/factories";
|
|
18
|
+
import { AsyncAction } from "../../../../../core/composables";
|
|
19
|
+
import { VcButton, VcCol, VcContainer, VcRow } from "../../../../../ui/components";
|
|
20
|
+
|
|
21
|
+
interface RawControl {
|
|
22
|
+
field: string;
|
|
23
|
+
component: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
data?: { value: string; displayName: string }[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface Control {
|
|
29
|
+
title: string;
|
|
30
|
+
fields: {
|
|
31
|
+
[x: string]: ReturnType<typeof Checkbox> | ReturnType<typeof InputField>;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Data {
|
|
36
|
+
columns: {
|
|
37
|
+
title: string;
|
|
38
|
+
controls: RawControl[];
|
|
39
|
+
}[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface UseFilterBuilder {
|
|
43
|
+
filterComponent: (slotMethods: { close: () => void }) => VNode<
|
|
44
|
+
RendererNode,
|
|
45
|
+
RendererElement,
|
|
46
|
+
{
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
}
|
|
50
|
+
>;
|
|
51
|
+
activeFilterCount: ComputedRef<number>;
|
|
52
|
+
isFilterVisible: ComputedRef<boolean>;
|
|
53
|
+
reset: () => Promise<void>;
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
+
readonly filter: Record<string, any>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default <Query>(args: { data: Data; query: MaybeRef<Query>; load: AsyncAction<Query> }): UseFilterBuilder => {
|
|
59
|
+
const _search = args.load;
|
|
60
|
+
const _data = args.data;
|
|
61
|
+
|
|
62
|
+
const isFilterVisible = ref(true);
|
|
63
|
+
const filter = reactive({});
|
|
64
|
+
|
|
65
|
+
const controls = ref<Control[]>([]);
|
|
66
|
+
|
|
67
|
+
const appliedFilter = ref({});
|
|
68
|
+
const activeFilterCount = computed(() => Object.values(appliedFilter.value).filter((item) => !!item).length);
|
|
69
|
+
|
|
70
|
+
const disable = computed(() => !Object.keys(filter).length || _.some(filter, _.isEmpty));
|
|
71
|
+
|
|
72
|
+
const disabled = computed(() => !Object.keys(appliedFilter.value).length || _.some(appliedFilter.value, _.isEmpty));
|
|
73
|
+
|
|
74
|
+
onMounted(() => createFilterControls());
|
|
75
|
+
|
|
76
|
+
function isItemSelected(value: string, field: string) {
|
|
77
|
+
return filter[field]?.some((x) => x === value);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function selectFilterItem(e: boolean, value: string, field: string) {
|
|
81
|
+
const isSelected = filter[field]?.includes(value);
|
|
82
|
+
|
|
83
|
+
if (!Array.isArray(filter[field])) {
|
|
84
|
+
filter[field] = [];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (e && !isSelected) {
|
|
88
|
+
filter[field]?.push(value);
|
|
89
|
+
} else if (!e && isSelected) {
|
|
90
|
+
filter[field] = filter[field].filter((x) => x !== value);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function createFilterControls() {
|
|
95
|
+
if (!_data?.columns) {
|
|
96
|
+
isFilterVisible.value = false;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
controls.value = _data.columns.map((item): Control => {
|
|
100
|
+
const ctr = item.controls.reduce((obj, control) => {
|
|
101
|
+
if (control.component === "vc-checkbox") {
|
|
102
|
+
const filterData = control.data;
|
|
103
|
+
const fields = createCheckboxFromData(filterData, control);
|
|
104
|
+
|
|
105
|
+
obj = fields;
|
|
106
|
+
}
|
|
107
|
+
if (control.component === "vc-input") {
|
|
108
|
+
obj[control.field] = createInput(control);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return obj;
|
|
112
|
+
}, {});
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
title: item.title,
|
|
116
|
+
fields: ctr,
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function createCheckboxFromData(data: RawControl["data"], control: RawControl) {
|
|
122
|
+
if (!(data && data.length)) return;
|
|
123
|
+
return data.reduce((obj, currC) => {
|
|
124
|
+
obj[currC.value] = Checkbox({
|
|
125
|
+
props: {
|
|
126
|
+
classNames: "tw-mb-2",
|
|
127
|
+
modelValue: computed(() => isItemSelected(currC.value, control.field)),
|
|
128
|
+
"onUpdate:modelValue": (e) => selectFilterItem(e, currC.value, control.field),
|
|
129
|
+
},
|
|
130
|
+
slots: {
|
|
131
|
+
default: () => currC.displayName,
|
|
132
|
+
},
|
|
133
|
+
options: {
|
|
134
|
+
visibility: computed(() => true),
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
return obj;
|
|
139
|
+
}, {});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function createInput(control: RawControl) {
|
|
143
|
+
return InputField({
|
|
144
|
+
props: {
|
|
145
|
+
type: "date",
|
|
146
|
+
classNames: "tw-mb-3",
|
|
147
|
+
label: control.label,
|
|
148
|
+
modelValue: computed(() => filter[control.field]),
|
|
149
|
+
"onUpdate:modelValue": (e) => (filter[control.field] = e),
|
|
150
|
+
},
|
|
151
|
+
options: {
|
|
152
|
+
visibility: computed(() => true),
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
async function applyFilters(filterHandlerFn: () => void) {
|
|
158
|
+
filterHandlerFn();
|
|
159
|
+
await _search({
|
|
160
|
+
...unref(args.query),
|
|
161
|
+
...filter,
|
|
162
|
+
});
|
|
163
|
+
appliedFilter.value = {
|
|
164
|
+
...filter,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async function resetFilters(filterHandlerFn: () => void) {
|
|
169
|
+
filterHandlerFn();
|
|
170
|
+
|
|
171
|
+
await reset();
|
|
172
|
+
|
|
173
|
+
await _search({
|
|
174
|
+
...unref(args.query),
|
|
175
|
+
...filter,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function render(slotMethods: { close: () => void }) {
|
|
180
|
+
if (_.isEmpty(controls.value)) return;
|
|
181
|
+
return h(VcContainer, () => [
|
|
182
|
+
h(VcRow, () =>
|
|
183
|
+
Object.values(controls.value).map(({ title, fields }) =>
|
|
184
|
+
h(VcCol, { class: "tw-p-2" }, () => [
|
|
185
|
+
h("div", { class: "tw-mb-4 tw-text-[#a1c0d4] tw-font-bold tw-text-[17px]" }, title),
|
|
186
|
+
Object.values(fields).map((item) => {
|
|
187
|
+
if ("component" in item && item.component) {
|
|
188
|
+
return h(
|
|
189
|
+
item.component as Component,
|
|
190
|
+
{ ...item.props, class: item.props.classNames },
|
|
191
|
+
"slots" in item && item.slots ? { ...item.slots } : {}
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
}),
|
|
195
|
+
])
|
|
196
|
+
)
|
|
197
|
+
),
|
|
198
|
+
h(VcRow, () =>
|
|
199
|
+
h(VcCol, { class: "tw-p-2" }, () =>
|
|
200
|
+
h("div", { class: "tw-flex tw-justify-end" }, [
|
|
201
|
+
h(
|
|
202
|
+
VcButton,
|
|
203
|
+
{
|
|
204
|
+
outline: true,
|
|
205
|
+
class: "tw-mr-4",
|
|
206
|
+
disabled: disabled.value,
|
|
207
|
+
onClick: () => resetFilters(slotMethods.close),
|
|
208
|
+
},
|
|
209
|
+
() => "Reset"
|
|
210
|
+
),
|
|
211
|
+
h(
|
|
212
|
+
VcButton,
|
|
213
|
+
{ disabled: disable.value, onClick: () => applyFilters(slotMethods.close) },
|
|
214
|
+
() => "Apply filters"
|
|
215
|
+
),
|
|
216
|
+
])
|
|
217
|
+
)
|
|
218
|
+
),
|
|
219
|
+
]);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
async function reset() {
|
|
223
|
+
Object.keys(filter).forEach((key: string) => (filter[key] = undefined));
|
|
224
|
+
|
|
225
|
+
appliedFilter.value = {};
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return {
|
|
229
|
+
filterComponent: render,
|
|
230
|
+
activeFilterCount,
|
|
231
|
+
filter: readonly(filter),
|
|
232
|
+
isFilterVisible: computed(() => isFilterVisible.value),
|
|
233
|
+
reset,
|
|
234
|
+
};
|
|
235
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { computed, ref, watch } from "vue";
|
|
2
|
+
import * as _ from "lodash-es";
|
|
3
|
+
import { useForm, useIsFormDirty, useIsFormValid } from "vee-validate";
|
|
4
|
+
import { useAsync, useLoading } from "../../../../../core/composables";
|
|
5
|
+
import type { ItemId, IValidationState, UseDetails } from "../types";
|
|
6
|
+
import { createUnrefFn } from "@vueuse/core";
|
|
7
|
+
|
|
8
|
+
export interface UseDetailsFactoryParams<Item> {
|
|
9
|
+
load: (args: ItemId) => Promise<Item>;
|
|
10
|
+
saveChanges: (details: Item) => Promise<Item>;
|
|
11
|
+
remove: (args: ItemId) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const useDetailsFactory = <Item>(factoryParams: UseDetailsFactoryParams<Item>) => {
|
|
15
|
+
return function useDetails(): UseDetails<Item> {
|
|
16
|
+
const { setFieldError, setErrors, validate } = useForm({
|
|
17
|
+
validateOnMount: false,
|
|
18
|
+
});
|
|
19
|
+
const item = ref<Item>();
|
|
20
|
+
const itemTemp = ref<Item>();
|
|
21
|
+
const isModified = ref(false);
|
|
22
|
+
const isFormValid = useIsFormValid();
|
|
23
|
+
const isDirty = useIsFormDirty();
|
|
24
|
+
const isDisabled = computed(() => !isDirty.value || !isFormValid.value);
|
|
25
|
+
|
|
26
|
+
const { loading: itemLoading, action: load } = useAsync<ItemId>(async (args) => {
|
|
27
|
+
item.value = await factoryParams.load(args);
|
|
28
|
+
resetModified(item.value);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const { loading: manageLoading, action: saveChanges } = useAsync<Item>(async (item) => {
|
|
32
|
+
if (validationState.value.valid) {
|
|
33
|
+
await factoryParams.saveChanges(item);
|
|
34
|
+
isModified.value = false;
|
|
35
|
+
} else throw new Error("Form is not valid");
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const { loading: removeLoading, action: remove } = useAsync<ItemId>(async (args) => {
|
|
39
|
+
await factoryParams.remove(args);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const loading = useLoading(itemLoading, manageLoading, removeLoading);
|
|
43
|
+
|
|
44
|
+
const validationState = computed(
|
|
45
|
+
(): IValidationState<Item> => ({
|
|
46
|
+
dirty: isDirty.value,
|
|
47
|
+
valid: isFormValid.value,
|
|
48
|
+
modified: isModified.value,
|
|
49
|
+
disabled: isDisabled.value,
|
|
50
|
+
validated: !isDisabled.value && isModified.value,
|
|
51
|
+
setFieldError,
|
|
52
|
+
setErrors,
|
|
53
|
+
resetModified,
|
|
54
|
+
validate,
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
watch(
|
|
59
|
+
[() => item, () => itemTemp],
|
|
60
|
+
([state, stateCopy]) => {
|
|
61
|
+
isModified.value = !_.isEqual(stateCopy.value, state.value);
|
|
62
|
+
},
|
|
63
|
+
{ deep: true }
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const resetModified = createUnrefFn((data: Item, updateInitial = false) => {
|
|
67
|
+
if (updateInitial) {
|
|
68
|
+
item.value = data;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
itemTemp.value = _.cloneDeep(data);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
load,
|
|
76
|
+
saveChanges,
|
|
77
|
+
remove,
|
|
78
|
+
loading,
|
|
79
|
+
item,
|
|
80
|
+
validationState,
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { ComputedRef, Ref, computed, ref } from "vue";
|
|
3
|
+
import { CustomQuery, UseList } from "../types";
|
|
4
|
+
import { AsyncAction, useAsync, useLoading } from "../../../../../core/composables";
|
|
5
|
+
|
|
6
|
+
interface ISearchResult<T> {
|
|
7
|
+
totalCount?: number;
|
|
8
|
+
results?: T;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface UseListFactoryParams<Items extends Record<string, any>[], Query extends IQuery> {
|
|
12
|
+
load?: (query: Query) => Promise<ISearchResult<Items>>;
|
|
13
|
+
remove?: (query: Query, customQuery: CustomQuery) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface IQuery {
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
take?: number;
|
|
19
|
+
sort?: string;
|
|
20
|
+
skip?: number;
|
|
21
|
+
keyword?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IUseListOptions extends Pick<IQuery, "sort"> {
|
|
25
|
+
pageSize?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const useListFactory = <Items extends Record<string, any>[], Query extends IQuery>(
|
|
29
|
+
factoryParams: UseListFactoryParams<Items, Query>
|
|
30
|
+
) => {
|
|
31
|
+
return function useList(options?: IUseListOptions): UseList<Items, Query> {
|
|
32
|
+
const pageSize = options?.pageSize || 20;
|
|
33
|
+
const searchResult = ref<ISearchResult<Items>>();
|
|
34
|
+
const searchQuery = ref({
|
|
35
|
+
take: pageSize,
|
|
36
|
+
sort: options?.sort,
|
|
37
|
+
}) as Ref<Query>;
|
|
38
|
+
|
|
39
|
+
const { loading: itemsLoading, action: load } = useAsync<Query>(async (query) => {
|
|
40
|
+
searchQuery.value = { ...searchQuery.value, ...query };
|
|
41
|
+
searchResult.value = await factoryParams.load(query);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const { loading: itemsDelete, action: remove } = useAsync<CustomQuery>(async (customQuery) => {
|
|
45
|
+
await factoryParams.remove(searchQuery.value, customQuery);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const loading = useLoading(itemsLoading, itemsDelete);
|
|
49
|
+
|
|
50
|
+
const pagination = computed(() => ({
|
|
51
|
+
currentPage: (searchQuery.value?.skip || 0) / Math.max(1, searchQuery?.value.take || 20) + 1,
|
|
52
|
+
totalCount: searchResult.value?.totalCount,
|
|
53
|
+
pageSize: pageSize,
|
|
54
|
+
get pages() {
|
|
55
|
+
return Math.ceil(this.totalCount / this.pageSize);
|
|
56
|
+
},
|
|
57
|
+
}));
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
items: computed(() => searchResult.value?.results),
|
|
61
|
+
query: searchQuery,
|
|
62
|
+
loading,
|
|
63
|
+
pagination,
|
|
64
|
+
load,
|
|
65
|
+
remove,
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { ComputedRef, MaybeRef, Ref, UnwrapNestedRefs } from "vue";
|
|
3
|
+
import { AsyncAction } from "../../../../../core/composables";
|
|
4
|
+
import { SettingsSchema } from "../../types";
|
|
5
|
+
import { Asset, AssetsHandler, IBladeToolbar, IImage } from "../../../../../core/types";
|
|
6
|
+
import { useBladeNavigation } from "../../../../components";
|
|
7
|
+
|
|
8
|
+
export type ItemId = { id: string };
|
|
9
|
+
|
|
10
|
+
export interface IPagination {
|
|
11
|
+
currentPage: number;
|
|
12
|
+
totalCount: number;
|
|
13
|
+
pageSize: number;
|
|
14
|
+
pages: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IValidationState<Item> {
|
|
18
|
+
valid: boolean;
|
|
19
|
+
dirty: boolean;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
modified: boolean;
|
|
22
|
+
validated: boolean;
|
|
23
|
+
setFieldError: (field: string, message: string | string[]) => void;
|
|
24
|
+
setErrors: (fields: Record<string, string>) => void;
|
|
25
|
+
resetModified: (data: MaybeRef<Item>, updateInitial?: MaybeRef<boolean>) => void;
|
|
26
|
+
validate: () => Promise<{ valid: boolean; errors: Record<string, string> }>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type CustomQuery = { ids: string[] | null; allSelected?: boolean };
|
|
30
|
+
|
|
31
|
+
export interface UseDetails<Item, Scope extends DetailsBaseBladeScope = DetailsBaseBladeScope> {
|
|
32
|
+
load: AsyncAction<ItemId>;
|
|
33
|
+
saveChanges: AsyncAction<Item>;
|
|
34
|
+
remove: AsyncAction<ItemId>;
|
|
35
|
+
loading: ComputedRef<boolean>;
|
|
36
|
+
item: Ref<Item>;
|
|
37
|
+
validationState: ComputedRef<IValidationState<Item>>;
|
|
38
|
+
scope?: ComputedRef<UnwrapNestedRefs<Scope>>;
|
|
39
|
+
bladeTitle?: ComputedRef<string>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface UseList<Items, Query, Scope extends ListBaseBladeScope = ListBaseBladeScope> {
|
|
43
|
+
items: ComputedRef<Items>;
|
|
44
|
+
query: Ref<Query>;
|
|
45
|
+
loading: ComputedRef<boolean>;
|
|
46
|
+
pagination: ComputedRef<{
|
|
47
|
+
currentPage: number;
|
|
48
|
+
totalCount: number;
|
|
49
|
+
pageSize: number;
|
|
50
|
+
pages: number;
|
|
51
|
+
}>;
|
|
52
|
+
load: AsyncAction<Query>;
|
|
53
|
+
remove?: AsyncAction<CustomQuery>;
|
|
54
|
+
scope?: ComputedRef<UnwrapNestedRefs<Scope>>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface BaseBladeScope {
|
|
58
|
+
[x: string]: any;
|
|
59
|
+
toolbarOverrides?: { [x: string]: IBladeToolbar } | ((...args: any[]) => any);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ListBaseBladeScope extends BaseBladeScope {
|
|
63
|
+
openDetailsBlade: (args?: Omit<Parameters<ReturnType<typeof useBladeNavigation>["openBlade"]>["0"], "blade">) => void;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface DetailsBaseBladeScope extends BaseBladeScope {
|
|
67
|
+
disabled?: ComputedRef<boolean>;
|
|
68
|
+
multilanguage?: {
|
|
69
|
+
loading: ComputedRef<boolean>;
|
|
70
|
+
currentLocale: Ref<string>;
|
|
71
|
+
languages: Ref<string[]>;
|
|
72
|
+
setLocale: (locale: string) => void;
|
|
73
|
+
localesOptions: Ref<{ label: string; value: string }[]>;
|
|
74
|
+
getLanguages: AsyncAction<void, void>;
|
|
75
|
+
};
|
|
76
|
+
dynamicProperties?: {
|
|
77
|
+
loading: ComputedRef<boolean>;
|
|
78
|
+
loadDictionaries: (
|
|
79
|
+
property: Record<string, any>,
|
|
80
|
+
keyword?: string,
|
|
81
|
+
locale?: string
|
|
82
|
+
) => Promise<Record<string, any>[]>;
|
|
83
|
+
getPropertyValue: (property: Record<string, any>, locale: string) => any;
|
|
84
|
+
setPropertyValue: (data: {
|
|
85
|
+
property: Record<string, any>;
|
|
86
|
+
value: string | Record<string, any>[];
|
|
87
|
+
dictionary?: Record<string, any>[];
|
|
88
|
+
locale?: string;
|
|
89
|
+
}) => void;
|
|
90
|
+
};
|
|
91
|
+
assetsHandler?: {
|
|
92
|
+
assets?: AssetsHandler<Asset, Asset>;
|
|
93
|
+
images?: AssetsHandler<IImage, IImage>;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface DetailsBladeContext extends UseDetails<Record<string, any>, DetailsBaseBladeScope> {
|
|
98
|
+
settings: ComputedRef<SettingsSchema>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface ListBladeContext extends UseList<Record<string, any>[], Record<string, any>, ListBaseBladeScope> {
|
|
102
|
+
settings: ComputedRef<SettingsSchema>;
|
|
103
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { reactify } from "@vueuse/core";
|
|
2
|
+
import { toValue } from "vue";
|
|
3
|
+
import * as _ from "lodash-es";
|
|
4
|
+
|
|
5
|
+
export const getModel = reactify((property: string, context: Record<string, any>) => {
|
|
6
|
+
if (property && context) {
|
|
7
|
+
return _.get(context, property);
|
|
8
|
+
}
|
|
9
|
+
return null;
|
|
10
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { unref, computed, toValue, h, UnwrapNestedRefs, MaybeRef, reactive } from "vue";
|
|
2
|
+
import FIELD_MAP from "../components/FIELD_MAP";
|
|
3
|
+
import { ControlSchema } from "../types";
|
|
4
|
+
import { IControlBaseProps, IControlBaseOptions } from "../types/models";
|
|
5
|
+
import { getModel } from "./getters";
|
|
6
|
+
import { setModel } from "./setters";
|
|
7
|
+
import { unwrapInterpolation } from "./unwrapInterpolation";
|
|
8
|
+
import { DetailsBladeContext } from "../factories";
|
|
9
|
+
import * as _ from "lodash-es";
|
|
10
|
+
|
|
11
|
+
function disabledHandler(
|
|
12
|
+
disabled: { method?: string } | boolean,
|
|
13
|
+
context: UnwrapNestedRefs<DetailsBladeContext>
|
|
14
|
+
): boolean {
|
|
15
|
+
if (!disabled) return false;
|
|
16
|
+
if (typeof disabled === "boolean") return disabled;
|
|
17
|
+
else if (typeof context.scope[disabled.method] === "function") return context.scope[disabled.method]();
|
|
18
|
+
else if (context.scope[disabled.method]) return context.scope[disabled.method];
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function nodeBuilder<Context, BContext extends UnwrapNestedRefs<DetailsBladeContext>, FormData>(args: {
|
|
23
|
+
controlSchema: ControlSchema;
|
|
24
|
+
parentId: string | number;
|
|
25
|
+
internalContext: Context;
|
|
26
|
+
bladeContext: BContext;
|
|
27
|
+
currentLocale: MaybeRef<string>;
|
|
28
|
+
formData: FormData;
|
|
29
|
+
}) {
|
|
30
|
+
const { controlSchema, parentId, internalContext, bladeContext, currentLocale, formData } = args;
|
|
31
|
+
if (!controlSchema) return false;
|
|
32
|
+
|
|
33
|
+
const baseProps = reactive<IControlBaseProps>({
|
|
34
|
+
key: `${parentId}`,
|
|
35
|
+
label: controlSchema.label ? unref(unwrapInterpolation(controlSchema.label, internalContext)) : undefined,
|
|
36
|
+
disabled:
|
|
37
|
+
("disabled" in bladeContext.scope && bladeContext.scope.disabled) ||
|
|
38
|
+
disabledHandler("disabled" in controlSchema && controlSchema.disabled, bladeContext),
|
|
39
|
+
name: controlSchema.id,
|
|
40
|
+
rules: controlSchema.rules,
|
|
41
|
+
placeholder: controlSchema.placeholder,
|
|
42
|
+
required: controlSchema.rules?.required,
|
|
43
|
+
modelValue: getModel(controlSchema.property, internalContext),
|
|
44
|
+
"onUpdate:modelValue": (e) => {
|
|
45
|
+
setModel({ property: controlSchema.property, value: e, context: internalContext });
|
|
46
|
+
|
|
47
|
+
if (_.has(controlSchema, "update.method")) {
|
|
48
|
+
controlSchema.update.method in bladeContext.scope &&
|
|
49
|
+
typeof bladeContext.scope[controlSchema.update.method] === "function"
|
|
50
|
+
? bladeContext.scope[controlSchema.update.method](e, controlSchema.property, internalContext)
|
|
51
|
+
: undefined;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
tooltip: controlSchema.tooltip,
|
|
55
|
+
multilanguage: controlSchema.multilanguage,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const baseOptions = reactive<IControlBaseOptions>({
|
|
59
|
+
visibility: computed(() =>
|
|
60
|
+
controlSchema.visibility?.method ? toValue(bladeContext.scope[controlSchema.visibility?.method]) : true
|
|
61
|
+
),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const component = FIELD_MAP[controlSchema.component];
|
|
65
|
+
|
|
66
|
+
const fieldsHandler = computed(() => {
|
|
67
|
+
if (!("fields" in controlSchema)) return null;
|
|
68
|
+
const fieldsModel = getModel(controlSchema.property, internalContext);
|
|
69
|
+
|
|
70
|
+
if (toValue(fieldsModel) && Array.isArray(toValue(fieldsModel))) {
|
|
71
|
+
return toValue(fieldsModel).map((model) =>
|
|
72
|
+
controlSchema.fields.map((fieldItem) =>
|
|
73
|
+
nodeBuilder({
|
|
74
|
+
controlSchema: fieldItem,
|
|
75
|
+
parentId: `fieldset-${fieldItem.id}-${model.id}`,
|
|
76
|
+
internalContext: model,
|
|
77
|
+
bladeContext,
|
|
78
|
+
currentLocale,
|
|
79
|
+
formData,
|
|
80
|
+
})
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
return [
|
|
85
|
+
controlSchema.fields.map((field) =>
|
|
86
|
+
nodeBuilder({
|
|
87
|
+
controlSchema: field,
|
|
88
|
+
parentId: `fieldset-${parentId}-${field.id}`,
|
|
89
|
+
internalContext,
|
|
90
|
+
bladeContext,
|
|
91
|
+
currentLocale,
|
|
92
|
+
formData,
|
|
93
|
+
})
|
|
94
|
+
),
|
|
95
|
+
];
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const elProps = {
|
|
99
|
+
baseProps,
|
|
100
|
+
baseOptions,
|
|
101
|
+
bladeContext,
|
|
102
|
+
element: controlSchema,
|
|
103
|
+
currentLocale,
|
|
104
|
+
fields: fieldsHandler,
|
|
105
|
+
formData,
|
|
106
|
+
fieldContext: internalContext,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
return h(component, elProps);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export { nodeBuilder };
|