@teselagen/ui 0.3.70 → 0.3.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -3062,6 +3062,18 @@ function parentIncludesNoChildDataTip(el, count) {
3062
3062
  return parentIncludesNoChildDataTip(el.parentElement, count + 1);
3063
3063
  }
3064
3064
  __name(parentIncludesNoChildDataTip, "parentIncludesNoChildDataTip");
3065
+ const LoadingDots = /* @__PURE__ */ __name(() => {
3066
+ const [dots, setDots] = React$1.useState("");
3067
+ React$1.useEffect(() => {
3068
+ const interval = setInterval(() => {
3069
+ setDots((dots2) => {
3070
+ return dots2.length === 3 ? "" : dots2 + ".";
3071
+ });
3072
+ }, 500);
3073
+ return () => clearInterval(interval);
3074
+ }, []);
3075
+ return /* @__PURE__ */ React$1.createElement("span", null, dots);
3076
+ }, "LoadingDots");
3065
3077
  const AssignDefaultsModeContext = React$1.createContext({
3066
3078
  inAssignDefaultsMode: false,
3067
3079
  // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -5523,10 +5535,10 @@ var ownKeys$3 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownK
5523
5535
  /* istanbul ignore next */
5524
5536
  Object.getOwnPropertyNames
5525
5537
  );
5526
- function toPrimitive$2(value) {
5538
+ function toPrimitive$3(value) {
5527
5539
  return value === null ? null : typeof value === "object" ? "" + value : value;
5528
5540
  }
5529
- __name(toPrimitive$2, "toPrimitive$2");
5541
+ __name(toPrimitive$3, "toPrimitive$3");
5530
5542
  function hasProp(target, prop) {
5531
5543
  return objectPrototype$1.hasOwnProperty.call(target, prop);
5532
5544
  }
@@ -6423,7 +6435,7 @@ var ObservableValue = /* @__PURE__ */ function(_Atom) {
6423
6435
  return this.name_ + "[" + this.value_ + "]";
6424
6436
  }, "toString");
6425
6437
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
6426
- return toPrimitive$2(this.get());
6438
+ return toPrimitive$3(this.get());
6427
6439
  }, "valueOf");
6428
6440
  _proto[_Symbol$toPrimitive] = function() {
6429
6441
  return this.valueOf();
@@ -6608,7 +6620,7 @@ var ComputedValue = /* @__PURE__ */ function() {
6608
6620
  return this.name_ + "[" + this.derivation.toString() + "]";
6609
6621
  }, "toString");
6610
6622
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
6611
- return toPrimitive$2(this.get());
6623
+ return toPrimitive$3(this.get());
6612
6624
  }, "valueOf");
6613
6625
  _proto[_Symbol$toPrimitive$1] = function() {
6614
6626
  return this.valueOf();
@@ -11242,7 +11254,7 @@ lodash.exports;
11242
11254
  "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
11243
11255
  );
11244
11256
  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;
