@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,34 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
export const useCwaCollectionPagination = (props) => {
|
|
3
|
+
const pages = computed(() => {
|
|
4
|
+
if (!props.totalPages) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
const allPages = Array.from(Array(props.totalPages), (_, x) => x + 1);
|
|
8
|
+
const maxPagesToDisplay = props.maxPagesToDisplay || 7;
|
|
9
|
+
if (allPages.length < maxPagesToDisplay) {
|
|
10
|
+
return allPages;
|
|
11
|
+
}
|
|
12
|
+
const displayPages = [];
|
|
13
|
+
displayPages.push(props.currentPage);
|
|
14
|
+
let lowest = props.currentPage;
|
|
15
|
+
let highest = props.currentPage;
|
|
16
|
+
let displayCounter = 1;
|
|
17
|
+
while (displayCounter < maxPagesToDisplay) {
|
|
18
|
+
displayCounter++;
|
|
19
|
+
if ((displayCounter % 2 === 0 || highest >= props.totalPages) && lowest > 1) {
|
|
20
|
+
lowest--;
|
|
21
|
+
displayPages.unshift(lowest);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (highest < props.totalPages) {
|
|
25
|
+
highest++;
|
|
26
|
+
displayPages.push(highest);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return displayPages;
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
pages
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { CwaResourceUtilsOps } from './cwa-resource.js';
|
|
3
|
+
import type { CwaResource } from '#cwa/runtime/resources/resource-utils';
|
|
4
|
+
export declare const useCwaCollectionResource: (iri: Ref<string>, ops?: CwaResourceUtilsOps) => {
|
|
5
|
+
resource: import("vue").ComputedRef<import("../storage/stores/resources/state.js").CwaCurrentResourceInterface | undefined>;
|
|
6
|
+
collectionItems: import("vue").ComputedRef<CwaResource[] | undefined>;
|
|
7
|
+
isLoadingCollection: Ref<boolean, boolean>;
|
|
8
|
+
pageModel: Ref<any, any>;
|
|
9
|
+
totalPages: Ref<number, number>;
|
|
10
|
+
goToNextPage: () => void;
|
|
11
|
+
goToPreviousPage: () => void;
|
|
12
|
+
changePage: (newPageNumber: number) => void;
|
|
13
|
+
$cwa: import("../cwa.js").default;
|
|
14
|
+
getResource: () => import("vue").ComputedRef<import("../storage/stores/resources/state.js").CwaCurrentResourceInterface | undefined>;
|
|
15
|
+
exposeMeta: import("#imports").CwaResourceMeta;
|
|
16
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { computed, ref, watch } from "vue";
|
|
2
|
+
import { useRoute } from "vue-router";
|
|
3
|
+
import { useCwa, useCwaResource, useQueryBoundModel } from "#imports";
|
|
4
|
+
export const useCwaCollectionResource = (iri, ops) => {
|
|
5
|
+
const cwaResource = useCwaResource(iri, ops);
|
|
6
|
+
const resource = cwaResource.getResource();
|
|
7
|
+
const isLoadingCollection = ref(false);
|
|
8
|
+
const fetchedCollectionItems = ref();
|
|
9
|
+
const loadCounter = ref(0);
|
|
10
|
+
const $cwa = useCwa();
|
|
11
|
+
const route = useRoute();
|
|
12
|
+
const { model: pageModel } = useQueryBoundModel("page", { defaultValue: 1, asNumber: true });
|
|
13
|
+
const collectionItems = computed(() => {
|
|
14
|
+
return fetchedCollectionItems.value || resource.value?.data?.collection?.["hydra:member"];
|
|
15
|
+
});
|
|
16
|
+
const dataResourceIri = computed(() => {
|
|
17
|
+
return resource.value?.data?.resourceIri;
|
|
18
|
+
});
|
|
19
|
+
const totalPages = ref(1);
|
|
20
|
+
function populateCollectionData(resource2) {
|
|
21
|
+
if (resource2?.collection?.["hydra:member"]) {
|
|
22
|
+
fetchedCollectionItems.value = resource2?.collection?.["hydra:member"];
|
|
23
|
+
const lastPagePath = resource2?.collection?.["hydra:view"]?.["hydra:last"];
|
|
24
|
+
if (!lastPagePath) {
|
|
25
|
+
totalPages.value = 1;
|
|
26
|
+
} else {
|
|
27
|
+
const urlParams = new URLSearchParams(lastPagePath.split("?")[1]);
|
|
28
|
+
const pageQueryParam = urlParams.get("page");
|
|
29
|
+
totalPages.value = pageQueryParam ? parseInt(pageQueryParam) || 1 : 1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async function reloadCollection() {
|
|
34
|
+
if (!dataResourceIri.value) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const currentLoadCounter = ++loadCounter.value;
|
|
38
|
+
isLoadingCollection.value = true;
|
|
39
|
+
const { response } = $cwa.fetch({ path: iri.value });
|
|
40
|
+
const { _data: resource2 } = await response;
|
|
41
|
+
if (currentLoadCounter === loadCounter.value) {
|
|
42
|
+
populateCollectionData(resource2);
|
|
43
|
+
isLoadingCollection.value = false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function goToNextPage() {
|
|
47
|
+
if (pageModel.value >= totalPages.value) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
changePage(pageModel.value + 1);
|
|
51
|
+
}
|
|
52
|
+
function goToPreviousPage() {
|
|
53
|
+
if (!pageModel.value || pageModel.value <= 1) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
changePage(pageModel.value - 1);
|
|
57
|
+
}
|
|
58
|
+
function changePage(newPageNumber) {
|
|
59
|
+
pageModel.value = newPageNumber;
|
|
60
|
+
}
|
|
61
|
+
if (route) {
|
|
62
|
+
watch(() => route.query, async (newQuery, oldQuery) => {
|
|
63
|
+
const cleanPaginationFromQuery = (q) => {
|
|
64
|
+
const cleanQuery = { ...q };
|
|
65
|
+
delete cleanQuery.perPage;
|
|
66
|
+
delete cleanQuery.page;
|
|
67
|
+
return cleanQuery;
|
|
68
|
+
};
|
|
69
|
+
const cleanedOld = cleanPaginationFromQuery(oldQuery);
|
|
70
|
+
const cleanedNew = cleanPaginationFromQuery(newQuery);
|
|
71
|
+
if (JSON.stringify(cleanedOld) !== JSON.stringify(cleanedNew)) {
|
|
72
|
+
pageModel.value = 1;
|
|
73
|
+
}
|
|
74
|
+
if (JSON.stringify(oldQuery) === JSON.stringify(newQuery)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
await reloadCollection();
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
populateCollectionData(resource.value?.data);
|
|
81
|
+
return {
|
|
82
|
+
...cwaResource,
|
|
83
|
+
resource,
|
|
84
|
+
collectionItems,
|
|
85
|
+
isLoadingCollection,
|
|
86
|
+
pageModel,
|
|
87
|
+
totalPages,
|
|
88
|
+
goToNextPage,
|
|
89
|
+
goToPreviousPage,
|
|
90
|
+
changePage
|
|
91
|
+
};
|
|
92
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export declare const useCwaImage: (iri: Ref<string>, imagineFilterName?: string) => {
|
|
3
|
+
contentUrl: import("vue").ComputedRef<string | undefined>;
|
|
4
|
+
displayMedia: import("vue").ComputedRef<{
|
|
5
|
+
contentUrl: string;
|
|
6
|
+
fileSize: number;
|
|
7
|
+
mimeType: string;
|
|
8
|
+
formattedFileSize: string;
|
|
9
|
+
imagineFilter?: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
} | undefined>;
|
|
13
|
+
handleLoad: () => void;
|
|
14
|
+
loaded: Ref<boolean, boolean>;
|
|
15
|
+
resource: import("vue").ComputedRef<import("../storage/stores/resources/state.js").CwaCurrentResourceInterface | undefined>;
|
|
16
|
+
$cwa: import("../cwa.js").default;
|
|
17
|
+
getResource: () => import("vue").ComputedRef<import("../storage/stores/resources/state.js").CwaCurrentResourceInterface | undefined>;
|
|
18
|
+
exposeMeta: import("#imports").CwaResourceMeta;
|
|
19
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { computed, onMounted, ref } from "vue";
|
|
2
|
+
import { useCwaResourceEndpoint } from "#cwa/runtime/composables/cwa-resource-endpoint";
|
|
3
|
+
import { useCwaResource } from "#imports";
|
|
4
|
+
export const useCwaImage = (iri, imagineFilterName) => {
|
|
5
|
+
const cwaResource = useCwaResource(iri);
|
|
6
|
+
const { query } = useCwaResourceEndpoint(iri);
|
|
7
|
+
const resource = cwaResource.getResource();
|
|
8
|
+
const loaded = ref(false);
|
|
9
|
+
const image = ref();
|
|
10
|
+
function handleLoad() {
|
|
11
|
+
loaded.value = true;
|
|
12
|
+
}
|
|
13
|
+
const imageFileMediaObjects = computed(() => {
|
|
14
|
+
return resource.value?.data?._metadata.mediaObjects?.file;
|
|
15
|
+
});
|
|
16
|
+
const displayMedia = computed(() => {
|
|
17
|
+
if (!imageFileMediaObjects.value || !imageFileMediaObjects.value.length) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const thumbnail = imageFileMediaObjects.value.filter(({ imagineFilter }) => imagineFilter === imagineFilterName);
|
|
21
|
+
return thumbnail?.[0] || imageFileMediaObjects.value[0];
|
|
22
|
+
});
|
|
23
|
+
const contentUrl = computed(() => {
|
|
24
|
+
const mediaUrl = displayMedia.value?.contentUrl;
|
|
25
|
+
if (!mediaUrl) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
return `${mediaUrl}${query.value}`;
|
|
29
|
+
});
|
|
30
|
+
onMounted(() => {
|
|
31
|
+
if (image.value?.complete || image.value?.naturalHeight !== 0) {
|
|
32
|
+
handleLoad();
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
...cwaResource,
|
|
37
|
+
contentUrl,
|
|
38
|
+
displayMedia,
|
|
39
|
+
handleLoad,
|
|
40
|
+
loaded,
|
|
41
|
+
resource
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useRouter, useRoute } from "vue-router";
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
|
+
import { debounce } from "lodash-es";
|
|
4
|
+
export const useQueryBoundModel = (queryParam, ops) => {
|
|
5
|
+
const route = useRoute();
|
|
6
|
+
const router = useRouter();
|
|
7
|
+
let debounced;
|
|
8
|
+
const exp = new RegExp(`^${queryParam}\\[([a-zA-Z0-9]+)]$`, "i");
|
|
9
|
+
const matchingQueryParams = computed(() => {
|
|
10
|
+
if (!route) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
if (Array.isArray(queryParam)) {
|
|
14
|
+
const foundParams = [];
|
|
15
|
+
for (const p of queryParam) {
|
|
16
|
+
route.query[p] && foundParams.push(p);
|
|
17
|
+
}
|
|
18
|
+
return foundParams;
|
|
19
|
+
}
|
|
20
|
+
if (route.query[queryParam]) {
|
|
21
|
+
return [queryParam];
|
|
22
|
+
}
|
|
23
|
+
const allQueryParams = Object.keys(route.query);
|
|
24
|
+
return allQueryParams.filter((param) => exp.test(param));
|
|
25
|
+
});
|
|
26
|
+
const matchedQueryParamValue = computed(() => {
|
|
27
|
+
const matchingParams = matchingQueryParams.value;
|
|
28
|
+
if (!matchingParams || !matchingParams.length || !route) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const normalizeValueAsArray = (valueIsArray, value) => {
|
|
32
|
+
if (Array.isArray(value)) {
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
if (valueIsArray) {
|
|
36
|
+
return [value];
|
|
37
|
+
}
|
|
38
|
+
return ops?.asNumber && value !== null ? Number(value) : value;
|
|
39
|
+
};
|
|
40
|
+
if (Array.isArray(queryParam)) {
|
|
41
|
+
for (const p of queryParam) {
|
|
42
|
+
const valueIsArray = p.endsWith("[]");
|
|
43
|
+
if (route.query[p]) {
|
|
44
|
+
return normalizeValueAsArray(valueIsArray, route.query[p]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
} else if (route.query[queryParam]) {
|
|
48
|
+
const valueIsArray = queryParam.endsWith("[]");
|
|
49
|
+
return normalizeValueAsArray(valueIsArray, route.query[queryParam]);
|
|
50
|
+
}
|
|
51
|
+
const matches = matchingParams[0].match(exp);
|
|
52
|
+
if (!matches || matches.length < 2) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const matchingObjectKey = matches[1];
|
|
56
|
+
if (matchingParams.length && matchingObjectKey) {
|
|
57
|
+
return { [matchingObjectKey]: route.query[matchingParams[0]] };
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
});
|
|
61
|
+
const model = ref(matchedQueryParamValue.value !== null ? matchedQueryParamValue.value : ops?.defaultValue);
|
|
62
|
+
watch(matchedQueryParamValue, (newValue) => {
|
|
63
|
+
model.value = newValue;
|
|
64
|
+
});
|
|
65
|
+
watch(model, async (newValue) => {
|
|
66
|
+
if (debounced) {
|
|
67
|
+
debounced.cancel();
|
|
68
|
+
}
|
|
69
|
+
if (!route) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const filteredKeys = Object.keys(route.query).filter((key) => !matchingQueryParams.value.includes(key));
|
|
73
|
+
const newQuery = {};
|
|
74
|
+
for (const retainedKey of filteredKeys) {
|
|
75
|
+
newQuery[retainedKey] = route.query[retainedKey];
|
|
76
|
+
}
|
|
77
|
+
const isObj = Object.prototype.toString.call(newValue) === "[object Object]";
|
|
78
|
+
if (isObj) {
|
|
79
|
+
for (const newValueKey of Object.keys(newValue)) {
|
|
80
|
+
if (!newValue[newValueKey]) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (Array.isArray(queryParam)) {
|
|
84
|
+
for (const p of queryParam) {
|
|
85
|
+
newQuery[`${p}[${newValueKey}]`] = newValue[newValueKey];
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
newQuery[`${queryParam}[${newValueKey}]`] = newValue[newValueKey];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} else if (newValue && (!Array.isArray(newValue) || newValue.length)) {
|
|
92
|
+
if (Array.isArray(queryParam)) {
|
|
93
|
+
for (const p of queryParam) {
|
|
94
|
+
newQuery[p] = newValue;
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
newQuery[queryParam] = newValue;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
debounced = debounce(async () => {
|
|
101
|
+
await router.replace({ query: newQuery });
|
|
102
|
+
}, ops?.delay || 10);
|
|
103
|
+
await debounced();
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
model
|
|
107
|
+
};
|
|
108
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { computed, onBeforeUnmount, ref, watch, watchEffect } from "vue";
|
|
2
|
+
import { getPublishedResourceState } from "#cwa/runtime/resources/resource-utils";
|
|
3
|
+
import { useCwa } from "#cwa/runtime/composables/cwa";
|
|
4
|
+
export const useCwaResourceEndpoint = (iri, postfix) => {
|
|
5
|
+
const $cwa = useCwa();
|
|
6
|
+
const resource = computed(() => iri.value ? $cwa.resources.getResource(iri.value).value : void 0);
|
|
7
|
+
const forcePublishedVersion = $cwa.admin.resourceStackManager.forcePublishedVersion;
|
|
8
|
+
const applyPostfix = ref(false);
|
|
9
|
+
const query = ref("");
|
|
10
|
+
const unwatchEffect = watchEffect(() => {
|
|
11
|
+
if (!resource.value) {
|
|
12
|
+
applyPostfix.value = false;
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const publishableState = getPublishedResourceState(resource.value);
|
|
16
|
+
applyPostfix.value = (forcePublishedVersion.value !== void 0 || !$cwa.admin.isEditing) && publishableState === true;
|
|
17
|
+
});
|
|
18
|
+
const unwatchApplyPostfix = watch(applyPostfix, (newApplyPostfix) => {
|
|
19
|
+
if (!newApplyPostfix) {
|
|
20
|
+
query.value = "";
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
query.value = forcePublishedVersion.value || !$cwa.admin.isEditing ? "?published=true" : "?published=false";
|
|
24
|
+
}, {
|
|
25
|
+
immediate: true
|
|
26
|
+
});
|
|
27
|
+
const endpoint = computed(() => `${iri.value}${postfix || ""}${query.value}`);
|
|
28
|
+
onBeforeUnmount(() => {
|
|
29
|
+
unwatchEffect();
|
|
30
|
+
unwatchApplyPostfix();
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
endpoint,
|
|
34
|
+
query
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComponentPublicInstance, type Ref } from 'vue';
|
|
2
|
+
import type { ManageableResourceOps } from '../admin/manageable-resource.js';
|
|
3
|
+
import ManageableResource from '../admin/manageable-resource.js';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* @description Advanced usage - usually this composable will be initialised from useCwaResource where disableManager does not equal true. Primarily separated for the ComponentGroup component
|
|
7
|
+
*/
|
|
8
|
+
export declare const useCwaResourceManageable: (iri: Ref<string | undefined>, ops?: ManageableResourceOps, proxy?: ComponentPublicInstance) => {
|
|
9
|
+
manager: ManageableResource;
|
|
10
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCurrentInstance,
|
|
3
|
+
onBeforeUnmount,
|
|
4
|
+
onMounted,
|
|
5
|
+
ref
|
|
6
|
+
} from "vue";
|
|
7
|
+
import ManageableResource from "../admin/manageable-resource.js";
|
|
8
|
+
import { useCwa } from "./cwa.js";
|
|
9
|
+
export const useCwaResourceManageable = (iri, ops, proxy) => {
|
|
10
|
+
const useProxy = proxy || getCurrentInstance()?.proxy;
|
|
11
|
+
if (!useProxy) {
|
|
12
|
+
throw new Error(`Cannot initialise manager for resource. Instance is not defined with iri '${iri.value}'`);
|
|
13
|
+
}
|
|
14
|
+
const $cwa = useCwa();
|
|
15
|
+
const manageableResource = new ManageableResource(useProxy, $cwa, ops || ref({}));
|
|
16
|
+
onMounted(() => {
|
|
17
|
+
manageableResource.init(iri);
|
|
18
|
+
iri.value && $cwa.admin.eventBus.emit("componentMounted", iri.value);
|
|
19
|
+
$cwa.admin.eventBus.on("manageableComponentMounted", (iriMounted) => {
|
|
20
|
+
if (iriMounted === iri.value) {
|
|
21
|
+
manageableResource.initNewIri();
|
|
22
|
+
$cwa.admin.eventBus.emit("componentMounted", iri.value);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
onBeforeUnmount(() => {
|
|
27
|
+
manageableResource.clear();
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
manager: manageableResource
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
export interface CwaResourceManagerTabOptions {
|
|
3
|
+
name: string;
|
|
4
|
+
order?: number;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface CwaResourceManagerTabMeta extends Pick<CwaResourceManagerTabOptions, 'name' | 'order'> {
|
|
8
|
+
disabled: Ref<boolean>;
|
|
9
|
+
}
|
|
10
|
+
export declare const useCwaResourceManagerTab: (options: CwaResourceManagerTabOptions) => {
|
|
11
|
+
$cwa: import("../cwa.js").default;
|
|
12
|
+
iri: import("vue").ComputedRef<string | undefined>;
|
|
13
|
+
resource: import("vue").ComputedRef<import("../storage/stores/resources/state.js").CwaCurrentResourceInterface | undefined>;
|
|
14
|
+
exposeMeta: CwaResourceManagerTabMeta;
|
|
15
|
+
createComputedState: <T = any>(propName: string, initialValue?: T) => import("vue").WritableComputedRef<T, T>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { computed, ref } from "vue";
|
|
2
|
+
import { useCwa } from "#cwa/runtime/composables/cwa";
|
|
3
|
+
export const useCwaResourceManagerTab = (options) => {
|
|
4
|
+
const $cwa = useCwa();
|
|
5
|
+
const iri = $cwa.admin.resourceStackManager.currentIri;
|
|
6
|
+
const resource = computed(() => iri.value ? $cwa.resources.getResource(iri.value).value : void 0);
|
|
7
|
+
const exposeMeta = {
|
|
8
|
+
name: options.name,
|
|
9
|
+
order: options.order,
|
|
10
|
+
disabled: ref(options.disabled || false)
|
|
11
|
+
};
|
|
12
|
+
function createComputedState(propName, initialValue) {
|
|
13
|
+
initialValue !== void 0 && $cwa.admin.resourceStackManager.getState(propName) === void 0 && $cwa.admin.resourceStackManager.setState(propName, initialValue);
|
|
14
|
+
return computed({
|
|
15
|
+
get() {
|
|
16
|
+
return $cwa.admin.resourceStackManager.getState(propName);
|
|
17
|
+
},
|
|
18
|
+
set(val) {
|
|
19
|
+
$cwa.admin.resourceStackManager.setState(propName, val);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
$cwa,
|
|
25
|
+
iri,
|
|
26
|
+
resource,
|
|
27
|
+
exposeMeta,
|
|
28
|
+
createComputedState
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
interface ResourceModelOps {
|
|
3
|
+
longWaitThreshold?: number;
|
|
4
|
+
debounceTime?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const useCwaResourceModel: <T>(iri: Ref<string | undefined>, property: string | string[], ops?: ResourceModelOps) => {
|
|
7
|
+
states: {
|
|
8
|
+
pendingSubmit: Ref<boolean, boolean>;
|
|
9
|
+
submitting: Ref<boolean, boolean>;
|
|
10
|
+
isBusy: import("vue").ComputedRef<boolean>;
|
|
11
|
+
isLongWait: Ref<boolean, boolean>;
|
|
12
|
+
};
|
|
13
|
+
resetValue: (resetIri?: string) => void;
|
|
14
|
+
model: import("vue").WritableComputedRef<T | null | undefined, T | null | undefined>;
|
|
15
|
+
localValueWithIri: Ref<{
|
|
16
|
+
[iri: string]: T | null | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
[iri: string]: T | null | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { computed, getCurrentInstance, onBeforeUnmount, ref, watch } from "vue";
|
|
2
|
+
import { debounce, get, isObject, set } from "lodash-es";
|
|
3
|
+
import { useCwa } from "#cwa/runtime/composables/cwa";
|
|
4
|
+
import { useCwaResourceEndpoint } from "#cwa/runtime/composables/cwa-resource-endpoint";
|
|
5
|
+
export const useCwaResourceModel = (iri, property, ops) => {
|
|
6
|
+
const proxy = getCurrentInstance()?.proxy;
|
|
7
|
+
const source = `input_${proxy?.$?.uid}`;
|
|
8
|
+
const $cwa = useCwa();
|
|
9
|
+
const resource = computed(() => iri.value ? $cwa.resources.getResource(iri.value).value : void 0);
|
|
10
|
+
const { endpoint } = useCwaResourceEndpoint(iri);
|
|
11
|
+
const storeValue = computed(() => resource.value?.data ? get(resource.value.data, property) : void 0);
|
|
12
|
+
const rootProperty = computed(() => {
|
|
13
|
+
if (Array.isArray(property)) {
|
|
14
|
+
return property[0];
|
|
15
|
+
}
|
|
16
|
+
return property.split(".")[0].split("[")[0];
|
|
17
|
+
});
|
|
18
|
+
const rootStoreValue = computed(() => resource.value?.data ? get(resource.value.data, rootProperty.value) : void 0);
|
|
19
|
+
const localValueWithIri = ref({});
|
|
20
|
+
const localValue = computed({
|
|
21
|
+
get() {
|
|
22
|
+
if (!iri.value) {
|
|
23
|
+
return void 0;
|
|
24
|
+
}
|
|
25
|
+
return localValueWithIri.value[iri.value];
|
|
26
|
+
},
|
|
27
|
+
set(newValue) {
|
|
28
|
+
if (!iri.value) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
localValueWithIri.value[iri.value] = newValue;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const pendingSubmit = ref(false);
|
|
35
|
+
const isLongWait = ref(false);
|
|
36
|
+
const longWaitThreshold = ops?.longWaitThreshold || 5e3;
|
|
37
|
+
const debounceTime = ops?.debounceTime !== void 0 ? ops.debounceTime : 250;
|
|
38
|
+
let debounced;
|
|
39
|
+
const isBusy = computed(() => pendingSubmit.value || isSubmitting.value);
|
|
40
|
+
const isSubmitting = ref(false);
|
|
41
|
+
const lastSubmittedValueInProgress = ref();
|
|
42
|
+
function isEqual(value1, value2) {
|
|
43
|
+
function requiresNormalizing(value) {
|
|
44
|
+
const type = typeof value;
|
|
45
|
+
return value !== void 0 && value !== null && (type === "object" || Array.isArray(value));
|
|
46
|
+
}
|
|
47
|
+
function getNormalizedValue(value) {
|
|
48
|
+
return requiresNormalizing(value) ? JSON.stringify(value) : value;
|
|
49
|
+
}
|
|
50
|
+
return getNormalizedValue(value1) === getNormalizedValue(value2);
|
|
51
|
+
}
|
|
52
|
+
async function updateResource(newLocalValue) {
|
|
53
|
+
const submittingIri = iri.value;
|
|
54
|
+
if (!submittingIri) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const isNewValueObject = isObject(newLocalValue);
|
|
58
|
+
isNewValueObject && await $cwa.resourcesManager.getWaitForRequestPromise(endpoint.value, rootProperty.value, source);
|
|
59
|
+
if (resource.value === void 0 || isSubmitting.value && isEqual(lastSubmittedValueInProgress.value, newLocalValue)) {
|
|
60
|
+
resetValue();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (!isSubmitting.value && isEqual(storeValue.value, newLocalValue)) {
|
|
64
|
+
pendingSubmit.value = false;
|
|
65
|
+
resetValue();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
isSubmitting.value = true;
|
|
69
|
+
let submittingValue;
|
|
70
|
+
if (isNewValueObject) {
|
|
71
|
+
const newObject = set({ [rootProperty.value]: { ...rootStoreValue.value } }, property, newLocalValue);
|
|
72
|
+
submittingValue = newObject[rootProperty.value];
|
|
73
|
+
} else {
|
|
74
|
+
submittingValue = newLocalValue;
|
|
75
|
+
}
|
|
76
|
+
lastSubmittedValueInProgress.value = submittingValue;
|
|
77
|
+
pendingSubmit.value = false;
|
|
78
|
+
const newResource = await $cwa.resourcesManager.updateResource({
|
|
79
|
+
endpoint: endpoint.value,
|
|
80
|
+
data: {
|
|
81
|
+
[rootProperty.value]: submittingValue
|
|
82
|
+
},
|
|
83
|
+
source
|
|
84
|
+
});
|
|
85
|
+
const newIriReturned = newResource?.["@id"] && newResource["@id"] !== submittingIri;
|
|
86
|
+
if (newIriReturned) {
|
|
87
|
+
localValueWithIri.value[newResource["@id"]] = localValueWithIri.value[submittingIri];
|
|
88
|
+
resetValue(submittingIri);
|
|
89
|
+
}
|
|
90
|
+
isEqual(storeValue.value, submittingValue) && isEqual(storeValue.value, localValue.value) && resetValue();
|
|
91
|
+
}
|
|
92
|
+
function resetValue(resetIri) {
|
|
93
|
+
const useIri = resetIri || iri.value;
|
|
94
|
+
if (!useIri) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
localValueWithIri.value[useIri] = void 0;
|
|
98
|
+
}
|
|
99
|
+
const unwatchLocalValue = watch(localValue, (newLocalValue) => {
|
|
100
|
+
if (newLocalValue === void 0) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (debounced) {
|
|
104
|
+
debounced.cancel();
|
|
105
|
+
}
|
|
106
|
+
pendingSubmit.value = true;
|
|
107
|
+
debounced = debounce(() => updateResource(newLocalValue), debounceTime);
|
|
108
|
+
debounced();
|
|
109
|
+
});
|
|
110
|
+
let longWaitTimeoutFn;
|
|
111
|
+
const unwatchIsBusy = watch(isBusy, (newBusy) => {
|
|
112
|
+
if (!newBusy) {
|
|
113
|
+
isLongWait.value = false;
|
|
114
|
+
if (longWaitTimeoutFn) {
|
|
115
|
+
clearTimeout(longWaitTimeoutFn);
|
|
116
|
+
}
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
longWaitTimeoutFn = setTimeout(() => {
|
|
120
|
+
isLongWait.value = true;
|
|
121
|
+
}, longWaitThreshold);
|
|
122
|
+
});
|
|
123
|
+
const model = computed({
|
|
124
|
+
get() {
|
|
125
|
+
if (localValue.value !== void 0) {
|
|
126
|
+
return localValue.value;
|
|
127
|
+
}
|
|
128
|
+
return storeValue.value || null;
|
|
129
|
+
},
|
|
130
|
+
set(value) {
|
|
131
|
+
localValue.value = value;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
onBeforeUnmount(() => {
|
|
135
|
+
unwatchLocalValue();
|
|
136
|
+
unwatchIsBusy();
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
states: {
|
|
140
|
+
pendingSubmit,
|
|
141
|
+
submitting: isSubmitting,
|
|
142
|
+
isBusy,
|
|
143
|
+
isLongWait
|
|
144
|
+
},
|
|
145
|
+
resetValue,
|
|
146
|
+
model,
|
|
147
|
+
localValueWithIri
|
|
148
|
+
};
|
|
149
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComputedRef } from 'vue';
|
|
2
|
+
export declare const useCwaResourceUpload: (iri: ComputedRef<string | undefined>) => {
|
|
3
|
+
filenameInputModel: import("vue").Ref<string, string>;
|
|
4
|
+
updating: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
fileExists: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
handleInputChangeFile: (newFile: File | undefined) => Promise<void>;
|
|
7
|
+
handleInputDeleteFile: () => Promise<void>;
|
|
8
|
+
};
|