@rttui/skin-anocca 1.0.2 → 1.0.4
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 +16 -0
- package/dist/cjs/index.cjs +314 -0
- package/dist/cjs/index.cjs.map +10 -0
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/index.mjs +283 -0
- package/dist/mjs/index.mjs.map +10 -0
- package/dist/mjs/package.json +1 -1
- package/package.json +6 -6
- package/dist/cjs/index.d.ts +0 -3
- package/dist/cjs/index.js +0 -207
- package/dist/mjs/index.d.ts +0 -3
- package/dist/mjs/index.js +0 -201
- package/tsconfig.cjs.json +0 -7
- package/tsconfig.mjs.json +0 -7
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# @rttui/skin-anocca
|
2
2
|
|
3
|
+
## 1.0.4
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- new build method
|
8
|
+
- Updated dependencies
|
9
|
+
- @rttui/core@1.0.4
|
10
|
+
|
11
|
+
## 1.0.3
|
12
|
+
|
13
|
+
### Patch Changes
|
14
|
+
|
15
|
+
- 51c73d3: build with bun build instead
|
16
|
+
- Updated dependencies [51c73d3]
|
17
|
+
- @rttui/core@1.0.3
|
18
|
+
|
3
19
|
## 1.0.2
|
4
20
|
|
5
21
|
### Patch Changes
|
@@ -0,0 +1,314 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __getProtoOf = Object.getPrototypeOf;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __toESM = (mod, isNodeMode, target) => {
|
8
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
9
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
10
|
+
for (let key of __getOwnPropNames(mod))
|
11
|
+
if (!__hasOwnProp.call(to, key))
|
12
|
+
__defProp(to, key, {
|
13
|
+
get: () => mod[key],
|
14
|
+
enumerable: true
|
15
|
+
});
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
19
|
+
var __toCommonJS = (from) => {
|
20
|
+
var entry = __moduleCache.get(from), desc;
|
21
|
+
if (entry)
|
22
|
+
return entry;
|
23
|
+
entry = __defProp({}, "__esModule", { value: true });
|
24
|
+
if (from && typeof from === "object" || typeof from === "function")
|
25
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
26
|
+
get: () => from[key],
|
27
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
28
|
+
}));
|
29
|
+
__moduleCache.set(from, entry);
|
30
|
+
return entry;
|
31
|
+
};
|
32
|
+
var __export = (target, all) => {
|
33
|
+
for (var name in all)
|
34
|
+
__defProp(target, name, {
|
35
|
+
get: all[name],
|
36
|
+
enumerable: true,
|
37
|
+
configurable: true,
|
38
|
+
set: (newValue) => all[name] = () => newValue
|
39
|
+
});
|
40
|
+
};
|
41
|
+
|
42
|
+
// packages/skin-anocca/src/index.tsx
|
43
|
+
var exports_src = {};
|
44
|
+
__export(exports_src, {
|
45
|
+
AnoccaSkin: () => AnoccaSkin
|
46
|
+
});
|
47
|
+
module.exports = __toCommonJS(exports_src);
|
48
|
+
var import_material = require("@mui/material");
|
49
|
+
var import_core = require("@rttui/core");
|
50
|
+
var import_react = __toESM(require("react"));
|
51
|
+
var import_react_table = require("@tanstack/react-table");
|
52
|
+
var jsx_dev_runtime = require("react/jsx-dev-runtime");
|
53
|
+
var AnoccaSkin = {
|
54
|
+
rowHeight: 32,
|
55
|
+
headerRowHeight: 32,
|
56
|
+
footerRowHeight: 32,
|
57
|
+
OuterContainer: ({ children }) => {
|
58
|
+
const { width, height, tableContainerRef } = import_core.useTableContext();
|
59
|
+
const cssVars = import_core.useTableCssVars();
|
60
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.Paper, {
|
61
|
+
ref: tableContainerRef,
|
62
|
+
className: "outer-container",
|
63
|
+
elevation: 2,
|
64
|
+
sx: {
|
65
|
+
overflow: "auto",
|
66
|
+
width: width + "px",
|
67
|
+
height: height + "px",
|
68
|
+
position: "relative",
|
69
|
+
contain: "paint",
|
70
|
+
willChange: "transform",
|
71
|
+
borderRadius: 1,
|
72
|
+
...cssVars
|
73
|
+
},
|
74
|
+
children
|
75
|
+
}, undefined, false, undefined, this);
|
76
|
+
},
|
77
|
+
TableScroller: () => {
|
78
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
79
|
+
className: "table-scroller",
|
80
|
+
style: {
|
81
|
+
width: "var(--table-width)",
|
82
|
+
height: "calc(var(--table-height) + var(--header-height) + var(--footer-height))",
|
83
|
+
position: "absolute"
|
84
|
+
}
|
85
|
+
}, undefined, false, undefined, this);
|
86
|
+
},
|
87
|
+
TableHeader: ({ children }) => {
|
88
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.TableHead, {
|
89
|
+
component: "div",
|
90
|
+
className: "thead",
|
91
|
+
sx: {
|
92
|
+
position: "sticky",
|
93
|
+
top: 0,
|
94
|
+
width: "var(--table-width)",
|
95
|
+
zIndex: 2,
|
96
|
+
backgroundColor: (theme) => theme.palette.background.paper,
|
97
|
+
boxShadow: (theme) => `0 1px 0 ${theme.palette.divider}`
|
98
|
+
},
|
99
|
+
children
|
100
|
+
}, undefined, false, undefined, this);
|
101
|
+
},
|
102
|
+
TableFooter: ({ children }) => {
|
103
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.TableFooter, {
|
104
|
+
component: "div",
|
105
|
+
className: "table-footer",
|
106
|
+
sx: {
|
107
|
+
position: "sticky",
|
108
|
+
bottom: -1,
|
109
|
+
width: "var(--table-width)",
|
110
|
+
zIndex: 2,
|
111
|
+
backgroundColor: (theme) => theme.palette.background.paper,
|
112
|
+
boxShadow: (theme) => `0 -1px 0 ${theme.palette.divider}`
|
113
|
+
},
|
114
|
+
children
|
115
|
+
}, undefined, false, undefined, this);
|
116
|
+
},
|
117
|
+
HeaderRow: TableHeaderRow,
|
118
|
+
HeaderCell: (props) => {
|
119
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(TableHeaderCell, {
|
120
|
+
...props
|
121
|
+
}, undefined, false, undefined, this);
|
122
|
+
},
|
123
|
+
TableBody: ({ children }) => {
|
124
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.TableBody, {
|
125
|
+
component: "div",
|
126
|
+
className: "table-body",
|
127
|
+
sx: { position: "relative", width: "var(--table-width)" },
|
128
|
+
children
|
129
|
+
}, undefined, false, undefined, this);
|
130
|
+
},
|
131
|
+
PinnedRows: ({ children, position, pinned }) => {
|
132
|
+
if (pinned.length === 0) {
|
133
|
+
return null;
|
134
|
+
}
|
135
|
+
const style = {
|
136
|
+
position: "sticky",
|
137
|
+
zIndex: 3
|
138
|
+
};
|
139
|
+
if (position === "top") {
|
140
|
+
style.top = "var(--header-height)";
|
141
|
+
style.borderBottom = (theme) => `1px solid ${theme.palette.divider}`;
|
142
|
+
style.boxShadow = "0 4px 8px -4px rgba(0, 0, 0, 0.15), 0 6px 12px -6px rgba(0, 0, 0, 0.1)";
|
143
|
+
} else if (position === "bottom") {
|
144
|
+
style.bottom = "var(--footer-height)";
|
145
|
+
style.borderTop = (theme) => `1px solid ${theme.palette.divider}`;
|
146
|
+
style.boxShadow = "0 -4px 8px -4px rgba(0, 0, 0, 0.15), 0 -6px 12px -6px rgba(0, 0, 0, 0.1)";
|
147
|
+
}
|
148
|
+
const Component = position === "top" ? import_material.TableHead : import_material.TableFooter;
|
149
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Component, {
|
150
|
+
component: "div",
|
151
|
+
className: `sticky-${position}-rows`,
|
152
|
+
sx: style,
|
153
|
+
children
|
154
|
+
}, undefined, false, undefined, this);
|
155
|
+
},
|
156
|
+
PinnedCols: ({ children, position, pinned }) => {
|
157
|
+
if (pinned.length === 0) {
|
158
|
+
return null;
|
159
|
+
}
|
160
|
+
const style = {
|
161
|
+
position: "sticky",
|
162
|
+
zIndex: 3,
|
163
|
+
display: "flex"
|
164
|
+
};
|
165
|
+
if (position === "left") {
|
166
|
+
style.left = 0;
|
167
|
+
style.boxShadow = "4px 0 8px -4px rgba(0, 0, 0, 0.15), 6px 0 12px -6px rgba(0, 0, 0, 0.1)";
|
168
|
+
} else if (position === "right") {
|
169
|
+
style.right = 0;
|
170
|
+
style.borderLeft = (theme) => `1px solid ${theme.palette.divider}`;
|
171
|
+
style.boxShadow = "-4px 0 8px -4px rgba(0, 0, 0, 0.15), -6px 0 12px -6px rgba(0, 0, 0, 0.1)";
|
172
|
+
}
|
173
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.Box, {
|
174
|
+
component: "div",
|
175
|
+
className: `sticky-${position}-cols`,
|
176
|
+
sx: style,
|
177
|
+
children
|
178
|
+
}, undefined, false, undefined, this);
|
179
|
+
},
|
180
|
+
TableRowWrapper: import_react.default.forwardRef(({ children, flatIndex, dndStyle }, ref) => {
|
181
|
+
const theme = import_material.useTheme();
|
182
|
+
const backgroundColor = (theme2) => {
|
183
|
+
const baseColor = flatIndex % 2 === 0 ? theme2.palette.background.paper : theme2.palette.mode === "dark" ? theme2.palette.grey[900] : theme2.palette.grey[100];
|
184
|
+
return baseColor;
|
185
|
+
};
|
186
|
+
const vars = {
|
187
|
+
"--row-background-color": backgroundColor(theme)
|
188
|
+
};
|
189
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.Box, {
|
190
|
+
sx: {
|
191
|
+
...dndStyle,
|
192
|
+
...vars
|
193
|
+
},
|
194
|
+
"data-index": flatIndex,
|
195
|
+
ref,
|
196
|
+
children
|
197
|
+
}, undefined, false, undefined, this);
|
198
|
+
}),
|
199
|
+
TableRow: ({ children }) => {
|
200
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.TableRow, {
|
201
|
+
component: "div",
|
202
|
+
className: "table-row",
|
203
|
+
sx: {
|
204
|
+
position: "relative",
|
205
|
+
width: "var(--table-width)",
|
206
|
+
display: "flex",
|
207
|
+
height: "var(--row-height)",
|
208
|
+
zIndex: 1,
|
209
|
+
boxSizing: "border-box",
|
210
|
+
backgroundColor: "var(--row-background-color)"
|
211
|
+
},
|
212
|
+
children
|
213
|
+
}, undefined, false, undefined, this);
|
214
|
+
},
|
215
|
+
TableRowExpandedContent: ({ children }) => {
|
216
|
+
const { table } = import_core.useTableContext();
|
217
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.TableRow, {
|
218
|
+
component: "div",
|
219
|
+
className: "expanded-row",
|
220
|
+
sx: {
|
221
|
+
backgroundColor: (theme) => theme.palette.background.default
|
222
|
+
},
|
223
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.TableCell, {
|
224
|
+
component: "div",
|
225
|
+
className: "expanded-cell",
|
226
|
+
colSpan: table.getAllLeafColumns().length,
|
227
|
+
sx: {
|
228
|
+
padding: 2
|
229
|
+
},
|
230
|
+
children
|
231
|
+
}, undefined, false, undefined, this)
|
232
|
+
}, undefined, false, undefined, this);
|
233
|
+
},
|
234
|
+
Cell: ({ children, header }) => {
|
235
|
+
const { isPinned } = header;
|
236
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.TableCell, {
|
237
|
+
className: "td",
|
238
|
+
component: "div",
|
239
|
+
sx: {
|
240
|
+
height: "var(--row-height)",
|
241
|
+
width: header.width,
|
242
|
+
overflow: "hidden",
|
243
|
+
textOverflow: "ellipsis",
|
244
|
+
whiteSpace: "nowrap",
|
245
|
+
zIndex: isPinned ? 5 : 0,
|
246
|
+
boxSizing: "border-box",
|
247
|
+
alignItems: "center",
|
248
|
+
gap: "8px",
|
249
|
+
display: "flex",
|
250
|
+
justifyContent: "flex-start",
|
251
|
+
alignContent: "center",
|
252
|
+
padding: "6px 12px",
|
253
|
+
backgroundColor: "var(--row-background-color)",
|
254
|
+
borderBottom: "none",
|
255
|
+
flexShrink: 0,
|
256
|
+
position: "relative",
|
257
|
+
borderRight: (theme) => `1px solid ${theme.palette.divider}`,
|
258
|
+
".table-row:hover &": {
|
259
|
+
backgroundColor: (theme) => {
|
260
|
+
return theme.palette.mode === "dark" ? "#1e1e52" : "#E3F2FD";
|
261
|
+
},
|
262
|
+
zIndex: isPinned ? 2 : 0
|
263
|
+
}
|
264
|
+
},
|
265
|
+
children
|
266
|
+
}, undefined, false, undefined, this);
|
267
|
+
}
|
268
|
+
};
|
269
|
+
function TableHeaderCell({
|
270
|
+
headerId,
|
271
|
+
isPinned,
|
272
|
+
width,
|
273
|
+
header,
|
274
|
+
type
|
275
|
+
}) {
|
276
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.TableCell, {
|
277
|
+
component: "div",
|
278
|
+
className: "th",
|
279
|
+
"data-header-id": headerId,
|
280
|
+
"data-is-pinned": isPinned,
|
281
|
+
sx: {
|
282
|
+
transition: "background-color 0.2s ease",
|
283
|
+
whiteSpace: "nowrap",
|
284
|
+
zIndex: isPinned ? 1 : 0,
|
285
|
+
display: "flex",
|
286
|
+
overflow: "hidden",
|
287
|
+
height: "var(--header-row-height)",
|
288
|
+
width,
|
289
|
+
position: "relative",
|
290
|
+
flexShrink: 0,
|
291
|
+
alignItems: "center",
|
292
|
+
gap: "8px",
|
293
|
+
justifyContent: "space-between",
|
294
|
+
padding: "6px 12px",
|
295
|
+
boxSizing: "border-box",
|
296
|
+
fontWeight: 600,
|
297
|
+
backgroundColor: isPinned ? (theme) => theme.palette.background.paper : "transparent",
|
298
|
+
borderRight: (theme) => `1px solid ${theme.palette.divider}`
|
299
|
+
},
|
300
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
301
|
+
style: { flex: 1, display: "flex", justifyContent: "flex-start" },
|
302
|
+
children: header && !header.isPlaceholder ? import_react_table.flexRender(header.column.columnDef[type], header.getContext()) : null
|
303
|
+
}, undefined, false, undefined, this)
|
304
|
+
}, undefined, false, undefined, this);
|
305
|
+
}
|
306
|
+
function TableHeaderRow({ children }) {
|
307
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_material.TableRow, {
|
308
|
+
component: "div",
|
309
|
+
sx: { height: "var(--row-height)", display: "flex" },
|
310
|
+
children
|
311
|
+
}, undefined, false, undefined, this);
|
312
|
+
}
|
313
|
+
|
314
|
+
//# debugId=1B1A7D6C6A1CF7C164756E2164756E21
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/index.tsx"],
|
4
|
+
"sourcesContent": [
|
5
|
+
"import {\n Box,\n Paper,\n SxProps,\n TableBody,\n TableCell,\n TableFooter,\n TableHead,\n TableRow,\n Theme,\n useTheme,\n} from \"@mui/material\";\nimport {\n Skin,\n useTableContext,\n useTableCssVars,\n VirtualHeader,\n} from \"@rttui/core\";\nimport React from \"react\";\nimport { flexRender } from \"@tanstack/react-table\";\n\nconst AnoccaSkin: Skin = {\n rowHeight: 32,\n headerRowHeight: 32,\n footerRowHeight: 32,\n OuterContainer: ({ children }) => {\n const { width, height, tableContainerRef } = useTableContext();\n const cssVars = useTableCssVars();\n\n return (\n <Paper\n ref={tableContainerRef}\n className=\"outer-container\"\n elevation={2}\n sx={{\n overflow: \"auto\",\n width: width + \"px\",\n height: height + \"px\",\n position: \"relative\",\n contain: \"paint\",\n willChange: \"transform\",\n borderRadius: 1,\n ...cssVars,\n }}\n >\n {children}\n </Paper>\n );\n },\n TableScroller: () => {\n return (\n <div\n className=\"table-scroller\"\n style={{\n width: \"var(--table-width)\",\n height:\n \"calc(var(--table-height) + var(--header-height) + var(--footer-height))\",\n position: \"absolute\",\n }}\n ></div>\n );\n },\n TableHeader: ({ children }) => {\n return (\n <TableHead\n component=\"div\"\n className=\"thead\"\n sx={{\n position: \"sticky\",\n top: 0,\n width: \"var(--table-width)\",\n zIndex: 2,\n backgroundColor: (theme) => theme.palette.background.paper,\n boxShadow: (theme) => `0 1px 0 ${theme.palette.divider}`,\n }}\n >\n {children}\n </TableHead>\n );\n },\n TableFooter: ({ children }) => {\n return (\n <TableFooter\n component=\"div\"\n className=\"table-footer\"\n sx={{\n position: \"sticky\",\n bottom: -1,\n width: \"var(--table-width)\",\n zIndex: 2,\n backgroundColor: (theme) => theme.palette.background.paper,\n boxShadow: (theme) => `0 -1px 0 ${theme.palette.divider}`,\n }}\n >\n {children}\n </TableFooter>\n );\n },\n HeaderRow: TableHeaderRow,\n HeaderCell: (props) => {\n return <TableHeaderCell {...props} />;\n },\n TableBody: ({ children }) => {\n return (\n <TableBody\n component=\"div\"\n className=\"table-body\"\n sx={{ position: \"relative\", width: \"var(--table-width)\" }}\n >\n {children}\n </TableBody>\n );\n },\n PinnedRows: ({ children, position, pinned }) => {\n if (pinned.length === 0) {\n return null;\n }\n\n const style: SxProps<Theme> = {\n position: \"sticky\",\n zIndex: 3,\n };\n if (position === \"top\") {\n style.top = \"var(--header-height)\";\n style.borderBottom = (theme) => `1px solid ${theme.palette.divider}`;\n style.boxShadow =\n \"0 4px 8px -4px rgba(0, 0, 0, 0.15), 0 6px 12px -6px rgba(0, 0, 0, 0.1)\";\n } else if (position === \"bottom\") {\n style.bottom = \"var(--footer-height)\";\n style.borderTop = (theme) => `1px solid ${theme.palette.divider}`;\n style.boxShadow =\n \"0 -4px 8px -4px rgba(0, 0, 0, 0.15), 0 -6px 12px -6px rgba(0, 0, 0, 0.1)\";\n }\n\n const Component = position === \"top\" ? TableHead : TableFooter;\n\n return (\n <Component\n component=\"div\"\n className={`sticky-${position}-rows`}\n sx={style}\n >\n {children}\n </Component>\n );\n },\n PinnedCols: ({ children, position, pinned }) => {\n if (pinned.length === 0) {\n return null;\n }\n\n const style: SxProps<Theme> = {\n position: \"sticky\",\n zIndex: 3,\n display: \"flex\",\n };\n\n if (position === \"left\") {\n style.left = 0;\n style.boxShadow =\n \"4px 0 8px -4px rgba(0, 0, 0, 0.15), 6px 0 12px -6px rgba(0, 0, 0, 0.1)\";\n } else if (position === \"right\") {\n style.right = 0;\n style.borderLeft = (theme) => `1px solid ${theme.palette.divider}`;\n style.boxShadow =\n \"-4px 0 8px -4px rgba(0, 0, 0, 0.15), -6px 0 12px -6px rgba(0, 0, 0, 0.1)\";\n }\n\n return (\n <Box component=\"div\" className={`sticky-${position}-cols`} sx={style}>\n {children}\n </Box>\n );\n },\n\n TableRowWrapper: React.forwardRef(\n ({ children, flatIndex, dndStyle }, ref) => {\n const theme = useTheme();\n const backgroundColor = (theme: Theme) => {\n const baseColor =\n flatIndex % 2 === 0\n ? theme.palette.background.paper\n : theme.palette.mode === \"dark\"\n ? theme.palette.grey[900]\n : theme.palette.grey[100];\n return baseColor;\n };\n\n const vars: Record<string, string> = {\n \"--row-background-color\": backgroundColor(theme),\n };\n\n return (\n <Box\n sx={{\n ...dndStyle,\n ...vars,\n }}\n data-index={flatIndex}\n ref={ref}\n >\n {children}\n </Box>\n );\n },\n ),\n TableRow: ({ children }) => {\n return (\n <TableRow\n component=\"div\"\n className=\"table-row\"\n sx={{\n position: \"relative\",\n width: \"var(--table-width)\",\n display: \"flex\",\n height: \"var(--row-height)\",\n zIndex: 1,\n boxSizing: \"border-box\",\n backgroundColor: \"var(--row-background-color)\",\n }}\n >\n {children}\n </TableRow>\n );\n },\n TableRowExpandedContent: ({ children }) => {\n const { table } = useTableContext();\n return (\n <TableRow\n component=\"div\"\n className=\"expanded-row\"\n sx={{\n backgroundColor: (theme) => theme.palette.background.default,\n }}\n >\n <TableCell\n component=\"div\"\n className=\"expanded-cell\"\n colSpan={table.getAllLeafColumns().length}\n sx={{\n padding: 2,\n }}\n >\n {children}\n </TableCell>\n </TableRow>\n );\n },\n Cell: ({ children, header }) => {\n const { isPinned } = header;\n return (\n <TableCell\n className=\"td\"\n component=\"div\"\n sx={{\n height: \"var(--row-height)\",\n width: header.width,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n zIndex: isPinned ? 5 : 0,\n boxSizing: \"border-box\",\n alignItems: \"center\",\n gap: \"8px\",\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignContent: \"center\",\n padding: \"6px 12px\",\n backgroundColor: \"var(--row-background-color)\",\n borderBottom: \"none\",\n flexShrink: 0,\n position: \"relative\",\n borderRight: (theme) => `1px solid ${theme.palette.divider}`,\n \".table-row:hover &\": {\n backgroundColor: (theme) => {\n // Always use solid background colors for all cells on hover\n return theme.palette.mode === \"dark\"\n ? \"#1e1e52\" // Dark blue solid color\n : \"#E3F2FD\"; // Light blue solid color\n },\n zIndex: isPinned ? 2 : 0,\n },\n }}\n >\n {children}\n </TableCell>\n );\n },\n};\n\nfunction TableHeaderCell({\n headerId,\n isPinned,\n width,\n header,\n type,\n}: VirtualHeader & {\n type: \"header\" | \"footer\";\n}) {\n return (\n <TableCell\n component=\"div\"\n className=\"th\"\n data-header-id={headerId}\n data-is-pinned={isPinned}\n sx={{\n transition: \"background-color 0.2s ease\",\n whiteSpace: \"nowrap\",\n zIndex: isPinned ? 1 : 0,\n display: \"flex\",\n overflow: \"hidden\",\n height: \"var(--header-row-height)\",\n width,\n position: \"relative\",\n flexShrink: 0,\n alignItems: \"center\",\n gap: \"8px\",\n justifyContent: \"space-between\",\n padding: \"6px 12px\",\n boxSizing: \"border-box\",\n fontWeight: 600,\n backgroundColor: isPinned\n ? (theme) => theme.palette.background.paper\n : \"transparent\",\n borderRight: (theme) => `1px solid ${theme.palette.divider}`,\n }}\n >\n <div style={{ flex: 1, display: \"flex\", justifyContent: \"flex-start\" }}>\n {header && !header.isPlaceholder\n ? flexRender(header.column.columnDef[type], header.getContext())\n : null}\n </div>\n </TableCell>\n );\n}\n\nexport { AnoccaSkin };\n\nfunction TableHeaderRow({ children }: { children: React.ReactNode }) {\n return (\n <TableRow\n component=\"div\"\n sx={{ height: \"var(--row-height)\", display: \"flex\" }}\n >\n {children}\n </TableRow>\n );\n}\n"
|
6
|
+
],
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,IAXP;AAiBO,IALP;AAMkB,IAAlB;AAC2B,IAA3B;AAAA;AAEA,IAAM,aAAmB;AAAA,EACvB,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,gBAAgB,GAAG,eAAe;AAAA,IAChC,QAAQ,OAAO,QAAQ,sBAAsB,4BAAgB;AAAA,IAC7D,MAAM,UAAU,4BAAgB;AAAA,IAEhC,uBACE,uBAgBE,uBAhBF;AAAA,MACE,KAAK;AAAA,MACL,WAAU;AAAA,MACV,WAAW;AAAA,MACX,IAAI;AAAA,QACF,UAAU;AAAA,QACV,OAAO,QAAQ;AAAA,QACf,QAAQ,SAAS;AAAA,QACjB,UAAU;AAAA,QACV,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,cAAc;AAAA,WACX;AAAA,MACL;AAAA,MAbF;AAAA,wCAgBE;AAAA;AAAA,EAGN,eAAe,MAAM;AAAA,IACnB,uBACE,uBAQG,OARH;AAAA,MACE,WAAU;AAAA,MACV,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QACE;AAAA,QACF,UAAU;AAAA,MACZ;AAAA,OAPF,iCAQG;AAAA;AAAA,EAGP,aAAa,GAAG,eAAe;AAAA,IAC7B,uBACE,uBAaE,2BAbF;AAAA,MACE,WAAU;AAAA,MACV,WAAU;AAAA,MACV,IAAI;AAAA,QACF,UAAU;AAAA,QACV,KAAK;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,iBAAiB,CAAC,UAAU,MAAM,QAAQ,WAAW;AAAA,QACrD,WAAW,CAAC,UAAU,WAAW,MAAM,QAAQ;AAAA,MACjD;AAAA,MAVF;AAAA,wCAaE;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|
4
|
+
Paper,
|
5
|
+
TableBody,
|
6
|
+
TableCell,
|
7
|
+
TableFooter,
|
8
|
+
TableHead,
|
9
|
+
TableRow,
|
10
|
+
useTheme
|
11
|
+
} from "@mui/material";
|
12
|
+
import {
|
13
|
+
useTableContext,
|
14
|
+
useTableCssVars
|
15
|
+
} from "@rttui/core";
|
16
|
+
import React from "react";
|
17
|
+
import { flexRender } from "@tanstack/react-table";
|
18
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
19
|
+
var AnoccaSkin = {
|
20
|
+
rowHeight: 32,
|
21
|
+
headerRowHeight: 32,
|
22
|
+
footerRowHeight: 32,
|
23
|
+
OuterContainer: ({ children }) => {
|
24
|
+
const { width, height, tableContainerRef } = useTableContext();
|
25
|
+
const cssVars = useTableCssVars();
|
26
|
+
return /* @__PURE__ */ jsxDEV(Paper, {
|
27
|
+
ref: tableContainerRef,
|
28
|
+
className: "outer-container",
|
29
|
+
elevation: 2,
|
30
|
+
sx: {
|
31
|
+
overflow: "auto",
|
32
|
+
width: width + "px",
|
33
|
+
height: height + "px",
|
34
|
+
position: "relative",
|
35
|
+
contain: "paint",
|
36
|
+
willChange: "transform",
|
37
|
+
borderRadius: 1,
|
38
|
+
...cssVars
|
39
|
+
},
|
40
|
+
children
|
41
|
+
}, undefined, false, undefined, this);
|
42
|
+
},
|
43
|
+
TableScroller: () => {
|
44
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
45
|
+
className: "table-scroller",
|
46
|
+
style: {
|
47
|
+
width: "var(--table-width)",
|
48
|
+
height: "calc(var(--table-height) + var(--header-height) + var(--footer-height))",
|
49
|
+
position: "absolute"
|
50
|
+
}
|
51
|
+
}, undefined, false, undefined, this);
|
52
|
+
},
|
53
|
+
TableHeader: ({ children }) => {
|
54
|
+
return /* @__PURE__ */ jsxDEV(TableHead, {
|
55
|
+
component: "div",
|
56
|
+
className: "thead",
|
57
|
+
sx: {
|
58
|
+
position: "sticky",
|
59
|
+
top: 0,
|
60
|
+
width: "var(--table-width)",
|
61
|
+
zIndex: 2,
|
62
|
+
backgroundColor: (theme) => theme.palette.background.paper,
|
63
|
+
boxShadow: (theme) => `0 1px 0 ${theme.palette.divider}`
|
64
|
+
},
|
65
|
+
children
|
66
|
+
}, undefined, false, undefined, this);
|
67
|
+
},
|
68
|
+
TableFooter: ({ children }) => {
|
69
|
+
return /* @__PURE__ */ jsxDEV(TableFooter, {
|
70
|
+
component: "div",
|
71
|
+
className: "table-footer",
|
72
|
+
sx: {
|
73
|
+
position: "sticky",
|
74
|
+
bottom: -1,
|
75
|
+
width: "var(--table-width)",
|
76
|
+
zIndex: 2,
|
77
|
+
backgroundColor: (theme) => theme.palette.background.paper,
|
78
|
+
boxShadow: (theme) => `0 -1px 0 ${theme.palette.divider}`
|
79
|
+
},
|
80
|
+
children
|
81
|
+
}, undefined, false, undefined, this);
|
82
|
+
},
|
83
|
+
HeaderRow: TableHeaderRow,
|
84
|
+
HeaderCell: (props) => {
|
85
|
+
return /* @__PURE__ */ jsxDEV(TableHeaderCell, {
|
86
|
+
...props
|
87
|
+
}, undefined, false, undefined, this);
|
88
|
+
},
|
89
|
+
TableBody: ({ children }) => {
|
90
|
+
return /* @__PURE__ */ jsxDEV(TableBody, {
|
91
|
+
component: "div",
|
92
|
+
className: "table-body",
|
93
|
+
sx: { position: "relative", width: "var(--table-width)" },
|
94
|
+
children
|
95
|
+
}, undefined, false, undefined, this);
|
96
|
+
},
|
97
|
+
PinnedRows: ({ children, position, pinned }) => {
|
98
|
+
if (pinned.length === 0) {
|
99
|
+
return null;
|
100
|
+
}
|
101
|
+
const style = {
|
102
|
+
position: "sticky",
|
103
|
+
zIndex: 3
|
104
|
+
};
|
105
|
+
if (position === "top") {
|
106
|
+
style.top = "var(--header-height)";
|
107
|
+
style.borderBottom = (theme) => `1px solid ${theme.palette.divider}`;
|
108
|
+
style.boxShadow = "0 4px 8px -4px rgba(0, 0, 0, 0.15), 0 6px 12px -6px rgba(0, 0, 0, 0.1)";
|
109
|
+
} else if (position === "bottom") {
|
110
|
+
style.bottom = "var(--footer-height)";
|
111
|
+
style.borderTop = (theme) => `1px solid ${theme.palette.divider}`;
|
112
|
+
style.boxShadow = "0 -4px 8px -4px rgba(0, 0, 0, 0.15), 0 -6px 12px -6px rgba(0, 0, 0, 0.1)";
|
113
|
+
}
|
114
|
+
const Component = position === "top" ? TableHead : TableFooter;
|
115
|
+
return /* @__PURE__ */ jsxDEV(Component, {
|
116
|
+
component: "div",
|
117
|
+
className: `sticky-${position}-rows`,
|
118
|
+
sx: style,
|
119
|
+
children
|
120
|
+
}, undefined, false, undefined, this);
|
121
|
+
},
|
122
|
+
PinnedCols: ({ children, position, pinned }) => {
|
123
|
+
if (pinned.length === 0) {
|
124
|
+
return null;
|
125
|
+
}
|
126
|
+
const style = {
|
127
|
+
position: "sticky",
|
128
|
+
zIndex: 3,
|
129
|
+
display: "flex"
|
130
|
+
};
|
131
|
+
if (position === "left") {
|
132
|
+
style.left = 0;
|
133
|
+
style.boxShadow = "4px 0 8px -4px rgba(0, 0, 0, 0.15), 6px 0 12px -6px rgba(0, 0, 0, 0.1)";
|
134
|
+
} else if (position === "right") {
|
135
|
+
style.right = 0;
|
136
|
+
style.borderLeft = (theme) => `1px solid ${theme.palette.divider}`;
|
137
|
+
style.boxShadow = "-4px 0 8px -4px rgba(0, 0, 0, 0.15), -6px 0 12px -6px rgba(0, 0, 0, 0.1)";
|
138
|
+
}
|
139
|
+
return /* @__PURE__ */ jsxDEV(Box, {
|
140
|
+
component: "div",
|
141
|
+
className: `sticky-${position}-cols`,
|
142
|
+
sx: style,
|
143
|
+
children
|
144
|
+
}, undefined, false, undefined, this);
|
145
|
+
},
|
146
|
+
TableRowWrapper: React.forwardRef(({ children, flatIndex, dndStyle }, ref) => {
|
147
|
+
const theme = useTheme();
|
148
|
+
const backgroundColor = (theme2) => {
|
149
|
+
const baseColor = flatIndex % 2 === 0 ? theme2.palette.background.paper : theme2.palette.mode === "dark" ? theme2.palette.grey[900] : theme2.palette.grey[100];
|
150
|
+
return baseColor;
|
151
|
+
};
|
152
|
+
const vars = {
|
153
|
+
"--row-background-color": backgroundColor(theme)
|
154
|
+
};
|
155
|
+
return /* @__PURE__ */ jsxDEV(Box, {
|
156
|
+
sx: {
|
157
|
+
...dndStyle,
|
158
|
+
...vars
|
159
|
+
},
|
160
|
+
"data-index": flatIndex,
|
161
|
+
ref,
|
162
|
+
children
|
163
|
+
}, undefined, false, undefined, this);
|
164
|
+
}),
|
165
|
+
TableRow: ({ children }) => {
|
166
|
+
return /* @__PURE__ */ jsxDEV(TableRow, {
|
167
|
+
component: "div",
|
168
|
+
className: "table-row",
|
169
|
+
sx: {
|
170
|
+
position: "relative",
|
171
|
+
width: "var(--table-width)",
|
172
|
+
display: "flex",
|
173
|
+
height: "var(--row-height)",
|
174
|
+
zIndex: 1,
|
175
|
+
boxSizing: "border-box",
|
176
|
+
backgroundColor: "var(--row-background-color)"
|
177
|
+
},
|
178
|
+
children
|
179
|
+
}, undefined, false, undefined, this);
|
180
|
+
},
|
181
|
+
TableRowExpandedContent: ({ children }) => {
|
182
|
+
const { table } = useTableContext();
|
183
|
+
return /* @__PURE__ */ jsxDEV(TableRow, {
|
184
|
+
component: "div",
|
185
|
+
className: "expanded-row",
|
186
|
+
sx: {
|
187
|
+
backgroundColor: (theme) => theme.palette.background.default
|
188
|
+
},
|
189
|
+
children: /* @__PURE__ */ jsxDEV(TableCell, {
|
190
|
+
component: "div",
|
191
|
+
className: "expanded-cell",
|
192
|
+
colSpan: table.getAllLeafColumns().length,
|
193
|
+
sx: {
|
194
|
+
padding: 2
|
195
|
+
},
|
196
|
+
children
|
197
|
+
}, undefined, false, undefined, this)
|
198
|
+
}, undefined, false, undefined, this);
|
199
|
+
},
|
200
|
+
Cell: ({ children, header }) => {
|
201
|
+
const { isPinned } = header;
|
202
|
+
return /* @__PURE__ */ jsxDEV(TableCell, {
|
203
|
+
className: "td",
|
204
|
+
component: "div",
|
205
|
+
sx: {
|
206
|
+
height: "var(--row-height)",
|
207
|
+
width: header.width,
|
208
|
+
overflow: "hidden",
|
209
|
+
textOverflow: "ellipsis",
|
210
|
+
whiteSpace: "nowrap",
|
211
|
+
zIndex: isPinned ? 5 : 0,
|
212
|
+
boxSizing: "border-box",
|
213
|
+
alignItems: "center",
|
214
|
+
gap: "8px",
|
215
|
+
display: "flex",
|
216
|
+
justifyContent: "flex-start",
|
217
|
+
alignContent: "center",
|
218
|
+
padding: "6px 12px",
|
219
|
+
backgroundColor: "var(--row-background-color)",
|
220
|
+
borderBottom: "none",
|
221
|
+
flexShrink: 0,
|
222
|
+
position: "relative",
|
223
|
+
borderRight: (theme) => `1px solid ${theme.palette.divider}`,
|
224
|
+
".table-row:hover &": {
|
225
|
+
backgroundColor: (theme) => {
|
226
|
+
return theme.palette.mode === "dark" ? "#1e1e52" : "#E3F2FD";
|
227
|
+
},
|
228
|
+
zIndex: isPinned ? 2 : 0
|
229
|
+
}
|
230
|
+
},
|
231
|
+
children
|
232
|
+
}, undefined, false, undefined, this);
|
233
|
+
}
|
234
|
+
};
|
235
|
+
function TableHeaderCell({
|
236
|
+
headerId,
|
237
|
+
isPinned,
|
238
|
+
width,
|
239
|
+
header,
|
240
|
+
type
|
241
|
+
}) {
|
242
|
+
return /* @__PURE__ */ jsxDEV(TableCell, {
|
243
|
+
component: "div",
|
244
|
+
className: "th",
|
245
|
+
"data-header-id": headerId,
|
246
|
+
"data-is-pinned": isPinned,
|
247
|
+
sx: {
|
248
|
+
transition: "background-color 0.2s ease",
|
249
|
+
whiteSpace: "nowrap",
|
250
|
+
zIndex: isPinned ? 1 : 0,
|
251
|
+
display: "flex",
|
252
|
+
overflow: "hidden",
|
253
|
+
height: "var(--header-row-height)",
|
254
|
+
width,
|
255
|
+
position: "relative",
|
256
|
+
flexShrink: 0,
|
257
|
+
alignItems: "center",
|
258
|
+
gap: "8px",
|
259
|
+
justifyContent: "space-between",
|
260
|
+
padding: "6px 12px",
|
261
|
+
boxSizing: "border-box",
|
262
|
+
fontWeight: 600,
|
263
|
+
backgroundColor: isPinned ? (theme) => theme.palette.background.paper : "transparent",
|
264
|
+
borderRight: (theme) => `1px solid ${theme.palette.divider}`
|
265
|
+
},
|
266
|
+
children: /* @__PURE__ */ jsxDEV("div", {
|
267
|
+
style: { flex: 1, display: "flex", justifyContent: "flex-start" },
|
268
|
+
children: header && !header.isPlaceholder ? flexRender(header.column.columnDef[type], header.getContext()) : null
|
269
|
+
}, undefined, false, undefined, this)
|
270
|
+
}, undefined, false, undefined, this);
|
271
|
+
}
|
272
|
+
function TableHeaderRow({ children }) {
|
273
|
+
return /* @__PURE__ */ jsxDEV(TableRow, {
|
274
|
+
component: "div",
|
275
|
+
sx: { height: "var(--row-height)", display: "flex" },
|
276
|
+
children
|
277
|
+
}, undefined, false, undefined, this);
|
278
|
+
}
|
279
|
+
export {
|
280
|
+
AnoccaSkin
|
281
|
+
};
|
282
|
+
|
283
|
+
//# debugId=10494150C3C4F7AF64756E2164756E21
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/index.tsx"],
|
4
|
+
"sourcesContent": [
|
5
|
+
"import {\n Box,\n Paper,\n SxProps,\n TableBody,\n TableCell,\n TableFooter,\n TableHead,\n TableRow,\n Theme,\n useTheme,\n} from \"@mui/material\";\nimport {\n Skin,\n useTableContext,\n useTableCssVars,\n VirtualHeader,\n} from \"@rttui/core\";\nimport React from \"react\";\nimport { flexRender } from \"@tanstack/react-table\";\n\nconst AnoccaSkin: Skin = {\n rowHeight: 32,\n headerRowHeight: 32,\n footerRowHeight: 32,\n OuterContainer: ({ children }) => {\n const { width, height, tableContainerRef } = useTableContext();\n const cssVars = useTableCssVars();\n\n return (\n <Paper\n ref={tableContainerRef}\n className=\"outer-container\"\n elevation={2}\n sx={{\n overflow: \"auto\",\n width: width + \"px\",\n height: height + \"px\",\n position: \"relative\",\n contain: \"paint\",\n willChange: \"transform\",\n borderRadius: 1,\n ...cssVars,\n }}\n >\n {children}\n </Paper>\n );\n },\n TableScroller: () => {\n return (\n <div\n className=\"table-scroller\"\n style={{\n width: \"var(--table-width)\",\n height:\n \"calc(var(--table-height) + var(--header-height) + var(--footer-height))\",\n position: \"absolute\",\n }}\n ></div>\n );\n },\n TableHeader: ({ children }) => {\n return (\n <TableHead\n component=\"div\"\n className=\"thead\"\n sx={{\n position: \"sticky\",\n top: 0,\n width: \"var(--table-width)\",\n zIndex: 2,\n backgroundColor: (theme) => theme.palette.background.paper,\n boxShadow: (theme) => `0 1px 0 ${theme.palette.divider}`,\n }}\n >\n {children}\n </TableHead>\n );\n },\n TableFooter: ({ children }) => {\n return (\n <TableFooter\n component=\"div\"\n className=\"table-footer\"\n sx={{\n position: \"sticky\",\n bottom: -1,\n width: \"var(--table-width)\",\n zIndex: 2,\n backgroundColor: (theme) => theme.palette.background.paper,\n boxShadow: (theme) => `0 -1px 0 ${theme.palette.divider}`,\n }}\n >\n {children}\n </TableFooter>\n );\n },\n HeaderRow: TableHeaderRow,\n HeaderCell: (props) => {\n return <TableHeaderCell {...props} />;\n },\n TableBody: ({ children }) => {\n return (\n <TableBody\n component=\"div\"\n className=\"table-body\"\n sx={{ position: \"relative\", width: \"var(--table-width)\" }}\n >\n {children}\n </TableBody>\n );\n },\n PinnedRows: ({ children, position, pinned }) => {\n if (pinned.length === 0) {\n return null;\n }\n\n const style: SxProps<Theme> = {\n position: \"sticky\",\n zIndex: 3,\n };\n if (position === \"top\") {\n style.top = \"var(--header-height)\";\n style.borderBottom = (theme) => `1px solid ${theme.palette.divider}`;\n style.boxShadow =\n \"0 4px 8px -4px rgba(0, 0, 0, 0.15), 0 6px 12px -6px rgba(0, 0, 0, 0.1)\";\n } else if (position === \"bottom\") {\n style.bottom = \"var(--footer-height)\";\n style.borderTop = (theme) => `1px solid ${theme.palette.divider}`;\n style.boxShadow =\n \"0 -4px 8px -4px rgba(0, 0, 0, 0.15), 0 -6px 12px -6px rgba(0, 0, 0, 0.1)\";\n }\n\n const Component = position === \"top\" ? TableHead : TableFooter;\n\n return (\n <Component\n component=\"div\"\n className={`sticky-${position}-rows`}\n sx={style}\n >\n {children}\n </Component>\n );\n },\n PinnedCols: ({ children, position, pinned }) => {\n if (pinned.length === 0) {\n return null;\n }\n\n const style: SxProps<Theme> = {\n position: \"sticky\",\n zIndex: 3,\n display: \"flex\",\n };\n\n if (position === \"left\") {\n style.left = 0;\n style.boxShadow =\n \"4px 0 8px -4px rgba(0, 0, 0, 0.15), 6px 0 12px -6px rgba(0, 0, 0, 0.1)\";\n } else if (position === \"right\") {\n style.right = 0;\n style.borderLeft = (theme) => `1px solid ${theme.palette.divider}`;\n style.boxShadow =\n \"-4px 0 8px -4px rgba(0, 0, 0, 0.15), -6px 0 12px -6px rgba(0, 0, 0, 0.1)\";\n }\n\n return (\n <Box component=\"div\" className={`sticky-${position}-cols`} sx={style}>\n {children}\n </Box>\n );\n },\n\n TableRowWrapper: React.forwardRef(\n ({ children, flatIndex, dndStyle }, ref) => {\n const theme = useTheme();\n const backgroundColor = (theme: Theme) => {\n const baseColor =\n flatIndex % 2 === 0\n ? theme.palette.background.paper\n : theme.palette.mode === \"dark\"\n ? theme.palette.grey[900]\n : theme.palette.grey[100];\n return baseColor;\n };\n\n const vars: Record<string, string> = {\n \"--row-background-color\": backgroundColor(theme),\n };\n\n return (\n <Box\n sx={{\n ...dndStyle,\n ...vars,\n }}\n data-index={flatIndex}\n ref={ref}\n >\n {children}\n </Box>\n );\n },\n ),\n TableRow: ({ children }) => {\n return (\n <TableRow\n component=\"div\"\n className=\"table-row\"\n sx={{\n position: \"relative\",\n width: \"var(--table-width)\",\n display: \"flex\",\n height: \"var(--row-height)\",\n zIndex: 1,\n boxSizing: \"border-box\",\n backgroundColor: \"var(--row-background-color)\",\n }}\n >\n {children}\n </TableRow>\n );\n },\n TableRowExpandedContent: ({ children }) => {\n const { table } = useTableContext();\n return (\n <TableRow\n component=\"div\"\n className=\"expanded-row\"\n sx={{\n backgroundColor: (theme) => theme.palette.background.default,\n }}\n >\n <TableCell\n component=\"div\"\n className=\"expanded-cell\"\n colSpan={table.getAllLeafColumns().length}\n sx={{\n padding: 2,\n }}\n >\n {children}\n </TableCell>\n </TableRow>\n );\n },\n Cell: ({ children, header }) => {\n const { isPinned } = header;\n return (\n <TableCell\n className=\"td\"\n component=\"div\"\n sx={{\n height: \"var(--row-height)\",\n width: header.width,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n zIndex: isPinned ? 5 : 0,\n boxSizing: \"border-box\",\n alignItems: \"center\",\n gap: \"8px\",\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignContent: \"center\",\n padding: \"6px 12px\",\n backgroundColor: \"var(--row-background-color)\",\n borderBottom: \"none\",\n flexShrink: 0,\n position: \"relative\",\n borderRight: (theme) => `1px solid ${theme.palette.divider}`,\n \".table-row:hover &\": {\n backgroundColor: (theme) => {\n // Always use solid background colors for all cells on hover\n return theme.palette.mode === \"dark\"\n ? \"#1e1e52\" // Dark blue solid color\n : \"#E3F2FD\"; // Light blue solid color\n },\n zIndex: isPinned ? 2 : 0,\n },\n }}\n >\n {children}\n </TableCell>\n );\n },\n};\n\nfunction TableHeaderCell({\n headerId,\n isPinned,\n width,\n header,\n type,\n}: VirtualHeader & {\n type: \"header\" | \"footer\";\n}) {\n return (\n <TableCell\n component=\"div\"\n className=\"th\"\n data-header-id={headerId}\n data-is-pinned={isPinned}\n sx={{\n transition: \"background-color 0.2s ease\",\n whiteSpace: \"nowrap\",\n zIndex: isPinned ? 1 : 0,\n display: \"flex\",\n overflow: \"hidden\",\n height: \"var(--header-row-height)\",\n width,\n position: \"relative\",\n flexShrink: 0,\n alignItems: \"center\",\n gap: \"8px\",\n justifyContent: \"space-between\",\n padding: \"6px 12px\",\n boxSizing: \"border-box\",\n fontWeight: 600,\n backgroundColor: isPinned\n ? (theme) => theme.palette.background.paper\n : \"transparent\",\n borderRight: (theme) => `1px solid ${theme.palette.divider}`,\n }}\n >\n <div style={{ flex: 1, display: \"flex\", justifyContent: \"flex-start\" }}>\n {header && !header.isPlaceholder\n ? flexRender(header.column.columnDef[type], header.getContext())\n : null}\n </div>\n </TableCell>\n );\n}\n\nexport { AnoccaSkin };\n\nfunction TableHeaderRow({ children }: { children: React.ReactNode }) {\n return (\n <TableRow\n component=\"div\"\n sx={{ height: \"var(--row-height)\", display: \"flex\" }}\n >\n {children}\n </TableRow>\n );\n}\n"
|
6
|
+
],
|
7
|
+
"mappings": ";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA;AAAA;AAAA;AAAA;AAMA;AACA;AAAA;AAEA,IAAM,aAAmB;AAAA,EACvB,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,gBAAgB,GAAG,eAAe;AAAA,IAChC,QAAQ,OAAO,QAAQ,sBAAsB,gBAAgB;AAAA,IAC7D,MAAM,UAAU,gBAAgB;AAAA,IAEhC,uBACE,OAgBE,OAhBF;AAAA,MACE,KAAK;AAAA,MACL,WAAU;AAAA,MACV,WAAW;AAAA,MACX,IAAI;AAAA,QACF,UAAU;AAAA,QACV,OAAO,QAAQ;AAAA,QACf,QAAQ,SAAS;AAAA,QACjB,UAAU;AAAA,QACV,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,cAAc;AAAA,WACX;AAAA,MACL;AAAA,MAbF;AAAA,wCAgBE;AAAA;AAAA,EAGN,eAAe,MAAM;AAAA,IACnB,uBACE,OAQG,OARH;AAAA,MACE,WAAU;AAAA,MACV,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QACE;AAAA,QACF,UAAU;AAAA,MACZ;AAAA,OAPF,iCAQG;AAAA;AAAA,EAGP,aAAa,GAAG,eAAe;AAAA,IAC7B,uBACE,OAaE,WAbF;AAAA,MACE,WAAU;AAAA,MACV,WAAU;AAAA,MACV,IAAI;AAAA,QACF,UAAU;AAAA,QACV,KAAK;AAAA,QACL,OAAO;AAA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|
+
}
|
package/dist/mjs/package.json
CHANGED
package/package.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rttui/skin-anocca",
|
3
|
-
"version": "1.0.
|
4
|
-
"main": "./dist/cjs/index.
|
3
|
+
"version": "1.0.4",
|
4
|
+
"main": "./dist/cjs/index.cjs",
|
5
5
|
"dependencies": {
|
6
|
-
"@rttui/core": "^1.0.
|
6
|
+
"@rttui/core": "^1.0.4"
|
7
7
|
},
|
8
|
-
"module": "./dist/mjs/index.
|
8
|
+
"module": "./dist/mjs/index.mjs",
|
9
9
|
"types": "./dist/types/index.d.ts",
|
10
10
|
"exports": {
|
11
11
|
".": {
|
12
12
|
"types": "./dist/types/index.d.ts",
|
13
|
-
"require": "./dist/cjs/index.
|
14
|
-
"import": "./dist/mjs/index.
|
13
|
+
"require": "./dist/cjs/index.cjs",
|
14
|
+
"import": "./dist/mjs/index.mjs"
|
15
15
|
}
|
16
16
|
},
|
17
17
|
"publishConfig": {
|
package/dist/cjs/index.d.ts
DELETED
package/dist/cjs/index.js
DELETED
@@ -1,207 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.AnoccaSkin = void 0;
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
8
|
-
const material_1 = require("@mui/material");
|
9
|
-
const core_1 = require("@rttui/core");
|
10
|
-
const react_1 = __importDefault(require("react"));
|
11
|
-
const react_table_1 = require("@tanstack/react-table");
|
12
|
-
const AnoccaSkin = {
|
13
|
-
rowHeight: 32,
|
14
|
-
headerRowHeight: 32,
|
15
|
-
footerRowHeight: 32,
|
16
|
-
OuterContainer: ({ children }) => {
|
17
|
-
const { width, height, tableContainerRef } = (0, core_1.useTableContext)();
|
18
|
-
const cssVars = (0, core_1.useTableCssVars)();
|
19
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Paper, { ref: tableContainerRef, className: "outer-container", elevation: 2, sx: {
|
20
|
-
overflow: "auto",
|
21
|
-
width: width + "px",
|
22
|
-
height: height + "px",
|
23
|
-
position: "relative",
|
24
|
-
contain: "paint",
|
25
|
-
willChange: "transform",
|
26
|
-
borderRadius: 1,
|
27
|
-
...cssVars,
|
28
|
-
}, children: children }));
|
29
|
-
},
|
30
|
-
TableScroller: () => {
|
31
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "table-scroller", style: {
|
32
|
-
width: "var(--table-width)",
|
33
|
-
height: "calc(var(--table-height) + var(--header-height) + var(--footer-height))",
|
34
|
-
position: "absolute",
|
35
|
-
} }));
|
36
|
-
},
|
37
|
-
TableHeader: ({ children }) => {
|
38
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TableHead, { component: "div", className: "thead", sx: {
|
39
|
-
position: "sticky",
|
40
|
-
top: 0,
|
41
|
-
width: "var(--table-width)",
|
42
|
-
zIndex: 2,
|
43
|
-
backgroundColor: (theme) => theme.palette.background.paper,
|
44
|
-
boxShadow: (theme) => `0 1px 0 ${theme.palette.divider}`,
|
45
|
-
}, children: children }));
|
46
|
-
},
|
47
|
-
TableFooter: ({ children }) => {
|
48
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TableFooter, { component: "div", className: "table-footer", sx: {
|
49
|
-
position: "sticky",
|
50
|
-
bottom: -1,
|
51
|
-
width: "var(--table-width)",
|
52
|
-
zIndex: 2,
|
53
|
-
backgroundColor: (theme) => theme.palette.background.paper,
|
54
|
-
boxShadow: (theme) => `0 -1px 0 ${theme.palette.divider}`,
|
55
|
-
}, children: children }));
|
56
|
-
},
|
57
|
-
HeaderRow: TableHeaderRow,
|
58
|
-
HeaderCell: (props) => {
|
59
|
-
return (0, jsx_runtime_1.jsx)(TableHeaderCell, { ...props });
|
60
|
-
},
|
61
|
-
TableBody: ({ children }) => {
|
62
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TableBody, { component: "div", className: "table-body", sx: { position: "relative", width: "var(--table-width)" }, children: children }));
|
63
|
-
},
|
64
|
-
PinnedRows: ({ children, position, pinned }) => {
|
65
|
-
if (pinned.length === 0) {
|
66
|
-
return null;
|
67
|
-
}
|
68
|
-
const style = {
|
69
|
-
position: "sticky",
|
70
|
-
zIndex: 3,
|
71
|
-
};
|
72
|
-
if (position === "top") {
|
73
|
-
style.top = "var(--header-height)";
|
74
|
-
style.borderBottom = (theme) => `1px solid ${theme.palette.divider}`;
|
75
|
-
style.boxShadow =
|
76
|
-
"0 4px 8px -4px rgba(0, 0, 0, 0.15), 0 6px 12px -6px rgba(0, 0, 0, 0.1)";
|
77
|
-
}
|
78
|
-
else if (position === "bottom") {
|
79
|
-
style.bottom = "var(--footer-height)";
|
80
|
-
style.borderTop = (theme) => `1px solid ${theme.palette.divider}`;
|
81
|
-
style.boxShadow =
|
82
|
-
"0 -4px 8px -4px rgba(0, 0, 0, 0.15), 0 -6px 12px -6px rgba(0, 0, 0, 0.1)";
|
83
|
-
}
|
84
|
-
const Component = position === "top" ? material_1.TableHead : material_1.TableFooter;
|
85
|
-
return ((0, jsx_runtime_1.jsx)(Component, { component: "div", className: `sticky-${position}-rows`, sx: style, children: children }));
|
86
|
-
},
|
87
|
-
PinnedCols: ({ children, position, pinned }) => {
|
88
|
-
if (pinned.length === 0) {
|
89
|
-
return null;
|
90
|
-
}
|
91
|
-
const style = {
|
92
|
-
position: "sticky",
|
93
|
-
zIndex: 3,
|
94
|
-
display: "flex",
|
95
|
-
};
|
96
|
-
if (position === "left") {
|
97
|
-
style.left = 0;
|
98
|
-
style.boxShadow =
|
99
|
-
"4px 0 8px -4px rgba(0, 0, 0, 0.15), 6px 0 12px -6px rgba(0, 0, 0, 0.1)";
|
100
|
-
}
|
101
|
-
else if (position === "right") {
|
102
|
-
style.right = 0;
|
103
|
-
style.borderLeft = (theme) => `1px solid ${theme.palette.divider}`;
|
104
|
-
style.boxShadow =
|
105
|
-
"-4px 0 8px -4px rgba(0, 0, 0, 0.15), -6px 0 12px -6px rgba(0, 0, 0, 0.1)";
|
106
|
-
}
|
107
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "div", className: `sticky-${position}-cols`, sx: style, children: children }));
|
108
|
-
},
|
109
|
-
TableRowWrapper: react_1.default.forwardRef(({ children, flatIndex, dndStyle }, ref) => {
|
110
|
-
const theme = (0, material_1.useTheme)();
|
111
|
-
const backgroundColor = (theme) => {
|
112
|
-
const baseColor = flatIndex % 2 === 0
|
113
|
-
? theme.palette.background.paper
|
114
|
-
: theme.palette.mode === "dark"
|
115
|
-
? theme.palette.grey[900]
|
116
|
-
: theme.palette.grey[100];
|
117
|
-
return baseColor;
|
118
|
-
};
|
119
|
-
const vars = {
|
120
|
-
"--row-background-color": backgroundColor(theme),
|
121
|
-
};
|
122
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
123
|
-
...dndStyle,
|
124
|
-
...vars,
|
125
|
-
}, "data-index": flatIndex, ref: ref, children: children }));
|
126
|
-
}),
|
127
|
-
TableRow: ({ children }) => {
|
128
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TableRow, { component: "div", className: "table-row", sx: {
|
129
|
-
position: "relative",
|
130
|
-
width: "var(--table-width)",
|
131
|
-
display: "flex",
|
132
|
-
height: "var(--row-height)",
|
133
|
-
zIndex: 1,
|
134
|
-
boxSizing: "border-box",
|
135
|
-
backgroundColor: "var(--row-background-color)",
|
136
|
-
}, children: children }));
|
137
|
-
},
|
138
|
-
TableRowExpandedContent: ({ children }) => {
|
139
|
-
const { table } = (0, core_1.useTableContext)();
|
140
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TableRow, { component: "div", className: "expanded-row", sx: {
|
141
|
-
backgroundColor: (theme) => theme.palette.background.default,
|
142
|
-
}, children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { component: "div", className: "expanded-cell", colSpan: table.getAllLeafColumns().length, sx: {
|
143
|
-
padding: 2,
|
144
|
-
}, children: children }) }));
|
145
|
-
},
|
146
|
-
Cell: ({ children, header }) => {
|
147
|
-
const { isPinned } = header;
|
148
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { className: "td", component: "div", sx: {
|
149
|
-
height: "var(--row-height)",
|
150
|
-
width: header.width,
|
151
|
-
overflow: "hidden",
|
152
|
-
textOverflow: "ellipsis",
|
153
|
-
whiteSpace: "nowrap",
|
154
|
-
zIndex: isPinned ? 5 : 0,
|
155
|
-
boxSizing: "border-box",
|
156
|
-
alignItems: "center",
|
157
|
-
gap: "8px",
|
158
|
-
display: "flex",
|
159
|
-
justifyContent: "flex-start",
|
160
|
-
alignContent: "center",
|
161
|
-
padding: "6px 12px",
|
162
|
-
backgroundColor: "var(--row-background-color)",
|
163
|
-
borderBottom: "none",
|
164
|
-
flexShrink: 0,
|
165
|
-
position: "relative",
|
166
|
-
borderRight: (theme) => `1px solid ${theme.palette.divider}`,
|
167
|
-
".table-row:hover &": {
|
168
|
-
backgroundColor: (theme) => {
|
169
|
-
// Always use solid background colors for all cells on hover
|
170
|
-
return theme.palette.mode === "dark"
|
171
|
-
? "#1e1e52" // Dark blue solid color
|
172
|
-
: "#E3F2FD"; // Light blue solid color
|
173
|
-
},
|
174
|
-
zIndex: isPinned ? 2 : 0,
|
175
|
-
},
|
176
|
-
}, children: children }));
|
177
|
-
},
|
178
|
-
};
|
179
|
-
exports.AnoccaSkin = AnoccaSkin;
|
180
|
-
function TableHeaderCell({ headerId, isPinned, width, header, type, }) {
|
181
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { component: "div", className: "th", "data-header-id": headerId, "data-is-pinned": isPinned, sx: {
|
182
|
-
transition: "background-color 0.2s ease",
|
183
|
-
whiteSpace: "nowrap",
|
184
|
-
zIndex: isPinned ? 1 : 0,
|
185
|
-
display: "flex",
|
186
|
-
overflow: "hidden",
|
187
|
-
height: "var(--header-row-height)",
|
188
|
-
width,
|
189
|
-
position: "relative",
|
190
|
-
flexShrink: 0,
|
191
|
-
alignItems: "center",
|
192
|
-
gap: "8px",
|
193
|
-
justifyContent: "space-between",
|
194
|
-
padding: "6px 12px",
|
195
|
-
boxSizing: "border-box",
|
196
|
-
fontWeight: 600,
|
197
|
-
backgroundColor: isPinned
|
198
|
-
? (theme) => theme.palette.background.paper
|
199
|
-
: "transparent",
|
200
|
-
borderRight: (theme) => `1px solid ${theme.palette.divider}`,
|
201
|
-
}, children: (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, display: "flex", justifyContent: "flex-start" }, children: header && !header.isPlaceholder
|
202
|
-
? (0, react_table_1.flexRender)(header.column.columnDef[type], header.getContext())
|
203
|
-
: null }) }));
|
204
|
-
}
|
205
|
-
function TableHeaderRow({ children }) {
|
206
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TableRow, { component: "div", sx: { height: "var(--row-height)", display: "flex" }, children: children }));
|
207
|
-
}
|
package/dist/mjs/index.d.ts
DELETED
package/dist/mjs/index.js
DELETED
@@ -1,201 +0,0 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { Box, Paper, TableBody, TableCell, TableFooter, TableHead, TableRow, useTheme, } from "@mui/material";
|
3
|
-
import { useTableContext, useTableCssVars, } from "@rttui/core";
|
4
|
-
import React from "react";
|
5
|
-
import { flexRender } from "@tanstack/react-table";
|
6
|
-
const AnoccaSkin = {
|
7
|
-
rowHeight: 32,
|
8
|
-
headerRowHeight: 32,
|
9
|
-
footerRowHeight: 32,
|
10
|
-
OuterContainer: ({ children }) => {
|
11
|
-
const { width, height, tableContainerRef } = useTableContext();
|
12
|
-
const cssVars = useTableCssVars();
|
13
|
-
return (_jsx(Paper, { ref: tableContainerRef, className: "outer-container", elevation: 2, sx: {
|
14
|
-
overflow: "auto",
|
15
|
-
width: width + "px",
|
16
|
-
height: height + "px",
|
17
|
-
position: "relative",
|
18
|
-
contain: "paint",
|
19
|
-
willChange: "transform",
|
20
|
-
borderRadius: 1,
|
21
|
-
...cssVars,
|
22
|
-
}, children: children }));
|
23
|
-
},
|
24
|
-
TableScroller: () => {
|
25
|
-
return (_jsx("div", { className: "table-scroller", style: {
|
26
|
-
width: "var(--table-width)",
|
27
|
-
height: "calc(var(--table-height) + var(--header-height) + var(--footer-height))",
|
28
|
-
position: "absolute",
|
29
|
-
} }));
|
30
|
-
},
|
31
|
-
TableHeader: ({ children }) => {
|
32
|
-
return (_jsx(TableHead, { component: "div", className: "thead", sx: {
|
33
|
-
position: "sticky",
|
34
|
-
top: 0,
|
35
|
-
width: "var(--table-width)",
|
36
|
-
zIndex: 2,
|
37
|
-
backgroundColor: (theme) => theme.palette.background.paper,
|
38
|
-
boxShadow: (theme) => `0 1px 0 ${theme.palette.divider}`,
|
39
|
-
}, children: children }));
|
40
|
-
},
|
41
|
-
TableFooter: ({ children }) => {
|
42
|
-
return (_jsx(TableFooter, { component: "div", className: "table-footer", sx: {
|
43
|
-
position: "sticky",
|
44
|
-
bottom: -1,
|
45
|
-
width: "var(--table-width)",
|
46
|
-
zIndex: 2,
|
47
|
-
backgroundColor: (theme) => theme.palette.background.paper,
|
48
|
-
boxShadow: (theme) => `0 -1px 0 ${theme.palette.divider}`,
|
49
|
-
}, children: children }));
|
50
|
-
},
|
51
|
-
HeaderRow: TableHeaderRow,
|
52
|
-
HeaderCell: (props) => {
|
53
|
-
return _jsx(TableHeaderCell, { ...props });
|
54
|
-
},
|
55
|
-
TableBody: ({ children }) => {
|
56
|
-
return (_jsx(TableBody, { component: "div", className: "table-body", sx: { position: "relative", width: "var(--table-width)" }, children: children }));
|
57
|
-
},
|
58
|
-
PinnedRows: ({ children, position, pinned }) => {
|
59
|
-
if (pinned.length === 0) {
|
60
|
-
return null;
|
61
|
-
}
|
62
|
-
const style = {
|
63
|
-
position: "sticky",
|
64
|
-
zIndex: 3,
|
65
|
-
};
|
66
|
-
if (position === "top") {
|
67
|
-
style.top = "var(--header-height)";
|
68
|
-
style.borderBottom = (theme) => `1px solid ${theme.palette.divider}`;
|
69
|
-
style.boxShadow =
|
70
|
-
"0 4px 8px -4px rgba(0, 0, 0, 0.15), 0 6px 12px -6px rgba(0, 0, 0, 0.1)";
|
71
|
-
}
|
72
|
-
else if (position === "bottom") {
|
73
|
-
style.bottom = "var(--footer-height)";
|
74
|
-
style.borderTop = (theme) => `1px solid ${theme.palette.divider}`;
|
75
|
-
style.boxShadow =
|
76
|
-
"0 -4px 8px -4px rgba(0, 0, 0, 0.15), 0 -6px 12px -6px rgba(0, 0, 0, 0.1)";
|
77
|
-
}
|
78
|
-
const Component = position === "top" ? TableHead : TableFooter;
|
79
|
-
return (_jsx(Component, { component: "div", className: `sticky-${position}-rows`, sx: style, children: children }));
|
80
|
-
},
|
81
|
-
PinnedCols: ({ children, position, pinned }) => {
|
82
|
-
if (pinned.length === 0) {
|
83
|
-
return null;
|
84
|
-
}
|
85
|
-
const style = {
|
86
|
-
position: "sticky",
|
87
|
-
zIndex: 3,
|
88
|
-
display: "flex",
|
89
|
-
};
|
90
|
-
if (position === "left") {
|
91
|
-
style.left = 0;
|
92
|
-
style.boxShadow =
|
93
|
-
"4px 0 8px -4px rgba(0, 0, 0, 0.15), 6px 0 12px -6px rgba(0, 0, 0, 0.1)";
|
94
|
-
}
|
95
|
-
else if (position === "right") {
|
96
|
-
style.right = 0;
|
97
|
-
style.borderLeft = (theme) => `1px solid ${theme.palette.divider}`;
|
98
|
-
style.boxShadow =
|
99
|
-
"-4px 0 8px -4px rgba(0, 0, 0, 0.15), -6px 0 12px -6px rgba(0, 0, 0, 0.1)";
|
100
|
-
}
|
101
|
-
return (_jsx(Box, { component: "div", className: `sticky-${position}-cols`, sx: style, children: children }));
|
102
|
-
},
|
103
|
-
TableRowWrapper: React.forwardRef(({ children, flatIndex, dndStyle }, ref) => {
|
104
|
-
const theme = useTheme();
|
105
|
-
const backgroundColor = (theme) => {
|
106
|
-
const baseColor = flatIndex % 2 === 0
|
107
|
-
? theme.palette.background.paper
|
108
|
-
: theme.palette.mode === "dark"
|
109
|
-
? theme.palette.grey[900]
|
110
|
-
: theme.palette.grey[100];
|
111
|
-
return baseColor;
|
112
|
-
};
|
113
|
-
const vars = {
|
114
|
-
"--row-background-color": backgroundColor(theme),
|
115
|
-
};
|
116
|
-
return (_jsx(Box, { sx: {
|
117
|
-
...dndStyle,
|
118
|
-
...vars,
|
119
|
-
}, "data-index": flatIndex, ref: ref, children: children }));
|
120
|
-
}),
|
121
|
-
TableRow: ({ children }) => {
|
122
|
-
return (_jsx(TableRow, { component: "div", className: "table-row", sx: {
|
123
|
-
position: "relative",
|
124
|
-
width: "var(--table-width)",
|
125
|
-
display: "flex",
|
126
|
-
height: "var(--row-height)",
|
127
|
-
zIndex: 1,
|
128
|
-
boxSizing: "border-box",
|
129
|
-
backgroundColor: "var(--row-background-color)",
|
130
|
-
}, children: children }));
|
131
|
-
},
|
132
|
-
TableRowExpandedContent: ({ children }) => {
|
133
|
-
const { table } = useTableContext();
|
134
|
-
return (_jsx(TableRow, { component: "div", className: "expanded-row", sx: {
|
135
|
-
backgroundColor: (theme) => theme.palette.background.default,
|
136
|
-
}, children: _jsx(TableCell, { component: "div", className: "expanded-cell", colSpan: table.getAllLeafColumns().length, sx: {
|
137
|
-
padding: 2,
|
138
|
-
}, children: children }) }));
|
139
|
-
},
|
140
|
-
Cell: ({ children, header }) => {
|
141
|
-
const { isPinned } = header;
|
142
|
-
return (_jsx(TableCell, { className: "td", component: "div", sx: {
|
143
|
-
height: "var(--row-height)",
|
144
|
-
width: header.width,
|
145
|
-
overflow: "hidden",
|
146
|
-
textOverflow: "ellipsis",
|
147
|
-
whiteSpace: "nowrap",
|
148
|
-
zIndex: isPinned ? 5 : 0,
|
149
|
-
boxSizing: "border-box",
|
150
|
-
alignItems: "center",
|
151
|
-
gap: "8px",
|
152
|
-
display: "flex",
|
153
|
-
justifyContent: "flex-start",
|
154
|
-
alignContent: "center",
|
155
|
-
padding: "6px 12px",
|
156
|
-
backgroundColor: "var(--row-background-color)",
|
157
|
-
borderBottom: "none",
|
158
|
-
flexShrink: 0,
|
159
|
-
position: "relative",
|
160
|
-
borderRight: (theme) => `1px solid ${theme.palette.divider}`,
|
161
|
-
".table-row:hover &": {
|
162
|
-
backgroundColor: (theme) => {
|
163
|
-
// Always use solid background colors for all cells on hover
|
164
|
-
return theme.palette.mode === "dark"
|
165
|
-
? "#1e1e52" // Dark blue solid color
|
166
|
-
: "#E3F2FD"; // Light blue solid color
|
167
|
-
},
|
168
|
-
zIndex: isPinned ? 2 : 0,
|
169
|
-
},
|
170
|
-
}, children: children }));
|
171
|
-
},
|
172
|
-
};
|
173
|
-
function TableHeaderCell({ headerId, isPinned, width, header, type, }) {
|
174
|
-
return (_jsx(TableCell, { component: "div", className: "th", "data-header-id": headerId, "data-is-pinned": isPinned, sx: {
|
175
|
-
transition: "background-color 0.2s ease",
|
176
|
-
whiteSpace: "nowrap",
|
177
|
-
zIndex: isPinned ? 1 : 0,
|
178
|
-
display: "flex",
|
179
|
-
overflow: "hidden",
|
180
|
-
height: "var(--header-row-height)",
|
181
|
-
width,
|
182
|
-
position: "relative",
|
183
|
-
flexShrink: 0,
|
184
|
-
alignItems: "center",
|
185
|
-
gap: "8px",
|
186
|
-
justifyContent: "space-between",
|
187
|
-
padding: "6px 12px",
|
188
|
-
boxSizing: "border-box",
|
189
|
-
fontWeight: 600,
|
190
|
-
backgroundColor: isPinned
|
191
|
-
? (theme) => theme.palette.background.paper
|
192
|
-
: "transparent",
|
193
|
-
borderRight: (theme) => `1px solid ${theme.palette.divider}`,
|
194
|
-
}, children: _jsx("div", { style: { flex: 1, display: "flex", justifyContent: "flex-start" }, children: header && !header.isPlaceholder
|
195
|
-
? flexRender(header.column.columnDef[type], header.getContext())
|
196
|
-
: null }) }));
|
197
|
-
}
|
198
|
-
export { AnoccaSkin };
|
199
|
-
function TableHeaderRow({ children }) {
|
200
|
-
return (_jsx(TableRow, { component: "div", sx: { height: "var(--row-height)", display: "flex" }, children: children }));
|
201
|
-
}
|
package/tsconfig.cjs.json
DELETED