@cloud-ru/ds-table 1.0.2-preview-7665e9c3.0 → 1.0.2-preview-c048fbb9.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/README.md +3 -3
- package/dist/cjs/components/Table/Table.js +12 -4
- package/dist/cjs/components/Table/hooks/useColumnOrderByDrag/useColumnOrderByDrag.d.ts +2 -0
- package/dist/cjs/components/Table/hooks/useColumnOrderByDrag/useColumnOrderByDrag.js +20 -3
- package/dist/cjs/components/Table/hooks/useColumnSettings/utils/createColumnsSettingsOption.d.ts +2 -2
- package/dist/cjs/components/Table/hooks/useColumnSettings/utils/createColumnsSettingsOption.js +2 -2
- package/dist/cjs/components/Table/hooks/useColumnSettings/utils/getColumnSettingsMode.d.ts +8 -0
- package/dist/cjs/components/Table/hooks/useColumnSettings/utils/getColumnSettingsMode.js +15 -0
- package/dist/cjs/components/Table/hooks/useColumnSettings/utils/index.d.ts +1 -0
- package/dist/cjs/components/Table/hooks/useColumnSettings/utils/index.js +1 -0
- package/dist/cjs/components/Table/hooks/useColumnSettings/utils/isColumnEnabledInitially.js +3 -4
- package/dist/cjs/components/Table/hooks/useColumnSettings/utils/isColumnVisibilityConfigurable.js +3 -15
- package/dist/cjs/components/Table/hooks/useColumnSettings/utils/isFilterableColumn.js +4 -2
- package/dist/cjs/components/Table/hooks/useTableScroll.js +15 -1
- package/dist/cjs/components/Table/styles.module.css +11 -1
- package/dist/cjs/components/Table/utils/alignOverlayToHeader.d.ts +6 -0
- package/dist/cjs/components/Table/utils/alignOverlayToHeader.js +28 -0
- package/dist/cjs/components/Table/utils/index.d.ts +1 -0
- package/dist/cjs/components/Table/utils/index.js +1 -0
- package/dist/cjs/constants.d.ts +1 -1
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/helperComponents/Cells/BodyCell/BodyCell.js +4 -4
- package/dist/cjs/helperComponents/Cells/HeaderCell/HeaderCell.js +7 -6
- package/dist/cjs/helperComponents/Cells/HeaderCell/ResizeHandle.js +1 -1
- package/dist/cjs/helperComponents/Cells/styles.module.css +3 -0
- package/dist/cjs/helperComponents/Rows/styles.module.css +4 -0
- package/dist/cjs/helperComponents/TableEmptyState/hooks.js +0 -1
- package/dist/cjs/helperComponents/TableEmptyState/styles.module.css +3 -1
- package/dist/cjs/hooks/useCellSizes.d.ts +0 -1
- package/dist/cjs/hooks/useCellSizes.js +1 -4
- package/dist/cjs/locale/index.d.ts +0 -4
- package/dist/cjs/locale/index.js +0 -2
- package/dist/cjs/style.css +21 -2
- package/dist/cjs/types.d.ts +1 -0
- package/dist/esm/components/Table/Table.js +15 -7
- package/dist/esm/components/Table/hooks/useColumnOrderByDrag/useColumnOrderByDrag.d.ts +2 -0
- package/dist/esm/components/Table/hooks/useColumnOrderByDrag/useColumnOrderByDrag.js +21 -4
- package/dist/esm/components/Table/hooks/useColumnSettings/utils/createColumnsSettingsOption.d.ts +2 -2
- package/dist/esm/components/Table/hooks/useColumnSettings/utils/createColumnsSettingsOption.js +2 -2
- package/dist/esm/components/Table/hooks/useColumnSettings/utils/getColumnSettingsMode.d.ts +8 -0
- package/dist/esm/components/Table/hooks/useColumnSettings/utils/getColumnSettingsMode.js +11 -0
- package/dist/esm/components/Table/hooks/useColumnSettings/utils/index.d.ts +1 -0
- package/dist/esm/components/Table/hooks/useColumnSettings/utils/index.js +1 -0
- package/dist/esm/components/Table/hooks/useColumnSettings/utils/isColumnEnabledInitially.js +3 -4
- package/dist/esm/components/Table/hooks/useColumnSettings/utils/isColumnVisibilityConfigurable.js +3 -15
- package/dist/esm/components/Table/hooks/useColumnSettings/utils/isFilterableColumn.js +4 -2
- package/dist/esm/components/Table/hooks/useTableScroll.js +15 -1
- package/dist/esm/components/Table/styles.module.css +11 -1
- package/dist/esm/components/Table/utils/alignOverlayToHeader.d.ts +6 -0
- package/dist/esm/components/Table/utils/alignOverlayToHeader.js +24 -0
- package/dist/esm/components/Table/utils/index.d.ts +1 -0
- package/dist/esm/components/Table/utils/index.js +1 -0
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/helperComponents/Cells/BodyCell/BodyCell.js +4 -4
- package/dist/esm/helperComponents/Cells/HeaderCell/HeaderCell.js +7 -6
- package/dist/esm/helperComponents/Cells/HeaderCell/ResizeHandle.js +1 -1
- package/dist/esm/helperComponents/Cells/styles.module.css +3 -0
- package/dist/esm/helperComponents/Rows/styles.module.css +4 -0
- package/dist/esm/helperComponents/TableEmptyState/hooks.js +0 -1
- package/dist/esm/helperComponents/TableEmptyState/styles.module.css +3 -1
- package/dist/esm/hooks/useCellSizes.d.ts +0 -1
- package/dist/esm/hooks/useCellSizes.js +1 -4
- package/dist/esm/locale/index.d.ts +0 -4
- package/dist/esm/locale/index.js +0 -2
- package/dist/esm/style.css +21 -2
- package/dist/esm/types.d.ts +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +19 -18
- package/src/components/Table/Table.tsx +53 -26
- package/src/components/Table/hooks/useColumnOrderByDrag/useColumnOrderByDrag.ts +31 -7
- package/src/components/Table/hooks/useColumnSettings/utils/createColumnsSettingsOption.ts +2 -2
- package/src/components/Table/hooks/useColumnSettings/utils/getColumnSettingsMode.ts +18 -0
- package/src/components/Table/hooks/useColumnSettings/utils/index.ts +1 -0
- package/src/components/Table/hooks/useColumnSettings/utils/isColumnEnabledInitially.ts +3 -5
- package/src/components/Table/hooks/useColumnSettings/utils/isColumnVisibilityConfigurable.ts +3 -18
- package/src/components/Table/hooks/useColumnSettings/utils/isFilterableColumn.ts +4 -2
- package/src/components/Table/hooks/useTableScroll.ts +21 -1
- package/src/components/Table/styles.module.scss +16 -1
- package/src/components/Table/utils/alignOverlayToHeader.ts +36 -0
- package/src/components/Table/utils/index.ts +1 -0
- package/src/constants.ts +1 -1
- package/src/helperComponents/Cells/BodyCell/BodyCell.tsx +5 -2
- package/src/helperComponents/Cells/HeaderCell/HeaderCell.tsx +10 -7
- package/src/helperComponents/Cells/HeaderCell/ResizeHandle.tsx +1 -2
- package/src/helperComponents/Cells/styles.module.scss +11 -0
- package/src/helperComponents/Rows/styles.module.scss +5 -0
- package/src/helperComponents/TableEmptyState/hooks.ts +0 -1
- package/src/helperComponents/TableEmptyState/styles.module.scss +5 -1
- package/src/hooks/useCellSizes.ts +1 -5
- package/src/locale/index.ts +0 -2
- package/src/types.ts +3 -5
|
@@ -3,7 +3,6 @@ import { useMemo } from 'react';
|
|
|
3
3
|
import { TABLE_COLUMN_CSS_VARS } from '../constants.js';
|
|
4
4
|
export function useCellSizes(element, options) {
|
|
5
5
|
const column = element.column;
|
|
6
|
-
const isDragging = options?.isDragging ?? false;
|
|
7
6
|
const transform = options?.transform ?? null;
|
|
8
7
|
const minWidth = column.columnDef.minSize;
|
|
9
8
|
const maxWidth = column.columnDef.maxSize;
|
|
@@ -18,14 +17,12 @@ export function useCellSizes(element, options) {
|
|
|
18
17
|
flexShrink,
|
|
19
18
|
};
|
|
20
19
|
if (options?.isDraggable) {
|
|
21
|
-
styles.opacity = isDragging ? 0.8 : 1;
|
|
22
20
|
styles.position = 'relative';
|
|
23
21
|
styles.transform = CSS.Translate.toString(transform);
|
|
24
|
-
styles.zIndex = isDragging ? 1 : undefined;
|
|
25
22
|
if (isHeaderCell) {
|
|
26
23
|
styles.whiteSpace = 'nowrap';
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
26
|
return styles;
|
|
30
|
-
}, [options?.isDraggable, flexShrink,
|
|
27
|
+
}, [options?.isDraggable, flexShrink, isHeaderCell, maxWidth, minWidth, transform, width]);
|
|
31
28
|
}
|
|
@@ -13,7 +13,6 @@ declare const TABLE_MESSAGES: {
|
|
|
13
13
|
};
|
|
14
14
|
readonly noData: {
|
|
15
15
|
readonly title: "No data";
|
|
16
|
-
readonly content: "Try refreshing the page";
|
|
17
16
|
};
|
|
18
17
|
readonly noResults: {
|
|
19
18
|
readonly title: "Nothing found";
|
|
@@ -38,7 +37,6 @@ declare const TABLE_MESSAGES: {
|
|
|
38
37
|
};
|
|
39
38
|
readonly noData: {
|
|
40
39
|
readonly title: "Нет данных";
|
|
41
|
-
readonly content: "Обновите страницу";
|
|
42
40
|
};
|
|
43
41
|
readonly noResults: {
|
|
44
42
|
readonly title: "Ничего не найдено";
|
|
@@ -67,7 +65,6 @@ export declare const tableLocale: import("@cloud-ru/ds-locale").DefinedLocale<{
|
|
|
67
65
|
};
|
|
68
66
|
readonly noData: {
|
|
69
67
|
readonly title: "No data";
|
|
70
|
-
readonly content: "Try refreshing the page";
|
|
71
68
|
};
|
|
72
69
|
readonly noResults: {
|
|
73
70
|
readonly title: "Nothing found";
|
|
@@ -92,7 +89,6 @@ export declare const tableLocale: import("@cloud-ru/ds-locale").DefinedLocale<{
|
|
|
92
89
|
};
|
|
93
90
|
readonly noData: {
|
|
94
91
|
readonly title: "Нет данных";
|
|
95
|
-
readonly content: "Обновите страницу";
|
|
96
92
|
};
|
|
97
93
|
readonly noResults: {
|
|
98
94
|
readonly title: "Ничего не найдено";
|
package/dist/esm/locale/index.js
CHANGED
|
@@ -14,7 +14,6 @@ const TABLE_MESSAGES = defineMessages({
|
|
|
14
14
|
},
|
|
15
15
|
noData: {
|
|
16
16
|
title: 'No data',
|
|
17
|
-
content: 'Try refreshing the page',
|
|
18
17
|
},
|
|
19
18
|
noResults: {
|
|
20
19
|
title: 'Nothing found',
|
|
@@ -39,7 +38,6 @@ const TABLE_MESSAGES = defineMessages({
|
|
|
39
38
|
},
|
|
40
39
|
noData: {
|
|
41
40
|
title: 'Нет данных',
|
|
42
|
-
content: 'Обновите страницу',
|
|
43
41
|
},
|
|
44
42
|
noResults: {
|
|
45
43
|
title: 'Ничего не найдено',
|
package/dist/esm/style.css
CHANGED
|
@@ -442,7 +442,8 @@
|
|
|
442
442
|
flex:1 1 auto;
|
|
443
443
|
flex-direction:column;
|
|
444
444
|
width:100%;
|
|
445
|
-
min-width
|
|
445
|
+
min-width:-moz-max-content;
|
|
446
|
+
min-width:max-content;
|
|
446
447
|
min-height:100%;
|
|
447
448
|
}
|
|
448
449
|
|
|
@@ -576,6 +577,15 @@
|
|
|
576
577
|
width:100%;
|
|
577
578
|
max-width:100%;
|
|
578
579
|
}
|
|
580
|
+
|
|
581
|
+
.columnDragPreview{
|
|
582
|
+
display:flex;
|
|
583
|
+
align-items:center;
|
|
584
|
+
box-sizing:border-box;
|
|
585
|
+
height:var(--sn-table-anatomy-content-tableCell-minHeight, var(--sn-primitive-dimension-40, 40px));
|
|
586
|
+
padding:var(--sn-table-anatomy-content-tableHead-paddingTop, var(--sn-primitive-dimension-6, 6px)) var(--sn-table-anatomy-content-tableHead-paddingRight, var(--sn-primitive-dimension-12, 12px)) var(--sn-table-anatomy-content-tableHead-paddingBottom, var(--sn-primitive-dimension-6, 6px)) var(--sn-table-anatomy-content-tableHead-paddingLeft, var(--sn-primitive-dimension-12, 12px));
|
|
587
|
+
border-radius:var(--sn-table-anatomy-content-borderRadius, var(--sn-brand-anatomy-radius-table-m, var(--sn-primitive-dimension-4, 4px)));
|
|
588
|
+
}
|
|
579
589
|
.tableBodyCell{
|
|
580
590
|
gap:var(--sn-table-anatomy-content-tableCell-contentWrapper-slot-gap, var(--sn-primitive-dimension-2, 2px));
|
|
581
591
|
padding:calc(var(--sn-table-anatomy-content-tableCell-paddingTop, var(--sn-primitive-dimension-6, 6px)) + var(--sn-table-anatomy-content-tableCell-contentWrapper-paddingTop, var(--sn-primitive-dimension-2, 2px))) var(--sn-table-anatomy-content-tableCell-paddingRight, var(--sn-primitive-dimension-12, 12px)) calc(var(--sn-table-anatomy-content-tableCell-paddingBottom, var(--sn-primitive-dimension-6, 6px)) + var(--sn-table-anatomy-content-tableCell-contentWrapper-paddingBottom, var(--sn-primitive-dimension-2, 2px))) var(--sn-table-anatomy-content-tableCell-paddingLeft, var(--sn-primitive-dimension-12, 12px));
|
|
@@ -1005,6 +1015,9 @@
|
|
|
1005
1015
|
width:100%;
|
|
1006
1016
|
background-color:transparent;
|
|
1007
1017
|
}
|
|
1018
|
+
.tableCell[data-dragging]{
|
|
1019
|
+
box-shadow:inset var(--sn-table-anatomy-content-tableLine-background-interaction-borderVerticalWidth, var(--sn-primitive-strokeWeight-strokeRegular, 1px)) 0 0 0 var(--sn-theme-color-available-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-default-borderColor, rgba(159, 166, 198, 0.3019607843))), inset calc(-1 * var(--sn-table-anatomy-content-tableLine-background-interaction-borderVerticalWidth, var(--sn-primitive-strokeWeight-strokeRegular, 1px))) 0 0 0 var(--sn-theme-color-available-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-default-borderColor, rgba(159, 166, 198, 0.3019607843)));
|
|
1020
|
+
}
|
|
1008
1021
|
@charset "UTF-8";
|
|
1009
1022
|
.surface{
|
|
1010
1023
|
isolation:isolate;
|
|
@@ -1277,6 +1290,10 @@
|
|
|
1277
1290
|
width:var(--sn-table-anatomy-content-tableLine-background-interaction-borderVerticalWidth, var(--sn-primitive-strokeWeight-strokeRegular, 1px));
|
|
1278
1291
|
}
|
|
1279
1292
|
|
|
1293
|
+
.tableHeader .rowPinnedCells::after{
|
|
1294
|
+
bottom:0;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1280
1297
|
.rowPinnedCells[data-position=left]{
|
|
1281
1298
|
left:0;
|
|
1282
1299
|
}
|
|
@@ -1525,13 +1542,15 @@
|
|
|
1525
1542
|
padding:0;
|
|
1526
1543
|
}
|
|
1527
1544
|
.tableEmptyStateWrapper{
|
|
1545
|
+
position:sticky;
|
|
1546
|
+
left:0;
|
|
1528
1547
|
display:flex;
|
|
1529
1548
|
flex:1 1 auto;
|
|
1530
1549
|
flex-direction:column;
|
|
1531
1550
|
align-items:center;
|
|
1532
1551
|
justify-content:center;
|
|
1533
1552
|
box-sizing:border-box;
|
|
1534
|
-
width:100
|
|
1553
|
+
width:var(--table-viewport-width, 100%);
|
|
1535
1554
|
min-height:304px;
|
|
1536
1555
|
padding:var(--sn-primitive-dimension-24, 24px);
|
|
1537
1556
|
}
|
package/dist/esm/types.d.ts
CHANGED