@rjsf/antd 6.6.0 → 6.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/antd.esm.js +79 -136
- package/dist/antd.esm.js.map +4 -4
- package/dist/antd.umd.js +55 -63
- package/dist/index.cjs +80 -91
- package/dist/index.cjs.map +4 -4
- package/lib/index.d.ts +3 -3
- package/lib/index.js.map +1 -1
- package/lib/templates/ArrayFieldItemTemplate/index.d.ts +1 -1
- package/lib/templates/ArrayFieldItemTemplate/index.js +1 -1
- package/lib/templates/ArrayFieldItemTemplate/index.js.map +1 -1
- package/lib/templates/ArrayFieldTemplate/index.d.ts +1 -1
- package/lib/templates/ArrayFieldTemplate/index.js +1 -1
- package/lib/templates/ArrayFieldTemplate/index.js.map +1 -1
- package/lib/templates/BaseInputTemplate/index.d.ts +1 -1
- package/lib/templates/BaseInputTemplate/index.js +3 -4
- package/lib/templates/BaseInputTemplate/index.js.map +1 -1
- package/lib/templates/ErrorList/index.d.ts +1 -1
- package/lib/templates/ErrorList/index.js +2 -2
- package/lib/templates/ErrorList/index.js.map +1 -1
- package/lib/templates/FieldDescriptionTemplate/index.d.ts +1 -1
- package/lib/templates/FieldErrorTemplate/index.d.ts +1 -1
- package/lib/templates/FieldErrorTemplate/index.js.map +1 -1
- package/lib/templates/FieldHelpTemplate/index.d.ts +1 -1
- package/lib/templates/FieldHelpTemplate/index.js.map +1 -1
- package/lib/templates/FieldTemplate/index.d.ts +1 -1
- package/lib/templates/FieldTemplate/index.js +1 -1
- package/lib/templates/FieldTemplate/index.js.map +1 -1
- package/lib/templates/GridTemplate/index.d.ts +1 -1
- package/lib/templates/IconButton/index.d.ts +2 -2
- package/lib/templates/IconButton/index.js +1 -1
- package/lib/templates/IconButton/index.js.map +1 -1
- package/lib/templates/MultiSchemaFieldTemplate/index.d.ts +1 -1
- package/lib/templates/ObjectFieldTemplate/index.d.ts +1 -1
- package/lib/templates/ObjectFieldTemplate/index.js +1 -1
- package/lib/templates/ObjectFieldTemplate/index.js.map +1 -1
- package/lib/templates/OptionalDataControlsTemplate/index.d.ts +1 -1
- package/lib/templates/OptionalDataControlsTemplate/index.js +1 -1
- package/lib/templates/OptionalDataControlsTemplate/index.js.map +1 -1
- package/lib/templates/SubmitButton/index.d.ts +1 -1
- package/lib/templates/SubmitButton/index.js.map +1 -1
- package/lib/templates/TitleField/index.d.ts +1 -1
- package/lib/templates/TitleField/index.js +4 -1
- package/lib/templates/TitleField/index.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate/index.d.ts +1 -1
- package/lib/templates/WrapIfAdditionalTemplate/index.js +1 -1
- package/lib/templates/WrapIfAdditionalTemplate/index.js.map +1 -1
- package/lib/templates/index.d.ts +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/AltDateTimeWidget/index.d.ts +1 -1
- package/lib/widgets/AltDateWidget/index.d.ts +1 -1
- package/lib/widgets/AltDateWidget/index.js +1 -1
- package/lib/widgets/AltDateWidget/index.js.map +1 -1
- package/lib/widgets/CheckboxWidget/index.d.ts +1 -1
- package/lib/widgets/CheckboxWidget/index.js +1 -1
- package/lib/widgets/CheckboxWidget/index.js.map +1 -1
- package/lib/widgets/CheckboxesWidget/index.d.ts +1 -1
- package/lib/widgets/CheckboxesWidget/index.js +3 -3
- package/lib/widgets/CheckboxesWidget/index.js.map +1 -1
- package/lib/widgets/DateTimeWidget/index.d.ts +3 -3
- package/lib/widgets/DateTimeWidget/index.js +4 -16
- package/lib/widgets/DateTimeWidget/index.js.map +1 -1
- package/lib/widgets/DateWidget/index.d.ts +9 -2
- package/lib/widgets/DateWidget/index.js +10 -6
- package/lib/widgets/DateWidget/index.js.map +1 -1
- package/lib/widgets/PasswordWidget/index.d.ts +1 -1
- package/lib/widgets/PasswordWidget/index.js +1 -1
- package/lib/widgets/PasswordWidget/index.js.map +1 -1
- package/lib/widgets/RadioWidget/index.d.ts +1 -1
- package/lib/widgets/RadioWidget/index.js +1 -1
- package/lib/widgets/RadioWidget/index.js.map +1 -1
- package/lib/widgets/RangeWidget/index.d.ts +1 -1
- package/lib/widgets/RangeWidget/index.js +1 -1
- package/lib/widgets/RangeWidget/index.js.map +1 -1
- package/lib/widgets/SelectWidget/index.d.ts +1 -1
- package/lib/widgets/SelectWidget/index.js +6 -6
- package/lib/widgets/SelectWidget/index.js.map +1 -1
- package/lib/widgets/TextareaWidget/index.d.ts +1 -1
- package/lib/widgets/TextareaWidget/index.js +1 -1
- package/lib/widgets/TextareaWidget/index.js.map +1 -1
- package/lib/widgets/index.d.ts +1 -1
- package/package.json +9 -9
- package/src/index.ts +4 -3
- package/src/templates/ArrayFieldItemTemplate/index.tsx +2 -8
- package/src/templates/ArrayFieldTemplate/index.tsx +2 -4
- package/src/templates/BaseInputTemplate/index.tsx +7 -8
- package/src/templates/ErrorList/index.tsx +4 -2
- package/src/templates/FieldDescriptionTemplate/index.tsx +1 -1
- package/src/templates/FieldErrorTemplate/index.tsx +2 -1
- package/src/templates/FieldHelpTemplate/index.tsx +2 -1
- package/src/templates/FieldTemplate/index.tsx +2 -9
- package/src/templates/GridTemplate/index.tsx +1 -1
- package/src/templates/IconButton/index.tsx +5 -10
- package/src/templates/MultiSchemaFieldTemplate/index.tsx +1 -1
- package/src/templates/ObjectFieldTemplate/index.tsx +2 -6
- package/src/templates/OptionalDataControlsTemplate/index.tsx +3 -2
- package/src/templates/SubmitButton/index.tsx +4 -2
- package/src/templates/TitleField/index.tsx +5 -1
- package/src/templates/WrapIfAdditionalTemplate/index.tsx +2 -10
- package/src/templates/index.ts +1 -1
- package/src/widgets/AltDateTimeWidget/index.tsx +1 -1
- package/src/widgets/AltDateWidget/index.tsx +2 -10
- package/src/widgets/CheckboxWidget/index.tsx +5 -11
- package/src/widgets/CheckboxesWidget/index.tsx +27 -32
- package/src/widgets/DateTimeWidget/index.tsx +5 -43
- package/src/widgets/DateWidget/index.tsx +28 -15
- package/src/widgets/PasswordWidget/index.tsx +3 -9
- package/src/widgets/RadioWidget/index.tsx +6 -9
- package/src/widgets/RangeWidget/index.tsx +2 -9
- package/src/widgets/SelectWidget/index.tsx +16 -17
- package/src/widgets/TextareaWidget/index.tsx +3 -9
- package/src/widgets/index.ts +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
2
|
export default function AltDateTimeWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ time, ...props }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
2
|
export default function AltDateWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ autofocus, disabled, options, readonly, time, ...props }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { DateElement, TranslatableString, useAltDateWidgetProps
|
|
2
|
+
import { DateElement, TranslatableString, useAltDateWidgetProps } from '@rjsf/utils';
|
|
3
3
|
import { Row, Col, Button } from 'antd';
|
|
4
4
|
export default function AltDateWidget({ autofocus = false, disabled = false, options, readonly = false, time = false, ...props }) {
|
|
5
5
|
const { id, name, onBlur, onFocus, registry } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/AltDateWidget/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/AltDateWidget/index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KAAC,WAAW,IACV,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,YAAY,KAChB,SAAS,EACb,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,IAAI,CAAC,KAAK,CAAC,GAC/B,IAZkB,MAAM,CAatB,CACP,CAAC;YACJ,CAAC,CAAC,EACD,CAAC,OAAO,CAAC,aAAa,IAAI,CACzB,KAAC,GAAG,IAAC,IAAI,EAAC,MAAM,YACd,KAAC,MAAM,IAAC,KAAK,QAAC,SAAS,EAAC,SAAS,EAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAC,SAAS,YACpE,eAAe,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GACtC,GACL,CACP,EACA,CAAC,OAAO,CAAC,eAAe,IAAI,CAC3B,KAAC,GAAG,IAAC,IAAI,EAAC,MAAM,YACd,KAAC,MAAM,IAAC,KAAK,QAAC,SAAS,EAAC,WAAW,EAAC,MAAM,QAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAC,SAAS,YAC5E,eAAe,CAAC,kBAAkB,CAAC,UAAU,CAAC,GACxC,GACL,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
2
|
/** The `CheckBoxWidget` is a widget for rendering boolean properties.
|
|
3
3
|
* It is typically used to represent a boolean.
|
|
4
4
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ariaDescribedByIds, labelValue
|
|
2
|
+
import { ariaDescribedByIds, labelValue } from '@rjsf/utils';
|
|
3
3
|
import { Checkbox } from 'antd';
|
|
4
4
|
/** The `CheckBoxWidget` is a widget for rendering boolean properties.
|
|
5
5
|
* It is typically used to represent a boolean.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/CheckboxWidget/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/CheckboxWidget/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAIpC,KAA2B;IAC3B,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,GACjH,KAAK,CAAC;IACR,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC;IACjC,MAAM,EAAE,kBAAkB,GAAG,IAAI,EAAE,GAAG,WAAgC,CAAC;IAEvE,MAAM,YAAY,GAA2C,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEtG,MAAM,UAAU,GAAG,CAAC,EAAE,MAAM,EAAgC,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAEtG,MAAM,WAAW,GAAG,CAAC,EAAE,MAAM,EAAgC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAExG,iHAAiH;IACjH,8GAA8G;IAC9G,MAAM,UAAU,GAAG;QACjB,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;QAC1C,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;KAC7C,CAAC;IACF,OAAO,CACL,KAAC,QAAQ,IACP,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EACrD,QAAQ,EAAE,QAAQ,IAAI,CAAC,kBAAkB,IAAI,QAAQ,CAAC,EACtD,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,QAAQ,IAAI,EAAE,EACpB,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,KAC1C,UAAU,sBACI,kBAAkB,CAAC,EAAE,CAAC,YAEvC,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,GACxB,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, WidgetProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, WidgetProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
/** The `CheckboxesWidget` is a widget for rendering checkbox groups.
|
|
3
3
|
* It is typically used to represent an array of enums.
|
|
4
4
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ariaDescribedByIds, enumOptionSelectedValue, enumOptionValueDecoder, enumOptionValueEncoder, getOptionValueFormat, optionId, } from '@rjsf/utils';
|
|
3
3
|
import { Checkbox } from 'antd';
|
|
4
4
|
/** The `CheckboxesWidget` is a widget for rendering checkbox groups.
|
|
@@ -22,7 +22,7 @@ export default function CheckboxesWidget({ autofocus, disabled, registry, id, ht
|
|
|
22
22
|
onFocus: !readonly ? handleFocus : undefined,
|
|
23
23
|
};
|
|
24
24
|
const selectValue = enumOptionSelectedValue(value, enumOptions, true, optionValueFormat, []);
|
|
25
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? (_jsx(
|
|
26
|
-
|
|
25
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? (_jsx(Checkbox.Group, { disabled: disabled || (readonlyAsDisabled && readonly), name: htmlName || id, onChange: !readonly ? handleChange : undefined, value: selectValue, ...extraProps, "aria-describedby": ariaDescribedByIds(id), children: Array.isArray(enumOptions) &&
|
|
26
|
+
enumOptions.map((option, i) => (_jsxs("span", { children: [_jsx(Checkbox, { id: optionId(id, i), name: htmlName || id, autoFocus: i === 0 ? autofocus : false, disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value), value: enumOptionValueEncoder(option.value, i, optionValueFormat), children: option.label }), !inline && _jsx("br", {})] }, i))) })) : null;
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/CheckboxesWidget/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/CheckboxesWidget/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAItC,EACA,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,EACR,KAA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KAAC,QAAQ,CAAC,KAAK,IACb,QAAQ,EAAE,QAAQ,IAAI,CAAC,kBAAkB,IAAI,QAAQ,CAAC,EACtD,IAAI,EAAE,QAAQ,IAAI,EAAE,EACpB,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAC9C,KAAK,EAAE,WAAW,KACd,UAAU,sBACI,kBAAkB,CAAC,EAAE,CAAC,YAEvC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;YACzB,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAE7B,2BACE,KAAC,QAAQ,IACP,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,EACnB,IAAI,EAAE,QAAQ,IAAI,EAAE,EACpB,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EACtC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5E,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,iBAAiB,CAAC,YAEhE,MAAM,CAAC,KAAK,GACJ,EACV,CAAC,MAAM,IAAI,cAAM,KAVT,CAAC,CAWL,CACR,CAAC,GACW,CAClB,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
|
-
/** The `DateTimeWidget` component uses the `
|
|
3
|
-
* the value to/from
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
|
+
/** The `DateTimeWidget` component uses the `DateWidget` with `showTime` enabled, transforming
|
|
3
|
+
* the value to/from ISO string format.
|
|
4
4
|
*
|
|
5
5
|
* @param props - The `WidgetProps` for this component
|
|
6
6
|
*/
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const DATE_PICKER_STYLE = {
|
|
6
|
-
width: '100%',
|
|
7
|
-
};
|
|
8
|
-
/** The `DateTimeWidget` component uses the `BaseInputTemplate` changing the type to `datetime-local` and transforms
|
|
9
|
-
* the value to/from utc using the appropriate utility functions.
|
|
2
|
+
import DateWidget from '../DateWidget/index.js';
|
|
3
|
+
/** The `DateTimeWidget` component uses the `DateWidget` with `showTime` enabled, transforming
|
|
4
|
+
* the value to/from ISO string format.
|
|
10
5
|
*
|
|
11
6
|
* @param props - The `WidgetProps` for this component
|
|
12
7
|
*/
|
|
13
8
|
export default function DateTimeWidget(props) {
|
|
14
|
-
|
|
15
|
-
const { formContext } = registry;
|
|
16
|
-
const { readonlyAsDisabled = true } = formContext;
|
|
17
|
-
const handleChange = (nextValue) => onChange(nextValue && nextValue.toISOString());
|
|
18
|
-
const handleBlur = () => onBlur(id, value);
|
|
19
|
-
const handleFocus = () => onFocus(id, value);
|
|
20
|
-
const getPopupContainer = (node) => node.parentNode;
|
|
21
|
-
return (_jsx(DatePicker, { disabled: disabled || (readonlyAsDisabled && readonly), getPopupContainer: getPopupContainer, id: id, name: id, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, showTime: true, style: DATE_PICKER_STYLE, value: value && dayjs(value), "aria-describedby": ariaDescribedByIds(id) }));
|
|
9
|
+
return _jsx(DateWidget, { showTime: true, ...props });
|
|
22
10
|
}
|
|
23
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/DateTimeWidget/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/DateTimeWidget/index.tsx"],"names":[],"mappings":";AAEA,OAAO,UAAU,MAAM,eAAe,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAIpC,KAA2B;IAC3B,OAAO,KAAC,UAAU,IAAC,QAAQ,WAAK,KAAK,GAAI,CAAC;AAC5C,CAAC"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
|
+
type DateWidgetProps<T, S extends StrictRJSFSchema, F extends FormContextType> = WidgetProps<T, S, F> & {
|
|
3
|
+
showTime?: boolean;
|
|
4
|
+
};
|
|
2
5
|
/** The `DateWidget` component uses the `BaseInputTemplate` changing the type to `date` and transforms
|
|
3
6
|
* the value to undefined when it is falsy during the `onChange` handling.
|
|
4
7
|
*
|
|
5
8
|
* @param props - The `WidgetProps` for this component
|
|
6
9
|
*/
|
|
7
|
-
|
|
10
|
+
declare function DateWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ disabled, registry, id, onBlur, onChange, onFocus, placeholder, readonly, value, showTime, }: DateWidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare namespace DateWidget {
|
|
12
|
+
var getPopupContainerCallback: () => (node: any) => any;
|
|
13
|
+
}
|
|
14
|
+
export default DateWidget;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ariaDescribedByIds
|
|
2
|
+
import { ariaDescribedByIds } from '@rjsf/utils';
|
|
3
3
|
import { DatePicker } from 'antd';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
const DATE_PICKER_STYLE = {
|
|
@@ -10,14 +10,18 @@ const DATE_PICKER_STYLE = {
|
|
|
10
10
|
*
|
|
11
11
|
* @param props - The `WidgetProps` for this component
|
|
12
12
|
*/
|
|
13
|
-
export default function DateWidget(
|
|
14
|
-
const { disabled, registry, id, onBlur, onChange, onFocus, placeholder, readonly, value } = props;
|
|
13
|
+
export default function DateWidget({ disabled, registry, id, onBlur, onChange, onFocus, placeholder, readonly, value, showTime = false, }) {
|
|
15
14
|
const { formContext } = registry;
|
|
16
15
|
const { readonlyAsDisabled = true } = formContext;
|
|
17
|
-
const handleChange = (nextValue) => onChange(nextValue && nextValue.format('YYYY-MM-DD'));
|
|
16
|
+
const handleChange = (nextValue) => onChange(nextValue && (showTime ? nextValue.toISOString() : nextValue.format('YYYY-MM-DD')));
|
|
18
17
|
const handleBlur = () => onBlur(id, value);
|
|
19
18
|
const handleFocus = () => onFocus(id, value);
|
|
20
|
-
const getPopupContainer = (
|
|
21
|
-
return (_jsx(DatePicker, { disabled: disabled || (readonlyAsDisabled && readonly), getPopupContainer: getPopupContainer, id: id, name: id, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, showTime:
|
|
19
|
+
const getPopupContainer = DateWidget.getPopupContainerCallback();
|
|
20
|
+
return (_jsx(DatePicker, { disabled: disabled || (readonlyAsDisabled && readonly), getPopupContainer: getPopupContainer, id: id, name: id, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, showTime: showTime, style: DATE_PICKER_STYLE, value: value && dayjs(value), "aria-describedby": ariaDescribedByIds(id) }));
|
|
22
21
|
}
|
|
22
|
+
/** Give the playground a place to hook into the `getPopupContainer` callback generation function so that it can be
|
|
23
|
+
* disabled while in the playground. Since the callback is a simple function, it can be returned by this static
|
|
24
|
+
* "generator" function.
|
|
25
|
+
*/
|
|
26
|
+
DateWidget.getPopupContainerCallback = () => (node) => node.parentNode;
|
|
23
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/DateWidget/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/DateWidget/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,MAAM;CACd,CAAC;AAMF;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAoF,EACpH,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,GAAG,KAAK,GACS;IACzB,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC;IACjC,MAAM,EAAE,kBAAkB,GAAG,IAAI,EAAE,GAAG,WAAgC,CAAC;IAEvE,MAAM,YAAY,GAAG,CAAC,SAAc,EAAE,EAAE,CACtC,QAAQ,CAAC,SAAS,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAE/F,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAE3C,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAE7C,MAAM,iBAAiB,GAAG,UAAU,CAAC,yBAAyB,EAAE,CAAC;IAEjE,OAAO,CACL,KAAC,UAAU,IACT,QAAQ,EAAE,QAAQ,IAAI,CAAC,kBAAkB,IAAI,QAAQ,CAAC,EACtD,iBAAiB,EAAE,iBAAiB,EACpC,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,EAAE,EACR,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAC9C,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAC5C,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,iBAAiB,EACxB,KAAK,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,sBACV,kBAAkB,CAAC,EAAE,CAAC,GACxC,CACH,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,UAAU,CAAC,yBAAyB,GAAG,GAAG,EAAE,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
2
|
/** The `PasswordWidget` component uses the `BaseInputTemplate` changing the type to `password`.
|
|
3
3
|
*
|
|
4
4
|
* @param props - The `WidgetProps` for this component
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ariaDescribedByIds
|
|
2
|
+
import { ariaDescribedByIds } from '@rjsf/utils';
|
|
3
3
|
import { Input } from 'antd';
|
|
4
4
|
/** The `PasswordWidget` component uses the `BaseInputTemplate` changing the type to `password`.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/PasswordWidget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,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAC9C,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAC5C,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,IAAI,EAAE,sBACA,kBAAkB,CAAC,EAAE,CAAC,GACxC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
2
|
/** The `RadioWidget` is a widget for rendering a radio group.
|
|
3
3
|
* It is typically used with a string property constrained with enum options.
|
|
4
4
|
*
|
|
@@ -16,6 +16,6 @@ export default function RadioWidget({ autofocus, disabled, registry, id, htmlNam
|
|
|
16
16
|
const handleFocus = ({ target }) => onFocus(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue));
|
|
17
17
|
const selectValue = enumOptionSelectedValue(value, enumOptions, false, optionValueFormat, emptyValue);
|
|
18
18
|
return (_jsx(Radio.Group, { disabled: disabled || (readonlyAsDisabled && readonly), id: id, name: htmlName || id, onChange: !readonly ? handleChange : undefined, onBlur: !readonly ? handleBlur : undefined, onFocus: !readonly ? handleFocus : undefined, value: selectValue, "aria-describedby": ariaDescribedByIds(id), children: Array.isArray(enumOptions) &&
|
|
19
|
-
enumOptions.map((option, i) => (_jsx(Radio, { id: optionId(id, i), name: htmlName || id, autoFocus: i === 0 ? autofocus : false, disabled: disabled || (Array.isArray(enumDisabled) && enumDisabled.
|
|
19
|
+
enumOptions.map((option, i) => (_jsx(Radio, { id: optionId(id, i), name: htmlName || id, autoFocus: i === 0 ? autofocus : false, disabled: disabled || (Array.isArray(enumDisabled) && enumDisabled.includes(option.value)), value: enumOptionValueEncoder(option.value, i, optionValueFormat), children: option.label }, String(option.value)))) }));
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/RadioWidget/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/RadioWidget/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,QAAQ,GACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE7B;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAoF,EACrH,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,EACR,KAAK,GACgB;IACrB,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC;IACjC,MAAM,EAAE,kBAAkB,GAAG,IAAI,EAAE,GAAG,WAAgC,CAAC;IAEvE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC1D,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAExD,MAAM,YAAY,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAoB,EAAE,EAAE,CAC1E,QAAQ,CAAC,sBAAsB,CAAI,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAE7F,MAAM,UAAU,GAAG,CAAC,EAAE,MAAM,EAAgC,EAAE,EAAE,CAC9D,MAAM,CAAC,EAAE,EAAE,sBAAsB,CAAI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YAAY,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAE1F,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,iBAAiB,CAAC,YAEhE,MAAM,CAAC,KAAK,IAHR,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAInB,CACT,CAAC,GACQ,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
2
|
/** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
|
|
3
3
|
* in a div, with the value along side it.
|
|
4
4
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ariaDescribedByIds, rangeSpec
|
|
2
|
+
import { ariaDescribedByIds, rangeSpec } from '@rjsf/utils';
|
|
3
3
|
import { Slider } from 'antd';
|
|
4
4
|
/** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
|
|
5
5
|
* in a div, with the value along side it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/RangeWidget/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/RangeWidget/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,KAA2B;IAE3B,MAAM,EACJ,SAAS,EACT,QAAQ,EACR,QAAQ,E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AK,EACZ,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,KACR,UAAU,sBACI,kBAAkB,CAAC,EAAE,CAAC,GACxC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
2
|
/** The `SelectWidget` is a widget for rendering dropdowns.
|
|
3
3
|
* It is typically used with string properties constrained with enum options.
|
|
4
4
|
*
|
|
@@ -23,7 +23,7 @@ export default function SelectWidget({ autofocus, disabled, registry, id, htmlNa
|
|
|
23
23
|
const filterOption = (input, option) => {
|
|
24
24
|
if (option && isString(option.label)) {
|
|
25
25
|
// labels are strings in this context
|
|
26
|
-
return option.label.toLowerCase().
|
|
26
|
+
return option.label.toLowerCase().includes(input.toLowerCase());
|
|
27
27
|
}
|
|
28
28
|
return false;
|
|
29
29
|
};
|
|
@@ -37,22 +37,22 @@ export default function SelectWidget({ autofocus, disabled, registry, id, htmlNa
|
|
|
37
37
|
const showPlaceholderOption = !multiple && schema.default === undefined;
|
|
38
38
|
const selectOptions = useMemo(() => {
|
|
39
39
|
if (Array.isArray(enumOptions)) {
|
|
40
|
-
const
|
|
41
|
-
disabled: Array.isArray(enumDisabled) && enumDisabled.
|
|
40
|
+
const enumOptionsList = enumOptions.map(({ value: optionValue, label: optionLabel }, index) => ({
|
|
41
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.includes(optionValue),
|
|
42
42
|
key: String(index),
|
|
43
43
|
value: enumOptionValueEncoder(optionValue, index, optionValueFormat),
|
|
44
44
|
label: optionLabel,
|
|
45
45
|
}));
|
|
46
46
|
if (showPlaceholderOption) {
|
|
47
|
-
|
|
47
|
+
enumOptionsList.unshift({ value: '', label: placeholder || '' });
|
|
48
48
|
}
|
|
49
|
-
return
|
|
49
|
+
return enumOptionsList;
|
|
50
50
|
}
|
|
51
51
|
return undefined;
|
|
52
52
|
}, [enumDisabled, enumOptions, placeholder, showPlaceholderOption, optionValueFormat]);
|
|
53
53
|
return (_jsx(Select, { open: open, autoFocus: autofocus, disabled: disabled || (readonlyAsDisabled && readonly), getPopupContainer: getPopupContainer, id: id, mode: multiple ? 'multiple' : undefined, onBlur: !readonly ? handleBlur : undefined, onChange: !readonly ? handleChange : undefined, onFocus: !readonly ? handleFocus : undefined, placeholder: placeholder, style: SELECT_STYLE, value: selectValue, ...extraProps,
|
|
54
54
|
// When the open change is called, set the open state, needed so that the select opens properly in the playground
|
|
55
|
-
onOpenChange: setOpen,
|
|
55
|
+
onOpenChange: setOpen, showSearch: { filterOption }, "aria-describedby": ariaDescribedByIds(id), options: selectOptions }));
|
|
56
56
|
}
|
|
57
57
|
/** Give the playground a place to hook into the `getPopupContainer` callback generation function so that it can be
|
|
58
58
|
* disabled while in the playground. Since the callback is a simple function, it can be returned by this static
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/SelectWidget/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/SelectWidget/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,MAAM;CACd,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAIlC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L,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,IAAI,CAAC,kBAAkB,IAAI,QAAQ,CAAC,EACtD,iBAAiB,EAAE,iBAAiB,EACpC,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACvC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAC9C,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAC5C,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,WAAW,KACd,UAAU;QACd,iHAAiH;QACjH,YAAY,EAAE,OAAO,EACrB,UAAU,EAAE,EAAE,YAAY,EAAE,sBACV,kBAAkB,CAAC,EAAE,CAAC,EACxC,OAAO,EAAE,aAAa,GACtB,CACH,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,YAAY,CAAC,yBAAyB,GAAG,GAAG,EAAE,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
2
|
/** The `TextareaWidget` is a widget for rendering input fields as textarea.
|
|
3
3
|
*
|
|
4
4
|
* @param props - The `WidgetProps` for this component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/TextareaWidget/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.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IAAI,EAAE,EACpB,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAC9C,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAC5C,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,EACvB,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,KAAK,KACR,UAAU,sBACI,kBAAkB,CAAC,EAAE,CAAC,GACxC,CACH,CAAC;AACJ,CAAC"}
|
package/lib/widgets/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
1
|
+
import type { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
2
|
export declare function generateWidgets<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): RegistryWidgetsType<T, S, F>;
|
|
3
3
|
declare const _default: RegistryWidgetsType<any, RJSFSchema, any>;
|
|
4
4
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rjsf/antd",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.2",
|
|
4
4
|
"description": "Ant Design theme, fields and widgets for react-jsonschema-form",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"lint": "oxlint src test",
|
|
46
46
|
"precommit": "lint-staged",
|
|
47
47
|
"test": "vitest run",
|
|
48
|
-
"test:update": "vitest run --update
|
|
48
|
+
"test:update": "vitest run --update"
|
|
49
49
|
},
|
|
50
50
|
"lint-staged": {
|
|
51
51
|
"{src,test}/**/*.{ts,tsx}": [
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@ant-design/icons": "^6.0.0",
|
|
67
|
-
"@rjsf/core": "^6.
|
|
68
|
-
"@rjsf/utils": "^6.
|
|
67
|
+
"@rjsf/core": "^6.6.x",
|
|
68
|
+
"@rjsf/utils": "^6.6.x",
|
|
69
69
|
"antd": "^5 || >6.3.5",
|
|
70
70
|
"dayjs": "^1.8.0",
|
|
71
71
|
"react": ">=18"
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"rc-picker": "^4.11.3"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@ant-design/icons": "^6.2.
|
|
81
|
-
"@rjsf/core": "6.6.
|
|
82
|
-
"@rjsf/snapshot-tests": "6.6.
|
|
83
|
-
"@rjsf/utils": "6.6.
|
|
84
|
-
"@rjsf/validator-ajv8": "6.6.
|
|
80
|
+
"@ant-design/icons": "^6.2.5",
|
|
81
|
+
"@rjsf/core": "6.6.2",
|
|
82
|
+
"@rjsf/snapshot-tests": "6.6.2",
|
|
83
|
+
"@rjsf/utils": "6.6.2",
|
|
84
|
+
"@rjsf/validator-ajv8": "6.6.2",
|
|
85
85
|
"@rollup/plugin-replace": "^6.0.3",
|
|
86
86
|
"antd": "^6.4.3",
|
|
87
87
|
"atob": "^2.1.2",
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { FormProps, ThemeProps
|
|
3
|
-
import {
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { FormProps, ThemeProps } from '@rjsf/core';
|
|
3
|
+
import { withTheme } from '@rjsf/core';
|
|
4
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
4
5
|
|
|
5
6
|
import Templates, { generateTemplates } from './templates';
|
|
6
7
|
import Widgets, { generateWidgets } from './widgets';
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
FormContextType,
|
|
4
|
-
getUiOptions,
|
|
5
|
-
getTemplate,
|
|
6
|
-
RJSFSchema,
|
|
7
|
-
StrictRJSFSchema,
|
|
8
|
-
} from '@rjsf/utils';
|
|
1
|
+
import type { ArrayFieldItemTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import { getUiOptions, getTemplate } from '@rjsf/utils';
|
|
9
3
|
import { Col, Row, Space } from 'antd';
|
|
10
4
|
|
|
11
5
|
const BTN_GRP_STYLE = {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
getTemplate,
|
|
4
|
-
getUiOptions,
|
|
2
|
+
import type {
|
|
5
3
|
ArrayFieldTemplateProps,
|
|
6
4
|
FormContextType,
|
|
7
5
|
GenericObjectType,
|
|
8
6
|
RJSFSchema,
|
|
9
7
|
StrictRJSFSchema,
|
|
10
|
-
buttonId,
|
|
11
8
|
} from '@rjsf/utils';
|
|
9
|
+
import { getTemplate, getUiOptions, buttonId } from '@rjsf/utils';
|
|
12
10
|
import { Col, Row, ConfigProvider } from 'antd';
|
|
13
11
|
import classNames from 'classnames';
|
|
14
12
|
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { ChangeEvent, FocusEvent, MouseEvent
|
|
1
|
+
import type { ChangeEvent, FocusEvent, MouseEvent } from 'react';
|
|
2
|
+
import { useCallback } from 'react';
|
|
2
3
|
import { SchemaExamples } from '@rjsf/core';
|
|
3
|
-
import {
|
|
4
|
-
ariaDescribedByIds,
|
|
4
|
+
import type {
|
|
5
5
|
BaseInputTemplateProps,
|
|
6
|
-
examplesId,
|
|
7
|
-
getInputProps,
|
|
8
6
|
FormContextType,
|
|
9
7
|
GenericObjectType,
|
|
10
8
|
RJSFSchema,
|
|
11
9
|
StrictRJSFSchema,
|
|
12
10
|
} from '@rjsf/utils';
|
|
11
|
+
import { ariaDescribedByIds, examplesId, getInputProps } from '@rjsf/utils';
|
|
13
12
|
import { Input, InputNumber } from 'antd';
|
|
14
13
|
|
|
15
14
|
const INPUT_STYLE = {
|
|
@@ -53,9 +52,9 @@ export default function BaseInputTemplate<
|
|
|
53
52
|
|
|
54
53
|
const handleNumberChange = (nextValue: number | null) => onChange(nextValue);
|
|
55
54
|
|
|
56
|
-
const handleTextChange =
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
const handleTextChange =
|
|
56
|
+
onChangeOverride ||
|
|
57
|
+
(({ target }: ChangeEvent<HTMLInputElement>) => onChange(target.value === '' ? options.emptyValue : target.value));
|
|
59
58
|
|
|
60
59
|
const handleBlur = ({ target }: FocusEvent<HTMLInputElement>) => onBlur(id, target && target.value);
|
|
61
60
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
2
|
+
import type { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
import { TranslatableString } from '@rjsf/utils';
|
|
1
4
|
import { Alert, Space, theme, version } from 'antd';
|
|
2
5
|
|
|
3
6
|
const antdMajor = parseInt(version.split('.')[0], 10);
|
|
4
|
-
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
5
|
-
import { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
|
|
6
7
|
|
|
7
8
|
/** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
|
|
8
9
|
*
|
|
@@ -21,6 +22,7 @@ export default function ErrorList<T = any, S extends StrictRJSFSchema = RJSFSche
|
|
|
21
22
|
<ul style={{ margin: 0, padding: 0, listStyle: 'none' }}>
|
|
22
23
|
{errors.map((error, index) => (
|
|
23
24
|
<li
|
|
25
|
+
// oxlint-disable-next-line react/no-array-index-key
|
|
24
26
|
key={index}
|
|
25
27
|
style={{
|
|
26
28
|
display: 'flex',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RichDescription } from '@rjsf/core';
|
|
2
|
-
import { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import type { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
3
|
|
|
4
4
|
/** The `DescriptionField` is the template to use to render the description of a field
|
|
5
5
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema
|
|
1
|
+
import type { FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import { errorId } from '@rjsf/utils';
|
|
2
3
|
|
|
3
4
|
/** The `FieldErrorTemplate` component renders the errors local to the particular field
|
|
4
5
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RichHelp } from '@rjsf/core';
|
|
2
|
-
import {
|
|
2
|
+
import type { FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
3
|
+
import { helpId } from '@rjsf/utils';
|
|
3
4
|
|
|
4
5
|
/** The `FieldHelpTemplate` component renders any help desired for a field
|
|
5
6
|
*
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
FormContextType,
|
|
4
|
-
RJSFSchema,
|
|
5
|
-
StrictRJSFSchema,
|
|
6
|
-
getTemplate,
|
|
7
|
-
getUiOptions,
|
|
8
|
-
GenericObjectType,
|
|
9
|
-
} from '@rjsf/utils';
|
|
1
|
+
import type { FieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema, GenericObjectType } from '@rjsf/utils';
|
|
2
|
+
import { getTemplate, getUiOptions } from '@rjsf/utils';
|
|
10
3
|
import { Form } from 'antd';
|
|
11
4
|
|
|
12
5
|
const VERTICAL_LABEL_COL = { span: 24 };
|