trotl-table 1.0.12 → 1.0.13

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/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import * as React$1 from 'react';
2
2
  import React__default, { cloneElement, useEffect, useState, useCallback, useRef, useMemo } from 'react';
3
3
  import { DndProvider, useDrop, useDrag } from 'react-dnd';
4
4
  import { HTML5Backend } from 'react-dnd-html5-backend';
@@ -370,7 +370,7 @@ var ArrowKeyStepper = /*#__PURE__*/function (_React$PureComponent) {
370
370
  var _this$_getScrollState3 = this._getScrollState(),
371
371
  scrollToColumn = _this$_getScrollState3.scrollToColumn,
372
372
  scrollToRow = _this$_getScrollState3.scrollToRow;
373
- return /*#__PURE__*/React.createElement("div", {
373
+ return /*#__PURE__*/React$1.createElement("div", {
374
374
  className: className,
375
375
  onKeyDown: this._onKeyDown
376
376
  }, children({
@@ -424,7 +424,7 @@ var ArrowKeyStepper = /*#__PURE__*/function (_React$PureComponent) {
424
424
  return {};
425
425
  }
426
426
  }]);
427
- }(React.PureComponent);
427
+ }(React$1.PureComponent);
428
428
  _defineProperty(ArrowKeyStepper, "defaultProps", {
429
429
  disabled: false,
430
430
  isControlled: false,
@@ -788,14 +788,14 @@ var AutoSizer = /*#__PURE__*/function (_React$Component) {
788
788
  }
789
789
  */
790
790
 
791
- return /*#__PURE__*/React.createElement("div", {
791
+ return /*#__PURE__*/React$1.createElement("div", {
792
792
  className: className,
793
793
  ref: this._setRef,
794
794
  style: _objectSpread$6(_objectSpread$6({}, outerStyle), style)
795
795
  }, children(childParams));
796
796
  }
797
797
  }]);
798
- }(React.Component);
798
+ }(React$1.Component);
799
799
  _defineProperty(AutoSizer, "defaultProps", {
800
800
  onResize: function onResize() {},
801
801
  disableHeight: false,
@@ -834,7 +834,7 @@ var CellMeasurer = /*#__PURE__*/function (_React$PureComponent) {
834
834
  args[_key] = arguments[_key];
835
835
  }
836
836
  _this = _callSuper$c(this, CellMeasurer, [].concat(args));
837
- _defineProperty(_this, "_child", /*#__PURE__*/React.createRef());
837
+ _defineProperty(_this, "_child", /*#__PURE__*/React$1.createRef());
838
838
  _defineProperty(_this, "_measure", function () {
839
839
  var _this$props = _this.props,
840
840
  cache = _this$props.cache,
@@ -975,7 +975,7 @@ var CellMeasurer = /*#__PURE__*/function (_React$PureComponent) {
975
975
  }
976
976
  }
977
977
  }]);
978
- }(React.PureComponent); // Used for DEV mode warning check
978
+ }(React$1.PureComponent); // Used for DEV mode warning check
979
979
  _defineProperty(CellMeasurer, "__internalCellMeasurerFlag", false);
