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