katecms 0.0.0-stage → 1.0.0-beta.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/README.md +5 -3
- package/dist/module.d.mts +93 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +579 -0
- package/dist/runtime/assets/img/katecms-logo.svg +17 -0
- package/dist/runtime/composables/getCollection.d.ts +62 -0
- package/dist/runtime/composables/getCollection.js +167 -0
- package/dist/runtime/composables/getOptions.d.ts +22 -0
- package/dist/runtime/composables/getOptions.js +22 -0
- package/dist/runtime/composables/getQueryCollection.d.ts +95 -0
- package/dist/runtime/composables/getQueryCollection.js +199 -0
- package/dist/runtime/composables/getTerms.d.ts +79 -0
- package/dist/runtime/composables/getTerms.js +148 -0
- package/dist/runtime/composables/useAuth.d.ts +14 -0
- package/dist/runtime/composables/useAuth.js +33 -0
- package/dist/runtime/composables/useAuthCooldown.d.ts +6 -0
- package/dist/runtime/composables/useAuthCooldown.js +44 -0
- package/dist/runtime/composables/useCmsPaths.d.ts +15 -0
- package/dist/runtime/composables/useCmsPaths.js +21 -0
- package/dist/runtime/composables/useKateCmsExtensions.d.ts +49 -0
- package/dist/runtime/composables/useKateCmsExtensions.js +29 -0
- package/dist/runtime/composables/useMediaLibrary.d.ts +84 -0
- package/dist/runtime/composables/useMediaLibrary.js +140 -0
- package/dist/runtime/composables/useMenuAccess.d.ts +8 -0
- package/dist/runtime/composables/useMenuAccess.js +16 -0
- package/dist/runtime/internal/admin/AdminHeader.d.vue.ts +24 -0
- package/dist/runtime/internal/admin/AdminHeader.vue +91 -0
- package/dist/runtime/internal/admin/AdminHeader.vue.d.ts +24 -0
- package/dist/runtime/internal/admin/AppMenu.d.vue.ts +3 -0
- package/dist/runtime/internal/admin/AppMenu.vue +244 -0
- package/dist/runtime/internal/admin/AppMenu.vue.d.ts +3 -0
- package/dist/runtime/internal/admin/AppUser.d.vue.ts +3 -0
- package/dist/runtime/internal/admin/AppUser.vue +227 -0
- package/dist/runtime/internal/admin/AppUser.vue.d.ts +3 -0
- package/dist/runtime/internal/admin/CollectionEntryForm.d.vue.ts +41 -0
- package/dist/runtime/internal/admin/CollectionEntryForm.vue +916 -0
- package/dist/runtime/internal/admin/CollectionEntryForm.vue.d.ts +41 -0
- package/dist/runtime/internal/admin/ConfirmDialog.d.vue.ts +28 -0
- package/dist/runtime/internal/admin/ConfirmDialog.vue +136 -0
- package/dist/runtime/internal/admin/ConfirmDialog.vue.d.ts +28 -0
- package/dist/runtime/internal/admin/DictionaryTermForm.d.vue.ts +33 -0
- package/dist/runtime/internal/admin/DictionaryTermForm.vue +328 -0
- package/dist/runtime/internal/admin/DictionaryTermForm.vue.d.ts +33 -0
- package/dist/runtime/internal/admin/EntryRevisions.d.vue.ts +15 -0
- package/dist/runtime/internal/admin/EntryRevisions.vue +125 -0
- package/dist/runtime/internal/admin/EntryRevisions.vue.d.ts +15 -0
- package/dist/runtime/internal/admin/MediaLibraryFilters.d.vue.ts +16 -0
- package/dist/runtime/internal/admin/MediaLibraryFilters.vue +153 -0
- package/dist/runtime/internal/admin/MediaLibraryFilters.vue.d.ts +16 -0
- package/dist/runtime/internal/admin/MediaLibraryModal.d.vue.ts +65 -0
- package/dist/runtime/internal/admin/MediaLibraryModal.vue +451 -0
- package/dist/runtime/internal/admin/MediaLibraryModal.vue.d.ts +65 -0
- package/dist/runtime/internal/admin/OptionPageForm.d.vue.ts +26 -0
- package/dist/runtime/internal/admin/OptionPageForm.vue +222 -0
- package/dist/runtime/internal/admin/OptionPageForm.vue.d.ts +26 -0
- package/dist/runtime/internal/admin/UserAvatarField.d.vue.ts +12 -0
- package/dist/runtime/internal/admin/UserAvatarField.vue +305 -0
- package/dist/runtime/internal/admin/UserAvatarField.vue.d.ts +12 -0
- package/dist/runtime/internal/fields/AccordionField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/AccordionField.vue +220 -0
- package/dist/runtime/internal/fields/AccordionField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/ButtonGroupField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/ButtonGroupField.vue +109 -0
- package/dist/runtime/internal/fields/ButtonGroupField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/CheckboxField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/CheckboxField.vue +190 -0
- package/dist/runtime/internal/fields/CheckboxField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/ColorPickerField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/ColorPickerField.vue +791 -0
- package/dist/runtime/internal/fields/ColorPickerField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/DatePickerField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/DatePickerField.vue +26 -0
- package/dist/runtime/internal/fields/DatePickerField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/DateTimePickerField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/DateTimePickerField.vue +26 -0
- package/dist/runtime/internal/fields/DateTimePickerField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/DictionaryField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/DictionaryField.vue +345 -0
- package/dist/runtime/internal/fields/DictionaryField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/EmailField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/EmailField.vue +21 -0
- package/dist/runtime/internal/fields/EmailField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/FileField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/FileField.vue +408 -0
- package/dist/runtime/internal/fields/FileField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/FlexibleContentField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/FlexibleContentField.vue +1114 -0
- package/dist/runtime/internal/fields/FlexibleContentField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/GalleryField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/GalleryField.vue +584 -0
- package/dist/runtime/internal/fields/GalleryField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/GroupField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/GroupField.vue +111 -0
- package/dist/runtime/internal/fields/GroupField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/ImageField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/ImageField.vue +638 -0
- package/dist/runtime/internal/fields/ImageField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/ImageSelectField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/ImageSelectField.vue +179 -0
- package/dist/runtime/internal/fields/ImageSelectField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/LinkField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/LinkField.vue +303 -0
- package/dist/runtime/internal/fields/LinkField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/NumberField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/NumberField.vue +25 -0
- package/dist/runtime/internal/fields/NumberField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/OembedField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/OembedField.vue +161 -0
- package/dist/runtime/internal/fields/OembedField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/OpenStreetMapField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/OpenStreetMapField.vue +1502 -0
- package/dist/runtime/internal/fields/OpenStreetMapField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/PageLinkField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/PageLinkField.vue +153 -0
- package/dist/runtime/internal/fields/PageLinkField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/PasswordField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/PasswordField.vue +108 -0
- package/dist/runtime/internal/fields/PasswordField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/PostObjectField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/PostObjectField.vue +151 -0
- package/dist/runtime/internal/fields/PostObjectField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/RadioField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/RadioField.vue +163 -0
- package/dist/runtime/internal/fields/RadioField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/RangeField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/RangeField.vue +48 -0
- package/dist/runtime/internal/fields/RangeField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/RelationshipField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/RelationshipField.vue +525 -0
- package/dist/runtime/internal/fields/RelationshipField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/RepeaterField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/RepeaterField.vue +856 -0
- package/dist/runtime/internal/fields/RepeaterField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/SelectField.d.vue.ts +21 -0
- package/dist/runtime/internal/fields/SelectField.vue +101 -0
- package/dist/runtime/internal/fields/SelectField.vue.d.ts +21 -0
- package/dist/runtime/internal/fields/SeparatorField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/SeparatorField.vue +63 -0
- package/dist/runtime/internal/fields/SeparatorField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/TabField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/TabField.vue +210 -0
- package/dist/runtime/internal/fields/TabField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/TextField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/TextField.vue +22 -0
- package/dist/runtime/internal/fields/TextField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/TextareaField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/TextareaField.vue +62 -0
- package/dist/runtime/internal/fields/TextareaField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/TimePickerField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/TimePickerField.vue +24 -0
- package/dist/runtime/internal/fields/TimePickerField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/TrueFalseField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/TrueFalseField.vue +151 -0
- package/dist/runtime/internal/fields/TrueFalseField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/UrlField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/UrlField.vue +21 -0
- package/dist/runtime/internal/fields/UrlField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/UserField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/UserField.vue +164 -0
- package/dist/runtime/internal/fields/UserField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/WysiwygField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/WysiwygField.vue +971 -0
- package/dist/runtime/internal/fields/WysiwygField.vue.d.ts +0 -0
- package/dist/runtime/internal/parts/DateTimeControl.d.vue.ts +90 -0
- package/dist/runtime/internal/parts/DateTimeControl.vue +568 -0
- package/dist/runtime/internal/parts/DateTimeControl.vue.d.ts +90 -0
- package/dist/runtime/internal/parts/FieldAddon.d.vue.ts +0 -0
- package/dist/runtime/internal/parts/FieldAddon.vue +43 -0
- package/dist/runtime/internal/parts/FieldAddon.vue.d.ts +0 -0
- package/dist/runtime/internal/parts/FieldInstructions.d.vue.ts +0 -0
- package/dist/runtime/internal/parts/FieldInstructions.vue +24 -0
- package/dist/runtime/internal/parts/FieldInstructions.vue.d.ts +0 -0
- package/dist/runtime/internal/parts/FieldLabel.d.vue.ts +0 -0
- package/dist/runtime/internal/parts/FieldLabel.vue +40 -0
- package/dist/runtime/internal/parts/FieldLabel.vue.d.ts +0 -0
- package/dist/runtime/internal/parts/FieldWrapper.d.vue.ts +0 -0
- package/dist/runtime/internal/parts/FieldWrapper.vue +47 -0
- package/dist/runtime/internal/parts/FieldWrapper.vue.d.ts +0 -0
- package/dist/runtime/internal/parts/ImageCropper.d.vue.ts +17 -0
- package/dist/runtime/internal/parts/ImageCropper.vue +363 -0
- package/dist/runtime/internal/parts/ImageCropper.vue.d.ts +17 -0
- package/dist/runtime/internal/parts/InputControl.d.vue.ts +0 -0
- package/dist/runtime/internal/parts/InputControl.vue +163 -0
- package/dist/runtime/internal/parts/InputControl.vue.d.ts +0 -0
- package/dist/runtime/internal/ui/UiButton.d.vue.ts +35 -0
- package/dist/runtime/internal/ui/UiButton.vue +204 -0
- package/dist/runtime/internal/ui/UiButton.vue.d.ts +35 -0
- package/dist/runtime/internal/ui/UiNotice.d.vue.ts +40 -0
- package/dist/runtime/internal/ui/UiNotice.vue +253 -0
- package/dist/runtime/internal/ui/UiNotice.vue.d.ts +40 -0
- package/dist/runtime/internal/ui/UiSelect.d.vue.ts +61 -0
- package/dist/runtime/internal/ui/UiSelect.vue +1212 -0
- package/dist/runtime/internal/ui/UiSelect.vue.d.ts +61 -0
- package/dist/runtime/middleware/auth-guard.d.ts +9 -0
- package/dist/runtime/middleware/auth-guard.js +37 -0
- package/dist/runtime/pages/admin/collections/[id].d.vue.ts +3 -0
- package/dist/runtime/pages/admin/collections/[id].vue +423 -0
- package/dist/runtime/pages/admin/collections/[id].vue.d.ts +3 -0
- package/dist/runtime/pages/admin/collections/create.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/collections/create.vue +179 -0
- package/dist/runtime/pages/admin/collections/create.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/collections/index.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/collections/index.vue +828 -0
- package/dist/runtime/pages/admin/collections/index.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/demo-fields.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/demo-fields.vue +1327 -0
- package/dist/runtime/pages/admin/demo-fields.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/dictionaries/[id].d.vue.ts +3 -0
- package/dist/runtime/pages/admin/dictionaries/[id].vue +213 -0
- package/dist/runtime/pages/admin/dictionaries/[id].vue.d.ts +3 -0
- package/dist/runtime/pages/admin/dictionaries/index.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/dictionaries/index.vue +387 -0
- package/dist/runtime/pages/admin/dictionaries/index.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/index.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/index.vue +138 -0
- package/dist/runtime/pages/admin/index.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/login.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/login.vue +373 -0
- package/dist/runtime/pages/admin/login.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/media.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/media.vue +1054 -0
- package/dist/runtime/pages/admin/media.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/options/[page].d.vue.ts +3 -0
- package/dist/runtime/pages/admin/options/[page].vue +151 -0
- package/dist/runtime/pages/admin/options/[page].vue.d.ts +3 -0
- package/dist/runtime/pages/admin/register.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/register.vue +391 -0
- package/dist/runtime/pages/admin/register.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/users/[id].d.vue.ts +3 -0
- package/dist/runtime/pages/admin/users/[id].vue +337 -0
- package/dist/runtime/pages/admin/users/[id].vue.d.ts +3 -0
- package/dist/runtime/pages/admin/users/create.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/users/create.vue +201 -0
- package/dist/runtime/pages/admin/users/create.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/users/index.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/users/index.vue +329 -0
- package/dist/runtime/pages/admin/users/index.vue.d.ts +3 -0
- package/dist/runtime/pages/index.d.vue.ts +3 -0
- package/dist/runtime/pages/index.vue +399 -0
- package/dist/runtime/pages/index.vue.d.ts +3 -0
- package/dist/runtime/server/api/_katecms/auth/login.post.d.ts +5 -0
- package/dist/runtime/server/api/_katecms/auth/login.post.js +44 -0
- package/dist/runtime/server/api/_katecms/auth/logout.post.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/auth/logout.post.js +6 -0
- package/dist/runtime/server/api/_katecms/auth/register.post.d.ts +19 -0
- package/dist/runtime/server/api/_katecms/auth/register.post.js +83 -0
- package/dist/runtime/server/api/_katecms/auth/state.get.d.ts +9 -0
- package/dist/runtime/server/api/_katecms/auth/state.get.js +12 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].delete.d.ts +15 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].delete.js +59 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].get.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].get.js +50 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].patch.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].patch.js +130 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/revisions/[revisionId].post.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/revisions/[revisionId].post.js +123 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/revisions.get.d.ts +6 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/revisions.get.js +31 -0
- package/dist/runtime/server/api/_katecms/collections/[collection].get.d.ts +8 -0
- package/dist/runtime/server/api/_katecms/collections/[collection].get.js +135 -0
- package/dist/runtime/server/api/_katecms/collections/[collection].post.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/collections/[collection].post.js +91 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].delete.d.ts +7 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].delete.js +31 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].get.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].get.js +45 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].patch.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].patch.js +83 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].get.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].get.js +38 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].post.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].post.js +64 -0
- package/dist/runtime/server/api/_katecms/media/[id]/regenerate.post.d.ts +8 -0
- package/dist/runtime/server/api/_katecms/media/[id]/regenerate.post.js +30 -0
- package/dist/runtime/server/api/_katecms/media/[id].delete.d.ts +7 -0
- package/dist/runtime/server/api/_katecms/media/[id].delete.js +22 -0
- package/dist/runtime/server/api/_katecms/media/[id].get.d.ts +9 -0
- package/dist/runtime/server/api/_katecms/media/[id].get.js +17 -0
- package/dist/runtime/server/api/_katecms/media/[id].patch.d.ts +6 -0
- package/dist/runtime/server/api/_katecms/media/[id].patch.js +48 -0
- package/dist/runtime/server/api/_katecms/media/index.get.d.ts +5 -0
- package/dist/runtime/server/api/_katecms/media/index.get.js +75 -0
- package/dist/runtime/server/api/_katecms/media/index.post.d.ts +9 -0
- package/dist/runtime/server/api/_katecms/media/index.post.js +84 -0
- package/dist/runtime/server/api/_katecms/media/regenerate.post.d.ts +7 -0
- package/dist/runtime/server/api/_katecms/media/regenerate.post.js +30 -0
- package/dist/runtime/server/api/_katecms/menu.get.d.ts +8 -0
- package/dist/runtime/server/api/_katecms/menu.get.js +14 -0
- package/dist/runtime/server/api/_katecms/oembed.get.d.ts +2 -0
- package/dist/runtime/server/api/_katecms/oembed.get.js +53 -0
- package/dist/runtime/server/api/_katecms/options/[page].get.d.ts +7 -0
- package/dist/runtime/server/api/_katecms/options/[page].get.js +28 -0
- package/dist/runtime/server/api/_katecms/options/[page].patch.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/options/[page].patch.js +36 -0
- package/dist/runtime/server/api/_katecms/query.get.d.ts +24 -0
- package/dist/runtime/server/api/_katecms/query.get.js +270 -0
- package/dist/runtime/server/api/_katecms/relation/entries.get.d.ts +17 -0
- package/dist/runtime/server/api/_katecms/relation/entries.get.js +74 -0
- package/dist/runtime/server/api/_katecms/relation/terms.get.d.ts +17 -0
- package/dist/runtime/server/api/_katecms/relation/terms.get.js +51 -0
- package/dist/runtime/server/api/_katecms/resolve.get.d.ts +17 -0
- package/dist/runtime/server/api/_katecms/resolve.get.js +116 -0
- package/dist/runtime/server/api/_katecms/terms.get.d.ts +20 -0
- package/dist/runtime/server/api/_katecms/terms.get.js +201 -0
- package/dist/runtime/server/api/_katecms/users/[id].delete.d.ts +11 -0
- package/dist/runtime/server/api/_katecms/users/[id].delete.js +45 -0
- package/dist/runtime/server/api/_katecms/users/[id].patch.d.ts +19 -0
- package/dist/runtime/server/api/_katecms/users/[id].patch.js +129 -0
- package/dist/runtime/server/api/_katecms/users.get.d.ts +10 -0
- package/dist/runtime/server/api/_katecms/users.get.js +34 -0
- package/dist/runtime/server/api/_katecms/users.post.d.ts +10 -0
- package/dist/runtime/server/api/_katecms/users.post.js +62 -0
- package/dist/runtime/server/api/uploads/[...key].get.d.ts +3 -0
- package/dist/runtime/server/api/uploads/[...key].get.js +28 -0
- package/dist/runtime/server/kit.d.ts +5 -0
- package/dist/runtime/server/kit.js +5 -0
- package/dist/runtime/server/middleware/admin-headers.d.ts +3 -0
- package/dist/runtime/server/middleware/admin-headers.js +12 -0
- package/dist/runtime/server/plugins/auto-migrate.d.ts +2 -0
- package/dist/runtime/server/plugins/auto-migrate.js +45 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/auth-attempts.d.ts +22 -0
- package/dist/runtime/server/utils/auth-attempts.js +42 -0
- package/dist/runtime/server/utils/auth-rate-limit.d.ts +11 -0
- package/dist/runtime/server/utils/auth-rate-limit.js +36 -0
- package/dist/runtime/server/utils/client-address.d.ts +16 -0
- package/dist/runtime/server/utils/client-address.js +23 -0
- package/dist/runtime/server/utils/collections.d.ts +42 -0
- package/dist/runtime/server/utils/collections.js +300 -0
- package/dist/runtime/server/utils/db.d.ts +3 -0
- package/dist/runtime/server/utils/db.js +25 -0
- package/dist/runtime/server/utils/dictionaries.d.ts +53 -0
- package/dist/runtime/server/utils/dictionaries.js +301 -0
- package/dist/runtime/server/utils/media-list.d.ts +18 -0
- package/dist/runtime/server/utils/media-list.js +84 -0
- package/dist/runtime/server/utils/media.d.ts +12 -0
- package/dist/runtime/server/utils/media.js +77 -0
- package/dist/runtime/server/utils/oembed-fetch.d.ts +4 -0
- package/dist/runtime/server/utils/oembed-fetch.js +142 -0
- package/dist/runtime/server/utils/options.d.ts +17 -0
- package/dist/runtime/server/utils/options.js +66 -0
- package/dist/runtime/server/utils/permissions.d.ts +13 -0
- package/dist/runtime/server/utils/permissions.js +20 -0
- package/dist/runtime/server/utils/public-fields-query.d.ts +6 -0
- package/dist/runtime/server/utils/public-fields-query.js +8 -0
- package/dist/runtime/server/utils/public-term.d.ts +8 -0
- package/dist/runtime/server/utils/public-term.js +80 -0
- package/dist/runtime/server/utils/regenerate.d.ts +12 -0
- package/dist/runtime/server/utils/regenerate.js +40 -0
- package/dist/runtime/server/utils/relation.d.ts +18 -0
- package/dist/runtime/server/utils/relation.js +77 -0
- package/dist/runtime/server/utils/request-address.d.ts +6 -0
- package/dist/runtime/server/utils/request-address.js +10 -0
- package/dist/runtime/server/utils/revisions.d.ts +20 -0
- package/dist/runtime/server/utils/revisions.js +172 -0
- package/dist/runtime/server/utils/session.d.ts +18 -0
- package/dist/runtime/server/utils/session.js +71 -0
- package/dist/runtime/server/utils/upload-headers.d.ts +2 -0
- package/dist/runtime/server/utils/upload-headers.js +30 -0
- package/dist/runtime/server/utils/users.d.ts +13 -0
- package/dist/runtime/server/utils/users.js +47 -0
- package/dist/runtime/utils/admin-users.d.ts +20 -0
- package/dist/runtime/utils/admin-users.js +19 -0
- package/dist/runtime/utils/auth-error.d.ts +6 -0
- package/dist/runtime/utils/auth-error.js +11 -0
- package/dist/runtime/utils/cms-paths.d.ts +5 -0
- package/dist/runtime/utils/cms-paths.js +13 -0
- package/dist/runtime/utils/collections.d.ts +176 -0
- package/dist/runtime/utils/collections.js +30 -0
- package/dist/runtime/utils/dictionaries.d.ts +65 -0
- package/dist/runtime/utils/dictionaries.js +14 -0
- package/dist/runtime/utils/field-errors.d.ts +4 -0
- package/dist/runtime/utils/field-errors.js +9 -0
- package/dist/runtime/utils/field-values.d.ts +19 -0
- package/dist/runtime/utils/field-values.js +82 -0
- package/dist/runtime/utils/helpers.d.ts +4 -0
- package/dist/runtime/utils/helpers.js +20 -0
- package/dist/runtime/utils/media-library-query.d.ts +54 -0
- package/dist/runtime/utils/media-library-query.js +190 -0
- package/dist/runtime/utils/options.d.ts +19 -0
- package/dist/runtime/utils/options.js +3 -0
- package/dist/runtime/utils/preview.d.ts +22 -0
- package/dist/runtime/utils/preview.js +33 -0
- package/dist/runtime/utils/relation.d.ts +33 -0
- package/dist/runtime/utils/relation.js +23 -0
- package/dist/runtime/utils/slugify.d.ts +2 -0
- package/dist/runtime/utils/slugify.js +4 -0
- package/dist/types.d.mts +7 -0
- package/package.json +84 -3
- package/src/admin-components.ts +124 -0
- package/src/module.ts +592 -0
- package/src/runtime/assets/img/katecms-logo.svg +17 -0
- package/src/runtime/assets/styles/_functions.scss +70 -0
- package/src/runtime/assets/styles/_index.scss +3 -0
- package/src/runtime/assets/styles/_mixins.scss +256 -0
- package/src/runtime/assets/styles/_variables.scss +35 -0
- package/src/runtime/composables/getCollection.ts +253 -0
- package/src/runtime/composables/getOptions.ts +42 -0
- package/src/runtime/composables/getQueryCollection.ts +325 -0
- package/src/runtime/composables/getTerms.ts +231 -0
- package/src/runtime/composables/useAuth.ts +43 -0
- package/src/runtime/composables/useAuthCooldown.ts +52 -0
- package/src/runtime/composables/useCmsPaths.ts +24 -0
- package/src/runtime/composables/useKateCmsExtensions.ts +81 -0
- package/src/runtime/composables/useMediaLibrary.ts +168 -0
- package/src/runtime/composables/useMenuAccess.ts +25 -0
- package/src/runtime/internal/admin/AdminHeader.vue +106 -0
- package/src/runtime/internal/admin/AppMenu.vue +290 -0
- package/src/runtime/internal/admin/AppUser.vue +260 -0
- package/src/runtime/internal/admin/CollectionEntryForm.vue +1044 -0
- package/src/runtime/internal/admin/ConfirmDialog.vue +164 -0
- package/src/runtime/internal/admin/DictionaryTermForm.vue +400 -0
- package/src/runtime/internal/admin/EntryRevisions.vue +145 -0
- package/src/runtime/internal/admin/MediaLibraryFilters.vue +186 -0
- package/src/runtime/internal/admin/MediaLibraryModal.vue +526 -0
- package/src/runtime/internal/admin/OptionPageForm.vue +277 -0
- package/src/runtime/internal/admin/UserAvatarField.vue +337 -0
- package/src/runtime/internal/fields/AccordionField.vue +258 -0
- package/src/runtime/internal/fields/ButtonGroupField.vue +144 -0
- package/src/runtime/internal/fields/CheckboxField.vue +228 -0
- package/src/runtime/internal/fields/ColorPickerField.vue +926 -0
- package/src/runtime/internal/fields/DatePickerField.vue +33 -0
- package/src/runtime/internal/fields/DateTimePickerField.vue +33 -0
- package/src/runtime/internal/fields/DictionaryField.vue +403 -0
- package/src/runtime/internal/fields/EmailField.vue +28 -0
- package/src/runtime/internal/fields/FileField.vue +480 -0
- package/src/runtime/internal/fields/FlexibleContentField.vue +1296 -0
- package/src/runtime/internal/fields/GalleryField.vue +677 -0
- package/src/runtime/internal/fields/GroupField.vue +136 -0
- package/src/runtime/internal/fields/ImageField.vue +730 -0
- package/src/runtime/internal/fields/ImageSelectField.vue +213 -0
- package/src/runtime/internal/fields/LinkField.vue +338 -0
- package/src/runtime/internal/fields/NumberField.vue +32 -0
- package/src/runtime/internal/fields/OembedField.vue +187 -0
- package/src/runtime/internal/fields/OpenStreetMapField.vue +1716 -0
- package/src/runtime/internal/fields/PageLinkField.vue +186 -0
- package/src/runtime/internal/fields/PasswordField.vue +127 -0
- package/src/runtime/internal/fields/PostObjectField.vue +187 -0
- package/src/runtime/internal/fields/RadioField.vue +195 -0
- package/src/runtime/internal/fields/RangeField.vue +62 -0
- package/src/runtime/internal/fields/RelationshipField.vue +604 -0
- package/src/runtime/internal/fields/RepeaterField.vue +999 -0
- package/src/runtime/internal/fields/SelectField.vue +118 -0
- package/src/runtime/internal/fields/SeparatorField.vue +77 -0
- package/src/runtime/internal/fields/TabField.vue +249 -0
- package/src/runtime/internal/fields/TextField.vue +29 -0
- package/src/runtime/internal/fields/TextareaField.vue +61 -0
- package/src/runtime/internal/fields/TimePickerField.vue +31 -0
- package/src/runtime/internal/fields/TrueFalseField.vue +181 -0
- package/src/runtime/internal/fields/UrlField.vue +28 -0
- package/src/runtime/internal/fields/UserField.vue +203 -0
- package/src/runtime/internal/fields/WysiwygField.vue +1061 -0
- package/src/runtime/internal/parts/DateTimeControl.vue +657 -0
- package/src/runtime/internal/parts/FieldAddon.vue +60 -0
- package/src/runtime/internal/parts/FieldInstructions.vue +38 -0
- package/src/runtime/internal/parts/FieldLabel.vue +56 -0
- package/src/runtime/internal/parts/FieldWrapper.vue +63 -0
- package/src/runtime/internal/parts/ImageCropper.vue +415 -0
- package/src/runtime/internal/parts/InputControl.vue +189 -0
- package/src/runtime/internal/ui/UiButton.vue +274 -0
- package/src/runtime/internal/ui/UiNotice.vue +302 -0
- package/src/runtime/internal/ui/UiSelect.vue +1420 -0
- package/src/runtime/middleware/auth-guard.ts +52 -0
- package/src/runtime/pages/admin/collections/[id].vue +486 -0
- package/src/runtime/pages/admin/collections/create.vue +208 -0
- package/src/runtime/pages/admin/collections/index.vue +955 -0
- package/src/runtime/pages/admin/demo-fields.vue +1354 -0
- package/src/runtime/pages/admin/dictionaries/[id].vue +246 -0
- package/src/runtime/pages/admin/dictionaries/index.vue +438 -0
- package/src/runtime/pages/admin/index.vue +155 -0
- package/src/runtime/pages/admin/login.vue +159 -0
- package/src/runtime/pages/admin/media.vue +1176 -0
- package/src/runtime/pages/admin/options/[page].vue +174 -0
- package/src/runtime/pages/admin/register.vue +179 -0
- package/src/runtime/pages/admin/users/[id].vue +382 -0
- package/src/runtime/pages/admin/users/create.vue +232 -0
- package/src/runtime/pages/admin/users/index.vue +374 -0
- package/src/runtime/pages/index.vue +265 -0
- package/src/runtime/server/api/_katecms/auth/login.post.ts +62 -0
- package/src/runtime/server/api/_katecms/auth/logout.post.ts +7 -0
- package/src/runtime/server/api/_katecms/auth/register.post.ts +112 -0
- package/src/runtime/server/api/_katecms/auth/state.get.ts +19 -0
- package/src/runtime/server/api/_katecms/collections/[collection]/[id].delete.ts +77 -0
- package/src/runtime/server/api/_katecms/collections/[collection]/[id].get.ts +57 -0
- package/src/runtime/server/api/_katecms/collections/[collection]/[id].patch.ts +157 -0
- package/src/runtime/server/api/_katecms/collections/[collection]/revisions/[revisionId].post.ts +133 -0
- package/src/runtime/server/api/_katecms/collections/[collection]/revisions.get.ts +35 -0
- package/src/runtime/server/api/_katecms/collections/[collection].get.ts +177 -0
- package/src/runtime/server/api/_katecms/collections/[collection].post.ts +111 -0
- package/src/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].delete.ts +37 -0
- package/src/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].get.ts +51 -0
- package/src/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].patch.ts +101 -0
- package/src/runtime/server/api/_katecms/dictionaries/[dictionary].get.ts +43 -0
- package/src/runtime/server/api/_katecms/dictionaries/[dictionary].post.ts +78 -0
- package/src/runtime/server/api/_katecms/media/[id]/regenerate.post.ts +39 -0
- package/src/runtime/server/api/_katecms/media/[id].delete.ts +28 -0
- package/src/runtime/server/api/_katecms/media/[id].get.ts +25 -0
- package/src/runtime/server/api/_katecms/media/[id].patch.ts +60 -0
- package/src/runtime/server/api/_katecms/media/index.get.ts +96 -0
- package/src/runtime/server/api/_katecms/media/index.post.ts +104 -0
- package/src/runtime/server/api/_katecms/media/regenerate.post.ts +38 -0
- package/src/runtime/server/api/_katecms/menu.get.ts +19 -0
- package/src/runtime/server/api/_katecms/oembed.get.ts +62 -0
- package/src/runtime/server/api/_katecms/options/[page].get.ts +35 -0
- package/src/runtime/server/api/_katecms/options/[page].patch.ts +46 -0
- package/src/runtime/server/api/_katecms/query.get.ts +332 -0
- package/src/runtime/server/api/_katecms/relation/entries.get.ts +98 -0
- package/src/runtime/server/api/_katecms/relation/terms.get.ts +61 -0
- package/src/runtime/server/api/_katecms/resolve.get.ts +148 -0
- package/src/runtime/server/api/_katecms/terms.get.ts +258 -0
- package/src/runtime/server/api/_katecms/users/[id].delete.ts +57 -0
- package/src/runtime/server/api/_katecms/users/[id].patch.ts +177 -0
- package/src/runtime/server/api/_katecms/users.get.ts +48 -0
- package/src/runtime/server/api/_katecms/users.post.ts +85 -0
- package/src/runtime/server/api/uploads/[...key].get.ts +33 -0
- package/src/runtime/server/kit.ts +5 -0
- package/src/runtime/server/middleware/admin-headers.ts +14 -0
- package/src/runtime/server/plugins/auto-migrate.ts +53 -0
- package/src/runtime/server/tsconfig.json +3 -0
- package/src/runtime/server/utils/auth-attempts.ts +71 -0
- package/src/runtime/server/utils/auth-rate-limit.ts +48 -0
- package/src/runtime/server/utils/client-address.ts +41 -0
- package/src/runtime/server/utils/collections.ts +381 -0
- package/src/runtime/server/utils/db.ts +36 -0
- package/src/runtime/server/utils/dictionaries.ts +397 -0
- package/src/runtime/server/utils/media-list.ts +131 -0
- package/src/runtime/server/utils/media.ts +94 -0
- package/src/runtime/server/utils/oembed-fetch.ts +157 -0
- package/src/runtime/server/utils/options.ts +86 -0
- package/src/runtime/server/utils/permissions.ts +44 -0
- package/src/runtime/server/utils/public-fields-query.ts +14 -0
- package/src/runtime/server/utils/public-term.ts +98 -0
- package/src/runtime/server/utils/regenerate.ts +56 -0
- package/src/runtime/server/utils/relation.ts +96 -0
- package/src/runtime/server/utils/request-address.ts +16 -0
- package/src/runtime/server/utils/revisions.ts +256 -0
- package/src/runtime/server/utils/session.ts +112 -0
- package/src/runtime/server/utils/upload-headers.ts +35 -0
- package/src/runtime/server/utils/users.ts +67 -0
- package/src/runtime/utils/admin-users.ts +43 -0
- package/src/runtime/utils/auth-error.ts +22 -0
- package/src/runtime/utils/cms-paths.ts +17 -0
- package/src/runtime/utils/collections.ts +228 -0
- package/src/runtime/utils/dictionaries.ts +89 -0
- package/src/runtime/utils/field-errors.ts +12 -0
- package/src/runtime/utils/field-values.ts +101 -0
- package/src/runtime/utils/helpers.ts +33 -0
- package/src/runtime/utils/media-library-query.ts +263 -0
- package/src/runtime/utils/options.ts +25 -0
- package/src/runtime/utils/preview.ts +56 -0
- package/src/runtime/utils/relation.ts +60 -0
- package/src/runtime/utils/slugify.ts +10 -0
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
4
|
+
import { DATE_FIELD_FORMATS, formatDate, parseDate } from '@katecms/core'
|
|
5
|
+
|
|
6
|
+
type PickerMode = 'date' | 'datetime' | 'time'
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
// What to pick: date, date+time, or time only.
|
|
10
|
+
mode: {
|
|
11
|
+
type: String as PropType<PickerMode>,
|
|
12
|
+
default: 'date',
|
|
13
|
+
},
|
|
14
|
+
id: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: undefined,
|
|
17
|
+
},
|
|
18
|
+
name: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: undefined,
|
|
21
|
+
},
|
|
22
|
+
required: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
displayFormat: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: undefined,
|
|
29
|
+
},
|
|
30
|
+
returnFormat: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: undefined,
|
|
33
|
+
},
|
|
34
|
+
firstDay: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 1,
|
|
37
|
+
},
|
|
38
|
+
defaultToCurrentDate: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
// The model stores the value as a string in returnFormat.
|
|
45
|
+
const model = defineModel<string>()
|
|
46
|
+
|
|
47
|
+
const rootClass = 'katecms-date-time-control'
|
|
48
|
+
|
|
49
|
+
const DEFAULT_FORMATS = DATE_FIELD_FORMATS
|
|
50
|
+
|
|
51
|
+
const DISPLAY_FORMAT = computed(() => props.displayFormat || DEFAULT_FORMATS[props.mode].display)
|
|
52
|
+
const RETURN_FORMAT = computed(() => props.returnFormat || DEFAULT_FORMATS[props.mode].return)
|
|
53
|
+
|
|
54
|
+
const showCalendar = computed(() => props.mode !== 'time')
|
|
55
|
+
const showTime = computed(() => props.mode !== 'date')
|
|
56
|
+
const hasSeconds = computed(() => /s/.test(RETURN_FORMAT.value) || /s/.test(DISPLAY_FORMAT.value))
|
|
57
|
+
|
|
58
|
+
const WEEKDAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
|
|
59
|
+
const MONTHS = [
|
|
60
|
+
'January', 'February', 'March', 'April', 'May', 'June',
|
|
61
|
+
'July', 'August', 'September', 'October', 'November', 'December',
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
const pad = (n: number) => String(n).padStart(2, '0')
|
|
65
|
+
|
|
66
|
+
// Selected value parsed from the model.
|
|
67
|
+
const selectedDate = computed(() => (model.value ? parseDate(model.value, RETURN_FORMAT.value) : null))
|
|
68
|
+
|
|
69
|
+
// Text shown in the input.
|
|
70
|
+
const displayValue = computed(() => (selectedDate.value ? formatDate(selectedDate.value, DISPLAY_FORMAT.value) : ''))
|
|
71
|
+
|
|
72
|
+
const open = ref(false)
|
|
73
|
+
const today = new Date()
|
|
74
|
+
|
|
75
|
+
// Month currently shown in the calendar.
|
|
76
|
+
const viewYear = ref((selectedDate.value ?? today).getFullYear())
|
|
77
|
+
const viewMonth = ref((selectedDate.value ?? today).getMonth())
|
|
78
|
+
|
|
79
|
+
// Selected time.
|
|
80
|
+
const viewHour = ref((selectedDate.value ?? today).getHours())
|
|
81
|
+
const viewMinute = ref((selectedDate.value ?? today).getMinutes())
|
|
82
|
+
const viewSecond = ref((selectedDate.value ?? today).getSeconds())
|
|
83
|
+
|
|
84
|
+
const hoursList = Array.from({ length: 24 }, (_, i) => i)
|
|
85
|
+
const minutesList = Array.from({ length: 60 }, (_, i) => i)
|
|
86
|
+
const secondsList = Array.from({ length: 60 }, (_, i) => i)
|
|
87
|
+
|
|
88
|
+
// Weekday labels rotated so they start at firstDay.
|
|
89
|
+
const weekdayLabels = computed(() =>
|
|
90
|
+
Array.from({ length: 7 }, (_, i) => WEEKDAYS[(props.firstDay + i) % 7]),
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
// Calendar cells: leading blanks plus the days of the month.
|
|
94
|
+
const cells = computed<(number | null)[]>(() => {
|
|
95
|
+
const daysInMonth = new Date(viewYear.value, viewMonth.value + 1, 0).getDate()
|
|
96
|
+
const firstWeekday = new Date(viewYear.value, viewMonth.value, 1).getDay()
|
|
97
|
+
const offset = (firstWeekday - props.firstDay + 7) % 7
|
|
98
|
+
const result: (number | null)[] = Array.from({ length: offset }, () => null)
|
|
99
|
+
for (let d = 1; d <= daysInMonth; d++) {
|
|
100
|
+
result.push(d)
|
|
101
|
+
}
|
|
102
|
+
return result
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
function sameDate(a: Date, y: number, m: number, d: number) {
|
|
106
|
+
return a.getFullYear() === y && a.getMonth() === m && a.getDate() === d
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function isSelected(day: number) {
|
|
110
|
+
return selectedDate.value ? sameDate(selectedDate.value, viewYear.value, viewMonth.value, day) : false
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function isToday(day: number) {
|
|
114
|
+
return sameDate(today, viewYear.value, viewMonth.value, day)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function prevMonth() {
|
|
118
|
+
if (viewMonth.value === 0) {
|
|
119
|
+
viewMonth.value = 11
|
|
120
|
+
viewYear.value--
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
viewMonth.value--
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function nextMonth() {
|
|
128
|
+
if (viewMonth.value === 11) {
|
|
129
|
+
viewMonth.value = 0
|
|
130
|
+
viewYear.value++
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
viewMonth.value++
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function commit(year: number, month: number, day: number) {
|
|
138
|
+
model.value = formatDate(
|
|
139
|
+
new Date(year, month, day, viewHour.value, viewMinute.value, viewSecond.value),
|
|
140
|
+
RETURN_FORMAT.value,
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function selectDay(day: number) {
|
|
145
|
+
// Picking a day applies the selected time and closes the popup.
|
|
146
|
+
commit(viewYear.value, viewMonth.value, day)
|
|
147
|
+
open.value = false
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Changing time rebuilds the model from the already selected date.
|
|
151
|
+
function applyTime() {
|
|
152
|
+
const base = selectedDate.value ?? today
|
|
153
|
+
commit(base.getFullYear(), base.getMonth(), base.getDate())
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function onHourChange(event: Event) {
|
|
157
|
+
viewHour.value = Number((event.target as HTMLSelectElement).value)
|
|
158
|
+
applyTime()
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function onMinuteChange(event: Event) {
|
|
162
|
+
viewMinute.value = Number((event.target as HTMLSelectElement).value)
|
|
163
|
+
applyTime()
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function onSecondChange(event: Event) {
|
|
167
|
+
viewSecond.value = Number((event.target as HTMLSelectElement).value)
|
|
168
|
+
applyTime()
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Year picker list: current year ± range.
|
|
172
|
+
const years = computed(() => {
|
|
173
|
+
const base = today.getFullYear()
|
|
174
|
+
const start = base - 100
|
|
175
|
+
const end = base + 20
|
|
176
|
+
return Array.from({ length: end - start + 1 }, (_, i) => start + i)
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
function onMonthChange(event: Event) {
|
|
180
|
+
viewMonth.value = Number((event.target as HTMLSelectElement).value)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function onYearChange(event: Event) {
|
|
184
|
+
viewYear.value = Number((event.target as HTMLSelectElement).value)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function selectNow() {
|
|
188
|
+
const now = new Date()
|
|
189
|
+
viewYear.value = now.getFullYear()
|
|
190
|
+
viewMonth.value = now.getMonth()
|
|
191
|
+
viewHour.value = now.getHours()
|
|
192
|
+
viewMinute.value = now.getMinutes()
|
|
193
|
+
viewSecond.value = now.getSeconds()
|
|
194
|
+
commit(now.getFullYear(), now.getMonth(), now.getDate())
|
|
195
|
+
// In time-only mode, "Now" closes the popup immediately.
|
|
196
|
+
if (!showCalendar.value) {
|
|
197
|
+
open.value = false
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function clear() {
|
|
202
|
+
model.value = ''
|
|
203
|
+
open.value = false
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Approximate popup height used to choose open direction.
|
|
207
|
+
const POPUP_HEIGHT = computed(() => {
|
|
208
|
+
if (props.mode === 'time') {
|
|
209
|
+
return 140
|
|
210
|
+
}
|
|
211
|
+
return props.mode === 'datetime' ? 420 : 360
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
const POPUP_WIDTH = computed(() => (props.mode === 'time' ? 200 : 280))
|
|
215
|
+
|
|
216
|
+
const control = ref<HTMLElement>()
|
|
217
|
+
const dropUp = ref(false)
|
|
218
|
+
const alignRight = ref(false)
|
|
219
|
+
|
|
220
|
+
// Open upward when there is not enough room below and more room above.
|
|
221
|
+
// Pin to the right when the popup would overflow the viewport.
|
|
222
|
+
function updatePopupPlacement() {
|
|
223
|
+
if (typeof window === 'undefined' || !control.value) {
|
|
224
|
+
return
|
|
225
|
+
}
|
|
226
|
+
const rect = control.value.getBoundingClientRect()
|
|
227
|
+
const spaceBelow = window.innerHeight - rect.bottom
|
|
228
|
+
const spaceAbove = rect.top
|
|
229
|
+
dropUp.value = spaceBelow < POPUP_HEIGHT.value && spaceAbove > spaceBelow
|
|
230
|
+
alignRight.value = rect.left + POPUP_WIDTH.value > window.innerWidth
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function toggle() {
|
|
234
|
+
// When opening, show the month/time of the selected value.
|
|
235
|
+
if (!open.value && selectedDate.value) {
|
|
236
|
+
viewYear.value = selectedDate.value.getFullYear()
|
|
237
|
+
viewMonth.value = selectedDate.value.getMonth()
|
|
238
|
+
viewHour.value = selectedDate.value.getHours()
|
|
239
|
+
viewMinute.value = selectedDate.value.getMinutes()
|
|
240
|
+
viewSecond.value = selectedDate.value.getSeconds()
|
|
241
|
+
}
|
|
242
|
+
if (!open.value) {
|
|
243
|
+
updatePopupPlacement()
|
|
244
|
+
}
|
|
245
|
+
open.value = !open.value
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// defaultToCurrentDate: if there is no value, seed it with now.
|
|
249
|
+
onMounted(() => {
|
|
250
|
+
if (!model.value && props.defaultToCurrentDate) {
|
|
251
|
+
model.value = formatDate(today, RETURN_FORMAT.value)
|
|
252
|
+
}
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
// Close on Escape and click outside the field.
|
|
256
|
+
const root = ref<HTMLElement>()
|
|
257
|
+
|
|
258
|
+
function onDocEvent(event: Event) {
|
|
259
|
+
if (event instanceof KeyboardEvent) {
|
|
260
|
+
if (event.key === 'Escape') {
|
|
261
|
+
open.value = false
|
|
262
|
+
}
|
|
263
|
+
return
|
|
264
|
+
}
|
|
265
|
+
if (root.value && !root.value.contains(event.target as Node)) {
|
|
266
|
+
open.value = false
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
watch(open, (isOpen) => {
|
|
271
|
+
if (typeof document === 'undefined') {
|
|
272
|
+
return
|
|
273
|
+
}
|
|
274
|
+
if (isOpen) {
|
|
275
|
+
document.addEventListener('keydown', onDocEvent)
|
|
276
|
+
document.addEventListener('click', onDocEvent)
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
document.removeEventListener('keydown', onDocEvent)
|
|
280
|
+
document.removeEventListener('click', onDocEvent)
|
|
281
|
+
}
|
|
282
|
+
})
|
|
283
|
+
|
|
284
|
+
onBeforeUnmount(() => {
|
|
285
|
+
if (typeof document !== 'undefined') {
|
|
286
|
+
document.removeEventListener('keydown', onDocEvent)
|
|
287
|
+
document.removeEventListener('click', onDocEvent)
|
|
288
|
+
}
|
|
289
|
+
})
|
|
290
|
+
</script>
|
|
291
|
+
|
|
292
|
+
<template>
|
|
293
|
+
<div
|
|
294
|
+
ref="root"
|
|
295
|
+
:class="rootClass"
|
|
296
|
+
>
|
|
297
|
+
<div
|
|
298
|
+
ref="control"
|
|
299
|
+
:class="`${rootClass}__control`"
|
|
300
|
+
>
|
|
301
|
+
<input
|
|
302
|
+
:id="id"
|
|
303
|
+
:value="displayValue"
|
|
304
|
+
type="text"
|
|
305
|
+
readonly
|
|
306
|
+
:class="`${rootClass}__input`"
|
|
307
|
+
:name="name"
|
|
308
|
+
:placeholder="DISPLAY_FORMAT"
|
|
309
|
+
:required="required"
|
|
310
|
+
@click="toggle"
|
|
311
|
+
>
|
|
312
|
+
|
|
313
|
+
<div
|
|
314
|
+
v-if="open"
|
|
315
|
+
:class="[`${rootClass}__popup`, { 'is-drop-up': dropUp, 'is-align-right': alignRight, 'is-time-only': !showCalendar }]"
|
|
316
|
+
>
|
|
317
|
+
<template v-if="showCalendar">
|
|
318
|
+
<div :class="`${rootClass}__nav`">
|
|
319
|
+
<button
|
|
320
|
+
type="button"
|
|
321
|
+
:class="`${rootClass}__nav-btn`"
|
|
322
|
+
@click="prevMonth"
|
|
323
|
+
>
|
|
324
|
+
<svg
|
|
325
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
326
|
+
viewBox="0 0 640 640"
|
|
327
|
+
><path d="M201 297a32 32 0 0 0 0 46l160 160a32 32 0 0 0 46-46L269 320l138-137a32 32 0 0 0-46-46z" /></svg>
|
|
328
|
+
</button>
|
|
329
|
+
|
|
330
|
+
<div :class="`${rootClass}__selects`">
|
|
331
|
+
<select
|
|
332
|
+
:class="`${rootClass}__select`"
|
|
333
|
+
:value="viewMonth"
|
|
334
|
+
@change="onMonthChange"
|
|
335
|
+
>
|
|
336
|
+
<option
|
|
337
|
+
v-for="(month, index) in MONTHS"
|
|
338
|
+
:key="month"
|
|
339
|
+
:value="index"
|
|
340
|
+
>
|
|
341
|
+
{{ month }}
|
|
342
|
+
</option>
|
|
343
|
+
</select>
|
|
344
|
+
|
|
345
|
+
<select
|
|
346
|
+
:class="`${rootClass}__select`"
|
|
347
|
+
:value="viewYear"
|
|
348
|
+
@change="onYearChange"
|
|
349
|
+
>
|
|
350
|
+
<option
|
|
351
|
+
v-for="year in years"
|
|
352
|
+
:key="year"
|
|
353
|
+
:value="year"
|
|
354
|
+
>
|
|
355
|
+
{{ year }}
|
|
356
|
+
</option>
|
|
357
|
+
</select>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<button
|
|
361
|
+
type="button"
|
|
362
|
+
:class="`${rootClass}__nav-btn`"
|
|
363
|
+
@click="nextMonth"
|
|
364
|
+
>
|
|
365
|
+
<svg
|
|
366
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
367
|
+
viewBox="0 0 640 640"
|
|
368
|
+
><path d="M439 297c13 13 13 33 0 46L279 503a32 32 0 0 1-45-46l137-137-137-137a32 32 0 0 1 45-46z" /></svg>
|
|
369
|
+
</button>
|
|
370
|
+
</div>
|
|
371
|
+
|
|
372
|
+
<div :class="`${rootClass}__grid`">
|
|
373
|
+
<span
|
|
374
|
+
v-for="label in weekdayLabels"
|
|
375
|
+
:key="label"
|
|
376
|
+
:class="`${rootClass}__weekday`"
|
|
377
|
+
>{{ label }}</span>
|
|
378
|
+
|
|
379
|
+
<template v-for="(cell, index) in cells">
|
|
380
|
+
<span
|
|
381
|
+
v-if="cell === null"
|
|
382
|
+
:key="`b-${index}`"
|
|
383
|
+
:class="`${rootClass}__cell`"
|
|
384
|
+
/>
|
|
385
|
+
<button
|
|
386
|
+
v-else
|
|
387
|
+
:key="`d-${cell}`"
|
|
388
|
+
type="button"
|
|
389
|
+
:class="[
|
|
390
|
+
`${rootClass}__cell`,
|
|
391
|
+
`${rootClass}__day`,
|
|
392
|
+
{ 'is-selected': isSelected(cell), 'is-today': isToday(cell) },
|
|
393
|
+
]"
|
|
394
|
+
@click="selectDay(cell)"
|
|
395
|
+
>
|
|
396
|
+
{{ cell }}
|
|
397
|
+
</button>
|
|
398
|
+
</template>
|
|
399
|
+
</div>
|
|
400
|
+
</template>
|
|
401
|
+
|
|
402
|
+
<div
|
|
403
|
+
v-if="showTime"
|
|
404
|
+
:class="[`${rootClass}__time`, { 'is-standalone': !showCalendar }]"
|
|
405
|
+
>
|
|
406
|
+
<span
|
|
407
|
+
v-if="showCalendar"
|
|
408
|
+
:class="`${rootClass}__time-label`"
|
|
409
|
+
>Time</span>
|
|
410
|
+
<select
|
|
411
|
+
:class="`${rootClass}__select`"
|
|
412
|
+
:value="viewHour"
|
|
413
|
+
@change="onHourChange"
|
|
414
|
+
>
|
|
415
|
+
<option
|
|
416
|
+
v-for="hour in hoursList"
|
|
417
|
+
:key="hour"
|
|
418
|
+
:value="hour"
|
|
419
|
+
>
|
|
420
|
+
{{ pad(hour) }}
|
|
421
|
+
</option>
|
|
422
|
+
</select>
|
|
423
|
+
<span :class="`${rootClass}__time-sep`">:</span>
|
|
424
|
+
<select
|
|
425
|
+
:class="`${rootClass}__select`"
|
|
426
|
+
:value="viewMinute"
|
|
427
|
+
@change="onMinuteChange"
|
|
428
|
+
>
|
|
429
|
+
<option
|
|
430
|
+
v-for="minute in minutesList"
|
|
431
|
+
:key="minute"
|
|
432
|
+
:value="minute"
|
|
433
|
+
>
|
|
434
|
+
{{ pad(minute) }}
|
|
435
|
+
</option>
|
|
436
|
+
</select>
|
|
437
|
+
<template v-if="hasSeconds">
|
|
438
|
+
<span :class="`${rootClass}__time-sep`">:</span>
|
|
439
|
+
<select
|
|
440
|
+
:class="`${rootClass}__select`"
|
|
441
|
+
:value="viewSecond"
|
|
442
|
+
@change="onSecondChange"
|
|
443
|
+
>
|
|
444
|
+
<option
|
|
445
|
+
v-for="second in secondsList"
|
|
446
|
+
:key="second"
|
|
447
|
+
:value="second"
|
|
448
|
+
>
|
|
449
|
+
{{ pad(second) }}
|
|
450
|
+
</option>
|
|
451
|
+
</select>
|
|
452
|
+
</template>
|
|
453
|
+
</div>
|
|
454
|
+
|
|
455
|
+
<div :class="`${rootClass}__footer`">
|
|
456
|
+
<KateCmsUiButton
|
|
457
|
+
tag="button"
|
|
458
|
+
:variant="['secondary', 'small']"
|
|
459
|
+
@click="selectNow"
|
|
460
|
+
>
|
|
461
|
+
Now
|
|
462
|
+
</KateCmsUiButton>
|
|
463
|
+
<KateCmsUiButton
|
|
464
|
+
tag="button"
|
|
465
|
+
:variant="['secondary', 'small']"
|
|
466
|
+
@click="clear"
|
|
467
|
+
>
|
|
468
|
+
Clear
|
|
469
|
+
</KateCmsUiButton>
|
|
470
|
+
</div>
|
|
471
|
+
</div>
|
|
472
|
+
</div>
|
|
473
|
+
</div>
|
|
474
|
+
</template>
|
|
475
|
+
|
|
476
|
+
<style scoped lang="scss">
|
|
477
|
+
@use "../../assets/styles" as *;
|
|
478
|
+
|
|
479
|
+
$root: '.katecms-date-time-control';
|
|
480
|
+
|
|
481
|
+
#{$root} {
|
|
482
|
+
|
|
483
|
+
&__control {
|
|
484
|
+
position: relative;
|
|
485
|
+
width: 100%;
|
|
486
|
+
max-width: 100%;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
&__input {
|
|
490
|
+
width: 100%;
|
|
491
|
+
height: math-rem(38);
|
|
492
|
+
border: 1px solid $color-border;
|
|
493
|
+
border-radius: $border-radius;
|
|
494
|
+
padding: 0 math-rem(10);
|
|
495
|
+
color: $color-ink;
|
|
496
|
+
cursor: pointer;
|
|
497
|
+
background-color: $color-surface;
|
|
498
|
+
|
|
499
|
+
&:focus {
|
|
500
|
+
outline: none;
|
|
501
|
+
border-color: $color-accent;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
&__popup {
|
|
506
|
+
position: absolute;
|
|
507
|
+
z-index: 100;
|
|
508
|
+
top: calc(100% + 4px);
|
|
509
|
+
left: 0;
|
|
510
|
+
width: 280px;
|
|
511
|
+
padding: 10px;
|
|
512
|
+
background-color: $color-surface;
|
|
513
|
+
border: 1px solid $color-border;
|
|
514
|
+
border-radius: $border-radius;
|
|
515
|
+
box-shadow: $shadow-md;
|
|
516
|
+
|
|
517
|
+
&.is-time-only {
|
|
518
|
+
width: 200px;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
&.is-drop-up {
|
|
522
|
+
top: auto;
|
|
523
|
+
bottom: calc(100% + 4px);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
&.is-align-right {
|
|
527
|
+
left: auto;
|
|
528
|
+
right: 0;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
&__nav {
|
|
533
|
+
display: flex;
|
|
534
|
+
align-items: center;
|
|
535
|
+
justify-content: space-between;
|
|
536
|
+
margin-bottom: 8px;
|
|
537
|
+
|
|
538
|
+
&-btn {
|
|
539
|
+
width: 28px;
|
|
540
|
+
height: 28px;
|
|
541
|
+
border: 1px solid $color-border;
|
|
542
|
+
border-radius: 5px;
|
|
543
|
+
background-color: $color-surface;
|
|
544
|
+
cursor: pointer;
|
|
545
|
+
padding: 0;
|
|
546
|
+
|
|
547
|
+
&:focus {
|
|
548
|
+
outline: none;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
svg {
|
|
552
|
+
display: block;
|
|
553
|
+
width: 14px;
|
|
554
|
+
height: 14px;
|
|
555
|
+
margin: auto;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
&__selects {
|
|
561
|
+
display: flex;
|
|
562
|
+
gap: 6px;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
&__select {
|
|
566
|
+
min-width: 58px;
|
|
567
|
+
height: 28px;
|
|
568
|
+
border: 1px solid $color-border;
|
|
569
|
+
border-radius: 5px;
|
|
570
|
+
padding: 0 4px;
|
|
571
|
+
background-color: $color-surface;
|
|
572
|
+
cursor: pointer;
|
|
573
|
+
|
|
574
|
+
&:focus {
|
|
575
|
+
outline: none;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
&__grid {
|
|
580
|
+
display: grid;
|
|
581
|
+
grid-template-columns: repeat(7, 1fr);
|
|
582
|
+
gap: 2px;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
&__weekday {
|
|
586
|
+
display: flex;
|
|
587
|
+
align-items: center;
|
|
588
|
+
justify-content: center;
|
|
589
|
+
height: 30px;
|
|
590
|
+
font-size: 12px;
|
|
591
|
+
color: $color-muted;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
&__cell {
|
|
595
|
+
height: 32px;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
&__day {
|
|
599
|
+
border: 0;
|
|
600
|
+
border-radius: 5px;
|
|
601
|
+
background-color: transparent;
|
|
602
|
+
cursor: pointer;
|
|
603
|
+
|
|
604
|
+
&:hover {
|
|
605
|
+
background-color: $color-bg;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
&.is-today {
|
|
609
|
+
border: 1px solid $color-accent;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
&.is-selected {
|
|
613
|
+
background-color: $color-accent;
|
|
614
|
+
color: $color-on-accent;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
&:focus {
|
|
618
|
+
outline: none;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
&__time {
|
|
623
|
+
display: flex;
|
|
624
|
+
align-items: center;
|
|
625
|
+
//justify-content: center;
|
|
626
|
+
gap: 6px;
|
|
627
|
+
margin-top: 10px;
|
|
628
|
+
padding-top: 10px;
|
|
629
|
+
border-top: 1px solid $color-border;
|
|
630
|
+
|
|
631
|
+
&.is-standalone {
|
|
632
|
+
margin-top: 0;
|
|
633
|
+
padding-top: 0;
|
|
634
|
+
border-top: 0;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
&-label {
|
|
638
|
+
margin-right: auto;
|
|
639
|
+
font-size: 13px;
|
|
640
|
+
color: $color-muted;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
&-sep {
|
|
644
|
+
font-weight: 600;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
&__footer {
|
|
649
|
+
display: flex;
|
|
650
|
+
justify-content: space-between;
|
|
651
|
+
gap: 8px;
|
|
652
|
+
margin-top: 8px;
|
|
653
|
+
padding-top: 8px;
|
|
654
|
+
border-top: 1px solid $color-border;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Field } from '@katecms/core'
|
|
3
|
+
|
|
4
|
+
type AddonField = Partial<Pick<
|
|
5
|
+
Extract<Field, { type: 'text' }>,
|
|
6
|
+
'prepend' | 'append'
|
|
7
|
+
>>
|
|
8
|
+
|
|
9
|
+
withDefaults(defineProps<{
|
|
10
|
+
field?: AddonField
|
|
11
|
+
position?: 'prepend' | 'append'
|
|
12
|
+
}>(), {
|
|
13
|
+
field: () => ({}),
|
|
14
|
+
position: 'prepend',
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const rootClass = 'katecms-field-addon'
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div
|
|
22
|
+
v-if="field?.[position]"
|
|
23
|
+
:class="[
|
|
24
|
+
rootClass,
|
|
25
|
+
`${rootClass}--${position}`,
|
|
26
|
+
]"
|
|
27
|
+
>
|
|
28
|
+
{{ field[position] }}
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<style scoped lang="scss">
|
|
33
|
+
@use "../../assets/styles" as *;
|
|
34
|
+
|
|
35
|
+
$root: '.katecms-field-addon';
|
|
36
|
+
|
|
37
|
+
#{$root} {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
flex: 0 0 auto;
|
|
41
|
+
width: auto;
|
|
42
|
+
max-width: 100%;
|
|
43
|
+
padding: 0 math-rem(12);
|
|
44
|
+
background-color: $color-bg;
|
|
45
|
+
border: 1px solid $color-border;
|
|
46
|
+
color: $color-muted;
|
|
47
|
+
font-size: math-rem(14);
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
|
|
50
|
+
&--prepend {
|
|
51
|
+
border-right: 0;
|
|
52
|
+
border-radius: $border-radius-inter 0 0 $border-radius-inter;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--append {
|
|
56
|
+
border-left: 0;
|
|
57
|
+
border-radius: 0 $border-radius-inter $border-radius-inter 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</style>
|