@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.
Files changed (325) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +609 -0
  3. package/dist/eponyme.d.mts +15 -0
  4. package/dist/eponyme.mjs +38 -0
  5. package/dist/module.d.mts +26 -0
  6. package/dist/module.json +9 -0
  7. package/dist/module.mjs +154 -0
  8. package/dist/runtime/assets/dashboard.css +1 -0
  9. package/dist/runtime/components/editor/EponymeCollectionPage.d.vue.ts +9 -0
  10. package/dist/runtime/components/editor/EponymeCollectionPage.vue +238 -0
  11. package/dist/runtime/components/editor/EponymeCollectionPage.vue.d.ts +9 -0
  12. package/dist/runtime/components/editor/EponymeCopy.d.vue.ts +7 -0
  13. package/dist/runtime/components/editor/EponymeCopy.vue +28 -0
  14. package/dist/runtime/components/editor/EponymeCopy.vue.d.ts +7 -0
  15. package/dist/runtime/components/editor/EponymeFolderNav.d.vue.ts +7 -0
  16. package/dist/runtime/components/editor/EponymeFolderNav.vue +146 -0
  17. package/dist/runtime/components/editor/EponymeFolderNav.vue.d.ts +7 -0
  18. package/dist/runtime/components/editor/EponymeFolderPage.d.vue.ts +7 -0
  19. package/dist/runtime/components/editor/EponymeFolderPage.vue +62 -0
  20. package/dist/runtime/components/editor/EponymeFolderPage.vue.d.ts +7 -0
  21. package/dist/runtime/components/editor/EponymeForm.d.vue.ts +9 -0
  22. package/dist/runtime/components/editor/EponymeForm.vue +309 -0
  23. package/dist/runtime/components/editor/EponymeForm.vue.d.ts +9 -0
  24. package/dist/runtime/components/editor/EponymeFormPage.d.vue.ts +8 -0
  25. package/dist/runtime/components/editor/EponymeFormPage.vue +288 -0
  26. package/dist/runtime/components/editor/EponymeFormPage.vue.d.ts +8 -0
  27. package/dist/runtime/components/editor/EponymeHistoryDialog.d.vue.ts +14 -0
  28. package/dist/runtime/components/editor/EponymeHistoryDialog.vue +97 -0
  29. package/dist/runtime/components/editor/EponymeHistoryDialog.vue.d.ts +14 -0
  30. package/dist/runtime/components/editor/EponymeNavigationLink.d.vue.ts +14 -0
  31. package/dist/runtime/components/editor/EponymeNavigationLink.vue +80 -0
  32. package/dist/runtime/components/editor/EponymeNavigationLink.vue.d.ts +14 -0
  33. package/dist/runtime/components/editor/EponymePageNavigation.d.vue.ts +8 -0
  34. package/dist/runtime/components/editor/EponymePageNavigation.vue +58 -0
  35. package/dist/runtime/components/editor/EponymePageNavigation.vue.d.ts +8 -0
  36. package/dist/runtime/components/editor/EponymePreviewPanel.d.vue.ts +16 -0
  37. package/dist/runtime/components/editor/EponymePreviewPanel.vue +100 -0
  38. package/dist/runtime/components/editor/EponymePreviewPanel.vue.d.ts +16 -0
  39. package/dist/runtime/components/editor/EponymeSidebar.d.vue.ts +6 -0
  40. package/dist/runtime/components/editor/EponymeSidebar.vue +244 -0
  41. package/dist/runtime/components/editor/EponymeSidebar.vue.d.ts +6 -0
  42. package/dist/runtime/components/editor/EponymeSidebarTree.d.vue.ts +18 -0
  43. package/dist/runtime/components/editor/EponymeSidebarTree.vue +84 -0
  44. package/dist/runtime/components/editor/EponymeSidebarTree.vue.d.ts +18 -0
  45. package/dist/runtime/components/fields/ArrayField.d.vue.ts +19 -0
  46. package/dist/runtime/components/fields/ArrayField.vue +198 -0
  47. package/dist/runtime/components/fields/ArrayField.vue.d.ts +19 -0
  48. package/dist/runtime/components/fields/BooleanField.d.vue.ts +16 -0
  49. package/dist/runtime/components/fields/BooleanField.vue +36 -0
  50. package/dist/runtime/components/fields/BooleanField.vue.d.ts +16 -0
  51. package/dist/runtime/components/fields/CheckboxGroupField.d.vue.ts +20 -0
  52. package/dist/runtime/components/fields/CheckboxGroupField.vue +52 -0
  53. package/dist/runtime/components/fields/CheckboxGroupField.vue.d.ts +20 -0
  54. package/dist/runtime/components/fields/ColorField.d.vue.ts +19 -0
  55. package/dist/runtime/components/fields/ColorField.vue +39 -0
  56. package/dist/runtime/components/fields/ColorField.vue.d.ts +19 -0
  57. package/dist/runtime/components/fields/DateField.d.vue.ts +18 -0
  58. package/dist/runtime/components/fields/DateField.vue +39 -0
  59. package/dist/runtime/components/fields/DateField.vue.d.ts +18 -0
  60. package/dist/runtime/components/fields/FieldRenderer.d.vue.ts +24 -0
  61. package/dist/runtime/components/fields/FieldRenderer.vue +135 -0
  62. package/dist/runtime/components/fields/FieldRenderer.vue.d.ts +24 -0
  63. package/dist/runtime/components/fields/NumberField.d.vue.ts +20 -0
  64. package/dist/runtime/components/fields/NumberField.vue +58 -0
  65. package/dist/runtime/components/fields/NumberField.vue.d.ts +20 -0
  66. package/dist/runtime/components/fields/RadioField.d.vue.ts +20 -0
  67. package/dist/runtime/components/fields/RadioField.vue +44 -0
  68. package/dist/runtime/components/fields/RadioField.vue.d.ts +20 -0
  69. package/dist/runtime/components/fields/RichTextField.d.vue.ts +20 -0
  70. package/dist/runtime/components/fields/RichTextField.vue +176 -0
  71. package/dist/runtime/components/fields/RichTextField.vue.d.ts +20 -0
  72. package/dist/runtime/components/fields/SectionField.d.vue.ts +20 -0
  73. package/dist/runtime/components/fields/SectionField.vue +127 -0
  74. package/dist/runtime/components/fields/SectionField.vue.d.ts +20 -0
  75. package/dist/runtime/components/fields/SelectField.d.vue.ts +21 -0
  76. package/dist/runtime/components/fields/SelectField.vue +42 -0
  77. package/dist/runtime/components/fields/SelectField.vue.d.ts +21 -0
  78. package/dist/runtime/components/fields/SlugField.d.vue.ts +20 -0
  79. package/dist/runtime/components/fields/SlugField.vue +35 -0
  80. package/dist/runtime/components/fields/SlugField.vue.d.ts +20 -0
  81. package/dist/runtime/components/fields/TabsField.d.vue.ts +19 -0
  82. package/dist/runtime/components/fields/TabsField.vue +109 -0
  83. package/dist/runtime/components/fields/TabsField.vue.d.ts +19 -0
  84. package/dist/runtime/components/fields/TextField.d.vue.ts +22 -0
  85. package/dist/runtime/components/fields/TextField.vue +56 -0
  86. package/dist/runtime/components/fields/TextField.vue.d.ts +22 -0
  87. package/dist/runtime/components/fields/TextareaField.d.vue.ts +20 -0
  88. package/dist/runtime/components/fields/TextareaField.vue +47 -0
  89. package/dist/runtime/components/fields/TextareaField.vue.d.ts +20 -0
  90. package/dist/runtime/components/fields/UrlField.d.vue.ts +17 -0
  91. package/dist/runtime/components/fields/UrlField.vue +35 -0
  92. package/dist/runtime/components/fields/UrlField.vue.d.ts +17 -0
  93. package/dist/runtime/components/ui/EPAccordion.d.vue.ts +26 -0
  94. package/dist/runtime/components/ui/EPAccordion.vue +64 -0
  95. package/dist/runtime/components/ui/EPAccordion.vue.d.ts +26 -0
  96. package/dist/runtime/components/ui/EPAvatar.d.vue.ts +9 -0
  97. package/dist/runtime/components/ui/EPAvatar.vue +25 -0
  98. package/dist/runtime/components/ui/EPAvatar.vue.d.ts +9 -0
  99. package/dist/runtime/components/ui/EPBadge.d.vue.ts +16 -0
  100. package/dist/runtime/components/ui/EPBadge.vue +17 -0
  101. package/dist/runtime/components/ui/EPBadge.vue.d.ts +16 -0
  102. package/dist/runtime/components/ui/EPButton.d.vue.ts +22 -0
  103. package/dist/runtime/components/ui/EPButton.vue +55 -0
  104. package/dist/runtime/components/ui/EPButton.vue.d.ts +22 -0
  105. package/dist/runtime/components/ui/EPCheckbox.d.vue.ts +11 -0
  106. package/dist/runtime/components/ui/EPCheckbox.vue +21 -0
  107. package/dist/runtime/components/ui/EPCheckbox.vue.d.ts +11 -0
  108. package/dist/runtime/components/ui/EPColorPicker.d.vue.ts +19 -0
  109. package/dist/runtime/components/ui/EPColorPicker.vue +63 -0
  110. package/dist/runtime/components/ui/EPColorPicker.vue.d.ts +19 -0
  111. package/dist/runtime/components/ui/EPDialog.d.vue.ts +24 -0
  112. package/dist/runtime/components/ui/EPDialog.vue +54 -0
  113. package/dist/runtime/components/ui/EPDialog.vue.d.ts +24 -0
  114. package/dist/runtime/components/ui/EPDropdownMenu.d.vue.ts +25 -0
  115. package/dist/runtime/components/ui/EPDropdownMenu.vue +40 -0
  116. package/dist/runtime/components/ui/EPDropdownMenu.vue.d.ts +25 -0
  117. package/dist/runtime/components/ui/EPFormField.d.vue.ts +24 -0
  118. package/dist/runtime/components/ui/EPFormField.vue +62 -0
  119. package/dist/runtime/components/ui/EPFormField.vue.d.ts +24 -0
  120. package/dist/runtime/components/ui/EPInputText.d.vue.ts +17 -0
  121. package/dist/runtime/components/ui/EPInputText.vue +33 -0
  122. package/dist/runtime/components/ui/EPInputText.vue.d.ts +17 -0
  123. package/dist/runtime/components/ui/EPLinkEditor.d.vue.ts +16 -0
  124. package/dist/runtime/components/ui/EPLinkEditor.vue +169 -0
  125. package/dist/runtime/components/ui/EPLinkEditor.vue.d.ts +16 -0
  126. package/dist/runtime/components/ui/EPRadioButton.d.vue.ts +16 -0
  127. package/dist/runtime/components/ui/EPRadioButton.vue +34 -0
  128. package/dist/runtime/components/ui/EPRadioButton.vue.d.ts +16 -0
  129. package/dist/runtime/components/ui/EPSelect.d.vue.ts +21 -0
  130. package/dist/runtime/components/ui/EPSelect.vue +73 -0
  131. package/dist/runtime/components/ui/EPSelect.vue.d.ts +21 -0
  132. package/dist/runtime/components/ui/EPSlider.d.vue.ts +16 -0
  133. package/dist/runtime/components/ui/EPSlider.vue +51 -0
  134. package/dist/runtime/components/ui/EPSlider.vue.d.ts +16 -0
  135. package/dist/runtime/components/ui/EPSwitch.d.vue.ts +11 -0
  136. package/dist/runtime/components/ui/EPSwitch.vue +23 -0
  137. package/dist/runtime/components/ui/EPSwitch.vue.d.ts +11 -0
  138. package/dist/runtime/components/ui/EPTextarea.d.vue.ts +12 -0
  139. package/dist/runtime/components/ui/EPTextarea.vue +18 -0
  140. package/dist/runtime/components/ui/EPTextarea.vue.d.ts +12 -0
  141. package/dist/runtime/components/ui/EPToast.d.vue.ts +13 -0
  142. package/dist/runtime/components/ui/EPToast.vue +60 -0
  143. package/dist/runtime/components/ui/EPToast.vue.d.ts +13 -0
  144. package/dist/runtime/components/ui/EPTooltip.d.vue.ts +17 -0
  145. package/dist/runtime/components/ui/EPTooltip.vue +34 -0
  146. package/dist/runtime/components/ui/EPTooltip.vue.d.ts +17 -0
  147. package/dist/runtime/components/ui/form-field-context.d.ts +12 -0
  148. package/dist/runtime/components/ui/form-field-context.js +1 -0
  149. package/dist/runtime/composables/useEponyme.d.ts +24 -0
  150. package/dist/runtime/composables/useEponyme.js +63 -0
  151. package/dist/runtime/composables/useEponymeAuth.d.ts +16 -0
  152. package/dist/runtime/composables/useEponymeAuth.js +81 -0
  153. package/dist/runtime/composables/useEponymeCollection.d.ts +27 -0
  154. package/dist/runtime/composables/useEponymeCollection.js +44 -0
  155. package/dist/runtime/composables/useEponymeColorPresets.d.ts +5 -0
  156. package/dist/runtime/composables/useEponymeColorPresets.js +16 -0
  157. package/dist/runtime/composables/useEponymeConfig.d.ts +1 -0
  158. package/dist/runtime/composables/useEponymeConfig.js +4 -0
  159. package/dist/runtime/composables/useEponymeForm.d.ts +35 -0
  160. package/dist/runtime/composables/useEponymeForm.js +75 -0
  161. package/dist/runtime/composables/useEponymeHistory.d.ts +26 -0
  162. package/dist/runtime/composables/useEponymeHistory.js +24 -0
  163. package/dist/runtime/composables/useEponymeValidation.d.ts +21 -0
  164. package/dist/runtime/composables/useEponymeValidation.js +34 -0
  165. package/dist/runtime/fields/array.d.ts +2 -0
  166. package/dist/runtime/fields/array.js +3 -0
  167. package/dist/runtime/fields/boolean.d.ts +2 -0
  168. package/dist/runtime/fields/boolean.js +3 -0
  169. package/dist/runtime/fields/checkbox-group.d.ts +2 -0
  170. package/dist/runtime/fields/checkbox-group.js +3 -0
  171. package/dist/runtime/fields/color.d.ts +2 -0
  172. package/dist/runtime/fields/color.js +3 -0
  173. package/dist/runtime/fields/date.d.ts +3 -0
  174. package/dist/runtime/fields/date.js +6 -0
  175. package/dist/runtime/fields/email.d.ts +2 -0
  176. package/dist/runtime/fields/email.js +3 -0
  177. package/dist/runtime/fields/image.d.ts +2 -0
  178. package/dist/runtime/fields/image.js +3 -0
  179. package/dist/runtime/fields/index.d.ts +37 -0
  180. package/dist/runtime/fields/index.js +19 -0
  181. package/dist/runtime/fields/number.d.ts +2 -0
  182. package/dist/runtime/fields/number.js +3 -0
  183. package/dist/runtime/fields/radio.d.ts +2 -0
  184. package/dist/runtime/fields/radio.js +3 -0
  185. package/dist/runtime/fields/rich-text.d.ts +2 -0
  186. package/dist/runtime/fields/rich-text.js +3 -0
  187. package/dist/runtime/fields/section.d.ts +2 -0
  188. package/dist/runtime/fields/section.js +3 -0
  189. package/dist/runtime/fields/select.d.ts +2 -0
  190. package/dist/runtime/fields/select.js +3 -0
  191. package/dist/runtime/fields/slug.d.ts +2 -0
  192. package/dist/runtime/fields/slug.js +3 -0
  193. package/dist/runtime/fields/string.d.ts +2 -0
  194. package/dist/runtime/fields/string.js +3 -0
  195. package/dist/runtime/fields/tab.d.ts +2 -0
  196. package/dist/runtime/fields/tab.js +3 -0
  197. package/dist/runtime/fields/textarea.d.ts +2 -0
  198. package/dist/runtime/fields/textarea.js +3 -0
  199. package/dist/runtime/fields/url.d.ts +2 -0
  200. package/dist/runtime/fields/url.js +3 -0
  201. package/dist/runtime/middleware/eponyme-auth.d.ts +2 -0
  202. package/dist/runtime/middleware/eponyme-auth.js +13 -0
  203. package/dist/runtime/middleware/eponyme-owner.d.ts +2 -0
  204. package/dist/runtime/middleware/eponyme-owner.js +7 -0
  205. package/dist/runtime/pages/EponymeChangePasswordPage.d.vue.ts +3 -0
  206. package/dist/runtime/pages/EponymeChangePasswordPage.vue +118 -0
  207. package/dist/runtime/pages/EponymeChangePasswordPage.vue.d.ts +3 -0
  208. package/dist/runtime/pages/EponymeDetailPage.d.vue.ts +3 -0
  209. package/dist/runtime/pages/EponymeDetailPage.vue +83 -0
  210. package/dist/runtime/pages/EponymeDetailPage.vue.d.ts +3 -0
  211. package/dist/runtime/pages/EponymeIndexPage.d.vue.ts +3 -0
  212. package/dist/runtime/pages/EponymeIndexPage.vue +51 -0
  213. package/dist/runtime/pages/EponymeIndexPage.vue.d.ts +3 -0
  214. package/dist/runtime/pages/EponymeLoginPage.d.vue.ts +3 -0
  215. package/dist/runtime/pages/EponymeLoginPage.vue +102 -0
  216. package/dist/runtime/pages/EponymeLoginPage.vue.d.ts +3 -0
  217. package/dist/runtime/pages/EponymeUsersPage.d.vue.ts +3 -0
  218. package/dist/runtime/pages/EponymeUsersPage.vue +261 -0
  219. package/dist/runtime/pages/EponymeUsersPage.vue.d.ts +3 -0
  220. package/dist/runtime/server/api/eponyme/[name].get.d.ts +4 -0
  221. package/dist/runtime/server/api/eponyme/[name].get.js +20 -0
  222. package/dist/runtime/server/api/eponyme/[name].patch.d.ts +11 -0
  223. package/dist/runtime/server/api/eponyme/[name].patch.js +20 -0
  224. package/dist/runtime/server/api/eponyme-auth/change-password.post.d.ts +4 -0
  225. package/dist/runtime/server/api/eponyme-auth/change-password.post.js +21 -0
  226. package/dist/runtime/server/api/eponyme-auth/login.post.d.ts +4 -0
  227. package/dist/runtime/server/api/eponyme-auth/login.post.js +12 -0
  228. package/dist/runtime/server/api/eponyme-auth/logout.post.d.ts +4 -0
  229. package/dist/runtime/server/api/eponyme-auth/logout.post.js +13 -0
  230. package/dist/runtime/server/api/eponyme-auth/session.get.d.ts +4 -0
  231. package/dist/runtime/server/api/eponyme-auth/session.get.js +5 -0
  232. package/dist/runtime/server/api/eponyme-collections/[path].delete.d.ts +4 -0
  233. package/dist/runtime/server/api/eponyme-collections/[path].delete.js +11 -0
  234. package/dist/runtime/server/api/eponyme-collections/[path].get.d.ts +4 -0
  235. package/dist/runtime/server/api/eponyme-collections/[path].get.js +11 -0
  236. package/dist/runtime/server/api/eponyme-collections/[path].post.d.ts +7 -0
  237. package/dist/runtime/server/api/eponyme-collections/[path].post.js +16 -0
  238. package/dist/runtime/server/api/eponyme-forms/[path].delete.d.ts +6 -0
  239. package/dist/runtime/server/api/eponyme-forms/[path].delete.js +19 -0
  240. package/dist/runtime/server/api/eponyme-forms/[path].get.d.ts +4 -0
  241. package/dist/runtime/server/api/eponyme-forms/[path].get.js +22 -0
  242. package/dist/runtime/server/api/eponyme-forms/[path].post.d.ts +19 -0
  243. package/dist/runtime/server/api/eponyme-forms/[path].post.js +36 -0
  244. package/dist/runtime/server/api/eponyme-history/[path].get.d.ts +4 -0
  245. package/dist/runtime/server/api/eponyme-history/[path].get.js +11 -0
  246. package/dist/runtime/server/api/eponyme-history/[path].patch.d.ts +2 -0
  247. package/dist/runtime/server/api/eponyme-history/[path].patch.js +18 -0
  248. package/dist/runtime/server/api/eponyme-sitemap.get.d.ts +4 -0
  249. package/dist/runtime/server/api/eponyme-sitemap.get.js +5 -0
  250. package/dist/runtime/server/api/eponyme-statuses.get.d.ts +4 -0
  251. package/dist/runtime/server/api/eponyme-statuses.get.js +7 -0
  252. package/dist/runtime/server/api/eponyme-users/[id]/reset-password.post.d.ts +5 -0
  253. package/dist/runtime/server/api/eponyme-users/[id]/reset-password.post.js +12 -0
  254. package/dist/runtime/server/api/eponyme-users/[id].patch.d.ts +4 -0
  255. package/dist/runtime/server/api/eponyme-users/[id].patch.js +14 -0
  256. package/dist/runtime/server/api/eponyme-users/index.get.d.ts +4 -0
  257. package/dist/runtime/server/api/eponyme-users/index.get.js +7 -0
  258. package/dist/runtime/server/api/eponyme-users/index.post.d.ts +5 -0
  259. package/dist/runtime/server/api/eponyme-users/index.post.js +13 -0
  260. package/dist/runtime/server/plugins/eponyme-sync.d.ts +2 -0
  261. package/dist/runtime/server/plugins/eponyme-sync.js +14 -0
  262. package/dist/runtime/server/services/eponyme-auth-service.d.ts +2 -0
  263. package/dist/runtime/server/services/eponyme-auth-service.js +15 -0
  264. package/dist/runtime/server/services/eponyme-auth-store.d.ts +119 -0
  265. package/dist/runtime/server/services/eponyme-auth-store.js +227 -0
  266. package/dist/runtime/server/services/eponyme-form-service.d.ts +3 -0
  267. package/dist/runtime/server/services/eponyme-form-service.js +8 -0
  268. package/dist/runtime/server/services/eponyme-form-store.d.ts +100 -0
  269. package/dist/runtime/server/services/eponyme-form-store.js +109 -0
  270. package/dist/runtime/server/services/eponyme-service.d.ts +3 -0
  271. package/dist/runtime/server/services/eponyme-service.js +8 -0
  272. package/dist/runtime/server/services/eponyme-store.d.ts +202 -0
  273. package/dist/runtime/server/services/eponyme-store.js +338 -0
  274. package/dist/runtime/server/utils/auth.d.ts +11 -0
  275. package/dist/runtime/server/utils/auth.js +41 -0
  276. package/dist/runtime/server/utils/eponyme-form.d.ts +14 -0
  277. package/dist/runtime/server/utils/eponyme-form.js +6 -0
  278. package/dist/runtime/server/utils/eponyme-sitemap.d.ts +7 -0
  279. package/dist/runtime/server/utils/eponyme-sitemap.js +7 -0
  280. package/dist/runtime/server/utils/form-route.d.ts +14 -0
  281. package/dist/runtime/server/utils/form-route.js +14 -0
  282. package/dist/runtime/server/utils/password.d.ts +4 -0
  283. package/dist/runtime/server/utils/password.js +30 -0
  284. package/dist/runtime/types/auth.d.ts +20 -0
  285. package/dist/runtime/types/auth.js +7 -0
  286. package/dist/runtime/types/eponyme-config.d.ts +11 -0
  287. package/dist/runtime/types/eponyme-navigation.d.ts +6 -0
  288. package/dist/runtime/types/eponyme-navigation.js +0 -0
  289. package/dist/runtime/types/eponyme.d.ts +87 -0
  290. package/dist/runtime/types/eponyme.js +0 -0
  291. package/dist/runtime/types/field.d.ts +203 -0
  292. package/dist/runtime/types/field.js +0 -0
  293. package/dist/runtime/types/index.d.ts +3 -0
  294. package/dist/runtime/types/index.js +3 -0
  295. package/dist/runtime/types/nuxt.d.ts +11 -0
  296. package/dist/runtime/utils/as-record.d.ts +1 -0
  297. package/dist/runtime/utils/as-record.js +3 -0
  298. package/dist/runtime/utils/build-eponyme-schema.d.ts +22 -0
  299. package/dist/runtime/utils/build-eponyme-schema.js +42 -0
  300. package/dist/runtime/utils/changed-paths.d.ts +6 -0
  301. package/dist/runtime/utils/changed-paths.js +25 -0
  302. package/dist/runtime/utils/create-default-eponyme-data.d.ts +5 -0
  303. package/dist/runtime/utils/create-default-eponyme-data.js +12 -0
  304. package/dist/runtime/utils/field-path.d.ts +14 -0
  305. package/dist/runtime/utils/field-path.js +23 -0
  306. package/dist/runtime/utils/get-eponyme-schemas.d.ts +7 -0
  307. package/dist/runtime/utils/get-eponyme-schemas.js +33 -0
  308. package/dist/runtime/utils/get-field-default-value.d.ts +4 -0
  309. package/dist/runtime/utils/get-field-default-value.js +56 -0
  310. package/dist/runtime/utils/humanize-label.d.ts +6 -0
  311. package/dist/runtime/utils/humanize-label.js +3 -0
  312. package/dist/runtime/utils/initials.d.ts +1 -0
  313. package/dist/runtime/utils/initials.js +3 -0
  314. package/dist/runtime/utils/is-field-visible.d.ts +2 -0
  315. package/dist/runtime/utils/is-field-visible.js +14 -0
  316. package/dist/runtime/utils/normalize-hex-color.d.ts +8 -0
  317. package/dist/runtime/utils/normalize-hex-color.js +11 -0
  318. package/dist/runtime/utils/normalize-slug.d.ts +1 -0
  319. package/dist/runtime/utils/normalize-slug.js +4 -0
  320. package/dist/runtime/utils/preview.d.ts +30 -0
  321. package/dist/runtime/utils/preview.js +30 -0
  322. package/dist/runtime/utils/validate-eponyme-data.d.ts +10 -0
  323. package/dist/runtime/utils/validate-eponyme-data.js +204 -0
  324. package/dist/types.d.mts +11 -0
  325. package/package.json +96 -0
