@teselagen/ui 0.3.36 → 0.3.37

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.
Files changed (4) hide show
  1. package/index.cjs.js +1707 -2073
  2. package/index.es.js +1707 -2073
  3. package/package.json +2 -1
  4. package/style.css +1 -1
package/index.cjs.js CHANGED
@@ -4960,7 +4960,7 @@ function _objectSpread$3(target) {
4960
4960
  for (var i = 1; i < arguments.length; i++) {
4961
4961
  var source = null != arguments[i] ? arguments[i] : {};
4962
4962
  i % 2 ? ownKeys$5(Object(source), true).forEach(function(key) {
4963
- _defineProperty$9(target, key, source[key]);
4963
+ _defineProperty$8(target, key, source[key]);
4964
4964
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function(key) {
4965
4965
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4966
4966
  });
@@ -4968,7 +4968,7 @@ function _objectSpread$3(target) {
4968
4968
  return target;
4969
4969
  }
4970
4970
  __name(_objectSpread$3, "_objectSpread$3");
4971
- function _defineProperty$9(obj, key, value) {
4971
+ function _defineProperty$8(obj, key, value) {
4972
4972
  if (key in obj) {
4973
4973
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
4974
4974
  } else {
@@ -4976,11 +4976,11 @@ function _defineProperty$9(obj, key, value) {
4976
4976
  }
4977
4977
  return obj;
4978
4978
  }
4979
- __name(_defineProperty$9, "_defineProperty$9");
4980
- function _slicedToArray$6(arr, i) {
4979
+ __name(_defineProperty$8, "_defineProperty$8");
4980
+ function _slicedToArray$4(arr, i) {
4981
4981
  return _arrayWithHoles$4(arr) || _iterableToArrayLimit$4(arr, i) || _unsupportedIterableToArray$a(arr, i) || _nonIterableRest$4();
4982
4982
  }
4983
- __name(_slicedToArray$6, "_slicedToArray$6");
4983
+ __name(_slicedToArray$4, "_slicedToArray$4");
4984
4984
  function _nonIterableRest$4() {
4985
4985
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4986
4986
  }
@@ -5100,8 +5100,8 @@ function allFilesAccepted(_ref) {
5100
5100
  return false;
5101
5101
  }
5102
5102
  return files.every(function(file) {
5103
- var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$6(_fileAccepted, 1), accepted = _fileAccepted2[0];
5104
- var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$6(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0];
5103
+ var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$4(_fileAccepted, 1), accepted = _fileAccepted2[0];
5104
+ var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$4(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0];
5105
5105
  return accepted && sizeMatch;
5106
5106
  });
5107
5107
  }
@@ -5170,16 +5170,16 @@ function filePickerOptionsTypes(accept) {
5170
5170
  accept: Array.isArray(accept) ? accept.filter(function(item) {
5171
5171
  return item === "audio/*" || item === "video/*" || item === "image/*" || item === "text/*" || /\w+\/[-+.\w]+/g.test(item);
5172
5172
  }).reduce(function(a2, b2) {
5173
- return _objectSpread$3(_objectSpread$3({}, a2), {}, _defineProperty$9({}, b2, []));
5173
+ return _objectSpread$3(_objectSpread$3({}, a2), {}, _defineProperty$8({}, b2, []));
5174
5174
  }, {}) : {}
5175
5175
  }];
5176
5176
  }
5177
5177
  __name(filePickerOptionsTypes, "filePickerOptionsTypes");
5178
5178
  var _excluded$1 = ["children"], _excluded2 = ["open"], _excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], _excluded4 = ["refKey", "onChange", "onClick"];
5179
- function _toConsumableArray$1(arr) {
5179
+ function _toConsumableArray(arr) {
5180
5180
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$9(arr) || _nonIterableSpread();
5181
5181
  }
5182
- __name(_toConsumableArray$1, "_toConsumableArray$1");
5182
+ __name(_toConsumableArray, "_toConsumableArray");
5183
5183
  function _nonIterableSpread() {
5184
5184
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5185
5185
  }
@@ -5194,10 +5194,10 @@ function _arrayWithoutHoles(arr) {
5194
5194
  return _arrayLikeToArray$9(arr);
5195
5195
  }
5196
5196
  __name(_arrayWithoutHoles, "_arrayWithoutHoles");
5197
- function _slicedToArray$5(arr, i) {
5197
+ function _slicedToArray$3(arr, i) {
5198
5198
  return _arrayWithHoles$3(arr) || _iterableToArrayLimit$3(arr, i) || _unsupportedIterableToArray$9(arr, i) || _nonIterableRest$3();
5199
5199
  }
5200
- __name(_slicedToArray$5, "_slicedToArray$5");
5200
+ __name(_slicedToArray$3, "_slicedToArray$3");
5201
5201
  function _nonIterableRest$3() {
5202
5202
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5203
5203
  }
@@ -5274,7 +5274,7 @@ function _objectSpread$2(target) {
5274
5274
  for (var i = 1; i < arguments.length; i++) {
5275
5275
  var source = null != arguments[i] ? arguments[i] : {};
5276
5276
  i % 2 ? ownKeys$4(Object(source), true).forEach(function(key) {
5277
- _defineProperty$8(target, key, source[key]);
5277
+ _defineProperty$7(target, key, source[key]);
5278
5278
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function(key) {
5279
5279
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5280
5280
  });
@@ -5282,7 +5282,7 @@ function _objectSpread$2(target) {
5282
5282
  return target;
5283
5283
  }
5284
5284
  __name(_objectSpread$2, "_objectSpread$2");
5285
- function _defineProperty$8(obj, key, value) {
5285
+ function _defineProperty$7(obj, key, value) {
5286
5286
  if (key in obj) {
5287
5287
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
5288
5288
  } else {
@@ -5290,8 +5290,8 @@ function _defineProperty$8(obj, key, value) {
5290
5290
  }
5291
5291
  return obj;
5292
5292
  }
5293
- __name(_defineProperty$8, "_defineProperty$8");
5294
- function _objectWithoutProperties$7(source, excluded) {
5293
+ __name(_defineProperty$7, "_defineProperty$7");
5294
+ function _objectWithoutProperties$5(source, excluded) {
5295
5295
  if (source == null)
5296
5296
  return {};
5297
5297
  var target = _objectWithoutPropertiesLoose$2(source, excluded);
@@ -5309,7 +5309,7 @@ function _objectWithoutProperties$7(source, excluded) {
5309
5309
  }
5310
5310
  return target;
5311
5311
  }
5312
- __name(_objectWithoutProperties$7, "_objectWithoutProperties$7");
5312
+ __name(_objectWithoutProperties$5, "_objectWithoutProperties$5");
5313
5313
  function _objectWithoutPropertiesLoose$2(source, excluded) {
5314
5314
  if (source == null)
5315
5315
  return {};
@@ -5326,8 +5326,8 @@ function _objectWithoutPropertiesLoose$2(source, excluded) {
5326
5326
  }
5327
5327
  __name(_objectWithoutPropertiesLoose$2, "_objectWithoutPropertiesLoose$2");
5328
5328
  var Dropzone = /* @__PURE__ */ React$1.forwardRef(function(_ref, ref) {
5329
- var children = _ref.children, params = _objectWithoutProperties$7(_ref, _excluded$1);
5330
- var _useDropzone = useDropzone(params), open2 = _useDropzone.open, props = _objectWithoutProperties$7(_useDropzone, _excluded2);
5329
+ var children = _ref.children, params = _objectWithoutProperties$5(_ref, _excluded$1);
5330
+ var _useDropzone = useDropzone(params), open2 = _useDropzone.open, props = _objectWithoutProperties$5(_useDropzone, _excluded2);
5331
5331
  React$1.useImperativeHandle(ref, function() {
5332
5332
  return {
5333
5333
  open: open2
@@ -5536,7 +5536,7 @@ function useDropzone() {
5536
5536
  }, [onFileDialogCancel]);
5537
5537
  var rootRef = React$1.useRef(null);
5538
5538
  var inputRef = React$1.useRef(null);
5539
- var _useReducer = React$1.useReducer(reducer, initialState), _useReducer2 = _slicedToArray$5(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1];
5539
+ var _useReducer = React$1.useReducer(reducer, initialState), _useReducer2 = _slicedToArray$3(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1];
5540
5540
  var isFocused = state.isFocused, isFileDialogActive = state.isFileDialogActive, draggedFiles = state.draggedFiles;
5541
5541
  var onWindowFocus = /* @__PURE__ */ __name(function onWindowFocus2() {
5542
5542
  if (isFileDialogActive) {
@@ -5587,7 +5587,7 @@ function useDropzone() {
5587
5587
  event.preventDefault();
5588
5588
  event.persist();
5589
5589
  stopPropagation(event);
5590
- dragTargetsRef.current = [].concat(_toConsumableArray$1(dragTargetsRef.current), [event.target]);
5590
+ dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);
5591
5591
  if (isEvtWithFiles(event)) {
5592
5592
  Promise.resolve(getFilesFromEvent(event)).then(function(draggedFiles2) {
5593
5593
  if (isPropagationStopped(event) && !noDragEventsBubbling) {
@@ -5648,8 +5648,8 @@ function useDropzone() {
5648
5648
  var acceptedFiles = [];
5649
5649
  var fileRejections = [];
5650
5650
  files.forEach(function(file) {
5651
- var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$5(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1];
5652
- var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$5(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1];
5651
+ var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$3(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1];
5652
+ var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$3(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1];
5653
5653
  var customErrors = validator2 ? validator2(file) : null;
5654
5654
  if (accepted && sizeMatch && !customErrors) {
5655
5655
  acceptedFiles.push(file);
@@ -5784,8 +5784,8 @@ function useDropzone() {
5784
5784
  }, "stopPropagation");
5785
5785
  var getRootProps = React$1.useMemo(function() {
5786
5786
  return function() {
5787
- var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref2.role, onKeyDown = _ref2.onKeyDown, onFocus = _ref2.onFocus, onBlur = _ref2.onBlur, onClick = _ref2.onClick, onDragEnter2 = _ref2.onDragEnter, onDragOver2 = _ref2.onDragOver, onDragLeave2 = _ref2.onDragLeave, onDrop2 = _ref2.onDrop, rest = _objectWithoutProperties$7(_ref2, _excluded3);
5788
- return _objectSpread$2(_objectSpread$2(_defineProperty$8({
5787
+ var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref2.role, onKeyDown = _ref2.onKeyDown, onFocus = _ref2.onFocus, onBlur = _ref2.onBlur, onClick = _ref2.onClick, onDragEnter2 = _ref2.onDragEnter, onDragOver2 = _ref2.onDragOver, onDragLeave2 = _ref2.onDragLeave, onDrop2 = _ref2.onDrop, rest = _objectWithoutProperties$5(_ref2, _excluded3);
5788
+ return _objectSpread$2(_objectSpread$2(_defineProperty$7({
5789
5789
  onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
5790
5790
  onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
5791
5791
  onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
@@ -5805,8 +5805,8 @@ function useDropzone() {
5805
5805
  }, []);
5806
5806
  var getInputProps = React$1.useMemo(function() {
5807
5807
  return function() {
5808
- var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties$7(_ref3, _excluded4);
5809
- var inputProps = _defineProperty$8({
5808
+ var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties$5(_ref3, _excluded4);
5809
+ var inputProps = _defineProperty$7({
5810
5810
  accept,
5811
5811
  multiple,
5812
5812
  type: "file",
@@ -6814,10 +6814,10 @@ var ownKeys$3 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownK
6814
6814
  /* istanbul ignore next */
6815
6815
  Object.getOwnPropertyNames
6816
6816
  );
6817
- function toPrimitive$3(value) {
6817
+ function toPrimitive$2(value) {
6818
6818
  return value === null ? null : typeof value === "object" ? "" + value : value;
6819
6819
  }
6820
- __name(toPrimitive$3, "toPrimitive$3");
6820
+ __name(toPrimitive$2, "toPrimitive$2");
6821
6821
  function hasProp(target, prop) {
6822
6822
  return objectPrototype$1.hasOwnProperty.call(target, prop);
6823
6823
  }
@@ -6840,7 +6840,7 @@ function _defineProperties$1(target, props) {
6840
6840
  }
6841
6841
  }
6842
6842
  __name(_defineProperties$1, "_defineProperties$1");
6843
- function _createClass$d(Constructor, protoProps, staticProps) {
6843
+ function _createClass$9(Constructor, protoProps, staticProps) {
6844
6844
  if (protoProps)
6845
6845
  _defineProperties$1(Constructor.prototype, protoProps);
6846
6846
  if (staticProps)
@@ -6850,9 +6850,9 @@ function _createClass$d(Constructor, protoProps, staticProps) {
6850
6850
  });
6851
6851
  return Constructor;
6852
6852
  }
6853
- __name(_createClass$d, "_createClass$d");
6854
- function _extends$o() {
6855
- _extends$o = Object.assign ? Object.assign.bind() : function(target) {
6853
+ __name(_createClass$9, "_createClass$9");
6854
+ function _extends$j() {
6855
+ _extends$j = Object.assign ? Object.assign.bind() : function(target) {
6856
6856
  for (var i = 1; i < arguments.length; i++) {
6857
6857
  var source = arguments[i];
6858
6858
  for (var key in source) {
@@ -6863,9 +6863,9 @@ function _extends$o() {
6863
6863
  }
6864
6864
  return target;
6865
6865
  };
6866
- return _extends$o.apply(this, arguments);
6866
+ return _extends$j.apply(this, arguments);
6867
6867
  }
6868
- __name(_extends$o, "_extends$o");
6868
+ __name(_extends$j, "_extends$j");
6869
6869
  function _inheritsLoose$2(subClass, superClass) {
6870
6870
  subClass.prototype = Object.create(superClass.prototype);
6871
6871
  subClass.prototype.constructor = subClass;
@@ -6960,7 +6960,7 @@ function createDecoratorAnnotation(annotation) {
6960
6960
  __name(createDecoratorAnnotation, "createDecoratorAnnotation");
6961
6961
  function storeAnnotation(prototype, key, annotation) {
6962
6962
  if (!hasProp(prototype, storedAnnotationsSymbol)) {
6963
- addHiddenProp(prototype, storedAnnotationsSymbol, _extends$o({}, prototype[storedAnnotationsSymbol]));
6963
+ addHiddenProp(prototype, storedAnnotationsSymbol, _extends$j({}, prototype[storedAnnotationsSymbol]));
6964
6964
  }
6965
6965
  if (!isOverride(annotation)) {
6966
6966
  prototype[storedAnnotationsSymbol][key] = annotation;
@@ -6969,7 +6969,7 @@ function storeAnnotation(prototype, key, annotation) {
6969
6969
  __name(storeAnnotation, "storeAnnotation");
6970
6970
  function collectStoredAnnotations(target) {
6971
6971
  if (!hasProp(target, storedAnnotationsSymbol)) {
6972
- addHiddenProp(target, storedAnnotationsSymbol, _extends$o({}, target[storedAnnotationsSymbol]));
6972
+ addHiddenProp(target, storedAnnotationsSymbol, _extends$j({}, target[storedAnnotationsSymbol]));
6973
6973
  }
6974
6974
  return target[storedAnnotationsSymbol];
6975
6975
  }
@@ -7297,7 +7297,7 @@ function make_$3(adm, key, descriptor2) {
7297
7297
  __name(make_$3, "make_$3");
7298
7298
  function extend_$3(adm, key, descriptor2, proxyTrap) {
7299
7299
  assertComputedDescriptor(adm, this, key, descriptor2);
7300
- return adm.defineComputedProperty_(key, _extends$o({}, this.options_, {
7300
+ return adm.defineComputedProperty_(key, _extends$j({}, this.options_, {
7301
7301
  get: descriptor2.get,
7302
7302
  set: descriptor2.set
7303
7303
  }), proxyTrap);
@@ -7714,7 +7714,7 @@ var ObservableValue = /* @__PURE__ */ function(_Atom) {
7714
7714
  return this.name_ + "[" + this.value_ + "]";
7715
7715
  }, "toString");
7716
7716
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
7717
- return toPrimitive$3(this.get());
7717
+ return toPrimitive$2(this.get());
7718
7718
  }, "valueOf");
7719
7719
  _proto[_Symbol$toPrimitive] = function() {
7720
7720
  return this.valueOf();
@@ -7899,7 +7899,7 @@ var ComputedValue = /* @__PURE__ */ function() {
7899
7899
  return this.name_ + "[" + this.derivation.toString() + "]";
7900
7900
  }, "toString");
7901
7901
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
7902
- return toPrimitive$3(this.get());
7902
+ return toPrimitive$2(this.get());
7903
7903
  }, "valueOf");
7904
7904
  _proto[_Symbol$toPrimitive$1] = function() {
7905
7905
  return this.valueOf();
@@ -9644,7 +9644,7 @@ var ObservableMap = /* @__PURE__ */ function() {
9644
9644
  _proto.intercept_ = /* @__PURE__ */ __name(function intercept_(handler) {
9645
9645
  return registerInterceptor(this, handler);
9646
9646
  }, "intercept_");
9647
- _createClass$d(ObservableMap2, [{
9647
+ _createClass$9(ObservableMap2, [{
9648
9648
  key: "size",
9649
9649
  get: /* @__PURE__ */ __name(function get5() {
9650
9650
  this.keysAtom_.reportObserved();
@@ -9878,7 +9878,7 @@ var ObservableSet = /* @__PURE__ */ function() {
9878
9878
  _proto[_Symbol$iterator$1] = function() {
9879
9879
  return this.values();
9880
9880
  };
9881
- _createClass$d(ObservableSet2, [{
9881
+ _createClass$9(ObservableSet2, [{
9882
9882
  key: "size",
9883
9883
  get: /* @__PURE__ */ __name(function get5() {
9884
9884
  this.atom_.reportObserved();
@@ -10074,7 +10074,7 @@ var ObservableObjectAdministration = /* @__PURE__ */ function() {
10074
10074
  }
10075
10075
  var newValue = change.newValue;
10076
10076
  if (descriptor2.value !== newValue) {
10077
- descriptor2 = _extends$o({}, descriptor2, {
10077
+ descriptor2 = _extends$j({}, descriptor2, {
10078
10078
  value: newValue
10079
10079
  });
10080
10080
  }
@@ -10402,7 +10402,7 @@ var LegacyObservableArray = /* @__PURE__ */ function(_StubArray, _Symbol$toStrin
10402
10402
  }, "next")
10403
10403
  });
10404
10404
  };
10405
- _createClass$d(LegacyObservableArray2, [{
10405
+ _createClass$9(LegacyObservableArray2, [{
10406
10406
  key: "length",
10407
10407
  get: /* @__PURE__ */ __name(function get5() {
10408
10408
  return this[$mobx].getArrayLength_();
@@ -12533,7 +12533,7 @@ lodash.exports;
12533
12533
  "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
12534
12534
  );
12535
12535
  var Buffer2 = moduleExports2 ? context.Buffer : undefined$12, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe2 = Buffer2 ? Buffer2.allocUnsafe : undefined$12, getPrototype2 = overArg2(Object2.getPrototypeOf, Object2), objectCreate2 = Object2.create, propertyIsEnumerable3 = objectProto2.propertyIsEnumerable, splice3 = arrayProto2.splice, spreadableSymbol2 = Symbol2 ? Symbol2.isConcatSpreadable : undefined$12, symIterator = Symbol2 ? Symbol2.iterator : undefined$12, symToStringTag2 = Symbol2 ? Symbol2.toStringTag : undefined$12;
12536
- var defineProperty6 = function() {
12536
+ var defineProperty5 = function() {
12537
12537
  try {
12538
12538
  var func = getNative2(Object2, "defineProperty");
12539
12539
  func({}, "", {});
@@ -12973,8 +12973,8 @@ lodash.exports;
12973
12973
  }
12974
12974
  __name(baseAssignIn2, "baseAssignIn");
12975
12975
  function baseAssignValue2(object2, key, value) {
12976
- if (key == "__proto__" && defineProperty6) {
12977
- defineProperty6(object2, key, {
12976
+ if (key == "__proto__" && defineProperty5) {
12977
+ defineProperty5(object2, key, {
12978
12978
  "configurable": true,
12979
12979
  "enumerable": true,
12980
12980
  "value": value,
@@ -13707,8 +13707,8 @@ lodash.exports;
13707
13707
  metaMap.set(func, data);
13708
13708
  return func;
13709
13709
  };
13710
- var baseSetToString2 = !defineProperty6 ? identity3 : function(func, string2) {
13711
- return defineProperty6(func, "toString", {
13710
+ var baseSetToString2 = !defineProperty5 ? identity3 : function(func, string2) {
13711
+ return defineProperty5(func, "toString", {
13712
13712
  "configurable": true,
13713
13713
  "enumerable": false,
13714
13714
  "value": constant2(string2),
@@ -17736,8 +17736,8 @@ lodash.exports;
17736
17736
  }).call(commonjsGlobal);
17737
17737
  })(lodash, lodash.exports);
17738
17738
  var lodashExports = lodash.exports;
17739
- function _extends$n() {
17740
- _extends$n = Object.assign ? Object.assign.bind() : function(target) {
17739
+ function _extends$i() {
17740
+ _extends$i = Object.assign ? Object.assign.bind() : function(target) {
17741
17741
  for (var i = 1; i < arguments.length; i++) {
17742
17742
  var source = arguments[i];
17743
17743
  for (var key in source) {
@@ -17748,9 +17748,9 @@ function _extends$n() {
17748
17748
  }
17749
17749
  return target;
17750
17750
  };
17751
- return _extends$n.apply(this, arguments);
17751
+ return _extends$i.apply(this, arguments);
17752
17752
  }
17753
- __name(_extends$n, "_extends$n");
17753
+ __name(_extends$i, "_extends$i");
17754
17754
  function _setPrototypeOf$2(o2, p2) {
17755
17755
  _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf3(o3, p3) {
17756
17756
  o3.__proto__ = p3;
@@ -17945,7 +17945,7 @@ var mapProps = /* @__PURE__ */ __name(function mapProps2(propsMapper) {
17945
17945
  }, "mapProps");
17946
17946
  var withProps = /* @__PURE__ */ __name(function withProps2(input) {
17947
17947
  var hoc = mapProps(function(props) {
17948
- return _extends$n({}, props, typeof input === "function" ? input(props) : input);
17948
+ return _extends$i({}, props, typeof input === "function" ? input(props) : input);
17949
17949
  });
17950
17950
  return hoc;
17951
17951
  }, "withProps");
@@ -17980,7 +17980,7 @@ var withHandlers = /* @__PURE__ */ __name(function withHandlers2(handlers2) {
17980
17980
  __name(WithHandlers2, "WithHandlers");
17981
17981
  var _proto = WithHandlers2.prototype;
17982
17982
  _proto.render = /* @__PURE__ */ __name(function render3() {
17983
- return factory(_extends$n({}, this.props, this.handlers));
17983
+ return factory(_extends$i({}, this.props, this.handlers));
17984
17984
  }, "render");
17985
17985
  return WithHandlers2;
17986
17986
  }(React$1.Component);
@@ -18015,7 +18015,7 @@ var withState = /* @__PURE__ */ __name(function withState2(stateName, stateUpdat
18015
18015
  var _proto = WithState2.prototype;
18016
18016
  _proto.render = /* @__PURE__ */ __name(function render3() {
18017
18017
  var _extends2;
18018
- return factory(_extends$n({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2)));
18018
+ return factory(_extends$i({}, this.props, (_extends2 = {}, _extends2[stateName] = this.state.stateValue, _extends2[stateUpdaterName] = this.updateStateValue, _extends2)));
18019
18019
  }, "render");
18020
18020
  return WithState2;
18021
18021
  }(React$1.Component);
@@ -18075,7 +18075,7 @@ var lifecycle = /* @__PURE__ */ __name(function lifecycle2(spec) {
18075
18075
  __name(Lifecycle3, "Lifecycle");
18076
18076
  var _proto = Lifecycle3.prototype;
18077
18077
  _proto.render = /* @__PURE__ */ __name(function render3() {
18078
- return factory(_extends$n({}, this.props, this.state));
18078
+ return factory(_extends$i({}, this.props, this.state));
18079
18079
  }, "render");
18080
18080
  return Lifecycle3;
18081
18081
  }(React$1.Component);
@@ -18257,11 +18257,20 @@ var _fails = /* @__PURE__ */ __name(function(exec) {
18257
18257
  return true;
18258
18258
  }
18259
18259
  }, "_fails");
18260
- var _descriptors = !_fails(function() {
18261
- return Object.defineProperty({}, "a", { get: function() {
18262
- return 7;
18263
- } }).a != 7;
18264
- });
18260
+ var _descriptors;
18261
+ var hasRequired_descriptors;
18262
+ function require_descriptors() {
18263
+ if (hasRequired_descriptors)
18264
+ return _descriptors;
18265
+ hasRequired_descriptors = 1;
18266
+ _descriptors = !_fails(function() {
18267
+ return Object.defineProperty({}, "a", { get: function() {
18268
+ return 7;
18269
+ } }).a != 7;
18270
+ });
18271
+ return _descriptors;
18272
+ }
18273
+ __name(require_descriptors, "require_descriptors");
18265
18274
  var _domCreate;
18266
18275
  var hasRequired_domCreate;
18267
18276
  function require_domCreate() {
@@ -18277,11 +18286,20 @@ function require_domCreate() {
18277
18286
  return _domCreate;
18278
18287
  }
18279
18288
  __name(require_domCreate, "require_domCreate");
18280
- var _ie8DomDefine = !_descriptors && !_fails(function() {
18281
- return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
18282
- return 7;
18283
- } }).a != 7;
18284
- });
18289
+ var _ie8DomDefine;
18290
+ var hasRequired_ie8DomDefine;
18291
+ function require_ie8DomDefine() {
18292
+ if (hasRequired_ie8DomDefine)
18293
+ return _ie8DomDefine;
18294
+ hasRequired_ie8DomDefine = 1;
18295
+ _ie8DomDefine = !require_descriptors() && !_fails(function() {
18296
+ return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
18297
+ return 7;
18298
+ } }).a != 7;
18299
+ });
18300
+ return _ie8DomDefine;
18301
+ }
18302
+ __name(require_ie8DomDefine, "require_ie8DomDefine");
18285
18303
  var isObject$d = _isObject;
18286
18304
  var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
18287
18305
  if (!isObject$d(it))
@@ -18295,25 +18313,33 @@ var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
18295
18313
  return val;
18296
18314
  throw TypeError("Can't convert object to primitive value");
18297
18315
  }, "_toPrimitive");
18298
- var anObject$3 = _anObject;
18299
- var IE8_DOM_DEFINE$1 = _ie8DomDefine;
18300
- var toPrimitive$2 = _toPrimitive;
18301
- var dP$2 = Object.defineProperty;
18302
- _objectDp.f = _descriptors ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty2(O2, P2, Attributes) {
18303
- anObject$3(O2);
18304
- P2 = toPrimitive$2(P2, true);
18305
- anObject$3(Attributes);
18306
- if (IE8_DOM_DEFINE$1)
18307
- try {
18308
- return dP$2(O2, P2, Attributes);
18309
- } catch (e2) {
18310
- }
18311
- if ("get" in Attributes || "set" in Attributes)
18312
- throw TypeError("Accessors not supported!");
18313
- if ("value" in Attributes)
18314
- O2[P2] = Attributes.value;
18315
- return O2;
18316
- }, "defineProperty");
18316
+ var hasRequired_objectDp;
18317
+ function require_objectDp() {
18318
+ if (hasRequired_objectDp)
18319
+ return _objectDp;
18320
+ hasRequired_objectDp = 1;
18321
+ var anObject2 = _anObject;
18322
+ var IE8_DOM_DEFINE2 = require_ie8DomDefine();
18323
+ var toPrimitive2 = _toPrimitive;
18324
+ var dP2 = Object.defineProperty;
18325
+ _objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty5(O2, P2, Attributes) {
18326
+ anObject2(O2);
18327
+ P2 = toPrimitive2(P2, true);
18328
+ anObject2(Attributes);
18329
+ if (IE8_DOM_DEFINE2)
18330
+ try {
18331
+ return dP2(O2, P2, Attributes);
18332
+ } catch (e2) {
18333
+ }
18334
+ if ("get" in Attributes || "set" in Attributes)
18335
+ throw TypeError("Accessors not supported!");
18336
+ if ("value" in Attributes)
18337
+ O2[P2] = Attributes.value;
18338
+ return O2;
18339
+ }, "defineProperty");
18340
+ return _objectDp;
18341
+ }
18342
+ __name(require_objectDp, "require_objectDp");
18317
18343
  var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
18318
18344
  return {
18319
18345
  enumerable: !(bitmap & 1),
@@ -18322,9 +18348,9 @@ var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
18322
18348
  value
18323
18349
  };
18324
18350
  }, "_propertyDesc");
18325
- var dP$1 = _objectDp;
18351
+ var dP$1 = require_objectDp();
18326
18352
  var createDesc$3 = _propertyDesc;
18327
- var _hide = _descriptors ? function(object2, key, value) {
18353
+ var _hide = require_descriptors() ? function(object2, key, value) {
18328
18354
  return dP$1.f(object2, key, createDesc$3(1, value));
18329
18355
  } : function(object2, key, value) {
18330
18356
  object2[key] = value;
@@ -18396,16 +18422,25 @@ var toString$6 = {}.toString;
18396
18422
  var _cof = /* @__PURE__ */ __name(function(it) {
18397
18423
  return toString$6.call(it).slice(8, -1);
18398
18424
  }, "_cof");
18399
- var cof$2 = _cof;
18400
- var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
18401
- return cof$2(it) == "String" ? it.split("") : Object(it);
18402
- };
18425
+ var _iobject;
18426
+ var hasRequired_iobject;
18427
+ function require_iobject() {
18428
+ if (hasRequired_iobject)
18429
+ return _iobject;
18430
+ hasRequired_iobject = 1;
18431
+ var cof2 = _cof;
18432
+ _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
18433
+ return cof2(it) == "String" ? it.split("") : Object(it);
18434
+ };
18435
+ return _iobject;
18436
+ }
18437
+ __name(require_iobject, "require_iobject");
18403
18438
  var _defined = /* @__PURE__ */ __name(function(it) {
18404
18439
  if (it == void 0)
18405
18440
  throw TypeError("Can't call method on " + it);
18406
18441
  return it;
18407
18442
  }, "_defined");
18408
- var IObject = _iobject;
18443
+ var IObject = require_iobject();
18409
18444
  var defined$2 = _defined;
18410
18445
  var _toIobject = /* @__PURE__ */ __name(function(it) {
18411
18446
  return IObject(defined$2(it));
@@ -18521,12 +18556,12 @@ function require_objectAssign() {
18521
18556
  if (hasRequired_objectAssign)
18522
18557
  return _objectAssign;
18523
18558
  hasRequired_objectAssign = 1;
18524
- var DESCRIPTORS2 = _descriptors;
18559
+ var DESCRIPTORS2 = require_descriptors();
18525
18560
  var getKeys2 = _objectKeys;
18526
18561
  var gOPS2 = _objectGops;
18527
18562
  var pIE2 = require_objectPie();
18528
18563
  var toObject2 = _toObject;
18529
- var IObject2 = _iobject;
18564
+ var IObject2 = require_iobject();
18530
18565
  var $assign = Object.assign;
18531
18566
  _objectAssign = !$assign || _fails(function() {
18532
18567
  var A2 = {};
@@ -18593,10 +18628,10 @@ function require_objectDps() {
18593
18628
  if (hasRequired_objectDps)
18594
18629
  return _objectDps;
18595
18630
  hasRequired_objectDps = 1;
18596
- var dP2 = _objectDp;
18631
+ var dP2 = require_objectDp();
18597
18632
  var anObject2 = _anObject;
18598
18633
  var getKeys2 = _objectKeys;
18599
- _objectDps = _descriptors ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties2(O2, Properties) {
18634
+ _objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties2(O2, Properties) {
18600
18635
  anObject2(O2);
18601
18636
  var keys3 = getKeys2(Properties);
18602
18637
  var length = keys3.length;
@@ -18675,7 +18710,7 @@ var $exports = _wks.exports = function(name) {
18675
18710
  };
18676
18711
  $exports.store = store;
18677
18712
  var _wksExports = _wks.exports;
18678
- var def = _objectDp.f;
18713
+ var def = require_objectDp().f;
18679
18714
  var has$9 = _has;
18680
18715
  var TAG$1 = _wksExports("toStringTag");
18681
18716
  var _setToStringTag = /* @__PURE__ */ __name(function(it, tag, stat) {
@@ -18948,7 +18983,7 @@ var ArrayProto = Array.prototype;
18948
18983
  var _isArrayIter = /* @__PURE__ */ __name(function(it) {
18949
18984
  return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
18950
18985
  }, "_isArrayIter");
18951
- var $defineProperty$1 = _objectDp;
18986
+ var $defineProperty$1 = require_objectDp();
18952
18987
  var createDesc$2 = _propertyDesc;
18953
18988
  var _createProperty = /* @__PURE__ */ __name(function(object2, index2, value) {
18954
18989
  if (index2 in object2)
@@ -19077,14 +19112,14 @@ var _default$8 = /* @__PURE__ */ __name(function(instance, Constructor) {
19077
19112
  }
19078
19113
  }, "_default$8");
19079
19114
  var $export$3 = _export;
19080
- $export$3($export$3.S + $export$3.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
19115
+ $export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: require_objectDp().f });
19081
19116
  var $Object$2 = _coreExports.Object;
19082
- var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty3(it, key, desc) {
19117
+ var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty2(it, key, desc) {
19083
19118
  return $Object$2.defineProperty(it, key, desc);
19084
19119
  }, "defineProperty");
19085
19120
  var defineProperty$8 = { "default": defineProperty$9, __esModule: true };
19086
- var _defineProperty$7 = defineProperty$8;
19087
- var _defineProperty2 = _interopRequireDefault$e(_defineProperty$7);
19121
+ var _defineProperty$6 = defineProperty$8;
19122
+ var _defineProperty2 = _interopRequireDefault$e(_defineProperty$6);
19088
19123
  function _interopRequireDefault$e(obj) {
19089
19124
  return obj && obj.__esModule ? obj : { default: obj };
19090
19125
  }
@@ -19118,7 +19153,7 @@ var _meta = { exports: {} };
19118
19153
  var META$1 = _uid("meta");
19119
19154
  var isObject$c = _isObject;
19120
19155
  var has$7 = _has;
19121
- var setDesc = _objectDp.f;
19156
+ var setDesc = require_objectDp().f;
19122
19157
  var id = 0;
19123
19158
  var isExtensible = Object.isExtensible || function() {
19124
19159
  return true;
@@ -19171,7 +19206,7 @@ var meta = _meta.exports = {
19171
19206
  var _metaExports = _meta.exports;
19172
19207
  var core = _coreExports;
19173
19208
  var wksExt$1 = _wksExt;
19174
- var defineProperty$7 = _objectDp.f;
19209
+ var defineProperty$7 = require_objectDp().f;
19175
19210
  var _wksDefine = /* @__PURE__ */ __name(function(name) {
19176
19211
  var $Symbol2 = core.Symbol || (core.Symbol = {});
19177
19212
  if (name.charAt(0) != "_" && !(name in $Symbol2))
@@ -19225,9 +19260,9 @@ var createDesc$1 = _propertyDesc;
19225
19260
  var toIObject$1 = _toIobject;
19226
19261
  var toPrimitive$1 = _toPrimitive;
19227
19262
  var has$6 = _has;
19228
- var IE8_DOM_DEFINE = _ie8DomDefine;
19263
+ var IE8_DOM_DEFINE = require_ie8DomDefine();
19229
19264
  var gOPD$2 = Object.getOwnPropertyDescriptor;
19230
- _objectGopd.f = _descriptors ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
19265
+ _objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
19231
19266
  O2 = toIObject$1(O2);
19232
19267
  P2 = toPrimitive$1(P2, true);
19233
19268
  if (IE8_DOM_DEFINE)
@@ -19240,7 +19275,7 @@ _objectGopd.f = _descriptors ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPr
19240
19275
  }, "getOwnPropertyDescriptor");
19241
19276
  var global$1 = _globalExports;
19242
19277
  var has$5 = _has;
19243
- var DESCRIPTORS = _descriptors;
19278
+ var DESCRIPTORS = require_descriptors();
19244
19279
  var $export$2 = _export;
19245
19280
  var redefine = _redefine;
19246
19281
  var META = _metaExports.KEY;
@@ -19263,7 +19298,7 @@ var _create$1 = require_objectCreate();
19263
19298
  var gOPNExt = _objectGopnExt;
19264
19299
  var $GOPD = _objectGopd;
19265
19300
  var $GOPS = _objectGops;
19266
- var $DP = _objectDp;
19301
+ var $DP = require_objectDp();
19267
19302
  var $keys$1 = _objectKeys;
19268
19303
  var gOPD$1 = $GOPD.f;
19269
19304
  var dP = $DP.f;
@@ -19306,7 +19341,7 @@ var isSymbol$8 = USE_NATIVE && typeof $Symbol.iterator == "symbol" ? function(it
19306
19341
  } : function(it) {
19307
19342
  return it instanceof $Symbol;
19308
19343
  };
19309
- var $defineProperty = /* @__PURE__ */ __name(function defineProperty4(it, key, D2) {
19344
+ var $defineProperty = /* @__PURE__ */ __name(function defineProperty3(it, key, D2) {
19310
19345
  if (it === ObjectProto)
19311
19346
  $defineProperty(OPSymbols, key, D2);
19312
19347
  anObject(it);
@@ -21164,8 +21199,8 @@ var defineProperty$6 = function() {
21164
21199
  } catch (e2) {
21165
21200
  }
21166
21201
  }();
21167
- var _defineProperty$6 = defineProperty$6;
21168
- var constant$1 = constant_1, defineProperty$5 = _defineProperty$6, identity$3 = identity_1;
21202
+ var _defineProperty$5 = defineProperty$6;
21203
+ var constant$1 = constant_1, defineProperty$5 = _defineProperty$5, identity$3 = identity_1;
21169
21204
  var baseSetToString$3 = !defineProperty$5 ? identity$3 : function(func, string2) {
21170
21205
  return defineProperty$5(func, "toString", {
21171
21206
  "configurable": true,
@@ -22225,7 +22260,7 @@ function _typeof$4(obj) {
22225
22260
  return _typeof$4(obj);
22226
22261
  }
22227
22262
  __name(_typeof$4, "_typeof$4");
22228
- function _defineProperty$5(obj, key, value) {
22263
+ function _defineProperty$4(obj, key, value) {
22229
22264
  if (key in obj) {
22230
22265
  Object.defineProperty(obj, key, {
22231
22266
  value,
@@ -22238,7 +22273,7 @@ function _defineProperty$5(obj, key, value) {
22238
22273
  }
22239
22274
  return obj;
22240
22275
  }
22241
- __name(_defineProperty$5, "_defineProperty$5");
22276
+ __name(_defineProperty$4, "_defineProperty$4");
22242
22277
  function ownKeys$2(object2, enumerableOnly) {
22243
22278
  var keys3 = Object.keys(object2);
22244
22279
  if (Object.getOwnPropertySymbols) {
@@ -22257,7 +22292,7 @@ function _objectSpread2(target) {
22257
22292
  var source = arguments[i] != null ? arguments[i] : {};
22258
22293
  if (i % 2) {
22259
22294
  ownKeys$2(source, true).forEach(function(key) {
22260
- _defineProperty$5(target, key, source[key]);
22295
+ _defineProperty$4(target, key, source[key]);
22261
22296
  });
22262
22297
  } else if (Object.getOwnPropertyDescriptors) {
22263
22298
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
@@ -23238,7 +23273,7 @@ var reactList = {};
23238
23273
  key: "getSizeOfItem",
23239
23274
  value: /* @__PURE__ */ __name(function getSizeOfItem(index2) {
23240
23275
  var cache = this.cache, items = this.items;
23241
- var _this$props6 = this.props, axis = _this$props6.axis, itemSizeGetter = _this$props6.itemSizeGetter, itemSizeEstimator3 = _this$props6.itemSizeEstimator, type = _this$props6.type;
23276
+ var _this$props6 = this.props, axis = _this$props6.axis, itemSizeGetter = _this$props6.itemSizeGetter, itemSizeEstimator2 = _this$props6.itemSizeEstimator, type = _this$props6.type;
23242
23277
  var _this$state4 = this.state, from3 = _this$state4.from, itemSize = _this$state4.itemSize, size = _this$state4.size;
23243
23278
  if (itemSize)
23244
23279
  return itemSize;
@@ -23251,8 +23286,8 @@ var reactList = {};
23251
23286
  if (itemEl)
23252
23287
  return itemEl[OFFSET_SIZE_KEYS[axis]];
23253
23288
  }
23254
- if (itemSizeEstimator3)
23255
- return itemSizeEstimator3(index2, cache);
23289
+ if (itemSizeEstimator2)
23290
+ return itemSizeEstimator2(index2, cache);
23256
23291
  }, "getSizeOfItem")
23257
23292
  }, {
23258
23293
  key: "constrain",
@@ -23428,29 +23463,6 @@ var reactList = {};
23428
23463
  });
23429
23464
  })(reactList);
23430
23465
  const ReactList = /* @__PURE__ */ getDefaultExportFromCjs(reactList);
23431
- var _extends$m = Object.assign || function(target) {
23432
- for (var i = 1; i < arguments.length; i++) {
23433
- var source = arguments[i];
23434
- for (var key in source) {
23435
- if (Object.prototype.hasOwnProperty.call(source, key)) {
23436
- target[key] = source[key];
23437
- }
23438
- }
23439
- }
23440
- return target;
23441
- };
23442
- function _objectWithoutProperties$6(obj, keys3) {
23443
- var target = {};
23444
- for (var i in obj) {
23445
- if (keys3.indexOf(i) >= 0)
23446
- continue;
23447
- if (!Object.prototype.hasOwnProperty.call(obj, i))
23448
- continue;
23449
- target[i] = obj[i];
23450
- }
23451
- return target;
23452
- }
23453
- __name(_objectWithoutProperties$6, "_objectWithoutProperties$6");
23454
23466
  const _ = {
23455
23467
  get: get$3,
23456
23468
  set: set4,
@@ -23475,24 +23487,19 @@ function get$3(obj, path2, def2) {
23475
23487
  if (!path2) {
23476
23488
  return obj;
23477
23489
  }
23478
- var pathObj = makePathArray(path2);
23479
- var val = void 0;
23490
+ const pathObj = makePathArray(path2);
23491
+ let val;
23480
23492
  try {
23481
- val = pathObj.reduce(function(current, pathPart) {
23482
- return current[pathPart];
23483
- }, obj);
23493
+ val = pathObj.reduce((current, pathPart) => current[pathPart], obj);
23484
23494
  } catch (e2) {
23485
23495
  }
23486
23496
  return typeof val !== "undefined" ? val : def2;
23487
23497
  }
23488
23498
  __name(get$3, "get$3");
23489
- function set4() {
23490
- var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
23491
- var path2 = arguments[1];
23492
- var value = arguments[2];
23493
- var keys3 = makePathArray(path2);
23494
- var keyPart = void 0;
23495
- var cursor = obj;
23499
+ function set4(obj = {}, path2, value) {
23500
+ const keys3 = makePathArray(path2);
23501
+ let keyPart;
23502
+ let cursor = obj;
23496
23503
  while ((keyPart = keys3.shift()) && keys3.length) {
23497
23504
  if (!cursor[keyPart]) {
23498
23505
  cursor[keyPart] = {};
@@ -23504,7 +23511,7 @@ function set4() {
23504
23511
  }
23505
23512
  __name(set4, "set");
23506
23513
  function takeRight(arr, n2) {
23507
- var start2 = n2 > arr.length ? 0 : arr.length - n2;
23514
+ const start2 = n2 > arr.length ? 0 : arr.length - n2;
23508
23515
  return arr.slice(start2);
23509
23516
  }
23510
23517
  __name(takeRight, "takeRight");
@@ -23513,19 +23520,19 @@ function last(arr) {
23513
23520
  }
23514
23521
  __name(last, "last");
23515
23522
  function range(n2) {
23516
- var arr = [];
23517
- for (var i = 0; i < n2; i += 1) {
23523
+ const arr = [];
23524
+ for (let i = 0; i < n2; i += 1) {
23518
23525
  arr.push(n2);
23519
23526
  }
23520
23527
  return arr;
23521
23528
  }
23522
23529
  __name(range, "range");
23523
23530
  function orderBy(arr, funcs, dirs, indexKey) {
23524
- return arr.sort(function(rowA, rowB) {
23525
- for (var i = 0; i < funcs.length; i += 1) {
23526
- var comp = funcs[i];
23527
- var desc = dirs[i] === false || dirs[i] === "desc";
23528
- var sortInt = comp(rowA, rowB);
23531
+ return arr.sort((rowA, rowB) => {
23532
+ for (let i = 0; i < funcs.length; i += 1) {
23533
+ const comp = funcs[i];
23534
+ const desc = dirs[i] === false || dirs[i] === "desc";
23535
+ const sortInt = comp(rowA, rowB);
23529
23536
  if (sortInt) {
23530
23537
  return desc ? -sortInt : sortInt;
23531
23538
  }
@@ -23535,8 +23542,8 @@ function orderBy(arr, funcs, dirs, indexKey) {
23535
23542
  }
23536
23543
  __name(orderBy, "orderBy");
23537
23544
  function remove2(a2, b2) {
23538
- return a2.filter(function(o2, i) {
23539
- var r2 = b2(o2);
23545
+ return a2.filter((o2, i) => {
23546
+ const r2 = b2(o2);
23540
23547
  if (r2) {
23541
23548
  a2.splice(i, 1);
23542
23549
  return true;
@@ -23547,50 +23554,46 @@ function remove2(a2, b2) {
23547
23554
  __name(remove2, "remove");
23548
23555
  function clone2(a2) {
23549
23556
  try {
23550
- return JSON.parse(JSON.stringify(a2, function(key, value) {
23551
- if (typeof value === "function") {
23552
- return value.toString();
23553
- }
23554
- return value;
23555
- }));
23557
+ return JSON.parse(
23558
+ JSON.stringify(a2, (key, value) => {
23559
+ if (typeof value === "function") {
23560
+ return value.toString();
23561
+ }
23562
+ return value;
23563
+ })
23564
+ );
23556
23565
  } catch (e2) {
23557
23566
  return a2;
23558
23567
  }
23559
23568
  }
23560
23569
  __name(clone2, "clone");
23561
- function getFirstDefined() {
23562
- for (var i = 0; i < arguments.length; i += 1) {
23563
- if (typeof (arguments.length <= i ? void 0 : arguments[i]) !== "undefined") {
23564
- return arguments.length <= i ? void 0 : arguments[i];
23570
+ function getFirstDefined(...args) {
23571
+ for (let i = 0; i < args.length; i += 1) {
23572
+ if (typeof args[i] !== "undefined") {
23573
+ return args[i];
23565
23574
  }
23566
23575
  }
23567
23576
  }
23568
23577
  __name(getFirstDefined, "getFirstDefined");
23569
23578
  function sum(arr) {
23570
- return arr.reduce(function(a2, b2) {
23571
- return a2 + b2;
23572
- }, 0);
23579
+ return arr.reduce((a2, b2) => a2 + b2, 0);
23573
23580
  }
23574
23581
  __name(sum, "sum");
23575
23582
  function makeTemplateComponent(compClass, displayName) {
23576
23583
  if (!displayName) {
23577
23584
  throw new Error("No displayName found for template component:", compClass);
23578
23585
  }
23579
- var cmp = /* @__PURE__ */ __name(function cmp2(_ref) {
23580
- var children = _ref.children, className = _ref.className, rest = _objectWithoutProperties$6(_ref, ["children", "className"]);
23581
- return React$1.createElement(
23582
- "div",
23583
- _extends$m({ className: classNames(compClass, className) }, rest),
23584
- children
23585
- );
23586
+ const cmp = /* @__PURE__ */ __name((_a2) => {
23587
+ var _b = _a2, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
23588
+ return /* @__PURE__ */ React$1.createElement("div", __spreadValues({ className: classNames(compClass, className) }, rest), children);
23586
23589
  }, "cmp");
23587
23590
  cmp.displayName = displayName;
23588
23591
  return cmp;
23589
23592
  }
23590
23593
  __name(makeTemplateComponent, "makeTemplateComponent");
23591
23594
  function groupBy(xs, key) {
23592
- return xs.reduce(function(rv, x2, i) {
23593
- var resKey = typeof key === "function" ? key(x2, i) : x2[key];
23595
+ return xs.reduce((rv, x2, i) => {
23596
+ const resKey = typeof key === "function" ? key(x2, i) : x2[key];
23594
23597
  rv[resKey] = isArray$b(rv[resKey]) ? rv[resKey] : [];
23595
23598
  rv[resKey].push(x2);
23596
23599
  return rv;
@@ -23599,7 +23602,7 @@ function groupBy(xs, key) {
23599
23602
  __name(groupBy, "groupBy");
23600
23603
  function asPx(value) {
23601
23604
  value = Number(value);
23602
- return Number.isNaN(value) ? null : value + "px";
23605
+ return Number.isNaN(value) ? null : `${value}px`;
23603
23606
  }
23604
23607
  __name(asPx, "asPx");
23605
23608
  function isArray$b(a2) {
@@ -23610,20 +23613,19 @@ function makePathArray(obj) {
23610
23613
  return flattenDeep(obj).join(".").replace(/\[/g, ".").replace(/\]/g, "").split(".");
23611
23614
  }
23612
23615
  __name(makePathArray, "makePathArray");
23613
- function flattenDeep(arr) {
23614
- var newArr = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
23616
+ function flattenDeep(arr, newArr = []) {
23615
23617
  if (!isArray$b(arr)) {
23616
23618
  newArr.push(arr);
23617
23619
  } else {
23618
- for (var i = 0; i < arr.length; i += 1) {
23620
+ for (let i = 0; i < arr.length; i += 1) {
23619
23621
  flattenDeep(arr[i], newArr);
23620
23622
  }
23621
23623
  }
23622
23624
  return newArr;
23623
23625
  }
23624
23626
  __name(flattenDeep, "flattenDeep");
23625
- function splitProps(_ref2) {
23626
- var className = _ref2.className, style2 = _ref2.style, rest = _objectWithoutProperties$6(_ref2, ["className", "style"]);
23627
+ function splitProps(_c) {
23628
+ var _d = _c, { className, style: style2 } = _d, rest = __objRest(_d, ["className", "style"]);
23627
23629
  return {
23628
23630
  className,
23629
23631
  style: style2,
@@ -23632,9 +23634,9 @@ function splitProps(_ref2) {
23632
23634
  }
23633
23635
  __name(splitProps, "splitProps");
23634
23636
  function compactObject(obj) {
23635
- var newObj = {};
23637
+ const newObj = {};
23636
23638
  if (obj) {
23637
- Object.keys(obj).map(function(key) {
23639
+ Object.keys(obj).map((key) => {
23638
23640
  if (Object.prototype.hasOwnProperty.call(obj, key) && obj[key] !== void 0 && typeof obj[key] !== "undefined") {
23639
23641
  newObj[key] = obj[key];
23640
23642
  }
@@ -23648,1084 +23650,744 @@ function isSortingDesc(d2) {
23648
23650
  return !!(d2.sort === "desc" || d2.desc === true || d2.asc === false);
23649
23651
  }
23650
23652
  __name(isSortingDesc, "isSortingDesc");
23651
- function normalizeComponent(Comp) {
23652
- var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
23653
- var fallback = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Comp;
23654
- return typeof Comp === "function" ? Object.getPrototypeOf(Comp).isReactComponent ? React$1.createElement(Comp, params) : Comp(params) : fallback;
23653
+ function normalizeComponent(Comp, params = {}, fallback = Comp) {
23654
+ return typeof Comp === "function" ? Object.getPrototypeOf(Comp).isReactComponent ? /* @__PURE__ */ React$1.createElement(Comp, __spreadValues({}, params)) : Comp(params) : fallback;
23655
23655
  }
23656
23656
  __name(normalizeComponent, "normalizeComponent");
23657
- var _createClass$c = function() {
23658
- function defineProperties2(target, props) {
23659
- for (var i = 0; i < props.length; i++) {
23660
- var descriptor2 = props[i];
23661
- descriptor2.enumerable = descriptor2.enumerable || false;
23662
- descriptor2.configurable = true;
23663
- if ("value" in descriptor2)
23664
- descriptor2.writable = true;
23665
- Object.defineProperty(target, descriptor2.key, descriptor2);
23666
- }
23667
- }
23668
- __name(defineProperties2, "defineProperties");
23669
- return function(Constructor, protoProps, staticProps) {
23670
- if (protoProps)
23671
- defineProperties2(Constructor.prototype, protoProps);
23672
- if (staticProps)
23673
- defineProperties2(Constructor, staticProps);
23674
- return Constructor;
23675
- };
23676
- }();
23677
- function _classCallCheck$h(instance, Constructor) {
23678
- if (!(instance instanceof Constructor)) {
23679
- throw new TypeError("Cannot call a class as a function");
23680
- }
23681
- }
23682
- __name(_classCallCheck$h, "_classCallCheck$h");
23683
- function _possibleConstructorReturn$h(self2, call2) {
23684
- if (!self2) {
23685
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
23657
+ const Lifecycle = /* @__PURE__ */ __name((Base) => class extends Base {
23658
+ UNSAFE_componentWillMount() {
23659
+ this.setStateWithData(this.getDataModel(this.getResolvedState(), true));
23686
23660
  }
23687
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
23688
- }
23689
- __name(_possibleConstructorReturn$h, "_possibleConstructorReturn$h");
23690
- function _inherits$h(subClass, superClass) {
23691
- if (typeof superClass !== "function" && superClass !== null) {
23692
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
23661
+ componentDidMount() {
23662
+ this.fireFetchData();
23693
23663
  }
23694
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
23695
- if (superClass)
23696
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
23697
- }
23698
- __name(_inherits$h, "_inherits$h");
23699
- const Lifecycle = /* @__PURE__ */ __name(function(Base) {
23700
- return function(_Base) {
23701
- _inherits$h(_class, _Base);
23702
- function _class() {
23703
- _classCallCheck$h(this, _class);
23704
- return _possibleConstructorReturn$h(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
23705
- }
23706
- __name(_class, "_class");
23707
- _createClass$c(_class, [{
23708
- key: "UNSAFE_componentWillMount",
23709
- value: /* @__PURE__ */ __name(function UNSAFE_componentWillMount() {
23710
- this.setStateWithData(this.getDataModel(this.getResolvedState(), true));
23711
- }, "UNSAFE_componentWillMount")
23712
- }, {
23713
- key: "componentDidMount",
23714
- value: /* @__PURE__ */ __name(function componentDidMount() {
23715
- this.fireFetchData();
23716
- }, "componentDidMount")
23717
- }, {
23718
- key: "UNSAFE_componentWillReceiveProps",
23719
- value: /* @__PURE__ */ __name(function UNSAFE_componentWillReceiveProps(nextProps, nextState) {
23720
- var oldState = this.getResolvedState();
23721
- var newState = this.getResolvedState(nextProps, nextState);
23722
- var defaultableOptions = ["sorted", "filtered", "resized", "expanded"];
23723
- defaultableOptions.forEach(function(x2) {
23724
- var defaultName = "default" + (x2.charAt(0).toUpperCase() + x2.slice(1));
23725
- if (JSON.stringify(oldState[defaultName]) !== JSON.stringify(newState[defaultName])) {
23726
- newState[x2] = newState[defaultName];
23727
- }
23728
- });
23729
- var resettableOptions = ["sortable", "filterable", "resizable"];
23730
- resettableOptions.forEach(function(x2) {
23731
- if (oldState[x2] !== newState[x2]) {
23732
- var baseName = x2.replace("able", "");
23733
- var optionName = baseName + "ed";
23734
- var defaultName = "default" + (optionName.charAt(0).toUpperCase() + optionName.slice(1));
23735
- newState[optionName] = newState[defaultName];
23736
- }
23737
- });
23738
- if (oldState.data !== newState.data || oldState.columns !== newState.columns || oldState.pivotBy !== newState.pivotBy || oldState.sorted !== newState.sorted || oldState.filtered !== newState.filtered) {
23739
- this.setStateWithData(this.getDataModel(newState, oldState.data !== newState.data));
23740
- }
23741
- }, "UNSAFE_componentWillReceiveProps")
23742
- }, {
23743
- key: "setStateWithData",
23744
- value: /* @__PURE__ */ __name(function setStateWithData(newState, cb) {
23745
- var _this2 = this;
23746
- var oldState = this.getResolvedState();
23747
- var newResolvedState = this.getResolvedState({}, newState);
23748
- var freezeWhenExpanded = newResolvedState.freezeWhenExpanded;
23749
- newResolvedState.frozen = false;
23750
- if (freezeWhenExpanded) {
23751
- var keys3 = Object.keys(newResolvedState.expanded);
23752
- for (var i = 0; i < keys3.length; i += 1) {
23753
- if (newResolvedState.expanded[keys3[i]]) {
23754
- newResolvedState.frozen = true;
23755
- break;
23756
- }
23757
- }
23758
- }
23759
- if (oldState.frozen && !newResolvedState.frozen || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered || oldState.showFilters !== newResolvedState.showFilters || !newResolvedState.frozen && oldState.resolvedData !== newResolvedState.resolvedData) {
23760
- 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) {
23761
- newResolvedState.expanded = {};
23762
- }
23763
- Object.assign(newResolvedState, this.getSortedData(newResolvedState));
23764
- }
23765
- if (oldState.filtered !== newResolvedState.filtered) {
23766
- newResolvedState.page = 0;
23767
- }
23768
- if (newResolvedState.sortedData) {
23769
- newResolvedState.pages = newResolvedState.manual ? newResolvedState.pages : Math.ceil(newResolvedState.sortedData.length / newResolvedState.pageSize);
23770
- newResolvedState.page = newResolvedState.manual ? newResolvedState.page : Math.max(newResolvedState.page >= newResolvedState.pages ? newResolvedState.pages - 1 : newResolvedState.page, 0);
23771
- }
23772
- return this.setState(newResolvedState, function() {
23773
- if (cb) {
23774
- cb();
23775
- }
23776
- if (oldState.page !== newResolvedState.page || oldState.pageSize !== newResolvedState.pageSize || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered) {
23777
- _this2.fireFetchData();
23778
- }
23779
- });
23780
- }, "setStateWithData")
23781
- }]);
23782
- return _class;
23783
- }(Base);
23784
- }, "Lifecycle");
23785
- var _slicedToArray$4 = function() {
23786
- function sliceIterator(arr, i) {
23787
- var _arr = [];
23788
- var _n = true;
23789
- var _d = false;
23790
- var _e = void 0;
23791
- try {
23792
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
23793
- _arr.push(_s.value);
23794
- if (i && _arr.length === i)
23795
- break;
23664
+ UNSAFE_componentWillReceiveProps(nextProps, nextState) {
23665
+ const oldState = this.getResolvedState();
23666
+ const newState = this.getResolvedState(nextProps, nextState);
23667
+ const defaultableOptions = ["sorted", "filtered", "resized", "expanded"];
23668
+ defaultableOptions.forEach((x2) => {
23669
+ const defaultName = `default${x2.charAt(0).toUpperCase() + x2.slice(1)}`;
23670
+ if (JSON.stringify(oldState[defaultName]) !== JSON.stringify(newState[defaultName])) {
23671
+ newState[x2] = newState[defaultName];
23796
23672
  }
23797
- } catch (err) {
23798
- _d = true;
23799
- _e = err;
23800
- } finally {
23801
- try {
23802
- if (!_n && _i["return"])
23803
- _i["return"]();
23804
- } finally {
23805
- if (_d)
23806
- throw _e;
23673
+ });
23674
+ const resettableOptions = ["sortable", "filterable", "resizable"];
23675
+ resettableOptions.forEach((x2) => {
23676
+ if (oldState[x2] !== newState[x2]) {
23677
+ const baseName = x2.replace("able", "");
23678
+ const optionName = `${baseName}ed`;
23679
+ const defaultName = `default${optionName.charAt(0).toUpperCase() + optionName.slice(1)}`;
23680
+ newState[optionName] = newState[defaultName];
23681
+ }
23682
+ });
23683
+ if (oldState.data !== newState.data || oldState.columns !== newState.columns || oldState.pivotBy !== newState.pivotBy || oldState.sorted !== newState.sorted || oldState.filtered !== newState.filtered) {
23684
+ this.setStateWithData(this.getDataModel(newState, oldState.data !== newState.data));
23685
+ }
23686
+ }
23687
+ setStateWithData(newState, cb) {
23688
+ const oldState = this.getResolvedState();
23689
+ const newResolvedState = this.getResolvedState({}, newState);
23690
+ const { freezeWhenExpanded } = newResolvedState;
23691
+ newResolvedState.frozen = false;
23692
+ if (freezeWhenExpanded) {
23693
+ const keys3 = Object.keys(newResolvedState.expanded);
23694
+ for (let i = 0; i < keys3.length; i += 1) {
23695
+ if (newResolvedState.expanded[keys3[i]]) {
23696
+ newResolvedState.frozen = true;
23697
+ break;
23698
+ }
23807
23699
  }
23808
23700
  }
23809
- return _arr;
23810
- }
23811
- __name(sliceIterator, "sliceIterator");
23812
- return function(arr, i) {
23813
- if (Array.isArray(arr)) {
23814
- return arr;
23815
- } else if (Symbol.iterator in Object(arr)) {
23816
- return sliceIterator(arr, i);
23817
- } else {
23818
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
23819
- }
23820
- };
23821
- }();
23822
- var _extends$l = Object.assign || function(target) {
23823
- for (var i = 1; i < arguments.length; i++) {
23824
- var source = arguments[i];
23825
- for (var key in source) {
23826
- if (Object.prototype.hasOwnProperty.call(source, key)) {
23827
- target[key] = source[key];
23701
+ if (oldState.frozen && !newResolvedState.frozen || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered || oldState.showFilters !== newResolvedState.showFilters || !newResolvedState.frozen && oldState.resolvedData !== newResolvedState.resolvedData) {
23702
+ 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) {
23703
+ newResolvedState.expanded = {};
23828
23704
  }
23705
+ Object.assign(newResolvedState, this.getSortedData(newResolvedState));
23829
23706
  }
23830
- }
23831
- return target;
23832
- };
23833
- var _createClass$b = function() {
23834
- function defineProperties2(target, props) {
23835
- for (var i = 0; i < props.length; i++) {
23836
- var descriptor2 = props[i];
23837
- descriptor2.enumerable = descriptor2.enumerable || false;
23838
- descriptor2.configurable = true;
23839
- if ("value" in descriptor2)
23840
- descriptor2.writable = true;
23841
- Object.defineProperty(target, descriptor2.key, descriptor2);
23707
+ if (oldState.filtered !== newResolvedState.filtered) {
23708
+ newResolvedState.page = 0;
23842
23709
  }
23843
- }
23844
- __name(defineProperties2, "defineProperties");
23845
- return function(Constructor, protoProps, staticProps) {
23846
- if (protoProps)
23847
- defineProperties2(Constructor.prototype, protoProps);
23848
- if (staticProps)
23849
- defineProperties2(Constructor, staticProps);
23850
- return Constructor;
23851
- };
23852
- }();
23853
- function _defineProperty$4(obj, key, value) {
23854
- if (key in obj) {
23855
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
23856
- } else {
23857
- obj[key] = value;
23858
- }
23859
- return obj;
23860
- }
23861
- __name(_defineProperty$4, "_defineProperty$4");
23862
- function _toConsumableArray(arr) {
23863
- if (Array.isArray(arr)) {
23864
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
23865
- arr2[i] = arr[i];
23710
+ if (newResolvedState.sortedData) {
23711
+ newResolvedState.pages = newResolvedState.manual ? newResolvedState.pages : Math.ceil(newResolvedState.sortedData.length / newResolvedState.pageSize);
23712
+ newResolvedState.page = newResolvedState.manual ? newResolvedState.page : Math.max(
23713
+ newResolvedState.page >= newResolvedState.pages ? newResolvedState.pages - 1 : newResolvedState.page,
23714
+ 0
23715
+ );
23866
23716
  }
23867
- return arr2;
23868
- } else {
23869
- return Array.from(arr);
23870
- }
23871
- }
23872
- __name(_toConsumableArray, "_toConsumableArray");
23873
- function _classCallCheck$g(instance, Constructor) {
23874
- if (!(instance instanceof Constructor)) {
23875
- throw new TypeError("Cannot call a class as a function");
23876
- }
23877
- }
23878
- __name(_classCallCheck$g, "_classCallCheck$g");
23879
- function _possibleConstructorReturn$g(self2, call2) {
23880
- if (!self2) {
23881
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
23717
+ return this.setState(newResolvedState, () => {
23718
+ if (cb) {
23719
+ cb();
23720
+ }
23721
+ if (oldState.page !== newResolvedState.page || oldState.pageSize !== newResolvedState.pageSize || oldState.sorted !== newResolvedState.sorted || oldState.filtered !== newResolvedState.filtered) {
23722
+ this.fireFetchData();
23723
+ }
23724
+ });
23882
23725
  }
23883
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
23884
- }
23885
- __name(_possibleConstructorReturn$g, "_possibleConstructorReturn$g");
23886
- function _inherits$g(subClass, superClass) {
23887
- if (typeof superClass !== "function" && superClass !== null) {
23888
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
23726
+ }, "Lifecycle");
23727
+ const Methods = /* @__PURE__ */ __name((Base) => class extends Base {
23728
+ getResolvedState(props, state) {
23729
+ const resolvedState = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, _.compactObject(this.state)), _.compactObject(this.props)), _.compactObject(state)), _.compactObject(props));
23730
+ return resolvedState;
23889
23731
  }
23890
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
23891
- if (superClass)
23892
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
23893
- }
23894
- __name(_inherits$g, "_inherits$g");
23895
- const Methods = /* @__PURE__ */ __name(function(Base) {
23896
- return function(_Base) {
23897
- _inherits$g(_class, _Base);
23898
- function _class() {
23899
- _classCallCheck$g(this, _class);
23900
- return _possibleConstructorReturn$g(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
23901
- }
23902
- __name(_class, "_class");
23903
- _createClass$b(_class, [{
23904
- key: "getResolvedState",
23905
- value: /* @__PURE__ */ __name(function getResolvedState(props, state) {
23906
- var resolvedState = _extends$l({}, _.compactObject(this.state), _.compactObject(this.props), _.compactObject(state), _.compactObject(props));
23907
- return resolvedState;
23908
- }, "getResolvedState")
23909
- }, {
23910
- key: "getDataModel",
23911
- value: /* @__PURE__ */ __name(function getDataModel(newState) {
23912
- var _this2 = this;
23913
- 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;
23914
- var hasHeaderGroups = false;
23915
- columns.forEach(function(column) {
23916
- if (column.columns) {
23917
- hasHeaderGroups = true;
23918
- }
23732
+ getDataModel(newState) {
23733
+ const {
23734
+ columns,
23735
+ pivotBy = [],
23736
+ data,
23737
+ resolveData,
23738
+ pivotIDKey,
23739
+ pivotValKey,
23740
+ subRowsKey,
23741
+ aggregatedKey,
23742
+ nestingLevelKey,
23743
+ originalKey,
23744
+ indexKey,
23745
+ groupedByPivotKey,
23746
+ SubComponent
23747
+ } = newState;
23748
+ let hasHeaderGroups = false;
23749
+ columns.forEach((column) => {
23750
+ if (column.columns) {
23751
+ hasHeaderGroups = true;
23752
+ }
23753
+ });
23754
+ let columnsWithExpander = [...columns];
23755
+ let expanderColumn = columns.find(
23756
+ (col) => col.expander || col.columns && col.columns.some((col2) => col2.expander)
23757
+ );
23758
+ if (expanderColumn && !expanderColumn.expander) {
23759
+ expanderColumn = expanderColumn.columns.find((col) => col.expander);
23760
+ }
23761
+ if (SubComponent && !expanderColumn) {
23762
+ expanderColumn = { expander: true };
23763
+ columnsWithExpander = [expanderColumn, ...columnsWithExpander];
23764
+ }
23765
+ const makeDecoratedColumn = /* @__PURE__ */ __name((column, parentColumn) => {
23766
+ let dcol;
23767
+ if (column.expander) {
23768
+ dcol = __spreadValues(__spreadValues(__spreadValues({}, this.props.column), this.props.expanderDefaults), column);
23769
+ } else {
23770
+ dcol = __spreadValues(__spreadValues({}, this.props.column), column);
23771
+ }
23772
+ if (dcol.maxWidth < dcol.minWidth) {
23773
+ dcol.minWidth = dcol.maxWidth;
23774
+ }
23775
+ if (parentColumn) {
23776
+ dcol.parentColumn = parentColumn;
23777
+ }
23778
+ if (typeof dcol.accessor === "string") {
23779
+ dcol.id = dcol.id || dcol.accessor;
23780
+ const accessorString = dcol.accessor;
23781
+ dcol.accessor = (row) => _.get(row, accessorString);
23782
+ return dcol;
23783
+ }
23784
+ if (dcol.accessor && !dcol.id) {
23785
+ console.warn(dcol);
23786
+ throw new Error(
23787
+ "A column id is required if using a non-string accessor for column above."
23788
+ );
23789
+ }
23790
+ if (!dcol.accessor) {
23791
+ dcol.accessor = () => void 0;
23792
+ }
23793
+ return dcol;
23794
+ }, "makeDecoratedColumn");
23795
+ const allDecoratedColumns = [];
23796
+ const decorateAndAddToAll = /* @__PURE__ */ __name((column, parentColumn) => {
23797
+ const decoratedColumn = makeDecoratedColumn(column, parentColumn);
23798
+ allDecoratedColumns.push(decoratedColumn);
23799
+ return decoratedColumn;
23800
+ }, "decorateAndAddToAll");
23801
+ const decoratedColumns = columnsWithExpander.map((column) => {
23802
+ if (column.columns) {
23803
+ return __spreadProps(__spreadValues({}, column), {
23804
+ columns: column.columns.map((d2) => decorateAndAddToAll(d2, column))
23919
23805
  });
23920
- var columnsWithExpander = [].concat(_toConsumableArray(columns));
23921
- var expanderColumn = columns.find(function(col) {
23922
- return col.expander || col.columns && col.columns.some(function(col2) {
23923
- return col2.expander;
23924
- });
23806
+ }
23807
+ return decorateAndAddToAll(column);
23808
+ });
23809
+ let visibleColumns = decoratedColumns.slice();
23810
+ let allVisibleColumns = [];
23811
+ visibleColumns = visibleColumns.map((column) => {
23812
+ if (column.columns) {
23813
+ const visibleSubColumns = column.columns.filter(
23814
+ (d2) => pivotBy.indexOf(d2.id) > -1 ? false : _.getFirstDefined(d2.show, true)
23815
+ );
23816
+ return __spreadProps(__spreadValues({}, column), {
23817
+ columns: visibleSubColumns
23925
23818
  });
23926
- if (expanderColumn && !expanderColumn.expander) {
23927
- expanderColumn = expanderColumn.columns.find(function(col) {
23928
- return col.expander;
23929
- });
23819
+ }
23820
+ return column;
23821
+ });
23822
+ visibleColumns = visibleColumns.filter(
23823
+ (column) => column.columns ? column.columns.length : pivotBy.indexOf(column.id) > -1 ? false : _.getFirstDefined(column.show, true)
23824
+ );
23825
+ const pivotIndex = visibleColumns.findIndex((col) => col.pivot);
23826
+ if (pivotBy.length) {
23827
+ const pivotColumns = [];
23828
+ pivotBy.forEach((pivotID) => {
23829
+ const found = allDecoratedColumns.find((d2) => d2.id === pivotID);
23830
+ if (found) {
23831
+ pivotColumns.push(found);
23930
23832
  }
23931
- if (SubComponent && !expanderColumn) {
23932
- expanderColumn = { expander: true };
23933
- columnsWithExpander = [expanderColumn].concat(_toConsumableArray(columnsWithExpander));
23833
+ });
23834
+ const PivotParentColumn = pivotColumns.reduce(
23835
+ (prev, current) => prev && prev === current.parentColumn && current.parentColumn,
23836
+ pivotColumns[0].parentColumn
23837
+ );
23838
+ let PivotGroupHeader = hasHeaderGroups && PivotParentColumn.Header;
23839
+ PivotGroupHeader = PivotGroupHeader || (() => /* @__PURE__ */ React$1.createElement("strong", null, "Pivoted"));
23840
+ let pivotColumnGroup = {
23841
+ Header: PivotGroupHeader,
23842
+ columns: pivotColumns.map((col) => __spreadProps(__spreadValues(__spreadValues({}, this.props.pivotDefaults), col), {
23843
+ pivoted: true
23844
+ }))
23845
+ };
23846
+ if (pivotIndex >= 0) {
23847
+ pivotColumnGroup = __spreadValues(__spreadValues({}, visibleColumns[pivotIndex]), pivotColumnGroup);
23848
+ visibleColumns.splice(pivotIndex, 1, pivotColumnGroup);
23849
+ } else {
23850
+ visibleColumns.unshift(pivotColumnGroup);
23851
+ }
23852
+ }
23853
+ const headerGroups = [];
23854
+ let currentSpan = [];
23855
+ const addHeader = /* @__PURE__ */ __name((columns2, column) => {
23856
+ headerGroups.push(__spreadProps(__spreadValues(__spreadValues({}, this.props.column), column), {
23857
+ columns: columns2
23858
+ }));
23859
+ currentSpan = [];
23860
+ }, "addHeader");
23861
+ visibleColumns.forEach((column) => {
23862
+ if (column.columns) {
23863
+ allVisibleColumns = allVisibleColumns.concat(column.columns);
23864
+ if (currentSpan.length > 0) {
23865
+ addHeader(currentSpan);
23934
23866
  }
23935
- var makeDecoratedColumn = /* @__PURE__ */ __name(function makeDecoratedColumn2(column, parentColumn) {
23936
- var dcol = void 0;
23937
- if (column.expander) {
23938
- dcol = _extends$l({}, _this2.props.column, _this2.props.expanderDefaults, column);
23939
- } else {
23940
- dcol = _extends$l({}, _this2.props.column, column);
23941
- }
23942
- if (dcol.maxWidth < dcol.minWidth) {
23943
- dcol.minWidth = dcol.maxWidth;
23944
- }
23945
- if (parentColumn) {
23946
- dcol.parentColumn = parentColumn;
23947
- }
23948
- if (typeof dcol.accessor === "string") {
23949
- dcol.id = dcol.id || dcol.accessor;
23950
- var accessorString = dcol.accessor;
23951
- dcol.accessor = function(row) {
23952
- return _.get(row, accessorString);
23953
- };
23954
- return dcol;
23955
- }
23956
- if (dcol.accessor && !dcol.id) {
23957
- console.warn(dcol);
23958
- throw new Error("A column id is required if using a non-string accessor for column above.");
23959
- }
23960
- if (!dcol.accessor) {
23961
- dcol.accessor = function() {
23962
- return void 0;
23963
- };
23964
- }
23965
- return dcol;
23966
- }, "makeDecoratedColumn");
23967
- var allDecoratedColumns = [];
23968
- var decorateAndAddToAll = /* @__PURE__ */ __name(function decorateAndAddToAll2(column, parentColumn) {
23969
- var decoratedColumn = makeDecoratedColumn(column, parentColumn);
23970
- allDecoratedColumns.push(decoratedColumn);
23971
- return decoratedColumn;
23972
- }, "decorateAndAddToAll");
23973
- var decoratedColumns = columnsWithExpander.map(function(column) {
23974
- if (column.columns) {
23975
- return _extends$l({}, column, {
23976
- columns: column.columns.map(function(d2) {
23977
- return decorateAndAddToAll(d2, column);
23978
- })
23979
- });
23980
- }
23981
- return decorateAndAddToAll(column);
23982
- });
23983
- var visibleColumns = decoratedColumns.slice();
23984
- var allVisibleColumns = [];
23985
- visibleColumns = visibleColumns.map(function(column) {
23986
- if (column.columns) {
23987
- var visibleSubColumns = column.columns.filter(function(d2) {
23988
- return pivotBy.indexOf(d2.id) > -1 ? false : _.getFirstDefined(d2.show, true);
23989
- });
23990
- return _extends$l({}, column, {
23991
- columns: visibleSubColumns
23992
- });
23993
- }
23994
- return column;
23995
- });
23996
- visibleColumns = visibleColumns.filter(function(column) {
23997
- return column.columns ? column.columns.length : pivotBy.indexOf(column.id) > -1 ? false : _.getFirstDefined(column.show, true);
23998
- });
23999
- var pivotIndex = visibleColumns.findIndex(function(col) {
24000
- return col.pivot;
23867
+ addHeader(column.columns, column);
23868
+ return;
23869
+ }
23870
+ allVisibleColumns.push(column);
23871
+ currentSpan.push(column);
23872
+ });
23873
+ if (hasHeaderGroups && currentSpan.length > 0) {
23874
+ addHeader(currentSpan);
23875
+ }
23876
+ const accessRow = /* @__PURE__ */ __name((d2, i, level = 0) => {
23877
+ const row = {
23878
+ [originalKey]: d2,
23879
+ [indexKey]: i,
23880
+ [subRowsKey]: d2[subRowsKey],
23881
+ [nestingLevelKey]: level
23882
+ };
23883
+ allDecoratedColumns.forEach((column) => {
23884
+ if (column.expander)
23885
+ return;
23886
+ row[column.id] = column.accessor(d2);
23887
+ });
23888
+ if (row[subRowsKey]) {
23889
+ row[subRowsKey] = row[subRowsKey].map((d22, i2) => accessRow(d22, i2, level + 1));
23890
+ }
23891
+ return row;
23892
+ }, "accessRow");
23893
+ let resolvedData = resolveData(data).map((d2, i) => accessRow(d2, i));
23894
+ const aggregatingColumns = allVisibleColumns.filter((d2) => !d2.expander && d2.aggregate);
23895
+ const aggregate = /* @__PURE__ */ __name((rows) => {
23896
+ const aggregationValues = {};
23897
+ aggregatingColumns.forEach((column) => {
23898
+ const values = rows.map((d2) => d2[column.id]);
23899
+ aggregationValues[column.id] = column.aggregate(values, rows);
23900
+ });
23901
+ return aggregationValues;
23902
+ }, "aggregate");
23903
+ if (pivotBy.length) {
23904
+ const groupRecursively = /* @__PURE__ */ __name((rows, keys3, i = 0) => {
23905
+ if (i === keys3.length) {
23906
+ return rows;
23907
+ }
23908
+ let groupedRows = Object.entries(_.groupBy(rows, keys3[i])).map(([key, value]) => ({
23909
+ [pivotIDKey]: keys3[i],
23910
+ [pivotValKey]: key,
23911
+ [keys3[i]]: key,
23912
+ [subRowsKey]: value,
23913
+ [nestingLevelKey]: i,
23914
+ [groupedByPivotKey]: true
23915
+ }));
23916
+ groupedRows = groupedRows.map((rowGroup) => {
23917
+ const subRows = groupRecursively(rowGroup[subRowsKey], keys3, i + 1);
23918
+ return __spreadValues(__spreadProps(__spreadValues({}, rowGroup), {
23919
+ [subRowsKey]: subRows,
23920
+ [aggregatedKey]: true
23921
+ }), aggregate(subRows));
24001
23922
  });
24002
- if (pivotBy.length) {
24003
- var pivotColumns = [];
24004
- pivotBy.forEach(function(pivotID) {
24005
- var found = allDecoratedColumns.find(function(d2) {
24006
- return d2.id === pivotID;
24007
- });
24008
- if (found) {
24009
- pivotColumns.push(found);
24010
- }
24011
- });
24012
- var PivotParentColumn = pivotColumns.reduce(function(prev, current) {
24013
- return prev && prev === current.parentColumn && current.parentColumn;
24014
- }, pivotColumns[0].parentColumn);
24015
- var PivotGroupHeader = hasHeaderGroups && PivotParentColumn.Header;
24016
- PivotGroupHeader = PivotGroupHeader || function() {
24017
- return React$1.createElement(
24018
- "strong",
24019
- null,
24020
- "Pivoted"
24021
- );
24022
- };
24023
- var pivotColumnGroup = {
24024
- Header: PivotGroupHeader,
24025
- columns: pivotColumns.map(function(col) {
24026
- return _extends$l({}, _this2.props.pivotDefaults, col, {
24027
- pivoted: true
24028
- });
24029
- })
24030
- // Place the pivotColumns back into the visibleColumns
24031
- };
24032
- if (pivotIndex >= 0) {
24033
- pivotColumnGroup = _extends$l({}, visibleColumns[pivotIndex], pivotColumnGroup);
24034
- visibleColumns.splice(pivotIndex, 1, pivotColumnGroup);
24035
- } else {
24036
- visibleColumns.unshift(pivotColumnGroup);
24037
- }
23923
+ return groupedRows;
23924
+ }, "groupRecursively");
23925
+ resolvedData = groupRecursively(resolvedData, pivotBy);
23926
+ }
23927
+ return __spreadProps(__spreadValues({}, newState), {
23928
+ resolvedData,
23929
+ allVisibleColumns,
23930
+ headerGroups,
23931
+ allDecoratedColumns,
23932
+ hasHeaderGroups
23933
+ });
23934
+ }
23935
+ getSortedData(resolvedState) {
23936
+ const {
23937
+ manual,
23938
+ sorted,
23939
+ filtered,
23940
+ defaultFilterMethod,
23941
+ resolvedData,
23942
+ allVisibleColumns,
23943
+ allDecoratedColumns
23944
+ } = resolvedState;
23945
+ const sortMethodsByColumnID = {};
23946
+ allDecoratedColumns.filter((col) => col.sortMethod).forEach((col) => {
23947
+ sortMethodsByColumnID[col.id] = col.sortMethod;
23948
+ });
23949
+ return {
23950
+ sortedData: manual ? resolvedData : this.sortData(
23951
+ this.filterData(resolvedData, filtered, defaultFilterMethod, allVisibleColumns),
23952
+ sorted,
23953
+ sortMethodsByColumnID
23954
+ )
23955
+ };
23956
+ }
23957
+ fireFetchData() {
23958
+ this.props.onFetchData(this.getResolvedState(), this);
23959
+ }
23960
+ getPropOrState(key) {
23961
+ return _.getFirstDefined(this.props[key], this.state[key]);
23962
+ }
23963
+ getStateOrProp(key) {
23964
+ return _.getFirstDefined(this.state[key], this.props[key]);
23965
+ }
23966
+ filterData(data, filtered, defaultFilterMethod, allVisibleColumns) {
23967
+ let filteredData = data;
23968
+ if (filtered.length) {
23969
+ filteredData = filtered.reduce((filteredSoFar, nextFilter) => {
23970
+ const column = allVisibleColumns.find((x2) => x2.id === nextFilter.id);
23971
+ if (!column || column.filterable === false) {
23972
+ return filteredSoFar;
24038
23973
  }
24039
- var headerGroups = [];
24040
- var currentSpan = [];
24041
- var addHeader = /* @__PURE__ */ __name(function addHeader2(columns2, column) {
24042
- headerGroups.push(_extends$l({}, _this2.props.column, column, {
24043
- columns: columns2
24044
- }));
24045
- currentSpan = [];
24046
- }, "addHeader");
24047
- visibleColumns.forEach(function(column) {
24048
- if (column.columns) {
24049
- allVisibleColumns = allVisibleColumns.concat(column.columns);
24050
- if (currentSpan.length > 0) {
24051
- addHeader(currentSpan);
24052
- }
24053
- addHeader(column.columns, column);
24054
- return;
24055
- }
24056
- allVisibleColumns.push(column);
24057
- currentSpan.push(column);
24058
- });
24059
- if (hasHeaderGroups && currentSpan.length > 0) {
24060
- addHeader(currentSpan);
23974
+ const filterMethod = column.filterMethod || defaultFilterMethod;
23975
+ if (column.filterAll) {
23976
+ return filterMethod(nextFilter, filteredSoFar, column);
24061
23977
  }
24062
- var accessRow = /* @__PURE__ */ __name(function accessRow2(d2, i) {
24063
- var _row;
24064
- var level = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
24065
- 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);
24066
- allDecoratedColumns.forEach(function(column) {
24067
- if (column.expander)
24068
- return;
24069
- row[column.id] = column.accessor(d2);
24070
- });
24071
- if (row[subRowsKey]) {
24072
- row[subRowsKey] = row[subRowsKey].map(function(d3, i2) {
24073
- return accessRow2(d3, i2, level + 1);
24074
- });
24075
- }
23978
+ return filteredSoFar.filter((row) => filterMethod(nextFilter, row, column));
23979
+ }, filteredData);
23980
+ filteredData = filteredData.map((row) => {
23981
+ if (!row[this.props.subRowsKey]) {
24076
23982
  return row;
24077
- }, "accessRow");
24078
- var resolvedData = resolveData2(data).map(function(d2, i) {
24079
- return accessRow(d2, i);
24080
- });
24081
- var aggregatingColumns = allVisibleColumns.filter(function(d2) {
24082
- return !d2.expander && d2.aggregate;
24083
- });
24084
- var aggregate = /* @__PURE__ */ __name(function aggregate2(rows) {
24085
- var aggregationValues = {};
24086
- aggregatingColumns.forEach(function(column) {
24087
- var values = rows.map(function(d2) {
24088
- return d2[column.id];
24089
- });
24090
- aggregationValues[column.id] = column.aggregate(values, rows);
24091
- });
24092
- return aggregationValues;
24093
- }, "aggregate");
24094
- if (pivotBy.length) {
24095
- var groupRecursively = /* @__PURE__ */ __name(function groupRecursively2(rows, keys3) {
24096
- var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
24097
- if (i === keys3.length) {
24098
- return rows;
24099
- }
24100
- var groupedRows = Object.entries(_.groupBy(rows, keys3[i])).map(function(_ref) {
24101
- var _ref3;
24102
- var _ref2 = _slicedToArray$4(_ref, 2), key = _ref2[0], value = _ref2[1];
24103
- 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;
24104
- });
24105
- groupedRows = groupedRows.map(function(rowGroup) {
24106
- var _extends2;
24107
- var subRows = groupRecursively2(rowGroup[subRowsKey], keys3, i + 1);
24108
- return _extends$l({}, rowGroup, (_extends2 = {}, _defineProperty$4(_extends2, subRowsKey, subRows), _defineProperty$4(_extends2, aggregatedKey, true), _extends2), aggregate(subRows));
24109
- });
24110
- return groupedRows;
24111
- }, "groupRecursively");
24112
- resolvedData = groupRecursively(resolvedData, pivotBy);
24113
- }
24114
- return _extends$l({}, newState, {
24115
- resolvedData,
24116
- allVisibleColumns,
24117
- headerGroups,
24118
- allDecoratedColumns,
24119
- hasHeaderGroups
24120
- });
24121
- }, "getDataModel")
24122
- }, {
24123
- key: "getSortedData",
24124
- value: /* @__PURE__ */ __name(function getSortedData(resolvedState) {
24125
- var manual = resolvedState.manual, sorted = resolvedState.sorted, filtered = resolvedState.filtered, defaultFilterMethod2 = resolvedState.defaultFilterMethod, resolvedData = resolvedState.resolvedData, allVisibleColumns = resolvedState.allVisibleColumns, allDecoratedColumns = resolvedState.allDecoratedColumns;
24126
- var sortMethodsByColumnID = {};
24127
- allDecoratedColumns.filter(function(col) {
24128
- return col.sortMethod;
24129
- }).forEach(function(col) {
24130
- sortMethodsByColumnID[col.id] = col.sortMethod;
24131
- });
24132
- return {
24133
- sortedData: manual ? resolvedData : this.sortData(this.filterData(resolvedData, filtered, defaultFilterMethod2, allVisibleColumns), sorted, sortMethodsByColumnID)
24134
- };
24135
- }, "getSortedData")
24136
- }, {
24137
- key: "fireFetchData",
24138
- value: /* @__PURE__ */ __name(function fireFetchData() {
24139
- this.props.onFetchData(this.getResolvedState(), this);
24140
- }, "fireFetchData")
24141
- }, {
24142
- key: "getPropOrState",
24143
- value: /* @__PURE__ */ __name(function getPropOrState(key) {
24144
- return _.getFirstDefined(this.props[key], this.state[key]);
24145
- }, "getPropOrState")
24146
- }, {
24147
- key: "getStateOrProp",
24148
- value: /* @__PURE__ */ __name(function getStateOrProp(key) {
24149
- return _.getFirstDefined(this.state[key], this.props[key]);
24150
- }, "getStateOrProp")
24151
- }, {
24152
- key: "filterData",
24153
- value: /* @__PURE__ */ __name(function filterData(data, filtered, defaultFilterMethod2, allVisibleColumns) {
24154
- var _this3 = this;
24155
- var filteredData = data;
24156
- if (filtered.length) {
24157
- filteredData = filtered.reduce(function(filteredSoFar, nextFilter) {
24158
- var column = allVisibleColumns.find(function(x2) {
24159
- return x2.id === nextFilter.id;
24160
- });
24161
- if (!column || column.filterable === false) {
24162
- return filteredSoFar;
24163
- }
24164
- var filterMethod = column.filterMethod || defaultFilterMethod2;
24165
- if (column.filterAll) {
24166
- return filterMethod(nextFilter, filteredSoFar, column);
24167
- }
24168
- return filteredSoFar.filter(function(row) {
24169
- return filterMethod(nextFilter, row, column);
24170
- });
24171
- }, filteredData);
24172
- filteredData = filteredData.map(function(row) {
24173
- if (!row[_this3.props.subRowsKey]) {
24174
- return row;
24175
- }
24176
- return _extends$l({}, row, _defineProperty$4({}, _this3.props.subRowsKey, _this3.filterData(row[_this3.props.subRowsKey], filtered, defaultFilterMethod2, allVisibleColumns)));
24177
- }).filter(function(row) {
24178
- if (!row[_this3.props.subRowsKey]) {
24179
- return true;
24180
- }
24181
- return row[_this3.props.subRowsKey].length > 0;
24182
- });
24183
23983
  }
24184
- return filteredData;
24185
- }, "filterData")
24186
- }, {
24187
- key: "sortData",
24188
- value: /* @__PURE__ */ __name(function sortData(data, sorted) {
24189
- var _this4 = this;
24190
- var sortMethodsByColumnID = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
24191
- if (!sorted.length) {
24192
- return data;
24193
- }
24194
- var sortedData = (this.props.orderByMethod || _.orderBy)(data, sorted.map(function(sort2) {
24195
- if (sortMethodsByColumnID[sort2.id]) {
24196
- return function(a2, b2) {
24197
- return sortMethodsByColumnID[sort2.id](a2[sort2.id], b2[sort2.id], sort2.desc);
24198
- };
24199
- }
24200
- return function(a2, b2) {
24201
- return _this4.props.defaultSortMethod(a2[sort2.id], b2[sort2.id], sort2.desc);
24202
- };
24203
- }), sorted.map(function(d2) {
24204
- return !d2.desc;
24205
- }), this.props.indexKey);
24206
- sortedData.forEach(function(row) {
24207
- if (!row[_this4.props.subRowsKey]) {
24208
- return;
24209
- }
24210
- row[_this4.props.subRowsKey] = _this4.sortData(row[_this4.props.subRowsKey], sorted, sortMethodsByColumnID);
24211
- });
24212
- return sortedData;
24213
- }, "sortData")
24214
- }, {
24215
- key: "getMinRows",
24216
- value: /* @__PURE__ */ __name(function getMinRows() {
24217
- return _.getFirstDefined(this.props.minRows, this.getStateOrProp("pageSize"));
24218
- }, "getMinRows")
24219
- // User actions
24220
- }, {
24221
- key: "onPageChange",
24222
- value: /* @__PURE__ */ __name(function onPageChange(page) {
24223
- var _props = this.props, onPageChange2 = _props.onPageChange, collapseOnPageChange = _props.collapseOnPageChange;
24224
- var newState = { page };
24225
- if (collapseOnPageChange) {
24226
- newState.expanded = {};
24227
- }
24228
- this.setStateWithData(newState, function() {
24229
- return onPageChange2 && onPageChange2(page);
24230
- });
24231
- }, "onPageChange")
24232
- }, {
24233
- key: "onPageSizeChange",
24234
- value: /* @__PURE__ */ __name(function onPageSizeChange(newPageSize) {
24235
- var onPageSizeChange2 = this.props.onPageSizeChange;
24236
- var _getResolvedState = this.getResolvedState(), pageSize = _getResolvedState.pageSize, page = _getResolvedState.page;
24237
- var currentRow = pageSize * page;
24238
- var newPage = Math.floor(currentRow / newPageSize);
24239
- this.setStateWithData({
24240
- pageSize: newPageSize,
24241
- page: newPage
24242
- }, function() {
24243
- return onPageSizeChange2 && onPageSizeChange2(newPageSize, newPage);
23984
+ return __spreadProps(__spreadValues({}, row), {
23985
+ [this.props.subRowsKey]: this.filterData(
23986
+ row[this.props.subRowsKey],
23987
+ filtered,
23988
+ defaultFilterMethod,
23989
+ allVisibleColumns
23990
+ )
24244
23991
  });
24245
- }, "onPageSizeChange")
24246
- }, {
24247
- key: "sortColumn",
24248
- value: /* @__PURE__ */ __name(function sortColumn(column, additive) {
24249
- var _getResolvedState2 = this.getResolvedState(), sorted = _getResolvedState2.sorted, skipNextSort = _getResolvedState2.skipNextSort, defaultSortDesc = _getResolvedState2.defaultSortDesc;
24250
- var firstSortDirection = Object.prototype.hasOwnProperty.call(column, "defaultSortDesc") ? column.defaultSortDesc : defaultSortDesc;
24251
- var secondSortDirection = !firstSortDirection;
24252
- if (skipNextSort) {
24253
- this.setStateWithData({
24254
- skipNextSort: false
24255
- });
24256
- return;
23992
+ }).filter((row) => {
23993
+ if (!row[this.props.subRowsKey]) {
23994
+ return true;
24257
23995
  }
24258
- var onSortedChange = this.props.onSortedChange;
24259
- var newSorted = _.clone(sorted || []).map(function(d2) {
24260
- d2.desc = _.isSortingDesc(d2);
24261
- return d2;
24262
- });
24263
- if (!_.isArray(column)) {
24264
- var existingIndex = newSorted.findIndex(function(d2) {
24265
- return d2.id === column.id;
24266
- });
24267
- if (existingIndex > -1) {
24268
- var existing = newSorted[existingIndex];
24269
- if (existing.desc === secondSortDirection) {
24270
- if (additive) {
24271
- newSorted.splice(existingIndex, 1);
24272
- } else {
24273
- existing.desc = firstSortDirection;
24274
- newSorted = [existing];
24275
- }
24276
- } else {
24277
- existing.desc = secondSortDirection;
24278
- if (!additive) {
24279
- newSorted = [existing];
24280
- }
24281
- }
24282
- } else if (additive) {
24283
- newSorted.push({
24284
- id: column.id,
24285
- desc: firstSortDirection
24286
- });
23996
+ return row[this.props.subRowsKey].length > 0;
23997
+ });
23998
+ }
23999
+ return filteredData;
24000
+ }
24001
+ sortData(data, sorted, sortMethodsByColumnID = {}) {
24002
+ if (!sorted.length) {
24003
+ return data;
24004
+ }
24005
+ const sortedData = (this.props.orderByMethod || _.orderBy)(
24006
+ data,
24007
+ sorted.map((sort2) => {
24008
+ if (sortMethodsByColumnID[sort2.id]) {
24009
+ return (a2, b2) => sortMethodsByColumnID[sort2.id](a2[sort2.id], b2[sort2.id], sort2.desc);
24010
+ }
24011
+ return (a2, b2) => this.props.defaultSortMethod(a2[sort2.id], b2[sort2.id], sort2.desc);
24012
+ }),
24013
+ sorted.map((d2) => !d2.desc),
24014
+ this.props.indexKey
24015
+ );
24016
+ sortedData.forEach((row) => {
24017
+ if (!row[this.props.subRowsKey]) {
24018
+ return;
24019
+ }
24020
+ row[this.props.subRowsKey] = this.sortData(
24021
+ row[this.props.subRowsKey],
24022
+ sorted,
24023
+ sortMethodsByColumnID
24024
+ );
24025
+ });
24026
+ return sortedData;
24027
+ }
24028
+ getMinRows() {
24029
+ return _.getFirstDefined(this.props.minRows, this.getStateOrProp("pageSize"));
24030
+ }
24031
+ // User actions
24032
+ onPageChange(page) {
24033
+ const { onPageChange, collapseOnPageChange } = this.props;
24034
+ const newState = { page };
24035
+ if (collapseOnPageChange) {
24036
+ newState.expanded = {};
24037
+ }
24038
+ this.setStateWithData(newState, () => onPageChange && onPageChange(page));
24039
+ }
24040
+ onPageSizeChange(newPageSize) {
24041
+ const { onPageSizeChange } = this.props;
24042
+ const { pageSize, page } = this.getResolvedState();
24043
+ const currentRow = pageSize * page;
24044
+ const newPage = Math.floor(currentRow / newPageSize);
24045
+ this.setStateWithData(
24046
+ {
24047
+ pageSize: newPageSize,
24048
+ page: newPage
24049
+ },
24050
+ () => onPageSizeChange && onPageSizeChange(newPageSize, newPage)
24051
+ );
24052
+ }
24053
+ sortColumn(column, additive) {
24054
+ const { sorted, skipNextSort, defaultSortDesc } = this.getResolvedState();
24055
+ const firstSortDirection = Object.prototype.hasOwnProperty.call(column, "defaultSortDesc") ? column.defaultSortDesc : defaultSortDesc;
24056
+ const secondSortDirection = !firstSortDirection;
24057
+ if (skipNextSort) {
24058
+ this.setStateWithData({
24059
+ skipNextSort: false
24060
+ });
24061
+ return;
24062
+ }
24063
+ const { onSortedChange } = this.props;
24064
+ let newSorted = _.clone(sorted || []).map((d2) => {
24065
+ d2.desc = _.isSortingDesc(d2);
24066
+ return d2;
24067
+ });
24068
+ if (!_.isArray(column)) {
24069
+ const existingIndex = newSorted.findIndex((d2) => d2.id === column.id);
24070
+ if (existingIndex > -1) {
24071
+ const existing = newSorted[existingIndex];
24072
+ if (existing.desc === secondSortDirection) {
24073
+ if (additive) {
24074
+ newSorted.splice(existingIndex, 1);
24287
24075
  } else {
24288
- newSorted = [{
24289
- id: column.id,
24290
- desc: firstSortDirection
24291
- }];
24076
+ existing.desc = firstSortDirection;
24077
+ newSorted = [existing];
24292
24078
  }
24293
24079
  } else {
24294
- var _existingIndex = newSorted.findIndex(function(d2) {
24295
- return d2.id === column[0].id;
24296
- });
24297
- if (_existingIndex > -1) {
24298
- var _existing = newSorted[_existingIndex];
24299
- if (_existing.desc === secondSortDirection) {
24300
- if (additive) {
24301
- newSorted.splice(_existingIndex, column.length);
24302
- } else {
24303
- column.forEach(function(d2, i) {
24304
- newSorted[_existingIndex + i].desc = firstSortDirection;
24305
- });
24306
- }
24307
- } else {
24308
- column.forEach(function(d2, i) {
24309
- newSorted[_existingIndex + i].desc = secondSortDirection;
24310
- });
24311
- }
24312
- if (!additive) {
24313
- newSorted = newSorted.slice(_existingIndex, column.length);
24314
- }
24315
- } else if (additive) {
24316
- newSorted = newSorted.concat(column.map(function(d2) {
24317
- return {
24318
- id: d2.id,
24319
- desc: firstSortDirection
24320
- };
24321
- }));
24322
- } else {
24323
- newSorted = column.map(function(d2) {
24324
- return {
24325
- id: d2.id,
24326
- desc: firstSortDirection
24327
- };
24328
- });
24080
+ existing.desc = secondSortDirection;
24081
+ if (!additive) {
24082
+ newSorted = [existing];
24329
24083
  }
24330
24084
  }
24331
- this.setStateWithData({
24332
- page: !sorted.length && newSorted.length || !additive ? 0 : this.state.page,
24333
- sorted: newSorted
24334
- }, function() {
24335
- return onSortedChange && onSortedChange(newSorted, column, additive);
24336
- });
24337
- }, "sortColumn")
24338
- }, {
24339
- key: "filterColumn",
24340
- value: /* @__PURE__ */ __name(function filterColumn(column, value) {
24341
- var _getResolvedState3 = this.getResolvedState(), filtered = _getResolvedState3.filtered;
24342
- var onFilteredChange = this.props.onFilteredChange;
24343
- var newFiltering = (filtered || []).filter(function(x2) {
24344
- return x2.id !== column.id;
24345
- });
24346
- if (value !== "") {
24347
- newFiltering.push({
24348
- id: column.id,
24349
- value
24350
- });
24351
- }
24352
- this.setStateWithData({
24353
- filtered: newFiltering
24354
- }, function() {
24355
- return onFilteredChange && onFilteredChange(newFiltering, column, value);
24085
+ } else if (additive) {
24086
+ newSorted.push({
24087
+ id: column.id,
24088
+ desc: firstSortDirection
24356
24089
  });
24357
- }, "filterColumn")
24358
- }, {
24359
- key: "resizeColumnStart",
24360
- value: /* @__PURE__ */ __name(function resizeColumnStart(event, column, isTouch) {
24361
- var _this5 = this;
24362
- event.stopPropagation();
24363
- var parentWidth = event.target.parentElement.getBoundingClientRect().width;
24364
- var pageX = void 0;
24365
- if (isTouch) {
24366
- pageX = event.changedTouches[0].pageX;
24367
- } else {
24368
- pageX = event.pageX;
24369
- }
24370
- this.trapEvents = true;
24371
- this.setStateWithData({
24372
- currentlyResizing: {
24090
+ } else {
24091
+ newSorted = [
24092
+ {
24373
24093
  id: column.id,
24374
- startX: pageX,
24375
- parentWidth
24094
+ desc: firstSortDirection
24376
24095
  }
24377
- }, function() {
24378
- if (isTouch) {
24379
- document.addEventListener("touchmove", _this5.resizeColumnMoving);
24380
- document.addEventListener("touchcancel", _this5.resizeColumnEnd);
24381
- document.addEventListener("touchend", _this5.resizeColumnEnd);
24096
+ ];
24097
+ }
24098
+ } else {
24099
+ const existingIndex = newSorted.findIndex((d2) => d2.id === column[0].id);
24100
+ if (existingIndex > -1) {
24101
+ const existing = newSorted[existingIndex];
24102
+ if (existing.desc === secondSortDirection) {
24103
+ if (additive) {
24104
+ newSorted.splice(existingIndex, column.length);
24382
24105
  } else {
24383
- document.addEventListener("mousemove", _this5.resizeColumnMoving);
24384
- document.addEventListener("mouseup", _this5.resizeColumnEnd);
24385
- document.addEventListener("mouseleave", _this5.resizeColumnEnd);
24106
+ column.forEach((d2, i) => {
24107
+ newSorted[existingIndex + i].desc = firstSortDirection;
24108
+ });
24386
24109
  }
24387
- });
24388
- }, "resizeColumnStart")
24389
- }, {
24390
- key: "resizeColumnMoving",
24391
- value: /* @__PURE__ */ __name(function resizeColumnMoving(event) {
24392
- event.stopPropagation();
24393
- var onResizedChange = this.props.onResizedChange;
24394
- var _getResolvedState4 = this.getResolvedState(), resized = _getResolvedState4.resized, currentlyResizing = _getResolvedState4.currentlyResizing;
24395
- var newResized = resized.filter(function(x2) {
24396
- return x2.id !== currentlyResizing.id;
24397
- });
24398
- var pageX = void 0;
24399
- if (event.type === "touchmove") {
24400
- pageX = event.changedTouches[0].pageX;
24401
- } else if (event.type === "mousemove") {
24402
- pageX = event.pageX;
24403
- }
24404
- var newWidth = Math.max(currentlyResizing.parentWidth + pageX - currentlyResizing.startX, 11);
24405
- newResized.push({
24406
- id: currentlyResizing.id,
24407
- value: newWidth
24408
- });
24409
- this.setStateWithData({
24410
- resized: newResized
24411
- }, function() {
24412
- return onResizedChange && onResizedChange(newResized, event);
24413
- });
24414
- }, "resizeColumnMoving")
24415
- }, {
24416
- key: "resizeColumnEnd",
24417
- value: /* @__PURE__ */ __name(function resizeColumnEnd(event) {
24418
- event.stopPropagation();
24419
- var isTouch = event.type === "touchend" || event.type === "touchcancel";
24420
- if (isTouch) {
24421
- document.removeEventListener("touchmove", this.resizeColumnMoving);
24422
- document.removeEventListener("touchcancel", this.resizeColumnEnd);
24423
- document.removeEventListener("touchend", this.resizeColumnEnd);
24424
- }
24425
- document.removeEventListener("mousemove", this.resizeColumnMoving);
24426
- document.removeEventListener("mouseup", this.resizeColumnEnd);
24427
- document.removeEventListener("mouseleave", this.resizeColumnEnd);
24428
- if (!isTouch) {
24429
- this.setStateWithData({
24430
- skipNextSort: true,
24431
- currentlyResizing: false
24110
+ } else {
24111
+ column.forEach((d2, i) => {
24112
+ newSorted[existingIndex + i].desc = secondSortDirection;
24432
24113
  });
24433
24114
  }
24434
- }, "resizeColumnEnd")
24435
- }]);
24436
- return _class;
24437
- }(Base);
24438
- }, "Methods");
24439
- var _createClass$a = function() {
24440
- function defineProperties2(target, props) {
24441
- for (var i = 0; i < props.length; i++) {
24442
- var descriptor2 = props[i];
24443
- descriptor2.enumerable = descriptor2.enumerable || false;
24444
- descriptor2.configurable = true;
24445
- if ("value" in descriptor2)
24446
- descriptor2.writable = true;
24447
- Object.defineProperty(target, descriptor2.key, descriptor2);
24115
+ if (!additive) {
24116
+ newSorted = newSorted.slice(existingIndex, column.length);
24117
+ }
24118
+ } else if (additive) {
24119
+ newSorted = newSorted.concat(
24120
+ column.map((d2) => ({
24121
+ id: d2.id,
24122
+ desc: firstSortDirection
24123
+ }))
24124
+ );
24125
+ } else {
24126
+ newSorted = column.map((d2) => ({
24127
+ id: d2.id,
24128
+ desc: firstSortDirection
24129
+ }));
24130
+ }
24448
24131
  }
24132
+ this.setStateWithData(
24133
+ {
24134
+ page: !sorted.length && newSorted.length || !additive ? 0 : this.state.page,
24135
+ sorted: newSorted
24136
+ },
24137
+ () => onSortedChange && onSortedChange(newSorted, column, additive)
24138
+ );
24449
24139
  }
24450
- __name(defineProperties2, "defineProperties");
24451
- return function(Constructor, protoProps, staticProps) {
24452
- if (protoProps)
24453
- defineProperties2(Constructor.prototype, protoProps);
24454
- if (staticProps)
24455
- defineProperties2(Constructor, staticProps);
24456
- return Constructor;
24457
- };
24458
- }();
24459
- var _extends$k = Object.assign || function(target) {
24460
- for (var i = 1; i < arguments.length; i++) {
24461
- var source = arguments[i];
24462
- for (var key in source) {
24463
- if (Object.prototype.hasOwnProperty.call(source, key)) {
24464
- target[key] = source[key];
24465
- }
24140
+ filterColumn(column, value) {
24141
+ const { filtered } = this.getResolvedState();
24142
+ const { onFilteredChange } = this.props;
24143
+ const newFiltering = (filtered || []).filter((x2) => x2.id !== column.id);
24144
+ if (value !== "") {
24145
+ newFiltering.push({
24146
+ id: column.id,
24147
+ value
24148
+ });
24466
24149
  }
24150
+ this.setStateWithData(
24151
+ {
24152
+ filtered: newFiltering
24153
+ },
24154
+ () => onFilteredChange && onFilteredChange(newFiltering, column, value)
24155
+ );
24467
24156
  }
24468
- return target;
24469
- };
24470
- function _classCallCheck$f(instance, Constructor) {
24471
- if (!(instance instanceof Constructor)) {
24472
- throw new TypeError("Cannot call a class as a function");
24157
+ resizeColumnStart(event, column, isTouch) {
24158
+ event.stopPropagation();
24159
+ const parentWidth = event.target.parentElement.getBoundingClientRect().width;
24160
+ let pageX;
24161
+ if (isTouch) {
24162
+ pageX = event.changedTouches[0].pageX;
24163
+ } else {
24164
+ pageX = event.pageX;
24165
+ }
24166
+ this.trapEvents = true;
24167
+ this.setStateWithData(
24168
+ {
24169
+ currentlyResizing: {
24170
+ id: column.id,
24171
+ startX: pageX,
24172
+ parentWidth
24173
+ }
24174
+ },
24175
+ () => {
24176
+ if (isTouch) {
24177
+ document.addEventListener("touchmove", this.resizeColumnMoving);
24178
+ document.addEventListener("touchcancel", this.resizeColumnEnd);
24179
+ document.addEventListener("touchend", this.resizeColumnEnd);
24180
+ } else {
24181
+ document.addEventListener("mousemove", this.resizeColumnMoving);
24182
+ document.addEventListener("mouseup", this.resizeColumnEnd);
24183
+ document.addEventListener("mouseleave", this.resizeColumnEnd);
24184
+ }
24185
+ }
24186
+ );
24473
24187
  }
24474
- }
24475
- __name(_classCallCheck$f, "_classCallCheck$f");
24476
- function _possibleConstructorReturn$f(self2, call2) {
24477
- if (!self2) {
24478
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
24188
+ resizeColumnMoving(event) {
24189
+ event.stopPropagation();
24190
+ const { onResizedChange } = this.props;
24191
+ const { resized, currentlyResizing } = this.getResolvedState();
24192
+ const newResized = resized.filter((x2) => x2.id !== currentlyResizing.id);
24193
+ let pageX;
24194
+ if (event.type === "touchmove") {
24195
+ pageX = event.changedTouches[0].pageX;
24196
+ } else if (event.type === "mousemove") {
24197
+ pageX = event.pageX;
24198
+ }
24199
+ const newWidth = Math.max(
24200
+ currentlyResizing.parentWidth + pageX - currentlyResizing.startX,
24201
+ 11
24202
+ );
24203
+ newResized.push({
24204
+ id: currentlyResizing.id,
24205
+ value: newWidth
24206
+ });
24207
+ this.setStateWithData(
24208
+ {
24209
+ resized: newResized
24210
+ },
24211
+ () => onResizedChange && onResizedChange(newResized, event)
24212
+ );
24479
24213
  }
24480
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
24481
- }
24482
- __name(_possibleConstructorReturn$f, "_possibleConstructorReturn$f");
24483
- function _inherits$f(subClass, superClass) {
24484
- if (typeof superClass !== "function" && superClass !== null) {
24485
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
24214
+ resizeColumnEnd(event) {
24215
+ event.stopPropagation();
24216
+ const isTouch = event.type === "touchend" || event.type === "touchcancel";
24217
+ if (isTouch) {
24218
+ document.removeEventListener("touchmove", this.resizeColumnMoving);
24219
+ document.removeEventListener("touchcancel", this.resizeColumnEnd);
24220
+ document.removeEventListener("touchend", this.resizeColumnEnd);
24221
+ }
24222
+ document.removeEventListener("mousemove", this.resizeColumnMoving);
24223
+ document.removeEventListener("mouseup", this.resizeColumnEnd);
24224
+ document.removeEventListener("mouseleave", this.resizeColumnEnd);
24225
+ if (!isTouch) {
24226
+ this.setStateWithData({
24227
+ skipNextSort: true,
24228
+ currentlyResizing: false
24229
+ });
24230
+ }
24486
24231
  }
24487
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
24488
- if (superClass)
24489
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
24490
- }
24491
- __name(_inherits$f, "_inherits$f");
24492
- var defaultButton = /* @__PURE__ */ __name(function defaultButton2(props) {
24493
- return React$1.createElement(
24494
- "button",
24495
- _extends$k({ type: "button" }, props, { className: "-btn" }),
24496
- props.children
24497
- );
24498
- }, "defaultButton");
24499
- var ReactTablePagination = function(_Component) {
24500
- _inherits$f(ReactTablePagination2, _Component);
24501
- function ReactTablePagination2(props) {
24502
- _classCallCheck$f(this, ReactTablePagination2);
24503
- var _this = _possibleConstructorReturn$f(this, (ReactTablePagination2.__proto__ || Object.getPrototypeOf(ReactTablePagination2)).call(this, props));
24504
- _this.getSafePage = _this.getSafePage.bind(_this);
24505
- _this.changePage = _this.changePage.bind(_this);
24506
- _this.applyPage = _this.applyPage.bind(_this);
24507
- _this.state = {
24232
+ }, "Methods");
24233
+ const defaultButton = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React$1.createElement("button", __spreadProps(__spreadValues({ type: "button" }, props), { className: "-btn" }), props.children), "defaultButton");
24234
+ const _ReactTablePagination = class _ReactTablePagination extends React$1.Component {
24235
+ constructor(props) {
24236
+ super(props);
24237
+ this.getSafePage = this.getSafePage.bind(this);
24238
+ this.changePage = this.changePage.bind(this);
24239
+ this.applyPage = this.applyPage.bind(this);
24240
+ this.state = {
24508
24241
  page: props.page
24509
24242
  };
24510
- return _this;
24511
24243
  }
24512
- __name(ReactTablePagination2, "ReactTablePagination");
24513
- _createClass$a(ReactTablePagination2, [{
24514
- key: "UNSAFE_componentWillReceiveProps",
24515
- value: /* @__PURE__ */ __name(function UNSAFE_componentWillReceiveProps(nextProps) {
24516
- if (this.props.page !== nextProps.page) {
24517
- this.setState({ page: nextProps.page });
24518
- }
24519
- }, "UNSAFE_componentWillReceiveProps")
24520
- }, {
24521
- key: "getSafePage",
24522
- value: /* @__PURE__ */ __name(function getSafePage(page) {
24523
- if (Number.isNaN(page)) {
24524
- page = this.props.page;
24525
- }
24526
- return Math.min(Math.max(page, 0), this.props.pages - 1);
24527
- }, "getSafePage")
24528
- }, {
24529
- key: "changePage",
24530
- value: /* @__PURE__ */ __name(function changePage(page) {
24531
- page = this.getSafePage(page);
24532
- this.setState({ page });
24533
- if (this.props.page !== page) {
24534
- this.props.onPageChange(page);
24535
- }
24536
- }, "changePage")
24537
- }, {
24538
- key: "applyPage",
24539
- value: /* @__PURE__ */ __name(function applyPage(e2) {
24540
- if (e2) {
24541
- e2.preventDefault();
24542
- }
24543
- var page = this.state.page;
24544
- this.changePage(page === "" ? this.props.page : page);
24545
- }, "applyPage")
24546
- }, {
24547
- key: "getPageJumpProperties",
24548
- value: /* @__PURE__ */ __name(function getPageJumpProperties() {
24549
- var _this2 = this;
24550
- return {
24551
- onKeyPress: /* @__PURE__ */ __name(function onKeyPress(e2) {
24552
- if (e2.which === 13 || e2.keyCode === 13) {
24553
- _this2.applyPage();
24554
- }
24555
- }, "onKeyPress"),
24556
- onBlur: this.applyPage,
24557
- value: this.state.page === "" ? "" : this.state.page + 1,
24558
- onChange: /* @__PURE__ */ __name(function onChange(e2) {
24559
- var val = e2.target.value;
24560
- var page = val - 1;
24561
- if (val === "") {
24562
- return _this2.setState({ page: val });
24563
- }
24564
- _this2.setState({ page: _this2.getSafePage(page) });
24565
- }, "onChange"),
24566
- inputType: this.state.page === "" ? "text" : "number",
24567
- pageJumpText: this.props.pageJumpText
24568
- };
24569
- }, "getPageJumpProperties")
24570
- }, {
24571
- key: "render",
24572
- value: /* @__PURE__ */ __name(function render3() {
24573
- var _this3 = this;
24574
- 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;
24575
- return React$1.createElement(
24576
- "div",
24577
- { className: classNames(className, "-pagination"), style: this.props.style },
24578
- React$1.createElement(
24579
- "div",
24580
- { className: "-previous" },
24581
- React$1.createElement(
24582
- PreviousComponent,
24583
- {
24584
- onClick: /* @__PURE__ */ __name(function onClick() {
24585
- if (!canPrevious)
24586
- return;
24587
- _this3.changePage(page - 1);
24588
- }, "onClick"),
24589
- disabled: !canPrevious
24590
- },
24591
- this.props.previousText
24592
- )
24593
- ),
24594
- React$1.createElement(
24595
- "div",
24596
- { className: "-center" },
24597
- React$1.createElement(
24598
- "span",
24599
- { className: "-pageInfo" },
24600
- this.props.pageText,
24601
- " ",
24602
- showPageJump ? renderPageJump2(this.getPageJumpProperties()) : renderCurrentPage2(page),
24603
- " ",
24604
- this.props.ofText,
24605
- " ",
24606
- renderTotalPagesCount2(pages)
24607
- ),
24608
- showPageSizeOptions && renderPageSizeOptions2({
24609
- pageSize,
24610
- rowsSelectorText: this.props.rowsSelectorText,
24611
- pageSizeOptions,
24612
- onPageSizeChange,
24613
- rowsText: this.props.rowsText
24614
- })
24615
- ),
24616
- React$1.createElement(
24617
- "div",
24618
- { className: "-next" },
24619
- React$1.createElement(
24620
- NextComponent,
24621
- {
24622
- onClick: /* @__PURE__ */ __name(function onClick() {
24623
- if (!canNext)
24624
- return;
24625
- _this3.changePage(page + 1);
24626
- }, "onClick"),
24627
- disabled: !canNext
24628
- },
24629
- this.props.nextText
24630
- )
24631
- )
24632
- );
24633
- }, "render")
24634
- }]);
24635
- return ReactTablePagination2;
24636
- }(React$1.Component);
24637
- ReactTablePagination.defaultProps = {
24638
- PreviousComponent: defaultButton,
24639
- NextComponent: defaultButton,
24640
- renderPageJump: /* @__PURE__ */ __name(function renderPageJump(_ref) {
24641
- var onChange = _ref.onChange, value = _ref.value, onBlur = _ref.onBlur, onKeyPress = _ref.onKeyPress, inputType = _ref.inputType, pageJumpText = _ref.pageJumpText;
24642
- return React$1.createElement(
24643
- "div",
24644
- { className: "-pageJump" },
24645
- React$1.createElement("input", {
24646
- "aria-label": pageJumpText,
24647
- type: inputType,
24648
- onChange,
24649
- value,
24650
- onBlur,
24651
- onKeyPress
24652
- })
24653
- );
24654
- }, "renderPageJump"),
24655
- renderCurrentPage: /* @__PURE__ */ __name(function renderCurrentPage(page) {
24656
- return React$1.createElement(
24657
- "span",
24658
- { className: "-currentPage" },
24659
- page + 1
24660
- );
24661
- }, "renderCurrentPage"),
24662
- renderTotalPagesCount: /* @__PURE__ */ __name(function renderTotalPagesCount(pages) {
24663
- return React$1.createElement(
24664
- "span",
24665
- { className: "-totalPages" },
24666
- pages || 1
24667
- );
24668
- }, "renderTotalPagesCount"),
24669
- renderPageSizeOptions: /* @__PURE__ */ __name(function renderPageSizeOptions(_ref2) {
24670
- var pageSize = _ref2.pageSize, pageSizeOptions = _ref2.pageSizeOptions, rowsSelectorText = _ref2.rowsSelectorText, onPageSizeChange = _ref2.onPageSizeChange, rowsText = _ref2.rowsText;
24671
- return React$1.createElement(
24672
- "span",
24673
- { className: "select-wrap -pageSizeOptions" },
24674
- React$1.createElement(
24675
- "select",
24676
- {
24677
- "aria-label": rowsSelectorText,
24678
- onChange: /* @__PURE__ */ __name(function onChange(e2) {
24679
- return onPageSizeChange(Number(e2.target.value));
24680
- }, "onChange"),
24681
- value: pageSize
24682
- },
24683
- pageSizeOptions.map(function(option, i) {
24684
- return (
24685
- // eslint-disable-next-line react/no-array-index-key
24686
- React$1.createElement(
24687
- "option",
24688
- { key: i, value: option },
24689
- option + " " + rowsText
24690
- )
24691
- );
24692
- })
24693
- )
24694
- );
24695
- }, "renderPageSizeOptions")
24696
- };
24697
- var _extends$j = Object.assign || function(target) {
24698
- for (var i = 1; i < arguments.length; i++) {
24699
- var source = arguments[i];
24700
- for (var key in source) {
24701
- if (Object.prototype.hasOwnProperty.call(source, key)) {
24702
- target[key] = source[key];
24703
- }
24244
+ UNSAFE_componentWillReceiveProps(nextProps) {
24245
+ if (this.props.page !== nextProps.page) {
24246
+ this.setState({ page: nextProps.page });
24704
24247
  }
24705
24248
  }
24706
- return target;
24707
- };
24708
- function _objectWithoutProperties$5(obj, keys3) {
24709
- var target = {};
24710
- for (var i in obj) {
24711
- if (keys3.indexOf(i) >= 0)
24712
- continue;
24713
- if (!Object.prototype.hasOwnProperty.call(obj, i))
24714
- continue;
24715
- target[i] = obj[i];
24249
+ getSafePage(page) {
24250
+ if (Number.isNaN(page)) {
24251
+ page = this.props.page;
24252
+ }
24253
+ return Math.min(Math.max(page, 0), this.props.pages - 1);
24716
24254
  }
24717
- return target;
24718
- }
24719
- __name(_objectWithoutProperties$5, "_objectWithoutProperties$5");
24720
- var emptyObj = /* @__PURE__ */ __name(function emptyObj2() {
24721
- return {};
24722
- }, "emptyObj");
24255
+ changePage(page) {
24256
+ page = this.getSafePage(page);
24257
+ this.setState({ page });
24258
+ if (this.props.page !== page) {
24259
+ this.props.onPageChange(page);
24260
+ }
24261
+ }
24262
+ applyPage(e2) {
24263
+ if (e2) {
24264
+ e2.preventDefault();
24265
+ }
24266
+ const page = this.state.page;
24267
+ this.changePage(page === "" ? this.props.page : page);
24268
+ }
24269
+ getPageJumpProperties() {
24270
+ return {
24271
+ onKeyPress: (e2) => {
24272
+ if (e2.which === 13 || e2.keyCode === 13) {
24273
+ this.applyPage();
24274
+ }
24275
+ },
24276
+ onBlur: this.applyPage,
24277
+ value: this.state.page === "" ? "" : this.state.page + 1,
24278
+ onChange: (e2) => {
24279
+ const val = e2.target.value;
24280
+ const page = val - 1;
24281
+ if (val === "") {
24282
+ return this.setState({ page: val });
24283
+ }
24284
+ this.setState({ page: this.getSafePage(page) });
24285
+ },
24286
+ inputType: this.state.page === "" ? "text" : "number",
24287
+ pageJumpText: this.props.pageJumpText
24288
+ };
24289
+ }
24290
+ render() {
24291
+ const {
24292
+ // Computed
24293
+ pages,
24294
+ // Props
24295
+ page,
24296
+ showPageSizeOptions,
24297
+ pageSizeOptions,
24298
+ pageSize,
24299
+ showPageJump,
24300
+ canPrevious,
24301
+ canNext,
24302
+ onPageSizeChange,
24303
+ className,
24304
+ PreviousComponent,
24305
+ NextComponent,
24306
+ renderPageJump,
24307
+ renderCurrentPage,
24308
+ renderTotalPagesCount,
24309
+ renderPageSizeOptions
24310
+ } = this.props;
24311
+ return /* @__PURE__ */ React$1.createElement("div", { className: classNames(className, "-pagination"), style: this.props.style }, /* @__PURE__ */ React$1.createElement("div", { className: "-previous" }, /* @__PURE__ */ React$1.createElement(
24312
+ PreviousComponent,
24313
+ {
24314
+ onClick: () => {
24315
+ if (!canPrevious)
24316
+ return;
24317
+ this.changePage(page - 1);
24318
+ },
24319
+ disabled: !canPrevious
24320
+ },
24321
+ this.props.previousText
24322
+ )), /* @__PURE__ */ React$1.createElement("div", { className: "-center" }, /* @__PURE__ */ React$1.createElement("span", { className: "-pageInfo" }, this.props.pageText, " ", showPageJump ? renderPageJump(this.getPageJumpProperties()) : renderCurrentPage(page), " ", this.props.ofText, " ", renderTotalPagesCount(pages)), showPageSizeOptions && renderPageSizeOptions({
24323
+ pageSize,
24324
+ rowsSelectorText: this.props.rowsSelectorText,
24325
+ pageSizeOptions,
24326
+ onPageSizeChange,
24327
+ rowsText: this.props.rowsText
24328
+ })), /* @__PURE__ */ React$1.createElement("div", { className: "-next" }, /* @__PURE__ */ React$1.createElement(
24329
+ NextComponent,
24330
+ {
24331
+ onClick: () => {
24332
+ if (!canNext)
24333
+ return;
24334
+ this.changePage(page + 1);
24335
+ },
24336
+ disabled: !canNext
24337
+ },
24338
+ this.props.nextText
24339
+ )));
24340
+ }
24341
+ };
24342
+ __name(_ReactTablePagination, "ReactTablePagination");
24343
+ __publicField(_ReactTablePagination, "defaultProps", {
24344
+ PreviousComponent: defaultButton,
24345
+ NextComponent: defaultButton,
24346
+ renderPageJump: ({
24347
+ onChange,
24348
+ value,
24349
+ onBlur,
24350
+ onKeyPress,
24351
+ inputType,
24352
+ pageJumpText
24353
+ }) => /* @__PURE__ */ React$1.createElement("div", { className: "-pageJump" }, /* @__PURE__ */ React$1.createElement(
24354
+ "input",
24355
+ {
24356
+ "aria-label": pageJumpText,
24357
+ type: inputType,
24358
+ onChange,
24359
+ value,
24360
+ onBlur,
24361
+ onKeyPress
24362
+ }
24363
+ )),
24364
+ renderCurrentPage: (page) => /* @__PURE__ */ React$1.createElement("span", { className: "-currentPage" }, page + 1),
24365
+ renderTotalPagesCount: (pages) => /* @__PURE__ */ React$1.createElement("span", { className: "-totalPages" }, pages || 1),
24366
+ renderPageSizeOptions: ({
24367
+ pageSize,
24368
+ pageSizeOptions,
24369
+ rowsSelectorText,
24370
+ onPageSizeChange,
24371
+ rowsText
24372
+ }) => /* @__PURE__ */ React$1.createElement("span", { className: "select-wrap -pageSizeOptions" }, /* @__PURE__ */ React$1.createElement(
24373
+ "select",
24374
+ {
24375
+ "aria-label": rowsSelectorText,
24376
+ onChange: (e2) => onPageSizeChange(Number(e2.target.value)),
24377
+ value: pageSize
24378
+ },
24379
+ pageSizeOptions.map((option, i) => (
24380
+ // eslint-disable-next-line react/no-array-index-key
24381
+ /* @__PURE__ */ React$1.createElement("option", { key: i, value: option }, `${option} ${rowsText}`)
24382
+ ))
24383
+ ))
24384
+ });
24385
+ let ReactTablePagination = _ReactTablePagination;
24386
+ const emptyObj = /* @__PURE__ */ __name(() => ({}), "emptyObj");
24723
24387
  const defaultProps$1 = {
24724
24388
  // General
24725
24389
  data: [],
24726
- resolveData: /* @__PURE__ */ __name(function resolveData(data) {
24727
- return data;
24728
- }, "resolveData"),
24390
+ resolveData: (data) => data,
24729
24391
  loading: false,
24730
24392
  showPagination: true,
24731
24393
  showPaginationTop: false,
@@ -24749,12 +24411,12 @@ const defaultProps$1 = {
24749
24411
  defaultResized: [],
24750
24412
  defaultExpanded: {},
24751
24413
  // eslint-disable-next-line no-unused-vars
24752
- defaultFilterMethod: /* @__PURE__ */ __name(function defaultFilterMethod(filter, row, column) {
24753
- var id2 = filter.pivotId || filter.id;
24414
+ defaultFilterMethod: (filter, row, column) => {
24415
+ const id2 = filter.pivotId || filter.id;
24754
24416
  return row[id2] !== void 0 ? String(row[id2]).startsWith(filter.value) : true;
24755
- }, "defaultFilterMethod"),
24417
+ },
24756
24418
  // eslint-disable-next-line no-unused-vars
24757
- defaultSortMethod: /* @__PURE__ */ __name(function defaultSortMethod(a2, b2, desc) {
24419
+ defaultSortMethod: (a2, b2, desc) => {
24758
24420
  a2 = a2 === null || a2 === void 0 ? "" : a2;
24759
24421
  b2 = b2 === null || b2 === void 0 ? "" : b2;
24760
24422
  a2 = typeof a2 === "string" ? a2.toLowerCase() : a2;
@@ -24766,7 +24428,7 @@ const defaultProps$1 = {
24766
24428
  return -1;
24767
24429
  }
24768
24430
  return 0;
24769
- }, "defaultSortMethod"),
24431
+ },
24770
24432
  // Controlled State Props
24771
24433
  // page: undefined,
24772
24434
  // pageSize: undefined,
@@ -24793,9 +24455,7 @@ const defaultProps$1 = {
24793
24455
  indexKey: "_index",
24794
24456
  groupedByPivotKey: "_groupedByPivot",
24795
24457
  // Server-side Callbacks
24796
- onFetchData: /* @__PURE__ */ __name(function onFetchData() {
24797
- return null;
24798
- }, "onFetchData"),
24458
+ onFetchData: () => null,
24799
24459
  // Classes
24800
24460
  className: "",
24801
24461
  style: {},
@@ -24883,145 +24543,106 @@ const defaultProps$1 = {
24883
24543
  pageJumpText: "jump to page",
24884
24544
  rowsSelectorText: "rows per page",
24885
24545
  // Components
24886
- TableComponent: /* @__PURE__ */ __name(function TableComponent(_ref) {
24887
- var children = _ref.children, className = _ref.className, rest = _objectWithoutProperties$5(_ref, ["children", "className"]);
24888
- return React$1.createElement(
24546
+ TableComponent: (_e) => {
24547
+ var _f = _e, { children, className } = _f, rest = __objRest(_f, ["children", "className"]);
24548
+ return /* @__PURE__ */ React$1.createElement(
24889
24549
  "div",
24890
- _extends$j({
24550
+ __spreadValues({
24891
24551
  className: classNames("rt-table", className),
24892
24552
  role: "grid"
24893
- // tabIndex='0'
24894
24553
  }, rest),
24895
24554
  children
24896
24555
  );
24897
- }, "TableComponent"),
24556
+ },
24898
24557
  TheadComponent: _.makeTemplateComponent("rt-thead", "Thead"),
24899
24558
  TbodyComponent: _.makeTemplateComponent("rt-tbody", "Tbody"),
24900
- TrGroupComponent: /* @__PURE__ */ __name(function TrGroupComponent(_ref2) {
24901
- var children = _ref2.children, className = _ref2.className, rest = _objectWithoutProperties$5(_ref2, ["children", "className"]);
24902
- return React$1.createElement(
24903
- "div",
24904
- _extends$j({ className: classNames("rt-tr-group", className), role: "rowgroup" }, rest),
24905
- children
24906
- );
24907
- }, "TrGroupComponent"),
24908
- TrComponent: /* @__PURE__ */ __name(function TrComponent(_ref3) {
24909
- var children = _ref3.children, className = _ref3.className, rest = _objectWithoutProperties$5(_ref3, ["children", "className"]);
24910
- return React$1.createElement(
24911
- "div",
24912
- _extends$j({ className: classNames("rt-tr", className), role: "row" }, rest),
24559
+ TrGroupComponent: (_g) => {
24560
+ var _h = _g, { children, className } = _h, rest = __objRest(_h, ["children", "className"]);
24561
+ return /* @__PURE__ */ React$1.createElement("div", __spreadValues({ className: classNames("rt-tr-group", className), role: "rowgroup" }, rest), children);
24562
+ },
24563
+ TrComponent: (_i) => {
24564
+ var _j = _i, { children, className } = _j, rest = __objRest(_j, ["children", "className"]);
24565
+ return /* @__PURE__ */ React$1.createElement("div", __spreadValues({ className: classNames("rt-tr", className), role: "row" }, rest), children);
24566
+ },
24567
+ ThComponent: (_k) => {
24568
+ var _l = _k, {
24569
+ toggleSort,
24570
+ className,
24913
24571
  children
24914
- );
24915
- }, "TrComponent"),
24916
- ThComponent: /* @__PURE__ */ __name(function ThComponent(_ref4) {
24917
- var toggleSort = _ref4.toggleSort, className = _ref4.className, children = _ref4.children, rest = _objectWithoutProperties$5(_ref4, ["toggleSort", "className", "children"]);
24572
+ } = _l, rest = __objRest(_l, [
24573
+ "toggleSort",
24574
+ "className",
24575
+ "children"
24576
+ ]);
24918
24577
  return (
24919
24578
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events
24920
- React$1.createElement(
24579
+ /* @__PURE__ */ React$1.createElement(
24921
24580
  "div",
24922
- _extends$j({
24581
+ __spreadValues({
24923
24582
  className: classNames("rt-th", className),
24924
- onClick: /* @__PURE__ */ __name(function onClick(e2) {
24925
- return toggleSort && toggleSort(e2);
24926
- }, "onClick"),
24583
+ onClick: (e2) => toggleSort && toggleSort(e2),
24927
24584
  role: "columnheader",
24928
24585
  tabIndex: "-1"
24929
- // Resolves eslint issues without implementing keyboard navigation incorrectly
24930
24586
  }, rest),
24931
24587
  children
24932
24588
  )
24933
24589
  );
24934
- }, "ThComponent"),
24935
- TdComponent: /* @__PURE__ */ __name(function TdComponent(_ref5) {
24936
- _ref5.toggleSort;
24937
- var className = _ref5.className, children = _ref5.children, rest = _objectWithoutProperties$5(_ref5, ["toggleSort", "className", "children"]);
24938
- return React$1.createElement(
24939
- "div",
24940
- _extends$j({ className: classNames("rt-td", className), role: "gridcell" }, rest),
24590
+ },
24591
+ TdComponent: (_m) => {
24592
+ var _n = _m, {
24593
+ toggleSort,
24594
+ className,
24941
24595
  children
24942
- );
24943
- }, "TdComponent"),
24596
+ } = _n, rest = __objRest(_n, [
24597
+ "toggleSort",
24598
+ "className",
24599
+ "children"
24600
+ ]);
24601
+ return /* @__PURE__ */ React$1.createElement("div", __spreadValues({ className: classNames("rt-td", className), role: "gridcell" }, rest), children);
24602
+ },
24944
24603
  TfootComponent: _.makeTemplateComponent("rt-tfoot", "Tfoot"),
24945
- FilterComponent: /* @__PURE__ */ __name(function FilterComponent(_ref6) {
24946
- var filter = _ref6.filter, _onChange = _ref6.onChange, column = _ref6.column;
24947
- return React$1.createElement("input", {
24604
+ FilterComponent: ({ filter, onChange, column }) => /* @__PURE__ */ React$1.createElement(
24605
+ "input",
24606
+ {
24948
24607
  type: "text",
24949
24608
  style: {
24950
24609
  width: "100%"
24951
24610
  },
24952
24611
  placeholder: column.Placeholder,
24953
24612
  value: filter ? filter.value : "",
24954
- onChange: /* @__PURE__ */ __name(function onChange(event) {
24955
- return _onChange(event.target.value);
24956
- }, "onChange")
24957
- });
24958
- }, "FilterComponent"),
24959
- ExpanderComponent: /* @__PURE__ */ __name(function ExpanderComponent(_ref7) {
24960
- var isExpanded = _ref7.isExpanded;
24961
- return React$1.createElement(
24962
- "div",
24963
- { className: classNames("rt-expander", isExpanded && "-open") },
24964
- ""
24965
- );
24966
- }, "ExpanderComponent"),
24967
- PivotValueComponent: /* @__PURE__ */ __name(function PivotValueComponent(_ref8) {
24968
- var subRows = _ref8.subRows, value = _ref8.value;
24969
- return React$1.createElement(
24970
- "span",
24971
- null,
24972
- value,
24973
- " ",
24974
- subRows && "(" + subRows.length + ")"
24975
- );
24976
- }, "PivotValueComponent"),
24977
- AggregatedComponent: /* @__PURE__ */ __name(function AggregatedComponent(_ref9) {
24978
- var subRows = _ref9.subRows, column = _ref9.column;
24979
- var previewValues = subRows.filter(function(d2) {
24980
- return typeof d2[column.id] !== "undefined";
24981
- }).map(function(row, i) {
24982
- return (
24983
- // eslint-disable-next-line react/no-array-index-key
24984
- React$1.createElement(
24985
- "span",
24986
- { key: i },
24987
- row[column.id],
24988
- i < subRows.length - 1 ? ", " : ""
24989
- )
24990
- );
24991
- });
24992
- return React$1.createElement(
24993
- "span",
24994
- null,
24995
- previewValues
24996
- );
24997
- }, "AggregatedComponent"),
24613
+ onChange: (event) => onChange(event.target.value)
24614
+ }
24615
+ ),
24616
+ ExpanderComponent: ({ isExpanded }) => /* @__PURE__ */ React$1.createElement("div", { className: classNames("rt-expander", isExpanded && "-open") }, "•"),
24617
+ PivotValueComponent: ({ subRows, value }) => /* @__PURE__ */ React$1.createElement("span", null, value, " ", subRows && `(${subRows.length})`),
24618
+ AggregatedComponent: ({ subRows, column }) => {
24619
+ const previewValues = subRows.filter((d2) => typeof d2[column.id] !== "undefined").map((row, i) => (
24620
+ // eslint-disable-next-line react/no-array-index-key
24621
+ /* @__PURE__ */ React$1.createElement("span", { key: i }, row[column.id], i < subRows.length - 1 ? ", " : "")
24622
+ ));
24623
+ return /* @__PURE__ */ React$1.createElement("span", null, previewValues);
24624
+ },
24998
24625
  PivotComponent: void 0,
24999
24626
  // this is a computed default generated using
25000
24627
  // the ExpanderComponent and PivotValueComponent at run-time in methods.js
25001
24628
  PaginationComponent: ReactTablePagination,
25002
24629
  PreviousComponent: void 0,
25003
24630
  NextComponent: void 0,
25004
- LoadingComponent: /* @__PURE__ */ __name(function LoadingComponent(_ref10) {
25005
- var className = _ref10.className, loading = _ref10.loading, loadingText = _ref10.loadingText, rest = _objectWithoutProperties$5(_ref10, ["className", "loading", "loadingText"]);
25006
- return React$1.createElement(
25007
- "div",
25008
- _extends$j({ className: classNames("-loading", { "-active": loading }, className) }, rest),
25009
- React$1.createElement(
25010
- "div",
25011
- { className: "-loading-inner" },
25012
- loadingText
25013
- )
25014
- );
25015
- }, "LoadingComponent"),
24631
+ LoadingComponent: (_o) => {
24632
+ var _p = _o, {
24633
+ className,
24634
+ loading,
24635
+ loadingText
24636
+ } = _p, rest = __objRest(_p, [
24637
+ "className",
24638
+ "loading",
24639
+ "loadingText"
24640
+ ]);
24641
+ return /* @__PURE__ */ React$1.createElement("div", __spreadValues({ className: classNames("-loading", { "-active": loading }, className) }, rest), /* @__PURE__ */ React$1.createElement("div", { className: "-loading-inner" }, loadingText));
24642
+ },
25016
24643
  NoDataComponent: _.makeTemplateComponent("rt-noData", "NoData"),
25017
24644
  ResizerComponent: _.makeTemplateComponent("rt-resizer", "Resizer"),
25018
- PadRowComponent: /* @__PURE__ */ __name(function PadRowComponent() {
25019
- return React$1.createElement(
25020
- "span",
25021
- null,
25022
- " "
25023
- );
25024
- }, "PadRowComponent")
24645
+ PadRowComponent: () => /* @__PURE__ */ React$1.createElement("span", null, " ")
25025
24646
  };
25026
24647
  const propTypes = {
25027
24648
  // General
@@ -25095,44 +24716,46 @@ const propTypes = {
25095
24716
  getNoDataProps: PropTypes$1.func,
25096
24717
  getResizerProps: PropTypes$1.func,
25097
24718
  // Global Column Defaults
25098
- columns: PropTypes$1.arrayOf(PropTypes$1.shape({
25099
- // Renderers
25100
- Cell: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25101
- Header: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25102
- Footer: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25103
- Aggregated: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25104
- Pivot: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25105
- PivotValue: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25106
- Expander: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
25107
- Filter: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.func]),
25108
- // All Columns
25109
- sortable: PropTypes$1.bool,
25110
- // use table default
25111
- resizable: PropTypes$1.bool,
25112
- // use table default
25113
- filterable: PropTypes$1.bool,
25114
- // use table default
25115
- show: PropTypes$1.bool,
25116
- minWidth: PropTypes$1.number,
25117
- minResizeWidth: PropTypes$1.number,
25118
- // Cells only
25119
- className: PropTypes$1.string,
25120
- style: PropTypes$1.object,
25121
- getProps: PropTypes$1.func,
25122
- // Pivot only
25123
- aggregate: PropTypes$1.func,
25124
- // Headers only
25125
- headerClassName: PropTypes$1.string,
25126
- headerStyle: PropTypes$1.object,
25127
- getHeaderProps: PropTypes$1.func,
25128
- // Footers only
25129
- footerClassName: PropTypes$1.string,
25130
- footerStyle: PropTypes$1.object,
25131
- getFooterProps: PropTypes$1.func,
25132
- filterMethod: PropTypes$1.func,
25133
- filterAll: PropTypes$1.bool,
25134
- sortMethod: PropTypes$1.func
25135
- })),
24719
+ columns: PropTypes$1.arrayOf(
24720
+ PropTypes$1.shape({
24721
+ // Renderers
24722
+ Cell: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24723
+ Header: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24724
+ Footer: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24725
+ Aggregated: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24726
+ Pivot: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24727
+ PivotValue: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24728
+ Expander: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.string, PropTypes$1.func]),
24729
+ Filter: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.func]),
24730
+ // All Columns
24731
+ sortable: PropTypes$1.bool,
24732
+ // use table default
24733
+ resizable: PropTypes$1.bool,
24734
+ // use table default
24735
+ filterable: PropTypes$1.bool,
24736
+ // use table default
24737
+ show: PropTypes$1.bool,
24738
+ minWidth: PropTypes$1.number,
24739
+ minResizeWidth: PropTypes$1.number,
24740
+ // Cells only
24741
+ className: PropTypes$1.string,
24742
+ style: PropTypes$1.object,
24743
+ getProps: PropTypes$1.func,
24744
+ // Pivot only
24745
+ aggregate: PropTypes$1.func,
24746
+ // Headers only
24747
+ headerClassName: PropTypes$1.string,
24748
+ headerStyle: PropTypes$1.object,
24749
+ getHeaderProps: PropTypes$1.func,
24750
+ // Footers only
24751
+ footerClassName: PropTypes$1.string,
24752
+ footerStyle: PropTypes$1.object,
24753
+ getFooterProps: PropTypes$1.func,
24754
+ filterMethod: PropTypes$1.func,
24755
+ filterAll: PropTypes$1.bool,
24756
+ sortMethod: PropTypes$1.func
24757
+ })
24758
+ ),
25136
24759
  // Global Expander Column Defaults
25137
24760
  expanderDefaults: PropTypes$1.shape({
25138
24761
  sortable: PropTypes$1.bool,
@@ -25175,122 +24798,48 @@ const propTypes = {
25175
24798
  ResizerComponent: PropTypes$1.elementType,
25176
24799
  PadRowComponent: PropTypes$1.elementType
25177
24800
  };
25178
- var _slicedToArray$3 = function() {
25179
- function sliceIterator(arr, i) {
25180
- var _arr = [];
25181
- var _n = true;
25182
- var _d = false;
25183
- var _e = void 0;
25184
- try {
25185
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
25186
- _arr.push(_s.value);
25187
- if (i && _arr.length === i)
25188
- break;
25189
- }
25190
- } catch (err) {
25191
- _d = true;
25192
- _e = err;
25193
- } finally {
24801
+ const itemSizeEstimator = /* @__PURE__ */ __name(() => 41.36, "itemSizeEstimator");
24802
+ const ReactTableDefaults = defaultProps$1;
24803
+ const _ReactTable = class _ReactTable extends Methods(Lifecycle(React$1.Component)) {
24804
+ constructor(props) {
24805
+ super();
24806
+ this.getResolvedState = this.getResolvedState.bind(this);
24807
+ this.getDataModel = this.getDataModel.bind(this);
24808
+ this.getSortedData = this.getSortedData.bind(this);
24809
+ this.fireFetchData = this.fireFetchData.bind(this);
24810
+ this.getPropOrState = this.getPropOrState.bind(this);
24811
+ this.getStateOrProp = this.getStateOrProp.bind(this);
24812
+ this.filterData = this.filterData.bind(this);
24813
+ this.sortData = this.sortData.bind(this);
24814
+ this.getMinRows = this.getMinRows.bind(this);
24815
+ this.onPageChange = this.onPageChange.bind(this);
24816
+ this.onPageSizeChange = this.onPageSizeChange.bind(this);
24817
+ this.sortColumn = this.sortColumn.bind(this);
24818
+ this.filterColumn = this.filterColumn.bind(this);
24819
+ this.resizeColumnStart = this.resizeColumnStart.bind(this);
24820
+ this.resizeColumnEnd = this.resizeColumnEnd.bind(this);
24821
+ this.resizeColumnMoving = this.resizeColumnMoving.bind(this);
24822
+ setTimeout(() => {
25194
24823
  try {
25195
- if (!_n && _i["return"])
25196
- _i["return"]();
25197
- } finally {
25198
- if (_d)
25199
- throw _e;
25200
- }
25201
- }
25202
- return _arr;
25203
- }
25204
- __name(sliceIterator, "sliceIterator");
25205
- return function(arr, i) {
25206
- if (Array.isArray(arr)) {
25207
- return arr;
25208
- } else if (Symbol.iterator in Object(arr)) {
25209
- return sliceIterator(arr, i);
25210
- } else {
25211
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
25212
- }
25213
- };
25214
- }();
25215
- var _extends$i = Object.assign || function(target) {
25216
- for (var i = 1; i < arguments.length; i++) {
25217
- var source = arguments[i];
25218
- for (var key in source) {
25219
- if (Object.prototype.hasOwnProperty.call(source, key)) {
25220
- target[key] = source[key];
24824
+ const newResized = this.props.defaultResized || [];
24825
+ this.tableRef.querySelectorAll(".tg-react-table-column-header").forEach((th) => {
24826
+ const { width } = th.parentNode.parentNode.getBoundingClientRect();
24827
+ const id2 = th.getAttribute("data-path");
24828
+ if (!newResized.find((x2) => x2.id === id2)) {
24829
+ newResized.push({
24830
+ id: id2,
24831
+ value: width
24832
+ });
24833
+ }
24834
+ });
24835
+ this.setState({
24836
+ resized: newResized
24837
+ });
24838
+ } catch (e2) {
24839
+ console.warn("TNW: Error setting initial table column widths (please contact @tnrich if you see this error. thanks!):", e2);
25221
24840
  }
25222
- }
25223
- }
25224
- return target;
25225
- };
25226
- var _createClass$9 = function() {
25227
- function defineProperties2(target, props) {
25228
- for (var i = 0; i < props.length; i++) {
25229
- var descriptor2 = props[i];
25230
- descriptor2.enumerable = descriptor2.enumerable || false;
25231
- descriptor2.configurable = true;
25232
- if ("value" in descriptor2)
25233
- descriptor2.writable = true;
25234
- Object.defineProperty(target, descriptor2.key, descriptor2);
25235
- }
25236
- }
25237
- __name(defineProperties2, "defineProperties");
25238
- return function(Constructor, protoProps, staticProps) {
25239
- if (protoProps)
25240
- defineProperties2(Constructor.prototype, protoProps);
25241
- if (staticProps)
25242
- defineProperties2(Constructor, staticProps);
25243
- return Constructor;
25244
- };
25245
- }();
25246
- function _classCallCheck$e(instance, Constructor) {
25247
- if (!(instance instanceof Constructor)) {
25248
- throw new TypeError("Cannot call a class as a function");
25249
- }
25250
- }
25251
- __name(_classCallCheck$e, "_classCallCheck$e");
25252
- function _possibleConstructorReturn$e(self2, call2) {
25253
- if (!self2) {
25254
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
25255
- }
25256
- return call2 && (typeof call2 === "object" || typeof call2 === "function") ? call2 : self2;
25257
- }
25258
- __name(_possibleConstructorReturn$e, "_possibleConstructorReturn$e");
25259
- function _inherits$e(subClass, superClass) {
25260
- if (typeof superClass !== "function" && superClass !== null) {
25261
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
25262
- }
25263
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
25264
- if (superClass)
25265
- Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
25266
- }
25267
- __name(_inherits$e, "_inherits$e");
25268
- var itemSizeEstimator = /* @__PURE__ */ __name(function itemSizeEstimator2() {
25269
- return 41.36;
25270
- }, "itemSizeEstimator");
25271
- var ReactTableDefaults = defaultProps$1;
25272
- var ReactTable = function(_Methods) {
25273
- _inherits$e(ReactTable2, _Methods);
25274
- function ReactTable2(props) {
25275
- _classCallCheck$e(this, ReactTable2);
25276
- var _this = _possibleConstructorReturn$e(this, (ReactTable2.__proto__ || Object.getPrototypeOf(ReactTable2)).call(this));
25277
- _this.getResolvedState = _this.getResolvedState.bind(_this);
25278
- _this.getDataModel = _this.getDataModel.bind(_this);
25279
- _this.getSortedData = _this.getSortedData.bind(_this);
25280
- _this.fireFetchData = _this.fireFetchData.bind(_this);
25281
- _this.getPropOrState = _this.getPropOrState.bind(_this);
25282
- _this.getStateOrProp = _this.getStateOrProp.bind(_this);
25283
- _this.filterData = _this.filterData.bind(_this);
25284
- _this.sortData = _this.sortData.bind(_this);
25285
- _this.getMinRows = _this.getMinRows.bind(_this);
25286
- _this.onPageChange = _this.onPageChange.bind(_this);
25287
- _this.onPageSizeChange = _this.onPageSizeChange.bind(_this);
25288
- _this.sortColumn = _this.sortColumn.bind(_this);
25289
- _this.filterColumn = _this.filterColumn.bind(_this);
25290
- _this.resizeColumnStart = _this.resizeColumnStart.bind(_this);
25291
- _this.resizeColumnEnd = _this.resizeColumnEnd.bind(_this);
25292
- _this.resizeColumnMoving = _this.resizeColumnMoving.bind(_this);
25293
- _this.state = {
24841
+ }, 0);
24842
+ this.state = {
25294
24843
  page: props.defaultPage,
25295
24844
  pageSize: props.defaultPageSize,
25296
24845
  sorted: props.defaultSorted,
@@ -25300,588 +24849,673 @@ var ReactTable = function(_Methods) {
25300
24849
  currentlyResizing: false,
25301
24850
  skipNextSort: false
25302
24851
  };
25303
- return _this;
25304
24852
  }
25305
- __name(ReactTable2, "ReactTable");
25306
- _createClass$9(ReactTable2, [{
25307
- key: "render",
25308
- value: /* @__PURE__ */ __name(function render3() {
25309
- var _this2 = this;
25310
- var resolvedState = this.getResolvedState();
25311
- 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;
25312
- var startRow = pageSize * page;
25313
- var endRow = startRow + pageSize;
25314
- var pageRows = manual ? resolvedData : sortedData.slice(startRow, endRow);
25315
- var minRows = this.getMinRows();
25316
- var padRows = _.range(Math.max(minRows - pageRows.length, 0));
25317
- var hasColumnFooter = allVisibleColumns.some(function(d2) {
25318
- return d2.Footer;
25319
- });
25320
- var hasFilters = filterable || allVisibleColumns.some(function(d2) {
25321
- return d2.filterable;
25322
- });
25323
- var recurseRowsViewIndex = /* @__PURE__ */ __name(function recurseRowsViewIndex2(rows) {
25324
- var path2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
25325
- var index2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
25326
- return [rows.map(function(row, i) {
25327
- index2 += 1;
25328
- var rowWithViewIndex = _extends$i({}, row, {
25329
- _viewIndex: index2
25330
- });
25331
- var newPath = path2.concat([i]);
25332
- if (rowWithViewIndex[subRowsKey] && _.get(expanded, newPath)) {
25333
- var _recurseRowsViewIndex = recurseRowsViewIndex2(rowWithViewIndex[subRowsKey], newPath, index2);
25334
- var _recurseRowsViewIndex2 = _slicedToArray$3(_recurseRowsViewIndex, 2);
25335
- rowWithViewIndex[subRowsKey] = _recurseRowsViewIndex2[0];
25336
- index2 = _recurseRowsViewIndex2[1];
25337
- }
25338
- return rowWithViewIndex;
25339
- }), index2];
25340
- }, "recurseRowsViewIndex");
25341
- var _recurseRowsViewIndex3 = recurseRowsViewIndex(pageRows);
25342
- var _recurseRowsViewIndex4 = _slicedToArray$3(_recurseRowsViewIndex3, 1);
25343
- pageRows = _recurseRowsViewIndex4[0];
25344
- var canPrevious = page > 0;
25345
- var canNext = page + 1 < pages;
25346
- var rowMinWidth = _.sum(allVisibleColumns.map(function(d2) {
25347
- var resizedColumn = resized.find(function(x2) {
25348
- return x2.id === d2.id;
25349
- }) || {};
24853
+ render() {
24854
+ const resolvedState = this.getResolvedState();
24855
+ const {
24856
+ children,
24857
+ className,
24858
+ style: style2,
24859
+ getProps,
24860
+ getTableProps,
24861
+ getTheadGroupProps,
24862
+ getTheadGroupTrProps,
24863
+ getTheadGroupThProps,
24864
+ getTheadProps,
24865
+ getTheadTrProps,
24866
+ getTheadThProps,
24867
+ getTheadFilterProps,
24868
+ getTheadFilterTrProps,
24869
+ getTheadFilterThProps,
24870
+ getTbodyProps,
24871
+ getTrGroupProps,
24872
+ getTrProps,
24873
+ getTdProps,
24874
+ getTfootProps,
24875
+ getTfootTrProps,
24876
+ getTfootTdProps,
24877
+ getPaginationProps,
24878
+ getLoadingProps,
24879
+ getNoDataProps,
24880
+ getResizerProps,
24881
+ showPagination,
24882
+ showPaginationTop,
24883
+ showPaginationBottom,
24884
+ manual,
24885
+ loadingText,
24886
+ noDataText,
24887
+ sortable,
24888
+ multiSort,
24889
+ resizable,
24890
+ filterable,
24891
+ // Pivoting State
24892
+ pivotIDKey,
24893
+ pivotValKey,
24894
+ pivotBy,
24895
+ subRowsKey,
24896
+ aggregatedKey,
24897
+ originalKey,
24898
+ indexKey,
24899
+ groupedByPivotKey,
24900
+ // State
24901
+ loading,
24902
+ pageSize,
24903
+ page,
24904
+ sorted,
24905
+ filtered,
24906
+ resized,
24907
+ expanded,
24908
+ pages,
24909
+ onExpandedChange,
24910
+ // Components
24911
+ TableComponent,
24912
+ TheadComponent,
24913
+ TbodyComponent,
24914
+ additionalBodyEl,
24915
+ TrGroupComponent,
24916
+ TrComponent,
24917
+ ThComponent,
24918
+ TdComponent,
24919
+ TfootComponent,
24920
+ PaginationComponent,
24921
+ LoadingComponent: LoadingComponent2,
24922
+ SubComponent,
24923
+ NoDataComponent,
24924
+ ResizerComponent,
24925
+ ExpanderComponent,
24926
+ PivotValueComponent,
24927
+ PivotComponent,
24928
+ AggregatedComponent,
24929
+ FilterComponent,
24930
+ PadRowComponent,
24931
+ // Data model
24932
+ resolvedData,
24933
+ allVisibleColumns,
24934
+ headerGroups,
24935
+ hasHeaderGroups,
24936
+ // Sorted Data
24937
+ sortedData,
24938
+ currentlyResizing
24939
+ } = resolvedState;
24940
+ const startRow = pageSize * page;
24941
+ const endRow = startRow + pageSize;
24942
+ let pageRows = manual ? resolvedData : sortedData.slice(startRow, endRow);
24943
+ const minRows = this.getMinRows();
24944
+ const padRows = _.range(Math.max(minRows - pageRows.length, 0));
24945
+ const hasColumnFooter = allVisibleColumns.some((d2) => d2.Footer);
24946
+ const hasFilters = filterable || allVisibleColumns.some((d2) => d2.filterable);
24947
+ const recurseRowsViewIndex = /* @__PURE__ */ __name((rows, path2 = [], index2 = -1) => [
24948
+ rows.map((row, i) => {
24949
+ index2 += 1;
24950
+ const rowWithViewIndex = __spreadProps(__spreadValues({}, row), {
24951
+ _viewIndex: index2
24952
+ });
24953
+ const newPath = path2.concat([i]);
24954
+ if (rowWithViewIndex[subRowsKey] && _.get(expanded, newPath)) {
24955
+ [rowWithViewIndex[subRowsKey], index2] = recurseRowsViewIndex(
24956
+ rowWithViewIndex[subRowsKey],
24957
+ newPath,
24958
+ index2
24959
+ );
24960
+ }
24961
+ return rowWithViewIndex;
24962
+ }),
24963
+ index2
24964
+ ], "recurseRowsViewIndex");
24965
+ [pageRows] = recurseRowsViewIndex(pageRows);
24966
+ const canPrevious = page > 0;
24967
+ const canNext = page + 1 < pages;
24968
+ const rowMinWidth = _.sum(
24969
+ allVisibleColumns.map((d2) => {
24970
+ const resizedColumn = resized.find((x2) => x2.id === d2.id) || {};
25350
24971
  return _.getFirstDefined(resizedColumn.value, d2.width, d2.minWidth);
25351
- }));
25352
- var rowIndex = -1;
25353
- var finalState = _extends$i({}, resolvedState, {
25354
- startRow,
25355
- endRow,
25356
- pageRows,
25357
- minRows,
25358
- padRows,
25359
- hasColumnFooter,
25360
- canPrevious,
25361
- canNext,
25362
- rowMinWidth
25363
- });
25364
- var rootProps = _.splitProps(getProps(finalState, void 0, void 0, this));
25365
- var tableProps = _.splitProps(getTableProps(finalState, void 0, void 0, this));
25366
- var tBodyProps = _.splitProps(getTbodyProps(finalState, void 0, void 0, this));
25367
- var loadingProps = getLoadingProps(finalState, void 0, void 0, this);
25368
- var noDataProps = getNoDataProps(finalState, void 0, void 0, this);
25369
- var makeHeaderGroup = /* @__PURE__ */ __name(function makeHeaderGroup2(column, i) {
25370
- var resizedValue = /* @__PURE__ */ __name(function resizedValue2(col) {
25371
- return (resized.find(function(x2) {
25372
- return x2.id === col.id;
25373
- }) || {}).value;
25374
- }, "resizedValue");
25375
- var flex2 = _.sum(column.columns.map(function(col) {
25376
- return col.width || resizedValue(col) ? 0 : col.minWidth;
25377
- }));
25378
- var width = _.sum(column.columns.map(function(col) {
25379
- return _.getFirstDefined(resizedValue(col), col.width, col.minWidth);
25380
- }));
25381
- var maxWidth = _.sum(column.columns.map(function(col) {
25382
- return _.getFirstDefined(resizedValue(col), col.width, col.maxWidth);
25383
- }));
25384
- var theadGroupThProps = _.splitProps(getTheadGroupThProps(finalState, void 0, column, _this2));
25385
- var columnHeaderProps = _.splitProps(column.getHeaderProps(finalState, void 0, column, _this2));
25386
- var classes = [column.headerClassName, theadGroupThProps.className, columnHeaderProps.className];
25387
- var styles2 = _extends$i({}, column.headerStyle, theadGroupThProps.style, columnHeaderProps.style);
25388
- var rest = _extends$i({}, theadGroupThProps.rest, columnHeaderProps.rest);
25389
- var flexStyles = {
25390
- flex: flex2 + " 0 auto",
25391
- width: _.asPx(width),
25392
- maxWidth: _.asPx(maxWidth)
25393
- };
25394
- return React$1.createElement(
25395
- ThComponent2,
25396
- _extends$i({
25397
- key: i + "-" + column.id,
25398
- className: classNames(classes),
25399
- style: _extends$i({}, styles2, flexStyles)
25400
- }, rest),
25401
- _.normalizeComponent(column.Header, {
25402
- data: sortedData,
25403
- column
24972
+ })
24973
+ );
24974
+ let rowIndex = -1;
24975
+ const finalState = __spreadProps(__spreadValues({}, resolvedState), {
24976
+ startRow,
24977
+ endRow,
24978
+ pageRows,
24979
+ minRows,
24980
+ padRows,
24981
+ hasColumnFooter,
24982
+ canPrevious,
24983
+ canNext,
24984
+ rowMinWidth
24985
+ });
24986
+ const rootProps = _.splitProps(getProps(finalState, void 0, void 0, this));
24987
+ const tableProps = _.splitProps(getTableProps(finalState, void 0, void 0, this));
24988
+ const tBodyProps = _.splitProps(getTbodyProps(finalState, void 0, void 0, this));
24989
+ const loadingProps = getLoadingProps(finalState, void 0, void 0, this);
24990
+ const noDataProps = getNoDataProps(finalState, void 0, void 0, this);
24991
+ const makeHeaderGroup = /* @__PURE__ */ __name((column, i) => {
24992
+ const resizedValue = /* @__PURE__ */ __name((col) => (resized.find((x2) => x2.id === col.id) || {}).value, "resizedValue");
24993
+ const flex2 = _.sum(
24994
+ column.columns.map((col) => col.width || resizedValue(col) ? 0 : col.minWidth)
24995
+ );
24996
+ const width = _.sum(
24997
+ column.columns.map((col) => _.getFirstDefined(resizedValue(col), col.width, col.minWidth))
24998
+ );
24999
+ const maxWidth = _.sum(
25000
+ column.columns.map((col) => _.getFirstDefined(resizedValue(col), col.width, col.maxWidth))
25001
+ );
25002
+ const theadGroupThProps = _.splitProps(
25003
+ getTheadGroupThProps(finalState, void 0, column, this)
25004
+ );
25005
+ const columnHeaderProps = _.splitProps(
25006
+ column.getHeaderProps(finalState, void 0, column, this)
25007
+ );
25008
+ const classes = [
25009
+ column.headerClassName,
25010
+ theadGroupThProps.className,
25011
+ columnHeaderProps.className
25012
+ ];
25013
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, column.headerStyle), theadGroupThProps.style), columnHeaderProps.style);
25014
+ const rest = __spreadValues(__spreadValues({}, theadGroupThProps.rest), columnHeaderProps.rest);
25015
+ const flexStyles = {
25016
+ flex: `${flex2} 0 auto`,
25017
+ width: _.asPx(width),
25018
+ maxWidth: _.asPx(maxWidth)
25019
+ };
25020
+ return /* @__PURE__ */ React$1.createElement(
25021
+ ThComponent,
25022
+ __spreadValues({
25023
+ key: `${i}-${column.id}`,
25024
+ className: classNames(classes),
25025
+ style: __spreadValues(__spreadValues({}, styles2), flexStyles)
25026
+ }, rest),
25027
+ _.normalizeComponent(column.Header, {
25028
+ data: sortedData,
25029
+ column
25030
+ })
25031
+ );
25032
+ }, "makeHeaderGroup");
25033
+ const makeHeaderGroups = /* @__PURE__ */ __name(() => {
25034
+ const theadGroupProps = _.splitProps(
25035
+ getTheadGroupProps(finalState, void 0, void 0, this)
25036
+ );
25037
+ const theadGroupTrProps = _.splitProps(
25038
+ getTheadGroupTrProps(finalState, void 0, void 0, this)
25039
+ );
25040
+ return /* @__PURE__ */ React$1.createElement(
25041
+ TheadComponent,
25042
+ __spreadValues({
25043
+ className: classNames("-headerGroups", theadGroupProps.className),
25044
+ style: __spreadProps(__spreadValues({}, theadGroupProps.style), {
25045
+ minWidth: `${rowMinWidth}px`
25404
25046
  })
25405
- );
25406
- }, "makeHeaderGroup");
25407
- var makeHeaderGroups = /* @__PURE__ */ __name(function makeHeaderGroups2() {
25408
- var theadGroupProps = _.splitProps(getTheadGroupProps(finalState, void 0, void 0, _this2));
25409
- var theadGroupTrProps = _.splitProps(getTheadGroupTrProps(finalState, void 0, void 0, _this2));
25410
- return React$1.createElement(
25411
- TheadComponent,
25412
- _extends$i({
25413
- className: classNames("-headerGroups", theadGroupProps.className),
25414
- style: _extends$i({}, theadGroupProps.style, {
25415
- minWidth: rowMinWidth + "px"
25416
- })
25417
- }, theadGroupProps.rest),
25418
- React$1.createElement(
25419
- TrComponent2,
25420
- _extends$i({
25421
- className: theadGroupTrProps.className,
25422
- style: theadGroupTrProps.style
25423
- }, theadGroupTrProps.rest),
25424
- headerGroups.map(makeHeaderGroup)
25425
- )
25426
- );
25427
- }, "makeHeaderGroups");
25428
- var makeHeader = /* @__PURE__ */ __name(function makeHeader2(column, i) {
25429
- var resizedCol = resized.find(function(x2) {
25430
- return x2.id === column.id;
25431
- }) || {};
25432
- var sort2 = sorted.find(function(d2) {
25433
- return d2.id === column.id;
25434
- });
25435
- var show = typeof column.show === "function" ? column.show() : column.show;
25436
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25437
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25438
- var theadThProps = _.splitProps(getTheadThProps(finalState, void 0, column, _this2));
25439
- var columnHeaderProps = _.splitProps(column.getHeaderProps(finalState, void 0, column, _this2));
25440
- var classes = [column.headerClassName, theadThProps.className, columnHeaderProps.className];
25441
- var styles2 = _extends$i({}, column.headerStyle, theadThProps.style, columnHeaderProps.style);
25442
- var rest = _extends$i({}, theadThProps.rest, columnHeaderProps.rest);
25443
- var isResizable = _.getFirstDefined(column.resizable, resizable, false);
25444
- var resizer = isResizable ? React$1.createElement(ResizerComponent, _extends$i({
25445
- onMouseDown: /* @__PURE__ */ __name(function onMouseDown2(e2) {
25446
- return _this2.resizeColumnStart(e2, column, false);
25447
- }, "onMouseDown"),
25448
- onTouchStart: /* @__PURE__ */ __name(function onTouchStart(e2) {
25449
- return _this2.resizeColumnStart(e2, column, true);
25450
- }, "onTouchStart")
25451
- }, getResizerProps("finalState", void 0, column, _this2))) : null;
25452
- var isSortable = _.getFirstDefined(column.sortable, sortable, false);
25453
- return React$1.createElement(
25454
- ThComponent2,
25455
- _extends$i({
25456
- key: i + "-" + column.id,
25457
- 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"),
25458
- style: _extends$i({}, styles2, {
25459
- flex: width + " 0 auto",
25460
- width: _.asPx(width),
25461
- maxWidth: _.asPx(maxWidth)
25462
- }),
25463
- toggleSort: /* @__PURE__ */ __name(function toggleSort(e2) {
25464
- if (isSortable)
25465
- _this2.sortColumn(column, multiSort ? e2.shiftKey : false);
25466
- }, "toggleSort")
25467
- }, rest),
25468
- React$1.createElement(
25469
- "div",
25470
- { className: classNames(isResizable && "rt-resizable-header-content") },
25471
- _.normalizeComponent(column.Header, {
25472
- data: sortedData,
25473
- column
25474
- })
25047
+ }, theadGroupProps.rest),
25048
+ /* @__PURE__ */ React$1.createElement(
25049
+ TrComponent,
25050
+ __spreadValues({
25051
+ className: theadGroupTrProps.className,
25052
+ style: theadGroupTrProps.style
25053
+ }, theadGroupTrProps.rest),
25054
+ headerGroups.map(makeHeaderGroup)
25055
+ )
25056
+ );
25057
+ }, "makeHeaderGroups");
25058
+ const makeHeader = /* @__PURE__ */ __name((column, i) => {
25059
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25060
+ const sort2 = sorted.find((d2) => d2.id === column.id);
25061
+ const show = typeof column.show === "function" ? column.show() : column.show;
25062
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25063
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25064
+ const theadThProps = _.splitProps(getTheadThProps(finalState, void 0, column, this));
25065
+ const columnHeaderProps = _.splitProps(
25066
+ column.getHeaderProps(finalState, void 0, column, this)
25067
+ );
25068
+ const classes = [column.headerClassName, theadThProps.className, columnHeaderProps.className];
25069
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, column.headerStyle), theadThProps.style), columnHeaderProps.style);
25070
+ const rest = __spreadValues(__spreadValues({}, theadThProps.rest), columnHeaderProps.rest);
25071
+ const isResizable = _.getFirstDefined(column.resizable, resizable, false);
25072
+ const resizer = isResizable ? /* @__PURE__ */ React$1.createElement(
25073
+ ResizerComponent,
25074
+ __spreadValues({
25075
+ onMouseDown: (e2) => this.resizeColumnStart(e2, column, false),
25076
+ onTouchStart: (e2) => this.resizeColumnStart(e2, column, true)
25077
+ }, getResizerProps("finalState", void 0, column, this))
25078
+ ) : null;
25079
+ const isSortable = _.getFirstDefined(column.sortable, sortable, false);
25080
+ return /* @__PURE__ */ React$1.createElement(
25081
+ ThComponent,
25082
+ __spreadValues({
25083
+ key: `${i}-${column.id}`,
25084
+ className: classNames(
25085
+ classes,
25086
+ isResizable && "rt-resizable-header",
25087
+ sort2 ? sort2.desc ? "-sort-desc" : "-sort-asc" : "",
25088
+ isSortable && "-cursor-pointer",
25089
+ !show && "-hidden",
25090
+ pivotBy && pivotBy.slice(0, -1).includes(column.id) && "rt-header-pivot"
25475
25091
  ),
25476
- resizer
25477
- );
25478
- }, "makeHeader");
25479
- var makeHeaders = /* @__PURE__ */ __name(function makeHeaders2() {
25480
- var theadProps = _.splitProps(getTheadProps(finalState, void 0, void 0, _this2));
25481
- var theadTrProps = _.splitProps(getTheadTrProps(finalState, void 0, void 0, _this2));
25482
- return React$1.createElement(
25483
- TheadComponent,
25484
- _extends$i({
25485
- className: classNames("-header", theadProps.className),
25486
- style: _extends$i({}, theadProps.style, {
25487
- minWidth: rowMinWidth + "px"
25488
- })
25489
- }, theadProps.rest),
25490
- React$1.createElement(
25491
- TrComponent2,
25492
- _extends$i({
25493
- className: theadTrProps.className,
25494
- style: theadTrProps.style
25495
- }, theadTrProps.rest),
25496
- allVisibleColumns.map(makeHeader)
25497
- )
25498
- );
25499
- }, "makeHeaders");
25500
- var makeFilter = /* @__PURE__ */ __name(function makeFilter2(column, i) {
25501
- var resizedCol = resized.find(function(x2) {
25502
- return x2.id === column.id;
25503
- }) || {};
25504
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25505
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25506
- var theadFilterThProps = _.splitProps(getTheadFilterThProps(finalState, void 0, column, _this2));
25507
- var columnHeaderProps = _.splitProps(column.getHeaderProps(finalState, void 0, column, _this2));
25508
- var classes = [column.headerClassName, theadFilterThProps.className, columnHeaderProps.className];
25509
- var styles2 = _extends$i({}, column.headerStyle, theadFilterThProps.style, columnHeaderProps.style);
25510
- var rest = _extends$i({}, theadFilterThProps.rest, columnHeaderProps.rest);
25511
- var filter = filtered.find(function(filter2) {
25512
- return filter2.id === column.id;
25513
- });
25514
- var ResolvedFilterComponent = column.Filter || FilterComponent2;
25515
- var isFilterable = _.getFirstDefined(column.filterable, filterable, false);
25516
- return React$1.createElement(
25517
- ThComponent2,
25518
- _extends$i({
25519
- key: i + "-" + column.id,
25520
- className: classNames(classes),
25521
- style: _extends$i({}, styles2, {
25522
- flex: width + " 0 auto",
25523
- width: _.asPx(width),
25524
- maxWidth: _.asPx(maxWidth)
25525
- })
25526
- }, rest),
25527
- isFilterable ? _.normalizeComponent(ResolvedFilterComponent, {
25092
+ style: __spreadProps(__spreadValues({}, styles2), {
25093
+ flex: `${width} 0 auto`,
25094
+ width: _.asPx(width),
25095
+ maxWidth: _.asPx(maxWidth)
25096
+ }),
25097
+ toggleSort: (e2) => {
25098
+ if (isSortable)
25099
+ this.sortColumn(column, multiSort ? e2.shiftKey : false);
25100
+ }
25101
+ }, rest),
25102
+ /* @__PURE__ */ React$1.createElement("div", { className: classNames(isResizable && "rt-resizable-header-content") }, _.normalizeComponent(column.Header, {
25103
+ data: sortedData,
25104
+ column
25105
+ })),
25106
+ resizer
25107
+ );
25108
+ }, "makeHeader");
25109
+ const makeHeaders = /* @__PURE__ */ __name(() => {
25110
+ const theadProps = _.splitProps(getTheadProps(finalState, void 0, void 0, this));
25111
+ const theadTrProps = _.splitProps(getTheadTrProps(finalState, void 0, void 0, this));
25112
+ return /* @__PURE__ */ React$1.createElement(
25113
+ TheadComponent,
25114
+ __spreadValues({
25115
+ className: classNames("-header", theadProps.className),
25116
+ style: __spreadProps(__spreadValues({}, theadProps.style), {
25117
+ minWidth: `${rowMinWidth}px`
25118
+ })
25119
+ }, theadProps.rest),
25120
+ /* @__PURE__ */ React$1.createElement(
25121
+ TrComponent,
25122
+ __spreadValues({
25123
+ className: theadTrProps.className,
25124
+ style: theadTrProps.style
25125
+ }, theadTrProps.rest),
25126
+ allVisibleColumns.map(makeHeader)
25127
+ )
25128
+ );
25129
+ }, "makeHeaders");
25130
+ const makeFilter = /* @__PURE__ */ __name((column, i) => {
25131
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25132
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25133
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25134
+ const theadFilterThProps = _.splitProps(
25135
+ getTheadFilterThProps(finalState, void 0, column, this)
25136
+ );
25137
+ const columnHeaderProps = _.splitProps(
25138
+ column.getHeaderProps(finalState, void 0, column, this)
25139
+ );
25140
+ const classes = [
25141
+ column.headerClassName,
25142
+ theadFilterThProps.className,
25143
+ columnHeaderProps.className
25144
+ ];
25145
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, column.headerStyle), theadFilterThProps.style), columnHeaderProps.style);
25146
+ const rest = __spreadValues(__spreadValues({}, theadFilterThProps.rest), columnHeaderProps.rest);
25147
+ const filter = filtered.find((filter2) => filter2.id === column.id);
25148
+ const ResolvedFilterComponent = column.Filter || FilterComponent;
25149
+ const isFilterable = _.getFirstDefined(column.filterable, filterable, false);
25150
+ return /* @__PURE__ */ React$1.createElement(
25151
+ ThComponent,
25152
+ __spreadValues({
25153
+ key: `${i}-${column.id}`,
25154
+ className: classNames(classes),
25155
+ style: __spreadProps(__spreadValues({}, styles2), {
25156
+ flex: `${width} 0 auto`,
25157
+ width: _.asPx(width),
25158
+ maxWidth: _.asPx(maxWidth)
25159
+ })
25160
+ }, rest),
25161
+ isFilterable ? _.normalizeComponent(
25162
+ ResolvedFilterComponent,
25163
+ {
25528
25164
  column,
25529
25165
  filter,
25530
- onChange: /* @__PURE__ */ __name(function onChange(value) {
25531
- return _this2.filterColumn(column, value);
25532
- }, "onChange")
25533
- }, defaultProps$1.column.Filter) : null
25534
- );
25535
- }, "makeFilter");
25536
- var makeFilters = /* @__PURE__ */ __name(function makeFilters2() {
25537
- var theadFilterProps = _.splitProps(getTheadFilterProps(finalState, void 0, void 0, _this2));
25538
- var theadFilterTrProps = _.splitProps(getTheadFilterTrProps(finalState, void 0, void 0, _this2));
25539
- return React$1.createElement(
25540
- TheadComponent,
25541
- _extends$i({
25542
- className: classNames("-filters", theadFilterProps.className),
25543
- style: _extends$i({}, theadFilterProps.style, {
25544
- minWidth: rowMinWidth + "px"
25545
- })
25546
- }, theadFilterProps.rest),
25547
- React$1.createElement(
25548
- TrComponent2,
25549
- _extends$i({
25550
- className: theadFilterTrProps.className,
25551
- style: theadFilterTrProps.style
25552
- }, theadFilterTrProps.rest),
25553
- allVisibleColumns.map(makeFilter)
25554
- )
25555
- );
25556
- }, "makeFilters");
25557
- var makePageRow = /* @__PURE__ */ __name(function makePageRow2(row, i) {
25558
- var path2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
25559
- var rowInfo = {
25560
- original: row[originalKey],
25561
- row,
25562
- index: row[indexKey],
25563
- viewIndex: rowIndex += 1,
25564
- pageSize,
25565
- page,
25566
- level: path2.length,
25567
- nestingPath: path2.concat([i]),
25568
- aggregated: row[aggregatedKey],
25569
- groupedByPivot: row[groupedByPivotKey],
25570
- subRows: row[subRowsKey]
25571
- };
25572
- var isExpanded = _.get(expanded, rowInfo.nestingPath);
25573
- var trGroupProps = getTrGroupProps(finalState, rowInfo, void 0, _this2);
25574
- var trProps = _.splitProps(getTrProps(finalState, rowInfo, void 0, _this2));
25575
- return React$1.createElement(
25576
- TrGroupComponent2,
25577
- _extends$i({ key: rowInfo.nestingPath.join("_") }, trGroupProps),
25578
- React$1.createElement(
25579
- TrComponent2,
25580
- _extends$i({
25581
- className: classNames(trProps.className, row._viewIndex % 2 ? "-even" : "-odd"),
25582
- style: trProps.style
25583
- }, trProps.rest),
25584
- allVisibleColumns.map(function(column, i2) {
25585
- var resizedCol = resized.find(function(x2) {
25586
- return x2.id === column.id;
25587
- }) || {};
25588
- var show = typeof column.show === "function" ? column.show() : column.show;
25589
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25590
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25591
- var tdProps = _.splitProps(getTdProps(finalState, rowInfo, column, _this2));
25592
- var columnProps = _.splitProps(column.getProps(finalState, rowInfo, column, _this2));
25593
- var classes = [tdProps.className, column.className, columnProps.className];
25594
- var styles2 = _extends$i({}, tdProps.style, column.style, columnProps.style);
25595
- var cellInfo = _extends$i({}, rowInfo, {
25596
- isExpanded,
25597
- column: _extends$i({}, column),
25598
- value: rowInfo.row[column.id],
25599
- pivoted: column.pivoted,
25600
- expander: column.expander,
25601
- resized,
25602
- show,
25603
- width,
25604
- maxWidth,
25605
- tdProps,
25606
- columnProps,
25607
- classes,
25608
- styles: styles2
25609
- });
25610
- var value = cellInfo.value;
25611
- var useOnExpanderClick = void 0;
25612
- var isBranch = void 0;
25613
- var isPreview = void 0;
25614
- var onExpanderClick = /* @__PURE__ */ __name(function onExpanderClick2(e2) {
25615
- var newExpanded = _.clone(expanded);
25616
- if (isExpanded) {
25617
- newExpanded = _.set(newExpanded, cellInfo.nestingPath, false);
25618
- } else {
25619
- newExpanded = _.set(newExpanded, cellInfo.nestingPath, {});
25620
- }
25621
- return _this2.setStateWithData({
25622
- expanded: newExpanded
25623
- }, function() {
25624
- return onExpandedChange && onExpandedChange(newExpanded, cellInfo.nestingPath, e2, cellInfo);
25625
- });
25626
- }, "onExpanderClick");
25627
- var resolvedCell = _.normalizeComponent(column.Cell, cellInfo, value);
25628
- var ResolvedAggregatedComponent = column.Aggregated || (!column.aggregate ? AggregatedComponent2 : column.Cell);
25629
- var ResolvedExpanderComponent = column.Expander || ExpanderComponent2;
25630
- var ResolvedPivotValueComponent = column.PivotValue || PivotValueComponent2;
25631
- var DefaultResolvedPivotComponent = PivotComponent || function(props) {
25632
- return React$1.createElement(
25633
- "div",
25634
- null,
25635
- React$1.createElement(ResolvedExpanderComponent, props),
25636
- React$1.createElement(ResolvedPivotValueComponent, props)
25637
- );
25638
- };
25639
- var ResolvedPivotComponent = column.Pivot || DefaultResolvedPivotComponent;
25640
- if (cellInfo.pivoted || cellInfo.expander) {
25641
- cellInfo.expandable = true;
25642
- useOnExpanderClick = true;
25643
- if (cellInfo.pivoted && !cellInfo.subRows && !SubComponent) {
25644
- cellInfo.expandable = false;
25645
- }
25646
- }
25647
- if (cellInfo.pivoted) {
25648
- isBranch = rowInfo.row[pivotIDKey] === column.id && cellInfo.subRows;
25649
- isPreview = pivotBy.indexOf(column.id) > pivotBy.indexOf(rowInfo.row[pivotIDKey]) && cellInfo.subRows;
25650
- if (isBranch) {
25651
- resolvedCell = _.normalizeComponent(ResolvedPivotComponent, _extends$i({}, cellInfo, {
25652
- value: row[pivotValKey]
25653
- }), row[pivotValKey]);
25654
- } else if (isPreview) {
25655
- resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25656
- } else {
25657
- resolvedCell = null;
25658
- }
25659
- } else if (cellInfo.aggregated) {
25660
- resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25661
- }
25662
- if (cellInfo.expander) {
25663
- resolvedCell = _.normalizeComponent(ResolvedExpanderComponent, cellInfo, row[pivotValKey]);
25664
- if (pivotBy) {
25665
- if (cellInfo.groupedByPivot) {
25666
- resolvedCell = null;
25667
- }
25668
- if (!cellInfo.subRows && !SubComponent) {
25669
- resolvedCell = null;
25670
- }
25671
- }
25672
- }
25673
- var resolvedOnExpanderClick = useOnExpanderClick ? onExpanderClick : function() {
25674
- };
25675
- var interactionProps = {
25676
- onClick: resolvedOnExpanderClick
25677
- };
25678
- if (tdProps.rest.onClick) {
25679
- interactionProps.onClick = function(e2) {
25680
- tdProps.rest.onClick(e2, function() {
25681
- return resolvedOnExpanderClick(e2);
25682
- });
25683
- };
25166
+ onChange: (value) => this.filterColumn(column, value)
25167
+ },
25168
+ defaultProps$1.column.Filter
25169
+ ) : null
25170
+ );
25171
+ }, "makeFilter");
25172
+ const makeFilters = /* @__PURE__ */ __name(() => {
25173
+ const theadFilterProps = _.splitProps(
25174
+ getTheadFilterProps(finalState, void 0, void 0, this)
25175
+ );
25176
+ const theadFilterTrProps = _.splitProps(
25177
+ getTheadFilterTrProps(finalState, void 0, void 0, this)
25178
+ );
25179
+ return /* @__PURE__ */ React$1.createElement(
25180
+ TheadComponent,
25181
+ __spreadValues({
25182
+ className: classNames("-filters", theadFilterProps.className),
25183
+ style: __spreadProps(__spreadValues({}, theadFilterProps.style), {
25184
+ minWidth: `${rowMinWidth}px`
25185
+ })
25186
+ }, theadFilterProps.rest),
25187
+ /* @__PURE__ */ React$1.createElement(
25188
+ TrComponent,
25189
+ __spreadValues({
25190
+ className: theadFilterTrProps.className,
25191
+ style: theadFilterTrProps.style
25192
+ }, theadFilterTrProps.rest),
25193
+ allVisibleColumns.map(makeFilter)
25194
+ )
25195
+ );
25196
+ }, "makeFilters");
25197
+ const makePageRow = /* @__PURE__ */ __name((row, i, path2 = []) => {
25198
+ const rowInfo = {
25199
+ original: row[originalKey],
25200
+ row,
25201
+ index: row[indexKey],
25202
+ viewIndex: rowIndex += 1,
25203
+ pageSize,
25204
+ page,
25205
+ level: path2.length,
25206
+ nestingPath: path2.concat([i]),
25207
+ aggregated: row[aggregatedKey],
25208
+ groupedByPivot: row[groupedByPivotKey],
25209
+ subRows: row[subRowsKey]
25210
+ };
25211
+ const isExpanded = _.get(expanded, rowInfo.nestingPath);
25212
+ const trGroupProps = getTrGroupProps(finalState, rowInfo, void 0, this);
25213
+ const trProps = _.splitProps(getTrProps(finalState, rowInfo, void 0, this));
25214
+ return /* @__PURE__ */ React$1.createElement(TrGroupComponent, __spreadValues({ key: rowInfo.nestingPath.join("_") }, trGroupProps), /* @__PURE__ */ React$1.createElement(
25215
+ TrComponent,
25216
+ __spreadValues({
25217
+ className: classNames(trProps.className, row._viewIndex % 2 ? "-even" : "-odd"),
25218
+ style: trProps.style
25219
+ }, trProps.rest),
25220
+ allVisibleColumns.map((column, i2) => {
25221
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25222
+ const show = typeof column.show === "function" ? column.show() : column.show;
25223
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25224
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25225
+ const tdProps = _.splitProps(getTdProps(finalState, rowInfo, column, this));
25226
+ const columnProps = _.splitProps(column.getProps(finalState, rowInfo, column, this));
25227
+ const classes = [tdProps.className, column.className, columnProps.className];
25228
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, tdProps.style), column.style), columnProps.style);
25229
+ const cellInfo = __spreadProps(__spreadValues({}, rowInfo), {
25230
+ isExpanded,
25231
+ column: __spreadValues({}, column),
25232
+ value: rowInfo.row[column.id],
25233
+ pivoted: column.pivoted,
25234
+ expander: column.expander,
25235
+ resized,
25236
+ show,
25237
+ width,
25238
+ maxWidth,
25239
+ tdProps,
25240
+ columnProps,
25241
+ classes,
25242
+ styles: styles2
25243
+ });
25244
+ const value = cellInfo.value;
25245
+ let useOnExpanderClick;
25246
+ let isBranch;
25247
+ let isPreview;
25248
+ const onExpanderClick = /* @__PURE__ */ __name((e2) => {
25249
+ let newExpanded = _.clone(expanded);
25250
+ if (isExpanded) {
25251
+ newExpanded = _.set(newExpanded, cellInfo.nestingPath, false);
25252
+ } else {
25253
+ newExpanded = _.set(newExpanded, cellInfo.nestingPath, {});
25254
+ }
25255
+ return this.setStateWithData(
25256
+ {
25257
+ expanded: newExpanded
25258
+ },
25259
+ () => onExpandedChange && onExpandedChange(newExpanded, cellInfo.nestingPath, e2, cellInfo)
25260
+ );
25261
+ }, "onExpanderClick");
25262
+ let resolvedCell = _.normalizeComponent(column.Cell, cellInfo, value);
25263
+ const ResolvedAggregatedComponent = column.Aggregated || (!column.aggregate ? AggregatedComponent : column.Cell);
25264
+ const ResolvedExpanderComponent = column.Expander || ExpanderComponent;
25265
+ const ResolvedPivotValueComponent = column.PivotValue || PivotValueComponent;
25266
+ const DefaultResolvedPivotComponent = PivotComponent || ((props) => /* @__PURE__ */ React$1.createElement("div", null, /* @__PURE__ */ React$1.createElement(ResolvedExpanderComponent, __spreadValues({}, props)), /* @__PURE__ */ React$1.createElement(ResolvedPivotValueComponent, __spreadValues({}, props))));
25267
+ const ResolvedPivotComponent = column.Pivot || DefaultResolvedPivotComponent;
25268
+ if (cellInfo.pivoted || cellInfo.expander) {
25269
+ cellInfo.expandable = true;
25270
+ useOnExpanderClick = true;
25271
+ if (cellInfo.pivoted && !cellInfo.subRows && !SubComponent) {
25272
+ cellInfo.expandable = false;
25273
+ }
25274
+ }
25275
+ if (cellInfo.pivoted) {
25276
+ isBranch = rowInfo.row[pivotIDKey] === column.id && cellInfo.subRows;
25277
+ isPreview = pivotBy.indexOf(column.id) > pivotBy.indexOf(rowInfo.row[pivotIDKey]) && cellInfo.subRows;
25278
+ if (isBranch) {
25279
+ resolvedCell = _.normalizeComponent(
25280
+ ResolvedPivotComponent,
25281
+ __spreadProps(__spreadValues({}, cellInfo), {
25282
+ value: row[pivotValKey]
25283
+ }),
25284
+ row[pivotValKey]
25285
+ );
25286
+ } else if (isPreview) {
25287
+ resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25288
+ } else {
25289
+ resolvedCell = null;
25290
+ }
25291
+ } else if (cellInfo.aggregated) {
25292
+ resolvedCell = _.normalizeComponent(ResolvedAggregatedComponent, cellInfo, value);
25293
+ }
25294
+ if (cellInfo.expander) {
25295
+ resolvedCell = _.normalizeComponent(
25296
+ ResolvedExpanderComponent,
25297
+ cellInfo,
25298
+ row[pivotValKey]
25299
+ );
25300
+ if (pivotBy) {
25301
+ if (cellInfo.groupedByPivot) {
25302
+ resolvedCell = null;
25684
25303
  }
25685
- if (columnProps.rest.onClick) {
25686
- interactionProps.onClick = function(e2) {
25687
- columnProps.rest.onClick(e2, function() {
25688
- return resolvedOnExpanderClick(e2);
25689
- });
25690
- };
25304
+ if (!cellInfo.subRows && !SubComponent) {
25305
+ resolvedCell = null;
25691
25306
  }
25692
- return React$1.createElement(
25693
- TdComponent2,
25694
- _extends$i({
25695
- key: i2 + "-" + column.id,
25696
- className: classNames(classes, !cellInfo.expandable && !show && "hidden", cellInfo.expandable && "rt-expandable", (isBranch || isPreview) && "rt-pivot"),
25697
- style: _extends$i({}, styles2, {
25698
- flex: width + " 0 auto",
25699
- width: _.asPx(width),
25700
- maxWidth: _.asPx(maxWidth)
25701
- })
25702
- }, tdProps.rest, columnProps.rest, interactionProps),
25703
- resolvedCell
25704
- );
25705
- })
25307
+ }
25308
+ }
25309
+ const resolvedOnExpanderClick = useOnExpanderClick ? onExpanderClick : () => {
25310
+ };
25311
+ const interactionProps = {
25312
+ onClick: resolvedOnExpanderClick
25313
+ };
25314
+ if (tdProps.rest.onClick) {
25315
+ interactionProps.onClick = (e2) => {
25316
+ tdProps.rest.onClick(e2, () => resolvedOnExpanderClick(e2));
25317
+ };
25318
+ }
25319
+ if (columnProps.rest.onClick) {
25320
+ interactionProps.onClick = (e2) => {
25321
+ columnProps.rest.onClick(e2, () => resolvedOnExpanderClick(e2));
25322
+ };
25323
+ }
25324
+ return /* @__PURE__ */ React$1.createElement(
25325
+ TdComponent,
25326
+ __spreadValues(__spreadValues(__spreadValues({
25327
+ key: `${i2}-${column.id}`,
25328
+ className: classNames(
25329
+ classes,
25330
+ !cellInfo.expandable && !show && "hidden",
25331
+ cellInfo.expandable && "rt-expandable",
25332
+ (isBranch || isPreview) && "rt-pivot"
25333
+ ),
25334
+ style: __spreadProps(__spreadValues({}, styles2), {
25335
+ flex: `${width} 0 auto`,
25336
+ width: _.asPx(width),
25337
+ maxWidth: _.asPx(maxWidth)
25338
+ })
25339
+ }, tdProps.rest), columnProps.rest), interactionProps),
25340
+ resolvedCell
25341
+ );
25342
+ })
25343
+ ), rowInfo.subRows && isExpanded && rowInfo.subRows.map((d2, i2) => makePageRow(d2, i2, rowInfo.nestingPath)), SubComponent && !rowInfo.subRows && isExpanded && SubComponent(rowInfo, () => {
25344
+ const newExpanded = _.clone(expanded);
25345
+ _.set(newExpanded, rowInfo.nestingPath, false);
25346
+ }));
25347
+ }, "makePageRow");
25348
+ const makePadColumn = /* @__PURE__ */ __name((column, i) => {
25349
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25350
+ const show = typeof column.show === "function" ? column.show() : column.show;
25351
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25352
+ const flex2 = width;
25353
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25354
+ const tdProps = _.splitProps(getTdProps(finalState, void 0, column, this));
25355
+ const columnProps = _.splitProps(column.getProps(finalState, void 0, column, this));
25356
+ const classes = [tdProps.className, column.className, columnProps.className];
25357
+ const styles2 = __spreadValues(__spreadValues(__spreadValues({}, tdProps.style), column.style), columnProps.style);
25358
+ return /* @__PURE__ */ React$1.createElement(
25359
+ TdComponent,
25360
+ __spreadValues({
25361
+ key: `${i}-${column.id}`,
25362
+ className: classNames(classes, !show && "hidden"),
25363
+ style: __spreadProps(__spreadValues({}, styles2), {
25364
+ flex: `${flex2} 0 auto`,
25365
+ width: _.asPx(width),
25366
+ maxWidth: _.asPx(maxWidth)
25367
+ })
25368
+ }, tdProps.rest),
25369
+ _.normalizeComponent(PadRowComponent)
25370
+ );
25371
+ }, "makePadColumn");
25372
+ const makePadRow = /* @__PURE__ */ __name((row, i) => {
25373
+ const trGroupProps = getTrGroupProps(finalState, void 0, void 0, this);
25374
+ const trProps = _.splitProps(getTrProps(finalState, void 0, void 0, this));
25375
+ return /* @__PURE__ */ React$1.createElement(TrGroupComponent, __spreadValues({ key: `pad-${i}` }, trGroupProps), /* @__PURE__ */ React$1.createElement(
25376
+ TrComponent,
25377
+ {
25378
+ className: classNames(
25379
+ "-padRow",
25380
+ (pageRows.length + i) % 2 ? "-even" : "-odd",
25381
+ trProps.className
25706
25382
  ),
25707
- rowInfo.subRows && isExpanded && rowInfo.subRows.map(function(d2, i2) {
25708
- return makePageRow2(d2, i2, rowInfo.nestingPath);
25709
- }),
25710
- SubComponent && !rowInfo.subRows && isExpanded && SubComponent(rowInfo, function() {
25711
- var newExpanded = _.clone(expanded);
25712
- _.set(newExpanded, rowInfo.nestingPath, false);
25383
+ style: trProps.style || {}
25384
+ },
25385
+ allVisibleColumns.map(makePadColumn)
25386
+ ));
25387
+ }, "makePadRow");
25388
+ const makeColumnFooter = /* @__PURE__ */ __name((column, i) => {
25389
+ const resizedCol = resized.find((x2) => x2.id === column.id) || {};
25390
+ const show = typeof column.show === "function" ? column.show() : column.show;
25391
+ const width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25392
+ const maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25393
+ const tFootTdProps = _.splitProps(getTfootTdProps(finalState, void 0, column, this));
25394
+ const columnProps = _.splitProps(column.getProps(finalState, void 0, column, this));
25395
+ const columnFooterProps = _.splitProps(
25396
+ column.getFooterProps(finalState, void 0, column, this)
25397
+ );
25398
+ const classes = [
25399
+ tFootTdProps.className,
25400
+ column.className,
25401
+ columnProps.className,
25402
+ columnFooterProps.className
25403
+ ];
25404
+ const styles2 = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, tFootTdProps.style), column.style), columnProps.style), columnFooterProps.style);
25405
+ return /* @__PURE__ */ React$1.createElement(
25406
+ TdComponent,
25407
+ __spreadValues(__spreadValues(__spreadValues({
25408
+ key: `${i}-${column.id}`,
25409
+ className: classNames(classes, !show && "hidden"),
25410
+ style: __spreadProps(__spreadValues({}, styles2), {
25411
+ flex: `${width} 0 auto`,
25412
+ width: _.asPx(width),
25413
+ maxWidth: _.asPx(maxWidth)
25713
25414
  })
25714
- );
25715
- }, "makePageRow");
25716
- var makePadColumn = /* @__PURE__ */ __name(function makePadColumn2(column, i) {
25717
- var resizedCol = resized.find(function(x2) {
25718
- return x2.id === column.id;
25719
- }) || {};
25720
- var show = typeof column.show === "function" ? column.show() : column.show;
25721
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25722
- var flex2 = width;
25723
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25724
- var tdProps = _.splitProps(getTdProps(finalState, void 0, column, _this2));
25725
- var columnProps = _.splitProps(column.getProps(finalState, void 0, column, _this2));
25726
- var classes = [tdProps.className, column.className, columnProps.className];
25727
- var styles2 = _extends$i({}, tdProps.style, column.style, columnProps.style);
25728
- return React$1.createElement(
25729
- TdComponent2,
25730
- _extends$i({
25731
- key: i + "-" + column.id,
25732
- className: classNames(classes, !show && "hidden"),
25733
- style: _extends$i({}, styles2, {
25734
- flex: flex2 + " 0 auto",
25735
- width: _.asPx(width),
25736
- maxWidth: _.asPx(maxWidth)
25737
- })
25738
- }, tdProps.rest),
25739
- _.normalizeComponent(PadRowComponent2)
25740
- );
25741
- }, "makePadColumn");
25742
- var makePadRow = /* @__PURE__ */ __name(function makePadRow2(row, i) {
25743
- var trGroupProps = getTrGroupProps(finalState, void 0, void 0, _this2);
25744
- var trProps = _.splitProps(getTrProps(finalState, void 0, void 0, _this2));
25745
- return React$1.createElement(
25746
- TrGroupComponent2,
25747
- _extends$i({ key: "pad-" + i }, trGroupProps),
25748
- React$1.createElement(
25749
- TrComponent2,
25750
- {
25751
- className: classNames("-padRow", (pageRows.length + i) % 2 ? "-even" : "-odd", trProps.className),
25752
- style: trProps.style || {}
25753
- },
25754
- allVisibleColumns.map(makePadColumn)
25755
- )
25756
- );
25757
- }, "makePadRow");
25758
- var makeColumnFooter = /* @__PURE__ */ __name(function makeColumnFooter2(column, i) {
25759
- var resizedCol = resized.find(function(x2) {
25760
- return x2.id === column.id;
25761
- }) || {};
25762
- var show = typeof column.show === "function" ? column.show() : column.show;
25763
- var width = _.getFirstDefined(resizedCol.value, column.width, column.minWidth);
25764
- var maxWidth = _.getFirstDefined(resizedCol.value, column.width, column.maxWidth);
25765
- var tFootTdProps = _.splitProps(getTfootTdProps(finalState, void 0, column, _this2));
25766
- var columnProps = _.splitProps(column.getProps(finalState, void 0, column, _this2));
25767
- var columnFooterProps = _.splitProps(column.getFooterProps(finalState, void 0, column, _this2));
25768
- var classes = [tFootTdProps.className, column.className, columnProps.className, columnFooterProps.className];
25769
- var styles2 = _extends$i({}, tFootTdProps.style, column.style, columnProps.style, columnFooterProps.style);
25770
- return React$1.createElement(
25771
- TdComponent2,
25772
- _extends$i({
25773
- key: i + "-" + column.id,
25774
- className: classNames(classes, !show && "hidden"),
25775
- style: _extends$i({}, styles2, {
25776
- flex: width + " 0 auto",
25777
- width: _.asPx(width),
25778
- maxWidth: _.asPx(maxWidth)
25779
- })
25780
- }, columnProps.rest, tFootTdProps.rest, columnFooterProps.rest),
25781
- _.normalizeComponent(column.Footer, {
25782
- data: sortedData,
25783
- column
25415
+ }, columnProps.rest), tFootTdProps.rest), columnFooterProps.rest),
25416
+ _.normalizeComponent(column.Footer, {
25417
+ data: sortedData,
25418
+ column
25419
+ })
25420
+ );
25421
+ }, "makeColumnFooter");
25422
+ const makeColumnFooters = /* @__PURE__ */ __name(() => {
25423
+ const tFootProps = _.splitProps(getTfootProps(finalState, void 0, void 0, this));
25424
+ const tFootTrProps = _.splitProps(getTfootTrProps(finalState, void 0, void 0, this));
25425
+ return /* @__PURE__ */ React$1.createElement(
25426
+ TfootComponent,
25427
+ __spreadValues({
25428
+ className: tFootProps.className,
25429
+ style: __spreadProps(__spreadValues({}, tFootProps.style), {
25430
+ minWidth: `${rowMinWidth}px`
25784
25431
  })
25785
- );
25786
- }, "makeColumnFooter");
25787
- var makeColumnFooters = /* @__PURE__ */ __name(function makeColumnFooters2() {
25788
- var tFootProps = _.splitProps(getTfootProps(finalState, void 0, void 0, _this2));
25789
- var tFootTrProps = _.splitProps(getTfootTrProps(finalState, void 0, void 0, _this2));
25790
- return React$1.createElement(
25791
- TfootComponent,
25792
- _extends$i({
25793
- className: tFootProps.className,
25794
- style: _extends$i({}, tFootProps.style, {
25795
- minWidth: rowMinWidth + "px"
25796
- })
25797
- }, tFootProps.rest),
25798
- React$1.createElement(
25799
- TrComponent2,
25800
- _extends$i({
25801
- className: classNames(tFootTrProps.className),
25802
- style: tFootTrProps.style
25803
- }, tFootTrProps.rest),
25804
- allVisibleColumns.map(makeColumnFooter)
25805
- )
25806
- );
25807
- }, "makeColumnFooters");
25808
- var makePagination = /* @__PURE__ */ __name(function makePagination2(isTop) {
25809
- var paginationProps = _.splitProps(getPaginationProps(finalState, void 0, void 0, _this2));
25810
- return React$1.createElement(PaginationComponent, _extends$i({}, resolvedState, {
25432
+ }, tFootProps.rest),
25433
+ /* @__PURE__ */ React$1.createElement(
25434
+ TrComponent,
25435
+ __spreadValues({
25436
+ className: classNames(tFootTrProps.className),
25437
+ style: tFootTrProps.style
25438
+ }, tFootTrProps.rest),
25439
+ allVisibleColumns.map(makeColumnFooter)
25440
+ )
25441
+ );
25442
+ }, "makeColumnFooters");
25443
+ const makePagination = /* @__PURE__ */ __name((isTop) => {
25444
+ const paginationProps = _.splitProps(
25445
+ getPaginationProps(finalState, void 0, void 0, this)
25446
+ );
25447
+ return /* @__PURE__ */ React$1.createElement(
25448
+ PaginationComponent,
25449
+ __spreadValues(__spreadProps(__spreadValues({}, resolvedState), {
25811
25450
  pages,
25812
25451
  canPrevious,
25813
25452
  canNext,
25814
- onPageChange: _this2.onPageChange,
25815
- onPageSizeChange: _this2.onPageSizeChange,
25453
+ onPageChange: this.onPageChange,
25454
+ onPageSizeChange: this.onPageSizeChange,
25816
25455
  className: paginationProps.className,
25817
25456
  style: paginationProps.style,
25818
25457
  isTop
25819
- }, paginationProps.rest));
25820
- }, "makePagination");
25821
- var makeTable = /* @__PURE__ */ __name(function makeTable2() {
25822
- return React$1.createElement(
25823
- "div",
25824
- _extends$i({
25825
- className: classNames("ReactTable", className, rootProps.className),
25826
- style: _extends$i({}, style2, rootProps.style)
25827
- }, rootProps.rest),
25828
- showPagination && showPaginationTop ? React$1.createElement(
25829
- "div",
25830
- { className: "pagination-top" },
25831
- makePagination(true)
25832
- ) : null,
25833
- React$1.createElement(
25834
- TableComponent2,
25835
- _extends$i({
25836
- className: classNames(tableProps.className, currentlyResizing ? "rt-resizing" : ""),
25837
- style: tableProps.style
25838
- }, tableProps.rest),
25839
- hasHeaderGroups ? makeHeaderGroups() : null,
25840
- makeHeaders(),
25841
- hasFilters ? makeFilters() : null,
25842
- React$1.createElement(
25843
- TbodyComponent,
25844
- _extends$i({
25845
- className: classNames(tBodyProps.className),
25846
- style: _extends$i({}, tBodyProps.style, {
25847
- minWidth: rowMinWidth + "px"
25848
- })
25849
- }, tBodyProps.rest),
25850
- pageRows.length < 200 ? pageRows.map(function(d2, i) {
25851
- return makePageRow(d2, i);
25852
- }) : React$1.createElement(ReactList, {
25853
- type: "variable",
25854
- itemSizeEstimator: _this2.props.itemSizeEstimator || itemSizeEstimator,
25855
- itemRenderer: /* @__PURE__ */ __name(function itemRenderer(i) {
25856
- return makePageRow(pageRows[i], i);
25857
- }, "itemRenderer"),
25858
- length: pageRows.length
25859
- }),
25860
- padRows.map(makePadRow),
25861
- additionalBodyEl
25862
- ),
25863
- hasColumnFooter ? makeColumnFooters() : null
25864
- ),
25865
- showPagination && showPaginationBottom ? React$1.createElement(
25866
- "div",
25867
- { className: "pagination-bottom" },
25868
- makePagination(false)
25869
- ) : null,
25870
- !pageRows.length && React$1.createElement(
25871
- NoDataComponent,
25872
- noDataProps,
25873
- _.normalizeComponent(noDataText)
25458
+ }), paginationProps.rest)
25459
+ );
25460
+ }, "makePagination");
25461
+ const makeTable = /* @__PURE__ */ __name(() => /* @__PURE__ */ React$1.createElement(
25462
+ "div",
25463
+ __spreadProps(__spreadValues({
25464
+ className: classNames("ReactTable", className, rootProps.className),
25465
+ style: __spreadValues(__spreadValues({}, style2), rootProps.style)
25466
+ }, rootProps.rest), {
25467
+ ref: (r2) => {
25468
+ if (!r2)
25469
+ return;
25470
+ if (rootProps.rest.ref) {
25471
+ rootProps.rest.ref(r2);
25472
+ }
25473
+ this.tableRef = r2;
25474
+ }
25475
+ }),
25476
+ showPagination && showPaginationTop ? /* @__PURE__ */ React$1.createElement("div", { className: "pagination-top" }, makePagination(true)) : null,
25477
+ /* @__PURE__ */ React$1.createElement(
25478
+ TableComponent,
25479
+ __spreadValues({
25480
+ className: classNames(tableProps.className, currentlyResizing ? "rt-resizing" : ""),
25481
+ style: tableProps.style
25482
+ }, tableProps.rest),
25483
+ hasHeaderGroups ? makeHeaderGroups() : null,
25484
+ makeHeaders(),
25485
+ hasFilters ? makeFilters() : null,
25486
+ /* @__PURE__ */ React$1.createElement(
25487
+ TbodyComponent,
25488
+ __spreadValues({
25489
+ className: classNames(tBodyProps.className),
25490
+ style: __spreadProps(__spreadValues({}, tBodyProps.style), {
25491
+ minWidth: `${rowMinWidth}px`
25492
+ })
25493
+ }, tBodyProps.rest),
25494
+ pageRows.length < 200 ? pageRows.map((d2, i) => makePageRow(d2, i)) : /* @__PURE__ */ React$1.createElement(
25495
+ ReactList,
25496
+ {
25497
+ type: "variable",
25498
+ itemSizeEstimator: this.props.itemSizeEstimator || itemSizeEstimator,
25499
+ itemRenderer: (i) => makePageRow(pageRows[i], i),
25500
+ length: pageRows.length
25501
+ }
25874
25502
  ),
25875
- React$1.createElement(LoadingComponent3, _extends$i({ loading, loadingText }, loadingProps))
25876
- );
25877
- }, "makeTable");
25878
- return children ? children(finalState, makeTable, this) : makeTable();
25879
- }, "render")
25880
- }]);
25881
- return ReactTable2;
25882
- }(Methods(Lifecycle(React$1.Component)));
25883
- ReactTable.propTypes = propTypes;
25884
- ReactTable.defaultProps = defaultProps$1;
25503
+ padRows.map(makePadRow),
25504
+ additionalBodyEl
25505
+ ),
25506
+ hasColumnFooter ? makeColumnFooters() : null
25507
+ ),
25508
+ showPagination && showPaginationBottom ? /* @__PURE__ */ React$1.createElement("div", { className: "pagination-bottom" }, makePagination(false)) : null,
25509
+ !pageRows.length && /* @__PURE__ */ React$1.createElement(NoDataComponent, __spreadValues({}, noDataProps), _.normalizeComponent(noDataText)),
25510
+ /* @__PURE__ */ React$1.createElement(LoadingComponent2, __spreadValues({ loading, loadingText }, loadingProps))
25511
+ ), "makeTable");
25512
+ return children ? children(finalState, makeTable, this) : makeTable();
25513
+ }
25514
+ };
25515
+ __name(_ReactTable, "ReactTable");
25516
+ __publicField(_ReactTable, "propTypes", propTypes);
25517
+ __publicField(_ReactTable, "defaultProps", defaultProps$1);
25518
+ let ReactTable = _ReactTable;
25885
25519
  var dayjs_min = { exports: {} };
25886
25520
  (function(module2, exports2) {
25887
25521
  !function(t2, e2) {
@@ -44193,7 +43827,7 @@ function arrayEach$2(array2, iteratee) {
44193
43827
  }
44194
43828
  __name(arrayEach$2, "arrayEach$2");
44195
43829
  var _arrayEach = arrayEach$2;
44196
- var defineProperty$3 = _defineProperty$6;
43830
+ var defineProperty$3 = _defineProperty$5;
44197
43831
  function baseAssignValue$3(object2, key, value) {
44198
43832
  if (key == "__proto__" && defineProperty$3) {
44199
43833
  defineProperty$3(object2, key, {
@@ -53803,8 +53437,8 @@ const renderSuggest = /* @__PURE__ */ __name((props) => {
53803
53437
  });
53804
53438
  return /* @__PURE__ */ React$1.createElement(TgSuggest, __spreadValues({}, propsToUse));
53805
53439
  }, "renderSuggest");
53806
- const BPSelect = /* @__PURE__ */ __name((_c) => {
53807
- var _d = _c, { value, onChange } = _d, rest = __objRest(_d, ["value", "onChange"]);
53440
+ const BPSelect = /* @__PURE__ */ __name((_q) => {
53441
+ var _r = _q, { value, onChange } = _r, rest = __objRest(_r, ["value", "onChange"]);
53808
53442
  return renderSelect(__spreadProps(__spreadValues({}, rest), { input: { onChange, value } }));
53809
53443
  }, "BPSelect");
53810
53444
  const renderSelect = /* @__PURE__ */ __name((props) => {
@@ -53939,12 +53573,12 @@ const renderBlueprintNumericInput = /* @__PURE__ */ __name((props) => {
53939
53573
  })
53940
53574
  );
53941
53575
  }, "renderBlueprintNumericInput");
53942
- const renderBlueprintRadioGroup = /* @__PURE__ */ __name((_e) => {
53943
- var _f = _e, {
53576
+ const renderBlueprintRadioGroup = /* @__PURE__ */ __name((_s) => {
53577
+ var _t = _s, {
53944
53578
  input,
53945
53579
  options,
53946
53580
  onFieldSubmit
53947
- } = _f, rest = __objRest(_f, [
53581
+ } = _t, rest = __objRest(_t, [
53948
53582
  "input",
53949
53583
  "options",
53950
53584
  "onFieldSubmit"
@@ -54455,10 +54089,10 @@ const _DisplayOptions = class _DisplayOptions extends React$1.Component {
54455
54089
  };
54456
54090
  __name(_DisplayOptions, "DisplayOptions");
54457
54091
  let DisplayOptions = _DisplayOptions;
54458
- const { LoadingComponent: LoadingComponent2 } = ReactTableDefaults;
54092
+ const { LoadingComponent } = ReactTableDefaults;
54459
54093
  function DisabledLoadingComponent({ disabled, loading, loadingText }) {
54460
54094
  return /* @__PURE__ */ React$1.createElement(
54461
- LoadingComponent2,
54095
+ LoadingComponent,
54462
54096
  {
54463
54097
  className: disabled ? "disabled" : "",
54464
54098
  loading,
@@ -54640,7 +54274,7 @@ function createLocation(path2, state, key, currentLocation) {
54640
54274
  location2 = parsePath(path2);
54641
54275
  location2.state = state;
54642
54276
  } else {
54643
- location2 = _extends$n({}, path2);
54277
+ location2 = _extends$i({}, path2);
54644
54278
  if (location2.pathname === void 0)
54645
54279
  location2.pathname = "";
54646
54280
  if (location2.search) {
@@ -55335,7 +54969,7 @@ var KNOWN_STATICS = {
55335
54969
  arguments: true,
55336
54970
  arity: true
55337
54971
  };
55338
- var defineProperty5 = Object.defineProperty;
54972
+ var defineProperty4 = Object.defineProperty;
55339
54973
  var getOwnPropertyNames4 = Object.getOwnPropertyNames;
55340
54974
  var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
55341
54975
  var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
@@ -55358,7 +54992,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
55358
54992
  if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
55359
54993
  var descriptor2 = getOwnPropertyDescriptor3(sourceComponent, key);
55360
54994
  try {
55361
- defineProperty5(targetComponent, key, descriptor2);
54995
+ defineProperty4(targetComponent, key, descriptor2);
55362
54996
  } catch (e2) {
55363
54997
  }
55364
54998
  }
@@ -57140,8 +56774,8 @@ const _DataTable = class _DataTable extends React$1.Component {
57140
56774
  };
57141
56775
  }),
57142
56776
  branch(({ immovable }) => "true" !== immovable, sortableElement)
57143
- )((_g) => {
57144
- var _h = _g, { toggleSort, className, children } = _h, rest = __objRest(_h, ["toggleSort", "className", "children"]);
56777
+ )((_u) => {
56778
+ var _v = _u, { toggleSort, className, children } = _v, rest = __objRest(_v, ["toggleSort", "className", "children"]);
57145
56779
  return /* @__PURE__ */ React$1.createElement(
57146
56780
  "div",
57147
56781
  __spreadValues({
@@ -59268,13 +58902,13 @@ function getCellInfo({
59268
58902
  };
59269
58903
  }
59270
58904
  __name(getCellInfo, "getCellInfo");
59271
- function ColumnFilterMenu(_i) {
59272
- var _j = _i, {
58905
+ function ColumnFilterMenu(_w) {
58906
+ var _x = _w, {
59273
58907
  FilterMenu,
59274
58908
  filterActiveForColumn,
59275
58909
  compact: compact3,
59276
58910
  extraCompact
59277
- } = _j, rest = __objRest(_j, [
58911
+ } = _x, rest = __objRest(_x, [
59278
58912
  "FilterMenu",
59279
58913
  "filterActiveForColumn",
59280
58914
  "compact",
@@ -62079,8 +61713,8 @@ function maybeStripIdFromEntities(ents, validateAgainstSchema) {
62079
61713
  return toRet == null ? void 0 : toRet.map((e2) => lodashExports.omit(e2, ["_isClean"]));
62080
61714
  }
62081
61715
  __name(maybeStripIdFromEntities, "maybeStripIdFromEntities");
62082
- const useDialog = /* @__PURE__ */ __name((_k) => {
62083
- var _l = _k, { ModalComponent } = _l, rest = __objRest(_l, ["ModalComponent"]);
61716
+ const useDialog = /* @__PURE__ */ __name((_y) => {
61717
+ var _z = _y, { ModalComponent } = _z, rest = __objRest(_z, ["ModalComponent"]);
62084
61718
  const [isOpen, setOpen] = React$1.useState(false);
62085
61719
  const [additionalProps, setAdditionalProps] = React$1.useState(false);
62086
61720
  const comp = /* @__PURE__ */ React$1.createElement(
@@ -72672,14 +72306,14 @@ function BlueprintError({ error }) {
72672
72306
  return /* @__PURE__ */ React$1.createElement("div", { className: classNames(core$5.Classes.FORM_GROUP, core$5.Classes.INTENT_DANGER) }, /* @__PURE__ */ React$1.createElement("div", { className: classNames(core$5.Classes.FORM_HELPER_TEXT, "preserve-newline") }, error));
72673
72307
  }
72674
72308
  __name(BlueprintError, "BlueprintError");
72675
- function DropdownButton(_m) {
72676
- var _n = _m, {
72309
+ function DropdownButton(_A) {
72310
+ var _B = _A, {
72677
72311
  disabled,
72678
72312
  menu,
72679
72313
  noRightIcon,
72680
72314
  popoverProps,
72681
72315
  className
72682
- } = _n, rest = __objRest(_n, [
72316
+ } = _B, rest = __objRest(_B, [
72683
72317
  "disabled",
72684
72318
  "menu",
72685
72319
  "noRightIcon",
@@ -76122,14 +75756,14 @@ const EnhancedMenuItem = compose(
76122
75756
  }
76123
75757
  }),
76124
75758
  branch(({ navTo }) => navTo, withRouter$1)
76125
- )(function(_o) {
76126
- var _p = _o, {
75759
+ )(function(_C) {
75760
+ var _D = _C, {
76127
75761
  navTo,
76128
75762
  context,
76129
75763
  staticContext,
76130
75764
  didMount,
76131
75765
  willUnmount
76132
- } = _p, props = __objRest(_p, [
75766
+ } = _D, props = __objRest(_D, [
76133
75767
  "navTo",
76134
75768
  "context",
76135
75769
  "staticContext",
@@ -76350,8 +75984,8 @@ function doesSearchValMatchText(searchVal, justText) {
76350
75984
  );
76351
75985
  }
76352
75986
  __name(doesSearchValMatchText, "doesSearchValMatchText");
76353
- const MenuItemWithTooltip = /* @__PURE__ */ __name((_q) => {
76354
- var _r = _q, { tooltip } = _r, rest = __objRest(_r, ["tooltip"]);
75987
+ const MenuItemWithTooltip = /* @__PURE__ */ __name((_E) => {
75988
+ var _F = _E, { tooltip } = _F, rest = __objRest(_F, ["tooltip"]);
76355
75989
  let out = /* @__PURE__ */ React$1.createElement(core$5.MenuItem, __spreadValues({}, rest));
76356
75990
  if (tooltip) {
76357
75991
  out = /* @__PURE__ */ React$1.createElement(core$5.Tooltip, { content: tooltip }, out);