@infinite-table/infinite-react 0.4.3 → 0.4.6

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.js CHANGED
@@ -4223,8 +4223,8 @@ var InfiniteTableFooter = React15.forwardRef(function InfiniteTableFooter2(props
4223
4223
  });
4224
4224
 
4225
4225
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderCell.tsx
4226
- var React25 = __toModule(require("react"));
4227
- var import_react23 = __toModule(require("react"));
4226
+ var React28 = __toModule(require("react"));
4227
+ var import_react24 = __toModule(require("react"));
4228
4228
  var import_react_dom = __toModule(require("react-dom"));
4229
4229
 
4230
4230
  // src/components/DataSource/defaultFilterTypes.ts
@@ -4320,6 +4320,9 @@ function useCellClassName(column, baseClasses, variants, extraFlags) {
4320
4320
  if (column.computedLastInCategory) {
4321
4321
  result.push(...baseClasses.map((c) => `${c}--last-in-category`));
4322
4322
  }
4323
+ if (extraFlags.rowSelected) {
4324
+ result.push(...baseClasses.map((c) => `${c}--row-selected`));
4325
+ }
4323
4326
  if (column.computedPinned) {
4324
4327
  result.push(...baseClasses.map((c) => `${c}--pinned-${column.computedPinned}`));
4325
4328
  } else {
@@ -4912,11 +4915,49 @@ function shallowEqualObjects(objA, objB, ignoreKeys) {
4912
4915
  return true;
4913
4916
  }
4914
4917
 
4918
+ // src/components/InfiniteTable/hooks/adjustColumnOrderForAllColumns.ts
4919
+ function adjustColumnOrderForAllColumns(options) {
4920
+ const {
4921
+ newColumnOrder,
4922
+ visibleColumnOrder,
4923
+ existingColumnOrder,
4924
+ dragColumnId
4925
+ } = options;
4926
+ if (visibleColumnOrder.length !== newColumnOrder.length) {
4927
+ console.warn("new column order cannot contain less columns than the visible column order");
4928
+ return newColumnOrder;
4929
+ }
4930
+ const dragIndex = visibleColumnOrder.indexOf(dragColumnId);
4931
+ const dropIndex = newColumnOrder.indexOf(dragColumnId);
4932
+ if (dragIndex === dropIndex) {
4933
+ return existingColumnOrder;
4934
+ }
4935
+ if (dropIndex > dragIndex) {
4936
+ const indexInNewOrder = newColumnOrder.indexOf(dragColumnId);
4937
+ const prevColIdInNewOrder = newColumnOrder[indexInNewOrder - 1];
4938
+ const prevColIndexInExiting = existingColumnOrder.indexOf(prevColIdInNewOrder);
4939
+ const indexInExisting = existingColumnOrder.indexOf(dragColumnId);
4940
+ return moveXatY(existingColumnOrder, indexInExisting, prevColIndexInExiting);
4941
+ } else {
4942
+ const indexInNewOrder = newColumnOrder.indexOf(dragColumnId);
4943
+ const nextColIdInNewOrder = newColumnOrder[indexInNewOrder + 1];
4944
+ const nextColIndexInExiting = existingColumnOrder.indexOf(nextColIdInNewOrder);
4945
+ const indexInExisting = existingColumnOrder.indexOf(dragColumnId);
4946
+ return moveXatY(existingColumnOrder, indexInExisting, nextColIndexInExiting);
4947
+ }
4948
+ return newColumnOrder;
4949
+ }
4950
+
4915
4951
  // src/components/InfiniteTable/hooks/useColumnPointerEvents.ts
4916
4952
  var columnOffsetAtIndex4 = stripVar(InternalVars.columnOffsetAtIndex);
4917
4953
  var columnWidthAtIndex3 = stripVar(InternalVars.columnWidthAtIndex);
4918
4954
  var baseZIndexForCells2 = stripVar(InternalVars.baseZIndexForCells);
4919
4955
  var equalPinning = (pinning1, pinning2) => {
4956
+ const empty1 = !pinning1 || Object.keys(pinning1).length === 0;
4957
+ const empty2 = !pinning2 || Object.keys(pinning2).length === 0;
4958
+ if (empty1 && empty2) {
4959
+ return true;
4960
+ }
4920
4961
  if (!!pinning1 != !!pinning2) {
4921
4962
  return false;
4922
4963
  }
@@ -4983,14 +5024,19 @@ var useColumnPointerEvents = ({
4983
5024
  function persistColumnOrder(reorderDragResult2) {
4984
5025
  const { columnPinning, columnOrder } = reorderDragResult2;
4985
5026
  if (!equalPinning(getState().columnPinning, columnPinning)) {
4986
- console.log("update pinning");
4987
5027
  componentActions.columnPinning = columnPinning;
4988
5028
  }
4989
- if (JSON.stringify(columnOrder, getComputed().computedColumnOrder)) {
5029
+ const currentComputedColumnOrder = getComputed().computedColumnOrder;
5030
+ if (JSON.stringify(columnOrder, currentComputedColumnOrder)) {
4990
5031
  computedVisibleColumns.forEach((col) => {
4991
5032
  setInfiniteColumnOffsetWhileReordering(col.computedVisibleIndex, "", rootRef.current);
4992
5033
  });
4993
- componentActions.columnOrder = columnOrder;
5034
+ componentActions.columnOrder = adjustColumnOrderForAllColumns({
5035
+ newColumnOrder: columnOrder,
5036
+ visibleColumnOrder: getComputed().computedVisibleColumns.map((c) => c.id),
5037
+ existingColumnOrder: currentComputedColumnOrder,
5038
+ dragColumnId: columnId
5039
+ });
4994
5040
  }
4995
5041
  }
4996
5042
  const onPointerMove = (e2) => {
@@ -5051,11 +5097,255 @@ var useColumnPointerEvents = ({
5051
5097
  };
5052
5098
 
5053
5099
  // src/components/InfiniteTable/utils/RenderHookComponent.tsx
5054
- var React19 = __toModule(require("react"));
5100
+ var React22 = __toModule(require("react"));
5055
5101
 
5056
5102
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
5103
+ var React21 = __toModule(require("react"));
5104
+ var import_react19 = __toModule(require("react"));
5105
+
5106
+ // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
5057
5107
  var React18 = __toModule(require("react"));
5058
- var import_react18 = __toModule(require("react"));
5108
+
5109
+ // src/components/DataSource/state/rowInfoStatus.ts
5110
+ var showLoadingIcon = (rowInfo) => {
5111
+ if (rowInfo.dataSourceHasGrouping) {
5112
+ return rowInfo.isGroupRow ? rowInfo.childrenLoading || !rowInfo.selfLoaded : !rowInfo.selfLoaded;
5113
+ }
5114
+ return !rowInfo.selfLoaded;
5115
+ };
5116
+
5117
+ // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
5118
+ var React16 = __toModule(require("react"));
5119
+ var import_react17 = __toModule(require("react"));
5120
+
5121
+ // src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
5122
+ var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5123
+ var ExpanderIconCls = "_16lm1iw6 _16lm1iwi _16lm1iwe";
5124
+ 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"]] });
5125
+
5126
+ // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
5127
+ function ExpanderIcon(props) {
5128
+ var _a;
5129
+ const { size = 24, direction = "start" } = props;
5130
+ const [expanded, setExpanded] = (0, import_react17.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
5131
+ const onClick = () => {
5132
+ var _a2;
5133
+ (_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
5134
+ if (!isControlled("expanded", props)) {
5135
+ setExpanded(!expanded);
5136
+ }
5137
+ };
5138
+ React16.useEffect(() => {
5139
+ if (isControlled("expanded", props)) {
5140
+ setExpanded(props.expanded);
5141
+ }
5142
+ }, [props.expanded]);
5143
+ return /* @__PURE__ */ React16.createElement("svg", {
5144
+ "data-name": "expander-icon",
5145
+ xmlns: "http://www.w3.org/2000/svg",
5146
+ height: `${size}px`,
5147
+ viewBox: "0 0 24 24",
5148
+ width: `${size}px`,
5149
+ style: props.style,
5150
+ onClick,
5151
+ className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
5152
+ direction: direction || "start",
5153
+ expanded
5154
+ }), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`, `InfiniteIcon-expander--${direction === "end" ? "end" : "start"}`)
5155
+ }, /* @__PURE__ */ React16.createElement("path", {
5156
+ d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
5157
+ }));
5158
+ }
5159
+
5160
+ // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
5161
+ var React17 = __toModule(require("react"));
5162
+
5163
+ // src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
5164
+ var LoadingIconCls = "_16lm1iw8 _16lm1iwi _16lm1iwe";
5165
+
5166
+ // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
5167
+ var LoadingIcon = (props) => {
5168
+ return /* @__PURE__ */ React17.createElement("svg", {
5169
+ xmlns: "http://www.w3.org/2000/svg",
5170
+ style: {
5171
+ margin: "auto",
5172
+ display: "block",
5173
+ shapeRendering: "auto"
5174
+ },
5175
+ width: "24px",
5176
+ height: "24px",
5177
+ viewBox: "0 0 100 100",
5178
+ preserveAspectRatio: "xMidYMid",
5179
+ className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
5180
+ }, /* @__PURE__ */ React17.createElement("circle", {
5181
+ cx: "50",
5182
+ cy: "50",
5183
+ fill: "none",
5184
+ strokeWidth: "10",
5185
+ r: "35",
5186
+ strokeDasharray: "164.93361431346415 56.97787143782138"
5187
+ }, /* @__PURE__ */ React17.createElement("animateTransform", {
5188
+ attributeName: "transform",
5189
+ type: "rotate",
5190
+ repeatCount: "indefinite",
5191
+ dur: "1s",
5192
+ values: "0 50 50;360 50 50",
5193
+ keyTimes: "0;1"
5194
+ })));
5195
+ };
5196
+
5197
+ // src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
5198
+ var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5199
+ var GroupRowExpanderCls = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_7pupv0b", center: "_7pupv0c", end: "_7pupv0d" } }, defaultVariants: {}, compoundVariants: [] });
5200
+ 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: [] });
5201
+ var RowHoverCls = "_7pupv01";
5202
+
5203
+ // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
5204
+ function styleForGroupColumn({
5205
+ rowInfo
5206
+ }) {
5207
+ return {
5208
+ [stripVar(ThemeVars.components.Row.groupNesting)]: rowInfo.dataSourceHasGrouping ? rowInfo.isGroupRow ? rowInfo.groupNesting - 1 : rowInfo.groupNesting : 0
5209
+ };
5210
+ }
5211
+ function getGroupColumnRender({
5212
+ groupIndexForColumn,
5213
+ groupRenderStrategy
5214
+ }) {
5215
+ return (renderOptions) => {
5216
+ const { rowInfo, renderBag, column } = renderOptions;
5217
+ let { value: valueToRender, groupIcon, selectionCheckBox } = renderBag;
5218
+ const groupRowInfo = rowInfo;
5219
+ if (groupRenderStrategy === "multi-column") {
5220
+ if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting && groupRowInfo.isGroupRow) {
5221
+ return null;
5222
+ }
5223
+ } else if (groupRenderStrategy === "single-column" && !groupRowInfo.isGroupRow) {
5224
+ }
5225
+ return /* @__PURE__ */ React18.createElement("div", {
5226
+ 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)
5227
+ }, groupIcon, selectionCheckBox, /* @__PURE__ */ React18.createElement("div", {
5228
+ className: cssEllipsisClassName
5229
+ }, valueToRender != null ? valueToRender : null));
5230
+ };
5231
+ }
5232
+ function getGroupColumnRenderGroupIcon({
5233
+ groupIndexForColumn,
5234
+ groupRenderStrategy,
5235
+ toggleGroupRow,
5236
+ initialRenderGroupIcon
5237
+ }) {
5238
+ return (renderOptions) => {
5239
+ var _a, _b, _c;
5240
+ const {
5241
+ rowInfo,
5242
+ value,
5243
+ rootGroupBy: groupBy,
5244
+ pivotBy,
5245
+ column
5246
+ } = renderOptions;
5247
+ const groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : rowInfo.isGroupRow && ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
5248
+ if (!groupRowInfo) {
5249
+ return null;
5250
+ }
5251
+ const collapsed = groupRowInfo.collapsed;
5252
+ if (groupRenderStrategy === "inline") {
5253
+ if (groupRowInfo.groupCount === 1) {
5254
+ return value;
5255
+ }
5256
+ if (groupRowInfo.groupNesting === groupIndexForColumn && collapsed) {
5257
+ return null;
5258
+ }
5259
+ } else {
5260
+ if (!groupRowInfo.isGroupRow) {
5261
+ return null;
5262
+ }
5263
+ if (groupRenderStrategy === "multi-column") {
5264
+ if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting) {
5265
+ return null;
5266
+ }
5267
+ }
5268
+ }
5269
+ const groupKeys = groupRowInfo.groupKeys;
5270
+ let icon = null;
5271
+ 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);
5272
+ const isLoading = showLoadingIcon(groupRowInfo);
5273
+ if (isLoading) {
5274
+ icon = /* @__PURE__ */ React18.createElement(LoadingIcon, null);
5275
+ } else if (showExpanderIcon) {
5276
+ const defaultIcon = /* @__PURE__ */ React18.createElement(ExpanderIcon, {
5277
+ expanded: !collapsed,
5278
+ direction: column.align === "end" ? "end" : "start",
5279
+ onChange: () => {
5280
+ toggleGroupRow(groupKeys);
5281
+ }
5282
+ });
5283
+ icon = defaultIcon;
5284
+ }
5285
+ if (initialRenderGroupIcon) {
5286
+ renderOptions.renderBag.groupIcon = icon;
5287
+ icon = /* @__PURE__ */ React18.createElement(RenderCellHookComponent, {
5288
+ render: initialRenderGroupIcon,
5289
+ renderParam: renderOptions
5290
+ });
5291
+ }
5292
+ return icon;
5293
+ };
5294
+ }
5295
+ function getColumnForGroupBy(options, toggleGroupRow, groupColumnFromProps) {
5296
+ const { groupByForColumn, groupIndexForColumn, groupRenderStrategy } = options;
5297
+ let userDefinedGroupColumn = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : __spreadValues({}, groupColumnFromProps);
5298
+ if (groupByForColumn.column) {
5299
+ userDefinedGroupColumn = __spreadValues(__spreadValues({}, userDefinedGroupColumn), groupByForColumn.column);
5300
+ }
5301
+ let generatedGroupColumn = __spreadProps(__spreadValues({
5302
+ header: `Group by ${groupByForColumn.field}`,
5303
+ groupByField: groupByForColumn.field,
5304
+ render: getGroupColumnRender({
5305
+ groupIndexForColumn,
5306
+ groupRenderStrategy
5307
+ })
5308
+ }, userDefinedGroupColumn), {
5309
+ renderGroupIcon: getGroupColumnRenderGroupIcon({
5310
+ initialRenderGroupIcon: userDefinedGroupColumn == null ? void 0 : userDefinedGroupColumn.renderGroupIcon,
5311
+ groupIndexForColumn,
5312
+ toggleGroupRow,
5313
+ groupRenderStrategy
5314
+ })
5315
+ });
5316
+ if (groupColumnFromProps) {
5317
+ if (typeof groupColumnFromProps === "function") {
5318
+ generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps(options, toggleGroupRow));
5319
+ } else {
5320
+ generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps);
5321
+ }
5322
+ }
5323
+ return generatedGroupColumn;
5324
+ }
5325
+ function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
5326
+ const theGroupColumnFromProps = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : groupColumnFromProps;
5327
+ const base = {};
5328
+ if (options.sortable != void 0) {
5329
+ base.sortable = options.sortable;
5330
+ }
5331
+ let generatedGroupColumn = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, base), {
5332
+ header: `Group`,
5333
+ groupByField: options.groupBy.map((g) => g.field),
5334
+ renderSelectionCheckBox: options.selectionMode === "multi-row",
5335
+ render: getGroupColumnRender({
5336
+ groupIndexForColumn: 0,
5337
+ groupRenderStrategy: "single-column"
5338
+ })
5339
+ }), groupColumnFromProps), {
5340
+ renderGroupIcon: getGroupColumnRenderGroupIcon({
5341
+ initialRenderGroupIcon: theGroupColumnFromProps == null ? void 0 : theGroupColumnFromProps.renderGroupIcon,
5342
+ groupIndexForColumn: 0,
5343
+ toggleGroupRow,
5344
+ groupRenderStrategy: "single-column"
5345
+ })
5346
+ });
5347
+ return generatedGroupColumn;
5348
+ }
5059
5349
 
5060
5350
  // src/components/InfiniteTable/utils/objectValuesExcept.ts
5061
5351
  function objectValuesExcept(obj, exceptList) {
@@ -5068,14 +5358,14 @@ function objectValuesExcept(obj, exceptList) {
5068
5358
  }
5069
5359
 
5070
5360
  // src/components/InfiniteTable/components/cell.css.ts
5071
- var import_createRuntimeFn2 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5361
+ var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5072
5362
  var ColumnCellCls = "_1eexc2a6 _1eexc2a5 _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw2 _16lm1iw1r _16lm1iw1s _16lm1iwy";
5073
- var ColumnCellRecipe = (0, import_createRuntimeFn2.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"]] });
5363
+ var ColumnCellRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "_1eexc2a8", variantClassNames: { dragging: { false: "_1eexc2a9", true: "_1eexc2aa" }, rowActive: { false: "_1eexc2ab", true: "_1eexc2ac" }, zebra: { false: "_1eexc2ad", even: "_1eexc2ae", odd: "_1eexc2af" }, rowSelected: { true: "_1eexc2ag", false: "_1eexc2ah", null: "_1eexc2ai" }, first: { true: "_1eexc2aj", false: "_1eexc2ak" }, last: { true: "_1eexc2al", false: "_1eexc2am" }, groupByField: { true: "_1eexc2an", false: "_1eexc2ao" }, firstInCategory: { true: "_1eexc2ap", false: "_1eexc2aq" }, lastInCategory: { true: "_1eexc2ar", false: "_1eexc2as" }, pinned: { start: "_1eexc2at", end: "_1eexc2au", false: "_1eexc2av" }, filtered: { true: "_1eexc2aw", false: "_1eexc2ax" } }, defaultVariants: {}, compoundVariants: [[{ pinned: "start", lastInCategory: true }, "_1eexc2ay"], [{ pinned: "start", firstInCategory: true }, "_1eexc2az"], [{ pinned: "end", firstInCategory: true }, "_1eexc2a10"], [{ pinned: "end", lastInCategory: true }, "_1eexc2a11"]] });
5074
5364
  var SelectionCheckboxCls = "_1eexc2a7";
5075
5365
 
5076
5366
  // src/components/InfiniteTable/components/CheckBox.tsx
5077
- var React16 = __toModule(require("react"));
5078
- var import_react17 = __toModule(require("react"));
5367
+ var React19 = __toModule(require("react"));
5368
+ var import_react18 = __toModule(require("react"));
5079
5369
 
5080
5370
  // src/components/InfiniteTable/components/CheckBox.css.ts
5081
5371
  var CheckBoxCls = "_16lm1iwe";
@@ -5102,11 +5392,11 @@ var InfiniteCheckBoxRoot = getComponentStateRoot({
5102
5392
  function InfiniteCheckBoxComponent() {
5103
5393
  const { componentState, componentActions } = useComponentState();
5104
5394
  const { checked, domProps } = componentState;
5105
- const inputRef = (0, import_react17.useRef)(null);
5106
- (0, import_react17.useEffect)(() => {
5395
+ const inputRef = (0, import_react18.useRef)(null);
5396
+ (0, import_react18.useEffect)(() => {
5107
5397
  inputRef.current.indeterminate = checked == null;
5108
5398
  }, [checked]);
5109
- return /* @__PURE__ */ React16.createElement("input", __spreadProps(__spreadValues({}, domProps), {
5399
+ return /* @__PURE__ */ React19.createElement("input", __spreadProps(__spreadValues({}, domProps), {
5110
5400
  className: join(CheckBoxCls, domProps == null ? void 0 : domProps.className),
5111
5401
  type: "checkbox",
5112
5402
  ref: inputRef,
@@ -5117,19 +5407,162 @@ function InfiniteCheckBoxComponent() {
5117
5407
  }));
5118
5408
  }
5119
5409
  function InfiniteCheckBox(props) {
5120
- return /* @__PURE__ */ React16.createElement(InfiniteCheckBoxRoot, __spreadValues({}, props), /* @__PURE__ */ React16.createElement(InfiniteCheckBoxComponent, null));
5410
+ return /* @__PURE__ */ React19.createElement(InfiniteCheckBoxRoot, __spreadValues({}, props), /* @__PURE__ */ React19.createElement(InfiniteCheckBoxComponent, null));
5121
5411
  }
5122
5412
 
5123
- // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
5124
- var React17 = __toModule(require("react"));
5125
- var { rootClassName: rootClassName5 } = internalProps;
5126
- var InfiniteTableCellClassName = `${rootClassName5}Cell`;
5127
- var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
5128
- var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
5129
- var columnReorderEffectDurationAtIndex2 = stripVar(InternalVars.columnReorderEffectDurationAtIndex);
5130
- function InfiniteTableCellFn(props) {
5131
- var _b, _c, _d;
5132
- const _a = props, {
5413
+ // src/components/InfiniteTable/components/InfiniteTableRow/columnRendering.tsx
5414
+ function isColumnWithField(c) {
5415
+ return typeof c.field === "string";
5416
+ }
5417
+ function getGroupByColumn(options) {
5418
+ const { column, rowInfo, fieldsToColumn } = options;
5419
+ let groupByColumn = void 0;
5420
+ if (column.groupByField) {
5421
+ if (rowInfo.isGroupRow) {
5422
+ groupByColumn = fieldsToColumn.get(rowInfo.groupBy[rowInfo.groupBy.length - 1]);
5423
+ } else if (column.field) {
5424
+ groupByColumn = fieldsToColumn.get(column.field);
5425
+ }
5426
+ }
5427
+ return groupByColumn;
5428
+ }
5429
+ function getColumnRenderingParams(options) {
5430
+ const { column } = options;
5431
+ const groupByColumn = getGroupByColumn(options);
5432
+ const formattedResult = getFormattedValueContextForCell(__spreadProps(__spreadValues({}, options), {
5433
+ column: groupByColumn || column
5434
+ }));
5435
+ const { formattedValueContext } = formattedResult;
5436
+ return {
5437
+ stylingParam: __spreadValues({
5438
+ column: options.column
5439
+ }, formattedValueContext),
5440
+ formattedValueContext,
5441
+ renderFunctions: {
5442
+ renderGroupIcon: column.renderGroupIcon || (groupByColumn == null ? void 0 : groupByColumn.renderGroupIcon),
5443
+ renderSelectionCheckBox: column.renderSelectionCheckBox,
5444
+ renderValue: column.renderValue || (groupByColumn == null ? void 0 : groupByColumn.renderValue),
5445
+ renderGroupValue: column.renderGroupValue || (groupByColumn == null ? void 0 : groupByColumn.renderGroupValue),
5446
+ renderLeafValue: column.renderLeafValue || (groupByColumn == null ? void 0 : groupByColumn.renderLeafValue)
5447
+ },
5448
+ renderParams: getColumnRenderParam(__spreadProps(__spreadValues({}, options), {
5449
+ formattedValueContext
5450
+ })),
5451
+ groupByColumn
5452
+ };
5453
+ }
5454
+ function getColumnRenderParam(options) {
5455
+ const {
5456
+ column,
5457
+ context,
5458
+ rowInfo,
5459
+ columnsMap,
5460
+ fieldsToColumn,
5461
+ formattedValueContext
5462
+ } = options;
5463
+ const { value } = formattedValueContext;
5464
+ const { api: imperativeApi, getDataSourceState } = context;
5465
+ const { indexInAll: rowIndex } = rowInfo;
5466
+ const dataSourceState = getDataSourceState();
5467
+ const { selectionMode } = dataSourceState;
5468
+ const groupByColumn = getGroupByColumn({ rowInfo, column, fieldsToColumn });
5469
+ const toggleGroupRow = imperativeApi.toggleGroupRow;
5470
+ const renderParam = __spreadProps(__spreadValues({
5471
+ column,
5472
+ columnsMap,
5473
+ fieldsToColumn
5474
+ }, formattedValueContext), {
5475
+ groupByColumn,
5476
+ selectionMode,
5477
+ api: imperativeApi,
5478
+ selectRow: imperativeApi.selectionApi.selectRow,
5479
+ deselectRow: imperativeApi.selectionApi.deselectRow,
5480
+ toggleRowSelection: imperativeApi.selectionApi.toggleRowSelection,
5481
+ renderBag: {
5482
+ value,
5483
+ selectionCheckBox: null,
5484
+ groupIcon: null
5485
+ },
5486
+ selectCurrentRow: () => {
5487
+ return imperativeApi.selectionApi.selectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
5488
+ },
5489
+ deselectCurrentRow: () => {
5490
+ return imperativeApi.selectionApi.deselectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
5491
+ },
5492
+ rowIndex,
5493
+ toggleGroupRow,
5494
+ toggleCurrentGroupRow: () => {
5495
+ if (!rowInfo.isGroupRow) {
5496
+ return;
5497
+ }
5498
+ toggleGroupRow(rowInfo.groupKeys);
5499
+ },
5500
+ toggleCurrentGroupRowSelection: () => {
5501
+ if (!rowInfo.isGroupRow) {
5502
+ return;
5503
+ }
5504
+ return imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.isGroupRow ? rowInfo.groupKeys : []);
5505
+ },
5506
+ rootGroupBy: dataSourceState.groupBy,
5507
+ pivotBy: dataSourceState.pivotBy
5508
+ });
5509
+ return renderParam;
5510
+ }
5511
+ function getRawValueForCell(column, rowInfo) {
5512
+ const { data, isGroupRow, dataSourceHasGrouping } = rowInfo;
5513
+ const groupBy = dataSourceHasGrouping ? rowInfo.groupBy : void 0;
5514
+ let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
5515
+ if (column.valueGetter) {
5516
+ if (!rowInfo.isGroupRow && rowInfo.data) {
5517
+ value = column.valueGetter({ data: rowInfo.data, field: column.field });
5518
+ }
5519
+ }
5520
+ return value;
5521
+ }
5522
+ function getFormattedValueParamForCell(rawValue, column, rowInfo, context) {
5523
+ const { rowSelected, indexInAll: rowIndex } = rowInfo;
5524
+ const { activeRowIndex, keyboardNavigation } = context.getState();
5525
+ const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
5526
+ return rowInfo.isGroupRow ? {
5527
+ rowInfo,
5528
+ isGroupRow: rowInfo.isGroupRow,
5529
+ data: rowInfo.data,
5530
+ rowSelected,
5531
+ rowActive,
5532
+ value: rawValue,
5533
+ field: column.field
5534
+ } : {
5535
+ rowInfo,
5536
+ isGroupRow: rowInfo.isGroupRow,
5537
+ data: rowInfo.data,
5538
+ rowSelected,
5539
+ rowActive,
5540
+ value: rawValue,
5541
+ field: column.field
5542
+ };
5543
+ }
5544
+ function getFormattedValueContextForCell(options) {
5545
+ const { column, rowInfo, context } = options;
5546
+ const rawValue = getRawValueForCell(column, rowInfo);
5547
+ const formattedValueContext = getFormattedValueParamForCell(rawValue, column, rowInfo, context);
5548
+ const formattedValue = column.valueFormatter ? column.valueFormatter(formattedValueContext) : rawValue;
5549
+ formattedValueContext.value = formattedValue;
5550
+ return {
5551
+ formattedValue,
5552
+ formattedValueContext
5553
+ };
5554
+ }
5555
+
5556
+ // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableCell.tsx
5557
+ var React20 = __toModule(require("react"));
5558
+ var { rootClassName: rootClassName5 } = internalProps;
5559
+ var InfiniteTableCellClassName = `${rootClassName5}Cell`;
5560
+ var InfiniteTableCellContentClassName = `${rootClassName5}Cell_content`;
5561
+ var columnWidthAtIndex4 = stripVar(InternalVars.columnWidthAtIndex);
5562
+ var columnReorderEffectDurationAtIndex2 = stripVar(InternalVars.columnReorderEffectDurationAtIndex);
5563
+ function InfiniteTableCellFn(props) {
5564
+ var _b, _c, _d;
5565
+ const _a = props, {
5133
5566
  cssEllipsis = true,
5134
5567
  virtualized = true,
5135
5568
  skipColumnShifting = false,
@@ -5138,6 +5571,7 @@ function InfiniteTableCellFn(props) {
5138
5571
  domRef,
5139
5572
  width,
5140
5573
  contentClassName,
5574
+ rowId,
5141
5575
  afterChildren,
5142
5576
  beforeChildren,
5143
5577
  cellType,
@@ -5152,6 +5586,7 @@ function InfiniteTableCellFn(props) {
5152
5586
  "domRef",
5153
5587
  "width",
5154
5588
  "contentClassName",
5589
+ "rowId",
5155
5590
  "afterChildren",
5156
5591
  "beforeChildren",
5157
5592
  "cellType",
@@ -5168,25 +5603,28 @@ function InfiniteTableCellFn(props) {
5168
5603
  "data-column-id": column.id,
5169
5604
  "data-z-index": style.zIndex,
5170
5605
  className: join(domProps.className, justifyContent[(_b = column.align) != null ? _b : "start"], InfiniteTableCellClassName, ColumnCellCls),
5171
- children: /* @__PURE__ */ React17.createElement(React17.Fragment, null, beforeChildren, /* @__PURE__ */ React17.createElement("div", {
5606
+ children: /* @__PURE__ */ React20.createElement(React20.Fragment, null, beforeChildren, /* @__PURE__ */ React20.createElement("div", {
5172
5607
  className: join(InfiniteTableCellContentClassName, cssEllipsis ? cssEllipsisClassName : overflow.hidden, contentClassName),
5173
5608
  style: contentStyle
5174
5609
  }, children), afterChildren)
5175
5610
  });
5611
+ if (rowId != null) {
5612
+ finalDOMProps["data-row-id"] = `${rowId}`;
5613
+ }
5176
5614
  const RenderComponent = cellType === "body" ? (_c = column.components) == null ? void 0 : _c.ColumnCell : (_d = column.components) == null ? void 0 : _d.HeaderCell;
5177
5615
  if (RenderComponent) {
5178
- return /* @__PURE__ */ React17.createElement(RenderComponent, __spreadValues({}, finalDOMProps));
5616
+ return /* @__PURE__ */ React20.createElement(RenderComponent, __spreadValues({}, finalDOMProps));
5179
5617
  }
5180
- return /* @__PURE__ */ React17.createElement("div", __spreadProps(__spreadValues({}, finalDOMProps), {
5618
+ return /* @__PURE__ */ React20.createElement("div", __spreadProps(__spreadValues({}, finalDOMProps), {
5181
5619
  ref: domRef
5182
5620
  }));
5183
5621
  }
5184
- var InfiniteTableCell = React17.memo(InfiniteTableCellFn);
5622
+ var InfiniteTableCell = React20.memo(InfiniteTableCellFn);
5185
5623
 
5186
5624
  // src/components/InfiniteTable/components/InfiniteTableRow/InfiniteTableColumnCell.tsx
5187
5625
  var { rootClassName: rootClassName6 } = internalProps;
5188
5626
  var columnZIndexAtIndex4 = stripVar(InternalVars.columnZIndexAtIndex);
5189
- var InfiniteTableColumnCellContext = React18.createContext(null);
5627
+ var InfiniteTableColumnCellContext = React21.createContext(null);
5190
5628
  var InfiniteTableColumnCellClassName = `${rootClassName6}ColumnCell`;
5191
5629
  var defaultRenderSelectionCheckBox = (params) => {
5192
5630
  const {
@@ -5199,7 +5637,7 @@ var defaultRenderSelectionCheckBox = (params) => {
5199
5637
  if (rowInfo.isGroupRow && !column.groupByField) {
5200
5638
  return null;
5201
5639
  }
5202
- return /* @__PURE__ */ React18.createElement(InfiniteCheckBox, {
5640
+ return /* @__PURE__ */ React21.createElement(InfiniteCheckBox, {
5203
5641
  domProps: {
5204
5642
  className: SelectionCheckboxCls
5205
5643
  },
@@ -5217,8 +5655,12 @@ var defaultRenderSelectionCheckBox = (params) => {
5217
5655
  checked: rowInfo.rowSelected
5218
5656
  });
5219
5657
  };
5220
- function isColumnWithField(c) {
5221
- return typeof c.field === "string";
5658
+ function applyColumnClassName(columnClassName, param) {
5659
+ const colClassName = columnClassName ? typeof columnClassName === "function" ? columnClassName(param) : columnClassName : void 0;
5660
+ return colClassName;
5661
+ }
5662
+ function applyColumnStyle(existingStyle, columnStyle, param) {
5663
+ return typeof columnStyle === "function" ? __spreadValues(__spreadValues({}, existingStyle), columnStyle(param)) : __spreadValues(__spreadValues({}, existingStyle), columnStyle);
5222
5664
  }
5223
5665
  function InfiniteTableColumnCellFn(props) {
5224
5666
  var _a;
@@ -5230,55 +5672,59 @@ function InfiniteTableColumnCellFn(props) {
5230
5672
  column,
5231
5673
  onMouseLeave,
5232
5674
  onMouseEnter,
5233
- toggleGroupRow,
5234
5675
  rowIndex,
5235
5676
  rowHeight,
5236
5677
  columnsMap,
5678
+ fieldsToColumn,
5237
5679
  domRef,
5238
5680
  hidden,
5239
5681
  showZebraRows
5240
5682
  } = props;
5241
5683
  if (!column) {
5242
- return /* @__PURE__ */ React18.createElement("div", {
5684
+ return /* @__PURE__ */ React21.createElement("div", {
5243
5685
  ref: domRef
5244
5686
  }, "no column");
5245
5687
  }
5246
- const { data, isGroupRow, dataSourceHasGrouping, rowSelected } = rowInfo;
5247
- const groupBy = dataSourceHasGrouping ? rowInfo.groupBy : void 0;
5248
- const groupRowInfo = null;
5688
+ const { rowSelected } = rowInfo;
5249
5689
  const { getState, componentActions, imperativeApi } = useInfiniteTable();
5690
+ const { componentState: dataSourceState, getState: getDataSourceState } = useDataSourceContextValue();
5250
5691
  const { activeRowIndex, keyboardNavigation } = getState();
5251
5692
  const rowActive = rowIndex === activeRowIndex && keyboardNavigation === "row";
5252
- let value = isGroupRow && groupBy && column.groupByField ? rowInfo.value : isColumnWithField(column) ? data == null ? void 0 : data[column.field] : null;
5253
- if (column.valueGetter) {
5254
- if (!rowInfo.isGroupRow && rowInfo.data) {
5255
- value = column.valueGetter({ data: rowInfo.data, field: column.field });
5256
- }
5257
- }
5258
- if (column.valueFormatter) {
5259
- value = column.valueFormatter(isGroupRow ? {
5260
- data: rowInfo.data,
5261
- isGroupRow,
5262
- rowInfo,
5263
- rowActive,
5264
- field: column.field,
5265
- value
5266
- } : {
5267
- data: rowInfo.data,
5268
- isGroupRow,
5269
- rowActive,
5270
- rowInfo,
5271
- field: column.field,
5272
- value
5273
- });
5274
- }
5275
- const onClick = (0, import_react18.useCallback)((event) => {
5693
+ const renderingContext = {
5694
+ getState,
5695
+ getDataSourceState,
5696
+ actions: componentActions,
5697
+ api: imperativeApi
5698
+ };
5699
+ const {
5700
+ stylingParam,
5701
+ renderParams,
5702
+ formattedValueContext,
5703
+ renderFunctions,
5704
+ groupByColumn
5705
+ } = getColumnRenderingParams({
5706
+ column,
5707
+ rowInfo,
5708
+ columnsMap,
5709
+ fieldsToColumn,
5710
+ context: renderingContext
5711
+ });
5712
+ const renderParam = renderParams;
5713
+ const onClick = (0, import_react19.useCallback)((event) => {
5276
5714
  const colIndex = column.computedVisibleIndex;
5277
5715
  getState().cellClick({
5278
5716
  rowIndex,
5279
5717
  colIndex,
5280
5718
  event
5281
5719
  });
5720
+ }, [rowIndex, column.computedVisibleIndex, keyboardNavigation]);
5721
+ const onMouseDown = (0, import_react19.useCallback)((event) => {
5722
+ const colIndex = column.computedVisibleIndex;
5723
+ getState().cellMouseDown({
5724
+ rowIndex,
5725
+ colIndex,
5726
+ event
5727
+ });
5282
5728
  if (keyboardNavigation === "row") {
5283
5729
  componentActions.activeRowIndex = rowIndex;
5284
5730
  return;
@@ -5287,121 +5733,73 @@ function InfiniteTableColumnCellFn(props) {
5287
5733
  componentActions.activeCellIndex = [rowIndex, colIndex];
5288
5734
  }
5289
5735
  }, [rowIndex, column.computedVisibleIndex, keyboardNavigation]);
5290
- const { componentState: computedDataSource } = useDataSourceContextValue();
5291
- const { selectionMode } = computedDataSource;
5292
- const rest = rowInfo.isGroupRow ? {
5293
- rowInfo,
5294
- isGroupRow: rowInfo.isGroupRow,
5295
- data: rowInfo.data,
5296
- rowActive,
5297
- value,
5298
- field: column.field
5299
- } : {
5300
- rowInfo,
5301
- isGroupRow: rowInfo.isGroupRow,
5302
- data: rowInfo.data,
5303
- rowActive,
5304
- value,
5305
- field: column.field
5306
- };
5307
- const stylingRenderParam = __spreadValues({
5308
- column
5309
- }, rest);
5310
- const renderParam = __spreadProps(__spreadValues({
5311
- column,
5312
- columnsMap,
5313
- domRef,
5314
- groupRowInfo
5315
- }, rest), {
5316
- selectionMode,
5317
- selectRow: imperativeApi.selectionApi.selectRow,
5318
- deselectRow: imperativeApi.selectionApi.deselectRow,
5319
- toggleRowSelection: imperativeApi.selectionApi.toggleRowSelection,
5320
- renderBag: {
5321
- value,
5322
- selectionCheckBox: null,
5323
- groupIcon: null
5324
- },
5325
- selectCurrentRow: (0, import_react18.useCallback)(() => {
5326
- return imperativeApi.selectionApi.selectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
5327
- }, [rowInfo]),
5328
- deselectCurrentRow: (0, import_react18.useCallback)(() => {
5329
- return imperativeApi.selectionApi.deselectRow(rowInfo.id, rowInfo.dataSourceHasGrouping ? rowInfo.groupKeys : void 0);
5330
- }, [rowInfo]),
5331
- rowIndex,
5332
- toggleGroupRow,
5333
- toggleCurrentGroupRow: (0, import_react18.useCallback)(() => {
5334
- if (!rowInfo.isGroupRow) {
5335
- return;
5336
- }
5337
- toggleGroupRow(rowInfo.groupKeys);
5338
- }, [rowInfo]),
5339
- toggleCurrentGroupRowSelection: (0, import_react18.useCallback)(() => {
5340
- if (!rowInfo.isGroupRow) {
5341
- return;
5342
- }
5343
- return imperativeApi.selectionApi.toggleGroupRowSelection(rowInfo.isGroupRow ? rowInfo.groupKeys : []);
5344
- }, [rowInfo]),
5345
- groupBy: computedDataSource.groupBy,
5346
- pivotBy: computedDataSource.pivotBy
5347
- });
5348
- const renderChildren = (0, import_react18.useCallback)(() => {
5736
+ const { selectionMode } = dataSourceState;
5737
+ renderParam.domRef = domRef;
5738
+ renderParam.selectCurrentRow = (0, import_react19.useCallback)(renderParam.selectCurrentRow, [
5739
+ rowInfo
5740
+ ]);
5741
+ renderParam.deselectCurrentRow = (0, import_react19.useCallback)(renderParam.deselectCurrentRow, [
5742
+ rowInfo
5743
+ ]);
5744
+ renderParam.toggleCurrentGroupRow = (0, import_react19.useCallback)(renderParam.toggleCurrentGroupRow, [rowInfo]);
5745
+ renderParam.toggleCurrentGroupRowSelection = (0, import_react19.useCallback)(renderParam.toggleCurrentGroupRowSelection, [rowInfo]);
5746
+ const renderChildren = (0, import_react19.useCallback)(() => {
5349
5747
  if (hidden) {
5350
5748
  return null;
5351
5749
  }
5352
- if (column.renderGroupIcon) {
5353
- renderParam.renderBag.groupIcon = /* @__PURE__ */ React18.createElement(RenderCellHookComponent, {
5354
- render: column.renderGroupIcon,
5750
+ if (renderFunctions.renderGroupIcon) {
5751
+ renderParam.renderBag.groupIcon = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
5752
+ render: renderFunctions.renderGroupIcon,
5355
5753
  renderParam: __spreadProps(__spreadValues({}, renderParam), {
5356
5754
  renderBag: __spreadValues({}, renderParam.renderBag)
5357
5755
  })
5358
5756
  });
5359
5757
  }
5360
- if (column.renderSelectionCheckBox && selectionMode == "multi-row") {
5361
- renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React18.createElement(RenderCellHookComponent, {
5758
+ if (renderFunctions.renderSelectionCheckBox && selectionMode == "multi-row") {
5759
+ renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
5362
5760
  render: defaultRenderSelectionCheckBox,
5363
5761
  renderParam
5364
5762
  });
5365
- if (column.renderSelectionCheckBox !== true) {
5366
- renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React18.createElement(RenderCellHookComponent, {
5367
- render: column.renderSelectionCheckBox,
5763
+ if (renderFunctions.renderSelectionCheckBox !== true) {
5764
+ renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
5765
+ render: renderFunctions.renderSelectionCheckBox,
5368
5766
  renderParam: __spreadProps(__spreadValues({}, renderParam), {
5369
5767
  renderBag: __spreadValues({}, renderParam.renderBag)
5370
5768
  })
5371
5769
  });
5372
5770
  }
5373
5771
  }
5374
- if (column.renderValue) {
5375
- renderParam.renderBag.value = /* @__PURE__ */ React18.createElement(RenderCellHookComponent, {
5376
- render: column.renderValue,
5772
+ if (renderFunctions.renderValue) {
5773
+ renderParam.renderBag.value = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
5774
+ render: renderFunctions.renderValue,
5377
5775
  renderParam: __spreadProps(__spreadValues({}, renderParam), {
5378
5776
  renderBag: __spreadValues({}, renderParam.renderBag)
5379
5777
  })
5380
5778
  });
5381
5779
  }
5382
- if (rowInfo.isGroupRow && column.renderGroupValue) {
5383
- renderParam.renderBag.value = /* @__PURE__ */ React18.createElement(RenderCellHookComponent, {
5384
- render: column.renderGroupValue,
5780
+ if (rowInfo.isGroupRow && renderFunctions.renderGroupValue) {
5781
+ renderParam.renderBag.value = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
5782
+ render: renderFunctions.renderGroupValue,
5385
5783
  renderParam: __spreadProps(__spreadValues({}, renderParam), {
5386
5784
  renderBag: __spreadValues({}, renderParam.renderBag)
5387
5785
  })
5388
5786
  });
5389
5787
  }
5390
- if (!rowInfo.isGroupRow && column.renderLeafValue) {
5391
- renderParam.renderBag.value = /* @__PURE__ */ React18.createElement(RenderCellHookComponent, {
5392
- render: column.renderLeafValue,
5788
+ if (!rowInfo.isGroupRow && renderFunctions.renderLeafValue) {
5789
+ renderParam.renderBag.value = /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
5790
+ render: renderFunctions.renderLeafValue,
5393
5791
  renderParam: __spreadProps(__spreadValues({}, renderParam), {
5394
5792
  renderBag: __spreadValues({}, renderParam.renderBag)
5395
5793
  })
5396
5794
  });
5397
5795
  }
5398
5796
  if (column.render) {
5399
- return /* @__PURE__ */ React18.createElement(RenderCellHookComponent, {
5797
+ return /* @__PURE__ */ React21.createElement(RenderCellHookComponent, {
5400
5798
  render: column.render,
5401
5799
  renderParam
5402
5800
  });
5403
5801
  }
5404
- return /* @__PURE__ */ React18.createElement(React18.Fragment, null, column.align !== "end" ? renderParam.renderBag.groupIcon : null, column.align !== "end" ? renderParam.renderBag.selectionCheckBox : null, renderParam.renderBag.value, column.align === "end" ? renderParam.renderBag.selectionCheckBox : null, column.align === "end" ? renderParam.renderBag.groupIcon : null);
5802
+ return /* @__PURE__ */ React21.createElement(React21.Fragment, null, column.align !== "end" ? renderParam.renderBag.groupIcon : null, column.align !== "end" ? renderParam.renderBag.selectionCheckBox : null, renderParam.renderBag.value, column.align === "end" ? renderParam.renderBag.selectionCheckBox : null, column.align === "end" ? renderParam.renderBag.groupIcon : null);
5405
5803
  }, [
5406
5804
  column,
5407
5805
  hidden,
@@ -5409,19 +5807,34 @@ function InfiniteTableColumnCellFn(props) {
5409
5807
  renderBag: true
5410
5808
  })
5411
5809
  ]);
5412
- const rowPropsAndStyleArgs = __spreadProps(__spreadValues({}, rest), {
5810
+ const rowPropsAndStyleArgs = __spreadProps(__spreadValues({}, formattedValueContext), {
5413
5811
  rowIndex
5414
5812
  });
5415
5813
  const rowComputedClassName = typeof rowClassName === "function" ? rowClassName(rowPropsAndStyleArgs) : rowClassName;
5416
- const colClassName = column.className ? typeof column.className === "function" ? column.className(stylingRenderParam) : column.className : void 0;
5814
+ let colClassName = void 0;
5815
+ if (groupByColumn == null ? void 0 : groupByColumn.className) {
5816
+ colClassName = applyColumnClassName(groupByColumn.className, stylingParam);
5817
+ }
5818
+ if (column.className) {
5819
+ colClassName = join(colClassName, applyColumnClassName(column.className, stylingParam));
5820
+ }
5417
5821
  let style;
5822
+ if (rowInfo.dataSourceHasGrouping && column.groupByField) {
5823
+ style = styleForGroupColumn({ rowInfo });
5824
+ }
5418
5825
  if (rowStyle) {
5419
5826
  style = typeof rowStyle === "function" ? __spreadValues(__spreadValues({}, style), rowStyle(rowPropsAndStyleArgs)) : __spreadValues(__spreadValues({}, style), rowStyle);
5420
5827
  }
5421
- style = column.style ? typeof column.style === "function" ? __spreadValues(__spreadValues({}, style), column.style(stylingRenderParam) || {}) : __spreadValues(__spreadValues({}, style), column.style) : style || {};
5828
+ if (groupByColumn == null ? void 0 : groupByColumn.style) {
5829
+ style = applyColumnStyle(style, groupByColumn.style, stylingParam);
5830
+ }
5831
+ if (column.style) {
5832
+ style = applyColumnStyle(style, column.style, stylingParam);
5833
+ }
5834
+ style = style || {};
5422
5835
  style.height = rowHeight;
5423
5836
  style.zIndex = `var(${columnZIndexAtIndex4}-${column.computedVisibleIndex})`;
5424
- const memoizedStyle = (0, import_react18.useMemo)(() => style, [!style ? null : JSON.stringify(style)]);
5837
+ const memoizedStyle = (0, import_react19.useMemo)(() => style, [!style ? null : JSON.stringify(style)]);
5425
5838
  const odd = (rowInfo.indexInAll != null ? rowInfo.indexInAll : rowIndex) % 2 === 1;
5426
5839
  const zebra = showZebraRows ? odd ? "odd" : "even" : false;
5427
5840
  const cellProps = {
@@ -5429,19 +5842,21 @@ function InfiniteTableColumnCellFn(props) {
5429
5842
  cellType: "body",
5430
5843
  column,
5431
5844
  width,
5845
+ rowId: rowInfo.id,
5432
5846
  style: memoizedStyle,
5433
5847
  onMouseLeave,
5434
5848
  onMouseEnter,
5435
5849
  onClick,
5850
+ onMouseDown,
5436
5851
  cssEllipsis: (_a = column.cssEllipsis) != null ? _a : true,
5437
5852
  className: join(useCellClassName(column, [InfiniteTableColumnCellClassName, InfiniteTableCellClassName], ColumnCellRecipe, { dragging: false, zebra, rowActive, rowSelected }), colClassName, rowComputedClassName),
5438
5853
  renderChildren
5439
5854
  };
5440
- return /* @__PURE__ */ React18.createElement(InfiniteTableCell, __spreadValues({}, cellProps));
5855
+ return /* @__PURE__ */ React21.createElement(InfiniteTableCell, __spreadValues({}, cellProps));
5441
5856
  }
5442
- var InfiniteTableColumnCell = React18.memo(InfiniteTableColumnCellFn);
5857
+ var InfiniteTableColumnCell = React21.memo(InfiniteTableColumnCellFn);
5443
5858
  function useInfiniteColumnCell() {
5444
- const result = (0, import_react18.useContext)(InfiniteTableColumnCellContext);
5859
+ const result = (0, import_react19.useContext)(InfiniteTableColumnCellContext);
5445
5860
  return result;
5446
5861
  }
5447
5862
 
@@ -5452,25 +5867,25 @@ function RenderHookComponent(props) {
5452
5867
  }
5453
5868
  function RenderCellHookComponent(props) {
5454
5869
  const ContextProvider = InfiniteTableColumnCellContext.Provider;
5455
- return /* @__PURE__ */ React19.createElement(ContextProvider, {
5870
+ return /* @__PURE__ */ React22.createElement(ContextProvider, {
5456
5871
  value: props.renderParam
5457
- }, /* @__PURE__ */ React19.createElement(RenderHookComponent, {
5872
+ }, /* @__PURE__ */ React22.createElement(RenderHookComponent, {
5458
5873
  render: props.render,
5459
5874
  renderParam: props.renderParam
5460
5875
  }));
5461
5876
  }
5462
5877
  function RenderHeaderCellHookComponent(props) {
5463
5878
  const ContextProvider = InfiniteTableHeaderCellContext.Provider;
5464
- return /* @__PURE__ */ React19.createElement(ContextProvider, {
5879
+ return /* @__PURE__ */ React22.createElement(ContextProvider, {
5465
5880
  value: props.renderParam
5466
- }, /* @__PURE__ */ React19.createElement(RenderHookComponent, {
5881
+ }, /* @__PURE__ */ React22.createElement(RenderHookComponent, {
5467
5882
  render: props.render,
5468
5883
  renderParam: props.renderParam
5469
5884
  }));
5470
5885
  }
5471
5886
 
5472
5887
  // src/components/InfiniteTable/components/FilterEditors.tsx
5473
- var React20 = __toModule(require("react"));
5888
+ var React23 = __toModule(require("react"));
5474
5889
  function getFilterEditors() {
5475
5890
  return {
5476
5891
  string: StringFilterEditor,
@@ -5479,7 +5894,7 @@ function getFilterEditors() {
5479
5894
  }
5480
5895
  var defaultFilterEditors = getFilterEditors();
5481
5896
  function StringFilterEditor(props) {
5482
- return /* @__PURE__ */ React20.createElement("input", {
5897
+ return /* @__PURE__ */ React23.createElement("input", {
5483
5898
  "aria-label": `Filter for ${props.ariaLabel}`,
5484
5899
  type: "text",
5485
5900
  value: props.filterValue,
@@ -5490,7 +5905,7 @@ function StringFilterEditor(props) {
5490
5905
  });
5491
5906
  }
5492
5907
  function NumberFilterEditor(props) {
5493
- return /* @__PURE__ */ React20.createElement("input", {
5908
+ return /* @__PURE__ */ React23.createElement("input", {
5494
5909
  "aria-label": `Filter for ${props.ariaLabel}`,
5495
5910
  type: "number",
5496
5911
  value: props.filterValue,
@@ -5506,23 +5921,23 @@ function NumberFilterEditor(props) {
5506
5921
  }
5507
5922
 
5508
5923
  // src/components/InfiniteTable/components/icons/SortIcon.tsx
5509
- var React21 = __toModule(require("react"));
5510
- var import_react19 = __toModule(require("react"));
5924
+ var React24 = __toModule(require("react"));
5925
+ var import_react20 = __toModule(require("react"));
5511
5926
 
5512
5927
  // src/components/InfiniteTable/components/InfiniteTableHeader/header.css.ts
5513
- var import_createRuntimeFn3 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5928
+ var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
5514
5929
  var CellCls = "_1eexc2a5 _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw2 _16lm1iw1r _16lm1iw1s _16lm1iwy";
5515
- var HeaderCellContentRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "_12zfob11e _16lm1iw10 _16lm1iw12 _16lm1iwu _16lm1iw1f _16lm1iw1h", variantClassNames: { filtered: { false: "_12zfob11f", true: "_12zfob11g" } }, defaultVariants: {}, compoundVariants: [] });
5930
+ var HeaderCellContentRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob11e _16lm1iw10 _16lm1iw12 _16lm1iwu _16lm1iw1f _16lm1iw1h", variantClassNames: { filtered: { false: "_12zfob11f", true: "_12zfob11g" } }, defaultVariants: {}, compoundVariants: [] });
5516
5931
  var HeaderCellProxy = "_12zfob1k _16lm1iw1s _16lm1iw1t _16lm1iw1m";
5517
- var HeaderCellRecipe = (0, import_createRuntimeFn3.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"]] });
5518
- var HeaderClsRecipe = (0, import_createRuntimeFn3.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"]] });
5932
+ 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"]] });
5933
+ var HeaderClsRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_12zfob16 _16lm1iww _16lm1iw2", variantClassNames: { pinned: { start: "_12zfob17", end: "_12zfob18", false: "_12zfob19" }, firstInCategory: { true: "_12zfob1a", false: "_12zfob1b" }, lastInCategory: { true: "_12zfob1c", false: "_12zfob1d" }, overflow: { true: "_12zfob1e", false: "_12zfob1f" } }, defaultVariants: {}, compoundVariants: [[{ overflow: true, pinned: "start" }, "_12zfob1g"], [{ pinned: "start", firstInCategory: true }, "_12zfob1h"], [{ overflow: true, pinned: "end" }, "_12zfob1i"], [{ pinned: "end", lastInCategory: true }, "_12zfob1j"]] });
5519
5934
  var HeaderFilterCls = "_12zfob11j _16lm1iwu _16lm1iw1f _16lm1iw1h _16lm1iw1";
5520
5935
  var HeaderFilterEditorCls = "_16lm1iw12 _16lm1iw10";
5521
5936
  var HeaderGroupCls = "_12zfob11i _16lm1iwu _16lm1iw1f _16lm1iw1h";
5522
5937
  var HeaderScrollbarPlaceholderCls = "_12zfob15 _16lm1iw2";
5523
5938
  var HeaderSortIconCls = "_16lm1iw1";
5524
5939
  var HeaderSortIconIndexCls = "_12zfob14";
5525
- var HeaderSortIconRecipe = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
5940
+ var HeaderSortIconRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_12zfob11", center: "_12zfob12", end: "_12zfob13" } }, defaultVariants: {}, compoundVariants: [] });
5526
5941
  var HeaderWrapperCls = "_12zfob11h _16lm1iw1m _16lm1iw1 _16lm1iwu _16lm1iw1f";
5527
5942
 
5528
5943
  // src/components/InfiniteTable/components/icons/SortIcon.tsx
@@ -5534,8 +5949,8 @@ var defaultLineStyle = {
5534
5949
  var InfiniteTableIconClassName = "InfiniteTableIcon";
5535
5950
  function SortIcon(props) {
5536
5951
  var _a;
5537
- const [rendered, setRendered] = (0, import_react19.useState)(true);
5538
- const [opacity, setOpacity] = (0, import_react19.useState)(0);
5952
+ const [rendered, setRendered] = (0, import_react20.useState)(true);
5953
+ const [opacity, setOpacity] = (0, import_react20.useState)(0);
5539
5954
  const { direction, lineWidth = 1, style, className, index } = props;
5540
5955
  const showIndex = index != null && index > 0;
5541
5956
  const size = (_a = props.size) != null ? _a : 16;
@@ -5549,7 +5964,7 @@ function SortIcon(props) {
5549
5964
  }), props.lineStyle), {
5550
5965
  opacity
5551
5966
  });
5552
- (0, import_react19.useEffect)(() => {
5967
+ (0, import_react20.useEffect)(() => {
5553
5968
  const newOpacity = direction != 0 ? 1 : 0;
5554
5969
  if (!rendered && newOpacity) {
5555
5970
  setRendered(true);
@@ -5579,37 +5994,37 @@ function SortIcon(props) {
5579
5994
  if (direction === -1) {
5580
5995
  indexStyle.top = "100%";
5581
5996
  }
5582
- return /* @__PURE__ */ React21.createElement("div", {
5997
+ return /* @__PURE__ */ React24.createElement("div", {
5583
5998
  style: __spreadProps(__spreadValues({}, style), { width: size }),
5584
5999
  className: join(className, InfiniteTableIconClassName, `${InfiniteTableIconClassName}-sort`)
5585
- }, showIndex ? /* @__PURE__ */ React21.createElement("div", {
6000
+ }, showIndex ? /* @__PURE__ */ React24.createElement("div", {
5586
6001
  "data-name": "index",
5587
6002
  style: indexStyle,
5588
6003
  className: HeaderSortIconIndexCls
5589
- }, index) : null, /* @__PURE__ */ React21.createElement("div", {
6004
+ }, index) : null, /* @__PURE__ */ React24.createElement("div", {
5590
6005
  style: __spreadValues({ width: sizes[0] }, lineStyle),
5591
6006
  onTransitionEnd
5592
- }), /* @__PURE__ */ React21.createElement("div", {
6007
+ }), /* @__PURE__ */ React24.createElement("div", {
5593
6008
  style: __spreadValues({ width: sizes[1] }, lineStyle)
5594
- }), /* @__PURE__ */ React21.createElement("div", {
6009
+ }), /* @__PURE__ */ React24.createElement("div", {
5595
6010
  style: __spreadValues({ width: sizes[2] }, lineStyle)
5596
6011
  }));
5597
6012
  }
5598
6013
 
5599
6014
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableColumnHeaderFilter.tsx
5600
- var React22 = __toModule(require("react"));
5601
- var import_react20 = __toModule(require("react"));
6015
+ var React25 = __toModule(require("react"));
6016
+ var import_react21 = __toModule(require("react"));
5602
6017
  var { rootClassName: rootClassName7 } = internalProps;
5603
6018
  var InfiniteTableColumnHeaderFilterClassName = `${rootClassName7}HeaderCell__filter`;
5604
6019
  var stopPropagation = (e) => e.stopPropagation();
5605
6020
  function InfiniteTableColumnHeaderFilter(props) {
5606
6021
  var _a, _b, _c, _d;
5607
- const [theValue, setTheValue] = (0, import_react20.useState)((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
6022
+ const [theValue, setTheValue] = (0, import_react21.useState)((_b = (_a = props.columnFilterValue) == null ? void 0 : _a.filterValue) != null ? _b : "");
5608
6023
  const onInputChange = (filterValue) => {
5609
6024
  setTheValue(filterValue);
5610
6025
  props.onChange(filterValue);
5611
6026
  };
5612
- (0, import_react20.useEffect)(() => {
6027
+ (0, import_react21.useEffect)(() => {
5613
6028
  var _a2;
5614
6029
  if (props.columnFilterValue) {
5615
6030
  if (theValue !== props.columnFilterValue.filterValue) {
@@ -5636,15 +6051,15 @@ function InfiniteTableColumnHeaderFilter(props) {
5636
6051
  onChange: onInputChange
5637
6052
  };
5638
6053
  const FilterEditor = props.filterEditor;
5639
- return /* @__PURE__ */ React22.createElement("div", {
6054
+ return /* @__PURE__ */ React25.createElement("div", {
5640
6055
  onPointerUp: stopPropagation,
5641
6056
  onPointerDown: stopPropagation,
5642
6057
  className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
5643
6058
  style: { height: props.columnHeaderHeight }
5644
- }, FilterEditor ? /* @__PURE__ */ React22.createElement(FilterEditor, __spreadValues({}, filterEditorProps)) : null);
6059
+ }, FilterEditor ? /* @__PURE__ */ React25.createElement(FilterEditor, __spreadValues({}, filterEditorProps)) : null);
5645
6060
  }
5646
6061
  function InfiniteTableColumnHeaderFilterEmpty() {
5647
- return /* @__PURE__ */ React22.createElement("div", {
6062
+ return /* @__PURE__ */ React25.createElement("div", {
5648
6063
  onPointerUp: stopPropagation,
5649
6064
  onPointerDown: stopPropagation,
5650
6065
  className: `${InfiniteTableColumnHeaderFilterClassName} ${HeaderFilterCls}`,
@@ -5653,8 +6068,8 @@ function InfiniteTableColumnHeaderFilterEmpty() {
5653
6068
  }
5654
6069
 
5655
6070
  // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
5656
- var React24 = __toModule(require("react"));
5657
- var import_react22 = __toModule(require("react"));
6071
+ var React27 = __toModule(require("react"));
6072
+ var import_react23 = __toModule(require("react"));
5658
6073
 
5659
6074
  // src/components/flexbox/index.ts
5660
6075
  var computeFlex = (params) => {
@@ -5993,8 +6408,8 @@ var computeGroupResize = (params) => {
5993
6408
  };
5994
6409
 
5995
6410
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
5996
- var import_react21 = __toModule(require("react"));
5997
- var React23 = __toModule(require("react"));
6411
+ var import_react22 = __toModule(require("react"));
6412
+ var React26 = __toModule(require("react"));
5998
6413
 
5999
6414
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/columnResizer.ts
6000
6415
  function getColumnResizer(colIndex, {
@@ -6085,18 +6500,18 @@ function getColumnGroupResizer(colIndexes, config) {
6085
6500
  }
6086
6501
 
6087
6502
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/ResizeHandle.css.ts
6088
- var import_createRuntimeFn4 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
6503
+ var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
6089
6504
  var ResizeHandleCls = "zneyzh0 _16lm1iw2 _16lm1iw13 _16lm1iw1a _16lm1iw18 _16lm1iwf _16lm1iw1m";
6090
- var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2 _16lm1iw13 _16lm1iw18", variantClassNames: { constrained: { false: "zneyzhc", true: "zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
6091
- var ResizeHandleRecipeCls = (0, import_createRuntimeFn4.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"]] });
6505
+ var ResizeHandleDraggerClsRecipe = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "zneyzhb _16lm1iw2 _16lm1iw13 _16lm1iw18", variantClassNames: { constrained: { false: "zneyzhc", true: "zneyzhd" } }, defaultVariants: {}, compoundVariants: [] });
6506
+ var ResizeHandleRecipeCls = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { computedPinned: { start: "zneyzh1", end: "zneyzh2 _16lm1iw15 _16lm1iw1c", false: "zneyzh3" }, computedFirstInCategory: { true: "zneyzh4", false: "zneyzh5" }, computedLastInCategory: { true: "zneyzh6", false: "zneyzh7" } }, defaultVariants: {}, compoundVariants: [[{ computedPinned: "end", computedLastInCategory: false, computedFirstInCategory: true }, "zneyzh8"], [{ computedPinned: false, computedFirstInCategory: false, computedLastInCategory: true }, "zneyzh9"], [{ computedPinned: "start", computedFirstInCategory: false, computedLastInCategory: true }, "zneyzha"]] });
6092
6507
 
6093
6508
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/index.tsx
6094
6509
  var { rootClassName: rootClassName8 } = internalProps;
6095
6510
  var InfiniteTableHeaderCellResizeHandleCls = `${rootClassName8}HeaderCell_ResizeHandle`;
6096
6511
  function ResizeHandleFn(props) {
6097
- const domRef = (0, import_react21.useRef)(null);
6098
- const [constrained, setConstrained] = (0, import_react21.useState)(false);
6099
- const constrainedRef = (0, import_react21.useRef)(constrained);
6512
+ const domRef = (0, import_react22.useRef)(null);
6513
+ const [constrained, setConstrained] = (0, import_react22.useState)(false);
6514
+ const constrainedRef = (0, import_react22.useRef)(constrained);
6100
6515
  constrainedRef.current = constrained;
6101
6516
  const col = props.columns[props.columnIndex];
6102
6517
  if (!col) {
@@ -6148,7 +6563,7 @@ function ResizeHandleFn(props) {
6148
6563
  const style = (computedPinned === false || computedPinned === "start") && computedLastInCategory ? {
6149
6564
  right: computedPinned === "start" ? 0 : 0
6150
6565
  } : computedPinned === "end" && computedFirstInCategory ? { right: "none", left: 0 } : void 0;
6151
- return /* @__PURE__ */ React23.createElement("div", {
6566
+ return /* @__PURE__ */ React26.createElement("div", {
6152
6567
  ref: domRef,
6153
6568
  className: `${InfiniteTableHeaderCellResizeHandleCls} ${ResizeHandleCls} ${ResizeHandleRecipeCls({
6154
6569
  computedPinned,
@@ -6156,14 +6571,14 @@ function ResizeHandleFn(props) {
6156
6571
  computedLastInCategory
6157
6572
  })}`,
6158
6573
  onPointerDown
6159
- }, /* @__PURE__ */ React23.createElement("div", {
6574
+ }, /* @__PURE__ */ React26.createElement("div", {
6160
6575
  style,
6161
6576
  className: ResizeHandleDraggerClsRecipe({
6162
6577
  constrained
6163
6578
  })
6164
6579
  }));
6165
6580
  }
6166
- var ResizeHandle = React23.memo(ResizeHandleFn);
6581
+ var ResizeHandle = React26.memo(ResizeHandleFn);
6167
6582
 
6168
6583
  // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnResizeHandle.tsx
6169
6584
  function useColumnResizeHandle(column) {
@@ -6173,7 +6588,7 @@ function useColumnResizeHandle(column) {
6173
6588
  getComputed,
6174
6589
  componentActions
6175
6590
  } = useInfiniteTable();
6176
- const computeResizeForDiff = (0, import_react22.useCallback)(({
6591
+ const computeResizeForDiff = (0, import_react23.useCallback)(({
6177
6592
  diff,
6178
6593
  shareSpaceOnResize
6179
6594
  }) => {
@@ -6208,7 +6623,7 @@ function useColumnResizeHandle(column) {
6208
6623
  });
6209
6624
  return result;
6210
6625
  }, [column]);
6211
- const onColumnResize = (0, import_react22.useCallback)(({
6626
+ const onColumnResize = (0, import_react23.useCallback)(({
6212
6627
  diff,
6213
6628
  shareSpaceOnResize
6214
6629
  }) => {
@@ -6221,7 +6636,7 @@ function useColumnResizeHandle(column) {
6221
6636
  }
6222
6637
  componentActions.columnSizing = columnSizing;
6223
6638
  }, [computeResizeForDiff]);
6224
- const resizeHandle = column.computedResizable ? /* @__PURE__ */ React24.createElement(ResizeHandle, {
6639
+ const resizeHandle = column.computedResizable ? /* @__PURE__ */ React27.createElement(ResizeHandle, {
6225
6640
  columns: computedVisibleColumns,
6226
6641
  columnIndex: column.computedVisibleIndex,
6227
6642
  computeResize: computeResizeForDiff,
@@ -6234,7 +6649,7 @@ function useColumnResizeHandle(column) {
6234
6649
  var defaultRenderSelectionCheckBox2 = (params) => {
6235
6650
  const { allRowsSelected, someRowsSelected, api } = params;
6236
6651
  const selected = allRowsSelected ? true : someRowsSelected ? null : false;
6237
- return /* @__PURE__ */ React25.createElement(InfiniteCheckBox, {
6652
+ return /* @__PURE__ */ React28.createElement(InfiniteCheckBox, {
6238
6653
  domProps: {
6239
6654
  className: SelectionCheckboxCls
6240
6655
  },
@@ -6248,7 +6663,7 @@ var defaultRenderSelectionCheckBox2 = (params) => {
6248
6663
  checked: selected
6249
6664
  });
6250
6665
  };
6251
- var InfiniteTableHeaderCellContext = React25.createContext(null);
6666
+ var InfiniteTableHeaderCellContext = React28.createContext(null);
6252
6667
  var { rootClassName: rootClassName9 } = internalProps;
6253
6668
  var InfiniteTableHeaderCellClassName = `${rootClassName9}HeaderCell`;
6254
6669
  var columnZIndexAtIndex5 = stripVar(InternalVars.columnZIndexAtIndex);
@@ -6270,13 +6685,13 @@ function InfiniteTableHeaderCell(props) {
6270
6685
  const { onResize, height, width, headerOptions, columnsMap } = props;
6271
6686
  const sortInfo = column.computedSortInfo;
6272
6687
  let header = column.header;
6273
- const ref = (0, import_react23.useCallback)((node) => {
6688
+ const ref = (0, import_react24.useCallback)((node) => {
6274
6689
  var _a2;
6275
6690
  domRef.current = node;
6276
6691
  (_a2 = props.domRef) == null ? void 0 : _a2.call(props, node);
6277
6692
  }, [props.domRef]);
6278
6693
  const alwaysShow = headerOptions.alwaysReserveSpaceForSortIcon;
6279
- const sortIcon = column.computedSortable && (column.computedSorted || alwaysShow) ? /* @__PURE__ */ React25.createElement(SortIcon, {
6694
+ const sortIcon = column.computedSortable && (column.computedSorted || alwaysShow) ? /* @__PURE__ */ React28.createElement(SortIcon, {
6280
6695
  index: column.computedMultiSort ? column.computedSortIndex + 1 : void 0,
6281
6696
  className: `${InfiniteTableHeaderCellClassName}__sort-icon ${HeaderSortIconCls} ${HeaderSortIconRecipe({
6282
6697
  align: column.align || "start"
@@ -6303,7 +6718,7 @@ function InfiniteTableHeaderCell(props) {
6303
6718
  const align = column.align || "start";
6304
6719
  const renderChildren = () => {
6305
6720
  if (column.renderSortIcon) {
6306
- renderParam.renderBag.sortIcon = /* @__PURE__ */ React25.createElement(RenderHeaderCellHookComponent, {
6721
+ renderParam.renderBag.sortIcon = /* @__PURE__ */ React28.createElement(RenderHeaderCellHookComponent, {
6307
6722
  render: column.renderSortIcon,
6308
6723
  renderParam: __spreadProps(__spreadValues({}, renderParam), {
6309
6724
  renderBag: __spreadValues({}, renderParam.renderBag)
@@ -6311,12 +6726,12 @@ function InfiniteTableHeaderCell(props) {
6311
6726
  });
6312
6727
  }
6313
6728
  if (column.renderSelectionCheckBox && selectionMode === "multi-row") {
6314
- renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React25.createElement(RenderHeaderCellHookComponent, {
6729
+ renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React28.createElement(RenderHeaderCellHookComponent, {
6315
6730
  render: defaultRenderSelectionCheckBox2,
6316
6731
  renderParam
6317
6732
  });
6318
6733
  if (column.renderHeaderSelectionCheckBox && column.renderHeaderSelectionCheckBox !== true) {
6319
- renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React25.createElement(RenderHeaderCellHookComponent, {
6734
+ renderParam.renderBag.selectionCheckBox = /* @__PURE__ */ React28.createElement(RenderHeaderCellHookComponent, {
6320
6735
  render: column.renderHeaderSelectionCheckBox,
6321
6736
  renderParam: __spreadProps(__spreadValues({}, renderParam), {
6322
6737
  renderBag: __spreadValues({}, renderParam.renderBag)
@@ -6325,7 +6740,7 @@ function InfiniteTableHeaderCell(props) {
6325
6740
  }
6326
6741
  }
6327
6742
  if (header instanceof Function) {
6328
- renderParam.renderBag.header = /* @__PURE__ */ React25.createElement(RenderHookComponent, {
6743
+ renderParam.renderBag.header = /* @__PURE__ */ React28.createElement(RenderHeaderCellHookComponent, {
6329
6744
  render: header,
6330
6745
  renderParam: __spreadProps(__spreadValues({}, renderParam), {
6331
6746
  renderBag: __spreadValues({}, renderParam.renderBag)
@@ -6333,20 +6748,20 @@ function InfiniteTableHeaderCell(props) {
6333
6748
  });
6334
6749
  }
6335
6750
  if (column.renderHeader) {
6336
- return /* @__PURE__ */ React25.createElement(RenderHeaderCellHookComponent, {
6751
+ return /* @__PURE__ */ React28.createElement(RenderHeaderCellHookComponent, {
6337
6752
  render: column.renderHeader,
6338
6753
  renderParam
6339
6754
  });
6340
6755
  }
6341
- return /* @__PURE__ */ React25.createElement(React25.Fragment, null, align !== "end" ? renderParam.renderBag.selectionCheckBox : null, align === "end" ? renderParam.renderBag.sortIcon : null, renderParam.renderBag.header, align !== "end" ? renderParam.renderBag.sortIcon : null, align === "end" ? renderParam.renderBag.selectionCheckBox : null);
6756
+ return /* @__PURE__ */ React28.createElement(React28.Fragment, null, align !== "end" ? renderParam.renderBag.selectionCheckBox : null, align === "end" ? renderParam.renderBag.sortIcon : null, renderParam.renderBag.header, align !== "end" ? renderParam.renderBag.sortIcon : null, align === "end" ? renderParam.renderBag.selectionCheckBox : null);
6342
6757
  };
6343
- const domRef = (0, import_react23.useRef)(null);
6758
+ const domRef = (0, import_react24.useRef)(null);
6344
6759
  const {
6345
6760
  componentActions: dataSourceActions,
6346
6761
  getState: getDataSourceState,
6347
6762
  componentState: { filterDelay, filterTypes }
6348
6763
  } = useDataSourceContextValue();
6349
- (0, import_react23.useEffect)(() => {
6764
+ (0, import_react24.useEffect)(() => {
6350
6765
  let clearOnResize = null;
6351
6766
  const node = domRef.current;
6352
6767
  if (onResize && node) {
@@ -6369,7 +6784,7 @@ function InfiniteTableHeaderCell(props) {
6369
6784
  });
6370
6785
  let draggingProxy = null;
6371
6786
  if (dragging && proxyPosition) {
6372
- draggingProxy = /* @__PURE__ */ React25.createElement("div", {
6787
+ draggingProxy = /* @__PURE__ */ React28.createElement("div", {
6373
6788
  key: column.id,
6374
6789
  className: `${InfiniteTableHeaderCellClassName}Proxy ${HeaderCellProxy}`,
6375
6790
  style: {
@@ -6387,7 +6802,7 @@ function InfiniteTableHeaderCell(props) {
6387
6802
  const contentRecipeVariants = {
6388
6803
  filtered: column.computedFiltered
6389
6804
  };
6390
- const setFilterValue = (0, import_react23.useCallback)((filterValue) => {
6805
+ const setFilterValue = (0, import_react24.useCallback)((filterValue) => {
6391
6806
  var _a2;
6392
6807
  const state = getDataSourceState();
6393
6808
  let newFilterValue = (_a2 = state.filterValue) != null ? _a2 : [];
@@ -6411,7 +6826,7 @@ function InfiniteTableHeaderCell(props) {
6411
6826
  });
6412
6827
  dataSourceActions.filterValue = newFilterValue;
6413
6828
  }, [column, filterTypes]);
6414
- const debouncedOnFilterValueChange = React25.useMemo(() => {
6829
+ const debouncedOnFilterValueChange = React28.useMemo(() => {
6415
6830
  const fn = (filterValue) => {
6416
6831
  let newFilterValueForColumn;
6417
6832
  if (column.computedFilterValue) {
@@ -6451,9 +6866,9 @@ function InfiniteTableHeaderCell(props) {
6451
6866
  const resizeHandle = useColumnResizeHandle(column);
6452
6867
  const zIndex2 = `var(${columnZIndexAtIndex5}-${column.computedVisibleIndex})`;
6453
6868
  style.zIndex = zIndex2;
6454
- return /* @__PURE__ */ React25.createElement(ContextProvider, {
6869
+ return /* @__PURE__ */ React28.createElement(ContextProvider, {
6455
6870
  value: renderParam
6456
- }, /* @__PURE__ */ React25.createElement(InfiniteTableCell, {
6871
+ }, /* @__PURE__ */ React28.createElement(InfiniteTableCell, {
6457
6872
  domRef: ref,
6458
6873
  cellType: "header",
6459
6874
  column,
@@ -6472,7 +6887,7 @@ function InfiniteTableHeaderCell(props) {
6472
6887
  rowActive: false
6473
6888
  }), CellCls),
6474
6889
  cssEllipsis: (_e = (_d = column.headerCssEllipsis) != null ? _d : column.cssEllipsis) != null ? _e : true,
6475
- afterChildren: /* @__PURE__ */ React25.createElement(React25.Fragment, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ React25.createElement(InfiniteTableColumnHeaderFilter, {
6890
+ afterChildren: /* @__PURE__ */ React28.createElement(React28.Fragment, null, showColumnFilters ? column.computedFilterable ? /* @__PURE__ */ React28.createElement(InfiniteTableColumnHeaderFilter, {
6476
6891
  filterEditor: FilterEditor,
6477
6892
  filterTypes,
6478
6893
  onChange: debouncedOnFilterValueChange,
@@ -6480,17 +6895,17 @@ function InfiniteTableHeaderCell(props) {
6480
6895
  columnLabel: column.field || column.name || column.id,
6481
6896
  columnFilterValue: column.computedFilterValue,
6482
6897
  columnHeaderHeight
6483
- }) : /* @__PURE__ */ React25.createElement(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
6898
+ }) : /* @__PURE__ */ React28.createElement(InfiniteTableColumnHeaderFilterEmpty, null) : null, resizeHandle),
6484
6899
  renderChildren
6485
6900
  }), draggingProxy);
6486
6901
  }
6487
6902
  function useInfiniteHeaderCell() {
6488
- const result = (0, import_react23.useContext)(InfiniteTableHeaderCellContext);
6903
+ const result = (0, import_react24.useContext)(InfiniteTableHeaderCellContext);
6489
6904
  return result;
6490
6905
  }
6491
6906
 
6492
6907
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
6493
- var React30 = __toModule(require("react"));
6908
+ var React33 = __toModule(require("react"));
6494
6909
 
6495
6910
  // src/components/InfiniteTable/components/InfiniteTableHeader/buildColumnAndGroupTree.ts
6496
6911
  function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap, columnGroupsMaxDepth) {
@@ -6593,25 +7008,25 @@ function assignGroupOffsetsAndComputedWidths(items, groupOffset = 0) {
6593
7008
  }
6594
7009
 
6595
7010
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeader.tsx
6596
- var React29 = __toModule(require("react"));
6597
- var import_react26 = __toModule(require("react"));
7011
+ var React32 = __toModule(require("react"));
7012
+ var import_react27 = __toModule(require("react"));
6598
7013
 
6599
7014
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderGroup.tsx
6600
- var React28 = __toModule(require("react"));
7015
+ var React31 = __toModule(require("react"));
6601
7016
 
6602
7017
  // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
6603
- var React27 = __toModule(require("react"));
6604
- var import_react25 = __toModule(require("react"));
7018
+ var React30 = __toModule(require("react"));
7019
+ var import_react26 = __toModule(require("react"));
6605
7020
 
6606
7021
  // src/components/InfiniteTable/components/InfiniteTableHeader/ResizeHandle/GroupResizeHandle.tsx
6607
- var import_react24 = __toModule(require("react"));
6608
- var React26 = __toModule(require("react"));
7022
+ var import_react25 = __toModule(require("react"));
7023
+ var React29 = __toModule(require("react"));
6609
7024
  var { rootClassName: rootClassName10 } = internalProps;
6610
7025
  var InfiniteTableHeaderCellResizeHandleCls2 = `${rootClassName10}HeaderCell_ResizeHandle`;
6611
7026
  function GroupResizeHandleFn(props) {
6612
- const domRef = (0, import_react24.useRef)(null);
6613
- const [constrained, setConstrained] = (0, import_react24.useState)(false);
6614
- const constrainedRef = (0, import_react24.useRef)(constrained);
7027
+ const domRef = (0, import_react25.useRef)(null);
7028
+ const [constrained, setConstrained] = (0, import_react25.useState)(false);
7029
+ const constrainedRef = (0, import_react25.useRef)(constrained);
6615
7030
  constrainedRef.current = constrained;
6616
7031
  const col = props.groupColumns[0];
6617
7032
  if (!col) {
@@ -6671,7 +7086,7 @@ function GroupResizeHandleFn(props) {
6671
7086
  const style = (computedPinned === false || computedPinned === "start") && computedLastInCategory ? {
6672
7087
  right: computedPinned === "start" ? 0 : ThemeVars.components.HeaderCell.resizeHandleWidth
6673
7088
  } : computedPinned === "end" && computedFirstInCategory ? { right: "none", left: 0 } : void 0;
6674
- return /* @__PURE__ */ React26.createElement("div", {
7089
+ return /* @__PURE__ */ React29.createElement("div", {
6675
7090
  ref: domRef,
6676
7091
  className: `${InfiniteTableHeaderCellResizeHandleCls2} ${ResizeHandleCls} ${ResizeHandleRecipeCls({
6677
7092
  computedPinned,
@@ -6679,14 +7094,14 @@ function GroupResizeHandleFn(props) {
6679
7094
  computedLastInCategory
6680
7095
  })}`,
6681
7096
  onPointerDown
6682
- }, /* @__PURE__ */ React26.createElement("div", {
7097
+ }, /* @__PURE__ */ React29.createElement("div", {
6683
7098
  style: __spreadValues(__spreadValues({}, style), props.style),
6684
7099
  className: ResizeHandleDraggerClsRecipe({
6685
7100
  constrained
6686
7101
  })
6687
7102
  }));
6688
7103
  }
6689
- var GroupResizeHandle = React26.memo(GroupResizeHandleFn);
7104
+ var GroupResizeHandle = React29.memo(GroupResizeHandleFn);
6690
7105
 
6691
7106
  // src/components/InfiniteTable/components/InfiniteTableHeader/useColumnGroupResizeHandle.tsx
6692
7107
  function useColumnGroupResizeHandle(groupColumns, config) {
@@ -6698,7 +7113,7 @@ function useColumnGroupResizeHandle(groupColumns, config) {
6698
7113
  componentActions
6699
7114
  } = useInfiniteTable();
6700
7115
  const lastColumnInGroup = groupColumns[groupColumns.length - 1];
6701
- const computeResizeForDiff = (0, import_react25.useCallback)((diff) => {
7116
+ const computeResizeForDiff = (0, import_react26.useCallback)((diff) => {
6702
7117
  const state = getState();
6703
7118
  const { columnSizing, viewportReservedWidth, bodySize } = state;
6704
7119
  const columns = getComputed().computedVisibleColumns;
@@ -6731,13 +7146,13 @@ function useColumnGroupResizeHandle(groupColumns, config) {
6731
7146
  });
6732
7147
  return result;
6733
7148
  }, [lastColumnInGroup]);
6734
- const onColumnResize = (0, import_react25.useCallback)((diff) => {
7149
+ const onColumnResize = (0, import_react26.useCallback)((diff) => {
6735
7150
  const { columnSizing, reservedWidth } = computeResizeForDiff(diff);
6736
7151
  componentActions.viewportReservedWidth = reservedWidth;
6737
7152
  componentActions.columnSizing = columnSizing;
6738
7153
  }, [computeResizeForDiff]);
6739
7154
  const groupResizable = groupColumns.some((c) => c.computedResizable);
6740
- const resizeHandle = groupResizable ? /* @__PURE__ */ React27.createElement(GroupResizeHandle, {
7155
+ const resizeHandle = groupResizable ? /* @__PURE__ */ React30.createElement(GroupResizeHandle, {
6741
7156
  brain: bodyBrain,
6742
7157
  style: {
6743
7158
  height: groupHeight * (columnGroupsMaxDepth - columnGroup.depth + 2)
@@ -6771,13 +7186,13 @@ function InfiniteTableHeaderGroup(props) {
6771
7186
  const firstColumn = columns[0];
6772
7187
  const width = columns.length > 1 ? `calc( ` + columns.map((col) => `var(${columnWidthAtIndex5}-${col.computedVisibleIndex})`).join(" + ") + " )" : `var(${columnWidthAtIndex5}-${firstColumn.computedVisibleIndex})`;
6773
7188
  const zIndex2 = `calc(var(${columnZIndexAtIndex6}-${firstColumn.computedVisibleIndex}) + ${columnGroupsMaxDepth - columnGroup.depth})`;
6774
- return /* @__PURE__ */ React28.createElement("div", {
7189
+ return /* @__PURE__ */ React31.createElement("div", {
6775
7190
  ref: props.domRef,
6776
7191
  "data-group-id": columnGroup.uniqueGroupId,
6777
7192
  className: join(HeaderGroupCls, TableHeaderGroupClassName),
6778
7193
  style: { width, height },
6779
7194
  "data-z-index": zIndex2
6780
- }, /* @__PURE__ */ React28.createElement("div", {
7195
+ }, /* @__PURE__ */ React31.createElement("div", {
6781
7196
  className: join(`${TableHeaderGroupClassName}__header-content`, cssEllipsisClassName)
6782
7197
  }, header), handle);
6783
7198
  }
@@ -6800,8 +7215,8 @@ function InfiniteTableHeaderFn(props) {
6800
7215
  computed,
6801
7216
  componentState: { headerBrain, headerOptions }
6802
7217
  } = useInfiniteTable();
6803
- const { computedVisibleColumnsMap, showColumnFilters } = computed;
6804
- (0, import_react26.useEffect)(() => {
7218
+ const { computedColumnsMap, showColumnFilters } = computed;
7219
+ (0, import_react27.useEffect)(() => {
6805
7220
  const onScroll = (scrollPosition) => {
6806
7221
  if (domRef.current) {
6807
7222
  domRef.current.style.transform = `translate3d(-${scrollPosition.scrollLeft}px, 0px, 0px)`;
@@ -6810,7 +7225,7 @@ function InfiniteTableHeaderFn(props) {
6810
7225
  const removeOnScroll = brain.onScroll(onScroll);
6811
7226
  return removeOnScroll;
6812
7227
  }, [brain]);
6813
- const domRef = (0, import_react26.useRef)(null);
7228
+ const domRef = (0, import_react27.useRef)(null);
6814
7229
  const headerCls = HeaderClsRecipe({
6815
7230
  overflow: false
6816
7231
  });
@@ -6819,7 +7234,7 @@ function InfiniteTableHeaderFn(props) {
6819
7234
  className: join(TableHeaderClassName, `${TableHeaderClassName}--virtualized`, className, headerCls),
6820
7235
  style: __spreadProps(__spreadValues({}, style), { height: columnHeaderHeight })
6821
7236
  };
6822
- const renderCell = (0, import_react26.useCallback)((params) => {
7237
+ const renderCell = (0, import_react27.useCallback)((params) => {
6823
7238
  const {
6824
7239
  rowIndex,
6825
7240
  colIndex,
@@ -6844,7 +7259,7 @@ function InfiniteTableHeaderFn(props) {
6844
7259
  computedWidth: colGroupItem.computedWidth,
6845
7260
  groupOffset: colGroupItem.groupOffset
6846
7261
  });
6847
- return /* @__PURE__ */ React29.createElement(InfiniteTableHeaderGroup, {
7262
+ return /* @__PURE__ */ React32.createElement(InfiniteTableHeaderGroup, {
6848
7263
  bodyBrain,
6849
7264
  columnGroupsMaxDepth,
6850
7265
  domRef: domRef2,
@@ -6854,13 +7269,13 @@ function InfiniteTableHeaderFn(props) {
6854
7269
  columnGroup: computedColumnGroup
6855
7270
  });
6856
7271
  }
6857
- return /* @__PURE__ */ React29.createElement(InfiniteTableHeaderCell, {
7272
+ return /* @__PURE__ */ React32.createElement(InfiniteTableHeaderCell, {
6858
7273
  domRef: domRef2,
6859
7274
  column,
6860
7275
  headerOptions,
6861
7276
  width: widthWithColspan,
6862
7277
  height: heightWithRowspan,
6863
- columnsMap: computedVisibleColumnsMap
7278
+ columnsMap: computedColumnsMap
6864
7279
  });
6865
7280
  }, [
6866
7281
  headerOptions,
@@ -6870,14 +7285,14 @@ function InfiniteTableHeaderFn(props) {
6870
7285
  columnGroupsMaxDepth,
6871
7286
  showColumnFilters
6872
7287
  ]);
6873
- return /* @__PURE__ */ React29.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React29.createElement(RawTable, {
7288
+ return /* @__PURE__ */ React32.createElement("div", __spreadValues({}, domProps), /* @__PURE__ */ React32.createElement(RawTable, {
6874
7289
  name: "header",
6875
7290
  renderCell,
6876
7291
  brain: headerBrain,
6877
7292
  cellHoverClassNames: []
6878
7293
  }));
6879
7294
  }
6880
- var InfiniteTableHeader = React29.memo(InfiniteTableHeaderFn);
7295
+ var InfiniteTableHeader = React32.memo(InfiniteTableHeaderFn);
6881
7296
 
6882
7297
  // src/components/InfiniteTable/components/InfiniteTableHeader/InfiniteTableHeaderWrapper.tsx
6883
7298
  function TableHeaderWrapper(props) {
@@ -6900,13 +7315,13 @@ function TableHeaderWrapper(props) {
6900
7315
  } = tableContextValue;
6901
7316
  const rows = !computedColumnGroups || !computedColumnGroups.size ? 1 : columnGroupsMaxDepth + 2;
6902
7317
  const height = rows * columnHeaderHeight + (showColumnFilters ? columnHeaderHeight : 0);
6903
- const columnAndGroupTreeInfo = React30.useMemo(() => {
7318
+ const columnAndGroupTreeInfo = React33.useMemo(() => {
6904
7319
  if (!computedColumnGroups || !computedColumnGroups.size) {
6905
7320
  return void 0;
6906
7321
  }
6907
7322
  return buildColumnAndGroupTree(computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap, columnGroupsMaxDepth);
6908
7323
  }, [computedVisibleColumns, computedColumnGroups, columnGroupsDepthsMap]);
6909
- const cellspan = React30.useCallback(({ rowIndex, colIndex }) => {
7324
+ const cellspan = React33.useCallback(({ rowIndex, colIndex }) => {
6910
7325
  const column = computedVisibleColumns[colIndex];
6911
7326
  const rowspan2 = 1;
6912
7327
  const colspan2 = 1;
@@ -6939,9 +7354,9 @@ function TableHeaderWrapper(props) {
6939
7354
  rows,
6940
7355
  columnGroupsDepthsMap
6941
7356
  ]);
6942
- const rowspan = React30.useCallback(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).rowspan, [cellspan]);
6943
- const colspan = React30.useCallback(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).colspan, [cellspan]);
6944
- const rowHeight = React30.useCallback((index) => {
7357
+ const rowspan = React33.useCallback(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).rowspan, [cellspan]);
7358
+ const colspan = React33.useCallback(({ rowIndex, colIndex }) => cellspan({ rowIndex, colIndex }).colspan, [cellspan]);
7359
+ const rowHeight = React33.useCallback((index) => {
6945
7360
  return showColumnFilters ? index < rows - 1 ? columnHeaderHeight : 2 * columnHeaderHeight : columnHeaderHeight;
6946
7361
  }, [rows, showColumnFilters, columnHeaderHeight]);
6947
7362
  useMatrixBrain(headerBrain, {
@@ -6956,7 +7371,7 @@ function TableHeaderWrapper(props) {
6956
7371
  fixedColsEnd: computedPinnedEndColumns.length,
6957
7372
  fixedColsStart: computedPinnedStartColumns.length
6958
7373
  });
6959
- const header = /* @__PURE__ */ React30.createElement(InfiniteTableHeader, {
7374
+ const header = /* @__PURE__ */ React33.createElement(InfiniteTableHeader, {
6960
7375
  columns: computedVisibleColumns,
6961
7376
  headerBrain,
6962
7377
  bodyBrain,
@@ -6964,14 +7379,14 @@ function TableHeaderWrapper(props) {
6964
7379
  columnGroupsMaxDepth,
6965
7380
  columnAndGroupTreeInfo
6966
7381
  });
6967
- const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ React30.createElement("div", {
7382
+ const verticalScrollbarPlaceholder = scrollbars.vertical && getScrollbarWidth() ? /* @__PURE__ */ React33.createElement("div", {
6968
7383
  className: HeaderScrollbarPlaceholderCls,
6969
7384
  style: {
6970
7385
  zIndex: 1e3,
6971
7386
  width: getScrollbarWidth()
6972
7387
  }
6973
7388
  }) : null;
6974
- return /* @__PURE__ */ React30.createElement("div", {
7389
+ return /* @__PURE__ */ React33.createElement("div", {
6975
7390
  className: HeaderWrapperCls,
6976
7391
  style: {
6977
7392
  height
@@ -6980,8 +7395,8 @@ function TableHeaderWrapper(props) {
6980
7395
  }
6981
7396
 
6982
7397
  // src/components/InfiniteTable/components/InfiniteTableLicenseFooter/index.tsx
6983
- var React31 = __toModule(require("react"));
6984
- var import_react27 = __toModule(require("react"));
7398
+ var React34 = __toModule(require("react"));
7399
+ var import_react28 = __toModule(require("react"));
6985
7400
 
6986
7401
  // src/components/utils/decamelize.ts
6987
7402
  function decamelize(str, options) {
@@ -7016,10 +7431,10 @@ var enforceStyle = (node, style) => {
7016
7431
  node.style.setProperty(decamelize(propertyName), propertyValue, "important");
7017
7432
  }
7018
7433
  };
7019
- var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
7434
+ var InfiniteTableLicenseFooter = React34.forwardRef(function InfiniteTableLicenseFooter2(props, ref) {
7020
7435
  const { rootClassName: rootClassName13 } = useInternalProps();
7021
- const domRef = React31.useRef(null);
7022
- const domCallback = React31.useCallback((node) => {
7436
+ const domRef = React34.useRef(null);
7437
+ const domCallback = React34.useCallback((node) => {
7023
7438
  domRef.current = node;
7024
7439
  if (!ref) {
7025
7440
  return;
@@ -7030,7 +7445,7 @@ var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicens
7030
7445
  ref.current = node;
7031
7446
  }
7032
7447
  }, []);
7033
- (0, import_react27.useEffect)(() => {
7448
+ (0, import_react28.useEffect)(() => {
7034
7449
  const forceStyle = () => {
7035
7450
  raf(() => {
7036
7451
  var _a;
@@ -7044,12 +7459,12 @@ var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicens
7044
7459
  clearInterval(intervalId);
7045
7460
  };
7046
7461
  }, []);
7047
- return /* @__PURE__ */ React31.createElement("div", __spreadProps(__spreadValues({
7462
+ return /* @__PURE__ */ React34.createElement("div", __spreadProps(__spreadValues({
7048
7463
  ref: domCallback
7049
7464
  }, props), {
7050
7465
  className: join(`${rootClassName13}-Footer`, FooterCls, props.className),
7051
7466
  style: defaultStyle
7052
- }), "Powered by", " ", /* @__PURE__ */ React31.createElement("a", {
7467
+ }), "Powered by", " ", /* @__PURE__ */ React34.createElement("a", {
7053
7468
  href: "https://infinite-table.com",
7054
7469
  rel: "noopener noreferrer",
7055
7470
  role: "link",
@@ -7057,14 +7472,8 @@ var InfiniteTableLicenseFooter = React31.forwardRef(function InfiniteTableLicens
7057
7472
  }, "Infinite Table"));
7058
7473
  });
7059
7474
 
7060
- // src/components/InfiniteTable/components/InfiniteTableRow/row.css.ts
7061
- var import_createRuntimeFn5 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
7062
- var GroupRowExpanderCls = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "", variantClassNames: { align: { start: "_7pupv0b", center: "_7pupv0c", end: "_7pupv0d" } }, defaultVariants: {}, compoundVariants: [] });
7063
- var RowClsRecipe = (0, import_createRuntimeFn5.createRuntimeFn)({ defaultClassName: "_7pupv00", variantClassNames: { zebra: { false: "_7pupv02", even: "_7pupv03", odd: "_7pupv04" }, groupRow: { true: "_7pupv05", false: "_7pupv06" }, inlineGroupRow: { true: "_7pupv07", false: "_7pupv08" }, showHoverRows: { true: "_7pupv09", false: "_7pupv0a" } }, defaultVariants: {}, compoundVariants: [] });
7064
- var RowHoverCls = "_7pupv01";
7065
-
7066
7475
  // src/components/InfiniteTable/components/LoadMask.tsx
7067
- var React32 = __toModule(require("react"));
7476
+ var React35 = __toModule(require("react"));
7068
7477
 
7069
7478
  // src/components/InfiniteTable/components/LoadMask.css.ts
7070
7479
  var LoadMaskCls = { visible: "qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw13 _16lm1iw15 _16lm1iw1a _16lm1iw18", hidden: "qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw13 _16lm1iw15 _16lm1iw1a _16lm1iw18" };
@@ -7076,15 +7485,15 @@ var { rootClassName: rootClassName12 } = internalProps;
7076
7485
  var baseCls3 = `${rootClassName12}-LoadMask`;
7077
7486
  function LoadMaskFn(props) {
7078
7487
  const { visible, children = "Loading" } = props;
7079
- return /* @__PURE__ */ React32.createElement("div", {
7488
+ return /* @__PURE__ */ React35.createElement("div", {
7080
7489
  className: `${LoadMaskCls[visible ? "visible" : "hidden"]} ${baseCls3}`
7081
- }, /* @__PURE__ */ React32.createElement("div", {
7490
+ }, /* @__PURE__ */ React35.createElement("div", {
7082
7491
  className: `${LoadMaskOverlayCls} ${baseCls3}-Overlay`
7083
- }), /* @__PURE__ */ React32.createElement("div", {
7492
+ }), /* @__PURE__ */ React35.createElement("div", {
7084
7493
  className: `${LoadMaskTextCls} ${baseCls3}-Text`
7085
7494
  }, children));
7086
7495
  }
7087
- var LoadMask = React32.memo(LoadMaskFn);
7496
+ var LoadMask = React35.memo(LoadMaskFn);
7088
7497
 
7089
7498
  // src/utils/deepClone.ts
7090
7499
  function cloneArray(arr) {
@@ -7321,14 +7730,17 @@ function group(groupParams, data) {
7321
7730
  }
7322
7731
  for (let i = 0, len = data.length; i < len; i++) {
7323
7732
  const item = data[i];
7733
+ const commonData = {};
7324
7734
  for (let groupByIndex = 0; groupByIndex < groupByLength; groupByIndex++) {
7325
7735
  const { field: groupByProperty, toKey: groupToKey } = groupBy[groupByIndex];
7326
7736
  const key = (groupToKey || defaultToKey)(item[groupByProperty], item);
7737
+ commonData[groupByProperty] = key;
7327
7738
  currentGroupKeys.push(key);
7328
7739
  if (!deepMap.has(currentGroupKeys)) {
7329
7740
  const deepMapGroupValue = {
7330
7741
  items: [],
7331
7742
  cache: false,
7743
+ commonData: __spreadValues({}, commonData),
7332
7744
  childrenLoading: false,
7333
7745
  childrenAvailable: false,
7334
7746
  reducerResults: deepClone(initialReducerValue)
@@ -7600,7 +8012,7 @@ function enhancedFlatten(param) {
7600
8012
  }
7601
8013
 
7602
8014
  // src/components/DataSource/index.tsx
7603
- var React33 = __toModule(require("react"));
8015
+ var React36 = __toModule(require("react"));
7604
8016
 
7605
8017
  // src/utils/multisort/sortTypes.ts
7606
8018
  var numberComparator = function(first, second) {
@@ -7619,7 +8031,15 @@ var sortTypes_default = defaultSortTypes;
7619
8031
 
7620
8032
  // src/utils/multisort/index.ts
7621
8033
  var multisort = (sortInfo, array, get) => {
7622
- array.sort(getMultisortFunction(sortInfo, get));
8034
+ const plainSortInfo = sortInfo.map((sortInfo2) => {
8035
+ if (Array.isArray(sortInfo2.field)) {
8036
+ return sortInfo2.field.map((field) => {
8037
+ return __spreadProps(__spreadValues({}, sortInfo2), { field });
8038
+ });
8039
+ }
8040
+ return sortInfo2;
8041
+ }).flat();
8042
+ array.sort(getMultisortFunction(plainSortInfo, get));
7623
8043
  return array;
7624
8044
  };
7625
8045
  multisort.knownTypes = sortTypes_default;
@@ -7852,15 +8272,15 @@ var GroupRowsState = class extends BooleanDeepCollectionState {
7852
8272
  };
7853
8273
 
7854
8274
  // src/components/DataSource/privateHooks/useLoadData.ts
7855
- var import_react29 = __toModule(require("react"));
8275
+ var import_react30 = __toModule(require("react"));
7856
8276
 
7857
8277
  // src/components/hooks/useEffectWithChanges.ts
7858
- var import_react28 = __toModule(require("react"));
8278
+ var import_react29 = __toModule(require("react"));
7859
8279
  function useEffectWithChanges(fn, deps) {
7860
- const prevRef = (0, import_react28.useRef)({});
7861
- const oldValuesRef = (0, import_react28.useRef)({});
8280
+ const prevRef = (0, import_react29.useRef)({});
8281
+ const oldValuesRef = (0, import_react29.useRef)({});
7862
8282
  const oldValues = oldValuesRef.current;
7863
- const changesRef = (0, import_react28.useRef)({});
8283
+ const changesRef = (0, import_react29.useRef)({});
7864
8284
  const changes = changesRef.current;
7865
8285
  const useEffectDeps = [];
7866
8286
  for (const k in deps) {
@@ -7873,7 +8293,7 @@ function useEffectWithChanges(fn, deps) {
7873
8293
  }
7874
8294
  }
7875
8295
  prevRef.current = deps;
7876
- (0, import_react28.useEffect)(() => {
8296
+ (0, import_react29.useEffect)(() => {
7877
8297
  const changes2 = changesRef.current;
7878
8298
  const result = fn(changes2, oldValues);
7879
8299
  changesRef.current = {};
@@ -8139,12 +8559,12 @@ function useLoadData() {
8139
8559
  livePaginationCursor,
8140
8560
  cursorId: stateCursorId
8141
8561
  } = componentState;
8142
- const [scrollbars, setScrollbars] = (0, import_react29.useState)({
8562
+ const [scrollbars, setScrollbars] = (0, import_react30.useState)({
8143
8563
  vertical: false,
8144
8564
  horizontal: false
8145
8565
  });
8146
- const scrollbarsRef = (0, import_react29.useRef)(scrollbars);
8147
- (0, import_react29.useEffect)(() => {
8566
+ const scrollbarsRef = (0, import_react30.useRef)(scrollbars);
8567
+ (0, import_react30.useEffect)(() => {
8148
8568
  notifyScrollbarsChange.onChange((scrollbars2) => {
8149
8569
  if (!scrollbars2) {
8150
8570
  return;
@@ -8154,7 +8574,7 @@ function useLoadData() {
8154
8574
  });
8155
8575
  return () => notifyScrollbarsChange.destroy();
8156
8576
  }, [notifyScrollbarsChange]);
8157
- (0, import_react29.useEffect)(() => {
8577
+ (0, import_react30.useEffect)(() => {
8158
8578
  if (!livePagination) {
8159
8579
  return;
8160
8580
  }
@@ -8168,7 +8588,7 @@ function useLoadData() {
8168
8588
  });
8169
8589
  return () => cancelAnimationFrame(frameId);
8170
8590
  }, [livePaginationCursor]);
8171
- (0, import_react29.useEffect)(() => {
8591
+ (0, import_react30.useEffect)(() => {
8172
8592
  if (!livePagination || livePaginationCursor !== void 0) {
8173
8593
  return;
8174
8594
  }
@@ -8182,7 +8602,7 @@ function useLoadData() {
8182
8602
  });
8183
8603
  return () => cancelAnimationFrame(frameId);
8184
8604
  }, [dataArray.length, livePaginationCursor]);
8185
- (0, import_react29.useEffect)(() => {
8605
+ (0, import_react30.useEffect)(() => {
8186
8606
  const state = getComponentState();
8187
8607
  const { livePaginationCursor: livePaginationCursor2, livePagination: livePagination2, dataArray: dataArray2 } = state;
8188
8608
  if (!scrollbars.vertical && livePagination2) {
@@ -8200,7 +8620,7 @@ function useLoadData() {
8200
8620
  filterValue,
8201
8621
  cursorId: livePagination ? stateCursorId : null
8202
8622
  };
8203
- const initialRef = (0, import_react29.useRef)(true);
8623
+ const initialRef = (0, import_react30.useRef)(true);
8204
8624
  useLazyLoadRange();
8205
8625
  useEffectWithChanges(() => {
8206
8626
  const componentState2 = getComponentState();
@@ -8232,7 +8652,7 @@ function useLazyLoadRange() {
8232
8652
  componentActions: actions,
8233
8653
  componentState
8234
8654
  } = useComponentState();
8235
- (0, import_react29.useEffect)(() => {
8655
+ (0, import_react30.useEffect)(() => {
8236
8656
  actions.lazyLoadCacheOfLoadedBatches = new DeepMap();
8237
8657
  }, [componentState.data, componentState.dataParams]);
8238
8658
  const {
@@ -8242,7 +8662,7 @@ function useLazyLoadRange() {
8242
8662
  dataArray,
8243
8663
  scrollStopDelayUpdatedByTable
8244
8664
  } = componentState;
8245
- const latestRenderRangeRef = (0, import_react29.useRef)(null);
8665
+ const latestRenderRangeRef = (0, import_react30.useRef)(null);
8246
8666
  const loadRange = (renderRange, cache = getComponentState().lazyLoadCacheOfLoadedBatches) => {
8247
8667
  const componentState2 = getComponentState();
8248
8668
  renderRange = renderRange || latestRenderRangeRef.current;
@@ -8267,8 +8687,8 @@ function useLazyLoadRange() {
8267
8687
  componentActions: actions
8268
8688
  }, cache);
8269
8689
  };
8270
- const debouncedLoadRange = (0, import_react29.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
8271
- (0, import_react29.useEffect)(() => {
8690
+ const debouncedLoadRange = (0, import_react30.useMemo)(() => debounce(loadRange, { wait: scrollStopDelayUpdatedByTable }), [scrollStopDelayUpdatedByTable]);
8691
+ (0, import_react30.useEffect)(() => {
8272
8692
  if (lazyLoad) {
8273
8693
  return notifyRenderRangeChange.onChange((renderRange) => {
8274
8694
  latestRenderRangeRef.current = renderRange;
@@ -8277,7 +8697,7 @@ function useLazyLoadRange() {
8277
8697
  }
8278
8698
  return;
8279
8699
  }, [lazyLoadBatchSize, lazyLoad]);
8280
- (0, import_react29.useEffect)(() => {
8700
+ (0, import_react30.useEffect)(() => {
8281
8701
  if (lazyLoadBatchSize && lazyLoadBatchSize > 0) {
8282
8702
  debouncedLoadRange();
8283
8703
  }
@@ -9069,7 +9489,7 @@ function getLivePaginationCursorValue(livePaginationCursorProp, state) {
9069
9489
  return livePaginationCursor;
9070
9490
  }
9071
9491
  function mapPropsToState(params) {
9072
- var _a, _b;
9492
+ var _a;
9073
9493
  const { props, state, oldState } = params;
9074
9494
  const controlledSort = isControlledValue(props.sortInfo);
9075
9495
  const controlledFilter = isControlledValue(props.filterValue);
@@ -9088,7 +9508,7 @@ function mapPropsToState(params) {
9088
9508
  if (props.cellSelection !== void 0 || props.defaultCellSelection !== void 0) {
9089
9509
  selectionMode = "multi-cell";
9090
9510
  } else {
9091
- const rowSelectionProp = (_a = props.rowSelection) != null ? _a : props.defaultRowSelection;
9511
+ const rowSelectionProp = props.rowSelection !== void 0 ? props.rowSelection : props.defaultRowSelection;
9092
9512
  if (rowSelectionProp !== void 0) {
9093
9513
  if (rowSelectionProp && typeof rowSelectionProp === "object") {
9094
9514
  selectionMode = "multi-row";
@@ -9123,7 +9543,7 @@ function mapPropsToState(params) {
9123
9543
  operatorsByFilterType,
9124
9544
  controlledSort,
9125
9545
  controlledFilter,
9126
- filterMode: ((_b = props.filterMode) != null ? _b : props.filterFunction != null) ? "local" : typeof props.data === "function" ? "remote" : "local",
9546
+ filterMode: ((_a = props.filterMode) != null ? _a : props.filterFunction != null) ? "local" : typeof props.data === "function" ? "remote" : "local",
9127
9547
  multiSort: Array.isArray(controlledSort ? props.sortInfo : props.defaultSortInfo),
9128
9548
  lazyLoadBatchSize: typeof props.lazyLoad === "object" ? props.lazyLoad.batchSize : void 0
9129
9549
  };
@@ -9727,7 +10147,7 @@ function DataSourceWithContext(props) {
9727
10147
  if (typeof children === "function") {
9728
10148
  children = children(computedValues);
9729
10149
  }
9730
- return /* @__PURE__ */ React33.createElement(React33.Fragment, null, children);
10150
+ return /* @__PURE__ */ React36.createElement(React36.Fragment, null, children);
9731
10151
  }
9732
10152
  var DataSourceRoot = getComponentStateRoot({
9733
10153
  initSetupState,
@@ -9752,14 +10172,14 @@ function DataSourceCmp({ children }) {
9752
10172
  globalThis.dataSourceActions = componentActions;
9753
10173
  }
9754
10174
  useLoadData();
9755
- return /* @__PURE__ */ React33.createElement(DataSourceContext.Provider, {
10175
+ return /* @__PURE__ */ React36.createElement(DataSourceContext.Provider, {
9756
10176
  value: contextValue
9757
- }, /* @__PURE__ */ React33.createElement(DataSourceWithContext, {
10177
+ }, /* @__PURE__ */ React36.createElement(DataSourceWithContext, {
9758
10178
  children
9759
10179
  }));
9760
10180
  }
9761
10181
  function DataSource(props) {
9762
- return /* @__PURE__ */ React33.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React33.createElement(DataSourceCmp, {
10182
+ return /* @__PURE__ */ React36.createElement(DataSourceRoot, __spreadValues({}, props), /* @__PURE__ */ React36.createElement(DataSourceCmp, {
9763
10183
  children: props.children
9764
10184
  }));
9765
10185
  }
@@ -9930,7 +10350,7 @@ function getImperativeApi(param) {
9930
10350
  }
9931
10351
 
9932
10352
  // src/components/InfiniteTable/hooks/useAutoSizeColumns.ts
9933
- var import_react30 = __toModule(require("react"));
10353
+ var import_react31 = __toModule(require("react"));
9934
10354
  var OFFSET = 10;
9935
10355
  function getColumnContentMaxWidths(domRef, options) {
9936
10356
  var _a;
@@ -9996,11 +10416,11 @@ function useAutoSizeColumns() {
9996
10416
  componentActions,
9997
10417
  componentState: { domRef, ready, autoSizeColumnsKey, brain }
9998
10418
  } = useComponentState();
9999
- const [refreshId, setRefreshId] = (0, import_react30.useState)(0);
10419
+ const [refreshId, setRefreshId] = (0, import_react31.useState)(0);
10000
10420
  const theKey = typeof autoSizeColumnsKey === "object" ? autoSizeColumnsKey.key : autoSizeColumnsKey;
10001
10421
  const getTheKey = useLatest(theKey);
10002
- const lastExecutedIdentifierRef = (0, import_react30.useRef)(null);
10003
- (0, import_react30.useEffect)(() => {
10422
+ const lastExecutedIdentifierRef = (0, import_react31.useRef)(null);
10423
+ (0, import_react31.useEffect)(() => {
10004
10424
  const key = getTheKey();
10005
10425
  if (key == null) {
10006
10426
  return;
@@ -10013,7 +10433,7 @@ function useAutoSizeColumns() {
10013
10433
  };
10014
10434
  return brain.onRenderRangeChange(onChange);
10015
10435
  }, [brain]);
10016
- (0, import_react30.useEffect)(() => {
10436
+ (0, import_react31.useEffect)(() => {
10017
10437
  var _a;
10018
10438
  if (theKey == null) {
10019
10439
  return;
@@ -10058,8 +10478,8 @@ function useAutoSizeColumns() {
10058
10478
  }
10059
10479
 
10060
10480
  // src/components/InfiniteTable/hooks/useCellRendering.tsx
10061
- var import_react31 = __toModule(require("react"));
10062
- var React34 = __toModule(require("react"));
10481
+ var import_react32 = __toModule(require("react"));
10482
+ var React37 = __toModule(require("react"));
10063
10483
 
10064
10484
  // src/components/InfiniteTable/hooks/useYourBrain.ts
10065
10485
  function useYourBrain(param) {
@@ -10095,7 +10515,8 @@ function useCellRendering(param) {
10095
10515
  computedPinnedStartColumns,
10096
10516
  computedPinnedEndColumns,
10097
10517
  computedVisibleColumns,
10098
- computedVisibleColumnsMap,
10518
+ computedColumnsMap,
10519
+ fieldsToColumn,
10099
10520
  rowspan,
10100
10521
  toggleGroupRow,
10101
10522
  columnSize
@@ -10130,13 +10551,13 @@ function useCellRendering(param) {
10130
10551
  bodySize,
10131
10552
  rowspan
10132
10553
  });
10133
- const scrollTopMaxRef = (0, import_react31.useRef)(0);
10134
- (0, import_react31.useEffect)(() => {
10554
+ const scrollTopMaxRef = (0, import_react32.useRef)(0);
10555
+ (0, import_react32.useEffect)(() => {
10135
10556
  return brain.onRenderCountChange(() => {
10136
10557
  scrollTopMaxRef.current = brain.scrollTopMax;
10137
10558
  });
10138
10559
  }, [brain]);
10139
- (0, import_react31.useEffect)(() => {
10560
+ (0, import_react32.useEffect)(() => {
10140
10561
  return brain.onScrollStop((scrollPosition) => {
10141
10562
  const { scrollTop: scrollTop2 } = scrollPosition;
10142
10563
  if (scrollTop2 === 0) {
@@ -10153,7 +10574,7 @@ function useCellRendering(param) {
10153
10574
  }
10154
10575
  });
10155
10576
  }, [brain, onScrollToTop, onScrollToBottom]);
10156
- (0, import_react31.useEffect)(() => {
10577
+ (0, import_react32.useEffect)(() => {
10157
10578
  if (!bodySize.height) {
10158
10579
  return;
10159
10580
  }
@@ -10164,10 +10585,10 @@ function useCellRendering(param) {
10164
10585
  }
10165
10586
  }, [!!bodySize.height]);
10166
10587
  const [, rerender] = useRerender();
10167
- (0, import_react31.useEffect)(() => {
10588
+ (0, import_react32.useEffect)(() => {
10168
10589
  rerender();
10169
10590
  }, [dataSourceState]);
10170
- const renderCell = (0, import_react31.useCallback)((params) => {
10591
+ const renderCell = (0, import_react32.useCallback)((params) => {
10171
10592
  const {
10172
10593
  rowIndex,
10173
10594
  colIndex,
@@ -10199,16 +10620,18 @@ function useCellRendering(param) {
10199
10620
  domRef,
10200
10621
  width,
10201
10622
  column,
10202
- columnsMap: computedVisibleColumnsMap,
10623
+ columnsMap: computedColumnsMap,
10624
+ fieldsToColumn,
10203
10625
  rowStyle,
10204
10626
  rowClassName
10205
10627
  };
10206
- return /* @__PURE__ */ React34.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
10628
+ return /* @__PURE__ */ React37.createElement(InfiniteTableColumnCell, __spreadValues({}, cellProps));
10207
10629
  }, [
10208
10630
  rowHeight,
10209
10631
  getData,
10210
10632
  computedVisibleColumns,
10211
- computedVisibleColumnsMap,
10633
+ computedColumnsMap,
10634
+ fieldsToColumn,
10212
10635
  groupRenderStrategy,
10213
10636
  toggleGroupRow,
10214
10637
  showZebraRows,
@@ -10295,10 +10718,10 @@ var MultiRowSelector = class {
10295
10718
  };
10296
10719
 
10297
10720
  // src/components/InfiniteTable/hooks/useColumnGroups.ts
10298
- var import_react33 = __toModule(require("react"));
10721
+ var import_react34 = __toModule(require("react"));
10299
10722
 
10300
10723
  // src/components/hooks/useInterceptedMap.ts
10301
- var import_react32 = __toModule(require("react"));
10724
+ var import_react33 = __toModule(require("react"));
10302
10725
  function interceptMap(map2, fns) {
10303
10726
  const { set, delete: deleteKey, clear } = map2;
10304
10727
  if (fns.set) {
@@ -10328,373 +10751,141 @@ function interceptMap(map2, fns) {
10328
10751
  };
10329
10752
  }
10330
10753
  return () => {
10331
- if (set) {
10332
- map2.set = set;
10333
- }
10334
- if (deleteKey) {
10335
- map2.delete = deleteKey;
10336
- }
10337
- if (clear) {
10338
- map2.clear = clear;
10339
- }
10340
- };
10341
- }
10342
-
10343
- // src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
10344
- function computeColumnGroupsDepths(columnGroups) {
10345
- const map2 = new Map();
10346
- columnGroups.forEach((colGroup, colGroupId) => {
10347
- let parentGroupId = colGroup.columnGroup;
10348
- let depth = 0;
10349
- while (parentGroupId) {
10350
- const parent = columnGroups.get(parentGroupId);
10351
- if (!parent) {
10352
- if (false) {
10353
- console.warn(`Cannot find column group ${parentGroupId}`);
10354
- }
10355
- break;
10356
- }
10357
- depth++;
10358
- parentGroupId = parent.columnGroup;
10359
- }
10360
- map2.set(colGroupId, depth);
10361
- });
10362
- return map2;
10363
- }
10364
-
10365
- // src/components/InfiniteTable/hooks/useColumnGroups.ts
10366
- function useColumnGroups() {
10367
- const {
10368
- componentState: {
10369
- computedColumnGroups,
10370
- collapsedColumnGroups
10371
- },
10372
- componentActions,
10373
- getComponentState
10374
- } = useComponentState();
10375
- (0, import_react33.useEffect)(() => {
10376
- const recompute = () => {
10377
- componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
10378
- };
10379
- const update = rafFn(recompute);
10380
- return interceptMap(computedColumnGroups, {
10381
- clear: update,
10382
- delete: update,
10383
- set: update
10384
- });
10385
- }, [computedColumnGroups]);
10386
- (0, import_react33.useEffect)(() => {
10387
- return interceptMap(collapsedColumnGroups, {
10388
- set: (key, visibleCol) => {
10389
- const colIds = key.slice(1);
10390
- const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
10391
- colIds.forEach((colId) => {
10392
- columnVisibility[colId] = false;
10393
- });
10394
- delete columnVisibility[visibleCol];
10395
- componentActions.columnVisibility = columnVisibility;
10396
- },
10397
- beforeClear: (currentCollapsedGroups) => {
10398
- const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
10399
- const keys = [...currentCollapsedGroups.keys()];
10400
- keys.forEach((key) => {
10401
- const colIds = key.slice(1);
10402
- colIds.forEach((colId) => {
10403
- delete columnVisibility[colId];
10404
- });
10405
- });
10406
- componentActions.columnVisibility = columnVisibility;
10407
- },
10408
- delete: (key) => {
10409
- const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
10410
- const colIds = key.slice(1);
10411
- colIds.forEach((colId) => {
10412
- delete columnVisibility[colId];
10413
- });
10414
- componentActions.columnVisibility = columnVisibility;
10415
- }
10416
- });
10417
- }, [collapsedColumnGroups]);
10418
- }
10419
-
10420
- // src/components/InfiniteTable/hooks/useColumnRowspan.ts
10421
- var import_react34 = __toModule(require("react"));
10422
- function useColumnRowspan(computedVisibleColumns) {
10423
- const { getState: getDataSourceState } = useDataSourceContextValue();
10424
- const rowspan = (0, import_react34.useMemo)(() => {
10425
- const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
10426
- return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
10427
- const dataArray = getDataSourceState().dataArray;
10428
- const rowInfo = dataArray[rowIndex];
10429
- if (!rowInfo) {
10430
- return 1;
10431
- }
10432
- const data = rowInfo.data;
10433
- const column = computedVisibleColumns[colIndex];
10434
- if (!column || !column.rowspan) {
10435
- return 1;
10436
- }
10437
- return column.rowspan({
10438
- column,
10439
- data,
10440
- dataArray,
10441
- rowInfo,
10442
- rowIndex
10443
- });
10444
- } : void 0;
10445
- }, [computedVisibleColumns]);
10446
- return rowspan;
10447
- }
10448
-
10449
- // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
10450
- var import_react35 = __toModule(require("react"));
10451
- var debug4 = dbg("useColumnSizeFn");
10452
- function useColumnSizeFn(columns) {
10453
- const columnSize = (0, import_react35.useCallback)((index) => {
10454
- const column = columns[index];
10455
- if (false) {
10456
- debug4("cannot find column at index", index, columns);
10457
- }
10458
- return column ? column.computedWidth : 0;
10459
- }, [columns]);
10460
- return columnSize;
10461
- }
10462
-
10463
- // src/components/InfiniteTable/hooks/useColumnsWhen.ts
10464
- var import_react39 = __toModule(require("react"));
10465
-
10466
- // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
10467
- var React37 = __toModule(require("react"));
10468
-
10469
- // src/components/DataSource/state/rowInfoStatus.ts
10470
- var showLoadingIcon = (rowInfo) => {
10471
- if (rowInfo.dataSourceHasGrouping) {
10472
- return rowInfo.isGroupRow ? rowInfo.childrenLoading || !rowInfo.selfLoaded : !rowInfo.selfLoaded;
10473
- }
10474
- return !rowInfo.selfLoaded;
10475
- };
10476
-
10477
- // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
10478
- var React35 = __toModule(require("react"));
10479
- var import_react36 = __toModule(require("react"));
10480
-
10481
- // src/components/InfiniteTable/components/icons/ExpanderIcon.css.ts
10482
- var import_createRuntimeFn6 = __toModule(require_vanilla_extract_recipes_createRuntimeFn_cjs());
10483
- var ExpanderIconCls = "_16lm1iw6 _16lm1iwi _16lm1iwe";
10484
- var ExpanderIconClsVariants = (0, import_createRuntimeFn6.createRuntimeFn)({ defaultClassName: "", variantClassNames: { expanded: { true: "_16lm1iwc", false: "_198z9782" }, direction: { end: "_198z9783", start: "_198z9784" } }, defaultVariants: {}, compoundVariants: [[{ expanded: false, direction: "end" }, "_16lm1iwd"]] });
10485
-
10486
- // src/components/InfiniteTable/components/icons/ExpanderIcon.tsx
10487
- function ExpanderIcon(props) {
10488
- var _a;
10489
- const { size = 24, direction = "start" } = props;
10490
- const [expanded, setExpanded] = (0, import_react36.useState)((_a = props.expanded) != null ? _a : props.defaultExpanded);
10491
- const onClick = () => {
10492
- var _a2;
10493
- (_a2 = props.onChange) == null ? void 0 : _a2.call(props, !expanded);
10494
- if (!isControlled("expanded", props)) {
10495
- setExpanded(!expanded);
10496
- }
10497
- };
10498
- React35.useEffect(() => {
10499
- if (isControlled("expanded", props)) {
10500
- setExpanded(props.expanded);
10501
- }
10502
- }, [props.expanded]);
10503
- return /* @__PURE__ */ React35.createElement("svg", {
10504
- "data-name": "expander-icon",
10505
- xmlns: "http://www.w3.org/2000/svg",
10506
- height: `${size}px`,
10507
- viewBox: "0 0 24 24",
10508
- width: `${size}px`,
10509
- style: props.style,
10510
- onClick,
10511
- className: join(props.className, ExpanderIconCls, ExpanderIconClsVariants({
10512
- direction: direction || "start",
10513
- expanded
10514
- }), "InfiniteIcon", "InfiniteIcon-expander", `InfiniteIcon-expander--${expanded ? "expanded" : "collapsed"}`, `InfiniteIcon-expander--${direction === "end" ? "end" : "start"}`)
10515
- }, /* @__PURE__ */ React35.createElement("path", {
10516
- d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
10517
- }));
10518
- }
10519
-
10520
- // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
10521
- var React36 = __toModule(require("react"));
10522
-
10523
- // src/components/InfiniteTable/components/icons/LoadingIcon.css.ts
10524
- var LoadingIconCls = "_16lm1iw8 _16lm1iwi _16lm1iwe";
10525
-
10526
- // src/components/InfiniteTable/components/icons/LoadingIcon.tsx
10527
- var LoadingIcon = (props) => {
10528
- return /* @__PURE__ */ React36.createElement("svg", {
10529
- xmlns: "http://www.w3.org/2000/svg",
10530
- style: {
10531
- margin: "auto",
10532
- display: "block",
10533
- shapeRendering: "auto"
10534
- },
10535
- width: "24px",
10536
- height: "24px",
10537
- viewBox: "0 0 100 100",
10538
- preserveAspectRatio: "xMidYMid",
10539
- className: join(props.className, LoadingIconCls, "InfiniteIcon", "InfiniteIcon-loading")
10540
- }, /* @__PURE__ */ React36.createElement("circle", {
10541
- cx: "50",
10542
- cy: "50",
10543
- fill: "none",
10544
- strokeWidth: "10",
10545
- r: "35",
10546
- strokeDasharray: "164.93361431346415 56.97787143782138"
10547
- }, /* @__PURE__ */ React36.createElement("animateTransform", {
10548
- attributeName: "transform",
10549
- type: "rotate",
10550
- repeatCount: "indefinite",
10551
- dur: "1s",
10552
- values: "0 50 50;360 50 50",
10553
- keyTimes: "0;1"
10554
- })));
10555
- };
10556
-
10557
- // src/components/InfiniteTable/utils/getColumnForGroupBy.tsx
10558
- function styleForGroupColumn({
10559
- rowInfo
10560
- }) {
10561
- return {
10562
- [stripVar(ThemeVars.components.Row.groupNesting)]: rowInfo.dataSourceHasGrouping ? rowInfo.isGroupRow ? rowInfo.groupNesting - 1 : rowInfo.groupNesting : 0
10563
- };
10564
- }
10565
- function getGroupColumnRender({
10566
- groupIndexForColumn,
10567
- groupRenderStrategy
10568
- }) {
10569
- return (renderOptions) => {
10570
- const { rowInfo, renderBag, column } = renderOptions;
10571
- let { value: valueToRender, groupIcon, selectionCheckBox } = renderBag;
10572
- const groupRowInfo = rowInfo;
10573
- if (groupRenderStrategy === "multi-column") {
10574
- if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting && groupRowInfo.isGroupRow) {
10575
- return null;
10576
- }
10577
- } else if (groupRenderStrategy === "single-column" && !groupRowInfo.isGroupRow) {
10578
- }
10579
- return /* @__PURE__ */ React37.createElement("div", {
10580
- className: join(display.flex, column.align === "end" ? flexFlow.rowReverse : flexFlow.row, alignItems.center, groupRenderStrategy === "single-column" || groupRenderStrategy === "multi-column" && !rowInfo.isGroupRow && selectionCheckBox ? GroupRowExpanderCls({ align: column.align || "start" }) : null)
10581
- }, groupIcon, selectionCheckBox, /* @__PURE__ */ React37.createElement("div", {
10582
- className: cssEllipsisClassName
10583
- }, valueToRender != null ? valueToRender : null));
10584
- };
10585
- }
10586
- function getGroupColumnRenderGroupIcon({
10587
- groupIndexForColumn,
10588
- groupRenderStrategy,
10589
- toggleGroupRow,
10590
- initialRenderGroupIcon
10591
- }) {
10592
- return (renderOptions) => {
10593
- var _a, _b, _c;
10594
- const { rowInfo, value, groupBy, pivotBy, column } = renderOptions;
10595
- const groupRowInfo = groupRenderStrategy !== "inline" ? rowInfo : rowInfo.isGroupRow && ((_a = rowInfo.parents) == null ? void 0 : _a[groupIndexForColumn]) || rowInfo;
10596
- if (!groupRowInfo) {
10597
- return null;
10598
- }
10599
- const collapsed = groupRowInfo.collapsed;
10600
- if (groupRenderStrategy === "inline") {
10601
- if (groupRowInfo.groupCount === 1) {
10602
- return value;
10603
- }
10604
- if (groupRowInfo.groupNesting === groupIndexForColumn && collapsed) {
10605
- return null;
10606
- }
10607
- } else {
10608
- if (!groupRowInfo.isGroupRow) {
10609
- return null;
10610
- }
10611
- if (groupRenderStrategy === "multi-column") {
10612
- if (groupIndexForColumn + 1 !== groupRowInfo.groupNesting) {
10613
- return null;
10614
- }
10615
- }
10754
+ if (set) {
10755
+ map2.set = set;
10616
10756
  }
10617
- const groupKeys = groupRowInfo.groupKeys;
10618
- let icon = null;
10619
- const showExpanderIcon = pivotBy ? (((_b = groupRowInfo.groupKeys) == null ? void 0 : _b.length) || 0) < (groupBy == null ? void 0 : groupBy.length) : (((_c = groupRowInfo.groupKeys) == null ? void 0 : _c.length) || 0) <= (groupBy == null ? void 0 : groupBy.length);
10620
- const isLoading = showLoadingIcon(groupRowInfo);
10621
- if (isLoading) {
10622
- icon = /* @__PURE__ */ React37.createElement(LoadingIcon, null);
10623
- } else if (showExpanderIcon) {
10624
- const defaultIcon = /* @__PURE__ */ React37.createElement(ExpanderIcon, {
10625
- expanded: !collapsed,
10626
- direction: column.align === "end" ? "end" : "start",
10627
- onChange: () => {
10628
- toggleGroupRow(groupKeys);
10629
- }
10630
- });
10631
- icon = defaultIcon;
10757
+ if (deleteKey) {
10758
+ map2.delete = deleteKey;
10632
10759
  }
10633
- if (initialRenderGroupIcon) {
10634
- renderOptions.renderBag.groupIcon = icon;
10635
- icon = /* @__PURE__ */ React37.createElement(RenderHookComponent, {
10636
- render: initialRenderGroupIcon,
10637
- renderParam: renderOptions
10638
- });
10760
+ if (clear) {
10761
+ map2.clear = clear;
10639
10762
  }
10640
- return icon;
10641
10763
  };
10642
10764
  }
10643
- function getColumnForGroupBy(options, toggleGroupRow, groupColumnFromProps) {
10644
- const { groupByForColumn, groupIndexForColumn, groupRenderStrategy } = options;
10645
- let userDefinedGroupColumn = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : __spreadValues({}, groupColumnFromProps);
10646
- if (groupByForColumn.column) {
10647
- userDefinedGroupColumn = __spreadValues(__spreadValues({}, userDefinedGroupColumn), groupByForColumn.column);
10648
- }
10649
- let generatedGroupColumn = __spreadProps(__spreadValues({
10650
- header: `Group by ${groupByForColumn.field}`,
10651
- groupByField: groupByForColumn.field,
10652
- sortable: false,
10653
- style: styleForGroupColumn,
10654
- render: getGroupColumnRender({
10655
- groupIndexForColumn,
10656
- groupRenderStrategy
10657
- })
10658
- }, userDefinedGroupColumn), {
10659
- renderGroupIcon: getGroupColumnRenderGroupIcon({
10660
- initialRenderGroupIcon: userDefinedGroupColumn == null ? void 0 : userDefinedGroupColumn.renderGroupIcon,
10661
- groupIndexForColumn,
10662
- toggleGroupRow,
10663
- groupRenderStrategy
10664
- })
10665
- });
10666
- if (groupColumnFromProps) {
10667
- if (typeof groupColumnFromProps === "function") {
10668
- generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps(options, toggleGroupRow));
10669
- } else {
10670
- generatedGroupColumn = __spreadValues(__spreadValues({}, generatedGroupColumn), groupColumnFromProps);
10765
+
10766
+ // src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
10767
+ function computeColumnGroupsDepths(columnGroups) {
10768
+ const map2 = new Map();
10769
+ columnGroups.forEach((colGroup, colGroupId) => {
10770
+ let parentGroupId = colGroup.columnGroup;
10771
+ let depth = 0;
10772
+ while (parentGroupId) {
10773
+ const parent = columnGroups.get(parentGroupId);
10774
+ if (!parent) {
10775
+ if (false) {
10776
+ console.warn(`Cannot find column group ${parentGroupId}`);
10777
+ }
10778
+ break;
10779
+ }
10780
+ depth++;
10781
+ parentGroupId = parent.columnGroup;
10671
10782
  }
10672
- }
10673
- return generatedGroupColumn;
10674
- }
10675
- function getSingleGroupColumn(options, toggleGroupRow, groupColumnFromProps) {
10676
- const theGroupColumnFromProps = typeof groupColumnFromProps === "function" ? groupColumnFromProps(options, toggleGroupRow) : groupColumnFromProps;
10677
- let generatedGroupColumn = __spreadProps(__spreadValues({
10678
- header: `Group`,
10679
- groupByField: options.groupBy.map((g) => g.field),
10680
- sortable: false,
10681
- renderSelectionCheckBox: options.selectionMode === "multi-row",
10682
- style: styleForGroupColumn,
10683
- render: getGroupColumnRender({
10684
- groupIndexForColumn: 0,
10685
- groupRenderStrategy: "single-column"
10686
- })
10687
- }, groupColumnFromProps), {
10688
- renderGroupIcon: getGroupColumnRenderGroupIcon({
10689
- initialRenderGroupIcon: theGroupColumnFromProps == null ? void 0 : theGroupColumnFromProps.renderGroupIcon,
10690
- groupIndexForColumn: 0,
10691
- toggleGroupRow,
10692
- groupRenderStrategy: "single-column"
10693
- })
10783
+ map2.set(colGroupId, depth);
10694
10784
  });
10695
- return generatedGroupColumn;
10785
+ return map2;
10786
+ }
10787
+
10788
+ // src/components/InfiniteTable/hooks/useColumnGroups.ts
10789
+ function useColumnGroups() {
10790
+ const {
10791
+ componentState: {
10792
+ computedColumnGroups,
10793
+ collapsedColumnGroups
10794
+ },
10795
+ componentActions,
10796
+ getComponentState
10797
+ } = useComponentState();
10798
+ (0, import_react34.useEffect)(() => {
10799
+ const recompute = () => {
10800
+ componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
10801
+ };
10802
+ const update = rafFn(recompute);
10803
+ return interceptMap(computedColumnGroups, {
10804
+ clear: update,
10805
+ delete: update,
10806
+ set: update
10807
+ });
10808
+ }, [computedColumnGroups]);
10809
+ (0, import_react34.useEffect)(() => {
10810
+ return interceptMap(collapsedColumnGroups, {
10811
+ set: (key, visibleCol) => {
10812
+ const colIds = key.slice(1);
10813
+ const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
10814
+ colIds.forEach((colId) => {
10815
+ columnVisibility[colId] = false;
10816
+ });
10817
+ delete columnVisibility[visibleCol];
10818
+ componentActions.columnVisibility = columnVisibility;
10819
+ },
10820
+ beforeClear: (currentCollapsedGroups) => {
10821
+ const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
10822
+ const keys = [...currentCollapsedGroups.keys()];
10823
+ keys.forEach((key) => {
10824
+ const colIds = key.slice(1);
10825
+ colIds.forEach((colId) => {
10826
+ delete columnVisibility[colId];
10827
+ });
10828
+ });
10829
+ componentActions.columnVisibility = columnVisibility;
10830
+ },
10831
+ delete: (key) => {
10832
+ const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
10833
+ const colIds = key.slice(1);
10834
+ colIds.forEach((colId) => {
10835
+ delete columnVisibility[colId];
10836
+ });
10837
+ componentActions.columnVisibility = columnVisibility;
10838
+ }
10839
+ });
10840
+ }, [collapsedColumnGroups]);
10841
+ }
10842
+
10843
+ // src/components/InfiniteTable/hooks/useColumnRowspan.ts
10844
+ var import_react35 = __toModule(require("react"));
10845
+ function useColumnRowspan(computedVisibleColumns) {
10846
+ const { getState: getDataSourceState } = useDataSourceContextValue();
10847
+ const rowspan = (0, import_react35.useMemo)(() => {
10848
+ const colsWithRowspan = computedVisibleColumns.filter((col) => typeof col.rowspan === "function");
10849
+ return colsWithRowspan.length ? ({ rowIndex, colIndex }) => {
10850
+ const dataArray = getDataSourceState().dataArray;
10851
+ const rowInfo = dataArray[rowIndex];
10852
+ if (!rowInfo) {
10853
+ return 1;
10854
+ }
10855
+ const data = rowInfo.data;
10856
+ const column = computedVisibleColumns[colIndex];
10857
+ if (!column || !column.rowspan) {
10858
+ return 1;
10859
+ }
10860
+ return column.rowspan({
10861
+ column,
10862
+ data,
10863
+ dataArray,
10864
+ rowInfo,
10865
+ rowIndex
10866
+ });
10867
+ } : void 0;
10868
+ }, [computedVisibleColumns]);
10869
+ return rowspan;
10870
+ }
10871
+
10872
+ // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
10873
+ var import_react36 = __toModule(require("react"));
10874
+ var debug4 = dbg("useColumnSizeFn");
10875
+ function useColumnSizeFn(columns) {
10876
+ const columnSize = (0, import_react36.useCallback)((index) => {
10877
+ const column = columns[index];
10878
+ if (false) {
10879
+ debug4("cannot find column at index", index, columns);
10880
+ }
10881
+ return column ? column.computedWidth : 0;
10882
+ }, [columns]);
10883
+ return columnSize;
10696
10884
  }
10697
10885
 
10886
+ // src/components/InfiniteTable/hooks/useColumnsWhen.ts
10887
+ var import_react39 = __toModule(require("react"));
10888
+
10698
10889
  // src/components/InfiniteTable/hooks/useEffectWithRaf.ts
10699
10890
  var import_react37 = __toModule(require("react"));
10700
10891
  function useEffectWithRaf(fn, deps) {
@@ -10882,17 +11073,19 @@ function useColumnsWhenGrouping() {
10882
11073
  componentState: {
10883
11074
  columns,
10884
11075
  groupColumn,
11076
+ hideColumnWhenGrouped,
10885
11077
  groupRenderStrategy,
10886
11078
  pivotColumns,
10887
11079
  pivotColumn,
10888
11080
  pivotTotalColumnPosition,
10889
11081
  pivotGrandTotalColumnPosition
10890
- }
11082
+ },
11083
+ getComponentState
10891
11084
  } = useComponentState();
10892
11085
  const toggleGroupRow = useToggleGroupRow();
10893
11086
  (0, import_react39.useEffect)(() => {
10894
11087
  const update = () => {
10895
- const columnsWhenGrouping = getColumnsWhenGrouping({
11088
+ const { columns: columnsWhenGrouping, groupColumnIds } = getColumnsWhenGrouping({
10896
11089
  columns,
10897
11090
  groupColumn,
10898
11091
  pivotColumn,
@@ -10906,6 +11099,23 @@ function useColumnsWhenGrouping() {
10906
11099
  selectionMode
10907
11100
  });
10908
11101
  componentActions.columnsWhenGrouping = columnsWhenGrouping;
11102
+ let currentColumnOrder = getComponentState().columnOrder;
11103
+ if (groupColumnIds.length && Array.isArray(currentColumnOrder)) {
11104
+ const colOrder = new Set(currentColumnOrder);
11105
+ let shouldUpdate = false;
11106
+ groupColumnIds.forEach((groupColId) => {
11107
+ if (!colOrder.has(groupColId)) {
11108
+ shouldUpdate = true;
11109
+ currentColumnOrder = [
11110
+ groupColId,
11111
+ ...currentColumnOrder
11112
+ ];
11113
+ }
11114
+ });
11115
+ if (shouldUpdate) {
11116
+ componentActions.columnOrder = currentColumnOrder;
11117
+ }
11118
+ }
10909
11119
  };
10910
11120
  update();
10911
11121
  return interceptMap(columns, {
@@ -10918,6 +11128,7 @@ function useColumnsWhenGrouping() {
10918
11128
  groupBy,
10919
11129
  pivotBy,
10920
11130
  selectionMode,
11131
+ hideColumnWhenGrouped,
10921
11132
  groupColumn,
10922
11133
  groupRenderStrategy,
10923
11134
  pivotColumns,
@@ -10942,6 +11153,7 @@ function useHideColumns(groupByMap) {
10942
11153
  componentState: {
10943
11154
  columnTypes,
10944
11155
  computedColumns,
11156
+ hideColumnWhenGrouped,
10945
11157
  hideEmptyGroupColumns,
10946
11158
  groupRenderStrategy
10947
11159
  }
@@ -11031,30 +11243,54 @@ function useHideColumns(groupByMap) {
11031
11243
  (0, import_react39.useEffect)(() => {
11032
11244
  const isGrouped = groupBy.length > 0;
11033
11245
  const currentState = getComponentState();
11034
- const { controlledColumnVisibility, columnVisibility } = currentState;
11035
- if (controlledColumnVisibility) {
11036
- return;
11037
- }
11246
+ const {
11247
+ columnVisibility,
11248
+ columnVisibilityForGrouping,
11249
+ hideColumnWhenGrouped: hideColumnWhenGrouped2
11250
+ } = currentState;
11038
11251
  const newColumnVisibility = __spreadValues({}, columnVisibility);
11039
- let updated = false;
11252
+ let newColumnVisibilityForGrouping = __spreadValues({}, columnVisibilityForGrouping);
11253
+ let updatedVisibilityWhenGrouping = false;
11254
+ let newlyHiddenColumns = new Set();
11255
+ let newlyDisplayedColumns = new Set();
11040
11256
  computedColumns.forEach((col, id) => {
11041
- if (col.defaultHiddenWhenGroupedBy) {
11042
- const nowHidden = columnVisibility[id] === false;
11043
- const shouldBeHidden = col.defaultHiddenWhenGroupedBy === "*" && isGrouped || typeof col.defaultHiddenWhenGroupedBy === "string" && groupByMap.get(col.defaultHiddenWhenGroupedBy) || typeof col.defaultHiddenWhenGroupedBy === "object" && Object.keys(col.defaultHiddenWhenGroupedBy).reduce((acc, field) => acc || groupByMap.has(field), false);
11044
- if (nowHidden !== shouldBeHidden) {
11045
- updated = true;
11046
- if (shouldBeHidden) {
11047
- newColumnVisibility[id] = false;
11048
- } else {
11049
- delete newColumnVisibility[id];
11257
+ if (col.defaultHiddenWhenGroupedBy || hideColumnWhenGrouped2 != null) {
11258
+ 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);
11259
+ if (hideWhenGrouped) {
11260
+ if (newColumnVisibilityForGrouping[id] !== false) {
11261
+ if (columnVisibility[id] === false) {
11262
+ return;
11263
+ }
11264
+ newColumnVisibilityForGrouping[id] = false;
11265
+ updatedVisibilityWhenGrouping = true;
11266
+ newlyHiddenColumns.add(id);
11267
+ }
11268
+ } else {
11269
+ if (newColumnVisibilityForGrouping[id] === false) {
11270
+ delete newColumnVisibilityForGrouping[id];
11271
+ updatedVisibilityWhenGrouping = true;
11272
+ newlyDisplayedColumns.add(id);
11050
11273
  }
11051
11274
  }
11052
11275
  }
11053
11276
  });
11054
- if (updated) {
11277
+ if (updatedVisibilityWhenGrouping) {
11278
+ componentActions.columnVisibilityForGrouping = newColumnVisibilityForGrouping;
11279
+ newlyDisplayedColumns.forEach((colId) => {
11280
+ delete newColumnVisibility[colId];
11281
+ });
11282
+ newlyHiddenColumns.forEach((colId) => {
11283
+ newColumnVisibility[colId] = false;
11284
+ });
11055
11285
  componentActions.columnVisibility = newColumnVisibility;
11056
11286
  }
11057
- }, [computedColumns, columnTypes, groupBy, groupByMap]);
11287
+ }, [
11288
+ computedColumns,
11289
+ columnTypes,
11290
+ groupBy,
11291
+ groupByMap,
11292
+ hideColumnWhenGrouped
11293
+ ]);
11058
11294
  }
11059
11295
  function getColumnsWhenGrouping(params) {
11060
11296
  const {
@@ -11071,9 +11307,10 @@ function getColumnsWhenGrouping(params) {
11071
11307
  columns
11072
11308
  } = params;
11073
11309
  if (groupRenderStrategy === "inline") {
11074
- return void 0;
11310
+ return { columns: void 0, groupColumnIds: [] };
11075
11311
  }
11076
11312
  const computedColumns = new Map();
11313
+ const groupColumnIds = [];
11077
11314
  if (groupRenderStrategy === "multi-column") {
11078
11315
  groupBy.forEach((groupByForColumn, groupIndexForColumn, arr) => {
11079
11316
  const generatedGroupColumn = getColumnForGroupBy({
@@ -11085,7 +11322,9 @@ function getColumnsWhenGrouping(params) {
11085
11322
  groupRenderStrategy,
11086
11323
  selectionMode
11087
11324
  }, toggleGroupRow, groupColumn);
11088
- computedColumns.set(generatedGroupColumn.id || `group-by-${groupByForColumn.field}`, generatedGroupColumn);
11325
+ const groupColumnId = generatedGroupColumn.id || `group-by-${groupByForColumn.field}`;
11326
+ groupColumnIds.push(groupColumnId);
11327
+ computedColumns.set(groupColumnId, generatedGroupColumn);
11089
11328
  });
11090
11329
  } else if (groupRenderStrategy === "single-column" && groupBy.length) {
11091
11330
  const singleGroupColumn = getSingleGroupColumn({
@@ -11095,7 +11334,9 @@ function getColumnsWhenGrouping(params) {
11095
11334
  groupRenderStrategy,
11096
11335
  selectionMode
11097
11336
  }, toggleGroupRow, groupColumn);
11098
- computedColumns.set(singleGroupColumn.id || "group-by", singleGroupColumn);
11337
+ const groupColumnId = singleGroupColumn.id || "group-by";
11338
+ groupColumnIds.push(groupColumnId);
11339
+ computedColumns.set(groupColumnId, singleGroupColumn);
11099
11340
  }
11100
11341
  if (pivotColumns) {
11101
11342
  const columnsByField = {};
@@ -11142,7 +11383,10 @@ function getColumnsWhenGrouping(params) {
11142
11383
  computedColumns.set(colId, col);
11143
11384
  });
11144
11385
  }
11145
- return computedColumns.size ? computedColumns : void 0;
11386
+ return {
11387
+ columns: computedColumns.size ? computedColumns : void 0,
11388
+ groupColumnIds
11389
+ };
11146
11390
  }
11147
11391
 
11148
11392
  // src/components/InfiniteTable/hooks/useComputedVisibleColumns.ts
@@ -11202,6 +11446,33 @@ var getComputedPinned = (colId, columnPinning) => {
11202
11446
  const computedPinned = pinned === "start" || pinned === true ? "start" : pinned === "end" ? "end" : false;
11203
11447
  return computedPinned;
11204
11448
  };
11449
+ function isGroupColumnSortable(column, columns) {
11450
+ var _a;
11451
+ let sortableColumnOrType = (_a = column.sortable) != null ? _a : column.colType.sortable;
11452
+ if (sortableColumnOrType != null) {
11453
+ return sortableColumnOrType;
11454
+ }
11455
+ if (column.computedSortable === false) {
11456
+ return false;
11457
+ }
11458
+ let groupByField = column.groupByField || [];
11459
+ if (groupByField != null && !Array.isArray(groupByField)) {
11460
+ groupByField = [groupByField];
11461
+ }
11462
+ const fields = (groupByField || []).reduce((acc, field) => {
11463
+ acc[field] = true;
11464
+ return acc;
11465
+ }, {});
11466
+ const groupColumns = [];
11467
+ columns.forEach((col) => {
11468
+ if (col.field && fields[col.field]) {
11469
+ groupColumns.push(col);
11470
+ }
11471
+ });
11472
+ return groupColumns.reduce((sortable, col) => {
11473
+ return sortable && col.computedSortable === true;
11474
+ }, true);
11475
+ }
11205
11476
  var getComputedVisibleColumns = ({
11206
11477
  columns,
11207
11478
  bodySize,
@@ -11248,12 +11519,16 @@ var getComputedVisibleColumns = ({
11248
11519
  const result2 = isColumnVisible(columnVisibility, columnVisibilityAssumeVisible, colId);
11249
11520
  return result2;
11250
11521
  });
11251
- const columnsArray = visibleColumnOrder.map((columnId) => columns.get(columnId)).filter(Boolean);
11522
+ const columnIdsToVisibleIndex = new Map();
11523
+ const visibleColumnsArray = visibleColumnOrder.map((columnId, index) => {
11524
+ const col = columns.get(columnId);
11525
+ columnIdsToVisibleIndex.set(columnId, index);
11526
+ return col;
11527
+ });
11252
11528
  const sortedMap = (sortInfo != null ? sortInfo : []).reduce((acc, info, index) => {
11253
11529
  if (info.id) {
11254
11530
  acc[info.id] = { sortInfo: info, index };
11255
- }
11256
- if (info.field) {
11531
+ } else if (info.field) {
11257
11532
  acc[info.field] = {
11258
11533
  sortInfo: info,
11259
11534
  index
@@ -11261,54 +11536,57 @@ var getComputedVisibleColumns = ({
11261
11536
  }
11262
11537
  return acc;
11263
11538
  }, {});
11539
+ function getColSize(colId) {
11540
+ var _a, _b, _c, _d, _e, _f;
11541
+ const column = columns.get(colId);
11542
+ const colType = getColumnComputedType(column, columnTypes);
11543
+ const colTypeSizing = {
11544
+ minWidth: colType == null ? void 0 : colType.minWidth,
11545
+ maxWidth: colType == null ? void 0 : colType.maxWidth,
11546
+ width: colType == null ? void 0 : colType.defaultWidth,
11547
+ flex: colType == null ? void 0 : colType.defaultFlex
11548
+ };
11549
+ let colSizing = assignNonNull({
11550
+ width: column == null ? void 0 : column.defaultWidth,
11551
+ flex: column == null ? void 0 : column.defaultFlex,
11552
+ minWidth: column == null ? void 0 : column.minWidth,
11553
+ maxWidth: column == null ? void 0 : column.maxWidth
11554
+ }, columnSizing[colId]);
11555
+ if (colSizing.width != null) {
11556
+ delete colTypeSizing.flex;
11557
+ }
11558
+ if (colSizing.flex != null) {
11559
+ delete colTypeSizing.width;
11560
+ }
11561
+ colSizing = assignNonNull(colTypeSizing, colSizing);
11562
+ const colFlex = (_a = colSizing.flex) != null ? _a : void 0;
11563
+ const colMinWidth = (_c = (_b = colSizing.minWidth) != null ? _b : column == null ? void 0 : column.minWidth) != null ? _c : columnMinWidth;
11564
+ const colMaxWidth = (_e = (_d = colSizing.maxWidth) != null ? _d : column == null ? void 0 : column.maxWidth) != null ? _e : columnMaxWidth;
11565
+ let size = colFlex != void 0 ? void 0 : (_f = colSizing.width) != null ? _f : columnDefaultWidth;
11566
+ if (!size && colFlex == void 0) {
11567
+ size = colMinWidth;
11568
+ }
11569
+ return {
11570
+ size,
11571
+ flex: colFlex,
11572
+ minSize: colMinWidth,
11573
+ maxSize: colMaxWidth
11574
+ };
11575
+ }
11264
11576
  const flexResult = computeFlex({
11265
11577
  availableSize: Math.max(bodySize.width - (viewportReservedWidth != null ? viewportReservedWidth : 0) - getScrollbarWidth(), 0),
11266
11578
  maxSize: columnMaxWidth,
11267
11579
  minSize: columnMinWidth,
11268
- items: visibleColumnOrder.map((colId) => {
11269
- var _a, _b, _c, _d, _e, _f;
11270
- const column = columns.get(colId);
11271
- const colType = getColumnComputedType(column, columnTypes);
11272
- const colTypeSizing = {
11273
- minWidth: colType == null ? void 0 : colType.minWidth,
11274
- maxWidth: colType == null ? void 0 : colType.maxWidth,
11275
- width: colType == null ? void 0 : colType.defaultWidth,
11276
- flex: colType == null ? void 0 : colType.defaultFlex
11277
- };
11278
- let colSizing = assignNonNull({
11279
- width: column == null ? void 0 : column.defaultWidth,
11280
- flex: column == null ? void 0 : column.defaultFlex,
11281
- minWidth: column == null ? void 0 : column.minWidth,
11282
- maxWidth: column == null ? void 0 : column.maxWidth
11283
- }, columnSizing[colId]);
11284
- if (colSizing.width != null) {
11285
- delete colTypeSizing.flex;
11286
- }
11287
- if (colSizing.flex != null) {
11288
- delete colTypeSizing.width;
11289
- }
11290
- colSizing = assignNonNull(colTypeSizing, colSizing);
11291
- const colFlex = (_a = colSizing.flex) != null ? _a : void 0;
11292
- const colMinWidth = (_c = (_b = colSizing.minWidth) != null ? _b : column == null ? void 0 : column.minWidth) != null ? _c : columnMinWidth;
11293
- const colMaxWidth = (_e = (_d = colSizing.maxWidth) != null ? _d : column == null ? void 0 : column.maxWidth) != null ? _e : columnMaxWidth;
11294
- let size = colFlex != void 0 ? void 0 : (_f = colSizing.width) != null ? _f : columnDefaultWidth;
11295
- if (!size && colFlex == void 0) {
11296
- size = colMinWidth;
11297
- }
11298
- return {
11299
- size,
11300
- flex: colFlex,
11301
- minSize: colMinWidth,
11302
- maxSize: colMaxWidth
11303
- };
11304
- })
11580
+ items: visibleColumnOrder.map(getColSize)
11305
11581
  });
11306
11582
  const { computedSizes, flexSizes, minSizes, maxSizes } = flexResult;
11307
11583
  const computedPinnedStartColumns = [];
11308
11584
  const computedPinnedEndColumns = [];
11309
11585
  const computedUnpinnedColumns = [];
11310
11586
  const computedVisibleColumns = [];
11587
+ computedVisibleColumns.length = visibleColumnOrder.length;
11311
11588
  const computedVisibleColumnsMap = new Map();
11589
+ const computedColumnsMap = new Map();
11312
11590
  let computedUnpinnedColumnsWidth = 0;
11313
11591
  let computedPinnedStartColumnsWidth = 0;
11314
11592
  let computedPinnedEndColumnsWidth = 0;
@@ -11317,7 +11595,7 @@ var getComputedVisibleColumns = ({
11317
11595
  let totalPinnedStartWidth = 0;
11318
11596
  let totalUnpinnedWidth = 0;
11319
11597
  let totalPinnedEndWidth = 0;
11320
- columnsArray.forEach((_c, i) => {
11598
+ visibleColumnsArray.forEach((_c, i) => {
11321
11599
  const id = visibleColumnOrder[i];
11322
11600
  const computedWidth = computedSizes[i];
11323
11601
  const pinned = computedPinnedArray[i] = getComputedPinned(id, columnPinning);
@@ -11330,39 +11608,56 @@ var getComputedVisibleColumns = ({
11330
11608
  }
11331
11609
  });
11332
11610
  const firstPinnedEndAbsoluteOffset = bodySize.width - totalPinnedEndWidth;
11333
- columnsArray.forEach((c, i) => {
11611
+ const groupColumns = [];
11612
+ const orderedColumns = new Map();
11613
+ visibleColumnOrder.forEach((id, index) => {
11614
+ const c = visibleColumnsArray[index];
11615
+ orderedColumns.set(id, c);
11616
+ });
11617
+ columns.forEach((c, key) => {
11618
+ if (!orderedColumns.has(key)) {
11619
+ orderedColumns.set(key, c);
11620
+ }
11621
+ });
11622
+ const fieldsToColumn = new Map();
11623
+ orderedColumns.forEach((c, id) => {
11334
11624
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
11335
- const id = visibleColumnOrder[i];
11336
- const nextColumnId = visibleColumnOrder[i + 1];
11625
+ let theComputedVisibleIndex = columnIdsToVisibleIndex.get(id);
11626
+ if (theComputedVisibleIndex == void 0) {
11627
+ theComputedVisibleIndex = -1;
11628
+ }
11629
+ const computedVisible = theComputedVisibleIndex != -1;
11630
+ const nextColumnId = visibleColumnOrder[theComputedVisibleIndex + 1];
11337
11631
  const colType = getColumnComputedType(c, columnTypes);
11338
- const computedVisibleIndex = i;
11632
+ const computedVisibleIndex = theComputedVisibleIndex;
11339
11633
  const sortingInfo = sortedMap[id] ? sortedMap[id] : c.field ? (_a = sortedMap[c.field]) != null ? _a : null : null;
11340
11634
  const computedSortInfo = (_b = sortingInfo == null ? void 0 : sortingInfo.sortInfo) != null ? _b : null;
11341
11635
  const computedSorted = !!computedSortInfo;
11342
11636
  const computedSortedAsc = computedSorted && computedSortInfo.dir === 1;
11343
11637
  const computedSortedDesc = computedSorted && !computedSortedAsc;
11344
11638
  const computedSortIndex = (_c = sortingInfo == null ? void 0 : sortingInfo.index) != null ? _c : -1;
11345
- const computedWidth = computedSizes[i];
11346
- const computedFlex = flexSizes[i] || null;
11347
- const computedMinWidth = minSizes[i] || 0;
11348
- const computedMaxWidth = maxSizes[i] || 1e4;
11349
- const computedPinned = getComputedPinned(id, columnPinning);
11350
- const computedLast = i === visibleColumnOrder.length - 1;
11639
+ const colSizeForNonVisibleColumn = computedVisible ? {} : getColSize(id);
11640
+ const computedWidth = computedVisible ? computedSizes[theComputedVisibleIndex] : colSizeForNonVisibleColumn.size || 0;
11641
+ const computedFlex = computedVisible ? flexSizes[theComputedVisibleIndex] || null : null;
11642
+ const computedMinWidth = computedVisible ? minSizes[theComputedVisibleIndex] || 0 : colSizeForNonVisibleColumn.minSize || 0;
11643
+ const computedMaxWidth = computedVisible ? maxSizes[theComputedVisibleIndex] || 1e4 : colSizeForNonVisibleColumn.maxSize || 1e4;
11644
+ const computedPinned = computedVisible ? getComputedPinned(id, columnPinning) : false;
11645
+ const computedLast = computedVisible ? theComputedVisibleIndex === visibleColumnOrder.length - 1 : false;
11351
11646
  let computedVisibleIndexInCategory = computedVisibleIndex;
11352
- const computedPinningOffset = computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth;
11647
+ const computedPinningOffset = computedVisible ? computedPinned === "start" ? computedPinnedStartColumnsWidth : computedPinned === "end" ? computedPinnedEndColumnsWidth : computedOffset - computedPinnedStartColumnsWidth : 0;
11353
11648
  if (computedPinned == "start") {
11354
- computedVisibleIndexInCategory = computedVisibleIndex;
11649
+ computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex : -1;
11355
11650
  } else if (computedPinned === "end") {
11356
- computedVisibleIndexInCategory = computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length);
11651
+ computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex - (computedPinnedStartColumns.length + computedUnpinnedColumns.length) : -1;
11357
11652
  } else {
11358
- computedVisibleIndexInCategory = computedVisibleIndex - computedPinnedStartColumns.length;
11653
+ computedVisibleIndexInCategory = computedVisible ? computedVisibleIndex - computedPinnedStartColumns.length : -1;
11359
11654
  }
11360
- const computedAbsoluteOffset = computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth;
11361
- const computedFirstInCategory = computedPinned !== prevPinned;
11362
- const computedLastInCategory = computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning);
11655
+ const computedAbsoluteOffset = computedVisible ? computedPinned === "start" || computedPinned === false ? computedOffset : firstPinnedEndAbsoluteOffset + computedPinnedEndColumnsWidth : -1;
11656
+ const computedFirstInCategory = computedVisible ? computedPinned !== prevPinned : false;
11657
+ const computedLastInCategory = computedVisible ? computedLast || computedPinned !== getComputedPinned(nextColumnId, columnPinning) : false;
11363
11658
  const cssEllipsis = (_e = (_d = c.cssEllipsis) != null ? _d : colType.cssEllipsis) != null ? _e : columnCssEllipsis;
11364
11659
  const headerCssEllipsis = (_j = (_i = (_h = (_g = (_f = c.headerCssEllipsis) != null ? _f : colType.cssEllipsis) != null ? _g : c.cssEllipsis) != null ? _h : colType.headerCssEllipsis) != null ? _i : columnHeaderCssEllipsis) != null ? _j : cssEllipsis;
11365
- const computedFilterValue = filterValueRecord[id] || c.field ? filterValueRecord[c.field] || null : null;
11660
+ const computedFilterValue = computedVisible ? filterValueRecord[id] || c.field ? filterValueRecord[c.field] || null : null : null;
11366
11661
  const computedFiltered = computedFilterValue != null;
11367
11662
  const computedFilterable = (_l = (_k = c.defaultFilterable) != null ? _k : colType.defaultFilterable) != null ? _l : true;
11368
11663
  const computedDataType = c.dataType || colType.dataType || (Array.isArray(c.type) ? c.type[0] : c.type) || "string";
@@ -11371,14 +11666,16 @@ var getComputedVisibleColumns = ({
11371
11666
  const field = (_m = c.field) != null ? _m : colType.field;
11372
11667
  const valueGetter = (_n = c.valueGetter) != null ? _n : colType.valueGetter;
11373
11668
  let sortableColumnOrType = (_o = c.sortable) != null ? _o : colType.sortable;
11374
- if (sortableColumnOrType == null) {
11669
+ if (sortableColumnOrType == null && !c.groupByField) {
11375
11670
  if (field == null && valueGetter == null) {
11376
11671
  sortableColumnOrType = false;
11377
11672
  }
11378
11673
  }
11379
11674
  let computedSortable = (_p = sortableColumnOrType != null ? sortableColumnOrType : sortable) != null ? _p : true;
11380
11675
  const result2 = __spreadProps(__spreadValues({
11676
+ colType,
11381
11677
  align: colType.align,
11678
+ computedVisible,
11382
11679
  verticalAlign: colType.verticalAlign,
11383
11680
  defaultHiddenWhenGroupedBy: colType.defaultHiddenWhenGroupedBy,
11384
11681
  valueGetter,
@@ -11421,16 +11718,17 @@ var getComputedVisibleColumns = ({
11421
11718
  computedDraggable: (_u = (_t = c.draggable) != null ? _t : draggableColumns) != null ? _u : true,
11422
11719
  computedFirstInCategory,
11423
11720
  computedLastInCategory,
11424
- computedFirst: i === 0,
11721
+ computedFirst: theComputedVisibleIndex === 0,
11425
11722
  computedLast,
11426
11723
  toggleSort: () => {
11427
11724
  const currentSortInfo = computedSortInfo;
11428
11725
  let newColumnSortInfo;
11726
+ const field2 = result2.groupByField ? result2.groupByField : c.field;
11429
11727
  if (!currentSortInfo) {
11430
11728
  newColumnSortInfo = {
11431
11729
  dir: 1,
11432
11730
  id,
11433
- field: c.field,
11731
+ field: field2,
11434
11732
  type: computedSortType
11435
11733
  };
11436
11734
  } else {
@@ -11442,8 +11740,8 @@ var getComputedVisibleColumns = ({
11442
11740
  });
11443
11741
  }
11444
11742
  }
11445
- if (c.field && newColumnSortInfo && !newColumnSortInfo.field) {
11446
- newColumnSortInfo.field = c.field;
11743
+ if (field2 && newColumnSortInfo && !newColumnSortInfo.field) {
11744
+ newColumnSortInfo.field = field2;
11447
11745
  }
11448
11746
  if (c.valueGetter && newColumnSortInfo && !newColumnSortInfo.valueGetter) {
11449
11747
  newColumnSortInfo.valueGetter = (data) => c.valueGetter({ data, field: c.field });
@@ -11470,22 +11768,34 @@ var getComputedVisibleColumns = ({
11470
11768
  id,
11471
11769
  header: (_x = (_w = (_v = c.header) != null ? _v : colType.header) != null ? _w : c.name) != null ? _x : c.field
11472
11770
  });
11473
- computedOffset += computedWidth;
11474
- computedVisibleColumnsMap.set(result2.id, result2);
11475
- computedVisibleColumns.push(result2);
11476
- if (computedPinned === "start") {
11477
- computedPinnedStartColumns.push(result2);
11478
- computedPinnedStartColumnsWidth += result2.computedWidth;
11479
- }
11480
- if (computedPinned === "end") {
11481
- computedPinnedEndColumns.push(result2);
11482
- computedPinnedEndColumnsWidth += result2.computedWidth;
11483
- }
11484
- if (!computedPinned) {
11485
- computedUnpinnedColumns.push(result2);
11486
- computedUnpinnedColumnsWidth += result2.computedWidth;
11487
- }
11488
- prevPinned = computedPinned;
11771
+ if (computedVisible) {
11772
+ computedOffset += computedWidth;
11773
+ computedVisibleColumnsMap.set(result2.id, result2);
11774
+ computedVisibleColumns[theComputedVisibleIndex] = result2;
11775
+ if (computedPinned === "start") {
11776
+ computedPinnedStartColumns.push(result2);
11777
+ computedPinnedStartColumnsWidth += result2.computedWidth;
11778
+ }
11779
+ if (computedPinned === "end") {
11780
+ computedPinnedEndColumns.push(result2);
11781
+ computedPinnedEndColumnsWidth += result2.computedWidth;
11782
+ }
11783
+ if (!computedPinned) {
11784
+ computedUnpinnedColumns.push(result2);
11785
+ computedUnpinnedColumnsWidth += result2.computedWidth;
11786
+ }
11787
+ prevPinned = computedPinned;
11788
+ }
11789
+ if (result2.groupByField) {
11790
+ groupColumns.push(result2);
11791
+ }
11792
+ computedColumnsMap.set(result2.id, result2);
11793
+ if (result2.field && !result2.groupByField && !fieldsToColumn.has(result2.field)) {
11794
+ fieldsToColumn.set(result2.field, result2);
11795
+ }
11796
+ });
11797
+ groupColumns.forEach((col) => {
11798
+ col.computedSortable = isGroupColumnSortable(col, computedColumnsMap);
11489
11799
  });
11490
11800
  const computedPinnedStartWidth = pinnedStartMaxWidth != null ? Math.min(pinnedStartMaxWidth, computedPinnedStartColumnsWidth) : computedPinnedStartColumnsWidth;
11491
11801
  const computedPinnedEndWidth = pinnedEndMaxWidth != null ? Math.min(pinnedEndMaxWidth, computedPinnedEndColumnsWidth) : computedPinnedEndColumnsWidth;
@@ -11501,12 +11811,14 @@ var getComputedVisibleColumns = ({
11501
11811
  computedPinnedEndOffset: computedPinnedStartColumnsWidth + computedUnpinnedColumnsWidth,
11502
11812
  computedUnpinnedColumns,
11503
11813
  computedVisibleColumns,
11814
+ computedColumnsMap,
11504
11815
  computedVisibleColumnsMap,
11505
11816
  computedPinnedEndWidth,
11506
11817
  computedPinnedStartWidth,
11507
11818
  renderSelectionCheckBox: computedVisibleColumns.reduce((bool, c) => {
11508
11819
  return bool || !!c.renderSelectionCheckBox;
11509
- }, false)
11820
+ }, false),
11821
+ fieldsToColumn
11510
11822
  };
11511
11823
  return result;
11512
11824
  };
@@ -11568,7 +11880,9 @@ var useComputedVisibleColumns = ({
11568
11880
  computedPinnedEndOffset,
11569
11881
  computedPinnedEndWidth,
11570
11882
  computedPinnedStartWidth,
11571
- renderSelectionCheckBox
11883
+ renderSelectionCheckBox,
11884
+ computedColumnsMap,
11885
+ fieldsToColumn
11572
11886
  } = (0, import_react41.useMemo)(() => {
11573
11887
  return getComputedVisibleColumns({
11574
11888
  columns,
@@ -11621,6 +11935,7 @@ var useComputedVisibleColumns = ({
11621
11935
  const result = {
11622
11936
  renderSelectionCheckBox,
11623
11937
  columns,
11938
+ computedColumnsMap,
11624
11939
  computedPinnedEndWidth,
11625
11940
  computedPinnedStartWidth,
11626
11941
  computedRemainingSpace,
@@ -11634,7 +11949,8 @@ var useComputedVisibleColumns = ({
11634
11949
  computedUnpinnedColumns,
11635
11950
  computedVisibleColumns,
11636
11951
  computedVisibleColumnsMap,
11637
- computedColumnOrder
11952
+ computedColumnOrder,
11953
+ fieldsToColumn
11638
11954
  };
11639
11955
  return result;
11640
11956
  };
@@ -11728,7 +12044,9 @@ function useComputed() {
11728
12044
  computedRemainingSpace,
11729
12045
  computedPinnedStartWidth,
11730
12046
  computedPinnedEndWidth,
11731
- renderSelectionCheckBox
12047
+ renderSelectionCheckBox,
12048
+ computedColumnsMap,
12049
+ fieldsToColumn
11732
12050
  } = useComputedVisibleColumns({
11733
12051
  columns,
11734
12052
  columnCssEllipsis: componentState.columnCssEllipsis,
@@ -11772,6 +12090,7 @@ function useComputed() {
11772
12090
  columnSize,
11773
12091
  rowspan,
11774
12092
  toggleGroupRow,
12093
+ computedColumnsMap,
11775
12094
  renderSelectionCheckBox,
11776
12095
  computedPinnedStartOverflow,
11777
12096
  computedPinnedEndOverflow,
@@ -11789,7 +12108,8 @@ function useComputed() {
11789
12108
  computedPinnedEndColumnsWidth,
11790
12109
  computedUnpinnedColumnsWidth,
11791
12110
  computedUnpinnedOffset,
11792
- computedPinnedEndOffset
12111
+ computedPinnedEndOffset,
12112
+ fieldsToColumn
11793
12113
  };
11794
12114
  }
11795
12115
 
@@ -11955,7 +12275,7 @@ var useLicense = (licenseKey = "") => {
11955
12275
  const valid = (0, import_react44.useMemo)(() => {
11956
12276
  let valid2 = isValidLicense(licenseKey, {
11957
12277
  publishedAt: 1624970570587,
11958
- version: "0.4.3"
12278
+ version: "0.4.6"
11959
12279
  });
11960
12280
  if (!licenseKey && !valid2 && isInsidePlayground) {
11961
12281
  return true;
@@ -12135,6 +12455,7 @@ function initSetupState2() {
12135
12455
  onRowHeightCSSVarChange: buildSubscriptionCallback(),
12136
12456
  onColumnHeaderHeightCSSVarChange: buildSubscriptionCallback(),
12137
12457
  cellClick: buildSubscriptionCallback(),
12458
+ cellMouseDown: buildSubscriptionCallback(),
12138
12459
  keyDown: buildSubscriptionCallback(),
12139
12460
  bodySize: {
12140
12461
  width: 0,
@@ -12149,6 +12470,7 @@ function initSetupState2() {
12149
12470
  focused: false,
12150
12471
  focusedWithin: false,
12151
12472
  columnsWhenGrouping: columnsGeneratedForGrouping,
12473
+ columnVisibilityForGrouping: {},
12152
12474
  pinnedStartScrollListener: new ScrollListener(),
12153
12475
  pinnedEndScrollListener: new ScrollListener(),
12154
12476
  columnsWhenInlineGroupRenderStrategy: void 0
@@ -12189,6 +12511,7 @@ var forwardProps4 = (setupState) => {
12189
12511
  filterEditors: (filterEditors) => __spreadValues(__spreadValues({}, defaultFilterEditors), filterEditors),
12190
12512
  viewportReservedWidth: (viewportReservedWidth) => viewportReservedWidth != null ? viewportReservedWidth : 0,
12191
12513
  resizableColumns: (resizableColumns) => resizableColumns != null ? resizableColumns : true,
12514
+ hideColumnWhenGrouped: (hideColumnWhenGrouped) => hideColumnWhenGrouped != null ? hideColumnWhenGrouped : false,
12192
12515
  columnMinWidth: (columnMinWidth) => columnMinWidth != null ? columnMinWidth : 30,
12193
12516
  columnMaxWidth: (columnMaxWidth) => columnMaxWidth != null ? columnMaxWidth : 5e3,
12194
12517
  columnDefaultWidth: (columnDefaultWidth) => columnDefaultWidth != null ? columnDefaultWidth : 200,
@@ -12265,6 +12588,7 @@ var mapPropsToState2 = (params) => {
12265
12588
  groupRenderStrategy,
12266
12589
  groupBy,
12267
12590
  computedColumns,
12591
+ initialColumns: props.columns,
12268
12592
  keyboardNavigation: (_a = props.keyboardNavigation) != null ? _a : state.activeCellIndex != null ? "cell" : state.activeRowIndex != null ? "row" : "cell",
12269
12593
  columnHeaderCssEllipsis: (_c = (_b = props.columnHeaderCssEllipsis) != null ? _b : props.columnCssEllipsis) != null ? _c : true,
12270
12594
  columnGroupsDepthsMap,
@@ -12286,11 +12610,10 @@ function onCellClick(context, event) {
12286
12610
  updateRowSelectionOnCellClick(context, event);
12287
12611
  }
12288
12612
  function updateRowSelectionOnCellClick(context, event) {
12289
- const { rowIndex, getDataSourceState, getComputed, dataSourceActions } = context;
12613
+ const { rowIndex, getDataSourceState, getComputed, dataSourceActions, api } = context;
12290
12614
  const { multiRowSelector, renderSelectionCheckBox } = getComputed();
12291
12615
  const dataSourceState = getDataSourceState();
12292
- const { selectionMode, groupBy } = dataSourceState;
12293
- let { rowSelection: rowSelectionState } = dataSourceState;
12616
+ const { selectionMode, groupBy, dataArray } = dataSourceState;
12294
12617
  if (groupBy.length) {
12295
12618
  return false;
12296
12619
  }
@@ -12298,6 +12621,7 @@ function updateRowSelectionOnCellClick(context, event) {
12298
12621
  if (renderSelectionCheckBox && !event.key) {
12299
12622
  return false;
12300
12623
  }
12624
+ let { rowSelection: rowSelectionState } = dataSourceState;
12301
12625
  rowSelectionState = new RowSelectionState(rowSelectionState, rowSelectionStateConfigGetter(getDataSourceState));
12302
12626
  multiRowSelector.rowSelectionState = rowSelectionState;
12303
12627
  if (rowSelectionState && typeof rowSelectionState === "object") {
@@ -12312,6 +12636,12 @@ function updateRowSelectionOnCellClick(context, event) {
12312
12636
  return true;
12313
12637
  }
12314
12638
  } else if (selectionMode === "single-row") {
12639
+ const id = dataArray[rowIndex].id;
12640
+ if (event.metaKey || event.ctrlKey) {
12641
+ api.selectionApi.toggleRowSelection(id);
12642
+ } else {
12643
+ api.selectionApi.selectRow(id);
12644
+ }
12315
12645
  }
12316
12646
  return false;
12317
12647
  }