@clickhouse/click-ui 0.8.0 → 0.9.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/dist/cjs/click-ui.css +362 -0
- package/dist/cjs/components/Assets/Icons/Horizontal-Loading.cjs +13 -49
- package/dist/cjs/components/Assets/Icons/Horizontal-Loading.cjs.map +1 -1
- package/dist/cjs/components/Assets/Icons/Loaders.css +94 -0
- package/dist/cjs/components/Assets/Icons/Loaders.module.css.cjs +13 -0
- package/dist/cjs/components/Assets/Icons/Loaders.module.css.cjs.map +1 -0
- package/dist/cjs/components/Assets/Icons/Loading-Animated.cjs +8 -12
- package/dist/cjs/components/Assets/Icons/Loading-Animated.cjs.map +1 -1
- package/dist/cjs/components/Assets/Icons/Loading.cjs +13 -6
- package/dist/cjs/components/Assets/Icons/Loading.cjs.map +1 -1
- package/dist/cjs/components/DatePicker/DateRangePicker.cjs +12 -2
- package/dist/cjs/components/DatePicker/DateRangePicker.cjs.map +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -3
- package/dist/cjs/components/DatePicker/index.cjs.map +1 -1
- package/dist/cjs/components/DatePicker/utils.cjs +3 -0
- package/dist/cjs/components/DatePicker/utils.cjs.map +1 -1
- package/dist/cjs/components/Grid/Cell.cjs +1 -3
- package/dist/cjs/components/Grid/Cell.cjs.map +1 -1
- package/dist/cjs/components/Grid/ColumnResizer.cjs +18 -15
- package/dist/cjs/components/Grid/ColumnResizer.cjs.map +1 -1
- package/dist/cjs/components/Grid/ColumnResizer.css +22 -0
- package/dist/cjs/components/Grid/ColumnResizer.module.css.cjs +11 -0
- package/dist/cjs/components/Grid/ColumnResizer.module.css.cjs.map +1 -0
- package/dist/cjs/components/Grid/Grid.css +34 -0
- package/dist/cjs/components/Grid/Grid.module.css.cjs +21 -0
- package/dist/cjs/components/Grid/Grid.module.css.cjs.map +1 -0
- package/dist/cjs/components/Grid/Header.cjs +22 -43
- package/dist/cjs/components/Grid/Header.cjs.map +1 -1
- package/dist/cjs/components/Grid/Header.css +44 -0
- package/dist/cjs/components/Grid/Header.module.css.cjs +19 -0
- package/dist/cjs/components/Grid/Header.module.css.cjs.map +1 -0
- package/dist/cjs/components/Grid/RowNumberColumn.cjs +12 -29
- package/dist/cjs/components/Grid/RowNumberColumn.cjs.map +1 -1
- package/dist/cjs/components/Grid/RowNumberColumn.css +22 -0
- package/dist/cjs/components/Grid/RowNumberColumn.module.css.cjs +12 -0
- package/dist/cjs/components/Grid/RowNumberColumn.module.css.cjs.map +1 -0
- package/dist/cjs/components/Grid/StyledCell.cjs +84 -56
- package/dist/cjs/components/Grid/StyledCell.cjs.map +1 -1
- package/dist/cjs/components/Grid/StyledCell.css +146 -0
- package/dist/cjs/components/Grid/StyledCell.module.css.cjs +47 -0
- package/dist/cjs/components/Grid/StyledCell.module.css.cjs.map +1 -0
- package/dist/cjs/components/Grid/index.cjs +30 -30
- package/dist/cjs/components/Grid/index.cjs.map +1 -1
- package/dist/esm/click-ui.css +362 -0
- package/dist/esm/components/Assets/Icons/Horizontal-Loading.js +13 -49
- package/dist/esm/components/Assets/Icons/Horizontal-Loading.js.map +1 -1
- package/dist/esm/components/Assets/Icons/Loaders.css +94 -0
- package/dist/esm/components/Assets/Icons/Loaders.module.css.js +8 -0
- package/dist/esm/components/Assets/Icons/Loaders.module.css.js.map +1 -0
- package/dist/esm/components/Assets/Icons/Loading-Animated.js +9 -13
- package/dist/esm/components/Assets/Icons/Loading-Animated.js.map +1 -1
- package/dist/esm/components/Assets/Icons/Loading.js +13 -6
- package/dist/esm/components/Assets/Icons/Loading.js.map +1 -1
- package/dist/esm/components/Assets/Icons/system/IconsLight.js +2 -2
- package/dist/esm/components/Assets/Icons/system/IconsLight.js.map +1 -1
- package/dist/esm/components/DatePicker/DateRangePicker.js +14 -4
- package/dist/esm/components/DatePicker/DateRangePicker.js.map +1 -1
- package/dist/esm/components/DatePicker/index.js +2 -4
- package/dist/esm/components/DatePicker/index.js.map +1 -1
- package/dist/esm/components/DatePicker/utils.js +3 -1
- package/dist/esm/components/DatePicker/utils.js.map +1 -1
- package/dist/esm/components/Grid/Cell.js +1 -3
- package/dist/esm/components/Grid/Cell.js.map +1 -1
- package/dist/esm/components/Grid/ColumnResizer.css +22 -0
- package/dist/esm/components/Grid/ColumnResizer.js +18 -15
- package/dist/esm/components/Grid/ColumnResizer.js.map +1 -1
- package/dist/esm/components/Grid/ColumnResizer.module.css.js +7 -0
- package/dist/esm/components/Grid/ColumnResizer.module.css.js.map +1 -0
- package/dist/esm/components/Grid/Grid.css +34 -0
- package/dist/esm/components/Grid/Grid.module.css.js +13 -0
- package/dist/esm/components/Grid/Grid.module.css.js.map +1 -0
- package/dist/esm/components/Grid/Header.css +44 -0
- package/dist/esm/components/Grid/Header.js +22 -43
- package/dist/esm/components/Grid/Header.js.map +1 -1
- package/dist/esm/components/Grid/Header.module.css.js +13 -0
- package/dist/esm/components/Grid/Header.module.css.js.map +1 -0
- package/dist/esm/components/Grid/RowNumberColumn.css +22 -0
- package/dist/esm/components/Grid/RowNumberColumn.js +12 -29
- package/dist/esm/components/Grid/RowNumberColumn.js.map +1 -1
- package/dist/esm/components/Grid/RowNumberColumn.module.css.js +8 -0
- package/dist/esm/components/Grid/RowNumberColumn.module.css.js.map +1 -0
- package/dist/esm/components/Grid/StyledCell.css +146 -0
- package/dist/esm/components/Grid/StyledCell.js +84 -56
- package/dist/esm/components/Grid/StyledCell.js.map +1 -1
- package/dist/esm/components/Grid/StyledCell.module.css.js +32 -0
- package/dist/esm/components/Grid/StyledCell.module.css.js.map +1 -0
- package/dist/esm/components/Grid/index.js +30 -30
- package/dist/esm/components/Grid/index.js.map +1 -1
- package/dist/types/components/Assets/Icons/Horizontal-Loading.d.ts +2 -3
- package/dist/types/components/Assets/Icons/Loading-Animated.d.ts +2 -3
- package/dist/types/components/Assets/Icons/Loading.d.ts +2 -4
- package/dist/types/components/DatePicker/DateRangePicker.d.ts +2 -1
- package/dist/types/components/DatePicker/utils.d.ts +1 -0
- package/dist/types/components/Grid/RowNumberColumn.d.ts +1 -2
- package/dist/types/components/Grid/StyledCell.d.ts +10 -5
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const styles = {
|
|
6
|
+
"column-resizer": "column-resizer__8f12T",
|
|
7
|
+
"column-resizer_pressed": "column-resizer_pressed__JGAln"
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
exports.default = styles;
|
|
11
|
+
//# sourceMappingURL=ColumnResizer.module.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnResizer.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* `.grid` is the Grid's outer container. It is rendered as the ContextMenu.Trigger
|
|
3
|
+
* (the root element the whole grid mounts into), which is why the trigger carries
|
|
4
|
+
* the grid's own box styling rather than a context-menu-specific class.
|
|
5
|
+
*/
|
|
6
|
+
.grid__h49fk {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: var(--grid-height, 100%);
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
border-radius: var(--grid-radius);
|
|
11
|
+
background: var(--click-grid-body-cell-color-background-default);
|
|
12
|
+
outline: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.grid_bordered__kFqF5 {
|
|
16
|
+
border: 1px solid var(--click-grid-header-cell-color-stroke-default);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* react-window's inner element that lays out the scrolling cell grid */
|
|
20
|
+
.grid__inner__IZhj9 {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column-reverse;
|
|
23
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features -- the original styled rule used overflow-anchor */
|
|
24
|
+
overflow-anchor: none;
|
|
25
|
+
user-select: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.grid__data__Mn4TK {
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 0;
|
|
31
|
+
left: 0;
|
|
32
|
+
margin-top: var(--grid-data-top, 0);
|
|
33
|
+
margin-left: var(--grid-data-left, 0);
|
|
34
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const grid = "grid__h49fk";
|
|
6
|
+
const grid_bordered = "grid_bordered__kFqF5";
|
|
7
|
+
const grid__inner = "grid__inner__IZhj9";
|
|
8
|
+
const grid__data = "grid__data__Mn4TK";
|
|
9
|
+
const styles = {
|
|
10
|
+
grid: grid,
|
|
11
|
+
grid_bordered: grid_bordered,
|
|
12
|
+
grid__inner: grid__inner,
|
|
13
|
+
grid__data: grid__data
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.default = styles;
|
|
17
|
+
exports.grid = grid;
|
|
18
|
+
exports.grid__data = grid__data;
|
|
19
|
+
exports.grid__inner = grid__inner;
|
|
20
|
+
exports.grid_bordered = grid_bordered;
|
|
21
|
+
//# sourceMappingURL=Grid.module.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,54 +1,21 @@
|
|
|
1
|
+
require("./Header.css");
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
5
|
|
|
5
6
|
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
const
|
|
7
|
+
const cva = require('../../lib/cva.cjs');
|
|
8
|
+
const Header_module = require('./Header.module.css.cjs');
|
|
7
9
|
const StyledCell = require('./StyledCell.cjs');
|
|
8
10
|
const ColumnResizer = require('./ColumnResizer.cjs');
|
|
9
11
|
|
|
10
|
-
const
|
|
11
|
-
componentId: "sc-1oadqc8-0"
|
|
12
|
-
})(["position:sticky;top:0;left:0;display:flex;flex-direction:row;height:", "px;", ""], ({
|
|
13
|
-
$height
|
|
14
|
-
}) => $height, ({
|
|
15
|
-
$scrolledVertical,
|
|
16
|
-
theme
|
|
17
|
-
}) => $scrolledVertical ? `box-shadow: 0px 0 0px 1px ${theme.click.grid.header.cell.color.stroke.default};` : "");
|
|
18
|
-
const ScrollableHeaderContainer = styledComponents.styled.div.withConfig({
|
|
19
|
-
componentId: "sc-1oadqc8-1"
|
|
20
|
-
})(["position:relative;left:", "px;"], ({
|
|
21
|
-
$left
|
|
22
|
-
}) => $left);
|
|
23
|
-
const HeaderCellContainer = styledComponents.styled.div.withConfig({
|
|
24
|
-
componentId: "sc-1oadqc8-2"
|
|
25
|
-
})(["position:absolute;display:flex;width:", ";height:", "px;left:", "px;&:hover [data-resize]{background:", ";}"], ({
|
|
26
|
-
$width
|
|
27
|
-
}) => typeof $width === "string" ? $width : `${$width}px`, ({
|
|
28
|
-
$height
|
|
29
|
-
}) => $height, ({
|
|
30
|
-
$columnPosition
|
|
31
|
-
}) => $columnPosition, ({
|
|
32
|
-
theme
|
|
33
|
-
}) => theme.click.grid.header.cell.color.stroke.selectDirect);
|
|
34
|
-
const RowColumnContainer = styledComponents.styled(HeaderCellContainer).withConfig({
|
|
35
|
-
componentId: "sc-1oadqc8-3"
|
|
36
|
-
})(["position:sticky;top:0;left:0;width:", ";text-align:right;", ""], ({
|
|
37
|
-
$width
|
|
38
|
-
}) => typeof $width === "string" ? $width : `${$width}px`, ({
|
|
39
|
-
$scrolledHorizontal,
|
|
40
|
-
theme
|
|
41
|
-
}) => $scrolledHorizontal ? `box-shadow: 0px 0 0px 1px ${theme.click.grid.header.cell.color.stroke.default};` : "");
|
|
42
|
-
const RowColumn = styledComponents.styled(StyledCell.StyledCell).withConfig({
|
|
43
|
-
componentId: "sc-1oadqc8-4"
|
|
44
|
-
})(["width:100%;text-align:right;overflow:hidden;"]);
|
|
12
|
+
const toCssSize = ($width) => typeof $width === "string" ? $width : `${$width}px`;
|
|
45
13
|
const Column = ({
|
|
46
14
|
columnIndex,
|
|
47
15
|
cell,
|
|
48
16
|
getColumnWidth,
|
|
49
17
|
getColumnHorizontalPosition,
|
|
50
18
|
getSelectionType,
|
|
51
|
-
isFirstColumn,
|
|
52
19
|
isLastColumn,
|
|
53
20
|
onColumnResize,
|
|
54
21
|
height,
|
|
@@ -68,8 +35,12 @@ const Column = ({
|
|
|
68
35
|
const isSelected = selectionType === "selectDirect";
|
|
69
36
|
const isSelectedLeft = (leftSelectionType === "selectDirect" || isSelected) && leftSelectionType !== selectionType;
|
|
70
37
|
const columnWidth = getColumnWidth(columnIndex);
|
|
71
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
72
|
-
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Header_module.default["header__cell"], style: {
|
|
39
|
+
"--header-cell-width": toCssSize(columnWidth),
|
|
40
|
+
"--header-cell-height": `${height}px`,
|
|
41
|
+
"--header-cell-left": `${columnPosition}px`
|
|
42
|
+
}, "data-header": columnIndex, children: [
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledCell.StyledCell, { $type: "header", as: cell, columnIndex, type: "header-cell", $selectionType: selectionType, $isLastColumn: isLastColumn, $isFocused: false, $isSelectedLeft: isSelectedLeft, $isSelectedTop: isSelected, $isLastRow: false, $height: height, "data-grid-row": -1, "data-grid-column": columnIndex, "data-selected": isSelected, $showBorder: showBorder, width: columnWidth }),
|
|
73
44
|
/* @__PURE__ */ jsxRuntime.jsx(ColumnResizer.default, { height, onColumnResize, columnIndex, getResizerPosition, columnWidth, resizingState })
|
|
74
45
|
] });
|
|
75
46
|
};
|
|
@@ -94,11 +65,19 @@ const Header = ({
|
|
|
94
65
|
const selectedAllType = getSelectionType({
|
|
95
66
|
type: "all"
|
|
96
67
|
});
|
|
97
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
98
|
-
|
|
68
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cva.cn(Header_module.default["header"], scrolledVertical && Header_module.default["header_scrolled-vertical"]), style: {
|
|
69
|
+
"--header-height": `${height}px`
|
|
70
|
+
}, children: [
|
|
71
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: Header_module.default["header__scroll-area"], style: {
|
|
72
|
+
"--header-scroll-area-left": `${rowNumberWidth}px`
|
|
73
|
+
}, children: Array.from({
|
|
99
74
|
length: maxColumn - minColumn + 1
|
|
100
|
-
}, (_, index) => minColumn + index).map((columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(Column, { getSelectionType, columnIndex, getColumnWidth, getColumnHorizontalPosition, cell,
|
|
101
|
-
showRowNumber && /* @__PURE__ */ jsxRuntime.jsx(
|
|
75
|
+
}, (_, index) => minColumn + index).map((columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(Column, { getSelectionType, columnIndex, getColumnWidth, getColumnHorizontalPosition, cell, isLastColumn: columnIndex + 1 === columnCount, onColumnResize, height, getResizerPosition, showBorder, resizingState }, `header-${columnIndex}`)) }),
|
|
76
|
+
showRowNumber && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cva.cn(Header_module.default["header__cell"], Header_module.default["header__row-column"], scrolledHorizontal && Header_module.default["header__row-column_scrolled-horizontal"]), style: {
|
|
77
|
+
"--header-cell-width": toCssSize(rowNumberWidth),
|
|
78
|
+
"--header-cell-height": `${height}px`,
|
|
79
|
+
"--header-cell-left": "0px"
|
|
80
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(StyledCell.StyledCell, { "data-align": "right", "data-selected": selectedAllType === "selectDirect", $type: "header", $selectionType: selectedAllType, $isLastRow: false, $isLastColumn: false, $height: height, $isFocused: false, $isSelectedLeft: false, $isSelectedTop: false, "data-grid-row": -1, "data-grid-column": -1, $showBorder: showBorder, children: "#" }) })
|
|
102
81
|
] });
|
|
103
82
|
};
|
|
104
83
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.cjs","sources":["../../../../src/components/Grid/Header.tsx"],"sourcesContent":["import { styled } from 'styled-components';\nimport {\n CellProps,\n ColumnResizeFn,\n GetResizerPositionFn,\n SelectionTypeFn,\n} from './types';\nimport { StyledCell } from './StyledCell';\nimport ColumnResizer from './ColumnResizer';\nimport { ResizingState } from './useResizingState';\n\ninterface HeaderProps {\n showRowNumber: boolean;\n rowNumberWidth: number;\n minColumn: number;\n maxColumn: number;\n height: number;\n getColumnWidth: (index: number) => number;\n cell: CellProps;\n getSelectionType: SelectionTypeFn;\n columnCount: number;\n onColumnResize: ColumnResizeFn;\n getColumnHorizontalPosition: (columnIndex: number) => number;\n scrolledVertical: boolean;\n getResizerPosition: GetResizerPositionFn;\n showBorder: boolean;\n scrolledHorizontal: boolean;\n resizingState: ResizingState;\n}\n\nconst HeaderContainer = styled.div<{ $height: number; $scrolledVertical: boolean }>`\n position: sticky;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: row;\n height: ${({ $height }) => $height}px;\n ${({ $scrolledVertical, theme }) =>\n $scrolledVertical\n ? `box-shadow: 0px 0 0px 1px ${theme.click.grid.header.cell.color.stroke.default};`\n : ''}\n`;\n\nconst ScrollableHeaderContainer = styled.div<{\n $left: number;\n}>`\n position: relative;\n left: ${({ $left }) => $left}px;\n`;\n\ninterface ColumnProps extends Pick<\n HeaderProps,\n | 'cell'\n | 'getSelectionType'\n | 'onColumnResize'\n | 'getColumnWidth'\n | 'height'\n | 'getResizerPosition'\n | 'showBorder'\n | 'getColumnHorizontalPosition'\n | 'resizingState'\n> {\n columnIndex: number;\n isFirstColumn: boolean;\n isLastColumn: boolean;\n}\n\nconst HeaderCellContainer = styled.div<{\n $width: string | number;\n $height: number;\n $columnPosition: number;\n}>`\n position: absolute;\n display: flex;\n width: ${({ $width }) => (typeof $width === 'string' ? $width : `${$width}px`)};\n height: ${({ $height }) => $height}px;\n left: ${({ $columnPosition }) => $columnPosition}px;\n &:hover [data-resize] {\n background: ${({ theme }) => theme.click.grid.header.cell.color.stroke.selectDirect};\n }\n`;\n\nconst RowColumnContainer = styled(HeaderCellContainer)<{\n $width: string | number;\n $scrolledHorizontal: boolean;\n}>`\n position: sticky;\n top: 0;\n left: 0;\n width: ${({ $width }) => (typeof $width === 'string' ? $width : `${$width}px`)};\n text-align: right;\n ${({ $scrolledHorizontal, theme }) =>\n $scrolledHorizontal\n ? `box-shadow: 0px 0 0px 1px ${theme.click.grid.header.cell.color.stroke.default};`\n : ''}\n`;\n\nconst RowColumn = styled(StyledCell)`\n width: 100%;\n text-align: right;\n overflow: hidden;\n`;\n\nconst Column = ({\n columnIndex,\n cell,\n getColumnWidth,\n getColumnHorizontalPosition,\n getSelectionType,\n isFirstColumn,\n isLastColumn,\n onColumnResize,\n height,\n getResizerPosition,\n showBorder,\n resizingState,\n}: ColumnProps) => {\n const selectionType = getSelectionType({\n column: columnIndex,\n type: 'column',\n });\n const leftSelectionType = getSelectionType({\n column: columnIndex - 1,\n type: 'column',\n });\n const columnPosition = getColumnHorizontalPosition(columnIndex);\n\n const isSelected = selectionType === 'selectDirect';\n const isSelectedLeft =\n (leftSelectionType === 'selectDirect' || isSelected) &&\n leftSelectionType !== selectionType;\n\n const columnWidth = getColumnWidth(columnIndex);\n return (\n <HeaderCellContainer\n $width={columnWidth}\n $columnPosition={columnPosition}\n $height={height}\n data-header={columnIndex}\n >\n <StyledCell\n $type=\"header\"\n as={cell}\n columnIndex={columnIndex}\n type=\"header-cell\"\n $isFirstColumn={isFirstColumn}\n $selectionType={selectionType}\n $isLastColumn={isLastColumn}\n $isFocused={false}\n $isSelectedLeft={isSelectedLeft}\n $isSelectedTop={isSelected}\n $isLastRow={false}\n $isFirstRow\n $height={height}\n data-grid-row={-1}\n data-grid-column={columnIndex}\n data-selected={isSelected}\n $showBorder={showBorder}\n width={columnWidth}\n />\n <ColumnResizer\n height={height}\n onColumnResize={onColumnResize}\n columnIndex={columnIndex}\n getResizerPosition={getResizerPosition}\n columnWidth={columnWidth}\n resizingState={resizingState}\n />\n </HeaderCellContainer>\n );\n};\n\nconst Header = ({\n scrolledVertical,\n scrolledHorizontal,\n showRowNumber,\n rowNumberWidth,\n minColumn,\n maxColumn,\n height,\n getColumnWidth,\n cell,\n columnCount,\n getSelectionType,\n onColumnResize,\n getColumnHorizontalPosition,\n getResizerPosition,\n showBorder,\n resizingState,\n}: HeaderProps) => {\n const selectedAllType = getSelectionType({\n type: 'all',\n });\n return (\n <HeaderContainer\n $height={height}\n $scrolledVertical={scrolledVertical}\n >\n <ScrollableHeaderContainer $left={rowNumberWidth}>\n {Array.from(\n { length: maxColumn - minColumn + 1 },\n (_, index) => minColumn + index\n ).map(columnIndex => (\n <Column\n key={`header-${columnIndex}`}\n getSelectionType={getSelectionType}\n columnIndex={columnIndex}\n getColumnWidth={getColumnWidth}\n getColumnHorizontalPosition={getColumnHorizontalPosition}\n cell={cell}\n isFirstColumn={columnIndex === 0 && !showRowNumber}\n isLastColumn={columnIndex + 1 === columnCount}\n onColumnResize={onColumnResize}\n height={height}\n getResizerPosition={getResizerPosition}\n showBorder={showBorder}\n resizingState={resizingState}\n />\n ))}\n </ScrollableHeaderContainer>\n {showRowNumber && (\n <RowColumnContainer\n $width={rowNumberWidth}\n $height={height}\n $columnPosition={0}\n $scrolledHorizontal={scrolledHorizontal}\n >\n <RowColumn\n data-selected={selectedAllType === 'selectDirect'}\n $type=\"header\"\n $isFirstRow\n $isFirstColumn\n $selectionType={selectedAllType}\n $isLastRow={false}\n $isLastColumn={false}\n $height={height}\n $isFocused={false}\n $isSelectedLeft={false}\n $isSelectedTop={false}\n data-grid-row={-1}\n data-grid-column={-1}\n $showBorder={showBorder}\n >\n #\n </RowColumn>\n </RowColumnContainer>\n )}\n </HeaderContainer>\n );\n};\n\nexport default Header;\n"],"names":["HeaderContainer","styled","div","withConfig","componentId","$height","$scrolledVertical","theme","click","grid","header","cell","color","stroke","default","ScrollableHeaderContainer","$left","HeaderCellContainer","$width","$columnPosition","selectDirect","RowColumnContainer","$scrolledHorizontal","RowColumn","StyledCell","Column","columnIndex","getColumnWidth","getColumnHorizontalPosition","getSelectionType","isFirstColumn","isLastColumn","onColumnResize","height","getResizerPosition","showBorder","resizingState","selectionType","column","type","leftSelectionType","columnPosition","isSelected","isSelectedLeft","columnWidth","jsxs","jsx","ColumnResizer","Header","scrolledVertical","scrolledHorizontal","showRowNumber","rowNumberWidth","minColumn","maxColumn","columnCount","selectedAllType","Array","from","length","_","index","map"],"mappings":";;;;;;;;;AA8BA,MAAMA,eAAAA,GAAkBC,uBAAAA,CAAOC,GAAAA,CAAGC,UAAAA,CAAA;AAAA,EAAAC,WAAAA,EAAA;AAAA,CAAA,EAAA,CAAA,sEAAA,EAAA,KAAA,EAAA,EAAA,GAMtB,CAAC;AAAA,EAAEC;AAAQ,CAAA,KAAMA,SACzB,CAAC;AAAA,EAAEC,iBAAAA;AAAAA,EAAmBC;AAAM,CAAA,KAC5BD,iBAAAA,GACI,CAAA,0BAAA,EAA6BC,KAAAA,CAAMC,KAAAA,CAAMC,IAAAA,CAAKC,MAAAA,CAAOC,IAAAA,CAAKC,KAAAA,CAAMC,MAAAA,CAAOC,OAAO,CAAA,CAAA,CAAA,GAC9E,EAAE,CAAA;AAGV,MAAMC,yBAAAA,GAA4Bd,uBAAAA,CAAOC,GAAAA,CAAGC,UAAAA,CAAA;AAAA,EAAAC,WAAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,yBAAA,EAAA,KAAA,GAIlC,CAAC;AAAA,EAAEY;AAAM,CAAA,KAAMA,KAAK,CAAA;AAoB9B,MAAMC,mBAAAA,GAAsBhB,uBAAAA,CAAOC,GAAAA,CAAGC,UAAAA,CAAA;AAAA,EAAAC,W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AA,EACA,YACA,aAAA,EAAA,EAZK,CAAA,OAAA,EAAU7B,WAAW,CAAA,CAYG,CAEhC,CAAA,EACH,CAAA;AAAA,IACCyB,iCACCL,cAAA,CAAC,kBAAA,EAAA,EACC,QAAQM,cAAAA,EACR,OAAA,EAASnB,QACT,eAAA,EAAiB,CAAA,EACjB,qBAAqBiB,kBAAAA,EAErB,QAAA,kBAAAJ,cAAA,CAAC,aACC,eAAA,EAAeU,eAAAA,KAAoB,gBACnC,KAAA,EAAM,QAAA,EACN,aAAW,IAAA,EACX,cAAA,EAAc,MACd,cAAA,EAAgBA,eAAAA,EAChB,YAAY,KAAA,EACZ,aAAA,EAAe,OACf,OAAA,EAASvB,MAAAA,EACT,YAAY,KAAA,EACZ,eAAA,EAAiB,OACjB,cAAA,EAAgB,KAAA,EAChB,iBAAe,EAAA,EACf,kBAAA,EAAkB,IAClB,WAAA,EAAaE,UAAAA,EAAW,eAG1B,CAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"Header.cjs","sources":["../../../../src/components/Grid/Header.tsx"],"sourcesContent":["import { CSSProperties } from 'react';\nimport { cn } from '@/lib/cva';\nimport styles from './Header.module.css';\nimport {\n CellProps,\n ColumnResizeFn,\n GetResizerPositionFn,\n SelectionTypeFn,\n} from './types';\nimport { StyledCell } from './StyledCell';\nimport ColumnResizer from './ColumnResizer';\nimport { ResizingState } from './useResizingState';\n\ninterface HeaderProps {\n showRowNumber: boolean;\n rowNumberWidth: number;\n minColumn: number;\n maxColumn: number;\n height: number;\n getColumnWidth: (index: number) => number;\n cell: CellProps;\n getSelectionType: SelectionTypeFn;\n columnCount: number;\n onColumnResize: ColumnResizeFn;\n getColumnHorizontalPosition: (columnIndex: number) => number;\n scrolledVertical: boolean;\n getResizerPosition: GetResizerPositionFn;\n showBorder: boolean;\n scrolledHorizontal: boolean;\n resizingState: ResizingState;\n}\n\ninterface ColumnProps extends Pick<\n HeaderProps,\n | 'cell'\n | 'getSelectionType'\n | 'onColumnResize'\n | 'getColumnWidth'\n | 'height'\n | 'getResizerPosition'\n | 'showBorder'\n | 'getColumnHorizontalPosition'\n | 'resizingState'\n> {\n columnIndex: number;\n isLastColumn: boolean;\n}\n\nconst toCssSize = ($width: string | number): string =>\n typeof $width === 'string' ? $width : `${$width}px`;\n\nconst Column = ({\n columnIndex,\n cell,\n getColumnWidth,\n getColumnHorizontalPosition,\n getSelectionType,\n isLastColumn,\n onColumnResize,\n height,\n getResizerPosition,\n showBorder,\n resizingState,\n}: ColumnProps) => {\n const selectionType = getSelectionType({\n column: columnIndex,\n type: 'column',\n });\n const leftSelectionType = getSelectionType({\n column: columnIndex - 1,\n type: 'column',\n });\n const columnPosition = getColumnHorizontalPosition(columnIndex);\n\n const isSelected = selectionType === 'selectDirect';\n const isSelectedLeft =\n (leftSelectionType === 'selectDirect' || isSelected) &&\n leftSelectionType !== selectionType;\n\n const columnWidth = getColumnWidth(columnIndex);\n return (\n <div\n className={styles['header__cell']}\n style={\n {\n '--header-cell-width': toCssSize(columnWidth),\n '--header-cell-height': `${height}px`,\n '--header-cell-left': `${columnPosition}px`,\n } as CSSProperties\n }\n data-header={columnIndex}\n >\n <StyledCell\n $type=\"header\"\n as={cell}\n columnIndex={columnIndex}\n type=\"header-cell\"\n $selectionType={selectionType}\n $isLastColumn={isLastColumn}\n $isFocused={false}\n $isSelectedLeft={isSelectedLeft}\n $isSelectedTop={isSelected}\n $isLastRow={false}\n $height={height}\n data-grid-row={-1}\n data-grid-column={columnIndex}\n data-selected={isSelected}\n $showBorder={showBorder}\n width={columnWidth}\n />\n <ColumnResizer\n height={height}\n onColumnResize={onColumnResize}\n columnIndex={columnIndex}\n getResizerPosition={getResizerPosition}\n columnWidth={columnWidth}\n resizingState={resizingState}\n />\n </div>\n );\n};\n\nconst Header = ({\n scrolledVertical,\n scrolledHorizontal,\n showRowNumber,\n rowNumberWidth,\n minColumn,\n maxColumn,\n height,\n getColumnWidth,\n cell,\n columnCount,\n getSelectionType,\n onColumnResize,\n getColumnHorizontalPosition,\n getResizerPosition,\n showBorder,\n resizingState,\n}: HeaderProps) => {\n const selectedAllType = getSelectionType({\n type: 'all',\n });\n return (\n <div\n className={cn(\n styles['header'],\n scrolledVertical && styles['header_scrolled-vertical']\n )}\n style={{ '--header-height': `${height}px` } as CSSProperties}\n >\n <div\n className={styles['header__scroll-area']}\n style={{ '--header-scroll-area-left': `${rowNumberWidth}px` } as CSSProperties}\n >\n {Array.from(\n { length: maxColumn - minColumn + 1 },\n (_, index) => minColumn + index\n ).map(columnIndex => (\n <Column\n key={`header-${columnIndex}`}\n getSelectionType={getSelectionType}\n columnIndex={columnIndex}\n getColumnWidth={getColumnWidth}\n getColumnHorizontalPosition={getColumnHorizontalPosition}\n cell={cell}\n isLastColumn={columnIndex + 1 === columnCount}\n onColumnResize={onColumnResize}\n height={height}\n getResizerPosition={getResizerPosition}\n showBorder={showBorder}\n resizingState={resizingState}\n />\n ))}\n </div>\n {showRowNumber && (\n <div\n className={cn(\n styles['header__cell'],\n styles['header__row-column'],\n scrolledHorizontal && styles['header__row-column_scrolled-horizontal']\n )}\n style={\n {\n '--header-cell-width': toCssSize(rowNumberWidth),\n '--header-cell-height': `${height}px`,\n '--header-cell-left': '0px',\n } as CSSProperties\n }\n >\n <StyledCell\n data-align=\"right\"\n data-selected={selectedAllType === 'selectDirect'}\n $type=\"header\"\n $selectionType={selectedAllType}\n $isLastRow={false}\n $isLastColumn={false}\n $height={height}\n $isFocused={false}\n $isSelectedLeft={false}\n $isSelectedTop={false}\n data-grid-row={-1}\n data-grid-column={-1}\n $showBorder={showBorder}\n >\n #\n </StyledCell>\n </div>\n )}\n </div>\n );\n};\n\nexport default Header;\n"],"names":["toCssSize","$width","Column","columnIndex","cell","getColumnWidth","getColumnHorizontalPosition","getSelectionType","isLastColumn","onColumnResize","height","getResizerPosition","showBorder","resizingState","selectionType","column","type","leftSelectionType","columnPosition","isSelected","isSelectedLeft","columnWidth","styles","jsx","StyledCell","ColumnResizer","Header","scrolledVertical","scrolledHorizontal","showRowNumber","rowNumberWidth","minColumn","maxColumn","columnCount","selectedAllType","jsxs","cn","Array","from","length","_","index","map"],"mappings":";;;;;;;;;;AAgDA,MAAMA,SAAAA,GAAYA,CAACC,MAAAA,KACjB,OAAOA,WAAW,QAAA,GAAWA,MAAAA,GAAS,GAAGA,MAAM,CAAA,EAAA,CAAA;AAEjD,MAAMC,SAASA,CAAC;AAAA,EACdC,WAAAA;AAAAA,EACAC,IAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,2BAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,MAAAA;AAAAA,EACAC,kBAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC;AACW,CAAA,KAAM;AACjB,EAAA,MAAMC,gBAAgBP,gBAAAA,CAAiB;AAAA,IACrCQ,MAAAA,EAAQZ,WAAAA;AAAAA,IACRa,IAAAA,EAAM;AAAA,GACP,CAAA;AACD,EAAA,MAAMC,oBAAoBV,gBAAAA,CAAiB;AAAA,IACzCQ,QAAQZ,WAAAA,GAAc,CAAA;AAAA,IACtBa,IAAAA,EAAM;AAAA,GACP,CAAA;AACD,EAAA,MAAME,cAAAA,GAAiBZ,4BAA4BH,WAAW,CAAA;AAE9D,EAAA,MAAMgB,aAAaL,aAAAA,KAAkB,cAAA;AACrC,EAAA,MAAMM,cAAAA,GAAAA,CACHH,iBAAAA,KAAsB,cAAA,IAAkBE,UAAAA,KACzCF,iBAAAA,KAAsBH,aAAAA;AAExB,EAAA,MAAMO,WAAAA,GAAchB,eAAeF,WAAW,CAAA;AAC9C,EAAA,uCACG,KAAA,EAAA,EACC,SAAA,EAAWmB,qBAAAA,CAAO,cAAc,GAChC,KAAA,EACE;AAAA,IACE,qBAAA,EAAuBtB,UAAUqB,WAAW,CAAA;AAAA,IAC5C,sBAAA,EAAwB,GAAGX,MAAM,CAAA,EAAA,CAA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,EACnC,KAAA,EAAM,QAAA,EACN,cAAA,EAAgBA,eAAAA,EAChB,YAAY,KAAA,EACZ,aAAA,EAAe,KAAA,EACf,OAAA,EAASxB,MAAAA,EACT,UAAA,EAAY,KAAA,EACZ,eAAA,EAAiB,OACjB,cAAA,EAAgB,KAAA,EAChB,eAAA,EAAe,EAAA,EACf,kBAAA,EAAkB,EAAA,EAClB,WAAA,EAAaE,UAAAA,EAAW,eAG1B,CAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* stylelint-disable custom-property-pattern -- design tokens use camelCase (e.g. selectDirect) */
|
|
2
|
+
|
|
3
|
+
.header__hXzAE {
|
|
4
|
+
display: flex;
|
|
5
|
+
position: sticky;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
height: var(--header-height);
|
|
9
|
+
flex-direction: row;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.header_scrolled-vertical__mIp2- {
|
|
13
|
+
box-shadow: 0 0 0 1px var(--click-grid-header-cell-color-stroke-default);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.header__scroll-area__Nok8G {
|
|
17
|
+
position: relative;
|
|
18
|
+
left: var(--header-scroll-area-left);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.header__cell__ZCE9p {
|
|
22
|
+
display: flex;
|
|
23
|
+
position: absolute;
|
|
24
|
+
left: var(--header-cell-left);
|
|
25
|
+
width: var(--header-cell-width);
|
|
26
|
+
height: var(--header-cell-height);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.header__cell__ZCE9p:hover [data-resize] {
|
|
30
|
+
background: var(--click-grid-header-cell-color-stroke-selectDirect);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* the sticky "select all" corner extends a header cell (styled(HeaderCellContainer)) */
|
|
34
|
+
.header__row-column__ceu5w {
|
|
35
|
+
position: sticky;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
width: var(--header-cell-width);
|
|
39
|
+
text-align: right;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.header__row-column_scrolled-horizontal__QZO4p {
|
|
43
|
+
box-shadow: 0 0 0 1px var(--click-grid-header-cell-color-stroke-default);
|
|
44
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const header = "header__hXzAE";
|
|
6
|
+
const header__cell = "header__cell__ZCE9p";
|
|
7
|
+
const styles = {
|
|
8
|
+
header: header,
|
|
9
|
+
"header_scrolled-vertical": "header_scrolled-vertical__mIp2-",
|
|
10
|
+
"header__scroll-area": "header__scroll-area__Nok8G",
|
|
11
|
+
header__cell: header__cell,
|
|
12
|
+
"header__row-column": "header__row-column__ceu5w",
|
|
13
|
+
"header__row-column_scrolled-horizontal": "header__row-column_scrolled-horizontal__QZO4p"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.default = styles;
|
|
17
|
+
exports.header = header;
|
|
18
|
+
exports.header__cell = header__cell;
|
|
19
|
+
//# sourceMappingURL=Header.module.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,40 +1,18 @@
|
|
|
1
|
+
require("./RowNumberColumn.css");
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
5
|
|
|
5
6
|
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
const
|
|
7
|
+
const cva = require('../../lib/cva.cjs');
|
|
8
|
+
const RowNumberColumn_module = require('./RowNumberColumn.module.css.cjs');
|
|
7
9
|
const StyledCell = require('./StyledCell.cjs');
|
|
8
10
|
|
|
9
|
-
const RowNumberColumnContainer = styledComponents.styled.div.withConfig({
|
|
10
|
-
componentId: "sc-7gbi4d-0"
|
|
11
|
-
})(["position:sticky;left:0;", " ", ""], ({
|
|
12
|
-
$height,
|
|
13
|
-
$width
|
|
14
|
-
}) => `
|
|
15
|
-
top: ${$height}px;
|
|
16
|
-
width: ${$width}px;
|
|
17
|
-
height: 100%;
|
|
18
|
-
`, ({
|
|
19
|
-
$scrolledHorizontal,
|
|
20
|
-
theme
|
|
21
|
-
}) => $scrolledHorizontal ? `box-shadow: 0px 0 0px 1px ${theme.click.grid.header.cell.color.stroke.default};` : "");
|
|
22
|
-
const RowNumberCell = styledComponents.styled.div.withConfig({
|
|
23
|
-
componentId: "sc-7gbi4d-1"
|
|
24
|
-
})(["position:absolute;left:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;", ""], ({
|
|
25
|
-
$height,
|
|
26
|
-
$rowNumber,
|
|
27
|
-
$rowAutoHeight
|
|
28
|
-
}) => `
|
|
29
|
-
top: ${$height * $rowNumber}px;
|
|
30
|
-
height: ${$rowAutoHeight ? "100%" : `${$height}px`};
|
|
31
|
-
`);
|
|
32
11
|
const RowNumber = ({
|
|
33
12
|
rowIndex,
|
|
34
13
|
rowHeight,
|
|
35
14
|
getSelectionType,
|
|
36
15
|
isLastRow,
|
|
37
|
-
isFirstRow,
|
|
38
16
|
showBorder,
|
|
39
17
|
rowStart,
|
|
40
18
|
rowAutoHeight
|
|
@@ -50,7 +28,10 @@ const RowNumber = ({
|
|
|
50
28
|
type: "row"
|
|
51
29
|
});
|
|
52
30
|
const isSelectedTop = (topSelectionType === "selectDirect" || isSelected) && topSelectionType !== selectionType;
|
|
53
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: RowNumberColumn_module.default["row-number-column__cell"], style: {
|
|
32
|
+
"--row-number-cell-top": `${rowHeight * rowIndex}px`,
|
|
33
|
+
"--row-number-cell-height": rowAutoHeight ? "100%" : `${rowHeight}px`
|
|
34
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(StyledCell.StyledCell, { $height: rowHeight, $isLastColumn: false, $selectionType: selectionType, $type: "header", $isFocused: false, $isLastRow: isLastRow, $isSelectedLeft: isSelected, $isSelectedTop: isSelectedTop, $rowAutoHeight: rowAutoHeight, "data-selected": isSelected, "data-grid-row": currentRowIndex, "data-grid-column": -1, "data-testid": `header-cell-${currentRowIndex}-x`, $showBorder: showBorder, "data-align": "right", children: currentRowIndex }) });
|
|
54
35
|
};
|
|
55
36
|
const RowNumberColumn = ({
|
|
56
37
|
minRow,
|
|
@@ -60,15 +41,17 @@ const RowNumberColumn = ({
|
|
|
60
41
|
rowWidth,
|
|
61
42
|
getSelectionType,
|
|
62
43
|
rowCount,
|
|
63
|
-
showHeader,
|
|
64
44
|
scrolledHorizontal,
|
|
65
45
|
rowStart = 0,
|
|
66
46
|
showBorder,
|
|
67
47
|
rowAutoHeight
|
|
68
48
|
}) => {
|
|
69
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cva.cn(RowNumberColumn_module.default["row-number-column"], scrolledHorizontal && RowNumberColumn_module.default["row-number-column_scrolled-horizontal"]), style: {
|
|
50
|
+
"--row-number-column-top": `${headerHeight}px`,
|
|
51
|
+
"--row-number-column-width": `${rowWidth}px`
|
|
52
|
+
}, children: Array.from({
|
|
70
53
|
length: maxRow - minRow + 1
|
|
71
|
-
}, (_, index) => minRow + index).map((rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(RowNumber, { getSelectionType, rowHeight, rowIndex, isLastRow: rowIndex === rowCount,
|
|
54
|
+
}, (_, index) => minRow + index).map((rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(RowNumber, { getSelectionType, rowHeight, rowIndex, isLastRow: rowIndex === rowCount, showBorder, rowStart, rowAutoHeight }, `row-number-${rowIndex}`)) });
|
|
72
55
|
};
|
|
73
56
|
|
|
74
57
|
exports.default = RowNumberColumn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowNumberColumn.cjs","sources":["../../../../src/components/Grid/RowNumberColumn.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"RowNumberColumn.cjs","sources":["../../../../src/components/Grid/RowNumberColumn.tsx"],"sourcesContent":["import { CSSProperties } from 'react';\nimport { cn } from '@/lib/cva';\nimport styles from './RowNumberColumn.module.css';\nimport { SelectionTypeFn } from './types';\nimport { StyledCell } from './StyledCell';\n\ninterface RowNumberColumnProps {\n minRow: number;\n maxRow: number;\n rowHeight: number;\n headerHeight: number;\n rowWidth: number;\n getSelectionType: SelectionTypeFn;\n rowCount: number;\n scrolledHorizontal: boolean;\n rowStart: number;\n showBorder: boolean;\n rowAutoHeight?: boolean;\n}\ninterface RowNumberProps extends Pick<\n RowNumberColumnProps,\n 'rowHeight' | 'getSelectionType' | 'showBorder' | 'rowStart'\n> {\n rowIndex: number;\n isLastRow: boolean;\n rowAutoHeight?: boolean;\n}\nconst RowNumber = ({\n rowIndex,\n rowHeight,\n getSelectionType,\n isLastRow,\n showBorder,\n rowStart,\n rowAutoHeight,\n}: RowNumberProps) => {\n const currentRowIndex = rowIndex + rowStart;\n const selectionType = getSelectionType({\n row: currentRowIndex,\n type: 'row',\n });\n const isSelected = selectionType === 'selectDirect';\n const topSelectionType = getSelectionType({\n row: currentRowIndex - 1,\n type: 'row',\n });\n const isSelectedTop =\n (topSelectionType === 'selectDirect' || isSelected) &&\n topSelectionType !== selectionType;\n\n return (\n <div\n className={styles['row-number-column__cell']}\n style={\n {\n '--row-number-cell-top': `${rowHeight * rowIndex}px`,\n '--row-number-cell-height': rowAutoHeight ? '100%' : `${rowHeight}px`,\n } as CSSProperties\n }\n >\n <StyledCell\n $height={rowHeight}\n $isLastColumn={false}\n $selectionType={selectionType}\n $type=\"header\"\n $isFocused={false}\n $isLastRow={isLastRow}\n $isSelectedLeft={isSelected}\n $isSelectedTop={isSelectedTop}\n $rowAutoHeight={rowAutoHeight}\n data-selected={isSelected}\n data-grid-row={currentRowIndex}\n data-grid-column={-1}\n data-testid={`header-cell-${currentRowIndex}-x`}\n $showBorder={showBorder}\n data-align=\"right\"\n >\n {currentRowIndex}\n </StyledCell>\n </div>\n );\n};\n\nconst RowNumberColumn = ({\n minRow,\n maxRow,\n rowHeight,\n headerHeight,\n rowWidth,\n getSelectionType,\n rowCount,\n scrolledHorizontal,\n rowStart = 0,\n showBorder,\n rowAutoHeight,\n}: RowNumberColumnProps) => {\n return (\n <div\n className={cn(\n styles['row-number-column'],\n scrolledHorizontal && styles['row-number-column_scrolled-horizontal']\n )}\n style={\n {\n '--row-number-column-top': `${headerHeight}px`,\n '--row-number-column-width': `${rowWidth}px`,\n } as CSSProperties\n }\n >\n {Array.from({ length: maxRow - minRow + 1 }, (_, index) => minRow + index).map(\n rowIndex => (\n <RowNumber\n key={`row-number-${rowIndex}`}\n getSelectionType={getSelectionType}\n rowHeight={rowHeight}\n rowIndex={rowIndex}\n isLastRow={rowIndex === rowCount}\n showBorder={showBorder}\n rowStart={rowStart}\n rowAutoHeight={rowAutoHeight}\n />\n )\n )}\n </div>\n );\n};\n\nexport default RowNumberColumn;\n"],"names":["RowNumber","rowIndex","rowHeight","getSelectionType","isLastRow","showBorder","rowStart","rowAutoHeight","currentRowIndex","selectionType","row","type","isSelected","topSelectionType","isSelectedTop","styles","jsx","StyledCell","RowNumberColumn","minRow","maxRow","headerHeight","rowWidth","rowCount","scrolledHorizontal","cn","Array","from","length","_","index","map"],"mappings":";;;;;;;;;AA2BA,MAAMA,YAAYA,CAAC;AAAA,EACjBC,QAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC;AACc,CAAA,KAA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AAAA,EACAC,MAAAA;AAAAA,EACAlB,SAAAA;AAAAA,EACAmB,YAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAnB,gBAAAA;AAAAA,EACAoB,QAAAA;AAAAA,EACAC,kBAAAA;AAAAA,EACAlB,QAAAA,GAAW,CAAA;AAAA,EACXD,UAAAA;AAAAA,EACAE;AACoB,CAAA,KAAM;AAC1B,EAAA,uBACES,cAAA,CAAC,KAAA,EAAA,EACC,SAAA,EAAWS,MAAAA,CACTV,8BAAAA,CAAO,mBAAmB,CAAA,EAC1BS,kBAAAA,IAAsBT,8BAAAA,CAAO,uCAAuC,CACtE,CAAA,EACA,KAAA,EACE;AAAA,IACE,yBAAA,EAA2B,GAAGM,YAAY,CAAA,EAAA,CAAA;AAAA,IAC1C,2BAAA,EAA6B,GAAGC,QAAQ,CAAA,EAAA;AAAA,GAC1C,EAGDI,gBAAMC,IAAAA,CAAK;AAAA,IAAEC,MAAAA,EAAQR,SAASD,MAAAA,GAAS;AAAA,GAAE,EAAG,CAACU,CAAAA,EAAGC,KAAAA,KAAUX,MAAAA,GAASW,KAAK,CAAA,CAAEC,GAAAA,CACzE9B,CAAAA,QAAAA,qBACEe,cAAA,CAAC,SAAA,EAAA,EAEC,gBAAA,EACA,WACA,QAAA,EACA,SAAA,EAAWf,QAAAA,KAAasB,QAAAA,EACxB,UAAA,EACA,QAAA,EACA,iBAPK,CAAA,WAAA,EAActB,QAAQ,CAAA,EAUjC,CAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.row-number-column__n-aQm {
|
|
2
|
+
position: sticky;
|
|
3
|
+
top: var(--row-number-column-top);
|
|
4
|
+
left: 0;
|
|
5
|
+
width: var(--row-number-column-width);
|
|
6
|
+
height: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.row-number-column_scrolled-horizontal__L9fAB {
|
|
10
|
+
box-shadow: 0 0 0 1px var(--click-grid-header-cell-color-stroke-default);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.row-number-column__cell__00w03 {
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: var(--row-number-cell-top);
|
|
16
|
+
left: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: var(--row-number-cell-height);
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const styles = {
|
|
6
|
+
"row-number-column": "row-number-column__n-aQm",
|
|
7
|
+
"row-number-column_scrolled-horizontal": "row-number-column_scrolled-horizontal__L9fAB",
|
|
8
|
+
"row-number-column__cell": "row-number-column__cell__00w03"
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.default = styles;
|
|
12
|
+
//# sourceMappingURL=RowNumberColumn.module.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowNumberColumn.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1,70 +1,98 @@
|
|
|
1
|
+
require("./StyledCell.css");
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const cva = require('../../lib/cva.cjs');
|
|
8
|
+
const StyledCell_module = require('./StyledCell.module.css.cjs');
|
|
9
|
+
const classVarianceAuthority = require('class-variance-authority');
|
|
6
10
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
const cellVariants = classVarianceAuthority.cva(StyledCell_module.default.cell, {
|
|
12
|
+
variants: {
|
|
13
|
+
type: {
|
|
14
|
+
body: StyledCell_module.default.cell_type_body,
|
|
15
|
+
header: StyledCell_module.default.cell_type_header
|
|
16
|
+
},
|
|
17
|
+
selection: {
|
|
18
|
+
default: null,
|
|
19
|
+
selectDirect: StyledCell_module.default["cell_selection_direct"],
|
|
20
|
+
selectIndirect: StyledCell_module.default["cell_selection_indirect"]
|
|
21
|
+
},
|
|
22
|
+
noBorder: {
|
|
23
|
+
true: StyledCell_module.default["cell_no-border"]
|
|
24
|
+
},
|
|
25
|
+
focused: {
|
|
26
|
+
true: StyledCell_module.default.cell_focused
|
|
27
|
+
},
|
|
28
|
+
lastRow: {
|
|
29
|
+
true: StyledCell_module.default["cell_last-row"]
|
|
30
|
+
},
|
|
31
|
+
lastColumn: {
|
|
32
|
+
true: StyledCell_module.default["cell_last-column"]
|
|
33
|
+
},
|
|
34
|
+
rowAutoHeight: {
|
|
35
|
+
true: StyledCell_module.default["cell_row-auto-height"]
|
|
36
|
+
},
|
|
37
|
+
overlay: {
|
|
38
|
+
true: StyledCell_module.default.cell__overlay
|
|
39
|
+
},
|
|
40
|
+
overlayTop: {
|
|
41
|
+
true: StyledCell_module.default["cell__overlay_selected_top"]
|
|
42
|
+
},
|
|
43
|
+
overlayLeft: {
|
|
44
|
+
true: StyledCell_module.default["cell__overlay_selected_left"]
|
|
45
|
+
},
|
|
46
|
+
overlayBottom: {
|
|
47
|
+
true: StyledCell_module.default["cell__overlay_selected_bottom"]
|
|
48
|
+
},
|
|
49
|
+
overlayRight: {
|
|
50
|
+
true: StyledCell_module.default["cell__overlay_selected_right"]
|
|
51
|
+
},
|
|
52
|
+
overlayAutoHeight: {
|
|
53
|
+
true: StyledCell_module.default["cell__overlay_row-auto-height"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const StyledCell = ({
|
|
58
|
+
as,
|
|
11
59
|
$isFocused,
|
|
60
|
+
$selectionType,
|
|
61
|
+
$isSelectedTop,
|
|
62
|
+
$isSelectedLeft,
|
|
12
63
|
$isLastRow,
|
|
13
64
|
$isLastColumn,
|
|
14
|
-
$selectionType,
|
|
15
65
|
$height,
|
|
16
66
|
$type = "body",
|
|
17
67
|
$showBorder,
|
|
18
|
-
$rowAutoHeight
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
$
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
$isLastRow,
|
|
47
|
-
$isLastColumn,
|
|
48
|
-
$selectionType,
|
|
49
|
-
$type = "body",
|
|
50
|
-
$isSelectedTop,
|
|
51
|
-
$isSelectedLeft,
|
|
52
|
-
$rowAutoHeight
|
|
53
|
-
}) => $isSelectedTop || $isSelectedLeft || $selectionType === "selectDirect" && ($isLastRow || $isLastColumn) || $rowAutoHeight ? `
|
|
54
|
-
&::before {
|
|
55
|
-
content: "";
|
|
56
|
-
position: absolute;
|
|
57
|
-
top: 0;
|
|
58
|
-
bottom: 0;
|
|
59
|
-
right: 0;
|
|
60
|
-
left: 0;
|
|
61
|
-
${$isSelectedTop ? `border-top: 1px solid ${theme.click.grid[$type].cell.color.stroke.selectDirect};` : ""}
|
|
62
|
-
${$isSelectedLeft ? `border-left: 1px solid ${theme.click.grid[$type].cell.color.stroke.selectDirect};` : ""}
|
|
63
|
-
${$selectionType === "selectDirect" && $isLastRow ? `border-bottom: 1px solid ${theme.click.grid[$type].cell.color.stroke.selectDirect};` : ""}
|
|
64
|
-
${$selectionType === "selectDirect" && $isLastColumn ? `border-right: 1px solid ${theme.click.grid[$type].cell.color.stroke.selectDirect};` : ""}
|
|
65
|
-
${$rowAutoHeight && "border: none;"}
|
|
66
|
-
}
|
|
67
|
-
` : "");
|
|
68
|
+
$rowAutoHeight,
|
|
69
|
+
className,
|
|
70
|
+
style,
|
|
71
|
+
children,
|
|
72
|
+
...props
|
|
73
|
+
}) => {
|
|
74
|
+
const Component = as ?? "div";
|
|
75
|
+
const hasOverlay = $isSelectedTop || $isSelectedLeft || $selectionType === "selectDirect" && ($isLastRow || $isLastColumn) || !!$rowAutoHeight;
|
|
76
|
+
const mergedStyle = {
|
|
77
|
+
height: $rowAutoHeight ? "100%" : `${$height}px`,
|
|
78
|
+
...style
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Component, { className: cva.cn(cellVariants({
|
|
81
|
+
type: $type,
|
|
82
|
+
selection: $selectionType,
|
|
83
|
+
noBorder: $type === "header" && !$showBorder,
|
|
84
|
+
focused: $isFocused,
|
|
85
|
+
lastRow: $isLastRow,
|
|
86
|
+
lastColumn: $isLastColumn,
|
|
87
|
+
rowAutoHeight: !!$rowAutoHeight,
|
|
88
|
+
overlay: hasOverlay,
|
|
89
|
+
overlayTop: $isSelectedTop,
|
|
90
|
+
overlayLeft: $isSelectedLeft,
|
|
91
|
+
overlayBottom: $selectionType === "selectDirect" && $isLastRow,
|
|
92
|
+
overlayRight: $selectionType === "selectDirect" && $isLastColumn,
|
|
93
|
+
overlayAutoHeight: !!$rowAutoHeight
|
|
94
|
+
}), className), style: mergedStyle, ...props, children });
|
|
95
|
+
};
|
|
68
96
|
|
|
69
97
|
exports.StyledCell = StyledCell;
|
|
70
98
|
//# sourceMappingURL=StyledCell.cjs.map
|