@ornikar/kitt-universal 32.5.1 → 32.5.2

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.
@@ -6372,15 +6372,16 @@ var DatePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
6372
6372
  });
6373
6373
 
6374
6374
  function DocumentPicker(_ref) {
6375
- var onDocumentUpload = _ref.onDocumentUpload,
6376
- children = _ref.children,
6375
+ var children = _ref.children,
6377
6376
  disabled = _ref.disabled,
6378
- documentPickerOptions = _ref.documentPickerOptions;
6377
+ documentPickerOptions = _ref.documentPickerOptions,
6378
+ onDocumentUpload = _ref.onDocumentUpload,
6379
+ onGetDocumentAsyncError = _ref.onGetDocumentAsyncError;
6379
6380
  var childElement = Children.only(children);
6380
6381
  var handlePickDocument = /*#__PURE__*/function () {
6381
6382
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
6382
- var _childElement$props$o, _childElement$props, _result$assets$;
6383
- var result;
6383
+ var _childElement$props$o, _childElement$props, _result$assets;
6384
+ var result, file;
6384
6385
  return _regeneratorRuntime().wrap(function (_context) {
6385
6386
  while (1) switch (_context.prev = _context.next) {
6386
6387
  case 0:
@@ -6391,20 +6392,33 @@ function DocumentPicker(_ref) {
6391
6392
  return _context.abrupt("return");
6392
6393
  case 2:
6393
6394
  (_childElement$props$o = (_childElement$props = childElement.props).onPress) === null || _childElement$props$o === void 0 || _childElement$props$o.call(_childElement$props);
6394
- _context.next = 5;
6395
+ _context.prev = 3;
6396
+ _context.next = 6;
6395
6397
  return getDocumentAsync(_objectSpread(_objectSpread({}, documentPickerOptions), {}, {
6396
6398
  multiple: false
6397
6399
  }));
6398
- case 5:
6400
+ case 6:
6399
6401
  result = _context.sent;
6400
- if (!result.canceled && (_result$assets$ = result.assets[0]) !== null && _result$assets$ !== void 0 && _result$assets$.file) {
6401
- onDocumentUpload(result.assets[0].file);
6402
+ _context.next = 13;
6403
+ break;
6404
+ case 9:
6405
+ _context.prev = 9;
6406
+ _context.t0 = _context["catch"](3);
6407
+ onGetDocumentAsyncError === null || onGetDocumentAsyncError === void 0 || onGetDocumentAsyncError();
6408
+ result = {
6409
+ canceled: true,
6410
+ assets: null
6411
+ };
6412
+ case 13:
6413
+ file = (_result$assets = result.assets) === null || _result$assets === void 0 || (_result$assets = _result$assets.at(0)) === null || _result$assets === void 0 ? void 0 : _result$assets.file;
6414
+ if (!result.canceled && file) {
6415
+ onDocumentUpload(file);
6402
6416
  }
6403
- case 7:
6417
+ case 15:
6404
6418
  case "end":
6405
6419
  return _context.stop();
6406
6420
  }
6407
- }, _callee);
6421
+ }, _callee, null, [[3, 9]]);
6408
6422
  }));
6409
6423
  return function () {
6410
6424
  return _ref2.apply(this, arguments);