@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.
- package/cjs/components/Table/Table.css +24 -22
- package/cjs/components/Table/Table.js +11 -16
- package/cjs/components/Table/Table.js.map +1 -1
- package/cjs/components/Table/Table.styles.js +17 -11
- package/cjs/components/Table/Table.styles.js.map +1 -1
- package/cjs/components/Table/Table.styles_xngwgy.css +12 -0
- package/cjs/components/Table/Table.tokens.js +9 -0
- package/cjs/components/Table/Table.tokens.js.map +1 -1
- package/cjs/components/Table/ui/Cell/Cell.css +24 -22
- package/cjs/components/Table/ui/Cell/Cell.js.map +1 -1
- package/cjs/components/Table/ui/Cell/Cell.styles.js +1 -1
- package/cjs/components/Table/ui/Cell/Cell.styles.js.map +1 -1
- package/cjs/components/Table/ui/Cell/Cell.styles_1q2mjxm.css +1 -0
- package/cjs/components/Table/ui/EditableCell/EditableCell.css +25 -23
- package/cjs/components/Table/ui/EditableCell/EditableCell.js +15 -9
- package/cjs/components/Table/ui/EditableCell/EditableCell.js.map +1 -1
- package/cjs/components/Table/ui/EditableCell/EditableCell.styles.js +5 -5
- package/cjs/components/Table/ui/EditableCell/EditableCell.styles.js.map +1 -1
- package/{es/components/Table/ui/EditableCell/EditableCell.styles_277bjm.css → cjs/components/Table/ui/EditableCell/EditableCell.styles_1g3clv2.css} +3 -3
- package/cjs/components/Table/ui/HeadCell/HeadCell.css +24 -22
- package/cjs/components/Table/ui/HeadCell/HeadCell.js +9 -9
- package/cjs/components/Table/ui/HeadCell/HeadCell.js.map +1 -1
- package/cjs/components/Table/ui/HeadCell/HeadCell.styles.js +7 -1
- package/cjs/components/Table/ui/HeadCell/HeadCell.styles.js.map +1 -1
- package/{es/components/Table/ui/HeadCell/HeadCell.styles_1lo3lcf.css → cjs/components/Table/ui/HeadCell/HeadCell.styles_155gsrn.css} +1 -0
- package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.css +24 -22
- package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
- package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.js.map +1 -1
- package/cjs/index.css +26 -24
- package/emotion/cjs/components/Table/Table.js +14 -16
- package/emotion/cjs/components/Table/Table.styles.js +20 -16
- package/emotion/cjs/components/Table/Table.tokens.js +9 -1
- package/emotion/cjs/components/Table/ui/Cell/Cell.styles.js +2 -2
- package/emotion/cjs/components/Table/ui/EditableCell/EditableCell.js +15 -9
- package/emotion/cjs/components/Table/ui/EditableCell/EditableCell.styles.js +9 -9
- package/emotion/cjs/components/Table/ui/HeadCell/HeadCell.js +9 -9
- package/emotion/cjs/components/Table/ui/HeadCell/HeadCell.styles.js +17 -5
- package/emotion/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
- package/emotion/cjs/examples/plasma_b2c/components/Table/Table.stories.tsx +7 -6
- package/emotion/cjs/examples/plasma_web/components/Table/Table.stories.tsx +7 -6
- package/emotion/es/components/Table/Table.js +15 -17
- package/emotion/es/components/Table/Table.styles.js +19 -15
- package/emotion/es/components/Table/Table.tokens.js +8 -0
- package/emotion/es/components/Table/ui/Cell/Cell.styles.js +2 -2
- package/emotion/es/components/Table/ui/EditableCell/EditableCell.js +15 -9
- package/emotion/es/components/Table/ui/EditableCell/EditableCell.styles.js +10 -10
- package/emotion/es/components/Table/ui/HeadCell/HeadCell.js +10 -10
- package/emotion/es/components/Table/ui/HeadCell/HeadCell.styles.js +16 -4
- package/emotion/es/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
- package/emotion/es/examples/plasma_b2c/components/Table/Table.stories.tsx +7 -6
- package/emotion/es/examples/plasma_web/components/Table/Table.stories.tsx +7 -6
- package/es/components/Table/Table.css +24 -22
- package/es/components/Table/Table.js +13 -18
- package/es/components/Table/Table.js.map +1 -1
- package/es/components/Table/Table.styles.js +17 -12
- package/es/components/Table/Table.styles.js.map +1 -1
- package/es/components/Table/Table.styles_xngwgy.css +12 -0
- package/es/components/Table/Table.tokens.js +9 -1
- package/es/components/Table/Table.tokens.js.map +1 -1
- package/es/components/Table/ui/Cell/Cell.css +24 -22
- package/es/components/Table/ui/Cell/Cell.js.map +1 -1
- package/es/components/Table/ui/Cell/Cell.styles.js +1 -1
- package/es/components/Table/ui/Cell/Cell.styles.js.map +1 -1
- package/es/components/Table/ui/Cell/Cell.styles_1q2mjxm.css +1 -0
- package/es/components/Table/ui/EditableCell/EditableCell.css +25 -23
- package/es/components/Table/ui/EditableCell/EditableCell.js +15 -9
- package/es/components/Table/ui/EditableCell/EditableCell.js.map +1 -1
- package/es/components/Table/ui/EditableCell/EditableCell.styles.js +5 -5
- package/es/components/Table/ui/EditableCell/EditableCell.styles.js.map +1 -1
- package/{cjs/components/Table/ui/EditableCell/EditableCell.styles_277bjm.css → es/components/Table/ui/EditableCell/EditableCell.styles_1g3clv2.css} +3 -3
- package/es/components/Table/ui/HeadCell/HeadCell.css +24 -22
- package/es/components/Table/ui/HeadCell/HeadCell.js +10 -10
- package/es/components/Table/ui/HeadCell/HeadCell.js.map +1 -1
- package/es/components/Table/ui/HeadCell/HeadCell.styles.js +7 -2
- package/es/components/Table/ui/HeadCell/HeadCell.styles.js.map +1 -1
- package/{cjs/components/Table/ui/HeadCell/HeadCell.styles_1lo3lcf.css → es/components/Table/ui/HeadCell/HeadCell.styles_155gsrn.css} +1 -0
- package/es/components/Table/ui/HeadCell/ui/Filter/Filter.css +24 -22
- package/es/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
- package/es/components/Table/ui/HeadCell/ui/Filter/Filter.js.map +1 -1
- package/es/index.css +26 -24
- package/package.json +2 -2
- package/styled-components/cjs/components/Table/Table.js +14 -16
- package/styled-components/cjs/components/Table/Table.styles.js +13 -10
- package/styled-components/cjs/components/Table/Table.tokens.js +9 -1
- package/styled-components/cjs/components/Table/ui/Cell/Cell.styles.js +1 -1
- package/styled-components/cjs/components/Table/ui/EditableCell/EditableCell.js +15 -9
- package/styled-components/cjs/components/Table/ui/EditableCell/EditableCell.styles.js +4 -4
- package/styled-components/cjs/components/Table/ui/HeadCell/HeadCell.js +9 -9
- package/styled-components/cjs/components/Table/ui/HeadCell/HeadCell.styles.js +5 -2
- package/styled-components/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Table/Table.stories.tsx +7 -6
- package/styled-components/cjs/examples/plasma_web/components/Table/Table.stories.tsx +7 -6
- package/styled-components/es/components/Table/Table.js +15 -17
- package/styled-components/es/components/Table/Table.styles.js +12 -9
- package/styled-components/es/components/Table/Table.tokens.js +8 -0
- package/styled-components/es/components/Table/ui/Cell/Cell.styles.js +1 -1
- package/styled-components/es/components/Table/ui/EditableCell/EditableCell.js +15 -9
- package/styled-components/es/components/Table/ui/EditableCell/EditableCell.styles.js +5 -5
- package/styled-components/es/components/Table/ui/HeadCell/HeadCell.js +10 -10
- package/styled-components/es/components/Table/ui/HeadCell/HeadCell.styles.js +4 -1
- package/styled-components/es/components/Table/ui/HeadCell/ui/Filter/Filter.js +3 -1
- package/styled-components/es/examples/plasma_b2c/components/Table/Table.stories.tsx +7 -6
- package/styled-components/es/examples/plasma_web/components/Table/Table.stories.tsx +7 -6
- package/types/components/Table/Table.d.ts +2 -15
- package/types/components/Table/Table.d.ts.map +1 -1
- package/types/components/Table/Table.styles.d.ts +1 -0
- package/types/components/Table/Table.styles.d.ts.map +1 -1
- package/types/components/Table/Table.tokens.d.ts +8 -0
- package/types/components/Table/Table.tokens.d.ts.map +1 -1
- package/types/components/Table/Table.types.d.ts +11 -1
- package/types/components/Table/Table.types.d.ts.map +1 -1
- package/types/components/Table/ui/Cell/Cell.d.ts +3 -2
- package/types/components/Table/ui/Cell/Cell.d.ts.map +1 -1
- package/types/components/Table/ui/EditableCell/EditableCell.d.ts +12 -1
- package/types/components/Table/ui/EditableCell/EditableCell.d.ts.map +1 -1
- package/types/components/Table/ui/EditableCell/EditableCell.styles.d.ts.map +1 -1
- package/types/components/Table/ui/HeadCell/HeadCell.d.ts +11 -1
- package/types/components/Table/ui/HeadCell/HeadCell.d.ts.map +1 -1
- package/types/components/Table/ui/HeadCell/HeadCell.styles.d.ts +1 -0
- package/types/components/Table/ui/HeadCell/HeadCell.styles.d.ts.map +1 -1
- package/types/components/Table/ui/HeadCell/ui/Filter/Filter.d.ts +10 -1
- package/types/components/Table/ui/HeadCell/ui/Filter/Filter.d.ts.map +1 -1
- package/cjs/components/Table/Table.styles_1eg2zsx.css +0 -11
- package/cjs/components/Table/ui/Cell/Cell.styles_1ikyrwt.css +0 -1
- package/es/components/Table/Table.styles_1eg2zsx.css +0 -11
- 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 = '
|
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
|
-
|
128
|
-
return
|
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(
|
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()
|