@azrico/reactgrid 1.1.12 → 1.1.13
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/README.md +3 -3
- package/index.ts +4 -4
- package/package.json +62 -62
- package/public/index.html +19 -19
- package/public/manifest.json +9 -9
- package/src/example.tsx +117 -117
- package/src/func/helpers.ts +74 -74
- package/src/index.tsx +11 -11
- package/src/themes/base_styles.css +26 -26
- package/src/themes/grid.css +20 -20
- package/src/views/DataGrid.tsx +519 -478
- package/src/views/index.ts +4 -4
- package/yarn-error.log +79 -79
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -21
- package/dist/src/example.d.ts +0 -4
- package/dist/src/example.js +0 -123
- package/dist/src/func/helpers.d.ts +0 -29
- package/dist/src/func/helpers.js +0 -80
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.js +0 -24
- package/dist/src/themes/base_styles.css +0 -26
- package/dist/src/themes/grid.css +0 -20
- package/dist/src/views/DataGrid.d.ts +0 -66
- package/dist/src/views/DataGrid.js +0 -355
- package/dist/src/views/index.d.ts +0 -3
- package/dist/src/views/index.js +0 -23
package/src/views/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './DataGrid';
|
|
2
|
-
|
|
3
|
-
import AzGrid from './DataGrid';
|
|
4
|
-
export default AzGrid;
|
|
1
|
+
export * from './DataGrid';
|
|
2
|
+
|
|
3
|
+
import AzGrid from './DataGrid';
|
|
4
|
+
export default AzGrid;
|
package/yarn-error.log
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
Arguments:
|
|
2
|
-
C:\Program Files\nodejs\node.exe C:\Program Files (x86)\Yarn\bin\yarn.js install
|
|
3
|
-
|
|
4
|
-
PATH:
|
|
5
|
-
C:\Program Files\Common Files\Oracle\Java\javapath;C:\Python310\Scripts\;C:\Python310\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Users\Ayhan\AppData\Local\mongodb\mongosh\bin;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\PuTTY\;D:\php;C:\ProgramData\ComposerSetup\bin;C:\Users\Ayhan\AppData\Roaming\.dotnet;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Users\Ayhan\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Ayhan\AppData\Local\Yarn\bin;C:\Users\Ayhan\AppData\Roaming\npm;C:\Users\Ayhan\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;C:\Users\Ayhan\AppData\Roaming\Composer\vendor\bin;%USERPROFILE%\.dotnet\tools;
|
|
6
|
-
|
|
7
|
-
Yarn version:
|
|
8
|
-
1.22.5
|
|
9
|
-
|
|
10
|
-
Node version:
|
|
11
|
-
16.17.0
|
|
12
|
-
|
|
13
|
-
Platform:
|
|
14
|
-
win32 x64
|
|
15
|
-
|
|
16
|
-
Trace:
|
|
17
|
-
Error: ENOENT: no such file or directory, lstat 'C:\Code\azrico-reactgrid\node_modules\make-dir'
|
|
18
|
-
|
|
19
|
-
npm manifest:
|
|
20
|
-
{
|
|
21
|
-
"name": "@azrico/reactgrid",
|
|
22
|
-
"version": "1.0.0",
|
|
23
|
-
"private": true,
|
|
24
|
-
"main": "src/test",
|
|
25
|
-
"description": "React Datagrid",
|
|
26
|
-
"author": "Azrideus <MehrdadTavangar@gmail.com>",
|
|
27
|
-
"homepage": ".",
|
|
28
|
-
"scripts": {
|
|
29
|
-
"start": "react-scripts start",
|
|
30
|
-
"build": "react-scripts build",
|
|
31
|
-
"test": "react-scripts test --env=jsdom",
|
|
32
|
-
"eject": "react-scripts eject",
|
|
33
|
-
"deploy": "gh-pages -d build"
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"@azrico/controls": "1.3.0",
|
|
37
|
-
"@emotion/react": "^11.9.3",
|
|
38
|
-
"@emotion/styled": "^11.9.3",
|
|
39
|
-
"@inovua/reactdatagrid-enterprise": "^5.6.1",
|
|
40
|
-
"clsx": "^1.2.1",
|
|
41
|
-
"react": "^18.2.0",
|
|
42
|
-
"react-resize-detector": "^7.1.2"
|
|
43
|
-
},
|
|
44
|
-
"config-overrides-path": "../../config/config-overrides.js",
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"@mui/material": "*",
|
|
47
|
-
"@types/react": "^18.0.25",
|
|
48
|
-
"@types/react-dom": "^18.0.8",
|
|
49
|
-
"react-dom": "^18.2.0",
|
|
50
|
-
"react-scripts": "^5.0.1",
|
|
51
|
-
"typescript": "^4.8.4"
|
|
52
|
-
},
|
|
53
|
-
"peerDependencies": {
|
|
54
|
-
"@azrico/controls": "*",
|
|
55
|
-
"@emotion/react": "*",
|
|
56
|
-
"@emotion/styled": "*",
|
|
57
|
-
"clsx": "*",
|
|
58
|
-
"react": "*",
|
|
59
|
-
"react-resize-detector": "*"
|
|
60
|
-
},
|
|
61
|
-
"browserslist": {
|
|
62
|
-
"production": [
|
|
63
|
-
">0.2%",
|
|
64
|
-
"not dead",
|
|
65
|
-
"not op_mini all"
|
|
66
|
-
],
|
|
67
|
-
"development": [
|
|
68
|
-
"last 1 chrome version",
|
|
69
|
-
"last 1 firefox version",
|
|
70
|
-
"last 1 safari version"
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
yarn manifest:
|
|
76
|
-
No manifest
|
|
77
|
-
|
|
78
|
-
Lockfile:
|
|
1
|
+
Arguments:
|
|
2
|
+
C:\Program Files\nodejs\node.exe C:\Program Files (x86)\Yarn\bin\yarn.js install
|
|
3
|
+
|
|
4
|
+
PATH:
|
|
5
|
+
C:\Program Files\Common Files\Oracle\Java\javapath;C:\Python310\Scripts\;C:\Python310\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Users\Ayhan\AppData\Local\mongodb\mongosh\bin;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\PuTTY\;D:\php;C:\ProgramData\ComposerSetup\bin;C:\Users\Ayhan\AppData\Roaming\.dotnet;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Users\Ayhan\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Ayhan\AppData\Local\Yarn\bin;C:\Users\Ayhan\AppData\Roaming\npm;C:\Users\Ayhan\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;C:\Users\Ayhan\AppData\Roaming\Composer\vendor\bin;%USERPROFILE%\.dotnet\tools;
|
|
6
|
+
|
|
7
|
+
Yarn version:
|
|
8
|
+
1.22.5
|
|
9
|
+
|
|
10
|
+
Node version:
|
|
11
|
+
16.17.0
|
|
12
|
+
|
|
13
|
+
Platform:
|
|
14
|
+
win32 x64
|
|
15
|
+
|
|
16
|
+
Trace:
|
|
17
|
+
Error: ENOENT: no such file or directory, lstat 'C:\Code\azrico-reactgrid\node_modules\make-dir'
|
|
18
|
+
|
|
19
|
+
npm manifest:
|
|
20
|
+
{
|
|
21
|
+
"name": "@azrico/reactgrid",
|
|
22
|
+
"version": "1.0.0",
|
|
23
|
+
"private": true,
|
|
24
|
+
"main": "src/test",
|
|
25
|
+
"description": "React Datagrid",
|
|
26
|
+
"author": "Azrideus <MehrdadTavangar@gmail.com>",
|
|
27
|
+
"homepage": ".",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"start": "react-scripts start",
|
|
30
|
+
"build": "react-scripts build",
|
|
31
|
+
"test": "react-scripts test --env=jsdom",
|
|
32
|
+
"eject": "react-scripts eject",
|
|
33
|
+
"deploy": "gh-pages -d build"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@azrico/controls": "1.3.0",
|
|
37
|
+
"@emotion/react": "^11.9.3",
|
|
38
|
+
"@emotion/styled": "^11.9.3",
|
|
39
|
+
"@inovua/reactdatagrid-enterprise": "^5.6.1",
|
|
40
|
+
"clsx": "^1.2.1",
|
|
41
|
+
"react": "^18.2.0",
|
|
42
|
+
"react-resize-detector": "^7.1.2"
|
|
43
|
+
},
|
|
44
|
+
"config-overrides-path": "../../config/config-overrides.js",
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@mui/material": "*",
|
|
47
|
+
"@types/react": "^18.0.25",
|
|
48
|
+
"@types/react-dom": "^18.0.8",
|
|
49
|
+
"react-dom": "^18.2.0",
|
|
50
|
+
"react-scripts": "^5.0.1",
|
|
51
|
+
"typescript": "^4.8.4"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"@azrico/controls": "*",
|
|
55
|
+
"@emotion/react": "*",
|
|
56
|
+
"@emotion/styled": "*",
|
|
57
|
+
"clsx": "*",
|
|
58
|
+
"react": "*",
|
|
59
|
+
"react-resize-detector": "*"
|
|
60
|
+
},
|
|
61
|
+
"browserslist": {
|
|
62
|
+
"production": [
|
|
63
|
+
">0.2%",
|
|
64
|
+
"not dead",
|
|
65
|
+
"not op_mini all"
|
|
66
|
+
],
|
|
67
|
+
"development": [
|
|
68
|
+
"last 1 chrome version",
|
|
69
|
+
"last 1 firefox version",
|
|
70
|
+
"last 1 safari version"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
yarn manifest:
|
|
76
|
+
No manifest
|
|
77
|
+
|
|
78
|
+
Lockfile:
|
|
79
79
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
80
80
|
# yarn lockfile v1
|
|
81
81
|
|
|
@@ -9250,4 +9250,4 @@ Lockfile:
|
|
|
9250
9250
|
yocto-queue@^0.1.0:
|
|
9251
9251
|
version "0.1.0"
|
|
9252
9252
|
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|
|
9253
|
-
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
|
|
9253
|
+
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {};
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _src = require("./src");
|
|
9
|
-
Object.keys(_src).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
12
|
-
if (key in exports && exports[key] === _src[key]) return;
|
|
13
|
-
Object.defineProperty(exports, key, {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _src[key];
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
var _default = _src.AzGrid;
|
|
21
|
-
exports.default = _default;
|
package/dist/src/example.d.ts
DELETED
package/dist/src/example.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
ExampleGrid: true
|
|
8
|
-
};
|
|
9
|
-
exports.ExampleGrid = ExampleGrid;
|
|
10
|
-
exports.default = void 0;
|
|
11
|
-
var _DataGrid = _interopRequireWildcard(require("./views/DataGrid"));
|
|
12
|
-
Object.keys(_DataGrid).forEach(function (key) {
|
|
13
|
-
if (key === "default" || key === "__esModule") return;
|
|
14
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
15
|
-
if (key in exports && exports[key] === _DataGrid[key]) return;
|
|
16
|
-
Object.defineProperty(exports, key, {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return _DataGrid[key];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
var _react = _interopRequireDefault(require("react"));
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
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); }
|
|
26
|
-
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; }
|
|
27
|
-
const columns = [{
|
|
28
|
-
name: 'name',
|
|
29
|
-
title: 'Category',
|
|
30
|
-
defaultFlex: 1
|
|
31
|
-
}];
|
|
32
|
-
const leftColumns = ['username', 'row'];
|
|
33
|
-
const customColumns = [{
|
|
34
|
-
name: 'job',
|
|
35
|
-
render: () => {
|
|
36
|
-
return _react.default.createElement("div", null, "test");
|
|
37
|
-
}
|
|
38
|
-
}];
|
|
39
|
-
const filterValue = [{
|
|
40
|
-
name: 'name',
|
|
41
|
-
operator: 'contains',
|
|
42
|
-
type: 'string',
|
|
43
|
-
value: ''
|
|
44
|
-
}];
|
|
45
|
-
const contextMenuItems = ['test'];
|
|
46
|
-
function getData() {
|
|
47
|
-
const fd = [];
|
|
48
|
-
for (let index = 0; index < 200; index++) {
|
|
49
|
-
fd.push({
|
|
50
|
-
__table_id: String(index),
|
|
51
|
-
name: 'user-' + index,
|
|
52
|
-
age: 20
|
|
53
|
-
});
|
|
54
|
-
//if (index % 5 == 0) {
|
|
55
|
-
// const sub_selfid = 's' + index;
|
|
56
|
-
// fd.push({
|
|
57
|
-
// __table_id: sub_selfid,
|
|
58
|
-
// __parent__table_id: String(index),
|
|
59
|
-
// name: 'sub-' + index,
|
|
60
|
-
// age: 20,
|
|
61
|
-
// });
|
|
62
|
-
// if (index % 2 == 0) {
|
|
63
|
-
// const sub2_selfid = 'ss' + index;
|
|
64
|
-
// fd.push({
|
|
65
|
-
// __table_id: sub2_selfid,
|
|
66
|
-
// __parent__table_id: sub_selfid,
|
|
67
|
-
// name: 'sub2-' + index,
|
|
68
|
-
// age: 20,
|
|
69
|
-
// });
|
|
70
|
-
// }
|
|
71
|
-
//}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return fd;
|
|
75
|
-
}
|
|
76
|
-
function ExampleGrid() {
|
|
77
|
-
const [ds_reset, set_ds_reset] = _react.default.useState(0);
|
|
78
|
-
const dataSource = _react.default.useCallback(async dt => {
|
|
79
|
-
//console.log('Start loading');
|
|
80
|
-
return await new Promise(resolve => {
|
|
81
|
-
setTimeout(() => {
|
|
82
|
-
//console.log('end loading');
|
|
83
|
-
resolve(getData());
|
|
84
|
-
}, 1000);
|
|
85
|
-
});
|
|
86
|
-
}, [ds_reset]);
|
|
87
|
-
const onRowDoubleClick = _react.default.useCallback((index, rowdata) => {
|
|
88
|
-
console.log((rowdata === null || rowdata === void 0 ? void 0 : rowdata.data) || rowdata);
|
|
89
|
-
}, []);
|
|
90
|
-
const onRowClick = _react.default.useCallback((index, rowdata) => {
|
|
91
|
-
//console.log(rowdata?.data || rowdata);
|
|
92
|
-
}, []);
|
|
93
|
-
function rst_ds() {
|
|
94
|
-
//console.log('rst_ds');
|
|
95
|
-
set_ds_reset(s => s + 1);
|
|
96
|
-
}
|
|
97
|
-
return _react.default.createElement(_DataGrid.default, {
|
|
98
|
-
dark: true,
|
|
99
|
-
onRowClick: onRowClick,
|
|
100
|
-
onRowDoubleClick: onRowDoubleClick,
|
|
101
|
-
// allowChildRows
|
|
102
|
-
// onSelectionChange={onSelectionChange}
|
|
103
|
-
// selected={selected}
|
|
104
|
-
contextMenuItems: contextMenuItems,
|
|
105
|
-
// customColumns={customColumns}
|
|
106
|
-
columns: columns,
|
|
107
|
-
// leftColumns={leftColumns}
|
|
108
|
-
gridOptions: {
|
|
109
|
-
// defaultFilterValue: filterValue,
|
|
110
|
-
// remoteFilter: false,
|
|
111
|
-
// multiSelect: true,
|
|
112
|
-
// pagination: 'local',
|
|
113
|
-
// defaultLimit: 100,
|
|
114
|
-
// limit: 100,
|
|
115
|
-
// pageSizes: [100],
|
|
116
|
-
// rowIndexColumn: true,
|
|
117
|
-
// checkboxColumn: true,
|
|
118
|
-
},
|
|
119
|
-
dataSource: dataSource
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
var _default = ExampleGrid;
|
|
123
|
-
exports.default = _default;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
type mrow = {
|
|
2
|
-
__parent__table_id: any;
|
|
3
|
-
__table_id: any;
|
|
4
|
-
__children?: any[];
|
|
5
|
-
};
|
|
6
|
-
export declare function fix_parent_child_relations<T extends mrow>(rows: T[]): T[];
|
|
7
|
-
export declare class func_selection {
|
|
8
|
-
static getVirtualElement(x?: number, y?: number): () => {
|
|
9
|
-
getBoundingClientRect: () => {
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
top: number;
|
|
13
|
-
right: number;
|
|
14
|
-
bottom: number;
|
|
15
|
-
left: number;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
static generateGetBoundingClientRect(x?: number, y?: number): () => {
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
top: number;
|
|
22
|
-
right: number;
|
|
23
|
-
bottom: number;
|
|
24
|
-
left: number;
|
|
25
|
-
};
|
|
26
|
-
static get_selectedText(): string;
|
|
27
|
-
static has_selection(): boolean;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
package/dist/src/func/helpers.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.fix_parent_child_relations = fix_parent_child_relations;
|
|
7
|
-
exports.func_selection = void 0;
|
|
8
|
-
function get_parentId(obj) {
|
|
9
|
-
return obj.__parent__table_id || obj.parent;
|
|
10
|
-
}
|
|
11
|
-
function get_selfId(obj) {
|
|
12
|
-
return obj.__table_id;
|
|
13
|
-
}
|
|
14
|
-
//given an array of rows, fixes parent,child relations
|
|
15
|
-
function fix_parent_child_relations(rows) {
|
|
16
|
-
if (!Array.isArray(rows)) rows = [];
|
|
17
|
-
const converted_rows = rows.filter(r => r != null).map(r => {
|
|
18
|
-
return {
|
|
19
|
-
parent: get_parentId(r),
|
|
20
|
-
self: get_selfId(r),
|
|
21
|
-
data: r
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
const top_level_rows = converted_rows.filter(r => !r.parent);
|
|
25
|
-
//find children of top-level parents:
|
|
26
|
-
for (let index = 0; index < top_level_rows.length; index++) {
|
|
27
|
-
const mrow = top_level_rows[index];
|
|
28
|
-
assign_children(mrow, converted_rows);
|
|
29
|
-
}
|
|
30
|
-
const result = top_level_rows.map(r => r.data);
|
|
31
|
-
//console.log(result);
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
function assign_children(row, all_rows) {
|
|
35
|
-
const my_children = all_rows.filter(s => row.self == s.parent);
|
|
36
|
-
if (my_children.length > 0) {
|
|
37
|
-
//find children of my children:
|
|
38
|
-
for (let index = 0; index < my_children.length; index++) {
|
|
39
|
-
const child = my_children[index];
|
|
40
|
-
assign_children(child, all_rows);
|
|
41
|
-
}
|
|
42
|
-
row.data.__children = my_children.map(r => r.data);
|
|
43
|
-
} else if (!Array.isArray(row.data.__children) || row.data.__children.length == 0) row.data.__children = undefined;
|
|
44
|
-
}
|
|
45
|
-
class func_selection {
|
|
46
|
-
static getVirtualElement(x = 0, y = 0) {
|
|
47
|
-
return () => ({
|
|
48
|
-
getBoundingClientRect: func_selection.generateGetBoundingClientRect(x, y)
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
static generateGetBoundingClientRect(x = 0, y = 0) {
|
|
52
|
-
return () => ({
|
|
53
|
-
width: 0,
|
|
54
|
-
height: 0,
|
|
55
|
-
top: y,
|
|
56
|
-
right: x,
|
|
57
|
-
bottom: y,
|
|
58
|
-
left: x
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
static get_selectedText() {
|
|
62
|
-
var text = '';
|
|
63
|
-
if (window.getSelection) {
|
|
64
|
-
var _window$getSelection;
|
|
65
|
-
text = (_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.toString();
|
|
66
|
-
} else if (document.selection && document.selection.type != 'Control') {
|
|
67
|
-
var _document$selection$c;
|
|
68
|
-
text = (_document$selection$c = document.selection.createRange()) === null || _document$selection$c === void 0 ? void 0 : _document$selection$c.text;
|
|
69
|
-
}
|
|
70
|
-
return text || '';
|
|
71
|
-
}
|
|
72
|
-
static has_selection() {
|
|
73
|
-
const slct = window.getSelection();
|
|
74
|
-
if (slct == null) return false;
|
|
75
|
-
if (slct.type == null) return func_selection.get_selectedText().length !== 0;
|
|
76
|
-
if (slct.type === 'Range') return true;
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.func_selection = func_selection;
|
package/dist/src/index.d.ts
DELETED
package/dist/src/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {};
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _DataGrid = _interopRequireWildcard(require("./views/DataGrid"));
|
|
9
|
-
Object.keys(_DataGrid).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
12
|
-
if (key in exports && exports[key] === _DataGrid[key]) return;
|
|
13
|
-
Object.defineProperty(exports, key, {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _DataGrid[key];
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
});
|
|
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
|
-
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; // const root = ReactDOM.createRoot(document.getElementById('testroot') as HTMLElement);
|
|
23
|
-
// root.render(<ExampleGrid />);
|
|
24
|
-
exports.default = _default;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.azgrid-container {
|
|
2
|
-
height: 100%;
|
|
3
|
-
width: 100%;
|
|
4
|
-
}
|
|
5
|
-
.azgrid-borderbox {
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
}
|
|
8
|
-
.azgrid-filler {
|
|
9
|
-
height: 100%;
|
|
10
|
-
width: 100%;
|
|
11
|
-
}
|
|
12
|
-
.azgrid-nooverflow {
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
}
|
|
15
|
-
.azgrid-testborder {
|
|
16
|
-
border: 3px solid red;
|
|
17
|
-
}
|
|
18
|
-
.azgrid-pad50px {
|
|
19
|
-
padding: 50px;
|
|
20
|
-
}
|
|
21
|
-
.azgrid-nopad {
|
|
22
|
-
padding: 0;
|
|
23
|
-
}
|
|
24
|
-
.azgrid-nomargin {
|
|
25
|
-
margin: 0;
|
|
26
|
-
}
|
package/dist/src/themes/grid.css
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* .InovuaReactDataGrid {
|
|
2
|
-
--grid-bg: '#fff';
|
|
3
|
-
}
|
|
4
|
-
.InovuaReactDataGrid {
|
|
5
|
-
background: var(--grid-bg) !important;
|
|
6
|
-
}
|
|
7
|
-
.InovuaReactDataGrid__header {
|
|
8
|
-
background: var(--grid-bg) !important;
|
|
9
|
-
}
|
|
10
|
-
.InovuaReactDataGrid__row {
|
|
11
|
-
background: var(--grid-bg) !important;
|
|
12
|
-
}
|
|
13
|
-
.InovuaReactDataGrid__cell {
|
|
14
|
-
background: var(--grid-bg) !important;
|
|
15
|
-
} */
|
|
16
|
-
.InovuaReactDataGrid__cell .InovuaReactDataGrid__cell__content {
|
|
17
|
-
height: 100%;
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import '@inovua/reactdatagrid-enterprise/index.css';
|
|
2
|
-
import '@inovua/reactdatagrid-enterprise/theme/default-dark.css';
|
|
3
|
-
import '@inovua/reactdatagrid-enterprise/theme/amber-dark.css';
|
|
4
|
-
import '../themes/base_styles.css';
|
|
5
|
-
import '../themes/grid.css';
|
|
6
|
-
import { ConvertableToMenuItem } from '@azrico/controls';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { TypeColumn, TypeDataGridProps, TypeDataSource, TypeFilterTypes, TypeRowDetailsInfo, TypeRowProps, TypeRowSelection } from '@inovua/reactdatagrid-community/types';
|
|
9
|
-
import { TypeOnSelectionChangeArg } from '@inovua/reactdatagrid-community/types/TypeDataGridProps';
|
|
10
|
-
export type ColumnDefinition = TypeColumn;
|
|
11
|
-
export type CellDefinition = any;
|
|
12
|
-
export type RowDefinition = any;
|
|
13
|
-
export type RowProps = TypeRowProps;
|
|
14
|
-
export type RowSelectionValue = TypeRowSelection;
|
|
15
|
-
export type DataRowDefinition = any;
|
|
16
|
-
export type FilterTypes = TypeFilterTypes;
|
|
17
|
-
export type DataSourceDefinition = TypeDataSource;
|
|
18
|
-
export type OnSelectionChangeFunc = (config: TypeOnSelectionChangeArg) => void;
|
|
19
|
-
export type RowDetailsFunc = (rowDetailsInfo: TypeRowDetailsInfo) => React.ReactNode;
|
|
20
|
-
type loose_column_names = {
|
|
21
|
-
key: string;
|
|
22
|
-
field: string;
|
|
23
|
-
columnName: string;
|
|
24
|
-
name: string;
|
|
25
|
-
};
|
|
26
|
-
type loose_column_fields = loose_column_names & {
|
|
27
|
-
title: string;
|
|
28
|
-
};
|
|
29
|
-
export type LooseColumnDefinition = Partial<loose_column_fields & ColumnDefinition>;
|
|
30
|
-
type columnOrString = string | LooseColumnDefinition;
|
|
31
|
-
type customColumnData = {
|
|
32
|
-
name: string;
|
|
33
|
-
render: (cell: any, formatterParams: any, onRendered: any) => React.ReactNode | undefined | null;
|
|
34
|
-
};
|
|
35
|
-
type GridOptions = Partial<TypeDataGridProps>;
|
|
36
|
-
export type AzGridProps = {
|
|
37
|
-
columns?: columnOrString[];
|
|
38
|
-
dataSource?: any[] | ((args: any) => any[] | Promise<any[] | any>);
|
|
39
|
-
licenseKey?: string;
|
|
40
|
-
gridOptions?: GridOptions;
|
|
41
|
-
columnExtensions?: Array<{
|
|
42
|
-
name: string;
|
|
43
|
-
} & Partial<ColumnDefinition>>;
|
|
44
|
-
editableColumns?: string[];
|
|
45
|
-
leftColumns?: string[];
|
|
46
|
-
rightColumns?: string[];
|
|
47
|
-
customColumns?: customColumnData[];
|
|
48
|
-
contextMenuItems?: ConvertableToMenuItem[];
|
|
49
|
-
highlightedRow?: any;
|
|
50
|
-
RowDetail?: RowDetailsFunc;
|
|
51
|
-
selected?: RowSelectionValue;
|
|
52
|
-
onSelectionChange?: OnSelectionChangeFunc;
|
|
53
|
-
onRowClick?: (rowIndex: number, row: any) => void;
|
|
54
|
-
onRowDoubleClick?: (rowIndex: number, row: any) => void;
|
|
55
|
-
onLimitChange?: (v: number) => void;
|
|
56
|
-
onSkipChange?: (v: number) => void;
|
|
57
|
-
skip?: number;
|
|
58
|
-
limit?: number;
|
|
59
|
-
loading?: boolean;
|
|
60
|
-
dark?: boolean;
|
|
61
|
-
allowChildRows?: boolean;
|
|
62
|
-
looseCacheCheck?: boolean;
|
|
63
|
-
className?: string;
|
|
64
|
-
};
|
|
65
|
-
export declare function AzGrid(props: AzGridProps): JSX.Element;
|
|
66
|
-
export default AzGrid;
|