@karibsen/eponyme 0.1.0
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 +609 -0
- package/dist/eponyme.d.mts +15 -0
- package/dist/eponyme.mjs +38 -0
- package/dist/module.d.mts +26 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +154 -0
- package/dist/runtime/assets/dashboard.css +1 -0
- package/dist/runtime/components/editor/EponymeCollectionPage.d.vue.ts +9 -0
- package/dist/runtime/components/editor/EponymeCollectionPage.vue +238 -0
- package/dist/runtime/components/editor/EponymeCollectionPage.vue.d.ts +9 -0
- package/dist/runtime/components/editor/EponymeCopy.d.vue.ts +7 -0
- package/dist/runtime/components/editor/EponymeCopy.vue +28 -0
- package/dist/runtime/components/editor/EponymeCopy.vue.d.ts +7 -0
- package/dist/runtime/components/editor/EponymeFolderNav.d.vue.ts +7 -0
- package/dist/runtime/components/editor/EponymeFolderNav.vue +146 -0
- package/dist/runtime/components/editor/EponymeFolderNav.vue.d.ts +7 -0
- package/dist/runtime/components/editor/EponymeFolderPage.d.vue.ts +7 -0
- package/dist/runtime/components/editor/EponymeFolderPage.vue +62 -0
- package/dist/runtime/components/editor/EponymeFolderPage.vue.d.ts +7 -0
- package/dist/runtime/components/editor/EponymeForm.d.vue.ts +9 -0
- package/dist/runtime/components/editor/EponymeForm.vue +309 -0
- package/dist/runtime/components/editor/EponymeForm.vue.d.ts +9 -0
- package/dist/runtime/components/editor/EponymeFormPage.d.vue.ts +8 -0
- package/dist/runtime/components/editor/EponymeFormPage.vue +288 -0
- package/dist/runtime/components/editor/EponymeFormPage.vue.d.ts +8 -0
- package/dist/runtime/components/editor/EponymeHistoryDialog.d.vue.ts +14 -0
- package/dist/runtime/components/editor/EponymeHistoryDialog.vue +97 -0
- package/dist/runtime/components/editor/EponymeHistoryDialog.vue.d.ts +14 -0
- package/dist/runtime/components/editor/EponymeNavigationLink.d.vue.ts +14 -0
- package/dist/runtime/components/editor/EponymeNavigationLink.vue +80 -0
- package/dist/runtime/components/editor/EponymeNavigationLink.vue.d.ts +14 -0
- package/dist/runtime/components/editor/EponymePageNavigation.d.vue.ts +8 -0
- package/dist/runtime/components/editor/EponymePageNavigation.vue +58 -0
- package/dist/runtime/components/editor/EponymePageNavigation.vue.d.ts +8 -0
- package/dist/runtime/components/editor/EponymePreviewPanel.d.vue.ts +16 -0
- package/dist/runtime/components/editor/EponymePreviewPanel.vue +100 -0
- package/dist/runtime/components/editor/EponymePreviewPanel.vue.d.ts +16 -0
- package/dist/runtime/components/editor/EponymeSidebar.d.vue.ts +6 -0
- package/dist/runtime/components/editor/EponymeSidebar.vue +244 -0
- package/dist/runtime/components/editor/EponymeSidebar.vue.d.ts +6 -0
- package/dist/runtime/components/editor/EponymeSidebarTree.d.vue.ts +18 -0
- package/dist/runtime/components/editor/EponymeSidebarTree.vue +84 -0
- package/dist/runtime/components/editor/EponymeSidebarTree.vue.d.ts +18 -0
- package/dist/runtime/components/fields/ArrayField.d.vue.ts +19 -0
- package/dist/runtime/components/fields/ArrayField.vue +198 -0
- package/dist/runtime/components/fields/ArrayField.vue.d.ts +19 -0
- package/dist/runtime/components/fields/BooleanField.d.vue.ts +16 -0
- package/dist/runtime/components/fields/BooleanField.vue +36 -0
- package/dist/runtime/components/fields/BooleanField.vue.d.ts +16 -0
- package/dist/runtime/components/fields/CheckboxGroupField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/CheckboxGroupField.vue +52 -0
- package/dist/runtime/components/fields/CheckboxGroupField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/ColorField.d.vue.ts +19 -0
- package/dist/runtime/components/fields/ColorField.vue +39 -0
- package/dist/runtime/components/fields/ColorField.vue.d.ts +19 -0
- package/dist/runtime/components/fields/DateField.d.vue.ts +18 -0
- package/dist/runtime/components/fields/DateField.vue +39 -0
- package/dist/runtime/components/fields/DateField.vue.d.ts +18 -0
- package/dist/runtime/components/fields/FieldRenderer.d.vue.ts +24 -0
- package/dist/runtime/components/fields/FieldRenderer.vue +135 -0
- package/dist/runtime/components/fields/FieldRenderer.vue.d.ts +24 -0
- package/dist/runtime/components/fields/NumberField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/NumberField.vue +58 -0
- package/dist/runtime/components/fields/NumberField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/RadioField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/RadioField.vue +44 -0
- package/dist/runtime/components/fields/RadioField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/RichTextField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/RichTextField.vue +176 -0
- package/dist/runtime/components/fields/RichTextField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/SectionField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/SectionField.vue +127 -0
- package/dist/runtime/components/fields/SectionField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/SelectField.d.vue.ts +21 -0
- package/dist/runtime/components/fields/SelectField.vue +42 -0
- package/dist/runtime/components/fields/SelectField.vue.d.ts +21 -0
- package/dist/runtime/components/fields/SlugField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/SlugField.vue +35 -0
- package/dist/runtime/components/fields/SlugField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/TabsField.d.vue.ts +19 -0
- package/dist/runtime/components/fields/TabsField.vue +109 -0
- package/dist/runtime/components/fields/TabsField.vue.d.ts +19 -0
- package/dist/runtime/components/fields/TextField.d.vue.ts +22 -0
- package/dist/runtime/components/fields/TextField.vue +56 -0
- package/dist/runtime/components/fields/TextField.vue.d.ts +22 -0
- package/dist/runtime/components/fields/TextareaField.d.vue.ts +20 -0
- package/dist/runtime/components/fields/TextareaField.vue +47 -0
- package/dist/runtime/components/fields/TextareaField.vue.d.ts +20 -0
- package/dist/runtime/components/fields/UrlField.d.vue.ts +17 -0
- package/dist/runtime/components/fields/UrlField.vue +35 -0
- package/dist/runtime/components/fields/UrlField.vue.d.ts +17 -0
- package/dist/runtime/components/ui/EPAccordion.d.vue.ts +26 -0
- package/dist/runtime/components/ui/EPAccordion.vue +64 -0
- package/dist/runtime/components/ui/EPAccordion.vue.d.ts +26 -0
- package/dist/runtime/components/ui/EPAvatar.d.vue.ts +9 -0
- package/dist/runtime/components/ui/EPAvatar.vue +25 -0
- package/dist/runtime/components/ui/EPAvatar.vue.d.ts +9 -0
- package/dist/runtime/components/ui/EPBadge.d.vue.ts +16 -0
- package/dist/runtime/components/ui/EPBadge.vue +17 -0
- package/dist/runtime/components/ui/EPBadge.vue.d.ts +16 -0
- package/dist/runtime/components/ui/EPButton.d.vue.ts +22 -0
- package/dist/runtime/components/ui/EPButton.vue +55 -0
- package/dist/runtime/components/ui/EPButton.vue.d.ts +22 -0
- package/dist/runtime/components/ui/EPCheckbox.d.vue.ts +11 -0
- package/dist/runtime/components/ui/EPCheckbox.vue +21 -0
- package/dist/runtime/components/ui/EPCheckbox.vue.d.ts +11 -0
- package/dist/runtime/components/ui/EPColorPicker.d.vue.ts +19 -0
- package/dist/runtime/components/ui/EPColorPicker.vue +63 -0
- package/dist/runtime/components/ui/EPColorPicker.vue.d.ts +19 -0
- package/dist/runtime/components/ui/EPDialog.d.vue.ts +24 -0
- package/dist/runtime/components/ui/EPDialog.vue +54 -0
- package/dist/runtime/components/ui/EPDialog.vue.d.ts +24 -0
- package/dist/runtime/components/ui/EPDropdownMenu.d.vue.ts +25 -0
- package/dist/runtime/components/ui/EPDropdownMenu.vue +40 -0
- package/dist/runtime/components/ui/EPDropdownMenu.vue.d.ts +25 -0
- package/dist/runtime/components/ui/EPFormField.d.vue.ts +24 -0
- package/dist/runtime/components/ui/EPFormField.vue +62 -0
- package/dist/runtime/components/ui/EPFormField.vue.d.ts +24 -0
- package/dist/runtime/components/ui/EPInputText.d.vue.ts +17 -0
- package/dist/runtime/components/ui/EPInputText.vue +33 -0
- package/dist/runtime/components/ui/EPInputText.vue.d.ts +17 -0
- package/dist/runtime/components/ui/EPLinkEditor.d.vue.ts +16 -0
- package/dist/runtime/components/ui/EPLinkEditor.vue +169 -0
- package/dist/runtime/components/ui/EPLinkEditor.vue.d.ts +16 -0
- package/dist/runtime/components/ui/EPRadioButton.d.vue.ts +16 -0
- package/dist/runtime/components/ui/EPRadioButton.vue +34 -0
- package/dist/runtime/components/ui/EPRadioButton.vue.d.ts +16 -0
- package/dist/runtime/components/ui/EPSelect.d.vue.ts +21 -0
- package/dist/runtime/components/ui/EPSelect.vue +73 -0
- package/dist/runtime/components/ui/EPSelect.vue.d.ts +21 -0
- package/dist/runtime/components/ui/EPSlider.d.vue.ts +16 -0
- package/dist/runtime/components/ui/EPSlider.vue +51 -0
- package/dist/runtime/components/ui/EPSlider.vue.d.ts +16 -0
- package/dist/runtime/components/ui/EPSwitch.d.vue.ts +11 -0
- package/dist/runtime/components/ui/EPSwitch.vue +23 -0
- package/dist/runtime/components/ui/EPSwitch.vue.d.ts +11 -0
- package/dist/runtime/components/ui/EPTextarea.d.vue.ts +12 -0
- package/dist/runtime/components/ui/EPTextarea.vue +18 -0
- package/dist/runtime/components/ui/EPTextarea.vue.d.ts +12 -0
- package/dist/runtime/components/ui/EPToast.d.vue.ts +13 -0
- package/dist/runtime/components/ui/EPToast.vue +60 -0
- package/dist/runtime/components/ui/EPToast.vue.d.ts +13 -0
- package/dist/runtime/components/ui/EPTooltip.d.vue.ts +17 -0
- package/dist/runtime/components/ui/EPTooltip.vue +34 -0
- package/dist/runtime/components/ui/EPTooltip.vue.d.ts +17 -0
- package/dist/runtime/components/ui/form-field-context.d.ts +12 -0
- package/dist/runtime/components/ui/form-field-context.js +1 -0
- package/dist/runtime/composables/useEponyme.d.ts +24 -0
- package/dist/runtime/composables/useEponyme.js +63 -0
- package/dist/runtime/composables/useEponymeAuth.d.ts +16 -0
- package/dist/runtime/composables/useEponymeAuth.js +81 -0
- package/dist/runtime/composables/useEponymeCollection.d.ts +27 -0
- package/dist/runtime/composables/useEponymeCollection.js +44 -0
- package/dist/runtime/composables/useEponymeColorPresets.d.ts +5 -0
- package/dist/runtime/composables/useEponymeColorPresets.js +16 -0
- package/dist/runtime/composables/useEponymeConfig.d.ts +1 -0
- package/dist/runtime/composables/useEponymeConfig.js +4 -0
- package/dist/runtime/composables/useEponymeForm.d.ts +35 -0
- package/dist/runtime/composables/useEponymeForm.js +75 -0
- package/dist/runtime/composables/useEponymeHistory.d.ts +26 -0
- package/dist/runtime/composables/useEponymeHistory.js +24 -0
- package/dist/runtime/composables/useEponymeValidation.d.ts +21 -0
- package/dist/runtime/composables/useEponymeValidation.js +34 -0
- package/dist/runtime/fields/array.d.ts +2 -0
- package/dist/runtime/fields/array.js +3 -0
- package/dist/runtime/fields/boolean.d.ts +2 -0
- package/dist/runtime/fields/boolean.js +3 -0
- package/dist/runtime/fields/checkbox-group.d.ts +2 -0
- package/dist/runtime/fields/checkbox-group.js +3 -0
- package/dist/runtime/fields/color.d.ts +2 -0
- package/dist/runtime/fields/color.js +3 -0
- package/dist/runtime/fields/date.d.ts +3 -0
- package/dist/runtime/fields/date.js +6 -0
- package/dist/runtime/fields/email.d.ts +2 -0
- package/dist/runtime/fields/email.js +3 -0
- package/dist/runtime/fields/image.d.ts +2 -0
- package/dist/runtime/fields/image.js +3 -0
- package/dist/runtime/fields/index.d.ts +37 -0
- package/dist/runtime/fields/index.js +19 -0
- package/dist/runtime/fields/number.d.ts +2 -0
- package/dist/runtime/fields/number.js +3 -0
- package/dist/runtime/fields/radio.d.ts +2 -0
- package/dist/runtime/fields/radio.js +3 -0
- package/dist/runtime/fields/rich-text.d.ts +2 -0
- package/dist/runtime/fields/rich-text.js +3 -0
- package/dist/runtime/fields/section.d.ts +2 -0
- package/dist/runtime/fields/section.js +3 -0
- package/dist/runtime/fields/select.d.ts +2 -0
- package/dist/runtime/fields/select.js +3 -0
- package/dist/runtime/fields/slug.d.ts +2 -0
- package/dist/runtime/fields/slug.js +3 -0
- package/dist/runtime/fields/string.d.ts +2 -0
- package/dist/runtime/fields/string.js +3 -0
- package/dist/runtime/fields/tab.d.ts +2 -0
- package/dist/runtime/fields/tab.js +3 -0
- package/dist/runtime/fields/textarea.d.ts +2 -0
- package/dist/runtime/fields/textarea.js +3 -0
- package/dist/runtime/fields/url.d.ts +2 -0
- package/dist/runtime/fields/url.js +3 -0
- package/dist/runtime/middleware/eponyme-auth.d.ts +2 -0
- package/dist/runtime/middleware/eponyme-auth.js +13 -0
- package/dist/runtime/middleware/eponyme-owner.d.ts +2 -0
- package/dist/runtime/middleware/eponyme-owner.js +7 -0
- package/dist/runtime/pages/EponymeChangePasswordPage.d.vue.ts +3 -0
- package/dist/runtime/pages/EponymeChangePasswordPage.vue +118 -0
- package/dist/runtime/pages/EponymeChangePasswordPage.vue.d.ts +3 -0
- package/dist/runtime/pages/EponymeDetailPage.d.vue.ts +3 -0
- package/dist/runtime/pages/EponymeDetailPage.vue +83 -0
- package/dist/runtime/pages/EponymeDetailPage.vue.d.ts +3 -0
- package/dist/runtime/pages/EponymeIndexPage.d.vue.ts +3 -0
- package/dist/runtime/pages/EponymeIndexPage.vue +51 -0
- package/dist/runtime/pages/EponymeIndexPage.vue.d.ts +3 -0
- package/dist/runtime/pages/EponymeLoginPage.d.vue.ts +3 -0
- package/dist/runtime/pages/EponymeLoginPage.vue +102 -0
- package/dist/runtime/pages/EponymeLoginPage.vue.d.ts +3 -0
- package/dist/runtime/pages/EponymeUsersPage.d.vue.ts +3 -0
- package/dist/runtime/pages/EponymeUsersPage.vue +261 -0
- package/dist/runtime/pages/EponymeUsersPage.vue.d.ts +3 -0
- package/dist/runtime/server/api/eponyme/[name].get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme/[name].get.js +20 -0
- package/dist/runtime/server/api/eponyme/[name].patch.d.ts +11 -0
- package/dist/runtime/server/api/eponyme/[name].patch.js +20 -0
- package/dist/runtime/server/api/eponyme-auth/change-password.post.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-auth/change-password.post.js +21 -0
- package/dist/runtime/server/api/eponyme-auth/login.post.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-auth/login.post.js +12 -0
- package/dist/runtime/server/api/eponyme-auth/logout.post.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-auth/logout.post.js +13 -0
- package/dist/runtime/server/api/eponyme-auth/session.get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-auth/session.get.js +5 -0
- package/dist/runtime/server/api/eponyme-collections/[path].delete.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-collections/[path].delete.js +11 -0
- package/dist/runtime/server/api/eponyme-collections/[path].get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-collections/[path].get.js +11 -0
- package/dist/runtime/server/api/eponyme-collections/[path].post.d.ts +7 -0
- package/dist/runtime/server/api/eponyme-collections/[path].post.js +16 -0
- package/dist/runtime/server/api/eponyme-forms/[path].delete.d.ts +6 -0
- package/dist/runtime/server/api/eponyme-forms/[path].delete.js +19 -0
- package/dist/runtime/server/api/eponyme-forms/[path].get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-forms/[path].get.js +22 -0
- package/dist/runtime/server/api/eponyme-forms/[path].post.d.ts +19 -0
- package/dist/runtime/server/api/eponyme-forms/[path].post.js +36 -0
- package/dist/runtime/server/api/eponyme-history/[path].get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-history/[path].get.js +11 -0
- package/dist/runtime/server/api/eponyme-history/[path].patch.d.ts +2 -0
- package/dist/runtime/server/api/eponyme-history/[path].patch.js +18 -0
- package/dist/runtime/server/api/eponyme-sitemap.get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-sitemap.get.js +5 -0
- package/dist/runtime/server/api/eponyme-statuses.get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-statuses.get.js +7 -0
- package/dist/runtime/server/api/eponyme-users/[id]/reset-password.post.d.ts +5 -0
- package/dist/runtime/server/api/eponyme-users/[id]/reset-password.post.js +12 -0
- package/dist/runtime/server/api/eponyme-users/[id].patch.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-users/[id].patch.js +14 -0
- package/dist/runtime/server/api/eponyme-users/index.get.d.ts +4 -0
- package/dist/runtime/server/api/eponyme-users/index.get.js +7 -0
- package/dist/runtime/server/api/eponyme-users/index.post.d.ts +5 -0
- package/dist/runtime/server/api/eponyme-users/index.post.js +13 -0
- package/dist/runtime/server/plugins/eponyme-sync.d.ts +2 -0
- package/dist/runtime/server/plugins/eponyme-sync.js +14 -0
- package/dist/runtime/server/services/eponyme-auth-service.d.ts +2 -0
- package/dist/runtime/server/services/eponyme-auth-service.js +15 -0
- package/dist/runtime/server/services/eponyme-auth-store.d.ts +119 -0
- package/dist/runtime/server/services/eponyme-auth-store.js +227 -0
- package/dist/runtime/server/services/eponyme-form-service.d.ts +3 -0
- package/dist/runtime/server/services/eponyme-form-service.js +8 -0
- package/dist/runtime/server/services/eponyme-form-store.d.ts +100 -0
- package/dist/runtime/server/services/eponyme-form-store.js +109 -0
- package/dist/runtime/server/services/eponyme-service.d.ts +3 -0
- package/dist/runtime/server/services/eponyme-service.js +8 -0
- package/dist/runtime/server/services/eponyme-store.d.ts +202 -0
- package/dist/runtime/server/services/eponyme-store.js +338 -0
- package/dist/runtime/server/utils/auth.d.ts +11 -0
- package/dist/runtime/server/utils/auth.js +41 -0
- package/dist/runtime/server/utils/eponyme-form.d.ts +14 -0
- package/dist/runtime/server/utils/eponyme-form.js +6 -0
- package/dist/runtime/server/utils/eponyme-sitemap.d.ts +7 -0
- package/dist/runtime/server/utils/eponyme-sitemap.js +7 -0
- package/dist/runtime/server/utils/form-route.d.ts +14 -0
- package/dist/runtime/server/utils/form-route.js +14 -0
- package/dist/runtime/server/utils/password.d.ts +4 -0
- package/dist/runtime/server/utils/password.js +30 -0
- package/dist/runtime/types/auth.d.ts +20 -0
- package/dist/runtime/types/auth.js +7 -0
- package/dist/runtime/types/eponyme-config.d.ts +11 -0
- package/dist/runtime/types/eponyme-navigation.d.ts +6 -0
- package/dist/runtime/types/eponyme-navigation.js +0 -0
- package/dist/runtime/types/eponyme.d.ts +87 -0
- package/dist/runtime/types/eponyme.js +0 -0
- package/dist/runtime/types/field.d.ts +203 -0
- package/dist/runtime/types/field.js +0 -0
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/index.js +3 -0
- package/dist/runtime/types/nuxt.d.ts +11 -0
- package/dist/runtime/utils/as-record.d.ts +1 -0
- package/dist/runtime/utils/as-record.js +3 -0
- package/dist/runtime/utils/build-eponyme-schema.d.ts +22 -0
- package/dist/runtime/utils/build-eponyme-schema.js +42 -0
- package/dist/runtime/utils/changed-paths.d.ts +6 -0
- package/dist/runtime/utils/changed-paths.js +25 -0
- package/dist/runtime/utils/create-default-eponyme-data.d.ts +5 -0
- package/dist/runtime/utils/create-default-eponyme-data.js +12 -0
- package/dist/runtime/utils/field-path.d.ts +14 -0
- package/dist/runtime/utils/field-path.js +23 -0
- package/dist/runtime/utils/get-eponyme-schemas.d.ts +7 -0
- package/dist/runtime/utils/get-eponyme-schemas.js +33 -0
- package/dist/runtime/utils/get-field-default-value.d.ts +4 -0
- package/dist/runtime/utils/get-field-default-value.js +56 -0
- package/dist/runtime/utils/humanize-label.d.ts +6 -0
- package/dist/runtime/utils/humanize-label.js +3 -0
- package/dist/runtime/utils/initials.d.ts +1 -0
- package/dist/runtime/utils/initials.js +3 -0
- package/dist/runtime/utils/is-field-visible.d.ts +2 -0
- package/dist/runtime/utils/is-field-visible.js +14 -0
- package/dist/runtime/utils/normalize-hex-color.d.ts +8 -0
- package/dist/runtime/utils/normalize-hex-color.js +11 -0
- package/dist/runtime/utils/normalize-slug.d.ts +1 -0
- package/dist/runtime/utils/normalize-slug.js +4 -0
- package/dist/runtime/utils/preview.d.ts +30 -0
- package/dist/runtime/utils/preview.js +30 -0
- package/dist/runtime/utils/validate-eponyme-data.d.ts +10 -0
- package/dist/runtime/utils/validate-eponyme-data.js +204 -0
- package/dist/types.d.mts +11 -0
- package/package.json +96 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useSortable } from "@vueuse/integrations/useSortable";
|
|
3
|
+
import { computed, nextTick, ref } from "vue";
|
|
4
|
+
import FieldRenderer from "./FieldRenderer.vue";
|
|
5
|
+
import { getArrayItemDefaultValue, isArrayItemFieldDefinition } from "../../utils/get-field-default-value";
|
|
6
|
+
import { isFieldVisible } from "../../utils/is-field-visible";
|
|
7
|
+
import { asRecord } from "../../utils/as-record";
|
|
8
|
+
import { errorsAt, fieldPathId, joinFieldPath } from "../../utils/field-path";
|
|
9
|
+
import EPButton from "../ui/EPButton.vue";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
fieldName: { type: String, required: true },
|
|
12
|
+
definition: { type: Object, required: true },
|
|
13
|
+
modelValue: { type: null, required: true },
|
|
14
|
+
path: { type: String, required: false },
|
|
15
|
+
errors: { type: Object, required: false },
|
|
16
|
+
disabled: { type: Boolean, required: false }
|
|
17
|
+
});
|
|
18
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
19
|
+
const items = computed(() => Array.isArray(props.modelValue) ? props.modelValue : []);
|
|
20
|
+
const isSimple = computed(() => isArrayItemFieldDefinition(props.definition.options.of));
|
|
21
|
+
const objectFields = computed(() => isSimple.value ? [] : Object.entries(props.definition.options.of));
|
|
22
|
+
const basePath = computed(() => props.path || props.fieldName);
|
|
23
|
+
const sortableRoot = ref(null);
|
|
24
|
+
const sortableItems = computed({
|
|
25
|
+
get: () => items.value,
|
|
26
|
+
set: (value) => {
|
|
27
|
+
if (!props.disabled) emit("update:modelValue", value);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
useSortable(sortableRoot, sortableItems, {
|
|
31
|
+
animation: 180,
|
|
32
|
+
disabled: props.disabled,
|
|
33
|
+
draggable: ".eponyme-sortable-item",
|
|
34
|
+
handle: ".eponyme-drag-handle",
|
|
35
|
+
ghostClass: "eponyme-sortable-ghost",
|
|
36
|
+
chosenClass: "eponyme-sortable-chosen"
|
|
37
|
+
});
|
|
38
|
+
function itemLabel(index) {
|
|
39
|
+
return (props.definition.options.itemLabel || "Item $i").replaceAll("$i", String(index + 1));
|
|
40
|
+
}
|
|
41
|
+
function itemPath(index, fieldName) {
|
|
42
|
+
const path = joinFieldPath(basePath.value, index);
|
|
43
|
+
return fieldName ? joinFieldPath(path, fieldName) : path;
|
|
44
|
+
}
|
|
45
|
+
function itemErrorKey(index, fieldName) {
|
|
46
|
+
return fieldName ? `${index}.${fieldName}` : String(index);
|
|
47
|
+
}
|
|
48
|
+
async function addItem() {
|
|
49
|
+
if (props.disabled) return;
|
|
50
|
+
if (props.definition.options.maxItems !== void 0 && items.value.length >= props.definition.options.maxItems) return;
|
|
51
|
+
const index = items.value.length;
|
|
52
|
+
emit("update:modelValue", [...items.value, getArrayItemDefaultValue(props.definition.options.of)]);
|
|
53
|
+
await nextTick();
|
|
54
|
+
document.getElementById(fieldPathId(itemPath(index, objectFields.value[0]?.[0])))?.focus();
|
|
55
|
+
}
|
|
56
|
+
function removeItem(index) {
|
|
57
|
+
if (props.disabled) return;
|
|
58
|
+
emit("update:modelValue", items.value.filter((_, itemIndex) => itemIndex !== index));
|
|
59
|
+
}
|
|
60
|
+
function updateItem(index, value) {
|
|
61
|
+
if (props.disabled) return;
|
|
62
|
+
const next = [...items.value];
|
|
63
|
+
next[index] = value;
|
|
64
|
+
emit("update:modelValue", next);
|
|
65
|
+
}
|
|
66
|
+
function updateObjectItem(index, fieldName, value) {
|
|
67
|
+
updateItem(index, { ...asRecord(items.value[index]), [fieldName]: value });
|
|
68
|
+
}
|
|
69
|
+
async function handleObjectEnter(index, fieldName) {
|
|
70
|
+
const itemData = asRecord(items.value[index]);
|
|
71
|
+
const fieldIndex = objectFields.value.findIndex(([name]) => name === fieldName);
|
|
72
|
+
const nextField = objectFields.value.slice(fieldIndex + 1).find(([, definition]) => isFieldVisible(definition.options, itemData));
|
|
73
|
+
if (nextField) {
|
|
74
|
+
document.getElementById(fieldPathId(itemPath(index, nextField[0])))?.focus();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
await addItem();
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<template>
|
|
82
|
+
<div class="ep:grid ep:min-w-0 ep:max-w-full ep:gap-3">
|
|
83
|
+
<div
|
|
84
|
+
ref="sortableRoot"
|
|
85
|
+
class="ep:grid ep:gap-3"
|
|
86
|
+
>
|
|
87
|
+
<div
|
|
88
|
+
v-for="(item, index) in items"
|
|
89
|
+
:key="index"
|
|
90
|
+
class="eponyme-sortable-item"
|
|
91
|
+
:class="isSimple ? 'ep:grid ep:min-w-0 ep:grid-cols-[2rem_minmax(0,1fr)_3rem] ep:items-start ep:gap-2' : 'ep:min-w-0 ep:max-w-full ep:rounded-xl ep:bg-selected-ep/30 ep:p-4'"
|
|
92
|
+
>
|
|
93
|
+
<template v-if="isSimple">
|
|
94
|
+
<button
|
|
95
|
+
type="button"
|
|
96
|
+
class="eponyme-drag-handle ep:flex ep:h-12 ep:w-8 ep:cursor-grab ep:items-center ep:justify-center ep:border-0 ep:bg-transparent ep:text-base ep:tracking-tighter ep:text-muted-ep ep:active:cursor-grabbing ep:hover:text-white"
|
|
97
|
+
:disabled="disabled"
|
|
98
|
+
:aria-label="`Move ${itemLabel(index)}`"
|
|
99
|
+
title="Drag to reorder"
|
|
100
|
+
>
|
|
101
|
+
⠿
|
|
102
|
+
</button>
|
|
103
|
+
<div class="ep:min-w-0 ep:flex-1">
|
|
104
|
+
<FieldRenderer
|
|
105
|
+
hide-label
|
|
106
|
+
:field-name="fieldName"
|
|
107
|
+
:path="itemPath(index)"
|
|
108
|
+
:field="definition.options.of"
|
|
109
|
+
:model-value="item"
|
|
110
|
+
:errors="errorsAt(errors, itemErrorKey(index))"
|
|
111
|
+
:disabled="disabled"
|
|
112
|
+
@update:model-value="updateItem(index, $event)"
|
|
113
|
+
@enter="addItem"
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
<EPButton
|
|
117
|
+
icon="mingcute:close-line"
|
|
118
|
+
:disabled="disabled"
|
|
119
|
+
:aria-label="`Remove ${itemLabel(index)}`"
|
|
120
|
+
@click="removeItem(index)"
|
|
121
|
+
/>
|
|
122
|
+
</template>
|
|
123
|
+
|
|
124
|
+
<template v-else>
|
|
125
|
+
<div class="ep:mb-4 ep:flex ep:items-center ep:justify-between ep:gap-3">
|
|
126
|
+
<div class="ep:flex ep:items-center ep:gap-2">
|
|
127
|
+
<button
|
|
128
|
+
type="button"
|
|
129
|
+
class="eponyme-drag-handle ep:flex ep:h-8 ep:w-7 ep:cursor-grab ep:items-center ep:justify-center ep:border-0 ep:bg-transparent ep:text-base ep:tracking-tighter ep:text-muted-ep ep:active:cursor-grabbing ep:hover:text-white"
|
|
130
|
+
:disabled="disabled"
|
|
131
|
+
:aria-label="`Move ${itemLabel(index)}`"
|
|
132
|
+
title="Drag to reorder"
|
|
133
|
+
>
|
|
134
|
+
⠿
|
|
135
|
+
</button>
|
|
136
|
+
<span class="ep:text-xs ep:font-semibold ep:text-muted-ep">{{ itemLabel(index) }}</span>
|
|
137
|
+
</div>
|
|
138
|
+
<EPButton
|
|
139
|
+
icon="mingcute:close-line"
|
|
140
|
+
:aria-label="`Remove ${itemLabel(index)}`"
|
|
141
|
+
:disabled="disabled"
|
|
142
|
+
@click="removeItem(index)"
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="ep:grid ep:min-w-0 ep:gap-4">
|
|
146
|
+
<template
|
|
147
|
+
v-for="([itemFieldName, itemDefinition]) in objectFields"
|
|
148
|
+
:key="itemFieldName"
|
|
149
|
+
>
|
|
150
|
+
<FieldRenderer
|
|
151
|
+
v-if="isFieldVisible(itemDefinition.options, asRecord(item))"
|
|
152
|
+
compact
|
|
153
|
+
:field-name="itemFieldName"
|
|
154
|
+
:path="itemPath(index, itemFieldName)"
|
|
155
|
+
:field="itemDefinition"
|
|
156
|
+
:model-value="asRecord(item)[itemFieldName]"
|
|
157
|
+
:errors="errorsAt(errors, itemErrorKey(index, itemFieldName))"
|
|
158
|
+
:disabled="disabled"
|
|
159
|
+
@update:model-value="updateObjectItem(index, itemFieldName, $event)"
|
|
160
|
+
@enter="handleObjectEnter(index, itemFieldName)"
|
|
161
|
+
/>
|
|
162
|
+
</template>
|
|
163
|
+
</div>
|
|
164
|
+
<p
|
|
165
|
+
v-for="error in errorsAt(errors, itemErrorKey(index))"
|
|
166
|
+
:key="error"
|
|
167
|
+
role="alert"
|
|
168
|
+
class="ep:mt-2 ep:text-xs ep:text-danger-ep"
|
|
169
|
+
>
|
|
170
|
+
{{ error }}
|
|
171
|
+
</p>
|
|
172
|
+
</template>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<div class="ep:flex ep:items-center ep:justify-between ep:gap-3">
|
|
177
|
+
<EPButton
|
|
178
|
+
size="sm"
|
|
179
|
+
class="ep:disabled:cursor-not-allowed ep:disabled:opacity-50"
|
|
180
|
+
:disabled="disabled || definition.options.maxItems !== void 0 && items.length >= definition.options.maxItems"
|
|
181
|
+
@click="addItem"
|
|
182
|
+
>
|
|
183
|
+
{{ definition.options.addLabel || "Add item" }}
|
|
184
|
+
</EPButton>
|
|
185
|
+
<span
|
|
186
|
+
v-if="definition.options.showCounter !== false && (definition.options.minItems !== void 0 || definition.options.maxItems !== void 0)"
|
|
187
|
+
class="ep:text-[11px] ep:text-muted-ep"
|
|
188
|
+
>
|
|
189
|
+
{{ items.length }}<template v-if="definition.options.maxItems !== void 0"> / {{ definition.options.maxItems }}</template>
|
|
190
|
+
items<template v-if="definition.options.minItems !== void 0"> · min {{ definition.options.minItems }}</template>
|
|
191
|
+
</span>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</template>
|
|
195
|
+
|
|
196
|
+
<style scoped>
|
|
197
|
+
.eponyme-sortable-ghost{opacity:.25}.eponyme-sortable-chosen{cursor:grabbing}
|
|
198
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ArrayFieldDefinition } from '../../types/index.js';
|
|
2
|
+
import type { ValidationErrors } from '../../utils/validate-eponyme-data.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
fieldName: string;
|
|
5
|
+
definition: ArrayFieldDefinition;
|
|
6
|
+
modelValue: unknown;
|
|
7
|
+
/** Dotted path of this array; items extend it with their index. */
|
|
8
|
+
path?: string;
|
|
9
|
+
/** Errors of this subtree, keyed relative to this array (`0.title`, `1`). */
|
|
10
|
+
errors?: ValidationErrors;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: unknown[]) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: unknown[]) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
modelValue?: unknown;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
errors?: string[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: boolean) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import EPFormField from "../ui/EPFormField.vue";
|
|
3
|
+
import EPSwitch from "../ui/EPSwitch.vue";
|
|
4
|
+
defineProps({
|
|
5
|
+
id: { type: String, required: true },
|
|
6
|
+
modelValue: { type: null, required: false },
|
|
7
|
+
label: { type: String, required: true },
|
|
8
|
+
description: { type: String, required: false },
|
|
9
|
+
required: { type: Boolean, required: false },
|
|
10
|
+
errors: { type: Array, required: false, default: () => [] },
|
|
11
|
+
disabled: { type: Boolean, required: false }
|
|
12
|
+
});
|
|
13
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<EPFormField
|
|
18
|
+
:id="id"
|
|
19
|
+
:label="label"
|
|
20
|
+
:description="description"
|
|
21
|
+
:required="required"
|
|
22
|
+
:errors="errors"
|
|
23
|
+
>
|
|
24
|
+
<ClientOnly>
|
|
25
|
+
<EPSwitch
|
|
26
|
+
:id="id"
|
|
27
|
+
:model-value="Boolean(modelValue)"
|
|
28
|
+
:disabled="disabled"
|
|
29
|
+
@update:model-value="emit('update:modelValue', $event)"
|
|
30
|
+
/>
|
|
31
|
+
<template #fallback>
|
|
32
|
+
<span class="ep:block ep:h-6 ep:w-11 ep:rounded-full ep:border ep:border-border-ep ep:bg-selected-ep" />
|
|
33
|
+
</template>
|
|
34
|
+
</ClientOnly>
|
|
35
|
+
</EPFormField>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
modelValue?: unknown;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
errors?: string[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: boolean) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
modelValue?: unknown;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
options: ReadonlyArray<{
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}>;
|
|
11
|
+
errors?: string[];
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:modelValue": (value: string[]) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import EPCheckbox from "../ui/EPCheckbox.vue";
|
|
3
|
+
import EPFormField from "../ui/EPFormField.vue";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
id: { type: String, required: true },
|
|
6
|
+
modelValue: { type: null, required: false },
|
|
7
|
+
label: { type: String, required: true },
|
|
8
|
+
description: { type: String, required: false },
|
|
9
|
+
required: { type: Boolean, required: false },
|
|
10
|
+
options: { type: Array, required: true },
|
|
11
|
+
errors: { type: Array, required: false, default: () => [] },
|
|
12
|
+
disabled: { type: Boolean, required: false }
|
|
13
|
+
});
|
|
14
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
15
|
+
function checked(value) {
|
|
16
|
+
return Array.isArray(props.modelValue) && props.modelValue.includes(value);
|
|
17
|
+
}
|
|
18
|
+
function update(value, enabled) {
|
|
19
|
+
const current = Array.isArray(props.modelValue) ? props.modelValue.filter((item) => typeof item === "string") : [];
|
|
20
|
+
emit("update:modelValue", enabled ? [.../* @__PURE__ */ new Set([...current, value])] : current.filter((item) => item !== value));
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<EPFormField
|
|
26
|
+
:id="id"
|
|
27
|
+
:label="label"
|
|
28
|
+
:description="description"
|
|
29
|
+
:required="required"
|
|
30
|
+
:errors="errors"
|
|
31
|
+
>
|
|
32
|
+
<div class="ep:grid ep:gap-2 ep:sm:grid-cols-2">
|
|
33
|
+
<label
|
|
34
|
+
v-for="option in options"
|
|
35
|
+
:key="option.value"
|
|
36
|
+
class="ep:flex ep:cursor-pointer ep:items-center ep:gap-3 ep:rounded-xl ep:bg-selected-ep/40 ep:px-4 ep:py-3 ep:text-sm ep:text-text-ep ep:transition ep:hover:border-muted-ep"
|
|
37
|
+
>
|
|
38
|
+
<ClientOnly>
|
|
39
|
+
<EPCheckbox
|
|
40
|
+
:model-value="checked(option.value)"
|
|
41
|
+
:disabled="disabled"
|
|
42
|
+
@update:model-value="update(option.value, $event)"
|
|
43
|
+
/>
|
|
44
|
+
<template #fallback>
|
|
45
|
+
<span class="ep:h-5 ep:w-5 ep:rounded-md ep:border ep:border-border-ep ep:bg-selected-ep" />
|
|
46
|
+
</template>
|
|
47
|
+
</ClientOnly>
|
|
48
|
+
{{ option.label }}
|
|
49
|
+
</label>
|
|
50
|
+
</div>
|
|
51
|
+
</EPFormField>
|
|
52
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
modelValue?: unknown;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
options: ReadonlyArray<{
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}>;
|
|
11
|
+
errors?: string[];
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:modelValue": (value: string[]) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ColorPreset } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
id: string;
|
|
4
|
+
modelValue?: unknown;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
errors?: string[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Overrides the module-wide palette for this field only. */
|
|
11
|
+
presets?: ReadonlyArray<string | ColorPreset>;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: string) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import EPFormField from "../ui/EPFormField.vue";
|
|
4
|
+
import EPColorPicker from "../ui/EPColorPicker.vue";
|
|
5
|
+
import { normalizeColorPresets, useEponymeColorPresets } from "../../composables/useEponymeColorPresets";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
id: { type: String, required: true },
|
|
8
|
+
modelValue: { type: null, required: false },
|
|
9
|
+
label: { type: String, required: true },
|
|
10
|
+
description: { type: String, required: false },
|
|
11
|
+
required: { type: Boolean, required: false },
|
|
12
|
+
errors: { type: Array, required: false, default: () => [] },
|
|
13
|
+
disabled: { type: Boolean, required: false },
|
|
14
|
+
presets: { type: Array, required: false }
|
|
15
|
+
});
|
|
16
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
17
|
+
const globalPresets = useEponymeColorPresets();
|
|
18
|
+
const presets = computed(() => props.presets ? normalizeColorPresets(props.presets) : globalPresets);
|
|
19
|
+
const value = computed(() => typeof props.modelValue === "string" ? props.modelValue : "");
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<EPFormField
|
|
24
|
+
:id="id"
|
|
25
|
+
:label="label"
|
|
26
|
+
:description="description"
|
|
27
|
+
:required="required"
|
|
28
|
+
:errors="errors"
|
|
29
|
+
>
|
|
30
|
+
<EPColorPicker
|
|
31
|
+
:id="id"
|
|
32
|
+
:model-value="value"
|
|
33
|
+
:presets="presets"
|
|
34
|
+
:disabled="disabled"
|
|
35
|
+
:invalid="Boolean(errors.length)"
|
|
36
|
+
@update:model-value="emit('update:modelValue', $event)"
|
|
37
|
+
/>
|
|
38
|
+
</EPFormField>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ColorPreset } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
id: string;
|
|
4
|
+
modelValue?: unknown;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
errors?: string[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Overrides the module-wide palette for this field only. */
|
|
11
|
+
presets?: ReadonlyArray<string | ColorPreset>;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: string) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
modelValue?: unknown;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
min?: string;
|
|
8
|
+
max?: string;
|
|
9
|
+
errors?: string[];
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (value: string | number) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import EPFormField from "../ui/EPFormField.vue";
|
|
3
|
+
import EPInputText from "../ui/EPInputText.vue";
|
|
4
|
+
defineProps({
|
|
5
|
+
id: { type: String, required: true },
|
|
6
|
+
modelValue: { type: null, required: false },
|
|
7
|
+
label: { type: String, required: true },
|
|
8
|
+
description: { type: String, required: false },
|
|
9
|
+
required: { type: Boolean, required: false },
|
|
10
|
+
min: { type: String, required: false },
|
|
11
|
+
max: { type: String, required: false },
|
|
12
|
+
errors: { type: Array, required: false, default: () => [] },
|
|
13
|
+
disabled: { type: Boolean, required: false }
|
|
14
|
+
});
|
|
15
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<EPFormField
|
|
20
|
+
:id="id"
|
|
21
|
+
:label="label"
|
|
22
|
+
:description="description"
|
|
23
|
+
:required="required"
|
|
24
|
+
:errors="errors"
|
|
25
|
+
>
|
|
26
|
+
<EPInputText
|
|
27
|
+
:id="id"
|
|
28
|
+
:model-value="typeof modelValue === 'string' ? modelValue : ''"
|
|
29
|
+
type="date"
|
|
30
|
+
:min="min"
|
|
31
|
+
:max="max"
|
|
32
|
+
:required="required"
|
|
33
|
+
:invalid="Boolean(errors.length)"
|
|
34
|
+
:disabled="disabled"
|
|
35
|
+
class="ep:font-sans"
|
|
36
|
+
@update:model-value="emit('update:modelValue', $event)"
|
|
37
|
+
/>
|
|
38
|
+
</EPFormField>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
modelValue?: unknown;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
min?: string;
|
|
8
|
+
max?: string;
|
|
9
|
+
errors?: string[];
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (value: string | number) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FieldDefinition } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
fieldName: string;
|
|
4
|
+
field: Exclude<FieldDefinition, {
|
|
5
|
+
type: 'array' | 'section' | 'tabs';
|
|
6
|
+
}>;
|
|
7
|
+
modelValue?: unknown;
|
|
8
|
+
/** Dotted path of this field in the document; defaults to its name at the root. */
|
|
9
|
+
path?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
errors?: string[];
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
hideLabel?: boolean;
|
|
14
|
+
compact?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: unknown) => any;
|
|
18
|
+
enter: () => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
21
|
+
onEnter?: (() => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|