funda-ui 4.7.625 → 4.7.701

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 (84) hide show
  1. package/CascadingSelect/index.js +2 -2
  2. package/CascadingSelectE2E/index.js +2 -2
  3. package/Chatbox/index.js +3 -17
  4. package/Checkbox/index.js +3 -3
  5. package/ColorPicker/index.js +3 -18
  6. package/Date/index.js +3 -18
  7. package/EventCalendarTimeline/index.d.ts +1 -1
  8. package/EventCalendarTimeline/index.js +11 -1
  9. package/File/index.d.ts +9 -0
  10. package/File/index.js +245 -93
  11. package/Input/index.js +3 -18
  12. package/LiveSearch/index.js +3 -18
  13. package/NativeSelect/index.js +3 -3
  14. package/NumberInput/index.js +3 -18
  15. package/Popover/index.css +198 -0
  16. package/Popover/index.d.ts +4 -0
  17. package/Popover/index.js +1808 -0
  18. package/README.md +1 -0
  19. package/Radio/index.js +3 -3
  20. package/RangeSlider/index.js +3 -18
  21. package/SearchBar/index.js +3 -18
  22. package/Select/index.js +3 -2
  23. package/Switch/index.js +3 -3
  24. package/TagInput/index.css +31 -31
  25. package/TagInput/index.js +12 -23
  26. package/Textarea/index.js +3 -17
  27. package/Utils/useSSE.d.ts +9 -0
  28. package/Utils/useSSE.js +211 -0
  29. package/all.d.ts +1 -0
  30. package/all.js +1 -0
  31. package/lib/cjs/CascadingSelect/index.js +2 -2
  32. package/lib/cjs/CascadingSelectE2E/index.js +2 -2
  33. package/lib/cjs/Chatbox/index.js +3 -17
  34. package/lib/cjs/Checkbox/index.js +3 -3
  35. package/lib/cjs/ColorPicker/index.js +3 -18
  36. package/lib/cjs/Date/index.js +3 -18
  37. package/lib/cjs/EventCalendarTimeline/index.d.ts +1 -1
  38. package/lib/cjs/EventCalendarTimeline/index.js +11 -1
  39. package/lib/cjs/File/index.d.ts +9 -0
  40. package/lib/cjs/File/index.js +245 -93
  41. package/lib/cjs/Input/index.js +3 -18
  42. package/lib/cjs/LiveSearch/index.js +3 -18
  43. package/lib/cjs/NativeSelect/index.js +3 -3
  44. package/lib/cjs/NumberInput/index.js +3 -18
  45. package/lib/cjs/Popover/index.d.ts +4 -0
  46. package/lib/cjs/Popover/index.js +1808 -0
  47. package/lib/cjs/Radio/index.js +3 -3
  48. package/lib/cjs/RangeSlider/index.js +3 -18
  49. package/lib/cjs/SearchBar/index.js +3 -18
  50. package/lib/cjs/Select/index.js +3 -2
  51. package/lib/cjs/Switch/index.js +3 -3
  52. package/lib/cjs/TagInput/index.js +12 -23
  53. package/lib/cjs/Textarea/index.js +3 -17
  54. package/lib/cjs/Utils/useSSE.d.ts +9 -0
  55. package/lib/cjs/Utils/useSSE.js +211 -0
  56. package/lib/cjs/index.d.ts +1 -0
  57. package/lib/cjs/index.js +1 -0
  58. package/lib/css/Popover/index.css +198 -0
  59. package/lib/css/TagInput/index.css +31 -31
  60. package/lib/esm/CascadingSelect/index.tsx +2 -2
  61. package/lib/esm/CascadingSelectE2E/index.tsx +2 -2
  62. package/lib/esm/Checkbox/index.tsx +3 -3
  63. package/lib/esm/ColorPicker/index.tsx +4 -15
  64. package/lib/esm/EventCalendarTimeline/index.tsx +11 -2
  65. package/lib/esm/File/index.tsx +148 -23
  66. package/lib/esm/Input/index.tsx +6 -17
  67. package/lib/esm/NativeSelect/index.tsx +3 -3
  68. package/lib/esm/NumberInput/index.tsx +7 -15
  69. package/lib/esm/Popover/Popover.tsx +251 -0
  70. package/lib/esm/Popover/PopoverClose.tsx +51 -0
  71. package/lib/esm/Popover/PopoverContent.tsx +72 -0
  72. package/lib/esm/Popover/PopoverTrigger.tsx +62 -0
  73. package/lib/esm/Popover/index.scss +272 -0
  74. package/lib/esm/Popover/index.tsx +4 -0
  75. package/lib/esm/Radio/index.tsx +3 -3
  76. package/lib/esm/SearchBar/index.tsx +8 -12
  77. package/lib/esm/Select/index.tsx +2 -2
  78. package/lib/esm/Switch/index.tsx +3 -3
  79. package/lib/esm/TagInput/index.scss +24 -24
  80. package/lib/esm/TagInput/index.tsx +13 -20
  81. package/lib/esm/Textarea/index.tsx +6 -14
  82. package/lib/esm/Utils/hooks/useSSE.tsx +109 -0
  83. package/lib/esm/index.js +1 -0
  84. package/package.json +1 -1
