@syncfusion/ej2-image-editor 26.1.38 → 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 +134 -29
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +133 -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 +10 -10
- 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 +47 -2
- package/src/image-editor/action/shape.js +11 -1
- package/src/image-editor/action/undo-redo.js +4 -0
- 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
- package/styles/bootstrap-dark.css +7 -0
- package/styles/bootstrap.css +7 -0
- package/styles/bootstrap4.css +7 -0
- package/styles/bootstrap5-dark.css +7 -0
- package/styles/bootstrap5.css +7 -0
- package/styles/fabric-dark.css +7 -0
- package/styles/fabric.css +7 -0
- package/styles/fluent-dark.css +7 -0
- package/styles/fluent.css +7 -0
- package/styles/fluent2.css +12 -5
- package/styles/highcontrast-light.css +7 -0
- package/styles/highcontrast.css +7 -0
- package/styles/image-editor/_bds-definition.scss +1 -0
- package/styles/image-editor/_bootstrap-dark-definition.scss +1 -0
- package/styles/image-editor/_bootstrap-definition.scss +1 -0
- package/styles/image-editor/_bootstrap4-definition.scss +1 -0
- package/styles/image-editor/_bootstrap5-definition.scss +1 -0
- package/styles/image-editor/_bootstrap5.3-definition.scss +1 -0
- package/styles/image-editor/_fabric-dark-definition.scss +1 -0
- package/styles/image-editor/_fabric-definition.scss +1 -0
- package/styles/image-editor/_fluent-definition.scss +1 -0
- package/styles/image-editor/_fluent2-definition.scss +1 -0
- package/styles/image-editor/_fusionnew-definition.scss +1 -0
- package/styles/image-editor/_highcontrast-definition.scss +1 -0
- package/styles/image-editor/_highcontrast-light-definition.scss +1 -0
- package/styles/image-editor/_layout.scss +29 -4
- package/styles/image-editor/_material-dark-definition.scss +1 -0
- package/styles/image-editor/_material-definition.scss +1 -0
- package/styles/image-editor/_material3-definition.scss +1 -0
- package/styles/image-editor/_tailwind-definition.scss +1 -0
- package/styles/image-editor/_theme.scss +7 -0
- package/styles/image-editor/bootstrap-dark.css +7 -0
- package/styles/image-editor/bootstrap.css +7 -0
- package/styles/image-editor/bootstrap4.css +7 -0
- package/styles/image-editor/bootstrap5-dark.css +7 -0
- package/styles/image-editor/bootstrap5.css +7 -0
- package/styles/image-editor/fabric-dark.css +7 -0
- package/styles/image-editor/fabric.css +7 -0
- package/styles/image-editor/fluent-dark.css +7 -0
- package/styles/image-editor/fluent.css +7 -0
- package/styles/image-editor/fluent2.css +12 -5
- package/styles/image-editor/highcontrast-light.css +7 -0
- package/styles/image-editor/highcontrast.css +7 -0
- package/styles/image-editor/material-dark.css +7 -0
- package/styles/image-editor/material.css +7 -0
- package/styles/image-editor/material3-dark.css +20 -3
- package/styles/image-editor/material3.css +20 -3
- package/styles/image-editor/tailwind-dark.css +7 -0
- package/styles/image-editor/tailwind.css +7 -0
- package/styles/material-dark.css +7 -0
- package/styles/material.css +7 -0
- package/styles/material3-dark.css +20 -3
- package/styles/material3.css +20 -3
- package/styles/tailwind-dark.css +7 -0
- package/styles/tailwind.css +7 -0
|
@@ -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;
|
|
@@ -9390,7 +9394,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9390
9394
|
}
|
|
9391
9395
|
else {
|
|
9392
9396
|
parent.trigger('shapeChanging', shapeMovingArgs);
|
|
9393
|
-
this.isPreventShaping =
|
|
9397
|
+
this.isPreventShaping = shapeMovingArgs.cancel;
|
|
9394
9398
|
parent.notify('shape', { prop: 'updateShapeChangeEventArgs', onPropertyChange: false,
|
|
9395
9399
|
value: { shapeSettings: shapeMovingArgs.currentShapeSettings } });
|
|
9396
9400
|
}
|
|
@@ -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 */
|
|
@@ -13894,6 +13942,14 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
13894
13942
|
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
13895
13943
|
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
|
|
13896
13944
|
}
|
|
13945
|
+
if (text && text.indexOf('\n') > -1 && parent.isPublicMethod) {
|
|
13946
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13947
|
+
var fontSizeInd = String(parent.fontSizeColl.findIndex(function (item) { return item.text === String(parent.activeObj.textSettings.fontSize); }) + 1);
|
|
13948
|
+
parent.noPushUndo = true;
|
|
13949
|
+
parent.updateFontSize('5');
|
|
13950
|
+
parent.updateFontSize(fontSizeInd);
|
|
13951
|
+
parent.noPushUndo = false;
|
|
13952
|
+
}
|
|
13897
13953
|
if (parent.isPublicMethod && !isSelected) {
|
|
13898
13954
|
parent.notify('undo-redo', { prop: 'updateUndoRedo', value: { operation: 'shapeInsert' }, onPropertyChange: false });
|
|
13899
13955
|
}
|
|
@@ -15987,7 +16043,9 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
15987
16043
|
Shape.prototype.pushActItemIntoObj = function () {
|
|
15988
16044
|
var parent = this.parent;
|
|
15989
16045
|
if (parent.textArea.style.display === 'none') {
|
|
15990
|
-
parent.
|
|
16046
|
+
if (parent.activeObj.activePoint.width !== 0 || parent.activeObj.activePoint.height !== 0) {
|
|
16047
|
+
parent.objColl.push(parent.activeObj);
|
|
16048
|
+
}
|
|
15991
16049
|
}
|
|
15992
16050
|
else {
|
|
15993
16051
|
var temp = extend({}, parent.activeObj, {}, true);
|
|
@@ -19620,6 +19678,8 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
19620
19678
|
case 'freehanddraw':
|
|
19621
19679
|
case 'freehand-draw':
|
|
19622
19680
|
this.updateFreehandDraw(obj.previousPointColl, obj.previousSelPointColl);
|
|
19681
|
+
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
19682
|
+
value: { value: parent.pointColl.length } });
|
|
19623
19683
|
break;
|
|
19624
19684
|
case 'freehanddrawCustomized':
|
|
19625
19685
|
this.updateFreehandDrawCustomized(obj.previousObjColl, obj.previousPointColl);
|
|
@@ -19750,6 +19810,8 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
19750
19810
|
case 'freehanddraw':
|
|
19751
19811
|
case 'freehand-draw':
|
|
19752
19812
|
this.updateFreehandDraw(obj.currentPointColl, obj.currentSelPointColl);
|
|
19813
|
+
parent.notify('freehand-draw', { prop: 'setCurrentFreehandDrawIndex',
|
|
19814
|
+
value: { value: parent.pointColl.length } });
|
|
19753
19815
|
break;
|
|
19754
19816
|
case 'freehanddrawCustomized':
|
|
19755
19817
|
this.updateFreehandDrawCustomized(obj.currentObjColl, obj.currentPointColl);
|
|
@@ -20612,6 +20674,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
20612
20674
|
/** @hidden */
|
|
20613
20675
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20614
20676
|
_this.shapeColl = [];
|
|
20677
|
+
/** @hidden */
|
|
20678
|
+
_this.isKBDNavigation = false;
|
|
20615
20679
|
ImageEditor_1.Inject(Crop, Draw, Selection, Transform, Export, ToolbarModule);
|
|
20616
20680
|
ImageEditor_1.Inject(UndoRedo);
|
|
20617
20681
|
ImageEditor_1.Inject(Filter);
|
|
@@ -21370,7 +21434,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
21370
21434
|
this.aspectWidth = this.aspectHeight = null;
|
|
21371
21435
|
this.isResize = false;
|
|
21372
21436
|
this.drawingShape = null;
|
|
21373
|
-
this.isShapeDrawing = this.noPushUndo = this.isUndoRedoStack = false;
|
|
21437
|
+
this.isShapeDrawing = this.noPushUndo = this.isUndoRedoStack = this.isKBDNavigation = false;
|
|
21374
21438
|
this.shapeColl = [];
|
|
21375
21439
|
var obj_1 = { initialZoomValue: false };
|
|
21376
21440
|
this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj_1 } });
|
|
@@ -21436,15 +21500,16 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
21436
21500
|
*
|
|
21437
21501
|
* @param {string} type - Specifies a format of image to be saved.
|
|
21438
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.
|
|
21439
21504
|
*
|
|
21440
21505
|
* @remarks
|
|
21441
21506
|
* The supported file types are JPG, JPEG, PNG, and SVG.
|
|
21442
21507
|
*
|
|
21443
21508
|
* @returns {void}.
|
|
21444
21509
|
*/
|
|
21445
|
-
ImageEditor.prototype.export = function (type, fileName) {
|
|
21510
|
+
ImageEditor.prototype.export = function (type, fileName, imageQuality) {
|
|
21446
21511
|
this.applyShapes();
|
|
21447
|
-
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 } });
|
|
21448
21513
|
};
|
|
21449
21514
|
/**
|
|
21450
21515
|
* Perform selection in an image editor. The selection helps to crop an image.
|
|
@@ -25030,7 +25095,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25030
25095
|
var toolbarItems = [];
|
|
25031
25096
|
if (isOkBtn) {
|
|
25032
25097
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
25033
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
25098
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
25034
25099
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
25035
25100
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
25036
25101
|
}
|
|
@@ -25112,7 +25177,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25112
25177
|
}
|
|
25113
25178
|
if (isApplyOption) {
|
|
25114
25179
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
25115
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
25180
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
25116
25181
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
25117
25182
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
25118
25183
|
}
|
|
@@ -25256,7 +25321,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25256
25321
|
};
|
|
25257
25322
|
ToolbarModule.prototype.widthAspectRatio = function (e) {
|
|
25258
25323
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
25259
|
-
if (e.keyCode === 109) {
|
|
25324
|
+
if (e.keyCode === 109 || e.keyCode === 9) {
|
|
25260
25325
|
return;
|
|
25261
25326
|
}
|
|
25262
25327
|
var parent = this.parent;
|
|
@@ -25300,7 +25365,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25300
25365
|
};
|
|
25301
25366
|
ToolbarModule.prototype.heightAspectRatio = function (e) {
|
|
25302
25367
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
25303
|
-
if (e.keyCode === 109) {
|
|
25368
|
+
if (e.keyCode === 109 || e.keyCode === 9) {
|
|
25304
25369
|
return;
|
|
25305
25370
|
}
|
|
25306
25371
|
var parent = this.parent;
|
|
@@ -25368,7 +25433,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25368
25433
|
placeholder: isResize ? null : height, format: '###.## px' })
|
|
25369
25434
|
});
|
|
25370
25435
|
if (!this.isAspectRatio) {
|
|
25371
|
-
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 });
|
|
25372
25438
|
this.isAspectRatio = true;
|
|
25373
25439
|
}
|
|
25374
25440
|
else {
|
|
@@ -25377,7 +25443,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
25377
25443
|
}
|
|
25378
25444
|
if (!Browser.isDevice) {
|
|
25379
25445
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
25380
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
25446
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
25381
25447
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
25382
25448
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
25383
25449
|
}
|
|
@@ -26022,7 +26088,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26022
26088
|
{ id: 'svg', text: 'SVG' }
|
|
26023
26089
|
];
|
|
26024
26090
|
var inputObj = new TextBox({
|
|
26025
|
-
placeholder: this.l10n.getConstant('ImageName')
|
|
26091
|
+
placeholder: this.l10n.getConstant('ImageName')
|
|
26026
26092
|
});
|
|
26027
26093
|
inputObj.appendTo('#' + id + '_imgNametext');
|
|
26028
26094
|
var qualityContainer = document.getElementById(id + '_imgQualitydiv');
|
|
@@ -26193,7 +26259,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26193
26259
|
else {
|
|
26194
26260
|
imageNameLabel = document.getElementById(id + '_imageNameLabel');
|
|
26195
26261
|
}
|
|
26196
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26262
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
26197
26263
|
tempCanvas.toBlob((function (blob) {
|
|
26198
26264
|
fileSize = Math.floor(blob.size / 1024);
|
|
26199
26265
|
if (fileSize > 1000) {
|
|
@@ -26273,7 +26339,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26273
26339
|
}
|
|
26274
26340
|
if (!Browser.isDevice) {
|
|
26275
26341
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
26276
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
26342
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
26277
26343
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
26278
26344
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
26279
26345
|
}
|
|
@@ -26350,7 +26416,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26350
26416
|
parent.notify('selection', { prop: 'getCurrentDrawingShape', value: { obj: obj } });
|
|
26351
26417
|
if (obj['shape'] !== 'path') {
|
|
26352
26418
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
26353
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
26419
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
26354
26420
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
26355
26421
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
26356
26422
|
}
|
|
@@ -26964,7 +27030,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
26964
27030
|
}
|
|
26965
27031
|
if (!Browser.isDevice) {
|
|
26966
27032
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
26967
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
27033
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
26968
27034
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
26969
27035
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
26970
27036
|
}
|
|
@@ -27347,6 +27413,44 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27347
27413
|
}
|
|
27348
27414
|
this.currToolbar = type;
|
|
27349
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
|
+
}
|
|
27350
27454
|
};
|
|
27351
27455
|
ToolbarModule.prototype.performCropTransformClick = function (shape, isTransform) {
|
|
27352
27456
|
var parent = this.parent;
|
|
@@ -27412,7 +27516,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27412
27516
|
}
|
|
27413
27517
|
if (!Browser.isDevice) {
|
|
27414
27518
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
27415
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
27519
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
27416
27520
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
27417
27521
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
27418
27522
|
}
|
|
@@ -27465,7 +27569,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27465
27569
|
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Default') > -1)) {
|
|
27466
27570
|
toolbarItems.push({ id: id + '_default', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
27467
27571
|
tooltipText: this.l10n.getConstant('Default'), align: 'Center',
|
|
27468
|
-
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>' });
|
|
27469
27573
|
}
|
|
27470
27574
|
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
|
|
27471
27575
|
toolbarItems.push({ id: id + '_chrome', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
@@ -27538,7 +27642,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
27538
27642
|
}
|
|
27539
27643
|
if (!Browser.isDevice) {
|
|
27540
27644
|
toolbarItems.push({ id: id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
27541
|
-
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
27645
|
+
tooltipText: this.l10n.getConstant('OK'), align: 'Right', tabIndex: 0 });
|
|
27542
27646
|
toolbarItems.push({ id: id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
27543
27647
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
27544
27648
|
}
|