@infinite-table/infinite-react 0.4.3 → 0.4.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/index.css +41 -41
- package/index.d.ts +52 -37
- package/index.esm.css +41 -41
- package/index.esm.js +1011 -737
- package/index.js +1050 -776
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -4223,8 +4223,8 @@ var InfiniteTableFooter = React15.forwardRef(function InfiniteTableFooter2(props
|
|
|
4223
4223
|
});
|
|
4224
4224
|
|
|
4225
4225
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
|
|
4226
|
-
var
|
|
4227
|
-
var
|
|
4226
|
+
var React28 = __toModule(require("react"));
|
|
4227
|
+
var import_react24 = __toModule(require("react"));
|
|
4228
4228
|
var import_react_dom = __toModule(require("react-dom"));
|
|
4229
4229
|
|
|
4230
4230
|
// src/components/DataSource/defaultFilterTypes.ts
|
|
@@ -4320,6 +4320,9 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
4320
4320
|
if (column.computedLastInCategory) {
|
|
4321
4321
|
result.push(...baseClasses.map((c) => `${c}--last-in-category`));
|
|
4322
4322
|
}
|
|
4323
|
+
if (extraFlags.rowSelected) {
|
|
4324
|
+
result.push(...baseClasses.map((c) => `${c}--row-selected`));
|
|
4325
|
+
}
|
|
4323
4326
|
if (column.computedPinned) {
|
|
4324
4327
|
result.push(...baseClasses.map((c) => `${c}--pinned-${column.computedPinned}`));
|
|
4325
4328
|
} else {
|
|
@@ -4912,11 +4915,49 @@ function shallowEqualObjects(objA, objB, ignoreKeys) {
|
|
|
4912
4915
|
return true;
|
|
4913
4916
|
}
|
|
4914
4917
|
|
|
4918
|
+
// src/components/InfiniteTable/hooks/adjustColumnOrderForAllColumns.ts
|
|
4919
|
+
function adjustColumnOrderForAllColumns(options) {
|
|
4920
|
+
const {
|
|
4921
|
+
newColumnOrder,
|
|
4922
|
+
visibleColumnOrder,
|
|
4923
|
+
existingColumnOrder,
|
|
4924
|
+
dragColumnId
|
|
4925
|
+
} = options;
|
|
4926
|
+
if (visibleColumnOrder.length !== newColumnOrder.length) {
|
|
4927
|
+
console.warn("new column order cannot contain less columns than the visible column order");
|
|
4928
|
+
return newColumnOrder;
|
|
4929
|
+
}
|
|
4930
|
+
const dragIndex = visibleColumnOrder.indexOf(dragColumnId);
|
|
4931
|
+
const dropIndex = newColumnOrder.indexOf(dragColumnId);
|
|
4932
|
+
if (dragIndex === dropIndex) {
|
|
4933
|
+
return existingColumnOrder;
|
|
4934
|
+
}
|
|
4935
|
+
if (dropIndex > dragIndex) {
|
|
4936
|
+
const indexInNewOrder = newColumnOrder.indexOf(dragColumnId);
|
|
4937
|
+
const prevColIdInNewOrder = newColumnOrder[indexInNewOrder - 1];
|
|
4938
|
+
const prevColIndexInExiting = existingColumnOrder.indexOf(prevColIdInNewOrder);
|
|
4939
|
+
const indexInExisting = existingColumnOrder.indexOf(dragColumnId);
|
|
4940
|
+
return moveXatY(existingColumnOrder, indexInExisting, prevColIndexInExiting);
|
|
4941
|
+
} else {
|
|
4942
|
+
const indexInNewOrder = newColumnOrder.indexOf(dragColumnId);
|
|
4943
|
+
const nextColIdInNewOrder = newColumnOrder[indexInNewOrder + 1];
|
|
4944
|
+
const nextColIndexInExiting = existingColumnOrder.indexOf(nextColIdInNewOrder);
|
|
4945
|
+
const indexInExisting = existingColumnOrder.indexOf(dragColumnId);
|
|
4946
|
+
return moveXatY(existingColumnOrder, indexInExisting, nextColIndexInExiting);
|
|
4947
|
+
}
|
|
4948
|
+
return newColumnOrder;
|
|
4949
|
+
}
|
|
4950
|
+
|
|
4915
4951
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
4916
4952
|
var columnOffsetAtIndex4 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
4917
4953
|
var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4918
4954
|
var baseZIndexForCells2 = stripVar(InternalVars.baseZIndexForCells);
|
|
4919
4955
|
var equalPinning = (pinning1, pinning2) => {
|
|
4956
|
+
const empty1 = !pinning1 || Object.keys(pinning1).length === 0;
|
|
4957
|
+
const empty2 = !pinning2 || Object.keys(pinning2).length === 0;
|
|
4958
|
+
if (empty1 && empty2) {
|
|
4959
|
+
return true;
|
|
4960
|
+
}
|
|
4920
4961
|
if (!!pinning1 != !!pinning2) {
|
|
4921
4962
|
return false;
|
|
4922
4963
|
}
|
|
@@ -4983,14 +5024,20 @@ var useColumnPointerEvents = ({
|
|
|
4983
5024
|
function persistColumnOrder(reorderDragResult2) {
|
|
4984
5025
|
const { columnPinning, columnOrder } = reorderDragResult2;
|
|
4985
5026
|
if (!equalPinning(getState().columnPinning, columnPinning)) {
|
|
4986
|
-
console.log("update pinning");
|
|
4987
5027
|
componentActions.columnPinning = columnPinning;
|
|
4988
5028
|
}
|
|
4989
|
-
|
|
5029
|
+
console.log("old order", getComputed().computedColumnOrder);
|
|
5030
|
+
const currentComputedColumnOrder = getComputed().computedColumnOrder;
|
|
5031
|
+
if (JSON.stringify(columnOrder, currentComputedColumnOrder)) {
|
|
4990
5032
|
computedVisibleColumns.forEach((col) => {
|
|
4991
5033
|
setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
|
|
4992
5034
|
});
|
|
4993
|
-
componentActions.columnOrder =
|
|
5035
|
+
componentActions.columnOrder = adjustColumnOrderForAllColumns({
|
|
5036
|
+
newColumnOrder: columnOrder,
|
|
5037
|
+
visibleColumnOrder: getComputed().computedVisibleColumns.map((c) => c.id),
|
|
5038
|
+
existingColumnOrder: currentComputedColumnOrder,
|
|
5039
|
+
dragColumnId: columnId
|
|
5040
|
+
});
|
|
4994
5041
|
}
|
|
4995
5042
|
}
|
|
4996
5043
|
const onPointerMove = (e2) => {
|
|
@@ -5051,11 +5098,255 @@ var useColumnPointerEvents = ({
|
|
|
5051
5098
|
};
|
|
5052
5099
|
|
|
5053
5100
|
// src/components/InfiniteTable/utils/RenderHookComponent.tsx
|
|
5054
|
-
var
|
|
5101
|
+
var React22 = __toModule(require("react"));
|
|
5055
5102
|
|
|
5056
5103
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
5104
|
+
var React21 = __toModule(require("react"));
|
|
5105
|
+
var import_react19 = __toModule(require("react"));
|
|
5106
|
+
|
|
5107
|
+
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
5057
5108
|
var React18 = __toModule(require("react"));
|
|
5058
|
-
|
|
5109
|
+
|
|
5110
|
+
// src/components/DataSource/state/rowInfoStatus.ts
|
|
5111
|
+
var showLoadingIcon = (rowInfo) => {
|
|
5112
|
+
if (rowInfo.dataSourceHasGrouping) {
|
|
5113
|
+
return rowInfo.isGroupRow ? rowInfo.childrenLoading || !rowInfo.selfLoaded : !rowInfo.selfLoaded;
|
|
5114
|
+
}
|
|
5115
|
+
return !rowInfo.selfLoaded;
|
|
5116
|
+
};
|
|
5117
|
+
|
|
5118
|
+
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5119
|
+
var React16 = __toModule(require("react"));
|
|
5120
|
+
var import_react17 = __toModule(require("react"));
|
|
5121
|
+
|
|
5122
|
+
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
5123
|
+
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5124
|
+
var ExpanderIconCls = "_16lm1iw6 _16lm1iwi _16lm1iwe";
|
|
5125
|
+
var ExpanderIconClsVariants = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwc", false: "_198z9782" }, direction: { end: "_198z9783", start: "_198z9784" } }, defaultVariants: {}, compoundVariants: [[{ expanded: false, direction: "end" }, "_16lm1iwd"]] });
|
|
5126
|
+
|
|
5127
|
+
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5128
|
+
function ExpanderIcon(props) {
|
|
5129
|
+
var _a;
|
|
5130
|
+
const { size = 24, direction = "start" } = props;
|
|
5131
|
+
const [expanded, setExpanded] = (0, import_react17.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
5132
|
+
const onClick = () => {
|
|
5133
|
+
var _a2;
|
|
5134
|
+
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
5135
|
+
if (!isControlled("expanded", props)) {
|
|
5136
|
+
setExpanded(!expanded);
|
|
5137
|
+
}
|
|
5138
|
+
};
|
|
5139
|
+
React16.useEffect(() => {
|
|
5140
|
+
if (isControlled("expanded", props)) {
|
|
5141
|
+
setExpanded(props.expanded);
|
|
5142
|
+
}
|
|
5143
|
+
}, [props.expanded]);
|
|
5144
|
+
return /* @__PURE__ */ React16.createElement("svg", {
|
|
5145
|
+
"data-name": "expander-icon",
|
|
5146
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5147
|
+
height: `${size}px`,
|
|
5148
|
+
viewBox: "0 0 24 24",
|
|
5149
|
+
width: `${size}px`,
|
|
5150
|
+
style: props.style,
|
|
5151
|
+
onClick,
|
|
5152
|
+
className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
|
|
5153
|
+
direction: direction || "start",
|
|
5154
|
+
expanded
|
|
5155
|
+
}), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`, `InfiniteIcon-expander--${direction === "end" ? "end" : "start"}`)
|
|
5156
|
+
}, /* @__PURE__ */ React16.createElement("path", {
|
|
5157
|
+
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
5158
|
+
}));
|
|
5159
|
+
}
|
|
5160
|
+
|
|
5161
|
+
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5162
|
+
var React17 = __toModule(require("react"));
|
|
5163
|
+
|
|
5164
|
+
// src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
|
|
5165
|
+
var LoadingIconCls = "_16lm1iw8 _16lm1iwi _16lm1iwe";
|
|
5166
|
+
|
|
5167
|
+
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5168
|
+
var LoadingIcon = (props) => {
|
|
5169
|
+
return /* @__PURE__ */ React17.createElement("svg", {
|
|
5170
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5171
|
+
style: {
|
|
5172
|
+
margin: "auto",
|
|
5173
|
+
display: "block",
|
|
5174
|
+
shapeRendering: "auto"
|
|
5175
|
+
},
|
|
5176
|
+
width: "24px",
|
|
5177
|
+
height: "24px",
|
|
5178
|
+
viewBox: "0 0 100 100",
|
|
5179
|
+
preserveAspectRatio: "xMidYMid",
|
|
5180
|
+
className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
|
|
5181
|
+
}, /* @__PURE__ */ React17.createElement("circle", {
|
|
5182
|
+
cx: "50",
|
|
5183
|
+
cy: "50",
|
|
5184
|
+
fill: "none",
|
|
5185
|
+
strokeWidth: "10",
|
|
5186
|
+
r: "35",
|
|
5187
|
+
strokeDasharray: "164.93361431346415 56.97787143782138"
|
|
5188
|
+
}, /* @__PURE__ */ React17.createElement("animateTransform", {
|
|
5189
|
+
attributeName: "transform",
|
|
5190
|
+
type: "rotate",
|
|
5191
|
+
repeatCount: "indefinite",
|
|
5192
|
+
dur: "1s",
|
|
5193
|
+
values: "0 50 50;360 50 50",
|
|
5194
|
+
keyTimes: "0;1"
|
|
5195
|
+
})));
|
|
5196
|
+
};
|
|
5197
|
+
|
|
5198
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
5199
|
+
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5200
|
+
var GroupRowExpanderCls = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_7pupv0b", center: "_7pupv0c", end: "_7pupv0d" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5201
|
+
var RowClsRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "_7pupv00", variantClassNames: { zebra: { false: "_7pupv02", even: "_7pupv03", odd: "_7pupv04" }, groupRow: { true: "_7pupv05", false: "_7pupv06" }, inlineGroupRow: { true: "_7pupv07", false: "_7pupv08" }, showHoverRows: { true: "_7pupv09", false: "_7pupv0a" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5202
|
+
var RowHoverCls = "_7pupv01";
|
|
5203
|
+
|
|
5204
|
+
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
5205
|
+
function styleForGroupColumn({
|
|
5206
|
+
rowInfo
|
|
5207
|
+
}) {
|
|
5208
|
+
return {
|
|
5209
|
+
[stripVar(ThemeVars.components.Row.groupNesting)]: rowInfo.dataSourceHasGrouping ? rowInfo.isGroupRow ? rowInfo.groupNesting - 1 : rowInfo.groupNesting : 0
|
|
5210
|
+
};
|
|
5211
|
+
}
|
|
5212
|
+
function getGroupColumnRender({
|
|
5213
|
+
groupIndexForColumn,
|
|
5214
|
+
groupRenderStrategy
|
|
5215
|
+
}) {
|
|
5216
|
+
return (renderOptions) => {
|
|
5217
|
+
const { rowInfo, renderBag, column } = renderOptions;
|
|
5218
|
+
let { value: valueToRender, groupIcon, selectionCheckBox } = renderBag;
|
|
5219
|
+
const groupRowInfo = rowInfo;
|
|
5220
|
+
if (groupRenderStrategy === "multi-column") {
|
|
5221
|
+
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting && groupRowInfo.isGroupRow) {
|
|
5222
|
+
return null;
|
|
5223
|
+
}
|
|
5224
|
+
} else if (groupRenderStrategy === "single-column" && !groupRowInfo.isGroupRow) {
|
|
5225
|
+
}
|
|
5226
|
+
return /* @__PURE__ */ React18.createElement("div", {
|
|
5227
|
+
className: join(display.flex, column.align === "end" ? flexFlow.rowReverse : flexFlow.row, alignItems.center, groupRenderStrategy === "single-column" || groupRenderStrategy === "multi-column" && !rowInfo.isGroupRow && selectionCheckBox ? GroupRowExpanderCls({ align: column.align || "start" }) : null)
|
|
5228
|
+
}, groupIcon, selectionCheckBox, /* @__PURE__ */ React18.createElement("div", {
|
|
5229
|
+
className: cssEllipsisClassName
|
|
5230
|
+
}, valueToRender != null ? valueToRender : null));
|
|
5231
|
+
};
|
|
5232
|
+
}
|
|
5233
|
+
function getGroupColumnRenderGroupIcon({
|
|
5234
|
+
groupIndexForColumn,
|
|
5235
|
+
groupRenderStrategy,
|
|
5236
|
+
toggleGroupRow,
|
|
5237
|
+
initialRenderGroupIcon
|
|
5238
|
+
}) {
|
|
5239
|
+
return (renderOptions) => {
|
|
5240
|
+
var _a, _b, _c;
|
|
5241
|
+
const {
|
|
5242
|
+
rowInfo,
|
|
5243
|
+
value,
|
|
5244
|
+
rootGroupBy: groupBy,
|
|
5245
|
+
pivotBy,
|
|
5246
|
+
column
|
|
5247
|
+
} = renderOptions;
|
|
5248
|
+
const groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : rowInfo.isGroupRow && ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
|
|
5249
|
+
if (!groupRowInfo) {
|
|
5250
|
+
return null;
|
|
5251
|
+
}
|
|
5252
|
+
const collapsed = groupRowInfo.collapsed;
|
|
5253
|
+
if (groupRenderStrategy === "inline") {
|
|
5254
|
+
if (groupRowInfo.groupCount === 1) {
|
|
5255
|
+
return value;
|
|
5256
|
+
}
|
|
5257
|
+
if (groupRowInfo.groupNesting === groupIndexForColumn && collapsed) {
|
|
5258
|
+
return null;
|
|
5259
|
+
}
|
|
5260
|
+
} else {
|
|
5261
|
+
if (!groupRowInfo.isGroupRow) {
|
|
5262
|
+
return null;
|
|
5263
|
+
}
|
|
5264
|
+
if (groupRenderStrategy === "multi-column") {
|
|
5265
|
+
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting) {
|
|
5266
|
+
return null;
|
|
5267
|
+
}
|
|
5268
|
+
}
|
|
5269
|
+
}
|
|
5270
|
+
const groupKeys = groupRowInfo.groupKeys;
|
|
5271
|
+
let icon = null;
|
|
5272
|
+
const showExpanderIcon = pivotBy ? (((_b = groupRowInfo.groupKeys) == null ? void 0 : _b.length) || 0) < (groupBy == null ? void 0 : groupBy.length) : (((_c = groupRowInfo.groupKeys) == null ? void 0 : _c.length) || 0) <= (groupBy == null ? void 0 : groupBy.length);
|
|
5273
|
+
const isLoading = showLoadingIcon(groupRowInfo);
|
|
5274
|
+
if (isLoading) {
|
|
5275
|
+
icon = /* @__PURE__ */ React18.createElement(LoadingIcon, null);
|
|
5276
|
+
} else if (showExpanderIcon) {
|
|
5277
|
+
const defaultIcon = /* @__PURE__ */ React18.createElement(ExpanderIcon, {
|
|
5278
|
+
expanded: !collapsed,
|
|
5279
|
+
direction: column.align === "end" ? "end" : "start",
|
|
5280
|
+
onChange: () => {
|
|
5281
|
+
toggleGroupRow(groupKeys);
|
|
5282
|
+
}
|
|
5283
|
+
});
|
|
5284
|
+
icon = defaultIcon;
|
|
5285
|
+
}
|
|
5286
|
+
if (initialRenderGroupIcon) {
|
|
5287
|
+
renderOptions.renderBag.groupIcon = icon;
|
|
5288
|
+
icon = /* @__PURE__ */ React18.createElement(RenderCellHookComponent, {
|
|
5289
|
+
render: initialRenderGroupIcon,
|
|
5290
|
+
renderParam: renderOptions
|
|
5291
|
+
});
|
|
5292
|
+
}
|
|
5293
|
+
return icon;
|
|
5294
|
+
};
|
|
5295
|
+
}
|
|
5296
|
+
function getColumnForGroupBy(options, toggleGroupRow, groupColumnFromProps) {
|
|
5297
|
+
const { groupByForColumn, groupIndexForColumn, groupRenderStrategy } = options;
|
|
5298
|
+
let userDefinedGroupColumn = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : __spreadValues({}, groupColumnFromProps);
|
|
5299
|
+
if (groupByForColumn.column) {
|
|
5300
|
+
userDefinedGroupColumn = __spreadValues(__spreadValues({}, userDefinedGroupColumn), groupByForColumn.column);
|
|
5301
|
+
}
|
|
5302
|
+
let generatedGroupColumn = __spreadProps(__spreadValues({
|
|
5303
|
+
header: `Group by ${groupByForColumn.field}`,
|
|
5304
|
+
groupByField: groupByForColumn.field,
|
|
5305
|
+
render: getGroupColumnRender({
|
|
5306
|
+
groupIndexForColumn,
|
|
5307
|
+
groupRenderStrategy
|
|
5308
|
+
})
|
|
5309
|
+
}, userDefinedGroupColumn), {
|
|
5310
|
+
renderGroupIcon: getGroupColumnRenderGroupIcon({
|
|
5311
|
+
initialRenderGroupIcon: userDefinedGroupColumn == null ? void 0 : userDefinedGroupColumn.renderGroupIcon,
|
|
5312
|
+
groupIndexForColumn,
|
|
5313
|
+
toggleGroupRow,
|
|
5314
|
+
groupRenderStrategy
|
|
5315
|
+
})
|
|
5316
|
+
});
|
|
5317
|
+
if (groupColumnFromProps) {
|
|
5318
|
+
if (typeof groupColumnFromProps === "function") {
|
|
5319
|
+
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps(options, toggleGroupRow));
|
|
5320
|
+
} else {
|
|
5321
|
+
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps);
|
|
5322
|
+
}
|
|
5323
|
+
}
|
|
5324
|
+
return generatedGroupColumn;
|
|
5325
|
+
}
|
|
5326
|
+
function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
5327
|
+
const theGroupColumnFromProps = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : groupColumnFromProps;
|
|
5328
|
+
const base = {};
|
|
5329
|
+
if (options.sortable != void 0) {
|
|
5330
|
+
base.sortable = options.sortable;
|
|
5331
|
+
}
|
|
5332
|
+
let generatedGroupColumn = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, base), {
|
|
5333
|
+
header: `Group`,
|
|
5334
|
+
groupByField: options.groupBy.map((g) => g.field),
|
|
5335
|
+
renderSelectionCheckBox: options.selectionMode === "multi-row",
|
|
5336
|
+
render: getGroupColumnRender({
|
|
5337
|
+
groupIndexForColumn: 0,
|
|
5338
|
+
groupRenderStrategy: "single-column"
|
|
5339
|
+
})
|
|
5340
|
+
}), groupColumnFromProps), {
|
|
5341
|
+
renderGroupIcon: getGroupColumnRenderGroupIcon({
|
|
5342
|
+
initialRenderGroupIcon: theGroupColumnFromProps == null ? void 0 : theGroupColumnFromProps.renderGroupIcon,
|
|
5343
|
+
groupIndexForColumn: 0,
|
|
5344
|
+
toggleGroupRow,
|
|
5345
|
+
groupRenderStrategy: "single-column"
|
|
5346
|
+
})
|
|
5347
|
+
});
|
|
5348
|
+
return generatedGroupColumn;
|
|
5349
|
+
}
|
|
5059
5350
|
|
|
5060
5351
|
// src/components/InfiniteTable/utils/objectValuesExcept.ts
|
|
5061
5352
|
function objectValuesExcept(obj, exceptList) {
|
|
@@ -5068,14 +5359,14 @@ function objectValuesExcept(obj, exceptList) {
|
|
|
5068
5359
|
}
|
|
5069
5360
|
|
|
5070
5361
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
5071
|
-
var
|
|
5362
|
+
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5072
5363
|
var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw2 _16lm1iw1r _16lm1iw1s _16lm1iwy";
|
|
5073
|
-
var ColumnCellRecipe = (0,
|
|
5364
|
+
var ColumnCellRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "_1eexc2a8", variantClassNames: { dragging: { false: "_1eexc2a9", true: "_1eexc2aa" }, rowActive: { false: "_1eexc2ab", true: "_1eexc2ac" }, zebra: { false: "_1eexc2ad", even: "_1eexc2ae", odd: "_1eexc2af" }, rowSelected: { true: "_1eexc2ag", false: "_1eexc2ah", null: "_1eexc2ai" }, first: { true: "_1eexc2aj", false: "_1eexc2ak" }, last: { true: "_1eexc2al", false: "_1eexc2am" }, groupByField: { true: "_1eexc2an", false: "_1eexc2ao" }, firstInCategory: { true: "_1eexc2ap", false: "_1eexc2aq" }, lastInCategory: { true: "_1eexc2ar", false: "_1eexc2as" }, pinned: { start: "_1eexc2at", end: "_1eexc2au", false: "_1eexc2av" }, filtered: { true: "_1eexc2aw", false: "_1eexc2ax" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2ay"], [{ pinned: "start", firstInCategory: true }, "_1eexc2az"], [{ pinned: "end", firstInCategory: true }, "_1eexc2a10"], [{ pinned: "end", lastInCategory: true }, "_1eexc2a11"]] });
|
|
5074
5365
|
var SelectionCheckboxCls = "_1eexc2a7";
|
|
5075
5366
|
|
|
5076
5367
|
// src/components/InfiniteTable/components/CheckBox.tsx
|
|
5077
|
-
var
|
|
5078
|
-
var
|
|
5368
|
+
var React19 = __toModule(require("react"));
|
|
5369
|
+
var import_react18 = __toModule(require("react"));
|
|
5079
5370
|
|
|
5080
5371
|
// src/components/InfiniteTable/components/CheckBox.css.ts
|
|
5081
5372
|
var CheckBoxCls = "_16lm1iwe";
|
|
@@ -5102,11 +5393,11 @@ var InfiniteCheckBoxRoot = getComponentStateRoot({
|
|
|
5102
5393
|
function InfiniteCheckBoxComponent() {
|
|
5103
5394
|
const { componentState, componentActions } = useComponentState();
|
|
5104
5395
|
const { checked, domProps } = componentState;
|
|
5105
|
-
const inputRef = (0,
|
|
5106
|
-
(0,
|
|
5396
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
5397
|
+
(0, import_react18.useEffect)(() => {
|
|
5107
5398
|
inputRef.current.indeterminate = checked == null;
|
|
5108
5399
|
}, [checked]);
|
|
5109
|
-
return /* @__PURE__ */
|
|
5400
|
+
return /* @__PURE__ */ React19.createElement("input", __spreadProps(__spreadValues({}, domProps), {
|
|
5110
5401
|
className: join(CheckBoxCls, domProps == null ? void 0 : domProps.className),
|
|
5111
5402
|
type: "checkbox",
|
|
5112
5403
|
ref: inputRef,
|
|
@@ -5117,19 +5408,147 @@ function InfiniteCheckBoxComponent() {
|
|
|
5117
5408
|
}));
|
|
5118
5409
|
}
|
|
5119
5410
|
function InfiniteCheckBox(props) {
|
|
5120
|
-
return /* @__PURE__ */
|
|
5411
|
+
return /* @__PURE__ */ React19.createElement(InfiniteCheckBoxRoot, __spreadValues({}, props), /* @__PURE__ */ React19.createElement(InfiniteCheckBoxComponent, null));
|
|
5121
5412
|
}
|
|
5122
5413
|
|
|
5123
|
-
// src/components/InfiniteTable/components/InfiniteTableRow/
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5414
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/columnRendering.tsx
|
|
5415
|
+
function isColumnWithField(c) {
|
|
5416
|
+
return typeof c.field === "string";
|
|
5417
|
+
}
|
|
5418
|
+
function getGroupByColumn(options) {
|
|
5419
|
+
const { column, rowInfo, columnsMap } = options;
|
|
5420
|
+
const groupByColumn = rowInfo.isGroupRow && column.groupByField ? columnsMap.get(rowInfo.isGroupRow ? rowInfo.groupBy[rowInfo.groupBy.length - 1] : "") : void 0;
|
|
5421
|
+
return groupByColumn;
|
|
5422
|
+
}
|
|
5423
|
+
function getColumnRenderingParams(options) {
|
|
5424
|
+
const { column } = options;
|
|
5425
|
+
const groupByColumn = getGroupByColumn(options);
|
|
5426
|
+
const formattedResult = getFormattedValueContextForCell(__spreadProps(__spreadValues({}, options), {
|
|
5427
|
+
column: groupByColumn || column
|
|
5428
|
+
}));
|
|
5429
|
+
const { formattedValueContext } = formattedResult;
|
|
5430
|
+
return {
|
|
5431
|
+
stylingParam: __spreadValues({
|
|
5432
|
+
column: options.column
|
|
5433
|
+
}, formattedValueContext),
|
|
5434
|
+
formattedValueContext,
|
|
5435
|
+
renderFunctions: {
|
|
5436
|
+
renderGroupIcon: (groupByColumn == null ? void 0 : groupByColumn.renderGroupIcon) || column.renderGroupIcon,
|
|
5437
|
+
renderSelectionCheckBox: column.renderSelectionCheckBox,
|
|
5438
|
+
renderValue: (groupByColumn == null ? void 0 : groupByColumn.renderValue) || column.renderValue,
|
|
5439
|
+
renderGroupValue: (groupByColumn == null ? void 0 : groupByColumn.renderGroupValue) || column.renderGroupValue,
|
|
5440
|
+
renderLeafValue: (groupByColumn == null ? void 0 : groupByColumn.renderLeafValue) || column.renderLeafValue
|
|
5441
|
+
},
|
|
5442
|
+
renderParams: getColumnRenderParam(__spreadProps(__spreadValues({}, options), {
|
|
5443
|
+
formattedValueContext
|
|
5444
|
+
})),
|
|
5445
|
+
groupByColumn
|
|
5446
|
+
};
|
|
5447
|
+
}
|
|
5448
|
+
function getColumnRenderParam(options) {
|
|
5449
|
+
const { column, context, rowInfo, columnsMap, formattedValueContext } = options;
|
|
5450
|
+
const { value } = formattedValueContext;
|
|
5451
|
+
const { api: imperativeApi, getDataSourceState } = context;
|
|
5452
|
+
const { indexInAll: rowIndex } = rowInfo;
|
|
5453
|
+
const dataSourceState = getDataSourceState();
|
|
5454
|
+
const { selectionMode } = dataSourceState;
|
|
5455
|
+
const groupByColumn = rowInfo.isGroupRow ? columnsMap.get(rowInfo.isGroupRow ? rowInfo.groupBy[rowInfo.groupBy.length - 1] : "") : void 0;
|
|
5456
|
+
const toggleGroupRow = imperativeApi.toggleGroupRow;
|
|
5457
|
+
const renderParam = __spreadProps(__spreadValues({
|
|
5458
|
+
column,
|
|
5459
|
+
columnsMap
|
|
5460
|
+
}, formattedValueContext), {
|
|
5461
|
+
groupByColumn,
|
|
5462
|
+
selectionMode,
|
|
5463
|
+
api: imperativeApi,
|
|
5464
|
+
selectRow: imperativeApi.selectionApi.selectRow,
|
|
5465
|
+
deselectRow: imperativeApi.selectionApi.deselectRow,
|
|
5466
|
+
toggleRowSelection: imperativeApi.selectionApi.toggleRowSelection,
|
|
5467
|
+
renderBag: {
|
|
5468
|
+
value,
|
|
5469
|
+
selectionCheckBox: null,
|
|
5470
|
+
groupIcon: null
|
|
5471
|
+
},
|
|
5472
|
+
selectCurrentRow: () => {
|
|
5473
|
+
return imperativeApi.selectionApi.selectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5474
|
+
},
|
|
5475
|
+
deselectCurrentRow: () => {
|
|
5476
|
+
return imperativeApi.selectionApi.deselectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5477
|
+
},
|
|
5478
|
+
rowIndex,
|
|
5479
|
+
toggleGroupRow,
|
|
5480
|
+
toggleCurrentGroupRow: () => {
|
|
5481
|
+
if (!rowInfo.isGroupRow) {
|
|
5482
|
+
return;
|
|
5483
|
+
}
|
|
5484
|
+
toggleGroupRow(rowInfo.groupKeys);
|
|
5485
|
+
},
|
|
5486
|
+
toggleCurrentGroupRowSelection: () => {
|
|
5487
|
+
if (!rowInfo.isGroupRow) {
|
|
5488
|
+
return;
|
|
5489
|
+
}
|
|
5490
|
+
return imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.isGroupRow ? rowInfo.groupKeys : []);
|
|
5491
|
+
},
|
|
5492
|
+
rootGroupBy: dataSourceState.groupBy,
|
|
5493
|
+
pivotBy: dataSourceState.pivotBy
|
|
5494
|
+
});
|
|
5495
|
+
return renderParam;
|
|
5496
|
+
}
|
|
5497
|
+
function getRawValueForCell(column, rowInfo) {
|
|
5498
|
+
const { data, isGroupRow, dataSourceHasGrouping } = rowInfo;
|
|
5499
|
+
const groupBy = dataSourceHasGrouping ? rowInfo.groupBy : void 0;
|
|
5500
|
+
let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
|
|
5501
|
+
if (column.valueGetter) {
|
|
5502
|
+
if (!rowInfo.isGroupRow && rowInfo.data) {
|
|
5503
|
+
value = column.valueGetter({ data: rowInfo.data, field: column.field });
|
|
5504
|
+
}
|
|
5505
|
+
}
|
|
5506
|
+
return value;
|
|
5507
|
+
}
|
|
5508
|
+
function getFormattedValueParamForCell(rawValue, column, rowInfo, context) {
|
|
5509
|
+
const { rowSelected, indexInAll: rowIndex } = rowInfo;
|
|
5510
|
+
const { activeRowIndex, keyboardNavigation } = context.getState();
|
|
5511
|
+
const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
|
|
5512
|
+
return rowInfo.isGroupRow ? {
|
|
5513
|
+
rowInfo,
|
|
5514
|
+
isGroupRow: rowInfo.isGroupRow,
|
|
5515
|
+
data: rowInfo.data,
|
|
5516
|
+
rowSelected,
|
|
5517
|
+
rowActive,
|
|
5518
|
+
value: rawValue,
|
|
5519
|
+
field: column.field
|
|
5520
|
+
} : {
|
|
5521
|
+
rowInfo,
|
|
5522
|
+
isGroupRow: rowInfo.isGroupRow,
|
|
5523
|
+
data: rowInfo.data,
|
|
5524
|
+
rowSelected,
|
|
5525
|
+
rowActive,
|
|
5526
|
+
value: rawValue,
|
|
5527
|
+
field: column.field
|
|
5528
|
+
};
|
|
5529
|
+
}
|
|
5530
|
+
function getFormattedValueContextForCell(options) {
|
|
5531
|
+
const { column, rowInfo, context } = options;
|
|
5532
|
+
const rawValue = getRawValueForCell(column, rowInfo);
|
|
5533
|
+
const formattedValueContext = getFormattedValueParamForCell(rawValue, column, rowInfo, context);
|
|
5534
|
+
const formattedValue = column.valueFormatter ? column.valueFormatter(formattedValueContext) : rawValue;
|
|
5535
|
+
formattedValueContext.value = formattedValue;
|
|
5536
|
+
return {
|
|
5537
|
+
formattedValue,
|
|
5538
|
+
formattedValueContext
|
|
5539
|
+
};
|
|
5540
|
+
}
|
|
5541
|
+
|
|
5542
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
5543
|
+
var React20 = __toModule(require("react"));
|
|
5544
|
+
var { rootClassName: rootClassName5 } = internalProps;
|
|
5545
|
+
var InfiniteTableCellClassName = `${rootClassName5}Cell`;
|
|
5546
|
+
var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
|
|
5547
|
+
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
5548
|
+
var columnReorderEffectDurationAtIndex2 = stripVar(InternalVars.columnReorderEffectDurationAtIndex);
|
|
5549
|
+
function InfiniteTableCellFn(props) {
|
|
5550
|
+
var _b, _c, _d;
|
|
5551
|
+
const _a = props, {
|
|
5133
5552
|
cssEllipsis = true,
|
|
5134
5553
|
virtualized = true,
|
|
5135
5554
|
skipColumnShifting = false,
|
|
@@ -5138,6 +5557,7 @@ function InfiniteTableCellFn(props) {
|
|
|
5138
5557
|
domRef,
|
|
5139
5558
|
width,
|
|
5140
5559
|
contentClassName,
|
|
5560
|
+
rowId,
|
|
5141
5561
|
afterChildren,
|
|
5142
5562
|
beforeChildren,
|
|
5143
5563
|
cellType,
|
|
@@ -5152,6 +5572,7 @@ function InfiniteTableCellFn(props) {
|
|
|
5152
5572
|
"domRef",
|
|
5153
5573
|
"width",
|
|
5154
5574
|
"contentClassName",
|
|
5575
|
+
"rowId",
|
|
5155
5576
|
"afterChildren",
|
|
5156
5577
|
"beforeChildren",
|
|
5157
5578
|
"cellType",
|
|
@@ -5168,25 +5589,28 @@ function InfiniteTableCellFn(props) {
|
|
|
5168
5589
|
"data-column-id": column.id,
|
|
5169
5590
|
"data-z-index": style.zIndex,
|
|
5170
5591
|
className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls),
|
|
5171
|
-
children: /* @__PURE__ */
|
|
5592
|
+
children: /* @__PURE__ */ React20.createElement(React20.Fragment, null, beforeChildren, /* @__PURE__ */ React20.createElement("div", {
|
|
5172
5593
|
className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
|
|
5173
5594
|
style: contentStyle
|
|
5174
5595
|
}, children), afterChildren)
|
|
5175
5596
|
});
|
|
5597
|
+
if (rowId != null) {
|
|
5598
|
+
finalDOMProps["data-row-id"] = `${rowId}`;
|
|
5599
|
+
}
|
|
5176
5600
|
const RenderComponent = cellType === "body" ? (_c = column.components) == null ? void 0 : _c.ColumnCell : (_d = column.components) == null ? void 0 : _d.HeaderCell;
|
|
5177
5601
|
if (RenderComponent) {
|
|
5178
|
-
return /* @__PURE__ */
|
|
5602
|
+
return /* @__PURE__ */ React20.createElement(RenderComponent, __spreadValues({}, finalDOMProps));
|
|
5179
5603
|
}
|
|
5180
|
-
return /* @__PURE__ */
|
|
5604
|
+
return /* @__PURE__ */ React20.createElement("div", __spreadProps(__spreadValues({}, finalDOMProps), {
|
|
5181
5605
|
ref: domRef
|
|
5182
5606
|
}));
|
|
5183
5607
|
}
|
|
5184
|
-
var InfiniteTableCell =
|
|
5608
|
+
var InfiniteTableCell = React20.memo(InfiniteTableCellFn);
|
|
5185
5609
|
|
|
5186
5610
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
5187
5611
|
var { rootClassName: rootClassName6 } = internalProps;
|
|
5188
5612
|
var columnZIndexAtIndex4 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
5189
|
-
var InfiniteTableColumnCellContext =
|
|
5613
|
+
var InfiniteTableColumnCellContext = React21.createContext(null);
|
|
5190
5614
|
var InfiniteTableColumnCellClassName = `${rootClassName6}ColumnCell`;
|
|
5191
5615
|
var defaultRenderSelectionCheckBox = (params) => {
|
|
5192
5616
|
const {
|
|
@@ -5199,7 +5623,7 @@ var defaultRenderSelectionCheckBox = (params) => {
|
|
|
5199
5623
|
if (rowInfo.isGroupRow && !column.groupByField) {
|
|
5200
5624
|
return null;
|
|
5201
5625
|
}
|
|
5202
|
-
return /* @__PURE__ */
|
|
5626
|
+
return /* @__PURE__ */ React21.createElement(InfiniteCheckBox, {
|
|
5203
5627
|
domProps: {
|
|
5204
5628
|
className: SelectionCheckboxCls
|
|
5205
5629
|
},
|
|
@@ -5217,8 +5641,12 @@ var defaultRenderSelectionCheckBox = (params) => {
|
|
|
5217
5641
|
checked: rowInfo.rowSelected
|
|
5218
5642
|
});
|
|
5219
5643
|
};
|
|
5220
|
-
function
|
|
5221
|
-
|
|
5644
|
+
function applyColumnClassName(columnClassName, param) {
|
|
5645
|
+
const colClassName = columnClassName ? typeof columnClassName === "function" ? columnClassName(param) : columnClassName : void 0;
|
|
5646
|
+
return colClassName;
|
|
5647
|
+
}
|
|
5648
|
+
function applyColumnStyle(existingStyle, columnStyle, param) {
|
|
5649
|
+
return typeof columnStyle === "function" ? __spreadValues(__spreadValues({}, existingStyle), columnStyle(param)) : __spreadValues(__spreadValues({}, existingStyle), columnStyle);
|
|
5222
5650
|
}
|
|
5223
5651
|
function InfiniteTableColumnCellFn(props) {
|
|
5224
5652
|
var _a;
|
|
@@ -5230,7 +5658,6 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5230
5658
|
column,
|
|
5231
5659
|
onMouseLeave,
|
|
5232
5660
|
onMouseEnter,
|
|
5233
|
-
toggleGroupRow,
|
|
5234
5661
|
rowIndex,
|
|
5235
5662
|
rowHeight,
|
|
5236
5663
|
columnsMap,
|
|
@@ -5239,46 +5666,49 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5239
5666
|
showZebraRows
|
|
5240
5667
|
} = props;
|
|
5241
5668
|
if (!column) {
|
|
5242
|
-
return /* @__PURE__ */
|
|
5669
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
5243
5670
|
ref: domRef
|
|
5244
5671
|
}, "no column");
|
|
5245
5672
|
}
|
|
5246
|
-
const {
|
|
5247
|
-
const groupBy = dataSourceHasGrouping ? rowInfo.groupBy : void 0;
|
|
5248
|
-
const groupRowInfo = null;
|
|
5673
|
+
const { rowSelected } = rowInfo;
|
|
5249
5674
|
const { getState, componentActions, imperativeApi } = useInfiniteTable();
|
|
5675
|
+
const { componentState: dataSourceState, getState: getDataSourceState } = useDataSourceContextValue();
|
|
5250
5676
|
const { activeRowIndex, keyboardNavigation } = getState();
|
|
5251
5677
|
const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
}
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
value
|
|
5273
|
-
});
|
|
5274
|
-
}
|
|
5275
|
-
const onClick = (0, import_react18.useCallback)((event) => {
|
|
5678
|
+
const renderingContext = {
|
|
5679
|
+
getState,
|
|
5680
|
+
getDataSourceState,
|
|
5681
|
+
actions: componentActions,
|
|
5682
|
+
api: imperativeApi
|
|
5683
|
+
};
|
|
5684
|
+
const {
|
|
5685
|
+
stylingParam,
|
|
5686
|
+
renderParams,
|
|
5687
|
+
formattedValueContext,
|
|
5688
|
+
renderFunctions,
|
|
5689
|
+
groupByColumn
|
|
5690
|
+
} = getColumnRenderingParams({
|
|
5691
|
+
column,
|
|
5692
|
+
rowInfo,
|
|
5693
|
+
columnsMap,
|
|
5694
|
+
context: renderingContext
|
|
5695
|
+
});
|
|
5696
|
+
const renderParam = renderParams;
|
|
5697
|
+
const onClick = (0, import_react19.useCallback)((event) => {
|
|
5276
5698
|
const colIndex = column.computedVisibleIndex;
|
|
5277
5699
|
getState().cellClick({
|
|
5278
5700
|
rowIndex,
|
|
5279
5701
|
colIndex,
|
|
5280
5702
|
event
|
|
5281
5703
|
});
|
|
5704
|
+
}, [rowIndex, column.computedVisibleIndex, keyboardNavigation]);
|
|
5705
|
+
const onMouseDown = (0, import_react19.useCallback)((event) => {
|
|
5706
|
+
const colIndex = column.computedVisibleIndex;
|
|
5707
|
+
getState().cellMouseDown({
|
|
5708
|
+
rowIndex,
|
|
5709
|
+
colIndex,
|
|
5710
|
+
event
|
|
5711
|
+
});
|
|
5282
5712
|
if (keyboardNavigation === "row") {
|
|
5283
5713
|
componentActions.activeRowIndex = rowIndex;
|
|
5284
5714
|
return;
|
|
@@ -5287,121 +5717,73 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5287
5717
|
componentActions.activeCellIndex = [rowIndex, colIndex];
|
|
5288
5718
|
}
|
|
5289
5719
|
}, [rowIndex, column.computedVisibleIndex, keyboardNavigation]);
|
|
5290
|
-
const {
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
rowInfo
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
isGroupRow: rowInfo.isGroupRow,
|
|
5302
|
-
data: rowInfo.data,
|
|
5303
|
-
rowActive,
|
|
5304
|
-
value,
|
|
5305
|
-
field: column.field
|
|
5306
|
-
};
|
|
5307
|
-
const stylingRenderParam = __spreadValues({
|
|
5308
|
-
column
|
|
5309
|
-
}, rest);
|
|
5310
|
-
const renderParam = __spreadProps(__spreadValues({
|
|
5311
|
-
column,
|
|
5312
|
-
columnsMap,
|
|
5313
|
-
domRef,
|
|
5314
|
-
groupRowInfo
|
|
5315
|
-
}, rest), {
|
|
5316
|
-
selectionMode,
|
|
5317
|
-
selectRow: imperativeApi.selectionApi.selectRow,
|
|
5318
|
-
deselectRow: imperativeApi.selectionApi.deselectRow,
|
|
5319
|
-
toggleRowSelection: imperativeApi.selectionApi.toggleRowSelection,
|
|
5320
|
-
renderBag: {
|
|
5321
|
-
value,
|
|
5322
|
-
selectionCheckBox: null,
|
|
5323
|
-
groupIcon: null
|
|
5324
|
-
},
|
|
5325
|
-
selectCurrentRow: (0, import_react18.useCallback)(() => {
|
|
5326
|
-
return imperativeApi.selectionApi.selectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5327
|
-
}, [rowInfo]),
|
|
5328
|
-
deselectCurrentRow: (0, import_react18.useCallback)(() => {
|
|
5329
|
-
return imperativeApi.selectionApi.deselectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5330
|
-
}, [rowInfo]),
|
|
5331
|
-
rowIndex,
|
|
5332
|
-
toggleGroupRow,
|
|
5333
|
-
toggleCurrentGroupRow: (0, import_react18.useCallback)(() => {
|
|
5334
|
-
if (!rowInfo.isGroupRow) {
|
|
5335
|
-
return;
|
|
5336
|
-
}
|
|
5337
|
-
toggleGroupRow(rowInfo.groupKeys);
|
|
5338
|
-
}, [rowInfo]),
|
|
5339
|
-
toggleCurrentGroupRowSelection: (0, import_react18.useCallback)(() => {
|
|
5340
|
-
if (!rowInfo.isGroupRow) {
|
|
5341
|
-
return;
|
|
5342
|
-
}
|
|
5343
|
-
return imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.isGroupRow ? rowInfo.groupKeys : []);
|
|
5344
|
-
}, [rowInfo]),
|
|
5345
|
-
groupBy: computedDataSource.groupBy,
|
|
5346
|
-
pivotBy: computedDataSource.pivotBy
|
|
5347
|
-
});
|
|
5348
|
-
const renderChildren = (0, import_react18.useCallback)(() => {
|
|
5720
|
+
const { selectionMode } = dataSourceState;
|
|
5721
|
+
renderParam.domRef = domRef;
|
|
5722
|
+
renderParam.selectCurrentRow = (0, import_react19.useCallback)(renderParam.selectCurrentRow, [
|
|
5723
|
+
rowInfo
|
|
5724
|
+
]);
|
|
5725
|
+
renderParam.deselectCurrentRow = (0, import_react19.useCallback)(renderParam.deselectCurrentRow, [
|
|
5726
|
+
rowInfo
|
|
5727
|
+
]);
|
|
5728
|
+
renderParam.toggleCurrentGroupRow = (0, import_react19.useCallback)(renderParam.toggleCurrentGroupRow, [rowInfo]);
|
|
5729
|
+
renderParam.toggleCurrentGroupRowSelection = (0, import_react19.useCallback)(renderParam.toggleCurrentGroupRowSelection, [rowInfo]);
|
|
5730
|
+
const renderChildren = (0, import_react19.useCallback)(() => {
|
|
5349
5731
|
if (hidden) {
|
|
5350
5732
|
return null;
|
|
5351
5733
|
}
|
|
5352
|
-
if (
|
|
5353
|
-
renderParam.renderBag.groupIcon = /* @__PURE__ */
|
|
5354
|
-
render:
|
|
5734
|
+
if (renderFunctions.renderGroupIcon) {
|
|
5735
|
+
renderParam.renderBag.groupIcon = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
|
|
5736
|
+
render: renderFunctions.renderGroupIcon,
|
|
5355
5737
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5356
5738
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5357
5739
|
})
|
|
5358
5740
|
});
|
|
5359
5741
|
}
|
|
5360
|
-
if (
|
|
5361
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
5742
|
+
if (renderFunctions.renderSelectionCheckBox && selectionMode == "multi-row") {
|
|
5743
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
|
|
5362
5744
|
render: defaultRenderSelectionCheckBox,
|
|
5363
5745
|
renderParam
|
|
5364
5746
|
});
|
|
5365
|
-
if (
|
|
5366
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
5367
|
-
render:
|
|
5747
|
+
if (renderFunctions.renderSelectionCheckBox !== true) {
|
|
5748
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
|
|
5749
|
+
render: renderFunctions.renderSelectionCheckBox,
|
|
5368
5750
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5369
5751
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5370
5752
|
})
|
|
5371
5753
|
});
|
|
5372
5754
|
}
|
|
5373
5755
|
}
|
|
5374
|
-
if (
|
|
5375
|
-
renderParam.renderBag.value = /* @__PURE__ */
|
|
5376
|
-
render:
|
|
5756
|
+
if (renderFunctions.renderValue) {
|
|
5757
|
+
renderParam.renderBag.value = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
|
|
5758
|
+
render: renderFunctions.renderValue,
|
|
5377
5759
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5378
5760
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5379
5761
|
})
|
|
5380
5762
|
});
|
|
5381
5763
|
}
|
|
5382
|
-
if (rowInfo.isGroupRow &&
|
|
5383
|
-
renderParam.renderBag.value = /* @__PURE__ */
|
|
5384
|
-
render:
|
|
5764
|
+
if (rowInfo.isGroupRow && renderFunctions.renderGroupValue) {
|
|
5765
|
+
renderParam.renderBag.value = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
|
|
5766
|
+
render: renderFunctions.renderGroupValue,
|
|
5385
5767
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5386
5768
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5387
5769
|
})
|
|
5388
5770
|
});
|
|
5389
5771
|
}
|
|
5390
|
-
if (!rowInfo.isGroupRow &&
|
|
5391
|
-
renderParam.renderBag.value = /* @__PURE__ */
|
|
5392
|
-
render:
|
|
5772
|
+
if (!rowInfo.isGroupRow && renderFunctions.renderLeafValue) {
|
|
5773
|
+
renderParam.renderBag.value = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
|
|
5774
|
+
render: renderFunctions.renderLeafValue,
|
|
5393
5775
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5394
5776
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5395
5777
|
})
|
|
5396
5778
|
});
|
|
5397
5779
|
}
|
|
5398
5780
|
if (column.render) {
|
|
5399
|
-
return /* @__PURE__ */
|
|
5781
|
+
return /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
|
|
5400
5782
|
render: column.render,
|
|
5401
5783
|
renderParam
|
|
5402
5784
|
});
|
|
5403
5785
|
}
|
|
5404
|
-
return /* @__PURE__ */
|
|
5786
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, column.align !== "end" ? renderParam.renderBag.groupIcon : null, column.align !== "end" ? renderParam.renderBag.selectionCheckBox : null, renderParam.renderBag.value, column.align === "end" ? renderParam.renderBag.selectionCheckBox : null, column.align === "end" ? renderParam.renderBag.groupIcon : null);
|
|
5405
5787
|
}, [
|
|
5406
5788
|
column,
|
|
5407
5789
|
hidden,
|
|
@@ -5409,19 +5791,34 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5409
5791
|
renderBag: true
|
|
5410
5792
|
})
|
|
5411
5793
|
]);
|
|
5412
|
-
const rowPropsAndStyleArgs = __spreadProps(__spreadValues({},
|
|
5794
|
+
const rowPropsAndStyleArgs = __spreadProps(__spreadValues({}, formattedValueContext), {
|
|
5413
5795
|
rowIndex
|
|
5414
5796
|
});
|
|
5415
5797
|
const rowComputedClassName = typeof rowClassName === "function" ? rowClassName(rowPropsAndStyleArgs) : rowClassName;
|
|
5416
|
-
|
|
5798
|
+
let colClassName = void 0;
|
|
5799
|
+
if (groupByColumn == null ? void 0 : groupByColumn.className) {
|
|
5800
|
+
colClassName = applyColumnClassName(groupByColumn.className, stylingParam);
|
|
5801
|
+
}
|
|
5802
|
+
if (column.className) {
|
|
5803
|
+
colClassName = join(colClassName, applyColumnClassName(column.className, stylingParam));
|
|
5804
|
+
}
|
|
5417
5805
|
let style;
|
|
5806
|
+
if (rowInfo.dataSourceHasGrouping && column.groupByField) {
|
|
5807
|
+
style = styleForGroupColumn({ rowInfo });
|
|
5808
|
+
}
|
|
5418
5809
|
if (rowStyle) {
|
|
5419
5810
|
style = typeof rowStyle === "function" ? __spreadValues(__spreadValues({}, style), rowStyle(rowPropsAndStyleArgs)) : __spreadValues(__spreadValues({}, style), rowStyle);
|
|
5420
5811
|
}
|
|
5421
|
-
|
|
5812
|
+
if (groupByColumn == null ? void 0 : groupByColumn.style) {
|
|
5813
|
+
style = applyColumnStyle(style, groupByColumn.style, stylingParam);
|
|
5814
|
+
}
|
|
5815
|
+
if (column.style) {
|
|
5816
|
+
style = applyColumnStyle(style, column.style, stylingParam);
|
|
5817
|
+
}
|
|
5818
|
+
style = style || {};
|
|
5422
5819
|
style.height = rowHeight;
|
|
5423
5820
|
style.zIndex = `var(${columnZIndexAtIndex4}-${column.computedVisibleIndex})`;
|
|
5424
|
-
const memoizedStyle = (0,
|
|
5821
|
+
const memoizedStyle = (0, import_react19.useMemo)(() => style, [!style ? null : JSON.stringify(style)]);
|
|
5425
5822
|
const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
|
|
5426
5823
|
const zebra = showZebraRows ? odd ? "odd" : "even" : false;
|
|
5427
5824
|
const cellProps = {
|
|
@@ -5429,19 +5826,21 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5429
5826
|
cellType: "body",
|
|
5430
5827
|
column,
|
|
5431
5828
|
width,
|
|
5829
|
+
rowId: rowInfo.id,
|
|
5432
5830
|
style: memoizedStyle,
|
|
5433
5831
|
onMouseLeave,
|
|
5434
5832
|
onMouseEnter,
|
|
5435
5833
|
onClick,
|
|
5834
|
+
onMouseDown,
|
|
5436
5835
|
cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
|
|
5437
5836
|
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false, zebra, rowActive, rowSelected }), colClassName, rowComputedClassName),
|
|
5438
5837
|
renderChildren
|
|
5439
5838
|
};
|
|
5440
|
-
return /* @__PURE__ */
|
|
5839
|
+
return /* @__PURE__ */ React21.createElement(InfiniteTableCell, __spreadValues({}, cellProps));
|
|
5441
5840
|
}
|
|
5442
|
-
var InfiniteTableColumnCell =
|
|
5841
|
+
var InfiniteTableColumnCell = React21.memo(InfiniteTableColumnCellFn);
|
|
5443
5842
|
function useInfiniteColumnCell() {
|
|
5444
|
-
const result = (0,
|
|
5843
|
+
const result = (0, import_react19.useContext)(InfiniteTableColumnCellContext);
|
|
5445
5844
|
return result;
|
|
5446
5845
|
}
|
|
5447
5846
|
|
|
@@ -5452,25 +5851,25 @@ function RenderHookComponent(props) {
|
|
|
5452
5851
|
}
|
|
5453
5852
|
function RenderCellHookComponent(props) {
|
|
5454
5853
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
5455
|
-
return /* @__PURE__ */
|
|
5854
|
+
return /* @__PURE__ */ React22.createElement(ContextProvider, {
|
|
5456
5855
|
value: props.renderParam
|
|
5457
|
-
}, /* @__PURE__ */
|
|
5856
|
+
}, /* @__PURE__ */ React22.createElement(RenderHookComponent, {
|
|
5458
5857
|
render: props.render,
|
|
5459
5858
|
renderParam: props.renderParam
|
|
5460
5859
|
}));
|
|
5461
5860
|
}
|
|
5462
5861
|
function RenderHeaderCellHookComponent(props) {
|
|
5463
5862
|
const ContextProvider = InfiniteTableHeaderCellContext.Provider;
|
|
5464
|
-
return /* @__PURE__ */
|
|
5863
|
+
return /* @__PURE__ */ React22.createElement(ContextProvider, {
|
|
5465
5864
|
value: props.renderParam
|
|
5466
|
-
}, /* @__PURE__ */
|
|
5865
|
+
}, /* @__PURE__ */ React22.createElement(RenderHookComponent, {
|
|
5467
5866
|
render: props.render,
|
|
5468
5867
|
renderParam: props.renderParam
|
|
5469
5868
|
}));
|
|
5470
5869
|
}
|
|
5471
5870
|
|
|
5472
5871
|
// src/components/InfiniteTable/components/FilterEditors.tsx
|
|
5473
|
-
var
|
|
5872
|
+
var React23 = __toModule(require("react"));
|
|
5474
5873
|
function getFilterEditors() {
|
|
5475
5874
|
return {
|
|
5476
5875
|
string: StringFilterEditor,
|
|
@@ -5479,7 +5878,7 @@ function getFilterEditors() {
|
|
|
5479
5878
|
}
|
|
5480
5879
|
var defaultFilterEditors = getFilterEditors();
|
|
5481
5880
|
function StringFilterEditor(props) {
|
|
5482
|
-
return /* @__PURE__ */
|
|
5881
|
+
return /* @__PURE__ */ React23.createElement("input", {
|
|
5483
5882
|
"aria-label": `Filter for ${props.ariaLabel}`,
|
|
5484
5883
|
type: "text",
|
|
5485
5884
|
value: props.filterValue,
|
|
@@ -5490,7 +5889,7 @@ function StringFilterEditor(props) {
|
|
|
5490
5889
|
});
|
|
5491
5890
|
}
|
|
5492
5891
|
function NumberFilterEditor(props) {
|
|
5493
|
-
return /* @__PURE__ */
|
|
5892
|
+
return /* @__PURE__ */ React23.createElement("input", {
|
|
5494
5893
|
"aria-label": `Filter for ${props.ariaLabel}`,
|
|
5495
5894
|
type: "number",
|
|
5496
5895
|
value: props.filterValue,
|
|
@@ -5506,23 +5905,23 @@ function NumberFilterEditor(props) {
|
|
|
5506
5905
|
}
|
|
5507
5906
|
|
|
5508
5907
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
5509
|
-
var
|
|
5510
|
-
var
|
|
5908
|
+
var React24 = __toModule(require("react"));
|
|
5909
|
+
var import_react20 = __toModule(require("react"));
|
|
5511
5910
|
|
|
5512
5911
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5513
|
-
var
|
|
5912
|
+
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5514
5913
|
var CellCls = "_1eexc2a5 _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw2 _16lm1iw1r _16lm1iw1s _16lm1iwy";
|
|
5515
|
-
var HeaderCellContentRecipe = (0,
|
|
5914
|
+
var HeaderCellContentRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob11e _16lm1iw10 _16lm1iw12 _16lm1iwu _16lm1iw1f _16lm1iw1h", variantClassNames: { filtered: { false: "_12zfob11f", true: "_12zfob11g" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5516
5915
|
var HeaderCellProxy = "_12zfob1k _16lm1iw1s _16lm1iw1t _16lm1iw1m";
|
|
5517
|
-
var HeaderCellRecipe = (0,
|
|
5518
|
-
var HeaderClsRecipe = (0,
|
|
5916
|
+
var HeaderCellRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob1l _16lm1iww", variantClassNames: { rowActive: { false: "_12zfob1m", true: "_12zfob1n" }, rowSelected: { false: "_12zfob1o", true: "_12zfob1p", null: "_12zfob1q" }, zebra: { false: "_12zfob1r", even: "_12zfob1s", odd: "_12zfob1t" }, dragging: { true: "_12zfob1u", false: "_12zfob1v" }, first: { true: "_12zfob1w", false: "_12zfob1x" }, last: { true: "_12zfob1y", false: "_12zfob1z" }, groupByField: { true: "_12zfob110", false: "_12zfob111" }, firstInCategory: { true: "_12zfob112", false: "_12zfob113" }, lastInCategory: { true: "_12zfob114", false: "_12zfob115" }, pinned: { start: "_12zfob116", end: "_12zfob117", false: "_12zfob118" }, filtered: { true: "_12zfob119", false: "_12zfob11a" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_12zfob11b"], [{ pinned: "end", firstInCategory: true }, "_12zfob11c"], [{ pinned: false, lastInCategory: true }, "_12zfob11d"]] });
|
|
5917
|
+
var HeaderClsRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob16 _16lm1iww _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob17", end: "_12zfob18", false: "_12zfob19" }, firstInCategory: { true: "_12zfob1a", false: "_12zfob1b" }, lastInCategory: { true: "_12zfob1c", false: "_12zfob1d" }, overflow: { true: "_12zfob1e", false: "_12zfob1f" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1g"], [{ pinned: "start", firstInCategory: true }, "_12zfob1h"], [{ overflow: true, pinned: "end" }, "_12zfob1i"], [{ pinned: "end", lastInCategory: true }, "_12zfob1j"]] });
|
|
5519
5918
|
var HeaderFilterCls = "_12zfob11j _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw1";
|
|
5520
5919
|
var HeaderFilterEditorCls = "_16lm1iw12 _16lm1iw10";
|
|
5521
5920
|
var HeaderGroupCls = "_12zfob11i _16lm1iwu _16lm1iw1f _16lm1iw1h";
|
|
5522
5921
|
var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
|
|
5523
5922
|
var HeaderSortIconCls = "_16lm1iw1";
|
|
5524
5923
|
var HeaderSortIconIndexCls = "_12zfob14";
|
|
5525
|
-
var HeaderSortIconRecipe = (0,
|
|
5924
|
+
var HeaderSortIconRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5526
5925
|
var HeaderWrapperCls = "_12zfob11h _16lm1iw1m _16lm1iw1 _16lm1iwu _16lm1iw1f";
|
|
5527
5926
|
|
|
5528
5927
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
@@ -5534,8 +5933,8 @@ var defaultLineStyle = {
|
|
|
5534
5933
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
5535
5934
|
function SortIcon(props) {
|
|
5536
5935
|
var _a;
|
|
5537
|
-
const [rendered, setRendered] = (0,
|
|
5538
|
-
const [opacity, setOpacity] = (0,
|
|
5936
|
+
const [rendered, setRendered] = (0, import_react20.useState)(true);
|
|
5937
|
+
const [opacity, setOpacity] = (0, import_react20.useState)(0);
|
|
5539
5938
|
const { direction, lineWidth = 1, style, className, index } = props;
|
|
5540
5939
|
const showIndex = index != null && index > 0;
|
|
5541
5940
|
const size = (_a = props.size) != null ? _a : 16;
|
|
@@ -5549,7 +5948,7 @@ function SortIcon(props) {
|
|
|
5549
5948
|
}), props.lineStyle), {
|
|
5550
5949
|
opacity
|
|
5551
5950
|
});
|
|
5552
|
-
(0,
|
|
5951
|
+
(0, import_react20.useEffect)(() => {
|
|
5553
5952
|
const newOpacity = direction != 0 ? 1 : 0;
|
|
5554
5953
|
if (!rendered && newOpacity) {
|
|
5555
5954
|
setRendered(true);
|
|
@@ -5579,37 +5978,37 @@ function SortIcon(props) {
|
|
|
5579
5978
|
if (direction === -1) {
|
|
5580
5979
|
indexStyle.top = "100%";
|
|
5581
5980
|
}
|
|
5582
|
-
return /* @__PURE__ */
|
|
5981
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
5583
5982
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
5584
5983
|
className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
|
|
5585
|
-
}, showIndex ? /* @__PURE__ */
|
|
5984
|
+
}, showIndex ? /* @__PURE__ */ React24.createElement("div", {
|
|
5586
5985
|
"data-name": "index",
|
|
5587
5986
|
style: indexStyle,
|
|
5588
5987
|
className: HeaderSortIconIndexCls
|
|
5589
|
-
}, index) : null, /* @__PURE__ */
|
|
5988
|
+
}, index) : null, /* @__PURE__ */ React24.createElement("div", {
|
|
5590
5989
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
5591
5990
|
onTransitionEnd
|
|
5592
|
-
}), /* @__PURE__ */
|
|
5991
|
+
}), /* @__PURE__ */ React24.createElement("div", {
|
|
5593
5992
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
5594
|
-
}), /* @__PURE__ */
|
|
5993
|
+
}), /* @__PURE__ */ React24.createElement("div", {
|
|
5595
5994
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
5596
5995
|
}));
|
|
5597
5996
|
}
|
|
5598
5997
|
|
|
5599
5998
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx
|
|
5600
|
-
var
|
|
5601
|
-
var
|
|
5999
|
+
var React25 = __toModule(require("react"));
|
|
6000
|
+
var import_react21 = __toModule(require("react"));
|
|
5602
6001
|
var { rootClassName: rootClassName7 } = internalProps;
|
|
5603
6002
|
var InfiniteTableColumnHeaderFilterClassName = `${rootClassName7}HeaderCell__filter`;
|
|
5604
6003
|
var stopPropagation = (e) => e.stopPropagation();
|
|
5605
6004
|
function InfiniteTableColumnHeaderFilter(props) {
|
|
5606
6005
|
var _a, _b, _c, _d;
|
|
5607
|
-
const [theValue, setTheValue] = (0,
|
|
6006
|
+
const [theValue, setTheValue] = (0, import_react21.useState)((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
|
|
5608
6007
|
const onInputChange = (filterValue) => {
|
|
5609
6008
|
setTheValue(filterValue);
|
|
5610
6009
|
props.onChange(filterValue);
|
|
5611
6010
|
};
|
|
5612
|
-
(0,
|
|
6011
|
+
(0, import_react21.useEffect)(() => {
|
|
5613
6012
|
var _a2;
|
|
5614
6013
|
if (props.columnFilterValue) {
|
|
5615
6014
|
if (theValue !== props.columnFilterValue.filterValue) {
|
|
@@ -5636,15 +6035,15 @@ function InfiniteTableColumnHeaderFilter(props) {
|
|
|
5636
6035
|
onChange: onInputChange
|
|
5637
6036
|
};
|
|
5638
6037
|
const FilterEditor = props.filterEditor;
|
|
5639
|
-
return /* @__PURE__ */
|
|
6038
|
+
return /* @__PURE__ */ React25.createElement("div", {
|
|
5640
6039
|
onPointerUp: stopPropagation,
|
|
5641
6040
|
onPointerDown: stopPropagation,
|
|
5642
6041
|
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
|
|
5643
6042
|
style: { height: props.columnHeaderHeight }
|
|
5644
|
-
}, FilterEditor ? /* @__PURE__ */
|
|
6043
|
+
}, FilterEditor ? /* @__PURE__ */ React25.createElement(FilterEditor, __spreadValues({}, filterEditorProps)) : null);
|
|
5645
6044
|
}
|
|
5646
6045
|
function InfiniteTableColumnHeaderFilterEmpty() {
|
|
5647
|
-
return /* @__PURE__ */
|
|
6046
|
+
return /* @__PURE__ */ React25.createElement("div", {
|
|
5648
6047
|
onPointerUp: stopPropagation,
|
|
5649
6048
|
onPointerDown: stopPropagation,
|
|
5650
6049
|
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
|
|
@@ -5653,8 +6052,8 @@ function InfiniteTableColumnHeaderFilterEmpty() {
|
|
|
5653
6052
|
}
|
|
5654
6053
|
|
|
5655
6054
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
|
|
5656
|
-
var
|
|
5657
|
-
var
|
|
6055
|
+
var React27 = __toModule(require("react"));
|
|
6056
|
+
var import_react23 = __toModule(require("react"));
|
|
5658
6057
|
|
|
5659
6058
|
// src/components/flexbox/index.ts
|
|
5660
6059
|
var computeFlex = (params) => {
|
|
@@ -5993,8 +6392,8 @@ var computeGroupResize = (params) => {
|
|
|
5993
6392
|
};
|
|
5994
6393
|
|
|
5995
6394
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
5996
|
-
var
|
|
5997
|
-
var
|
|
6395
|
+
var import_react22 = __toModule(require("react"));
|
|
6396
|
+
var React26 = __toModule(require("react"));
|
|
5998
6397
|
|
|
5999
6398
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts
|
|
6000
6399
|
function getColumnResizer(colIndex, {
|
|
@@ -6085,18 +6484,18 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
6085
6484
|
}
|
|
6086
6485
|
|
|
6087
6486
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
6088
|
-
var
|
|
6487
|
+
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
6089
6488
|
var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iw13 _16lm1iw1a _16lm1iw18 _16lm1iwf _16lm1iw1m";
|
|
6090
|
-
var ResizeHandleDraggerClsRecipe = (0,
|
|
6091
|
-
var ResizeHandleRecipeCls = (0,
|
|
6489
|
+
var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2 _16lm1iw13 _16lm1iw18", variantClassNames: { constrained: { false: "zneyzhc", true: "zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6490
|
+
var ResizeHandleRecipeCls = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { computedPinned: { start: "zneyzh1", end: "zneyzh2 _16lm1iw15 _16lm1iw1c", false: "zneyzh3" }, computedFirstInCategory: { true: "zneyzh4", false: "zneyzh5" }, computedLastInCategory: { true: "zneyzh6", false: "zneyzh7" } }, defaultVariants: {}, compoundVariants: [[{ computedPinned: "end", computedLastInCategory: false, computedFirstInCategory: true }, "zneyzh8"], [{ computedPinned: false, computedFirstInCategory: false, computedLastInCategory: true }, "zneyzh9"], [{ computedPinned: "start", computedFirstInCategory: false, computedLastInCategory: true }, "zneyzha"]] });
|
|
6092
6491
|
|
|
6093
6492
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
6094
6493
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
6095
6494
|
var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName8}HeaderCell_ResizeHandle`;
|
|
6096
6495
|
function ResizeHandleFn(props) {
|
|
6097
|
-
const domRef = (0,
|
|
6098
|
-
const [constrained, setConstrained] = (0,
|
|
6099
|
-
const constrainedRef = (0,
|
|
6496
|
+
const domRef = (0, import_react22.useRef)(null);
|
|
6497
|
+
const [constrained, setConstrained] = (0, import_react22.useState)(false);
|
|
6498
|
+
const constrainedRef = (0, import_react22.useRef)(constrained);
|
|
6100
6499
|
constrainedRef.current = constrained;
|
|
6101
6500
|
const col = props.columns[props.columnIndex];
|
|
6102
6501
|
if (!col) {
|
|
@@ -6148,7 +6547,7 @@ function ResizeHandleFn(props) {
|
|
|
6148
6547
|
const style = (computedPinned === false || computedPinned === "start") && computedLastInCategory ? {
|
|
6149
6548
|
right: computedPinned === "start" ? 0 : 0
|
|
6150
6549
|
} : computedPinned === "end" && computedFirstInCategory ? { right: "none", left: 0 } : void 0;
|
|
6151
|
-
return /* @__PURE__ */
|
|
6550
|
+
return /* @__PURE__ */ React26.createElement("div", {
|
|
6152
6551
|
ref: domRef,
|
|
6153
6552
|
className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls} ${ResizeHandleRecipeCls({
|
|
6154
6553
|
computedPinned,
|
|
@@ -6156,14 +6555,14 @@ function ResizeHandleFn(props) {
|
|
|
6156
6555
|
computedLastInCategory
|
|
6157
6556
|
})}`,
|
|
6158
6557
|
onPointerDown
|
|
6159
|
-
}, /* @__PURE__ */
|
|
6558
|
+
}, /* @__PURE__ */ React26.createElement("div", {
|
|
6160
6559
|
style,
|
|
6161
6560
|
className: ResizeHandleDraggerClsRecipe({
|
|
6162
6561
|
constrained
|
|
6163
6562
|
})
|
|
6164
6563
|
}));
|
|
6165
6564
|
}
|
|
6166
|
-
var ResizeHandle =
|
|
6565
|
+
var ResizeHandle = React26.memo(ResizeHandleFn);
|
|
6167
6566
|
|
|
6168
6567
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
|
|
6169
6568
|
function useColumnResizeHandle(column) {
|
|
@@ -6173,7 +6572,7 @@ function useColumnResizeHandle(column) {
|
|
|
6173
6572
|
getComputed,
|
|
6174
6573
|
componentActions
|
|
6175
6574
|
} = useInfiniteTable();
|
|
6176
|
-
const computeResizeForDiff = (0,
|
|
6575
|
+
const computeResizeForDiff = (0, import_react23.useCallback)(({
|
|
6177
6576
|
diff,
|
|
6178
6577
|
shareSpaceOnResize
|
|
6179
6578
|
}) => {
|
|
@@ -6208,7 +6607,7 @@ function useColumnResizeHandle(column) {
|
|
|
6208
6607
|
});
|
|
6209
6608
|
return result;
|
|
6210
6609
|
}, [column]);
|
|
6211
|
-
const onColumnResize = (0,
|
|
6610
|
+
const onColumnResize = (0, import_react23.useCallback)(({
|
|
6212
6611
|
diff,
|
|
6213
6612
|
shareSpaceOnResize
|
|
6214
6613
|
}) => {
|
|
@@ -6221,7 +6620,7 @@ function useColumnResizeHandle(column) {
|
|
|
6221
6620
|
}
|
|
6222
6621
|
componentActions.columnSizing = columnSizing;
|
|
6223
6622
|
}, [computeResizeForDiff]);
|
|
6224
|
-
const resizeHandle = column.computedResizable ? /* @__PURE__ */
|
|
6623
|
+
const resizeHandle = column.computedResizable ? /* @__PURE__ */ React27.createElement(ResizeHandle, {
|
|
6225
6624
|
columns: computedVisibleColumns,
|
|
6226
6625
|
columnIndex: column.computedVisibleIndex,
|
|
6227
6626
|
computeResize: computeResizeForDiff,
|
|
@@ -6234,7 +6633,7 @@ function useColumnResizeHandle(column) {
|
|
|
6234
6633
|
var defaultRenderSelectionCheckBox2 = (params) => {
|
|
6235
6634
|
const { allRowsSelected, someRowsSelected, api } = params;
|
|
6236
6635
|
const selected = allRowsSelected ? true : someRowsSelected ? null : false;
|
|
6237
|
-
return /* @__PURE__ */
|
|
6636
|
+
return /* @__PURE__ */ React28.createElement(InfiniteCheckBox, {
|
|
6238
6637
|
domProps: {
|
|
6239
6638
|
className: SelectionCheckboxCls
|
|
6240
6639
|
},
|
|
@@ -6248,7 +6647,7 @@ var defaultRenderSelectionCheckBox2 = (params) => {
|
|
|
6248
6647
|
checked: selected
|
|
6249
6648
|
});
|
|
6250
6649
|
};
|
|
6251
|
-
var InfiniteTableHeaderCellContext =
|
|
6650
|
+
var InfiniteTableHeaderCellContext = React28.createContext(null);
|
|
6252
6651
|
var { rootClassName: rootClassName9 } = internalProps;
|
|
6253
6652
|
var InfiniteTableHeaderCellClassName = `${rootClassName9}HeaderCell`;
|
|
6254
6653
|
var columnZIndexAtIndex5 = stripVar(InternalVars.columnZIndexAtIndex);
|
|
@@ -6270,13 +6669,13 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6270
6669
|
const { onResize, height, width, headerOptions, columnsMap } = props;
|
|
6271
6670
|
const sortInfo = column.computedSortInfo;
|
|
6272
6671
|
let header = column.header;
|
|
6273
|
-
const ref = (0,
|
|
6672
|
+
const ref = (0, import_react24.useCallback)((node) => {
|
|
6274
6673
|
var _a2;
|
|
6275
6674
|
domRef.current = node;
|
|
6276
6675
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
6277
6676
|
}, [props.domRef]);
|
|
6278
6677
|
const alwaysShow = headerOptions.alwaysReserveSpaceForSortIcon;
|
|
6279
|
-
const sortIcon = column.computedSortable && (column.computedSorted || alwaysShow) ? /* @__PURE__ */
|
|
6678
|
+
const sortIcon = column.computedSortable && (column.computedSorted || alwaysShow) ? /* @__PURE__ */ React28.createElement(SortIcon, {
|
|
6280
6679
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
6281
6680
|
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls} ${HeaderSortIconRecipe({
|
|
6282
6681
|
align: column.align || "start"
|
|
@@ -6303,7 +6702,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6303
6702
|
const align = column.align || "start";
|
|
6304
6703
|
const renderChildren = () => {
|
|
6305
6704
|
if (column.renderSortIcon) {
|
|
6306
|
-
renderParam.renderBag.sortIcon = /* @__PURE__ */
|
|
6705
|
+
renderParam.renderBag.sortIcon = /* @__PURE__ */ React28.createElement(RenderHeaderCellHookComponent, {
|
|
6307
6706
|
render: column.renderSortIcon,
|
|
6308
6707
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
6309
6708
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
@@ -6311,12 +6710,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6311
6710
|
});
|
|
6312
6711
|
}
|
|
6313
6712
|
if (column.renderSelectionCheckBox && selectionMode === "multi-row") {
|
|
6314
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
6713
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React28.createElement(RenderHeaderCellHookComponent, {
|
|
6315
6714
|
render: defaultRenderSelectionCheckBox2,
|
|
6316
6715
|
renderParam
|
|
6317
6716
|
});
|
|
6318
6717
|
if (column.renderHeaderSelectionCheckBox && column.renderHeaderSelectionCheckBox !== true) {
|
|
6319
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
6718
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React28.createElement(RenderHeaderCellHookComponent, {
|
|
6320
6719
|
render: column.renderHeaderSelectionCheckBox,
|
|
6321
6720
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
6322
6721
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
@@ -6325,7 +6724,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6325
6724
|
}
|
|
6326
6725
|
}
|
|
6327
6726
|
if (header instanceof Function) {
|
|
6328
|
-
renderParam.renderBag.header = /* @__PURE__ */
|
|
6727
|
+
renderParam.renderBag.header = /* @__PURE__ */ React28.createElement(RenderHeaderCellHookComponent, {
|
|
6329
6728
|
render: header,
|
|
6330
6729
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
6331
6730
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
@@ -6333,20 +6732,20 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6333
6732
|
});
|
|
6334
6733
|
}
|
|
6335
6734
|
if (column.renderHeader) {
|
|
6336
|
-
return /* @__PURE__ */
|
|
6735
|
+
return /* @__PURE__ */ React28.createElement(RenderHeaderCellHookComponent, {
|
|
6337
6736
|
render: column.renderHeader,
|
|
6338
6737
|
renderParam
|
|
6339
6738
|
});
|
|
6340
6739
|
}
|
|
6341
|
-
return /* @__PURE__ */
|
|
6740
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, align !== "end" ? renderParam.renderBag.selectionCheckBox : null, align === "end" ? renderParam.renderBag.sortIcon : null, renderParam.renderBag.header, align !== "end" ? renderParam.renderBag.sortIcon : null, align === "end" ? renderParam.renderBag.selectionCheckBox : null);
|
|
6342
6741
|
};
|
|
6343
|
-
const domRef = (0,
|
|
6742
|
+
const domRef = (0, import_react24.useRef)(null);
|
|
6344
6743
|
const {
|
|
6345
6744
|
componentActions: dataSourceActions,
|
|
6346
6745
|
getState: getDataSourceState,
|
|
6347
6746
|
componentState: { filterDelay, filterTypes }
|
|
6348
6747
|
} = useDataSourceContextValue();
|
|
6349
|
-
(0,
|
|
6748
|
+
(0, import_react24.useEffect)(() => {
|
|
6350
6749
|
let clearOnResize = null;
|
|
6351
6750
|
const node = domRef.current;
|
|
6352
6751
|
if (onResize && node) {
|
|
@@ -6369,7 +6768,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6369
6768
|
});
|
|
6370
6769
|
let draggingProxy = null;
|
|
6371
6770
|
if (dragging && proxyPosition) {
|
|
6372
|
-
draggingProxy = /* @__PURE__ */
|
|
6771
|
+
draggingProxy = /* @__PURE__ */ React28.createElement("div", {
|
|
6373
6772
|
key: column.id,
|
|
6374
6773
|
className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
|
|
6375
6774
|
style: {
|
|
@@ -6387,7 +6786,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6387
6786
|
const contentRecipeVariants = {
|
|
6388
6787
|
filtered: column.computedFiltered
|
|
6389
6788
|
};
|
|
6390
|
-
const setFilterValue = (0,
|
|
6789
|
+
const setFilterValue = (0, import_react24.useCallback)((filterValue) => {
|
|
6391
6790
|
var _a2;
|
|
6392
6791
|
const state = getDataSourceState();
|
|
6393
6792
|
let newFilterValue = (_a2 = state.filterValue) != null ? _a2 : [];
|
|
@@ -6411,7 +6810,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6411
6810
|
});
|
|
6412
6811
|
dataSourceActions.filterValue = newFilterValue;
|
|
6413
6812
|
}, [column, filterTypes]);
|
|
6414
|
-
const debouncedOnFilterValueChange =
|
|
6813
|
+
const debouncedOnFilterValueChange = React28.useMemo(() => {
|
|
6415
6814
|
const fn = (filterValue) => {
|
|
6416
6815
|
let newFilterValueForColumn;
|
|
6417
6816
|
if (column.computedFilterValue) {
|
|
@@ -6451,9 +6850,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6451
6850
|
const resizeHandle = useColumnResizeHandle(column);
|
|
6452
6851
|
const zIndex2 = `var(${columnZIndexAtIndex5}-${column.computedVisibleIndex})`;
|
|
6453
6852
|
style.zIndex = zIndex2;
|
|
6454
|
-
return /* @__PURE__ */
|
|
6853
|
+
return /* @__PURE__ */ React28.createElement(ContextProvider, {
|
|
6455
6854
|
value: renderParam
|
|
6456
|
-
}, /* @__PURE__ */
|
|
6855
|
+
}, /* @__PURE__ */ React28.createElement(InfiniteTableCell, {
|
|
6457
6856
|
domRef: ref,
|
|
6458
6857
|
cellType: "header",
|
|
6459
6858
|
column,
|
|
@@ -6472,7 +6871,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6472
6871
|
rowActive: false
|
|
6473
6872
|
}), CellCls),
|
|
6474
6873
|
cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
|
|
6475
|
-
afterChildren: /* @__PURE__ */
|
|
6874
|
+
afterChildren: /* @__PURE__ */ React28.createElement(React28.Fragment, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ React28.createElement(InfiniteTableColumnHeaderFilter, {
|
|
6476
6875
|
filterEditor: FilterEditor,
|
|
6477
6876
|
filterTypes,
|
|
6478
6877
|
onChange: debouncedOnFilterValueChange,
|
|
@@ -6480,17 +6879,17 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6480
6879
|
columnLabel: column.field || column.name || column.id,
|
|
6481
6880
|
columnFilterValue: column.computedFilterValue,
|
|
6482
6881
|
columnHeaderHeight
|
|
6483
|
-
}) : /* @__PURE__ */
|
|
6882
|
+
}) : /* @__PURE__ */ React28.createElement(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
|
|
6484
6883
|
renderChildren
|
|
6485
6884
|
}), draggingProxy);
|
|
6486
6885
|
}
|
|
6487
6886
|
function useInfiniteHeaderCell() {
|
|
6488
|
-
const result = (0,
|
|
6887
|
+
const result = (0, import_react24.useContext)(InfiniteTableHeaderCellContext);
|
|
6489
6888
|
return result;
|
|
6490
6889
|
}
|
|
6491
6890
|
|
|
6492
6891
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
6493
|
-
var
|
|
6892
|
+
var React33 = __toModule(require("react"));
|
|
6494
6893
|
|
|
6495
6894
|
// src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
|
|
6496
6895
|
function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap, columnGroupsMaxDepth) {
|
|
@@ -6593,25 +6992,25 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
6593
6992
|
}
|
|
6594
6993
|
|
|
6595
6994
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
6596
|
-
var
|
|
6597
|
-
var
|
|
6995
|
+
var React32 = __toModule(require("react"));
|
|
6996
|
+
var import_react27 = __toModule(require("react"));
|
|
6598
6997
|
|
|
6599
6998
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
6600
|
-
var
|
|
6999
|
+
var React31 = __toModule(require("react"));
|
|
6601
7000
|
|
|
6602
7001
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
|
|
6603
|
-
var
|
|
6604
|
-
var
|
|
7002
|
+
var React30 = __toModule(require("react"));
|
|
7003
|
+
var import_react26 = __toModule(require("react"));
|
|
6605
7004
|
|
|
6606
7005
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
|
|
6607
|
-
var
|
|
6608
|
-
var
|
|
7006
|
+
var import_react25 = __toModule(require("react"));
|
|
7007
|
+
var React29 = __toModule(require("react"));
|
|
6609
7008
|
var { rootClassName: rootClassName10 } = internalProps;
|
|
6610
7009
|
var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName10}HeaderCell_ResizeHandle`;
|
|
6611
7010
|
function GroupResizeHandleFn(props) {
|
|
6612
|
-
const domRef = (0,
|
|
6613
|
-
const [constrained, setConstrained] = (0,
|
|
6614
|
-
const constrainedRef = (0,
|
|
7011
|
+
const domRef = (0, import_react25.useRef)(null);
|
|
7012
|
+
const [constrained, setConstrained] = (0, import_react25.useState)(false);
|
|
7013
|
+
const constrainedRef = (0, import_react25.useRef)(constrained);
|
|
6615
7014
|
constrainedRef.current = constrained;
|
|
6616
7015
|
const col = props.groupColumns[0];
|
|
6617
7016
|
if (!col) {
|
|
@@ -6671,7 +7070,7 @@ function GroupResizeHandleFn(props) {
|
|
|
6671
7070
|
const style = (computedPinned === false || computedPinned === "start") && computedLastInCategory ? {
|
|
6672
7071
|
right: computedPinned === "start" ? 0 : ThemeVars.components.HeaderCell.resizeHandleWidth
|
|
6673
7072
|
} : computedPinned === "end" && computedFirstInCategory ? { right: "none", left: 0 } : void 0;
|
|
6674
|
-
return /* @__PURE__ */
|
|
7073
|
+
return /* @__PURE__ */ React29.createElement("div", {
|
|
6675
7074
|
ref: domRef,
|
|
6676
7075
|
className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls} ${ResizeHandleRecipeCls({
|
|
6677
7076
|
computedPinned,
|
|
@@ -6679,14 +7078,14 @@ function GroupResizeHandleFn(props) {
|
|
|
6679
7078
|
computedLastInCategory
|
|
6680
7079
|
})}`,
|
|
6681
7080
|
onPointerDown
|
|
6682
|
-
}, /* @__PURE__ */
|
|
7081
|
+
}, /* @__PURE__ */ React29.createElement("div", {
|
|
6683
7082
|
style: __spreadValues(__spreadValues({}, style), props.style),
|
|
6684
7083
|
className: ResizeHandleDraggerClsRecipe({
|
|
6685
7084
|
constrained
|
|
6686
7085
|
})
|
|
6687
7086
|
}));
|
|
6688
7087
|
}
|
|
6689
|
-
var GroupResizeHandle =
|
|
7088
|
+
var GroupResizeHandle = React29.memo(GroupResizeHandleFn);
|
|
6690
7089
|
|
|
6691
7090
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
|
|
6692
7091
|
function useColumnGroupResizeHandle(groupColumns, config) {
|
|
@@ -6698,7 +7097,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
6698
7097
|
componentActions
|
|
6699
7098
|
} = useInfiniteTable();
|
|
6700
7099
|
const lastColumnInGroup = groupColumns[groupColumns.length - 1];
|
|
6701
|
-
const computeResizeForDiff = (0,
|
|
7100
|
+
const computeResizeForDiff = (0, import_react26.useCallback)((diff) => {
|
|
6702
7101
|
const state = getState();
|
|
6703
7102
|
const { columnSizing, viewportReservedWidth, bodySize } = state;
|
|
6704
7103
|
const columns = getComputed().computedVisibleColumns;
|
|
@@ -6731,13 +7130,13 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
6731
7130
|
});
|
|
6732
7131
|
return result;
|
|
6733
7132
|
}, [lastColumnInGroup]);
|
|
6734
|
-
const onColumnResize = (0,
|
|
7133
|
+
const onColumnResize = (0, import_react26.useCallback)((diff) => {
|
|
6735
7134
|
const { columnSizing, reservedWidth } = computeResizeForDiff(diff);
|
|
6736
7135
|
componentActions.viewportReservedWidth = reservedWidth;
|
|
6737
7136
|
componentActions.columnSizing = columnSizing;
|
|
6738
7137
|
}, [computeResizeForDiff]);
|
|
6739
7138
|
const groupResizable = groupColumns.some((c) => c.computedResizable);
|
|
6740
|
-
const resizeHandle = groupResizable ? /* @__PURE__ */
|
|
7139
|
+
const resizeHandle = groupResizable ? /* @__PURE__ */ React30.createElement(GroupResizeHandle, {
|
|
6741
7140
|
brain: bodyBrain,
|
|
6742
7141
|
style: {
|
|
6743
7142
|
height: groupHeight * (columnGroupsMaxDepth - columnGroup.depth + 2)
|
|
@@ -6771,13 +7170,13 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
6771
7170
|
const firstColumn = columns[0];
|
|
6772
7171
|
const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex5}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex5}-${firstColumn.computedVisibleIndex})`;
|
|
6773
7172
|
const zIndex2 = `calc(var(${columnZIndexAtIndex6}-${firstColumn.computedVisibleIndex}) + ${columnGroupsMaxDepth - columnGroup.depth})`;
|
|
6774
|
-
return /* @__PURE__ */
|
|
7173
|
+
return /* @__PURE__ */ React31.createElement("div", {
|
|
6775
7174
|
ref: props.domRef,
|
|
6776
7175
|
"data-group-id": columnGroup.uniqueGroupId,
|
|
6777
7176
|
className: join(HeaderGroupCls, TableHeaderGroupClassName),
|
|
6778
7177
|
style: { width, height },
|
|
6779
7178
|
"data-z-index": zIndex2
|
|
6780
|
-
}, /* @__PURE__ */
|
|
7179
|
+
}, /* @__PURE__ */ React31.createElement("div", {
|
|
6781
7180
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
6782
7181
|
}, header), handle);
|
|
6783
7182
|
}
|
|
@@ -6800,8 +7199,8 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6800
7199
|
computed,
|
|
6801
7200
|
componentState: { headerBrain, headerOptions }
|
|
6802
7201
|
} = useInfiniteTable();
|
|
6803
|
-
const {
|
|
6804
|
-
(0,
|
|
7202
|
+
const { computedColumnsMap, showColumnFilters } = computed;
|
|
7203
|
+
(0, import_react27.useEffect)(() => {
|
|
6805
7204
|
const onScroll = (scrollPosition) => {
|
|
6806
7205
|
if (domRef.current) {
|
|
6807
7206
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
@@ -6810,7 +7209,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6810
7209
|
const removeOnScroll = brain.onScroll(onScroll);
|
|
6811
7210
|
return removeOnScroll;
|
|
6812
7211
|
}, [brain]);
|
|
6813
|
-
const domRef = (0,
|
|
7212
|
+
const domRef = (0, import_react27.useRef)(null);
|
|
6814
7213
|
const headerCls = HeaderClsRecipe({
|
|
6815
7214
|
overflow: false
|
|
6816
7215
|
});
|
|
@@ -6819,7 +7218,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6819
7218
|
className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
|
|
6820
7219
|
style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
|
|
6821
7220
|
};
|
|
6822
|
-
const renderCell = (0,
|
|
7221
|
+
const renderCell = (0, import_react27.useCallback)((params) => {
|
|
6823
7222
|
const {
|
|
6824
7223
|
rowIndex,
|
|
6825
7224
|
colIndex,
|
|
@@ -6844,7 +7243,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6844
7243
|
computedWidth: colGroupItem.computedWidth,
|
|
6845
7244
|
groupOffset: colGroupItem.groupOffset
|
|
6846
7245
|
});
|
|
6847
|
-
return /* @__PURE__ */
|
|
7246
|
+
return /* @__PURE__ */ React32.createElement(InfiniteTableHeaderGroup, {
|
|
6848
7247
|
bodyBrain,
|
|
6849
7248
|
columnGroupsMaxDepth,
|
|
6850
7249
|
domRef: domRef2,
|
|
@@ -6854,13 +7253,13 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6854
7253
|
columnGroup: computedColumnGroup
|
|
6855
7254
|
});
|
|
6856
7255
|
}
|
|
6857
|
-
return /* @__PURE__ */
|
|
7256
|
+
return /* @__PURE__ */ React32.createElement(InfiniteTableHeaderCell, {
|
|
6858
7257
|
domRef: domRef2,
|
|
6859
7258
|
column,
|
|
6860
7259
|
headerOptions,
|
|
6861
7260
|
width: widthWithColspan,
|
|
6862
7261
|
height: heightWithRowspan,
|
|
6863
|
-
columnsMap:
|
|
7262
|
+
columnsMap: computedColumnsMap
|
|
6864
7263
|
});
|
|
6865
7264
|
}, [
|
|
6866
7265
|
headerOptions,
|
|
@@ -6870,14 +7269,14 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6870
7269
|
columnGroupsMaxDepth,
|
|
6871
7270
|
showColumnFilters
|
|
6872
7271
|
]);
|
|
6873
|
-
return /* @__PURE__ */
|
|
7272
|
+
return /* @__PURE__ */ React32.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React32.createElement(RawTable, {
|
|
6874
7273
|
name: "header",
|
|
6875
7274
|
renderCell,
|
|
6876
7275
|
brain: headerBrain,
|
|
6877
7276
|
cellHoverClassNames: []
|
|
6878
7277
|
}));
|
|
6879
7278
|
}
|
|
6880
|
-
var InfiniteTableHeader =
|
|
7279
|
+
var InfiniteTableHeader = React32.memo(InfiniteTableHeaderFn);
|
|
6881
7280
|
|
|
6882
7281
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
6883
7282
|
function TableHeaderWrapper(props) {
|
|
@@ -6900,13 +7299,13 @@ function TableHeaderWrapper(props) {
|
|
|
6900
7299
|
} = tableContextValue;
|
|
6901
7300
|
const rows = !computedColumnGroups || !computedColumnGroups.size ? 1 : columnGroupsMaxDepth + 2;
|
|
6902
7301
|
const height = rows * columnHeaderHeight + (showColumnFilters ? columnHeaderHeight : 0);
|
|
6903
|
-
const columnAndGroupTreeInfo =
|
|
7302
|
+
const columnAndGroupTreeInfo = React33.useMemo(() => {
|
|
6904
7303
|
if (!computedColumnGroups || !computedColumnGroups.size) {
|
|
6905
7304
|
return void 0;
|
|
6906
7305
|
}
|
|
6907
7306
|
return buildColumnAndGroupTree(computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap, columnGroupsMaxDepth);
|
|
6908
7307
|
}, [computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap]);
|
|
6909
|
-
const cellspan =
|
|
7308
|
+
const cellspan = React33.useCallback(({ rowIndex, colIndex }) => {
|
|
6910
7309
|
const column = computedVisibleColumns[colIndex];
|
|
6911
7310
|
const rowspan2 = 1;
|
|
6912
7311
|
const colspan2 = 1;
|
|
@@ -6939,9 +7338,9 @@ function TableHeaderWrapper(props) {
|
|
|
6939
7338
|
rows,
|
|
6940
7339
|
columnGroupsDepthsMap
|
|
6941
7340
|
]);
|
|
6942
|
-
const rowspan =
|
|
6943
|
-
const colspan =
|
|
6944
|
-
const rowHeight =
|
|
7341
|
+
const rowspan = React33.useCallback(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).rowspan, [cellspan]);
|
|
7342
|
+
const colspan = React33.useCallback(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).colspan, [cellspan]);
|
|
7343
|
+
const rowHeight = React33.useCallback((index) => {
|
|
6945
7344
|
return showColumnFilters ? index < rows - 1 ? columnHeaderHeight : 2 * columnHeaderHeight : columnHeaderHeight;
|
|
6946
7345
|
}, [rows, showColumnFilters, columnHeaderHeight]);
|
|
6947
7346
|
useMatrixBrain(headerBrain, {
|
|
@@ -6956,7 +7355,7 @@ function TableHeaderWrapper(props) {
|
|
|
6956
7355
|
fixedColsEnd: computedPinnedEndColumns.length,
|
|
6957
7356
|
fixedColsStart: computedPinnedStartColumns.length
|
|
6958
7357
|
});
|
|
6959
|
-
const header = /* @__PURE__ */
|
|
7358
|
+
const header = /* @__PURE__ */ React33.createElement(InfiniteTableHeader, {
|
|
6960
7359
|
columns: computedVisibleColumns,
|
|
6961
7360
|
headerBrain,
|
|
6962
7361
|
bodyBrain,
|
|
@@ -6964,14 +7363,14 @@ function TableHeaderWrapper(props) {
|
|
|
6964
7363
|
columnGroupsMaxDepth,
|
|
6965
7364
|
columnAndGroupTreeInfo
|
|
6966
7365
|
});
|
|
6967
|
-
const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */
|
|
7366
|
+
const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ React33.createElement("div", {
|
|
6968
7367
|
className: HeaderScrollbarPlaceholderCls,
|
|
6969
7368
|
style: {
|
|
6970
7369
|
zIndex: 1e3,
|
|
6971
7370
|
width: getScrollbarWidth()
|
|
6972
7371
|
}
|
|
6973
7372
|
}) : null;
|
|
6974
|
-
return /* @__PURE__ */
|
|
7373
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
6975
7374
|
className: HeaderWrapperCls,
|
|
6976
7375
|
style: {
|
|
6977
7376
|
height
|
|
@@ -6980,8 +7379,8 @@ function TableHeaderWrapper(props) {
|
|
|
6980
7379
|
}
|
|
6981
7380
|
|
|
6982
7381
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
6983
|
-
var
|
|
6984
|
-
var
|
|
7382
|
+
var React34 = __toModule(require("react"));
|
|
7383
|
+
var import_react28 = __toModule(require("react"));
|
|
6985
7384
|
|
|
6986
7385
|
// src/components/utils/decamelize.ts
|
|
6987
7386
|
function decamelize(str, options) {
|
|
@@ -7016,10 +7415,10 @@ var enforceStyle = (node, style) => {
|
|
|
7016
7415
|
node.style.setProperty(decamelize(propertyName), propertyValue, "important");
|
|
7017
7416
|
}
|
|
7018
7417
|
};
|
|
7019
|
-
var InfiniteTableLicenseFooter =
|
|
7418
|
+
var InfiniteTableLicenseFooter = React34.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
|
|
7020
7419
|
const { rootClassName: rootClassName13 } = useInternalProps();
|
|
7021
|
-
const domRef =
|
|
7022
|
-
const domCallback =
|
|
7420
|
+
const domRef = React34.useRef(null);
|
|
7421
|
+
const domCallback = React34.useCallback((node) => {
|
|
7023
7422
|
domRef.current = node;
|
|
7024
7423
|
if (!ref) {
|
|
7025
7424
|
return;
|
|
@@ -7030,7 +7429,7 @@ var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicens
|
|
|
7030
7429
|
ref.current = node;
|
|
7031
7430
|
}
|
|
7032
7431
|
}, []);
|
|
7033
|
-
(0,
|
|
7432
|
+
(0, import_react28.useEffect)(() => {
|
|
7034
7433
|
const forceStyle = () => {
|
|
7035
7434
|
raf(() => {
|
|
7036
7435
|
var _a;
|
|
@@ -7044,12 +7443,12 @@ var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicens
|
|
|
7044
7443
|
clearInterval(intervalId);
|
|
7045
7444
|
};
|
|
7046
7445
|
}, []);
|
|
7047
|
-
return /* @__PURE__ */
|
|
7446
|
+
return /* @__PURE__ */ React34.createElement("div", __spreadProps(__spreadValues({
|
|
7048
7447
|
ref: domCallback
|
|
7049
7448
|
}, props), {
|
|
7050
7449
|
className: join(`${rootClassName13}-Footer`, FooterCls, props.className),
|
|
7051
7450
|
style: defaultStyle
|
|
7052
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7451
|
+
}), "Powered by", " ", /* @__PURE__ */ React34.createElement("a", {
|
|
7053
7452
|
href: "https://infinite-table.com",
|
|
7054
7453
|
rel: "noopener noreferrer",
|
|
7055
7454
|
role: "link",
|
|
@@ -7057,14 +7456,8 @@ var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicens
|
|
|
7057
7456
|
}, "Infinite Table"));
|
|
7058
7457
|
});
|
|
7059
7458
|
|
|
7060
|
-
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
7061
|
-
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
7062
|
-
var GroupRowExpanderCls = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_7pupv0b", center: "_7pupv0c", end: "_7pupv0d" } }, defaultVariants: {}, compoundVariants: [] });
|
|
7063
|
-
var RowClsRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_7pupv00", variantClassNames: { zebra: { false: "_7pupv02", even: "_7pupv03", odd: "_7pupv04" }, groupRow: { true: "_7pupv05", false: "_7pupv06" }, inlineGroupRow: { true: "_7pupv07", false: "_7pupv08" }, showHoverRows: { true: "_7pupv09", false: "_7pupv0a" } }, defaultVariants: {}, compoundVariants: [] });
|
|
7064
|
-
var RowHoverCls = "_7pupv01";
|
|
7065
|
-
|
|
7066
7459
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
7067
|
-
var
|
|
7460
|
+
var React35 = __toModule(require("react"));
|
|
7068
7461
|
|
|
7069
7462
|
// src/components/InfiniteTable/components/LoadMask.css.ts
|
|
7070
7463
|
var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw13 _16lm1iw15 _16lm1iw1a _16lm1iw18", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw13 _16lm1iw15 _16lm1iw1a _16lm1iw18" };
|
|
@@ -7076,15 +7469,15 @@ var { rootClassName: rootClassName12 } = internalProps;
|
|
|
7076
7469
|
var baseCls3 = `${rootClassName12}-LoadMask`;
|
|
7077
7470
|
function LoadMaskFn(props) {
|
|
7078
7471
|
const { visible, children = "Loading" } = props;
|
|
7079
|
-
return /* @__PURE__ */
|
|
7472
|
+
return /* @__PURE__ */ React35.createElement("div", {
|
|
7080
7473
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls3}`
|
|
7081
|
-
}, /* @__PURE__ */
|
|
7474
|
+
}, /* @__PURE__ */ React35.createElement("div", {
|
|
7082
7475
|
className: `${LoadMaskOverlayCls} ${baseCls3}-Overlay`
|
|
7083
|
-
}), /* @__PURE__ */
|
|
7476
|
+
}), /* @__PURE__ */ React35.createElement("div", {
|
|
7084
7477
|
className: `${LoadMaskTextCls} ${baseCls3}-Text`
|
|
7085
7478
|
}, children));
|
|
7086
7479
|
}
|
|
7087
|
-
var LoadMask =
|
|
7480
|
+
var LoadMask = React35.memo(LoadMaskFn);
|
|
7088
7481
|
|
|
7089
7482
|
// src/utils/deepClone.ts
|
|
7090
7483
|
function cloneArray(arr) {
|
|
@@ -7321,14 +7714,17 @@ function group(groupParams, data) {
|
|
|
7321
7714
|
}
|
|
7322
7715
|
for (let i = 0, len = data.length; i < len; i++) {
|
|
7323
7716
|
const item = data[i];
|
|
7717
|
+
const commonData = {};
|
|
7324
7718
|
for (let groupByIndex = 0; groupByIndex < groupByLength; groupByIndex++) {
|
|
7325
7719
|
const { field: groupByProperty, toKey: groupToKey } = groupBy[groupByIndex];
|
|
7326
7720
|
const key = (groupToKey || defaultToKey)(item[groupByProperty], item);
|
|
7721
|
+
commonData[groupByProperty] = key;
|
|
7327
7722
|
currentGroupKeys.push(key);
|
|
7328
7723
|
if (!deepMap.has(currentGroupKeys)) {
|
|
7329
7724
|
const deepMapGroupValue = {
|
|
7330
7725
|
items: [],
|
|
7331
7726
|
cache: false,
|
|
7727
|
+
commonData: __spreadValues({}, commonData),
|
|
7332
7728
|
childrenLoading: false,
|
|
7333
7729
|
childrenAvailable: false,
|
|
7334
7730
|
reducerResults: deepClone(initialReducerValue)
|
|
@@ -7600,7 +7996,7 @@ function enhancedFlatten(param) {
|
|
|
7600
7996
|
}
|
|
7601
7997
|
|
|
7602
7998
|
// src/components/DataSource/index.tsx
|
|
7603
|
-
var
|
|
7999
|
+
var React36 = __toModule(require("react"));
|
|
7604
8000
|
|
|
7605
8001
|
// src/utils/multisort/sortTypes.ts
|
|
7606
8002
|
var numberComparator = function(first, second) {
|
|
@@ -7619,7 +8015,15 @@ var sortTypes_default = defaultSortTypes;
|
|
|
7619
8015
|
|
|
7620
8016
|
// src/utils/multisort/index.ts
|
|
7621
8017
|
var multisort = (sortInfo, array, get) => {
|
|
7622
|
-
|
|
8018
|
+
const plainSortInfo = sortInfo.map((sortInfo2) => {
|
|
8019
|
+
if (Array.isArray(sortInfo2.field)) {
|
|
8020
|
+
return sortInfo2.field.map((field) => {
|
|
8021
|
+
return __spreadProps(__spreadValues({}, sortInfo2), { field });
|
|
8022
|
+
});
|
|
8023
|
+
}
|
|
8024
|
+
return sortInfo2;
|
|
8025
|
+
}).flat();
|
|
8026
|
+
array.sort(getMultisortFunction(plainSortInfo, get));
|
|
7623
8027
|
return array;
|
|
7624
8028
|
};
|
|
7625
8029
|
multisort.knownTypes = sortTypes_default;
|
|
@@ -7852,15 +8256,15 @@ var GroupRowsState = class extends BooleanDeepCollectionState {
|
|
|
7852
8256
|
};
|
|
7853
8257
|
|
|
7854
8258
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
7855
|
-
var
|
|
8259
|
+
var import_react30 = __toModule(require("react"));
|
|
7856
8260
|
|
|
7857
8261
|
// src/components/hooks/useEffectWithChanges.ts
|
|
7858
|
-
var
|
|
8262
|
+
var import_react29 = __toModule(require("react"));
|
|
7859
8263
|
function useEffectWithChanges(fn, deps) {
|
|
7860
|
-
const prevRef = (0,
|
|
7861
|
-
const oldValuesRef = (0,
|
|
8264
|
+
const prevRef = (0, import_react29.useRef)({});
|
|
8265
|
+
const oldValuesRef = (0, import_react29.useRef)({});
|
|
7862
8266
|
const oldValues = oldValuesRef.current;
|
|
7863
|
-
const changesRef = (0,
|
|
8267
|
+
const changesRef = (0, import_react29.useRef)({});
|
|
7864
8268
|
const changes = changesRef.current;
|
|
7865
8269
|
const useEffectDeps = [];
|
|
7866
8270
|
for (const k in deps) {
|
|
@@ -7873,7 +8277,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
7873
8277
|
}
|
|
7874
8278
|
}
|
|
7875
8279
|
prevRef.current = deps;
|
|
7876
|
-
(0,
|
|
8280
|
+
(0, import_react29.useEffect)(() => {
|
|
7877
8281
|
const changes2 = changesRef.current;
|
|
7878
8282
|
const result = fn(changes2, oldValues);
|
|
7879
8283
|
changesRef.current = {};
|
|
@@ -8139,12 +8543,12 @@ function useLoadData() {
|
|
|
8139
8543
|
livePaginationCursor,
|
|
8140
8544
|
cursorId: stateCursorId
|
|
8141
8545
|
} = componentState;
|
|
8142
|
-
const [scrollbars, setScrollbars] = (0,
|
|
8546
|
+
const [scrollbars, setScrollbars] = (0, import_react30.useState)({
|
|
8143
8547
|
vertical: false,
|
|
8144
8548
|
horizontal: false
|
|
8145
8549
|
});
|
|
8146
|
-
const scrollbarsRef = (0,
|
|
8147
|
-
(0,
|
|
8550
|
+
const scrollbarsRef = (0, import_react30.useRef)(scrollbars);
|
|
8551
|
+
(0, import_react30.useEffect)(() => {
|
|
8148
8552
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
8149
8553
|
if (!scrollbars2) {
|
|
8150
8554
|
return;
|
|
@@ -8154,7 +8558,7 @@ function useLoadData() {
|
|
|
8154
8558
|
});
|
|
8155
8559
|
return () => notifyScrollbarsChange.destroy();
|
|
8156
8560
|
}, [notifyScrollbarsChange]);
|
|
8157
|
-
(0,
|
|
8561
|
+
(0, import_react30.useEffect)(() => {
|
|
8158
8562
|
if (!livePagination) {
|
|
8159
8563
|
return;
|
|
8160
8564
|
}
|
|
@@ -8168,7 +8572,7 @@ function useLoadData() {
|
|
|
8168
8572
|
});
|
|
8169
8573
|
return () => cancelAnimationFrame(frameId);
|
|
8170
8574
|
}, [livePaginationCursor]);
|
|
8171
|
-
(0,
|
|
8575
|
+
(0, import_react30.useEffect)(() => {
|
|
8172
8576
|
if (!livePagination || livePaginationCursor !== void 0) {
|
|
8173
8577
|
return;
|
|
8174
8578
|
}
|
|
@@ -8182,7 +8586,7 @@ function useLoadData() {
|
|
|
8182
8586
|
});
|
|
8183
8587
|
return () => cancelAnimationFrame(frameId);
|
|
8184
8588
|
}, [dataArray.length, livePaginationCursor]);
|
|
8185
|
-
(0,
|
|
8589
|
+
(0, import_react30.useEffect)(() => {
|
|
8186
8590
|
const state = getComponentState();
|
|
8187
8591
|
const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
|
|
8188
8592
|
if (!scrollbars.vertical && livePagination2) {
|
|
@@ -8200,7 +8604,7 @@ function useLoadData() {
|
|
|
8200
8604
|
filterValue,
|
|
8201
8605
|
cursorId: livePagination ? stateCursorId : null
|
|
8202
8606
|
};
|
|
8203
|
-
const initialRef = (0,
|
|
8607
|
+
const initialRef = (0, import_react30.useRef)(true);
|
|
8204
8608
|
useLazyLoadRange();
|
|
8205
8609
|
useEffectWithChanges(() => {
|
|
8206
8610
|
const componentState2 = getComponentState();
|
|
@@ -8232,7 +8636,7 @@ function useLazyLoadRange() {
|
|
|
8232
8636
|
componentActions: actions,
|
|
8233
8637
|
componentState
|
|
8234
8638
|
} = useComponentState();
|
|
8235
|
-
(0,
|
|
8639
|
+
(0, import_react30.useEffect)(() => {
|
|
8236
8640
|
actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
|
|
8237
8641
|
}, [componentState.data, componentState.dataParams]);
|
|
8238
8642
|
const {
|
|
@@ -8242,7 +8646,7 @@ function useLazyLoadRange() {
|
|
|
8242
8646
|
dataArray,
|
|
8243
8647
|
scrollStopDelayUpdatedByTable
|
|
8244
8648
|
} = componentState;
|
|
8245
|
-
const latestRenderRangeRef = (0,
|
|
8649
|
+
const latestRenderRangeRef = (0, import_react30.useRef)(null);
|
|
8246
8650
|
const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
|
|
8247
8651
|
const componentState2 = getComponentState();
|
|
8248
8652
|
renderRange = renderRange || latestRenderRangeRef.current;
|
|
@@ -8267,8 +8671,8 @@ function useLazyLoadRange() {
|
|
|
8267
8671
|
componentActions: actions
|
|
8268
8672
|
}, cache);
|
|
8269
8673
|
};
|
|
8270
|
-
const debouncedLoadRange = (0,
|
|
8271
|
-
(0,
|
|
8674
|
+
const debouncedLoadRange = (0, import_react30.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
8675
|
+
(0, import_react30.useEffect)(() => {
|
|
8272
8676
|
if (lazyLoad) {
|
|
8273
8677
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
8274
8678
|
latestRenderRangeRef.current = renderRange;
|
|
@@ -8277,7 +8681,7 @@ function useLazyLoadRange() {
|
|
|
8277
8681
|
}
|
|
8278
8682
|
return;
|
|
8279
8683
|
}, [lazyLoadBatchSize, lazyLoad]);
|
|
8280
|
-
(0,
|
|
8684
|
+
(0, import_react30.useEffect)(() => {
|
|
8281
8685
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
8282
8686
|
debouncedLoadRange();
|
|
8283
8687
|
}
|
|
@@ -9727,7 +10131,7 @@ function DataSourceWithContext(props) {
|
|
|
9727
10131
|
if (typeof children === "function") {
|
|
9728
10132
|
children = children(computedValues);
|
|
9729
10133
|
}
|
|
9730
|
-
return /* @__PURE__ */
|
|
10134
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, children);
|
|
9731
10135
|
}
|
|
9732
10136
|
var DataSourceRoot = getComponentStateRoot({
|
|
9733
10137
|
initSetupState,
|
|
@@ -9752,14 +10156,14 @@ function DataSourceCmp({ children }) {
|
|
|
9752
10156
|
globalThis.dataSourceActions = componentActions;
|
|
9753
10157
|
}
|
|
9754
10158
|
useLoadData();
|
|
9755
|
-
return /* @__PURE__ */
|
|
10159
|
+
return /* @__PURE__ */ React36.createElement(DataSourceContext.Provider, {
|
|
9756
10160
|
value: contextValue
|
|
9757
|
-
}, /* @__PURE__ */
|
|
10161
|
+
}, /* @__PURE__ */ React36.createElement(DataSourceWithContext, {
|
|
9758
10162
|
children
|
|
9759
10163
|
}));
|
|
9760
10164
|
}
|
|
9761
10165
|
function DataSource(props) {
|
|
9762
|
-
return /* @__PURE__ */
|
|
10166
|
+
return /* @__PURE__ */ React36.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React36.createElement(DataSourceCmp, {
|
|
9763
10167
|
children: props.children
|
|
9764
10168
|
}));
|
|
9765
10169
|
}
|
|
@@ -9930,7 +10334,7 @@ function getImperativeApi(param) {
|
|
|
9930
10334
|
}
|
|
9931
10335
|
|
|
9932
10336
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
9933
|
-
var
|
|
10337
|
+
var import_react31 = __toModule(require("react"));
|
|
9934
10338
|
var OFFSET = 10;
|
|
9935
10339
|
function getColumnContentMaxWidths(domRef, options) {
|
|
9936
10340
|
var _a;
|
|
@@ -9996,11 +10400,11 @@ function useAutoSizeColumns() {
|
|
|
9996
10400
|
componentActions,
|
|
9997
10401
|
componentState: { domRef, ready, autoSizeColumnsKey, brain }
|
|
9998
10402
|
} = useComponentState();
|
|
9999
|
-
const [refreshId, setRefreshId] = (0,
|
|
10403
|
+
const [refreshId, setRefreshId] = (0, import_react31.useState)(0);
|
|
10000
10404
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
10001
10405
|
const getTheKey = useLatest(theKey);
|
|
10002
|
-
const lastExecutedIdentifierRef = (0,
|
|
10003
|
-
(0,
|
|
10406
|
+
const lastExecutedIdentifierRef = (0, import_react31.useRef)(null);
|
|
10407
|
+
(0, import_react31.useEffect)(() => {
|
|
10004
10408
|
const key = getTheKey();
|
|
10005
10409
|
if (key == null) {
|
|
10006
10410
|
return;
|
|
@@ -10013,7 +10417,7 @@ function useAutoSizeColumns() {
|
|
|
10013
10417
|
};
|
|
10014
10418
|
return brain.onRenderRangeChange(onChange);
|
|
10015
10419
|
}, [brain]);
|
|
10016
|
-
(0,
|
|
10420
|
+
(0, import_react31.useEffect)(() => {
|
|
10017
10421
|
var _a;
|
|
10018
10422
|
if (theKey == null) {
|
|
10019
10423
|
return;
|
|
@@ -10058,8 +10462,8 @@ function useAutoSizeColumns() {
|
|
|
10058
10462
|
}
|
|
10059
10463
|
|
|
10060
10464
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
10061
|
-
var
|
|
10062
|
-
var
|
|
10465
|
+
var import_react32 = __toModule(require("react"));
|
|
10466
|
+
var React37 = __toModule(require("react"));
|
|
10063
10467
|
|
|
10064
10468
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
10065
10469
|
function useYourBrain(param) {
|
|
@@ -10095,7 +10499,7 @@ function useCellRendering(param) {
|
|
|
10095
10499
|
computedPinnedStartColumns,
|
|
10096
10500
|
computedPinnedEndColumns,
|
|
10097
10501
|
computedVisibleColumns,
|
|
10098
|
-
|
|
10502
|
+
computedColumnsMap,
|
|
10099
10503
|
rowspan,
|
|
10100
10504
|
toggleGroupRow,
|
|
10101
10505
|
columnSize
|
|
@@ -10130,13 +10534,13 @@ function useCellRendering(param) {
|
|
|
10130
10534
|
bodySize,
|
|
10131
10535
|
rowspan
|
|
10132
10536
|
});
|
|
10133
|
-
const scrollTopMaxRef = (0,
|
|
10134
|
-
(0,
|
|
10537
|
+
const scrollTopMaxRef = (0, import_react32.useRef)(0);
|
|
10538
|
+
(0, import_react32.useEffect)(() => {
|
|
10135
10539
|
return brain.onRenderCountChange(() => {
|
|
10136
10540
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
10137
10541
|
});
|
|
10138
10542
|
}, [brain]);
|
|
10139
|
-
(0,
|
|
10543
|
+
(0, import_react32.useEffect)(() => {
|
|
10140
10544
|
return brain.onScrollStop((scrollPosition) => {
|
|
10141
10545
|
const { scrollTop: scrollTop2 } = scrollPosition;
|
|
10142
10546
|
if (scrollTop2 === 0) {
|
|
@@ -10153,7 +10557,7 @@ function useCellRendering(param) {
|
|
|
10153
10557
|
}
|
|
10154
10558
|
});
|
|
10155
10559
|
}, [brain, onScrollToTop, onScrollToBottom]);
|
|
10156
|
-
(0,
|
|
10560
|
+
(0, import_react32.useEffect)(() => {
|
|
10157
10561
|
if (!bodySize.height) {
|
|
10158
10562
|
return;
|
|
10159
10563
|
}
|
|
@@ -10164,10 +10568,10 @@ function useCellRendering(param) {
|
|
|
10164
10568
|
}
|
|
10165
10569
|
}, [!!bodySize.height]);
|
|
10166
10570
|
const [, rerender] = useRerender();
|
|
10167
|
-
(0,
|
|
10571
|
+
(0, import_react32.useEffect)(() => {
|
|
10168
10572
|
rerender();
|
|
10169
10573
|
}, [dataSourceState]);
|
|
10170
|
-
const renderCell = (0,
|
|
10574
|
+
const renderCell = (0, import_react32.useCallback)((params) => {
|
|
10171
10575
|
const {
|
|
10172
10576
|
rowIndex,
|
|
10173
10577
|
colIndex,
|
|
@@ -10199,16 +10603,16 @@ function useCellRendering(param) {
|
|
|
10199
10603
|
domRef,
|
|
10200
10604
|
width,
|
|
10201
10605
|
column,
|
|
10202
|
-
columnsMap:
|
|
10606
|
+
columnsMap: computedColumnsMap,
|
|
10203
10607
|
rowStyle,
|
|
10204
10608
|
rowClassName
|
|
10205
10609
|
};
|
|
10206
|
-
return /* @__PURE__ */
|
|
10610
|
+
return /* @__PURE__ */ React37.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
|
|
10207
10611
|
}, [
|
|
10208
10612
|
rowHeight,
|
|
10209
10613
|
getData,
|
|
10210
10614
|
computedVisibleColumns,
|
|
10211
|
-
|
|
10615
|
+
computedColumnsMap,
|
|
10212
10616
|
groupRenderStrategy,
|
|
10213
10617
|
toggleGroupRow,
|
|
10214
10618
|
showZebraRows,
|
|
@@ -10295,10 +10699,10 @@ var MultiRowSelector = class {
|
|
|
10295
10699
|
};
|
|
10296
10700
|
|
|
10297
10701
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
10298
|
-
var
|
|
10702
|
+
var import_react34 = __toModule(require("react"));
|
|
10299
10703
|
|
|
10300
10704
|
// src/components/hooks/useInterceptedMap.ts
|
|
10301
|
-
var
|
|
10705
|
+
var import_react33 = __toModule(require("react"));
|
|
10302
10706
|
function interceptMap(map2, fns) {
|
|
10303
10707
|
const { set, delete: deleteKey, clear } = map2;
|
|
10304
10708
|
if (fns.set) {
|
|
@@ -10314,387 +10718,155 @@ function interceptMap(map2, fns) {
|
|
|
10314
10718
|
fns.delete(key);
|
|
10315
10719
|
return removed;
|
|
10316
10720
|
};
|
|
10317
|
-
}
|
|
10318
|
-
if (fns.clear || fns.beforeClear) {
|
|
10319
|
-
map2.clear = () => {
|
|
10320
|
-
if (fns.beforeClear) {
|
|
10321
|
-
fns.beforeClear(map2);
|
|
10322
|
-
}
|
|
10323
|
-
const result = clear.call(map2);
|
|
10324
|
-
if (fns.clear) {
|
|
10325
|
-
fns.clear();
|
|
10326
|
-
}
|
|
10327
|
-
return result;
|
|
10328
|
-
};
|
|
10329
|
-
}
|
|
10330
|
-
return () => {
|
|
10331
|
-
if (set) {
|
|
10332
|
-
map2.set = set;
|
|
10333
|
-
}
|
|
10334
|
-
if (deleteKey) {
|
|
10335
|
-
map2.delete = deleteKey;
|
|
10336
|
-
}
|
|
10337
|
-
if (clear) {
|
|
10338
|
-
map2.clear = clear;
|
|
10339
|
-
}
|
|
10340
|
-
};
|
|
10341
|
-
}
|
|
10342
|
-
|
|
10343
|
-
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
10344
|
-
function computeColumnGroupsDepths(columnGroups) {
|
|
10345
|
-
const map2 = new Map();
|
|
10346
|
-
columnGroups.forEach((colGroup, colGroupId) => {
|
|
10347
|
-
let parentGroupId = colGroup.columnGroup;
|
|
10348
|
-
let depth = 0;
|
|
10349
|
-
while (parentGroupId) {
|
|
10350
|
-
const parent = columnGroups.get(parentGroupId);
|
|
10351
|
-
if (!parent) {
|
|
10352
|
-
if (false) {
|
|
10353
|
-
console.warn(`Cannot find column group ${parentGroupId}`);
|
|
10354
|
-
}
|
|
10355
|
-
break;
|
|
10356
|
-
}
|
|
10357
|
-
depth++;
|
|
10358
|
-
parentGroupId = parent.columnGroup;
|
|
10359
|
-
}
|
|
10360
|
-
map2.set(colGroupId, depth);
|
|
10361
|
-
});
|
|
10362
|
-
return map2;
|
|
10363
|
-
}
|
|
10364
|
-
|
|
10365
|
-
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
10366
|
-
function useColumnGroups() {
|
|
10367
|
-
const {
|
|
10368
|
-
componentState: {
|
|
10369
|
-
computedColumnGroups,
|
|
10370
|
-
collapsedColumnGroups
|
|
10371
|
-
},
|
|
10372
|
-
componentActions,
|
|
10373
|
-
getComponentState
|
|
10374
|
-
} = useComponentState();
|
|
10375
|
-
(0, import_react33.useEffect)(() => {
|
|
10376
|
-
const recompute = () => {
|
|
10377
|
-
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
10378
|
-
};
|
|
10379
|
-
const update = rafFn(recompute);
|
|
10380
|
-
return interceptMap(computedColumnGroups, {
|
|
10381
|
-
clear: update,
|
|
10382
|
-
delete: update,
|
|
10383
|
-
set: update
|
|
10384
|
-
});
|
|
10385
|
-
}, [computedColumnGroups]);
|
|
10386
|
-
(0, import_react33.useEffect)(() => {
|
|
10387
|
-
return interceptMap(collapsedColumnGroups, {
|
|
10388
|
-
set: (key, visibleCol) => {
|
|
10389
|
-
const colIds = key.slice(1);
|
|
10390
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10391
|
-
colIds.forEach((colId) => {
|
|
10392
|
-
columnVisibility[colId] = false;
|
|
10393
|
-
});
|
|
10394
|
-
delete columnVisibility[visibleCol];
|
|
10395
|
-
componentActions.columnVisibility = columnVisibility;
|
|
10396
|
-
},
|
|
10397
|
-
beforeClear: (currentCollapsedGroups) => {
|
|
10398
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10399
|
-
const keys = [...currentCollapsedGroups.keys()];
|
|
10400
|
-
keys.forEach((key) => {
|
|
10401
|
-
const colIds = key.slice(1);
|
|
10402
|
-
colIds.forEach((colId) => {
|
|
10403
|
-
delete columnVisibility[colId];
|
|
10404
|
-
});
|
|
10405
|
-
});
|
|
10406
|
-
componentActions.columnVisibility = columnVisibility;
|
|
10407
|
-
},
|
|
10408
|
-
delete: (key) => {
|
|
10409
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10410
|
-
const colIds = key.slice(1);
|
|
10411
|
-
colIds.forEach((colId) => {
|
|
10412
|
-
delete columnVisibility[colId];
|
|
10413
|
-
});
|
|
10414
|
-
componentActions.columnVisibility = columnVisibility;
|
|
10415
|
-
}
|
|
10416
|
-
});
|
|
10417
|
-
}, [collapsedColumnGroups]);
|
|
10418
|
-
}
|
|
10419
|
-
|
|
10420
|
-
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
10421
|
-
var import_react34 = __toModule(require("react"));
|
|
10422
|
-
function useColumnRowspan(computedVisibleColumns) {
|
|
10423
|
-
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
10424
|
-
const rowspan = (0, import_react34.useMemo)(() => {
|
|
10425
|
-
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
10426
|
-
return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
|
|
10427
|
-
const dataArray = getDataSourceState().dataArray;
|
|
10428
|
-
const rowInfo = dataArray[rowIndex];
|
|
10429
|
-
if (!rowInfo) {
|
|
10430
|
-
return 1;
|
|
10431
|
-
}
|
|
10432
|
-
const data = rowInfo.data;
|
|
10433
|
-
const column = computedVisibleColumns[colIndex];
|
|
10434
|
-
if (!column || !column.rowspan) {
|
|
10435
|
-
return 1;
|
|
10436
|
-
}
|
|
10437
|
-
return column.rowspan({
|
|
10438
|
-
column,
|
|
10439
|
-
data,
|
|
10440
|
-
dataArray,
|
|
10441
|
-
rowInfo,
|
|
10442
|
-
rowIndex
|
|
10443
|
-
});
|
|
10444
|
-
} : void 0;
|
|
10445
|
-
}, [computedVisibleColumns]);
|
|
10446
|
-
return rowspan;
|
|
10447
|
-
}
|
|
10448
|
-
|
|
10449
|
-
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
10450
|
-
var import_react35 = __toModule(require("react"));
|
|
10451
|
-
var debug4 = dbg("useColumnSizeFn");
|
|
10452
|
-
function useColumnSizeFn(columns) {
|
|
10453
|
-
const columnSize = (0, import_react35.useCallback)((index) => {
|
|
10454
|
-
const column = columns[index];
|
|
10455
|
-
if (false) {
|
|
10456
|
-
debug4("cannot find column at index", index, columns);
|
|
10457
|
-
}
|
|
10458
|
-
return column ? column.computedWidth : 0;
|
|
10459
|
-
}, [columns]);
|
|
10460
|
-
return columnSize;
|
|
10461
|
-
}
|
|
10462
|
-
|
|
10463
|
-
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
10464
|
-
var import_react39 = __toModule(require("react"));
|
|
10465
|
-
|
|
10466
|
-
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
10467
|
-
var React37 = __toModule(require("react"));
|
|
10468
|
-
|
|
10469
|
-
// src/components/DataSource/state/rowInfoStatus.ts
|
|
10470
|
-
var showLoadingIcon = (rowInfo) => {
|
|
10471
|
-
if (rowInfo.dataSourceHasGrouping) {
|
|
10472
|
-
return rowInfo.isGroupRow ? rowInfo.childrenLoading || !rowInfo.selfLoaded : !rowInfo.selfLoaded;
|
|
10473
|
-
}
|
|
10474
|
-
return !rowInfo.selfLoaded;
|
|
10475
|
-
};
|
|
10476
|
-
|
|
10477
|
-
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
10478
|
-
var React35 = __toModule(require("react"));
|
|
10479
|
-
var import_react36 = __toModule(require("react"));
|
|
10480
|
-
|
|
10481
|
-
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
10482
|
-
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
10483
|
-
var ExpanderIconCls = "_16lm1iw6 _16lm1iwi _16lm1iwe";
|
|
10484
|
-
var ExpanderIconClsVariants = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwc", false: "_198z9782" }, direction: { end: "_198z9783", start: "_198z9784" } }, defaultVariants: {}, compoundVariants: [[{ expanded: false, direction: "end" }, "_16lm1iwd"]] });
|
|
10485
|
-
|
|
10486
|
-
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
10487
|
-
function ExpanderIcon(props) {
|
|
10488
|
-
var _a;
|
|
10489
|
-
const { size = 24, direction = "start" } = props;
|
|
10490
|
-
const [expanded, setExpanded] = (0, import_react36.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
10491
|
-
const onClick = () => {
|
|
10492
|
-
var _a2;
|
|
10493
|
-
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
10494
|
-
if (!isControlled("expanded", props)) {
|
|
10495
|
-
setExpanded(!expanded);
|
|
10496
|
-
}
|
|
10497
|
-
};
|
|
10498
|
-
React35.useEffect(() => {
|
|
10499
|
-
if (isControlled("expanded", props)) {
|
|
10500
|
-
setExpanded(props.expanded);
|
|
10501
|
-
}
|
|
10502
|
-
}, [props.expanded]);
|
|
10503
|
-
return /* @__PURE__ */ React35.createElement("svg", {
|
|
10504
|
-
"data-name": "expander-icon",
|
|
10505
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10506
|
-
height: `${size}px`,
|
|
10507
|
-
viewBox: "0 0 24 24",
|
|
10508
|
-
width: `${size}px`,
|
|
10509
|
-
style: props.style,
|
|
10510
|
-
onClick,
|
|
10511
|
-
className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
|
|
10512
|
-
direction: direction || "start",
|
|
10513
|
-
expanded
|
|
10514
|
-
}), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`, `InfiniteIcon-expander--${direction === "end" ? "end" : "start"}`)
|
|
10515
|
-
}, /* @__PURE__ */ React35.createElement("path", {
|
|
10516
|
-
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
10517
|
-
}));
|
|
10518
|
-
}
|
|
10519
|
-
|
|
10520
|
-
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
10521
|
-
var React36 = __toModule(require("react"));
|
|
10522
|
-
|
|
10523
|
-
// src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
|
|
10524
|
-
var LoadingIconCls = "_16lm1iw8 _16lm1iwi _16lm1iwe";
|
|
10525
|
-
|
|
10526
|
-
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
10527
|
-
var LoadingIcon = (props) => {
|
|
10528
|
-
return /* @__PURE__ */ React36.createElement("svg", {
|
|
10529
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10530
|
-
style: {
|
|
10531
|
-
margin: "auto",
|
|
10532
|
-
display: "block",
|
|
10533
|
-
shapeRendering: "auto"
|
|
10534
|
-
},
|
|
10535
|
-
width: "24px",
|
|
10536
|
-
height: "24px",
|
|
10537
|
-
viewBox: "0 0 100 100",
|
|
10538
|
-
preserveAspectRatio: "xMidYMid",
|
|
10539
|
-
className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
|
|
10540
|
-
}, /* @__PURE__ */ React36.createElement("circle", {
|
|
10541
|
-
cx: "50",
|
|
10542
|
-
cy: "50",
|
|
10543
|
-
fill: "none",
|
|
10544
|
-
strokeWidth: "10",
|
|
10545
|
-
r: "35",
|
|
10546
|
-
strokeDasharray: "164.93361431346415 56.97787143782138"
|
|
10547
|
-
}, /* @__PURE__ */ React36.createElement("animateTransform", {
|
|
10548
|
-
attributeName: "transform",
|
|
10549
|
-
type: "rotate",
|
|
10550
|
-
repeatCount: "indefinite",
|
|
10551
|
-
dur: "1s",
|
|
10552
|
-
values: "0 50 50;360 50 50",
|
|
10553
|
-
keyTimes: "0;1"
|
|
10554
|
-
})));
|
|
10555
|
-
};
|
|
10556
|
-
|
|
10557
|
-
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
10558
|
-
function styleForGroupColumn({
|
|
10559
|
-
rowInfo
|
|
10560
|
-
}) {
|
|
10561
|
-
return {
|
|
10562
|
-
[stripVar(ThemeVars.components.Row.groupNesting)]: rowInfo.dataSourceHasGrouping ? rowInfo.isGroupRow ? rowInfo.groupNesting - 1 : rowInfo.groupNesting : 0
|
|
10563
|
-
};
|
|
10564
|
-
}
|
|
10565
|
-
function getGroupColumnRender({
|
|
10566
|
-
groupIndexForColumn,
|
|
10567
|
-
groupRenderStrategy
|
|
10568
|
-
}) {
|
|
10569
|
-
return (renderOptions) => {
|
|
10570
|
-
const { rowInfo, renderBag, column } = renderOptions;
|
|
10571
|
-
let { value: valueToRender, groupIcon, selectionCheckBox } = renderBag;
|
|
10572
|
-
const groupRowInfo = rowInfo;
|
|
10573
|
-
if (groupRenderStrategy === "multi-column") {
|
|
10574
|
-
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting && groupRowInfo.isGroupRow) {
|
|
10575
|
-
return null;
|
|
10576
|
-
}
|
|
10577
|
-
} else if (groupRenderStrategy === "single-column" && !groupRowInfo.isGroupRow) {
|
|
10578
|
-
}
|
|
10579
|
-
return /* @__PURE__ */ React37.createElement("div", {
|
|
10580
|
-
className: join(display.flex, column.align === "end" ? flexFlow.rowReverse : flexFlow.row, alignItems.center, groupRenderStrategy === "single-column" || groupRenderStrategy === "multi-column" && !rowInfo.isGroupRow && selectionCheckBox ? GroupRowExpanderCls({ align: column.align || "start" }) : null)
|
|
10581
|
-
}, groupIcon, selectionCheckBox, /* @__PURE__ */ React37.createElement("div", {
|
|
10582
|
-
className: cssEllipsisClassName
|
|
10583
|
-
}, valueToRender != null ? valueToRender : null));
|
|
10584
|
-
};
|
|
10585
|
-
}
|
|
10586
|
-
function getGroupColumnRenderGroupIcon({
|
|
10587
|
-
groupIndexForColumn,
|
|
10588
|
-
groupRenderStrategy,
|
|
10589
|
-
toggleGroupRow,
|
|
10590
|
-
initialRenderGroupIcon
|
|
10591
|
-
}) {
|
|
10592
|
-
return (renderOptions) => {
|
|
10593
|
-
var _a, _b, _c;
|
|
10594
|
-
const { rowInfo, value, groupBy, pivotBy, column } = renderOptions;
|
|
10595
|
-
const groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : rowInfo.isGroupRow && ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
|
|
10596
|
-
if (!groupRowInfo) {
|
|
10597
|
-
return null;
|
|
10598
|
-
}
|
|
10599
|
-
const collapsed = groupRowInfo.collapsed;
|
|
10600
|
-
if (groupRenderStrategy === "inline") {
|
|
10601
|
-
if (groupRowInfo.groupCount === 1) {
|
|
10602
|
-
return value;
|
|
10603
|
-
}
|
|
10604
|
-
if (groupRowInfo.groupNesting === groupIndexForColumn && collapsed) {
|
|
10605
|
-
return null;
|
|
10606
|
-
}
|
|
10607
|
-
} else {
|
|
10608
|
-
if (!groupRowInfo.isGroupRow) {
|
|
10609
|
-
return null;
|
|
10721
|
+
}
|
|
10722
|
+
if (fns.clear || fns.beforeClear) {
|
|
10723
|
+
map2.clear = () => {
|
|
10724
|
+
if (fns.beforeClear) {
|
|
10725
|
+
fns.beforeClear(map2);
|
|
10610
10726
|
}
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
}
|
|
10727
|
+
const result = clear.call(map2);
|
|
10728
|
+
if (fns.clear) {
|
|
10729
|
+
fns.clear();
|
|
10615
10730
|
}
|
|
10731
|
+
return result;
|
|
10732
|
+
};
|
|
10733
|
+
}
|
|
10734
|
+
return () => {
|
|
10735
|
+
if (set) {
|
|
10736
|
+
map2.set = set;
|
|
10616
10737
|
}
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
const showExpanderIcon = pivotBy ? (((_b = groupRowInfo.groupKeys) == null ? void 0 : _b.length) || 0) < (groupBy == null ? void 0 : groupBy.length) : (((_c = groupRowInfo.groupKeys) == null ? void 0 : _c.length) || 0) <= (groupBy == null ? void 0 : groupBy.length);
|
|
10620
|
-
const isLoading = showLoadingIcon(groupRowInfo);
|
|
10621
|
-
if (isLoading) {
|
|
10622
|
-
icon = /* @__PURE__ */ React37.createElement(LoadingIcon, null);
|
|
10623
|
-
} else if (showExpanderIcon) {
|
|
10624
|
-
const defaultIcon = /* @__PURE__ */ React37.createElement(ExpanderIcon, {
|
|
10625
|
-
expanded: !collapsed,
|
|
10626
|
-
direction: column.align === "end" ? "end" : "start",
|
|
10627
|
-
onChange: () => {
|
|
10628
|
-
toggleGroupRow(groupKeys);
|
|
10629
|
-
}
|
|
10630
|
-
});
|
|
10631
|
-
icon = defaultIcon;
|
|
10738
|
+
if (deleteKey) {
|
|
10739
|
+
map2.delete = deleteKey;
|
|
10632
10740
|
}
|
|
10633
|
-
if (
|
|
10634
|
-
|
|
10635
|
-
icon = /* @__PURE__ */ React37.createElement(RenderHookComponent, {
|
|
10636
|
-
render: initialRenderGroupIcon,
|
|
10637
|
-
renderParam: renderOptions
|
|
10638
|
-
});
|
|
10741
|
+
if (clear) {
|
|
10742
|
+
map2.clear = clear;
|
|
10639
10743
|
}
|
|
10640
|
-
return icon;
|
|
10641
10744
|
};
|
|
10642
10745
|
}
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
initialRenderGroupIcon: userDefinedGroupColumn == null ? void 0 : userDefinedGroupColumn.renderGroupIcon,
|
|
10661
|
-
groupIndexForColumn,
|
|
10662
|
-
toggleGroupRow,
|
|
10663
|
-
groupRenderStrategy
|
|
10664
|
-
})
|
|
10665
|
-
});
|
|
10666
|
-
if (groupColumnFromProps) {
|
|
10667
|
-
if (typeof groupColumnFromProps === "function") {
|
|
10668
|
-
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps(options, toggleGroupRow));
|
|
10669
|
-
} else {
|
|
10670
|
-
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps);
|
|
10746
|
+
|
|
10747
|
+
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
10748
|
+
function computeColumnGroupsDepths(columnGroups) {
|
|
10749
|
+
const map2 = new Map();
|
|
10750
|
+
columnGroups.forEach((colGroup, colGroupId) => {
|
|
10751
|
+
let parentGroupId = colGroup.columnGroup;
|
|
10752
|
+
let depth = 0;
|
|
10753
|
+
while (parentGroupId) {
|
|
10754
|
+
const parent = columnGroups.get(parentGroupId);
|
|
10755
|
+
if (!parent) {
|
|
10756
|
+
if (false) {
|
|
10757
|
+
console.warn(`Cannot find column group ${parentGroupId}`);
|
|
10758
|
+
}
|
|
10759
|
+
break;
|
|
10760
|
+
}
|
|
10761
|
+
depth++;
|
|
10762
|
+
parentGroupId = parent.columnGroup;
|
|
10671
10763
|
}
|
|
10672
|
-
|
|
10673
|
-
return generatedGroupColumn;
|
|
10674
|
-
}
|
|
10675
|
-
function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
10676
|
-
const theGroupColumnFromProps = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : groupColumnFromProps;
|
|
10677
|
-
let generatedGroupColumn = __spreadProps(__spreadValues({
|
|
10678
|
-
header: `Group`,
|
|
10679
|
-
groupByField: options.groupBy.map((g) => g.field),
|
|
10680
|
-
sortable: false,
|
|
10681
|
-
renderSelectionCheckBox: options.selectionMode === "multi-row",
|
|
10682
|
-
style: styleForGroupColumn,
|
|
10683
|
-
render: getGroupColumnRender({
|
|
10684
|
-
groupIndexForColumn: 0,
|
|
10685
|
-
groupRenderStrategy: "single-column"
|
|
10686
|
-
})
|
|
10687
|
-
}, groupColumnFromProps), {
|
|
10688
|
-
renderGroupIcon: getGroupColumnRenderGroupIcon({
|
|
10689
|
-
initialRenderGroupIcon: theGroupColumnFromProps == null ? void 0 : theGroupColumnFromProps.renderGroupIcon,
|
|
10690
|
-
groupIndexForColumn: 0,
|
|
10691
|
-
toggleGroupRow,
|
|
10692
|
-
groupRenderStrategy: "single-column"
|
|
10693
|
-
})
|
|
10764
|
+
map2.set(colGroupId, depth);
|
|
10694
10765
|
});
|
|
10695
|
-
return
|
|
10766
|
+
return map2;
|
|
10767
|
+
}
|
|
10768
|
+
|
|
10769
|
+
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
10770
|
+
function useColumnGroups() {
|
|
10771
|
+
const {
|
|
10772
|
+
componentState: {
|
|
10773
|
+
computedColumnGroups,
|
|
10774
|
+
collapsedColumnGroups
|
|
10775
|
+
},
|
|
10776
|
+
componentActions,
|
|
10777
|
+
getComponentState
|
|
10778
|
+
} = useComponentState();
|
|
10779
|
+
(0, import_react34.useEffect)(() => {
|
|
10780
|
+
const recompute = () => {
|
|
10781
|
+
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
10782
|
+
};
|
|
10783
|
+
const update = rafFn(recompute);
|
|
10784
|
+
return interceptMap(computedColumnGroups, {
|
|
10785
|
+
clear: update,
|
|
10786
|
+
delete: update,
|
|
10787
|
+
set: update
|
|
10788
|
+
});
|
|
10789
|
+
}, [computedColumnGroups]);
|
|
10790
|
+
(0, import_react34.useEffect)(() => {
|
|
10791
|
+
return interceptMap(collapsedColumnGroups, {
|
|
10792
|
+
set: (key, visibleCol) => {
|
|
10793
|
+
const colIds = key.slice(1);
|
|
10794
|
+
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10795
|
+
colIds.forEach((colId) => {
|
|
10796
|
+
columnVisibility[colId] = false;
|
|
10797
|
+
});
|
|
10798
|
+
delete columnVisibility[visibleCol];
|
|
10799
|
+
componentActions.columnVisibility = columnVisibility;
|
|
10800
|
+
},
|
|
10801
|
+
beforeClear: (currentCollapsedGroups) => {
|
|
10802
|
+
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10803
|
+
const keys = [...currentCollapsedGroups.keys()];
|
|
10804
|
+
keys.forEach((key) => {
|
|
10805
|
+
const colIds = key.slice(1);
|
|
10806
|
+
colIds.forEach((colId) => {
|
|
10807
|
+
delete columnVisibility[colId];
|
|
10808
|
+
});
|
|
10809
|
+
});
|
|
10810
|
+
componentActions.columnVisibility = columnVisibility;
|
|
10811
|
+
},
|
|
10812
|
+
delete: (key) => {
|
|
10813
|
+
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10814
|
+
const colIds = key.slice(1);
|
|
10815
|
+
colIds.forEach((colId) => {
|
|
10816
|
+
delete columnVisibility[colId];
|
|
10817
|
+
});
|
|
10818
|
+
componentActions.columnVisibility = columnVisibility;
|
|
10819
|
+
}
|
|
10820
|
+
});
|
|
10821
|
+
}, [collapsedColumnGroups]);
|
|
10822
|
+
}
|
|
10823
|
+
|
|
10824
|
+
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
10825
|
+
var import_react35 = __toModule(require("react"));
|
|
10826
|
+
function useColumnRowspan(computedVisibleColumns) {
|
|
10827
|
+
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
10828
|
+
const rowspan = (0, import_react35.useMemo)(() => {
|
|
10829
|
+
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
10830
|
+
return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
|
|
10831
|
+
const dataArray = getDataSourceState().dataArray;
|
|
10832
|
+
const rowInfo = dataArray[rowIndex];
|
|
10833
|
+
if (!rowInfo) {
|
|
10834
|
+
return 1;
|
|
10835
|
+
}
|
|
10836
|
+
const data = rowInfo.data;
|
|
10837
|
+
const column = computedVisibleColumns[colIndex];
|
|
10838
|
+
if (!column || !column.rowspan) {
|
|
10839
|
+
return 1;
|
|
10840
|
+
}
|
|
10841
|
+
return column.rowspan({
|
|
10842
|
+
column,
|
|
10843
|
+
data,
|
|
10844
|
+
dataArray,
|
|
10845
|
+
rowInfo,
|
|
10846
|
+
rowIndex
|
|
10847
|
+
});
|
|
10848
|
+
} : void 0;
|
|
10849
|
+
}, [computedVisibleColumns]);
|
|
10850
|
+
return rowspan;
|
|
10851
|
+
}
|
|
10852
|
+
|
|
10853
|
+
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
10854
|
+
var import_react36 = __toModule(require("react"));
|
|
10855
|
+
var debug4 = dbg("useColumnSizeFn");
|
|
10856
|
+
function useColumnSizeFn(columns) {
|
|
10857
|
+
const columnSize = (0, import_react36.useCallback)((index) => {
|
|
10858
|
+
const column = columns[index];
|
|
10859
|
+
if (false) {
|
|
10860
|
+
debug4("cannot find column at index", index, columns);
|
|
10861
|
+
}
|
|
10862
|
+
return column ? column.computedWidth : 0;
|
|
10863
|
+
}, [columns]);
|
|
10864
|
+
return columnSize;
|
|
10696
10865
|
}
|
|
10697
10866
|
|
|
10867
|
+
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
10868
|
+
var import_react39 = __toModule(require("react"));
|
|
10869
|
+
|
|
10698
10870
|
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
10699
10871
|
var import_react37 = __toModule(require("react"));
|
|
10700
10872
|
function useEffectWithRaf(fn, deps) {
|
|
@@ -10882,17 +11054,19 @@ function useColumnsWhenGrouping() {
|
|
|
10882
11054
|
componentState: {
|
|
10883
11055
|
columns,
|
|
10884
11056
|
groupColumn,
|
|
11057
|
+
hideColumnWhenGrouped,
|
|
10885
11058
|
groupRenderStrategy,
|
|
10886
11059
|
pivotColumns,
|
|
10887
11060
|
pivotColumn,
|
|
10888
11061
|
pivotTotalColumnPosition,
|
|
10889
11062
|
pivotGrandTotalColumnPosition
|
|
10890
|
-
}
|
|
11063
|
+
},
|
|
11064
|
+
getComponentState
|
|
10891
11065
|
} = useComponentState();
|
|
10892
11066
|
const toggleGroupRow = useToggleGroupRow();
|
|
10893
11067
|
(0, import_react39.useEffect)(() => {
|
|
10894
11068
|
const update = () => {
|
|
10895
|
-
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
11069
|
+
const { columns: columnsWhenGrouping, groupColumnIds } = getColumnsWhenGrouping({
|
|
10896
11070
|
columns,
|
|
10897
11071
|
groupColumn,
|
|
10898
11072
|
pivotColumn,
|
|
@@ -10906,6 +11080,23 @@ function useColumnsWhenGrouping() {
|
|
|
10906
11080
|
selectionMode
|
|
10907
11081
|
});
|
|
10908
11082
|
componentActions.columnsWhenGrouping = columnsWhenGrouping;
|
|
11083
|
+
let currentColumnOrder = getComponentState().columnOrder;
|
|
11084
|
+
if (groupColumnIds.length && Array.isArray(currentColumnOrder)) {
|
|
11085
|
+
const colOrder = new Set(currentColumnOrder);
|
|
11086
|
+
let shouldUpdate = false;
|
|
11087
|
+
groupColumnIds.forEach((groupColId) => {
|
|
11088
|
+
if (!colOrder.has(groupColId)) {
|
|
11089
|
+
shouldUpdate = true;
|
|
11090
|
+
currentColumnOrder = [
|
|
11091
|
+
groupColId,
|
|
11092
|
+
...currentColumnOrder
|
|
11093
|
+
];
|
|
11094
|
+
}
|
|
11095
|
+
});
|
|
11096
|
+
if (shouldUpdate) {
|
|
11097
|
+
componentActions.columnOrder = currentColumnOrder;
|
|
11098
|
+
}
|
|
11099
|
+
}
|
|
10909
11100
|
};
|
|
10910
11101
|
update();
|
|
10911
11102
|
return interceptMap(columns, {
|
|
@@ -10918,6 +11109,7 @@ function useColumnsWhenGrouping() {
|
|
|
10918
11109
|
groupBy,
|
|
10919
11110
|
pivotBy,
|
|
10920
11111
|
selectionMode,
|
|
11112
|
+
hideColumnWhenGrouped,
|
|
10921
11113
|
groupColumn,
|
|
10922
11114
|
groupRenderStrategy,
|
|
10923
11115
|
pivotColumns,
|
|
@@ -10942,6 +11134,7 @@ function useHideColumns(groupByMap) {
|
|
|
10942
11134
|
componentState: {
|
|
10943
11135
|
columnTypes,
|
|
10944
11136
|
computedColumns,
|
|
11137
|
+
hideColumnWhenGrouped,
|
|
10945
11138
|
hideEmptyGroupColumns,
|
|
10946
11139
|
groupRenderStrategy
|
|
10947
11140
|
}
|
|
@@ -11031,16 +11224,13 @@ function useHideColumns(groupByMap) {
|
|
|
11031
11224
|
(0, import_react39.useEffect)(() => {
|
|
11032
11225
|
const isGrouped = groupBy.length > 0;
|
|
11033
11226
|
const currentState = getComponentState();
|
|
11034
|
-
const {
|
|
11035
|
-
if (controlledColumnVisibility) {
|
|
11036
|
-
return;
|
|
11037
|
-
}
|
|
11227
|
+
const { columnVisibility, hideColumnWhenGrouped: hideColumnWhenGrouped2 } = currentState;
|
|
11038
11228
|
const newColumnVisibility = __spreadValues({}, columnVisibility);
|
|
11039
11229
|
let updated = false;
|
|
11040
11230
|
computedColumns.forEach((col, id) => {
|
|
11041
|
-
if (col.defaultHiddenWhenGroupedBy) {
|
|
11231
|
+
if (col.defaultHiddenWhenGroupedBy || hideColumnWhenGrouped2) {
|
|
11042
11232
|
const nowHidden = columnVisibility[id] === false;
|
|
11043
|
-
const shouldBeHidden = col.defaultHiddenWhenGroupedBy === "*" && isGrouped || typeof col.defaultHiddenWhenGroupedBy === "string" && groupByMap.get(col.defaultHiddenWhenGroupedBy) || typeof col.defaultHiddenWhenGroupedBy === "object" && Object.keys(col.defaultHiddenWhenGroupedBy).reduce((acc, field) => acc || groupByMap.has(field), false);
|
|
11233
|
+
const shouldBeHidden = col.defaultHiddenWhenGroupedBy === "*" && isGrouped || (col.defaultHiddenWhenGroupedBy === true || hideColumnWhenGrouped2) && col.field && groupByMap.get(col.field) || typeof col.defaultHiddenWhenGroupedBy === "string" && groupByMap.get(col.defaultHiddenWhenGroupedBy) || typeof col.defaultHiddenWhenGroupedBy === "object" && Object.keys(col.defaultHiddenWhenGroupedBy).reduce((acc, field) => acc || groupByMap.has(field), false);
|
|
11044
11234
|
if (nowHidden !== shouldBeHidden) {
|
|
11045
11235
|
updated = true;
|
|
11046
11236
|
if (shouldBeHidden) {
|
|
@@ -11054,7 +11244,13 @@ function useHideColumns(groupByMap) {
|
|
|
11054
11244
|
if (updated) {
|
|
11055
11245
|
componentActions.columnVisibility = newColumnVisibility;
|
|
11056
11246
|
}
|
|
11057
|
-
}, [
|
|
11247
|
+
}, [
|
|
11248
|
+
computedColumns,
|
|
11249
|
+
columnTypes,
|
|
11250
|
+
groupBy,
|
|
11251
|
+
groupByMap,
|
|
11252
|
+
hideColumnWhenGrouped
|
|
11253
|
+
]);
|
|
11058
11254
|
}
|
|
11059
11255
|
function getColumnsWhenGrouping(params) {
|
|
11060
11256
|
const {
|
|
@@ -11071,9 +11267,10 @@ function getColumnsWhenGrouping(params) {
|
|
|
11071
11267
|
columns
|
|
11072
11268
|
} = params;
|
|
11073
11269
|
if (groupRenderStrategy === "inline") {
|
|
11074
|
-
return void 0;
|
|
11270
|
+
return { columns: void 0, groupColumnIds: [] };
|
|
11075
11271
|
}
|
|
11076
11272
|
const computedColumns = new Map();
|
|
11273
|
+
const groupColumnIds = [];
|
|
11077
11274
|
if (groupRenderStrategy === "multi-column") {
|
|
11078
11275
|
groupBy.forEach((groupByForColumn, groupIndexForColumn, arr) => {
|
|
11079
11276
|
const generatedGroupColumn = getColumnForGroupBy({
|
|
@@ -11085,7 +11282,9 @@ function getColumnsWhenGrouping(params) {
|
|
|
11085
11282
|
groupRenderStrategy,
|
|
11086
11283
|
selectionMode
|
|
11087
11284
|
}, toggleGroupRow, groupColumn);
|
|
11088
|
-
|
|
11285
|
+
const groupColumnId = generatedGroupColumn.id || `group-by-${groupByForColumn.field}`;
|
|
11286
|
+
groupColumnIds.push(groupColumnId);
|
|
11287
|
+
computedColumns.set(groupColumnId, generatedGroupColumn);
|
|
11089
11288
|
});
|
|
11090
11289
|
} else if (groupRenderStrategy === "single-column" && groupBy.length) {
|
|
11091
11290
|
const singleGroupColumn = getSingleGroupColumn({
|
|
@@ -11095,7 +11294,9 @@ function getColumnsWhenGrouping(params) {
|
|
|
11095
11294
|
groupRenderStrategy,
|
|
11096
11295
|
selectionMode
|
|
11097
11296
|
}, toggleGroupRow, groupColumn);
|
|
11098
|
-
|
|
11297
|
+
const groupColumnId = singleGroupColumn.id || "group-by";
|
|
11298
|
+
groupColumnIds.push(groupColumnId);
|
|
11299
|
+
computedColumns.set(groupColumnId, singleGroupColumn);
|
|
11099
11300
|
}
|
|
11100
11301
|
if (pivotColumns) {
|
|
11101
11302
|
const columnsByField = {};
|
|
@@ -11142,7 +11343,10 @@ function getColumnsWhenGrouping(params) {
|
|
|
11142
11343
|
computedColumns.set(colId, col);
|
|
11143
11344
|
});
|
|
11144
11345
|
}
|
|
11145
|
-
return
|
|
11346
|
+
return {
|
|
11347
|
+
columns: computedColumns.size ? computedColumns : void 0,
|
|
11348
|
+
groupColumnIds
|
|
11349
|
+
};
|
|
11146
11350
|
}
|
|
11147
11351
|
|
|
11148
11352
|
// src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
|
|
@@ -11202,6 +11406,33 @@ var getComputedPinned = (colId, columnPinning) => {
|
|
|
11202
11406
|
const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
|
|
11203
11407
|
return computedPinned;
|
|
11204
11408
|
};
|
|
11409
|
+
function isGroupColumnSortable(column, columns) {
|
|
11410
|
+
var _a;
|
|
11411
|
+
let sortableColumnOrType = (_a = column.sortable) != null ? _a : column.colType.sortable;
|
|
11412
|
+
if (sortableColumnOrType != null) {
|
|
11413
|
+
return sortableColumnOrType;
|
|
11414
|
+
}
|
|
11415
|
+
if (column.computedSortable === false) {
|
|
11416
|
+
return false;
|
|
11417
|
+
}
|
|
11418
|
+
let groupByField = column.groupByField || [];
|
|
11419
|
+
if (groupByField != null && !Array.isArray(groupByField)) {
|
|
11420
|
+
groupByField = [groupByField];
|
|
11421
|
+
}
|
|
11422
|
+
const fields = (groupByField || []).reduce((acc, field) => {
|
|
11423
|
+
acc[field] = true;
|
|
11424
|
+
return acc;
|
|
11425
|
+
}, {});
|
|
11426
|
+
const groupColumns = [];
|
|
11427
|
+
columns.forEach((col) => {
|
|
11428
|
+
if (col.field && fields[col.field]) {
|
|
11429
|
+
groupColumns.push(col);
|
|
11430
|
+
}
|
|
11431
|
+
});
|
|
11432
|
+
return groupColumns.reduce((sortable, col) => {
|
|
11433
|
+
return sortable && col.computedSortable === true;
|
|
11434
|
+
}, true);
|
|
11435
|
+
}
|
|
11205
11436
|
var getComputedVisibleColumns = ({
|
|
11206
11437
|
columns,
|
|
11207
11438
|
bodySize,
|
|
@@ -11248,12 +11479,16 @@ var getComputedVisibleColumns = ({
|
|
|
11248
11479
|
const result2 = isColumnVisible(columnVisibility, columnVisibilityAssumeVisible, colId);
|
|
11249
11480
|
return result2;
|
|
11250
11481
|
});
|
|
11251
|
-
const
|
|
11482
|
+
const columnIdsToVisibleIndex = new Map();
|
|
11483
|
+
const visibleColumnsArray = visibleColumnOrder.map((columnId, index) => {
|
|
11484
|
+
const col = columns.get(columnId);
|
|
11485
|
+
columnIdsToVisibleIndex.set(columnId, index);
|
|
11486
|
+
return col;
|
|
11487
|
+
});
|
|
11252
11488
|
const sortedMap = (sortInfo != null ? sortInfo : []).reduce((acc, info, index) => {
|
|
11253
11489
|
if (info.id) {
|
|
11254
11490
|
acc[info.id] = { sortInfo: info, index };
|
|
11255
|
-
}
|
|
11256
|
-
if (info.field) {
|
|
11491
|
+
} else if (info.field) {
|
|
11257
11492
|
acc[info.field] = {
|
|
11258
11493
|
sortInfo: info,
|
|
11259
11494
|
index
|
|
@@ -11261,54 +11496,57 @@ var getComputedVisibleColumns = ({
|
|
|
11261
11496
|
}
|
|
11262
11497
|
return acc;
|
|
11263
11498
|
}, {});
|
|
11499
|
+
function getColSize(colId) {
|
|
11500
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11501
|
+
const column = columns.get(colId);
|
|
11502
|
+
const colType = getColumnComputedType(column, columnTypes);
|
|
11503
|
+
const colTypeSizing = {
|
|
11504
|
+
minWidth: colType == null ? void 0 : colType.minWidth,
|
|
11505
|
+
maxWidth: colType == null ? void 0 : colType.maxWidth,
|
|
11506
|
+
width: colType == null ? void 0 : colType.defaultWidth,
|
|
11507
|
+
flex: colType == null ? void 0 : colType.defaultFlex
|
|
11508
|
+
};
|
|
11509
|
+
let colSizing = assignNonNull({
|
|
11510
|
+
width: column == null ? void 0 : column.defaultWidth,
|
|
11511
|
+
flex: column == null ? void 0 : column.defaultFlex,
|
|
11512
|
+
minWidth: column == null ? void 0 : column.minWidth,
|
|
11513
|
+
maxWidth: column == null ? void 0 : column.maxWidth
|
|
11514
|
+
}, columnSizing[colId]);
|
|
11515
|
+
if (colSizing.width != null) {
|
|
11516
|
+
delete colTypeSizing.flex;
|
|
11517
|
+
}
|
|
11518
|
+
if (colSizing.flex != null) {
|
|
11519
|
+
delete colTypeSizing.width;
|
|
11520
|
+
}
|
|
11521
|
+
colSizing = assignNonNull(colTypeSizing, colSizing);
|
|
11522
|
+
const colFlex = (_a = colSizing.flex) != null ? _a : void 0;
|
|
11523
|
+
const colMinWidth = (_c = (_b = colSizing.minWidth) != null ? _b : column == null ? void 0 : column.minWidth) != null ? _c : columnMinWidth;
|
|
11524
|
+
const colMaxWidth = (_e = (_d = colSizing.maxWidth) != null ? _d : column == null ? void 0 : column.maxWidth) != null ? _e : columnMaxWidth;
|
|
11525
|
+
let size = colFlex != void 0 ? void 0 : (_f = colSizing.width) != null ? _f : columnDefaultWidth;
|
|
11526
|
+
if (!size && colFlex == void 0) {
|
|
11527
|
+
size = colMinWidth;
|
|
11528
|
+
}
|
|
11529
|
+
return {
|
|
11530
|
+
size,
|
|
11531
|
+
flex: colFlex,
|
|
11532
|
+
minSize: colMinWidth,
|
|
11533
|
+
maxSize: colMaxWidth
|
|
11534
|
+
};
|
|
11535
|
+
}
|
|
11264
11536
|
const flexResult = computeFlex({
|
|
11265
11537
|
availableSize: Math.max(bodySize.width - (viewportReservedWidth != null ? viewportReservedWidth : 0) - getScrollbarWidth(), 0),
|
|
11266
11538
|
maxSize: columnMaxWidth,
|
|
11267
11539
|
minSize: columnMinWidth,
|
|
11268
|
-
items: visibleColumnOrder.map(
|
|
11269
|
-
var _a, _b, _c, _d, _e, _f;
|
|
11270
|
-
const column = columns.get(colId);
|
|
11271
|
-
const colType = getColumnComputedType(column, columnTypes);
|
|
11272
|
-
const colTypeSizing = {
|
|
11273
|
-
minWidth: colType == null ? void 0 : colType.minWidth,
|
|
11274
|
-
maxWidth: colType == null ? void 0 : colType.maxWidth,
|
|
11275
|
-
width: colType == null ? void 0 : colType.defaultWidth,
|
|
11276
|
-
flex: colType == null ? void 0 : colType.defaultFlex
|
|
11277
|
-
};
|
|
11278
|
-
let colSizing = assignNonNull({
|
|
11279
|
-
width: column == null ? void 0 : column.defaultWidth,
|
|
11280
|
-
flex: column == null ? void 0 : column.defaultFlex,
|
|
11281
|
-
minWidth: column == null ? void 0 : column.minWidth,
|
|
11282
|
-
maxWidth: column == null ? void 0 : column.maxWidth
|
|
11283
|
-
}, columnSizing[colId]);
|
|
11284
|
-
if (colSizing.width != null) {
|
|
11285
|
-
delete colTypeSizing.flex;
|
|
11286
|
-
}
|
|
11287
|
-
if (colSizing.flex != null) {
|
|
11288
|
-
delete colTypeSizing.width;
|
|
11289
|
-
}
|
|
11290
|
-
colSizing = assignNonNull(colTypeSizing, colSizing);
|
|
11291
|
-
const colFlex = (_a = colSizing.flex) != null ? _a : void 0;
|
|
11292
|
-
const colMinWidth = (_c = (_b = colSizing.minWidth) != null ? _b : column == null ? void 0 : column.minWidth) != null ? _c : columnMinWidth;
|
|
11293
|
-
const colMaxWidth = (_e = (_d = colSizing.maxWidth) != null ? _d : column == null ? void 0 : column.maxWidth) != null ? _e : columnMaxWidth;
|
|
11294
|
-
let size = colFlex != void 0 ? void 0 : (_f = colSizing.width) != null ? _f : columnDefaultWidth;
|
|
11295
|
-
if (!size && colFlex == void 0) {
|
|
11296
|
-
size = colMinWidth;
|
|
11297
|
-
}
|
|
11298
|
-
return {
|
|
11299
|
-
size,
|
|
11300
|
-
flex: colFlex,
|
|
11301
|
-
minSize: colMinWidth,
|
|
11302
|
-
maxSize: colMaxWidth
|
|
11303
|
-
};
|
|
11304
|
-
})
|
|
11540
|
+
items: visibleColumnOrder.map(getColSize)
|
|
11305
11541
|
});
|
|
11306
11542
|
const { computedSizes, flexSizes, minSizes, maxSizes } = flexResult;
|
|
11307
11543
|
const computedPinnedStartColumns = [];
|
|
11308
11544
|
const computedPinnedEndColumns = [];
|
|
11309
11545
|
const computedUnpinnedColumns = [];
|
|
11310
11546
|
const computedVisibleColumns = [];
|
|
11547
|
+
computedVisibleColumns.length = visibleColumnOrder.length;
|
|
11311
11548
|
const computedVisibleColumnsMap = new Map();
|
|
11549
|
+
const computedColumnsMap = new Map();
|
|
11312
11550
|
let computedUnpinnedColumnsWidth = 0;
|
|
11313
11551
|
let computedPinnedStartColumnsWidth = 0;
|
|
11314
11552
|
let computedPinnedEndColumnsWidth = 0;
|
|
@@ -11317,7 +11555,7 @@ var getComputedVisibleColumns = ({
|
|
|
11317
11555
|
let totalPinnedStartWidth = 0;
|
|
11318
11556
|
let totalUnpinnedWidth = 0;
|
|
11319
11557
|
let totalPinnedEndWidth = 0;
|
|
11320
|
-
|
|
11558
|
+
visibleColumnsArray.forEach((_c, i) => {
|
|
11321
11559
|
const id = visibleColumnOrder[i];
|
|
11322
11560
|
const computedWidth = computedSizes[i];
|
|
11323
11561
|
const pinned = computedPinnedArray[i] = getComputedPinned(id, columnPinning);
|
|
@@ -11330,39 +11568,55 @@ var getComputedVisibleColumns = ({
|
|
|
11330
11568
|
}
|
|
11331
11569
|
});
|
|
11332
11570
|
const firstPinnedEndAbsoluteOffset = bodySize.width - totalPinnedEndWidth;
|
|
11333
|
-
|
|
11571
|
+
const groupColumns = [];
|
|
11572
|
+
const orderedColumns = new Map();
|
|
11573
|
+
visibleColumnOrder.forEach((id, index) => {
|
|
11574
|
+
const c = visibleColumnsArray[index];
|
|
11575
|
+
orderedColumns.set(id, c);
|
|
11576
|
+
});
|
|
11577
|
+
columns.forEach((c, key) => {
|
|
11578
|
+
if (!orderedColumns.has(key)) {
|
|
11579
|
+
orderedColumns.set(key, c);
|
|
11580
|
+
}
|
|
11581
|
+
});
|
|
11582
|
+
orderedColumns.forEach((c, id) => {
|
|
11334
11583
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
11335
|
-
|
|
11336
|
-
|
|
11584
|
+
let theComputedVisibleIndex = columnIdsToVisibleIndex.get(id);
|
|
11585
|
+
if (theComputedVisibleIndex == void 0) {
|
|
11586
|
+
theComputedVisibleIndex = -1;
|
|
11587
|
+
}
|
|
11588
|
+
const computedVisible = theComputedVisibleIndex != -1;
|
|
11589
|
+
const nextColumnId = visibleColumnOrder[theComputedVisibleIndex + 1];
|
|
11337
11590
|
const colType = getColumnComputedType(c, columnTypes);
|
|
11338
|
-
const computedVisibleIndex =
|
|
11591
|
+
const computedVisibleIndex = theComputedVisibleIndex;
|
|
11339
11592
|
const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
|
|
11340
11593
|
const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
|
|
11341
11594
|
const computedSorted = !!computedSortInfo;
|
|
11342
11595
|
const computedSortedAsc = computedSorted && computedSortInfo.dir === 1;
|
|
11343
11596
|
const computedSortedDesc = computedSorted && !computedSortedAsc;
|
|
11344
11597
|
const computedSortIndex = (_c = sortingInfo == null ? void 0 : sortingInfo.index) != null ? _c : -1;
|
|
11345
|
-
const
|
|
11346
|
-
const
|
|
11347
|
-
const
|
|
11348
|
-
const
|
|
11349
|
-
const
|
|
11350
|
-
const
|
|
11598
|
+
const colSizeForNonVisibleColumn = computedVisible ? {} : getColSize(id);
|
|
11599
|
+
const computedWidth = computedVisible ? computedSizes[theComputedVisibleIndex] : colSizeForNonVisibleColumn.size || 0;
|
|
11600
|
+
const computedFlex = computedVisible ? flexSizes[theComputedVisibleIndex] || null : null;
|
|
11601
|
+
const computedMinWidth = computedVisible ? minSizes[theComputedVisibleIndex] || 0 : colSizeForNonVisibleColumn.minSize || 0;
|
|
11602
|
+
const computedMaxWidth = computedVisible ? maxSizes[theComputedVisibleIndex] || 1e4 : colSizeForNonVisibleColumn.maxSize || 1e4;
|
|
11603
|
+
const computedPinned = computedVisible ? getComputedPinned(id, columnPinning) : false;
|
|
11604
|
+
const computedLast = computedVisible ? theComputedVisibleIndex === visibleColumnOrder.length - 1 : false;
|
|
11351
11605
|
let computedVisibleIndexInCategory = computedVisibleIndex;
|
|
11352
|
-
const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
|
|
11606
|
+
const computedPinningOffset = computedVisible ? computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth : 0;
|
|
11353
11607
|
if (computedPinned == "start") {
|
|
11354
|
-
computedVisibleIndexInCategory = computedVisibleIndex;
|
|
11608
|
+
computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex : -1;
|
|
11355
11609
|
} else if (computedPinned === "end") {
|
|
11356
|
-
computedVisibleIndexInCategory = computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length);
|
|
11610
|
+
computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length) : -1;
|
|
11357
11611
|
} else {
|
|
11358
|
-
computedVisibleIndexInCategory = computedVisibleIndex - computedPinnedStartColumns.length;
|
|
11612
|
+
computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex - computedPinnedStartColumns.length : -1;
|
|
11359
11613
|
}
|
|
11360
|
-
const computedAbsoluteOffset = computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth;
|
|
11361
|
-
const computedFirstInCategory = computedPinned !== prevPinned;
|
|
11362
|
-
const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
|
|
11614
|
+
const computedAbsoluteOffset = computedVisible ? computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth : -1;
|
|
11615
|
+
const computedFirstInCategory = computedVisible ? computedPinned !== prevPinned : false;
|
|
11616
|
+
const computedLastInCategory = computedVisible ? computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning) : false;
|
|
11363
11617
|
const cssEllipsis = (_e = (_d = c.cssEllipsis) != null ? _d : colType.cssEllipsis) != null ? _e : columnCssEllipsis;
|
|
11364
11618
|
const headerCssEllipsis = (_j = (_i = (_h = (_g = (_f = c.headerCssEllipsis) != null ? _f : colType.cssEllipsis) != null ? _g : c.cssEllipsis) != null ? _h : colType.headerCssEllipsis) != null ? _i : columnHeaderCssEllipsis) != null ? _j : cssEllipsis;
|
|
11365
|
-
const computedFilterValue = filterValueRecord[id] || c.field ? filterValueRecord[c.field] || null : null;
|
|
11619
|
+
const computedFilterValue = computedVisible ? filterValueRecord[id] || c.field ? filterValueRecord[c.field] || null : null : null;
|
|
11366
11620
|
const computedFiltered = computedFilterValue != null;
|
|
11367
11621
|
const computedFilterable = (_l = (_k = c.defaultFilterable) != null ? _k : colType.defaultFilterable) != null ? _l : true;
|
|
11368
11622
|
const computedDataType = c.dataType || colType.dataType || (Array.isArray(c.type) ? c.type[0] : c.type) || "string";
|
|
@@ -11371,14 +11625,16 @@ var getComputedVisibleColumns = ({
|
|
|
11371
11625
|
const field = (_m = c.field) != null ? _m : colType.field;
|
|
11372
11626
|
const valueGetter = (_n = c.valueGetter) != null ? _n : colType.valueGetter;
|
|
11373
11627
|
let sortableColumnOrType = (_o = c.sortable) != null ? _o : colType.sortable;
|
|
11374
|
-
if (sortableColumnOrType == null) {
|
|
11628
|
+
if (sortableColumnOrType == null && !c.groupByField) {
|
|
11375
11629
|
if (field == null && valueGetter == null) {
|
|
11376
11630
|
sortableColumnOrType = false;
|
|
11377
11631
|
}
|
|
11378
11632
|
}
|
|
11379
11633
|
let computedSortable = (_p = sortableColumnOrType != null ? sortableColumnOrType : sortable) != null ? _p : true;
|
|
11380
11634
|
const result2 = __spreadProps(__spreadValues({
|
|
11635
|
+
colType,
|
|
11381
11636
|
align: colType.align,
|
|
11637
|
+
computedVisible,
|
|
11382
11638
|
verticalAlign: colType.verticalAlign,
|
|
11383
11639
|
defaultHiddenWhenGroupedBy: colType.defaultHiddenWhenGroupedBy,
|
|
11384
11640
|
valueGetter,
|
|
@@ -11421,16 +11677,17 @@ var getComputedVisibleColumns = ({
|
|
|
11421
11677
|
computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
|
|
11422
11678
|
computedFirstInCategory,
|
|
11423
11679
|
computedLastInCategory,
|
|
11424
|
-
computedFirst:
|
|
11680
|
+
computedFirst: theComputedVisibleIndex === 0,
|
|
11425
11681
|
computedLast,
|
|
11426
11682
|
toggleSort: () => {
|
|
11427
11683
|
const currentSortInfo = computedSortInfo;
|
|
11428
11684
|
let newColumnSortInfo;
|
|
11685
|
+
const field2 = result2.groupByField ? result2.groupByField : c.field;
|
|
11429
11686
|
if (!currentSortInfo) {
|
|
11430
11687
|
newColumnSortInfo = {
|
|
11431
11688
|
dir: 1,
|
|
11432
11689
|
id,
|
|
11433
|
-
field:
|
|
11690
|
+
field: field2,
|
|
11434
11691
|
type: computedSortType
|
|
11435
11692
|
};
|
|
11436
11693
|
} else {
|
|
@@ -11442,8 +11699,8 @@ var getComputedVisibleColumns = ({
|
|
|
11442
11699
|
});
|
|
11443
11700
|
}
|
|
11444
11701
|
}
|
|
11445
|
-
if (
|
|
11446
|
-
newColumnSortInfo.field =
|
|
11702
|
+
if (field2 && newColumnSortInfo && !newColumnSortInfo.field) {
|
|
11703
|
+
newColumnSortInfo.field = field2;
|
|
11447
11704
|
}
|
|
11448
11705
|
if (c.valueGetter && newColumnSortInfo && !newColumnSortInfo.valueGetter) {
|
|
11449
11706
|
newColumnSortInfo.valueGetter = (data) => c.valueGetter({ data, field: c.field });
|
|
@@ -11470,22 +11727,31 @@ var getComputedVisibleColumns = ({
|
|
|
11470
11727
|
id,
|
|
11471
11728
|
header: (_x = (_w = (_v = c.header) != null ? _v : colType.header) != null ? _w : c.name) != null ? _x : c.field
|
|
11472
11729
|
});
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
|
|
11482
|
-
|
|
11483
|
-
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
|
|
11730
|
+
if (computedVisible) {
|
|
11731
|
+
computedOffset += computedWidth;
|
|
11732
|
+
computedVisibleColumnsMap.set(result2.id, result2);
|
|
11733
|
+
computedVisibleColumns[theComputedVisibleIndex] = result2;
|
|
11734
|
+
if (computedPinned === "start") {
|
|
11735
|
+
computedPinnedStartColumns.push(result2);
|
|
11736
|
+
computedPinnedStartColumnsWidth += result2.computedWidth;
|
|
11737
|
+
}
|
|
11738
|
+
if (computedPinned === "end") {
|
|
11739
|
+
computedPinnedEndColumns.push(result2);
|
|
11740
|
+
computedPinnedEndColumnsWidth += result2.computedWidth;
|
|
11741
|
+
}
|
|
11742
|
+
if (!computedPinned) {
|
|
11743
|
+
computedUnpinnedColumns.push(result2);
|
|
11744
|
+
computedUnpinnedColumnsWidth += result2.computedWidth;
|
|
11745
|
+
}
|
|
11746
|
+
prevPinned = computedPinned;
|
|
11747
|
+
}
|
|
11748
|
+
if (result2.groupByField) {
|
|
11749
|
+
groupColumns.push(result2);
|
|
11750
|
+
}
|
|
11751
|
+
computedColumnsMap.set(result2.id, result2);
|
|
11752
|
+
});
|
|
11753
|
+
groupColumns.forEach((col) => {
|
|
11754
|
+
col.computedSortable = isGroupColumnSortable(col, computedColumnsMap);
|
|
11489
11755
|
});
|
|
11490
11756
|
const computedPinnedStartWidth = pinnedStartMaxWidth != null ? Math.min(pinnedStartMaxWidth, computedPinnedStartColumnsWidth) : computedPinnedStartColumnsWidth;
|
|
11491
11757
|
const computedPinnedEndWidth = pinnedEndMaxWidth != null ? Math.min(pinnedEndMaxWidth, computedPinnedEndColumnsWidth) : computedPinnedEndColumnsWidth;
|
|
@@ -11501,6 +11767,7 @@ var getComputedVisibleColumns = ({
|
|
|
11501
11767
|
computedPinnedEndOffset: computedPinnedStartColumnsWidth + computedUnpinnedColumnsWidth,
|
|
11502
11768
|
computedUnpinnedColumns,
|
|
11503
11769
|
computedVisibleColumns,
|
|
11770
|
+
computedColumnsMap,
|
|
11504
11771
|
computedVisibleColumnsMap,
|
|
11505
11772
|
computedPinnedEndWidth,
|
|
11506
11773
|
computedPinnedStartWidth,
|
|
@@ -11568,7 +11835,8 @@ var useComputedVisibleColumns = ({
|
|
|
11568
11835
|
computedPinnedEndOffset,
|
|
11569
11836
|
computedPinnedEndWidth,
|
|
11570
11837
|
computedPinnedStartWidth,
|
|
11571
|
-
renderSelectionCheckBox
|
|
11838
|
+
renderSelectionCheckBox,
|
|
11839
|
+
computedColumnsMap
|
|
11572
11840
|
} = (0, import_react41.useMemo)(() => {
|
|
11573
11841
|
return getComputedVisibleColumns({
|
|
11574
11842
|
columns,
|
|
@@ -11621,6 +11889,7 @@ var useComputedVisibleColumns = ({
|
|
|
11621
11889
|
const result = {
|
|
11622
11890
|
renderSelectionCheckBox,
|
|
11623
11891
|
columns,
|
|
11892
|
+
computedColumnsMap,
|
|
11624
11893
|
computedPinnedEndWidth,
|
|
11625
11894
|
computedPinnedStartWidth,
|
|
11626
11895
|
computedRemainingSpace,
|
|
@@ -11728,7 +11997,8 @@ function useComputed() {
|
|
|
11728
11997
|
computedRemainingSpace,
|
|
11729
11998
|
computedPinnedStartWidth,
|
|
11730
11999
|
computedPinnedEndWidth,
|
|
11731
|
-
renderSelectionCheckBox
|
|
12000
|
+
renderSelectionCheckBox,
|
|
12001
|
+
computedColumnsMap
|
|
11732
12002
|
} = useComputedVisibleColumns({
|
|
11733
12003
|
columns,
|
|
11734
12004
|
columnCssEllipsis: componentState.columnCssEllipsis,
|
|
@@ -11772,6 +12042,7 @@ function useComputed() {
|
|
|
11772
12042
|
columnSize,
|
|
11773
12043
|
rowspan,
|
|
11774
12044
|
toggleGroupRow,
|
|
12045
|
+
computedColumnsMap,
|
|
11775
12046
|
renderSelectionCheckBox,
|
|
11776
12047
|
computedPinnedStartOverflow,
|
|
11777
12048
|
computedPinnedEndOverflow,
|
|
@@ -11955,7 +12226,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
11955
12226
|
const valid = (0, import_react44.useMemo)(() => {
|
|
11956
12227
|
let valid2 = isValidLicense(licenseKey, {
|
|
11957
12228
|
publishedAt: 1624970570587,
|
|
11958
|
-
version: "0.4.
|
|
12229
|
+
version: "0.4.4"
|
|
11959
12230
|
});
|
|
11960
12231
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
11961
12232
|
return true;
|
|
@@ -12135,6 +12406,7 @@ function initSetupState2() {
|
|
|
12135
12406
|
onRowHeightCSSVarChange: buildSubscriptionCallback(),
|
|
12136
12407
|
onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
|
|
12137
12408
|
cellClick: buildSubscriptionCallback(),
|
|
12409
|
+
cellMouseDown: buildSubscriptionCallback(),
|
|
12138
12410
|
keyDown: buildSubscriptionCallback(),
|
|
12139
12411
|
bodySize: {
|
|
12140
12412
|
width: 0,
|
|
@@ -12189,6 +12461,7 @@ var forwardProps4 = (setupState) => {
|
|
|
12189
12461
|
filterEditors: (filterEditors) => __spreadValues(__spreadValues({}, defaultFilterEditors), filterEditors),
|
|
12190
12462
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
12191
12463
|
resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
|
|
12464
|
+
hideColumnWhenGrouped: (hideColumnWhenGrouped) => hideColumnWhenGrouped != null ? hideColumnWhenGrouped : false,
|
|
12192
12465
|
columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
|
|
12193
12466
|
columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 5e3,
|
|
12194
12467
|
columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
|
|
@@ -12265,6 +12538,7 @@ var mapPropsToState2 = (params) => {
|
|
|
12265
12538
|
groupRenderStrategy,
|
|
12266
12539
|
groupBy,
|
|
12267
12540
|
computedColumns,
|
|
12541
|
+
initialColumns: props.columns,
|
|
12268
12542
|
keyboardNavigation: (_a = props.keyboardNavigation) != null ? _a : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
|
|
12269
12543
|
columnHeaderCssEllipsis: (_c = (_b = props.columnHeaderCssEllipsis) != null ? _b : props.columnCssEllipsis) != null ? _c : true,
|
|
12270
12544
|
columnGroupsDepthsMap,
|