@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.
- package/dist/index.js +1128 -5
- package/dist/index.js.map +7 -0
- package/dist/semantic-ui.esm.js +641 -809
- package/dist/semantic-ui.esm.js.map +7 -1
- package/dist/semantic-ui.umd.js +997 -0
- package/lib/AddButton/AddButton.d.ts +5 -0
- package/lib/AddButton/AddButton.js +12 -0
- package/lib/AddButton/AddButton.js.map +1 -0
- package/lib/AddButton/index.d.ts +2 -0
- package/lib/AddButton/index.js +3 -0
- package/lib/AddButton/index.js.map +1 -0
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +7 -0
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +21 -0
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -0
- package/lib/ArrayFieldItemTemplate/index.d.ts +2 -0
- package/lib/ArrayFieldItemTemplate/index.js +3 -0
- package/lib/ArrayFieldItemTemplate/index.js.map +1 -0
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +7 -0
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +40 -0
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -0
- package/lib/ArrayFieldTemplate/index.d.ts +2 -0
- package/lib/ArrayFieldTemplate/index.js +3 -0
- package/lib/ArrayFieldTemplate/index.js.map +1 -0
- package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +9 -0
- package/lib/BaseInputTemplate/BaseInputTemplate.js +28 -0
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -0
- package/lib/BaseInputTemplate/index.d.ts +2 -0
- package/lib/BaseInputTemplate/index.js +3 -0
- package/lib/BaseInputTemplate/index.js.map +1 -0
- package/lib/CheckboxWidget/CheckboxWidget.d.ts +8 -0
- package/lib/CheckboxWidget/CheckboxWidget.js +33 -0
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -0
- package/lib/CheckboxWidget/index.d.ts +2 -0
- package/lib/CheckboxWidget/index.js +3 -0
- package/lib/CheckboxWidget/index.js.map +1 -0
- package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +8 -0
- package/lib/CheckboxesWidget/CheckboxesWidget.js +42 -0
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -0
- package/lib/CheckboxesWidget/index.d.ts +2 -0
- package/lib/CheckboxesWidget/index.js +3 -0
- package/lib/CheckboxesWidget/index.js.map +1 -0
- package/lib/DescriptionField/DescriptionField.d.ts +7 -0
- package/lib/DescriptionField/DescriptionField.js +13 -0
- package/lib/DescriptionField/DescriptionField.js.map +1 -0
- package/lib/DescriptionField/index.d.ts +2 -0
- package/lib/DescriptionField/index.js +3 -0
- package/lib/DescriptionField/index.js.map +1 -0
- package/lib/ErrorList/ErrorList.d.ts +7 -0
- package/lib/ErrorList/ErrorList.js +12 -0
- package/lib/ErrorList/ErrorList.js.map +1 -0
- package/lib/ErrorList/index.d.ts +2 -0
- package/lib/ErrorList/index.js +3 -0
- package/lib/ErrorList/index.js.map +1 -0
- package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +7 -0
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +30 -0
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -0
- package/lib/FieldErrorTemplate/index.d.ts +2 -0
- package/lib/FieldErrorTemplate/index.js +3 -0
- package/lib/FieldErrorTemplate/index.js.map +1 -0
- package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +7 -0
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +16 -0
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -0
- package/lib/FieldHelpTemplate/index.d.ts +2 -0
- package/lib/FieldHelpTemplate/index.js +3 -0
- package/lib/FieldHelpTemplate/index.js.map +1 -0
- package/lib/FieldTemplate/FieldTemplate.d.ts +8 -0
- package/lib/FieldTemplate/FieldTemplate.js +22 -0
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -0
- package/lib/FieldTemplate/index.d.ts +2 -0
- package/lib/FieldTemplate/index.js +3 -0
- package/lib/FieldTemplate/index.js.map +1 -0
- package/lib/IconButton/IconButton.d.ts +8 -0
- package/lib/IconButton/IconButton.js +26 -0
- package/lib/IconButton/IconButton.js.map +1 -0
- package/lib/IconButton/index.d.ts +2 -0
- package/lib/IconButton/index.js +3 -0
- package/lib/IconButton/index.js.map +1 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +9 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +23 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -0
- package/lib/ObjectFieldTemplate/index.d.ts +2 -0
- package/lib/ObjectFieldTemplate/index.js +3 -0
- package/lib/ObjectFieldTemplate/index.js.map +1 -0
- package/lib/RadioWidget/RadioWidget.d.ts +8 -0
- package/lib/RadioWidget/RadioWidget.js +32 -0
- package/lib/RadioWidget/RadioWidget.js.map +1 -0
- package/lib/RadioWidget/index.d.ts +2 -0
- package/lib/RadioWidget/index.js +3 -0
- package/lib/RadioWidget/index.js.map +1 -0
- package/lib/RangeWidget/RangeWidget.d.ts +8 -0
- package/lib/RangeWidget/RangeWidget.js +26 -0
- package/lib/RangeWidget/RangeWidget.js.map +1 -0
- package/lib/RangeWidget/index.d.ts +2 -0
- package/lib/RangeWidget/index.js +3 -0
- package/lib/RangeWidget/index.js.map +1 -0
- package/lib/SelectWidget/SelectWidget.d.ts +8 -0
- package/lib/SelectWidget/SelectWidget.js +51 -0
- package/lib/SelectWidget/SelectWidget.js.map +1 -0
- package/lib/SelectWidget/index.d.ts +2 -0
- package/lib/SelectWidget/index.js +3 -0
- package/lib/SelectWidget/index.js.map +1 -0
- package/lib/SemanticUIForm/SemanticUIForm.d.ts +6 -0
- package/lib/SemanticUIForm/SemanticUIForm.js +7 -0
- package/lib/SemanticUIForm/SemanticUIForm.js.map +1 -0
- package/lib/SemanticUIForm/index.d.ts +2 -0
- package/lib/SemanticUIForm/index.js +3 -0
- package/lib/SemanticUIForm/index.js.map +1 -0
- package/lib/SubmitButton/SubmitButton.d.ts +5 -0
- package/lib/SubmitButton/SubmitButton.js +13 -0
- package/lib/SubmitButton/SubmitButton.js.map +1 -0
- package/lib/SubmitButton/index.d.ts +2 -0
- package/lib/SubmitButton/index.js +3 -0
- package/lib/SubmitButton/index.js.map +1 -0
- package/lib/Templates/Templates.d.ts +4 -0
- package/lib/Templates/Templates.js +39 -0
- package/lib/Templates/Templates.js.map +1 -0
- package/lib/Templates/index.d.ts +2 -0
- package/lib/Templates/index.js +3 -0
- package/lib/Templates/index.js.map +1 -0
- package/lib/TextareaWidget/TextareaWidget.d.ts +7 -0
- package/lib/TextareaWidget/TextareaWidget.js +22 -0
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -0
- package/lib/TextareaWidget/index.d.ts +2 -0
- package/lib/TextareaWidget/index.js +3 -0
- package/lib/TextareaWidget/index.js.map +1 -0
- package/lib/Theme/Theme.d.ts +5 -0
- package/lib/Theme/Theme.js +12 -0
- package/lib/Theme/Theme.js.map +1 -0
- package/lib/Theme/index.d.ts +2 -0
- package/lib/Theme/index.js +3 -0
- package/lib/Theme/index.js.map +1 -0
- package/lib/TitleField/TitleField.d.ts +7 -0
- package/lib/TitleField/TitleField.js +22 -0
- package/lib/TitleField/TitleField.js.map +1 -0
- package/lib/TitleField/index.d.ts +2 -0
- package/lib/TitleField/index.js +3 -0
- package/lib/TitleField/index.js.map +1 -0
- package/lib/Widgets/Widgets.d.ts +4 -0
- package/lib/Widgets/Widgets.js +18 -0
- package/lib/Widgets/Widgets.js.map +1 -0
- package/lib/Widgets/index.d.ts +2 -0
- package/lib/Widgets/index.js +3 -0
- package/lib/Widgets/index.js.map +1 -0
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +8 -0
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +23 -0
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -0
- package/lib/WrapIfAdditionalTemplate/index.d.ts +2 -0
- package/lib/WrapIfAdditionalTemplate/index.js +3 -0
- package/lib/WrapIfAdditionalTemplate/index.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib/util.d.ts +60 -0
- package/lib/util.js +69 -0
- package/lib/util.js.map +1 -0
- package/package.json +23 -15
- package/src/AddButton/AddButton.tsx +24 -0
- package/src/AddButton/index.ts +2 -0
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +102 -0
- package/src/ArrayFieldItemTemplate/index.ts +2 -0
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +114 -0
- package/src/ArrayFieldTemplate/index.ts +2 -0
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +90 -0
- package/src/BaseInputTemplate/index.ts +2 -0
- package/src/CheckboxWidget/CheckboxWidget.tsx +95 -0
- package/src/CheckboxWidget/index.ts +2 -0
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +102 -0
- package/src/CheckboxesWidget/index.ts +2 -0
- package/src/DescriptionField/DescriptionField.tsx +21 -0
- package/src/DescriptionField/index.ts +2 -0
- package/src/ErrorList/ErrorList.tsx +23 -0
- package/src/ErrorList/index.ts +2 -0
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +43 -0
- package/src/FieldErrorTemplate/index.ts +2 -0
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +19 -0
- package/src/FieldHelpTemplate/index.ts +2 -0
- package/src/FieldTemplate/FieldTemplate.tsx +77 -0
- package/src/FieldTemplate/index.ts +2 -0
- package/src/IconButton/IconButton.tsx +55 -0
- package/src/IconButton/index.ts +2 -0
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +94 -0
- package/src/ObjectFieldTemplate/index.ts +2 -0
- package/src/RadioWidget/RadioWidget.tsx +78 -0
- package/src/RadioWidget/index.ts +2 -0
- package/src/RangeWidget/RangeWidget.tsx +65 -0
- package/src/RangeWidget/index.ts +2 -0
- package/src/SelectWidget/SelectWidget.tsx +111 -0
- package/src/SelectWidget/index.ts +2 -0
- package/src/SemanticUIForm/SemanticUIForm.ts +15 -0
- package/src/SemanticUIForm/index.ts +2 -0
- package/src/SubmitButton/SubmitButton.tsx +20 -0
- package/src/SubmitButton/index.ts +2 -0
- package/src/Templates/Templates.ts +46 -0
- package/src/Templates/index.ts +2 -0
- package/src/TextareaWidget/TextareaWidget.tsx +69 -0
- package/src/TextareaWidget/index.ts +2 -0
- package/src/Theme/Theme.ts +20 -0
- package/src/Theme/index.ts +2 -0
- package/src/TitleField/TitleField.tsx +32 -0
- package/src/TitleField/index.ts +2 -0
- package/src/Widgets/Widgets.tsx +25 -0
- package/src/Widgets/index.ts +2 -0
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +95 -0
- package/src/WrapIfAdditionalTemplate/index.ts +2 -0
- package/src/index.ts +8 -0
- package/src/util.tsx +126 -0
- package/dist/index.d.ts +0 -17
- package/dist/semantic-ui.cjs.development.js +0 -1335
- package/dist/semantic-ui.cjs.development.js.map +0 -1
- package/dist/semantic-ui.cjs.production.min.js +0 -2
- package/dist/semantic-ui.cjs.production.min.js.map +0 -1
- package/dist/semantic-ui.umd.development.js +0 -1333
- package/dist/semantic-ui.umd.development.js.map +0 -1
- package/dist/semantic-ui.umd.production.min.js +0 -2
- package/dist/semantic-ui.umd.production.min.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/FieldTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
declare function IconButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): JSX.Element;
|
|
4
|
+
export default IconButton;
|
|
5
|
+
export declare function CopyButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): JSX.Element;
|
|
6
|
+
export declare function MoveDownButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): JSX.Element;
|
|
7
|
+
export declare function MoveUpButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): JSX.Element;
|
|
8
|
+
export declare function RemoveButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: IconButtonProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from 'semantic-ui-react';
|
|
4
|
+
import { TranslatableString } from '@rjsf/utils';
|
|
5
|
+
function IconButton(props) {
|
|
6
|
+
const { icon, iconType, color, className, uiSchema, registry } = props, otherProps = __rest(props, ["icon", "iconType", "color", "className", "uiSchema", "registry"]);
|
|
7
|
+
return (_jsx(Button, Object.assign({ icon: icon, size: iconType, color: color, className: className }, otherProps)));
|
|
8
|
+
}
|
|
9
|
+
export default IconButton;
|
|
10
|
+
export function CopyButton(props) {
|
|
11
|
+
const { registry: { translateString }, } = props;
|
|
12
|
+
return _jsx(IconButton, Object.assign({ title: translateString(TranslatableString.CopyButton) }, props, { icon: 'copy' }));
|
|
13
|
+
}
|
|
14
|
+
export function MoveDownButton(props) {
|
|
15
|
+
const { registry: { translateString }, } = props;
|
|
16
|
+
return _jsx(IconButton, Object.assign({ title: translateString(TranslatableString.MoveDownButton) }, props, { icon: 'angle down' }));
|
|
17
|
+
}
|
|
18
|
+
export function MoveUpButton(props) {
|
|
19
|
+
const { registry: { translateString }, } = props;
|
|
20
|
+
return _jsx(IconButton, Object.assign({ title: translateString(TranslatableString.MoveUpButton) }, props, { icon: 'angle up' }));
|
|
21
|
+
}
|
|
22
|
+
export function RemoveButton(props) {
|
|
23
|
+
const { registry: { translateString }, } = props;
|
|
24
|
+
return _jsx(IconButton, Object.assign({ title: translateString(TranslatableString.RemoveButton) }, props, { icon: 'trash' }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=IconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../src/IconButton/IconButton.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,EAAe,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAkE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjH,SAAS,UAAU,CACjB,KAA+B;IAE/B,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,KAAoB,KAAK,EAApB,UAAU,UAAK,KAAK,EAA/E,kEAAuE,CAAQ,CAAC;IACtF,OAAO,CACL,KAAC,MAAM,kBACL,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,QAA+B,EACrC,KAAK,EAAE,KAA6B,EACpC,SAAS,EAAE,SAAS,IAChB,UAAU,EACd,CACH,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC;AAE1B,MAAM,UAAU,UAAU,CACxB,KAA+B;IAE/B,MAAM,EACJ,QAAQ,EAAE,EAAE,eAAe,EAAE,GAC9B,GAAG,KAAK,CAAC;IACV,OAAO,KAAC,UAAU,kBAAC,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,UAAU,CAAC,IAAM,KAAK,IAAE,IAAI,EAAC,MAAM,IAAG,CAAC;AACtG,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,KAA+B;IAE/B,MAAM,EACJ,QAAQ,EAAE,EAAE,eAAe,EAAE,GAC9B,GAAG,KAAK,CAAC;IACV,OAAO,KAAC,UAAU,kBAAC,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,cAAc,CAAC,IAAM,KAAK,IAAE,IAAI,EAAC,YAAY,IAAG,CAAC;AAChH,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,KAA+B;IAE/B,MAAM,EACJ,QAAQ,EAAE,EAAE,eAAe,EAAE,GAC9B,GAAG,KAAK,CAAC;IACV,OAAO,KAAC,UAAU,kBAAC,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,YAAY,CAAC,IAAM,KAAK,IAAE,IAAI,EAAC,UAAU,IAAG,CAAC;AAC5G,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,KAA+B;IAE/B,MAAM,EACJ,QAAQ,EAAE,EAAE,eAAe,EAAE,GAC9B,GAAG,KAAK,CAAC;IACV,OAAO,KAAC,UAAU,kBAAC,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,YAAY,CAAC,IAAM,KAAK,IAAE,IAAI,EAAC,OAAO,IAAG,CAAC;AACzG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/IconButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, ObjectFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
4
|
+
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
|
|
5
|
+
* the properties.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `ObjectFieldTemplateProps` for this component
|
|
8
|
+
*/
|
|
9
|
+
export default function ObjectFieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: ObjectFieldTemplateProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Grid } from 'semantic-ui-react';
|
|
3
|
+
import { canExpand, descriptionId, getTemplate, getUiOptions, titleId, } from '@rjsf/utils';
|
|
4
|
+
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
5
|
+
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
|
|
6
|
+
* the properties.
|
|
7
|
+
*
|
|
8
|
+
* @param props - The `ObjectFieldTemplateProps` for this component
|
|
9
|
+
*/
|
|
10
|
+
export default function ObjectFieldTemplate(props) {
|
|
11
|
+
const { description, onAddClick, title, properties, disabled, readonly, required, uiSchema, schema, formData, idSchema, registry, } = props;
|
|
12
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
13
|
+
const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
|
|
14
|
+
const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
|
|
15
|
+
// Button templates are not overridden in the uiSchema
|
|
16
|
+
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
17
|
+
return (_jsxs(_Fragment, { children: [title && (_jsx(TitleFieldTemplate, { id: titleId(idSchema), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry })), description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(idSchema), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), properties.map((prop) => prop.content), canExpand(schema, uiSchema, formData) && (_jsx(Grid.Column, Object.assign({ width: 16, verticalAlign: 'middle' }, { children: _jsx(Grid.Row, { children: _jsx("div", Object.assign({ style: {
|
|
18
|
+
marginTop: '1rem',
|
|
19
|
+
position: 'relative',
|
|
20
|
+
textAlign: 'right',
|
|
21
|
+
} }, { children: _jsx(AddButton, { onClick: onAddClick(schema), disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) })) }) })))] }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ObjectFieldTemplate.js.map
|
|
@@ -0,0 +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,GACR,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAIzC,KAAwC;IACxC,MAAM,EACJ,WAAW,EACX,UAAU,EACV,KAAK,EACL,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,kBAAkB,GAAG,WAAW,CAAgC,oBAAoB,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IACjH,MAAM,wBAAwB,GAAG,WAAW,CAC1C,0BAA0B,EAC1B,QAAQ,EACR,SAAS,CACV,CAAC;IACF,sDAAsD;IACtD,MAAM,EACJ,eAAe,EAAE,EAAE,SAAS,EAAE,GAC/B,GAAG,QAAQ,CAAC,SAAS,CAAC;IACvB,OAAO,CACL,8BACG,KAAK,IAAI,CACR,KAAC,kBAAkB,IACjB,EAAE,EAAE,OAAO,CAAI,QAAQ,CAAC,EACxB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,CACH,EACA,WAAW,IAAI,CACd,KAAC,wBAAwB,IACvB,EAAE,EAAE,aAAa,CAAI,QAAQ,CAAC,EAC9B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,CACH,EACA,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,kBAAC,KAAK,EAAE,EAAE,EAAE,aAAa,EAAC,QAAQ,gBAC5C,KAAC,IAAI,CAAC,GAAG,cACP,4BACE,KAAK,EAAE;4BACL,SAAS,EAAE,MAAM;4BACjB,QAAQ,EAAE,UAAU;4BACpB,SAAS,EAAE,OAAO;yBACnB,gBAED,KAAC,SAAS,IACR,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,EAC3B,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,IACE,GACG,IACC,CACf,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ObjectFieldTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
3
|
+
/** The `RadioWidget` is a widget for rendering a radio group.
|
|
4
|
+
* It is typically used with a string property constrained with enum options.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `WidgetProps` for this component
|
|
7
|
+
*/
|
|
8
|
+
export default function RadioWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as _createElement } from "react";
|
|
3
|
+
import { ariaDescribedByIds, enumOptionsIsSelected, enumOptionsValueForIndex, optionId, } from '@rjsf/utils';
|
|
4
|
+
import { Form, Radio } from 'semantic-ui-react';
|
|
5
|
+
import { getSemanticProps } from '../util';
|
|
6
|
+
/** The `RadioWidget` is a widget for rendering a radio group.
|
|
7
|
+
* It is typically used with a string property constrained with enum options.
|
|
8
|
+
*
|
|
9
|
+
* @param props - The `WidgetProps` for this component
|
|
10
|
+
*/
|
|
11
|
+
export default function RadioWidget(props) {
|
|
12
|
+
const { id, value, required, disabled, readonly, onChange, onBlur, onFocus, options, formContext, uiSchema, rawErrors = [], } = props;
|
|
13
|
+
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
14
|
+
const semanticProps = getSemanticProps({
|
|
15
|
+
formContext,
|
|
16
|
+
options,
|
|
17
|
+
uiSchema,
|
|
18
|
+
});
|
|
19
|
+
const _onChange = (_, { value: eventValue }) => {
|
|
20
|
+
return onChange(enumOptionsValueForIndex(eventValue, enumOptions, emptyValue));
|
|
21
|
+
};
|
|
22
|
+
const _onBlur = () => onBlur(id, value);
|
|
23
|
+
const _onFocus = () => onFocus(id, value);
|
|
24
|
+
const inlineOption = options.inline ? { inline: true } : { grouped: true };
|
|
25
|
+
return (_jsx(Form.Group, Object.assign({}, inlineOption, { children: Array.isArray(enumOptions) &&
|
|
26
|
+
enumOptions.map((option, index) => {
|
|
27
|
+
const checked = enumOptionsIsSelected(option.value, value);
|
|
28
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
29
|
+
return (_createElement(Form.Field, Object.assign({ 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) })));
|
|
30
|
+
}) })));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=RadioWidget.js.map
|
|
@@ -0,0 +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,WAAW,EACX,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;QACX,OAAO;QACP,QAAQ;KACT,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,CAAC,CAA8B,EAAE,EAAE,KAAK,EAAE,UAAU,EAAiB,EAAE,EAAE;QACzF,OAAO,QAAQ,CAAC,wBAAwB,CAAI,UAAW,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC;IACrF,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3E,OAAO,CACL,KAAC,IAAI,CAAC,KAAK,oBAAK,YAAY,cACzB,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;YACzB,WAAW,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,kBACT,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,KAAK,EACd,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EACvB,IAAI,EAAE,EAAE,IACJ,aAAa,IACjB,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,CAAI,EAAE,CAAC,IAC3C,CACH,CAAC;YACJ,CAAC,CAAC,IACO,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/RadioWidget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
3
|
+
/** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
|
|
4
|
+
* in a div, with the value along side it.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `WidgetProps` for this component
|
|
7
|
+
*/
|
|
8
|
+
export default function RangeWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Input } from 'semantic-ui-react';
|
|
3
|
+
import { ariaDescribedByIds, rangeSpec } from '@rjsf/utils';
|
|
4
|
+
import { getSemanticProps } from '../util';
|
|
5
|
+
/** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
|
|
6
|
+
* in a div, with the value along side it.
|
|
7
|
+
*
|
|
8
|
+
* @param props - The `WidgetProps` for this component
|
|
9
|
+
*/
|
|
10
|
+
export default function RangeWidget(props) {
|
|
11
|
+
const { id, value, required, readonly, disabled, onChange, onBlur, onFocus, options, schema, uiSchema, formContext, rawErrors = [], } = props;
|
|
12
|
+
const semanticProps = getSemanticProps({
|
|
13
|
+
formContext,
|
|
14
|
+
options,
|
|
15
|
+
uiSchema,
|
|
16
|
+
defaultSchemaProps: {
|
|
17
|
+
fluid: true,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
// eslint-disable-next-line no-shadow
|
|
21
|
+
const _onChange = ({ target: { value } }) => onChange && onChange(value === '' ? options.emptyValue : value);
|
|
22
|
+
const _onBlur = () => onBlur && onBlur(id, value);
|
|
23
|
+
const _onFocus = () => onFocus && onFocus(id, value);
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx(Input, Object.assign({ id: id, name: id, type: 'range', required: required, disabled: disabled || readonly }, rangeSpec(schema), semanticProps, { value: value || '', error: rawErrors.length > 0, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }), id), _jsx("span", { children: value })] }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=RangeWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeWidget.js","sourceRoot":"","sources":["../../src/RangeWidget/RangeWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAA8D,SAAS,EAAE,MAAM,aAAa,CAAC;AACxH,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,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,GAAG,EAAE,GACf,GAAG,KAAK,CAAC;IACV,MAAM,aAAa,GAAG,gBAAgB,CAAU;QAC9C,WAAW;QACX,OAAO;QACP,QAAQ;QACR,kBAAkB,EAAE;YAClB,KAAK,EAAE,IAAI;SACZ;KACF,CAAC,CAAC;IAEH,qCAAqC;IACrC,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAiC,EAAE,EAAE,CACzE,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;IAErD,OAAO,CACL,8BACE,KAAC,KAAK,kBACJ,EAAE,EAAE,EAAE,EAEN,IAAI,EAAE,EAAE,EACR,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,IAC1B,SAAS,CAAI,MAAM,CAAC,EACpB,aAAa,IACjB,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,EAC3B,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,sBACC,kBAAkB,CAAI,EAAE,CAAC,KAZtC,EAAE,CAaP,EACF,yBAAO,KAAK,GAAQ,IACnB,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/RangeWidget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
3
|
+
/** The `SelectWidget` is a widget for rendering dropdowns.
|
|
4
|
+
* It is typically used with string properties constrained with enum options.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `WidgetProps` for this component
|
|
7
|
+
*/
|
|
8
|
+
export default function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ariaDescribedByIds, enumOptionsIndexForValue, enumOptionsValueForIndex, labelValue, } from '@rjsf/utils';
|
|
3
|
+
import map from 'lodash/map';
|
|
4
|
+
import { Form } from 'semantic-ui-react';
|
|
5
|
+
import { getSemanticProps } from '../util';
|
|
6
|
+
/**
|
|
7
|
+
* Returns and creates an array format required for semantic drop down
|
|
8
|
+
* @param {array} enumOptions- array of items for the dropdown
|
|
9
|
+
* @param {array} enumDisabled - array of enum option values to disable
|
|
10
|
+
* @returns {*}
|
|
11
|
+
*/
|
|
12
|
+
function createDefaultValueOptionsForDropDown(enumOptions, enumDisabled) {
|
|
13
|
+
const disabledOptions = enumDisabled || [];
|
|
14
|
+
const options = map(enumOptions, ({ label, value }, index) => ({
|
|
15
|
+
disabled: disabledOptions.indexOf(value) !== -1,
|
|
16
|
+
key: label,
|
|
17
|
+
text: label,
|
|
18
|
+
value: String(index),
|
|
19
|
+
}));
|
|
20
|
+
return options;
|
|
21
|
+
}
|
|
22
|
+
/** The `SelectWidget` is a widget for rendering dropdowns.
|
|
23
|
+
* It is typically used with string properties constrained with enum options.
|
|
24
|
+
*
|
|
25
|
+
* @param props - The `WidgetProps` for this component
|
|
26
|
+
*/
|
|
27
|
+
export default function SelectWidget(props) {
|
|
28
|
+
const { uiSchema, formContext, id, options, label, hideLabel, required, disabled, readonly, value, multiple, placeholder, autofocus, onChange, onBlur, onFocus, rawErrors = [], } = props;
|
|
29
|
+
const semanticProps = getSemanticProps({
|
|
30
|
+
uiSchema,
|
|
31
|
+
formContext,
|
|
32
|
+
options,
|
|
33
|
+
defaultSchemaProps: {
|
|
34
|
+
inverted: 'false',
|
|
35
|
+
selection: true,
|
|
36
|
+
fluid: true,
|
|
37
|
+
scrolling: true,
|
|
38
|
+
upward: false,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
const { enumDisabled, enumOptions, emptyValue: optEmptyVal } = options;
|
|
42
|
+
const emptyValue = multiple ? [] : '';
|
|
43
|
+
const dropdownOptions = createDefaultValueOptionsForDropDown(enumOptions, enumDisabled);
|
|
44
|
+
const _onChange = (_, { value }) => onChange(enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
|
|
45
|
+
// eslint-disable-next-line no-shadow
|
|
46
|
+
const _onBlur = (_, { target: { value } }) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
|
|
47
|
+
const _onFocus = (_, { target: { value } }) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
|
|
48
|
+
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
49
|
+
return (_jsx(Form.Dropdown, Object.assign({ 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));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=SelectWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectWidget.js","sourceRoot":"","sources":["../../src/SelectWidget/SelectWidget.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/SelectWidget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { FormProps } from '@rjsf/core';
|
|
3
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
4
|
+
export declare function generateForm<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): ComponentType<FormProps<T, S, F>>;
|
|
5
|
+
declare const _default: ComponentType<FormProps<any, RJSFSchema, any>>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SemanticUIForm.js","sourceRoot":"","sources":["../../src/SemanticUIForm/SemanticUIForm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAGlD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,YAAY;IAK1B,OAAO,SAAS,CAAU,aAAa,EAAW,CAAC,CAAC;AACtD,CAAC;AAED,eAAe,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/SemanticUIForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, SubmitButtonProps } from '@rjsf/utils';
|
|
3
|
+
/** The `SubmitButton` renders a button that represent the `Submit` action on a form
|
|
4
|
+
*/
|
|
5
|
+
export default function SubmitButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ uiSchema }: SubmitButtonProps<T, S, F>): JSX.Element | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from 'semantic-ui-react';
|
|
3
|
+
import { getSubmitButtonOptions } from '@rjsf/utils';
|
|
4
|
+
/** The `SubmitButton` renders a button that represent the `Submit` action on a form
|
|
5
|
+
*/
|
|
6
|
+
export default function SubmitButton({ uiSchema }) {
|
|
7
|
+
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
8
|
+
if (norender) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (_jsx(Button, Object.assign({ type: 'submit', primary: true }, submitButtonProps, { children: submitText })));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=SubmitButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmitButton.js","sourceRoot":"","sources":["../../src/SubmitButton/SubmitButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAoE,MAAM,aAAa,CAAC;AAEvH;GACG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAIlC,EAAE,QAAQ,EAA8B;IACxC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,GAAG,EAAE,EAAE,GAAG,sBAAsB,CAAU,QAAQ,CAAC,CAAC;IAC1G,IAAI,QAAQ,EAAE;QACZ,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,KAAC,MAAM,kBAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,UAAK,iBAAiB,cAChD,UAAU,IACJ,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/SubmitButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
|
|
2
|
+
export declare function generateTemplates<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): Partial<TemplatesType<T, S, F>>;
|
|
3
|
+
declare const _default: Partial<TemplatesType<any, RJSFSchema, any>>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import AddButton from '../AddButton';
|
|
2
|
+
import ArrayFieldItemTemplate from '../ArrayFieldItemTemplate';
|
|
3
|
+
import ArrayFieldTemplate from '../ArrayFieldTemplate';
|
|
4
|
+
import BaseInputTemplate from '../BaseInputTemplate';
|
|
5
|
+
import DescriptionField from '../DescriptionField';
|
|
6
|
+
import ErrorList from '../ErrorList';
|
|
7
|
+
import { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } from '../IconButton';
|
|
8
|
+
import FieldErrorTemplate from '../FieldErrorTemplate';
|
|
9
|
+
import FieldHelpTemplate from '../FieldHelpTemplate';
|
|
10
|
+
import FieldTemplate from '../FieldTemplate';
|
|
11
|
+
import ObjectFieldTemplate from '../ObjectFieldTemplate';
|
|
12
|
+
import SubmitButton from '../SubmitButton';
|
|
13
|
+
import TitleField from '../TitleField';
|
|
14
|
+
import WrapIfAdditionalTemplate from '../WrapIfAdditionalTemplate';
|
|
15
|
+
export function generateTemplates() {
|
|
16
|
+
return {
|
|
17
|
+
ArrayFieldItemTemplate,
|
|
18
|
+
ArrayFieldTemplate,
|
|
19
|
+
BaseInputTemplate,
|
|
20
|
+
ButtonTemplates: {
|
|
21
|
+
AddButton,
|
|
22
|
+
CopyButton,
|
|
23
|
+
MoveDownButton,
|
|
24
|
+
MoveUpButton,
|
|
25
|
+
RemoveButton,
|
|
26
|
+
SubmitButton,
|
|
27
|
+
},
|
|
28
|
+
DescriptionFieldTemplate: DescriptionField,
|
|
29
|
+
ErrorListTemplate: ErrorList,
|
|
30
|
+
FieldErrorTemplate,
|
|
31
|
+
FieldHelpTemplate,
|
|
32
|
+
FieldTemplate,
|
|
33
|
+
ObjectFieldTemplate,
|
|
34
|
+
TitleFieldTemplate: TitleField,
|
|
35
|
+
WrapIfAdditionalTemplate,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export default generateTemplates();
|
|
39
|
+
//# sourceMappingURL=Templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Templates.js","sourceRoot":"","sources":["../../src/Templates/Templates.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,wBAAwB,MAAM,6BAA6B,CAAC;AAEnE,MAAM,UAAU,iBAAiB;IAK/B,OAAO;QACL,sBAAsB;QACtB,kBAAkB;QAClB,iBAAiB;QACjB,eAAe,EAAE;YACf,SAAS;YACT,UAAU;YACV,cAAc;YACd,YAAY;YACZ,YAAY;YACZ,YAAY;SACb;QACD,wBAAwB,EAAE,gBAAgB;QAC1C,iBAAiB,EAAE,SAAS;QAC5B,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;QACb,mBAAmB;QACnB,kBAAkB,EAAE,UAAU;QAC9B,wBAAwB;KACzB,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
3
|
+
/** The `TextareaWidget` is a widget for rendering input fields as textarea.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `WidgetProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function TextareaWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ariaDescribedByIds, labelValue, } from '@rjsf/utils';
|
|
3
|
+
import { Form } from 'semantic-ui-react';
|
|
4
|
+
import { getSemanticProps } from '../util';
|
|
5
|
+
/** The `TextareaWidget` is a widget for rendering input fields as textarea.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `WidgetProps` for this component
|
|
8
|
+
*/
|
|
9
|
+
export default function TextareaWidget(props) {
|
|
10
|
+
const { id, placeholder, value, required, disabled, autofocus, label, hideLabel, readonly, onBlur, onFocus, onChange, options, formContext, rawErrors = [], } = props;
|
|
11
|
+
const semanticProps = getSemanticProps({
|
|
12
|
+
formContext,
|
|
13
|
+
options,
|
|
14
|
+
defaultSchemaProps: { inverted: 'false' },
|
|
15
|
+
});
|
|
16
|
+
// eslint-disable-next-line no-shadow
|
|
17
|
+
const _onChange = ({ target: { value } }) => onChange && onChange(value === '' ? options.emptyValue : value);
|
|
18
|
+
const _onBlur = () => onBlur && onBlur(id, value);
|
|
19
|
+
const _onFocus = () => onFocus && onFocus(id, value);
|
|
20
|
+
return (_jsx(Form.TextArea, Object.assign({ 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));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=TextareaWidget.js.map
|
|
@@ -0,0 +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,WAAW,EACX,SAAS,GAAG,EAAE,GACf,GAAG,KAAK,CAAC;IACV,MAAM,aAAa,GAAG,gBAAgB,CAAU;QAC9C,WAAW;QACX,OAAO;QACP,kBAAkB,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,kBACZ,EAAE,EAAE,EAAE,EAEN,IAAI,EAAE,EAAE,EACR,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,IAC1B,aAAa,IACjB,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,CAAI,EAAE,CAAC,KAdtC,EAAE,CAeP,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TextareaWidget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import { ThemeProps } from '@rjsf/core';
|
|
3
|
+
export declare function generateTheme<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): ThemeProps<T, S, F>;
|
|
4
|
+
declare const _default: ThemeProps<any, RJSFSchema, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Form as SuiForm } from 'semantic-ui-react';
|
|
2
|
+
import { generateTemplates } from '../Templates';
|
|
3
|
+
import { generateWidgets } from '../Widgets';
|
|
4
|
+
export function generateTheme() {
|
|
5
|
+
return {
|
|
6
|
+
templates: generateTemplates(),
|
|
7
|
+
widgets: generateWidgets(),
|
|
8
|
+
_internalFormWrapper: SuiForm,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export default generateTheme();
|
|
12
|
+
//# sourceMappingURL=Theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Theme.js","sourceRoot":"","sources":["../../src/Theme/Theme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,UAAU,aAAa;IAK3B,OAAO;QACL,SAAS,EAAE,iBAAiB,EAAW;QACvC,OAAO,EAAE,eAAe,EAAW;QACnC,oBAAoB,EAAE,OAAO;KAC9B,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, TitleFieldProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `TitleField` is the template to use to render the title of a field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `TitleFieldProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function TitleField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, title, uiSchema, }: TitleFieldProps<T, S, F>): JSX.Element | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Header } from 'semantic-ui-react';
|
|
3
|
+
import { getSemanticProps } from '../util';
|
|
4
|
+
const DEFAULT_OPTIONS = {
|
|
5
|
+
inverted: false,
|
|
6
|
+
dividing: true,
|
|
7
|
+
};
|
|
8
|
+
/** The `TitleField` is the template to use to render the title of a field
|
|
9
|
+
*
|
|
10
|
+
* @param props - The `TitleFieldProps` for this component
|
|
11
|
+
*/
|
|
12
|
+
export default function TitleField({ id, title, uiSchema, }) {
|
|
13
|
+
const semanticProps = getSemanticProps({
|
|
14
|
+
uiSchema,
|
|
15
|
+
defaultSchemaProps: DEFAULT_OPTIONS,
|
|
16
|
+
});
|
|
17
|
+
if (!title) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return (_jsx(Header, Object.assign({ id: id }, semanticProps, { as: 'h5' }, { children: title })));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=TitleField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TitleField.js","sourceRoot":"","sources":["../../src/TitleField/TitleField.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,eAAe,GAAG;IACtB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAoF,EACpH,EAAE,EACF,KAAK,EACL,QAAQ,GACiB;IACzB,MAAM,aAAa,GAAG,gBAAgB,CAAU;QAC9C,QAAQ;QACR,kBAAkB,EAAE,eAAe;KACpC,CAAC,CAAC;IACH,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,KAAC,MAAM,kBAAC,EAAE,EAAE,EAAE,IAAM,aAAa,IAAE,EAAE,EAAC,IAAI,gBACvC,KAAK,IACC,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TitleField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,cAAc,CAAC"}
|