@bsol-oss/react-datatable5 11.0.0-beta.9 → 12.0.0-beta.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 +8 -5
- package/dist/index.mjs +8 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4338,12 +4338,15 @@ react.NumberInput.Scrubber;
|
|
|
4338
4338
|
react.NumberInput.Label;
|
|
4339
4339
|
|
|
4340
4340
|
const NumberInputField = ({ schema, column, prefix, }) => {
|
|
4341
|
-
const {
|
|
4341
|
+
const { setValue, formState: { errors }, watch, } = reactHookForm.useFormContext();
|
|
4342
4342
|
const { translate } = useSchemaContext();
|
|
4343
4343
|
const { required, gridColumn, gridRow } = schema;
|
|
4344
4344
|
const isRequired = required?.some((columnId) => columnId === column);
|
|
4345
4345
|
const colLabel = `${prefix}${column}`;
|
|
4346
|
-
|
|
4346
|
+
const value = watch(`${colLabel}`);
|
|
4347
|
+
return (jsxRuntime.jsxs(Field, { label: `${translate.t(removeIndex(`${colLabel}.fieldLabel`))}`, required: isRequired, gridColumn, gridRow, children: [jsxRuntime.jsx(NumberInputRoot, { children: jsxRuntime.jsx(NumberInputField$1, { required: isRequired, value: value, onChange: (event) => {
|
|
4348
|
+
setValue(`${colLabel}`, Number(event.target.value));
|
|
4349
|
+
} }) }), errors[`${column}`] && (jsxRuntime.jsx(react.Text, { color: "red.400", children: translate.t(removeIndex(`${colLabel}.fieldRequired`)) }))] }));
|
|
4347
4350
|
};
|
|
4348
4351
|
|
|
4349
4352
|
const ObjectInput = ({ schema, column, prefix }) => {
|
|
@@ -5046,9 +5049,9 @@ const FormInternal = () => {
|
|
|
5046
5049
|
}, formNoValidate: true, children: translate.t("submit") })] })] }) }));
|
|
5047
5050
|
};
|
|
5048
5051
|
const Form = ({ schema, idMap, setIdMap, form, serverUrl, translate, order = [], ignore = [], include = [], onSubmit = undefined, rowNumber = undefined, requestOptions = {}, }) => {
|
|
5049
|
-
const { properties } = schema;
|
|
5050
|
-
idListSanityCheck("order", order, properties);
|
|
5051
|
-
idListSanityCheck("ignore", ignore, properties);
|
|
5052
|
+
// const { properties } = schema;
|
|
5053
|
+
// idListSanityCheck("order", order, properties as object);
|
|
5054
|
+
// idListSanityCheck("ignore", ignore, properties as object);
|
|
5052
5055
|
return (jsxRuntime.jsx(SchemaFormContext.Provider, { value: {
|
|
5053
5056
|
schema,
|
|
5054
5057
|
serverUrl,
|
package/dist/index.mjs
CHANGED
|
@@ -4318,12 +4318,15 @@ NumberInput.Scrubber;
|
|
|
4318
4318
|
NumberInput.Label;
|
|
4319
4319
|
|
|
4320
4320
|
const NumberInputField = ({ schema, column, prefix, }) => {
|
|
4321
|
-
const {
|
|
4321
|
+
const { setValue, formState: { errors }, watch, } = useFormContext();
|
|
4322
4322
|
const { translate } = useSchemaContext();
|
|
4323
4323
|
const { required, gridColumn, gridRow } = schema;
|
|
4324
4324
|
const isRequired = required?.some((columnId) => columnId === column);
|
|
4325
4325
|
const colLabel = `${prefix}${column}`;
|
|
4326
|
-
|
|
4326
|
+
const value = watch(`${colLabel}`);
|
|
4327
|
+
return (jsxs(Field, { label: `${translate.t(removeIndex(`${colLabel}.fieldLabel`))}`, required: isRequired, gridColumn, gridRow, children: [jsx(NumberInputRoot, { children: jsx(NumberInputField$1, { required: isRequired, value: value, onChange: (event) => {
|
|
4328
|
+
setValue(`${colLabel}`, Number(event.target.value));
|
|
4329
|
+
} }) }), errors[`${column}`] && (jsx(Text, { color: "red.400", children: translate.t(removeIndex(`${colLabel}.fieldRequired`)) }))] }));
|
|
4327
4330
|
};
|
|
4328
4331
|
|
|
4329
4332
|
const ObjectInput = ({ schema, column, prefix }) => {
|
|
@@ -5026,9 +5029,9 @@ const FormInternal = () => {
|
|
|
5026
5029
|
}, formNoValidate: true, children: translate.t("submit") })] })] }) }));
|
|
5027
5030
|
};
|
|
5028
5031
|
const Form = ({ schema, idMap, setIdMap, form, serverUrl, translate, order = [], ignore = [], include = [], onSubmit = undefined, rowNumber = undefined, requestOptions = {}, }) => {
|
|
5029
|
-
const { properties } = schema;
|
|
5030
|
-
idListSanityCheck("order", order, properties);
|
|
5031
|
-
idListSanityCheck("ignore", ignore, properties);
|
|
5032
|
+
// const { properties } = schema;
|
|
5033
|
+
// idListSanityCheck("order", order, properties as object);
|
|
5034
|
+
// idListSanityCheck("ignore", ignore, properties as object);
|
|
5032
5035
|
return (jsx(SchemaFormContext.Provider, { value: {
|
|
5033
5036
|
schema,
|
|
5034
5037
|
serverUrl,
|