@dmsi/wedgekit-react 0.0.208 → 0.0.209
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/{chunk-EFX3RPW4.js → chunk-Q3TNALWH.js} +14 -23
- package/dist/components/DataGridCell.cjs +826 -839
- package/dist/components/DataGridCell.js +1 -1
- package/dist/components/index.cjs +901 -909
- package/dist/components/index.js +15 -10
- package/package.json +1 -1
- package/src/components/DataGrid/TableBody/TableBodyRow.tsx +0 -4
- package/src/components/DataGrid/TableBody/index.tsx +14 -3
- package/src/components/DataGrid/index.tsx +1 -4
- package/src/components/DataGridCell.tsx +11 -17
|
@@ -30,10 +30,10 @@ import {
|
|
|
30
30
|
import { useSortable } from "@dnd-kit/sortable";
|
|
31
31
|
import clsx from "clsx";
|
|
32
32
|
import {
|
|
33
|
-
memo,
|
|
34
33
|
useEffect,
|
|
35
34
|
useRef,
|
|
36
|
-
useState
|
|
35
|
+
useState,
|
|
36
|
+
memo
|
|
37
37
|
} from "react";
|
|
38
38
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
39
39
|
var DataGridCell = memo(
|
|
@@ -54,6 +54,7 @@ var DataGridCell = memo(
|
|
|
54
54
|
warning,
|
|
55
55
|
center,
|
|
56
56
|
width,
|
|
57
|
+
minWidth,
|
|
57
58
|
testid
|
|
58
59
|
} = _b, props = __objRest(_b, [
|
|
59
60
|
"id",
|
|
@@ -71,6 +72,7 @@ var DataGridCell = memo(
|
|
|
71
72
|
"warning",
|
|
72
73
|
"center",
|
|
73
74
|
"width",
|
|
75
|
+
"minWidth",
|
|
74
76
|
"testid"
|
|
75
77
|
]);
|
|
76
78
|
const Element = type === "header" ? "th" : "td";
|
|
@@ -144,7 +146,7 @@ var DataGridCell = memo(
|
|
|
144
146
|
id,
|
|
145
147
|
"data-testid": testid,
|
|
146
148
|
className: clsx("flex h-10", !width && "flex-1"),
|
|
147
|
-
style: { width }
|
|
149
|
+
style: { width, minWidth }
|
|
148
150
|
}, props), {
|
|
149
151
|
"data-theme": type === "header" && !locked ? "brand" : void 0,
|
|
150
152
|
children: /* @__PURE__ */ jsx(
|
|
@@ -185,7 +187,7 @@ function DataCellHeader(_a) {
|
|
|
185
187
|
"testid",
|
|
186
188
|
"useMenuDefaultMinWidth"
|
|
187
189
|
]);
|
|
188
|
-
var _a2
|
|
190
|
+
var _a2;
|
|
189
191
|
const [showMenu, setShowMenu] = useState(false);
|
|
190
192
|
const [filter, setFilter] = useState(
|
|
191
193
|
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
@@ -219,7 +221,7 @@ function DataCellHeader(_a) {
|
|
|
219
221
|
const style = __spreadValues({
|
|
220
222
|
position: "relative",
|
|
221
223
|
whiteSpace: "nowrap",
|
|
222
|
-
|
|
224
|
+
minWidth: header.column.getSize(),
|
|
223
225
|
"--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
|
|
224
226
|
"--color-icon-on-action-primary-normal": "var(--color-text-brand-primary-normal)",
|
|
225
227
|
"--background-action-secondary-normal": "var(--color-text-brand-primary-normal)"
|
|
@@ -233,6 +235,7 @@ function DataCellHeader(_a) {
|
|
|
233
235
|
type: "header",
|
|
234
236
|
component: "header",
|
|
235
237
|
style,
|
|
238
|
+
minWidth: `${header.column.getSize()}px`,
|
|
236
239
|
onClick: header.column.getToggleSortingHandler(),
|
|
237
240
|
onRightClick: () => setShowMenu(!showMenu)
|
|
238
241
|
}, props), {
|
|
@@ -256,8 +259,8 @@ function DataCellHeader(_a) {
|
|
|
256
259
|
id: id ? `${id}-filter-option` : void 0,
|
|
257
260
|
testid: testid ? `${testid}-filter-option` : void 0
|
|
258
261
|
}, subMenuListeners), {
|
|
259
|
-
subMenu: (
|
|
260
|
-
var
|
|
262
|
+
subMenu: (_b2) => {
|
|
263
|
+
var _c = _b2, { menuId, subMenuLevel } = _c, props2 = __objRest(_c, ["menuId", "subMenuLevel"]);
|
|
261
264
|
return /* @__PURE__ */ jsxs(
|
|
262
265
|
Menu,
|
|
263
266
|
__spreadProps(__spreadValues({
|
|
@@ -330,8 +333,8 @@ function DataCellHeader(_a) {
|
|
|
330
333
|
setShowMenu(!showMenu);
|
|
331
334
|
}
|
|
332
335
|
}, subMenuListeners), {
|
|
333
|
-
subMenu: (
|
|
334
|
-
var
|
|
336
|
+
subMenu: (_d) => {
|
|
337
|
+
var _e = _d, { menuId, subMenuLevel } = _e, props2 = __objRest(_e, ["menuId", "subMenuLevel"]);
|
|
335
338
|
return /* @__PURE__ */ jsxs(
|
|
336
339
|
Menu,
|
|
337
340
|
__spreadProps(__spreadValues({}, props2), {
|
|
@@ -419,7 +422,6 @@ function DraggableCellHeader(_a) {
|
|
|
419
422
|
"header",
|
|
420
423
|
"children"
|
|
421
424
|
]);
|
|
422
|
-
var _a2, _b2;
|
|
423
425
|
const { attributes, isDragging, listeners, setNodeRef, transform, node } = useSortable({
|
|
424
426
|
id: header.column.id
|
|
425
427
|
});
|
|
@@ -430,7 +432,6 @@ function DraggableCellHeader(_a) {
|
|
|
430
432
|
transition: "width transform 0.2s ease-in-out",
|
|
431
433
|
whiteSpace: "nowrap",
|
|
432
434
|
zIndex: isDragging ? 1 : 0,
|
|
433
|
-
width: (_b2 = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.headerWidth) != null ? _b2 : header.column.getSize(),
|
|
434
435
|
"--color-text-primary-normal": "var(--color-action-000)",
|
|
435
436
|
"--color-icon-on-action-primary-normal": "var(--color-action-000)",
|
|
436
437
|
userSelect: "none"
|
|
@@ -456,7 +457,6 @@ function DragAlongCell(_a) {
|
|
|
456
457
|
"cell",
|
|
457
458
|
"children"
|
|
458
459
|
]);
|
|
459
|
-
var _a2, _b2, _c, _d;
|
|
460
460
|
const { isDragging, setNodeRef, transform } = useSortable({
|
|
461
461
|
id: cell.column.id
|
|
462
462
|
});
|
|
@@ -465,19 +465,10 @@ function DragAlongCell(_a) {
|
|
|
465
465
|
position: "relative",
|
|
466
466
|
transform: CSS.Translate.toString(transform),
|
|
467
467
|
transition: "width transform 0.2s ease-in-out",
|
|
468
|
-
|
|
468
|
+
minWidth: cell.column.getSize(),
|
|
469
469
|
zIndex: isDragging ? 1 : 0
|
|
470
470
|
};
|
|
471
|
-
return /* @__PURE__ */ jsx(
|
|
472
|
-
DataGridCell,
|
|
473
|
-
__spreadProps(__spreadValues({
|
|
474
|
-
style,
|
|
475
|
-
ref: setNodeRef,
|
|
476
|
-
width: (_d = (_c = cell.column.columnDef.meta) == null ? void 0 : _c.headerWidth) != null ? _d : `${cell.column.getSize()}px`
|
|
477
|
-
}, props), {
|
|
478
|
-
children
|
|
479
|
-
})
|
|
480
|
-
);
|
|
471
|
+
return /* @__PURE__ */ jsx(DataGridCell, __spreadProps(__spreadValues({ style, ref: setNodeRef }, props), { children }));
|
|
481
472
|
}
|
|
482
473
|
DragAlongCell.displayName = "DragAlongCell";
|
|
483
474
|
|