@semcore/data-table 4.49.1 → 16.0.0-prerelease.10
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/CHANGELOG.md +6 -0
- package/lib/cjs/Body.js +10 -10
- package/lib/cjs/Body.js.map +1 -1
- package/lib/cjs/DataTable.js +47 -52
- package/lib/cjs/DataTable.js.map +1 -1
- package/lib/cjs/Head.js +6 -5
- package/lib/cjs/Head.js.map +1 -1
- package/lib/cjs/style/data-table.shadow.css +0 -19
- package/lib/es6/Body.js +11 -10
- package/lib/es6/Body.js.map +1 -1
- package/lib/es6/DataTable.js +48 -51
- package/lib/es6/DataTable.js.map +1 -1
- package/lib/es6/Head.js +6 -5
- package/lib/es6/Head.js.map +1 -1
- package/lib/es6/style/data-table.shadow.css +0 -19
- package/lib/esm/Body.mjs +344 -237
- package/lib/esm/DataTable.mjs +476 -336
- package/lib/esm/Head.mjs +318 -206
- package/lib/esm/index.mjs +6 -6
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +30 -30
- package/lib/esm/translations/de.json.mjs +5 -4
- package/lib/esm/translations/en.json.mjs +5 -4
- package/lib/esm/translations/es.json.mjs +5 -4
- package/lib/esm/translations/fr.json.mjs +5 -4
- package/lib/esm/translations/it.json.mjs +5 -4
- package/lib/esm/translations/ja.json.mjs +5 -4
- package/lib/esm/translations/ko.json.mjs +5 -4
- package/lib/esm/translations/nl.json.mjs +5 -4
- package/lib/esm/translations/pl.json.mjs +5 -4
- package/lib/esm/translations/pt.json.mjs +5 -4
- package/lib/esm/translations/sv.json.mjs +5 -4
- package/lib/esm/translations/tr.json.mjs +5 -4
- package/lib/esm/translations/vi.json.mjs +5 -4
- package/lib/esm/translations/zh.json.mjs +5 -4
- package/lib/esm/utils.mjs +44 -29
- package/lib/types/Body.d.ts +1 -1
- package/package.json +5 -8
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
var
|
|
16
|
-
de
|
|
17
|
-
en
|
|
18
|
-
es
|
|
19
|
-
fr
|
|
20
|
-
it
|
|
21
|
-
ja
|
|
22
|
-
ko
|
|
23
|
-
nl
|
|
24
|
-
pt
|
|
25
|
-
tr
|
|
26
|
-
vi
|
|
27
|
-
zh
|
|
28
|
-
pl
|
|
29
|
-
sv
|
|
1
|
+
import de from "./de.json.mjs";
|
|
2
|
+
import en from "./en.json.mjs";
|
|
3
|
+
import es from "./es.json.mjs";
|
|
4
|
+
import fr from "./fr.json.mjs";
|
|
5
|
+
import it from "./it.json.mjs";
|
|
6
|
+
import ja from "./ja.json.mjs";
|
|
7
|
+
import ko from "./ko.json.mjs";
|
|
8
|
+
import nl from "./nl.json.mjs";
|
|
9
|
+
import pt from "./pt.json.mjs";
|
|
10
|
+
import tr from "./tr.json.mjs";
|
|
11
|
+
import vi from "./vi.json.mjs";
|
|
12
|
+
import zh from "./zh.json.mjs";
|
|
13
|
+
import pl from "./pl.json.mjs";
|
|
14
|
+
import sv from "./sv.json.mjs";
|
|
15
|
+
var localizedMessages = {
|
|
16
|
+
de,
|
|
17
|
+
en,
|
|
18
|
+
es,
|
|
19
|
+
fr,
|
|
20
|
+
it,
|
|
21
|
+
ja,
|
|
22
|
+
ko,
|
|
23
|
+
nl,
|
|
24
|
+
pt,
|
|
25
|
+
tr,
|
|
26
|
+
vi,
|
|
27
|
+
zh,
|
|
28
|
+
pl,
|
|
29
|
+
sv
|
|
30
30
|
};
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
localizedMessages
|
|
33
33
|
};
|
package/lib/esm/utils.mjs
CHANGED
|
@@ -1,37 +1,52 @@
|
|
|
1
|
-
var
|
|
2
|
-
return
|
|
3
|
-
|
|
1
|
+
var getScrollOffsetValue = function getScrollOffsetValue2(columns) {
|
|
2
|
+
return columns.reduce(function(acc, column) {
|
|
3
|
+
if (column.fixed === "left") {
|
|
4
|
+
acc[0] += column.width;
|
|
5
|
+
}
|
|
6
|
+
if (column.fixed === "right") {
|
|
7
|
+
acc[1] += column.width;
|
|
8
|
+
}
|
|
9
|
+
return acc;
|
|
4
10
|
}, [0, 0]);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
};
|
|
12
|
+
var flattenColumns = function flattenColumns2(columns) {
|
|
13
|
+
return columns.reduce(function(acc, column) {
|
|
14
|
+
var hasNestedColumns = "columns" in column && column.columns.length > 0;
|
|
15
|
+
var columns2 = hasNestedColumns ? flattenColumns2(column.columns) : [column];
|
|
16
|
+
acc = acc.concat(columns2);
|
|
17
|
+
return acc;
|
|
9
18
|
}, []);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
};
|
|
20
|
+
var getFixedStyle = function getFixedStyle2(cell, columns) {
|
|
21
|
+
var side = cell.fixed;
|
|
22
|
+
if (!side) return [void 0, void 0];
|
|
23
|
+
var names = cell.name.split("/");
|
|
24
|
+
var nameSideMap = {
|
|
25
|
+
left: names[0],
|
|
26
|
+
right: names[names.length - 1]
|
|
27
|
+
};
|
|
28
|
+
var name = nameSideMap[side];
|
|
29
|
+
var index = columns.findIndex(function(column) {
|
|
30
|
+
return column.name === name;
|
|
18
31
|
});
|
|
19
|
-
if (
|
|
20
|
-
var
|
|
32
|
+
if (index === -1) return [void 0, void 0];
|
|
33
|
+
var startIndexSideMap = {
|
|
21
34
|
left: 0,
|
|
22
|
-
right:
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
35
|
+
right: index + 1
|
|
36
|
+
};
|
|
37
|
+
var endIndexSideMap = {
|
|
38
|
+
left: index,
|
|
39
|
+
right: columns.length
|
|
40
|
+
};
|
|
41
|
+
var columnsFixed = columns.slice(startIndexSideMap[side], endIndexSideMap[side]);
|
|
42
|
+
if (columnsFixed.length < 1) return [side, 0];
|
|
43
|
+
var vars = columnsFixed.map(function(column) {
|
|
44
|
+
return "var(--".concat(column.name, "_width)");
|
|
30
45
|
});
|
|
31
|
-
return [
|
|
46
|
+
return [side, vars.length === 1 ? vars[0] : "calc(".concat(vars.join(" + "), ")")];
|
|
32
47
|
};
|
|
33
48
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
49
|
+
flattenColumns,
|
|
50
|
+
getFixedStyle,
|
|
51
|
+
getScrollOffsetValue
|
|
37
52
|
};
|
package/lib/types/Body.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Component } from '@semcore/core';
|
|
3
3
|
import { RowData, Column, NestedCells, PropsLayer, Cell } from './types';
|
|
4
|
-
import syncScroll from '@semcore/
|
|
4
|
+
import syncScroll from '@semcore/core/lib/utils/syncScroll';
|
|
5
5
|
type AsProps = {
|
|
6
6
|
rows: NestedCells[][];
|
|
7
7
|
columns: Column[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/data-table",
|
|
3
3
|
"description": "Semrush DataTable Component",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "16.0.0-prerelease.10",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/
|
|
18
|
-
"@semcore/
|
|
19
|
-
"@semcore/scroll-area": "
|
|
20
|
-
"@semcore/utils": "4.48.1"
|
|
17
|
+
"@semcore/icon": "16.0.0-prerelease.10",
|
|
18
|
+
"@semcore/flex-box": "16.0.0-prerelease.10",
|
|
19
|
+
"@semcore/scroll-area": "16.0.0-prerelease.10"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
22
|
"@types/react": "18.0.21",
|
|
@@ -37,9 +36,7 @@
|
|
|
37
36
|
"csstype": "3.0.8"
|
|
38
37
|
},
|
|
39
38
|
"peerDependencies": {
|
|
40
|
-
"@semcore/
|
|
41
|
-
"react": "16.8 - 18",
|
|
42
|
-
"react-dom": "16.8 - 18"
|
|
39
|
+
"@semcore/base-components": "^16.0.0-prerelease.10"
|
|
43
40
|
},
|
|
44
41
|
"repository": {
|
|
45
42
|
"type": "git",
|