@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.es.js CHANGED
@@ -4942,7 +4942,7 @@ function _objectSpread$3(target) {
4942
4942
  for (var i = 1; i < arguments.length; i++) {
4943
4943
  var source = null != arguments[i] ? arguments[i] : {};
4944
4944
  i % 2 ? ownKeys$5(Object(source), true).forEach(function(key) {
4945
- _defineProperty$9(target, key, source[key]);
4945
+ _defineProperty$8(target, key, source[key]);
4946
4946
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function(key) {
4947
4947
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4948
4948
  });
@@ -4950,7 +4950,7 @@ function _objectSpread$3(target) {
4950
4950
  return target;
4951
4951
  }
4952
4952
  __name(_objectSpread$3, "_objectSpread$3");
4953
- function _defineProperty$9(obj, key, value) {
4953
+ function _defineProperty$8(obj, key, value) {
4954
4954
  if (key in obj) {
4955
4955
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
4956
4956
  } else {
@@ -4958,11 +4958,11 @@ function _defineProperty$9(obj, key, value) {
4958
4958
  }
4959
4959
  return obj;
4960
4960
  }
4961
- __name(_defineProperty$9, "_defineProperty$9");
4962
- function _slicedToArray$6(arr, i) {
4961
+ __name(_defineProperty$8, "_defineProperty$8");
4962
+ function _slicedToArray$4(arr, i) {
4963
4963
  return _arrayWithHoles$4(arr) || _iterableToArrayLimit$4(arr, i) || _unsupportedIterableToArray$a(arr, i) || _nonIterableRest$4();
4964
4964
  }
4965
- __name(_slicedToArray$6, "_slicedToArray$6");
4965
+ __name(_slicedToArray$4, "_slicedToArray$4");
4966
4966
  function _nonIterableRest$4() {
4967
4967
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4968
4968
  }
@@ -5082,8 +5082,8 @@ function allFilesAccepted(_ref) {
5082
5082
  return false;
5083
5083
  }
5084
5084
  return files.every(function(file) {
5085
- var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$6(_fileAccepted, 1), accepted = _fileAccepted2[0];
5086
- var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$6(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0];
5085
+ var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$4(_fileAccepted, 1), accepted = _fileAccepted2[0];
5086
+ var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$4(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0];
5087
5087
  return accepted && sizeMatch;
5088
5088
  });
5089
5089
  }
@@ -5152,16 +5152,16 @@ function filePickerOptionsTypes(accept) {
5152
5152
  accept: Array.isArray(accept) ? accept.filter(function(item) {
5153
5153
  return item === "audio/*" || item === "video/*" || item === "image/*" || item === "text/*" || /\w+\/[-+.\w]+/g.test(item);
5154
5154
  }).reduce(function(a2, b2) {
5155
- return _objectSpread$3(_objectSpread$3({}, a2), {}, _defineProperty$9({}, b2, []));
5155
+ return _objectSpread$3(_objectSpread$3({}, a2), {}, _defineProperty$8({}, b2, []));
5156
5156
  }, {}) : {}
5157
5157
  }];
5158
5158
  }
5159
5159
  __name(filePickerOptionsTypes, "filePickerOptionsTypes");
5160
5160
  var _excluded$1 = ["children"], _excluded2 = ["open"], _excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], _excluded4 = ["refKey", "onChange", "onClick"];
5161
- function _toConsumableArray$1(arr) {
5161
+ function _toConsumableArray(arr) {
5162
5162
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$9(arr) || _nonIterableSpread();
5163
5163
  }
5164
- __name(_toConsumableArray$1, "_toConsumableArray$1");
5164
+ __name(_toConsumableArray, "_toConsumableArray");
5165
5165
  function _nonIterableSpread() {
5166
5166
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5167
5167
  }
@@ -5176,10 +5176,10 @@ function _arrayWithoutHoles(arr) {
5176
5176
  return _arrayLikeToArray$9(arr);
5177
5177
  }
5178
5178
  __name(_arrayWithoutHoles, "_arrayWithoutHoles");
5179
- function _slicedToArray$5(arr, i) {
5179
+ function _slicedToArray$3(arr, i) {
5180
5180
  return _arrayWithHoles$3(arr) || _iterableToArrayLimit$3(arr, i) || _unsupportedIterableToArray$9(arr, i) || _nonIterableRest$3();
5181
5181
  }
5182
- __name(_slicedToArray$5, "_slicedToArray$5");
5182
+ __name(_slicedToArray$3, "_slicedToArray$3");
5183
5183
  function _nonIterableRest$3() {
5184
5184
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5185
5185
  }
@@ -5256,7 +5256,7 @@ function _objectSpread$2(target) {
5256
5256
  for (var i = 1; i < arguments.length; i++) {
5257
5257
  var source = null != arguments[i] ? arguments[i] : {};
5258
5258
  i % 2 ? ownKeys$4(Object(source), true).forEach(function(key) {
5259
- _defineProperty$8(target, key, source[key]);
5259
+ _defineProperty$7(target, key, source[key]);
5260
5260
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function(key) {
5261
5261
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5262
5262
  });
@@ -5264,7 +5264,7 @@ function _objectSpread$2(target) {
5264
5264
  return target;
5265
5265
  }
5266
5266
  __name(_objectSpread$2, "_objectSpread$2");
5267
- function _defineProperty$8(obj, key, value) {
5267
+ function _defineProperty$7(obj, key, value) {
5268
5268
  if (key in obj) {
5269
5269
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
5270
5270
  } else {
@@ -5272,8 +5272,8 @@ function _defineProperty$8(obj, key, value) {
5272
5272
  }
5273
5273
  return obj;
5274
5274
  }
5275
- __name(_defineProperty$8, "_defineProperty$8");
5276
- function _objectWithoutProperties$7(source, excluded) {
5275
+ __name(_defineProperty$7, "_defineProperty$7");
5276
+ function _objectWithoutProperties$5(source, excluded) {
5277
5277
  if (source == null)
5278
5278
  return {};
5279
5279
  var target = _objectWithoutPropertiesLoose$2(source, excluded);
@@ -5291,7 +5291,7 @@ function _objectWithoutProperties$7(source, excluded) {
5291
5291
  }
5292
5292
  return target;
5293
5293
  }
5294
- __name(_objectWithoutProperties$7, "_objectWithoutProperties$7");
5294
+ __name(_objectWithoutProperties$5, "_objectWithoutProperties$5");
5295
5295
  function _objectWithoutPropertiesLoose$2(source, excluded) {
5296
5296
  if (source == null)
5297
5297
  return {};
@@ -5308,8 +5308,8 @@ function _objectWithoutPropertiesLoose$2(source, excluded) {
5308
5308
  }
5309
5309
  __name(_objectWithoutPropertiesLoose$2, "_objectWithoutPropertiesLoose$2");
5310
5310
  var Dropzone = /* @__PURE__ */ forwardRef(function(_ref, ref) {
5311
- var children = _ref.children, params = _objectWithoutProperties$7(_ref, _excluded$1);
5312
- var _useDropzone = useDropzone(params), open2 = _useDropzone.open, props = _objectWithoutProperties$7(_useDropzone, _excluded2);
5311
+ var children = _ref.children, params = _objectWithoutProperties$5(_ref, _excluded$1);
5312
+ var _useDropzone = useDropzone(params), open2 = _useDropzone.open, props = _objectWithoutProperties$5(_useDropzone, _excluded2);
5313
5313
  useImperativeHandle(ref, function() {
5314
5314
  return {
5315
5315
  open: open2
@@ -5518,7 +5518,7 @@ function useDropzone() {
5518
5518
  }, [onFileDialogCancel]);
5519
5519
  var rootRef = useRef(null);
5520
5520
  var inputRef = useRef(null);
5521
- var _useReducer = useReducer(reducer, initialState), _useReducer2 = _slicedToArray$5(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1];
5521
+ var _useReducer = useReducer(reducer, initialState), _useReducer2 = _slicedToArray$3(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1];
5522
5522
  var isFocused = state.isFocused, isFileDialogActive = state.isFileDialogActive, draggedFiles = state.draggedFiles;
5523
5523
  var onWindowFocus = /* @__PURE__ */ __name(function onWindowFocus2() {
5524
5524
  if (isFileDialogActive) {
@@ -5569,7 +5569,7 @@ function useDropzone() {
5569
5569
  event.preventDefault();
5570
5570
  event.persist();
5571
5571
  stopPropagation(event);
5572
- dragTargetsRef.current = [].concat(_toConsumableArray$1(dragTargetsRef.current), [event.target]);
5572
+ dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);
5573
5573
  if (isEvtWithFiles(event)) {
5574
5574
  Promise.resolve(getFilesFromEvent(event)).then(function(draggedFiles2) {
5575
5575
  if (isPropagationStopped(event) && !noDragEventsBubbling) {
@@ -5630,8 +5630,8 @@ function useDropzone() {
5630
5630
  var acceptedFiles = [];
5631
5631
  var fileRejections = [];
5632
5632
  files.forEach(function(file) {
5633
- var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$5(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1];
5634
- var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$5(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1];
5633
+ var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$3(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1];
5634
+ var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$3(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1];
5635
5635
  var customErrors = validator2 ? validator2(file) : null;
5636
5636
  if (accepted && sizeMatch && !customErrors) {
5637
5637
  acceptedFiles.push(file);
@@ -5766,8 +5766,8 @@ function useDropzone() {
5766
5766
  }, "stopPropagation");
5767
5767
  var getRootProps = useMemo(function() {
5768
5768
  return function() {
5769
- 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);
5770
- return _objectSpread$2(_objectSpread$2(_defineProperty$8({
5769
+ 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);
5770
+ return _objectSpread$2(_objectSpread$2(_defineProperty$7({
5771
5771
  onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
5772
5772
  onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
5773
5773
  onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
@@ -5787,8 +5787,8 @@ function useDropzone() {
5787
5787
  }, []);
5788
5788
  var getInputProps = useMemo(function() {
5789
5789
  return function() {
5790
- 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);
5791
- var inputProps = _defineProperty$8({
5790
+ 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);
5791
+ var inputProps = _defineProperty$7({
5792
5792
  accept,
5793
5793
  multiple,
5794
5794
  type: "file",
@@ -6822,7 +6822,7 @@ function _defineProperties$1(target, props) {
6822
6822
  }
6823
6823
  }
6824
6824
  __name(_defineProperties$1, "_defineProperties$1");
6825
- function _createClass$d(Constructor, protoProps, staticProps) {
6825
+ function _createClass$9(Constructor, protoProps, staticProps) {
6826
6826
  if (protoProps)
6827
6827
  _defineProperties$1(Constructor.prototype, protoProps);
6828
6828
  if (staticProps)
@@ -6832,9 +6832,9 @@ function _createClass$d(Constructor, protoProps, staticProps) {
6832
6832
  });
6833
6833
  return Constructor;
6834
6834
  }
6835
- __name(_createClass$d, "_createClass$d");
6836
- function _extends$o() {
6837
- _extends$o = Object.assign ? Object.assign.bind() : function(target) {
6835
+ __name(_createClass$9, "_createClass$9");
6836
+ function _extends$j() {
6837
+ _extends$j = Object.assign ? Object.assign.bind() : function(target) {
6838
6838
  for (var i = 1; i < arguments.length; i++) {
6839
6839
  var source = arguments[i];
6840
6840
  for (var key in source) {
@@ -6845,9 +6845,9 @@ function _extends$o() {
6845
6845
  }
6846
6846
  return target;
6847
6847
  };
6848
- return _extends$o.apply(this, arguments);
6848
+ return _extends$j.apply(this, arguments);
6849
6849
  }
6850
- __name(_extends$o, "_extends$o");
6850
+ __name(_extends$j, "_extends$j");
6851
6851
  function _inheritsLoose$2(subClass, superClass) {
6852
6852
  subClass.prototype = Object.create(superClass.prototype);
6853
6853
  subClass.prototype.constructor = subClass;
@@ -6942,7 +6942,7 @@ function createDecoratorAnnotation(annotation) {
6942
6942
  __name(createDecoratorAnnotation, "createDecoratorAnnotation");
6943
6943
  function storeAnnotation(prototype, key, annotation) {
6944
6944
  if (!hasProp(prototype, storedAnnotationsSymbol)) {
6945
- addHiddenProp(prototype, storedAnnotationsSymbol, _extends$o({}, prototype[storedAnnotationsSymbol]));
6945
+ addHiddenProp(prototype, storedAnnotationsSymbol, _extends$j({}, prototype[storedAnnotationsSymbol]));
6946
6946
  }
6947
6947
  if (!isOverride(annotation)) {
6948
6948
  prototype[storedAnnotationsSymbol][key] = annotation;
@@ -6951,7 +6951,7 @@ function storeAnnotation(prototype, key, annotation) {
6951
6951
  __name(storeAnnotation, "storeAnnotation");
6952
6952
  function collectStoredAnnotations(target) {
6953
6953
  if (!hasProp(target, storedAnnotationsSymbol)) {
6954
- addHiddenProp(target, storedAnnotationsSymbol, _extends$o({}, target[storedAnnotationsSymbol]));
6954
+ addHiddenProp(target, storedAnnotationsSymbol, _extends$j({}, target[storedAnnotationsSymbol]));
6955
6955
  }
6956
6956
  return target[storedAnnotationsSymbol];
6957
6957
  }
@@ -7279,7 +7279,7 @@ function make_$3(adm, key, descriptor2) {
7279
7279
  __name(make_$3, "make_$3");
7280
7280
  function extend_$3(adm, key, descriptor2, proxyTrap) {
7281
7281
  assertComputedDescriptor(adm, this, key, descriptor2);
7282
- return adm.defineComputedProperty_(key, _extends$o({}, this.options_, {
7282
+ return adm.defineComputedProperty_(key, _extends$j({}, this.options_, {
7283
7283
  get: descriptor2.get,
7284
7284
  set: descriptor2.set
7285
7285
  }), proxyTrap);
@@ -9626,7 +9626,7 @@ var ObservableMap = /* @__PURE__ */ function() {
9626
9626
  _proto.intercept_ = /* @__PURE__ */ __name(function intercept_(handler) {
9627
9627
  return registerInterceptor(this, handler);
9628
9628
  }, "intercept_");
9629
- _createClass$d(ObservableMap2, [{
9629
+ _createClass$9(ObservableMap2, [{
9630
9630
  key: "size",
9631
9631
  get: /* @__PURE__ */ __name(function get5() {
9632
9632
  this.keysAtom_.reportObserved();
@@ -9860,7 +9860,7 @@ var ObservableSet = /* @__PURE__ */ function() {
9860
9860
  _proto[_Symbol$iterator$1] = function() {
9861
9861
  return this.values();
9862
9862
  };
9863
- _createClass$d(ObservableSet2, [{
9863
+ _createClass$9(ObservableSet2, [{
9864
9864
  key: "size",
9865
9865
  get: /* @__PURE__ */ __name(function get5() {
9866
9866
  this.atom_.reportObserved();
@@ -10056,7 +10056,7 @@ var ObservableObjectAdministration = /* @__PURE__ */ function() {
10056
10056
  }
10057
10057
  var newValue = change2.newValue;
10058
10058
  if (descriptor2.value !== newValue) {
10059
- descriptor2 = _extends$o({}, descriptor2, {
10059
+ descriptor2 = _extends$j({}, descriptor2, {
10060
10060
  value: newValue
10061
10061
  });
10062
10062
  }
@@ -10384,7 +10384,7 @@ var LegacyObservableArray = /* @__PURE__ */ function(_StubArray, _Symbol$toStrin
10384
10384
  }, "next")
10385
10385
  });
10386
10386
  };
10387
- _createClass$d(LegacyObservableArray2, [{
10387
+ _createClass$9(LegacyObservableArray2, [{
10388
10388
  key: "length",
10389
10389
  get: /* @__PURE__ */ __name(function get5() {
10390
10390
  return this[$mobx].getArrayLength_();
@@ -17718,8 +17718,8 @@ lodash.exports;
17718
17718
  }).call(commonjsGlobal);
17719
17719
  })(lodash, lodash.exports);
17720
17720
  var lodashExports = lodash.exports;
17721
- function _extends$n() {
17722
- _extends$n = Object.assign ? Object.assign.bind() : function(target) {
17721
+ function _extends$i() {
17722
+ _extends$i = Object.assign ? Object.assign.bind() : function(target) {
17723
17723
  for (var i = 1; i < arguments.length; i++) {
17724
17724
  var source = arguments[i];
17725
17725
  for (var key in source) {
@@ -17730,9 +17730,9 @@ function _extends$n() {
17730
17730
  }
17731
17731
  return target;
17732
17732
  };
17733
- return _extends$n.apply(this, arguments);
17733
+ return _extends$i.apply(this, arguments);
17734
17734
  }
17735
- __name(_extends$n, "_extends$n");
17735
+ __name(_extends$i, "_extends$i");
17736
17736
  function _setPrototypeOf$2(o2, p2) {
17737
17737
  _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf3(o3, p3) {
17738
17738
  o3.__proto__ = p3;
@@ -17927,7 +17927,7 @@ var mapProps = /* @__PURE__ */ __name(function mapProps2(propsMapper) {
17927
17927
  }, "mapProps");
17928
17928
  var withProps = /* @__PURE__ */ __name(function withProps2(input) {
17929
17929
  var hoc = mapProps(function(props) {
17930
- return _extends$n({}, props, typeof input === "function" ? input(props) : input);
17930
+ return _extends$i({}, props, typeof input === "function" ? input(props) : input);
17931
17931
  });
17932
17932
  return hoc;
17933
17933
  }, "withProps");
@@ -17962,7 +17962,7 @@ var withHandlers = /* @__PURE__ */ __name(function withHandlers2(handlers2) {
17962
17962
  __name(WithHandlers2, "WithHandlers");
17963
17963
  var _proto = WithHandlers2.prototype;
17964
17964
  _proto.render = /* @__PURE__ */ __name(function render3() {
17965
- return factory(_extends$n({}, this.props, this.handlers));
17965
+ return factory(_extends$i({}, this.props, this.handlers));
17966
17966
  }, "render");
17967
17967
  return WithHandlers2;
17968
17968
  }(Component);
@@ -17997,7 +17997,7 @@ var withState = /* @__PURE__ */ __name(function withState2(stateName, stateUpdat
17997
17997
  var _proto = WithState2.prototype;
17998
17998
  _proto.render = /* @__PURE__ */ __name(function render3() {
17999
17999
  var _extends2;
18000
- return factory(_extends$n({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2)));
18000
+ return factory(_extends$i({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2)));
18001
18001
  }, "render");
18002
18002
  return WithState2;
18003
18003
  }(Component);
@@ -18057,7 +18057,7 @@ var lifecycle = /* @__PURE__ */ __name(function lifecycle2(spec) {
18057
18057
  __name(Lifecycle3, "Lifecycle");
18058
18058
  var _proto = Lifecycle3.prototype;
18059
18059
  _proto.render = /* @__PURE__ */ __name(function render3() {
18060
- return factory(_extends$n({}, this.props, this.state));
18060
+ return factory(_extends$i({}, this.props, this.state));
18061
18061
  }, "render");
18062
18062
  return Lifecycle3;
18063
18063
  }(Component);
@@ -18378,25 +18378,16 @@ var toString$6 = {}.toString;
18378
18378
  var _cof = /* @__PURE__ */ __name(function(it) {
18379
18379
  return toString$6.call(it).slice(8, -1);
18380
18380
  }, "_cof");
18381
- var _iobject;
18382
- var hasRequired_iobject;
18383
- function require_iobject() {
18384
- if (hasRequired_iobject)
18385
- return _iobject;
18386
- hasRequired_iobject = 1;
18387
- var cof2 = _cof;
18388
- _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
18389
- return cof2(it) == "String" ? it.split("") : Object(it);
18390
- };
18391
- return _iobject;
18392
- }
18393
- __name(require_iobject, "require_iobject");
18381
+ var cof$2 = _cof;
18382
+ var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
18383
+ return cof$2(it) == "String" ? it.split("") : Object(it);
18384
+ };
18394
18385
  var _defined = /* @__PURE__ */ __name(function(it) {
18395
18386
  if (it == void 0)
18396
18387
  throw TypeError("Can't call method on " + it);
18397
18388
  return it;
18398
18389
  }, "_defined");
18399
- var IObject = require_iobject();
18390
+ var IObject = _iobject;
18400
18391
  var defined$2 = _defined;
18401
18392
  var _toIobject = /* @__PURE__ */ __name(function(it) {
18402
18393
  return IObject(defined$2(it));
@@ -18517,7 +18508,7 @@ function require_objectAssign() {
18517
18508
  var gOPS2 = _objectGops;
18518
18509
  var pIE2 = require_objectPie();
18519
18510
  var toObject2 = _toObject;
18520
- var IObject2 = require_iobject();
18511
+ var IObject2 = _iobject;
18521
18512
  var $assign = Object.assign;
18522
18513
  _objectAssign = !$assign || _fails(function() {
18523
18514
  var A2 = {};
@@ -19074,8 +19065,8 @@ var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty3(it, key,
19074
19065
  return $Object$2.defineProperty(it, key, desc);
19075
19066
  }, "defineProperty");
19076
19067
  var defineProperty$8 = { "default": defineProperty$9, __esModule: true };
19077
- var _defineProperty$7 = defineProperty$8;
19078
- var _defineProperty2 = _interopRequireDefault$e(_defineProperty$7);
19068
+ var _defineProperty$6 = defineProperty$8;
19069
+ var _defineProperty2 = _interopRequireDefault$e(_defineProperty$6);
19079
19070
  function _interopRequireDefault$e(obj) {
19080
19071
  return obj && obj.__esModule ? obj : { default: obj };
19081
19072
  }
@@ -21155,8 +21146,8 @@ var defineProperty$6 = function() {
21155
21146
  } catch (e2) {
21156
21147
  }
21157
21148
  }();
21158
- var _defineProperty$6 = defineProperty$6;
21159
- var constant$1 = constant_1, defineProperty$5 = _defineProperty$6, identity$3 = identity_1;
21149
+ var _defineProperty$5 = defineProperty$6;
21150
+ var constant$1 = constant_1, defineProperty$5 = _defineProperty$5, identity$3 = identity_1;
21160
21151
  var baseSetToString$3 = !defineProperty$5 ? identity$3 : function(func, string2) {
21161
21152
  return defineProperty$5(func, "toString", {
21162
21153
  "configurable": true,
@@ -22216,7 +22207,7 @@ function _typeof$4(obj) {
22216
22207
  return _typeof$4(obj);
22217
22208
  }
22218
22209
  __name(_typeof$4, "_typeof$4");
22219
- function _defineProperty$5(obj, key, value) {
22210
+ function _defineProperty$4(obj, key, value) {
22220
22211
  if (key in obj) {
22221
22212
  Object.defineProperty(obj, key, {
22222
22213
  value,
@@ -22229,7 +22220,7 @@ function _defineProperty$5(obj, key, value) {
22229
22220
  }
22230
22221
  return obj;
22231
22222
  }
22232
- __name(_defineProperty$5, "_defineProperty$5");
22223
+ __name(_defineProperty$4, "_defineProperty$4");
22233
22224
  function ownKeys$2(object2, enumerableOnly) {
22234
22225
  var keys3 = Object.keys(object2);
22235
22226
  if (Object.getOwnPropertySymbols) {
@@ -22248,7 +22239,7 @@ function _objectSpread2(target) {
22248
22239
  var source = arguments[i] != null ? arguments[i] : {};
22249
22240
  if (i % 2) {
22250
22241
  ownKeys$2(source, true).forEach(function(key) {
22251
- _defineProperty$5(target, key, source[key]);
22242
+ _defineProperty$4(target, key, source[key]);
22252
22243
  });
22253
22244
  } else if (Object.getOwnPropertyDescriptors) {
22254
22245
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
@@ -23229,7 +23220,7 @@ var reactList = {};
23229
23220
  key: "getSizeOfItem",
23230
23221
  value: /* @__PURE__ */ __name(function getSizeOfItem(index2) {
23231
23222
  var cache = this.cache, items = this.items;
23232
- var _this$props6 = this.props, axis = _this$props6.axis, itemSizeGetter = _this$props6.itemSizeGetter, itemSizeEstimator3 = _this$props6.itemSizeEstimator, type = _this$props6.type;
23223
+ var _this$props6 = this.props, axis = _this$props6.axis, itemSizeGetter = _this$props6.itemSizeGetter, itemSizeEstimator2 = _this$props6.itemSizeEstimator, type = _this$props6.type;
23233
23224
  var _this$state4 = this.state, from3 = _this$state4.from, itemSize = _this$state4.itemSize, size = _this$state4.size;
23234
23225
  if (itemSize)
23235
23226
  return itemSize;
@@ -23242,8 +23233,8 @@ var reactList = {};
23242
23233
  if (itemEl)
23243
23234
  return itemEl[OFFSET_SIZE_KEYS[axis]];
23244
23235
  }
23245
- if (itemSizeEstimator3)
23246
- return itemSizeEstimator3(index2, cache);
23236
+ if (itemSizeEstimator2)
23237
+ return itemSizeEstimator2(index2, cache);
23247
23238
  }, "getSizeOfItem")
23248
23239
  }, {
23249
23240
  key: "constrain",
@@ -23419,29 +23410,6 @@ var reactList = {};
23419
23410
  });
23420
23411
  })(reactList);
23421
23412
  const ReactList = /* @__PURE__ */ getDefaultExportFromCjs(reactList);
23422
- var _extends$m = Object.assign || function(target) {
23423
- for (var i = 1; i < arguments.length; i++) {
23424
- var source = arguments[i];
23425
- for (var key in source) {
23426
- if (Object.prototype.hasOwnProperty.call(source, key)) {
23427
- target[key] = source[key];
23428
- }
23429
- }
23430
- }
23431
- return target;
23432
- };
23433
- function _objectWithoutProperties$6(obj, keys3) {
23434
- var target = {};
23435
- for (var i in obj) {
23436
- if (keys3.indexOf(i) >= 0)
23437
- continue;
23438
- if (!Object.prototype.hasOwnProperty.call(obj, i))
23439
- continue;
23440
- target[i] = obj[i];
23441
- }
23442
- return target;
23443
- }
23444
- __name(_objectWithoutProperties$6, "_objectWithoutProperties$6");
23445
23413
  const _ = {
23446
23414
  get: get$3,
23447
23415
  set: set4,
@@ -23466,24 +23434,19 @@ function get$3(obj, path2, def2) {
23466
23434
  if (!path2) {
23467
23435
  return obj;
23468
23436
  }
23469
- var pathObj = makePathArray(path2);
23470
- var val = void 0;
23437
+ const pathObj = makePathArray(path2);
23438
+ let val;
23471
23439
  try {
23472
- val = pathObj.reduce(function(current, pathPart) {
23473
- return current[pathPart];
23474
- }, obj);
23440
+ val = pathObj.reduce((current, pathPart) => current[pathPart], obj);
23475
23441
  } catch (e2) {
23476
23442
  }
23477
23443
  return typeof val !== "undefined" ? val : def2;
23478
23444
  }
23479
23445
  __name(get$3, "get$3");
23480
- function set4() {
23481
- var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
23482
- var path2 = arguments[1];
23483
- var value = arguments[2];
23484
- var keys3 = makePathArray(path2);
23485
- var keyPart = void 0;
23486
- var cursor = obj;
23446
+ function set4(obj = {}, path2, value) {
23447
+ const keys3 = makePathArray(path2);
23448
+ let keyPart;
23449
+ let cursor = obj;
23487
23450
  while ((keyPart = keys3.shift()) && keys3.length) {
23488
23451
  if (!cursor[keyPart]) {
23489
23452
  cursor[keyPart] = {};
@@ -23495,7 +23458,7 @@ function set4() {
23495
23458
  }
23496
23459
  __name(set4, "set");
23497
23460
  function takeRight(arr, n2) {
23498
- var start2 = n2 > arr.length ? 0 : arr.length - n2;
23461
+ const start2 = n2 > arr.length ? 0 : arr.length - n2;
23499
23462
  return arr.slice(start2);
23500
23463
  }
23501
23464
  __name(takeRight, "takeRight");
@@ -23504,19 +23467,19 @@ function last(arr) {
23504
23467
  }
23505
23468
  __name(last, "last");
23506
23469
  function range(n2) {
23507
- var arr = [];
23508
- for (var i = 0; i < n2; i += 1) {
23470
+ const arr = [];
23471
+ for (let i = 0; i < n2; i += 1) {
23509
23472
  arr.push(n2);
23510
23473
  }
23511
23474
  return arr;
23512
23475
  }
23513
23476
  __name(range, "range");
23514
23477
  function orderBy(arr, funcs, dirs, indexKey) {
23515
- return arr.sort(function(rowA, rowB) {
23516
- for (var i = 0; i < funcs.length; i += 1) {
23517
- var comp = funcs[i];
23518
- var desc = dirs[i] === false || dirs[i] === "desc";
23519
- var sortInt = comp(rowA, rowB);
23478
+ return arr.sort((rowA, rowB) => {
23479
+ for (let i = 0; i < funcs.length; i += 1) {
23480
+ const comp = funcs[i];
23481
+ const desc = dirs[i] === false || dirs[i] === "desc";
23482
+ const sortInt = comp(rowA, rowB);
23520
23483
  if (sortInt) {
23521
23484
  return desc ? -sortInt : sortInt;
23522
23485
  }
@@ -23526,8 +23489,8 @@ function orderBy(arr, funcs, dirs, indexKey) {
23526
23489
  }
23527
23490
  __name(orderBy, "orderBy");
23528
23491
  function remove2(a2, b2) {
23529
- return a2.filter(function(o2, i) {
23530
- var r2 = b2(o2);
23492
+ return a2.filter((o2, i) => {
23493
+ const r2 = b2(o2);
23531
23494
  if (r2) {
23532
23495
  a2.splice(i, 1);
23533
23496
  return true;
@@ -23538,50 +23501,46 @@ function remove2(a2, b2) {
23538
23501
  __name(remove2, "remove");
23539
23502
  function clone2(a2) {
23540
23503
  try {
23541
- return JSON.parse(JSON.stringify(a2, function(key, value) {
23542
- if (typeof value === "function") {
23543
- return value.toString();
23544
- }
23545
- return value;
23546
- }));
23504
+ return JSON.parse(
23505
+ JSON.stringify(a2, (key, value) => {
23506
+ if (typeof value === "function") {
23507
+ return value.toString();
23508
+ }
23509
+ return value;
23510
+ })
23511
+ );
23547
23512
  } catch (e2) {
23548
23513
  return a2;
23549
23514
  }
23550
23515
  }
23551
23516
  __name(clone2, "clone");
23552
- function getFirstDefined() {
23553
- for (var i = 0; i < arguments.length; i += 1) {
23554
- if (typeof (arguments.length <= i ? void 0 : arguments[i]) !== "undefined") {
23555
- return arguments.length <= i ? void 0 : arguments[i];
23517
+ function getFirstDefined(...args) {
23518
+ for (let i = 0; i < args.length; i += 1) {
23519
+ if (typeof args[i] !== "undefined") {
23520
+ return args[i];
23556
23521
  }
23557
23522
  }
23558
23523
  }
23559
23524
  __name(getFirstDefined, "getFirstDefined");
23560
23525
  function sum(arr) {
23561
- return arr.reduce(function(a2, b2) {
23562
- return a2 + b2;
23563
- }, 0);
23526
+ return arr.reduce((a2, b2) => a2 + b2, 0);
23564
23527
  }
23565
23528
  __name(sum, "sum");
23566
23529
  function makeTemplateComponent(compClass, displayName) {
23567
23530
  if (!displayName) {
23568
23531
  throw new Error("No displayName found for template component:", compClass);
23569
23532
  }
23570
- var cmp = /* @__PURE__ */ __name(function cmp2(_ref) {
23571
- var children = _ref.children, className = _ref.className, rest = _objectWithoutProperties$6(_ref, ["children", "className"]);
23572
- return React__default.createElement(
23573
- "div",
23574
- _extends$m({ className: classNames(compClass, className) }, rest),
23575
- children
23576
- );
23533
+ const cmp = /* @__PURE__ */ __name((_a2) => {
23534
+ var _b = _a2, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
23535
+ return /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: classNames(compClass, className) }, rest), children);
23577
23536
  }, "cmp");
23578
23537
  cmp.displayName = displayName;
23579
23538
  return cmp;
23580
23539
  }
23581
23540
  __name(makeTemplateComponent, "makeTemplateComponent");
23582
23541
  function groupBy(xs, key) {
23583
- return xs.reduce(function(rv, x2, i) {
23584
- var resKey = typeof key === "function" ? key(x2, i) : x2[key];
23542
+ return xs.reduce((rv, x2, i) => {
23543
+ const resKey = typeof key === "function" ? key(x2, i) : x2[key];
23585
23544
  rv[resKey] = isArray$b(rv[resKey]) ? rv[resKey] : [];
23586
23545
  rv[resKey].push(x2);
23587
23546
  return rv;
@@ -23590,7 +23549,7 @@ function groupBy(xs, key) {
23590
23549
  __name(groupBy, "groupBy");
23591
23550
  function asPx(value) {
23592
23551
  value = Number(value);
23593
- return Number.isNaN(value) ? null : value + "px";
23552
+ return Number.isNaN(value) ? null : `${value}px`;
23594
23553
  }
23595
23554
  __name(asPx, "asPx");
23596
23555
  function isArray$b(a2) {
@@ -23601,20 +23560,19 @@ function makePathArray(obj) {
23601
23560
  return flattenDeep(obj).join(".").replace(/\[/g, ".").replace(/\]/g, "").split(".");
23602
23561
  }
23603
23562
  __name(makePathArray, "makePathArray");
23604
- function flattenDeep(arr) {
23605
- var newArr = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
23563
+ function flattenDeep(arr, newArr = []) {
23606
23564
  if (!isArray$b(arr)) {
23607
23565
  newArr.push(arr);
23608
23566
  } else {
23609
- for (var i = 0; i < arr.length; i += 1) {
23567
+ for (let i = 0; i < arr.length; i += 1) {
23610
23568
  flattenDeep(arr[i], newArr);
23611
23569
  }
23612
23570
  }
23613
23571
  return newArr;
23614
23572
  }
23615
23573
  __name(flattenDeep, "flattenDeep");
23616
- function splitProps(_ref2) {
23617
- var className = _ref2.className, style2 = _ref2.style, rest = _objectWithoutProperties$6(_ref2, ["className", "style"]);
23574
+ function splitProps(_c) {
23575
+ var _d = _c, { className, style: style2 } = _d, rest = __objRest(_d, ["className", "style"]);
23618
23576
  return {
23619
23577
  className,
23620
23578
  style: style2,
@@ -23623,9 +23581,9 @@ function splitProps(_ref2) {
23623
23581
  }
23624
23582
  __name(splitProps, "splitProps");
23625
23583
  function compactObject(obj) {
23626
- var newObj = {};
23584
+ const newObj = {};
23627
23585
  if (obj) {
23628
- Object.keys(obj).map(function(key) {
23586
+ Object.keys(obj).map((key) => {
23629
23587
  if (Object.prototype.hasOwnProperty.call(obj, key) && obj[key] !== void 0 && typeof obj[key] !== "undefined") {
23630
23588
  newObj[key] = obj[key];
23631
23589
  }
@@ -23639,1084 +23597,744 @@ function isSortingDesc(d2) {
23639
23597
  return !!(d2.sort === "desc" || d2.desc === true || d2.asc === false);
23640
23598
  }
23641
23599
  __name(isSortingDesc, "isSortingDesc");
23642
- function normalizeComponent(Comp) {
23643
- var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
23644
- var fallback = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Comp;
23645
- return typeof Comp === "function" ? Object.getPrototypeOf(Comp).isReactComponent ? React__default.createElement(Comp, params) : Comp(params) : fallback;
23600
+ function normalizeComponent(Comp, params = {}, fallback = Comp) {
23601
+ return typeof Comp === "function" ? Object.getPrototypeOf(Comp).isReactComponent ? /* @__PURE__ */ React__default.createElement(Comp, __spreadValues({}, params)) : Comp(params) : fallback;
23646
23602
  }
23647
23603
  __name(normalizeComponent, "normalizeComponent");
23648
- var _createClass$c = function() {
23649
- function defineProperties2(target, props) {
23650
- for (var i = 0; i < props.length; i++) {
23651
- var descriptor2 = props[i];
23652
- descriptor2.enumerable = descriptor2.enumerable || false;
23653
- descriptor2.configurable = true;
23654
- if ("value" in descriptor2)
23655
- descriptor2.writable = true;
23656
- Object.defineProperty(target, descriptor2.key, descriptor2);
23657
- }
23658
- }
23659
- __name(defineProperties2, "defineProperties");
23660
- return function(Constructor, protoProps, staticProps) {
23661
- if (protoProps)
23662
- defineProperties2(Constructor.prototype, protoProps);
23663
- if (staticProps)
23664
- defineProperties2(Constructor, staticProps);
23665
- return Constructor;
23666
- };
23667
- }();
23668
- function _classCallCheck$h(instance, Constructor) {
23669
- if (!(instance instanceof Constructor)) {
23670
- throw new TypeError("Cannot call a class as a function");
23671
- }
23672
- }
23673
- __name(_classCallCheck$h, "_classCallCheck$h");
23674
- function _possibleConstructorReturn$h(self2, call2) {
23675
- if (!self2) {
23676
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
23604
+ const Lifecycle = /* @__PURE__ */ __name((Base) => class extends Base {
23605
+ UNSAFE_componentWillMount() {
23606
+ this.setStateWithData(this.getDataModel(this.getResolvedState(), true));
23677
23607
  }
23678
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
23679
- }
23680
- __name(_possibleConstructorReturn$h, "_possibleConstructorReturn$h");
23681
- function _inherits$h(subClass, superClass) {
23682
- if (typeof superClass !== "function" && superClass !== null) {
23683
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
23608
+ componentDidMount() {
23609
+ this.fireFetchData();
23684
23610
  }
23685
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
23686
- if (superClass)
23687
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
23688
- }
23689
- __name(_inherits$h, "_inherits$h");
23690
- const Lifecycle = /* @__PURE__ */ __name(function(Base) {
23691
- return function(_Base) {
23692
- _inherits$h(_class, _Base);
23693
- function _class() {
23694
- _classCallCheck$h(this, _class);
23695
- return _possibleConstructorReturn$h(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
23696
- }
23697
- __name(_class, "_class");
23698
- _createClass$c(_class, [{
23699
- key: "UNSAFE_componentWillMount",
23700
- value: /* @__PURE__ */ __name(function UNSAFE_componentWillMount() {
23701
- this.setStateWithData(this.getDataModel(this.getResolvedState(), true));
23702
- }, "UNSAFE_componentWillMount")
23703
- }, {
23704
- key: "componentDidMount",
23705
- value: /* @__PURE__ */ __name(function componentDidMount() {
23706
- this.fireFetchData();
23707
- }, "componentDidMount")
23708
- }, {
23709
- key: "UNSAFE_componentWillReceiveProps",
23710
- value: /* @__PURE__ */ __name(function UNSAFE_componentWillReceiveProps(nextProps, nextState) {
23711
- var oldState = this.getResolvedState();
23712
- var newState = this.getResolvedState(nextProps, nextState);
23713
- var defaultableOptions = ["sorted", "filtered", "resized", "expanded"];
23714
- defaultableOptions.forEach(function(x2) {
23715
- var defaultName = "default" + (x2.charAt(0).toUpperCase() + x2.slice(1));
23716
- if (JSON.stringify(oldState[defaultName]) !== JSON.stringify(newState[defaultName])) {
23717
- newState[x2] = newState[defaultName];
23718
- }
23719
- });
23720
- var resettableOptions = ["sortable", "filterable", "resizable"];
23721
- resettableOptions.forEach(function(x2) {
23722
- if (oldState[x2] !== newState[x2]) {
23723
- var baseName = x2.replace("able", "");
23724
- var optionName = baseName + "ed";
23725
- var defaultName = "default" + (optionName.charAt(0).toUpperCase() + optionName.slice(1));
23726
- newState[optionName] = newState[defaultName];
23727
- }
23728
- });
23729
- if (oldState.data !== newState.data || oldState.columns !== newState.columns || oldState.pivotBy !== newState.pivotBy || oldState.sorted !== newState.sorted || oldState.filtered !== newState.filtered) {
23730
- this.setStateWithData(this.getDataModel(newState, oldState.data !== newState.data));
23731
- }
23732
- }, "UNSAFE_componentWillReceiveProps")
23733
- }, {
23734
- key: "setStateWithData",
23735
- value: /* @__PURE__ */ __name(function setStateWithData(newState, cb) {
23736
- var _this2 = this;
23737
- var oldState = this.getResolvedState();
23738
- var newResolvedState = this.getResolvedState({}, newState);
23739
- var freezeWhenExpanded = newResolvedState.freezeWhenExpanded;
23740
- newResolvedState.frozen = false;
23741
- if (freezeWhenExpanded) {
23742
- var keys3 = Object.keys(newResolvedState.expanded);
23743
- for (var i = 0; i < keys3.length; i += 1) {
23744
- if (newResolvedState.expanded[keys3[i]]) {
23745
- newResolvedState.frozen = true;
23746
- break;
23747
- }
23748
- }
23749
- }
23750
- if (oldState.frozen && !newResolvedState.frozen || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered || oldState.showFilters !== newResolvedState.showFilters || !newResolvedState.frozen && oldState.resolvedData !== newResolvedState.resolvedData) {
23751
- 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) {
23752
- newResolvedState.expanded = {};
23753
- }
23754
- Object.assign(newResolvedState, this.getSortedData(newResolvedState));
23755
- }
23756
- if (oldState.filtered !== newResolvedState.filtered) {
23757
- newResolvedState.page = 0;
23758
- }
23759
- if (newResolvedState.sortedData) {
23760
- newResolvedState.pages = newResolvedState.manual ? newResolvedState.pages : Math.ceil(newResolvedState.sortedData.length / newResolvedState.pageSize);
23761
- newResolvedState.page = newResolvedState.manual ? newResolvedState.page : Math.max(newResolvedState.page >= newResolvedState.pages ? newResolvedState.pages - 1 : newResolvedState.page, 0);
23762
- }
23763
- return this.setState(newResolvedState, function() {
23764
- if (cb) {
23765
- cb();
23766
- }
23767
- if (oldState.page !== newResolvedState.page || oldState.pageSize !== newResolvedState.pageSize || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered) {
23768
- _this2.fireFetchData();
23769
- }
23770
- });
23771
- }, "setStateWithData")
23772
- }]);
23773
- return _class;
23774
- }(Base);
23775
- }, "Lifecycle");
23776
- var _slicedToArray$4 = function() {
23777
- function sliceIterator(arr, i) {
23778
- var _arr = [];
23779
- var _n = true;
23780
- var _d = false;
23781
- var _e = void 0;
23782
- try {
23783
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
23784
- _arr.push(_s.value);
23785
- if (i && _arr.length === i)
23786
- break;
23611
+ UNSAFE_componentWillReceiveProps(nextProps, nextState) {
23612
+ const oldState = this.getResolvedState();
23613
+ const newState = this.getResolvedState(nextProps, nextState);
23614
+ const defaultableOptions = ["sorted", "filtered", "resized", "expanded"];
23615
+ defaultableOptions.forEach((x2) => {
23616
+ const defaultName = `default${x2.charAt(0).toUpperCase() + x2.slice(1)}`;
23617
+ if (JSON.stringify(oldState[defaultName]) !== JSON.stringify(newState[defaultName])) {
23618
+ newState[x2] = newState[defaultName];
23787
23619
  }
23788
- } catch (err) {
23789
- _d = true;
23790
- _e = err;
23791
- } finally {
23792
- try {
23793
- if (!_n && _i["return"])
23794
- _i["return"]();
23795
- } finally {
23796
- if (_d)
23797
- throw _e;
23620
+ });
23621
+ const resettableOptions = ["sortable", "filterable", "resizable"];
23622
+ resettableOptions.forEach((x2) => {
23623
+ if (oldState[x2] !== newState[x2]) {
23624
+ const baseName = x2.replace("able", "");
23625
+ const optionName = `${baseName}ed`;
23626
+ const defaultName = `default${optionName.charAt(0).toUpperCase() + optionName.slice(1)}`;
23627
+ newState[optionName] = newState[defaultName];
23628
+ }
23629
+ });
23630
+ if (oldState.data !== newState.data || oldState.columns !== newState.columns || oldState.pivotBy !== newState.pivotBy || oldState.sorted !== newState.sorted || oldState.filtered !== newState.filtered) {
23631
+ this.setStateWithData(this.getDataModel(newState, oldState.data !== newState.data));
23632
+ }
23633
+ }
23634
+ setStateWithData(newState, cb) {
23635
+ const oldState = this.getResolvedState();
23636
+ const newResolvedState = this.getResolvedState({}, newState);
23637
+ const { freezeWhenExpanded } = newResolvedState;
23638
+ newResolvedState.frozen = false;
23639
+ if (freezeWhenExpanded) {
23640
+ const keys3 = Object.keys(newResolvedState.expanded);
23641
+ for (let i = 0; i < keys3.length; i += 1) {
23642
+ if (newResolvedState.expanded[keys3[i]]) {
23643
+ newResolvedState.frozen = true;
23644
+ break;
23645
+ }
23798
23646
  }
23799
23647
  }
23800
- return _arr;
23801
- }
23802
- __name(sliceIterator, "sliceIterator");
23803
- return function(arr, i) {
23804
- if (Array.isArray(arr)) {
23805
- return arr;
23806
- } else if (Symbol.iterator in Object(arr)) {
23807
- return sliceIterator(arr, i);
23808
- } else {
23809
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
23810
- }
23811
- };
23812
- }();
23813
- var _extends$l = Object.assign || function(target) {
23814
- for (var i = 1; i < arguments.length; i++) {
23815
- var source = arguments[i];
23816
- for (var key in source) {
23817
- if (Object.prototype.hasOwnProperty.call(source, key)) {
23818
- target[key] = source[key];
23648
+ if (oldState.frozen && !newResolvedState.frozen || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered || oldState.showFilters !== newResolvedState.showFilters || !newResolvedState.frozen && oldState.resolvedData !== newResolvedState.resolvedData) {
23649
+ 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) {
23650
+ newResolvedState.expanded = {};
23819
23651
  }
23652
+ Object.assign(newResolvedState, this.getSortedData(newResolvedState));
23820
23653
  }
23821
- }
23822
- return target;
23823
- };
23824
- var _createClass$b = function() {
23825
- function defineProperties2(target, props) {
23826
- for (var i = 0; i < props.length; i++) {
23827
- var descriptor2 = props[i];
23828
- descriptor2.enumerable = descriptor2.enumerable || false;
23829
- descriptor2.configurable = true;
23830
- if ("value" in descriptor2)
23831
- descriptor2.writable = true;
23832
- Object.defineProperty(target, descriptor2.key, descriptor2);
23654
+ if (oldState.filtered !== newResolvedState.filtered) {
23655
+ newResolvedState.page = 0;
23833
23656
  }
23834
- }
23835
- __name(defineProperties2, "defineProperties");
23836
- return function(Constructor, protoProps, staticProps) {
23837
- if (protoProps)
23838
- defineProperties2(Constructor.prototype, protoProps);
23839
- if (staticProps)
23840
- defineProperties2(Constructor, staticProps);
23841
- return Constructor;
23842
- };
23843
- }();
23844
- function _defineProperty$4(obj, key, value) {
23845
- if (key in obj) {
23846
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
23847
- } else {
23848
- obj[key] = value;
23849
- }
23850
- return obj;
23851
- }
23852
- __name(_defineProperty$4, "_defineProperty$4");
23853
- function _toConsumableArray(arr) {
23854
- if (Array.isArray(arr)) {
23855
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
23856
- arr2[i] = arr[i];
23657
+ if (newResolvedState.sortedData) {
23658
+ newResolvedState.pages = newResolvedState.manual ? newResolvedState.pages : Math.ceil(newResolvedState.sortedData.length / newResolvedState.pageSize);
23659
+ newResolvedState.page = newResolvedState.manual ? newResolvedState.page : Math.max(
23660
+ newResolvedState.page >= newResolvedState.pages ? newResolvedState.pages - 1 : newResolvedState.page,
23661
+ 0
23662
+ );
23857
23663
  }
23858
- return arr2;
23859
- } else {
23860
- return Array.from(arr);
23861
- }
23862
- }
23863
- __name(_toConsumableArray, "_toConsumableArray");
23864
- function _classCallCheck$g(instance, Constructor) {
23865
- if (!(instance instanceof Constructor)) {
23866
- throw new TypeError("Cannot call a class as a function");
23867
- }
23868
- }
23869
- __name(_classCallCheck$g, "_classCallCheck$g");
23870
- function _possibleConstructorReturn$g(self2, call2) {
23871
- if (!self2) {
23872
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
23664
+ return this.setState(newResolvedState, () => {
23665
+ if (cb) {
23666
+ cb();
23667
+ }
23668
+ if (oldState.page !== newResolvedState.page || oldState.pageSize !== newResolvedState.pageSize || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered) {
23669
+ this.fireFetchData();
23670
+ }
23671
+ });
23873
23672
  }
23874
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
23875
- }
23876
- __name(_possibleConstructorReturn$g, "_possibleConstructorReturn$g");
23877
- function _inherits$g(subClass, superClass) {
23878
- if (typeof superClass !== "function" && superClass !== null) {
23879
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
23673
+ }, "Lifecycle");
23674
+ const Methods = /* @__PURE__ */ __name((Base) => class extends Base {
23675
+ getResolvedState(props, state) {
23676
+ const resolvedState = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, _.compactObject(this.state)), _.compactObject(this.props)), _.compactObject(state)), _.compactObject(props));
23677
+ return resolvedState;
23880
23678
  }
23881
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
23882
- if (superClass)
23883
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
23884
- }
23885
- __name(_inherits$g, "_inherits$g");
23886
- const Methods = /* @__PURE__ */ __name(function(Base) {
23887
- return function(_Base) {
23888
- _inherits$g(_class, _Base);
23889
- function _class() {
23890
- _classCallCheck$g(this, _class);
23891
- return _possibleConstructorReturn$g(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
23892
- }
23893
- __name(_class, "_class");
23894
- _createClass$b(_class, [{
23895
- key: "getResolvedState",
23896
- value: /* @__PURE__ */ __name(function getResolvedState(props, state) {
23897
- var resolvedState = _extends$l({}, _.compactObject(this.state), _.compactObject(this.props), _.compactObject(state), _.compactObject(props));
23898
- return resolvedState;
23899
- }, "getResolvedState")
23900
- }, {
23901
- key: "getDataModel",
23902
- value: /* @__PURE__ */ __name(function getDataModel(newState) {
23903
- var _this2 = this;
23904
- 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;
23905
- var hasHeaderGroups = false;
23906
- columns.forEach(function(column) {
23907
- if (column.columns) {
23908
- hasHeaderGroups = true;
23909
- }
23679
+ getDataModel(newState) {
23680
+ const {
23681
+ columns,
23682
+ pivotBy = [],
23683
+ data,
23684
+ resolveData,
23685
+ pivotIDKey,
23686
+ pivotValKey,
23687
+ subRowsKey,
23688
+ aggregatedKey,
23689
+ nestingLevelKey,
23690
+ originalKey,
23691
+ indexKey,
23692
+ groupedByPivotKey,
23693
+ SubComponent
23694
+ } = newState;
23695
+ let hasHeaderGroups = false;
23696
+ columns.forEach((column) => {
23697
+ if (column.columns) {
23698
+ hasHeaderGroups = true;
23699
+ }
23700
+ });
23701
+ let columnsWithExpander = [...columns];
23702
+ let expanderColumn = columns.find(
23703
+ (col) => col.expander || col.columns && col.columns.some((col2) => col2.expander)
23704
+ );
23705
+ if (expanderColumn && !expanderColumn.expander) {
23706
+ expanderColumn = expanderColumn.columns.find((col) => col.expander);
23707
+ }
23708
+ if (SubComponent && !expanderColumn) {
23709
+ expanderColumn = { expander: true };
23710
+ columnsWithExpander = [expanderColumn, ...columnsWithExpander];
23711
+ }
23712
+ const makeDecoratedColumn = /* @__PURE__ */ __name((column, parentColumn) => {
23713
+ let dcol;
23714
+ if (column.expander) {
23715
+ dcol = __spreadValues(__spreadValues(__spreadValues({}, this.props.column), this.props.expanderDefaults), column);
23716
+ } else {
23717
+ dcol = __spreadValues(__spreadValues({}, this.props.column), column);
23718
+ }
23719
+ if (dcol.maxWidth < dcol.minWidth) {
23720
+ dcol.minWidth = dcol.maxWidth;
23721
+ }
23722
+ if (parentColumn) {
23723
+ dcol.parentColumn = parentColumn;
23724
+ }
23725
+ if (typeof dcol.accessor === "string") {
23726
+ dcol.id = dcol.id || dcol.accessor;
23727
+ const accessorString = dcol.accessor;
23728
+ dcol.accessor = (row) => _.get(row, accessorString);
23729
+ return dcol;
23730
+ }
23731
+ if (dcol.accessor && !dcol.id) {
23732
+ console.warn(dcol);
23733
+ throw new Error(
23734
+ "A column id is required if using a non-string accessor for column above."
23735
+ );
23736
+ }
23737
+ if (!dcol.accessor) {
23738
+ dcol.accessor = () => void 0;
23739
+ }
23740
+ return dcol;
23741
+ }, "makeDecoratedColumn");
23742
+ const allDecoratedColumns = [];
23743
+ const decorateAndAddToAll = /* @__PURE__ */ __name((column, parentColumn) => {
23744
+ const decoratedColumn = makeDecoratedColumn(column, parentColumn);
23745
+ allDecoratedColumns.push(decoratedColumn);
23746
+ return decoratedColumn;
23747
+ }, "decorateAndAddToAll");
23748
+ const decoratedColumns = columnsWithExpander.map((column) => {
23749
+ if (column.columns) {
23750
+ return __spreadProps(__spreadValues({}, column), {
23751
+ columns: column.columns.map((d2) => decorateAndAddToAll(d2, column))
23910
23752
  });
23911
- var columnsWithExpander = [].concat(_toConsumableArray(columns));
23912
- var expanderColumn = columns.find(function(col) {
23913
- return col.expander || col.columns && col.columns.some(function(col2) {
23914
- return col2.expander;
23915
- });
23753
+ }
23754
+ return decorateAndAddToAll(column);
23755
+ });
23756
+ let visibleColumns = decoratedColumns.slice();
23757
+ let allVisibleColumns = [];
23758
+ visibleColumns = visibleColumns.map((column) => {
23759
+ if (column.columns) {
23760
+ const visibleSubColumns = column.columns.filter(
23761
+ (d2) => pivotBy.indexOf(d2.id) > -1 ? false : _.getFirstDefined(d2.show, true)
23762
+ );
23763
+ return __spreadProps(__spreadValues({}, column), {
23764
+ columns: visibleSubColumns
23916
23765
  });
23917
- if (expanderColumn && !expanderColumn.expander) {
23918
- expanderColumn = expanderColumn.columns.find(function(col) {
23919
- return col.expander;
23920
- });
23766
+ }
23767
+ return column;
23768
+ });
23769
+ visibleColumns = visibleColumns.filter(
23770
+ (column) => column.columns ? column.columns.length : pivotBy.indexOf(column.id) > -1 ? false : _.getFirstDefined(column.show, true)
23771
+ );
23772
+ const pivotIndex = visibleColumns.findIndex((col) => col.pivot);
23773
+ if (pivotBy.length) {
23774
+ const pivotColumns = [];
23775
+ pivotBy.forEach((pivotID) => {
23776
+ const found = allDecoratedColumns.find((d2) => d2.id === pivotID);
23777
+ if (found) {
23778
+ pivotColumns.push(found);
23921
23779
  }
23922
- if (SubComponent && !expanderColumn) {
23923
- expanderColumn = { expander: true };
23924
- columnsWithExpander = [expanderColumn].concat(_toConsumableArray(columnsWithExpander));
23780
+ });
23781
+ const PivotParentColumn = pivotColumns.reduce(
23782
+ (prev, current) => prev && prev === current.parentColumn && current.parentColumn,
23783
+ pivotColumns[0].parentColumn
23784
+ );
23785
+ let PivotGroupHeader = hasHeaderGroups && PivotParentColumn.Header;
23786
+ PivotGroupHeader = PivotGroupHeader || (() => /* @__PURE__ */ React__default.createElement("strong", null, "Pivoted"));
23787
+ let pivotColumnGroup = {
23788
+ Header: PivotGroupHeader,
23789
+ columns: pivotColumns.map((col) => __spreadProps(__spreadValues(__spreadValues({}, this.props.pivotDefaults), col), {
23790
+ pivoted: true
23791
+ }))
23792
+ };
23793
+ if (pivotIndex >= 0) {
23794
+ pivotColumnGroup = __spreadValues(__spreadValues({}, visibleColumns[pivotIndex]), pivotColumnGroup);
23795
+ visibleColumns.splice(pivotIndex, 1, pivotColumnGroup);
23796
+ } else {
23797
+ visibleColumns.unshift(pivotColumnGroup);
23798
+ }
23799
+ }
23800
+ const headerGroups = [];
23801
+ let currentSpan = [];
23802
+ const addHeader = /* @__PURE__ */ __name((columns2, column) => {
23803
+ headerGroups.push(__spreadProps(__spreadValues(__spreadValues({}, this.props.column), column), {
23804
+ columns: columns2
23805
+ }));
23806
+ currentSpan = [];
23807
+ }, "addHeader");
23808
+ visibleColumns.forEach((column) => {
23809
+ if (column.columns) {
23810
+ allVisibleColumns = allVisibleColumns.concat(column.columns);
23811
+ if (currentSpan.length > 0) {
23812
+ addHeader(currentSpan);
23925
23813
  }
23926
- var makeDecoratedColumn = /* @__PURE__ */ __name(function makeDecoratedColumn2(column, parentColumn) {
23927
- var dcol = void 0;
23928
- if (column.expander) {
23929
- dcol = _extends$l({}, _this2.props.column, _this2.props.expanderDefaults, column);
23930
- } else {
23931
- dcol = _extends$l({}, _this2.props.column, column);
23932
- }
23933
- if (dcol.maxWidth < dcol.minWidth) {
23934
- dcol.minWidth = dcol.maxWidth;
23935
- }
23936
- if (parentColumn) {
23937
- dcol.parentColumn = parentColumn;
23938
- }
23939
- if (typeof dcol.accessor === "string") {
23940
- dcol.id = dcol.id || dcol.accessor;
23941
- var accessorString = dcol.accessor;
23942
- dcol.accessor = function(row) {
23943
- return _.get(row, accessorString);
23944
- };
23945
- return dcol;
23946
- }
23947
- if (dcol.accessor && !dcol.id) {
23948
- console.warn(dcol);
23949
- throw new Error("A column id is required if using a non-string accessor for column above.");
23950
- }
23951
- if (!dcol.accessor) {
23952
- dcol.accessor = function() {
23953
- return void 0;
23954
- };
23955
- }
23956
- return dcol;
23957
- }, "makeDecoratedColumn");
23958
- var allDecoratedColumns = [];
23959
- var decorateAndAddToAll = /* @__PURE__ */ __name(function decorateAndAddToAll2(column, parentColumn) {
23960
- var decoratedColumn = makeDecoratedColumn(column, parentColumn);
23961
- allDecoratedColumns.push(decoratedColumn);
23962
- return decoratedColumn;
23963
- }, "decorateAndAddToAll");
23964
- var decoratedColumns = columnsWithExpander.map(function(column) {
23965
- if (column.columns) {
23966
- return _extends$l({}, column, {
23967
- columns: column.columns.map(function(d2) {
23968
- return decorateAndAddToAll(d2, column);
23969
- })
23970
- });
23971
- }
23972
- return decorateAndAddToAll(column);
23973
- });
23974
- var visibleColumns = decoratedColumns.slice();
23975
- var allVisibleColumns = [];
23976
- visibleColumns = visibleColumns.map(function(column) {
23977
- if (column.columns) {
23978
- var visibleSubColumns = column.columns.filter(function(d2) {
23979
- return pivotBy.indexOf(d2.id) > -1 ? false : _.getFirstDefined(d2.show, true);
23980
- });
23981
- return _extends$l({}, column, {
23982
- columns: visibleSubColumns
23983
- });
23984
- }
23985
- return column;
23986
- });
23987
- visibleColumns = visibleColumns.filter(function(column) {
23988
- return column.columns ? column.columns.length : pivotBy.indexOf(column.id) > -1 ? false : _.getFirstDefined(column.show, true);
23989
- });
23990
- var pivotIndex = visibleColumns.findIndex(function(col) {
23991
- return col.pivot;
23814
+ addHeader(column.columns, column);
23815
+ return;
23816
+ }
23817
+ allVisibleColumns.push(column);
23818
+ currentSpan.push(column);
23819
+ });
23820
+ if (hasHeaderGroups && currentSpan.length > 0) {
23821
+ addHeader(currentSpan);
23822
+ }
23823
+ const accessRow = /* @__PURE__ */ __name((d2, i, level = 0) => {
23824
+ const row = {
23825
+ [originalKey]: d2,
23826
+ [indexKey]: i,
23827
+ [subRowsKey]: d2[subRowsKey],
23828
+ [nestingLevelKey]: level
23829
+ };
23830
+ allDecoratedColumns.forEach((column) => {
23831
+ if (column.expander)
23832
+ return;
23833
+ row[column.id] = column.accessor(d2);
23834
+ });
23835
+ if (row[subRowsKey]) {
23836
+ row[subRowsKey] = row[subRowsKey].map((d22, i2) => accessRow(d22, i2, level + 1));
23837
+ }
23838
+ return row;
23839
+ }, "accessRow");
23840
+ let resolvedData = resolveData(data).map((d2, i) => accessRow(d2, i));
23841
+ const aggregatingColumns = allVisibleColumns.filter((d2) => !d2.expander && d2.aggregate);
23842
+ const aggregate = /* @__PURE__ */ __name((rows) => {
23843
+ const aggregationValues = {};
23844
+ aggregatingColumns.forEach((column) => {
23845
+ const values = rows.map((d2) => d2[column.id]);
23846
+ aggregationValues[column.id] = column.aggregate(values, rows);
23847
+ });
23848
+ return aggregationValues;
23849
+ }, "aggregate");
23850
+ if (pivotBy.length) {
23851
+ const groupRecursively = /* @__PURE__ */ __name((rows, keys3, i = 0) => {
23852
+ if (i === keys3.length) {
23853
+ return rows;
23854
+ }
23855
+ let groupedRows = Object.entries(_.groupBy(rows, keys3[i])).map(([key, value]) => ({
23856
+ [pivotIDKey]: keys3[i],
23857
+ [pivotValKey]: key,
23858
+ [keys3[i]]: key,
23859
+ [subRowsKey]: value,
23860
+ [nestingLevelKey]: i,
23861
+ [groupedByPivotKey]: true
23862
+ }));
23863
+ groupedRows = groupedRows.map((rowGroup) => {
23864
+ const subRows = groupRecursively(rowGroup[subRowsKey], keys3, i + 1);
23865
+ return __spreadValues(__spreadProps(__spreadValues({}, rowGroup), {
23866
+ [subRowsKey]: subRows,
23867
+ [aggregatedKey]: true
23868
+ }), aggregate(subRows));
23992
23869
  });
23993
- if (pivotBy.length) {
23994
- var pivotColumns = [];
23995
- pivotBy.forEach(function(pivotID) {
23996
- var found = allDecoratedColumns.find(function(d2) {
23997
- return d2.id === pivotID;
23998
- });
23999
- if (found) {
24000
- pivotColumns.push(found);
24001
- }
24002
- });
24003
- var PivotParentColumn = pivotColumns.reduce(function(prev, current) {
24004
- return prev && prev === current.parentColumn && current.parentColumn;
24005
- }, pivotColumns[0].parentColumn);
24006
- var PivotGroupHeader = hasHeaderGroups && PivotParentColumn.Header;
24007
- PivotGroupHeader = PivotGroupHeader || function() {
24008
- return React__default.createElement(
24009
- "strong",
24010
- null,
24011
- "Pivoted"
24012
- );
24013
- };
24014
- var pivotColumnGroup = {
24015
- Header: PivotGroupHeader,
24016
- columns: pivotColumns.map(function(col) {
24017
- return _extends$l({}, _this2.props.pivotDefaults, col, {
24018
- pivoted: true
24019
- });
24020
- })
24021
- // Place the pivotColumns back into the visibleColumns
24022
- };
24023
- if (pivotIndex >= 0) {
24024
- pivotColumnGroup = _extends$l({}, visibleColumns[pivotIndex], pivotColumnGroup);
24025
- visibleColumns.splice(pivotIndex, 1, pivotColumnGroup);
24026
- } else {
24027
- visibleColumns.unshift(pivotColumnGroup);
24028
- }
23870
+ return groupedRows;
23871
+ }, "groupRecursively");
23872
+ resolvedData = groupRecursively(resolvedData, pivotBy);
23873
+ }
23874
+ return __spreadProps(__spreadValues({}, newState), {
23875
+ resolvedData,
23876
+ allVisibleColumns,
23877
+ headerGroups,
23878
+ allDecoratedColumns,
23879
+ hasHeaderGroups
23880
+ });
23881
+ }
23882
+ getSortedData(resolvedState) {
23883
+ const {
23884
+ manual,
23885
+ sorted,
23886
+ filtered,
23887
+ defaultFilterMethod,
23888
+ resolvedData,
23889
+ allVisibleColumns,
23890
+ allDecoratedColumns
23891
+ } = resolvedState;
23892
+ const sortMethodsByColumnID = {};
23893
+ allDecoratedColumns.filter((col) => col.sortMethod).forEach((col) => {
23894
+ sortMethodsByColumnID[col.id] = col.sortMethod;
23895
+ });
23896
+ return {
23897
+ sortedData: manual ? resolvedData : this.sortData(
23898
+ this.filterData(resolvedData, filtered, defaultFilterMethod, allVisibleColumns),
23899
+ sorted,
23900
+ sortMethodsByColumnID
23901
+ )
23902
+ };
23903
+ }
23904
+ fireFetchData() {
23905
+ this.props.onFetchData(this.getResolvedState(), this);
23906
+ }
23907
+ getPropOrState(key) {
23908
+ return _.getFirstDefined(this.props[key], this.state[key]);
23909
+ }
23910
+ getStateOrProp(key) {
23911
+ return _.getFirstDefined(this.state[key], this.props[key]);
23912
+ }
23913
+ filterData(data, filtered, defaultFilterMethod, allVisibleColumns) {
23914
+ let filteredData = data;
23915
+ if (filtered.length) {
23916
+ filteredData = filtered.reduce((filteredSoFar, nextFilter) => {
23917
+ const column = allVisibleColumns.find((x2) => x2.id === nextFilter.id);
23918
+ if (!column || column.filterable === false) {
23919
+ return filteredSoFar;
24029
23920
  }
24030
- var headerGroups = [];
24031
- var currentSpan = [];
24032
- var addHeader = /* @__PURE__ */ __name(function addHeader2(columns2, column) {
24033
- headerGroups.push(_extends$l({}, _this2.props.column, column, {
24034
- columns: columns2
24035
- }));
24036
- currentSpan = [];
24037
- }, "addHeader");
24038
- visibleColumns.forEach(function(column) {
24039
- if (column.columns) {
24040
- allVisibleColumns = allVisibleColumns.concat(column.columns);
24041
- if (currentSpan.length > 0) {
24042
- addHeader(currentSpan);
24043
- }
24044
- addHeader(column.columns, column);
24045
- return;
24046
- }
24047
- allVisibleColumns.push(column);
24048
- currentSpan.push(column);
24049
- });
24050
- if (hasHeaderGroups && currentSpan.length > 0) {
24051
- addHeader(currentSpan);
23921
+ const filterMethod = column.filterMethod || defaultFilterMethod;
23922
+ if (column.filterAll) {
23923
+ return filterMethod(nextFilter, filteredSoFar, column);
24052
23924
  }
24053
- var accessRow = /* @__PURE__ */ __name(function accessRow2(d2, i) {
24054
- var _row;
24055
- var level = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
24056
- 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);
24057
- allDecoratedColumns.forEach(function(column) {
24058
- if (column.expander)
24059
- return;
24060
- row[column.id] = column.accessor(d2);
24061
- });
24062
- if (row[subRowsKey]) {
24063
- row[subRowsKey] = row[subRowsKey].map(function(d3, i2) {
24064
- return accessRow2(d3, i2, level + 1);
24065
- });
24066
- }
23925
+ return filteredSoFar.filter((row) => filterMethod(nextFilter, row, column));
23926
+ }, filteredData);
23927
+ filteredData = filteredData.map((row) => {
23928
+ if (!row[this.props.subRowsKey]) {
24067
23929
  return row;
24068
- }, "accessRow");
24069
- var resolvedData = resolveData2(data).map(function(d2, i) {
24070
- return accessRow(d2, i);
24071
- });
24072
- var aggregatingColumns = allVisibleColumns.filter(function(d2) {
24073
- return !d2.expander && d2.aggregate;
24074
- });
24075
- var aggregate = /* @__PURE__ */ __name(function aggregate2(rows) {
24076
- var aggregationValues = {};
24077
- aggregatingColumns.forEach(function(column) {
24078
- var values = rows.map(function(d2) {
24079
- return d2[column.id];
24080
- });
24081
- aggregationValues[column.id] = column.aggregate(values, rows);
24082
- });
24083
- return aggregationValues;
24084
- }, "aggregate");
24085
- if (pivotBy.length) {
24086
- var groupRecursively = /* @__PURE__ */ __name(function groupRecursively2(rows, keys3) {
24087
- var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
24088
- if (i === keys3.length) {
24089
- return rows;
24090
- }
24091
- var groupedRows = Object.entries(_.groupBy(rows, keys3[i])).map(function(_ref) {
24092
- var _ref3;
24093
- var _ref2 = _slicedToArray$4(_ref, 2), key = _ref2[0], value = _ref2[1];
24094
- 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;
24095
- });
24096
- groupedRows = groupedRows.map(function(rowGroup) {
24097
- var _extends2;
24098
- var subRows = groupRecursively2(rowGroup[subRowsKey], keys3, i + 1);
24099
- return _extends$l({}, rowGroup, (_extends2 = {}, _defineProperty$4(_extends2, subRowsKey, subRows), _defineProperty$4(_extends2, aggregatedKey, true), _extends2), aggregate(subRows));
24100
- });
24101
- return groupedRows;
24102
- }, "groupRecursively");
24103
- resolvedData = groupRecursively(resolvedData, pivotBy);
24104
- }
24105
- return _extends$l({}, newState, {
24106
- resolvedData,
24107
- allVisibleColumns,
24108
- headerGroups,
24109
- allDecoratedColumns,
24110
- hasHeaderGroups
24111
- });
24112
- }, "getDataModel")
24113
- }, {
24114
- key: "getSortedData",
24115
- value: /* @__PURE__ */ __name(function getSortedData(resolvedState) {
24116
- var manual = resolvedState.manual, sorted = resolvedState.sorted, filtered = resolvedState.filtered, defaultFilterMethod2 = resolvedState.defaultFilterMethod, resolvedData = resolvedState.resolvedData, allVisibleColumns = resolvedState.allVisibleColumns, allDecoratedColumns = resolvedState.allDecoratedColumns;
24117
- var sortMethodsByColumnID = {};
24118
- allDecoratedColumns.filter(function(col) {
24119
- return col.sortMethod;
24120
- }).forEach(function(col) {
24121
- sortMethodsByColumnID[col.id] = col.sortMethod;
24122
- });
24123
- return {
24124
- sortedData: manual ? resolvedData : this.sortData(this.filterData(resolvedData, filtered, defaultFilterMethod2, allVisibleColumns), sorted, sortMethodsByColumnID)
24125
- };
24126
- }, "getSortedData")
24127
- }, {
24128
- key: "fireFetchData",
24129
- value: /* @__PURE__ */ __name(function fireFetchData() {
24130
- this.props.onFetchData(this.getResolvedState(), this);
24131
- }, "fireFetchData")
24132
- }, {
24133
- key: "getPropOrState",
24134
- value: /* @__PURE__ */ __name(function getPropOrState(key) {
24135
- return _.getFirstDefined(this.props[key], this.state[key]);
24136
- }, "getPropOrState")
24137
- }, {
24138
- key: "getStateOrProp",
24139
- value: /* @__PURE__ */ __name(function getStateOrProp(key) {
24140
- return _.getFirstDefined(this.state[key], this.props[key]);
24141
- }, "getStateOrProp")
24142
- }, {
24143
- key: "filterData",
24144
- value: /* @__PURE__ */ __name(function filterData(data, filtered, defaultFilterMethod2, allVisibleColumns) {
24145
- var _this3 = this;
24146
- var filteredData = data;
24147
- if (filtered.length) {
24148
- filteredData = filtered.reduce(function(filteredSoFar, nextFilter) {
24149
- var column = allVisibleColumns.find(function(x2) {
24150
- return x2.id === nextFilter.id;
24151
- });
24152
- if (!column || column.filterable === false) {
24153
- return filteredSoFar;
24154
- }
24155
- var filterMethod = column.filterMethod || defaultFilterMethod2;
24156
- if (column.filterAll) {
24157
- return filterMethod(nextFilter, filteredSoFar, column);
24158
- }
24159
- return filteredSoFar.filter(function(row) {
24160
- return filterMethod(nextFilter, row, column);
24161
- });
24162
- }, filteredData);
24163
- filteredData = filteredData.map(function(row) {
24164
- if (!row[_this3.props.subRowsKey]) {
24165
- return row;
24166
- }
24167
- return _extends$l({}, row, _defineProperty$4({}, _this3.props.subRowsKey, _this3.filterData(row[_this3.props.subRowsKey], filtered, defaultFilterMethod2, allVisibleColumns)));
24168
- }).filter(function(row) {
24169
- if (!row[_this3.props.subRowsKey]) {
24170
- return true;
24171
- }
24172
- return row[_this3.props.subRowsKey].length > 0;
24173
- });
24174
- }
24175
- return filteredData;
24176
- }, "filterData")
24177
- }, {
24178
- key: "sortData",
24179
- value: /* @__PURE__ */ __name(function sortData(data, sorted) {
24180
- var _this4 = this;
24181
- var sortMethodsByColumnID = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
24182
- if (!sorted.length) {
24183
- return data;
24184
23930
  }
24185
- var sortedData = (this.props.orderByMethod || _.orderBy)(data, sorted.map(function(sort2) {
24186
- if (sortMethodsByColumnID[sort2.id]) {
24187
- return function(a2, b2) {
24188
- return sortMethodsByColumnID[sort2.id](a2[sort2.id], b2[sort2.id], sort2.desc);
24189
- };
24190
- }
24191
- return function(a2, b2) {
24192
- return _this4.props.defaultSortMethod(a2[sort2.id], b2[sort2.id], sort2.desc);
24193
- };
24194
- }), sorted.map(function(d2) {
24195
- return !d2.desc;
24196
- }), this.props.indexKey);
24197
- sortedData.forEach(function(row) {
24198
- if (!row[_this4.props.subRowsKey]) {
24199
- return;
24200
- }
24201
- row[_this4.props.subRowsKey] = _this4.sortData(row[_this4.props.subRowsKey], sorted, sortMethodsByColumnID);
24202
- });
24203
- return sortedData;
24204
- }, "sortData")
24205
- }, {
24206
- key: "getMinRows",
24207
- value: /* @__PURE__ */ __name(function getMinRows() {
24208
- return _.getFirstDefined(this.props.minRows, this.getStateOrProp("pageSize"));
24209
- }, "getMinRows")
24210
- // User actions
24211
- }, {
24212
- key: "onPageChange",
24213
- value: /* @__PURE__ */ __name(function onPageChange(page) {
24214
- var _props = this.props, onPageChange2 = _props.onPageChange, collapseOnPageChange = _props.collapseOnPageChange;
24215
- var newState = { page };
24216
- if (collapseOnPageChange) {
24217
- newState.expanded = {};
24218
- }
24219
- this.setStateWithData(newState, function() {
24220
- return onPageChange2 && onPageChange2(page);
24221
- });
24222
- }, "onPageChange")
24223
- }, {
24224
- key: "onPageSizeChange",
24225
- value: /* @__PURE__ */ __name(function onPageSizeChange(newPageSize) {
24226
- var onPageSizeChange2 = this.props.onPageSizeChange;
24227
- var _getResolvedState = this.getResolvedState(), pageSize = _getResolvedState.pageSize, page = _getResolvedState.page;
24228
- var currentRow = pageSize * page;
24229
- var newPage = Math.floor(currentRow / newPageSize);
24230
- this.setStateWithData({
24231
- pageSize: newPageSize,
24232
- page: newPage
24233
- }, function() {
24234
- return onPageSizeChange2 && onPageSizeChange2(newPageSize, newPage);
23931
+ return __spreadProps(__spreadValues({}, row), {
23932
+ [this.props.subRowsKey]: this.filterData(
23933
+ row[this.props.subRowsKey],
23934
+ filtered,
23935
+ defaultFilterMethod,
23936
+ allVisibleColumns
23937
+ )
24235
23938
  });
24236
- }, "onPageSizeChange")
24237
- }, {
24238
- key: "sortColumn",
24239
- value: /* @__PURE__ */ __name(function sortColumn(column, additive) {
24240
- var _getResolvedState2 = this.getResolvedState(), sorted = _getResolvedState2.sorted, skipNextSort = _getResolvedState2.skipNextSort, defaultSortDesc = _getResolvedState2.defaultSortDesc;
24241
- var firstSortDirection = Object.prototype.hasOwnProperty.call(column, "defaultSortDesc") ? column.defaultSortDesc : defaultSortDesc;
24242
- var secondSortDirection = !firstSortDirection;
24243
- if (skipNextSort) {
24244
- this.setStateWithData({
24245
- skipNextSort: false
24246
- });
24247
- return;
23939
+ }).filter((row) => {
23940
+ if (!row[this.props.subRowsKey]) {
23941
+ return true;
24248
23942
  }
24249
- var onSortedChange = this.props.onSortedChange;
24250
- var newSorted = _.clone(sorted || []).map(function(d2) {
24251
- d2.desc = _.isSortingDesc(d2);
24252
- return d2;
24253
- });
24254
- if (!_.isArray(column)) {
24255
- var existingIndex = newSorted.findIndex(function(d2) {
24256
- return d2.id === column.id;
24257
- });
24258
- if (existingIndex > -1) {
24259
- var existing = newSorted[existingIndex];
24260
- if (existing.desc === secondSortDirection) {
24261
- if (additive) {
24262
- newSorted.splice(existingIndex, 1);
24263
- } else {
24264
- existing.desc = firstSortDirection;
24265
- newSorted = [existing];
24266
- }
24267
- } else {
24268
- existing.desc = secondSortDirection;
24269
- if (!additive) {
24270
- newSorted = [existing];
24271
- }
24272
- }
24273
- } else if (additive) {
24274
- newSorted.push({
24275
- id: column.id,
24276
- desc: firstSortDirection
24277
- });
23943
+ return row[this.props.subRowsKey].length > 0;
23944
+ });
23945
+ }
23946
+ return filteredData;
23947
+ }
23948
+ sortData(data, sorted, sortMethodsByColumnID = {}) {
23949
+ if (!sorted.length) {
23950
+ return data;
23951
+ }
23952
+ const sortedData = (this.props.orderByMethod || _.orderBy)(
23953
+ data,
23954
+ sorted.map((sort2) => {
23955
+ if (sortMethodsByColumnID[sort2.id]) {
23956
+ return (a2, b2) => sortMethodsByColumnID[sort2.id](a2[sort2.id], b2[sort2.id], sort2.desc);
23957
+ }
23958
+ return (a2, b2) => this.props.defaultSortMethod(a2[sort2.id], b2[sort2.id], sort2.desc);
23959
+ }),
23960
+ sorted.map((d2) => !d2.desc),
23961
+ this.props.indexKey
23962
+ );
23963
+ sortedData.forEach((row) => {
23964
+ if (!row[this.props.subRowsKey]) {
23965
+ return;
23966
+ }
23967
+ row[this.props.subRowsKey] = this.sortData(
23968
+ row[this.props.subRowsKey],
23969
+ sorted,
23970
+ sortMethodsByColumnID
23971
+ );
23972
+ });
23973
+ return sortedData;
23974
+ }
23975
+ getMinRows() {
23976
+ return _.getFirstDefined(this.props.minRows, this.getStateOrProp("pageSize"));
23977
+ }
23978
+ // User actions
23979
+ onPageChange(page) {
23980
+ const { onPageChange, collapseOnPageChange } = this.props;
23981
+ const newState = { page };
23982
+ if (collapseOnPageChange) {
23983
+ newState.expanded = {};
23984
+ }
23985
+ this.setStateWithData(newState, () => onPageChange && onPageChange(page));
23986
+ }
23987
+ onPageSizeChange(newPageSize) {
23988
+ const { onPageSizeChange } = this.props;
23989
+ const { pageSize, page } = this.getResolvedState();
23990
+ const currentRow = pageSize * page;
23991
+ const newPage = Math.floor(currentRow / newPageSize);
23992
+ this.setStateWithData(
23993
+ {
23994
+ pageSize: newPageSize,
23995
+ page: newPage
23996
+ },
23997
+ () => onPageSizeChange && onPageSizeChange(newPageSize, newPage)
23998
+ );
23999
+ }
24000
+ sortColumn(column, additive) {
24001
+ const { sorted, skipNextSort, defaultSortDesc } = this.getResolvedState();
24002
+ const firstSortDirection = Object.prototype.hasOwnProperty.call(column, "defaultSortDesc") ? column.defaultSortDesc : defaultSortDesc;
24003
+ const secondSortDirection = !firstSortDirection;
24004
+ if (skipNextSort) {
24005
+ this.setStateWithData({
24006
+ skipNextSort: false
24007
+ });
24008
+ return;
24009
+ }
24010
+ const { onSortedChange } = this.props;
24011
+ let newSorted = _.clone(sorted || []).map((d2) => {
24012
+ d2.desc = _.isSortingDesc(d2);
24013
+ return d2;
24014
+ });
24015
+ if (!_.isArray(column)) {
24016
+ const existingIndex = newSorted.findIndex((d2) => d2.id === column.id);
24017
+ if (existingIndex > -1) {
24018
+ const existing = newSorted[existingIndex];
24019
+ if (existing.desc === secondSortDirection) {
24020
+ if (additive) {
24021
+ newSorted.splice(existingIndex, 1);
24278
24022
  } else {
24279
- newSorted = [{
24280
- id: column.id,
24281
- desc: firstSortDirection
24282
- }];
24023
+ existing.desc = firstSortDirection;
24024
+ newSorted = [existing];
24283
24025
  }
24284
24026
  } else {
24285
- var _existingIndex = newSorted.findIndex(function(d2) {
24286
- return d2.id === column[0].id;
24287
- });
24288
- if (_existingIndex > -1) {
24289
- var _existing = newSorted[_existingIndex];
24290
- if (_existing.desc === secondSortDirection) {
24291
- if (additive) {
24292
- newSorted.splice(_existingIndex, column.length);
24293
- } else {
24294
- column.forEach(function(d2, i) {
24295
- newSorted[_existingIndex + i].desc = firstSortDirection;
24296
- });
24297
- }
24298
- } else {
24299
- column.forEach(function(d2, i) {
24300
- newSorted[_existingIndex + i].desc = secondSortDirection;
24301
- });
24302
- }
24303
- if (!additive) {
24304
- newSorted = newSorted.slice(_existingIndex, column.length);
24305
- }
24306
- } else if (additive) {
24307
- newSorted = newSorted.concat(column.map(function(d2) {
24308
- return {
24309
- id: d2.id,
24310
- desc: firstSortDirection
24311
- };
24312
- }));
24313
- } else {
24314
- newSorted = column.map(function(d2) {
24315
- return {
24316
- id: d2.id,
24317
- desc: firstSortDirection
24318
- };
24319
- });
24027
+ existing.desc = secondSortDirection;
24028
+ if (!additive) {
24029
+ newSorted = [existing];
24320
24030
  }
24321
24031
  }
24322
- this.setStateWithData({
24323
- page: !sorted.length && newSorted.length || !additive ? 0 : this.state.page,
24324
- sorted: newSorted
24325
- }, function() {
24326
- return onSortedChange && onSortedChange(newSorted, column, additive);
24327
- });
24328
- }, "sortColumn")
24329
- }, {
24330
- key: "filterColumn",
24331
- value: /* @__PURE__ */ __name(function filterColumn(column, value) {
24332
- var _getResolvedState3 = this.getResolvedState(), filtered = _getResolvedState3.filtered;
24333
- var onFilteredChange = this.props.onFilteredChange;
24334
- var newFiltering = (filtered || []).filter(function(x2) {
24335
- return x2.id !== column.id;
24336
- });
24337
- if (value !== "") {
24338
- newFiltering.push({
24339
- id: column.id,
24340
- value
24341
- });
24342
- }
24343
- this.setStateWithData({
24344
- filtered: newFiltering
24345
- }, function() {
24346
- return onFilteredChange && onFilteredChange(newFiltering, column, value);
24032
+ } else if (additive) {
24033
+ newSorted.push({
24034
+ id: column.id,
24035
+ desc: firstSortDirection
24347
24036
  });
24348
- }, "filterColumn")
24349
- }, {
24350
- key: "resizeColumnStart",
24351
- value: /* @__PURE__ */ __name(function resizeColumnStart(event, column, isTouch) {
24352
- var _this5 = this;
24353
- event.stopPropagation();
24354
- var parentWidth = event.target.parentElement.getBoundingClientRect().width;
24355
- var pageX = void 0;
24356
- if (isTouch) {
24357
- pageX = event.changedTouches[0].pageX;
24358
- } else {
24359
- pageX = event.pageX;
24360
- }
24361
- this.trapEvents = true;
24362
- this.setStateWithData({
24363
- currentlyResizing: {
24037
+ } else {
24038
+ newSorted = [
24039
+ {
24364
24040
  id: column.id,
24365
- startX: pageX,
24366
- parentWidth
24041
+ desc: firstSortDirection
24367
24042
  }
24368
- }, function() {
24369
- if (isTouch) {
24370
- document.addEventListener("touchmove", _this5.resizeColumnMoving);
24371
- document.addEventListener("touchcancel", _this5.resizeColumnEnd);
24372
- document.addEventListener("touchend", _this5.resizeColumnEnd);
24043
+ ];
24044
+ }
24045
+ } else {
24046
+ const existingIndex = newSorted.findIndex((d2) => d2.id === column[0].id);
24047
+ if (existingIndex > -1) {
24048
+ const existing = newSorted[existingIndex];
24049
+ if (existing.desc === secondSortDirection) {
24050
+ if (additive) {
24051
+ newSorted.splice(existingIndex, column.length);
24373
24052
  } else {
24374
- document.addEventListener("mousemove", _this5.resizeColumnMoving);
24375
- document.addEventListener("mouseup", _this5.resizeColumnEnd);
24376
- document.addEventListener("mouseleave", _this5.resizeColumnEnd);
24053
+ column.forEach((d2, i) => {
24054
+ newSorted[existingIndex + i].desc = firstSortDirection;
24055
+ });
24377
24056
  }
24378
- });
24379
- }, "resizeColumnStart")
24380
- }, {
24381
- key: "resizeColumnMoving",
24382
- value: /* @__PURE__ */ __name(function resizeColumnMoving(event) {
24383
- event.stopPropagation();
24384
- var onResizedChange = this.props.onResizedChange;
24385
- var _getResolvedState4 = this.getResolvedState(), resized = _getResolvedState4.resized, currentlyResizing = _getResolvedState4.currentlyResizing;
24386
- var newResized = resized.filter(function(x2) {
24387
- return x2.id !== currentlyResizing.id;
24388
- });
24389
- var pageX = void 0;
24390
- if (event.type === "touchmove") {
24391
- pageX = event.changedTouches[0].pageX;
24392
- } else if (event.type === "mousemove") {
24393
- pageX = event.pageX;
24394
- }
24395
- var newWidth = Math.max(currentlyResizing.parentWidth + pageX - currentlyResizing.startX, 11);
24396
- newResized.push({
24397
- id: currentlyResizing.id,
24398
- value: newWidth
24399
- });
24400
- this.setStateWithData({
24401
- resized: newResized
24402
- }, function() {
24403
- return onResizedChange && onResizedChange(newResized, event);
24404
- });
24405
- }, "resizeColumnMoving")
24406
- }, {
24407
- key: "resizeColumnEnd",
24408
- value: /* @__PURE__ */ __name(function resizeColumnEnd(event) {
24409
- event.stopPropagation();
24410
- var isTouch = event.type === "touchend" || event.type === "touchcancel";
24411
- if (isTouch) {
24412
- document.removeEventListener("touchmove", this.resizeColumnMoving);
24413
- document.removeEventListener("touchcancel", this.resizeColumnEnd);
24414
- document.removeEventListener("touchend", this.resizeColumnEnd);
24415
- }
24416
- document.removeEventListener("mousemove", this.resizeColumnMoving);
24417
- document.removeEventListener("mouseup", this.resizeColumnEnd);
24418
- document.removeEventListener("mouseleave", this.resizeColumnEnd);
24419
- if (!isTouch) {
24420
- this.setStateWithData({
24421
- skipNextSort: true,
24422
- currentlyResizing: false
24057
+ } else {
24058
+ column.forEach((d2, i) => {
24059
+ newSorted[existingIndex + i].desc = secondSortDirection;
24423
24060
  });
24424
24061
  }
24425
- }, "resizeColumnEnd")
24426
- }]);
24427
- return _class;
24428
- }(Base);
24429
- }, "Methods");
24430
- var _createClass$a = function() {
24431
- function defineProperties2(target, props) {
24432
- for (var i = 0; i < props.length; i++) {
24433
- var descriptor2 = props[i];
24434
- descriptor2.enumerable = descriptor2.enumerable || false;
24435
- descriptor2.configurable = true;
24436
- if ("value" in descriptor2)
24437
- descriptor2.writable = true;
24438
- Object.defineProperty(target, descriptor2.key, descriptor2);
24062
+ if (!additive) {
24063
+ newSorted = newSorted.slice(existingIndex, column.length);
24064
+ }
24065
+ } else if (additive) {
24066
+ newSorted = newSorted.concat(
24067
+ column.map((d2) => ({
24068
+ id: d2.id,
24069
+ desc: firstSortDirection
24070
+ }))
24071
+ );
24072
+ } else {
24073
+ newSorted = column.map((d2) => ({
24074
+ id: d2.id,
24075
+ desc: firstSortDirection
24076
+ }));
24077
+ }
24439
24078
  }
24079
+ this.setStateWithData(
24080
+ {
24081
+ page: !sorted.length && newSorted.length || !additive ? 0 : this.state.page,
24082
+ sorted: newSorted
24083
+ },
24084
+ () => onSortedChange && onSortedChange(newSorted, column, additive)
24085
+ );
24440
24086
  }
24441
- __name(defineProperties2, "defineProperties");
24442
- return function(Constructor, protoProps, staticProps) {
24443
- if (protoProps)
24444
- defineProperties2(Constructor.prototype, protoProps);
24445
- if (staticProps)
24446
- defineProperties2(Constructor, staticProps);
24447
- return Constructor;
24448
- };
24449
- }();
24450
- var _extends$k = Object.assign || function(target) {
24451
- for (var i = 1; i < arguments.length; i++) {
24452
- var source = arguments[i];
24453
- for (var key in source) {
24454
- if (Object.prototype.hasOwnProperty.call(source, key)) {
24455
- target[key] = source[key];
24456
- }
24087
+ filterColumn(column, value) {
24088
+ const { filtered } = this.getResolvedState();
24089
+ const { onFilteredChange } = this.props;
24090
+ const newFiltering = (filtered || []).filter((x2) => x2.id !== column.id);
24091
+ if (value !== "") {
24092
+ newFiltering.push({
24093
+ id: column.id,
24094
+ value
24095
+ });
24457
24096
  }
24097
+ this.setStateWithData(
24098
+ {
24099
+ filtered: newFiltering
24100
+ },
24101
+ () => onFilteredChange && onFilteredChange(newFiltering, column, value)
24102
+ );
24458
24103
  }
24459
- return target;
24460
- };
24461
- function _classCallCheck$f(instance, Constructor) {
24462
- if (!(instance instanceof Constructor)) {
24463
- throw new TypeError("Cannot call a class as a function");
24104
+ resizeColumnStart(event, column, isTouch) {
24105
+ event.stopPropagation();
24106
+ const parentWidth = event.target.parentElement.getBoundingClientRect().width;
24107
+ let pageX;
24108
+ if (isTouch) {
24109
+ pageX = event.changedTouches[0].pageX;
24110
+ } else {
24111
+ pageX = event.pageX;
24112
+ }
24113
+ this.trapEvents = true;
24114
+ this.setStateWithData(
24115
+ {
24116
+ currentlyResizing: {
24117
+ id: column.id,
24118
+ startX: pageX,
24119
+ parentWidth
24120
+ }
24121
+ },
24122
+ () => {
24123
+ if (isTouch) {
24124
+ document.addEventListener("touchmove", this.resizeColumnMoving);
24125
+ document.addEventListener("touchcancel", this.resizeColumnEnd);
24126
+ document.addEventListener("touchend", this.resizeColumnEnd);
24127
+ } else {
24128
+ document.addEventListener("mousemove", this.resizeColumnMoving);
24129
+ document.addEventListener("mouseup", this.resizeColumnEnd);
24130
+ document.addEventListener("mouseleave", this.resizeColumnEnd);
24131
+ }
24132
+ }
24133
+ );
24464
24134
  }
24465
- }
24466
- __name(_classCallCheck$f, "_classCallCheck$f");
24467
- function _possibleConstructorReturn$f(self2, call2) {
24468
- if (!self2) {
24469
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
24135
+ resizeColumnMoving(event) {
24136
+ event.stopPropagation();
24137
+ const { onResizedChange } = this.props;
24138
+ const { resized, currentlyResizing } = this.getResolvedState();
24139
+ const newResized = resized.filter((x2) => x2.id !== currentlyResizing.id);
24140
+ let pageX;
24141
+ if (event.type === "touchmove") {
24142
+ pageX = event.changedTouches[0].pageX;
24143
+ } else if (event.type === "mousemove") {
24144
+ pageX = event.pageX;
24145
+ }
24146
+ const newWidth = Math.max(
24147
+ currentlyResizing.parentWidth + pageX - currentlyResizing.startX,
24148
+ 11
24149
+ );
24150
+ newResized.push({
24151
+ id: currentlyResizing.id,
24152
+ value: newWidth
24153
+ });
24154
+ this.setStateWithData(
24155
+ {
24156
+ resized: newResized
24157
+ },
24158
+ () => onResizedChange && onResizedChange(newResized, event)
24159
+ );
24470
24160
  }
24471
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
24472
- }
24473
- __name(_possibleConstructorReturn$f, "_possibleConstructorReturn$f");
24474
- function _inherits$f(subClass, superClass) {
24475
- if (typeof superClass !== "function" && superClass !== null) {
24476
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
24161
+ resizeColumnEnd(event) {
24162
+ event.stopPropagation();
24163
+ const isTouch = event.type === "touchend" || event.type === "touchcancel";
24164
+ if (isTouch) {
24165
+ document.removeEventListener("touchmove", this.resizeColumnMoving);
24166
+ document.removeEventListener("touchcancel", this.resizeColumnEnd);
24167
+ document.removeEventListener("touchend", this.resizeColumnEnd);
24168
+ }
24169
+ document.removeEventListener("mousemove", this.resizeColumnMoving);
24170
+ document.removeEventListener("mouseup", this.resizeColumnEnd);
24171
+ document.removeEventListener("mouseleave", this.resizeColumnEnd);
24172
+ if (!isTouch) {
24173
+ this.setStateWithData({
24174
+ skipNextSort: true,
24175
+ currentlyResizing: false
24176
+ });
24177
+ }
24477
24178
  }
24478
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
24479
- if (superClass)
24480
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
24481
- }
24482
- __name(_inherits$f, "_inherits$f");
24483
- var defaultButton = /* @__PURE__ */ __name(function defaultButton2(props) {
24484
- return React__default.createElement(
24485
- "button",
24486
- _extends$k({ type: "button" }, props, { className: "-btn" }),
24487
- props.children
24488
- );
24489
- }, "defaultButton");
24490
- var ReactTablePagination = function(_Component) {
24491
- _inherits$f(ReactTablePagination2, _Component);
24492
- function ReactTablePagination2(props) {
24493
- _classCallCheck$f(this, ReactTablePagination2);
24494
- var _this = _possibleConstructorReturn$f(this, (ReactTablePagination2.__proto__ || Object.getPrototypeOf(ReactTablePagination2)).call(this, props));
24495
- _this.getSafePage = _this.getSafePage.bind(_this);
24496
- _this.changePage = _this.changePage.bind(_this);
24497
- _this.applyPage = _this.applyPage.bind(_this);
24498
- _this.state = {
24179
+ }, "Methods");
24180
+ const defaultButton = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React__default.createElement("button", __spreadProps(__spreadValues({ type: "button" }, props), { className: "-btn" }), props.children), "defaultButton");
24181
+ const _ReactTablePagination = class _ReactTablePagination extends Component {
24182
+ constructor(props) {
24183
+ super(props);
24184
+ this.getSafePage = this.getSafePage.bind(this);
24185
+ this.changePage = this.changePage.bind(this);
24186
+ this.applyPage = this.applyPage.bind(this);
24187
+ this.state = {
24499
24188
  page: props.page
24500
24189
  };
24501
- return _this;
24502
24190
  }
24503
- __name(ReactTablePagination2, "ReactTablePagination");
24504
- _createClass$a(ReactTablePagination2, [{
24505
- key: "UNSAFE_componentWillReceiveProps",
24506
- value: /* @__PURE__ */ __name(function UNSAFE_componentWillReceiveProps(nextProps) {
24507
- if (this.props.page !== nextProps.page) {
24508
- this.setState({ page: nextProps.page });
24509
- }
24510
- }, "UNSAFE_componentWillReceiveProps")
24511
- }, {
24512
- key: "getSafePage",
24513
- value: /* @__PURE__ */ __name(function getSafePage(page) {
24514
- if (Number.isNaN(page)) {
24515
- page = this.props.page;
24516
- }
24517
- return Math.min(Math.max(page, 0), this.props.pages - 1);
24518
- }, "getSafePage")
24519
- }, {
24520
- key: "changePage",
24521
- value: /* @__PURE__ */ __name(function changePage(page) {
24522
- page = this.getSafePage(page);
24523
- this.setState({ page });
24524
- if (this.props.page !== page) {
24525
- this.props.onPageChange(page);
24526
- }
24527
- }, "changePage")
24528
- }, {
24529
- key: "applyPage",
24530
- value: /* @__PURE__ */ __name(function applyPage(e2) {
24531
- if (e2) {
24532
- e2.preventDefault();
24533
- }
24534
- var page = this.state.page;
24535
- this.changePage(page === "" ? this.props.page : page);
24536
- }, "applyPage")
24537
- }, {
24538
- key: "getPageJumpProperties",
24539
- value: /* @__PURE__ */ __name(function getPageJumpProperties() {
24540
- var _this2 = this;
24541
- return {
24542
- onKeyPress: /* @__PURE__ */ __name(function onKeyPress(e2) {
24543
- if (e2.which === 13 || e2.keyCode === 13) {
24544
- _this2.applyPage();
24545
- }
24546
- }, "onKeyPress"),
24547
- onBlur: this.applyPage,
24548
- value: this.state.page === "" ? "" : this.state.page + 1,
24549
- onChange: /* @__PURE__ */ __name(function onChange(e2) {
24550
- var val = e2.target.value;
24551
- var page = val - 1;
24552
- if (val === "") {
24553
- return _this2.setState({ page: val });
24554
- }
24555
- _this2.setState({ page: _this2.getSafePage(page) });
24556
- }, "onChange"),
24557
- inputType: this.state.page === "" ? "text" : "number",
24558
- pageJumpText: this.props.pageJumpText
24559
- };
24560
- }, "getPageJumpProperties")
24561
- }, {
24562
- key: "render",
24563
- value: /* @__PURE__ */ __name(function render3() {
24564
- var _this3 = this;
24565
- 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;
24566
- return React__default.createElement(
24567
- "div",
24568
- { className: classNames(className, "-pagination"), style: this.props.style },
24569
- React__default.createElement(
24570
- "div",
24571
- { className: "-previous" },
24572
- React__default.createElement(
24573
- PreviousComponent,
24574
- {
24575
- onClick: /* @__PURE__ */ __name(function onClick() {
24576
- if (!canPrevious)
24577
- return;
24578
- _this3.changePage(page - 1);
24579
- }, "onClick"),
24580
- disabled: !canPrevious
24581
- },
24582
- this.props.previousText
24583
- )
24584
- ),
24585
- React__default.createElement(
24586
- "div",
24587
- { className: "-center" },
24588
- React__default.createElement(
24589
- "span",
24590
- { className: "-pageInfo" },
24591
- this.props.pageText,
24592
- " ",
24593
- showPageJump ? renderPageJump2(this.getPageJumpProperties()) : renderCurrentPage2(page),
24594
- " ",
24595
- this.props.ofText,
24596
- " ",
24597
- renderTotalPagesCount2(pages)
24598
- ),
24599
- showPageSizeOptions && renderPageSizeOptions2({
24600
- pageSize,
24601
- rowsSelectorText: this.props.rowsSelectorText,
24602
- pageSizeOptions,
24603
- onPageSizeChange,
24604
- rowsText: this.props.rowsText
24605
- })
24606
- ),
24607
- React__default.createElement(
24608
- "div",
24609
- { className: "-next" },
24610
- React__default.createElement(
24611
- NextComponent,
24612
- {
24613
- onClick: /* @__PURE__ */ __name(function onClick() {
24614
- if (!canNext)
24615
- return;
24616
- _this3.changePage(page + 1);
24617
- }, "onClick"),
24618
- disabled: !canNext
24619
- },
24620
- this.props.nextText
24621
- )
24622
- )
24623
- );
24624
- }, "render")
24625
- }]);
24626
- return ReactTablePagination2;
24627
- }(Component);
24628
- ReactTablePagination.defaultProps = {
24629
- PreviousComponent: defaultButton,
24630
- NextComponent: defaultButton,
24631
- renderPageJump: /* @__PURE__ */ __name(function renderPageJump(_ref) {
24632
- var onChange = _ref.onChange, value = _ref.value, onBlur = _ref.onBlur, onKeyPress = _ref.onKeyPress, inputType = _ref.inputType, pageJumpText = _ref.pageJumpText;
24633
- return React__default.createElement(
24634
- "div",
24635
- { className: "-pageJump" },
24636
- React__default.createElement("input", {
24637
- "aria-label": pageJumpText,
24638
- type: inputType,
24639
- onChange,
24640
- value,
24641
- onBlur,
24642
- onKeyPress
24643
- })
24644
- );
24645
- }, "renderPageJump"),
24646
- renderCurrentPage: /* @__PURE__ */ __name(function renderCurrentPage(page) {
24647
- return React__default.createElement(
24648
- "span",
24649
- { className: "-currentPage" },
24650
- page + 1
24651
- );
24652
- }, "renderCurrentPage"),
24653
- renderTotalPagesCount: /* @__PURE__ */ __name(function renderTotalPagesCount(pages) {
24654
- return React__default.createElement(
24655
- "span",
24656
- { className: "-totalPages" },
24657
- pages || 1
24658
- );
24659
- }, "renderTotalPagesCount"),
24660
- renderPageSizeOptions: /* @__PURE__ */ __name(function renderPageSizeOptions(_ref2) {
24661
- var pageSize = _ref2.pageSize, pageSizeOptions = _ref2.pageSizeOptions, rowsSelectorText = _ref2.rowsSelectorText, onPageSizeChange = _ref2.onPageSizeChange, rowsText = _ref2.rowsText;
24662
- return React__default.createElement(
24663
- "span",
24664
- { className: "select-wrap -pageSizeOptions" },
24665
- React__default.createElement(
24666
- "select",
24667
- {
24668
- "aria-label": rowsSelectorText,
24669
- onChange: /* @__PURE__ */ __name(function onChange(e2) {
24670
- return onPageSizeChange(Number(e2.target.value));
24671
- }, "onChange"),
24672
- value: pageSize
24673
- },
24674
- pageSizeOptions.map(function(option, i) {
24675
- return (
24676
- // eslint-disable-next-line react/no-array-index-key
24677
- React__default.createElement(
24678
- "option",
24679
- { key: i, value: option },
24680
- option + " " + rowsText
24681
- )
24682
- );
24683
- })
24684
- )
24685
- );
24686
- }, "renderPageSizeOptions")
24687
- };
24688
- var _extends$j = Object.assign || function(target) {
24689
- for (var i = 1; i < arguments.length; i++) {
24690
- var source = arguments[i];
24691
- for (var key in source) {
24692
- if (Object.prototype.hasOwnProperty.call(source, key)) {
24693
- target[key] = source[key];
24694
- }
24191
+ UNSAFE_componentWillReceiveProps(nextProps) {
24192
+ if (this.props.page !== nextProps.page) {
24193
+ this.setState({ page: nextProps.page });
24695
24194
  }
24696
24195
  }
24697
- return target;
24698
- };
24699
- function _objectWithoutProperties$5(obj, keys3) {
24700
- var target = {};
24701
- for (var i in obj) {
24702
- if (keys3.indexOf(i) >= 0)
24703
- continue;
24704
- if (!Object.prototype.hasOwnProperty.call(obj, i))
24705
- continue;
24706
- target[i] = obj[i];
24196
+ getSafePage(page) {
24197
+ if (Number.isNaN(page)) {
24198
+ page = this.props.page;
24199
+ }
24200
+ return Math.min(Math.max(page, 0), this.props.pages - 1);
24707
24201
  }
24708
- return target;
24709
- }
24710
- __name(_objectWithoutProperties$5, "_objectWithoutProperties$5");
24711
- var emptyObj = /* @__PURE__ */ __name(function emptyObj2() {
24712
- return {};
24713
- }, "emptyObj");
24202
+ changePage(page) {
24203
+ page = this.getSafePage(page);
24204
+ this.setState({ page });
24205
+ if (this.props.page !== page) {
24206
+ this.props.onPageChange(page);
24207
+ }
24208
+ }
24209
+ applyPage(e2) {
24210
+ if (e2) {
24211
+ e2.preventDefault();
24212
+ }
24213
+ const page = this.state.page;
24214
+ this.changePage(page === "" ? this.props.page : page);
24215
+ }
24216
+ getPageJumpProperties() {
24217
+ return {
24218
+ onKeyPress: (e2) => {
24219
+ if (e2.which === 13 || e2.keyCode === 13) {
24220
+ this.applyPage();
24221
+ }
24222
+ },
24223
+ onBlur: this.applyPage,
24224
+ value: this.state.page === "" ? "" : this.state.page + 1,
24225
+ onChange: (e2) => {
24226
+ const val = e2.target.value;
24227
+ const page = val - 1;
24228
+ if (val === "") {
24229
+ return this.setState({ page: val });
24230
+ }
24231
+ this.setState({ page: this.getSafePage(page) });
24232
+ },
24233
+ inputType: this.state.page === "" ? "text" : "number",
24234
+ pageJumpText: this.props.pageJumpText
24235
+ };
24236
+ }
24237
+ render() {
24238
+ const {
24239
+ // Computed
24240
+ pages,
24241
+ // Props
24242
+ page,
24243
+ showPageSizeOptions,
24244
+ pageSizeOptions,
24245
+ pageSize,
24246
+ showPageJump,
24247
+ canPrevious,
24248
+ canNext,
24249
+ onPageSizeChange,
24250
+ className,
24251
+ PreviousComponent,
24252
+ NextComponent,
24253
+ renderPageJump,
24254
+ renderCurrentPage,
24255
+ renderTotalPagesCount,
24256
+ renderPageSizeOptions
24257
+ } = this.props;
24258
+ return /* @__PURE__ */ React__default.createElement("div", { className: classNames(className, "-pagination"), style: this.props.style }, /* @__PURE__ */ React__default.createElement("div", { className: "-previous" }, /* @__PURE__ */ React__default.createElement(
24259
+ PreviousComponent,
24260
+ {
24261
+ onClick: () => {
24262
+ if (!canPrevious)
24263
+ return;
24264
+ this.changePage(page - 1);
24265
+ },
24266
+ disabled: !canPrevious
24267
+ },
24268
+ this.props.previousText
24269
+ )), /* @__PURE__ */ React__default.createElement("div", { className: "-center" }, /* @__PURE__ */ React__default.createElement("span", { className: "-pageInfo" }, this.props.pageText, " ", showPageJump ? renderPageJump(this.getPageJumpProperties()) : renderCurrentPage(page), " ", this.props.ofText, " ", renderTotalPagesCount(pages)), showPageSizeOptions && renderPageSizeOptions({
24270
+ pageSize,
24271
+ rowsSelectorText: this.props.rowsSelectorText,
24272
+ pageSizeOptions,
24273
+ onPageSizeChange,
24274
+ rowsText: this.props.rowsText
24275
+ })), /* @__PURE__ */ React__default.createElement("div", { className: "-next" }, /* @__PURE__ */ React__default.createElement(
24276
+ NextComponent,
24277
+ {
24278
+ onClick: () => {
24279
+ if (!canNext)
24280
+ return;
24281
+ this.changePage(page + 1);
24282
+ },
24283
+ disabled: !canNext
24284
+ },
24285
+ this.props.nextText
24286
+ )));
24287
+ }
24288
+ };
24289
+ __name(_ReactTablePagination, "ReactTablePagination");
24290
+ __publicField(_ReactTablePagination, "defaultProps", {
24291
+ PreviousComponent: defaultButton,
24292
+ NextComponent: defaultButton,
24293
+ renderPageJump: ({
24294
+ onChange,
24295
+ value,
24296
+ onBlur,
24297
+ onKeyPress,
24298
+ inputType,
24299
+ pageJumpText
24300
+ }) => /* @__PURE__ */ React__default.createElement("div", { className: "-pageJump" }, /* @__PURE__ */ React__default.createElement(
24301
+ "input",
24302
+ {
24303
+ "aria-label": pageJumpText,
24304
+ type: inputType,
24305
+ onChange,
24306
+ value,
24307
+ onBlur,
24308
+ onKeyPress
24309
+ }
24310
+ )),
24311
+ renderCurrentPage: (page) => /* @__PURE__ */ React__default.createElement("span", { className: "-currentPage" }, page + 1),
24312
+ renderTotalPagesCount: (pages) => /* @__PURE__ */ React__default.createElement("span", { className: "-totalPages" }, pages || 1),
24313
+ renderPageSizeOptions: ({
24314
+ pageSize,
24315
+ pageSizeOptions,
24316
+ rowsSelectorText,
24317
+ onPageSizeChange,
24318
+ rowsText
24319
+ }) => /* @__PURE__ */ React__default.createElement("span", { className: "select-wrap -pageSizeOptions" }, /* @__PURE__ */ React__default.createElement(
24320
+ "select",
24321
+ {
24322
+ "aria-label": rowsSelectorText,
24323
+ onChange: (e2) => onPageSizeChange(Number(e2.target.value)),
24324
+ value: pageSize
24325
+ },
24326
+ pageSizeOptions.map((option, i) => (
24327
+ // eslint-disable-next-line react/no-array-index-key
24328
+ /* @__PURE__ */ React__default.createElement("option", { key: i, value: option }, `${option} ${rowsText}`)
24329
+ ))
24330
+ ))
24331
+ });
24332
+ let ReactTablePagination = _ReactTablePagination;
24333
+ const emptyObj = /* @__PURE__ */ __name(() => ({}), "emptyObj");
24714
24334
  const defaultProps$1 = {
24715
24335
  // General
24716
24336
  data: [],
24717
- resolveData: /* @__PURE__ */ __name(function resolveData(data) {
24718
- return data;
24719
- }, "resolveData"),
24337
+ resolveData: (data) => data,
24720
24338
  loading: false,
24721
24339
  showPagination: true,
24722
24340
  showPaginationTop: false,
@@ -24740,12 +24358,12 @@ const defaultProps$1 = {
24740
24358
  defaultResized: [],
24741
24359
  defaultExpanded: {},
24742
24360
  // eslint-disable-next-line no-unused-vars
24743
- defaultFilterMethod: /* @__PURE__ */ __name(function defaultFilterMethod(filter, row, column) {
24744
- var id2 = filter.pivotId || filter.id;
24361
+ defaultFilterMethod: (filter, row, column) => {
24362
+ const id2 = filter.pivotId || filter.id;
24745
24363
  return row[id2] !== void 0 ? String(row[id2]).startsWith(filter.value) : true;
24746
- }, "defaultFilterMethod"),
24364
+ },
24747
24365
  // eslint-disable-next-line no-unused-vars
24748
- defaultSortMethod: /* @__PURE__ */ __name(function defaultSortMethod(a2, b2, desc) {
24366
+ defaultSortMethod: (a2, b2, desc) => {
24749
24367
  a2 = a2 === null || a2 === void 0 ? "" : a2;
24750
24368
  b2 = b2 === null || b2 === void 0 ? "" : b2;
24751
24369
  a2 = typeof a2 === "string" ? a2.toLowerCase() : a2;
@@ -24757,7 +24375,7 @@ const defaultProps$1 = {
24757
24375
  return -1;
24758
24376
  }
24759
24377
  return 0;
24760
- }, "defaultSortMethod"),
24378
+ },
24761
24379
  // Controlled State Props
24762
24380
  // page: undefined,
24763
24381
  // pageSize: undefined,
@@ -24784,9 +24402,7 @@ const defaultProps$1 = {
24784
24402
  indexKey: "_index",
24785
24403
  groupedByPivotKey: "_groupedByPivot",
24786
24404
  // Server-side Callbacks
24787
- onFetchData: /* @__PURE__ */ __name(function onFetchData() {
24788
- return null;
24789
- }, "onFetchData"),
24405
+ onFetchData: () => null,
24790
24406
  // Classes
24791
24407
  className: "",
24792
24408
  style: {},
@@ -24874,145 +24490,106 @@ const defaultProps$1 = {
24874
24490
  pageJumpText: "jump to page",
24875
24491
  rowsSelectorText: "rows per page",
24876
24492
  // Components
24877
- TableComponent: /* @__PURE__ */ __name(function TableComponent(_ref) {
24878
- var children = _ref.children, className = _ref.className, rest = _objectWithoutProperties$5(_ref, ["children", "className"]);
24879
- return React__default.createElement(
24493
+ TableComponent: (_e) => {
24494
+ var _f = _e, { children, className } = _f, rest = __objRest(_f, ["children", "className"]);
24495
+ return /* @__PURE__ */ React__default.createElement(
24880
24496
  "div",
24881
- _extends$j({
24497
+ __spreadValues({
24882
24498
  className: classNames("rt-table", className),
24883
24499
  role: "grid"
24884
- // tabIndex='0'
24885
24500
  }, rest),
24886
24501
  children
24887
24502
  );
24888
- }, "TableComponent"),
24503
+ },
24889
24504
  TheadComponent: _.makeTemplateComponent("rt-thead", "Thead"),
24890
24505
  TbodyComponent: _.makeTemplateComponent("rt-tbody", "Tbody"),
24891
- TrGroupComponent: /* @__PURE__ */ __name(function TrGroupComponent(_ref2) {
24892
- var children = _ref2.children, className = _ref2.className, rest = _objectWithoutProperties$5(_ref2, ["children", "className"]);
24893
- return React__default.createElement(
24894
- "div",
24895
- _extends$j({ className: classNames("rt-tr-group", className), role: "rowgroup" }, rest),
24896
- children
24897
- );
24898
- }, "TrGroupComponent"),
24899
- TrComponent: /* @__PURE__ */ __name(function TrComponent(_ref3) {
24900
- var children = _ref3.children, className = _ref3.className, rest = _objectWithoutProperties$5(_ref3, ["children", "className"]);
24901
- return React__default.createElement(
24902
- "div",
24903
- _extends$j({ className: classNames("rt-tr", className), role: "row" }, rest),
24506
+ TrGroupComponent: (_g) => {
24507
+ var _h = _g, { children, className } = _h, rest = __objRest(_h, ["children", "className"]);
24508
+ return /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: classNames("rt-tr-group", className), role: "rowgroup" }, rest), children);
24509
+ },
24510
+ TrComponent: (_i) => {
24511
+ var _j = _i, { children, className } = _j, rest = __objRest(_j, ["children", "className"]);
24512
+ return /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: classNames("rt-tr", className), role: "row" }, rest), children);
24513
+ },
24514
+ ThComponent: (_k) => {
24515
+ var _l = _k, {
24516
+ toggleSort,
24517
+ className,
24904
24518
  children
24905
- );
24906
- }, "TrComponent"),
24907
- ThComponent: /* @__PURE__ */ __name(function ThComponent(_ref4) {
24908
- var toggleSort = _ref4.toggleSort, className = _ref4.className, children = _ref4.children, rest = _objectWithoutProperties$5(_ref4, ["toggleSort", "className", "children"]);
24519
+ } = _l, rest = __objRest(_l, [
24520
+ "toggleSort",
24521
+ "className",
24522
+ "children"
24523
+ ]);
24909
24524
  return (
24910
24525
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events
24911
- React__default.createElement(
24526
+ /* @__PURE__ */ React__default.createElement(
24912
24527
  "div",
24913
- _extends$j({
24528
+ __spreadValues({
24914
24529
  className: classNames("rt-th", className),
24915
- onClick: /* @__PURE__ */ __name(function onClick(e2) {
24916
- return toggleSort && toggleSort(e2);
24917
- }, "onClick"),
24530
+ onClick: (e2) => toggleSort && toggleSort(e2),
24918
24531
  role: "columnheader",
24919
24532
  tabIndex: "-1"
24920
- // Resolves eslint issues without implementing keyboard navigation incorrectly
24921
24533
  }, rest),
24922
24534
  children
24923
24535
  )
24924
24536
  );
24925
- }, "ThComponent"),
24926
- TdComponent: /* @__PURE__ */ __name(function TdComponent(_ref5) {
24927
- _ref5.toggleSort;
24928
- var className = _ref5.className, children = _ref5.children, rest = _objectWithoutProperties$5(_ref5, ["toggleSort", "className", "children"]);
24929
- return React__default.createElement(
24930
- "div",
24931
- _extends$j({ className: classNames("rt-td", className), role: "gridcell" }, rest),
24537
+ },
24538
+ TdComponent: (_m) => {
24539
+ var _n = _m, {
24540
+ toggleSort,
24541
+ className,
24932
24542
  children
24933
- );
24934
- }, "TdComponent"),
24543
+ } = _n, rest = __objRest(_n, [
24544
+ "toggleSort",
24545
+ "className",
24546
+ "children"
24547
+ ]);
24548
+ return /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: classNames("rt-td", className), role: "gridcell" }, rest), children);
24549
+ },
24935
24550
  TfootComponent: _.makeTemplateComponent("rt-tfoot", "Tfoot"),
24936
- FilterComponent: /* @__PURE__ */ __name(function FilterComponent(_ref6) {
24937
- var filter = _ref6.filter, _onChange = _ref6.onChange, column = _ref6.column;
24938
- return React__default.createElement("input", {
24551
+ FilterComponent: ({ filter, onChange, column }) => /* @__PURE__ */ React__default.createElement(
24552
+ "input",
24553
+ {
24939
24554
  type: "text",
24940
24555
  style: {
24941
24556
  width: "100%"
24942
24557
  },
24943
24558
  placeholder: column.Placeholder,
24944
24559
  value: filter ? filter.value : "",
24945
- onChange: /* @__PURE__ */ __name(function onChange(event) {
24946
- return _onChange(event.target.value);
24947
- }, "onChange")
24948
- });
24949
- }, "FilterComponent"),
24950
- ExpanderComponent: /* @__PURE__ */ __name(function ExpanderComponent(_ref7) {
24951
- var isExpanded = _ref7.isExpanded;
24952
- return React__default.createElement(
24953
- "div",
24954
- { className: classNames("rt-expander", isExpanded && "-open") },
24955
- ""
24956
- );
24957
- }, "ExpanderComponent"),
24958
- PivotValueComponent: /* @__PURE__ */ __name(function PivotValueComponent(_ref8) {
24959
- var subRows = _ref8.subRows, value = _ref8.value;
24960
- return React__default.createElement(
24961
- "span",
24962
- null,
24963
- value,
24964
- " ",
24965
- subRows && "(" + subRows.length + ")"
24966
- );
24967
- }, "PivotValueComponent"),
24968
- AggregatedComponent: /* @__PURE__ */ __name(function AggregatedComponent(_ref9) {
24969
- var subRows = _ref9.subRows, column = _ref9.column;
24970
- var previewValues = subRows.filter(function(d2) {
24971
- return typeof d2[column.id] !== "undefined";
24972
- }).map(function(row, i) {
24973
- return (
24974
- // eslint-disable-next-line react/no-array-index-key
24975
- React__default.createElement(
24976
- "span",
24977
- { key: i },
24978
- row[column.id],
24979
- i < subRows.length - 1 ? ", " : ""
24980
- )
24981
- );
24982
- });
24983
- return React__default.createElement(
24984
- "span",
24985
- null,
24986
- previewValues
24987
- );
24988
- }, "AggregatedComponent"),
24560
+ onChange: (event) => onChange(event.target.value)
24561
+ }
24562
+ ),
24563
+ ExpanderComponent: ({ isExpanded }) => /* @__PURE__ */ React__default.createElement("div", { className: classNames("rt-expander", isExpanded && "-open") }, "•"),
24564
+ PivotValueComponent: ({ subRows, value }) => /* @__PURE__ */ React__default.createElement("span", null, value, " ", subRows && `(${subRows.length})`),
24565
+ AggregatedComponent: ({ subRows, column }) => {
24566
+ const previewValues = subRows.filter((d2) => typeof d2[column.id] !== "undefined").map((row, i) => (
24567
+ // eslint-disable-next-line react/no-array-index-key
24568
+ /* @__PURE__ */ React__default.createElement("span", { key: i }, row[column.id], i < subRows.length - 1 ? ", " : "")
24569
+ ));
24570
+ return /* @__PURE__ */ React__default.createElement("span", null, previewValues);
24571
+ },
24989
24572
  PivotComponent: void 0,
24990
24573
  // this is a computed default generated using
24991
24574
  // the ExpanderComponent and PivotValueComponent at run-time in methods.js
24992
24575
  PaginationComponent: ReactTablePagination,
24993
24576
  PreviousComponent: void 0,
24994
24577
  NextComponent: void 0,
24995
- LoadingComponent: /* @__PURE__ */ __name(function LoadingComponent(_ref10) {
24996
- var className = _ref10.className, loading = _ref10.loading, loadingText = _ref10.loadingText, rest = _objectWithoutProperties$5(_ref10, ["className", "loading", "loadingText"]);
24997
- return React__default.createElement(
24998
- "div",
24999
- _extends$j({ className: classNames("-loading", { "-active": loading }, className) }, rest),
25000
- React__default.createElement(
25001
- "div",
25002
- { className: "-loading-inner" },
25003
- loadingText
25004
- )
25005
- );
25006
- }, "LoadingComponent"),
24578
+ LoadingComponent: (_o) => {
24579
+ var _p = _o, {
24580
+ className,
24581
+ loading,
24582
+ loadingText
24583
+ } = _p, rest = __objRest(_p, [
24584
+ "className",
24585
+ "loading",
24586
+ "loadingText"
24587
+ ]);
24588
+ return /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: classNames("-loading", { "-active": loading }, className) }, rest), /* @__PURE__ */ React__default.createElement("div", { className: "-loading-inner" }, loadingText));
24589
+ },
25007
24590
  NoDataComponent: _.makeTemplateComponent("rt-noData", "NoData"),
25008
24591
  ResizerComponent: _.makeTemplateComponent("rt-resizer", "Resizer"),
25009
- PadRowComponent: /* @__PURE__ */ __name(function PadRowComponent() {
25010
- return React__default.createElement(
25011
- "span",
25012
- null,
25013
- " "
25014
- );
25015
- }, "PadRowComponent")
24592
+ PadRowComponent: () => /* @__PURE__ */ React__default.createElement("span", null, " ")
25016
24593
  };
25017
24594
  const propTypes = {
25018
24595
  // General
@@ -25086,44 +24663,46 @@ const propTypes = {
25086
24663
  getNoDataProps: PropTypes$1.func,
25087
24664
  getResizerProps: PropTypes$1.func,
25088
24665
  // Global Column Defaults
25089
- columns: PropTypes$1.arrayOf(PropTypes$1.shape({
25090
- // Renderers
25091
- Cell: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25092
- Header: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25093
- Footer: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25094
- Aggregated: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25095
- Pivot: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25096
- PivotValue: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25097
- Expander: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25098
- Filter: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.func]),
25099
- // All Columns
25100
- sortable: PropTypes$1.bool,
25101
- // use table default
25102
- resizable: PropTypes$1.bool,
25103
- // use table default
25104
- filterable: PropTypes$1.bool,
25105
- // use table default
25106
- show: PropTypes$1.bool,
25107
- minWidth: PropTypes$1.number,
25108
- minResizeWidth: PropTypes$1.number,
25109
- // Cells only
25110
- className: PropTypes$1.string,
25111
- style: PropTypes$1.object,
25112
- getProps: PropTypes$1.func,
25113
- // Pivot only
25114
- aggregate: PropTypes$1.func,
25115
- // Headers only
25116
- headerClassName: PropTypes$1.string,
25117
- headerStyle: PropTypes$1.object,
25118
- getHeaderProps: PropTypes$1.func,
25119
- // Footers only
25120
- footerClassName: PropTypes$1.string,
25121
- footerStyle: PropTypes$1.object,
25122
- getFooterProps: PropTypes$1.func,
25123
- filterMethod: PropTypes$1.func,
25124
- filterAll: PropTypes$1.bool,
25125
- sortMethod: PropTypes$1.func
25126
- })),
24666
+ columns: PropTypes$1.arrayOf(
24667
+ PropTypes$1.shape({
24668
+ // Renderers
24669
+ Cell: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24670
+ Header: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24671
+ Footer: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24672
+ Aggregated: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24673
+ Pivot: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24674
+ PivotValue: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24675
+ Expander: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24676
+ Filter: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.func]),
24677
+ // All Columns
24678
+ sortable: PropTypes$1.bool,
24679
+ // use table default
24680
+ resizable: PropTypes$1.bool,
24681
+ // use table default
24682
+ filterable: PropTypes$1.bool,
24683
+ // use table default
24684
+ show: PropTypes$1.bool,
24685
+ minWidth: PropTypes$1.number,
24686
+ minResizeWidth: PropTypes$1.number,
24687
+ // Cells only
24688
+ className: PropTypes$1.string,
24689
+ style: PropTypes$1.object,
24690
+ getProps: PropTypes$1.func,
24691
+ // Pivot only
24692
+ aggregate: PropTypes$1.func,
24693
+ // Headers only
24694
+ headerClassName: PropTypes$1.string,
24695
+ headerStyle: PropTypes$1.object,
24696
+ getHeaderProps: PropTypes$1.func,
24697
+ // Footers only
24698
+ footerClassName: PropTypes$1.string,
24699
+ footerStyle: PropTypes$1.object,
24700
+ getFooterProps: PropTypes$1.func,
24701
+ filterMethod: PropTypes$1.func,
24702
+ filterAll: PropTypes$1.bool,
24703
+ sortMethod: PropTypes$1.func
24704
+ })
24705
+ ),
25127
24706
  // Global Expander Column Defaults
25128
24707
  expanderDefaults: PropTypes$1.shape({
25129
24708
  sortable: PropTypes$1.bool,
@@ -25166,122 +24745,48 @@ const propTypes = {
25166
24745
  ResizerComponent: PropTypes$1.elementType,
25167
24746
  PadRowComponent: PropTypes$1.elementType
25168
24747
  };
25169
- var _slicedToArray$3 = function() {
25170
- function sliceIterator(arr, i) {
25171
- var _arr = [];
25172
- var _n = true;
25173
- var _d = false;
25174
- var _e = void 0;
25175
- try {
25176
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
25177
- _arr.push(_s.value);
25178
- if (i && _arr.length === i)
25179
- break;
25180
- }
25181
- } catch (err) {
25182
- _d = true;
25183
- _e = err;
25184
- } finally {
24748
+ const itemSizeEstimator = /* @__PURE__ */ __name(() => 41.36, "itemSizeEstimator");
24749
+ const ReactTableDefaults = defaultProps$1;
24750
+ const _ReactTable = class _ReactTable extends Methods(Lifecycle(Component)) {
24751
+ constructor(props) {
24752
+ super();
24753
+ this.getResolvedState = this.getResolvedState.bind(this);
24754
+ this.getDataModel = this.getDataModel.bind(this);
24755
+ this.getSortedData = this.getSortedData.bind(this);
24756
+ this.fireFetchData = this.fireFetchData.bind(this);
24757
+ this.getPropOrState = this.getPropOrState.bind(this);
24758
+ this.getStateOrProp = this.getStateOrProp.bind(this);
24759
+ this.filterData = this.filterData.bind(this);
24760
+ this.sortData = this.sortData.bind(this);
24761
+ this.getMinRows = this.getMinRows.bind(this);
24762
+ this.onPageChange = this.onPageChange.bind(this);
24763
+ this.onPageSizeChange = this.onPageSizeChange.bind(this);
24764
+ this.sortColumn = this.sortColumn.bind(this);
24765
+ this.filterColumn = this.filterColumn.bind(this);
24766
+ this.resizeColumnStart = this.resizeColumnStart.bind(this);
24767
+ this.resizeColumnEnd = this.resizeColumnEnd.bind(this);
24768
+ this.resizeColumnMoving = this.resizeColumnMoving.bind(this);
24769
+ setTimeout(() => {
25185
24770
  try {
25186
- if (!_n && _i["return"])
25187
- _i["return"]();
25188
- } finally {
25189
- if (_d)
25190
- throw _e;
25191
- }
25192
- }
25193
- return _arr;
25194
- }
25195
- __name(sliceIterator, "sliceIterator");
25196
- return function(arr, i) {
25197
- if (Array.isArray(arr)) {
25198
- return arr;
25199
- } else if (Symbol.iterator in Object(arr)) {
25200
- return sliceIterator(arr, i);
25201
- } else {
25202
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
25203
- }
25204
- };
25205
- }();
25206
- var _extends$i = Object.assign || function(target) {
25207
- for (var i = 1; i < arguments.length; i++) {
25208
- var source = arguments[i];
25209
- for (var key in source) {
25210
- if (Object.prototype.hasOwnProperty.call(source, key)) {
25211
- target[key] = source[key];
24771
+ const newResized = this.props.defaultResized || [];
24772
+ this.tableRef.querySelectorAll(".tg-react-table-column-header").forEach((th) => {
24773
+ const { width } = th.parentNode.parentNode.getBoundingClientRect();
24774
+ const id2 = th.getAttribute("data-path");
24775
+ if (!newResized.find((x2) => x2.id === id2)) {
24776
+ newResized.push({
24777
+ id: id2,
24778
+ value: width
24779
+ });
24780
+ }
24781
+ });
24782
+ this.setState({
24783
+ resized: newResized
24784
+ });
24785
+ } catch (e2) {
24786
+ console.warn("TNW: Error setting initial table column widths (please contact @tnrich if you see this error. thanks!):", e2);
25212
24787
  }
25213
- }
25214
- }
25215
- return target;
25216
- };
25217
- var _createClass$9 = function() {
25218
- function defineProperties2(target, props) {
25219
- for (var i = 0; i < props.length; i++) {
25220
- var descriptor2 = props[i];
25221
- descriptor2.enumerable = descriptor2.enumerable || false;
25222
- descriptor2.configurable = true;
25223
- if ("value" in descriptor2)
25224
- descriptor2.writable = true;
25225
- Object.defineProperty(target, descriptor2.key, descriptor2);
25226
- }
25227
- }
25228
- __name(defineProperties2, "defineProperties");
25229
- return function(Constructor, protoProps, staticProps) {
25230
- if (protoProps)
25231
- defineProperties2(Constructor.prototype, protoProps);
25232
- if (staticProps)
25233
- defineProperties2(Constructor, staticProps);
25234
- return Constructor;
25235
- };
25236
- }();
25237
- function _classCallCheck$e(instance, Constructor) {
25238
- if (!(instance instanceof Constructor)) {
25239
- throw new TypeError("Cannot call a class as a function");
25240
- }
25241
- }
25242
- __name(_classCallCheck$e, "_classCallCheck$e");
25243
- function _possibleConstructorReturn$e(self2, call2) {
25244
- if (!self2) {
25245
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
25246
- }
25247
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
25248
- }
25249
- __name(_possibleConstructorReturn$e, "_possibleConstructorReturn$e");
25250
- function _inherits$e(subClass, superClass) {
25251
- if (typeof superClass !== "function" && superClass !== null) {
25252
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
25253
- }
25254
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
25255
- if (superClass)
25256
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
25257
- }
25258
- __name(_inherits$e, "_inherits$e");
25259
- var itemSizeEstimator = /* @__PURE__ */ __name(function itemSizeEstimator2() {
25260
- return 41.36;
25261
- }, "itemSizeEstimator");
25262
- var ReactTableDefaults = defaultProps$1;
25263
- var ReactTable = function(_Methods) {
25264
- _inherits$e(ReactTable2, _Methods);
25265
- function ReactTable2(props) {
25266
- _classCallCheck$e(this, ReactTable2);
25267
- var _this = _possibleConstructorReturn$e(this, (ReactTable2.__proto__ || Object.getPrototypeOf(ReactTable2)).call(this));
25268
- _this.getResolvedState = _this.getResolvedState.bind(_this);
25269
- _this.getDataModel = _this.getDataModel.bind(_this);
25270
- _this.getSortedData = _this.getSortedData.bind(_this);
25271
- _this.fireFetchData = _this.fireFetchData.bind(_this);
25272
- _this.getPropOrState = _this.getPropOrState.bind(_this);
25273
- _this.getStateOrProp = _this.getStateOrProp.bind(_this);
25274
- _this.filterData = _this.filterData.bind(_this);
25275
- _this.sortData = _this.sortData.bind(_this);
25276
- _this.getMinRows = _this.getMinRows.bind(_this);
25277
- _this.onPageChange = _this.onPageChange.bind(_this);
25278
- _this.onPageSizeChange = _this.onPageSizeChange.bind(_this);
25279
- _this.sortColumn = _this.sortColumn.bind(_this);
25280
- _this.filterColumn = _this.filterColumn.bind(_this);
25281
- _this.resizeColumnStart = _this.resizeColumnStart.bind(_this);
25282
- _this.resizeColumnEnd = _this.resizeColumnEnd.bind(_this);
25283
- _this.resizeColumnMoving = _this.resizeColumnMoving.bind(_this);
25284
- _this.state = {
24788
+ }, 0);
24789
+ this.state = {
25285
24790
  page: props.defaultPage,
25286
24791
  pageSize: props.defaultPageSize,
25287
24792
  sorted: props.defaultSorted,
@@ -25291,588 +24796,673 @@ var ReactTable = function(_Methods) {
25291
24796
  currentlyResizing: false,
25292
24797
  skipNextSort: false
25293
24798
  };
25294
- return _this;
25295
24799
  }
25296
- __name(ReactTable2, "ReactTable");
25297
- _createClass$9(ReactTable2, [{
25298
- key: "render",
25299
- value: /* @__PURE__ */ __name(function render3() {
25300
- var _this2 = this;
25301
- var resolvedState = this.getResolvedState();
25302
- 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;
25303
- var startRow = pageSize * page;
25304
- var endRow = startRow + pageSize;
25305
- var pageRows = manual ? resolvedData : sortedData.slice(startRow, endRow);
25306
- var minRows = this.getMinRows();
25307
- var padRows = _.range(Math.max(minRows - pageRows.length, 0));
25308
- var hasColumnFooter = allVisibleColumns.some(function(d2) {
25309
- return d2.Footer;
25310
- });
25311
- var hasFilters = filterable || allVisibleColumns.some(function(d2) {
25312
- return d2.filterable;
25313
- });
25314
- var recurseRowsViewIndex = /* @__PURE__ */ __name(function recurseRowsViewIndex2(rows) {
25315
- var path2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
25316
- var index2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
25317
- return [rows.map(function(row, i) {
25318
- index2 += 1;
25319
- var rowWithViewIndex = _extends$i({}, row, {
25320
- _viewIndex: index2
25321
- });
25322
- var newPath = path2.concat([i]);
25323
- if (rowWithViewIndex[subRowsKey] && _.get(expanded, newPath)) {
25324
- var _recurseRowsViewIndex = recurseRowsViewIndex2(rowWithViewIndex[subRowsKey], newPath, index2);
25325
- var _recurseRowsViewIndex2 = _slicedToArray$3(_recurseRowsViewIndex, 2);
25326
- rowWithViewIndex[subRowsKey] = _recurseRowsViewIndex2[0];
25327
- index2 = _recurseRowsViewIndex2[1];
25328
- }
25329
- return rowWithViewIndex;
25330
- }), index2];
25331
- }, "recurseRowsViewIndex");
25332
- var _recurseRowsViewIndex3 = recurseRowsViewIndex(pageRows);
25333
- var _recurseRowsViewIndex4 = _slicedToArray$3(_recurseRowsViewIndex3, 1);
25334
- pageRows = _recurseRowsViewIndex4[0];
25335
- var canPrevious = page > 0;
25336
- var canNext = page + 1 < pages;
25337
- var rowMinWidth = _.sum(allVisibleColumns.map(function(d2) {
25338
- var resizedColumn = resized.find(function(x2) {
25339
- return x2.id === d2.id;
25340
- }) || {};
24800
+ render() {
24801
+ const resolvedState = this.getResolvedState();
24802
+ const {
24803
+ children,
24804
+ className,
24805
+ style: style2,
24806
+ getProps,
24807
+ getTableProps,
24808
+ getTheadGroupProps,
24809
+ getTheadGroupTrProps,
24810
+ getTheadGroupThProps,
24811
+ getTheadProps,
24812
+ getTheadTrProps,
24813
+ getTheadThProps,
24814
+ getTheadFilterProps,
24815
+ getTheadFilterTrProps,
24816
+ getTheadFilterThProps,
24817
+ getTbodyProps,
24818
+ getTrGroupProps,
24819
+ getTrProps,
24820
+ getTdProps,
24821
+ getTfootProps,
24822
+ getTfootTrProps,
24823
+ getTfootTdProps,
24824
+ getPaginationProps,
24825
+ getLoadingProps,
24826
+ getNoDataProps,
24827
+ getResizerProps,
24828
+ showPagination,
24829
+ showPaginationTop,
24830
+ showPaginationBottom,
24831
+ manual,
24832
+ loadingText,
24833
+ noDataText,
24834
+ sortable,
24835
+ multiSort,
24836
+ resizable,
24837
+ filterable,
24838
+ // Pivoting State
24839
+ pivotIDKey,
24840
+ pivotValKey,
24841
+ pivotBy,
24842
+ subRowsKey,
24843
+ aggregatedKey,
24844
+ originalKey,
24845
+ indexKey,
24846
+ groupedByPivotKey,
24847
+ // State
24848
+ loading,
24849
+ pageSize,
24850
+ page,
24851
+ sorted,
24852
+ filtered,
24853
+ resized,
24854
+ expanded,
24855
+ pages,
24856
+ onExpandedChange,
24857
+ // Components
24858
+ TableComponent,
24859
+ TheadComponent,
24860
+ TbodyComponent,
24861
+ additionalBodyEl,
24862
+ TrGroupComponent,
24863
+ TrComponent,
24864
+ ThComponent,
24865
+ TdComponent,
24866
+ TfootComponent,
24867
+ PaginationComponent,
24868
+ LoadingComponent: LoadingComponent2,
24869
+ SubComponent,
24870
+ NoDataComponent,
24871
+ ResizerComponent,
24872
+ ExpanderComponent,
24873
+ PivotValueComponent,
24874
+ PivotComponent,
24875
+ AggregatedComponent,
24876
+ FilterComponent,
24877
+ PadRowComponent,
24878
+ // Data model
24879
+ resolvedData,
24880
+ allVisibleColumns,
24881
+ headerGroups,
24882
+ hasHeaderGroups,
24883
+ // Sorted Data
24884
+ sortedData,
24885
+ currentlyResizing
24886
+ } = resolvedState;
24887
+ const startRow = pageSize * page;
24888
+ const endRow = startRow + pageSize;
24889
+ let pageRows = manual ? resolvedData : sortedData.slice(startRow, endRow);
24890
+ const minRows = this.getMinRows();
24891
+ const padRows = _.range(Math.max(minRows - pageRows.length, 0));
24892
+ const hasColumnFooter = allVisibleColumns.some((d2) => d2.Footer);
24893
+ const hasFilters = filterable || allVisibleColumns.some((d2) => d2.filterable);
24894
+ const recurseRowsViewIndex = /* @__PURE__ */ __name((rows, path2 = [], index2 = -1) => [
24895
+ rows.map((row, i) => {
24896
+ index2 += 1;
24897
+ const rowWithViewIndex = __spreadProps(__spreadValues({}, row), {
24898
+ _viewIndex: index2
24899
+ });
24900
+ const newPath = path2.concat([i]);
24901
+ if (rowWithViewIndex[subRowsKey] && _.get(expanded, newPath)) {
24902
+ [rowWithViewIndex[subRowsKey], index2] = recurseRowsViewIndex(
24903
+ rowWithViewIndex[subRowsKey],
24904
+ newPath,
24905
+ index2
24906
+ );
24907
+ }
24908
+ return rowWithViewIndex;
24909
+ }),
24910
+ index2
24911
+ ], "recurseRowsViewIndex");
24912
+ [pageRows] = recurseRowsViewIndex(pageRows);
24913
+ const canPrevious = page > 0;
24914
+ const canNext = page + 1 < pages;
24915
+ const rowMinWidth = _.sum(
24916
+ allVisibleColumns.map((d2) => {
24917
+ const resizedColumn = resized.find((x2) => x2.id === d2.id) || {};
25341
24918
  return _.getFirstDefined(resizedColumn.value, d2.width, d2.minWidth);
25342
- }));
25343
- var rowIndex = -1;
25344
- var finalState = _extends$i({}, resolvedState, {
25345
- startRow,
25346
- endRow,
25347
- pageRows,
25348
- minRows,
25349
- padRows,
25350
- hasColumnFooter,
25351
- canPrevious,
25352
- canNext,
25353
- rowMinWidth
25354
- });
25355
- var rootProps = _.splitProps(getProps(finalState, void 0, void 0, this));
25356
- var tableProps = _.splitProps(getTableProps(finalState, void 0, void 0, this));
25357
- var tBodyProps = _.splitProps(getTbodyProps(finalState, void 0, void 0, this));
25358
- var loadingProps = getLoadingProps(finalState, void 0, void 0, this);
25359
- var noDataProps = getNoDataProps(finalState, void 0, void 0, this);
25360
- var makeHeaderGroup = /* @__PURE__ */ __name(function makeHeaderGroup2(column, i) {
25361
- var resizedValue = /* @__PURE__ */ __name(function resizedValue2(col) {
25362
- return (resized.find(function(x2) {
25363
- return x2.id === col.id;
25364
- }) || {}).value;
25365
- }, "resizedValue");
25366
- var flex2 = _.sum(column.columns.map(function(col) {
25367
- return col.width || resizedValue(col) ? 0 : col.minWidth;
25368
- }));
25369
- var width = _.sum(column.columns.map(function(col) {
25370
- return _.getFirstDefined(resizedValue(col), col.width, col.minWidth);
25371
- }));
25372
- var maxWidth = _.sum(column.columns.map(function(col) {
25373
- return _.getFirstDefined(resizedValue(col), col.width, col.maxWidth);
25374
- }));
25375
- var theadGroupThProps = _.splitProps(getTheadGroupThProps(finalState, void 0, column, _this2));
25376
- var columnHeaderProps = _.splitProps(column.getHeaderProps(finalState, void 0, column, _this2));
25377
- var classes = [column.headerClassName, theadGroupThProps.className, columnHeaderProps.className];
25378
- var styles2 = _extends$i({}, column.headerStyle, theadGroupThProps.style, columnHeaderProps.style);
25379
- var rest = _extends$i({}, theadGroupThProps.rest, columnHeaderProps.rest);
25380
- var flexStyles = {
25381
- flex: flex2 + " 0 auto",
25382
- width: _.asPx(width),
25383
- maxWidth: _.asPx(maxWidth)
25384
- };
25385
- return React__default.createElement(
25386
- ThComponent2,
25387
- _extends$i({
25388
- key: i + "-" + column.id,
25389
- className: classNames(classes),
25390
- style: _extends$i({}, styles2, flexStyles)
25391
- }, rest),
25392
- _.normalizeComponent(column.Header, {
25393
- data: sortedData,
25394
- column
24919
+ })
24920
+ );
24921
+ let rowIndex = -1;
24922
+ const finalState = __spreadProps(__spreadValues({}, resolvedState), {
24923
+ startRow,
24924
+ endRow,
24925
+ pageRows,
24926
+ minRows,
24927
+ padRows,
24928
+ hasColumnFooter,
24929
+ canPrevious,
24930
+ canNext,
24931
+ rowMinWidth
24932
+ });
24933
+ const rootProps = _.splitProps(getProps(finalState, void 0, void 0, this));
24934
+ const tableProps = _.splitProps(getTableProps(finalState, void 0, void 0, this));
24935
+ const tBodyProps = _.splitProps(getTbodyProps(finalState, void 0, void 0, this));
24936
+ const loadingProps = getLoadingProps(finalState, void 0, void 0, this);
24937
+ const noDataProps = getNoDataProps(finalState, void 0, void 0, this);
24938
+ const makeHeaderGroup = /* @__PURE__ */ __name((column, i) => {
24939
+ const resizedValue = /* @__PURE__ */ __name((col) => (resized.find((x2) => x2.id === col.id) || {}).value, "resizedValue");
24940
+ const flex2 = _.sum(
24941
+ column.columns.map((col) => col.width || resizedValue(col) ? 0 : col.minWidth)
24942
+ );
24943
+ const width = _.sum(
24944
+ column.columns.map((col) => _.getFirstDefined(resizedValue(col), col.width, col.minWidth))
24945
+ );
24946
+ const maxWidth = _.sum(
24947
+ column.columns.map((col) => _.getFirstDefined(resizedValue(col), col.width, col.maxWidth))
24948
+ );
24949
+ const theadGroupThProps = _.splitProps(
24950
+ getTheadGroupThProps(finalState, void 0, column, this)
24951
+ );
24952
+ const columnHeaderProps = _.splitProps(
24953
+ column.getHeaderProps(finalState, void 0, column, this)
24954
+ );
24955
+ const classes = [
24956
+ column.headerClassName,
24957
+ theadGroupThProps.className,
24958
+ columnHeaderProps.className
24959
+ ];
24960
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, column.headerStyle), theadGroupThProps.style), columnHeaderProps.style);
24961
+ const rest = __spreadValues(__spreadValues({}, theadGroupThProps.rest), columnHeaderProps.rest);
24962
+ const flexStyles = {
24963
+ flex: `${flex2} 0 auto`,
24964
+ width: _.asPx(width),
24965
+ maxWidth: _.asPx(maxWidth)
24966
+ };
24967
+ return /* @__PURE__ */ React__default.createElement(
24968
+ ThComponent,
24969
+ __spreadValues({
24970
+ key: `${i}-${column.id}`,
24971
+ className: classNames(classes),
24972
+ style: __spreadValues(__spreadValues({}, styles2), flexStyles)
24973
+ }, rest),
24974
+ _.normalizeComponent(column.Header, {
24975
+ data: sortedData,
24976
+ column
24977
+ })
24978
+ );
24979
+ }, "makeHeaderGroup");
24980
+ const makeHeaderGroups = /* @__PURE__ */ __name(() => {
24981
+ const theadGroupProps = _.splitProps(
24982
+ getTheadGroupProps(finalState, void 0, void 0, this)
24983
+ );
24984
+ const theadGroupTrProps = _.splitProps(
24985
+ getTheadGroupTrProps(finalState, void 0, void 0, this)
24986
+ );
24987
+ return /* @__PURE__ */ React__default.createElement(
24988
+ TheadComponent,
24989
+ __spreadValues({
24990
+ className: classNames("-headerGroups", theadGroupProps.className),
24991
+ style: __spreadProps(__spreadValues({}, theadGroupProps.style), {
24992
+ minWidth: `${rowMinWidth}px`
25395
24993
  })
25396
- );
25397
- }, "makeHeaderGroup");
25398
- var makeHeaderGroups = /* @__PURE__ */ __name(function makeHeaderGroups2() {
25399
- var theadGroupProps = _.splitProps(getTheadGroupProps(finalState, void 0, void 0, _this2));
25400
- var theadGroupTrProps = _.splitProps(getTheadGroupTrProps(finalState, void 0, void 0, _this2));
25401
- return React__default.createElement(
25402
- TheadComponent,
25403
- _extends$i({
25404
- className: classNames("-headerGroups", theadGroupProps.className),
25405
- style: _extends$i({}, theadGroupProps.style, {
25406
- minWidth: rowMinWidth + "px"
25407
- })
25408
- }, theadGroupProps.rest),
25409
- React__default.createElement(
25410
- TrComponent2,
25411
- _extends$i({
25412
- className: theadGroupTrProps.className,
25413
- style: theadGroupTrProps.style
25414
- }, theadGroupTrProps.rest),
25415
- headerGroups.map(makeHeaderGroup)
25416
- )
25417
- );
25418
- }, "makeHeaderGroups");
25419
- var makeHeader = /* @__PURE__ */ __name(function makeHeader2(column, i) {
25420
- var resizedCol = resized.find(function(x2) {
25421
- return x2.id === column.id;
25422
- }) || {};
25423
- var sort2 = sorted.find(function(d2) {
25424
- return d2.id === column.id;
25425
- });
25426
- var show = typeof column.show === "function" ? column.show() : column.show;
25427
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25428
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25429
- var theadThProps = _.splitProps(getTheadThProps(finalState, void 0, column, _this2));
25430
- var columnHeaderProps = _.splitProps(column.getHeaderProps(finalState, void 0, column, _this2));
25431
- var classes = [column.headerClassName, theadThProps.className, columnHeaderProps.className];
25432
- var styles2 = _extends$i({}, column.headerStyle, theadThProps.style, columnHeaderProps.style);
25433
- var rest = _extends$i({}, theadThProps.rest, columnHeaderProps.rest);
25434
- var isResizable = _.getFirstDefined(column.resizable, resizable, false);
25435
- var resizer = isResizable ? React__default.createElement(ResizerComponent, _extends$i({
25436
- onMouseDown: /* @__PURE__ */ __name(function onMouseDown2(e2) {
25437
- return _this2.resizeColumnStart(e2, column, false);
25438
- }, "onMouseDown"),
25439
- onTouchStart: /* @__PURE__ */ __name(function onTouchStart(e2) {
25440
- return _this2.resizeColumnStart(e2, column, true);
25441
- }, "onTouchStart")
25442
- }, getResizerProps("finalState", void 0, column, _this2))) : null;
25443
- var isSortable = _.getFirstDefined(column.sortable, sortable, false);
25444
- return React__default.createElement(
25445
- ThComponent2,
25446
- _extends$i({
25447
- key: i + "-" + column.id,
25448
- 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"),
25449
- style: _extends$i({}, styles2, {
25450
- flex: width + " 0 auto",
25451
- width: _.asPx(width),
25452
- maxWidth: _.asPx(maxWidth)
25453
- }),
25454
- toggleSort: /* @__PURE__ */ __name(function toggleSort(e2) {
25455
- if (isSortable)
25456
- _this2.sortColumn(column, multiSort ? e2.shiftKey : false);
25457
- }, "toggleSort")
25458
- }, rest),
25459
- React__default.createElement(
25460
- "div",
25461
- { className: classNames(isResizable && "rt-resizable-header-content") },
25462
- _.normalizeComponent(column.Header, {
25463
- data: sortedData,
25464
- column
25465
- })
24994
+ }, theadGroupProps.rest),
24995
+ /* @__PURE__ */ React__default.createElement(
24996
+ TrComponent,
24997
+ __spreadValues({
24998
+ className: theadGroupTrProps.className,
24999
+ style: theadGroupTrProps.style
25000
+ }, theadGroupTrProps.rest),
25001
+ headerGroups.map(makeHeaderGroup)
25002
+ )
25003
+ );
25004
+ }, "makeHeaderGroups");
25005
+ const makeHeader = /* @__PURE__ */ __name((column, i) => {
25006
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25007
+ const sort2 = sorted.find((d2) => d2.id === column.id);
25008
+ const show = typeof column.show === "function" ? column.show() : column.show;
25009
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25010
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25011
+ const theadThProps = _.splitProps(getTheadThProps(finalState, void 0, column, this));
25012
+ const columnHeaderProps = _.splitProps(
25013
+ column.getHeaderProps(finalState, void 0, column, this)
25014
+ );
25015
+ const classes = [column.headerClassName, theadThProps.className, columnHeaderProps.className];
25016
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, column.headerStyle), theadThProps.style), columnHeaderProps.style);
25017
+ const rest = __spreadValues(__spreadValues({}, theadThProps.rest), columnHeaderProps.rest);
25018
+ const isResizable = _.getFirstDefined(column.resizable, resizable, false);
25019
+ const resizer = isResizable ? /* @__PURE__ */ React__default.createElement(
25020
+ ResizerComponent,
25021
+ __spreadValues({
25022
+ onMouseDown: (e2) => this.resizeColumnStart(e2, column, false),
25023
+ onTouchStart: (e2) => this.resizeColumnStart(e2, column, true)
25024
+ }, getResizerProps("finalState", void 0, column, this))
25025
+ ) : null;
25026
+ const isSortable = _.getFirstDefined(column.sortable, sortable, false);
25027
+ return /* @__PURE__ */ React__default.createElement(
25028
+ ThComponent,
25029
+ __spreadValues({
25030
+ key: `${i}-${column.id}`,
25031
+ className: classNames(
25032
+ classes,
25033
+ isResizable && "rt-resizable-header",
25034
+ sort2 ? sort2.desc ? "-sort-desc" : "-sort-asc" : "",
25035
+ isSortable && "-cursor-pointer",
25036
+ !show && "-hidden",
25037
+ pivotBy && pivotBy.slice(0, -1).includes(column.id) && "rt-header-pivot"
25466
25038
  ),
25467
- resizer
25468
- );
25469
- }, "makeHeader");
25470
- var makeHeaders = /* @__PURE__ */ __name(function makeHeaders2() {
25471
- var theadProps = _.splitProps(getTheadProps(finalState, void 0, void 0, _this2));
25472
- var theadTrProps = _.splitProps(getTheadTrProps(finalState, void 0, void 0, _this2));
25473
- return React__default.createElement(
25474
- TheadComponent,
25475
- _extends$i({
25476
- className: classNames("-header", theadProps.className),
25477
- style: _extends$i({}, theadProps.style, {
25478
- minWidth: rowMinWidth + "px"
25479
- })
25480
- }, theadProps.rest),
25481
- React__default.createElement(
25482
- TrComponent2,
25483
- _extends$i({
25484
- className: theadTrProps.className,
25485
- style: theadTrProps.style
25486
- }, theadTrProps.rest),
25487
- allVisibleColumns.map(makeHeader)
25488
- )
25489
- );
25490
- }, "makeHeaders");
25491
- var makeFilter = /* @__PURE__ */ __name(function makeFilter2(column, i) {
25492
- var resizedCol = resized.find(function(x2) {
25493
- return x2.id === column.id;
25494
- }) || {};
25495
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25496
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25497
- var theadFilterThProps = _.splitProps(getTheadFilterThProps(finalState, void 0, column, _this2));
25498
- var columnHeaderProps = _.splitProps(column.getHeaderProps(finalState, void 0, column, _this2));
25499
- var classes = [column.headerClassName, theadFilterThProps.className, columnHeaderProps.className];
25500
- var styles2 = _extends$i({}, column.headerStyle, theadFilterThProps.style, columnHeaderProps.style);
25501
- var rest = _extends$i({}, theadFilterThProps.rest, columnHeaderProps.rest);
25502
- var filter = filtered.find(function(filter2) {
25503
- return filter2.id === column.id;
25504
- });
25505
- var ResolvedFilterComponent = column.Filter || FilterComponent2;
25506
- var isFilterable = _.getFirstDefined(column.filterable, filterable, false);
25507
- return React__default.createElement(
25508
- ThComponent2,
25509
- _extends$i({
25510
- key: i + "-" + column.id,
25511
- className: classNames(classes),
25512
- style: _extends$i({}, styles2, {
25513
- flex: width + " 0 auto",
25514
- width: _.asPx(width),
25515
- maxWidth: _.asPx(maxWidth)
25516
- })
25517
- }, rest),
25518
- isFilterable ? _.normalizeComponent(ResolvedFilterComponent, {
25039
+ style: __spreadProps(__spreadValues({}, styles2), {
25040
+ flex: `${width} 0 auto`,
25041
+ width: _.asPx(width),
25042
+ maxWidth: _.asPx(maxWidth)
25043
+ }),
25044
+ toggleSort: (e2) => {
25045
+ if (isSortable)
25046
+ this.sortColumn(column, multiSort ? e2.shiftKey : false);
25047
+ }
25048
+ }, rest),
25049
+ /* @__PURE__ */ React__default.createElement("div", { className: classNames(isResizable && "rt-resizable-header-content") }, _.normalizeComponent(column.Header, {
25050
+ data: sortedData,
25051
+ column
25052
+ })),
25053
+ resizer
25054
+ );
25055
+ }, "makeHeader");
25056
+ const makeHeaders = /* @__PURE__ */ __name(() => {
25057
+ const theadProps = _.splitProps(getTheadProps(finalState, void 0, void 0, this));
25058
+ const theadTrProps = _.splitProps(getTheadTrProps(finalState, void 0, void 0, this));
25059
+ return /* @__PURE__ */ React__default.createElement(
25060
+ TheadComponent,
25061
+ __spreadValues({
25062
+ className: classNames("-header", theadProps.className),
25063
+ style: __spreadProps(__spreadValues({}, theadProps.style), {
25064
+ minWidth: `${rowMinWidth}px`
25065
+ })
25066
+ }, theadProps.rest),
25067
+ /* @__PURE__ */ React__default.createElement(
25068
+ TrComponent,
25069
+ __spreadValues({
25070
+ className: theadTrProps.className,
25071
+ style: theadTrProps.style
25072
+ }, theadTrProps.rest),
25073
+ allVisibleColumns.map(makeHeader)
25074
+ )
25075
+ );
25076
+ }, "makeHeaders");
25077
+ const makeFilter = /* @__PURE__ */ __name((column, i) => {
25078
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25079
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25080
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25081
+ const theadFilterThProps = _.splitProps(
25082
+ getTheadFilterThProps(finalState, void 0, column, this)
25083
+ );
25084
+ const columnHeaderProps = _.splitProps(
25085
+ column.getHeaderProps(finalState, void 0, column, this)
25086
+ );
25087
+ const classes = [
25088
+ column.headerClassName,
25089
+ theadFilterThProps.className,
25090
+ columnHeaderProps.className
25091
+ ];
25092
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, column.headerStyle), theadFilterThProps.style), columnHeaderProps.style);
25093
+ const rest = __spreadValues(__spreadValues({}, theadFilterThProps.rest), columnHeaderProps.rest);
25094
+ const filter = filtered.find((filter2) => filter2.id === column.id);
25095
+ const ResolvedFilterComponent = column.Filter || FilterComponent;
25096
+ const isFilterable = _.getFirstDefined(column.filterable, filterable, false);
25097
+ return /* @__PURE__ */ React__default.createElement(
25098
+ ThComponent,
25099
+ __spreadValues({
25100
+ key: `${i}-${column.id}`,
25101
+ className: classNames(classes),
25102
+ style: __spreadProps(__spreadValues({}, styles2), {
25103
+ flex: `${width} 0 auto`,
25104
+ width: _.asPx(width),
25105
+ maxWidth: _.asPx(maxWidth)
25106
+ })
25107
+ }, rest),
25108
+ isFilterable ? _.normalizeComponent(
25109
+ ResolvedFilterComponent,
25110
+ {
25519
25111
  column,
25520
25112
  filter,
25521
- onChange: /* @__PURE__ */ __name(function onChange(value) {
25522
- return _this2.filterColumn(column, value);
25523
- }, "onChange")
25524
- }, defaultProps$1.column.Filter) : null
25525
- );
25526
- }, "makeFilter");
25527
- var makeFilters = /* @__PURE__ */ __name(function makeFilters2() {
25528
- var theadFilterProps = _.splitProps(getTheadFilterProps(finalState, void 0, void 0, _this2));
25529
- var theadFilterTrProps = _.splitProps(getTheadFilterTrProps(finalState, void 0, void 0, _this2));
25530
- return React__default.createElement(
25531
- TheadComponent,
25532
- _extends$i({
25533
- className: classNames("-filters", theadFilterProps.className),
25534
- style: _extends$i({}, theadFilterProps.style, {
25535
- minWidth: rowMinWidth + "px"
25536
- })
25537
- }, theadFilterProps.rest),
25538
- React__default.createElement(
25539
- TrComponent2,
25540
- _extends$i({
25541
- className: theadFilterTrProps.className,
25542
- style: theadFilterTrProps.style
25543
- }, theadFilterTrProps.rest),
25544
- allVisibleColumns.map(makeFilter)
25545
- )
25546
- );
25547
- }, "makeFilters");
25548
- var makePageRow = /* @__PURE__ */ __name(function makePageRow2(row, i) {
25549
- var path2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
25550
- var rowInfo = {
25551
- original: row[originalKey],
25552
- row,
25553
- index: row[indexKey],
25554
- viewIndex: rowIndex += 1,
25555
- pageSize,
25556
- page,
25557
- level: path2.length,
25558
- nestingPath: path2.concat([i]),
25559
- aggregated: row[aggregatedKey],
25560
- groupedByPivot: row[groupedByPivotKey],
25561
- subRows: row[subRowsKey]
25562
- };
25563
- var isExpanded = _.get(expanded, rowInfo.nestingPath);
25564
- var trGroupProps = getTrGroupProps(finalState, rowInfo, void 0, _this2);
25565
- var trProps = _.splitProps(getTrProps(finalState, rowInfo, void 0, _this2));
25566
- return React__default.createElement(
25567
- TrGroupComponent2,
25568
- _extends$i({ key: rowInfo.nestingPath.join("_") }, trGroupProps),
25569
- React__default.createElement(
25570
- TrComponent2,
25571
- _extends$i({
25572
- className: classNames(trProps.className, row._viewIndex % 2 ? "-even" : "-odd"),
25573
- style: trProps.style
25574
- }, trProps.rest),
25575
- allVisibleColumns.map(function(column, i2) {
25576
- var resizedCol = resized.find(function(x2) {
25577
- return x2.id === column.id;
25578
- }) || {};
25579
- var show = typeof column.show === "function" ? column.show() : column.show;
25580
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25581
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25582
- var tdProps = _.splitProps(getTdProps(finalState, rowInfo, column, _this2));
25583
- var columnProps = _.splitProps(column.getProps(finalState, rowInfo, column, _this2));
25584
- var classes = [tdProps.className, column.className, columnProps.className];
25585
- var styles2 = _extends$i({}, tdProps.style, column.style, columnProps.style);
25586
- var cellInfo = _extends$i({}, rowInfo, {
25587
- isExpanded,
25588
- column: _extends$i({}, column),
25589
- value: rowInfo.row[column.id],
25590
- pivoted: column.pivoted,
25591
- expander: column.expander,
25592
- resized,
25593
- show,
25594
- width,
25595
- maxWidth,
25596
- tdProps,
25597
- columnProps,
25598
- classes,
25599
- styles: styles2
25600
- });
25601
- var value = cellInfo.value;
25602
- var useOnExpanderClick = void 0;
25603
- var isBranch = void 0;
25604
- var isPreview = void 0;
25605
- var onExpanderClick = /* @__PURE__ */ __name(function onExpanderClick2(e2) {
25606
- var newExpanded = _.clone(expanded);
25607
- if (isExpanded) {
25608
- newExpanded = _.set(newExpanded, cellInfo.nestingPath, false);
25609
- } else {
25610
- newExpanded = _.set(newExpanded, cellInfo.nestingPath, {});
25611
- }
25612
- return _this2.setStateWithData({
25613
- expanded: newExpanded
25614
- }, function() {
25615
- return onExpandedChange && onExpandedChange(newExpanded, cellInfo.nestingPath, e2, cellInfo);
25616
- });
25617
- }, "onExpanderClick");
25618
- var resolvedCell = _.normalizeComponent(column.Cell, cellInfo, value);
25619
- var ResolvedAggregatedComponent = column.Aggregated || (!column.aggregate ? AggregatedComponent2 : column.Cell);
25620
- var ResolvedExpanderComponent = column.Expander || ExpanderComponent2;
25621
- var ResolvedPivotValueComponent = column.PivotValue || PivotValueComponent2;
25622
- var DefaultResolvedPivotComponent = PivotComponent || function(props) {
25623
- return React__default.createElement(
25624
- "div",
25625
- null,
25626
- React__default.createElement(ResolvedExpanderComponent, props),
25627
- React__default.createElement(ResolvedPivotValueComponent, props)
25628
- );
25629
- };
25630
- var ResolvedPivotComponent = column.Pivot || DefaultResolvedPivotComponent;
25631
- if (cellInfo.pivoted || cellInfo.expander) {
25632
- cellInfo.expandable = true;
25633
- useOnExpanderClick = true;
25634
- if (cellInfo.pivoted && !cellInfo.subRows && !SubComponent) {
25635
- cellInfo.expandable = false;
25636
- }
25637
- }
25638
- if (cellInfo.pivoted) {
25639
- isBranch = rowInfo.row[pivotIDKey] === column.id && cellInfo.subRows;
25640
- isPreview = pivotBy.indexOf(column.id) > pivotBy.indexOf(rowInfo.row[pivotIDKey]) && cellInfo.subRows;
25641
- if (isBranch) {
25642
- resolvedCell = _.normalizeComponent(ResolvedPivotComponent, _extends$i({}, cellInfo, {
25643
- value: row[pivotValKey]
25644
- }), row[pivotValKey]);
25645
- } else if (isPreview) {
25646
- resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25647
- } else {
25648
- resolvedCell = null;
25649
- }
25650
- } else if (cellInfo.aggregated) {
25651
- resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25652
- }
25653
- if (cellInfo.expander) {
25654
- resolvedCell = _.normalizeComponent(ResolvedExpanderComponent, cellInfo, row[pivotValKey]);
25655
- if (pivotBy) {
25656
- if (cellInfo.groupedByPivot) {
25657
- resolvedCell = null;
25658
- }
25659
- if (!cellInfo.subRows && !SubComponent) {
25660
- resolvedCell = null;
25661
- }
25662
- }
25663
- }
25664
- var resolvedOnExpanderClick = useOnExpanderClick ? onExpanderClick : function() {
25665
- };
25666
- var interactionProps = {
25667
- onClick: resolvedOnExpanderClick
25668
- };
25669
- if (tdProps.rest.onClick) {
25670
- interactionProps.onClick = function(e2) {
25671
- tdProps.rest.onClick(e2, function() {
25672
- return resolvedOnExpanderClick(e2);
25673
- });
25674
- };
25113
+ onChange: (value) => this.filterColumn(column, value)
25114
+ },
25115
+ defaultProps$1.column.Filter
25116
+ ) : null
25117
+ );
25118
+ }, "makeFilter");
25119
+ const makeFilters = /* @__PURE__ */ __name(() => {
25120
+ const theadFilterProps = _.splitProps(
25121
+ getTheadFilterProps(finalState, void 0, void 0, this)
25122
+ );
25123
+ const theadFilterTrProps = _.splitProps(
25124
+ getTheadFilterTrProps(finalState, void 0, void 0, this)
25125
+ );
25126
+ return /* @__PURE__ */ React__default.createElement(
25127
+ TheadComponent,
25128
+ __spreadValues({
25129
+ className: classNames("-filters", theadFilterProps.className),
25130
+ style: __spreadProps(__spreadValues({}, theadFilterProps.style), {
25131
+ minWidth: `${rowMinWidth}px`
25132
+ })
25133
+ }, theadFilterProps.rest),
25134
+ /* @__PURE__ */ React__default.createElement(
25135
+ TrComponent,
25136
+ __spreadValues({
25137
+ className: theadFilterTrProps.className,
25138
+ style: theadFilterTrProps.style
25139
+ }, theadFilterTrProps.rest),
25140
+ allVisibleColumns.map(makeFilter)
25141
+ )
25142
+ );
25143
+ }, "makeFilters");
25144
+ const makePageRow = /* @__PURE__ */ __name((row, i, path2 = []) => {
25145
+ const rowInfo = {
25146
+ original: row[originalKey],
25147
+ row,
25148
+ index: row[indexKey],
25149
+ viewIndex: rowIndex += 1,
25150
+ pageSize,
25151
+ page,
25152
+ level: path2.length,
25153
+ nestingPath: path2.concat([i]),
25154
+ aggregated: row[aggregatedKey],
25155
+ groupedByPivot: row[groupedByPivotKey],
25156
+ subRows: row[subRowsKey]
25157
+ };
25158
+ const isExpanded = _.get(expanded, rowInfo.nestingPath);
25159
+ const trGroupProps = getTrGroupProps(finalState, rowInfo, void 0, this);
25160
+ const trProps = _.splitProps(getTrProps(finalState, rowInfo, void 0, this));
25161
+ return /* @__PURE__ */ React__default.createElement(TrGroupComponent, __spreadValues({ key: rowInfo.nestingPath.join("_") }, trGroupProps), /* @__PURE__ */ React__default.createElement(
25162
+ TrComponent,
25163
+ __spreadValues({
25164
+ className: classNames(trProps.className, row._viewIndex % 2 ? "-even" : "-odd"),
25165
+ style: trProps.style
25166
+ }, trProps.rest),
25167
+ allVisibleColumns.map((column, i2) => {
25168
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25169
+ const show = typeof column.show === "function" ? column.show() : column.show;
25170
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25171
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25172
+ const tdProps = _.splitProps(getTdProps(finalState, rowInfo, column, this));
25173
+ const columnProps = _.splitProps(column.getProps(finalState, rowInfo, column, this));
25174
+ const classes = [tdProps.className, column.className, columnProps.className];
25175
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, tdProps.style), column.style), columnProps.style);
25176
+ const cellInfo = __spreadProps(__spreadValues({}, rowInfo), {
25177
+ isExpanded,
25178
+ column: __spreadValues({}, column),
25179
+ value: rowInfo.row[column.id],
25180
+ pivoted: column.pivoted,
25181
+ expander: column.expander,
25182
+ resized,
25183
+ show,
25184
+ width,
25185
+ maxWidth,
25186
+ tdProps,
25187
+ columnProps,
25188
+ classes,
25189
+ styles: styles2
25190
+ });
25191
+ const value = cellInfo.value;
25192
+ let useOnExpanderClick;
25193
+ let isBranch;
25194
+ let isPreview;
25195
+ const onExpanderClick = /* @__PURE__ */ __name((e2) => {
25196
+ let newExpanded = _.clone(expanded);
25197
+ if (isExpanded) {
25198
+ newExpanded = _.set(newExpanded, cellInfo.nestingPath, false);
25199
+ } else {
25200
+ newExpanded = _.set(newExpanded, cellInfo.nestingPath, {});
25201
+ }
25202
+ return this.setStateWithData(
25203
+ {
25204
+ expanded: newExpanded
25205
+ },
25206
+ () => onExpandedChange && onExpandedChange(newExpanded, cellInfo.nestingPath, e2, cellInfo)
25207
+ );
25208
+ }, "onExpanderClick");
25209
+ let resolvedCell = _.normalizeComponent(column.Cell, cellInfo, value);
25210
+ const ResolvedAggregatedComponent = column.Aggregated || (!column.aggregate ? AggregatedComponent : column.Cell);
25211
+ const ResolvedExpanderComponent = column.Expander || ExpanderComponent;
25212
+ const ResolvedPivotValueComponent = column.PivotValue || PivotValueComponent;
25213
+ const DefaultResolvedPivotComponent = PivotComponent || ((props) => /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(ResolvedExpanderComponent, __spreadValues({}, props)), /* @__PURE__ */ React__default.createElement(ResolvedPivotValueComponent, __spreadValues({}, props))));
25214
+ const ResolvedPivotComponent = column.Pivot || DefaultResolvedPivotComponent;
25215
+ if (cellInfo.pivoted || cellInfo.expander) {
25216
+ cellInfo.expandable = true;
25217
+ useOnExpanderClick = true;
25218
+ if (cellInfo.pivoted && !cellInfo.subRows && !SubComponent) {
25219
+ cellInfo.expandable = false;
25220
+ }
25221
+ }
25222
+ if (cellInfo.pivoted) {
25223
+ isBranch = rowInfo.row[pivotIDKey] === column.id && cellInfo.subRows;
25224
+ isPreview = pivotBy.indexOf(column.id) > pivotBy.indexOf(rowInfo.row[pivotIDKey]) && cellInfo.subRows;
25225
+ if (isBranch) {
25226
+ resolvedCell = _.normalizeComponent(
25227
+ ResolvedPivotComponent,
25228
+ __spreadProps(__spreadValues({}, cellInfo), {
25229
+ value: row[pivotValKey]
25230
+ }),
25231
+ row[pivotValKey]
25232
+ );
25233
+ } else if (isPreview) {
25234
+ resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25235
+ } else {
25236
+ resolvedCell = null;
25237
+ }
25238
+ } else if (cellInfo.aggregated) {
25239
+ resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25240
+ }
25241
+ if (cellInfo.expander) {
25242
+ resolvedCell = _.normalizeComponent(
25243
+ ResolvedExpanderComponent,
25244
+ cellInfo,
25245
+ row[pivotValKey]
25246
+ );
25247
+ if (pivotBy) {
25248
+ if (cellInfo.groupedByPivot) {
25249
+ resolvedCell = null;
25675
25250
  }
25676
- if (columnProps.rest.onClick) {
25677
- interactionProps.onClick = function(e2) {
25678
- columnProps.rest.onClick(e2, function() {
25679
- return resolvedOnExpanderClick(e2);
25680
- });
25681
- };
25251
+ if (!cellInfo.subRows && !SubComponent) {
25252
+ resolvedCell = null;
25682
25253
  }
25683
- return React__default.createElement(
25684
- TdComponent2,
25685
- _extends$i({
25686
- key: i2 + "-" + column.id,
25687
- className: classNames(classes, !cellInfo.expandable && !show && "hidden", cellInfo.expandable && "rt-expandable", (isBranch || isPreview) && "rt-pivot"),
25688
- style: _extends$i({}, styles2, {
25689
- flex: width + " 0 auto",
25690
- width: _.asPx(width),
25691
- maxWidth: _.asPx(maxWidth)
25692
- })
25693
- }, tdProps.rest, columnProps.rest, interactionProps),
25694
- resolvedCell
25695
- );
25696
- })
25254
+ }
25255
+ }
25256
+ const resolvedOnExpanderClick = useOnExpanderClick ? onExpanderClick : () => {
25257
+ };
25258
+ const interactionProps = {
25259
+ onClick: resolvedOnExpanderClick
25260
+ };
25261
+ if (tdProps.rest.onClick) {
25262
+ interactionProps.onClick = (e2) => {
25263
+ tdProps.rest.onClick(e2, () => resolvedOnExpanderClick(e2));
25264
+ };
25265
+ }
25266
+ if (columnProps.rest.onClick) {
25267
+ interactionProps.onClick = (e2) => {
25268
+ columnProps.rest.onClick(e2, () => resolvedOnExpanderClick(e2));
25269
+ };
25270
+ }
25271
+ return /* @__PURE__ */ React__default.createElement(
25272
+ TdComponent,
25273
+ __spreadValues(__spreadValues(__spreadValues({
25274
+ key: `${i2}-${column.id}`,
25275
+ className: classNames(
25276
+ classes,
25277
+ !cellInfo.expandable && !show && "hidden",
25278
+ cellInfo.expandable && "rt-expandable",
25279
+ (isBranch || isPreview) && "rt-pivot"
25280
+ ),
25281
+ style: __spreadProps(__spreadValues({}, styles2), {
25282
+ flex: `${width} 0 auto`,
25283
+ width: _.asPx(width),
25284
+ maxWidth: _.asPx(maxWidth)
25285
+ })
25286
+ }, tdProps.rest), columnProps.rest), interactionProps),
25287
+ resolvedCell
25288
+ );
25289
+ })
25290
+ ), rowInfo.subRows && isExpanded && rowInfo.subRows.map((d2, i2) => makePageRow(d2, i2, rowInfo.nestingPath)), SubComponent && !rowInfo.subRows && isExpanded && SubComponent(rowInfo, () => {
25291
+ const newExpanded = _.clone(expanded);
25292
+ _.set(newExpanded, rowInfo.nestingPath, false);
25293
+ }));
25294
+ }, "makePageRow");
25295
+ const makePadColumn = /* @__PURE__ */ __name((column, i) => {
25296
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25297
+ const show = typeof column.show === "function" ? column.show() : column.show;
25298
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25299
+ const flex2 = width;
25300
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25301
+ const tdProps = _.splitProps(getTdProps(finalState, void 0, column, this));
25302
+ const columnProps = _.splitProps(column.getProps(finalState, void 0, column, this));
25303
+ const classes = [tdProps.className, column.className, columnProps.className];
25304
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, tdProps.style), column.style), columnProps.style);
25305
+ return /* @__PURE__ */ React__default.createElement(
25306
+ TdComponent,
25307
+ __spreadValues({
25308
+ key: `${i}-${column.id}`,
25309
+ className: classNames(classes, !show && "hidden"),
25310
+ style: __spreadProps(__spreadValues({}, styles2), {
25311
+ flex: `${flex2} 0 auto`,
25312
+ width: _.asPx(width),
25313
+ maxWidth: _.asPx(maxWidth)
25314
+ })
25315
+ }, tdProps.rest),
25316
+ _.normalizeComponent(PadRowComponent)
25317
+ );
25318
+ }, "makePadColumn");
25319
+ const makePadRow = /* @__PURE__ */ __name((row, i) => {
25320
+ const trGroupProps = getTrGroupProps(finalState, void 0, void 0, this);
25321
+ const trProps = _.splitProps(getTrProps(finalState, void 0, void 0, this));
25322
+ return /* @__PURE__ */ React__default.createElement(TrGroupComponent, __spreadValues({ key: `pad-${i}` }, trGroupProps), /* @__PURE__ */ React__default.createElement(
25323
+ TrComponent,
25324
+ {
25325
+ className: classNames(
25326
+ "-padRow",
25327
+ (pageRows.length + i) % 2 ? "-even" : "-odd",
25328
+ trProps.className
25697
25329
  ),
25698
- rowInfo.subRows && isExpanded && rowInfo.subRows.map(function(d2, i2) {
25699
- return makePageRow2(d2, i2, rowInfo.nestingPath);
25700
- }),
25701
- SubComponent && !rowInfo.subRows && isExpanded && SubComponent(rowInfo, function() {
25702
- var newExpanded = _.clone(expanded);
25703
- _.set(newExpanded, rowInfo.nestingPath, false);
25330
+ style: trProps.style || {}
25331
+ },
25332
+ allVisibleColumns.map(makePadColumn)
25333
+ ));
25334
+ }, "makePadRow");
25335
+ const makeColumnFooter = /* @__PURE__ */ __name((column, i) => {
25336
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25337
+ const show = typeof column.show === "function" ? column.show() : column.show;
25338
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25339
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25340
+ const tFootTdProps = _.splitProps(getTfootTdProps(finalState, void 0, column, this));
25341
+ const columnProps = _.splitProps(column.getProps(finalState, void 0, column, this));
25342
+ const columnFooterProps = _.splitProps(
25343
+ column.getFooterProps(finalState, void 0, column, this)
25344
+ );
25345
+ const classes = [
25346
+ tFootTdProps.className,
25347
+ column.className,
25348
+ columnProps.className,
25349
+ columnFooterProps.className
25350
+ ];
25351
+ const styles2 = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, tFootTdProps.style), column.style), columnProps.style), columnFooterProps.style);
25352
+ return /* @__PURE__ */ React__default.createElement(
25353
+ TdComponent,
25354
+ __spreadValues(__spreadValues(__spreadValues({
25355
+ key: `${i}-${column.id}`,
25356
+ className: classNames(classes, !show && "hidden"),
25357
+ style: __spreadProps(__spreadValues({}, styles2), {
25358
+ flex: `${width} 0 auto`,
25359
+ width: _.asPx(width),
25360
+ maxWidth: _.asPx(maxWidth)
25704
25361
  })
25705
- );
25706
- }, "makePageRow");
25707
- var makePadColumn = /* @__PURE__ */ __name(function makePadColumn2(column, i) {
25708
- var resizedCol = resized.find(function(x2) {
25709
- return x2.id === column.id;
25710
- }) || {};
25711
- var show = typeof column.show === "function" ? column.show() : column.show;
25712
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25713
- var flex2 = width;
25714
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25715
- var tdProps = _.splitProps(getTdProps(finalState, void 0, column, _this2));
25716
- var columnProps = _.splitProps(column.getProps(finalState, void 0, column, _this2));
25717
- var classes = [tdProps.className, column.className, columnProps.className];
25718
- var styles2 = _extends$i({}, tdProps.style, column.style, columnProps.style);
25719
- return React__default.createElement(
25720
- TdComponent2,
25721
- _extends$i({
25722
- key: i + "-" + column.id,
25723
- className: classNames(classes, !show && "hidden"),
25724
- style: _extends$i({}, styles2, {
25725
- flex: flex2 + " 0 auto",
25726
- width: _.asPx(width),
25727
- maxWidth: _.asPx(maxWidth)
25728
- })
25729
- }, tdProps.rest),
25730
- _.normalizeComponent(PadRowComponent2)
25731
- );
25732
- }, "makePadColumn");
25733
- var makePadRow = /* @__PURE__ */ __name(function makePadRow2(row, i) {
25734
- var trGroupProps = getTrGroupProps(finalState, void 0, void 0, _this2);
25735
- var trProps = _.splitProps(getTrProps(finalState, void 0, void 0, _this2));
25736
- return React__default.createElement(
25737
- TrGroupComponent2,
25738
- _extends$i({ key: "pad-" + i }, trGroupProps),
25739
- React__default.createElement(
25740
- TrComponent2,
25741
- {
25742
- className: classNames("-padRow", (pageRows.length + i) % 2 ? "-even" : "-odd", trProps.className),
25743
- style: trProps.style || {}
25744
- },
25745
- allVisibleColumns.map(makePadColumn)
25746
- )
25747
- );
25748
- }, "makePadRow");
25749
- var makeColumnFooter = /* @__PURE__ */ __name(function makeColumnFooter2(column, i) {
25750
- var resizedCol = resized.find(function(x2) {
25751
- return x2.id === column.id;
25752
- }) || {};
25753
- var show = typeof column.show === "function" ? column.show() : column.show;
25754
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25755
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25756
- var tFootTdProps = _.splitProps(getTfootTdProps(finalState, void 0, column, _this2));
25757
- var columnProps = _.splitProps(column.getProps(finalState, void 0, column, _this2));
25758
- var columnFooterProps = _.splitProps(column.getFooterProps(finalState, void 0, column, _this2));
25759
- var classes = [tFootTdProps.className, column.className, columnProps.className, columnFooterProps.className];
25760
- var styles2 = _extends$i({}, tFootTdProps.style, column.style, columnProps.style, columnFooterProps.style);
25761
- return React__default.createElement(
25762
- TdComponent2,
25763
- _extends$i({
25764
- key: i + "-" + column.id,
25765
- className: classNames(classes, !show && "hidden"),
25766
- style: _extends$i({}, styles2, {
25767
- flex: width + " 0 auto",
25768
- width: _.asPx(width),
25769
- maxWidth: _.asPx(maxWidth)
25770
- })
25771
- }, columnProps.rest, tFootTdProps.rest, columnFooterProps.rest),
25772
- _.normalizeComponent(column.Footer, {
25773
- data: sortedData,
25774
- column
25362
+ }, columnProps.rest), tFootTdProps.rest), columnFooterProps.rest),
25363
+ _.normalizeComponent(column.Footer, {
25364
+ data: sortedData,
25365
+ column
25366
+ })
25367
+ );
25368
+ }, "makeColumnFooter");
25369
+ const makeColumnFooters = /* @__PURE__ */ __name(() => {
25370
+ const tFootProps = _.splitProps(getTfootProps(finalState, void 0, void 0, this));
25371
+ const tFootTrProps = _.splitProps(getTfootTrProps(finalState, void 0, void 0, this));
25372
+ return /* @__PURE__ */ React__default.createElement(
25373
+ TfootComponent,
25374
+ __spreadValues({
25375
+ className: tFootProps.className,
25376
+ style: __spreadProps(__spreadValues({}, tFootProps.style), {
25377
+ minWidth: `${rowMinWidth}px`
25775
25378
  })
25776
- );
25777
- }, "makeColumnFooter");
25778
- var makeColumnFooters = /* @__PURE__ */ __name(function makeColumnFooters2() {
25779
- var tFootProps = _.splitProps(getTfootProps(finalState, void 0, void 0, _this2));
25780
- var tFootTrProps = _.splitProps(getTfootTrProps(finalState, void 0, void 0, _this2));
25781
- return React__default.createElement(
25782
- TfootComponent,
25783
- _extends$i({
25784
- className: tFootProps.className,
25785
- style: _extends$i({}, tFootProps.style, {
25786
- minWidth: rowMinWidth + "px"
25787
- })
25788
- }, tFootProps.rest),
25789
- React__default.createElement(
25790
- TrComponent2,
25791
- _extends$i({
25792
- className: classNames(tFootTrProps.className),
25793
- style: tFootTrProps.style
25794
- }, tFootTrProps.rest),
25795
- allVisibleColumns.map(makeColumnFooter)
25796
- )
25797
- );
25798
- }, "makeColumnFooters");
25799
- var makePagination = /* @__PURE__ */ __name(function makePagination2(isTop) {
25800
- var paginationProps = _.splitProps(getPaginationProps(finalState, void 0, void 0, _this2));
25801
- return React__default.createElement(PaginationComponent, _extends$i({}, resolvedState, {
25379
+ }, tFootProps.rest),
25380
+ /* @__PURE__ */ React__default.createElement(
25381
+ TrComponent,
25382
+ __spreadValues({
25383
+ className: classNames(tFootTrProps.className),
25384
+ style: tFootTrProps.style
25385
+ }, tFootTrProps.rest),
25386
+ allVisibleColumns.map(makeColumnFooter)
25387
+ )
25388
+ );
25389
+ }, "makeColumnFooters");
25390
+ const makePagination = /* @__PURE__ */ __name((isTop) => {
25391
+ const paginationProps = _.splitProps(
25392
+ getPaginationProps(finalState, void 0, void 0, this)
25393
+ );
25394
+ return /* @__PURE__ */ React__default.createElement(
25395
+ PaginationComponent,
25396
+ __spreadValues(__spreadProps(__spreadValues({}, resolvedState), {
25802
25397
  pages,
25803
25398
  canPrevious,
25804
25399
  canNext,
25805
- onPageChange: _this2.onPageChange,
25806
- onPageSizeChange: _this2.onPageSizeChange,
25400
+ onPageChange: this.onPageChange,
25401
+ onPageSizeChange: this.onPageSizeChange,
25807
25402
  className: paginationProps.className,
25808
25403
  style: paginationProps.style,
25809
25404
  isTop
25810
- }, paginationProps.rest));
25811
- }, "makePagination");
25812
- var makeTable = /* @__PURE__ */ __name(function makeTable2() {
25813
- return React__default.createElement(
25814
- "div",
25815
- _extends$i({
25816
- className: classNames("ReactTable", className, rootProps.className),
25817
- style: _extends$i({}, style2, rootProps.style)
25818
- }, rootProps.rest),
25819
- showPagination && showPaginationTop ? React__default.createElement(
25820
- "div",
25821
- { className: "pagination-top" },
25822
- makePagination(true)
25823
- ) : null,
25824
- React__default.createElement(
25825
- TableComponent2,
25826
- _extends$i({
25827
- className: classNames(tableProps.className, currentlyResizing ? "rt-resizing" : ""),
25828
- style: tableProps.style
25829
- }, tableProps.rest),
25830
- hasHeaderGroups ? makeHeaderGroups() : null,
25831
- makeHeaders(),
25832
- hasFilters ? makeFilters() : null,
25833
- React__default.createElement(
25834
- TbodyComponent,
25835
- _extends$i({
25836
- className: classNames(tBodyProps.className),
25837
- style: _extends$i({}, tBodyProps.style, {
25838
- minWidth: rowMinWidth + "px"
25839
- })
25840
- }, tBodyProps.rest),
25841
- pageRows.length < 200 ? pageRows.map(function(d2, i) {
25842
- return makePageRow(d2, i);
25843
- }) : React__default.createElement(ReactList, {
25844
- type: "variable",
25845
- itemSizeEstimator: _this2.props.itemSizeEstimator || itemSizeEstimator,
25846
- itemRenderer: /* @__PURE__ */ __name(function itemRenderer(i) {
25847
- return makePageRow(pageRows[i], i);
25848
- }, "itemRenderer"),
25849
- length: pageRows.length
25850
- }),
25851
- padRows.map(makePadRow),
25852
- additionalBodyEl
25853
- ),
25854
- hasColumnFooter ? makeColumnFooters() : null
25855
- ),
25856
- showPagination && showPaginationBottom ? React__default.createElement(
25857
- "div",
25858
- { className: "pagination-bottom" },
25859
- makePagination(false)
25860
- ) : null,
25861
- !pageRows.length && React__default.createElement(
25862
- NoDataComponent,
25863
- noDataProps,
25864
- _.normalizeComponent(noDataText)
25405
+ }), paginationProps.rest)
25406
+ );
25407
+ }, "makePagination");
25408
+ const makeTable = /* @__PURE__ */ __name(() => /* @__PURE__ */ React__default.createElement(
25409
+ "div",
25410
+ __spreadProps(__spreadValues({
25411
+ className: classNames("ReactTable", className, rootProps.className),
25412
+ style: __spreadValues(__spreadValues({}, style2), rootProps.style)
25413
+ }, rootProps.rest), {
25414
+ ref: (r2) => {
25415
+ if (!r2)
25416
+ return;
25417
+ if (rootProps.rest.ref) {
25418
+ rootProps.rest.ref(r2);
25419
+ }
25420
+ this.tableRef = r2;
25421
+ }
25422
+ }),
25423
+ showPagination && showPaginationTop ? /* @__PURE__ */ React__default.createElement("div", { className: "pagination-top" }, makePagination(true)) : null,
25424
+ /* @__PURE__ */ React__default.createElement(
25425
+ TableComponent,
25426
+ __spreadValues({
25427
+ className: classNames(tableProps.className, currentlyResizing ? "rt-resizing" : ""),
25428
+ style: tableProps.style
25429
+ }, tableProps.rest),
25430
+ hasHeaderGroups ? makeHeaderGroups() : null,
25431
+ makeHeaders(),
25432
+ hasFilters ? makeFilters() : null,
25433
+ /* @__PURE__ */ React__default.createElement(
25434
+ TbodyComponent,
25435
+ __spreadValues({
25436
+ className: classNames(tBodyProps.className),
25437
+ style: __spreadProps(__spreadValues({}, tBodyProps.style), {
25438
+ minWidth: `${rowMinWidth}px`
25439
+ })
25440
+ }, tBodyProps.rest),
25441
+ pageRows.length < 200 ? pageRows.map((d2, i) => makePageRow(d2, i)) : /* @__PURE__ */ React__default.createElement(
25442
+ ReactList,
25443
+ {
25444
+ type: "variable",
25445
+ itemSizeEstimator: this.props.itemSizeEstimator || itemSizeEstimator,
25446
+ itemRenderer: (i) => makePageRow(pageRows[i], i),
25447
+ length: pageRows.length
25448
+ }
25865
25449
  ),
25866
- React__default.createElement(LoadingComponent3, _extends$i({ loading, loadingText }, loadingProps))
25867
- );
25868
- }, "makeTable");
25869
- return children ? children(finalState, makeTable, this) : makeTable();
25870
- }, "render")
25871
- }]);
25872
- return ReactTable2;
25873
- }(Methods(Lifecycle(Component)));
25874
- ReactTable.propTypes = propTypes;
25875
- ReactTable.defaultProps = defaultProps$1;
25450
+ padRows.map(makePadRow),
25451
+ additionalBodyEl
25452
+ ),
25453
+ hasColumnFooter ? makeColumnFooters() : null
25454
+ ),
25455
+ showPagination && showPaginationBottom ? /* @__PURE__ */ React__default.createElement("div", { className: "pagination-bottom" }, makePagination(false)) : null,
25456
+ !pageRows.length && /* @__PURE__ */ React__default.createElement(NoDataComponent, __spreadValues({}, noDataProps), _.normalizeComponent(noDataText)),
25457
+ /* @__PURE__ */ React__default.createElement(LoadingComponent2, __spreadValues({ loading, loadingText }, loadingProps))
25458
+ ), "makeTable");
25459
+ return children ? children(finalState, makeTable, this) : makeTable();
25460
+ }
25461
+ };
25462
+ __name(_ReactTable, "ReactTable");
25463
+ __publicField(_ReactTable, "propTypes", propTypes);
25464
+ __publicField(_ReactTable, "defaultProps", defaultProps$1);
25465
+ let ReactTable = _ReactTable;
25876
25466
  var dayjs_min = { exports: {} };
25877
25467
  (function(module2, exports2) {
25878
25468
  !function(t2, e2) {
@@ -44184,7 +43774,7 @@ function arrayEach$2(array2, iteratee) {
44184
43774
  }
44185
43775
  __name(arrayEach$2, "arrayEach$2");
44186
43776
  var _arrayEach = arrayEach$2;
44187
- var defineProperty$3 = _defineProperty$6;
43777
+ var defineProperty$3 = _defineProperty$5;
44188
43778
  function baseAssignValue$3(object2, key, value) {
44189
43779
  if (key == "__proto__" && defineProperty$3) {
44190
43780
  defineProperty$3(object2, key, {
@@ -53794,8 +53384,8 @@ const renderSuggest = /* @__PURE__ */ __name((props) => {
53794
53384
  });
53795
53385
  return /* @__PURE__ */ React__default.createElement(TgSuggest, __spreadValues({}, propsToUse));
53796
53386
  }, "renderSuggest");
53797
- const BPSelect = /* @__PURE__ */ __name((_c) => {
53798
- var _d = _c, { value, onChange } = _d, rest = __objRest(_d, ["value", "onChange"]);
53387
+ const BPSelect = /* @__PURE__ */ __name((_q) => {
53388
+ var _r = _q, { value, onChange } = _r, rest = __objRest(_r, ["value", "onChange"]);
53799
53389
  return renderSelect(__spreadProps(__spreadValues({}, rest), { input: { onChange, value } }));
53800
53390
  }, "BPSelect");
53801
53391
  const renderSelect = /* @__PURE__ */ __name((props) => {
@@ -53930,12 +53520,12 @@ const renderBlueprintNumericInput = /* @__PURE__ */ __name((props) => {
53930
53520
  })
53931
53521
  );
53932
53522
  }, "renderBlueprintNumericInput");
53933
- const renderBlueprintRadioGroup = /* @__PURE__ */ __name((_e) => {
53934
- var _f = _e, {
53523
+ const renderBlueprintRadioGroup = /* @__PURE__ */ __name((_s) => {
53524
+ var _t = _s, {
53935
53525
  input,
53936
53526
  options,
53937
53527
  onFieldSubmit
53938
- } = _f, rest = __objRest(_f, [
53528
+ } = _t, rest = __objRest(_t, [
53939
53529
  "input",
53940
53530
  "options",
53941
53531
  "onFieldSubmit"
@@ -54446,10 +54036,10 @@ const _DisplayOptions = class _DisplayOptions extends React__default.Component {
54446
54036
  };
54447
54037
  __name(_DisplayOptions, "DisplayOptions");
54448
54038
  let DisplayOptions = _DisplayOptions;
54449
- const { LoadingComponent: LoadingComponent2 } = ReactTableDefaults;
54039
+ const { LoadingComponent } = ReactTableDefaults;
54450
54040
  function DisabledLoadingComponent({ disabled, loading, loadingText }) {
54451
54041
  return /* @__PURE__ */ React__default.createElement(
54452
- LoadingComponent2,
54042
+ LoadingComponent,
54453
54043
  {
54454
54044
  className: disabled ? "disabled" : "",
54455
54045
  loading,
@@ -54625,7 +54215,7 @@ function createLocation(path2, state, key, currentLocation) {
54625
54215
  location2 = parsePath(path2);
54626
54216
  location2.state = state;
54627
54217
  } else {
54628
- location2 = _extends$n({}, path2);
54218
+ location2 = _extends$i({}, path2);
54629
54219
  if (location2.pathname === void 0)
54630
54220
  location2.pathname = "";
54631
54221
  if (location2.search) {
@@ -57125,8 +56715,8 @@ const _DataTable = class _DataTable extends React__default.Component {
57125
56715
  };
57126
56716
  }),
57127
56717
  branch(({ immovable }) => "true" !== immovable, sortableElement)
57128
- )((_g) => {
57129
- var _h = _g, { toggleSort, className, children } = _h, rest = __objRest(_h, ["toggleSort", "className", "children"]);
56718
+ )((_u) => {
56719
+ var _v = _u, { toggleSort, className, children } = _v, rest = __objRest(_v, ["toggleSort", "className", "children"]);
57130
56720
  return /* @__PURE__ */ React__default.createElement(
57131
56721
  "div",
57132
56722
  __spreadValues({
@@ -58495,6 +58085,7 @@ const _DataTable = class _DataTable extends React__default.Component {
58495
58085
  ${description2} ${isUnique ? "<br>Must be unique" : ""}</div>`
58496
58086
  }), {
58497
58087
  "data-test": columnTitleTextified,
58088
+ "data-path": path2,
58498
58089
  "data-copy-text": columnTitleTextified,
58499
58090
  className: classNames("tg-react-table-column-header", {
58500
58091
  "sort-active": sortUp || sortDown
@@ -59252,13 +58843,13 @@ function getCellInfo({
59252
58843
  };
59253
58844
  }
59254
58845
  __name(getCellInfo, "getCellInfo");
59255
- function ColumnFilterMenu(_i) {
59256
- var _j = _i, {
58846
+ function ColumnFilterMenu(_w) {
58847
+ var _x = _w, {
59257
58848
  FilterMenu,
59258
58849
  filterActiveForColumn,
59259
58850
  compact: compact3,
59260
58851
  extraCompact
59261
- } = _j, rest = __objRest(_j, [
58852
+ } = _x, rest = __objRest(_x, [
59262
58853
  "FilterMenu",
59263
58854
  "filterActiveForColumn",
59264
58855
  "compact",
@@ -62063,8 +61654,8 @@ function maybeStripIdFromEntities(ents, validateAgainstSchema) {
62063
61654
  return toRet == null ? void 0 : toRet.map((e2) => lodashExports.omit(e2, ["_isClean"]));
62064
61655
  }
62065
61656
  __name(maybeStripIdFromEntities, "maybeStripIdFromEntities");
62066
- const useDialog = /* @__PURE__ */ __name((_k) => {
62067
- var _l = _k, { ModalComponent } = _l, rest = __objRest(_l, ["ModalComponent"]);
61657
+ const useDialog = /* @__PURE__ */ __name((_y) => {
61658
+ var _z = _y, { ModalComponent } = _z, rest = __objRest(_z, ["ModalComponent"]);
62068
61659
  const [isOpen, setOpen] = useState(false);
62069
61660
  const [additionalProps, setAdditionalProps] = useState(false);
62070
61661
  const comp = /* @__PURE__ */ React__default.createElement(
@@ -72656,14 +72247,14 @@ function BlueprintError({ error }) {
72656
72247
  return /* @__PURE__ */ React__default.createElement("div", { className: classNames(Classes.FORM_GROUP, Classes.INTENT_DANGER) }, /* @__PURE__ */ React__default.createElement("div", { className: classNames(Classes.FORM_HELPER_TEXT, "preserve-newline") }, error));
72657
72248
  }
72658
72249
  __name(BlueprintError, "BlueprintError");
72659
- function DropdownButton(_m) {
72660
- var _n = _m, {
72250
+ function DropdownButton(_A) {
72251
+ var _B = _A, {
72661
72252
  disabled,
72662
72253
  menu,
72663
72254
  noRightIcon,
72664
72255
  popoverProps,
72665
72256
  className
72666
- } = _n, rest = __objRest(_n, [
72257
+ } = _B, rest = __objRest(_B, [
72667
72258
  "disabled",
72668
72259
  "menu",
72669
72260
  "noRightIcon",
@@ -76106,14 +75697,14 @@ const EnhancedMenuItem = compose(
76106
75697
  }
76107
75698
  }),
76108
75699
  branch(({ navTo }) => navTo, withRouter$1)
76109
- )(function(_o) {
76110
- var _p = _o, {
75700
+ )(function(_C) {
75701
+ var _D = _C, {
76111
75702
  navTo,
76112
75703
  context,
76113
75704
  staticContext,
76114
75705
  didMount,
76115
75706
  willUnmount
76116
- } = _p, props = __objRest(_p, [
75707
+ } = _D, props = __objRest(_D, [
76117
75708
  "navTo",
76118
75709
  "context",
76119
75710
  "staticContext",
@@ -76334,8 +75925,8 @@ function doesSearchValMatchText(searchVal, justText) {
76334
75925
  );
76335
75926
  }
76336
75927
  __name(doesSearchValMatchText, "doesSearchValMatchText");
76337
- const MenuItemWithTooltip = /* @__PURE__ */ __name((_q) => {
76338
- var _r = _q, { tooltip } = _r, rest = __objRest(_r, ["tooltip"]);
75928
+ const MenuItemWithTooltip = /* @__PURE__ */ __name((_E) => {
75929
+ var _F = _E, { tooltip } = _F, rest = __objRest(_F, ["tooltip"]);
76339
75930
  let out = /* @__PURE__ */ React__default.createElement(MenuItem, __spreadValues({}, rest));
76340
75931
  if (tooltip) {
76341
75932
  out = /* @__PURE__ */ React__default.createElement(Tooltip, { content: tooltip }, out);