@plasmicpkgs/plasmic-rich-components 1.0.43 → 1.0.45

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.
@@ -12,9 +12,39 @@ var icons = require('@ant-design/icons');
12
12
  var proComponents = require('@ant-design/pro-components');
13
13
  var antd = require('antd');
14
14
  var host = require('@plasmicapp/host');
15
- var sync = require('csv-stringify/sync');
15
+ var csvWriterBrowser = require('csv-writer-browser');
16
16
  var fastStringify = _interopDefault(require('fast-stringify'));
17
17
 
18
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
19
+ try {
20
+ var info = gen[key](arg);
21
+ var value = info.value;
22
+ } catch (error) {
23
+ reject(error);
24
+ return;
25
+ }
26
+ if (info.done) {
27
+ resolve(value);
28
+ } else {
29
+ Promise.resolve(value).then(_next, _throw);
30
+ }
31
+ }
32
+ function _asyncToGenerator(fn) {
33
+ return function () {
34
+ var self = this,
35
+ args = arguments;
36
+ return new Promise(function (resolve, reject) {
37
+ var gen = fn.apply(self, args);
38
+ function _next(value) {
39
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
40
+ }
41
+ function _throw(err) {
42
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
43
+ }
44
+ _next(undefined);
45
+ });
46
+ };
47
+ }
18
48
  function _extends() {
19
49
  _extends = Object.assign ? Object.assign.bind() : function (target) {
20
50
  for (var i = 1; i < arguments.length; i++) {
@@ -341,6 +371,664 @@ function registerRichLayout(loader) {
341
371
  registerComponentHelper(loader, RichLayout, richLayoutMeta);
342
372
  }
343
373
 
374
+ function createCommonjsModule(fn, module) {
375
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
376
+ }
377
+
378
+ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
379
+ /**
380
+ * Copyright (c) 2014-present, Facebook, Inc.
381
+ *
382
+ * This source code is licensed under the MIT license found in the
383
+ * LICENSE file in the root directory of this source tree.
384
+ */
385
+
386
+ var runtime = function (exports) {
387
+
388
+ var Op = Object.prototype;
389
+ var hasOwn = Op.hasOwnProperty;
390
+ var undefined$1; // More compressible than void 0.
391
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
392
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
393
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
394
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
395
+ function define(obj, key, value) {
396
+ Object.defineProperty(obj, key, {
397
+ value: value,
398
+ enumerable: true,
399
+ configurable: true,
400
+ writable: true
401
+ });
402
+ return obj[key];
403
+ }
404
+ try {
405
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
406
+ define({}, "");
407
+ } catch (err) {
408
+ define = function define(obj, key, value) {
409
+ return obj[key] = value;
410
+ };
411
+ }
412
+ function wrap(innerFn, outerFn, self, tryLocsList) {
413
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
414
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
415
+ var generator = Object.create(protoGenerator.prototype);
416
+ var context = new Context(tryLocsList || []);
417
+
418
+ // The ._invoke method unifies the implementations of the .next,
419
+ // .throw, and .return methods.
420
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
421
+ return generator;
422
+ }
423
+ exports.wrap = wrap;
424
+
425
+ // Try/catch helper to minimize deoptimizations. Returns a completion
426
+ // record like context.tryEntries[i].completion. This interface could
427
+ // have been (and was previously) designed to take a closure to be
428
+ // invoked without arguments, but in all the cases we care about we
429
+ // already have an existing method we want to call, so there's no need
430
+ // to create a new function object. We can even get away with assuming
431
+ // the method takes exactly one argument, since that happens to be true
432
+ // in every case, so we don't have to touch the arguments object. The
433
+ // only additional allocation required is the completion record, which
434
+ // has a stable shape and so hopefully should be cheap to allocate.
435
+ function tryCatch(fn, obj, arg) {
436
+ try {
437
+ return {
438
+ type: "normal",
439
+ arg: fn.call(obj, arg)
440
+ };
441
+ } catch (err) {
442
+ return {
443
+ type: "throw",
444
+ arg: err
445
+ };
446
+ }
447
+ }
448
+ var GenStateSuspendedStart = "suspendedStart";
449
+ var GenStateSuspendedYield = "suspendedYield";
450
+ var GenStateExecuting = "executing";
451
+ var GenStateCompleted = "completed";
452
+
453
+ // Returning this object from the innerFn has the same effect as
454
+ // breaking out of the dispatch switch statement.
455
+ var ContinueSentinel = {};
456
+
457
+ // Dummy constructor functions that we use as the .constructor and
458
+ // .constructor.prototype properties for functions that return Generator
459
+ // objects. For full spec compliance, you may wish to configure your
460
+ // minifier not to mangle the names of these two functions.
461
+ function Generator() {}
462
+ function GeneratorFunction() {}
463
+ function GeneratorFunctionPrototype() {}
464
+
465
+ // This is a polyfill for %IteratorPrototype% for environments that
466
+ // don't natively support it.
467
+ var IteratorPrototype = {};
468
+ define(IteratorPrototype, iteratorSymbol, function () {
469
+ return this;
470
+ });
471
+ var getProto = Object.getPrototypeOf;
472
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
473
+ if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
474
+ // This environment has a native %IteratorPrototype%; use it instead
475
+ // of the polyfill.
476
+ IteratorPrototype = NativeIteratorPrototype;
477
+ }
478
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
479
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
480
+ define(Gp, "constructor", GeneratorFunctionPrototype);
481
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
482
+ GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
483
+
484
+ // Helper for defining the .next, .throw, and .return methods of the
485
+ // Iterator interface in terms of a single ._invoke method.
486
+ function defineIteratorMethods(prototype) {
487
+ ["next", "throw", "return"].forEach(function (method) {
488
+ define(prototype, method, function (arg) {
489
+ return this._invoke(method, arg);
490
+ });
491
+ });
492
+ }
493
+ exports.isGeneratorFunction = function (genFun) {
494
+ var ctor = typeof genFun === "function" && genFun.constructor;
495
+ return ctor ? ctor === GeneratorFunction ||
496
+ // For the native GeneratorFunction constructor, the best we can
497
+ // do is to check its .name property.
498
+ (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
499
+ };
500
+ exports.mark = function (genFun) {
501
+ if (Object.setPrototypeOf) {
502
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
503
+ } else {
504
+ genFun.__proto__ = GeneratorFunctionPrototype;
505
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
506
+ }
507
+ genFun.prototype = Object.create(Gp);
508
+ return genFun;
509
+ };
510
+
511
+ // Within the body of any async function, `await x` is transformed to
512
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
513
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
514
+ // meant to be awaited.
515
+ exports.awrap = function (arg) {
516
+ return {
517
+ __await: arg
518
+ };
519
+ };
520
+ function AsyncIterator(generator, PromiseImpl) {
521
+ function invoke(method, arg, resolve, reject) {
522
+ var record = tryCatch(generator[method], generator, arg);
523
+ if (record.type === "throw") {
524
+ reject(record.arg);
525
+ } else {
526
+ var result = record.arg;
527
+ var value = result.value;
528
+ if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
529
+ return PromiseImpl.resolve(value.__await).then(function (value) {
530
+ invoke("next", value, resolve, reject);
531
+ }, function (err) {
532
+ invoke("throw", err, resolve, reject);
533
+ });
534
+ }
535
+ return PromiseImpl.resolve(value).then(function (unwrapped) {
536
+ // When a yielded Promise is resolved, its final value becomes
537
+ // the .value of the Promise<{value,done}> result for the
538
+ // current iteration.
539
+ result.value = unwrapped;
540
+ resolve(result);
541
+ }, function (error) {
542
+ // If a rejected Promise was yielded, throw the rejection back
543
+ // into the async generator function so it can be handled there.
544
+ return invoke("throw", error, resolve, reject);
545
+ });
546
+ }
547
+ }
548
+ var previousPromise;
549
+ function enqueue(method, arg) {
550
+ function callInvokeWithMethodAndArg() {
551
+ return new PromiseImpl(function (resolve, reject) {
552
+ invoke(method, arg, resolve, reject);
553
+ });
554
+ }
555
+ return previousPromise =
556
+ // If enqueue has been called before, then we want to wait until
557
+ // all previous Promises have been resolved before calling invoke,
558
+ // so that results are always delivered in the correct order. If
559
+ // enqueue has not been called before, then it is important to
560
+ // call invoke immediately, without waiting on a callback to fire,
561
+ // so that the async generator function has the opportunity to do
562
+ // any necessary setup in a predictable way. This predictability
563
+ // is why the Promise constructor synchronously invokes its
564
+ // executor callback, and why async functions synchronously
565
+ // execute code before the first await. Since we implement simple
566
+ // async functions in terms of async generators, it is especially
567
+ // important to get this right, even though it requires care.
568
+ previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
569
+ // Avoid propagating failures to Promises returned by later
570
+ // invocations of the iterator.
571
+ callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
572
+ }
573
+
574
+ // Define the unified helper method that is used to implement .next,
575
+ // .throw, and .return (see defineIteratorMethods).
576
+ this._invoke = enqueue;
577
+ }
578
+ defineIteratorMethods(AsyncIterator.prototype);
579
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
580
+ return this;
581
+ });
582
+ exports.AsyncIterator = AsyncIterator;
583
+
584
+ // Note that simple async functions are implemented on top of
585
+ // AsyncIterator objects; they just return a Promise for the value of
586
+ // the final result produced by the iterator.
587
+ exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
588
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
589
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
590
+ return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
591
+ : iter.next().then(function (result) {
592
+ return result.done ? result.value : iter.next();
593
+ });
594
+ };
595
+ function makeInvokeMethod(innerFn, self, context) {
596
+ var state = GenStateSuspendedStart;
597
+ return function invoke(method, arg) {
598
+ if (state === GenStateExecuting) {
599
+ throw new Error("Generator is already running");
600
+ }
601
+ if (state === GenStateCompleted) {
602
+ if (method === "throw") {
603
+ throw arg;
604
+ }
605
+
606
+ // Be forgiving, per 25.3.3.3.3 of the spec:
607
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
608
+ return doneResult();
609
+ }
610
+ context.method = method;
611
+ context.arg = arg;
612
+ while (true) {
613
+ var delegate = context.delegate;
614
+ if (delegate) {
615
+ var delegateResult = maybeInvokeDelegate(delegate, context);
616
+ if (delegateResult) {
617
+ if (delegateResult === ContinueSentinel) continue;
618
+ return delegateResult;
619
+ }
620
+ }
621
+ if (context.method === "next") {
622
+ // Setting context._sent for legacy support of Babel's
623
+ // function.sent implementation.
624
+ context.sent = context._sent = context.arg;
625
+ } else if (context.method === "throw") {
626
+ if (state === GenStateSuspendedStart) {
627
+ state = GenStateCompleted;
628
+ throw context.arg;
629
+ }
630
+ context.dispatchException(context.arg);
631
+ } else if (context.method === "return") {
632
+ context.abrupt("return", context.arg);
633
+ }
634
+ state = GenStateExecuting;
635
+ var record = tryCatch(innerFn, self, context);
636
+ if (record.type === "normal") {
637
+ // If an exception is thrown from innerFn, we leave state ===
638
+ // GenStateExecuting and loop back for another invocation.
639
+ state = context.done ? GenStateCompleted : GenStateSuspendedYield;
640
+ if (record.arg === ContinueSentinel) {
641
+ continue;
642
+ }
643
+ return {
644
+ value: record.arg,
645
+ done: context.done
646
+ };
647
+ } else if (record.type === "throw") {
648
+ state = GenStateCompleted;
649
+ // Dispatch the exception by looping back around to the
650
+ // context.dispatchException(context.arg) call above.
651
+ context.method = "throw";
652
+ context.arg = record.arg;
653
+ }
654
+ }
655
+ };
656
+ }
657
+
658
+ // Call delegate.iterator[context.method](context.arg) and handle the
659
+ // result, either by returning a { value, done } result from the
660
+ // delegate iterator, or by modifying context.method and context.arg,
661
+ // setting context.delegate to null, and returning the ContinueSentinel.
662
+ function maybeInvokeDelegate(delegate, context) {
663
+ var method = delegate.iterator[context.method];
664
+ if (method === undefined$1) {
665
+ // A .throw or .return when the delegate iterator has no .throw
666
+ // method always terminates the yield* loop.
667
+ context.delegate = null;
668
+ if (context.method === "throw") {
669
+ // Note: ["return"] must be used for ES3 parsing compatibility.
670
+ if (delegate.iterator["return"]) {
671
+ // If the delegate iterator has a return method, give it a
672
+ // chance to clean up.
673
+ context.method = "return";
674
+ context.arg = undefined$1;
675
+ maybeInvokeDelegate(delegate, context);
676
+ if (context.method === "throw") {
677
+ // If maybeInvokeDelegate(context) changed context.method from
678
+ // "return" to "throw", let that override the TypeError below.
679
+ return ContinueSentinel;
680
+ }
681
+ }
682
+ context.method = "throw";
683
+ context.arg = new TypeError("The iterator does not provide a 'throw' method");
684
+ }
685
+ return ContinueSentinel;
686
+ }
687
+ var record = tryCatch(method, delegate.iterator, context.arg);
688
+ if (record.type === "throw") {
689
+ context.method = "throw";
690
+ context.arg = record.arg;
691
+ context.delegate = null;
692
+ return ContinueSentinel;
693
+ }
694
+ var info = record.arg;
695
+ if (!info) {
696
+ context.method = "throw";
697
+ context.arg = new TypeError("iterator result is not an object");
698
+ context.delegate = null;
699
+ return ContinueSentinel;
700
+ }
701
+ if (info.done) {
702
+ // Assign the result of the finished delegate to the temporary
703
+ // variable specified by delegate.resultName (see delegateYield).
704
+ context[delegate.resultName] = info.value;
705
+
706
+ // Resume execution at the desired location (see delegateYield).
707
+ context.next = delegate.nextLoc;
708
+
709
+ // If context.method was "throw" but the delegate handled the
710
+ // exception, let the outer generator proceed normally. If
711
+ // context.method was "next", forget context.arg since it has been
712
+ // "consumed" by the delegate iterator. If context.method was
713
+ // "return", allow the original .return call to continue in the
714
+ // outer generator.
715
+ if (context.method !== "return") {
716
+ context.method = "next";
717
+ context.arg = undefined$1;
718
+ }
719
+ } else {
720
+ // Re-yield the result returned by the delegate method.
721
+ return info;
722
+ }
723
+
724
+ // The delegate iterator is finished, so forget it and continue with
725
+ // the outer generator.
726
+ context.delegate = null;
727
+ return ContinueSentinel;
728
+ }
729
+
730
+ // Define Generator.prototype.{next,throw,return} in terms of the
731
+ // unified ._invoke helper method.
732
+ defineIteratorMethods(Gp);
733
+ define(Gp, toStringTagSymbol, "Generator");
734
+
735
+ // A Generator should always return itself as the iterator object when the
736
+ // @@iterator function is called on it. Some browsers' implementations of the
737
+ // iterator prototype chain incorrectly implement this, causing the Generator
738
+ // object to not be returned from this call. This ensures that doesn't happen.
739
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
740
+ define(Gp, iteratorSymbol, function () {
741
+ return this;
742
+ });
743
+ define(Gp, "toString", function () {
744
+ return "[object Generator]";
745
+ });
746
+ function pushTryEntry(locs) {
747
+ var entry = {
748
+ tryLoc: locs[0]
749
+ };
750
+ if (1 in locs) {
751
+ entry.catchLoc = locs[1];
752
+ }
753
+ if (2 in locs) {
754
+ entry.finallyLoc = locs[2];
755
+ entry.afterLoc = locs[3];
756
+ }
757
+ this.tryEntries.push(entry);
758
+ }
759
+ function resetTryEntry(entry) {
760
+ var record = entry.completion || {};
761
+ record.type = "normal";
762
+ delete record.arg;
763
+ entry.completion = record;
764
+ }
765
+ function Context(tryLocsList) {
766
+ // The root entry object (effectively a try statement without a catch
767
+ // or a finally block) gives us a place to store values thrown from
768
+ // locations where there is no enclosing try statement.
769
+ this.tryEntries = [{
770
+ tryLoc: "root"
771
+ }];
772
+ tryLocsList.forEach(pushTryEntry, this);
773
+ this.reset(true);
774
+ }
775
+ exports.keys = function (object) {
776
+ var keys = [];
777
+ for (var key in object) {
778
+ keys.push(key);
779
+ }
780
+ keys.reverse();
781
+
782
+ // Rather than returning an object with a next method, we keep
783
+ // things simple and return the next function itself.
784
+ return function next() {
785
+ while (keys.length) {
786
+ var key = keys.pop();
787
+ if (key in object) {
788
+ next.value = key;
789
+ next.done = false;
790
+ return next;
791
+ }
792
+ }
793
+
794
+ // To avoid creating an additional object, we just hang the .value
795
+ // and .done properties off the next function object itself. This
796
+ // also ensures that the minifier will not anonymize the function.
797
+ next.done = true;
798
+ return next;
799
+ };
800
+ };
801
+ function values(iterable) {
802
+ if (iterable) {
803
+ var iteratorMethod = iterable[iteratorSymbol];
804
+ if (iteratorMethod) {
805
+ return iteratorMethod.call(iterable);
806
+ }
807
+ if (typeof iterable.next === "function") {
808
+ return iterable;
809
+ }
810
+ if (!isNaN(iterable.length)) {
811
+ var i = -1,
812
+ next = function next() {
813
+ while (++i < iterable.length) {
814
+ if (hasOwn.call(iterable, i)) {
815
+ next.value = iterable[i];
816
+ next.done = false;
817
+ return next;
818
+ }
819
+ }
820
+ next.value = undefined$1;
821
+ next.done = true;
822
+ return next;
823
+ };
824
+ return next.next = next;
825
+ }
826
+ }
827
+
828
+ // Return an iterator with no values.
829
+ return {
830
+ next: doneResult
831
+ };
832
+ }
833
+ exports.values = values;
834
+ function doneResult() {
835
+ return {
836
+ value: undefined$1,
837
+ done: true
838
+ };
839
+ }
840
+ Context.prototype = {
841
+ constructor: Context,
842
+ reset: function reset(skipTempReset) {
843
+ this.prev = 0;
844
+ this.next = 0;
845
+ // Resetting context._sent for legacy support of Babel's
846
+ // function.sent implementation.
847
+ this.sent = this._sent = undefined$1;
848
+ this.done = false;
849
+ this.delegate = null;
850
+ this.method = "next";
851
+ this.arg = undefined$1;
852
+ this.tryEntries.forEach(resetTryEntry);
853
+ if (!skipTempReset) {
854
+ for (var name in this) {
855
+ // Not sure about the optimal order of these conditions:
856
+ if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
857
+ this[name] = undefined$1;
858
+ }
859
+ }
860
+ }
861
+ },
862
+ stop: function stop() {
863
+ this.done = true;
864
+ var rootEntry = this.tryEntries[0];
865
+ var rootRecord = rootEntry.completion;
866
+ if (rootRecord.type === "throw") {
867
+ throw rootRecord.arg;
868
+ }
869
+ return this.rval;
870
+ },
871
+ dispatchException: function dispatchException(exception) {
872
+ if (this.done) {
873
+ throw exception;
874
+ }
875
+ var context = this;
876
+ function handle(loc, caught) {
877
+ record.type = "throw";
878
+ record.arg = exception;
879
+ context.next = loc;
880
+ if (caught) {
881
+ // If the dispatched exception was caught by a catch block,
882
+ // then let that catch block handle the exception normally.
883
+ context.method = "next";
884
+ context.arg = undefined$1;
885
+ }
886
+ return !!caught;
887
+ }
888
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
889
+ var entry = this.tryEntries[i];
890
+ var record = entry.completion;
891
+ if (entry.tryLoc === "root") {
892
+ // Exception thrown outside of any try block that could handle
893
+ // it, so set the completion value of the entire function to
894
+ // throw the exception.
895
+ return handle("end");
896
+ }
897
+ if (entry.tryLoc <= this.prev) {
898
+ var hasCatch = hasOwn.call(entry, "catchLoc");
899
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
900
+ if (hasCatch && hasFinally) {
901
+ if (this.prev < entry.catchLoc) {
902
+ return handle(entry.catchLoc, true);
903
+ } else if (this.prev < entry.finallyLoc) {
904
+ return handle(entry.finallyLoc);
905
+ }
906
+ } else if (hasCatch) {
907
+ if (this.prev < entry.catchLoc) {
908
+ return handle(entry.catchLoc, true);
909
+ }
910
+ } else if (hasFinally) {
911
+ if (this.prev < entry.finallyLoc) {
912
+ return handle(entry.finallyLoc);
913
+ }
914
+ } else {
915
+ throw new Error("try statement without catch or finally");
916
+ }
917
+ }
918
+ }
919
+ },
920
+ abrupt: function abrupt(type, arg) {
921
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
922
+ var entry = this.tryEntries[i];
923
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
924
+ var finallyEntry = entry;
925
+ break;
926
+ }
927
+ }
928
+ if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
929
+ // Ignore the finally entry if control is not jumping to a
930
+ // location outside the try/catch block.
931
+ finallyEntry = null;
932
+ }
933
+ var record = finallyEntry ? finallyEntry.completion : {};
934
+ record.type = type;
935
+ record.arg = arg;
936
+ if (finallyEntry) {
937
+ this.method = "next";
938
+ this.next = finallyEntry.finallyLoc;
939
+ return ContinueSentinel;
940
+ }
941
+ return this.complete(record);
942
+ },
943
+ complete: function complete(record, afterLoc) {
944
+ if (record.type === "throw") {
945
+ throw record.arg;
946
+ }
947
+ if (record.type === "break" || record.type === "continue") {
948
+ this.next = record.arg;
949
+ } else if (record.type === "return") {
950
+ this.rval = this.arg = record.arg;
951
+ this.method = "return";
952
+ this.next = "end";
953
+ } else if (record.type === "normal" && afterLoc) {
954
+ this.next = afterLoc;
955
+ }
956
+ return ContinueSentinel;
957
+ },
958
+ finish: function finish(finallyLoc) {
959
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
960
+ var entry = this.tryEntries[i];
961
+ if (entry.finallyLoc === finallyLoc) {
962
+ this.complete(entry.completion, entry.afterLoc);
963
+ resetTryEntry(entry);
964
+ return ContinueSentinel;
965
+ }
966
+ }
967
+ },
968
+ "catch": function _catch(tryLoc) {
969
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
970
+ var entry = this.tryEntries[i];
971
+ if (entry.tryLoc === tryLoc) {
972
+ var record = entry.completion;
973
+ if (record.type === "throw") {
974
+ var thrown = record.arg;
975
+ resetTryEntry(entry);
976
+ }
977
+ return thrown;
978
+ }
979
+ }
980
+
981
+ // The context.catch method must only be called with a location
982
+ // argument that corresponds to a known catch block.
983
+ throw new Error("illegal catch attempt");
984
+ },
985
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
986
+ this.delegate = {
987
+ iterator: values(iterable),
988
+ resultName: resultName,
989
+ nextLoc: nextLoc
990
+ };
991
+ if (this.method === "next") {
992
+ // Deliberately forget the last sent value so that we don't
993
+ // accidentally pass it on to the delegate.
994
+ this.arg = undefined$1;
995
+ }
996
+ return ContinueSentinel;
997
+ }
998
+ };
999
+
1000
+ // Regardless of whether this script is executing as a CommonJS module
1001
+ // or not, return the runtime object so that we can declare the variable
1002
+ // regeneratorRuntime in the outer scope, which allows this module to be
1003
+ // injected easily by `bin/regenerator --include-runtime script.js`.
1004
+ return exports;
1005
+ }(
1006
+ // If this script is executing as a CommonJS module, use module.exports
1007
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
1008
+ // object. Either way, the resulting object will be used to initialize
1009
+ // the regeneratorRuntime variable at the top of this file.
1010
+ module.exports );
1011
+ try {
1012
+ regeneratorRuntime = runtime;
1013
+ } catch (accidentalStrictMode) {
1014
+ // This module should not be running in strict mode, so the above
1015
+ // assignment should always work unless something is misconfigured. Just
1016
+ // in case runtime.js accidentally runs in strict mode, in modern engines
1017
+ // we can explicitly access globalThis. In older engines we can escape
1018
+ // strict mode using a global Function call. This could conceivably fail
1019
+ // if a Content Security Policy forbids using Function, but in that case
1020
+ // the proper solution is to fix the accidental strict mode problem. If
1021
+ // you've misconfigured your bundler to force strict mode and applied a
1022
+ // CSP to forbid Function, and you're not willing to fix either of those
1023
+ // problems, please detail your unique predicament in a GitHub issue.
1024
+ if (typeof globalThis === "object") {
1025
+ globalThis.regeneratorRuntime = runtime;
1026
+ } else {
1027
+ Function("r", "regeneratorRuntime = r")(runtime);
1028
+ }
1029
+ }
1030
+ });
1031
+
344
1032
  var tuple = function tuple() {
345
1033
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
346
1034
  args[_key] = arguments[_key];
@@ -694,36 +1382,59 @@ function RichTable(props) {
694
1382
  items: [{
695
1383
  label: "Download as CSV",
696
1384
  key: "csv",
697
- onClick: function onClick() {
698
- var _tryGetSchema$fields$, _tryGetSchema;
699
- var dataStr = sync.stringify(data == null ? void 0 : data.data, {
700
- columns: (_tryGetSchema$fields$ = (_tryGetSchema = tryGetSchema(data)) == null ? void 0 : _tryGetSchema.fields.map(function (f) {
701
- return f.id;
702
- })) != null ? _tryGetSchema$fields$ : [],
703
- header: true
704
- });
705
- var filename = "data.csv";
706
- // Adapted from https://stackoverflow.com/a/68771795
707
- var blob = new Blob([dataStr], {
708
- type: "text/csv;charset=utf-8;"
709
- });
710
- if (navigator.msSaveBlob) {
711
- // In case of IE 10+
712
- navigator.msSaveBlob(blob, filename);
713
- } else {
714
- var link = document.createElement("a");
715
- if (link.download !== undefined) {
716
- // Browsers that support HTML5 download attribute
717
- var url = URL.createObjectURL(blob);
718
- link.setAttribute("href", url);
719
- link.setAttribute("download", filename);
720
- link.style.visibility = "hidden";
721
- document.body.appendChild(link);
722
- link.click();
723
- document.body.removeChild(link);
724
- }
1385
+ onClick: function () {
1386
+ var _onClick = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
1387
+ var _tryGetSchema$fields$, _tryGetSchema;
1388
+ var writer, dataStr, filename, blob, link, url;
1389
+ return runtime_1.wrap(function _callee$(_context) {
1390
+ while (1) {
1391
+ switch (_context.prev = _context.next) {
1392
+ case 0:
1393
+ writer = csvWriterBrowser.createObjectCsvStringifier({
1394
+ header: (_tryGetSchema$fields$ = (_tryGetSchema = tryGetSchema(data)) == null ? void 0 : _tryGetSchema.fields.map(function (f) {
1395
+ return {
1396
+ id: f.id,
1397
+ title: f.id
1398
+ };
1399
+ })) != null ? _tryGetSchema$fields$ : []
1400
+ });
1401
+ dataStr = writer.getHeaderString() + writer.stringifyRecords(data == null ? void 0 : data.data); // const dataStr = stringify(data?.data as any, {
1402
+ // columns:
1403
+ // tryGetSchema(data)?.fields.map((f) => f.id) ?? [],
1404
+ // header: true,
1405
+ // });
1406
+ filename = "data.csv"; // Adapted from https://stackoverflow.com/a/68771795
1407
+ blob = new Blob([dataStr], {
1408
+ type: "text/csv;charset=utf-8;"
1409
+ });
1410
+ if (navigator.msSaveBlob) {
1411
+ // In case of IE 10+
1412
+ navigator.msSaveBlob(blob, filename);
1413
+ } else {
1414
+ link = document.createElement("a");
1415
+ if (link.download !== undefined) {
1416
+ // Browsers that support HTML5 download attribute
1417
+ url = URL.createObjectURL(blob);
1418
+ link.setAttribute("href", url);
1419
+ link.setAttribute("download", filename);
1420
+ link.style.visibility = "hidden";
1421
+ document.body.appendChild(link);
1422
+ link.click();
1423
+ document.body.removeChild(link);
1424
+ }
1425
+ }
1426
+ case 5:
1427
+ case "end":
1428
+ return _context.stop();
1429
+ }
1430
+ }
1431
+ }, _callee);
1432
+ }));
1433
+ function onClick() {
1434
+ return _onClick.apply(this, arguments);
725
1435
  }
726
- }
1436
+ return onClick;
1437
+ }()
727
1438
  }, {
728
1439
  label: "Download as JSON",
729
1440
  key: "json",