@rjsf/semantic-ui 6.0.0-alpha.0 → 6.0.0-beta.2
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.
- package/dist/index.js +101 -127
- package/dist/index.js.map +4 -4
- package/dist/semantic-ui.esm.js +93 -115
- package/dist/semantic-ui.esm.js.map +4 -4
- package/dist/semantic-ui.umd.js +36 -67
- package/lib/AddButton/index.d.ts +2 -2
- package/lib/AddButton/index.js +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +3 -3
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +6 -6
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/index.d.ts +2 -2
- package/lib/ArrayFieldItemTemplate/index.js +2 -2
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +4 -4
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/index.d.ts +2 -2
- package/lib/ArrayFieldTemplate/index.js +2 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js +1 -1
- package/lib/BaseInputTemplate/index.d.ts +2 -2
- package/lib/BaseInputTemplate/index.js +2 -2
- package/lib/CheckboxWidget/CheckboxWidget.js +2 -2
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxWidget/index.d.ts +2 -2
- package/lib/CheckboxWidget/index.js +2 -2
- package/lib/CheckboxesWidget/CheckboxesWidget.js +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/CheckboxesWidget/index.d.ts +2 -2
- package/lib/CheckboxesWidget/index.js +2 -2
- package/lib/DescriptionField/DescriptionField.js +3 -2
- package/lib/DescriptionField/DescriptionField.js.map +1 -1
- package/lib/DescriptionField/index.d.ts +2 -2
- package/lib/DescriptionField/index.js +2 -2
- package/lib/ErrorList/index.d.ts +2 -2
- package/lib/ErrorList/index.js +2 -2
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldErrorTemplate/index.d.ts +2 -2
- package/lib/FieldErrorTemplate/index.js +2 -2
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/index.d.ts +2 -2
- package/lib/FieldHelpTemplate/index.js +2 -2
- package/lib/FieldTemplate/FieldTemplate.js +1 -1
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/FieldTemplate/index.d.ts +2 -2
- package/lib/FieldTemplate/index.js +2 -2
- package/lib/GridTemplate/GridTemplate.d.ts +7 -0
- package/lib/GridTemplate/GridTemplate.js +15 -0
- package/lib/GridTemplate/GridTemplate.js.map +1 -0
- package/lib/GridTemplate/index.d.ts +2 -0
- package/lib/GridTemplate/index.js +3 -0
- package/lib/GridTemplate/index.js.map +1 -0
- package/lib/IconButton/index.d.ts +2 -2
- package/lib/IconButton/index.js +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/ObjectFieldTemplate/index.d.ts +2 -2
- package/lib/ObjectFieldTemplate/index.js +2 -2
- package/lib/RadioWidget/RadioWidget.js +1 -1
- package/lib/RadioWidget/index.d.ts +2 -2
- package/lib/RadioWidget/index.js +2 -2
- package/lib/RangeWidget/RangeWidget.js +1 -1
- package/lib/RangeWidget/index.d.ts +2 -2
- package/lib/RangeWidget/index.js +2 -2
- package/lib/SelectWidget/SelectWidget.js +1 -1
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SelectWidget/index.d.ts +2 -2
- package/lib/SelectWidget/index.js +2 -2
- package/lib/SemanticUIForm/SemanticUIForm.js +1 -1
- package/lib/SemanticUIForm/index.d.ts +2 -2
- package/lib/SemanticUIForm/index.js +2 -2
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/SubmitButton/index.d.ts +2 -2
- package/lib/SubmitButton/index.js +2 -2
- package/lib/Templates/Templates.js +16 -14
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/Templates/index.d.ts +2 -2
- package/lib/Templates/index.js +2 -2
- package/lib/TextareaWidget/TextareaWidget.js +1 -1
- package/lib/TextareaWidget/index.d.ts +2 -2
- package/lib/TextareaWidget/index.js +2 -2
- package/lib/Theme/Theme.js +2 -2
- package/lib/Theme/index.d.ts +2 -2
- package/lib/Theme/index.js +2 -2
- package/lib/TitleField/TitleField.js +1 -1
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/TitleField/index.d.ts +2 -2
- package/lib/TitleField/index.js +2 -2
- package/lib/Widgets/Widgets.js +6 -6
- package/lib/Widgets/index.d.ts +2 -2
- package/lib/Widgets/index.js +2 -2
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -2
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/index.d.ts +2 -2
- package/lib/WrapIfAdditionalTemplate/index.js +2 -2
- package/lib/index.d.ts +5 -5
- package/lib/index.js +5 -5
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +42 -36
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +15 -62
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +16 -8
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +1 -1
- package/src/CheckboxWidget/CheckboxWidget.tsx +3 -3
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +1 -1
- package/src/DescriptionField/DescriptionField.tsx +4 -3
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +1 -1
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +1 -1
- package/src/FieldTemplate/FieldTemplate.tsx +2 -2
- package/src/GridTemplate/GridTemplate.tsx +15 -0
- package/src/GridTemplate/index.ts +2 -0
- package/src/IconButton/IconButton.tsx +5 -5
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +5 -2
- package/src/RadioWidget/RadioWidget.tsx +1 -1
- package/src/RangeWidget/RangeWidget.tsx +1 -1
- package/src/SelectWidget/SelectWidget.tsx +3 -3
- package/src/SemanticUIForm/SemanticUIForm.ts +1 -1
- package/src/SubmitButton/SubmitButton.tsx +1 -1
- package/src/Templates/Templates.ts +3 -1
- package/src/TextareaWidget/TextareaWidget.tsx +1 -1
- package/src/Theme/Theme.ts +1 -1
- package/src/Widgets/Widgets.tsx +1 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +4 -2
- package/src/util.tsx +3 -3
- package/LICENSE.md +0 -201
package/dist/index.js
CHANGED
|
@@ -28,25 +28,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
Form: () => SemanticUIForm_default,
|
|
34
34
|
Templates: () => Templates_default,
|
|
35
35
|
Theme: () => Theme_default,
|
|
36
36
|
Widgets: () => Widgets_default,
|
|
37
|
-
default: () =>
|
|
37
|
+
default: () => index_default,
|
|
38
38
|
generateForm: () => generateForm,
|
|
39
39
|
generateTemplates: () => generateTemplates,
|
|
40
40
|
generateTheme: () => generateTheme,
|
|
41
41
|
generateWidgets: () => generateWidgets
|
|
42
42
|
});
|
|
43
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(index_exports);
|
|
44
44
|
|
|
45
45
|
// src/SemanticUIForm/SemanticUIForm.ts
|
|
46
|
-
var
|
|
46
|
+
var import_core2 = require("@rjsf/core");
|
|
47
47
|
|
|
48
48
|
// src/Theme/Theme.ts
|
|
49
|
-
var
|
|
49
|
+
var import_semantic_ui_react20 = require("semantic-ui-react");
|
|
50
50
|
|
|
51
51
|
// src/AddButton/AddButton.tsx
|
|
52
52
|
var import_semantic_ui_react = require("semantic-ui-react");
|
|
@@ -125,69 +125,17 @@ var gridStyle = (vertical) => ({
|
|
|
125
125
|
gridTemplateColumns: `1fr ${vertical ? 65 : 150}px`
|
|
126
126
|
});
|
|
127
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;
|
|
128
|
+
const { children, buttonsProps, hasToolbar, uiSchema, registry } = props;
|
|
145
129
|
const uiOptions = (0, import_utils3.getUiOptions)(uiSchema);
|
|
130
|
+
const ArrayFieldItemButtonsTemplate = (0, import_utils3.getTemplate)(
|
|
131
|
+
"ArrayFieldItemButtonsTemplate",
|
|
132
|
+
registry,
|
|
133
|
+
uiOptions
|
|
134
|
+
);
|
|
146
135
|
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: [
|
|
136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "rjsf-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
137
|
/* @__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:
|
|
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
|
-
] }) })
|
|
138
|
+
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_semantic_ui_react2.Grid.Column, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_semantic_ui_react2.Button.Group, { size: "mini", vertical: !horizontalButtons, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrayFieldItemButtonsTemplate, { ...buttonsProps }) }) })
|
|
191
139
|
] }) }) });
|
|
192
140
|
}
|
|
193
141
|
|
|
@@ -279,7 +227,17 @@ function ArrayFieldTemplate(props) {
|
|
|
279
227
|
position: "relative",
|
|
280
228
|
textAlign: "right"
|
|
281
229
|
},
|
|
282
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
230
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
231
|
+
AddButton2,
|
|
232
|
+
{
|
|
233
|
+
id: (0, import_utils4.buttonId)(idSchema, "add"),
|
|
234
|
+
className: "rjsf-array-item-add",
|
|
235
|
+
onClick: onAddClick,
|
|
236
|
+
disabled: disabled || readonly,
|
|
237
|
+
uiSchema,
|
|
238
|
+
registry
|
|
239
|
+
}
|
|
240
|
+
)
|
|
283
241
|
}
|
|
284
242
|
)
|
|
285
243
|
] }, `array-item-list-${idSchema.$id}`)
|
|
@@ -351,13 +309,14 @@ function BaseInputTemplate(props) {
|
|
|
351
309
|
}
|
|
352
310
|
|
|
353
311
|
// src/DescriptionField/DescriptionField.tsx
|
|
312
|
+
var import_core = require("@rjsf/core");
|
|
354
313
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
355
314
|
function DescriptionField(props) {
|
|
356
|
-
const { id, description } = props;
|
|
315
|
+
const { id, description, registry, uiSchema } = props;
|
|
357
316
|
if (!description) {
|
|
358
317
|
return null;
|
|
359
318
|
}
|
|
360
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id, className: "sui-description", children: description });
|
|
319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id, className: "sui-description", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core.RichDescription, { description, registry, uiSchema }) });
|
|
361
320
|
}
|
|
362
321
|
|
|
363
322
|
// src/ErrorList/ErrorList.tsx
|
|
@@ -510,10 +469,21 @@ function FieldTemplate(props) {
|
|
|
510
469
|
);
|
|
511
470
|
}
|
|
512
471
|
|
|
513
|
-
// src/
|
|
472
|
+
// src/GridTemplate/GridTemplate.tsx
|
|
514
473
|
var import_semantic_ui_react9 = require("semantic-ui-react");
|
|
515
|
-
var import_utils11 = require("@rjsf/utils");
|
|
516
474
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
475
|
+
function GridTemplate(props) {
|
|
476
|
+
const { children, column, ...rest } = props;
|
|
477
|
+
if (column) {
|
|
478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_semantic_ui_react9.Grid.Column, { ...rest, children });
|
|
479
|
+
}
|
|
480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_semantic_ui_react9.Grid, { ...rest, children });
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
484
|
+
var import_semantic_ui_react10 = require("semantic-ui-react");
|
|
485
|
+
var import_utils11 = require("@rjsf/utils");
|
|
486
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
517
487
|
function ObjectFieldTemplate(props) {
|
|
518
488
|
const {
|
|
519
489
|
description,
|
|
@@ -539,8 +509,8 @@ function ObjectFieldTemplate(props) {
|
|
|
539
509
|
const {
|
|
540
510
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
541
511
|
} = registry.templates;
|
|
542
|
-
return /* @__PURE__ */ (0,
|
|
543
|
-
title && /* @__PURE__ */ (0,
|
|
512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
513
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
544
514
|
TitleFieldTemplate,
|
|
545
515
|
{
|
|
546
516
|
id: (0, import_utils11.titleId)(idSchema),
|
|
@@ -551,7 +521,7 @@ function ObjectFieldTemplate(props) {
|
|
|
551
521
|
registry
|
|
552
522
|
}
|
|
553
523
|
),
|
|
554
|
-
description && /* @__PURE__ */ (0,
|
|
524
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
555
525
|
DescriptionFieldTemplate,
|
|
556
526
|
{
|
|
557
527
|
id: (0, import_utils11.descriptionId)(idSchema),
|
|
@@ -562,7 +532,7 @@ function ObjectFieldTemplate(props) {
|
|
|
562
532
|
}
|
|
563
533
|
),
|
|
564
534
|
properties.map((prop) => prop.content),
|
|
565
|
-
(0, import_utils11.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0,
|
|
535
|
+
(0, import_utils11.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_semantic_ui_react10.Grid.Column, { width: 16, verticalAlign: "middle", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_semantic_ui_react10.Grid.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
566
536
|
"div",
|
|
567
537
|
{
|
|
568
538
|
style: {
|
|
@@ -570,9 +540,11 @@ function ObjectFieldTemplate(props) {
|
|
|
570
540
|
position: "relative",
|
|
571
541
|
textAlign: "right"
|
|
572
542
|
},
|
|
573
|
-
children: /* @__PURE__ */ (0,
|
|
543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
574
544
|
AddButton2,
|
|
575
545
|
{
|
|
546
|
+
id: (0, import_utils11.buttonId)(idSchema, "add"),
|
|
547
|
+
className: "rjsf-object-property-expand",
|
|
576
548
|
onClick: onAddClick(schema),
|
|
577
549
|
disabled: disabled || readonly,
|
|
578
550
|
uiSchema,
|
|
@@ -585,20 +557,20 @@ function ObjectFieldTemplate(props) {
|
|
|
585
557
|
}
|
|
586
558
|
|
|
587
559
|
// src/SubmitButton/SubmitButton.tsx
|
|
588
|
-
var
|
|
560
|
+
var import_semantic_ui_react11 = require("semantic-ui-react");
|
|
589
561
|
var import_utils12 = require("@rjsf/utils");
|
|
590
|
-
var
|
|
562
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
591
563
|
function SubmitButton({ uiSchema }) {
|
|
592
564
|
const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils12.getSubmitButtonOptions)(uiSchema);
|
|
593
565
|
if (norender) {
|
|
594
566
|
return null;
|
|
595
567
|
}
|
|
596
|
-
return /* @__PURE__ */ (0,
|
|
568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_semantic_ui_react11.Button, { type: "submit", primary: true, ...submitButtonProps, children: submitText });
|
|
597
569
|
}
|
|
598
570
|
|
|
599
571
|
// src/TitleField/TitleField.tsx
|
|
600
|
-
var
|
|
601
|
-
var
|
|
572
|
+
var import_semantic_ui_react12 = require("semantic-ui-react");
|
|
573
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
602
574
|
var DEFAULT_OPTIONS2 = {
|
|
603
575
|
inverted: false,
|
|
604
576
|
dividing: true
|
|
@@ -615,13 +587,13 @@ function TitleField({
|
|
|
615
587
|
if (!title) {
|
|
616
588
|
return null;
|
|
617
589
|
}
|
|
618
|
-
return /* @__PURE__ */ (0,
|
|
590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_semantic_ui_react12.Header, { id, ...semanticProps, as: "h5", children: title });
|
|
619
591
|
}
|
|
620
592
|
|
|
621
593
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
622
594
|
var import_utils13 = require("@rjsf/utils");
|
|
623
|
-
var
|
|
624
|
-
var
|
|
595
|
+
var import_semantic_ui_react13 = require("semantic-ui-react");
|
|
596
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
625
597
|
function WrapIfAdditionalTemplate(props) {
|
|
626
598
|
const {
|
|
627
599
|
children,
|
|
@@ -644,12 +616,12 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
644
616
|
const { readonlyAsDisabled = true, wrapperStyle } = registry.formContext;
|
|
645
617
|
const additional = import_utils13.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
646
618
|
if (!additional) {
|
|
647
|
-
return /* @__PURE__ */ (0,
|
|
619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: classNames, style, children });
|
|
648
620
|
}
|
|
649
621
|
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
650
|
-
return /* @__PURE__ */ (0,
|
|
651
|
-
/* @__PURE__ */ (0,
|
|
652
|
-
|
|
622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: classNames, style, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_semantic_ui_react13.Grid, { columns: "equal", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_semantic_ui_react13.Grid.Row, { children: [
|
|
623
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_semantic_ui_react13.Grid.Column, { className: "form-additional", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_semantic_ui_react13.Form.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
624
|
+
import_semantic_ui_react13.Form.Input,
|
|
653
625
|
{
|
|
654
626
|
className: "form-group",
|
|
655
627
|
hasFeedback: true,
|
|
@@ -666,12 +638,13 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
666
638
|
type: "text"
|
|
667
639
|
}
|
|
668
640
|
) }) }),
|
|
669
|
-
/* @__PURE__ */ (0,
|
|
670
|
-
/* @__PURE__ */ (0,
|
|
641
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_semantic_ui_react13.Grid.Column, { className: "form-additional", verticalAlign: "middle", children }),
|
|
642
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_semantic_ui_react13.Grid.Column, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
671
643
|
RemoveButton2,
|
|
672
644
|
{
|
|
645
|
+
id: (0, import_utils13.buttonId)(id, "remove"),
|
|
673
646
|
iconType: "mini",
|
|
674
|
-
className: "
|
|
647
|
+
className: "rjsf-object-property-remove",
|
|
675
648
|
disabled: disabled || readonly,
|
|
676
649
|
onClick: onDropPropertyClick(label),
|
|
677
650
|
uiSchema,
|
|
@@ -700,6 +673,7 @@ function generateTemplates() {
|
|
|
700
673
|
FieldErrorTemplate,
|
|
701
674
|
FieldHelpTemplate,
|
|
702
675
|
FieldTemplate,
|
|
676
|
+
GridTemplate,
|
|
703
677
|
ObjectFieldTemplate,
|
|
704
678
|
TitleFieldTemplate: TitleField,
|
|
705
679
|
WrapIfAdditionalTemplate
|
|
@@ -709,8 +683,8 @@ var Templates_default = generateTemplates();
|
|
|
709
683
|
|
|
710
684
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
711
685
|
var import_utils14 = require("@rjsf/utils");
|
|
712
|
-
var
|
|
713
|
-
var
|
|
686
|
+
var import_semantic_ui_react14 = require("semantic-ui-react");
|
|
687
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
714
688
|
function CheckboxWidget(props) {
|
|
715
689
|
const {
|
|
716
690
|
id,
|
|
@@ -749,8 +723,8 @@ function CheckboxWidget(props) {
|
|
|
749
723
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
750
724
|
const checked = value == "true" || value == true;
|
|
751
725
|
const description = options.description ?? schema.description;
|
|
752
|
-
return /* @__PURE__ */ (0,
|
|
753
|
-
!hideLabel &&
|
|
726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
727
|
+
!hideLabel && description && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
754
728
|
DescriptionFieldTemplate,
|
|
755
729
|
{
|
|
756
730
|
id: (0, import_utils14.descriptionId)(id),
|
|
@@ -760,8 +734,8 @@ function CheckboxWidget(props) {
|
|
|
760
734
|
registry
|
|
761
735
|
}
|
|
762
736
|
),
|
|
763
|
-
/* @__PURE__ */ (0,
|
|
764
|
-
|
|
737
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
738
|
+
import_semantic_ui_react14.Form.Checkbox,
|
|
765
739
|
{
|
|
766
740
|
id,
|
|
767
741
|
name: id,
|
|
@@ -782,9 +756,9 @@ function CheckboxWidget(props) {
|
|
|
782
756
|
}
|
|
783
757
|
|
|
784
758
|
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
785
|
-
var
|
|
759
|
+
var import_semantic_ui_react15 = require("semantic-ui-react");
|
|
786
760
|
var import_utils15 = require("@rjsf/utils");
|
|
787
|
-
var
|
|
761
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
788
762
|
function CheckboxesWidget(props) {
|
|
789
763
|
const {
|
|
790
764
|
id,
|
|
@@ -825,13 +799,13 @@ function CheckboxesWidget(props) {
|
|
|
825
799
|
const _onBlur = () => onBlur(id, value);
|
|
826
800
|
const _onFocus = () => onFocus(id, value);
|
|
827
801
|
const inlineOption = inline ? { inline: true } : { grouped: true };
|
|
828
|
-
return /* @__PURE__ */ (0,
|
|
829
|
-
!hideLabel && !!label && /* @__PURE__ */ (0,
|
|
830
|
-
/* @__PURE__ */ (0,
|
|
802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
803
|
+
!hideLabel && !!label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TitleFieldTemplate, { id: (0, import_utils15.titleId)(id), title: label, schema, uiSchema, registry }),
|
|
804
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_semantic_ui_react15.Form.Group, { id, name: id, ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
831
805
|
const checked = (0, import_utils15.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
832
806
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
833
|
-
return /* @__PURE__ */ (0,
|
|
834
|
-
|
|
807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
808
|
+
import_semantic_ui_react15.Form.Checkbox,
|
|
835
809
|
{
|
|
836
810
|
id: (0, import_utils15.optionId)(id, index),
|
|
837
811
|
name: id,
|
|
@@ -854,8 +828,8 @@ function CheckboxesWidget(props) {
|
|
|
854
828
|
|
|
855
829
|
// src/RadioWidget/RadioWidget.tsx
|
|
856
830
|
var import_utils16 = require("@rjsf/utils");
|
|
857
|
-
var
|
|
858
|
-
var
|
|
831
|
+
var import_semantic_ui_react16 = require("semantic-ui-react");
|
|
832
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
859
833
|
var import_react = require("react");
|
|
860
834
|
function RadioWidget(props) {
|
|
861
835
|
const {
|
|
@@ -884,14 +858,14 @@ function RadioWidget(props) {
|
|
|
884
858
|
const _onBlur = () => onBlur(id, value);
|
|
885
859
|
const _onFocus = () => onFocus(id, value);
|
|
886
860
|
const inlineOption = options.inline ? { inline: true } : { grouped: true };
|
|
887
|
-
return /* @__PURE__ */ (0,
|
|
861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_semantic_ui_react16.Form.Group, { ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
888
862
|
const checked = (0, import_utils16.enumOptionsIsSelected)(option.value, value);
|
|
889
863
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
890
864
|
return /* @__PURE__ */ (0, import_react.createElement)(
|
|
891
|
-
|
|
865
|
+
import_semantic_ui_react16.Form.Field,
|
|
892
866
|
{
|
|
893
867
|
required,
|
|
894
|
-
control:
|
|
868
|
+
control: import_semantic_ui_react16.Radio,
|
|
895
869
|
id: (0, import_utils16.optionId)(id, index),
|
|
896
870
|
name: id,
|
|
897
871
|
...semanticProps,
|
|
@@ -911,9 +885,9 @@ function RadioWidget(props) {
|
|
|
911
885
|
}
|
|
912
886
|
|
|
913
887
|
// src/RangeWidget/RangeWidget.tsx
|
|
914
|
-
var
|
|
888
|
+
var import_semantic_ui_react17 = require("semantic-ui-react");
|
|
915
889
|
var import_utils17 = require("@rjsf/utils");
|
|
916
|
-
var
|
|
890
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
917
891
|
function RangeWidget(props) {
|
|
918
892
|
const {
|
|
919
893
|
id,
|
|
@@ -941,9 +915,9 @@ function RangeWidget(props) {
|
|
|
941
915
|
const _onChange = ({ target: { value: value2 } }) => onChange && onChange(value2 === "" ? options.emptyValue : value2);
|
|
942
916
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
943
917
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
944
|
-
return /* @__PURE__ */ (0,
|
|
945
|
-
/* @__PURE__ */ (0,
|
|
946
|
-
|
|
918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
919
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
920
|
+
import_semantic_ui_react17.Input,
|
|
947
921
|
{
|
|
948
922
|
id,
|
|
949
923
|
name: id,
|
|
@@ -961,15 +935,15 @@ function RangeWidget(props) {
|
|
|
961
935
|
},
|
|
962
936
|
id
|
|
963
937
|
),
|
|
964
|
-
/* @__PURE__ */ (0,
|
|
938
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: value })
|
|
965
939
|
] });
|
|
966
940
|
}
|
|
967
941
|
|
|
968
942
|
// src/SelectWidget/SelectWidget.tsx
|
|
969
943
|
var import_utils18 = require("@rjsf/utils");
|
|
970
|
-
var import_map = __toESM(require("lodash/map"));
|
|
971
|
-
var
|
|
972
|
-
var
|
|
944
|
+
var import_map = __toESM(require("lodash/map"), 1);
|
|
945
|
+
var import_semantic_ui_react18 = require("semantic-ui-react");
|
|
946
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
973
947
|
function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled, showPlaceholderOption, placeholder) {
|
|
974
948
|
const disabledOptions = enumDisabled || [];
|
|
975
949
|
const options = (0, import_map.default)(enumOptions, ({ label, value }, index) => ({
|
|
@@ -1029,8 +1003,8 @@ function SelectWidget(props) {
|
|
|
1029
1003
|
const _onBlur = (_, { target }) => onBlur(id, (0, import_utils18.enumOptionsValueForIndex)(target && target.value, enumOptions, optEmptyVal));
|
|
1030
1004
|
const _onFocus = (_, { target }) => onFocus(id, (0, import_utils18.enumOptionsValueForIndex)(target && target.value, enumOptions, optEmptyVal));
|
|
1031
1005
|
const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
1032
|
-
return /* @__PURE__ */ (0,
|
|
1033
|
-
|
|
1006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1007
|
+
import_semantic_ui_react18.Form.Dropdown,
|
|
1034
1008
|
{
|
|
1035
1009
|
id,
|
|
1036
1010
|
name: id,
|
|
@@ -1056,8 +1030,8 @@ function SelectWidget(props) {
|
|
|
1056
1030
|
|
|
1057
1031
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
1058
1032
|
var import_utils19 = require("@rjsf/utils");
|
|
1059
|
-
var
|
|
1060
|
-
var
|
|
1033
|
+
var import_semantic_ui_react19 = require("semantic-ui-react");
|
|
1034
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1061
1035
|
function TextareaWidget(props) {
|
|
1062
1036
|
const {
|
|
1063
1037
|
id,
|
|
@@ -1084,8 +1058,8 @@ function TextareaWidget(props) {
|
|
|
1084
1058
|
const _onChange = ({ target: { value: value2 } }) => onChange && onChange(value2 === "" ? options.emptyValue : value2);
|
|
1085
1059
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
1086
1060
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
1087
|
-
return /* @__PURE__ */ (0,
|
|
1088
|
-
|
|
1061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1062
|
+
import_semantic_ui_react19.Form.TextArea,
|
|
1089
1063
|
{
|
|
1090
1064
|
id,
|
|
1091
1065
|
name: id,
|
|
@@ -1125,17 +1099,17 @@ function generateTheme() {
|
|
|
1125
1099
|
return {
|
|
1126
1100
|
templates: generateTemplates(),
|
|
1127
1101
|
widgets: generateWidgets(),
|
|
1128
|
-
_internalFormWrapper:
|
|
1102
|
+
_internalFormWrapper: import_semantic_ui_react20.Form
|
|
1129
1103
|
};
|
|
1130
1104
|
}
|
|
1131
1105
|
var Theme_default = generateTheme();
|
|
1132
1106
|
|
|
1133
1107
|
// src/SemanticUIForm/SemanticUIForm.ts
|
|
1134
1108
|
function generateForm() {
|
|
1135
|
-
return (0,
|
|
1109
|
+
return (0, import_core2.withTheme)(generateTheme());
|
|
1136
1110
|
}
|
|
1137
1111
|
var SemanticUIForm_default = generateForm();
|
|
1138
1112
|
|
|
1139
1113
|
// src/index.ts
|
|
1140
|
-
var
|
|
1114
|
+
var index_default = SemanticUIForm_default;
|
|
1141
1115
|
//# sourceMappingURL=index.js.map
|