@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
package/build/index.js CHANGED
@@ -1,17 +1,70 @@
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
  */
6
6
 
7
7
  'use strict';
8
8
 
9
+ /*! *****************************************************************************
10
+ Copyright (c) Microsoft Corporation.
11
+
12
+ Permission to use, copy, modify, and/or distribute this software for any
13
+ purpose with or without fee is hereby granted.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
16
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
18
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
+ PERFORMANCE OF THIS SOFTWARE.
22
+ ***************************************************************************** */
23
+
24
+ function __rest(s, e) {
25
+ var t = {};
26
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
27
+ t[p] = s[p];
28
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
29
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
30
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
31
+ t[p[i]] = s[p[i]];
32
+ }
33
+ return t;
34
+ }
35
+
9
36
  /*!
10
- * @usecsv/js v0.1.0
37
+ * @usecsv/js v0.2.2
11
38
  * (c) layercode
12
39
  * Released under the MIT License.
13
40
  */
14
41
 
42
+ /*! *****************************************************************************
43
+ Copyright (c) Microsoft Corporation.
44
+
45
+ Permission to use, copy, modify, and/or distribute this software for any
46
+ purpose with or without fee is hereby granted.
47
+
48
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
49
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
50
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
51
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
52
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
53
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
54
+ PERFORMANCE OF THIS SOFTWARE.
55
+ ***************************************************************************** */
56
+
57
+ var __assign = function() {
58
+ __assign = Object.assign || function __assign(t) {
59
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
60
+ s = arguments[i];
61
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
62
+ }
63
+ return t;
64
+ };
65
+ return __assign.apply(this, arguments);
66
+ };
67
+
15
68
  var containers = []; // will store container HTMLElement references
16
69
  var styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}
17
70
 
@@ -573,18 +626,16 @@ var insertIframe = function (id) {
573
626
  return iframe;
574
627
  };
575
628
  var useCsvPlugin = function (_a) {
576
- var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata;
629
+ var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData;
577
630
  var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
578
631
  return whenDomReady().then(function () {
579
632
  var iframe = insertIframe(id);
580
633
  var iframeConnection = connectToChild({
581
634
  iframe: iframe,
582
- methods: {
583
- closeIframe: function () {
635
+ methods: __assign({ closeIframe: function () {
584
636
  var _a;
585
637
  (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();
586
- },
587
- },
638
+ } }, (onData ? { onData: onData } : {})),
588
639
  });
589
640
  iframeConnection.promise.then(function (child) {
590
641
  var _a;
@@ -3095,8 +3146,8 @@ if (process.env.NODE_ENV === 'production') {
3095
3146
  });
3096
3147
 
3097
3148
  var UseCsvButton = function (_a) {
3098
- var children = _a.children, importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, render = _a.render;
3099
- 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: {
3149
+ var children = _a.children, render = _a.render, parmas = __rest(_a, ["children", "render"]);
3150
+ 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: {
3100
3151
  backgroundColor: "#FFF",
3101
3152
  color: "#000",
3102
3153
  border: "2px solid #000",
@@ -3105,7 +3156,7 @@ var UseCsvButton = function (_a) {
3105
3156
  textAlign: "center",
3106
3157
  fontSize: "16px",
3107
3158
  cursor: "pointer",
3108
- }, onClick: function () { return useCsvPlugin({ importerKey: importerKey, user: user, metadata: metadata }); } }, children))));
3159
+ }, onClick: function () { return useCsvPlugin(parmas); } }, children))));
3109
3160
  };
3110
3161
 
3111
3162
  module.exports = UseCsvButton;