@usecsv/vuejs 1.1.17 → 1.1.21
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/dist/UseCSVButton.esm.js +131 -46
- package/dist/UseCSVButton.min.js +3 -17
- package/dist/UseCSVButton.ssr.js +168 -85
- package/dist/types/src/UseCSVButton.vue.d.ts +5 -2
- package/package.json +21 -21
- package/src/UseCSVButton.vue +7 -4
- package/CHANGELOG.md +0 -153
package/dist/UseCSVButton.esm.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
|
-
* @usecsv/js v0.
|
|
4
|
+
* @usecsv/js v0.13.1
|
|
5
5
|
* (c) layercode
|
|
6
6
|
* Released under the MIT License.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
/******************************************************************************
|
|
10
10
|
Copyright (c) Microsoft Corporation.
|
|
11
11
|
|
|
12
12
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -214,14 +214,14 @@ const deserializeError = (obj) => {
|
|
|
214
214
|
* Listens for "call" messages coming from the remote, executes the corresponding method, and
|
|
215
215
|
* responds with the return value.
|
|
216
216
|
*/
|
|
217
|
-
var connectCallReceiver = (info,
|
|
217
|
+
var connectCallReceiver = (info, serializedMethods, log) => {
|
|
218
218
|
const { localName, local, remote, originForSending, originForReceiving, } = info;
|
|
219
219
|
let destroyed = false;
|
|
220
220
|
const handleMessageEvent = (event) => {
|
|
221
221
|
if (event.source !== remote || event.data.penpal !== MessageType.Call) {
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
if (event.origin !== originForReceiving) {
|
|
224
|
+
if (originForReceiving !== '*' && event.origin !== originForReceiving) {
|
|
225
225
|
log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
@@ -271,7 +271,7 @@ var connectCallReceiver = (info, methods, log) => {
|
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
};
|
|
274
|
-
new Promise((resolve) => resolve(
|
|
274
|
+
new Promise((resolve) => resolve(serializedMethods[methodName].apply(serializedMethods, args))).then(createPromiseHandler(Resolution.Fulfilled), createPromiseHandler(Resolution.Rejected));
|
|
275
275
|
};
|
|
276
276
|
local.addEventListener(NativeEventType.Message, handleMessageEvent);
|
|
277
277
|
return () => {
|
|
@@ -286,18 +286,86 @@ let id = 0;
|
|
|
286
286
|
*/
|
|
287
287
|
var generateId = () => ++id;
|
|
288
288
|
|
|
289
|
+
const KEY_PATH_DELIMITER = '.';
|
|
290
|
+
const keyPathToSegments = (keyPath) => keyPath ? keyPath.split(KEY_PATH_DELIMITER) : [];
|
|
291
|
+
const segmentsToKeyPath = (segments) => segments.join(KEY_PATH_DELIMITER);
|
|
292
|
+
const createKeyPath = (key, prefix) => {
|
|
293
|
+
const segments = keyPathToSegments(prefix || '');
|
|
294
|
+
segments.push(key);
|
|
295
|
+
return segmentsToKeyPath(segments);
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Given a `keyPath`, set it to be `value` on `subject`, creating any intermediate
|
|
299
|
+
* objects along the way.
|
|
300
|
+
*
|
|
301
|
+
* @param {Object} subject The object on which to set value.
|
|
302
|
+
* @param {string} keyPath The key path at which to set value.
|
|
303
|
+
* @param {Object} value The value to store at the given key path.
|
|
304
|
+
* @returns {Object} Updated subject.
|
|
305
|
+
*/
|
|
306
|
+
const setAtKeyPath = (subject, keyPath, value) => {
|
|
307
|
+
const segments = keyPathToSegments(keyPath);
|
|
308
|
+
segments.reduce((prevSubject, key, idx) => {
|
|
309
|
+
if (typeof prevSubject[key] === 'undefined') {
|
|
310
|
+
prevSubject[key] = {};
|
|
311
|
+
}
|
|
312
|
+
if (idx === segments.length - 1) {
|
|
313
|
+
prevSubject[key] = value;
|
|
314
|
+
}
|
|
315
|
+
return prevSubject[key];
|
|
316
|
+
}, subject);
|
|
317
|
+
return subject;
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Given a dictionary of (nested) keys to function, flatten them to a map
|
|
321
|
+
* from key path to function.
|
|
322
|
+
*
|
|
323
|
+
* @param {Object} methods The (potentially nested) object to serialize.
|
|
324
|
+
* @param {string} prefix A string with which to prefix entries. Typically not intended to be used by consumers.
|
|
325
|
+
* @returns {Object} An map from key path in `methods` to functions.
|
|
326
|
+
*/
|
|
327
|
+
const serializeMethods = (methods, prefix) => {
|
|
328
|
+
const flattenedMethods = {};
|
|
329
|
+
Object.keys(methods).forEach((key) => {
|
|
330
|
+
const value = methods[key];
|
|
331
|
+
const keyPath = createKeyPath(key, prefix);
|
|
332
|
+
if (typeof value === 'object') {
|
|
333
|
+
// Recurse into any nested children.
|
|
334
|
+
Object.assign(flattenedMethods, serializeMethods(value, keyPath));
|
|
335
|
+
}
|
|
336
|
+
if (typeof value === 'function') {
|
|
337
|
+
// If we've found a method, expose it.
|
|
338
|
+
flattenedMethods[keyPath] = value;
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
return flattenedMethods;
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* Given a map of key paths to functions, unpack the key paths to an object.
|
|
345
|
+
*
|
|
346
|
+
* @param {Object} flattenedMethods A map of key paths to functions to unpack.
|
|
347
|
+
* @returns {Object} A (potentially nested) map of functions.
|
|
348
|
+
*/
|
|
349
|
+
const deserializeMethods = (flattenedMethods) => {
|
|
350
|
+
const methods = {};
|
|
351
|
+
for (const keyPath in flattenedMethods) {
|
|
352
|
+
setAtKeyPath(methods, keyPath, flattenedMethods[keyPath]);
|
|
353
|
+
}
|
|
354
|
+
return methods;
|
|
355
|
+
};
|
|
356
|
+
|
|
289
357
|
/**
|
|
290
358
|
* Augments an object with methods that match those defined by the remote. When these methods are
|
|
291
359
|
* called, a "call" message will be sent to the remote, the remote's corresponding method will be
|
|
292
360
|
* executed, and the method's return value will be returned via a message.
|
|
293
361
|
* @param {Object} callSender Sender object that should be augmented with methods.
|
|
294
362
|
* @param {Object} info Information about the local and remote windows.
|
|
295
|
-
* @param {Array}
|
|
363
|
+
* @param {Array} methodKeyPaths Key paths of methods available to be called on the remote.
|
|
296
364
|
* @param {Promise} destructionPromise A promise resolved when destroy() is called on the penpal
|
|
297
365
|
* connection.
|
|
298
366
|
* @returns {Object} The call sender object with methods that may be called.
|
|
299
367
|
*/
|
|
300
|
-
var connectCallSender = (callSender, info,
|
|
368
|
+
var connectCallSender = (callSender, info, methodKeyPaths, destroyConnection, log) => {
|
|
301
369
|
const { localName, local, remote, originForSending, originForReceiving, } = info;
|
|
302
370
|
let destroyed = false;
|
|
303
371
|
log(`${localName}: Connecting call sender`);
|
|
@@ -338,7 +406,8 @@ var connectCallSender = (callSender, info, methodNames, destroyConnection, log)
|
|
|
338
406
|
event.data.id !== id) {
|
|
339
407
|
return;
|
|
340
408
|
}
|
|
341
|
-
if (
|
|
409
|
+
if (originForReceiving !== '*' &&
|
|
410
|
+
event.origin !== originForReceiving) {
|
|
342
411
|
log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);
|
|
343
412
|
return;
|
|
344
413
|
}
|
|
@@ -362,10 +431,14 @@ var connectCallSender = (callSender, info, methodNames, destroyConnection, log)
|
|
|
362
431
|
});
|
|
363
432
|
};
|
|
364
433
|
};
|
|
365
|
-
|
|
366
|
-
|
|
434
|
+
// Wrap each method in a proxy which sends it to the corresponding receiver.
|
|
435
|
+
const flattenedMethods = methodKeyPaths.reduce((api, name) => {
|
|
436
|
+
api[name] = createMethodProxy(name);
|
|
367
437
|
return api;
|
|
368
|
-
},
|
|
438
|
+
}, {});
|
|
439
|
+
// Unpack the structure of the provided methods object onto the CallSender, exposing
|
|
440
|
+
// the methods in the same shape they were provided.
|
|
441
|
+
Object.assign(callSender, deserializeMethods(flattenedMethods));
|
|
369
442
|
return () => {
|
|
370
443
|
destroyed = true;
|
|
371
444
|
};
|
|
@@ -374,7 +447,7 @@ var connectCallSender = (callSender, info, methodNames, destroyConnection, log)
|
|
|
374
447
|
/**
|
|
375
448
|
* Handles an ACK handshake message.
|
|
376
449
|
*/
|
|
377
|
-
var handleAckMessageFactory = (
|
|
450
|
+
var handleAckMessageFactory = (serializedMethods, childOrigin, originForSending, destructor, log) => {
|
|
378
451
|
const { destroy, onDestroy } = destructor;
|
|
379
452
|
let destroyCallReceiver;
|
|
380
453
|
let receiverMethodNames;
|
|
@@ -384,7 +457,7 @@ var handleAckMessageFactory = (methods, childOrigin, originForSending, destructo
|
|
|
384
457
|
// latest provided by the child.
|
|
385
458
|
const callSender = {};
|
|
386
459
|
return (event) => {
|
|
387
|
-
if (event.origin !== childOrigin) {
|
|
460
|
+
if (childOrigin !== '*' && event.origin !== childOrigin) {
|
|
388
461
|
log(`Parent: Handshake - Received ACK message from origin ${event.origin} which did not match expected origin ${childOrigin}`);
|
|
389
462
|
return;
|
|
390
463
|
}
|
|
@@ -401,7 +474,7 @@ var handleAckMessageFactory = (methods, childOrigin, originForSending, destructo
|
|
|
401
474
|
if (destroyCallReceiver) {
|
|
402
475
|
destroyCallReceiver();
|
|
403
476
|
}
|
|
404
|
-
destroyCallReceiver = connectCallReceiver(info,
|
|
477
|
+
destroyCallReceiver = connectCallReceiver(info, serializedMethods, log);
|
|
405
478
|
onDestroy(destroyCallReceiver);
|
|
406
479
|
// If the child reconnected, we need to remove the methods from the
|
|
407
480
|
// previous call receiver off the sender.
|
|
@@ -420,16 +493,23 @@ var handleAckMessageFactory = (methods, childOrigin, originForSending, destructo
|
|
|
420
493
|
/**
|
|
421
494
|
* Handles a SYN handshake message.
|
|
422
495
|
*/
|
|
423
|
-
var handleSynMessageFactory = (log,
|
|
496
|
+
var handleSynMessageFactory = (log, serializedMethods, childOrigin, originForSending) => {
|
|
424
497
|
return (event) => {
|
|
425
|
-
|
|
498
|
+
// Under specific timing circumstances, we can receive an event
|
|
499
|
+
// whose source is null. This seems to happen when the child iframe is
|
|
500
|
+
// removed from the DOM about the same time it has sent the SYN event.
|
|
501
|
+
// https://github.com/Aaronius/penpal/issues/85
|
|
502
|
+
if (!event.source) {
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
if (childOrigin !== '*' && event.origin !== childOrigin) {
|
|
426
506
|
log(`Parent: Handshake - Received SYN message from origin ${event.origin} which did not match expected origin ${childOrigin}`);
|
|
427
507
|
return;
|
|
428
508
|
}
|
|
429
509
|
log('Parent: Handshake - Received SYN, responding with SYN-ACK');
|
|
430
510
|
const synAckMessage = {
|
|
431
511
|
penpal: MessageType.SynAck,
|
|
432
|
-
methodNames: Object.keys(
|
|
512
|
+
methodNames: Object.keys(serializedMethods),
|
|
433
513
|
};
|
|
434
514
|
event.source.postMessage(synAckMessage, originForSending);
|
|
435
515
|
};
|
|
@@ -500,8 +580,9 @@ var connectToChild = (options) => {
|
|
|
500
580
|
// must post messages with "*" as targetOrigin when sending messages.
|
|
501
581
|
// https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#Using_window.postMessage_in_extensions
|
|
502
582
|
const originForSending = childOrigin === 'null' ? '*' : childOrigin;
|
|
503
|
-
const
|
|
504
|
-
const
|
|
583
|
+
const serializedMethods = serializeMethods(methods);
|
|
584
|
+
const handleSynMessage = handleSynMessageFactory(log, serializedMethods, childOrigin, originForSending);
|
|
585
|
+
const handleAckMessage = handleAckMessageFactory(serializedMethods, childOrigin, originForSending, destructor, log);
|
|
505
586
|
const promise = new Promise((resolve, reject) => {
|
|
506
587
|
const stopConnectionTimeout = startConnectionTimeout(timeout, destroy);
|
|
507
588
|
const handleMessage = (event) => {
|
|
@@ -601,7 +682,7 @@ var insertIframe = function (id, importerDisplay) {
|
|
|
601
682
|
return iframe;
|
|
602
683
|
};
|
|
603
684
|
var useCsvPlugin = function (_a) {
|
|
604
|
-
var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit, _b = _a.importerDisplay, importerDisplay = _b === void 0 ? "modal" : _b, onClose = _a.onClose, theme = _a.theme;
|
|
685
|
+
var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit, _b = _a.importerDisplay, importerDisplay = _b === void 0 ? "modal" : _b, onClose = _a.onClose, theme = _a.theme, batchSize = _a.batchSize, sampleFileURL = _a.sampleFileURL, _c = _a.downloadExampleButton, downloadExampleButton = _c === void 0 ? true : _c;
|
|
605
686
|
var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
|
|
606
687
|
return whenDomReady().then(function () {
|
|
607
688
|
var iframe = insertIframe(id, importerDisplay);
|
|
@@ -633,7 +714,18 @@ var useCsvPlugin = function (_a) {
|
|
|
633
714
|
var _a;
|
|
634
715
|
(_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.classList.remove("loading");
|
|
635
716
|
// eslint-disable-next-line dot-notation
|
|
636
|
-
child["setParams"] &&
|
|
717
|
+
child["setParams"] &&
|
|
718
|
+
// eslint-disable-next-line dot-notation
|
|
719
|
+
child["setParams"]({
|
|
720
|
+
importerKey: importerKey,
|
|
721
|
+
user: user,
|
|
722
|
+
metadata: metadata,
|
|
723
|
+
importerDisplay: importerDisplay,
|
|
724
|
+
theme: theme,
|
|
725
|
+
batchSize: batchSize,
|
|
726
|
+
sampleFileURL: sampleFileURL,
|
|
727
|
+
downloadExampleButton: downloadExampleButton,
|
|
728
|
+
});
|
|
637
729
|
});
|
|
638
730
|
return iframeConnection;
|
|
639
731
|
});
|
|
@@ -650,15 +742,16 @@ var script = /*#__PURE__*/Vue.extend({
|
|
|
650
742
|
onRecordsInitial: {},
|
|
651
743
|
onRecordEdit: {},
|
|
652
744
|
onClose: {},
|
|
653
|
-
theme: {}
|
|
745
|
+
theme: {},
|
|
746
|
+
batchSize: {},
|
|
747
|
+
sampleFileURL: {},
|
|
748
|
+
downloadExampleButton: {}
|
|
654
749
|
},
|
|
655
|
-
|
|
656
750
|
data() {
|
|
657
751
|
return {
|
|
658
752
|
hasSlot: !!this.$slots.default
|
|
659
753
|
};
|
|
660
754
|
},
|
|
661
|
-
|
|
662
755
|
methods: {
|
|
663
756
|
openModal() {
|
|
664
757
|
useCsvPlugin({
|
|
@@ -670,14 +763,15 @@ var script = /*#__PURE__*/Vue.extend({
|
|
|
670
763
|
onRecordsInitial: this.onRecordsInitial,
|
|
671
764
|
onRecordEdit: this.onRecordEdit,
|
|
672
765
|
onClose: this.onClose,
|
|
673
|
-
theme: this.theme
|
|
766
|
+
theme: this.theme,
|
|
767
|
+
batchSize: this.batchSize,
|
|
768
|
+
sampleFileURL: this.sampleFileURL,
|
|
769
|
+
downloadExampleButton: this.downloadExampleButton
|
|
674
770
|
});
|
|
675
771
|
},
|
|
676
|
-
|
|
677
772
|
hasScopedSlot() {
|
|
678
773
|
return (this.$scopedSlots.default && this.$scopedSlots.default.name) === "normalized";
|
|
679
774
|
}
|
|
680
|
-
|
|
681
775
|
}
|
|
682
776
|
});
|
|
683
777
|
|
|
@@ -811,15 +905,12 @@ function addStyle(id, css) {
|
|
|
811
905
|
|
|
812
906
|
/* script */
|
|
813
907
|
const __vue_script__ = script;
|
|
814
|
-
/* template */
|
|
815
908
|
|
|
909
|
+
/* template */
|
|
816
910
|
var __vue_render__ = function () {
|
|
817
911
|
var _vm = this;
|
|
818
|
-
|
|
819
912
|
var _h = _vm.$createElement;
|
|
820
|
-
|
|
821
913
|
var _c = _vm._self._c || _h;
|
|
822
|
-
|
|
823
914
|
return _c('div', {
|
|
824
915
|
staticClass: "usecsv"
|
|
825
916
|
}, [_vm.hasScopedSlot() ? _c('div', [_vm._t("default", null, {
|
|
@@ -836,27 +927,22 @@ var __vue_render__ = function () {
|
|
|
836
927
|
return [_vm._v(" open usecsv ")];
|
|
837
928
|
})], 2)])]);
|
|
838
929
|
};
|
|
839
|
-
|
|
840
930
|
var __vue_staticRenderFns__ = [];
|
|
841
|
-
/* style */
|
|
842
931
|
|
|
932
|
+
/* style */
|
|
843
933
|
const __vue_inject_styles__ = function (inject) {
|
|
844
934
|
if (!inject) return;
|
|
845
|
-
inject("data-v-
|
|
846
|
-
source: "#usecsv-button[data-v-
|
|
935
|
+
inject("data-v-2d3aaabe_0", {
|
|
936
|
+
source: "#usecsv-button[data-v-2d3aaabe]{background-color:#fff;color:#000;border:2px solid #000;border-radius:6px;padding:10px 15px;text-align:center;font-size:16px;cursor:pointer}",
|
|
847
937
|
map: undefined,
|
|
848
938
|
media: undefined
|
|
849
939
|
});
|
|
850
940
|
};
|
|
851
941
|
/* scoped */
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
const __vue_scope_id__ = "data-v-79d7f16a";
|
|
942
|
+
const __vue_scope_id__ = "data-v-2d3aaabe";
|
|
855
943
|
/* module identifier */
|
|
856
|
-
|
|
857
944
|
const __vue_module_identifier__ = undefined;
|
|
858
945
|
/* functional template */
|
|
859
|
-
|
|
860
946
|
const __vue_is_functional_template__ = false;
|
|
861
947
|
/* style inject SSR */
|
|
862
948
|
|
|
@@ -866,23 +952,22 @@ const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
|
866
952
|
render: __vue_render__,
|
|
867
953
|
staticRenderFns: __vue_staticRenderFns__
|
|
868
954
|
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, createInjector, undefined, undefined);
|
|
869
|
-
|
|
870
955
|
var component = __vue_component__;
|
|
871
956
|
|
|
872
957
|
// Import vue component
|
|
958
|
+
// Default export is installable instance of component.
|
|
873
959
|
// IIFE injects install function into component, allowing component
|
|
874
960
|
// to be registered via Vue.use() as well as Vue.component(),
|
|
875
|
-
|
|
876
961
|
var entry_esm = /*#__PURE__*/(() => {
|
|
877
962
|
// Assign InstallableComponent type
|
|
878
|
-
const installable = component;
|
|
879
|
-
|
|
963
|
+
const installable = component;
|
|
964
|
+
// Attach install function executed by Vue.use()
|
|
880
965
|
installable.install = Vue => {
|
|
881
966
|
Vue.component('usecsv-button', installable);
|
|
882
967
|
};
|
|
883
|
-
|
|
884
968
|
return installable;
|
|
885
|
-
})();
|
|
969
|
+
})();
|
|
970
|
+
// It's possible to expose named exports when writing components that can
|
|
886
971
|
// also be used as directives, etc. - eg. import { RollupDemoDirective } from 'rollup-demo';
|
|
887
972
|
// export const RollupDemoDirective = directive;
|
|
888
973
|
|
package/dist/UseCSVButton.min.js
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
var UseCSVButton=function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null
|
|
1
|
+
var UseCSVButton=function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){d=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw r}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}
|
|
2
2
|
/*!
|
|
3
|
-
* @usecsv/js v0.
|
|
3
|
+
* @usecsv/js v0.13.1
|
|
4
4
|
* (c) layercode
|
|
5
5
|
* Released under the MIT License.
|
|
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
|
-
***************************************************************************** */()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var i=function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)},s=[],a=[];function c(e,t){if(t=t||{},void 0===e)throw new Error("insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).");var n,o=!0===t.prepend?"prepend":"append",r=void 0!==t.container?t.container:document.querySelector("head"),i=s.indexOf(r);return-1===i&&(i=s.push(r)-1,a[i]={}),void 0!==a[i]&&void 0!==a[i][o]?n=a[i][o]:(n=a[i][o]=function(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}(),"prepend"===o?r.insertBefore(n,r.childNodes[0]):r.appendChild(n)),65279===e.charCodeAt(0)&&(e=e.substr(1,e.length)),n.styleSheet?n.styleSheet.cssText+=e:n.textContent+=e,n}var d,l,u,m,p,f=c;c.insertCss=f,function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(d||(d={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(l||(l={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NoIframeSrc="NoIframeSrc"}(u||(u={})),function(e){e.DataCloneError="DataCloneError"}(m||(m={})),function(e){e.Message="message"}(p||(p={}));const h={"http:":"80","https:":"443"},v=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,y=["file:","data:"];const g=({name:e,message:t,stack:n})=>({name:e,message:t,stack:n});let C=0;var b=()=>++C,S=(e,t,n,o,r)=>{const{localName:i,local:s,remote:a,originForSending:c,originForReceiving:m}=t;let f=!1;r(`${i}: Connecting call sender`);const h=e=>(...t)=>{let n;r(`${i}: Sending ${e}() call`);try{a.closed&&(n=!0)}catch(e){n=!0}if(n&&o(),f){const t=new Error(`Unable to send ${e}() call due to destroyed connection`);throw t.code=u.ConnectionDestroyed,t}return new Promise(((n,o)=>{const u=b(),f=t=>{if(t.source!==a||t.data.penpal!==d.Reply||t.data.id!==u)return;if(t.origin!==m)return void r(`${i} received message from origin ${t.origin} which did not match expected origin ${m}`);const c=t.data;r(`${i}: Received ${e}() reply`),s.removeEventListener(p.Message,f);let h=c.returnValue;c.returnValueIsError&&(h=(e=>{const t=new Error;return Object.keys(e).forEach((n=>t[n]=e[n])),t})(h)),(c.resolution===l.Fulfilled?n:o)(h)};s.addEventListener(p.Message,f);const h={penpal:d.Call,id:u,methodName:e,args:t};a.postMessage(h,c)}))};return n.reduce(((e,t)=>(e[t]=h(t),e)),e),()=>{f=!0}},w=(e,t,n,o,r)=>{const{destroy:i,onDestroy:s}=o;let a,c;const u={};return o=>{if(o.origin!==t)return void r(`Parent: Handshake - Received ACK message from origin ${o.origin} which did not match expected origin ${t}`);r("Parent: Handshake - Received ACK");const f={localName:"Parent",local:window,remote:o.source,originForSending:n,originForReceiving:t};a&&a(),a=((e,t,n)=>{const{localName:o,local:r,remote:i,originForSending:s,originForReceiving:a}=e;let c=!1;const u=e=>{if(e.source!==i||e.data.penpal!==d.Call)return;if(e.origin!==a)return void n(`${o} received message from origin ${e.origin} which did not match expected origin ${a}`);const r=e.data,{methodName:u,args:p,id:f}=r;n(`${o}: Received ${u}() call`);const h=e=>t=>{if(n(`${o}: Sending ${u}() reply`),c)return void n(`${o}: Unable to send ${u}() reply due to destroyed connection`);const r={penpal:d.Reply,id:f,resolution:e,returnValue:t};e===l.Rejected&&t instanceof Error&&(r.returnValue=g(t),r.returnValueIsError=!0);try{i.postMessage(r,s)}catch(e){if(e.name===m.DataCloneError){const t={penpal:d.Reply,id:f,resolution:l.Rejected,returnValue:g(e),returnValueIsError:!0};i.postMessage(t,s)}throw e}};new Promise((e=>e(t[u].apply(t,p)))).then(h(l.Fulfilled),h(l.Rejected))};return r.addEventListener(p.Message,u),()=>{c=!0,r.removeEventListener(p.Message,u)}})(f,e,r),s(a),c&&c.forEach((e=>{delete u[e]})),c=o.data.methodNames;const h=S(u,f,c,i,r);return s(h),u}};var E=e=>{let{iframe:t,methods:n={},childOrigin:o,timeout:r,debug:i=!1}=e;const s=(e=>(...t)=>{e&&console.log("[Penpal]",...t)})(i),a=((e,t)=>{const n=[];let o=!1;return{destroy(r){o||(o=!0,t(`${e}: Destroying connection`),n.forEach((e=>{e(r)})))},onDestroy(e){o?e():n.push(e)}}})("Parent",s),{onDestroy:c,destroy:l}=a;o||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=u.NoIframeSrc,e}})(t),o=(e=>{if(e&&y.find((t=>e.startsWith(t))))return"null";const t=document.location,n=v.exec(e);let o,r,i;return n?(o=n[1]?n[1]:t.protocol,r=n[2],i=n[4]):(o=t.protocol,r=t.hostname,i=t.port),`${o}//${r}${i&&i!==h[o]?`:${i}`:""}`})(t.src));const m="null"===o?"*":o,f=((e,t,n,o)=>r=>{if(r.origin!==n)return void e(`Parent: Handshake - Received SYN message from origin ${r.origin} which did not match expected origin ${n}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const i={penpal:d.SynAck,methodNames:Object.keys(t)};r.source.postMessage(i,o)})(s,n,o,m),g=w(n,o,m,a,s),C=new Promise(((e,n)=>{const o=((e,t)=>{let n;return void 0!==e&&(n=window.setTimeout((()=>{const n=new Error(`Connection timed out after ${e}ms`);n.code=u.ConnectionTimeout,t(n)}),e)),()=>{clearTimeout(n)}})(r,l),i=n=>{if(n.source===t.contentWindow&&n.data)if(n.data.penpal!==d.Syn)if(n.data.penpal!==d.Ack);else{const t=g(n);t&&(o(),e(t))}else f(n)};window.addEventListener(p.Message,i),s("Parent: Awaiting handshake"),((e,t)=>{const{destroy:n,onDestroy:o}=t,r=setInterval((()=>{e.isConnected||(clearInterval(r),n())}),6e4);o((()=>{clearInterval(r)}))})(t,a),c((e=>{window.removeEventListener(p.Message,i),e&&n(e)}))}));return{promise:C,destroy(){l()}}},$=["interactive","complete"],R=function(e,t){return new Promise((function(n){e&&"function"!=typeof e&&(t=e,e=null),t=t||window.document;var o=function(){return n(void(e&&setTimeout(e)))};-1!==$.indexOf(t.readyState)?o():t.addEventListener("DOMContentLoaded",o)}))};R.resume=function(e){return function(t){return R(e).then((function(){return t}))}};var _=function(e){var t=e.importerKey,n=e.user,o=e.metadata,r=e.onData,s=e.onRecordsInitial,a=e.onRecordEdit,c=e.importerDisplay,d=void 0===c?"modal":c,l=e.onClose,u=e.theme,m="usecsv-".concat(Math.round(1e8*Math.random()));return R().then((function(){var e=function(e,t){var n=document.getElementById("usecsv-importer-inline-wrapper");f("\n ".concat("modal"!==t&&n?"":".usecsv_container { position: fixed; top: 0px; bottom: 0; right: 0; left: 0; z-index: 100000; }","\n .usecsv_container iframe {\n width: 100%;\n height: 100%;\n position: absolute;\n border-width: 0;\n }\n .usecsv_container {\n overflow: hidden;\n overscroll-behavior-x: none;\n }\n")),document.body.insertAdjacentHTML("beforeend","<div id=".concat(e,' class="usecsv_container loading"></div>'));var o=document.createElement("iframe");o.setAttribute("src","https://app.usecsv.com/importer");var r=document.getElementById(e);return null==r||r.appendChild(o),"inline"===t&&n&&(null==n||n.appendChild(r)),o}(m,d),c=function(){var e;null===(e=document.getElementById(m))||void 0===e||e.remove()},p=E({iframe:e,methods:i(i(i(i({closeIframe:c},r?{onData:function(e){return r(e,c)}}:{}),s?{onRecordsInitial:s}:{}),a?{onRecordEdit:a}:{}),l?{onClose:l}:{})});return p.promise.then((function(e){var r;null===(r=document.getElementById(m))||void 0===r||r.classList.remove("loading"),e.setParams&&e.setParams({importerKey:t,user:n,metadata:o,importerDisplay:d,theme:u})})),p}))},x=n.default.extend({name:"usecsv-button",props:{importerKey:{},user:{},metadata:{},onData:{},importerDisplay:{},onRecordsInitial:{},onRecordEdit:{},onClose:{},theme:{}},data:function(){return{hasSlot:!!this.$slots.default}},methods:{openModal:function(){_({importerKey:this.importerKey,user:this.user,metadata:this.metadata,onData:this.onData,importerDisplay:this.importerDisplay,onRecordsInitial:this.onRecordsInitial,onRecordEdit:this.onRecordEdit,onClose:this.onClose,theme:this.theme})},hasScopedSlot:function(){return"normalized"===(this.$scopedSlots.default&&this.$scopedSlots.default.name)}}});function I(e,t,n,o,r,i,s,a,c,d){"boolean"!=typeof s&&(c=a,a=s,s=!1);const l="function"==typeof n?n.options:n;let u;if(e&&e.render&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),o&&(l._scopeId=o),i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,c(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},l._ssrRegister=u):t&&(u=s?function(e){t.call(this,d(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),u)if(l.functional){const e=l.render;l.render=function(t,n){return u.call(n),e(t,n)}}else{const e=l.beforeCreate;l.beforeCreate=e?[].concat(e,u):[u]}return n}const D="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function A(e){return(e,t)=>function(e,t){const n=D?t.media||"default":e,o=N[n]||(N[n]={ids:new Set,styles:[]});if(!o.ids.has(e)){o.ids.add(e);let n=t.source;if(t.map&&(n+="\n/*# sourceURL="+t.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),o.element||(o.element=document.createElement("style"),o.element.type="text/css",t.media&&o.element.setAttribute("media",t.media),void 0===M&&(M=document.head||document.getElementsByTagName("head")[0]),M.appendChild(o.element)),"styleSheet"in o.element)o.styles.push(n),o.element.styleSheet.cssText=o.styles.filter(Boolean).join("\n");else{const e=o.ids.size-1,t=document.createTextNode(n),r=o.element.childNodes;r[e]&&o.element.removeChild(r[e]),r.length?o.element.insertBefore(t,r[e]):o.element.appendChild(t)}}}(e,t)}let M;const N={};var j=I({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"usecsv"},[e.hasScopedSlot()?n("div",[e._t("default",null,{openModal:e.openModal})],2):n("div",[n("button",{attrs:{type:"button",id:"usecsv-button"},on:{click:e.openModal}},[e._t("default",(function(){return[e._v(" open usecsv ")]}))],2)])])},staticRenderFns:[]},(function(e){e&&e("data-v-79d7f16a_0",{source:"#usecsv-button[data-v-79d7f16a]{background-color:#fff;color:#000;border:2px solid #000;border-radius:6px;padding:10px 15px;text-align:center;font-size:16px;cursor:pointer}",map:void 0,media:void 0})}),x,"data-v-79d7f16a",false,undefined,!1,A,void 0,void 0),k=function(){var e=j;return e.install=function(t){t.component("usecsv-button",e)},e}(),O=Object.freeze({__proto__:null,default:k});return Object.entries(O).forEach((function(e){var t=o(e,2),n=t[0],r=t[1];"default"!==n&&(k[n]=r)})),k}(Vue);
|
|
6
|
+
*/()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var i=function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)},a=[],s=[];function c(e,t){if(t=t||{},void 0===e)throw new Error("insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).");var n,o=!0===t.prepend?"prepend":"append",r=void 0!==t.container?t.container:document.querySelector("head"),i=a.indexOf(r);return-1===i&&(i=a.push(r)-1,s[i]={}),void 0!==s[i]&&void 0!==s[i][o]?n=s[i][o]:(n=s[i][o]=function(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}(),"prepend"===o?r.insertBefore(n,r.childNodes[0]):r.appendChild(n)),65279===e.charCodeAt(0)&&(e=e.substr(1,e.length)),n.styleSheet?n.styleSheet.cssText+=e:n.textContent+=e,n}var d,l,u,p,m,f=c;c.insertCss=f,function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(d||(d={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(l||(l={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NoIframeSrc="NoIframeSrc"}(u||(u={})),function(e){e.DataCloneError="DataCloneError"}(p||(p={})),function(e){e.Message="message"}(m||(m={}));const h={"http:":"80","https:":"443"},v=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,y=["file:","data:"];const g=({name:e,message:t,stack:n})=>({name:e,message:t,stack:n});let b=0;var C=()=>++b;const E=e=>e?e.split("."):[],S=(e,t,n)=>{const o=E(t);return o.reduce(((e,t,r)=>(void 0===e[t]&&(e[t]={}),r===o.length-1&&(e[t]=n),e[t])),e),e},w=(e,t)=>{const n={};return Object.keys(e).forEach((o=>{const r=e[o],i=((e,t)=>{const n=E(t||"");return n.push(e),(e=>e.join("."))(n)})(o,t);"object"==typeof r&&Object.assign(n,w(r,i)),"function"==typeof r&&(n[i]=r)})),n};var R=(e,t,n,o,r)=>{const{localName:i,local:a,remote:s,originForSending:c,originForReceiving:p}=t;let f=!1;r(`${i}: Connecting call sender`);const h=e=>(...t)=>{let n;r(`${i}: Sending ${e}() call`);try{s.closed&&(n=!0)}catch(e){n=!0}if(n&&o(),f){const t=new Error(`Unable to send ${e}() call due to destroyed connection`);throw t.code=u.ConnectionDestroyed,t}return new Promise(((n,o)=>{const u=C(),f=t=>{if(t.source!==s||t.data.penpal!==d.Reply||t.data.id!==u)return;if("*"!==p&&t.origin!==p)return void r(`${i} received message from origin ${t.origin} which did not match expected origin ${p}`);const c=t.data;r(`${i}: Received ${e}() reply`),a.removeEventListener(m.Message,f);let h=c.returnValue;c.returnValueIsError&&(h=(e=>{const t=new Error;return Object.keys(e).forEach((n=>t[n]=e[n])),t})(h)),(c.resolution===l.Fulfilled?n:o)(h)};a.addEventListener(m.Message,f);const h={penpal:d.Call,id:u,methodName:e,args:t};s.postMessage(h,c)}))},v=n.reduce(((e,t)=>(e[t]=h(t),e)),{});return Object.assign(e,(e=>{const t={};for(const n in e)S(t,n,e[n]);return t})(v)),()=>{f=!0}},$=(e,t,n,o,r)=>{const{destroy:i,onDestroy:a}=o;let s,c;const u={};return o=>{if("*"!==t&&o.origin!==t)return void r(`Parent: Handshake - Received ACK message from origin ${o.origin} which did not match expected origin ${t}`);r("Parent: Handshake - Received ACK");const f={localName:"Parent",local:window,remote:o.source,originForSending:n,originForReceiving:t};s&&s(),s=((e,t,n)=>{const{localName:o,local:r,remote:i,originForSending:a,originForReceiving:s}=e;let c=!1;const u=e=>{if(e.source!==i||e.data.penpal!==d.Call)return;if("*"!==s&&e.origin!==s)return void n(`${o} received message from origin ${e.origin} which did not match expected origin ${s}`);const r=e.data,{methodName:u,args:m,id:f}=r;n(`${o}: Received ${u}() call`);const h=e=>t=>{if(n(`${o}: Sending ${u}() reply`),c)return void n(`${o}: Unable to send ${u}() reply due to destroyed connection`);const r={penpal:d.Reply,id:f,resolution:e,returnValue:t};e===l.Rejected&&t instanceof Error&&(r.returnValue=g(t),r.returnValueIsError=!0);try{i.postMessage(r,a)}catch(e){if(e.name===p.DataCloneError){const t={penpal:d.Reply,id:f,resolution:l.Rejected,returnValue:g(e),returnValueIsError:!0};i.postMessage(t,a)}throw e}};new Promise((e=>e(t[u].apply(t,m)))).then(h(l.Fulfilled),h(l.Rejected))};return r.addEventListener(m.Message,u),()=>{c=!0,r.removeEventListener(m.Message,u)}})(f,e,r),a(s),c&&c.forEach((e=>{delete u[e]})),c=o.data.methodNames;const h=R(u,f,c,i,r);return a(h),u}};var x=e=>{let{iframe:t,methods:n={},childOrigin:o,timeout:r,debug:i=!1}=e;const a=(e=>(...t)=>{e&&console.log("[Penpal]",...t)})(i),s=((e,t)=>{const n=[];let o=!1;return{destroy(r){o||(o=!0,t(`${e}: Destroying connection`),n.forEach((e=>{e(r)})))},onDestroy(e){o?e():n.push(e)}}})("Parent",a),{onDestroy:c,destroy:l}=s;o||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=u.NoIframeSrc,e}})(t),o=(e=>{if(e&&y.find((t=>e.startsWith(t))))return"null";const t=document.location,n=v.exec(e);let o,r,i;return n?(o=n[1]?n[1]:t.protocol,r=n[2],i=n[4]):(o=t.protocol,r=t.hostname,i=t.port),`${o}//${r}${i&&i!==h[o]?`:${i}`:""}`})(t.src));const p="null"===o?"*":o,f=w(n),g=((e,t,n,o)=>r=>{if(!r.source)return;if("*"!==n&&r.origin!==n)return void e(`Parent: Handshake - Received SYN message from origin ${r.origin} which did not match expected origin ${n}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const i={penpal:d.SynAck,methodNames:Object.keys(t)};r.source.postMessage(i,o)})(a,f,o,p),b=$(f,o,p,s,a),C=new Promise(((e,n)=>{const o=((e,t)=>{let n;return void 0!==e&&(n=window.setTimeout((()=>{const n=new Error(`Connection timed out after ${e}ms`);n.code=u.ConnectionTimeout,t(n)}),e)),()=>{clearTimeout(n)}})(r,l),i=n=>{if(n.source===t.contentWindow&&n.data)if(n.data.penpal!==d.Syn)if(n.data.penpal!==d.Ack);else{const t=b(n);t&&(o(),e(t))}else g(n)};window.addEventListener(m.Message,i),a("Parent: Awaiting handshake"),((e,t)=>{const{destroy:n,onDestroy:o}=t,r=setInterval((()=>{e.isConnected||(clearInterval(r),n())}),6e4);o((()=>{clearInterval(r)}))})(t,s),c((e=>{window.removeEventListener(m.Message,i),e&&n(e)}))}));return{promise:C,destroy(){l()}}},_=["interactive","complete"],j=function(e,t){return new Promise((function(n){e&&"function"!=typeof e&&(t=e,e=null),t=t||window.document;var o=function(){return n(void(e&&setTimeout(e)))};-1!==_.indexOf(t.readyState)?o():t.addEventListener("DOMContentLoaded",o)}))};j.resume=function(e){return function(t){return j(e).then((function(){return t}))}};var I=function(e){var t=e.importerKey,n=e.user,o=e.metadata,r=e.onData,a=e.onRecordsInitial,s=e.onRecordEdit,c=e.importerDisplay,d=void 0===c?"modal":c,l=e.onClose,u=e.theme,p=e.batchSize,m=e.sampleFileURL,h=e.downloadExampleButton,v=void 0===h||h,y="usecsv-".concat(Math.round(1e8*Math.random()));return j().then((function(){var e=function(e,t){var n=document.getElementById("usecsv-importer-inline-wrapper");f("\n ".concat("modal"!==t&&n?"":".usecsv_container { position: fixed; top: 0px; bottom: 0; right: 0; left: 0; z-index: 100000; }","\n .usecsv_container iframe {\n width: 100%;\n height: 100%;\n position: absolute;\n border-width: 0;\n }\n .usecsv_container {\n overflow: hidden;\n overscroll-behavior-x: none;\n }\n")),document.body.insertAdjacentHTML("beforeend","<div id=".concat(e,' class="usecsv_container loading"></div>'));var o=document.createElement("iframe");o.setAttribute("src","https://app.usecsv.com/importer");var r=document.getElementById(e);return null==r||r.appendChild(o),"inline"===t&&n&&(null==n||n.appendChild(r)),o}(y,d),c=function(){var e;null===(e=document.getElementById(y))||void 0===e||e.remove()},h=x({iframe:e,methods:i(i(i(i({closeIframe:c},r?{onData:function(e){return r(e,c)}}:{}),a?{onRecordsInitial:a}:{}),s?{onRecordEdit:s}:{}),l?{onClose:l}:{})});return h.promise.then((function(e){var r;null===(r=document.getElementById(y))||void 0===r||r.classList.remove("loading"),e.setParams&&e.setParams({importerKey:t,user:n,metadata:o,importerDisplay:d,theme:u,batchSize:p,sampleFileURL:m,downloadExampleButton:v})})),h}))},D=n.default.extend({name:"usecsv-button",props:{importerKey:{},user:{},metadata:{},onData:{},importerDisplay:{},onRecordsInitial:{},onRecordEdit:{},onClose:{},theme:{},batchSize:{},sampleFileURL:{},downloadExampleButton:{}},data:function(){return{hasSlot:!!this.$slots.default}},methods:{openModal:function(){I({importerKey:this.importerKey,user:this.user,metadata:this.metadata,onData:this.onData,importerDisplay:this.importerDisplay,onRecordsInitial:this.onRecordsInitial,onRecordEdit:this.onRecordEdit,onClose:this.onClose,theme:this.theme,batchSize:this.batchSize,sampleFileURL:this.sampleFileURL,downloadExampleButton:this.downloadExampleButton})},hasScopedSlot:function(){return"normalized"===(this.$scopedSlots.default&&this.$scopedSlots.default.name)}}});function A(e,t,n,o,r,i,a,s,c,d){"boolean"!=typeof a&&(c=s,s=a,a=!1);const l="function"==typeof n?n.options:n;let u;if(e&&e.render&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,r&&(l.functional=!0)),o&&(l._scopeId=o),i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,c(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},l._ssrRegister=u):t&&(u=a?function(e){t.call(this,d(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),u)if(l.functional){const e=l.render;l.render=function(t,n){return u.call(n),e(t,n)}}else{const e=l.beforeCreate;l.beforeCreate=e?[].concat(e,u):[u]}return n}const M="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function O(e){return(e,t)=>function(e,t){const n=M?t.media||"default":e,o=k[n]||(k[n]={ids:new Set,styles:[]});if(!o.ids.has(e)){o.ids.add(e);let n=t.source;if(t.map&&(n+="\n/*# sourceURL="+t.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),o.element||(o.element=document.createElement("style"),o.element.type="text/css",t.media&&o.element.setAttribute("media",t.media),void 0===N&&(N=document.head||document.getElementsByTagName("head")[0]),N.appendChild(o.element)),"styleSheet"in o.element)o.styles.push(n),o.element.styleSheet.cssText=o.styles.filter(Boolean).join("\n");else{const e=o.ids.size-1,t=document.createTextNode(n),r=o.element.childNodes;r[e]&&o.element.removeChild(r[e]),r.length?o.element.insertBefore(t,r[e]):o.element.appendChild(t)}}}(e,t)}let N;const k={};var L=A({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"usecsv"},[e.hasScopedSlot()?n("div",[e._t("default",null,{openModal:e.openModal})],2):n("div",[n("button",{attrs:{type:"button",id:"usecsv-button"},on:{click:e.openModal}},[e._t("default",(function(){return[e._v(" open usecsv ")]}))],2)])])},staticRenderFns:[]},(function(e){e&&e("data-v-2d3aaabe_0",{source:"#usecsv-button[data-v-2d3aaabe]{background-color:#fff;color:#000;border:2px solid #000;border-radius:6px;padding:10px 15px;text-align:center;font-size:16px;cursor:pointer}",map:void 0,media:void 0})}),D,"data-v-2d3aaabe",false,undefined,!1,O,void 0,void 0),F=function(){var e=L;return e.install=function(t){t.component("usecsv-button",e)},e}(),T=Object.freeze({__proto__:null,default:F});return Object.entries(T).forEach((function(e){var t=o(e,2),n=t[0],r=t[1];"default"!==n&&(F[n]=r)})),F}(Vue);
|
package/dist/UseCSVButton.ssr.js
CHANGED
|
@@ -1,41 +1,36 @@
|
|
|
1
|
-
'use strict';var Vue=require('vue');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var Vue__default=/*#__PURE__*/_interopDefaultLegacy(Vue);function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (_i == null) return;
|
|
13
|
-
var _arr = [];
|
|
14
|
-
var _n = true;
|
|
15
|
-
var _d = false;
|
|
16
|
-
|
|
17
|
-
var _s, _e;
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
21
|
-
_arr.push(_s.value);
|
|
22
|
-
|
|
23
|
-
if (i && _arr.length === i) break;
|
|
24
|
-
}
|
|
25
|
-
} catch (err) {
|
|
26
|
-
_d = true;
|
|
27
|
-
_e = err;
|
|
28
|
-
} finally {
|
|
1
|
+
'use strict';var Vue=require('vue');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var Vue__default=/*#__PURE__*/_interopDefaultLegacy(Vue);function _iterableToArrayLimit(arr, i) {
|
|
2
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3
|
+
if (null != _i) {
|
|
4
|
+
var _s,
|
|
5
|
+
_e,
|
|
6
|
+
_x,
|
|
7
|
+
_r,
|
|
8
|
+
_arr = [],
|
|
9
|
+
_n = !0,
|
|
10
|
+
_d = !1;
|
|
29
11
|
try {
|
|
30
|
-
if (
|
|
12
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
13
|
+
if (Object(_i) !== _i) return;
|
|
14
|
+
_n = !1;
|
|
15
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
16
|
+
} catch (err) {
|
|
17
|
+
_d = !0, _e = err;
|
|
31
18
|
} finally {
|
|
32
|
-
|
|
19
|
+
try {
|
|
20
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
21
|
+
} finally {
|
|
22
|
+
if (_d) throw _e;
|
|
23
|
+
}
|
|
33
24
|
}
|
|
25
|
+
return _arr;
|
|
34
26
|
}
|
|
35
|
-
|
|
36
|
-
return _arr;
|
|
37
27
|
}
|
|
38
|
-
|
|
28
|
+
function _slicedToArray(arr, i) {
|
|
29
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
30
|
+
}
|
|
31
|
+
function _arrayWithHoles(arr) {
|
|
32
|
+
if (Array.isArray(arr)) return arr;
|
|
33
|
+
}
|
|
39
34
|
function _unsupportedIterableToArray(o, minLen) {
|
|
40
35
|
if (!o) return;
|
|
41
36
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -44,24 +39,20 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
44
39
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
45
40
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
46
41
|
}
|
|
47
|
-
|
|
48
42
|
function _arrayLikeToArray(arr, len) {
|
|
49
43
|
if (len == null || len > arr.length) len = arr.length;
|
|
50
|
-
|
|
51
44
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
52
|
-
|
|
53
45
|
return arr2;
|
|
54
46
|
}
|
|
55
|
-
|
|
56
47
|
function _nonIterableRest() {
|
|
57
48
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
58
49
|
}/*!
|
|
59
|
-
* @usecsv/js v0.
|
|
50
|
+
* @usecsv/js v0.13.1
|
|
60
51
|
* (c) layercode
|
|
61
52
|
* Released under the MIT License.
|
|
62
53
|
*/
|
|
63
54
|
|
|
64
|
-
|
|
55
|
+
/******************************************************************************
|
|
65
56
|
Copyright (c) Microsoft Corporation.
|
|
66
57
|
|
|
67
58
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -269,14 +260,14 @@ const deserializeError = (obj) => {
|
|
|
269
260
|
* Listens for "call" messages coming from the remote, executes the corresponding method, and
|
|
270
261
|
* responds with the return value.
|
|
271
262
|
*/
|
|
272
|
-
var connectCallReceiver = (info,
|
|
263
|
+
var connectCallReceiver = (info, serializedMethods, log) => {
|
|
273
264
|
const { localName, local, remote, originForSending, originForReceiving, } = info;
|
|
274
265
|
let destroyed = false;
|
|
275
266
|
const handleMessageEvent = (event) => {
|
|
276
267
|
if (event.source !== remote || event.data.penpal !== MessageType.Call) {
|
|
277
268
|
return;
|
|
278
269
|
}
|
|
279
|
-
if (event.origin !== originForReceiving) {
|
|
270
|
+
if (originForReceiving !== '*' && event.origin !== originForReceiving) {
|
|
280
271
|
log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);
|
|
281
272
|
return;
|
|
282
273
|
}
|
|
@@ -326,7 +317,7 @@ var connectCallReceiver = (info, methods, log) => {
|
|
|
326
317
|
}
|
|
327
318
|
};
|
|
328
319
|
};
|
|
329
|
-
new Promise((resolve) => resolve(
|
|
320
|
+
new Promise((resolve) => resolve(serializedMethods[methodName].apply(serializedMethods, args))).then(createPromiseHandler(Resolution.Fulfilled), createPromiseHandler(Resolution.Rejected));
|
|
330
321
|
};
|
|
331
322
|
local.addEventListener(NativeEventType.Message, handleMessageEvent);
|
|
332
323
|
return () => {
|
|
@@ -341,18 +332,86 @@ let id = 0;
|
|
|
341
332
|
*/
|
|
342
333
|
var generateId = () => ++id;
|
|
343
334
|
|
|
335
|
+
const KEY_PATH_DELIMITER = '.';
|
|
336
|
+
const keyPathToSegments = (keyPath) => keyPath ? keyPath.split(KEY_PATH_DELIMITER) : [];
|
|
337
|
+
const segmentsToKeyPath = (segments) => segments.join(KEY_PATH_DELIMITER);
|
|
338
|
+
const createKeyPath = (key, prefix) => {
|
|
339
|
+
const segments = keyPathToSegments(prefix || '');
|
|
340
|
+
segments.push(key);
|
|
341
|
+
return segmentsToKeyPath(segments);
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* Given a `keyPath`, set it to be `value` on `subject`, creating any intermediate
|
|
345
|
+
* objects along the way.
|
|
346
|
+
*
|
|
347
|
+
* @param {Object} subject The object on which to set value.
|
|
348
|
+
* @param {string} keyPath The key path at which to set value.
|
|
349
|
+
* @param {Object} value The value to store at the given key path.
|
|
350
|
+
* @returns {Object} Updated subject.
|
|
351
|
+
*/
|
|
352
|
+
const setAtKeyPath = (subject, keyPath, value) => {
|
|
353
|
+
const segments = keyPathToSegments(keyPath);
|
|
354
|
+
segments.reduce((prevSubject, key, idx) => {
|
|
355
|
+
if (typeof prevSubject[key] === 'undefined') {
|
|
356
|
+
prevSubject[key] = {};
|
|
357
|
+
}
|
|
358
|
+
if (idx === segments.length - 1) {
|
|
359
|
+
prevSubject[key] = value;
|
|
360
|
+
}
|
|
361
|
+
return prevSubject[key];
|
|
362
|
+
}, subject);
|
|
363
|
+
return subject;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* Given a dictionary of (nested) keys to function, flatten them to a map
|
|
367
|
+
* from key path to function.
|
|
368
|
+
*
|
|
369
|
+
* @param {Object} methods The (potentially nested) object to serialize.
|
|
370
|
+
* @param {string} prefix A string with which to prefix entries. Typically not intended to be used by consumers.
|
|
371
|
+
* @returns {Object} An map from key path in `methods` to functions.
|
|
372
|
+
*/
|
|
373
|
+
const serializeMethods = (methods, prefix) => {
|
|
374
|
+
const flattenedMethods = {};
|
|
375
|
+
Object.keys(methods).forEach((key) => {
|
|
376
|
+
const value = methods[key];
|
|
377
|
+
const keyPath = createKeyPath(key, prefix);
|
|
378
|
+
if (typeof value === 'object') {
|
|
379
|
+
// Recurse into any nested children.
|
|
380
|
+
Object.assign(flattenedMethods, serializeMethods(value, keyPath));
|
|
381
|
+
}
|
|
382
|
+
if (typeof value === 'function') {
|
|
383
|
+
// If we've found a method, expose it.
|
|
384
|
+
flattenedMethods[keyPath] = value;
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
return flattenedMethods;
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Given a map of key paths to functions, unpack the key paths to an object.
|
|
391
|
+
*
|
|
392
|
+
* @param {Object} flattenedMethods A map of key paths to functions to unpack.
|
|
393
|
+
* @returns {Object} A (potentially nested) map of functions.
|
|
394
|
+
*/
|
|
395
|
+
const deserializeMethods = (flattenedMethods) => {
|
|
396
|
+
const methods = {};
|
|
397
|
+
for (const keyPath in flattenedMethods) {
|
|
398
|
+
setAtKeyPath(methods, keyPath, flattenedMethods[keyPath]);
|
|
399
|
+
}
|
|
400
|
+
return methods;
|
|
401
|
+
};
|
|
402
|
+
|
|
344
403
|
/**
|
|
345
404
|
* Augments an object with methods that match those defined by the remote. When these methods are
|
|
346
405
|
* called, a "call" message will be sent to the remote, the remote's corresponding method will be
|
|
347
406
|
* executed, and the method's return value will be returned via a message.
|
|
348
407
|
* @param {Object} callSender Sender object that should be augmented with methods.
|
|
349
408
|
* @param {Object} info Information about the local and remote windows.
|
|
350
|
-
* @param {Array}
|
|
409
|
+
* @param {Array} methodKeyPaths Key paths of methods available to be called on the remote.
|
|
351
410
|
* @param {Promise} destructionPromise A promise resolved when destroy() is called on the penpal
|
|
352
411
|
* connection.
|
|
353
412
|
* @returns {Object} The call sender object with methods that may be called.
|
|
354
413
|
*/
|
|
355
|
-
var connectCallSender = (callSender, info,
|
|
414
|
+
var connectCallSender = (callSender, info, methodKeyPaths, destroyConnection, log) => {
|
|
356
415
|
const { localName, local, remote, originForSending, originForReceiving, } = info;
|
|
357
416
|
let destroyed = false;
|
|
358
417
|
log(`${localName}: Connecting call sender`);
|
|
@@ -393,7 +452,8 @@ var connectCallSender = (callSender, info, methodNames, destroyConnection, log)
|
|
|
393
452
|
event.data.id !== id) {
|
|
394
453
|
return;
|
|
395
454
|
}
|
|
396
|
-
if (
|
|
455
|
+
if (originForReceiving !== '*' &&
|
|
456
|
+
event.origin !== originForReceiving) {
|
|
397
457
|
log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);
|
|
398
458
|
return;
|
|
399
459
|
}
|
|
@@ -417,10 +477,14 @@ var connectCallSender = (callSender, info, methodNames, destroyConnection, log)
|
|
|
417
477
|
});
|
|
418
478
|
};
|
|
419
479
|
};
|
|
420
|
-
|
|
421
|
-
|
|
480
|
+
// Wrap each method in a proxy which sends it to the corresponding receiver.
|
|
481
|
+
const flattenedMethods = methodKeyPaths.reduce((api, name) => {
|
|
482
|
+
api[name] = createMethodProxy(name);
|
|
422
483
|
return api;
|
|
423
|
-
},
|
|
484
|
+
}, {});
|
|
485
|
+
// Unpack the structure of the provided methods object onto the CallSender, exposing
|
|
486
|
+
// the methods in the same shape they were provided.
|
|
487
|
+
Object.assign(callSender, deserializeMethods(flattenedMethods));
|
|
424
488
|
return () => {
|
|
425
489
|
destroyed = true;
|
|
426
490
|
};
|
|
@@ -429,7 +493,7 @@ var connectCallSender = (callSender, info, methodNames, destroyConnection, log)
|
|
|
429
493
|
/**
|
|
430
494
|
* Handles an ACK handshake message.
|
|
431
495
|
*/
|
|
432
|
-
var handleAckMessageFactory = (
|
|
496
|
+
var handleAckMessageFactory = (serializedMethods, childOrigin, originForSending, destructor, log) => {
|
|
433
497
|
const { destroy, onDestroy } = destructor;
|
|
434
498
|
let destroyCallReceiver;
|
|
435
499
|
let receiverMethodNames;
|
|
@@ -439,7 +503,7 @@ var handleAckMessageFactory = (methods, childOrigin, originForSending, destructo
|
|
|
439
503
|
// latest provided by the child.
|
|
440
504
|
const callSender = {};
|
|
441
505
|
return (event) => {
|
|
442
|
-
if (event.origin !== childOrigin) {
|
|
506
|
+
if (childOrigin !== '*' && event.origin !== childOrigin) {
|
|
443
507
|
log(`Parent: Handshake - Received ACK message from origin ${event.origin} which did not match expected origin ${childOrigin}`);
|
|
444
508
|
return;
|
|
445
509
|
}
|
|
@@ -456,7 +520,7 @@ var handleAckMessageFactory = (methods, childOrigin, originForSending, destructo
|
|
|
456
520
|
if (destroyCallReceiver) {
|
|
457
521
|
destroyCallReceiver();
|
|
458
522
|
}
|
|
459
|
-
destroyCallReceiver = connectCallReceiver(info,
|
|
523
|
+
destroyCallReceiver = connectCallReceiver(info, serializedMethods, log);
|
|
460
524
|
onDestroy(destroyCallReceiver);
|
|
461
525
|
// If the child reconnected, we need to remove the methods from the
|
|
462
526
|
// previous call receiver off the sender.
|
|
@@ -475,16 +539,23 @@ var handleAckMessageFactory = (methods, childOrigin, originForSending, destructo
|
|
|
475
539
|
/**
|
|
476
540
|
* Handles a SYN handshake message.
|
|
477
541
|
*/
|
|
478
|
-
var handleSynMessageFactory = (log,
|
|
542
|
+
var handleSynMessageFactory = (log, serializedMethods, childOrigin, originForSending) => {
|
|
479
543
|
return (event) => {
|
|
480
|
-
|
|
544
|
+
// Under specific timing circumstances, we can receive an event
|
|
545
|
+
// whose source is null. This seems to happen when the child iframe is
|
|
546
|
+
// removed from the DOM about the same time it has sent the SYN event.
|
|
547
|
+
// https://github.com/Aaronius/penpal/issues/85
|
|
548
|
+
if (!event.source) {
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
if (childOrigin !== '*' && event.origin !== childOrigin) {
|
|
481
552
|
log(`Parent: Handshake - Received SYN message from origin ${event.origin} which did not match expected origin ${childOrigin}`);
|
|
482
553
|
return;
|
|
483
554
|
}
|
|
484
555
|
log('Parent: Handshake - Received SYN, responding with SYN-ACK');
|
|
485
556
|
const synAckMessage = {
|
|
486
557
|
penpal: MessageType.SynAck,
|
|
487
|
-
methodNames: Object.keys(
|
|
558
|
+
methodNames: Object.keys(serializedMethods),
|
|
488
559
|
};
|
|
489
560
|
event.source.postMessage(synAckMessage, originForSending);
|
|
490
561
|
};
|
|
@@ -555,8 +626,9 @@ var connectToChild = (options) => {
|
|
|
555
626
|
// must post messages with "*" as targetOrigin when sending messages.
|
|
556
627
|
// https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#Using_window.postMessage_in_extensions
|
|
557
628
|
const originForSending = childOrigin === 'null' ? '*' : childOrigin;
|
|
558
|
-
const
|
|
559
|
-
const
|
|
629
|
+
const serializedMethods = serializeMethods(methods);
|
|
630
|
+
const handleSynMessage = handleSynMessageFactory(log, serializedMethods, childOrigin, originForSending);
|
|
631
|
+
const handleAckMessage = handleAckMessageFactory(serializedMethods, childOrigin, originForSending, destructor, log);
|
|
560
632
|
const promise = new Promise((resolve, reject) => {
|
|
561
633
|
const stopConnectionTimeout = startConnectionTimeout(timeout, destroy);
|
|
562
634
|
const handleMessage = (event) => {
|
|
@@ -656,7 +728,7 @@ var insertIframe = function (id, importerDisplay) {
|
|
|
656
728
|
return iframe;
|
|
657
729
|
};
|
|
658
730
|
var useCsvPlugin = function (_a) {
|
|
659
|
-
var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit, _b = _a.importerDisplay, importerDisplay = _b === void 0 ? "modal" : _b, onClose = _a.onClose, theme = _a.theme;
|
|
731
|
+
var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit, _b = _a.importerDisplay, importerDisplay = _b === void 0 ? "modal" : _b, onClose = _a.onClose, theme = _a.theme, batchSize = _a.batchSize, sampleFileURL = _a.sampleFileURL, _c = _a.downloadExampleButton, downloadExampleButton = _c === void 0 ? true : _c;
|
|
660
732
|
var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
|
|
661
733
|
return whenDomReady().then(function () {
|
|
662
734
|
var iframe = insertIframe(id, importerDisplay);
|
|
@@ -688,7 +760,18 @@ var useCsvPlugin = function (_a) {
|
|
|
688
760
|
var _a;
|
|
689
761
|
(_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.classList.remove("loading");
|
|
690
762
|
// eslint-disable-next-line dot-notation
|
|
691
|
-
child["setParams"] &&
|
|
763
|
+
child["setParams"] &&
|
|
764
|
+
// eslint-disable-next-line dot-notation
|
|
765
|
+
child["setParams"]({
|
|
766
|
+
importerKey: importerKey,
|
|
767
|
+
user: user,
|
|
768
|
+
metadata: metadata,
|
|
769
|
+
importerDisplay: importerDisplay,
|
|
770
|
+
theme: theme,
|
|
771
|
+
batchSize: batchSize,
|
|
772
|
+
sampleFileURL: sampleFileURL,
|
|
773
|
+
downloadExampleButton: downloadExampleButton,
|
|
774
|
+
});
|
|
692
775
|
});
|
|
693
776
|
return iframeConnection;
|
|
694
777
|
});
|
|
@@ -704,7 +787,10 @@ var useCsvPlugin = function (_a) {
|
|
|
704
787
|
onRecordsInitial: {},
|
|
705
788
|
onRecordEdit: {},
|
|
706
789
|
onClose: {},
|
|
707
|
-
theme: {}
|
|
790
|
+
theme: {},
|
|
791
|
+
batchSize: {},
|
|
792
|
+
sampleFileURL: {},
|
|
793
|
+
downloadExampleButton: {}
|
|
708
794
|
},
|
|
709
795
|
data: function data() {
|
|
710
796
|
return {
|
|
@@ -722,7 +808,10 @@ var useCsvPlugin = function (_a) {
|
|
|
722
808
|
onRecordsInitial: this.onRecordsInitial,
|
|
723
809
|
onRecordEdit: this.onRecordEdit,
|
|
724
810
|
onClose: this.onClose,
|
|
725
|
-
theme: this.theme
|
|
811
|
+
theme: this.theme,
|
|
812
|
+
batchSize: this.batchSize,
|
|
813
|
+
sampleFileURL: this.sampleFileURL,
|
|
814
|
+
downloadExampleButton: this.downloadExampleButton
|
|
726
815
|
});
|
|
727
816
|
},
|
|
728
817
|
hasScopedSlot: function hasScopedSlot() {
|
|
@@ -844,44 +933,36 @@ function renderStyles(styles) {
|
|
|
844
933
|
return css;
|
|
845
934
|
}/* script */
|
|
846
935
|
var __vue_script__ = script;
|
|
847
|
-
/* template */
|
|
848
936
|
|
|
937
|
+
/* template */
|
|
849
938
|
var __vue_render__ = function __vue_render__() {
|
|
850
939
|
var _vm = this;
|
|
851
|
-
|
|
852
940
|
var _h = _vm.$createElement;
|
|
853
|
-
|
|
854
941
|
var _c = _vm._self._c || _h;
|
|
855
|
-
|
|
856
942
|
return _c('div', {
|
|
857
943
|
staticClass: "usecsv"
|
|
858
|
-
}, [_vm.hasScopedSlot() ? _vm._ssrNode("<div data-v-
|
|
944
|
+
}, [_vm.hasScopedSlot() ? _vm._ssrNode("<div data-v-2d3aaabe>", "</div>", [_vm._t("default", null, {
|
|
859
945
|
"openModal": _vm.openModal
|
|
860
|
-
})], 2) : _vm._ssrNode("<div data-v-
|
|
946
|
+
})], 2) : _vm._ssrNode("<div data-v-2d3aaabe>", "</div>", [_vm._ssrNode("<button type=\"button\" id=\"usecsv-button\" data-v-2d3aaabe>", "</button>", [_vm._t("default", function () {
|
|
861
947
|
return [_vm._v(" open usecsv ")];
|
|
862
948
|
})], 2)])]);
|
|
863
949
|
};
|
|
864
|
-
|
|
865
950
|
var __vue_staticRenderFns__ = [];
|
|
866
|
-
/* style */
|
|
867
951
|
|
|
952
|
+
/* style */
|
|
868
953
|
var __vue_inject_styles__ = function __vue_inject_styles__(inject) {
|
|
869
954
|
if (!inject) return;
|
|
870
|
-
inject("data-v-
|
|
871
|
-
source: "#usecsv-button[data-v-
|
|
955
|
+
inject("data-v-2d3aaabe_0", {
|
|
956
|
+
source: "#usecsv-button[data-v-2d3aaabe]{background-color:#fff;color:#000;border:2px solid #000;border-radius:6px;padding:10px 15px;text-align:center;font-size:16px;cursor:pointer}",
|
|
872
957
|
map: undefined,
|
|
873
958
|
media: undefined
|
|
874
959
|
});
|
|
875
960
|
};
|
|
876
961
|
/* scoped */
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
var __vue_scope_id__ = "data-v-79d7f16a";
|
|
962
|
+
var __vue_scope_id__ = "data-v-2d3aaabe";
|
|
880
963
|
/* module identifier */
|
|
881
|
-
|
|
882
|
-
var __vue_module_identifier__ = "data-v-79d7f16a";
|
|
964
|
+
var __vue_module_identifier__ = "data-v-2d3aaabe";
|
|
883
965
|
/* functional template */
|
|
884
|
-
|
|
885
966
|
var __vue_is_functional_template__ = false;
|
|
886
967
|
/* style inject shadow dom */
|
|
887
968
|
|
|
@@ -889,31 +970,33 @@ var __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
|
889
970
|
render: __vue_render__,
|
|
890
971
|
staticRenderFns: __vue_staticRenderFns__
|
|
891
972
|
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, createInjectorSSR, undefined);
|
|
892
|
-
|
|
893
973
|
var component$1 = __vue_component__;// Import vue component
|
|
894
974
|
|
|
975
|
+
// Define typescript interfaces for installable component
|
|
976
|
+
|
|
895
977
|
// Default export is installable instance of component.
|
|
896
978
|
// IIFE injects install function into component, allowing component
|
|
897
979
|
// to be registered via Vue.use() as well as Vue.component(),
|
|
898
980
|
var component = /*#__PURE__*/(function () {
|
|
899
981
|
// Assign InstallableComponent type
|
|
900
|
-
var installable = component$1;
|
|
982
|
+
var installable = component$1;
|
|
901
983
|
|
|
984
|
+
// Attach install function executed by Vue.use()
|
|
902
985
|
installable.install = function (Vue) {
|
|
903
986
|
Vue.component('usecsv-button', installable);
|
|
904
987
|
};
|
|
905
|
-
|
|
906
988
|
return installable;
|
|
907
|
-
})();
|
|
989
|
+
})();
|
|
990
|
+
|
|
991
|
+
// It's possible to expose named exports when writing components that can
|
|
908
992
|
// also be used as directives, etc. - eg. import { RollupDemoDirective } from 'rollup-demo';
|
|
909
993
|
// export const RollupDemoDirective = directive;
|
|
910
|
-
var namedExports=/*#__PURE__*/Object.freeze({__proto__:null,'default':component});//
|
|
994
|
+
var namedExports=/*#__PURE__*/Object.freeze({__proto__:null,'default':component});// Attach named exports directly to component. IIFE/CJS will
|
|
995
|
+
// only expose one global var, with named exports exposed as properties of
|
|
911
996
|
// that global var (eg. plugin.namedExport)
|
|
912
|
-
|
|
913
997
|
Object.entries(namedExports).forEach(function (_ref) {
|
|
914
998
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
999
|
+
exportName = _ref2[0],
|
|
1000
|
+
exported = _ref2[1];
|
|
918
1001
|
if (exportName !== 'default') component[exportName] = exported;
|
|
919
1002
|
});module.exports=component;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Vue from "vue";
|
|
2
|
-
declare const _default: import("vue/types/vue").ExtendedVue<Vue, {
|
|
2
|
+
declare const _default: import("vue/types/vue").ExtendedVue<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, any>>, {
|
|
3
3
|
hasSlot: boolean;
|
|
4
4
|
}, {
|
|
5
5
|
openModal: () => void;
|
|
@@ -19,5 +19,8 @@ declare const _default: import("vue/types/vue").ExtendedVue<Vue, {
|
|
|
19
19
|
importerDisplay?: "inline" | "modal" | undefined;
|
|
20
20
|
onClose?: (() => void) | undefined;
|
|
21
21
|
theme?: import("@usecsv/js/build/types/lib/types").ThemeType | undefined;
|
|
22
|
-
|
|
22
|
+
batchSize?: number | undefined;
|
|
23
|
+
sampleFileURL?: string | undefined;
|
|
24
|
+
downloadExampleButton?: boolean | undefined;
|
|
25
|
+
}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin>;
|
|
23
26
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usecsv/vuejs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.21",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/UseCSVButton.ssr.js",
|
|
6
6
|
"browser": "dist/UseCSVButton.esm.js",
|
|
@@ -24,42 +24,42 @@
|
|
|
24
24
|
"prepublishOnly": "yarn build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@usecsv/js": "^0.
|
|
27
|
+
"@usecsv/js": "^0.13.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@babel/core": "^7.
|
|
31
|
-
"@babel/preset-env": "^7.
|
|
32
|
-
"@babel/preset-typescript": "^7.
|
|
30
|
+
"@babel/core": "^7.21.8",
|
|
31
|
+
"@babel/preset-env": "^7.21.5",
|
|
32
|
+
"@babel/preset-typescript": "^7.21.5",
|
|
33
33
|
"@rollup/plugin-alias": "^3.1.2",
|
|
34
34
|
"@rollup/plugin-babel": "^5.3.0",
|
|
35
|
-
"@rollup/plugin-commonjs": "^
|
|
36
|
-
"@rollup/plugin-node-resolve": "^
|
|
37
|
-
"@rollup/plugin-replace": "^
|
|
38
|
-
"@rushstack/eslint-patch": "^1.
|
|
39
|
-
"@semantic-release/changelog": "^6.0.
|
|
35
|
+
"@rollup/plugin-commonjs": "^24.1.0",
|
|
36
|
+
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
37
|
+
"@rollup/plugin-replace": "^5.0.2",
|
|
38
|
+
"@rushstack/eslint-patch": "^1.2.0",
|
|
39
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
40
40
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
41
41
|
"@semantic-release/git": "^10.0.1",
|
|
42
42
|
"@semantic-release/github": "^8.0.7",
|
|
43
|
-
"@semantic-release/release-notes-generator": "^
|
|
44
|
-
"@vue/cli-plugin-babel": "^
|
|
45
|
-
"@vue/cli-plugin-typescript": "^
|
|
46
|
-
"@vue/cli-service": "^
|
|
43
|
+
"@semantic-release/release-notes-generator": "^11.0.1",
|
|
44
|
+
"@vue/cli-plugin-babel": "^5.0.8",
|
|
45
|
+
"@vue/cli-plugin-typescript": "^5.0.8",
|
|
46
|
+
"@vue/cli-service": "^5.0.8",
|
|
47
47
|
"@vue/eslint-config-typescript": "^10.0.0",
|
|
48
48
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
|
49
49
|
"cross-env": "^7.0.3",
|
|
50
|
-
"eslint": "^8.
|
|
50
|
+
"eslint": "^8.39.0",
|
|
51
51
|
"eslint-plugin-vue": "^8.4.1",
|
|
52
|
-
"minimist": "^1.2.
|
|
52
|
+
"minimist": "^1.2.8",
|
|
53
53
|
"rimraf": "^3.0.2",
|
|
54
54
|
"rollup": "^2.52.8",
|
|
55
55
|
"rollup-plugin-terser": "^7.0.2",
|
|
56
|
-
"rollup-plugin-typescript2": "^0.
|
|
56
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
57
57
|
"rollup-plugin-vue": "^5.1.9",
|
|
58
|
-
"semantic-release": "^
|
|
59
|
-
"ttypescript": "^1.5.
|
|
60
|
-
"typescript": "
|
|
58
|
+
"semantic-release": "^21.0.2",
|
|
59
|
+
"ttypescript": "^1.5.15",
|
|
60
|
+
"typescript": "<4.8",
|
|
61
61
|
"vue": "^2.6.14",
|
|
62
|
-
"vue-template-compiler": "^2.
|
|
62
|
+
"vue-template-compiler": "^2.7.14"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"vue": "^2.6.14"
|
package/src/UseCSVButton.vue
CHANGED
|
@@ -21,6 +21,9 @@ export default /*#__PURE__*/ Vue.extend<
|
|
|
21
21
|
onRecordEdit: {},
|
|
22
22
|
onClose: {},
|
|
23
23
|
theme: {},
|
|
24
|
+
batchSize: {},
|
|
25
|
+
sampleFileURL: {},
|
|
26
|
+
downloadExampleButton: {},
|
|
24
27
|
},
|
|
25
28
|
data() {
|
|
26
29
|
return {
|
|
@@ -39,13 +42,13 @@ export default /*#__PURE__*/ Vue.extend<
|
|
|
39
42
|
onRecordEdit: this.onRecordEdit,
|
|
40
43
|
onClose: this.onClose,
|
|
41
44
|
theme: this.theme,
|
|
45
|
+
batchSize: this.batchSize,
|
|
46
|
+
sampleFileURL: this.sampleFileURL,
|
|
47
|
+
downloadExampleButton: this.downloadExampleButton,
|
|
42
48
|
});
|
|
43
49
|
},
|
|
44
50
|
hasScopedSlot(): boolean {
|
|
45
|
-
return (
|
|
46
|
-
(this.$scopedSlots.default && this.$scopedSlots.default.name) ===
|
|
47
|
-
"normalized"
|
|
48
|
-
);
|
|
51
|
+
return (this.$scopedSlots.default && this.$scopedSlots.default.name) === "normalized";
|
|
49
52
|
},
|
|
50
53
|
},
|
|
51
54
|
});
|
package/CHANGELOG.md
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
## [1.1.17](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.16...v1.1.17) (2022-12-12)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* update "@usecsv/js", Overwrite theme variables in importer params ([73a81d3](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/73a81d301f706c615bd777d8800fafdf58725d58))
|
|
7
|
-
|
|
8
|
-
## [1.1.16](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.15...v1.1.16) (2022-11-02)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Bug Fixes
|
|
12
|
-
|
|
13
|
-
* update "@usecsv/js", update validation hooks level type ([98cd038](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/98cd038e0e47e93fdf4b0b47604b39cfca2803a3))
|
|
14
|
-
|
|
15
|
-
## [1.1.15](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.14...v1.1.15) (2022-10-25)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Bug Fixes
|
|
19
|
-
|
|
20
|
-
* update "@usecsv/js", support onClose prop in usecsv plugin ([a8f3478](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/a8f3478bd6495320f4697aab99ed978441c2ebe6))
|
|
21
|
-
|
|
22
|
-
## [1.1.14](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.13...v1.1.14) (2022-10-24)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### Bug Fixes
|
|
26
|
-
|
|
27
|
-
* update "@usecsv/js", remove importer modal margin in inline display ([60f396a](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/60f396ab6f2ded91827de7a92ae9c654cb3804f8))
|
|
28
|
-
|
|
29
|
-
## [1.1.13](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.12...v1.1.13) (2022-10-24)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
### Bug Fixes
|
|
33
|
-
|
|
34
|
-
* add missing onData prop ([de179a8](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/de179a8fe868418063c6297c42ece3a3da9eae58))
|
|
35
|
-
|
|
36
|
-
## [1.1.12](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.11...v1.1.12) (2022-10-23)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
### Bug Fixes
|
|
40
|
-
|
|
41
|
-
* add missing prop ([2fc5d16](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/2fc5d168fdefae6d264e859a84debf29b7ec1922))
|
|
42
|
-
|
|
43
|
-
## [1.1.11](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.10...v1.1.11) (2022-10-23)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### Bug Fixes
|
|
47
|
-
|
|
48
|
-
* update "@usecsv/js", support inline importer modal ([76ae016](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/76ae016a800c544b7901d070cb3520c08c53c832))
|
|
49
|
-
|
|
50
|
-
## [1.1.10](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.9...v1.1.10) (2022-10-06)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
### Bug Fixes
|
|
54
|
-
|
|
55
|
-
* update "@usecsv/js", update validation hooks response types ([62f3a9b](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/62f3a9b65ff4bcf06b8e5a45a6249f3343e8350c))
|
|
56
|
-
|
|
57
|
-
## [1.1.9](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.8...v1.1.9) (2022-08-30)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### Bug Fixes
|
|
61
|
-
|
|
62
|
-
* ci publish ([129f5e2](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/129f5e27dbdbd6c3c0cd99b649772b4d39ba1c02))
|
|
63
|
-
|
|
64
|
-
## [1.1.8](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.7...v1.1.8) (2022-08-17)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
### Bug Fixes
|
|
68
|
-
|
|
69
|
-
* update \"@usecsv/js\" , fix types ([0b46f0e](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/0b46f0eecbf44e9b86306997b78c962c2032d818))
|
|
70
|
-
|
|
71
|
-
## [1.1.7](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.6...v1.1.7) (2022-08-15)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
### Bug Fixes
|
|
75
|
-
|
|
76
|
-
* update "@usecsv/js" , update data hooks ([bd1c69c](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/bd1c69c7e58548128683646a70902f989f687580))
|
|
77
|
-
|
|
78
|
-
## [1.1.6](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.5...v1.1.6) (2022-05-12)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
### Bug Fixes
|
|
82
|
-
|
|
83
|
-
* update \"@usecsv/js\" , to fix close fn ([924a48a](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/924a48ab69a95247340cd5b8a3a944e67b03fe27))
|
|
84
|
-
|
|
85
|
-
## [1.1.5](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.4...v1.1.5) (2022-04-25)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
### Bug Fixes
|
|
89
|
-
|
|
90
|
-
* update "@usecsv/js" , to use close function param ([8bbb8f2](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/8bbb8f232fe6a818bfedec0c55acafacb6e0b7b8))
|
|
91
|
-
|
|
92
|
-
## [1.1.4](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.3...v1.1.4) (2022-04-24)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
### Bug Fixes
|
|
96
|
-
|
|
97
|
-
* update usecsv core package ([3b10aaa](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/3b10aaa4859ef34fa6c9d3d97586bd0b328e807f))
|
|
98
|
-
|
|
99
|
-
## [1.1.3](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.2...v1.1.3) (2022-04-06)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
### Bug Fixes
|
|
103
|
-
|
|
104
|
-
* allow usecsv core patch updates ([ed1982e](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/ed1982ed12528c1a6c4355eb5dcefb680e0f022e))
|
|
105
|
-
|
|
106
|
-
## [1.1.2](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.1...v1.1.2) (2022-03-09)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
### Bug Fixes
|
|
110
|
-
|
|
111
|
-
* update dependencies ([3814b7e](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/3814b7e7b3e9bf81da78782fd5d1a224c7502ffc))
|
|
112
|
-
|
|
113
|
-
## [1.1.1](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.1.0...v1.1.1) (2022-03-07)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
### Bug Fixes
|
|
117
|
-
|
|
118
|
-
* dependencies ([2ef2dfd](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/2ef2dfd1279ffb0d4e549c9803943a4c85cf9c4b))
|
|
119
|
-
|
|
120
|
-
# [1.1.0](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.0.3...v1.1.0) (2022-03-07)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
### Features
|
|
124
|
-
|
|
125
|
-
* add onData callback ([4c5830d](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/4c5830debdb8e1d98ec23f7b8c0ec7a8ad4a6bfe))
|
|
126
|
-
|
|
127
|
-
## [1.0.3](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.0.2...v1.0.3) (2022-02-15)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
### Bug Fixes
|
|
131
|
-
|
|
132
|
-
* update props ([a8c47a1](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/a8c47a1d2743ac2ea41c3f590a60080cd92634af))
|
|
133
|
-
|
|
134
|
-
## [1.0.2](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.0.1...v1.0.2) (2022-02-15)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
### Bug Fixes
|
|
138
|
-
|
|
139
|
-
* typo ([a09307d](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/a09307d09ec88c6cac0dbf92274e68e82b8677b9))
|
|
140
|
-
|
|
141
|
-
## [1.0.1](https://github.com/layercodedev/usecsv-vuejs-plugin/compare/v1.0.0...v1.0.1) (2022-02-14)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
### Bug Fixes
|
|
145
|
-
|
|
146
|
-
* rename component to UseCSVButton ([fe32bf6](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/fe32bf678a14b08112370f907088c93433fcde59))
|
|
147
|
-
|
|
148
|
-
# 1.0.0 (2022-02-14)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### Features
|
|
152
|
-
|
|
153
|
-
* usecsv plugin ([330f046](https://github.com/layercodedev/usecsv-vuejs-plugin/commit/330f046d551eee9b2caf32ded1a173cd594e5e1f))
|