@gisce/react-ooui 1.1.20-rc.0 → 1.1.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.1.20-rc.0",
3
+ "version": "1.1.21",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -1,4 +1,5 @@
1
1
  import { One2manyItem } from "@/widgets/base/one2many/One2manyInput";
2
+ import { Form as FormOoui } from "@gisce/ooui";
2
3
 
3
4
  const filteredValues = (values: any, fields: any) => {
4
5
  if (!fields) {
@@ -100,15 +101,16 @@ export const getTouchedValues = ({
100
101
 
101
102
  export const checkFieldsType = ({
102
103
  changedFields,
103
- fields,
104
+ formOoui,
104
105
  types,
105
106
  }: {
106
107
  changedFields: string[];
107
- fields: any;
108
+ formOoui: FormOoui;
108
109
  types: string[];
109
110
  }) => {
110
111
  const valuesChecked = changedFields.map((key) => {
111
- return types.includes(fields[key]?.type);
112
+ const fieldType = formOoui?.findById(key)?.type!;
113
+ return types.includes(fieldType);
112
114
  });
113
115
  return valuesChecked.some((i) => i === true);
114
116
  };
@@ -699,7 +699,7 @@ function Form(props: FormProps, ref: any) {
699
699
  if (
700
700
  checkFieldsType({
701
701
  changedFields,
702
- fields,
702
+ formOoui: formOoui!,
703
703
  types: [
704
704
  "text",
705
705
  "codeeditor",