@teselagen/ui 0.3.70 → 0.3.71

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;
@@ -17131,25 +17117,16 @@ var toString$6 = {}.toString;
17131
17117
  var _cof = /* @__PURE__ */ __name(function(it) {
17132
17118
  return toString$6.call(it).slice(8, -1);
17133
17119
  }, "_cof");
17134
- var _iobject;
17135
- var hasRequired_iobject;
17136
- function require_iobject() {
17137
- if (hasRequired_iobject)
17138
- return _iobject;
17139
- hasRequired_iobject = 1;
17140
- var cof2 = _cof;
17141
- _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
17142
- return cof2(it) == "String" ? it.split("") : Object(it);
17143
- };
17144
- return _iobject;
17145
- }
17146
- __name(require_iobject, "require_iobject");
17120
+ var cof$2 = _cof;
17121
+ var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
17122
+ return cof$2(it) == "String" ? it.split("") : Object(it);
17123
+ };
17147
17124
  var _defined = /* @__PURE__ */ __name(function(it) {
17148
17125
  if (it == void 0)
17149
17126
  throw TypeError("Can't call method on " + it);
17150
17127
  return it;
17151
17128
  }, "_defined");
17152
- var IObject = require_iobject();
17129
+ var IObject = _iobject;
17153
17130
  var defined$2 = _defined;
