@snack-uikit/table 0.8.7 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/components/TablePagination/TablePagination.js +1 -1
- package/dist/helperComponents/Cells/RowActionsCell/RowActionsCell.js +1 -1
- package/package.json +11 -11
- package/src/components/TablePagination/TablePagination.tsx +2 -0
- package/src/helperComponents/Cells/RowActionsCell/RowActionsCell.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.8.9 (2023-12-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **FF-3960:** change child components size ([2ce2369](https://github.com/cloud-ru-tech/snack-uikit/commit/2ce2369d6f8c05f8688d61f8c53df4956196b52c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 0.8.8 (2023-12-28)
|
|
18
|
+
|
|
19
|
+
### Only dependencies have been changed
|
|
20
|
+
* [@snack-uikit/button@0.15.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/button/CHANGELOG.md)
|
|
21
|
+
* [@snack-uikit/chips@0.10.4](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/chips/CHANGELOG.md)
|
|
22
|
+
* [@snack-uikit/droplist@0.12.4](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/droplist/CHANGELOG.md)
|
|
23
|
+
* [@snack-uikit/icon-predefined@0.4.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/icon-predefined/CHANGELOG.md)
|
|
24
|
+
* [@snack-uikit/pagination@0.6.0](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/pagination/CHANGELOG.md)
|
|
25
|
+
* [@snack-uikit/toggles@0.9.3](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/toggles/CHANGELOG.md)
|
|
26
|
+
* [@snack-uikit/toolbar@0.5.4](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/toolbar/CHANGELOG.md)
|
|
27
|
+
* [@snack-uikit/truncate-string@0.4.4](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/truncate-string/CHANGELOG.md)
|
|
28
|
+
* [@snack-uikit/typography@0.6.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/typography/CHANGELOG.md)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
## 0.8.7 (2023-12-26)
|
|
7
35
|
|
|
8
36
|
|
|
@@ -15,5 +15,5 @@ export function TablePagination({ table, options: optionsProp, optionsLabel = 'R
|
|
|
15
15
|
if (table.getPageCount() <= 1 && !options) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
return (_jsxs("div", { className: styles.footer, children: [table.getPageCount() > 1 && (_jsx(Pagination, { total: table.getPageCount(), page: tablePaginationState.pageIndex + 1, onChange: handlePaginationOnChange, className: styles.pagination })), options && table.getRowModel().rows.length >= Number(options[0].value) && (_jsx(ChipChoice.Single, { value: String(tablePaginationState.pageSize), onChange: handleRowsVolumeOnChange, placement: 'top-end', options: options, label: optionsLabel, widthStrategy: 'auto', showClearButton: false }))] }));
|
|
18
|
+
return (_jsxs("div", { className: styles.footer, children: [table.getPageCount() > 1 && (_jsx(Pagination, { total: table.getPageCount(), page: tablePaginationState.pageIndex + 1, onChange: handlePaginationOnChange, size: 'xs', className: styles.pagination })), options && table.getRowModel().rows.length >= Number(options[0].value) && (_jsx(ChipChoice.Single, { value: String(tablePaginationState.pageSize), onChange: handleRowsVolumeOnChange, placement: 'top-end', options: options, label: optionsLabel, widthStrategy: 'auto', showClearButton: false, size: 'xs' }))] }));
|
|
19
19
|
}
|
|
@@ -20,7 +20,7 @@ function RowActionsCell({ row, actions }) {
|
|
|
20
20
|
const visibleActions = useMemo(() => actions.filter(item => !(item === null || item === void 0 ? void 0 : item.hidden)), [actions]);
|
|
21
21
|
return (
|
|
22
22
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
23
|
-
_jsx("div", { onClick: stopPropagationClick, className: styles.rowActionsCellWrap, "data-open": droplistOpened || undefined, children: !disabled && Boolean(visibleActions.length) && (_jsx(Droplist, { open: droplistOpened, onOpenChange: setDroplistOpen, placement: 'bottom-end', firstElementRefCallback: firstElementRefCallback, onFocusLeave: handleDroplistFocusLeave, triggerElement: _jsx("span", { children: _jsx(ButtonFunction, { icon: _jsx(MoreSVG, { size: 24 }), "data-test-id": TEST_IDS.rowActions.droplistTrigger, onKeyDown: handleTriggerKeyDown, ref: triggerElementRef }) }), triggerClassName: styles.rowActionsCellTrigger, size: '
|
|
23
|
+
_jsx("div", { onClick: stopPropagationClick, className: styles.rowActionsCellWrap, "data-open": droplistOpened || undefined, children: !disabled && Boolean(visibleActions.length) && (_jsx(Droplist, { open: droplistOpened, onOpenChange: setDroplistOpen, placement: 'bottom-end', firstElementRefCallback: firstElementRefCallback, onFocusLeave: handleDroplistFocusLeave, triggerElement: _jsx("span", { children: _jsx(ButtonFunction, { icon: _jsx(MoreSVG, { size: 24 }), "data-test-id": TEST_IDS.rowActions.droplistTrigger, onKeyDown: handleTriggerKeyDown, ref: triggerElementRef }) }), triggerClassName: styles.rowActionsCellTrigger, size: 'm', "data-test-id": TEST_IDS.rowActions.droplist, children: actions.map(item => (_createElement(Droplist.ItemSingle, Object.assign({}, item, { key: `${row.id}-${item.id || item.option}`, onClick: e => handleDroplistItemClick(e, handleItemClick(item)), "data-test-id": TEST_IDS.rowActions.option, onKeyDown: handleDroplistItemKeyDown })))) })) }));
|
|
24
24
|
}
|
|
25
25
|
/** Вспомогательная функция для создания ячейки с дополнительными действиями у строки */
|
|
26
26
|
export function getRowActionsColumnDef({ actionsGenerator, pinned, }) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Table",
|
|
7
|
-
"version": "0.8.
|
|
7
|
+
"version": "0.8.9",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
"license": "Apache-2.0",
|
|
33
33
|
"scripts": {},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@snack-uikit/button": "0.15.
|
|
36
|
-
"@snack-uikit/chips": "0.10.
|
|
37
|
-
"@snack-uikit/droplist": "0.12.
|
|
38
|
-
"@snack-uikit/icon-predefined": "0.4.
|
|
35
|
+
"@snack-uikit/button": "0.15.1",
|
|
36
|
+
"@snack-uikit/chips": "0.10.4",
|
|
37
|
+
"@snack-uikit/droplist": "0.12.4",
|
|
38
|
+
"@snack-uikit/icon-predefined": "0.4.1",
|
|
39
39
|
"@snack-uikit/icons": "0.19.2",
|
|
40
|
-
"@snack-uikit/pagination": "0.
|
|
40
|
+
"@snack-uikit/pagination": "0.6.0",
|
|
41
41
|
"@snack-uikit/scroll": "0.5.0",
|
|
42
42
|
"@snack-uikit/skeleton": "0.3.2",
|
|
43
|
-
"@snack-uikit/toggles": "0.9.
|
|
44
|
-
"@snack-uikit/toolbar": "0.5.
|
|
45
|
-
"@snack-uikit/truncate-string": "0.4.
|
|
46
|
-
"@snack-uikit/typography": "0.6.
|
|
43
|
+
"@snack-uikit/toggles": "0.9.3",
|
|
44
|
+
"@snack-uikit/toolbar": "0.5.4",
|
|
45
|
+
"@snack-uikit/truncate-string": "0.4.4",
|
|
46
|
+
"@snack-uikit/typography": "0.6.1",
|
|
47
47
|
"@snack-uikit/utils": "3.2.0",
|
|
48
48
|
"@tanstack/match-sorter-utils": "8.8.4",
|
|
49
49
|
"@tanstack/react-table": "8.10.7",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"uncontrollable": "8.0.0",
|
|
52
52
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "39d8bb34b33858ad9fb3e401309e386e5b0f3d28"
|
|
55
55
|
}
|
|
@@ -50,6 +50,7 @@ export function TablePagination<TData>({
|
|
|
50
50
|
total={table.getPageCount()}
|
|
51
51
|
page={tablePaginationState.pageIndex + 1}
|
|
52
52
|
onChange={handlePaginationOnChange}
|
|
53
|
+
size='xs'
|
|
53
54
|
className={styles.pagination}
|
|
54
55
|
/>
|
|
55
56
|
)}
|
|
@@ -63,6 +64,7 @@ export function TablePagination<TData>({
|
|
|
63
64
|
label={optionsLabel}
|
|
64
65
|
widthStrategy='auto'
|
|
65
66
|
showClearButton={false}
|
|
67
|
+
size='xs'
|
|
66
68
|
/>
|
|
67
69
|
)}
|
|
68
70
|
</div>
|