@rjsf/semantic-ui 5.11.2 → 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
@@ -1,134 +1,89 @@
1
- import { withTheme } from '@rjsf/core';
2
- import { Button, Icon, Segment, Grid, Form, Message, Label, List, Header, Radio, Input } from 'semantic-ui-react';
3
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
- import { TranslatableString, getUiOptions, getTemplate, isFixedItems, UI_OPTIONS_KEY, getInputProps, labelValue, examplesId, ariaDescribedByIds, errorId, helpId, titleId, descriptionId, canExpand, getSubmitButtonOptions, ADDITIONAL_PROPERTY_FLAG, schemaRequiresTrueValue, enumOptionsIsSelected, optionId, enumOptionsSelectValue, enumOptionsDeselectValue, enumOptionsValueForIndex, rangeSpec, enumOptionsIndexForValue } from '@rjsf/utils';
5
- import { nanoid } from 'nanoid';
6
- import { createElement } from 'react';
7
- import map from 'lodash-es/map';
1
+ // src/SemanticUIForm/SemanticUIForm.ts
2
+ import { withTheme } from "@rjsf/core";
8
3
 
9
- /** The `AddButton` renders a button that represent the `Add` action on a form
10
- */
4
+ // src/Theme/Theme.ts
5
+ import { Form as SuiForm } from "semantic-ui-react";
6
+
7
+ // src/AddButton/AddButton.tsx
8
+ import { Button, Icon } from "semantic-ui-react";
9
+ import { TranslatableString } from "@rjsf/utils";
10
+ import { jsx } from "react/jsx-runtime";
11
11
  function AddButton({
12
12
  uiSchema,
13
13
  registry,
14
14
  color,
15
15
  ...props
16
16
  }) {
17
- const {
18
- translateString
19
- } = registry;
20
- return jsx(Button, {
21
- title: translateString(TranslatableString.AddItemButton),
22
- color: color,
23
- ...props,
24
- icon: true,
25
- size: 'tiny',
26
- children: jsx(Icon, {
27
- name: 'plus'
28
- })
29
- });
17
+ const { translateString } = registry;
18
+ return /* @__PURE__ */ jsx(
19
+ Button,
20
+ {
21
+ title: translateString(TranslatableString.AddItemButton),
22
+ color,
23
+ ...props,
24
+ icon: true,
25
+ size: "tiny",
26
+ children: /* @__PURE__ */ jsx(Icon, { name: "plus" })
27
+ }
28
+ );
30
29
  }
31
30
 
32
- /**
33
- * Extract props meant for semantic UI components from props that are
34
- * passed to Widgets, Templates and Fields.
35
- * @param {Object} params
36
- * @param {Object?} params.formContext
37
- * @param {Object?} params.uiSchema
38
- * @param {Object?} params.options
39
- * @param {Object?} params.defaultSchemaProps
40
- * @param {Object?} params.defaultContextProps
41
- * @returns {any}
42
- */
31
+ // src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
32
+ import {
33
+ getUiOptions as getUiOptions2
34
+ } from "@rjsf/utils";
35
+ import { Button as Button2, Grid, Segment } from "semantic-ui-react";
36
+
37
+ // src/util.tsx
38
+ import {
39
+ getUiOptions
40
+ } from "@rjsf/utils";
41
+ import { jsx as jsx2 } from "react/jsx-runtime";
43
42
  function getSemanticProps({
44
43
  formContext = {},
45
44
  uiSchema = {},
46
45
  options = {},
47
- defaultSchemaProps = {
48
- fluid: true,
49
- inverted: false
50
- },
46
+ defaultSchemaProps = { fluid: true, inverted: false },
51
47
  defaultContextProps = {}
52
48
  }) {
53
49
  const formContextProps = formContext.semantic;
54
50
  const schemaProps = getUiOptions(uiSchema).semantic;
55
51
  const optionProps = options.semantic;
56
- // formContext props should overide other props
57
- return Object.assign({}, {
58
- ...defaultSchemaProps
59
- }, {
60
- ...defaultContextProps
61
- }, schemaProps, optionProps, formContextProps);
52
+ return Object.assign(
53
+ {},
54
+ { ...defaultSchemaProps },
55
+ { ...defaultContextProps },
56
+ schemaProps,
57
+ optionProps,
58
+ formContextProps
59
+ );
62
60
  }
63
- /**
64
- * Extract error props meant for semantic UI components from props that are
65
- * passed to Widgets, Templates and Fields.
66
- * @param {Object} params
67
- * @param {Object?} params.formContext
68
- * @param {Object?} params.uiSchema
69
- * @param {Object?} params.defaultProps
70
- * @returns {any}
71
- */
72
61
  function getSemanticErrorProps({
73
62
  formContext = {},
74
63
  uiSchema = {},
75
64
  options = {},
76
- defaultProps = {
77
- size: 'small',
78
- pointing: 'above'
79
- }
65
+ defaultProps = { size: "small", pointing: "above" }
80
66
  }) {
81
67
  const formContextProps = formContext.semantic && formContext.semantic.errorOptions;
82
68
  const semanticOptions = getUiOptions(uiSchema).semantic;
83
69
  const schemaProps = semanticOptions && semanticOptions.errorOptions;
84
70
  const optionProps = options.semantic && options.semantic.errorOptions;
85
- return Object.assign({}, {
86
- ...defaultProps
87
- }, schemaProps, optionProps, formContextProps);
71
+ return Object.assign({}, { ...defaultProps }, schemaProps, optionProps, formContextProps);
88
72
  }
89
- /**
90
- * Combine multiple strings containing class names into a single string,
91
- * removing duplicates. E.g.
92
- * cleanClassNames('bar', 'baz bar', 'x y ', undefined)
93
- * // 'bar baz x y'
94
- * @param {Array} classNameArr
95
- * @param {Array} omit
96
- * @returns {string}
97
- */
98
73
  function cleanClassNames(classNameArr, omit = []) {
99
- // Split each arg on whitespace, and add it to an array. Skip false-y args
100
- // like "" and undefined.
101
74
  const classList = classNameArr.filter(Boolean).reduce((previous, current) => previous.concat(current.trim().split(/\s+/)), []);
102
- // Remove any class names from omit, and make the rest unique before
103
- // returning them as a string
104
- return [...new Set(classList.filter(cn => !omit.includes(cn)))].join(' ');
75
+ return [...new Set(classList.filter((cn) => !omit.includes(cn)))].join(" ");
105
76
  }
