@rjsf/primereact 6.0.0-beta.11

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 (265) hide show
  1. package/README.md +120 -0
  2. package/dist/index.js +1285 -0
  3. package/dist/index.js.map +7 -0
  4. package/dist/primereact.esm.js +1327 -0
  5. package/dist/primereact.esm.js.map +7 -0
  6. package/dist/primereact.umd.js +1135 -0
  7. package/lib/AddButton/AddButton.d.ts +4 -0
  8. package/lib/AddButton/AddButton.js +10 -0
  9. package/lib/AddButton/AddButton.js.map +1 -0
  10. package/lib/AddButton/index.d.ts +2 -0
  11. package/lib/AddButton/index.js +3 -0
  12. package/lib/AddButton/index.js.map +1 -0
  13. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +6 -0
  14. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +13 -0
  15. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -0
  16. package/lib/ArrayFieldItemTemplate/index.d.ts +2 -0
  17. package/lib/ArrayFieldItemTemplate/index.js +3 -0
  18. package/lib/ArrayFieldItemTemplate/index.js.map +1 -0
  19. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +6 -0
  20. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +30 -0
  21. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -0
  22. package/lib/ArrayFieldTemplate/index.d.ts +2 -0
  23. package/lib/ArrayFieldTemplate/index.js +3 -0
  24. package/lib/ArrayFieldTemplate/index.js.map +1 -0
  25. package/lib/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.d.ts +6 -0
  26. package/lib/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.js +11 -0
  27. package/lib/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.js.map +1 -0
  28. package/lib/ArrayFieldTitleTemplate/index.d.ts +2 -0
  29. package/lib/ArrayFieldTitleTemplate/index.js +3 -0
  30. package/lib/ArrayFieldTitleTemplate/index.js.map +1 -0
  31. package/lib/AutoCompleteWidget/AutoCompleteWidget.d.ts +7 -0
  32. package/lib/AutoCompleteWidget/AutoCompleteWidget.js +42 -0
  33. package/lib/AutoCompleteWidget/AutoCompleteWidget.js.map +1 -0
  34. package/lib/AutoCompleteWidget/index.d.ts +2 -0
  35. package/lib/AutoCompleteWidget/index.js +3 -0
  36. package/lib/AutoCompleteWidget/index.js.map +1 -0
  37. package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +4 -0
  38. package/lib/BaseInputTemplate/BaseInputTemplate.js +19 -0
  39. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -0
  40. package/lib/BaseInputTemplate/index.d.ts +2 -0
  41. package/lib/BaseInputTemplate/index.js +3 -0
  42. package/lib/BaseInputTemplate/index.js.map +1 -0
  43. package/lib/CheckboxWidget/CheckboxWidget.d.ts +7 -0
  44. package/lib/CheckboxWidget/CheckboxWidget.js +23 -0
  45. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -0
  46. package/lib/CheckboxWidget/index.d.ts +2 -0
  47. package/lib/CheckboxWidget/index.js +3 -0
  48. package/lib/CheckboxWidget/index.js.map +1 -0
  49. package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +7 -0
  50. package/lib/CheckboxesWidget/CheckboxesWidget.js +35 -0
  51. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -0
  52. package/lib/CheckboxesWidget/index.d.ts +2 -0
  53. package/lib/CheckboxesWidget/index.js +3 -0
  54. package/lib/CheckboxesWidget/index.js.map +1 -0
  55. package/lib/ColorWidget/ColorWidget.d.ts +6 -0
  56. package/lib/ColorWidget/ColorWidget.js +18 -0
  57. package/lib/ColorWidget/ColorWidget.js.map +1 -0
  58. package/lib/ColorWidget/index.d.ts +2 -0
  59. package/lib/ColorWidget/index.js +3 -0
  60. package/lib/ColorWidget/index.js.map +1 -0
  61. package/lib/DescriptionField/DescriptionField.d.ts +6 -0
  62. package/lib/DescriptionField/DescriptionField.js +14 -0
  63. package/lib/DescriptionField/DescriptionField.js.map +1 -0
  64. package/lib/DescriptionField/index.d.ts +2 -0
  65. package/lib/DescriptionField/index.js +3 -0
  66. package/lib/DescriptionField/index.js.map +1 -0
  67. package/lib/ErrorList/ErrorList.d.ts +6 -0
  68. package/lib/ErrorList/ErrorList.js +21 -0
  69. package/lib/ErrorList/ErrorList.js.map +1 -0
  70. package/lib/ErrorList/index.d.ts +2 -0
  71. package/lib/ErrorList/index.js +3 -0
  72. package/lib/ErrorList/index.js.map +1 -0
  73. package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +6 -0
  74. package/lib/FieldErrorTemplate/FieldErrorTemplate.js +18 -0
  75. package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -0
  76. package/lib/FieldErrorTemplate/index.d.ts +2 -0
  77. package/lib/FieldErrorTemplate/index.js +3 -0
  78. package/lib/FieldErrorTemplate/index.js.map +1 -0
  79. package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +6 -0
  80. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +15 -0
  81. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -0
  82. package/lib/FieldHelpTemplate/index.d.ts +2 -0
  83. package/lib/FieldHelpTemplate/index.js +3 -0
  84. package/lib/FieldHelpTemplate/index.js.map +1 -0
  85. package/lib/FieldTemplate/FieldTemplate.d.ts +2 -0
  86. package/lib/FieldTemplate/FieldTemplate.js +13 -0
  87. package/lib/FieldTemplate/FieldTemplate.js.map +1 -0
  88. package/lib/FieldTemplate/index.d.ts +2 -0
  89. package/lib/FieldTemplate/index.js +3 -0
  90. package/lib/FieldTemplate/index.js.map +1 -0
  91. package/lib/GridTemplate/GridTemplate.d.ts +8 -0
  92. package/lib/GridTemplate/GridTemplate.js +69 -0
  93. package/lib/GridTemplate/GridTemplate.js.map +1 -0
  94. package/lib/GridTemplate/index.d.ts +2 -0
  95. package/lib/GridTemplate/index.js +3 -0
  96. package/lib/GridTemplate/index.js.map +1 -0
  97. package/lib/IconButton/IconButton.d.ts +7 -0
  98. package/lib/IconButton/IconButton.js +25 -0
  99. package/lib/IconButton/IconButton.js.map +1 -0
  100. package/lib/IconButton/index.d.ts +2 -0
  101. package/lib/IconButton/index.js +3 -0
  102. package/lib/IconButton/index.js.map +1 -0
  103. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +2 -0
  104. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js +7 -0
  105. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js.map +1 -0
  106. package/lib/MultiSchemaFieldTemplate/index.d.ts +2 -0
  107. package/lib/MultiSchemaFieldTemplate/index.js +3 -0
  108. package/lib/MultiSchemaFieldTemplate/index.js.map +1 -0
  109. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +8 -0
  110. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +18 -0
  111. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -0
  112. package/lib/ObjectFieldTemplate/index.d.ts +2 -0
  113. package/lib/ObjectFieldTemplate/index.js +3 -0
  114. package/lib/ObjectFieldTemplate/index.js.map +1 -0
  115. package/lib/PasswordWidget/PasswordWidget.d.ts +6 -0
  116. package/lib/PasswordWidget/PasswordWidget.js +17 -0
  117. package/lib/PasswordWidget/PasswordWidget.js.map +1 -0
  118. package/lib/PasswordWidget/index.d.ts +2 -0
  119. package/lib/PasswordWidget/index.js +3 -0
  120. package/lib/PasswordWidget/index.js.map +1 -0
  121. package/lib/PrimeForm/PrimeForm.d.ts +6 -0
  122. package/lib/PrimeForm/PrimeForm.js +7 -0
  123. package/lib/PrimeForm/PrimeForm.js.map +1 -0
  124. package/lib/PrimeForm/index.d.ts +2 -0
  125. package/lib/PrimeForm/index.js +3 -0
  126. package/lib/PrimeForm/index.js.map +1 -0
  127. package/lib/RadioWidget/RadioWidget.d.ts +7 -0
  128. package/lib/RadioWidget/RadioWidget.js +25 -0
  129. package/lib/RadioWidget/RadioWidget.js.map +1 -0
  130. package/lib/RadioWidget/index.d.ts +2 -0
  131. package/lib/RadioWidget/index.js +3 -0
  132. package/lib/RadioWidget/index.js.map +1 -0
  133. package/lib/RangeWidget/RangeWidget.d.ts +7 -0
  134. package/lib/RangeWidget/RangeWidget.js +21 -0
  135. package/lib/RangeWidget/RangeWidget.js.map +1 -0
  136. package/lib/RangeWidget/index.d.ts +2 -0
  137. package/lib/RangeWidget/index.js +3 -0
  138. package/lib/RangeWidget/index.js.map +1 -0
  139. package/lib/SelectWidget/SelectWidget.d.ts +7 -0
  140. package/lib/SelectWidget/SelectWidget.js +47 -0
  141. package/lib/SelectWidget/SelectWidget.js.map +1 -0
  142. package/lib/SelectWidget/index.d.ts +2 -0
  143. package/lib/SelectWidget/index.js +3 -0
  144. package/lib/SelectWidget/index.js.map +1 -0
  145. package/lib/SubmitButton/SubmitButton.d.ts +4 -0
  146. package/lib/SubmitButton/SubmitButton.js +13 -0
  147. package/lib/SubmitButton/SubmitButton.js.map +1 -0
  148. package/lib/SubmitButton/index.d.ts +2 -0
  149. package/lib/SubmitButton/index.js +3 -0
  150. package/lib/SubmitButton/index.js.map +1 -0
  151. package/lib/Templates/Templates.d.ts +4 -0
  152. package/lib/Templates/Templates.js +45 -0
  153. package/lib/Templates/Templates.js.map +1 -0
  154. package/lib/Templates/index.d.ts +2 -0
  155. package/lib/Templates/index.js +3 -0
  156. package/lib/Templates/index.js.map +1 -0
  157. package/lib/TextareaWidget/TextareaWidget.d.ts +6 -0
  158. package/lib/TextareaWidget/TextareaWidget.js +20 -0
  159. package/lib/TextareaWidget/TextareaWidget.js.map +1 -0
  160. package/lib/TextareaWidget/index.d.ts +2 -0
  161. package/lib/TextareaWidget/index.js +3 -0
  162. package/lib/TextareaWidget/index.js.map +1 -0
  163. package/lib/Theme/Theme.d.ts +5 -0
  164. package/lib/Theme/Theme.js +10 -0
  165. package/lib/Theme/Theme.js.map +1 -0
  166. package/lib/Theme/index.d.ts +2 -0
  167. package/lib/Theme/index.js +3 -0
  168. package/lib/Theme/index.js.map +1 -0
  169. package/lib/TitleField/TitleField.d.ts +6 -0
  170. package/lib/TitleField/TitleField.js +12 -0
  171. package/lib/TitleField/TitleField.js.map +1 -0
  172. package/lib/TitleField/index.d.ts +2 -0
  173. package/lib/TitleField/index.js +3 -0
  174. package/lib/TitleField/index.js.map +1 -0
  175. package/lib/UpDownWidget/UpDownWidget.d.ts +6 -0
  176. package/lib/UpDownWidget/UpDownWidget.js +19 -0
  177. package/lib/UpDownWidget/UpDownWidget.js.map +1 -0
  178. package/lib/UpDownWidget/index.d.ts +2 -0
  179. package/lib/UpDownWidget/index.js +3 -0
  180. package/lib/UpDownWidget/index.js.map +1 -0
  181. package/lib/Widgets/Widgets.d.ts +4 -0
  182. package/lib/Widgets/Widgets.js +26 -0
  183. package/lib/Widgets/Widgets.js.map +1 -0
  184. package/lib/Widgets/index.d.ts +2 -0
  185. package/lib/Widgets/index.js +3 -0
  186. package/lib/Widgets/index.js.map +1 -0
  187. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +7 -0
  188. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +20 -0
  189. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -0
  190. package/lib/WrapIfAdditionalTemplate/index.d.ts +2 -0
  191. package/lib/WrapIfAdditionalTemplate/index.js +3 -0
  192. package/lib/WrapIfAdditionalTemplate/index.js.map +1 -0
  193. package/lib/index.d.ts +6 -0
  194. package/lib/index.js +7 -0
  195. package/lib/index.js.map +1 -0
  196. package/lib/tsconfig.tsbuildinfo +1 -0
  197. package/lib/util.d.ts +5 -0
  198. package/lib/util.js +8 -0
  199. package/lib/util.js.map +1 -0
  200. package/package.json +104 -0
  201. package/src/AddButton/AddButton.tsx +23 -0
  202. package/src/AddButton/index.ts +2 -0
  203. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +40 -0
  204. package/src/ArrayFieldItemTemplate/index.ts +2 -0
  205. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +111 -0
  206. package/src/ArrayFieldTemplate/index.ts +2 -0
  207. package/src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx +25 -0
  208. package/src/ArrayFieldTitleTemplate/index.ts +2 -0
  209. package/src/AutoCompleteWidget/AutoCompleteWidget.tsx +96 -0
  210. package/src/AutoCompleteWidget/index.ts +2 -0
  211. package/src/BaseInputTemplate/BaseInputTemplate.tsx +71 -0
  212. package/src/BaseInputTemplate/index.ts +2 -0
  213. package/src/CheckboxWidget/CheckboxWidget.tsx +86 -0
  214. package/src/CheckboxWidget/index.ts +2 -0
  215. package/src/CheckboxesWidget/CheckboxesWidget.tsx +105 -0
  216. package/src/CheckboxesWidget/index.ts +2 -0
  217. package/src/ColorWidget/ColorWidget.tsx +62 -0
  218. package/src/ColorWidget/index.ts +2 -0
  219. package/src/DescriptionField/DescriptionField.tsx +22 -0
  220. package/src/DescriptionField/index.ts +2 -0
  221. package/src/ErrorList/ErrorList.tsx +44 -0
  222. package/src/ErrorList/index.ts +2 -0
  223. package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +30 -0
  224. package/src/FieldErrorTemplate/index.ts +2 -0
  225. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +18 -0
  226. package/src/FieldHelpTemplate/index.ts +2 -0
  227. package/src/FieldTemplate/FieldTemplate.tsx +40 -0
  228. package/src/FieldTemplate/index.ts +2 -0
  229. package/src/GridTemplate/GridTemplate.tsx +93 -0
  230. package/src/GridTemplate/index.ts +2 -0
  231. package/src/IconButton/IconButton.tsx +47 -0
  232. package/src/IconButton/index.ts +2 -0
  233. package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +17 -0
  234. package/src/MultiSchemaFieldTemplate/index.ts +2 -0
  235. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +88 -0
  236. package/src/ObjectFieldTemplate/index.ts +2 -0
  237. package/src/PasswordWidget/PasswordWidget.tsx +65 -0
  238. package/src/PasswordWidget/index.ts +2 -0
  239. package/src/PrimeForm/PrimeForm.ts +15 -0
  240. package/src/PrimeForm/index.ts +2 -0
  241. package/src/RadioWidget/RadioWidget.tsx +60 -0
  242. package/src/RadioWidget/index.ts +2 -0
  243. package/src/RangeWidget/RangeWidget.tsx +37 -0
  244. package/src/RangeWidget/index.ts +2 -0
  245. package/src/SelectWidget/SelectWidget.tsx +139 -0
  246. package/src/SelectWidget/index.ts +2 -0
  247. package/src/SubmitButton/SubmitButton.tsx +16 -0
  248. package/src/SubmitButton/index.ts +2 -0
  249. package/src/Templates/Templates.ts +52 -0
  250. package/src/Templates/index.ts +2 -0
  251. package/src/TextareaWidget/TextareaWidget.tsx +41 -0
  252. package/src/TextareaWidget/index.ts +2 -0
  253. package/src/Theme/Theme.ts +18 -0
  254. package/src/Theme/index.ts +2 -0
  255. package/src/TitleField/TitleField.tsx +23 -0
  256. package/src/TitleField/index.ts +2 -0
  257. package/src/UpDownWidget/UpDownWidget.tsx +70 -0
  258. package/src/UpDownWidget/index.ts +2 -0
  259. package/src/Widgets/Widgets.tsx +33 -0
  260. package/src/Widgets/index.ts +2 -0
  261. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +83 -0
  262. package/src/WrapIfAdditionalTemplate/index.ts +2 -0
  263. package/src/index.ts +8 -0
  264. package/src/tsconfig.json +24 -0
  265. package/src/util.tsx +11 -0