@@ -1245,7 +1245,7 @@ __webpack_require__.r(__webpack_exports__);
1245
1245
  /* harmony import */ var funda_utils_dist_cjs_buffer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(funda_utils_dist_cjs_buffer__WEBPACK_IMPORTED_MODULE_2__);
1246
1246
  /* harmony import */ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(188);
1247
1247
  /* harmony import */ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_3__);
1248
- var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "labelClassName", "labelHoverClassName", "accept", "inline", "autoSubmit", "fetchUrl", "fetchMethod", "fetchParams", "multiple", "submitLabel", "submitClassName", "progressLabel", "progressClassName", "disabled", "required", "value", "requiredLabel", "label", "name", "id", "data", "tabIndex", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "onChange", "onComplete", "onProgress"];
1248
+ var _excluded = ["contentRef", "wrapperClassName", "controlClassName", "controlExClassName", "labelClassName", "labelHoverClassName", "accept", "inline", "autoSubmit", "fetchUrl", "fetchMethod", "fetchParams", "multiple", "submitLabel", "submitClassName", "progressLabel", "progressClassName", "disabled", "required", "value", "requiredLabel", "label", "name", "id", "data", "tabIndex", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "formDataAppend", "onChange", "onComplete", "onProgress", "enableChunkedUpload", "chunkSize", "chunkDataAppend", "onChunkProgress"];
1249
1249
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1250
1250
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1251
1251
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -1256,9 +1256,9 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
1256
1256
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1257
1257
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1258
1258
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1259
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function (_e2) { function e(_x6) { return _e2.apply(this, arguments); } e.toString = function () { return _e2.toString(); }; return e; }(function (e) { throw e; }), f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function (_e3) { function e(_x7) { return _e3.apply(this, arguments); } e.toString = function () { return _e3.toString(); }; return e; }(function (e) { didErr = true; err = e; }), f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
1260
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
1259
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function (_e2) { function e(_x8) { return _e2.apply(this, arguments); } e.toString = function () { return _e2.toString(); }; return e; }(function (e) { throw e; }), f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function (_e3) { function e(_x9) { return _e3.apply(this, arguments); } e.toString = function () { return _e3.toString(); }; return e; }(function (e) { didErr = true; err = e; }), f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
1261
1260
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1261
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
1262
1262
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
1263
1263
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
1264
1264
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -1303,9 +1303,15 @@ var File = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(functi
1303
1303
  fetchFuncAsync = props.fetchFuncAsync,
1304
1304
  fetchFuncMethod = props.fetchFuncMethod,
1305
1305
  fetchFuncMethodParams = props.fetchFuncMethodParams,
1306
+ formDataAppend = props.formDataAppend,
1306
1307
  onChange = props.onChange,
1307
1308
  onComplete = props.onComplete,
1308
1309
  onProgress = props.onProgress,
1310
+ enableChunkedUpload = props.enableChunkedUpload,
1311
+ _props$chunkSize = props.chunkSize,
1312
+ chunkSize = _props$chunkSize === void 0 ? 2 * 1024 * 1024 : _props$chunkSize,
1313
+ chunkDataAppend = props.chunkDataAppend,
1314
+ onChunkProgress = props.onChunkProgress,
1309
1315
  attributes = _objectWithoutProperties(props, _excluded);
1310
1316
  var uniqueID = funda_utils_dist_cjs_useComId__WEBPACK_IMPORTED_MODULE_1___default()();
1311
1317
  var idRes = id || uniqueID;
@@ -1358,35 +1364,38 @@ var File = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(functi
1358
1364
  return _fetchData.apply(this, arguments);
1359
1365
  }
1360
1366
  function _fetchData() {
1361
- _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params, data) {
1367
+ _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params, data) {
1362
1368
  var response;
1363
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1364
- while (1) switch (_context4.prev = _context4.next) {
1369
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1370
+ while (1) switch (_context5.prev = _context5.next) {
1365
1371
  case 0:
1366
1372
  if (!(_typeof(fetchFuncAsync) === 'object')) {
1367
- _context4.next = 7;
1373
+ _context5.next = 7;
1368
1374
  break;
1369
1375
  }
1370
- _context4.next = 3;
1376
+ _context5.next = 3;
1371
1377
  return fetchFuncAsync["".concat(fetchFuncMethod)].apply(fetchFuncAsync, _toConsumableArray(params.split(',')).concat([data]));
1372
1378
  case 3:
1373
- response = _context4.sent;
1374
- return _context4.abrupt("return", response.data);
1379
+ response = _context5.sent;
1380
+ return _context5.abrupt("return", response.data);
1375
1381
  case 7:
1376
- return _context4.abrupt("return", null);
1382
+ return _context5.abrupt("return", null);
1377
1383
  case 8:
1378
1384
  case "end":
1379
- return _context4.stop();
1385
+ return _context5.stop();
1380
1386
  }
1381
- }, _callee4);
1387
+ }, _callee5);
1382
1388
  }));