980
980
  if (process.env.NODE_ENV !== 'production') {
981
981
  CellMeasurer.__internalCellMeasurerFlag = true;
@@ -2557,7 +2557,7 @@ var CollectionView = /*#__PURE__*/function (_React$PureComponent) {
2557
2557
  // This was originally reported via clauderic/react-infinite-calendar/issues/23
2558
2558
  collectionStyle.overflowX = totalWidth + verticalScrollBarSize <= width ? 'hidden' : 'auto';
2559
2559
  collectionStyle.overflowY = totalHeight + horizontalScrollBarSize <= height ? 'hidden' : 'auto';
2560
- return /*#__PURE__*/React.createElement("div", {
2560
+ return /*#__PURE__*/React$1.createElement("div", {
2561
2561
  ref: this._setScrollingContainerRef,
2562
2562
  "aria-label": this.props['aria-label'],
2563
2563
  className: clsx('ReactVirtualized__Collection', className),
@@ -2566,7 +2566,7 @@ var CollectionView = /*#__PURE__*/function (_React$PureComponent) {
2566
2566
  role: "grid",
2567
2567
  style: _objectSpread$5(_objectSpread$5({}, collectionStyle), style),
2568
2568
  tabIndex: 0
2569
- }, cellCount > 0 && /*#__PURE__*/React.createElement("div", {
2569
+ }, cellCount > 0 && /*#__PURE__*/React$1.createElement("div", {
2570
2570
  className: "ReactVirtualized__Collection__innerScrollContainer",
2571
2571
  style: {
2572
2572
  height: totalHeight,
@@ -2670,7 +2670,7 @@ var CollectionView = /*#__PURE__*/function (_React$PureComponent) {
2670
2670
  return null;
2671
2671
  }
2672
2672
  }]);
2673
- }(React.PureComponent);
2673
+ }(React$1.PureComponent);
2674
2674
  _defineProperty(CollectionView, "defaultProps", {
2675
2675
  'aria-label': 'grid',
2676
2676
  horizontalOverscanSize: 0,
@@ -3046,7 +3046,7 @@ var Collection = /*#__PURE__*/function (_React$PureComponent) {
3046
3046
  key: "render",
3047
3047
  value: function render() {
3048
3048
  var props = _extends({}, (_objectDestructuringEmpty(this.props), this.props));
3049
- return /*#__PURE__*/React.createElement(CollectionView, _extends({
3049
+ return /*#__PURE__*/React$1.createElement(CollectionView, _extends({
3050
3050
  cellLayoutManager: this,
3051
3051
  isScrollingChange: this._isScrollingChange,
3052
3052
  ref: this._setCollectionViewRef
@@ -3168,7 +3168,7 @@ var Collection = /*#__PURE__*/function (_React$PureComponent) {
3168
3168
  this._collectionView = ref;
3169
3169
  }
3170
3170
  }]);
3171
- }(React.PureComponent);
3171
+ }(React$1.PureComponent);
3172
3172
  _defineProperty(Collection, "defaultProps", {
3173
3173
  'aria-label': 'grid',
3174
3174
  cellGroupRenderer: defaultCellGroupRenderer
@@ -3309,7 +3309,7 @@ var ColumnSizer = /*#__PURE__*/function (_React$PureComponent) {
3309
3309
  }
3310
3310
  }
3311
3311
  }]);
3312
- }(React.PureComponent);
3312
+ }(React$1.PureComponent);
3313
3313
  ColumnSizer.propTypes = process.env.NODE_ENV !== "production" ? {
3314
3314
  /**
3315
3315
  * Function responsible for rendering a virtualized Grid.
@@ -5013,7 +5013,7 @@ var Grid = /*#__PURE__*/function (_React$PureComponent) {
5013
5013
  gridStyle.overflowY = totalRowsHeight + horizontalScrollBarSize <= height ? 'hidden' : 'auto';
5014
5014
  var childrenToDisplay = this._childrenToDisplay;
5015
5015
  var showNoContentRenderer = childrenToDisplay.length === 0 && height > 0 && width > 0;
5016
- return /*#__PURE__*/React.createElement("div", _extends({
5016
+ return /*#__PURE__*/React$1.createElement("div", _extends({
5017
5017
  ref: this._setScrollingContainerRef
5018
5018
  }, containerProps, {
5019
5019
  "aria-label": this.props['aria-label'],
@@ -5024,7 +5024,7 @@ var Grid = /*#__PURE__*/function (_React$PureComponent) {
5024
5024
  role: role,
5025
5025
  style: _objectSpread$4(_objectSpread$4({}, gridStyle), style),
5026
5026
  tabIndex: tabIndex
5027
- }), childrenToDisplay.length > 0 && /*#__PURE__*/React.createElement("div", {
5027
+ }), childrenToDisplay.length > 0 && /*#__PURE__*/React$1.createElement("div", {
5028
5028
  className: "ReactVirtualized__Grid__innerScrollContainer",
5029
5029
  role: containerRole,
5030
5030
  style: _objectSpread$4({
@@ -5558,7 +5558,7 @@ var Grid = /*#__PURE__*/function (_React$PureComponent) {
5558
5558
  return {};
5559
5559
  }
5560
5560
  }]);
5561
- }(React.PureComponent);
5561
+ }(React$1.PureComponent);
5562
5562
  _defineProperty(Grid, "defaultProps", {
5563
5563
  'aria-label': 'grid',
5564
5564
  'aria-readonly': true,
@@ -5759,7 +5759,7 @@ var InfiniteLoader = /*#__PURE__*/function (_React$PureComponent) {
5759
5759
  this._registeredChild = registeredChild;
5760
5760
  }
5761
5761
  }]);
5762
- }(React.PureComponent);
5762
+ }(React$1.PureComponent);
5763
5763
  /**
5764
5764
  * Determines if the specified start/stop range is visible based on the most recently rendered range.
5765
5765
  */
@@ -6164,7 +6164,7 @@ var List = /*#__PURE__*/function (_React$PureComponent) {
6164
6164
  scrollToIndex = _this$props.scrollToIndex,
6165
6165
  width = _this$props.width;
6166
6166
  var classNames = clsx('ReactVirtualized__List', className);
6167
- return /*#__PURE__*/React.createElement(Grid, _extends({}, this.props, {
6167
+ return /*#__PURE__*/React$1.createElement(Grid, _extends({}, this.props, {
6168
6168
  autoContainerWidth: true,
6169
6169
  cellRenderer: this._cellRenderer,
6170
6170
  className: classNames,
@@ -6178,7 +6178,7 @@ var List = /*#__PURE__*/function (_React$PureComponent) {
6178
6178
  }));
6179
6179
  }
6180
6180
  }]);
6181
- }(React.PureComponent);
6181
+ }(React$1.PureComponent);
6182
6182
  _defineProperty(List, "defaultProps", {
6183
6183
  autoHeight: false,
6184
6184
  estimatedRowSize: 30,
@@ -7098,7 +7098,7 @@ var Masonry = /*#__PURE__*/function (_React$PureComponent) {
7098
7098
  }
7099
7099
  this._startIndex = startIndex;
7100
7100
  this._stopIndex = stopIndex;
7101
- return /*#__PURE__*/React.createElement("div", {
7101
+ return /*#__PURE__*/React$1.createElement("div", {
7102
7102
  ref: this._setScrollingContainerRef,
7103
7103
  "aria-label": this.props['aria-label'],
7104
7104
  className: clsx('ReactVirtualized__Masonry', className),
@@ -7117,7 +7117,7 @@ var Masonry = /*#__PURE__*/function (_React$PureComponent) {
7117
7117
  willChange: 'transform'
7118
7118
  }, style),
7119
7119
  tabIndex: tabIndex
7120
- }, /*#__PURE__*/React.createElement("div", {
7120
+ }, /*#__PURE__*/React$1.createElement("div", {
7121
7121
  className: "ReactVirtualized__Masonry__innerScrollContainer",
7122
7122
  style: {
7123
7123
  width: '100%',
@@ -7217,7 +7217,7 @@ var Masonry = /*#__PURE__*/function (_React$PureComponent) {
7217
7217
  return null;
7218
7218
  }
7219
7219
  }]);
7220
- }(React.PureComponent);
7220
+ }(React$1.PureComponent);
7221
7221
  _defineProperty(Masonry, "defaultProps", {
7222
7222
  autoHeight: false,
7223
7223
  keyMapper: identity,
@@ -7405,7 +7405,7 @@ var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
7405
7405
  fixedRowCount = _this$props.fixedRowCount,
7406
7406
  rowCount = _this$props.rowCount;
7407
7407
  if (rowIndex === rowCount - fixedRowCount) {
7408
- return /*#__PURE__*/React.createElement("div", {
7408
+ return /*#__PURE__*/React$1.createElement("div", {
7409
7409
  key: rest.key,
7410
7410
  style: _objectSpread$2(_objectSpread$2({}, rest.style), {}, {
7411
7411
  height: SCROLLBAR_SIZE_BUFFER
@@ -7440,7 +7440,7 @@ var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
7440
7440
  columnCount = _this$props3.columnCount,
7441
7441
  fixedColumnCount = _this$props3.fixedColumnCount;
7442
7442
  if (columnIndex === columnCount - fixedColumnCount) {
7443
- return /*#__PURE__*/React.createElement("div", {
7443
+ return /*#__PURE__*/React$1.createElement("div", {
7444
7444
  key: rest.key,
7445
7445
  style: _objectSpread$2(_objectSpread$2({}, rest.style), {}, {
7446
7446
  width: SCROLLBAR_SIZE_BUFFER
@@ -7689,14 +7689,14 @@ var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
7689
7689
  var _this$state4 = this.state,
7690
7690
  scrollLeft = _this$state4.scrollLeft,
7691
7691
  scrollTop = _this$state4.scrollTop;
7692
- return /*#__PURE__*/React.createElement("div", {
7692
+ return /*#__PURE__*/React$1.createElement("div", {
7693
7693
  style: this._containerOuterStyle
7694
- }, /*#__PURE__*/React.createElement("div", {
7694
+ }, /*#__PURE__*/React$1.createElement("div", {
7695
7695
  style: this._containerTopStyle
7696
7696
  }, this._renderTopLeftGrid(rest), this._renderTopRightGrid(_objectSpread$2(_objectSpread$2({}, rest), {}, {
7697
7697
  onScroll: onScroll,
7698
7698
  scrollLeft: scrollLeft
7699
- }))), /*#__PURE__*/React.createElement("div", {
7699
+ }))), /*#__PURE__*/React$1.createElement("div", {
7700
7700
  style: this._containerBottomStyle
7701
7701
  }, this._renderBottomLeftGrid(_objectSpread$2(_objectSpread$2({}, rest), {}, {
7702
7702
  onScroll: onScroll,
@@ -7902,7 +7902,7 @@ var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
7902
7902
  width = this._getLeftGridWidth(props),
7903
7903
  scrollbarSize = this.state.showVerticalScrollbar ? this.state.scrollbarSize : 0,
7904
7904
  gridWidth = hideBottomLeftGridScrollbar ? width + scrollbarSize : width;
7905
- var bottomLeftGrid = /*#__PURE__*/React.createElement(Grid, _extends({}, props, {
7905
+ var bottomLeftGrid = /*#__PURE__*/React$1.createElement(Grid, _extends({}, props, {
7906
7906
  cellRenderer: this._cellRendererBottomLeftGrid,
7907
7907
  className: this.props.classNameBottomLeftGrid,
7908
7908
  columnCount: fixedColumnCount,
@@ -7917,7 +7917,7 @@ var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
7917
7917
  width: gridWidth
7918
7918
  }));
7919
7919
  if (hideBottomLeftGridScrollbar) {
7920
- return /*#__PURE__*/React.createElement("div", {
7920
+ return /*#__PURE__*/React$1.createElement("div", {
7921
7921
  className: "BottomLeftGrid_ScrollWrapper",
7922
7922
  style: _objectSpread$2(_objectSpread$2({}, this._bottomLeftGridStyle), {}, {
7923
7923
  height: height,
@@ -7937,7 +7937,7 @@ var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
7937
7937
  rowCount = props.rowCount,
7938
7938
  scrollToColumn = props.scrollToColumn,
7939
7939
  scrollToRow = props.scrollToRow;
7940
- return /*#__PURE__*/React.createElement(Grid, _extends({}, props, {
7940
+ return /*#__PURE__*/React$1.createElement(Grid, _extends({}, props, {
7941
7941
  cellRenderer: this._cellRendererBottomRightGrid,
7942
7942
  className: this.props.classNameBottomRightGrid,
7943
7943
  columnCount: Math.max(0, columnCount - fixedColumnCount),
@@ -7963,7 +7963,7 @@ var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
7963
7963
  if (!fixedColumnCount || !fixedRowCount) {
7964
7964
  return null;
7965
7965
  }
7966
- return /*#__PURE__*/React.createElement(Grid, _extends({}, props, {
7966
+ return /*#__PURE__*/React$1.createElement(Grid, _extends({}, props, {
7967
7967
  className: this.props.classNameTopLeftGrid,
7968
7968
  columnCount: fixedColumnCount,
7969
7969
  height: this._getTopGridHeight(props),
@@ -8001,7 +8001,7 @@ var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
8001
8001
  left: 0
8002
8002
  });
8003
8003
  }
8004
- var topRightGrid = /*#__PURE__*/React.createElement(Grid, _extends({}, props, {
8004
+ var topRightGrid = /*#__PURE__*/React$1.createElement(Grid, _extends({}, props, {
8005
8005
  cellRenderer: this._cellRendererTopRightGrid,
8006
8006
  className: this.props.classNameTopRightGrid,
8007
8007
  columnCount: Math.max(0, columnCount - fixedColumnCount) + additionalColumnCount,
@@ -8017,7 +8017,7 @@ var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
8017
8017
  width: width
8018
8018
  }));
8019
8019
  if (hideTopRightGridScrollbar) {
8020
- return /*#__PURE__*/React.createElement("div", {
8020
+ return /*#__PURE__*/React$1.createElement("div", {
8021
8021
  className: "TopRightGrid_ScrollWrapper",
8022
8022
  style: _objectSpread$2(_objectSpread$2({}, this._topRightGridStyle), {}, {
8023
8023
  height: height,
@@ -8040,7 +8040,7 @@ var MultiGrid = /*#__PURE__*/function (_React$PureComponent) {
8040
8040
  return null;
8041
8041
  }
8042
8042
  }]);
8043
- }(React.PureComponent);
8043
+ }(React$1.PureComponent);
8044
8044
  _defineProperty(MultiGrid, "defaultProps", {
8045
8045
  classNameBottomLeftGrid: '',
8046
8046
  classNameBottomRightGrid: '',
@@ -8143,7 +8143,7 @@ var ScrollSync = /*#__PURE__*/function (_React$PureComponent) {
8143
8143
  });
8144
8144
  }
8145
8145
  }]);
8146
- }(React.PureComponent);
8146
+ }(React$1.PureComponent);
8147
8147
  ScrollSync.propTypes = process.env.NODE_ENV !== "production" ? {
8148
8148
  /**
8149
8149
  * Function responsible for rendering 2 or more virtualized components.
@@ -8188,7 +8188,7 @@ function defaultHeaderRowRenderer(_ref /*:: */) {
8188
8188
  var className = _ref /*:: */.className,
8189
8189
  columns = _ref /*:: */.columns,
8190
8190
  style = _ref /*:: */.style;
8191
- return /*#__PURE__*/React.createElement("div", {
8191
+ return /*#__PURE__*/React$1.createElement("div", {
8192
8192
  className: className,
8193
8193
  role: "row",
8194
8194
  style: style
@@ -8217,16 +8217,16 @@ function SortIndicator(_ref) {
8217
8217
  'ReactVirtualized__Table__sortableHeaderIcon--ASC': sortDirection === SortDirection.ASC,
8218
8218
  'ReactVirtualized__Table__sortableHeaderIcon--DESC': sortDirection === SortDirection.DESC
8219
8219
  });
8220
- return /*#__PURE__*/React.createElement("svg", {
8220
+ return /*#__PURE__*/React$1.createElement("svg", {
8221
8221
  className: classNames,
8222
8222
  width: 18,
8223
8223
  height: 18,
8224
8224
  viewBox: "0 0 24 24"
8225
- }, sortDirection === SortDirection.ASC ? /*#__PURE__*/React.createElement("path", {
8225
+ }, sortDirection === SortDirection.ASC ? /*#__PURE__*/React$1.createElement("path", {
8226
8226
  d: "M7 14l5-5 5 5z"
8227
- }) : /*#__PURE__*/React.createElement("path", {
8227
+ }) : /*#__PURE__*/React$1.createElement("path", {
8228
8228
  d: "M7 10l5 5 5-5z"
8229
- }), /*#__PURE__*/React.createElement("path", {
8229
+ }), /*#__PURE__*/React$1.createElement("path", {
8230
8230
  d: "M0 0h24v24H0z",
8231
8231
  fill: "none"
8232
8232
  }));
@@ -8245,13 +8245,13 @@ function defaultHeaderRenderer(_ref /*:: */) {
8245
8245
  sortBy = _ref /*:: */.sortBy,
8246
8246
  sortDirection = _ref /*:: */.sortDirection;
8247
8247
  var showSortIndicator = sortBy === dataKey;
8248
- var children = [/*#__PURE__*/React.createElement("span", {
8248
+ var children = [/*#__PURE__*/React$1.createElement("span", {
8249
8249
  className: "ReactVirtualized__Table__headerTruncatedText",
8250
8250
  key: "label",
8251
8251
  title: typeof label === 'string' ? label : null
8252
8252
  }, label)];
8253
8253
  if (showSortIndicator) {
8254
- children.push(/*#__PURE__*/React.createElement(SortIndicator, {
8254
+ children.push(/*#__PURE__*/React$1.createElement(SortIndicator, {
8255
8255
  key: "SortIndicator",
8256
8256
  sortDirection: sortDirection
8257
8257
  }));
@@ -8327,7 +8327,7 @@ function defaultRowRenderer(_ref /*:: */) {
8327
8327
  };
8328
8328
  }
8329
8329
  }
8330
- return /*#__PURE__*/React.createElement("div", _extends({}, a11yProps, {
8330
+ return /*#__PURE__*/React$1.createElement("div", _extends({}, a11yProps, {
8331
8331
  className: className,
8332
8332
  key: key,
8333
8333
  role: "row",
@@ -8348,7 +8348,7 @@ var Column = /*#__PURE__*/function (_React$Component) {
8348
8348
  }
8349
8349
  _inherits(Column, _React$Component);
8350
8350
  return _createClass(Column);
8351
- }(React.Component);
8351
+ }(React$1.Component);
8352
8352
  _defineProperty(Column, "defaultProps", {
8353
8353
  cellDataGetter: defaultCellDataGetter,
8354
8354
  cellRenderer: defaultCellRenderer,
@@ -8587,7 +8587,7 @@ var Table$1 = /*#__PURE__*/function (_React$PureComponent) {
8587
8587
 
8588
8588
  // Precompute and cache column styles before rendering rows and columns to speed things up
8589
8589
  this._cachedColumnStyles = [];
8590
- React.Children.toArray(children).forEach(function (column, index) {
8590
+ React$1.Children.toArray(children).forEach(function (column, index) {
8591
8591
  var flexStyles = _this2._getFlexStyleForColumn(column, column.props.style || Column.defaultProps.style);
8592
8592
  _this2._cachedColumnStyles[index] = _objectSpread$1({
8593
8593
  overflow: 'hidden'
@@ -8597,10 +8597,10 @@ var Table$1 = /*#__PURE__*/function (_React$PureComponent) {
8597
8597
  // Note that we specify :rowCount, :scrollbarWidth, :sortBy, and :sortDirection as properties on Grid even though these have nothing to do with Grid.
8598
8598
  // This is done because Grid is a pure component and won't update unless its properties or state has changed.
8599
8599
  // Any property that should trigger a re-render of Grid then is specified here to avoid a stale display.
8600
- return /*#__PURE__*/React.createElement("div", {
8600
+ return /*#__PURE__*/React$1.createElement("div", {
8601
8601
  "aria-label": this.props['aria-label'],
8602
8602
  "aria-labelledby": this.props['aria-labelledby'],
8603
- "aria-colcount": React.Children.toArray(children).length,
8603
+ "aria-colcount": React$1.Children.toArray(children).length,
8604
8604
  "aria-rowcount": this.props.rowCount,
8605
8605
  className: clsx('ReactVirtualized__Table', className),
8606
8606
  id: id,
@@ -8615,7 +8615,7 @@ var Table$1 = /*#__PURE__*/function (_React$PureComponent) {
8615
8615
  paddingRight: scrollbarWidth,
8616
8616
  width: width
8617
8617
  }, rowStyleObject)
8618
- }), /*#__PURE__*/React.createElement(Grid, _extends({}, this.props, {
8618
+ }), /*#__PURE__*/React$1.createElement(Grid, _extends({}, this.props, {
8619
8619
  elementRef: this._setGridElementRef,
8620
8620
  "aria-readonly": null,
8621
8621
  autoContainerWidth: true,
@@ -8682,7 +8682,7 @@ var Table$1 = /*#__PURE__*/function (_React$PureComponent) {
8682
8682
  // Avoid using object-spread syntax with multiple objects here,
8683
8683
  // Since it results in an extra method call to 'babel-runtime/helpers/extends'
8684
8684
  // See PR https://github.com/bvaughn/react-virtualized/pull/942
8685
- return /*#__PURE__*/React.createElement("div", {
8685
+ return /*#__PURE__*/React$1.createElement("div", {
8686
8686
  "aria-colindex": columnIndex + 1,
8687
8687
  "aria-describedby": id,
8688
8688
  className: clsx('ReactVirtualized__Table__rowColumn', className),
@@ -8765,7 +8765,7 @@ var Table$1 = /*#__PURE__*/function (_React$PureComponent) {
8765
8765
  // Avoid using object-spread syntax with multiple objects here,
8766
8766
  // Since it results in an extra method call to 'babel-runtime/helpers/extends'
8767
8767
  // See PR https://github.com/bvaughn/react-virtualized/pull/942
8768
- return /*#__PURE__*/React.createElement("div", {
8768
+ return /*#__PURE__*/React$1.createElement("div", {
8769
8769
  "aria-label": headerAriaLabel,
8770
8770
  "aria-sort": headerAriaSort,
8771
8771
  className: classNames,
@@ -8808,7 +8808,7 @@ var Table$1 = /*#__PURE__*/function (_React$PureComponent) {
8808
8808
  var rowData = rowGetter({
8809
8809
  index: index
8810
8810
  });
8811
- var columns = React.Children.toArray(children).map(function (column, columnIndex) {
8811
+ var columns = React$1.Children.toArray(children).map(function (column, columnIndex) {
8812
8812
  return _this3._createColumn({
8813
8813
  column: column,
8814
8814
  columnIndex: columnIndex,
@@ -8869,7 +8869,7 @@ var Table$1 = /*#__PURE__*/function (_React$PureComponent) {
8869
8869
  var _this$props4 = this.props,
8870
8870
  children = _this$props4.children,
8871
8871
  disableHeader = _this$props4.disableHeader;
8872
- var items = disableHeader ? [] : React.Children.toArray(children);
8872
+ var items = disableHeader ? [] : React$1.Children.toArray(children);
8873
8873
  return items.map(function (column, index) {
8874
8874
  return _this4._createHeader({
8875
8875
  column: column,
@@ -8932,7 +8932,7 @@ var Table$1 = /*#__PURE__*/function (_React$PureComponent) {
8932
8932
  });
8933
8933
  }
8934
8934
  }]);
8935
- }(React.PureComponent);
8935
+ }(React$1.PureComponent);
8936
8936
  _defineProperty(Table$1, "defaultProps", {
8937
8937
  disableHeader: false,
8938
8938
  estimatedRowSize: 30,
@@ -8968,7 +8968,7 @@ Table$1.propTypes = process.env.NODE_ENV !== "production" ? {
8968
8968
  autoHeight: PropTypes.bool,
8969
8969
  /** One or more Columns describing the data displayed in this row */
8970
8970
  children: function children(props) {
8971
- var children = React.Children.toArray(props.children);
8971
+ var children = React$1.Children.toArray(props.children);
8972
8972
  for (var i = 0; i < children.length; i++) {
8973
8973
  var childType = children[i].type;
8974
8974
  if (childType !== Column && !(childType.prototype instanceof Column)) {
@@ -9347,7 +9347,7 @@ var WindowScroller = /*#__PURE__*/function (_React$PureComponent) {
9347
9347
  _defineProperty(_this, "_positionFromLeft", 0);
9348
9348
  _defineProperty(_this, "_detectElementResize", void 0);
9349
9349
  _defineProperty(_this, "_child", void 0);
9350
- _defineProperty(_this, "_windowScrollerRef", /*#__PURE__*/React.createRef());
9350
+ _defineProperty(_this, "_windowScrollerRef", /*#__PURE__*/React$1.createRef());
9351
9351
  _defineProperty(_this, "state", _objectSpread(_objectSpread({}, getDimensions(_this.props.scrollElement, _this.props)), {}, {
9352
9352
  isScrolling: false,
9353
9353
  scrollLeft: 0,
@@ -9497,7 +9497,7 @@ var WindowScroller = /*#__PURE__*/function (_React$PureComponent) {
9497
9497
  scrollLeft = _this$state2.scrollLeft,
9498
9498
  height = _this$state2.height,
9499
9499
  width = _this$state2.width;
9500
- return /*#__PURE__*/React.createElement('div', {
9500
+ return /*#__PURE__*/React$1.createElement('div', {
9501
9501
  ref: this._windowScrollerRef
9502
9502
  }, children({
9503
9503
  onChildScroll: this._onChildScroll,
@@ -9510,7 +9510,7 @@ var WindowScroller = /*#__PURE__*/function (_React$PureComponent) {
9510
9510
  }));
9511
9511
  }
9512
9512
  }]);
9513
- }(React.PureComponent);
9513
+ }(React$1.PureComponent);
9514
9514
  _defineProperty(WindowScroller, "defaultProps", {
9515
9515
  onResize: function onResize() {},
9516
9516
  onScroll: function onScroll() {},
@@ -9674,7 +9674,8 @@ function TableInner({
9674
9674
  enableMultiSelect = false,
9675
9675
  enableExternalRowDrop = false,
9676
9676
  onExternalRowDrop = () => {},
9677
- useExternalDndContext = false
9677
+ useExternalDndContext = false,
9678
+ customColumns = []
9678
9679
  }) {
9679
9680
  // Local selection & sorting state (removed TableContext dependency)
9680
9681
  const [selectedRows, setSelectedRows] = useState([]);
@@ -10128,6 +10129,20 @@ function TableInner({
10128
10129
  }
10129
10130
  const row = item.row;
10130
10131
  const visualIndex = tableDataFlat.slice(0, index).filter(i => i.type === "row").length + 1;
10132
+
10133
+ // Compose columns + custom columns
10134
+ const allColumns = [...columns];
10135
+ // Insert custom columns at specified places
10136
+ if (Array.isArray(customColumns)) {
10137
+ customColumns.forEach(col => {
10138
+ if (typeof col.place === 'number') {
10139
+ allColumns.splice(col.place, 0, {
10140
+ ...col,
10141
+ isCustom: true
10142
+ });
10143
+ }
10144
+ });
10145
+ }
10131
10146
  const content = /*#__PURE__*/React__default.createElement("div", {
10132
10147
  key: key,
10133
10148
  style: style,
@@ -10140,10 +10155,22 @@ function TableInner({
10140
10155
  onChange: () => toggleRowSelection(row.id)
10141
10156
  })), showKey && /*#__PURE__*/React__default.createElement("div", {
10142
10157
  className: "table-cell key-cell"
10143
- }, visualIndex), columns.map((col, i) => /*#__PURE__*/React__default.createElement("div", {
10144
- key: i,
10145
- className: "table-cell"
10146
- }, renderCell(row[col.accessor], col.accessor))), showActions && /*#__PURE__*/React__default.createElement("div", {
10158
+ }, visualIndex), allColumns.map((col, i) => {
10159
+ let cellStyle = col.isCustom && col.style ? {
10160
+ ...col.style
10161
+ } : undefined;
10162
+ if (col.isCustom && col.style && col.style.width) {
10163
+ cellStyle = cellStyle || {};
10164
+ cellStyle.minWidth = col.style.width;
10165
+ cellStyle.maxWidth = col.style.width;
10166
+ cellStyle.width = col.style.width;
10167
+ }
10168
+ return /*#__PURE__*/React__default.createElement("div", {
10169
+ key: i,
10170
+ className: "table-cell",
10171
+ style: cellStyle
10172
+ }, col.isCustom ? typeof col.render === 'function' ? col.render(row, i) : col.render : renderCell(row[col.accessor], col.accessor, row));
10173
+ }), showActions && /*#__PURE__*/React__default.createElement("div", {
10147
10174
  className: "table-cell action-cell"
10148
10175
  }, showView && /*#__PURE__*/React__default.createElement("button", {
10149
10176
  className: "action-btn-table",
@@ -10180,7 +10207,7 @@ function TableInner({
10180
10207
  }, content);
10181
10208
  }
10182
10209
  return content;
10183
- }, [tableDataFlat, columns, selectedRows, toggleRowSelection, groupRowsById, renderCell, showActions, showDelete, showEdit, showKey, showView, viewCallback, editCallback, enableDragRow, moveRow, enableMultiSelect, rowHeight, tableId]);
10210
+ }, [tableDataFlat, columns, selectedRows, toggleRowSelection, groupRowsById, renderCell, showActions, showDelete, showEdit, showKey, showView, viewCallback, editCallback, enableDragRow, moveRow, enableMultiSelect, rowHeight, tableId, customColumns]);
10184
10211
  const rowHeightGetter = ({
10185
10212
  index
10186
10213
  }) => tableDataFlat[index]?.type === "group" ? groupHeaderHeight : rowHeight;
@@ -10205,6 +10232,19 @@ function TableInner({
10205
10232
  externalDrop(node);
10206
10233
  }
10207
10234
  }, [useExternalDndContext, enableExternalRowDrop, externalDrop]);
10235
+
10236
+ // Compose columns + custom columns for header
10237
+ const allColumns = [...columns];
10238
+ if (Array.isArray(customColumns)) {
10239
+ customColumns.forEach(col => {
10240
+ if (typeof col.place === 'number') {
10241
+ allColumns.splice(col.place, 0, {
10242
+ ...col,
10243
+ isCustom: true
10244
+ });
10245
+ }
10246
+ });
10247
+ }
10208
10248
  const tableMarkup = /*#__PURE__*/React__default.createElement("div", {
10209
10249
  className: "table-container",
10210
10250
  ref: setTableRef,
@@ -10238,14 +10278,29 @@ function TableInner({
10238
10278
  }
10239
10279
  })), showKey && /*#__PURE__*/React__default.createElement("div", {
10240
10280
  className: "table-cell key-cell"
10241
- }, "#"), columns.map((col, i) => /*#__PURE__*/React__default.createElement("div", {
10242
- key: i,
10243
- className: "table-cell",
10244
- onClick: () => setSort(col.accessor),
10245
- style: {
10246
- cursor: "pointer"
10281
+ }, "#"), allColumns.map((col, i) => {
10282
+ // For custom columns, apply width and textAlign to header cell
10283
+ let cellStyle = col.isCustom && col.style ? {
10284
+ ...col.style,
10285
+ cursor: undefined,
10286
+ display: 'flex',
10287
+ alignItems: 'center',
10288
+ justifyContent: col.style.textAlign === 'center' ? 'center' : col.style.textAlign === 'right' ? 'flex-end' : 'flex-start'
10289
+ } : {
10290
+ cursor: col.isCustom ? undefined : "pointer"
10291
+ };
10292
+ if (col.isCustom && col.style && col.style.width) {
10293
+ cellStyle.minWidth = col.style.width;
10294
+ cellStyle.maxWidth = col.style.width;
10295
+ cellStyle.width = col.style.width;
10247
10296
  }
10248
- }, col.header, sorting?.column === col.accessor && (sorting.direction === "asc" ? " ↑" : " ↓"))), showActions && /*#__PURE__*/React__default.createElement("div", {
10297
+ return /*#__PURE__*/React__default.createElement("div", {
10298
+ key: i,
10299
+ className: "table-cell",
10300
+ style: cellStyle,
10301
+ onClick: col.isCustom ? undefined : () => setSort(col.accessor)
10302
+ }, col.isCustom ? col.header ?? '' : col.header, !col.isCustom && sorting?.column === col.accessor && (sorting.direction === "asc" ? " ↑" : " ↓"));
10303
+ }), showActions && /*#__PURE__*/React__default.createElement("div", {
10249
10304
  className: "table-cell action-cell"
10250
10305
  }, "Action"))), /*#__PURE__*/React__default.createElement("div", {
10251
10306
  className: "main-table",
@@ -10287,8 +10342,49 @@ function Table(props) {
10287
10342
  }, /*#__PURE__*/React__default.createElement(TableInner, props));
10288
10343
  }
10289
10344
 
10345
+ function Switch({
10346
+ checked,
10347
+ onChange
10348
+ }) {
10349
+ return /*#__PURE__*/React.createElement("label", {
10350
+ style: {
10351
+ display: "inline-flex",
10352
+ alignItems: "center",
10353
+ cursor: "pointer"
10354
+ }
10355
+ }, /*#__PURE__*/React.createElement("input", {
10356
+ type: "checkbox",
10357
+ checked: checked,
10358
+ onChange: onChange,
10359
+ style: {
10360
+ display: "none"
10361
+ }
10362
+ }), /*#__PURE__*/React.createElement("span", {
10363
+ style: {
10364
+ width: 36,
10365
+ height: 20,
10366
+ background: checked ? "#4caf50" : "#ccc",
10367
+ borderRadius: 12,
10368
+ position: "relative",
10369
+ transition: "background 0.2s",
10370
+ display: "inline-block"
10371
+ }
10372
+ }, /*#__PURE__*/React.createElement("span", {
10373
+ style: {
10374
+ position: "absolute",
10375
+ left: checked ? 18 : 2,
10376
+ top: 2,
10377
+ width: 16,
10378
+ height: 16,
10379
+ background: "#fff",
10380
+ borderRadius: "50%",
10381
+ transition: "left 0.2s"
10382
+ }
10383
+ })));
10384
+ }
10385
+
10290
10386
  // src/index.js
10291
- // if you want named import
10387
+ // named exports for both
10292
10388
 
10293
- export { Table, Table as default };
10389
+ export { Switch, Table, Table as default };
10294
10390
  //# sourceMappingURL=index.esm.js.map