@usecsv/react 0.1.0 → 0.2.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/build/index.cjs +61 -10
  3. package/build/index.cjs.map +1 -1
  4. package/build/index.esm.js +61 -10
  5. package/build/index.esm.js.map +1 -1
  6. package/build/index.js +61 -10
  7. package/build/index.js.map +1 -1
  8. package/build/index.mjs +61 -10
  9. package/build/index.mjs.map +1 -1
  10. package/build/index.umd.js +61 -10
  11. package/build/index.umd.js.map +1 -1
  12. package/build/index.umd.min.js +33 -4
  13. package/build/index.umd.min.js.map +1 -1
  14. package/build/types/lib/useCsvReactPlugin.d.ts +3 -7
  15. package/build/types/lib/useCsvReactPlugin.d.ts.map +1 -1
  16. package/package.json +4 -4
  17. package/.babelrc.jest.js +0 -14
  18. package/.editorconfig +0 -15
  19. package/.env +0 -0
  20. package/.env.example +0 -1
  21. package/.eslintignore +0 -1
  22. package/.eslintrc.airbnbts.js +0 -73
  23. package/.eslintrc.json +0 -91
  24. package/.github/PULL_REQUEST_TEMPLATE.md +0 -7
  25. package/.github/dependabot.yml +0 -7
  26. package/.github/workflows/main.yml +0 -44
  27. package/.github/workflows/publish.yml +0 -19
  28. package/.github/workflows/sementic_release.yml +0 -27
  29. package/.gitignore +0 -8
  30. package/.nvmrc +0 -1
  31. package/.nyc_output/0196dd80-12a9-4176-bd5b-4a8bc6e984f9.json +0 -1
  32. package/.nyc_output/0d5259bc-f1f3-4ca2-9d4f-1f77daccebf4.json +0 -1
  33. package/.nyc_output/92c6bc34-84c6-46f7-9e14-0d1bd2068352.json +0 -1
  34. package/.nyc_output/a0942cca-db9b-40d2-833e-8fcf7011171f.json +0 -1
  35. package/.nyc_output/b3fc15a1-349d-4d4c-a8dd-2142cc988ac3.json +0 -1
  36. package/.nyc_output/processinfo/0196dd80-12a9-4176-bd5b-4a8bc6e984f9.json +0 -1
  37. package/.nyc_output/processinfo/0d5259bc-f1f3-4ca2-9d4f-1f77daccebf4.json +0 -1
  38. package/.nyc_output/processinfo/92c6bc34-84c6-46f7-9e14-0d1bd2068352.json +0 -1
  39. package/.nyc_output/processinfo/a0942cca-db9b-40d2-833e-8fcf7011171f.json +0 -1
  40. package/.nyc_output/processinfo/b3fc15a1-349d-4d4c-a8dd-2142cc988ac3.json +0 -1
  41. package/.nyc_output/processinfo/index.json +0 -1
  42. package/.nycrc +0 -8
  43. package/.prettierignore +0 -2
  44. package/.prettierrc.js +0 -6
  45. package/.releaserc.json +0 -39
  46. package/.vscode/extensions.json +0 -8
  47. package/.vscode/launch.json +0 -29
  48. package/.vscode/settings.json +0 -21
  49. package/commitlint.config.js +0 -1
  50. package/config/rollup.config.js +0 -78
  51. package/config/webpack.dev.js +0 -59
  52. package/reports/coverage/base.css +0 -224
  53. package/reports/coverage/block-navigation.js +0 -79
  54. package/reports/coverage/favicon.png +0 -0
  55. package/reports/coverage/index.html +0 -96
  56. package/reports/coverage/prettify.css +0 -1
  57. package/reports/coverage/prettify.js +0 -2
  58. package/reports/coverage/sort-arrow-sprite.png +0 -0
  59. package/reports/coverage/sorter.js +0 -170
  60. package/src/dev/index.html +0 -14
  61. package/src/dev/index.tsx +0 -22
  62. package/src/index.tsx +0 -3
  63. package/src/lib/useCsvReactPlugin.tsx +0 -42
  64. package/src/test/jest-setup.ts +0 -7
  65. package/tsconfig.json +0 -35
  66. package/tsconfig.module.json +0 -23
  67. package/yarn.lock +0 -11867
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @usecsv/react v0.1.0
2
+ * @usecsv/react v0.2.2
3
3
  * (c) layercode