11245
- var defineProperty5 = function() {
11257
+ var defineProperty6 = function() {
11246
11258
  try {
11247
11259
  var func = getNative2(Object2, "defineProperty");
11248
11260
  func({}, "", {});
@@ -11682,8 +11694,8 @@ lodash.exports;
11682
11694
  }
11683
11695
  __name(baseAssignIn2, "baseAssignIn");
11684
11696
  function baseAssignValue2(object2, key, value) {
11685
- if (key == "__proto__" && defineProperty5) {
11686
- defineProperty5(object2, key, {
11697
+ if (key == "__proto__" && defineProperty6) {
11698
+ defineProperty6(object2, key, {
11687
11699
  "configurable": true,
11688
11700
  "enumerable": true,
11689
11701
  "value": value,
@@ -12416,8 +12428,8 @@ lodash.exports;
12416
12428
  metaMap.set(func, data);
12417
12429
  return func;
12418
12430
  };
12419
- var baseSetToString2 = !defineProperty5 ? identity3 : function(func, string2) {
12420
- return defineProperty5(func, "toString", {
12431
+ var baseSetToString2 = !defineProperty6 ? identity3 : function(func, string2) {
12432
+ return defineProperty6(func, "toString", {
12421
12433
  "configurable": true,
12422
12434
  "enumerable": false,
12423
12435
  "value": constant2(string2),
@@ -16966,20 +16978,11 @@ var _fails = /* @__PURE__ */ __name(function(exec) {
16966
16978
  return true;
16967
16979
  }
16968
16980
  }, "_fails");
16969
- var _descriptors;
16970
- var hasRequired_descriptors;
16971
- function require_descriptors() {
16972
- if (hasRequired_descriptors)
16973
- return _descriptors;
16974
- hasRequired_descriptors = 1;
16975
- _descriptors = !_fails(function() {
16976
- return Object.defineProperty({}, "a", { get: function() {
16977
- return 7;
16978
- } }).a != 7;
16979
- });
16980
- return _descriptors;
16981
- }
16982
- __name(require_descriptors, "require_descriptors");
16981
+ var _descriptors = !_fails(function() {
16982
+ return Object.defineProperty({}, "a", { get: function() {
16983
+ return 7;
16984
+ } }).a != 7;
16985
+ });
16983
16986
  var _domCreate;
16984
16987
  var hasRequired_domCreate;
16985
16988
  function require_domCreate() {
@@ -16995,20 +16998,11 @@ function require_domCreate() {
16995
16998
  return _domCreate;
16996
16999
  }
16997
17000
  __name(require_domCreate, "require_domCreate");
16998
- var _ie8DomDefine;
16999
- var hasRequired_ie8DomDefine;
17000
- function require_ie8DomDefine() {
17001
- if (hasRequired_ie8DomDefine)
17002
- return _ie8DomDefine;
17003
- hasRequired_ie8DomDefine = 1;
17004
- _ie8DomDefine = !require_descriptors() && !_fails(function() {
17005
- return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
17006
- return 7;
17007
- } }).a != 7;
17008
- });
17009
- return _ie8DomDefine;
17010
- }
17011
- __name(require_ie8DomDefine, "require_ie8DomDefine");
17001
+ var _ie8DomDefine = !_descriptors && !_fails(function() {
17002
+ return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
17003
+ return 7;
17004
+ } }).a != 7;
17005
+ });
17012
17006
  var isObject$d = _isObject;
17013
17007
  var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
17014
17008
  if (!isObject$d(it))
@@ -17022,33 +17016,25 @@ var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
17022
17016
  return val;
17023
17017
  throw TypeError("Can't convert object to primitive value");
17024
17018
  }, "_toPrimitive");
17025
- var hasRequired_objectDp;
17026
- function require_objectDp() {
17027
- if (hasRequired_objectDp)
17028
- return _objectDp;
17029
- hasRequired_objectDp = 1;
17030
- var anObject2 = _anObject;
17031
- var IE8_DOM_DEFINE2 = require_ie8DomDefine();
17032
- var toPrimitive2 = _toPrimitive;
17033
- var dP2 = Object.defineProperty;
17034
- _objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty5(O2, P2, Attributes) {
17035
- anObject2(O2);
17036
- P2 = toPrimitive2(P2, true);
17037
- anObject2(Attributes);
17038
- if (IE8_DOM_DEFINE2)
17039
- try {
17040
- return dP2(O2, P2, Attributes);
17041
- } catch (e2) {
17042
- }
17043
- if ("get" in Attributes || "set" in Attributes)
17044
- throw TypeError("Accessors not supported!");
17045
- if ("value" in Attributes)
17046
- O2[P2] = Attributes.value;
17047
- return O2;
17048
- }, "defineProperty");
17049
- return _objectDp;
17050
- }
17051
- __name(require_objectDp, "require_objectDp");
17019
+ var anObject$5 = _anObject;
17020
+ var IE8_DOM_DEFINE$1 = _ie8DomDefine;
17021
+ var toPrimitive$2 = _toPrimitive;
17022
+ var dP$3 = Object.defineProperty;
17023
+ _objectDp.f = _descriptors ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty2(O2, P2, Attributes) {
17024
+ anObject$5(O2);
17025
+ P2 = toPrimitive$2(P2, true);
17026
+ anObject$5(Attributes);
17027
+ if (IE8_DOM_DEFINE$1)
17028
+ try {
17029
+ return dP$3(O2, P2, Attributes);
17030
+ } catch (e2) {
17031
+ }
17032
+ if ("get" in Attributes || "set" in Attributes)
17033
+ throw TypeError("Accessors not supported!");
17034
+ if ("value" in Attributes)
17035
+ O2[P2] = Attributes.value;
17036
+ return O2;
17037
+ }, "defineProperty");
17052
17038
  var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
17053
17039
  return {
17054
17040
  enumerable: !(bitmap & 1),
@@ -17057,9 +17043,9 @@ var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
17057
17043
  value
17058
17044
  };
17059
17045
  }, "_propertyDesc");
17060
- var dP$2 = require_objectDp();
17046
+ var dP$2 = _objectDp;
17061
17047
  var createDesc$3 = _propertyDesc;
17062
- var _hide = require_descriptors() ? function(object2, key, value) {
17048
+ var _hide = _descriptors ? function(object2, key, value) {
17063
17049
  return dP$2.f(object2, key, createDesc$3(1, value));
17064
17050
  } : function(object2, key, value) {
17065
17051
  object2[key] = value;
@@ -17265,7 +17251,7 @@ function require_objectAssign() {
17265
17251
  if (hasRequired_objectAssign)
17266
17252
  return _objectAssign;
17267
17253
  hasRequired_objectAssign = 1;
17268
- var DESCRIPTORS2 = require_descriptors();
17254
+ var DESCRIPTORS2 = _descriptors;
17269
17255
  var getKeys2 = _objectKeys;
17270
17256
  var gOPS2 = _objectGops;
17271
17257
  var pIE2 = require_objectPie();
@@ -17331,10 +17317,10 @@ var _iterStep = /* @__PURE__ */ __name(function(done, value) {
17331
17317
  }, "_iterStep");
17332
17318
  var _iterators = {};
17333
17319
  var _redefine = _hide;
17334
- var dP$1 = require_objectDp();
17320
+ var dP$1 = _objectDp;
17335
17321
  var anObject$4 = _anObject;
17336
17322
  var getKeys$1 = _objectKeys;
17337
- var _objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties(O2, Properties) {
17323
+ var _objectDps = _descriptors ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties(O2, Properties) {
17338
17324
  anObject$4(O2);
17339
17325
  var keys3 = getKeys$1(Properties);
17340
17326
  var length = keys3.length;
@@ -17401,7 +17387,7 @@ var $exports = _wks.exports = function(name) {
17401
17387
  };
17402
17388
  $exports.store = store;
17403
17389
  var _wksExports = _wks.exports;
17404
- var def = require_objectDp().f;
17390
+ var def = _objectDp.f;
17405
17391
  var has$9 = _has;
17406
17392
  var TAG$1 = _wksExports("toStringTag");
17407
17393
  var _setToStringTag = /* @__PURE__ */ __name(function(it, tag, stat) {
@@ -17674,7 +17660,7 @@ var ArrayProto = Array.prototype;
17674
17660
  var _isArrayIter = /* @__PURE__ */ __name(function(it) {
17675
17661
  return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
17676
17662
  }, "_isArrayIter");
17677
- var $defineProperty$1 = require_objectDp();
17663
+ var $defineProperty$1 = _objectDp;
17678
17664
  var createDesc$2 = _propertyDesc;
17679
17665
  var _createProperty = /* @__PURE__ */ __name(function(object2, index2, value) {
17680
17666
  if (index2 in object2)
@@ -17803,9 +17789,9 @@ var _default$8 = /* @__PURE__ */ __name(function(instance, Constructor) {
17803
17789
  }
17804
17790
  }, "_default$8");
17805
17791
  var $export$3 = _export;
17806
- $export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: require_objectDp().f });
17792
+ $export$3($export$3.S + $export$3.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
17807
17793
  var $Object$2 = _coreExports.Object;
17808
- var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty2(it, key, desc) {
17794
+ var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty3(it, key, desc) {
17809
17795
  return $Object$2.defineProperty(it, key, desc);
17810
17796
  }, "defineProperty");
17811
17797
  var defineProperty$8 = { "default": defineProperty$9, __esModule: true };
@@ -17844,7 +17830,7 @@ var _meta = { exports: {} };
17844
17830
  var META$1 = _uid("meta");
17845
17831
  var isObject$c = _isObject;
17846
17832
  var has$7 = _has;
17847
- var setDesc = require_objectDp().f;
17833
+ var setDesc = _objectDp.f;
17848
17834
  var id = 0;
17849
17835
  var isExtensible = Object.isExtensible || function() {
17850
17836
  return true;
@@ -17897,7 +17883,7 @@ var meta = _meta.exports = {
17897
17883
  var _metaExports = _meta.exports;
17898
17884
  var core = _coreExports;
17899
17885
  var wksExt$1 = _wksExt;
17900
- var defineProperty$7 = require_objectDp().f;
17886
+ var defineProperty$7 = _objectDp.f;
17901
17887
  var _wksDefine = /* @__PURE__ */ __name(function(name) {
17902
17888
  var $Symbol2 = core.Symbol || (core.Symbol = {});
17903
17889
  if (name.charAt(0) != "_" && !(name in $Symbol2))
@@ -17951,9 +17937,9 @@ var createDesc$1 = _propertyDesc;
17951
17937
  var toIObject$1 = _toIobject;
17952
17938
  var toPrimitive$1 = _toPrimitive;
17953
17939
  var has$6 = _has;
17954
- var IE8_DOM_DEFINE = require_ie8DomDefine();
17940
+ var IE8_DOM_DEFINE = _ie8DomDefine;
17955
17941
  var gOPD$2 = Object.getOwnPropertyDescriptor;
17956
- _objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
17942
+ _objectGopd.f = _descriptors ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
17957
17943
  O2 = toIObject$1(O2);
17958
17944
  P2 = toPrimitive$1(P2, true);
17959
17945
  if (IE8_DOM_DEFINE)
@@ -17966,7 +17952,7 @@ _objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function
17966
17952
  }, "getOwnPropertyDescriptor");
17967
17953
  var global$1 = _globalExports;
17968
17954
  var has$5 = _has;
17969
- var DESCRIPTORS = require_descriptors();
17955
+ var DESCRIPTORS = _descriptors;
17970
17956
  var $export$2 = _export;
17971
17957
  var redefine = _redefine;
17972
17958
  var META = _metaExports.KEY;
@@ -17989,7 +17975,7 @@ var _create$1 = _objectCreate;
17989
17975
  var gOPNExt = _objectGopnExt;
17990
17976
  var $GOPD = _objectGopd;
17991
17977
  var $GOPS = _objectGops;
17992
- var $DP = require_objectDp();
17978
+ var $DP = _objectDp;
17993
17979
  var $keys$1 = _objectKeys;
17994
17980
  var gOPD$1 = $GOPD.f;
17995
17981
  var dP = $DP.f;
@@ -18032,7 +18018,7 @@ var isSymbol$8 = USE_NATIVE && typeof $Symbol.iterator == "symbol" ? function(it
18032
18018
  } : function(it) {
18033
18019
  return it instanceof $Symbol;
18034
18020
  };
18035
- var $defineProperty = /* @__PURE__ */ __name(function defineProperty3(it, key, D2) {
18021
+ var $defineProperty = /* @__PURE__ */ __name(function defineProperty4(it, key, D2) {
18036
18022
  if (it === ObjectProto)
18037
18023
  $defineProperty(OPSymbols, key, D2);
18038
18024
  anObject(it);
@@ -54121,7 +54107,7 @@ var KNOWN_STATICS = {
54121
54107
  arguments: true,
54122
54108
  arity: true
54123
54109
  };
54124
- var defineProperty4 = Object.defineProperty;
54110
+ var defineProperty5 = Object.defineProperty;
54125
54111
  var getOwnPropertyNames4 = Object.getOwnPropertyNames;
54126
54112
  var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
54127
54113
  var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
@@ -54144,7 +54130,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
54144
54130
  if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
54145
54131
  var descriptor2 = getOwnPropertyDescriptor3(sourceComponent, key);
54146
54132
  try {
54147
- defineProperty4(targetComponent, key, descriptor2);
54133
+ defineProperty5(targetComponent, key, descriptor2);
54148
54134
  } catch (e2) {
54149
54135
  }
54150
54136
  }
@@ -55797,7 +55783,7 @@ const _DataTable = class _DataTable extends React$1.Component {
55797
55783
  onFinishMsg: "Column Copied"
55798
55784
  });
55799
55785
  }, "handleCopyColumn"));
55800
- __publicField(this, "handleCopyRows", /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, onFinishMsg } = {}) => {
55786
+ __publicField(this, "handleCopyRows", /* @__PURE__ */ __name((rowElsToCopy, { specificColumn, onFinishMsg, isDownload } = {}) => {
55801
55787
  let textToCopy = [];
55802
55788
  const jsonToCopy = [];
55803
55789
  lodashExports.forEach(rowElsToCopy, (rowEl) => {
@@ -55808,7 +55794,15 @@ const _DataTable = class _DataTable extends React$1.Component {
55808
55794
  textToCopy = textToCopy.filter((text2) => text2).join("\n");
55809
55795
  if (!textToCopy)
55810
55796
  return window.toastr.warning("No text to copy");
55811
- this.handleCopyHelper(textToCopy, jsonToCopy, onFinishMsg || "Row Copied");
55797
+ if (isDownload) {
55798
+ downloadjs(textToCopy.replaceAll(" ", ","), "tableData.csv", "text/csv");
55799
+ } else {
55800
+ this.handleCopyHelper(
55801
+ textToCopy,
55802
+ jsonToCopy,
55803
+ onFinishMsg || "Row Copied"
55804
+ );
55805
+ }
55812
55806
  }, "handleCopyRows"));
55813
55807
  __publicField(this, "updateEntitiesHelper", /* @__PURE__ */ __name((ents, fn4) => {
55814
55808
  const { change, reduxFormEntitiesUndoRedoStack = { currentVersion: 0 } } = this.props;
@@ -55861,14 +55855,14 @@ const _DataTable = class _DataTable extends React$1.Component {
55861
55855
  window.toastr.success(message);
55862
55856
  }
55863
55857
  }, "handleCopyHelper"));
55864
- __publicField(this, "handleCopyTable", /* @__PURE__ */ __name((e2) => {
55858
+ __publicField(this, "handleCopyTable", /* @__PURE__ */ __name((e2, opts) => {
55865
55859
  try {
55866
55860
  const allRowEls = getAllRows(e2);
55867
55861
  if (!allRowEls)
55868
55862
  return;
55869
- this.handleCopyRows(allRowEls, {
55863
+ this.handleCopyRows(allRowEls, __spreadProps(__spreadValues({}, opts), {
55870
55864
  onFinishMsg: "Table Copied"
55871
- });
55865
+ }));
55872
55866
  } catch (error) {
55873
55867
  console.error(`error:`, error);
55874
55868
  window.toastr.error("Error copying rows.");
@@ -58120,27 +58114,6 @@ const _DataTable = class _DataTable extends React$1.Component {
58120
58114
  if (n2)
58121
58115
  this.table = n2;
58122
58116
  },
58123
- additionalBodyEl: isCellEditable && !onlyShowRowsWErrors && /* @__PURE__ */ React$1.createElement(
58124
- "div",
58125
- {
58126
- style: {
58127
- width: "100%",
58128
- display: "flex",
58129
- justifyContent: "center"
58130
- }
58131
- },
58132
- /* @__PURE__ */ React$1.createElement(
58133
- core$5.Button,
58134
- {
58135
- icon: "add",
58136
- onClick: () => {
58137
- this.insertRows({ numRows: 10, appendToBottom: true });
58138
- },
58139
- minimal: true
58140
- },
58141
- "Add 10 Rows"
58142
- )
58143
- ),
58144
58117
  className: classNames({
58145
58118
  isCellEditable,
58146
58119
  "tg-table-loading": isLoading,
@@ -58182,6 +58155,37 @@ const _DataTable = class _DataTable extends React$1.Component {
58182
58155
  SubComponent: SubComponentToUse
58183
58156
  }, ReactTableProps)
58184
58157
  ),
58158
+ isCellEditable && /* @__PURE__ */ React$1.createElement("div", { style: { display: "flex" } }, /* @__PURE__ */ React$1.createElement(
58159
+ "div",
58160
+ {
58161
+ style: {
58162
+ width: "100%",
58163
+ display: "flex",
58164
+ justifyContent: "center"
58165
+ }
58166
+ },
58167
+ !onlyShowRowsWErrors && /* @__PURE__ */ React$1.createElement(
58168
+ core$5.Button,
58169
+ {
58170
+ icon: "add",
58171
+ onClick: () => {
58172
+ this.insertRows({ numRows: 10, appendToBottom: true });
58173
+ },
58174
+ minimal: true
58175
+ },
58176
+ "Add 10 Rows"
58177
+ )
58178
+ ), /* @__PURE__ */ React$1.createElement(
58179
+ core$5.Button,
58180
+ {
58181
+ onClick: (e2) => {
58182
+ this.handleCopyTable(e2, { isDownload: true });
58183
+ },
58184
+ "data-tip": "Download Table as CSV",
58185
+ minimal: true,
58186
+ icon: "download"
58187
+ }
58188
+ )),
58185
58189
  !noFooter && /* @__PURE__ */ React$1.createElement(
58186
58190
  "div",
58187
58191
  {
@@ -70697,7 +70701,7 @@ __name(_ValidateAgainstSchema, "ValidateAgainstSchema");
70697
70701
  let ValidateAgainstSchema = _ValidateAgainstSchema;
70698
70702
  const emptyPromise = Promise.resolve.bind(Promise);
70699
70703
  function UploaderInner({
70700
- accept: _accept,
70704
+ accept: __accept,
70701
70705
  contentOverride: maybeContentOverride,
70702
70706
  innerIcon,
70703
70707
  innerText,
@@ -70727,20 +70731,37 @@ function UploaderInner({
70727
70731
  dropzoneProps = {},
70728
70732
  overflowList,
70729
70733
  autoUnzip,
70730
- disabled,
70734
+ disabled: _disabled,
70731
70735
  noBuildCsvOption,
70732
70736
  initializeForm,
70733
70737
  showFilesCount,
70734
70738
  threeDotMenuItems,
70735
70739
  onPreviewClick
70736
70740
  }) {
70737
- var _a2, _b, _c, _d, _e, _f;
70741
+ var _a2, _b, _c, _d;
70742
+ let dropzoneDisabled = _disabled;
70743
+ let _accept = __accept;
70738
70744
  const validateAgainstSchemaStore = React$1.useRef(new ValidateAgainstSchema());
70739
- const callout = _callout || ((_c = (_b = (_a2 = lodashExports.isArray(_accept) ? _accept : [_accept]).find) == null ? void 0 : _b.call(_a2, (a2) => a2 == null ? void 0 : a2.callout)) == null ? void 0 : _c.callout);
70740
- const validateAgainstSchemaToUse = _validateAgainstSchema || ((_f = (_e = (_d = lodashExports.isArray(_accept) ? _accept : [_accept]).find) == null ? void 0 : _e.call(
70741
- _d,
70742
- (a2) => a2 == null ? void 0 : a2.validateAgainstSchema
70743
- )) == null ? void 0 : _f.validateAgainstSchema);
70745
+ const [resolvedAccept, setResolvedAccept] = React$1.useState();
70746
+ if (resolvedAccept) {
70747
+ _accept = resolvedAccept;
70748
+ }
70749
+ const isAcceptPromise = (__accept == null ? void 0 : __accept.then) || (Array.isArray(__accept) ? __accept.some((a2) => a2 == null ? void 0 : a2.then) : false);
70750
+ const acceptLoading = !resolvedAccept && isAcceptPromise && `Accept Loading...`;
70751
+ if (isAcceptPromise && !resolvedAccept) {
70752
+ Promise.allSettled(Array.isArray(__accept) ? __accept : [__accept]).then(
70753
+ (results) => {
70754
+ const resolved = lodashExports.flatMap(results, (r2) => r2.value);
70755
+ setResolvedAccept(resolved);
70756
+ }
70757
+ );
70758
+ _accept = [];
70759
+ }
70760
+ if (acceptLoading)
70761
+ dropzoneDisabled = true;
70762
+ const accept = !_accept ? void 0 : isAcceptPromise && !resolvedAccept ? [] : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
70763
+ const callout = _callout || ((_b = (_a2 = accept == null ? void 0 : accept.find) == null ? void 0 : _a2.call(accept, (a2) => a2 == null ? void 0 : a2.callout)) == null ? void 0 : _b.callout);
70764
+ const validateAgainstSchemaToUse = _validateAgainstSchema || ((_d = (_c = accept == null ? void 0 : accept.find) == null ? void 0 : _c.call(accept, (a2) => a2 == null ? void 0 : a2.validateAgainstSchema)) == null ? void 0 : _d.validateAgainstSchema);
70744
70765
  React$1.useEffect(() => {
70745
70766
  validateAgainstSchemaStore.current.setValidateAgainstSchema(
70746
70767
  validateAgainstSchemaToUse
@@ -70750,7 +70771,6 @@ function UploaderInner({
70750
70771
  if (validateAgainstSchemaToUse) {
70751
70772
  validateAgainstSchema = validateAgainstSchemaStore.current;
70752
70773
  }
70753
- const accept = !_accept ? void 0 : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
70754
70774
  if ((validateAgainstSchema || autoUnzip) && accept && !accept.some((a2) => a2.type === "zip")) {
70755
70775
  accept == null ? void 0 : accept.unshift({
70756
70776
  type: "zip",
@@ -71015,14 +71035,14 @@ function UploaderInner({
71015
71035
  className: "tg-uploader-inner",
71016
71036
  style: { width: "100%", height: "fit-content", minWidth: 0 }
71017
71037
  },
71018
- simpleAccept && /* @__PURE__ */ React$1.createElement(
71038
+ (simpleAccept || acceptLoading) && /* @__PURE__ */ React$1.createElement(
71019
71039
  "div",
71020
71040
  {
71021
71041
  className: core$5.Classes.TEXT_MUTED,
71022
71042
  style: { fontSize: 11, marginBottom: 5 }
71023
71043
  },
71024
71044
  advancedAccept ? /* @__PURE__ */ React$1.createElement("div", { style: {} }, "Accepts  ", /* @__PURE__ */ React$1.createElement("span", { style: {} }, advancedAccept.map((a2, i) => {
71025
- const disabled2 = !(a2.description || a2.exampleFile || a2.exampleFiles);
71045
+ const disabled = !(a2.description || a2.exampleFile || a2.exampleFiles);
71026
71046
  const PopOrTooltip = a2.exampleFiles ? core$5.Popover : core$5.Tooltip;
71027
71047
  const hasDownload = a2.exampleFile || a2.exampleFiles;
71028
71048
  const CustomTag = !hasDownload ? "span" : "a";
@@ -71031,7 +71051,7 @@ function UploaderInner({
71031
71051
  {
71032
71052
  key: i,
71033
71053
  interactionKind: "hover",
71034
- disabled: disabled2,
71054
+ disabled,
71035
71055
  modifiers: popoverOverflowModifiers,
71036
71056
  content: a2.exampleFiles ? /* @__PURE__ */ React$1.createElement(core$5.Menu, null, a2.exampleFiles.map(
71037
71057
  ({ description, subtext, exampleFile, icon }, i2) => {
@@ -71109,12 +71129,15 @@ function UploaderInner({
71109
71129
  )
71110
71130
  )
71111
71131
  );
71112
- }))) : /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, "Accepts ", simpleAccept)
71132
+ }))) : acceptLoading ? (
71133
+ // make the dots below "load"
71134
+ /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, "Accept Loading", /* @__PURE__ */ React$1.createElement(LoadingDots, null))
71135
+ ) : /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, "Accepts ", simpleAccept)
71113
71136
  ),
71114
71137
  /* @__PURE__ */ React$1.createElement(
71115
71138
  Dropzone$1,
71116
71139
  __spreadValues(__spreadValues({
71117
- disabled,
71140
+ disabled: dropzoneDisabled,
71118
71141
  onClick: (evt) => evt.preventDefault(),
71119
71142
  multiple: fileLimit !== 1,
71120
71143
  accept: simpleAccept ? simpleAccept.split(", ").map((a2) => a2.startsWith(".") ? a2 : "." + a2).join(", ") : void 0
@@ -71368,7 +71391,8 @@ function UploaderInner({
71368
71391
  "tg-dropzone-reject": isDragReject,
71369
71392
  // tnr: the acceptClassName/rejectClassName doesn't work with file extensions (only mimetypes are supported when dragging). Thus we'll just always turn the drop area blue when dragging and let the filtering occur on drop. See https://github.com/react-dropzone/react-dropzone/issues/888#issuecomment-773938074
71370
71393
  "tg-dropzone-accept": isDragAccept,
71371
- "tg-dropzone-disabled": disabled
71394
+ "tg-dropzone-disabled": dropzoneDisabled,
71395
+ "bp3-disabled": dropzoneDisabled
71372
71396
  })
71373
71397
  }),
71374
71398
  /* @__PURE__ */ React$1.createElement("input", __spreadValues({}, getInputProps())),
@@ -77749,6 +77773,7 @@ exports.InfoHelper = InfoHelper;
77749
77773
  exports.InputField = InputField;
77750
77774
  exports.IntentText = IntentText;
77751
77775
  exports.Loading = Loading;
77776
+ exports.LoadingDots = LoadingDots;
77752
77777
  exports.MenuBar = MenuBar;
77753
77778
  exports.MenuItemWithTooltip = MenuItemWithTooltip;
77754
77779
  exports.NumericInputField = NumericInputField;