@gisce/react-ooui 1.2.0-rc.26 → 1.2.0-rc.28
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/helpers/formHelper.d.ts +3 -2
- package/dist/helpers/formHelper.d.ts.map +1 -1
- package/dist/locales/ca_ES.d.ts +1 -0
- package/dist/locales/ca_ES.d.ts.map +1 -1
- package/dist/locales/en_US.d.ts +1 -0
- package/dist/locales/en_US.d.ts.map +1 -1
- package/dist/locales/es_ES.d.ts +1 -0
- package/dist/locales/es_ES.d.ts.map +1 -1
- package/dist/react-ooui.es.js +2496 -2491
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +17 -17
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/widgets/views/Form.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/helpers/formHelper.ts +5 -3
- package/src/locales/ca_ES.tsx +1 -0
- package/src/locales/en_US.tsx +1 -0
- package/src/locales/es_ES.tsx +1 -0
- package/src/widgets/views/Form.tsx +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["Form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["Form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAkCf,OAAO,EAAE,QAAQ,EAAgB,MAAM,SAAS,CAAC;AAiBjD,oBAAY,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACxE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;;AAg+BF,wBAAgC"}
|
package/package.json
CHANGED
|
@@ -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
|
-
|
|
104
|
+
formOoui,
|
|
104
105
|
types,
|
|
105
106
|
}: {
|
|
106
107
|
changedFields: string[];
|
|
107
|
-
|
|
108
|
+
formOoui: FormOoui;
|
|
108
109
|
types: string[];
|
|
109
110
|
}) => {
|
|
110
111
|
const valuesChecked = changedFields.map((key) => {
|
|
111
|
-
|
|
112
|
+
const fieldType = formOoui?.findById(key)?.type!;
|
|
113
|
+
return types.includes(fieldType);
|
|
112
114
|
});
|
|
113
115
|
return valuesChecked.some((i) => i === true);
|
|
114
116
|
};
|
package/src/locales/ca_ES.tsx
CHANGED
package/src/locales/en_US.tsx
CHANGED
package/src/locales/es_ES.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
Row,
|
|
16
16
|
Alert,
|
|
17
17
|
Spin,
|
|
18
|
+
message,
|
|
18
19
|
} from "antd";
|
|
19
20
|
import Measure from "react-measure";
|
|
20
21
|
import { CheckOutlined, CloseOutlined } from "@ant-design/icons";
|
|
@@ -105,7 +106,7 @@ function Form(props: FormProps, ref: any) {
|
|
|
105
106
|
defaultValues,
|
|
106
107
|
forcedValues = {},
|
|
107
108
|
} = props;
|
|
108
|
-
const { lang } = useContext(LocaleContext) as LocaleContextType;
|
|
109
|
+
const { t, lang } = useContext(LocaleContext) as LocaleContextType;
|
|
109
110
|
|
|
110
111
|
const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
|
|
111
112
|
const [error, setError] = useState<string>();
|
|
@@ -343,6 +344,7 @@ function Form(props: FormProps, ref: any) {
|
|
|
343
344
|
await antForm.validateFields();
|
|
344
345
|
return false;
|
|
345
346
|
} catch (verror) {
|
|
347
|
+
message.error(t("fillRequiredFields"));
|
|
346
348
|
return true;
|
|
347
349
|
}
|
|
348
350
|
}
|
|
@@ -637,6 +639,7 @@ function Form(props: FormProps, ref: any) {
|
|
|
637
639
|
setIsSubmitting(false);
|
|
638
640
|
setFormIsSaving?.(false);
|
|
639
641
|
onSubmitError?.(err);
|
|
642
|
+
message.error(t("errorWhileSavingForm"));
|
|
640
643
|
setError(err?.message ? err.message : err);
|
|
641
644
|
} finally {
|
|
642
645
|
formSubmitting.current = false;
|
|
@@ -692,7 +695,7 @@ function Form(props: FormProps, ref: any) {
|
|
|
692
695
|
if (
|
|
693
696
|
checkFieldsType({
|
|
694
697
|
changedFields,
|
|
695
|
-
|
|
698
|
+
formOoui: formOoui!,
|
|
696
699
|
types: [
|
|
697
700
|
"text",
|
|
698
701
|
"codeeditor",
|