@progress/kendo-spreadsheet-common 1.1.2-develop.2 → 1.1.2-develop.4
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/index-esm.js +46 -17
- package/dist/index.js +46 -17
- package/package.json +1 -1
- package/src/index.d.ts +1 -1
package/dist/index-esm.js
CHANGED
|
@@ -1250,6 +1250,10 @@ function deepExtendOne(destination, source) {
|
|
|
1250
1250
|
destProp;
|
|
1251
1251
|
|
|
1252
1252
|
for (property in source) {
|
|
1253
|
+
if (property === '__proto__' || property === 'constructor') {
|
|
1254
|
+
continue;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1253
1257
|
propValue = source[property];
|
|
1254
1258
|
propType = typeof propValue;
|
|
1255
1259
|
|
|
@@ -25019,7 +25023,7 @@ class SaveAsCommand extends Command {
|
|
|
25019
25023
|
exec() {
|
|
25020
25024
|
let fileName = this.options.name + this.options.extension;
|
|
25021
25025
|
if (this.options.extension === ".xlsx") {
|
|
25022
|
-
this.options.workbook.saveAsExcel({
|
|
25026
|
+
return this.options.workbook.saveAsExcel({
|
|
25023
25027
|
fileName: fileName
|
|
25024
25028
|
});
|
|
25025
25029
|
} else if (this.options.extension === ".pdf") {
|
|
@@ -27452,29 +27456,47 @@ class Workbook extends Observable {
|
|
|
27452
27456
|
});
|
|
27453
27457
|
let count = ids.length;
|
|
27454
27458
|
let images = count ? {} : null;
|
|
27459
|
+
const promises = [];
|
|
27460
|
+
|
|
27455
27461
|
if (count) {
|
|
27456
27462
|
ids.forEach(function(id) {
|
|
27457
27463
|
let img = self._images[id];
|
|
27464
|
+
|
|
27458
27465
|
if (img.blob) {
|
|
27459
|
-
|
|
27460
|
-
|
|
27461
|
-
|
|
27462
|
-
|
|
27463
|
-
|
|
27464
|
-
|
|
27466
|
+
const promise = new Promise((resolve) => {
|
|
27467
|
+
let reader = new FileReader();
|
|
27468
|
+
reader.onload = function() {
|
|
27469
|
+
images[id] = {
|
|
27470
|
+
type: img.blob.type,
|
|
27471
|
+
name: img.blob.name,
|
|
27472
|
+
data: reader.result
|
|
27473
|
+
};
|
|
27474
|
+
|
|
27475
|
+
count--;
|
|
27476
|
+
resolve();
|
|
27465
27477
|
};
|
|
27466
|
-
|
|
27467
|
-
};
|
|
27468
|
-
|
|
27478
|
+
reader.readAsArrayBuffer(img.blob);
|
|
27479
|
+
});
|
|
27480
|
+
|
|
27481
|
+
promises.push(promise);
|
|
27469
27482
|
} else {
|
|
27470
|
-
|
|
27471
|
-
|
|
27472
|
-
|
|
27483
|
+
const promise = new Promise((resolve) => {
|
|
27484
|
+
loadBinary(img.url, function(data, type) {
|
|
27485
|
+
images[id] = { type: type, data: data };
|
|
27486
|
+
count--;
|
|
27487
|
+
resolve();
|
|
27488
|
+
});
|
|
27473
27489
|
});
|
|
27490
|
+
promises.push(promise);
|
|
27474
27491
|
}
|
|
27475
27492
|
});
|
|
27493
|
+
|
|
27494
|
+
return Promise.all(promises)
|
|
27495
|
+
.then(() => {
|
|
27496
|
+
return next();
|
|
27497
|
+
});
|
|
27476
27498
|
} else {
|
|
27477
|
-
next();
|
|
27499
|
+
return next();
|
|
27478
27500
|
}
|
|
27479
27501
|
|
|
27480
27502
|
function next() {
|
|
@@ -27482,13 +27504,20 @@ class Workbook extends Observable {
|
|
|
27482
27504
|
data.images = images;
|
|
27483
27505
|
let workbook = new options.Workbook(data);
|
|
27484
27506
|
const promise = options.forceProxy ? workbook.toDataURL() : workbook.toBlob();
|
|
27485
|
-
|
|
27507
|
+
|
|
27508
|
+
if (!options.saveAs) {
|
|
27509
|
+
return promise;
|
|
27510
|
+
}
|
|
27511
|
+
|
|
27512
|
+
return promise.then(blob => {
|
|
27486
27513
|
options.saveAs(blob, data.fileName || options.fileName, {
|
|
27487
27514
|
proxyURL: options.proxyURL,
|
|
27488
27515
|
forceProxy: options.forceProxy
|
|
27489
27516
|
});
|
|
27490
27517
|
});
|
|
27491
27518
|
}
|
|
27519
|
+
|
|
27520
|
+
return Promise.resolve();
|
|
27492
27521
|
}
|
|
27493
27522
|
}
|
|
27494
27523
|
|
|
@@ -28031,7 +28060,7 @@ class SpreadsheetWidget extends Widget {
|
|
|
28031
28060
|
}
|
|
28032
28061
|
|
|
28033
28062
|
saveAsExcel(options) {
|
|
28034
|
-
this._workbook.saveAsExcel(options);
|
|
28063
|
+
return this._workbook.saveAsExcel(options);
|
|
28035
28064
|
}
|
|
28036
28065
|
|
|
28037
28066
|
draw(options, callback) {
|
|
@@ -28174,7 +28203,7 @@ class SpreadsheetWidget extends Widget {
|
|
|
28174
28203
|
// kendo.ui.progress(this.element, e.toggle);
|
|
28175
28204
|
}
|
|
28176
28205
|
|
|
28177
|
-
_onContextMenu(e) {
|
|
28206
|
+
_onContextMenu(e) {
|
|
28178
28207
|
this.trigger("contextmenu", e);
|
|
28179
28208
|
}
|
|
28180
28209
|
|
package/dist/index.js
CHANGED
|
@@ -1251,6 +1251,10 @@
|
|
|
1251
1251
|
destProp;
|
|
1252
1252
|
|
|
1253
1253
|
for (property in source) {
|
|
1254
|
+
if (property === '__proto__' || property === 'constructor') {
|
|
1255
|
+
continue;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1254
1258
|
propValue = source[property];
|
|
1255
1259
|
propType = typeof propValue;
|
|
1256
1260
|
|
|
@@ -25020,7 +25024,7 @@
|
|
|
25020
25024
|
exec() {
|
|
25021
25025
|
let fileName = this.options.name + this.options.extension;
|
|
25022
25026
|
if (this.options.extension === ".xlsx") {
|
|
25023
|
-
this.options.workbook.saveAsExcel({
|
|
25027
|
+
return this.options.workbook.saveAsExcel({
|
|
25024
25028
|
fileName: fileName
|
|
25025
25029
|
});
|
|
25026
25030
|
} else if (this.options.extension === ".pdf") {
|
|
@@ -27453,29 +27457,47 @@
|
|
|
27453
27457
|
});
|
|
27454
27458
|
let count = ids.length;
|
|
27455
27459
|
let images = count ? {} : null;
|
|
27460
|
+
const promises = [];
|
|
27461
|
+
|
|
27456
27462
|
if (count) {
|
|
27457
27463
|
ids.forEach(function(id) {
|
|
27458
27464
|
let img = self._images[id];
|
|
27465
|
+
|
|
27459
27466
|
if (img.blob) {
|
|
27460
|
-
|
|
27461
|
-
|
|
27462
|
-
|
|
27463
|
-
|
|
27464
|
-
|
|
27465
|
-
|
|
27467
|
+
const promise = new Promise((resolve) => {
|
|
27468
|
+
let reader = new FileReader();
|
|
27469
|
+
reader.onload = function() {
|
|
27470
|
+
images[id] = {
|
|
27471
|
+
type: img.blob.type,
|
|
27472
|
+
name: img.blob.name,
|
|
27473
|
+
data: reader.result
|
|
27474
|
+
};
|
|
27475
|
+
|
|
27476
|
+
count--;
|
|
27477
|
+
resolve();
|
|
27466
27478
|
};
|
|
27467
|
-
|
|
27468
|
-
};
|
|
27469
|
-
|
|
27479
|
+
reader.readAsArrayBuffer(img.blob);
|
|
27480
|
+
});
|
|
27481
|
+
|
|
27482
|
+
promises.push(promise);
|
|
27470
27483
|
} else {
|
|
27471
|
-
|
|
27472
|
-
|
|
27473
|
-
|
|
27484
|
+
const promise = new Promise((resolve) => {
|
|
27485
|
+
loadBinary(img.url, function(data, type) {
|
|
27486
|
+
images[id] = { type: type, data: data };
|
|
27487
|
+
count--;
|
|
27488
|
+
resolve();
|
|
27489
|
+
});
|
|
27474
27490
|
});
|
|
27491
|
+
promises.push(promise);
|
|
27475
27492
|
}
|
|
27476
27493
|
});
|
|
27494
|
+
|
|
27495
|
+
return Promise.all(promises)
|
|
27496
|
+
.then(() => {
|
|
27497
|
+
return next();
|
|
27498
|
+
});
|
|
27477
27499
|
} else {
|
|
27478
|
-
next();
|
|
27500
|
+
return next();
|
|
27479
27501
|
}
|
|
27480
27502
|
|
|
27481
27503
|
function next() {
|
|
@@ -27483,13 +27505,20 @@
|
|
|
27483
27505
|
data.images = images;
|
|
27484
27506
|
let workbook = new options.Workbook(data);
|
|
27485
27507
|
const promise = options.forceProxy ? workbook.toDataURL() : workbook.toBlob();
|
|
27486
|
-
|
|
27508
|
+
|
|
27509
|
+
if (!options.saveAs) {
|
|
27510
|
+
return promise;
|
|
27511
|
+
}
|
|
27512
|
+
|
|
27513
|
+
return promise.then(blob => {
|
|
27487
27514
|
options.saveAs(blob, data.fileName || options.fileName, {
|
|
27488
27515
|
proxyURL: options.proxyURL,
|
|
27489
27516
|
forceProxy: options.forceProxy
|
|
27490
27517
|
});
|
|
27491
27518
|
});
|
|
27492
27519
|
}
|
|
27520
|
+
|
|
27521
|
+
return Promise.resolve();
|
|
27493
27522
|
}
|
|
27494
27523
|
}
|
|
27495
27524
|
|
|
@@ -28032,7 +28061,7 @@
|
|
|
28032
28061
|
}
|
|
28033
28062
|
|
|
28034
28063
|
saveAsExcel(options) {
|
|
28035
|
-
this._workbook.saveAsExcel(options);
|
|
28064
|
+
return this._workbook.saveAsExcel(options);
|
|
28036
28065
|
}
|
|
28037
28066
|
|
|
28038
28067
|
draw(options, callback) {
|
|
@@ -28175,7 +28204,7 @@
|
|
|
28175
28204
|
// kendo.ui.progress(this.element, e.toggle);
|
|
28176
28205
|
}
|
|
28177
28206
|
|
|
28178
|
-
_onContextMenu(e) {
|
|
28207
|
+
_onContextMenu(e) {
|
|
28179
28208
|
this.trigger("contextmenu", e);
|
|
28180
28209
|
}
|
|
28181
28210
|
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -754,7 +754,7 @@ export class SpreadsheetWidget {
|
|
|
754
754
|
* Note: Calling this method may trigger the built-in popup blocker of the browser.
|
|
755
755
|
* To avoid that, always call it as a response to an end-user action, for example, a button click.
|
|
756
756
|
*/
|
|
757
|
-
saveAsExcel(options: any):
|
|
757
|
+
saveAsExcel(options: any): Promise<Blob | string>;
|
|
758
758
|
|
|
759
759
|
/**
|
|
760
760
|
* Gets or sets the active sheet.
|