@snack-uikit/table 0.7.0 → 0.7.1
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
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.7.1 (2023-12-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **FF-3646:** fix refresh button render in case without onRefresh callback in props ([d99a0e6](https://github.com/cloud-ru-tech/snack-uikit/commit/d99a0e6ef75d6c0d5c49f0c06259c92584821a04))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 0.7.0 (2023-12-06)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -115,7 +115,7 @@ export function Table(_a) {
|
|
|
115
115
|
const tableRows = table.getRowModel().rows;
|
|
116
116
|
const loadingTableRows = loadingTable.getRowModel().rows;
|
|
117
117
|
const tablePagination = table.getState().pagination;
|
|
118
|
-
return (_jsx(_Fragment, { children: _jsxs("div", Object.assign({ style: { '--page-size': !suppressPagination ? tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.pageSize : pageSize }, className: className }, extractSupportProps(rest), { children: [!suppressToolbar && (_jsxs("div", Object.assign({ className: styles.header }, { children: [_jsx(Toolbar, { value: globalFilter, onChange: onGlobalFilterChange, checked: table.getIsAllPageRowsSelected(), indeterminate: table.getIsSomePageRowsSelected(), className: styles.toolbar, onRefresh: handleOnRefresh, onDelete: enableSelection && onDelete ? handleOnDelete : undefined, onCheck: enableSelection ? handleOnCheck : undefined, outline: outline, loading: search === null || search === void 0 ? void 0 : search.loading, placeholder: (search === null || search === void 0 ? void 0 : search.placeholder) || 'Search', selectionMode: (rowSelectionProp === null || rowSelectionProp === void 0 ? void 0 : rowSelectionProp.multiRow) ? Toolbar.selectionModes.Multiple : Toolbar.selectionModes.Single, actions: exportFileName ? (_jsx(ExportButton, { fileName: exportFileName, columnDefinitions: columnDefinitions, data: data })) : undefined, moreActions: moreActions }), columnFiltersProp && _jsxs("div", Object.assign({ className: styles.filtersWrapper }, { children: [" ", columnFiltersProp, " "] }))] }))), _jsx("div", Object.assign({ className: styles.scrollWrapper, "data-outline": outline || undefined }, { children: _jsx(Scroll, Object.assign({ size: Scroll.sizes.S, className: styles.table }, { children: _jsx("div", Object.assign({ className: styles.tableContent }, { children: _jsx(TableContext.Provider, Object.assign({ value: { table } }, { children: loading ? (_jsxs(SkeletonContextProvider, Object.assign({ loading: true }, { children: [_jsx(HeaderRow, {}), loadingTableRows.map(row => (_jsx(BodyRow, { row: row }, row.id)))] }))) : (_jsxs(_Fragment, { children: [tableRows.length ? _jsx(HeaderRow, {}) : null, tableRows.map(row => (_jsx(BodyRow, { row: row, onRowClick: onRowClick }, row.id))), !tableRows.length && globalFilter && _jsx(TableEmptyState, Object.assign({}, noResultsState)), !tableRows.length && !globalFilter && _jsx(TableEmptyState, Object.assign({}, noDataState))] })) })) })) })) })), !suppressPagination && (_jsx(TablePagination, { table: table, options: paginationProp === null || paginationProp === void 0 ? void 0 : paginationProp.options, optionsLabel: paginationProp === null || paginationProp === void 0 ? void 0 : paginationProp.optionsLabel, pageCount: pageCount }))] })) }));
|
|
118
|
+
return (_jsx(_Fragment, { children: _jsxs("div", Object.assign({ style: { '--page-size': !suppressPagination ? tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.pageSize : pageSize }, className: className }, extractSupportProps(rest), { children: [!suppressToolbar && (_jsxs("div", Object.assign({ className: styles.header }, { children: [_jsx(Toolbar, { value: globalFilter, onChange: onGlobalFilterChange, checked: table.getIsAllPageRowsSelected(), indeterminate: table.getIsSomePageRowsSelected(), className: styles.toolbar, onRefresh: onRefresh ? handleOnRefresh : undefined, onDelete: enableSelection && onDelete ? handleOnDelete : undefined, onCheck: enableSelection ? handleOnCheck : undefined, outline: outline, loading: search === null || search === void 0 ? void 0 : search.loading, placeholder: (search === null || search === void 0 ? void 0 : search.placeholder) || 'Search', selectionMode: (rowSelectionProp === null || rowSelectionProp === void 0 ? void 0 : rowSelectionProp.multiRow) ? Toolbar.selectionModes.Multiple : Toolbar.selectionModes.Single, actions: exportFileName ? (_jsx(ExportButton, { fileName: exportFileName, columnDefinitions: columnDefinitions, data: data })) : undefined, moreActions: moreActions }), columnFiltersProp && _jsxs("div", Object.assign({ className: styles.filtersWrapper }, { children: [" ", columnFiltersProp, " "] }))] }))), _jsx("div", Object.assign({ className: styles.scrollWrapper, "data-outline": outline || undefined }, { children: _jsx(Scroll, Object.assign({ size: Scroll.sizes.S, className: styles.table }, { children: _jsx("div", Object.assign({ className: styles.tableContent }, { children: _jsx(TableContext.Provider, Object.assign({ value: { table } }, { children: loading ? (_jsxs(SkeletonContextProvider, Object.assign({ loading: true }, { children: [_jsx(HeaderRow, {}), loadingTableRows.map(row => (_jsx(BodyRow, { row: row }, row.id)))] }))) : (_jsxs(_Fragment, { children: [tableRows.length ? _jsx(HeaderRow, {}) : null, tableRows.map(row => (_jsx(BodyRow, { row: row, onRowClick: onRowClick }, row.id))), !tableRows.length && globalFilter && _jsx(TableEmptyState, Object.assign({}, noResultsState)), !tableRows.length && !globalFilter && _jsx(TableEmptyState, Object.assign({}, noDataState))] })) })) })) })) })), !suppressPagination && (_jsx(TablePagination, { table: table, options: paginationProp === null || paginationProp === void 0 ? void 0 : paginationProp.options, optionsLabel: paginationProp === null || paginationProp === void 0 ? void 0 : paginationProp.optionsLabel, pageCount: pageCount }))] })) }));
|
|
119
119
|
}
|
|
120
120
|
Table.columnPinPositions = ColumnPinPosition;
|
|
121
121
|
Table.columnAligns = ColumnAlign;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Table",
|
|
7
|
-
"version": "0.7.
|
|
7
|
+
"version": "0.7.1",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -32,24 +32,24 @@
|
|
|
32
32
|
"license": "Apache-2.0",
|
|
33
33
|
"scripts": {},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@snack-uikit/button": "0.14.
|
|
36
|
-
"@snack-uikit/chips": "0.9.
|
|
37
|
-
"@snack-uikit/droplist": "0.11.
|
|
38
|
-
"@snack-uikit/icon-predefined": "0.3.
|
|
35
|
+
"@snack-uikit/button": "0.14.1",
|
|
36
|
+
"@snack-uikit/chips": "0.9.1",
|
|
37
|
+
"@snack-uikit/droplist": "0.11.1",
|
|
38
|
+
"@snack-uikit/icon-predefined": "0.3.1",
|
|
39
39
|
"@snack-uikit/icons": "0.19.0",
|
|
40
|
-
"@snack-uikit/pagination": "0.5.
|
|
41
|
-
"@snack-uikit/scroll": "0.4.
|
|
42
|
-
"@snack-uikit/skeleton": "0.3.
|
|
43
|
-
"@snack-uikit/toggles": "0.8.
|
|
44
|
-
"@snack-uikit/toolbar": "0.4.
|
|
45
|
-
"@snack-uikit/truncate-string": "0.3.
|
|
46
|
-
"@snack-uikit/typography": "0.5.
|
|
47
|
-
"@snack-uikit/utils": "3.
|
|
40
|
+
"@snack-uikit/pagination": "0.5.1",
|
|
41
|
+
"@snack-uikit/scroll": "0.4.1",
|
|
42
|
+
"@snack-uikit/skeleton": "0.3.1",
|
|
43
|
+
"@snack-uikit/toggles": "0.8.1",
|
|
44
|
+
"@snack-uikit/toolbar": "0.4.1",
|
|
45
|
+
"@snack-uikit/truncate-string": "0.3.1",
|
|
46
|
+
"@snack-uikit/typography": "0.5.1",
|
|
47
|
+
"@snack-uikit/utils": "3.1.0",
|
|
48
48
|
"@tanstack/match-sorter-utils": "8.8.4",
|
|
49
49
|
"@tanstack/react-table": "8.10.7",
|
|
50
50
|
"classnames": "2.3.2",
|
|
51
51
|
"uncontrollable": "8.0.0",
|
|
52
52
|
"xlsx": "0.18.5"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "76a159dde7baccf49dc7b11e1fd7abc31424b42f"
|
|
55
55
|
}
|
|
@@ -316,7 +316,7 @@ export function Table<TData extends object>({
|
|
|
316
316
|
checked={table.getIsAllPageRowsSelected()}
|
|
317
317
|
indeterminate={table.getIsSomePageRowsSelected()}
|
|
318
318
|
className={styles.toolbar}
|
|
319
|
-
onRefresh={handleOnRefresh}
|
|
319
|
+
onRefresh={onRefresh ? handleOnRefresh : undefined}
|
|
320
320
|
onDelete={enableSelection && onDelete ? handleOnDelete : undefined}
|
|
321
321
|
onCheck={enableSelection ? handleOnCheck : undefined}
|
|
322
322
|
outline={outline}
|