@@ -0,0 +1,127 @@
1
+ <script setup>
2
+ import { computed, ref } from "vue";
3
+ import ArrayField from "./ArrayField.vue";
4
+ import FieldRenderer from "./FieldRenderer.vue";
5
+ import { isFieldVisible } from "../../utils/is-field-visible";
6
+ import { humanizeLabel } from "../../utils/humanize-label";
7
+ import { asRecord } from "../../utils/as-record";
8
+ import { childErrors, errorsAt, fieldPathId, joinFieldPath } from "../../utils/field-path";
9
+ const props = defineProps({
10
+ fieldName: { type: String, required: true },
11
+ definition: { type: Object, required: true },
12
+ modelValue: { type: null, required: true },
13
+ path: { type: String, required: false },
14
+ errors: { type: Object, required: false },
15
+ hideHeader: { type: Boolean, required: false },
16
+ disabled: { type: Boolean, required: false }
17
+ });
18
+ const emit = defineEmits(["update:modelValue"]);
19
+ const open = ref(true);
20
+ const fields = computed(() => Object.entries(props.definition.options.fields));
21
+ const basePath = computed(() => props.path || props.fieldName);
22
+ const sectionData = computed(() => asRecord(props.modelValue));
23
+ function fieldPath(name) {
24
+ return joinFieldPath(basePath.value, name);
25
+ }
26
+ function relativePath(name) {
27
+ return name;
28
+ }
29
+ function updateField(name, value) {
30
+ emit("update:modelValue", { ...sectionData.value, [name]: value });
31
+ }
32
+ function focusNextField(name) {
33
+ const index = fields.value.findIndex(([fieldName]) => fieldName === name);
34
+ const next = fields.value.slice(index + 1).find(([, definition]) => isFieldVisible(definition.options, sectionData.value));
35
+ if (next) document.getElementById(fieldPathId(fieldPath(next[0])))?.focus();
36
+ }
37
+ </script>
38
+
39
+ <template>
40
+ <section :class="hideHeader ? '' : 'ep:border-t ep:border-border-ep ep:pt-5'">
41
+ <button
42
+ v-if="!hideHeader"
43
+ type="button"
44
+ class="ep:flex ep:w-full ep:cursor-pointer ep:items-start ep:justify-between ep:gap-4 ep:border-0 ep:bg-transparent ep:p-0 ep:text-left ep:text-text-ep"
45
+ :aria-expanded="open"
46
+ :aria-controls="`${fieldPathId(basePath)}-panel`"
47
+ @click="open = !open"
48
+ >
49
+ <span class="ep:min-w-0 ep:flex-1">
50
+ <span class="ep:block ep:min-w-0 ep:max-w-full ep:text-xl ep:font-semibold ep:tracking-tight ep:text-white ep:[overflow-wrap:anywhere]">
51
+ {{ humanizeLabel(fieldName, definition.options.label) }}
52
+ </span>
53
+ <span
54
+ v-if="definition.options.description"
55
+ class="ep:mt-1 ep:block ep:text-xs ep:leading-relaxed ep:text-muted-ep"
56
+ >
57
+ {{ definition.options.description }}
58
+ </span>
59
+ </span>
60
+ <span
61
+ class="ep:mt-1 ep:shrink-0 ep:text-lg ep:text-muted-ep ep:transition-transform"
62
+ :class="{ 'ep:rotate-90': open }"
63
+ aria-hidden="true"
64
+ >
65
+ ›
66
+ </span>
67
+ </button>
68
+
69
+ <div
70
+ v-if="hideHeader || open"
71
+ :id="`${fieldPathId(basePath)}-panel`"
72
+ class="ep:grid ep:gap-5"
73
+ :class="{ 'ep:mt-6': !hideHeader }"
74
+ >
75
+ <template
76
+ v-for="([sectionFieldName, sectionField]) in fields"
77
+ :key="sectionFieldName"
78
+ >
79
+ <div v-if="isFieldVisible(sectionField.options, sectionData)">
80
+ <template v-if="sectionField.type === 'array'">
81
+ <label
82
+ :for="fieldPathId(fieldPath(sectionFieldName))"
83
+ class="ep:mb-1.5 ep:inline-block ep:w-fit ep:text-sm ep:font-medium ep:text-text-ep"
84
+ >{{ humanizeLabel(sectionFieldName, sectionField.options.label) }}<span
85
+ v-if="sectionField.options.required"
86
+ class="ep:text-danger-ep"
87
+ > *</span></label>
88
+ <p
89
+ v-if="sectionField.options.description"
90
+ class="ep:mt-0 ep:mb-2 ep:text-xs ep:leading-relaxed ep:text-muted-ep"
91
+ >
92
+ {{ sectionField.options.description }}
93
+ </p>
94
+ <ArrayField
95
+ :field-name="sectionFieldName"
96
+ :path="fieldPath(sectionFieldName)"
97
+ :definition="sectionField"
98
+ :model-value="sectionData[sectionFieldName]"
99
+ :errors="childErrors(errors, relativePath(sectionFieldName))"
100
+ :disabled="disabled"
101
+ @update:model-value="updateField(sectionFieldName, $event)"
102
+ />
103
+ <p
104
+ v-for="error in errorsAt(errors, relativePath(sectionFieldName))"
105
+ :key="error"
106
+ role="alert"
107
+ class="ep:mt-1.5 ep:text-xs ep:text-danger-ep"
108
+ >
109
+ {{ error }}
110
+ </p>
111
+ </template>
112
+ <FieldRenderer
113
+ v-else
114
+ :field-name="sectionFieldName"
115
+ :path="fieldPath(sectionFieldName)"
116
+ :field="sectionField"
117
+ :model-value="sectionData[sectionFieldName]"
118
+ :errors="errorsAt(errors, relativePath(sectionFieldName))"
119
+ :disabled="disabled"
120
+ @update:model-value="updateField(sectionFieldName, $event)"
121
+ @enter="focusNextField(sectionFieldName)"
122
+ />
123
+ </div>
124
+ </template>
125
+ </div>
126
+ </section>
127
+ </template>
@@ -0,0 +1,20 @@
1
+ import type { SectionFieldDefinition } from '../../types/index.js';
2
+ import type { ValidationErrors } from '../../utils/validate-eponyme-data.js';
3
+ type __VLS_Props = {
4
+ fieldName: string;
5
+ definition: SectionFieldDefinition;
6
+ modelValue: unknown;
7
+ /** Dotted path of this section; children extend it. */
8
+ path?: string;
9
+ /** Errors of this subtree, keyed relative to this section. */
10
+ errors?: ValidationErrors;
11
+ hideHeader?: boolean;
12
+ disabled?: boolean;
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ "update:modelValue": (value: Record<string, unknown>) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
+ "onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
@@ -0,0 +1,21 @@
1
+ type __VLS_Props = {
2
+ id: string;
3
+ modelValue?: unknown;
4
+ label: string;
5
+ description?: string;
6
+ required?: boolean;
7
+ placeholder?: string;
8
+ options: ReadonlyArray<{
9
+ label: string;
10
+ value: string;
11
+ }>;
12
+ errors?: string[];
13
+ disabled?: boolean;
14
+ };
15
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ "update:modelValue": (value: string) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
@@ -0,0 +1,42 @@
1
+ <script setup>
2
+ import EPFormField from "../ui/EPFormField.vue";
3
+ import EPSelect from "../ui/EPSelect.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
+ placeholder: { type: String, required: false },
11
+ options: { type: Array, required: true },
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
+ <ClientOnly>
27
+ <EPSelect
28
+ :id="id"
29
+ :model-value="typeof modelValue === 'string' ? modelValue : ''"
30
+ :options="options"
31
+ :placeholder="placeholder"
32
+ :required="required"
33
+ :invalid="Boolean(errors.length)"
34
+ :disabled="disabled"
35
+ @update:model-value="emit('update:modelValue', $event)"
36
+ />
37
+ <template #fallback>
38
+ <div class="ep:h-12 ep:w-full ep:rounded-xl ep:border ep:border-border-ep ep:bg-selected-ep" />
39
+ </template>
40
+ </ClientOnly>
41
+ </EPFormField>
42
+ </template>
@@ -0,0 +1,21 @@
1
+ type __VLS_Props = {
2
+ id: string;
3
+ modelValue?: unknown;
4
+ label: string;
5
+ description?: string;
6
+ required?: boolean;
7
+ placeholder?: string;
8
+ options: ReadonlyArray<{
9
+ label: string;
10
+ value: string;
11
+ }>;
12
+ errors?: string[];
13
+ disabled?: boolean;
14
+ };
15
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ "update:modelValue": (value: string) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: typeof __VLS_export;
21
+ 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
+ placeholder?: string;
8
+ minLength?: number;
9
+ maxLength?: number;
10
+ showCounter?: boolean;
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,35 @@
1
+ <script setup>
2
+ import TextField from "./TextField.vue";
3
+ import { normalizeSlug } from "../../utils/normalize-slug";
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
+ placeholder: { type: String, required: false },
11
+ minLength: { type: Number, required: false },
12
+ maxLength: { type: Number, required: false },
13
+ showCounter: { type: Boolean, required: false },
14
+ errors: { type: Array, required: false, default: () => [] },
15
+ disabled: { type: Boolean, required: false }
16
+ });
17
+ const emit = defineEmits(["update:modelValue"]);
18
+ </script>
19
+
20
+ <template>
21
+ <TextField
22
+ :id="id"
23
+ :model-value="modelValue"
24
+ :label="label"
25
+ :description="description"
26
+ :required="required"
27
+ :placeholder="placeholder"
28
+ :min-length="minLength"
29
+ :max-length="maxLength"
30
+ :show-counter="showCounter"
31
+ :errors="errors"
32
+ :disabled="disabled"
33
+ @update:model-value="emit('update:modelValue', normalizeSlug(String($event)))"
34
+ />
35
+ </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
+ placeholder?: string;
8
+ minLength?: number;
9
+ maxLength?: number;
10
+ showCounter?: boolean;
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 { TabFieldDefinition } from '../../types/index.js';
2
+ import type { ValidationErrors } from '../../utils/validate-eponyme-data.js';
3
+ type __VLS_Props = {
4
+ fieldName: string;
5
+ definition: TabFieldDefinition;
6
+ modelValue: unknown;
7
+ /** Dotted path of this group; tabs extend it with their name. */
8
+ path?: string;
9
+ /** Errors of this subtree, keyed relative to this group (`seo.title`). */
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: Record<string, unknown>) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ "onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
@@ -0,0 +1,109 @@
1
+ <script setup>
2
+ import { computed, ref, watch } from "vue";
3
+ import SectionField from "./SectionField.vue";
4
+ import { humanizeLabel } from "../../utils/humanize-label";
5
+ import { asRecord } from "../../utils/as-record";
6
+ import { childErrors, hasErrorsUnder, joinFieldPath } from "../../utils/field-path";
7
+ const props = defineProps({
8
+ fieldName: { type: String, required: true },
9
+ definition: { type: Object, required: true },
10
+ modelValue: { type: null, required: true },
11
+ path: { type: String, required: false },
12
+ errors: { type: Object, required: false },
13
+ disabled: { type: Boolean, required: false }
14
+ });
15
+ const emit = defineEmits(["update:modelValue"]);
16
+ const tabs = computed(() => Object.entries(props.definition.options.tabs));
17
+ const activeTab = ref(tabs.value[0]?.[0] ?? "");
18
+ const basePath = computed(() => props.path || props.fieldName);
19
+ const tabsData = computed(() => asRecord(props.modelValue));
20
+ watch(tabs, (value) => {
21
+ if (!value.some(([name]) => name === activeTab.value)) activeTab.value = value[0]?.[0] ?? "";
22
+ });
23
+ function updateTab(name, value) {
24
+ emit("update:modelValue", { ...tabsData.value, [name]: value });
25
+ }
26
+ function sectionDefinition(name) {
27
+ return {
28
+ type: "section",
29
+ options: { fields: props.definition.options.tabs[name]?.fields ?? {} }
30
+ };
31
+ }
32
+ function tabHasErrors(name) {
33
+ return hasErrorsUnder(props.errors, name);
34
+ }
35
+ function focusTab(offset) {
36
+ const index = tabs.value.findIndex(([name]) => name === activeTab.value);
37
+ const next = tabs.value[(index + offset + tabs.value.length) % tabs.value.length];
38
+ if (!next) return;
39
+ activeTab.value = next[0];
40
+ document.getElementById(`tab-${basePath.value}-${next[0]}`)?.focus();
41
+ }
42
+ </script>
43
+
44
+ <template>
45
+ <section class="ep:border-t ep:border-border-ep ep:pt-5">
46
+ <header class="ep:mb-5">
47
+ <h2 class="ep:m-0 ep:min-w-0 ep:max-w-full ep:text-xl ep:font-semibold ep:tracking-tight ep:text-white ep:[overflow-wrap:anywhere]">
48
+ {{ humanizeLabel(fieldName, definition.options.label) }}
49
+ </h2>
50
+ <p
51
+ v-if="definition.options.description"
52
+ class="ep:mt-1 ep:mb-0 ep:text-xs ep:leading-relaxed ep:text-muted-ep"
53
+ >
54
+ {{ definition.options.description }}
55
+ </p>
56
+ </header>
57
+
58
+ <div
59
+ role="tablist"
60
+ :aria-label="humanizeLabel(fieldName, definition.options.label)"
61
+ class="ep:mb-6 ep:flex ep:flex-wrap ep:gap-1 ep:border-b ep:border-border-ep"
62
+ @keydown.right.prevent="focusTab(1)"
63
+ @keydown.left.prevent="focusTab(-1)"
64
+ >
65
+ <button
66
+ v-for="([tabName, tabDefinition]) in tabs"
67
+ :id="`tab-${basePath}-${tabName}`"
68
+ :key="tabName"
69
+ type="button"
70
+ role="tab"
71
+ :aria-selected="activeTab === tabName"
72
+ :aria-controls="`panel-${basePath}-${tabName}`"
73
+ :tabindex="activeTab === tabName ? 0 : -1"
74
+ class="ep:-mb-px ep:min-w-0 ep:max-w-full ep:cursor-pointer ep:border-0 ep:border-b-2 ep:bg-transparent ep:px-4 ep:py-2.5 ep:text-left ep:text-sm ep:font-medium ep:transition ep:[overflow-wrap:anywhere]"
75
+ :class="activeTab === tabName ? 'ep:border-white ep:text-white' : 'ep:border-transparent ep:text-muted-ep ep:hover:text-text-ep'"
76
+ @click="activeTab = tabName"
77
+ >
78
+ {{ humanizeLabel(tabName, tabDefinition.label) }}<span
79
+ v-if="tabHasErrors(tabName)"
80
+ class="ep:ml-1 ep:text-danger-ep"
81
+ :aria-label="`${humanizeLabel(tabName, tabDefinition.label)} has errors`"
82
+ >•</span>
83
+ </button>
84
+ </div>
85
+
86
+ <template
87
+ v-for="([tabName]) in tabs"
88
+ :key="tabName"
89
+ >
90
+ <div
91
+ v-if="activeTab === tabName"
92
+ :id="`panel-${basePath}-${tabName}`"
93
+ role="tabpanel"
94
+ :aria-labelledby="`tab-${basePath}-${tabName}`"
95
+ >
96
+ <SectionField
97
+ hide-header
98
+ :field-name="tabName"
99
+ :path="joinFieldPath(basePath, tabName)"
100
+ :definition="sectionDefinition(tabName)"
101
+ :model-value="tabsData[tabName]"
102
+ :errors="childErrors(errors, tabName)"
103
+ :disabled="disabled"
104
+ @update:model-value="updateTab(tabName, $event)"
105
+ />
106
+ </div>
107
+ </template>
108
+ </section>
109
+ </template>
@@ -0,0 +1,19 @@
1
+ import type { TabFieldDefinition } from '../../types/index.js';
2
+ import type { ValidationErrors } from '../../utils/validate-eponyme-data.js';
3
+ type __VLS_Props = {
4
+ fieldName: string;
5
+ definition: TabFieldDefinition;
6
+ modelValue: unknown;
7
+ /** Dotted path of this group; tabs extend it with their name. */
8
+ path?: string;
9
+ /** Errors of this subtree, keyed relative to this group (`seo.title`). */
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: Record<string, unknown>) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ "onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
@@ -0,0 +1,22 @@
1
+ type __VLS_Props = {
2
+ id: string;
3
+ modelValue?: unknown;
4
+ label: string;
5
+ description?: string;
6
+ required?: boolean;
7
+ placeholder?: string;
8
+ minLength?: number;
9
+ maxLength?: number;
10
+ showCounter?: boolean;
11
+ inputType?: 'text' | 'email' | 'url';
12
+ errors?: string[];
13
+ preview?: boolean;
14
+ disabled?: boolean;
15
+ };
16
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ "update:modelValue": (value: string | number) => any;
18
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
19
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const _default: typeof __VLS_export;
22
+ export default _default;
@@ -0,0 +1,56 @@
1
+ <script setup>
2
+ import EPFormField from "../ui/EPFormField.vue";
3
+ import EPInputText from "../ui/EPInputText.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
+ placeholder: { type: String, required: false },
11
+ minLength: { type: Number, required: false },
12
+ maxLength: { type: Number, required: false },
13
+ showCounter: { type: Boolean, required: false },
14
+ inputType: { type: String, required: false, default: "text" },
15
+ errors: { type: Array, required: false, default: () => [] },
16
+ preview: { type: Boolean, required: false },
17
+ disabled: { type: Boolean, required: false }
18
+ });
19
+ const emit = defineEmits(["update:modelValue"]);
20
+ const value = () => typeof props.modelValue === "string" ? props.modelValue : "";
21
+ </script>
22
+
23
+ <template>
24
+ <EPFormField
25
+ :id="id"
26
+ :label="label"
27
+ :description="description"
28
+ :required="required"
29
+ :errors="errors"
30
+ >
31
+ <EPInputText
32
+ :id="id"
33
+ :model-value="value()"
34
+ :type="inputType"
35
+ :placeholder="placeholder"
36
+ :minlength="minLength"
37
+ :maxlength="maxLength"
38
+ :required="required"
39
+ :invalid="Boolean(errors.length)"
40
+ :disabled="disabled"
41
+ @update:model-value="emit('update:modelValue', $event)"
42
+ />
43
+ <p
44
+ v-if="maxLength !== void 0 && showCounter !== false"
45
+ class="ep:mt-1.5 ep:mb-0 ep:text-right ep:text-[11px] ep:text-muted-ep"
46
+ >
47
+ {{ value().length }} / {{ maxLength }}
48
+ </p>
49
+ <img
50
+ v-if="preview && value()"
51
+ :src="value()"
52
+ :alt="label"
53
+ class="ep:mt-3 ep:block ep:max-h-64 ep:max-w-full ep:rounded-xl ep:border ep:border-border-ep ep:object-contain"
54
+ >
55
+ </EPFormField>
56
+ </template>
@@ -0,0 +1,22 @@
1
+ type __VLS_Props = {
2
+ id: string;
3
+ modelValue?: unknown;
4
+ label: string;
5
+ description?: string;
6
+ required?: boolean;
7
+ placeholder?: string;
8
+ minLength?: number;
9
+ maxLength?: number;
10
+ showCounter?: boolean;
11
+ inputType?: 'text' | 'email' | 'url';
12
+ errors?: string[];
13
+ preview?: boolean;
14
+ disabled?: boolean;
15
+ };
16
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ "update:modelValue": (value: string | number) => any;
18
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
19
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const _default: typeof __VLS_export;
22
+ 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
+ placeholder?: string;
8
+ minLength?: number;
9
+ maxLength?: number;
10
+ showCounter?: boolean;
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,47 @@
1
+ <script setup>
2
+ import EPFormField from "../ui/EPFormField.vue";
3
+ import EPTextarea from "../ui/EPTextarea.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
+ placeholder: { type: String, required: false },
11
+ minLength: { type: Number, required: false },
12
+ maxLength: { type: Number, required: false },
13
+ showCounter: { type: Boolean, required: false },
14
+ errors: { type: Array, required: false, default: () => [] },
15
+ disabled: { type: Boolean, required: false }
16
+ });
17
+ const emit = defineEmits(["update:modelValue"]);
18
+ const value = () => typeof props.modelValue === "string" ? props.modelValue : "";
19
+ </script>
20
+
21
+ <template>
22
+ <EPFormField
23
+ :id="id"
24
+ :label="label"
25
+ :description="description"
26
+ :required="required"
27
+ :errors="errors"
28
+ >
29
+ <EPTextarea
30
+ :id="id"
31
+ :model-value="value()"
32
+ :placeholder="placeholder"
33
+ :minlength="minLength"
34
+ :maxlength="maxLength"
35
+ :required="required"
36
+ :disabled="disabled"
37
+ :invalid="Boolean(errors.length)"
38
+ @update:model-value="emit('update:modelValue', $event)"
39
+ />
40
+ <p
41
+ v-if="maxLength !== void 0 && showCounter !== false"
42
+ class="ep:mt-1.5 ep:mb-0 ep:text-right ep:text-[11px] ep:text-muted-ep"
43
+ >
44
+ {{ value().length }} / {{ maxLength }}
45
+ </p>
46
+ </EPFormField>
47
+ </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
+ placeholder?: string;
8
+ minLength?: number;
9
+ maxLength?: number;
10
+ showCounter?: boolean;
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;