1383
1389
  return _fetchData.apply(this, arguments);
1384
1390
  }
1385
1391
  function fetchDataDefault(_x4) {
1386
1392
  return _fetchDataDefault.apply(this, arguments);
1387
1393
  }
1394
+ /**
1395
+ * Upload file in chunks
1396
+ */
1388
1397
  function _fetchDataDefault() {
1389
- _fetchDataDefault = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(url) {
1398
+ _fetchDataDefault = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(url) {
1390
1399
  var data,
1391
1400
  methord,
1392
1401
  res,
@@ -1394,52 +1403,146 @@ var File = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(functi
1394
1403
  rest,
1395
1404
  _key,
1396
1405
  response,
1397
- _args5 = arguments;
1398
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1399
- while (1) switch (_context5.prev = _context5.next) {
1406
+ _args6 = arguments;
1407
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1408
+ while (1) switch (_context6.prev = _context6.next) {
1400
1409
  case 0:
1401
- data = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
1402
- methord = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : 'GET';
1410
+ data = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
1411
+ methord = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : 'GET';
1403
1412
  res = {};
1404
1413
  if (!(typeof window === 'undefined')) {
1405
- _context5.next = 5;
1414
+ _context6.next = 5;
1406
1415
  break;
1407
1416
  }
1408
- return _context5.abrupt("return", res);
1417
+ return _context6.abrupt("return", res);
1409
1418
  case 5:
1410
- _context5.prev = 5;
1411
- for (_len = _args5.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
1412
- rest[_key - 3] = _args5[_key];
1419
+ _context6.prev = 5;
1420
+ for (_len = _args6.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
1421
+ rest[_key - 3] = _args6[_key];
1413
1422
  }
1414
- _context5.next = 9;
1415
- return fetch(url + '?' + new URLSearchParams(fetchParams), _objectSpread({
1423
+ _context6.next = 9;
1424
+ return fetch(typeof fetchParams !== 'undefined' ? url + '?' + new URLSearchParams(fetchParams) : url, _objectSpread({
1416
1425
  method: methord,
1417
1426
  body: data
1418
1427
  }, rest));
1419
1428
  case 9:
1420
- response = _context5.sent;
1421
- _context5.next = 12;
1429
+ response = _context6.sent;
1430
+ _context6.next = 12;
1422
1431
  return response.json();
1423
1432
  case 12:
1424
- res = _context5.sent;
1425
- _context5.next = 18;
1433
+ res = _context6.sent;
1434
+ _context6.next = 18;
1426
1435
  break;
1427
1436
  case 15:
1428
- _context5.prev = 15;
1429
- _context5.t0 = _context5["catch"](5);
1437
+ _context6.prev = 15;
1438
+ _context6.t0 = _context6["catch"](5);
1430
1439
  res = {
1431
- 'error': _context5.t0
1440
+ 'error': _context6.t0
1432
1441
  };
1433
1442
  case 18:
1434
- return _context5.abrupt("return", res);
1443
+ return _context6.abrupt("return", res);
1435
1444
  case 19:
1436
1445
  case "end":
1437
- return _context5.stop();
1446
+ return _context6.stop();
1438
1447
  }
1439
- }, _callee5, null, [[5, 15]]);
1448
+ }, _callee6, null, [[5, 15]]);
1440
1449
  }));
1441
1450
  return _fetchDataDefault.apply(this, arguments);
1442
1451
  }
1452
+ function uploadFileInChunks(_x5, _x6) {
1453
+ return _uploadFileInChunks.apply(this, arguments);
1454
+ }
1455
+ function _uploadFileInChunks() {
1456
+ _uploadFileInChunks = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(file, url) {
1457
+ var method,
1458
+ totalChunks,
1459
+ uploadId,
1460
+ uploadedBytes,
1461
+ _chunkIndex,
1462
+ start,
1463
+ end,
1464
+ _chunk,
1465
+ _formData2,
1466
+ response,
1467
+ _args7 = arguments;
1468
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1469
+ while (1) switch (_context7.prev = _context7.next) {
1470
+ case 0:
1471
+ method = _args7.length > 2 && _args7[2] !== undefined ? _args7[2] : 'POST';
1472
+ totalChunks = Math.ceil(file.size / chunkSize);
1473
+ uploadId = "".concat(Date.now(), "-").concat(Math.random().toString(36).substring(2, 11));
1474
+ uploadedBytes = 0; // Upload each chunk sequentially
1475
+ _chunkIndex = 0;
1476
+ case 5:
1477
+ if (!(_chunkIndex < totalChunks)) {
1478
+ _context7.next = 23;
1479
+ break;
1480
+ }
1481
+ start = _chunkIndex * chunkSize;
1482
+ end = Math.min(start + chunkSize, file.size);
1483
+ _chunk = file.slice(start, end);
1484
+ _formData2 = new FormData();
1485
+ if (chunkDataAppend) {
1486
+ // Use custom chunk data append function
1487
+ chunkDataAppend(_formData2, _chunk, _chunkIndex, totalChunks, file);
1488
+ } else {
1489
+ // Default chunk upload format
1490
+ _formData2.append('chunk', _chunk);
1491
+ _formData2.append('chunkIndex', _chunkIndex.toString());
1492
+ _formData2.append('totalChunks', totalChunks.toString());
1493
+ _formData2.append('uploadId', uploadId);
1494
+ _formData2.append('fileName', file.name);
1495
+ _formData2.append('fileSize', file.size.toString());
1496
+ _formData2.append('fileType', file.type);
1497
+ }
1498
+
1499
+ // Update progress
1500
+ uploadedBytes += end - start;
1501
+ onChunkProgress === null || onChunkProgress === void 0 ? void 0 : onChunkProgress(uploadedBytes, file.size, file, _chunkIndex, totalChunks);
1502
+
1503
+ // Upload chunk
1504
+ _context7.next = 15;
1505
+ return fetchDataDefault(url, _formData2, method, {
1506
+ headers: {
1507
+ 'Content-Type': 'multipart/form-data'
1508
+ }
1509
+ });
1510
+ case 15:
1511
+ response = _context7.sent;
1512
+ if (!response.error) {
1513
+ _context7.next = 18;
1514
+ break;
1515
+ }
1516
+ throw new Error("Chunk ".concat(_chunkIndex + 1, "/").concat(totalChunks, " upload failed: ").concat(response.error));
1517
+ case 18:
1518
+ if (!(response.code !== undefined && response.code !== 0 && response.code !== 200)) {
1519
+ _context7.next = 20;
1520
+ break;
1521
+ }
1522
+ throw new Error("Chunk ".concat(_chunkIndex + 1, "/").concat(totalChunks, " upload failed: ").concat(response.message || 'Unknown error'));
1523
+ case 20:
1524
+ _chunkIndex++;
1525
+ _context7.next = 5;
1526
+ break;
1527
+ case 23:
1528
+ return _context7.abrupt("return", {
1529
+ code: 0,
1530
+ message: 'Upload completed',
1531
+ data: {
1532
+ uploadId: uploadId,
1533
+ fileName: file.name,
1534
+ fileSize: file.size,
1535
+ totalChunks: totalChunks
1536
+ }
1537
+ });
1538
+ case 24:
1539
+ case "end":
1540
+ return _context7.stop();
1541
+ }
1542
+ }, _callee7);
1543
+ }));
1544
+ return _uploadFileInChunks.apply(this, arguments);
1545
+ }
1443
1546
  function handleLabelEnter(event) {
1444
1547
  event.currentTarget.getElementsByTagName('button')[0].className = labelHoverClassName ? labelHoverClassName : 'btn btn-primary';
1445
1548
  }
