@snack-uikit/table 0.35.2 → 0.35.3
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 +11 -0
- package/dist/cjs/helperComponents/Cells/HeaderCell/HeaderCell.js +1 -1
- package/dist/cjs/helperComponents/Cells/HeaderCell/styles.module.css +3 -3
- package/dist/esm/helperComponents/Cells/HeaderCell/HeaderCell.js +2 -2
- package/dist/esm/helperComponents/Cells/HeaderCell/styles.module.css +3 -3
- package/package.json +2 -2
- package/src/helperComponents/Cells/HeaderCell/HeaderCell.tsx +1 -2
- package/src/helperComponents/Cells/HeaderCell/styles.module.scss +8 -7
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.35.3 (2025-04-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **PDS-1889:** fixed header align in table ([2b7e448](https://github.com/cloud-ru-tech/snack-uikit/commit/2b7e448df3254396b7cb04e78feba24a4cee9629))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 0.35.2 (2025-04-10)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -68,7 +68,6 @@ function HeaderCell(_ref) {
|
|
|
68
68
|
"data-no-padding": columnDef.noHeaderCellPadding || undefined,
|
|
69
69
|
"data-no-offset": columnDef.noHeaderCellBorderOffset || undefined,
|
|
70
70
|
"data-test-id": constants_1.TEST_IDS.headerCell,
|
|
71
|
-
"data-align": columnDef.headerAlign || undefined,
|
|
72
71
|
"data-header-id": header.id,
|
|
73
72
|
"data-resizing": isResizing || undefined,
|
|
74
73
|
"data-pin-position": pinPosition || undefined,
|
|
@@ -87,6 +86,7 @@ function HeaderCell(_ref) {
|
|
|
87
86
|
}, draggableProps, {
|
|
88
87
|
children: (0, jsx_runtime_1.jsxs)("div", {
|
|
89
88
|
className: styles_module_scss_1.default.tableHeaderCellMain,
|
|
89
|
+
"data-align": columnDef.headerAlign || undefined,
|
|
90
90
|
children: [columnDef.header && (0, jsx_runtime_1.jsx)("div", {
|
|
91
91
|
className: styles_module_scss_1.default.tableHeaderCellName,
|
|
92
92
|
children: rowAutoHeight ? (0, react_table_1.flexRender)(columnDef.header, header.getContext()) : (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, {
|
|
@@ -93,9 +93,6 @@
|
|
|
93
93
|
-moz-user-select:none;
|
|
94
94
|
user-select:none;
|
|
95
95
|
}
|
|
96
|
-
.tableHeaderCell[data-align=right]{
|
|
97
|
-
justify-content:flex-end;
|
|
98
|
-
}
|
|
99
96
|
.tableHeaderCell[data-pin-position=right]:last-child{
|
|
100
97
|
overflow:hidden;
|
|
101
98
|
}
|
|
@@ -128,6 +125,9 @@
|
|
|
128
125
|
box-sizing:border-box;
|
|
129
126
|
min-width:0;
|
|
130
127
|
}
|
|
128
|
+
.tableHeaderCellMain[data-align=right]{
|
|
129
|
+
justify-content:flex-end;
|
|
130
|
+
}
|
|
131
131
|
|
|
132
132
|
.tableHeaderCellName{
|
|
133
133
|
min-height:var(--size-table-head-name-layout, 24px);
|
|
@@ -36,10 +36,10 @@ export function HeaderCell({ header, pinPosition, className, rowAutoHeight, isDr
|
|
|
36
36
|
}
|
|
37
37
|
return Object.assign(Object.assign({}, attributes), listeners);
|
|
38
38
|
}, [attributes, header.column.id, isDraggable, listeners]);
|
|
39
|
-
return (_jsxs(Cell, { style: style, onClick: sortingHandler, "data-sortable": isSortable || undefined, "data-draggable": isDraggable || undefined, "data-no-padding": columnDef.noHeaderCellPadding || undefined, "data-no-offset": columnDef.noHeaderCellBorderOffset || undefined, "data-test-id": TEST_IDS.headerCell, "data-
|
|
39
|
+
return (_jsxs(Cell, { style: style, onClick: sortingHandler, "data-sortable": isSortable || undefined, "data-draggable": isDraggable || undefined, "data-no-padding": columnDef.noHeaderCellPadding || undefined, "data-no-offset": columnDef.noHeaderCellBorderOffset || undefined, "data-test-id": TEST_IDS.headerCell, "data-header-id": header.id, "data-resizing": isResizing || undefined, "data-pin-position": pinPosition || undefined, "data-row-auto-height": rowAutoHeight || undefined, role: 'columnheader', className: cn(styles.tableHeaderCell, className, columnDef.headerClassName), ref: element => {
|
|
40
40
|
if (isDraggable) {
|
|
41
41
|
setNodeRef(element);
|
|
42
42
|
}
|
|
43
43
|
return cellRef;
|
|
44
|
-
}, children: [_jsx("div", Object.assign({ className: styles.tableHeaderCellDragWrapper, "data-dragging": (isDraggable && isDragging) || undefined }, draggableProps, { children: _jsxs("div", { className: styles.tableHeaderCellMain, children: [columnDef.header && (_jsx("div", { className: styles.tableHeaderCellName, children: rowAutoHeight ? (flexRender(columnDef.header, header.getContext())) : (_jsx(TruncateString, { text: flexRender(columnDef.header, header.getContext()) })) })), Boolean(sortIcon) && (_jsx("div", { className: styles.tableHeaderIcon, "data-sort-direction": sortDirection, "data-test-id": TEST_IDS.headerSortIndicator, children: sortIcon }))] }) })), Boolean(isResizable) && _jsx(ResizeHandle, { header: header, cellRef: cellRef })] }));
|
|
44
|
+
}, children: [_jsx("div", Object.assign({ className: styles.tableHeaderCellDragWrapper, "data-dragging": (isDraggable && isDragging) || undefined }, draggableProps, { children: _jsxs("div", { className: styles.tableHeaderCellMain, "data-align": columnDef.headerAlign || undefined, children: [columnDef.header && (_jsx("div", { className: styles.tableHeaderCellName, children: rowAutoHeight ? (flexRender(columnDef.header, header.getContext())) : (_jsx(TruncateString, { text: flexRender(columnDef.header, header.getContext()) })) })), Boolean(sortIcon) && (_jsx("div", { className: styles.tableHeaderIcon, "data-sort-direction": sortDirection, "data-test-id": TEST_IDS.headerSortIndicator, children: sortIcon }))] }) })), Boolean(isResizable) && _jsx(ResizeHandle, { header: header, cellRef: cellRef })] }));
|
|
45
45
|
}
|
|
@@ -93,9 +93,6 @@
|
|
|
93
93
|
-moz-user-select:none;
|
|
94
94
|
user-select:none;
|
|
95
95
|
}
|
|
96
|
-
.tableHeaderCell[data-align=right]{
|
|
97
|
-
justify-content:flex-end;
|
|
98
|
-
}
|
|
99
96
|
.tableHeaderCell[data-pin-position=right]:last-child{
|
|
100
97
|
overflow:hidden;
|
|
101
98
|
}
|
|
@@ -128,6 +125,9 @@
|
|
|
128
125
|
box-sizing:border-box;
|
|
129
126
|
min-width:0;
|
|
130
127
|
}
|
|
128
|
+
.tableHeaderCellMain[data-align=right]{
|
|
129
|
+
justify-content:flex-end;
|
|
130
|
+
}
|
|
131
131
|
|
|
132
132
|
.tableHeaderCellName{
|
|
133
133
|
min-height:var(--size-table-head-name-layout, 24px);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Table",
|
|
7
|
-
"version": "0.35.
|
|
7
|
+
"version": "0.35.3",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@snack-uikit/locale": "*"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "f8268af3ad89841073bb5e032006e8f704fd6111"
|
|
70
70
|
}
|
|
@@ -72,7 +72,6 @@ export function HeaderCell<TData>({
|
|
|
72
72
|
data-no-padding={columnDef.noHeaderCellPadding || undefined}
|
|
73
73
|
data-no-offset={columnDef.noHeaderCellBorderOffset || undefined}
|
|
74
74
|
data-test-id={TEST_IDS.headerCell}
|
|
75
|
-
data-align={columnDef.headerAlign || undefined}
|
|
76
75
|
data-header-id={header.id}
|
|
77
76
|
data-resizing={isResizing || undefined}
|
|
78
77
|
data-pin-position={pinPosition || undefined}
|
|
@@ -91,7 +90,7 @@ export function HeaderCell<TData>({
|
|
|
91
90
|
data-dragging={(isDraggable && isDragging) || undefined}
|
|
92
91
|
{...draggableProps}
|
|
93
92
|
>
|
|
94
|
-
<div className={styles.tableHeaderCellMain}>
|
|
93
|
+
<div className={styles.tableHeaderCellMain} data-align={columnDef.headerAlign || undefined}>
|
|
95
94
|
{columnDef.header && (
|
|
96
95
|
<div className={styles.tableHeaderCellName}>
|
|
97
96
|
{rowAutoHeight ? (
|
|
@@ -126,10 +126,6 @@
|
|
|
126
126
|
user-select: none;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
&[data-align='right'] {
|
|
130
|
-
justify-content: flex-end;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
129
|
&[data-pin-position='right'] {
|
|
134
130
|
&:last-child {
|
|
135
131
|
overflow: hidden;
|
|
@@ -172,6 +168,10 @@
|
|
|
172
168
|
|
|
173
169
|
box-sizing: border-box;
|
|
174
170
|
min-width: 0;
|
|
171
|
+
|
|
172
|
+
&[data-align='right'] {
|
|
173
|
+
justify-content: flex-end;
|
|
174
|
+
}
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
.tableHeaderCellName {
|
|
@@ -192,8 +192,9 @@
|
|
|
192
192
|
color: styles-tokens-table.simple-var(styles-tokens-table.$sys-neutral-text-light);
|
|
193
193
|
|
|
194
194
|
svg {
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
/* stylelint-disable-next-line declaration-no-important */
|
|
196
|
+
width: styles-tokens-table.simple-var(styles-tokens-element.$icon-xs) !important;
|
|
197
|
+
/* stylelint-disable-next-line declaration-no-important */
|
|
198
|
+
height: styles-tokens-table.simple-var(styles-tokens-element.$icon-xs) !important;
|
|
197
199
|
}
|
|
198
200
|
}
|
|
199
|
-
|