@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,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `AddButton` renders a button that represent the `Add` action on a form
|
|
4
|
+
*/
|
|
5
|
+
export default function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ uiSchema, registry, color, ...props }: IconButtonProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Button, Icon } from 'semantic-ui-react';
|
|
4
|
+
import { TranslatableString } from '@rjsf/utils';
|
|
5
|
+
/** The `AddButton` renders a button that represent the `Add` action on a form
|
|
6
|
+
*/
|
|
7
|
+
export default function AddButton(_a) {
|
|
8
|
+
var { uiSchema, registry, color } = _a, props = __rest(_a, ["uiSchema", "registry", "color"]);
|
|
9
|
+
const { translateString } = registry;
|
|
10
|
+
return (_jsx(Button, Object.assign({ title: translateString(TranslatableString.AddItemButton), color: color }, props, { icon: true, size: 'tiny' }, { children: _jsx(Icon, { name: 'plus' }) })));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=AddButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddButton.js","sourceRoot":"","sources":["../../src/AddButton/AddButton.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAkE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjH;GACG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAoF,EAK1F;QAL0F,EACnH,QAAQ,EACR,QAAQ,EACR,KAAK,OAEoB,EADtB,KAAK,cAJ2G,iCAKpH,CADS;IAER,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IACrC,OAAO,CACL,KAAC,MAAM,kBACL,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,aAAa,CAAC,EACxD,KAAK,EAAE,KAA6B,IAChC,KAAK,IACT,IAAI,QACJ,IAAI,EAAC,MAAM,gBAEX,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,IACb,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AddButton/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 { ArrayFieldTemplateItemType, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
6
|
+
*/
|
|
7
|
+
export default function ArrayFieldItemTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: ArrayFieldTemplateItemType<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getUiOptions, } from '@rjsf/utils';
|
|
3
|
+
import { Button, Grid, Segment } from 'semantic-ui-react';
|
|
4
|
+
import { MaybeWrap } from '../util';
|
|
5
|
+
const gridStyle = (vertical) => ({
|
|
6
|
+
display: 'grid',
|
|
7
|
+
gridTemplateColumns: `1fr ${vertical ? 65 : 150}px`,
|
|
8
|
+
});
|
|
9
|
+
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
10
|
+
*
|
|
11
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
12
|
+
*/
|
|
13
|
+
export default function ArrayFieldItemTemplate(props) {
|
|
14
|
+
const { children, disabled, hasToolbar, hasCopy, hasMoveDown, hasMoveUp, hasRemove, index, onCopyIndexClick, onDropIndexClick, onReorderClick, readonly, uiSchema, registry, } = props;
|
|
15
|
+
const { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } = registry.templates.ButtonTemplates;
|
|
16
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
17
|
+
// Pull the semantic props out of the uiOptions that were put in via the ArrayFieldTemplate
|
|
18
|
+
const { horizontalButtons = true, wrapItem = false } = uiOptions.semantic;
|
|
19
|
+
return (_jsx("div", Object.assign({ className: 'array-item' }, { children: _jsx(MaybeWrap, Object.assign({ wrap: wrapItem, component: Segment }, { children: _jsxs(Grid, Object.assign({ style: Object.assign(Object.assign({}, gridStyle(!horizontalButtons)), { alignItems: 'center' }) }, { children: [_jsx(Grid.Column, Object.assign({ width: 16, verticalAlign: 'middle' }, { children: children })), hasToolbar && (_jsx(Grid.Column, { children: (hasMoveUp || hasMoveDown || hasRemove) && (_jsxs(Button.Group, Object.assign({ size: 'mini', vertical: !horizontalButtons }, { children: [(hasMoveUp || hasMoveDown) && (_jsx(MoveUpButton, { className: 'array-item-move-up', disabled: disabled || readonly || !hasMoveUp, onClick: onReorderClick(index, index - 1), uiSchema: uiSchema, registry: registry })), (hasMoveUp || hasMoveDown) && (_jsx(MoveDownButton, { className: 'array-item-move-down', disabled: disabled || readonly || !hasMoveDown, onClick: onReorderClick(index, index + 1), uiSchema: uiSchema, registry: registry })), hasCopy && (_jsx(CopyButton, { className: 'array-item-copy', disabled: disabled || readonly, onClick: onCopyIndexClick(index), uiSchema: uiSchema, registry: registry })), hasRemove && (_jsx(RemoveButton, { className: 'array-item-remove', disabled: disabled || readonly, onClick: onDropIndexClick(index), uiSchema: uiSchema, registry: registry }))] }))) }))] })) })) })));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=ArrayFieldItemTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrayFieldItemTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAML,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,M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 -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ArrayFieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
6
|
+
*/
|
|
7
|
+
export default function ArrayFieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: ArrayFieldTemplateProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { getTemplate, getUiOptions, isFixedItems, UI_OPTIONS_KEY, } from '@rjsf/utils';
|
|
4
|
+
import { cleanClassNames, getSemanticProps } from '../util';
|
|
5
|
+
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
8
|
+
*/
|
|
9
|
+
export default function ArrayFieldTemplate(props) {
|
|
10
|
+
const { uiSchema, idSchema, canAdd, className,
|
|
11
|
+
// classNames, This is not part of the type, so it is likely never passed in
|
|
12
|
+
disabled, formContext, items, onAddClick,
|
|
13
|
+
// options, This is not part of the type, so it is likely never passed in
|
|
14
|
+
readonly, required, schema, title, registry, } = props;
|
|
15
|
+
const semanticProps = getSemanticProps({
|
|
16
|
+
uiSchema,
|
|
17
|
+
formContext,
|
|
18
|
+
defaultSchemaProps: { horizontalButtons: true, wrapItem: false },
|
|
19
|
+
});
|
|
20
|
+
const { horizontalButtons, wrapItem } = semanticProps;
|
|
21
|
+
const semantic = { horizontalButtons, wrapItem };
|
|
22
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
23
|
+
const ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
24
|
+
const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
25
|
+
const ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
26
|
+
// Button templates are not overridden in the uiSchema
|
|
27
|
+
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
28
|
+
return (_jsxs("div", Object.assign({ className: cleanClassNames([className, isFixedItems(schema) ? '' : 'sortable-form-fields']) }, { children: [_jsx(ArrayFieldTitleTemplate, { idSchema: idSchema, title: uiOptions.title || title, schema: schema, uiSchema: uiSchema, required: required, registry: registry }), _jsx(ArrayFieldDescriptionTemplate, { idSchema: idSchema, description: uiOptions.description || schema.description, schema: schema, uiSchema: uiSchema, registry: registry }), _jsxs("div", { children: [_jsx("div", Object.assign({ className: 'row array-item-list' }, { children: items &&
|
|
29
|
+
items.map((_a) => {
|
|
30
|
+
var { key, uiSchema: itemUiSchema = {} } = _a, props = __rest(_a, ["key", "uiSchema"]);
|
|
31
|
+
// Merge in the semantic props from the ArrayFieldTemplate into each of the items
|
|
32
|
+
const mergedUiSchema = Object.assign(Object.assign({}, itemUiSchema), { [UI_OPTIONS_KEY]: Object.assign(Object.assign({}, itemUiSchema[UI_OPTIONS_KEY]), { semantic }) });
|
|
33
|
+
return _jsx(ArrayFieldItemTemplate, Object.assign({}, props, { uiSchema: mergedUiSchema }), key);
|
|
34
|
+
}) })), canAdd && (_jsx("div", Object.assign({ style: {
|
|
35
|
+
marginTop: '1rem',
|
|
36
|
+
position: 'relative',
|
|
37
|
+
textAlign: 'right',
|
|
38
|
+
} }, { children: _jsx(AddButton, { onClick: onAddClick, disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) })))] }, `array-item-list-${idSchema.$id}`)] })));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=ArrayFieldTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrayFieldTemplate.js","sourceR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QAAQ,CAAC,GAAG,EAAE,CA0BrC,KACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ArrayFieldTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseInputTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
4
|
+
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
5
|
+
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The `WidgetProps` for this template
|
|
8
|
+
*/
|
|
9
|
+
export default function BaseInputTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: BaseInputTemplateProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Form } from 'semantic-ui-react';
|
|
3
|
+
import { getSemanticProps } from '../util';
|
|
4
|
+
import { ariaDescribedByIds, examplesId, getInputProps, labelValue, } from '@rjsf/utils';
|
|
5
|
+
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
6
|
+
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
7
|
+
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
8
|
+
*
|
|
9
|
+
* @param props - The `WidgetProps` for this template
|
|
10
|
+
*/
|
|
11
|
+
export default function BaseInputTemplate(props) {
|
|
12
|
+
const { id, placeholder, label, hideLabel, value, required, readonly, disabled, onChange, onChangeOverride, onBlur, onFocus, autofocus, options, schema, uiSchema, formContext, type, rawErrors = [], } = props;
|
|
13
|
+
const inputProps = getInputProps(schema, type, options);
|
|
14
|
+
const semanticProps = getSemanticProps({
|
|
15
|
+
uiSchema,
|
|
16
|
+
formContext,
|
|
17
|
+
options,
|
|
18
|
+
});
|
|
19
|
+
const _onChange = ({ target: { value } }) => onChange(value === '' ? options.emptyValue : value);
|
|
20
|
+
const _onBlur = () => onBlur && onBlur(id, value);
|
|
21
|
+
const _onFocus = () => onFocus && onFocus(id, value);
|
|
22
|
+
return (_jsxs(_Fragment, { children: [_jsx(Form.Input, Object.assign({ 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", Object.assign({ id: examplesId(id) }, { children: schema.examples
|
|
23
|
+
.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : [])
|
|
24
|
+
.map((example) => {
|
|
25
|
+
return _jsx("option", { value: example }, example);
|
|
26
|
+
}) })))] }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=BaseInputTemplate.js.map
|
|
@@ -0,0 +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,O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AAC,CAAC,CAAC,SAAS,IACjD,aAAa,IACjB,KAAK,EAAE,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EACxC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,EAC3B,QAAQ,EAAE,gBAAgB,IAAI,SAAS,EACvC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,sBACC,kBAAkB,CAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAhBzD,EAAE,CAiBP,EACD,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CACjC,iCAAU,EAAE,EAAE,UAAU,CAAI,EAAE,CAAC,gBAC3B,MAAM,CAAC,QAAqB;qBAC3B,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,CAAC,MAAM,CAAC,OAAO,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,IACK,CACZ,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/BaseInputTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
3
|
+
/** The `CheckBoxWidget` is a widget for rendering boolean properties.
|
|
4
|
+
* It is typically used to represent a boolean.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `WidgetProps` for this component
|
|
7
|
+
*/
|
|
8
|
+
export default function CheckboxWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ariaDescribedByIds, descriptionId, getTemplate, labelValue, schemaRequiresTrueValue, } from '@rjsf/utils';
|
|
3
|
+
import { Form } from 'semantic-ui-react';
|
|
4
|
+
import { getSemanticProps } from '../util';
|
|
5
|
+
/** The `CheckBoxWidget` is a widget for rendering boolean properties.
|
|
6
|
+
* It is typically used to represent a boolean.
|
|
7
|
+
*
|
|
8
|
+
* @param props - The `WidgetProps` for this component
|
|
9
|
+
*/
|
|
10
|
+
export default function CheckboxWidget(props) {
|
|
11
|
+
var _a;
|
|
12
|
+
const { id, value, disabled, readonly, label = '', hideLabel, autofocus, onChange, onBlur, options, onFocus, formContext, schema, uiSchema, rawErrors = [], registry, } = props;
|
|
13
|
+
const semanticProps = getSemanticProps({
|
|
14
|
+
options,
|
|
15
|
+
formContext,
|
|
16
|
+
uiSchema,
|
|
17
|
+
defaultSchemaProps: {
|
|
18
|
+
inverted: 'false',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, options);
|
|
22
|
+
// Because an unchecked checkbox will cause html5 validation to fail, only add
|
|
23
|
+
// the "required" attribute if the field value must be "true", due to the
|
|
24
|
+
// "const" or "enum" keywords
|
|
25
|
+
const required = schemaRequiresTrueValue(schema);
|
|
26
|
+
const _onChange = (_, data) => onChange && onChange(data.checked);
|
|
27
|
+
const _onBlur = () => onBlur && onBlur(id, value);
|
|
28
|
+
const _onFocus = () => onFocus && onFocus(id, value);
|
|
29
|
+
const checked = value == 'true' || value == true;
|
|
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, Object.assign({ 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) }))] }));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=CheckboxWidget.js.map
|
|
@@ -0,0 +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,WAAW,EACX,MAAM,EACN,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,aAAa,GAAG,gBAAgB,CAAU;QAC9C,OAAO;QACP,WAAW;QACX,QAAQ;QACR,kBAAkB,EAAE;YAClB,QAAQ,EAAE,OAAO;SAClB;KACF,CAAC,CAAC;IACH,MAAM,wBAAwB,GAAG,WAAW,C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EACjB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,sBACxB,kBAAkB,CAAI,EAAE,CAAC,IAC3C,IACD,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/CheckboxWidget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
3
|
+
/** The `CheckboxesWidget` is a widget for rendering checkbox groups.
|
|
4
|
+
* It is typically used to represent an array of enums.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `WidgetProps` for this component
|
|
7
|
+
*/
|
|
8
|
+
export default function CheckboxesWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Form } from 'semantic-ui-react';
|
|
3
|
+
import { ariaDescribedByIds, enumOptionsDeselectValue, enumOptionsIsSelected, enumOptionsSelectValue, getTemplate, optionId, titleId, } from '@rjsf/utils';
|
|
4
|
+
import { getSemanticProps } from '../util';
|
|
5
|
+
/** The `CheckboxesWidget` is a widget for rendering checkbox groups.
|
|
6
|
+
* It is typically used to represent an array of enums.
|
|
7
|
+
*
|
|
8
|
+
* @param props - The `WidgetProps` for this component
|
|
9
|
+
*/
|
|
10
|
+
export default function CheckboxesWidget(props) {
|
|
11
|
+
const { id, disabled, options, value, autofocus, readonly, label, hideLabel, onChange, onBlur, onFocus, formContext, schema, uiSchema, rawErrors = [], registry, } = props;
|
|
12
|
+
const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
|
|
13
|
+
const { enumOptions, enumDisabled, inline } = options;
|
|
14
|
+
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
15
|
+
const semanticProps = getSemanticProps({
|
|
16
|
+
options,
|
|
17
|
+
formContext,
|
|
18
|
+
uiSchema,
|
|
19
|
+
defaultSchemaProps: {
|
|
20
|
+
inverted: 'false',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
const _onChange = (index) => ({ target: { checked } }) => {
|
|
24
|
+
// eslint-disable-next-line no-shadow
|
|
25
|
+
if (checked) {
|
|
26
|
+
onChange(enumOptionsSelectValue(index, checkboxesValues, enumOptions));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
onChange(enumOptionsDeselectValue(index, checkboxesValues, enumOptions));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const _onBlur = () => onBlur(id, value);
|
|
33
|
+
const _onFocus = () => onFocus(id, value);
|
|
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, Object.assign({ id: id, name: id }, inlineOption, { children: Array.isArray(enumOptions) &&
|
|
36
|
+
enumOptions.map((option, index) => {
|
|
37
|
+
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
38
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
39
|
+
return (_jsx(Form.Checkbox, Object.assign({ 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));
|
|
40
|
+
}) }))] }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=CheckboxesWidget.js.map
|
|
@@ -0,0 +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,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAItC,KAA2B;IAC3B,MAAM,EACJ,EAAE,EACF,QAAQ,EACR,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,EACR,KAAK,EACL,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,WAAW,EACX,MAAM,EACN,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,kBAAkB,GAAG,WAAW,CAAgC,oBAAoB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/G,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACtD,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAChE,MAAM,aAAa,GAAG,gBAAgB,CAAU;QAC9C,OAAO;QACP,WAAW;QACX,QAAQ;QACR,kBAAkB,EAAE;YAClB,QAAQ,EAAE,OAAO;SAClB;KACF,CAAC,CAAC;IACH,MAAM,SAAS,GACb,CAAC,KAAa,EAAE,EAAE,CAClB,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,E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AC;wBAC9F,OAAO,CACL,KAAC,IAAI,CAAC,QAAQ,kBACZ,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EACvB,IAAI,EAAE,EAAE,EAER,KAAK,EAAE,MAAM,CAAC,KAAK,IACf,aAAa,IACjB,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,CAAI,EAAE,CAAC,KAVtC,KAAK,CAWV,CACH,CAAC;oBACJ,CAAC,CAAC,IACO,IACZ,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/CheckboxesWidget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `DescriptionField` is the template to use to render the description of a field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `DescriptionFieldProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function DescriptionField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: DescriptionFieldProps<T, S, F>): JSX.Element | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** The `DescriptionField` is the template to use to render the description of a field
|
|
3
|
+
*
|
|
4
|
+
* @param props - The `DescriptionFieldProps` for this component
|
|
5
|
+
*/
|
|
6
|
+
export default function DescriptionField(props) {
|
|
7
|
+
const { id, description } = props;
|
|
8
|
+
if (!description) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (_jsx("p", Object.assign({ id: id, className: 'sui-description' }, { children: description })));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=DescriptionField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescriptionField.js","sourceRoot":"","sources":["../../src/DescriptionField/DescriptionField.tsx"],"names":[],"mappings":";AAEA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAItC,KAAqC;IACrC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAClC,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,0BAAG,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,iBAAiB,gBACnC,WAAW,IACV,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/DescriptionField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `ErrorListProps` for this component
|
|
6
|
+
*/
|
|
7
|
+
export default function ErrorList<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ errors, registry, }: ErrorListProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Message } from 'semantic-ui-react';
|
|
3
|
+
import { TranslatableString } from '@rjsf/utils';
|
|
4
|
+
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `ErrorListProps` for this component
|
|
7
|
+
*/
|
|
8
|
+
export default function ErrorList({ errors, registry, }) {
|
|
9
|
+
const { translateString } = registry;
|
|
10
|
+
return (_jsxs(Message, Object.assign({ negative: true }, { children: [_jsx(Message.Header, { children: translateString(TranslatableString.ErrorsLabel) }), _jsx(Message.List, { children: errors.map((error, index) => (_jsx(Message.Item, { children: error.stack }, `error-${index}`))) })] })));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ErrorList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorList.js","sourceRoot":"","sources":["../../src/ErrorList/ErrorList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAiE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEhH;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAoF,EACnH,MAAM,EACN,QAAQ,GACgB;IACxB,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IACrC,OAAO,CACL,MAAC,OAAO,kBAAC,QAAQ,uBACf,KAAC,OAAO,CAAC,MAAM,cAAE,eAAe,CAAC,kBAAkB,CAAC,WAAW,CAAC,GAAkB,EAClF,KAAC,OAAO,CAAC,IAAI,cACV,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5B,KAAC,OAAO,CAAC,IAAI,cAAyB,KAAK,CAAC,KAAK,IAA9B,SAAS,KAAK,EAAE,CAA8B,CAClE,CAAC,GACW,KACP,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ErrorList/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 { FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
6
|
+
*/
|
|
7
|
+
export default function FieldErrorTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ errors, idSchema, uiSchema, registry }: FieldErrorProps<T, S, F>): JSX.Element | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { errorId } from '@rjsf/utils';
|
|
3
|
+
import { nanoid } from 'nanoid';
|
|
4
|
+
import { Label, List } from 'semantic-ui-react';
|
|
5
|
+
import { getSemanticErrorProps } from '../util';
|
|
6
|
+
const DEFAULT_OPTIONS = {
|
|
7
|
+
options: {
|
|
8
|
+
pointing: 'above',
|
|
9
|
+
size: 'small',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
13
|
+
*
|
|
14
|
+
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
15
|
+
*/
|
|
16
|
+
export default function FieldErrorTemplate({ errors, idSchema, uiSchema, registry }) {
|
|
17
|
+
const { formContext } = registry;
|
|
18
|
+
const options = getSemanticErrorProps({
|
|
19
|
+
formContext,
|
|
20
|
+
uiSchema,
|
|
21
|
+
defaultProps: DEFAULT_OPTIONS,
|
|
22
|
+
});
|
|
23
|
+
const { pointing, size } = options;
|
|
24
|
+
if (errors && errors.length > 0) {
|
|
25
|
+
const id = errorId(idSchema);
|
|
26
|
+
return (_jsx(Label, Object.assign({ id: id, color: 'red', pointing: pointing || 'above', size: size || 'small', basic: true }, { children: _jsx(List, Object.assign({ bulleted: true }, { children: errors.map((error) => (_jsx(List.Item, { children: error }, nanoid()))) })) })));
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=FieldErrorTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldErrorTemplate.js","sourceRoot":"","sources":["../../src/FieldErrorTemplate/FieldErrorTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAkE,MAAM,aAAa,CAAC;AACtG,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,MAAM,eAAe,GAAG;IACtB,OAAO,EAAE;QACP,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,OAAO;KACd;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAA4B;IAClE,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC;IACjC,MAAM,OAAO,GAAG,qBAAqB,CAAU;QAC7C,WAAW;QACX,QAAQ;QACR,YAAY,EAAE,eAAe;KAC9B,CAAC,CAAC;IACH,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACnC,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/B,MAAM,EAAE,GAAG,OAAO,CAAI,QAAQ,CAAC,CAAC;QAChC,OAAO,CACL,KAAC,KAAK,kBAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAC,KAAK,EAAC,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,OAAO,EAAE,KAAK,sBACpF,KAAC,IAAI,kBAAC,QAAQ,sBACX,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,KAAC,IAAI,CAAC,IAAI,cAAiB,KAAK,IAAhB,MAAM,EAAE,CAAqB,CAC9C,CAAC,IACG,IACD,CACT,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/FieldErrorTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `FieldHelpTemplate` component renders any help desired for a field
|
|
4
|
+
*
|
|
5
|
+
* @param props - The `FieldHelpProps` to be rendered
|
|
6
|
+
*/
|
|
7
|
+
export default function FieldHelpTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldHelpProps<T, S, F>): JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Message } from 'semantic-ui-react';
|
|
3
|
+
import { helpId } from '@rjsf/utils';
|
|
4
|
+
/** The `FieldHelpTemplate` component renders any help desired for a field
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `FieldHelpProps` to be rendered
|
|
7
|
+
*/
|
|
8
|
+
export default function FieldHelpTemplate(props) {
|
|
9
|
+
const { idSchema, help } = props;
|
|
10
|
+
if (help) {
|
|
11
|
+
const id = helpId(idSchema);
|
|
12
|
+
return _jsx(Message, { size: 'mini', info: true, id: id, content: help });
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=FieldHelpTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldHelpTemplate.js","sourceRoot":"","sources":["../../src/FieldHelpTemplate/FieldHelpTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAiE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEpG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAIvC,KAA8B;IAC9B,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACjC,IAAI,IAAI,EAAE;QACR,MAAM,EAAE,GAAG,MAAM,CAAI,QAAQ,CAAC,CAAC;QAC/B,OAAO,KAAC,OAAO,IAAC,IAAI,EAAC,MAAM,EAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,GAAI,CAAC;KAC5D;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/FieldHelpTemplate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
|
|
4
|
+
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
|
|
5
|
+
*
|
|
6
|
+
* @param props - The `FieldTemplateProps` for this component
|
|
7
|
+
*/
|
|
8
|
+
export default function FieldTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldTemplateProps<T, S, F>): JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { getTemplate, getUiOptions, } from '@rjsf/utils';
|
|
4
|
+
import { Form } from 'semantic-ui-react';
|
|
5
|
+
import { getSemanticProps, MaybeWrap } from '../util';
|
|
6
|
+
/** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
|
|
7
|
+
* content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
|
|
8
|
+
*
|
|
9
|
+
* @param props - The `FieldTemplateProps` for this component
|
|
10
|
+
*/
|
|
11
|
+
export default function FieldTemplate(props) {
|
|
12
|
+
const { id, children, classNames, style, displayLabel, label, errors, help, hidden, description, rawDescription, registry, schema, uiSchema } = props, otherProps = __rest(props, ["id", "children", "classNames", "style", "displayLabel", "label", "errors", "help", "hidden", "description", "rawDescription", "registry", "schema", "uiSchema"]);
|
|
13
|
+
const semanticProps = getSemanticProps(otherProps);
|
|
14
|
+
const { wrapLabel, wrapContent } = semanticProps;
|
|
15
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
16
|
+
const WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
|
|
17
|
+
if (hidden) {
|
|
18
|
+
return _jsx("div", Object.assign({ style: { display: 'none' } }, { children: children }));
|
|
19
|
+
}
|
|
20
|
+
return (_jsx(WrapIfAdditionalTemplate, Object.assign({ classNames: classNames, style: style, id: id, label: label, registry: registry, schema: schema, uiSchema: uiSchema }, otherProps, { children: _jsx(Form.Group, Object.assign({ widths: 'equal', grouped: true }, { children: _jsxs(MaybeWrap, Object.assign({ wrap: wrapContent, className: 'sui-field-content' }, { children: [children, displayLabel && rawDescription && (_jsx(MaybeWrap, Object.assign({ wrap: wrapLabel, className: 'sui-field-label' }, { children: description }))), help, errors] })) }), id) })));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=FieldTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldTemplate.js","sourceRoot":"","sources":["../../src/FieldTemplate/FieldTemplate.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAKL,WAAW,EACX,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAInC,KAAkC;IAClC,MAAM,EACJ,EAAE,EACF,QAAQ,EACR,UAAU,EACV,KAAK,EACL,YAAY,EACZ,KAAK,EACL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,WAAW,EACX,cAAc,EACd,QAAQ,EACR,MAAM,EACN,QAAQ,KAEN,KAAK,EADJ,UAAU,UACX,KAAK,EAhBH,iKAgBL,CAAQ,CAAC;IACV,MAAM,aAAa,GAAG,gBAAgB,CAAU,UAAU,CAAC,CAAC;IAC5D,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;IACjD,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,wBAAwB,GAAG,WAAW,CAC1C,0BAA0B,EAC1B,QAAQ,EACR,SAAS,CACV,CAAC;IAEF,IAAI,MAAM,EAAE;QACV,OAAO,4BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAG,QAAQ,IAAO,CAAC;KAC1D;IAED,OAAO,CACL,KAAC,wBAAwB,kBACvB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QA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