@alfalab/core-components-table 2.1.14 → 2.2.0

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 (123) hide show
  1. package/component.d.ts +1 -0
  2. package/component.js +1 -1
  3. package/components/index.js +1 -1
  4. package/components/pagination/Component.js +2 -2
  5. package/components/pagination/index.css +8 -8
  6. package/components/pagination/index.js +1 -1
  7. package/components/pagination/select-field/index.css +4 -4
  8. package/components/pagination/select-field/index.js +2 -2
  9. package/components/table/Component.d.ts +8 -0
  10. package/components/table/Component.js +5 -3
  11. package/components/table/index.css +9 -6
  12. package/components/table/index.js +1 -1
  13. package/components/table/utils.js +1 -1
  14. package/components/table-context/index.d.ts +1 -0
  15. package/components/table-context/index.js +1 -0
  16. package/components/tbody/Component.js +2 -2
  17. package/components/tbody/index.css +2 -2
  18. package/components/tbody/index.js +1 -1
  19. package/components/tcell/Component.js +2 -2
  20. package/components/tcell/index.css +6 -6
  21. package/components/tcell/index.js +1 -1
  22. package/components/texpandable-row/Component.js +2 -2
  23. package/components/texpandable-row/index.css +5 -5
  24. package/components/texpandable-row/index.js +1 -1
  25. package/components/thead/Component.js +2 -2
  26. package/components/thead/index.css +6 -6
  27. package/components/thead/index.js +1 -1
  28. package/components/thead-cell/Component.js +7 -4
  29. package/components/thead-cell/index.css +14 -7
  30. package/components/thead-cell/index.js +1 -1
  31. package/components/trow/Component.js +2 -2
  32. package/components/trow/index.css +8 -10
  33. package/components/trow/index.js +1 -1
  34. package/components/tsortable-head-cell/Component.js +2 -2
  35. package/components/tsortable-head-cell/index.css +9 -9
  36. package/components/tsortable-head-cell/index.js +1 -1
  37. package/components/tsortable-head-cell/sort-icon-asc.js +1 -1
  38. package/components/tsortable-head-cell/sort-icon-desc.js +1 -1
  39. package/components/tsortable-head-cell/sort-icon-unset.js +1 -1
  40. package/cssm/component.d.ts +1 -0
  41. package/cssm/components/table/Component.d.ts +8 -0
  42. package/cssm/components/table/Component.js +3 -1
  43. package/cssm/components/table/index.module.css +3 -0
  44. package/cssm/components/table-context/index.d.ts +1 -0
  45. package/cssm/components/table-context/index.js +1 -0
  46. package/cssm/components/thead-cell/Component.js +5 -2
  47. package/cssm/components/thead-cell/index.module.css +7 -0
  48. package/cssm/components/trow/index.module.css +1 -3
  49. package/esm/component.d.ts +1 -0
  50. package/esm/component.js +1 -1
  51. package/esm/components/index.js +1 -1
  52. package/esm/components/pagination/Component.js +2 -2
  53. package/esm/components/pagination/index.css +8 -8
  54. package/esm/components/pagination/index.js +1 -1
  55. package/esm/components/pagination/select-field/index.css +4 -4
  56. package/esm/components/pagination/select-field/index.js +2 -2
  57. package/esm/components/table/Component.d.ts +8 -0
  58. package/esm/components/table/Component.js +5 -3
  59. package/esm/components/table/index.css +9 -6
  60. package/esm/components/table/index.js +1 -1
  61. package/esm/components/table/utils.js +1 -1
  62. package/esm/components/table-context/index.d.ts +1 -0
  63. package/esm/components/table-context/index.js +1 -0
  64. package/esm/components/tbody/Component.js +2 -2
  65. package/esm/components/tbody/index.css +2 -2
  66. package/esm/components/tbody/index.js +1 -1
  67. package/esm/components/tcell/Component.js +2 -2
  68. package/esm/components/tcell/index.css +6 -6
  69. package/esm/components/tcell/index.js +1 -1
  70. package/esm/components/texpandable-row/Component.js +2 -2
  71. package/esm/components/texpandable-row/index.css +5 -5
  72. package/esm/components/texpandable-row/index.js +1 -1
  73. package/esm/components/thead/Component.js +2 -2
  74. package/esm/components/thead/index.css +6 -6
  75. package/esm/components/thead/index.js +1 -1
  76. package/esm/components/thead-cell/Component.js +7 -4
  77. package/esm/components/thead-cell/index.css +14 -7
  78. package/esm/components/thead-cell/index.js +1 -1
  79. package/esm/components/trow/Component.js +2 -2
  80. package/esm/components/trow/index.css +8 -10
  81. package/esm/components/trow/index.js +1 -1
  82. package/esm/components/tsortable-head-cell/Component.js +2 -2
  83. package/esm/components/tsortable-head-cell/index.css +9 -9
  84. package/esm/components/tsortable-head-cell/index.js +1 -1
  85. package/esm/components/tsortable-head-cell/sort-icon-asc.js +1 -1
  86. package/esm/components/tsortable-head-cell/sort-icon-desc.js +1 -1
  87. package/esm/components/tsortable-head-cell/sort-icon-unset.js +1 -1
  88. package/esm/index.js +1 -1
  89. package/esm/{tslib.es6-de554ff0.d.ts → tslib.es6-7d90e6df.d.ts} +0 -0
  90. package/esm/{tslib.es6-de554ff0.js → tslib.es6-7d90e6df.js} +0 -0
  91. package/index.js +1 -1
  92. package/modern/component.d.ts +1 -0
  93. package/modern/components/pagination/Component.js +2 -2
  94. package/modern/components/pagination/index.css +8 -8
  95. package/modern/components/pagination/select-field/index.css +4 -4
  96. package/modern/components/pagination/select-field/index.js +1 -1
  97. package/modern/components/table/Component.d.ts +8 -0
  98. package/modern/components/table/Component.js +4 -2
  99. package/modern/components/table/index.css +9 -6
  100. package/modern/components/table/utils.js +2 -2
  101. package/modern/components/table-context/index.d.ts +1 -0
  102. package/modern/components/table-context/index.js +1 -0
  103. package/modern/components/tbody/Component.js +1 -1
  104. package/modern/components/tbody/index.css +2 -2
  105. package/modern/components/tcell/Component.js +1 -1
  106. package/modern/components/tcell/index.css +6 -6
  107. package/modern/components/texpandable-row/Component.js +1 -1
  108. package/modern/components/texpandable-row/index.css +5 -5
  109. package/modern/components/thead/Component.js +1 -1
  110. package/modern/components/thead/index.css +6 -6
  111. package/modern/components/thead-cell/Component.js +5 -3
  112. package/modern/components/thead-cell/index.css +14 -7
  113. package/modern/components/trow/Component.js +1 -1
  114. package/modern/components/trow/index.css +8 -10
  115. package/modern/components/tsortable-head-cell/Component.js +1 -1
  116. package/modern/components/tsortable-head-cell/index.css +9 -9
  117. package/modern/components/tsortable-head-cell/sort-icon-asc.js +1 -1
  118. package/modern/components/tsortable-head-cell/sort-icon-desc.js +1 -1
  119. package/modern/components/tsortable-head-cell/sort-icon-unset.js +1 -1
  120. package/package.json +2 -2
  121. package/send-stats.js +1 -1
  122. /package/{tslib.es6-88e029d7.d.ts → tslib.es6-b406adfc.d.ts} +0 -0
  123. /package/{tslib.es6-88e029d7.js → tslib.es6-b406adfc.js} +0 -0
