@alfalab/core-components-table 2.0.3 → 2.1.2
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/component.d.ts +3 -2
- package/component.js +1 -1
- package/components/index.js +1 -1
- package/components/pagination/Component.js +2 -2
- package/components/pagination/index.css +8 -8
- package/components/pagination/index.js +1 -1
- package/components/pagination/select-field/index.css +4 -4
- package/components/pagination/select-field/index.js +2 -2
- package/components/table/Component.d.ts +8 -0
- package/components/table/Component.js +9 -4
- package/components/table/index.css +6 -6
- package/components/table/index.js +1 -1
- package/components/table/utils.js +1 -1
- package/components/table-context/index.d.ts +1 -0
- package/components/table-context/index.js +1 -0
- package/components/tbody/Component.js +2 -2
- package/components/tbody/index.css +2 -2
- package/components/tbody/index.js +1 -1
- package/components/tcell/Component.d.ts +1 -1
- package/components/tcell/Component.js +6 -4
- package/components/tcell/index.css +15 -7
- package/components/tcell/index.js +1 -1
- package/components/texpandable-row/Component.js +2 -2
- package/components/texpandable-row/index.css +5 -5
- package/components/texpandable-row/index.js +1 -1
- package/components/thead/Component.js +2 -2
- package/components/thead/index.css +11 -8
- package/components/thead/index.js +1 -1
- package/components/thead-cell/Component.d.ts +1 -1
- package/components/thead-cell/Component.js +7 -3
- package/components/thead-cell/index.css +16 -8
- package/components/thead-cell/index.js +2 -1
- package/components/trow/Component.js +2 -2
- package/components/trow/index.css +8 -8
- package/components/trow/index.js +1 -1
- package/components/tsortable-head-cell/Component.js +3 -2
- package/components/tsortable-head-cell/index.css +9 -9
- package/components/tsortable-head-cell/index.js +2 -1
- package/components/tsortable-head-cell/sort-icon-asc.js +1 -1
- package/components/tsortable-head-cell/sort-icon-desc.js +1 -1
- package/components/tsortable-head-cell/sort-icon-unset.js +1 -1
- package/cssm/component.d.ts +3 -2
- package/cssm/components/table/Component.d.ts +8 -0
- package/cssm/components/table/Component.js +7 -2
- package/cssm/components/table-context/index.d.ts +1 -0
- package/cssm/components/table-context/index.js +1 -0
- package/cssm/components/tcell/Component.d.ts +1 -1
- package/cssm/components/tcell/Component.js +4 -2
- package/cssm/components/tcell/index.module.css +12 -4
- package/cssm/components/thead/index.module.css +5 -2
- package/cssm/components/thead-cell/Component.d.ts +1 -1
- package/cssm/components/thead-cell/Component.js +5 -1
- package/cssm/components/thead-cell/index.js +1 -0
- package/cssm/components/thead-cell/index.module.css +12 -4
- package/cssm/components/tsortable-head-cell/Component.js +1 -0
- package/cssm/components/tsortable-head-cell/index.js +1 -0
- package/esm/component.d.ts +3 -2
- package/esm/component.js +1 -1
- package/esm/components/index.js +1 -1
- package/esm/components/pagination/Component.js +2 -2
- package/esm/components/pagination/index.css +8 -8
- package/esm/components/pagination/index.js +1 -1
- package/esm/components/pagination/select-field/index.css +4 -4
- package/esm/components/pagination/select-field/index.js +2 -2
- package/esm/components/table/Component.d.ts +8 -0
- package/esm/components/table/Component.js +9 -4
- package/esm/components/table/index.css +6 -6
- package/esm/components/table/index.js +1 -1
- package/esm/components/table/utils.js +1 -1
- package/esm/components/table-context/index.d.ts +1 -0
- package/esm/components/table-context/index.js +1 -0
- package/esm/components/tbody/Component.js +2 -2
- package/esm/components/tbody/index.css +2 -2
- package/esm/components/tbody/index.js +1 -1
- package/esm/components/tcell/Component.d.ts +1 -1
- package/esm/components/tcell/Component.js +6 -4
- package/esm/components/tcell/index.css +15 -7
- package/esm/components/tcell/index.js +1 -1
- package/esm/components/texpandable-row/Component.js +2 -2
- package/esm/components/texpandable-row/index.css +5 -5
- package/esm/components/texpandable-row/index.js +1 -1
- package/esm/components/thead/Component.js +2 -2
- package/esm/components/thead/index.css +11 -8
- package/esm/components/thead/index.js +1 -1
- package/esm/components/thead-cell/Component.d.ts +1 -1
- package/esm/components/thead-cell/Component.js +8 -4
- package/esm/components/thead-cell/index.css +16 -8
- package/esm/components/thead-cell/index.js +2 -1
- package/esm/components/trow/Component.js +2 -2
- package/esm/components/trow/index.css +8 -8
- package/esm/components/trow/index.js +1 -1
- package/esm/components/tsortable-head-cell/Component.js +3 -2
- package/esm/components/tsortable-head-cell/index.css +9 -9
- package/esm/components/tsortable-head-cell/index.js +2 -1
- package/esm/components/tsortable-head-cell/sort-icon-asc.js +1 -1
- package/esm/components/tsortable-head-cell/sort-icon-desc.js +1 -1
- package/esm/components/tsortable-head-cell/sort-icon-unset.js +1 -1
- package/esm/index.js +1 -1
- package/esm/{tslib.es6-a4f1ccf0.d.ts → tslib.es6-fd2d5374.d.ts} +0 -0
- package/esm/{tslib.es6-a4f1ccf0.js → tslib.es6-fd2d5374.js} +0 -0
- package/index.js +1 -1
- package/modern/component.d.ts +3 -2
- package/modern/components/pagination/Component.js +1 -1
- package/modern/components/pagination/index.css +8 -8
- package/modern/components/pagination/select-field/index.css +4 -4
- package/modern/components/pagination/select-field/index.js +1 -1
- package/modern/components/table/Component.d.ts +8 -0
- package/modern/components/table/Component.js +8 -3
- package/modern/components/table/index.css +6 -6
- package/modern/components/table-context/index.d.ts +1 -0
- package/modern/components/table-context/index.js +1 -0
- package/modern/components/tbody/Component.js +1 -1
- package/modern/components/tbody/index.css +2 -2
- package/modern/components/tcell/Component.d.ts +1 -1
- package/modern/components/tcell/Component.js +5 -3
- package/modern/components/tcell/index.css +15 -7
- package/modern/components/texpandable-row/Component.js +1 -1
- package/modern/components/texpandable-row/index.css +5 -5
- package/modern/components/thead/Component.js +1 -1
- package/modern/components/thead/index.css +11 -8
- package/modern/components/thead-cell/Component.d.ts +1 -1
- package/modern/components/thead-cell/Component.js +9 -3
- package/modern/components/thead-cell/index.css +16 -8
- package/modern/components/thead-cell/index.js +1 -0
- package/modern/components/trow/Component.js +1 -1
- package/modern/components/trow/index.css +8 -8
- package/modern/components/tsortable-head-cell/Component.js +2 -1
- package/modern/components/tsortable-head-cell/index.css +9 -9
- package/modern/components/tsortable-head-cell/index.js +1 -0
- package/package.json +4 -4
- /package/{tslib.es6-ef36f34b.d.ts → tslib.es6-e0c7d064.d.ts} +0 -0
- /package/{tslib.es6-ef36f34b.js → tslib.es6-e0c7d064.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 11li2 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-border-primary: #dbdee1;
|
|
@@ -14,10 +14,11 @@
|
|
|
14
14
|
}
|
|
15
15
|
:root {
|
|
16
16
|
--gap-2xs: 4px;
|
|
17
|
+
--gap-s: 12px;
|
|
17
18
|
--gap-m: 16px;
|
|
18
19
|
--gap-2xl: 32px;
|
|
19
20
|
}
|
|
20
|
-
.
|
|
21
|
+
.table__component_1p6lp {
|
|
21
22
|
font-size: 12px;
|
|
22
23
|
line-height: 16px;
|
|
23
24
|
font-weight: 500;
|
|
@@ -28,18 +29,25 @@
|
|
|
28
29
|
position: relative;
|
|
29
30
|
text-align: left;
|
|
30
31
|
color: var(--color-light-text-primary);
|
|
31
|
-
padding: var(--gap-2xl) var(--gap-
|
|
32
|
+
padding: var(--gap-2xl) var(--gap-s) var(--gap-2xs);
|
|
32
33
|
border-bottom: 1px solid var(--color-light-border-primary);
|
|
33
34
|
background: var(--color-light-bg-primary);
|
|
34
35
|
vertical-align: top;
|
|
35
|
-
box-sizing: border-box
|
|
36
|
+
box-sizing: border-box
|
|
36
37
|
}
|
|
37
|
-
.
|
|
38
|
+
.table__component_1p6lp:first-child {
|
|
39
|
+
padding-left: var(--gap-m);
|
|
40
|
+
}
|
|
41
|
+
.table__component_1p6lp:last-child {
|
|
42
|
+
padding-right: var(--gap-m);
|
|
43
|
+
}
|
|
44
|
+
.table__sortable_1p6lp {
|
|
38
45
|
cursor: pointer;
|
|
39
46
|
}
|
|
40
|
-
.
|
|
47
|
+
.table__sorted_1p6lp {
|
|
41
48
|
color: var(--color-light-text-primary);
|
|
42
49
|
}
|
|
43
|
-
.
|
|
44
|
-
|
|
50
|
+
.table__compactHorizontal_1p6lp {
|
|
51
|
+
padding-left: 6px;
|
|
52
|
+
padding-right: 6px;
|
|
45
53
|
}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('../../tslib.es6-
|
|
5
|
+
require('../../tslib.es6-e0c7d064.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
|
+
require('../table-context/index.js');
|
|
8
9
|
var components_theadCell_Component = require('./Component.js');
|
|
9
10
|
|
|
10
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-e0c7d064.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
12
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
13
13
|
|
|
14
|
-
var styles = {"component":"
|
|
14
|
+
var styles = {"component":"table__component_1uama","withoutBorder":"table__withoutBorder_1uama","clickable":"table__clickable_1uama","selected":"table__selected_1uama"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
var TRow = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: r00mv */
|
|
2
2
|
:root {
|
|
3
3
|
--color-static-graphic-solitude: #e8f2fe;
|
|
4
4
|
}
|
|
@@ -14,30 +14,30 @@
|
|
|
14
14
|
|
|
15
15
|
/* Hard up */
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
.table__component_1uama {
|
|
18
18
|
padding-top: 1px;
|
|
19
19
|
width: 100%;
|
|
20
20
|
transition: background-color 0.2s;
|
|
21
21
|
box-sizing: border-box;
|
|
22
22
|
background: var(--color-light-bg-primary)
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.table__component_1uama:first-child td {
|
|
25
25
|
border-top: 0;
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.table__withoutBorder_1uama {
|
|
28
28
|
td {
|
|
29
29
|
border: none;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
.
|
|
32
|
+
.table__clickable_1uama {
|
|
33
33
|
cursor: pointer
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
.table__clickable_1uama:hover {
|
|
36
36
|
background-color: var(--color-light-bg-secondary);
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.table__selected_1uama {
|
|
39
39
|
background-color: #f2f8ff /* нет цвета в палитре */
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.table__selected_1uama:hover {
|
|
42
42
|
background-color: var(--color-static-graphic-solitude);
|
|
43
43
|
}
|
package/components/trow/index.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-e0c7d064.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
|
+
require('../table-context/index.js');
|
|
8
9
|
var components_theadCell_Component = require('../thead-cell/Component.js');
|
|
9
10
|
var components_tsortableHeadCell_sortIconAsc = require('./sort-icon-asc.js');
|
|
10
11
|
var components_tsortableHeadCell_sortIconDesc = require('./sort-icon-desc.js');
|
|
@@ -15,7 +16,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
15
16
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
17
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
17
18
|
|
|
18
|
-
var styles = {"component":"
|
|
19
|
+
var styles = {"component":"table__component_1jg4o","content":"table__content_1jg4o","icon":"table__icon_1jg4o","reverse":"table__reverse_1jg4o","sorted":"table__sorted_1jg4o"};
|
|
19
20
|
require('./index.css')
|
|
20
21
|
|
|
21
22
|
var TSortableHeadCell = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: o5thq */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-graphic-link: #007aff;
|
|
4
4
|
--color-light-graphic-primary: #0b1f35;
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
:root {
|
|
16
16
|
--gap-xs: 8px;
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.table__component_1jg4o {
|
|
19
19
|
position: relative;
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.table__content_1jg4o {
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: flex-start;
|
|
24
24
|
}
|
|
25
|
-
.
|
|
25
|
+
.table__icon_1jg4o {
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
margin-left: var(--gap-xs);
|
|
28
28
|
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
transition: color 0.2s ease;
|
|
36
36
|
flex-shrink: 0
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.table__icon_1jg4o:hover {
|
|
39
39
|
color: var(--color-light-graphic-primary);
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.table__reverse_1jg4o {
|
|
42
42
|
flex-direction: row-reverse
|
|
43
43
|
}
|
|
44
|
-
.
|
|
44
|
+
.table__reverse_1jg4o .table__icon_1jg4o {
|
|
45
45
|
margin-left: 0;
|
|
46
46
|
margin-right: var(--gap-xs);
|
|
47
47
|
}
|
|
48
|
-
.
|
|
48
|
+
.table__sorted_1jg4o {
|
|
49
49
|
color: var(--color-light-graphic-link)
|
|
50
50
|
}
|
|
51
|
-
.
|
|
51
|
+
.table__sorted_1jg4o:hover {
|
|
52
52
|
color: var(--color-light-graphic-link);
|
|
53
53
|
}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('../../tslib.es6-
|
|
5
|
+
require('../../tslib.es6-e0c7d064.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
|
+
require('../table-context/index.js');
|
|
8
9
|
require('../thead-cell/Component.js');
|
|
9
10
|
var components_tsortableHeadCell_Component = require('./Component.js');
|
|
10
11
|
require('./sort-icon-asc.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-e0c7d064.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-e0c7d064.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-e0c7d064.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
package/cssm/component.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const Table: import("react").ForwardRefExoticComponent<import("react").TableHTMLAttributes<HTMLTableElement> & {
|
|
3
3
|
compactView?: boolean | undefined;
|
|
4
|
+
compactHorizontal?: boolean | undefined;
|
|
4
5
|
className?: string | undefined;
|
|
5
6
|
children: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>[];
|
|
6
7
|
wrapper?: boolean | undefined;
|
|
@@ -9,9 +10,9 @@ declare const Table: import("react").ForwardRefExoticComponent<import("react").T
|
|
|
9
10
|
} & import("react").RefAttributes<HTMLTableElement>> & {
|
|
10
11
|
TBody: import("react").FC<import("./components/index").TBodyProps>;
|
|
11
12
|
THead: import("react").FC<import("./components/index").THeadProps>;
|
|
12
|
-
THeadCell: ({ children, className, dataTestId, style, width, textAlign, hidden, ...restProps }: import("./components/index").THeadCellProps) => JSX.Element;
|
|
13
|
+
THeadCell: ({ children, className, dataTestId, style, width, textAlign, hidden, ...restProps }: import("./components/index").THeadCellProps) => JSX.Element | null;
|
|
13
14
|
TSortableHeadCell: ({ children, className, defaultIsSortedDesc, isSortedDesc, textAlign, onSort, ...restProps }: import("./components/index").TSortableHeadCellProps) => JSX.Element;
|
|
14
|
-
TCell: ({ className, style, dataTestId, children, index, ...restProps }: import("./components/index").TCellProps) => JSX.Element;
|
|
15
|
+
TCell: ({ className, style, dataTestId, children, index, ...restProps }: import("./components/index").TCellProps) => JSX.Element | null;
|
|
15
16
|
TRow: ({ children, className, selected, withoutBorder, dataTestId, ...restProps }: import("./components/index").TRowProps) => JSX.Element;
|
|
16
17
|
TExpandableRow: ({ className, selected, expanded, defaultExpanded, onToggle, renderContent, ...restProps }: import("./components/index").TExpandableRowProps) => JSX.Element;
|
|
17
18
|
Pagination: import("react").FC<import("packages/pagination/src").PaginationProps & {
|
|
@@ -6,6 +6,10 @@ type TableProps = TableHTMLAttributes<HTMLTableElement> & {
|
|
|
6
6
|
* Компактный вид
|
|
7
7
|
*/
|
|
8
8
|
compactView?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Уменьшение горизонтальных паддингов
|
|
11
|
+
*/
|
|
12
|
+
compactHorizontal?: boolean;
|
|
9
13
|
/**
|
|
10
14
|
* Дополнительный класс
|
|
11
15
|
*/
|
|
@@ -32,6 +36,10 @@ declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttributes<H
|
|
|
32
36
|
* Компактный вид
|
|
33
37
|
*/
|
|
34
38
|
compactView?: boolean | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Уменьшение горизонтальных паддингов
|
|
41
|
+
*/
|
|
42
|
+
compactHorizontal?: boolean | undefined;
|
|
35
43
|
/**
|
|
36
44
|
* Дополнительный класс
|
|
37
45
|
*/
|
|
@@ -20,7 +20,7 @@ var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
|
20
20
|
|
|
21
21
|
var Table = React.forwardRef(function (_a, ref) {
|
|
22
22
|
var _b;
|
|
23
|
-
var className = _a.className, children = _a.children, _c = _a.compactView, compactView = _c === void 0 ? false : _c, _d = _a.wrapper, wrapper =
|
|
23
|
+
var className = _a.className, children = _a.children, _c = _a.compactView, compactView = _c === void 0 ? false : _c, _d = _a.compactHorizontal, compactHorizontal = _d === void 0 ? false : _d, _e = _a.wrapper, wrapper = _e === void 0 ? true : _e, pagination = _a.pagination, dataTestId = _a.dataTestId, restProps = tslib_es6.__rest(_a, ["className", "children", "compactView", "compactHorizontal", "wrapper", "pagination", "dataTestId"]);
|
|
24
24
|
var wrapperRef = React.useRef(null);
|
|
25
25
|
var columnsConfiguration = React.useMemo(function () {
|
|
26
26
|
return components_table_utils.findAllHeadCellsProps(children).map(function (columnProps, index) { return ({
|
|
@@ -30,7 +30,12 @@ var Table = React.forwardRef(function (_a, ref) {
|
|
|
30
30
|
index: index,
|
|
31
31
|
}); });
|
|
32
32
|
}, [children]);
|
|
33
|
-
return (React__default['default'].createElement(components_tableContext_index.TableContext.Provider, { value: {
|
|
33
|
+
return (React__default['default'].createElement(components_tableContext_index.TableContext.Provider, { value: {
|
|
34
|
+
columnsConfiguration: columnsConfiguration,
|
|
35
|
+
compactView: compactView,
|
|
36
|
+
compactHorizontal: compactHorizontal,
|
|
37
|
+
wrapperRef: wrapperRef,
|
|
38
|
+
} },
|
|
34
39
|
React__default['default'].createElement("div", { ref: wrapperRef, className: cn__default['default'](styles__default['default'].component, className, (_b = {},
|
|
35
40
|
_b[styles__default['default'].wrapper] = wrapper,
|
|
36
41
|
_b[styles__default['default'].hasPagination] = !!pagination,
|
|
@@ -11,6 +11,7 @@ type ColumnConfiguration = {
|
|
|
11
11
|
type TableContextType = {
|
|
12
12
|
columnsConfiguration: ColumnConfiguration[];
|
|
13
13
|
compactView: boolean;
|
|
14
|
+
compactHorizontal: boolean;
|
|
14
15
|
wrapperRef: RefObject<HTMLDivElement>;
|
|
15
16
|
};
|
|
16
17
|
declare const DEFAULT_TABLE_CONTEXT: TableContextType;
|
|
@@ -11,6 +11,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
11
11
|
var DEFAULT_TABLE_CONTEXT = {
|
|
12
12
|
columnsConfiguration: [],
|
|
13
13
|
compactView: false,
|
|
14
|
+
compactHorizontal: false,
|
|
14
15
|
wrapperRef: { current: null },
|
|
15
16
|
};
|
|
16
17
|
var TableContext = React__default['default'].createContext(DEFAULT_TABLE_CONTEXT);
|
|
@@ -14,5 +14,5 @@ type TCellProps = TdHTMLAttributes<HTMLTableCellElement> & {
|
|
|
14
14
|
*/
|
|
15
15
|
index?: number;
|
|
16
16
|
};
|
|
17
|
-
declare const TCell: ({ className, style, dataTestId, children, index, ...restProps }: TCellProps) => JSX.Element;
|
|
17
|
+
declare const TCell: ({ className, style, dataTestId, children, index, ...restProps }: TCellProps) => JSX.Element | null;
|
|
18
18
|
export { TCellProps, TCell };
|
|
@@ -16,12 +16,14 @@ var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
|
16
16
|
|
|
17
17
|
var TCell = function (_a) {
|
|
18
18
|
var className = _a.className, style = _a.style, dataTestId = _a.dataTestId, children = _a.children, index = _a.index, restProps = tslib_es6.__rest(_a, ["className", "style", "dataTestId", "children", "index"]);
|
|
19
|
-
var _b = React.useContext(components_tableContext_index.TableContext), columnsConfiguration = _b.columnsConfiguration, compactView = _b.compactView;
|
|
19
|
+
var _b = React.useContext(components_tableContext_index.TableContext), columnsConfiguration = _b.columnsConfiguration, compactView = _b.compactView, compactHorizontal = _b.compactHorizontal;
|
|
20
20
|
var column = index === undefined ? null : columnsConfiguration[index];
|
|
21
21
|
var width = column === null || column === void 0 ? void 0 : column.width;
|
|
22
22
|
var textAlign = column === null || column === void 0 ? void 0 : column.textAlign;
|
|
23
23
|
var hidden = (column === null || column === void 0 ? void 0 : column.hidden) || false;
|
|
24
|
-
|
|
24
|
+
if (hidden)
|
|
25
|
+
return null;
|
|
26
|
+
return (React__default['default'].createElement("td", tslib_es6.__assign({ className: cn__default['default'](styles__default['default'].component, className, compactView && styles__default['default'].compact, compactHorizontal && styles__default['default'].compactHorizontal), style: tslib_es6.__assign(tslib_es6.__assign({}, style), { width: width, textAlign: textAlign }), "data-test-id": dataTestId }, restProps), children));
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
exports.TCell = TCell;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
}
|
|
13
13
|
:root {
|
|
14
14
|
--gap-xs: 8px;
|
|
15
|
+
--gap-s: 12px;
|
|
15
16
|
--gap-m: 16px;
|
|
16
17
|
--gap-xl: 24px;
|
|
17
18
|
}
|
|
@@ -21,14 +22,21 @@
|
|
|
21
22
|
font-weight: 400;
|
|
22
23
|
|
|
23
24
|
color: var(--color-light-text-primary);
|
|
24
|
-
padding: var(--gap-xl) var(--gap-
|
|
25
|
+
padding: var(--gap-xl) var(--gap-s);
|
|
25
26
|
height: 72px;
|
|
26
27
|
border-top: 1px solid var(--color-light-border-primary);
|
|
27
28
|
vertical-align: top;
|
|
28
|
-
box-sizing: border-box
|
|
29
|
+
box-sizing: border-box
|
|
29
30
|
}
|
|
30
|
-
.
|
|
31
|
-
|
|
31
|
+
.component:first-child {
|
|
32
|
+
padding-left: var(--gap-m);
|
|
33
|
+
}
|
|
34
|
+
.component:last-child {
|
|
35
|
+
padding-right: var(--gap-m);
|
|
36
|
+
}
|
|
37
|
+
.compactHorizontal {
|
|
38
|
+
padding-left: 6px;
|
|
39
|
+
padding-right: 6px;
|
|
32
40
|
}
|
|
33
41
|
.compact {
|
|
34
42
|
padding-top: var(--gap-xs);
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
/* Hard up */
|
|
11
11
|
}
|
|
12
|
+
:root {
|
|
13
|
+
--gap-xs: 8px;
|
|
14
|
+
}
|
|
12
15
|
.component {
|
|
13
16
|
position: relative;
|
|
14
17
|
width: 100%;
|
|
@@ -22,8 +25,8 @@
|
|
|
22
25
|
|
|
23
26
|
width: 1px;
|
|
24
27
|
right: 0;
|
|
25
|
-
top:
|
|
26
|
-
bottom:
|
|
28
|
+
top: var(--gap-xs);
|
|
29
|
+
bottom: var(--gap-xs);
|
|
27
30
|
background-color: var(--color-light-graphic-quaternary);
|
|
28
31
|
}
|
|
29
32
|
.component th:after {
|
|
@@ -23,5 +23,5 @@ type THeadCellProps = ThHTMLAttributes<HTMLHeadingElement> & {
|
|
|
23
23
|
*/
|
|
24
24
|
dataTestId?: string;
|
|
25
25
|
};
|
|
26
|
-
declare const THeadCell: ({ children, className, dataTestId, style, width, textAlign, hidden, ...restProps }: THeadCellProps) => JSX.Element;
|
|
26
|
+
declare const THeadCell: ({ children, className, dataTestId, style, width, textAlign, hidden, ...restProps }: THeadCellProps) => JSX.Element | null;
|
|
27
27
|
export { THeadCellProps, THeadCell };
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib_es6 = require('../../tslib.es6-ce870b46.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
|
+
var components_tableContext_index = require('../table-context/index.js');
|
|
8
9
|
var styles = require('./index.module.css');
|
|
9
10
|
|
|
10
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -15,7 +16,10 @@ var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
|
15
16
|
|
|
16
17
|
var THeadCell = function (_a) {
|
|
17
18
|
var children = _a.children, className = _a.className, dataTestId = _a.dataTestId, style = _a.style, width = _a.width, textAlign = _a.textAlign, hidden = _a.hidden, restProps = tslib_es6.__rest(_a, ["children", "className", "dataTestId", "style", "width", "textAlign", "hidden"]);
|
|
18
|
-
|
|
19
|
+
var compactHorizontal = React.useContext(components_tableContext_index.TableContext).compactHorizontal;
|
|
20
|
+
if (hidden)
|
|
21
|
+
return null;
|
|
22
|
+
return (React__default['default'].createElement("th", tslib_es6.__assign({ className: cn__default['default'](styles__default['default'].component, className, compactHorizontal && styles__default['default'].compactHorizontal), style: tslib_es6.__assign(tslib_es6.__assign({}, style), { width: width, textAlign: textAlign }), "data-test-id": dataTestId }, restProps), children));
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
exports.THeadCell = THeadCell;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
require('../../tslib.es6-ce870b46.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
|
+
require('../table-context/index.js');
|
|
8
9
|
require('./index.module.css');
|
|
9
10
|
var components_theadCell_Component = require('./Component.js');
|
|
10
11
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
:root {
|
|
15
15
|
--gap-2xs: 4px;
|
|
16
|
+
--gap-s: 12px;
|
|
16
17
|
--gap-m: 16px;
|
|
17
18
|
--gap-2xl: 32px;
|
|
18
19
|
}
|
|
@@ -27,18 +28,25 @@
|
|
|
27
28
|
position: relative;
|
|
28
29
|
text-align: left;
|
|
29
30
|
color: var(--color-light-text-primary);
|
|
30
|
-
padding: var(--gap-2xl) var(--gap-
|
|
31
|
+
padding: var(--gap-2xl) var(--gap-s) var(--gap-2xs);
|
|
31
32
|
border-bottom: 1px solid var(--color-light-border-primary);
|
|
32
33
|
background: var(--color-light-bg-primary);
|
|
33
34
|
vertical-align: top;
|
|
34
|
-
box-sizing: border-box
|
|
35
|
+
box-sizing: border-box
|
|
35
36
|
}
|
|
37
|
+
.component:first-child {
|
|
38
|
+
padding-left: var(--gap-m);
|
|
39
|
+
}
|
|
40
|
+
.component:last-child {
|
|
41
|
+
padding-right: var(--gap-m);
|
|
42
|
+
}
|
|
36
43
|
.sortable {
|
|
37
44
|
cursor: pointer;
|
|
38
45
|
}
|
|
39
46
|
.sorted {
|
|
40
47
|
color: var(--color-light-text-primary);
|
|
41
48
|
}
|
|
42
|
-
.
|
|
43
|
-
|
|
49
|
+
.compactHorizontal {
|
|
50
|
+
padding-left: 6px;
|
|
51
|
+
padding-right: 6px;
|
|
44
52
|
}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib_es6 = require('../../tslib.es6-ce870b46.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
|
+
require('../table-context/index.js');
|
|
8
9
|
require('../thead-cell/index.module.css');
|
|
9
10
|
var components_theadCell_Component = require('../thead-cell/Component.js');
|
|
10
11
|
var styles = require('./index.module.css');
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
require('../../tslib.es6-ce870b46.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
|
+
require('../table-context/index.js');
|
|
8
9
|
require('../thead-cell/index.module.css');
|
|
9
10
|
require('../thead-cell/Component.js');
|
|
10
11
|
require('./index.module.css');
|
package/esm/component.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const Table: import("react").ForwardRefExoticComponent<import("react").TableHTMLAttributes<HTMLTableElement> & {
|
|
3
3
|
compactView?: boolean | undefined;
|
|
4
|
+
compactHorizontal?: boolean | undefined;
|
|
4
5
|
className?: string | undefined;
|
|
5
6
|
children: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>[];
|
|
6
7
|
wrapper?: boolean | undefined;
|
|
@@ -9,9 +10,9 @@ declare const Table: import("react").ForwardRefExoticComponent<import("react").T
|
|
|
9
10
|
} & import("react").RefAttributes<HTMLTableElement>> & {
|
|
10
11
|
TBody: import("react").FC<import("./components/index").TBodyProps>;
|
|
11
12
|
THead: import("react").FC<import("./components/index").THeadProps>;
|
|
12
|
-
THeadCell: ({ children, className, dataTestId, style, width, textAlign, hidden, ...restProps }: import("./components/index").THeadCellProps) => JSX.Element;
|
|
13
|
+
THeadCell: ({ children, className, dataTestId, style, width, textAlign, hidden, ...restProps }: import("./components/index").THeadCellProps) => JSX.Element | null;
|
|
13
14
|
TSortableHeadCell: ({ children, className, defaultIsSortedDesc, isSortedDesc, textAlign, onSort, ...restProps }: import("./components/index").TSortableHeadCellProps) => JSX.Element;
|
|
14
|
-
TCell: ({ className, style, dataTestId, children, index, ...restProps }: import("./components/index").TCellProps) => JSX.Element;
|
|
15
|
+
TCell: ({ className, style, dataTestId, children, index, ...restProps }: import("./components/index").TCellProps) => JSX.Element | null;
|
|
15
16
|
TRow: ({ children, className, selected, withoutBorder, dataTestId, ...restProps }: import("./components/index").TRowProps) => JSX.Element;
|
|
16
17
|
TExpandableRow: ({ className, selected, expanded, defaultExpanded, onToggle, renderContent, ...restProps }: import("./components/index").TExpandableRowProps) => JSX.Element;
|
|
17
18
|
Pagination: import("react").FC<import("packages/pagination/src").PaginationProps & {
|
package/esm/component.js
CHANGED
package/esm/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign } from '../../tslib.es6-
|
|
1
|
+
import { _ as __rest, a as __assign } from '../../tslib.es6-fd2d5374.js';
|
|
2
2
|
import React, { useContext, useMemo, useCallback } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { TableContext } from '../table-context/index.js';
|
|
@@ -7,7 +7,7 @@ import { Pagination as Pagination$1 } from '@alfalab/core-components-pagination/
|
|
|
7
7
|
import '@alfalab/core-components-button/esm';
|
|
8
8
|
import { CustomSelectField } from './select-field/index.js';
|
|
9
9
|
|
|
10
|
-
var styles = {"component":"
|
|
10
|
+
var styles = {"component":"table__component_1qxwc","pagesWrapper":"table__pagesWrapper_1qxwc","tag":"table__tag_1qxwc","tagActive":"table__tagActive_1qxwc","menu":"table__menu_1qxwc","option":"table__option_1qxwc"};
|
|
11
11
|
require('./index.css')
|
|
12
12
|
|
|
13
13
|
var Pagination = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1ffu9 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-border-primary: #dbdee1;
|
|
4
4
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
--gap-xl: 24px;
|
|
18
18
|
--gap-2xl: 32px;
|
|
19
19
|
}
|
|
20
|
-
.
|
|
20
|
+
.table__component_1qxwc {
|
|
21
21
|
display: flex;
|
|
22
22
|
justify-content: space-between;
|
|
23
23
|
align-items: flex-start;
|
|
@@ -26,24 +26,24 @@
|
|
|
26
26
|
border-top: 1px solid var(--color-light-border-primary);
|
|
27
27
|
box-sizing: border-box;
|
|
28
28
|
}
|
|
29
|
-
.
|
|
29
|
+
.table__pagesWrapper_1qxwc {
|
|
30
30
|
display: flex;
|
|
31
31
|
}
|
|
32
|
-
.
|
|
32
|
+
.table__tag_1qxwc.table__tag_1qxwc {
|
|
33
33
|
flex-shrink: 0;
|
|
34
34
|
margin-right: var(--gap-xs);
|
|
35
35
|
padding: 0 var(--gap-xs);
|
|
36
36
|
min-width: 32px
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.table__tag_1qxwc.table__tag_1qxwc:last-child {
|
|
39
39
|
margin-right: 0;
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.table__tag_1qxwc.table__tag_1qxwc.table__tagActive_1qxwc {
|
|
42
42
|
cursor: default;
|
|
43
43
|
}
|
|
44
|
-
.
|
|
44
|
+
.table__menu_1qxwc {
|
|
45
45
|
margin: var(--gap-2xs) 0;
|
|
46
46
|
}
|
|
47
|
-
.
|
|
47
|
+
.table__option_1qxwc {
|
|
48
48
|
min-width: 208px;
|
|
49
49
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1tob6 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-specialbg-component-shade-7: rgba(10, 29, 49, 0.1351);
|
|
4
4
|
}
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
/* Hard up */
|
|
12
12
|
}
|
|
13
|
-
.
|
|
13
|
+
.table__field_6vphk svg {
|
|
14
14
|
width: 18px;
|
|
15
15
|
height: 18px;
|
|
16
16
|
}
|
|
17
|
-
.
|
|
18
|
-
.
|
|
17
|
+
.table__open_6vphk,
|
|
18
|
+
.table__open_6vphk:hover {
|
|
19
19
|
background-color: var(--color-light-specialbg-component-shade-7);
|
|
20
20
|
}
|