4
4
  * Released under the MIT License.
5
5
  */
@@ -10,12 +10,65 @@
10
10
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["@usecsv/react"] = factory());
11
11
  })(this, (function () { 'use strict';
12
12
 
13
+ /*! *****************************************************************************
14
+ Copyright (c) Microsoft Corporation.
15
+
16
+ Permission to use, copy, modify, and/or distribute this software for any
17
+ purpose with or without fee is hereby granted.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
20
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
+ PERFORMANCE OF THIS SOFTWARE.
26
+ ***************************************************************************** */
27
+
28
+ function __rest(s, e) {
29
+ var t = {};
30
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
31
+ t[p] = s[p];
32
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
33
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
34
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
35
+ t[p[i]] = s[p[i]];
36
+ }
37
+ return t;
38
+ }
39
+
13
40
  /*!
14
- * @usecsv/js v0.1.0
41
+ * @usecsv/js v0.2.2
15
42
  * (c) layercode
16
43
  * Released under the MIT License.
17
44
  */
18
45
 
46
+ /*! *****************************************************************************
47
+ Copyright (c) Microsoft Corporation.
48
+
49
+ Permission to use, copy, modify, and/or distribute this software for any
50
+ purpose with or without fee is hereby granted.
51
+
52
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
53
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
54
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
55
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
56
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
57
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
58
+ PERFORMANCE OF THIS SOFTWARE.
59
+ ***************************************************************************** */
60
+
61
+ var __assign = function() {
62
+ __assign = Object.assign || function __assign(t) {
63
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
64
+ s = arguments[i];
65
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
66
+ }
67
+ return t;
68
+ };
69
+ return __assign.apply(this, arguments);
70
+ };
71
+
19
72
  var containers = []; // will store container HTMLElement references
20
73
  var styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}
21
74
 
@@ -577,18 +630,16 @@
577
630
  return iframe;
578
631
  };
579
632
  var useCsvPlugin = function (_a) {
580
- var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata;
633
+ var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData;
581
634
  var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
582
635
  return whenDomReady().then(function () {
583
636
  var iframe = insertIframe(id);
584
637
  var iframeConnection = connectToChild({
585
638
  iframe: iframe,
586
- methods: {
587
- closeIframe: function () {
639
+ methods: __assign({ closeIframe: function () {
588
640
  var _a;
589
641
  (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();
590
- },
591
- },
642
+ } }, (onData ? { onData: onData } : {})),
592
643
  });
593
644
  iframeConnection.promise.then(function (child) {
594
645
  var _a;
@@ -3099,8 +3150,8 @@
3099
3150
  });
3100
3151
 
3101
3152
  var UseCsvButton = function (_a) {
3102
- var children = _a.children, importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, render = _a.render;
3103
- return (react.createElement(react.Fragment, null, render ? (react.createElement(react.Fragment, null, render(function () { return useCsvPlugin({ importerKey: importerKey, user: user, metadata: metadata }); }))) : (react.createElement("button", { type: "button", id: "usecsv-button", style: {
3153
+ var children = _a.children, render = _a.render, parmas = __rest(_a, ["children", "render"]);
3154
+ return (react.createElement(react.Fragment, null, render ? (react.createElement(react.Fragment, null, render(function () { return useCsvPlugin(parmas); }))) : (react.createElement("button", { type: "button", id: "usecsv-button", style: {
3104
3155
  backgroundColor: "#FFF",
3105
3156
  color: "#000",
3106
3157
  border: "2px solid #000",
@@ -3109,7 +3160,7 @@
3109
3160
  textAlign: "center",
3110
3161
  fontSize: "16px",
3111
3162
  cursor: "pointer",
3112
- }, onClick: function () { return useCsvPlugin({ importerKey: importerKey, user: user, metadata: metadata }); } }, children))));
3163
+ }, onClick: function () { return useCsvPlugin(parmas); } }, children))));
3113
3164
  };
3114
3165
 
3115
3166
  return UseCsvButton;