@cwa/nuxt-edge 0.0.0-29696494.72f11a4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/README.template.md +32 -0
- package/dist/layer/_components/TextButton.vue +13 -0
- package/dist/layer/error.vue +13 -0
- package/dist/layer/layouts/CwaRootLayout.vue +172 -0
- package/dist/layer/nuxt.config.ts +8 -0
- package/dist/layer/pages/_cwa/[cwaPage0].vue +18 -0
- package/dist/layer/pages/_cwa/index/composables/useDataList.ts +50 -0
- package/dist/layer/pages/_cwa/index/composables/useDataType.ts +41 -0
- package/dist/layer/pages/_cwa/index/composables/useDynamicPageLoader.ts +28 -0
- package/dist/layer/pages/_cwa/index/composables/useItemPage.ts +200 -0
- package/dist/layer/pages/_cwa/index/composables/useListPage.ts +44 -0
- package/dist/layer/pages/_cwa/index/composables/useParentPageDataLoader.ts +51 -0
- package/dist/layer/pages/_cwa/index/composables/useParentPageLoader.ts +25 -0
- package/dist/layer/pages/_cwa/index/data/[type]/[iri].vue +22 -0
- package/dist/layer/pages/_cwa/index/data/[type].vue +132 -0
- package/dist/layer/pages/_cwa/index/data/index.vue +84 -0
- package/dist/layer/pages/_cwa/index/layouts/[iri].vue +180 -0
- package/dist/layer/pages/_cwa/index/layouts.vue +77 -0
- package/dist/layer/pages/_cwa/index/pages/[iri].vue +16 -0
- package/dist/layer/pages/_cwa/index/pages.vue +130 -0
- package/dist/layer/pages/_cwa/index/routes.vue +56 -0
- package/dist/layer/pages/_cwa/index/settings.vue +398 -0
- package/dist/layer/pages/_cwa/index/users/[iri].vue +337 -0
- package/dist/layer/pages/_cwa/index/users.vue +90 -0
- package/dist/layer/pages/_cwa/index.vue +43 -0
- package/dist/layer/pages/confirm-new-email/[username]/[newEmail]/[token].vue +49 -0
- package/dist/layer/pages/forgot-password.vue +31 -0
- package/dist/layer/pages/login.vue +32 -0
- package/dist/layer/pages/reset-password/[username]/[token].vue +38 -0
- package/dist/layer/pages/verify-email/[username]/[token].vue +48 -0
- package/dist/module.d.mts +15 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +292 -0
- package/dist/runtime/admin/admin.d.ts +35 -0
- package/dist/runtime/admin/admin.js +65 -0
- package/dist/runtime/admin/manageable-resource.d.ts +42 -0
- package/dist/runtime/admin/manageable-resource.js +241 -0
- package/dist/runtime/admin/manager-tabs-resolver.d.ts +17 -0
- package/dist/runtime/admin/manager-tabs-resolver.js +55 -0
- package/dist/runtime/admin/navigation-guard.d.ts +18 -0
- package/dist/runtime/admin/navigation-guard.js +57 -0
- package/dist/runtime/admin/resource-stack-manager.d.ts +93 -0
- package/dist/runtime/admin/resource-stack-manager.js +388 -0
- package/dist/runtime/api/api-documentation.d.ts +28 -0
- package/dist/runtime/api/api-documentation.js +131 -0
- package/dist/runtime/api/auth.d.ts +100 -0
- package/dist/runtime/api/auth.js +264 -0
- package/dist/runtime/api/fetcher/cwa-fetch.d.ts +12 -0
- package/dist/runtime/api/fetcher/cwa-fetch.js +43 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.d.ts +59 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.js +225 -0
- package/dist/runtime/api/fetcher/fetcher.d.ts +57 -0
- package/dist/runtime/api/fetcher/fetcher.js +263 -0
- package/dist/runtime/api/fetcher/preload-headers.d.ts +6 -0
- package/dist/runtime/api/fetcher/preload-headers.js +31 -0
- package/dist/runtime/api/forms.d.ts +40 -0
- package/dist/runtime/api/forms.js +40 -0
- package/dist/runtime/api/mercure.d.ts +32 -0
- package/dist/runtime/api/mercure.js +196 -0
- package/dist/runtime/api/site-config.d.ts +36 -0
- package/dist/runtime/api/site-config.js +135 -0
- package/dist/runtime/composables/component/html-content.d.ts +2 -0
- package/dist/runtime/composables/component/html-content.js +74 -0
- package/dist/runtime/composables/cwa-collection-pagination.d.ts +13 -0
- package/dist/runtime/composables/cwa-collection-pagination.js +34 -0
- package/dist/runtime/composables/cwa-collection-resource.d.ts +18 -0
- package/dist/runtime/composables/cwa-collection-resource.js +105 -0
- package/dist/runtime/composables/cwa-image-resource.d.ts +15 -0
- package/dist/runtime/composables/cwa-image-resource.js +26 -0
- package/dist/runtime/composables/cwa-image.d.ts +24 -0
- package/dist/runtime/composables/cwa-image.js +38 -0
- package/dist/runtime/composables/cwa-query-bound-model.d.ts +9 -0
- package/dist/runtime/composables/cwa-query-bound-model.js +109 -0
- package/dist/runtime/composables/cwa-resource-endpoint.d.ts +5 -0
- package/dist/runtime/composables/cwa-resource-endpoint.js +36 -0
- package/dist/runtime/composables/cwa-resource-manageable.d.ts +10 -0
- package/dist/runtime/composables/cwa-resource-manageable.js +53 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.d.ts +16 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.js +30 -0
- package/dist/runtime/composables/cwa-resource-model.d.ts +21 -0
- package/dist/runtime/composables/cwa-resource-model.js +156 -0
- package/dist/runtime/composables/cwa-resource-upload.d.ts +8 -0
- package/dist/runtime/composables/cwa-resource-upload.js +70 -0
- package/dist/runtime/composables/cwa-resource.d.ts +26 -0
- package/dist/runtime/composables/cwa-resource.js +42 -0
- package/dist/runtime/composables/cwa-select-input.d.ts +21 -0
- package/dist/runtime/composables/cwa-select-input.js +37 -0
- package/dist/runtime/composables/cwa-select.d.ts +15 -0
- package/dist/runtime/composables/cwa-select.js +24 -0
- package/dist/runtime/composables/cwa.d.ts +2 -0
- package/dist/runtime/composables/cwa.js +2 -0
- package/dist/runtime/composables/forgot-password.d.ts +9 -0
- package/dist/runtime/composables/forgot-password.js +45 -0
- package/dist/runtime/composables/login.d.ts +9 -0
- package/dist/runtime/composables/login.js +30 -0
- package/dist/runtime/composables/popper.d.ts +529 -0
- package/dist/runtime/composables/popper.js +105 -0
- package/dist/runtime/composables/process.d.ts +4 -0
- package/dist/runtime/composables/process.js +6 -0
- package/dist/runtime/composables/reset-password.d.ts +14 -0
- package/dist/runtime/composables/reset-password.js +75 -0
- package/dist/runtime/composables/transitions.d.ts +12 -0
- package/dist/runtime/composables/transitions.js +12 -0
- package/dist/runtime/composables/useCwaResourceRoute.d.ts +10 -0
- package/dist/runtime/composables/useCwaResourceRoute.js +17 -0
- package/dist/runtime/composables/useCwaSiteConfig.d.ts +15 -0
- package/dist/runtime/composables/useCwaSiteConfig.js +78 -0
- package/dist/runtime/composables/useResendVerifyEmail.d.ts +6 -0
- package/dist/runtime/composables/useResendVerifyEmail.js +43 -0
- package/dist/runtime/composables/useVerifyEmail.d.ts +8 -0
- package/dist/runtime/composables/useVerifyEmail.js +84 -0
- package/dist/runtime/cwa.d.ts +70 -0
- package/dist/runtime/cwa.js +133 -0
- package/dist/runtime/errors/cwa-resource-error.d.ts +20 -0
- package/dist/runtime/errors/cwa-resource-error.js +61 -0
- package/dist/runtime/plugin.d.ts +8 -0
- package/dist/runtime/plugin.js +20 -0
- package/dist/runtime/resources/resource-utils.d.ts +52 -0
- package/dist/runtime/resources/resource-utils.js +86 -0
- package/dist/runtime/resources/resources-manager.d.ts +70 -0
- package/dist/runtime/resources/resources-manager.js +482 -0
- package/dist/runtime/resources/resources.d.ts +61 -0
- package/dist/runtime/resources/resources.js +360 -0
- package/dist/runtime/route-middleware.d.ts +2 -0
- package/dist/runtime/route-middleware.js +71 -0
- package/dist/runtime/server/cwa-custom-sitemap.get.d.ts +2 -0
- package/dist/runtime/server/cwa-custom-sitemap.get.js +29 -0
- package/dist/runtime/server/cwa-healthcheck.get.d.ts +4 -0
- package/dist/runtime/server/cwa-healthcheck.get.js +10 -0
- package/dist/runtime/server/cwa-urls.get.d.ts +3 -0
- package/dist/runtime/server/cwa-urls.get.js +15 -0
- package/dist/runtime/server/server-middleware.d.ts +2 -0
- package/dist/runtime/server/server-middleware.js +63 -0
- package/dist/runtime/server/server-plugin.d.ts +2 -0
- package/dist/runtime/server/server-plugin.js +59 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/useFetcher.d.ts +7 -0
- package/dist/runtime/server/useFetcher.js +40 -0
- package/dist/runtime/storage/storage.d.ts +25 -0
- package/dist/runtime/storage/storage.js +48 -0
- package/dist/runtime/storage/stores/admin/actions.d.ts +5 -0
- package/dist/runtime/storage/stores/admin/actions.js +10 -0
- package/dist/runtime/storage/stores/admin/admin-store.d.ts +18 -0
- package/dist/runtime/storage/stores/admin/admin-store.js +20 -0
- package/dist/runtime/storage/stores/admin/state.d.ts +7 -0
- package/dist/runtime/storage/stores/admin/state.js +9 -0
- package/dist/runtime/storage/stores/api-documentation/api-documentation-store.d.ts +16 -0
- package/dist/runtime/storage/stores/api-documentation/api-documentation-store.js +18 -0
- package/dist/runtime/storage/stores/api-documentation/state.d.ts +71 -0
- package/dist/runtime/storage/stores/api-documentation/state.js +6 -0
- package/dist/runtime/storage/stores/auth/auth-store.d.ts +16 -0
- package/dist/runtime/storage/stores/auth/auth-store.js +18 -0
- package/dist/runtime/storage/stores/auth/state.d.ts +19 -0
- package/dist/runtime/storage/stores/auth/state.js +15 -0
- package/dist/runtime/storage/stores/cwa-store-types.d.ts +14 -0
- package/dist/runtime/storage/stores/error/actions.d.ts +11 -0
- package/dist/runtime/storage/stores/error/actions.js +73 -0
- package/dist/runtime/storage/stores/error/error-store.d.ts +13 -0
- package/dist/runtime/storage/stores/error/error-store.js +21 -0
- package/dist/runtime/storage/stores/error/getters.d.ts +7 -0
- package/dist/runtime/storage/stores/error/getters.js +11 -0
- package/dist/runtime/storage/stores/error/state.d.ts +35 -0
- package/dist/runtime/storage/stores/error/state.js +15 -0
- package/dist/runtime/storage/stores/fetcher/actions.d.ts +56 -0
- package/dist/runtime/storage/stores/fetcher/actions.js +138 -0
- package/dist/runtime/storage/stores/fetcher/fetcher-store.d.ts +19 -0
- package/dist/runtime/storage/stores/fetcher/fetcher-store.js +23 -0
- package/dist/runtime/storage/stores/fetcher/getter-utils.d.ts +7 -0
- package/dist/runtime/storage/stores/fetcher/getter-utils.js +27 -0
- package/dist/runtime/storage/stores/fetcher/getters.d.ts +13 -0
- package/dist/runtime/storage/stores/fetcher/getters.js +52 -0
- package/dist/runtime/storage/stores/fetcher/state.d.ts +27 -0
- package/dist/runtime/storage/stores/fetcher/state.js +7 -0
- package/dist/runtime/storage/stores/mercure/mercure-store.d.ts +16 -0
- package/dist/runtime/storage/stores/mercure/mercure-store.js +18 -0
- package/dist/runtime/storage/stores/mercure/state.d.ts +5 -0
- package/dist/runtime/storage/stores/mercure/state.js +6 -0
- package/dist/runtime/storage/stores/resources/actions.d.ts +59 -0
- package/dist/runtime/storage/stores/resources/actions.js +449 -0
- package/dist/runtime/storage/stores/resources/getter-utils.d.ts +7 -0
- package/dist/runtime/storage/stores/resources/getter-utils.js +27 -0
- package/dist/runtime/storage/stores/resources/getters.d.ts +38 -0
- package/dist/runtime/storage/stores/resources/getters.js +254 -0
- package/dist/runtime/storage/stores/resources/resources-store.d.ts +19 -0
- package/dist/runtime/storage/stores/resources/resources-store.js +23 -0
- package/dist/runtime/storage/stores/resources/state.d.ts +67 -0
- package/dist/runtime/storage/stores/resources/state.js +24 -0
- package/dist/runtime/storage/stores/site-config/actions.d.ts +9 -0
- package/dist/runtime/storage/stores/site-config/actions.js +20 -0
- package/dist/runtime/storage/stores/site-config/getters.d.ts +7 -0
- package/dist/runtime/storage/stores/site-config/getters.js +10 -0
- package/dist/runtime/storage/stores/site-config/site-config-store.d.ts +19 -0
- package/dist/runtime/storage/stores/site-config/site-config-store.js +23 -0
- package/dist/runtime/storage/stores/site-config/state.d.ts +13 -0
- package/dist/runtime/storage/stores/site-config/state.js +8 -0
- package/dist/runtime/templates/assets/base.css +1 -0
- package/dist/runtime/templates/assets/cwa.css +1 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.d.vue.ts +7 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue +27 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue.d.ts +7 -0
- package/dist/runtime/templates/components/core/ComponentPosition.d.vue.ts +4 -0
- package/dist/runtime/templates/components/core/ComponentPosition.spec.ts.snap +16 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue +64 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue.d.ts +4 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue +41 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/DialogBox.d.vue.ts +38 -0
- package/dist/runtime/templates/components/core/DialogBox.vue +96 -0
- package/dist/runtime/templates/components/core/DialogBox.vue.d.ts +38 -0
- package/dist/runtime/templates/components/core/README.md +1 -0
- package/dist/runtime/templates/components/core/ResourceLoader.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/ResourceLoader.spec.ts.snap +39 -0
- package/dist/runtime/templates/components/core/ResourceLoader.vue +151 -0
- package/dist/runtime/templates/components/core/ResourceLoader.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.vue +7 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue +11 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContent.d.vue.ts +24 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue +137 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue.d.ts +24 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.d.vue.ts +10 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue +49 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue.d.ts +10 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue +53 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.d.vue.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue +33 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue.d.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue +94 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue +19 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.d.vue.ts +13 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue +404 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue.d.ts +13 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue +368 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.vue +439 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.d.vue.ts +35 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue +110 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue.d.ts +35 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.d.vue.ts +7 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue +27 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue.d.ts +7 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.d.vue.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue +24 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.d.vue.ts +0 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue +81 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue.d.ts +0 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.vue +42 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.d.vue.ts +21 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue +102 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue.d.ts +21 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.d.vue.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue +62 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue.d.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue +264 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.d.vue.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.vue +45 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.vue.d.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.d.vue.ts +24 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.vue +139 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.vue.d.ts +24 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.vue +74 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue +19 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.d.vue.ts +8 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue +86 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue.d.ts +8 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue +24 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue +57 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.vue +23 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue +100 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.d.vue.ts +9 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue +112 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue +21 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue +15 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconData.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue +24 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue +20 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconPages.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue +21 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue +23 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue +13 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/useDataResolver.d.ts +12 -0
- package/dist/runtime/templates/components/core/useDataResolver.js +113 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.d.ts +6 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.js +166 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.d.ts +22 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.js +102 -0
- package/dist/runtime/templates/components/main/ComponentGroup.d.vue.ts +13 -0
- package/dist/runtime/templates/components/main/ComponentGroup.spec.ts.snap +68 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue +138 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue.d.ts +13 -0
- package/dist/runtime/templates/components/main/CwaLink.d.vue.ts +14 -0
- package/dist/runtime/templates/components/main/CwaLink.vue +55 -0
- package/dist/runtime/templates/components/main/CwaLink.vue.d.ts +14 -0
- package/dist/runtime/templates/components/main/CwaPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/CwaPage.vue +22 -0
- package/dist/runtime/templates/components/main/CwaPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/DefaultLayout.d.vue.ts +12 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue +12 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/ErrorPage.d.vue.ts +7 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue +134 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/Logo.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/Logo.vue +18 -0
- package/dist/runtime/templates/components/main/Logo.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/README.md +7 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.d.vue.ts +12 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue +41 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue +48 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.d.ts +5 -0
- package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.js +19 -0
- package/dist/runtime/templates/components/main/admin/header/Header.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue +209 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue +155 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.d.vue.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue.d.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.d.vue.ts +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue +20 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue.d.ts +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.d.vue.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue +70 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue.d.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue +19 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue +79 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue +52 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.d.vue.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue +159 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue.d.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.d.vue.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue +198 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue.d.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.d.vue.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue +186 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue.d.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue +208 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.d.vue.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue +38 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue.d.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.d.vue.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue +15 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue.d.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.d.vue.ts +14 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue +44 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue.d.ts +14 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue +67 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue +75 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue +41 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue +114 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue +34 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue +104 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue +52 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.d.vue.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue +94 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue.d.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.d.vue.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue +59 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue.d.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue +28 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.d.vue.ts +26 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue +56 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue.d.ts +26 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.d.vue.ts +28 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue +61 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue.d.ts +28 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.d.vue.ts +28 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue +59 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue.d.ts +28 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.d.vue.ts +7 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.spec.ts.snap +14 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue +17 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.d.vue.ts +25 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.spec.ts.snap +90 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue +59 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue.d.ts +25 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.d.vue.ts +22 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.spec.ts.snap +111 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.vue +50 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.vue.d.ts +22 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue +1071 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/Hamburger.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue +75 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/ProgressBar.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/ProgressBar.spec.ts.snap +71 -0
- package/dist/runtime/templates/components/ui/ProgressBar.vue +29 -0
- package/dist/runtime/templates/components/ui/ProgressBar.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/README.md +6 -0
- package/dist/runtime/templates/components/ui/alert/Info.d.vue.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Info.spec.ts.snap +23 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue +17 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue.d.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Warning.d.vue.ts +13 -0
- package/dist/runtime/templates/components/ui/alert/Warning.spec.ts.snap +18 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue +13 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue.d.ts +13 -0
- package/dist/runtime/templates/components/ui/form/Button.d.vue.ts +53 -0
- package/dist/runtime/templates/components/ui/form/Button.vue +139 -0
- package/dist/runtime/templates/components/ui/form/Button.vue.d.ts +53 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue +18 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue +15 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/form/File.d.vue.ts +18 -0
- package/dist/runtime/templates/components/ui/form/File.vue +72 -0
- package/dist/runtime/templates/components/ui/form/File.vue.d.ts +18 -0
- package/dist/runtime/templates/components/ui/form/Input.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/form/Input.vue +17 -0
- package/dist/runtime/templates/components/ui/form/Input.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.d.vue.ts +15 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue +17 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue.d.ts +15 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.d.vue.ts +15 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.vue +212 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.vue.d.ts +15 -0
- package/dist/runtime/templates/components/ui/form/Select.d.vue.ts +8 -0
- package/dist/runtime/templates/components/ui/form/Select.vue +60 -0
- package/dist/runtime/templates/components/ui/form/Select.vue.d.ts +8 -0
- package/dist/runtime/templates/components/ui/form/Toggle.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue +48 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue +30 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue +12 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue +10 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue +23 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue +11 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue +15 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/utils/ContextMenu.d.vue.ts +27 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue +60 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue.d.ts +27 -0
- package/dist/runtime/templates/components/utils/HotSpot.d.vue.ts +12 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue +28 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue.d.ts +12 -0
- package/dist/runtime/templates/components/utils/README.md +1 -0
- package/dist/runtime/templates/components/utils/Spinner.d.vue.ts +7 -0
- package/dist/runtime/templates/components/utils/Spinner.spec.ts.snap +56 -0
- package/dist/runtime/templates/components/utils/Spinner.vue +44 -0
- package/dist/runtime/templates/components/utils/Spinner.vue.d.ts +7 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.d.vue.ts +7 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue +43 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue.d.ts +7 -0
- package/dist/runtime/templates/cwa-page.d.vue.ts +3 -0
- package/dist/runtime/templates/cwa-page.spec.ts.snap +9 -0
- package/dist/runtime/templates/cwa-page.vue +55 -0
- package/dist/runtime/templates/cwa-page.vue.d.ts +3 -0
- package/dist/runtime/types/index.d.ts +59 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/types/popper.d.ts +14 -0
- package/dist/types.d.mts +7 -0
- package/package.json +132 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useCwaResourceEndpoint } from "#cwa/composables/cwa-resource-endpoint";
|
|
2
|
+
import { computed, onMounted, ref } from "vue";
|
|
3
|
+
export const useCwaImage = (iri, ops) => {
|
|
4
|
+
const { query } = useCwaResourceEndpoint(iri);
|
|
5
|
+
const fileProperty = ops.fileProp || "file";
|
|
6
|
+
const loaded = ref(false);
|
|
7
|
+
function handleLoad() {
|
|
8
|
+
loaded.value = true;
|
|
9
|
+
}
|
|
10
|
+
const imageFileMediaObjects = computed(() => {
|
|
11
|
+
return ops.mediaObjects.value?.[fileProperty];
|
|
12
|
+
});
|
|
13
|
+
const displayMedia = computed(() => {
|
|
14
|
+
if (!imageFileMediaObjects.value || !imageFileMediaObjects.value.length) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const thumbnail = imageFileMediaObjects.value.filter(({ imagineFilter }) => imagineFilter === ops.imagineFilterName);
|
|
18
|
+
return thumbnail?.[0] || imageFileMediaObjects.value[0];
|
|
19
|
+
});
|
|
20
|
+
const contentUrl = computed(() => {
|
|
21
|
+
const mediaUrl = displayMedia.value?.contentUrl;
|
|
22
|
+
if (!mediaUrl) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
return `${mediaUrl}${query.value}`;
|
|
26
|
+
});
|
|
27
|
+
onMounted(() => {
|
|
28
|
+
if (ops.imageRef.value?.complete || ops.imageRef.value?.naturalHeight !== 0) {
|
|
29
|
+
handleLoad();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
contentUrl,
|
|
34
|
+
displayMedia,
|
|
35
|
+
handleLoad,
|
|
36
|
+
loaded
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { useRouter, useRoute } from "vue-router";
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
|
+
import debounce from "lodash-es/debounce";
|
|
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 matchedParam = matchingParams[0];
|
|
32
|
+
const normalizeValueAsArray = (valueIsArray, value) => {
|
|
33
|
+
if (Array.isArray(value)) {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
if (valueIsArray) {
|
|
37
|
+
return [value];
|
|
38
|
+
}
|
|
39
|
+
return ops?.asNumber && value !== null ? Number(value) : value;
|
|
40
|
+
};
|
|
41
|
+
if (Array.isArray(queryParam)) {
|
|
42
|
+
for (const p of queryParam) {
|
|
43
|
+
const valueIsArray = p.endsWith("[]");
|
|
44
|
+
if (route.query[p]) {
|
|
45
|
+
return normalizeValueAsArray(valueIsArray, route.query[p]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
} else if (route.query[queryParam]) {
|
|
49
|
+
const valueIsArray = queryParam.endsWith("[]");
|
|
50
|
+
return normalizeValueAsArray(valueIsArray, route.query[queryParam]);
|
|
51
|
+
}
|
|
52
|
+
const matches = matchedParam.match(exp);
|
|
53
|
+
if (!matches || matches.length < 2) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const matchingObjectKey = matches[1];
|
|
57
|
+
if (matchingParams.length && matchingObjectKey) {
|
|
58
|
+
return { [matchingObjectKey]: route.query[matchedParam] };
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
});
|
|
62
|
+
const model = ref(matchedQueryParamValue.value !== null ? matchedQueryParamValue.value : ops?.defaultValue);
|
|
63
|
+
watch(matchedQueryParamValue, (newValue) => {
|
|
64
|
+
model.value = newValue;
|
|
65
|
+
});
|
|
66
|
+
watch(model, async (newValue) => {
|
|
67
|
+
if (debounced) {
|
|
68
|
+
debounced.cancel();
|
|
69
|
+
}
|
|
70
|
+
if (!route) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const filteredKeys = Object.keys(route.query).filter((key) => !matchingQueryParams.value.includes(key));
|
|
74
|
+
const newQuery = {};
|
|
75
|
+
for (const retainedKey of filteredKeys) {
|
|
76
|
+
newQuery[retainedKey] = route.query[retainedKey];
|
|
77
|
+
}
|
|
78
|
+
const isObj = Object.prototype.toString.call(newValue) === "[object Object]";
|
|
79
|
+
if (isObj) {
|
|
80
|
+
for (const newValueKey of Object.keys(newValue)) {
|
|
81
|
+
if (!newValue[newValueKey]) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (Array.isArray(queryParam)) {
|
|
85
|
+
for (const p of queryParam) {
|
|
86
|
+
newQuery[`${p}[${newValueKey}]`] = newValue[newValueKey];
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
newQuery[`${queryParam}[${newValueKey}]`] = newValue[newValueKey];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
} else if (newValue && (!Array.isArray(newValue) || newValue.length)) {
|
|
93
|
+
if (Array.isArray(queryParam)) {
|
|
94
|
+
for (const p of queryParam) {
|
|
95
|
+
newQuery[p] = newValue;
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
newQuery[queryParam] = newValue;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
debounced = debounce(async () => {
|
|
102
|
+
await router.replace({ query: newQuery });
|
|
103
|
+
}, ops?.delay || 10);
|
|
104
|
+
await debounced();
|
|
105
|
+
});
|
|
106
|
+
return {
|
|
107
|
+
model
|
|
108
|
+
};
|
|
109
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { computed, onBeforeUnmount, ref, watch, watchEffect } from "vue";
|
|
2
|
+
import { getPublishedResourceState } from "#cwa/resources/resource-utils";
|
|
3
|
+
import { useCwa } from "#cwa/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, 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,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCurrentInstance,
|
|
3
|
+
onBeforeUnmount,
|
|
4
|
+
onMounted,
|
|
5
|
+
ref,
|
|
6
|
+
watch
|
|
7
|
+
} from "vue";
|
|
8
|
+
import ManageableResource from "../admin/manageable-resource.js";
|
|
9
|
+
import { useCwa } from "./cwa.js";
|
|
10
|
+
export const useCwaResourceManageable = (iri, ops, proxy) => {
|
|
11
|
+
const useProxy = proxy || getCurrentInstance()?.proxy;
|
|
12
|
+
if (!useProxy) {
|
|
13
|
+
throw new Error(`Cannot initialise manager for resource. Instance is not defined with iri '${iri.value}'`);
|
|
14
|
+
}
|
|
15
|
+
const $cwa = useCwa();
|
|
16
|
+
const manageableResource = new ManageableResource(useProxy, $cwa, ops || ref({}));
|
|
17
|
+
const isAdmin = $cwa.auth.isAdmin;
|
|
18
|
+
const onManageableComponentMounted = (iriMounted) => {
|
|
19
|
+
if (iriMounted === iri.value) {
|
|
20
|
+
manageableResource.initNewIri();
|
|
21
|
+
$cwa.admin.eventBus.emit("componentMounted", iri.value);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const initAdmin = () => {
|
|
25
|
+
manageableResource.init(iri);
|
|
26
|
+
iri.value && $cwa.admin.eventBus.emit("componentMounted", iri.value);
|
|
27
|
+
$cwa.admin.eventBus.on("manageableComponentMounted", onManageableComponentMounted);
|
|
28
|
+
};
|
|
29
|
+
const clearAdmin = () => {
|
|
30
|
+
$cwa.admin.eventBus.off("manageableComponentMounted", onManageableComponentMounted);
|
|
31
|
+
manageableResource.clear();
|
|
32
|
+
};
|
|
33
|
+
let stopAdminWatch;
|
|
34
|
+
onMounted(() => {
|
|
35
|
+
if (isAdmin.value) {
|
|
36
|
+
initAdmin();
|
|
37
|
+
}
|
|
38
|
+
stopAdminWatch = watch(isAdmin, (isAdminValue, wasAdmin) => {
|
|
39
|
+
if (isAdminValue && !wasAdmin) {
|
|
40
|
+
initAdmin();
|
|
41
|
+
} else if (!isAdminValue && wasAdmin) {
|
|
42
|
+
clearAdmin();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
onBeforeUnmount(() => {
|
|
47
|
+
stopAdminWatch?.();
|
|
48
|
+
clearAdmin();
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
manager: manageableResource
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
export interface CwaResourceManagerTabOptions {
|
|
3
|
+
name: string;
|
|
4
|
+
order?: number;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export 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
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { computed, ref } from "vue";
|
|
2
|
+
import { useCwa } from "#cwa/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,156 @@
|
|
|
1
|
+
import { computed, getCurrentInstance, onBeforeUnmount, ref, watch } from "vue";
|
|
2
|
+
import debounce from "lodash-es/debounce";
|
|
3
|
+
import get from "lodash-es/get";
|
|
4
|
+
import isObject from "lodash-es/isObject";
|
|
5
|
+
import set from "lodash-es/set";
|
|
6
|
+
import { useCwa } from "#cwa/composables/cwa";
|
|
7
|
+
import { useCwaResourceEndpoint } from "#cwa/composables/cwa-resource-endpoint";
|
|
8
|
+
export const useCwaResourceModel = (iri, property, ops) => {
|
|
9
|
+
const proxy = getCurrentInstance()?.proxy;
|
|
10
|
+
const source = `input_${proxy?.$?.uid}`;
|
|
11
|
+
const $cwa = useCwa();
|
|
12
|
+
const resource = computed(() => iri.value ? $cwa.resources.getResource(iri.value).value : void 0);
|
|
13
|
+
const { endpoint } = useCwaResourceEndpoint(iri);
|
|
14
|
+
const storeValue = computed(() => resource.value?.data ? get(resource.value.data, property) : void 0);
|
|
15
|
+
const rootProperty = computed(() => {
|
|
16
|
+
if (Array.isArray(property)) {
|
|
17
|
+
return property[0] || "";
|
|
18
|
+
}
|
|
19
|
+
return property.split(".")[0]?.split("[")[0] || "";
|
|
20
|
+
});
|
|
21
|
+
const rootStoreValue = computed(() => resource.value?.data ? get(resource.value.data, rootProperty.value) : void 0);
|
|
22
|
+
const localValueWithIri = ref({});
|
|
23
|
+
const localValue = computed({
|
|
24
|
+
get() {
|
|
25
|
+
if (!iri.value) {
|
|
26
|
+
return void 0;
|
|
27
|
+
}
|
|
28
|
+
return localValueWithIri.value[iri.value];
|
|
29
|
+
},
|
|
30
|
+
set(newValue) {
|
|
31
|
+
if (!iri.value) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
localValueWithIri.value[iri.value] = newValue;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const pendingSubmit = ref(false);
|
|
38
|
+
const isLongWait = ref(false);
|
|
39
|
+
const longWaitThreshold = ops?.longWaitThreshold || 5e3;
|
|
40
|
+
const debounceTime = ops?.debounceTime !== void 0 ? ops.debounceTime : 250;
|
|
41
|
+
let debounced;
|
|
42
|
+
const isBusy = computed(() => pendingSubmit.value || isSubmitting.value);
|
|
43
|
+
const isSubmitting = ref(false);
|
|
44
|
+
const lastSubmittedValueInProgress = ref();
|
|
45
|
+
function isEqual(value1, value2) {
|
|
46
|
+
function requiresNormalizing(value) {
|
|
47
|
+
const type = typeof value;
|
|
48
|
+
return value !== void 0 && value !== null && (type === "object" || Array.isArray(value));
|
|
49
|
+
}
|
|
50
|
+
function getNormalizedValue(value) {
|
|
51
|
+
return requiresNormalizing(value) ? JSON.stringify(value) : value;
|
|
52
|
+
}
|
|
53
|
+
return getNormalizedValue(value1) === getNormalizedValue(value2);
|
|
54
|
+
}
|
|
55
|
+
async function updateResource(newLocalValue) {
|
|
56
|
+
const submittingIri = iri.value;
|
|
57
|
+
if (!submittingIri) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const isNewValueObject = isObject(newLocalValue);
|
|
61
|
+
isNewValueObject && await $cwa.resourcesManager.getWaitForRequestPromise(endpoint.value, rootProperty.value, source);
|
|
62
|
+
if (resource.value === void 0 || isSubmitting.value && isEqual(lastSubmittedValueInProgress.value, newLocalValue)) {
|
|
63
|
+
resetValue();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (!isSubmitting.value && isEqual(storeValue.value, newLocalValue)) {
|
|
67
|
+
pendingSubmit.value = false;
|
|
68
|
+
resetValue();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
isSubmitting.value = true;
|
|
72
|
+
let submittingValue;
|
|
73
|
+
if (isNewValueObject) {
|
|
74
|
+
const newObject = set({ [rootProperty.value]: { ...rootStoreValue.value } }, property, newLocalValue);
|
|
75
|
+
submittingValue = newObject[rootProperty.value];
|
|
76
|
+
} else {
|
|
77
|
+
submittingValue = newLocalValue;
|
|
78
|
+
}
|
|
79
|
+
lastSubmittedValueInProgress.value = submittingValue;
|
|
80
|
+
pendingSubmit.value = false;
|
|
81
|
+
const newResource = await $cwa.resourcesManager.updateResource({
|
|
82
|
+
endpoint: endpoint.value,
|
|
83
|
+
data: {
|
|
84
|
+
[rootProperty.value]: submittingValue
|
|
85
|
+
},
|
|
86
|
+
source
|
|
87
|
+
});
|
|
88
|
+
isSubmitting.value = false;
|
|
89
|
+
const newIriReturned = newResource?.["@id"] && newResource["@id"] !== submittingIri;
|
|
90
|
+
if (newIriReturned) {
|
|
91
|
+
localValueWithIri.value[newResource["@id"]] = localValueWithIri.value[submittingIri];
|
|
92
|
+
resetValue(submittingIri);
|
|
93
|
+
}
|
|
94
|
+
isEqual(storeValue.value, submittingValue) && isEqual(storeValue.value, localValue.value) && resetValue();
|
|
95
|
+
}
|
|
96
|
+
function resetValue(resetIri) {
|
|
97
|
+
const useIri = resetIri || iri.value;
|
|
98
|
+
if (!useIri) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
localValueWithIri.value[useIri] = void 0;
|
|
102
|
+
}
|
|
103
|
+
const unwatchLocalValue = watch(localValue, (newLocalValue) => {
|
|
104
|
+
if (newLocalValue === void 0) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (debounced) {
|
|
108
|
+
debounced.cancel();
|
|
109
|
+
}
|
|
110
|
+
pendingSubmit.value = true;
|
|
111
|
+
debounced = debounce(() => updateResource(newLocalValue), debounceTime);
|
|
112
|
+
debounced();
|
|
113
|
+
});
|
|
114
|
+
let longWaitTimeoutFn;
|
|
115
|
+
const unwatchIsBusy = watch(isBusy, (newBusy) => {
|
|
116
|
+
if (!newBusy) {
|
|
117
|
+
isLongWait.value = false;
|
|
118
|
+
if (longWaitTimeoutFn) {
|
|
119
|
+
clearTimeout(longWaitTimeoutFn);
|
|
120
|
+
}
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
longWaitTimeoutFn = setTimeout(() => {
|
|
124
|
+
isLongWait.value = true;
|
|
125
|
+
}, longWaitThreshold);
|
|
126
|
+
});
|
|
127
|
+
const model = computed({
|
|
128
|
+
get() {
|
|
129
|
+
if (localValue.value !== void 0) {
|
|
130
|
+
return localValue.value;
|
|
131
|
+
}
|
|
132
|
+
if (storeValue.value === void 0) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
return storeValue.value;
|
|
136
|
+
},
|
|
137
|
+
set(value) {
|
|
138
|
+
localValue.value = value;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
onBeforeUnmount(() => {
|
|
142
|
+
unwatchLocalValue();
|
|
143
|
+
unwatchIsBusy();
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
states: {
|
|
147
|
+
pendingSubmit,
|
|
148
|
+
submitting: isSubmitting,
|
|
149
|
+
isBusy,
|
|
150
|
+
isLongWait
|
|
151
|
+
},
|
|
152
|
+
resetValue,
|
|
153
|
+
model,
|
|
154
|
+
localValueWithIri
|
|
155
|
+
};
|
|
156
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
export declare const useCwaResourceUpload: (iri: ComputedRef<string | undefined>, filename?: string, fileDisplayType?: string) => {
|
|
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
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { computed, ref } from "vue";
|
|
2
|
+
import { createConfirmDialog } from "vuejs-confirm-dialog";
|
|
3
|
+
import { useCwaResourceEndpoint } from "#cwa/composables/cwa-resource-endpoint";
|
|
4
|
+
import { useCwa } from "#cwa/composables/cwa";
|
|
5
|
+
import ConfirmDialog from "#cwa/templates/components/core/ConfirmDialog.vue";
|
|
6
|
+
export const useCwaResourceUpload = (iri, filename = "file", fileDisplayType = "Image") => {
|
|
7
|
+
const $cwa = useCwa();
|
|
8
|
+
const resource = computed(() => iri.value ? $cwa.resources.getResource(iri.value).value : void 0);
|
|
9
|
+
function getFilename() {
|
|
10
|
+
return fileData.value ? `Existing ${fileDisplayType} (${fileData.value.formattedFileSize})` : "";
|
|
11
|
+
}
|
|
12
|
+
const fileData = computed(() => resource.value?.data?._metadata.mediaObjects?.[filename]?.[0]);
|
|
13
|
+
const filenameInputModel = ref(getFilename());
|
|
14
|
+
const fileExists = ref(true);
|
|
15
|
+
const updating = ref(false);
|
|
16
|
+
const { endpoint: updateEndpoint } = useCwaResourceEndpoint(iri, "/upload");
|
|
17
|
+
const { endpoint: deleteEndpoint } = useCwaResourceEndpoint(iri);
|
|
18
|
+
async function handleInputChangeFile(newFile) {
|
|
19
|
+
if (!newFile || !iri.value) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
updating.value = true;
|
|
23
|
+
const formData = new FormData();
|
|
24
|
+
formData.append(filename, newFile);
|
|
25
|
+
await $cwa.resourcesManager.updateResource({
|
|
26
|
+
iri: iri.value,
|
|
27
|
+
endpoint: updateEndpoint.value,
|
|
28
|
+
data: formData,
|
|
29
|
+
headers: {
|
|
30
|
+
accept: "*/*"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
filenameInputModel.value = getFilename();
|
|
34
|
+
updating.value = false;
|
|
35
|
+
}
|
|
36
|
+
async function confirmDelete() {
|
|
37
|
+
const alertData = {
|
|
38
|
+
title: `Delete this ${fileDisplayType.toLowerCase()}?`,
|
|
39
|
+
content: `<p>Are you sure you want to permanently delete this ${fileDisplayType.toLowerCase()}?</p>`
|
|
40
|
+
};
|
|
41
|
+
const dialog = createConfirmDialog(ConfirmDialog);
|
|
42
|
+
const { isCanceled } = await dialog.reveal(alertData);
|
|
43
|
+
return !isCanceled;
|
|
44
|
+
}
|
|
45
|
+
async function handleInputDeleteFile() {
|
|
46
|
+
if (!fileExists.value || !iri.value) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (!await confirmDelete()) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
updating.value = true;
|
|
53
|
+
await $cwa.resourcesManager.updateResource({
|
|
54
|
+
endpoint: deleteEndpoint.value,
|
|
55
|
+
data: {
|
|
56
|
+
[filename]: null
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
fileExists.value = false;
|
|
60
|
+
filenameInputModel.value = "";
|
|
61
|
+
updating.value = false;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
filenameInputModel,
|
|
65
|
+
updating,
|
|
66
|
+
fileExists,
|
|
67
|
+
handleInputChangeFile,
|
|
68
|
+
handleInputDeleteFile
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CwaResource } from '#cwa/resources/resource-utils';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
3
|
+
import type { StyleOptions } from '#cwa/admin/manageable-resource';
|
|
4
|
+
export type IriProp = {
|
|
5
|
+
iri: string;
|
|
6
|
+
};
|
|
7
|
+
export interface CwaResourceUtilsOps {
|
|
8
|
+
name?: string;
|
|
9
|
+
styles?: StyleOptions;
|
|
10
|
+
manager?: {
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface CwaResourceMeta {
|
|
15
|
+
cwaResource: {
|
|
16
|
+
name?: string;
|
|
17
|
+
styles?: StyleOptions;
|
|
18
|
+
};
|
|
19
|
+
disableManager: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const useCwaResource: (iri: Ref<string>, ops?: CwaResourceUtilsOps) => {
|
|
22
|
+
$cwa: import("../cwa.js").default;
|
|
23
|
+
getResource: () => import("vue").ComputedRef<import("../storage/stores/resources/state.js").CwaCurrentResourceInterface | undefined>;
|
|
24
|
+
exposeMeta: CwaResourceMeta;
|
|
25
|
+
getCurrentStyleName: (resource: CwaResource) => string | undefined;
|
|
26
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import isEqual from "lodash-es/isEqual";
|
|
2
|
+
import { computed, getCurrentInstance, onMounted } from "vue";
|
|
3
|
+
import { useCwa } from "./cwa.js";
|
|
4
|
+
export const useCwaResource = (iri, ops) => {
|
|
5
|
+
const $cwa = useCwa();
|
|
6
|
+
const instance = getCurrentInstance();
|
|
7
|
+
const disableManager = !!ops?.manager?.disabled;
|
|
8
|
+
onMounted(() => {
|
|
9
|
+
const el = instance?.proxy?.$el;
|
|
10
|
+
if (el && !el.isConnected) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
$cwa.admin.eventBus.emit(disableManager ? "componentMounted" : "manageableComponentMounted", iri.value);
|
|
14
|
+
});
|
|
15
|
+
const uiStyles = ops?.styles;
|
|
16
|
+
const exposeMeta = {
|
|
17
|
+
cwaResource: {
|
|
18
|
+
name: ops?.name,
|
|
19
|
+
styles: uiStyles
|
|
20
|
+
},
|
|
21
|
+
disableManager
|
|
22
|
+
};
|
|
23
|
+
const getResource = () => {
|
|
24
|
+
return computed(() => $cwa.resources.getResource(iri.value).value);
|
|
25
|
+
};
|
|
26
|
+
const getCurrentStyleName = (resource) => {
|
|
27
|
+
if (!uiStyles?.classes) return;
|
|
28
|
+
const currentClassNames = resource.uiClassNames;
|
|
29
|
+
for (const [name, classes] of Object.entries(uiStyles.classes)) {
|
|
30
|
+
if (isEqual(currentClassNames, classes)) {
|
|
31
|
+
return name;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
$cwa,
|
|
37
|
+
// this needs to be a function so useCwa is not called early - would get issues from ComponentPosition and more
|
|
38
|
+
getResource,
|
|
39
|
+
exposeMeta,
|
|
40
|
+
getCurrentStyleName
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
import type { PopperOptions } from '#cwa/types/popper';
|
|
3
|
+
type ModelValue = undefined | string | number | boolean | object | null | (string | number | boolean | object)[];
|
|
4
|
+
export interface SelectOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: ModelValue;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type SelectInputProps = {
|
|
10
|
+
options: SelectOption[];
|
|
11
|
+
modelValue: ModelValue;
|
|
12
|
+
popper?: PopperOptions;
|
|
13
|
+
};
|
|
14
|
+
export declare const useCwaSelectInput: (inputProps: ComputedRef<SelectInputProps>, emit: (event: "update:modelValue", ...args: any[]) => void) => {
|
|
15
|
+
value: import("vue").WritableComputedRef<ModelValue, ModelValue>;
|
|
16
|
+
compareOptions: (a: ModelValue, b: ModelValue) => boolean;
|
|
17
|
+
selectedOption: ComputedRef<SelectOption | null>;
|
|
18
|
+
trigger: import("vue").Ref<import("@vueuse/core").MaybeElement, import("@vueuse/core").MaybeElement>;
|
|
19
|
+
container: import("vue").Ref<import("@vueuse/core").MaybeElement, import("@vueuse/core").MaybeElement>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|