@salutejs/plasma-new-hope 0.317.0-dev.0 → 0.318.0-canary.1888.14216501427.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 (126) hide show
  1. package/cjs/components/Table/Table.css +24 -22
  2. package/cjs/components/Table/Table.js +11 -16
  3. package/cjs/components/Table/Table.js.map +1 -1
  4. package/cjs/components/Table/Table.styles.js +17 -11
  5. package/cjs/components/Table/Table.styles.js.map +1 -1
  6. package/cjs/components/Table/Table.styles_xngwgy.css +12 -0
  7. package/cjs/components/Table/Table.tokens.js +9 -0
  8. package/cjs/components/Table/Table.tokens.js.map +1 -1
  9. package/cjs/components/Table/ui/Cell/Cell.css +24 -22
  10. package/cjs/components/Table/ui/Cell/Cell.js.map +1 -1
  11. package/cjs/components/Table/ui/Cell/Cell.styles.js +1 -1
  12. package/cjs/components/Table/ui/Cell/Cell.styles.js.map +1 -1
  13. package/cjs/components/Table/ui/Cell/Cell.styles_1q2mjxm.css +1 -0
  14. package/cjs/components/Table/ui/EditableCell/EditableCell.css +25 -23
  15. package/cjs/components/Table/ui/EditableCell/EditableCell.js +15 -9
  16. package/cjs/components/Table/ui/EditableCell/EditableCell.js.map +1 -1
  17. package/cjs/components/Table/ui/EditableCell/EditableCell.styles.js +5 -5
  18. package/cjs/components/Table/ui/EditableCell/EditableCell.styles.js.map +1 -1
  19. package/{es/components/Table/ui/EditableCell/EditableCell.styles_277bjm.css → cjs/components/Table/ui/EditableCell/EditableCell.styles_1g3clv2.css} +3 -3
  20. package/cjs/components/Table/ui/HeadCell/HeadCell.css +24 -22
  21. package/cjs/components/Table/ui/HeadCell/HeadCell.js +9 -9
  22. package/cjs/components/Table/ui/HeadCell/HeadCell.js.map +1 -1
  23. package/cjs/components/Table/ui/HeadCell/HeadCell.styles.js +7 -1
  24. package/cjs/components/Table/ui/HeadCell/HeadCell.styles.js.map +1 -1
  25. package/{es/components/Table/ui/HeadCell/HeadCell.styles_1lo3lcf.css → cjs/components/Table/ui/HeadCell/HeadCell.styles_155gsrn.css} +1 -0
  26. package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.css +24 -22
  27. package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
  28. package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.js.map +1 -1
  29. package/cjs/index.css +26 -24
  30. package/emotion/cjs/components/Table/Table.js +14 -16
  31. package/emotion/cjs/components/Table/Table.styles.js +20 -16
  32. package/emotion/cjs/components/Table/Table.tokens.js +9 -1
  33. package/emotion/cjs/components/Table/ui/Cell/Cell.styles.js +2 -2
  34. package/emotion/cjs/components/Table/ui/EditableCell/EditableCell.js +15 -9
  35. package/emotion/cjs/components/Table/ui/EditableCell/EditableCell.styles.js +9 -9
  36. package/emotion/cjs/components/Table/ui/HeadCell/HeadCell.js +9 -9
  37. package/emotion/cjs/components/Table/ui/HeadCell/HeadCell.styles.js +17 -5
  38. package/emotion/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
  39. package/emotion/cjs/examples/plasma_b2c/components/Table/Table.stories.tsx +7 -6
  40. package/emotion/cjs/examples/plasma_web/components/Table/Table.stories.tsx +7 -6
  41. package/emotion/es/components/Table/Table.js +15 -17
  42. package/emotion/es/components/Table/Table.styles.js +19 -15
  43. package/emotion/es/components/Table/Table.tokens.js +8 -0
  44. package/emotion/es/components/Table/ui/Cell/Cell.styles.js +2 -2
  45. package/emotion/es/components/Table/ui/EditableCell/EditableCell.js +15 -9
  46. package/emotion/es/components/Table/ui/EditableCell/EditableCell.styles.js +10 -10
  47. package/emotion/es/components/Table/ui/HeadCell/HeadCell.js +10 -10
  48. package/emotion/es/components/Table/ui/HeadCell/HeadCell.styles.js +16 -4
  49. package/emotion/es/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
  50. package/emotion/es/examples/plasma_b2c/components/Table/Table.stories.tsx +7 -6
  51. package/emotion/es/examples/plasma_web/components/Table/Table.stories.tsx +7 -6
  52. package/es/components/Table/Table.css +24 -22
  53. package/es/components/Table/Table.js +13 -18
  54. package/es/components/Table/Table.js.map +1 -1
  55. package/es/components/Table/Table.styles.js +17 -12
  56. package/es/components/Table/Table.styles.js.map +1 -1
  57. package/es/components/Table/Table.styles_xngwgy.css +12 -0
  58. package/es/components/Table/Table.tokens.js +9 -1
  59. package/es/components/Table/Table.tokens.js.map +1 -1
  60. package/es/components/Table/ui/Cell/Cell.css +24 -22
  61. package/es/components/Table/ui/Cell/Cell.js.map +1 -1
  62. package/es/components/Table/ui/Cell/Cell.styles.js +1 -1
  63. package/es/components/Table/ui/Cell/Cell.styles.js.map +1 -1
  64. package/es/components/Table/ui/Cell/Cell.styles_1q2mjxm.css +1 -0
  65. package/es/components/Table/ui/EditableCell/EditableCell.css +25 -23
  66. package/es/components/Table/ui/EditableCell/EditableCell.js +15 -9
  67. package/es/components/Table/ui/EditableCell/EditableCell.js.map +1 -1
  68. package/es/components/Table/ui/EditableCell/EditableCell.styles.js +5 -5
  69. package/es/components/Table/ui/EditableCell/EditableCell.styles.js.map +1 -1
  70. package/{cjs/components/Table/ui/EditableCell/EditableCell.styles_277bjm.css → es/components/Table/ui/EditableCell/EditableCell.styles_1g3clv2.css} +3 -3
  71. package/es/components/Table/ui/HeadCell/HeadCell.css +24 -22
  72. package/es/components/Table/ui/HeadCell/HeadCell.js +10 -10
  73. package/es/components/Table/ui/HeadCell/HeadCell.js.map +1 -1
  74. package/es/components/Table/ui/HeadCell/HeadCell.styles.js +7 -2
  75. package/es/components/Table/ui/HeadCell/HeadCell.styles.js.map +1 -1
  76. package/{cjs/components/Table/ui/HeadCell/HeadCell.styles_1lo3lcf.css → es/components/Table/ui/HeadCell/HeadCell.styles_155gsrn.css} +1 -0
  77. package/es/components/Table/ui/HeadCell/ui/Filter/Filter.css +24 -22
  78. package/es/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
  79. package/es/components/Table/ui/HeadCell/ui/Filter/Filter.js.map +1 -1
  80. package/es/index.css +26 -24
  81. package/package.json +2 -2
  82. package/styled-components/cjs/components/Table/Table.js +14 -16
  83. package/styled-components/cjs/components/Table/Table.styles.js +13 -10
  84. package/styled-components/cjs/components/Table/Table.tokens.js +9 -1
  85. package/styled-components/cjs/components/Table/ui/Cell/Cell.styles.js +1 -1
  86. package/styled-components/cjs/components/Table/ui/EditableCell/EditableCell.js +15 -9
  87. package/styled-components/cjs/components/Table/ui/EditableCell/EditableCell.styles.js +4 -4
  88. package/styled-components/cjs/components/Table/ui/HeadCell/HeadCell.js +9 -9
  89. package/styled-components/cjs/components/Table/ui/HeadCell/HeadCell.styles.js +5 -2
  90. package/styled-components/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
  91. package/styled-components/cjs/examples/plasma_b2c/components/Table/Table.stories.tsx +7 -6
  92. package/styled-components/cjs/examples/plasma_web/components/Table/Table.stories.tsx +7 -6
  93. package/styled-components/es/components/Table/Table.js +15 -17
  94. package/styled-components/es/components/Table/Table.styles.js +12 -9
  95. package/styled-components/es/components/Table/Table.tokens.js +8 -0
  96. package/styled-components/es/components/Table/ui/Cell/Cell.styles.js +1 -1
  97. package/styled-components/es/components/Table/ui/EditableCell/EditableCell.js +15 -9
  98. package/styled-components/es/components/Table/ui/EditableCell/EditableCell.styles.js +5 -5
  99. package/styled-components/es/components/Table/ui/HeadCell/HeadCell.js +10 -10
  100. package/styled-components/es/components/Table/ui/HeadCell/HeadCell.styles.js +4 -1
  101. package/styled-components/es/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
  102. package/styled-components/es/examples/plasma_b2c/components/Table/Table.stories.tsx +7 -6
  103. package/styled-components/es/examples/plasma_web/components/Table/Table.stories.tsx +7 -6
  104. package/types/components/Table/Table.d.ts +2 -15
  105. package/types/components/Table/Table.d.ts.map +1 -1
  106. package/types/components/Table/Table.styles.d.ts +1 -0
  107. package/types/components/Table/Table.styles.d.ts.map +1 -1
  108. package/types/components/Table/Table.tokens.d.ts +8 -0
  109. package/types/components/Table/Table.tokens.d.ts.map +1 -1
  110. package/types/components/Table/Table.types.d.ts +11 -1
  111. package/types/components/Table/Table.types.d.ts.map +1 -1
  112. package/types/components/Table/ui/Cell/Cell.d.ts +3 -2
  113. package/types/components/Table/ui/Cell/Cell.d.ts.map +1 -1
  114. package/types/components/Table/ui/EditableCell/EditableCell.d.ts +12 -1
  115. package/types/components/Table/ui/EditableCell/EditableCell.d.ts.map +1 -1
  116. package/types/components/Table/ui/EditableCell/EditableCell.styles.d.ts.map +1 -1
  117. package/types/components/Table/ui/HeadCell/HeadCell.d.ts +11 -1
  118. package/types/components/Table/ui/HeadCell/HeadCell.d.ts.map +1 -1
  119. package/types/components/Table/ui/HeadCell/HeadCell.styles.d.ts +1 -0
  120. package/types/components/Table/ui/HeadCell/HeadCell.styles.d.ts.map +1 -1
  121. package/types/components/Table/ui/HeadCell/ui/Filter/Filter.d.ts +10 -1
  122. package/types/components/Table/ui/HeadCell/ui/Filter/Filter.d.ts.map +1 -1
  123. package/cjs/components/Table/Table.styles_1eg2zsx.css +0 -11
  124. package/cjs/components/Table/ui/Cell/Cell.styles_1ikyrwt.css +0 -1
  125. package/es/components/Table/Table.styles_1eg2zsx.css +0 -11
  126. package/es/components/Table/ui/Cell/Cell.styles_1ikyrwt.css +0 -1
