@rjsf/semantic-ui 5.11.1 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/dist/index.js +1128 -5
  2. package/dist/index.js.map +7 -0
  3. package/dist/semantic-ui.esm.js +641 -809
  4. package/dist/semantic-ui.esm.js.map +7 -1
  5. package/dist/semantic-ui.umd.js +997 -0
  6. package/lib/AddButton/AddButton.d.ts +5 -0
  7. package/lib/AddButton/AddButton.js +12 -0
  8. package/lib/AddButton/AddButton.js.map +1 -0
  9. package/lib/AddButton/index.d.ts +2 -0
  10. package/lib/AddButton/index.js +3 -0
  11. package/lib/AddButton/index.js.map +1 -0
  12. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +7 -0
  13. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +21 -0
  14. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -0
  15. package/lib/ArrayFieldItemTemplate/index.d.ts +2 -0
  16. package/lib/ArrayFieldItemTemplate/index.js +3 -0
  17. package/lib/ArrayFieldItemTemplate/index.js.map +1 -0
  18. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +7 -0
  19. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +40 -0
  20. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -0
  21. package/lib/ArrayFieldTemplate/index.d.ts +2 -0
  22. package/lib/ArrayFieldTemplate/index.js +3 -0
  23. package/lib/ArrayFieldTemplate/index.js.map +1 -0
  24. package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +9 -0
  25. package/lib/BaseInputTemplate/BaseInputTemplate.js +28 -0
  26. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -0
  27. package/lib/BaseInputTemplate/index.d.ts +2 -0
  28. package/lib/BaseInputTemplate/index.js +3 -0
  29. package/lib/BaseInputTemplate/index.js.map +1 -0
  30. package/lib/CheckboxWidget/CheckboxWidget.d.ts +8 -0
  31. package/lib/CheckboxWidget/CheckboxWidget.js +33 -0
  32. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -0
  33. package/lib/CheckboxWidget/index.d.ts +2 -0
  34. package/lib/CheckboxWidget/index.js +3 -0
  35. package/lib/CheckboxWidget/index.js.map +1 -0
  36. package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +8 -0
  37. package/lib/CheckboxesWidget/CheckboxesWidget.js +42 -0
  38. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -0
  39. package/lib/CheckboxesWidget/index.d.ts +2 -0
  40. package/lib/CheckboxesWidget/index.js +3 -0
  41. package/lib/CheckboxesWidget/index.js.map +1 -0
  42. package/lib/DescriptionField/DescriptionField.d.ts +7 -0
  43. package/lib/DescriptionField/DescriptionField.js +13 -0
  44. package/lib/DescriptionField/DescriptionField.js.map +1 -0
  45. package/lib/DescriptionField/index.d.ts +2 -0
  46. package/lib/DescriptionField/index.js +3 -0
  47. package/lib/DescriptionField/index.js.map +1 -0
  48. package/lib/ErrorList/ErrorList.d.ts +7 -0
  49. package/lib/ErrorList/ErrorList.js +12 -0
  50. package/lib/ErrorList/ErrorList.js.map +1 -0
  51. package/lib/ErrorList/index.d.ts +2 -0
  52. package/lib/ErrorList/index.js +3 -0
  53. package/lib/ErrorList/index.js.map +1 -0
  54. package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +7 -0
  55. package/lib/FieldErrorTemplate/FieldErrorTemplate.js +30 -0
  56. package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -0
  57. package/lib/FieldErrorTemplate/index.d.ts +2 -0
  58. package/lib/FieldErrorTemplate/index.js +3 -0
  59. package/lib/FieldErrorTemplate/index.js.map +1 -0
  60. package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +7 -0
  61. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +16 -0
  62. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -0
  63. package/lib/FieldHelpTemplate/index.d.ts +2 -0
  64. package/lib/FieldHelpTemplate/index.js +3 -0
  65. package/lib/FieldHelpTemplate/index.js.map +1 -0
  66. package/lib/FieldTemplate/FieldTemplate.d.ts +8 -0
  67. package/lib/FieldTemplate/FieldTemplate.js +22 -0
  68. package/lib/FieldTemplate/FieldTemplate.js.map +1 -0
  69. package/lib/FieldTemplate/index.d.ts +2 -0
  70. package/lib/FieldTemplate/index.js +3 -0
  71. package/lib/FieldTemplate/index.js.map +1 -0
  72. package/lib/IconButton/IconButton.d.ts +8 -0
  73. package/lib/IconButton/IconButton.js +26 -0
  74. package/lib/IconButton/IconButton.js.map +1 -0
  75. package/lib/IconButton/index.d.ts +2 -0
  76. package/lib/IconButton/index.js +3 -0
  77. package/lib/IconButton/index.js.map +1 -0
  78. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +9 -0
  79. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +23 -0
  80. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -0
  81. package/lib/ObjectFieldTemplate/index.d.ts +2 -0
  82. package/lib/ObjectFieldTemplate/index.js +3 -0
  83. package/lib/ObjectFieldTemplate/index.js.map +1 -0
  84. package/lib/RadioWidget/RadioWidget.d.ts +8 -0
  85. package/lib/RadioWidget/RadioWidget.js +32 -0
  86. package/lib/RadioWidget/RadioWidget.js.map +1 -0
  87. package/lib/RadioWidget/index.d.ts +2 -0
  88. package/lib/RadioWidget/index.js +3 -0
  89. package/lib/RadioWidget/index.js.map +1 -0
  90. package/lib/RangeWidget/RangeWidget.d.ts +8 -0
  91. package/lib/RangeWidget/RangeWidget.js +26 -0
  92. package/lib/RangeWidget/RangeWidget.js.map +1 -0
  93. package/lib/RangeWidget/index.d.ts +2 -0
  94. package/lib/RangeWidget/index.js +3 -0
  95. package/lib/RangeWidget/index.js.map +1 -0
  96. package/lib/SelectWidget/SelectWidget.d.ts +8 -0
  97. package/lib/SelectWidget/SelectWidget.js +51 -0
  98. package/lib/SelectWidget/SelectWidget.js.map +1 -0
  99. package/lib/SelectWidget/index.d.ts +2 -0
  100. package/lib/SelectWidget/index.js +3 -0
  101. package/lib/SelectWidget/index.js.map +1 -0
  102. package/lib/SemanticUIForm/SemanticUIForm.d.ts +6 -0
  103. package/lib/SemanticUIForm/SemanticUIForm.js +7 -0
  104. package/lib/SemanticUIForm/SemanticUIForm.js.map +1 -0
  105. package/lib/SemanticUIForm/index.d.ts +2 -0
  106. package/lib/SemanticUIForm/index.js +3 -0
  107. package/lib/SemanticUIForm/index.js.map +1 -0
  108. package/lib/SubmitButton/SubmitButton.d.ts +5 -0
  109. package/lib/SubmitButton/SubmitButton.js +13 -0
  110. package/lib/SubmitButton/SubmitButton.js.map +1 -0
  111. package/lib/SubmitButton/index.d.ts +2 -0
  112. package/lib/SubmitButton/index.js +3 -0
  113. package/lib/SubmitButton/index.js.map +1 -0
  114. package/lib/Templates/Templates.d.ts +4 -0
  115. package/lib/Templates/Templates.js +39 -0
  116. package/lib/Templates/Templates.js.map +1 -0
  117. package/lib/Templates/index.d.ts +2 -0
  118. package/lib/Templates/index.js +3 -0
  119. package/lib/Templates/index.js.map +1 -0
  120. package/lib/TextareaWidget/TextareaWidget.d.ts +7 -0
  121. package/lib/TextareaWidget/TextareaWidget.js +22 -0
  122. package/lib/TextareaWidget/TextareaWidget.js.map +1 -0
  123. package/lib/TextareaWidget/index.d.ts +2 -0
  124. package/lib/TextareaWidget/index.js +3 -0
  125. package/lib/TextareaWidget/index.js.map +1 -0
  126. package/lib/Theme/Theme.d.ts +5 -0
  127. package/lib/Theme/Theme.js +12 -0
  128. package/lib/Theme/Theme.js.map +1 -0
  129. package/lib/Theme/index.d.ts +2 -0
  130. package/lib/Theme/index.js +3 -0
  131. package/lib/Theme/index.js.map +1 -0
  132. package/lib/TitleField/TitleField.d.ts +7 -0
  133. package/lib/TitleField/TitleField.js +22 -0
  134. package/lib/TitleField/TitleField.js.map +1 -0
  135. package/lib/TitleField/index.d.ts +2 -0
  136. package/lib/TitleField/index.js +3 -0
  137. package/lib/TitleField/index.js.map +1 -0
  138. package/lib/Widgets/Widgets.d.ts +4 -0
  139. package/lib/Widgets/Widgets.js +18 -0
  140. package/lib/Widgets/Widgets.js.map +1 -0
  141. package/lib/Widgets/index.d.ts +2 -0
  142. package/lib/Widgets/index.js +3 -0
  143. package/lib/Widgets/index.js.map +1 -0
  144. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +8 -0
  145. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +23 -0
  146. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -0
  147. package/lib/WrapIfAdditionalTemplate/index.d.ts +2 -0
  148. package/lib/WrapIfAdditionalTemplate/index.js +3 -0
  149. package/lib/WrapIfAdditionalTemplate/index.js.map +1 -0
  150. package/lib/index.d.ts +6 -0
  151. package/lib/index.js +7 -0
  152. package/lib/index.js.map +1 -0
  153. package/lib/util.d.ts +60 -0
  154. package/lib/util.js +69 -0
  155. package/lib/util.js.map +1 -0
  156. package/package.json +23 -15
  157. package/src/AddButton/AddButton.tsx +24 -0
  158. package/src/AddButton/index.ts +2 -0
  159. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +102 -0
  160. package/src/ArrayFieldItemTemplate/index.ts +2 -0
  161. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +114 -0
  162. package/src/ArrayFieldTemplate/index.ts +2 -0
  163. package/src/BaseInputTemplate/BaseInputTemplate.tsx +90 -0
  164. package/src/BaseInputTemplate/index.ts +2 -0
  165. package/src/CheckboxWidget/CheckboxWidget.tsx +95 -0
  166. package/src/CheckboxWidget/index.ts +2 -0
  167. package/src/CheckboxesWidget/CheckboxesWidget.tsx +102 -0
  168. package/src/CheckboxesWidget/index.ts +2 -0
  169. package/src/DescriptionField/DescriptionField.tsx +21 -0
  170. package/src/DescriptionField/index.ts +2 -0
  171. package/src/ErrorList/ErrorList.tsx +23 -0
  172. package/src/ErrorList/index.ts +2 -0
  173. package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +43 -0
  174. package/src/FieldErrorTemplate/index.ts +2 -0
  175. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +19 -0
  176. package/src/FieldHelpTemplate/index.ts +2 -0
  177. package/src/FieldTemplate/FieldTemplate.tsx +77 -0
  178. package/src/FieldTemplate/index.ts +2 -0
  179. package/src/IconButton/IconButton.tsx +55 -0
  180. package/src/IconButton/index.ts +2 -0
  181. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +94 -0
  182. package/src/ObjectFieldTemplate/index.ts +2 -0
  183. package/src/RadioWidget/RadioWidget.tsx +78 -0
  184. package/src/RadioWidget/index.ts +2 -0
  185. package/src/RangeWidget/RangeWidget.tsx +65 -0
  186. package/src/RangeWidget/index.ts +2 -0
  187. package/src/SelectWidget/SelectWidget.tsx +111 -0
  188. package/src/SelectWidget/index.ts +2 -0
  189. package/src/SemanticUIForm/SemanticUIForm.ts +15 -0
  190. package/src/SemanticUIForm/index.ts +2 -0
  191. package/src/SubmitButton/SubmitButton.tsx +20 -0
  192. package/src/SubmitButton/index.ts +2 -0
  193. package/src/Templates/Templates.ts +46 -0
  194. package/src/Templates/index.ts +2 -0
  195. package/src/TextareaWidget/TextareaWidget.tsx +69 -0
  196. package/src/TextareaWidget/index.ts +2 -0
  197. package/src/Theme/Theme.ts +20 -0
  198. package/src/Theme/index.ts +2 -0
  199. package/src/TitleField/TitleField.tsx +32 -0
  200. package/src/TitleField/index.ts +2 -0
  201. package/src/Widgets/Widgets.tsx +25 -0
  202. package/src/Widgets/index.ts +2 -0
  203. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +95 -0
  204. package/src/WrapIfAdditionalTemplate/index.ts +2 -0
  205. package/src/index.ts +8 -0
  206. package/src/util.tsx +126 -0
  207. package/dist/index.d.ts +0 -17
  208. package/dist/semantic-ui.cjs.development.js +0 -1335
  209. package/dist/semantic-ui.cjs.development.js.map +0 -1
  210. package/dist/semantic-ui.cjs.production.min.js +0 -2
  211. package/dist/semantic-ui.cjs.production.min.js.map +0 -1
  212. package/dist/semantic-ui.umd.development.js +0 -1333
  213. package/dist/semantic-ui.umd.development.js.map +0 -1
  214. package/dist/semantic-ui.umd.production.min.js +0 -2
  215. package/dist/semantic-ui.umd.production.min.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,8 +1,1131 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
