@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.esm.js
CHANGED
|
@@ -4258,10 +4258,10 @@ var InfiniteTableFooter = forwardRef3(function InfiniteTableFooter2(props, ref)
|
|
|
4258
4258
|
import {
|
|
4259
4259
|
Fragment as Fragment3,
|
|
4260
4260
|
createContext as createContext5,
|
|
4261
|
-
createElement as
|
|
4261
|
+
createElement as createElement25,
|
|
4262
4262
|
useMemo as useMemo5
|
|
4263
4263
|
} from "react";
|
|
4264
|
-
import { useCallback as useCallback9, useContext as useContext5, useEffect as
|
|
4264
|
+
import { useCallback as useCallback9, useContext as useContext5, useEffect as useEffect13, useRef as useRef13 } from "react";
|
|
4265
4265
|
import { createPortal } from "react-dom";
|
|
4266
4266
|
|
|
4267
4267
|
// src/components/DataSource/defaultFilterTypes.ts
|
|
@@ -4357,6 +4357,9 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
4357
4357
|
if (column.computedLastInCategory) {
|
|
4358
4358
|
result.push(...baseClasses.map((c) => `${c}--last-in-category`));
|
|
4359
4359
|
}
|
|
4360
|
+
if (extraFlags.rowSelected) {
|
|
4361
|
+
result.push(...baseClasses.map((c) => `${c}--row-selected`));
|
|
4362
|
+
}
|
|
4360
4363
|
if (column.computedPinned) {
|
|
4361
4364
|
result.push(...baseClasses.map((c) => `${c}--pinned-${column.computedPinned}`));
|
|
4362
4365
|
} else {
|
|
@@ -4949,11 +4952,49 @@ function shallowEqualObjects(objA, objB, ignoreKeys) {
|
|
|
4949
4952
|
return true;
|
|
4950
4953
|
}
|
|
4951
4954
|
|
|
4955
|
+
// src/components/InfiniteTable/hooks/adjustColumnOrderForAllColumns.ts
|
|
4956
|
+
function adjustColumnOrderForAllColumns(options) {
|
|
4957
|
+
const {
|
|
4958
|
+
newColumnOrder,
|
|
4959
|
+
visibleColumnOrder,
|
|
4960
|
+
existingColumnOrder,
|
|
4961
|
+
dragColumnId
|
|
4962
|
+
} = options;
|
|
4963
|
+
if (visibleColumnOrder.length !== newColumnOrder.length) {
|
|
4964
|
+
console.warn("new column order cannot contain less columns than the visible column order");
|
|
4965
|
+
return newColumnOrder;
|
|
4966
|
+
}
|
|
4967
|
+
const dragIndex = visibleColumnOrder.indexOf(dragColumnId);
|
|
4968
|
+
const dropIndex = newColumnOrder.indexOf(dragColumnId);
|
|
4969
|
+
if (dragIndex === dropIndex) {
|
|
4970
|
+
return existingColumnOrder;
|
|
4971
|
+
}
|
|
4972
|
+
if (dropIndex > dragIndex) {
|
|
4973
|
+
const indexInNewOrder = newColumnOrder.indexOf(dragColumnId);
|
|
4974
|
+
const prevColIdInNewOrder = newColumnOrder[indexInNewOrder - 1];
|
|
4975
|
+
const prevColIndexInExiting = existingColumnOrder.indexOf(prevColIdInNewOrder);
|
|
4976
|
+
const indexInExisting = existingColumnOrder.indexOf(dragColumnId);
|
|
4977
|
+
return moveXatY(existingColumnOrder, indexInExisting, prevColIndexInExiting);
|
|
4978
|
+
} else {
|
|
4979
|
+
const indexInNewOrder = newColumnOrder.indexOf(dragColumnId);
|
|
4980
|
+
const nextColIdInNewOrder = newColumnOrder[indexInNewOrder + 1];
|
|
4981
|
+
const nextColIndexInExiting = existingColumnOrder.indexOf(nextColIdInNewOrder);
|
|
4982
|
+
const indexInExisting = existingColumnOrder.indexOf(dragColumnId);
|
|
4983
|
+
return moveXatY(existingColumnOrder, indexInExisting, nextColIndexInExiting);
|
|
4984
|
+
}
|
|
4985
|
+
return newColumnOrder;
|
|
4986
|
+
}
|
|
4987
|
+
|
|
4952
4988
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
4953
4989
|
var columnOffsetAtIndex4 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
4954
4990
|
var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4955
4991
|
var baseZIndexForCells2 = stripVar(InternalVars.baseZIndexForCells);
|
|
4956
4992
|
var equalPinning = (pinning1, pinning2) => {
|
|
4993
|
+
const empty1 = !pinning1 || Object.keys(pinning1).length === 0;
|
|
4994
|
+
const empty2 = !pinning2 || Object.keys(pinning2).length === 0;
|
|
4995
|
+
if (empty1 && empty2) {
|
|
4996
|
+
return true;
|
|
4997
|
+
}
|
|
4957
4998
|
if (!!pinning1 != !!pinning2) {
|
|
4958
4999
|
return false;
|
|
4959
5000
|
}
|
|
@@ -5020,14 +5061,20 @@ var useColumnPointerEvents = ({
|
|
|
5020
5061
|
function persistColumnOrder(reorderDragResult2) {
|
|
5021
5062
|
const { columnPinning, columnOrder } = reorderDragResult2;
|
|
5022
5063
|
if (!equalPinning(getState().columnPinning, columnPinning)) {
|
|
5023
|
-
console.log("update pinning");
|
|
5024
5064
|
componentActions.columnPinning = columnPinning;
|
|
5025
5065
|
}
|
|
5026
|
-
|
|
5066
|
+
console.log("old order", getComputed().computedColumnOrder);
|
|
5067
|
+
const currentComputedColumnOrder = getComputed().computedColumnOrder;
|
|
5068
|
+
if (JSON.stringify(columnOrder, currentComputedColumnOrder)) {
|
|
5027
5069
|
computedVisibleColumns.forEach((col) => {
|
|
5028
5070
|
setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
|
|
5029
5071
|
});
|
|
5030
|
-
componentActions.columnOrder =
|
|
5072
|
+
componentActions.columnOrder = adjustColumnOrderForAllColumns({
|
|
5073
|
+
newColumnOrder: columnOrder,
|
|
5074
|
+
visibleColumnOrder: getComputed().computedVisibleColumns.map((c) => c.id),
|
|
5075
|
+
existingColumnOrder: currentComputedColumnOrder,
|
|
5076
|
+
dragColumnId: columnId
|
|
5077
|
+
});
|
|
5031
5078
|
}
|
|
5032
5079
|
}
|
|
5033
5080
|
const onPointerMove = (e2) => {
|
|
@@ -5089,18 +5136,269 @@ var useColumnPointerEvents = ({
|
|
|
5089
5136
|
|
|
5090
5137
|
// src/components/InfiniteTable/utils/RenderHookComponent.tsx
|
|
5091
5138
|
import {
|
|
5092
|
-
createElement as
|
|
5139
|
+
createElement as createElement19
|
|
5093
5140
|
} from "react";
|
|
5094
5141
|
|
|
5095
5142
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
5096
5143
|
import {
|
|
5097
5144
|
Fragment as Fragment2,
|
|
5098
5145
|
createContext as createContext4,
|
|
5099
|
-
createElement as
|
|
5146
|
+
createElement as createElement18,
|
|
5100
5147
|
memo as memo8
|
|
5101
5148
|
} from "react";
|
|
5102
5149
|
import { useCallback as useCallback7, useContext as useContext4, useMemo as useMemo4 } from "react";
|
|
5103
5150
|
|
|
5151
|
+
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
5152
|
+
import {
|
|
5153
|
+
createElement as createElement15
|
|
5154
|
+
} from "react";
|
|
5155
|
+
|
|
5156
|
+
// src/components/DataSource/state/rowInfoStatus.ts
|
|
5157
|
+
var showLoadingIcon = (rowInfo) => {
|
|
5158
|
+
if (rowInfo.dataSourceHasGrouping) {
|
|
5159
|
+
return rowInfo.isGroupRow ? rowInfo.childrenLoading || !rowInfo.selfLoaded : !rowInfo.selfLoaded;
|
|
5160
|
+
}
|
|
5161
|
+
return !rowInfo.selfLoaded;
|
|
5162
|
+
};
|
|
5163
|
+
|
|
5164
|
+
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5165
|
+
import {
|
|
5166
|
+
createElement as createElement13,
|
|
5167
|
+
useEffect as useEffect9
|
|
5168
|
+
} from "react";
|
|
5169
|
+
import { useState as useState6 } from "react";
|
|
5170
|
+
|
|
5171
|
+
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
5172
|
+
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5173
|
+
var ExpanderIconCls = "_16lm1iw6 _16lm1iwi _16lm1iwe";
|
|
5174
|
+
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"]] });
|
|
5175
|
+
|
|
5176
|
+
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5177
|
+
function ExpanderIcon(props) {
|
|
5178
|
+
var _a;
|
|
5179
|
+
const { size = 24, direction = "start" } = props;
|
|
5180
|
+
const [expanded, setExpanded] = useState6((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
5181
|
+
const onClick = () => {
|
|
5182
|
+
var _a2;
|
|
5183
|
+
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
5184
|
+
if (!isControlled("expanded", props)) {
|
|
5185
|
+
setExpanded(!expanded);
|
|
5186
|
+
}
|
|
5187
|
+
};
|
|
5188
|
+
useEffect9(() => {
|
|
5189
|
+
if (isControlled("expanded", props)) {
|
|
5190
|
+
setExpanded(props.expanded);
|
|
5191
|
+
}
|
|
5192
|
+
}, [props.expanded]);
|
|
5193
|
+
return /* @__PURE__ */ createElement13("svg", {
|
|
5194
|
+
"data-name": "expander-icon",
|
|
5195
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5196
|
+
height: `${size}px`,
|
|
5197
|
+
viewBox: "0 0 24 24",
|
|
5198
|
+
width: `${size}px`,
|
|
5199
|
+
style: props.style,
|
|
5200
|
+
onClick,
|
|
5201
|
+
className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
|
|
5202
|
+
direction: direction || "start",
|
|
5203
|
+
expanded
|
|
5204
|
+
}), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`, `InfiniteIcon-expander--${direction === "end" ? "end" : "start"}`)
|
|
5205
|
+
}, /* @__PURE__ */ createElement13("path", {
|
|
5206
|
+
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
5207
|
+
}));
|
|
5208
|
+
}
|
|
5209
|
+
|
|
5210
|
+
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5211
|
+
import {
|
|
5212
|
+
createElement as createElement14
|
|
5213
|
+
} from "react";
|
|
5214
|
+
|
|
5215
|
+
// src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
|
|
5216
|
+
var LoadingIconCls = "_16lm1iw8 _16lm1iwi _16lm1iwe";
|
|
5217
|
+
|
|
5218
|
+
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5219
|
+
var LoadingIcon = (props) => {
|
|
5220
|
+
return /* @__PURE__ */ createElement14("svg", {
|
|
5221
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5222
|
+
style: {
|
|
5223
|
+
margin: "auto",
|
|
5224
|
+
display: "block",
|
|
5225
|
+
shapeRendering: "auto"
|
|
5226
|
+
},
|
|
5227
|
+
width: "24px",
|
|
5228
|
+
height: "24px",
|
|
5229
|
+
viewBox: "0 0 100 100",
|
|
5230
|
+
preserveAspectRatio: "xMidYMid",
|
|
5231
|
+
className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
|
|
5232
|
+
}, /* @__PURE__ */ createElement14("circle", {
|
|
5233
|
+
cx: "50",
|
|
5234
|
+
cy: "50",
|
|
5235
|
+
fill: "none",
|
|
5236
|
+
strokeWidth: "10",
|
|
5237
|
+
r: "35",
|
|
5238
|
+
strokeDasharray: "164.93361431346415 56.97787143782138"
|
|
5239
|
+
}, /* @__PURE__ */ createElement14("animateTransform", {
|
|
5240
|
+
attributeName: "transform",
|
|
5241
|
+
type: "rotate",
|
|
5242
|
+
repeatCount: "indefinite",
|
|
5243
|
+
dur: "1s",
|
|
5244
|
+
values: "0 50 50;360 50 50",
|
|
5245
|
+
keyTimes: "0;1"
|
|
5246
|
+
})));
|
|
5247
|
+
};
|
|
5248
|
+
|
|
5249
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
5250
|
+
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5251
|
+
var GroupRowExpanderCls = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_7pupv0b", center: "_7pupv0c", end: "_7pupv0d" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5252
|
+
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: [] });
|
|
5253
|
+
var RowHoverCls = "_7pupv01";
|
|
5254
|
+
|
|
5255
|
+
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
5256
|
+
function styleForGroupColumn({
|
|
5257
|
+
rowInfo
|
|
5258
|
+
}) {
|
|
5259
|
+
return {
|
|
5260
|
+
[stripVar(ThemeVars.components.Row.groupNesting)]: rowInfo.dataSourceHasGrouping ? rowInfo.isGroupRow ? rowInfo.groupNesting - 1 : rowInfo.groupNesting : 0
|
|
5261
|
+
};
|
|
5262
|
+
}
|
|
5263
|
+
function getGroupColumnRender({
|
|
5264
|
+
groupIndexForColumn,
|
|
5265
|
+
groupRenderStrategy
|
|
5266
|
+
}) {
|
|
5267
|
+
return (renderOptions) => {
|
|
5268
|
+
const { rowInfo, renderBag, column } = renderOptions;
|
|
5269
|
+
let { value: valueToRender, groupIcon, selectionCheckBox } = renderBag;
|
|
5270
|
+
const groupRowInfo = rowInfo;
|
|
5271
|
+
if (groupRenderStrategy === "multi-column") {
|
|
5272
|
+
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting && groupRowInfo.isGroupRow) {
|
|
5273
|
+
return null;
|
|
5274
|
+
}
|
|
5275
|
+
} else if (groupRenderStrategy === "single-column" && !groupRowInfo.isGroupRow) {
|
|
5276
|
+
}
|
|
5277
|
+
return /* @__PURE__ */ createElement15("div", {
|
|
5278
|
+
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)
|
|
5279
|
+
}, groupIcon, selectionCheckBox, /* @__PURE__ */ createElement15("div", {
|
|
5280
|
+
className: cssEllipsisClassName
|
|
5281
|
+
}, valueToRender != null ? valueToRender : null));
|
|
5282
|
+
};
|
|
5283
|
+
}
|
|
5284
|
+
function getGroupColumnRenderGroupIcon({
|
|
5285
|
+
groupIndexForColumn,
|
|
5286
|
+
groupRenderStrategy,
|
|
5287
|
+
toggleGroupRow,
|
|
5288
|
+
initialRenderGroupIcon
|
|
5289
|
+
}) {
|
|
5290
|
+
return (renderOptions) => {
|
|
5291
|
+
var _a, _b, _c;
|
|
5292
|
+
const {
|
|
5293
|
+
rowInfo,
|
|
5294
|
+
value,
|
|
5295
|
+
rootGroupBy: groupBy,
|
|
5296
|
+
pivotBy,
|
|
5297
|
+
column
|
|
5298
|
+
} = renderOptions;
|
|
5299
|
+
const groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : rowInfo.isGroupRow && ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
|
|
5300
|
+
if (!groupRowInfo) {
|
|
5301
|
+
return null;
|
|
5302
|
+
}
|
|
5303
|
+
const collapsed = groupRowInfo.collapsed;
|
|
5304
|
+
if (groupRenderStrategy === "inline") {
|
|
5305
|
+
if (groupRowInfo.groupCount === 1) {
|
|
5306
|
+
return value;
|
|
5307
|
+
}
|
|
5308
|
+
if (groupRowInfo.groupNesting === groupIndexForColumn && collapsed) {
|
|
5309
|
+
return null;
|
|
5310
|
+
}
|
|
5311
|
+
} else {
|
|
5312
|
+
if (!groupRowInfo.isGroupRow) {
|
|
5313
|
+
return null;
|
|
5314
|
+
}
|
|
5315
|
+
if (groupRenderStrategy === "multi-column") {
|
|
5316
|
+
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting) {
|
|
5317
|
+
return null;
|
|
5318
|
+
}
|
|
5319
|
+
}
|
|
5320
|
+
}
|
|
5321
|
+
const groupKeys = groupRowInfo.groupKeys;
|
|
5322
|
+
let icon = null;
|
|
5323
|
+
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);
|
|
5324
|
+
const isLoading = showLoadingIcon(groupRowInfo);
|
|
5325
|
+
if (isLoading) {
|
|
5326
|
+
icon = /* @__PURE__ */ createElement15(LoadingIcon, null);
|
|
5327
|
+
} else if (showExpanderIcon) {
|
|
5328
|
+
const defaultIcon = /* @__PURE__ */ createElement15(ExpanderIcon, {
|
|
5329
|
+
expanded: !collapsed,
|
|
5330
|
+
direction: column.align === "end" ? "end" : "start",
|
|
5331
|
+
onChange: () => {
|
|
5332
|
+
toggleGroupRow(groupKeys);
|
|
5333
|
+
}
|
|
5334
|
+
});
|
|
5335
|
+
icon = defaultIcon;
|
|
5336
|
+
}
|
|
5337
|
+
if (initialRenderGroupIcon) {
|
|
5338
|
+
renderOptions.renderBag.groupIcon = icon;
|
|
5339
|
+
icon = /* @__PURE__ */ createElement15(RenderCellHookComponent, {
|
|
5340
|
+
render: initialRenderGroupIcon,
|
|
5341
|
+
renderParam: renderOptions
|
|
5342
|
+
});
|
|
5343
|
+
}
|
|
5344
|
+
return icon;
|
|
5345
|
+
};
|
|
5346
|
+
}
|
|
5347
|
+
function getColumnForGroupBy(options, toggleGroupRow, groupColumnFromProps) {
|
|
5348
|
+
const { groupByForColumn, groupIndexForColumn, groupRenderStrategy } = options;
|
|
5349
|
+
let userDefinedGroupColumn = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : __spreadValues({}, groupColumnFromProps);
|
|
5350
|
+
if (groupByForColumn.column) {
|
|
5351
|
+
userDefinedGroupColumn = __spreadValues(__spreadValues({}, userDefinedGroupColumn), groupByForColumn.column);
|
|
5352
|
+
}
|
|
5353
|
+
let generatedGroupColumn = __spreadProps(__spreadValues({
|
|
5354
|
+
header: `Group by ${groupByForColumn.field}`,
|
|
5355
|
+
groupByField: groupByForColumn.field,
|
|
5356
|
+
render: getGroupColumnRender({
|
|
5357
|
+
groupIndexForColumn,
|
|
5358
|
+
groupRenderStrategy
|
|
5359
|
+
})
|
|
5360
|
+
}, userDefinedGroupColumn), {
|
|
5361
|
+
renderGroupIcon: getGroupColumnRenderGroupIcon({
|
|
5362
|
+
initialRenderGroupIcon: userDefinedGroupColumn == null ? void 0 : userDefinedGroupColumn.renderGroupIcon,
|
|
5363
|
+
groupIndexForColumn,
|
|
5364
|
+
toggleGroupRow,
|
|
5365
|
+
groupRenderStrategy
|
|
5366
|
+
})
|
|
5367
|
+
});
|
|
5368
|
+
if (groupColumnFromProps) {
|
|
5369
|
+
if (typeof groupColumnFromProps === "function") {
|
|
5370
|
+
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps(options, toggleGroupRow));
|
|
5371
|
+
} else {
|
|
5372
|
+
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps);
|
|
5373
|
+
}
|
|
5374
|
+
}
|
|
5375
|
+
return generatedGroupColumn;
|
|
5376
|
+
}
|
|
5377
|
+
function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
5378
|
+
const theGroupColumnFromProps = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : groupColumnFromProps;
|
|
5379
|
+
const base = {};
|
|
5380
|
+
if (options.sortable != void 0) {
|
|
5381
|
+
base.sortable = options.sortable;
|
|
5382
|
+
}
|
|
5383
|
+
let generatedGroupColumn = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, base), {
|
|
5384
|
+
header: `Group`,
|
|
5385
|
+
groupByField: options.groupBy.map((g) => g.field),
|
|
5386
|
+
renderSelectionCheckBox: options.selectionMode === "multi-row",
|
|
5387
|
+
render: getGroupColumnRender({
|
|
5388
|
+
groupIndexForColumn: 0,
|
|
5389
|
+
groupRenderStrategy: "single-column"
|
|
5390
|
+
})
|
|
5391
|
+
}), groupColumnFromProps), {
|
|
5392
|
+
renderGroupIcon: getGroupColumnRenderGroupIcon({
|
|
5393
|
+
initialRenderGroupIcon: theGroupColumnFromProps == null ? void 0 : theGroupColumnFromProps.renderGroupIcon,
|
|
5394
|
+
groupIndexForColumn: 0,
|
|
5395
|
+
toggleGroupRow,
|
|
5396
|
+
groupRenderStrategy: "single-column"
|
|
5397
|
+
})
|
|
5398
|
+
});
|
|
5399
|
+
return generatedGroupColumn;
|
|
5400
|
+
}
|
|
5401
|
+
|
|
5104
5402
|
// src/components/InfiniteTable/utils/objectValuesExcept.ts
|
|
5105
5403
|
function objectValuesExcept(obj, exceptList) {
|
|
5106
5404
|
const result = [];
|
|
@@ -5112,16 +5410,16 @@ function objectValuesExcept(obj, exceptList) {
|
|
|
5112
5410
|
}
|
|
5113
5411
|
|
|
5114
5412
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
5115
|
-
var
|
|
5413
|
+
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5116
5414
|
var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw2 _16lm1iw1r _16lm1iw1s _16lm1iwy";
|
|
5117
|
-
var ColumnCellRecipe = (0,
|
|
5415
|
+
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"]] });
|
|
5118
5416
|
var SelectionCheckboxCls = "_1eexc2a7";
|
|
5119
5417
|
|
|
5120
5418
|
// src/components/InfiniteTable/components/CheckBox.tsx
|
|
5121
5419
|
import {
|
|
5122
|
-
createElement as
|
|
5420
|
+
createElement as createElement16
|
|
5123
5421
|
} from "react";
|
|
5124
|
-
import { useEffect as
|
|
5422
|
+
import { useEffect as useEffect10, useRef as useRef11 } from "react";
|
|
5125
5423
|
|
|
5126
5424
|
// src/components/InfiniteTable/components/CheckBox.css.ts
|
|
5127
5425
|
var CheckBoxCls = "_16lm1iwe";
|
|
@@ -5149,10 +5447,10 @@ function InfiniteCheckBoxComponent() {
|
|
|
5149
5447
|
const { componentState, componentActions } = useComponentState();
|
|
5150
5448
|
const { checked, domProps } = componentState;
|
|
5151
5449
|
const inputRef = useRef11(null);
|
|
5152
|
-
|
|
5450
|
+
useEffect10(() => {
|
|
5153
5451
|
inputRef.current.indeterminate = checked == null;
|
|
5154
5452
|
}, [checked]);
|
|
5155
|
-
return /* @__PURE__ */
|
|
5453
|
+
return /* @__PURE__ */ createElement16("input", __spreadProps(__spreadValues({}, domProps), {
|
|
5156
5454
|
className: join(CheckBoxCls, domProps == null ? void 0 : domProps.className),
|
|
5157
5455
|
type: "checkbox",
|
|
5158
5456
|
ref: inputRef,
|
|
@@ -5163,24 +5461,152 @@ function InfiniteCheckBoxComponent() {
|
|
|
5163
5461
|
}));
|
|
5164
5462
|
}
|
|
5165
5463
|
function InfiniteCheckBox(props) {
|
|
5166
|
-
return /* @__PURE__ */
|
|
5464
|
+
return /* @__PURE__ */ createElement16(InfiniteCheckBoxRoot, __spreadValues({}, props), /* @__PURE__ */ createElement16(InfiniteCheckBoxComponent, null));
|
|
5167
5465
|
}
|
|
5168
5466
|
|
|
5169
|
-
// src/components/InfiniteTable/components/InfiniteTableRow/
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
}
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5467
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/columnRendering.tsx
|
|
5468
|
+
function isColumnWithField(c) {
|
|
5469
|
+
return typeof c.field === "string";
|
|
5470
|
+
}
|
|
5471
|
+
function getGroupByColumn(options) {
|
|
5472
|
+
const { column, rowInfo, columnsMap } = options;
|
|
5473
|
+
const groupByColumn = rowInfo.isGroupRow && column.groupByField ? columnsMap.get(rowInfo.isGroupRow ? rowInfo.groupBy[rowInfo.groupBy.length - 1] : "") : void 0;
|
|
5474
|
+
return groupByColumn;
|
|
5475
|
+
}
|
|
5476
|
+
function getColumnRenderingParams(options) {
|
|
5477
|
+
const { column } = options;
|
|
5478
|
+
const groupByColumn = getGroupByColumn(options);
|
|
5479
|
+
const formattedResult = getFormattedValueContextForCell(__spreadProps(__spreadValues({}, options), {
|
|
5480
|
+
column: groupByColumn || column
|
|
5481
|
+
}));
|
|
5482
|
+
const { formattedValueContext } = formattedResult;
|
|
5483
|
+
return {
|
|
5484
|
+
stylingParam: __spreadValues({
|
|
5485
|
+
column: options.column
|
|
5486
|
+
}, formattedValueContext),
|
|
5487
|
+
formattedValueContext,
|
|
5488
|
+
renderFunctions: {
|
|
5489
|
+
renderGroupIcon: (groupByColumn == null ? void 0 : groupByColumn.renderGroupIcon) || column.renderGroupIcon,
|
|
5490
|
+
renderSelectionCheckBox: column.renderSelectionCheckBox,
|
|
5491
|
+
renderValue: (groupByColumn == null ? void 0 : groupByColumn.renderValue) || column.renderValue,
|
|
5492
|
+
renderGroupValue: (groupByColumn == null ? void 0 : groupByColumn.renderGroupValue) || column.renderGroupValue,
|
|
5493
|
+
renderLeafValue: (groupByColumn == null ? void 0 : groupByColumn.renderLeafValue) || column.renderLeafValue
|
|
5494
|
+
},
|
|
5495
|
+
renderParams: getColumnRenderParam(__spreadProps(__spreadValues({}, options), {
|
|
5496
|
+
formattedValueContext
|
|
5497
|
+
})),
|
|
5498
|
+
groupByColumn
|
|
5499
|
+
};
|
|
5500
|
+
}
|
|
5501
|
+
function getColumnRenderParam(options) {
|
|
5502
|
+
const { column, context, rowInfo, columnsMap, formattedValueContext } = options;
|
|
5503
|
+
const { value } = formattedValueContext;
|
|
5504
|
+
const { api: imperativeApi, getDataSourceState } = context;
|
|
5505
|
+
const { indexInAll: rowIndex } = rowInfo;
|
|
5506
|
+
const dataSourceState = getDataSourceState();
|
|
5507
|
+
const { selectionMode } = dataSourceState;
|
|
5508
|
+
const groupByColumn = rowInfo.isGroupRow ? columnsMap.get(rowInfo.isGroupRow ? rowInfo.groupBy[rowInfo.groupBy.length - 1] : "") : void 0;
|
|
5509
|
+
const toggleGroupRow = imperativeApi.toggleGroupRow;
|
|
5510
|
+
const renderParam = __spreadProps(__spreadValues({
|
|
5511
|
+
column,
|
|
5512
|
+
columnsMap
|
|
5513
|
+
}, formattedValueContext), {
|
|
5514
|
+
groupByColumn,
|
|
5515
|
+
selectionMode,
|
|
5516
|
+
api: imperativeApi,
|
|
5517
|
+
selectRow: imperativeApi.selectionApi.selectRow,
|
|
5518
|
+
deselectRow: imperativeApi.selectionApi.deselectRow,
|
|
5519
|
+
toggleRowSelection: imperativeApi.selectionApi.toggleRowSelection,
|
|
5520
|
+
renderBag: {
|
|
5521
|
+
value,
|
|
5522
|
+
selectionCheckBox: null,
|
|
5523
|
+
groupIcon: null
|
|
5524
|
+
},
|
|
5525
|
+
selectCurrentRow: () => {
|
|
5526
|
+
return imperativeApi.selectionApi.selectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5527
|
+
},
|
|
5528
|
+
deselectCurrentRow: () => {
|
|
5529
|
+
return imperativeApi.selectionApi.deselectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5530
|
+
},
|
|
5531
|
+
rowIndex,
|
|
5532
|
+
toggleGroupRow,
|
|
5533
|
+
toggleCurrentGroupRow: () => {
|
|
5534
|
+
if (!rowInfo.isGroupRow) {
|
|
5535
|
+
return;
|
|
5536
|
+
}
|
|
5537
|
+
toggleGroupRow(rowInfo.groupKeys);
|
|
5538
|
+
},
|
|
5539
|
+
toggleCurrentGroupRowSelection: () => {
|
|
5540
|
+
if (!rowInfo.isGroupRow) {
|
|
5541
|
+
return;
|
|
5542
|
+
}
|
|
5543
|
+
return imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.isGroupRow ? rowInfo.groupKeys : []);
|
|
5544
|
+
},
|
|
5545
|
+
rootGroupBy: dataSourceState.groupBy,
|
|
5546
|
+
pivotBy: dataSourceState.pivotBy
|
|
5547
|
+
});
|
|
5548
|
+
return renderParam;
|
|
5549
|
+
}
|
|
5550
|
+
function getRawValueForCell(column, rowInfo) {
|
|
5551
|
+
const { data, isGroupRow, dataSourceHasGrouping } = rowInfo;
|
|
5552
|
+
const groupBy = dataSourceHasGrouping ? rowInfo.groupBy : void 0;
|
|
5553
|
+
let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
|
|
5554
|
+
if (column.valueGetter) {
|
|
5555
|
+
if (!rowInfo.isGroupRow && rowInfo.data) {
|
|
5556
|
+
value = column.valueGetter({ data: rowInfo.data, field: column.field });
|
|
5557
|
+
}
|
|
5558
|
+
}
|
|
5559
|
+
return value;
|
|
5560
|
+
}
|
|
5561
|
+
function getFormattedValueParamForCell(rawValue, column, rowInfo, context) {
|
|
5562
|
+
const { rowSelected, indexInAll: rowIndex } = rowInfo;
|
|
5563
|
+
const { activeRowIndex, keyboardNavigation } = context.getState();
|
|
5564
|
+
const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
|
|
5565
|
+
return rowInfo.isGroupRow ? {
|
|
5566
|
+
rowInfo,
|
|
5567
|
+
isGroupRow: rowInfo.isGroupRow,
|
|
5568
|
+
data: rowInfo.data,
|
|
5569
|
+
rowSelected,
|
|
5570
|
+
rowActive,
|
|
5571
|
+
value: rawValue,
|
|
5572
|
+
field: column.field
|
|
5573
|
+
} : {
|
|
5574
|
+
rowInfo,
|
|
5575
|
+
isGroupRow: rowInfo.isGroupRow,
|
|
5576
|
+
data: rowInfo.data,
|
|
5577
|
+
rowSelected,
|
|
5578
|
+
rowActive,
|
|
5579
|
+
value: rawValue,
|
|
5580
|
+
field: column.field
|
|
5581
|
+
};
|
|
5582
|
+
}
|
|
5583
|
+
function getFormattedValueContextForCell(options) {
|
|
5584
|
+
const { column, rowInfo, context } = options;
|
|
5585
|
+
const rawValue = getRawValueForCell(column, rowInfo);
|
|
5586
|
+
const formattedValueContext = getFormattedValueParamForCell(rawValue, column, rowInfo, context);
|
|
5587
|
+
const formattedValue = column.valueFormatter ? column.valueFormatter(formattedValueContext) : rawValue;
|
|
5588
|
+
formattedValueContext.value = formattedValue;
|
|
5589
|
+
return {
|
|
5590
|
+
formattedValue,
|
|
5591
|
+
formattedValueContext
|
|
5592
|
+
};
|
|
5593
|
+
}
|
|
5594
|
+
|
|
5595
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
5596
|
+
import {
|
|
5597
|
+
Fragment,
|
|
5598
|
+
createElement as createElement17,
|
|
5599
|
+
memo as memo7
|
|
5600
|
+
} from "react";
|
|
5601
|
+
var { rootClassName: rootClassName5 } = internalProps;
|
|
5602
|
+
var InfiniteTableCellClassName = `${rootClassName5}Cell`;
|
|
5603
|
+
var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
|
|
5604
|
+
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
5605
|
+
var columnReorderEffectDurationAtIndex2 = stripVar(InternalVars.columnReorderEffectDurationAtIndex);
|
|
5606
|
+
function InfiniteTableCellFn(props) {
|
|
5607
|
+
var _b, _c, _d;
|
|
5608
|
+
const _a = props, {
|
|
5609
|
+
cssEllipsis = true,
|
|
5184
5610
|
virtualized = true,
|
|
5185
5611
|
skipColumnShifting = false,
|
|
5186
5612
|
contentStyle,
|
|
@@ -5188,6 +5614,7 @@ function InfiniteTableCellFn(props) {
|
|
|
5188
5614
|
domRef,
|
|
5189
5615
|
width,
|
|
5190
5616
|
contentClassName,
|
|
5617
|
+
rowId,
|
|
5191
5618
|
afterChildren,
|
|
5192
5619
|
beforeChildren,
|
|
5193
5620
|
cellType,
|
|
@@ -5202,6 +5629,7 @@ function InfiniteTableCellFn(props) {
|
|
|
5202
5629
|
"domRef",
|
|
5203
5630
|
"width",
|
|
5204
5631
|
"contentClassName",
|
|
5632
|
+
"rowId",
|
|
5205
5633
|
"afterChildren",
|
|
5206
5634
|
"beforeChildren",
|
|
5207
5635
|
"cellType",
|
|
@@ -5218,16 +5646,19 @@ function InfiniteTableCellFn(props) {
|
|
|
5218
5646
|
"data-column-id": column.id,
|
|
5219
5647
|
"data-z-index": style.zIndex,
|
|
5220
5648
|
className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls),
|
|
5221
|
-
children: /* @__PURE__ */
|
|
5649
|
+
children: /* @__PURE__ */ createElement17(Fragment, null, beforeChildren, /* @__PURE__ */ createElement17("div", {
|
|
5222
5650
|
className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
|
|
5223
5651
|
style: contentStyle
|
|
5224
5652
|
}, children), afterChildren)
|
|
5225
5653
|
});
|
|
5654
|
+
if (rowId != null) {
|
|
5655
|
+
finalDOMProps["data-row-id"] = `${rowId}`;
|
|
5656
|
+
}
|
|
5226
5657
|
const RenderComponent = cellType === "body" ? (_c = column.components) == null ? void 0 : _c.ColumnCell : (_d = column.components) == null ? void 0 : _d.HeaderCell;
|
|
5227
5658
|
if (RenderComponent) {
|
|
5228
|
-
return /* @__PURE__ */
|
|
5659
|
+
return /* @__PURE__ */ createElement17(RenderComponent, __spreadValues({}, finalDOMProps));
|
|
5229
5660
|
}
|
|
5230
|
-
return /* @__PURE__ */
|
|
5661
|
+
return /* @__PURE__ */ createElement17("div", __spreadProps(__spreadValues({}, finalDOMProps), {
|
|
5231
5662
|
ref: domRef
|
|
5232
5663
|
}));
|
|
5233
5664
|
}
|
|
@@ -5249,7 +5680,7 @@ var defaultRenderSelectionCheckBox = (params) => {
|
|
|
5249
5680
|
if (rowInfo.isGroupRow && !column.groupByField) {
|
|
5250
5681
|
return null;
|
|
5251
5682
|
}
|
|
5252
|
-
return /* @__PURE__ */
|
|
5683
|
+
return /* @__PURE__ */ createElement18(InfiniteCheckBox, {
|
|
5253
5684
|
domProps: {
|
|
5254
5685
|
className: SelectionCheckboxCls
|
|
5255
5686
|
},
|
|
@@ -5267,8 +5698,12 @@ var defaultRenderSelectionCheckBox = (params) => {
|
|
|
5267
5698
|
checked: rowInfo.rowSelected
|
|
5268
5699
|
});
|
|
5269
5700
|
};
|
|
5270
|
-
function
|
|
5271
|
-
|
|
5701
|
+
function applyColumnClassName(columnClassName, param) {
|
|
5702
|
+
const colClassName = columnClassName ? typeof columnClassName === "function" ? columnClassName(param) : columnClassName : void 0;
|
|
5703
|
+
return colClassName;
|
|
5704
|
+
}
|
|
5705
|
+
function applyColumnStyle(existingStyle, columnStyle, param) {
|
|
5706
|
+
return typeof columnStyle === "function" ? __spreadValues(__spreadValues({}, existingStyle), columnStyle(param)) : __spreadValues(__spreadValues({}, existingStyle), columnStyle);
|
|
5272
5707
|
}
|
|
5273
5708
|
function InfiniteTableColumnCellFn(props) {
|
|
5274
5709
|
var _a;
|
|
@@ -5280,7 +5715,6 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5280
5715
|
column,
|
|
5281
5716
|
onMouseLeave,
|
|
5282
5717
|
onMouseEnter,
|
|
5283
|
-
toggleGroupRow,
|
|
5284
5718
|
rowIndex,
|
|
5285
5719
|
rowHeight,
|
|
5286
5720
|
columnsMap,
|
|
@@ -5289,39 +5723,34 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5289
5723
|
showZebraRows
|
|
5290
5724
|
} = props;
|
|
5291
5725
|
if (!column) {
|
|
5292
|
-
return /* @__PURE__ */
|
|
5726
|
+
return /* @__PURE__ */ createElement18("div", {
|
|
5293
5727
|
ref: domRef
|
|
5294
5728
|
}, "no column");
|
|
5295
5729
|
}
|
|
5296
|
-
const {
|
|
5297
|
-
const groupBy = dataSourceHasGrouping ? rowInfo.groupBy : void 0;
|
|
5298
|
-
const groupRowInfo = null;
|
|
5730
|
+
const { rowSelected } = rowInfo;
|
|
5299
5731
|
const { getState, componentActions, imperativeApi } = useInfiniteTable();
|
|
5732
|
+
const { componentState: dataSourceState, getState: getDataSourceState } = useDataSourceContextValue();
|
|
5300
5733
|
const { activeRowIndex, keyboardNavigation } = getState();
|
|
5301
5734
|
const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
}
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
field: column.field,
|
|
5322
|
-
value
|
|
5323
|
-
});
|
|
5324
|
-
}
|
|
5735
|
+
const renderingContext = {
|
|
5736
|
+
getState,
|
|
5737
|
+
getDataSourceState,
|
|
5738
|
+
actions: componentActions,
|
|
5739
|
+
api: imperativeApi
|
|
5740
|
+
};
|
|
5741
|
+
const {
|
|
5742
|
+
stylingParam,
|
|
5743
|
+
renderParams,
|
|
5744
|
+
formattedValueContext,
|
|
5745
|
+
renderFunctions,
|
|
5746
|
+
groupByColumn
|
|
5747
|
+
} = getColumnRenderingParams({
|
|
5748
|
+
column,
|
|
5749
|
+
rowInfo,
|
|
5750
|
+
columnsMap,
|
|
5751
|
+
context: renderingContext
|
|
5752
|
+
});
|
|
5753
|
+
const renderParam = renderParams;
|
|
5325
5754
|
const onClick = useCallback7((event) => {
|
|
5326
5755
|
const colIndex = column.computedVisibleIndex;
|
|
5327
5756
|
getState().cellClick({
|
|
@@ -5329,6 +5758,14 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5329
5758
|
colIndex,
|
|
5330
5759
|
event
|
|
5331
5760
|
});
|
|
5761
|
+
}, [rowIndex, column.computedVisibleIndex, keyboardNavigation]);
|
|
5762
|
+
const onMouseDown = useCallback7((event) => {
|
|
5763
|
+
const colIndex = column.computedVisibleIndex;
|
|
5764
|
+
getState().cellMouseDown({
|
|
5765
|
+
rowIndex,
|
|
5766
|
+
colIndex,
|
|
5767
|
+
event
|
|
5768
|
+
});
|
|
5332
5769
|
if (keyboardNavigation === "row") {
|
|
5333
5770
|
componentActions.activeRowIndex = rowIndex;
|
|
5334
5771
|
return;
|
|
@@ -5337,121 +5774,73 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5337
5774
|
componentActions.activeCellIndex = [rowIndex, colIndex];
|
|
5338
5775
|
}
|
|
5339
5776
|
}, [rowIndex, column.computedVisibleIndex, keyboardNavigation]);
|
|
5340
|
-
const {
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
rowInfo
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
rowInfo,
|
|
5351
|
-
isGroupRow: rowInfo.isGroupRow,
|
|
5352
|
-
data: rowInfo.data,
|
|
5353
|
-
rowActive,
|
|
5354
|
-
value,
|
|
5355
|
-
field: column.field
|
|
5356
|
-
};
|
|
5357
|
-
const stylingRenderParam = __spreadValues({
|
|
5358
|
-
column
|
|
5359
|
-
}, rest);
|
|
5360
|
-
const renderParam = __spreadProps(__spreadValues({
|
|
5361
|
-
column,
|
|
5362
|
-
columnsMap,
|
|
5363
|
-
domRef,
|
|
5364
|
-
groupRowInfo
|
|
5365
|
-
}, rest), {
|
|
5366
|
-
selectionMode,
|
|
5367
|
-
selectRow: imperativeApi.selectionApi.selectRow,
|
|
5368
|
-
deselectRow: imperativeApi.selectionApi.deselectRow,
|
|
5369
|
-
toggleRowSelection: imperativeApi.selectionApi.toggleRowSelection,
|
|
5370
|
-
renderBag: {
|
|
5371
|
-
value,
|
|
5372
|
-
selectionCheckBox: null,
|
|
5373
|
-
groupIcon: null
|
|
5374
|
-
},
|
|
5375
|
-
selectCurrentRow: useCallback7(() => {
|
|
5376
|
-
return imperativeApi.selectionApi.selectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5377
|
-
}, [rowInfo]),
|
|
5378
|
-
deselectCurrentRow: useCallback7(() => {
|
|
5379
|
-
return imperativeApi.selectionApi.deselectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5380
|
-
}, [rowInfo]),
|
|
5381
|
-
rowIndex,
|
|
5382
|
-
toggleGroupRow,
|
|
5383
|
-
toggleCurrentGroupRow: useCallback7(() => {
|
|
5384
|
-
if (!rowInfo.isGroupRow) {
|
|
5385
|
-
return;
|
|
5386
|
-
}
|
|
5387
|
-
toggleGroupRow(rowInfo.groupKeys);
|
|
5388
|
-
}, [rowInfo]),
|
|
5389
|
-
toggleCurrentGroupRowSelection: useCallback7(() => {
|
|
5390
|
-
if (!rowInfo.isGroupRow) {
|
|
5391
|
-
return;
|
|
5392
|
-
}
|
|
5393
|
-
return imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.isGroupRow ? rowInfo.groupKeys : []);
|
|
5394
|
-
}, [rowInfo]),
|
|
5395
|
-
groupBy: computedDataSource.groupBy,
|
|
5396
|
-
pivotBy: computedDataSource.pivotBy
|
|
5397
|
-
});
|
|
5777
|
+
const { selectionMode } = dataSourceState;
|
|
5778
|
+
renderParam.domRef = domRef;
|
|
5779
|
+
renderParam.selectCurrentRow = useCallback7(renderParam.selectCurrentRow, [
|
|
5780
|
+
rowInfo
|
|
5781
|
+
]);
|
|
5782
|
+
renderParam.deselectCurrentRow = useCallback7(renderParam.deselectCurrentRow, [
|
|
5783
|
+
rowInfo
|
|
5784
|
+
]);
|
|
5785
|
+
renderParam.toggleCurrentGroupRow = useCallback7(renderParam.toggleCurrentGroupRow, [rowInfo]);
|
|
5786
|
+
renderParam.toggleCurrentGroupRowSelection = useCallback7(renderParam.toggleCurrentGroupRowSelection, [rowInfo]);
|
|
5398
5787
|
const renderChildren = useCallback7(() => {
|
|
5399
5788
|
if (hidden) {
|
|
5400
5789
|
return null;
|
|
5401
5790
|
}
|
|
5402
|
-
if (
|
|
5403
|
-
renderParam.renderBag.groupIcon = /* @__PURE__ */
|
|
5404
|
-
render:
|
|
5791
|
+
if (renderFunctions.renderGroupIcon) {
|
|
5792
|
+
renderParam.renderBag.groupIcon = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5793
|
+
render: renderFunctions.renderGroupIcon,
|
|
5405
5794
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5406
5795
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5407
5796
|
})
|
|
5408
5797
|
});
|
|
5409
5798
|
}
|
|
5410
|
-
if (
|
|
5411
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
5799
|
+
if (renderFunctions.renderSelectionCheckBox && selectionMode == "multi-row") {
|
|
5800
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5412
5801
|
render: defaultRenderSelectionCheckBox,
|
|
5413
5802
|
renderParam
|
|
5414
5803
|
});
|
|
5415
|
-
if (
|
|
5416
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
5417
|
-
render:
|
|
5804
|
+
if (renderFunctions.renderSelectionCheckBox !== true) {
|
|
5805
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5806
|
+
render: renderFunctions.renderSelectionCheckBox,
|
|
5418
5807
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5419
5808
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5420
5809
|
})
|
|
5421
5810
|
});
|
|
5422
5811
|
}
|
|
5423
5812
|
}
|
|
5424
|
-
if (
|
|
5425
|
-
renderParam.renderBag.value = /* @__PURE__ */
|
|
5426
|
-
render:
|
|
5813
|
+
if (renderFunctions.renderValue) {
|
|
5814
|
+
renderParam.renderBag.value = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5815
|
+
render: renderFunctions.renderValue,
|
|
5427
5816
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5428
5817
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5429
5818
|
})
|
|
5430
5819
|
});
|
|
5431
5820
|
}
|
|
5432
|
-
if (rowInfo.isGroupRow &&
|
|
5433
|
-
renderParam.renderBag.value = /* @__PURE__ */
|
|
5434
|
-
render:
|
|
5821
|
+
if (rowInfo.isGroupRow && renderFunctions.renderGroupValue) {
|
|
5822
|
+
renderParam.renderBag.value = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5823
|
+
render: renderFunctions.renderGroupValue,
|
|
5435
5824
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5436
5825
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5437
5826
|
})
|
|
5438
5827
|
});
|
|
5439
5828
|
}
|
|
5440
|
-
if (!rowInfo.isGroupRow &&
|
|
5441
|
-
renderParam.renderBag.value = /* @__PURE__ */
|
|
5442
|
-
render:
|
|
5829
|
+
if (!rowInfo.isGroupRow && renderFunctions.renderLeafValue) {
|
|
5830
|
+
renderParam.renderBag.value = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5831
|
+
render: renderFunctions.renderLeafValue,
|
|
5443
5832
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5444
5833
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5445
5834
|
})
|
|
5446
5835
|
});
|
|
5447
5836
|
}
|
|
5448
5837
|
if (column.render) {
|
|
5449
|
-
return /* @__PURE__ */
|
|
5838
|
+
return /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5450
5839
|
render: column.render,
|
|
5451
5840
|
renderParam
|
|
5452
5841
|
});
|
|
5453
5842
|
}
|
|
5454
|
-
return /* @__PURE__ */
|
|
5843
|
+
return /* @__PURE__ */ createElement18(Fragment2, 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);
|
|
5455
5844
|
}, [
|
|
5456
5845
|
column,
|
|
5457
5846
|
hidden,
|
|
@@ -5459,16 +5848,31 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5459
5848
|
renderBag: true
|
|
5460
5849
|
})
|
|
5461
5850
|
]);
|
|
5462
|
-
const rowPropsAndStyleArgs = __spreadProps(__spreadValues({},
|
|
5851
|
+
const rowPropsAndStyleArgs = __spreadProps(__spreadValues({}, formattedValueContext), {
|
|
5463
5852
|
rowIndex
|
|
5464
5853
|
});
|
|
5465
5854
|
const rowComputedClassName = typeof rowClassName === "function" ? rowClassName(rowPropsAndStyleArgs) : rowClassName;
|
|
5466
|
-
|
|
5855
|
+
let colClassName = void 0;
|
|
5856
|
+
if (groupByColumn == null ? void 0 : groupByColumn.className) {
|
|
5857
|
+
colClassName = applyColumnClassName(groupByColumn.className, stylingParam);
|
|
5858
|
+
}
|
|
5859
|
+
if (column.className) {
|
|
5860
|
+
colClassName = join(colClassName, applyColumnClassName(column.className, stylingParam));
|
|
5861
|
+
}
|
|
5467
5862
|
let style;
|
|
5863
|
+
if (rowInfo.dataSourceHasGrouping && column.groupByField) {
|
|
5864
|
+
style = styleForGroupColumn({ rowInfo });
|
|
5865
|
+
}
|
|
5468
5866
|
if (rowStyle) {
|
|
5469
5867
|
style = typeof rowStyle === "function" ? __spreadValues(__spreadValues({}, style), rowStyle(rowPropsAndStyleArgs)) : __spreadValues(__spreadValues({}, style), rowStyle);
|
|
5470
5868
|
}
|
|
5471
|
-
|
|
5869
|
+
if (groupByColumn == null ? void 0 : groupByColumn.style) {
|
|
5870
|
+
style = applyColumnStyle(style, groupByColumn.style, stylingParam);
|
|
5871
|
+
}
|
|
5872
|
+
if (column.style) {
|
|
5873
|
+
style = applyColumnStyle(style, column.style, stylingParam);
|
|
5874
|
+
}
|
|
5875
|
+
style = style || {};
|
|
5472
5876
|
style.height = rowHeight;
|
|
5473
5877
|
style.zIndex = `var(${columnZIndexAtIndex4}-${column.computedVisibleIndex})`;
|
|
5474
5878
|
const memoizedStyle = useMemo4(() => style, [!style ? null : JSON.stringify(style)]);
|
|
@@ -5479,15 +5883,17 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5479
5883
|
cellType: "body",
|
|
5480
5884
|
column,
|
|
5481
5885
|
width,
|
|
5886
|
+
rowId: rowInfo.id,
|
|
5482
5887
|
style: memoizedStyle,
|
|
5483
5888
|
onMouseLeave,
|
|
5484
5889
|
onMouseEnter,
|
|
5485
5890
|
onClick,
|
|
5891
|
+
onMouseDown,
|
|
5486
5892
|
cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
|
|
5487
5893
|
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false, zebra, rowActive, rowSelected }), colClassName, rowComputedClassName),
|
|
5488
5894
|
renderChildren
|
|
5489
5895
|
};
|
|
5490
|
-
return /* @__PURE__ */
|
|
5896
|
+
return /* @__PURE__ */ createElement18(InfiniteTableCell, __spreadValues({}, cellProps));
|
|
5491
5897
|
}
|
|
5492
5898
|
var InfiniteTableColumnCell = memo8(InfiniteTableColumnCellFn);
|
|
5493
5899
|
function useInfiniteColumnCell() {
|
|
@@ -5502,18 +5908,18 @@ function RenderHookComponent(props) {
|
|
|
5502
5908
|
}
|
|
5503
5909
|
function RenderCellHookComponent(props) {
|
|
5504
5910
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
5505
|
-
return /* @__PURE__ */
|
|
5911
|
+
return /* @__PURE__ */ createElement19(ContextProvider, {
|
|
5506
5912
|
value: props.renderParam
|
|
5507
|
-
}, /* @__PURE__ */
|
|
5913
|
+
}, /* @__PURE__ */ createElement19(RenderHookComponent, {
|
|
5508
5914
|
render: props.render,
|
|
5509
5915
|
renderParam: props.renderParam
|
|
5510
5916
|
}));
|
|
5511
5917
|
}
|
|
5512
5918
|
function RenderHeaderCellHookComponent(props) {
|
|
5513
5919
|
const ContextProvider = InfiniteTableHeaderCellContext.Provider;
|
|
5514
|
-
return /* @__PURE__ */
|
|
5920
|
+
return /* @__PURE__ */ createElement19(ContextProvider, {
|
|
5515
5921
|
value: props.renderParam
|
|
5516
|
-
}, /* @__PURE__ */
|
|
5922
|
+
}, /* @__PURE__ */ createElement19(RenderHookComponent, {
|
|
5517
5923
|
render: props.render,
|
|
5518
5924
|
renderParam: props.renderParam
|
|
5519
5925
|
}));
|
|
@@ -5521,7 +5927,7 @@ function RenderHeaderCellHookComponent(props) {
|
|
|
5521
5927
|
|
|
5522
5928
|
// src/components/InfiniteTable/components/FilterEditors.tsx
|
|
5523
5929
|
import {
|
|
5524
|
-
createElement as
|
|
5930
|
+
createElement as createElement20
|
|
5525
5931
|
} from "react";
|
|
5526
5932
|
function getFilterEditors() {
|
|
5527
5933
|
return {
|
|
@@ -5531,7 +5937,7 @@ function getFilterEditors() {
|
|
|
5531
5937
|
}
|
|
5532
5938
|
var defaultFilterEditors = getFilterEditors();
|
|
5533
5939
|
function StringFilterEditor(props) {
|
|
5534
|
-
return /* @__PURE__ */
|
|
5940
|
+
return /* @__PURE__ */ createElement20("input", {
|
|
5535
5941
|
"aria-label": `Filter for ${props.ariaLabel}`,
|
|
5536
5942
|
type: "text",
|
|
5537
5943
|
value: props.filterValue,
|
|
@@ -5542,7 +5948,7 @@ function StringFilterEditor(props) {
|
|
|
5542
5948
|
});
|
|
5543
5949
|
}
|
|
5544
5950
|
function NumberFilterEditor(props) {
|
|
5545
|
-
return /* @__PURE__ */
|
|
5951
|
+
return /* @__PURE__ */ createElement20("input", {
|
|
5546
5952
|
"aria-label": `Filter for ${props.ariaLabel}`,
|
|
5547
5953
|
type: "number",
|
|
5548
5954
|
value: props.filterValue,
|
|
@@ -5559,24 +5965,24 @@ function NumberFilterEditor(props) {
|
|
|
5559
5965
|
|
|
5560
5966
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
5561
5967
|
import {
|
|
5562
|
-
createElement as
|
|
5968
|
+
createElement as createElement21
|
|
5563
5969
|
} from "react";
|
|
5564
|
-
import { useEffect as
|
|
5970
|
+
import { useEffect as useEffect11, useState as useState7 } from "react";
|
|
5565
5971
|
|
|
5566
5972
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5567
|
-
var
|
|
5973
|
+
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5568
5974
|
var CellCls = "_1eexc2a5 _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw2 _16lm1iw1r _16lm1iw1s _16lm1iwy";
|
|
5569
|
-
var HeaderCellContentRecipe = (0,
|
|
5975
|
+
var HeaderCellContentRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob11e _16lm1iw10 _16lm1iw12 _16lm1iwu _16lm1iw1f _16lm1iw1h", variantClassNames: { filtered: { false: "_12zfob11f", true: "_12zfob11g" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5570
5976
|
var HeaderCellProxy = "_12zfob1k _16lm1iw1s _16lm1iw1t _16lm1iw1m";
|
|
5571
|
-
var HeaderCellRecipe = (0,
|
|
5572
|
-
var HeaderClsRecipe = (0,
|
|
5977
|
+
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"]] });
|
|
5978
|
+
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"]] });
|
|
5573
5979
|
var HeaderFilterCls = "_12zfob11j _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw1";
|
|
5574
5980
|
var HeaderFilterEditorCls = "_16lm1iw12 _16lm1iw10";
|
|
5575
5981
|
var HeaderGroupCls = "_12zfob11i _16lm1iwu _16lm1iw1f _16lm1iw1h";
|
|
5576
5982
|
var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
|
|
5577
5983
|
var HeaderSortIconCls = "_16lm1iw1";
|
|
5578
5984
|
var HeaderSortIconIndexCls = "_12zfob14";
|
|
5579
|
-
var HeaderSortIconRecipe = (0,
|
|
5985
|
+
var HeaderSortIconRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5580
5986
|
var HeaderWrapperCls = "_12zfob11h _16lm1iw1m _16lm1iw1 _16lm1iwu _16lm1iw1f";
|
|
5581
5987
|
|
|
5582
5988
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
@@ -5588,8 +5994,8 @@ var defaultLineStyle = {
|
|
|
5588
5994
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
5589
5995
|
function SortIcon(props) {
|
|
5590
5996
|
var _a;
|
|
5591
|
-
const [rendered, setRendered] =
|
|
5592
|
-
const [opacity, setOpacity] =
|
|
5997
|
+
const [rendered, setRendered] = useState7(true);
|
|
5998
|
+
const [opacity, setOpacity] = useState7(0);
|
|
5593
5999
|
const { direction, lineWidth = 1, style, className, index } = props;
|
|
5594
6000
|
const showIndex = index != null && index > 0;
|
|
5595
6001
|
const size = (_a = props.size) != null ? _a : 16;
|
|
@@ -5603,7 +6009,7 @@ function SortIcon(props) {
|
|
|
5603
6009
|
}), props.lineStyle), {
|
|
5604
6010
|
opacity
|
|
5605
6011
|
});
|
|
5606
|
-
|
|
6012
|
+
useEffect11(() => {
|
|
5607
6013
|
const newOpacity = direction != 0 ? 1 : 0;
|
|
5608
6014
|
if (!rendered && newOpacity) {
|
|
5609
6015
|
setRendered(true);
|
|
@@ -5633,39 +6039,39 @@ function SortIcon(props) {
|
|
|
5633
6039
|
if (direction === -1) {
|
|
5634
6040
|
indexStyle.top = "100%";
|
|
5635
6041
|
}
|
|
5636
|
-
return /* @__PURE__ */
|
|
6042
|
+
return /* @__PURE__ */ createElement21("div", {
|
|
5637
6043
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
5638
6044
|
className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
|
|
5639
|
-
}, showIndex ? /* @__PURE__ */
|
|
6045
|
+
}, showIndex ? /* @__PURE__ */ createElement21("div", {
|
|
5640
6046
|
"data-name": "index",
|
|
5641
6047
|
style: indexStyle,
|
|
5642
6048
|
className: HeaderSortIconIndexCls
|
|
5643
|
-
}, index) : null, /* @__PURE__ */
|
|
6049
|
+
}, index) : null, /* @__PURE__ */ createElement21("div", {
|
|
5644
6050
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
5645
6051
|
onTransitionEnd
|
|
5646
|
-
}), /* @__PURE__ */
|
|
6052
|
+
}), /* @__PURE__ */ createElement21("div", {
|
|
5647
6053
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
5648
|
-
}), /* @__PURE__ */
|
|
6054
|
+
}), /* @__PURE__ */ createElement21("div", {
|
|
5649
6055
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
5650
6056
|
}));
|
|
5651
6057
|
}
|
|
5652
6058
|
|
|
5653
6059
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx
|
|
5654
6060
|
import {
|
|
5655
|
-
createElement as
|
|
6061
|
+
createElement as createElement22
|
|
5656
6062
|
} from "react";
|
|
5657
|
-
import { useEffect as
|
|
6063
|
+
import { useEffect as useEffect12, useState as useState8 } from "react";
|
|
5658
6064
|
var { rootClassName: rootClassName7 } = internalProps;
|
|
5659
6065
|
var InfiniteTableColumnHeaderFilterClassName = `${rootClassName7}HeaderCell__filter`;
|
|
5660
6066
|
var stopPropagation = (e) => e.stopPropagation();
|
|
5661
6067
|
function InfiniteTableColumnHeaderFilter(props) {
|
|
5662
6068
|
var _a, _b, _c, _d;
|
|
5663
|
-
const [theValue, setTheValue] =
|
|
6069
|
+
const [theValue, setTheValue] = useState8((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
|
|
5664
6070
|
const onInputChange = (filterValue) => {
|
|
5665
6071
|
setTheValue(filterValue);
|
|
5666
6072
|
props.onChange(filterValue);
|
|
5667
6073
|
};
|
|
5668
|
-
|
|
6074
|
+
useEffect12(() => {
|
|
5669
6075
|
var _a2;
|
|
5670
6076
|
if (props.columnFilterValue) {
|
|
5671
6077
|
if (theValue !== props.columnFilterValue.filterValue) {
|
|
@@ -5692,15 +6098,15 @@ function InfiniteTableColumnHeaderFilter(props) {
|
|
|
5692
6098
|
onChange: onInputChange
|
|
5693
6099
|
};
|
|
5694
6100
|
const FilterEditor = props.filterEditor;
|
|
5695
|
-
return /* @__PURE__ */
|
|
6101
|
+
return /* @__PURE__ */ createElement22("div", {
|
|
5696
6102
|
onPointerUp: stopPropagation,
|
|
5697
6103
|
onPointerDown: stopPropagation,
|
|
5698
6104
|
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
|
|
5699
6105
|
style: { height: props.columnHeaderHeight }
|
|
5700
|
-
}, FilterEditor ? /* @__PURE__ */
|
|
6106
|
+
}, FilterEditor ? /* @__PURE__ */ createElement22(FilterEditor, __spreadValues({}, filterEditorProps)) : null);
|
|
5701
6107
|
}
|
|
5702
6108
|
function InfiniteTableColumnHeaderFilterEmpty() {
|
|
5703
|
-
return /* @__PURE__ */
|
|
6109
|
+
return /* @__PURE__ */ createElement22("div", {
|
|
5704
6110
|
onPointerUp: stopPropagation,
|
|
5705
6111
|
onPointerDown: stopPropagation,
|
|
5706
6112
|
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
|
|
@@ -5710,7 +6116,7 @@ function InfiniteTableColumnHeaderFilterEmpty() {
|
|
|
5710
6116
|
|
|
5711
6117
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
|
|
5712
6118
|
import {
|
|
5713
|
-
createElement as
|
|
6119
|
+
createElement as createElement24
|
|
5714
6120
|
} from "react";
|
|
5715
6121
|
import { useCallback as useCallback8 } from "react";
|
|
5716
6122
|
|
|
@@ -6051,9 +6457,9 @@ var computeGroupResize = (params) => {
|
|
|
6051
6457
|
};
|
|
6052
6458
|
|
|
6053
6459
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
6054
|
-
import { useRef as useRef12, useState as
|
|
6460
|
+
import { useRef as useRef12, useState as useState9 } from "react";
|
|
6055
6461
|
import {
|
|
6056
|
-
createElement as
|
|
6462
|
+
createElement as createElement23,
|
|
6057
6463
|
memo as memo9
|
|
6058
6464
|
} from "react";
|
|
6059
6465
|
|
|
@@ -6146,17 +6552,17 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
6146
6552
|
}
|
|
6147
6553
|
|
|
6148
6554
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
6149
|
-
var
|
|
6555
|
+
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
6150
6556
|
var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iw13 _16lm1iw1a _16lm1iw18 _16lm1iwf _16lm1iw1m";
|
|
6151
|
-
var ResizeHandleDraggerClsRecipe = (0,
|
|
6152
|
-
var ResizeHandleRecipeCls = (0,
|
|
6557
|
+
var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2 _16lm1iw13 _16lm1iw18", variantClassNames: { constrained: { false: "zneyzhc", true: "zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6558
|
+
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"]] });
|
|
6153
6559
|
|
|
6154
6560
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
6155
6561
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
6156
6562
|
var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName8}HeaderCell_ResizeHandle`;
|
|
6157
6563
|
function ResizeHandleFn(props) {
|
|
6158
6564
|
const domRef = useRef12(null);
|
|
6159
|
-
const [constrained, setConstrained] =
|
|
6565
|
+
const [constrained, setConstrained] = useState9(false);
|
|
6160
6566
|
const constrainedRef = useRef12(constrained);
|
|
6161
6567
|
constrainedRef.current = constrained;
|
|
6162
6568
|
const col = props.columns[props.columnIndex];
|
|
@@ -6209,7 +6615,7 @@ function ResizeHandleFn(props) {
|
|
|
6209
6615
|
const style = (computedPinned === false || computedPinned === "start") && computedLastInCategory ? {
|
|
6210
6616
|
right: computedPinned === "start" ? 0 : 0
|
|
6211
6617
|
} : computedPinned === "end" && computedFirstInCategory ? { right: "none", left: 0 } : void 0;
|
|
6212
|
-
return /* @__PURE__ */
|
|
6618
|
+
return /* @__PURE__ */ createElement23("div", {
|
|
6213
6619
|
ref: domRef,
|
|
6214
6620
|
className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls} ${ResizeHandleRecipeCls({
|
|
6215
6621
|
computedPinned,
|
|
@@ -6217,7 +6623,7 @@ function ResizeHandleFn(props) {
|
|
|
6217
6623
|
computedLastInCategory
|
|
6218
6624
|
})}`,
|
|
6219
6625
|
onPointerDown
|
|
6220
|
-
}, /* @__PURE__ */
|
|
6626
|
+
}, /* @__PURE__ */ createElement23("div", {
|
|
6221
6627
|
style,
|
|
6222
6628
|
className: ResizeHandleDraggerClsRecipe({
|
|
6223
6629
|
constrained
|
|
@@ -6282,7 +6688,7 @@ function useColumnResizeHandle(column) {
|
|
|
6282
6688
|
}
|
|
6283
6689
|
componentActions.columnSizing = columnSizing;
|
|
6284
6690
|
}, [computeResizeForDiff]);
|
|
6285
|
-
const resizeHandle = column.computedResizable ? /* @__PURE__ */
|
|
6691
|
+
const resizeHandle = column.computedResizable ? /* @__PURE__ */ createElement24(ResizeHandle, {
|
|
6286
6692
|
columns: computedVisibleColumns,
|
|
6287
6693
|
columnIndex: column.computedVisibleIndex,
|
|
6288
6694
|
computeResize: computeResizeForDiff,
|
|
@@ -6295,7 +6701,7 @@ function useColumnResizeHandle(column) {
|
|
|
6295
6701
|
var defaultRenderSelectionCheckBox2 = (params) => {
|
|
6296
6702
|
const { allRowsSelected, someRowsSelected, api } = params;
|
|
6297
6703
|
const selected = allRowsSelected ? true : someRowsSelected ? null : false;
|
|
6298
|
-
return /* @__PURE__ */
|
|
6704
|
+
return /* @__PURE__ */ createElement25(InfiniteCheckBox, {
|
|
6299
6705
|
domProps: {
|
|
6300
6706
|
className: SelectionCheckboxCls
|
|
6301
6707
|
},
|
|
@@ -6337,7 +6743,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6337
6743
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
6338
6744
|
}, [props.domRef]);
|
|
6339
6745
|
const alwaysShow = headerOptions.alwaysReserveSpaceForSortIcon;
|
|
6340
|
-
const sortIcon = column.computedSortable && (column.computedSorted || alwaysShow) ? /* @__PURE__ */
|
|
6746
|
+
const sortIcon = column.computedSortable && (column.computedSorted || alwaysShow) ? /* @__PURE__ */ createElement25(SortIcon, {
|
|
6341
6747
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
6342
6748
|
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls} ${HeaderSortIconRecipe({
|
|
6343
6749
|
align: column.align || "start"
|
|
@@ -6364,7 +6770,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6364
6770
|
const align = column.align || "start";
|
|
6365
6771
|
const renderChildren = () => {
|
|
6366
6772
|
if (column.renderSortIcon) {
|
|
6367
|
-
renderParam.renderBag.sortIcon = /* @__PURE__ */
|
|
6773
|
+
renderParam.renderBag.sortIcon = /* @__PURE__ */ createElement25(RenderHeaderCellHookComponent, {
|
|
6368
6774
|
render: column.renderSortIcon,
|
|
6369
6775
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
6370
6776
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
@@ -6372,12 +6778,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6372
6778
|
});
|
|
6373
6779
|
}
|
|
6374
6780
|
if (column.renderSelectionCheckBox && selectionMode === "multi-row") {
|
|
6375
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
6781
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ createElement25(RenderHeaderCellHookComponent, {
|
|
6376
6782
|
render: defaultRenderSelectionCheckBox2,
|
|
6377
6783
|
renderParam
|
|
6378
6784
|
});
|
|
6379
6785
|
if (column.renderHeaderSelectionCheckBox && column.renderHeaderSelectionCheckBox !== true) {
|
|
6380
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
6786
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ createElement25(RenderHeaderCellHookComponent, {
|
|
6381
6787
|
render: column.renderHeaderSelectionCheckBox,
|
|
6382
6788
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
6383
6789
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
@@ -6386,7 +6792,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6386
6792
|
}
|
|
6387
6793
|
}
|
|
6388
6794
|
if (header instanceof Function) {
|
|
6389
|
-
renderParam.renderBag.header = /* @__PURE__ */
|
|
6795
|
+
renderParam.renderBag.header = /* @__PURE__ */ createElement25(RenderHeaderCellHookComponent, {
|
|
6390
6796
|
render: header,
|
|
6391
6797
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
6392
6798
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
@@ -6394,12 +6800,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6394
6800
|
});
|
|
6395
6801
|
}
|
|
6396
6802
|
if (column.renderHeader) {
|
|
6397
|
-
return /* @__PURE__ */
|
|
6803
|
+
return /* @__PURE__ */ createElement25(RenderHeaderCellHookComponent, {
|
|
6398
6804
|
render: column.renderHeader,
|
|
6399
6805
|
renderParam
|
|
6400
6806
|
});
|
|
6401
6807
|
}
|
|
6402
|
-
return /* @__PURE__ */
|
|
6808
|
+
return /* @__PURE__ */ createElement25(Fragment3, 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);
|
|
6403
6809
|
};
|
|
6404
6810
|
const domRef = useRef13(null);
|
|
6405
6811
|
const {
|
|
@@ -6407,7 +6813,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6407
6813
|
getState: getDataSourceState,
|
|
6408
6814
|
componentState: { filterDelay, filterTypes }
|
|
6409
6815
|
} = useDataSourceContextValue();
|
|
6410
|
-
|
|
6816
|
+
useEffect13(() => {
|
|
6411
6817
|
let clearOnResize = null;
|
|
6412
6818
|
const node = domRef.current;
|
|
6413
6819
|
if (onResize && node) {
|
|
@@ -6430,7 +6836,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6430
6836
|
});
|
|
6431
6837
|
let draggingProxy = null;
|
|
6432
6838
|
if (dragging && proxyPosition) {
|
|
6433
|
-
draggingProxy = /* @__PURE__ */
|
|
6839
|
+
draggingProxy = /* @__PURE__ */ createElement25("div", {
|
|
6434
6840
|
key: column.id,
|
|
6435
6841
|
className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
|
|
6436
6842
|
style: {
|
|
@@ -6512,9 +6918,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6512
6918
|
const resizeHandle = useColumnResizeHandle(column);
|
|
6513
6919
|
const zIndex2 = `var(${columnZIndexAtIndex5}-${column.computedVisibleIndex})`;
|
|
6514
6920
|
style.zIndex = zIndex2;
|
|
6515
|
-
return /* @__PURE__ */
|
|
6921
|
+
return /* @__PURE__ */ createElement25(ContextProvider, {
|
|
6516
6922
|
value: renderParam
|
|
6517
|
-
}, /* @__PURE__ */
|
|
6923
|
+
}, /* @__PURE__ */ createElement25(InfiniteTableCell, {
|
|
6518
6924
|
domRef: ref,
|
|
6519
6925
|
cellType: "header",
|
|
6520
6926
|
column,
|
|
@@ -6533,7 +6939,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6533
6939
|
rowActive: false
|
|
6534
6940
|
}), CellCls),
|
|
6535
6941
|
cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
|
|
6536
|
-
afterChildren: /* @__PURE__ */
|
|
6942
|
+
afterChildren: /* @__PURE__ */ createElement25(Fragment3, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement25(InfiniteTableColumnHeaderFilter, {
|
|
6537
6943
|
filterEditor: FilterEditor,
|
|
6538
6944
|
filterTypes,
|
|
6539
6945
|
onChange: debouncedOnFilterValueChange,
|
|
@@ -6541,7 +6947,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6541
6947
|
columnLabel: column.field || column.name || column.id,
|
|
6542
6948
|
columnFilterValue: column.computedFilterValue,
|
|
6543
6949
|
columnHeaderHeight
|
|
6544
|
-
}) : /* @__PURE__ */
|
|
6950
|
+
}) : /* @__PURE__ */ createElement25(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
|
|
6545
6951
|
renderChildren
|
|
6546
6952
|
}), draggingProxy);
|
|
6547
6953
|
}
|
|
@@ -6552,7 +6958,7 @@ function useInfiniteHeaderCell() {
|
|
|
6552
6958
|
|
|
6553
6959
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
6554
6960
|
import {
|
|
6555
|
-
createElement as
|
|
6961
|
+
createElement as createElement30,
|
|
6556
6962
|
useCallback as useCallback12,
|
|
6557
6963
|
useMemo as useMemo6
|
|
6558
6964
|
} from "react";
|
|
@@ -6659,33 +7065,33 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
6659
7065
|
|
|
6660
7066
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
6661
7067
|
import {
|
|
6662
|
-
createElement as
|
|
7068
|
+
createElement as createElement29,
|
|
6663
7069
|
memo as memo11
|
|
6664
7070
|
} from "react";
|
|
6665
|
-
import { useCallback as useCallback11, useEffect as
|
|
7071
|
+
import { useCallback as useCallback11, useEffect as useEffect14, useRef as useRef15 } from "react";
|
|
6666
7072
|
|
|
6667
7073
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
6668
7074
|
import {
|
|
6669
|
-
createElement as
|
|
7075
|
+
createElement as createElement28
|
|
6670
7076
|
} from "react";
|
|
6671
7077
|
|
|
6672
7078
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
|
|
6673
7079
|
import {
|
|
6674
|
-
createElement as
|
|
7080
|
+
createElement as createElement27
|
|
6675
7081
|
} from "react";
|
|
6676
7082
|
import { useCallback as useCallback10 } from "react";
|
|
6677
7083
|
|
|
6678
7084
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
|
|
6679
|
-
import { useRef as useRef14, useState as
|
|
7085
|
+
import { useRef as useRef14, useState as useState10 } from "react";
|
|
6680
7086
|
import {
|
|
6681
|
-
createElement as
|
|
7087
|
+
createElement as createElement26,
|
|
6682
7088
|
memo as memo10
|
|
6683
7089
|
} from "react";
|
|
6684
7090
|
var { rootClassName: rootClassName10 } = internalProps;
|
|
6685
7091
|
var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName10}HeaderCell_ResizeHandle`;
|
|
6686
7092
|
function GroupResizeHandleFn(props) {
|
|
6687
7093
|
const domRef = useRef14(null);
|
|
6688
|
-
const [constrained, setConstrained] =
|
|
7094
|
+
const [constrained, setConstrained] = useState10(false);
|
|
6689
7095
|
const constrainedRef = useRef14(constrained);
|
|
6690
7096
|
constrainedRef.current = constrained;
|
|
6691
7097
|
const col = props.groupColumns[0];
|
|
@@ -6746,7 +7152,7 @@ function GroupResizeHandleFn(props) {
|
|
|
6746
7152
|
const style = (computedPinned === false || computedPinned === "start") && computedLastInCategory ? {
|
|
6747
7153
|
right: computedPinned === "start" ? 0 : ThemeVars.components.HeaderCell.resizeHandleWidth
|
|
6748
7154
|
} : computedPinned === "end" && computedFirstInCategory ? { right: "none", left: 0 } : void 0;
|
|
6749
|
-
return /* @__PURE__ */
|
|
7155
|
+
return /* @__PURE__ */ createElement26("div", {
|
|
6750
7156
|
ref: domRef,
|
|
6751
7157
|
className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls} ${ResizeHandleRecipeCls({
|
|
6752
7158
|
computedPinned,
|
|
@@ -6754,7 +7160,7 @@ function GroupResizeHandleFn(props) {
|
|
|
6754
7160
|
computedLastInCategory
|
|
6755
7161
|
})}`,
|
|
6756
7162
|
onPointerDown
|
|
6757
|
-
}, /* @__PURE__ */
|
|
7163
|
+
}, /* @__PURE__ */ createElement26("div", {
|
|
6758
7164
|
style: __spreadValues(__spreadValues({}, style), props.style),
|
|
6759
7165
|
className: ResizeHandleDraggerClsRecipe({
|
|
6760
7166
|
constrained
|
|
@@ -6812,7 +7218,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
6812
7218
|
componentActions.columnSizing = columnSizing;
|
|
6813
7219
|
}, [computeResizeForDiff]);
|
|
6814
7220
|
const groupResizable = groupColumns.some((c) => c.computedResizable);
|
|
6815
|
-
const resizeHandle = groupResizable ? /* @__PURE__ */
|
|
7221
|
+
const resizeHandle = groupResizable ? /* @__PURE__ */ createElement27(GroupResizeHandle, {
|
|
6816
7222
|
brain: bodyBrain,
|
|
6817
7223
|
style: {
|
|
6818
7224
|
height: groupHeight * (columnGroupsMaxDepth - columnGroup.depth + 2)
|
|
@@ -6846,13 +7252,13 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
6846
7252
|
const firstColumn = columns[0];
|
|
6847
7253
|
const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex5}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex5}-${firstColumn.computedVisibleIndex})`;
|
|
6848
7254
|
const zIndex2 = `calc(var(${columnZIndexAtIndex6}-${firstColumn.computedVisibleIndex}) + ${columnGroupsMaxDepth - columnGroup.depth})`;
|
|
6849
|
-
return /* @__PURE__ */
|
|
7255
|
+
return /* @__PURE__ */ createElement28("div", {
|
|
6850
7256
|
ref: props.domRef,
|
|
6851
7257
|
"data-group-id": columnGroup.uniqueGroupId,
|
|
6852
7258
|
className: join(HeaderGroupCls, TableHeaderGroupClassName),
|
|
6853
7259
|
style: { width, height },
|
|
6854
7260
|
"data-z-index": zIndex2
|
|
6855
|
-
}, /* @__PURE__ */
|
|
7261
|
+
}, /* @__PURE__ */ createElement28("div", {
|
|
6856
7262
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
6857
7263
|
}, header), handle);
|
|
6858
7264
|
}
|
|
@@ -6875,8 +7281,8 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6875
7281
|
computed,
|
|
6876
7282
|
componentState: { headerBrain, headerOptions }
|
|
6877
7283
|
} = useInfiniteTable();
|
|
6878
|
-
const {
|
|
6879
|
-
|
|
7284
|
+
const { computedColumnsMap, showColumnFilters } = computed;
|
|
7285
|
+
useEffect14(() => {
|
|
6880
7286
|
const onScroll = (scrollPosition) => {
|
|
6881
7287
|
if (domRef.current) {
|
|
6882
7288
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
@@ -6919,7 +7325,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6919
7325
|
computedWidth: colGroupItem.computedWidth,
|
|
6920
7326
|
groupOffset: colGroupItem.groupOffset
|
|
6921
7327
|
});
|
|
6922
|
-
return /* @__PURE__ */
|
|
7328
|
+
return /* @__PURE__ */ createElement29(InfiniteTableHeaderGroup, {
|
|
6923
7329
|
bodyBrain,
|
|
6924
7330
|
columnGroupsMaxDepth,
|
|
6925
7331
|
domRef: domRef2,
|
|
@@ -6929,13 +7335,13 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6929
7335
|
columnGroup: computedColumnGroup
|
|
6930
7336
|
});
|
|
6931
7337
|
}
|
|
6932
|
-
return /* @__PURE__ */
|
|
7338
|
+
return /* @__PURE__ */ createElement29(InfiniteTableHeaderCell, {
|
|
6933
7339
|
domRef: domRef2,
|
|
6934
7340
|
column,
|
|
6935
7341
|
headerOptions,
|
|
6936
7342
|
width: widthWithColspan,
|
|
6937
7343
|
height: heightWithRowspan,
|
|
6938
|
-
columnsMap:
|
|
7344
|
+
columnsMap: computedColumnsMap
|
|
6939
7345
|
});
|
|
6940
7346
|
}, [
|
|
6941
7347
|
headerOptions,
|
|
@@ -6945,7 +7351,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6945
7351
|
columnGroupsMaxDepth,
|
|
6946
7352
|
showColumnFilters
|
|
6947
7353
|
]);
|
|
6948
|
-
return /* @__PURE__ */
|
|
7354
|
+
return /* @__PURE__ */ createElement29("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement29(RawTable, {
|
|
6949
7355
|
name: "header",
|
|
6950
7356
|
renderCell,
|
|
6951
7357
|
brain: headerBrain,
|
|
@@ -7031,7 +7437,7 @@ function TableHeaderWrapper(props) {
|
|
|
7031
7437
|
fixedColsEnd: computedPinnedEndColumns.length,
|
|
7032
7438
|
fixedColsStart: computedPinnedStartColumns.length
|
|
7033
7439
|
});
|
|
7034
|
-
const header = /* @__PURE__ */
|
|
7440
|
+
const header = /* @__PURE__ */ createElement30(InfiniteTableHeader, {
|
|
7035
7441
|
columns: computedVisibleColumns,
|
|
7036
7442
|
headerBrain,
|
|
7037
7443
|
bodyBrain,
|
|
@@ -7039,14 +7445,14 @@ function TableHeaderWrapper(props) {
|
|
|
7039
7445
|
columnGroupsMaxDepth,
|
|
7040
7446
|
columnAndGroupTreeInfo
|
|
7041
7447
|
});
|
|
7042
|
-
const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */
|
|
7448
|
+
const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ createElement30("div", {
|
|
7043
7449
|
className: HeaderScrollbarPlaceholderCls,
|
|
7044
7450
|
style: {
|
|
7045
7451
|
zIndex: 1e3,
|
|
7046
7452
|
width: getScrollbarWidth()
|
|
7047
7453
|
}
|
|
7048
7454
|
}) : null;
|
|
7049
|
-
return /* @__PURE__ */
|
|
7455
|
+
return /* @__PURE__ */ createElement30("div", {
|
|
7050
7456
|
className: HeaderWrapperCls,
|
|
7051
7457
|
style: {
|
|
7052
7458
|
height
|
|
@@ -7056,12 +7462,12 @@ function TableHeaderWrapper(props) {
|
|
|
7056
7462
|
|
|
7057
7463
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
7058
7464
|
import {
|
|
7059
|
-
createElement as
|
|
7465
|
+
createElement as createElement31,
|
|
7060
7466
|
forwardRef as forwardRef4,
|
|
7061
7467
|
useCallback as useCallback13,
|
|
7062
7468
|
useRef as useRef16
|
|
7063
7469
|
} from "react";
|
|
7064
|
-
import { useEffect as
|
|
7470
|
+
import { useEffect as useEffect15 } from "react";
|
|
7065
7471
|
|
|
7066
7472
|
// src/components/utils/decamelize.ts
|
|
7067
7473
|
function decamelize(str, options) {
|
|
@@ -7110,7 +7516,7 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
|
|
|
7110
7516
|
ref.current = node;
|
|
7111
7517
|
}
|
|
7112
7518
|
}, []);
|
|
7113
|
-
|
|
7519
|
+
useEffect15(() => {
|
|
7114
7520
|
const forceStyle = () => {
|
|
7115
7521
|
raf(() => {
|
|
7116
7522
|
var _a;
|
|
@@ -7124,12 +7530,12 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
|
|
|
7124
7530
|
clearInterval(intervalId);
|
|
7125
7531
|
};
|
|
7126
7532
|
}, []);
|
|
7127
|
-
return /* @__PURE__ */
|
|
7533
|
+
return /* @__PURE__ */ createElement31("div", __spreadProps(__spreadValues({
|
|
7128
7534
|
ref: domCallback
|
|
7129
7535
|
}, props), {
|
|
7130
7536
|
className: join(`${rootClassName13}-Footer`, FooterCls, props.className),
|
|
7131
7537
|
style: defaultStyle
|
|
7132
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7538
|
+
}), "Powered by", " ", /* @__PURE__ */ createElement31("a", {
|
|
7133
7539
|
href: "https://infinite-table.com",
|
|
7134
7540
|
rel: "noopener noreferrer",
|
|
7135
7541
|
role: "link",
|
|
@@ -7137,15 +7543,9 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
|
|
|
7137
7543
|
}, "Infinite Table"));
|
|
7138
7544
|
});
|
|
7139
7545
|
|
|
7140
|
-
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
7141
|
-
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
7142
|
-
var GroupRowExpanderCls = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_7pupv0b", center: "_7pupv0c", end: "_7pupv0d" } }, defaultVariants: {}, compoundVariants: [] });
|
|
7143
|
-
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: [] });
|
|
7144
|
-
var RowHoverCls = "_7pupv01";
|
|
7145
|
-
|
|
7146
7546
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
7147
7547
|
import {
|
|
7148
|
-
createElement as
|
|
7548
|
+
createElement as createElement32,
|
|
7149
7549
|
memo as memo12
|
|
7150
7550
|
} from "react";
|
|
7151
7551
|
|
|
@@ -7159,11 +7559,11 @@ var { rootClassName: rootClassName12 } = internalProps;
|
|
|
7159
7559
|
var baseCls3 = `${rootClassName12}-LoadMask`;
|
|
7160
7560
|
function LoadMaskFn(props) {
|
|
7161
7561
|
const { visible, children = "Loading" } = props;
|
|
7162
|
-
return /* @__PURE__ */
|
|
7562
|
+
return /* @__PURE__ */ createElement32("div", {
|
|
7163
7563
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls3}`
|
|
7164
|
-
}, /* @__PURE__ */
|
|
7564
|
+
}, /* @__PURE__ */ createElement32("div", {
|
|
7165
7565
|
className: `${LoadMaskOverlayCls} ${baseCls3}-Overlay`
|
|
7166
|
-
}), /* @__PURE__ */
|
|
7566
|
+
}), /* @__PURE__ */ createElement32("div", {
|
|
7167
7567
|
className: `${LoadMaskTextCls} ${baseCls3}-Text`
|
|
7168
7568
|
}, children));
|
|
7169
7569
|
}
|
|
@@ -7404,14 +7804,17 @@ function group(groupParams, data) {
|
|
|
7404
7804
|
}
|
|
7405
7805
|
for (let i = 0, len = data.length; i < len; i++) {
|
|
7406
7806
|
const item = data[i];
|
|
7807
|
+
const commonData = {};
|
|
7407
7808
|
for (let groupByIndex = 0; groupByIndex < groupByLength; groupByIndex++) {
|
|
7408
7809
|
const { field: groupByProperty, toKey: groupToKey } = groupBy[groupByIndex];
|
|
7409
7810
|
const key = (groupToKey || defaultToKey)(item[groupByProperty], item);
|
|
7811
|
+
commonData[groupByProperty] = key;
|
|
7410
7812
|
currentGroupKeys.push(key);
|
|
7411
7813
|
if (!deepMap.has(currentGroupKeys)) {
|
|
7412
7814
|
const deepMapGroupValue = {
|
|
7413
7815
|
items: [],
|
|
7414
7816
|
cache: false,
|
|
7817
|
+
commonData: __spreadValues({}, commonData),
|
|
7415
7818
|
childrenLoading: false,
|
|
7416
7819
|
childrenAvailable: false,
|
|
7417
7820
|
reducerResults: deepClone(initialReducerValue)
|
|
@@ -7685,7 +8088,7 @@ function enhancedFlatten(param) {
|
|
|
7685
8088
|
// src/components/DataSource/index.tsx
|
|
7686
8089
|
import {
|
|
7687
8090
|
Fragment as Fragment4,
|
|
7688
|
-
createElement as
|
|
8091
|
+
createElement as createElement33
|
|
7689
8092
|
} from "react";
|
|
7690
8093
|
|
|
7691
8094
|
// src/utils/multisort/sortTypes.ts
|
|
@@ -7705,7 +8108,15 @@ var sortTypes_default = defaultSortTypes;
|
|
|
7705
8108
|
|
|
7706
8109
|
// src/utils/multisort/index.ts
|
|
7707
8110
|
var multisort = (sortInfo, array, get) => {
|
|
7708
|
-
|
|
8111
|
+
const plainSortInfo = sortInfo.map((sortInfo2) => {
|
|
8112
|
+
if (Array.isArray(sortInfo2.field)) {
|
|
8113
|
+
return sortInfo2.field.map((field) => {
|
|
8114
|
+
return __spreadProps(__spreadValues({}, sortInfo2), { field });
|
|
8115
|
+
});
|
|
8116
|
+
}
|
|
8117
|
+
return sortInfo2;
|
|
8118
|
+
}).flat();
|
|
8119
|
+
array.sort(getMultisortFunction(plainSortInfo, get));
|
|
7709
8120
|
return array;
|
|
7710
8121
|
};
|
|
7711
8122
|
multisort.knownTypes = sortTypes_default;
|
|
@@ -7938,10 +8349,10 @@ var GroupRowsState = class extends BooleanDeepCollectionState {
|
|
|
7938
8349
|
};
|
|
7939
8350
|
|
|
7940
8351
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
7941
|
-
import { useEffect as
|
|
8352
|
+
import { useEffect as useEffect17, useMemo as useMemo7, useRef as useRef18, useState as useState11 } from "react";
|
|
7942
8353
|
|
|
7943
8354
|
// src/components/hooks/useEffectWithChanges.ts
|
|
7944
|
-
import { useEffect as
|
|
8355
|
+
import { useEffect as useEffect16, useRef as useRef17 } from "react";
|
|
7945
8356
|
function useEffectWithChanges(fn, deps) {
|
|
7946
8357
|
const prevRef = useRef17({});
|
|
7947
8358
|
const oldValuesRef = useRef17({});
|
|
@@ -7959,7 +8370,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
7959
8370
|
}
|
|
7960
8371
|
}
|
|
7961
8372
|
prevRef.current = deps;
|
|
7962
|
-
|
|
8373
|
+
useEffect16(() => {
|
|
7963
8374
|
const changes2 = changesRef.current;
|
|
7964
8375
|
const result = fn(changes2, oldValues);
|
|
7965
8376
|
changesRef.current = {};
|
|
@@ -8225,12 +8636,12 @@ function useLoadData() {
|
|
|
8225
8636
|
livePaginationCursor,
|
|
8226
8637
|
cursorId: stateCursorId
|
|
8227
8638
|
} = componentState;
|
|
8228
|
-
const [scrollbars, setScrollbars] =
|
|
8639
|
+
const [scrollbars, setScrollbars] = useState11({
|
|
8229
8640
|
vertical: false,
|
|
8230
8641
|
horizontal: false
|
|
8231
8642
|
});
|
|
8232
8643
|
const scrollbarsRef = useRef18(scrollbars);
|
|
8233
|
-
|
|
8644
|
+
useEffect17(() => {
|
|
8234
8645
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
8235
8646
|
if (!scrollbars2) {
|
|
8236
8647
|
return;
|
|
@@ -8240,7 +8651,7 @@ function useLoadData() {
|
|
|
8240
8651
|
});
|
|
8241
8652
|
return () => notifyScrollbarsChange.destroy();
|
|
8242
8653
|
}, [notifyScrollbarsChange]);
|
|
8243
|
-
|
|
8654
|
+
useEffect17(() => {
|
|
8244
8655
|
if (!livePagination) {
|
|
8245
8656
|
return;
|
|
8246
8657
|
}
|
|
@@ -8254,7 +8665,7 @@ function useLoadData() {
|
|
|
8254
8665
|
});
|
|
8255
8666
|
return () => cancelAnimationFrame(frameId);
|
|
8256
8667
|
}, [livePaginationCursor]);
|
|
8257
|
-
|
|
8668
|
+
useEffect17(() => {
|
|
8258
8669
|
if (!livePagination || livePaginationCursor !== void 0) {
|
|
8259
8670
|
return;
|
|
8260
8671
|
}
|
|
@@ -8268,7 +8679,7 @@ function useLoadData() {
|
|
|
8268
8679
|
});
|
|
8269
8680
|
return () => cancelAnimationFrame(frameId);
|
|
8270
8681
|
}, [dataArray.length, livePaginationCursor]);
|
|
8271
|
-
|
|
8682
|
+
useEffect17(() => {
|
|
8272
8683
|
const state = getComponentState();
|
|
8273
8684
|
const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
|
|
8274
8685
|
if (!scrollbars.vertical && livePagination2) {
|
|
@@ -8318,7 +8729,7 @@ function useLazyLoadRange() {
|
|
|
8318
8729
|
componentActions: actions,
|
|
8319
8730
|
componentState
|
|
8320
8731
|
} = useComponentState();
|
|
8321
|
-
|
|
8732
|
+
useEffect17(() => {
|
|
8322
8733
|
actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
|
|
8323
8734
|
}, [componentState.data, componentState.dataParams]);
|
|
8324
8735
|
const {
|
|
@@ -8354,7 +8765,7 @@ function useLazyLoadRange() {
|
|
|
8354
8765
|
}, cache);
|
|
8355
8766
|
};
|
|
8356
8767
|
const debouncedLoadRange = useMemo7(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
8357
|
-
|
|
8768
|
+
useEffect17(() => {
|
|
8358
8769
|
if (lazyLoad) {
|
|
8359
8770
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
8360
8771
|
latestRenderRangeRef.current = renderRange;
|
|
@@ -8363,7 +8774,7 @@ function useLazyLoadRange() {
|
|
|
8363
8774
|
}
|
|
8364
8775
|
return;
|
|
8365
8776
|
}, [lazyLoadBatchSize, lazyLoad]);
|
|
8366
|
-
|
|
8777
|
+
useEffect17(() => {
|
|
8367
8778
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
8368
8779
|
debouncedLoadRange();
|
|
8369
8780
|
}
|
|
@@ -9813,7 +10224,7 @@ function DataSourceWithContext(props) {
|
|
|
9813
10224
|
if (typeof children === "function") {
|
|
9814
10225
|
children = children(computedValues);
|
|
9815
10226
|
}
|
|
9816
|
-
return /* @__PURE__ */
|
|
10227
|
+
return /* @__PURE__ */ createElement33(Fragment4, null, children);
|
|
9817
10228
|
}
|
|
9818
10229
|
var DataSourceRoot = getComponentStateRoot({
|
|
9819
10230
|
initSetupState,
|
|
@@ -9838,14 +10249,14 @@ function DataSourceCmp({ children }) {
|
|
|
9838
10249
|
globalThis.dataSourceActions = componentActions;
|
|
9839
10250
|
}
|
|
9840
10251
|
useLoadData();
|
|
9841
|
-
return /* @__PURE__ */
|
|
10252
|
+
return /* @__PURE__ */ createElement33(DataSourceContext.Provider, {
|
|
9842
10253
|
value: contextValue
|
|
9843
|
-
}, /* @__PURE__ */
|
|
10254
|
+
}, /* @__PURE__ */ createElement33(DataSourceWithContext, {
|
|
9844
10255
|
children
|
|
9845
10256
|
}));
|
|
9846
10257
|
}
|
|
9847
10258
|
function DataSource(props) {
|
|
9848
|
-
return /* @__PURE__ */
|
|
10259
|
+
return /* @__PURE__ */ createElement33(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement33(DataSourceCmp, {
|
|
9849
10260
|
children: props.children
|
|
9850
10261
|
}));
|
|
9851
10262
|
}
|
|
@@ -10017,9 +10428,9 @@ function getImperativeApi(param) {
|
|
|
10017
10428
|
|
|
10018
10429
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
10019
10430
|
import {
|
|
10020
|
-
useEffect as
|
|
10431
|
+
useEffect as useEffect18,
|
|
10021
10432
|
useRef as useRef19,
|
|
10022
|
-
useState as
|
|
10433
|
+
useState as useState12
|
|
10023
10434
|
} from "react";
|
|
10024
10435
|
var OFFSET = 10;
|
|
10025
10436
|
function getColumnContentMaxWidths(domRef, options) {
|
|
@@ -10086,11 +10497,11 @@ function useAutoSizeColumns() {
|
|
|
10086
10497
|
componentActions,
|
|
10087
10498
|
componentState: { domRef, ready, autoSizeColumnsKey, brain }
|
|
10088
10499
|
} = useComponentState();
|
|
10089
|
-
const [refreshId, setRefreshId] =
|
|
10500
|
+
const [refreshId, setRefreshId] = useState12(0);
|
|
10090
10501
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
10091
10502
|
const getTheKey = useLatest(theKey);
|
|
10092
10503
|
const lastExecutedIdentifierRef = useRef19(null);
|
|
10093
|
-
|
|
10504
|
+
useEffect18(() => {
|
|
10094
10505
|
const key = getTheKey();
|
|
10095
10506
|
if (key == null) {
|
|
10096
10507
|
return;
|
|
@@ -10103,7 +10514,7 @@ function useAutoSizeColumns() {
|
|
|
10103
10514
|
};
|
|
10104
10515
|
return brain.onRenderRangeChange(onChange);
|
|
10105
10516
|
}, [brain]);
|
|
10106
|
-
|
|
10517
|
+
useEffect18(() => {
|
|
10107
10518
|
var _a;
|
|
10108
10519
|
if (theKey == null) {
|
|
10109
10520
|
return;
|
|
@@ -10148,9 +10559,9 @@ function useAutoSizeColumns() {
|
|
|
10148
10559
|
}
|
|
10149
10560
|
|
|
10150
10561
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
10151
|
-
import { useCallback as useCallback14, useEffect as
|
|
10562
|
+
import { useCallback as useCallback14, useEffect as useEffect19, useRef as useRef20 } from "react";
|
|
10152
10563
|
import {
|
|
10153
|
-
createElement as
|
|
10564
|
+
createElement as createElement34
|
|
10154
10565
|
} from "react";
|
|
10155
10566
|
|
|
10156
10567
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
@@ -10187,7 +10598,7 @@ function useCellRendering(param) {
|
|
|
10187
10598
|
computedPinnedStartColumns,
|
|
10188
10599
|
computedPinnedEndColumns,
|
|
10189
10600
|
computedVisibleColumns,
|
|
10190
|
-
|
|
10601
|
+
computedColumnsMap,
|
|
10191
10602
|
rowspan,
|
|
10192
10603
|
toggleGroupRow,
|
|
10193
10604
|
columnSize
|
|
@@ -10223,12 +10634,12 @@ function useCellRendering(param) {
|
|
|
10223
10634
|
rowspan
|
|
10224
10635
|
});
|
|
10225
10636
|
const scrollTopMaxRef = useRef20(0);
|
|
10226
|
-
|
|
10637
|
+
useEffect19(() => {
|
|
10227
10638
|
return brain.onRenderCountChange(() => {
|
|
10228
10639
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
10229
10640
|
});
|
|
10230
10641
|
}, [brain]);
|
|
10231
|
-
|
|
10642
|
+
useEffect19(() => {
|
|
10232
10643
|
return brain.onScrollStop((scrollPosition) => {
|
|
10233
10644
|
const { scrollTop: scrollTop2 } = scrollPosition;
|
|
10234
10645
|
if (scrollTop2 === 0) {
|
|
@@ -10245,7 +10656,7 @@ function useCellRendering(param) {
|
|
|
10245
10656
|
}
|
|
10246
10657
|
});
|
|
10247
10658
|
}, [brain, onScrollToTop, onScrollToBottom]);
|
|
10248
|
-
|
|
10659
|
+
useEffect19(() => {
|
|
10249
10660
|
if (!bodySize.height) {
|
|
10250
10661
|
return;
|
|
10251
10662
|
}
|
|
@@ -10256,7 +10667,7 @@ function useCellRendering(param) {
|
|
|
10256
10667
|
}
|
|
10257
10668
|
}, [!!bodySize.height]);
|
|
10258
10669
|
const [, rerender] = useRerender();
|
|
10259
|
-
|
|
10670
|
+
useEffect19(() => {
|
|
10260
10671
|
rerender();
|
|
10261
10672
|
}, [dataSourceState]);
|
|
10262
10673
|
const renderCell = useCallback14((params) => {
|
|
@@ -10291,16 +10702,16 @@ function useCellRendering(param) {
|
|
|
10291
10702
|
domRef,
|
|
10292
10703
|
width,
|
|
10293
10704
|
column,
|
|
10294
|
-
columnsMap:
|
|
10705
|
+
columnsMap: computedColumnsMap,
|
|
10295
10706
|
rowStyle,
|
|
10296
10707
|
rowClassName
|
|
10297
10708
|
};
|
|
10298
|
-
return /* @__PURE__ */
|
|
10709
|
+
return /* @__PURE__ */ createElement34(InfiniteTableColumnCell, __spreadValues({}, cellProps));
|
|
10299
10710
|
}, [
|
|
10300
10711
|
rowHeight,
|
|
10301
10712
|
getData,
|
|
10302
10713
|
computedVisibleColumns,
|
|
10303
|
-
|
|
10714
|
+
computedColumnsMap,
|
|
10304
10715
|
groupRenderStrategy,
|
|
10305
10716
|
toggleGroupRow,
|
|
10306
10717
|
showZebraRows,
|
|
@@ -10387,10 +10798,10 @@ var MultiRowSelector = class {
|
|
|
10387
10798
|
};
|
|
10388
10799
|
|
|
10389
10800
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
10390
|
-
import { useEffect as
|
|
10801
|
+
import { useEffect as useEffect21 } from "react";
|
|
10391
10802
|
|
|
10392
10803
|
// src/components/hooks/useInterceptedMap.ts
|
|
10393
|
-
import { useEffect as
|
|
10804
|
+
import { useEffect as useEffect20 } from "react";
|
|
10394
10805
|
function interceptMap(map2, fns) {
|
|
10395
10806
|
const { set, delete: deleteKey, clear } = map2;
|
|
10396
10807
|
if (fns.set) {
|
|
@@ -10410,390 +10821,151 @@ function interceptMap(map2, fns) {
|
|
|
10410
10821
|
if (fns.clear || fns.beforeClear) {
|
|
10411
10822
|
map2.clear = () => {
|
|
10412
10823
|
if (fns.beforeClear) {
|
|
10413
|
-
fns.beforeClear(map2);
|
|
10414
|
-
}
|
|
10415
|
-
const result = clear.call(map2);
|
|
10416
|
-
if (fns.clear) {
|
|
10417
|
-
fns.clear();
|
|
10418
|
-
}
|
|
10419
|
-
return result;
|
|
10420
|
-
};
|
|
10421
|
-
}
|
|
10422
|
-
return () => {
|
|
10423
|
-
if (set) {
|
|
10424
|
-
map2.set = set;
|
|
10425
|
-
}
|
|
10426
|
-
if (deleteKey) {
|
|
10427
|
-
map2.delete = deleteKey;
|
|
10428
|
-
}
|
|
10429
|
-
if (clear) {
|
|
10430
|
-
map2.clear = clear;
|
|
10431
|
-
}
|
|
10432
|
-
};
|
|
10433
|
-
}
|
|
10434
|
-
|
|
10435
|
-
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
10436
|
-
function computeColumnGroupsDepths(columnGroups) {
|
|
10437
|
-
const map2 = new Map();
|
|
10438
|
-
columnGroups.forEach((colGroup, colGroupId) => {
|
|
10439
|
-
let parentGroupId = colGroup.columnGroup;
|
|
10440
|
-
let depth = 0;
|
|
10441
|
-
while (parentGroupId) {
|
|
10442
|
-
const parent = columnGroups.get(parentGroupId);
|
|
10443
|
-
if (!parent) {
|
|
10444
|
-
if (false) {
|
|
10445
|
-
console.warn(`Cannot find column group ${parentGroupId}`);
|
|
10446
|
-
}
|
|
10447
|
-
break;
|
|
10448
|
-
}
|
|
10449
|
-
depth++;
|
|
10450
|
-
parentGroupId = parent.columnGroup;
|
|
10451
|
-
}
|
|
10452
|
-
map2.set(colGroupId, depth);
|
|
10453
|
-
});
|
|
10454
|
-
return map2;
|
|
10455
|
-
}
|
|
10456
|
-
|
|
10457
|
-
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
10458
|
-
function useColumnGroups() {
|
|
10459
|
-
const {
|
|
10460
|
-
componentState: {
|
|
10461
|
-
computedColumnGroups,
|
|
10462
|
-
collapsedColumnGroups
|
|
10463
|
-
},
|
|
10464
|
-
componentActions,
|
|
10465
|
-
getComponentState
|
|
10466
|
-
} = useComponentState();
|
|
10467
|
-
useEffect20(() => {
|
|
10468
|
-
const recompute = () => {
|
|
10469
|
-
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
10470
|
-
};
|
|
10471
|
-
const update = rafFn(recompute);
|
|
10472
|
-
return interceptMap(computedColumnGroups, {
|
|
10473
|
-
clear: update,
|
|
10474
|
-
delete: update,
|
|
10475
|
-
set: update
|
|
10476
|
-
});
|
|
10477
|
-
}, [computedColumnGroups]);
|
|
10478
|
-
useEffect20(() => {
|
|
10479
|
-
return interceptMap(collapsedColumnGroups, {
|
|
10480
|
-
set: (key, visibleCol) => {
|
|
10481
|
-
const colIds = key.slice(1);
|
|
10482
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10483
|
-
colIds.forEach((colId) => {
|
|
10484
|
-
columnVisibility[colId] = false;
|
|
10485
|
-
});
|
|
10486
|
-
delete columnVisibility[visibleCol];
|
|
10487
|
-
componentActions.columnVisibility = columnVisibility;
|
|
10488
|
-
},
|
|
10489
|
-
beforeClear: (currentCollapsedGroups) => {
|
|
10490
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10491
|
-
const keys = [...currentCollapsedGroups.keys()];
|
|
10492
|
-
keys.forEach((key) => {
|
|
10493
|
-
const colIds = key.slice(1);
|
|
10494
|
-
colIds.forEach((colId) => {
|
|
10495
|
-
delete columnVisibility[colId];
|
|
10496
|
-
});
|
|
10497
|
-
});
|
|
10498
|
-
componentActions.columnVisibility = columnVisibility;
|
|
10499
|
-
},
|
|
10500
|
-
delete: (key) => {
|
|
10501
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10502
|
-
const colIds = key.slice(1);
|
|
10503
|
-
colIds.forEach((colId) => {
|
|
10504
|
-
delete columnVisibility[colId];
|
|
10505
|
-
});
|
|
10506
|
-
componentActions.columnVisibility = columnVisibility;
|
|
10507
|
-
}
|
|
10508
|
-
});
|
|
10509
|
-
}, [collapsedColumnGroups]);
|
|
10510
|
-
}
|
|
10511
|
-
|
|
10512
|
-
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
10513
|
-
import { useMemo as useMemo8 } from "react";
|
|
10514
|
-
function useColumnRowspan(computedVisibleColumns) {
|
|
10515
|
-
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
10516
|
-
const rowspan = useMemo8(() => {
|
|
10517
|
-
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
10518
|
-
return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
|
|
10519
|
-
const dataArray = getDataSourceState().dataArray;
|
|
10520
|
-
const rowInfo = dataArray[rowIndex];
|
|
10521
|
-
if (!rowInfo) {
|
|
10522
|
-
return 1;
|
|
10523
|
-
}
|
|
10524
|
-
const data = rowInfo.data;
|
|
10525
|
-
const column = computedVisibleColumns[colIndex];
|
|
10526
|
-
if (!column || !column.rowspan) {
|
|
10527
|
-
return 1;
|
|
10528
|
-
}
|
|
10529
|
-
return column.rowspan({
|
|
10530
|
-
column,
|
|
10531
|
-
data,
|
|
10532
|
-
dataArray,
|
|
10533
|
-
rowInfo,
|
|
10534
|
-
rowIndex
|
|
10535
|
-
});
|
|
10536
|
-
} : void 0;
|
|
10537
|
-
}, [computedVisibleColumns]);
|
|
10538
|
-
return rowspan;
|
|
10539
|
-
}
|
|
10540
|
-
|
|
10541
|
-
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
10542
|
-
import { useCallback as useCallback15 } from "react";
|
|
10543
|
-
var debug4 = dbg("useColumnSizeFn");
|
|
10544
|
-
function useColumnSizeFn(columns) {
|
|
10545
|
-
const columnSize = useCallback15((index) => {
|
|
10546
|
-
const column = columns[index];
|
|
10547
|
-
if (false) {
|
|
10548
|
-
debug4("cannot find column at index", index, columns);
|
|
10549
|
-
}
|
|
10550
|
-
return column ? column.computedWidth : 0;
|
|
10551
|
-
}, [columns]);
|
|
10552
|
-
return columnSize;
|
|
10553
|
-
}
|
|
10554
|
-
|
|
10555
|
-
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
10556
|
-
import { useEffect as useEffect23, useMemo as useMemo9 } from "react";
|
|
10557
|
-
|
|
10558
|
-
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
10559
|
-
import {
|
|
10560
|
-
createElement as createElement34
|
|
10561
|
-
} from "react";
|
|
10562
|
-
|
|
10563
|
-
// src/components/DataSource/state/rowInfoStatus.ts
|
|
10564
|
-
var showLoadingIcon = (rowInfo) => {
|
|
10565
|
-
if (rowInfo.dataSourceHasGrouping) {
|
|
10566
|
-
return rowInfo.isGroupRow ? rowInfo.childrenLoading || !rowInfo.selfLoaded : !rowInfo.selfLoaded;
|
|
10567
|
-
}
|
|
10568
|
-
return !rowInfo.selfLoaded;
|
|
10569
|
-
};
|
|
10570
|
-
|
|
10571
|
-
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
10572
|
-
import {
|
|
10573
|
-
createElement as createElement32,
|
|
10574
|
-
useEffect as useEffect21
|
|
10575
|
-
} from "react";
|
|
10576
|
-
import { useState as useState12 } from "react";
|
|
10577
|
-
|
|
10578
|
-
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
10579
|
-
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
10580
|
-
var ExpanderIconCls = "_16lm1iw6 _16lm1iwi _16lm1iwe";
|
|
10581
|
-
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"]] });
|
|
10582
|
-
|
|
10583
|
-
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
10584
|
-
function ExpanderIcon(props) {
|
|
10585
|
-
var _a;
|
|
10586
|
-
const { size = 24, direction = "start" } = props;
|
|
10587
|
-
const [expanded, setExpanded] = useState12((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
10588
|
-
const onClick = () => {
|
|
10589
|
-
var _a2;
|
|
10590
|
-
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
10591
|
-
if (!isControlled("expanded", props)) {
|
|
10592
|
-
setExpanded(!expanded);
|
|
10593
|
-
}
|
|
10594
|
-
};
|
|
10595
|
-
useEffect21(() => {
|
|
10596
|
-
if (isControlled("expanded", props)) {
|
|
10597
|
-
setExpanded(props.expanded);
|
|
10598
|
-
}
|
|
10599
|
-
}, [props.expanded]);
|
|
10600
|
-
return /* @__PURE__ */ createElement32("svg", {
|
|
10601
|
-
"data-name": "expander-icon",
|
|
10602
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10603
|
-
height: `${size}px`,
|
|
10604
|
-
viewBox: "0 0 24 24",
|
|
10605
|
-
width: `${size}px`,
|
|
10606
|
-
style: props.style,
|
|
10607
|
-
onClick,
|
|
10608
|
-
className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
|
|
10609
|
-
direction: direction || "start",
|
|
10610
|
-
expanded
|
|
10611
|
-
}), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`, `InfiniteIcon-expander--${direction === "end" ? "end" : "start"}`)
|
|
10612
|
-
}, /* @__PURE__ */ createElement32("path", {
|
|
10613
|
-
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
10614
|
-
}));
|
|
10615
|
-
}
|
|
10616
|
-
|
|
10617
|
-
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
10618
|
-
import {
|
|
10619
|
-
createElement as createElement33
|
|
10620
|
-
} from "react";
|
|
10621
|
-
|
|
10622
|
-
// src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
|
|
10623
|
-
var LoadingIconCls = "_16lm1iw8 _16lm1iwi _16lm1iwe";
|
|
10624
|
-
|
|
10625
|
-
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
10626
|
-
var LoadingIcon = (props) => {
|
|
10627
|
-
return /* @__PURE__ */ createElement33("svg", {
|
|
10628
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10629
|
-
style: {
|
|
10630
|
-
margin: "auto",
|
|
10631
|
-
display: "block",
|
|
10632
|
-
shapeRendering: "auto"
|
|
10633
|
-
},
|
|
10634
|
-
width: "24px",
|
|
10635
|
-
height: "24px",
|
|
10636
|
-
viewBox: "0 0 100 100",
|
|
10637
|
-
preserveAspectRatio: "xMidYMid",
|
|
10638
|
-
className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
|
|
10639
|
-
}, /* @__PURE__ */ createElement33("circle", {
|
|
10640
|
-
cx: "50",
|
|
10641
|
-
cy: "50",
|
|
10642
|
-
fill: "none",
|
|
10643
|
-
strokeWidth: "10",
|
|
10644
|
-
r: "35",
|
|
10645
|
-
strokeDasharray: "164.93361431346415 56.97787143782138"
|
|
10646
|
-
}, /* @__PURE__ */ createElement33("animateTransform", {
|
|
10647
|
-
attributeName: "transform",
|
|
10648
|
-
type: "rotate",
|
|
10649
|
-
repeatCount: "indefinite",
|
|
10650
|
-
dur: "1s",
|
|
10651
|
-
values: "0 50 50;360 50 50",
|
|
10652
|
-
keyTimes: "0;1"
|
|
10653
|
-
})));
|
|
10654
|
-
};
|
|
10655
|
-
|
|
10656
|
-
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
10657
|
-
function styleForGroupColumn({
|
|
10658
|
-
rowInfo
|
|
10659
|
-
}) {
|
|
10660
|
-
return {
|
|
10661
|
-
[stripVar(ThemeVars.components.Row.groupNesting)]: rowInfo.dataSourceHasGrouping ? rowInfo.isGroupRow ? rowInfo.groupNesting - 1 : rowInfo.groupNesting : 0
|
|
10662
|
-
};
|
|
10663
|
-
}
|
|
10664
|
-
function getGroupColumnRender({
|
|
10665
|
-
groupIndexForColumn,
|
|
10666
|
-
groupRenderStrategy
|
|
10667
|
-
}) {
|
|
10668
|
-
return (renderOptions) => {
|
|
10669
|
-
const { rowInfo, renderBag, column } = renderOptions;
|
|
10670
|
-
let { value: valueToRender, groupIcon, selectionCheckBox } = renderBag;
|
|
10671
|
-
const groupRowInfo = rowInfo;
|
|
10672
|
-
if (groupRenderStrategy === "multi-column") {
|
|
10673
|
-
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting && groupRowInfo.isGroupRow) {
|
|
10674
|
-
return null;
|
|
10675
|
-
}
|
|
10676
|
-
} else if (groupRenderStrategy === "single-column" && !groupRowInfo.isGroupRow) {
|
|
10677
|
-
}
|
|
10678
|
-
return /* @__PURE__ */ createElement34("div", {
|
|
10679
|
-
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)
|
|
10680
|
-
}, groupIcon, selectionCheckBox, /* @__PURE__ */ createElement34("div", {
|
|
10681
|
-
className: cssEllipsisClassName
|
|
10682
|
-
}, valueToRender != null ? valueToRender : null));
|
|
10683
|
-
};
|
|
10684
|
-
}
|
|
10685
|
-
function getGroupColumnRenderGroupIcon({
|
|
10686
|
-
groupIndexForColumn,
|
|
10687
|
-
groupRenderStrategy,
|
|
10688
|
-
toggleGroupRow,
|
|
10689
|
-
initialRenderGroupIcon
|
|
10690
|
-
}) {
|
|
10691
|
-
return (renderOptions) => {
|
|
10692
|
-
var _a, _b, _c;
|
|
10693
|
-
const { rowInfo, value, groupBy, pivotBy, column } = renderOptions;
|
|
10694
|
-
const groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : rowInfo.isGroupRow && ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
|
|
10695
|
-
if (!groupRowInfo) {
|
|
10696
|
-
return null;
|
|
10697
|
-
}
|
|
10698
|
-
const collapsed = groupRowInfo.collapsed;
|
|
10699
|
-
if (groupRenderStrategy === "inline") {
|
|
10700
|
-
if (groupRowInfo.groupCount === 1) {
|
|
10701
|
-
return value;
|
|
10702
|
-
}
|
|
10703
|
-
if (groupRowInfo.groupNesting === groupIndexForColumn && collapsed) {
|
|
10704
|
-
return null;
|
|
10705
|
-
}
|
|
10706
|
-
} else {
|
|
10707
|
-
if (!groupRowInfo.isGroupRow) {
|
|
10708
|
-
return null;
|
|
10824
|
+
fns.beforeClear(map2);
|
|
10709
10825
|
}
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
}
|
|
10826
|
+
const result = clear.call(map2);
|
|
10827
|
+
if (fns.clear) {
|
|
10828
|
+
fns.clear();
|
|
10714
10829
|
}
|
|
10830
|
+
return result;
|
|
10831
|
+
};
|
|
10832
|
+
}
|
|
10833
|
+
return () => {
|
|
10834
|
+
if (set) {
|
|
10835
|
+
map2.set = set;
|
|
10715
10836
|
}
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
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);
|
|
10719
|
-
const isLoading = showLoadingIcon(groupRowInfo);
|
|
10720
|
-
if (isLoading) {
|
|
10721
|
-
icon = /* @__PURE__ */ createElement34(LoadingIcon, null);
|
|
10722
|
-
} else if (showExpanderIcon) {
|
|
10723
|
-
const defaultIcon = /* @__PURE__ */ createElement34(ExpanderIcon, {
|
|
10724
|
-
expanded: !collapsed,
|
|
10725
|
-
direction: column.align === "end" ? "end" : "start",
|
|
10726
|
-
onChange: () => {
|
|
10727
|
-
toggleGroupRow(groupKeys);
|
|
10728
|
-
}
|
|
10729
|
-
});
|
|
10730
|
-
icon = defaultIcon;
|
|
10837
|
+
if (deleteKey) {
|
|
10838
|
+
map2.delete = deleteKey;
|
|
10731
10839
|
}
|
|
10732
|
-
if (
|
|
10733
|
-
|
|
10734
|
-
icon = /* @__PURE__ */ createElement34(RenderHookComponent, {
|
|
10735
|
-
render: initialRenderGroupIcon,
|
|
10736
|
-
renderParam: renderOptions
|
|
10737
|
-
});
|
|
10840
|
+
if (clear) {
|
|
10841
|
+
map2.clear = clear;
|
|
10738
10842
|
}
|
|
10739
|
-
return icon;
|
|
10740
10843
|
};
|
|
10741
10844
|
}
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10759
|
-
initialRenderGroupIcon: userDefinedGroupColumn == null ? void 0 : userDefinedGroupColumn.renderGroupIcon,
|
|
10760
|
-
groupIndexForColumn,
|
|
10761
|
-
toggleGroupRow,
|
|
10762
|
-
groupRenderStrategy
|
|
10763
|
-
})
|
|
10764
|
-
});
|
|
10765
|
-
if (groupColumnFromProps) {
|
|
10766
|
-
if (typeof groupColumnFromProps === "function") {
|
|
10767
|
-
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps(options, toggleGroupRow));
|
|
10768
|
-
} else {
|
|
10769
|
-
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps);
|
|
10845
|
+
|
|
10846
|
+
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
10847
|
+
function computeColumnGroupsDepths(columnGroups) {
|
|
10848
|
+
const map2 = new Map();
|
|
10849
|
+
columnGroups.forEach((colGroup, colGroupId) => {
|
|
10850
|
+
let parentGroupId = colGroup.columnGroup;
|
|
10851
|
+
let depth = 0;
|
|
10852
|
+
while (parentGroupId) {
|
|
10853
|
+
const parent = columnGroups.get(parentGroupId);
|
|
10854
|
+
if (!parent) {
|
|
10855
|
+
if (false) {
|
|
10856
|
+
console.warn(`Cannot find column group ${parentGroupId}`);
|
|
10857
|
+
}
|
|
10858
|
+
break;
|
|
10859
|
+
}
|
|
10860
|
+
depth++;
|
|
10861
|
+
parentGroupId = parent.columnGroup;
|
|
10770
10862
|
}
|
|
10771
|
-
|
|
10772
|
-
return generatedGroupColumn;
|
|
10773
|
-
}
|
|
10774
|
-
function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
10775
|
-
const theGroupColumnFromProps = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : groupColumnFromProps;
|
|
10776
|
-
let generatedGroupColumn = __spreadProps(__spreadValues({
|
|
10777
|
-
header: `Group`,
|
|
10778
|
-
groupByField: options.groupBy.map((g) => g.field),
|
|
10779
|
-
sortable: false,
|
|
10780
|
-
renderSelectionCheckBox: options.selectionMode === "multi-row",
|
|
10781
|
-
style: styleForGroupColumn,
|
|
10782
|
-
render: getGroupColumnRender({
|
|
10783
|
-
groupIndexForColumn: 0,
|
|
10784
|
-
groupRenderStrategy: "single-column"
|
|
10785
|
-
})
|
|
10786
|
-
}, groupColumnFromProps), {
|
|
10787
|
-
renderGroupIcon: getGroupColumnRenderGroupIcon({
|
|
10788
|
-
initialRenderGroupIcon: theGroupColumnFromProps == null ? void 0 : theGroupColumnFromProps.renderGroupIcon,
|
|
10789
|
-
groupIndexForColumn: 0,
|
|
10790
|
-
toggleGroupRow,
|
|
10791
|
-
groupRenderStrategy: "single-column"
|
|
10792
|
-
})
|
|
10863
|
+
map2.set(colGroupId, depth);
|
|
10793
10864
|
});
|
|
10794
|
-
return
|
|
10865
|
+
return map2;
|
|
10866
|
+
}
|
|
10867
|
+
|
|
10868
|
+
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
10869
|
+
function useColumnGroups() {
|
|
10870
|
+
const {
|
|
10871
|
+
componentState: {
|
|
10872
|
+
computedColumnGroups,
|
|
10873
|
+
collapsedColumnGroups
|
|
10874
|
+
},
|
|
10875
|
+
componentActions,
|
|
10876
|
+
getComponentState
|
|
10877
|
+
} = useComponentState();
|
|
10878
|
+
useEffect21(() => {
|
|
10879
|
+
const recompute = () => {
|
|
10880
|
+
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
10881
|
+
};
|
|
10882
|
+
const update = rafFn(recompute);
|
|
10883
|
+
return interceptMap(computedColumnGroups, {
|
|
10884
|
+
clear: update,
|
|
10885
|
+
delete: update,
|
|
10886
|
+
set: update
|
|
10887
|
+
});
|
|
10888
|
+
}, [computedColumnGroups]);
|
|
10889
|
+
useEffect21(() => {
|
|
10890
|
+
return interceptMap(collapsedColumnGroups, {
|
|
10891
|
+
set: (key, visibleCol) => {
|
|
10892
|
+
const colIds = key.slice(1);
|
|
10893
|
+
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10894
|
+
colIds.forEach((colId) => {
|
|
10895
|
+
columnVisibility[colId] = false;
|
|
10896
|
+
});
|
|
10897
|
+
delete columnVisibility[visibleCol];
|
|
10898
|
+
componentActions.columnVisibility = columnVisibility;
|
|
10899
|
+
},
|
|
10900
|
+
beforeClear: (currentCollapsedGroups) => {
|
|
10901
|
+
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10902
|
+
const keys = [...currentCollapsedGroups.keys()];
|
|
10903
|
+
keys.forEach((key) => {
|
|
10904
|
+
const colIds = key.slice(1);
|
|
10905
|
+
colIds.forEach((colId) => {
|
|
10906
|
+
delete columnVisibility[colId];
|
|
10907
|
+
});
|
|
10908
|
+
});
|
|
10909
|
+
componentActions.columnVisibility = columnVisibility;
|
|
10910
|
+
},
|
|
10911
|
+
delete: (key) => {
|
|
10912
|
+
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10913
|
+
const colIds = key.slice(1);
|
|
10914
|
+
colIds.forEach((colId) => {
|
|
10915
|
+
delete columnVisibility[colId];
|
|
10916
|
+
});
|
|
10917
|
+
componentActions.columnVisibility = columnVisibility;
|
|
10918
|
+
}
|
|
10919
|
+
});
|
|
10920
|
+
}, [collapsedColumnGroups]);
|
|
10921
|
+
}
|
|
10922
|
+
|
|
10923
|
+
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
10924
|
+
import { useMemo as useMemo8 } from "react";
|
|
10925
|
+
function useColumnRowspan(computedVisibleColumns) {
|
|
10926
|
+
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
10927
|
+
const rowspan = useMemo8(() => {
|
|
10928
|
+
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
10929
|
+
return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
|
|
10930
|
+
const dataArray = getDataSourceState().dataArray;
|
|
10931
|
+
const rowInfo = dataArray[rowIndex];
|
|
10932
|
+
if (!rowInfo) {
|
|
10933
|
+
return 1;
|
|
10934
|
+
}
|
|
10935
|
+
const data = rowInfo.data;
|
|
10936
|
+
const column = computedVisibleColumns[colIndex];
|
|
10937
|
+
if (!column || !column.rowspan) {
|
|
10938
|
+
return 1;
|
|
10939
|
+
}
|
|
10940
|
+
return column.rowspan({
|
|
10941
|
+
column,
|
|
10942
|
+
data,
|
|
10943
|
+
dataArray,
|
|
10944
|
+
rowInfo,
|
|
10945
|
+
rowIndex
|
|
10946
|
+
});
|
|
10947
|
+
} : void 0;
|
|
10948
|
+
}, [computedVisibleColumns]);
|
|
10949
|
+
return rowspan;
|
|
10950
|
+
}
|
|
10951
|
+
|
|
10952
|
+
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
10953
|
+
import { useCallback as useCallback15 } from "react";
|
|
10954
|
+
var debug4 = dbg("useColumnSizeFn");
|
|
10955
|
+
function useColumnSizeFn(columns) {
|
|
10956
|
+
const columnSize = useCallback15((index) => {
|
|
10957
|
+
const column = columns[index];
|
|
10958
|
+
if (false) {
|
|
10959
|
+
debug4("cannot find column at index", index, columns);
|
|
10960
|
+
}
|
|
10961
|
+
return column ? column.computedWidth : 0;
|
|
10962
|
+
}, [columns]);
|
|
10963
|
+
return columnSize;
|
|
10795
10964
|
}
|
|
10796
10965
|
|
|
10966
|
+
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
10967
|
+
import { useEffect as useEffect23, useMemo as useMemo9 } from "react";
|
|
10968
|
+
|
|
10797
10969
|
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
10798
10970
|
import { useEffect as useEffect22, useRef as useRef21 } from "react";
|
|
10799
10971
|
function useEffectWithRaf(fn, deps) {
|
|
@@ -10981,17 +11153,19 @@ function useColumnsWhenGrouping() {
|
|
|
10981
11153
|
componentState: {
|
|
10982
11154
|
columns,
|
|
10983
11155
|
groupColumn,
|
|
11156
|
+
hideColumnWhenGrouped,
|
|
10984
11157
|
groupRenderStrategy,
|
|
10985
11158
|
pivotColumns,
|
|
10986
11159
|
pivotColumn,
|
|
10987
11160
|
pivotTotalColumnPosition,
|
|
10988
11161
|
pivotGrandTotalColumnPosition
|
|
10989
|
-
}
|
|
11162
|
+
},
|
|
11163
|
+
getComponentState
|
|
10990
11164
|
} = useComponentState();
|
|
10991
11165
|
const toggleGroupRow = useToggleGroupRow();
|
|
10992
11166
|
useEffect23(() => {
|
|
10993
11167
|
const update = () => {
|
|
10994
|
-
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
11168
|
+
const { columns: columnsWhenGrouping, groupColumnIds } = getColumnsWhenGrouping({
|
|
10995
11169
|
columns,
|
|
10996
11170
|
groupColumn,
|
|
10997
11171
|
pivotColumn,
|
|
@@ -11005,6 +11179,23 @@ function useColumnsWhenGrouping() {
|
|
|
11005
11179
|
selectionMode
|
|
11006
11180
|
});
|
|
11007
11181
|
componentActions.columnsWhenGrouping = columnsWhenGrouping;
|
|
11182
|
+
let currentColumnOrder = getComponentState().columnOrder;
|
|
11183
|
+
if (groupColumnIds.length && Array.isArray(currentColumnOrder)) {
|
|
11184
|
+
const colOrder = new Set(currentColumnOrder);
|
|
11185
|
+
let shouldUpdate = false;
|
|
11186
|
+
groupColumnIds.forEach((groupColId) => {
|
|
11187
|
+
if (!colOrder.has(groupColId)) {
|
|
11188
|
+
shouldUpdate = true;
|
|
11189
|
+
currentColumnOrder = [
|
|
11190
|
+
groupColId,
|
|
11191
|
+
...currentColumnOrder
|
|
11192
|
+
];
|
|
11193
|
+
}
|
|
11194
|
+
});
|
|
11195
|
+
if (shouldUpdate) {
|
|
11196
|
+
componentActions.columnOrder = currentColumnOrder;
|
|
11197
|
+
}
|
|
11198
|
+
}
|
|
11008
11199
|
};
|
|
11009
11200
|
update();
|
|
11010
11201
|
return interceptMap(columns, {
|
|
@@ -11017,6 +11208,7 @@ function useColumnsWhenGrouping() {
|
|
|
11017
11208
|
groupBy,
|
|
11018
11209
|
pivotBy,
|
|
11019
11210
|
selectionMode,
|
|
11211
|
+
hideColumnWhenGrouped,
|
|
11020
11212
|
groupColumn,
|
|
11021
11213
|
groupRenderStrategy,
|
|
11022
11214
|
pivotColumns,
|
|
@@ -11041,6 +11233,7 @@ function useHideColumns(groupByMap) {
|
|
|
11041
11233
|
componentState: {
|
|
11042
11234
|
columnTypes,
|
|
11043
11235
|
computedColumns,
|
|
11236
|
+
hideColumnWhenGrouped,
|
|
11044
11237
|
hideEmptyGroupColumns,
|
|
11045
11238
|
groupRenderStrategy
|
|
11046
11239
|
}
|
|
@@ -11130,16 +11323,13 @@ function useHideColumns(groupByMap) {
|
|
|
11130
11323
|
useEffect23(() => {
|
|
11131
11324
|
const isGrouped = groupBy.length > 0;
|
|
11132
11325
|
const currentState = getComponentState();
|
|
11133
|
-
const {
|
|
11134
|
-
if (controlledColumnVisibility) {
|
|
11135
|
-
return;
|
|
11136
|
-
}
|
|
11326
|
+
const { columnVisibility, hideColumnWhenGrouped: hideColumnWhenGrouped2 } = currentState;
|
|
11137
11327
|
const newColumnVisibility = __spreadValues({}, columnVisibility);
|
|
11138
11328
|
let updated = false;
|
|
11139
11329
|
computedColumns.forEach((col, id) => {
|
|
11140
|
-
if (col.defaultHiddenWhenGroupedBy) {
|
|
11330
|
+
if (col.defaultHiddenWhenGroupedBy || hideColumnWhenGrouped2) {
|
|
11141
11331
|
const nowHidden = columnVisibility[id] === false;
|
|
11142
|
-
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);
|
|
11332
|
+
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);
|
|
11143
11333
|
if (nowHidden !== shouldBeHidden) {
|
|
11144
11334
|
updated = true;
|
|
11145
11335
|
if (shouldBeHidden) {
|
|
@@ -11153,7 +11343,13 @@ function useHideColumns(groupByMap) {
|
|
|
11153
11343
|
if (updated) {
|
|
11154
11344
|
componentActions.columnVisibility = newColumnVisibility;
|
|
11155
11345
|
}
|
|
11156
|
-
}, [
|
|
11346
|
+
}, [
|
|
11347
|
+
computedColumns,
|
|
11348
|
+
columnTypes,
|
|
11349
|
+
groupBy,
|
|
11350
|
+
groupByMap,
|
|
11351
|
+
hideColumnWhenGrouped
|
|
11352
|
+
]);
|
|
11157
11353
|
}
|
|
11158
11354
|
function getColumnsWhenGrouping(params) {
|
|
11159
11355
|
const {
|
|
@@ -11170,9 +11366,10 @@ function getColumnsWhenGrouping(params) {
|
|
|
11170
11366
|
columns
|
|
11171
11367
|
} = params;
|
|
11172
11368
|
if (groupRenderStrategy === "inline") {
|
|
11173
|
-
return void 0;
|
|
11369
|
+
return { columns: void 0, groupColumnIds: [] };
|
|
11174
11370
|
}
|
|
11175
11371
|
const computedColumns = new Map();
|
|
11372
|
+
const groupColumnIds = [];
|
|
11176
11373
|
if (groupRenderStrategy === "multi-column") {
|
|
11177
11374
|
groupBy.forEach((groupByForColumn, groupIndexForColumn, arr) => {
|
|
11178
11375
|
const generatedGroupColumn = getColumnForGroupBy({
|
|
@@ -11184,7 +11381,9 @@ function getColumnsWhenGrouping(params) {
|
|
|
11184
11381
|
groupRenderStrategy,
|
|
11185
11382
|
selectionMode
|
|
11186
11383
|
}, toggleGroupRow, groupColumn);
|
|
11187
|
-
|
|
11384
|
+
const groupColumnId = generatedGroupColumn.id || `group-by-${groupByForColumn.field}`;
|
|
11385
|
+
groupColumnIds.push(groupColumnId);
|
|
11386
|
+
computedColumns.set(groupColumnId, generatedGroupColumn);
|
|
11188
11387
|
});
|
|
11189
11388
|
} else if (groupRenderStrategy === "single-column" && groupBy.length) {
|
|
11190
11389
|
const singleGroupColumn = getSingleGroupColumn({
|
|
@@ -11194,7 +11393,9 @@ function getColumnsWhenGrouping(params) {
|
|
|
11194
11393
|
groupRenderStrategy,
|
|
11195
11394
|
selectionMode
|
|
11196
11395
|
}, toggleGroupRow, groupColumn);
|
|
11197
|
-
|
|
11396
|
+
const groupColumnId = singleGroupColumn.id || "group-by";
|
|
11397
|
+
groupColumnIds.push(groupColumnId);
|
|
11398
|
+
computedColumns.set(groupColumnId, singleGroupColumn);
|
|
11198
11399
|
}
|
|
11199
11400
|
if (pivotColumns) {
|
|
11200
11401
|
const columnsByField = {};
|
|
@@ -11241,7 +11442,10 @@ function getColumnsWhenGrouping(params) {
|
|
|
11241
11442
|
computedColumns.set(colId, col);
|
|
11242
11443
|
});
|
|
11243
11444
|
}
|
|
11244
|
-
return
|
|
11445
|
+
return {
|
|
11446
|
+
columns: computedColumns.size ? computedColumns : void 0,
|
|
11447
|
+
groupColumnIds
|
|
11448
|
+
};
|
|
11245
11449
|
}
|
|
11246
11450
|
|
|
11247
11451
|
// src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
|
|
@@ -11301,6 +11505,33 @@ var getComputedPinned = (colId, columnPinning) => {
|
|
|
11301
11505
|
const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
|
|
11302
11506
|
return computedPinned;
|
|
11303
11507
|
};
|
|
11508
|
+
function isGroupColumnSortable(column, columns) {
|
|
11509
|
+
var _a;
|
|
11510
|
+
let sortableColumnOrType = (_a = column.sortable) != null ? _a : column.colType.sortable;
|
|
11511
|
+
if (sortableColumnOrType != null) {
|
|
11512
|
+
return sortableColumnOrType;
|
|
11513
|
+
}
|
|
11514
|
+
if (column.computedSortable === false) {
|
|
11515
|
+
return false;
|
|
11516
|
+
}
|
|
11517
|
+
let groupByField = column.groupByField || [];
|
|
11518
|
+
if (groupByField != null && !Array.isArray(groupByField)) {
|
|
11519
|
+
groupByField = [groupByField];
|
|
11520
|
+
}
|
|
11521
|
+
const fields = (groupByField || []).reduce((acc, field) => {
|
|
11522
|
+
acc[field] = true;
|
|
11523
|
+
return acc;
|
|
11524
|
+
}, {});
|
|
11525
|
+
const groupColumns = [];
|
|
11526
|
+
columns.forEach((col) => {
|
|
11527
|
+
if (col.field && fields[col.field]) {
|
|
11528
|
+
groupColumns.push(col);
|
|
11529
|
+
}
|
|
11530
|
+
});
|
|
11531
|
+
return groupColumns.reduce((sortable, col) => {
|
|
11532
|
+
return sortable && col.computedSortable === true;
|
|
11533
|
+
}, true);
|
|
11534
|
+
}
|
|
11304
11535
|
var getComputedVisibleColumns = ({
|
|
11305
11536
|
columns,
|
|
11306
11537
|
bodySize,
|
|
@@ -11347,12 +11578,16 @@ var getComputedVisibleColumns = ({
|
|
|
11347
11578
|
const result2 = isColumnVisible(columnVisibility, columnVisibilityAssumeVisible, colId);
|
|
11348
11579
|
return result2;
|
|
11349
11580
|
});
|
|
11350
|
-
const
|
|
11581
|
+
const columnIdsToVisibleIndex = new Map();
|
|
11582
|
+
const visibleColumnsArray = visibleColumnOrder.map((columnId, index) => {
|
|
11583
|
+
const col = columns.get(columnId);
|
|
11584
|
+
columnIdsToVisibleIndex.set(columnId, index);
|
|
11585
|
+
return col;
|
|
11586
|
+
});
|
|
11351
11587
|
const sortedMap = (sortInfo != null ? sortInfo : []).reduce((acc, info, index) => {
|
|
11352
11588
|
if (info.id) {
|
|
11353
11589
|
acc[info.id] = { sortInfo: info, index };
|
|
11354
|
-
}
|
|
11355
|
-
if (info.field) {
|
|
11590
|
+
} else if (info.field) {
|
|
11356
11591
|
acc[info.field] = {
|
|
11357
11592
|
sortInfo: info,
|
|
11358
11593
|
index
|
|
@@ -11360,54 +11595,57 @@ var getComputedVisibleColumns = ({
|
|
|
11360
11595
|
}
|
|
11361
11596
|
return acc;
|
|
11362
11597
|
}, {});
|
|
11598
|
+
function getColSize(colId) {
|
|
11599
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11600
|
+
const column = columns.get(colId);
|
|
11601
|
+
const colType = getColumnComputedType(column, columnTypes);
|
|
11602
|
+
const colTypeSizing = {
|
|
11603
|
+
minWidth: colType == null ? void 0 : colType.minWidth,
|
|
11604
|
+
maxWidth: colType == null ? void 0 : colType.maxWidth,
|
|
11605
|
+
width: colType == null ? void 0 : colType.defaultWidth,
|
|
11606
|
+
flex: colType == null ? void 0 : colType.defaultFlex
|
|
11607
|
+
};
|
|
11608
|
+
let colSizing = assignNonNull({
|
|
11609
|
+
width: column == null ? void 0 : column.defaultWidth,
|
|
11610
|
+
flex: column == null ? void 0 : column.defaultFlex,
|
|
11611
|
+
minWidth: column == null ? void 0 : column.minWidth,
|
|
11612
|
+
maxWidth: column == null ? void 0 : column.maxWidth
|
|
11613
|
+
}, columnSizing[colId]);
|
|
11614
|
+
if (colSizing.width != null) {
|
|
11615
|
+
delete colTypeSizing.flex;
|
|
11616
|
+
}
|
|
11617
|
+
if (colSizing.flex != null) {
|
|
11618
|
+
delete colTypeSizing.width;
|
|
11619
|
+
}
|
|
11620
|
+
colSizing = assignNonNull(colTypeSizing, colSizing);
|
|
11621
|
+
const colFlex = (_a = colSizing.flex) != null ? _a : void 0;
|
|
11622
|
+
const colMinWidth = (_c = (_b = colSizing.minWidth) != null ? _b : column == null ? void 0 : column.minWidth) != null ? _c : columnMinWidth;
|
|
11623
|
+
const colMaxWidth = (_e = (_d = colSizing.maxWidth) != null ? _d : column == null ? void 0 : column.maxWidth) != null ? _e : columnMaxWidth;
|
|
11624
|
+
let size = colFlex != void 0 ? void 0 : (_f = colSizing.width) != null ? _f : columnDefaultWidth;
|
|
11625
|
+
if (!size && colFlex == void 0) {
|
|
11626
|
+
size = colMinWidth;
|
|
11627
|
+
}
|
|
11628
|
+
return {
|
|
11629
|
+
size,
|
|
11630
|
+
flex: colFlex,
|
|
11631
|
+
minSize: colMinWidth,
|
|
11632
|
+
maxSize: colMaxWidth
|
|
11633
|
+
};
|
|
11634
|
+
}
|
|
11363
11635
|
const flexResult = computeFlex({
|
|
11364
11636
|
availableSize: Math.max(bodySize.width - (viewportReservedWidth != null ? viewportReservedWidth : 0) - getScrollbarWidth(), 0),
|
|
11365
11637
|
maxSize: columnMaxWidth,
|
|
11366
11638
|
minSize: columnMinWidth,
|
|
11367
|
-
items: visibleColumnOrder.map(
|
|
11368
|
-
var _a, _b, _c, _d, _e, _f;
|
|
11369
|
-
const column = columns.get(colId);
|
|
11370
|
-
const colType = getColumnComputedType(column, columnTypes);
|
|
11371
|
-
const colTypeSizing = {
|
|
11372
|
-
minWidth: colType == null ? void 0 : colType.minWidth,
|
|
11373
|
-
maxWidth: colType == null ? void 0 : colType.maxWidth,
|
|
11374
|
-
width: colType == null ? void 0 : colType.defaultWidth,
|
|
11375
|
-
flex: colType == null ? void 0 : colType.defaultFlex
|
|
11376
|
-
};
|
|
11377
|
-
let colSizing = assignNonNull({
|
|
11378
|
-
width: column == null ? void 0 : column.defaultWidth,
|
|
11379
|
-
flex: column == null ? void 0 : column.defaultFlex,
|
|
11380
|
-
minWidth: column == null ? void 0 : column.minWidth,
|
|
11381
|
-
maxWidth: column == null ? void 0 : column.maxWidth
|
|
11382
|
-
}, columnSizing[colId]);
|
|
11383
|
-
if (colSizing.width != null) {
|
|
11384
|
-
delete colTypeSizing.flex;
|
|
11385
|
-
}
|
|
11386
|
-
if (colSizing.flex != null) {
|
|
11387
|
-
delete colTypeSizing.width;
|
|
11388
|
-
}
|
|
11389
|
-
colSizing = assignNonNull(colTypeSizing, colSizing);
|
|
11390
|
-
const colFlex = (_a = colSizing.flex) != null ? _a : void 0;
|
|
11391
|
-
const colMinWidth = (_c = (_b = colSizing.minWidth) != null ? _b : column == null ? void 0 : column.minWidth) != null ? _c : columnMinWidth;
|
|
11392
|
-
const colMaxWidth = (_e = (_d = colSizing.maxWidth) != null ? _d : column == null ? void 0 : column.maxWidth) != null ? _e : columnMaxWidth;
|
|
11393
|
-
let size = colFlex != void 0 ? void 0 : (_f = colSizing.width) != null ? _f : columnDefaultWidth;
|
|
11394
|
-
if (!size && colFlex == void 0) {
|
|
11395
|
-
size = colMinWidth;
|
|
11396
|
-
}
|
|
11397
|
-
return {
|
|
11398
|
-
size,
|
|
11399
|
-
flex: colFlex,
|
|
11400
|
-
minSize: colMinWidth,
|
|
11401
|
-
maxSize: colMaxWidth
|
|
11402
|
-
};
|
|
11403
|
-
})
|
|
11639
|
+
items: visibleColumnOrder.map(getColSize)
|
|
11404
11640
|
});
|
|
11405
11641
|
const { computedSizes, flexSizes, minSizes, maxSizes } = flexResult;
|
|
11406
11642
|
const computedPinnedStartColumns = [];
|
|
11407
11643
|
const computedPinnedEndColumns = [];
|
|
11408
11644
|
const computedUnpinnedColumns = [];
|
|
11409
11645
|
const computedVisibleColumns = [];
|
|
11646
|
+
computedVisibleColumns.length = visibleColumnOrder.length;
|
|
11410
11647
|
const computedVisibleColumnsMap = new Map();
|
|
11648
|
+
const computedColumnsMap = new Map();
|
|
11411
11649
|
let computedUnpinnedColumnsWidth = 0;
|
|
11412
11650
|
let computedPinnedStartColumnsWidth = 0;
|
|
11413
11651
|
let computedPinnedEndColumnsWidth = 0;
|
|
@@ -11416,7 +11654,7 @@ var getComputedVisibleColumns = ({
|
|
|
11416
11654
|
let totalPinnedStartWidth = 0;
|
|
11417
11655
|
let totalUnpinnedWidth = 0;
|
|
11418
11656
|
let totalPinnedEndWidth = 0;
|
|
11419
|
-
|
|
11657
|
+
visibleColumnsArray.forEach((_c, i) => {
|
|
11420
11658
|
const id = visibleColumnOrder[i];
|
|
11421
11659
|
const computedWidth = computedSizes[i];
|
|
11422
11660
|
const pinned = computedPinnedArray[i] = getComputedPinned(id, columnPinning);
|
|
@@ -11429,39 +11667,55 @@ var getComputedVisibleColumns = ({
|
|
|
11429
11667
|
}
|
|
11430
11668
|
});
|
|
11431
11669
|
const firstPinnedEndAbsoluteOffset = bodySize.width - totalPinnedEndWidth;
|
|
11432
|
-
|
|
11670
|
+
const groupColumns = [];
|
|
11671
|
+
const orderedColumns = new Map();
|
|
11672
|
+
visibleColumnOrder.forEach((id, index) => {
|
|
11673
|
+
const c = visibleColumnsArray[index];
|
|
11674
|
+
orderedColumns.set(id, c);
|
|
11675
|
+
});
|
|
11676
|
+
columns.forEach((c, key) => {
|
|
11677
|
+
if (!orderedColumns.has(key)) {
|
|
11678
|
+
orderedColumns.set(key, c);
|
|
11679
|
+
}
|
|
11680
|
+
});
|
|
11681
|
+
orderedColumns.forEach((c, id) => {
|
|
11433
11682
|
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;
|
|
11434
|
-
|
|
11435
|
-
|
|
11683
|
+
let theComputedVisibleIndex = columnIdsToVisibleIndex.get(id);
|
|
11684
|
+
if (theComputedVisibleIndex == void 0) {
|
|
11685
|
+
theComputedVisibleIndex = -1;
|
|
11686
|
+
}
|
|
11687
|
+
const computedVisible = theComputedVisibleIndex != -1;
|
|
11688
|
+
const nextColumnId = visibleColumnOrder[theComputedVisibleIndex + 1];
|
|
11436
11689
|
const colType = getColumnComputedType(c, columnTypes);
|
|
11437
|
-
const computedVisibleIndex =
|
|
11690
|
+
const computedVisibleIndex = theComputedVisibleIndex;
|
|
11438
11691
|
const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
|
|
11439
11692
|
const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
|
|
11440
11693
|
const computedSorted = !!computedSortInfo;
|
|
11441
11694
|
const computedSortedAsc = computedSorted && computedSortInfo.dir === 1;
|
|
11442
11695
|
const computedSortedDesc = computedSorted && !computedSortedAsc;
|
|
11443
11696
|
const computedSortIndex = (_c = sortingInfo == null ? void 0 : sortingInfo.index) != null ? _c : -1;
|
|
11444
|
-
const
|
|
11445
|
-
const
|
|
11446
|
-
const
|
|
11447
|
-
const
|
|
11448
|
-
const
|
|
11449
|
-
const
|
|
11697
|
+
const colSizeForNonVisibleColumn = computedVisible ? {} : getColSize(id);
|
|
11698
|
+
const computedWidth = computedVisible ? computedSizes[theComputedVisibleIndex] : colSizeForNonVisibleColumn.size || 0;
|
|
11699
|
+
const computedFlex = computedVisible ? flexSizes[theComputedVisibleIndex] || null : null;
|
|
11700
|
+
const computedMinWidth = computedVisible ? minSizes[theComputedVisibleIndex] || 0 : colSizeForNonVisibleColumn.minSize || 0;
|
|
11701
|
+
const computedMaxWidth = computedVisible ? maxSizes[theComputedVisibleIndex] || 1e4 : colSizeForNonVisibleColumn.maxSize || 1e4;
|
|
11702
|
+
const computedPinned = computedVisible ? getComputedPinned(id, columnPinning) : false;
|
|
11703
|
+
const computedLast = computedVisible ? theComputedVisibleIndex === visibleColumnOrder.length - 1 : false;
|
|
11450
11704
|
let computedVisibleIndexInCategory = computedVisibleIndex;
|
|
11451
|
-
const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
|
|
11705
|
+
const computedPinningOffset = computedVisible ? computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth : 0;
|
|
11452
11706
|
if (computedPinned == "start") {
|
|
11453
|
-
computedVisibleIndexInCategory = computedVisibleIndex;
|
|
11707
|
+
computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex : -1;
|
|
11454
11708
|
} else if (computedPinned === "end") {
|
|
11455
|
-
computedVisibleIndexInCategory = computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length);
|
|
11709
|
+
computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length) : -1;
|
|
11456
11710
|
} else {
|
|
11457
|
-
computedVisibleIndexInCategory = computedVisibleIndex - computedPinnedStartColumns.length;
|
|
11711
|
+
computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex - computedPinnedStartColumns.length : -1;
|
|
11458
11712
|
}
|
|
11459
|
-
const computedAbsoluteOffset = computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth;
|
|
11460
|
-
const computedFirstInCategory = computedPinned !== prevPinned;
|
|
11461
|
-
const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
|
|
11713
|
+
const computedAbsoluteOffset = computedVisible ? computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth : -1;
|
|
11714
|
+
const computedFirstInCategory = computedVisible ? computedPinned !== prevPinned : false;
|
|
11715
|
+
const computedLastInCategory = computedVisible ? computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning) : false;
|
|
11462
11716
|
const cssEllipsis = (_e = (_d = c.cssEllipsis) != null ? _d : colType.cssEllipsis) != null ? _e : columnCssEllipsis;
|
|
11463
11717
|
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;
|
|
11464
|
-
const computedFilterValue = filterValueRecord[id] || c.field ? filterValueRecord[c.field] || null : null;
|
|
11718
|
+
const computedFilterValue = computedVisible ? filterValueRecord[id] || c.field ? filterValueRecord[c.field] || null : null : null;
|
|
11465
11719
|
const computedFiltered = computedFilterValue != null;
|
|
11466
11720
|
const computedFilterable = (_l = (_k = c.defaultFilterable) != null ? _k : colType.defaultFilterable) != null ? _l : true;
|
|
11467
11721
|
const computedDataType = c.dataType || colType.dataType || (Array.isArray(c.type) ? c.type[0] : c.type) || "string";
|
|
@@ -11470,14 +11724,16 @@ var getComputedVisibleColumns = ({
|
|
|
11470
11724
|
const field = (_m = c.field) != null ? _m : colType.field;
|
|
11471
11725
|
const valueGetter = (_n = c.valueGetter) != null ? _n : colType.valueGetter;
|
|
11472
11726
|
let sortableColumnOrType = (_o = c.sortable) != null ? _o : colType.sortable;
|
|
11473
|
-
if (sortableColumnOrType == null) {
|
|
11727
|
+
if (sortableColumnOrType == null && !c.groupByField) {
|
|
11474
11728
|
if (field == null && valueGetter == null) {
|
|
11475
11729
|
sortableColumnOrType = false;
|
|
11476
11730
|
}
|
|
11477
11731
|
}
|
|
11478
11732
|
let computedSortable = (_p = sortableColumnOrType != null ? sortableColumnOrType : sortable) != null ? _p : true;
|
|
11479
11733
|
const result2 = __spreadProps(__spreadValues({
|
|
11734
|
+
colType,
|
|
11480
11735
|
align: colType.align,
|
|
11736
|
+
computedVisible,
|
|
11481
11737
|
verticalAlign: colType.verticalAlign,
|
|
11482
11738
|
defaultHiddenWhenGroupedBy: colType.defaultHiddenWhenGroupedBy,
|
|
11483
11739
|
valueGetter,
|
|
@@ -11520,16 +11776,17 @@ var getComputedVisibleColumns = ({
|
|
|
11520
11776
|
computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
|
|
11521
11777
|
computedFirstInCategory,
|
|
11522
11778
|
computedLastInCategory,
|
|
11523
|
-
computedFirst:
|
|
11779
|
+
computedFirst: theComputedVisibleIndex === 0,
|
|
11524
11780
|
computedLast,
|
|
11525
11781
|
toggleSort: () => {
|
|
11526
11782
|
const currentSortInfo = computedSortInfo;
|
|
11527
11783
|
let newColumnSortInfo;
|
|
11784
|
+
const field2 = result2.groupByField ? result2.groupByField : c.field;
|
|
11528
11785
|
if (!currentSortInfo) {
|
|
11529
11786
|
newColumnSortInfo = {
|
|
11530
11787
|
dir: 1,
|
|
11531
11788
|
id,
|
|
11532
|
-
field:
|
|
11789
|
+
field: field2,
|
|
11533
11790
|
type: computedSortType
|
|
11534
11791
|
};
|
|
11535
11792
|
} else {
|
|
@@ -11541,8 +11798,8 @@ var getComputedVisibleColumns = ({
|
|
|
11541
11798
|
});
|
|
11542
11799
|
}
|
|
11543
11800
|
}
|
|
11544
|
-
if (
|
|
11545
|
-
newColumnSortInfo.field =
|
|
11801
|
+
if (field2 && newColumnSortInfo && !newColumnSortInfo.field) {
|
|
11802
|
+
newColumnSortInfo.field = field2;
|
|
11546
11803
|
}
|
|
11547
11804
|
if (c.valueGetter && newColumnSortInfo && !newColumnSortInfo.valueGetter) {
|
|
11548
11805
|
newColumnSortInfo.valueGetter = (data) => c.valueGetter({ data, field: c.field });
|
|
@@ -11569,22 +11826,31 @@ var getComputedVisibleColumns = ({
|
|
|
11569
11826
|
id,
|
|
11570
11827
|
header: (_x = (_w = (_v = c.header) != null ? _v : colType.header) != null ? _w : c.name) != null ? _x : c.field
|
|
11571
11828
|
});
|
|
11572
|
-
|
|
11573
|
-
|
|
11574
|
-
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
|
|
11582
|
-
|
|
11583
|
-
|
|
11584
|
-
|
|
11585
|
-
|
|
11586
|
-
|
|
11587
|
-
|
|
11829
|
+
if (computedVisible) {
|
|
11830
|
+
computedOffset += computedWidth;
|
|
11831
|
+
computedVisibleColumnsMap.set(result2.id, result2);
|
|
11832
|
+
computedVisibleColumns[theComputedVisibleIndex] = result2;
|
|
11833
|
+
if (computedPinned === "start") {
|
|
11834
|
+
computedPinnedStartColumns.push(result2);
|
|
11835
|
+
computedPinnedStartColumnsWidth += result2.computedWidth;
|
|
11836
|
+
}
|
|
11837
|
+
if (computedPinned === "end") {
|
|
11838
|
+
computedPinnedEndColumns.push(result2);
|
|
11839
|
+
computedPinnedEndColumnsWidth += result2.computedWidth;
|
|
11840
|
+
}
|
|
11841
|
+
if (!computedPinned) {
|
|
11842
|
+
computedUnpinnedColumns.push(result2);
|
|
11843
|
+
computedUnpinnedColumnsWidth += result2.computedWidth;
|
|
11844
|
+
}
|
|
11845
|
+
prevPinned = computedPinned;
|
|
11846
|
+
}
|
|
11847
|
+
if (result2.groupByField) {
|
|
11848
|
+
groupColumns.push(result2);
|
|
11849
|
+
}
|
|
11850
|
+
computedColumnsMap.set(result2.id, result2);
|
|
11851
|
+
});
|
|
11852
|
+
groupColumns.forEach((col) => {
|
|
11853
|
+
col.computedSortable = isGroupColumnSortable(col, computedColumnsMap);
|
|
11588
11854
|
});
|
|
11589
11855
|
const computedPinnedStartWidth = pinnedStartMaxWidth != null ? Math.min(pinnedStartMaxWidth, computedPinnedStartColumnsWidth) : computedPinnedStartColumnsWidth;
|
|
11590
11856
|
const computedPinnedEndWidth = pinnedEndMaxWidth != null ? Math.min(pinnedEndMaxWidth, computedPinnedEndColumnsWidth) : computedPinnedEndColumnsWidth;
|
|
@@ -11600,6 +11866,7 @@ var getComputedVisibleColumns = ({
|
|
|
11600
11866
|
computedPinnedEndOffset: computedPinnedStartColumnsWidth + computedUnpinnedColumnsWidth,
|
|
11601
11867
|
computedUnpinnedColumns,
|
|
11602
11868
|
computedVisibleColumns,
|
|
11869
|
+
computedColumnsMap,
|
|
11603
11870
|
computedVisibleColumnsMap,
|
|
11604
11871
|
computedPinnedEndWidth,
|
|
11605
11872
|
computedPinnedStartWidth,
|
|
@@ -11667,7 +11934,8 @@ var useComputedVisibleColumns = ({
|
|
|
11667
11934
|
computedPinnedEndOffset,
|
|
11668
11935
|
computedPinnedEndWidth,
|
|
11669
11936
|
computedPinnedStartWidth,
|
|
11670
|
-
renderSelectionCheckBox
|
|
11937
|
+
renderSelectionCheckBox,
|
|
11938
|
+
computedColumnsMap
|
|
11671
11939
|
} = useMemo10(() => {
|
|
11672
11940
|
return getComputedVisibleColumns({
|
|
11673
11941
|
columns,
|
|
@@ -11720,6 +11988,7 @@ var useComputedVisibleColumns = ({
|
|
|
11720
11988
|
const result = {
|
|
11721
11989
|
renderSelectionCheckBox,
|
|
11722
11990
|
columns,
|
|
11991
|
+
computedColumnsMap,
|
|
11723
11992
|
computedPinnedEndWidth,
|
|
11724
11993
|
computedPinnedStartWidth,
|
|
11725
11994
|
computedRemainingSpace,
|
|
@@ -11827,7 +12096,8 @@ function useComputed() {
|
|
|
11827
12096
|
computedRemainingSpace,
|
|
11828
12097
|
computedPinnedStartWidth,
|
|
11829
12098
|
computedPinnedEndWidth,
|
|
11830
|
-
renderSelectionCheckBox
|
|
12099
|
+
renderSelectionCheckBox,
|
|
12100
|
+
computedColumnsMap
|
|
11831
12101
|
} = useComputedVisibleColumns({
|
|
11832
12102
|
columns,
|
|
11833
12103
|
columnCssEllipsis: componentState.columnCssEllipsis,
|
|
@@ -11871,6 +12141,7 @@ function useComputed() {
|
|
|
11871
12141
|
columnSize,
|
|
11872
12142
|
rowspan,
|
|
11873
12143
|
toggleGroupRow,
|
|
12144
|
+
computedColumnsMap,
|
|
11874
12145
|
renderSelectionCheckBox,
|
|
11875
12146
|
computedPinnedStartOverflow,
|
|
11876
12147
|
computedPinnedEndOverflow,
|
|
@@ -12054,7 +12325,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
12054
12325
|
const valid = useMemo11(() => {
|
|
12055
12326
|
let valid2 = isValidLicense(licenseKey, {
|
|
12056
12327
|
publishedAt: 1624970570587,
|
|
12057
|
-
version: "0.4.
|
|
12328
|
+
version: "0.4.4"
|
|
12058
12329
|
});
|
|
12059
12330
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
12060
12331
|
return true;
|
|
@@ -12234,6 +12505,7 @@ function initSetupState2() {
|
|
|
12234
12505
|
onRowHeightCSSVarChange: buildSubscriptionCallback(),
|
|
12235
12506
|
onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
|
|
12236
12507
|
cellClick: buildSubscriptionCallback(),
|
|
12508
|
+
cellMouseDown: buildSubscriptionCallback(),
|
|
12237
12509
|
keyDown: buildSubscriptionCallback(),
|
|
12238
12510
|
bodySize: {
|
|
12239
12511
|
width: 0,
|
|
@@ -12288,6 +12560,7 @@ var forwardProps4 = (setupState) => {
|
|
|
12288
12560
|
filterEditors: (filterEditors) => __spreadValues(__spreadValues({}, defaultFilterEditors), filterEditors),
|
|
12289
12561
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
12290
12562
|
resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
|
|
12563
|
+
hideColumnWhenGrouped: (hideColumnWhenGrouped) => hideColumnWhenGrouped != null ? hideColumnWhenGrouped : false,
|
|
12291
12564
|
columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
|
|
12292
12565
|
columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 5e3,
|
|
12293
12566
|
columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
|
|
@@ -12364,6 +12637,7 @@ var mapPropsToState2 = (params) => {
|
|
|
12364
12637
|
groupRenderStrategy,
|
|
12365
12638
|
groupBy,
|
|
12366
12639
|
computedColumns,
|
|
12640
|
+
initialColumns: props.columns,
|
|
12367
12641
|
keyboardNavigation: (_a = props.keyboardNavigation) != null ? _a : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
|
|
12368
12642
|
columnHeaderCssEllipsis: (_c = (_b = props.columnHeaderCssEllipsis) != null ? _b : props.columnCssEllipsis) != null ? _c : true,
|
|
12369
12643
|
columnGroupsDepthsMap,
|