@azrico/reactgrid 1.0.21 → 1.0.22
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/src/example.js +32 -13
- package/dist/src/index.js +2 -9
- package/package.json +2 -2
- package/src/example.tsx +47 -27
- package/src/index.tsx +2 -9
package/dist/src/example.js
CHANGED
|
@@ -78,11 +78,6 @@ function getData() {
|
|
|
78
78
|
return fd;
|
|
79
79
|
}
|
|
80
80
|
function ExampleGrid() {
|
|
81
|
-
const renderContactsGrid = ({
|
|
82
|
-
data
|
|
83
|
-
}) => {
|
|
84
|
-
return _react.default.createElement("div", null, _react.default.createElement("div", null, 'Test'));
|
|
85
|
-
};
|
|
86
81
|
const [selected, setSelected] = _react.default.useState(null);
|
|
87
82
|
const onSelectionChange = _react.default.useCallback(({
|
|
88
83
|
selected
|
|
@@ -90,12 +85,18 @@ function ExampleGrid() {
|
|
|
90
85
|
setSelected(selected);
|
|
91
86
|
}, []);
|
|
92
87
|
const dataSource = _react.default.useCallback(async dt => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
console.log('Start loading');
|
|
89
|
+
return await new Promise(resolve => {
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
console.log('end loading');
|
|
92
|
+
resolve({
|
|
93
|
+
data: getData(),
|
|
94
|
+
count: 999
|
|
95
|
+
});
|
|
96
|
+
}, 1000);
|
|
97
|
+
});
|
|
97
98
|
}, []);
|
|
98
|
-
return _react.default.createElement(_DataGrid.default, {
|
|
99
|
+
return _react.default.createElement("div", null, _react.default.createElement(_DataGrid.default, {
|
|
99
100
|
dark: true,
|
|
100
101
|
allowChildRows: true,
|
|
101
102
|
onSelectionChange: onSelectionChange,
|
|
@@ -103,6 +104,7 @@ function ExampleGrid() {
|
|
|
103
104
|
contextMenuItems: contextMenuItems,
|
|
104
105
|
customColumns: customColumns,
|
|
105
106
|
columns: columns,
|
|
107
|
+
leftColumns: leftColumns,
|
|
106
108
|
gridOptions: {
|
|
107
109
|
pagination: 'remote',
|
|
108
110
|
defaultLimit: 100,
|
|
@@ -111,9 +113,26 @@ function ExampleGrid() {
|
|
|
111
113
|
rowIndexColumn: true,
|
|
112
114
|
checkboxColumn: true
|
|
113
115
|
},
|
|
114
|
-
dataSource: dataSource
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
dataSource: dataSource
|
|
117
|
+
}), _react.default.createElement(_DataGrid.default, {
|
|
118
|
+
dark: true,
|
|
119
|
+
allowChildRows: true,
|
|
120
|
+
onSelectionChange: onSelectionChange,
|
|
121
|
+
selected: selected,
|
|
122
|
+
contextMenuItems: contextMenuItems,
|
|
123
|
+
customColumns: customColumns,
|
|
124
|
+
columns: columns,
|
|
125
|
+
leftColumns: leftColumns,
|
|
126
|
+
gridOptions: {
|
|
127
|
+
pagination: 'remote',
|
|
128
|
+
defaultLimit: 100,
|
|
129
|
+
limit: 100,
|
|
130
|
+
pageSizes: [100],
|
|
131
|
+
rowIndexColumn: true,
|
|
132
|
+
checkboxColumn: true
|
|
133
|
+
},
|
|
134
|
+
dataSource: dataSource
|
|
135
|
+
}));
|
|
117
136
|
}
|
|
118
137
|
var _default = ExampleGrid;
|
|
119
138
|
exports.default = _default;
|
package/dist/src/index.js
CHANGED
|
@@ -19,13 +19,6 @@ Object.keys(_DataGrid).forEach(function (key) {
|
|
|
19
19
|
});
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
-
var _default = _DataGrid.default; //
|
|
23
|
-
//
|
|
24
|
-
// // enable sentry
|
|
25
|
-
// } else if (process.env!.NODE_ENV === 'development') {
|
|
26
|
-
// const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
|
27
|
-
// root.render(<ExampleGrid />);
|
|
28
|
-
// } else {
|
|
29
|
-
// // set defaults
|
|
30
|
-
// }
|
|
22
|
+
var _default = _DataGrid.default; // const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
|
23
|
+
// root.render(<ExampleGrid />);
|
|
31
24
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azrico/reactgrid",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"description": "React Datagrid",
|
|
6
6
|
"author": "Azrideus <MehrdadTavangar@gmail.com>",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@azrico/controls": "1.3.0",
|
|
33
33
|
"@emotion/react": "^11.9.3",
|
|
34
34
|
"@emotion/styled": "^11.9.3",
|
|
35
|
-
"@inovua/reactdatagrid-enterprise": "^5.
|
|
35
|
+
"@inovua/reactdatagrid-enterprise": "^5.8.0",
|
|
36
36
|
"clsx": "^1.2.1",
|
|
37
37
|
"react": "^18.2.0",
|
|
38
38
|
"react-resize-detector": "^7.1.2"
|
package/src/example.tsx
CHANGED
|
@@ -49,13 +49,6 @@ function getData() {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export function ExampleGrid() {
|
|
52
|
-
const renderContactsGrid = ({ data }) => {
|
|
53
|
-
return (
|
|
54
|
-
<div>
|
|
55
|
-
<div>{'Test'}</div>
|
|
56
|
-
</div>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
52
|
const [selected, setSelected] = React.useState(null);
|
|
60
53
|
|
|
61
54
|
const onSelectionChange = React.useCallback(({ selected }) => {
|
|
@@ -63,29 +56,56 @@ export function ExampleGrid() {
|
|
|
63
56
|
}, []);
|
|
64
57
|
|
|
65
58
|
const dataSource = React.useCallback(async (dt) => {
|
|
66
|
-
|
|
59
|
+
console.log('Start loading');
|
|
60
|
+
return await new Promise((resolve) => {
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
console.log('end loading');
|
|
63
|
+
resolve({ data: getData(), count: 999 });
|
|
64
|
+
}, 1000);
|
|
65
|
+
});
|
|
67
66
|
}, []);
|
|
68
67
|
|
|
69
68
|
return (
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
69
|
+
<div>
|
|
70
|
+
<AzGrid
|
|
71
|
+
dark
|
|
72
|
+
allowChildRows
|
|
73
|
+
onSelectionChange={onSelectionChange}
|
|
74
|
+
selected={selected}
|
|
75
|
+
contextMenuItems={contextMenuItems}
|
|
76
|
+
customColumns={customColumns}
|
|
77
|
+
columns={columns}
|
|
78
|
+
leftColumns={leftColumns}
|
|
79
|
+
gridOptions={{
|
|
80
|
+
pagination: 'remote',
|
|
81
|
+
defaultLimit: 100,
|
|
82
|
+
limit: 100,
|
|
83
|
+
pageSizes: [100],
|
|
84
|
+
rowIndexColumn: true,
|
|
85
|
+
checkboxColumn: true,
|
|
86
|
+
}}
|
|
87
|
+
dataSource={dataSource}
|
|
88
|
+
/>
|
|
89
|
+
<AzGrid
|
|
90
|
+
dark
|
|
91
|
+
allowChildRows
|
|
92
|
+
onSelectionChange={onSelectionChange}
|
|
93
|
+
selected={selected}
|
|
94
|
+
contextMenuItems={contextMenuItems}
|
|
95
|
+
customColumns={customColumns}
|
|
96
|
+
columns={columns}
|
|
97
|
+
leftColumns={leftColumns}
|
|
98
|
+
gridOptions={{
|
|
99
|
+
pagination: 'remote',
|
|
100
|
+
defaultLimit: 100,
|
|
101
|
+
limit: 100,
|
|
102
|
+
pageSizes: [100],
|
|
103
|
+
rowIndexColumn: true,
|
|
104
|
+
checkboxColumn: true,
|
|
105
|
+
}}
|
|
106
|
+
dataSource={dataSource}
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
89
109
|
);
|
|
90
110
|
}
|
|
91
111
|
export default ExampleGrid;
|
package/src/index.tsx
CHANGED
|
@@ -7,12 +7,5 @@ import React from 'react';
|
|
|
7
7
|
import ReactDOM from 'react-dom/client';
|
|
8
8
|
export default AzGrid;
|
|
9
9
|
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// // enable sentry
|
|
13
|
-
// } else if (process.env!.NODE_ENV === 'development') {
|
|
14
|
-
// const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
|
15
|
-
// root.render(<ExampleGrid />);
|
|
16
|
-
// } else {
|
|
17
|
-
// // set defaults
|
|
18
|
-
// }
|
|
10
|
+
// const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
|
11
|
+
// root.render(<ExampleGrid />);
|