17154
17131
  var _toIobject = /* @__PURE__ */ __name(function(it) {
17155
17132
  return IObject(defined$2(it));
@@ -17265,12 +17242,12 @@ function require_objectAssign() {
17265
17242
  if (hasRequired_objectAssign)
17266
17243
  return _objectAssign;
17267
17244
  hasRequired_objectAssign = 1;
17268
- var DESCRIPTORS2 = require_descriptors();
17245
+ var DESCRIPTORS2 = _descriptors;
17269
17246
  var getKeys2 = _objectKeys;
17270
17247
  var gOPS2 = _objectGops;
17271
17248
  var pIE2 = require_objectPie();
17272
17249
  var toObject2 = _toObject;
17273
- var IObject2 = require_iobject();
17250
+ var IObject2 = _iobject;
17274
17251
  var $assign = Object.assign;
17275
17252
  _objectAssign = !$assign || _fails(function() {
17276
17253
  var A2 = {};
@@ -17331,10 +17308,10 @@ var _iterStep = /* @__PURE__ */ __name(function(done, value) {
17331
17308
  }, "_iterStep");
17332
17309
  var _iterators = {};
17333
17310
  var _redefine = _hide;
17334
- var dP$1 = require_objectDp();
17311
+ var dP$1 = _objectDp;
17335
17312
  var anObject$4 = _anObject;
17336
17313
  var getKeys$1 = _objectKeys;
17337
- var _objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties(O2, Properties) {
17314
+ var _objectDps = _descriptors ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties(O2, Properties) {
17338
17315
  anObject$4(O2);
17339
17316
  var keys3 = getKeys$1(Properties);
17340
17317
  var length = keys3.length;
@@ -17401,7 +17378,7 @@ var $exports = _wks.exports = function(name) {
17401
17378
  };
17402
17379
  $exports.store = store;
17403
17380
  var _wksExports = _wks.exports;
17404
- var def = require_objectDp().f;
17381
+ var def = _objectDp.f;
17405
17382
  var has$9 = _has;
17406
17383
  var TAG$1 = _wksExports("toStringTag");
17407
17384
  var _setToStringTag = /* @__PURE__ */ __name(function(it, tag, stat) {
@@ -17674,7 +17651,7 @@ var ArrayProto = Array.prototype;
17674
17651
  var _isArrayIter = /* @__PURE__ */ __name(function(it) {
17675
17652
  return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
17676
17653
  }, "_isArrayIter");
17677
- var $defineProperty$1 = require_objectDp();
17654
+ var $defineProperty$1 = _objectDp;
17678
17655
  var createDesc$2 = _propertyDesc;
17679
17656
  var _createProperty = /* @__PURE__ */ __name(function(object2, index2, value) {
17680
17657
  if (index2 in object2)
@@ -17803,9 +17780,9 @@ var _default$8 = /* @__PURE__ */ __name(function(instance, Constructor) {
17803
17780
  }
17804
17781
  }, "_default$8");
17805
17782
  var $export$3 = _export;
17806
- $export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: require_objectDp().f });
17783
+ $export$3($export$3.S + $export$3.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
17807
17784
  var $Object$2 = _coreExports.Object;
17808
- var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty2(it, key, desc) {
17785
+ var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty3(it, key, desc) {
17809
17786
  return $Object$2.defineProperty(it, key, desc);
17810
17787
  }, "defineProperty");
17811
17788
  var defineProperty$8 = { "default": defineProperty$9, __esModule: true };
@@ -17844,7 +17821,7 @@ var _meta = { exports: {} };
17844
17821
  var META$1 = _uid("meta");
17845
17822
  var isObject$c = _isObject;
17846
17823
  var has$7 = _has;
17847
- var setDesc = require_objectDp().f;
17824
+ var setDesc = _objectDp.f;
17848
17825
  var id = 0;
17849
17826
  var isExtensible = Object.isExtensible || function() {
17850
17827
  return true;
@@ -17897,7 +17874,7 @@ var meta = _meta.exports = {
17897
17874
  var _metaExports = _meta.exports;
17898
17875
  var core = _coreExports;
17899
17876
  var wksExt$1 = _wksExt;
17900
- var defineProperty$7 = require_objectDp().f;
17877
+ var defineProperty$7 = _objectDp.f;
17901
17878
  var _wksDefine = /* @__PURE__ */ __name(function(name) {
17902
17879
  var $Symbol2 = core.Symbol || (core.Symbol = {});
17903
17880
  if (name.charAt(0) != "_" && !(name in $Symbol2))
@@ -17951,9 +17928,9 @@ var createDesc$1 = _propertyDesc;
17951
17928
  var toIObject$1 = _toIobject;
17952
17929
  var toPrimitive$1 = _toPrimitive;
17953
17930
  var has$6 = _has;
17954
- var IE8_DOM_DEFINE = require_ie8DomDefine();
17931
+ var IE8_DOM_DEFINE = _ie8DomDefine;
17955
17932
  var gOPD$2 = Object.getOwnPropertyDescriptor;
17956
- _objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
17933
+ _objectGopd.f = _descriptors ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
17957
17934
  O2 = toIObject$1(O2);
17958
17935
  P2 = toPrimitive$1(P2, true);
17959
17936
  if (IE8_DOM_DEFINE)
@@ -17966,7 +17943,7 @@ _objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function
17966
17943
  }, "getOwnPropertyDescriptor");
17967
17944
  var global$1 = _globalExports;
17968
17945
  var has$5 = _has;
17969
- var DESCRIPTORS = require_descriptors();
17946
+ var DESCRIPTORS = _descriptors;
17970
17947
  var $export$2 = _export;
17971
17948
  var redefine = _redefine;
17972
17949
  var META = _metaExports.KEY;
@@ -17989,7 +17966,7 @@ var _create$1 = _objectCreate;
17989
17966
  var gOPNExt = _objectGopnExt;
17990
17967
  var $GOPD = _objectGopd;
17991
17968
  var $GOPS = _objectGops;
17992
- var $DP = require_objectDp();
17969
+ var $DP = _objectDp;
17993
17970
  var $keys$1 = _objectKeys;
17994
17971
  var gOPD$1 = $GOPD.f;
17995
17972
  var dP = $DP.f;
@@ -18032,7 +18009,7 @@ var isSymbol$8 = USE_NATIVE && typeof $Symbol.iterator == "symbol" ? function(it
18032
18009
  } : function(it) {
18033
18010
  return it instanceof $Symbol;
18034
18011
  };
18035
- var $defineProperty = /* @__PURE__ */ __name(function defineProperty3(it, key, D2) {
18012
+ var $defineProperty = /* @__PURE__ */ __name(function defineProperty4(it, key, D2) {
18036
18013
  if (it === ObjectProto)
18037
18014
  $defineProperty(OPSymbols, key, D2);
18038
18015
  anObject(it);
@@ -54121,7 +54098,7 @@ var KNOWN_STATICS = {
54121
54098
  arguments: true,
54122
54099
  arity: true
54123
54100
  };
54124
- var defineProperty4 = Object.defineProperty;
54101
+ var defineProperty5 = Object.defineProperty;
54125
54102
  var getOwnPropertyNames4 = Object.getOwnPropertyNames;
54126
54103
  var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
54127
54104
  var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
@@ -54144,7 +54121,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
54144
54121
  if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
54145
54122
  var descriptor2 = getOwnPropertyDescriptor3(sourceComponent, key);
54146
54123
  try {
54147
- defineProperty4(targetComponent, key, descriptor2);
54124
+ defineProperty5(targetComponent, key, descriptor2);
54148
54125
  } catch (e2) {
54149
54126
  }
54150
54127
  }
@@ -70697,7 +70674,7 @@ __name(_ValidateAgainstSchema, "ValidateAgainstSchema");
70697
70674
  let ValidateAgainstSchema = _ValidateAgainstSchema;
70698
70675
  const emptyPromise = Promise.resolve.bind(Promise);
70699
70676
  function UploaderInner({
70700
- accept: _accept,
70677
+ accept: __accept,
70701
70678
  contentOverride: maybeContentOverride,
70702
70679
  innerIcon,
70703
70680
  innerText,
@@ -70727,20 +70704,37 @@ function UploaderInner({
70727
70704
  dropzoneProps = {},
70728
70705
  overflowList,
70729
70706
  autoUnzip,
70730
- disabled,
70707
+ _disabled,
70731
70708
  noBuildCsvOption,
70732
70709
  initializeForm,
70733
70710
  showFilesCount,
70734
70711
  threeDotMenuItems,
70735
70712
  onPreviewClick
70736
70713
  }) {
70737
- var _a2, _b, _c, _d, _e, _f;
70714
+ var _a2, _b, _c, _d;
70715
+ let dropzoneDisabled = _disabled;
70716
+ let _accept = __accept;
70738
70717
  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);
70718
+ const [resolvedAccept, setResolvedAccept] = React$1.useState();
70719
+ if (resolvedAccept) {
70720
+ _accept = resolvedAccept;
70721
+ }
70722
+ const isAcceptPromise = (__accept == null ? void 0 : __accept.then) || (Array.isArray(__accept) ? __accept.some((a2) => a2 == null ? void 0 : a2.then) : false);
70723
+ const acceptLoading = !resolvedAccept && isAcceptPromise && `Accept Loading...`;
70724
+ if (isAcceptPromise && !resolvedAccept) {
70725
+ Promise.allSettled(Array.isArray(__accept) ? __accept : [__accept]).then(
70726
+ (results) => {
70727
+ const resolved = lodashExports.flatMap(results, (r2) => r2.value);
70728
+ setResolvedAccept(resolved);
70729
+ }
70730
+ );
70731
+ _accept = [];
70732
+ }
70733
+ if (acceptLoading)
70734
+ dropzoneDisabled = true;
70735
+ const accept = !_accept ? void 0 : !isAcceptPromise && !resolvedAccept ? [] : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
70736
+ const callout = _callout || ((_b = (_a2 = accept.find) == null ? void 0 : _a2.call(accept, (a2) => a2 == null ? void 0 : a2.callout)) == null ? void 0 : _b.callout);
70737
+ const validateAgainstSchemaToUse = _validateAgainstSchema || ((_d = (_c = accept.find) == null ? void 0 : _c.call(accept, (a2) => a2 == null ? void 0 : a2.validateAgainstSchema)) == null ? void 0 : _d.validateAgainstSchema);
70744
70738
  React$1.useEffect(() => {
70745
70739
  validateAgainstSchemaStore.current.setValidateAgainstSchema(
70746
70740
  validateAgainstSchemaToUse
@@ -70750,7 +70744,6 @@ function UploaderInner({
70750
70744
  if (validateAgainstSchemaToUse) {
70751
70745
  validateAgainstSchema = validateAgainstSchemaStore.current;
70752
70746
  }
70753
- const accept = !_accept ? void 0 : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
70754
70747
  if ((validateAgainstSchema || autoUnzip) && accept && !accept.some((a2) => a2.type === "zip")) {
70755
70748
  accept == null ? void 0 : accept.unshift({
70756
70749
  type: "zip",
@@ -71015,14 +71008,14 @@ function UploaderInner({
71015
71008
  className: "tg-uploader-inner",
71016
71009
  style: { width: "100%", height: "fit-content", minWidth: 0 }
71017
71010
  },
71018
- simpleAccept && /* @__PURE__ */ React$1.createElement(
71011
+ (simpleAccept || acceptLoading) && /* @__PURE__ */ React$1.createElement(
71019
71012
  "div",
71020
71013
  {
71021
71014
  className: core$5.Classes.TEXT_MUTED,
71022
71015
  style: { fontSize: 11, marginBottom: 5 }
71023
71016
  },
71024
71017
  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);
71018
+ const disabled = !(a2.description || a2.exampleFile || a2.exampleFiles);
71026
71019
  const PopOrTooltip = a2.exampleFiles ? core$5.Popover : core$5.Tooltip;
71027
71020
  const hasDownload = a2.exampleFile || a2.exampleFiles;
71028
71021
  const CustomTag = !hasDownload ? "span" : "a";
@@ -71031,7 +71024,7 @@ function UploaderInner({
71031
71024
  {
71032
71025
  key: i,
71033
71026
  interactionKind: "hover",
71034
- disabled: disabled2,
71027
+ disabled,
71035
71028
  modifiers: popoverOverflowModifiers,
71036
71029
  content: a2.exampleFiles ? /* @__PURE__ */ React$1.createElement(core$5.Menu, null, a2.exampleFiles.map(
71037
71030
  ({ description, subtext, exampleFile, icon }, i2) => {
@@ -71109,12 +71102,15 @@ function UploaderInner({
71109
71102
  )
71110
71103
  )
71111
71104
  );
71112
- }))) : /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, "Accepts ", simpleAccept)
71105
+ }))) : acceptLoading ? (
71106
+ // make the dots below "load"
71107
+ /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, "Accept Loading", /* @__PURE__ */ React$1.createElement(LoadingDots, null))
71108
+ ) : /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, "Accepts ", simpleAccept)
71113
71109
  ),
71114
71110
  /* @__PURE__ */ React$1.createElement(
71115
71111
  Dropzone$1,
71116
71112
  __spreadValues(__spreadValues({
71117
- disabled,
71113
+ disabled: dropzoneDisabled,
71118
71114
  onClick: (evt) => evt.preventDefault(),
71119
71115
  multiple: fileLimit !== 1,
71120
71116
  accept: simpleAccept ? simpleAccept.split(", ").map((a2) => a2.startsWith(".") ? a2 : "." + a2).join(", ") : void 0
@@ -71368,7 +71364,8 @@ function UploaderInner({
71368
71364
  "tg-dropzone-reject": isDragReject,
71369
71365
  // 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
71366
  "tg-dropzone-accept": isDragAccept,
71371
- "tg-dropzone-disabled": disabled
71367
+ "tg-dropzone-disabled": dropzoneDisabled,
71368
+ "bp3-disabled": dropzoneDisabled
71372
71369
  })
71373
71370
  }),
71374
71371
  /* @__PURE__ */ React$1.createElement("input", __spreadValues({}, getInputProps())),
@@ -77749,6 +77746,7 @@ exports.InfoHelper = InfoHelper;
77749
77746
  exports.InputField = InputField;
77750
77747
  exports.IntentText = IntentText;
77751
77748
  exports.Loading = Loading;
77749
+ exports.LoadingDots = LoadingDots;
77752
77750
  exports.MenuBar = MenuBar;
77753
77751
  exports.MenuItemWithTooltip = MenuItemWithTooltip;
77754
77752
  exports.NumericInputField = NumericInputField;
package/index.es.js CHANGED
@@ -57,7 +57,7 @@ var __async = (__this, __arguments, generator) => {
57
57
  });
58
58
  };
59
59
  import * as React$1 from "react";
60
- import React__default, { forwardRef, useImperativeHandle, Fragment, useMemo, useRef, useReducer, useEffect, useCallback, useState, memo, Component, PureComponent, createElement, isValidElement, useContext } from "react";
60
+ import React__default, { useState, useEffect, forwardRef, useImperativeHandle, Fragment, useMemo, useRef, useReducer, useCallback, memo, Component, PureComponent, createElement, isValidElement, useContext } from "react";
61
61
  import { Icon, Classes, Button, Intent, Keys, MenuItem, Tag, useHotkeys, Popover, Tooltip, Toaster, Position, Menu, MenuDivider, NumericInput, InputGroup, Spinner, FormGroup, TextArea, Checkbox, Switch, EditableText, RadioGroup, Callout, ContextMenu, Dialog, Card, Tabs, Tab, Colors, Overlay, KeyCombo, ProgressBar } from "@blueprintjs/core";
62
62
  import ReactDOM, { unstable_batchedUpdates, findDOMNode as findDOMNode$1 } from "react-dom";
63
63
  import { FormName, formValueSelector, change, Field, reduxForm, SubmissionError, destroy, initialize, Fields } from "redux-form";
@@ -3044,6 +3044,18 @@ function parentIncludesNoChildDataTip(el, count) {
3044
3044
  return parentIncludesNoChildDataTip(el.parentElement, count + 1);
3045
3045
  }
3046
3046
  __name(parentIncludesNoChildDataTip, "parentIncludesNoChildDataTip");
3047
+ const LoadingDots = /* @__PURE__ */ __name(() => {
3048
+ const [dots, setDots] = useState("");
3049
+ useEffect(() => {
3050
+ const interval = setInterval(() => {
3051
+ setDots((dots2) => {
3052
+ return dots2.length === 3 ? "" : dots2 + ".";
3053
+ });
3054
+ }, 500);
3055
+ return () => clearInterval(interval);
3056
+ }, []);
3057
+ return /* @__PURE__ */ React__default.createElement("span", null, dots);
3058
+ }, "LoadingDots");
3047
3059
  const AssignDefaultsModeContext = React__default.createContext({
3048
3060
  inAssignDefaultsMode: false,
3049
3061
  // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -5505,10 +5517,10 @@ var ownKeys$3 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownK
5505
5517
  /* istanbul ignore next */
5506
5518
  Object.getOwnPropertyNames
5507
5519
  );
5508
- function toPrimitive$2(value) {
5520
+ function toPrimitive$3(value) {
5509
5521
  return value === null ? null : typeof value === "object" ? "" + value : value;
5510
5522
  }
5511
- __name(toPrimitive$2, "toPrimitive$2");
5523
+ __name(toPrimitive$3, "toPrimitive$3");
5512
5524
  function hasProp(target, prop) {
5513
5525
  return objectPrototype$1.hasOwnProperty.call(target, prop);
5514
5526
  }
@@ -6405,7 +6417,7 @@ var ObservableValue = /* @__PURE__ */ function(_Atom) {
6405
6417
  return this.name_ + "[" + this.value_ + "]";
6406
6418
  }, "toString");
6407
6419
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
6408
- return toPrimitive$2(this.get());
6420
+ return toPrimitive$3(this.get());
6409
6421
  }, "valueOf");
6410
6422
  _proto[_Symbol$toPrimitive] = function() {
6411
6423
  return this.valueOf();
@@ -6590,7 +6602,7 @@ var ComputedValue = /* @__PURE__ */ function() {
6590
6602
  return this.name_ + "[" + this.derivation.toString() + "]";
6591
6603
  }, "toString");
6592
6604
  _proto.valueOf = /* @__PURE__ */ __name(function valueOf() {
6593
- return toPrimitive$2(this.get());
6605
+ return toPrimitive$3(this.get());
6594
6606
  }, "valueOf");
6595
6607
  _proto[_Symbol$toPrimitive$1] = function() {
6596
6608
  return this.valueOf();
@@ -11224,7 +11236,7 @@ lodash.exports;
11224
11236
  "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
11225
11237
  );
11226
11238
  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;
11227
- var defineProperty5 = function() {
11239
+ var defineProperty6 = function() {
11228
11240
  try {
11229
11241
  var func = getNative2(Object2, "defineProperty");
11230
11242
  func({}, "", {});
@@ -11664,8 +11676,8 @@ lodash.exports;
11664
11676
  }
11665
11677
  __name(baseAssignIn2, "baseAssignIn");
11666
11678
  function baseAssignValue2(object2, key, value) {
11667
- if (key == "__proto__" && defineProperty5) {
11668
- defineProperty5(object2, key, {
11679
+ if (key == "__proto__" && defineProperty6) {
11680
+ defineProperty6(object2, key, {
11669
11681
  "configurable": true,
11670
11682
  "enumerable": true,
11671
11683
  "value": value,
@@ -12398,8 +12410,8 @@ lodash.exports;
12398
12410
  metaMap.set(func, data);
12399
12411
  return func;
12400
12412
  };
12401
- var baseSetToString2 = !defineProperty5 ? identity3 : function(func, string2) {
12402
- return defineProperty5(func, "toString", {
12413
+ var baseSetToString2 = !defineProperty6 ? identity3 : function(func, string2) {
12414
+ return defineProperty6(func, "toString", {
12403
12415
  "configurable": true,
12404
12416
  "enumerable": false,
12405
12417
  "value": constant2(string2),
@@ -16948,20 +16960,11 @@ var _fails = /* @__PURE__ */ __name(function(exec) {
16948
16960
  return true;
16949
16961
  }
16950
16962
  }, "_fails");
16951
- var _descriptors;
16952
- var hasRequired_descriptors;
16953
- function require_descriptors() {
16954
- if (hasRequired_descriptors)
16955
- return _descriptors;
16956
- hasRequired_descriptors = 1;
16957
- _descriptors = !_fails(function() {
16958
- return Object.defineProperty({}, "a", { get: function() {
16959
- return 7;
16960
- } }).a != 7;
16961
- });
16962
- return _descriptors;
16963
- }
16964
- __name(require_descriptors, "require_descriptors");
16963
+ var _descriptors = !_fails(function() {
16964
+ return Object.defineProperty({}, "a", { get: function() {
16965
+ return 7;
16966
+ } }).a != 7;
16967
+ });
16965
16968
  var _domCreate;
16966
16969
  var hasRequired_domCreate;
16967
16970
  function require_domCreate() {
@@ -16977,20 +16980,11 @@ function require_domCreate() {
16977
16980
  return _domCreate;
16978
16981
  }
16979
16982
  __name(require_domCreate, "require_domCreate");
16980
- var _ie8DomDefine;
16981
- var hasRequired_ie8DomDefine;
16982
- function require_ie8DomDefine() {
16983
- if (hasRequired_ie8DomDefine)
16984
- return _ie8DomDefine;
16985
- hasRequired_ie8DomDefine = 1;
16986
- _ie8DomDefine = !require_descriptors() && !_fails(function() {
16987
- return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
16988
- return 7;
16989
- } }).a != 7;
16990
- });
16991
- return _ie8DomDefine;
16992
- }
16993
- __name(require_ie8DomDefine, "require_ie8DomDefine");
16983
+ var _ie8DomDefine = !_descriptors && !_fails(function() {
16984
+ return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
16985
+ return 7;
16986
+ } }).a != 7;
16987
+ });
16994
16988
  var isObject$d = _isObject;
16995
16989
  var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
16996
16990
  if (!isObject$d(it))
@@ -17004,33 +16998,25 @@ var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
17004
16998
  return val;
17005
16999
  throw TypeError("Can't convert object to primitive value");
17006
17000
  }, "_toPrimitive");
17007
- var hasRequired_objectDp;
17008
- function require_objectDp() {
17009
- if (hasRequired_objectDp)
17010
- return _objectDp;
17011
- hasRequired_objectDp = 1;
17012
- var anObject2 = _anObject;
17013
- var IE8_DOM_DEFINE2 = require_ie8DomDefine();
17014
- var toPrimitive2 = _toPrimitive;
17015
- var dP2 = Object.defineProperty;
17016
- _objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty5(O2, P2, Attributes) {
17017
- anObject2(O2);
17018
- P2 = toPrimitive2(P2, true);
17019
- anObject2(Attributes);
17020
- if (IE8_DOM_DEFINE2)
17021
- try {
17022
- return dP2(O2, P2, Attributes);
17023
- } catch (e2) {
17024
- }
17025
- if ("get" in Attributes || "set" in Attributes)
17026
- throw TypeError("Accessors not supported!");
17027
- if ("value" in Attributes)
17028
- O2[P2] = Attributes.value;
17029
- return O2;
17030
- }, "defineProperty");
17031
- return _objectDp;
17032
- }
17033
- __name(require_objectDp, "require_objectDp");
17001
+ var anObject$5 = _anObject;
17002
+ var IE8_DOM_DEFINE$1 = _ie8DomDefine;
17003
+ var toPrimitive$2 = _toPrimitive;
17004
+ var dP$3 = Object.defineProperty;
17005
+ _objectDp.f = _descriptors ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty2(O2, P2, Attributes) {
17006
+ anObject$5(O2);
17007
+ P2 = toPrimitive$2(P2, true);
17008
+ anObject$5(Attributes);
17009
+ if (IE8_DOM_DEFINE$1)
17010
+ try {
17011
+ return dP$3(O2, P2, Attributes);
17012
+ } catch (e2) {
17013
+ }
17014
+ if ("get" in Attributes || "set" in Attributes)
17015
+ throw TypeError("Accessors not supported!");
17016
+ if ("value" in Attributes)
17017
+ O2[P2] = Attributes.value;
17018
+ return O2;
17019
+ }, "defineProperty");
17034
17020
  var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
17035
17021
  return {
17036
17022
  enumerable: !(bitmap & 1),
@@ -17039,9 +17025,9 @@ var _propertyDesc = /* @__PURE__ */ __name(function(bitmap, value) {
17039
17025
  value
17040
17026
  };
17041
17027
  }, "_propertyDesc");
17042
- var dP$2 = require_objectDp();
17028
+ var dP$2 = _objectDp;
17043
17029
  var createDesc$3 = _propertyDesc;
17044
- var _hide = require_descriptors() ? function(object2, key, value) {
17030
+ var _hide = _descriptors ? function(object2, key, value) {
17045
17031
  return dP$2.f(object2, key, createDesc$3(1, value));
17046
17032
  } : function(object2, key, value) {
17047
17033
  object2[key] = value;
@@ -17113,25 +17099,16 @@ var toString$6 = {}.toString;
17113
17099
  var _cof = /* @__PURE__ */ __name(function(it) {
17114
17100
  return toString$6.call(it).slice(8, -1);
17115
17101
  }, "_cof");
17116
- var _iobject;
17117
- var hasRequired_iobject;
17118
- function require_iobject() {
17119
- if (hasRequired_iobject)
17120
- return _iobject;
17121
- hasRequired_iobject = 1;
17122
- var cof2 = _cof;
17123
- _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
17124
- return cof2(it) == "String" ? it.split("") : Object(it);
17125
- };
17126
- return _iobject;
17127
- }
17128
- __name(require_iobject, "require_iobject");
17102
+ var cof$2 = _cof;
17103
+ var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
17104
+ return cof$2(it) == "String" ? it.split("") : Object(it);
17105
+ };
17129
17106
  var _defined = /* @__PURE__ */ __name(function(it) {
17130
17107
  if (it == void 0)
17131
17108
  throw TypeError("Can't call method on " + it);
17132
17109
  return it;
17133
17110
  }, "_defined");
17134
- var IObject = require_iobject();
17111
+ var IObject = _iobject;
17135
17112
  var defined$2 = _defined;
17136
17113
  var _toIobject = /* @__PURE__ */ __name(function(it) {
17137
17114
  return IObject(defined$2(it));
@@ -17247,12 +17224,12 @@ function require_objectAssign() {
17247
17224
  if (hasRequired_objectAssign)
17248
17225
  return _objectAssign;
17249
17226
  hasRequired_objectAssign = 1;
17250
- var DESCRIPTORS2 = require_descriptors();
17227
+ var DESCRIPTORS2 = _descriptors;
17251
17228
  var getKeys2 = _objectKeys;
17252
17229
  var gOPS2 = _objectGops;
17253
17230
  var pIE2 = require_objectPie();
17254
17231
  var toObject2 = _toObject;
17255
- var IObject2 = require_iobject();
17232
+ var IObject2 = _iobject;
17256
17233
  var $assign = Object.assign;
17257
17234
  _objectAssign = !$assign || _fails(function() {
17258
17235
  var A2 = {};
@@ -17313,10 +17290,10 @@ var _iterStep = /* @__PURE__ */ __name(function(done, value) {
17313
17290
  }, "_iterStep");
17314
17291
  var _iterators = {};
17315
17292
  var _redefine = _hide;
17316
- var dP$1 = require_objectDp();
17293
+ var dP$1 = _objectDp;
17317
17294
  var anObject$4 = _anObject;
17318
17295
  var getKeys$1 = _objectKeys;
17319
- var _objectDps = require_descriptors() ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties(O2, Properties) {
17296
+ var _objectDps = _descriptors ? Object.defineProperties : /* @__PURE__ */ __name(function defineProperties(O2, Properties) {
17320
17297
  anObject$4(O2);
17321
17298
  var keys3 = getKeys$1(Properties);
17322
17299
  var length = keys3.length;
@@ -17383,7 +17360,7 @@ var $exports = _wks.exports = function(name) {
17383
17360
  };
17384
17361
  $exports.store = store;
17385
17362
  var _wksExports = _wks.exports;
17386
- var def = require_objectDp().f;
17363
+ var def = _objectDp.f;
17387
17364
  var has$9 = _has;
17388
17365
  var TAG$1 = _wksExports("toStringTag");
17389
17366
  var _setToStringTag = /* @__PURE__ */ __name(function(it, tag, stat) {
@@ -17656,7 +17633,7 @@ var ArrayProto = Array.prototype;
17656
17633
  var _isArrayIter = /* @__PURE__ */ __name(function(it) {
17657
17634
  return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
17658
17635
  }, "_isArrayIter");
17659
- var $defineProperty$1 = require_objectDp();
17636
+ var $defineProperty$1 = _objectDp;
17660
17637
  var createDesc$2 = _propertyDesc;
17661
17638
  var _createProperty = /* @__PURE__ */ __name(function(object2, index2, value) {
17662
17639
  if (index2 in object2)
@@ -17785,9 +17762,9 @@ var _default$8 = /* @__PURE__ */ __name(function(instance, Constructor) {
17785
17762
  }
17786
17763
  }, "_default$8");
17787
17764
  var $export$3 = _export;
17788
- $export$3($export$3.S + $export$3.F * !require_descriptors(), "Object", { defineProperty: require_objectDp().f });
17765
+ $export$3($export$3.S + $export$3.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
17789
17766
  var $Object$2 = _coreExports.Object;
17790
- var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty2(it, key, desc) {
17767
+ var defineProperty$9 = /* @__PURE__ */ __name(function defineProperty3(it, key, desc) {
17791
17768
  return $Object$2.defineProperty(it, key, desc);
17792
17769
  }, "defineProperty");
17793
17770
  var defineProperty$8 = { "default": defineProperty$9, __esModule: true };
@@ -17826,7 +17803,7 @@ var _meta = { exports: {} };
17826
17803
  var META$1 = _uid("meta");
17827
17804
  var isObject$c = _isObject;
17828
17805
  var has$7 = _has;
17829
- var setDesc = require_objectDp().f;
17806
+ var setDesc = _objectDp.f;
17830
17807
  var id = 0;
17831
17808
  var isExtensible = Object.isExtensible || function() {
17832
17809
  return true;
@@ -17879,7 +17856,7 @@ var meta = _meta.exports = {
17879
17856
  var _metaExports = _meta.exports;
17880
17857
  var core = _coreExports;
17881
17858
  var wksExt$1 = _wksExt;
17882
- var defineProperty$7 = require_objectDp().f;
17859
+ var defineProperty$7 = _objectDp.f;
17883
17860
  var _wksDefine = /* @__PURE__ */ __name(function(name) {
17884
17861
  var $Symbol2 = core.Symbol || (core.Symbol = {});
17885
17862
  if (name.charAt(0) != "_" && !(name in $Symbol2))
@@ -17933,9 +17910,9 @@ var createDesc$1 = _propertyDesc;
17933
17910
  var toIObject$1 = _toIobject;
17934
17911
  var toPrimitive$1 = _toPrimitive;
17935
17912
  var has$6 = _has;
17936
- var IE8_DOM_DEFINE = require_ie8DomDefine();
17913
+ var IE8_DOM_DEFINE = _ie8DomDefine;
17937
17914
  var gOPD$2 = Object.getOwnPropertyDescriptor;
17938
- _objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
17915
+ _objectGopd.f = _descriptors ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
17939
17916
  O2 = toIObject$1(O2);
17940
17917
  P2 = toPrimitive$1(P2, true);
17941
17918
  if (IE8_DOM_DEFINE)
@@ -17948,7 +17925,7 @@ _objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function
17948
17925
  }, "getOwnPropertyDescriptor");
17949
17926
  var global$1 = _globalExports;
17950
17927
  var has$5 = _has;
17951
- var DESCRIPTORS = require_descriptors();
17928
+ var DESCRIPTORS = _descriptors;
17952
17929
  var $export$2 = _export;
17953
17930
  var redefine = _redefine;
17954
17931
  var META = _metaExports.KEY;
@@ -17971,7 +17948,7 @@ var _create$1 = _objectCreate;
17971
17948
  var gOPNExt = _objectGopnExt;
17972
17949
  var $GOPD = _objectGopd;
17973
17950
  var $GOPS = _objectGops;
17974
- var $DP = require_objectDp();
17951
+ var $DP = _objectDp;
17975
17952
  var $keys$1 = _objectKeys;
17976
17953
  var gOPD$1 = $GOPD.f;
17977
17954
  var dP = $DP.f;
@@ -18014,7 +17991,7 @@ var isSymbol$8 = USE_NATIVE && typeof $Symbol.iterator == "symbol" ? function(it
18014
17991
  } : function(it) {
18015
17992
  return it instanceof $Symbol;
18016
17993
  };
18017
- var $defineProperty = /* @__PURE__ */ __name(function defineProperty3(it, key, D2) {
17994
+ var $defineProperty = /* @__PURE__ */ __name(function defineProperty4(it, key, D2) {
18018
17995
  if (it === ObjectProto)
18019
17996
  $defineProperty(OPSymbols, key, D2);
18020
17997
  anObject(it);
@@ -54103,7 +54080,7 @@ var KNOWN_STATICS = {
54103
54080
  arguments: true,
54104
54081
  arity: true
54105
54082
  };
54106
- var defineProperty4 = Object.defineProperty;
54083
+ var defineProperty5 = Object.defineProperty;
54107
54084
  var getOwnPropertyNames4 = Object.getOwnPropertyNames;
54108
54085
  var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
54109
54086
  var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
@@ -54126,7 +54103,7 @@ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
54126
54103
  if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
54127
54104
  var descriptor2 = getOwnPropertyDescriptor3(sourceComponent, key);
54128
54105
  try {
54129
- defineProperty4(targetComponent, key, descriptor2);
54106
+ defineProperty5(targetComponent, key, descriptor2);
54130
54107
  } catch (e2) {
54131
54108
  }
54132
54109
  }
@@ -70679,7 +70656,7 @@ __name(_ValidateAgainstSchema, "ValidateAgainstSchema");
70679
70656
  let ValidateAgainstSchema = _ValidateAgainstSchema;
70680
70657
  const emptyPromise = Promise.resolve.bind(Promise);
70681
70658
  function UploaderInner({
70682
- accept: _accept,
70659
+ accept: __accept,
70683
70660
  contentOverride: maybeContentOverride,
70684
70661
  innerIcon,
70685
70662
  innerText,
@@ -70709,20 +70686,37 @@ function UploaderInner({
70709
70686
  dropzoneProps = {},
70710
70687
  overflowList,
70711
70688
  autoUnzip,
70712
- disabled,
70689
+ _disabled,
70713
70690
  noBuildCsvOption,
70714
70691
  initializeForm,
70715
70692
  showFilesCount,
70716
70693
  threeDotMenuItems,
70717
70694
  onPreviewClick
70718
70695
  }) {
70719
- var _a2, _b, _c, _d, _e, _f;
70696
+ var _a2, _b, _c, _d;
70697
+ let dropzoneDisabled = _disabled;
70698
+ let _accept = __accept;
70720
70699
  const validateAgainstSchemaStore = useRef(new ValidateAgainstSchema());
70721
- 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);
70722
- const validateAgainstSchemaToUse = _validateAgainstSchema || ((_f = (_e = (_d = lodashExports.isArray(_accept) ? _accept : [_accept]).find) == null ? void 0 : _e.call(
70723
- _d,
70724
- (a2) => a2 == null ? void 0 : a2.validateAgainstSchema
70725
- )) == null ? void 0 : _f.validateAgainstSchema);
70700
+ const [resolvedAccept, setResolvedAccept] = useState();
70701
+ if (resolvedAccept) {
70702
+ _accept = resolvedAccept;
70703
+ }
70704
+ const isAcceptPromise = (__accept == null ? void 0 : __accept.then) || (Array.isArray(__accept) ? __accept.some((a2) => a2 == null ? void 0 : a2.then) : false);
70705
+ const acceptLoading = !resolvedAccept && isAcceptPromise && `Accept Loading...`;
70706
+ if (isAcceptPromise && !resolvedAccept) {
70707
+ Promise.allSettled(Array.isArray(__accept) ? __accept : [__accept]).then(
70708
+ (results) => {
70709
+ const resolved = lodashExports.flatMap(results, (r2) => r2.value);
70710
+ setResolvedAccept(resolved);
70711
+ }
70712
+ );
70713
+ _accept = [];
70714
+ }
70715
+ if (acceptLoading)
70716
+ dropzoneDisabled = true;
70717
+ const accept = !_accept ? void 0 : !isAcceptPromise && !resolvedAccept ? [] : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
70718
+ const callout = _callout || ((_b = (_a2 = accept.find) == null ? void 0 : _a2.call(accept, (a2) => a2 == null ? void 0 : a2.callout)) == null ? void 0 : _b.callout);
70719
+ const validateAgainstSchemaToUse = _validateAgainstSchema || ((_d = (_c = accept.find) == null ? void 0 : _c.call(accept, (a2) => a2 == null ? void 0 : a2.validateAgainstSchema)) == null ? void 0 : _d.validateAgainstSchema);
70726
70720
  useEffect(() => {
70727
70721
  validateAgainstSchemaStore.current.setValidateAgainstSchema(
70728
70722
  validateAgainstSchemaToUse
@@ -70732,7 +70726,6 @@ function UploaderInner({
70732
70726
  if (validateAgainstSchemaToUse) {
70733
70727
  validateAgainstSchema = validateAgainstSchemaStore.current;
70734
70728
  }
70735
- const accept = !_accept ? void 0 : lodashExports.isPlainObject(_accept) ? [_accept] : lodashExports.isArray(_accept) ? _accept : _accept.split(",").map((a2) => ({ type: a2 }));
70736
70729
  if ((validateAgainstSchema || autoUnzip) && accept && !accept.some((a2) => a2.type === "zip")) {
70737
70730
  accept == null ? void 0 : accept.unshift({
70738
70731
  type: "zip",
@@ -70997,14 +70990,14 @@ function UploaderInner({
70997
70990
  className: "tg-uploader-inner",
70998
70991
  style: { width: "100%", height: "fit-content", minWidth: 0 }
70999
70992
  },
71000
- simpleAccept && /* @__PURE__ */ React__default.createElement(
70993
+ (simpleAccept || acceptLoading) && /* @__PURE__ */ React__default.createElement(
71001
70994
  "div",
71002
70995
  {
71003
70996
  className: Classes.TEXT_MUTED,
71004
70997
  style: { fontSize: 11, marginBottom: 5 }
71005
70998
  },
71006
70999
  advancedAccept ? /* @__PURE__ */ React__default.createElement("div", { style: {} }, "Accepts  ", /* @__PURE__ */ React__default.createElement("span", { style: {} }, advancedAccept.map((a2, i) => {
71007
- const disabled2 = !(a2.description || a2.exampleFile || a2.exampleFiles);
71000
+ const disabled = !(a2.description || a2.exampleFile || a2.exampleFiles);
71008
71001
  const PopOrTooltip = a2.exampleFiles ? Popover : Tooltip;
71009
71002
  const hasDownload = a2.exampleFile || a2.exampleFiles;
71010
71003
  const CustomTag = !hasDownload ? "span" : "a";
@@ -71013,7 +71006,7 @@ function UploaderInner({
71013
71006
  {
71014
71007
  key: i,
71015
71008
  interactionKind: "hover",
71016
- disabled: disabled2,
71009
+ disabled,
71017
71010
  modifiers: popoverOverflowModifiers,
71018
71011
  content: a2.exampleFiles ? /* @__PURE__ */ React__default.createElement(Menu, null, a2.exampleFiles.map(
71019
71012
  ({ description, subtext, exampleFile, icon }, i2) => {
@@ -71091,12 +71084,15 @@ function UploaderInner({
71091
71084
  )
71092
71085
  )
71093
71086
  );
71094
- }))) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, "Accepts ", simpleAccept)
71087
+ }))) : acceptLoading ? (
71088
+ // make the dots below "load"
71089
+ /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, "Accept Loading", /* @__PURE__ */ React__default.createElement(LoadingDots, null))
71090
+ ) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, "Accepts ", simpleAccept)
71095
71091
  ),
71096
71092
  /* @__PURE__ */ React__default.createElement(
71097
71093
  Dropzone$1,
71098
71094
  __spreadValues(__spreadValues({
71099
- disabled,
71095
+ disabled: dropzoneDisabled,
71100
71096
  onClick: (evt) => evt.preventDefault(),
71101
71097
  multiple: fileLimit !== 1,
71102
71098
  accept: simpleAccept ? simpleAccept.split(", ").map((a2) => a2.startsWith(".") ? a2 : "." + a2).join(", ") : void 0
@@ -71350,7 +71346,8 @@ function UploaderInner({
71350
71346
  "tg-dropzone-reject": isDragReject,
71351
71347
  // 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
71352
71348
  "tg-dropzone-accept": isDragAccept,
71353
- "tg-dropzone-disabled": disabled
71349
+ "tg-dropzone-disabled": dropzoneDisabled,
71350
+ "bp3-disabled": dropzoneDisabled
71354
71351
  })
71355
71352
  }),
71356
71353
  /* @__PURE__ */ React__default.createElement("input", __spreadValues({}, getInputProps())),
@@ -77732,6 +77729,7 @@ export {
77732
77729
  InputField,
77733
77730
  IntentText,
77734
77731
  Loading,
77732
+ LoadingDots,
77735
77733
  MenuBar,
77736
77734
  MenuItemWithTooltip,
77737
77735
  NumericInputField,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.3.70",
3
+ "version": "0.3.71",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -0,0 +1,14 @@
1
+ import React, { useEffect, useState } from "react";
2
+
3
+ export const LoadingDots = () => {
4
+ const [dots, setDots] = useState("");
5
+ useEffect(() => {
6
+ const interval = setInterval(() => {
7
+ setDots(dots => {
8
+ return dots.length === 3 ? "" : dots + ".";
9
+ });
10
+ }, 500);
11
+ return () => clearInterval(interval);
12
+ }, []);
13
+ return <span>{dots}</span>;
14
+ };
@@ -43,6 +43,7 @@ import { initialize } from "redux-form";
43
43
  import classNames from "classnames";
44
44
  import { compose } from "recompose";
45
45
  import convertSchema from "../DataTable/utils/convertSchema";
46
+ import { LoadingDots } from "./LoadingDots";
46
47
 
47
48
  configure({ isolateGlobalState: true });
48
49
  const helperText = [
@@ -115,7 +116,7 @@ class ValidateAgainstSchema {
115
116
  const emptyPromise = Promise.resolve.bind(Promise);
116
117
 
117
118
  function UploaderInner({
118
- accept: _accept,
119
+ accept: __accept,
119
120
  contentOverride: maybeContentOverride,
120
121
  innerIcon,
121
122
  innerText,
@@ -138,23 +139,52 @@ function UploaderInner({
138
139
  dropzoneProps = {},
139
140
  overflowList,
140
141
  autoUnzip,
141
- disabled,
142
+ _disabled,
142
143
  noBuildCsvOption,
143
144
  initializeForm,
144
145
  showFilesCount,
145
146
  threeDotMenuItems,
146
147
  onPreviewClick
147
148
  }) {
149
+ let dropzoneDisabled = _disabled;
150
+ let _accept = __accept;
148
151
  //on component did mount
149
152
  const validateAgainstSchemaStore = useRef(new ValidateAgainstSchema());
150
- const callout =
151
- _callout ||
152
- (isArray(_accept) ? _accept : [_accept]).find?.(a => a?.callout)?.callout;
153
+ const [resolvedAccept, setResolvedAccept] = useState();
154
+ if (resolvedAccept) {
155
+ _accept = resolvedAccept;
156
+ }
157
+ const isAcceptPromise =
158
+ __accept?.then ||
159
+ (Array.isArray(__accept) ? __accept.some(a => a?.then) : false);
160
+ const acceptLoading =
161
+ !resolvedAccept && isAcceptPromise && `Accept Loading...`;
162
+
163
+ if (isAcceptPromise && !resolvedAccept) {
164
+ Promise.allSettled(Array.isArray(__accept) ? __accept : [__accept]).then(
165
+ results => {
166
+ const resolved = flatMap(results, r => r.value);
167
+ setResolvedAccept(resolved);
168
+ }
169
+ );
170
+ _accept = [];
171
+ }
172
+
173
+ if (acceptLoading) dropzoneDisabled = true;
174
+ const accept = !_accept
175
+ ? undefined
176
+ : !isAcceptPromise && !resolvedAccept
177
+ ? []
178
+ : isPlainObject(_accept)
179
+ ? [_accept]
180
+ : isArray(_accept)
181
+ ? _accept
182
+ : _accept.split(",").map(a => ({ type: a }));
183
+ const callout = _callout || accept.find?.(a => a?.callout)?.callout;
184
+
153
185
  const validateAgainstSchemaToUse =
154
186
  _validateAgainstSchema ||
155
- (isArray(_accept) ? _accept : [_accept]).find?.(
156
- a => a?.validateAgainstSchema
157
- )?.validateAgainstSchema;
187
+ accept.find?.(a => a?.validateAgainstSchema)?.validateAgainstSchema;
158
188
 
159
189
  useEffect(() => {
160
190
  // validateAgainstSchema
@@ -166,13 +196,7 @@ function UploaderInner({
166
196
  if (validateAgainstSchemaToUse) {
167
197
  validateAgainstSchema = validateAgainstSchemaStore.current;
168
198
  }
169
- const accept = !_accept
170
- ? undefined
171
- : isPlainObject(_accept)
172
- ? [_accept]
173
- : isArray(_accept)
174
- ? _accept
175
- : _accept.split(",").map(a => ({ type: a }));
199
+
176
200
  if (
177
201
  (validateAgainstSchema || autoUnzip) &&
178
202
  accept &&
@@ -471,7 +495,7 @@ function UploaderInner({
471
495
  className="tg-uploader-inner"
472
496
  style={{ width: "100%", height: "fit-content", minWidth: 0 }}
473
497
  >
474
- {simpleAccept && (
498
+ {(simpleAccept || acceptLoading) && (
475
499
  <div
476
500
  className={Classes.TEXT_MUTED}
477
501
  style={{ fontSize: 11, marginBottom: 5 }}
@@ -601,13 +625,19 @@ function UploaderInner({
601
625
  })}
602
626
  </span>
603
627
  </div>
628
+ ) : acceptLoading ? (
629
+ // make the dots below "load"
630
+
631
+ <>
632
+ Accept Loading<LoadingDots></LoadingDots>
633
+ </>
604
634
  ) : (
605
635
  <>Accepts {simpleAccept}</>
606
636
  )}
607
637
  </div>
608
638
  )}
609
639
  <Dropzone
610
- disabled={disabled}
640
+ disabled={dropzoneDisabled}
611
641
  onClick={evt => evt.preventDefault()}
612
642
  multiple={fileLimit !== 1}
613
643
  accept={
@@ -922,7 +952,8 @@ function UploaderInner({
922
952
  "tg-dropzone-active": isDragActive,
923
953
  "tg-dropzone-reject": isDragReject, // 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
924
954
  "tg-dropzone-accept": isDragAccept,
925
- "tg-dropzone-disabled": disabled
955
+ "tg-dropzone-disabled": dropzoneDisabled,
956
+ "bp3-disabled": dropzoneDisabled
926
957
  })}
927
958
  >
928
959
  <input {...getInputProps()} />
@@ -62,6 +62,7 @@
62
62
  border-color: rgb(91, 157, 211);
63
63
  }
64
64
  .tg-dropzone-disabled {
65
+ cursor: not-allowed;
65
66
  border-color: rgb(136, 133, 132) !important;
66
67
  opacity: 0.8;
67
68
  }
@@ -418,10 +418,10 @@ const UploadCsvWizardDialogInner = compose(
418
418
  !hasSubmitted
419
419
  ? "Review and Edit Data"
420
420
  : onMultiFileUploadSubmit
421
- ? isThisTheLastBadFile
422
- ? "Finalize Files"
423
- : "Next File"
424
- : "Add File"
421
+ ? isThisTheLastBadFile
422
+ ? "Finalize Files"
423
+ : "Next File"
424
+ : "Add File"
425
425
  }
426
426
  submitting={submitting}
427
427
  disabled={
package/src/index.js CHANGED
@@ -3,6 +3,7 @@ import "@blueprintjs/datetime/lib/css/blueprint-datetime.css";
3
3
  import "@blueprintjs/icons/lib/css/blueprint-icons.css";
4
4
  import "./style.css";
5
5
  import "./autoTooltip";
6
+ export { LoadingDots } from "./FormComponents/LoadingDots";
6
7
  export * from "./AssignDefaultsModeContext";
7
8
  export { default as Uploader } from "./FormComponents/Uploader";
8
9
  export { mergeSchemas } from "./DataTable/utils/convertSchema";
package/style.css CHANGED
@@ -9779,6 +9779,7 @@ body:not(.drag-active)
9779
9779
  border-color: rgb(91, 157, 211);
9780
9780
  }
9781
9781
  .tg-dropzone-disabled {
9782
+ cursor: not-allowed;
9782
9783
  border-color: rgb(136, 133, 132) !important;
9783
9784
  opacity: 0.8;
9784
9785
  }