nextjs-cms 0.0.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +289 -0
  3. package/dist/api/axios/axiosInstance.d.ts +2 -0
  4. package/dist/api/axios/axiosInstance.d.ts.map +1 -0
  5. package/dist/api/axios/axiosInstance.js +8 -0
  6. package/dist/api/index.d.ts +856 -0
  7. package/dist/api/index.d.ts.map +1 -0
  8. package/dist/api/index.js +12 -0
  9. package/dist/api/lib/serverActions.d.ts +240 -0
  10. package/dist/api/lib/serverActions.d.ts.map +1 -0
  11. package/dist/api/lib/serverActions.js +834 -0
  12. package/dist/api/root.d.ts +829 -0
  13. package/dist/api/root.d.ts.map +1 -0
  14. package/dist/api/root.js +30 -0
  15. package/dist/api/routers/accountSettings.d.ts +61 -0
  16. package/dist/api/routers/accountSettings.d.ts.map +1 -0
  17. package/dist/api/routers/accountSettings.js +108 -0
  18. package/dist/api/routers/admins.d.ts +106 -0
  19. package/dist/api/routers/admins.d.ts.map +1 -0
  20. package/dist/api/routers/admins.js +219 -0
  21. package/dist/api/routers/auth.d.ts +48 -0
  22. package/dist/api/routers/auth.d.ts.map +1 -0
  23. package/dist/api/routers/auth.js +25 -0
  24. package/dist/api/routers/categorySection.d.ts +104 -0
  25. package/dist/api/routers/categorySection.d.ts.map +1 -0
  26. package/dist/api/routers/categorySection.js +38 -0
  27. package/dist/api/routers/cmsSettings.d.ts +49 -0
  28. package/dist/api/routers/cmsSettings.d.ts.map +1 -0
  29. package/dist/api/routers/cmsSettings.js +51 -0
  30. package/dist/api/routers/cpanel.d.ts +84 -0
  31. package/dist/api/routers/cpanel.d.ts.map +1 -0
  32. package/dist/api/routers/cpanel.js +216 -0
  33. package/dist/api/routers/files.d.ts +48 -0
  34. package/dist/api/routers/files.d.ts.map +1 -0
  35. package/dist/api/routers/files.js +23 -0
  36. package/dist/api/routers/gallery.d.ts +36 -0
  37. package/dist/api/routers/gallery.d.ts.map +1 -0
  38. package/dist/api/routers/gallery.js +62 -0
  39. package/dist/api/routers/googleAnalytics.d.ts +31 -0
  40. package/dist/api/routers/googleAnalytics.d.ts.map +1 -0
  41. package/dist/api/routers/googleAnalytics.js +7 -0
  42. package/dist/api/routers/hasItemsSection.d.ts +140 -0
  43. package/dist/api/routers/hasItemsSection.d.ts.map +1 -0
  44. package/dist/api/routers/hasItemsSection.js +34 -0
  45. package/dist/api/routers/navigation.d.ts +52 -0
  46. package/dist/api/routers/navigation.d.ts.map +1 -0
  47. package/dist/api/routers/navigation.js +11 -0
  48. package/dist/api/routers/simpleSection.d.ts +58 -0
  49. package/dist/api/routers/simpleSection.d.ts.map +1 -0
  50. package/dist/api/routers/simpleSection.js +12 -0
  51. package/dist/api/trpc.d.ts +107 -0
  52. package/dist/api/trpc.d.ts.map +1 -0
  53. package/dist/api/trpc.js +72 -0
  54. package/dist/auth/axios/axiosInstance.d.ts +2 -0
  55. package/dist/auth/axios/axiosInstance.d.ts.map +1 -0
  56. package/dist/auth/axios/axiosInstance.js +8 -0
  57. package/dist/auth/csrf.d.ts +30 -0
  58. package/dist/auth/csrf.d.ts.map +1 -0
  59. package/dist/auth/csrf.js +76 -0
  60. package/dist/auth/hooks/index.d.ts +4 -0
  61. package/dist/auth/hooks/index.d.ts.map +1 -0
  62. package/dist/auth/hooks/index.js +3 -0
  63. package/dist/auth/hooks/useAxiosPrivate.d.ts +5 -0
  64. package/dist/auth/hooks/useAxiosPrivate.d.ts.map +1 -0
  65. package/dist/auth/hooks/useAxiosPrivate.js +74 -0
  66. package/dist/auth/hooks/useRefreshToken.d.ts +7 -0
  67. package/dist/auth/hooks/useRefreshToken.d.ts.map +1 -0
  68. package/dist/auth/hooks/useRefreshToken.js +79 -0
  69. package/dist/auth/index.d.ts +23 -0
  70. package/dist/auth/index.d.ts.map +1 -0
  71. package/dist/auth/index.js +44 -0
  72. package/dist/auth/jwt.d.ts +6 -0
  73. package/dist/auth/jwt.d.ts.map +1 -0
  74. package/dist/auth/jwt.js +25 -0
  75. package/dist/auth/lib/actions.d.ts +33 -0
  76. package/dist/auth/lib/actions.d.ts.map +1 -0
  77. package/dist/auth/lib/actions.js +209 -0
  78. package/dist/auth/lib/client.d.ts +4 -0
  79. package/dist/auth/lib/client.d.ts.map +1 -0
  80. package/dist/auth/lib/client.js +46 -0
  81. package/dist/auth/lib/index.d.ts +3 -0
  82. package/dist/auth/lib/index.d.ts.map +1 -0
  83. package/dist/auth/lib/index.js +2 -0
  84. package/dist/auth/react.d.ts +106 -0
  85. package/dist/auth/react.d.ts.map +1 -0
  86. package/dist/auth/react.js +347 -0
  87. package/dist/auth/trpc.d.ts +6 -0
  88. package/dist/auth/trpc.d.ts.map +1 -0
  89. package/dist/auth/trpc.js +81 -0
  90. package/dist/core/config/config-loader.d.ts +92 -0
  91. package/dist/core/config/config-loader.d.ts.map +1 -0
  92. package/dist/core/config/config-loader.js +230 -0
  93. package/dist/core/config/index.d.ts +3 -0
  94. package/dist/core/config/index.d.ts.map +1 -0
  95. package/dist/core/config/index.js +1 -0
  96. package/dist/core/config/loader.d.ts +2 -0
  97. package/dist/core/config/loader.d.ts.map +1 -0
  98. package/dist/core/config/loader.js +42 -0
  99. package/dist/core/db/index.d.ts +2 -0
  100. package/dist/core/db/index.d.ts.map +1 -0
  101. package/dist/core/db/index.js +1 -0
  102. package/dist/core/db/table-checker/DbTable.d.ts +6 -0
  103. package/dist/core/db/table-checker/DbTable.d.ts.map +1 -0
  104. package/dist/core/db/table-checker/DbTable.js +5 -0
  105. package/dist/core/db/table-checker/MysqlTable.d.ts +34 -0
  106. package/dist/core/db/table-checker/MysqlTable.d.ts.map +1 -0
  107. package/dist/core/db/table-checker/MysqlTable.js +102 -0
  108. package/dist/core/db/table-checker/index.d.ts +2 -0
  109. package/dist/core/db/table-checker/index.d.ts.map +1 -0
  110. package/dist/core/db/table-checker/index.js +1 -0
  111. package/dist/core/factories/FieldFactory.d.ts +124 -0
  112. package/dist/core/factories/FieldFactory.d.ts.map +1 -0
  113. package/dist/core/factories/FieldFactory.js +411 -0
  114. package/dist/core/factories/SectionFactory.d.ts +110 -0
  115. package/dist/core/factories/SectionFactory.d.ts.map +1 -0
  116. package/dist/core/factories/SectionFactory.js +415 -0
  117. package/dist/core/factories/index.d.ts +3 -0
  118. package/dist/core/factories/index.d.ts.map +1 -0
  119. package/dist/core/factories/index.js +2 -0
  120. package/dist/core/fields/checkbox.d.ts +63 -0
  121. package/dist/core/fields/checkbox.d.ts.map +1 -0
  122. package/dist/core/fields/checkbox.js +62 -0
  123. package/dist/core/fields/color.d.ts +84 -0
  124. package/dist/core/fields/color.d.ts.map +1 -0
  125. package/dist/core/fields/color.js +91 -0
  126. package/dist/core/fields/date.d.ts +100 -0
  127. package/dist/core/fields/date.d.ts.map +1 -0
  128. package/dist/core/fields/date.js +108 -0
  129. package/dist/core/fields/document.d.ts +180 -0
  130. package/dist/core/fields/document.d.ts.map +1 -0
  131. package/dist/core/fields/document.js +277 -0
  132. package/dist/core/fields/field-group.d.ts +18 -0
  133. package/dist/core/fields/field-group.d.ts.map +1 -0
  134. package/dist/core/fields/field-group.js +6 -0
  135. package/dist/core/fields/field.d.ts +126 -0
  136. package/dist/core/fields/field.d.ts.map +1 -0
  137. package/dist/core/fields/field.js +148 -0
  138. package/dist/core/fields/fileField.d.ts +15 -0
  139. package/dist/core/fields/fileField.d.ts.map +1 -0
  140. package/dist/core/fields/fileField.js +5 -0
  141. package/dist/core/fields/index.d.ts +65 -0
  142. package/dist/core/fields/index.d.ts.map +1 -0
  143. package/dist/core/fields/index.js +18 -0
  144. package/dist/core/fields/map.d.ts +167 -0
  145. package/dist/core/fields/map.d.ts.map +1 -0
  146. package/dist/core/fields/map.js +152 -0
  147. package/dist/core/fields/number.d.ts +186 -0
  148. package/dist/core/fields/number.d.ts.map +1 -0
  149. package/dist/core/fields/number.js +241 -0
  150. package/dist/core/fields/password.d.ts +109 -0
  151. package/dist/core/fields/password.d.ts.map +1 -0
  152. package/dist/core/fields/password.js +133 -0
  153. package/dist/core/fields/photo.d.ts +289 -0
  154. package/dist/core/fields/photo.d.ts.map +1 -0
  155. package/dist/core/fields/photo.js +410 -0
  156. package/dist/core/fields/richText.d.ts +295 -0
  157. package/dist/core/fields/richText.d.ts.map +1 -0
  158. package/dist/core/fields/richText.js +338 -0
  159. package/dist/core/fields/select.d.ts +366 -0
  160. package/dist/core/fields/select.d.ts.map +1 -0
  161. package/dist/core/fields/select.js +499 -0
  162. package/dist/core/fields/selectMultiple.d.ts +236 -0
  163. package/dist/core/fields/selectMultiple.d.ts.map +1 -0
  164. package/dist/core/fields/selectMultiple.js +417 -0
  165. package/dist/core/fields/tags.d.ts +131 -0
  166. package/dist/core/fields/tags.d.ts.map +1 -0
  167. package/dist/core/fields/tags.js +105 -0
  168. package/dist/core/fields/text.d.ts +136 -0
  169. package/dist/core/fields/text.d.ts.map +1 -0
  170. package/dist/core/fields/text.js +157 -0
  171. package/dist/core/fields/textArea.d.ts +107 -0
  172. package/dist/core/fields/textArea.d.ts.map +1 -0
  173. package/dist/core/fields/textArea.js +126 -0
  174. package/dist/core/fields/video.d.ts +148 -0
  175. package/dist/core/fields/video.d.ts.map +1 -0
  176. package/dist/core/fields/video.js +248 -0
  177. package/dist/core/helpers/entity.d.ts +8 -0
  178. package/dist/core/helpers/entity.d.ts.map +1 -0
  179. package/dist/core/helpers/entity.js +27 -0
  180. package/dist/core/helpers/index.d.ts +5 -0
  181. package/dist/core/helpers/index.d.ts.map +1 -0
  182. package/dist/core/helpers/index.js +3 -0
  183. package/dist/core/index.d.ts +8 -0
  184. package/dist/core/index.d.ts.map +1 -0
  185. package/dist/core/index.js +7 -0
  186. package/dist/core/sections/category.d.ts +283 -0
  187. package/dist/core/sections/category.d.ts.map +1 -0
  188. package/dist/core/sections/category.js +147 -0
  189. package/dist/core/sections/hasItems.d.ts +632 -0
  190. package/dist/core/sections/hasItems.d.ts.map +1 -0
  191. package/dist/core/sections/hasItems.js +144 -0
  192. package/dist/core/sections/index.d.ts +5 -0
  193. package/dist/core/sections/index.d.ts.map +1 -0
  194. package/dist/core/sections/index.js +4 -0
  195. package/dist/core/sections/section.d.ts +226 -0
  196. package/dist/core/sections/section.d.ts.map +1 -0
  197. package/dist/core/sections/section.js +341 -0
  198. package/dist/core/sections/simple.d.ts +99 -0
  199. package/dist/core/sections/simple.d.ts.map +1 -0
  200. package/dist/core/sections/simple.js +95 -0
  201. package/dist/core/security/dom.d.ts +11 -0
  202. package/dist/core/security/dom.d.ts.map +1 -0
  203. package/dist/core/security/dom.js +92 -0
  204. package/dist/core/submit/ItemEditSubmit.d.ts +76 -0
  205. package/dist/core/submit/ItemEditSubmit.d.ts.map +1 -0
  206. package/dist/core/submit/ItemEditSubmit.js +186 -0
  207. package/dist/core/submit/NewItemSubmit.d.ts +14 -0
  208. package/dist/core/submit/NewItemSubmit.d.ts.map +1 -0
  209. package/dist/core/submit/NewItemSubmit.js +93 -0
  210. package/dist/core/submit/SimpleSectionSubmit.d.ts +13 -0
  211. package/dist/core/submit/SimpleSectionSubmit.d.ts.map +1 -0
  212. package/dist/core/submit/SimpleSectionSubmit.js +93 -0
  213. package/dist/core/submit/index.d.ts +5 -0
  214. package/dist/core/submit/index.d.ts.map +1 -0
  215. package/dist/core/submit/index.js +4 -0
  216. package/dist/core/submit/submit.d.ts +116 -0
  217. package/dist/core/submit/submit.d.ts.map +1 -0
  218. package/dist/core/submit/submit.js +479 -0
  219. package/dist/core/types/index.d.ts +280 -0
  220. package/dist/core/types/index.d.ts.map +1 -0
  221. package/dist/core/types/index.js +1 -0
  222. package/dist/db/client.d.ts +9 -0
  223. package/dist/db/client.d.ts.map +1 -0
  224. package/dist/db/client.js +19 -0
  225. package/dist/db/config.d.ts +6 -0
  226. package/dist/db/config.d.ts.map +1 -0
  227. package/dist/db/config.js +22 -0
  228. package/dist/db/drizzle.config.d.ts +6 -0
  229. package/dist/db/drizzle.config.d.ts.map +1 -0
  230. package/dist/db/drizzle.config.js +18 -0
  231. package/dist/db/index.d.ts +3 -0
  232. package/dist/db/index.d.ts.map +1 -0
  233. package/dist/db/index.js +3 -0
  234. package/dist/db/schema.d.ts +639 -0
  235. package/dist/db/schema.d.ts.map +1 -0
  236. package/dist/db/schema.js +73 -0
  237. package/dist/index.d.ts +7 -1
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/index.js +7 -1
  240. package/dist/translations/dictionaries/ar.json +279 -0
  241. package/dist/translations/dictionaries/en.json +279 -0
  242. package/dist/translations/index.d.ts +3 -0
  243. package/dist/translations/index.d.ts.map +1 -0
  244. package/dist/translations/index.js +15 -0
  245. package/dist/utils/CpanelApi.d.ts +25 -0
  246. package/dist/utils/CpanelApi.d.ts.map +1 -0
  247. package/dist/utils/CpanelApi.js +64 -0
  248. package/dist/utils/constants.d.ts +14 -0
  249. package/dist/utils/constants.d.ts.map +1 -0
  250. package/dist/utils/constants.js +61 -0
  251. package/dist/utils/index.d.ts +5 -0
  252. package/dist/utils/index.d.ts.map +1 -0
  253. package/dist/utils/index.js +4 -0
  254. package/dist/utils/utils.d.ts +60 -0
  255. package/dist/utils/utils.d.ts.map +1 -0
  256. package/dist/utils/utils.js +132 -0
  257. package/dist/validators/checkbox.d.ts +4 -0
  258. package/dist/validators/checkbox.d.ts.map +1 -0
  259. package/dist/validators/checkbox.js +12 -0
  260. package/dist/validators/color.d.ts +4 -0
  261. package/dist/validators/color.d.ts.map +1 -0
  262. package/dist/validators/color.js +7 -0
  263. package/dist/validators/date.d.ts +4 -0
  264. package/dist/validators/date.d.ts.map +1 -0
  265. package/dist/validators/date.js +5 -0
  266. package/dist/validators/document.d.ts +4 -0
  267. package/dist/validators/document.d.ts.map +1 -0
  268. package/dist/validators/document.js +57 -0
  269. package/dist/validators/index.d.ts +15 -0
  270. package/dist/validators/index.d.ts.map +1 -0
  271. package/dist/validators/index.js +14 -0
  272. package/dist/validators/map.d.ts +4 -0
  273. package/dist/validators/map.d.ts.map +1 -0
  274. package/dist/validators/map.js +5 -0
  275. package/dist/validators/number.d.ts +4 -0
  276. package/dist/validators/number.d.ts.map +1 -0
  277. package/dist/validators/number.js +20 -0
  278. package/dist/validators/password.d.ts +4 -0
  279. package/dist/validators/password.d.ts.map +1 -0
  280. package/dist/validators/password.js +11 -0
  281. package/dist/validators/photo.d.ts +4 -0
  282. package/dist/validators/photo.d.ts.map +1 -0
  283. package/dist/validators/photo.js +100 -0
  284. package/dist/validators/richText.d.ts +4 -0
  285. package/dist/validators/richText.d.ts.map +1 -0
  286. package/dist/validators/richText.js +8 -0
  287. package/dist/validators/select-multiple.d.ts +10 -0
  288. package/dist/validators/select-multiple.d.ts.map +1 -0
  289. package/dist/validators/select-multiple.js +20 -0
  290. package/dist/validators/select.d.ts +4 -0
  291. package/dist/validators/select.d.ts.map +1 -0
  292. package/dist/validators/select.js +5 -0
  293. package/dist/validators/text.d.ts +4 -0
  294. package/dist/validators/text.d.ts.map +1 -0
  295. package/dist/validators/text.js +7 -0
  296. package/dist/validators/textarea.d.ts +4 -0
  297. package/dist/validators/textarea.d.ts.map +1 -0
  298. package/dist/validators/textarea.js +7 -0
  299. package/dist/validators/video.d.ts +4 -0
  300. package/dist/validators/video.d.ts.map +1 -0
  301. package/dist/validators/video.js +57 -0
  302. package/package.json +150 -6