@@ -1,4 +1,4 @@
1
- import '../../tslib.es6-de554ff0.js';
1
+ import '../../tslib.es6-7d90e6df.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import '../table-context/index.js';
@@ -1,9 +1,9 @@
1
- import { _ as __rest, a as __assign } from '../../tslib.es6-de554ff0.js';
1
+ import { _ as __rest, a as __assign } from '../../tslib.es6-7d90e6df.js';
2
2
  import React, { useState } from 'react';
3
3
  import cn from 'classnames';
4
4
  import { TRow } from '../trow/Component.js';
5
5
 
6
- var styles = {"row":"table__row_1vip8","selected":"table__selected_1vip8","expanded":"table__expanded_1vip8","expandable":"table__expandable_1vip8"};
6
+ var styles = {"row":"table__row_5mla0","selected":"table__selected_5mla0","expanded":"table__expanded_5mla0","expandable":"table__expandable_5mla0"};
7
7
  require('./index.css')
8
8
 
9
9
  var TExpandableRow = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1t653 */
1
+ /* hash: 19qfj */
2
2
  :root {
3
3
 
4
4
  /* Hard */
@@ -7,16 +7,16 @@
7
7
 
8
8
  /* Hard up */
9
9
  }
10
- .table__row_1vip8 {
10
+ .table__row_5mla0 {
11
11
  cursor: pointer;
12
12
  }
13
- .table__selected_1vip8.table__expanded_1vip8 {
13
+ .table__selected_5mla0.table__expanded_5mla0 {
14
14
  background-color: inherit;
15
15
  }
16
- .table__expanded_1vip8:hover {
16
+ .table__expanded_5mla0:hover {
17
17
  background-color: inherit;
18
18
  }
19
- .table__expandable_1vip8 td {
19
+ .table__expandable_5mla0 td {
20
20
  margin: 0;
21
21
  padding-top: 0;
22
22
  padding-bottom: 0;
@@ -1,4 +1,4 @@
1
- import '../../tslib.es6-de554ff0.js';
1
+ import '../../tslib.es6-7d90e6df.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import '../trow/Component.js';
@@ -1,8 +1,8 @@
1
- import { _ as __rest, a as __assign } from '../../tslib.es6-de554ff0.js';
1
+ import { _ as __rest, a as __assign } from '../../tslib.es6-7d90e6df.js';
2
2
  import React from 'react';
3
3
  import cn from 'classnames';
4
4
 
5
- var styles = {"component":"table__component_x3k0x","row":"table__row_x3k0x"};
5
+ var styles = {"component":"table__component_nyjx6","row":"table__row_nyjx6"};
6
6
  require('./index.css')
7
7
 
8
8
  var THead = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 1h5ld */
1
+ /* hash: y18qv */
2
2
  :root {
3
3
  --color-light-graphic-quaternary: #dbdee1;
4
4
  }
@@ -13,12 +13,12 @@
13
13
  :root {
14
14
  --gap-xs: 8px;
15
15
  }
16
- .table__component_x3k0x {
16
+ .table__component_nyjx6 {
17
17
  position: relative;
18
18
  width: 100%;
19
19
  box-sizing: border-box
20
20
  }
21
- .table__component_x3k0x th:not(:last-child):not(:empty):after {
21
+ .table__component_nyjx6 th:not(:last-child):not(:empty):after {
22
22
  transition: opacity 0.2s;
23
23
  position: absolute;
24
24
  content: '';
@@ -30,12 +30,12 @@
30
30
  bottom: var(--gap-xs);
31
31
  background-color: var(--color-light-graphic-quaternary);
32
32
  }
33
- .table__component_x3k0x th:after {
33
+ .table__component_nyjx6 th:after {
34
34
  opacity: 0;
35
35
  }
36
- .table__component_x3k0x:hover th:after {
36
+ .table__component_nyjx6:hover th:after {
37
37
  opacity: 1;
38
38
  }
39
- .table__row_x3k0x {
39
+ .table__row_nyjx6 {
40
40
  height: 72px;
41
41
  }
@@ -1,4 +1,4 @@
1
- import '../../tslib.es6-de554ff0.js';
1
+ import '../../tslib.es6-7d90e6df.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  export { THead } from './Component.js';
@@ -1,17 +1,20 @@
1
- import { _ as __rest, a as __assign } from '../../tslib.es6-de554ff0.js';
1
+ import { _ as __rest, a as __assign } from '../../tslib.es6-7d90e6df.js';
2
2
  import React, { useContext } from 'react';
3
3
  import cn from 'classnames';
4
4
  import { TableContext } from '../table-context/index.js';
5
5
 
6
- var styles = {"component":"table__component_1fnfd","sortable":"table__sortable_1fnfd","sorted":"table__sorted_1fnfd","compactHorizontal":"table__compactHorizontal_1fnfd"};
6
+ var styles = {"component":"table__component_1vhhk","sortable":"table__sortable_1vhhk","sorted":"table__sorted_1vhhk","stickyHeader":"table__stickyHeader_1vhhk","compactHorizontal":"table__compactHorizontal_1vhhk"};
7
7
  require('./index.css')
8
8
 
9
9
  var THeadCell = function (_a) {
10
+ var _b;
10
11
  var children = _a.children, className = _a.className, dataTestId = _a.dataTestId, style = _a.style, width = _a.width, textAlign = _a.textAlign, hidden = _a.hidden, restProps = __rest(_a, ["children", "className", "dataTestId", "style", "width", "textAlign", "hidden"]);
11
- var compactHorizontal = useContext(TableContext).compactHorizontal;
12
+ var _c = useContext(TableContext), compactHorizontal = _c.compactHorizontal, stickyHeader = _c.stickyHeader;
12
13
  if (hidden)
13
14
  return null;
14
- return (React.createElement("th", __assign({ className: cn(styles.component, className, compactHorizontal && styles.compactHorizontal), style: __assign(__assign({}, style), { width: width, textAlign: textAlign }), "data-test-id": dataTestId }, restProps), children));
15
+ return (React.createElement("th", __assign({ className: cn(styles.component, className, compactHorizontal && styles.compactHorizontal, (_b = {},
16
+ _b[styles.stickyHeader] = stickyHeader,
17
+ _b)), style: __assign(__assign({}, style), { width: width, textAlign: textAlign }), "data-test-id": dataTestId }, restProps), children));
15
18
  };
16
19
 
17
20
  export { THeadCell };
@@ -1,4 +1,4 @@
1
- /* hash: 1p0ca */
1
+ /* hash: kwoub */
2
2
  :root {
3
3
  --color-light-bg-primary: #fff;
4
4
  --color-light-border-primary: #dbdee1;
@@ -18,7 +18,7 @@
18
18
  --gap-m: 16px;
19
19
  --gap-2xl: 32px;
20
20
  }
21
- .table__component_1fnfd {
21
+ .table__component_1vhhk {
22
22
  font-size: 12px;
23
23
  line-height: 16px;
24
24
  font-weight: 500;
@@ -35,19 +35,26 @@
35
35
  vertical-align: top;
36
36
  box-sizing: border-box
37
37
  }
38
- .table__component_1fnfd:first-child {
38
+ .table__component_1vhhk:first-child {
39
39
  padding-left: var(--gap-m);
40
40
  }
41
- .table__component_1fnfd:last-child {
41
+ .table__component_1vhhk:last-child {
42
42
  padding-right: var(--gap-m);
43
43
  }
44
- .table__sortable_1fnfd {
44
+ .table__sortable_1vhhk {
45
45
  cursor: pointer;
46
46
  }
47
- .table__sorted_1fnfd {
47
+ .table__sorted_1vhhk {
48
48
  color: var(--color-light-text-primary);
49
49
  }
50
- .table__compactHorizontal_1fnfd {
50
+ .table__stickyHeader_1vhhk {
51
+ top: 0;
52
+ position: sticky;
53
+ box-shadow: inset 0 -1px 0 0 rgba(11, 31, 53, 0.16);
54
+ border: none;
55
+ z-index: 1;
56
+ }
57
+ .table__compactHorizontal_1vhhk {
51
58
  padding-left: 6px;
52
59
  padding-right: 6px;
53
60
  }
@@ -1,4 +1,4 @@
1
- import '../../tslib.es6-de554ff0.js';
1
+ import '../../tslib.es6-7d90e6df.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import '../table-context/index.js';
@@ -1,8 +1,8 @@
1
- import { _ as __rest, a as __assign } from '../../tslib.es6-de554ff0.js';
1
+ import { _ as __rest, a as __assign } from '../../tslib.es6-7d90e6df.js';
2
2
  import React from 'react';
3
3
  import cn from 'classnames';
4
4
 
5
- var styles = {"component":"table__component_q5ojc","withoutBorder":"table__withoutBorder_q5ojc","clickable":"table__clickable_q5ojc","selected":"table__selected_q5ojc"};
5
+ var styles = {"component":"table__component_h0ofl","withoutBorder":"table__withoutBorder_h0ofl","clickable":"table__clickable_h0ofl","selected":"table__selected_h0ofl"};
6
6
  require('./index.css')
7
7
 
8
8
  var TRow = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 13nfy */
1
+ /* hash: k7qds */
2
2
  :root {
3
3
  --color-static-graphic-solitude: #e8f2fe;
4
4
  }
@@ -14,30 +14,28 @@
14
14
 
15
15
  /* Hard up */
16
16
  }
17
- .table__component_q5ojc {
17
+ .table__component_h0ofl {
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
- .table__component_q5ojc:first-child td {
24
+ .table__component_h0ofl:first-child td {
25
25
  border-top: 0;
26
26
  }
27
- .table__withoutBorder_q5ojc {
28
- td {
27
+ .table__withoutBorder_h0ofl td {
29
28
  border: none;
30
29
  }
31
- }
32
- .table__clickable_q5ojc {
30
+ .table__clickable_h0ofl {
33
31
  cursor: pointer
34
32
  }
35
- .table__clickable_q5ojc:hover {
33
+ .table__clickable_h0ofl:hover {
36
34
  background-color: var(--color-light-bg-secondary);
37
35
  }
38
- .table__selected_q5ojc {
36
+ .table__selected_h0ofl {
39
37
  background-color: #f2f8ff /* нет цвета в палитре */
40
38
  }
41
- .table__selected_q5ojc:hover {
39
+ .table__selected_h0ofl:hover {
42
40
  background-color: var(--color-static-graphic-solitude);
43
41
  }
@@ -1,4 +1,4 @@
1
- import '../../tslib.es6-de554ff0.js';
1
+ import '../../tslib.es6-7d90e6df.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  export { TRow } from './Component.js';
@@ -1,4 +1,4 @@
1
- import { _ as __rest, a as __assign } from '../../tslib.es6-de554ff0.js';
1
+ import { _ as __rest, a as __assign } from '../../tslib.es6-7d90e6df.js';
2
2
  import React, { useMemo } from 'react';
3
3
  import cn from 'classnames';
4
4
  import '../table-context/index.js';
@@ -7,7 +7,7 @@ import { SortIconAsc } from './sort-icon-asc.js';
7
7
  import { SortIconDesc } from './sort-icon-desc.js';
8
8
  import { SortIconUnset } from './sort-icon-unset.js';
9
9
 
10
- var styles = {"component":"table__component_xzgsk","content":"table__content_xzgsk","icon":"table__icon_xzgsk","reverse":"table__reverse_xzgsk","sorted":"table__sorted_xzgsk"};
10
+ var styles = {"component":"table__component_ougot","content":"table__content_ougot","icon":"table__icon_ougot","reverse":"table__reverse_ougot","sorted":"table__sorted_ougot"};
11
11
  require('./index.css')
12
12
 
13
13
  var TSortableHeadCell = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 14y24 */
1
+ /* hash: 1o2eq */
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
- .table__component_xzgsk {
18
+ .table__component_ougot {
19
19
  position: relative;
20
20
  }
21
- .table__content_xzgsk {
21
+ .table__content_ougot {
22
22
  display: flex;
23
23
  align-items: flex-start;
24
24
  }
25
- .table__icon_xzgsk {
25
+ .table__icon_ougot {
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
- .table__icon_xzgsk:hover {
38
+ .table__icon_ougot:hover {
39
39
  color: var(--color-light-graphic-primary);
40
40
  }
41
- .table__reverse_xzgsk {
41
+ .table__reverse_ougot {
42
42
  flex-direction: row-reverse
43
43
  }
44
- .table__reverse_xzgsk .table__icon_xzgsk {
44
+ .table__reverse_ougot .table__icon_ougot {
45
45
  margin-left: 0;
46
46
  margin-right: var(--gap-xs);
47
47
  }
48
- .table__sorted_xzgsk {
48
+ .table__sorted_ougot {
49
49
  color: var(--color-light-graphic-link)
50
50
  }
51
- .table__sorted_xzgsk:hover {
51
+ .table__sorted_ougot:hover {
52
52
  color: var(--color-light-graphic-link);
53
53
  }
@@ -1,4 +1,4 @@
1
- import '../../tslib.es6-de554ff0.js';
1
+ import '../../tslib.es6-7d90e6df.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import '../table-context/index.js';
@@ -1,4 +1,4 @@
1
- import { a as __assign } from '../../tslib.es6-de554ff0.js';
1
+ import { a as __assign } from '../../tslib.es6-7d90e6df.js';
2
2
  import React from 'react';
3
3
 
4
4
  var SortIconAsc = function (props) { return (React.createElement("svg", __assign({ width: '18', height: '18', viewBox: '0 0 18 18', fill: 'currentColor', xmlns: 'http://www.w3.org/2000/svg', focusable: 'false', role: 'img' }, props),
@@ -1,4 +1,4 @@
1
- import { a as __assign } from '../../tslib.es6-de554ff0.js';
1
+ import { a as __assign } from '../../tslib.es6-7d90e6df.js';
2
2
  import React from 'react';
3
3
 
4
4
  var SortIconDesc = function (props) { return (React.createElement("svg", __assign({ width: '18', height: '18', viewBox: '0 0 18 18', fill: 'currentColor', xmlns: 'http://www.w3.org/2000/svg', focusable: 'false', role: 'img' }, props),
@@ -1,4 +1,4 @@
1
- import { a as __assign } from '../../tslib.es6-de554ff0.js';
1
+ import { a as __assign } from '../../tslib.es6-7d90e6df.js';
2
2
  import React from 'react';
3
3
 
4
4
  var SortIconUnset = function (props) { return (React.createElement("svg", __assign({ width: '18', height: '18', viewBox: '0 0 18 18', fill: 'currentColor', xmlns: 'http://www.w3.org/2000/svg', focusable: 'false', role: 'img' }, props),
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './tslib.es6-de554ff0.js';
1
+ import './tslib.es6-7d90e6df.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import './components/table-context/index.js';
package/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('./tslib.es6-88e029d7.js');
5
+ require('./tslib.es6-b406adfc.js');
6
6
  require('react');
7
7
  require('classnames');
8
8
  require('./components/table-context/index.js');
@@ -7,6 +7,7 @@ declare const Table: import("react").ForwardRefExoticComponent<import("react").T
7
7
  wrapper?: boolean | undefined;
8
8
  pagination?: import("react").ReactNode;
9
9
  dataTestId?: string | undefined;
10
+ stickyHeader?: boolean | undefined;
10
11
  } & import("react").RefAttributes<HTMLTableElement>> & {
11
12
  TBody: import("react").FC<import("./components/index").TBodyProps>;
12
13
  THead: import("react").FC<import("./components/index").THeadProps>;
@@ -6,14 +6,14 @@ import { Select } from '@alfalab/core-components-select/modern';
6
6
  import '@alfalab/core-components-button/modern';
7
7
  import { CustomSelectField } from './select-field/index.js';
8
8
 
9
- var styles = {"component":"table__component_3ived","pagesWrapper":"table__pagesWrapper_3ived","tag":"table__tag_3ived","tagActive":"table__tagActive_3ived","menu":"table__menu_3ived","option":"table__option_3ived"};
9
+ var styles = {"component":"table__component_1mpx8","pagesWrapper":"table__pagesWrapper_1mpx8","tag":"table__tag_1mpx8","tagActive":"table__tagActive_1mpx8","menu":"table__menu_1mpx8","option":"table__option_1mpx8"};
10
10
  require('./index.css')
11
11
 
12
12
  const Pagination = ({ perPage = 25, possiblePerPage = [25, 50, 100], onPerPageChange = () => null, pagesCount, onPageChange = () => null, className, dataTestId, ...restPaginationProps }) => {
13
13
  const { wrapperRef } = useContext(TableContext);
14
14
  const options = useMemo(() => Array.from(new Set(possiblePerPage.concat(perPage)))
15
15
  .sort((a, b) => a - b)
16
- .map(value => ({
16
+ .map((value) => ({
17
17
  key: value.toString(),
18
18
  content: `Показывать по ${value}`,
19
19
  })), [perPage, possiblePerPage]);
@@ -1,4 +1,4 @@
1
- /* hash: an7dd */
1
+ /* hash: 1klmf */
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
- .table__component_3ived {
20
+ .table__component_1mpx8 {
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
- .table__pagesWrapper_3ived {
29
+ .table__pagesWrapper_1mpx8 {
30
30
  display: flex;
31
31
  }
32
- .table__tag_3ived.table__tag_3ived {
32
+ .table__tag_1mpx8.table__tag_1mpx8 {
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
- .table__tag_3ived.table__tag_3ived:last-child {
38
+ .table__tag_1mpx8.table__tag_1mpx8:last-child {
39
39
  margin-right: 0;
40
40
  }
41
- .table__tag_3ived.table__tag_3ived.table__tagActive_3ived {
41
+ .table__tag_1mpx8.table__tag_1mpx8.table__tagActive_1mpx8 {
42
42
  cursor: default;
43
43
  }
44
- .table__menu_3ived {
44
+ .table__menu_1mpx8 {
45
45
  margin: var(--gap-2xs) 0;
46
46
  }
47
- .table__option_3ived {
47
+ .table__option_1mpx8 {
48
48
  min-width: 208px;
49
49
  }
@@ -1,4 +1,4 @@
1
- /* hash: p1tfx */
1
+ /* hash: 1z08i */
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
- .table__field_ihslj svg {
13
+ .table__field_2nqe0 svg {
14
14
  width: 18px;
15
15
  height: 18px;
16
16
  }
17
- .table__open_ihslj,
18
- .table__open_ihslj:hover {
17
+ .table__open_2nqe0,
18
+ .table__open_2nqe0:hover {
19
19
  background-color: var(--color-light-specialbg-component-shade-7);
20
20
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Button } from '@alfalab/core-components-button/modern';
4
4
 
5
- var styles = {"field":"table__field_ihslj","open":"table__open_ihslj"};
5
+ var styles = {"field":"table__field_2nqe0","open":"table__open_2nqe0"};
6
6
  require('./index.css')
7
7
 
8
8
  const CustomSelectField = ({ selected, innerProps, Arrow, open }) => {
@@ -30,6 +30,10 @@ type TableProps = TableHTMLAttributes<HTMLTableElement> & {
30
30
  * Идентификатор для систем автоматизированного тестирования
31
31
  */
32
32
  dataTestId?: string;
33
+ /**
34
+ * Если true то заголовок будет фиксироваться при скроле
35
+ */
36
+ stickyHeader?: boolean;
33
37
  };
34
38
  declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttributes<HTMLTableElement> & {
35
39
  /**
@@ -60,5 +64,9 @@ declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttributes<H
60
64
  * Идентификатор для систем автоматизированного тестирования
61
65
  */
62
66
  dataTestId?: string | undefined;
67
+ /**
68
+ * Если true то заголовок будет фиксироваться при скроле
69
+ */
70
+ stickyHeader?: boolean | undefined;
63
71
  } & React.RefAttributes<HTMLTableElement>>;
64
72
  export { TableProps, Table };
@@ -5,10 +5,10 @@ import '../../utils.js';
5
5
  import '../thead/Component.js';
6
6
  import { findAllHeadCellsProps } from './utils.js';
7
7
 
8
- var styles = {"component":"table__component_ci4vy","wrapper":"table__wrapper_ci4vy","hasPagination":"table__hasPagination_ci4vy","table":"table__table_ci4vy"};
8
+ var styles = {"component":"table__component_3d4s6","wrapper":"table__wrapper_3d4s6","stickyHeader":"table__stickyHeader_3d4s6","hasPagination":"table__hasPagination_3d4s6","table":"table__table_3d4s6"};
9
9
  require('./index.css')
10
10
 
11
- const Table = forwardRef(({ className, children, compactView = false, compactHorizontal = false, wrapper = true, pagination, dataTestId, ...restProps }, ref) => {
11
+ const Table = forwardRef(({ className, children, compactView = false, compactHorizontal = false, wrapper = true, pagination, dataTestId, stickyHeader = false, ...restProps }, ref) => {
12
12
  const wrapperRef = useRef(null);
13
13
  const columnsConfiguration = useMemo(() => findAllHeadCellsProps(children).map((columnProps, index) => ({
14
14
  width: columnProps.width,
@@ -18,6 +18,7 @@ const Table = forwardRef(({ className, children, compactView = false, compactHor
18
18
  })), [children]);
19
19
  /* eslint-disable react/jsx-no-constructed-context-values */
20
20
  return (React.createElement(TableContext.Provider, { value: {
21
+ stickyHeader,
21
22
  columnsConfiguration,
22
23
  compactView,
23
24
  compactHorizontal,
@@ -26,6 +27,7 @@ const Table = forwardRef(({ className, children, compactView = false, compactHor
26
27
  React.createElement("div", { ref: wrapperRef, className: cn(styles.component, className, {
27
28
  [styles.wrapper]: wrapper,
28
29
  [styles.hasPagination]: !!pagination,
30
+ [styles.stickyHeader]: stickyHeader,
29
31
  }), "data-test-id": dataTestId },
30
32
  React.createElement("table", { ref: ref, className: styles.table, ...restProps }, children),
31
33
  pagination)));
@@ -1,4 +1,4 @@
1
- /* hash: 368qa */
1
+ /* hash: s5cz6 */
2
2
  :root {
3
3
  --color-light-bg-primary: #fff;
4
4
  }
@@ -18,26 +18,29 @@
18
18
  :root {
19
19
  --border-radius-m: 8px;
20
20
  }
21
- .table__component_ci4vy {
21
+ .table__component_3d4s6 {
22
22
  box-sizing: border-box;
23
23
  }
24
- .table__wrapper_ci4vy {
24
+ .table__wrapper_3d4s6 {
25
25
  padding: 0 var(--gap-m) var(--gap-m);
26
26
  background: var(--color-light-bg-primary);
27
27
  box-shadow: var(--shadow-xs-hard);
28
28
  border-radius: var(--border-radius-m);
29
29
  overflow: auto;
30
30
  }
31
- .table__hasPagination_ci4vy {
31
+ .table__stickyHeader_3d4s6 {
32
+ max-height: 100%;
33
+ }
34
+ .table__hasPagination_3d4s6 {
32
35
  padding-bottom: 0;
33
36
  }
34
- .table__table_ci4vy {
37
+ .table__table_3d4s6 {
35
38
  width: 100%;
36
39
  border-collapse: collapse;
37
40
  box-sizing: border-box
38
41
 
39
42
  /* TODO: Хак для выравнивания чекбокса */
40
43
  }
41
- .table__table_ci4vy td:first-child label > *[class^='box'], .table__table_ci4vy th:first-child label > *[class^='box'] {
44
+ .table__table_3d4s6 td:first-child label > *[class^='box'], .table__table_3d4s6 th:first-child label > *[class^='box'] {
42
45
  margin-top: 0;
43
46
  }
@@ -5,9 +5,9 @@ import { THead } from '../thead/Component.js';
5
5
 
6
6
  function findAllHeadCellsProps(children) {
7
7
  const result = [];
8
- React.Children.forEach(children, child => {
8
+ React.Children.forEach(children, (child) => {
9
9
  if (isChildInstanceOf(child, THead)) {
10
- React.Children.forEach(child.props.children, headChild => {
10
+ React.Children.forEach(child.props.children, (headChild) => {
11
11
  result.push(headChild.props);
12
12
  });
13
13
  }
@@ -10,6 +10,7 @@ type ColumnConfiguration = {
10
10
  };
11
11
  type TableContextType = {
12
12
  columnsConfiguration: ColumnConfiguration[];
13
+ stickyHeader: boolean;
13
14
  compactView: boolean;
14
15
  compactHorizontal: boolean;
15
16
  wrapperRef: RefObject<HTMLDivElement>;
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  const DEFAULT_TABLE_CONTEXT = {
4
4
  columnsConfiguration: [],
5
5
  compactView: false,
6
+ stickyHeader: false,
6
7
  compactHorizontal: false,
7
8
  wrapperRef: { current: null },
8
9
  };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
- var styles = {"component":"table__component_asmrb"};
4
+ var styles = {"component":"table__component_1tzol"};
5
5
  require('./index.css')
6
6
 
7
7
  const TBody = ({ className, children, dataTestId, ...restProps }) => (React.createElement("tbody", { className: cn(styles.component, className), "data-test-id": dataTestId, ...restProps }, children));
@@ -1,4 +1,4 @@
1
- /* hash: 1826l */
1
+ /* hash: 49w33 */
2
2
  :root {
3
3
 
4
4
  /* Hard */
@@ -7,7 +7,7 @@
7
7
 
8
8
  /* Hard up */
9
9
  }
10
- .table__component_asmrb {
10
+ .table__component_1tzol {
11
11
  width: 100%;
12
12
  box-sizing: border-box;
13
13
  }
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
2
2
  import cn from 'classnames';
3
3
  import { TableContext } from '../table-context/index.js';
4
4
 
5
- var styles = {"component":"table__component_4jfwm","compactHorizontal":"table__compactHorizontal_4jfwm","compact":"table__compact_4jfwm"};
5
+ var styles = {"component":"table__component_1ufju","compactHorizontal":"table__compactHorizontal_1ufju","compact":"table__compact_1ufju"};
6
6
  require('./index.css')
7
7
 
8
8
  const TCell = ({ className, style, dataTestId, children, index, ...restProps }) => {