@nuxt-atelier/admin 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/module.d.mts +52 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +188 -0
- package/dist/runtime/admin.css +1 -0
- package/dist/runtime/ai-off.d.ts +1 -0
- package/dist/runtime/ai-off.js +1 -0
- package/dist/runtime/appearance.d.ts +59 -0
- package/dist/runtime/appearance.js +111 -0
- package/dist/runtime/branding.d.ts +11 -0
- package/dist/runtime/branding.js +14 -0
- package/dist/runtime/components/App.d.vue.ts +6 -0
- package/dist/runtime/components/App.vue +170 -0
- package/dist/runtime/components/App.vue.d.ts +6 -0
- package/dist/runtime/components/AppearanceModal.d.vue.ts +3 -0
- package/dist/runtime/components/AppearanceModal.vue +267 -0
- package/dist/runtime/components/AppearanceModal.vue.d.ts +3 -0
- package/dist/runtime/components/AuthFrame.d.vue.ts +15 -0
- package/dist/runtime/components/AuthFrame.vue +56 -0
- package/dist/runtime/components/AuthFrame.vue.d.ts +15 -0
- package/dist/runtime/components/BlocksField.d.vue.ts +14 -0
- package/dist/runtime/components/BlocksField.vue +167 -0
- package/dist/runtime/components/BlocksField.vue.d.ts +14 -0
- package/dist/runtime/components/Brand.d.vue.ts +6 -0
- package/dist/runtime/components/Brand.vue +22 -0
- package/dist/runtime/components/Brand.vue.d.ts +6 -0
- package/dist/runtime/components/CollectionList.d.vue.ts +6 -0
- package/dist/runtime/components/CollectionList.vue +312 -0
- package/dist/runtime/components/CollectionList.vue.d.ts +6 -0
- package/dist/runtime/components/CommentsPanel.d.vue.ts +9 -0
- package/dist/runtime/components/CommentsPanel.vue +228 -0
- package/dist/runtime/components/CommentsPanel.vue.d.ts +9 -0
- package/dist/runtime/components/EntryEdit.d.vue.ts +9 -0
- package/dist/runtime/components/EntryEdit.vue +457 -0
- package/dist/runtime/components/EntryEdit.vue.d.ts +9 -0
- package/dist/runtime/components/FieldInput.d.vue.ts +13 -0
- package/dist/runtime/components/FieldInput.vue +356 -0
- package/dist/runtime/components/FieldInput.vue.d.ts +13 -0
- package/dist/runtime/components/FormSubmissions.d.vue.ts +6 -0
- package/dist/runtime/components/FormSubmissions.vue +197 -0
- package/dist/runtime/components/FormSubmissions.vue.d.ts +6 -0
- package/dist/runtime/components/GlobalSearch.d.vue.ts +10 -0
- package/dist/runtime/components/GlobalSearch.vue +145 -0
- package/dist/runtime/components/GlobalSearch.vue.d.ts +10 -0
- package/dist/runtime/components/Home.d.vue.ts +3 -0
- package/dist/runtime/components/Home.vue +247 -0
- package/dist/runtime/components/Home.vue.d.ts +3 -0
- package/dist/runtime/components/Icon.d.ts +14 -0
- package/dist/runtime/components/Icon.js +12 -0
- package/dist/runtime/components/MediaDetails.d.vue.ts +11 -0
- package/dist/runtime/components/MediaDetails.vue +222 -0
- package/dist/runtime/components/MediaDetails.vue.d.ts +11 -0
- package/dist/runtime/components/MediaField.d.vue.ts +14 -0
- package/dist/runtime/components/MediaField.vue +86 -0
- package/dist/runtime/components/MediaField.vue.d.ts +14 -0
- package/dist/runtime/components/MediaGrid.d.vue.ts +13 -0
- package/dist/runtime/components/MediaGrid.vue +49 -0
- package/dist/runtime/components/MediaGrid.vue.d.ts +13 -0
- package/dist/runtime/components/MediaLibrary.d.vue.ts +12 -0
- package/dist/runtime/components/MediaLibrary.vue +151 -0
- package/dist/runtime/components/MediaLibrary.vue.d.ts +12 -0
- package/dist/runtime/components/NotFound.d.vue.ts +6 -0
- package/dist/runtime/components/NotFound.vue +29 -0
- package/dist/runtime/components/NotFound.vue.d.ts +6 -0
- package/dist/runtime/components/NotificationBell.d.vue.ts +3 -0
- package/dist/runtime/components/NotificationBell.vue +53 -0
- package/dist/runtime/components/NotificationBell.vue.d.ts +3 -0
- package/dist/runtime/components/Page.d.vue.ts +28 -0
- package/dist/runtime/components/Page.vue +84 -0
- package/dist/runtime/components/Page.vue.d.ts +28 -0
- package/dist/runtime/components/RelatedCreate.d.vue.ts +16 -0
- package/dist/runtime/components/RelatedCreate.vue +86 -0
- package/dist/runtime/components/RelatedCreate.vue.d.ts +16 -0
- package/dist/runtime/components/RevisionHistory.d.vue.ts +16 -0
- package/dist/runtime/components/RevisionHistory.vue +145 -0
- package/dist/runtime/components/RevisionHistory.vue.d.ts +16 -0
- package/dist/runtime/components/RichTextEditor.d.vue.ts +15 -0
- package/dist/runtime/components/RichTextEditor.vue +190 -0
- package/dist/runtime/components/RichTextEditor.vue.d.ts +15 -0
- package/dist/runtime/components/RobotsSettings.d.vue.ts +3 -0
- package/dist/runtime/components/RobotsSettings.vue +173 -0
- package/dist/runtime/components/RobotsSettings.vue.d.ts +3 -0
- package/dist/runtime/components/RoleEdit.d.vue.ts +6 -0
- package/dist/runtime/components/RoleEdit.vue +234 -0
- package/dist/runtime/components/RoleEdit.vue.d.ts +6 -0
- package/dist/runtime/components/Roles.d.vue.ts +3 -0
- package/dist/runtime/components/Roles.vue +129 -0
- package/dist/runtime/components/Roles.vue.d.ts +3 -0
- package/dist/runtime/components/ScheduleSection.d.vue.ts +12 -0
- package/dist/runtime/components/ScheduleSection.vue +120 -0
- package/dist/runtime/components/ScheduleSection.vue.d.ts +12 -0
- package/dist/runtime/components/SeoPanel.d.vue.ts +7 -0
- package/dist/runtime/components/SeoPanel.vue +81 -0
- package/dist/runtime/components/SeoPanel.vue.d.ts +7 -0
- package/dist/runtime/components/Setup.d.vue.ts +3 -0
- package/dist/runtime/components/Setup.vue +79 -0
- package/dist/runtime/components/Setup.vue.d.ts +3 -0
- package/dist/runtime/components/SharedBlockUsage.d.vue.ts +7 -0
- package/dist/runtime/components/SharedBlockUsage.vue +91 -0
- package/dist/runtime/components/SharedBlockUsage.vue.d.ts +7 -0
- package/dist/runtime/components/Shell.d.vue.ts +15 -0
- package/dist/runtime/components/Shell.vue +281 -0
- package/dist/runtime/components/Shell.vue.d.ts +15 -0
- package/dist/runtime/components/SignIn.d.vue.ts +3 -0
- package/dist/runtime/components/SignIn.vue +106 -0
- package/dist/runtime/components/SignIn.vue.d.ts +3 -0
- package/dist/runtime/components/Toaster.d.vue.ts +3 -0
- package/dist/runtime/components/Toaster.vue +24 -0
- package/dist/runtime/components/Toaster.vue.d.ts +3 -0
- package/dist/runtime/components/Users.d.vue.ts +3 -0
- package/dist/runtime/components/Users.vue +226 -0
- package/dist/runtime/components/Users.vue.d.ts +3 -0
- package/dist/runtime/composables/debounced.d.ts +3 -0
- package/dist/runtime/composables/debounced.js +11 -0
- package/dist/runtime/composables/useAtelierAdmin.d.ts +17 -0
- package/dist/runtime/composables/useAtelierAdmin.js +53 -0
- package/dist/runtime/composables/useAtelierAdminPortal.d.ts +3 -0
- package/dist/runtime/composables/useAtelierAdminPortal.js +5 -0
- package/dist/runtime/composables/useAtelierAdminSchema.d.ts +182 -0
- package/dist/runtime/composables/useAtelierAdminSchema.js +26 -0
- package/dist/runtime/composables/useAtelierCollection.d.ts +49 -0
- package/dist/runtime/composables/useAtelierCollection.js +77 -0
- package/dist/runtime/composables/useAtelierComments.d.ts +50 -0
- package/dist/runtime/composables/useAtelierComments.js +46 -0
- package/dist/runtime/composables/useAtelierDashboard.d.ts +42 -0
- package/dist/runtime/composables/useAtelierDashboard.js +16 -0
- package/dist/runtime/composables/useAtelierEntryForm.d.ts +77 -0
- package/dist/runtime/composables/useAtelierEntryForm.js +184 -0
- package/dist/runtime/composables/useAtelierGlobalSearch.d.ts +12 -0
- package/dist/runtime/composables/useAtelierGlobalSearch.js +17 -0
- package/dist/runtime/composables/useAtelierMediaLibrary.d.ts +75 -0
- package/dist/runtime/composables/useAtelierMediaLibrary.js +85 -0
- package/dist/runtime/composables/useAtelierNavigation.d.ts +20 -0
- package/dist/runtime/composables/useAtelierNavigation.js +37 -0
- package/dist/runtime/composables/useAtelierNotifications.d.ts +21 -0
- package/dist/runtime/composables/useAtelierNotifications.js +34 -0
- package/dist/runtime/composables/useAtelierPermissions.d.ts +11 -0
- package/dist/runtime/composables/useAtelierPermissions.js +15 -0
- package/dist/runtime/composables/useAtelierPresence.d.ts +32 -0
- package/dist/runtime/composables/useAtelierPresence.js +95 -0
- package/dist/runtime/composables/useAtelierRealtime.d.ts +10 -0
- package/dist/runtime/composables/useAtelierRealtime.js +74 -0
- package/dist/runtime/composables/useAtelierRoles.d.ts +13 -0
- package/dist/runtime/composables/useAtelierRoles.js +15 -0
- package/dist/runtime/composables/useAtelierSeo.d.ts +34 -0
- package/dist/runtime/composables/useAtelierSeo.js +57 -0
- package/dist/runtime/composables/useAtelierSession.d.ts +35 -0
- package/dist/runtime/composables/useAtelierSession.js +36 -0
- package/dist/runtime/composables/useAtelierSetting.d.ts +11 -0
- package/dist/runtime/composables/useAtelierSetting.js +16 -0
- package/dist/runtime/composables/useAtelierUsers.d.ts +18 -0
- package/dist/runtime/composables/useAtelierUsers.js +16 -0
- package/dist/runtime/crystal-neuo/VERSION +3 -0
- package/dist/runtime/crystal-neuo/components/Alert.d.vue.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Alert.vue +25 -0
- package/dist/runtime/crystal-neuo/components/Alert.vue.d.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Avatar.d.vue.ts +15 -0
- package/dist/runtime/crystal-neuo/components/Avatar.vue +25 -0
- package/dist/runtime/crystal-neuo/components/Avatar.vue.d.ts +15 -0
- package/dist/runtime/crystal-neuo/components/Badge.d.vue.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Badge.vue +17 -0
- package/dist/runtime/crystal-neuo/components/Badge.vue.d.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Breadcrumb.d.vue.ts +16 -0
- package/dist/runtime/crystal-neuo/components/Breadcrumb.vue +26 -0
- package/dist/runtime/crystal-neuo/components/Breadcrumb.vue.d.ts +16 -0
- package/dist/runtime/crystal-neuo/components/Button.d.vue.ts +35 -0
- package/dist/runtime/crystal-neuo/components/Button.vue +31 -0
- package/dist/runtime/crystal-neuo/components/Button.vue.d.ts +35 -0
- package/dist/runtime/crystal-neuo/components/Card.d.vue.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Card.vue +17 -0
- package/dist/runtime/crystal-neuo/components/Card.vue.d.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Checkbox.d.vue.ts +23 -0
- package/dist/runtime/crystal-neuo/components/Checkbox.vue +45 -0
- package/dist/runtime/crystal-neuo/components/Checkbox.vue.d.ts +23 -0
- package/dist/runtime/crystal-neuo/components/DatePicker.d.vue.ts +24 -0
- package/dist/runtime/crystal-neuo/components/DatePicker.vue +43 -0
- package/dist/runtime/crystal-neuo/components/DatePicker.vue.d.ts +24 -0
- package/dist/runtime/crystal-neuo/components/Dialog.d.vue.ts +41 -0
- package/dist/runtime/crystal-neuo/components/Dialog.vue +63 -0
- package/dist/runtime/crystal-neuo/components/Dialog.vue.d.ts +41 -0
- package/dist/runtime/crystal-neuo/components/Drawer.d.vue.ts +34 -0
- package/dist/runtime/crystal-neuo/components/Drawer.vue +45 -0
- package/dist/runtime/crystal-neuo/components/Drawer.vue.d.ts +34 -0
- package/dist/runtime/crystal-neuo/components/FileUpload.d.vue.ts +32 -0
- package/dist/runtime/crystal-neuo/components/FileUpload.vue +94 -0
- package/dist/runtime/crystal-neuo/components/FileUpload.vue.d.ts +32 -0
- package/dist/runtime/crystal-neuo/components/Input.d.vue.ts +26 -0
- package/dist/runtime/crystal-neuo/components/Input.vue +48 -0
- package/dist/runtime/crystal-neuo/components/Input.vue.d.ts +26 -0
- package/dist/runtime/crystal-neuo/components/List.d.vue.ts +25 -0
- package/dist/runtime/crystal-neuo/components/List.vue +19 -0
- package/dist/runtime/crystal-neuo/components/List.vue.d.ts +25 -0
- package/dist/runtime/crystal-neuo/components/ListItem.d.vue.ts +20 -0
- package/dist/runtime/crystal-neuo/components/ListItem.vue +13 -0
- package/dist/runtime/crystal-neuo/components/ListItem.vue.d.ts +20 -0
- package/dist/runtime/crystal-neuo/components/Menu.d.vue.ts +26 -0
- package/dist/runtime/crystal-neuo/components/Menu.vue +120 -0
- package/dist/runtime/crystal-neuo/components/Menu.vue.d.ts +26 -0
- package/dist/runtime/crystal-neuo/components/Modal.d.vue.ts +32 -0
- package/dist/runtime/crystal-neuo/components/Modal.vue +37 -0
- package/dist/runtime/crystal-neuo/components/Modal.vue.d.ts +32 -0
- package/dist/runtime/crystal-neuo/components/Nav.d.vue.ts +24 -0
- package/dist/runtime/crystal-neuo/components/Nav.vue +15 -0
- package/dist/runtime/crystal-neuo/components/Nav.vue.d.ts +24 -0
- package/dist/runtime/crystal-neuo/components/NavLink.d.vue.ts +22 -0
- package/dist/runtime/crystal-neuo/components/NavLink.vue +23 -0
- package/dist/runtime/crystal-neuo/components/NavLink.vue.d.ts +22 -0
- package/dist/runtime/crystal-neuo/components/Pagination.d.vue.ts +23 -0
- package/dist/runtime/crystal-neuo/components/Pagination.vue +58 -0
- package/dist/runtime/crystal-neuo/components/Pagination.vue.d.ts +23 -0
- package/dist/runtime/crystal-neuo/components/Progress.d.vue.ts +18 -0
- package/dist/runtime/crystal-neuo/components/Progress.vue +35 -0
- package/dist/runtime/crystal-neuo/components/Progress.vue.d.ts +18 -0
- package/dist/runtime/crystal-neuo/components/Radio.d.vue.ts +28 -0
- package/dist/runtime/crystal-neuo/components/Radio.vue +40 -0
- package/dist/runtime/crystal-neuo/components/Radio.vue.d.ts +28 -0
- package/dist/runtime/crystal-neuo/components/SegmentedControl.d.vue.ts +31 -0
- package/dist/runtime/crystal-neuo/components/SegmentedControl.vue +39 -0
- package/dist/runtime/crystal-neuo/components/SegmentedControl.vue.d.ts +31 -0
- package/dist/runtime/crystal-neuo/components/Select.d.vue.ts +28 -0
- package/dist/runtime/crystal-neuo/components/Select.vue +48 -0
- package/dist/runtime/crystal-neuo/components/Select.vue.d.ts +28 -0
- package/dist/runtime/crystal-neuo/components/Sheet.d.vue.ts +29 -0
- package/dist/runtime/crystal-neuo/components/Sheet.vue +37 -0
- package/dist/runtime/crystal-neuo/components/Sheet.vue.d.ts +29 -0
- package/dist/runtime/crystal-neuo/components/Skeleton.d.vue.ts +13 -0
- package/dist/runtime/crystal-neuo/components/Skeleton.vue +17 -0
- package/dist/runtime/crystal-neuo/components/Skeleton.vue.d.ts +13 -0
- package/dist/runtime/crystal-neuo/components/Slider.d.vue.ts +28 -0
- package/dist/runtime/crystal-neuo/components/Slider.vue +41 -0
- package/dist/runtime/crystal-neuo/components/Slider.vue.d.ts +28 -0
- package/dist/runtime/crystal-neuo/components/TabBar.d.vue.ts +28 -0
- package/dist/runtime/crystal-neuo/components/TabBar.vue +29 -0
- package/dist/runtime/crystal-neuo/components/TabBar.vue.d.ts +28 -0
- package/dist/runtime/crystal-neuo/components/Table.d.vue.ts +31 -0
- package/dist/runtime/crystal-neuo/components/Table.vue +36 -0
- package/dist/runtime/crystal-neuo/components/Table.vue.d.ts +31 -0
- package/dist/runtime/crystal-neuo/components/Tabs.d.vue.ts +40 -0
- package/dist/runtime/crystal-neuo/components/Tabs.vue +79 -0
- package/dist/runtime/crystal-neuo/components/Tabs.vue.d.ts +40 -0
- package/dist/runtime/crystal-neuo/components/Textarea.d.vue.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Textarea.vue +48 -0
- package/dist/runtime/crystal-neuo/components/Textarea.vue.d.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Toast.d.vue.ts +32 -0
- package/dist/runtime/crystal-neuo/components/Toast.vue +67 -0
- package/dist/runtime/crystal-neuo/components/Toast.vue.d.ts +32 -0
- package/dist/runtime/crystal-neuo/components/Toggle.d.vue.ts +21 -0
- package/dist/runtime/crystal-neuo/components/Toggle.vue +43 -0
- package/dist/runtime/crystal-neuo/components/Toggle.vue.d.ts +21 -0
- package/dist/runtime/crystal-neuo/components/Tooltip.d.vue.ts +23 -0
- package/dist/runtime/crystal-neuo/components/Tooltip.vue +38 -0
- package/dist/runtime/crystal-neuo/components/Tooltip.vue.d.ts +23 -0
- package/dist/runtime/crystal-neuo/components/cn.d.ts +1 -0
- package/dist/runtime/crystal-neuo/components/cn.js +3 -0
- package/dist/runtime/crystal-neuo/components/useControlAttrs.d.ts +15 -0
- package/dist/runtime/crystal-neuo/components/useControlAttrs.js +11 -0
- package/dist/runtime/crystal-neuo/components/useFocusTrap.d.ts +9 -0
- package/dist/runtime/crystal-neuo/components/useFocusTrap.js +55 -0
- package/dist/runtime/crystal-neuo/components/useModalDialog.d.ts +11 -0
- package/dist/runtime/crystal-neuo/components/useModalDialog.js +42 -0
- package/dist/runtime/crystal-neuo/contract/alert.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/alert.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/avatar.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/avatar.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/badge.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/badge.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/breadcrumb.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/breadcrumb.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/button.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/button.contract.js +22 -0
- package/dist/runtime/crystal-neuo/contract/card.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/card.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/checkbox.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/checkbox.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/date-picker.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/date-picker.contract.js +22 -0
- package/dist/runtime/crystal-neuo/contract/dialog.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/dialog.contract.js +23 -0
- package/dist/runtime/crystal-neuo/contract/drawer.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/drawer.contract.js +23 -0
- package/dist/runtime/crystal-neuo/contract/file-upload.contract.d.ts +17 -0
- package/dist/runtime/crystal-neuo/contract/file-upload.contract.js +36 -0
- package/dist/runtime/crystal-neuo/contract/index.d.ts +67 -0
- package/dist/runtime/crystal-neuo/contract/index.js +96 -0
- package/dist/runtime/crystal-neuo/contract/input.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/input.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/list.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/list.contract.js +21 -0
- package/dist/runtime/crystal-neuo/contract/menu.contract.d.ts +21 -0
- package/dist/runtime/crystal-neuo/contract/menu.contract.js +51 -0
- package/dist/runtime/crystal-neuo/contract/modal.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/modal.contract.js +24 -0
- package/dist/runtime/crystal-neuo/contract/nav.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/nav.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/pagination.contract.d.ts +11 -0
- package/dist/runtime/crystal-neuo/contract/pagination.contract.js +32 -0
- package/dist/runtime/crystal-neuo/contract/progress.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/progress.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/radio.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/radio.contract.js +24 -0
- package/dist/runtime/crystal-neuo/contract/segmented-control.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/segmented-control.contract.js +23 -0
- package/dist/runtime/crystal-neuo/contract/select.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/select.contract.js +24 -0
- package/dist/runtime/crystal-neuo/contract/sheet.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/sheet.contract.js +23 -0
- package/dist/runtime/crystal-neuo/contract/skeleton.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/skeleton.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/slider.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/slider.contract.js +24 -0
- package/dist/runtime/crystal-neuo/contract/tab-bar.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/tab-bar.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/table.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/table.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/tabs.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/tabs.contract.js +26 -0
- package/dist/runtime/crystal-neuo/contract/textarea.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/textarea.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/toast.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/toast.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/toggle.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/toggle.contract.js +22 -0
- package/dist/runtime/crystal-neuo/contract/tooltip.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/tooltip.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/types.d.ts +76 -0
- package/dist/runtime/crystal-neuo/contract/types.js +12 -0
- package/dist/runtime/crystal-neuo/css/crystal-neuo.css +1 -0
- package/dist/runtime/crystal-neuo/runtime/axes.d.ts +16 -0
- package/dist/runtime/crystal-neuo/runtime/axes.js +9 -0
- package/dist/runtime/crystal-neuo/runtime/index.d.ts +62 -0
- package/dist/runtime/crystal-neuo/runtime/index.js +115 -0
- package/dist/runtime/crystal-neuo/runtime/platform.d.ts +11 -0
- package/dist/runtime/crystal-neuo/runtime/platform.js +18 -0
- package/dist/runtime/crystal-neuo/runtime/refraction.d.ts +42 -0
- package/dist/runtime/crystal-neuo/runtime/refraction.js +183 -0
- package/dist/runtime/css/shell.css +1 -0
- package/dist/runtime/i18n/en.d.ts +2 -0
- package/dist/runtime/i18n/en.js +543 -0
- package/dist/runtime/i18n/index.d.ts +15 -0
- package/dist/runtime/i18n/index.js +52 -0
- package/dist/runtime/overrides.d.ts +5 -0
- package/dist/runtime/overrides.js +6 -0
- package/dist/runtime/pages/AdminPage.d.vue.ts +3 -0
- package/dist/runtime/pages/AdminPage.vue +49 -0
- package/dist/runtime/pages/AdminPage.vue.d.ts +3 -0
- package/dist/runtime/passkeys-off.d.ts +1 -0
- package/dist/runtime/passkeys-off.js +3 -0
- package/dist/runtime/passkeys.d.ts +1 -0
- package/dist/runtime/passkeys.js +6 -0
- package/dist/runtime/toast.d.ts +15 -0
- package/dist/runtime/toast.js +19 -0
- package/dist/runtime/types.d.ts +133 -0
- package/dist/runtime/types.js +0 -0
- package/dist/types.d.mts +3 -0
- package/package.json +59 -4
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useQuery } from "@tanstack/vue-query";
|
|
3
|
+
import { computed, defineAsyncComponent, inject, ref, resolveComponent } from "vue";
|
|
4
|
+
import { ai } from "#atelier-admin-ai";
|
|
5
|
+
import { applies } from "#atelier/shared/fields";
|
|
6
|
+
import { atelierFetch } from "../composables/useAtelierAdmin";
|
|
7
|
+
import { titleField } from "../composables/useAtelierCollection";
|
|
8
|
+
import { useAtelierAdminSchema } from "../composables/useAtelierAdminSchema";
|
|
9
|
+
import { humanize, singularLabel } from "../composables/useAtelierNavigation";
|
|
10
|
+
import CnButton from "../crystal-neuo/components/Button.vue";
|
|
11
|
+
import CnCheckbox from "../crystal-neuo/components/Checkbox.vue";
|
|
12
|
+
import CnInput from "../crystal-neuo/components/Input.vue";
|
|
13
|
+
import CnSelect from "../crystal-neuo/components/Select.vue";
|
|
14
|
+
import CnTextarea from "../crystal-neuo/components/Textarea.vue";
|
|
15
|
+
import CnToggle from "../crystal-neuo/components/Toggle.vue";
|
|
16
|
+
import { pascal, useOverrides } from "../overrides";
|
|
17
|
+
import BlocksField from "./BlocksField.vue";
|
|
18
|
+
import Icon from "./Icon";
|
|
19
|
+
import MediaField from "./MediaField.vue";
|
|
20
|
+
import RelatedCreate from "./RelatedCreate.vue";
|
|
21
|
+
import { useAdminI18n } from "../i18n";
|
|
22
|
+
defineOptions({ name: "AtelierAdminFieldInput" });
|
|
23
|
+
const RichTextEditor = defineAsyncComponent(() => import("./RichTextEditor.vue"));
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
form: { type: null, required: true },
|
|
26
|
+
name: { type: String, required: true },
|
|
27
|
+
field: { type: Object, required: true },
|
|
28
|
+
root: { type: Object, required: true },
|
|
29
|
+
sibling: { type: Object, required: true },
|
|
30
|
+
readOnly: { type: Boolean, required: false }
|
|
31
|
+
});
|
|
32
|
+
const { t } = useAdminI18n();
|
|
33
|
+
const entry = inject("atelier-entry", null);
|
|
34
|
+
const aiOn = ai ? ai.enabled() : ref(false);
|
|
35
|
+
const label = computed(() => (props.field.label ?? humanize(props.name.split(".").pop())) + (props.field.required ? " *" : ""));
|
|
36
|
+
const { schema } = useAtelierAdminSchema();
|
|
37
|
+
const otherLocales = computed(() => (schema.value?.locales.codes ?? []).filter((code) => code !== schema.value?.locales.default));
|
|
38
|
+
const localeTexts = computed(() => props.field.type === "custom" && props.field.fieldType === "locale-texts");
|
|
39
|
+
const visible = computed(() => applies(props.field, props.sibling ?? {}, props.root ?? {}) && !(localeTexts.value && !otherLocales.value.length));
|
|
40
|
+
const options = (list) => list.map((o) => typeof o === "string" ? { value: o, label: o } : { value: o.value, label: o.label ?? o.value });
|
|
41
|
+
const errorOf = (field) => {
|
|
42
|
+
const all = [...field.state.meta.errors, field.state.meta.errorMap?.onServer].filter(Boolean);
|
|
43
|
+
const first = all[0];
|
|
44
|
+
return typeof first === "string" ? first : first?.message;
|
|
45
|
+
};
|
|
46
|
+
const toLocal = (iso) => {
|
|
47
|
+
if (typeof iso !== "string" || !iso)
|
|
48
|
+
return "";
|
|
49
|
+
const d = new Date(iso);
|
|
50
|
+
return Number.isNaN(d.getTime()) ? "" : new Date(d.getTime() - d.getTimezoneOffset() * 6e4).toISOString().slice(0, 16);
|
|
51
|
+
};
|
|
52
|
+
const fromLocal = (local) => local ? new Date(local).toISOString().replace(/\.\d{3}Z$/, "Z") : null;
|
|
53
|
+
const json = (value) => value === void 0 || value === null ? "" : JSON.stringify(value, null, 2);
|
|
54
|
+
function parseJson(text, set) {
|
|
55
|
+
try {
|
|
56
|
+
set(text.trim() ? JSON.parse(text) : null);
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const target = computed(() => props.field.type === "relation" ? schema.value?.collections.find((c) => c.name === props.field.to) : void 0);
|
|
61
|
+
const related = useQuery({
|
|
62
|
+
queryKey: ["atelier", "collections", computed(() => target.value?.name ?? ""), "choices"],
|
|
63
|
+
queryFn: () => atelierFetch(`/collections/${encodeURIComponent(target.value.name)}`, { query: { limit: 100, draft: "true" } }),
|
|
64
|
+
enabled: computed(() => !!target.value)
|
|
65
|
+
});
|
|
66
|
+
const creating = ref(false);
|
|
67
|
+
const relatedOptions = computed(() => {
|
|
68
|
+
const key = titleField(target.value);
|
|
69
|
+
return (related.data.value?.items ?? []).map((e) => ({ value: e.id, label: String(key && e.data[key] || e.id) }));
|
|
70
|
+
});
|
|
71
|
+
const fieldOverride = useOverrides()(`Field${pascal(props.field.type === "custom" ? props.field.fieldType : props.field.type)}`);
|
|
72
|
+
const custom = computed(() => props.field.type === "custom" && props.field.input ? resolveComponent(props.field.input) : void 0);
|
|
73
|
+
const inputType = { text: "text", slug: "text", email: "email", url: "url", color: "color" };
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
77
|
+
<template v-if="visible">
|
|
78
|
+
<!-- an object: its own fields, in a group -->
|
|
79
|
+
<fieldset
|
|
80
|
+
v-if="field.type === 'object'"
|
|
81
|
+
class="app-fieldset"
|
|
82
|
+
>
|
|
83
|
+
<legend class="cn-label">
|
|
84
|
+
{{ label }}
|
|
85
|
+
</legend>
|
|
86
|
+
<AtelierAdminFieldInput
|
|
87
|
+
v-for="(sub, key) in field.fields"
|
|
88
|
+
:key="key"
|
|
89
|
+
:form="form"
|
|
90
|
+
:name="`${name}.${key}`"
|
|
91
|
+
:field="sub"
|
|
92
|
+
:root="root"
|
|
93
|
+
:sibling="sibling?.[name.split('.').pop()] ?? {}"
|
|
94
|
+
:read-only="readOnly"
|
|
95
|
+
/>
|
|
96
|
+
</fieldset>
|
|
97
|
+
|
|
98
|
+
<!-- a repeater: a list of items with the same fields -->
|
|
99
|
+
<form.Field
|
|
100
|
+
v-else-if="field.type === 'repeater'"
|
|
101
|
+
:name="name"
|
|
102
|
+
mode="array"
|
|
103
|
+
>
|
|
104
|
+
<template #default="{ field: list }">
|
|
105
|
+
<fieldset class="app-fieldset">
|
|
106
|
+
<legend class="cn-label">
|
|
107
|
+
{{ label }}
|
|
108
|
+
</legend>
|
|
109
|
+
<div
|
|
110
|
+
v-for="(item, i) in list.state.value ?? []"
|
|
111
|
+
:key="i"
|
|
112
|
+
class="app-repeater__item app-fieldset"
|
|
113
|
+
>
|
|
114
|
+
<AtelierAdminFieldInput
|
|
115
|
+
v-for="(sub, key) in field.fields"
|
|
116
|
+
:key="key"
|
|
117
|
+
:form="form"
|
|
118
|
+
:name="`${name}[${i}].${key}`"
|
|
119
|
+
:field="sub"
|
|
120
|
+
:root="root"
|
|
121
|
+
:sibling="item"
|
|
122
|
+
:read-only="readOnly"
|
|
123
|
+
/>
|
|
124
|
+
<div>
|
|
125
|
+
<CnButton
|
|
126
|
+
variant="ghost"
|
|
127
|
+
size="sm"
|
|
128
|
+
:disabled="readOnly"
|
|
129
|
+
@click="list.removeValue(i)"
|
|
130
|
+
>
|
|
131
|
+
<Icon name="trash-2" />
|
|
132
|
+
{{ t("field.remove") }}
|
|
133
|
+
</CnButton>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
<div>
|
|
137
|
+
<CnButton
|
|
138
|
+
variant="secondary"
|
|
139
|
+
size="sm"
|
|
140
|
+
:disabled="readOnly"
|
|
141
|
+
@click="list.pushValue({})"
|
|
142
|
+
>
|
|
143
|
+
<Icon name="plus" />
|
|
144
|
+
{{ t("field.add") }}
|
|
145
|
+
</CnButton>
|
|
146
|
+
</div>
|
|
147
|
+
</fieldset>
|
|
148
|
+
</template>
|
|
149
|
+
</form.Field>
|
|
150
|
+
|
|
151
|
+
<!-- blocks: cards with their fields, unless the app replaces the input -->
|
|
152
|
+
<BlocksField
|
|
153
|
+
v-else-if="field.type === 'blocks' && !fieldOverride"
|
|
154
|
+
:form="form"
|
|
155
|
+
:name="name"
|
|
156
|
+
:label="label"
|
|
157
|
+
:rules="{ ...field.allow ? { allow: [...field.allow] } : {}, min: field.minItems, max: field.maxItems }"
|
|
158
|
+
:root="root"
|
|
159
|
+
:read-only="readOnly"
|
|
160
|
+
/>
|
|
161
|
+
|
|
162
|
+
<form.Field
|
|
163
|
+
v-else
|
|
164
|
+
:name="name"
|
|
165
|
+
>
|
|
166
|
+
<template #default="{ field: f }">
|
|
167
|
+
<div class="cn-field">
|
|
168
|
+
<component
|
|
169
|
+
:is="fieldOverride"
|
|
170
|
+
v-if="fieldOverride"
|
|
171
|
+
:model-value="f.state.value"
|
|
172
|
+
:field="field"
|
|
173
|
+
:label="label"
|
|
174
|
+
:error="errorOf(f)"
|
|
175
|
+
:disabled="readOnly"
|
|
176
|
+
@update:model-value="f.handleChange"
|
|
177
|
+
/>
|
|
178
|
+
<CnToggle
|
|
179
|
+
v-else-if="field.type === 'boolean'"
|
|
180
|
+
:checked="!!f.state.value"
|
|
181
|
+
:label="label"
|
|
182
|
+
:disabled="readOnly"
|
|
183
|
+
@update:checked="f.handleChange"
|
|
184
|
+
/>
|
|
185
|
+
|
|
186
|
+
<MediaField
|
|
187
|
+
v-else-if="field.type === 'media'"
|
|
188
|
+
:model-value="f.state.value ?? null"
|
|
189
|
+
:label="label"
|
|
190
|
+
:hint="field.help"
|
|
191
|
+
:error="errorOf(f)"
|
|
192
|
+
:disabled="readOnly"
|
|
193
|
+
@update:model-value="f.handleChange"
|
|
194
|
+
/>
|
|
195
|
+
<CnSelect
|
|
196
|
+
v-else-if="field.type === 'select' || field.type === 'relation' && !field.many"
|
|
197
|
+
:model-value="f.state.value ?? ''"
|
|
198
|
+
:label="label"
|
|
199
|
+
:options="[{ value: '', label: '\u2014' }, ...field.type === 'select' ? options(field.options) : relatedOptions]"
|
|
200
|
+
:error="errorOf(f)"
|
|
201
|
+
:disabled="readOnly"
|
|
202
|
+
@update:model-value="(v) => f.handleChange(v || null)"
|
|
203
|
+
/>
|
|
204
|
+
|
|
205
|
+
<fieldset
|
|
206
|
+
v-else-if="field.type === 'multiSelect' || field.type === 'relation'"
|
|
207
|
+
class="app-fieldset"
|
|
208
|
+
>
|
|
209
|
+
<legend class="cn-label">
|
|
210
|
+
{{ label }}
|
|
211
|
+
</legend>
|
|
212
|
+
<CnCheckbox
|
|
213
|
+
v-for="o in field.type === 'multiSelect' ? options(field.options) : relatedOptions"
|
|
214
|
+
:key="o.value"
|
|
215
|
+
:label="o.label"
|
|
216
|
+
:checked="(f.state.value ?? []).includes(o.value)"
|
|
217
|
+
:disabled="readOnly"
|
|
218
|
+
@update:checked="(on) => f.handleChange(on ? [...f.state.value ?? [], o.value] : (f.state.value ?? []).filter((x) => x !== o.value))"
|
|
219
|
+
/>
|
|
220
|
+
<span
|
|
221
|
+
v-if="errorOf(f)"
|
|
222
|
+
class="cn-field__message"
|
|
223
|
+
role="alert"
|
|
224
|
+
>{{ errorOf(f) }}</span>
|
|
225
|
+
</fieldset>
|
|
226
|
+
|
|
227
|
+
<CnInput
|
|
228
|
+
v-else-if="field.type === 'number'"
|
|
229
|
+
:model-value="f.state.value === null || f.state.value === void 0 ? '' : String(f.state.value)"
|
|
230
|
+
:label="label"
|
|
231
|
+
type="number"
|
|
232
|
+
:step="field.integer ? 1 : 'any'"
|
|
233
|
+
:min="field.min"
|
|
234
|
+
:max="field.max"
|
|
235
|
+
:hint="field.help"
|
|
236
|
+
:error="errorOf(f)"
|
|
237
|
+
:disabled="readOnly"
|
|
238
|
+
@update:model-value="(v) => f.handleChange(v === '' ? null : Number(v))"
|
|
239
|
+
@blur="f.handleBlur"
|
|
240
|
+
/>
|
|
241
|
+
|
|
242
|
+
<CnInput
|
|
243
|
+
v-else-if="field.type === 'date'"
|
|
244
|
+
:model-value="field.mode === 'datetime' ? toLocal(f.state.value) : f.state.value ?? ''"
|
|
245
|
+
:label="label"
|
|
246
|
+
:type="field.mode === 'datetime' ? 'datetime-local' : field.mode === 'time' ? 'time' : 'date'"
|
|
247
|
+
:hint="field.help"
|
|
248
|
+
:error="errorOf(f)"
|
|
249
|
+
:disabled="readOnly"
|
|
250
|
+
@update:model-value="(v) => f.handleChange(field.mode === 'datetime' ? fromLocal(v) : v || null)"
|
|
251
|
+
/>
|
|
252
|
+
|
|
253
|
+
<CnTextarea
|
|
254
|
+
v-else-if="field.type === 'textarea'"
|
|
255
|
+
:model-value="f.state.value ?? ''"
|
|
256
|
+
:label="label"
|
|
257
|
+
:rows="field.rows ?? 4"
|
|
258
|
+
:hint="field.help"
|
|
259
|
+
:error="errorOf(f)"
|
|
260
|
+
:disabled="readOnly"
|
|
261
|
+
@update:model-value="(v) => f.handleChange(v || null)"
|
|
262
|
+
@blur="f.handleBlur"
|
|
263
|
+
/>
|
|
264
|
+
|
|
265
|
+
<RichTextEditor
|
|
266
|
+
v-else-if="field.type === 'richText'"
|
|
267
|
+
:model-value="f.state.value ?? null"
|
|
268
|
+
:label="label"
|
|
269
|
+
:hint="field.help"
|
|
270
|
+
:error="errorOf(f)"
|
|
271
|
+
:disabled="readOnly"
|
|
272
|
+
@update:model-value="f.handleChange"
|
|
273
|
+
/>
|
|
274
|
+
|
|
275
|
+
<fieldset
|
|
276
|
+
v-else-if="localeTexts"
|
|
277
|
+
class="app-fieldset"
|
|
278
|
+
>
|
|
279
|
+
<legend class="cn-label">
|
|
280
|
+
{{ label }}
|
|
281
|
+
</legend>
|
|
282
|
+
<CnInput
|
|
283
|
+
v-for="code in otherLocales"
|
|
284
|
+
:key="code"
|
|
285
|
+
:model-value="f.state.value?.[code] ?? ''"
|
|
286
|
+
:label="code.toUpperCase()"
|
|
287
|
+
:disabled="readOnly"
|
|
288
|
+
@update:model-value="(v) => f.handleChange({ ...f.state.value, [code]: v || void 0 })"
|
|
289
|
+
/>
|
|
290
|
+
</fieldset>
|
|
291
|
+
|
|
292
|
+
<component
|
|
293
|
+
:is="custom"
|
|
294
|
+
v-else-if="custom"
|
|
295
|
+
:model-value="f.state.value"
|
|
296
|
+
:field="field"
|
|
297
|
+
:label="label"
|
|
298
|
+
:disabled="readOnly"
|
|
299
|
+
@update:model-value="f.handleChange"
|
|
300
|
+
/>
|
|
301
|
+
|
|
302
|
+
<CnTextarea
|
|
303
|
+
v-else-if="field.type === 'json' || field.type === 'custom'"
|
|
304
|
+
:model-value="json(f.state.value)"
|
|
305
|
+
:label="label"
|
|
306
|
+
:rows="6"
|
|
307
|
+
:hint="field.help ?? t('field.jsonHint')"
|
|
308
|
+
:error="errorOf(f)"
|
|
309
|
+
:disabled="readOnly"
|
|
310
|
+
@update:model-value="(v) => parseJson(v, f.handleChange)"
|
|
311
|
+
/>
|
|
312
|
+
|
|
313
|
+
<CnInput
|
|
314
|
+
v-else
|
|
315
|
+
:model-value="f.state.value ?? ''"
|
|
316
|
+
:label="label"
|
|
317
|
+
:type="inputType[field.type] ?? 'text'"
|
|
318
|
+
:hint="field.help"
|
|
319
|
+
:error="errorOf(f)"
|
|
320
|
+
:disabled="readOnly"
|
|
321
|
+
:maxlength="'maxLength' in field ? field.maxLength : void 0"
|
|
322
|
+
@update:model-value="(v) => f.handleChange(v || null)"
|
|
323
|
+
@blur="f.handleBlur"
|
|
324
|
+
/>
|
|
325
|
+
<component
|
|
326
|
+
:is="ai.TextActions"
|
|
327
|
+
v-if="ai && aiOn && entry && !readOnly && !name.includes('.') && (field.type === 'text' || field.type === 'textarea') && f.state.value"
|
|
328
|
+
:type="entry.type"
|
|
329
|
+
:field="name"
|
|
330
|
+
:value="String(f.state.value)"
|
|
331
|
+
:locale="entry.locale"
|
|
332
|
+
:locales="entry.locales"
|
|
333
|
+
@apply="(v) => f.handleChange(v)"
|
|
334
|
+
/>
|
|
335
|
+
<template v-if="field.type === 'relation' && target?.can.create && !readOnly">
|
|
336
|
+
<div>
|
|
337
|
+
<CnButton
|
|
338
|
+
variant="ghost"
|
|
339
|
+
size="sm"
|
|
340
|
+
@click="creating = true"
|
|
341
|
+
>
|
|
342
|
+
<Icon name="plus" />
|
|
343
|
+
{{ t("field.newRelated", { name: singularLabel(target).toLowerCase() }) }}
|
|
344
|
+
</CnButton>
|
|
345
|
+
</div>
|
|
346
|
+
<RelatedCreate
|
|
347
|
+
v-model:open="creating"
|
|
348
|
+
:collection="target.name"
|
|
349
|
+
@created="(id) => f.handleChange(field.many ? [...f.state.value ?? [], id] : id)"
|
|
350
|
+
/>
|
|
351
|
+
</template>
|
|
352
|
+
</div>
|
|
353
|
+
</template>
|
|
354
|
+
</form.Field>
|
|
355
|
+
</template>
|
|
356
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Field } from '../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
form: any;
|
|
4
|
+
name: string;
|
|
5
|
+
field: Field;
|
|
6
|
+
/** The whole entry's values and this field's siblings, for `when` conditions. */
|
|
7
|
+
root: Record<string, unknown>;
|
|
8
|
+
sibling: Record<string, unknown>;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/vue-query";
|
|
3
|
+
import { computed, ref } from "vue";
|
|
4
|
+
import { atelierFetch } from "../composables/useAtelierAdmin";
|
|
5
|
+
import { refDebounced } from "../composables/debounced";
|
|
6
|
+
import CnButton from "../crystal-neuo/components/Button.vue";
|
|
7
|
+
import CnDialog from "../crystal-neuo/components/Dialog.vue";
|
|
8
|
+
import CnInput from "../crystal-neuo/components/Input.vue";
|
|
9
|
+
import { useAdminToast } from "../toast";
|
|
10
|
+
import { useAdminI18n } from "../i18n";
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
id: { type: String, required: true }
|
|
13
|
+
});
|
|
14
|
+
const { t } = useAdminI18n();
|
|
15
|
+
const toast = useAdminToast();
|
|
16
|
+
const client = useQueryClient();
|
|
17
|
+
const PAGE = 50;
|
|
18
|
+
const q = ref("");
|
|
19
|
+
const from = ref("");
|
|
20
|
+
const to = ref("");
|
|
21
|
+
const offset = ref(0);
|
|
22
|
+
const search = refDebounced(q, 300);
|
|
23
|
+
const base = computed(() => `/api/_atelier/forms/${encodeURIComponent(props.id)}/submissions`);
|
|
24
|
+
const filters = computed(() => ({ ...search.value ? { q: search.value } : {}, ...from.value ? { from: from.value } : {}, ...to.value ? { to: to.value } : {} }));
|
|
25
|
+
const queryKey = computed(() => ["atelier", "form-submissions", props.id, filters.value, offset.value]);
|
|
26
|
+
const page = useQuery({
|
|
27
|
+
queryKey,
|
|
28
|
+
queryFn: () => atelierFetch(`/forms/${encodeURIComponent(props.id)}/submissions`, { query: { ...filters.value, limit: PAGE, offset: offset.value } })
|
|
29
|
+
});
|
|
30
|
+
const columns = computed(() => (page.data.value?.fields ?? []).filter((f) => f.type !== "hidden").slice(0, 4));
|
|
31
|
+
const exportUrl = (format) => `${base.value}?${new URLSearchParams({ ...filters.value, format })}`;
|
|
32
|
+
const shown = (value) => value && typeof value === "object" ? value.name : value === true ? "\u2713" : value === false ? "" : String(value ?? "");
|
|
33
|
+
const isFile = (value) => !!value && typeof value === "object" && "name" in value;
|
|
34
|
+
const refresh = () => client.invalidateQueries({ queryKey: ["atelier", "form-submissions", props.id] });
|
|
35
|
+
const remove = useMutation({
|
|
36
|
+
mutationFn: (submission) => atelierFetch(`/forms/${encodeURIComponent(props.id)}/submissions/${encodeURIComponent(submission)}`, { method: "DELETE" }),
|
|
37
|
+
onSuccess: refresh,
|
|
38
|
+
onError: (e) => toast.add({ color: "error", title: e.message })
|
|
39
|
+
});
|
|
40
|
+
const erasing = ref(false);
|
|
41
|
+
const email = ref("");
|
|
42
|
+
async function erase() {
|
|
43
|
+
try {
|
|
44
|
+
const { deleted } = await atelierFetch("/forms/erase", { method: "POST", body: { email: email.value } });
|
|
45
|
+
toast.add({ color: "success", title: t("forms.erased", { count: deleted }) });
|
|
46
|
+
email.value = "";
|
|
47
|
+
await refresh();
|
|
48
|
+
} catch (e) {
|
|
49
|
+
toast.add({ color: "error", title: e.message });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<template>
|
|
55
|
+
<section
|
|
56
|
+
class="app-comments"
|
|
57
|
+
aria-labelledby="atelier-form-submissions"
|
|
58
|
+
data-form-submissions
|
|
59
|
+
>
|
|
60
|
+
<h2
|
|
61
|
+
id="atelier-form-submissions"
|
|
62
|
+
class="app-section__title"
|
|
63
|
+
>
|
|
64
|
+
{{ t("forms.submissions") }} <span v-if="page.data.value">({{ page.data.value.total }})</span>
|
|
65
|
+
</h2>
|
|
66
|
+
<div class="app-row">
|
|
67
|
+
<CnInput
|
|
68
|
+
v-model="q"
|
|
69
|
+
type="search"
|
|
70
|
+
:label="t('list.search')"
|
|
71
|
+
/>
|
|
72
|
+
<CnInput
|
|
73
|
+
v-model="from"
|
|
74
|
+
type="date"
|
|
75
|
+
:label="t('forms.from')"
|
|
76
|
+
/>
|
|
77
|
+
<CnInput
|
|
78
|
+
v-model="to"
|
|
79
|
+
type="date"
|
|
80
|
+
:label="t('forms.to')"
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="app-row">
|
|
84
|
+
<a
|
|
85
|
+
class="cn-button cn-button--secondary cn-button--size-sm"
|
|
86
|
+
:href="exportUrl('csv')"
|
|
87
|
+
download
|
|
88
|
+
>{{ t("forms.exportCsv") }}</a>
|
|
89
|
+
<a
|
|
90
|
+
class="cn-button cn-button--ghost cn-button--size-sm"
|
|
91
|
+
:href="exportUrl('json')"
|
|
92
|
+
download
|
|
93
|
+
>{{ t("forms.exportJson") }}</a>
|
|
94
|
+
<CnButton
|
|
95
|
+
variant="ghost"
|
|
96
|
+
size="sm"
|
|
97
|
+
@click="erasing = true"
|
|
98
|
+
>
|
|
99
|
+
{{ t("forms.erase") }}
|
|
100
|
+
</CnButton>
|
|
101
|
+
</div>
|
|
102
|
+
<p v-if="page.data.value && !page.data.value.items.length">
|
|
103
|
+
{{ t("forms.none") }}
|
|
104
|
+
</p>
|
|
105
|
+
<div
|
|
106
|
+
v-else-if="page.data.value"
|
|
107
|
+
class="app-table-wrap"
|
|
108
|
+
>
|
|
109
|
+
<table class="cn-table cn-table--default cn-table--size-sm">
|
|
110
|
+
<thead>
|
|
111
|
+
<tr>
|
|
112
|
+
<th scope="col">
|
|
113
|
+
{{ t("forms.submitted") }}
|
|
114
|
+
</th>
|
|
115
|
+
<th
|
|
116
|
+
v-for="column in columns"
|
|
117
|
+
:key="column.name"
|
|
118
|
+
scope="col"
|
|
119
|
+
>
|
|
120
|
+
{{ column.label }}
|
|
121
|
+
</th>
|
|
122
|
+
<th scope="col">
|
|
123
|
+
<span class="sr-only">{{ t("common.actions") }}</span>
|
|
124
|
+
</th>
|
|
125
|
+
</tr>
|
|
126
|
+
</thead>
|
|
127
|
+
<tbody>
|
|
128
|
+
<tr
|
|
129
|
+
v-for="item in page.data.value.items"
|
|
130
|
+
:key="item.id"
|
|
131
|
+
>
|
|
132
|
+
<td>
|
|
133
|
+
<time :datetime="item.createdAt">{{ new Date(item.createdAt).toLocaleString() }}</time>
|
|
134
|
+
</td>
|
|
135
|
+
<td
|
|
136
|
+
v-for="column in columns"
|
|
137
|
+
:key="column.name"
|
|
138
|
+
>
|
|
139
|
+
<a
|
|
140
|
+
v-if="isFile(item.data[column.name])"
|
|
141
|
+
:href="`${base}/${encodeURIComponent(item.id)}/files/${encodeURIComponent(column.name)}`"
|
|
142
|
+
download
|
|
143
|
+
>{{ shown(item.data[column.name]) }}</a>
|
|
144
|
+
<template v-else>
|
|
145
|
+
{{ shown(item.data[column.name]) }}
|
|
146
|
+
</template>
|
|
147
|
+
</td>
|
|
148
|
+
<td>
|
|
149
|
+
<CnButton
|
|
150
|
+
variant="ghost"
|
|
151
|
+
size="sm"
|
|
152
|
+
@click="remove.mutate(item.id)"
|
|
153
|
+
>
|
|
154
|
+
{{ t("common.delete") }}
|
|
155
|
+
</CnButton>
|
|
156
|
+
</td>
|
|
157
|
+
</tr>
|
|
158
|
+
</tbody>
|
|
159
|
+
</table>
|
|
160
|
+
</div>
|
|
161
|
+
<div
|
|
162
|
+
v-if="page.data.value && page.data.value.total > PAGE"
|
|
163
|
+
class="app-row"
|
|
164
|
+
>
|
|
165
|
+
<CnButton
|
|
166
|
+
variant="ghost"
|
|
167
|
+
size="sm"
|
|
168
|
+
:disabled="offset === 0"
|
|
169
|
+
@click="offset = Math.max(0, offset - PAGE)"
|
|
170
|
+
>
|
|
171
|
+
{{ t("forms.previous") }}
|
|
172
|
+
</CnButton>
|
|
173
|
+
<CnButton
|
|
174
|
+
variant="ghost"
|
|
175
|
+
size="sm"
|
|
176
|
+
:disabled="offset + PAGE >= page.data.value.total"
|
|
177
|
+
@click="offset += PAGE"
|
|
178
|
+
>
|
|
179
|
+
{{ t("forms.next") }}
|
|
180
|
+
</CnButton>
|
|
181
|
+
</div>
|
|
182
|
+
<CnDialog
|
|
183
|
+
v-model:open="erasing"
|
|
184
|
+
:title="t('forms.eraseTitle')"
|
|
185
|
+
:description="t('forms.eraseBody')"
|
|
186
|
+
:confirm-label="t('forms.erase')"
|
|
187
|
+
variant="destructive"
|
|
188
|
+
@confirm="erase"
|
|
189
|
+
>
|
|
190
|
+
<CnInput
|
|
191
|
+
v-model="email"
|
|
192
|
+
type="email"
|
|
193
|
+
:label="t('common.email')"
|
|
194
|
+
/>
|
|
195
|
+
</CnDialog>
|
|
196
|
+
</section>
|
|
197
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type __VLS_ModelProps = {
|
|
2
|
+
'open'?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"update:open": (value: boolean) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
7
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|