@vc-shell/framework 1.0.128 → 1.0.130
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 +38 -0
- package/core/api/platform.ts +514 -92
- package/core/composables/index.ts +2 -1
- package/core/composables/useApiClient/index.ts +1 -7
- package/core/composables/useAssets/index.ts +0 -6
- package/core/composables/useBeforeUnload/index.ts +20 -0
- package/core/composables/useMenuService/index.ts +96 -0
- package/core/composables/useNotifications/index.ts +29 -40
- package/core/composables/useSettings/index.ts +23 -29
- package/core/composables/useUser/index.ts +61 -132
- package/core/directives/loading/styles.css +5 -5
- package/core/interceptors/index.ts +75 -0
- package/core/plugins/i18n/index.ts +1 -0
- package/core/plugins/modularity/index.ts +63 -20
- package/core/plugins/moment/moment.ts +2 -2
- package/core/plugins/signalR/index.ts +23 -3
- package/core/types/index.ts +18 -35
- package/core/utilities/kebabToCamel.ts +1 -1
- package/dist/core/api/platform.d.ts +125 -87
- package/dist/core/api/platform.d.ts.map +1 -1
- package/dist/core/composables/index.d.ts +2 -1
- package/dist/core/composables/index.d.ts.map +1 -1
- package/dist/core/composables/useApiClient/index.d.ts.map +1 -1
- package/dist/core/composables/useAssets/index.d.ts.map +1 -1
- package/dist/core/composables/useBeforeUnload/index.d.ts +5 -0
- package/dist/core/composables/useBeforeUnload/index.d.ts.map +1 -0
- package/dist/core/composables/useMenuService/index.d.ts +16 -0
- package/dist/core/composables/useMenuService/index.d.ts.map +1 -0
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/useSettings/index.d.ts +2 -2
- package/dist/core/composables/useSettings/index.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts +8 -6
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/interceptors/index.d.ts +3 -0
- package/dist/core/interceptors/index.d.ts.map +1 -0
- package/dist/core/plugins/i18n/index.d.ts.map +1 -1
- package/dist/core/plugins/modularity/index.d.ts +1 -1
- package/dist/core/plugins/modularity/index.d.ts.map +1 -1
- package/dist/core/plugins/moment/moment.d.ts.map +1 -1
- package/dist/core/plugins/signalR/index.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +16 -29
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/{framework.mjs → framework.js} +32147 -32235
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/components/app-switcher/components/vc-app-switcher/index.d.ts +1 -19
- package/dist/shared/components/app-switcher/components/vc-app-switcher/index.d.ts.map +1 -1
- package/dist/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue.d.ts +3 -0
- 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/index.d.ts +1 -70
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts +1 -82
- 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/components/vc-blade-view/vc-blade-view.d.ts +28 -0
- package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts +11 -27
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/injectionKeys.d.ts +4 -0
- package/dist/shared/components/blade-navigation/injectionKeys.d.ts.map +1 -0
- package/dist/shared/components/blade-navigation/plugin.d.ts +4 -1
- package/dist/shared/components/blade-navigation/plugin.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/types/index.d.ts +48 -35
- package/dist/shared/components/blade-navigation/types/index.d.ts.map +1 -1
- package/dist/shared/components/error-interceptor/index.d.ts +33 -67
- package/dist/shared/components/error-interceptor/index.d.ts.map +1 -1
- package/dist/shared/components/index.d.ts +2 -0
- package/dist/shared/components/index.d.ts.map +1 -1
- package/dist/shared/components/language-selector/index.d.ts +1 -49
- package/dist/shared/components/language-selector/index.d.ts.map +1 -1
- package/dist/shared/components/language-selector/language-selector.vue.d.ts +1 -40
- package/dist/shared/components/language-selector/language-selector.vue.d.ts.map +1 -1
- package/dist/{ui/components/organisms/vc-notification-dropdown → shared/components/notification-dropdown}/_internal/notification/notification.vue.d.ts +2 -2
- package/dist/shared/components/notification-dropdown/_internal/notification/notification.vue.d.ts.map +1 -0
- package/dist/shared/components/notification-dropdown/index.d.ts +7 -0
- package/dist/shared/components/notification-dropdown/index.d.ts.map +1 -0
- package/dist/shared/components/notification-dropdown/notification-dropdown.vue.d.ts +3 -0
- package/dist/shared/components/notification-dropdown/notification-dropdown.vue.d.ts.map +1 -0
- package/dist/shared/components/notification-template/index.d.ts +91 -0
- package/dist/shared/components/notification-template/index.d.ts.map +1 -0
- package/dist/{ui/components/organisms/vc-notification-template/vc-notification-template.vue.d.ts → shared/components/notification-template/notification-template.vue.d.ts} +2 -2
- package/dist/shared/components/notification-template/notification-template.vue.d.ts.map +1 -0
- package/dist/shared/components/notifications/components/notification-container/index.d.ts +1 -1
- package/dist/shared/components/notifications/components/notification-container/index.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 +10 -16
- package/dist/shared/components/user-dropdown-button/index.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts +7 -4
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -1
- package/dist/shared/index.d.ts +4 -1
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts +3 -0
- package/dist/shared/modules/assets/components/assets-details/assets-details.vue.d.ts.map +1 -1
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +3 -0
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/composables/useFilterBuilder/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/types/index.d.ts +3 -1
- package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/index.d.ts +1 -3
- package/dist/shared/modules/dynamic/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +12 -10
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +5 -2
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/index.d.ts +16 -1
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
- package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
- package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts.map +1 -1
- package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
- package/dist/shared/utilities/vueUtils.d.ts.map +1 -1
- package/dist/tailwind.config.d.ts +56 -0
- package/dist/tailwind.config.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-badge/index.d.ts +32 -67
- package/dist/ui/components/atoms/vc-badge/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts +6 -1
- 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 +66 -102
- package/dist/ui/components/atoms/vc-card/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts +7 -0
- package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts +7 -1
- 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 +91 -129
- 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 +7 -1
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-col/vc-col.vue.d.ts +6 -1
- 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 +36 -71
- package/dist/ui/components/atoms/vc-container/index.d.ts.map +1 -1
- 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 +8 -38
- package/dist/ui/components/atoms/vc-hint/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-hint/vc-hint.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts +3 -0
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-image/vc-image.vue.d.ts +3 -0
- package/dist/ui/components/atoms/vc-image/vc-image.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-info-row/vc-info-row.vue.d.ts +3 -0
- 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 +42 -74
- 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 +7 -1
- 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 +32 -66
- package/dist/ui/components/atoms/vc-link/index.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/ui/components/atoms/vc-progress/index.d.ts +30 -63
- package/dist/ui/components/atoms/vc-progress/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts +3 -0
- package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-row/vc-row.vue.d.ts +3 -1
- package/dist/ui/components/atoms/vc-row/vc-row.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-status/vc-status.vue.d.ts +6 -1
- 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.map +1 -1
- package/dist/ui/components/atoms/vc-switch/vc-switch.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-video/vc-video.vue.d.ts +3 -0
- 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.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts +3 -0
- 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 +59 -98
- package/dist/ui/components/molecules/vc-code-editor/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-code-editor/vc-code-editor.vue.d.ts +1 -0
- package/dist/ui/components/molecules/vc-code-editor/vc-code-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +4 -1
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-field/_internal/vc-field-type/vc-field-type.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts +3 -0
- package/dist/ui/components/molecules/vc-field/vc-field.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts +67 -105
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +3 -0
- 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 +8 -38
- package/dist/ui/components/molecules/vc-form/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-form/vc-form.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +56 -1
- 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 +159 -214
- 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.vue.d.ts +3 -0
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +27 -9
- 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.map +1 -1
- package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts +3 -0
- 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 +59 -96
- package/dist/ui/components/molecules/vc-rating/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts +3 -0
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +257 -8
- 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 +55 -91
- package/dist/ui/components/molecules/vc-slider/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-slider/vc-slider.vue.d.ts +3 -0
- package/dist/ui/components/molecules/vc-slider/vc-slider.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts +6 -1
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/index.d.ts +0 -2
- package/dist/ui/components/organisms/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts +2 -4
- 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 +10 -7
- 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 +10 -18
- 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 +16 -16
- 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 +1 -292
- package/dist/ui/components/organisms/vc-app/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +17 -56
- 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.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 +3 -0
- 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 +3 -0
- 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 +89 -131
- package/dist/ui/components/organisms/vc-blade/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +3 -0
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts +21 -18
- 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 +4 -1
- 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 +4 -1
- 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/vc-gallery.vue.d.ts +3 -0
- 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 +32 -66
- package/dist/ui/components/organisms/vc-login-form/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts +3 -0
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.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-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 +3 -0
- 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 +3 -0
- 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 +3 -0
- 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/vc-table.vue.d.ts +57 -6
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/dist/ui/types/index.d.ts +5 -45
- package/dist/ui/types/index.d.ts.map +1 -1
- package/package.json +26 -30
- package/shared/components/app-switcher/components/vc-app-switcher/index.ts +1 -3
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +2 -2
- package/shared/components/blade-navigation/components/vc-blade-navigation/index.ts +1 -3
- package/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +46 -157
- package/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.ts +81 -0
- package/shared/components/blade-navigation/composables/useBladeNavigation/index.ts +323 -261
- package/shared/components/blade-navigation/injectionKeys.ts +4 -0
- package/shared/components/blade-navigation/plugin.ts +8 -10
- package/shared/components/blade-navigation/types/index.ts +53 -44
- package/shared/components/index.ts +2 -0
- package/shared/components/language-selector/language-selector.vue +12 -12
- package/{ui/components/organisms/vc-notification-dropdown → shared/components/notification-dropdown}/_internal/notification/notification.vue +6 -5
- package/shared/components/notification-dropdown/index.ts +10 -0
- package/{ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue → shared/components/notification-dropdown/notification-dropdown.vue} +21 -17
- package/shared/components/notification-template/index.ts +10 -0
- package/{ui/components/organisms/vc-notification-template/vc-notification-template.vue → shared/components/notification-template/notification-template.vue} +2 -2
- package/shared/components/popup-handler/composables/usePopup/index.ts +29 -9
- package/shared/components/user-dropdown-button/user-dropdown-button.vue +58 -17
- package/shared/index.ts +3 -2
- package/shared/locales/en.json +7 -0
- package/shared/modules/assets/components/assets-details/assets-details.vue +5 -0
- package/shared/modules/assets-manager/components/assets-manager/assets-manager.vue +8 -5
- package/shared/modules/dynamic/components/fields/GalleryField.ts +7 -7
- package/shared/modules/dynamic/components/fields/InputCurrency.ts +2 -1
- package/shared/modules/dynamic/composables/useFilterBuilder/index.ts +42 -36
- package/shared/modules/dynamic/factories/base/useDetailsFactory.ts +5 -3
- package/shared/modules/dynamic/factories/types/index.ts +6 -2
- package/shared/modules/dynamic/helpers/override.ts +38 -32
- package/shared/modules/dynamic/helpers/safeIn.ts +1 -1
- package/shared/modules/dynamic/index.ts +12 -12
- package/shared/modules/dynamic/pages/dynamic-blade-form.vue +96 -57
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +133 -118
- package/shared/modules/dynamic/types/index.ts +16 -1
- package/shared/pages/InvitePage/components/invite/Invite.vue +2 -2
- package/shared/pages/LoginPage/components/login/Login.vue +23 -16
- package/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue +3 -3
- package/shared/utilities/vueUtils.ts +7 -7
- package/tailwind.config.ts +50 -0
- package/ui/components/atoms/vc-button/vc-button.vue +1 -1
- package/ui/components/atoms/vc-card/vc-card.stories.ts +25 -0
- package/ui/components/atoms/vc-card/vc-card.vue +1 -1
- package/ui/components/atoms/vc-container/vc-container.vue +1 -1
- package/ui/components/atoms/vc-icon/vc-icon.vue +1 -1
- package/ui/components/molecules/vc-editor/vc-editor.vue +2 -7
- package/ui/components/molecules/vc-notification/vc-notification.vue +2 -2
- package/ui/components/molecules/vc-select/vc-select.vue +13 -13
- package/ui/components/organisms/index.ts +0 -2
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +25 -42
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +123 -25
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +11 -103
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +34 -52
- package/ui/components/organisms/vc-app/index.ts +1 -12
- package/ui/components/organisms/vc-app/vc-app.stories.ts +36 -36
- package/ui/components/organisms/vc-app/vc-app.vue +122 -61
- package/ui/components/organisms/vc-blade/vc-blade.vue +5 -13
- package/ui/components/organisms/vc-table/vc-table.vue +9 -9
- package/ui/locales/en.json +2 -4
- package/ui/types/index.ts +7 -51
- package/core/composables/useMenuComposer/index.ts +0 -25
- package/dist/core/composables/useMenuComposer/index.d.ts +0 -12
- package/dist/core/composables/useMenuComposer/index.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-notification-dropdown/_internal/notification/notification.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-notification-dropdown/index.d.ts +0 -38
- package/dist/ui/components/organisms/vc-notification-dropdown/index.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue.d.ts +0 -21
- package/dist/ui/components/organisms/vc-notification-dropdown/vc-notification-dropdown.vue.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-notification-template/index.d.ts +0 -2
- package/dist/ui/components/organisms/vc-notification-template/index.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-notification-template/vc-notification-template.vue.d.ts.map +0 -1
- package/dist/utils/isInDemoMode.d.ts +0 -2
- package/dist/utils/isInDemoMode.d.ts.map +0 -1
- package/dist/vite.config.d.ts +0 -3
- package/dist/vite.config.d.ts.map +0 -1
- package/tailwind.config.js +0 -50
- package/ui/components/organisms/vc-notification-dropdown/index.ts +0 -3
- package/ui/components/organisms/vc-notification-template/index.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Router } from "vue-router";
|
|
2
|
+
import { App } from "vue";
|
|
3
3
|
import * as components from "./components";
|
|
4
|
-
import { BladeNavigationPlugin
|
|
4
|
+
import { BladeNavigationPlugin } from "./types";
|
|
5
5
|
|
|
6
6
|
// Declare globally
|
|
7
7
|
declare module "@vue/runtime-core" {
|
|
@@ -13,17 +13,15 @@ declare module "@vue/runtime-core" {
|
|
|
13
13
|
export let bladeNavigationInstance: BladeNavigationPlugin;
|
|
14
14
|
|
|
15
15
|
export const VcBladeNavigationComponent = {
|
|
16
|
-
install(app: App) {
|
|
16
|
+
install(app: App, args: { router: Router }) {
|
|
17
17
|
// Register components
|
|
18
|
-
|
|
18
|
+
Object.entries(components).forEach(([componentName, component]) => {
|
|
19
|
+
app.component(componentName, component);
|
|
20
|
+
});
|
|
19
21
|
|
|
20
22
|
// Plugin
|
|
21
|
-
const blades = ref<IBladeContainer[]>([]);
|
|
22
|
-
const bladesRefs = ref<IBladeRef[]>([]);
|
|
23
|
-
|
|
24
23
|
const bladeNavigationPlugin: BladeNavigationPlugin = {
|
|
25
|
-
|
|
26
|
-
bladesRefs,
|
|
24
|
+
router: args.router,
|
|
27
25
|
};
|
|
28
26
|
|
|
29
27
|
app.config.globalProperties.$bladeNavigationPlugin = bladeNavigationPlugin;
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { RouteRecordNormalized, Router } from "vue-router";
|
|
2
3
|
import {
|
|
3
4
|
AppContext,
|
|
4
5
|
Component,
|
|
5
6
|
ComponentOptionsBase,
|
|
6
7
|
ComponentOptionsMixin,
|
|
7
|
-
ComponentPublicInstance,
|
|
8
|
-
ComputedOptions,
|
|
9
8
|
VNode,
|
|
10
9
|
ComponentInternalInstance,
|
|
11
10
|
VNodeTypes,
|
|
12
|
-
|
|
13
|
-
MethodOptions,
|
|
11
|
+
ComponentPublicInstance,
|
|
14
12
|
} from "vue";
|
|
15
13
|
import { ComponentPublicInstanceConstructor } from "../../../utilities/vueUtils";
|
|
16
14
|
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated use `ComponentPublicInstanceConstructor` interface instead
|
|
19
|
-
*/
|
|
20
|
-
export type ComponentInstanceConstructor<T = any> = ComponentPublicInstanceConstructor<T>;
|
|
21
|
-
|
|
22
15
|
export type CoreBladeComponentProps = {
|
|
23
16
|
expanded?: boolean;
|
|
24
17
|
closable?: boolean;
|
|
@@ -31,29 +24,38 @@ export type CoreDynamicBladeComponentProps = {
|
|
|
31
24
|
composables?: any;
|
|
32
25
|
};
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
export interface MenuItemConfig {
|
|
28
|
+
id?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Menu item title.
|
|
31
|
+
*/
|
|
32
|
+
title: string;
|
|
33
|
+
/**
|
|
34
|
+
* Menu item icon.
|
|
35
|
+
*/
|
|
36
|
+
icon: string;
|
|
37
|
+
/**
|
|
38
|
+
* Menu item group. Is used to group menu items with it's provided name.
|
|
39
|
+
*
|
|
40
|
+
* If the path is not specified, the menu item is added to the root of the menu.
|
|
41
|
+
*/
|
|
42
|
+
group?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Position priority.
|
|
45
|
+
*/
|
|
46
|
+
priority: number;
|
|
47
|
+
}
|
|
42
48
|
|
|
43
49
|
export type CoreBladeAdditionalSettings = {
|
|
44
50
|
url?: `/${string}`;
|
|
45
51
|
permissions?: string | string[];
|
|
46
52
|
isWorkspace?: boolean;
|
|
53
|
+
name?: string;
|
|
54
|
+
menuItem?: MenuItemConfig;
|
|
47
55
|
};
|
|
48
|
-
|
|
49
|
-
export type CoreBladeNavigationData = {
|
|
50
|
-
idx?: number;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
56
|
export interface CoreBladeExposed {
|
|
54
57
|
[x: string]: any;
|
|
55
58
|
title?: string;
|
|
56
|
-
onBeforeClose?: () => Promise<boolean>;
|
|
57
59
|
reloadParent?: () => void;
|
|
58
60
|
reload?: () => void;
|
|
59
61
|
}
|
|
@@ -64,22 +66,13 @@ export interface IParentCallArgs {
|
|
|
64
66
|
callback?: (args: unknown) => void;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
export interface IBladeContainer extends IBladeEvent {
|
|
68
|
-
idx?: number;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
69
|
export interface BladeComponentInternalInstance extends ComponentInternalInstance {
|
|
72
|
-
vnode: VNode &
|
|
70
|
+
vnode: VNode & BladeVNode;
|
|
73
71
|
appContext: AppContext & { components: Record<string, BladeInstanceConstructor> };
|
|
74
72
|
}
|
|
75
73
|
|
|
76
74
|
export type ExtractedBladeOptions<T, U extends keyof T> = T[U];
|
|
77
75
|
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated use `BladeInstanceConstructor` interface instead
|
|
80
|
-
*/
|
|
81
|
-
export type BladeConstructor<T extends ComponentPublicInstance = ComponentPublicInstance> = BladeInstanceConstructor<T>;
|
|
82
|
-
|
|
83
76
|
type Extractor<T> = Extract<T, ComponentPublicInstanceConstructor>;
|
|
84
77
|
|
|
85
78
|
export type BladeInstanceConstructor<T extends Component = Component> = Extractor<T> & {
|
|
@@ -90,9 +83,7 @@ export type BladeInstanceConstructor<T extends Component = Component> = Extracto
|
|
|
90
83
|
$props: InstanceType<Extractor<T>>["$props"] & CoreBladeComponentProps;
|
|
91
84
|
};
|
|
92
85
|
} & ComponentOptionsBase<any, any, any, any, ComponentOptionsMixin, ComponentOptionsMixin, any, any, any> &
|
|
93
|
-
|
|
94
|
-
CoreBladeAdditionalSettings &
|
|
95
|
-
CoreBladeNavigationData;
|
|
86
|
+
CoreBladeAdditionalSettings;
|
|
96
87
|
|
|
97
88
|
export interface IBladeEvent<T extends Component = Component> {
|
|
98
89
|
blade: BladeInstanceConstructor<T>;
|
|
@@ -102,14 +93,32 @@ export interface IBladeEvent<T extends Component = Component> {
|
|
|
102
93
|
onClose?: () => void;
|
|
103
94
|
}
|
|
104
95
|
|
|
105
|
-
export interface
|
|
106
|
-
|
|
107
|
-
blade: IBladeContainer;
|
|
108
|
-
expanded?: boolean;
|
|
109
|
-
active?: boolean;
|
|
96
|
+
export interface BladeNavigationPlugin {
|
|
97
|
+
router: Router;
|
|
110
98
|
}
|
|
111
99
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
100
|
+
type VNodeMountHook = (vnode: BladeVNode | VNode) => void;
|
|
101
|
+
export interface BladeVNode extends VNode {
|
|
102
|
+
props: {
|
|
103
|
+
navigation: {
|
|
104
|
+
onOpen?: () => void;
|
|
105
|
+
onClose?: () => void;
|
|
106
|
+
fullPath: string;
|
|
107
|
+
bladePath?: string;
|
|
108
|
+
idx: number;
|
|
109
|
+
uniqueRouteKey: string;
|
|
110
|
+
};
|
|
111
|
+
onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
|
|
112
|
+
onVnodeMounted?: VNodeMountHook | VNodeMountHook[];
|
|
113
|
+
} & Omit<VNode["props"], "onVnodeUnmounted" | "onVnodeMounted"> &
|
|
114
|
+
CoreBladeComponentProps;
|
|
115
|
+
type: VNodeTypes & BladeInstanceConstructor;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface BladeRouteRecordLocationNormalized extends RouteRecordNormalized {
|
|
119
|
+
components: Record<string, BladeVNode>;
|
|
120
|
+
instances: Record<
|
|
121
|
+
string,
|
|
122
|
+
ComponentPublicInstance<CoreBladeExposed, any, CoreBladeExposed, any, CoreBladeExposed, any, any, any, any, any>
|
|
123
|
+
>;
|
|
115
124
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
}
|
|
7
7
|
"
|
|
8
8
|
class="tw-relative"
|
|
9
|
-
:title="
|
|
9
|
+
:title="$t('COMPONENTS.LANGUAGE_SELECTOR.TITLE')"
|
|
10
10
|
@click.stop="isDropActive = !isDropActive"
|
|
11
11
|
>
|
|
12
12
|
<div
|
|
@@ -43,18 +43,18 @@
|
|
|
43
43
|
import { VcIcon } from "./../../../ui/components";
|
|
44
44
|
import { ref } from "vue";
|
|
45
45
|
import { vOnClickOutside } from "@vueuse/components";
|
|
46
|
+
import { useI18n } from "vue-i18n";
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
title: string;
|
|
49
|
-
value: string;
|
|
50
|
-
languageItems: { lang: string; title: string; clickHandler: (lang: string) => void }[];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
withDefaults(defineProps<Props>(), {
|
|
54
|
-
title: "",
|
|
55
|
-
value: "",
|
|
56
|
-
languageItems: () => [],
|
|
57
|
-
});
|
|
48
|
+
const { locale: currentLocale, availableLocales, getLocaleMessage } = useI18n({ useScope: "global" });
|
|
58
49
|
|
|
59
50
|
const isDropActive = ref(false);
|
|
51
|
+
|
|
52
|
+
const languageItems = availableLocales.map((locale: string) => ({
|
|
53
|
+
lang: locale,
|
|
54
|
+
title: (getLocaleMessage(locale) as { language_name: string }).language_name,
|
|
55
|
+
clickHandler(lang: string) {
|
|
56
|
+
currentLocale.value = lang;
|
|
57
|
+
localStorage.setItem("VC_LANGUAGE_SETTINGS", lang);
|
|
58
|
+
},
|
|
59
|
+
}));
|
|
60
60
|
</script>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<notificationTemplateRenderer />
|
|
6
6
|
</template>
|
|
7
7
|
<template v-else>
|
|
8
|
-
<
|
|
8
|
+
<NotificationTemplate
|
|
9
9
|
:color="notificationStyle.color"
|
|
10
10
|
:title="notification.title ?? ''"
|
|
11
11
|
:icon="notificationStyle.icon"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
class="tw-mb-1"
|
|
17
17
|
>{{ notification.description }}</VcHint
|
|
18
18
|
>
|
|
19
|
-
</
|
|
19
|
+
</NotificationTemplate>
|
|
20
20
|
</template>
|
|
21
21
|
</VcRow>
|
|
22
22
|
</div>
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
|
|
25
25
|
<script lang="ts" setup>
|
|
26
26
|
import { computed, h } from "vue";
|
|
27
|
-
import { PushNotification } from "
|
|
28
|
-
import { VcRow
|
|
29
|
-
import {
|
|
27
|
+
import { PushNotification } from "./../../../../../core/api/platform";
|
|
28
|
+
import { VcRow } from "./../../../../../ui/components";
|
|
29
|
+
import { NotificationTemplate } from "./../../../notification-template";
|
|
30
|
+
import { NotificationTemplateConstructor } from "../../../../../core/types";
|
|
30
31
|
|
|
31
32
|
export interface Props {
|
|
32
33
|
notification: PushNotification;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _NotificationDropdown from "./notification-dropdown.vue";
|
|
2
|
+
|
|
3
|
+
export const NotificationDropdown = _NotificationDropdown as typeof _NotificationDropdown;
|
|
4
|
+
|
|
5
|
+
// Declare globally
|
|
6
|
+
declare module "@vue/runtime-core" {
|
|
7
|
+
export interface GlobalComponents {
|
|
8
|
+
NotificationDropdown: typeof NotificationDropdown;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
}
|
|
7
7
|
"
|
|
8
8
|
class="tw-relative tw-flex tw-items-center tw-h-full"
|
|
9
|
-
:title="
|
|
9
|
+
:title="$t('COMPONENTS.NOTIFICATION_DROPDOWN.TITLE')"
|
|
10
10
|
@click.stop="toggleNotificationsDrop"
|
|
11
11
|
>
|
|
12
12
|
<div
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
>
|
|
66
66
|
<NotificationItem
|
|
67
67
|
:notification="item"
|
|
68
|
-
:templates="
|
|
68
|
+
:templates="notificationTemplates || []"
|
|
69
69
|
@on-click="() => (isDropdownVisible = false)"
|
|
70
70
|
/>
|
|
71
71
|
</div>
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
v-else
|
|
75
75
|
class="tw-flex tw-justify-center tw-items-center tw-p-4"
|
|
76
76
|
>
|
|
77
|
-
{{ t("COMPONENTS.
|
|
77
|
+
{{ t("COMPONENTS.NOTIFICATION_DROPDOWN.EMPTY") }}
|
|
78
78
|
</div>
|
|
79
79
|
</VcContainer>
|
|
80
80
|
</div>
|
|
@@ -82,30 +82,34 @@
|
|
|
82
82
|
</template>
|
|
83
83
|
|
|
84
84
|
<script lang="ts" setup>
|
|
85
|
-
import { ref } from "vue";
|
|
85
|
+
import { ref, inject, computed } from "vue";
|
|
86
86
|
import NotificationItem from "./_internal/notification/notification.vue";
|
|
87
|
-
import {
|
|
88
|
-
import { VcCol, VcContainer, VcIcon } from "./../../";
|
|
87
|
+
import { VcCol, VcContainer, VcIcon } from "../../../ui/components";
|
|
89
88
|
import { vOnClickOutside } from "@vueuse/components";
|
|
90
|
-
import { NotificationTemplateConstructor } from "./../../../../core/types";
|
|
91
89
|
import { useI18n } from "vue-i18n";
|
|
90
|
+
import { NotificationTemplateConstructor } from "../../../core/types";
|
|
91
|
+
import { useNotifications } from "../../../core/composables";
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
title: string;
|
|
95
|
-
isAccent?: boolean;
|
|
96
|
-
notifications: PushNotification[];
|
|
97
|
-
templates?: NotificationTemplateConstructor[];
|
|
98
|
-
onOpen?: () => void;
|
|
99
|
-
}
|
|
93
|
+
const notificationTemplates = inject<NotificationTemplateConstructor[]>("notificationTemplates");
|
|
100
94
|
|
|
101
|
-
const props = defineProps<Props>();
|
|
102
95
|
const { t } = useI18n({ useScope: "global" });
|
|
96
|
+
const { notifications, markAllAsRead } = useNotifications();
|
|
97
|
+
|
|
103
98
|
const isDropdownVisible = ref(false);
|
|
104
99
|
|
|
100
|
+
const isAccent = computed(() => {
|
|
101
|
+
return notifications.value.some((item) => item.isNew);
|
|
102
|
+
});
|
|
103
|
+
|
|
105
104
|
function toggleNotificationsDrop() {
|
|
106
105
|
isDropdownVisible.value = !isDropdownVisible.value;
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
|
|
107
|
+
onOpen();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function onOpen() {
|
|
111
|
+
if (notifications.value.some((x) => x.isNew)) {
|
|
112
|
+
markAllAsRead();
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
</script>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _NotificationTemplate from "./notification-template.vue";
|
|
2
|
+
|
|
3
|
+
export const NotificationTemplate = _NotificationTemplate as typeof _NotificationTemplate;
|
|
4
|
+
|
|
5
|
+
// Declare globally
|
|
6
|
+
declare module "@vue/runtime-core" {
|
|
7
|
+
export interface GlobalComponents {
|
|
8
|
+
NotificationTemplate: typeof NotificationTemplate;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
|
|
31
31
|
<script setup lang="ts">
|
|
32
32
|
import { computed } from "vue";
|
|
33
|
-
import { VcIcon } from "
|
|
33
|
+
import { VcIcon } from "../../../ui/components";
|
|
34
34
|
import moment from "moment";
|
|
35
|
-
import { PushNotification } from "
|
|
35
|
+
import { PushNotification } from "../../../core/api/platform";
|
|
36
36
|
|
|
37
37
|
export interface Props {
|
|
38
38
|
color: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import { VcPopup } from "./../../../../../ui/components";
|
|
2
3
|
import {
|
|
3
4
|
markRaw,
|
|
@@ -16,6 +17,7 @@ import { PopupPlugin, UsePopupInternal, UsePopupProps } from "./../../types";
|
|
|
16
17
|
import { popupPluginInstance } from "./../../plugin";
|
|
17
18
|
import { useI18n } from "vue-i18n";
|
|
18
19
|
import { ComponentPublicInstanceConstructor } from "../../../../utilities/vueUtils";
|
|
20
|
+
import * as _ from "lodash-es";
|
|
19
21
|
|
|
20
22
|
interface IUsePopup {
|
|
21
23
|
open(): void;
|
|
@@ -24,12 +26,18 @@ interface IUsePopup {
|
|
|
24
26
|
showError(message: string | Ref<string>): void;
|
|
25
27
|
}
|
|
26
28
|
|
|
29
|
+
function usePopupInternal() {
|
|
30
|
+
const instance = getCurrentInstance();
|
|
31
|
+
const popupInstance: PopupPlugin = (instance && inject("popupPlugin")) || popupPluginInstance;
|
|
32
|
+
|
|
33
|
+
return popupInstance;
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typeof VcPopup>(
|
|
28
|
-
options?: MaybeRef<UsePopupProps<T
|
|
37
|
+
options?: MaybeRef<UsePopupProps<T>>,
|
|
29
38
|
): IUsePopup {
|
|
30
39
|
const { t } = useI18n({ useScope: "global" });
|
|
31
|
-
const
|
|
32
|
-
const popupInstance: PopupPlugin = (instance && inject("popupPlugin")) || popupPluginInstance;
|
|
40
|
+
const popupInstance = usePopupInternal();
|
|
33
41
|
let rawPopup: UsePopupProps<DefineComponent> & UsePopupInternal;
|
|
34
42
|
|
|
35
43
|
if (options) {
|
|
@@ -43,9 +51,16 @@ export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typ
|
|
|
43
51
|
rawPopup = createInstance(unref(newVal));
|
|
44
52
|
}
|
|
45
53
|
},
|
|
46
|
-
{ deep: true }
|
|
54
|
+
{ deep: true },
|
|
47
55
|
);
|
|
48
56
|
|
|
57
|
+
function destroy(confirmation: UsePopupProps<DefineComponent>): void {
|
|
58
|
+
const popupInstanceInternal = usePopupInternal();
|
|
59
|
+
const index = popupInstanceInternal.popups.findIndex((x) => _.isEqualWith(x, confirmation, (val) => val.component));
|
|
60
|
+
|
|
61
|
+
if (index !== -1) popupInstanceInternal.popups.splice(index, 1);
|
|
62
|
+
}
|
|
63
|
+
|
|
49
64
|
async function open(customInstance?: UsePopupProps<DefineComponent>) {
|
|
50
65
|
let activeInstance;
|
|
51
66
|
await nextTick();
|
|
@@ -53,6 +68,8 @@ export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typ
|
|
|
53
68
|
activeInstance = popupInstance;
|
|
54
69
|
}
|
|
55
70
|
|
|
71
|
+
destroy(rawPopup || customInstance);
|
|
72
|
+
|
|
56
73
|
activeInstance?.popups.push(rawPopup || customInstance);
|
|
57
74
|
}
|
|
58
75
|
|
|
@@ -89,6 +106,8 @@ export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typ
|
|
|
89
106
|
},
|
|
90
107
|
});
|
|
91
108
|
|
|
109
|
+
destroy(confirmation);
|
|
110
|
+
|
|
92
111
|
popupInstance.popups.push(confirmation);
|
|
93
112
|
|
|
94
113
|
return new Promise((resolve) => {
|
|
@@ -114,20 +133,21 @@ export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typ
|
|
|
114
133
|
},
|
|
115
134
|
});
|
|
116
135
|
|
|
136
|
+
destroy(confirmation);
|
|
137
|
+
|
|
117
138
|
popupInstance.popups.push(confirmation);
|
|
118
139
|
}
|
|
119
140
|
|
|
120
141
|
function createInstance<T extends ComponentPublicInstanceConstructor<any> = typeof VcPopup>(
|
|
121
|
-
options: UsePopupProps<T
|
|
142
|
+
options: UsePopupProps<T>,
|
|
122
143
|
) {
|
|
123
144
|
return (
|
|
124
145
|
options &&
|
|
125
146
|
(reactive({
|
|
126
|
-
id: Symbol("usePopup"),
|
|
127
147
|
...createComponent(options),
|
|
128
148
|
close: close,
|
|
129
149
|
open: open,
|
|
130
|
-
}) as UsePopupProps<DefineComponent> & UsePopupInternal)
|
|
150
|
+
}) as unknown as UsePopupProps<DefineComponent> & UsePopupInternal)
|
|
131
151
|
);
|
|
132
152
|
}
|
|
133
153
|
|
|
@@ -140,7 +160,7 @@ export function usePopup<T extends ComponentPublicInstanceConstructor<any> = typ
|
|
|
140
160
|
}
|
|
141
161
|
|
|
142
162
|
function createComponent<T extends ComponentPublicInstanceConstructor<any> = typeof VcPopup>(
|
|
143
|
-
options: UsePopupProps<T
|
|
163
|
+
options: UsePopupProps<T>,
|
|
144
164
|
) {
|
|
145
165
|
const slots =
|
|
146
166
|
typeof options.slots === "undefined"
|
|
@@ -151,7 +171,7 @@ function createComponent<T extends ComponentPublicInstanceConstructor<any> = typ
|
|
|
151
171
|
return [slotName, slotContent];
|
|
152
172
|
}
|
|
153
173
|
return [slotName, markRaw(slotContent)];
|
|
154
|
-
})
|
|
174
|
+
}),
|
|
155
175
|
);
|
|
156
176
|
|
|
157
177
|
return {
|
|
@@ -9,19 +9,26 @@
|
|
|
9
9
|
@click.stop="toggleAccountMenuVisible"
|
|
10
10
|
>
|
|
11
11
|
<div
|
|
12
|
+
v-if="avatarUrl"
|
|
12
13
|
class="user-dropdown-button__avatar"
|
|
13
14
|
:style="imageHandler"
|
|
14
15
|
></div>
|
|
16
|
+
<VcIcon
|
|
17
|
+
v-else
|
|
18
|
+
icon="fas fa-user-circle"
|
|
19
|
+
size="xxl"
|
|
20
|
+
class="tw-text-[color:var(--app-bar-button-color)]"
|
|
21
|
+
/>
|
|
15
22
|
<div class="tw-grow tw-basis-0 tw-ml-3 tw-overflow-hidden">
|
|
16
23
|
<div class="user-dropdown-button__name tw-truncate">
|
|
17
|
-
{{ name }}
|
|
24
|
+
{{ name || user?.userName }}
|
|
18
25
|
</div>
|
|
19
26
|
<div class="user-dropdown-button__role">
|
|
20
|
-
{{ role }}
|
|
27
|
+
{{ role || (user?.isAdministrator ? "Administrator" : "") }}
|
|
21
28
|
</div>
|
|
22
29
|
</div>
|
|
23
30
|
<div
|
|
24
|
-
v-if="
|
|
31
|
+
v-if="menu && menu.length && !$isMobile.value"
|
|
25
32
|
class="user-dropdown-button__chevron"
|
|
26
33
|
>
|
|
27
34
|
<VcIcon
|
|
@@ -30,12 +37,12 @@
|
|
|
30
37
|
></VcIcon>
|
|
31
38
|
</div>
|
|
32
39
|
<div
|
|
33
|
-
v-if="
|
|
40
|
+
v-if="menu && accountMenuVisible"
|
|
34
41
|
class="user-dropdown-button__menu"
|
|
35
42
|
@click.stop="accountMenuVisible = false"
|
|
36
43
|
>
|
|
37
44
|
<div
|
|
38
|
-
v-for="(item, i) in
|
|
45
|
+
v-for="(item, i) in menu"
|
|
39
46
|
:key="`menu_item_${i}`"
|
|
40
47
|
class="user-dropdown-button__menu-item"
|
|
41
48
|
@click="item.hasOwnProperty('clickHandler') ? item.clickHandler?.() : null"
|
|
@@ -47,31 +54,58 @@
|
|
|
47
54
|
</template>
|
|
48
55
|
|
|
49
56
|
<script lang="ts" setup>
|
|
50
|
-
import { computed, ref } from "vue";
|
|
57
|
+
import { Ref, computed, inject, ref } from "vue";
|
|
51
58
|
import { vOnClickOutside } from "@vueuse/components";
|
|
52
|
-
import {
|
|
59
|
+
import { useUser } from "../../../core/composables";
|
|
60
|
+
import { useBladeNavigation } from "../blade-navigation";
|
|
61
|
+
import { useRouter } from "vue-router";
|
|
62
|
+
import { useI18n } from "vue-i18n";
|
|
63
|
+
import { VcIcon } from "../../../ui/components";
|
|
64
|
+
import { BladeMenu } from "../../../core/types";
|
|
65
|
+
import { usePopup } from "../popup-handler/composables/usePopup";
|
|
66
|
+
import { ChangePassword } from "../change-password";
|
|
53
67
|
|
|
54
68
|
export interface Props {
|
|
55
|
-
|
|
56
|
-
name
|
|
57
|
-
role
|
|
69
|
+
avatarUrl?: string | undefined;
|
|
70
|
+
name?: string | undefined;
|
|
71
|
+
role?: string | undefined;
|
|
58
72
|
menuItems?: BladeMenu[];
|
|
59
73
|
}
|
|
60
74
|
const props = withDefaults(defineProps<Props>(), {
|
|
61
75
|
menuItems: () => [],
|
|
62
76
|
});
|
|
63
77
|
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
const isMobile = inject("isMobile") as Ref<boolean>;
|
|
79
|
+
|
|
80
|
+
const { user, signOut } = useUser();
|
|
81
|
+
const { closeBlade } = useBladeNavigation();
|
|
82
|
+
const router = useRouter();
|
|
83
|
+
const { t } = useI18n({ useScope: "global" });
|
|
84
|
+
|
|
85
|
+
const { open } = usePopup({
|
|
86
|
+
component: ChangePassword,
|
|
69
87
|
});
|
|
70
88
|
|
|
71
89
|
const accountMenuVisible = ref(false);
|
|
90
|
+
const menu = computed(() => [
|
|
91
|
+
...props.menuItems,
|
|
92
|
+
{
|
|
93
|
+
title: t("Change password"),
|
|
94
|
+
clickHandler() {
|
|
95
|
+
open();
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
title: t("Log Out"),
|
|
100
|
+
async clickHandler() {
|
|
101
|
+
await signOut();
|
|
102
|
+
router.push({ name: "Login" });
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
]);
|
|
72
106
|
|
|
73
107
|
const toggleAccountMenuVisible = () => {
|
|
74
|
-
if (
|
|
108
|
+
if (menu.value && menu.value.length && !isMobile.value) {
|
|
75
109
|
accountMenuVisible.value = !accountMenuVisible.value;
|
|
76
110
|
}
|
|
77
111
|
};
|
|
@@ -79,6 +113,13 @@ const toggleAccountMenuVisible = () => {
|
|
|
79
113
|
const onClose = () => {
|
|
80
114
|
accountMenuVisible.value = false;
|
|
81
115
|
};
|
|
116
|
+
|
|
117
|
+
const imageHandler = computed(() => {
|
|
118
|
+
if (props.avatarUrl) {
|
|
119
|
+
return `background-image: url(${CSS.escape(props.avatarUrl)})`;
|
|
120
|
+
}
|
|
121
|
+
return undefined;
|
|
122
|
+
});
|
|
82
123
|
</script>
|
|
83
124
|
|
|
84
125
|
<style lang="scss">
|
|
@@ -109,7 +150,7 @@ const onClose = () => {
|
|
|
109
150
|
}
|
|
110
151
|
|
|
111
152
|
&__chevron {
|
|
112
|
-
@apply tw-text-[#7e8e9d] [transition:
|
|
153
|
+
@apply tw-text-[#7e8e9d] [transition:color_0.2s_ease];
|
|
113
154
|
}
|
|
114
155
|
|
|
115
156
|
&:hover &__chevron {
|
package/shared/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Router } from "vue-router";
|
|
1
2
|
import { App } from "vue";
|
|
2
3
|
import { AssetsDetailsModule } from "./modules/assets";
|
|
3
4
|
import { VcAppSwitcherComponent } from "./components/app-switcher";
|
|
@@ -8,7 +9,7 @@ import * as locales from "./locales";
|
|
|
8
9
|
import { i18n } from "./../core/plugins";
|
|
9
10
|
|
|
10
11
|
export const SharedModule = {
|
|
11
|
-
install(app: App): void {
|
|
12
|
+
install(app: App, args: { router: Router }): void {
|
|
12
13
|
// Load locales
|
|
13
14
|
if (locales) {
|
|
14
15
|
Object.entries(locales).forEach(([key, message]) => {
|
|
@@ -19,7 +20,7 @@ export const SharedModule = {
|
|
|
19
20
|
app
|
|
20
21
|
.use(AssetsDetailsModule)
|
|
21
22
|
.use(AssetsManagerModule)
|
|
22
|
-
.use(VcBladeNavigationComponent)
|
|
23
|
+
.use(VcBladeNavigationComponent, { router: args.router })
|
|
23
24
|
.use(VcAppSwitcherComponent)
|
|
24
25
|
.use(VcPopupHandler);
|
|
25
26
|
},
|
package/shared/locales/en.json
CHANGED
|
@@ -30,6 +30,13 @@
|
|
|
30
30
|
"Incorrect password.": "You entered an incorrect password",
|
|
31
31
|
"You have used this password in the past. Choose another one.": "You have used this password in the past. Choose another one."
|
|
32
32
|
}
|
|
33
|
+
},
|
|
34
|
+
"NOTIFICATION_DROPDOWN": {
|
|
35
|
+
"TITLE": "Notifications",
|
|
36
|
+
"EMPTY": "No notifications yet"
|
|
37
|
+
},
|
|
38
|
+
"LANGUAGE_SELECTOR": {
|
|
39
|
+
"TITLE": "Language selector"
|
|
33
40
|
}
|
|
34
41
|
}
|
|
35
42
|
}
|