@rjsf/semantic-ui 6.0.0-beta.21 → 6.0.0-beta.23
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.cjs +27 -38
- package/dist/index.cjs.map +3 -3
- package/dist/semantic-ui.esm.js +27 -39
- package/dist/semantic-ui.esm.js.map +3 -3
- package/dist/semantic-ui.umd.js +27 -38
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +3 -3
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +9 -5
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +4 -22
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +2 -2
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +3 -3
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/RadioWidget/RadioWidget.js +2 -2
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js +2 -2
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.js +2 -2
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -3
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +11 -8
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +3 -27
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +2 -1
- package/src/CheckboxWidget/CheckboxWidget.tsx +2 -1
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +3 -2
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +2 -2
- package/src/RadioWidget/RadioWidget.tsx +2 -1
- package/src/SelectWidget/SelectWidget.tsx +2 -1
- package/src/TextareaWidget/TextareaWidget.tsx +2 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +4 -7
package/dist/semantic-ui.umd.js
CHANGED
|
@@ -67,14 +67,19 @@
|
|
|
67
67
|
gridTemplateColumns: `1fr ${vertical ? 65 : 150}px`
|
|
68
68
|
});
|
|
69
69
|
function ArrayFieldItemTemplate(props) {
|
|
70
|
-
const { children, buttonsProps, hasToolbar, uiSchema, registry } = props;
|
|
70
|
+
const { children, buttonsProps, hasToolbar, uiSchema, registry, parentUiSchema } = props;
|
|
71
71
|
const uiOptions = utils.getUiOptions(uiSchema);
|
|
72
72
|
const ArrayFieldItemButtonsTemplate = utils.getTemplate(
|
|
73
73
|
"ArrayFieldItemButtonsTemplate",
|
|
74
74
|
registry,
|
|
75
75
|
uiOptions
|
|
76
76
|
);
|
|
77
|
-
const
|
|
77
|
+
const semanticProps = getSemanticProps({
|
|
78
|
+
uiSchema: parentUiSchema,
|
|
79
|
+
formContext: registry.formContext,
|
|
80
|
+
defaultSchemaProps: { horizontalButtons: true, wrapItem: false }
|
|
81
|
+
});
|
|
82
|
+
const { horizontalButtons = true, wrapItem = false } = semanticProps;
|
|
78
83
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rjsf-array-item", children: /* @__PURE__ */ jsxRuntime.jsx(MaybeWrap, { wrap: wrapItem, component: semanticUiReact.Segment, children: /* @__PURE__ */ jsxRuntime.jsxs(semanticUiReact.Grid, { style: { ...gridStyle(!horizontalButtons), alignItems: "center" }, children: [
|
|
79
84
|
/* @__PURE__ */ jsxRuntime.jsx(semanticUiReact.Grid.Column, { width: 16, verticalAlign: "middle", children }),
|
|
80
85
|
hasToolbar && /* @__PURE__ */ jsxRuntime.jsx(semanticUiReact.Grid.Column, { children: /* @__PURE__ */ jsxRuntime.jsx(semanticUiReact.Button.Group, { size: "mini", vertical: !horizontalButtons, children: /* @__PURE__ */ jsxRuntime.jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps }) }) })
|
|
@@ -98,24 +103,12 @@
|
|
|
98
103
|
title,
|
|
99
104
|
registry
|
|
100
105
|
} = props;
|
|
101
|
-
const semanticProps = getSemanticProps({
|
|
102
|
-
uiSchema,
|
|
103
|
-
formContext: registry.formContext,
|
|
104
|
-
defaultSchemaProps: { horizontalButtons: true, wrapItem: false }
|
|
105
|
-
});
|
|
106
|
-
const { horizontalButtons, wrapItem } = semanticProps;
|
|
107
|
-
const semantic = { horizontalButtons, wrapItem };
|
|
108
106
|
const uiOptions = utils.getUiOptions(uiSchema);
|
|
109
107
|
const ArrayFieldDescriptionTemplate = utils.getTemplate(
|
|
110
108
|
"ArrayFieldDescriptionTemplate",
|
|
111
109
|
registry,
|
|
112
110
|
uiOptions
|
|
113
111
|
);
|
|
114
|
-
const ArrayFieldItemTemplate2 = utils.getTemplate(
|
|
115
|
-
"ArrayFieldItemTemplate",
|
|
116
|
-
registry,
|
|
117
|
-
uiOptions
|
|
118
|
-
);
|
|
119
112
|
const ArrayFieldTitleTemplate = utils.getTemplate(
|
|
120
113
|
"ArrayFieldTitleTemplate",
|
|
121
114
|
registry,
|
|
@@ -151,16 +144,7 @@
|
|
|
151
144
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
152
145
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "row array-item-list", children: [
|
|
153
146
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
154
|
-
items
|
|
155
|
-
const mergedUiSchema = {
|
|
156
|
-
...itemUiSchema,
|
|
157
|
-
[utils.UI_OPTIONS_KEY]: {
|
|
158
|
-
...itemUiSchema[utils.UI_OPTIONS_KEY],
|
|
159
|
-
semantic
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ArrayFieldItemTemplate2, { ...props2, uiSchema: mergedUiSchema }, key);
|
|
163
|
-
})
|
|
147
|
+
items
|
|
164
148
|
] }),
|
|
165
149
|
canAdd && /* @__PURE__ */ jsxRuntime.jsx(
|
|
166
150
|
"div",
|
|
@@ -189,6 +173,7 @@
|
|
|
189
173
|
function BaseInputTemplate(props) {
|
|
190
174
|
const {
|
|
191
175
|
id,
|
|
176
|
+
htmlName,
|
|
192
177
|
placeholder,
|
|
193
178
|
label,
|
|
194
179
|
hideLabel,
|
|
@@ -222,7 +207,7 @@
|
|
|
222
207
|
semanticUiReact.Form.Input,
|
|
223
208
|
{
|
|
224
209
|
id,
|
|
225
|
-
name: id,
|
|
210
|
+
name: htmlName || id,
|
|
226
211
|
placeholder,
|
|
227
212
|
...inputProps,
|
|
228
213
|
label: utils.labelValue(label || void 0, hideLabel, false),
|
|
@@ -397,7 +382,7 @@
|
|
|
397
382
|
const {
|
|
398
383
|
description,
|
|
399
384
|
optionalDataControl,
|
|
400
|
-
|
|
385
|
+
onAddProperty,
|
|
401
386
|
title,
|
|
402
387
|
properties,
|
|
403
388
|
disabled,
|
|
@@ -458,7 +443,7 @@
|
|
|
458
443
|
{
|
|
459
444
|
id: utils.buttonId(fieldPathId, "add"),
|
|
460
445
|
className: "rjsf-object-property-expand",
|
|
461
|
-
onClick:
|
|
446
|
+
onClick: onAddProperty,
|
|
462
447
|
disabled: disabled || readonly,
|
|
463
448
|
uiSchema,
|
|
464
449
|
registry
|
|
@@ -535,8 +520,8 @@
|
|
|
535
520
|
disabled,
|
|
536
521
|
id,
|
|
537
522
|
label,
|
|
538
|
-
|
|
539
|
-
|
|
523
|
+
onKeyRenameBlur,
|
|
524
|
+
onRemoveProperty,
|
|
540
525
|
readonly,
|
|
541
526
|
required,
|
|
542
527
|
schema,
|
|
@@ -551,7 +536,6 @@
|
|
|
551
536
|
if (!additional) {
|
|
552
537
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames, style, children });
|
|
553
538
|
}
|
|
554
|
-
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
555
539
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames, style, children: /* @__PURE__ */ jsxRuntime.jsx(semanticUiReact.Grid, { columns: "equal", children: /* @__PURE__ */ jsxRuntime.jsxs(semanticUiReact.Grid.Row, { children: [
|
|
556
540
|
/* @__PURE__ */ jsxRuntime.jsx(semanticUiReact.Grid.Column, { className: "form-additional", children: /* @__PURE__ */ jsxRuntime.jsx(semanticUiReact.Form.Group, { widths: "equal", grouped: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
557
541
|
semanticUiReact.Form.Input,
|
|
@@ -566,7 +550,7 @@
|
|
|
566
550
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
567
551
|
id: `${id}`,
|
|
568
552
|
name: `${id}`,
|
|
569
|
-
onBlur: !readonly ?
|
|
553
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
570
554
|
style: wrapperStyle,
|
|
571
555
|
type: "text"
|
|
572
556
|
}
|
|
@@ -579,7 +563,7 @@
|
|
|
579
563
|
iconType: "mini",
|
|
580
564
|
className: "rjsf-object-property-remove",
|
|
581
565
|
disabled: disabled || readonly,
|
|
582
|
-
onClick:
|
|
566
|
+
onClick: onRemoveProperty,
|
|
583
567
|
uiSchema,
|
|
584
568
|
registry
|
|
585
569
|
}
|
|
@@ -618,6 +602,7 @@
|
|
|
618
602
|
function CheckboxWidget(props) {
|
|
619
603
|
const {
|
|
620
604
|
id,
|
|
605
|
+
htmlName,
|
|
621
606
|
value,
|
|
622
607
|
disabled,
|
|
623
608
|
readonly,
|
|
@@ -667,7 +652,7 @@
|
|
|
667
652
|
semanticUiReact.Form.Checkbox,
|
|
668
653
|
{
|
|
669
654
|
id,
|
|
670
|
-
name: id,
|
|
655
|
+
name: htmlName || id,
|
|
671
656
|
disabled: disabled || readonly,
|
|
672
657
|
autoFocus: autofocus,
|
|
673
658
|
...semanticProps,
|
|
@@ -686,6 +671,7 @@
|
|
|
686
671
|
function CheckboxesWidget(props) {
|
|
687
672
|
const {
|
|
688
673
|
id,
|
|
674
|
+
htmlName,
|
|
689
675
|
disabled,
|
|
690
676
|
options,
|
|
691
677
|
value,
|
|
@@ -724,14 +710,14 @@
|
|
|
724
710
|
const inlineOption = inline ? { inline: true } : { grouped: true };
|
|
725
711
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
726
712
|
!hideLabel && !!label && /* @__PURE__ */ jsxRuntime.jsx(TitleFieldTemplate, { id: utils.titleId(id), title: label, schema, uiSchema, registry }),
|
|
727
|
-
/* @__PURE__ */ jsxRuntime.jsx(semanticUiReact.Form.Group, { id, name: id, ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
713
|
+
/* @__PURE__ */ jsxRuntime.jsx(semanticUiReact.Form.Group, { id, name: htmlName || id, ...inlineOption, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
728
714
|
const checked = utils.enumOptionsIsSelected(option.value, checkboxesValues);
|
|
729
715
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
730
716
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
731
717
|
semanticUiReact.Form.Checkbox,
|
|
732
718
|
{
|
|
733
719
|
id: utils.optionId(id, index),
|
|
734
|
-
name: id,
|
|
720
|
+
name: htmlName || id,
|
|
735
721
|
label: option.label,
|
|
736
722
|
...semanticProps,
|
|
737
723
|
checked,
|
|
@@ -751,6 +737,7 @@
|
|
|
751
737
|
function RadioWidget(props) {
|
|
752
738
|
const {
|
|
753
739
|
id,
|
|
740
|
+
htmlName,
|
|
754
741
|
value,
|
|
755
742
|
required,
|
|
756
743
|
disabled,
|
|
@@ -784,7 +771,7 @@
|
|
|
784
771
|
required,
|
|
785
772
|
control: semanticUiReact.Radio,
|
|
786
773
|
id: utils.optionId(id, index),
|
|
787
|
-
name: id,
|
|
774
|
+
name: htmlName || id,
|
|
788
775
|
...semanticProps,
|
|
789
776
|
onFocus: _onFocus,
|
|
790
777
|
onBlur: _onBlur,
|
|
@@ -868,6 +855,7 @@
|
|
|
868
855
|
uiSchema,
|
|
869
856
|
registry,
|
|
870
857
|
id,
|
|
858
|
+
htmlName,
|
|
871
859
|
options,
|
|
872
860
|
label,
|
|
873
861
|
hideLabel,
|
|
@@ -913,7 +901,7 @@
|
|
|
913
901
|
semanticUiReact.Form.Dropdown,
|
|
914
902
|
{
|
|
915
903
|
id,
|
|
916
|
-
name: id,
|
|
904
|
+
name: htmlName || id,
|
|
917
905
|
label: utils.labelValue(label || void 0, hideLabel, false),
|
|
918
906
|
multiple: typeof multiple === "undefined" ? false : multiple,
|
|
919
907
|
value: typeof value === "undefined" ? emptyValue : selectedIndexes,
|
|
@@ -936,6 +924,7 @@
|
|
|
936
924
|
function TextareaWidget(props) {
|
|
937
925
|
const {
|
|
938
926
|
id,
|
|
927
|
+
htmlName,
|
|
939
928
|
placeholder,
|
|
940
929
|
value,
|
|
941
930
|
required,
|
|
@@ -963,7 +952,7 @@
|
|
|
963
952
|
semanticUiReact.Form.TextArea,
|
|
964
953
|
{
|
|
965
954
|
id,
|
|
966
|
-
name: id,
|
|
955
|
+
name: htmlName || id,
|
|
967
956
|
label: utils.labelValue(label || void 0, hideLabel, false),
|
|
968
957
|
placeholder,
|
|
969
958
|
autoFocus: autofocus,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArrayFieldItemTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
3
3
|
*
|
|
4
|
-
* @param props - The `
|
|
4
|
+
* @param props - The `ArrayFieldItemTemplateProps` props for the component
|
|
5
5
|
*/
|
|
6
|
-
export default function ArrayFieldItemTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props:
|
|
6
|
+
export default function ArrayFieldItemTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: ArrayFieldItemTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getUiOptions, getTemplate, } from '@rjsf/utils';
|
|
3
3
|
import { Button, Grid, Segment } from 'semantic-ui-react';
|
|
4
|
-
import { MaybeWrap } from '../util.js';
|
|
4
|
+
import { getSemanticProps, MaybeWrap } from '../util.js';
|
|
5
5
|
const gridStyle = (vertical) => ({
|
|
6
6
|
display: 'grid',
|
|
7
7
|
gridTemplateColumns: `1fr ${vertical ? 65 : 150}px`,
|
|
8
8
|
});
|
|
9
9
|
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
10
10
|
*
|
|
11
|
-
* @param props - The `
|
|
11
|
+
* @param props - The `ArrayFieldItemTemplateProps` props for the component
|
|
12
12
|
*/
|
|
13
13
|
export default function ArrayFieldItemTemplate(props) {
|
|
14
|
-
const { children, buttonsProps, hasToolbar, uiSchema, registry } = props;
|
|
14
|
+
const { children, buttonsProps, hasToolbar, uiSchema, registry, parentUiSchema } = props;
|
|
15
15
|
const uiOptions = getUiOptions(uiSchema);
|
|
16
16
|
const ArrayFieldItemButtonsTemplate = getTemplate('ArrayFieldItemButtonsTemplate', registry, uiOptions);
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const semanticProps = getSemanticProps({
|
|
18
|
+
uiSchema: parentUiSchema,
|
|
19
|
+
formContext: registry.formContext,
|
|
20
|
+
defaultSchemaProps: { horizontalButtons: true, wrapItem: false },
|
|
21
|
+
});
|
|
22
|
+
const { horizontalButtons = true, wrapItem = false } = semanticProps;
|
|
19
23
|
return (_jsx("div", { className: 'rjsf-array-item', children: _jsx(MaybeWrap, { wrap: wrapItem, component: Segment, children: _jsxs(Grid, { style: { ...gridStyle(!horizontalButtons), alignItems: 'center' }, children: [_jsx(Grid.Column, { width: 16, verticalAlign: 'middle', children: children }), hasToolbar && (_jsx(Grid.Column, { children: _jsx(Button.Group, { size: 'mini', vertical: !horizontalButtons, children: _jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps }) }) }))] }) }) }));
|
|
20
24
|
}
|
|
21
25
|
//# sourceMappingURL=ArrayFieldItemTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayFieldItemTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ArrayFieldItemTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAKL,YAAY,EACZ,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,SAAS,GAAG,CAAC,QAAiB,EAAE,EAAE,CAAC,CAAC;IACxC,OAAO,EAAE,MAAM;IACf,mBAAmB,EAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI;CACpD,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAI5C,KAA2C;IAC3C,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IACzF,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,6BAA6B,GAAG,WAAW,CAC/C,+BAA+B,EAC/B,QAAQ,EACR,SAAS,CACV,CAAC;IACF,MAAM,aAAa,GAAG,gBAAgB,CAAU;QAC9C,QAAQ,EAAE,cAAc;QACxB,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,kBAAkB,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;KACjE,CAAC,CAAC;IACH,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,aAAa,CAAC;IACrE,OAAO,CACL,cAAK,SAAS,EAAC,iBAAiB,YAC9B,KAAC,SAAS,IAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,YAC3C,MAAC,IAAI,IAAC,KAAK,EAAE,EAAE,GAAG,SAAS,CAAC,CAAC,iBAAiB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,aACrE,KAAC,IAAI,CAAC,MAAM,IAAC,KAAK,EAAE,EAAE,EAAE,aAAa,EAAC,QAAQ,YAC3C,QAAQ,GACG,EACb,UAAU,IAAI,CACb,KAAC,IAAI,CAAC,MAAM,cACV,KAAC,MAAM,CAAC,KAAK,IAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,iBAAiB,YACpD,KAAC,6BAA6B,OAAK,YAAY,GAAI,GACtC,GACH,CACf,IACI,GACG,GACR,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArrayFieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
3
3
|
*
|
|
4
|
-
* @param props - The `
|
|
4
|
+
* @param props - The `ArrayFieldTemplateProps` props for the component
|
|
5
5
|
*/
|
|
6
6
|
export default function ArrayFieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: ArrayFieldTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getTemplate, getUiOptions, isFixedItems,
|
|
3
|
-
import { cleanClassNames
|
|
2
|
+
import { getTemplate, getUiOptions, isFixedItems, buttonId, } from '@rjsf/utils';
|
|
3
|
+
import { cleanClassNames } from '../util.js';
|
|
4
4
|
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
5
5
|
*
|
|
6
|
-
* @param props - The `
|
|
6
|
+
* @param props - The `ArrayFieldTemplateProps` props for the component
|
|
7
7
|
*/
|
|
8
8
|
export default function ArrayFieldTemplate(props) {
|
|
9
9
|
const { uiSchema, fieldPathId, canAdd, className,
|
|
@@ -11,31 +11,13 @@ export default function ArrayFieldTemplate(props) {
|
|
|
11
11
|
disabled, items, optionalDataControl, onAddClick,
|
|
12
12
|
// options, This is not part of the type, so it is likely never passed in
|
|
13
13
|
readonly, required, schema, title, registry, } = props;
|
|
14
|
-
const semanticProps = getSemanticProps({
|
|
15
|
-
uiSchema,
|
|
16
|
-
formContext: registry.formContext,
|
|
17
|
-
defaultSchemaProps: { horizontalButtons: true, wrapItem: false },
|
|
18
|
-
});
|
|
19
|
-
const { horizontalButtons, wrapItem } = semanticProps;
|
|
20
|
-
const semantic = { horizontalButtons, wrapItem };
|
|
21
14
|
const uiOptions = getUiOptions(uiSchema);
|
|
22
15
|
const ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
23
|
-
const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
24
16
|
const ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
25
17
|
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
26
18
|
// Button templates are not overridden in the uiSchema
|
|
27
19
|
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
28
|
-
return (_jsxs("div", { className: cleanClassNames([className, isFixedItems(schema) ? '' : 'sortable-form-fields']), children: [_jsx(ArrayFieldTitleTemplate, { fieldPathId: fieldPathId, title: uiOptions.title || title, schema: schema, uiSchema: uiSchema, required: required, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined }), _jsx(ArrayFieldDescriptionTemplate, { fieldPathId: fieldPathId, description: uiOptions.description || schema.description, schema: schema, uiSchema: uiSchema, registry: registry }), _jsxs("div", { children: [_jsxs("div", { className: 'row array-item-list', children: [!showOptionalDataControlInTitle ? optionalDataControl : undefined, items
|
|
29
|
-
// Merge in the semantic props from the ArrayFieldTemplate into each of the items
|
|
30
|
-
const mergedUiSchema = {
|
|
31
|
-
...itemUiSchema,
|
|
32
|
-
[UI_OPTIONS_KEY]: {
|
|
33
|
-
...itemUiSchema[UI_OPTIONS_KEY],
|
|
34
|
-
semantic,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
return _jsx(ArrayFieldItemTemplate, { ...props, uiSchema: mergedUiSchema }, key);
|
|
38
|
-
})] }), canAdd && (_jsx("div", { style: {
|
|
20
|
+
return (_jsxs("div", { className: cleanClassNames([className, isFixedItems(schema) ? '' : 'sortable-form-fields']), children: [_jsx(ArrayFieldTitleTemplate, { fieldPathId: fieldPathId, title: uiOptions.title || title, schema: schema, uiSchema: uiSchema, required: required, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined }), _jsx(ArrayFieldDescriptionTemplate, { fieldPathId: fieldPathId, description: uiOptions.description || schema.description, schema: schema, uiSchema: uiSchema, registry: registry }), _jsxs("div", { children: [_jsxs("div", { className: 'row array-item-list', children: [!showOptionalDataControlInTitle ? optionalDataControl : undefined, items] }), canAdd && (_jsx("div", { style: {
|
|
39
21
|
marginTop: '1rem',
|
|
40
22
|
position: 'relative',
|
|
41
23
|
textAlign: 'right',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayFieldTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldTemplate/ArrayFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,
|
|
1
|
+
{"version":3,"file":"ArrayFieldTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldTemplate/ArrayFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EAKZ,QAAQ,GACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAAuC;IACvC,MAAM,EACJ,QAAQ,EACR,WAAW,EACX,MAAM,EACN,SAAS;IACT,4EAA4E;IAC5E,QAAQ,EACR,KAAK,EACL,mBAAmB,EACnB,UAAU;IACV,yEAAyE;IACzE,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,6BAA6B,GAAG,WAAW,CAC/C,+BAA+B,EAC/B,QAAQ,EACR,SAAS,CACV,CAAC;IACF,MAAM,uBAAuB,GAAG,WAAW,CACzC,yBAAyB,EACzB,QAAQ,EACR,SAAS,CACV,CAAC;IACF,MAAM,8BAA8B,GAAG,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC;IAC9D,sDAAsD;IACtD,MAAM,EACJ,eAAe,EAAE,EAAE,SAAS,EAAE,GAC/B,GAAG,QAAQ,CAAC,SAAS,CAAC;IACvB,OAAO,CACL,eAAK,SAAS,EAAE,eAAe,CAAC,C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
|
|
10
10
|
*/
|
|
11
11
|
export default function BaseInputTemplate(props) {
|
|
12
|
-
const { id, placeholder, label, hideLabel, value, required, readonly, disabled, onChange, onChangeOverride, onBlur, onFocus, autofocus, options, schema, uiSchema, registry, type, rawErrors = [], } = props;
|
|
12
|
+
const { id, htmlName, placeholder, label, hideLabel, value, required, readonly, disabled, onChange, onChangeOverride, onBlur, onFocus, autofocus, options, schema, uiSchema, registry, type, rawErrors = [], } = props;
|
|
13
13
|
const inputProps = getInputProps(schema, type, options);
|
|
14
14
|
const semanticProps = getSemanticProps({
|
|
15
15
|
uiSchema,
|
|
@@ -19,7 +19,7 @@ export default function BaseInputTemplate(props) {
|
|
|
19
19
|
const _onChange = ({ target: { value } }) => onChange(value === '' ? options.emptyValue : value);
|
|
20
20
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
21
21
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
22
|
-
return (_jsxs(_Fragment, { children: [_jsx(Form.Input, { id: id, name: id, placeholder: placeholder, ...inputProps, label: labelValue(label || undefined, hideLabel, false), required: required, autoFocus: autofocus, disabled: disabled || readonly, list: schema.examples ? examplesId(id) : undefined, ...semanticProps, value: value || value === 0 ? value : '', error: rawErrors.length > 0, onChange: onChangeOverride || _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) }, id), Array.isArray(schema.examples) && (_jsx("datalist", { id: examplesId(id), children: schema.examples
|
|
22
|
+
return (_jsxs(_Fragment, { children: [_jsx(Form.Input, { id: id, name: htmlName || id, placeholder: placeholder, ...inputProps, label: labelValue(label || undefined, hideLabel, false), required: required, autoFocus: autofocus, disabled: disabled || readonly, list: schema.examples ? examplesId(id) : undefined, ...semanticProps, value: value || value === 0 ? value : '', error: rawErrors.length > 0, onChange: onChangeOverride || _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) }, id), Array.isArray(schema.examples) && (_jsx("datalist", { id: examplesId(id), children: schema.examples
|
|
23
23
|
.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : [])
|
|
24
24
|
.map((example) => {
|
|
25
25
|
return _jsx("option", { value: example }, example);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputTemplate.js","sourceRoot":"","sources":["../../src/BaseInputTemplate/BaseInputTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EACL,kBAAkB,EAElB,UAAU,EACV,aAAa,EACb,UAAU,GAIX,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAIvC,KAAsC;IACtC,MAAM,EACJ,EAAE,EACF,WAAW,EACX,KAAK,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,OAAO,EACP,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,SAAS,GAAG,EAAE,GACf,GAAG,KAAK,CAAC;IACV,MAAM,UAAU,GAAG,aAAa,CAAU,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACjE,MAAM,aAAa,GAAG,gBAAgB,CAAU;QAC9C,QAAQ;QACR,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,OAAO;KACR,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAiC,EAAE,EAAE,CACzE,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,EAA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AAO,CAAc,CAAC,CAAC,CAAC,EAAE,CAAC;qBACzG,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;oBACf,OAAO,iBAAsB,KAAK,EAAE,OAAO,IAAvB,OAAO,CAAoB,CAAC;gBAClD,CAAC,CAAC,GACK,CACZ,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { getSemanticProps } from '../util.js';
|
|
|
9
9
|
*/
|
|
10
10
|
export default function CheckboxWidget(props) {
|
|
11
11
|
var _a;
|
|
12
|
-
const { id, value, disabled, readonly, label = '', hideLabel, autofocus, onChange, onBlur, options, onFocus, schema, uiSchema, rawErrors = [], registry, } = props;
|
|
12
|
+
const { id, htmlName, value, disabled, readonly, label = '', hideLabel, autofocus, onChange, onBlur, options, onFocus, schema, uiSchema, rawErrors = [], registry, } = props;
|
|
13
13
|
const semanticProps = getSemanticProps({
|
|
14
14
|
options,
|
|
15
15
|
formContext: registry.formContext,
|
|
@@ -28,6 +28,6 @@ export default function CheckboxWidget(props) {
|
|
|
28
28
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
29
29
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
30
30
|
const description = (_a = options.description) !== null && _a !== void 0 ? _a : schema.description;
|
|
31
|
-
return (_jsxs(_Fragment, { children: [!hideLabel && description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(id), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsx(Form.Checkbox, { id: id, name: id, disabled: disabled || readonly, autoFocus: autofocus, ...semanticProps, checked: typeof value === 'undefined' ? false : checked, error: rawErrors.length > 0, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, required: required, label: labelValue(label, hideLabel, false), "aria-describedby": ariaDescribedByIds(id) })] }));
|
|
31
|
+
return (_jsxs(_Fragment, { children: [!hideLabel && description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(id), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsx(Form.Checkbox, { id: id, name: htmlName || id, disabled: disabled || readonly, autoFocus: autofocus, ...semanticProps, checked: typeof value === 'undefined' ? false : checked, error: rawErrors.length > 0, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, required: required, label: labelValue(label, hideLabel, false), "aria-describedby": ariaDescribedByIds(id) })] }));
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=CheckboxWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxWidget.js","sourceRoot":"","sources":["../../src/CheckboxWidget/CheckboxWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,UAAU,EACV,uBAAuB,GAKxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAiB,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAIpC,KAA2B;;IAC3B,MAAM,EACJ,EAAE,EACF,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,GAAG,EAAE,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,aAAa,GAAG,gBAAgB,CAAU;QAC9C,OAAO;QACP,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,QAAQ;QACR,kBAAkB,EAAE;YAClB,QAAQ,EAAE,OAAO;SAClB;KACF,CAAC,CAAC;IACH,MAAM,wBAAwB,GAAG,WAAW,CAC1C,0BAA0B,EAC1B,QAAQ,EACR,OAAO,CACR,CAAC;IACF,8EAA8E;IAC9E,yEAAyE;IACzE,6BAA6B;IAC7B,MAAM,QAAQ,GAAG,uBAAuB,CAAI,MAAM,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,KAA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,EAAE,EACN,IAAI,EAAE,QAAQ,IAAI,EAAE,EACpB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,SAAS,EAAE,SAAS,KAChB,aAAa,EACjB,OAAO,EAAE,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EACvD,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,EAC3B,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,sBACxB,kBAAkB,CAAC,EAAE,CAAC,GACxC,IACD,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { getSemanticProps } from '../util.js';
|
|
|
8
8
|
* @param props - The `WidgetProps` for this component
|
|
9
9
|
*/
|
|
10
10
|
export default function CheckboxesWidget(props) {
|
|
11
|
-
const { id, disabled, options, value, autofocus, readonly, label, hideLabel, onChange, onBlur, onFocus, schema, uiSchema, rawErrors = [], registry, } = props;
|
|
11
|
+
const { id, htmlName, disabled, options, value, autofocus, readonly, label, hideLabel, onChange, onBlur, onFocus, schema, uiSchema, rawErrors = [], registry, } = props;
|
|
12
12
|
const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
|
|
13
13
|
const { enumOptions, enumDisabled, inline } = options;
|
|
14
14
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
@@ -32,11 +32,11 @@ export default function CheckboxesWidget(props) {
|
|
|
32
32
|
const _onBlur = () => onBlur(id, value);
|
|
33
33
|
const _onFocus = () => onFocus(id, value);
|
|
34
34
|
const inlineOption = inline ? { inline: true } : { grouped: true };
|
|
35
|
-
return (_jsxs(_Fragment, { children: [!hideLabel && !!label && (_jsx(TitleFieldTemplate, { id: titleId(id), title: label, schema: schema, uiSchema: uiSchema, registry: registry })), _jsx(Form.Group, { id: id, name: id, ...inlineOption, children: Array.isArray(enumOptions) &&
|
|
35
|
+
return (_jsxs(_Fragment, { children: [!hideLabel && !!label && (_jsx(TitleFieldTemplate, { id: titleId(id), title: label, schema: schema, uiSchema: uiSchema, registry: registry })), _jsx(Form.Group, { id: id, name: htmlName || id, ...inlineOption, children: Array.isArray(enumOptions) &&
|
|
36
36
|
enumOptions.map((option, index) => {
|
|
37
37
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
38
38
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
39
|
-
return (_jsx(Form.Checkbox, { id: optionId(id, index), name: id, label: option.label, ...semanticProps, checked: checked, error: rawErrors.length > 0, disabled: disabled || itemDisabled || readonly, autoFocus: autofocus && index === 0, onChange: _onChange(index), onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }, index));
|
|
39
|
+
return (_jsx(Form.Checkbox, { id: optionId(id, index), name: htmlName || id, label: option.label, ...semanticProps, checked: checked, error: rawErrors.length > 0, disabled: disabled || itemDisabled || readonly, autoFocus: autofocus && index === 0, onChange: _onChange(index), onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }, index));
|
|
40
40
|
}) })] }));
|
|
41
41
|
}
|
|
42
42
|
//# sourceMappingURL=CheckboxesWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxesWidget.js","sourceRoot":"","sources":["../../src/CheckboxesWidget/CheckboxesWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,QAAQ,EACR,OAAO,GAKR,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;GAIG;AACH,M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AAQ,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC9G,EACD,KAAC,IAAI,CAAC,KAAK,IAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,IAAI,EAAE,KAAM,YAAY,YACvD,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;oBACzB,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;wBAChC,MAAM,OAAO,GAAG,qBAAqB,CAAI,MAAM,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;wBACzE,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;wBAC9F,OAAO,CACL,KAAC,IAAI,CAAC,QAAQ,IACZ,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EACvB,IAAI,EAAE,QAAQ,IAAI,EAAE,EAEpB,KAAK,EAAE,MAAM,CAAC,KAAK,KACf,aAAa,EACjB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,EAC3B,QAAQ,EAAE,QAAQ,IAAI,YAAY,IAAI,QAAQ,EAC9C,SAAS,EAAE,SAAS,IAAI,KAAK,KAAK,CAAC,EACnC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,EAC1B,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,sBACC,kBAAkB,CAAC,EAAE,CAAC,IAVnC,KAAK,CAWV,CACH,CAAC;oBACJ,CAAC,CAAC,GACO,IACZ,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { canExpand, descriptionId, getTemplate, getUiOptions, titleId, buttonId,
|
|
|
8
8
|
* @param props - The `ObjectFieldTemplateProps` for this component
|
|
9
9
|
*/
|
|
10
10
|
export default function ObjectFieldTemplate(props) {
|
|
11
|
-
const { description, optionalDataControl,
|
|
11
|
+
const { description, optionalDataControl, onAddProperty, title, properties, disabled, readonly, required, uiSchema, schema, formData, fieldPathId, registry, } = props;
|
|
12
12
|
const uiOptions = getUiOptions(uiSchema);
|
|
13
13
|
const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
|
|
14
14
|
const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
@@ -19,6 +19,6 @@ export default function ObjectFieldTemplate(props) {
|
|
|
19
19
|
marginTop: '1rem',
|
|
20
20
|
position: 'relative',
|
|
21
21
|
textAlign: 'right',
|
|
22
|
-
}, children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), className: 'rjsf-object-property-expand', onClick:
|
|
22
|
+
}, children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), className: 'rjsf-object-property-expand', onClick: onAddProperty, disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) }) }) }))] }));
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=ObjectFieldTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectFieldTemplate.js","sourceRoot":"","sources":["../../src/ObjectFieldTemplate/ObjectFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAKL,SAAS,EACT,aAAa,EACb,WAAW,EACX,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAIzC,KAAwC;IACxC,MAAM,EACJ,WAAW,EACX,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"ObjectFieldTemplate.js","sourceRoot":"","sources":["../../src/ObjectFieldTemplate/ObjectFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAKL,SAAS,E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CAAC,8BAA8B,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,EACjE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EACtC,SAAS,CAAU,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CACjD,KAAC,IAAI,CAAC,MAAM,IAAC,KAAK,EAAE,EAAE,EAAE,aAAa,EAAC,QAAQ,YAC5C,KAAC,IAAI,CAAC,GAAG,cACP,cACE,KAAK,EAAE;4BACL,SAAS,EAAE,MAAM;4BACjB,QAAQ,EAAE,UAAU;4BACpB,SAAS,EAAE,OAAO;yBACnB,YAED,KAAC,SAAS,IACR,EAAE,EAAE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,EAChC,SAAS,EAAC,6BAA6B,EACvC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACE,GACG,GACC,CACf,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { getSemanticProps } from '../util.js';
|
|
|
9
9
|
* @param props - The `WidgetProps` for this component
|
|
10
10
|
*/
|
|
11
11
|
export default function RadioWidget(props) {
|
|
12
|
-
const { id, value, required, disabled, readonly, onChange, onBlur, onFocus, options, registry, uiSchema, rawErrors = [], } = props;
|
|
12
|
+
const { id, htmlName, value, required, disabled, readonly, onChange, onBlur, onFocus, options, registry, uiSchema, rawErrors = [], } = props;
|
|
13
13
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
14
14
|
const semanticProps = getSemanticProps({
|
|
15
15
|
formContext: registry.formContext,
|
|
@@ -26,7 +26,7 @@ export default function RadioWidget(props) {
|
|
|
26
26
|
enumOptions.map((option, index) => {
|
|
27
27
|
const checked = enumOptionsIsSelected(option.value, value);
|
|
28
28
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
29
|
-
return (_createElement(Form.Field, { required: required, control: Radio, id: optionId(id, index), name: id, ...semanticProps, onFocus: _onFocus, onBlur: _onBlur, onChange: _onChange, label: option.label, value: String(index), error: rawErrors.length > 0, key: index, checked: checked, disabled: disabled || itemDisabled || readonly, "aria-describedby": ariaDescribedByIds(id) }));
|
|
29
|
+
return (_createElement(Form.Field, { required: required, control: Radio, id: optionId(id, index), name: htmlName || id, ...semanticProps, onFocus: _onFocus, onBlur: _onBlur, onChange: _onChange, label: option.label, value: String(index), error: rawErrors.length > 0, key: index, checked: checked, disabled: disabled || itemDisabled || readonly, "aria-describedby": ariaDescribedByIds(id) }));
|
|
30
30
|
}) }));
|
|
31
31
|
}
|
|
32
32
|
//# sourceMappingURL=RadioWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioWidget.js","sourceRoot":"","sources":["../../src/RadioWidget/RadioWidget.tsx"],"names":[],"mappings":";;AACA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,QAAQ,GAKT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAiB,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,KAA2B;IAE3B,MAAM,EACJ,EAAE,EACF,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,SAAS,GAAG,EAAE,GACf,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC1D,MAAM,aAAa,GAAG,gBAAgB,CAAU;QAC9C,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC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W,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBAChC,MAAM,OAAO,GAAG,qBAAqB,CAAI,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAC9D,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC9F,OAAO,CACL,eAAC,IAAI,CAAC,KAAK,IACT,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,KAAK,EACd,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EACvB,IAAI,EAAE,QAAQ,IAAI,EAAE,KAChB,aAAa,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EACpB,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,EAC3B,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,IAAI,YAAY,IAAI,QAAQ,sBAC5B,kBAAkB,CAAC,EAAE,CAAC,GACxC,CACH,CAAC;YACJ,CAAC,CAAC,GACO,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -30,7 +30,7 @@ function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled, showPla
|
|
|
30
30
|
* @param props - The `WidgetProps` for this component
|
|
31
31
|
*/
|
|
32
32
|
export default function SelectWidget(props) {
|
|
33
|
-
const { uiSchema, registry, id, options, label, hideLabel, required, disabled, readonly, value, multiple, placeholder, autofocus, onChange, onBlur, onFocus, rawErrors = [], schema, } = props;
|
|
33
|
+
const { uiSchema, registry, id, htmlName, options, label, hideLabel, required, disabled, readonly, value, multiple, placeholder, autofocus, onChange, onBlur, onFocus, rawErrors = [], schema, } = props;
|
|
34
34
|
const semanticProps = getSemanticProps({
|
|
35
35
|
uiSchema,
|
|
36
36
|
formContext: registry.formContext,
|
|
@@ -52,6 +52,6 @@ export default function SelectWidget(props) {
|
|
|
52
52
|
const _onBlur = (_, { target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, optEmptyVal));
|
|
53
53
|
const _onFocus = (_, { target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, optEmptyVal));
|
|
54
54
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
55
|
-
return (_jsx(Form.Dropdown, { id: id, name: id, label: labelValue(label || undefined, hideLabel, false), multiple: typeof multiple === 'undefined' ? false : multiple, value: typeof value === 'undefined' ? emptyValue : selectedIndexes, error: rawErrors.length > 0, disabled: disabled, placeholder: placeholder, ...semanticProps, required: required, autoFocus: autofocus, readOnly: readonly, options: dropdownOptions, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }, id));
|
|
55
|
+
return (_jsx(Form.Dropdown, { id: id, name: htmlName || id, label: labelValue(label || undefined, hideLabel, false), multiple: typeof multiple === 'undefined' ? false : multiple, value: typeof value === 'undefined' ? emptyValue : selectedIndexes, error: rawErrors.length > 0, disabled: disabled, placeholder: placeholder, ...semanticProps, required: required, autoFocus: autofocus, readOnly: readonly, options: dropdownOptions, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }, id));
|
|
56
56
|
}
|
|
57
57
|
//# sourceMappingURL=SelectWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectWidget.js","sourceRoot":"","sources":["../../src/SelectWidget/SelectWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,UAAU,GAOX,MAAM,aAAa,CAAC;AACrB,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,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AElF,OAAO,CACL,KAAC,IAAI,CAAC,QAAQ,IAEZ,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,QAAQ,IAAI,EAAE,EACpB,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,EACvD,QAAQ,EAAE,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAC5D,KAAK,EAAE,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,EAClE,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,EAC3B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,KACpB,aAAa,EACjB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,sBACC,kBAAkB,CAAC,EAAE,CAAC,IAjBnC,EAAE,CAkBP,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { getSemanticProps } from '../util.js';
|
|
|
7
7
|
* @param props - The `WidgetProps` for this component
|
|
8
8
|
*/
|
|
9
9
|
export default function TextareaWidget(props) {
|
|
10
|
-
const { id, placeholder, value, required, disabled, autofocus, label, hideLabel, readonly, onBlur, onFocus, onChange, options, registry, rawErrors = [], } = props;
|
|
10
|
+
const { id, htmlName, placeholder, value, required, disabled, autofocus, label, hideLabel, readonly, onBlur, onFocus, onChange, options, registry, rawErrors = [], } = props;
|
|
11
11
|
const semanticProps = getSemanticProps({
|
|
12
12
|
formContext: registry.formContext,
|
|
13
13
|
options,
|
|
@@ -17,6 +17,6 @@ export default function TextareaWidget(props) {
|
|
|
17
17
|
const _onChange = ({ target: { value } }) => onChange && onChange(value === '' ? options.emptyValue : value);
|
|
18
18
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
19
19
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
20
|
-
return (_jsx(Form.TextArea, { id: id, name: id, label: labelValue(label || undefined, hideLabel, false), placeholder: placeholder, autoFocus: autofocus, required: required, disabled: disabled || readonly, ...semanticProps, value: value || '', error: rawErrors.length > 0, rows: options.rows || 5, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }, id));
|
|
20
|
+
return (_jsx(Form.TextArea, { id: id, name: htmlName || id, label: labelValue(label || undefined, hideLabel, false), placeholder: placeholder, autoFocus: autofocus, required: required, disabled: disabled || readonly, ...semanticProps, value: value || '', error: rawErrors.length > 0, rows: options.rows || 5, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }, id));
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=TextareaWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextareaWidget.js","sourceRoot":"","sources":["../../src/TextareaWidget/TextareaWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,kBAAkB,EAClB,UAAU,GAKX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAIpC,KAA2B;IAC3B,MAAM,EACJ,EAAE,EACF,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,GAAG,EAAE,GACf,GAAG,KAAK,CAAC;IACV,MAAM,aAAa,GAAG,gBAAgB,CAAU;QAC9C,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,O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B,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE;KAC1C,CAAC,CAAC;IACH,qCAAqC;IACrC,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAoC,EAAE,EAAE,CAC5E,QAAQ,IAAI,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACrD,OAAO,CACL,KAAC,IAAI,CAAC,QAAQ,IACZ,EAAE,EAAE,EAAE,EAEN,IAAI,EAAE,QAAQ,IAAI,EAAE,EACpB,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,EACvD,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,KAC1B,aAAa,EACjB,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,EAC3B,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,EACvB,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,sBACC,kBAAkB,CAAC,EAAE,CAAC,IAdnC,EAAE,CAeP,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { Form, Grid } from 'semantic-ui-react';
|
|
|
7
7
|
* @param props - The `WrapIfAdditionalProps` for this component
|
|
8
8
|
*/
|
|
9
9
|
export default function WrapIfAdditionalTemplate(props) {
|
|
10
|
-
const { children, classNames, style, disabled, id, label,
|
|
10
|
+
const { children, classNames, style, disabled, id, label, onKeyRenameBlur, onRemoveProperty, readonly, required, schema, uiSchema, registry, } = props;
|
|
11
11
|
const { templates, translateString } = registry;
|
|
12
12
|
// Button templates are not overridden in the uiSchema
|
|
13
13
|
const { RemoveButton } = templates.ButtonTemplates;
|
|
@@ -17,7 +17,6 @@ export default function WrapIfAdditionalTemplate(props) {
|
|
|
17
17
|
if (!additional) {
|
|
18
18
|
return (_jsx("div", { className: classNames, style: style, children: children }));
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
return (_jsx("div", { className: classNames, style: style, children: _jsx(Grid, { columns: 'equal', children: _jsxs(Grid.Row, { children: [_jsx(Grid.Column, { className: 'form-additional', children: _jsx(Form.Group, { widths: 'equal', grouped: true, children: _jsx(Form.Input, { className: 'form-group', hasFeedback: true, fluid: true, htmlFor: `${id}`, label: keyLabel, required: required, defaultValue: label, disabled: disabled || (readonlyAsDisabled && readonly), id: `${id}`, name: `${id}`, onBlur: !readonly ? handleBlur : undefined, style: wrapperStyle, type: 'text' }) }) }), _jsx(Grid.Column, { className: 'form-additional', verticalAlign: 'middle', children: children }), _jsx(Grid.Column, { children: _jsx(RemoveButton, { id: buttonId(id, 'remove'), iconType: 'mini', className: 'rjsf-object-property-remove', disabled: disabled || readonly, onClick: onDropPropertyClick(label), uiSchema: uiSchema, registry: registry }) })] }) }) }, `${id}-key`));
|
|
20
|
+
return (_jsx("div", { className: classNames, style: style, children: _jsx(Grid, { columns: 'equal', children: _jsxs(Grid.Row, { children: [_jsx(Grid.Column, { className: 'form-additional', children: _jsx(Form.Group, { widths: 'equal', grouped: true, children: _jsx(Form.Input, { className: 'form-group', hasFeedback: true, fluid: true, htmlFor: `${id}`, label: keyLabel, required: required, defaultValue: label, disabled: disabled || (readonlyAsDisabled && readonly), id: `${id}`, name: `${id}`, onBlur: !readonly ? onKeyRenameBlur : undefined, style: wrapperStyle, type: 'text' }) }) }), _jsx(Grid.Column, { className: 'form-additional', verticalAlign: 'middle', children: children }), _jsx(Grid.Column, { children: _jsx(RemoveButton, { id: buttonId(id, 'remove'), iconType: 'mini', className: 'rjsf-object-property-remove', disabled: disabled || readonly, onClick: onRemoveProperty, uiSchema: uiSchema, registry: registry }) })] }) }) }, `${id}-key`));
|
|
22
21
|
}
|
|
23
22
|
//# sourceMappingURL=WrapIfAdditionalTemplate.js.map
|