@gisce/react-ooui 2.0.0-alpha.54 → 2.0.0-alpha.56

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.
Files changed (30) hide show
  1. package/dist/helpers/treeHelper.d.ts.map +1 -1
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/react-ooui.es.js +3248 -3144
  5. package/dist/react-ooui.es.js.map +1 -1
  6. package/dist/ui/TitleHeader.d.ts.map +1 -1
  7. package/dist/widgets/base/one2many/One2manyInput.d.ts.map +1 -1
  8. package/dist/widgets/modals/SearchModal.d.ts.map +1 -1
  9. package/dist/widgets/views/Dashboard/DashboardTree.d.ts.map +1 -1
  10. package/dist/widgets/views/SearchTree.d.ts.map +1 -1
  11. package/dist/widgets/views/{Tree.d.ts → Tree/Tree.d.ts} +6 -5
  12. package/dist/widgets/views/Tree/Tree.d.ts.map +1 -0
  13. package/dist/widgets/views/Tree/index.d.ts +2 -0
  14. package/dist/widgets/views/Tree/index.d.ts.map +1 -0
  15. package/dist/widgets/views/Tree/treeComponents.d.ts +131 -0
  16. package/dist/widgets/views/Tree/treeComponents.d.ts.map +1 -0
  17. package/package.json +2 -2
  18. package/src/helpers/{treeHelper.ts → treeHelper.tsx} +25 -4
  19. package/src/index.ts +1 -1
  20. package/src/ui/TitleHeader.tsx +10 -1
  21. package/src/widgets/base/one2many/One2manyInput.tsx +5 -4
  22. package/src/widgets/modals/SearchModal.tsx +2 -4
  23. package/src/widgets/views/Dashboard/DashboardTree.tsx +3 -1
  24. package/src/widgets/views/Graph/GraphDefaults.ts +1 -1
  25. package/src/widgets/views/SearchTree.tsx +21 -11
  26. package/src/widgets/views/Tree/Tree.tsx +295 -0
  27. package/src/widgets/views/Tree/index.ts +1 -0
  28. package/src/widgets/views/Tree/treeComponents.tsx +276 -0
  29. package/dist/widgets/views/Tree.d.ts.map +0 -1
  30. package/src/widgets/views/Tree.tsx +0 -450