@@ -1455,80 +1558,136 @@ var File = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(functi
1455
1558
  //----------------------------------------------------------------
1456
1559
  if (interceptRequests === false) return;
1457
1560
  setProgressing(true);
1561
+
1562
+ // Use the default "fetch()" method to handle file references
1458
1563
  if (fetchUrl) {
1459
- var formData = new FormData();
1460
- formData.append('action', 'upload_plug_action');
1461
- for (var i = 0; i < curFiles.length; i++) {
1462
- formData.append("clientFiles", curFiles[i]);
1463
- }
1464
- fetchDataDefault(fetchUrl, formData, fetchMethod ? fetchMethod : 'POST', {
1465
- headers: {
1466
- 'Content-Type': 'multipart/form-data'
1564
+ // Check if chunked upload is enabled
1565
+ if (enableChunkedUpload) {
1566
+ // Upload files in chunks
1567
+ _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1568
+ var uploadPromises, i, _file, results, jsonData, errorResponse;
1569
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1570
+ while (1) switch (_context.prev = _context.next) {
1571
+ case 0:
1572
+ _context.prev = 0;
1573
+ uploadPromises = [];
1574
+ for (i = 0; i < curFiles.length; i++) {
1575
+ _file = curFiles[i];
1576
+ uploadPromises.push(uploadFileInChunks(_file, fetchUrl, fetchMethod ? fetchMethod : 'POST'));
1577
+ }
1578
+ _context.next = 5;
1579
+ return Promise.all(uploadPromises);
1580
+ case 5:
1581
+ results = _context.sent;
1582
+ // Combine results from all files
1583
+ jsonData = {
1584
+ code: 0,
1585
+ message: 'All files uploaded successfully',
1586
+ data: results
1587
+ };
1588
+ onComplete === null || onComplete === void 0 ? void 0 : onComplete(fileInputRef.current, submitRef.current, jsonData, incomingData);
1589
+ setProgressing(false);
1590
+ resetDefaultVal();
1591
+ _context.next = 17;
1592
+ break;
1593
+ case 12:
1594
+ _context.prev = 12;
1595
+ _context.t0 = _context["catch"](0);
1596
+ errorResponse = {
1597
+ code: -1,
1598
+ message: _context.t0.message || 'Upload failed',
1599
+ error: _context.t0
1600
+ };
1601
+ onComplete === null || onComplete === void 0 ? void 0 : onComplete(fileInputRef.current, submitRef.current, errorResponse, incomingData);
1602
+ setProgressing(false);
1603
+ case 17:
1604
+ case "end":
1605
+ return _context.stop();
1606
+ }
1607
+ }, _callee, null, [[0, 12]]);
1608
+ }))();
1609
+ } else {
1610
+ // Original non-chunked upload
1611
+ var _formData = new FormData();
1612
+ if (formDataAppend) {
1613
+ // Use custom formData.append function
1614
+ formDataAppend(_formData, curFiles);
1615
+ } else {
1616
+ // Default behavior
1617
+ _formData.append('action', 'upload_plug_action');
1618
+ for (var i = 0; i < curFiles.length; i++) {
1619
+ _formData.append("clientFiles", curFiles[i]);
1620
+ }
1467
1621
  }
1468
- }).then(function (response) {
1469
- var jsonData = response.data;
1470
- onComplete === null || onComplete === void 0 ? void 0 : onComplete(fileInputRef.current, submitRef.current, jsonData, incomingData);
1471
- setProgressing(false);
1622
+ fetchDataDefault(fetchUrl, _formData, fetchMethod ? fetchMethod : 'POST', {
1623
+ headers: {
1624
+ 'Content-Type': 'multipart/form-data'
1625
+ }
1626
+ }).then(function (response) {
1627
+ var jsonData = response;
1628
+ onComplete === null || onComplete === void 0 ? void 0 : onComplete(fileInputRef.current, submitRef.current, jsonData, incomingData);
1629
+ setProgressing(false);
1472
1630
 
1473
- // update default value
1474
- resetDefaultVal();
1475
- });
1631
+ // update default value
1632
+ resetDefaultVal();
1633
+ });
1634
+ }
1476
1635
  } else {
1477
1636
  if (_typeof(fetchFuncAsync) === 'object') {
1478
1637
  // Using custom request structure of class
1479
1638
  //----------------------------------------------------------------
1480
1639
  var streamToText = /*#__PURE__*/function () {
1481
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(blob) {
1640
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(blob) {
1482
1641
  var readableStream, chunk;
1483
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1484
- while (1) switch (_context.prev = _context.next) {
1642
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1643
+ while (1) switch (_context2.prev = _context2.next) {
1485
1644
  case 0:
1486
- _context.next = 2;
1645
+ _context2.next = 2;
1487
1646
  return blob.getReader();
1488
1647
  case 2:
1489
- readableStream = _context.sent;
1490
- _context.next = 5;
1648
+ readableStream = _context2.sent;
1649
+ _context2.next = 5;
1491
1650
  return readableStream.read();
1492
1651
  case 5:
1493
- chunk = _context.sent;
1494
- return _context.abrupt("return", new TextDecoder('utf-8').decode(chunk.value));
1652
+ chunk = _context2.sent;
1653
+ return _context2.abrupt("return", new TextDecoder('utf-8').decode(chunk.value));
1495
1654
  case 7:
1496
1655
  case "end":
1497
- return _context.stop();
1656
+ return _context2.stop();
1498
1657
  }
1499
- }, _callee);
1658
+ }, _callee2);
1500
1659
  }));
