@vitrosoftware/common-ui-ts 1.1.149 → 1.1.151

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.
@@ -178,4 +178,11 @@
178
178
  .vitro-rich-text-floated.vitro-readonly.vitro-focus .ql-toolbar,
179
179
  .vitro-rich-text-floated.vitro-readonly .ql-toolbar {
180
180
  display: none !important;
181
+ }
182
+
183
+ .ql-snow .ql-toolbar button svg,
184
+ .ql-snow.ql-toolbar button svg,
185
+ .ql-snow .ql-toolbar button svg *,
186
+ .ql-snow.ql-toolbar button svg * {
187
+ pointer-events: none !important;
181
188
  }
package/dist/index.js CHANGED
@@ -22200,7 +22200,9 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
22200
22200
  async: {
22201
22201
  saveUrl: settings.async.saveUrl,
22202
22202
  autoUpload: settings.async.isAutoUpload,
22203
- batch: settings.async.isBatch
22203
+ batch: settings.async.isBatch,
22204
+ concurrent: settings.async.isConcurrent,
22205
+ chunkSize: settings.async.chunkSize
22204
22206
  },
22205
22207
  upload: function upload(e) {
22206
22208
  return component.upload(e);
@@ -22228,6 +22230,7 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
22228
22230
  },
22229
22231
  directoryDrop: settings.isDirectoryDrop,
22230
22232
  dropZone: dropZone,