29
 
2
- 'use strict'
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ Form: () => SemanticUIForm_default,
34
+ Templates: () => Templates_default,
35
+ Theme: () => Theme_default,
36
+ Widgets: () => Widgets_default,
37
+ default: () => src_default,
38
+ generateForm: () => generateForm,
39
+ generateTemplates: () => generateTemplates,
40
+ generateTheme: () => generateTheme,
41
+ generateWidgets: () => generateWidgets
42
+ });
43
+ module.exports = __toCommonJS(src_exports);
3
44
 
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./semantic-ui.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./semantic-ui.cjs.development.js')
45
+ // src/SemanticUIForm/SemanticUIForm.ts
46
+ var import_core = require("@rjsf/core");
47
+
48
+ // src/Theme/Theme.ts
49
+ var import_semantic_ui_react19 = require("semantic-ui-react");
50
+
51
+ // src/AddButton/AddButton.tsx
52
+ var import_semantic_ui_react = require("semantic-ui-react");
53
+ var import_utils = require("@rjsf/utils");
54
+ var import_jsx_runtime = require("react/jsx-runtime");
55
+ function AddButton({
56
+ uiSchema,
57
+ registry,
58
+ color,
59
+ ...props
60
+ }) {
61
+ const { translateString } = registry;
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
+ import_semantic_ui_react.Button,
64
+ {
65
+ title: translateString(import_utils.TranslatableString.AddItemButton),
66
+ color,
67
+ ...props,
68
+ icon: true,
69
+ size: "tiny",
70
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_semantic_ui_react.Icon, { name: "plus" })
71
+ }
72
+ );
73
+ }
74
+
75
+ // src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
76
+ var import_utils3 = require("@rjsf/utils");
77
+ var import_semantic_ui_react2 = require("semantic-ui-react");
78
+
79
+ // src/util.tsx
80
+ var import_utils2 = require("@rjsf/utils");
81
+ var import_jsx_runtime2 = require("react/jsx-runtime");
82
+ function getSemanticProps({
83
+ formContext = {},
84
+ uiSchema = {},
85
+ options = {},
86
+ defaultSchemaProps = { fluid: true, inverted: false },
87
+ defaultContextProps = {}
88
+ }) {
89
+ const formContextProps = formContext.semantic;
90
+ const schemaProps = (0, import_utils2.getUiOptions)(uiSchema).semantic;
91
+ const optionProps = options.semantic;
92
+ return Object.assign(
93
+ {},
94
+ { ...defaultSchemaProps },
95
+ { ...defaultContextProps },
96
+ schemaProps,
97
+ optionProps,
98
+ formContextProps
99
+ );
100
+ }
101
+ function getSemanticErrorProps({
102
+ formContext = {},
103
+ uiSchema = {},
104
+ options = {},
105
+ defaultProps = { size: "small", pointing: "above" }
106
+ }) {
107
+ const formContextProps = formContext.semantic && formContext.semantic.errorOptions;
108
+ const semanticOptions = (0, import_utils2.getUiOptions)(uiSchema).semantic;
109
+ const schemaProps = semanticOptions && semanticOptions.errorOptions;
110
+ const optionProps = options.semantic && options.semantic.errorOptions;
111
+ return Object.assign({}, { ...defaultProps }, schemaProps, optionProps, formContextProps);
112
+ }
113
+ function cleanClassNames(classNameArr, omit = []) {
114
+ const classList = classNameArr.filter(Boolean).reduce((previous, current) => previous.concat(current.trim().split(/\s+/)), []);
115
+ return [...new Set(classList.filter((cn) => !omit.includes(cn)))].join(" ");
116
+ }
117
+ function MaybeWrap({ wrap, component: Component = "div", ...props }) {
118
+ return wrap ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Component, { ...props }) : props.children;
119
+ }
120
+
121
+ // src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
122
+ var import_jsx_runtime3 = require("react/jsx-runtime");
123
+ var gridStyle = (vertical) => ({
124
+ display: "grid",
125
+ gridTemplateColumns: `1fr ${vertical ? 65 : 150}px`
126
+ });
127
+ function ArrayFieldItemTemplate(props) {
128
+ const {
129
+ children,
130
+ disabled,
131
+ hasToolbar,
132
+ hasCopy,
133
+ hasMoveDown,
134
+ hasMoveUp,
135
+ hasRemove,
136
+ index,
137
+ onCopyIndexClick,
138
+ onDropIndexClick,
139
+ onReorderClick,
140
+ readonly,
141
+ uiSchema,
142
+ registry
143
+ } = props;
144
+ const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
145
+ const uiOptions = (0, import_utils3.getUiOptions)(uiSchema);
146
+ const { horizontalButtons = true, wrapItem = false } = uiOptions.semantic;
147
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "array-item", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MaybeWrap, { wrap: wrapItem, component: import_semantic_ui_react2.Segment, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_semantic_ui_react2.Grid, { style: { ...gridStyle(!horizontalButtons), alignItems: "center" }, children: [
148
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_semantic_ui_react2.Grid.Column, { width: 16, verticalAlign: "middle", children }),
149
+ hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_semantic_ui_react2.Grid.Column, { children: (hasMoveUp || hasMoveDown || hasRemove) && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_semantic_ui_react2.Button.Group, { size: "mini", vertical: !horizontalButtons, children: [
150
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
151
+ MoveUpButton2,
152
+ {
153
+ className: "array-item-move-up",
154
+ disabled: disabled || readonly || !hasMoveUp,
155
+ onClick: onReorderClick(index, index - 1),
156
+ uiSchema,
157
+ registry
158
+ }
159
+ ),
160
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
161
+ MoveDownButton2,
162
+ {
163
+ className: "array-item-move-down",
164
+ disabled: disabled || readonly || !hasMoveDown,
165
+ onClick: onReorderClick(index, index + 1),
166
+ uiSchema,
167
+ registry
168
+ }
169
+ ),
170
+ hasCopy && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
171
+ CopyButton2,
172
+ {
173
+ className: "array-item-copy",
174
+ disabled: disabled || readonly,
175
+ onClick: onCopyIndexClick(index),
176
+ uiSchema,
177
+ registry
178
+ }
179
+ ),
180
+ hasRemove && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
181
+ RemoveButton2,
182
+ {
183
+ className: "array-item-remove",
184
+ disabled: disabled || readonly,
185
+ onClick: onDropIndexClick(index),
186
+ uiSchema,
187
+ registry
188
+ }
189
+ )
190
+ ] }) })
191
+ ] }) }) });
192
+ }
193
+
194
+ // src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
195
+ var import_utils4 = require("@rjsf/utils");
196
+ var import_jsx_runtime4 = require("react/jsx-runtime");
197
+ function ArrayFieldTemplate(props) {
198
+ const {
199
+ uiSchema,
200
+ idSchema,
201
+ canAdd,
202
+ className,
203
+ // classNames, This is not part of the type, so it is likely never passed in
204
+ disabled,
205
+ formContext,
206
+ items,
207
+ onAddClick,
208
+ // options, This is not part of the type, so it is likely never passed in
209
+ readonly,
210
+ required,
211
+ schema,
212
+ title,
213
+ registry
214
+ } = props;
215
+ const semanticProps = getSemanticProps({
216
+ uiSchema,
217
+ formContext,
218
+ defaultSchemaProps: { horizontalButtons: true, wrapItem: false }
219
+ });
220
+ const { horizontalButtons, wrapItem } = semanticProps;
221
+ const semantic = { horizontalButtons, wrapItem };
222
+ const uiOptions = (0, import_utils4.getUiOptions)(uiSchema);
223
+ const ArrayFieldDescriptionTemplate = (0, import_utils4.getTemplate)(
224
+ "ArrayFieldDescriptionTemplate",
225
+ registry,
226
+ uiOptions
227
+ );
228
+ const ArrayFieldItemTemplate2 = (0, import_utils4.getTemplate)(
229
+ "ArrayFieldItemTemplate",
230
+ registry,
231
+ uiOptions
232
+ );
233
+ const ArrayFieldTitleTemplate = (0, import_utils4.getTemplate)(
234
+ "ArrayFieldTitleTemplate",
235
+ registry,
236
+ uiOptions
237
+ );
238
+ const {
239
+ ButtonTemplates: { AddButton: AddButton2 }
240
+ } = registry.templates;
241
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: cleanClassNames([className, (0, import_utils4.isFixedItems)(schema) ? "" : "sortable-form-fields"]), children: [
242
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
243
+ ArrayFieldTitleTemplate,
244
+ {
245
+ idSchema,
246
+ title: uiOptions.title || title,
247
+ schema,
248
+ uiSchema,
249
+ required,
250
+ registry
251
+ }
252
+ ),
253
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
254
+ ArrayFieldDescriptionTemplate,
255
+ {
256
+ idSchema,
257
+ description: uiOptions.description || schema.description,
258
+ schema,
259
+ uiSchema,
260
+ registry
261
+ }
262
+ ),
263
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
264
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "row array-item-list", children: items && items.map(({ key, uiSchema: itemUiSchema = {}, ...props2 }) => {
265
+ const mergedUiSchema = {
266
+ ...itemUiSchema,
267
+ [import_utils4.UI_OPTIONS_KEY]: {
268
+ ...itemUiSchema[import_utils4.UI_OPTIONS_KEY],
269
+ semantic
270
+ }
271
+ };
272
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ArrayFieldItemTemplate2, { ...props2, uiSchema: mergedUiSchema }, key);
273
+ }) }),
274
+ canAdd && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
275
+ "div",
276
+ {
277
+ style: {
278
+ marginTop: "1rem",
279
+ position: "relative",
280
+ textAlign: "right"
281
+ },
282
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AddButton2, { onClick: onAddClick, disabled: disabled || readonly, uiSchema, registry })
283
+ }
284
+ )
285
+ ] }, `array-item-list-${idSchema.$id}`)
286
+ ] });
287
+ }
288
+
289
+ // src/BaseInputTemplate/BaseInputTemplate.tsx
290
+ var import_semantic_ui_react3 = require("semantic-ui-react");
291
+ var import_utils5 = require("@rjsf/utils");
292
+ var import_jsx_runtime5 = require("react/jsx-runtime");
293
+ function BaseInputTemplate(props) {
294
+ const {
295
+ id,
296
+ placeholder,
297
+ label,
298
+ hideLabel,
299
+ value,
300
+ required,
301
+ readonly,
302
+ disabled,
303
+ onChange,
304
+ onChangeOverride,
305
+ onBlur,
306
+ onFocus,
307
+ autofocus,
308
+ options,
309
+ schema,
310
+ uiSchema,
311
+ formContext,
312
+ type,
313
+ rawErrors = []
314
+ } = props;
315
+ const inputProps = (0, import_utils5.getInputProps)(schema, type, options);
316
+ const semanticProps = getSemanticProps({
317
+ uiSchema,
318
+ formContext,
319
+ options
320
+ });
321
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
322
+ const _onBlur = () => onBlur && onBlur(id, value);
323
+ const _onFocus = () => onFocus && onFocus(id, value);
324
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
325
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
326
+ import_semantic_ui_react3.Form.Input,
327
+ {
328
+ id,
329
+ name: id,
330
+ placeholder,
331
+ ...inputProps,
332
+ label: (0, import_utils5.labelValue)(label || void 0, hideLabel, false),
333
+ required,
334
+ autoFocus: autofocus,
335
+ disabled: disabled || readonly,
336
+ list: schema.examples ? (0, import_utils5.examplesId)(id) : void 0,
337
+ ...semanticProps,
338
+ value: value || value === 0 ? value : "",
339
+ error: rawErrors.length > 0,
340
+ onChange: onChangeOverride || _onChange,
341
+ onBlur: _onBlur,
342
+ onFocus: _onFocus,
343
+ "aria-describedby": (0, import_utils5.ariaDescribedByIds)(id, !!schema.examples)
344
+ },
345
+ id
346
+ ),
347
+ Array.isArray(schema.examples) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("datalist", { id: (0, import_utils5.examplesId)(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
348
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: example }, example);
349
+ }) })
350
+ ] });
351
+ }
352
+
353
+ // src/DescriptionField/DescriptionField.tsx
354
+ var import_jsx_runtime6 = require("react/jsx-runtime");
355
+ function DescriptionField(props) {
356
+ const { id, description } = props;
357
+ if (!description) {
358
+ return null;
359
+ }
360
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id, className: "sui-description", children: description });
361
+ }
362
+
363
+ // src/ErrorList/ErrorList.tsx
364
+ var import_semantic_ui_react4 = require("semantic-ui-react");
365
+ var import_utils6 = require("@rjsf/utils");
366
+ var import_jsx_runtime7 = require("react/jsx-runtime");
367
+ function ErrorList({
368
+ errors,
369
+ registry
370
+ }) {
371
+ const { translateString } = registry;
372
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_semantic_ui_react4.Message, { negative: true, children: [
373
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_semantic_ui_react4.Message.Header, { children: translateString(import_utils6.TranslatableString.ErrorsLabel) }),
374
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_semantic_ui_react4.Message.List, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_semantic_ui_react4.Message.Item, { children: error.stack }, `error-${index}`)) })
375
+ ] });
376
+ }
377
+
378
+ // src/IconButton/IconButton.tsx
379
+ var import_semantic_ui_react5 = require("semantic-ui-react");
380
+ var import_utils7 = require("@rjsf/utils");
381
+ var import_jsx_runtime8 = require("react/jsx-runtime");
382
+ function IconButton(props) {
383
+ const { icon, iconType, color, className, uiSchema, registry, ...otherProps } = props;
384
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
385
+ import_semantic_ui_react5.Button,
386
+ {
387
+ icon,
388
+ size: iconType,
389
+ color,
390
+ className,
391
+ ...otherProps
392
+ }
393
+ );
394
+ }
395
+ function CopyButton(props) {
396
+ const {
397
+ registry: { translateString }
398
+ } = props;
399
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { title: translateString(import_utils7.TranslatableString.CopyButton), ...props, icon: "copy" });
400
+ }
401
+ function MoveDownButton(props) {
402
+ const {
403
+ registry: { translateString }
404
+ } = props;
405
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { title: translateString(import_utils7.TranslatableString.MoveDownButton), ...props, icon: "angle down" });
406
+ }
407
+ function MoveUpButton(props) {
408
+ const {
409
+ registry: { translateString }
410
+ } = props;
411
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { title: translateString(import_utils7.TranslatableString.MoveUpButton), ...props, icon: "angle up" });
412
+ }
413
+ function RemoveButton(props) {
414
+ const {
415
+ registry: { translateString }
416
+ } = props;
417
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { title: translateString(import_utils7.TranslatableString.RemoveButton), ...props, icon: "trash" });
418
+ }
419
+
420
+ // src/FieldErrorTemplate/FieldErrorTemplate.tsx
421
+ var import_utils8 = require("@rjsf/utils");
422
+ var import_nanoid = require("nanoid");
423
+ var import_semantic_ui_react6 = require("semantic-ui-react");
424
+ var import_jsx_runtime9 = require("react/jsx-runtime");
425
+ var DEFAULT_OPTIONS = {
426
+ options: {
427
+ pointing: "above",
428
+ size: "small"
429
+ }
430
+ };
431
+ function FieldErrorTemplate({ errors, idSchema, uiSchema, registry }) {
432
+ const { formContext } = registry;
433
+ const options = getSemanticErrorProps({
434
+ formContext,
435
+ uiSchema,
436
+ defaultProps: DEFAULT_OPTIONS
437
+ });
438
+ const { pointing, size } = options;
439
+ if (errors && errors.length > 0) {
440
+ const id = (0, import_utils8.errorId)(idSchema);
441
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_semantic_ui_react6.Label, { id, color: "red", pointing: pointing || "above", size: size || "small", basic: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_semantic_ui_react6.List, { bulleted: true, children: errors.map((error) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_semantic_ui_react6.List.Item, { children: error }, (0, import_nanoid.nanoid)())) }) });
442
+ }
443
+ return null;
444
+ }
445
+
446
+ // src/FieldHelpTemplate/FieldHelpTemplate.tsx
447
+ var import_semantic_ui_react7 = require("semantic-ui-react");
448
+ var import_utils9 = require("@rjsf/utils");
449
+ var import_jsx_runtime10 = require("react/jsx-runtime");
450
+ function FieldHelpTemplate(props) {
451
+ const { idSchema, help } = props;
452
+ if (help) {
453
+ const id = (0, import_utils9.helpId)(idSchema);
454
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_semantic_ui_react7.Message, { size: "mini", info: true, id, content: help });
455
+ }
456
+ return null;
457
+ }
458
+
459
+ // src/FieldTemplate/FieldTemplate.tsx
460
+ var import_utils10 = require("@rjsf/utils");
461
+ var import_semantic_ui_react8 = require("semantic-ui-react");
462
+ var import_jsx_runtime11 = require("react/jsx-runtime");
463
+ function FieldTemplate(props) {
464
+ const {
465
+ id,
466
+ children,
467
+ classNames,
468
+ style,
469
+ displayLabel,
470
+ label,
471
+ errors,
472
+ help,
473
+ hidden,
474
+ description,
475
+ rawDescription,
476
+ registry,
477
+ schema,
478
+ uiSchema,
479
+ ...otherProps
480
+ } = props;
481
+ const semanticProps = getSemanticProps(otherProps);
482
+ const { wrapLabel, wrapContent } = semanticProps;
483
+ const uiOptions = (0, import_utils10.getUiOptions)(uiSchema);
484
+ const WrapIfAdditionalTemplate2 = (0, import_utils10.getTemplate)(
485
+ "WrapIfAdditionalTemplate",
486
+ registry,
487
+ uiOptions
488
+ );
489
+ if (hidden) {
490
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "none" }, children });
491
+ }
492
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
493
+ WrapIfAdditionalTemplate2,
494
+ {
495
+ classNames,
496
+ style,
497
+ id,
498
+ label,
499
+ registry,
500
+ schema,
501
+ uiSchema,
502
+ ...otherProps,
503
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_semantic_ui_react8.Form.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(MaybeWrap, { wrap: wrapContent, className: "sui-field-content", children: [
504
+ children,
505
+ displayLabel && rawDescription && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MaybeWrap, { wrap: wrapLabel, className: "sui-field-label", children: description }),
506
+ help,
507
+ errors
508
+ ] }) }, id)
509
+ }
510
+ );
8
511
  }