1501
- return function streamToText(_x5) {
1502
- return _ref.apply(this, arguments);
1660
+ return function streamToText(_x7) {
1661
+ return _ref2.apply(this, arguments);
1503
1662
  };
1504
1663
  }();
1505
- _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1506
- var allFiles, _i2, file, fileSliceBlob, fileSliceBlobStream;
1507
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1508
- while (1) switch (_context2.prev = _context2.next) {
1664
+ _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1665
+ var allFiles, _i2, _file2, fileSliceBlob, fileSliceBlobStream;
1666
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1667
+ while (1) switch (_context3.prev = _context3.next) {
1509
1668
  case 0:
1510
1669
  allFiles = [];
1511
1670
  _i2 = 0;
1512
1671
  case 2:
1513
1672
  if (!(_i2 < curFiles.length)) {
1514
- _context2.next = 16;
1673
+ _context3.next = 16;
1515
1674
  break;
1516
1675
  }
1517
- file = curFiles[_i2];
1518
- fileSliceBlob = file.slice(0, file.length);
1519
- _context2.next = 7;
1676
+ _file2 = curFiles[_i2];
1677
+ fileSliceBlob = _file2.slice(0, _file2.length);
1678
+ _context3.next = 7;
1520
1679
  return fileSliceBlob.stream();
1521
1680
  case 7:
1522
- fileSliceBlobStream = _context2.sent;
1523
- _context2.t0 = allFiles;
1524
- _context2.next = 11;
1681
+ fileSliceBlobStream = _context3.sent;
1682
+ _context3.t0 = allFiles;
1683
+ _context3.next = 11;
1525
1684
  return streamToText(fileSliceBlobStream);
1526
1685
  case 11:
1527
- _context2.t1 = _context2.sent;
1528
- _context2.t0.push.call(_context2.t0, _context2.t1);
1686
+ _context3.t1 = _context3.sent;
1687
+ _context3.t0.push.call(_context3.t0, _context3.t1);
1529
1688
  case 13:
1530
1689
  _i2++;
1531
- _context2.next = 2;
1690
+ _context3.next = 2;
1532
1691
  break;
1533
1692
  case 16:
1534
1693
  //send
@@ -1544,16 +1703,16 @@ var File = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(functi
1544
1703
  });
1545
1704
  case 17:
1546
1705
  case "end":
1547
- return _context2.stop();
1706
+ return _context3.stop();
1548
1707
  }