@@ -1,3 +1,5 @@
1
+ var _excluded = ["data", "onChange", "columns", "view", "size", "borderVariant", "enableSelection", "selected", "filtered", "sorted", "maxHeight", "stickyHeader", "onCellUpdate"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
3
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
4
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
5
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
@@ -8,12 +10,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
14
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
15
  import React, { forwardRef, useState, useMemo, useRef } from 'react';
12
16
  import { getCoreRowModel, useReactTable, getSortedRowModel, getFilteredRowModel } from '@tanstack/react-table';
13
17
  import { useForkRef } from '@salutejs/plasma-core';
14
18
  import { HeadCell, Cell, EditableCell } from './ui';
15
- import { base, Table, Tr, Thead, StyledCheckbox } from './Table.styles';
16
- export var SELECT_COLUMN_ID = 'select#65768756432';
19
+ import { base, Table, Tr, Thead, StyledCheckbox, Tbody } from './Table.styles';
20
+ export var SELECT_COLUMN_ID = 'SELECT_COLUMN_UNIQUE_ID';
17
21
  export var tableRoot = function tableRoot(Root) {
18
22
  return /*#__PURE__*/forwardRef(function (_ref, ref) {
19
23
  var data = _ref.data,
@@ -29,7 +33,8 @@ export var tableRoot = function tableRoot(Root) {
29
33
  outerSorted = _ref.sorted,
30
34
  maxHeight = _ref.maxHeight,
31
35
  stickyHeader = _ref.stickyHeader,
32
- onCellUpdate = _ref.onCellUpdate;
36
+ onCellUpdate = _ref.onCellUpdate,
37
+ props = _objectWithoutProperties(_ref, _excluded);
33
38
  var _useState = useState(outerSelected || {}),
34
39
  _useState2 = _slicedToArray(_useState, 2),
35
40
  innerSelected = _useState2[0],
@@ -123,17 +128,10 @@ export var tableRoot = function tableRoot(Root) {
123
128
  enableSorting: enableSorting,
124
129
  enableResizing: enableResizing,
125
130
  filterFn: function filterFn(row, columnId, filterArr) {
126
- if (outerFilterFn && filterArr && Array.isArray(filterArr)) {
127
- if (filterArr.length === 0) {
128
- return true;
129
- }
130
- for (var i = 0; i < filterArr.length; i++) {
131
- var filterValue = filterArr[i];
132
- if (outerFilterFn(filterValue, row.getValue(columnId))) {
133
- return true;
134
- }
135
- }
136
- return false;
131
+ if ((filterArr === null || filterArr === void 0 ? void 0 : filterArr.length) !== 0 && outerFilterFn && filterArr && Array.isArray(filterArr)) {
132
+ return filterArr.some(function (filterValue) {
133
+ return outerFilterFn(filterValue, row.getValue(columnId));
134
+ });
137
135
  }
138
136
  return true;
139
137
  },
@@ -174,7 +172,7 @@ export var tableRoot = function tableRoot(Root) {
174
172
  }
175
173
  }
176
174
  });
177
- return /*#__PURE__*/React.createElement(Root, {
175
+ return /*#__PURE__*/React.createElement(Root, _extends({
178
176
  ref: rootRef,
179
177
  data: data,
180
178
  columns: columns,
@@ -183,7 +181,7 @@ export var tableRoot = function tableRoot(Root) {
183
181
  style: {
184
182
  maxHeight: maxHeight || 'none'
185
183
  }
186
- }, /*#__PURE__*/React.createElement(Table, {
184
+ }, props), /*#__PURE__*/React.createElement(Table, {
187
185
  borderVariant: borderVariant,
188
186
  stickyHeader: stickyHeader
189
187
  }, /*#__PURE__*/React.createElement(Thead, {
@@ -203,7 +201,7 @@ export var tableRoot = function tableRoot(Root) {
203
201
  tableContainerRef: tableContainerRef
204
202
  });
205
203
  }));
206
- })), /*#__PURE__*/React.createElement("tbody", null, table.getRowModel().rows.map(function (row) {
204
+ })), /*#__PURE__*/React.createElement(Tbody, null, table.getRowModel().rows.map(function (row) {
207
205
  return /*#__PURE__*/React.createElement(Tr, {
208
206
  key: row.id,
209
207
  selected: row.getIsSelected()