@cwa/nuxt-edge 1.0.0-29138192.e49c1a0
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/error.vue +13 -0
- package/dist/layer/layouts/CwaRootLayout.vue +140 -0
- package/dist/layer/nuxt.config.spec.ts +10 -0
- package/dist/layer/nuxt.config.ts +3 -0
- package/dist/layer/pages/_cwa/composables/useDataList.ts +50 -0
- package/dist/layer/pages/_cwa/composables/useDataType.ts +30 -0
- package/dist/layer/pages/_cwa/composables/useDynamicPageLoader.ts +28 -0
- package/dist/layer/pages/_cwa/composables/useItemPage.ts +172 -0
- package/dist/layer/pages/_cwa/composables/useListPage.ts +43 -0
- package/dist/layer/pages/_cwa/data/[type]/[iri].vue +17 -0
- package/dist/layer/pages/_cwa/data/[type].vue +131 -0
- package/dist/layer/pages/_cwa/data/index.vue +84 -0
- package/dist/layer/pages/_cwa/layouts/[iri].vue +174 -0
- package/dist/layer/pages/_cwa/layouts.vue +77 -0
- package/dist/layer/pages/_cwa/pages/[iri].vue +11 -0
- package/dist/layer/pages/_cwa/pages.vue +129 -0
- package/dist/layer/pages/_cwa/routes.vue +72 -0
- package/dist/layer/pages/_cwa/users/[iri].vue +248 -0
- package/dist/layer/pages/_cwa/users.vue +86 -0
- package/dist/layer/pages/_cwa.vue +43 -0
- package/dist/layer/pages/forgot-password.vue +32 -0
- package/dist/layer/pages/login.vue +33 -0
- package/dist/layer/pages/reset-password/[username]/[token].vue +39 -0
- package/dist/module.d.mts +53 -0
- package/dist/module.json +13 -0
- package/dist/module.mjs +235 -0
- package/dist/runtime/admin/admin.d.ts +36 -0
- package/dist/runtime/admin/admin.js +65 -0
- package/dist/runtime/admin/manageable-resource.d.ts +41 -0
- package/dist/runtime/admin/manageable-resource.js +206 -0
- package/dist/runtime/admin/manager-tabs-resolver.d.ts +17 -0
- package/dist/runtime/admin/manager-tabs-resolver.js +51 -0
- package/dist/runtime/admin/navigation-guard.d.ts +18 -0
- package/dist/runtime/admin/navigation-guard.js +55 -0
- package/dist/runtime/admin/resource-stack-manager.d.ts +92 -0
- package/dist/runtime/admin/resource-stack-manager.js +355 -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 +85 -0
- package/dist/runtime/api/auth.js +183 -0
- package/dist/runtime/api/fetcher/cwa-fetch.d.ts +5 -0
- package/dist/runtime/api/fetcher/cwa-fetch.js +20 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.d.ts +51 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.js +185 -0
- package/dist/runtime/api/fetcher/fetcher.d.ts +57 -0
- package/dist/runtime/api/fetcher/fetcher.js +222 -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 +33 -0
- package/dist/runtime/api/mercure.js +191 -0
- package/dist/runtime/composables/component/html-content.d.ts +2 -0
- package/dist/runtime/composables/component/html-content.js +82 -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 +16 -0
- package/dist/runtime/composables/cwa-collection-resource.js +92 -0
- package/dist/runtime/composables/cwa-image.d.ts +19 -0
- package/dist/runtime/composables/cwa-image.js +43 -0
- package/dist/runtime/composables/cwa-query-bound-model.d.ts +9 -0
- package/dist/runtime/composables/cwa-query-bound-model.js +108 -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 +32 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.d.ts +17 -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 +149 -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 +24 -0
- package/dist/runtime/composables/cwa-resource.js +22 -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 +104 -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/cwa.d.ts +61 -0
- package/dist/runtime/cwa.js +123 -0
- package/dist/runtime/errors/cwa-resource-error.d.ts +18 -0
- package/dist/runtime/errors/cwa-resource-error.js +54 -0
- package/dist/runtime/plugin.d.ts +7 -0
- package/dist/runtime/plugin.js +18 -0
- package/dist/runtime/resources/resource-utils.d.ts +44 -0
- package/dist/runtime/resources/resource-utils.js +73 -0
- package/dist/runtime/resources/resources-manager.d.ts +70 -0
- package/dist/runtime/resources/resources-manager.js +463 -0
- package/dist/runtime/resources/resources.d.ts +53 -0
- package/dist/runtime/resources/resources.js +300 -0
- package/dist/runtime/route-middleware.d.ts +2 -0
- package/dist/runtime/route-middleware.js +86 -0
- package/dist/runtime/storage/storage.d.ts +20 -0
- package/dist/runtime/storage/storage.js +25 -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 +74 -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 +20 -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 +69 -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 +49 -0
- package/dist/runtime/storage/stores/fetcher/actions.js +125 -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 +25 -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 +54 -0
- package/dist/runtime/storage/stores/resources/actions.js +390 -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 +251 -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 +64 -0
- package/dist/runtime/storage/stores/resources/state.js +24 -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.vue +18 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/ComponentPosition.spec.ts.snap +16 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue +63 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue +41 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/DialogBox.vue +95 -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.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 +13 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue +7 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue +136 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue.d.ts +21 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue +49 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue +53 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue +32 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue.d.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue +87 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue +18 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue +260 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue +187 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue.d.ts +13 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue +99 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue.d.ts +27 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue +27 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue.d.ts +6 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue +23 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue +77 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue.d.ts +19 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue +102 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue.d.ts +20 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue +52 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue.d.ts +10 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue +273 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue +18 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue.d.ts +16 -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 +3 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue +23 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue +30 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue +99 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue.d.ts +6 -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 +4 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue +21 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue +15 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue +24 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue +20 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue +21 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue +23 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue +13 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/useDataResolver.d.ts +12 -0
- package/dist/runtime/templates/components/core/useDataResolver.js +109 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.d.ts +6 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.js +164 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.d.ts +20 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.js +69 -0
- package/dist/runtime/templates/components/main/ComponentGroup.spec.ts.snap +59 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue +107 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue.d.ts +9 -0
- package/dist/runtime/templates/components/main/CwaLink.vue +51 -0
- package/dist/runtime/templates/components/main/CwaLink.vue.d.ts +14 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue +8 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue +98 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/Logo.vue +18 -0
- package/dist/runtime/templates/components/main/Logo.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/README.md +7 -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 +7 -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 +2 -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.vue +207 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue +189 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue +14 -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.vue +19 -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.vue +69 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue.d.ts +12 -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 +2 -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 +2 -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 +2 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue +151 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue.d.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue +192 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue.d.ts +6 -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 +9 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue +205 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue.d.ts +2 -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 +6 -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 +7 -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 +13 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue +59 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue.d.ts +6 -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 +6 -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 +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue +101 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue.d.ts +6 -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 +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue +121 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue.d.ts +6 -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 +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue +99 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue.d.ts +7 -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 +7 -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 +2 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue +55 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue.d.ts +20 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue +60 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue.d.ts +23 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue +59 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue.d.ts +27 -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 +6 -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 +45 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue.d.ts +17 -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 +17 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue +960 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue +75 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue.d.ts +9 -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 +9 -0
- package/dist/runtime/templates/components/ui/README.md +6 -0
- package/dist/runtime/templates/components/ui/alert/Info.spec.ts.snap +23 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue +13 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue.d.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Warning.spec.ts.snap +14 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue +8 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue.d.ts +12 -0
- package/dist/runtime/templates/components/ui/form/Button.vue +139 -0
- package/dist/runtime/templates/components/ui/form/Button.vue.d.ts +52 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue +18 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue +15 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/form/File.vue +72 -0
- package/dist/runtime/templates/components/ui/form/File.vue.d.ts +9 -0
- package/dist/runtime/templates/components/ui/form/Input.vue +22 -0
- package/dist/runtime/templates/components/ui/form/Input.vue.d.ts +5 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue +16 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue.d.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 +14 -0
- package/dist/runtime/templates/components/ui/form/Select.vue +60 -0
- package/dist/runtime/templates/components/ui/form/Select.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue +39 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue.d.ts +6 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue +30 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue +12 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue +10 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue +23 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue +11 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue +15 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue +59 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue.d.ts +21 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue +24 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue.d.ts +9 -0
- package/dist/runtime/templates/components/utils/README.md +1 -0
- package/dist/runtime/templates/components/utils/Spinner.spec.ts.snap +56 -0
- package/dist/runtime/templates/components/utils/Spinner.vue +42 -0
- package/dist/runtime/templates/components/utils/Spinner.vue.d.ts +5 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue +43 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue.d.ts +6 -0
- package/dist/runtime/templates/cwa-page.spec.ts.snap +20 -0
- package/dist/runtime/templates/cwa-page.vue +32 -0
- package/dist/runtime/templates/cwa-page.vue.d.ts +2 -0
- package/dist/runtime/types/popper.d.ts +14 -0
- package/dist/types.d.mts +9 -0
- package/package.json +108 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import DialogBox, {} from "#cwa/runtime/templates/components/core/DialogBox.vue";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
title: { type: String, required: true, default: "No Title Set" },
|
|
6
|
+
content: { type: String, required: true, default: "No Content Set" }
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits(["confirm", "cancel"]);
|
|
9
|
+
const open = ref(true);
|
|
10
|
+
function completeDialog(eventName) {
|
|
11
|
+
open.value = false;
|
|
12
|
+
setTimeout(() => {
|
|
13
|
+
emit(eventName);
|
|
14
|
+
}, eventName === "cancel" ? 300 : 0);
|
|
15
|
+
}
|
|
16
|
+
const buttons = computed(() => {
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
label: "Ok",
|
|
20
|
+
color: "blue",
|
|
21
|
+
buttonClass: "cwa:min-w-[120px]",
|
|
22
|
+
callbackFn: () => completeDialog("confirm")
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "Cancel",
|
|
26
|
+
color: "grey",
|
|
27
|
+
callbackFn: () => completeDialog("cancel")
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<DialogBox
|
|
35
|
+
v-model="open"
|
|
36
|
+
:title="title"
|
|
37
|
+
:buttons="buttons"
|
|
38
|
+
>
|
|
39
|
+
<div v-html="props.content" />
|
|
40
|
+
</DialogBox>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
content: string;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
|
|
6
|
+
content: string;
|
|
7
|
+
title: string;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<TransitionRoot
|
|
3
|
+
as="template"
|
|
4
|
+
:show="isOpen"
|
|
5
|
+
>
|
|
6
|
+
<Dialog
|
|
7
|
+
as="div"
|
|
8
|
+
class="cwa:relative cwa:z-dialog"
|
|
9
|
+
@close="setIsOpen"
|
|
10
|
+
>
|
|
11
|
+
<TransitionChild
|
|
12
|
+
as="template"
|
|
13
|
+
enter="cwa:ease-out cwa:duration-300"
|
|
14
|
+
enter-from="cwa:opacity-0"
|
|
15
|
+
enter-to="cwa:opacity-100"
|
|
16
|
+
leave="cwa:ease-in cwa:duration-200"
|
|
17
|
+
leave-from="cwa:opacity-100"
|
|
18
|
+
leave-to="cwa:opacity-0"
|
|
19
|
+
>
|
|
20
|
+
<div class="cwa:fixed cwa:inset-0 cwa:dark-blur cwa:transition-opacity" />
|
|
21
|
+
</TransitionChild>
|
|
22
|
+
|
|
23
|
+
<div class="cwa:fixed cwa:inset-0 cwa:z-10 cwa:w-screen cwa:overflow-y-auto">
|
|
24
|
+
<div class="cwa:flex cwa:min-h-full cwa:items-end cwa:justify-center cwa:p-4 cwa:text-center cwa:sm:items-center">
|
|
25
|
+
<TransitionChild
|
|
26
|
+
as="template"
|
|
27
|
+
enter="cwa:ease-out cwa:duration-300"
|
|
28
|
+
enter-from="cwa:opacity-0 cwa:translate-y-4 cwa:sm:translate-y-0 cwa:sm:scale-95"
|
|
29
|
+
enter-to="cwa:opacity-100 cwa:translate-y-0 cwa:sm:scale-100"
|
|
30
|
+
leave="cwa:duration-0"
|
|
31
|
+
leave-from="cwa:opacity-100"
|
|
32
|
+
leave-to="cwa:opacity-0"
|
|
33
|
+
>
|
|
34
|
+
<DialogPanel :class="panelClassName">
|
|
35
|
+
<div class="cwa:sm:flex cwa:sm:items-start">
|
|
36
|
+
<div class="w-full">
|
|
37
|
+
<DialogTitle
|
|
38
|
+
as="h3"
|
|
39
|
+
class="cwa:text-xl cwa:sm:text-4xl cwa:font-normal cwa:border-b cwa:border-stone-600 cwa:px-6 cwa:pb-4 cwa:dark-blur cwa:pt-5"
|
|
40
|
+
>
|
|
41
|
+
{{ title }}
|
|
42
|
+
</DialogTitle>
|
|
43
|
+
<div class="cwa:px-6 cwa:py-6 cwa:bg-dark">
|
|
44
|
+
<slot />
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="cwa:px-6 cwa:py-5 cwa:sm:flex cwa:sm:flex-row-reverse cwa:gap-y-2 cwa:sm:gap-y-0 cwa:sm:gap-x-6 cwa:sm:gap-x-reverse cwa:dark-blur cwa:border-t cwa:border-stone-600">
|
|
49
|
+
<slot name="buttons">
|
|
50
|
+
<CwaUiFormButton
|
|
51
|
+
v-for="button of buttons"
|
|
52
|
+
:key="`dialog-button-${button.label}`"
|
|
53
|
+
:color="button.color"
|
|
54
|
+
:button-class="button.buttonClass"
|
|
55
|
+
:disabled="!!button.disabled || isLoading"
|
|
56
|
+
@click="!button.disabled && (button?.callbackFn ? button.callbackFn() : setIsOpen(false))"
|
|
57
|
+
>
|
|
58
|
+
{{ button.label }}
|
|
59
|
+
</CwaUiFormButton>
|
|
60
|
+
</slot>
|
|
61
|
+
</div>
|
|
62
|
+
</DialogPanel>
|
|
63
|
+
</TransitionChild>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</Dialog>
|
|
67
|
+
</TransitionRoot>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script setup>
|
|
71
|
+
import { computed } from "vue";
|
|
72
|
+
import { Dialog, DialogPanel, DialogTitle, TransitionChild, TransitionRoot } from "@headlessui/vue";
|
|
73
|
+
const isOpen = defineModel({ type: Boolean, ...{ default: false } });
|
|
74
|
+
defineProps({
|
|
75
|
+
title: { type: String, required: true, default: "" },
|
|
76
|
+
buttons: { type: Array, required: true, default: () => [
|
|
77
|
+
{
|
|
78
|
+
color: "blue",
|
|
79
|
+
buttonClass: "cwa:min-w-[120px]",
|
|
80
|
+
label: "Done"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
color: "grey",
|
|
84
|
+
label: "Cancel"
|
|
85
|
+
}
|
|
86
|
+
] },
|
|
87
|
+
isLoading: { type: Boolean, required: false, default: false }
|
|
88
|
+
});
|
|
89
|
+
function setIsOpen(value) {
|
|
90
|
+
isOpen.value = !!value;
|
|
91
|
+
}
|
|
92
|
+
const panelClassName = computed(() => {
|
|
93
|
+
return "cwa:relative cwa:transform cwa:overflow-hidden cwa:rounded-xl cwa:text-white cwa:text-left cwa:shadow-xl cwa:transition-all cwa:sm:my-8 cwa:sm:w-full cwa:sm:max-w-3xl";
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ButtonColor } from '#cwa/runtime/templates/components/ui/form/Button.vue';
|
|
2
|
+
export interface ActionButton {
|
|
3
|
+
label: string;
|
|
4
|
+
color: ButtonColor;
|
|
5
|
+
buttonClass?: string;
|
|
6
|
+
callbackFn?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
title: string;
|
|
11
|
+
buttons: ActionButton[];
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
15
|
+
modelValue?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare var __VLS_30: {}, __VLS_32: {};
|
|
18
|
+
type __VLS_Slots = {} & {
|
|
19
|
+
default?: (props: typeof __VLS_30) => any;
|
|
20
|
+
} & {
|
|
21
|
+
buttons?: (props: typeof __VLS_32) => any;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
|
+
"update:modelValue": (value: boolean) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
26
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
title: string;
|
|
29
|
+
isLoading: boolean;
|
|
30
|
+
buttons: ActionButton[];
|
|
31
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Components in this directory are for internal use by the module and are not automatically imported. This should not be used within your application and are internal.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`ResourceLoader > snapshots > should match snapshot IF UI component is not resolved 1`] = `
|
|
4
|
+
<warning-stub>
|
|
5
|
+
<p>
|
|
6
|
+
The component 'TestComponentMock' for resource 'testIri' cannot be resolved
|
|
7
|
+
</p>
|
|
8
|
+
</warning-stub>
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
exports[`ResourceLoader > snapshots > should match snapshot IF component is resolved from props 1`] = `
|
|
12
|
+
<dummycomponent-stub
|
|
13
|
+
iri="testIri"
|
|
14
|
+
/>
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
exports[`ResourceLoader > snapshots > should match snapshot IF global component name is resolved 1`] = `
|
|
18
|
+
<globalcomponent-stub
|
|
19
|
+
iri="testIri"
|
|
20
|
+
/>
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
exports[`ResourceLoader > snapshots > should match snapshot IF resource data is not resolved 1`] = `<!--v-if-->`;
|
|
24
|
+
|
|
25
|
+
exports[`ResourceLoader > snapshots > should match snapshot IF resource does not exist after loading 1`] = `
|
|
26
|
+
<warning-stub>
|
|
27
|
+
<p>
|
|
28
|
+
Resource 'testIri' has not been requested
|
|
29
|
+
</p>
|
|
30
|
+
</warning-stub>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
exports[`ResourceLoader > snapshots > should match snapshot IF resource is loading 1`] = `
|
|
34
|
+
<div>
|
|
35
|
+
<spinner-stub
|
|
36
|
+
show="true"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="isLoading">
|
|
3
|
+
<Spinner :show="true" />
|
|
4
|
+
</div>
|
|
5
|
+
<CwaUiAlertWarning v-else-if="warningPlaceholder">
|
|
6
|
+
<p>{{ warningPlaceholder }}</p>
|
|
7
|
+
</CwaUiAlertWarning>
|
|
8
|
+
<component
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
:is="resolvedComponent"
|
|
11
|
+
v-else-if="!!resource?.data && iri"
|
|
12
|
+
ref="resourceComponent"
|
|
13
|
+
:iri="iri"
|
|
14
|
+
:class="resourceClassNames"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
19
|
+
import { computed, onMounted, watch, getCurrentInstance, ref, onBeforeMount, useTemplateRef } from "vue";
|
|
20
|
+
import { CwaResourceApiStatuses } from "../../../storage/stores/resources/state";
|
|
21
|
+
import { useCwa } from "#imports";
|
|
22
|
+
import {
|
|
23
|
+
CwaResourceTypes,
|
|
24
|
+
getPublishedResourceState,
|
|
25
|
+
getResourceTypeFromIri
|
|
26
|
+
} from "#cwa/runtime/resources/resource-utils";
|
|
27
|
+
import Spinner from "#cwa/runtime/templates/components/utils/Spinner.vue";
|
|
28
|
+
const $cwa = useCwa();
|
|
29
|
+
const instance = getCurrentInstance();
|
|
30
|
+
const props = defineProps({
|
|
31
|
+
iri: { type: String, required: true },
|
|
32
|
+
componentPrefix: { type: String, required: false, default: "" },
|
|
33
|
+
uiComponent: { type: null, required: false, default: void 0 }
|
|
34
|
+
});
|
|
35
|
+
const resource = computed(() => $cwa.resources.getResource(props.iri).value);
|
|
36
|
+
const resourceComponent = useTemplateRef("resourceComponent");
|
|
37
|
+
const resourceLoadBuffering = ref(!resource.value);
|
|
38
|
+
onBeforeMount(() => {
|
|
39
|
+
if (resourceLoadBuffering.value) {
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
resourceLoadBuffering.value = false;
|
|
42
|
+
}, 20);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const isLoading = computed(() => {
|
|
46
|
+
if (!props.iri) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
const isLoading2 = !!resource.value && !resource.value?.data && resource.value?.apiState.status === CwaResourceApiStatuses.IN_PROGRESS;
|
|
50
|
+
return isLoading2 || resource.value === void 0 && resourceLoadBuffering.value;
|
|
51
|
+
});
|
|
52
|
+
const warningPlaceholder = computed(() => {
|
|
53
|
+
if (!props.iri) {
|
|
54
|
+
return "No IRI has been passed as a property to the `ResourceLoader` component";
|
|
55
|
+
}
|
|
56
|
+
if (!resource.value) {
|
|
57
|
+
return `Resource '${props.iri}' has not been requested`;
|
|
58
|
+
}
|
|
59
|
+
if (resourceUiComponent.value && !resolvedComponent.value) {
|
|
60
|
+
return `The component '${resourceUiComponent.value}' for resource '${props.iri}' cannot be resolved`;
|
|
61
|
+
}
|
|
62
|
+
return void 0;
|
|
63
|
+
});
|
|
64
|
+
const resourceUiComponent = computed(() => {
|
|
65
|
+
const data = resource.value?.data;
|
|
66
|
+
if (!data) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const rawName = data.uiComponent || data["@type"];
|
|
70
|
+
if (!rawName) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (!props.componentPrefix) {
|
|
74
|
+
return rawName;
|
|
75
|
+
}
|
|
76
|
+
const regExp = new RegExp(`^${props.componentPrefix}`);
|
|
77
|
+
return props.componentPrefix + rawName.replace(regExp, "");
|
|
78
|
+
});
|
|
79
|
+
const resourceClassNames = computed(() => {
|
|
80
|
+
return resource.value?.data?.uiClassNames;
|
|
81
|
+
});
|
|
82
|
+
const hasError = computed(() => {
|
|
83
|
+
return resource.value?.apiState.status === CwaResourceApiStatuses.ERROR;
|
|
84
|
+
});
|
|
85
|
+
const hasSilentError = computed(() => {
|
|
86
|
+
if (!hasError.value) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const state = resource.value?.apiState;
|
|
90
|
+
const statusCode = state.error?.statusCode;
|
|
91
|
+
return !!(statusCode && statusCode >= 400 && statusCode < 500);
|
|
92
|
+
});
|
|
93
|
+
const resolvedComponent = computed(() => {
|
|
94
|
+
if (props.uiComponent) {
|
|
95
|
+
return props.uiComponent;
|
|
96
|
+
}
|
|
97
|
+
if (typeof instance?.appContext.components !== "object" || !resourceUiComponent.value || !(resourceUiComponent.value in instance.appContext.components)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
return resourceUiComponent.value;
|
|
101
|
+
});
|
|
102
|
+
const ssrNoDataWithSilentError = computed(() => {
|
|
103
|
+
return resource.value?.apiState.ssr && resource.value?.data === void 0 && hasSilentError;
|
|
104
|
+
});
|
|
105
|
+
const ssrPositionHasPartialData = computed(() => {
|
|
106
|
+
return resource.value?.apiState.ssr && !!$cwa.auth.user && getResourceTypeFromIri(props.iri) === CwaResourceTypes.COMPONENT_POSITION && $cwa.resources.usesPageTemplate.value;
|
|
107
|
+
});
|
|
108
|
+
const refetchPublishedSsrResourceToResolveDraft = computed(() => {
|
|
109
|
+
if (getResourceTypeFromIri(props.iri) !== CwaResourceTypes.COMPONENT) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (!resource.value) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const publishableState = getPublishedResourceState(resource.value);
|
|
116
|
+
return publishableState === true && resource.value?.apiState.ssr && $cwa.auth.user;
|
|
117
|
+
});
|
|
118
|
+
const isOutdated = computed(() => {
|
|
119
|
+
const apiState = resource.value?.apiState;
|
|
120
|
+
if (!apiState || apiState.status !== CwaResourceApiStatuses.SUCCESS || !apiState.fetchedAt || !apiState.ssr) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const nowTime = (/* @__PURE__ */ new Date()).getTime();
|
|
124
|
+
const timeDifference = nowTime - apiState.fetchedAt;
|
|
125
|
+
return timeDifference > 5e3;
|
|
126
|
+
});
|
|
127
|
+
async function clientFetchResource() {
|
|
128
|
+
await $cwa.fetchResource({
|
|
129
|
+
path: props.iri
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
const methods = {
|
|
133
|
+
async fetchResource() {
|
|
134
|
+
if (isLoading.value) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (ssrNoDataWithSilentError.value || ssrPositionHasPartialData.value || refetchPublishedSsrResourceToResolveDraft.value) {
|
|
138
|
+
await clientFetchResource();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
onMounted(() => {
|
|
143
|
+
isOutdated.value && clientFetchResource();
|
|
144
|
+
watch([hasSilentError, resource], methods.fetchResource, {
|
|
145
|
+
immediate: true
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
defineExpose({
|
|
149
|
+
resourceComponent
|
|
150
|
+
});
|
|
151
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CwaResourceMeta } from '#imports';
|
|
2
|
+
import type { IriProp } from '#cwa/runtime/composables/cwa-resource.js';
|
|
3
|
+
type __VLS_Props = IriProp & {
|
|
4
|
+
componentPrefix?: string;
|
|
5
|
+
uiComponent?: any;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
8
|
+
resourceComponent: Readonly<import("vue").ShallowRef<CwaResourceMeta | null>>;
|
|
9
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
uiComponent: any;
|
|
11
|
+
componentPrefix: string;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ListContainer class="cwa:py-4">
|
|
3
|
+
<div class="cwa:relative">
|
|
4
|
+
<Transition
|
|
5
|
+
appear
|
|
6
|
+
mode="out-in"
|
|
7
|
+
enter-from-class="cwa:transform cwa:opacity-0"
|
|
8
|
+
enter-active-class="cwa:duration-200 cwa:ease-out"
|
|
9
|
+
enter-to-class="cwa:opacity-100"
|
|
10
|
+
leave-from-class="cwa:opacity-100"
|
|
11
|
+
leave-active-class="cwa:duration-200 cwa:ease-in"
|
|
12
|
+
leave-to-class="cwa:transform cwa:opacity-0"
|
|
13
|
+
>
|
|
14
|
+
<Spinner
|
|
15
|
+
v-if="loading"
|
|
16
|
+
class="cwa:absolute"
|
|
17
|
+
:show="true"
|
|
18
|
+
/>
|
|
19
|
+
<div
|
|
20
|
+
v-else-if="!items.length"
|
|
21
|
+
class="cwa:flex cwa:justify-center"
|
|
22
|
+
>
|
|
23
|
+
<div class="cwa:w-full cwa:max-w-xl cwa:text-center cwa:flex cwa:flex-col cwa:gap-y-2 cwa:text-stone-400">
|
|
24
|
+
<div class="cwa:flex cwa:justify-center">
|
|
25
|
+
<CwaUiIconWarningIcon class="cwa:w-20" />
|
|
26
|
+
</div>
|
|
27
|
+
<h2 class="cwa:font-bold">
|
|
28
|
+
Sorry, no items found
|
|
29
|
+
</h2>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div v-else>
|
|
33
|
+
<ListPagination
|
|
34
|
+
v-model:page.number="pageModel"
|
|
35
|
+
v-model:per-page.number="perPageModel"
|
|
36
|
+
:total-items="hydraData.totalItems || 0"
|
|
37
|
+
/>
|
|
38
|
+
<ul class="cwa:flex cwa:flex-col cwa:mb-8">
|
|
39
|
+
<li
|
|
40
|
+
v-for="(item, index) in items"
|
|
41
|
+
:key="`list-item-${index}`"
|
|
42
|
+
>
|
|
43
|
+
<slot
|
|
44
|
+
name="item"
|
|
45
|
+
v-bind="{ data: getItemFromStore(item), rawData: item }"
|
|
46
|
+
>
|
|
47
|
+
<div class="cwa:dark-blur cwa:p-2 cwa:border cwa:border-light/20">
|
|
48
|
+
<span class="cwa:font-bold">No list item template UI provided</span>
|
|
49
|
+
<pre class="cwa:text-xs cwa:p-2 cwa:max-h-40 cwa:overflow-auto">{{ item }}</pre>
|
|
50
|
+
</div>
|
|
51
|
+
</slot>
|
|
52
|
+
</li>
|
|
53
|
+
</ul>
|
|
54
|
+
<ListPagination
|
|
55
|
+
v-model:page.number="pageModel"
|
|
56
|
+
v-model:per-page.number="perPageModel"
|
|
57
|
+
:total-items="hydraData.totalItems || 0"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</Transition>
|
|
61
|
+
</div>
|
|
62
|
+
</ListContainer>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script setup>
|
|
66
|
+
import { onMounted, ref, watch } from "vue";
|
|
67
|
+
import { useRoute } from "vue-router";
|
|
68
|
+
import ListContainer from "./ListContainer.vue";
|
|
69
|
+
import ListPagination from "./ListPagination.vue";
|
|
70
|
+
import Spinner from "#cwa/runtime/templates/components/utils/Spinner.vue";
|
|
71
|
+
import { useCwa, useQueryBoundModel } from "#imports";
|
|
72
|
+
const $cwa = useCwa();
|
|
73
|
+
const route = useRoute();
|
|
74
|
+
const { model: perPageModel } = useQueryBoundModel("perPage", { defaultValue: null, asNumber: true });
|
|
75
|
+
const { model: pageModel } = useQueryBoundModel("page", { defaultValue: 1, asNumber: true });
|
|
76
|
+
watch(perPageModel, (newValue) => {
|
|
77
|
+
if (!newValue) {
|
|
78
|
+
perPageModel.value = 5;
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
immediate: true
|
|
82
|
+
});
|
|
83
|
+
const props = defineProps({
|
|
84
|
+
fetchUrl: { type: String, required: true }
|
|
85
|
+
});
|
|
86
|
+
const loading = ref(true);
|
|
87
|
+
const items = ref([]);
|
|
88
|
+
const hydraData = ref();
|
|
89
|
+
const currentRequestId = ref(0);
|
|
90
|
+
async function reloadItems() {
|
|
91
|
+
const thisRequestId = currentRequestId.value + 1;
|
|
92
|
+
currentRequestId.value = thisRequestId;
|
|
93
|
+
loading.value = true;
|
|
94
|
+
const { response } = $cwa.fetch({ path: props.fetchUrl });
|
|
95
|
+
const { _data: data } = await response;
|
|
96
|
+
hydraData.value = {
|
|
97
|
+
totalItems: data?.["hydra:totalItems"] || 0,
|
|
98
|
+
view: data?.["hydra:view"]
|
|
99
|
+
};
|
|
100
|
+
if (thisRequestId === currentRequestId.value) {
|
|
101
|
+
data && (items.value = data["hydra:member"]);
|
|
102
|
+
loading.value = false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function getItemFromStore(item) {
|
|
106
|
+
const storeItemData = $cwa.resources.getResource(item["@id"]).value?.data;
|
|
107
|
+
return storeItemData || item;
|
|
108
|
+
}
|
|
109
|
+
watch(() => route.query, (newQuery, oldQuery) => {
|
|
110
|
+
const cleanPaginationFromQuery = (q) => {
|
|
111
|
+
const cleanQuery = { ...q };
|
|
112
|
+
delete cleanQuery.perPage;
|
|
113
|
+
delete cleanQuery.page;
|
|
114
|
+
return cleanQuery;
|
|
115
|
+
};
|
|
116
|
+
const cleanedOld = cleanPaginationFromQuery(oldQuery);
|
|
117
|
+
const cleanedNew = cleanPaginationFromQuery(newQuery);
|
|
118
|
+
if (JSON.stringify(cleanedOld) !== JSON.stringify(cleanedNew)) {
|
|
119
|
+
pageModel.value = 1;
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
deep: true
|
|
123
|
+
});
|
|
124
|
+
watch(() => route.query, (oldQuery, newQuery) => {
|
|
125
|
+
if (JSON.stringify(oldQuery) === JSON.stringify(newQuery)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
reloadItems();
|
|
129
|
+
});
|
|
130
|
+
onMounted(() => {
|
|
131
|
+
reloadItems();
|
|
132
|
+
});
|
|
133
|
+
defineExpose({
|
|
134
|
+
reloadItems
|
|
135
|
+
});
|
|
136
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
fetchUrl: string;
|
|
3
|
+
};
|
|
4
|
+
declare function reloadItems(): Promise<void>;
|
|
5
|
+
declare var __VLS_19: {
|
|
6
|
+
data: any;
|
|
7
|
+
rawData: any;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
item?: (props: typeof __VLS_19) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
13
|
+
reloadItems: typeof reloadItems;
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ListContainer class="cwa:py-4">
|
|
3
|
+
<div class="cwa:flex cwa:gap-x-8">
|
|
4
|
+
<div class="cwa:grow">
|
|
5
|
+
<FilterFormWrapper
|
|
6
|
+
label="Search"
|
|
7
|
+
input-id="search-input"
|
|
8
|
+
>
|
|
9
|
+
<input
|
|
10
|
+
id="search-input"
|
|
11
|
+
v-model="searchModel"
|
|
12
|
+
type="text"
|
|
13
|
+
class="cwa:transition-colors cwa:border-0 cwa:focus:ring-0 cwa:outline-0 cwa:peer cwa:bg-stone-700/80 cwa:focus:bg-stone-700 cwa:rounded-lg cwa:w-full"
|
|
14
|
+
>
|
|
15
|
+
<CwaUiIconSearchIcon class="cwa:absolute cwa:right-2.5 cwa:top-1/2 cwa:-translate-y-1/2 cwa:w-[1.2rem] cwa:text-white/50 cwa:peer-focus:text-white cwa:transition-colors" />
|
|
16
|
+
</FilterFormWrapper>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="cwa:min-w-[150px]">
|
|
19
|
+
<FilterFormWrapper
|
|
20
|
+
label="Sort"
|
|
21
|
+
input-id="filter-select"
|
|
22
|
+
>
|
|
23
|
+
<FilterSelect
|
|
24
|
+
v-model="orderModel"
|
|
25
|
+
:options="orderOptions"
|
|
26
|
+
class="flex-grow cwa:w-full"
|
|
27
|
+
/>
|
|
28
|
+
</FilterFormWrapper>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</ListContainer>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup>
|
|
35
|
+
import ListContainer from "#cwa/runtime/templates/components/core/admin/ListContainer.vue";
|
|
36
|
+
import FilterFormWrapper from "#cwa/runtime/templates/components/core/admin/form/FilterFormWrapper.vue";
|
|
37
|
+
import FilterSelect from "#cwa/runtime/templates/components/core/admin/form/FilterSelect.vue";
|
|
38
|
+
import { useQueryBoundModel } from "#imports";
|
|
39
|
+
const props = defineProps({
|
|
40
|
+
searchFields: { type: Array, required: true },
|
|
41
|
+
orderOptions: { type: Array, required: true }
|
|
42
|
+
});
|
|
43
|
+
const { model: searchModel } = useQueryBoundModel(props.searchFields, {
|
|
44
|
+
delay: 250
|
|
45
|
+
});
|
|
46
|
+
const { model: orderModel } = useQueryBoundModel("order", {
|
|
47
|
+
defaultValue: props.orderOptions[0].value
|
|
48
|
+
});
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
searchFields: string[];
|
|
3
|
+
orderOptions: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: any;
|
|
6
|
+
}[];
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|