@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.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
*/
|
|
@@ -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.
|
|
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,
|
|
3103
|
-
return (react.createElement(react.Fragment, null, render ? (react.createElement(react.Fragment, null, render(function () { return useCsvPlugin(
|
|
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(
|
|
3163
|
+
}, onClick: function () { return useCsvPlugin(parmas); } }, children))));
|
|
3113
3164
|
};
|
|
3114
3165
|
|
|
3115
3166
|
return UseCsvButton;
|