@teselagen/ui 0.3.33 → 0.3.35

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.cjs.js CHANGED
@@ -4960,7 +4960,7 @@ function _objectSpread$3(target) {
4960
4960
  for (var i = 1; i < arguments.length; i++) {
4961
4961
  var source = null != arguments[i] ? arguments[i] : {};
4962
4962
  i % 2 ? ownKeys$5(Object(source), true).forEach(function(key) {
4963
- _defineProperty$9(target, key, source[key]);
4963
+ _defineProperty$8(target, key, source[key]);
4964
4964
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function(key) {
4965
4965
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4966
4966
  });
@@ -4968,7 +4968,7 @@ function _objectSpread$3(target) {
4968
4968
  return target;
4969
4969
  }
4970
4970
  __name(_objectSpread$3, "_objectSpread$3");
4971
- function _defineProperty$9(obj, key, value) {
4971
+ function _defineProperty$8(obj, key, value) {
4972
4972
  if (key in obj) {
4973
4973
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
4974
4974
  } else {
@@ -4976,11 +4976,11 @@ function _defineProperty$9(obj, key, value) {
4976
4976
  }
4977
4977
  return obj;
4978
4978
  }
4979
- __name(_defineProperty$9, "_defineProperty$9");
4980
- function _slicedToArray$6(arr, i) {
4979
+ __name(_defineProperty$8, "_defineProperty$8");
4980
+ function _slicedToArray$4(arr, i) {
4981
4981
  return _arrayWithHoles$4(arr) || _iterableToArrayLimit$4(arr, i) || _unsupportedIterableToArray$a(arr, i) || _nonIterableRest$4();
4982
4982
  }
4983
- __name(_slicedToArray$6, "_slicedToArray$6");
4983
+ __name(_slicedToArray$4, "_slicedToArray$4");
4984
4984
  function _nonIterableRest$4() {
4985
4985
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4986
4986
  }
@@ -5100,8 +5100,8 @@ function allFilesAccepted(_ref) {
5100
5100
  return false;
5101
5101
  }
5102
5102
  return files.every(function(file) {
5103
- var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$6(_fileAccepted, 1), accepted = _fileAccepted2[0];
5104
- var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$6(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0];
5103
+ var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$4(_fileAccepted, 1), accepted = _fileAccepted2[0];
5104
+ var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$4(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0];
5105
5105
  return accepted && sizeMatch;
5106
5106
  });
5107
5107
  }
@@ -5170,16 +5170,16 @@ function filePickerOptionsTypes(accept) {
5170
5170
  accept: Array.isArray(accept) ? accept.filter(function(item) {
5171
5171
  return item === "audio/*" || item === "video/*" || item === "image/*" || item === "text/*" || /\w+\/[-+.\w]+/g.test(item);
5172
5172
  }).reduce(function(a2, b2) {
5173
- return _objectSpread$3(_objectSpread$3({}, a2), {}, _defineProperty$9({}, b2, []));
5173
+ return _objectSpread$3(_objectSpread$3({}, a2), {}, _defineProperty$8({}, b2, []));
5174
5174
  }, {}) : {}
5175
5175
  }];
5176
5176
  }
5177
5177
  __name(filePickerOptionsTypes, "filePickerOptionsTypes");
5178
5178
  var _excluded$1 = ["children"], _excluded2 = ["open"], _excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], _excluded4 = ["refKey", "onChange", "onClick"];
5179
- function _toConsumableArray$1(arr) {
5179
+ function _toConsumableArray(arr) {
5180
5180
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$9(arr) || _nonIterableSpread();
5181
5181
  }
5182
- __name(_toConsumableArray$1, "_toConsumableArray$1");
5182
+ __name(_toConsumableArray, "_toConsumableArray");
5183
5183
  function _nonIterableSpread() {
5184
5184
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5185
5185
  }
@@ -5194,10 +5194,10 @@ function _arrayWithoutHoles(arr) {
5194
5194
  return _arrayLikeToArray$9(arr);
5195
5195
  }
5196
5196
  __name(_arrayWithoutHoles, "_arrayWithoutHoles");
5197
- function _slicedToArray$5(arr, i) {
5197
+ function _slicedToArray$3(arr, i) {
5198
5198
  return _arrayWithHoles$3(arr) || _iterableToArrayLimit$3(arr, i) || _unsupportedIterableToArray$9(arr, i) || _nonIterableRest$3();
5199
5199
  }
5200
- __name(_slicedToArray$5, "_slicedToArray$5");
5200
+ __name(_slicedToArray$3, "_slicedToArray$3");
5201
5201
  function _nonIterableRest$3() {
5202
5202
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5203
5203
  }
@@ -5274,7 +5274,7 @@ function _objectSpread$2(target) {
5274
5274
  for (var i = 1; i < arguments.length; i++) {
5275
5275
  var source = null != arguments[i] ? arguments[i] : {};
5276
5276
  i % 2 ? ownKeys$4(Object(source), true).forEach(function(key) {
5277
- _defineProperty$8(target, key, source[key]);
5277
+ _defineProperty$7(target, key, source[key]);
5278
5278
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function(key) {
5279
5279
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5280
5280
  });
@@ -5282,7 +5282,7 @@ function _objectSpread$2(target) {
5282
5282
  return target;
5283
5283
  }
5284
5284
  __name(_objectSpread$2, "_objectSpread$2");
5285
- function _defineProperty$8(obj, key, value) {
5285
+ function _defineProperty$7(obj, key, value) {
5286
5286
  if (key in obj) {
5287
5287
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
5288
5288
  } else {
@@ -5290,8 +5290,8 @@ function _defineProperty$8(obj, key, value) {
5290
5290
  }
5291
5291
  return obj;
5292
5292
  }
5293
- __name(_defineProperty$8, "_defineProperty$8");
5294
- function _objectWithoutProperties$7(source, excluded) {
5293
+ __name(_defineProperty$7, "_defineProperty$7");
5294
+ function _objectWithoutProperties$5(source, excluded) {
5295
5295
  if (source == null)
5296
5296
  return {};
5297
5297
  var target = _objectWithoutPropertiesLoose$2(source, excluded);
@@ -5309,7 +5309,7 @@ function _objectWithoutProperties$7(source, excluded) {
5309
5309
  }
5310
5310
  return target;
5311
5311
  }
5312
- __name(_objectWithoutProperties$7, "_objectWithoutProperties$7");
5312
+ __name(_objectWithoutProperties$5, "_objectWithoutProperties$5");
5313
5313
  function _objectWithoutPropertiesLoose$2(source, excluded) {
5314
5314
  if (source == null)
5315
5315
  return {};
@@ -5326,8 +5326,8 @@ function _objectWithoutPropertiesLoose$2(source, excluded) {
5326
5326
  }
5327
5327
  __name(_objectWithoutPropertiesLoose$2, "_objectWithoutPropertiesLoose$2");
5328
5328
  var Dropzone = /* @__PURE__ */ React$1.forwardRef(function(_ref, ref) {
5329
- var children = _ref.children, params = _objectWithoutProperties$7(_ref, _excluded$1);
5330
- var _useDropzone = useDropzone(params), open2 = _useDropzone.open, props = _objectWithoutProperties$7(_useDropzone, _excluded2);
5329
+ var children = _ref.children, params = _objectWithoutProperties$5(_ref, _excluded$1);
5330
+ var _useDropzone = useDropzone(params), open2 = _useDropzone.open, props = _objectWithoutProperties$5(_useDropzone, _excluded2);
5331
5331
  React$1.useImperativeHandle(ref, function() {
5332
5332
  return {
5333
5333
  open: open2
@@ -5536,7 +5536,7 @@ function useDropzone() {
5536
5536
  }, [onFileDialogCancel]);
5537
5537
  var rootRef = React$1.useRef(null);
5538
5538
  var inputRef = React$1.useRef(null);
5539
- var _useReducer = React$1.useReducer(reducer, initialState), _useReducer2 = _slicedToArray$5(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1];
5539
+ var _useReducer = React$1.useReducer(reducer, initialState), _useReducer2 = _slicedToArray$3(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1];
5540
5540
  var isFocused = state.isFocused, isFileDialogActive = state.isFileDialogActive, draggedFiles = state.draggedFiles;
5541
5541
  var onWindowFocus = /* @__PURE__ */ __name(function onWindowFocus2() {
5542
5542
  if (isFileDialogActive) {
@@ -5587,7 +5587,7 @@ function useDropzone() {
5587
5587
  event.preventDefault();
5588
5588
  event.persist();
5589
5589
  stopPropagation(event);
5590
- dragTargetsRef.current = [].concat(_toConsumableArray$1(dragTargetsRef.current), [event.target]);
5590
+ dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);
5591
5591
  if (isEvtWithFiles(event)) {
5592
5592
  Promise.resolve(getFilesFromEvent(event)).then(function(draggedFiles2) {
5593
5593
  if (isPropagationStopped(event) && !noDragEventsBubbling) {
@@ -5648,8 +5648,8 @@ function useDropzone() {
5648
5648
  var acceptedFiles = [];
5649
5649
  var fileRejections = [];
5650
5650
  files.forEach(function(file) {
5651
- var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$5(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1];
5652
- var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$5(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1];
5651
+ var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$3(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1];
5652
+ var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$3(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1];
5653
5653
  var customErrors = validator2 ? validator2(file) : null;
5654
5654
  if (accepted && sizeMatch && !customErrors) {
5655
5655
  acceptedFiles.push(file);
@@ -5784,8 +5784,8 @@ function useDropzone() {
5784
5784
  }, "stopPropagation");
5785
5785
  var getRootProps = React$1.useMemo(function() {
5786
5786
  return function() {
5787
- var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref2.role, onKeyDown = _ref2.onKeyDown, onFocus = _ref2.onFocus, onBlur = _ref2.onBlur, onClick = _ref2.onClick, onDragEnter2 = _ref2.onDragEnter, onDragOver2 = _ref2.onDragOver, onDragLeave2 = _ref2.onDragLeave, onDrop2 = _ref2.onDrop, rest = _objectWithoutProperties$7(_ref2, _excluded3);
5788
- return _objectSpread$2(_objectSpread$2(_defineProperty$8({
5787
+ var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref2.role, onKeyDown = _ref2.onKeyDown, onFocus = _ref2.onFocus, onBlur = _ref2.onBlur, onClick = _ref2.onClick, onDragEnter2 = _ref2.onDragEnter, onDragOver2 = _ref2.onDragOver, onDragLeave2 = _ref2.onDragLeave, onDrop2 = _ref2.onDrop, rest = _objectWithoutProperties$5(_ref2, _excluded3);
5788
+ return _objectSpread$2(_objectSpread$2(_defineProperty$7({
5789
5789
  onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
5790
5790
  onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
5791
5791
  onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
@@ -5805,8 +5805,8 @@ function useDropzone() {
5805
5805
  }, []);
5806
5806
  var getInputProps = React$1.useMemo(function() {
5807
5807
  return function() {
5808
- var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties$7(_ref3, _excluded4);
5809
- var inputProps = _defineProperty$8({
5808
+ var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties$5(_ref3, _excluded4);
5809
+ var inputProps = _defineProperty$7({
5810
5810
  accept,
5811
5811
  multiple,
5812
5812
  type: "file",
@@ -6840,7 +6840,7 @@ function _defineProperties$1(target, props) {
6840
6840
  }
6841
6841
  }
6842
6842
  __name(_defineProperties$1, "_defineProperties$1");
6843
- function _createClass$d(Constructor, protoProps, staticProps) {
6843
+ function _createClass$9(Constructor, protoProps, staticProps) {
6844
6844
  if (protoProps)
6845
6845
  _defineProperties$1(Constructor.prototype, protoProps);
6846
6846
  if (staticProps)
@@ -6850,9 +6850,9 @@ function _createClass$d(Constructor, protoProps, staticProps) {
6850
6850
  });
6851
6851
  return Constructor;
6852
6852
  }
6853
- __name(_createClass$d, "_createClass$d");
6854
- function _extends$o() {
6855
- _extends$o = Object.assign ? Object.assign.bind() : function(target) {
6853
+ __name(_createClass$9, "_createClass$9");
6854
+ function _extends$j() {
6855
+ _extends$j = Object.assign ? Object.assign.bind() : function(target) {
6856
6856
  for (var i = 1; i < arguments.length; i++) {
6857
6857
  var source = arguments[i];
6858
6858
  for (var key in source) {
@@ -6863,9 +6863,9 @@ function _extends$o() {
6863
6863
  }
6864
6864
  return target;
6865
6865
  };
6866
- return _extends$o.apply(this, arguments);
6866
+ return _extends$j.apply(this, arguments);
6867
6867
  }
6868
- __name(_extends$o, "_extends$o");
6868
+ __name(_extends$j, "_extends$j");
6869
6869
  function _inheritsLoose$2(subClass, superClass) {
6870
6870
  subClass.prototype = Object.create(superClass.prototype);
6871
6871
  subClass.prototype.constructor = subClass;
@@ -6960,7 +6960,7 @@ function createDecoratorAnnotation(annotation) {
6960
6960
  __name(createDecoratorAnnotation, "createDecoratorAnnotation");
6961
6961
  function storeAnnotation(prototype, key, annotation) {
6962
6962
  if (!hasProp(prototype, storedAnnotationsSymbol)) {
6963
- addHiddenProp(prototype, storedAnnotationsSymbol, _extends$o({}, prototype[storedAnnotationsSymbol]));
6963
+ addHiddenProp(prototype, storedAnnotationsSymbol, _extends$j({}, prototype[storedAnnotationsSymbol]));
6964
6964
  }
6965
6965
  if (!isOverride(annotation)) {
6966
6966
  prototype[storedAnnotationsSymbol][key] = annotation;
@@ -6969,7 +6969,7 @@ function storeAnnotation(prototype, key, annotation) {
6969
6969
  __name(storeAnnotation, "storeAnnotation");
6970
6970
  function collectStoredAnnotations(target) {
6971
6971
  if (!hasProp(target, storedAnnotationsSymbol)) {
6972
- addHiddenProp(target, storedAnnotationsSymbol, _extends$o({}, target[storedAnnotationsSymbol]));
6972
+ addHiddenProp(target, storedAnnotationsSymbol, _extends$j({}, target[storedAnnotationsSymbol]));
6973
6973
  }
6974
6974
  return target[storedAnnotationsSymbol];
6975
6975
  }
@@ -7297,7 +7297,7 @@ function make_$3(adm, key, descriptor2) {
7297
7297
  __name(make_$3, "make_$3");
7298
7298
  function extend_$3(adm, key, descriptor2, proxyTrap) {
7299
7299
  assertComputedDescriptor(adm, this, key, descriptor2);
7300
- return adm.defineComputedProperty_(key, _extends$o({}, this.options_, {
7300
+ return adm.defineComputedProperty_(key, _extends$j({}, this.options_, {
7301
7301
  get: descriptor2.get,
7302
7302
  set: descriptor2.set
7303
7303
  }), proxyTrap);
@@ -9644,7 +9644,7 @@ var ObservableMap = /* @__PURE__ */ function() {
9644
9644
  _proto.intercept_ = /* @__PURE__ */ __name(function intercept_(handler) {
9645
9645
  return registerInterceptor(this, handler);
9646
9646
  }, "intercept_");
9647
- _createClass$d(ObservableMap2, [{
9647
+ _createClass$9(ObservableMap2, [{
9648
9648
  key: "size",
9649
9649
  get: /* @__PURE__ */ __name(function get5() {
9650
9650
  this.keysAtom_.reportObserved();
@@ -9878,7 +9878,7 @@ var ObservableSet = /* @__PURE__ */ function() {
9878
9878
  _proto[_Symbol$iterator$1] = function() {
9879
9879
  return this.values();
9880
9880
  };
9881
- _createClass$d(ObservableSet2, [{
9881
+ _createClass$9(ObservableSet2, [{
9882
9882
  key: "size",
9883
9883
  get: /* @__PURE__ */ __name(function get5() {
9884
9884
  this.atom_.reportObserved();
@@ -10074,7 +10074,7 @@ var ObservableObjectAdministration = /* @__PURE__ */ function() {
10074
10074
  }
10075
10075
  var newValue = change.newValue;
10076
10076
  if (descriptor2.value !== newValue) {
10077
- descriptor2 = _extends$o({}, descriptor2, {
10077
+ descriptor2 = _extends$j({}, descriptor2, {
10078
10078
  value: newValue
10079
10079
  });
10080
10080
  }
@@ -10402,7 +10402,7 @@ var LegacyObservableArray = /* @__PURE__ */ function(_StubArray, _Symbol$toStrin
10402
10402
  }, "next")
10403
10403
  });
10404
10404
  };
10405
- _createClass$d(LegacyObservableArray2, [{
10405
+ _createClass$9(LegacyObservableArray2, [{
10406
10406
  key: "length",
10407
10407
  get: /* @__PURE__ */ __name(function get5() {
10408
10408
  return this[$mobx].getArrayLength_();
@@ -17736,8 +17736,8 @@ lodash.exports;
17736
17736
  }).call(commonjsGlobal);
17737
17737
  })(lodash, lodash.exports);
17738
17738
  var lodashExports = lodash.exports;
17739
- function _extends$n() {
17740
- _extends$n = Object.assign ? Object.assign.bind() : function(target) {
17739
+ function _extends$i() {
17740
+ _extends$i = Object.assign ? Object.assign.bind() : function(target) {
17741
17741
  for (var i = 1; i < arguments.length; i++) {
17742
17742
  var source = arguments[i];
17743
17743
  for (var key in source) {
@@ -17748,9 +17748,9 @@ function _extends$n() {
17748
17748
  }
17749
17749
  return target;
17750
17750
  };
17751
- return _extends$n.apply(this, arguments);
17751
+ return _extends$i.apply(this, arguments);
17752
17752
  }
17753
- __name(_extends$n, "_extends$n");
17753
+ __name(_extends$i, "_extends$i");
17754
17754
  function _setPrototypeOf$2(o2, p2) {
17755
17755
  _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf3(o3, p3) {
17756
17756
  o3.__proto__ = p3;
@@ -17945,7 +17945,7 @@ var mapProps = /* @__PURE__ */ __name(function mapProps2(propsMapper) {
17945
17945
  }, "mapProps");
17946
17946
  var withProps = /* @__PURE__ */ __name(function withProps2(input) {
17947
17947
  var hoc = mapProps(function(props) {
17948
- return _extends$n({}, props, typeof input === "function" ? input(props) : input);
17948
+ return _extends$i({}, props, typeof input === "function" ? input(props) : input);
17949
17949
  });
17950
17950
  return hoc;
17951
17951
  }, "withProps");
@@ -17980,7 +17980,7 @@ var withHandlers = /* @__PURE__ */ __name(function withHandlers2(handlers2) {
17980
17980
  __name(WithHandlers2, "WithHandlers");
17981
17981
  var _proto = WithHandlers2.prototype;
17982
17982
  _proto.render = /* @__PURE__ */ __name(function render3() {
17983
- return factory(_extends$n({}, this.props, this.handlers));
17983
+ return factory(_extends$i({}, this.props, this.handlers));
17984
17984
  }, "render");
17985
17985
  return WithHandlers2;
17986
17986
  }(React$1.Component);
@@ -18015,7 +18015,7 @@ var withState = /* @__PURE__ */ __name(function withState2(stateName, stateUpdat
18015
18015
  var _proto = WithState2.prototype;
18016
18016
  _proto.render = /* @__PURE__ */ __name(function render3() {
18017
18017
  var _extends2;
18018
- return factory(_extends$n({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2)));
18018
+ return factory(_extends$i({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2)));
18019
18019
  }, "render");
18020
18020
  return WithState2;
18021
18021
  }(React$1.Component);
@@ -18075,7 +18075,7 @@ var lifecycle = /* @__PURE__ */ __name(function lifecycle2(spec) {
18075
18075
  __name(Lifecycle3, "Lifecycle");
18076
18076
  var _proto = Lifecycle3.prototype;
18077
18077
  _proto.render = /* @__PURE__ */ __name(function render3() {
18078
- return factory(_extends$n({}, this.props, this.state));
18078
+ return factory(_extends$i({}, this.props, this.state));
18079
18079
  }, "render");
18080
18080
  return Lifecycle3;
18081
18081
  }(React$1.Component);
@@ -18396,25 +18396,16 @@ var toString$6 = {}.toString;
18396
18396
  var _cof = /* @__PURE__ */ __name(function(it) {
18397
18397
  return toString$6.call(it).slice(8, -1);
18398
18398
  }, "_cof");
18399
- var _iobject;
18400
- var hasRequired_iobject;
18401
- function require_iobject() {
18402
- if (hasRequired_iobject)
18403
- return _iobject;
18404
- hasRequired_iobject = 1;
18405
- var cof2 = _cof;
18406
- _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
18407
- return cof2(it) == "String" ? it.split("") : Object(it);
18408
- };
18409
- return _iobject;
18410
- }
18411
- __name(require_iobject, "require_iobject");
18399
+ var cof$2 = _cof;
18400
+ var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
18401
+ return cof$2(it) == "String" ? it.split("") : Object(it);
18402
+ };
18412
18403
  var _defined = /* @__PURE__ */ __name(function(it) {
18413
18404
  if (it == void 0)
18414
18405
  throw TypeError("Can't call method on " + it);
18415
18406
  return it;
18416
18407
  }, "_defined");
18417
- var IObject = require_iobject();
18408
+ var IObject = _iobject;
18418
18409
  var defined$2 = _defined;
18419
18410
  var _toIobject = /* @__PURE__ */ __name(function(it) {
18420
18411
  return IObject(defined$2(it));
@@ -18535,7 +18526,7 @@ function require_objectAssign() {
18535
18526
  var gOPS2 = _objectGops;
18536
18527
  var pIE2 = require_objectPie();
18537
18528
  var toObject2 = _toObject;
18538
- var IObject2 = require_iobject();
18529
+ var IObject2 = _iobject;
18539
18530
  var $assign = Object.assign;
18540
18531
  _objectAssign = !$assign || _fails(function() {
18541
18532
  var A2 = {};
@@ -19092,8 +19083,8 @@ var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty3(it, key,
19092
19083
  return $Object$2.defineProperty(it, key, desc);
19093
19084
  }, "defineProperty");
19094
19085
  var defineProperty$8 = { "default": defineProperty$9, __esModule: true };
19095
- var _defineProperty$7 = defineProperty$8;
19096
- var _defineProperty2 = _interopRequireDefault$e(_defineProperty$7);
19086
+ var _defineProperty$6 = defineProperty$8;
19087
+ var _defineProperty2 = _interopRequireDefault$e(_defineProperty$6);
19097
19088
  function _interopRequireDefault$e(obj) {
19098
19089
  return obj && obj.__esModule ? obj : { default: obj };
19099
19090
  }
@@ -21173,8 +21164,8 @@ var defineProperty$6 = function() {
21173
21164
  } catch (e2) {
21174
21165
  }
21175
21166
  }();
21176
- var _defineProperty$6 = defineProperty$6;
21177
- var constant$1 = constant_1, defineProperty$5 = _defineProperty$6, identity$3 = identity_1;
21167
+ var _defineProperty$5 = defineProperty$6;
21168
+ var constant$1 = constant_1, defineProperty$5 = _defineProperty$5, identity$3 = identity_1;
21178
21169
  var baseSetToString$3 = !defineProperty$5 ? identity$3 : function(func, string2) {
21179
21170
  return defineProperty$5(func, "toString", {
21180
21171
  "configurable": true,
@@ -22234,7 +22225,7 @@ function _typeof$4(obj) {
22234
22225
  return _typeof$4(obj);
22235
22226
  }
22236
22227
  __name(_typeof$4, "_typeof$4");
22237
- function _defineProperty$5(obj, key, value) {
22228
+ function _defineProperty$4(obj, key, value) {
22238
22229
  if (key in obj) {
22239
22230
  Object.defineProperty(obj, key, {
22240
22231
  value,
@@ -22247,7 +22238,7 @@ function _defineProperty$5(obj, key, value) {
22247
22238
  }
22248
22239
  return obj;
22249
22240
  }
22250
- __name(_defineProperty$5, "_defineProperty$5");
22241
+ __name(_defineProperty$4, "_defineProperty$4");
22251
22242
  function ownKeys$2(object2, enumerableOnly) {
22252
22243
  var keys3 = Object.keys(object2);
22253
22244
  if (Object.getOwnPropertySymbols) {
@@ -22266,7 +22257,7 @@ function _objectSpread2(target) {
22266
22257
  var source = arguments[i] != null ? arguments[i] : {};
22267
22258
  if (i % 2) {
22268
22259
  ownKeys$2(source, true).forEach(function(key) {
22269
- _defineProperty$5(target, key, source[key]);
22260
+ _defineProperty$4(target, key, source[key]);
22270
22261
  });
22271
22262
  } else if (Object.getOwnPropertyDescriptors) {
22272
22263
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
@@ -23247,7 +23238,7 @@ var reactList = {};
23247
23238
  key: "getSizeOfItem",
23248
23239
  value: /* @__PURE__ */ __name(function getSizeOfItem(index2) {
23249
23240
  var cache = this.cache, items = this.items;
23250
- var _this$props6 = this.props, axis = _this$props6.axis, itemSizeGetter = _this$props6.itemSizeGetter, itemSizeEstimator3 = _this$props6.itemSizeEstimator, type = _this$props6.type;
23241
+ var _this$props6 = this.props, axis = _this$props6.axis, itemSizeGetter = _this$props6.itemSizeGetter, itemSizeEstimator2 = _this$props6.itemSizeEstimator, type = _this$props6.type;
23251
23242
  var _this$state4 = this.state, from3 = _this$state4.from, itemSize = _this$state4.itemSize, size = _this$state4.size;
23252
23243
  if (itemSize)
23253
23244
  return itemSize;
@@ -23260,8 +23251,8 @@ var reactList = {};
23260
23251
  if (itemEl)
23261
23252
  return itemEl[OFFSET_SIZE_KEYS[axis]];
23262
23253
  }
23263
- if (itemSizeEstimator3)
23264
- return itemSizeEstimator3(index2, cache);
23254
+ if (itemSizeEstimator2)
23255
+ return itemSizeEstimator2(index2, cache);
23265
23256
  }, "getSizeOfItem")
23266
23257
  }, {
23267
23258
  key: "constrain",
@@ -23437,29 +23428,6 @@ var reactList = {};
23437
23428
  });
23438
23429
  })(reactList);
23439
23430
  const ReactList = /* @__PURE__ */ getDefaultExportFromCjs(reactList);
23440
- var _extends$m = Object.assign || function(target) {
23441
- for (var i = 1; i < arguments.length; i++) {
23442
- var source = arguments[i];
23443
- for (var key in source) {
23444
- if (Object.prototype.hasOwnProperty.call(source, key)) {
23445
- target[key] = source[key];
23446
- }
23447
- }
23448
- }
23449
- return target;
23450
- };
23451
- function _objectWithoutProperties$6(obj, keys3) {
23452
- var target = {};
23453
- for (var i in obj) {
23454
- if (keys3.indexOf(i) >= 0)
23455
- continue;
23456
- if (!Object.prototype.hasOwnProperty.call(obj, i))
23457
- continue;
23458
- target[i] = obj[i];
23459
- }
23460
- return target;
23461
- }
23462
- __name(_objectWithoutProperties$6, "_objectWithoutProperties$6");
23463
23431
  const _ = {
23464
23432
  get: get$3,
23465
23433
  set: set4,
@@ -23484,24 +23452,19 @@ function get$3(obj, path2, def2) {
23484
23452
  if (!path2) {
23485
23453
  return obj;
23486
23454
  }
23487
- var pathObj = makePathArray(path2);
23488
- var val = void 0;
23455
+ const pathObj = makePathArray(path2);
23456
+ let val;
23489
23457
  try {
23490
- val = pathObj.reduce(function(current, pathPart) {
23491
- return current[pathPart];
23492
- }, obj);
23458
+ val = pathObj.reduce((current, pathPart) => current[pathPart], obj);
23493
23459
  } catch (e2) {
23494
23460
  }
23495
23461
  return typeof val !== "undefined" ? val : def2;
23496
23462
  }
23497
23463
  __name(get$3, "get$3");
23498
- function set4() {
23499
- var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
23500
- var path2 = arguments[1];
23501
- var value = arguments[2];
23502
- var keys3 = makePathArray(path2);
23503
- var keyPart = void 0;
23504
- var cursor = obj;
23464
+ function set4(obj = {}, path2, value) {
23465
+ const keys3 = makePathArray(path2);
23466
+ let keyPart;
23467
+ let cursor = obj;
23505
23468
  while ((keyPart = keys3.shift()) && keys3.length) {
23506
23469
  if (!cursor[keyPart]) {
23507
23470
  cursor[keyPart] = {};
@@ -23513,7 +23476,7 @@ function set4() {
23513
23476
  }
23514
23477
  __name(set4, "set");
23515
23478
  function takeRight(arr, n2) {
23516
- var start2 = n2 > arr.length ? 0 : arr.length - n2;
23479
+ const start2 = n2 > arr.length ? 0 : arr.length - n2;
23517
23480
  return arr.slice(start2);
23518
23481
  }
23519
23482
  __name(takeRight, "takeRight");
@@ -23522,19 +23485,19 @@ function last(arr) {
23522
23485
  }
23523
23486
  __name(last, "last");
23524
23487
  function range(n2) {
23525
- var arr = [];
23526
- for (var i = 0; i < n2; i += 1) {
23488
+ const arr = [];
23489
+ for (let i = 0; i < n2; i += 1) {
23527
23490
  arr.push(n2);
23528
23491
  }
23529
23492
  return arr;
23530
23493
  }
23531
23494
  __name(range, "range");
23532
23495
  function orderBy(arr, funcs, dirs, indexKey) {
23533
- return arr.sort(function(rowA, rowB) {
23534
- for (var i = 0; i < funcs.length; i += 1) {
23535
- var comp = funcs[i];
23536
- var desc = dirs[i] === false || dirs[i] === "desc";
23537
- var sortInt = comp(rowA, rowB);
23496
+ return arr.sort((rowA, rowB) => {
23497
+ for (let i = 0; i < funcs.length; i += 1) {
23498
+ const comp = funcs[i];
23499
+ const desc = dirs[i] === false || dirs[i] === "desc";
23500
+ const sortInt = comp(rowA, rowB);
23538
23501
  if (sortInt) {
23539
23502
  return desc ? -sortInt : sortInt;
23540
23503
  }
@@ -23544,8 +23507,8 @@ function orderBy(arr, funcs, dirs, indexKey) {
23544
23507
  }
23545
23508
  __name(orderBy, "orderBy");
23546
23509
  function remove2(a2, b2) {
23547
- return a2.filter(function(o2, i) {
23548
- var r2 = b2(o2);
23510
+ return a2.filter((o2, i) => {
23511
+ const r2 = b2(o2);
23549
23512
  if (r2) {
23550
23513
  a2.splice(i, 1);
23551
23514
  return true;
@@ -23556,50 +23519,46 @@ function remove2(a2, b2) {
23556
23519
  __name(remove2, "remove");
23557
23520
  function clone2(a2) {
23558
23521
  try {
23559
- return JSON.parse(JSON.stringify(a2, function(key, value) {
23560
- if (typeof value === "function") {
23561
- return value.toString();
23562
- }
23563
- return value;
23564
- }));
23522
+ return JSON.parse(
23523
+ JSON.stringify(a2, (key, value) => {
23524
+ if (typeof value === "function") {
23525
+ return value.toString();
23526
+ }
23527
+ return value;
23528
+ })
23529
+ );
23565
23530
  } catch (e2) {
23566
23531
  return a2;
23567
23532
  }
23568
23533
  }
23569
23534
  __name(clone2, "clone");
23570
- function getFirstDefined() {
23571
- for (var i = 0; i < arguments.length; i += 1) {
23572
- if (typeof (arguments.length <= i ? void 0 : arguments[i]) !== "undefined") {
23573
- return arguments.length <= i ? void 0 : arguments[i];
23535
+ function getFirstDefined(...args) {
23536
+ for (let i = 0; i < args.length; i += 1) {
23537
+ if (typeof args[i] !== "undefined") {
23538
+ return args[i];
23574
23539
  }
23575
23540
  }
23576
23541
  }
23577
23542
  __name(getFirstDefined, "getFirstDefined");
23578
23543
  function sum(arr) {
23579
- return arr.reduce(function(a2, b2) {
23580
- return a2 + b2;
23581
- }, 0);
23544
+ return arr.reduce((a2, b2) => a2 + b2, 0);
23582
23545
  }
23583
23546
  __name(sum, "sum");
23584
23547
  function makeTemplateComponent(compClass, displayName) {
23585
23548
  if (!displayName) {
23586
23549
  throw new Error("No displayName found for template component:", compClass);
23587
23550
  }
23588
- var cmp = /* @__PURE__ */ __name(function cmp2(_ref) {
23589
- var children = _ref.children, className = _ref.className, rest = _objectWithoutProperties$6(_ref, ["children", "className"]);
23590
- return React$1.createElement(
23591
- "div",
23592
- _extends$m({ className: classNames(compClass, className) }, rest),
23593
- children
23594
- );
23551
+ const cmp = /* @__PURE__ */ __name((_a2) => {
23552
+ var _b = _a2, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
23553
+ return /* @__PURE__ */ React$1.createElement("div", __spreadValues({ className: classNames(compClass, className) }, rest), children);
23595
23554
  }, "cmp");
23596
23555
  cmp.displayName = displayName;
23597
23556
  return cmp;
23598
23557
  }
23599
23558
  __name(makeTemplateComponent, "makeTemplateComponent");
23600
23559
  function groupBy(xs, key) {
23601
- return xs.reduce(function(rv, x2, i) {
23602
- var resKey = typeof key === "function" ? key(x2, i) : x2[key];
23560
+ return xs.reduce((rv, x2, i) => {
23561
+ const resKey = typeof key === "function" ? key(x2, i) : x2[key];
23603
23562
  rv[resKey] = isArray$b(rv[resKey]) ? rv[resKey] : [];
23604
23563
  rv[resKey].push(x2);
23605
23564
  return rv;
@@ -23608,7 +23567,7 @@ function groupBy(xs, key) {
23608
23567
  __name(groupBy, "groupBy");
23609
23568
  function asPx(value) {
23610
23569
  value = Number(value);
23611
- return Number.isNaN(value) ? null : value + "px";
23570
+ return Number.isNaN(value) ? null : `${value}px`;
23612
23571
  }
23613
23572
  __name(asPx, "asPx");
23614
23573
  function isArray$b(a2) {
@@ -23619,20 +23578,19 @@ function makePathArray(obj) {
23619
23578
  return flattenDeep(obj).join(".").replace(/\[/g, ".").replace(/\]/g, "").split(".");
23620
23579
  }
23621
23580
  __name(makePathArray, "makePathArray");
23622
- function flattenDeep(arr) {
23623
- var newArr = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
23581
+ function flattenDeep(arr, newArr = []) {
23624
23582
  if (!isArray$b(arr)) {
23625
23583
  newArr.push(arr);
23626
23584
  } else {
23627
- for (var i = 0; i < arr.length; i += 1) {
23585
+ for (let i = 0; i < arr.length; i += 1) {
23628
23586
  flattenDeep(arr[i], newArr);
23629
23587
  }
23630
23588
  }
23631
23589
  return newArr;
23632
23590
  }
23633
23591
  __name(flattenDeep, "flattenDeep");
23634
- function splitProps(_ref2) {
23635
- var className = _ref2.className, style2 = _ref2.style, rest = _objectWithoutProperties$6(_ref2, ["className", "style"]);
23592
+ function splitProps(_c) {
23593
+ var _d = _c, { className, style: style2 } = _d, rest = __objRest(_d, ["className", "style"]);
23636
23594
  return {
23637
23595
  className,
23638
23596
  style: style2,
@@ -23641,9 +23599,9 @@ function splitProps(_ref2) {
23641
23599
  }
23642
23600
  __name(splitProps, "splitProps");
23643
23601
  function compactObject(obj) {
23644
- var newObj = {};
23602
+ const newObj = {};
23645
23603
  if (obj) {
23646
- Object.keys(obj).map(function(key) {
23604
+ Object.keys(obj).map((key) => {
23647
23605
  if (Object.prototype.hasOwnProperty.call(obj, key) && obj[key] !== void 0 && typeof obj[key] !== "undefined") {
23648
23606
  newObj[key] = obj[key];
23649
23607
  }
@@ -23657,1084 +23615,744 @@ function isSortingDesc(d2) {
23657
23615
  return !!(d2.sort === "desc" || d2.desc === true || d2.asc === false);
23658
23616
  }
23659
23617
  __name(isSortingDesc, "isSortingDesc");
23660
- function normalizeComponent(Comp) {
23661
- var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
23662
- var fallback = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Comp;
23663
- return typeof Comp === "function" ? Object.getPrototypeOf(Comp).isReactComponent ? React$1.createElement(Comp, params) : Comp(params) : fallback;
23618
+ function normalizeComponent(Comp, params = {}, fallback = Comp) {
23619
+ return typeof Comp === "function" ? Object.getPrototypeOf(Comp).isReactComponent ? /* @__PURE__ */ React$1.createElement(Comp, __spreadValues({}, params)) : Comp(params) : fallback;
23664
23620
  }
23665
23621
  __name(normalizeComponent, "normalizeComponent");
23666
- var _createClass$c = function() {
23667
- function defineProperties2(target, props) {
23668
- for (var i = 0; i < props.length; i++) {
23669
- var descriptor2 = props[i];
23670
- descriptor2.enumerable = descriptor2.enumerable || false;
23671
- descriptor2.configurable = true;
23672
- if ("value" in descriptor2)
23673
- descriptor2.writable = true;
23674
- Object.defineProperty(target, descriptor2.key, descriptor2);
23675
- }
23676
- }
23677
- __name(defineProperties2, "defineProperties");
23678
- return function(Constructor, protoProps, staticProps) {
23679
- if (protoProps)
23680
- defineProperties2(Constructor.prototype, protoProps);
23681
- if (staticProps)
23682
- defineProperties2(Constructor, staticProps);
23683
- return Constructor;
23684
- };
23685
- }();
23686
- function _classCallCheck$h(instance, Constructor) {
23687
- if (!(instance instanceof Constructor)) {
23688
- throw new TypeError("Cannot call a class as a function");
23689
- }
23690
- }
23691
- __name(_classCallCheck$h, "_classCallCheck$h");
23692
- function _possibleConstructorReturn$h(self2, call2) {
23693
- if (!self2) {
23694
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
23622
+ const Lifecycle = /* @__PURE__ */ __name((Base) => class extends Base {
23623
+ UNSAFE_componentWillMount() {
23624
+ this.setStateWithData(this.getDataModel(this.getResolvedState(), true));
23695
23625
  }
23696
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
23697
- }
23698
- __name(_possibleConstructorReturn$h, "_possibleConstructorReturn$h");
23699
- function _inherits$h(subClass, superClass) {
23700
- if (typeof superClass !== "function" && superClass !== null) {
23701
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
23626
+ componentDidMount() {
23627
+ this.fireFetchData();
23702
23628
  }
23703
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
23704
- if (superClass)
23705
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
23706
- }
23707
- __name(_inherits$h, "_inherits$h");
23708
- const Lifecycle = /* @__PURE__ */ __name(function(Base) {
23709
- return function(_Base) {
23710
- _inherits$h(_class, _Base);
23711
- function _class() {
23712
- _classCallCheck$h(this, _class);
23713
- return _possibleConstructorReturn$h(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
23714
- }
23715
- __name(_class, "_class");
23716
- _createClass$c(_class, [{
23717
- key: "UNSAFE_componentWillMount",
23718
- value: /* @__PURE__ */ __name(function UNSAFE_componentWillMount() {
23719
- this.setStateWithData(this.getDataModel(this.getResolvedState(), true));
23720
- }, "UNSAFE_componentWillMount")
23721
- }, {
23722
- key: "componentDidMount",
23723
- value: /* @__PURE__ */ __name(function componentDidMount() {
23724
- this.fireFetchData();
23725
- }, "componentDidMount")
23726
- }, {
23727
- key: "UNSAFE_componentWillReceiveProps",
23728
- value: /* @__PURE__ */ __name(function UNSAFE_componentWillReceiveProps(nextProps, nextState) {
23729
- var oldState = this.getResolvedState();
23730
- var newState = this.getResolvedState(nextProps, nextState);
23731
- var defaultableOptions = ["sorted", "filtered", "resized", "expanded"];
23732
- defaultableOptions.forEach(function(x2) {
23733
- var defaultName = "default" + (x2.charAt(0).toUpperCase() + x2.slice(1));
23734
- if (JSON.stringify(oldState[defaultName]) !== JSON.stringify(newState[defaultName])) {
23735
- newState[x2] = newState[defaultName];
23736
- }
23737
- });
23738
- var resettableOptions = ["sortable", "filterable", "resizable"];
23739
- resettableOptions.forEach(function(x2) {
23740
- if (oldState[x2] !== newState[x2]) {
23741
- var baseName = x2.replace("able", "");
23742
- var optionName = baseName + "ed";
23743
- var defaultName = "default" + (optionName.charAt(0).toUpperCase() + optionName.slice(1));
23744
- newState[optionName] = newState[defaultName];
23745
- }
23746
- });
23747
- if (oldState.data !== newState.data || oldState.columns !== newState.columns || oldState.pivotBy !== newState.pivotBy || oldState.sorted !== newState.sorted || oldState.filtered !== newState.filtered) {
23748
- this.setStateWithData(this.getDataModel(newState, oldState.data !== newState.data));
23749
- }
23750
- }, "UNSAFE_componentWillReceiveProps")
23751
- }, {
23752
- key: "setStateWithData",
23753
- value: /* @__PURE__ */ __name(function setStateWithData(newState, cb) {
23754
- var _this2 = this;
23755
- var oldState = this.getResolvedState();
23756
- var newResolvedState = this.getResolvedState({}, newState);
23757
- var freezeWhenExpanded = newResolvedState.freezeWhenExpanded;
23758
- newResolvedState.frozen = false;
23759
- if (freezeWhenExpanded) {
23760
- var keys3 = Object.keys(newResolvedState.expanded);
23761
- for (var i = 0; i < keys3.length; i += 1) {
23762
- if (newResolvedState.expanded[keys3[i]]) {
23763
- newResolvedState.frozen = true;
23764
- break;
23765
- }
23766
- }
23767
- }
23768
- if (oldState.frozen && !newResolvedState.frozen || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered || oldState.showFilters !== newResolvedState.showFilters || !newResolvedState.frozen && oldState.resolvedData !== newResolvedState.resolvedData) {
23769
- if (oldState.sorted !== newResolvedState.sorted && this.props.collapseOnSortingChange || oldState.filtered !== newResolvedState.filtered || oldState.showFilters !== newResolvedState.showFilters || oldState.sortedData && !newResolvedState.frozen && oldState.resolvedData !== newResolvedState.resolvedData && this.props.collapseOnDataChange) {
23770
- newResolvedState.expanded = {};
23771
- }
23772
- Object.assign(newResolvedState, this.getSortedData(newResolvedState));
23773
- }
23774
- if (oldState.filtered !== newResolvedState.filtered) {
23775
- newResolvedState.page = 0;
23776
- }
23777
- if (newResolvedState.sortedData) {
23778
- newResolvedState.pages = newResolvedState.manual ? newResolvedState.pages : Math.ceil(newResolvedState.sortedData.length / newResolvedState.pageSize);
23779
- newResolvedState.page = newResolvedState.manual ? newResolvedState.page : Math.max(newResolvedState.page >= newResolvedState.pages ? newResolvedState.pages - 1 : newResolvedState.page, 0);
23780
- }
23781
- return this.setState(newResolvedState, function() {
23782
- if (cb) {
23783
- cb();
23784
- }
23785
- if (oldState.page !== newResolvedState.page || oldState.pageSize !== newResolvedState.pageSize || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered) {
23786
- _this2.fireFetchData();
23787
- }
23788
- });
23789
- }, "setStateWithData")
23790
- }]);
23791
- return _class;
23792
- }(Base);
23793
- }, "Lifecycle");
23794
- var _slicedToArray$4 = function() {
23795
- function sliceIterator(arr, i) {
23796
- var _arr = [];
23797
- var _n = true;
23798
- var _d = false;
23799
- var _e = void 0;
23800
- try {
23801
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
23802
- _arr.push(_s.value);
23803
- if (i && _arr.length === i)
23804
- break;
23629
+ UNSAFE_componentWillReceiveProps(nextProps, nextState) {
23630
+ const oldState = this.getResolvedState();
23631
+ const newState = this.getResolvedState(nextProps, nextState);
23632
+ const defaultableOptions = ["sorted", "filtered", "resized", "expanded"];
23633
+ defaultableOptions.forEach((x2) => {
23634
+ const defaultName = `default${x2.charAt(0).toUpperCase() + x2.slice(1)}`;
23635
+ if (JSON.stringify(oldState[defaultName]) !== JSON.stringify(newState[defaultName])) {
23636
+ newState[x2] = newState[defaultName];
23805
23637
  }
23806
- } catch (err) {
23807
- _d = true;
23808
- _e = err;
23809
- } finally {
23810
- try {
23811
- if (!_n && _i["return"])
23812
- _i["return"]();
23813
- } finally {
23814
- if (_d)
23815
- throw _e;
23638
+ });
23639
+ const resettableOptions = ["sortable", "filterable", "resizable"];
23640
+ resettableOptions.forEach((x2) => {
23641
+ if (oldState[x2] !== newState[x2]) {
23642
+ const baseName = x2.replace("able", "");
23643
+ const optionName = `${baseName}ed`;
23644
+ const defaultName = `default${optionName.charAt(0).toUpperCase() + optionName.slice(1)}`;
23645
+ newState[optionName] = newState[defaultName];
23646
+ }
23647
+ });
23648
+ if (oldState.data !== newState.data || oldState.columns !== newState.columns || oldState.pivotBy !== newState.pivotBy || oldState.sorted !== newState.sorted || oldState.filtered !== newState.filtered) {
23649
+ this.setStateWithData(this.getDataModel(newState, oldState.data !== newState.data));
23650
+ }
23651
+ }
23652
+ setStateWithData(newState, cb) {
23653
+ const oldState = this.getResolvedState();
23654
+ const newResolvedState = this.getResolvedState({}, newState);
23655
+ const { freezeWhenExpanded } = newResolvedState;
23656
+ newResolvedState.frozen = false;
23657
+ if (freezeWhenExpanded) {
23658
+ const keys3 = Object.keys(newResolvedState.expanded);
23659
+ for (let i = 0; i < keys3.length; i += 1) {
23660
+ if (newResolvedState.expanded[keys3[i]]) {
23661
+ newResolvedState.frozen = true;
23662
+ break;
23663
+ }
23816
23664
  }
23817
23665
  }
23818
- return _arr;
23819
- }
23820
- __name(sliceIterator, "sliceIterator");
23821
- return function(arr, i) {
23822
- if (Array.isArray(arr)) {
23823
- return arr;
23824
- } else if (Symbol.iterator in Object(arr)) {
23825
- return sliceIterator(arr, i);
23826
- } else {
23827
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
23828
- }
23829
- };
23830
- }();
23831
- var _extends$l = Object.assign || function(target) {
23832
- for (var i = 1; i < arguments.length; i++) {
23833
- var source = arguments[i];
23834
- for (var key in source) {
23835
- if (Object.prototype.hasOwnProperty.call(source, key)) {
23836
- target[key] = source[key];
23666
+ if (oldState.frozen && !newResolvedState.frozen || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered || oldState.showFilters !== newResolvedState.showFilters || !newResolvedState.frozen && oldState.resolvedData !== newResolvedState.resolvedData) {
23667
+ if (oldState.sorted !== newResolvedState.sorted && this.props.collapseOnSortingChange || oldState.filtered !== newResolvedState.filtered || oldState.showFilters !== newResolvedState.showFilters || oldState.sortedData && !newResolvedState.frozen && oldState.resolvedData !== newResolvedState.resolvedData && this.props.collapseOnDataChange) {
23668
+ newResolvedState.expanded = {};
23837
23669
  }
23670
+ Object.assign(newResolvedState, this.getSortedData(newResolvedState));
23838
23671
  }
23839
- }
23840
- return target;
23841
- };
23842
- var _createClass$b = function() {
23843
- function defineProperties2(target, props) {
23844
- for (var i = 0; i < props.length; i++) {
23845
- var descriptor2 = props[i];
23846
- descriptor2.enumerable = descriptor2.enumerable || false;
23847
- descriptor2.configurable = true;
23848
- if ("value" in descriptor2)
23849
- descriptor2.writable = true;
23850
- Object.defineProperty(target, descriptor2.key, descriptor2);
23672
+ if (oldState.filtered !== newResolvedState.filtered) {
23673
+ newResolvedState.page = 0;
23851
23674
  }
23852
- }
23853
- __name(defineProperties2, "defineProperties");
23854
- return function(Constructor, protoProps, staticProps) {
23855
- if (protoProps)
23856
- defineProperties2(Constructor.prototype, protoProps);
23857
- if (staticProps)
23858
- defineProperties2(Constructor, staticProps);
23859
- return Constructor;
23860
- };
23861
- }();
23862
- function _defineProperty$4(obj, key, value) {
23863
- if (key in obj) {
23864
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
23865
- } else {
23866
- obj[key] = value;
23867
- }
23868
- return obj;
23869
- }
23870
- __name(_defineProperty$4, "_defineProperty$4");
23871
- function _toConsumableArray(arr) {
23872
- if (Array.isArray(arr)) {
23873
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
23874
- arr2[i] = arr[i];
23675
+ if (newResolvedState.sortedData) {
23676
+ newResolvedState.pages = newResolvedState.manual ? newResolvedState.pages : Math.ceil(newResolvedState.sortedData.length / newResolvedState.pageSize);
23677
+ newResolvedState.page = newResolvedState.manual ? newResolvedState.page : Math.max(
23678
+ newResolvedState.page >= newResolvedState.pages ? newResolvedState.pages - 1 : newResolvedState.page,
23679
+ 0
23680
+ );
23875
23681
  }
23876
- return arr2;
23877
- } else {
23878
- return Array.from(arr);
23879
- }
23880
- }
23881
- __name(_toConsumableArray, "_toConsumableArray");
23882
- function _classCallCheck$g(instance, Constructor) {
23883
- if (!(instance instanceof Constructor)) {
23884
- throw new TypeError("Cannot call a class as a function");
23885
- }
23886
- }
23887
- __name(_classCallCheck$g, "_classCallCheck$g");
23888
- function _possibleConstructorReturn$g(self2, call2) {
23889
- if (!self2) {
23890
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
23682
+ return this.setState(newResolvedState, () => {
23683
+ if (cb) {
23684
+ cb();
23685
+ }
23686
+ if (oldState.page !== newResolvedState.page || oldState.pageSize !== newResolvedState.pageSize || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered) {
23687
+ this.fireFetchData();
23688
+ }
23689
+ });
23891
23690
  }
23892
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
23893
- }
23894
- __name(_possibleConstructorReturn$g, "_possibleConstructorReturn$g");
23895
- function _inherits$g(subClass, superClass) {
23896
- if (typeof superClass !== "function" && superClass !== null) {
23897
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
23691
+ }, "Lifecycle");
23692
+ const Methods = /* @__PURE__ */ __name((Base) => class extends Base {
23693
+ getResolvedState(props, state) {
23694
+ const resolvedState = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, _.compactObject(this.state)), _.compactObject(this.props)), _.compactObject(state)), _.compactObject(props));
23695
+ return resolvedState;
23898
23696
  }
23899
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
23900
- if (superClass)
23901
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
23902
- }
23903
- __name(_inherits$g, "_inherits$g");
23904
- const Methods = /* @__PURE__ */ __name(function(Base) {
23905
- return function(_Base) {
23906
- _inherits$g(_class, _Base);
23907
- function _class() {
23908
- _classCallCheck$g(this, _class);
23909
- return _possibleConstructorReturn$g(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
23910
- }
23911
- __name(_class, "_class");
23912
- _createClass$b(_class, [{
23913
- key: "getResolvedState",
23914
- value: /* @__PURE__ */ __name(function getResolvedState(props, state) {
23915
- var resolvedState = _extends$l({}, _.compactObject(this.state), _.compactObject(this.props), _.compactObject(state), _.compactObject(props));
23916
- return resolvedState;
23917
- }, "getResolvedState")
23918
- }, {
23919
- key: "getDataModel",
23920
- value: /* @__PURE__ */ __name(function getDataModel(newState) {
23921
- var _this2 = this;
23922
- var columns = newState.columns, _newState$pivotBy = newState.pivotBy, pivotBy = _newState$pivotBy === void 0 ? [] : _newState$pivotBy, data = newState.data, resolveData2 = newState.resolveData, pivotIDKey = newState.pivotIDKey, pivotValKey = newState.pivotValKey, subRowsKey = newState.subRowsKey, aggregatedKey = newState.aggregatedKey, nestingLevelKey = newState.nestingLevelKey, originalKey = newState.originalKey, indexKey = newState.indexKey, groupedByPivotKey = newState.groupedByPivotKey, SubComponent = newState.SubComponent;
23923
- var hasHeaderGroups = false;
23924
- columns.forEach(function(column) {
23925
- if (column.columns) {
23926
- hasHeaderGroups = true;
23927
- }
23697
+ getDataModel(newState) {
23698
+ const {
23699
+ columns,
23700
+ pivotBy = [],
23701
+ data,
23702
+ resolveData,
23703
+ pivotIDKey,
23704
+ pivotValKey,
23705
+ subRowsKey,
23706
+ aggregatedKey,
23707
+ nestingLevelKey,
23708
+ originalKey,
23709
+ indexKey,
23710
+ groupedByPivotKey,
23711
+ SubComponent
23712
+ } = newState;
23713
+ let hasHeaderGroups = false;
23714
+ columns.forEach((column) => {
23715
+ if (column.columns) {
23716
+ hasHeaderGroups = true;
23717
+ }
23718
+ });
23719
+ let columnsWithExpander = [...columns];
23720
+ let expanderColumn = columns.find(
23721
+ (col) => col.expander || col.columns && col.columns.some((col2) => col2.expander)
23722
+ );
23723
+ if (expanderColumn && !expanderColumn.expander) {
23724
+ expanderColumn = expanderColumn.columns.find((col) => col.expander);
23725
+ }
23726
+ if (SubComponent && !expanderColumn) {
23727
+ expanderColumn = { expander: true };
23728
+ columnsWithExpander = [expanderColumn, ...columnsWithExpander];
23729
+ }
23730
+ const makeDecoratedColumn = /* @__PURE__ */ __name((column, parentColumn) => {
23731
+ let dcol;
23732
+ if (column.expander) {
23733
+ dcol = __spreadValues(__spreadValues(__spreadValues({}, this.props.column), this.props.expanderDefaults), column);
23734
+ } else {
23735
+ dcol = __spreadValues(__spreadValues({}, this.props.column), column);
23736
+ }
23737
+ if (dcol.maxWidth < dcol.minWidth) {
23738
+ dcol.minWidth = dcol.maxWidth;
23739
+ }
23740
+ if (parentColumn) {
23741
+ dcol.parentColumn = parentColumn;
23742
+ }
23743
+ if (typeof dcol.accessor === "string") {
23744
+ dcol.id = dcol.id || dcol.accessor;
23745
+ const accessorString = dcol.accessor;
23746
+ dcol.accessor = (row) => _.get(row, accessorString);
23747
+ return dcol;
23748
+ }
23749
+ if (dcol.accessor && !dcol.id) {
23750
+ console.warn(dcol);
23751
+ throw new Error(
23752
+ "A column id is required if using a non-string accessor for column above."
23753
+ );
23754
+ }
23755
+ if (!dcol.accessor) {
23756
+ dcol.accessor = () => void 0;
23757
+ }
23758
+ return dcol;
23759
+ }, "makeDecoratedColumn");
23760
+ const allDecoratedColumns = [];
23761
+ const decorateAndAddToAll = /* @__PURE__ */ __name((column, parentColumn) => {
23762
+ const decoratedColumn = makeDecoratedColumn(column, parentColumn);
23763
+ allDecoratedColumns.push(decoratedColumn);
23764
+ return decoratedColumn;
23765
+ }, "decorateAndAddToAll");
23766
+ const decoratedColumns = columnsWithExpander.map((column) => {
23767
+ if (column.columns) {
23768
+ return __spreadProps(__spreadValues({}, column), {
23769
+ columns: column.columns.map((d2) => decorateAndAddToAll(d2, column))
23928
23770
  });
23929
- var columnsWithExpander = [].concat(_toConsumableArray(columns));
23930
- var expanderColumn = columns.find(function(col) {
23931
- return col.expander || col.columns && col.columns.some(function(col2) {
23932
- return col2.expander;
23933
- });
23771
+ }
23772
+ return decorateAndAddToAll(column);
23773
+ });
23774
+ let visibleColumns = decoratedColumns.slice();
23775
+ let allVisibleColumns = [];
23776
+ visibleColumns = visibleColumns.map((column) => {
23777
+ if (column.columns) {
23778
+ const visibleSubColumns = column.columns.filter(
23779
+ (d2) => pivotBy.indexOf(d2.id) > -1 ? false : _.getFirstDefined(d2.show, true)
23780
+ );
23781
+ return __spreadProps(__spreadValues({}, column), {
23782
+ columns: visibleSubColumns
23934
23783
  });
23935
- if (expanderColumn && !expanderColumn.expander) {
23936
- expanderColumn = expanderColumn.columns.find(function(col) {
23937
- return col.expander;
23938
- });
23784
+ }
23785
+ return column;
23786
+ });
23787
+ visibleColumns = visibleColumns.filter(
23788
+ (column) => column.columns ? column.columns.length : pivotBy.indexOf(column.id) > -1 ? false : _.getFirstDefined(column.show, true)
23789
+ );
23790
+ const pivotIndex = visibleColumns.findIndex((col) => col.pivot);
23791
+ if (pivotBy.length) {
23792
+ const pivotColumns = [];
23793
+ pivotBy.forEach((pivotID) => {
23794
+ const found = allDecoratedColumns.find((d2) => d2.id === pivotID);
23795
+ if (found) {
23796
+ pivotColumns.push(found);
23939
23797
  }
23940
- if (SubComponent && !expanderColumn) {
23941
- expanderColumn = { expander: true };
23942
- columnsWithExpander = [expanderColumn].concat(_toConsumableArray(columnsWithExpander));
23798
+ });
23799
+ const PivotParentColumn = pivotColumns.reduce(
23800
+ (prev, current) => prev && prev === current.parentColumn && current.parentColumn,
23801
+ pivotColumns[0].parentColumn
23802
+ );
23803
+ let PivotGroupHeader = hasHeaderGroups && PivotParentColumn.Header;
23804
+ PivotGroupHeader = PivotGroupHeader || (() => /* @__PURE__ */ React$1.createElement("strong", null, "Pivoted"));
23805
+ let pivotColumnGroup = {
23806
+ Header: PivotGroupHeader,
23807
+ columns: pivotColumns.map((col) => __spreadProps(__spreadValues(__spreadValues({}, this.props.pivotDefaults), col), {
23808
+ pivoted: true
23809
+ }))
23810
+ };
23811
+ if (pivotIndex >= 0) {
23812
+ pivotColumnGroup = __spreadValues(__spreadValues({}, visibleColumns[pivotIndex]), pivotColumnGroup);
23813
+ visibleColumns.splice(pivotIndex, 1, pivotColumnGroup);
23814
+ } else {
23815
+ visibleColumns.unshift(pivotColumnGroup);
23816
+ }
23817
+ }
23818
+ const headerGroups = [];
23819
+ let currentSpan = [];
23820
+ const addHeader = /* @__PURE__ */ __name((columns2, column) => {
23821
+ headerGroups.push(__spreadProps(__spreadValues(__spreadValues({}, this.props.column), column), {
23822
+ columns: columns2
23823
+ }));
23824
+ currentSpan = [];
23825
+ }, "addHeader");
23826
+ visibleColumns.forEach((column) => {
23827
+ if (column.columns) {
23828
+ allVisibleColumns = allVisibleColumns.concat(column.columns);
23829
+ if (currentSpan.length > 0) {
23830
+ addHeader(currentSpan);
23943
23831
  }
23944
- var makeDecoratedColumn = /* @__PURE__ */ __name(function makeDecoratedColumn2(column, parentColumn) {
23945
- var dcol = void 0;
23946
- if (column.expander) {
23947
- dcol = _extends$l({}, _this2.props.column, _this2.props.expanderDefaults, column);
23948
- } else {
23949
- dcol = _extends$l({}, _this2.props.column, column);
23950
- }
23951
- if (dcol.maxWidth < dcol.minWidth) {
23952
- dcol.minWidth = dcol.maxWidth;
23953
- }
23954
- if (parentColumn) {
23955
- dcol.parentColumn = parentColumn;
23956
- }
23957
- if (typeof dcol.accessor === "string") {
23958
- dcol.id = dcol.id || dcol.accessor;
23959
- var accessorString = dcol.accessor;
23960
- dcol.accessor = function(row) {
23961
- return _.get(row, accessorString);
23962
- };
23963
- return dcol;
23964
- }
23965
- if (dcol.accessor && !dcol.id) {
23966
- console.warn(dcol);
23967
- throw new Error("A column id is required if using a non-string accessor for column above.");
23968
- }
23969
- if (!dcol.accessor) {
23970
- dcol.accessor = function() {
23971
- return void 0;
23972
- };
23973
- }
23974
- return dcol;
23975
- }, "makeDecoratedColumn");
23976
- var allDecoratedColumns = [];
23977
- var decorateAndAddToAll = /* @__PURE__ */ __name(function decorateAndAddToAll2(column, parentColumn) {
23978
- var decoratedColumn = makeDecoratedColumn(column, parentColumn);
23979
- allDecoratedColumns.push(decoratedColumn);
23980
- return decoratedColumn;
23981
- }, "decorateAndAddToAll");
23982
- var decoratedColumns = columnsWithExpander.map(function(column) {
23983
- if (column.columns) {
23984
- return _extends$l({}, column, {
23985
- columns: column.columns.map(function(d2) {
23986
- return decorateAndAddToAll(d2, column);
23987
- })
23988
- });
23989
- }
23990
- return decorateAndAddToAll(column);
23991
- });
23992
- var visibleColumns = decoratedColumns.slice();
23993
- var allVisibleColumns = [];
23994
- visibleColumns = visibleColumns.map(function(column) {
23995
- if (column.columns) {
23996
- var visibleSubColumns = column.columns.filter(function(d2) {
23997
- return pivotBy.indexOf(d2.id) > -1 ? false : _.getFirstDefined(d2.show, true);
23998
- });
23999
- return _extends$l({}, column, {
24000
- columns: visibleSubColumns
24001
- });
24002
- }
24003
- return column;
24004
- });
24005
- visibleColumns = visibleColumns.filter(function(column) {
24006
- return column.columns ? column.columns.length : pivotBy.indexOf(column.id) > -1 ? false : _.getFirstDefined(column.show, true);
24007
- });
24008
- var pivotIndex = visibleColumns.findIndex(function(col) {
24009
- return col.pivot;
23832
+ addHeader(column.columns, column);
23833
+ return;
23834
+ }
23835
+ allVisibleColumns.push(column);
23836
+ currentSpan.push(column);
23837
+ });
23838
+ if (hasHeaderGroups && currentSpan.length > 0) {
23839
+ addHeader(currentSpan);
23840
+ }
23841
+ const accessRow = /* @__PURE__ */ __name((d2, i, level = 0) => {
23842
+ const row = {
23843
+ [originalKey]: d2,
23844
+ [indexKey]: i,
23845
+ [subRowsKey]: d2[subRowsKey],
23846
+ [nestingLevelKey]: level
23847
+ };
23848
+ allDecoratedColumns.forEach((column) => {
23849
+ if (column.expander)
23850
+ return;
23851
+ row[column.id] = column.accessor(d2);
23852
+ });
23853
+ if (row[subRowsKey]) {
23854
+ row[subRowsKey] = row[subRowsKey].map((d22, i2) => accessRow(d22, i2, level + 1));
23855
+ }
23856
+ return row;
23857
+ }, "accessRow");
23858
+ let resolvedData = resolveData(data).map((d2, i) => accessRow(d2, i));
23859
+ const aggregatingColumns = allVisibleColumns.filter((d2) => !d2.expander && d2.aggregate);
23860
+ const aggregate = /* @__PURE__ */ __name((rows) => {
23861
+ const aggregationValues = {};
23862
+ aggregatingColumns.forEach((column) => {
23863
+ const values = rows.map((d2) => d2[column.id]);
23864
+ aggregationValues[column.id] = column.aggregate(values, rows);
23865
+ });
23866
+ return aggregationValues;
23867
+ }, "aggregate");
23868
+ if (pivotBy.length) {
23869
+ const groupRecursively = /* @__PURE__ */ __name((rows, keys3, i = 0) => {
23870
+ if (i === keys3.length) {
23871
+ return rows;
23872
+ }
23873
+ let groupedRows = Object.entries(_.groupBy(rows, keys3[i])).map(([key, value]) => ({
23874
+ [pivotIDKey]: keys3[i],
23875
+ [pivotValKey]: key,
23876
+ [keys3[i]]: key,
23877
+ [subRowsKey]: value,
23878
+ [nestingLevelKey]: i,
23879
+ [groupedByPivotKey]: true
23880
+ }));
23881
+ groupedRows = groupedRows.map((rowGroup) => {
23882
+ const subRows = groupRecursively(rowGroup[subRowsKey], keys3, i + 1);
23883
+ return __spreadValues(__spreadProps(__spreadValues({}, rowGroup), {
23884
+ [subRowsKey]: subRows,
23885
+ [aggregatedKey]: true
23886
+ }), aggregate(subRows));
24010
23887
  });
24011
- if (pivotBy.length) {
24012
- var pivotColumns = [];
24013
- pivotBy.forEach(function(pivotID) {
24014
- var found = allDecoratedColumns.find(function(d2) {
24015
- return d2.id === pivotID;
24016
- });
24017
- if (found) {
24018
- pivotColumns.push(found);
24019
- }
24020
- });
24021
- var PivotParentColumn = pivotColumns.reduce(function(prev, current) {
24022
- return prev && prev === current.parentColumn && current.parentColumn;
24023
- }, pivotColumns[0].parentColumn);
24024
- var PivotGroupHeader = hasHeaderGroups && PivotParentColumn.Header;
24025
- PivotGroupHeader = PivotGroupHeader || function() {
24026
- return React$1.createElement(
24027
- "strong",
24028
- null,
24029
- "Pivoted"
24030
- );
24031
- };
24032
- var pivotColumnGroup = {
24033
- Header: PivotGroupHeader,
24034
- columns: pivotColumns.map(function(col) {
24035
- return _extends$l({}, _this2.props.pivotDefaults, col, {
24036
- pivoted: true
24037
- });
24038
- })
24039
- // Place the pivotColumns back into the visibleColumns
24040
- };
24041
- if (pivotIndex >= 0) {
24042
- pivotColumnGroup = _extends$l({}, visibleColumns[pivotIndex], pivotColumnGroup);
24043
- visibleColumns.splice(pivotIndex, 1, pivotColumnGroup);
24044
- } else {
24045
- visibleColumns.unshift(pivotColumnGroup);
24046
- }
23888
+ return groupedRows;
23889
+ }, "groupRecursively");
23890
+ resolvedData = groupRecursively(resolvedData, pivotBy);
23891
+ }
23892
+ return __spreadProps(__spreadValues({}, newState), {
23893
+ resolvedData,
23894
+ allVisibleColumns,
23895
+ headerGroups,
23896
+ allDecoratedColumns,
23897
+ hasHeaderGroups
23898
+ });
23899
+ }
23900
+ getSortedData(resolvedState) {
23901
+ const {
23902
+ manual,
23903
+ sorted,
23904
+ filtered,
23905
+ defaultFilterMethod,
23906
+ resolvedData,
23907
+ allVisibleColumns,
23908
+ allDecoratedColumns
23909
+ } = resolvedState;
23910
+ const sortMethodsByColumnID = {};
23911
+ allDecoratedColumns.filter((col) => col.sortMethod).forEach((col) => {
23912
+ sortMethodsByColumnID[col.id] = col.sortMethod;
23913
+ });
23914
+ return {
23915
+ sortedData: manual ? resolvedData : this.sortData(
23916
+ this.filterData(resolvedData, filtered, defaultFilterMethod, allVisibleColumns),
23917
+ sorted,
23918
+ sortMethodsByColumnID
23919
+ )
23920
+ };
23921
+ }
23922
+ fireFetchData() {
23923
+ this.props.onFetchData(this.getResolvedState(), this);
23924
+ }
23925
+ getPropOrState(key) {
23926
+ return _.getFirstDefined(this.props[key], this.state[key]);
23927
+ }
23928
+ getStateOrProp(key) {
23929
+ return _.getFirstDefined(this.state[key], this.props[key]);
23930
+ }
23931
+ filterData(data, filtered, defaultFilterMethod, allVisibleColumns) {
23932
+ let filteredData = data;
23933
+ if (filtered.length) {
23934
+ filteredData = filtered.reduce((filteredSoFar, nextFilter) => {
23935
+ const column = allVisibleColumns.find((x2) => x2.id === nextFilter.id);
23936
+ if (!column || column.filterable === false) {
23937
+ return filteredSoFar;
24047
23938
  }
24048
- var headerGroups = [];
24049
- var currentSpan = [];
24050
- var addHeader = /* @__PURE__ */ __name(function addHeader2(columns2, column) {
24051
- headerGroups.push(_extends$l({}, _this2.props.column, column, {
24052
- columns: columns2
24053
- }));
24054
- currentSpan = [];
24055
- }, "addHeader");
24056
- visibleColumns.forEach(function(column) {
24057
- if (column.columns) {
24058
- allVisibleColumns = allVisibleColumns.concat(column.columns);
24059
- if (currentSpan.length > 0) {
24060
- addHeader(currentSpan);
24061
- }
24062
- addHeader(column.columns, column);
24063
- return;
24064
- }
24065
- allVisibleColumns.push(column);
24066
- currentSpan.push(column);
24067
- });
24068
- if (hasHeaderGroups && currentSpan.length > 0) {
24069
- addHeader(currentSpan);
23939
+ const filterMethod = column.filterMethod || defaultFilterMethod;
23940
+ if (column.filterAll) {
23941
+ return filterMethod(nextFilter, filteredSoFar, column);
24070
23942
  }
24071
- var accessRow = /* @__PURE__ */ __name(function accessRow2(d2, i) {
24072
- var _row;
24073
- var level = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
24074
- var row = (_row = {}, _defineProperty$4(_row, originalKey, d2), _defineProperty$4(_row, indexKey, i), _defineProperty$4(_row, subRowsKey, d2[subRowsKey]), _defineProperty$4(_row, nestingLevelKey, level), _row);
24075
- allDecoratedColumns.forEach(function(column) {
24076
- if (column.expander)
24077
- return;
24078
- row[column.id] = column.accessor(d2);
24079
- });
24080
- if (row[subRowsKey]) {
24081
- row[subRowsKey] = row[subRowsKey].map(function(d3, i2) {
24082
- return accessRow2(d3, i2, level + 1);
24083
- });
24084
- }
23943
+ return filteredSoFar.filter((row) => filterMethod(nextFilter, row, column));
23944
+ }, filteredData);
23945
+ filteredData = filteredData.map((row) => {
23946
+ if (!row[this.props.subRowsKey]) {
24085
23947
  return row;
24086
- }, "accessRow");
24087
- var resolvedData = resolveData2(data).map(function(d2, i) {
24088
- return accessRow(d2, i);
24089
- });
24090
- var aggregatingColumns = allVisibleColumns.filter(function(d2) {
24091
- return !d2.expander && d2.aggregate;
24092
- });
24093
- var aggregate = /* @__PURE__ */ __name(function aggregate2(rows) {
24094
- var aggregationValues = {};
24095
- aggregatingColumns.forEach(function(column) {
24096
- var values = rows.map(function(d2) {
24097
- return d2[column.id];
24098
- });
24099
- aggregationValues[column.id] = column.aggregate(values, rows);
24100
- });
24101
- return aggregationValues;
24102
- }, "aggregate");
24103
- if (pivotBy.length) {
24104
- var groupRecursively = /* @__PURE__ */ __name(function groupRecursively2(rows, keys3) {
24105
- var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
24106
- if (i === keys3.length) {
24107
- return rows;
24108
- }
24109
- var groupedRows = Object.entries(_.groupBy(rows, keys3[i])).map(function(_ref) {
24110
- var _ref3;
24111
- var _ref2 = _slicedToArray$4(_ref, 2), key = _ref2[0], value = _ref2[1];
24112
- return _ref3 = {}, _defineProperty$4(_ref3, pivotIDKey, keys3[i]), _defineProperty$4(_ref3, pivotValKey, key), _defineProperty$4(_ref3, keys3[i], key), _defineProperty$4(_ref3, subRowsKey, value), _defineProperty$4(_ref3, nestingLevelKey, i), _defineProperty$4(_ref3, groupedByPivotKey, true), _ref3;
24113
- });
24114
- groupedRows = groupedRows.map(function(rowGroup) {
24115
- var _extends2;
24116
- var subRows = groupRecursively2(rowGroup[subRowsKey], keys3, i + 1);
24117
- return _extends$l({}, rowGroup, (_extends2 = {}, _defineProperty$4(_extends2, subRowsKey, subRows), _defineProperty$4(_extends2, aggregatedKey, true), _extends2), aggregate(subRows));
24118
- });
24119
- return groupedRows;
24120
- }, "groupRecursively");
24121
- resolvedData = groupRecursively(resolvedData, pivotBy);
24122
- }
24123
- return _extends$l({}, newState, {
24124
- resolvedData,
24125
- allVisibleColumns,
24126
- headerGroups,
24127
- allDecoratedColumns,
24128
- hasHeaderGroups
24129
- });
24130
- }, "getDataModel")
24131
- }, {
24132
- key: "getSortedData",
24133
- value: /* @__PURE__ */ __name(function getSortedData(resolvedState) {
24134
- var manual = resolvedState.manual, sorted = resolvedState.sorted, filtered = resolvedState.filtered, defaultFilterMethod2 = resolvedState.defaultFilterMethod, resolvedData = resolvedState.resolvedData, allVisibleColumns = resolvedState.allVisibleColumns, allDecoratedColumns = resolvedState.allDecoratedColumns;
24135
- var sortMethodsByColumnID = {};
24136
- allDecoratedColumns.filter(function(col) {
24137
- return col.sortMethod;
24138
- }).forEach(function(col) {
24139
- sortMethodsByColumnID[col.id] = col.sortMethod;
24140
- });
24141
- return {
24142
- sortedData: manual ? resolvedData : this.sortData(this.filterData(resolvedData, filtered, defaultFilterMethod2, allVisibleColumns), sorted, sortMethodsByColumnID)
24143
- };
24144
- }, "getSortedData")
24145
- }, {
24146
- key: "fireFetchData",
24147
- value: /* @__PURE__ */ __name(function fireFetchData() {
24148
- this.props.onFetchData(this.getResolvedState(), this);
24149
- }, "fireFetchData")
24150
- }, {
24151
- key: "getPropOrState",
24152
- value: /* @__PURE__ */ __name(function getPropOrState(key) {
24153
- return _.getFirstDefined(this.props[key], this.state[key]);
24154
- }, "getPropOrState")
24155
- }, {
24156
- key: "getStateOrProp",
24157
- value: /* @__PURE__ */ __name(function getStateOrProp(key) {
24158
- return _.getFirstDefined(this.state[key], this.props[key]);
24159
- }, "getStateOrProp")
24160
- }, {
24161
- key: "filterData",
24162
- value: /* @__PURE__ */ __name(function filterData(data, filtered, defaultFilterMethod2, allVisibleColumns) {
24163
- var _this3 = this;
24164
- var filteredData = data;
24165
- if (filtered.length) {
24166
- filteredData = filtered.reduce(function(filteredSoFar, nextFilter) {
24167
- var column = allVisibleColumns.find(function(x2) {
24168
- return x2.id === nextFilter.id;
24169
- });
24170
- if (!column || column.filterable === false) {
24171
- return filteredSoFar;
24172
- }
24173
- var filterMethod = column.filterMethod || defaultFilterMethod2;
24174
- if (column.filterAll) {
24175
- return filterMethod(nextFilter, filteredSoFar, column);
24176
- }
24177
- return filteredSoFar.filter(function(row) {
24178
- return filterMethod(nextFilter, row, column);
24179
- });
24180
- }, filteredData);
24181
- filteredData = filteredData.map(function(row) {
24182
- if (!row[_this3.props.subRowsKey]) {
24183
- return row;
24184
- }
24185
- return _extends$l({}, row, _defineProperty$4({}, _this3.props.subRowsKey, _this3.filterData(row[_this3.props.subRowsKey], filtered, defaultFilterMethod2, allVisibleColumns)));
24186
- }).filter(function(row) {
24187
- if (!row[_this3.props.subRowsKey]) {
24188
- return true;
24189
- }
24190
- return row[_this3.props.subRowsKey].length > 0;
24191
- });
24192
- }
24193
- return filteredData;
24194
- }, "filterData")
24195
- }, {
24196
- key: "sortData",
24197
- value: /* @__PURE__ */ __name(function sortData(data, sorted) {
24198
- var _this4 = this;
24199
- var sortMethodsByColumnID = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
24200
- if (!sorted.length) {
24201
- return data;
24202
23948
  }
24203
- var sortedData = (this.props.orderByMethod || _.orderBy)(data, sorted.map(function(sort2) {
24204
- if (sortMethodsByColumnID[sort2.id]) {
24205
- return function(a2, b2) {
24206
- return sortMethodsByColumnID[sort2.id](a2[sort2.id], b2[sort2.id], sort2.desc);
24207
- };
24208
- }
24209
- return function(a2, b2) {
24210
- return _this4.props.defaultSortMethod(a2[sort2.id], b2[sort2.id], sort2.desc);
24211
- };
24212
- }), sorted.map(function(d2) {
24213
- return !d2.desc;
24214
- }), this.props.indexKey);
24215
- sortedData.forEach(function(row) {
24216
- if (!row[_this4.props.subRowsKey]) {
24217
- return;
24218
- }
24219
- row[_this4.props.subRowsKey] = _this4.sortData(row[_this4.props.subRowsKey], sorted, sortMethodsByColumnID);
24220
- });
24221
- return sortedData;
24222
- }, "sortData")
24223
- }, {
24224
- key: "getMinRows",
24225
- value: /* @__PURE__ */ __name(function getMinRows() {
24226
- return _.getFirstDefined(this.props.minRows, this.getStateOrProp("pageSize"));
24227
- }, "getMinRows")
24228
- // User actions
24229
- }, {
24230
- key: "onPageChange",
24231
- value: /* @__PURE__ */ __name(function onPageChange(page) {
24232
- var _props = this.props, onPageChange2 = _props.onPageChange, collapseOnPageChange = _props.collapseOnPageChange;
24233
- var newState = { page };
24234
- if (collapseOnPageChange) {
24235
- newState.expanded = {};
24236
- }
24237
- this.setStateWithData(newState, function() {
24238
- return onPageChange2 && onPageChange2(page);
24239
- });
24240
- }, "onPageChange")
24241
- }, {
24242
- key: "onPageSizeChange",
24243
- value: /* @__PURE__ */ __name(function onPageSizeChange(newPageSize) {
24244
- var onPageSizeChange2 = this.props.onPageSizeChange;
24245
- var _getResolvedState = this.getResolvedState(), pageSize = _getResolvedState.pageSize, page = _getResolvedState.page;
24246
- var currentRow = pageSize * page;
24247
- var newPage = Math.floor(currentRow / newPageSize);
24248
- this.setStateWithData({
24249
- pageSize: newPageSize,
24250
- page: newPage
24251
- }, function() {
24252
- return onPageSizeChange2 && onPageSizeChange2(newPageSize, newPage);
23949
+ return __spreadProps(__spreadValues({}, row), {
23950
+ [this.props.subRowsKey]: this.filterData(
23951
+ row[this.props.subRowsKey],
23952
+ filtered,
23953
+ defaultFilterMethod,
23954
+ allVisibleColumns
23955
+ )
24253
23956
  });
24254
- }, "onPageSizeChange")
24255
- }, {
24256
- key: "sortColumn",
24257
- value: /* @__PURE__ */ __name(function sortColumn(column, additive) {
24258
- var _getResolvedState2 = this.getResolvedState(), sorted = _getResolvedState2.sorted, skipNextSort = _getResolvedState2.skipNextSort, defaultSortDesc = _getResolvedState2.defaultSortDesc;
24259
- var firstSortDirection = Object.prototype.hasOwnProperty.call(column, "defaultSortDesc") ? column.defaultSortDesc : defaultSortDesc;
24260
- var secondSortDirection = !firstSortDirection;
24261
- if (skipNextSort) {
24262
- this.setStateWithData({
24263
- skipNextSort: false
24264
- });
24265
- return;
23957
+ }).filter((row) => {
23958
+ if (!row[this.props.subRowsKey]) {
23959
+ return true;
24266
23960
  }
24267
- var onSortedChange = this.props.onSortedChange;
24268
- var newSorted = _.clone(sorted || []).map(function(d2) {
24269
- d2.desc = _.isSortingDesc(d2);
24270
- return d2;
24271
- });
24272
- if (!_.isArray(column)) {
24273
- var existingIndex = newSorted.findIndex(function(d2) {
24274
- return d2.id === column.id;
24275
- });
24276
- if (existingIndex > -1) {
24277
- var existing = newSorted[existingIndex];
24278
- if (existing.desc === secondSortDirection) {
24279
- if (additive) {
24280
- newSorted.splice(existingIndex, 1);
24281
- } else {
24282
- existing.desc = firstSortDirection;
24283
- newSorted = [existing];
24284
- }
24285
- } else {
24286
- existing.desc = secondSortDirection;
24287
- if (!additive) {
24288
- newSorted = [existing];
24289
- }
24290
- }
24291
- } else if (additive) {
24292
- newSorted.push({
24293
- id: column.id,
24294
- desc: firstSortDirection
24295
- });
23961
+ return row[this.props.subRowsKey].length > 0;
23962
+ });
23963
+ }
23964
+ return filteredData;
23965
+ }
23966
+ sortData(data, sorted, sortMethodsByColumnID = {}) {
23967
+ if (!sorted.length) {
23968
+ return data;
23969
+ }
23970
+ const sortedData = (this.props.orderByMethod || _.orderBy)(
23971
+ data,
23972
+ sorted.map((sort2) => {
23973
+ if (sortMethodsByColumnID[sort2.id]) {
23974
+ return (a2, b2) => sortMethodsByColumnID[sort2.id](a2[sort2.id], b2[sort2.id], sort2.desc);
23975
+ }
23976
+ return (a2, b2) => this.props.defaultSortMethod(a2[sort2.id], b2[sort2.id], sort2.desc);
23977
+ }),
23978
+ sorted.map((d2) => !d2.desc),
23979
+ this.props.indexKey
23980
+ );
23981
+ sortedData.forEach((row) => {
23982
+ if (!row[this.props.subRowsKey]) {
23983
+ return;
23984
+ }
23985
+ row[this.props.subRowsKey] = this.sortData(
23986
+ row[this.props.subRowsKey],
23987
+ sorted,
23988
+ sortMethodsByColumnID
23989
+ );
23990
+ });
23991
+ return sortedData;
23992
+ }
23993
+ getMinRows() {
23994
+ return _.getFirstDefined(this.props.minRows, this.getStateOrProp("pageSize"));
23995
+ }
23996
+ // User actions
23997
+ onPageChange(page) {
23998
+ const { onPageChange, collapseOnPageChange } = this.props;
23999
+ const newState = { page };
24000
+ if (collapseOnPageChange) {
24001
+ newState.expanded = {};
24002
+ }
24003
+ this.setStateWithData(newState, () => onPageChange && onPageChange(page));
24004
+ }
24005
+ onPageSizeChange(newPageSize) {
24006
+ const { onPageSizeChange } = this.props;
24007
+ const { pageSize, page } = this.getResolvedState();
24008
+ const currentRow = pageSize * page;
24009
+ const newPage = Math.floor(currentRow / newPageSize);
24010
+ this.setStateWithData(
24011
+ {
24012
+ pageSize: newPageSize,
24013
+ page: newPage
24014
+ },
24015
+ () => onPageSizeChange && onPageSizeChange(newPageSize, newPage)
24016
+ );
24017
+ }
24018
+ sortColumn(column, additive) {
24019
+ const { sorted, skipNextSort, defaultSortDesc } = this.getResolvedState();
24020
+ const firstSortDirection = Object.prototype.hasOwnProperty.call(column, "defaultSortDesc") ? column.defaultSortDesc : defaultSortDesc;
24021
+ const secondSortDirection = !firstSortDirection;
24022
+ if (skipNextSort) {
24023
+ this.setStateWithData({
24024
+ skipNextSort: false
24025
+ });
24026
+ return;
24027
+ }
24028
+ const { onSortedChange } = this.props;
24029
+ let newSorted = _.clone(sorted || []).map((d2) => {
24030
+ d2.desc = _.isSortingDesc(d2);
24031
+ return d2;
24032
+ });
24033
+ if (!_.isArray(column)) {
24034
+ const existingIndex = newSorted.findIndex((d2) => d2.id === column.id);
24035
+ if (existingIndex > -1) {
24036
+ const existing = newSorted[existingIndex];
24037
+ if (existing.desc === secondSortDirection) {
24038
+ if (additive) {
24039
+ newSorted.splice(existingIndex, 1);
24296
24040
  } else {
24297
- newSorted = [{
24298
- id: column.id,
24299
- desc: firstSortDirection
24300
- }];
24041
+ existing.desc = firstSortDirection;
24042
+ newSorted = [existing];
24301
24043
  }
24302
24044
  } else {
24303
- var _existingIndex = newSorted.findIndex(function(d2) {
24304
- return d2.id === column[0].id;
24305
- });
24306
- if (_existingIndex > -1) {
24307
- var _existing = newSorted[_existingIndex];
24308
- if (_existing.desc === secondSortDirection) {
24309
- if (additive) {
24310
- newSorted.splice(_existingIndex, column.length);
24311
- } else {
24312
- column.forEach(function(d2, i) {
24313
- newSorted[_existingIndex + i].desc = firstSortDirection;
24314
- });
24315
- }
24316
- } else {
24317
- column.forEach(function(d2, i) {
24318
- newSorted[_existingIndex + i].desc = secondSortDirection;
24319
- });
24320
- }
24321
- if (!additive) {
24322
- newSorted = newSorted.slice(_existingIndex, column.length);
24323
- }
24324
- } else if (additive) {
24325
- newSorted = newSorted.concat(column.map(function(d2) {
24326
- return {
24327
- id: d2.id,
24328
- desc: firstSortDirection
24329
- };
24330
- }));
24331
- } else {
24332
- newSorted = column.map(function(d2) {
24333
- return {
24334
- id: d2.id,
24335
- desc: firstSortDirection
24336
- };
24337
- });
24045
+ existing.desc = secondSortDirection;
24046
+ if (!additive) {
24047
+ newSorted = [existing];
24338
24048
  }
24339
24049
  }
24340
- this.setStateWithData({
24341
- page: !sorted.length && newSorted.length || !additive ? 0 : this.state.page,
24342
- sorted: newSorted
24343
- }, function() {
24344
- return onSortedChange && onSortedChange(newSorted, column, additive);
24345
- });
24346
- }, "sortColumn")
24347
- }, {
24348
- key: "filterColumn",
24349
- value: /* @__PURE__ */ __name(function filterColumn(column, value) {
24350
- var _getResolvedState3 = this.getResolvedState(), filtered = _getResolvedState3.filtered;
24351
- var onFilteredChange = this.props.onFilteredChange;
24352
- var newFiltering = (filtered || []).filter(function(x2) {
24353
- return x2.id !== column.id;
24354
- });
24355
- if (value !== "") {
24356
- newFiltering.push({
24357
- id: column.id,
24358
- value
24359
- });
24360
- }
24361
- this.setStateWithData({
24362
- filtered: newFiltering
24363
- }, function() {
24364
- return onFilteredChange && onFilteredChange(newFiltering, column, value);
24050
+ } else if (additive) {
24051
+ newSorted.push({
24052
+ id: column.id,
24053
+ desc: firstSortDirection
24365
24054
  });
24366
- }, "filterColumn")
24367
- }, {
24368
- key: "resizeColumnStart",
24369
- value: /* @__PURE__ */ __name(function resizeColumnStart(event, column, isTouch) {
24370
- var _this5 = this;
24371
- event.stopPropagation();
24372
- var parentWidth = event.target.parentElement.getBoundingClientRect().width;
24373
- var pageX = void 0;
24374
- if (isTouch) {
24375
- pageX = event.changedTouches[0].pageX;
24376
- } else {
24377
- pageX = event.pageX;
24378
- }
24379
- this.trapEvents = true;
24380
- this.setStateWithData({
24381
- currentlyResizing: {
24055
+ } else {
24056
+ newSorted = [
24057
+ {
24382
24058
  id: column.id,
24383
- startX: pageX,
24384
- parentWidth
24059
+ desc: firstSortDirection
24385
24060
  }
24386
- }, function() {
24387
- if (isTouch) {
24388
- document.addEventListener("touchmove", _this5.resizeColumnMoving);
24389
- document.addEventListener("touchcancel", _this5.resizeColumnEnd);
24390
- document.addEventListener("touchend", _this5.resizeColumnEnd);
24061
+ ];
24062
+ }
24063
+ } else {
24064
+ const existingIndex = newSorted.findIndex((d2) => d2.id === column[0].id);
24065
+ if (existingIndex > -1) {
24066
+ const existing = newSorted[existingIndex];
24067
+ if (existing.desc === secondSortDirection) {
24068
+ if (additive) {
24069
+ newSorted.splice(existingIndex, column.length);
24391
24070
  } else {
24392
- document.addEventListener("mousemove", _this5.resizeColumnMoving);
24393
- document.addEventListener("mouseup", _this5.resizeColumnEnd);
24394
- document.addEventListener("mouseleave", _this5.resizeColumnEnd);
24071
+ column.forEach((d2, i) => {
24072
+ newSorted[existingIndex + i].desc = firstSortDirection;
24073
+ });
24395
24074
  }
24396
- });
24397
- }, "resizeColumnStart")
24398
- }, {
24399
- key: "resizeColumnMoving",
24400
- value: /* @__PURE__ */ __name(function resizeColumnMoving(event) {
24401
- event.stopPropagation();
24402
- var onResizedChange = this.props.onResizedChange;
24403
- var _getResolvedState4 = this.getResolvedState(), resized = _getResolvedState4.resized, currentlyResizing = _getResolvedState4.currentlyResizing;
24404
- var newResized = resized.filter(function(x2) {
24405
- return x2.id !== currentlyResizing.id;
24406
- });
24407
- var pageX = void 0;
24408
- if (event.type === "touchmove") {
24409
- pageX = event.changedTouches[0].pageX;
24410
- } else if (event.type === "mousemove") {
24411
- pageX = event.pageX;
24412
- }
24413
- var newWidth = Math.max(currentlyResizing.parentWidth + pageX - currentlyResizing.startX, 11);
24414
- newResized.push({
24415
- id: currentlyResizing.id,
24416
- value: newWidth
24417
- });
24418
- this.setStateWithData({
24419
- resized: newResized
24420
- }, function() {
24421
- return onResizedChange && onResizedChange(newResized, event);
24422
- });
24423
- }, "resizeColumnMoving")
24424
- }, {
24425
- key: "resizeColumnEnd",
24426
- value: /* @__PURE__ */ __name(function resizeColumnEnd(event) {
24427
- event.stopPropagation();
24428
- var isTouch = event.type === "touchend" || event.type === "touchcancel";
24429
- if (isTouch) {
24430
- document.removeEventListener("touchmove", this.resizeColumnMoving);
24431
- document.removeEventListener("touchcancel", this.resizeColumnEnd);
24432
- document.removeEventListener("touchend", this.resizeColumnEnd);
24433
- }
24434
- document.removeEventListener("mousemove", this.resizeColumnMoving);
24435
- document.removeEventListener("mouseup", this.resizeColumnEnd);
24436
- document.removeEventListener("mouseleave", this.resizeColumnEnd);
24437
- if (!isTouch) {
24438
- this.setStateWithData({
24439
- skipNextSort: true,
24440
- currentlyResizing: false
24075
+ } else {
24076
+ column.forEach((d2, i) => {
24077
+ newSorted[existingIndex + i].desc = secondSortDirection;
24441
24078
  });
24442
24079
  }
24443
- }, "resizeColumnEnd")
24444
- }]);
24445
- return _class;
24446
- }(Base);
24447
- }, "Methods");
24448
- var _createClass$a = function() {
24449
- function defineProperties2(target, props) {
24450
- for (var i = 0; i < props.length; i++) {
24451
- var descriptor2 = props[i];
24452
- descriptor2.enumerable = descriptor2.enumerable || false;
24453
- descriptor2.configurable = true;
24454
- if ("value" in descriptor2)
24455
- descriptor2.writable = true;
24456
- Object.defineProperty(target, descriptor2.key, descriptor2);
24080
+ if (!additive) {
24081
+ newSorted = newSorted.slice(existingIndex, column.length);
24082
+ }
24083
+ } else if (additive) {
24084
+ newSorted = newSorted.concat(
24085
+ column.map((d2) => ({
24086
+ id: d2.id,
24087
+ desc: firstSortDirection
24088
+ }))
24089
+ );
24090
+ } else {
24091
+ newSorted = column.map((d2) => ({
24092
+ id: d2.id,
24093
+ desc: firstSortDirection
24094
+ }));
24095
+ }
24457
24096
  }
24097
+ this.setStateWithData(
24098
+ {
24099
+ page: !sorted.length && newSorted.length || !additive ? 0 : this.state.page,
24100
+ sorted: newSorted
24101
+ },
24102
+ () => onSortedChange && onSortedChange(newSorted, column, additive)
24103
+ );
24458
24104
  }
24459
- __name(defineProperties2, "defineProperties");
24460
- return function(Constructor, protoProps, staticProps) {
24461
- if (protoProps)
24462
- defineProperties2(Constructor.prototype, protoProps);
24463
- if (staticProps)
24464
- defineProperties2(Constructor, staticProps);
24465
- return Constructor;
24466
- };
24467
- }();
24468
- var _extends$k = Object.assign || function(target) {
24469
- for (var i = 1; i < arguments.length; i++) {
24470
- var source = arguments[i];
24471
- for (var key in source) {
24472
- if (Object.prototype.hasOwnProperty.call(source, key)) {
24473
- target[key] = source[key];
24474
- }
24105
+ filterColumn(column, value) {
24106
+ const { filtered } = this.getResolvedState();
24107
+ const { onFilteredChange } = this.props;
24108
+ const newFiltering = (filtered || []).filter((x2) => x2.id !== column.id);
24109
+ if (value !== "") {
24110
+ newFiltering.push({
24111
+ id: column.id,
24112
+ value
24113
+ });
24475
24114
  }
24115
+ this.setStateWithData(
24116
+ {
24117
+ filtered: newFiltering
24118
+ },
24119
+ () => onFilteredChange && onFilteredChange(newFiltering, column, value)
24120
+ );
24476
24121
  }
24477
- return target;
24478
- };
24479
- function _classCallCheck$f(instance, Constructor) {
24480
- if (!(instance instanceof Constructor)) {
24481
- throw new TypeError("Cannot call a class as a function");
24122
+ resizeColumnStart(event, column, isTouch) {
24123
+ event.stopPropagation();
24124
+ const parentWidth = event.target.parentElement.getBoundingClientRect().width;
24125
+ let pageX;
24126
+ if (isTouch) {
24127
+ pageX = event.changedTouches[0].pageX;
24128
+ } else {
24129
+ pageX = event.pageX;
24130
+ }
24131
+ this.trapEvents = true;
24132
+ this.setStateWithData(
24133
+ {
24134
+ currentlyResizing: {
24135
+ id: column.id,
24136
+ startX: pageX,
24137
+ parentWidth
24138
+ }
24139
+ },
24140
+ () => {
24141
+ if (isTouch) {
24142
+ document.addEventListener("touchmove", this.resizeColumnMoving);
24143
+ document.addEventListener("touchcancel", this.resizeColumnEnd);
24144
+ document.addEventListener("touchend", this.resizeColumnEnd);
24145
+ } else {
24146
+ document.addEventListener("mousemove", this.resizeColumnMoving);
24147
+ document.addEventListener("mouseup", this.resizeColumnEnd);
24148
+ document.addEventListener("mouseleave", this.resizeColumnEnd);
24149
+ }
24150
+ }
24151
+ );
24482
24152
  }
24483
- }
24484
- __name(_classCallCheck$f, "_classCallCheck$f");
24485
- function _possibleConstructorReturn$f(self2, call2) {
24486
- if (!self2) {
24487
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
24153
+ resizeColumnMoving(event) {
24154
+ event.stopPropagation();
24155
+ const { onResizedChange } = this.props;
24156
+ const { resized, currentlyResizing } = this.getResolvedState();
24157
+ const newResized = resized.filter((x2) => x2.id !== currentlyResizing.id);
24158
+ let pageX;
24159
+ if (event.type === "touchmove") {
24160
+ pageX = event.changedTouches[0].pageX;
24161
+ } else if (event.type === "mousemove") {
24162
+ pageX = event.pageX;
24163
+ }
24164
+ const newWidth = Math.max(
24165
+ currentlyResizing.parentWidth + pageX - currentlyResizing.startX,
24166
+ 11
24167
+ );
24168
+ newResized.push({
24169
+ id: currentlyResizing.id,
24170
+ value: newWidth
24171
+ });
24172
+ this.setStateWithData(
24173
+ {
24174
+ resized: newResized
24175
+ },
24176
+ () => onResizedChange && onResizedChange(newResized, event)
24177
+ );
24488
24178
  }
24489
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
24490
- }
24491
- __name(_possibleConstructorReturn$f, "_possibleConstructorReturn$f");
24492
- function _inherits$f(subClass, superClass) {
24493
- if (typeof superClass !== "function" && superClass !== null) {
24494
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
24179
+ resizeColumnEnd(event) {
24180
+ event.stopPropagation();
24181
+ const isTouch = event.type === "touchend" || event.type === "touchcancel";
24182
+ if (isTouch) {
24183
+ document.removeEventListener("touchmove", this.resizeColumnMoving);
24184
+ document.removeEventListener("touchcancel", this.resizeColumnEnd);
24185
+ document.removeEventListener("touchend", this.resizeColumnEnd);
24186
+ }
24187
+ document.removeEventListener("mousemove", this.resizeColumnMoving);
24188
+ document.removeEventListener("mouseup", this.resizeColumnEnd);
24189
+ document.removeEventListener("mouseleave", this.resizeColumnEnd);
24190
+ if (!isTouch) {
24191
+ this.setStateWithData({
24192
+ skipNextSort: true,
24193
+ currentlyResizing: false
24194
+ });
24195
+ }
24495
24196
  }
24496
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
24497
- if (superClass)
24498
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
24499
- }
24500
- __name(_inherits$f, "_inherits$f");
24501
- var defaultButton = /* @__PURE__ */ __name(function defaultButton2(props) {
24502
- return React$1.createElement(
24503
- "button",
24504
- _extends$k({ type: "button" }, props, { className: "-btn" }),
24505
- props.children
24506
- );
24507
- }, "defaultButton");
24508
- var ReactTablePagination = function(_Component) {
24509
- _inherits$f(ReactTablePagination2, _Component);
24510
- function ReactTablePagination2(props) {
24511
- _classCallCheck$f(this, ReactTablePagination2);
24512
- var _this = _possibleConstructorReturn$f(this, (ReactTablePagination2.__proto__ || Object.getPrototypeOf(ReactTablePagination2)).call(this, props));
24513
- _this.getSafePage = _this.getSafePage.bind(_this);
24514
- _this.changePage = _this.changePage.bind(_this);
24515
- _this.applyPage = _this.applyPage.bind(_this);
24516
- _this.state = {
24197
+ }, "Methods");
24198
+ const defaultButton = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React$1.createElement("button", __spreadProps(__spreadValues({ type: "button" }, props), { className: "-btn" }), props.children), "defaultButton");
24199
+ const _ReactTablePagination = class _ReactTablePagination extends React$1.Component {
24200
+ constructor(props) {
24201
+ super(props);
24202
+ this.getSafePage = this.getSafePage.bind(this);
24203
+ this.changePage = this.changePage.bind(this);
24204
+ this.applyPage = this.applyPage.bind(this);
24205
+ this.state = {
24517
24206
  page: props.page
24518
24207
  };
24519
- return _this;
24520
24208
  }
24521
- __name(ReactTablePagination2, "ReactTablePagination");
24522
- _createClass$a(ReactTablePagination2, [{
24523
- key: "UNSAFE_componentWillReceiveProps",
24524
- value: /* @__PURE__ */ __name(function UNSAFE_componentWillReceiveProps(nextProps) {
24525
- if (this.props.page !== nextProps.page) {
24526
- this.setState({ page: nextProps.page });
24527
- }
24528
- }, "UNSAFE_componentWillReceiveProps")
24529
- }, {
24530
- key: "getSafePage",
24531
- value: /* @__PURE__ */ __name(function getSafePage(page) {
24532
- if (Number.isNaN(page)) {
24533
- page = this.props.page;
24534
- }
24535
- return Math.min(Math.max(page, 0), this.props.pages - 1);
24536
- }, "getSafePage")
24537
- }, {
24538
- key: "changePage",
24539
- value: /* @__PURE__ */ __name(function changePage(page) {
24540
- page = this.getSafePage(page);
24541
- this.setState({ page });
24542
- if (this.props.page !== page) {
24543
- this.props.onPageChange(page);
24544
- }
24545
- }, "changePage")
24546
- }, {
24547
- key: "applyPage",
24548
- value: /* @__PURE__ */ __name(function applyPage(e2) {
24549
- if (e2) {
24550
- e2.preventDefault();
24551
- }
24552
- var page = this.state.page;
24553
- this.changePage(page === "" ? this.props.page : page);
24554
- }, "applyPage")
24555
- }, {
24556
- key: "getPageJumpProperties",
24557
- value: /* @__PURE__ */ __name(function getPageJumpProperties() {
24558
- var _this2 = this;
24559
- return {
24560
- onKeyPress: /* @__PURE__ */ __name(function onKeyPress(e2) {
24561
- if (e2.which === 13 || e2.keyCode === 13) {
24562
- _this2.applyPage();
24563
- }
24564
- }, "onKeyPress"),
24565
- onBlur: this.applyPage,
24566
- value: this.state.page === "" ? "" : this.state.page + 1,
24567
- onChange: /* @__PURE__ */ __name(function onChange(e2) {
24568
- var val = e2.target.value;
24569
- var page = val - 1;
24570
- if (val === "") {
24571
- return _this2.setState({ page: val });
24572
- }
24573
- _this2.setState({ page: _this2.getSafePage(page) });
24574
- }, "onChange"),
24575
- inputType: this.state.page === "" ? "text" : "number",
24576
- pageJumpText: this.props.pageJumpText
24577
- };
24578
- }, "getPageJumpProperties")
24579
- }, {
24580
- key: "render",
24581
- value: /* @__PURE__ */ __name(function render3() {
24582
- var _this3 = this;
24583
- var _props = this.props, pages = _props.pages, page = _props.page, showPageSizeOptions = _props.showPageSizeOptions, pageSizeOptions = _props.pageSizeOptions, pageSize = _props.pageSize, showPageJump = _props.showPageJump, canPrevious = _props.canPrevious, canNext = _props.canNext, onPageSizeChange = _props.onPageSizeChange, className = _props.className, PreviousComponent = _props.PreviousComponent, NextComponent = _props.NextComponent, renderPageJump2 = _props.renderPageJump, renderCurrentPage2 = _props.renderCurrentPage, renderTotalPagesCount2 = _props.renderTotalPagesCount, renderPageSizeOptions2 = _props.renderPageSizeOptions;
24584
- return React$1.createElement(
24585
- "div",
24586
- { className: classNames(className, "-pagination"), style: this.props.style },
24587
- React$1.createElement(
24588
- "div",
24589
- { className: "-previous" },
24590
- React$1.createElement(
24591
- PreviousComponent,
24592
- {
24593
- onClick: /* @__PURE__ */ __name(function onClick() {
24594
- if (!canPrevious)
24595
- return;
24596
- _this3.changePage(page - 1);
24597
- }, "onClick"),
24598
- disabled: !canPrevious
24599
- },
24600
- this.props.previousText
24601
- )
24602
- ),
24603
- React$1.createElement(
24604
- "div",
24605
- { className: "-center" },
24606
- React$1.createElement(
24607
- "span",
24608
- { className: "-pageInfo" },
24609
- this.props.pageText,
24610
- " ",
24611
- showPageJump ? renderPageJump2(this.getPageJumpProperties()) : renderCurrentPage2(page),
24612
- " ",
24613
- this.props.ofText,
24614
- " ",
24615
- renderTotalPagesCount2(pages)
24616
- ),
24617
- showPageSizeOptions && renderPageSizeOptions2({
24618
- pageSize,
24619
- rowsSelectorText: this.props.rowsSelectorText,
24620
- pageSizeOptions,
24621
- onPageSizeChange,
24622
- rowsText: this.props.rowsText
24623
- })
24624
- ),
24625
- React$1.createElement(
24626
- "div",
24627
- { className: "-next" },
24628
- React$1.createElement(
24629
- NextComponent,
24630
- {
24631
- onClick: /* @__PURE__ */ __name(function onClick() {
24632
- if (!canNext)
24633
- return;
24634
- _this3.changePage(page + 1);
24635
- }, "onClick"),
24636
- disabled: !canNext
24637
- },
24638
- this.props.nextText
24639
- )
24640
- )
24641
- );
24642
- }, "render")
24643
- }]);
24644
- return ReactTablePagination2;
24645
- }(React$1.Component);
24646
- ReactTablePagination.defaultProps = {
24647
- PreviousComponent: defaultButton,
24648
- NextComponent: defaultButton,
24649
- renderPageJump: /* @__PURE__ */ __name(function renderPageJump(_ref) {
24650
- var onChange = _ref.onChange, value = _ref.value, onBlur = _ref.onBlur, onKeyPress = _ref.onKeyPress, inputType = _ref.inputType, pageJumpText = _ref.pageJumpText;
24651
- return React$1.createElement(
24652
- "div",
24653
- { className: "-pageJump" },
24654
- React$1.createElement("input", {
24655
- "aria-label": pageJumpText,
24656
- type: inputType,
24657
- onChange,
24658
- value,
24659
- onBlur,
24660
- onKeyPress
24661
- })
24662
- );
24663
- }, "renderPageJump"),
24664
- renderCurrentPage: /* @__PURE__ */ __name(function renderCurrentPage(page) {
24665
- return React$1.createElement(
24666
- "span",
24667
- { className: "-currentPage" },
24668
- page + 1
24669
- );
24670
- }, "renderCurrentPage"),
24671
- renderTotalPagesCount: /* @__PURE__ */ __name(function renderTotalPagesCount(pages) {
24672
- return React$1.createElement(
24673
- "span",
24674
- { className: "-totalPages" },
24675
- pages || 1
24676
- );
24677
- }, "renderTotalPagesCount"),
24678
- renderPageSizeOptions: /* @__PURE__ */ __name(function renderPageSizeOptions(_ref2) {
24679
- var pageSize = _ref2.pageSize, pageSizeOptions = _ref2.pageSizeOptions, rowsSelectorText = _ref2.rowsSelectorText, onPageSizeChange = _ref2.onPageSizeChange, rowsText = _ref2.rowsText;
24680
- return React$1.createElement(
24681
- "span",
24682
- { className: "select-wrap -pageSizeOptions" },
24683
- React$1.createElement(
24684
- "select",
24685
- {
24686
- "aria-label": rowsSelectorText,
24687
- onChange: /* @__PURE__ */ __name(function onChange(e2) {
24688
- return onPageSizeChange(Number(e2.target.value));
24689
- }, "onChange"),
24690
- value: pageSize
24691
- },
24692
- pageSizeOptions.map(function(option, i) {
24693
- return (
24694
- // eslint-disable-next-line react/no-array-index-key
24695
- React$1.createElement(
24696
- "option",
24697
- { key: i, value: option },
24698
- option + " " + rowsText
24699
- )
24700
- );
24701
- })
24702
- )
24703
- );
24704
- }, "renderPageSizeOptions")
24705
- };
24706
- var _extends$j = Object.assign || function(target) {
24707
- for (var i = 1; i < arguments.length; i++) {
24708
- var source = arguments[i];
24709
- for (var key in source) {
24710
- if (Object.prototype.hasOwnProperty.call(source, key)) {
24711
- target[key] = source[key];
24712
- }
24209
+ UNSAFE_componentWillReceiveProps(nextProps) {
24210
+ if (this.props.page !== nextProps.page) {
24211
+ this.setState({ page: nextProps.page });
24713
24212
  }
24714
24213
  }
24715
- return target;
24716
- };
24717
- function _objectWithoutProperties$5(obj, keys3) {
24718
- var target = {};
24719
- for (var i in obj) {
24720
- if (keys3.indexOf(i) >= 0)
24721
- continue;
24722
- if (!Object.prototype.hasOwnProperty.call(obj, i))
24723
- continue;
24724
- target[i] = obj[i];
24214
+ getSafePage(page) {
24215
+ if (Number.isNaN(page)) {
24216
+ page = this.props.page;
24217
+ }
24218
+ return Math.min(Math.max(page, 0), this.props.pages - 1);
24725
24219
  }
24726
- return target;
24727
- }
24728
- __name(_objectWithoutProperties$5, "_objectWithoutProperties$5");
24729
- var emptyObj = /* @__PURE__ */ __name(function emptyObj2() {
24730
- return {};
24731
- }, "emptyObj");
24220
+ changePage(page) {
24221
+ page = this.getSafePage(page);
24222
+ this.setState({ page });
24223
+ if (this.props.page !== page) {
24224
+ this.props.onPageChange(page);
24225
+ }
24226
+ }
24227
+ applyPage(e2) {
24228
+ if (e2) {
24229
+ e2.preventDefault();
24230
+ }
24231
+ const page = this.state.page;
24232
+ this.changePage(page === "" ? this.props.page : page);
24233
+ }
24234
+ getPageJumpProperties() {
24235
+ return {
24236
+ onKeyPress: (e2) => {
24237
+ if (e2.which === 13 || e2.keyCode === 13) {
24238
+ this.applyPage();
24239
+ }
24240
+ },
24241
+ onBlur: this.applyPage,
24242
+ value: this.state.page === "" ? "" : this.state.page + 1,
24243
+ onChange: (e2) => {
24244
+ const val = e2.target.value;
24245
+ const page = val - 1;
24246
+ if (val === "") {
24247
+ return this.setState({ page: val });
24248
+ }
24249
+ this.setState({ page: this.getSafePage(page) });
24250
+ },
24251
+ inputType: this.state.page === "" ? "text" : "number",
24252
+ pageJumpText: this.props.pageJumpText
24253
+ };
24254
+ }
24255
+ render() {
24256
+ const {
24257
+ // Computed
24258
+ pages,
24259
+ // Props
24260
+ page,
24261
+ showPageSizeOptions,
24262
+ pageSizeOptions,
24263
+ pageSize,
24264
+ showPageJump,
24265
+ canPrevious,
24266
+ canNext,
24267
+ onPageSizeChange,
24268
+ className,
24269
+ PreviousComponent,
24270
+ NextComponent,
24271
+ renderPageJump,
24272
+ renderCurrentPage,
24273
+ renderTotalPagesCount,
24274
+ renderPageSizeOptions
24275
+ } = this.props;
24276
+ return /* @__PURE__ */ React$1.createElement("div", { className: classNames(className, "-pagination"), style: this.props.style }, /* @__PURE__ */ React$1.createElement("div", { className: "-previous" }, /* @__PURE__ */ React$1.createElement(
24277
+ PreviousComponent,
24278
+ {
24279
+ onClick: () => {
24280
+ if (!canPrevious)
24281
+ return;
24282
+ this.changePage(page - 1);
24283
+ },
24284
+ disabled: !canPrevious
24285
+ },
24286
+ this.props.previousText
24287
+ )), /* @__PURE__ */ React$1.createElement("div", { className: "-center" }, /* @__PURE__ */ React$1.createElement("span", { className: "-pageInfo" }, this.props.pageText, " ", showPageJump ? renderPageJump(this.getPageJumpProperties()) : renderCurrentPage(page), " ", this.props.ofText, " ", renderTotalPagesCount(pages)), showPageSizeOptions && renderPageSizeOptions({
24288
+ pageSize,
24289
+ rowsSelectorText: this.props.rowsSelectorText,
24290
+ pageSizeOptions,
24291
+ onPageSizeChange,
24292
+ rowsText: this.props.rowsText
24293
+ })), /* @__PURE__ */ React$1.createElement("div", { className: "-next" }, /* @__PURE__ */ React$1.createElement(
24294
+ NextComponent,
24295
+ {
24296
+ onClick: () => {
24297
+ if (!canNext)
24298
+ return;
24299
+ this.changePage(page + 1);
24300
+ },
24301
+ disabled: !canNext
24302
+ },
24303
+ this.props.nextText
24304
+ )));
24305
+ }
24306
+ };
24307
+ __name(_ReactTablePagination, "ReactTablePagination");
24308
+ __publicField(_ReactTablePagination, "defaultProps", {
24309
+ PreviousComponent: defaultButton,
24310
+ NextComponent: defaultButton,
24311
+ renderPageJump: ({
24312
+ onChange,
24313
+ value,
24314
+ onBlur,
24315
+ onKeyPress,
24316
+ inputType,
24317
+ pageJumpText
24318
+ }) => /* @__PURE__ */ React$1.createElement("div", { className: "-pageJump" }, /* @__PURE__ */ React$1.createElement(
24319
+ "input",
24320
+ {
24321
+ "aria-label": pageJumpText,
24322
+ type: inputType,
24323
+ onChange,
24324
+ value,
24325
+ onBlur,
24326
+ onKeyPress
24327
+ }
24328
+ )),
24329
+ renderCurrentPage: (page) => /* @__PURE__ */ React$1.createElement("span", { className: "-currentPage" }, page + 1),
24330
+ renderTotalPagesCount: (pages) => /* @__PURE__ */ React$1.createElement("span", { className: "-totalPages" }, pages || 1),
24331
+ renderPageSizeOptions: ({
24332
+ pageSize,
24333
+ pageSizeOptions,
24334
+ rowsSelectorText,
24335
+ onPageSizeChange,
24336
+ rowsText
24337
+ }) => /* @__PURE__ */ React$1.createElement("span", { className: "select-wrap -pageSizeOptions" }, /* @__PURE__ */ React$1.createElement(
24338
+ "select",
24339
+ {
24340
+ "aria-label": rowsSelectorText,
24341
+ onChange: (e2) => onPageSizeChange(Number(e2.target.value)),
24342
+ value: pageSize
24343
+ },
24344
+ pageSizeOptions.map((option, i) => (
24345
+ // eslint-disable-next-line react/no-array-index-key
24346
+ /* @__PURE__ */ React$1.createElement("option", { key: i, value: option }, `${option} ${rowsText}`)
24347
+ ))
24348
+ ))
24349
+ });
24350
+ let ReactTablePagination = _ReactTablePagination;
24351
+ const emptyObj = /* @__PURE__ */ __name(() => ({}), "emptyObj");
24732
24352
  const defaultProps$1 = {
24733
24353
  // General
24734
24354
  data: [],
24735
- resolveData: /* @__PURE__ */ __name(function resolveData(data) {
24736
- return data;
24737
- }, "resolveData"),
24355
+ resolveData: (data) => data,
24738
24356
  loading: false,
24739
24357
  showPagination: true,
24740
24358
  showPaginationTop: false,
@@ -24758,12 +24376,12 @@ const defaultProps$1 = {
24758
24376
  defaultResized: [],
24759
24377
  defaultExpanded: {},
24760
24378
  // eslint-disable-next-line no-unused-vars
24761
- defaultFilterMethod: /* @__PURE__ */ __name(function defaultFilterMethod(filter, row, column) {
24762
- var id2 = filter.pivotId || filter.id;
24379
+ defaultFilterMethod: (filter, row, column) => {
24380
+ const id2 = filter.pivotId || filter.id;
24763
24381
  return row[id2] !== void 0 ? String(row[id2]).startsWith(filter.value) : true;
24764
- }, "defaultFilterMethod"),
24382
+ },
24765
24383
  // eslint-disable-next-line no-unused-vars
24766
- defaultSortMethod: /* @__PURE__ */ __name(function defaultSortMethod(a2, b2, desc) {
24384
+ defaultSortMethod: (a2, b2, desc) => {
24767
24385
  a2 = a2 === null || a2 === void 0 ? "" : a2;
24768
24386
  b2 = b2 === null || b2 === void 0 ? "" : b2;
24769
24387
  a2 = typeof a2 === "string" ? a2.toLowerCase() : a2;
@@ -24775,7 +24393,7 @@ const defaultProps$1 = {
24775
24393
  return -1;
24776
24394
  }
24777
24395
  return 0;
24778
- }, "defaultSortMethod"),
24396
+ },
24779
24397
  // Controlled State Props
24780
24398
  // page: undefined,
24781
24399
  // pageSize: undefined,
@@ -24802,9 +24420,7 @@ const defaultProps$1 = {
24802
24420
  indexKey: "_index",
24803
24421
  groupedByPivotKey: "_groupedByPivot",
24804
24422
  // Server-side Callbacks
24805
- onFetchData: /* @__PURE__ */ __name(function onFetchData() {
24806
- return null;
24807
- }, "onFetchData"),
24423
+ onFetchData: () => null,
24808
24424
  // Classes
24809
24425
  className: "",
24810
24426
  style: {},
@@ -24892,145 +24508,106 @@ const defaultProps$1 = {
24892
24508
  pageJumpText: "jump to page",
24893
24509
  rowsSelectorText: "rows per page",
24894
24510
  // Components
24895
- TableComponent: /* @__PURE__ */ __name(function TableComponent(_ref) {
24896
- var children = _ref.children, className = _ref.className, rest = _objectWithoutProperties$5(_ref, ["children", "className"]);
24897
- return React$1.createElement(
24511
+ TableComponent: (_e) => {
24512
+ var _f = _e, { children, className } = _f, rest = __objRest(_f, ["children", "className"]);
24513
+ return /* @__PURE__ */ React$1.createElement(
24898
24514
  "div",
24899
- _extends$j({
24515
+ __spreadValues({
24900
24516
  className: classNames("rt-table", className),
24901
24517
  role: "grid"
24902
- // tabIndex='0'
24903
24518
  }, rest),
24904
24519
  children
24905
24520
  );
24906
- }, "TableComponent"),
24521
+ },
24907
24522
  TheadComponent: _.makeTemplateComponent("rt-thead", "Thead"),
24908
24523
  TbodyComponent: _.makeTemplateComponent("rt-tbody", "Tbody"),
24909
- TrGroupComponent: /* @__PURE__ */ __name(function TrGroupComponent(_ref2) {
24910
- var children = _ref2.children, className = _ref2.className, rest = _objectWithoutProperties$5(_ref2, ["children", "className"]);
24911
- return React$1.createElement(
24912
- "div",
24913
- _extends$j({ className: classNames("rt-tr-group", className), role: "rowgroup" }, rest),
24914
- children
24915
- );
24916
- }, "TrGroupComponent"),
24917
- TrComponent: /* @__PURE__ */ __name(function TrComponent(_ref3) {
24918
- var children = _ref3.children, className = _ref3.className, rest = _objectWithoutProperties$5(_ref3, ["children", "className"]);
24919
- return React$1.createElement(
24920
- "div",
24921
- _extends$j({ className: classNames("rt-tr", className), role: "row" }, rest),
24524
+ TrGroupComponent: (_g) => {
24525
+ var _h = _g, { children, className } = _h, rest = __objRest(_h, ["children", "className"]);
24526
+ return /* @__PURE__ */ React$1.createElement("div", __spreadValues({ className: classNames("rt-tr-group", className), role: "rowgroup" }, rest), children);
24527
+ },
24528
+ TrComponent: (_i) => {
24529
+ var _j = _i, { children, className } = _j, rest = __objRest(_j, ["children", "className"]);
24530
+ return /* @__PURE__ */ React$1.createElement("div", __spreadValues({ className: classNames("rt-tr", className), role: "row" }, rest), children);
24531
+ },
24532
+ ThComponent: (_k) => {
24533
+ var _l = _k, {
24534
+ toggleSort,
24535
+ className,
24922
24536
  children
24923
- );
24924
- }, "TrComponent"),
24925
- ThComponent: /* @__PURE__ */ __name(function ThComponent(_ref4) {
24926
- var toggleSort = _ref4.toggleSort, className = _ref4.className, children = _ref4.children, rest = _objectWithoutProperties$5(_ref4, ["toggleSort", "className", "children"]);
24537
+ } = _l, rest = __objRest(_l, [
24538
+ "toggleSort",
24539
+ "className",
24540
+ "children"
24541
+ ]);
24927
24542
  return (
24928
24543
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events
24929
- React$1.createElement(
24544
+ /* @__PURE__ */ React$1.createElement(
24930
24545
  "div",
24931
- _extends$j({
24546
+ __spreadValues({
24932
24547
  className: classNames("rt-th", className),
24933
- onClick: /* @__PURE__ */ __name(function onClick(e2) {
24934
- return toggleSort && toggleSort(e2);
24935
- }, "onClick"),
24548
+ onClick: (e2) => toggleSort && toggleSort(e2),
24936
24549
  role: "columnheader",
24937
24550
  tabIndex: "-1"
24938
- // Resolves eslint issues without implementing keyboard navigation incorrectly
24939
24551
  }, rest),
24940
24552
  children
24941
24553
  )
24942
24554
  );
24943
- }, "ThComponent"),
24944
- TdComponent: /* @__PURE__ */ __name(function TdComponent(_ref5) {
24945
- _ref5.toggleSort;
24946
- var className = _ref5.className, children = _ref5.children, rest = _objectWithoutProperties$5(_ref5, ["toggleSort", "className", "children"]);
24947
- return React$1.createElement(
24948
- "div",
24949
- _extends$j({ className: classNames("rt-td", className), role: "gridcell" }, rest),
24555
+ },
24556
+ TdComponent: (_m) => {
24557
+ var _n = _m, {
24558
+ toggleSort,
24559
+ className,
24950
24560
  children
24951
- );
24952
- }, "TdComponent"),
24561
+ } = _n, rest = __objRest(_n, [
24562
+ "toggleSort",
24563
+ "className",
24564
+ "children"
24565
+ ]);
24566
+ return /* @__PURE__ */ React$1.createElement("div", __spreadValues({ className: classNames("rt-td", className), role: "gridcell" }, rest), children);
24567
+ },
24953
24568
  TfootComponent: _.makeTemplateComponent("rt-tfoot", "Tfoot"),
24954
- FilterComponent: /* @__PURE__ */ __name(function FilterComponent(_ref6) {
24955
- var filter = _ref6.filter, _onChange = _ref6.onChange, column = _ref6.column;
24956
- return React$1.createElement("input", {
24569
+ FilterComponent: ({ filter, onChange, column }) => /* @__PURE__ */ React$1.createElement(
24570
+ "input",
24571
+ {
24957
24572
  type: "text",
24958
24573
  style: {
24959
24574
  width: "100%"
24960
24575
  },
24961
24576
  placeholder: column.Placeholder,
24962
24577
  value: filter ? filter.value : "",
24963
- onChange: /* @__PURE__ */ __name(function onChange(event) {
24964
- return _onChange(event.target.value);
24965
- }, "onChange")
24966
- });
24967
- }, "FilterComponent"),
24968
- ExpanderComponent: /* @__PURE__ */ __name(function ExpanderComponent(_ref7) {
24969
- var isExpanded = _ref7.isExpanded;
24970
- return React$1.createElement(
24971
- "div",
24972
- { className: classNames("rt-expander", isExpanded && "-open") },
24973
- ""
24974
- );
24975
- }, "ExpanderComponent"),
24976
- PivotValueComponent: /* @__PURE__ */ __name(function PivotValueComponent(_ref8) {
24977
- var subRows = _ref8.subRows, value = _ref8.value;
24978
- return React$1.createElement(
24979
- "span",
24980
- null,
24981
- value,
24982
- " ",
24983
- subRows && "(" + subRows.length + ")"
24984
- );
24985
- }, "PivotValueComponent"),
24986
- AggregatedComponent: /* @__PURE__ */ __name(function AggregatedComponent(_ref9) {
24987
- var subRows = _ref9.subRows, column = _ref9.column;
24988
- var previewValues = subRows.filter(function(d2) {
24989
- return typeof d2[column.id] !== "undefined";
24990
- }).map(function(row, i) {
24991
- return (
24992
- // eslint-disable-next-line react/no-array-index-key
24993
- React$1.createElement(
24994
- "span",
24995
- { key: i },
24996
- row[column.id],
24997
- i < subRows.length - 1 ? ", " : ""
24998
- )
24999
- );
25000
- });
25001
- return React$1.createElement(
25002
- "span",
25003
- null,
25004
- previewValues
25005
- );
25006
- }, "AggregatedComponent"),
24578
+ onChange: (event) => onChange(event.target.value)
24579
+ }
24580
+ ),
24581
+ ExpanderComponent: ({ isExpanded }) => /* @__PURE__ */ React$1.createElement("div", { className: classNames("rt-expander", isExpanded && "-open") }, "•"),
24582
+ PivotValueComponent: ({ subRows, value }) => /* @__PURE__ */ React$1.createElement("span", null, value, " ", subRows && `(${subRows.length})`),
24583
+ AggregatedComponent: ({ subRows, column }) => {
24584
+ const previewValues = subRows.filter((d2) => typeof d2[column.id] !== "undefined").map((row, i) => (
24585
+ // eslint-disable-next-line react/no-array-index-key
24586
+ /* @__PURE__ */ React$1.createElement("span", { key: i }, row[column.id], i < subRows.length - 1 ? ", " : "")
24587
+ ));
24588
+ return /* @__PURE__ */ React$1.createElement("span", null, previewValues);
24589
+ },
25007
24590
  PivotComponent: void 0,
25008
24591
  // this is a computed default generated using
25009
24592
  // the ExpanderComponent and PivotValueComponent at run-time in methods.js
25010
24593
  PaginationComponent: ReactTablePagination,
25011
24594
  PreviousComponent: void 0,
25012
24595
  NextComponent: void 0,
25013
- LoadingComponent: /* @__PURE__ */ __name(function LoadingComponent(_ref10) {
25014
- var className = _ref10.className, loading = _ref10.loading, loadingText = _ref10.loadingText, rest = _objectWithoutProperties$5(_ref10, ["className", "loading", "loadingText"]);
25015
- return React$1.createElement(
25016
- "div",
25017
- _extends$j({ className: classNames("-loading", { "-active": loading }, className) }, rest),
25018
- React$1.createElement(
25019
- "div",
25020
- { className: "-loading-inner" },
25021
- loadingText
25022
- )
25023
- );
25024
- }, "LoadingComponent"),
24596
+ LoadingComponent: (_o) => {
24597
+ var _p = _o, {
24598
+ className,
24599
+ loading,
24600
+ loadingText
24601
+ } = _p, rest = __objRest(_p, [
24602
+ "className",
24603
+ "loading",
24604
+ "loadingText"
24605
+ ]);
24606
+ return /* @__PURE__ */ React$1.createElement("div", __spreadValues({ className: classNames("-loading", { "-active": loading }, className) }, rest), /* @__PURE__ */ React$1.createElement("div", { className: "-loading-inner" }, loadingText));
24607
+ },
25025
24608
  NoDataComponent: _.makeTemplateComponent("rt-noData", "NoData"),
25026
24609
  ResizerComponent: _.makeTemplateComponent("rt-resizer", "Resizer"),
25027
- PadRowComponent: /* @__PURE__ */ __name(function PadRowComponent() {
25028
- return React$1.createElement(
25029
- "span",
25030
- null,
25031
- " "
25032
- );
25033
- }, "PadRowComponent")
24610
+ PadRowComponent: () => /* @__PURE__ */ React$1.createElement("span", null, " ")
25034
24611
  };
25035
24612
  const propTypes = {
25036
24613
  // General
@@ -25104,44 +24681,46 @@ const propTypes = {
25104
24681
  getNoDataProps: PropTypes$1.func,
25105
24682
  getResizerProps: PropTypes$1.func,
25106
24683
  // Global Column Defaults
25107
- columns: PropTypes$1.arrayOf(PropTypes$1.shape({
25108
- // Renderers
25109
- Cell: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25110
- Header: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25111
- Footer: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25112
- Aggregated: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25113
- Pivot: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25114
- PivotValue: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25115
- Expander: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25116
- Filter: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.func]),
25117
- // All Columns
25118
- sortable: PropTypes$1.bool,
25119
- // use table default
25120
- resizable: PropTypes$1.bool,
25121
- // use table default
25122
- filterable: PropTypes$1.bool,
25123
- // use table default
25124
- show: PropTypes$1.bool,
25125
- minWidth: PropTypes$1.number,
25126
- minResizeWidth: PropTypes$1.number,
25127
- // Cells only
25128
- className: PropTypes$1.string,
25129
- style: PropTypes$1.object,
25130
- getProps: PropTypes$1.func,
25131
- // Pivot only
25132
- aggregate: PropTypes$1.func,
25133
- // Headers only
25134
- headerClassName: PropTypes$1.string,
25135
- headerStyle: PropTypes$1.object,
25136
- getHeaderProps: PropTypes$1.func,
25137
- // Footers only
25138
- footerClassName: PropTypes$1.string,
25139
- footerStyle: PropTypes$1.object,
25140
- getFooterProps: PropTypes$1.func,
25141
- filterMethod: PropTypes$1.func,
25142
- filterAll: PropTypes$1.bool,
25143
- sortMethod: PropTypes$1.func
25144
- })),
24684
+ columns: PropTypes$1.arrayOf(
24685
+ PropTypes$1.shape({
24686
+ // Renderers
24687
+ Cell: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24688
+ Header: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24689
+ Footer: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24690
+ Aggregated: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24691
+ Pivot: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24692
+ PivotValue: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24693
+ Expander: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24694
+ Filter: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.func]),
24695
+ // All Columns
24696
+ sortable: PropTypes$1.bool,
24697
+ // use table default
24698
+ resizable: PropTypes$1.bool,
24699
+ // use table default
24700
+ filterable: PropTypes$1.bool,
24701
+ // use table default
24702
+ show: PropTypes$1.bool,
24703
+ minWidth: PropTypes$1.number,
24704
+ minResizeWidth: PropTypes$1.number,
24705
+ // Cells only
24706
+ className: PropTypes$1.string,
24707
+ style: PropTypes$1.object,
24708
+ getProps: PropTypes$1.func,
24709
+ // Pivot only
24710
+ aggregate: PropTypes$1.func,
24711
+ // Headers only
24712
+ headerClassName: PropTypes$1.string,
24713
+ headerStyle: PropTypes$1.object,
24714
+ getHeaderProps: PropTypes$1.func,
24715
+ // Footers only
24716
+ footerClassName: PropTypes$1.string,
24717
+ footerStyle: PropTypes$1.object,
24718
+ getFooterProps: PropTypes$1.func,
24719
+ filterMethod: PropTypes$1.func,
24720
+ filterAll: PropTypes$1.bool,
24721
+ sortMethod: PropTypes$1.func
24722
+ })
24723
+ ),
25145
24724
  // Global Expander Column Defaults
25146
24725
  expanderDefaults: PropTypes$1.shape({
25147
24726
  sortable: PropTypes$1.bool,
@@ -25184,122 +24763,48 @@ const propTypes = {
25184
24763
  ResizerComponent: PropTypes$1.elementType,
25185
24764
  PadRowComponent: PropTypes$1.elementType
25186
24765
  };
25187
- var _slicedToArray$3 = function() {
25188
- function sliceIterator(arr, i) {
25189
- var _arr = [];
25190
- var _n = true;
25191
- var _d = false;
25192
- var _e = void 0;
25193
- try {
25194
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
25195
- _arr.push(_s.value);
25196
- if (i && _arr.length === i)
25197
- break;
25198
- }
25199
- } catch (err) {
25200
- _d = true;
25201
- _e = err;
25202
- } finally {
24766
+ const itemSizeEstimator = /* @__PURE__ */ __name(() => 41.36, "itemSizeEstimator");
24767
+ const ReactTableDefaults = defaultProps$1;
24768
+ const _ReactTable = class _ReactTable extends Methods(Lifecycle(React$1.Component)) {
24769
+ constructor(props) {
24770
+ super();
24771
+ this.getResolvedState = this.getResolvedState.bind(this);
24772
+ this.getDataModel = this.getDataModel.bind(this);
24773
+ this.getSortedData = this.getSortedData.bind(this);
24774
+ this.fireFetchData = this.fireFetchData.bind(this);
24775
+ this.getPropOrState = this.getPropOrState.bind(this);
24776
+ this.getStateOrProp = this.getStateOrProp.bind(this);
24777
+ this.filterData = this.filterData.bind(this);
24778
+ this.sortData = this.sortData.bind(this);
24779
+ this.getMinRows = this.getMinRows.bind(this);
24780
+ this.onPageChange = this.onPageChange.bind(this);
24781
+ this.onPageSizeChange = this.onPageSizeChange.bind(this);
24782
+ this.sortColumn = this.sortColumn.bind(this);
24783
+ this.filterColumn = this.filterColumn.bind(this);
24784
+ this.resizeColumnStart = this.resizeColumnStart.bind(this);
24785
+ this.resizeColumnEnd = this.resizeColumnEnd.bind(this);
24786
+ this.resizeColumnMoving = this.resizeColumnMoving.bind(this);
24787
+ setTimeout(() => {
25203
24788
  try {
25204
- if (!_n && _i["return"])
25205
- _i["return"]();
25206
- } finally {
25207
- if (_d)
25208
- throw _e;
25209
- }
25210
- }
25211
- return _arr;
25212
- }
25213
- __name(sliceIterator, "sliceIterator");
25214
- return function(arr, i) {
25215
- if (Array.isArray(arr)) {
25216
- return arr;
25217
- } else if (Symbol.iterator in Object(arr)) {
25218
- return sliceIterator(arr, i);
25219
- } else {
25220
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
25221
- }
25222
- };
25223
- }();
25224
- var _extends$i = Object.assign || function(target) {
25225
- for (var i = 1; i < arguments.length; i++) {
25226
- var source = arguments[i];
25227
- for (var key in source) {
25228
- if (Object.prototype.hasOwnProperty.call(source, key)) {
25229
- target[key] = source[key];
24789
+ const newResized = this.props.defaultResized || [];
24790
+ this.tableRef.querySelectorAll(".tg-react-table-column-header").forEach((th) => {
24791
+ const { width } = th.parentNode.parentNode.getBoundingClientRect();
24792
+ const id2 = th.getAttribute("data-path");
24793
+ if (!newResized.find((x2) => x2.id === id2)) {
24794
+ newResized.push({
24795
+ id: id2,
24796
+ value: width
24797
+ });
24798
+ }
24799
+ });
24800
+ this.setState({
24801
+ resized: newResized
24802
+ });
24803
+ } catch (e2) {
24804
+ console.warn("TNW: Error setting initial table column widths (please contact @tnrich if you see this error. thanks!):", e2);
25230
24805
  }
25231
- }
25232
- }
25233
- return target;
25234
- };
25235
- var _createClass$9 = function() {
25236
- function defineProperties2(target, props) {
25237
- for (var i = 0; i < props.length; i++) {
25238
- var descriptor2 = props[i];
25239
- descriptor2.enumerable = descriptor2.enumerable || false;
25240
- descriptor2.configurable = true;
25241
- if ("value" in descriptor2)
25242
- descriptor2.writable = true;
25243
- Object.defineProperty(target, descriptor2.key, descriptor2);
25244
- }
25245
- }
25246
- __name(defineProperties2, "defineProperties");
25247
- return function(Constructor, protoProps, staticProps) {
25248
- if (protoProps)
25249
- defineProperties2(Constructor.prototype, protoProps);
25250
- if (staticProps)
25251
- defineProperties2(Constructor, staticProps);
25252
- return Constructor;
25253
- };
25254
- }();
25255
- function _classCallCheck$e(instance, Constructor) {
25256
- if (!(instance instanceof Constructor)) {
25257
- throw new TypeError("Cannot call a class as a function");
25258
- }
25259
- }
25260
- __name(_classCallCheck$e, "_classCallCheck$e");
25261
- function _possibleConstructorReturn$e(self2, call2) {
25262
- if (!self2) {
25263
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
25264
- }
25265
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
25266
- }
25267
- __name(_possibleConstructorReturn$e, "_possibleConstructorReturn$e");
25268
- function _inherits$e(subClass, superClass) {
25269
- if (typeof superClass !== "function" && superClass !== null) {
25270
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
25271
- }
25272
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
25273
- if (superClass)
25274
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
25275
- }
25276
- __name(_inherits$e, "_inherits$e");
25277
- var itemSizeEstimator = /* @__PURE__ */ __name(function itemSizeEstimator2() {
25278
- return 41.36;
25279
- }, "itemSizeEstimator");
25280
- var ReactTableDefaults = defaultProps$1;
25281
- var ReactTable = function(_Methods) {
25282
- _inherits$e(ReactTable2, _Methods);
25283
- function ReactTable2(props) {
25284
- _classCallCheck$e(this, ReactTable2);
25285
- var _this = _possibleConstructorReturn$e(this, (ReactTable2.__proto__ || Object.getPrototypeOf(ReactTable2)).call(this));
25286
- _this.getResolvedState = _this.getResolvedState.bind(_this);
25287
- _this.getDataModel = _this.getDataModel.bind(_this);
25288
- _this.getSortedData = _this.getSortedData.bind(_this);
25289
- _this.fireFetchData = _this.fireFetchData.bind(_this);
25290
- _this.getPropOrState = _this.getPropOrState.bind(_this);
25291
- _this.getStateOrProp = _this.getStateOrProp.bind(_this);
25292
- _this.filterData = _this.filterData.bind(_this);
25293
- _this.sortData = _this.sortData.bind(_this);
25294
- _this.getMinRows = _this.getMinRows.bind(_this);
25295
- _this.onPageChange = _this.onPageChange.bind(_this);
25296
- _this.onPageSizeChange = _this.onPageSizeChange.bind(_this);
25297
- _this.sortColumn = _this.sortColumn.bind(_this);
25298
- _this.filterColumn = _this.filterColumn.bind(_this);
25299
- _this.resizeColumnStart = _this.resizeColumnStart.bind(_this);
25300
- _this.resizeColumnEnd = _this.resizeColumnEnd.bind(_this);
25301
- _this.resizeColumnMoving = _this.resizeColumnMoving.bind(_this);
25302
- _this.state = {
24806
+ }, 0);
24807
+ this.state = {
25303
24808
  page: props.defaultPage,
25304
24809
  pageSize: props.defaultPageSize,
25305
24810
  sorted: props.defaultSorted,
@@ -25309,588 +24814,673 @@ var ReactTable = function(_Methods) {
25309
24814
  currentlyResizing: false,
25310
24815
  skipNextSort: false
25311
24816
  };
25312
- return _this;
25313
24817
  }
25314
- __name(ReactTable2, "ReactTable");
25315
- _createClass$9(ReactTable2, [{
25316
- key: "render",
25317
- value: /* @__PURE__ */ __name(function render3() {
25318
- var _this2 = this;
25319
- var resolvedState = this.getResolvedState();
25320
- var children = resolvedState.children, className = resolvedState.className, style2 = resolvedState.style, getProps = resolvedState.getProps, getTableProps = resolvedState.getTableProps, getTheadGroupProps = resolvedState.getTheadGroupProps, getTheadGroupTrProps = resolvedState.getTheadGroupTrProps, getTheadGroupThProps = resolvedState.getTheadGroupThProps, getTheadProps = resolvedState.getTheadProps, getTheadTrProps = resolvedState.getTheadTrProps, getTheadThProps = resolvedState.getTheadThProps, getTheadFilterProps = resolvedState.getTheadFilterProps, getTheadFilterTrProps = resolvedState.getTheadFilterTrProps, getTheadFilterThProps = resolvedState.getTheadFilterThProps, getTbodyProps = resolvedState.getTbodyProps, getTrGroupProps = resolvedState.getTrGroupProps, getTrProps = resolvedState.getTrProps, getTdProps = resolvedState.getTdProps, getTfootProps = resolvedState.getTfootProps, getTfootTrProps = resolvedState.getTfootTrProps, getTfootTdProps = resolvedState.getTfootTdProps, getPaginationProps = resolvedState.getPaginationProps, getLoadingProps = resolvedState.getLoadingProps, getNoDataProps = resolvedState.getNoDataProps, getResizerProps = resolvedState.getResizerProps, showPagination = resolvedState.showPagination, showPaginationTop = resolvedState.showPaginationTop, showPaginationBottom = resolvedState.showPaginationBottom, manual = resolvedState.manual, loadingText = resolvedState.loadingText, noDataText = resolvedState.noDataText, sortable = resolvedState.sortable, multiSort = resolvedState.multiSort, resizable = resolvedState.resizable, filterable = resolvedState.filterable, pivotIDKey = resolvedState.pivotIDKey, pivotValKey = resolvedState.pivotValKey, pivotBy = resolvedState.pivotBy, subRowsKey = resolvedState.subRowsKey, aggregatedKey = resolvedState.aggregatedKey, originalKey = resolvedState.originalKey, indexKey = resolvedState.indexKey, groupedByPivotKey = resolvedState.groupedByPivotKey, loading = resolvedState.loading, pageSize = resolvedState.pageSize, page = resolvedState.page, sorted = resolvedState.sorted, filtered = resolvedState.filtered, resized = resolvedState.resized, expanded = resolvedState.expanded, pages = resolvedState.pages, onExpandedChange = resolvedState.onExpandedChange, TableComponent2 = resolvedState.TableComponent, TheadComponent = resolvedState.TheadComponent, TbodyComponent = resolvedState.TbodyComponent, additionalBodyEl = resolvedState.additionalBodyEl, TrGroupComponent2 = resolvedState.TrGroupComponent, TrComponent2 = resolvedState.TrComponent, ThComponent2 = resolvedState.ThComponent, TdComponent2 = resolvedState.TdComponent, TfootComponent = resolvedState.TfootComponent, PaginationComponent = resolvedState.PaginationComponent, LoadingComponent3 = resolvedState.LoadingComponent, SubComponent = resolvedState.SubComponent, NoDataComponent = resolvedState.NoDataComponent, ResizerComponent = resolvedState.ResizerComponent, ExpanderComponent2 = resolvedState.ExpanderComponent, PivotValueComponent2 = resolvedState.PivotValueComponent, PivotComponent = resolvedState.PivotComponent, AggregatedComponent2 = resolvedState.AggregatedComponent, FilterComponent2 = resolvedState.FilterComponent, PadRowComponent2 = resolvedState.PadRowComponent, resolvedData = resolvedState.resolvedData, allVisibleColumns = resolvedState.allVisibleColumns, headerGroups = resolvedState.headerGroups, hasHeaderGroups = resolvedState.hasHeaderGroups, sortedData = resolvedState.sortedData, currentlyResizing = resolvedState.currentlyResizing;
25321
- var startRow = pageSize * page;
25322
- var endRow = startRow + pageSize;
25323
- var pageRows = manual ? resolvedData : sortedData.slice(startRow, endRow);
25324
- var minRows = this.getMinRows();
25325
- var padRows = _.range(Math.max(minRows - pageRows.length, 0));
25326
- var hasColumnFooter = allVisibleColumns.some(function(d2) {
25327
- return d2.Footer;
25328
- });
25329
- var hasFilters = filterable || allVisibleColumns.some(function(d2) {
25330
- return d2.filterable;
25331
- });
25332
- var recurseRowsViewIndex = /* @__PURE__ */ __name(function recurseRowsViewIndex2(rows) {
25333
- var path2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
25334
- var index2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
25335
- return [rows.map(function(row, i) {
25336
- index2 += 1;
25337
- var rowWithViewIndex = _extends$i({}, row, {
25338
- _viewIndex: index2
25339
- });
25340
- var newPath = path2.concat([i]);
25341
- if (rowWithViewIndex[subRowsKey] && _.get(expanded, newPath)) {
25342
- var _recurseRowsViewIndex = recurseRowsViewIndex2(rowWithViewIndex[subRowsKey], newPath, index2);
25343
- var _recurseRowsViewIndex2 = _slicedToArray$3(_recurseRowsViewIndex, 2);
25344
- rowWithViewIndex[subRowsKey] = _recurseRowsViewIndex2[0];
25345
- index2 = _recurseRowsViewIndex2[1];
25346
- }
25347
- return rowWithViewIndex;
25348
- }), index2];
25349
- }, "recurseRowsViewIndex");
25350
- var _recurseRowsViewIndex3 = recurseRowsViewIndex(pageRows);
25351
- var _recurseRowsViewIndex4 = _slicedToArray$3(_recurseRowsViewIndex3, 1);
25352
- pageRows = _recurseRowsViewIndex4[0];
25353
- var canPrevious = page > 0;
25354
- var canNext = page + 1 < pages;
25355
- var rowMinWidth = _.sum(allVisibleColumns.map(function(d2) {
25356
- var resizedColumn = resized.find(function(x2) {
25357
- return x2.id === d2.id;
25358
- }) || {};
24818
+ render() {
24819
+ const resolvedState = this.getResolvedState();
24820
+ const {
24821
+ children,
24822
+ className,
24823
+ style: style2,
24824
+ getProps,
24825
+ getTableProps,
24826
+ getTheadGroupProps,
24827
+ getTheadGroupTrProps,
24828
+ getTheadGroupThProps,
24829
+ getTheadProps,
24830
+ getTheadTrProps,
24831
+ getTheadThProps,
24832
+ getTheadFilterProps,
24833
+ getTheadFilterTrProps,
24834
+ getTheadFilterThProps,
24835
+ getTbodyProps,
24836
+ getTrGroupProps,
24837
+ getTrProps,
24838
+ getTdProps,
24839
+ getTfootProps,
24840
+ getTfootTrProps,
24841
+ getTfootTdProps,
24842
+ getPaginationProps,
24843
+ getLoadingProps,
24844
+ getNoDataProps,
24845
+ getResizerProps,
24846
+ showPagination,
24847
+ showPaginationTop,
24848
+ showPaginationBottom,
24849
+ manual,
24850
+ loadingText,
24851
+ noDataText,
24852
+ sortable,
24853
+ multiSort,
24854
+ resizable,
24855
+ filterable,
24856
+ // Pivoting State
24857
+ pivotIDKey,
24858
+ pivotValKey,
24859
+ pivotBy,
24860
+ subRowsKey,
24861
+ aggregatedKey,
24862
+ originalKey,
24863
+ indexKey,
24864
+ groupedByPivotKey,
24865
+ // State
24866
+ loading,
24867
+ pageSize,
24868
+ page,
24869
+ sorted,
24870
+ filtered,
24871
+ resized,
24872
+ expanded,
24873
+ pages,
24874
+ onExpandedChange,
24875
+ // Components
24876
+ TableComponent,
24877
+ TheadComponent,
24878
+ TbodyComponent,
24879
+ additionalBodyEl,
24880
+ TrGroupComponent,
24881
+ TrComponent,
24882
+ ThComponent,
24883
+ TdComponent,
24884
+ TfootComponent,
24885
+ PaginationComponent,
24886
+ LoadingComponent: LoadingComponent2,
24887
+ SubComponent,
24888
+ NoDataComponent,
24889
+ ResizerComponent,
24890
+ ExpanderComponent,
24891
+ PivotValueComponent,
24892
+ PivotComponent,
24893
+ AggregatedComponent,
24894
+ FilterComponent,
24895
+ PadRowComponent,
24896
+ // Data model
24897
+ resolvedData,
24898
+ allVisibleColumns,
24899
+ headerGroups,
24900
+ hasHeaderGroups,
24901
+ // Sorted Data
24902
+ sortedData,
24903
+ currentlyResizing
24904
+ } = resolvedState;
24905
+ const startRow = pageSize * page;
24906
+ const endRow = startRow + pageSize;
24907
+ let pageRows = manual ? resolvedData : sortedData.slice(startRow, endRow);
24908
+ const minRows = this.getMinRows();
24909
+ const padRows = _.range(Math.max(minRows - pageRows.length, 0));
24910
+ const hasColumnFooter = allVisibleColumns.some((d2) => d2.Footer);
24911
+ const hasFilters = filterable || allVisibleColumns.some((d2) => d2.filterable);
24912
+ const recurseRowsViewIndex = /* @__PURE__ */ __name((rows, path2 = [], index2 = -1) => [
24913
+ rows.map((row, i) => {
24914
+ index2 += 1;
24915
+ const rowWithViewIndex = __spreadProps(__spreadValues({}, row), {
24916
+ _viewIndex: index2
24917
+ });
24918
+ const newPath = path2.concat([i]);
24919
+ if (rowWithViewIndex[subRowsKey] && _.get(expanded, newPath)) {
24920
+ [rowWithViewIndex[subRowsKey], index2] = recurseRowsViewIndex(
24921
+ rowWithViewIndex[subRowsKey],
24922
+ newPath,
24923
+ index2
24924
+ );
24925
+ }
24926
+ return rowWithViewIndex;
24927
+ }),
24928
+ index2
24929
+ ], "recurseRowsViewIndex");
24930
+ [pageRows] = recurseRowsViewIndex(pageRows);
24931
+ const canPrevious = page > 0;
24932
+ const canNext = page + 1 < pages;
24933
+ const rowMinWidth = _.sum(
24934
+ allVisibleColumns.map((d2) => {
24935
+ const resizedColumn = resized.find((x2) => x2.id === d2.id) || {};
25359
24936
  return _.getFirstDefined(resizedColumn.value, d2.width, d2.minWidth);
25360
- }));
25361
- var rowIndex = -1;
25362
- var finalState = _extends$i({}, resolvedState, {
25363
- startRow,
25364
- endRow,
25365
- pageRows,
25366
- minRows,
25367
- padRows,
25368
- hasColumnFooter,
25369
- canPrevious,
25370
- canNext,
25371
- rowMinWidth
25372
- });
25373
- var rootProps = _.splitProps(getProps(finalState, void 0, void 0, this));
25374
- var tableProps = _.splitProps(getTableProps(finalState, void 0, void 0, this));
25375
- var tBodyProps = _.splitProps(getTbodyProps(finalState, void 0, void 0, this));
25376
- var loadingProps = getLoadingProps(finalState, void 0, void 0, this);
25377
- var noDataProps = getNoDataProps(finalState, void 0, void 0, this);
25378
- var makeHeaderGroup = /* @__PURE__ */ __name(function makeHeaderGroup2(column, i) {
25379
- var resizedValue = /* @__PURE__ */ __name(function resizedValue2(col) {
25380
- return (resized.find(function(x2) {
25381
- return x2.id === col.id;
25382
- }) || {}).value;
25383
- }, "resizedValue");
25384
- var flex2 = _.sum(column.columns.map(function(col) {
25385
- return col.width || resizedValue(col) ? 0 : col.minWidth;
25386
- }));
25387
- var width = _.sum(column.columns.map(function(col) {
25388
- return _.getFirstDefined(resizedValue(col), col.width, col.minWidth);
25389
- }));
25390
- var maxWidth = _.sum(column.columns.map(function(col) {
25391
- return _.getFirstDefined(resizedValue(col), col.width, col.maxWidth);
25392
- }));
25393
- var theadGroupThProps = _.splitProps(getTheadGroupThProps(finalState, void 0, column, _this2));
25394
- var columnHeaderProps = _.splitProps(column.getHeaderProps(finalState, void 0, column, _this2));
25395
- var classes = [column.headerClassName, theadGroupThProps.className, columnHeaderProps.className];
25396
- var styles2 = _extends$i({}, column.headerStyle, theadGroupThProps.style, columnHeaderProps.style);
25397
- var rest = _extends$i({}, theadGroupThProps.rest, columnHeaderProps.rest);
25398
- var flexStyles = {
25399
- flex: flex2 + " 0 auto",
25400
- width: _.asPx(width),
25401
- maxWidth: _.asPx(maxWidth)
25402
- };
25403
- return React$1.createElement(
25404
- ThComponent2,
25405
- _extends$i({
25406
- key: i + "-" + column.id,
25407
- className: classNames(classes),
25408
- style: _extends$i({}, styles2, flexStyles)
25409
- }, rest),
25410
- _.normalizeComponent(column.Header, {
25411
- data: sortedData,
25412
- column
24937
+ })
24938
+ );
24939
+ let rowIndex = -1;
24940
+ const finalState = __spreadProps(__spreadValues({}, resolvedState), {
24941
+ startRow,
24942
+ endRow,
24943
+ pageRows,
24944
+ minRows,
24945
+ padRows,
24946
+ hasColumnFooter,
24947
+ canPrevious,
24948
+ canNext,
24949
+ rowMinWidth
24950
+ });
24951
+ const rootProps = _.splitProps(getProps(finalState, void 0, void 0, this));
24952
+ const tableProps = _.splitProps(getTableProps(finalState, void 0, void 0, this));
24953
+ const tBodyProps = _.splitProps(getTbodyProps(finalState, void 0, void 0, this));
24954
+ const loadingProps = getLoadingProps(finalState, void 0, void 0, this);
24955
+ const noDataProps = getNoDataProps(finalState, void 0, void 0, this);
24956
+ const makeHeaderGroup = /* @__PURE__ */ __name((column, i) => {
24957
+ const resizedValue = /* @__PURE__ */ __name((col) => (resized.find((x2) => x2.id === col.id) || {}).value, "resizedValue");
24958
+ const flex2 = _.sum(
24959
+ column.columns.map((col) => col.width || resizedValue(col) ? 0 : col.minWidth)
24960
+ );
24961
+ const width = _.sum(
24962
+ column.columns.map((col) => _.getFirstDefined(resizedValue(col), col.width, col.minWidth))
24963
+ );
24964
+ const maxWidth = _.sum(
24965
+ column.columns.map((col) => _.getFirstDefined(resizedValue(col), col.width, col.maxWidth))
24966
+ );
24967
+ const theadGroupThProps = _.splitProps(
24968
+ getTheadGroupThProps(finalState, void 0, column, this)
24969
+ );
24970
+ const columnHeaderProps = _.splitProps(
24971
+ column.getHeaderProps(finalState, void 0, column, this)
24972
+ );
24973
+ const classes = [
24974
+ column.headerClassName,
24975
+ theadGroupThProps.className,
24976
+ columnHeaderProps.className
24977
+ ];
24978
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, column.headerStyle), theadGroupThProps.style), columnHeaderProps.style);
24979
+ const rest = __spreadValues(__spreadValues({}, theadGroupThProps.rest), columnHeaderProps.rest);
24980
+ const flexStyles = {
24981
+ flex: `${flex2} 0 auto`,
24982
+ width: _.asPx(width),
24983
+ maxWidth: _.asPx(maxWidth)
24984
+ };
24985
+ return /* @__PURE__ */ React$1.createElement(
24986
+ ThComponent,
24987
+ __spreadValues({
24988
+ key: `${i}-${column.id}`,
24989
+ className: classNames(classes),
24990
+ style: __spreadValues(__spreadValues({}, styles2), flexStyles)
24991
+ }, rest),
24992
+ _.normalizeComponent(column.Header, {
24993
+ data: sortedData,
24994
+ column
24995
+ })
24996
+ );
24997
+ }, "makeHeaderGroup");
24998
+ const makeHeaderGroups = /* @__PURE__ */ __name(() => {
24999
+ const theadGroupProps = _.splitProps(
25000
+ getTheadGroupProps(finalState, void 0, void 0, this)
25001
+ );
25002
+ const theadGroupTrProps = _.splitProps(
25003
+ getTheadGroupTrProps(finalState, void 0, void 0, this)
25004
+ );
25005
+ return /* @__PURE__ */ React$1.createElement(
25006
+ TheadComponent,
25007
+ __spreadValues({
25008
+ className: classNames("-headerGroups", theadGroupProps.className),
25009
+ style: __spreadProps(__spreadValues({}, theadGroupProps.style), {
25010
+ minWidth: `${rowMinWidth}px`
25413
25011
  })
25414
- );
25415
- }, "makeHeaderGroup");
25416
- var makeHeaderGroups = /* @__PURE__ */ __name(function makeHeaderGroups2() {
25417
- var theadGroupProps = _.splitProps(getTheadGroupProps(finalState, void 0, void 0, _this2));
25418
- var theadGroupTrProps = _.splitProps(getTheadGroupTrProps(finalState, void 0, void 0, _this2));
25419
- return React$1.createElement(
25420
- TheadComponent,
25421
- _extends$i({
25422
- className: classNames("-headerGroups", theadGroupProps.className),
25423
- style: _extends$i({}, theadGroupProps.style, {
25424
- minWidth: rowMinWidth + "px"
25425
- })
25426
- }, theadGroupProps.rest),
25427
- React$1.createElement(
25428
- TrComponent2,
25429
- _extends$i({
25430
- className: theadGroupTrProps.className,
25431
- style: theadGroupTrProps.style
25432
- }, theadGroupTrProps.rest),
25433
- headerGroups.map(makeHeaderGroup)
25434
- )
25435
- );
25436
- }, "makeHeaderGroups");
25437
- var makeHeader = /* @__PURE__ */ __name(function makeHeader2(column, i) {
25438
- var resizedCol = resized.find(function(x2) {
25439
- return x2.id === column.id;
25440
- }) || {};
25441
- var sort2 = sorted.find(function(d2) {
25442
- return d2.id === column.id;
25443
- });
25444
- var show = typeof column.show === "function" ? column.show() : column.show;
25445
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25446
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25447
- var theadThProps = _.splitProps(getTheadThProps(finalState, void 0, column, _this2));
25448
- var columnHeaderProps = _.splitProps(column.getHeaderProps(finalState, void 0, column, _this2));
25449
- var classes = [column.headerClassName, theadThProps.className, columnHeaderProps.className];
25450
- var styles2 = _extends$i({}, column.headerStyle, theadThProps.style, columnHeaderProps.style);
25451
- var rest = _extends$i({}, theadThProps.rest, columnHeaderProps.rest);
25452
- var isResizable = _.getFirstDefined(column.resizable, resizable, false);
25453
- var resizer = isResizable ? React$1.createElement(ResizerComponent, _extends$i({
25454
- onMouseDown: /* @__PURE__ */ __name(function onMouseDown2(e2) {
25455
- return _this2.resizeColumnStart(e2, column, false);
25456
- }, "onMouseDown"),
25457
- onTouchStart: /* @__PURE__ */ __name(function onTouchStart(e2) {
25458
- return _this2.resizeColumnStart(e2, column, true);
25459
- }, "onTouchStart")
25460
- }, getResizerProps("finalState", void 0, column, _this2))) : null;
25461
- var isSortable = _.getFirstDefined(column.sortable, sortable, false);
25462
- return React$1.createElement(
25463
- ThComponent2,
25464
- _extends$i({
25465
- key: i + "-" + column.id,
25466
- className: classNames(classes, isResizable && "rt-resizable-header", sort2 ? sort2.desc ? "-sort-desc" : "-sort-asc" : "", isSortable && "-cursor-pointer", !show && "-hidden", pivotBy && pivotBy.slice(0, -1).includes(column.id) && "rt-header-pivot"),
25467
- style: _extends$i({}, styles2, {
25468
- flex: width + " 0 auto",
25469
- width: _.asPx(width),
25470
- maxWidth: _.asPx(maxWidth)
25471
- }),
25472
- toggleSort: /* @__PURE__ */ __name(function toggleSort(e2) {
25473
- if (isSortable)
25474
- _this2.sortColumn(column, multiSort ? e2.shiftKey : false);
25475
- }, "toggleSort")
25476
- }, rest),
25477
- React$1.createElement(
25478
- "div",
25479
- { className: classNames(isResizable && "rt-resizable-header-content") },
25480
- _.normalizeComponent(column.Header, {
25481
- data: sortedData,
25482
- column
25483
- })
25012
+ }, theadGroupProps.rest),
25013
+ /* @__PURE__ */ React$1.createElement(
25014
+ TrComponent,
25015
+ __spreadValues({
25016
+ className: theadGroupTrProps.className,
25017
+ style: theadGroupTrProps.style
25018
+ }, theadGroupTrProps.rest),
25019
+ headerGroups.map(makeHeaderGroup)
25020
+ )
25021
+ );
25022
+ }, "makeHeaderGroups");
25023
+ const makeHeader = /* @__PURE__ */ __name((column, i) => {
25024
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25025
+ const sort2 = sorted.find((d2) => d2.id === column.id);
25026
+ const show = typeof column.show === "function" ? column.show() : column.show;
25027
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25028
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25029
+ const theadThProps = _.splitProps(getTheadThProps(finalState, void 0, column, this));
25030
+ const columnHeaderProps = _.splitProps(
25031
+ column.getHeaderProps(finalState, void 0, column, this)
25032
+ );
25033
+ const classes = [column.headerClassName, theadThProps.className, columnHeaderProps.className];
25034
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, column.headerStyle), theadThProps.style), columnHeaderProps.style);
25035
+ const rest = __spreadValues(__spreadValues({}, theadThProps.rest), columnHeaderProps.rest);
25036
+ const isResizable = _.getFirstDefined(column.resizable, resizable, false);
25037
+ const resizer = isResizable ? /* @__PURE__ */ React$1.createElement(
25038
+ ResizerComponent,
25039
+ __spreadValues({
25040
+ onMouseDown: (e2) => this.resizeColumnStart(e2, column, false),
25041
+ onTouchStart: (e2) => this.resizeColumnStart(e2, column, true)
25042
+ }, getResizerProps("finalState", void 0, column, this))
25043
+ ) : null;
25044
+ const isSortable = _.getFirstDefined(column.sortable, sortable, false);
25045
+ return /* @__PURE__ */ React$1.createElement(
25046
+ ThComponent,
25047
+ __spreadValues({
25048
+ key: `${i}-${column.id}`,
25049
+ className: classNames(
25050
+ classes,
25051
+ isResizable && "rt-resizable-header",
25052
+ sort2 ? sort2.desc ? "-sort-desc" : "-sort-asc" : "",
25053
+ isSortable && "-cursor-pointer",
25054
+ !show && "-hidden",
25055
+ pivotBy && pivotBy.slice(0, -1).includes(column.id) && "rt-header-pivot"
25484
25056
  ),
25485
- resizer
25486
- );
25487
- }, "makeHeader");
25488
- var makeHeaders = /* @__PURE__ */ __name(function makeHeaders2() {
25489
- var theadProps = _.splitProps(getTheadProps(finalState, void 0, void 0, _this2));
25490
- var theadTrProps = _.splitProps(getTheadTrProps(finalState, void 0, void 0, _this2));
25491
- return React$1.createElement(
25492
- TheadComponent,
25493
- _extends$i({
25494
- className: classNames("-header", theadProps.className),
25495
- style: _extends$i({}, theadProps.style, {
25496
- minWidth: rowMinWidth + "px"
25497
- })
25498
- }, theadProps.rest),
25499
- React$1.createElement(
25500
- TrComponent2,
25501
- _extends$i({
25502
- className: theadTrProps.className,
25503
- style: theadTrProps.style
25504
- }, theadTrProps.rest),
25505
- allVisibleColumns.map(makeHeader)
25506
- )
25507
- );
25508
- }, "makeHeaders");
25509
- var makeFilter = /* @__PURE__ */ __name(function makeFilter2(column, i) {
25510
- var resizedCol = resized.find(function(x2) {
25511
- return x2.id === column.id;
25512
- }) || {};
25513
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25514
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25515
- var theadFilterThProps = _.splitProps(getTheadFilterThProps(finalState, void 0, column, _this2));
25516
- var columnHeaderProps = _.splitProps(column.getHeaderProps(finalState, void 0, column, _this2));
25517
- var classes = [column.headerClassName, theadFilterThProps.className, columnHeaderProps.className];
25518
- var styles2 = _extends$i({}, column.headerStyle, theadFilterThProps.style, columnHeaderProps.style);
25519
- var rest = _extends$i({}, theadFilterThProps.rest, columnHeaderProps.rest);
25520
- var filter = filtered.find(function(filter2) {
25521
- return filter2.id === column.id;
25522
- });
25523
- var ResolvedFilterComponent = column.Filter || FilterComponent2;
25524
- var isFilterable = _.getFirstDefined(column.filterable, filterable, false);
25525
- return React$1.createElement(
25526
- ThComponent2,
25527
- _extends$i({
25528
- key: i + "-" + column.id,
25529
- className: classNames(classes),
25530
- style: _extends$i({}, styles2, {
25531
- flex: width + " 0 auto",
25532
- width: _.asPx(width),
25533
- maxWidth: _.asPx(maxWidth)
25534
- })
25535
- }, rest),
25536
- isFilterable ? _.normalizeComponent(ResolvedFilterComponent, {
25057
+ style: __spreadProps(__spreadValues({}, styles2), {
25058
+ flex: `${width} 0 auto`,
25059
+ width: _.asPx(width),
25060
+ maxWidth: _.asPx(maxWidth)
25061
+ }),
25062
+ toggleSort: (e2) => {
25063
+ if (isSortable)
25064
+ this.sortColumn(column, multiSort ? e2.shiftKey : false);
25065
+ }
25066
+ }, rest),
25067
+ /* @__PURE__ */ React$1.createElement("div", { className: classNames(isResizable && "rt-resizable-header-content") }, _.normalizeComponent(column.Header, {
25068
+ data: sortedData,
25069
+ column
25070
+ })),
25071
+ resizer
25072
+ );
25073
+ }, "makeHeader");
25074
+ const makeHeaders = /* @__PURE__ */ __name(() => {
25075
+ const theadProps = _.splitProps(getTheadProps(finalState, void 0, void 0, this));
25076
+ const theadTrProps = _.splitProps(getTheadTrProps(finalState, void 0, void 0, this));
25077
+ return /* @__PURE__ */ React$1.createElement(
25078
+ TheadComponent,
25079
+ __spreadValues({
25080
+ className: classNames("-header", theadProps.className),
25081
+ style: __spreadProps(__spreadValues({}, theadProps.style), {
25082
+ minWidth: `${rowMinWidth}px`
25083
+ })
25084
+ }, theadProps.rest),
25085
+ /* @__PURE__ */ React$1.createElement(
25086
+ TrComponent,
25087
+ __spreadValues({
25088
+ className: theadTrProps.className,
25089
+ style: theadTrProps.style
25090
+ }, theadTrProps.rest),
25091
+ allVisibleColumns.map(makeHeader)
25092
+ )
25093
+ );
25094
+ }, "makeHeaders");
25095
+ const makeFilter = /* @__PURE__ */ __name((column, i) => {
25096
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25097
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25098
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25099
+ const theadFilterThProps = _.splitProps(
25100
+ getTheadFilterThProps(finalState, void 0, column, this)
25101
+ );
25102
+ const columnHeaderProps = _.splitProps(
25103
+ column.getHeaderProps(finalState, void 0, column, this)
25104
+ );
25105
+ const classes = [
25106
+ column.headerClassName,
25107
+ theadFilterThProps.className,
25108
+ columnHeaderProps.className
25109
+ ];
25110
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, column.headerStyle), theadFilterThProps.style), columnHeaderProps.style);
25111
+ const rest = __spreadValues(__spreadValues({}, theadFilterThProps.rest), columnHeaderProps.rest);
25112
+ const filter = filtered.find((filter2) => filter2.id === column.id);
25113
+ const ResolvedFilterComponent = column.Filter || FilterComponent;
25114
+ const isFilterable = _.getFirstDefined(column.filterable, filterable, false);
25115
+ return /* @__PURE__ */ React$1.createElement(
25116
+ ThComponent,
25117
+ __spreadValues({
25118
+ key: `${i}-${column.id}`,
25119
+ className: classNames(classes),
25120
+ style: __spreadProps(__spreadValues({}, styles2), {
25121
+ flex: `${width} 0 auto`,
25122
+ width: _.asPx(width),
25123
+ maxWidth: _.asPx(maxWidth)
25124
+ })
25125
+ }, rest),
25126
+ isFilterable ? _.normalizeComponent(
25127
+ ResolvedFilterComponent,
25128
+ {
25537
25129
  column,
25538
25130
  filter,
25539
- onChange: /* @__PURE__ */ __name(function onChange(value) {
25540
- return _this2.filterColumn(column, value);
25541
- }, "onChange")
25542
- }, defaultProps$1.column.Filter) : null
25543
- );
25544
- }, "makeFilter");
25545
- var makeFilters = /* @__PURE__ */ __name(function makeFilters2() {
25546
- var theadFilterProps = _.splitProps(getTheadFilterProps(finalState, void 0, void 0, _this2));
25547
- var theadFilterTrProps = _.splitProps(getTheadFilterTrProps(finalState, void 0, void 0, _this2));
25548
- return React$1.createElement(
25549
- TheadComponent,
25550
- _extends$i({
25551
- className: classNames("-filters", theadFilterProps.className),
25552
- style: _extends$i({}, theadFilterProps.style, {
25553
- minWidth: rowMinWidth + "px"
25554
- })
25555
- }, theadFilterProps.rest),
25556
- React$1.createElement(
25557
- TrComponent2,
25558
- _extends$i({
25559
- className: theadFilterTrProps.className,
25560
- style: theadFilterTrProps.style
25561
- }, theadFilterTrProps.rest),
25562
- allVisibleColumns.map(makeFilter)
25563
- )
25564
- );
25565
- }, "makeFilters");
25566
- var makePageRow = /* @__PURE__ */ __name(function makePageRow2(row, i) {
25567
- var path2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
25568
- var rowInfo = {
25569
- original: row[originalKey],
25570
- row,
25571
- index: row[indexKey],
25572
- viewIndex: rowIndex += 1,
25573
- pageSize,
25574
- page,
25575
- level: path2.length,
25576
- nestingPath: path2.concat([i]),
25577
- aggregated: row[aggregatedKey],
25578
- groupedByPivot: row[groupedByPivotKey],
25579
- subRows: row[subRowsKey]
25580
- };
25581
- var isExpanded = _.get(expanded, rowInfo.nestingPath);
25582
- var trGroupProps = getTrGroupProps(finalState, rowInfo, void 0, _this2);
25583
- var trProps = _.splitProps(getTrProps(finalState, rowInfo, void 0, _this2));
25584
- return React$1.createElement(
25585
- TrGroupComponent2,
25586
- _extends$i({ key: rowInfo.nestingPath.join("_") }, trGroupProps),
25587
- React$1.createElement(
25588
- TrComponent2,
25589
- _extends$i({
25590
- className: classNames(trProps.className, row._viewIndex % 2 ? "-even" : "-odd"),
25591
- style: trProps.style
25592
- }, trProps.rest),
25593
- allVisibleColumns.map(function(column, i2) {
25594
- var resizedCol = resized.find(function(x2) {
25595
- return x2.id === column.id;
25596
- }) || {};
25597
- var show = typeof column.show === "function" ? column.show() : column.show;
25598
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25599
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25600
- var tdProps = _.splitProps(getTdProps(finalState, rowInfo, column, _this2));
25601
- var columnProps = _.splitProps(column.getProps(finalState, rowInfo, column, _this2));
25602
- var classes = [tdProps.className, column.className, columnProps.className];
25603
- var styles2 = _extends$i({}, tdProps.style, column.style, columnProps.style);
25604
- var cellInfo = _extends$i({}, rowInfo, {
25605
- isExpanded,
25606
- column: _extends$i({}, column),
25607
- value: rowInfo.row[column.id],
25608
- pivoted: column.pivoted,
25609
- expander: column.expander,
25610
- resized,
25611
- show,
25612
- width,
25613
- maxWidth,
25614
- tdProps,
25615
- columnProps,
25616
- classes,
25617
- styles: styles2
25618
- });
25619
- var value = cellInfo.value;
25620
- var useOnExpanderClick = void 0;
25621
- var isBranch = void 0;
25622
- var isPreview = void 0;
25623
- var onExpanderClick = /* @__PURE__ */ __name(function onExpanderClick2(e2) {
25624
- var newExpanded = _.clone(expanded);
25625
- if (isExpanded) {
25626
- newExpanded = _.set(newExpanded, cellInfo.nestingPath, false);
25627
- } else {
25628
- newExpanded = _.set(newExpanded, cellInfo.nestingPath, {});
25629
- }
25630
- return _this2.setStateWithData({
25631
- expanded: newExpanded
25632
- }, function() {
25633
- return onExpandedChange && onExpandedChange(newExpanded, cellInfo.nestingPath, e2, cellInfo);
25634
- });
25635
- }, "onExpanderClick");
25636
- var resolvedCell = _.normalizeComponent(column.Cell, cellInfo, value);
25637
- var ResolvedAggregatedComponent = column.Aggregated || (!column.aggregate ? AggregatedComponent2 : column.Cell);
25638
- var ResolvedExpanderComponent = column.Expander || ExpanderComponent2;
25639
- var ResolvedPivotValueComponent = column.PivotValue || PivotValueComponent2;
25640
- var DefaultResolvedPivotComponent = PivotComponent || function(props) {
25641
- return React$1.createElement(
25642
- "div",
25643
- null,
25644
- React$1.createElement(ResolvedExpanderComponent, props),
25645
- React$1.createElement(ResolvedPivotValueComponent, props)
25646
- );
25647
- };
25648
- var ResolvedPivotComponent = column.Pivot || DefaultResolvedPivotComponent;
25649
- if (cellInfo.pivoted || cellInfo.expander) {
25650
- cellInfo.expandable = true;
25651
- useOnExpanderClick = true;
25652
- if (cellInfo.pivoted && !cellInfo.subRows && !SubComponent) {
25653
- cellInfo.expandable = false;
25654
- }
25655
- }
25656
- if (cellInfo.pivoted) {
25657
- isBranch = rowInfo.row[pivotIDKey] === column.id && cellInfo.subRows;
25658
- isPreview = pivotBy.indexOf(column.id) > pivotBy.indexOf(rowInfo.row[pivotIDKey]) && cellInfo.subRows;
25659
- if (isBranch) {
25660
- resolvedCell = _.normalizeComponent(ResolvedPivotComponent, _extends$i({}, cellInfo, {
25661
- value: row[pivotValKey]
25662
- }), row[pivotValKey]);
25663
- } else if (isPreview) {
25664
- resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25665
- } else {
25666
- resolvedCell = null;
25667
- }
25668
- } else if (cellInfo.aggregated) {
25669
- resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25670
- }
25671
- if (cellInfo.expander) {
25672
- resolvedCell = _.normalizeComponent(ResolvedExpanderComponent, cellInfo, row[pivotValKey]);
25673
- if (pivotBy) {
25674
- if (cellInfo.groupedByPivot) {
25675
- resolvedCell = null;
25676
- }
25677
- if (!cellInfo.subRows && !SubComponent) {
25678
- resolvedCell = null;
25679
- }
25680
- }
25681
- }
25682
- var resolvedOnExpanderClick = useOnExpanderClick ? onExpanderClick : function() {
25683
- };
25684
- var interactionProps = {
25685
- onClick: resolvedOnExpanderClick
25686
- };
25687
- if (tdProps.rest.onClick) {
25688
- interactionProps.onClick = function(e2) {
25689
- tdProps.rest.onClick(e2, function() {
25690
- return resolvedOnExpanderClick(e2);
25691
- });
25692
- };
25131
+ onChange: (value) => this.filterColumn(column, value)
25132
+ },
25133
+ defaultProps$1.column.Filter
25134
+ ) : null
25135
+ );
25136
+ }, "makeFilter");
25137
+ const makeFilters = /* @__PURE__ */ __name(() => {
25138
+ const theadFilterProps = _.splitProps(
25139
+ getTheadFilterProps(finalState, void 0, void 0, this)
25140
+ );
25141
+ const theadFilterTrProps = _.splitProps(
25142
+ getTheadFilterTrProps(finalState, void 0, void 0, this)
25143
+ );
25144
+ return /* @__PURE__ */ React$1.createElement(
25145
+ TheadComponent,
25146
+ __spreadValues({
25147
+ className: classNames("-filters", theadFilterProps.className),
25148
+ style: __spreadProps(__spreadValues({}, theadFilterProps.style), {
25149
+ minWidth: `${rowMinWidth}px`
25150
+ })
25151
+ }, theadFilterProps.rest),
25152
+ /* @__PURE__ */ React$1.createElement(
25153
+ TrComponent,
25154
+ __spreadValues({
25155
+ className: theadFilterTrProps.className,
25156
+ style: theadFilterTrProps.style
25157
+ }, theadFilterTrProps.rest),
25158
+ allVisibleColumns.map(makeFilter)
25159
+ )
25160
+ );
25161
+ }, "makeFilters");
25162
+ const makePageRow = /* @__PURE__ */ __name((row, i, path2 = []) => {
25163
+ const rowInfo = {
25164
+ original: row[originalKey],
25165
+ row,
25166
+ index: row[indexKey],
25167
+ viewIndex: rowIndex += 1,
25168
+ pageSize,
25169
+ page,
25170
+ level: path2.length,
25171
+ nestingPath: path2.concat([i]),
25172
+ aggregated: row[aggregatedKey],
25173
+ groupedByPivot: row[groupedByPivotKey],
25174
+ subRows: row[subRowsKey]
25175
+ };
25176
+ const isExpanded = _.get(expanded, rowInfo.nestingPath);
25177
+ const trGroupProps = getTrGroupProps(finalState, rowInfo, void 0, this);
25178
+ const trProps = _.splitProps(getTrProps(finalState, rowInfo, void 0, this));
25179
+ return /* @__PURE__ */ React$1.createElement(TrGroupComponent, __spreadValues({ key: rowInfo.nestingPath.join("_") }, trGroupProps), /* @__PURE__ */ React$1.createElement(
25180
+ TrComponent,
25181
+ __spreadValues({
25182
+ className: classNames(trProps.className, row._viewIndex % 2 ? "-even" : "-odd"),
25183
+ style: trProps.style
25184
+ }, trProps.rest),
25185
+ allVisibleColumns.map((column, i2) => {
25186
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25187
+ const show = typeof column.show === "function" ? column.show() : column.show;
25188
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25189
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25190
+ const tdProps = _.splitProps(getTdProps(finalState, rowInfo, column, this));
25191
+ const columnProps = _.splitProps(column.getProps(finalState, rowInfo, column, this));
25192
+ const classes = [tdProps.className, column.className, columnProps.className];
25193
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, tdProps.style), column.style), columnProps.style);
25194
+ const cellInfo = __spreadProps(__spreadValues({}, rowInfo), {
25195
+ isExpanded,
25196
+ column: __spreadValues({}, column),
25197
+ value: rowInfo.row[column.id],
25198
+ pivoted: column.pivoted,
25199
+ expander: column.expander,
25200
+ resized,
25201
+ show,
25202
+ width,
25203
+ maxWidth,
25204
+ tdProps,
25205
+ columnProps,
25206
+ classes,
25207
+ styles: styles2
25208
+ });
25209
+ const value = cellInfo.value;
25210
+ let useOnExpanderClick;
25211
+ let isBranch;
25212
+ let isPreview;
25213
+ const onExpanderClick = /* @__PURE__ */ __name((e2) => {
25214
+ let newExpanded = _.clone(expanded);
25215
+ if (isExpanded) {
25216
+ newExpanded = _.set(newExpanded, cellInfo.nestingPath, false);
25217
+ } else {
25218
+ newExpanded = _.set(newExpanded, cellInfo.nestingPath, {});
25219
+ }
25220
+ return this.setStateWithData(
25221
+ {
25222
+ expanded: newExpanded
25223
+ },
25224
+ () => onExpandedChange && onExpandedChange(newExpanded, cellInfo.nestingPath, e2, cellInfo)
25225
+ );
25226
+ }, "onExpanderClick");
25227
+ let resolvedCell = _.normalizeComponent(column.Cell, cellInfo, value);
25228
+ const ResolvedAggregatedComponent = column.Aggregated || (!column.aggregate ? AggregatedComponent : column.Cell);
25229
+ const ResolvedExpanderComponent = column.Expander || ExpanderComponent;
25230
+ const ResolvedPivotValueComponent = column.PivotValue || PivotValueComponent;
25231
+ const DefaultResolvedPivotComponent = PivotComponent || ((props) => /* @__PURE__ */ React$1.createElement("div", null, /* @__PURE__ */ React$1.createElement(ResolvedExpanderComponent, __spreadValues({}, props)), /* @__PURE__ */ React$1.createElement(ResolvedPivotValueComponent, __spreadValues({}, props))));
25232
+ const ResolvedPivotComponent = column.Pivot || DefaultResolvedPivotComponent;
25233
+ if (cellInfo.pivoted || cellInfo.expander) {
25234
+ cellInfo.expandable = true;
25235
+ useOnExpanderClick = true;
25236
+ if (cellInfo.pivoted && !cellInfo.subRows && !SubComponent) {
25237
+ cellInfo.expandable = false;
25238
+ }
25239
+ }
25240
+ if (cellInfo.pivoted) {
25241
+ isBranch = rowInfo.row[pivotIDKey] === column.id && cellInfo.subRows;
25242
+ isPreview = pivotBy.indexOf(column.id) > pivotBy.indexOf(rowInfo.row[pivotIDKey]) && cellInfo.subRows;
25243
+ if (isBranch) {
25244
+ resolvedCell = _.normalizeComponent(
25245
+ ResolvedPivotComponent,
25246
+ __spreadProps(__spreadValues({}, cellInfo), {
25247
+ value: row[pivotValKey]
25248
+ }),
25249
+ row[pivotValKey]
25250
+ );
25251
+ } else if (isPreview) {
25252
+ resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25253
+ } else {
25254
+ resolvedCell = null;
25255
+ }
25256
+ } else if (cellInfo.aggregated) {
25257
+ resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25258
+ }
25259
+ if (cellInfo.expander) {
25260
+ resolvedCell = _.normalizeComponent(
25261
+ ResolvedExpanderComponent,
25262
+ cellInfo,
25263
+ row[pivotValKey]
25264
+ );
25265
+ if (pivotBy) {
25266
+ if (cellInfo.groupedByPivot) {
25267
+ resolvedCell = null;
25693
25268
  }
25694
- if (columnProps.rest.onClick) {
25695
- interactionProps.onClick = function(e2) {
25696
- columnProps.rest.onClick(e2, function() {
25697
- return resolvedOnExpanderClick(e2);
25698
- });
25699
- };
25269
+ if (!cellInfo.subRows && !SubComponent) {
25270
+ resolvedCell = null;
25700
25271
  }
25701
- return React$1.createElement(
25702
- TdComponent2,
25703
- _extends$i({
25704
- key: i2 + "-" + column.id,
25705
- className: classNames(classes, !cellInfo.expandable && !show && "hidden", cellInfo.expandable && "rt-expandable", (isBranch || isPreview) && "rt-pivot"),
25706
- style: _extends$i({}, styles2, {
25707
- flex: width + " 0 auto",
25708
- width: _.asPx(width),
25709
- maxWidth: _.asPx(maxWidth)
25710
- })
25711
- }, tdProps.rest, columnProps.rest, interactionProps),
25712
- resolvedCell
25713
- );
25714
- })
25272
+ }
25273
+ }
25274
+ const resolvedOnExpanderClick = useOnExpanderClick ? onExpanderClick : () => {
25275
+ };
25276
+ const interactionProps = {
25277
+ onClick: resolvedOnExpanderClick
25278
+ };
25279
+ if (tdProps.rest.onClick) {
25280
+ interactionProps.onClick = (e2) => {
25281
+ tdProps.rest.onClick(e2, () => resolvedOnExpanderClick(e2));
25282
+ };
25283
+ }
25284
+ if (columnProps.rest.onClick) {
25285
+ interactionProps.onClick = (e2) => {
25286
+ columnProps.rest.onClick(e2, () => resolvedOnExpanderClick(e2));
25287
+ };
25288
+ }
25289
+ return /* @__PURE__ */ React$1.createElement(
25290
+ TdComponent,
25291
+ __spreadValues(__spreadValues(__spreadValues({
25292
+ key: `${i2}-${column.id}`,
25293
+ className: classNames(
25294
+ classes,
25295
+ !cellInfo.expandable && !show && "hidden",
25296
+ cellInfo.expandable && "rt-expandable",
25297
+ (isBranch || isPreview) && "rt-pivot"
25298
+ ),
25299
+ style: __spreadProps(__spreadValues({}, styles2), {
25300
+ flex: `${width} 0 auto`,
25301
+ width: _.asPx(width),
25302
+ maxWidth: _.asPx(maxWidth)
25303
+ })
25304
+ }, tdProps.rest), columnProps.rest), interactionProps),
25305
+ resolvedCell
25306
+ );
25307
+ })
25308
+ ), rowInfo.subRows && isExpanded && rowInfo.subRows.map((d2, i2) => makePageRow(d2, i2, rowInfo.nestingPath)), SubComponent && !rowInfo.subRows && isExpanded && SubComponent(rowInfo, () => {
25309
+ const newExpanded = _.clone(expanded);
25310
+ _.set(newExpanded, rowInfo.nestingPath, false);
25311
+ }));
25312
+ }, "makePageRow");
25313
+ const makePadColumn = /* @__PURE__ */ __name((column, i) => {
25314
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25315
+ const show = typeof column.show === "function" ? column.show() : column.show;
25316
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25317
+ const flex2 = width;
25318
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25319
+ const tdProps = _.splitProps(getTdProps(finalState, void 0, column, this));
25320
+ const columnProps = _.splitProps(column.getProps(finalState, void 0, column, this));
25321
+ const classes = [tdProps.className, column.className, columnProps.className];
25322
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, tdProps.style), column.style), columnProps.style);
25323
+ return /* @__PURE__ */ React$1.createElement(
25324
+ TdComponent,
25325
+ __spreadValues({
25326
+ key: `${i}-${column.id}`,
25327
+ className: classNames(classes, !show && "hidden"),
25328
+ style: __spreadProps(__spreadValues({}, styles2), {
25329
+ flex: `${flex2} 0 auto`,
25330
+ width: _.asPx(width),
25331
+ maxWidth: _.asPx(maxWidth)
25332
+ })
25333
+ }, tdProps.rest),
25334
+ _.normalizeComponent(PadRowComponent)
25335
+ );
25336
+ }, "makePadColumn");
25337
+ const makePadRow = /* @__PURE__ */ __name((row, i) => {
25338
+ const trGroupProps = getTrGroupProps(finalState, void 0, void 0, this);
25339
+ const trProps = _.splitProps(getTrProps(finalState, void 0, void 0, this));
25340
+ return /* @__PURE__ */ React$1.createElement(TrGroupComponent, __spreadValues({ key: `pad-${i}` }, trGroupProps), /* @__PURE__ */ React$1.createElement(
25341
+ TrComponent,
25342
+ {
25343
+ className: classNames(
25344
+ "-padRow",
25345
+ (pageRows.length + i) % 2 ? "-even" : "-odd",
25346
+ trProps.className
25715
25347
  ),
25716
- rowInfo.subRows && isExpanded && rowInfo.subRows.map(function(d2, i2) {
25717
- return makePageRow2(d2, i2, rowInfo.nestingPath);
25718
- }),
25719
- SubComponent && !rowInfo.subRows && isExpanded && SubComponent(rowInfo, function() {
25720
- var newExpanded = _.clone(expanded);
25721
- _.set(newExpanded, rowInfo.nestingPath, false);
25348
+ style: trProps.style || {}
25349
+ },
25350
+ allVisibleColumns.map(makePadColumn)
25351
+ ));
25352
+ }, "makePadRow");
25353
+ const makeColumnFooter = /* @__PURE__ */ __name((column, i) => {
25354
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25355
+ const show = typeof column.show === "function" ? column.show() : column.show;
25356
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25357
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25358
+ const tFootTdProps = _.splitProps(getTfootTdProps(finalState, void 0, column, this));
25359
+ const columnProps = _.splitProps(column.getProps(finalState, void 0, column, this));
25360
+ const columnFooterProps = _.splitProps(
25361
+ column.getFooterProps(finalState, void 0, column, this)
25362
+ );
25363
+ const classes = [
25364
+ tFootTdProps.className,
25365
+ column.className,
25366
+ columnProps.className,
25367
+ columnFooterProps.className
25368
+ ];
25369
+ const styles2 = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, tFootTdProps.style), column.style), columnProps.style), columnFooterProps.style);
25370
+ return /* @__PURE__ */ React$1.createElement(
25371
+ TdComponent,
25372
+ __spreadValues(__spreadValues(__spreadValues({
25373
+ key: `${i}-${column.id}`,
25374
+ className: classNames(classes, !show && "hidden"),
25375
+ style: __spreadProps(__spreadValues({}, styles2), {
25376
+ flex: `${width} 0 auto`,
25377
+ width: _.asPx(width),
25378
+ maxWidth: _.asPx(maxWidth)
25722
25379
  })
25723
- );
25724
- }, "makePageRow");
25725
- var makePadColumn = /* @__PURE__ */ __name(function makePadColumn2(column, i) {
25726
- var resizedCol = resized.find(function(x2) {
25727
- return x2.id === column.id;
25728
- }) || {};
25729
- var show = typeof column.show === "function" ? column.show() : column.show;
25730
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25731
- var flex2 = width;
25732
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25733
- var tdProps = _.splitProps(getTdProps(finalState, void 0, column, _this2));
25734
- var columnProps = _.splitProps(column.getProps(finalState, void 0, column, _this2));
25735
- var classes = [tdProps.className, column.className, columnProps.className];
25736
- var styles2 = _extends$i({}, tdProps.style, column.style, columnProps.style);
25737
- return React$1.createElement(
25738
- TdComponent2,
25739
- _extends$i({
25740
- key: i + "-" + column.id,
25741
- className: classNames(classes, !show && "hidden"),
25742
- style: _extends$i({}, styles2, {
25743
- flex: flex2 + " 0 auto",
25744
- width: _.asPx(width),
25745
- maxWidth: _.asPx(maxWidth)
25746
- })
25747
- }, tdProps.rest),
25748
- _.normalizeComponent(PadRowComponent2)
25749
- );
25750
- }, "makePadColumn");
25751
- var makePadRow = /* @__PURE__ */ __name(function makePadRow2(row, i) {
25752
- var trGroupProps = getTrGroupProps(finalState, void 0, void 0, _this2);
25753
- var trProps = _.splitProps(getTrProps(finalState, void 0, void 0, _this2));
25754
- return React$1.createElement(
25755
- TrGroupComponent2,
25756
- _extends$i({ key: "pad-" + i }, trGroupProps),
25757
- React$1.createElement(
25758
- TrComponent2,
25759
- {
25760
- className: classNames("-padRow", (pageRows.length + i) % 2 ? "-even" : "-odd", trProps.className),
25761
- style: trProps.style || {}
25762
- },
25763
- allVisibleColumns.map(makePadColumn)
25764
- )
25765
- );
25766
- }, "makePadRow");
25767
- var makeColumnFooter = /* @__PURE__ */ __name(function makeColumnFooter2(column, i) {
25768
- var resizedCol = resized.find(function(x2) {
25769
- return x2.id === column.id;
25770
- }) || {};
25771
- var show = typeof column.show === "function" ? column.show() : column.show;
25772
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25773
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25774
- var tFootTdProps = _.splitProps(getTfootTdProps(finalState, void 0, column, _this2));
25775
- var columnProps = _.splitProps(column.getProps(finalState, void 0, column, _this2));
25776
- var columnFooterProps = _.splitProps(column.getFooterProps(finalState, void 0, column, _this2));
25777
- var classes = [tFootTdProps.className, column.className, columnProps.className, columnFooterProps.className];
25778
- var styles2 = _extends$i({}, tFootTdProps.style, column.style, columnProps.style, columnFooterProps.style);
25779
- return React$1.createElement(
25780
- TdComponent2,
25781
- _extends$i({
25782
- key: i + "-" + column.id,
25783
- className: classNames(classes, !show && "hidden"),
25784
- style: _extends$i({}, styles2, {
25785
- flex: width + " 0 auto",
25786
- width: _.asPx(width),
25787
- maxWidth: _.asPx(maxWidth)
25788
- })
25789
- }, columnProps.rest, tFootTdProps.rest, columnFooterProps.rest),
25790
- _.normalizeComponent(column.Footer, {
25791
- data: sortedData,
25792
- column
25380
+ }, columnProps.rest), tFootTdProps.rest), columnFooterProps.rest),
25381
+ _.normalizeComponent(column.Footer, {
25382
+ data: sortedData,
25383
+ column
25384
+ })
25385
+ );
25386
+ }, "makeColumnFooter");
25387
+ const makeColumnFooters = /* @__PURE__ */ __name(() => {
25388
+ const tFootProps = _.splitProps(getTfootProps(finalState, void 0, void 0, this));
25389
+ const tFootTrProps = _.splitProps(getTfootTrProps(finalState, void 0, void 0, this));
25390
+ return /* @__PURE__ */ React$1.createElement(
25391
+ TfootComponent,
25392
+ __spreadValues({
25393
+ className: tFootProps.className,
25394
+ style: __spreadProps(__spreadValues({}, tFootProps.style), {
25395
+ minWidth: `${rowMinWidth}px`
25793
25396
  })
25794
- );
25795
- }, "makeColumnFooter");
25796
- var makeColumnFooters = /* @__PURE__ */ __name(function makeColumnFooters2() {
25797
- var tFootProps = _.splitProps(getTfootProps(finalState, void 0, void 0, _this2));
25798
- var tFootTrProps = _.splitProps(getTfootTrProps(finalState, void 0, void 0, _this2));
25799
- return React$1.createElement(
25800
- TfootComponent,
25801
- _extends$i({
25802
- className: tFootProps.className,
25803
- style: _extends$i({}, tFootProps.style, {
25804
- minWidth: rowMinWidth + "px"
25805
- })
25806
- }, tFootProps.rest),
25807
- React$1.createElement(
25808
- TrComponent2,
25809
- _extends$i({
25810
- className: classNames(tFootTrProps.className),
25811
- style: tFootTrProps.style
25812
- }, tFootTrProps.rest),
25813
- allVisibleColumns.map(makeColumnFooter)
25814
- )
25815
- );
25816
- }, "makeColumnFooters");
25817
- var makePagination = /* @__PURE__ */ __name(function makePagination2(isTop) {
25818
- var paginationProps = _.splitProps(getPaginationProps(finalState, void 0, void 0, _this2));
25819
- return React$1.createElement(PaginationComponent, _extends$i({}, resolvedState, {
25397
+ }, tFootProps.rest),
25398
+ /* @__PURE__ */ React$1.createElement(
25399
+ TrComponent,
25400
+ __spreadValues({
25401
+ className: classNames(tFootTrProps.className),
25402
+ style: tFootTrProps.style
25403
+ }, tFootTrProps.rest),
25404
+ allVisibleColumns.map(makeColumnFooter)
25405
+ )
25406
+ );
25407
+ }, "makeColumnFooters");
25408
+ const makePagination = /* @__PURE__ */ __name((isTop) => {
25409
+ const paginationProps = _.splitProps(
25410
+ getPaginationProps(finalState, void 0, void 0, this)
25411
+ );
25412
+ return /* @__PURE__ */ React$1.createElement(
25413
+ PaginationComponent,
25414
+ __spreadValues(__spreadProps(__spreadValues({}, resolvedState), {
25820
25415
  pages,
25821
25416
  canPrevious,
25822
25417
  canNext,
25823
- onPageChange: _this2.onPageChange,
25824
- onPageSizeChange: _this2.onPageSizeChange,
25418
+ onPageChange: this.onPageChange,
25419
+ onPageSizeChange: this.onPageSizeChange,
25825
25420
  className: paginationProps.className,
25826
25421
  style: paginationProps.style,
25827
25422
  isTop
25828
- }, paginationProps.rest));
25829
- }, "makePagination");
25830
- var makeTable = /* @__PURE__ */ __name(function makeTable2() {
25831
- return React$1.createElement(
25832
- "div",
25833
- _extends$i({
25834
- className: classNames("ReactTable", className, rootProps.className),
25835
- style: _extends$i({}, style2, rootProps.style)
25836
- }, rootProps.rest),
25837
- showPagination && showPaginationTop ? React$1.createElement(
25838
- "div",
25839
- { className: "pagination-top" },
25840
- makePagination(true)
25841
- ) : null,
25842
- React$1.createElement(
25843
- TableComponent2,
25844
- _extends$i({
25845
- className: classNames(tableProps.className, currentlyResizing ? "rt-resizing" : ""),
25846
- style: tableProps.style
25847
- }, tableProps.rest),
25848
- hasHeaderGroups ? makeHeaderGroups() : null,
25849
- makeHeaders(),
25850
- hasFilters ? makeFilters() : null,
25851
- React$1.createElement(
25852
- TbodyComponent,
25853
- _extends$i({
25854
- className: classNames(tBodyProps.className),
25855
- style: _extends$i({}, tBodyProps.style, {
25856
- minWidth: rowMinWidth + "px"
25857
- })
25858
- }, tBodyProps.rest),
25859
- pageRows.length < 200 ? pageRows.map(function(d2, i) {
25860
- return makePageRow(d2, i);
25861
- }) : React$1.createElement(ReactList, {
25862
- type: "variable",
25863
- itemSizeEstimator: _this2.props.itemSizeEstimator || itemSizeEstimator,
25864
- itemRenderer: /* @__PURE__ */ __name(function itemRenderer(i) {
25865
- return makePageRow(pageRows[i], i);
25866
- }, "itemRenderer"),
25867
- length: pageRows.length
25868
- }),
25869
- padRows.map(makePadRow),
25870
- additionalBodyEl
25871
- ),
25872
- hasColumnFooter ? makeColumnFooters() : null
25873
- ),
25874
- showPagination && showPaginationBottom ? React$1.createElement(
25875
- "div",
25876
- { className: "pagination-bottom" },
25877
- makePagination(false)
25878
- ) : null,
25879
- !pageRows.length && React$1.createElement(
25880
- NoDataComponent,
25881
- noDataProps,
25882
- _.normalizeComponent(noDataText)
25423
+ }), paginationProps.rest)
25424
+ );
25425
+ }, "makePagination");
25426
+ const makeTable = /* @__PURE__ */ __name(() => /* @__PURE__ */ React$1.createElement(
25427
+ "div",
25428
+ __spreadProps(__spreadValues({
25429
+ className: classNames("ReactTable", className, rootProps.className),
25430
+ style: __spreadValues(__spreadValues({}, style2), rootProps.style)
25431
+ }, rootProps.rest), {
25432
+ ref: (r2) => {
25433
+ if (!r2)
25434
+ return;
25435
+ if (rootProps.rest.ref) {
25436
+ rootProps.rest.ref(r2);
25437
+ }
25438
+ this.tableRef = r2;
25439
+ }
25440
+ }),
25441
+ showPagination && showPaginationTop ? /* @__PURE__ */ React$1.createElement("div", { className: "pagination-top" }, makePagination(true)) : null,
25442
+ /* @__PURE__ */ React$1.createElement(
25443
+ TableComponent,
25444
+ __spreadValues({
25445
+ className: classNames(tableProps.className, currentlyResizing ? "rt-resizing" : ""),
25446
+ style: tableProps.style
25447
+ }, tableProps.rest),
25448
+ hasHeaderGroups ? makeHeaderGroups() : null,
25449
+ makeHeaders(),
25450
+ hasFilters ? makeFilters() : null,
25451
+ /* @__PURE__ */ React$1.createElement(
25452
+ TbodyComponent,
25453
+ __spreadValues({
25454
+ className: classNames(tBodyProps.className),
25455
+ style: __spreadProps(__spreadValues({}, tBodyProps.style), {
25456
+ minWidth: `${rowMinWidth}px`
25457
+ })
25458
+ }, tBodyProps.rest),
25459
+ pageRows.length < 200 ? pageRows.map((d2, i) => makePageRow(d2, i)) : /* @__PURE__ */ React$1.createElement(
25460
+ ReactList,
25461
+ {
25462
+ type: "variable",
25463
+ itemSizeEstimator: this.props.itemSizeEstimator || itemSizeEstimator,
25464
+ itemRenderer: (i) => makePageRow(pageRows[i], i),
25465
+ length: pageRows.length
25466
+ }
25883
25467
  ),
25884
- React$1.createElement(LoadingComponent3, _extends$i({ loading, loadingText }, loadingProps))
25885
- );
25886
- }, "makeTable");
25887
- return children ? children(finalState, makeTable, this) : makeTable();
25888
- }, "render")
25889
- }]);
25890
- return ReactTable2;
25891
- }(Methods(Lifecycle(React$1.Component)));
25892
- ReactTable.propTypes = propTypes;
25893
- ReactTable.defaultProps = defaultProps$1;
25468
+ padRows.map(makePadRow),
25469
+ additionalBodyEl
25470
+ ),
25471
+ hasColumnFooter ? makeColumnFooters() : null
25472
+ ),
25473
+ showPagination && showPaginationBottom ? /* @__PURE__ */ React$1.createElement("div", { className: "pagination-bottom" }, makePagination(false)) : null,
25474
+ !pageRows.length && /* @__PURE__ */ React$1.createElement(NoDataComponent, __spreadValues({}, noDataProps), _.normalizeComponent(noDataText)),
25475
+ /* @__PURE__ */ React$1.createElement(LoadingComponent2, __spreadValues({ loading, loadingText }, loadingProps))
25476
+ ), "makeTable");
25477
+ return children ? children(finalState, makeTable, this) : makeTable();
25478
+ }
25479
+ };
25480
+ __name(_ReactTable, "ReactTable");
25481
+ __publicField(_ReactTable, "propTypes", propTypes);
25482
+ __publicField(_ReactTable, "defaultProps", defaultProps$1);
25483
+ let ReactTable = _ReactTable;
25894
25484
  var dayjs_min = { exports: {} };
25895
25485
  (function(module2, exports2) {
25896
25486
  !function(t2, e2) {
@@ -44202,7 +43792,7 @@ function arrayEach$2(array2, iteratee) {
44202
43792
  }
44203
43793
  __name(arrayEach$2, "arrayEach$2");
44204
43794
  var _arrayEach = arrayEach$2;
44205
- var defineProperty$3 = _defineProperty$6;
43795
+ var defineProperty$3 = _defineProperty$5;
44206
43796
  function baseAssignValue$3(object2, key, value) {
44207
43797
  if (key == "__proto__" && defineProperty$3) {
44208
43798
  defineProperty$3(object2, key, {
@@ -53812,8 +53402,8 @@ const renderSuggest = /* @__PURE__ */ __name((props) => {
53812
53402
  });
53813
53403
  return /* @__PURE__ */ React$1.createElement(TgSuggest, __spreadValues({}, propsToUse));
53814
53404
  }, "renderSuggest");
53815
- const BPSelect = /* @__PURE__ */ __name((_c) => {
53816
- var _d = _c, { value, onChange } = _d, rest = __objRest(_d, ["value", "onChange"]);
53405
+ const BPSelect = /* @__PURE__ */ __name((_q) => {
53406
+ var _r = _q, { value, onChange } = _r, rest = __objRest(_r, ["value", "onChange"]);
53817
53407
  return renderSelect(__spreadProps(__spreadValues({}, rest), { input: { onChange, value } }));
53818
53408
  }, "BPSelect");
53819
53409
  const renderSelect = /* @__PURE__ */ __name((props) => {
@@ -53948,12 +53538,12 @@ const renderBlueprintNumericInput = /* @__PURE__ */ __name((props) => {
53948
53538
  })
53949
53539
  );
53950
53540
  }, "renderBlueprintNumericInput");
53951
- const renderBlueprintRadioGroup = /* @__PURE__ */ __name((_e) => {
53952
- var _f = _e, {
53541
+ const renderBlueprintRadioGroup = /* @__PURE__ */ __name((_s) => {
53542
+ var _t = _s, {
53953
53543
  input,
53954
53544
  options,
53955
53545
  onFieldSubmit
53956
- } = _f, rest = __objRest(_f, [
53546
+ } = _t, rest = __objRest(_t, [
53957
53547
  "input",
53958
53548
  "options",
53959
53549
  "onFieldSubmit"
@@ -54464,10 +54054,10 @@ const _DisplayOptions = class _DisplayOptions extends React$1.Component {
54464
54054
  };
54465
54055
  __name(_DisplayOptions, "DisplayOptions");
54466
54056
  let DisplayOptions = _DisplayOptions;
54467
- const { LoadingComponent: LoadingComponent2 } = ReactTableDefaults;
54057
+ const { LoadingComponent } = ReactTableDefaults;
54468
54058
  function DisabledLoadingComponent({ disabled, loading, loadingText }) {
54469
54059
  return /* @__PURE__ */ React$1.createElement(
54470
- LoadingComponent2,
54060
+ LoadingComponent,
54471
54061
  {
54472
54062
  className: disabled ? "disabled" : "",
54473
54063
  loading,
@@ -54643,7 +54233,7 @@ function createLocation(path2, state, key, currentLocation) {
54643
54233
  location2 = parsePath(path2);
54644
54234
  location2.state = state;
54645
54235
  } else {
54646
- location2 = _extends$n({}, path2);
54236
+ location2 = _extends$i({}, path2);
54647
54237
  if (location2.pathname === void 0)
54648
54238
  location2.pathname = "";
54649
54239
  if (location2.search) {
@@ -57143,8 +56733,8 @@ const _DataTable = class _DataTable extends React$1.Component {
57143
56733
  };
57144
56734
  }),
57145
56735
  branch(({ immovable }) => "true" !== immovable, sortableElement)
57146
- )((_g) => {
57147
- var _h = _g, { toggleSort, className, children } = _h, rest = __objRest(_h, ["toggleSort", "className", "children"]);
56736
+ )((_u) => {
56737
+ var _v = _u, { toggleSort, className, children } = _v, rest = __objRest(_v, ["toggleSort", "className", "children"]);
57148
56738
  return /* @__PURE__ */ React$1.createElement(
57149
56739
  "div",
57150
56740
  __spreadValues({
@@ -58513,6 +58103,7 @@ const _DataTable = class _DataTable extends React$1.Component {
58513
58103
  ${description2} ${isUnique ? "<br>Must be unique" : ""}</div>`
58514
58104
  }), {
58515
58105
  "data-test": columnTitleTextified,
58106
+ "data-path": path2,
58516
58107
  "data-copy-text": columnTitleTextified,
58517
58108
  className: classNames("tg-react-table-column-header", {
58518
58109
  "sort-active": sortUp || sortDown
@@ -59270,13 +58861,13 @@ function getCellInfo({
59270
58861
  };
59271
58862
  }
59272
58863
  __name(getCellInfo, "getCellInfo");
59273
- function ColumnFilterMenu(_i) {
59274
- var _j = _i, {
58864
+ function ColumnFilterMenu(_w) {
58865
+ var _x = _w, {
59275
58866
  FilterMenu,
59276
58867
  filterActiveForColumn,
59277
58868
  compact: compact3,
59278
58869
  extraCompact
59279
- } = _j, rest = __objRest(_j, [
58870
+ } = _x, rest = __objRest(_x, [
59280
58871
  "FilterMenu",
59281
58872
  "filterActiveForColumn",
59282
58873
  "compact",
@@ -62081,8 +61672,8 @@ function maybeStripIdFromEntities(ents, validateAgainstSchema) {
62081
61672
  return toRet == null ? void 0 : toRet.map((e2) => lodashExports.omit(e2, ["_isClean"]));
62082
61673
  }
62083
61674
  __name(maybeStripIdFromEntities, "maybeStripIdFromEntities");
62084
- const useDialog = /* @__PURE__ */ __name((_k) => {
62085
- var _l = _k, { ModalComponent } = _l, rest = __objRest(_l, ["ModalComponent"]);
61675
+ const useDialog = /* @__PURE__ */ __name((_y) => {
61676
+ var _z = _y, { ModalComponent } = _z, rest = __objRest(_z, ["ModalComponent"]);
62086
61677
  const [isOpen, setOpen] = React$1.useState(false);
62087
61678
  const [additionalProps, setAdditionalProps] = React$1.useState(false);
62088
61679
  const comp = /* @__PURE__ */ React$1.createElement(
@@ -72674,14 +72265,14 @@ function BlueprintError({ error }) {
72674
72265
  return /* @__PURE__ */ React$1.createElement("div", { className: classNames(core$5.Classes.FORM_GROUP, core$5.Classes.INTENT_DANGER) }, /* @__PURE__ */ React$1.createElement("div", { className: classNames(core$5.Classes.FORM_HELPER_TEXT, "preserve-newline") }, error));
72675
72266
  }
72676
72267
  __name(BlueprintError, "BlueprintError");
72677
- function DropdownButton(_m) {
72678
- var _n = _m, {
72268
+ function DropdownButton(_A) {
72269
+ var _B = _A, {
72679
72270
  disabled,
72680
72271
  menu,
72681
72272
  noRightIcon,
72682
72273
  popoverProps,
72683
72274
  className
72684
- } = _n, rest = __objRest(_n, [
72275
+ } = _B, rest = __objRest(_B, [
72685
72276
  "disabled",
72686
72277
  "menu",
72687
72278
  "noRightIcon",
@@ -76124,14 +75715,14 @@ const EnhancedMenuItem = compose(
76124
75715
  }
76125
75716
  }),
76126
75717
  branch(({ navTo }) => navTo, withRouter$1)
76127
- )(function(_o) {
76128
- var _p = _o, {
75718
+ )(function(_C) {
75719
+ var _D = _C, {
76129
75720
  navTo,
76130
75721
  context,
76131
75722
  staticContext,
76132
75723
  didMount,
76133
75724
  willUnmount
76134
- } = _p, props = __objRest(_p, [
75725
+ } = _D, props = __objRest(_D, [
76135
75726
  "navTo",
76136
75727
  "context",
76137
75728
  "staticContext",
@@ -76352,8 +75943,8 @@ function doesSearchValMatchText(searchVal, justText) {
76352
75943
  );
76353
75944
  }
76354
75945
  __name(doesSearchValMatchText, "doesSearchValMatchText");
76355
- const MenuItemWithTooltip = /* @__PURE__ */ __name((_q) => {
76356
- var _r = _q, { tooltip } = _r, rest = __objRest(_r, ["tooltip"]);
75946
+ const MenuItemWithTooltip = /* @__PURE__ */ __name((_E) => {
75947
+ var _F = _E, { tooltip } = _F, rest = __objRest(_F, ["tooltip"]);
76357
75948
  let out = /* @__PURE__ */ React$1.createElement(core$5.MenuItem, __spreadValues({}, rest));
76358
75949
  if (tooltip) {
76359
75950
  out = /* @__PURE__ */ React$1.createElement(core$5.Tooltip, { content: tooltip }, out);