package/dist/index.js ADDED
@@ -0,0 +1,1285 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Form: () => PrimeForm_default,
24
+ Templates: () => Templates_default,
25
+ Theme: () => Theme_default,
26
+ Widgets: () => Widgets_default,
27
+ default: () => index_default,
28
+ generateForm: () => generateForm,
29
+ generateTemplates: () => generateTemplates,
30
+ generateTheme: () => generateTheme,
31
+ generateWidgets: () => generateWidgets
32
+ });
33
+ module.exports = __toCommonJS(index_exports);
34
+
35
+ // src/PrimeForm/PrimeForm.ts
36
+ var import_core2 = require("@rjsf/core");
37
+
38
+ // src/AddButton/AddButton.tsx
39
+ var import_button = require("primereact/button");
40
+ var import_utils = require("@rjsf/utils");
41
+ var import_jsx_runtime = require("react/jsx-runtime");
42
+ function AddButton({
43
+ uiSchema,
44
+ registry,
45
+ color,
46
+ ...props
47
+ }) {
48
+ const { translateString } = registry;
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
50
+ import_button.Button,
51
+ {
52
+ label: translateString(import_utils.TranslatableString.AddItemButton),
53
+ icon: "pi pi-plus",
54
+ outlined: true,
55
+ severity: "secondary",
56
+ size: "small",
57
+ ...props
58
+ }
59
+ );
60
+ }
61
+
62
+ // src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
63
+ var import_utils2 = require("@rjsf/utils");
64
+ var import_jsx_runtime2 = require("react/jsx-runtime");
65
+ function ArrayFieldItemTemplate(props) {
66
+ const { children, buttonsProps, hasToolbar, uiSchema, registry } = props;
67
+ const uiOptions = (0, import_utils2.getUiOptions)(uiSchema);
68
+ const ArrayFieldItemButtonsTemplate = (0, import_utils2.getTemplate)(
69
+ "ArrayFieldItemButtonsTemplate",
70
+ registry,
71
+ uiOptions
72
+ );
73
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { position: "relative" }, children: [
74
+ hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { position: "absolute", right: 0, top: "-10px" }, children: hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { flexDirection: "row" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ArrayFieldItemButtonsTemplate, { ...buttonsProps }) }) }),
75
+ children
76
+ ] });
77
+ }
78
+
79
+ // src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
80
+ var import_utils3 = require("@rjsf/utils");
81
+ var import_fieldset = require("primereact/fieldset");
82
+ var import_jsx_runtime3 = require("react/jsx-runtime");
83
+ function ArrayFieldTemplate(props) {
84
+ const {
85
+ uiSchema,
86
+ idSchema,
87
+ canAdd,
88
+ className,
89
+ disabled,
90
+ items,
91
+ onAddClick,
92
+ readonly,
93
+ schema,
94
+ title,
95
+ registry,
96
+ required,
97
+ ...rest
98
+ } = props;
99
+ const uiOptions = (0, import_utils3.getUiOptions)(uiSchema);
100
+ const ArrayFieldDescriptionTemplate = (0, import_utils3.getTemplate)(
101
+ "ArrayFieldDescriptionTemplate",
102
+ registry,
103
+ uiOptions
104
+ );
105
+ const ArrayFieldItemTemplate2 = (0, import_utils3.getTemplate)(
106
+ "ArrayFieldItemTemplate",
107
+ registry,
108
+ uiOptions
109
+ );
110
+ const ArrayFieldTitleTemplate2 = (0, import_utils3.getTemplate)(
111
+ "ArrayFieldTitleTemplate",
112
+ registry,
113
+ uiOptions
114
+ );
115
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
116
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
117
+ ArrayFieldTitleTemplate2,
118
+ {
119
+ idSchema,
120
+ title: uiOptions.title || title,
121
+ schema,
122
+ uiSchema,
123
+ required,
124
+ registry
125
+ }
126
+ ),
127
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_fieldset.Fieldset, { ...rest, className: `${className}${(0, import_utils3.isFixedItems)(schema) ? "" : " sortable-form-fields"}`, children: [
128
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
129
+ ArrayFieldDescriptionTemplate,
130
+ {
131
+ idSchema,
132
+ description: uiOptions.description || schema.description,
133
+ schema,
134
+ uiSchema,
135
+ registry
136
+ }
137
+ ),
138
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
139
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: items && items.map(({ key, uiSchema: itemUiSchema = {}, ...props2 }) => {
140
+ const mergedUiSchema = {
141
+ ...itemUiSchema,
142
+ [import_utils3.UI_OPTIONS_KEY]: {
143
+ ...itemUiSchema[import_utils3.UI_OPTIONS_KEY]
144
+ }
145
+ };
146
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrayFieldItemTemplate2, { ...props2, uiSchema: mergedUiSchema }, key);
147
+ }) }),
148
+ canAdd && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
149
+ "div",
150
+ {
151
+ style: {
152
+ marginTop: "1rem",
153
+ position: "relative",
154
+ textAlign: "right"
155
+ },
156
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
157
+ AddButton,
158
+ {
159
+ id: (0, import_utils3.buttonId)(idSchema, "add"),
160
+ className: "rjsf-array-item-add",
161
+ onClick: onAddClick,
162
+ disabled: disabled || readonly,
163
+ uiSchema,
164
+ registry
165
+ }
166
+ )
167
+ }
168
+ )
169
+ ] }, `array-item-list-${idSchema.$id}`)
170
+ ] })
171
+ ] });
172
+ }
173
+
174
+ // src/BaseInputTemplate/BaseInputTemplate.tsx
175
+ var import_utils4 = require("@rjsf/utils");
176
+ var import_inputtext = require("primereact/inputtext");
177
+ var import_jsx_runtime4 = require("react/jsx-runtime");
178
+ function BaseInputTemplate(props) {
179
+ const {
180
+ id,
181
+ placeholder,
182
+ value,
183
+ required,
184
+ readonly,
185
+ disabled,
186
+ onChange,
187
+ onChangeOverride,
188
+ onBlur,
189
+ onFocus,
190
+ autofocus,
191
+ options,
192
+ schema,
193
+ type,
194
+ registry,
195
+ rawErrors = []
196
+ } = props;
197
+ const { AutoCompleteWidget: AutoCompleteWidget2 } = registry.widgets;
198
+ if (Array.isArray(schema.examples)) {
199
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AutoCompleteWidget2, { ...props });
200
+ }
201
+ const inputProps = (0, import_utils4.getInputProps)(schema, type, options);
202
+ const primeProps = options.prime || {};
203
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
204
+ const _onBlur = () => onBlur && onBlur(id, value);
205
+ const _onFocus = () => onFocus && onFocus(id, value);
206
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
207
+ import_inputtext.InputText,
208
+ {
209
+ id,
210
+ name: id,
211
+ placeholder,
212
+ ...primeProps,
213
+ ...inputProps,
214
+ required,
215
+ autoFocus: autofocus,
216
+ disabled: disabled || readonly,
217
+ list: schema.examples ? (0, import_utils4.examplesId)(id) : void 0,
218
+ value: value || value === 0 ? value : "",
219
+ invalid: rawErrors.length > 0,
220
+ onChange: onChangeOverride || _onChange,
221
+ onBlur: _onBlur,
222
+ onFocus: _onFocus,
223
+ "aria-describedby": (0, import_utils4.ariaDescribedByIds)(id, !!schema.examples)
224
+ }
225
+ );
226
+ }
227
+
228
+ // src/DescriptionField/DescriptionField.tsx
229
+ var import_core = require("@rjsf/core");
230
+ var import_jsx_runtime5 = require("react/jsx-runtime");
231
+ function DescriptionField(props) {
232
+ const { id, description, registry, uiSchema } = props;
233
+ if (!description) {
234
+ return null;
235
+ }
236
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { id, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core.RichDescription, { description, registry, uiSchema }) });
237
+ }
238
+
239
+ // src/ErrorList/ErrorList.tsx
240
+ var import_message = require("primereact/message");
241
+ var import_timescircle = require("primereact/icons/timescircle");
242
+ var import_utils5 = require("@rjsf/utils");
243
+ var import_jsx_runtime6 = require("react/jsx-runtime");
244
+ function ErrorList({
245
+ errors,
246
+ registry
247
+ }) {
248
+ const { translateString } = registry;
249
+ const content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", flexDirection: "column" }, children: [
250
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", gap: "0.5rem" }, children: [
251
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_timescircle.TimesCircleIcon, { style: { width: "1.5rem", height: "1.5rem" } }),
252
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "p-message-summary", children: translateString(import_utils5.TranslatableString.ErrorsLabel) })
253
+ ] }),
254
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "p-message-list", children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: error.stack }, `error-${index}`)) })
255
+ ] });
256
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
257
+ import_message.Message,
258
+ {
259
+ className: "p-message",
260
+ style: {
261
+ borderStyle: "solid",
262
+ borderColor: "#ff5757",
263
+ borderWidth: "0 0 0 6px",
264
+ width: "100%",
265
+ justifyContent: "start",
266
+ marginBottom: "1rem"
267
+ },
268
+ severity: "error",
269
+ content
270
+ }
271
+ );
272
+ }
273
+
274
+ // src/IconButton/IconButton.tsx
275
+ var import_button2 = require("primereact/button");
276
+ var import_utils6 = require("@rjsf/utils");
277
+ var import_jsx_runtime7 = require("react/jsx-runtime");
278
+ function IconButton(props) {
279
+ const { icon, iconType, uiSchema, registry, ...otherProps } = props;
280
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_button2.Button, { icon: `pi pi-${icon}`, rounded: true, text: true, severity: "secondary", ...otherProps });
281
+ }
282
+ function CopyButton(props) {
283
+ const {
284
+ registry: { translateString }
285
+ } = props;
286
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.CopyButton), ...props, icon: "copy" });
287
+ }
288
+ function MoveDownButton(props) {
289
+ const {
290
+ registry: { translateString }
291
+ } = props;
292
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.MoveDownButton), ...props, icon: "angle-down" });
293
+ }
294
+ function MoveUpButton(props) {
295
+ const {
296
+ registry: { translateString }
297
+ } = props;
298
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.MoveUpButton), ...props, icon: "angle-up" });
299
+ }
300
+ function RemoveButton(props) {
301
+ const {
302
+ registry: { translateString }
303
+ } = props;
304
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconButton, { title: translateString(import_utils6.TranslatableString.RemoveButton), ...props, icon: "trash" });
305
+ }
306
+
307
+ // src/FieldErrorTemplate/FieldErrorTemplate.tsx
308
+ var import_utils7 = require("@rjsf/utils");
309
+ var import_message2 = require("primereact/message");
310
+ var import_jsx_runtime8 = require("react/jsx-runtime");
311
+ function FieldErrorTemplate({ errors, idSchema }) {
312
+ if (errors && errors.length > 0) {
313
+ const id = (0, import_utils7.errorId)(idSchema);
314
+ const content = errors.map((error, i) => {
315
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: error }, i);
316
+ });
317
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
318
+ import_message2.Message,
319
+ {
320
+ id,
321
+ severity: "error",
322
+ style: { justifyContent: "left" },
323
+ text: content,
324
+ pt: { text: { style: { fontSize: "smaller" } } }
325
+ }
326
+ );
327
+ }
328
+ return null;
329
+ }
330
+
331
+ // src/FieldHelpTemplate/FieldHelpTemplate.tsx
332
+ var import_utils8 = require("@rjsf/utils");
333
+ var import_jsx_runtime9 = require("react/jsx-runtime");
334
+ function FieldHelpTemplate(props) {
335
+ const { idSchema, help } = props;
336
+ if (help) {
337
+ const id = (0, import_utils8.helpId)(idSchema);
338
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("small", { id, children: help });
339
+ }
340
+ return null;
341
+ }
342
+
343
+ // src/FieldTemplate/FieldTemplate.tsx
344
+ var import_utils9 = require("@rjsf/utils");
345
+
346
+ // src/util.tsx
347
+ var import_jsx_runtime10 = require("react/jsx-runtime");
348
+ function Label({ id, text, required }) {
349
+ if (!text) {
350
+ return null;
351
+ }
352
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { htmlFor: id, children: [
353
+ text,
354
+ " ",
355
+ required ? "*" : ""
356
+ ] });
357
+ }
358
+
359
+ // src/FieldTemplate/FieldTemplate.tsx
360
+ var import_jsx_runtime11 = require("react/jsx-runtime");
361
+ function FieldTemplate(props) {
362
+ const { children, errors, help, displayLabel, description, rawDescription, hidden, uiSchema, registry } = props;
363
+ const uiOptions = (0, import_utils9.getUiOptions)(uiSchema);
364
+ const WrapIfAdditionalTemplate2 = (0, import_utils9.getTemplate)(
365
+ "WrapIfAdditionalTemplate",
366
+ registry,
367
+ uiOptions
368
+ );
369
+ if (hidden) {
370
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "none" }, children });
371
+ }
372
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WrapIfAdditionalTemplate2, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "0.5rem", marginBottom: "1rem" }, children: [
373
+ displayLabel && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Label, { id: props.id, text: props.label, required: props.required }),
374
+ children,
375
+ displayLabel && rawDescription && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: description }),
376
+ errors,
377
+ help
378
+ ] }) });
379
+ }
380
+
381
+ // src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
382
+ var import_fieldset2 = require("primereact/fieldset");
383
+ var import_jsx_runtime12 = require("react/jsx-runtime");
384
+ function MultiSchemaFieldTemplate(props) {
385
+ const { selector, optionSchemaField } = props;
386
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_fieldset2.Fieldset, { children: [
387
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { marginBottom: "1rem" }, children: selector }),
388
+ optionSchemaField
389
+ ] });
390
+ }
391
+
392
+ // src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
393
+ var import_utils10 = require("@rjsf/utils");
394
+ var import_jsx_runtime13 = require("react/jsx-runtime");
395
+ function ObjectFieldTemplate(props) {
396
+ const {
397
+ description,
398
+ onAddClick,
399
+ title,
400
+ properties,
401
+ disabled,
402
+ readonly,
403
+ required,
404
+ uiSchema,
405
+ schema,
406
+ formData,
407
+ idSchema,
408
+ registry
409
+ } = props;
410
+ const uiOptions = (0, import_utils10.getUiOptions)(uiSchema);
411
+ const TitleFieldTemplate = (0, import_utils10.getTemplate)("TitleFieldTemplate", registry, uiOptions);
412
+ const DescriptionFieldTemplate = (0, import_utils10.getTemplate)(
413
+ "DescriptionFieldTemplate",
414
+ registry,
415
+ uiOptions
416
+ );
417
+ const {
418
+ ButtonTemplates: { AddButton: AddButton2 }
419
+ } = registry.templates;
420
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
421
+ title && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
422
+ TitleFieldTemplate,
423
+ {
424
+ id: (0, import_utils10.titleId)(idSchema),
425
+ title,
426
+ required,
427
+ schema,
428
+ uiSchema,
429
+ registry
430
+ }
431
+ ),
432
+ description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
433
+ DescriptionFieldTemplate,
434
+ {
435
+ id: (0, import_utils10.descriptionId)(idSchema),
436
+ description,
437
+ schema,
438
+ uiSchema,
439
+ registry
440
+ }
441
+ ) }),
442
+ properties.map((prop) => prop.content),
443
+ (0, import_utils10.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginTop: "1rem", textAlign: "right" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
444
+ AddButton2,
445
+ {
446
+ id: (0, import_utils10.buttonId)(idSchema, "add"),
447
+ className: "rjsf-object-property-expand",
448
+ icon: "pi pi-plus",
449
+ onClick: onAddClick(schema),
450
+ disabled: disabled || readonly,
451
+ registry
452
+ }
453
+ ) })
454
+ ] });
455
+ }
456
+
457
+ // src/SubmitButton/SubmitButton.tsx
458
+ var import_button3 = require("primereact/button");
459
+ var import_utils11 = require("@rjsf/utils");
460
+ var import_jsx_runtime14 = require("react/jsx-runtime");
461
+ function SubmitButton({ uiSchema }) {
462
+ const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils11.getSubmitButtonOptions)(uiSchema);
463
+ if (norender) {
464
+ return null;
465
+ }
466
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_button3.Button, { type: "submit", label: submitText, ...submitButtonProps });
467
+ }
468
+
469
+ // src/TitleField/TitleField.tsx
470
+ var import_divider = require("primereact/divider");
471
+ var import_utils12 = require("@rjsf/utils");
472
+ var import_jsx_runtime15 = require("react/jsx-runtime");
473
+ function TitleField({
474
+ id,
475
+ title,
476
+ uiSchema,
477
+ required
478
+ }) {
479
+ const uiOptions = (0, import_utils12.getUiOptions)(uiSchema);
480
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { id, children: [
481
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("h5", { style: { margin: 0, fontSize: id === (0, import_utils12.titleId)("root") ? "1.5rem" : "1.2rem" }, children: [
482
+ uiOptions.title || title,
483
+ " ",
484
+ required ? "*" : ""
485
+ ] }),
486
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_divider.Divider, { pt: { root: { style: { marginTop: "0.5rem" } } } })
487
+ ] });
488
+ }
489
+
490
+ // src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
491
+ var import_utils13 = require("@rjsf/utils");
492
+ var import_inputtext2 = require("primereact/inputtext");
493
+ var import_jsx_runtime16 = require("react/jsx-runtime");
494
+ function WrapIfAdditionalTemplate({
495
+ classNames,
496
+ style,
497
+ children,
498
+ disabled,
499
+ id,
500
+ label,
501
+ onDropPropertyClick,
502
+ onKeyChange,
503
+ readonly,
504
+ required,
505
+ schema,
506
+ registry
507
+ }) {
508
+ const { templates, translateString } = registry;
509
+ const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
510
+ const keyLabel = translateString(import_utils13.TranslatableString.KeyLabel, [label]);
511
+ const additional = import_utils13.ADDITIONAL_PROPERTY_FLAG in schema;
512
+ if (!additional) {
513
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: classNames, style, children });
514
+ }
515
+ const handleBlur = ({ target }) => onKeyChange(target.value);
516
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
517
+ "div",
518
+ {
519
+ className: classNames,
520
+ style: { ...style, display: "flex", alignItems: "center", gap: "1rem" },
521
+ children: [
522
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { flex: 1 }, children: [
523
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: `${id}-key`, style: { display: "block", marginBottom: "0.5rem" }, children: keyLabel }),
524
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
525
+ import_inputtext2.InputText,
526
+ {
527
+ id: `${id}-key`,
528
+ name: `${id}-key`,
529
+ defaultValue: label,
530
+ disabled: disabled || readonly,
531
+ onBlur: !readonly ? handleBlur : void 0,
532
+ required,
533
+ style: { width: "100%" }
534
+ }
535
+ )
536
+ ] }),
537
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { flex: 1 }, children }),
538
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
539
+ RemoveButton2,
540
+ {
541
+ id: (0, import_utils13.buttonId)(id, "remove"),
542
+ className: "rjsf-object-property-remove",
543
+ disabled: disabled || readonly,
544
+ onClick: onDropPropertyClick(label),
545
+ registry
546
+ }
547
+ ) })
548
+ ]
549
+ },
550
+ `${id}-key`
551
+ );
552
+ }
553
+
554
+ // src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx
555
+ var import_utils14 = require("@rjsf/utils");
556
+ var import_jsx_runtime17 = require("react/jsx-runtime");
557
+ function ArrayFieldTitleTemplate({ title, uiSchema, required, idSchema }) {
558
+ const uiOptions = (0, import_utils14.getUiOptions)(uiSchema);
559
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("h5", { id: (0, import_utils14.titleId)(idSchema), style: { margin: 0, fontSize: "1.5rem", marginBottom: "0.2rem" }, children: [
560
+ uiOptions.title || title,
561
+ " ",
562
+ required ? "*" : ""
563
+ ] });
564
+ }
565
+
566
+ // src/GridTemplate/GridTemplate.tsx
567
+ var import_react = require("react");
568
+ var import_jsx_runtime18 = require("react/jsx-runtime");
569
+ var breakpoints = {
570
+ xs: 0,
571
+ sm: 576,
572
+ md: 768,
573
+ lg: 992,
574
+ xl: 1200
575
+ };
576
+ function getBreakpoint(width) {
577
+ if (width >= breakpoints.xl) {
578
+ return "xl";
579
+ }
580
+ if (width >= breakpoints.lg) {
581
+ return "lg";
582
+ }
583
+ if (width >= breakpoints.md) {
584
+ return "md";
585
+ }
586
+ if (width >= breakpoints.sm) {
587
+ return "sm";
588
+ }
589
+ return "xs";
590
+ }
591
+ function getResponsiveSpan(spanDef, breakpoint) {
592
+ return spanDef[breakpoint] ?? spanDef.xl ?? spanDef.lg ?? spanDef.md ?? spanDef.sm ?? spanDef.xs ?? 12;
593
+ }
594
+ function getInitialWidth() {
595
+ return typeof window !== "undefined" ? window.innerWidth : breakpoints.xs;
596
+ }
597
+ function GridTemplate(props) {
598
+ return props.column ? GridTemplateColumn(props) : GridTemplateRow(props);
599
+ }
600
+ function GridTemplateRow(props) {
601
+ const { children, column, uiSchema, style, ...rest } = props;
602
+ const layoutGrid = uiSchema?.["ui:layoutGrid"] ?? {};
603
+ const totalColumns = layoutGrid.columns ?? 12;
604
+ const gap = layoutGrid.gap ?? "16px";
605
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
606
+ "div",
607
+ {
608
+ style: {
609
+ display: "grid",
610
+ gridTemplateColumns: `repeat(${totalColumns}, 1fr)`,
611
+ alignItems: "start",
612
+ gap,
613
+ ...style ?? {}
614
+ },
615
+ ...rest,
616
+ children
617
+ }
618
+ );
619
+ }
620
+ function GridTemplateColumn(props) {
621
+ const { children, column, uiSchema, xs, sm, md, lg, xl, style, ...rest } = props;
622
+ const [breakpoint, setBreakpoint] = (0, import_react.useState)(() => getBreakpoint(getInitialWidth()));
623
+ (0, import_react.useEffect)(() => {
624
+ if (typeof window === "undefined") {
625
+ return;
626
+ }
627
+ const handleResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
628
+ window.addEventListener("resize", handleResize);
629
+ return () => window.removeEventListener("resize", handleResize);
630
+ }, []);
631
+ const span = getResponsiveSpan(props, breakpoint);
632
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { gridColumn: `span ${span} / span ${span}`, ...style ?? {} }, ...rest, children });
633
+ }
634
+
635
+ // src/Templates/Templates.ts
636
+ function generateTemplates() {
637
+ return {
638
+ ArrayFieldItemTemplate,
639
+ ArrayFieldTemplate,
640
+ ArrayFieldTitleTemplate,
641
+ BaseInputTemplate,
642
+ ButtonTemplates: {
643
+ AddButton,
644
+ CopyButton,
645
+ MoveDownButton,
646
+ MoveUpButton,
647
+ RemoveButton,
648
+ SubmitButton
649
+ },
650
+ DescriptionFieldTemplate: DescriptionField,
651
+ ErrorListTemplate: ErrorList,
652
+ FieldErrorTemplate,
653
+ FieldHelpTemplate,
654
+ FieldTemplate,
655
+ MultiSchemaFieldTemplate,
656
+ ObjectFieldTemplate,
657
+ TitleFieldTemplate: TitleField,
658
+ WrapIfAdditionalTemplate,
659
+ GridTemplate
660
+ };
661
+ }
662
+ var Templates_default = generateTemplates();
663
+
664
+ // src/AutoCompleteWidget/AutoCompleteWidget.tsx
665
+ var import_react2 = require("react");
666
+ var import_utils15 = require("@rjsf/utils");
667
+ var import_autocomplete = require("primereact/autocomplete");
668
+ var import_jsx_runtime19 = require("react/jsx-runtime");
669
+ function AutoCompleteWidget(props) {
670
+ const {
671
+ id,
672
+ placeholder,
673
+ value,
674
+ required,
675
+ readonly,
676
+ disabled,
677
+ onChange,
678
+ onChangeOverride,
679
+ onBlur,
680
+ onFocus,
681
+ autofocus,
682
+ options,
683
+ schema,
684
+ type,
685
+ rawErrors = []
686
+ } = props;
687
+ const inputProps = (0, import_utils15.getInputProps)(schema, type, options);
688
+ const primeProps = options.prime || {};
689
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
690
+ const _onBlur = () => onBlur && onBlur(id, value);
691
+ const _onFocus = () => onFocus && onFocus(id, value);
692
+ const examples = schema.examples.concat(
693
+ schema.default && !schema.examples.includes(schema.default.toString()) ? [schema.default.toString()] : []
694
+ );
695
+ const [items, setItems] = (0, import_react2.useState)([]);
696
+ const search = (event) => {
697
+ setItems(examples.filter((example) => example.toString().toLowerCase().includes(event.query.toLowerCase())));
698
+ };
699
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
700
+ import_autocomplete.AutoComplete,
701
+ {
702
+ id,
703
+ name: id,
704
+ placeholder,
705
+ ...primeProps,
706
+ ...inputProps,
707
+ loadingIcon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, {}),
708
+ required,
709
+ autoFocus: autofocus,
710
+ disabled: disabled || readonly,
711
+ suggestions: items,
712
+ completeMethod: search,
713
+ value: value || value === 0 ? value : "",
714
+ dropdown: true,
715
+ invalid: rawErrors.length > 0,
716
+ onChange: onChangeOverride || _onChange,
717
+ onBlur: _onBlur,
718
+ onFocus: _onFocus,
719
+ "aria-describedby": (0, import_utils15.ariaDescribedByIds)(id, !!schema.examples),
720
+ pt: {
721
+ root: {
722
+ className: "p-dropdown"
723
+ },
724
+ input: {
725
+ root: {
726
+ style: { border: "none" }
727
+ }
728
+ },
729
+ dropdownButton: {
730
+ root: {
731
+ className: "p-button-text p-button-secondary"
732
+ }
733
+ }
734
+ }
735
+ }
736
+ );
737
+ }
738
+
739
+ // src/CheckboxWidget/CheckboxWidget.tsx
740
+ var import_utils16 = require("@rjsf/utils");
741
+ var import_checkbox = require("primereact/checkbox");
742
+ var import_jsx_runtime20 = require("react/jsx-runtime");
743
+ function CheckboxWidget(props) {
744
+ const {
745
+ id,
746
+ value,
747
+ disabled,
748
+ readonly,
749
+ label = "",
750
+ hideLabel,
751
+ autofocus,
752
+ onChange,
753
+ onBlur,
754
+ options,
755
+ onFocus,
756
+ schema,
757
+ uiSchema,
758
+ registry
759
+ } = props;
760
+ const DescriptionFieldTemplate = (0, import_utils16.getTemplate)(
761
+ "DescriptionFieldTemplate",
762
+ registry,
763
+ options
764
+ );
765
+ const required = (0, import_utils16.schemaRequiresTrueValue)(schema);
766
+ const _onChange = (e) => onChange && onChange(e.checked);
767
+ const _onBlur = () => onBlur && onBlur(id, value);
768
+ const _onFocus = () => onFocus && onFocus(id, value);
769
+ const checked = value === "true" || value === true;
770
+ const description = options.description ?? schema.description;
771
+ const primeProps = options.prime || {};
772
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
773
+ !hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
774
+ DescriptionFieldTemplate,
775
+ {
776
+ id: (0, import_utils16.descriptionId)(id),
777
+ description,
778
+ schema,
779
+ uiSchema,
780
+ registry
781
+ }
782
+ ),
783
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
784
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
785
+ import_checkbox.Checkbox,
786
+ {
787
+ inputId: id,
788
+ name: id,
789
+ ...primeProps,
790
+ disabled: disabled || readonly,
791
+ autoFocus: autofocus,
792
+ checked: typeof value === "undefined" ? false : checked,
793
+ onChange: _onChange,
794
+ onBlur: _onBlur,
795
+ onFocus: _onFocus,
796
+ required,
797
+ "aria-describedby": (0, import_utils16.ariaDescribedByIds)(id)
798
+ }
799
+ ),
800
+ (0, import_utils16.labelValue)(/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Label, { id, text: label }), hideLabel, false)
801
+ ] })
802
+ ] });
803
+ }
804
+
805
+ // src/CheckboxesWidget/CheckboxesWidget.tsx
806
+ var import_checkbox2 = require("primereact/checkbox");
807
+ var import_utils17 = require("@rjsf/utils");
808
+ var import_jsx_runtime21 = require("react/jsx-runtime");
809
+ function CheckboxesWidget(props) {
810
+ const {
811
+ id,
812
+ disabled,
813
+ options,
814
+ value,
815
+ autofocus,
816
+ readonly,
817
+ onChange,
818
+ onBlur,
819
+ onFocus,
820
+ schema,
821
+ uiSchema,
822
+ registry,
823
+ hideLabel
824
+ } = props;
825
+ const { enumOptions, enumDisabled } = options;
826
+ const primeProps = options.prime || {};
827
+ const checkboxesValues = Array.isArray(value) ? value : [value];
828
+ const _onChange = (index) => (e) => {
829
+ if (e.checked) {
830
+ onChange((0, import_utils17.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
831
+ } else {
832
+ onChange((0, import_utils17.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
833
+ }
834
+ };
835
+ const DescriptionFieldTemplate = (0, import_utils17.getTemplate)(
836
+ "DescriptionFieldTemplate",
837
+ registry,
838
+ options
839
+ );
840
+ const _onBlur = () => onBlur(id, value);
841
+ const _onFocus = () => onFocus(id, value);
842
+ const description = options.description ?? schema.description;
843
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
844
+ "div",
845
+ {
846
+ id,
847
+ style: { display: "flex", flexDirection: "column", gap: "1rem", marginTop: "0.5rem", marginBottom: "0.5rem" },
848
+ children: [
849
+ !hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
850
+ DescriptionFieldTemplate,
851
+ {
852
+ id: (0, import_utils17.descriptionId)(id),
853
+ description,
854
+ schema,
855
+ uiSchema,
856
+ registry
857
+ }
858
+ ),
859
+ Array.isArray(enumOptions) && enumOptions.map((option, index) => {
860
+ const checked = (0, import_utils17.enumOptionsIsSelected)(option.value, checkboxesValues);
861
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
862
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
863
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
864
+ import_checkbox2.Checkbox,
865
+ {
866
+ inputId: (0, import_utils17.optionId)(id, index),
867
+ name: id,
868
+ ...primeProps,
869
+ value: option.value,
870
+ checked,
871
+ disabled: disabled || itemDisabled || readonly,
872
+ autoFocus: autofocus && index === 0,
873
+ onChange: _onChange(index),
874
+ onBlur: _onBlur,
875
+ onFocus: _onFocus,
876
+ "aria-describedby": (0, import_utils17.ariaDescribedByIds)(id)
877
+ }
878
+ ),
879
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Label, { id: (0, import_utils17.optionId)(id, index), text: option.label })
880
+ ] }, index);
881
+ })
882
+ ]
883
+ }
884
+ );
885
+ }
886
+
887
+ // src/ColorWidget/ColorWidget.tsx
888
+ var import_utils18 = require("@rjsf/utils");
889
+ var import_colorpicker = require("primereact/colorpicker");
890
+ var import_jsx_runtime22 = require("react/jsx-runtime");
891
+ function ColorWidget(props) {
892
+ const {
893
+ id,
894
+ placeholder,
895
+ value,
896
+ required,
897
+ readonly,
898
+ disabled,
899
+ onChange,
900
+ onChangeOverride,
901
+ onBlur,
902
+ onFocus,
903
+ autofocus,
904
+ options,
905
+ schema,
906
+ type
907
+ } = props;
908
+ const inputProps = (0, import_utils18.getInputProps)(schema, type, options);
909
+ const { inline } = options;
910
+ const primeProps = options.prime || {};
911
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
912
+ const _onBlur = () => onBlur && onBlur(id, value);
913
+ const _onFocus = () => onFocus && onFocus(id, value);
914
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
915
+ import_colorpicker.ColorPicker,
916
+ {
917
+ id,
918
+ name: id,
919
+ placeholder,
920
+ ...primeProps,
921
+ ...inputProps,
922
+ required,
923
+ inline,
924
+ autoFocus: autofocus,
925
+ disabled: disabled || readonly,
926
+ value: value || "",
927
+ onChange: onChangeOverride || _onChange,
928
+ onBlur: _onBlur,
929
+ onFocus: _onFocus,
930
+ "aria-describedby": (0, import_utils18.ariaDescribedByIds)(id, !!schema.examples)
931
+ }
932
+ );
933
+ }
934
+
935
+ // src/PasswordWidget/PasswordWidget.tsx
936
+ var import_utils19 = require("@rjsf/utils");
937
+ var import_password = require("primereact/password");
938
+ var import_jsx_runtime23 = require("react/jsx-runtime");
939
+ function PasswordWidget(props) {
940
+ const {
941
+ id,
942
+ placeholder,
943
+ value,
944
+ required,
945
+ readonly,
946
+ disabled,
947
+ onChange,
948
+ onChangeOverride,
949
+ onBlur,
950
+ onFocus,
951
+ autofocus,
952
+ options,
953
+ schema,
954
+ type,
955
+ rawErrors = []
956
+ } = props;
957
+ const inputProps = (0, import_utils19.getInputProps)(schema, type, options);
958
+ const primeProps = options.prime || {};
959
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
960
+ const _onBlur = () => onBlur && onBlur(id, value);
961
+ const _onFocus = () => onFocus && onFocus(id, value);
962
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
963
+ import_password.Password,
964
+ {
965
+ id,
966
+ name: id,
967
+ placeholder,
968
+ ...primeProps,
969
+ ...inputProps,
970
+ required,
971
+ autoFocus: autofocus,
972
+ disabled: disabled || readonly,
973
+ value: value || "",
974
+ invalid: rawErrors.length > 0,
975
+ onChange: onChangeOverride || _onChange,
976
+ onBlur: _onBlur,
977
+ onFocus: _onFocus,
978
+ "aria-describedby": (0, import_utils19.ariaDescribedByIds)(id, !!schema.examples),
979
+ pt: { root: { style: { display: "flex", flexDirection: "column" } } }
980
+ }
981
+ );
982
+ }
983
+
984
+ // src/RadioWidget/RadioWidget.tsx
985
+ var import_utils20 = require("@rjsf/utils");
986
+ var import_radiobutton = require("primereact/radiobutton");
987
+ var import_jsx_runtime24 = require("react/jsx-runtime");
988
+ function RadioWidget(props) {
989
+ const { id, value, disabled, readonly, onChange, onBlur, onFocus, options } = props;
990
+ const primeProps = options.prime || {};
991
+ const { enumOptions, enumDisabled, emptyValue } = options;
992
+ const _onChange = (e) => {
993
+ onChange((0, import_utils20.enumOptionsValueForIndex)(e.value, enumOptions, emptyValue));
994
+ };
995
+ const _onBlur = () => onBlur(id, value);
996
+ const _onFocus = () => onFocus(id, value);
997
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { display: "flex", flexDirection: "row", gap: "1rem" }, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
998
+ const checked = (0, import_utils20.enumOptionsIsSelected)(option.value, value);
999
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
1000
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
1001
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1002
+ import_radiobutton.RadioButton,
1003
+ {
1004
+ inputId: (0, import_utils20.optionId)(id, index),
1005
+ name: id,
1006
+ ...primeProps,
1007
+ onFocus: _onFocus,
1008
+ onBlur: _onBlur,
1009
+ onChange: _onChange,
1010
+ value: String(index),
1011
+ checked,
1012
+ disabled: disabled || itemDisabled || readonly,
1013
+ "aria-describedby": (0, import_utils20.ariaDescribedByIds)(id)
1014
+ }
1015
+ ),
1016
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: (0, import_utils20.optionId)(id, index), style: { marginLeft: "8px" }, children: option.label })
1017
+ ] }, index);
1018
+ }) });
1019
+ }
1020
+
1021
+ // src/RangeWidget/RangeWidget.tsx
1022
+ var import_slider = require("primereact/slider");
1023
+ var import_utils21 = require("@rjsf/utils");
1024
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1025
+ function RangeWidget(props) {
1026
+ const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, id } = props;
1027
+ const primeProps = options.prime || {};
1028
+ const sliderProps = { value, id, ...(0, import_utils21.rangeSpec)(schema) };
1029
+ const _onChange = (e) => {
1030
+ onChange(e.value ?? options.emptyValue);
1031
+ };
1032
+ const _onBlur = ({ target }) => onBlur(id, target && target.value);
1033
+ const _onFocus = ({ target }) => onFocus(id, target && target.value);
1034
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1035
+ import_slider.Slider,
1036
+ {
1037
+ ...primeProps,
1038
+ disabled: disabled || readonly,
1039
+ onMouseDown: (e) => e.stopPropagation(),
1040
+ onChange: _onChange,
1041
+ onBlur: _onBlur,
1042
+ onFocus: _onFocus,
1043
+ ...sliderProps,
1044
+ "aria-describedby": (0, import_utils21.ariaDescribedByIds)(id)
1045
+ }
1046
+ ) });
1047
+ }
1048
+
1049
+ // src/SelectWidget/SelectWidget.tsx
1050
+ var import_dropdown = require("primereact/dropdown");
1051
+ var import_utils22 = require("@rjsf/utils");
1052
+ var import_multiselect = require("primereact/multiselect");
1053
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1054
+ function SelectWidget(props) {
1055
+ const { multiple = false } = props;
1056
+ return multiple ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(MultiSelectWidget, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SingleSelectWidget, { ...props });
1057
+ }
1058
+ function SingleSelectWidget({
1059
+ schema,
1060
+ id,
1061
+ name,
1062
+ // remove this from dropdownProps
1063
+ options,
1064
+ label,
1065
+ hideLabel,
1066
+ required,
1067
+ disabled,
1068
+ placeholder,
1069
+ readonly,
1070
+ value,
1071
+ multiple,
1072
+ autofocus,
1073
+ onChange,
1074
+ onBlur,
1075
+ onFocus,
1076
+ errorSchema,
1077
+ rawErrors = [],
1078
+ registry,
1079
+ uiSchema,
1080
+ hideError,
1081
+ formContext,
1082
+ ...dropdownProps
1083
+ }) {
1084
+ const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
1085
+ const primeProps = options.prime || {};
1086
+ multiple = typeof multiple === "undefined" ? false : multiple;
1087
+ const emptyValue = multiple ? [] : "";
1088
+ const isEmpty = typeof value === "undefined" || multiple && value.length < 1 || !multiple && value === emptyValue;
1089
+ const _onChange = (e) => onChange((0, import_utils22.enumOptionsValueForIndex)(e.value, enumOptions, optEmptyVal));
1090
+ const _onBlur = ({ target }) => onBlur(id, (0, import_utils22.enumOptionsValueForIndex)(target && target.value, enumOptions, optEmptyVal));
1091
+ const _onFocus = ({ target }) => onFocus(id, (0, import_utils22.enumOptionsValueForIndex)(target && target.value, enumOptions, optEmptyVal));
1092
+ const selectedIndexes = (0, import_utils22.enumOptionsIndexForValue)(value, enumOptions, multiple);
1093
+ const { ...dropdownRemainingProps } = dropdownProps;
1094
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1095
+ import_dropdown.Dropdown,
1096
+ {
1097
+ id,
1098
+ name: id,
1099
+ ...primeProps,
1100
+ value: !isEmpty && typeof selectedIndexes !== "undefined" ? selectedIndexes : emptyValue,
1101
+ options: (enumOptions ?? []).map(({ value: value2, label: label2 }, i) => ({
1102
+ label: label2,
1103
+ value: String(i),
1104
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1
1105
+ })),
1106
+ onChange: _onChange,
1107
+ onBlur: _onBlur,
1108
+ onFocus: _onFocus,
1109
+ placeholder,
1110
+ disabled: disabled || readonly,
1111
+ autoFocus: autofocus,
1112
+ "aria-describedby": (0, import_utils22.ariaDescribedByIds)(id),
1113
+ ...dropdownRemainingProps
1114
+ }
1115
+ );
1116
+ }
1117
+ function MultiSelectWidget({
1118
+ id,
1119
+ options,
1120
+ disabled,
1121
+ placeholder,
1122
+ readonly,
1123
+ value,
1124
+ multiple = false,
1125
+ autofocus,
1126
+ onChange,
1127
+ onBlur,
1128
+ onFocus
1129
+ }) {
1130
+ const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
1131
+ const primeProps = options.prime || {};
1132
+ const emptyValue = multiple ? [] : "";
1133
+ const isEmpty = typeof value === "undefined" || multiple && value.length < 1 || !multiple && value === emptyValue;
1134
+ const _onChange = (e) => onChange((0, import_utils22.enumOptionsValueForIndex)(e.value, enumOptions, optEmptyVal));
1135
+ const _onBlur = ({ target }) => onBlur(id, (0, import_utils22.enumOptionsValueForIndex)(target && target.value, enumOptions, optEmptyVal));
1136
+ const _onFocus = ({ target }) => onFocus(id, (0, import_utils22.enumOptionsValueForIndex)(target && target.value, enumOptions, optEmptyVal));
1137
+ const selectedIndexes = (0, import_utils22.enumOptionsIndexForValue)(value, enumOptions, multiple);
1138
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1139
+ import_multiselect.MultiSelect,
1140
+ {
1141
+ id,
1142
+ name: id,
1143
+ ...primeProps,
1144
+ value: !isEmpty && typeof selectedIndexes !== "undefined" ? selectedIndexes : emptyValue,
1145
+ options: (enumOptions ?? []).map(({ value: value2, label }, i) => ({
1146
+ label,
1147
+ value: String(i),
1148
+ disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1
1149
+ })),
1150
+ onChange: _onChange,
1151
+ onBlur: _onBlur,
1152
+ onFocus: _onFocus,
1153
+ placeholder,
1154
+ disabled: disabled || readonly,
1155
+ autoFocus: autofocus,
1156
+ display: options.display === "chip" ? "chip" : "comma",
1157
+ "aria-describedby": (0, import_utils22.ariaDescribedByIds)(id),
1158
+ pt: { root: { style: { position: "relative" } } }
1159
+ }
1160
+ );
1161
+ }
1162
+
1163
+ // src/TextareaWidget/TextareaWidget.tsx
1164
+ var import_inputtextarea = require("primereact/inputtextarea");
1165
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1166
+ function TextareaWidget(props) {
1167
+ const { id, value, required, disabled, readonly, autofocus, onChange, onBlur, onFocus, options } = props;
1168
+ const primeProps = options.prime || {};
1169
+ let rows = 5;
1170
+ if (typeof options.rows === "string" || typeof options.rows === "number") {
1171
+ rows = Number(options.rows);
1172
+ }
1173
+ const handleChange = (event) => {
1174
+ onChange(event.target.value === "" ? options.emptyValue : event.target.value);
1175
+ };
1176
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1177
+ import_inputtextarea.InputTextarea,
1178
+ {
1179
+ id,
1180
+ ...primeProps,
1181
+ value: value || "",
1182
+ required,
1183
+ disabled: disabled || readonly,
1184
+ autoFocus: autofocus,
1185
+ rows,
1186
+ onChange: handleChange,
1187
+ onBlur: onBlur && ((event) => onBlur(id, event.target.value)),
1188
+ onFocus: onFocus && ((event) => onFocus(id, event.target.value))
1189
+ }
1190
+ );
1191
+ }
1192
+
1193
+ // src/UpDownWidget/UpDownWidget.tsx
1194
+ var import_utils23 = require("@rjsf/utils");
1195
+ var import_inputnumber = require("primereact/inputnumber");
1196
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1197
+ function UpDownWidget(props) {
1198
+ const {
1199
+ id,
1200
+ placeholder,
1201
+ value,
1202
+ required,
1203
+ readonly,
1204
+ disabled,
1205
+ onChange,
1206
+ onChangeOverride,
1207
+ onBlur,
1208
+ onFocus,
1209
+ autofocus,
1210
+ options,
1211
+ schema,
1212
+ type,
1213
+ rawErrors = []
1214
+ } = props;
1215
+ const inputProps = (0, import_utils23.getInputProps)(schema, type, options);
1216
+ const { showButtons, buttonLayout, useGrouping, minFractionDigits, maxFractionDigits, locale, currency } = options;
1217
+ const primeProps = options.prime || {};
1218
+ const _onChange = (event) => onChange(event.value === null ? options.emptyValue : value);
1219
+ const _onBlur = () => onBlur && onBlur(id, value);
1220
+ const _onFocus = () => onFocus && onFocus(id, value);
1221
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1222
+ import_inputnumber.InputNumber,
1223
+ {
1224
+ id,
1225
+ name: id,
1226
+ ...primeProps,
1227
+ placeholder,
1228
+ step: isNaN(Number(inputProps.step)) ? 1 : Number(inputProps.step),
1229
+ required,
1230
+ autoFocus: autofocus,
1231
+ disabled: disabled || readonly,
1232
+ style: buttonLayout === "vertical" ? { width: "4em" } : {},
1233
+ showButtons: typeof showButtons === "undefined" ? true : !!showButtons,
1234
+ buttonLayout: buttonLayout ?? "stacked",
1235
+ useGrouping: !!useGrouping,
1236
+ minFractionDigits,
1237
+ maxFractionDigits,
1238
+ locale,
1239
+ mode: currency ? "currency" : "decimal",
1240
+ currency,
1241
+ value: isNaN(Number(value)) ? null : Number(value),
1242
+ invalid: rawErrors.length > 0,
1243
+ onChange: onChangeOverride || _onChange,
1244
+ onBlur: _onBlur,
1245
+ onFocus: _onFocus,
1246
+ "aria-describedby": (0, import_utils23.ariaDescribedByIds)(id, !!schema.examples)
1247
+ }
1248
+ );
1249
+ }
1250
+
1251
+ // src/Widgets/Widgets.tsx
1252
+ function generateWidgets() {
1253
+ return {
1254
+ AutoCompleteWidget,
1255
+ CheckboxWidget,
1256
+ CheckboxesWidget,
1257
+ ColorWidget,
1258
+ PasswordWidget,
1259
+ RadioWidget,
1260
+ RangeWidget,
1261
+ SelectWidget,
1262
+ TextareaWidget,
1263
+ UpDownWidget
1264
+ };
1265
+ }
1266
+ var Widgets_default = generateWidgets();
1267
+
1268
+ // src/Theme/Theme.ts
1269
+ function generateTheme() {
1270
+ return {
1271
+ templates: generateTemplates(),
1272
+ widgets: generateWidgets()
1273
+ };
1274
+ }
1275
+ var Theme_default = generateTheme();
1276
+
1277
+ // src/PrimeForm/PrimeForm.ts
1278
+ function generateForm() {
1279
+ return (0, import_core2.withTheme)(generateTheme());
1280
+ }
1281
+ var PrimeForm_default = generateForm();
1282
+
1283
+ // src/index.ts
1284
+ var index_default = PrimeForm_default;
1285
+ //# sourceMappingURL=index.js.map