22233
+ multiple: settings.isMultiple !== false,
22231
22234
  localization: {
22232
22235
  cancel: this.localeService.create(LOCALE.CANCEL),
22233
22236
  clearSelectedFiles: this.localeService.create(LOCALE.CANCEL),
@@ -22297,9 +22300,9 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
22297
22300
  _proto.progress = function progress(e) {
22298
22301
  this.progressInfoContainer.show();
22299
22302
  this.setFileProgress(e.files[0].uid, e.percentComplete);
22300
- if (this.fileList.length === 1) {
22303
+ if (this.fileList.length === 1 || this.settings.async.isBatch) {
22301
22304
  this.progressInfo = {
22302
- count: 1,
22305
+ count: this.fileList.length,
22303
22306
  percent: e.percentComplete
22304
22307
  };
22305
22308
  } else {
@@ -22409,42 +22412,109 @@ var TelerikUploaderContextImpl = /*#__PURE__*/function () {
22409
22412
  this.progressBar.style.width = percent + CTRL.PERCENT;
22410
22413
  }
22411
22414
  };
22415
+ _proto.readFileFromFileSystem = function readFileFromFileSystem(fileEntry) {
22416
+ return new Promise(function (resolve, reject) {
22417
+ fileEntry.file(function (entry) {
22418
+ resolve(entry);
22419
+ }, function (error) {
22420
+ reject(error);
22421
+ });
22422
+ });
22423
+ };
22424
+ _proto.readDirectoryEntries = function readDirectoryEntries(reader) {
22425
+ return new Promise(function (resolve, reject) {
22426
+ reader.readEntries(function (entries) {
22427
+ resolve(entries);
22428
+ }, function (error) {
22429
+ reject(error);
22430
+ });
22431
+ });
22432
+ };
22412
22433
  _proto.setFileProgress = function setFileProgress(id, percent) {
22413
22434
  var progressBar = $$1("[data-uid=" + id + "]").children('.k-progressbar')[0];
22414
22435
  progressBar.style.background = "conic-gradient(from 90deg, #0D6EFD, #0D6EFD " + percent + "%, white " + percent + "%, white 100%)";
22415
22436
  };
22437
+ _proto.initFileList = function initFileList(entry) {
22438
+ try {
22439
+ var _this4 = this;
22440
+ var fileList = [];
22441
+ var _temp2 = function () {
22442
+ if (entry.isDirectory) {
22443
+ var directoryReader = entry.createReader();
22444
+ return Promise.resolve(_this4.readDirectoryEntries(directoryReader)).then(function (entries) {
22445
+ var _temp = _forOf(entries, function (subEntry) {
22446
+ return Promise.resolve(_this4.initFileList(subEntry)).then(function (subFileList) {
22447
+ for (var _iterator = _createForOfIteratorHelperLoose(subFileList), _step; !(_step = _iterator()).done;) {
22448
+ var subFile = _step.value;
22449
+ fileList.push(subFile);
22450
+ }
22451
+ });
22452
+ });
22453
+ if (_temp && _temp.then) return _temp.then(function () {});
22454
+ });
22455
+ } else {
22456
+ return Promise.resolve(_this4.readFileFromFileSystem(entry)).then(function (fileEntity) {
22457
+ fileEntity.relativePath = entry.fullPath.slice(1);
22458
+ fileList.push(fileEntity);
22459
+ });
22460
+ }
22461
+ }();
22462
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {
22463
+ return fileList;
22464
+ }) : fileList);
22465
+ } catch (e) {
22466
+ return Promise.reject(e);
22467
+ }
22468
+ };
22469
+ _proto.processDrop = function processDrop(items) {
22470
+ try {
22471
+ var _this5 = this;
22472
+ var fileList = [];
22473
+ var length = items.length;
22474
+ var _i = 0;
22475
+ var _temp3 = _for(function () {
22476
+ return _i < length;
22477
+ }, function () {
22478
+ return _i++;
22479
+ }, function () {
22480
+ var item = items[_i];
22481
+ return Promise.resolve(_this5.initFileList(item)).then(function (subFileList) {
22482
+ for (var _iterator2 = _createForOfIteratorHelperLoose(subFileList), _step2; !(_step2 = _iterator2()).done;) {
22483
+ var subFile = _step2.value;
22484
+ fileList.push(subFile);
22485
+ }
22486
+ });
22487
+ });
22488
+ return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {
22489
+ return fileList;
22490
+ }) : fileList);
22491
+ } catch (e) {
22492
+ return Promise.reject(e);
22493
+ }
22494
+ };
22416
22495
  _proto.initOnDrop = function initOnDrop() {
22417
22496
  var kendo = window.kendo;
22418
22497
  var component = this.uploader;
22498
+ var processDrop = this.processDrop.bind(this);
22419
22499
  if (this.uploader) {
22420
22500
  kendo.ui.Upload.fn._onDrop = function (e) {
22421
22501
  component.accept = CTRL.EMPTY;
22422
22502
  var dt = e.originalEvent.dataTransfer;
22423
22503
  var that = this;
22424
22504
  var droppedFileList = dt.files;
22425
- var length;
22426
22505
  e.stopPropagation();
22427
22506
  e.preventDefault();
22428
22507
  if (dt.items) {
22429
- length = dt.items.length;
22430
22508
  that.droppedFolderCounter = 0;
22431
22509
  that.droppedFolderFiles = [];
22432
- for (var i = 0; i < length; i++) {
22433
- if (dt.items[i].webkitGetAsEntry) {
22434
- var entry = dt.items[i].webkitGetAsEntry();
22435
- if (entry != null) {
22436
- if (entry.isDirectory) {
22437
- that._traverseFileTree(entry, true);
22438
- } else if (entry.isFile) {
22439
- var a = [];
22440
- a.push(dt.items[i].getAsFile());
22441
- that._proceedDroppedItems(a);
22442
- }
22443
- } else {
22444
- that._proceedDroppedItems(droppedFileList);
22445
- }
22446
- }
22510
+ var itemList = [];
22511
+ var length = dt.items.length;
22512
+ for (var _i2 = 0; _i2 < length; _i2++) {
22513
+ itemList.push(dt.items[_i2].webkitGetAsEntry());
22447
22514
  }
22515
+ processDrop(itemList).then(function (fileList) {
22516
+ return that._proceedDroppedItems(fileList);
22517
+ });
22448
22518
  } else {
22449
22519
  that._proceedDroppedItems(droppedFileList);
22450
22520
  }
@@ -63080,7 +63150,7 @@ var Viewer = function Viewer(props) {
63080
63150
  };
63081
63151
 
63082
63152
  var name = "@vitrosoftware/common-ui-ts";
63083
- var version$1 = "1.1.149";
63153
+ var version$1 = "1.1.151";
63084
63154
  var description = "vitro software common ui ts";
63085
63155
  var author = "";
63086
63156
  var license = "MIT";