512
+
513
+ // src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
514
+ var import_semantic_ui_react9 = require("semantic-ui-react");
515
+ var import_utils11 = require("@rjsf/utils");
516
+ var import_jsx_runtime12 = require("react/jsx-runtime");
517
+ function ObjectFieldTemplate(props) {
518
+ const {
519
+ description,
520
+ onAddClick,
521
+ title,
522
+ properties,
523
+ disabled,
524
+ readonly,
525
+ required,
526
+ uiSchema,
527
+ schema,
528
+ formData,
529
+ idSchema,
530
+ registry
531
+ } = props;
532
+ const uiOptions = (0, import_utils11.getUiOptions)(uiSchema);
533
+ const TitleFieldTemplate = (0, import_utils11.getTemplate)("TitleFieldTemplate", registry, uiOptions);
534
+ const DescriptionFieldTemplate = (0, import_utils11.getTemplate)(
535
+ "DescriptionFieldTemplate",
536
+ registry,
537
+ uiOptions
538
+ );
539
+ const {
540
+ ButtonTemplates: { AddButton: AddButton2 }
541
+ } = registry.templates;
542
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
543
+ title && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
544
+ TitleFieldTemplate,
545
+ {
546
+ id: (0, import_utils11.titleId)(idSchema),
547
+ title,
548
+ required,
549
+ schema,
550
+ uiSchema,
551
+ registry
552
+ }
553
+ ),
554
+ description && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
555
+ DescriptionFieldTemplate,
556
+ {
557
+ id: (0, import_utils11.descriptionId)(idSchema),
558
+ description,
559
+ schema,
560
+ uiSchema,
561
+ registry
562
+ }
563
+ ),
564
+ properties.map((prop) => prop.content),
565
+ (0, import_utils11.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_semantic_ui_react9.Grid.Column, { width: 16, verticalAlign: "middle", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_semantic_ui_react9.Grid.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
566
+ "div",
567
+ {
568
+ style: {
569
+ marginTop: "1rem",
570
+ position: "relative",
571
+ textAlign: "right"
572
+ },
573
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
574
+ AddButton2,
575
+ {
576
+ onClick: onAddClick(schema),
577
+ disabled: disabled || readonly,
578
+ uiSchema,
579
+ registry
580
+ }
581
+ )
582
+ }
583
+ ) }) })
584
+ ] });
585
+ }
586
+
587
+ // src/SubmitButton/SubmitButton.tsx
588
+ var import_semantic_ui_react10 = require("semantic-ui-react");
589
+ var import_utils12 = require("@rjsf/utils");
590
+ var import_jsx_runtime13 = require("react/jsx-runtime");
591
+ function SubmitButton({ uiSchema }) {
592
+ const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils12.getSubmitButtonOptions)(uiSchema);
593
+ if (norender) {
594
+ return null;
595
+ }
596
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_semantic_ui_react10.Button, { type: "submit", primary: true, ...submitButtonProps, children: submitText });
597
+ }
598
+
599
+ // src/TitleField/TitleField.tsx
600
+ var import_semantic_ui_react11 = require("semantic-ui-react");
601
+ var import_jsx_runtime14 = require("react/jsx-runtime");
602
+ var DEFAULT_OPTIONS2 = {
603
+ inverted: false,
604
+ dividing: true
605
+ };
606
+ function TitleField({
607
+ id,
608
+ title,
609
+ uiSchema
610
+ }) {
611
+ const semanticProps = getSemanticProps({
612
+ uiSchema,
613
+ defaultSchemaProps: DEFAULT_OPTIONS2
614
+ });
615
+ if (!title) {
616
+ return null;
617
+ }
618
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_semantic_ui_react11.Header, { id, ...semanticProps, as: "h5", children: title });
619
+ }
620
+
621
+ // src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
622
+ var import_utils13 = require("@rjsf/utils");
623
+ var import_semantic_ui_react12 = require("semantic-ui-react");
624
+ var import_jsx_runtime15 = require("react/jsx-runtime");
625
+ function WrapIfAdditionalTemplate(props) {
626
+ const {
627
+ children,
628
+ classNames,
629
+ style,
630
+ disabled,
631
+ id,
632
+ label,
633
+ onDropPropertyClick,
634
+ onKeyChange,
635
+ readonly,
636
+ required,
637
+ schema,
638
+ uiSchema,
639
+ registry
640
+ } = props;
641
+ const { templates, translateString } = registry;
642
+ const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
643
+ const keyLabel = translateString(import_utils13.TranslatableString.KeyLabel, [label]);
644
+ const { readonlyAsDisabled = true, wrapperStyle } = registry.formContext;
645
+ const additional = import_utils13.ADDITIONAL_PROPERTY_FLAG in schema;
646
+ if (!additional) {
647
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: classNames, style, children });
648
+ }
649
+ const handleBlur = ({ target }) => onKeyChange(target.value);
650
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: classNames, style, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_semantic_ui_react12.Grid, { columns: "equal", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_semantic_ui_react12.Grid.Row, { children: [
651
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_semantic_ui_react12.Grid.Column, { className: "form-additional", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_semantic_ui_react12.Form.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
652
+ import_semantic_ui_react12.Form.Input,
653
+ {
654
+ className: "form-group",
655
+ hasFeedback: true,
656
+ fluid: true,
657
+ htmlFor: `${id}`,
658
+ label: keyLabel,
659
+ required,
660
+ defaultValue: label,
661
+ disabled: disabled || readonlyAsDisabled && readonly,
662
+ id: `${id}`,
663
+ name: `${id}`,
664
+ onBlur: !readonly ? handleBlur : void 0,
665
+ style: wrapperStyle,
666
+ type: "text"
667
+ }
668
+ ) }) }),
669
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_semantic_ui_react12.Grid.Column, { className: "form-additional", verticalAlign: "middle", children }),
670
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_semantic_ui_react12.Grid.Column, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
671
+ RemoveButton2,
672
+ {
673
+ iconType: "mini",
674
+ className: "array-item-remove",
675
+ disabled: disabled || readonly,
676
+ onClick: onDropPropertyClick(label),
677
+ uiSchema,
678
+ registry
679
+ }
680
+ ) })
681
+ ] }) }) }, `${id}-key`);
682
+ }
683
+
684
+ // src/Templates/Templates.ts
685
+ function generateTemplates() {
686
+ return {
687
+ ArrayFieldItemTemplate,
688
+ ArrayFieldTemplate,
689
+ BaseInputTemplate,
690
+ ButtonTemplates: {
691
+ AddButton,
692
+ CopyButton,
693
+ MoveDownButton,
694
+ MoveUpButton,
695
+ RemoveButton,
696
+ SubmitButton
697
+ },
698
+ DescriptionFieldTemplate: DescriptionField,
699
+ ErrorListTemplate: ErrorList,
700
+ FieldErrorTemplate,
701
+ FieldHelpTemplate,
702
+ FieldTemplate,
703
+ ObjectFieldTemplate,
704
+ TitleFieldTemplate: TitleField,
705
+ WrapIfAdditionalTemplate
706
+ };
707
+ }
708
+ var Templates_default = generateTemplates();
709
+
710
+ // src/CheckboxWidget/CheckboxWidget.tsx
711
+ var import_utils14 = require("@rjsf/utils");
712
+ var import_semantic_ui_react13 = require("semantic-ui-react");
713
+ var import_jsx_runtime16 = require("react/jsx-runtime");
714
+ function CheckboxWidget(props) {
715
+ const {
716
+ id,
717
+ value,
718
+ disabled,
719
+ readonly,
720
+ label = "",
721
+ hideLabel,
722
+ autofocus,
723
+ onChange,
724
+ onBlur,
725
+ options,
726
+ onFocus,
727
+ formContext,
728
+ schema,
729
+ uiSchema,
730
+ rawErrors = [],
731
+ registry
732
+ } = props;
733
+ const semanticProps = getSemanticProps({
734
+ options,
735
+ formContext,
736
+ uiSchema,
737
+ defaultSchemaProps: {
738
+ inverted: "false"
739
+ }
740
+ });
741
+ const DescriptionFieldTemplate = (0, import_utils14.getTemplate)(
742
+ "DescriptionFieldTemplate",
743
+ registry,
744
+ options
745
+ );
746
+ const required = (0, import_utils14.schemaRequiresTrueValue)(schema);
747
+ const _onChange = (_, data) => onChange && onChange(data.checked);
748
+ const _onBlur = () => onBlur && onBlur(id, value);
749
+ const _onFocus = () => onFocus && onFocus(id, value);
750
+ const checked = value == "true" || value == true;
751
+ const description = options.description ?? schema.description;
752
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
753
+ !hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
754
+ DescriptionFieldTemplate,
755
+ {
756
+ id: (0, import_utils14.descriptionId)(id),
757
+ description,
758
+ schema,
759
+ uiSchema,
760
+ registry
761
+ }
762
+ ),
763
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
764
+ import_semantic_ui_react13.Form.Checkbox,
765
+ {
766
+ id,
767
+ name: id,
768
+ disabled: disabled || readonly,
769
+ autoFocus: autofocus,
770
+ ...semanticProps,
771
+ checked: typeof value === "undefined" ? false : checked,
772
+ error: rawErrors.length > 0,
773
+ onChange: _onChange,
774
+ onBlur: _onBlur,
775
+ onFocus: _onFocus,
776
+ required,
777
+ label: (0, import_utils14.labelValue)(label, hideLabel, false),
778
+ "aria-describedby": (0, import_utils14.ariaDescribedByIds)(id)
779
+ }
780
+ )
781
+ ] });
782
+ }
783
+
784
+ // src/CheckboxesWidget/CheckboxesWidget.tsx
785
+ var import_semantic_ui_react14 = require("semantic-ui-react");
786
+ var import_utils15 = require("@rjsf/utils");
787
+ var import_jsx_runtime17 = require("react/jsx-runtime");
788
+ function CheckboxesWidget(props) {
789
+ const {
790
+ id,
791
+ disabled,
792
+ options,
793
+ value,
794
+ autofocus,
795
+ readonly,
796
+ label,
797
+ hideLabel,
798
+ onChange,
799
+ onBlur,
800
+ onFocus,
801
+ formContext,
802
+ schema,
803
+ uiSchema,
804
+ rawErrors = [],
805
+ registry
806
+ } = props;
807
+ const TitleFieldTemplate = (0, import_utils15.getTemplate)("TitleFieldTemplate", registry, options);
808
+ const { enumOptions, enumDisabled, inline } = options;
809
+ const checkboxesValues = Array.isArray(value) ? value : [value];
810
+ const semanticProps = getSemanticProps({
811
+ options,
812
+ formContext,
813
+ uiSchema,
814
+ defaultSchemaProps: {
815
+ inverted: "false"
816
+ }
817
+ });
818
+ const _onChange = (index) => ({ target: { checked } }) => {
819
+ if (checked) {
820
+ onChange((0, import_utils15.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
821
+ } else {
822
+ onChange((0, import_utils15.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
823
+ }
824
+ };
825
+ const _onBlur = () => onBlur(id, value);
826
+ const _onFocus = () => onFocus(id, value);
827
+ const inlineOption = inline ? { inline: true } : { grouped: true };
828
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
829
+ !hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TitleFieldTemplate, { id: (0, import_utils15.titleId)(id), title: label, schema, uiSchema, registry }),
830
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_semantic_ui_react14.Form.Group, { id, name: id, ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
831
+ const checked = (0, import_utils15.enumOptionsIsSelected)(option.value, checkboxesValues);
832
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
833
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
834
+ import_semantic_ui_react14.Form.Checkbox,
835
+ {
836
+ id: (0, import_utils15.optionId)(id, index),
837
+ name: id,
838
+ label: option.label,
839
+ ...semanticProps,
840
+ checked,
841
+ error: rawErrors.length > 0,
842
+ disabled: disabled || itemDisabled || readonly,
843
+ autoFocus: autofocus && index === 0,
844
+ onChange: _onChange(index),
845
+ onBlur: _onBlur,
846
+ onFocus: _onFocus,
847
+ "aria-describedby": (0, import_utils15.ariaDescribedByIds)(id)
848
+ },
849
+ index
850
+ );
851
+ }) })
852
+ ] });
853
+ }
854
+
855
+ // src/RadioWidget/RadioWidget.tsx
856
+ var import_utils16 = require("@rjsf/utils");
857
+ var import_semantic_ui_react15 = require("semantic-ui-react");
858
+ var import_jsx_runtime18 = require("react/jsx-runtime");
859
+ var import_react = require("react");
860
+ function RadioWidget(props) {
861
+ const {
862
+ id,
863
+ value,
864
+ required,
865
+ disabled,
866
+ readonly,
867
+ onChange,
868
+ onBlur,
869
+ onFocus,
870
+ options,
871
+ formContext,
872
+ uiSchema,
873
+ rawErrors = []
874
+ } = props;
875
+ const { enumOptions, enumDisabled, emptyValue } = options;
876
+ const semanticProps = getSemanticProps({
877
+ formContext,
878
+ options,
879
+ uiSchema
880
+ });
881
+ const _onChange = (_, { value: eventValue }) => {
882
+ return onChange((0, import_utils16.enumOptionsValueForIndex)(eventValue, enumOptions, emptyValue));
883
+ };
884
+ const _onBlur = () => onBlur(id, value);
885
+ const _onFocus = () => onFocus(id, value);
886
+ const inlineOption = options.inline ? { inline: true } : { grouped: true };
887
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_semantic_ui_react15.Form.Group, { ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
888
+ const checked = (0, import_utils16.enumOptionsIsSelected)(option.value, value);
889
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
890
+ return /* @__PURE__ */ (0, import_react.createElement)(
891
+ import_semantic_ui_react15.Form.Field,
892
+ {
893
+ required,
894
+ control: import_semantic_ui_react15.Radio,
895
+ id: (0, import_utils16.optionId)(id, index),
896
+ name: id,
897
+ ...semanticProps,
898
+ onFocus: _onFocus,
899
+ onBlur: _onBlur,
900
+ onChange: _onChange,
901
+ label: option.label,
902
+ value: String(index),
903
+ error: rawErrors.length > 0,
904
+ key: index,
905
+ checked,
906
+ disabled: disabled || itemDisabled || readonly,
907
+ "aria-describedby": (0, import_utils16.ariaDescribedByIds)(id)
908
+ }
909
+ );
910
+ }) });
911
+ }
912
+
913
+ // src/RangeWidget/RangeWidget.tsx
914
+ var import_semantic_ui_react16 = require("semantic-ui-react");
915
+ var import_utils17 = require("@rjsf/utils");
916
+ var import_jsx_runtime19 = require("react/jsx-runtime");
917
+ function RangeWidget(props) {
918
+ const {
919
+ id,
920
+ value,
921
+ required,
922
+ readonly,
923
+ disabled,
924
+ onChange,
925
+ onBlur,
926
+ onFocus,
927
+ options,
928
+ schema,
929
+ uiSchema,
930
+ formContext,
931
+ rawErrors = []
932
+ } = props;
933
+ const semanticProps = getSemanticProps({
934
+ formContext,
935
+ options,
936
+ uiSchema,
937
+ defaultSchemaProps: {
938
+ fluid: true
939
+ }
940
+ });
941
+ const _onChange = ({ target: { value: value2 } }) => onChange && onChange(value2 === "" ? options.emptyValue : value2);
942
+ const _onBlur = () => onBlur && onBlur(id, value);
943
+ const _onFocus = () => onFocus && onFocus(id, value);
944
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
945
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
946
+ import_semantic_ui_react16.Input,
947
+ {
948
+ id,
949
+ name: id,
950
+ type: "range",
951
+ required,
952
+ disabled: disabled || readonly,
953
+ ...(0, import_utils17.rangeSpec)(schema),
954
+ ...semanticProps,
955
+ value: value || "",
956
+ error: rawErrors.length > 0,
957
+ onChange: _onChange,
958
+ onBlur: _onBlur,
959
+ onFocus: _onFocus,
960
+ "aria-describedby": (0, import_utils17.ariaDescribedByIds)(id)
961
+ },
962
+ id
963
+ ),
964
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: value })
965
+ ] });
966
+ }
967
+
968
+ // src/SelectWidget/SelectWidget.tsx
969
+ var import_utils18 = require("@rjsf/utils");
970
+ var import_map = __toESM(require("lodash/map"));
971
+ var import_semantic_ui_react17 = require("semantic-ui-react");
972
+ var import_jsx_runtime20 = require("react/jsx-runtime");
973
+ function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled) {
974
+ const disabledOptions = enumDisabled || [];
975
+ const options = (0, import_map.default)(enumOptions, ({ label, value }, index) => ({
976
+ disabled: disabledOptions.indexOf(value) !== -1,
977
+ key: label,
978
+ text: label,
979
+ value: String(index)
980
+ }));
981
+ return options;
982
+ }
983
+ function SelectWidget(props) {
984
+ const {
985
+ uiSchema,
986
+ formContext,
987
+ id,
988
+ options,
989
+ label,
990
+ hideLabel,
991
+ required,
992
+ disabled,
993
+ readonly,
994
+ value,
995
+ multiple,
996
+ placeholder,
997
+ autofocus,
998
+ onChange,
999
+ onBlur,
1000
+ onFocus,
1001
+ rawErrors = []
1002
+ } = props;
1003
+ const semanticProps = getSemanticProps({
1004
+ uiSchema,
1005
+ formContext,
1006
+ options,
1007
+ defaultSchemaProps: {
1008
+ inverted: "false",
1009
+ selection: true,
1010
+ fluid: true,
1011
+ scrolling: true,
1012
+ upward: false
1013
+ }
1014
+ });
1015
+ const { enumDisabled, enumOptions, emptyValue: optEmptyVal } = options;
1016
+ const emptyValue = multiple ? [] : "";
1017
+ const dropdownOptions = createDefaultValueOptionsForDropDown(enumOptions, enumDisabled);
1018
+ const _onChange = (_, { value: value2 }) => onChange((0, import_utils18.enumOptionsValueForIndex)(value2, enumOptions, optEmptyVal));
1019
+ const _onBlur = (_, { target: { value: value2 } }) => onBlur(id, (0, import_utils18.enumOptionsValueForIndex)(value2, enumOptions, optEmptyVal));
1020
+ const _onFocus = (_, { target: { value: value2 } }) => onFocus(id, (0, import_utils18.enumOptionsValueForIndex)(value2, enumOptions, optEmptyVal));
1021
+ const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, multiple);
1022
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1023
+ import_semantic_ui_react17.Form.Dropdown,
1024
+ {
1025
+ id,
1026
+ name: id,
1027
+ label: (0, import_utils18.labelValue)(label || void 0, hideLabel, false),
1028
+ multiple: typeof multiple === "undefined" ? false : multiple,
1029
+ value: typeof value === "undefined" ? emptyValue : selectedIndexes,
1030
+ error: rawErrors.length > 0,
1031
+ disabled,
1032
+ placeholder,
1033
+ ...semanticProps,
1034
+ required,
1035
+ autoFocus: autofocus,
1036
+ readOnly: readonly,
1037
+ options: dropdownOptions,
1038
+ onChange: _onChange,
1039
+ onBlur: _onBlur,
1040
+ onFocus: _onFocus,
1041
+ "aria-describedby": (0, import_utils18.ariaDescribedByIds)(id)
1042
+ },
1043
+ id
1044
+ );
1045
+ }
1046
+
1047
+ // src/TextareaWidget/TextareaWidget.tsx
1048
+ var import_utils19 = require("@rjsf/utils");
1049
+ var import_semantic_ui_react18 = require("semantic-ui-react");
1050
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1051
+ function TextareaWidget(props) {
1052
+ const {
1053
+ id,
1054
+ placeholder,
1055
+ value,
1056
+ required,
1057
+ disabled,
1058
+ autofocus,
1059
+ label,
1060
+ hideLabel,
1061
+ readonly,
1062
+ onBlur,
1063
+ onFocus,
1064
+ onChange,
1065
+ options,
1066
+ formContext,
1067
+ rawErrors = []
1068
+ } = props;
1069
+ const semanticProps = getSemanticProps({
1070
+ formContext,
1071
+ options,
1072
+ defaultSchemaProps: { inverted: "false" }
1073
+ });
1074
+ const _onChange = ({ target: { value: value2 } }) => onChange && onChange(value2 === "" ? options.emptyValue : value2);
1075
+ const _onBlur = () => onBlur && onBlur(id, value);
1076
+ const _onFocus = () => onFocus && onFocus(id, value);
1077
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1078
+ import_semantic_ui_react18.Form.TextArea,
1079
+ {
1080
+ id,
1081
+ name: id,
1082
+ label: (0, import_utils19.labelValue)(label || void 0, hideLabel, false),
1083
+ placeholder,
1084
+ autoFocus: autofocus,
1085
+ required,
1086
+ disabled: disabled || readonly,
1087
+ ...semanticProps,
1088
+ value: value || "",
1089
+ error: rawErrors.length > 0,
1090
+ rows: options.rows || 5,
1091
+ onChange: _onChange,
1092
+ onBlur: _onBlur,
1093
+ onFocus: _onFocus,
1094
+ "aria-describedby": (0, import_utils19.ariaDescribedByIds)(id)
1095
+ },
1096
+ id
1097
+ );
1098
+ }
1099
+
1100
+ // src/Widgets/Widgets.tsx
1101
+ function generateWidgets() {
1102
+ return {
1103
+ CheckboxWidget,
1104
+ CheckboxesWidget,
1105
+ RadioWidget,
1106
+ RangeWidget,
1107
+ SelectWidget,
1108
+ TextareaWidget
1109
+ };
1110
+ }
1111
+ var Widgets_default = generateWidgets();
1112
+
1113
+ // src/Theme/Theme.ts
1114
+ function generateTheme() {
1115
+ return {
1116
+ templates: generateTemplates(),
1117
+ widgets: generateWidgets(),
1118
+ _internalFormWrapper: import_semantic_ui_react19.Form
1119
+ };
1120
+ }
1121
+ var Theme_default = generateTheme();
1122
+
1123
+ // src/SemanticUIForm/SemanticUIForm.ts
1124
+ function generateForm() {
1125
+ return (0, import_core.withTheme)(generateTheme());
1126
+ }
1127
+ var SemanticUIForm_default = generateForm();
1128
+
1129
+ // src/index.ts
1130
+ var src_default = SemanticUIForm_default;
1131
+ //# sourceMappingURL=index.js.map