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