@cwa/nuxt-edge 0.0.0-29696494.72f11a4
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/README.md +38 -0
- package/README.template.md +32 -0
- package/dist/layer/_components/TextButton.vue +13 -0
- package/dist/layer/error.vue +13 -0
- package/dist/layer/layouts/CwaRootLayout.vue +172 -0
- package/dist/layer/nuxt.config.ts +8 -0
- package/dist/layer/pages/_cwa/[cwaPage0].vue +18 -0
- package/dist/layer/pages/_cwa/index/composables/useDataList.ts +50 -0
- package/dist/layer/pages/_cwa/index/composables/useDataType.ts +41 -0
- package/dist/layer/pages/_cwa/index/composables/useDynamicPageLoader.ts +28 -0
- package/dist/layer/pages/_cwa/index/composables/useItemPage.ts +200 -0
- package/dist/layer/pages/_cwa/index/composables/useListPage.ts +44 -0
- package/dist/layer/pages/_cwa/index/composables/useParentPageDataLoader.ts +51 -0
- package/dist/layer/pages/_cwa/index/composables/useParentPageLoader.ts +25 -0
- package/dist/layer/pages/_cwa/index/data/[type]/[iri].vue +22 -0
- package/dist/layer/pages/_cwa/index/data/[type].vue +132 -0
- package/dist/layer/pages/_cwa/index/data/index.vue +84 -0
- package/dist/layer/pages/_cwa/index/layouts/[iri].vue +180 -0
- package/dist/layer/pages/_cwa/index/layouts.vue +77 -0
- package/dist/layer/pages/_cwa/index/pages/[iri].vue +16 -0
- package/dist/layer/pages/_cwa/index/pages.vue +130 -0
- package/dist/layer/pages/_cwa/index/routes.vue +56 -0
- package/dist/layer/pages/_cwa/index/settings.vue +398 -0
- package/dist/layer/pages/_cwa/index/users/[iri].vue +337 -0
- package/dist/layer/pages/_cwa/index/users.vue +90 -0
- package/dist/layer/pages/_cwa/index.vue +43 -0
- package/dist/layer/pages/confirm-new-email/[username]/[newEmail]/[token].vue +49 -0
- package/dist/layer/pages/forgot-password.vue +31 -0
- package/dist/layer/pages/login.vue +32 -0
- package/dist/layer/pages/reset-password/[username]/[token].vue +38 -0
- package/dist/layer/pages/verify-email/[username]/[token].vue +48 -0
- package/dist/module.d.mts +15 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +292 -0
- package/dist/runtime/admin/admin.d.ts +35 -0
- package/dist/runtime/admin/admin.js +65 -0
- package/dist/runtime/admin/manageable-resource.d.ts +42 -0
- package/dist/runtime/admin/manageable-resource.js +241 -0
- package/dist/runtime/admin/manager-tabs-resolver.d.ts +17 -0
- package/dist/runtime/admin/manager-tabs-resolver.js +55 -0
- package/dist/runtime/admin/navigation-guard.d.ts +18 -0
- package/dist/runtime/admin/navigation-guard.js +57 -0
- package/dist/runtime/admin/resource-stack-manager.d.ts +93 -0
- package/dist/runtime/admin/resource-stack-manager.js +388 -0
- package/dist/runtime/api/api-documentation.d.ts +28 -0
- package/dist/runtime/api/api-documentation.js +131 -0
- package/dist/runtime/api/auth.d.ts +100 -0
- package/dist/runtime/api/auth.js +264 -0
- package/dist/runtime/api/fetcher/cwa-fetch.d.ts +12 -0
- package/dist/runtime/api/fetcher/cwa-fetch.js +43 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.d.ts +59 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.js +225 -0
- package/dist/runtime/api/fetcher/fetcher.d.ts +57 -0
- package/dist/runtime/api/fetcher/fetcher.js +263 -0
- package/dist/runtime/api/fetcher/preload-headers.d.ts +6 -0
- package/dist/runtime/api/fetcher/preload-headers.js +31 -0
- package/dist/runtime/api/forms.d.ts +40 -0
- package/dist/runtime/api/forms.js +40 -0
- package/dist/runtime/api/mercure.d.ts +32 -0
- package/dist/runtime/api/mercure.js +196 -0
- package/dist/runtime/api/site-config.d.ts +36 -0
- package/dist/runtime/api/site-config.js +135 -0
- package/dist/runtime/composables/component/html-content.d.ts +2 -0
- package/dist/runtime/composables/component/html-content.js +74 -0
- package/dist/runtime/composables/cwa-collection-pagination.d.ts +13 -0
- package/dist/runtime/composables/cwa-collection-pagination.js +34 -0
- package/dist/runtime/composables/cwa-collection-resource.d.ts +18 -0
- package/dist/runtime/composables/cwa-collection-resource.js +105 -0
- package/dist/runtime/composables/cwa-image-resource.d.ts +15 -0
- package/dist/runtime/composables/cwa-image-resource.js +26 -0
- package/dist/runtime/composables/cwa-image.d.ts +24 -0
- package/dist/runtime/composables/cwa-image.js +38 -0
- package/dist/runtime/composables/cwa-query-bound-model.d.ts +9 -0
- package/dist/runtime/composables/cwa-query-bound-model.js +109 -0
- package/dist/runtime/composables/cwa-resource-endpoint.d.ts +5 -0
- package/dist/runtime/composables/cwa-resource-endpoint.js +36 -0
- package/dist/runtime/composables/cwa-resource-manageable.d.ts +10 -0
- package/dist/runtime/composables/cwa-resource-manageable.js +53 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.d.ts +16 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.js +30 -0
- package/dist/runtime/composables/cwa-resource-model.d.ts +21 -0
- package/dist/runtime/composables/cwa-resource-model.js +156 -0
- package/dist/runtime/composables/cwa-resource-upload.d.ts +8 -0
- package/dist/runtime/composables/cwa-resource-upload.js +70 -0
- package/dist/runtime/composables/cwa-resource.d.ts +26 -0
- package/dist/runtime/composables/cwa-resource.js +42 -0
- package/dist/runtime/composables/cwa-select-input.d.ts +21 -0
- package/dist/runtime/composables/cwa-select-input.js +37 -0
- package/dist/runtime/composables/cwa-select.d.ts +15 -0
- package/dist/runtime/composables/cwa-select.js +24 -0
- package/dist/runtime/composables/cwa.d.ts +2 -0
- package/dist/runtime/composables/cwa.js +2 -0
- package/dist/runtime/composables/forgot-password.d.ts +9 -0
- package/dist/runtime/composables/forgot-password.js +45 -0
- package/dist/runtime/composables/login.d.ts +9 -0
- package/dist/runtime/composables/login.js +30 -0
- package/dist/runtime/composables/popper.d.ts +529 -0
- package/dist/runtime/composables/popper.js +105 -0
- package/dist/runtime/composables/process.d.ts +4 -0
- package/dist/runtime/composables/process.js +6 -0
- package/dist/runtime/composables/reset-password.d.ts +14 -0
- package/dist/runtime/composables/reset-password.js +75 -0
- package/dist/runtime/composables/transitions.d.ts +12 -0
- package/dist/runtime/composables/transitions.js +12 -0
- package/dist/runtime/composables/useCwaResourceRoute.d.ts +10 -0
- package/dist/runtime/composables/useCwaResourceRoute.js +17 -0
- package/dist/runtime/composables/useCwaSiteConfig.d.ts +15 -0
- package/dist/runtime/composables/useCwaSiteConfig.js +78 -0
- package/dist/runtime/composables/useResendVerifyEmail.d.ts +6 -0
- package/dist/runtime/composables/useResendVerifyEmail.js +43 -0
- package/dist/runtime/composables/useVerifyEmail.d.ts +8 -0
- package/dist/runtime/composables/useVerifyEmail.js +84 -0
- package/dist/runtime/cwa.d.ts +70 -0
- package/dist/runtime/cwa.js +133 -0
- package/dist/runtime/errors/cwa-resource-error.d.ts +20 -0
- package/dist/runtime/errors/cwa-resource-error.js +61 -0
- package/dist/runtime/plugin.d.ts +8 -0
- package/dist/runtime/plugin.js +20 -0
- package/dist/runtime/resources/resource-utils.d.ts +52 -0
- package/dist/runtime/resources/resource-utils.js +86 -0
- package/dist/runtime/resources/resources-manager.d.ts +70 -0
- package/dist/runtime/resources/resources-manager.js +482 -0
- package/dist/runtime/resources/resources.d.ts +61 -0
- package/dist/runtime/resources/resources.js +360 -0
- package/dist/runtime/route-middleware.d.ts +2 -0
- package/dist/runtime/route-middleware.js +71 -0
- package/dist/runtime/server/cwa-custom-sitemap.get.d.ts +2 -0
- package/dist/runtime/server/cwa-custom-sitemap.get.js +29 -0
- package/dist/runtime/server/cwa-healthcheck.get.d.ts +4 -0
- package/dist/runtime/server/cwa-healthcheck.get.js +10 -0
- package/dist/runtime/server/cwa-urls.get.d.ts +3 -0
- package/dist/runtime/server/cwa-urls.get.js +15 -0
- package/dist/runtime/server/server-middleware.d.ts +2 -0
- package/dist/runtime/server/server-middleware.js +63 -0
- package/dist/runtime/server/server-plugin.d.ts +2 -0
- package/dist/runtime/server/server-plugin.js +59 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/useFetcher.d.ts +7 -0
- package/dist/runtime/server/useFetcher.js +40 -0
- package/dist/runtime/storage/storage.d.ts +25 -0
- package/dist/runtime/storage/storage.js +48 -0
- package/dist/runtime/storage/stores/admin/actions.d.ts +5 -0
- package/dist/runtime/storage/stores/admin/actions.js +10 -0
- package/dist/runtime/storage/stores/admin/admin-store.d.ts +18 -0
- package/dist/runtime/storage/stores/admin/admin-store.js +20 -0
- package/dist/runtime/storage/stores/admin/state.d.ts +7 -0
- package/dist/runtime/storage/stores/admin/state.js +9 -0
- package/dist/runtime/storage/stores/api-documentation/api-documentation-store.d.ts +16 -0
- package/dist/runtime/storage/stores/api-documentation/api-documentation-store.js +18 -0
- package/dist/runtime/storage/stores/api-documentation/state.d.ts +71 -0
- package/dist/runtime/storage/stores/api-documentation/state.js +6 -0
- package/dist/runtime/storage/stores/auth/auth-store.d.ts +16 -0
- package/dist/runtime/storage/stores/auth/auth-store.js +18 -0
- package/dist/runtime/storage/stores/auth/state.d.ts +19 -0
- package/dist/runtime/storage/stores/auth/state.js +15 -0
- package/dist/runtime/storage/stores/cwa-store-types.d.ts +14 -0
- package/dist/runtime/storage/stores/error/actions.d.ts +11 -0
- package/dist/runtime/storage/stores/error/actions.js +73 -0
- package/dist/runtime/storage/stores/error/error-store.d.ts +13 -0
- package/dist/runtime/storage/stores/error/error-store.js +21 -0
- package/dist/runtime/storage/stores/error/getters.d.ts +7 -0
- package/dist/runtime/storage/stores/error/getters.js +11 -0
- package/dist/runtime/storage/stores/error/state.d.ts +35 -0
- package/dist/runtime/storage/stores/error/state.js +15 -0
- package/dist/runtime/storage/stores/fetcher/actions.d.ts +56 -0
- package/dist/runtime/storage/stores/fetcher/actions.js +138 -0
- package/dist/runtime/storage/stores/fetcher/fetcher-store.d.ts +19 -0
- package/dist/runtime/storage/stores/fetcher/fetcher-store.js +23 -0
- package/dist/runtime/storage/stores/fetcher/getter-utils.d.ts +7 -0
- package/dist/runtime/storage/stores/fetcher/getter-utils.js +27 -0
- package/dist/runtime/storage/stores/fetcher/getters.d.ts +13 -0
- package/dist/runtime/storage/stores/fetcher/getters.js +52 -0
- package/dist/runtime/storage/stores/fetcher/state.d.ts +27 -0
- package/dist/runtime/storage/stores/fetcher/state.js +7 -0
- package/dist/runtime/storage/stores/mercure/mercure-store.d.ts +16 -0
- package/dist/runtime/storage/stores/mercure/mercure-store.js +18 -0
- package/dist/runtime/storage/stores/mercure/state.d.ts +5 -0
- package/dist/runtime/storage/stores/mercure/state.js +6 -0
- package/dist/runtime/storage/stores/resources/actions.d.ts +59 -0
- package/dist/runtime/storage/stores/resources/actions.js +449 -0
- package/dist/runtime/storage/stores/resources/getter-utils.d.ts +7 -0
- package/dist/runtime/storage/stores/resources/getter-utils.js +27 -0
- package/dist/runtime/storage/stores/resources/getters.d.ts +38 -0
- package/dist/runtime/storage/stores/resources/getters.js +254 -0
- package/dist/runtime/storage/stores/resources/resources-store.d.ts +19 -0
- package/dist/runtime/storage/stores/resources/resources-store.js +23 -0
- package/dist/runtime/storage/stores/resources/state.d.ts +67 -0
- package/dist/runtime/storage/stores/resources/state.js +24 -0
- package/dist/runtime/storage/stores/site-config/actions.d.ts +9 -0
- package/dist/runtime/storage/stores/site-config/actions.js +20 -0
- package/dist/runtime/storage/stores/site-config/getters.d.ts +7 -0
- package/dist/runtime/storage/stores/site-config/getters.js +10 -0
- package/dist/runtime/storage/stores/site-config/site-config-store.d.ts +19 -0
- package/dist/runtime/storage/stores/site-config/site-config-store.js +23 -0
- package/dist/runtime/storage/stores/site-config/state.d.ts +13 -0
- package/dist/runtime/storage/stores/site-config/state.js +8 -0
- package/dist/runtime/templates/assets/base.css +1 -0
- package/dist/runtime/templates/assets/cwa.css +1 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.d.vue.ts +7 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue +27 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue.d.ts +7 -0
- package/dist/runtime/templates/components/core/ComponentPosition.d.vue.ts +4 -0
- package/dist/runtime/templates/components/core/ComponentPosition.spec.ts.snap +16 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue +64 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue.d.ts +4 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue +41 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/DialogBox.d.vue.ts +38 -0
- package/dist/runtime/templates/components/core/DialogBox.vue +96 -0
- package/dist/runtime/templates/components/core/DialogBox.vue.d.ts +38 -0
- package/dist/runtime/templates/components/core/README.md +1 -0
- package/dist/runtime/templates/components/core/ResourceLoader.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/ResourceLoader.spec.ts.snap +39 -0
- package/dist/runtime/templates/components/core/ResourceLoader.vue +151 -0
- package/dist/runtime/templates/components/core/ResourceLoader.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.vue +7 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue +11 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContent.d.vue.ts +24 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue +137 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue.d.ts +24 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.d.vue.ts +10 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue +49 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue.d.ts +10 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue +53 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.d.vue.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue +33 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue.d.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue +94 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue +19 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.d.vue.ts +13 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue +404 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue.d.ts +13 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue +368 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.vue +439 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.d.vue.ts +35 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue +110 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue.d.ts +35 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.d.vue.ts +7 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue +27 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue.d.ts +7 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.d.vue.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue +24 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.d.vue.ts +0 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue +81 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue.d.ts +0 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.vue +42 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.d.vue.ts +21 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue +102 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue.d.ts +21 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.d.vue.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue +62 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue.d.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue +264 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.d.vue.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.vue +45 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.vue.d.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.d.vue.ts +24 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.vue +139 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.vue.d.ts +24 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.vue +74 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue +19 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.d.vue.ts +8 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue +86 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue.d.ts +8 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue +24 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue +57 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.vue +23 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue +100 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.d.vue.ts +9 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue +112 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue +21 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue +15 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconData.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue +24 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue +20 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconPages.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue +21 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue +23 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue +13 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/useDataResolver.d.ts +12 -0
- package/dist/runtime/templates/components/core/useDataResolver.js +113 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.d.ts +6 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.js +166 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.d.ts +22 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.js +102 -0
- package/dist/runtime/templates/components/main/ComponentGroup.d.vue.ts +13 -0
- package/dist/runtime/templates/components/main/ComponentGroup.spec.ts.snap +68 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue +138 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue.d.ts +13 -0
- package/dist/runtime/templates/components/main/CwaLink.d.vue.ts +14 -0
- package/dist/runtime/templates/components/main/CwaLink.vue +55 -0
- package/dist/runtime/templates/components/main/CwaLink.vue.d.ts +14 -0
- package/dist/runtime/templates/components/main/CwaPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/CwaPage.vue +22 -0
- package/dist/runtime/templates/components/main/CwaPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/DefaultLayout.d.vue.ts +12 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue +12 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/ErrorPage.d.vue.ts +7 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue +134 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/Logo.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/Logo.vue +18 -0
- package/dist/runtime/templates/components/main/Logo.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/README.md +7 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.d.vue.ts +12 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue +41 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue +48 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.d.ts +5 -0
- package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.js +19 -0
- package/dist/runtime/templates/components/main/admin/header/Header.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue +209 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue +155 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.d.vue.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue.d.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.d.vue.ts +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue +20 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue.d.ts +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.d.vue.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue +70 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue.d.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue +19 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue +79 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue +52 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.d.vue.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue +159 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue.d.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.d.vue.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue +198 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue.d.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.d.vue.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue +186 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue.d.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue +208 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.d.vue.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue +38 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue.d.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.d.vue.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue +15 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue.d.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.d.vue.ts +14 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue +44 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue.d.ts +14 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue +67 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue +75 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue +41 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue +114 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue +34 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue +104 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue +52 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.d.vue.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue +94 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue.d.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.d.vue.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue +59 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue.d.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue +28 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.d.vue.ts +26 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue +56 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue.d.ts +26 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.d.vue.ts +28 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue +61 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue.d.ts +28 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.d.vue.ts +28 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue +59 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue.d.ts +28 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.d.vue.ts +7 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.spec.ts.snap +14 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue +17 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.d.vue.ts +25 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.spec.ts.snap +90 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue +59 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue.d.ts +25 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.d.vue.ts +22 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.spec.ts.snap +111 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.vue +50 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.vue.d.ts +22 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue +1071 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/Hamburger.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue +75 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/ProgressBar.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/ProgressBar.spec.ts.snap +71 -0
- package/dist/runtime/templates/components/ui/ProgressBar.vue +29 -0
- package/dist/runtime/templates/components/ui/ProgressBar.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/README.md +6 -0
- package/dist/runtime/templates/components/ui/alert/Info.d.vue.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Info.spec.ts.snap +23 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue +17 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue.d.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Warning.d.vue.ts +13 -0
- package/dist/runtime/templates/components/ui/alert/Warning.spec.ts.snap +18 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue +13 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue.d.ts +13 -0
- package/dist/runtime/templates/components/ui/form/Button.d.vue.ts +53 -0
- package/dist/runtime/templates/components/ui/form/Button.vue +139 -0
- package/dist/runtime/templates/components/ui/form/Button.vue.d.ts +53 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue +18 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue +15 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/form/File.d.vue.ts +18 -0
- package/dist/runtime/templates/components/ui/form/File.vue +72 -0
- package/dist/runtime/templates/components/ui/form/File.vue.d.ts +18 -0
- package/dist/runtime/templates/components/ui/form/Input.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/form/Input.vue +17 -0
- package/dist/runtime/templates/components/ui/form/Input.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.d.vue.ts +15 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue +17 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue.d.ts +15 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.d.vue.ts +15 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.vue +212 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.vue.d.ts +15 -0
- package/dist/runtime/templates/components/ui/form/Select.d.vue.ts +8 -0
- package/dist/runtime/templates/components/ui/form/Select.vue +60 -0
- package/dist/runtime/templates/components/ui/form/Select.vue.d.ts +8 -0
- package/dist/runtime/templates/components/ui/form/Toggle.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue +48 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue +30 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue +12 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue +10 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue +23 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue +11 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue +15 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/utils/ContextMenu.d.vue.ts +27 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue +60 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue.d.ts +27 -0
- package/dist/runtime/templates/components/utils/HotSpot.d.vue.ts +12 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue +28 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue.d.ts +12 -0
- package/dist/runtime/templates/components/utils/README.md +1 -0
- package/dist/runtime/templates/components/utils/Spinner.d.vue.ts +7 -0
- package/dist/runtime/templates/components/utils/Spinner.spec.ts.snap +56 -0
- package/dist/runtime/templates/components/utils/Spinner.vue +44 -0
- package/dist/runtime/templates/components/utils/Spinner.vue.d.ts +7 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.d.vue.ts +7 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue +43 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue.d.ts +7 -0
- package/dist/runtime/templates/cwa-page.d.vue.ts +3 -0
- package/dist/runtime/templates/cwa-page.spec.ts.snap +9 -0
- package/dist/runtime/templates/cwa-page.vue +55 -0
- package/dist/runtime/templates/cwa-page.vue.d.ts +3 -0
- package/dist/runtime/types/index.d.ts +59 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/types/popper.d.ts +14 -0
- package/dist/types.d.mts +7 -0
- package/package.json +132 -0
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!---
|
|
2
|
+
This file is auto-generate by a github hook please modify README.template.md if you don't want to lose your work
|
|
3
|
+
-->
|
|
4
|
+
# CWA Nuxt 3 Module (in development)
|
|
5
|
+
|
|
6
|
+
[](https://app.codecov.io/gh/components-web-app/cwa-nuxt-module/tree/feat/manager-tabs)
|
|
7
|
+
|
|
8
|
+
This module is designed to work with the [API Component Bundle](https://github.com/components-web-app/api-components-bundle) and will provide a full user-interface and utilities to easily create custom web apps with an advanced in-line content management system
|
|
9
|
+
|
|
10
|
+
## CWA Module in Action
|
|
11
|
+
|
|
12
|
+
### Template using this module for front-end and API Components Bundle for back-end
|
|
13
|
+
https://github.com/components-web-app/components-web-app/tree/v3
|
|
14
|
+
|
|
15
|
+
### Template application deployed online
|
|
16
|
+
https://cwa-v3-silverback-web-apps.vercel.app/
|
|
17
|
+
|
|
18
|
+
## Development
|
|
19
|
+
|
|
20
|
+
- Run `pnpm run dev:prepare` to generate type stubs.
|
|
21
|
+
- Use `pnpm run dev` to start [playground](./playground) in development mode.
|
|
22
|
+
|
|
23
|
+
### Linting
|
|
24
|
+
|
|
25
|
+
- Run `pnpm run lint` or `pnpm run lint:fix`
|
|
26
|
+
|
|
27
|
+
### Testing
|
|
28
|
+
|
|
29
|
+
We have built in testing using `vitest`.
|
|
30
|
+
|
|
31
|
+
- To run tests as a one-off use `pnpm run test`
|
|
32
|
+
- To include coverage run `pnpm run test:coverage`
|
|
33
|
+
- To run tests in watch mode during development run `pnpm run test:watch`
|
|
34
|
+
- If you want to check coverage updates at the same time as watching for file changes you can run `pnpm run test:watch:coverage`
|
|
35
|
+
|
|
36
|
+
## Test coverage for branch `feat/manager-tabs`
|
|
37
|
+
|
|
38
|
+

|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# CWA Nuxt 3 Module
|
|
2
|
+
|
|
3
|
+
[](https://app.codecov.io/gh/components-web-app/cwa-nuxt-module/tree/{{ current.branch }})
|
|
4
|
+
|
|
5
|
+
This module is designed to work with the [API Component Bundle](https://github.com/components-web-app/api-components-bundle) and will provide a full user-interface and utilities to easily create custom web apps with an advanced in-line content management system
|
|
6
|
+
|
|
7
|
+
## CWA Module in Action
|
|
8
|
+
|
|
9
|
+
### Template using this module for front-end and API Components Bundle for back-end
|
|
10
|
+
https://github.com/components-web-app/components-web-app
|
|
11
|
+
|
|
12
|
+
## Development
|
|
13
|
+
|
|
14
|
+
- Run `pnpm run dev:prepare` to generate type stubs.
|
|
15
|
+
- Use `pnpm run dev` to start [playground](./playground) in development mode.
|
|
16
|
+
|
|
17
|
+
### Linting
|
|
18
|
+
|
|
19
|
+
- Run `pnpm run lint` or `pnpm run lint:fix`
|
|
20
|
+
|
|
21
|
+
### Testing
|
|
22
|
+
|
|
23
|
+
We have built in testing using `vitest`.
|
|
24
|
+
|
|
25
|
+
- To run tests as a one-off use `pnpm run test`
|
|
26
|
+
- To include coverage run `pnpm run test:coverage`
|
|
27
|
+
- To run tests in watch mode during development run `pnpm run test:watch`
|
|
28
|
+
- If you want to check coverage updates at the same time as watching for file changes you can run `pnpm run test:watch:coverage`
|
|
29
|
+
|
|
30
|
+
## Test coverage for branch `{{ current.branch }}`
|
|
31
|
+
|
|
32
|
+

|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
class="cwa:cursor-pointer cwa:underline cwa:flex cwa:items-center cwa:gap-x-2 cwa:group cwa:disabled:no-underline"
|
|
4
|
+
>
|
|
5
|
+
<slot />
|
|
6
|
+
</button>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
defineSlots<{
|
|
11
|
+
default(): any
|
|
12
|
+
}>()
|
|
13
|
+
</script>
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
id="cwa-root-layout"
|
|
4
|
+
ref="rootLayout"
|
|
5
|
+
class="cwa:relative cwa:h-full cwa:flex cwa:flex-col"
|
|
6
|
+
@contextmenu="closeContextMenu"
|
|
7
|
+
>
|
|
8
|
+
<ClientOnly>
|
|
9
|
+
<LazyCwaAdminHeader v-if="showAdmin" />
|
|
10
|
+
<OutdatedContentNotice
|
|
11
|
+
v-else
|
|
12
|
+
class="cwa:absolute cwa:top-0 cwa:mt-1.5 cwa:left-1/2 cwa:-translate-x-1/2 cwa:z-50"
|
|
13
|
+
/>
|
|
14
|
+
</ClientOnly>
|
|
15
|
+
<component
|
|
16
|
+
:is="resolvedComponent"
|
|
17
|
+
v-if="resolvedComponent"
|
|
18
|
+
class="cwa:relative"
|
|
19
|
+
@click.stop="onLayoutClick"
|
|
20
|
+
@contextmenu.stop="onLayoutContextMenu"
|
|
21
|
+
>
|
|
22
|
+
<div
|
|
23
|
+
ref="page"
|
|
24
|
+
class="cwa:grow"
|
|
25
|
+
@click.stop="onPageClick"
|
|
26
|
+
@contextmenu.stop="onPageContextMenu"
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
</div>
|
|
30
|
+
</component>
|
|
31
|
+
<ClientOnly>
|
|
32
|
+
<template v-if="showAdmin">
|
|
33
|
+
<LazyCwaAdminResourceManager ref="resourceManager" />
|
|
34
|
+
<LayoutPageOverlay
|
|
35
|
+
v-if="$cwa.admin.isEditing && page && rootLayout"
|
|
36
|
+
:page="page"
|
|
37
|
+
:layout="rootLayout"
|
|
38
|
+
/>
|
|
39
|
+
<teleport to="body">
|
|
40
|
+
<DialogsWrapper />
|
|
41
|
+
</teleport>
|
|
42
|
+
</template>
|
|
43
|
+
</ClientOnly>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { computed, ref, getCurrentInstance, watch, nextTick } from 'vue'
|
|
49
|
+
import { DialogsWrapper } from 'vuejs-confirm-dialog'
|
|
50
|
+
import { useRouter } from 'vue-router'
|
|
51
|
+
import { useWindowScroll } from '@vueuse/core'
|
|
52
|
+
import { useCwa, useHead } from '#imports'
|
|
53
|
+
import { LazyCwaAdminHeader, LazyCwaAdminResourceManager, LazyCwaDefaultLayout } from '#components'
|
|
54
|
+
import OutdatedContentNotice from '#cwa/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue'
|
|
55
|
+
import type { GlobalComponentNames } from '#cwa/types'
|
|
56
|
+
import LayoutPageOverlay from '#cwa/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue'
|
|
57
|
+
|
|
58
|
+
const $cwa = useCwa()
|
|
59
|
+
const currentRoute = useRouter().currentRoute
|
|
60
|
+
const resourceManager = ref<null | InstanceType<typeof LazyCwaAdminResourceManager>>(null)
|
|
61
|
+
const page = ref<null | HTMLElement>(null)
|
|
62
|
+
const rootLayout = ref<null | HTMLElement>(null)
|
|
63
|
+
const instance = getCurrentInstance()
|
|
64
|
+
|
|
65
|
+
const cwaPageMeta = computed(() => {
|
|
66
|
+
return currentRoute.value.meta?.cwa
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
function callResourceManagerHandler(handler: 'contextMenuHandler' | 'clickHandler', e: MouseEvent, type: 'layout' | 'page') {
|
|
70
|
+
resourceManager.value && resourceManager.value[handler](e, type)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function closeContextMenu(e: MouseEvent) {
|
|
74
|
+
resourceManager.value && resourceManager.value.closeContextMenu(e)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function onLayoutContextMenu(e: MouseEvent) {
|
|
78
|
+
callResourceManagerHandler('contextMenuHandler', e, 'layout')
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function onPageContextMenu(e: MouseEvent) {
|
|
82
|
+
callResourceManagerHandler('contextMenuHandler', e, 'page')
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function onPageClick(e: MouseEvent) {
|
|
86
|
+
callResourceManagerHandler('clickHandler', e, 'page')
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function onLayoutClick(e: MouseEvent) {
|
|
90
|
+
callResourceManagerHandler('clickHandler', e, 'layout')
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const layoutResource = computed(() => {
|
|
94
|
+
return $cwa.resources.layout.value
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
const layoutUiComponent = computed<GlobalComponentNames>(() => {
|
|
98
|
+
return cwaPageMeta.value?.staticLayout || (layoutResource.value?.data?.uiComponent as GlobalComponentNames) || LazyCwaDefaultLayout
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
// Whether the current context resolves to a named layout component (not falling back to default).
|
|
102
|
+
const hasNamedLayout = computed(() => !!(cwaPageMeta.value?.staticLayout || layoutResource.value?.data?.uiComponent))
|
|
103
|
+
|
|
104
|
+
// Track the last confirmed real layout component so we can avoid a brief flash back to the
|
|
105
|
+
// unstyled default during navigation. The flash occurs when the early-switch fires before the
|
|
106
|
+
// route resource's HTTP response has arrived: layoutIri is defined (we know the new layout IRI
|
|
107
|
+
// from the page resource) but layoutResource.data is still undefined (the layout entity hasn't
|
|
108
|
+
// been fetched yet), causing layoutUiComponent to momentarily fall back to LazyCwaDefaultLayout.
|
|
109
|
+
const stableLayoutUiComponent = ref<GlobalComponentNames | undefined>(hasNamedLayout.value ? layoutUiComponent.value : undefined)
|
|
110
|
+
watch(hasNamedLayout, (isNamed) => {
|
|
111
|
+
if (isNamed) {
|
|
112
|
+
stableLayoutUiComponent.value = layoutUiComponent.value
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
// todo: adjust to not be global https://github.com/nuxt/nuxt/issues/14036#issuecomment-2110180751
|
|
117
|
+
const resolvedComponent = computed(() => {
|
|
118
|
+
// todo: add checks to ensure component exists - otherwise output a warning and/or default
|
|
119
|
+
if (typeof instance?.appContext.components !== 'object') {
|
|
120
|
+
return LazyCwaDefaultLayout
|
|
121
|
+
}
|
|
122
|
+
// If we're momentarily without a named layout but we know a layout IRI exists (the layout
|
|
123
|
+
// entity data hasn't arrived yet), hold the last known real layout to avoid a flash back
|
|
124
|
+
// to the unstyled default during navigation.
|
|
125
|
+
if (!hasNamedLayout.value && $cwa.resources.layoutIri.value && stableLayoutUiComponent.value) {
|
|
126
|
+
return stableLayoutUiComponent.value
|
|
127
|
+
}
|
|
128
|
+
return layoutUiComponent.value
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
const cachedWindowScroll = ref<{ x: number, y: number }>()
|
|
132
|
+
const windowScroll = useWindowScroll()
|
|
133
|
+
|
|
134
|
+
watch(() => $cwa.admin.isEditing, () => {
|
|
135
|
+
cachedWindowScroll.value = {
|
|
136
|
+
x: windowScroll.x.value,
|
|
137
|
+
y: windowScroll.y.value,
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
flush: 'pre',
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
watch(() => $cwa.admin.isEditing, async () => {
|
|
144
|
+
// when lots of elements on the page are replaced with drafts, it can cause the scroll to revert to the top of the page. Prevent this.
|
|
145
|
+
// we may need to wait for other components to have loaded in from drafts... todo: have a think about draft component loading and taking some time.
|
|
146
|
+
await nextTick()
|
|
147
|
+
setTimeout(() => {
|
|
148
|
+
if (cachedWindowScroll.value) {
|
|
149
|
+
window.scrollTo(cachedWindowScroll.value.x, cachedWindowScroll.value.y)
|
|
150
|
+
cachedWindowScroll.value = undefined
|
|
151
|
+
}
|
|
152
|
+
}, 10)
|
|
153
|
+
}, {
|
|
154
|
+
flush: 'post',
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
const showAdmin = $cwa.auth.isAdmin
|
|
158
|
+
// resolve the store inside setup
|
|
159
|
+
const siteConfigVar = $cwa.siteConfig.config
|
|
160
|
+
useHead({
|
|
161
|
+
titleTemplate: () => {
|
|
162
|
+
if (siteConfigVar.concatTitle) {
|
|
163
|
+
return '%s %separator %siteName'
|
|
164
|
+
}
|
|
165
|
+
return '%s'
|
|
166
|
+
},
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
defineSlots<{
|
|
170
|
+
default(): any
|
|
171
|
+
}>()
|
|
172
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { definePageMeta } from '#imports'
|
|
3
|
+
import CwaPage from '#cwa/templates/cwa-page.vue'
|
|
4
|
+
import { options } from '#build/cwa-options'
|
|
5
|
+
|
|
6
|
+
definePageMeta({
|
|
7
|
+
name: '_cwa-resource-page',
|
|
8
|
+
cwa: {
|
|
9
|
+
disabled: false,
|
|
10
|
+
admin: false,
|
|
11
|
+
},
|
|
12
|
+
layout: options.layoutName || 'cwa-root-layout',
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<CwaPage v-bind="$props" />
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { onMounted, ref } from 'vue'
|
|
2
|
+
import { useCwa } from '#cwa/composables/cwa'
|
|
3
|
+
import type { PageDataMetadataResource } from '#cwa/storage/stores/api-documentation/state'
|
|
4
|
+
|
|
5
|
+
export const useDataList = () => {
|
|
6
|
+
const $cwa = useCwa()
|
|
7
|
+
const dataTypes = ref<PageDataMetadataResource[]>([])
|
|
8
|
+
const isLoadingDataTypes = ref(true)
|
|
9
|
+
|
|
10
|
+
function fqcnToEntrypointKey(fqcn: string) {
|
|
11
|
+
// e.g. App\\Entity\\BlogArticleData -> blogArticleData
|
|
12
|
+
const className = fqcn.split('\\').pop()
|
|
13
|
+
if (!className) {
|
|
14
|
+
return
|
|
15
|
+
}
|
|
16
|
+
return className.charAt(0).toLowerCase() + className.slice(1)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function displayPageDataClassName(cls: string) {
|
|
20
|
+
const clsName = cls.split('\\').pop()
|
|
21
|
+
const configName = clsName ? $cwa.pageDataConfig?.[clsName]?.name : undefined
|
|
22
|
+
return configName || clsName || cls
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
onMounted(async () => {
|
|
26
|
+
if (!$cwa.auth.user?.['@id']) {
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
isLoadingDataTypes.value = true
|
|
30
|
+
// need to fetch a resource to get the docs from link header if not set - user should always be there as we are logged in
|
|
31
|
+
await $cwa.fetchResource({
|
|
32
|
+
path: $cwa.auth.user?.['@id'],
|
|
33
|
+
})
|
|
34
|
+
const docs = await $cwa.getApiDocumentation()
|
|
35
|
+
const allMetadata = docs?.pageDataMetadata?.['member']
|
|
36
|
+
if (!allMetadata) {
|
|
37
|
+
isLoadingDataTypes.value = false
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
dataTypes.value = allMetadata.filter(data => (!data.resourceClass.endsWith('\\AbstractPageData')))
|
|
41
|
+
isLoadingDataTypes.value = false
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
displayPageDataClassName,
|
|
46
|
+
dataTypes,
|
|
47
|
+
fqcnToEntrypointKey,
|
|
48
|
+
isLoadingDataTypes,
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { computed, type MaybeRef, toValue } from 'vue'
|
|
2
|
+
import { useRoute } from 'vue-router'
|
|
3
|
+
import { useCwa } from '#cwa/composables/cwa'
|
|
4
|
+
|
|
5
|
+
export const useDataType = (dataClass: MaybeRef<string> | undefined = undefined) => {
|
|
6
|
+
const $cwa = useCwa()
|
|
7
|
+
const route = useRoute()
|
|
8
|
+
// todo: getStringFromParam is a function used localised in a few places, generalise it
|
|
9
|
+
function getStringFromParam(paramName: string): string {
|
|
10
|
+
const paramValue = route.params[paramName]
|
|
11
|
+
return (Array.isArray(paramValue) ? paramValue[0] : paramValue) || ''
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const dataType = computed<string>(() => {
|
|
15
|
+
if (dataClass) return toValue(dataClass)
|
|
16
|
+
return getStringFromParam('type')
|
|
17
|
+
})
|
|
18
|
+
const dataTypeClassName = computed(() => {
|
|
19
|
+
if (!dataType.value) {
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
return dataType.value.charAt(0).toUpperCase() + dataType.value.slice(1)
|
|
23
|
+
})
|
|
24
|
+
const pageDataConfig = computed(() => {
|
|
25
|
+
if (!dataTypeClassName.value) return
|
|
26
|
+
return $cwa.pageDataConfig?.[dataTypeClassName.value]
|
|
27
|
+
})
|
|
28
|
+
const pageDataClassName = computed<string>(() => {
|
|
29
|
+
if (!dataTypeClassName.value) {
|
|
30
|
+
return 'Unknown'
|
|
31
|
+
}
|
|
32
|
+
return pageDataConfig.value?.name || dataType.value
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
dataTypeClassName,
|
|
37
|
+
dataType,
|
|
38
|
+
pageDataClassName,
|
|
39
|
+
pageDataConfig,
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import type { CwaResource } from '#cwa/resources/resource-utils'
|
|
3
|
+
import { useCwa } from '#imports'
|
|
4
|
+
|
|
5
|
+
export const useDynamicPageLoader = () => {
|
|
6
|
+
const $cwa = useCwa()
|
|
7
|
+
const loadingDynamicPages = ref(false)
|
|
8
|
+
const currentRequestId = ref(0)
|
|
9
|
+
const dynamicPages = ref<CwaResource[]>()
|
|
10
|
+
|
|
11
|
+
async function loadDynamicPageOptions() {
|
|
12
|
+
const thisRequestId = currentRequestId.value + 1
|
|
13
|
+
currentRequestId.value = thisRequestId
|
|
14
|
+
loadingDynamicPages.value = true
|
|
15
|
+
const { response } = $cwa.fetch({ path: '/_/pages?isTemplate=true', noQuery: true })
|
|
16
|
+
const { _data: data } = await response
|
|
17
|
+
if (thisRequestId === currentRequestId.value) {
|
|
18
|
+
data && (dynamicPages.value = data['member'])
|
|
19
|
+
loadingDynamicPages.value = false
|
|
20
|
+
}
|
|
21
|
+
return dynamicPages
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
loadDynamicPageOptions,
|
|
26
|
+
dynamicPages,
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { computed, isRef, onMounted, ref, watch } from 'vue'
|
|
2
|
+
import type { ComputedRef, Ref } from 'vue'
|
|
3
|
+
import { useRoute, useRouter } from 'vue-router'
|
|
4
|
+
import dayjs from 'dayjs'
|
|
5
|
+
import { useCwaResourceRoute } from '#cwa/composables/useCwaResourceRoute'
|
|
6
|
+
import type { CwaResource } from '#cwa/resources/resource-utils'
|
|
7
|
+
import { useCwa } from '#cwa/composables/cwa'
|
|
8
|
+
import { ErrorType } from '#cwa/storage/stores/error/state'
|
|
9
|
+
import type { ApiResourceEvent } from '#cwa/resources/resources-manager'
|
|
10
|
+
|
|
11
|
+
export type TempCwaResource = Omit<CwaResource, '@id' | '_metadata'>
|
|
12
|
+
|
|
13
|
+
type StartsWithHash = `#${string}`
|
|
14
|
+
|
|
15
|
+
type UseItemOps = {
|
|
16
|
+
createEndpoint: string | Ref<string>
|
|
17
|
+
emit: ((evt: 'close') => void) & ((evt: 'reload') => void)
|
|
18
|
+
resourceType: string
|
|
19
|
+
defaultResource: Omit<TempCwaResource, '@type'>
|
|
20
|
+
validate?: (data: any) => boolean | string
|
|
21
|
+
endpoint?: Ref<string | undefined>
|
|
22
|
+
routeHashAfterAdd?: ComputedRef<StartsWithHash>
|
|
23
|
+
iri?: Ref<string | undefined>
|
|
24
|
+
excludeFields?: string[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const useItemPage = ({ emit, resourceType, defaultResource, createEndpoint, validate, endpoint: userDefinedEndpoint, routeHashAfterAdd, iri, excludeFields }: UseItemOps) => {
|
|
28
|
+
const $cwa = useCwa()
|
|
29
|
+
const router = useRouter()
|
|
30
|
+
const route = useRoute()
|
|
31
|
+
|
|
32
|
+
function getStringFromParam(paramName: string): string {
|
|
33
|
+
const paramValue = route.params[paramName]
|
|
34
|
+
return (Array.isArray(paramValue) ? paramValue[0] : paramValue) || ''
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const endpoint = computed(() => userDefinedEndpoint?.value || getStringFromParam('iri'))
|
|
38
|
+
if (!endpoint.value) {
|
|
39
|
+
throw new Error('No Endpoint Found For useItemPage composable')
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const isLoading = ref(true)
|
|
43
|
+
const isUpdating = ref(false)
|
|
44
|
+
const localResourceData = ref<TempCwaResource | CwaResource>()
|
|
45
|
+
const resourceIri = computed(() => (iri?.value || endpoint.value))
|
|
46
|
+
|
|
47
|
+
const isAdding = computed(() => endpoint.value === 'add')
|
|
48
|
+
const apiState = computed(() => (isAdding.value ? undefined : $cwa.resources.getResource(resourceIri.value).value?.apiState))
|
|
49
|
+
const resource = computed(() => isAdding.value ? localResourceData.value : $cwa.resources.getResource(resourceIri.value).value?.data)
|
|
50
|
+
|
|
51
|
+
function formatDate(dateStr: string) {
|
|
52
|
+
return dayjs(dateStr).format('DD/MM/YY @ HH:mm UTCZ')
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function loadResource() {
|
|
56
|
+
if (isAdding.value) {
|
|
57
|
+
localResourceData.value = {
|
|
58
|
+
'@type': resourceType,
|
|
59
|
+
...defaultResource,
|
|
60
|
+
}
|
|
61
|
+
return localResourceData.value
|
|
62
|
+
}
|
|
63
|
+
const fetchProps = {
|
|
64
|
+
path: endpoint.value,
|
|
65
|
+
iri: iri?.value,
|
|
66
|
+
shallowFetch: true,
|
|
67
|
+
}
|
|
68
|
+
const loadedResource = await $cwa.fetchResource(fetchProps)
|
|
69
|
+
isLoading.value = false
|
|
70
|
+
return loadedResource
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function deleteResource(refreshEndpoints?: string[] | undefined, requestCompleteFn?: ApiResourceEvent['requestCompleteFn']) {
|
|
74
|
+
isUpdating.value = true
|
|
75
|
+
await $cwa.resourcesManager.deleteResource({
|
|
76
|
+
endpoint: iri?.value || endpoint.value,
|
|
77
|
+
refreshEndpoints,
|
|
78
|
+
requestCompleteFn,
|
|
79
|
+
saveCompleteFn: () => {
|
|
80
|
+
// if in cwa view
|
|
81
|
+
emit('reload')
|
|
82
|
+
emit('close')
|
|
83
|
+
},
|
|
84
|
+
})
|
|
85
|
+
isUpdating.value = false
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function saveTitle() {
|
|
89
|
+
if (isAdding.value) {
|
|
90
|
+
return
|
|
91
|
+
}
|
|
92
|
+
return saveResource()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async function saveResource(close = false, extraData?: Record<string, any>) {
|
|
96
|
+
if (!localResourceData.value) {
|
|
97
|
+
return
|
|
98
|
+
}
|
|
99
|
+
if (validate) {
|
|
100
|
+
const result = validate(localResourceData.value)
|
|
101
|
+
if (result !== true) {
|
|
102
|
+
if (result !== false) {
|
|
103
|
+
$cwa.resourcesManager.addError({
|
|
104
|
+
type: ErrorType.VALIDATION,
|
|
105
|
+
timestamp: (new Date()).getTime(),
|
|
106
|
+
statusCode: 0,
|
|
107
|
+
detail: result,
|
|
108
|
+
violations: [
|
|
109
|
+
{
|
|
110
|
+
message: result,
|
|
111
|
+
property: 'plainPassword',
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
return
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const doRequest = async () => {
|
|
120
|
+
const data: { [key: string]: any } = {
|
|
121
|
+
...localResourceData.value,
|
|
122
|
+
...extraData,
|
|
123
|
+
}
|
|
124
|
+
if (excludeFields) {
|
|
125
|
+
for (const field of excludeFields) {
|
|
126
|
+
data[field] && (delete data[field])
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (isAdding.value) {
|
|
130
|
+
const newResource = await $cwa.resourcesManager.createResource({
|
|
131
|
+
endpoint: isRef(createEndpoint) ? createEndpoint.value : createEndpoint,
|
|
132
|
+
data,
|
|
133
|
+
source: 'admin-modal',
|
|
134
|
+
})
|
|
135
|
+
if (newResource) {
|
|
136
|
+
emit('reload')
|
|
137
|
+
if (close) {
|
|
138
|
+
emit('close')
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
router.push({ name: route.name, params: { iri: newResource['@id'] }, query: route.query, hash: routeHashAfterAdd?.value })
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return newResource
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const updatedResource = await $cwa.resourcesManager.updateResource({
|
|
148
|
+
endpoint: iri?.value || endpoint.value,
|
|
149
|
+
data,
|
|
150
|
+
})
|
|
151
|
+
if (close && updatedResource) {
|
|
152
|
+
emit('close')
|
|
153
|
+
}
|
|
154
|
+
return updatedResource
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
isUpdating.value = true
|
|
158
|
+
const resource = await doRequest()
|
|
159
|
+
isUpdating.value = false
|
|
160
|
+
return resource
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function syncLocalResourceWithStore(newResource?: TempCwaResource | undefined) {
|
|
164
|
+
const storeResource = newResource || resource.value
|
|
165
|
+
if (!isAdding.value && storeResource) {
|
|
166
|
+
localResourceData.value = { ...storeResource }
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
watch(resource, syncLocalResourceWithStore)
|
|
171
|
+
watch(endpoint, loadResource)
|
|
172
|
+
|
|
173
|
+
onMounted(async () => {
|
|
174
|
+
await loadResource()
|
|
175
|
+
if (!resource.value || (resourceType !== undefined && resource.value['@type'] !== resourceType)) {
|
|
176
|
+
emit('close')
|
|
177
|
+
isLoading.value = false
|
|
178
|
+
return
|
|
179
|
+
}
|
|
180
|
+
isLoading.value = false
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
const { getInternalResourceLink } = useCwaResourceRoute()
|
|
184
|
+
|
|
185
|
+
return {
|
|
186
|
+
isLoading,
|
|
187
|
+
isUpdating,
|
|
188
|
+
resource,
|
|
189
|
+
localResourceData,
|
|
190
|
+
isAdding,
|
|
191
|
+
apiState,
|
|
192
|
+
formatDate,
|
|
193
|
+
deleteResource,
|
|
194
|
+
saveTitle,
|
|
195
|
+
saveResource,
|
|
196
|
+
loadResource,
|
|
197
|
+
resetResource: syncLocalResourceWithStore,
|
|
198
|
+
getInternalResourceLink,
|
|
199
|
+
}
|
|
200
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useRoute, useRouter } from 'vue-router'
|
|
2
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
3
|
+
import type { Ref } from 'vue'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
import type ListContent from '#cwa/templates/components/core/admin/ListContent.vue'
|
|
6
|
+
|
|
7
|
+
export const useListPage = (listContent: Ref<InstanceType<typeof ListContent> | null>, clearPageNumberQuery?: boolean) => {
|
|
8
|
+
const router = useRouter()
|
|
9
|
+
const route = useRoute()
|
|
10
|
+
|
|
11
|
+
function triggerReload() {
|
|
12
|
+
listContent.value?.reloadItems()
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function goToAdd() {
|
|
16
|
+
router.push(computedItemLink.value('add'))
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const computedItemLink = computed(() => {
|
|
20
|
+
return (iri: string, routeName?: string, hash?: string, params?: { [key: string]: string }): RouteLocationRaw => {
|
|
21
|
+
const currentRouteName = routeName || route.name?.toString()
|
|
22
|
+
if (!currentRouteName) {
|
|
23
|
+
return '#'
|
|
24
|
+
}
|
|
25
|
+
const upperRouteName = currentRouteName.replace(/-iri$/, '')
|
|
26
|
+
|
|
27
|
+
if (!params) {
|
|
28
|
+
params = {}
|
|
29
|
+
}
|
|
30
|
+
params.iri = iri
|
|
31
|
+
|
|
32
|
+
const query = { ...route.query }
|
|
33
|
+
clearPageNumberQuery && delete query.page
|
|
34
|
+
|
|
35
|
+
return { name: `${upperRouteName}-iri`, params, query, hash }
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
goToAdd,
|
|
41
|
+
triggerReload,
|
|
42
|
+
computedItemLink,
|
|
43
|
+
}
|
|
44
|
+
}
|