@@ -1 +1 @@
1
- {"version":3,"file":"TitleHeader.d.ts","sourceRoot":"","sources":["../../src/ui/TitleHeader.tsx"],"names":[],"mappings":"AAaA,KAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAEF,iBAAS,WAAW,CAAC,KAAK,EAAE,KAAK,2CAyFhC;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"TitleHeader.d.ts","sourceRoot":"","sources":["../../src/ui/TitleHeader.tsx"],"names":[],"mappings":"AAaA,KAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAEF,iBAAS,WAAW,CAAC,KAAK,EAAE,KAAK,2CAkGhC;AAED,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"One2manyInput.d.ts","sourceRoot":"","sources":["../../../../src/widgets/base/one2many/One2manyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EACL,QAAQ,IAAI,YAAY,EAKzB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,KAAK,EAAY,MAAM,SAAS,CAAC;AAkB1C,KAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB,CAAC;AAQF,KAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EACN,UAAU,GACV,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,UAAU,kBAAkB;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,KAAK,CAAC;CACd;AAWD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqoB/C,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"One2manyInput.d.ts","sourceRoot":"","sources":["../../../../src/widgets/base/one2many/One2manyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EACL,QAAQ,IAAI,YAAY,EAKzB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,KAAK,EAAY,MAAM,SAAS,CAAC;AAkB1C,KAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB,CAAC;AAQF,KAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EACN,UAAU,GACV,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,UAAU,kBAAkB;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,KAAK,CAAC;CACd;AAWD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAsoB/C,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchModal.d.ts","sourceRoot":"","sources":["../../../src/widgets/modals/SearchModal.tsx"],"names":[],"mappings":"AAYA,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC3C,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,oBAAoB,4CA6GtD,CAAC"}
1
+ {"version":3,"file":"SearchModal.d.ts","sourceRoot":"","sources":["../../../src/widgets/modals/SearchModal.tsx"],"names":[],"mappings":"AAYA,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC3C,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,oBAAoB,4CA2GtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardTree.d.ts","sourceRoot":"","sources":["../../../../src/widgets/views/Dashboard/DashboardTree.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQnD,KAAK,gBAAgB,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/C,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,iBAAS,aAAa,CAAC,KAAK,EAAE,KAAK,kDA6MlC;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"DashboardTree.d.ts","sourceRoot":"","sources":["../../../../src/widgets/views/Dashboard/DashboardTree.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQnD,KAAK,gBAAgB,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/C,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,iBAAS,aAAa,CAAC,KAAK,EAAE,KAAK,kDA+MlC;AAED,eAAe,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchTree.d.ts","sourceRoot":"","sources":["../../../src/widgets/views/SearchTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgBnD,KAAK,gBAAgB,GAAG;IACtB,EAAE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,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,uBAAuB,CAAC,EAAE,CAAC,eAAe,EAAE,GAAG,KAAK,IAAI,CAAC;CAC1D,CAAC;;AA6TF,wBAAsC"}
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { TreeView } from '../../*/types';
1
+ /// <reference types="react" />
2
+ import { TreeView } from '../../../*/types';
3
3
  type Props = {
4
4
  total?: number;
5
5
  limit: number;
@@ -10,7 +10,8 @@ type Props = {
10
10
  showPagination?: boolean;
11
11
  onRequestPageChange?: (page: number, pageSize?: number) => void;
12
12
  onRowClicked?: (record: any) => void;
13
- rowSelection?: any;
13
+ onRowSelectionChange?: (selectedRowKeys: any[]) => void;
14
+ selectedRowKeys?: number[];
14
15
  scrollY?: number;
15
16
  colorsForResults?: {
16
17
  [key: number]: string;
@@ -27,6 +28,6 @@ type Props = {
27
28
  readonly?: boolean;
28
29
  onSelectAllRecords?: () => Promise<void>;
29
30
  };
30
- declare function Tree(props: Props): React.ReactElement;
31
- export default Tree;
31
+ export declare const Tree: import("react").MemoExoticComponent<(props: Props) => import("react/jsx-runtime").JSX.Element>;
32
+ export {};
32
33
  //# sourceMappingURL=Tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../src/widgets/views/Tree/Tree.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAiBnC,KAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAChE,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACxD,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC7C,gBAAgB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC7C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACtC,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,wBAAwB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C,CAAC;AACF,eAAO,MAAM,IAAI,8CAAgB,KAAK,6CAkPpC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./Tree";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/widgets/views/Tree/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,131 @@
1
+ import { ReactElement } from "react";
2
+ import { One2manyValue } from "../../base/one2many/One2manyInput";
3
+ export declare const BooleanComponent: ({ value, }: {
4
+ value: boolean;
5
+ }) => ReactElement;
6
+ export declare const Many2OneComponent: ({ value }: {
7
+ value: any;
8
+ }) => ReactElement;
9
+ export declare const TextComponent: ({ value }: {
10
+ value: any;
11
+ }) => ReactElement;
12
+ export declare const DateComponent: ({ value }: {
13
+ value: any;
14
+ }) => ReactElement;
15
+ export declare const DateTimeComponent: ({ value }: {
16
+ value: any;
17
+ }) => ReactElement;
18
+ export declare const One2ManyComponent: ({ value, }: {
19
+ value: One2manyValue;
20
+ }) => ReactElement;
21
+ export declare const ProgressBarComponent: ({ value, }: {
22
+ value: any;
23
+ }) => ReactElement;
24
+ export declare const FloatTimeComponent: ({ value }: {
25
+ value: any;
26
+ }) => ReactElement;
27
+ export declare const NumberComponent: ({ value }: {
28
+ value: number;
29
+ }) => ReactElement;
30
+ export declare const ImageComponent: ({ value }: {
31
+ value: string;
32
+ }) => ReactElement;
33
+ export declare const TagComponent: ({ value, key, ooui, context, }: {
34
+ value: any;
35
+ key: string;
36
+ ooui: any;
37
+ context: any;
38
+ }) => ReactElement;
39
+ export declare const SelectionComponent: ({ value, key, ooui, context, }: {
40
+ value: any;
41
+ key: string;
42
+ ooui: any;
43
+ context: any;
44
+ }) => ReactElement;
45
+ export declare const ReferenceComponent: ({ value, key, ooui, context, }: {
46
+ value: any;
47
+ key: string;
48
+ ooui: any;
49
+ context: any;
50
+ }) => ReactElement;
51
+ export declare const AvatarComponent: ({ value, key, ooui, context, }: {
52
+ value: any;
53
+ key: string;
54
+ ooui: any;
55
+ context: any;
56
+ }) => ReactElement;
57
+ export declare const TagsComponent: ({ value, key, ooui, context, }: {
58
+ value: any;
59
+ key: string;
60
+ ooui: any;
61
+ context: any;
62
+ }) => ReactElement;
63
+ export declare const COLUMN_COMPONENTS: {
64
+ boolean: ({ value, }: {
65
+ value: boolean;
66
+ }) => ReactElement;
67
+ many2one: ({ value }: {
68
+ value: any;
69
+ }) => ReactElement;
70
+ text: ({ value }: {
71
+ value: any;
72
+ }) => ReactElement;
73
+ one2many: ({ value, }: {
74
+ value: One2manyValue;
75
+ }) => ReactElement;
76
+ many2many: ({ value, }: {
77
+ value: One2manyValue;
78
+ }) => ReactElement;
79
+ progressbar: ({ value, }: {
80
+ value: any;
81
+ }) => ReactElement;
82
+ float_time: ({ value }: {
83
+ value: any;
84
+ }) => ReactElement;
85
+ image: ({ value }: {
86
+ value: string;
87
+ }) => ReactElement;
88
+ integer: ({ value }: {
89
+ value: number;
90
+ }) => ReactElement;
91
+ float: ({ value }: {
92
+ value: number;
93
+ }) => ReactElement;
94
+ reference: ({ value, key, ooui, context, }: {
95
+ value: any;
96
+ key: string;
97
+ ooui: any;
98
+ context: any;
99
+ }) => ReactElement;
100
+ tag: ({ value, key, ooui, context, }: {
101
+ value: any;
102
+ key: string;
103
+ ooui: any;
104
+ context: any;
105
+ }) => ReactElement;
106
+ selection: ({ value, key, ooui, context, }: {
107
+ value: any;
108
+ key: string;
109
+ ooui: any;
110
+ context: any;
111
+ }) => ReactElement;
112
+ date: ({ value }: {
113
+ value: any;
114
+ }) => ReactElement;
115
+ datetime: ({ value }: {
116
+ value: any;
117
+ }) => ReactElement;
118
+ avatar: ({ value, key, ooui, context, }: {
119
+ value: any;
120
+ key: string;
121
+ ooui: any;
122
+ context: any;
123
+ }) => ReactElement;
124
+ tags: ({ value, key, ooui, context, }: {
125
+ value: any;
126
+ key: string;
127
+ ooui: any;
128
+ context: any;
129
+ }) => ReactElement;
130
+ };
131
+ //# sourceMappingURL=treeComponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeComponents.d.ts","sourceRoot":"","sources":["../../../../src/widgets/views/Tree/treeComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA6C,MAAM,OAAO,CAAC;AAIhF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAWlE,e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AAK,YAAY;;eAPtB,MAAM;UAAK,YAAY;;eAAvB,MAAM;UAAK,YAAY;;eAqDlE,GAAG;aACL,MAAM;cACL,GAAG;iBACA,GAAG;UACV,YAAY;;eAhCP,GAAG;aACL,MAAM;cACL,GAAG;iBACA,GAAG;UACV,YAAY;;eAUP,GAAG;aACL,MAAM;cACL,GAAG;iBACA,GAAG;UACV,YAAY;;eAzFkC,GAAG;UAAK,YAAY;;eAYhB,GAAG;UAAK,YAAY;;eA8GjE,GAAG;aACL,MAAM;cACL,GAAG;iBACA,GAAG;UACV,YAAY;;eAUP,GAAG;aACL,MAAM;cACL,GAAG;iBACA,GAAG;UACV,YAAY;CAoFf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/react-ooui",
3
- "version": "2.0.0-alpha.54",
3
+ "version": "2.0.0-alpha.56",
4
4
  "engines": {
5
5
  "node": "20.5.0"
6
6
  },
@@ -36,7 +36,7 @@
36
36
  "@gisce/fiber-diagram": "^1.1.0-rc.3",
37
37
  "@gisce/ooui": "1.0.0-alpha.21",
38
38
  "@gisce/react-formiga-components": "^1.0.9-rc.21",
39
- "@gisce/react-formiga-table": "1.0.0-alpha.8",
39
+ "@gisce/react-formiga-table": "1.0.0-alpha.11",
40
40
  "@monaco-editor/react": "^4.4.5",
41
41
  "@tabler/icons-react": "^2.11.0",
42
42
  "antd": "^5.5.2",
@@ -15,6 +15,15 @@ const getTree = (treeView: TreeView): TreeOoui => {
15
15
  return tree;
16
16
  };
17
17
 
18
+ function isPrimitive(value: any): boolean {
19
+ return (
20
+ typeof value === "number" ||
21
+ typeof value === "string" ||
22
+ typeof value === "boolean" ||
23
+ value === null
24
+ );
25
+ }
26
+
18
27
  const getTableColumns = (
19
28
  tree: TreeOoui,
20
29
  components: any,
@@ -27,8 +36,21 @@ const getTableColumns = (
27
36
  let render;
28
37
 
29
38
  if (component) {
30
- render = (item: any) => {
31
- return component(item, key, column, context);
39
+ render = (value: any) => {
40
+ return component({ value, key, ooui: column, context });
41
+ };
42
+ } else {
43
+ render = (value: any) => {
44
+ return isPrimitive(value) ? (
45
+ value
46
+ ) : (
47
+ <p style={{ color: "red" }}>
48
+ Unsupported widget type for a Tree cell:
49
+ <pre>
50
+ <strong>{type}:</strong>
51
+ </pre>
52
+ </p>
53
+ );
32
54
  };
33
55
  }
34
56
 
@@ -58,7 +80,7 @@ const getTableColumns = (
58
80
  const getTableItems = (treeOoui: TreeOoui, results: any[]): any[] => {
59
81
  const tableItems = results.map((item: any) => {
60
82
  const parsedItem: any = {};
61
- Object.keys(item).map((key) => {
83
+ Object.keys(item).forEach((key) => {
62
84
  if (key === "id") {
63
85
  parsedItem[key] = item[key];
64
86
  } else {
@@ -67,7 +89,6 @@ const getTableItems = (treeOoui: TreeOoui, results: any[]): any[] => {
67
89
  if (widget instanceof Reference) {
68
90
  parsedItem[key] = item[key];
69
91
  } else if (widget instanceof Selection) {
70
- const selection = widget;
71
92
  parsedItem[key] = item[key];
72
93
  } else if (widget instanceof Many2one) {
73
94
  parsedItem[key] = item[key] &&
package/src/index.ts CHANGED
@@ -5,7 +5,7 @@ import { Selection } from "@/widgets/base/Selection";
5
5
  import { Boolean } from "@/widgets/base/Boolean";
6
6
  import { Many2one } from "@/widgets/base/many2one/Many2one";
7
7
  import { One2many } from "@/widgets/base/one2many/One2many";
8
- import Tree from "@/widgets/views/Tree";
8
+ import { Tree } from "@/widgets/views/Tree";
9
9
  import { Float } from "@/widgets/base/Float";
10
10
  import { ProgressBar } from "@/widgets/base/ProgressBar";
11
11
  import { FloatTime } from "@/widgets/base/FloatTime";
@@ -82,13 +82,22 @@ function TitleHeader(props: Props) {
82
82
  return null;
83
83
  }
84
84
  return (
85
- <div style={{ position: "sticky", top: 80, zIndex: 3 }}>
85
+ <div
86
+ style={{
87
+ position: "sticky",
88
+ top: 80,
89
+ zIndex: 3,
90
+ }}
91
+ >
86
92
  <Row
87
93
  className="shadow-md"
88
94
  style={{
89
95
  padding: "1em",
90
96
  borderRadius: token.borderRadius,
91
97
  backgroundColor: token.colorPrimaryBg,
98
+ height: "82px",
99
+ minHeight: "82px",
100
+ maxHeight: "82px",
92
101
  }}
93
102
  align="middle"
94
103
  >
@@ -124,6 +124,7 @@ const One2manyInput: React.FC<One2manyInputProps> = (
124
124
  }
125
125
 
126
126
  fetchDataIfNeeded();
127
+ // eslint-disable-next-line react-hooks/exhaustive-deps
127
128
  }, [items, currentView]);
128
129
 
129
130
  const fetchDataIfNeeded = useCallback(() => {
@@ -135,10 +136,12 @@ const One2manyInput: React.FC<One2manyInputProps> = (
135
136
  ) {
136
137
  fetchData();
137
138
  }
139
+ // eslint-disable-next-line react-hooks/exhaustive-deps
138
140
  }, [items, currentView]);
139
141
 
140
142
  useEffect(() => {
141
143
  parseDomain();
144
+ // eslint-disable-next-line react-hooks/exhaustive-deps
142
145
  }, [domain]);
143
146
 
144
147
  const triggerChange = (changedValue: One2manyItem[]) => {
@@ -626,10 +629,8 @@ const One2manyInput: React.FC<One2manyInputProps> = (
626
629
  : undefined
627
630
  }
628
631
  showPagination={false}
629
- rowSelection={{
630
- selectedRowKeys,
631
- onChange: setSelectedRowKeys,
632
- }}
632
+ selectedRowKeys={selectedRowKeys}
633
+ onRowSelectionChange={setSelectedRowKeys}
633
634
  sorter={sorter}
634
635
  onChangeSort={setSorter}
635
636
  context={{ ...getContext?.(), ...context }}
@@ -1,4 +1,4 @@
1
- import React, { useState, useContext, useRef, useEffect } from "react";
1
+ import { useState, useContext } from "react";
2
2
  import { Modal, Button, Divider, Row, Space } from "antd";
3
3
  import { FormModal } from "./FormModal";
4
4
  import SearchTree from "@/widgets/views/SearchTree";
@@ -65,9 +65,7 @@ export const SearchModal = (props: SearchSelectionProps) => {
65
65
  treeScrollY={modalHeight * 0.3}
66
66
  domain={domain}
67
67
  parentContext={context}
68
- onChangeSelectedRowKeys={(selectedRowKeys: any) => {
69
- setSelectedRowKeys(selectedRowKeys);
70
- }}
68
+ onChangeSelectedRowKeys={setSelectedRowKeys}
71
69
  />
72
70
  <Divider />
73
71
  <Row justify="end">
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState, useRef } from "react";
2
2
  import { Alert, Spin } from "antd";
3
3
 
4
- import Tree from "@/widgets/views/Tree";
4
+ import { Tree } from "@/widgets/views/Tree";
5
5
  import { FormView, TreeView } from "@/types/index";
6
6
  import ConnectionProvider from "@/ConnectionProvider";
7
7
 
@@ -116,6 +116,7 @@ function DashboardTree(props: Props) {
116
116
  if (visible) {
117
117
  fetchResults();
118
118
  }
119
+ // eslint-disable-next-line react-hooks/exhaustive-deps
119
120
  }, [page, offset, initialFetchDone, visible]);
120
121
 
121
122
  const fetchData = async (type: "action" | "model") => {
@@ -176,6 +177,7 @@ function DashboardTree(props: Props) {
176
177
  } else if (model) {
177
178
  fetchData("model");
178
179
  }
180
+ // eslint-disable-next-line react-hooks/exhaustive-deps
179
181
  }, [action, model]);
180
182
 
181
183
  const onRowClickedHandler = (record: any) => {
@@ -1,4 +1,4 @@
1
- import dayjs from "dayjs";
1
+ import dayjs from "@/helpers/dayjs";
2
2
 
3
3
  const formatter = (graphType: "pie" | "default" | "barGrouped") => {
4
4
  return (object: any) => {
@@ -5,11 +5,13 @@ import React, {
5
5
  useContext,
6
6
  forwardRef,
7
7
  useImperativeHandle,
8
+ useMemo,
9
+ useCallback,
8
10
  } from "react";
9
11
  import { Alert, Spin } from "antd";
10
12
 
11
13
  import SearchFilter from "@/widgets/views/searchFilter/SearchFilter";
12
- import Tree from "@/widgets/views/Tree";
14
+ import { Tree } from "@/widgets/views/Tree";
13
15
  import { FormView, TreeView } from "@/types/index";
14
16
  import ConnectionProvider from "@/ConnectionProvider";
15
17
 
@@ -109,6 +111,14 @@ function SearchTree(props: Props, ref: any) {
109
111
  setLimit = undefined,
110
112
  } = (rootTree ? actionViewContext : {}) || {};
111
113
 
114
+ const changeSelectedRowKeys = useCallback(
115
+ (newSelectedRowKeys: any[]) => {
116
+ setSelectedRowItems?.(newSelectedRowKeys.map((id: number) => ({ id })));
117
+ onChangeSelectedRowKeys?.(newSelectedRowKeys);
118
+ },
119
+ [onChangeSelectedRowKeys, setSelectedRowItems],
120
+ );
121
+
112
122
  const {
113
123
  submit,
114
124
  clear,
@@ -170,6 +180,7 @@ function SearchTree(props: Props, ref: any) {
170
180
  searchNameGetDoneRef.current = false;
171
181
  fetchResults();
172
182
  }
183
+ // eslint-disable-next-line react-hooks/exhaustive-deps
173
184
  }, [page, offset, initialFetchDone, visible, nameSearch, treeView]);
174
185
 
175
186
  const fetchData = async () => {
@@ -218,6 +229,7 @@ function SearchTree(props: Props, ref: any) {
218
229
 
219
230
  useEffect(() => {
220
231
  fetchData();
232
+ // eslint-disable-next-line react-hooks/exhaustive-deps
221
233
  }, [model]);
222
234
 
223
235
  const onSearchTreeLimitChange = (newLimit: number) => {
@@ -269,11 +281,6 @@ function SearchTree(props: Props, ref: any) {
269
281
  });
270
282
  };
271
283
 
272
- function changeSelectedRowKeys(selectedRowKeys: any[]) {
273
- setSelectedRowItems?.(selectedRowKeys.map((id: number) => ({ id })));
274
- onChangeSelectedRowKeys?.(selectedRowKeys);
275
- }
276
-
277
284
  async function selectAllRecords() {
278
285
  const allIds = await getAllIds();
279
286
  setSelectedRowItems?.(allIds.map((id: number) => ({ id })));
@@ -284,9 +291,14 @@ function SearchTree(props: Props, ref: any) {
284
291
  if (treeView?.isExpandable) {
285
292
  return height - 160;
286
293
  }
287
- return height - (searchFilterHeight + 210);
294
+ return height - (searchFilterHeight + 240);
288
295
  }
289
296
 
297
+ const selectedRowKeys = useMemo(
298
+ () => selectedRowItems?.map((item) => item.id),
299
+ [selectedRowItems],
300
+ );
301
+
290
302
  const content = () => {
291
303
  if (!treeView || !formView) {
292
304
  return null;
@@ -324,10 +336,8 @@ function SearchTree(props: Props, ref: any) {
324
336
  scrollY={treeScrollY || calculateTableHeight()}
325
337
  colorsForResults={colorsForResults}
326
338
  statusForResults={statusForResults}
327
- rowSelection={{
328
- selectedRowKeys: selectedRowItems?.map((item) => item.id),
329
- onChange: changeSelectedRowKeys,
330
- }}
339
+ selectedRowKeys={selectedRowKeys}
340
+ onRowSelectionChange={changeSelectedRowKeys}
331
341
  sorter={sorter}
332
342
  onChangeSort={changeSort}
333
343
  onFetchChildrenForRecord={