106
- /**
107
- *
108
- * @param {boolean} wrap
109
- * @param Component
110
- * @param {Object} props
111
- * @returns {*}
112
- * @constructor
113
- */
114
- function MaybeWrap({
115
- wrap,
116
- component: Component = 'div',
117
- ...props
118
- }) {
119
- return wrap ? jsx(Component, {
120
- ...props
121
- }) : props.children;
77
+ function MaybeWrap({ wrap, component: Component = "div", ...props }) {
78
+ return wrap ? /* @__PURE__ */ jsx2(Component, { ...props }) : props.children;
122
79
  }
123
80
 
124
- const gridStyle = vertical => ({
125
- display: 'grid',
81
+ // src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
82
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
83
+ var gridStyle = (vertical) => ({
84
+ display: "grid",
126
85
  gridTemplateColumns: `1fr ${vertical ? 65 : 150}px`
127
86
  });
128
- /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
129
- *
130
- * @param props - The `ArrayFieldTemplateItemType` props for the component
131
- */
132
87
  function ArrayFieldItemTemplate(props) {
133
88
  const {
134
89
  children,
@@ -146,72 +101,64 @@ function ArrayFieldItemTemplate(props) {
146
101
  uiSchema,
147
102
  registry
148
103
  } = props;
149
- const {
150
- CopyButton,
151
- MoveDownButton,
152
- MoveUpButton,
153
- RemoveButton
154
- } = registry.templates.ButtonTemplates;
155
- const uiOptions = getUiOptions(uiSchema);
156
- // Pull the semantic props out of the uiOptions that were put in via the ArrayFieldTemplate
157
- const {
158
- horizontalButtons = true,
159
- wrapItem = false
160
- } = uiOptions.semantic;
161
- return jsx("div", {
162
- className: 'array-item',
163
- children: jsx(MaybeWrap, {
164
- wrap: wrapItem,
165
- component: Segment,
166
- children: jsxs(Grid, {
167
- style: {
168
- ...gridStyle(!horizontalButtons),
169
- alignItems: 'center'
170
- },
171
- children: [jsx(Grid.Column, {
172
- width: 16,
173
- verticalAlign: 'middle',
174
- children: children
175
- }), hasToolbar && jsx(Grid.Column, {
176
- children: (hasMoveUp || hasMoveDown || hasRemove) && jsxs(Button.Group, {
177
- size: 'mini',
178
- vertical: !horizontalButtons,
179
- children: [(hasMoveUp || hasMoveDown) && jsx(MoveUpButton, {
180
- className: 'array-item-move-up',
181
- disabled: disabled || readonly || !hasMoveUp,
182
- onClick: onReorderClick(index, index - 1),
183
- uiSchema: uiSchema,
184
- registry: registry
185
- }), (hasMoveUp || hasMoveDown) && jsx(MoveDownButton, {
186
- className: 'array-item-move-down',
187
- disabled: disabled || readonly || !hasMoveDown,
188
- onClick: onReorderClick(index, index + 1),
189
- uiSchema: uiSchema,
190
- registry: registry
191
- }), hasCopy && jsx(CopyButton, {
192
- className: 'array-item-copy',
193
- disabled: disabled || readonly,
194
- onClick: onCopyIndexClick(index),
195
- uiSchema: uiSchema,
196
- registry: registry
197
- }), hasRemove && jsx(RemoveButton, {
198
- className: 'array-item-remove',
199
- disabled: disabled || readonly,
200
- onClick: onDropIndexClick(index),
201
- uiSchema: uiSchema,
202
- registry: registry
203
- })]
204
- })
205
- })]
206
- })
207
- })
208
- });
104
+ const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
105
+ const uiOptions = getUiOptions2(uiSchema);
106
+ const { horizontalButtons = true, wrapItem = false } = uiOptions.semantic;
107
+ return /* @__PURE__ */ jsx3("div", { className: "array-item", children: /* @__PURE__ */ jsx3(MaybeWrap, { wrap: wrapItem, component: Segment, children: /* @__PURE__ */ jsxs(Grid, { style: { ...gridStyle(!horizontalButtons), alignItems: "center" }, children: [
108
+ /* @__PURE__ */ jsx3(Grid.Column, { width: 16, verticalAlign: "middle", children }),
109
+ hasToolbar && /* @__PURE__ */ jsx3(Grid.Column, { children: (hasMoveUp || hasMoveDown || hasRemove) && /* @__PURE__ */ jsxs(Button2.Group, { size: "mini", vertical: !horizontalButtons, children: [
110
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx3(
111
+ MoveUpButton2,
112
+ {
113
+ className: "array-item-move-up",
114
+ disabled: disabled || readonly || !hasMoveUp,
115
+ onClick: onReorderClick(index, index - 1),
116
+ uiSchema,
117
+ registry
118
+ }
119
+ ),
120
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx3(
121
+ MoveDownButton2,
122
+ {
123
+ className: "array-item-move-down",
124
+ disabled: disabled || readonly || !hasMoveDown,
125
+ onClick: onReorderClick(index, index + 1),
126
+ uiSchema,
127
+ registry
128
+ }
129
+ ),
130
+ hasCopy && /* @__PURE__ */ jsx3(
131
+ CopyButton2,
132
+ {
133
+ className: "array-item-copy",
134
+ disabled: disabled || readonly,
135
+ onClick: onCopyIndexClick(index),
136
+ uiSchema,
137
+ registry
138
+ }
139
+ ),
140
+ hasRemove && /* @__PURE__ */ jsx3(
141
+ RemoveButton2,
142
+ {
143
+ className: "array-item-remove",
144
+ disabled: disabled || readonly,
145
+ onClick: onDropIndexClick(index),
146
+ uiSchema,
147
+ registry
148
+ }
149
+ )
150
+ ] }) })
151
+ ] }) }) });
209
152
  }
210
153
 
211
- /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
212
- *
213
- * @param props - The `ArrayFieldTemplateItemType` props for the component
214
- */
154
+ // src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
155
+ import {
156
+ getTemplate,
157
+ getUiOptions as getUiOptions3,
158
+ isFixedItems,
159
+ UI_OPTIONS_KEY
160
+ } from "@rjsf/utils";
161
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
215
162
  function ArrayFieldTemplate(props) {
216
163
  const {
217
164
  uiSchema,
@@ -233,88 +180,86 @@ function ArrayFieldTemplate(props) {
233
180
  const semanticProps = getSemanticProps({
234
181
  uiSchema,
235
182
  formContext,
236
- defaultSchemaProps: {
237
- horizontalButtons: true,
238
- wrapItem: false
239
- }
183
+ defaultSchemaProps: { horizontalButtons: true, wrapItem: false }
240
184
  });
185
+ const { horizontalButtons, wrapItem } = semanticProps;
186
+ const semantic = { horizontalButtons, wrapItem };
187
+ const uiOptions = getUiOptions3(uiSchema);
188
+ const ArrayFieldDescriptionTemplate = getTemplate(
189
+ "ArrayFieldDescriptionTemplate",
190
+ registry,
191
+ uiOptions
192
+ );
193
+ const ArrayFieldItemTemplate2 = getTemplate(
194
+ "ArrayFieldItemTemplate",
195
+ registry,
196
+ uiOptions
197
+ );
198
+ const ArrayFieldTitleTemplate = getTemplate(
199
+ "ArrayFieldTitleTemplate",
200
+ registry,
201
+ uiOptions
202
+ );
241
203
  const {
242
- horizontalButtons,
243
- wrapItem
244
- } = semanticProps;
245
- const semantic = {
246
- horizontalButtons,
247
- wrapItem
248
- };
249
- const uiOptions = getUiOptions(uiSchema);
250
- const ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
251
- const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
252
- const ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
253
- // Button templates are not overridden in the uiSchema
254
- const {
255
- ButtonTemplates: {
256
- AddButton
257
- }
204
+ ButtonTemplates: { AddButton: AddButton2 }
258
205
  } = registry.templates;
259
- return jsxs("div", {
260
- className: cleanClassNames([className, isFixedItems(schema) ? '' : 'sortable-form-fields']),
261
- children: [jsx(ArrayFieldTitleTemplate, {
262
- idSchema: idSchema,
263
- title: uiOptions.title || title,
264
- schema: schema,
265
- uiSchema: uiSchema,
266
- required: required,
267
- registry: registry
268
- }), jsx(ArrayFieldDescriptionTemplate, {
269
- idSchema: idSchema,
270
- description: uiOptions.description || schema.description,
271
- schema: schema,
272
- uiSchema: uiSchema,
273
- registry: registry
274
- }), jsxs("div", {
275
- children: [jsx("div", {
276
- className: 'row array-item-list',
277
- children: items && items.map(({
278
- key,
279
- uiSchema: itemUiSchema = {},
280
- ...props
281
- }) => {
282
- // Merge in the semantic props from the ArrayFieldTemplate into each of the items
283
- const mergedUiSchema = {
284
- ...itemUiSchema,
285
- [UI_OPTIONS_KEY]: {
286
- ...itemUiSchema[UI_OPTIONS_KEY],
287
- semantic
288
- }
289
- };
290
- return jsx(ArrayFieldItemTemplate, {
291
- ...props,
292
- uiSchema: mergedUiSchema
293
- }, key);
294
- })
295
- }), canAdd && jsx("div", {
296
- style: {
297
- marginTop: '1rem',
298
- position: 'relative',
299
- textAlign: 'right'
300
- },
301
- children: jsx(AddButton, {
302
- onClick: onAddClick,
303
- disabled: disabled || readonly,
304
- uiSchema: uiSchema,
305
- registry: registry
306
- })
307
- })]
308
- }, `array-item-list-${idSchema.$id}`)]
309
- });
206
+ return /* @__PURE__ */ jsxs2("div", { className: cleanClassNames([className, isFixedItems(schema) ? "" : "sortable-form-fields"]), children: [
207
+ /* @__PURE__ */ jsx4(
208
+ ArrayFieldTitleTemplate,
209
+ {
210
+ idSchema,
211
+ title: uiOptions.title || title,
212
+ schema,
213
+ uiSchema,
214
+ required,
215
+ registry
216
+ }
217
+ ),
218
+ /* @__PURE__ */ jsx4(
219
+ ArrayFieldDescriptionTemplate,
220
+ {
221
+ idSchema,
222
+ description: uiOptions.description || schema.description,
223
+ schema,
224
+ uiSchema,
225
+ registry
226
+ }
227
+ ),
228
+ /* @__PURE__ */ jsxs2("div", { children: [
229
+ /* @__PURE__ */ jsx4("div", { className: "row array-item-list", children: items && items.map(({ key, uiSchema: itemUiSchema = {}, ...props2 }) => {
230
+ const mergedUiSchema = {
231
+ ...itemUiSchema,
232
+ [UI_OPTIONS_KEY]: {
233
+ ...itemUiSchema[UI_OPTIONS_KEY],
234
+ semantic
235
+ }
236
+ };
237
+ return /* @__PURE__ */ jsx4(ArrayFieldItemTemplate2, { ...props2, uiSchema: mergedUiSchema }, key);
238
+ }) }),
239
+ canAdd && /* @__PURE__ */ jsx4(
240
+ "div",
241
+ {
242
+ style: {
243
+ marginTop: "1rem",
244
+ position: "relative",
245
+ textAlign: "right"
246
+ },
247
+ children: /* @__PURE__ */ jsx4(AddButton2, { onClick: onAddClick, disabled: disabled || readonly, uiSchema, registry })
248
+ }
249
+ )
250
+ ] }, `array-item-list-${idSchema.$id}`)
251
+ ] });
310
252
  }
311
253
 
312
- /** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
313
- * It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
314
- * It can be customized/overridden for other themes or individual implementations as needed.
315
- *
316
- * @param props - The `WidgetProps` for this template
317
- */
254
+ // src/BaseInputTemplate/BaseInputTemplate.tsx
255
+ import { Form } from "semantic-ui-react";
256
+ import {
257
+ ariaDescribedByIds,
258
+ examplesId,
259
+ getInputProps,
260
+ labelValue
261
+ } from "@rjsf/utils";
262
+ import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
318
263
  function BaseInputTemplate(props) {
319
264
  const {
320
265
  id,
@@ -343,224 +288,151 @@ function BaseInputTemplate(props) {
343
288
  formContext,
344
289
  options
345
290
  });
346
- const _onChange = ({
347
- target: {
348
- value
349
- }
350
- }) => onChange(value === '' ? options.emptyValue : value);
291
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
351
292
  const _onBlur = () => onBlur && onBlur(id, value);
352
293
  const _onFocus = () => onFocus && onFocus(id, value);
353
- return jsxs(Fragment, {
354
- children: [jsx(Form.Input, {
355
- id: id,
356
- name: id,
357
- placeholder: placeholder,
358
- ...inputProps,
359
- label: labelValue(label || undefined, hideLabel, false),
360
- required: required,
361
- autoFocus: autofocus,
362
- disabled: disabled || readonly,
363
- list: schema.examples ? examplesId(id) : undefined,
364
- ...semanticProps,
365
- value: value || value === 0 ? value : '',
366
- error: rawErrors.length > 0,
367
- onChange: onChangeOverride || _onChange,
368
- onBlur: _onBlur,
369
- onFocus: _onFocus,
370
- "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
371
- }, id), Array.isArray(schema.examples) && jsx("datalist", {
372
- id: examplesId(id),
373
- children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map(example => {
374
- return jsx("option", {
375
- value: example
376
- }, example);
377
- })
378
- })]
379
- });
294
+ return /* @__PURE__ */ jsxs3(Fragment, { children: [
295
+ /* @__PURE__ */ jsx5(
296
+ Form.Input,
297
+ {
298
+ id,
299
+ name: id,
300
+ placeholder,
301
+ ...inputProps,
302
+ label: labelValue(label || void 0, hideLabel, false),
303
+ required,
304
+ autoFocus: autofocus,
305
+ disabled: disabled || readonly,
306
+ list: schema.examples ? examplesId(id) : void 0,
307
+ ...semanticProps,
308
+ value: value || value === 0 ? value : "",
309
+ error: rawErrors.length > 0,
310
+ onChange: onChangeOverride || _onChange,
311
+ onBlur: _onBlur,
312
+ onFocus: _onFocus,
313
+ "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
314
+ },
315
+ id
316
+ ),
317
+ Array.isArray(schema.examples) && /* @__PURE__ */ jsx5("datalist", { id: examplesId(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
318
+ return /* @__PURE__ */ jsx5("option", { value: example }, example);
319
+ }) })
320
+ ] });
380
321
  }
381
322
 
382
- /** The `DescriptionField` is the template to use to render the description of a field
383
- *
384
- * @param props - The `DescriptionFieldProps` for this component
385
- */
323
+ // src/DescriptionField/DescriptionField.tsx
324
+ import { jsx as jsx6 } from "react/jsx-runtime";
386
325
  function DescriptionField(props) {
387
- const {
388
- id,
389
- description
390
- } = props;
326
+ const { id, description } = props;
391
327
  if (!description) {
392
328
  return null;
393
329
  }
394
- return jsx("p", {
395
- id: id,
396
- className: 'sui-description',
397
- children: description
398
- });
330
+ return /* @__PURE__ */ jsx6("p", { id, className: "sui-description", children: description });
399
331
  }
400
332
 
401
- /** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
402
- *
403
- * @param props - The `ErrorListProps` for this component
404
- */
333
+ // src/ErrorList/ErrorList.tsx
334
+ import { Message } from "semantic-ui-react";
335
+ import { TranslatableString as TranslatableString2 } from "@rjsf/utils";
336
+ import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
405
337
  function ErrorList({
406
338
  errors,
407
339
  registry
408
340
  }) {
409
- const {
410
- translateString
411
- } = registry;
412
- return jsxs(Message, {
413
- negative: true,
414
- children: [jsx(Message.Header, {
415
- children: translateString(TranslatableString.ErrorsLabel)
416
- }), jsx(Message.List, {
417
- children: errors.map((error, index) => jsx(Message.Item, {
418
- children: error.stack
419
- }, `error-${index}`))
420
- })]
421
- });
341
+ const { translateString } = registry;
342
+ return /* @__PURE__ */ jsxs4(Message, { negative: true, children: [
343
+ /* @__PURE__ */ jsx7(Message.Header, { children: translateString(TranslatableString2.ErrorsLabel) }),
344
+ /* @__PURE__ */ jsx7(Message.List, { children: errors.map((error, index) => /* @__PURE__ */ jsx7(Message.Item, { children: error.stack }, `error-${index}`)) })
345
+ ] });
422
346
  }
423
347
 
348
+ // src/IconButton/IconButton.tsx
349
+ import { Button as Button3 } from "semantic-ui-react";
350
+ import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
351
+ import { jsx as jsx8 } from "react/jsx-runtime";
424
352
  function IconButton(props) {
425
- const {
426
- icon,
427
- iconType,
428
- color,
429
- className,
430
- uiSchema,
431
- registry,
432
- ...otherProps
433
- } = props;
434
- return jsx(Button, {
435
- icon: icon,
436
- size: iconType,
437
- color: color,
438
- className: className,
439
- ...otherProps
440
- });
353
+ const { icon, iconType, color, className, uiSchema, registry, ...otherProps } = props;
354
+ return /* @__PURE__ */ jsx8(
355
+ Button3,
356
+ {
357
+ icon,
358
+ size: iconType,
359
+ color,
360
+ className,
361
+ ...otherProps
362
+ }
363
+ );
441
364
  }
442
365
  function CopyButton(props) {
443
366
  const {
444
- registry: {
445
- translateString
446
- }
367
+ registry: { translateString }
447
368
  } = props;
448
- return jsx(IconButton, {
449
- title: translateString(TranslatableString.CopyButton),
450
- ...props,
451
- icon: 'copy'
452
- });
369
+ return /* @__PURE__ */ jsx8(IconButton, { title: translateString(TranslatableString3.CopyButton), ...props, icon: "copy" });
453
370
  }
454
371
  function MoveDownButton(props) {
455
372
  const {
456
- registry: {
457
- translateString
458
- }
373
+ registry: { translateString }
459
374
  } = props;
460
- return jsx(IconButton, {
461
- title: translateString(TranslatableString.MoveDownButton),
462
- ...props,
463
- icon: 'angle down'
464
- });
375
+ return /* @__PURE__ */ jsx8(IconButton, { title: translateString(TranslatableString3.MoveDownButton), ...props, icon: "angle down" });
465
376
  }
466
377
  function MoveUpButton(props) {
467
378
  const {
468
- registry: {
469
- translateString
470
- }
379
+ registry: { translateString }
471
380
  } = props;
472
- return jsx(IconButton, {
473
- title: translateString(TranslatableString.MoveUpButton),
474
- ...props,
475
- icon: 'angle up'
476
- });
381
+ return /* @__PURE__ */ jsx8(IconButton, { title: translateString(TranslatableString3.MoveUpButton), ...props, icon: "angle up" });
477
382
  }
478
383
  function RemoveButton(props) {
479
384
  const {
480
- registry: {
481
- translateString
482
- }
385
+ registry: { translateString }
483
386
  } = props;
484
- return jsx(IconButton, {
485
- title: translateString(TranslatableString.RemoveButton),
486
- ...props,
487
- icon: 'trash'
488
- });
387
+ return /* @__PURE__ */ jsx8(IconButton, { title: translateString(TranslatableString3.RemoveButton), ...props, icon: "trash" });
489
388
  }
490
389
 
491
- const DEFAULT_OPTIONS$1 = {
390
+ // src/FieldErrorTemplate/FieldErrorTemplate.tsx
391
+ import { errorId } from "@rjsf/utils";
392
+ import { nanoid } from "nanoid";
393
+ import { Label, List } from "semantic-ui-react";
394
+ import { jsx as jsx9 } from "react/jsx-runtime";
395
+ var DEFAULT_OPTIONS = {
492
396
  options: {
493
- pointing: 'above',
494
- size: 'small'
397
+ pointing: "above",
398
+ size: "small"
495
399
  }
496
400
  };
497
- /** The `FieldErrorTemplate` component renders the errors local to the particular field
498
- *
499
- * @param props - The `FieldErrorProps` for the errors being rendered
500
- */
501
- function FieldErrorTemplate({
502
- errors,
503
- idSchema,
504
- uiSchema,
505
- registry
506
- }) {
507
- const {
508
- formContext
509
- } = registry;
401
+ function FieldErrorTemplate({ errors, idSchema, uiSchema, registry }) {
402
+ const { formContext } = registry;
510
403
  const options = getSemanticErrorProps({
511
404
  formContext,
512
405
  uiSchema,
513
- defaultProps: DEFAULT_OPTIONS$1
406
+ defaultProps: DEFAULT_OPTIONS
514
407
  });
515
- const {
516
- pointing,
517
- size
518
- } = options;
408
+ const { pointing, size } = options;
519
409
  if (errors && errors.length > 0) {
520
410
  const id = errorId(idSchema);
521
- return jsx(Label, {
522
- id: id,
523
- color: 'red',
524
- pointing: pointing || 'above',
525
- size: size || 'small',
526
- basic: true,
527
- children: jsx(List, {
528
- bulleted: true,
529
- children: errors.map(error => jsx(List.Item, {
530
- children: error
531
- }, nanoid()))
532
- })
533
- });
411
+ return /* @__PURE__ */ jsx9(Label, { id, color: "red", pointing: pointing || "above", size: size || "small", basic: true, children: /* @__PURE__ */ jsx9(List, { bulleted: true, children: errors.map((error) => /* @__PURE__ */ jsx9(List.Item, { children: error }, nanoid())) }) });
534
412
  }
535
413
  return null;
536
414
  }
537
415
 
538
- /** The `FieldHelpTemplate` component renders any help desired for a field
539
- *
540
- * @param props - The `FieldHelpProps` to be rendered
541
- */
416
+ // src/FieldHelpTemplate/FieldHelpTemplate.tsx
417
+ import { Message as Message2 } from "semantic-ui-react";
418
+ import { helpId } from "@rjsf/utils";
419
+ import { jsx as jsx10 } from "react/jsx-runtime";
542
420
  function FieldHelpTemplate(props) {
543
- const {
544
- idSchema,
545
- help
546
- } = props;
421
+ const { idSchema, help } = props;
547
422
  if (help) {
548
423
  const id = helpId(idSchema);
549
- return jsx(Message, {
550
- size: 'mini',
551
- info: true,
552
- id: id,
553
- content: help
554
- });
424
+ return /* @__PURE__ */ jsx10(Message2, { size: "mini", info: true, id, content: help });
555
425
  }
556
426
  return null;
557
427
  }
558
428
 
559
- /** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
560
- * content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
561
- *
562
- * @param props - The `FieldTemplateProps` for this component
563
- */
429
+ // src/FieldTemplate/FieldTemplate.tsx
430
+ import {
431
+ getTemplate as getTemplate2,
432
+ getUiOptions as getUiOptions4
433
+ } from "@rjsf/utils";
434
+ import { Form as Form2 } from "semantic-ui-react";
435
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
564
436
  function FieldTemplate(props) {
565
437
  const {
566
438
  id,
@@ -580,51 +452,47 @@ function FieldTemplate(props) {
580
452
  ...otherProps
581
453
  } = props;
582
454
  const semanticProps = getSemanticProps(otherProps);
583
- const {
584
- wrapLabel,
585
- wrapContent
586
- } = semanticProps;
587
- const uiOptions = getUiOptions(uiSchema);
588
- const WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
455
+ const { wrapLabel, wrapContent } = semanticProps;
456
+ const uiOptions = getUiOptions4(uiSchema);
457
+ const WrapIfAdditionalTemplate2 = getTemplate2(
458
+ "WrapIfAdditionalTemplate",
459
+ registry,
460
+ uiOptions
461
+ );
589
462
  if (hidden) {
590
- return jsx("div", {
591
- style: {
592
- display: 'none'
593
- },
594
- children: children
595
- });
463
+ return /* @__PURE__ */ jsx11("div", { style: { display: "none" }, children });
596
464
  }
597
- return jsx(WrapIfAdditionalTemplate, {
598
- classNames: classNames,
599
- style: style,
600
- id: id,
601
- label: label,
602
- registry: registry,
603
- schema: schema,
604
- uiSchema: uiSchema,
605
- ...otherProps,
606
- children: jsx(Form.Group, {
607
- widths: 'equal',
608
- grouped: true,
609
- children: jsxs(MaybeWrap, {
610
- wrap: wrapContent,
611
- className: 'sui-field-content',
612
- children: [children, displayLabel && rawDescription && jsx(MaybeWrap, {
613
- wrap: wrapLabel,
614
- className: 'sui-field-label',
615
- children: description
616
- }), help, errors]
617
- })
618
- }, id)
619
- });
465
+ return /* @__PURE__ */ jsx11(
466
+ WrapIfAdditionalTemplate2,
467
+ {
468
+ classNames,
469
+ style,
470
+ id,
471
+ label,
472
+ registry,
473
+ schema,
474
+ uiSchema,
475
+ ...otherProps,
476
+ children: /* @__PURE__ */ jsx11(Form2.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ jsxs5(MaybeWrap, { wrap: wrapContent, className: "sui-field-content", children: [
477
+ children,
478
+ displayLabel && rawDescription && /* @__PURE__ */ jsx11(MaybeWrap, { wrap: wrapLabel, className: "sui-field-label", children: description }),
479
+ help,
480
+ errors
481
+ ] }) }, id)
482
+ }
483
+ );
620
484
  }
621
485
 
622
- /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
623
- * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
624
- * the properties.
625
- *
626
- * @param props - The `ObjectFieldTemplateProps` for this component
627
- */
486
+ // src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
487
+ import { Grid as Grid2 } from "semantic-ui-react";
488
+ import {
489
+ canExpand,
490
+ descriptionId,
491
+ getTemplate as getTemplate3,
492
+ getUiOptions as getUiOptions5,
493
+ titleId
494
+ } from "@rjsf/utils";
495
+ import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
628
496
  function ObjectFieldTemplate(props) {
629
497
  const {
630
498
  description,
@@ -640,80 +508,80 @@ function ObjectFieldTemplate(props) {
640
508
  idSchema,
641
509
  registry
642
510
  } = props;
643
- const uiOptions = getUiOptions(uiSchema);
644
- const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
645
- const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
646
- // Button templates are not overridden in the uiSchema
511
+ const uiOptions = getUiOptions5(uiSchema);
512
+ const TitleFieldTemplate = getTemplate3("TitleFieldTemplate", registry, uiOptions);
513
+ const DescriptionFieldTemplate = getTemplate3(
514
+ "DescriptionFieldTemplate",
515
+ registry,
516
+ uiOptions
517
+ );
647
518
  const {
648
- ButtonTemplates: {
649
- AddButton
650
- }
519
+ ButtonTemplates: { AddButton: AddButton2 }
651
520
  } = registry.templates;
652
- return jsxs(Fragment, {
653
- children: [title && jsx(TitleFieldTemplate, {
654
- id: titleId(idSchema),
655
- title: title,
656
- required: required,
657
- schema: schema,
658
- uiSchema: uiSchema,
659
- registry: registry
660
- }), description && jsx(DescriptionFieldTemplate, {
661
- id: descriptionId(idSchema),
662
- description: description,
663
- schema: schema,
664
- uiSchema: uiSchema,
665
- registry: registry
666
- }), properties.map(prop => prop.content), canExpand(schema, uiSchema, formData) && jsx(Grid.Column, {
667
- width: 16,
668
- verticalAlign: 'middle',
669
- children: jsx(Grid.Row, {
670
- children: jsx("div", {
671
- style: {
672
- marginTop: '1rem',
673
- position: 'relative',
674
- textAlign: 'right'
675
- },
676
- children: jsx(AddButton, {
521
+ return /* @__PURE__ */ jsxs6(Fragment2, { children: [
522
+ title && /* @__PURE__ */ jsx12(
523
+ TitleFieldTemplate,
524
+ {
525
+ id: titleId(idSchema),
526
+ title,
527
+ required,
528
+ schema,
529
+ uiSchema,
530
+ registry
531
+ }
532
+ ),
533
+ description && /* @__PURE__ */ jsx12(
534
+ DescriptionFieldTemplate,
535
+ {
536
+ id: descriptionId(idSchema),
537
+ description,
538
+ schema,
539
+ uiSchema,
540
+ registry
541
+ }
542
+ ),
543
+ properties.map((prop) => prop.content),
544
+ canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx12(Grid2.Column, { width: 16, verticalAlign: "middle", children: /* @__PURE__ */ jsx12(Grid2.Row, { children: /* @__PURE__ */ jsx12(
545
+ "div",
546
+ {
547
+ style: {
548
+ marginTop: "1rem",
549
+ position: "relative",
550
+ textAlign: "right"
551
+ },
552
+ children: /* @__PURE__ */ jsx12(
553
+ AddButton2,
554
+ {
677
555
  onClick: onAddClick(schema),
678
556
  disabled: disabled || readonly,
679
- uiSchema: uiSchema,
680
- registry: registry
681
- })
682
- })
683
- })
684
- })]
685
- });
557
+ uiSchema,
558
+ registry
559
+ }
560
+ )
561
+ }
562
+ ) }) })
563
+ ] });
686
564
  }
687
565
 
688
- /** The `SubmitButton` renders a button that represent the `Submit` action on a form
689
- */
690
- function SubmitButton({
691
- uiSchema
692
- }) {
693
- const {
694
- submitText,
695
- norender,
696
- props: submitButtonProps = {}
697
- } = getSubmitButtonOptions(uiSchema);
566
+ // src/SubmitButton/SubmitButton.tsx
567
+ import { Button as Button4 } from "semantic-ui-react";
568
+ import { getSubmitButtonOptions } from "@rjsf/utils";
569
+ import { jsx as jsx13 } from "react/jsx-runtime";
570
+ function SubmitButton({ uiSchema }) {
571
+ const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
698
572
  if (norender) {
699
573
  return null;
700
574
  }
701
- return jsx(Button, {
702
- type: 'submit',
703
- primary: true,
704
- ...submitButtonProps,
705
- children: submitText
706
- });
575
+ return /* @__PURE__ */ jsx13(Button4, { type: "submit", primary: true, ...submitButtonProps, children: submitText });
707
576
  }
708
577
 
709
- const DEFAULT_OPTIONS = {
578
+ // src/TitleField/TitleField.tsx
579
+ import { Header } from "semantic-ui-react";
580
+ import { jsx as jsx14 } from "react/jsx-runtime";
581
+ var DEFAULT_OPTIONS2 = {
710
582
  inverted: false,
711
583
  dividing: true
712
584
  };
713
- /** The `TitleField` is the template to use to render the title of a field
714
- *
715
- * @param props - The `TitleFieldProps` for this component
716
- */
717
585
  function TitleField({
718
586
  id,
719
587
  title,
@@ -721,24 +589,21 @@ function TitleField({
721
589
  }) {
722
590
  const semanticProps = getSemanticProps({
723
591
  uiSchema,
724
- defaultSchemaProps: DEFAULT_OPTIONS
592
+ defaultSchemaProps: DEFAULT_OPTIONS2
725
593
  });
726
594
  if (!title) {
727
595
  return null;
728
596
  }
729
- return jsx(Header, {
730
- id: id,
731
- ...semanticProps,
732
- as: 'h5',
733
- children: title
734
- });
597
+ return /* @__PURE__ */ jsx14(Header, { id, ...semanticProps, as: "h5", children: title });
735
598
  }
736
599
 
737
- /** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
738
- * part of an `additionalProperties` part of a schema.
739
- *
740
- * @param props - The `WrapIfAdditionalProps` for this component
741
- */
600
+ // src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
601
+ import {
602
+ ADDITIONAL_PROPERTY_FLAG,
603
+ TranslatableString as TranslatableString4
604
+ } from "@rjsf/utils";
605
+ import { Form as Form3, Grid as Grid3 } from "semantic-ui-react";
606
+ import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
742
607
  function WrapIfAdditionalTemplate(props) {
743
608
  const {
744
609
  children,
@@ -755,76 +620,50 @@ function WrapIfAdditionalTemplate(props) {
755
620
  uiSchema,
756
621
  registry
757
622
  } = props;
758
- const {
759
- templates,
760
- translateString
761
- } = registry;
762
- // Button templates are not overridden in the uiSchema
763
- const {
764
- RemoveButton
765
- } = templates.ButtonTemplates;
766
- const keyLabel = translateString(TranslatableString.KeyLabel, [label]);
767
- const {
768
- readonlyAsDisabled = true,
769
- wrapperStyle
770
- } = registry.formContext;
771
- const additional = (ADDITIONAL_PROPERTY_FLAG in schema);
623
+ const { templates, translateString } = registry;
624
+ const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
625
+ const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
626
+ const { readonlyAsDisabled = true, wrapperStyle } = registry.formContext;
627
+ const additional = ADDITIONAL_PROPERTY_FLAG in schema;
772
628
  if (!additional) {
773
- return jsx("div", {
774
- className: classNames,
775
- style: style,
776
- children: children
777
- });
629
+ return /* @__PURE__ */ jsx15("div", { className: classNames, style, children });
778
630
  }
779
- const handleBlur = ({
780
- target
781
- }) => onKeyChange(target.value);
782
- return jsx("div", {
783
- className: classNames,
784
- style: style,
785
- children: jsx(Grid, {
786
- columns: 'equal',
787
- children: jsxs(Grid.Row, {
788
- children: [jsx(Grid.Column, {
789
- className: 'form-additional',
790
- children: jsx(Form.Group, {
791
- widths: 'equal',
792
- grouped: true,
793
- children: jsx(Form.Input, {
794
- className: 'form-group',
795
- hasFeedback: true,
796
- fluid: true,
797
- htmlFor: `${id}`,
798
- label: keyLabel,
799
- required: required,
800
- defaultValue: label,
801
- disabled: disabled || readonlyAsDisabled && readonly,
802
- id: `${id}`,
803
- name: `${id}`,
804
- onBlur: !readonly ? handleBlur : undefined,
805
- style: wrapperStyle,
806
- type: 'text'
807
- })
808
- })
809
- }), jsx(Grid.Column, {
810
- className: 'form-additional',
811
- verticalAlign: 'middle',
812
- children: children
813
- }), jsx(Grid.Column, {
814
- children: jsx(RemoveButton, {
815
- iconType: 'mini',
816
- className: 'array-item-remove',
817
- disabled: disabled || readonly,
818
- onClick: onDropPropertyClick(label),
819
- uiSchema: uiSchema,
820
- registry: registry
821
- })
822
- })]
823
- })
824
- })
825
- }, `${id}-key`);
631
+ const handleBlur = ({ target }) => onKeyChange(target.value);
632
+ return /* @__PURE__ */ jsx15("div", { className: classNames, style, children: /* @__PURE__ */ jsx15(Grid3, { columns: "equal", children: /* @__PURE__ */ jsxs7(Grid3.Row, { children: [
633
+ /* @__PURE__ */ jsx15(Grid3.Column, { className: "form-additional", children: /* @__PURE__ */ jsx15(Form3.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ jsx15(
634
+ Form3.Input,
635
+ {
636
+ className: "form-group",
637
+ hasFeedback: true,
638
+ fluid: true,
639
+ htmlFor: `${id}`,
640
+ label: keyLabel,
641
+ required,
642
+ defaultValue: label,
643
+ disabled: disabled || readonlyAsDisabled && readonly,
644
+ id: `${id}`,
645
+ name: `${id}`,
646
+ onBlur: !readonly ? handleBlur : void 0,
647
+ style: wrapperStyle,
648
+ type: "text"
649
+ }
650
+ ) }) }),
651
+ /* @__PURE__ */ jsx15(Grid3.Column, { className: "form-additional", verticalAlign: "middle", children }),
652
+ /* @__PURE__ */ jsx15(Grid3.Column, { children: /* @__PURE__ */ jsx15(
653
+ RemoveButton2,
654
+ {
655
+ iconType: "mini",
656
+ className: "array-item-remove",
657
+ disabled: disabled || readonly,
658
+ onClick: onDropPropertyClick(label),
659
+ uiSchema,
660
+ registry
661
+ }
662
+ ) })
663
+ ] }) }) }, `${id}-key`);
826
664
  }
827
665
 
666
+ // src/Templates/Templates.ts
828
667
  function generateTemplates() {
829
668
  return {
830
669
  ArrayFieldItemTemplate,
@@ -848,20 +687,25 @@ function generateTemplates() {
848
687
  WrapIfAdditionalTemplate
849
688
  };
850
689
  }
851
- var Templates = /*#__PURE__*/generateTemplates();
690
+ var Templates_default = generateTemplates();
852
691
 
853
- /** The `CheckBoxWidget` is a widget for rendering boolean properties.
854
- * It is typically used to represent a boolean.
855
- *
856
- * @param props - The `WidgetProps` for this component
857
- */
692
+ // src/CheckboxWidget/CheckboxWidget.tsx
693
+ import {
694
+ ariaDescribedByIds as ariaDescribedByIds2,
695
+ descriptionId as descriptionId2,
696
+ getTemplate as getTemplate4,
697
+ labelValue as labelValue2,
698
+ schemaRequiresTrueValue
699
+ } from "@rjsf/utils";
700
+ import { Form as Form4 } from "semantic-ui-react";
701
+ import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
858
702
  function CheckboxWidget(props) {
859
703
  const {
860
704
  id,
861
705
  value,
862
706
  disabled,
863
707
  readonly,
864
- label = '',
708
+ label = "",
865
709
  hideLabel,
866
710
  autofocus,
867
711
  onChange,
@@ -879,49 +723,64 @@ function CheckboxWidget(props) {
879
723
  formContext,
880
724
  uiSchema,
881
725
  defaultSchemaProps: {
882
- inverted: 'false'
726
+ inverted: "false"
883
727
  }
884
728
  });
885
- const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, options);
886
- // Because an unchecked checkbox will cause html5 validation to fail, only add
887
- // the "required" attribute if the field value must be "true", due to the
888
- // "const" or "enum" keywords
729
+ const DescriptionFieldTemplate = getTemplate4(
730
+ "DescriptionFieldTemplate",
731
+ registry,
732
+ options
733
+ );
889
734
  const required = schemaRequiresTrueValue(schema);
890
735
  const _onChange = (_, data) => onChange && onChange(data.checked);
891
736
  const _onBlur = () => onBlur && onBlur(id, value);
892
737
  const _onFocus = () => onFocus && onFocus(id, value);
893
- const checked = value == 'true' || value == true;
738
+ const checked = value == "true" || value == true;
894
739
  const description = options.description ?? schema.description;
895
- return jsxs(Fragment, {
896
- children: [!hideLabel && !!description && jsx(DescriptionFieldTemplate, {
897
- id: descriptionId(id),
898
- description: description,
899
- schema: schema,
900
- uiSchema: uiSchema,
901
- registry: registry
902
- }), jsx(Form.Checkbox, {
903
- id: id,
904
- name: id,
905
- disabled: disabled || readonly,
906
- autoFocus: autofocus,
907
- ...semanticProps,
908
- checked: typeof value === 'undefined' ? false : checked,
909
- error: rawErrors.length > 0,
910
- onChange: _onChange,
911
- onBlur: _onBlur,
912
- onFocus: _onFocus,
913
- required: required,
914
- label: labelValue(label, hideLabel, false),
915
- "aria-describedby": ariaDescribedByIds(id)
916
- })]
917
- });
740
+ return /* @__PURE__ */ jsxs8(Fragment3, { children: [
741
+ !hideLabel && !!description && /* @__PURE__ */ jsx16(
742
+ DescriptionFieldTemplate,
743
+ {
744
+ id: descriptionId2(id),
745
+ description,
746
+ schema,
747
+ uiSchema,
748
+ registry
749
+ }
750
+ ),
751
+ /* @__PURE__ */ jsx16(
752
+ Form4.Checkbox,
753
+ {
754
+ id,
755
+ name: id,
756
+ disabled: disabled || readonly,
757
+ autoFocus: autofocus,
758
+ ...semanticProps,
759
+ checked: typeof value === "undefined" ? false : checked,
760
+ error: rawErrors.length > 0,
761
+ onChange: _onChange,
762
+ onBlur: _onBlur,
763
+ onFocus: _onFocus,
764
+ required,
765
+ label: labelValue2(label, hideLabel, false),
766
+ "aria-describedby": ariaDescribedByIds2(id)
767
+ }
768
+ )
769
+ ] });
918
770
  }
919
771
 
920
- /** The `CheckboxesWidget` is a widget for rendering checkbox groups.
921
- * It is typically used to represent an array of enums.
922
- *
923
- * @param props - The `WidgetProps` for this component
924
- */
772
+ // src/CheckboxesWidget/CheckboxesWidget.tsx
773
+ import { Form as Form5 } from "semantic-ui-react";
774
+ import {
775
+ ariaDescribedByIds as ariaDescribedByIds3,
776
+ enumOptionsDeselectValue,
777
+ enumOptionsIsSelected,
778
+ enumOptionsSelectValue,
779
+ getTemplate as getTemplate5,
780
+ optionId,
781
+ titleId as titleId2
782
+ } from "@rjsf/utils";
783
+ import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
925
784
  function CheckboxesWidget(props) {
926
785
  const {
927
786
  id,
@@ -941,27 +800,18 @@ function CheckboxesWidget(props) {
941
800
  rawErrors = [],
942
801
  registry
943
802
  } = props;
944
- const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
945
- const {
946
- enumOptions,
947
- enumDisabled,
948
- inline
949
- } = options;
803
+ const TitleFieldTemplate = getTemplate5("TitleFieldTemplate", registry, options);
804
+ const { enumOptions, enumDisabled, inline } = options;
950
805
  const checkboxesValues = Array.isArray(value) ? value : [value];
951
806
  const semanticProps = getSemanticProps({
952
807
  options,
953
808
  formContext,
954
809
  uiSchema,
955
810
  defaultSchemaProps: {
956
- inverted: 'false'
811
+ inverted: "false"
957
812
  }
958
813
  });
959
- const _onChange = index => ({
960
- target: {
961
- checked
962
- }
963
- }) => {
964
- // eslint-disable-next-line no-shadow
814
+ const _onChange = (index) => ({ target: { checked } }) => {
965
815
  if (checked) {
966
816
  onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
967
817
  } else {
@@ -970,49 +820,44 @@ function CheckboxesWidget(props) {
970
820
  };
971
821
  const _onBlur = () => onBlur(id, value);
972
822
  const _onFocus = () => onFocus(id, value);
973
- const inlineOption = inline ? {
974
- inline: true
975
- } : {
976
- grouped: true
977
- };
978
- return jsxs(Fragment, {
979
- children: [!hideLabel && !!label && jsx(TitleFieldTemplate, {
980
- id: titleId(id),
981
- title: label,
982
- schema: schema,
983
- uiSchema: uiSchema,
984
- registry: registry
985
- }), jsx(Form.Group, {
986
- id: id,
987
- name: id,
988
- ...inlineOption,
989
- children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
990
- const checked = enumOptionsIsSelected(option.value, checkboxesValues);
991
- const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
992
- return jsx(Form.Checkbox, {
823
+ const inlineOption = inline ? { inline: true } : { grouped: true };
824
+ return /* @__PURE__ */ jsxs9(Fragment4, { children: [
825
+ !hideLabel && !!label && /* @__PURE__ */ jsx17(TitleFieldTemplate, { id: titleId2(id), title: label, schema, uiSchema, registry }),
826
+ /* @__PURE__ */ jsx17(Form5.Group, { id, name: id, ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
827
+ const checked = enumOptionsIsSelected(option.value, checkboxesValues);
828
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
829
+ return /* @__PURE__ */ jsx17(
830
+ Form5.Checkbox,
831
+ {
993
832
  id: optionId(id, index),
994
833
  name: id,
995
834
  label: option.label,
996
835
  ...semanticProps,
997
- checked: checked,
836
+ checked,
998
837
  error: rawErrors.length > 0,
999
838
  disabled: disabled || itemDisabled || readonly,
1000
839
  autoFocus: autofocus && index === 0,
1001
840
  onChange: _onChange(index),
1002
841
  onBlur: _onBlur,
1003
842
  onFocus: _onFocus,
1004
- "aria-describedby": ariaDescribedByIds(id)
1005
- }, index);
1006
- })
1007
- })]
1008
- });
843
+ "aria-describedby": ariaDescribedByIds3(id)
844
+ },
845
+ index
846
+ );
847
+ }) })
848
+ ] });
1009
849
  }
1010
850
 
1011
- /** The `RadioWidget` is a widget for rendering a radio group.
1012
- * It is typically used with a string property constrained with enum options.
1013
- *
1014
- * @param props - The `WidgetProps` for this component
1015
- */
851
+ // src/RadioWidget/RadioWidget.tsx
852
+ import {
853
+ ariaDescribedByIds as ariaDescribedByIds4,
854
+ enumOptionsIsSelected as enumOptionsIsSelected2,
855
+ enumOptionsValueForIndex,
856
+ optionId as optionId2
857
+ } from "@rjsf/utils";
858
+ import { Form as Form6, Radio } from "semantic-ui-react";
859
+ import { jsx as jsx18 } from "react/jsx-runtime";
860
+ import { createElement } from "react";
1016
861
  function RadioWidget(props) {
1017
862
  const {
1018
863
  id,
@@ -1028,37 +873,27 @@ function RadioWidget(props) {
1028
873
  uiSchema,
1029
874
  rawErrors = []
1030
875
  } = props;
1031
- const {
1032
- enumOptions,
1033
- enumDisabled,
1034
- emptyValue
1035
- } = options;
876
+ const { enumOptions, enumDisabled, emptyValue } = options;
1036
877
  const semanticProps = getSemanticProps({
1037
878
  formContext,
1038
879
  options,
1039
880
  uiSchema
1040
881
  });
1041
- const _onChange = (_, {
1042
- value: eventValue
1043
- }) => {
882
+ const _onChange = (_, { value: eventValue }) => {
1044
883
  return onChange(enumOptionsValueForIndex(eventValue, enumOptions, emptyValue));
1045
884
  };
1046
885
  const _onBlur = () => onBlur(id, value);
1047
886
  const _onFocus = () => onFocus(id, value);
1048
- const inlineOption = options.inline ? {
1049
- inline: true
1050
- } : {
1051
- grouped: true
1052
- };
1053
- return jsx(Form.Group, {
1054
- ...inlineOption,
1055
- children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
1056
- const checked = enumOptionsIsSelected(option.value, value);
1057
- const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
1058
- return /*#__PURE__*/createElement(Form.Field, {
1059
- required: required,
887
+ const inlineOption = options.inline ? { inline: true } : { grouped: true };
888
+ return /* @__PURE__ */ jsx18(Form6.Group, { ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
889
+ const checked = enumOptionsIsSelected2(option.value, value);
890
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
891
+ return /* @__PURE__ */ createElement(
892
+ Form6.Field,
893
+ {
894
+ required,
1060
895
  control: Radio,
1061
- id: optionId(id, index),
896
+ id: optionId2(id, index),
1062
897
  name: id,
1063
898
  ...semanticProps,
1064
899
  onFocus: _onFocus,
@@ -1068,19 +903,18 @@ function RadioWidget(props) {
1068
903
  value: String(index),
1069
904
  error: rawErrors.length > 0,
1070
905
  key: index,
1071
- checked: checked,
906
+ checked,
1072
907
  disabled: disabled || itemDisabled || readonly,
1073
- "aria-describedby": ariaDescribedByIds(id)
1074
- });
1075
- })
1076
- });
908
+ "aria-describedby": ariaDescribedByIds4(id)
909
+ }
910
+ );
911
+ }) });
1077
912
  }
1078
913
 
1079
- /** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
1080
- * in a div, with the value along side it.
1081
- *
1082
- * @param props - The `WidgetProps` for this component
1083
- */
914
+ // src/RangeWidget/RangeWidget.tsx
915
+ import { Input } from "semantic-ui-react";
916
+ import { ariaDescribedByIds as ariaDescribedByIds5, rangeSpec } from "@rjsf/utils";
917
+ import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
1084
918
  function RangeWidget(props) {
1085
919
  const {
1086
920
  id,
@@ -1105,47 +939,46 @@ function RangeWidget(props) {
1105
939
  fluid: true
1106
940
  }
1107
941
  });
1108
- // eslint-disable-next-line no-shadow
1109
- const _onChange = ({
1110
- target: {
1111
- value
1112
- }
1113
- }) => onChange && onChange(value === '' ? options.emptyValue : value);
942
+ const _onChange = ({ target: { value: value2 } }) => onChange && onChange(value2 === "" ? options.emptyValue : value2);
1114
943
  const _onBlur = () => onBlur && onBlur(id, value);
1115
944
  const _onFocus = () => onFocus && onFocus(id, value);
1116
- return jsxs(Fragment, {
1117
- children: [jsx(Input, {
1118
- id: id,
1119
- name: id,
1120
- type: 'range',
1121
- required: required,
1122
- disabled: disabled || readonly,
1123
- ...rangeSpec(schema),
1124
- ...semanticProps,
1125
- value: value || '',
1126
- error: rawErrors.length > 0,
1127
- onChange: _onChange,
1128
- onBlur: _onBlur,
1129
- onFocus: _onFocus,
1130
- "aria-describedby": ariaDescribedByIds(id)
1131
- }, id), jsx("span", {
1132
- children: value
1133
- })]
1134
- });
945
+ return /* @__PURE__ */ jsxs10(Fragment5, { children: [
946
+ /* @__PURE__ */ jsx19(
947
+ Input,
948
+ {
949
+ id,
950
+ name: id,
951
+ type: "range",
952
+ required,
953
+ disabled: disabled || readonly,
954
+ ...rangeSpec(schema),
955
+ ...semanticProps,
956
+ value: value || "",
957
+ error: rawErrors.length > 0,
958
+ onChange: _onChange,
959
+ onBlur: _onBlur,
960
+ onFocus: _onFocus,
961
+ "aria-describedby": ariaDescribedByIds5(id)
962
+ },
963
+ id
964
+ ),
965
+ /* @__PURE__ */ jsx19("span", { children: value })
966
+ ] });
1135
967
  }
1136
968
 
1137
- /**
1138
- * Returns and creates an array format required for semantic drop down
1139
- * @param {array} enumOptions- array of items for the dropdown
1140
- * @param {array} enumDisabled - array of enum option values to disable
1141
- * @returns {*}
1142
- */
969
+ // src/SelectWidget/SelectWidget.tsx
970
+ import {
971
+ ariaDescribedByIds as ariaDescribedByIds6,
972
+ enumOptionsIndexForValue,
973
+ enumOptionsValueForIndex as enumOptionsValueForIndex2,
974
+ labelValue as labelValue3
975
+ } from "@rjsf/utils";
976
+ import map from "lodash/map";
977
+ import { Form as Form7 } from "semantic-ui-react";
978
+ import { jsx as jsx20 } from "react/jsx-runtime";
1143
979
  function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled) {
1144
980
  const disabledOptions = enumDisabled || [];
1145
- const options = map(enumOptions, ({
1146
- label,
1147
- value
1148
- }, index) => ({
981
+ const options = map(enumOptions, ({ label, value }, index) => ({
1149
982
  disabled: disabledOptions.indexOf(value) !== -1,
1150
983
  key: label,
1151
984
  text: label,
@@ -1153,11 +986,6 @@ function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled) {
1153
986
  }));
1154
987
  return options;
1155
988
  }
1156
- /** The `SelectWidget` is a widget for rendering dropdowns.
1157
- * It is typically used with string properties constrained with enum options.
1158
- *
1159
- * @param props - The `WidgetProps` for this component
1160
- */
1161
989
  function SelectWidget(props) {
1162
990
  const {
1163
991
  uiSchema,
@@ -1183,60 +1011,52 @@ function SelectWidget(props) {
1183
1011
  formContext,
1184
1012
  options,
1185
1013
  defaultSchemaProps: {
1186
- inverted: 'false',
1014
+ inverted: "false",
1187
1015
  selection: true,
1188
1016
  fluid: true,
1189
1017
  scrolling: true,
1190
1018
  upward: false
1191
1019
  }
1192
1020
  });
1193
- const {
1194
- enumDisabled,
1195
- enumOptions,
1196
- emptyValue: optEmptyVal
1197
- } = options;
1198
- const emptyValue = multiple ? [] : '';
1021
+ const { enumDisabled, enumOptions, emptyValue: optEmptyVal } = options;
1022
+ const emptyValue = multiple ? [] : "";
1199
1023
  const dropdownOptions = createDefaultValueOptionsForDropDown(enumOptions, enumDisabled);
1200
- const _onChange = (_, {
1201
- value
1202
- }) => onChange(enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1203
- // eslint-disable-next-line no-shadow
1204
- const _onBlur = (_, {
1205
- target: {
1206
- value
1207
- }
1208
- }) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1209
- const _onFocus = (_, {
1210
- target: {
1211
- value
1212
- }
1213
- }) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
1024
+ const _onChange = (_, { value: value2 }) => onChange(enumOptionsValueForIndex2(value2, enumOptions, optEmptyVal));
1025
+ const _onBlur = (_, { target: { value: value2 } }) => onBlur(id, enumOptionsValueForIndex2(value2, enumOptions, optEmptyVal));
1026
+ const _onFocus = (_, { target: { value: value2 } }) => onFocus(id, enumOptionsValueForIndex2(value2, enumOptions, optEmptyVal));
1214
1027
  const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
1215
- return jsx(Form.Dropdown, {
1216
- id: id,
1217
- name: id,
1218
- label: labelValue(label || undefined, hideLabel, false),
1219
- multiple: typeof multiple === 'undefined' ? false : multiple,
1220
- value: typeof value === 'undefined' ? emptyValue : selectedIndexes,
1221
- error: rawErrors.length > 0,
1222
- disabled: disabled,
1223
- placeholder: placeholder,
1224
- ...semanticProps,
1225
- required: required,
1226
- autoFocus: autofocus,
1227
- readOnly: readonly,
1228
- options: dropdownOptions,
1229
- onChange: _onChange,
1230
- onBlur: _onBlur,
1231
- onFocus: _onFocus,
1232
- "aria-describedby": ariaDescribedByIds(id)
1233
- }, id);
1028
+ return /* @__PURE__ */ jsx20(
1029
+ Form7.Dropdown,
1030
+ {
1031
+ id,
1032
+ name: id,
1033
+ label: labelValue3(label || void 0, hideLabel, false),
1034
+ multiple: typeof multiple === "undefined" ? false : multiple,
1035
+ value: typeof value === "undefined" ? emptyValue : selectedIndexes,
1036
+ error: rawErrors.length > 0,
1037
+ disabled,
1038
+ placeholder,
1039
+ ...semanticProps,
1040
+ required,
1041
+ autoFocus: autofocus,
1042
+ readOnly: readonly,
1043
+ options: dropdownOptions,
1044
+ onChange: _onChange,
1045
+ onBlur: _onBlur,
1046
+ onFocus: _onFocus,
1047
+ "aria-describedby": ariaDescribedByIds6(id)
1048
+ },
1049
+ id
1050
+ );
1234
1051
  }
1235
1052
 
1236
- /** The `TextareaWidget` is a widget for rendering input fields as textarea.
1237
- *
1238
- * @param props - The `WidgetProps` for this component
1239
- */
1053
+ // src/TextareaWidget/TextareaWidget.tsx
1054
+ import {
1055
+ ariaDescribedByIds as ariaDescribedByIds7,
1056
+ labelValue as labelValue4
1057
+ } from "@rjsf/utils";
1058
+ import { Form as Form8 } from "semantic-ui-react";
1059
+ import { jsx as jsx21 } from "react/jsx-runtime";
1240
1060
  function TextareaWidget(props) {
1241
1061
  const {
1242
1062
  id,
@@ -1258,37 +1078,35 @@ function TextareaWidget(props) {
1258
1078
  const semanticProps = getSemanticProps({
1259
1079
  formContext,
1260
1080
  options,
1261
- defaultSchemaProps: {
1262
- inverted: 'false'
1263
- }
1081
+ defaultSchemaProps: { inverted: "false" }
1264
1082
  });
1265
- // eslint-disable-next-line no-shadow
1266
- const _onChange = ({
1267
- target: {
1268
- value
1269
- }
1270
- }) => onChange && onChange(value === '' ? options.emptyValue : value);
1083
+ const _onChange = ({ target: { value: value2 } }) => onChange && onChange(value2 === "" ? options.emptyValue : value2);
1271
1084
  const _onBlur = () => onBlur && onBlur(id, value);
1272
1085
  const _onFocus = () => onFocus && onFocus(id, value);
1273
- return jsx(Form.TextArea, {
1274
- id: id,
1275
- name: id,
1276
- label: labelValue(label || undefined, hideLabel, false),
1277
- placeholder: placeholder,
1278
- autoFocus: autofocus,
1279
- required: required,
1280
- disabled: disabled || readonly,
1281
- ...semanticProps,
1282
- value: value || '',
1283
- error: rawErrors.length > 0,
1284
- rows: options.rows || 5,
1285
- onChange: _onChange,
1286
- onBlur: _onBlur,
1287
- onFocus: _onFocus,
1288
- "aria-describedby": ariaDescribedByIds(id)
1289
- }, id);
1086
+ return /* @__PURE__ */ jsx21(
1087
+ Form8.TextArea,
1088
+ {
1089
+ id,
1090
+ name: id,
1091
+ label: labelValue4(label || void 0, hideLabel, false),
1092
+ placeholder,
1093
+ autoFocus: autofocus,
1094
+ required,
1095
+ disabled: disabled || readonly,
1096
+ ...semanticProps,
1097
+ value: value || "",
1098
+ error: rawErrors.length > 0,
1099
+ rows: options.rows || 5,
1100
+ onChange: _onChange,
1101
+ onBlur: _onBlur,
1102
+ onFocus: _onFocus,
1103
+ "aria-describedby": ariaDescribedByIds7(id)
1104
+ },
1105
+ id
1106
+ );
1290
1107
  }
1291
1108
 
1109
+ // src/Widgets/Widgets.tsx
1292
1110
  function generateWidgets() {
1293
1111
  return {
1294
1112
  CheckboxWidget,
@@ -1299,21 +1117,35 @@ function generateWidgets() {
1299
1117
  TextareaWidget
1300
1118
  };
1301
1119
  }
1302
- var Widgets = /*#__PURE__*/generateWidgets();
1120
+ var Widgets_default = generateWidgets();
1303
1121
 
1122
+ // src/Theme/Theme.ts
1304
1123
  function generateTheme() {
1305
1124
  return {
1306
1125
  templates: generateTemplates(),
1307
1126
  widgets: generateWidgets(),
1308
- _internalFormWrapper: Form
1127
+ _internalFormWrapper: SuiForm
1309
1128
  };
1310
1129
  }
1311
- var Theme = /*#__PURE__*/generateTheme();
1130
+ var Theme_default = generateTheme();
1312
1131
 
1132
+ // src/SemanticUIForm/SemanticUIForm.ts
1313
1133
  function generateForm() {
1314
1134
  return withTheme(generateTheme());
1315
1135
  }
1316
- var SemanticUIForm = /*#__PURE__*/generateForm();
1136
+ var SemanticUIForm_default = generateForm();
1317
1137
 
1318
- export { SemanticUIForm as Form, Templates, Theme, Widgets, SemanticUIForm as default, generateForm, generateTemplates, generateTheme, generateWidgets };
1138
+ // src/index.ts
1139
+ var src_default = SemanticUIForm_default;
1140
+ export {
1141
+ SemanticUIForm_default as Form,
1142
+ Templates_default as Templates,
1143
+ Theme_default as Theme,
1144
+ Widgets_default as Widgets,
1145
+ src_default as default,
1146
+ generateForm,
1147
+ generateTemplates,
1148
+ generateTheme,
1149
+ generateWidgets
1150
+ };
1319
1151
  //# sourceMappingURL=semantic-ui.esm.js.map