@syncfusion/ej2-image-editor 26.1.40 → 26.1.41
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/ej2-image-editor.umd.min.js +2 -2
- package/dist/ej2-image-editor.umd.min.js.map +1 -1
- package/dist/es6/ej2-image-editor.es2015.js +122 -29
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +121 -29
- package/dist/es6/ej2-image-editor.es5.js.map +1 -1
- package/dist/global/ej2-image-editor.min.js +2 -2
- package/dist/global/ej2-image-editor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +9 -9
- package/src/image-editor/action/draw.js +1 -2
- package/src/image-editor/action/export.js +11 -7
- package/src/image-editor/action/selection.d.ts +1 -0
- package/src/image-editor/action/selection.js +46 -1
- package/src/image-editor/action/undo-redo.js +4 -2
- package/src/image-editor/base/image-editor.d.ts +4 -1
- package/src/image-editor/base/image-editor.js +6 -3
- package/src/image-editor/base/interface.d.ts +4 -0
- package/src/image-editor/renderer/toolbar.d.ts +1 -0
- package/src/image-editor/renderer/toolbar.js +53 -14
|
@@ -1173,7 +1173,7 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
1173
1173
|
args.value['obj']['isNewPath'] = this.isNewPath;
|
|
1174
1174
|
break;
|
|
1175
1175
|
case 'getArrowDimension':
|
|
1176
|
-
args.value['obj']['arrowDimension'] = this.arrowDimension;
|
|
1176
|
+
args.value['obj']['arrowDimension'] = extend({}, this.arrowDimension, {}, true);
|
|
1177
1177
|
break;
|
|
1178
1178
|
case 'setArrowDimension':
|
|
1179
1179
|
this.arrowDimension = args.value['arrowDimension'];
|
|
@@ -4740,7 +4740,6 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
4740
4740
|
return [3 /*break*/, 3];
|
|
4741
4741
|
case 2:
|
|
4742
4742
|
ex_1 = _a.sent();
|
|
4743
|
-
console.log(ex_1.message);
|
|
4744
4743
|
return [3 /*break*/, 3];
|
|
4745
4744
|
case 3: return [2 /*return*/];
|
|
4746
4745
|
}
|
|
@@ -5843,7 +5842,7 @@ var Export = /** @__PURE__ @class */ (function () {
|
|
|
5843
5842
|
this.updatePvtVar();
|
|
5844
5843
|
switch (args.prop) {
|
|
5845
5844
|
case 'export':
|
|
5846
|
-
this.exportImg(args.value['type'], args.value['fileName']);
|
|
5845
|
+
this.exportImg(args.value['type'], args.value['fileName'], args.value['imgQuality']);
|
|
5847
5846
|
break;
|
|
5848
5847
|
case 'exportToCanvas':
|
|
5849
5848
|
this.exportToCanvas(args.value['object']);
|
|
@@ -5864,7 +5863,7 @@ var Export = /** @__PURE__ @class */ (function () {
|
|
|
5864
5863
|
this.lowerContext = parent.lowerCanvas.getContext('2d');
|
|
5865
5864
|
}
|
|
5866
5865
|
};
|
|
5867
|
-
Export.prototype.exportImg = function (type, fileName) {
|
|
5866
|
+
Export.prototype.exportImg = function (type, fileName, imgQuality) {
|
|
5868
5867
|
var parent = this.parent;
|
|
5869
5868
|
var obj = { fileName: '' };
|
|
5870
5869
|
parent.notify('draw', { prop: 'getFileName', onPropertyChange: false, value: { obj: obj } });
|
|
@@ -5890,12 +5889,12 @@ var Export = /** @__PURE__ @class */ (function () {
|
|
|
5890
5889
|
parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
|
|
5891
5890
|
value: { x: null, y: null, isMouseDown: null } });
|
|
5892
5891
|
var beforeSave = { cancel: false, fileName: fileName ? fileName : imageName,
|
|
5893
|
-
fileType: type };
|
|
5892
|
+
fileType: type, imageQuality: imgQuality };
|
|
5894
5893
|
parent.trigger('beforeSave', beforeSave);
|
|
5895
|
-
this.beforeSaveEvent(beforeSave, type, fileName, imageName);
|
|
5894
|
+
this.beforeSaveEvent(beforeSave, type, fileName, imageName, imgQuality);
|
|
5896
5895
|
}
|
|
5897
5896
|
};
|
|
5898
|
-
Export.prototype.beforeSaveEvent = function (observableSaveArgs, type, fileName, imageName) {
|
|
5897
|
+
Export.prototype.beforeSaveEvent = function (observableSaveArgs, type, fileName, imageName, imgQuality) {
|
|
5899
5898
|
var parent = this.parent;
|
|
5900
5899
|
if (!observableSaveArgs.cancel) {
|
|
5901
5900
|
parent.currObjType.isSave = true;
|
|
@@ -5906,7 +5905,7 @@ var Export = /** @__PURE__ @class */ (function () {
|
|
|
5906
5905
|
this.toSVGImg(fileName);
|
|
5907
5906
|
}
|
|
5908
5907
|
else {
|
|
5909
|
-
this.toBlobFn(fileName, lowerCaseType);
|
|
5908
|
+
this.toBlobFn(fileName, lowerCaseType, imgQuality);
|
|
5910
5909
|
}
|
|
5911
5910
|
var saved = { fileName: fileName ? fileName : imageName, fileType: type };
|
|
5912
5911
|
parent.trigger('saved', saved);
|
|
@@ -5949,12 +5948,16 @@ var Export = /** @__PURE__ @class */ (function () {
|
|
|
5949
5948
|
return null;
|
|
5950
5949
|
}
|
|
5951
5950
|
};
|
|
5952
|
-
Export.prototype.toBlobFn = function (fileName, type) {
|
|
5951
|
+
Export.prototype.toBlobFn = function (fileName, type, imgQuality) {
|
|
5953
5952
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
5954
5953
|
var proxy = this;
|
|
5955
5954
|
var parent = this.parent;
|
|
5956
5955
|
showSpinner(parent.element);
|
|
5957
5956
|
parent.element.style.opacity = '0.5';
|
|
5957
|
+
if (!isNullOrUndefined(imgQuality)) {
|
|
5958
|
+
imgQuality = imgQuality > 1 ? 1 : (imgQuality <= 0 ? 0.01 : imgQuality);
|
|
5959
|
+
this.imageQuality = imgQuality ? imgQuality : null;
|
|
5960
|
+
}
|
|
5958
5961
|
var tempCanvas = this.exportToCanvas();
|
|
5959
5962
|
var imagetype = type !== 'jpeg' ? 'image/png' : 'image/jpeg';
|
|
5960
5963
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
@@ -8512,6 +8515,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8512
8515
|
parent.notify('undo-redo', { prop: 'updateCurrUrc', value: { type: 'ok' } });
|
|
8513
8516
|
}
|
|
8514
8517
|
}
|
|
8518
|
+
parent.isKBDNavigation = true;
|
|
8515
8519
|
};
|
|
8516
8520
|
Selection.prototype.selMouseUpEvent = function () {
|
|
8517
8521
|
this.oldPoint.x = undefined;
|
|
@@ -11072,6 +11076,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
11072
11076
|
};
|
|
11073
11077
|
Selection.prototype.mouseDownEventHandler = function (e) {
|
|
11074
11078
|
var parent = this.parent;
|
|
11079
|
+
parent.isKBDNavigation = false;
|
|
11075
11080
|
this.mouseDown = e.currentTarget === parent.lowerCanvas || e.currentTarget === parent.upperCanvas ?
|
|
11076
11081
|
'canvas' : '';
|
|
11077
11082
|
if (e.type === 'touchstart') {
|
|
@@ -11532,6 +11537,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
11532
11537
|
Selection.prototype.mouseUpEventHandler = function (e) {
|
|
11533
11538
|
var parent = this.parent;
|
|
11534
11539
|
var id = parent.element.id;
|
|
11540
|
+
parent.isKBDNavigation = false;
|
|
11535
11541
|
if (!Browser.isDevice && ((parent.element.querySelector('#' + id + '_contextualToolbar') &&
|
|
11536
11542
|
!parent.element.querySelector('#' + id + '_contextualToolbar').parentElement.classList.contains('e-hide')) ||
|
|
11537
11543
|
(parent.element.querySelector('#' + id + '_headWrapper')
|
|
@@ -11679,7 +11685,10 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
11679
11685
|
previousCropObj: prevCropObj, previousText: null,
|
|
11680
11686
|
currentText: null, previousFilter: null, isCircleCrop: null } });
|
|
11681
11687
|
}
|
|
11682
|
-
|
|
11688
|
+
var tempObj = extend({}, parent.objColl[parent.objColl.length - 1], {}, true);
|
|
11689
|
+
parent.objColl.pop();
|
|
11690
|
+
this.redrawShape(tempObj);
|
|
11691
|
+
parent.objColl.push(tempObj);
|
|
11683
11692
|
this.tempObjColl = undefined;
|
|
11684
11693
|
}
|
|
11685
11694
|
if (!this.isFhdEditing) {
|
|
@@ -11729,6 +11738,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
11729
11738
|
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
11730
11739
|
}
|
|
11731
11740
|
if (!isCropSelection_1) {
|
|
11741
|
+
this.adjustActObjForLineArrow();
|
|
11732
11742
|
if (parent.isShapeDrawing) {
|
|
11733
11743
|
var temp = this.currentDrawingShape;
|
|
11734
11744
|
parent.notify('undo-redo', { prop: 'updateUndoRedoStack', onPropertyChange: false });
|
|
@@ -11754,8 +11764,11 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
11754
11764
|
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
11755
11765
|
}
|
|
11756
11766
|
else {
|
|
11767
|
+
var temp = this.currentDrawingShape;
|
|
11768
|
+
this.currentDrawingShape = '';
|
|
11757
11769
|
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
|
|
11758
11770
|
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
11771
|
+
this.currentDrawingShape = temp;
|
|
11759
11772
|
}
|
|
11760
11773
|
parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
|
|
11761
11774
|
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
|
|
@@ -12289,8 +12302,15 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12289
12302
|
Selection.prototype.performEnterAction = function (e) {
|
|
12290
12303
|
var parent = this.parent;
|
|
12291
12304
|
if (parent.isResize) {
|
|
12305
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
12306
|
+
var target = e.target;
|
|
12307
|
+
var isIcon = target.id.indexOf('aspectratio') ||
|
|
12308
|
+
target.id.indexOf('non-aspectratio') > -1 ? true : false;
|
|
12292
12309
|
var isValue = this.isValueUpdated();
|
|
12293
12310
|
if (!isValue) {
|
|
12311
|
+
if (isIcon) {
|
|
12312
|
+
this.focusRatioBtn();
|
|
12313
|
+
}
|
|
12294
12314
|
return;
|
|
12295
12315
|
}
|
|
12296
12316
|
var point = this.getNumTextValue();
|
|
@@ -12323,6 +12343,21 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12323
12343
|
}
|
|
12324
12344
|
}
|
|
12325
12345
|
parent.notify('draw', { prop: 'redrawDownScale' });
|
|
12346
|
+
if (isIcon) {
|
|
12347
|
+
this.focusRatioBtn();
|
|
12348
|
+
}
|
|
12349
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
12350
|
+
}
|
|
12351
|
+
else if (e.target.classList.contains('e-upload')) {
|
|
12352
|
+
var upload = parent.element.querySelector('.e-image-upload');
|
|
12353
|
+
if (upload && upload.querySelector('.e-tbar-btn')) {
|
|
12354
|
+
upload.querySelector('.e-tbar-btn').click();
|
|
12355
|
+
}
|
|
12356
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
12357
|
+
}
|
|
12358
|
+
else if (e.target.classList.contains('filter-wrapper')) {
|
|
12359
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
12360
|
+
e.target.parentElement.click();
|
|
12326
12361
|
}
|
|
12327
12362
|
else {
|
|
12328
12363
|
var splitWords = void 0;
|
|
@@ -12335,6 +12370,19 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12335
12370
|
}
|
|
12336
12371
|
}
|
|
12337
12372
|
};
|
|
12373
|
+
Selection.prototype.focusRatioBtn = function () {
|
|
12374
|
+
var id = this.parent.element.id;
|
|
12375
|
+
if (this.parent.isKBDNavigation) {
|
|
12376
|
+
setTimeout(function () {
|
|
12377
|
+
if (document.getElementById(id + '_aspectratio')) {
|
|
12378
|
+
document.getElementById(id + '_aspectratio').focus();
|
|
12379
|
+
}
|
|
12380
|
+
else if (document.getElementById(id + '_nonaspectratio')) {
|
|
12381
|
+
document.getElementById(id + '_nonaspectratio').focus();
|
|
12382
|
+
}
|
|
12383
|
+
}, 50);
|
|
12384
|
+
}
|
|
12385
|
+
};
|
|
12338
12386
|
Selection.prototype.isKeyBoardCrop = function (e) {
|
|
12339
12387
|
var bool = false;
|
|
12340
12388
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
@@ -19630,7 +19678,8 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
19630
19678
|
case 'freehanddraw':
|
|
19631
19679
|
case 'freehand-draw':
|
|
19632
19680
|
this.updateFreehandDraw(obj.previousPointColl, obj.previousSelPointColl);
|
|
19633
|
-
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
19681
|
+
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
19682
|
+
value: { value: parent.pointColl.length } });
|
|
19634
19683
|
break;
|
|
19635
19684
|
case 'freehanddrawCustomized':
|
|
19636
19685
|
this.updateFreehandDrawCustomized(obj.previousObjColl, obj.previousPointColl);
|
|
@@ -19761,7 +19810,8 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
19761
19810
|
case 'freehanddraw':
|
|
19762
19811
|
case 'freehand-draw':
|
|
19763
19812
|
this.updateFreehandDraw(obj.currentPointColl, obj.currentSelPointColl);
|
|
19764
|
-
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
19813
|
+
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
19814
|
+
value: { value: parent.pointColl.length } });
|
|
19765
19815
|
break;
|
|
19766
19816
|
case 'freehanddrawCustomized':
|
|
19767
19817
|
this.updateFreehandDrawCustomized(obj.currentObjColl, obj.currentPointColl);
|
|
@@ -20624,6 +20674,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
20624
20674
|
/** @hidden */
|
|
20625
20675
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20626
20676
|
_this.shapeColl = [];
|
|
20677
|
+
/** @hidden */
|
|
20678
|
+
_this.isKBDNavigation = false;
|
|
20627
20679
|
ImageEditor_1.Inject(Crop, Draw, Selection, Transform, Export, ToolbarModule);
|
|
20628
20680
|
ImageEditor_1.Inject(UndoRedo);
|
|
20629
20681
|
ImageEditor_1.Inject(Filter);
|
|
@@ -21382,7 +21434,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
21382
21434
|
this.aspectWidth = this.aspectHeight = null;
|
|
21383
21435
|
this.isResize = false;
|
|
21384
21436
|
this.drawingShape = null;
|
|
21385
|
-
this.isShapeDrawing = this.noPushUndo = this.isUndoRedoStack = false;
|
|
21437
|
+
this.isShapeDrawing = this.noPushUndo = this.isUndoRedoStack = this.isKBDNavigation = false;
|
|
21386
21438
|
this.shapeColl = [];
|
|
21387
21439
|
var obj_1 = { initialZoomValue: false };
|
|
21388
21440
|
this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj_1 } });
|
|
@@ -21448,15 +21500,16 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
21448
21500
|
*
|
|
21449
21501
|
* @param {string} type - Specifies a format of image to be saved.
|
|
21450
21502
|
* @param {string} fileName – Specifies a file name to be saved
|
|
21503
|
+
* @param {number} imageQuality – Specifies the quality of an image to be saved. The default value is “1” which represents the original size of the image if not specified.
|
|
21451
21504
|
*
|
|
21452
21505
|
* @remarks
|
|
21453
21506
|
* The supported file types are JPG, JPEG, PNG, and SVG.
|
|
21454
21507
|
*
|
|
21455
21508
|
* @returns {void}.
|
|
21456
21509
|
*/
|
|
21457
|
-
ImageEditor.prototype.export = function (type, fileName) {
|
|
21510
|
+
ImageEditor.prototype.export = function (type, fileName, imageQuality) {
|
|
21458
21511
|
this.applyShapes();
|
|
21459
|
-
this.notify('export', { prop: 'export', onPropertyChange: false, value: { type: type, fileName: fileName } });
|
|
21512
|
+
this.notify('export', { prop: 'export', onPropertyChange: false, value: { type: type, fileName: fileName, imgQuality: imageQuality } });
|
|
21460
21513
|
};
|
|
21461
21514
|
/**
|
|
21462
21515
|
* Perform selection in an image editor. The selection helps to crop an image.
|
|
@@ -25042,7 +25095,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25042
25095
|
var toolbarItems = [];
|
|
25043
25096
|
if (isOkBtn) {
|
|
25044
25097
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
25045
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
25098
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
25046
25099
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
25047
25100
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
25048
25101
|
}
|
|
@@ -25124,7 +25177,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25124
25177
|
}
|
|
25125
25178
|
if (isApplyOption) {
|
|
25126
25179
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
25127
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
25180
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
25128
25181
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
25129
25182
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
25130
25183
|
}
|
|
@@ -25268,7 +25321,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25268
25321
|
};
|
|
25269
25322
|
ToolbarModule.prototype.widthAspectRatio = function (e) {
|
|
25270
25323
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
25271
|
-
if (e.keyCode === 109) {
|
|
25324
|
+
if (e.keyCode === 109 || e.keyCode === 9) {
|
|
25272
25325
|
return;
|
|
25273
25326
|
}
|
|
25274
25327
|
var parent = this.parent;
|
|
@@ -25312,7 +25365,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25312
25365
|
};
|
|
25313
25366
|
ToolbarModule.prototype.heightAspectRatio = function (e) {
|
|
25314
25367
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
25315
|
-
if (e.keyCode === 109) {
|
|
25368
|
+
if (e.keyCode === 109 || e.keyCode === 9) {
|
|
25316
25369
|
return;
|
|
25317
25370
|
}
|
|
25318
25371
|
var parent = this.parent;
|
|
@@ -25380,7 +25433,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25380
25433
|
placeholder: isResize ? null : height, format: '###.## px' })
|
|
25381
25434
|
});
|
|
25382
25435
|
if (!this.isAspectRatio) {
|
|
25383
|
-
toolbarItems.push({ id: id + '_aspectratio', prefixIcon: 'e-icons e-lock', align: 'Center',
|
|
25436
|
+
toolbarItems.push({ id: id + '_aspectratio', prefixIcon: 'e-icons e-lock', align: 'Center',
|
|
25437
|
+
tooltipText: this.l10n.getConstant('AspectRatio'), type: 'Button', tabIndex: 0 });
|
|
25384
25438
|
this.isAspectRatio = true;
|
|
25385
25439
|
}
|
|
25386
25440
|
else {
|
|
@@ -25389,7 +25443,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25389
25443
|
}
|
|
25390
25444
|
if (!Browser.isDevice) {
|
|
25391
25445
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
25392
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
25446
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
25393
25447
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
25394
25448
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
25395
25449
|
}
|
|
@@ -26034,7 +26088,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26034
26088
|
{ id: 'svg', text: 'SVG' }
|
|
26035
26089
|
];
|
|
26036
26090
|
var inputObj = new TextBox({
|
|
26037
|
-
placeholder: this.l10n.getConstant('ImageName')
|
|
26091
|
+
placeholder: this.l10n.getConstant('ImageName')
|
|
26038
26092
|
});
|
|
26039
26093
|
inputObj.appendTo('#' + id + '_imgNametext');
|
|
26040
26094
|
var qualityContainer = document.getElementById(id + '_imgQualitydiv');
|
|
@@ -26205,7 +26259,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26205
26259
|
else {
|
|
26206
26260
|
imageNameLabel = document.getElementById(id + '_imageNameLabel');
|
|
26207
26261
|
}
|
|
26208
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26262
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
26209
26263
|
tempCanvas.toBlob((function (blob) {
|
|
26210
26264
|
fileSize = Math.floor(blob.size / 1024);
|
|
26211
26265
|
if (fileSize > 1000) {
|
|
@@ -26285,7 +26339,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26285
26339
|
}
|
|
26286
26340
|
if (!Browser.isDevice) {
|
|
26287
26341
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
26288
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
26342
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
26289
26343
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
26290
26344
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
26291
26345
|
}
|
|
@@ -26362,7 +26416,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26362
26416
|
parent.notify('selection', { prop: 'getCurrentDrawingShape', value: { obj: obj } });
|
|
26363
26417
|
if (obj['shape'] !== 'path') {
|
|
26364
26418
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
26365
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
26419
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
26366
26420
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
26367
26421
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
26368
26422
|
}
|
|
@@ -26976,7 +27030,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26976
27030
|
}
|
|
26977
27031
|
if (!Browser.isDevice) {
|
|
26978
27032
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
26979
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
27033
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
26980
27034
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
26981
27035
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
26982
27036
|
}
|
|
@@ -27359,6 +27413,44 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27359
27413
|
}
|
|
27360
27414
|
this.currToolbar = type;
|
|
27361
27415
|
this.refreshDropDownBtn(isCropping);
|
|
27416
|
+
this.updateKBDNavigation(this.currToolbar);
|
|
27417
|
+
};
|
|
27418
|
+
ToolbarModule.prototype.updateKBDNavigation = function (type) {
|
|
27419
|
+
var parent = this.parent;
|
|
27420
|
+
var id = parent.element.id;
|
|
27421
|
+
if (!parent.isKBDNavigation) {
|
|
27422
|
+
return;
|
|
27423
|
+
}
|
|
27424
|
+
if (this.isToolbar()) {
|
|
27425
|
+
var tbar = parent.element.querySelectorAll('#' + id + '_toolbar')[0];
|
|
27426
|
+
var tbarInitialChild = void 0;
|
|
27427
|
+
var tbarInitialBtn_1;
|
|
27428
|
+
if (tbar) {
|
|
27429
|
+
tbarInitialChild = tbar.querySelector('.e-toolbar-center');
|
|
27430
|
+
if (!tbarInitialChild || !tbarInitialChild.children[0]) {
|
|
27431
|
+
return;
|
|
27432
|
+
}
|
|
27433
|
+
tbarInitialBtn_1 = tbarInitialChild.children[0].querySelector('.e-btn');
|
|
27434
|
+
var tempElem = tbarInitialChild.children[1];
|
|
27435
|
+
if (tempElem) {
|
|
27436
|
+
tempElem = tempElem.children[0];
|
|
27437
|
+
}
|
|
27438
|
+
if (tempElem) {
|
|
27439
|
+
tempElem = tempElem.children[0];
|
|
27440
|
+
}
|
|
27441
|
+
if (type === 'resize' && tempElem) {
|
|
27442
|
+
tbarInitialBtn_1 = tempElem;
|
|
27443
|
+
}
|
|
27444
|
+
if (tbarInitialBtn_1) {
|
|
27445
|
+
if (type === 'main') {
|
|
27446
|
+
setTimeout(function () { return tbarInitialBtn_1.focus(); }, 50);
|
|
27447
|
+
}
|
|
27448
|
+
else {
|
|
27449
|
+
tbarInitialBtn_1.focus();
|
|
27450
|
+
}
|
|
27451
|
+
}
|
|
27452
|
+
}
|
|
27453
|
+
}
|
|
27362
27454
|
};
|
|
27363
27455
|
ToolbarModule.prototype.performCropTransformClick = function (shape, isTransform) {
|
|
27364
27456
|
var parent = this.parent;
|
|
@@ -27424,7 +27516,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27424
27516
|
}
|
|
27425
27517
|
if (!Browser.isDevice) {
|
|
27426
27518
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
27427
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
27519
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
27428
27520
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
27429
27521
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
27430
27522
|
}
|
|
@@ -27477,7 +27569,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27477
27569
|
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Default') > -1)) {
|
|
27478
27570
|
toolbarItems.push({ id: id + '_default', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
27479
27571
|
tooltipText: this.l10n.getConstant('Default'), align: 'Center',
|
|
27480
|
-
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + id + '_defaultCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Default') + '</span></div></div>' });
|
|
27572
|
+
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + id + '_defaultCanvas' + ' tabindex=0></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Default') + '</span></div></div>' });
|
|
27481
27573
|
}
|
|
27482
27574
|
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
|
|
27483
27575
|
toolbarItems.push({ id: id + '_chrome', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
@@ -27550,7 +27642,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27550
27642
|
}
|
|
27551
27643
|
if (!Browser.isDevice) {
|
|
27552
27644
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
27553
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
27645
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
27554
27646
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
27555
27647
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
27556
27648
|
}
|