@infinite-table/infinite-react 0.4.2 → 0.4.5
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 +63 -41
- package/index.esm.css +41 -41
- package/index.esm.js +1068 -746
- package/index.js +1107 -785
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -4063,8 +4063,7 @@ function getComponentStateRoot(config) {
|
|
|
4063
4063
|
props,
|
|
4064
4064
|
state: state2,
|
|
4065
4065
|
oldState: null,
|
|
4066
|
-
parentState
|
|
4067
|
-
getState: getComponentState
|
|
4066
|
+
parentState
|
|
4068
4067
|
});
|
|
4069
4068
|
propsToStateSetRef.current = new Set([
|
|
4070
4069
|
...propsToStateSetRef.current,
|
|
@@ -4098,8 +4097,7 @@ function getComponentStateRoot(config) {
|
|
|
4098
4097
|
props: getProps(),
|
|
4099
4098
|
state: newState,
|
|
4100
4099
|
oldState: previousState,
|
|
4101
|
-
parentState: parentState2
|
|
4102
|
-
getState: getComponentState
|
|
4100
|
+
parentState: parentState2
|
|
4103
4101
|
});
|
|
4104
4102
|
propsToStateSetRef.current = new Set([
|
|
4105
4103
|
...propsToStateSetRef.current,
|
|
@@ -4260,10 +4258,10 @@ var InfiniteTableFooter = forwardRef3(function InfiniteTableFooter2(props, ref)
|
|
|
4260
4258
|
import {
|
|
4261
4259
|
Fragment as Fragment3,
|
|
4262
4260
|
createContext as createContext5,
|
|
4263
|
-
createElement as
|
|
4261
|
+
createElement as createElement25,
|
|
4264
4262
|
useMemo as useMemo5
|
|
4265
4263
|
} from "react";
|
|
4266
|
-
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";
|
|
4267
4265
|
import { createPortal } from "react-dom";
|
|
4268
4266
|
|
|
4269
4267
|
// src/components/DataSource/defaultFilterTypes.ts
|
|
@@ -4359,6 +4357,9 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
|
|
|
4359
4357
|
if (column.computedLastInCategory) {
|
|
4360
4358
|
result.push(...baseClasses.map((c) => `${c}--last-in-category`));
|
|
4361
4359
|
}
|
|
4360
|
+
if (extraFlags.rowSelected) {
|
|
4361
|
+
result.push(...baseClasses.map((c) => `${c}--row-selected`));
|
|
4362
|
+
}
|
|
4362
4363
|
if (column.computedPinned) {
|
|
4363
4364
|
result.push(...baseClasses.map((c) => `${c}--pinned-${column.computedPinned}`));
|
|
4364
4365
|
} else {
|
|
@@ -4951,11 +4952,49 @@ function shallowEqualObjects(objA, objB, ignoreKeys) {
|
|
|
4951
4952
|
return true;
|
|
4952
4953
|
}
|
|
4953
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
|
+
|
|
4954
4988
|
// src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
|
|
4955
4989
|
var columnOffsetAtIndex4 = stripVar(InternalVars.columnOffsetAtIndex);
|
|
4956
4990
|
var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
|
|
4957
4991
|
var baseZIndexForCells2 = stripVar(InternalVars.baseZIndexForCells);
|
|
4958
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
|
+
}
|
|
4959
4998
|
if (!!pinning1 != !!pinning2) {
|
|
4960
4999
|
return false;
|
|
4961
5000
|
}
|
|
@@ -5022,14 +5061,19 @@ var useColumnPointerEvents = ({
|
|
|
5022
5061
|
function persistColumnOrder(reorderDragResult2) {
|
|
5023
5062
|
const { columnPinning, columnOrder } = reorderDragResult2;
|
|
5024
5063
|
if (!equalPinning(getState().columnPinning, columnPinning)) {
|
|
5025
|
-
console.log("update pinning");
|
|
5026
5064
|
componentActions.columnPinning = columnPinning;
|
|
5027
5065
|
}
|
|
5028
|
-
|
|
5066
|
+
const currentComputedColumnOrder = getComputed().computedColumnOrder;
|
|
5067
|
+
if (JSON.stringify(columnOrder, currentComputedColumnOrder)) {
|
|
5029
5068
|
computedVisibleColumns.forEach((col) => {
|
|
5030
5069
|
setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
|
|
5031
5070
|
});
|
|
5032
|
-
componentActions.columnOrder =
|
|
5071
|
+
componentActions.columnOrder = adjustColumnOrderForAllColumns({
|
|
5072
|
+
newColumnOrder: columnOrder,
|
|
5073
|
+
visibleColumnOrder: getComputed().computedVisibleColumns.map((c) => c.id),
|
|
5074
|
+
existingColumnOrder: currentComputedColumnOrder,
|
|
5075
|
+
dragColumnId: columnId
|
|
5076
|
+
});
|
|
5033
5077
|
}
|
|
5034
5078
|
}
|
|
5035
5079
|
const onPointerMove = (e2) => {
|
|
@@ -5091,18 +5135,269 @@ var useColumnPointerEvents = ({
|
|
|
5091
5135
|
|
|
5092
5136
|
// src/components/InfiniteTable/utils/RenderHookComponent.tsx
|
|
5093
5137
|
import {
|
|
5094
|
-
createElement as
|
|
5138
|
+
createElement as createElement19
|
|
5095
5139
|
} from "react";
|
|
5096
5140
|
|
|
5097
5141
|
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
|
|
5098
5142
|
import {
|
|
5099
5143
|
Fragment as Fragment2,
|
|
5100
5144
|
createContext as createContext4,
|
|
5101
|
-
createElement as
|
|
5145
|
+
createElement as createElement18,
|
|
5102
5146
|
memo as memo8
|
|
5103
5147
|
} from "react";
|
|
5104
5148
|
import { useCallback as useCallback7, useContext as useContext4, useMemo as useMemo4 } from "react";
|
|
5105
5149
|
|
|
5150
|
+
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
5151
|
+
import {
|
|
5152
|
+
createElement as createElement15
|
|
5153
|
+
} from "react";
|
|
5154
|
+
|
|
5155
|
+
// src/components/DataSource/state/rowInfoStatus.ts
|
|
5156
|
+
var showLoadingIcon = (rowInfo) => {
|
|
5157
|
+
if (rowInfo.dataSourceHasGrouping) {
|
|
5158
|
+
return rowInfo.isGroupRow ? rowInfo.childrenLoading || !rowInfo.selfLoaded : !rowInfo.selfLoaded;
|
|
5159
|
+
}
|
|
5160
|
+
return !rowInfo.selfLoaded;
|
|
5161
|
+
};
|
|
5162
|
+
|
|
5163
|
+
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5164
|
+
import {
|
|
5165
|
+
createElement as createElement13,
|
|
5166
|
+
useEffect as useEffect9
|
|
5167
|
+
} from "react";
|
|
5168
|
+
import { useState as useState6 } from "react";
|
|
5169
|
+
|
|
5170
|
+
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
5171
|
+
var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5172
|
+
var ExpanderIconCls = "_16lm1iw6 _16lm1iwi _16lm1iwe";
|
|
5173
|
+
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"]] });
|
|
5174
|
+
|
|
5175
|
+
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
5176
|
+
function ExpanderIcon(props) {
|
|
5177
|
+
var _a;
|
|
5178
|
+
const { size = 24, direction = "start" } = props;
|
|
5179
|
+
const [expanded, setExpanded] = useState6((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
5180
|
+
const onClick = () => {
|
|
5181
|
+
var _a2;
|
|
5182
|
+
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
5183
|
+
if (!isControlled("expanded", props)) {
|
|
5184
|
+
setExpanded(!expanded);
|
|
5185
|
+
}
|
|
5186
|
+
};
|
|
5187
|
+
useEffect9(() => {
|
|
5188
|
+
if (isControlled("expanded", props)) {
|
|
5189
|
+
setExpanded(props.expanded);
|
|
5190
|
+
}
|
|
5191
|
+
}, [props.expanded]);
|
|
5192
|
+
return /* @__PURE__ */ createElement13("svg", {
|
|
5193
|
+
"data-name": "expander-icon",
|
|
5194
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5195
|
+
height: `${size}px`,
|
|
5196
|
+
viewBox: "0 0 24 24",
|
|
5197
|
+
width: `${size}px`,
|
|
5198
|
+
style: props.style,
|
|
5199
|
+
onClick,
|
|
5200
|
+
className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
|
|
5201
|
+
direction: direction || "start",
|
|
5202
|
+
expanded
|
|
5203
|
+
}), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`, `InfiniteIcon-expander--${direction === "end" ? "end" : "start"}`)
|
|
5204
|
+
}, /* @__PURE__ */ createElement13("path", {
|
|
5205
|
+
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
5206
|
+
}));
|
|
5207
|
+
}
|
|
5208
|
+
|
|
5209
|
+
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5210
|
+
import {
|
|
5211
|
+
createElement as createElement14
|
|
5212
|
+
} from "react";
|
|
5213
|
+
|
|
5214
|
+
// src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
|
|
5215
|
+
var LoadingIconCls = "_16lm1iw8 _16lm1iwi _16lm1iwe";
|
|
5216
|
+
|
|
5217
|
+
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
5218
|
+
var LoadingIcon = (props) => {
|
|
5219
|
+
return /* @__PURE__ */ createElement14("svg", {
|
|
5220
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5221
|
+
style: {
|
|
5222
|
+
margin: "auto",
|
|
5223
|
+
display: "block",
|
|
5224
|
+
shapeRendering: "auto"
|
|
5225
|
+
},
|
|
5226
|
+
width: "24px",
|
|
5227
|
+
height: "24px",
|
|
5228
|
+
viewBox: "0 0 100 100",
|
|
5229
|
+
preserveAspectRatio: "xMidYMid",
|
|
5230
|
+
className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
|
|
5231
|
+
}, /* @__PURE__ */ createElement14("circle", {
|
|
5232
|
+
cx: "50",
|
|
5233
|
+
cy: "50",
|
|
5234
|
+
fill: "none",
|
|
5235
|
+
strokeWidth: "10",
|
|
5236
|
+
r: "35",
|
|
5237
|
+
strokeDasharray: "164.93361431346415 56.97787143782138"
|
|
5238
|
+
}, /* @__PURE__ */ createElement14("animateTransform", {
|
|
5239
|
+
attributeName: "transform",
|
|
5240
|
+
type: "rotate",
|
|
5241
|
+
repeatCount: "indefinite",
|
|
5242
|
+
dur: "1s",
|
|
5243
|
+
values: "0 50 50;360 50 50",
|
|
5244
|
+
keyTimes: "0;1"
|
|
5245
|
+
})));
|
|
5246
|
+
};
|
|
5247
|
+
|
|
5248
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
5249
|
+
var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5250
|
+
var GroupRowExpanderCls = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_7pupv0b", center: "_7pupv0c", end: "_7pupv0d" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5251
|
+
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: [] });
|
|
5252
|
+
var RowHoverCls = "_7pupv01";
|
|
5253
|
+
|
|
5254
|
+
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
5255
|
+
function styleForGroupColumn({
|
|
5256
|
+
rowInfo
|
|
5257
|
+
}) {
|
|
5258
|
+
return {
|
|
5259
|
+
[stripVar(ThemeVars.components.Row.groupNesting)]: rowInfo.dataSourceHasGrouping ? rowInfo.isGroupRow ? rowInfo.groupNesting - 1 : rowInfo.groupNesting : 0
|
|
5260
|
+
};
|
|
5261
|
+
}
|
|
5262
|
+
function getGroupColumnRender({
|
|
5263
|
+
groupIndexForColumn,
|
|
5264
|
+
groupRenderStrategy
|
|
5265
|
+
}) {
|
|
5266
|
+
return (renderOptions) => {
|
|
5267
|
+
const { rowInfo, renderBag, column } = renderOptions;
|
|
5268
|
+
let { value: valueToRender, groupIcon, selectionCheckBox } = renderBag;
|
|
5269
|
+
const groupRowInfo = rowInfo;
|
|
5270
|
+
if (groupRenderStrategy === "multi-column") {
|
|
5271
|
+
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting && groupRowInfo.isGroupRow) {
|
|
5272
|
+
return null;
|
|
5273
|
+
}
|
|
5274
|
+
} else if (groupRenderStrategy === "single-column" && !groupRowInfo.isGroupRow) {
|
|
5275
|
+
}
|
|
5276
|
+
return /* @__PURE__ */ createElement15("div", {
|
|
5277
|
+
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)
|
|
5278
|
+
}, groupIcon, selectionCheckBox, /* @__PURE__ */ createElement15("div", {
|
|
5279
|
+
className: cssEllipsisClassName
|
|
5280
|
+
}, valueToRender != null ? valueToRender : null));
|
|
5281
|
+
};
|
|
5282
|
+
}
|
|
5283
|
+
function getGroupColumnRenderGroupIcon({
|
|
5284
|
+
groupIndexForColumn,
|
|
5285
|
+
groupRenderStrategy,
|
|
5286
|
+
toggleGroupRow,
|
|
5287
|
+
initialRenderGroupIcon
|
|
5288
|
+
}) {
|
|
5289
|
+
return (renderOptions) => {
|
|
5290
|
+
var _a, _b, _c;
|
|
5291
|
+
const {
|
|
5292
|
+
rowInfo,
|
|
5293
|
+
value,
|
|
5294
|
+
rootGroupBy: groupBy,
|
|
5295
|
+
pivotBy,
|
|
5296
|
+
column
|
|
5297
|
+
} = renderOptions;
|
|
5298
|
+
const groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : rowInfo.isGroupRow && ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
|
|
5299
|
+
if (!groupRowInfo) {
|
|
5300
|
+
return null;
|
|
5301
|
+
}
|
|
5302
|
+
const collapsed = groupRowInfo.collapsed;
|
|
5303
|
+
if (groupRenderStrategy === "inline") {
|
|
5304
|
+
if (groupRowInfo.groupCount === 1) {
|
|
5305
|
+
return value;
|
|
5306
|
+
}
|
|
5307
|
+
if (groupRowInfo.groupNesting === groupIndexForColumn && collapsed) {
|
|
5308
|
+
return null;
|
|
5309
|
+
}
|
|
5310
|
+
} else {
|
|
5311
|
+
if (!groupRowInfo.isGroupRow) {
|
|
5312
|
+
return null;
|
|
5313
|
+
}
|
|
5314
|
+
if (groupRenderStrategy === "multi-column") {
|
|
5315
|
+
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting) {
|
|
5316
|
+
return null;
|
|
5317
|
+
}
|
|
5318
|
+
}
|
|
5319
|
+
}
|
|
5320
|
+
const groupKeys = groupRowInfo.groupKeys;
|
|
5321
|
+
let icon = null;
|
|
5322
|
+
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);
|
|
5323
|
+
const isLoading = showLoadingIcon(groupRowInfo);
|
|
5324
|
+
if (isLoading) {
|
|
5325
|
+
icon = /* @__PURE__ */ createElement15(LoadingIcon, null);
|
|
5326
|
+
} else if (showExpanderIcon) {
|
|
5327
|
+
const defaultIcon = /* @__PURE__ */ createElement15(ExpanderIcon, {
|
|
5328
|
+
expanded: !collapsed,
|
|
5329
|
+
direction: column.align === "end" ? "end" : "start",
|
|
5330
|
+
onChange: () => {
|
|
5331
|
+
toggleGroupRow(groupKeys);
|
|
5332
|
+
}
|
|
5333
|
+
});
|
|
5334
|
+
icon = defaultIcon;
|
|
5335
|
+
}
|
|
5336
|
+
if (initialRenderGroupIcon) {
|
|
5337
|
+
renderOptions.renderBag.groupIcon = icon;
|
|
5338
|
+
icon = /* @__PURE__ */ createElement15(RenderCellHookComponent, {
|
|
5339
|
+
render: initialRenderGroupIcon,
|
|
5340
|
+
renderParam: renderOptions
|
|
5341
|
+
});
|
|
5342
|
+
}
|
|
5343
|
+
return icon;
|
|
5344
|
+
};
|
|
5345
|
+
}
|
|
5346
|
+
function getColumnForGroupBy(options, toggleGroupRow, groupColumnFromProps) {
|
|
5347
|
+
const { groupByForColumn, groupIndexForColumn, groupRenderStrategy } = options;
|
|
5348
|
+
let userDefinedGroupColumn = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : __spreadValues({}, groupColumnFromProps);
|
|
5349
|
+
if (groupByForColumn.column) {
|
|
5350
|
+
userDefinedGroupColumn = __spreadValues(__spreadValues({}, userDefinedGroupColumn), groupByForColumn.column);
|
|
5351
|
+
}
|
|
5352
|
+
let generatedGroupColumn = __spreadProps(__spreadValues({
|
|
5353
|
+
header: `Group by ${groupByForColumn.field}`,
|
|
5354
|
+
groupByField: groupByForColumn.field,
|
|
5355
|
+
render: getGroupColumnRender({
|
|
5356
|
+
groupIndexForColumn,
|
|
5357
|
+
groupRenderStrategy
|
|
5358
|
+
})
|
|
5359
|
+
}, userDefinedGroupColumn), {
|
|
5360
|
+
renderGroupIcon: getGroupColumnRenderGroupIcon({
|
|
5361
|
+
initialRenderGroupIcon: userDefinedGroupColumn == null ? void 0 : userDefinedGroupColumn.renderGroupIcon,
|
|
5362
|
+
groupIndexForColumn,
|
|
5363
|
+
toggleGroupRow,
|
|
5364
|
+
groupRenderStrategy
|
|
5365
|
+
})
|
|
5366
|
+
});
|
|
5367
|
+
if (groupColumnFromProps) {
|
|
5368
|
+
if (typeof groupColumnFromProps === "function") {
|
|
5369
|
+
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps(options, toggleGroupRow));
|
|
5370
|
+
} else {
|
|
5371
|
+
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps);
|
|
5372
|
+
}
|
|
5373
|
+
}
|
|
5374
|
+
return generatedGroupColumn;
|
|
5375
|
+
}
|
|
5376
|
+
function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
5377
|
+
const theGroupColumnFromProps = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : groupColumnFromProps;
|
|
5378
|
+
const base = {};
|
|
5379
|
+
if (options.sortable != void 0) {
|
|
5380
|
+
base.sortable = options.sortable;
|
|
5381
|
+
}
|
|
5382
|
+
let generatedGroupColumn = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, base), {
|
|
5383
|
+
header: `Group`,
|
|
5384
|
+
groupByField: options.groupBy.map((g) => g.field),
|
|
5385
|
+
renderSelectionCheckBox: options.selectionMode === "multi-row",
|
|
5386
|
+
render: getGroupColumnRender({
|
|
5387
|
+
groupIndexForColumn: 0,
|
|
5388
|
+
groupRenderStrategy: "single-column"
|
|
5389
|
+
})
|
|
5390
|
+
}), groupColumnFromProps), {
|
|
5391
|
+
renderGroupIcon: getGroupColumnRenderGroupIcon({
|
|
5392
|
+
initialRenderGroupIcon: theGroupColumnFromProps == null ? void 0 : theGroupColumnFromProps.renderGroupIcon,
|
|
5393
|
+
groupIndexForColumn: 0,
|
|
5394
|
+
toggleGroupRow,
|
|
5395
|
+
groupRenderStrategy: "single-column"
|
|
5396
|
+
})
|
|
5397
|
+
});
|
|
5398
|
+
return generatedGroupColumn;
|
|
5399
|
+
}
|
|
5400
|
+
|
|
5106
5401
|
// src/components/InfiniteTable/utils/objectValuesExcept.ts
|
|
5107
5402
|
function objectValuesExcept(obj, exceptList) {
|
|
5108
5403
|
const result = [];
|
|
@@ -5114,16 +5409,16 @@ function objectValuesExcept(obj, exceptList) {
|
|
|
5114
5409
|
}
|
|
5115
5410
|
|
|
5116
5411
|
// src/components/InfiniteTable/components/cell.css.ts
|
|
5117
|
-
var
|
|
5412
|
+
var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5118
5413
|
var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw2 _16lm1iw1r _16lm1iw1s _16lm1iwy";
|
|
5119
|
-
var ColumnCellRecipe = (0,
|
|
5414
|
+
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"]] });
|
|
5120
5415
|
var SelectionCheckboxCls = "_1eexc2a7";
|
|
5121
5416
|
|
|
5122
5417
|
// src/components/InfiniteTable/components/CheckBox.tsx
|
|
5123
5418
|
import {
|
|
5124
|
-
createElement as
|
|
5419
|
+
createElement as createElement16
|
|
5125
5420
|
} from "react";
|
|
5126
|
-
import { useEffect as
|
|
5421
|
+
import { useEffect as useEffect10, useRef as useRef11 } from "react";
|
|
5127
5422
|
|
|
5128
5423
|
// src/components/InfiniteTable/components/CheckBox.css.ts
|
|
5129
5424
|
var CheckBoxCls = "_16lm1iwe";
|
|
@@ -5151,10 +5446,10 @@ function InfiniteCheckBoxComponent() {
|
|
|
5151
5446
|
const { componentState, componentActions } = useComponentState();
|
|
5152
5447
|
const { checked, domProps } = componentState;
|
|
5153
5448
|
const inputRef = useRef11(null);
|
|
5154
|
-
|
|
5449
|
+
useEffect10(() => {
|
|
5155
5450
|
inputRef.current.indeterminate = checked == null;
|
|
5156
5451
|
}, [checked]);
|
|
5157
|
-
return /* @__PURE__ */
|
|
5452
|
+
return /* @__PURE__ */ createElement16("input", __spreadProps(__spreadValues({}, domProps), {
|
|
5158
5453
|
className: join(CheckBoxCls, domProps == null ? void 0 : domProps.className),
|
|
5159
5454
|
type: "checkbox",
|
|
5160
5455
|
ref: inputRef,
|
|
@@ -5165,24 +5460,167 @@ function InfiniteCheckBoxComponent() {
|
|
|
5165
5460
|
}));
|
|
5166
5461
|
}
|
|
5167
5462
|
function InfiniteCheckBox(props) {
|
|
5168
|
-
return /* @__PURE__ */
|
|
5463
|
+
return /* @__PURE__ */ createElement16(InfiniteCheckBoxRoot, __spreadValues({}, props), /* @__PURE__ */ createElement16(InfiniteCheckBoxComponent, null));
|
|
5169
5464
|
}
|
|
5170
5465
|
|
|
5171
|
-
// src/components/InfiniteTable/components/InfiniteTableRow/
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
}
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5466
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/columnRendering.tsx
|
|
5467
|
+
function isColumnWithField(c) {
|
|
5468
|
+
return typeof c.field === "string";
|
|
5469
|
+
}
|
|
5470
|
+
function getGroupByColumn(options) {
|
|
5471
|
+
const { column, rowInfo, fieldsToColumn } = options;
|
|
5472
|
+
let groupByColumn = void 0;
|
|
5473
|
+
if (column.groupByField) {
|
|
5474
|
+
if (rowInfo.isGroupRow) {
|
|
5475
|
+
groupByColumn = fieldsToColumn.get(rowInfo.groupBy[rowInfo.groupBy.length - 1]);
|
|
5476
|
+
} else if (column.field) {
|
|
5477
|
+
groupByColumn = fieldsToColumn.get(column.field);
|
|
5478
|
+
}
|
|
5479
|
+
}
|
|
5480
|
+
return groupByColumn;
|
|
5481
|
+
}
|
|
5482
|
+
function getColumnRenderingParams(options) {
|
|
5483
|
+
const { column } = options;
|
|
5484
|
+
const groupByColumn = getGroupByColumn(options);
|
|
5485
|
+
const formattedResult = getFormattedValueContextForCell(__spreadProps(__spreadValues({}, options), {
|
|
5486
|
+
column: groupByColumn || column
|
|
5487
|
+
}));
|
|
5488
|
+
const { formattedValueContext } = formattedResult;
|
|
5489
|
+
return {
|
|
5490
|
+
stylingParam: __spreadValues({
|
|
5491
|
+
column: options.column
|
|
5492
|
+
}, formattedValueContext),
|
|
5493
|
+
formattedValueContext,
|
|
5494
|
+
renderFunctions: {
|
|
5495
|
+
renderGroupIcon: column.renderGroupIcon || (groupByColumn == null ? void 0 : groupByColumn.renderGroupIcon),
|
|
5496
|
+
renderSelectionCheckBox: column.renderSelectionCheckBox,
|
|
5497
|
+
renderValue: column.renderValue || (groupByColumn == null ? void 0 : groupByColumn.renderValue),
|
|
5498
|
+
renderGroupValue: column.renderGroupValue || (groupByColumn == null ? void 0 : groupByColumn.renderGroupValue),
|
|
5499
|
+
renderLeafValue: column.renderLeafValue || (groupByColumn == null ? void 0 : groupByColumn.renderLeafValue)
|
|
5500
|
+
},
|
|
5501
|
+
renderParams: getColumnRenderParam(__spreadProps(__spreadValues({}, options), {
|
|
5502
|
+
formattedValueContext
|
|
5503
|
+
})),
|
|
5504
|
+
groupByColumn
|
|
5505
|
+
};
|
|
5506
|
+
}
|
|
5507
|
+
function getColumnRenderParam(options) {
|
|
5508
|
+
const {
|
|
5509
|
+
column,
|
|
5510
|
+
context,
|
|
5511
|
+
rowInfo,
|
|
5512
|
+
columnsMap,
|
|
5513
|
+
fieldsToColumn,
|
|
5514
|
+
formattedValueContext
|
|
5515
|
+
} = options;
|
|
5516
|
+
const { value } = formattedValueContext;
|
|
5517
|
+
const { api: imperativeApi, getDataSourceState } = context;
|
|
5518
|
+
const { indexInAll: rowIndex } = rowInfo;
|
|
5519
|
+
const dataSourceState = getDataSourceState();
|
|
5520
|
+
const { selectionMode } = dataSourceState;
|
|
5521
|
+
const groupByColumn = getGroupByColumn({ rowInfo, column, fieldsToColumn });
|
|
5522
|
+
const toggleGroupRow = imperativeApi.toggleGroupRow;
|
|
5523
|
+
const renderParam = __spreadProps(__spreadValues({
|
|
5524
|
+
column,
|
|
5525
|
+
columnsMap,
|
|
5526
|
+
fieldsToColumn
|
|
5527
|
+
}, formattedValueContext), {
|
|
5528
|
+
groupByColumn,
|
|
5529
|
+
selectionMode,
|
|
5530
|
+
api: imperativeApi,
|
|
5531
|
+
selectRow: imperativeApi.selectionApi.selectRow,
|
|
5532
|
+
deselectRow: imperativeApi.selectionApi.deselectRow,
|
|
5533
|
+
toggleRowSelection: imperativeApi.selectionApi.toggleRowSelection,
|
|
5534
|
+
renderBag: {
|
|
5535
|
+
value,
|
|
5536
|
+
selectionCheckBox: null,
|
|
5537
|
+
groupIcon: null
|
|
5538
|
+
},
|
|
5539
|
+
selectCurrentRow: () => {
|
|
5540
|
+
return imperativeApi.selectionApi.selectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5541
|
+
},
|
|
5542
|
+
deselectCurrentRow: () => {
|
|
5543
|
+
return imperativeApi.selectionApi.deselectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5544
|
+
},
|
|
5545
|
+
rowIndex,
|
|
5546
|
+
toggleGroupRow,
|
|
5547
|
+
toggleCurrentGroupRow: () => {
|
|
5548
|
+
if (!rowInfo.isGroupRow) {
|
|
5549
|
+
return;
|
|
5550
|
+
}
|
|
5551
|
+
toggleGroupRow(rowInfo.groupKeys);
|
|
5552
|
+
},
|
|
5553
|
+
toggleCurrentGroupRowSelection: () => {
|
|
5554
|
+
if (!rowInfo.isGroupRow) {
|
|
5555
|
+
return;
|
|
5556
|
+
}
|
|
5557
|
+
return imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.isGroupRow ? rowInfo.groupKeys : []);
|
|
5558
|
+
},
|
|
5559
|
+
rootGroupBy: dataSourceState.groupBy,
|
|
5560
|
+
pivotBy: dataSourceState.pivotBy
|
|
5561
|
+
});
|
|
5562
|
+
return renderParam;
|
|
5563
|
+
}
|
|
5564
|
+
function getRawValueForCell(column, rowInfo) {
|
|
5565
|
+
const { data, isGroupRow, dataSourceHasGrouping } = rowInfo;
|
|
5566
|
+
const groupBy = dataSourceHasGrouping ? rowInfo.groupBy : void 0;
|
|
5567
|
+
let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
|
|
5568
|
+
if (column.valueGetter) {
|
|
5569
|
+
if (!rowInfo.isGroupRow && rowInfo.data) {
|
|
5570
|
+
value = column.valueGetter({ data: rowInfo.data, field: column.field });
|
|
5571
|
+
}
|
|
5572
|
+
}
|
|
5573
|
+
return value;
|
|
5574
|
+
}
|
|
5575
|
+
function getFormattedValueParamForCell(rawValue, column, rowInfo, context) {
|
|
5576
|
+
const { rowSelected, indexInAll: rowIndex } = rowInfo;
|
|
5577
|
+
const { activeRowIndex, keyboardNavigation } = context.getState();
|
|
5578
|
+
const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
|
|
5579
|
+
return rowInfo.isGroupRow ? {
|
|
5580
|
+
rowInfo,
|
|
5581
|
+
isGroupRow: rowInfo.isGroupRow,
|
|
5582
|
+
data: rowInfo.data,
|
|
5583
|
+
rowSelected,
|
|
5584
|
+
rowActive,
|
|
5585
|
+
value: rawValue,
|
|
5586
|
+
field: column.field
|
|
5587
|
+
} : {
|
|
5588
|
+
rowInfo,
|
|
5589
|
+
isGroupRow: rowInfo.isGroupRow,
|
|
5590
|
+
data: rowInfo.data,
|
|
5591
|
+
rowSelected,
|
|
5592
|
+
rowActive,
|
|
5593
|
+
value: rawValue,
|
|
5594
|
+
field: column.field
|
|
5595
|
+
};
|
|
5596
|
+
}
|
|
5597
|
+
function getFormattedValueContextForCell(options) {
|
|
5598
|
+
const { column, rowInfo, context } = options;
|
|
5599
|
+
const rawValue = getRawValueForCell(column, rowInfo);
|
|
5600
|
+
const formattedValueContext = getFormattedValueParamForCell(rawValue, column, rowInfo, context);
|
|
5601
|
+
const formattedValue = column.valueFormatter ? column.valueFormatter(formattedValueContext) : rawValue;
|
|
5602
|
+
formattedValueContext.value = formattedValue;
|
|
5603
|
+
return {
|
|
5604
|
+
formattedValue,
|
|
5605
|
+
formattedValueContext
|
|
5606
|
+
};
|
|
5607
|
+
}
|
|
5608
|
+
|
|
5609
|
+
// src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
|
|
5610
|
+
import {
|
|
5611
|
+
Fragment,
|
|
5612
|
+
createElement as createElement17,
|
|
5613
|
+
memo as memo7
|
|
5614
|
+
} from "react";
|
|
5615
|
+
var { rootClassName: rootClassName5 } = internalProps;
|
|
5616
|
+
var InfiniteTableCellClassName = `${rootClassName5}Cell`;
|
|
5617
|
+
var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
|
|
5618
|
+
var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
|
|
5619
|
+
var columnReorderEffectDurationAtIndex2 = stripVar(InternalVars.columnReorderEffectDurationAtIndex);
|
|
5620
|
+
function InfiniteTableCellFn(props) {
|
|
5621
|
+
var _b, _c, _d;
|
|
5622
|
+
const _a = props, {
|
|
5623
|
+
cssEllipsis = true,
|
|
5186
5624
|
virtualized = true,
|
|
5187
5625
|
skipColumnShifting = false,
|
|
5188
5626
|
contentStyle,
|
|
@@ -5190,6 +5628,7 @@ function InfiniteTableCellFn(props) {
|
|
|
5190
5628
|
domRef,
|
|
5191
5629
|
width,
|
|
5192
5630
|
contentClassName,
|
|
5631
|
+
rowId,
|
|
5193
5632
|
afterChildren,
|
|
5194
5633
|
beforeChildren,
|
|
5195
5634
|
cellType,
|
|
@@ -5204,6 +5643,7 @@ function InfiniteTableCellFn(props) {
|
|
|
5204
5643
|
"domRef",
|
|
5205
5644
|
"width",
|
|
5206
5645
|
"contentClassName",
|
|
5646
|
+
"rowId",
|
|
5207
5647
|
"afterChildren",
|
|
5208
5648
|
"beforeChildren",
|
|
5209
5649
|
"cellType",
|
|
@@ -5220,16 +5660,19 @@ function InfiniteTableCellFn(props) {
|
|
|
5220
5660
|
"data-column-id": column.id,
|
|
5221
5661
|
"data-z-index": style.zIndex,
|
|
5222
5662
|
className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls),
|
|
5223
|
-
children: /* @__PURE__ */
|
|
5663
|
+
children: /* @__PURE__ */ createElement17(Fragment, null, beforeChildren, /* @__PURE__ */ createElement17("div", {
|
|
5224
5664
|
className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
|
|
5225
5665
|
style: contentStyle
|
|
5226
5666
|
}, children), afterChildren)
|
|
5227
5667
|
});
|
|
5668
|
+
if (rowId != null) {
|
|
5669
|
+
finalDOMProps["data-row-id"] = `${rowId}`;
|
|
5670
|
+
}
|
|
5228
5671
|
const RenderComponent = cellType === "body" ? (_c = column.components) == null ? void 0 : _c.ColumnCell : (_d = column.components) == null ? void 0 : _d.HeaderCell;
|
|
5229
5672
|
if (RenderComponent) {
|
|
5230
|
-
return /* @__PURE__ */
|
|
5673
|
+
return /* @__PURE__ */ createElement17(RenderComponent, __spreadValues({}, finalDOMProps));
|
|
5231
5674
|
}
|
|
5232
|
-
return /* @__PURE__ */
|
|
5675
|
+
return /* @__PURE__ */ createElement17("div", __spreadProps(__spreadValues({}, finalDOMProps), {
|
|
5233
5676
|
ref: domRef
|
|
5234
5677
|
}));
|
|
5235
5678
|
}
|
|
@@ -5251,7 +5694,7 @@ var defaultRenderSelectionCheckBox = (params) => {
|
|
|
5251
5694
|
if (rowInfo.isGroupRow && !column.groupByField) {
|
|
5252
5695
|
return null;
|
|
5253
5696
|
}
|
|
5254
|
-
return /* @__PURE__ */
|
|
5697
|
+
return /* @__PURE__ */ createElement18(InfiniteCheckBox, {
|
|
5255
5698
|
domProps: {
|
|
5256
5699
|
className: SelectionCheckboxCls
|
|
5257
5700
|
},
|
|
@@ -5269,8 +5712,12 @@ var defaultRenderSelectionCheckBox = (params) => {
|
|
|
5269
5712
|
checked: rowInfo.rowSelected
|
|
5270
5713
|
});
|
|
5271
5714
|
};
|
|
5272
|
-
function
|
|
5273
|
-
|
|
5715
|
+
function applyColumnClassName(columnClassName, param) {
|
|
5716
|
+
const colClassName = columnClassName ? typeof columnClassName === "function" ? columnClassName(param) : columnClassName : void 0;
|
|
5717
|
+
return colClassName;
|
|
5718
|
+
}
|
|
5719
|
+
function applyColumnStyle(existingStyle, columnStyle, param) {
|
|
5720
|
+
return typeof columnStyle === "function" ? __spreadValues(__spreadValues({}, existingStyle), columnStyle(param)) : __spreadValues(__spreadValues({}, existingStyle), columnStyle);
|
|
5274
5721
|
}
|
|
5275
5722
|
function InfiniteTableColumnCellFn(props) {
|
|
5276
5723
|
var _a;
|
|
@@ -5282,48 +5729,44 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5282
5729
|
column,
|
|
5283
5730
|
onMouseLeave,
|
|
5284
5731
|
onMouseEnter,
|
|
5285
|
-
toggleGroupRow,
|
|
5286
5732
|
rowIndex,
|
|
5287
5733
|
rowHeight,
|
|
5288
5734
|
columnsMap,
|
|
5735
|
+
fieldsToColumn,
|
|
5289
5736
|
domRef,
|
|
5290
5737
|
hidden,
|
|
5291
5738
|
showZebraRows
|
|
5292
5739
|
} = props;
|
|
5293
5740
|
if (!column) {
|
|
5294
|
-
return /* @__PURE__ */
|
|
5741
|
+
return /* @__PURE__ */ createElement18("div", {
|
|
5295
5742
|
ref: domRef
|
|
5296
5743
|
}, "no column");
|
|
5297
5744
|
}
|
|
5298
|
-
const {
|
|
5299
|
-
const groupBy = dataSourceHasGrouping ? rowInfo.groupBy : void 0;
|
|
5300
|
-
const groupRowInfo = null;
|
|
5745
|
+
const { rowSelected } = rowInfo;
|
|
5301
5746
|
const { getState, componentActions, imperativeApi } = useInfiniteTable();
|
|
5747
|
+
const { componentState: dataSourceState, getState: getDataSourceState } = useDataSourceContextValue();
|
|
5302
5748
|
const { activeRowIndex, keyboardNavigation } = getState();
|
|
5303
5749
|
const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
}
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
value
|
|
5325
|
-
});
|
|
5326
|
-
}
|
|
5750
|
+
const renderingContext = {
|
|
5751
|
+
getState,
|
|
5752
|
+
getDataSourceState,
|
|
5753
|
+
actions: componentActions,
|
|
5754
|
+
api: imperativeApi
|
|
5755
|
+
};
|
|
5756
|
+
const {
|
|
5757
|
+
stylingParam,
|
|
5758
|
+
renderParams,
|
|
5759
|
+
formattedValueContext,
|
|
5760
|
+
renderFunctions,
|
|
5761
|
+
groupByColumn
|
|
5762
|
+
} = getColumnRenderingParams({
|
|
5763
|
+
column,
|
|
5764
|
+
rowInfo,
|
|
5765
|
+
columnsMap,
|
|
5766
|
+
fieldsToColumn,
|
|
5767
|
+
context: renderingContext
|
|
5768
|
+
});
|
|
5769
|
+
const renderParam = renderParams;
|
|
5327
5770
|
const onClick = useCallback7((event) => {
|
|
5328
5771
|
const colIndex = column.computedVisibleIndex;
|
|
5329
5772
|
getState().cellClick({
|
|
@@ -5331,6 +5774,14 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5331
5774
|
colIndex,
|
|
5332
5775
|
event
|
|
5333
5776
|
});
|
|
5777
|
+
}, [rowIndex, column.computedVisibleIndex, keyboardNavigation]);
|
|
5778
|
+
const onMouseDown = useCallback7((event) => {
|
|
5779
|
+
const colIndex = column.computedVisibleIndex;
|
|
5780
|
+
getState().cellMouseDown({
|
|
5781
|
+
rowIndex,
|
|
5782
|
+
colIndex,
|
|
5783
|
+
event
|
|
5784
|
+
});
|
|
5334
5785
|
if (keyboardNavigation === "row") {
|
|
5335
5786
|
componentActions.activeRowIndex = rowIndex;
|
|
5336
5787
|
return;
|
|
@@ -5339,121 +5790,73 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5339
5790
|
componentActions.activeCellIndex = [rowIndex, colIndex];
|
|
5340
5791
|
}
|
|
5341
5792
|
}, [rowIndex, column.computedVisibleIndex, keyboardNavigation]);
|
|
5342
|
-
const {
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
rowInfo
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
rowInfo,
|
|
5353
|
-
isGroupRow: rowInfo.isGroupRow,
|
|
5354
|
-
data: rowInfo.data,
|
|
5355
|
-
rowActive,
|
|
5356
|
-
value,
|
|
5357
|
-
field: column.field
|
|
5358
|
-
};
|
|
5359
|
-
const stylingRenderParam = __spreadValues({
|
|
5360
|
-
column
|
|
5361
|
-
}, rest);
|
|
5362
|
-
const renderParam = __spreadProps(__spreadValues({
|
|
5363
|
-
column,
|
|
5364
|
-
columnsMap,
|
|
5365
|
-
domRef,
|
|
5366
|
-
groupRowInfo
|
|
5367
|
-
}, rest), {
|
|
5368
|
-
selectionMode,
|
|
5369
|
-
selectRow: imperativeApi.selectionApi.selectRow,
|
|
5370
|
-
deselectRow: imperativeApi.selectionApi.deselectRow,
|
|
5371
|
-
toggleRowSelection: imperativeApi.selectionApi.toggleRowSelection,
|
|
5372
|
-
renderBag: {
|
|
5373
|
-
value,
|
|
5374
|
-
selectionCheckBox: null,
|
|
5375
|
-
groupIcon: null
|
|
5376
|
-
},
|
|
5377
|
-
selectCurrentRow: useCallback7(() => {
|
|
5378
|
-
return imperativeApi.selectionApi.selectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5379
|
-
}, [rowInfo]),
|
|
5380
|
-
deselectCurrentRow: useCallback7(() => {
|
|
5381
|
-
return imperativeApi.selectionApi.deselectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
|
|
5382
|
-
}, [rowInfo]),
|
|
5383
|
-
rowIndex,
|
|
5384
|
-
toggleGroupRow,
|
|
5385
|
-
toggleCurrentGroupRow: useCallback7(() => {
|
|
5386
|
-
if (!rowInfo.isGroupRow) {
|
|
5387
|
-
return;
|
|
5388
|
-
}
|
|
5389
|
-
toggleGroupRow(rowInfo.groupKeys);
|
|
5390
|
-
}, [rowInfo]),
|
|
5391
|
-
toggleCurrentGroupRowSelection: useCallback7(() => {
|
|
5392
|
-
if (!rowInfo.isGroupRow) {
|
|
5393
|
-
return;
|
|
5394
|
-
}
|
|
5395
|
-
return imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.isGroupRow ? rowInfo.groupKeys : []);
|
|
5396
|
-
}, [rowInfo]),
|
|
5397
|
-
groupBy: computedDataSource.groupBy,
|
|
5398
|
-
pivotBy: computedDataSource.pivotBy
|
|
5399
|
-
});
|
|
5793
|
+
const { selectionMode } = dataSourceState;
|
|
5794
|
+
renderParam.domRef = domRef;
|
|
5795
|
+
renderParam.selectCurrentRow = useCallback7(renderParam.selectCurrentRow, [
|
|
5796
|
+
rowInfo
|
|
5797
|
+
]);
|
|
5798
|
+
renderParam.deselectCurrentRow = useCallback7(renderParam.deselectCurrentRow, [
|
|
5799
|
+
rowInfo
|
|
5800
|
+
]);
|
|
5801
|
+
renderParam.toggleCurrentGroupRow = useCallback7(renderParam.toggleCurrentGroupRow, [rowInfo]);
|
|
5802
|
+
renderParam.toggleCurrentGroupRowSelection = useCallback7(renderParam.toggleCurrentGroupRowSelection, [rowInfo]);
|
|
5400
5803
|
const renderChildren = useCallback7(() => {
|
|
5401
5804
|
if (hidden) {
|
|
5402
5805
|
return null;
|
|
5403
5806
|
}
|
|
5404
|
-
if (
|
|
5405
|
-
renderParam.renderBag.groupIcon = /* @__PURE__ */
|
|
5406
|
-
render:
|
|
5807
|
+
if (renderFunctions.renderGroupIcon) {
|
|
5808
|
+
renderParam.renderBag.groupIcon = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5809
|
+
render: renderFunctions.renderGroupIcon,
|
|
5407
5810
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5408
5811
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5409
5812
|
})
|
|
5410
5813
|
});
|
|
5411
5814
|
}
|
|
5412
|
-
if (
|
|
5413
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
5815
|
+
if (renderFunctions.renderSelectionCheckBox && selectionMode == "multi-row") {
|
|
5816
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5414
5817
|
render: defaultRenderSelectionCheckBox,
|
|
5415
5818
|
renderParam
|
|
5416
5819
|
});
|
|
5417
|
-
if (
|
|
5418
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
5419
|
-
render:
|
|
5820
|
+
if (renderFunctions.renderSelectionCheckBox !== true) {
|
|
5821
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5822
|
+
render: renderFunctions.renderSelectionCheckBox,
|
|
5420
5823
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5421
5824
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5422
5825
|
})
|
|
5423
5826
|
});
|
|
5424
5827
|
}
|
|
5425
5828
|
}
|
|
5426
|
-
if (
|
|
5427
|
-
renderParam.renderBag.value = /* @__PURE__ */
|
|
5428
|
-
render:
|
|
5829
|
+
if (renderFunctions.renderValue) {
|
|
5830
|
+
renderParam.renderBag.value = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5831
|
+
render: renderFunctions.renderValue,
|
|
5429
5832
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5430
5833
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5431
5834
|
})
|
|
5432
5835
|
});
|
|
5433
5836
|
}
|
|
5434
|
-
if (rowInfo.isGroupRow &&
|
|
5435
|
-
renderParam.renderBag.value = /* @__PURE__ */
|
|
5436
|
-
render:
|
|
5837
|
+
if (rowInfo.isGroupRow && renderFunctions.renderGroupValue) {
|
|
5838
|
+
renderParam.renderBag.value = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5839
|
+
render: renderFunctions.renderGroupValue,
|
|
5437
5840
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5438
5841
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5439
5842
|
})
|
|
5440
5843
|
});
|
|
5441
5844
|
}
|
|
5442
|
-
if (!rowInfo.isGroupRow &&
|
|
5443
|
-
renderParam.renderBag.value = /* @__PURE__ */
|
|
5444
|
-
render:
|
|
5845
|
+
if (!rowInfo.isGroupRow && renderFunctions.renderLeafValue) {
|
|
5846
|
+
renderParam.renderBag.value = /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5847
|
+
render: renderFunctions.renderLeafValue,
|
|
5445
5848
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
5446
5849
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
5447
5850
|
})
|
|
5448
5851
|
});
|
|
5449
5852
|
}
|
|
5450
5853
|
if (column.render) {
|
|
5451
|
-
return /* @__PURE__ */
|
|
5854
|
+
return /* @__PURE__ */ createElement18(RenderCellHookComponent, {
|
|
5452
5855
|
render: column.render,
|
|
5453
5856
|
renderParam
|
|
5454
5857
|
});
|
|
5455
5858
|
}
|
|
5456
|
-
return /* @__PURE__ */
|
|
5859
|
+
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);
|
|
5457
5860
|
}, [
|
|
5458
5861
|
column,
|
|
5459
5862
|
hidden,
|
|
@@ -5461,16 +5864,31 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5461
5864
|
renderBag: true
|
|
5462
5865
|
})
|
|
5463
5866
|
]);
|
|
5464
|
-
const rowPropsAndStyleArgs = __spreadProps(__spreadValues({},
|
|
5867
|
+
const rowPropsAndStyleArgs = __spreadProps(__spreadValues({}, formattedValueContext), {
|
|
5465
5868
|
rowIndex
|
|
5466
5869
|
});
|
|
5467
5870
|
const rowComputedClassName = typeof rowClassName === "function" ? rowClassName(rowPropsAndStyleArgs) : rowClassName;
|
|
5468
|
-
|
|
5871
|
+
let colClassName = void 0;
|
|
5872
|
+
if (groupByColumn == null ? void 0 : groupByColumn.className) {
|
|
5873
|
+
colClassName = applyColumnClassName(groupByColumn.className, stylingParam);
|
|
5874
|
+
}
|
|
5875
|
+
if (column.className) {
|
|
5876
|
+
colClassName = join(colClassName, applyColumnClassName(column.className, stylingParam));
|
|
5877
|
+
}
|
|
5469
5878
|
let style;
|
|
5879
|
+
if (rowInfo.dataSourceHasGrouping && column.groupByField) {
|
|
5880
|
+
style = styleForGroupColumn({ rowInfo });
|
|
5881
|
+
}
|
|
5470
5882
|
if (rowStyle) {
|
|
5471
5883
|
style = typeof rowStyle === "function" ? __spreadValues(__spreadValues({}, style), rowStyle(rowPropsAndStyleArgs)) : __spreadValues(__spreadValues({}, style), rowStyle);
|
|
5472
5884
|
}
|
|
5473
|
-
|
|
5885
|
+
if (groupByColumn == null ? void 0 : groupByColumn.style) {
|
|
5886
|
+
style = applyColumnStyle(style, groupByColumn.style, stylingParam);
|
|
5887
|
+
}
|
|
5888
|
+
if (column.style) {
|
|
5889
|
+
style = applyColumnStyle(style, column.style, stylingParam);
|
|
5890
|
+
}
|
|
5891
|
+
style = style || {};
|
|
5474
5892
|
style.height = rowHeight;
|
|
5475
5893
|
style.zIndex = `var(${columnZIndexAtIndex4}-${column.computedVisibleIndex})`;
|
|
5476
5894
|
const memoizedStyle = useMemo4(() => style, [!style ? null : JSON.stringify(style)]);
|
|
@@ -5481,15 +5899,17 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
5481
5899
|
cellType: "body",
|
|
5482
5900
|
column,
|
|
5483
5901
|
width,
|
|
5902
|
+
rowId: rowInfo.id,
|
|
5484
5903
|
style: memoizedStyle,
|
|
5485
5904
|
onMouseLeave,
|
|
5486
5905
|
onMouseEnter,
|
|
5487
5906
|
onClick,
|
|
5907
|
+
onMouseDown,
|
|
5488
5908
|
cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
|
|
5489
5909
|
className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false, zebra, rowActive, rowSelected }), colClassName, rowComputedClassName),
|
|
5490
5910
|
renderChildren
|
|
5491
5911
|
};
|
|
5492
|
-
return /* @__PURE__ */
|
|
5912
|
+
return /* @__PURE__ */ createElement18(InfiniteTableCell, __spreadValues({}, cellProps));
|
|
5493
5913
|
}
|
|
5494
5914
|
var InfiniteTableColumnCell = memo8(InfiniteTableColumnCellFn);
|
|
5495
5915
|
function useInfiniteColumnCell() {
|
|
@@ -5504,18 +5924,18 @@ function RenderHookComponent(props) {
|
|
|
5504
5924
|
}
|
|
5505
5925
|
function RenderCellHookComponent(props) {
|
|
5506
5926
|
const ContextProvider = InfiniteTableColumnCellContext.Provider;
|
|
5507
|
-
return /* @__PURE__ */
|
|
5927
|
+
return /* @__PURE__ */ createElement19(ContextProvider, {
|
|
5508
5928
|
value: props.renderParam
|
|
5509
|
-
}, /* @__PURE__ */
|
|
5929
|
+
}, /* @__PURE__ */ createElement19(RenderHookComponent, {
|
|
5510
5930
|
render: props.render,
|
|
5511
5931
|
renderParam: props.renderParam
|
|
5512
5932
|
}));
|
|
5513
5933
|
}
|
|
5514
5934
|
function RenderHeaderCellHookComponent(props) {
|
|
5515
5935
|
const ContextProvider = InfiniteTableHeaderCellContext.Provider;
|
|
5516
|
-
return /* @__PURE__ */
|
|
5936
|
+
return /* @__PURE__ */ createElement19(ContextProvider, {
|
|
5517
5937
|
value: props.renderParam
|
|
5518
|
-
}, /* @__PURE__ */
|
|
5938
|
+
}, /* @__PURE__ */ createElement19(RenderHookComponent, {
|
|
5519
5939
|
render: props.render,
|
|
5520
5940
|
renderParam: props.renderParam
|
|
5521
5941
|
}));
|
|
@@ -5523,7 +5943,7 @@ function RenderHeaderCellHookComponent(props) {
|
|
|
5523
5943
|
|
|
5524
5944
|
// src/components/InfiniteTable/components/FilterEditors.tsx
|
|
5525
5945
|
import {
|
|
5526
|
-
createElement as
|
|
5946
|
+
createElement as createElement20
|
|
5527
5947
|
} from "react";
|
|
5528
5948
|
function getFilterEditors() {
|
|
5529
5949
|
return {
|
|
@@ -5533,7 +5953,7 @@ function getFilterEditors() {
|
|
|
5533
5953
|
}
|
|
5534
5954
|
var defaultFilterEditors = getFilterEditors();
|
|
5535
5955
|
function StringFilterEditor(props) {
|
|
5536
|
-
return /* @__PURE__ */
|
|
5956
|
+
return /* @__PURE__ */ createElement20("input", {
|
|
5537
5957
|
"aria-label": `Filter for ${props.ariaLabel}`,
|
|
5538
5958
|
type: "text",
|
|
5539
5959
|
value: props.filterValue,
|
|
@@ -5544,7 +5964,7 @@ function StringFilterEditor(props) {
|
|
|
5544
5964
|
});
|
|
5545
5965
|
}
|
|
5546
5966
|
function NumberFilterEditor(props) {
|
|
5547
|
-
return /* @__PURE__ */
|
|
5967
|
+
return /* @__PURE__ */ createElement20("input", {
|
|
5548
5968
|
"aria-label": `Filter for ${props.ariaLabel}`,
|
|
5549
5969
|
type: "number",
|
|
5550
5970
|
value: props.filterValue,
|
|
@@ -5561,24 +5981,24 @@ function NumberFilterEditor(props) {
|
|
|
5561
5981
|
|
|
5562
5982
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
5563
5983
|
import {
|
|
5564
|
-
createElement as
|
|
5984
|
+
createElement as createElement21
|
|
5565
5985
|
} from "react";
|
|
5566
|
-
import { useEffect as
|
|
5986
|
+
import { useEffect as useEffect11, useState as useState7 } from "react";
|
|
5567
5987
|
|
|
5568
5988
|
// src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
|
|
5569
|
-
var
|
|
5989
|
+
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
5570
5990
|
var CellCls = "_1eexc2a5 _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw2 _16lm1iw1r _16lm1iw1s _16lm1iwy";
|
|
5571
|
-
var HeaderCellContentRecipe = (0,
|
|
5991
|
+
var HeaderCellContentRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob11e _16lm1iw10 _16lm1iw12 _16lm1iwu _16lm1iw1f _16lm1iw1h", variantClassNames: { filtered: { false: "_12zfob11f", true: "_12zfob11g" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5572
5992
|
var HeaderCellProxy = "_12zfob1k _16lm1iw1s _16lm1iw1t _16lm1iw1m";
|
|
5573
|
-
var HeaderCellRecipe = (0,
|
|
5574
|
-
var HeaderClsRecipe = (0,
|
|
5993
|
+
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"]] });
|
|
5994
|
+
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"]] });
|
|
5575
5995
|
var HeaderFilterCls = "_12zfob11j _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw1";
|
|
5576
5996
|
var HeaderFilterEditorCls = "_16lm1iw12 _16lm1iw10";
|
|
5577
5997
|
var HeaderGroupCls = "_12zfob11i _16lm1iwu _16lm1iw1f _16lm1iw1h";
|
|
5578
5998
|
var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
|
|
5579
5999
|
var HeaderSortIconCls = "_16lm1iw1";
|
|
5580
6000
|
var HeaderSortIconIndexCls = "_12zfob14";
|
|
5581
|
-
var HeaderSortIconRecipe = (0,
|
|
6001
|
+
var HeaderSortIconRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5582
6002
|
var HeaderWrapperCls = "_12zfob11h _16lm1iw1m _16lm1iw1 _16lm1iwu _16lm1iw1f";
|
|
5583
6003
|
|
|
5584
6004
|
// src/components/InfiniteTable/components/icons/SortIcon.tsx
|
|
@@ -5590,8 +6010,8 @@ var defaultLineStyle = {
|
|
|
5590
6010
|
var InfiniteTableIconClassName = "InfiniteTableIcon";
|
|
5591
6011
|
function SortIcon(props) {
|
|
5592
6012
|
var _a;
|
|
5593
|
-
const [rendered, setRendered] =
|
|
5594
|
-
const [opacity, setOpacity] =
|
|
6013
|
+
const [rendered, setRendered] = useState7(true);
|
|
6014
|
+
const [opacity, setOpacity] = useState7(0);
|
|
5595
6015
|
const { direction, lineWidth = 1, style, className, index } = props;
|
|
5596
6016
|
const showIndex = index != null && index > 0;
|
|
5597
6017
|
const size = (_a = props.size) != null ? _a : 16;
|
|
@@ -5605,7 +6025,7 @@ function SortIcon(props) {
|
|
|
5605
6025
|
}), props.lineStyle), {
|
|
5606
6026
|
opacity
|
|
5607
6027
|
});
|
|
5608
|
-
|
|
6028
|
+
useEffect11(() => {
|
|
5609
6029
|
const newOpacity = direction != 0 ? 1 : 0;
|
|
5610
6030
|
if (!rendered && newOpacity) {
|
|
5611
6031
|
setRendered(true);
|
|
@@ -5635,39 +6055,39 @@ function SortIcon(props) {
|
|
|
5635
6055
|
if (direction === -1) {
|
|
5636
6056
|
indexStyle.top = "100%";
|
|
5637
6057
|
}
|
|
5638
|
-
return /* @__PURE__ */
|
|
6058
|
+
return /* @__PURE__ */ createElement21("div", {
|
|
5639
6059
|
style: __spreadProps(__spreadValues({}, style), { width: size }),
|
|
5640
6060
|
className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
|
|
5641
|
-
}, showIndex ? /* @__PURE__ */
|
|
6061
|
+
}, showIndex ? /* @__PURE__ */ createElement21("div", {
|
|
5642
6062
|
"data-name": "index",
|
|
5643
6063
|
style: indexStyle,
|
|
5644
6064
|
className: HeaderSortIconIndexCls
|
|
5645
|
-
}, index) : null, /* @__PURE__ */
|
|
6065
|
+
}, index) : null, /* @__PURE__ */ createElement21("div", {
|
|
5646
6066
|
style: __spreadValues({ width: sizes[0] }, lineStyle),
|
|
5647
6067
|
onTransitionEnd
|
|
5648
|
-
}), /* @__PURE__ */
|
|
6068
|
+
}), /* @__PURE__ */ createElement21("div", {
|
|
5649
6069
|
style: __spreadValues({ width: sizes[1] }, lineStyle)
|
|
5650
|
-
}), /* @__PURE__ */
|
|
6070
|
+
}), /* @__PURE__ */ createElement21("div", {
|
|
5651
6071
|
style: __spreadValues({ width: sizes[2] }, lineStyle)
|
|
5652
6072
|
}));
|
|
5653
6073
|
}
|
|
5654
6074
|
|
|
5655
6075
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx
|
|
5656
6076
|
import {
|
|
5657
|
-
createElement as
|
|
6077
|
+
createElement as createElement22
|
|
5658
6078
|
} from "react";
|
|
5659
|
-
import { useEffect as
|
|
6079
|
+
import { useEffect as useEffect12, useState as useState8 } from "react";
|
|
5660
6080
|
var { rootClassName: rootClassName7 } = internalProps;
|
|
5661
6081
|
var InfiniteTableColumnHeaderFilterClassName = `${rootClassName7}HeaderCell__filter`;
|
|
5662
6082
|
var stopPropagation = (e) => e.stopPropagation();
|
|
5663
6083
|
function InfiniteTableColumnHeaderFilter(props) {
|
|
5664
6084
|
var _a, _b, _c, _d;
|
|
5665
|
-
const [theValue, setTheValue] =
|
|
6085
|
+
const [theValue, setTheValue] = useState8((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
|
|
5666
6086
|
const onInputChange = (filterValue) => {
|
|
5667
6087
|
setTheValue(filterValue);
|
|
5668
6088
|
props.onChange(filterValue);
|
|
5669
6089
|
};
|
|
5670
|
-
|
|
6090
|
+
useEffect12(() => {
|
|
5671
6091
|
var _a2;
|
|
5672
6092
|
if (props.columnFilterValue) {
|
|
5673
6093
|
if (theValue !== props.columnFilterValue.filterValue) {
|
|
@@ -5694,15 +6114,15 @@ function InfiniteTableColumnHeaderFilter(props) {
|
|
|
5694
6114
|
onChange: onInputChange
|
|
5695
6115
|
};
|
|
5696
6116
|
const FilterEditor = props.filterEditor;
|
|
5697
|
-
return /* @__PURE__ */
|
|
6117
|
+
return /* @__PURE__ */ createElement22("div", {
|
|
5698
6118
|
onPointerUp: stopPropagation,
|
|
5699
6119
|
onPointerDown: stopPropagation,
|
|
5700
6120
|
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
|
|
5701
6121
|
style: { height: props.columnHeaderHeight }
|
|
5702
|
-
}, FilterEditor ? /* @__PURE__ */
|
|
6122
|
+
}, FilterEditor ? /* @__PURE__ */ createElement22(FilterEditor, __spreadValues({}, filterEditorProps)) : null);
|
|
5703
6123
|
}
|
|
5704
6124
|
function InfiniteTableColumnHeaderFilterEmpty() {
|
|
5705
|
-
return /* @__PURE__ */
|
|
6125
|
+
return /* @__PURE__ */ createElement22("div", {
|
|
5706
6126
|
onPointerUp: stopPropagation,
|
|
5707
6127
|
onPointerDown: stopPropagation,
|
|
5708
6128
|
className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
|
|
@@ -5712,7 +6132,7 @@ function InfiniteTableColumnHeaderFilterEmpty() {
|
|
|
5712
6132
|
|
|
5713
6133
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
|
|
5714
6134
|
import {
|
|
5715
|
-
createElement as
|
|
6135
|
+
createElement as createElement24
|
|
5716
6136
|
} from "react";
|
|
5717
6137
|
import { useCallback as useCallback8 } from "react";
|
|
5718
6138
|
|
|
@@ -6053,9 +6473,9 @@ var computeGroupResize = (params) => {
|
|
|
6053
6473
|
};
|
|
6054
6474
|
|
|
6055
6475
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
6056
|
-
import { useRef as useRef12, useState as
|
|
6476
|
+
import { useRef as useRef12, useState as useState9 } from "react";
|
|
6057
6477
|
import {
|
|
6058
|
-
createElement as
|
|
6478
|
+
createElement as createElement23,
|
|
6059
6479
|
memo as memo9
|
|
6060
6480
|
} from "react";
|
|
6061
6481
|
|
|
@@ -6148,17 +6568,17 @@ function getColumnGroupResizer(colIndexes, config) {
|
|
|
6148
6568
|
}
|
|
6149
6569
|
|
|
6150
6570
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
|
|
6151
|
-
var
|
|
6571
|
+
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
6152
6572
|
var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iw13 _16lm1iw1a _16lm1iw18 _16lm1iwf _16lm1iw1m";
|
|
6153
|
-
var ResizeHandleDraggerClsRecipe = (0,
|
|
6154
|
-
var ResizeHandleRecipeCls = (0,
|
|
6573
|
+
var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2 _16lm1iw13 _16lm1iw18", variantClassNames: { constrained: { false: "zneyzhc", true: "zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6574
|
+
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"]] });
|
|
6155
6575
|
|
|
6156
6576
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
|
|
6157
6577
|
var { rootClassName: rootClassName8 } = internalProps;
|
|
6158
6578
|
var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName8}HeaderCell_ResizeHandle`;
|
|
6159
6579
|
function ResizeHandleFn(props) {
|
|
6160
6580
|
const domRef = useRef12(null);
|
|
6161
|
-
const [constrained, setConstrained] =
|
|
6581
|
+
const [constrained, setConstrained] = useState9(false);
|
|
6162
6582
|
const constrainedRef = useRef12(constrained);
|
|
6163
6583
|
constrainedRef.current = constrained;
|
|
6164
6584
|
const col = props.columns[props.columnIndex];
|
|
@@ -6211,7 +6631,7 @@ function ResizeHandleFn(props) {
|
|
|
6211
6631
|
const style = (computedPinned === false || computedPinned === "start") && computedLastInCategory ? {
|
|
6212
6632
|
right: computedPinned === "start" ? 0 : 0
|
|
6213
6633
|
} : computedPinned === "end" && computedFirstInCategory ? { right: "none", left: 0 } : void 0;
|
|
6214
|
-
return /* @__PURE__ */
|
|
6634
|
+
return /* @__PURE__ */ createElement23("div", {
|
|
6215
6635
|
ref: domRef,
|
|
6216
6636
|
className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls} ${ResizeHandleRecipeCls({
|
|
6217
6637
|
computedPinned,
|
|
@@ -6219,7 +6639,7 @@ function ResizeHandleFn(props) {
|
|
|
6219
6639
|
computedLastInCategory
|
|
6220
6640
|
})}`,
|
|
6221
6641
|
onPointerDown
|
|
6222
|
-
}, /* @__PURE__ */
|
|
6642
|
+
}, /* @__PURE__ */ createElement23("div", {
|
|
6223
6643
|
style,
|
|
6224
6644
|
className: ResizeHandleDraggerClsRecipe({
|
|
6225
6645
|
constrained
|
|
@@ -6284,7 +6704,7 @@ function useColumnResizeHandle(column) {
|
|
|
6284
6704
|
}
|
|
6285
6705
|
componentActions.columnSizing = columnSizing;
|
|
6286
6706
|
}, [computeResizeForDiff]);
|
|
6287
|
-
const resizeHandle = column.computedResizable ? /* @__PURE__ */
|
|
6707
|
+
const resizeHandle = column.computedResizable ? /* @__PURE__ */ createElement24(ResizeHandle, {
|
|
6288
6708
|
columns: computedVisibleColumns,
|
|
6289
6709
|
columnIndex: column.computedVisibleIndex,
|
|
6290
6710
|
computeResize: computeResizeForDiff,
|
|
@@ -6297,7 +6717,7 @@ function useColumnResizeHandle(column) {
|
|
|
6297
6717
|
var defaultRenderSelectionCheckBox2 = (params) => {
|
|
6298
6718
|
const { allRowsSelected, someRowsSelected, api } = params;
|
|
6299
6719
|
const selected = allRowsSelected ? true : someRowsSelected ? null : false;
|
|
6300
|
-
return /* @__PURE__ */
|
|
6720
|
+
return /* @__PURE__ */ createElement25(InfiniteCheckBox, {
|
|
6301
6721
|
domProps: {
|
|
6302
6722
|
className: SelectionCheckboxCls
|
|
6303
6723
|
},
|
|
@@ -6339,7 +6759,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6339
6759
|
(_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
|
|
6340
6760
|
}, [props.domRef]);
|
|
6341
6761
|
const alwaysShow = headerOptions.alwaysReserveSpaceForSortIcon;
|
|
6342
|
-
const sortIcon = column.computedSortable && (column.computedSorted || alwaysShow) ? /* @__PURE__ */
|
|
6762
|
+
const sortIcon = column.computedSortable && (column.computedSorted || alwaysShow) ? /* @__PURE__ */ createElement25(SortIcon, {
|
|
6343
6763
|
index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
|
|
6344
6764
|
className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls} ${HeaderSortIconRecipe({
|
|
6345
6765
|
align: column.align || "start"
|
|
@@ -6366,7 +6786,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6366
6786
|
const align = column.align || "start";
|
|
6367
6787
|
const renderChildren = () => {
|
|
6368
6788
|
if (column.renderSortIcon) {
|
|
6369
|
-
renderParam.renderBag.sortIcon = /* @__PURE__ */
|
|
6789
|
+
renderParam.renderBag.sortIcon = /* @__PURE__ */ createElement25(RenderHeaderCellHookComponent, {
|
|
6370
6790
|
render: column.renderSortIcon,
|
|
6371
6791
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
6372
6792
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
@@ -6374,12 +6794,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6374
6794
|
});
|
|
6375
6795
|
}
|
|
6376
6796
|
if (column.renderSelectionCheckBox && selectionMode === "multi-row") {
|
|
6377
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
6797
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ createElement25(RenderHeaderCellHookComponent, {
|
|
6378
6798
|
render: defaultRenderSelectionCheckBox2,
|
|
6379
6799
|
renderParam
|
|
6380
6800
|
});
|
|
6381
6801
|
if (column.renderHeaderSelectionCheckBox && column.renderHeaderSelectionCheckBox !== true) {
|
|
6382
|
-
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */
|
|
6802
|
+
renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ createElement25(RenderHeaderCellHookComponent, {
|
|
6383
6803
|
render: column.renderHeaderSelectionCheckBox,
|
|
6384
6804
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
6385
6805
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
@@ -6388,7 +6808,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6388
6808
|
}
|
|
6389
6809
|
}
|
|
6390
6810
|
if (header instanceof Function) {
|
|
6391
|
-
renderParam.renderBag.header = /* @__PURE__ */
|
|
6811
|
+
renderParam.renderBag.header = /* @__PURE__ */ createElement25(RenderHeaderCellHookComponent, {
|
|
6392
6812
|
render: header,
|
|
6393
6813
|
renderParam: __spreadProps(__spreadValues({}, renderParam), {
|
|
6394
6814
|
renderBag: __spreadValues({}, renderParam.renderBag)
|
|
@@ -6396,12 +6816,12 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6396
6816
|
});
|
|
6397
6817
|
}
|
|
6398
6818
|
if (column.renderHeader) {
|
|
6399
|
-
return /* @__PURE__ */
|
|
6819
|
+
return /* @__PURE__ */ createElement25(RenderHeaderCellHookComponent, {
|
|
6400
6820
|
render: column.renderHeader,
|
|
6401
6821
|
renderParam
|
|
6402
6822
|
});
|
|
6403
6823
|
}
|
|
6404
|
-
return /* @__PURE__ */
|
|
6824
|
+
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);
|
|
6405
6825
|
};
|
|
6406
6826
|
const domRef = useRef13(null);
|
|
6407
6827
|
const {
|
|
@@ -6409,7 +6829,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6409
6829
|
getState: getDataSourceState,
|
|
6410
6830
|
componentState: { filterDelay, filterTypes }
|
|
6411
6831
|
} = useDataSourceContextValue();
|
|
6412
|
-
|
|
6832
|
+
useEffect13(() => {
|
|
6413
6833
|
let clearOnResize = null;
|
|
6414
6834
|
const node = domRef.current;
|
|
6415
6835
|
if (onResize && node) {
|
|
@@ -6432,7 +6852,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6432
6852
|
});
|
|
6433
6853
|
let draggingProxy = null;
|
|
6434
6854
|
if (dragging && proxyPosition) {
|
|
6435
|
-
draggingProxy = /* @__PURE__ */
|
|
6855
|
+
draggingProxy = /* @__PURE__ */ createElement25("div", {
|
|
6436
6856
|
key: column.id,
|
|
6437
6857
|
className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
|
|
6438
6858
|
style: {
|
|
@@ -6514,9 +6934,9 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6514
6934
|
const resizeHandle = useColumnResizeHandle(column);
|
|
6515
6935
|
const zIndex2 = `var(${columnZIndexAtIndex5}-${column.computedVisibleIndex})`;
|
|
6516
6936
|
style.zIndex = zIndex2;
|
|
6517
|
-
return /* @__PURE__ */
|
|
6937
|
+
return /* @__PURE__ */ createElement25(ContextProvider, {
|
|
6518
6938
|
value: renderParam
|
|
6519
|
-
}, /* @__PURE__ */
|
|
6939
|
+
}, /* @__PURE__ */ createElement25(InfiniteTableCell, {
|
|
6520
6940
|
domRef: ref,
|
|
6521
6941
|
cellType: "header",
|
|
6522
6942
|
column,
|
|
@@ -6535,7 +6955,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6535
6955
|
rowActive: false
|
|
6536
6956
|
}), CellCls),
|
|
6537
6957
|
cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
|
|
6538
|
-
afterChildren: /* @__PURE__ */
|
|
6958
|
+
afterChildren: /* @__PURE__ */ createElement25(Fragment3, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ createElement25(InfiniteTableColumnHeaderFilter, {
|
|
6539
6959
|
filterEditor: FilterEditor,
|
|
6540
6960
|
filterTypes,
|
|
6541
6961
|
onChange: debouncedOnFilterValueChange,
|
|
@@ -6543,7 +6963,7 @@ function InfiniteTableHeaderCell(props) {
|
|
|
6543
6963
|
columnLabel: column.field || column.name || column.id,
|
|
6544
6964
|
columnFilterValue: column.computedFilterValue,
|
|
6545
6965
|
columnHeaderHeight
|
|
6546
|
-
}) : /* @__PURE__ */
|
|
6966
|
+
}) : /* @__PURE__ */ createElement25(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
|
|
6547
6967
|
renderChildren
|
|
6548
6968
|
}), draggingProxy);
|
|
6549
6969
|
}
|
|
@@ -6554,7 +6974,7 @@ function useInfiniteHeaderCell() {
|
|
|
6554
6974
|
|
|
6555
6975
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
|
|
6556
6976
|
import {
|
|
6557
|
-
createElement as
|
|
6977
|
+
createElement as createElement30,
|
|
6558
6978
|
useCallback as useCallback12,
|
|
6559
6979
|
useMemo as useMemo6
|
|
6560
6980
|
} from "react";
|
|
@@ -6661,33 +7081,33 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
|
|
|
6661
7081
|
|
|
6662
7082
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
|
|
6663
7083
|
import {
|
|
6664
|
-
createElement as
|
|
7084
|
+
createElement as createElement29,
|
|
6665
7085
|
memo as memo11
|
|
6666
7086
|
} from "react";
|
|
6667
|
-
import { useCallback as useCallback11, useEffect as
|
|
7087
|
+
import { useCallback as useCallback11, useEffect as useEffect14, useRef as useRef15 } from "react";
|
|
6668
7088
|
|
|
6669
7089
|
// src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
|
|
6670
7090
|
import {
|
|
6671
|
-
createElement as
|
|
7091
|
+
createElement as createElement28
|
|
6672
7092
|
} from "react";
|
|
6673
7093
|
|
|
6674
7094
|
// src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
|
|
6675
7095
|
import {
|
|
6676
|
-
createElement as
|
|
7096
|
+
createElement as createElement27
|
|
6677
7097
|
} from "react";
|
|
6678
7098
|
import { useCallback as useCallback10 } from "react";
|
|
6679
7099
|
|
|
6680
7100
|
// src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
|
|
6681
|
-
import { useRef as useRef14, useState as
|
|
7101
|
+
import { useRef as useRef14, useState as useState10 } from "react";
|
|
6682
7102
|
import {
|
|
6683
|
-
createElement as
|
|
7103
|
+
createElement as createElement26,
|
|
6684
7104
|
memo as memo10
|
|
6685
7105
|
} from "react";
|
|
6686
7106
|
var { rootClassName: rootClassName10 } = internalProps;
|
|
6687
7107
|
var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName10}HeaderCell_ResizeHandle`;
|
|
6688
7108
|
function GroupResizeHandleFn(props) {
|
|
6689
7109
|
const domRef = useRef14(null);
|
|
6690
|
-
const [constrained, setConstrained] =
|
|
7110
|
+
const [constrained, setConstrained] = useState10(false);
|
|
6691
7111
|
const constrainedRef = useRef14(constrained);
|
|
6692
7112
|
constrainedRef.current = constrained;
|
|
6693
7113
|
const col = props.groupColumns[0];
|
|
@@ -6748,7 +7168,7 @@ function GroupResizeHandleFn(props) {
|
|
|
6748
7168
|
const style = (computedPinned === false || computedPinned === "start") && computedLastInCategory ? {
|
|
6749
7169
|
right: computedPinned === "start" ? 0 : ThemeVars.components.HeaderCell.resizeHandleWidth
|
|
6750
7170
|
} : computedPinned === "end" && computedFirstInCategory ? { right: "none", left: 0 } : void 0;
|
|
6751
|
-
return /* @__PURE__ */
|
|
7171
|
+
return /* @__PURE__ */ createElement26("div", {
|
|
6752
7172
|
ref: domRef,
|
|
6753
7173
|
className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls} ${ResizeHandleRecipeCls({
|
|
6754
7174
|
computedPinned,
|
|
@@ -6756,7 +7176,7 @@ function GroupResizeHandleFn(props) {
|
|
|
6756
7176
|
computedLastInCategory
|
|
6757
7177
|
})}`,
|
|
6758
7178
|
onPointerDown
|
|
6759
|
-
}, /* @__PURE__ */
|
|
7179
|
+
}, /* @__PURE__ */ createElement26("div", {
|
|
6760
7180
|
style: __spreadValues(__spreadValues({}, style), props.style),
|
|
6761
7181
|
className: ResizeHandleDraggerClsRecipe({
|
|
6762
7182
|
constrained
|
|
@@ -6814,7 +7234,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
|
|
|
6814
7234
|
componentActions.columnSizing = columnSizing;
|
|
6815
7235
|
}, [computeResizeForDiff]);
|
|
6816
7236
|
const groupResizable = groupColumns.some((c) => c.computedResizable);
|
|
6817
|
-
const resizeHandle = groupResizable ? /* @__PURE__ */
|
|
7237
|
+
const resizeHandle = groupResizable ? /* @__PURE__ */ createElement27(GroupResizeHandle, {
|
|
6818
7238
|
brain: bodyBrain,
|
|
6819
7239
|
style: {
|
|
6820
7240
|
height: groupHeight * (columnGroupsMaxDepth - columnGroup.depth + 2)
|
|
@@ -6848,13 +7268,13 @@ function InfiniteTableHeaderGroup(props) {
|
|
|
6848
7268
|
const firstColumn = columns[0];
|
|
6849
7269
|
const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex5}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex5}-${firstColumn.computedVisibleIndex})`;
|
|
6850
7270
|
const zIndex2 = `calc(var(${columnZIndexAtIndex6}-${firstColumn.computedVisibleIndex}) + ${columnGroupsMaxDepth - columnGroup.depth})`;
|
|
6851
|
-
return /* @__PURE__ */
|
|
7271
|
+
return /* @__PURE__ */ createElement28("div", {
|
|
6852
7272
|
ref: props.domRef,
|
|
6853
7273
|
"data-group-id": columnGroup.uniqueGroupId,
|
|
6854
7274
|
className: join(HeaderGroupCls, TableHeaderGroupClassName),
|
|
6855
7275
|
style: { width, height },
|
|
6856
7276
|
"data-z-index": zIndex2
|
|
6857
|
-
}, /* @__PURE__ */
|
|
7277
|
+
}, /* @__PURE__ */ createElement28("div", {
|
|
6858
7278
|
className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
|
|
6859
7279
|
}, header), handle);
|
|
6860
7280
|
}
|
|
@@ -6877,8 +7297,8 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6877
7297
|
computed,
|
|
6878
7298
|
componentState: { headerBrain, headerOptions }
|
|
6879
7299
|
} = useInfiniteTable();
|
|
6880
|
-
const {
|
|
6881
|
-
|
|
7300
|
+
const { computedColumnsMap, showColumnFilters } = computed;
|
|
7301
|
+
useEffect14(() => {
|
|
6882
7302
|
const onScroll = (scrollPosition) => {
|
|
6883
7303
|
if (domRef.current) {
|
|
6884
7304
|
domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
|
|
@@ -6921,7 +7341,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6921
7341
|
computedWidth: colGroupItem.computedWidth,
|
|
6922
7342
|
groupOffset: colGroupItem.groupOffset
|
|
6923
7343
|
});
|
|
6924
|
-
return /* @__PURE__ */
|
|
7344
|
+
return /* @__PURE__ */ createElement29(InfiniteTableHeaderGroup, {
|
|
6925
7345
|
bodyBrain,
|
|
6926
7346
|
columnGroupsMaxDepth,
|
|
6927
7347
|
domRef: domRef2,
|
|
@@ -6931,13 +7351,13 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6931
7351
|
columnGroup: computedColumnGroup
|
|
6932
7352
|
});
|
|
6933
7353
|
}
|
|
6934
|
-
return /* @__PURE__ */
|
|
7354
|
+
return /* @__PURE__ */ createElement29(InfiniteTableHeaderCell, {
|
|
6935
7355
|
domRef: domRef2,
|
|
6936
7356
|
column,
|
|
6937
7357
|
headerOptions,
|
|
6938
7358
|
width: widthWithColspan,
|
|
6939
7359
|
height: heightWithRowspan,
|
|
6940
|
-
columnsMap:
|
|
7360
|
+
columnsMap: computedColumnsMap
|
|
6941
7361
|
});
|
|
6942
7362
|
}, [
|
|
6943
7363
|
headerOptions,
|
|
@@ -6947,7 +7367,7 @@ function InfiniteTableHeaderFn(props) {
|
|
|
6947
7367
|
columnGroupsMaxDepth,
|
|
6948
7368
|
showColumnFilters
|
|
6949
7369
|
]);
|
|
6950
|
-
return /* @__PURE__ */
|
|
7370
|
+
return /* @__PURE__ */ createElement29("div", __spreadValues({}, domProps), /* @__PURE__ */ createElement29(RawTable, {
|
|
6951
7371
|
name: "header",
|
|
6952
7372
|
renderCell,
|
|
6953
7373
|
brain: headerBrain,
|
|
@@ -7033,7 +7453,7 @@ function TableHeaderWrapper(props) {
|
|
|
7033
7453
|
fixedColsEnd: computedPinnedEndColumns.length,
|
|
7034
7454
|
fixedColsStart: computedPinnedStartColumns.length
|
|
7035
7455
|
});
|
|
7036
|
-
const header = /* @__PURE__ */
|
|
7456
|
+
const header = /* @__PURE__ */ createElement30(InfiniteTableHeader, {
|
|
7037
7457
|
columns: computedVisibleColumns,
|
|
7038
7458
|
headerBrain,
|
|
7039
7459
|
bodyBrain,
|
|
@@ -7041,14 +7461,14 @@ function TableHeaderWrapper(props) {
|
|
|
7041
7461
|
columnGroupsMaxDepth,
|
|
7042
7462
|
columnAndGroupTreeInfo
|
|
7043
7463
|
});
|
|
7044
|
-
const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */
|
|
7464
|
+
const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ createElement30("div", {
|
|
7045
7465
|
className: HeaderScrollbarPlaceholderCls,
|
|
7046
7466
|
style: {
|
|
7047
7467
|
zIndex: 1e3,
|
|
7048
7468
|
width: getScrollbarWidth()
|
|
7049
7469
|
}
|
|
7050
7470
|
}) : null;
|
|
7051
|
-
return /* @__PURE__ */
|
|
7471
|
+
return /* @__PURE__ */ createElement30("div", {
|
|
7052
7472
|
className: HeaderWrapperCls,
|
|
7053
7473
|
style: {
|
|
7054
7474
|
height
|
|
@@ -7058,12 +7478,12 @@ function TableHeaderWrapper(props) {
|
|
|
7058
7478
|
|
|
7059
7479
|
// src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
|
|
7060
7480
|
import {
|
|
7061
|
-
createElement as
|
|
7481
|
+
createElement as createElement31,
|
|
7062
7482
|
forwardRef as forwardRef4,
|
|
7063
7483
|
useCallback as useCallback13,
|
|
7064
7484
|
useRef as useRef16
|
|
7065
7485
|
} from "react";
|
|
7066
|
-
import { useEffect as
|
|
7486
|
+
import { useEffect as useEffect15 } from "react";
|
|
7067
7487
|
|
|
7068
7488
|
// src/components/utils/decamelize.ts
|
|
7069
7489
|
function decamelize(str, options) {
|
|
@@ -7112,7 +7532,7 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
|
|
|
7112
7532
|
ref.current = node;
|
|
7113
7533
|
}
|
|
7114
7534
|
}, []);
|
|
7115
|
-
|
|
7535
|
+
useEffect15(() => {
|
|
7116
7536
|
const forceStyle = () => {
|
|
7117
7537
|
raf(() => {
|
|
7118
7538
|
var _a;
|
|
@@ -7126,12 +7546,12 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
|
|
|
7126
7546
|
clearInterval(intervalId);
|
|
7127
7547
|
};
|
|
7128
7548
|
}, []);
|
|
7129
|
-
return /* @__PURE__ */
|
|
7549
|
+
return /* @__PURE__ */ createElement31("div", __spreadProps(__spreadValues({
|
|
7130
7550
|
ref: domCallback
|
|
7131
7551
|
}, props), {
|
|
7132
7552
|
className: join(`${rootClassName13}-Footer`, FooterCls, props.className),
|
|
7133
7553
|
style: defaultStyle
|
|
7134
|
-
}), "Powered by", " ", /* @__PURE__ */
|
|
7554
|
+
}), "Powered by", " ", /* @__PURE__ */ createElement31("a", {
|
|
7135
7555
|
href: "https://infinite-table.com",
|
|
7136
7556
|
rel: "noopener noreferrer",
|
|
7137
7557
|
role: "link",
|
|
@@ -7139,15 +7559,9 @@ var InfiniteTableLicenseFooter = forwardRef4(function InfiniteTableLicenseFooter
|
|
|
7139
7559
|
}, "Infinite Table"));
|
|
7140
7560
|
});
|
|
7141
7561
|
|
|
7142
|
-
// src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
|
|
7143
|
-
var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
7144
|
-
var GroupRowExpanderCls = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_7pupv0b", center: "_7pupv0c", end: "_7pupv0d" } }, defaultVariants: {}, compoundVariants: [] });
|
|
7145
|
-
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: [] });
|
|
7146
|
-
var RowHoverCls = "_7pupv01";
|
|
7147
|
-
|
|
7148
7562
|
// src/components/InfiniteTable/components/LoadMask.tsx
|
|
7149
7563
|
import {
|
|
7150
|
-
createElement as
|
|
7564
|
+
createElement as createElement32,
|
|
7151
7565
|
memo as memo12
|
|
7152
7566
|
} from "react";
|
|
7153
7567
|
|
|
@@ -7161,11 +7575,11 @@ var { rootClassName: rootClassName12 } = internalProps;
|
|
|
7161
7575
|
var baseCls3 = `${rootClassName12}-LoadMask`;
|
|
7162
7576
|
function LoadMaskFn(props) {
|
|
7163
7577
|
const { visible, children = "Loading" } = props;
|
|
7164
|
-
return /* @__PURE__ */
|
|
7578
|
+
return /* @__PURE__ */ createElement32("div", {
|
|
7165
7579
|
className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls3}`
|
|
7166
|
-
}, /* @__PURE__ */
|
|
7580
|
+
}, /* @__PURE__ */ createElement32("div", {
|
|
7167
7581
|
className: `${LoadMaskOverlayCls} ${baseCls3}-Overlay`
|
|
7168
|
-
}), /* @__PURE__ */
|
|
7582
|
+
}), /* @__PURE__ */ createElement32("div", {
|
|
7169
7583
|
className: `${LoadMaskTextCls} ${baseCls3}-Text`
|
|
7170
7584
|
}, children));
|
|
7171
7585
|
}
|
|
@@ -7406,14 +7820,17 @@ function group(groupParams, data) {
|
|
|
7406
7820
|
}
|
|
7407
7821
|
for (let i = 0, len = data.length; i < len; i++) {
|
|
7408
7822
|
const item = data[i];
|
|
7823
|
+
const commonData = {};
|
|
7409
7824
|
for (let groupByIndex = 0; groupByIndex < groupByLength; groupByIndex++) {
|
|
7410
7825
|
const { field: groupByProperty, toKey: groupToKey } = groupBy[groupByIndex];
|
|
7411
7826
|
const key = (groupToKey || defaultToKey)(item[groupByProperty], item);
|
|
7827
|
+
commonData[groupByProperty] = key;
|
|
7412
7828
|
currentGroupKeys.push(key);
|
|
7413
7829
|
if (!deepMap.has(currentGroupKeys)) {
|
|
7414
7830
|
const deepMapGroupValue = {
|
|
7415
7831
|
items: [],
|
|
7416
7832
|
cache: false,
|
|
7833
|
+
commonData: __spreadValues({}, commonData),
|
|
7417
7834
|
childrenLoading: false,
|
|
7418
7835
|
childrenAvailable: false,
|
|
7419
7836
|
reducerResults: deepClone(initialReducerValue)
|
|
@@ -7687,7 +8104,7 @@ function enhancedFlatten(param) {
|
|
|
7687
8104
|
// src/components/DataSource/index.tsx
|
|
7688
8105
|
import {
|
|
7689
8106
|
Fragment as Fragment4,
|
|
7690
|
-
createElement as
|
|
8107
|
+
createElement as createElement33
|
|
7691
8108
|
} from "react";
|
|
7692
8109
|
|
|
7693
8110
|
// src/utils/multisort/sortTypes.ts
|
|
@@ -7707,7 +8124,15 @@ var sortTypes_default = defaultSortTypes;
|
|
|
7707
8124
|
|
|
7708
8125
|
// src/utils/multisort/index.ts
|
|
7709
8126
|
var multisort = (sortInfo, array, get) => {
|
|
7710
|
-
|
|
8127
|
+
const plainSortInfo = sortInfo.map((sortInfo2) => {
|
|
8128
|
+
if (Array.isArray(sortInfo2.field)) {
|
|
8129
|
+
return sortInfo2.field.map((field) => {
|
|
8130
|
+
return __spreadProps(__spreadValues({}, sortInfo2), { field });
|
|
8131
|
+
});
|
|
8132
|
+
}
|
|
8133
|
+
return sortInfo2;
|
|
8134
|
+
}).flat();
|
|
8135
|
+
array.sort(getMultisortFunction(plainSortInfo, get));
|
|
7711
8136
|
return array;
|
|
7712
8137
|
};
|
|
7713
8138
|
multisort.knownTypes = sortTypes_default;
|
|
@@ -7940,10 +8365,10 @@ var GroupRowsState = class extends BooleanDeepCollectionState {
|
|
|
7940
8365
|
};
|
|
7941
8366
|
|
|
7942
8367
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
7943
|
-
import { useEffect as
|
|
8368
|
+
import { useEffect as useEffect17, useMemo as useMemo7, useRef as useRef18, useState as useState11 } from "react";
|
|
7944
8369
|
|
|
7945
8370
|
// src/components/hooks/useEffectWithChanges.ts
|
|
7946
|
-
import { useEffect as
|
|
8371
|
+
import { useEffect as useEffect16, useRef as useRef17 } from "react";
|
|
7947
8372
|
function useEffectWithChanges(fn, deps) {
|
|
7948
8373
|
const prevRef = useRef17({});
|
|
7949
8374
|
const oldValuesRef = useRef17({});
|
|
@@ -7961,7 +8386,7 @@ function useEffectWithChanges(fn, deps) {
|
|
|
7961
8386
|
}
|
|
7962
8387
|
}
|
|
7963
8388
|
prevRef.current = deps;
|
|
7964
|
-
|
|
8389
|
+
useEffect16(() => {
|
|
7965
8390
|
const changes2 = changesRef.current;
|
|
7966
8391
|
const result = fn(changes2, oldValues);
|
|
7967
8392
|
changesRef.current = {};
|
|
@@ -8227,12 +8652,12 @@ function useLoadData() {
|
|
|
8227
8652
|
livePaginationCursor,
|
|
8228
8653
|
cursorId: stateCursorId
|
|
8229
8654
|
} = componentState;
|
|
8230
|
-
const [scrollbars, setScrollbars] =
|
|
8655
|
+
const [scrollbars, setScrollbars] = useState11({
|
|
8231
8656
|
vertical: false,
|
|
8232
8657
|
horizontal: false
|
|
8233
8658
|
});
|
|
8234
8659
|
const scrollbarsRef = useRef18(scrollbars);
|
|
8235
|
-
|
|
8660
|
+
useEffect17(() => {
|
|
8236
8661
|
notifyScrollbarsChange.onChange((scrollbars2) => {
|
|
8237
8662
|
if (!scrollbars2) {
|
|
8238
8663
|
return;
|
|
@@ -8242,7 +8667,7 @@ function useLoadData() {
|
|
|
8242
8667
|
});
|
|
8243
8668
|
return () => notifyScrollbarsChange.destroy();
|
|
8244
8669
|
}, [notifyScrollbarsChange]);
|
|
8245
|
-
|
|
8670
|
+
useEffect17(() => {
|
|
8246
8671
|
if (!livePagination) {
|
|
8247
8672
|
return;
|
|
8248
8673
|
}
|
|
@@ -8256,7 +8681,7 @@ function useLoadData() {
|
|
|
8256
8681
|
});
|
|
8257
8682
|
return () => cancelAnimationFrame(frameId);
|
|
8258
8683
|
}, [livePaginationCursor]);
|
|
8259
|
-
|
|
8684
|
+
useEffect17(() => {
|
|
8260
8685
|
if (!livePagination || livePaginationCursor !== void 0) {
|
|
8261
8686
|
return;
|
|
8262
8687
|
}
|
|
@@ -8270,7 +8695,7 @@ function useLoadData() {
|
|
|
8270
8695
|
});
|
|
8271
8696
|
return () => cancelAnimationFrame(frameId);
|
|
8272
8697
|
}, [dataArray.length, livePaginationCursor]);
|
|
8273
|
-
|
|
8698
|
+
useEffect17(() => {
|
|
8274
8699
|
const state = getComponentState();
|
|
8275
8700
|
const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
|
|
8276
8701
|
if (!scrollbars.vertical && livePagination2) {
|
|
@@ -8320,7 +8745,7 @@ function useLazyLoadRange() {
|
|
|
8320
8745
|
componentActions: actions,
|
|
8321
8746
|
componentState
|
|
8322
8747
|
} = useComponentState();
|
|
8323
|
-
|
|
8748
|
+
useEffect17(() => {
|
|
8324
8749
|
actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
|
|
8325
8750
|
}, [componentState.data, componentState.dataParams]);
|
|
8326
8751
|
const {
|
|
@@ -8356,7 +8781,7 @@ function useLazyLoadRange() {
|
|
|
8356
8781
|
}, cache);
|
|
8357
8782
|
};
|
|
8358
8783
|
const debouncedLoadRange = useMemo7(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
|
|
8359
|
-
|
|
8784
|
+
useEffect17(() => {
|
|
8360
8785
|
if (lazyLoad) {
|
|
8361
8786
|
return notifyRenderRangeChange.onChange((renderRange) => {
|
|
8362
8787
|
latestRenderRangeRef.current = renderRange;
|
|
@@ -8365,7 +8790,7 @@ function useLazyLoadRange() {
|
|
|
8365
8790
|
}
|
|
8366
8791
|
return;
|
|
8367
8792
|
}, [lazyLoadBatchSize, lazyLoad]);
|
|
8368
|
-
|
|
8793
|
+
useEffect17(() => {
|
|
8369
8794
|
if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
|
|
8370
8795
|
debouncedLoadRange();
|
|
8371
8796
|
}
|
|
@@ -9158,7 +9583,7 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
|
|
|
9158
9583
|
}
|
|
9159
9584
|
function mapPropsToState(params) {
|
|
9160
9585
|
var _a, _b;
|
|
9161
|
-
const { props, state, oldState
|
|
9586
|
+
const { props, state, oldState } = params;
|
|
9162
9587
|
const controlledSort = isControlledValue(props.sortInfo);
|
|
9163
9588
|
const controlledFilter = isControlledValue(props.filterValue);
|
|
9164
9589
|
const { filterTypes } = state;
|
|
@@ -9196,9 +9621,9 @@ function mapPropsToState(params) {
|
|
|
9196
9621
|
selectedRows: [],
|
|
9197
9622
|
deselectedRows: [],
|
|
9198
9623
|
defaultSelection: false
|
|
9199
|
-
}, rowSelectionStateConfigGetter(
|
|
9624
|
+
}, rowSelectionStateConfigGetter(state));
|
|
9200
9625
|
} else {
|
|
9201
|
-
rowSelectionState = selectionMode === "single-row" ? currentRowSelection : currentRowSelection instanceof RowSelectionState ? currentRowSelection : new RowSelectionState(currentRowSelection, rowSelectionStateConfigGetter(
|
|
9626
|
+
rowSelectionState = selectionMode === "single-row" ? currentRowSelection : currentRowSelection instanceof RowSelectionState ? currentRowSelection : new RowSelectionState(currentRowSelection, rowSelectionStateConfigGetter(state));
|
|
9202
9627
|
}
|
|
9203
9628
|
}
|
|
9204
9629
|
}
|
|
@@ -9815,7 +10240,7 @@ function DataSourceWithContext(props) {
|
|
|
9815
10240
|
if (typeof children === "function") {
|
|
9816
10241
|
children = children(computedValues);
|
|
9817
10242
|
}
|
|
9818
|
-
return /* @__PURE__ */
|
|
10243
|
+
return /* @__PURE__ */ createElement33(Fragment4, null, children);
|
|
9819
10244
|
}
|
|
9820
10245
|
var DataSourceRoot = getComponentStateRoot({
|
|
9821
10246
|
initSetupState,
|
|
@@ -9840,14 +10265,14 @@ function DataSourceCmp({ children }) {
|
|
|
9840
10265
|
globalThis.dataSourceActions = componentActions;
|
|
9841
10266
|
}
|
|
9842
10267
|
useLoadData();
|
|
9843
|
-
return /* @__PURE__ */
|
|
10268
|
+
return /* @__PURE__ */ createElement33(DataSourceContext.Provider, {
|
|
9844
10269
|
value: contextValue
|
|
9845
|
-
}, /* @__PURE__ */
|
|
10270
|
+
}, /* @__PURE__ */ createElement33(DataSourceWithContext, {
|
|
9846
10271
|
children
|
|
9847
10272
|
}));
|
|
9848
10273
|
}
|
|
9849
10274
|
function DataSource(props) {
|
|
9850
|
-
return /* @__PURE__ */
|
|
10275
|
+
return /* @__PURE__ */ createElement33(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ createElement33(DataSourceCmp, {
|
|
9851
10276
|
children: props.children
|
|
9852
10277
|
}));
|
|
9853
10278
|
}
|
|
@@ -10019,9 +10444,9 @@ function getImperativeApi(param) {
|
|
|
10019
10444
|
|
|
10020
10445
|
// src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
|
|
10021
10446
|
import {
|
|
10022
|
-
useEffect as
|
|
10447
|
+
useEffect as useEffect18,
|
|
10023
10448
|
useRef as useRef19,
|
|
10024
|
-
useState as
|
|
10449
|
+
useState as useState12
|
|
10025
10450
|
} from "react";
|
|
10026
10451
|
var OFFSET = 10;
|
|
10027
10452
|
function getColumnContentMaxWidths(domRef, options) {
|
|
@@ -10088,11 +10513,11 @@ function useAutoSizeColumns() {
|
|
|
10088
10513
|
componentActions,
|
|
10089
10514
|
componentState: { domRef, ready, autoSizeColumnsKey, brain }
|
|
10090
10515
|
} = useComponentState();
|
|
10091
|
-
const [refreshId, setRefreshId] =
|
|
10516
|
+
const [refreshId, setRefreshId] = useState12(0);
|
|
10092
10517
|
const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
|
|
10093
10518
|
const getTheKey = useLatest(theKey);
|
|
10094
10519
|
const lastExecutedIdentifierRef = useRef19(null);
|
|
10095
|
-
|
|
10520
|
+
useEffect18(() => {
|
|
10096
10521
|
const key = getTheKey();
|
|
10097
10522
|
if (key == null) {
|
|
10098
10523
|
return;
|
|
@@ -10105,7 +10530,7 @@ function useAutoSizeColumns() {
|
|
|
10105
10530
|
};
|
|
10106
10531
|
return brain.onRenderRangeChange(onChange);
|
|
10107
10532
|
}, [brain]);
|
|
10108
|
-
|
|
10533
|
+
useEffect18(() => {
|
|
10109
10534
|
var _a;
|
|
10110
10535
|
if (theKey == null) {
|
|
10111
10536
|
return;
|
|
@@ -10150,9 +10575,9 @@ function useAutoSizeColumns() {
|
|
|
10150
10575
|
}
|
|
10151
10576
|
|
|
10152
10577
|
// src/components/InfiniteTable/hooks/useCellRendering.tsx
|
|
10153
|
-
import { useCallback as useCallback14, useEffect as
|
|
10578
|
+
import { useCallback as useCallback14, useEffect as useEffect19, useRef as useRef20 } from "react";
|
|
10154
10579
|
import {
|
|
10155
|
-
createElement as
|
|
10580
|
+
createElement as createElement34
|
|
10156
10581
|
} from "react";
|
|
10157
10582
|
|
|
10158
10583
|
// src/components/InfiniteTable/hooks/useYourBrain.ts
|
|
@@ -10189,7 +10614,8 @@ function useCellRendering(param) {
|
|
|
10189
10614
|
computedPinnedStartColumns,
|
|
10190
10615
|
computedPinnedEndColumns,
|
|
10191
10616
|
computedVisibleColumns,
|
|
10192
|
-
|
|
10617
|
+
computedColumnsMap,
|
|
10618
|
+
fieldsToColumn,
|
|
10193
10619
|
rowspan,
|
|
10194
10620
|
toggleGroupRow,
|
|
10195
10621
|
columnSize
|
|
@@ -10225,12 +10651,12 @@ function useCellRendering(param) {
|
|
|
10225
10651
|
rowspan
|
|
10226
10652
|
});
|
|
10227
10653
|
const scrollTopMaxRef = useRef20(0);
|
|
10228
|
-
|
|
10654
|
+
useEffect19(() => {
|
|
10229
10655
|
return brain.onRenderCountChange(() => {
|
|
10230
10656
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
10231
10657
|
});
|
|
10232
10658
|
}, [brain]);
|
|
10233
|
-
|
|
10659
|
+
useEffect19(() => {
|
|
10234
10660
|
return brain.onScrollStop((scrollPosition) => {
|
|
10235
10661
|
const { scrollTop: scrollTop2 } = scrollPosition;
|
|
10236
10662
|
if (scrollTop2 === 0) {
|
|
@@ -10247,7 +10673,7 @@ function useCellRendering(param) {
|
|
|
10247
10673
|
}
|
|
10248
10674
|
});
|
|
10249
10675
|
}, [brain, onScrollToTop, onScrollToBottom]);
|
|
10250
|
-
|
|
10676
|
+
useEffect19(() => {
|
|
10251
10677
|
if (!bodySize.height) {
|
|
10252
10678
|
return;
|
|
10253
10679
|
}
|
|
@@ -10258,7 +10684,7 @@ function useCellRendering(param) {
|
|
|
10258
10684
|
}
|
|
10259
10685
|
}, [!!bodySize.height]);
|
|
10260
10686
|
const [, rerender] = useRerender();
|
|
10261
|
-
|
|
10687
|
+
useEffect19(() => {
|
|
10262
10688
|
rerender();
|
|
10263
10689
|
}, [dataSourceState]);
|
|
10264
10690
|
const renderCell = useCallback14((params) => {
|
|
@@ -10293,16 +10719,18 @@ function useCellRendering(param) {
|
|
|
10293
10719
|
domRef,
|
|
10294
10720
|
width,
|
|
10295
10721
|
column,
|
|
10296
|
-
columnsMap:
|
|
10722
|
+
columnsMap: computedColumnsMap,
|
|
10723
|
+
fieldsToColumn,
|
|
10297
10724
|
rowStyle,
|
|
10298
10725
|
rowClassName
|
|
10299
10726
|
};
|
|
10300
|
-
return /* @__PURE__ */
|
|
10727
|
+
return /* @__PURE__ */ createElement34(InfiniteTableColumnCell, __spreadValues({}, cellProps));
|
|
10301
10728
|
}, [
|
|
10302
10729
|
rowHeight,
|
|
10303
10730
|
getData,
|
|
10304
10731
|
computedVisibleColumns,
|
|
10305
|
-
|
|
10732
|
+
computedColumnsMap,
|
|
10733
|
+
fieldsToColumn,
|
|
10306
10734
|
groupRenderStrategy,
|
|
10307
10735
|
toggleGroupRow,
|
|
10308
10736
|
showZebraRows,
|
|
@@ -10389,10 +10817,10 @@ var MultiRowSelector = class {
|
|
|
10389
10817
|
};
|
|
10390
10818
|
|
|
10391
10819
|
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
10392
|
-
import { useEffect as
|
|
10820
|
+
import { useEffect as useEffect21 } from "react";
|
|
10393
10821
|
|
|
10394
10822
|
// src/components/hooks/useInterceptedMap.ts
|
|
10395
|
-
import { useEffect as
|
|
10823
|
+
import { useEffect as useEffect20 } from "react";
|
|
10396
10824
|
function interceptMap(map2, fns) {
|
|
10397
10825
|
const { set, delete: deleteKey, clear } = map2;
|
|
10398
10826
|
if (fns.set) {
|
|
@@ -10425,377 +10853,138 @@ function interceptMap(map2, fns) {
|
|
|
10425
10853
|
if (set) {
|
|
10426
10854
|
map2.set = set;
|
|
10427
10855
|
}
|
|
10428
|
-
if (deleteKey) {
|
|
10429
|
-
map2.delete = deleteKey;
|
|
10430
|
-
}
|
|
10431
|
-
if (clear) {
|
|
10432
|
-
map2.clear = clear;
|
|
10433
|
-
}
|
|
10434
|
-
};
|
|
10435
|
-
}
|
|
10436
|
-
|
|
10437
|
-
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
10438
|
-
function computeColumnGroupsDepths(columnGroups) {
|
|
10439
|
-
const map2 = new Map();
|
|
10440
|
-
columnGroups.forEach((colGroup, colGroupId) => {
|
|
10441
|
-
let parentGroupId = colGroup.columnGroup;
|
|
10442
|
-
let depth = 0;
|
|
10443
|
-
while (parentGroupId) {
|
|
10444
|
-
const parent = columnGroups.get(parentGroupId);
|
|
10445
|
-
if (!parent) {
|
|
10446
|
-
if (false) {
|
|
10447
|
-
console.warn(`Cannot find column group ${parentGroupId}`);
|
|
10448
|
-
}
|
|
10449
|
-
break;
|
|
10450
|
-
}
|
|
10451
|
-
depth++;
|
|
10452
|
-
parentGroupId = parent.columnGroup;
|
|
10453
|
-
}
|
|
10454
|
-
map2.set(colGroupId, depth);
|
|
10455
|
-
});
|
|
10456
|
-
return map2;
|
|
10457
|
-
}
|
|
10458
|
-
|
|
10459
|
-
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
10460
|
-
function useColumnGroups() {
|
|
10461
|
-
const {
|
|
10462
|
-
componentState: {
|
|
10463
|
-
computedColumnGroups,
|
|
10464
|
-
collapsedColumnGroups
|
|
10465
|
-
},
|
|
10466
|
-
componentActions,
|
|
10467
|
-
getComponentState
|
|
10468
|
-
} = useComponentState();
|
|
10469
|
-
useEffect20(() => {
|
|
10470
|
-
const recompute = () => {
|
|
10471
|
-
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
10472
|
-
};
|
|
10473
|
-
const update = rafFn(recompute);
|
|
10474
|
-
return interceptMap(computedColumnGroups, {
|
|
10475
|
-
clear: update,
|
|
10476
|
-
delete: update,
|
|
10477
|
-
set: update
|
|
10478
|
-
});
|
|
10479
|
-
}, [computedColumnGroups]);
|
|
10480
|
-
useEffect20(() => {
|
|
10481
|
-
return interceptMap(collapsedColumnGroups, {
|
|
10482
|
-
set: (key, visibleCol) => {
|
|
10483
|
-
const colIds = key.slice(1);
|
|
10484
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10485
|
-
colIds.forEach((colId) => {
|
|
10486
|
-
columnVisibility[colId] = false;
|
|
10487
|
-
});
|
|
10488
|
-
delete columnVisibility[visibleCol];
|
|
10489
|
-
componentActions.columnVisibility = columnVisibility;
|
|
10490
|
-
},
|
|
10491
|
-
beforeClear: (currentCollapsedGroups) => {
|
|
10492
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10493
|
-
const keys = [...currentCollapsedGroups.keys()];
|
|
10494
|
-
keys.forEach((key) => {
|
|
10495
|
-
const colIds = key.slice(1);
|
|
10496
|
-
colIds.forEach((colId) => {
|
|
10497
|
-
delete columnVisibility[colId];
|
|
10498
|
-
});
|
|
10499
|
-
});
|
|
10500
|
-
componentActions.columnVisibility = columnVisibility;
|
|
10501
|
-
},
|
|
10502
|
-
delete: (key) => {
|
|
10503
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10504
|
-
const colIds = key.slice(1);
|
|
10505
|
-
colIds.forEach((colId) => {
|
|
10506
|
-
delete columnVisibility[colId];
|
|
10507
|
-
});
|
|
10508
|
-
componentActions.columnVisibility = columnVisibility;
|
|
10509
|
-
}
|
|
10510
|
-
});
|
|
10511
|
-
}, [collapsedColumnGroups]);
|
|
10512
|
-
}
|
|
10513
|
-
|
|
10514
|
-
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
10515
|
-
import { useMemo as useMemo8 } from "react";
|
|
10516
|
-
function useColumnRowspan(computedVisibleColumns) {
|
|
10517
|
-
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
10518
|
-
const rowspan = useMemo8(() => {
|
|
10519
|
-
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
10520
|
-
return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
|
|
10521
|
-
const dataArray = getDataSourceState().dataArray;
|
|
10522
|
-
const rowInfo = dataArray[rowIndex];
|
|
10523
|
-
if (!rowInfo) {
|
|
10524
|
-
return 1;
|
|
10525
|
-
}
|
|
10526
|
-
const data = rowInfo.data;
|
|
10527
|
-
const column = computedVisibleColumns[colIndex];
|
|
10528
|
-
if (!column || !column.rowspan) {
|
|
10529
|
-
return 1;
|
|
10530
|
-
}
|
|
10531
|
-
return column.rowspan({
|
|
10532
|
-
column,
|
|
10533
|
-
data,
|
|
10534
|
-
dataArray,
|
|
10535
|
-
rowInfo,
|
|
10536
|
-
rowIndex
|
|
10537
|
-
});
|
|
10538
|
-
} : void 0;
|
|
10539
|
-
}, [computedVisibleColumns]);
|
|
10540
|
-
return rowspan;
|
|
10541
|
-
}
|
|
10542
|
-
|
|
10543
|
-
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
10544
|
-
import { useCallback as useCallback15 } from "react";
|
|
10545
|
-
var debug4 = dbg("useColumnSizeFn");
|
|
10546
|
-
function useColumnSizeFn(columns) {
|
|
10547
|
-
const columnSize = useCallback15((index) => {
|
|
10548
|
-
const column = columns[index];
|
|
10549
|
-
if (false) {
|
|
10550
|
-
debug4("cannot find column at index", index, columns);
|
|
10551
|
-
}
|
|
10552
|
-
return column ? column.computedWidth : 0;
|
|
10553
|
-
}, [columns]);
|
|
10554
|
-
return columnSize;
|
|
10555
|
-
}
|
|
10556
|
-
|
|
10557
|
-
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
10558
|
-
import { useEffect as useEffect23, useMemo as useMemo9 } from "react";
|
|
10559
|
-
|
|
10560
|
-
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
10561
|
-
import {
|
|
10562
|
-
createElement as createElement34
|
|
10563
|
-
} from "react";
|
|
10564
|
-
|
|
10565
|
-
// src/components/DataSource/state/rowInfoStatus.ts
|
|
10566
|
-
var showLoadingIcon = (rowInfo) => {
|
|
10567
|
-
if (rowInfo.dataSourceHasGrouping) {
|
|
10568
|
-
return rowInfo.isGroupRow ? rowInfo.childrenLoading || !rowInfo.selfLoaded : !rowInfo.selfLoaded;
|
|
10569
|
-
}
|
|
10570
|
-
return !rowInfo.selfLoaded;
|
|
10571
|
-
};
|
|
10572
|
-
|
|
10573
|
-
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
10574
|
-
import {
|
|
10575
|
-
createElement as createElement32,
|
|
10576
|
-
useEffect as useEffect21
|
|
10577
|
-
} from "react";
|
|
10578
|
-
import { useState as useState12 } from "react";
|
|
10579
|
-
|
|
10580
|
-
// src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
|
|
10581
|
-
var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
|
|
10582
|
-
var ExpanderIconCls = "_16lm1iw6 _16lm1iwi _16lm1iwe";
|
|
10583
|
-
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"]] });
|
|
10584
|
-
|
|
10585
|
-
// src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
|
|
10586
|
-
function ExpanderIcon(props) {
|
|
10587
|
-
var _a;
|
|
10588
|
-
const { size = 24, direction = "start" } = props;
|
|
10589
|
-
const [expanded, setExpanded] = useState12((_a = props.expanded) != null ? _a : props.defaultExpanded);
|
|
10590
|
-
const onClick = () => {
|
|
10591
|
-
var _a2;
|
|
10592
|
-
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
|
|
10593
|
-
if (!isControlled("expanded", props)) {
|
|
10594
|
-
setExpanded(!expanded);
|
|
10595
|
-
}
|
|
10596
|
-
};
|
|
10597
|
-
useEffect21(() => {
|
|
10598
|
-
if (isControlled("expanded", props)) {
|
|
10599
|
-
setExpanded(props.expanded);
|
|
10600
|
-
}
|
|
10601
|
-
}, [props.expanded]);
|
|
10602
|
-
return /* @__PURE__ */ createElement32("svg", {
|
|
10603
|
-
"data-name": "expander-icon",
|
|
10604
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10605
|
-
height: `${size}px`,
|
|
10606
|
-
viewBox: "0 0 24 24",
|
|
10607
|
-
width: `${size}px`,
|
|
10608
|
-
style: props.style,
|
|
10609
|
-
onClick,
|
|
10610
|
-
className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
|
|
10611
|
-
direction: direction || "start",
|
|
10612
|
-
expanded
|
|
10613
|
-
}), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`, `InfiniteIcon-expander--${direction === "end" ? "end" : "start"}`)
|
|
10614
|
-
}, /* @__PURE__ */ createElement32("path", {
|
|
10615
|
-
d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
10616
|
-
}));
|
|
10617
|
-
}
|
|
10618
|
-
|
|
10619
|
-
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
10620
|
-
import {
|
|
10621
|
-
createElement as createElement33
|
|
10622
|
-
} from "react";
|
|
10623
|
-
|
|
10624
|
-
// src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
|
|
10625
|
-
var LoadingIconCls = "_16lm1iw8 _16lm1iwi _16lm1iwe";
|
|
10626
|
-
|
|
10627
|
-
// src/components/InfiniteTable/components/icons/LoadingIcon.tsx
|
|
10628
|
-
var LoadingIcon = (props) => {
|
|
10629
|
-
return /* @__PURE__ */ createElement33("svg", {
|
|
10630
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10631
|
-
style: {
|
|
10632
|
-
margin: "auto",
|
|
10633
|
-
display: "block",
|
|
10634
|
-
shapeRendering: "auto"
|
|
10635
|
-
},
|
|
10636
|
-
width: "24px",
|
|
10637
|
-
height: "24px",
|
|
10638
|
-
viewBox: "0 0 100 100",
|
|
10639
|
-
preserveAspectRatio: "xMidYMid",
|
|
10640
|
-
className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
|
|
10641
|
-
}, /* @__PURE__ */ createElement33("circle", {
|
|
10642
|
-
cx: "50",
|
|
10643
|
-
cy: "50",
|
|
10644
|
-
fill: "none",
|
|
10645
|
-
strokeWidth: "10",
|
|
10646
|
-
r: "35",
|
|
10647
|
-
strokeDasharray: "164.93361431346415 56.97787143782138"
|
|
10648
|
-
}, /* @__PURE__ */ createElement33("animateTransform", {
|
|
10649
|
-
attributeName: "transform",
|
|
10650
|
-
type: "rotate",
|
|
10651
|
-
repeatCount: "indefinite",
|
|
10652
|
-
dur: "1s",
|
|
10653
|
-
values: "0 50 50;360 50 50",
|
|
10654
|
-
keyTimes: "0;1"
|
|
10655
|
-
})));
|
|
10656
|
-
};
|
|
10657
|
-
|
|
10658
|
-
// src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
|
|
10659
|
-
function styleForGroupColumn({
|
|
10660
|
-
rowInfo
|
|
10661
|
-
}) {
|
|
10662
|
-
return {
|
|
10663
|
-
[stripVar(ThemeVars.components.Row.groupNesting)]: rowInfo.dataSourceHasGrouping ? rowInfo.isGroupRow ? rowInfo.groupNesting - 1 : rowInfo.groupNesting : 0
|
|
10664
|
-
};
|
|
10665
|
-
}
|
|
10666
|
-
function getGroupColumnRender({
|
|
10667
|
-
groupIndexForColumn,
|
|
10668
|
-
groupRenderStrategy
|
|
10669
|
-
}) {
|
|
10670
|
-
return (renderOptions) => {
|
|
10671
|
-
const { rowInfo, renderBag, column } = renderOptions;
|
|
10672
|
-
let { value: valueToRender, groupIcon, selectionCheckBox } = renderBag;
|
|
10673
|
-
const groupRowInfo = rowInfo;
|
|
10674
|
-
if (groupRenderStrategy === "multi-column") {
|
|
10675
|
-
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting && groupRowInfo.isGroupRow) {
|
|
10676
|
-
return null;
|
|
10677
|
-
}
|
|
10678
|
-
} else if (groupRenderStrategy === "single-column" && !groupRowInfo.isGroupRow) {
|
|
10679
|
-
}
|
|
10680
|
-
return /* @__PURE__ */ createElement34("div", {
|
|
10681
|
-
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)
|
|
10682
|
-
}, groupIcon, selectionCheckBox, /* @__PURE__ */ createElement34("div", {
|
|
10683
|
-
className: cssEllipsisClassName
|
|
10684
|
-
}, valueToRender != null ? valueToRender : null));
|
|
10685
|
-
};
|
|
10686
|
-
}
|
|
10687
|
-
function getGroupColumnRenderGroupIcon({
|
|
10688
|
-
groupIndexForColumn,
|
|
10689
|
-
groupRenderStrategy,
|
|
10690
|
-
toggleGroupRow,
|
|
10691
|
-
initialRenderGroupIcon
|
|
10692
|
-
}) {
|
|
10693
|
-
return (renderOptions) => {
|
|
10694
|
-
var _a, _b, _c;
|
|
10695
|
-
const { rowInfo, value, groupBy, pivotBy, column } = renderOptions;
|
|
10696
|
-
const groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : rowInfo.isGroupRow && ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
|
|
10697
|
-
if (!groupRowInfo) {
|
|
10698
|
-
return null;
|
|
10699
|
-
}
|
|
10700
|
-
const collapsed = groupRowInfo.collapsed;
|
|
10701
|
-
if (groupRenderStrategy === "inline") {
|
|
10702
|
-
if (groupRowInfo.groupCount === 1) {
|
|
10703
|
-
return value;
|
|
10704
|
-
}
|
|
10705
|
-
if (groupRowInfo.groupNesting === groupIndexForColumn && collapsed) {
|
|
10706
|
-
return null;
|
|
10707
|
-
}
|
|
10708
|
-
} else {
|
|
10709
|
-
if (!groupRowInfo.isGroupRow) {
|
|
10710
|
-
return null;
|
|
10711
|
-
}
|
|
10712
|
-
if (groupRenderStrategy === "multi-column") {
|
|
10713
|
-
if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting) {
|
|
10714
|
-
return null;
|
|
10715
|
-
}
|
|
10716
|
-
}
|
|
10717
|
-
}
|
|
10718
|
-
const groupKeys = groupRowInfo.groupKeys;
|
|
10719
|
-
let icon = null;
|
|
10720
|
-
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);
|
|
10721
|
-
const isLoading = showLoadingIcon(groupRowInfo);
|
|
10722
|
-
if (isLoading) {
|
|
10723
|
-
icon = /* @__PURE__ */ createElement34(LoadingIcon, null);
|
|
10724
|
-
} else if (showExpanderIcon) {
|
|
10725
|
-
const defaultIcon = /* @__PURE__ */ createElement34(ExpanderIcon, {
|
|
10726
|
-
expanded: !collapsed,
|
|
10727
|
-
direction: column.align === "end" ? "end" : "start",
|
|
10728
|
-
onChange: () => {
|
|
10729
|
-
toggleGroupRow(groupKeys);
|
|
10730
|
-
}
|
|
10731
|
-
});
|
|
10732
|
-
icon = defaultIcon;
|
|
10856
|
+
if (deleteKey) {
|
|
10857
|
+
map2.delete = deleteKey;
|
|
10733
10858
|
}
|
|
10734
|
-
if (
|
|
10735
|
-
|
|
10736
|
-
icon = /* @__PURE__ */ createElement34(RenderHookComponent, {
|
|
10737
|
-
render: initialRenderGroupIcon,
|
|
10738
|
-
renderParam: renderOptions
|
|
10739
|
-
});
|
|
10859
|
+
if (clear) {
|
|
10860
|
+
map2.clear = clear;
|
|
10740
10861
|
}
|
|
10741
|
-
return icon;
|
|
10742
10862
|
};
|
|
10743
10863
|
}
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
initialRenderGroupIcon: userDefinedGroupColumn == null ? void 0 : userDefinedGroupColumn.renderGroupIcon,
|
|
10762
|
-
groupIndexForColumn,
|
|
10763
|
-
toggleGroupRow,
|
|
10764
|
-
groupRenderStrategy
|
|
10765
|
-
})
|
|
10766
|
-
});
|
|
10767
|
-
if (groupColumnFromProps) {
|
|
10768
|
-
if (typeof groupColumnFromProps === "function") {
|
|
10769
|
-
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps(options, toggleGroupRow));
|
|
10770
|
-
} else {
|
|
10771
|
-
generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps);
|
|
10864
|
+
|
|
10865
|
+
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
10866
|
+
function computeColumnGroupsDepths(columnGroups) {
|
|
10867
|
+
const map2 = new Map();
|
|
10868
|
+
columnGroups.forEach((colGroup, colGroupId) => {
|
|
10869
|
+
let parentGroupId = colGroup.columnGroup;
|
|
10870
|
+
let depth = 0;
|
|
10871
|
+
while (parentGroupId) {
|
|
10872
|
+
const parent = columnGroups.get(parentGroupId);
|
|
10873
|
+
if (!parent) {
|
|
10874
|
+
if (false) {
|
|
10875
|
+
console.warn(`Cannot find column group ${parentGroupId}`);
|
|
10876
|
+
}
|
|
10877
|
+
break;
|
|
10878
|
+
}
|
|
10879
|
+
depth++;
|
|
10880
|
+
parentGroupId = parent.columnGroup;
|
|
10772
10881
|
}
|
|
10773
|
-
|
|
10774
|
-
return generatedGroupColumn;
|
|
10775
|
-
}
|
|
10776
|
-
function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
|
|
10777
|
-
const theGroupColumnFromProps = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : groupColumnFromProps;
|
|
10778
|
-
let generatedGroupColumn = __spreadProps(__spreadValues({
|
|
10779
|
-
header: `Group`,
|
|
10780
|
-
groupByField: options.groupBy.map((g) => g.field),
|
|
10781
|
-
sortable: false,
|
|
10782
|
-
renderSelectionCheckBox: options.selectionMode === "multi-row",
|
|
10783
|
-
style: styleForGroupColumn,
|
|
10784
|
-
render: getGroupColumnRender({
|
|
10785
|
-
groupIndexForColumn: 0,
|
|
10786
|
-
groupRenderStrategy: "single-column"
|
|
10787
|
-
})
|
|
10788
|
-
}, groupColumnFromProps), {
|
|
10789
|
-
renderGroupIcon: getGroupColumnRenderGroupIcon({
|
|
10790
|
-
initialRenderGroupIcon: theGroupColumnFromProps == null ? void 0 : theGroupColumnFromProps.renderGroupIcon,
|
|
10791
|
-
groupIndexForColumn: 0,
|
|
10792
|
-
toggleGroupRow,
|
|
10793
|
-
groupRenderStrategy: "single-column"
|
|
10794
|
-
})
|
|
10882
|
+
map2.set(colGroupId, depth);
|
|
10795
10883
|
});
|
|
10796
|
-
return
|
|
10884
|
+
return map2;
|
|
10885
|
+
}
|
|
10886
|
+
|
|
10887
|
+
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
10888
|
+
function useColumnGroups() {
|
|
10889
|
+
const {
|
|
10890
|
+
componentState: {
|
|
10891
|
+
computedColumnGroups,
|
|
10892
|
+
collapsedColumnGroups
|
|
10893
|
+
},
|
|
10894
|
+
componentActions,
|
|
10895
|
+
getComponentState
|
|
10896
|
+
} = useComponentState();
|
|
10897
|
+
useEffect21(() => {
|
|
10898
|
+
const recompute = () => {
|
|
10899
|
+
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
10900
|
+
};
|
|
10901
|
+
const update = rafFn(recompute);
|
|
10902
|
+
return interceptMap(computedColumnGroups, {
|
|
10903
|
+
clear: update,
|
|
10904
|
+
delete: update,
|
|
10905
|
+
set: update
|
|
10906
|
+
});
|
|
10907
|
+
}, [computedColumnGroups]);
|
|
10908
|
+
useEffect21(() => {
|
|
10909
|
+
return interceptMap(collapsedColumnGroups, {
|
|
10910
|
+
set: (key, visibleCol) => {
|
|
10911
|
+
const colIds = key.slice(1);
|
|
10912
|
+
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10913
|
+
colIds.forEach((colId) => {
|
|
10914
|
+
columnVisibility[colId] = false;
|
|
10915
|
+
});
|
|
10916
|
+
delete columnVisibility[visibleCol];
|
|
10917
|
+
componentActions.columnVisibility = columnVisibility;
|
|
10918
|
+
},
|
|
10919
|
+
beforeClear: (currentCollapsedGroups) => {
|
|
10920
|
+
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10921
|
+
const keys = [...currentCollapsedGroups.keys()];
|
|
10922
|
+
keys.forEach((key) => {
|
|
10923
|
+
const colIds = key.slice(1);
|
|
10924
|
+
colIds.forEach((colId) => {
|
|
10925
|
+
delete columnVisibility[colId];
|
|
10926
|
+
});
|
|
10927
|
+
});
|
|
10928
|
+
componentActions.columnVisibility = columnVisibility;
|
|
10929
|
+
},
|
|
10930
|
+
delete: (key) => {
|
|
10931
|
+
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
10932
|
+
const colIds = key.slice(1);
|
|
10933
|
+
colIds.forEach((colId) => {
|
|
10934
|
+
delete columnVisibility[colId];
|
|
10935
|
+
});
|
|
10936
|
+
componentActions.columnVisibility = columnVisibility;
|
|
10937
|
+
}
|
|
10938
|
+
});
|
|
10939
|
+
}, [collapsedColumnGroups]);
|
|
10940
|
+
}
|
|
10941
|
+
|
|
10942
|
+
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
10943
|
+
import { useMemo as useMemo8 } from "react";
|
|
10944
|
+
function useColumnRowspan(computedVisibleColumns) {
|
|
10945
|
+
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
10946
|
+
const rowspan = useMemo8(() => {
|
|
10947
|
+
const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
|
|
10948
|
+
return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
|
|
10949
|
+
const dataArray = getDataSourceState().dataArray;
|
|
10950
|
+
const rowInfo = dataArray[rowIndex];
|
|
10951
|
+
if (!rowInfo) {
|
|
10952
|
+
return 1;
|
|
10953
|
+
}
|
|
10954
|
+
const data = rowInfo.data;
|
|
10955
|
+
const column = computedVisibleColumns[colIndex];
|
|
10956
|
+
if (!column || !column.rowspan) {
|
|
10957
|
+
return 1;
|
|
10958
|
+
}
|
|
10959
|
+
return column.rowspan({
|
|
10960
|
+
column,
|
|
10961
|
+
data,
|
|
10962
|
+
dataArray,
|
|
10963
|
+
rowInfo,
|
|
10964
|
+
rowIndex
|
|
10965
|
+
});
|
|
10966
|
+
} : void 0;
|
|
10967
|
+
}, [computedVisibleColumns]);
|
|
10968
|
+
return rowspan;
|
|
10969
|
+
}
|
|
10970
|
+
|
|
10971
|
+
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
10972
|
+
import { useCallback as useCallback15 } from "react";
|
|
10973
|
+
var debug4 = dbg("useColumnSizeFn");
|
|
10974
|
+
function useColumnSizeFn(columns) {
|
|
10975
|
+
const columnSize = useCallback15((index) => {
|
|
10976
|
+
const column = columns[index];
|
|
10977
|
+
if (false) {
|
|
10978
|
+
debug4("cannot find column at index", index, columns);
|
|
10979
|
+
}
|
|
10980
|
+
return column ? column.computedWidth : 0;
|
|
10981
|
+
}, [columns]);
|
|
10982
|
+
return columnSize;
|
|
10797
10983
|
}
|
|
10798
10984
|
|
|
10985
|
+
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
10986
|
+
import { useEffect as useEffect23, useMemo as useMemo9 } from "react";
|
|
10987
|
+
|
|
10799
10988
|
// src/components/InfiniteTable/hooks/useEffectWithRaf.ts
|
|
10800
10989
|
import { useEffect as useEffect22, useRef as useRef21 } from "react";
|
|
10801
10990
|
function useEffectWithRaf(fn, deps) {
|
|
@@ -10983,17 +11172,19 @@ function useColumnsWhenGrouping() {
|
|
|
10983
11172
|
componentState: {
|
|
10984
11173
|
columns,
|
|
10985
11174
|
groupColumn,
|
|
11175
|
+
hideColumnWhenGrouped,
|
|
10986
11176
|
groupRenderStrategy,
|
|
10987
11177
|
pivotColumns,
|
|
10988
11178
|
pivotColumn,
|
|
10989
11179
|
pivotTotalColumnPosition,
|
|
10990
11180
|
pivotGrandTotalColumnPosition
|
|
10991
|
-
}
|
|
11181
|
+
},
|
|
11182
|
+
getComponentState
|
|
10992
11183
|
} = useComponentState();
|
|
10993
11184
|
const toggleGroupRow = useToggleGroupRow();
|
|
10994
11185
|
useEffect23(() => {
|
|
10995
11186
|
const update = () => {
|
|
10996
|
-
const columnsWhenGrouping = getColumnsWhenGrouping({
|
|
11187
|
+
const { columns: columnsWhenGrouping, groupColumnIds } = getColumnsWhenGrouping({
|
|
10997
11188
|
columns,
|
|
10998
11189
|
groupColumn,
|
|
10999
11190
|
pivotColumn,
|
|
@@ -11007,6 +11198,23 @@ function useColumnsWhenGrouping() {
|
|
|
11007
11198
|
selectionMode
|
|
11008
11199
|
});
|
|
11009
11200
|
componentActions.columnsWhenGrouping = columnsWhenGrouping;
|
|
11201
|
+
let currentColumnOrder = getComponentState().columnOrder;
|
|
11202
|
+
if (groupColumnIds.length && Array.isArray(currentColumnOrder)) {
|
|
11203
|
+
const colOrder = new Set(currentColumnOrder);
|
|
11204
|
+
let shouldUpdate = false;
|
|
11205
|
+
groupColumnIds.forEach((groupColId) => {
|
|
11206
|
+
if (!colOrder.has(groupColId)) {
|
|
11207
|
+
shouldUpdate = true;
|
|
11208
|
+
currentColumnOrder = [
|
|
11209
|
+
groupColId,
|
|
11210
|
+
...currentColumnOrder
|
|
11211
|
+
];
|
|
11212
|
+
}
|
|
11213
|
+
});
|
|
11214
|
+
if (shouldUpdate) {
|
|
11215
|
+
componentActions.columnOrder = currentColumnOrder;
|
|
11216
|
+
}
|
|
11217
|
+
}
|
|
11010
11218
|
};
|
|
11011
11219
|
update();
|
|
11012
11220
|
return interceptMap(columns, {
|
|
@@ -11019,6 +11227,7 @@ function useColumnsWhenGrouping() {
|
|
|
11019
11227
|
groupBy,
|
|
11020
11228
|
pivotBy,
|
|
11021
11229
|
selectionMode,
|
|
11230
|
+
hideColumnWhenGrouped,
|
|
11022
11231
|
groupColumn,
|
|
11023
11232
|
groupRenderStrategy,
|
|
11024
11233
|
pivotColumns,
|
|
@@ -11043,6 +11252,7 @@ function useHideColumns(groupByMap) {
|
|
|
11043
11252
|
componentState: {
|
|
11044
11253
|
columnTypes,
|
|
11045
11254
|
computedColumns,
|
|
11255
|
+
hideColumnWhenGrouped,
|
|
11046
11256
|
hideEmptyGroupColumns,
|
|
11047
11257
|
groupRenderStrategy
|
|
11048
11258
|
}
|
|
@@ -11132,30 +11342,54 @@ function useHideColumns(groupByMap) {
|
|
|
11132
11342
|
useEffect23(() => {
|
|
11133
11343
|
const isGrouped = groupBy.length > 0;
|
|
11134
11344
|
const currentState = getComponentState();
|
|
11135
|
-
const {
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11345
|
+
const {
|
|
11346
|
+
columnVisibility,
|
|
11347
|
+
columnVisibilityForGrouping,
|
|
11348
|
+
hideColumnWhenGrouped: hideColumnWhenGrouped2
|
|
11349
|
+
} = currentState;
|
|
11139
11350
|
const newColumnVisibility = __spreadValues({}, columnVisibility);
|
|
11140
|
-
let
|
|
11351
|
+
let newColumnVisibilityForGrouping = __spreadValues({}, columnVisibilityForGrouping);
|
|
11352
|
+
let updatedVisibilityWhenGrouping = false;
|
|
11353
|
+
let newlyHiddenColumns = new Set();
|
|
11354
|
+
let newlyDisplayedColumns = new Set();
|
|
11141
11355
|
computedColumns.forEach((col, id) => {
|
|
11142
|
-
if (col.defaultHiddenWhenGroupedBy) {
|
|
11143
|
-
const
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11356
|
+
if (col.defaultHiddenWhenGroupedBy || hideColumnWhenGrouped2 != null) {
|
|
11357
|
+
const hideWhenGrouped = 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);
|
|
11358
|
+
if (hideWhenGrouped) {
|
|
11359
|
+
if (newColumnVisibilityForGrouping[id] !== false) {
|
|
11360
|
+
if (columnVisibility[id] === false) {
|
|
11361
|
+
return;
|
|
11362
|
+
}
|
|
11363
|
+
newColumnVisibilityForGrouping[id] = false;
|
|
11364
|
+
updatedVisibilityWhenGrouping = true;
|
|
11365
|
+
newlyHiddenColumns.add(id);
|
|
11366
|
+
}
|
|
11367
|
+
} else {
|
|
11368
|
+
if (newColumnVisibilityForGrouping[id] === false) {
|
|
11369
|
+
delete newColumnVisibilityForGrouping[id];
|
|
11370
|
+
updatedVisibilityWhenGrouping = true;
|
|
11371
|
+
newlyDisplayedColumns.add(id);
|
|
11151
11372
|
}
|
|
11152
11373
|
}
|
|
11153
11374
|
}
|
|
11154
11375
|
});
|
|
11155
|
-
if (
|
|
11376
|
+
if (updatedVisibilityWhenGrouping) {
|
|
11377
|
+
componentActions.columnVisibilityForGrouping = newColumnVisibilityForGrouping;
|
|
11378
|
+
newlyDisplayedColumns.forEach((colId) => {
|
|
11379
|
+
delete newColumnVisibility[colId];
|
|
11380
|
+
});
|
|
11381
|
+
newlyHiddenColumns.forEach((colId) => {
|
|
11382
|
+
newColumnVisibility[colId] = false;
|
|
11383
|
+
});
|
|
11156
11384
|
componentActions.columnVisibility = newColumnVisibility;
|
|
11157
11385
|
}
|
|
11158
|
-
}, [
|
|
11386
|
+
}, [
|
|
11387
|
+
computedColumns,
|
|
11388
|
+
columnTypes,
|
|
11389
|
+
groupBy,
|
|
11390
|
+
groupByMap,
|
|
11391
|
+
hideColumnWhenGrouped
|
|
11392
|
+
]);
|
|
11159
11393
|
}
|
|
11160
11394
|
function getColumnsWhenGrouping(params) {
|
|
11161
11395
|
const {
|
|
@@ -11172,9 +11406,10 @@ function getColumnsWhenGrouping(params) {
|
|
|
11172
11406
|
columns
|
|
11173
11407
|
} = params;
|
|
11174
11408
|
if (groupRenderStrategy === "inline") {
|
|
11175
|
-
return void 0;
|
|
11409
|
+
return { columns: void 0, groupColumnIds: [] };
|
|
11176
11410
|
}
|
|
11177
11411
|
const computedColumns = new Map();
|
|
11412
|
+
const groupColumnIds = [];
|
|
11178
11413
|
if (groupRenderStrategy === "multi-column") {
|
|
11179
11414
|
groupBy.forEach((groupByForColumn, groupIndexForColumn, arr) => {
|
|
11180
11415
|
const generatedGroupColumn = getColumnForGroupBy({
|
|
@@ -11186,7 +11421,9 @@ function getColumnsWhenGrouping(params) {
|
|
|
11186
11421
|
groupRenderStrategy,
|
|
11187
11422
|
selectionMode
|
|
11188
11423
|
}, toggleGroupRow, groupColumn);
|
|
11189
|
-
|
|
11424
|
+
const groupColumnId = generatedGroupColumn.id || `group-by-${groupByForColumn.field}`;
|
|
11425
|
+
groupColumnIds.push(groupColumnId);
|
|
11426
|
+
computedColumns.set(groupColumnId, generatedGroupColumn);
|
|
11190
11427
|
});
|
|
11191
11428
|
} else if (groupRenderStrategy === "single-column" && groupBy.length) {
|
|
11192
11429
|
const singleGroupColumn = getSingleGroupColumn({
|
|
@@ -11196,7 +11433,9 @@ function getColumnsWhenGrouping(params) {
|
|
|
11196
11433
|
groupRenderStrategy,
|
|
11197
11434
|
selectionMode
|
|
11198
11435
|
}, toggleGroupRow, groupColumn);
|
|
11199
|
-
|
|
11436
|
+
const groupColumnId = singleGroupColumn.id || "group-by";
|
|
11437
|
+
groupColumnIds.push(groupColumnId);
|
|
11438
|
+
computedColumns.set(groupColumnId, singleGroupColumn);
|
|
11200
11439
|
}
|
|
11201
11440
|
if (pivotColumns) {
|
|
11202
11441
|
const columnsByField = {};
|
|
@@ -11243,7 +11482,10 @@ function getColumnsWhenGrouping(params) {
|
|
|
11243
11482
|
computedColumns.set(colId, col);
|
|
11244
11483
|
});
|
|
11245
11484
|
}
|
|
11246
|
-
return
|
|
11485
|
+
return {
|
|
11486
|
+
columns: computedColumns.size ? computedColumns : void 0,
|
|
11487
|
+
groupColumnIds
|
|
11488
|
+
};
|
|
11247
11489
|
}
|
|
11248
11490
|
|
|
11249
11491
|
// src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
|
|
@@ -11303,6 +11545,33 @@ var getComputedPinned = (colId, columnPinning) => {
|
|
|
11303
11545
|
const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
|
|
11304
11546
|
return computedPinned;
|
|
11305
11547
|
};
|
|
11548
|
+
function isGroupColumnSortable(column, columns) {
|
|
11549
|
+
var _a;
|
|
11550
|
+
let sortableColumnOrType = (_a = column.sortable) != null ? _a : column.colType.sortable;
|
|
11551
|
+
if (sortableColumnOrType != null) {
|
|
11552
|
+
return sortableColumnOrType;
|
|
11553
|
+
}
|
|
11554
|
+
if (column.computedSortable === false) {
|
|
11555
|
+
return false;
|
|
11556
|
+
}
|
|
11557
|
+
let groupByField = column.groupByField || [];
|
|
11558
|
+
if (groupByField != null && !Array.isArray(groupByField)) {
|
|
11559
|
+
groupByField = [groupByField];
|
|
11560
|
+
}
|
|
11561
|
+
const fields = (groupByField || []).reduce((acc, field) => {
|
|
11562
|
+
acc[field] = true;
|
|
11563
|
+
return acc;
|
|
11564
|
+
}, {});
|
|
11565
|
+
const groupColumns = [];
|
|
11566
|
+
columns.forEach((col) => {
|
|
11567
|
+
if (col.field && fields[col.field]) {
|
|
11568
|
+
groupColumns.push(col);
|
|
11569
|
+
}
|
|
11570
|
+
});
|
|
11571
|
+
return groupColumns.reduce((sortable, col) => {
|
|
11572
|
+
return sortable && col.computedSortable === true;
|
|
11573
|
+
}, true);
|
|
11574
|
+
}
|
|
11306
11575
|
var getComputedVisibleColumns = ({
|
|
11307
11576
|
columns,
|
|
11308
11577
|
bodySize,
|
|
@@ -11349,12 +11618,16 @@ var getComputedVisibleColumns = ({
|
|
|
11349
11618
|
const result2 = isColumnVisible(columnVisibility, columnVisibilityAssumeVisible, colId);
|
|
11350
11619
|
return result2;
|
|
11351
11620
|
});
|
|
11352
|
-
const
|
|
11621
|
+
const columnIdsToVisibleIndex = new Map();
|
|
11622
|
+
const visibleColumnsArray = visibleColumnOrder.map((columnId, index) => {
|
|
11623
|
+
const col = columns.get(columnId);
|
|
11624
|
+
columnIdsToVisibleIndex.set(columnId, index);
|
|
11625
|
+
return col;
|
|
11626
|
+
});
|
|
11353
11627
|
const sortedMap = (sortInfo != null ? sortInfo : []).reduce((acc, info, index) => {
|
|
11354
11628
|
if (info.id) {
|
|
11355
11629
|
acc[info.id] = { sortInfo: info, index };
|
|
11356
|
-
}
|
|
11357
|
-
if (info.field) {
|
|
11630
|
+
} else if (info.field) {
|
|
11358
11631
|
acc[info.field] = {
|
|
11359
11632
|
sortInfo: info,
|
|
11360
11633
|
index
|
|
@@ -11362,54 +11635,57 @@ var getComputedVisibleColumns = ({
|
|
|
11362
11635
|
}
|
|
11363
11636
|
return acc;
|
|
11364
11637
|
}, {});
|
|
11638
|
+
function getColSize(colId) {
|
|
11639
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11640
|
+
const column = columns.get(colId);
|
|
11641
|
+
const colType = getColumnComputedType(column, columnTypes);
|
|
11642
|
+
const colTypeSizing = {
|
|
11643
|
+
minWidth: colType == null ? void 0 : colType.minWidth,
|
|
11644
|
+
maxWidth: colType == null ? void 0 : colType.maxWidth,
|
|
11645
|
+
width: colType == null ? void 0 : colType.defaultWidth,
|
|
11646
|
+
flex: colType == null ? void 0 : colType.defaultFlex
|
|
11647
|
+
};
|
|
11648
|
+
let colSizing = assignNonNull({
|
|
11649
|
+
width: column == null ? void 0 : column.defaultWidth,
|
|
11650
|
+
flex: column == null ? void 0 : column.defaultFlex,
|
|
11651
|
+
minWidth: column == null ? void 0 : column.minWidth,
|
|
11652
|
+
maxWidth: column == null ? void 0 : column.maxWidth
|
|
11653
|
+
}, columnSizing[colId]);
|
|
11654
|
+
if (colSizing.width != null) {
|
|
11655
|
+
delete colTypeSizing.flex;
|
|
11656
|
+
}
|
|
11657
|
+
if (colSizing.flex != null) {
|
|
11658
|
+
delete colTypeSizing.width;
|
|
11659
|
+
}
|
|
11660
|
+
colSizing = assignNonNull(colTypeSizing, colSizing);
|
|
11661
|
+
const colFlex = (_a = colSizing.flex) != null ? _a : void 0;
|
|
11662
|
+
const colMinWidth = (_c = (_b = colSizing.minWidth) != null ? _b : column == null ? void 0 : column.minWidth) != null ? _c : columnMinWidth;
|
|
11663
|
+
const colMaxWidth = (_e = (_d = colSizing.maxWidth) != null ? _d : column == null ? void 0 : column.maxWidth) != null ? _e : columnMaxWidth;
|
|
11664
|
+
let size = colFlex != void 0 ? void 0 : (_f = colSizing.width) != null ? _f : columnDefaultWidth;
|
|
11665
|
+
if (!size && colFlex == void 0) {
|
|
11666
|
+
size = colMinWidth;
|
|
11667
|
+
}
|
|
11668
|
+
return {
|
|
11669
|
+
size,
|
|
11670
|
+
flex: colFlex,
|
|
11671
|
+
minSize: colMinWidth,
|
|
11672
|
+
maxSize: colMaxWidth
|
|
11673
|
+
};
|
|
11674
|
+
}
|
|
11365
11675
|
const flexResult = computeFlex({
|
|
11366
11676
|
availableSize: Math.max(bodySize.width - (viewportReservedWidth != null ? viewportReservedWidth : 0) - getScrollbarWidth(), 0),
|
|
11367
11677
|
maxSize: columnMaxWidth,
|
|
11368
11678
|
minSize: columnMinWidth,
|
|
11369
|
-
items: visibleColumnOrder.map(
|
|
11370
|
-
var _a, _b, _c, _d, _e, _f;
|
|
11371
|
-
const column = columns.get(colId);
|
|
11372
|
-
const colType = getColumnComputedType(column, columnTypes);
|
|
11373
|
-
const colTypeSizing = {
|
|
11374
|
-
minWidth: colType == null ? void 0 : colType.minWidth,
|
|
11375
|
-
maxWidth: colType == null ? void 0 : colType.maxWidth,
|
|
11376
|
-
width: colType == null ? void 0 : colType.defaultWidth,
|
|
11377
|
-
flex: colType == null ? void 0 : colType.defaultFlex
|
|
11378
|
-
};
|
|
11379
|
-
let colSizing = assignNonNull({
|
|
11380
|
-
width: column == null ? void 0 : column.defaultWidth,
|
|
11381
|
-
flex: column == null ? void 0 : column.defaultFlex,
|
|
11382
|
-
minWidth: column == null ? void 0 : column.minWidth,
|
|
11383
|
-
maxWidth: column == null ? void 0 : column.maxWidth
|
|
11384
|
-
}, columnSizing[colId]);
|
|
11385
|
-
if (colSizing.width != null) {
|
|
11386
|
-
delete colTypeSizing.flex;
|
|
11387
|
-
}
|
|
11388
|
-
if (colSizing.flex != null) {
|
|
11389
|
-
delete colTypeSizing.width;
|
|
11390
|
-
}
|
|
11391
|
-
colSizing = assignNonNull(colTypeSizing, colSizing);
|
|
11392
|
-
const colFlex = (_a = colSizing.flex) != null ? _a : void 0;
|
|
11393
|
-
const colMinWidth = (_c = (_b = colSizing.minWidth) != null ? _b : column == null ? void 0 : column.minWidth) != null ? _c : columnMinWidth;
|
|
11394
|
-
const colMaxWidth = (_e = (_d = colSizing.maxWidth) != null ? _d : column == null ? void 0 : column.maxWidth) != null ? _e : columnMaxWidth;
|
|
11395
|
-
let size = colFlex != void 0 ? void 0 : (_f = colSizing.width) != null ? _f : columnDefaultWidth;
|
|
11396
|
-
if (!size && colFlex == void 0) {
|
|
11397
|
-
size = colMinWidth;
|
|
11398
|
-
}
|
|
11399
|
-
return {
|
|
11400
|
-
size,
|
|
11401
|
-
flex: colFlex,
|
|
11402
|
-
minSize: colMinWidth,
|
|
11403
|
-
maxSize: colMaxWidth
|
|
11404
|
-
};
|
|
11405
|
-
})
|
|
11679
|
+
items: visibleColumnOrder.map(getColSize)
|
|
11406
11680
|
});
|
|
11407
11681
|
const { computedSizes, flexSizes, minSizes, maxSizes } = flexResult;
|
|
11408
11682
|
const computedPinnedStartColumns = [];
|
|
11409
11683
|
const computedPinnedEndColumns = [];
|
|
11410
11684
|
const computedUnpinnedColumns = [];
|
|
11411
11685
|
const computedVisibleColumns = [];
|
|
11686
|
+
computedVisibleColumns.length = visibleColumnOrder.length;
|
|
11412
11687
|
const computedVisibleColumnsMap = new Map();
|
|
11688
|
+
const computedColumnsMap = new Map();
|
|
11413
11689
|
let computedUnpinnedColumnsWidth = 0;
|
|
11414
11690
|
let computedPinnedStartColumnsWidth = 0;
|
|
11415
11691
|
let computedPinnedEndColumnsWidth = 0;
|
|
@@ -11418,7 +11694,7 @@ var getComputedVisibleColumns = ({
|
|
|
11418
11694
|
let totalPinnedStartWidth = 0;
|
|
11419
11695
|
let totalUnpinnedWidth = 0;
|
|
11420
11696
|
let totalPinnedEndWidth = 0;
|
|
11421
|
-
|
|
11697
|
+
visibleColumnsArray.forEach((_c, i) => {
|
|
11422
11698
|
const id = visibleColumnOrder[i];
|
|
11423
11699
|
const computedWidth = computedSizes[i];
|
|
11424
11700
|
const pinned = computedPinnedArray[i] = getComputedPinned(id, columnPinning);
|
|
@@ -11431,39 +11707,56 @@ var getComputedVisibleColumns = ({
|
|
|
11431
11707
|
}
|
|
11432
11708
|
});
|
|
11433
11709
|
const firstPinnedEndAbsoluteOffset = bodySize.width - totalPinnedEndWidth;
|
|
11434
|
-
|
|
11710
|
+
const groupColumns = [];
|
|
11711
|
+
const orderedColumns = new Map();
|
|
11712
|
+
visibleColumnOrder.forEach((id, index) => {
|
|
11713
|
+
const c = visibleColumnsArray[index];
|
|
11714
|
+
orderedColumns.set(id, c);
|
|
11715
|
+
});
|
|
11716
|
+
columns.forEach((c, key) => {
|
|
11717
|
+
if (!orderedColumns.has(key)) {
|
|
11718
|
+
orderedColumns.set(key, c);
|
|
11719
|
+
}
|
|
11720
|
+
});
|
|
11721
|
+
const fieldsToColumn = new Map();
|
|
11722
|
+
orderedColumns.forEach((c, id) => {
|
|
11435
11723
|
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;
|
|
11436
|
-
|
|
11437
|
-
|
|
11724
|
+
let theComputedVisibleIndex = columnIdsToVisibleIndex.get(id);
|
|
11725
|
+
if (theComputedVisibleIndex == void 0) {
|
|
11726
|
+
theComputedVisibleIndex = -1;
|
|
11727
|
+
}
|
|
11728
|
+
const computedVisible = theComputedVisibleIndex != -1;
|
|
11729
|
+
const nextColumnId = visibleColumnOrder[theComputedVisibleIndex + 1];
|
|
11438
11730
|
const colType = getColumnComputedType(c, columnTypes);
|
|
11439
|
-
const computedVisibleIndex =
|
|
11731
|
+
const computedVisibleIndex = theComputedVisibleIndex;
|
|
11440
11732
|
const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
|
|
11441
11733
|
const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
|
|
11442
11734
|
const computedSorted = !!computedSortInfo;
|
|
11443
11735
|
const computedSortedAsc = computedSorted && computedSortInfo.dir === 1;
|
|
11444
11736
|
const computedSortedDesc = computedSorted && !computedSortedAsc;
|
|
11445
11737
|
const computedSortIndex = (_c = sortingInfo == null ? void 0 : sortingInfo.index) != null ? _c : -1;
|
|
11446
|
-
const
|
|
11447
|
-
const
|
|
11448
|
-
const
|
|
11449
|
-
const
|
|
11450
|
-
const
|
|
11451
|
-
const
|
|
11738
|
+
const colSizeForNonVisibleColumn = computedVisible ? {} : getColSize(id);
|
|
11739
|
+
const computedWidth = computedVisible ? computedSizes[theComputedVisibleIndex] : colSizeForNonVisibleColumn.size || 0;
|
|
11740
|
+
const computedFlex = computedVisible ? flexSizes[theComputedVisibleIndex] || null : null;
|
|
11741
|
+
const computedMinWidth = computedVisible ? minSizes[theComputedVisibleIndex] || 0 : colSizeForNonVisibleColumn.minSize || 0;
|
|
11742
|
+
const computedMaxWidth = computedVisible ? maxSizes[theComputedVisibleIndex] || 1e4 : colSizeForNonVisibleColumn.maxSize || 1e4;
|
|
11743
|
+
const computedPinned = computedVisible ? getComputedPinned(id, columnPinning) : false;
|
|
11744
|
+
const computedLast = computedVisible ? theComputedVisibleIndex === visibleColumnOrder.length - 1 : false;
|
|
11452
11745
|
let computedVisibleIndexInCategory = computedVisibleIndex;
|
|
11453
|
-
const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
|
|
11746
|
+
const computedPinningOffset = computedVisible ? computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth : 0;
|
|
11454
11747
|
if (computedPinned == "start") {
|
|
11455
|
-
computedVisibleIndexInCategory = computedVisibleIndex;
|
|
11748
|
+
computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex : -1;
|
|
11456
11749
|
} else if (computedPinned === "end") {
|
|
11457
|
-
computedVisibleIndexInCategory = computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length);
|
|
11750
|
+
computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length) : -1;
|
|
11458
11751
|
} else {
|
|
11459
|
-
computedVisibleIndexInCategory = computedVisibleIndex - computedPinnedStartColumns.length;
|
|
11752
|
+
computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex - computedPinnedStartColumns.length : -1;
|
|
11460
11753
|
}
|
|
11461
|
-
const computedAbsoluteOffset = computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth;
|
|
11462
|
-
const computedFirstInCategory = computedPinned !== prevPinned;
|
|
11463
|
-
const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
|
|
11754
|
+
const computedAbsoluteOffset = computedVisible ? computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth : -1;
|
|
11755
|
+
const computedFirstInCategory = computedVisible ? computedPinned !== prevPinned : false;
|
|
11756
|
+
const computedLastInCategory = computedVisible ? computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning) : false;
|
|
11464
11757
|
const cssEllipsis = (_e = (_d = c.cssEllipsis) != null ? _d : colType.cssEllipsis) != null ? _e : columnCssEllipsis;
|
|
11465
11758
|
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;
|
|
11466
|
-
const computedFilterValue = filterValueRecord[id] || c.field ? filterValueRecord[c.field] || null : null;
|
|
11759
|
+
const computedFilterValue = computedVisible ? filterValueRecord[id] || c.field ? filterValueRecord[c.field] || null : null : null;
|
|
11467
11760
|
const computedFiltered = computedFilterValue != null;
|
|
11468
11761
|
const computedFilterable = (_l = (_k = c.defaultFilterable) != null ? _k : colType.defaultFilterable) != null ? _l : true;
|
|
11469
11762
|
const computedDataType = c.dataType || colType.dataType || (Array.isArray(c.type) ? c.type[0] : c.type) || "string";
|
|
@@ -11472,14 +11765,16 @@ var getComputedVisibleColumns = ({
|
|
|
11472
11765
|
const field = (_m = c.field) != null ? _m : colType.field;
|
|
11473
11766
|
const valueGetter = (_n = c.valueGetter) != null ? _n : colType.valueGetter;
|
|
11474
11767
|
let sortableColumnOrType = (_o = c.sortable) != null ? _o : colType.sortable;
|
|
11475
|
-
if (sortableColumnOrType == null) {
|
|
11768
|
+
if (sortableColumnOrType == null && !c.groupByField) {
|
|
11476
11769
|
if (field == null && valueGetter == null) {
|
|
11477
11770
|
sortableColumnOrType = false;
|
|
11478
11771
|
}
|
|
11479
11772
|
}
|
|
11480
11773
|
let computedSortable = (_p = sortableColumnOrType != null ? sortableColumnOrType : sortable) != null ? _p : true;
|
|
11481
11774
|
const result2 = __spreadProps(__spreadValues({
|
|
11775
|
+
colType,
|
|
11482
11776
|
align: colType.align,
|
|
11777
|
+
computedVisible,
|
|
11483
11778
|
verticalAlign: colType.verticalAlign,
|
|
11484
11779
|
defaultHiddenWhenGroupedBy: colType.defaultHiddenWhenGroupedBy,
|
|
11485
11780
|
valueGetter,
|
|
@@ -11522,16 +11817,17 @@ var getComputedVisibleColumns = ({
|
|
|
11522
11817
|
computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
|
|
11523
11818
|
computedFirstInCategory,
|
|
11524
11819
|
computedLastInCategory,
|
|
11525
|
-
computedFirst:
|
|
11820
|
+
computedFirst: theComputedVisibleIndex === 0,
|
|
11526
11821
|
computedLast,
|
|
11527
11822
|
toggleSort: () => {
|
|
11528
11823
|
const currentSortInfo = computedSortInfo;
|
|
11529
11824
|
let newColumnSortInfo;
|
|
11825
|
+
const field2 = result2.groupByField ? result2.groupByField : c.field;
|
|
11530
11826
|
if (!currentSortInfo) {
|
|
11531
11827
|
newColumnSortInfo = {
|
|
11532
11828
|
dir: 1,
|
|
11533
11829
|
id,
|
|
11534
|
-
field:
|
|
11830
|
+
field: field2,
|
|
11535
11831
|
type: computedSortType
|
|
11536
11832
|
};
|
|
11537
11833
|
} else {
|
|
@@ -11543,8 +11839,8 @@ var getComputedVisibleColumns = ({
|
|
|
11543
11839
|
});
|
|
11544
11840
|
}
|
|
11545
11841
|
}
|
|
11546
|
-
if (
|
|
11547
|
-
newColumnSortInfo.field =
|
|
11842
|
+
if (field2 && newColumnSortInfo && !newColumnSortInfo.field) {
|
|
11843
|
+
newColumnSortInfo.field = field2;
|
|
11548
11844
|
}
|
|
11549
11845
|
if (c.valueGetter && newColumnSortInfo && !newColumnSortInfo.valueGetter) {
|
|
11550
11846
|
newColumnSortInfo.valueGetter = (data) => c.valueGetter({ data, field: c.field });
|
|
@@ -11571,22 +11867,34 @@ var getComputedVisibleColumns = ({
|
|
|
11571
11867
|
id,
|
|
11572
11868
|
header: (_x = (_w = (_v = c.header) != null ? _v : colType.header) != null ? _w : c.name) != null ? _x : c.field
|
|
11573
11869
|
});
|
|
11574
|
-
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
|
|
11582
|
-
|
|
11583
|
-
|
|
11584
|
-
|
|
11585
|
-
|
|
11586
|
-
|
|
11587
|
-
|
|
11588
|
-
|
|
11589
|
-
|
|
11870
|
+
if (computedVisible) {
|
|
11871
|
+
computedOffset += computedWidth;
|
|
11872
|
+
computedVisibleColumnsMap.set(result2.id, result2);
|
|
11873
|
+
computedVisibleColumns[theComputedVisibleIndex] = result2;
|
|
11874
|
+
if (computedPinned === "start") {
|
|
11875
|
+
computedPinnedStartColumns.push(result2);
|
|
11876
|
+
computedPinnedStartColumnsWidth += result2.computedWidth;
|
|
11877
|
+
}
|
|
11878
|
+
if (computedPinned === "end") {
|
|
11879
|
+
computedPinnedEndColumns.push(result2);
|
|
11880
|
+
computedPinnedEndColumnsWidth += result2.computedWidth;
|
|
11881
|
+
}
|
|
11882
|
+
if (!computedPinned) {
|
|
11883
|
+
computedUnpinnedColumns.push(result2);
|
|
11884
|
+
computedUnpinnedColumnsWidth += result2.computedWidth;
|
|
11885
|
+
}
|
|
11886
|
+
prevPinned = computedPinned;
|
|
11887
|
+
}
|
|
11888
|
+
if (result2.groupByField) {
|
|
11889
|
+
groupColumns.push(result2);
|
|
11890
|
+
}
|
|
11891
|
+
computedColumnsMap.set(result2.id, result2);
|
|
11892
|
+
if (result2.field && !result2.groupByField && !fieldsToColumn.has(result2.field)) {
|
|
11893
|
+
fieldsToColumn.set(result2.field, result2);
|
|
11894
|
+
}
|
|
11895
|
+
});
|
|
11896
|
+
groupColumns.forEach((col) => {
|
|
11897
|
+
col.computedSortable = isGroupColumnSortable(col, computedColumnsMap);
|
|
11590
11898
|
});
|
|
11591
11899
|
const computedPinnedStartWidth = pinnedStartMaxWidth != null ? Math.min(pinnedStartMaxWidth, computedPinnedStartColumnsWidth) : computedPinnedStartColumnsWidth;
|
|
11592
11900
|
const computedPinnedEndWidth = pinnedEndMaxWidth != null ? Math.min(pinnedEndMaxWidth, computedPinnedEndColumnsWidth) : computedPinnedEndColumnsWidth;
|
|
@@ -11602,12 +11910,14 @@ var getComputedVisibleColumns = ({
|
|
|
11602
11910
|
computedPinnedEndOffset: computedPinnedStartColumnsWidth + computedUnpinnedColumnsWidth,
|
|
11603
11911
|
computedUnpinnedColumns,
|
|
11604
11912
|
computedVisibleColumns,
|
|
11913
|
+
computedColumnsMap,
|
|
11605
11914
|
computedVisibleColumnsMap,
|
|
11606
11915
|
computedPinnedEndWidth,
|
|
11607
11916
|
computedPinnedStartWidth,
|
|
11608
11917
|
renderSelectionCheckBox: computedVisibleColumns.reduce((bool, c) => {
|
|
11609
11918
|
return bool || !!c.renderSelectionCheckBox;
|
|
11610
|
-
}, false)
|
|
11919
|
+
}, false),
|
|
11920
|
+
fieldsToColumn
|
|
11611
11921
|
};
|
|
11612
11922
|
return result;
|
|
11613
11923
|
};
|
|
@@ -11669,7 +11979,9 @@ var useComputedVisibleColumns = ({
|
|
|
11669
11979
|
computedPinnedEndOffset,
|
|
11670
11980
|
computedPinnedEndWidth,
|
|
11671
11981
|
computedPinnedStartWidth,
|
|
11672
|
-
renderSelectionCheckBox
|
|
11982
|
+
renderSelectionCheckBox,
|
|
11983
|
+
computedColumnsMap,
|
|
11984
|
+
fieldsToColumn
|
|
11673
11985
|
} = useMemo10(() => {
|
|
11674
11986
|
return getComputedVisibleColumns({
|
|
11675
11987
|
columns,
|
|
@@ -11722,6 +12034,7 @@ var useComputedVisibleColumns = ({
|
|
|
11722
12034
|
const result = {
|
|
11723
12035
|
renderSelectionCheckBox,
|
|
11724
12036
|
columns,
|
|
12037
|
+
computedColumnsMap,
|
|
11725
12038
|
computedPinnedEndWidth,
|
|
11726
12039
|
computedPinnedStartWidth,
|
|
11727
12040
|
computedRemainingSpace,
|
|
@@ -11735,7 +12048,8 @@ var useComputedVisibleColumns = ({
|
|
|
11735
12048
|
computedUnpinnedColumns,
|
|
11736
12049
|
computedVisibleColumns,
|
|
11737
12050
|
computedVisibleColumnsMap,
|
|
11738
|
-
computedColumnOrder
|
|
12051
|
+
computedColumnOrder,
|
|
12052
|
+
fieldsToColumn
|
|
11739
12053
|
};
|
|
11740
12054
|
return result;
|
|
11741
12055
|
};
|
|
@@ -11829,7 +12143,9 @@ function useComputed() {
|
|
|
11829
12143
|
computedRemainingSpace,
|
|
11830
12144
|
computedPinnedStartWidth,
|
|
11831
12145
|
computedPinnedEndWidth,
|
|
11832
|
-
renderSelectionCheckBox
|
|
12146
|
+
renderSelectionCheckBox,
|
|
12147
|
+
computedColumnsMap,
|
|
12148
|
+
fieldsToColumn
|
|
11833
12149
|
} = useComputedVisibleColumns({
|
|
11834
12150
|
columns,
|
|
11835
12151
|
columnCssEllipsis: componentState.columnCssEllipsis,
|
|
@@ -11873,6 +12189,7 @@ function useComputed() {
|
|
|
11873
12189
|
columnSize,
|
|
11874
12190
|
rowspan,
|
|
11875
12191
|
toggleGroupRow,
|
|
12192
|
+
computedColumnsMap,
|
|
11876
12193
|
renderSelectionCheckBox,
|
|
11877
12194
|
computedPinnedStartOverflow,
|
|
11878
12195
|
computedPinnedEndOverflow,
|
|
@@ -11890,7 +12207,8 @@ function useComputed() {
|
|
|
11890
12207
|
computedPinnedEndColumnsWidth,
|
|
11891
12208
|
computedUnpinnedColumnsWidth,
|
|
11892
12209
|
computedUnpinnedOffset,
|
|
11893
|
-
computedPinnedEndOffset
|
|
12210
|
+
computedPinnedEndOffset,
|
|
12211
|
+
fieldsToColumn
|
|
11894
12212
|
};
|
|
11895
12213
|
}
|
|
11896
12214
|
|
|
@@ -12056,7 +12374,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
12056
12374
|
const valid = useMemo11(() => {
|
|
12057
12375
|
let valid2 = isValidLicense(licenseKey, {
|
|
12058
12376
|
publishedAt: 1624970570587,
|
|
12059
|
-
version: "0.4.
|
|
12377
|
+
version: "0.4.5"
|
|
12060
12378
|
});
|
|
12061
12379
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
12062
12380
|
return true;
|
|
@@ -12236,6 +12554,7 @@ function initSetupState2() {
|
|
|
12236
12554
|
onRowHeightCSSVarChange: buildSubscriptionCallback(),
|
|
12237
12555
|
onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
|
|
12238
12556
|
cellClick: buildSubscriptionCallback(),
|
|
12557
|
+
cellMouseDown: buildSubscriptionCallback(),
|
|
12239
12558
|
keyDown: buildSubscriptionCallback(),
|
|
12240
12559
|
bodySize: {
|
|
12241
12560
|
width: 0,
|
|
@@ -12250,6 +12569,7 @@ function initSetupState2() {
|
|
|
12250
12569
|
focused: false,
|
|
12251
12570
|
focusedWithin: false,
|
|
12252
12571
|
columnsWhenGrouping: columnsGeneratedForGrouping,
|
|
12572
|
+
columnVisibilityForGrouping: {},
|
|
12253
12573
|
pinnedStartScrollListener: new ScrollListener(),
|
|
12254
12574
|
pinnedEndScrollListener: new ScrollListener(),
|
|
12255
12575
|
columnsWhenInlineGroupRenderStrategy: void 0
|
|
@@ -12290,6 +12610,7 @@ var forwardProps4 = (setupState) => {
|
|
|
12290
12610
|
filterEditors: (filterEditors) => __spreadValues(__spreadValues({}, defaultFilterEditors), filterEditors),
|
|
12291
12611
|
viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
|
|
12292
12612
|
resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
|
|
12613
|
+
hideColumnWhenGrouped: (hideColumnWhenGrouped) => hideColumnWhenGrouped != null ? hideColumnWhenGrouped : false,
|
|
12293
12614
|
columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
|
|
12294
12615
|
columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 5e3,
|
|
12295
12616
|
columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
|
|
@@ -12366,6 +12687,7 @@ var mapPropsToState2 = (params) => {
|
|
|
12366
12687
|
groupRenderStrategy,
|
|
12367
12688
|
groupBy,
|
|
12368
12689
|
computedColumns,
|
|
12690
|
+
initialColumns: props.columns,
|
|
12369
12691
|
keyboardNavigation: (_a = props.keyboardNavigation) != null ? _a : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
|
|
12370
12692
|
columnHeaderCssEllipsis: (_c = (_b = props.columnHeaderCssEllipsis) != null ? _b : props.columnCssEllipsis) != null ? _c : true,
|
|
12371
12693
|
columnGroupsDepthsMap,
|