1549
- }, _callee2);
1708
+ }, _callee3);
1550
1709
  }))();
1551
1710
  } else {
1552
1711
  // Using ReadableStream
1553
1712
  //----------------------------------------------------------------
1554
- _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1555
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1556
- while (1) switch (_context3.prev = _context3.next) {
1713
+ _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
1714
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1715
+ while (1) switch (_context4.prev = _context4.next) {
1557
1716
  case 0:
1558
1717
  // setFilesData
1559
1718
  [].slice.call(curFiles).forEach(function (file) {
@@ -1595,9 +1754,9 @@ var File = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(functi
1595
1754
  });
1596
1755
  case 1:
1597
1756
  case "end":
1598
- return _context3.stop();
1757
+ return _context4.stop();
1599
1758
  }
1600
- }, _callee3);
1759
+ }, _callee4);
1601
1760
  }))();
1602
1761
  }
1603
1762
  }
@@ -1609,13 +1768,6 @@ var File = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(functi
1609
1768
  // update default value
1610
1769
  setDefaultValue(null);
1611
1770
 
1612
- //----
1613
- //remove focus style
1614
- if (val === '') {
1615
- var _rootRef$current;
1616
- (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.remove('focus');
1617
- }
1618
-
1619
1771
  //
1620
1772
  onChange === null || onChange === void 0 ? void 0 : onChange(fileInputRef.current, submitRef.current, fileInputRef.current.files);
1621
1773
 
@@ -1632,8 +1784,8 @@ var File = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(functi
1632
1784
  _step;
1633
1785
  try {
1634
1786
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
1635
- var file = _step.value;
1636
- messages = messages.concat(file.name);
1787
+ var _file3 = _step.value;
1788
+ messages = messages.concat(_file3.name);
1637
1789
  }
1638
1790
  } catch (err) {
1639
1791
  _iterator.e(err);
@@ -1244,9 +1244,6 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1244
1244
  }
1245
1245
  }
1246
1246
  function handleFocus(event) {
1247
- var _rootRef$current;
1248
- (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.classList.add('focus');
1249
-
1250
1247
  //
1251
1248
  if (valRef.current) {
1252
1249
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, onComposition, valRef.current);
@@ -1255,13 +1252,6 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1255
1252
  function handleChange(event, curVal) {
1256
1253
  setChangedVal(curVal);
1257
1254
 
1258
- //----
1259
- //remove focus style
1260
- if (curVal === '') {
1261
- var _rootRef$current2;
1262
- (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.classList.remove('focus');
1263
- }
1264
-
1265
1255
  //
1266
1256
  if (valRef.current) {
1267
1257
  onChange === null || onChange === void 0 ? void 0 : onChange(event, onComposition, valRef.current, curVal);
@@ -1278,13 +1268,6 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1278
1268
  var el = event.target;
1279
1269
  var val = event.target.value;
1280
1270
 
1281
- //----
1282
- //remove focus style
1283
- if (val === '') {
1284
- var _rootRef$current3;
1285
- (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.classList.remove('focus');
1286
- }
1287
-
1288
1271
  //
1289
1272
  if (valRef.current) {
1290
1273
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event, onComposition, valRef.current);
@@ -1382,7 +1365,9 @@ var Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
1382
1365
  }
1383
1366
  }, []);
1384
1367
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1385
- className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(wrapperClassName, 'mb-3 position-relative'),
1368
+ className: (0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)((0,funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(wrapperClassName, 'mb-3 position-relative'), {
1369
+ 'focus-floating': changedVal !== ''
1370
+ }),
1386
1371
  ref: rootRef
1387
1372
  }, label ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, typeof label === 'string' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
1388
1373
  htmlFor: idRes,