@rttui/skin-anocca 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -54
- package/dist/cjs/AnoccaSkin.cjs +377 -0
- package/dist/cjs/AnoccaSkin.cjs.map +10 -0
- package/dist/cjs/HeaderPinButtons.cjs +2 -2
- package/dist/cjs/HeaderPinButtons.cjs.map +3 -3
- package/dist/cjs/TableHeaderRow.cjs +45 -0
- package/dist/cjs/TableHeaderRow.cjs.map +10 -0
- package/dist/cjs/index.cjs +10 -350
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/AnoccaSkin.mjs +346 -0
- package/dist/mjs/AnoccaSkin.mjs.map +10 -0
- package/dist/mjs/HeaderPinButtons.mjs +2 -2
- package/dist/mjs/HeaderPinButtons.mjs.map +3 -3
- package/dist/mjs/TableHeaderRow.mjs +15 -0
- package/dist/mjs/TableHeaderRow.mjs.map +10 -0
- package/dist/mjs/index.mjs +9 -348
- package/dist/mjs/index.mjs.map +4 -4
- package/dist/mjs/package.json +1 -1
- package/dist/types/AnoccaSkin.d.ts +3 -0
- package/dist/types/TableHeaderRow.d.ts +3 -0
- package/dist/types/index.d.ts +4 -3
- package/package.json +3 -11
- package/dist/cjs/stories/ReactTanstackTableUiStory.stories.cjs +0 -309
- package/dist/cjs/stories/ReactTanstackTableUiStory.stories.cjs.map +0 -10
- package/dist/cjs/stories/ReactTanstackTableUiStoryComponent.cjs +0 -186
- package/dist/cjs/stories/ReactTanstackTableUiStoryComponent.cjs.map +0 -10
- package/dist/cjs/stories/createSourceCode.cjs +0 -92
- package/dist/cjs/stories/createSourceCode.cjs.map +0 -10
- package/dist/mjs/stories/ReactTanstackTableUiStory.stories.mjs +0 -279
- package/dist/mjs/stories/ReactTanstackTableUiStory.stories.mjs.map +0 -10
- package/dist/mjs/stories/ReactTanstackTableUiStoryComponent.mjs +0 -155
- package/dist/mjs/stories/ReactTanstackTableUiStoryComponent.mjs.map +0 -10
- package/dist/mjs/stories/createSourceCode.mjs +0 -62
- package/dist/mjs/stories/createSourceCode.mjs.map +0 -10
- package/dist/types/stories/ReactTanstackTableUiStory.stories.d.ts +0 -81
- package/dist/types/stories/ReactTanstackTableUiStoryComponent.d.ts +0 -17
- package/dist/types/stories/createSourceCode.d.ts +0 -5
package/dist/cjs/index.cjs
CHANGED
@@ -1,20 +1,7 @@
|
|
1
|
-
var __create = Object.create;
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
3
1
|
var __defProp = Object.defineProperty;
|
4
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
6
4
|
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
5
|
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
19
6
|
var __toCommonJS = (from) => {
|
20
7
|
var entry = __moduleCache.get(from), desc;
|
@@ -39,345 +26,18 @@ var __export = (target, all) => {
|
|
39
26
|
});
|
40
27
|
};
|
41
28
|
|
42
|
-
// packages/skin-anocca/src/index.
|
29
|
+
// packages/skin-anocca/src/index.ts
|
43
30
|
var exports_src = {};
|
44
31
|
__export(exports_src, {
|
45
|
-
|
32
|
+
TableHeaderRow: () => import_TableHeaderRow.TableHeaderRow,
|
33
|
+
RowPinButtons: () => import_RowPinButtons.RowPinButtons,
|
34
|
+
HeaderPinButtons: () => import_HeaderPinButtons.HeaderPinButtons,
|
35
|
+
AnoccaSkin: () => import_AnoccaSkin.AnoccaSkin
|
46
36
|
});
|
47
37
|
module.exports = __toCommonJS(exports_src);
|
48
|
-
var
|
49
|
-
var
|
50
|
-
var
|
51
|
-
var
|
52
|
-
var jsx_runtime = require("react/jsx-runtime");
|
53
|
-
var AnoccaSkin = {
|
54
|
-
rowHeight: 32,
|
55
|
-
headerRowHeight: 32,
|
56
|
-
footerRowHeight: 32,
|
57
|
-
OverlayContainer: ({ children }) => {
|
58
|
-
const { width, height } = import_core.useTableContext();
|
59
|
-
const cssVars = import_core.useTableCssVars();
|
60
|
-
return /* @__PURE__ */ jsx_runtime.jsx("div", {
|
61
|
-
className: "rttui-overlay-container",
|
62
|
-
style: {
|
63
|
-
position: "relative",
|
64
|
-
width: width + "px",
|
65
|
-
height: height + "px",
|
66
|
-
...cssVars
|
67
|
-
},
|
68
|
-
children
|
69
|
-
});
|
70
|
-
},
|
71
|
-
OuterContainer: ({ children }) => {
|
72
|
-
const { tableContainerRef } = import_core.useTableContext();
|
73
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.Paper, {
|
74
|
-
ref: tableContainerRef,
|
75
|
-
className: "outer-container",
|
76
|
-
elevation: 2,
|
77
|
-
sx: {
|
78
|
-
overflow: "auto",
|
79
|
-
width: "var(--table-container-width)",
|
80
|
-
height: "var(--table-container-height)",
|
81
|
-
position: "relative",
|
82
|
-
contain: "paint",
|
83
|
-
willChange: "transform",
|
84
|
-
borderRadius: 1
|
85
|
-
},
|
86
|
-
children
|
87
|
-
});
|
88
|
-
},
|
89
|
-
TableScroller: () => {
|
90
|
-
return /* @__PURE__ */ jsx_runtime.jsx("div", {
|
91
|
-
className: "table-scroller",
|
92
|
-
style: {
|
93
|
-
width: "var(--table-width)",
|
94
|
-
height: "calc(var(--table-height) + var(--header-height) + var(--footer-height))",
|
95
|
-
position: "absolute"
|
96
|
-
}
|
97
|
-
});
|
98
|
-
},
|
99
|
-
TableHeader: ({ children }) => {
|
100
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.TableHead, {
|
101
|
-
component: "div",
|
102
|
-
className: "thead",
|
103
|
-
sx: {
|
104
|
-
position: "sticky",
|
105
|
-
top: 0,
|
106
|
-
width: "var(--table-width)",
|
107
|
-
zIndex: 2,
|
108
|
-
backgroundColor: (theme) => theme.palette.background.paper,
|
109
|
-
boxShadow: (theme) => `0 1px 0 ${theme.palette.divider}`,
|
110
|
-
display: "flex",
|
111
|
-
flexDirection: "column",
|
112
|
-
justifyContent: "flex-start",
|
113
|
-
alignItems: "stretch"
|
114
|
-
},
|
115
|
-
children
|
116
|
-
});
|
117
|
-
},
|
118
|
-
TableFooter: ({ children }) => {
|
119
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.TableFooter, {
|
120
|
-
component: "div",
|
121
|
-
className: "table-footer",
|
122
|
-
sx: {
|
123
|
-
position: "sticky",
|
124
|
-
bottom: -1,
|
125
|
-
width: "var(--table-width)",
|
126
|
-
zIndex: 2,
|
127
|
-
backgroundColor: (theme) => theme.palette.background.paper,
|
128
|
-
boxShadow: (theme) => `0 -1px 0 ${theme.palette.divider}`
|
129
|
-
},
|
130
|
-
children
|
131
|
-
});
|
132
|
-
},
|
133
|
-
HeaderRow: TableHeaderRow,
|
134
|
-
HeaderCell: import_react.default.forwardRef((props, ref) => {
|
135
|
-
return /* @__PURE__ */ jsx_runtime.jsx(TableHeaderCell, {
|
136
|
-
...props,
|
137
|
-
ref
|
138
|
-
});
|
139
|
-
}),
|
140
|
-
TableBody: ({ children }) => {
|
141
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.TableBody, {
|
142
|
-
component: "div",
|
143
|
-
className: "table-body",
|
144
|
-
sx: {
|
145
|
-
position: "relative",
|
146
|
-
width: "var(--table-width)",
|
147
|
-
height: "var(--table-height)",
|
148
|
-
display: "flex",
|
149
|
-
flexDirection: "column",
|
150
|
-
justifyContent: "flex-start",
|
151
|
-
alignItems: "stretch"
|
152
|
-
},
|
153
|
-
children
|
154
|
-
});
|
155
|
-
},
|
156
|
-
PinnedRows: ({ children, position, pinned }) => {
|
157
|
-
if (pinned.length === 0) {
|
158
|
-
return null;
|
159
|
-
}
|
160
|
-
const style = {
|
161
|
-
position: "sticky",
|
162
|
-
zIndex: 3
|
163
|
-
};
|
164
|
-
if (position === "top") {
|
165
|
-
style.top = "var(--header-height)";
|
166
|
-
style.borderBottom = (theme) => `1px solid ${theme.palette.divider}`;
|
167
|
-
style.boxShadow = "0 4px 8px -4px rgba(0, 0, 0, 0.15), 0 6px 12px -6px rgba(0, 0, 0, 0.1)";
|
168
|
-
} else if (position === "bottom") {
|
169
|
-
style.bottom = "var(--footer-height)";
|
170
|
-
style.borderTop = (theme) => `1px solid ${theme.palette.divider}`;
|
171
|
-
style.boxShadow = "0 -4px 8px -4px rgba(0, 0, 0, 0.15), 0 -6px 12px -6px rgba(0, 0, 0, 0.1)";
|
172
|
-
}
|
173
|
-
const Component = position === "top" ? import_material.TableHead : import_material.TableFooter;
|
174
|
-
return /* @__PURE__ */ jsx_runtime.jsx(Component, {
|
175
|
-
component: "div",
|
176
|
-
className: `sticky-${position}-rows`,
|
177
|
-
sx: style,
|
178
|
-
children
|
179
|
-
});
|
180
|
-
},
|
181
|
-
PinnedCols: ({ children, position, pinned }) => {
|
182
|
-
if (pinned.length === 0) {
|
183
|
-
return null;
|
184
|
-
}
|
185
|
-
const style = {
|
186
|
-
position: "sticky",
|
187
|
-
zIndex: 3,
|
188
|
-
display: "flex"
|
189
|
-
};
|
190
|
-
if (position === "left") {
|
191
|
-
style.left = 0;
|
192
|
-
} else if (position === "right") {
|
193
|
-
style.right = 0;
|
194
|
-
}
|
195
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.Box, {
|
196
|
-
component: "div",
|
197
|
-
className: `sticky-${position}-cols`,
|
198
|
-
sx: style,
|
199
|
-
children
|
200
|
-
});
|
201
|
-
},
|
202
|
-
TableRowWrapper: import_react.default.forwardRef(({ children, flatIndex, dndStyle }, ref) => {
|
203
|
-
const theme = import_material.useTheme();
|
204
|
-
const backgroundColor = (theme2) => {
|
205
|
-
const baseColor = flatIndex % 2 === 0 ? theme2.palette.background.paper : theme2.palette.mode === "dark" ? theme2.palette.grey[900] : theme2.palette.grey[100];
|
206
|
-
return baseColor;
|
207
|
-
};
|
208
|
-
const vars = {
|
209
|
-
"--row-background-color": backgroundColor(theme)
|
210
|
-
};
|
211
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.Box, {
|
212
|
-
sx: {
|
213
|
-
...dndStyle,
|
214
|
-
...vars,
|
215
|
-
width: "var(--table-width)",
|
216
|
-
display: "flex",
|
217
|
-
flexDirection: "column",
|
218
|
-
justifyContent: "flex-start",
|
219
|
-
alignItems: "stretch"
|
220
|
-
},
|
221
|
-
"data-index": flatIndex,
|
222
|
-
ref,
|
223
|
-
children
|
224
|
-
});
|
225
|
-
}),
|
226
|
-
TableRow: ({ children }) => {
|
227
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.TableRow, {
|
228
|
-
component: "div",
|
229
|
-
className: "table-row",
|
230
|
-
sx: {
|
231
|
-
position: "relative",
|
232
|
-
width: "var(--table-width)",
|
233
|
-
display: "flex",
|
234
|
-
height: "var(--row-height)",
|
235
|
-
zIndex: 1,
|
236
|
-
boxSizing: "border-box",
|
237
|
-
backgroundColor: "var(--row-background-color)",
|
238
|
-
"&:hover": {
|
239
|
-
backgroundColor: (theme) => {
|
240
|
-
return theme.palette.mode === "dark" ? "#1e1e52" : "#E3F2FD";
|
241
|
-
}
|
242
|
-
}
|
243
|
-
},
|
244
|
-
children
|
245
|
-
});
|
246
|
-
},
|
247
|
-
TableRowExpandedContent: ({ children }) => {
|
248
|
-
const { table } = import_core.useTableContext();
|
249
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.TableRow, {
|
250
|
-
component: "div",
|
251
|
-
className: "expanded-row",
|
252
|
-
sx: {
|
253
|
-
backgroundColor: (theme) => theme.palette.background.default
|
254
|
-
},
|
255
|
-
children: /* @__PURE__ */ jsx_runtime.jsx(import_material.TableCell, {
|
256
|
-
component: "div",
|
257
|
-
className: "expanded-cell",
|
258
|
-
colSpan: table.getAllLeafColumns().length,
|
259
|
-
sx: {
|
260
|
-
padding: 2
|
261
|
-
},
|
262
|
-
children
|
263
|
-
})
|
264
|
-
});
|
265
|
-
},
|
266
|
-
Cell: import_react.default.forwardRef(({ children, header, isMeasuring, isLastPinned, isLast, isLastCenter }, ref) => {
|
267
|
-
const { isPinned } = header;
|
268
|
-
const { table } = import_core.useTableContext();
|
269
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.TableCell, {
|
270
|
-
className: "td",
|
271
|
-
component: "div",
|
272
|
-
ref,
|
273
|
-
sx: {
|
274
|
-
height: "var(--row-height)",
|
275
|
-
width: isMeasuring ? "auto" : header.width,
|
276
|
-
overflow: "hidden",
|
277
|
-
textOverflow: "ellipsis",
|
278
|
-
whiteSpace: "nowrap",
|
279
|
-
zIndex: isPinned ? 5 : 0,
|
280
|
-
boxSizing: "border-box",
|
281
|
-
fontSize: "0.875rem",
|
282
|
-
color: "text.primary",
|
283
|
-
alignItems: "center",
|
284
|
-
gap: "8px",
|
285
|
-
display: "flex",
|
286
|
-
justifyContent: "flex-start",
|
287
|
-
alignContent: "center",
|
288
|
-
padding: "6px 12px",
|
289
|
-
backgroundColor: "var(--row-background-color)",
|
290
|
-
borderBottom: "none",
|
291
|
-
flexShrink: 0,
|
292
|
-
position: "relative",
|
293
|
-
borderRight: (isPinned === "start" && !isLastPinned || !isPinned) && !isLast && !(isLastCenter && table.getIsSomeColumnsPinned("right")) ? (theme) => `1px solid ${theme.palette.divider}` : undefined,
|
294
|
-
borderLeft: isPinned === "end" && !isLastPinned ? (theme) => `1px solid ${theme.palette.divider}` : undefined,
|
295
|
-
".table-row:hover &": {
|
296
|
-
backgroundColor: (theme) => {
|
297
|
-
return theme.palette.mode === "dark" ? "#1e1e52" : "#E3F2FD";
|
298
|
-
},
|
299
|
-
zIndex: isPinned ? 2 : 0
|
300
|
-
}
|
301
|
-
},
|
302
|
-
children
|
303
|
-
});
|
304
|
-
}),
|
305
|
-
PinnedColsOverlay: ({ position }) => {
|
306
|
-
const { table } = import_core.useTableContext();
|
307
|
-
if (!table.getIsSomeColumnsPinned(position)) {
|
308
|
-
return null;
|
309
|
-
}
|
310
|
-
const width = position === "left" ? table.getLeftTotalSize() : table.getRightTotalSize();
|
311
|
-
const style = {
|
312
|
-
width,
|
313
|
-
[position]: 0,
|
314
|
-
position: "sticky",
|
315
|
-
top: 0,
|
316
|
-
bottom: 0,
|
317
|
-
zIndex: 20,
|
318
|
-
pointerEvents: "none"
|
319
|
-
};
|
320
|
-
if (position === "left") {
|
321
|
-
style.boxShadow = "4px 0 8px -4px rgba(0, 0, 0, 0.15), 6px 0 12px -6px rgba(0, 0, 0, 0.1)";
|
322
|
-
} else if (position === "right") {
|
323
|
-
style.boxShadow = "-4px 0 8px -4px rgba(0, 0, 0, 0.15), -6px 0 12px -6px rgba(0, 0, 0, 0.1)";
|
324
|
-
}
|
325
|
-
return /* @__PURE__ */ jsx_runtime.jsx("div", {
|
326
|
-
className: `pinned-${position}-overlay`,
|
327
|
-
style
|
328
|
-
});
|
329
|
-
}
|
330
|
-
};
|
331
|
-
var TableHeaderCell = import_react.default.forwardRef(({
|
332
|
-
headerId,
|
333
|
-
isPinned,
|
334
|
-
width,
|
335
|
-
header,
|
336
|
-
type,
|
337
|
-
isLast,
|
338
|
-
isLastPinned,
|
339
|
-
isLastCenter,
|
340
|
-
isMeasuring
|
341
|
-
}, ref) => {
|
342
|
-
const { table } = import_core.useTableContext();
|
343
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.TableCell, {
|
344
|
-
ref,
|
345
|
-
component: "div",
|
346
|
-
className: "th",
|
347
|
-
"data-header-id": headerId,
|
348
|
-
"data-is-pinned": isPinned,
|
349
|
-
sx: {
|
350
|
-
transition: "background-color 0.2s ease",
|
351
|
-
whiteSpace: "nowrap",
|
352
|
-
zIndex: isPinned ? 1 : 0,
|
353
|
-
display: "flex",
|
354
|
-
overflow: "hidden",
|
355
|
-
height: "var(--header-row-height)",
|
356
|
-
width: isMeasuring ? "auto" : width,
|
357
|
-
position: "relative",
|
358
|
-
flexShrink: 0,
|
359
|
-
alignItems: "center",
|
360
|
-
gap: "8px",
|
361
|
-
justifyContent: "space-between",
|
362
|
-
padding: "6px 12px",
|
363
|
-
boxSizing: "border-box",
|
364
|
-
fontWeight: 600,
|
365
|
-
backgroundColor: isPinned ? (theme) => theme.palette.background.paper : "transparent",
|
366
|
-
borderRight: (isPinned === "start" && !isLastPinned || !isPinned) && !isLast && !(isLastCenter && table.getIsSomeColumnsPinned("right")) ? (theme) => `1px solid ${theme.palette.divider}` : undefined,
|
367
|
-
borderLeft: isPinned === "end" && !isLastPinned ? (theme) => `1px solid ${theme.palette.divider}` : undefined
|
368
|
-
},
|
369
|
-
children: /* @__PURE__ */ jsx_runtime.jsx("div", {
|
370
|
-
style: { flex: 1, display: "flex", justifyContent: "flex-start" },
|
371
|
-
children: header && !header.isPlaceholder ? import_react_table.flexRender(header.column.columnDef[type], header.getContext()) : null
|
372
|
-
})
|
373
|
-
});
|
374
|
-
});
|
375
|
-
function TableHeaderRow({ children }) {
|
376
|
-
return /* @__PURE__ */ jsx_runtime.jsx(import_material.TableRow, {
|
377
|
-
component: "div",
|
378
|
-
sx: { height: "var(--row-height)", display: "flex" },
|
379
|
-
children
|
380
|
-
});
|
381
|
-
}
|
38
|
+
var import_AnoccaSkin = require("./AnoccaSkin.cjs");
|
39
|
+
var import_TableHeaderRow = require("./TableHeaderRow.cjs");
|
40
|
+
var import_HeaderPinButtons = require("./HeaderPinButtons.cjs");
|
41
|
+
var import_RowPinButtons = require("./RowPinButtons.cjs");
|
382
42
|
|
383
|
-
//# debugId=
|
43
|
+
//# debugId=AAA5930ADB54A5D964756E2164756E21
|
package/dist/cjs/index.cjs.map
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
|
-
"sources": ["../../src/index.
|
3
|
+
"sources": ["../../src/index.ts"],
|
4
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, { CSSProperties } from \"react\";\nimport { flexRender } from \"@tanstack/react-table\";\n\nconst AnoccaSkin: Skin = {\n rowHeight: 32,\n headerRowHeight: 32,\n footerRowHeight: 32,\n OverlayContainer: ({ children }) => {\n const { width, height } = useTableContext();\n const cssVars = useTableCssVars();\n return (\n <div\n className=\"rttui-overlay-container\"\n style={{\n position: \"relative\",\n width: width + \"px\",\n height: height + \"px\",\n ...cssVars,\n }}\n >\n {children}\n </div>\n );\n },\n OuterContainer: ({ children }) => {\n const { tableContainerRef } = useTableContext();\n\n return (\n <Paper\n ref={tableContainerRef}\n className=\"outer-container\"\n elevation={2}\n sx={{\n overflow: \"auto\",\n width: \"var(--table-container-width)\",\n height: \"var(--table-container-height)\",\n position: \"relative\",\n contain: \"paint\",\n willChange: \"transform\",\n borderRadius: 1,\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 display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flex-start\",\n alignItems: \"stretch\",\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: React.forwardRef((props, ref) => {\n return <TableHeaderCell {...props} ref={ref} />;\n }),\n TableBody: ({ children }) => {\n return (\n <TableBody\n component=\"div\"\n className=\"table-body\"\n sx={{\n position: \"relative\",\n width: \"var(--table-width)\",\n height: \"var(--table-height)\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flex-start\",\n alignItems: \"stretch\",\n }}\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 } else if (position === \"right\") {\n style.right = 0;\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 width: \"var(--table-width)\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flex-start\",\n alignItems: \"stretch\",\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 \"&: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 },\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: React.forwardRef(\n (\n { children, header, isMeasuring, isLastPinned, isLast, isLastCenter },\n ref,\n ) => {\n const { isPinned } = header;\n const { table } = useTableContext();\n return (\n <TableCell\n className=\"td\"\n component=\"div\"\n ref={ref}\n sx={{\n height: \"var(--row-height)\",\n width: isMeasuring ? \"auto\" : header.width,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n zIndex: isPinned ? 5 : 0,\n boxSizing: \"border-box\",\n fontSize: \"0.875rem\",\n color: \"text.primary\",\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:\n ((isPinned === \"start\" && !isLastPinned) || !isPinned) &&\n !isLast &&\n !(isLastCenter && table.getIsSomeColumnsPinned(\"right\"))\n ? (theme) => `1px solid ${theme.palette.divider}`\n : undefined,\n borderLeft:\n isPinned === \"end\" && !isLastPinned\n ? (theme) => `1px solid ${theme.palette.divider}`\n : undefined,\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 PinnedColsOverlay: ({ position }) => {\n const { table } = useTableContext();\n if (!table.getIsSomeColumnsPinned(position)) {\n return null;\n }\n const width =\n position === \"left\"\n ? table.getLeftTotalSize()\n : table.getRightTotalSize();\n\n const style: CSSProperties = {\n width,\n [position]: 0,\n position: \"sticky\",\n top: 0,\n bottom: 0,\n zIndex: 20,\n pointerEvents: \"none\",\n };\n\n if (position === \"left\") {\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.boxShadow =\n \"-4px 0 8px -4px rgba(0, 0, 0, 0.15), -6px 0 12px -6px rgba(0, 0, 0, 0.1)\";\n }\n return <div className={`pinned-${position}-overlay`} style={style} />;\n },\n};\n\nconst TableHeaderCell = React.forwardRef<\n HTMLDivElement,\n VirtualHeader & {\n type: \"header\" | \"footer\";\n isLast: boolean;\n isFirst: boolean;\n isLastPinned: boolean;\n isFirstPinned: boolean;\n isLastCenter: boolean;\n isFirstCenter: boolean;\n isMeasuring: boolean;\n }\n>(\n (\n {\n headerId,\n isPinned,\n width,\n header,\n type,\n isLast,\n isLastPinned,\n isLastCenter,\n isMeasuring,\n },\n ref,\n ) => {\n const { table } = useTableContext();\n return (\n <TableCell\n ref={ref}\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: isMeasuring ? \"auto\" : 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:\n ((isPinned === \"start\" && !isLastPinned) || !isPinned) &&\n !isLast &&\n !(isLastCenter && table.getIsSomeColumnsPinned(\"right\"))\n ? (theme) => `1px solid ${theme.palette.divider}`\n : undefined,\n borderLeft:\n isPinned === \"end\" && !isLastPinned\n ? (theme) => `1px solid ${theme.palette.divider}`\n : undefined,\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);\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"
|
5
|
+
"export { AnoccaSkin } from \"./AnoccaSkin.cjs\";\nexport { TableHeaderRow } from \"./TableHeaderRow.cjs\";\nexport { HeaderPinButtons } from \"./HeaderPinButtons.cjs\";\nexport { RowPinButtons } from \"./RowPinButtons.cjs\";\n"
|
6
6
|
],
|
7
|
-
"mappings": "
|
8
|
-
"debugId": "
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA2B,IAA3B;AAC+B,IAA/B;AACiC,IAAjC;AAC8B,IAA9B;",
|
8
|
+
"debugId": "AAA5930ADB54A5D964756E2164756E21",
|
9
9
|
"names": []
|
10
10
|
}
|
package/dist/cjs/package.json
CHANGED