@@ -0,0 +1,131 @@
1
+ import type { BaseFieldConfig } from './field';
2
+ import { Field } from './field';
3
+ import { entityKind } from '../helpers';
4
+ import * as z from 'zod';
5
+ declare const configSchema: z.ZodObject<{
6
+ /**
7
+ * A destination table where the values will be saved
8
+ * When this is set, the value of the field will only be saved in the destination table as one row per each value
9
+ */
10
+ destinationDb: z.ZodOptional<z.ZodObject<{
11
+ table: z.ZodString;
12
+ itemIdentifier: z.ZodString;
13
+ selectIdentifier: z.ZodString;
14
+ }, z.core.$strict>>;
15
+ autoCompletion: z.ZodOptional<z.ZodObject<{
16
+ table: z.ZodString;
17
+ column: z.ZodString;
18
+ }, z.core.$strict>>;
19
+ placeholder: z.ZodOptional<z.ZodString>;
20
+ /**
21
+ * Whether to sanitize the value before saving it to the database.
22
+ * If true, the value will be escaped to prevent XSS attacks.
23
+ * If false, the value will be saved as is (raw input).
24
+ * @default false
25
+ */
26
+ sanitize: z.ZodOptional<z.ZodBoolean>;
27
+ }, z.core.$strict>;
28
+ type Config = z.infer<typeof configSchema>;
29
+ export declare class TagsField extends Field<'tags', Config> {
30
+ static readonly [entityKind]: string;
31
+ readonly destinationDb?: {
32
+ table: string;
33
+ itemIdentifier: string;
34
+ selectIdentifier: string;
35
+ };
36
+ readonly placeholder: string;
37
+ readonly sanitize: boolean;
38
+ constructor(config: BaseFieldConfig<Config>);
39
+ getValue(): any;
40
+ exportForClient(): {
41
+ placeholder: string;
42
+ sanitize: boolean;
43
+ type: "tags";
44
+ name: string;
45
+ label: string;
46
+ required: boolean;
47
+ conditionalFields: import("../types").ConditionalField[];
48
+ readonly: boolean;
49
+ defaultValue: any;
50
+ value: any;
51
+ };
52
+ checkRequired(): void;
53
+ prepareForSubmission(): Promise<void>;
54
+ }
55
+ export type TagsFieldClientConfig = ReturnType<TagsField['exportForClient']>;
56
+ declare const optionsSchema: z.ZodObject<{
57
+ /**
58
+ * A destination table where the values will be saved
59
+ * When this is set, the value of the field will only be saved in the destination table as one row per each value
60
+ */
61
+ destinationDb: z.ZodOptional<z.ZodObject<{
62
+ table: z.ZodString;
63
+ itemIdentifier: z.ZodString;
64
+ selectIdentifier: z.ZodString;
65
+ }, z.core.$strict>>;
66
+ autoCompletion: z.ZodOptional<z.ZodObject<{
67
+ table: z.ZodString;
68
+ column: z.ZodString;
69
+ }, z.core.$strict>>;
70
+ placeholder: z.ZodOptional<z.ZodString>;
71
+ /**
72
+ * Whether to sanitize the value before saving it to the database.
73
+ * If true, the value will be escaped to prevent XSS attacks.
74
+ * If false, the value will be saved as is (raw input).
75
+ * @default false
76
+ */
77
+ sanitize: z.ZodOptional<z.ZodBoolean>;
78
+ name: z.ZodString;
79
+ label: z.ZodOptional<z.ZodString>;
80
+ required: z.ZodOptional<z.ZodBoolean>;
81
+ defaultValue: z.ZodOptional<z.ZodAny>;
82
+ order: z.ZodOptional<z.ZodNumber>;
83
+ conditionalRules: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types").ConditionalRule, import("../types").ConditionalRule>>>;
84
+ adminGenerated: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodLiteral<false>, z.ZodLiteral<"readonly">]>>;
85
+ }, z.core.$strict>;
86
+ declare const tagsFieldConfigSchema: z.ZodObject<{
87
+ type: z.ZodLiteral<"tags">;
88
+ build: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodCustom<TagsField, TagsField>>;
89
+ /**
90
+ * A destination table where the values will be saved
91
+ * When this is set, the value of the field will only be saved in the destination table as one row per each value
92
+ */
93
+ destinationDb: z.ZodOptional<z.ZodObject<{
94
+ table: z.ZodString;
95
+ itemIdentifier: z.ZodString;
96
+ selectIdentifier: z.ZodString;
97
+ }, z.core.$strict>>;
98
+ autoCompletion: z.ZodOptional<z.ZodObject<{
99
+ table: z.ZodString;
100
+ column: z.ZodString;
101
+ }, z.core.$strict>>;
102
+ placeholder: z.ZodOptional<z.ZodString>;
103
+ /**
104
+ * Whether to sanitize the value before saving it to the database.
105
+ * If true, the value will be escaped to prevent XSS attacks.
106
+ * If false, the value will be saved as is (raw input).
107
+ * @default false
108
+ */
109
+ sanitize: z.ZodOptional<z.ZodBoolean>;
110
+ name: z.ZodString;
111
+ label: z.ZodOptional<z.ZodString>;
112
+ required: z.ZodOptional<z.ZodBoolean>;
113
+ defaultValue: z.ZodOptional<z.ZodAny>;
114
+ order: z.ZodOptional<z.ZodNumber>;
115
+ conditionalRules: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types").ConditionalRule, import("../types").ConditionalRule>>>;
116
+ adminGenerated: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodLiteral<false>, z.ZodLiteral<"readonly">]>>;
117
+ }, z.core.$strict>;
118
+ /**
119
+ * Tags field configuration type
120
+ * This is a plain object that can be serialized and used anywhere
121
+ * The build() method allows creating a TagsField instance when needed
122
+ */
123
+ export type TagsFieldConfig = z.infer<typeof tagsFieldConfigSchema>;
124
+ /**
125
+ * Helper function to create a tags field configuration
126
+ * Returns a config object with a build() method that can be serialized and used anywhere
127
+ * @param field
128
+ */
129
+ export declare function tagsField(field: z.infer<typeof optionsSchema>): TagsFieldConfig;
130
+ export {};
131
+ //# sourceMappingURL=tags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../../src/core/fields/tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAyB,MAAM,SAAS,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,QAAA,MAAM,YAAY;IACd;;;OAGG;;;;;;;;;;;IAiBH;;;;;OAKG;;kBAEL,CAAA;AAEF,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1C,qBAAa,SAAU,SAAQ,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC;IAChD,gBAAyB,CAAC,UAAU,CAAC,EAAE,MAAM,CAAc;IAC3D,SAAkB,aAAa,CAAC,EAAE;QAC9B,KAAK,EAAE,MAAM,CAAA;QACb,cAAc,EAAE,MAAM,CAAA;QACtB,gBAAgB,EAAE,MAAM,CAAA;KAC3B,CAAA;IACD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;gBAEd,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC;IAO3C,QAAQ;IAIQ,eAAe;;;;;;;;;;;;IAQ/B,aAAa;IAMP,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;CAa9C;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAE5E,QAAA,MAAM,aAAa;IAnFf;;;OAGG;;;;;;;;;;;IAiBH;;;;;OAKG;;;;;;;;;kBA6DL,CAAA;AAEF,QAAA,MAAM,qBAAqB;;;IAxFvB;;;OAGG;;;;;;;;;;;IAiBH;;;;;OAKG;;;;;;;;;kBAmEL,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,GAAG,eAAe,CAmB/E"}
@@ -0,0 +1,105 @@
1
+ import { Field, baseFieldConfigSchema } from './field';
2
+ import { entityKind } from '../helpers';
3
+ import * as z from 'zod';
4
+ import { escapeHTML } from '../security/dom';
5
+ const configSchema = z.strictObject({
6
+ /**
7
+ * A destination table where the values will be saved
8
+ * When this is set, the value of the field will only be saved in the destination table as one row per each value
9
+ */
10
+ destinationDb: z
11
+ .strictObject({
12
+ table: z.string().describe('The destination table name'),
13
+ itemIdentifier: z.string().describe('The identifier of the item that has this tags field as a field'),
14
+ selectIdentifier: z.string().describe('An identifier name for the value of the values in the tags field'),
15
+ })
16
+ .optional()
17
+ .describe('Destination table configuration'),
18
+ autoCompletion: z
19
+ .strictObject({
20
+ table: z.string().describe('The table where the auto completion values are stored'),
21
+ column: z.string().describe('The column where the values are stored'),
22
+ })
23
+ .optional()
24
+ .describe('Auto completion configuration'),
25
+ placeholder: z.string().optional().describe('The placeholder text for the field'),
26
+ /**
27
+ * Whether to sanitize the value before saving it to the database.
28
+ * If true, the value will be escaped to prevent XSS attacks.
29
+ * If false, the value will be saved as is (raw input).
30
+ * @default false
31
+ */
32
+ sanitize: z.boolean().optional().describe('Sanitize the value before saving'),
33
+ });
34
+ export class TagsField extends Field {
35
+ static [entityKind] = 'TagsField';
36
+ destinationDb;
37
+ placeholder;
38
+ sanitize;
39
+ constructor(config) {
40
+ super(config, 'tags');
41
+ this.destinationDb = config.destinationDb;
42
+ this.placeholder = config.placeholder || '';
43
+ this.sanitize = config.sanitize ?? false;
44
+ }
45
+ getValue() {
46
+ return this.value;
47
+ }
48
+ exportForClient() {
49
+ return {
50
+ ...super.exportForClient(),
51
+ placeholder: this.placeholder,
52
+ sanitize: this.sanitize,
53
+ };
54
+ }
55
+ checkRequired() {
56
+ if (this.required && (!this.value || this.value.length === 0)) {
57
+ throw new Error(`Field ${this.label} is required`);
58
+ }
59
+ }
60
+ async prepareForSubmission() {
61
+ if (this.value) {
62
+ if (!Array.isArray(this.value)) {
63
+ throw new Error(`Field ${this.label} must be an array of tags`);
64
+ }
65
+ if (this.value.some((tag) => typeof tag !== 'string')) {
66
+ throw new Error(`Field ${this.label} must contain only string tags`);
67
+ }
68
+ if (this.sanitize) {
69
+ this.value = this.value.map((tag) => escapeHTML(tag) || tag);
70
+ }
71
+ }
72
+ }
73
+ }
74
+ const optionsSchema = z.strictObject({
75
+ ...baseFieldConfigSchema.shape,
76
+ ...configSchema.shape,
77
+ });
78
+ const tagsFieldConfigSchema = z.strictObject({
79
+ ...optionsSchema.shape,
80
+ type: z.literal('tags').describe('The type of the field'),
81
+ build: z.function().output(z.instanceof(TagsField)).describe('Build a TagsField instance from this config'),
82
+ });
83
+ /**
84
+ * Helper function to create a tags field configuration
85
+ * Returns a config object with a build() method that can be serialized and used anywhere
86
+ * @param field
87
+ */
88
+ export function tagsField(field) {
89
+ /**
90
+ * Validate the field config
91
+ */
92
+ const result = optionsSchema.safeParse(field);
93
+ if (!result.success) {
94
+ throw new Error(`[Field: ${field.name}]: ${z.prettifyError(result.error)}`);
95
+ }
96
+ const config = {
97
+ ...field,
98
+ type: 'tags',
99
+ build() {
100
+ // Use the original field config directly (it doesn't have build() method)
101
+ return new TagsField(field);
102
+ },
103
+ };
104
+ return config;
105
+ }
@@ -0,0 +1,136 @@
1
+ import type { BaseFieldConfig } from './field';
2
+ import { Field } from './field';
3
+ import { entityKind } from '../helpers';
4
+ import * as z from 'zod';
5
+ declare const configSchema: z.ZodObject<{
6
+ placeholder: z.ZodOptional<z.ZodString>;
7
+ minLength: z.ZodOptional<z.ZodNumber>;
8
+ maxLength: z.ZodOptional<z.ZodNumber>;
9
+ /**
10
+ * The default value of the field.
11
+ * If set, the field will be pre-populated with this value when the form is loaded.
12
+ * If `adminGenerated` is not true, the field will be included when submitting the form with this value.
13
+ */
14
+ defaultValue: z.ZodOptional<z.ZodString>;
15
+ /**
16
+ * Whether to sanitize the value before saving it to the database.
17
+ * If true, the value will be escaped to prevent XSS attacks.
18
+ * If false, the value will be saved as is (raw input).
19
+ * @default false
20
+ */
21
+ sanitize: z.ZodOptional<z.ZodBoolean>;
22
+ }, z.core.$strict>;
23
+ type Config = z.infer<typeof configSchema>;
24
+ export declare class TextField extends Field<'text', Config> {
25
+ static readonly [entityKind]: string;
26
+ readonly maxLength: number | undefined;
27
+ readonly minLength: number | undefined;
28
+ readonly placeholder: string | undefined;
29
+ private readonly _defaultValue;
30
+ value: string | undefined;
31
+ readonly sanitize: boolean;
32
+ constructor(config: BaseFieldConfig<Config>);
33
+ /**
34
+ * Sanitize the value
35
+ */
36
+ private sanitizeValue;
37
+ exportForClient(): {
38
+ maxLength: number | undefined;
39
+ minLength: number | undefined;
40
+ placeholder: string | undefined;
41
+ sanitize: boolean;
42
+ type: "text";
43
+ name: string;
44
+ label: string;
45
+ required: boolean;
46
+ conditionalFields: import("../types").ConditionalField[];
47
+ readonly: boolean;
48
+ defaultValue: any;
49
+ value: any;
50
+ };
51
+ /**
52
+ * Get the value of the field
53
+ */
54
+ getValue(): string | undefined;
55
+ checkRequired(): void;
56
+ hasSqlNameAndValue(): boolean;
57
+ /**
58
+ * Prepare the field for submission
59
+ */
60
+ prepareForSubmission(): Promise<void>;
61
+ }
62
+ export type TextFieldClientConfig = ReturnType<TextField['exportForClient']>;
63
+ declare const optionsSchema: z.ZodObject<{
64
+ placeholder: z.ZodOptional<z.ZodString>;
65
+ minLength: z.ZodOptional<z.ZodNumber>;
66
+ maxLength: z.ZodOptional<z.ZodNumber>;
67
+ /**
68
+ * The default value of the field.
69
+ * If set, the field will be pre-populated with this value when the form is loaded.
70
+ * If `adminGenerated` is not true, the field will be included when submitting the form with this value.
71
+ */
72
+ defaultValue: z.ZodOptional<z.ZodString>;
73
+ /**
74
+ * Whether to sanitize the value before saving it to the database.
75
+ * If true, the value will be escaped to prevent XSS attacks.
76
+ * If false, the value will be saved as is (raw input).
77
+ * @default false
78
+ */
79
+ sanitize: z.ZodOptional<z.ZodBoolean>;
80
+ name: z.ZodString;
81
+ label: z.ZodOptional<z.ZodString>;
82
+ required: z.ZodOptional<z.ZodBoolean>;
83
+ order: z.ZodOptional<z.ZodNumber>;
84
+ conditionalRules: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types").ConditionalRule, import("../types").ConditionalRule>>>;
85
+ adminGenerated: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodLiteral<false>, z.ZodLiteral<"readonly">]>>;
86
+ }, z.core.$strict>;
87
+ declare const textFieldConfigSchema: z.ZodObject<{
88
+ type: z.ZodLiteral<"text">;
89
+ build: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodCustom<TextField, TextField>>;
90
+ placeholder: z.ZodOptional<z.ZodString>;
91
+ minLength: z.ZodOptional<z.ZodNumber>;
92
+ maxLength: z.ZodOptional<z.ZodNumber>;
93
+ /**
94
+ * The default value of the field.
95
+ * If set, the field will be pre-populated with this value when the form is loaded.
96
+ * If `adminGenerated` is not true, the field will be included when submitting the form with this value.
97
+ */
98
+ defaultValue: z.ZodOptional<z.ZodString>;
99
+ /**
100
+ * Whether to sanitize the value before saving it to the database.
101
+ * If true, the value will be escaped to prevent XSS attacks.
102
+ * If false, the value will be saved as is (raw input).
103
+ * @default false
104
+ */
105
+ sanitize: z.ZodOptional<z.ZodBoolean>;
106
+ name: z.ZodString;
107
+ label: z.ZodOptional<z.ZodString>;
108
+ required: z.ZodOptional<z.ZodBoolean>;
109
+ order: z.ZodOptional<z.ZodNumber>;
110
+ conditionalRules: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types").ConditionalRule, import("../types").ConditionalRule>>>;
111
+ adminGenerated: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodLiteral<false>, z.ZodLiteral<"readonly">]>>;
112
+ }, z.core.$strict>;
113
+ /**
114
+ * Text field configuration type
115
+ * This is a plain object that can be serialized and used anywhere
116
+ * The build() method allows creating a TextField instance when needed
117
+ */
118
+ export type TextFieldConfig = z.infer<typeof textFieldConfigSchema>;
119
+ /**
120
+ * Helper function to create a text field configuration
121
+ * Returns a config object with a build() method that can be serialized and used anywhere
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * const fieldConfig = textField({ name: 'title', label: 'Title', required: true, order: 1 })
126
+ * // Use as config (serializable)
127
+ * const config = JSON.stringify(fieldConfig) // methods are ignored during serialization
128
+ * // Build instance when needed
129
+ * const fieldInstance = fieldConfig.build()
130
+ * ```
131
+ *
132
+ * @param field
133
+ */
134
+ export declare function textField(field: z.infer<typeof optionsSchema>): TextFieldConfig;
135
+ export {};
136
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/core/fields/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAyB,MAAM,SAAS,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,QAAA,MAAM,YAAY;;;;IAId;;;;OAIG;;IAEH;;;;;OAKG;;kBAEL,CAAA;AAEF,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1C,qBAAa,SAAU,SAAQ,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC;IAChD,gBAAyB,CAAC,UAAU,CAAC,EAAE,MAAM,CAAc;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IACzC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;gBAEd,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC;IAU3C;;OAEG;IACH,OAAO,CAAC,aAAa;IAgBL,eAAe;;;;;;;;;;;;;;IAU/B;;OAEG;IACH,QAAQ,IAAI,MAAM,GAAG,SAAS;IAI9B,aAAa;IAWJ,kBAAkB,IAAI,OAAO;IAOtC;;OAEG;IACG,oBAAoB;CAyB7B;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAE5E,QAAA,MAAM,aAAa;;;;IA1Hf;;;;OAIG;;IAEH;;;;;OAKG;;;;;;;;kBAkHL,CAAA;AAEF,QAAA,MAAM,qBAAqB;;;;;;IA/HvB;;;;OAIG;;IAEH;;;;;OAKG;;;;;;;;kBAwHL,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,GAAG,eAAe,CAmB/E"}
@@ -0,0 +1,157 @@
1
+ import { Field, baseFieldConfigSchema } from './field';
2
+ import { entityKind } from '../helpers';
3
+ import * as z from 'zod';
4
+ import { escapeHTML } from '../security/dom';
5
+ const configSchema = z.strictObject({
6
+ placeholder: z.string().optional().describe('The placeholder text for the field'),
7
+ minLength: z.number().optional().describe('The minimum length of the field value'),
8
+ maxLength: z.number().optional().describe('The maximum length of the field value'),
9
+ /**
10
+ * The default value of the field.
11
+ * If set, the field will be pre-populated with this value when the form is loaded.
12
+ * If `adminGenerated` is not true, the field will be included when submitting the form with this value.
13
+ */
14
+ defaultValue: z.string().optional().describe('The default value of the field'),
15
+ /**
16
+ * Whether to sanitize the value before saving it to the database.
17
+ * If true, the value will be escaped to prevent XSS attacks.
18
+ * If false, the value will be saved as is (raw input).
19
+ * @default false
20
+ */
21
+ sanitize: z.boolean().optional().describe('Sanitize the value before saving'),
22
+ });
23
+ export class TextField extends Field {
24
+ static [entityKind] = 'TextField';
25
+ maxLength;
26
+ minLength;
27
+ placeholder;
28
+ _defaultValue;
29
+ value;
30
+ sanitize;
31
+ constructor(config) {
32
+ super(config, 'text');
33
+ this.maxLength = config.maxLength;
34
+ this.minLength = config.minLength;
35
+ this.placeholder = config.placeholder;
36
+ this.value = config.defaultValue;
37
+ this._defaultValue = config.defaultValue;
38
+ this.sanitize = config.sanitize ?? false;
39
+ }
40
+ /**
41
+ * Sanitize the value
42
+ */
43
+ sanitizeValue() {
44
+ /**
45
+ * Check if the value is not undefined
46
+ */
47
+ if (this.value !== undefined && this.sanitize) {
48
+ /**
49
+ * Sanitize the value
50
+ */
51
+ this.value = escapeHTML(this.value);
52
+ }
53
+ }
54
+ /*public override async postSubmit(): Promise<void> {
55
+ return
56
+ }*/
57
+ exportForClient() {
58
+ return {
59
+ ...super.exportForClient(),
60
+ maxLength: this.maxLength,
61
+ minLength: this.minLength,
62
+ placeholder: this.placeholder,
63
+ sanitize: this.sanitize,
64
+ };
65
+ }
66
+ /**
67
+ * Get the value of the field
68
+ */
69
+ getValue() {
70
+ return this.value;
71
+ }
72
+ checkRequired() {
73
+ /**
74
+ * Check if the field is required
75
+ */
76
+ if (this.required) {
77
+ if (!this.value || this.value.trim().length === 0) {
78
+ throw new Error(`Field ${this.label} is required`);
79
+ }
80
+ }
81
+ }
82
+ hasSqlNameAndValue() {
83
+ /**
84
+ * Include the field in the SQL if it is admin-generated, or not admin-generated but has a default value
85
+ */
86
+ return this.adminGenerated === true || this._defaultValue !== undefined;
87
+ }
88
+ /**
89
+ * Prepare the field for submission
90
+ */
91
+ async prepareForSubmission() {
92
+ /**
93
+ * Sanitize the value
94
+ */
95
+ this.sanitizeValue();
96
+ if (this.value) {
97
+ /**
98
+ * Check minimum length
99
+ */
100
+ if (this.minLength) {
101
+ if (this.minLength > this.value.length) {
102
+ throw new Error(`Field ${this.label} must be at least ${this.minLength} characters long`);
103
+ }
104
+ }
105
+ /**
106
+ * Check maximum length
107
+ */
108
+ if (this.maxLength) {
109
+ if (this.maxLength < this.value.length) {
110
+ throw new Error(`Field ${this.label} must be at most ${this.maxLength} characters long`);
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ const optionsSchema = z.strictObject({
117
+ ...baseFieldConfigSchema.shape,
118
+ ...configSchema.shape,
119
+ });
120
+ const textFieldConfigSchema = z.strictObject({
121
+ ...optionsSchema.shape,
122
+ type: z.literal('text').describe('The type of the field'),
123
+ build: z.function().output(z.instanceof(TextField)).describe('Build a TextField instance from this config'),
124
+ });
125
+ /**
126
+ * Helper function to create a text field configuration
127
+ * Returns a config object with a build() method that can be serialized and used anywhere
128
+ *
129
+ * @example
130
+ * ```typescript
131
+ * const fieldConfig = textField({ name: 'title', label: 'Title', required: true, order: 1 })
132
+ * // Use as config (serializable)
133
+ * const config = JSON.stringify(fieldConfig) // methods are ignored during serialization
134
+ * // Build instance when needed
135
+ * const fieldInstance = fieldConfig.build()
136
+ * ```
137
+ *
138
+ * @param field
139
+ */
140
+ export function textField(field) {
141
+ /**
142
+ * Validate the field config
143
+ */
144
+ const result = optionsSchema.safeParse(field);
145
+ if (!result.success) {
146
+ throw new Error(`[Field: ${field.name}]: ${z.prettifyError(result.error)}`);
147
+ }
148
+ const config = {
149
+ ...field,
150
+ type: 'text',
151
+ build() {
152
+ // Use the original field config directly (it doesn't have build() method)
153
+ return new TextField(field);
154
+ },
155
+ };
156
+ return config;
157
+ }
@@ -0,0 +1,107 @@
1
+ import type { BaseFieldConfig } from './field';
2
+ import { Field } from './field';
3
+ import { entityKind } from '../helpers';
4
+ import * as z from 'zod';
5
+ declare const configSchema: z.ZodObject<{
6
+ placeholder: z.ZodOptional<z.ZodString>;
7
+ minLength: z.ZodOptional<z.ZodNumber>;
8
+ maxLength: z.ZodOptional<z.ZodNumber>;
9
+ /**
10
+ * Whether to sanitize the value before saving it to the database.
11
+ * If true, the value will be escaped to prevent XSS attacks.
12
+ * If false, the value will be saved as is (raw input).
13
+ * @default false
14
+ */
15
+ sanitize: z.ZodOptional<z.ZodBoolean>;
16
+ }, z.core.$strict>;
17
+ type Config = z.infer<typeof configSchema>;
18
+ export declare class TextAreaField extends Field<'textarea', Config> {
19
+ static readonly [entityKind]: string;
20
+ readonly maxLength: number | undefined;
21
+ readonly minLength: number | undefined;
22
+ readonly placeholder: string | undefined;
23
+ readonly sanitize: boolean;
24
+ constructor(config: BaseFieldConfig<Config>);
25
+ exportForClient(): {
26
+ maxLength: number | undefined;
27
+ minLength: number | undefined;
28
+ placeholder: string | undefined;
29
+ sanitize: boolean;
30
+ type: "textarea";
31
+ name: string;
32
+ label: string;
33
+ required: boolean;
34
+ conditionalFields: import("../types").ConditionalField[];
35
+ readonly: boolean;
36
+ defaultValue: any;
37
+ value: any;
38
+ };
39
+ /**
40
+ * Sanitize the value
41
+ */
42
+ private sanitizeValue;
43
+ /**
44
+ * Get the value of the field
45
+ */
46
+ getValue(): string | undefined;
47
+ checkRequired(): void;
48
+ /**
49
+ * Prepare the field for submission
50
+ */
51
+ prepareForSubmission(): Promise<void>;
52
+ }
53
+ export type TextAreaFieldClientConfig = ReturnType<TextAreaField['exportForClient']>;
54
+ declare const optionsSchema: z.ZodObject<{
55
+ placeholder: z.ZodOptional<z.ZodString>;
56
+ minLength: z.ZodOptional<z.ZodNumber>;
57
+ maxLength: z.ZodOptional<z.ZodNumber>;
58
+ /**
59
+ * Whether to sanitize the value before saving it to the database.
60
+ * If true, the value will be escaped to prevent XSS attacks.
61
+ * If false, the value will be saved as is (raw input).
62
+ * @default false
63
+ */
64
+ sanitize: z.ZodOptional<z.ZodBoolean>;
65
+ name: z.ZodString;
66
+ label: z.ZodOptional<z.ZodString>;
67
+ required: z.ZodOptional<z.ZodBoolean>;
68
+ defaultValue: z.ZodOptional<z.ZodAny>;
69
+ order: z.ZodOptional<z.ZodNumber>;
70
+ conditionalRules: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types").ConditionalRule, import("../types").ConditionalRule>>>;
71
+ adminGenerated: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodLiteral<false>, z.ZodLiteral<"readonly">]>>;
72
+ }, z.core.$strict>;
73
+ declare const textAreaFieldConfigSchema: z.ZodObject<{
74
+ type: z.ZodLiteral<"textarea">;
75
+ build: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodCustom<TextAreaField, TextAreaField>>;
76
+ placeholder: z.ZodOptional<z.ZodString>;
77
+ minLength: z.ZodOptional<z.ZodNumber>;
78
+ maxLength: z.ZodOptional<z.ZodNumber>;
79
+ /**
80
+ * Whether to sanitize the value before saving it to the database.
81
+ * If true, the value will be escaped to prevent XSS attacks.
82
+ * If false, the value will be saved as is (raw input).
83
+ * @default false
84
+ */
85
+ sanitize: z.ZodOptional<z.ZodBoolean>;
86
+ name: z.ZodString;
87
+ label: z.ZodOptional<z.ZodString>;
88
+ required: z.ZodOptional<z.ZodBoolean>;
89
+ defaultValue: z.ZodOptional<z.ZodAny>;
90
+ order: z.ZodOptional<z.ZodNumber>;
91
+ conditionalRules: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types").ConditionalRule, import("../types").ConditionalRule>>>;
92
+ adminGenerated: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodLiteral<false>, z.ZodLiteral<"readonly">]>>;
93
+ }, z.core.$strict>;
94
+ /**
95
+ * TextArea field configuration type
96
+ * This is a plain object that can be serialized and used anywhere
97
+ * The build() method allows creating a TextAreaField instance when needed
98
+ */
99
+ export type TextAreaFieldConfig = z.infer<typeof textAreaFieldConfigSchema>;
100
+ /**
101
+ * Helper function to create a textarea field configuration
102
+ * Returns a config object with a build() method that can be serialized and used anywhere
103
+ * @param field
104
+ */
105
+ export declare function textAreaField(field: z.infer<typeof optionsSchema>): TextAreaFieldConfig;
106
+ export {};
107
+ //# sourceMappingURL=textArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textArea.d.ts","sourceRoot":"","sources":["../../../src/core/fields/textArea.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAyB,MAAM,SAAS,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,QAAA,MAAM,YAAY;;;;IAId;;;;;OAKG;;kBAEL,CAAA;AAEF,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1C,qBAAa,aAAc,SAAQ,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC;IACxD,gBAAyB,CAAC,UAAU,CAAC,EAAE,MAAM,CAAkB;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;gBAEd,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC;IAQ3B,eAAe;;;;;;;;;;;;;;IAU/B;;OAEG;IACH,OAAO,CAAC,aAAa;IAYrB;;OAEG;IACH,QAAQ,IAAI,MAAM,GAAG,SAAS;IAI9B,aAAa;IAWb;;OAEG;IACG,oBAAoB;CAuB7B;AAED,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAEpF,QAAA,MAAM,aAAa;;;;IAnGf;;;;;OAKG;;;;;;;;;kBAiGL,CAAA;AAEF,QAAA,MAAM,yBAAyB;;;;;;IAxG3B;;;;;OAKG;;;;;;;;;kBAuGL,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,GAAG,mBAAmB,CAmBvF"}