@gisce/react-ooui 1.1.39 → 1.1.40-rc.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Reference.d.ts","sourceRoot":"","sources":["Reference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EACL,SAAS,IAAI,aAAa,EAG3B,MAAM,aAAa,CAAC;AAKrB,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,aAAa,CAAC;IACpB,iBAAiB,CAAC,EACd,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC,GAC5D,SAAS,CAAC;IACd,aAAa,CAAC,EACV,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC,GAC5D,SAAS,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,KAAK,gBASrC,CAAC;AAEF,UAAU,mBAAmB;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAkExD,CAAC"}
1
+ {"version":3,"file":"Reference.d.ts","sourceRoot":"","sources":["Reference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EACL,SAAS,IAAI,aAAa,EAG3B,MAAM,aAAa,CAAC;AAKrB,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,aAAa,CAAC;IACpB,iBAAiB,CAAC,EACd,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC,GAC5D,SAAS,CAAC;IACd,aAAa,CAAC,EACV,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC,GAC5D,SAAS,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,KAAK,gBASrC,CAAC;AAEF,UAAU,mBAAmB;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0ExD,CAAC"}
@@ -3,10 +3,13 @@ declare const DefaultGraphOptions: {
3
3
  padding: string;
4
4
  xAxis: {
5
5
  tickCount: number;
6
+ label: {
7
+ formatter: (value: any) => any;
8
+ };
6
9
  };
7
10
  yAxis: {
8
11
  label: {
9
- formatter: (value: number) => string;
12
+ formatter: (value: any) => any;
10
13
  };
11
14
  };
12
15
  legend: {
@@ -58,9 +61,14 @@ declare const DefaultGraphOptions: {
58
61
  value: any;
59
62
  };
60
63
  };
64
+ xAxis: {
65
+ label: {
66
+ formatter: (value: any) => any;
67
+ };
68
+ };
61
69
  yAxis: {
62
70
  label: {
63
- formatter: (value: number) => string;
71
+ formatter: (value: any) => any;
64
72
  };
65
73
  };
66
74
  label: {
@@ -1 +1 @@
1
- {"version":3,"file":"GraphDefaults.d.ts","sourceRoot":"","sources":["GraphDefaults.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,mBAAmB;;;;;;;;mCAQE,MAAM;;;;;;;;gCAjBf,GAAG;;;;;;;;;;;;mCAsCQ,GAAG;;;;;;;;;;;gCAtCd,GAAG;;;;;;;;;;;;;;;;gCAAH,GAAG;;;;;;;mCAoEM,MAAM;;;;;;;;;;CAsBhC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"GraphDefaults.d.ts","sourceRoot":"","sources":["GraphDefaults.ts"],"names":[],"mappings":"AAiCA,QAAA,MAAM,mBAAmB;;;;;;mCAvBK,GAAG;;;;;mCAAH,GAAG;;;;;;;;gCATf,GAAG;;;;;;;;;;;;mCA4DQ,GAAG;;;;;;;;;;;gCA5Dd,GAAG;;;;;;;;;;;;;;;;gCAAH,GAAG;;;;;;;mCASS,GAAG;;;;;mCAAH,GAAG;;;;;;;;;;CAwGhC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "1.1.39",
3
+ "version": "1.1.40-rc.1",
4
4
  "files": [
5
5
  "dist",
6
6
  "src",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@ant-design/plots": "^1.0.9",
39
- "@gisce/ooui": "^0.18.0",
39
+ "@gisce/ooui": "^0.17.14-rc.1",
40
40
  "@gisce/react-formiga-table": "^0.5.0",
41
41
  "@monaco-editor/react": "^4.4.5",
42
42
  "@tabler/icons-react": "^2.11.0",
@@ -73,8 +73,16 @@ export const ReferenceInput: React.FC<ReferenceInputProps> = (
73
73
  }
74
74
  onChange={(changedValue: string) => {
75
75
  setSelectionValue(changedValue);
76
- setMany2oneValue([]);
77
- onChange?.(undefined);
76
+ let m2oValue = many2oneValue[0] || 0;
77
+ if (changedValue !== selectionValue) {
78
+ setMany2oneValue([]);
79
+ m2oValue = 0;
80
+ }
81
+ const referenceValue = `${changedValue},${m2oValue}`;
82
+ if (referenceValue === value) {
83
+ return;
84
+ }
85
+ onChange?.(referenceValue);
78
86
  }}
79
87
  value={selectionValue}
80
88
  />
@@ -92,7 +100,7 @@ export const ReferenceInput: React.FC<ReferenceInputProps> = (
92
100
  value={many2oneValue}
93
101
  onChange={(changedValue: any[]) => {
94
102
  setMany2oneValue(changedValue);
95
- const referenceValue = `${selectionValue},${changedValue[0]}`;
103
+ const referenceValue = `${selectionValue},${changedValue[0] || 0}`;
96
104
  if (referenceValue === value) {
97
105
  return;
98
106
  }
@@ -8,19 +8,41 @@ const formatter = (graphType: "pie" | "default" | "barGrouped") => {
8
8
  };
9
9
  };
10
10
 
11
+ const axisFormatter = (value: any) => {
12
+ if (typeof value === "string" && stringIsValidNumeric(value)) {
13
+ return parseFloat(value).toLocaleString("es-ES", {
14
+ useGrouping: true,
15
+ });
16
+ } else if (isNumber(value)) {
17
+ return value.toLocaleString("es-ES", {
18
+ useGrouping: true,
19
+ });
20
+ } else {
21
+ return value;
22
+ }
23
+ };
24
+
25
+ const stringIsValidNumeric = (value: string) => {
26
+ const regex = /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/;
27
+ return regex.test(value);
28
+ };
29
+
30
+ const isNumber = (value: any) => {
31
+ return typeof value === "number" && !isNaN(value);
32
+ };
33
+
11
34
  const DefaultGraphOptions = {
12
35
  default: {
13
36
  padding: "auto",
14
37
  xAxis: {
15
38
  tickCount: 5,
39
+ label: {
40
+ formatter: axisFormatter,
41
+ },
16
42
  },
17
43
  yAxis: {
18
44
  label: {
19
- formatter: (value: number) => {
20
- return value.toLocaleString("es-ES", {
21
- useGrouping: true,
22
- });
23
- },
45
+ formatter: axisFormatter,
24
46
  },
25
47
  },
26
48
  legend: {
@@ -65,13 +87,14 @@ const DefaultGraphOptions = {
65
87
  tooltip: {
66
88
  formatter: formatter("barGrouped"),
67
89
  },
90
+ xAxis: {
91
+ label: {
92
+ formatter: axisFormatter,
93
+ },
94
+ },
68
95
  yAxis: {
69
96
  label: {
70
- formatter: (value: number) => {
71
- return value.toLocaleString("es-ES", {
72
- useGrouping: true,
73
- });
74
- },
97
+ formatter: axisFormatter,
75
98
  },
76
99
  },
77
100
  label: {