@infinite-table/infinite-react 0.4.2 → 0.4.5

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