@syncfusion/ej2-image-editor 22.1.34 → 22.1.37
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/CHANGELOG.md +16 -0
- 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 +1018 -1064
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +1016 -1066
- 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/crop.d.ts +1 -0
- package/src/image-editor/action/crop.js +12 -1
- package/src/image-editor/action/draw.d.ts +4 -1
- package/src/image-editor/action/draw.js +137 -127
- package/src/image-editor/action/filter.js +1 -1
- package/src/image-editor/action/freehand-draw.js +9 -9
- package/src/image-editor/action/selection.d.ts +1 -1
- package/src/image-editor/action/selection.js +64 -226
- package/src/image-editor/action/shape.d.ts +1 -0
- package/src/image-editor/action/shape.js +97 -9
- package/src/image-editor/action/transform.js +211 -22
- package/src/image-editor/action/undo-redo.js +9 -7
- package/src/image-editor/base/image-editor-model.d.ts +2 -2
- package/src/image-editor/base/image-editor.d.ts +0 -15
- package/src/image-editor/base/image-editor.js +35 -225
- package/src/image-editor/base/interface.d.ts +11 -3
- package/src/image-editor/renderer/toolbar.js +362 -363
- package/styles/highcontrast-light.css +2 -2
- package/styles/highcontrast.css +6 -1
- package/styles/image-editor/_highcontrast-definition.scss +1 -1
- package/styles/image-editor/_highcontrast-light-definition.scss +1 -1
- package/styles/image-editor/_theme.scss +2 -4
- package/styles/image-editor/highcontrast-light.css +2 -2
- package/styles/image-editor/highcontrast.css +6 -1
|
@@ -9,6 +9,7 @@ var Crop = /** @__PURE__ @class */ (function () {
|
|
|
9
9
|
this.croppedDegree = 0; // Specifies the degree when crop is performed
|
|
10
10
|
this.cropDestPoints = { startX: 0, startY: 0, width: 0, height: 0 }; // To redraw old image when navigate to crop tab
|
|
11
11
|
this.tempFlipPanPoint = { x: 0, y: 0 };
|
|
12
|
+
this.isPreventScaling = false;
|
|
12
13
|
this.parent = parent;
|
|
13
14
|
this.addEventListener();
|
|
14
15
|
}
|
|
@@ -71,6 +72,9 @@ var Crop = /** @__PURE__ @class */ (function () {
|
|
|
71
72
|
this.tempFlipPanPoint.y += args.value['point'].y;
|
|
72
73
|
}
|
|
73
74
|
break;
|
|
75
|
+
case 'getPreventScaling':
|
|
76
|
+
args.value['obj']['bool'] = this.isPreventScaling;
|
|
77
|
+
break;
|
|
74
78
|
case 'reset':
|
|
75
79
|
this.reset();
|
|
76
80
|
break;
|
|
@@ -93,6 +97,7 @@ var Crop = /** @__PURE__ @class */ (function () {
|
|
|
93
97
|
this.croppedDegree = 0;
|
|
94
98
|
this.cropDestPoints = { startX: 0, startY: 0, width: 0, height: 0 };
|
|
95
99
|
this.tempFlipPanPoint = { x: 0, y: 0 };
|
|
100
|
+
this.isPreventScaling = false;
|
|
96
101
|
};
|
|
97
102
|
Crop.prototype.cropImg = function (isRotateCrop) {
|
|
98
103
|
var parent = this.parent;
|
|
@@ -710,7 +715,7 @@ var Crop = /** @__PURE__ @class */ (function () {
|
|
|
710
715
|
}
|
|
711
716
|
var transitionArgs = { cancel: false, startPoint: { x: parent.activeObj.activePoint.startX,
|
|
712
717
|
y: parent.activeObj.activePoint.startY }, endPoint: { x: parent.activeObj.activePoint.endX,
|
|
713
|
-
y: parent.activeObj.activePoint.endY } };
|
|
718
|
+
y: parent.activeObj.activePoint.endY }, preventScaling: false };
|
|
714
719
|
if (!object_1['isCropToolbar'] && isBlazor() && parent.events && parent.events.cropping.hasDelegate === true) {
|
|
715
720
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
716
721
|
parent.dotNetRef.invokeMethodAsync('CropEventAsync', 'OnCrop', transitionArgs).then(function (args) {
|
|
@@ -736,6 +741,12 @@ var Crop = /** @__PURE__ @class */ (function () {
|
|
|
736
741
|
obj.isCrop = true;
|
|
737
742
|
var prevCropObj = extend({}, parent.cropObj, {}, true);
|
|
738
743
|
var prevObj = extend({}, this.prevCropCurrObj, {}, true);
|
|
744
|
+
if (transitionArgs.preventScaling) {
|
|
745
|
+
this.isPreventScaling = true;
|
|
746
|
+
}
|
|
747
|
+
else {
|
|
748
|
+
this.isPreventScaling = false;
|
|
749
|
+
}
|
|
739
750
|
this.cropImg();
|
|
740
751
|
parent.transform.zoomFactor = 0;
|
|
741
752
|
parent.zoomSettings.zoomFactor = 1;
|
|
@@ -994,10 +1005,6 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
994
1005
|
case 'setPrevActObj':
|
|
995
1006
|
this.prevActObj = args.value['prevActObj'];
|
|
996
1007
|
break;
|
|
997
|
-
case 'getZoomCrop':
|
|
998
|
-
args.value['obj']['width'] = this.zoomCrop.width;
|
|
999
|
-
args.value['obj']['height'] = this.zoomCrop.height;
|
|
1000
|
-
break;
|
|
1001
1008
|
case 'setZoomCropWidth':
|
|
1002
1009
|
this.zoomCrop.width = args.value['width'];
|
|
1003
1010
|
this.zoomCrop.height = args.value['height'];
|
|
@@ -1026,6 +1033,9 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
1026
1033
|
case 'setArrowDimension':
|
|
1027
1034
|
this.arrowDimension = args.value['arrowDimension'];
|
|
1028
1035
|
break;
|
|
1036
|
+
case 'moveToSelectionRange':
|
|
1037
|
+
this.moveToSelectionRange(args.value['type'], args.value['activeObj']);
|
|
1038
|
+
break;
|
|
1029
1039
|
}
|
|
1030
1040
|
};
|
|
1031
1041
|
Draw.prototype.getModuleName = function () {
|
|
@@ -1313,8 +1323,10 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
1313
1323
|
};
|
|
1314
1324
|
Draw.prototype.adjToCenter = function () {
|
|
1315
1325
|
var parent = this.parent;
|
|
1316
|
-
var diffX = ((parent.lowerCanvas.width) / 2) - (parent.activeObj.activePoint.endX -
|
|
1317
|
-
|
|
1326
|
+
var diffX = ((parent.lowerCanvas.width) / 2) - (parent.activeObj.activePoint.endX -
|
|
1327
|
+
parent.activeObj.activePoint.width / 2);
|
|
1328
|
+
var diffY = ((parent.lowerCanvas.height) / 2) - (parent.activeObj.activePoint.endY -
|
|
1329
|
+
parent.activeObj.activePoint.height / 2);
|
|
1318
1330
|
parent.activeObj.activePoint.startX += diffX;
|
|
1319
1331
|
parent.activeObj.activePoint.endX += diffX;
|
|
1320
1332
|
parent.activeObj.activePoint.startY += diffY;
|
|
@@ -2761,11 +2773,22 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2761
2773
|
// proxy.reset();
|
|
2762
2774
|
// proxy.parent.baseImg.src = proxy.baseImgSrc;
|
|
2763
2775
|
proxy.isErrorImage = true;
|
|
2776
|
+
proxy.errorLoading();
|
|
2764
2777
|
};
|
|
2765
2778
|
};
|
|
2779
|
+
Draw.prototype.errorLoading = function () {
|
|
2780
|
+
var parent = this.parent;
|
|
2781
|
+
var fileOpened = { fileName: null, fileType: null, isValidImage: false };
|
|
2782
|
+
if (isBlazor() && parent.events && parent.events.fileOpened.hasDelegate === true) {
|
|
2783
|
+
parent.dotNetRef.invokeMethodAsync('FileOpenEventAsync', 'FileOpened', fileOpened);
|
|
2784
|
+
}
|
|
2785
|
+
else {
|
|
2786
|
+
parent.trigger('fileOpened', fileOpened);
|
|
2787
|
+
}
|
|
2788
|
+
};
|
|
2766
2789
|
Draw.prototype.updateCanvas = function () {
|
|
2767
2790
|
var parent = this.parent;
|
|
2768
|
-
var fileOpened = { fileName: this.fileName, fileType: this.fileType };
|
|
2791
|
+
var fileOpened = { fileName: this.fileName, fileType: this.fileType, isValidImage: true };
|
|
2769
2792
|
parent.img.srcWidth = parent.baseImg.width;
|
|
2770
2793
|
parent.img.srcHeight = parent.baseImg.height;
|
|
2771
2794
|
var obj = { width: 0, height: 0 };
|
|
@@ -2944,10 +2967,6 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
2944
2967
|
else if (isCropSelection) {
|
|
2945
2968
|
this.cancelSelection();
|
|
2946
2969
|
}
|
|
2947
|
-
else if ((parent.transform.zoomFactor !== this.tempZoomFactor) || isCropSelection &&
|
|
2948
|
-
isNullOrUndefined(parent.currSelectionPoint)) {
|
|
2949
|
-
this.cancelZoom();
|
|
2950
|
-
}
|
|
2951
2970
|
else {
|
|
2952
2971
|
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
2953
2972
|
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
@@ -3089,114 +3108,6 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
3089
3108
|
}
|
|
3090
3109
|
}
|
|
3091
3110
|
};
|
|
3092
|
-
Draw.prototype.cancelZoom = function () {
|
|
3093
|
-
var parent = this.parent;
|
|
3094
|
-
var length = parent.transform.cropZoomFactor - this.tempZoomFactor;
|
|
3095
|
-
parent.transform.zoomFactor = parent.transform.cropZoomFactor;
|
|
3096
|
-
if (isNullOrUndefined(parent.cropObj.activeObj.shape)) {
|
|
3097
|
-
if ((parent.transform.degree === 0 && parent.panPoint.totalPannedPoint.x === 0 && parent.panPoint.totalPannedPoint.y === 0)
|
|
3098
|
-
|| (parent.transform.degree !== 0 && parent.panPoint.totalPannedInternalPoint.x === 0 &&
|
|
3099
|
-
parent.panPoint.totalPannedInternalPoint.y === 0 && parent.panPoint.totalPannedClientPoint.x === 0 &&
|
|
3100
|
-
parent.panPoint.totalPannedClientPoint.y === 0)) {
|
|
3101
|
-
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
3102
|
-
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
3103
|
-
if (length > 0) {
|
|
3104
|
-
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
3105
|
-
value: { zoomFactor: -length, zoomPoint: null } });
|
|
3106
|
-
}
|
|
3107
|
-
else {
|
|
3108
|
-
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
3109
|
-
value: { zoomFactor: Math.abs(length), zoomPoint: null } });
|
|
3110
|
-
}
|
|
3111
|
-
parent.transform.cropZoomFactor = this.tempZoomFactor;
|
|
3112
|
-
parent.currObjType.isCustomCrop = false;
|
|
3113
|
-
parent.upperCanvas.style.cursor = parent.cursor = 'default';
|
|
3114
|
-
parent.currObjType.isCustomCrop = false;
|
|
3115
|
-
this.tempStrokeSettings = { strokeColor: '#fff', fillColor: '', strokeWidth: null };
|
|
3116
|
-
var eventargs = { type: 'main', isApplyBtn: null, isCropping: false, isZooming: null };
|
|
3117
|
-
if (!isBlazor()) {
|
|
3118
|
-
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: eventargs });
|
|
3119
|
-
}
|
|
3120
|
-
else {
|
|
3121
|
-
parent.updateToolbar(parent.element, 'imageLoaded');
|
|
3122
|
-
}
|
|
3123
|
-
return;
|
|
3124
|
-
}
|
|
3125
|
-
}
|
|
3126
|
-
if (isNullOrUndefined(parent.cropObj.activeObj.shape)) {
|
|
3127
|
-
if (parent.transform.degree === 0) {
|
|
3128
|
-
var activeObj = extend({}, parent.activeObj, {});
|
|
3129
|
-
parent.img.destLeft += (-parent.panPoint.totalPannedPoint.x);
|
|
3130
|
-
parent.img.destTop += (-parent.panPoint.totalPannedPoint.y);
|
|
3131
|
-
parent.notify('transform', { prop: 'drawPannImage', onPropertyChange: false,
|
|
3132
|
-
value: { point: { x: -parent.panPoint.totalPannedPoint.x, y: -parent.panPoint.totalPannedPoint.y } } });
|
|
3133
|
-
this.updateFlipPan(activeObj);
|
|
3134
|
-
parent.panPoint.totalPannedPoint = { x: 0, y: 0 };
|
|
3135
|
-
}
|
|
3136
|
-
else {
|
|
3137
|
-
parent.panPoint.totalPannedClientPoint = { x: -parent.panPoint.totalPannedClientPoint.x,
|
|
3138
|
-
y: -parent.panPoint.totalPannedClientPoint.y };
|
|
3139
|
-
parent.panPoint.totalPannedInternalPoint = { x: -parent.panPoint.totalPannedInternalPoint.x,
|
|
3140
|
-
y: -parent.panPoint.totalPannedInternalPoint.y };
|
|
3141
|
-
parent.notify('transform', { prop: 'rotatePan', onPropertyChange: false,
|
|
3142
|
-
value: { isCropSelection: true, isDefaultZoom: null } });
|
|
3143
|
-
parent.panPoint.totalPannedClientPoint = { x: 0, y: 0 };
|
|
3144
|
-
parent.panPoint.totalPannedInternalPoint = { x: 0, y: 0 };
|
|
3145
|
-
parent.panPoint.currentPannedPoint = { x: 0, y: 0 };
|
|
3146
|
-
}
|
|
3147
|
-
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
3148
|
-
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
3149
|
-
if (length > 0) {
|
|
3150
|
-
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
3151
|
-
value: { zoomFactor: -length, zoomPoint: null } });
|
|
3152
|
-
}
|
|
3153
|
-
else {
|
|
3154
|
-
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
3155
|
-
value: { zoomFactor: Math.abs(length), zoomPoint: null } });
|
|
3156
|
-
}
|
|
3157
|
-
parent.transform.cropZoomFactor = this.tempZoomFactor;
|
|
3158
|
-
}
|
|
3159
|
-
else {
|
|
3160
|
-
this.isCancelAction = true;
|
|
3161
|
-
parent.objColl = [];
|
|
3162
|
-
parent.pointColl = [];
|
|
3163
|
-
var freehandCounter = parent.freehandCounter;
|
|
3164
|
-
parent.freehandCounter = 0;
|
|
3165
|
-
var object = { selPointColl: null };
|
|
3166
|
-
parent.notify('freehand-draw', { prop: 'getSelPointColl', onPropertyChange: false,
|
|
3167
|
-
value: { obj: object } });
|
|
3168
|
-
var cropSelPointColl = object['selPointColl'];
|
|
3169
|
-
parent.notify('freehand-draw', { prop: 'setSelPointColl', onPropertyChange: false,
|
|
3170
|
-
value: { obj: { selPointColl: [] } } });
|
|
3171
|
-
var cropObj = extend({}, parent.cropObj, {});
|
|
3172
|
-
var afterCropActions = extend([], parent.afterCropActions, {}, true);
|
|
3173
|
-
this.setCurrentObj();
|
|
3174
|
-
parent.notify('crop', { prop: 'cropImg', onPropertyChange: false, value: { isRotateCrop: null } });
|
|
3175
|
-
parent.cropObj = cropObj;
|
|
3176
|
-
parent.afterCropActions = afterCropActions;
|
|
3177
|
-
parent.objColl = extend([], this.cancelObjColl, [], true);
|
|
3178
|
-
parent.pointColl = extend([], this.cancelPointColl, [], true);
|
|
3179
|
-
parent.freehandCounter = freehandCounter;
|
|
3180
|
-
parent.notify('freehand-draw', { prop: 'setSelPointColl', onPropertyChange: false,
|
|
3181
|
-
value: { obj: { selPointColl: cropSelPointColl } } });
|
|
3182
|
-
parent.notify('shape', { prop: 'iterateObjColl', onPropertyChange: false });
|
|
3183
|
-
parent.notify('freehand-draw', { prop: 'freehandRedraw', onPropertyChange: false,
|
|
3184
|
-
value: { context: this.lowerContext, points: null } });
|
|
3185
|
-
this.clearOuterCanvas(this.lowerContext);
|
|
3186
|
-
if (parent.isCircleCrop) {
|
|
3187
|
-
parent.notify('crop', { prop: 'cropCircle', onPropertyChange: false,
|
|
3188
|
-
value: { context: this.lowerContext, isSave: null, isFlip: null } });
|
|
3189
|
-
}
|
|
3190
|
-
this.isCancelAction = false;
|
|
3191
|
-
}
|
|
3192
|
-
parent.transform.zoomFactor = parent.transform.defaultZoomFactor;
|
|
3193
|
-
if (!isBlazor()) {
|
|
3194
|
-
parent.notify('toolbar', { prop: 'enable-disable-btns', onPropertyChange: false });
|
|
3195
|
-
}
|
|
3196
|
-
else {
|
|
3197
|
-
parent.updateToolbar(parent.element, 'enableDisableToolbarBtn');
|
|
3198
|
-
}
|
|
3199
|
-
};
|
|
3200
3111
|
Draw.prototype.updateFlipPan = function (tempSelectionObj) {
|
|
3201
3112
|
var parent = this.parent;
|
|
3202
3113
|
if (parent.transform.currFlipState !== '') {
|
|
@@ -3858,13 +3769,8 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
3858
3769
|
parent.notify('toolbar', { prop: 'getDefToolbarItems', value: { obj: obj } });
|
|
3859
3770
|
if (obj['defToolbarItems'].length === 0 &&
|
|
3860
3771
|
(isNullOrUndefined(document.getElementById(parent.element.id + '_toolbar')))) {
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
}
|
|
3864
|
-
else if (parent.element.querySelector('#' + parent.element.id + '_toolbarArea')) {
|
|
3865
|
-
var height = parent.element.querySelector('#' + parent.element.id + '_toolbarArea').clientHeight;
|
|
3866
|
-
parent.notify('toolbar', { prop: 'setToolbarHeight', value: { height: height } });
|
|
3867
|
-
}
|
|
3772
|
+
var height = parent.element.querySelector('#' + parent.element.id + '_toolbarArea').clientHeight;
|
|
3773
|
+
parent.notify('toolbar', { prop: 'setToolbarHeight', value: { height: height } });
|
|
3868
3774
|
}
|
|
3869
3775
|
}
|
|
3870
3776
|
else {
|
|
@@ -4021,6 +3927,7 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
4021
3927
|
var fileData = filesData;
|
|
4022
3928
|
var fileExtension = fileData.name && fileData.name.split('.')[1].toLowerCase();
|
|
4023
3929
|
if (fileExtension && ['jpg', 'jpeg', 'png', 'svg'].indexOf(fileExtension) === -1) {
|
|
3930
|
+
this.errorLoading();
|
|
4024
3931
|
return;
|
|
4025
3932
|
}
|
|
4026
3933
|
showSpinner(parent.element);
|
|
@@ -4068,6 +3975,121 @@ var Draw = /** @__PURE__ @class */ (function () {
|
|
|
4068
3975
|
this.imageOnLoad(url.toString());
|
|
4069
3976
|
inputElement.value = '';
|
|
4070
3977
|
};
|
|
3978
|
+
Draw.prototype.moveToSelectionRange = function (type, activeObj) {
|
|
3979
|
+
var parent = this.parent;
|
|
3980
|
+
if (parent.activeObj.shape) {
|
|
3981
|
+
if (type === 'rotateleft' || type === 'rotateright') {
|
|
3982
|
+
var zoomFactor = parent.transform.zoomFactor;
|
|
3983
|
+
parent.objColl.push(parent.activeObj);
|
|
3984
|
+
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
3985
|
+
if (parent.transform.degree % 90 === 0 && parent.transform.degree % 180 !== 0) {
|
|
3986
|
+
if (parent.objColl[parent.objColl.length - 1].activePoint.width < activeObj.activePoint.height) {
|
|
3987
|
+
for (var i = 2; i < parent.zoomSettings.maxZoomFactor; i++) {
|
|
3988
|
+
if (parent.objColl[parent.objColl.length - 1].activePoint.width >= activeObj.activePoint.height ||
|
|
3989
|
+
this.isSelectionBiggerThanCanvas(parent.objColl[parent.objColl.length - 1]) ||
|
|
3990
|
+
this.isSelectionOutsideCanvas(parent.objColl[parent.objColl.length - 1])) {
|
|
3991
|
+
if (!isNullOrUndefined(zoomFactor)) {
|
|
3992
|
+
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
3993
|
+
value: { zoomFactor: -0.1, zoomPoint: null } });
|
|
3994
|
+
}
|
|
3995
|
+
break;
|
|
3996
|
+
}
|
|
3997
|
+
zoomFactor += 0.1;
|
|
3998
|
+
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
3999
|
+
value: { zoomFactor: zoomFactor, zoomPoint: null } });
|
|
4000
|
+
}
|
|
4001
|
+
}
|
|
4002
|
+
else {
|
|
4003
|
+
for (var i = 2; i < parent.zoomSettings.maxZoomFactor; i++) {
|
|
4004
|
+
if (parent.objColl[parent.objColl.length - 1].activePoint.width >= activeObj.activePoint.height ||
|
|
4005
|
+
this.isSelectionBiggerThanCanvas(parent.objColl[parent.objColl.length - 1]) ||
|
|
4006
|
+
this.isSelectionOutsideCanvas(parent.objColl[parent.objColl.length - 1])) {
|
|
4007
|
+
if (!isNullOrUndefined(zoomFactor)) {
|
|
4008
|
+
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
4009
|
+
value: { zoomFactor: 0.1, zoomPoint: null } });
|
|
4010
|
+
}
|
|
4011
|
+
break;
|
|
4012
|
+
}
|
|
4013
|
+
zoomFactor -= .1;
|
|
4014
|
+
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
4015
|
+
value: { zoomFactor: zoomFactor, zoomPoint: null } });
|
|
4016
|
+
}
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
else {
|
|
4020
|
+
if (parent.objColl[parent.objColl.length - 1].activePoint.height < activeObj.activePoint.width) {
|
|
4021
|
+
for (var i = 2; i < parent.zoomSettings.maxZoomFactor; i++) {
|
|
4022
|
+
if (parent.objColl[parent.objColl.length - 1].activePoint.height >= activeObj.activePoint.width ||
|
|
4023
|
+
this.isSelectionBiggerThanCanvas(parent.objColl[parent.objColl.length - 1]) ||
|
|
4024
|
+
this.isSelectionOutsideCanvas(parent.objColl[parent.objColl.length - 1])) {
|
|
4025
|
+
if (!isNullOrUndefined(zoomFactor)) {
|
|
4026
|
+
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
4027
|
+
value: { zoomFactor: -0.1, zoomPoint: null } });
|
|
4028
|
+
}
|
|
4029
|
+
break;
|
|
4030
|
+
}
|
|
4031
|
+
zoomFactor += 0.1;
|
|
4032
|
+
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
4033
|
+
value: { zoomFactor: zoomFactor, zoomPoint: null } });
|
|
4034
|
+
}
|
|
4035
|
+
}
|
|
4036
|
+
else {
|
|
4037
|
+
for (var i = 2; i < parent.zoomSettings.maxZoomFactor; i++) {
|
|
4038
|
+
if (parent.objColl[parent.objColl.length - 1].activePoint.height >= activeObj.activePoint.width ||
|
|
4039
|
+
this.isSelectionBiggerThanCanvas(parent.objColl[parent.objColl.length - 1]) ||
|
|
4040
|
+
this.isSelectionOutsideCanvas(parent.objColl[parent.objColl.length - 1])) {
|
|
4041
|
+
if (!isNullOrUndefined(zoomFactor)) {
|
|
4042
|
+
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
4043
|
+
value: { zoomFactor: 0.1, zoomPoint: null } });
|
|
4044
|
+
}
|
|
4045
|
+
break;
|
|
4046
|
+
}
|
|
4047
|
+
zoomFactor -= .1;
|
|
4048
|
+
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
4049
|
+
value: { zoomFactor: zoomFactor, zoomPoint: null } });
|
|
4050
|
+
}
|
|
4051
|
+
}
|
|
4052
|
+
}
|
|
4053
|
+
var panX = (parent.lowerCanvas.clientWidth / 2) - (parent.objColl[parent.objColl.length - 1].activePoint.startX +
|
|
4054
|
+
(parent.objColl[parent.objColl.length - 1].activePoint.width / 2));
|
|
4055
|
+
var panY = (parent.lowerCanvas.clientHeight / 2) - (parent.objColl[parent.objColl.length - 1].activePoint.startY +
|
|
4056
|
+
(parent.objColl[parent.objColl.length - 1].activePoint.height / 2));
|
|
4057
|
+
if (parent.transform.degree === 0) {
|
|
4058
|
+
parent.img.destLeft += panX;
|
|
4059
|
+
parent.img.destTop += panY;
|
|
4060
|
+
parent.notify('transform', { prop: 'drawPannImage', value: { point: { x: panX, y: panY } } });
|
|
4061
|
+
}
|
|
4062
|
+
else {
|
|
4063
|
+
parent.panPoint.currentPannedPoint = { x: panX, y: panY };
|
|
4064
|
+
parent.notify('transform', { prop: 'drawPannedImage', value: { xDiff: panX, yDiff: panY } });
|
|
4065
|
+
parent.panPoint.currentPannedPoint = { x: 0, y: 0 };
|
|
4066
|
+
}
|
|
4067
|
+
parent.notify('transform', { prop: 'setTempPanMove', onPropertyChange: false,
|
|
4068
|
+
value: { point: null } });
|
|
4069
|
+
parent.activeObj = extend({}, parent.objColl[parent.objColl.length - 1]);
|
|
4070
|
+
parent.objColl.pop();
|
|
4071
|
+
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj } });
|
|
4072
|
+
}
|
|
4073
|
+
}
|
|
4074
|
+
};
|
|
4075
|
+
Draw.prototype.isSelectionBiggerThanCanvas = function (obj) {
|
|
4076
|
+
var isBigger = false;
|
|
4077
|
+
if (obj.activePoint.startX <= this.parent.img.destLeft ||
|
|
4078
|
+
obj.activePoint.startY <= this.parent.img.destTop ||
|
|
4079
|
+
obj.activePoint.endX >= this.parent.img.destLeft + this.parent.img.destWidth ||
|
|
4080
|
+
obj.activePoint.endY >= this.parent.img.destTop + this.parent.img.destHeight) {
|
|
4081
|
+
isBigger = true;
|
|
4082
|
+
}
|
|
4083
|
+
return isBigger;
|
|
4084
|
+
};
|
|
4085
|
+
Draw.prototype.isSelectionOutsideCanvas = function (obj) {
|
|
4086
|
+
var isOutside = false;
|
|
4087
|
+
if ((obj.activePoint.height < this.parent.lowerCanvas.height - this.parent.toolbarHeight) ||
|
|
4088
|
+
(obj.activePoint.width < this.parent.lowerCanvas.width)) {
|
|
4089
|
+
isOutside = true;
|
|
4090
|
+
}
|
|
4091
|
+
return isOutside;
|
|
4092
|
+
};
|
|
4071
4093
|
return Draw;
|
|
4072
4094
|
}());
|
|
4073
4095
|
|
|
@@ -4523,7 +4545,7 @@ var Filter = /** @__PURE__ @class */ (function () {
|
|
|
4523
4545
|
};
|
|
4524
4546
|
Filter.prototype.updatePrivateVariables = function () {
|
|
4525
4547
|
var parent = this.parent;
|
|
4526
|
-
if (
|
|
4548
|
+
if (parent.lowerCanvas) {
|
|
4527
4549
|
this.lowerContext = parent.lowerCanvas.getContext('2d');
|
|
4528
4550
|
}
|
|
4529
4551
|
};
|
|
@@ -5833,7 +5855,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
5833
5855
|
FreehandDrawing.prototype.updateFHDCurPts = function () {
|
|
5834
5856
|
var parent = this.parent;
|
|
5835
5857
|
for (var n = 0; n < parent.freehandCounter; n++) {
|
|
5836
|
-
if (
|
|
5858
|
+
if (this.selPointColl[n]) {
|
|
5837
5859
|
this.selPoints = extend([], this.selPointColl[n].points, []);
|
|
5838
5860
|
this.pointCounter = 0;
|
|
5839
5861
|
var len = this.selPoints.length;
|
|
@@ -5861,7 +5883,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
5861
5883
|
}
|
|
5862
5884
|
// Update rotation points for each point for cursor styles
|
|
5863
5885
|
for (var n = 0; n < parent.freehandCounter; n++) {
|
|
5864
|
-
if (
|
|
5886
|
+
if (this.selPointColl[n]) {
|
|
5865
5887
|
this.selPoints = extend([], this.selPointColl[n].points, []);
|
|
5866
5888
|
this.pointCounter = 0;
|
|
5867
5889
|
var len = this.selPoints.length;
|
|
@@ -5917,7 +5939,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
5917
5939
|
}
|
|
5918
5940
|
// Update flip value for each points for cursor styles
|
|
5919
5941
|
for (var n = 0; n < parent.freehandCounter; n++) {
|
|
5920
|
-
if (
|
|
5942
|
+
if (this.selPointColl[n]) {
|
|
5921
5943
|
if (this.selPointColl[n].shapeFlip !== parent.transform.currFlipState) {
|
|
5922
5944
|
this.selPoints = extend([], this.selPointColl[n].points, []);
|
|
5923
5945
|
this.pointCounter = 0;
|
|
@@ -5964,7 +5986,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
5964
5986
|
}
|
|
5965
5987
|
// Update flip value for each points for cursor styles
|
|
5966
5988
|
for (var n = 0; n < parent.freehandCounter; n++) {
|
|
5967
|
-
if (
|
|
5989
|
+
if (this.selPointColl[n]) {
|
|
5968
5990
|
if (this.selPointColl[n].shapeFlip !== parent.transform.currFlipState) {
|
|
5969
5991
|
this.selPoints = extend([], this.selPointColl[n].points, []);
|
|
5970
5992
|
this.pointCounter = 0;
|
|
@@ -6015,7 +6037,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
6015
6037
|
}
|
|
6016
6038
|
}
|
|
6017
6039
|
for (var n = 0; n < parent.freehandCounter; n++) {
|
|
6018
|
-
if (
|
|
6040
|
+
if (this.selPointColl[n]) {
|
|
6019
6041
|
this.selPoints = extend([], this.selPointColl[n].points, []);
|
|
6020
6042
|
this.pointCounter = 0;
|
|
6021
6043
|
var len = this.selPoints.length;
|
|
@@ -6050,7 +6072,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
6050
6072
|
}
|
|
6051
6073
|
// Updating each points for cursor styles for panning
|
|
6052
6074
|
for (var n = 0; n < parent.freehandCounter; n++) {
|
|
6053
|
-
if (
|
|
6075
|
+
if (this.selPointColl[n]) {
|
|
6054
6076
|
this.selPoints = extend([], this.selPointColl[n].points, []);
|
|
6055
6077
|
this.pointCounter = 0;
|
|
6056
6078
|
var len = this.selPoints.length;
|
|
@@ -6113,13 +6135,13 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
6113
6135
|
FreehandDrawing.prototype.isFHDIdx = function (index, obj) {
|
|
6114
6136
|
var isIndex = false;
|
|
6115
6137
|
for (var i = 0; i < this.parent.freehandCounter; i++) {
|
|
6116
|
-
if (
|
|
6138
|
+
if (this.parent.pointColl[i].id &&
|
|
6117
6139
|
parseInt(this.parent.pointColl[i].id.split('_')[1], 10) - 1 === index) {
|
|
6118
6140
|
isIndex = true;
|
|
6119
6141
|
break;
|
|
6120
6142
|
}
|
|
6121
6143
|
}
|
|
6122
|
-
if (
|
|
6144
|
+
if (obj) {
|
|
6123
6145
|
obj['isIndex'] = isIndex;
|
|
6124
6146
|
}
|
|
6125
6147
|
return isIndex;
|
|
@@ -6128,7 +6150,7 @@ var FreehandDrawing = /** @__PURE__ @class */ (function () {
|
|
|
6128
6150
|
var parent = this.parent;
|
|
6129
6151
|
for (var n = 0; n < parent.freehandCounter; n++) {
|
|
6130
6152
|
var obj = { selPointColl: extend([], this.selPointColl) };
|
|
6131
|
-
if (
|
|
6153
|
+
if (obj['selPointColl'][n]) {
|
|
6132
6154
|
this.selPoints = extend([], obj['selPointColl'][n].points, []);
|
|
6133
6155
|
this.pointCounter = 0;
|
|
6134
6156
|
var len = this.selPoints.length;
|
|
@@ -6275,9 +6297,6 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
6275
6297
|
case 'handleScroll':
|
|
6276
6298
|
this.handleScroll(args.value['e']);
|
|
6277
6299
|
break;
|
|
6278
|
-
case 'adjustToScreen':
|
|
6279
|
-
this.adjustToScreen();
|
|
6280
|
-
break;
|
|
6281
6300
|
case 'textKeyDown':
|
|
6282
6301
|
setTimeout(this.textKeyDown.bind(this), 1, args.value['e']);
|
|
6283
6302
|
break;
|
|
@@ -6369,9 +6388,24 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
6369
6388
|
case 'getTransRotationPoint':
|
|
6370
6389
|
this.getTransRotationPoint(args.value['obj'], args.value['object']);
|
|
6371
6390
|
break;
|
|
6391
|
+
case 'adjustNEPoints':
|
|
6392
|
+
this.adjustNEPoints(args.value['rectangle'], args.value['x'], args.value['y'], args.value['angle']);
|
|
6393
|
+
break;
|
|
6394
|
+
case 'adjustRotationPoints':
|
|
6395
|
+
this.adjustRotationPoints(args.value['rectangle'], args.value['x'], args.value['y'], args.value['angle']);
|
|
6396
|
+
break;
|
|
6397
|
+
case 'getResizeDirection':
|
|
6398
|
+
this.getResizeDirection(args.value['rectangle'], args.value['x'], args.value['y'], args.value['angle']);
|
|
6399
|
+
break;
|
|
6400
|
+
case 'setResizedElement':
|
|
6401
|
+
this.resizedElement = args.value['value'];
|
|
6402
|
+
break;
|
|
6372
6403
|
case 'reset':
|
|
6373
6404
|
this.reset();
|
|
6374
6405
|
break;
|
|
6406
|
+
case 'unWireEvent':
|
|
6407
|
+
this.unwireEvent();
|
|
6408
|
+
break;
|
|
6375
6409
|
}
|
|
6376
6410
|
};
|
|
6377
6411
|
Selection.prototype.getModuleName = function () {
|
|
@@ -6379,10 +6413,10 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
6379
6413
|
};
|
|
6380
6414
|
Selection.prototype.updatePrivateVariables = function () {
|
|
6381
6415
|
var parent = this.parent;
|
|
6382
|
-
if (
|
|
6416
|
+
if (parent.lowerCanvas) {
|
|
6383
6417
|
this.lowerContext = parent.lowerCanvas.getContext('2d');
|
|
6384
6418
|
}
|
|
6385
|
-
if (
|
|
6419
|
+
if (parent.upperCanvas) {
|
|
6386
6420
|
this.upperContext = parent.upperCanvas.getContext('2d');
|
|
6387
6421
|
}
|
|
6388
6422
|
};
|
|
@@ -6493,7 +6527,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
6493
6527
|
cursor = 'move';
|
|
6494
6528
|
}
|
|
6495
6529
|
}
|
|
6496
|
-
else if (
|
|
6530
|
+
else if (rotationCirclePoint && !isApply &&
|
|
6497
6531
|
x >= (rotationCirclePoint.x - (actObj.bottomCenterCircle.radius + 2)) &&
|
|
6498
6532
|
x <= rotationCirclePoint.x + (actObj.bottomCenterCircle.radius + 2) &&
|
|
6499
6533
|
y >= rotationCirclePoint.y - (actObj.bottomCenterCircle.radius + 2) &&
|
|
@@ -6595,7 +6629,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
6595
6629
|
}
|
|
6596
6630
|
}
|
|
6597
6631
|
if ((parent.cursor === 'default' || parent.cursor === 'grab')
|
|
6598
|
-
&&
|
|
6632
|
+
&& parent.pointColl[0] && (parent.cursor !== 'grab' || !isCropSelection)
|
|
6599
6633
|
&& !parent.currObjType.isDragging && !parent.currObjType.isResize) {
|
|
6600
6634
|
this.setCursorForFreehandDrawing(x, y, upperCanvas);
|
|
6601
6635
|
}
|
|
@@ -6713,7 +6747,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
6713
6747
|
(actObj.bottomCenterCircle.radius + 2))) {
|
|
6714
6748
|
upperCanvas.style.cursor = parent.cursor = 'se-resize';
|
|
6715
6749
|
}
|
|
6716
|
-
else if (
|
|
6750
|
+
else if (actObj.rotationCirclePointColl &&
|
|
6717
6751
|
x >= (actObj.rotationCirclePointColl.x - (actObj.bottomCenterCircle.radius + 2)) &&
|
|
6718
6752
|
x <= actObj.rotationCirclePointColl.x + (actObj.bottomCenterCircle.radius + 2) &&
|
|
6719
6753
|
y >= actObj.rotationCirclePointColl.y - (actObj.bottomCenterCircle.radius + 2) &&
|
|
@@ -6781,7 +6815,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
6781
6815
|
if ((length >= 92 && length <= 182) || (length >= -178 && length <= -88)) {
|
|
6782
6816
|
var cursorMap = { 'nw-resize': 'ne-resize', 'n-resize': 's-resize',
|
|
6783
6817
|
'ne-resize': 'nw-resize', 'w-resize': 'e-resize', 'e-resize': 'w-resize',
|
|
6784
|
-
'sw-resize': 'se-resize', 's-resize': 'n-resize', 'se-resize': 'sw-resize'
|
|
6818
|
+
'sw-resize': 'se-resize', 's-resize': 'n-resize', 'se-resize': 'sw-resize'
|
|
6785
6819
|
};
|
|
6786
6820
|
if (parent.cursor in cursorMap) {
|
|
6787
6821
|
parent.cursor = cursorMap[parent.cursor];
|
|
@@ -6926,7 +6960,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
6926
6960
|
else if (!this.isFhdEditing || parent.pointColl[n].isSelected) {
|
|
6927
6961
|
if (this.isFhdPoint || this.isFhdEditing) {
|
|
6928
6962
|
upperContext.clearRect(0, 0, upperCanvas.width, upperCanvas.height);
|
|
6929
|
-
if (
|
|
6963
|
+
if (parent.activeObj.shape && textArea.style.display === 'none') {
|
|
6930
6964
|
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj } });
|
|
6931
6965
|
}
|
|
6932
6966
|
}
|
|
@@ -7202,7 +7236,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
7202
7236
|
if (splitWords !== undefined && splitWords[0] === 'crop') {
|
|
7203
7237
|
this.isCropSelection = true;
|
|
7204
7238
|
}
|
|
7205
|
-
if (!this.isCropSelection && this.parent.eventType !== 'resize' && isBlazor() &&
|
|
7239
|
+
if (!this.isCropSelection && this.parent.eventType !== 'resize' && isBlazor() && parent.events && this.parent.events.onShapeResizeStart.hasDelegate === true) {
|
|
7206
7240
|
shapeResizingArgs.action = 'resize-start';
|
|
7207
7241
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
7208
7242
|
parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShapeResizeStart', shapeResizingArgs).then(function (shapeResizingArgs) {
|
|
@@ -8413,7 +8447,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8413
8447
|
isResize = true;
|
|
8414
8448
|
this.dragElement = parent.upperCanvas.style.cursor;
|
|
8415
8449
|
}
|
|
8416
|
-
else if (
|
|
8450
|
+
else if (rotationCirclePoint &&
|
|
8417
8451
|
x >= rotationCirclePoint.x - (actObj.topLeftCircle.radius * 2) &&
|
|
8418
8452
|
x <= rotationCirclePoint.x + (actObj.topLeftCircle.radius * 2) &&
|
|
8419
8453
|
y >= rotationCirclePoint.y - (actObj.topLeftCircle.radius * 2) &&
|
|
@@ -8724,7 +8758,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8724
8758
|
this.dragCanvas = parent.togglePan = true;
|
|
8725
8759
|
}
|
|
8726
8760
|
var imageEditorClickEventArgs = { point: this.setXYPoints(e) };
|
|
8727
|
-
if (isBlazor() &&
|
|
8761
|
+
if (isBlazor() && parent.events && parent.events.clicked.hasDelegate === true) {
|
|
8728
8762
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
8729
8763
|
parent.dotNetRef.invokeMethodAsync('ClickEventAsync', 'click', imageEditorClickEventArgs).then(function (imageEditorClickEventArgs) {
|
|
8730
8764
|
_this.clickEvent(imageEditorClickEventArgs, e);
|
|
@@ -8755,7 +8789,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8755
8789
|
var parent = this.parent;
|
|
8756
8790
|
var x = imageEditorClickEventArgs.point.x;
|
|
8757
8791
|
var y = imageEditorClickEventArgs.point.y;
|
|
8758
|
-
var cursor =
|
|
8792
|
+
var cursor = parent.activeObj.shape && parent.activeObj.shape === 'text' ?
|
|
8759
8793
|
parent.cursor : 'default';
|
|
8760
8794
|
if (this.currentDrawingShape !== '') {
|
|
8761
8795
|
var object_1 = { currObj: {} };
|
|
@@ -8791,7 +8825,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8791
8825
|
this.isPan = false;
|
|
8792
8826
|
}
|
|
8793
8827
|
}
|
|
8794
|
-
if (
|
|
8828
|
+
if (parent.activeObj.shape) {
|
|
8795
8829
|
this.isObjSelected = true;
|
|
8796
8830
|
}
|
|
8797
8831
|
else {
|
|
@@ -8805,7 +8839,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8805
8839
|
var isFreehandDraw = this.isFreehandDrawTouch(e, this.isCropSelection);
|
|
8806
8840
|
var isShapeClick = isShape ? isShape : this.isShapeClick(e, this.isCropSelection);
|
|
8807
8841
|
var allowUndoRedoPush = this.applyCurrShape(isShapeClick);
|
|
8808
|
-
if (this.isTouch && !isShape &&
|
|
8842
|
+
if (this.isTouch && !isShape && activeObj.shape && !this.isCropSelection) {
|
|
8809
8843
|
if (this.applyObj(x, y)) {
|
|
8810
8844
|
parent.okBtn(true);
|
|
8811
8845
|
parent.notify('draw', { prop: 'setPrevActObj', onPropertyChange: false, value: { prevActObj: null } });
|
|
@@ -8840,11 +8874,12 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8840
8874
|
}
|
|
8841
8875
|
if (this.isFhdEditing) {
|
|
8842
8876
|
parent.notify('freehand-draw', { prop: 'applyFhd', onPropertyChange: false });
|
|
8877
|
+
this.isFhdCustomized = false;
|
|
8843
8878
|
if (!isBlazor()) {
|
|
8844
8879
|
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
8845
8880
|
}
|
|
8846
8881
|
}
|
|
8847
|
-
if (
|
|
8882
|
+
if (parent.activeObj.shape && (parent.activeObj.shape === 'rectangle' ||
|
|
8848
8883
|
parent.activeObj.shape === 'ellipse' || parent.activeObj.shape === 'line' ||
|
|
8849
8884
|
parent.activeObj.shape === 'arrow' || parent.activeObj.shape === 'path' || parent.activeObj.shape === 'text')) {
|
|
8850
8885
|
parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
|
|
@@ -8862,7 +8897,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8862
8897
|
}
|
|
8863
8898
|
else {
|
|
8864
8899
|
var isLineArrow = false;
|
|
8865
|
-
if (
|
|
8900
|
+
if (parent.activeObj.shape && (parent.activeObj.shape === 'line' ||
|
|
8866
8901
|
parent.activeObj.shape === 'arrow')) {
|
|
8867
8902
|
isLineArrow = true;
|
|
8868
8903
|
}
|
|
@@ -8918,7 +8953,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
8918
8953
|
else {
|
|
8919
8954
|
if (this.isFhdEditing) {
|
|
8920
8955
|
parent.notify('freehand-draw', { prop: 'cancelFhd', value: { type: 'ok' } });
|
|
8921
|
-
if (
|
|
8956
|
+
if (document.getElementById(parent.element.id + '_quickAccessToolbarArea')) {
|
|
8922
8957
|
document.getElementById(parent.element.id + '_quickAccessToolbarArea').style.display = 'none';
|
|
8923
8958
|
}
|
|
8924
8959
|
}
|
|
@@ -9056,7 +9091,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9056
9091
|
!this.dragCanvas || parent.activeObj.activePoint !== undefined) {
|
|
9057
9092
|
if (this.dragElement === '') {
|
|
9058
9093
|
this.setCursor(x, y);
|
|
9059
|
-
if ((
|
|
9094
|
+
if ((parent.activeObj.activePoint &&
|
|
9060
9095
|
(parent.activeObj.activePoint.width === 0 || (!isNullOrUndefined(parent.activeObj.currIndex) &&
|
|
9061
9096
|
this.cursorTargetId !== parent.activeObj.currIndex)))
|
|
9062
9097
|
&& parent.cursor !== 'default' &&
|
|
@@ -9131,15 +9166,14 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9131
9166
|
if (splitWords !== undefined && splitWords[0] === 'crop') {
|
|
9132
9167
|
isCropSelection = true;
|
|
9133
9168
|
}
|
|
9134
|
-
if (isBlazor() &&
|
|
9169
|
+
if (isBlazor() && this.parent.eventType) {
|
|
9135
9170
|
if (this.parent.eventType === 'pan') {
|
|
9136
|
-
if (
|
|
9137
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
9171
|
+
if (parent.events && parent.events.onPanEnd.hasDelegate === true) {
|
|
9138
9172
|
parent.dotNetRef.invokeMethodAsync('PanEventAsync', 'OnPanEnd', this.parent.panEventArgs);
|
|
9139
9173
|
}
|
|
9140
9174
|
}
|
|
9141
9175
|
else if (this.parent.eventType === 'resize') {
|
|
9142
|
-
if (!this.isCropSelection &&
|
|
9176
|
+
if (!this.isCropSelection && this.parent.events && this.parent.events.onShapeResizeEnd.hasDelegate === true) {
|
|
9143
9177
|
this.shapeResizingArgs.currentShapeSettings = this.updatePrevShapeSettings();
|
|
9144
9178
|
this.shapeResizingArgs.action = 'resize-end';
|
|
9145
9179
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
@@ -9148,7 +9182,8 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9148
9182
|
value: { shapeSettings: shapeResizingArgs.currentShapeSettings } });
|
|
9149
9183
|
});
|
|
9150
9184
|
}
|
|
9151
|
-
else if (
|
|
9185
|
+
else if (this.shapeResizingArgs && this.selectionResizingArgs && this.parent.events &&
|
|
9186
|
+
this.parent.events.onSelectionResizeEnd.hasDelegate === true) {
|
|
9152
9187
|
var currentSelectionSettings = { type: this.parent.activeObj.shape,
|
|
9153
9188
|
startX: this.shapeResizingArgs.currentShapeSettings.startX,
|
|
9154
9189
|
startY: this.shapeResizingArgs.currentShapeSettings.startY,
|
|
@@ -9164,7 +9199,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9164
9199
|
}
|
|
9165
9200
|
}
|
|
9166
9201
|
else {
|
|
9167
|
-
if (
|
|
9202
|
+
if (this.shapeMovingArgs && this.parent.events && this.parent.events.onShapeDragEnd.hasDelegate === true) {
|
|
9168
9203
|
this.shapeMovingArgs.currentShapeSettings = this.updatePrevShapeSettings();
|
|
9169
9204
|
this.shapeMovingArgs.action = 'drag-end';
|
|
9170
9205
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
@@ -9217,7 +9252,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9217
9252
|
value: { obj: selPointCollObj } });
|
|
9218
9253
|
prevObj.selPointColl = extend([], selPointCollObj['selPointColl'], [], true);
|
|
9219
9254
|
if (!parent.togglePen && !isCropSelection) {
|
|
9220
|
-
if (
|
|
9255
|
+
if (this.tempObjColl && parent.activeObj.activePoint.width !== 0) {
|
|
9221
9256
|
parent.objColl.push(parent.activeObj);
|
|
9222
9257
|
if (JSON.stringify(parent.activeObj.activePoint) !== JSON.stringify(this.tempActiveObj.activePoint)) {
|
|
9223
9258
|
parent.notify('undo-redo', { prop: 'updateUndoRedoColl', onPropertyChange: false,
|
|
@@ -9234,7 +9269,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9234
9269
|
parent.currObjType.isResize = false;
|
|
9235
9270
|
}
|
|
9236
9271
|
}
|
|
9237
|
-
if (
|
|
9272
|
+
if (parent.activeObj) {
|
|
9238
9273
|
var isCropSelection_1 = false;
|
|
9239
9274
|
var splitWords_1;
|
|
9240
9275
|
if (parent.activeObj.shape !== undefined) {
|
|
@@ -9283,7 +9318,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9283
9318
|
if (splitWords !== undefined && splitWords[0] === 'crop') {
|
|
9284
9319
|
isCropSelection = true;
|
|
9285
9320
|
}
|
|
9286
|
-
if (
|
|
9321
|
+
if (parent.activeObj.shape && !isCropSelection && e.currentTarget === parent.upperCanvas &&
|
|
9287
9322
|
parent.textArea.style.display === 'none') {
|
|
9288
9323
|
if (parent.activeObj.shape === 'text') {
|
|
9289
9324
|
if (!isBlazor()) {
|
|
@@ -9320,7 +9355,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9320
9355
|
var isAdjusted = false;
|
|
9321
9356
|
var parent = this.parent;
|
|
9322
9357
|
obj = obj ? obj : parent.activeObj;
|
|
9323
|
-
if (
|
|
9358
|
+
if (obj.shape && (obj.shape === 'line' || parent.activeObj.shape === 'arrow')) {
|
|
9324
9359
|
var temp = void 0;
|
|
9325
9360
|
if ((this.dragElement === 'e-resize' && obj.activePoint.endX < obj.activePoint.startX) ||
|
|
9326
9361
|
(this.dragElement === 'w-resize' && obj.activePoint.startX > obj.activePoint.endX)) {
|
|
@@ -9351,7 +9386,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9351
9386
|
Selection.prototype.updPtCollForShpRot = function (obj) {
|
|
9352
9387
|
var parent = this.parent;
|
|
9353
9388
|
obj = obj ? obj : parent.activeObj;
|
|
9354
|
-
if (
|
|
9389
|
+
if (obj.shape && obj.rotatedAngle !== 0) {
|
|
9355
9390
|
parent.notify('shape', { prop: 'setPointCollForShapeRotation', onPropertyChange: false,
|
|
9356
9391
|
value: { obj: obj } });
|
|
9357
9392
|
// Updating ratio for point collection
|
|
@@ -9415,7 +9450,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9415
9450
|
if (parent.togglePen) {
|
|
9416
9451
|
return isShape;
|
|
9417
9452
|
}
|
|
9418
|
-
if (
|
|
9453
|
+
if (parent.activeObj.shape && parent.activeObj.shape === 'text' && this.isShapeInserted) {
|
|
9419
9454
|
var isTextArea = parent.textArea.style.display === 'block' ? true : false;
|
|
9420
9455
|
var activeObj = extend({}, parent.activeObj, null, true);
|
|
9421
9456
|
parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
|
|
@@ -9439,7 +9474,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9439
9474
|
parent.objColl.splice(index, 1);
|
|
9440
9475
|
}
|
|
9441
9476
|
}
|
|
9442
|
-
else if (!isShape &&
|
|
9477
|
+
else if (!isShape && activeObj.shape) {
|
|
9443
9478
|
parent.activeObj = activeObj;
|
|
9444
9479
|
var index = this.getCurrentIndex();
|
|
9445
9480
|
if ((!isNullOrUndefined(index) &&
|
|
@@ -9457,7 +9492,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9457
9492
|
var parent = this.parent;
|
|
9458
9493
|
var isShape = false;
|
|
9459
9494
|
if (e.type === 'touchstart' && !parent.togglePen) {
|
|
9460
|
-
if (
|
|
9495
|
+
if (parent.activeObj && parent.activeObj.shape === 'text') {
|
|
9461
9496
|
this.timer = setTimeout(this.setTimer.bind(this), 1000, e);
|
|
9462
9497
|
}
|
|
9463
9498
|
var isTextArea = parent.textArea.style.display === 'block' ? true : false;
|
|
@@ -9527,7 +9562,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9527
9562
|
parent.objColl.splice(index, 1);
|
|
9528
9563
|
}
|
|
9529
9564
|
}
|
|
9530
|
-
else if (
|
|
9565
|
+
else if (activeObj.shape) {
|
|
9531
9566
|
parent.activeObj = activeObj;
|
|
9532
9567
|
var index = this.getCurrentIndex();
|
|
9533
9568
|
if (!isCropSelection) {
|
|
@@ -9546,7 +9581,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9546
9581
|
Selection.prototype.applyObj = function (x, y) {
|
|
9547
9582
|
var parent = this.parent;
|
|
9548
9583
|
var isApply = false;
|
|
9549
|
-
if (
|
|
9584
|
+
if (parent.activeObj.shape && (parent.activeObj.shape === 'rectangle' || parent.activeObj.shape === 'ellipse' ||
|
|
9550
9585
|
parent.activeObj.shape === 'text' || parent.activeObj.shape === 'line' || parent.activeObj.shape === 'arrow' ||
|
|
9551
9586
|
parent.activeObj.shape === 'path')) {
|
|
9552
9587
|
if (x >= (parent.activeObj.activePoint.startX - (parent.activeObj.topLeftCircle.radius * 2)) &&
|
|
@@ -9714,6 +9749,12 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9714
9749
|
EventHandler.add(this.parent.upperCanvas, 'touchend', this.mouseUpEventHandler, this);
|
|
9715
9750
|
EventHandler.add(this.parent.upperCanvas, 'touchmove', this.mouseMoveEventHandler, this);
|
|
9716
9751
|
};
|
|
9752
|
+
Selection.prototype.unwireEvent = function () {
|
|
9753
|
+
EventHandler.remove(this.parent.lowerCanvas, 'touchend', this.mouseUpEventHandler);
|
|
9754
|
+
EventHandler.remove(this.parent.lowerCanvas, 'touchmove', this.mouseMoveEventHandler);
|
|
9755
|
+
EventHandler.remove(this.parent.upperCanvas, 'touchend', this.mouseUpEventHandler);
|
|
9756
|
+
EventHandler.remove(this.parent.upperCanvas, 'touchmove', this.mouseMoveEventHandler);
|
|
9757
|
+
};
|
|
9717
9758
|
Selection.prototype.keyDownEventHandler = function (e) {
|
|
9718
9759
|
var _this = this;
|
|
9719
9760
|
var parent = this.parent;
|
|
@@ -9726,7 +9767,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9726
9767
|
var splitWords;
|
|
9727
9768
|
switch (e.key) {
|
|
9728
9769
|
case (e.ctrlKey && 's'):
|
|
9729
|
-
if (isBlazor() &&
|
|
9770
|
+
if (isBlazor() && parent.events && parent.events.saving.hasDelegate === true) {
|
|
9730
9771
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
9731
9772
|
parent.dotNetRef.invokeMethodAsync('BeforeSaveEventAsync', 'BeforeSave', beforeSave).then(function (args) {
|
|
9732
9773
|
_this.beforeSaveEvent(args, e);
|
|
@@ -9824,7 +9865,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9824
9865
|
e.stopPropagation();
|
|
9825
9866
|
if (e.ctrlKey === true && isInsideCanvas) {
|
|
9826
9867
|
e.preventDefault();
|
|
9827
|
-
if (!parent.isCropTab && (
|
|
9868
|
+
if (!parent.isCropTab && (parent.activeObj.shape && parent.activeObj.shape.split('-')[0] !== 'crop')) {
|
|
9828
9869
|
parent.okBtn();
|
|
9829
9870
|
if (!isBlazor()) {
|
|
9830
9871
|
parent.notify('toolbar', { prop: 'close-contextual-toolbar', onPropertyChange: false });
|
|
@@ -9847,265 +9888,85 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9847
9888
|
}
|
|
9848
9889
|
}
|
|
9849
9890
|
};
|
|
9850
|
-
Selection.prototype.
|
|
9891
|
+
Selection.prototype.textKeyDown = function (e) {
|
|
9851
9892
|
var parent = this.parent;
|
|
9852
|
-
if (
|
|
9853
|
-
|
|
9893
|
+
if (String.fromCharCode(e.which) === '\r') {
|
|
9894
|
+
this.textRow += 1;
|
|
9854
9895
|
}
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
parent.
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9896
|
+
parent.textArea.setAttribute('rows', this.textRow.toString());
|
|
9897
|
+
parent.textArea.style.height = 'auto';
|
|
9898
|
+
parent.textArea.style.height = parent.textArea.scrollHeight + 'px';
|
|
9899
|
+
parent.notify('shape', { prop: 'setTextBoxWidth', onPropertyChange: false, value: { e: e } });
|
|
9900
|
+
if (Browser.isDevice) {
|
|
9901
|
+
parent.textArea.style.width = parseFloat(parent.textArea.style.width) + parent.textArea.style.fontSize + 'px';
|
|
9902
|
+
}
|
|
9903
|
+
var rows = parent.textArea.value.split('\n');
|
|
9904
|
+
this.textRow = rows.length;
|
|
9905
|
+
parent.textArea.setAttribute('rows', this.textRow.toString());
|
|
9906
|
+
this.isInitialTextEdited = false;
|
|
9907
|
+
};
|
|
9908
|
+
Selection.prototype.clearSelection = function () {
|
|
9909
|
+
var parent = this.parent;
|
|
9910
|
+
if (!parent.disabled && parent.isImageLoaded) {
|
|
9911
|
+
parent.togglePen = false;
|
|
9912
|
+
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
9913
|
+
this.dragElement = '';
|
|
9914
|
+
this.dragPoint.startX = this.dragPoint.startY = this.dragPoint.endX = this.dragPoint.endY = 0;
|
|
9915
|
+
parent.currObjType.shape = '';
|
|
9916
|
+
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
9917
|
+
parent.currObjType.isActiveObj = true;
|
|
9918
|
+
parent.currObjType.isCustomCrop = false;
|
|
9919
|
+
parent.upperCanvas.style.cursor = parent.cursor = 'default';
|
|
9920
|
+
}
|
|
9921
|
+
};
|
|
9922
|
+
Selection.prototype.setDragDirection = function (width, height) {
|
|
9923
|
+
var arcRadius = (7.5);
|
|
9924
|
+
var parent = this.parent;
|
|
9925
|
+
if (parent.img.destWidth > parent.img.destHeight) {
|
|
9926
|
+
parent.activeObj.activePoint.startX = this.dragPoint.startX = ((width / 2) - (height / 2))
|
|
9927
|
+
+ arcRadius;
|
|
9928
|
+
parent.activeObj.activePoint.startY = this.dragPoint.startY = ((height / 2) - (height / 2))
|
|
9929
|
+
+ arcRadius;
|
|
9930
|
+
parent.activeObj.activePoint.endX = ((width / 2) + (height / 2)) - arcRadius;
|
|
9931
|
+
parent.activeObj.activePoint.endY = ((height / 2) + (height / 2)) - arcRadius;
|
|
9932
|
+
}
|
|
9933
|
+
else {
|
|
9934
|
+
parent.activeObj.activePoint.startY = this.dragPoint.startX = ((height / 2) - (width) / 2)
|
|
9935
|
+
+ arcRadius;
|
|
9936
|
+
parent.activeObj.activePoint.endY = ((height / 2) + (width) / 2) - arcRadius;
|
|
9937
|
+
parent.activeObj.activePoint.startX = this.dragPoint.startX = arcRadius;
|
|
9938
|
+
parent.activeObj.activePoint.endX = width - arcRadius;
|
|
9939
|
+
}
|
|
9940
|
+
};
|
|
9941
|
+
Selection.prototype.calcShapeRatio = function (x, y, imgWidth, imgHeight) {
|
|
9942
|
+
var parent = this.parent;
|
|
9943
|
+
var arcRadius = (7.5);
|
|
9944
|
+
var originalWidth = imgWidth;
|
|
9945
|
+
var originalHeight = imgHeight;
|
|
9946
|
+
var presetRatio = x / y;
|
|
9947
|
+
var standardSize = originalWidth >= originalHeight ? originalWidth : originalHeight;
|
|
9948
|
+
var width = standardSize * presetRatio;
|
|
9949
|
+
var height = standardSize;
|
|
9950
|
+
var scaleWidth = this.getScale(width, originalWidth);
|
|
9951
|
+
var snippetArray = [];
|
|
9952
|
+
for (var i = 0; i < 2; i++) {
|
|
9953
|
+
if (i === 0) {
|
|
9954
|
+
snippetArray.push(width * scaleWidth);
|
|
9864
9955
|
}
|
|
9865
9956
|
else {
|
|
9866
|
-
|
|
9957
|
+
snippetArray.push(height * scaleWidth);
|
|
9867
9958
|
}
|
|
9868
9959
|
}
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9960
|
+
width = snippetArray[0];
|
|
9961
|
+
height = snippetArray[1];
|
|
9962
|
+
var scaleHeight = this.getScale(height, originalHeight);
|
|
9963
|
+
var snippetArray1 = [];
|
|
9964
|
+
for (var i = 0; i < 2; i++) {
|
|
9965
|
+
if (i === 0) {
|
|
9966
|
+
snippetArray1.push(width * scaleHeight);
|
|
9872
9967
|
}
|
|
9873
9968
|
else {
|
|
9874
|
-
|
|
9875
|
-
}
|
|
9876
|
-
}
|
|
9877
|
-
var isActiveObj = false;
|
|
9878
|
-
if (parent.activeObj.shape !== undefined) {
|
|
9879
|
-
isActiveObj = true;
|
|
9880
|
-
if (parent.textArea.style.display === 'block') {
|
|
9881
|
-
parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
|
|
9882
|
-
value: { x: null, y: null, isMouseDown: null } });
|
|
9883
|
-
if (!isBlazor()) {
|
|
9884
|
-
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
9885
|
-
}
|
|
9886
|
-
else {
|
|
9887
|
-
parent.updateToolbar(parent.element, 'destroyQuickAccessToolbar');
|
|
9888
|
-
}
|
|
9889
|
-
}
|
|
9890
|
-
else {
|
|
9891
|
-
parent.notify('shape', { prop: 'updImgRatioForActObj', onPropertyChange: false });
|
|
9892
|
-
parent.objColl.push(parent.activeObj);
|
|
9893
|
-
}
|
|
9894
|
-
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
9895
|
-
}
|
|
9896
|
-
var tempFilter = this.lowerContext.filter;
|
|
9897
|
-
parent.update();
|
|
9898
|
-
parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: null } });
|
|
9899
|
-
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
9900
|
-
this.lowerContext.filter = tempFilter;
|
|
9901
|
-
parent.initialAdjustmentValue = tempFilter;
|
|
9902
|
-
if (parent.isImageLoaded) {
|
|
9903
|
-
showSpinner(parent.element);
|
|
9904
|
-
parent.element.style.opacity = '0.5';
|
|
9905
|
-
}
|
|
9906
|
-
this.lowerContext.clearRect(0, 0, parent.lowerCanvas.width, parent.lowerCanvas.height);
|
|
9907
|
-
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
9908
|
-
var canvasWrapper = document.querySelector('#' + parent.element.id + '_canvasWrapper');
|
|
9909
|
-
if (!isNullOrUndefined(canvasWrapper)) {
|
|
9910
|
-
canvasWrapper.style.width = parent.element.offsetWidth - 2 + 'px';
|
|
9911
|
-
canvasWrapper.style.height = parent.element.offsetHeight + 'px';
|
|
9912
|
-
var obj_3 = { toolbarHeight: !isBlazor() ? 0 : parent.toolbarHeight };
|
|
9913
|
-
if (!isBlazor()) {
|
|
9914
|
-
parent.notify('toolbar', { prop: 'getToolbarHeight', value: { obj: obj_3 } });
|
|
9915
|
-
}
|
|
9916
|
-
if (Browser.isDevice) {
|
|
9917
|
-
canvasWrapper.style.height = (parseFloat(canvasWrapper.style.height) - (2 * obj_3['toolbarHeight'])) - 3 + 'px';
|
|
9918
|
-
}
|
|
9919
|
-
else {
|
|
9920
|
-
canvasWrapper.style.height = (parseFloat(canvasWrapper.style.height) - obj_3['toolbarHeight']) - 3 + 'px';
|
|
9921
|
-
}
|
|
9922
|
-
}
|
|
9923
|
-
var obj = { width: 0, height: 0 };
|
|
9924
|
-
parent.notify('transform', { prop: 'calcMaxDimension', onPropertyChange: false,
|
|
9925
|
-
value: { width: parent.img.srcWidth, height: parent.img.srcHeight, obj: obj } });
|
|
9926
|
-
var maxDimension = obj;
|
|
9927
|
-
if (parent.transform.defaultZoomFactor > 0) {
|
|
9928
|
-
maxDimension.width += (maxDimension.width * parent.transform.defaultZoomFactor);
|
|
9929
|
-
maxDimension.height += (maxDimension.height * parent.transform.defaultZoomFactor);
|
|
9930
|
-
}
|
|
9931
|
-
parent.img.destLeft = (parent.lowerCanvas.clientWidth - maxDimension.width) / 2;
|
|
9932
|
-
parent.img.destTop = (parent.lowerCanvas.clientHeight - maxDimension.height) / 2;
|
|
9933
|
-
if (parent.transform.degree === 0 && parent.transform.currFlipState === '') {
|
|
9934
|
-
if (parent.transform.defaultZoomFactor > 0) {
|
|
9935
|
-
parent.img.destLeft += parent.panPoint.totalPannedPoint.x;
|
|
9936
|
-
parent.img.destTop += parent.panPoint.totalPannedPoint.y;
|
|
9937
|
-
}
|
|
9938
|
-
parent.notify('draw', { prop: 'draw-image-to-canvas', value: { dimension: maxDimension } });
|
|
9939
|
-
}
|
|
9940
|
-
else {
|
|
9941
|
-
parent.notify('draw', { prop: 'draw-image-to-canvas', value: { dimension: maxDimension } });
|
|
9942
|
-
parent.notify('draw', { prop: 'updateCurrTransState', onPropertyChange: false,
|
|
9943
|
-
value: { type: 'initial', isPreventDestination: null, isRotatePan: null } });
|
|
9944
|
-
var temp = this.lowerContext.filter;
|
|
9945
|
-
parent.notify('filter', { prop: 'updateBrightFilter', onPropertyChange: false });
|
|
9946
|
-
this.lowerContext.drawImage(parent.baseImg, parent.img.srcLeft, parent.img.srcTop, parent.img.srcWidth, parent.img.srcHeight, parent.img.destLeft, parent.img.destTop, parent.img.destWidth, parent.img.destHeight);
|
|
9947
|
-
this.lowerContext.filter = temp;
|
|
9948
|
-
parent.notify('draw', { prop: 'updateCurrTransState', onPropertyChange: false,
|
|
9949
|
-
value: { type: 'reverse', isPreventDestination: null, isRotatePan: null } });
|
|
9950
|
-
}
|
|
9951
|
-
parent.notify('shape', { prop: 'zoomObjColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
9952
|
-
parent.notify('freehand-draw', { prop: 'zoomFHDColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
9953
|
-
if (parent.isCircleCrop) {
|
|
9954
|
-
parent.notify('crop', { prop: 'cropCircle', onPropertyChange: false,
|
|
9955
|
-
value: { context: this.lowerContext, isSave: null, isFlip: null } });
|
|
9956
|
-
}
|
|
9957
|
-
hideSpinner(parent.element);
|
|
9958
|
-
parent.element.style.opacity = '1';
|
|
9959
|
-
var obj1 = { defToolbarItems: null };
|
|
9960
|
-
if (!isBlazor()) {
|
|
9961
|
-
parent.notify('toolbar', { prop: 'getDefToolbarItems', value: { obj: obj1 } });
|
|
9962
|
-
if (obj1['defToolbarItems'] && obj1['defToolbarItems'].length > 0 && (!isNullOrUndefined(document.getElementById(parent.element.id + '_toolbar')))) {
|
|
9963
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
9964
|
-
var toolbar_1 = getComponent(parent.element.id + '_toolbar', 'toolbar');
|
|
9965
|
-
toolbar_1.refreshOverflow();
|
|
9966
|
-
if (!isNullOrUndefined(parent.element.querySelector('.e-contextual-toolbar-wrapper'))) {
|
|
9967
|
-
parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
9968
|
-
}
|
|
9969
|
-
}
|
|
9970
|
-
}
|
|
9971
|
-
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
9972
|
-
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
9973
|
-
if (isActiveObj) {
|
|
9974
|
-
parent.activeObj = extend({}, parent.objColl[parent.objColl.length - 1], null, true);
|
|
9975
|
-
parent.objColl.pop();
|
|
9976
|
-
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj } });
|
|
9977
|
-
if (parent.activeObj.shape === 'rectangle' || parent.activeObj.shape === 'ellipse' || parent.activeObj.shape === 'text' ||
|
|
9978
|
-
parent.activeObj.shape === 'line' || parent.activeObj.shape === 'arrow' || parent.activeObj.shape === 'path') {
|
|
9979
|
-
if (!isBlazor()) {
|
|
9980
|
-
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
|
|
9981
|
-
}
|
|
9982
|
-
else {
|
|
9983
|
-
parent.updateToolbar(parent.element, 'quickAccessToolbar', parent.activeObj.shape);
|
|
9984
|
-
}
|
|
9985
|
-
}
|
|
9986
|
-
}
|
|
9987
|
-
if (this.isFhdEditing) {
|
|
9988
|
-
if (!isBlazor()) {
|
|
9989
|
-
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
|
|
9990
|
-
}
|
|
9991
|
-
else {
|
|
9992
|
-
parent.updateToolbar(parent.element, 'quickAccessToolbar', 'pen');
|
|
9993
|
-
}
|
|
9994
|
-
}
|
|
9995
|
-
if ((parent.transform.degree !== 0 || parent.transform.currFlipState !== '') && parent.transform.defaultZoomFactor > 0) {
|
|
9996
|
-
var totalPannedPoint = extend({}, parent.panPoint.totalPannedPoint, null, true);
|
|
9997
|
-
var totalPannedInternalPoint = extend({}, parent.panPoint.totalPannedInternalPoint, null, true);
|
|
9998
|
-
var totalPannedClientPoint = extend({}, parent.panPoint.totalPannedClientPoint, null, true);
|
|
9999
|
-
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
10000
|
-
value: { zoomFactor: .1, zoomPoint: null } });
|
|
10001
|
-
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
10002
|
-
value: { zoomFactor: -.1, zoomPoint: null } });
|
|
10003
|
-
if (parent.transform.degree === 0) {
|
|
10004
|
-
parent.img.destLeft += totalPannedPoint.x;
|
|
10005
|
-
parent.img.destTop += totalPannedPoint.y;
|
|
10006
|
-
parent.panPoint.totalPannedPoint = totalPannedPoint;
|
|
10007
|
-
parent.notify('draw', { prop: 'updateFlipPan', value: { tempSelectionObj: null } });
|
|
10008
|
-
}
|
|
10009
|
-
else {
|
|
10010
|
-
parent.panPoint.totalPannedInternalPoint = totalPannedInternalPoint;
|
|
10011
|
-
parent.panPoint.totalPannedClientPoint = totalPannedClientPoint;
|
|
10012
|
-
parent.panPoint.currentPannedPoint = { x: 0, y: 0 };
|
|
10013
|
-
parent.isCropTab = true;
|
|
10014
|
-
parent.notify('transform', { prop: 'rotatePan', onPropertyChange: false,
|
|
10015
|
-
value: { isCropSelection: null, isDefaultZoom: null } });
|
|
10016
|
-
parent.isCropTab = false;
|
|
10017
|
-
}
|
|
10018
|
-
}
|
|
10019
|
-
else if (parent.transform.degree !== 0 && parent.transform.cropZoomFactor > 0) {
|
|
10020
|
-
parent.transform.zoomFactor = 0;
|
|
10021
|
-
parent.transform.cropZoomFactor = null;
|
|
10022
|
-
if (!isBlazor()) {
|
|
10023
|
-
parent.notify('toolbar', { prop: 'enable-disable-btns', onPropertyChange: false });
|
|
10024
|
-
}
|
|
10025
|
-
else {
|
|
10026
|
-
parent.updateToolbar(parent.element, 'enableDisableToolbarBtn');
|
|
10027
|
-
}
|
|
10028
|
-
}
|
|
10029
|
-
};
|
|
10030
|
-
Selection.prototype.textKeyDown = function (e) {
|
|
10031
|
-
var parent = this.parent;
|
|
10032
|
-
if (String.fromCharCode(e.which) === '\r') {
|
|
10033
|
-
this.textRow += 1;
|
|
10034
|
-
}
|
|
10035
|
-
parent.textArea.setAttribute('rows', this.textRow.toString());
|
|
10036
|
-
parent.textArea.style.height = 'auto';
|
|
10037
|
-
parent.textArea.style.height = parent.textArea.scrollHeight + 'px';
|
|
10038
|
-
parent.notify('shape', { prop: 'setTextBoxWidth', onPropertyChange: false, value: { e: e } });
|
|
10039
|
-
if (Browser.isDevice) {
|
|
10040
|
-
parent.textArea.style.width = parseFloat(parent.textArea.style.width) + parent.textArea.style.fontSize + 'px';
|
|
10041
|
-
}
|
|
10042
|
-
var rows = parent.textArea.value.split('\n');
|
|
10043
|
-
this.textRow = rows.length;
|
|
10044
|
-
parent.textArea.setAttribute('rows', this.textRow.toString());
|
|
10045
|
-
this.isInitialTextEdited = false;
|
|
10046
|
-
};
|
|
10047
|
-
Selection.prototype.clearSelection = function () {
|
|
10048
|
-
var parent = this.parent;
|
|
10049
|
-
if (!parent.disabled && parent.isImageLoaded) {
|
|
10050
|
-
parent.togglePen = false;
|
|
10051
|
-
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
10052
|
-
this.dragElement = '';
|
|
10053
|
-
this.dragPoint.startX = this.dragPoint.startY = this.dragPoint.endX = this.dragPoint.endY = 0;
|
|
10054
|
-
parent.currObjType.shape = '';
|
|
10055
|
-
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
10056
|
-
parent.currObjType.isActiveObj = true;
|
|
10057
|
-
parent.currObjType.isCustomCrop = false;
|
|
10058
|
-
parent.upperCanvas.style.cursor = parent.cursor = 'default';
|
|
10059
|
-
}
|
|
10060
|
-
};
|
|
10061
|
-
Selection.prototype.setDragDirection = function (width, height) {
|
|
10062
|
-
var arcRadius = (7.5);
|
|
10063
|
-
var parent = this.parent;
|
|
10064
|
-
if (parent.img.destWidth > parent.img.destHeight) {
|
|
10065
|
-
parent.activeObj.activePoint.startX = this.dragPoint.startX = ((width / 2) - (height / 2))
|
|
10066
|
-
+ arcRadius;
|
|
10067
|
-
parent.activeObj.activePoint.startY = this.dragPoint.startY = ((height / 2) - (height / 2))
|
|
10068
|
-
+ arcRadius;
|
|
10069
|
-
parent.activeObj.activePoint.endX = ((width / 2) + (height / 2)) - arcRadius;
|
|
10070
|
-
parent.activeObj.activePoint.endY = ((height / 2) + (height / 2)) - arcRadius;
|
|
10071
|
-
}
|
|
10072
|
-
else {
|
|
10073
|
-
parent.activeObj.activePoint.startY = this.dragPoint.startX = ((height / 2) - (width) / 2)
|
|
10074
|
-
+ arcRadius;
|
|
10075
|
-
parent.activeObj.activePoint.endY = ((height / 2) + (width) / 2) - arcRadius;
|
|
10076
|
-
parent.activeObj.activePoint.startX = this.dragPoint.startX = arcRadius;
|
|
10077
|
-
parent.activeObj.activePoint.endX = width - arcRadius;
|
|
10078
|
-
}
|
|
10079
|
-
};
|
|
10080
|
-
Selection.prototype.calcShapeRatio = function (x, y, imgWidth, imgHeight) {
|
|
10081
|
-
var parent = this.parent;
|
|
10082
|
-
var arcRadius = (7.5);
|
|
10083
|
-
var originalWidth = imgWidth;
|
|
10084
|
-
var originalHeight = imgHeight;
|
|
10085
|
-
var presetRatio = x / y;
|
|
10086
|
-
var standardSize = originalWidth >= originalHeight ? originalWidth : originalHeight;
|
|
10087
|
-
var width = standardSize * presetRatio;
|
|
10088
|
-
var height = standardSize;
|
|
10089
|
-
var scaleWidth = this.getScale(width, originalWidth);
|
|
10090
|
-
var snippetArray = [];
|
|
10091
|
-
for (var i = 0; i < 2; i++) {
|
|
10092
|
-
if (i === 0) {
|
|
10093
|
-
snippetArray.push(width * scaleWidth);
|
|
10094
|
-
}
|
|
10095
|
-
else {
|
|
10096
|
-
snippetArray.push(height * scaleWidth);
|
|
10097
|
-
}
|
|
10098
|
-
}
|
|
10099
|
-
width = snippetArray[0];
|
|
10100
|
-
height = snippetArray[1];
|
|
10101
|
-
var scaleHeight = this.getScale(height, originalHeight);
|
|
10102
|
-
var snippetArray1 = [];
|
|
10103
|
-
for (var i = 0; i < 2; i++) {
|
|
10104
|
-
if (i === 0) {
|
|
10105
|
-
snippetArray1.push(width * scaleHeight);
|
|
10106
|
-
}
|
|
10107
|
-
else {
|
|
10108
|
-
snippetArray1.push(height * scaleHeight);
|
|
9969
|
+
snippetArray1.push(height * scaleHeight);
|
|
10109
9970
|
}
|
|
10110
9971
|
}
|
|
10111
9972
|
width = snippetArray1[0];
|
|
@@ -10256,7 +10117,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
10256
10117
|
x <= (actObj.activePoint.endX + (actObj.topLeftCircle.radius * 2)) &&
|
|
10257
10118
|
y >= (actObj.activePoint.startY - (actObj.topLeftCircle.radius * 2)) &&
|
|
10258
10119
|
y <= (actObj.activePoint.endY + (actObj.topLeftCircle.radius * 2))) ||
|
|
10259
|
-
(
|
|
10120
|
+
(rotationCirclePoint &&
|
|
10260
10121
|
x >= (rotationCirclePoint.x - (actObj.topLeftCircle.radius * 2)) &&
|
|
10261
10122
|
x <= (rotationCirclePoint.x + (actObj.topLeftCircle.radius * 2)) &&
|
|
10262
10123
|
y >= (rotationCirclePoint.y - (actObj.topLeftCircle.radius * 2)) &&
|
|
@@ -10303,7 +10164,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
10303
10164
|
value: { context: this.lowerContext, points: null } });
|
|
10304
10165
|
}
|
|
10305
10166
|
parent.notify('draw', { prop: 'clearOuterCanvas', onPropertyChange: false, value: { context: this.lowerContext } });
|
|
10306
|
-
if ((
|
|
10167
|
+
if ((parent.currSelectionPoint && parent.currSelectionPoint.shape === 'crop-circle') || parent.isCircleCrop) {
|
|
10307
10168
|
parent.notify('crop', { prop: 'cropCircle', onPropertyChange: false,
|
|
10308
10169
|
value: { context: this.lowerContext, isSave: null, isFlip: null } });
|
|
10309
10170
|
}
|
|
@@ -10330,7 +10191,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
10330
10191
|
this.isCropSelection = true;
|
|
10331
10192
|
}
|
|
10332
10193
|
if (!this.isCropSelection && isBlazor() && isNullOrUndefined(this.parent.eventType) &&
|
|
10333
|
-
|
|
10194
|
+
parent.events && parent.events.shapeChanging.hasDelegate === true) {
|
|
10334
10195
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
10335
10196
|
parent.dotNetRef.invokeMethodAsync('ShapeEventAsync', 'OnShape', shapeChangingArgs_1).then(function (shapeChangingArgs) {
|
|
10336
10197
|
_this.shapeEvent(shapeChangingArgs);
|
|
@@ -10352,7 +10213,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
10352
10213
|
startY: shapeChangingArgs_1.currentShapeSettings.startY,
|
|
10353
10214
|
width: shapeChangingArgs_1.currentShapeSettings.width,
|
|
10354
10215
|
height: shapeChangingArgs_1.currentShapeSettings.height } };
|
|
10355
|
-
if (isBlazor() &&
|
|
10216
|
+
if (isBlazor() && parent.events && parent.events.onSelectionResizeStart.hasDelegate === true) {
|
|
10356
10217
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
10357
10218
|
parent.dotNetRef.invokeMethodAsync('SelectionEventAsync', 'OnSelectionResizeStart', selectionChangingArgs).then(function (selectionChangingArgs) {
|
|
10358
10219
|
shapeChangingArgs_1.currentShapeSettings.startX = selectionChangingArgs.currentSelectionSettings.startX;
|
|
@@ -10421,7 +10282,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
10421
10282
|
Selection.prototype.getDistance = function (a, b) {
|
|
10422
10283
|
var x = 0;
|
|
10423
10284
|
var y = 0;
|
|
10424
|
-
if (
|
|
10285
|
+
if (a && b) {
|
|
10425
10286
|
x = a.x - b.x;
|
|
10426
10287
|
y = a.y - b.y;
|
|
10427
10288
|
}
|
|
@@ -10539,7 +10400,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
10539
10400
|
}
|
|
10540
10401
|
parent.notify('freehand-draw', { prop: 'zoomFHDColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
10541
10402
|
this.lowerContext.filter = tempFilter;
|
|
10542
|
-
if (
|
|
10403
|
+
if (parent.activeObj.shape) {
|
|
10543
10404
|
parent.notify('shape', { prop: 'apply', onPropertyChange: false,
|
|
10544
10405
|
value: { shape: null, obj: null, canvas: null } });
|
|
10545
10406
|
}
|
|
@@ -11035,6 +10896,9 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
11035
10896
|
case 'updateArrowRatio':
|
|
11036
10897
|
this.updateArrowRatio(args.value['obj']);
|
|
11037
10898
|
break;
|
|
10899
|
+
case 'getSquarePointForRotatedShape':
|
|
10900
|
+
this.getSquarePointForRotatedShape(args.value['obj'], args.value['object']);
|
|
10901
|
+
break;
|
|
11038
10902
|
case 'reset':
|
|
11039
10903
|
this.reset();
|
|
11040
10904
|
break;
|
|
@@ -11058,30 +10922,41 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
11058
10922
|
};
|
|
11059
10923
|
Shape.prototype.drawEllipse = function (x, y, radiusX, radiusY, strokeWidth, strokeColor, fillColor) {
|
|
11060
10924
|
this.initializeShape('ellipse');
|
|
11061
|
-
var start = { x: x, y: y };
|
|
10925
|
+
var start = x && y ? { x: x, y: y } : null;
|
|
11062
10926
|
this.drawShape('ellipse', strokeWidth, strokeColor, fillColor, start, radiusX, radiusY);
|
|
11063
10927
|
};
|
|
11064
10928
|
Shape.prototype.drawLine = function (startX, startY, endX, endY, strokeWidth, strokeColor) {
|
|
11065
10929
|
this.initializeShape('line');
|
|
11066
|
-
var start = { x: startX, y: startY };
|
|
10930
|
+
var start = startX && startY ? { x: startX, y: startY } : null;
|
|
11067
10931
|
var width = endX - startX;
|
|
11068
10932
|
var height = endY - startY;
|
|
11069
10933
|
this.drawShape('line', strokeWidth, strokeColor, null, start, width, height);
|
|
11070
10934
|
};
|
|
11071
10935
|
Shape.prototype.drawPath = function (pointColl, strokeWidth, strokeColor) {
|
|
11072
10936
|
this.initializeShape('path');
|
|
11073
|
-
|
|
10937
|
+
if (pointColl) {
|
|
10938
|
+
this.drawShape('path', strokeWidth, strokeColor, null, null, null, null, pointColl);
|
|
10939
|
+
}
|
|
10940
|
+
else {
|
|
10941
|
+
this.drawShape('line', strokeWidth, strokeColor, null, null, null, null);
|
|
10942
|
+
var obj = extend({}, this.parent.objColl[this.parent.objColl.length - 1], null, true);
|
|
10943
|
+
obj.shape = 'path';
|
|
10944
|
+
obj.lineDraw = null;
|
|
10945
|
+
obj.pointColl = [{ x: obj.activePoint.startX, y: obj.activePoint.startY },
|
|
10946
|
+
{ x: obj.activePoint.endX, y: obj.activePoint.endY }];
|
|
10947
|
+
this.parent.objColl[this.parent.objColl.length - 1] = obj;
|
|
10948
|
+
}
|
|
11074
10949
|
};
|
|
11075
10950
|
Shape.prototype.drawArrow = function (startX, startY, endX, endY, strokeWidth, strokeColor, arrowStart, arrowEnd) {
|
|
11076
10951
|
this.initializeShape('arrow');
|
|
11077
|
-
var start = { x: startX, y: startY };
|
|
10952
|
+
var start = startX && startY ? { x: startX, y: startY } : null;
|
|
11078
10953
|
var width = endX - startX;
|
|
11079
10954
|
var height = endY - startY;
|
|
11080
10955
|
this.drawShape('arrow', strokeWidth, strokeColor, null, start, width, height, null, arrowStart, arrowEnd);
|
|
11081
10956
|
};
|
|
11082
10957
|
Shape.prototype.drawRectangle = function (x, y, width, height, strokeWidth, strokeColor, fillColor) {
|
|
11083
10958
|
this.initializeShape('rectangle');
|
|
11084
|
-
var start = { x: x, y: y };
|
|
10959
|
+
var start = x && y ? { x: x, y: y } : null;
|
|
11085
10960
|
this.drawShape('rectangle', strokeWidth, strokeColor, fillColor, start, width, height);
|
|
11086
10961
|
};
|
|
11087
10962
|
Shape.prototype.drawText = function (x, y, text, fontFamily, fontSize, bold, italic, color) {
|
|
@@ -11243,7 +11118,7 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
11243
11118
|
var parent = this.parent;
|
|
11244
11119
|
if (parent.activeObj.shape === 'line' || parent.activeObj.shape === 'arrow') {
|
|
11245
11120
|
parent.activeObj.pointColl = this.getLinePoints(parent.activeObj.activePoint.startX, parent.activeObj.activePoint.startY, parent.activeObj.activePoint.endX, parent.activeObj.activePoint.endY);
|
|
11246
|
-
if (
|
|
11121
|
+
if (parent.activeObj.pointColl) {
|
|
11247
11122
|
for (var i = 0, len = parent.activeObj.pointColl.length; i < len; i++) {
|
|
11248
11123
|
parent.activeObj.pointColl[i].ratioX = (parent.activeObj.pointColl[i].x -
|
|
11249
11124
|
parent.img.destLeft) / parent.img.destWidth;
|
|
@@ -12366,7 +12241,7 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
12366
12241
|
this.upperContext.clearRect(0, 0, this.parent.upperCanvas.width, this.parent.upperCanvas.height);
|
|
12367
12242
|
this.lowerContext.clearRect(0, 0, this.parent.upperCanvas.width, this.parent.upperCanvas.height);
|
|
12368
12243
|
parent.notify('draw', { prop: 'redrawImgWithObj', onPropertyChange: false });
|
|
12369
|
-
if ((
|
|
12244
|
+
if ((parent.currSelectionPoint && parent.currSelectionPoint.shape === 'crop-circle') || parent.isCircleCrop) {
|
|
12370
12245
|
parent.notify('crop', { prop: 'cropCircle', onPropertyChange: false,
|
|
12371
12246
|
value: { context: this.lowerContext, isSave: null, isFlip: null } });
|
|
12372
12247
|
}
|
|
@@ -13084,8 +12959,8 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
13084
12959
|
};
|
|
13085
12960
|
Shape.prototype.isPointsInRange = function (x, y, obj) {
|
|
13086
12961
|
var inRange = false;
|
|
13087
|
-
if (!isNullOrUndefined(x) && !isNullOrUndefined(y) && x >=
|
|
13088
|
-
x <= this.parent.
|
|
12962
|
+
if (!isNullOrUndefined(x) && !isNullOrUndefined(y) && x >= this.parent.img.destLeft && y >= this.parent.img.destTop &&
|
|
12963
|
+
x <= this.parent.img.destLeft + this.parent.img.destWidth && y <= this.parent.img.destTop + this.parent.img.destHeight) {
|
|
13089
12964
|
inRange = true;
|
|
13090
12965
|
}
|
|
13091
12966
|
obj['inRange'] = inRange;
|
|
@@ -13242,8 +13117,10 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
13242
13117
|
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
13243
13118
|
}
|
|
13244
13119
|
parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
|
|
13120
|
+
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
|
|
13245
13121
|
}
|
|
13246
13122
|
else {
|
|
13123
|
+
parent.updateToolbar(parent.element, parent.activeObj.shape);
|
|
13247
13124
|
if (parent.activeObj.shape === 'path') {
|
|
13248
13125
|
parent.updateToolbar(this.parent.element, 'path', 'pathQuickAccessToolbar');
|
|
13249
13126
|
}
|
|
@@ -13265,8 +13142,13 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
13265
13142
|
isSelected = true;
|
|
13266
13143
|
parent.notify('freehand-draw', { prop: 'selectFhd', value: { id: id } });
|
|
13267
13144
|
if (!isBlazor()) {
|
|
13145
|
+
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
|
|
13268
13146
|
parent.notify('toolbar', { prop: 'update-toolbar-items', onPropertyChange: false });
|
|
13269
13147
|
}
|
|
13148
|
+
else {
|
|
13149
|
+
parent.updateToolbar(parent.element, 'pen');
|
|
13150
|
+
parent.updateToolbar(parent.element, 'quickAccessToolbar', 'pen');
|
|
13151
|
+
}
|
|
13270
13152
|
}
|
|
13271
13153
|
else {
|
|
13272
13154
|
isSelected = false;
|
|
@@ -13482,6 +13364,73 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
13482
13364
|
}
|
|
13483
13365
|
}
|
|
13484
13366
|
};
|
|
13367
|
+
Shape.prototype.getSquarePointForRotatedShape = function (obj, object) {
|
|
13368
|
+
var point = { startX: 0, startY: 0, endX: 0, endY: 0, width: 0, height: 0 };
|
|
13369
|
+
var center = { x: obj.activePoint.startX + (obj.activePoint.width / 2), y: obj.activePoint.startY +
|
|
13370
|
+
(obj.activePoint.height / 2) };
|
|
13371
|
+
var p1 = { x: Math.cos(obj.rotatedAngle) * (obj.activePoint.startX - center.x) - Math.sin(obj.rotatedAngle)
|
|
13372
|
+
* (obj.activePoint.startY - center.y) + center.x,
|
|
13373
|
+
y: Math.sin(obj.rotatedAngle) * (obj.activePoint.startX - center.x) + Math.cos(obj.rotatedAngle) * (obj.activePoint.startY
|
|
13374
|
+
- center.y) + center.y };
|
|
13375
|
+
var p2 = { x: Math.cos(obj.rotatedAngle) * (obj.activePoint.endX - center.x) - Math.sin(obj.rotatedAngle) *
|
|
13376
|
+
(obj.activePoint.startY - center.y) + center.x,
|
|
13377
|
+
y: Math.sin(obj.rotatedAngle) * (obj.activePoint.endX - center.x) + Math.cos(obj.rotatedAngle) * (obj.activePoint.startY
|
|
13378
|
+
- center.y) + center.y };
|
|
13379
|
+
var p3 = { x: Math.cos(obj.rotatedAngle) * (obj.activePoint.startX - center.x) - Math.sin(obj.rotatedAngle) *
|
|
13380
|
+
(obj.activePoint.endY - center.y) + center.x,
|
|
13381
|
+
y: Math.sin(obj.rotatedAngle) * (obj.activePoint.startX - center.x) + Math.cos(obj.rotatedAngle) * (obj.activePoint.endY
|
|
13382
|
+
- center.y) + center.y };
|
|
13383
|
+
var p4 = { x: Math.cos(obj.rotatedAngle) * (obj.activePoint.endX - center.x) - Math.sin(obj.rotatedAngle) *
|
|
13384
|
+
(obj.activePoint.endY - center.y) + center.x,
|
|
13385
|
+
y: Math.sin(obj.rotatedAngle) * (obj.activePoint.endX - center.x) + Math.cos(obj.rotatedAngle) *
|
|
13386
|
+
(obj.activePoint.endY - center.y) + center.y };
|
|
13387
|
+
point.startX = p1.x;
|
|
13388
|
+
point.startY = p1.y;
|
|
13389
|
+
point.endX = p1.x;
|
|
13390
|
+
point.endY = p1.y;
|
|
13391
|
+
if (point.startX > p2.x) {
|
|
13392
|
+
point.startX = p2.x;
|
|
13393
|
+
}
|
|
13394
|
+
if (point.startX > p3.x) {
|
|
13395
|
+
point.startX = p3.x;
|
|
13396
|
+
}
|
|
13397
|
+
if (point.startX > p4.x) {
|
|
13398
|
+
point.startX = p4.x;
|
|
13399
|
+
}
|
|
13400
|
+
if (point.startY > p2.y) {
|
|
13401
|
+
point.startY = p2.y;
|
|
13402
|
+
}
|
|
13403
|
+
if (point.startY > p3.y) {
|
|
13404
|
+
point.startY = p3.y;
|
|
13405
|
+
}
|
|
13406
|
+
if (point.startY > p4.y) {
|
|
13407
|
+
point.startY = p4.y;
|
|
13408
|
+
}
|
|
13409
|
+
if (point.endX < p2.x) {
|
|
13410
|
+
point.endX = p2.x;
|
|
13411
|
+
}
|
|
13412
|
+
if (point.endX < p3.x) {
|
|
13413
|
+
point.endX = p3.x;
|
|
13414
|
+
}
|
|
13415
|
+
if (point.endX < p4.x) {
|
|
13416
|
+
point.endX = p4.x;
|
|
13417
|
+
}
|
|
13418
|
+
if (point.endY < p2.y) {
|
|
13419
|
+
point.endY = p2.y;
|
|
13420
|
+
}
|
|
13421
|
+
if (point.endY < p3.y) {
|
|
13422
|
+
point.endY = p3.y;
|
|
13423
|
+
}
|
|
13424
|
+
if (point.endY < p4.y) {
|
|
13425
|
+
point.endY = p4.y;
|
|
13426
|
+
}
|
|
13427
|
+
point.width = point.endX - point.startX;
|
|
13428
|
+
point.height = point.endY - point.startY;
|
|
13429
|
+
if (object) {
|
|
13430
|
+
object['activePoint'] = point;
|
|
13431
|
+
}
|
|
13432
|
+
return point;
|
|
13433
|
+
};
|
|
13485
13434
|
return Shape;
|
|
13486
13435
|
}());
|
|
13487
13436
|
|
|
@@ -13661,7 +13610,7 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
13661
13610
|
var parent = this.parent;
|
|
13662
13611
|
var transitionArgs = { cancel: false, previousDegree: parent.transform.degree,
|
|
13663
13612
|
currentDegree: Math.abs(parent.transform.degree + degree) === 360 ? 0 : parent.transform.degree + degree };
|
|
13664
|
-
if (!this.isPreventSelect && isBlazor() &&
|
|
13613
|
+
if (!this.isPreventSelect && isBlazor() && parent.events && parent.events.rotating.hasDelegate === true) {
|
|
13665
13614
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
13666
13615
|
parent.dotNetRef.invokeMethodAsync('RotateEventAsync', 'OnRotate', transitionArgs).then(function (args) {
|
|
13667
13616
|
_this.rotateEvent(args, degree);
|
|
@@ -13693,7 +13642,7 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
13693
13642
|
parent.afterCropActions.push(degree === 90 ? 'rotateRight' : 'rotateLeft');
|
|
13694
13643
|
var splitWords = [];
|
|
13695
13644
|
var activeObjShape = void 0;
|
|
13696
|
-
if (
|
|
13645
|
+
if (parent.activeObj.activePoint && parent.activeObj.shape) {
|
|
13697
13646
|
if (parent.activeObj.shape !== undefined) {
|
|
13698
13647
|
splitWords = parent.activeObj.shape.split('-');
|
|
13699
13648
|
}
|
|
@@ -13847,7 +13796,7 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
13847
13796
|
var parent = this.parent;
|
|
13848
13797
|
var transitionArgs = { direction: direction, cancel: false,
|
|
13849
13798
|
previousDirection: parent.toPascalCase(parent.transform.currFlipState) };
|
|
13850
|
-
if (!this.isPreventSelect && isBlazor() &&
|
|
13799
|
+
if (!this.isPreventSelect && isBlazor() && parent.events && parent.events.flipping.hasDelegate === true) {
|
|
13851
13800
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
13852
13801
|
parent.dotNetRef.invokeMethodAsync('FlipEventAsync', 'OnFlip', transitionArgs).then(function (args) {
|
|
13853
13802
|
_this.flipEvent(args, direction);
|
|
@@ -13985,7 +13934,7 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
13985
13934
|
parent.notify('crop', { prop: 'cropCircle', onPropertyChange: false,
|
|
13986
13935
|
value: { context: this.lowerContext, isSave: null, isFlip: null } });
|
|
13987
13936
|
}
|
|
13988
|
-
if (
|
|
13937
|
+
if (activeObjShape) {
|
|
13989
13938
|
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
13990
13939
|
parent.activeObj = extend({}, parent.objColl[parent.objColl.length - 1], {}, true);
|
|
13991
13940
|
parent.objColl.pop();
|
|
@@ -14117,13 +14066,13 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
14117
14066
|
this.tempActiveObj = extend({}, parent.activeObj, {}, true);
|
|
14118
14067
|
parent.isCropTab = true;
|
|
14119
14068
|
}
|
|
14120
|
-
else if (
|
|
14069
|
+
else if (parent.activeObj.shape && splitWords[0] !== 'crop') {
|
|
14121
14070
|
this.isShape = true;
|
|
14122
14071
|
}
|
|
14123
14072
|
var obj = { zoomType: null };
|
|
14124
14073
|
parent.notify('selection', { prop: 'getZoomType', onPropertyChange: false, value: { obj: obj } });
|
|
14125
14074
|
if (isNullOrUndefined(zoomPoint)) {
|
|
14126
|
-
if (parent.isCropTab &&
|
|
14075
|
+
if (parent.isCropTab && this.tempActiveObj) {
|
|
14127
14076
|
zoomPoint = { x: parent.activeObj.activePoint.startX + (parent.activeObj.activePoint.width / 2),
|
|
14128
14077
|
y: parent.activeObj.activePoint.startY + (parent.activeObj.activePoint.height / 2) };
|
|
14129
14078
|
}
|
|
@@ -14137,7 +14086,7 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
14137
14086
|
var previousZoomFactor = parent.zoomSettings.zoomFactor - (zoomFactor * 10);
|
|
14138
14087
|
var zoomEventArgs = { zoomPoint: zoomPoint, cancel: false, previousZoomFactor: previousZoomFactor,
|
|
14139
14088
|
currentZoomFactor: parent.zoomSettings.zoomFactor, zoomTrigger: obj['zoomType'] };
|
|
14140
|
-
if (!parent.isCropToolbar && isBlazor() &&
|
|
14089
|
+
if (!parent.isCropToolbar && isBlazor() && parent.events && parent.events.zooming.hasDelegate === true) {
|
|
14141
14090
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
14142
14091
|
parent.dotNetRef.invokeMethodAsync('ZoomEventAsync', 'OnZoom', zoomEventArgs).then(function (args) {
|
|
14143
14092
|
_this.zoomEvent(args, zoomFactor);
|
|
@@ -14274,7 +14223,7 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
14274
14223
|
}
|
|
14275
14224
|
}
|
|
14276
14225
|
this.autoEnablePan();
|
|
14277
|
-
if (
|
|
14226
|
+
if (this.tempActiveObj) {
|
|
14278
14227
|
parent.activeObj = extend({}, this.tempActiveObj, {}, true);
|
|
14279
14228
|
}
|
|
14280
14229
|
if (parent.activeObj.shape === 'crop-custom') {
|
|
@@ -14581,7 +14530,7 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
14581
14530
|
var obj = { panDown: null };
|
|
14582
14531
|
parent.notify('selection', { prop: 'getPanDown', onPropertyChange: false, value: { obj: obj } });
|
|
14583
14532
|
var panEventArgs = { startPoint: obj['panDown'], endPoint: this.panMove, cancel: false };
|
|
14584
|
-
if (isBlazor() && isNullOrUndefined(this.parent.eventType) &&
|
|
14533
|
+
if (isBlazor() && isNullOrUndefined(this.parent.eventType) && parent.events && parent.events.onPanStart.hasDelegate === true) {
|
|
14585
14534
|
this.parent.eventType = 'pan';
|
|
14586
14535
|
this.parent.panEventArgs = panEventArgs;
|
|
14587
14536
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
@@ -14795,7 +14744,7 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
14795
14744
|
var tempDegree = parent.transform.degree;
|
|
14796
14745
|
var rotatePanActiveObj;
|
|
14797
14746
|
var object = { selPointColl: null };
|
|
14798
|
-
if (
|
|
14747
|
+
if (parent.activeObj.activePoint && parent.activeObj.shape) {
|
|
14799
14748
|
rotatePanActiveObj = extend({}, parent.activeObj, {}, true);
|
|
14800
14749
|
}
|
|
14801
14750
|
var tempObjColl = extend([], parent.objColl, [], true);
|
|
@@ -14866,7 +14815,7 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
14866
14815
|
parent.notify('draw', { prop: 'clearOuterCanvas', onPropertyChange: false, value: { context: this.lowerContext } });
|
|
14867
14816
|
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
14868
14817
|
parent.activeObj = extend({}, rotatePanActiveObj, {}, true);
|
|
14869
|
-
if (
|
|
14818
|
+
if (parent.activeObj.activePoint) {
|
|
14870
14819
|
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj, isCropRatio: null,
|
|
14871
14820
|
points: null, isPreventDrag: true, saveContext: null, isPreventSelection: null } });
|
|
14872
14821
|
}
|
|
@@ -15034,38 +14983,218 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
15034
14983
|
Transform.prototype.update = function () {
|
|
15035
14984
|
var parent = this.parent;
|
|
15036
14985
|
var toolbarHeight = 0;
|
|
14986
|
+
var isActiveObj = false;
|
|
14987
|
+
var freehandObj = { bool: false };
|
|
14988
|
+
if (parent.isImageLoaded) {
|
|
14989
|
+
if ((parent.element.querySelector('#' + parent.element.id + '_contextualToolbar') &&
|
|
14990
|
+
!parent.element.querySelector('#' + parent.element.id + '_contextualToolbar').parentElement.classList.contains('e-hide')) ||
|
|
14991
|
+
(parent.element.querySelector('#' + parent.element.id + '_headWrapper')
|
|
14992
|
+
&& !parent.element.querySelector('#' + parent.element.id + '_headWrapper').parentElement.classList.contains('e-hide'))) {
|
|
14993
|
+
parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
14994
|
+
parent.okBtn();
|
|
14995
|
+
if (!isBlazor()) {
|
|
14996
|
+
parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
|
|
14997
|
+
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
14998
|
+
}
|
|
14999
|
+
else {
|
|
15000
|
+
parent.updateToolbar(parent.element, 'imageLoaded');
|
|
15001
|
+
}
|
|
15002
|
+
}
|
|
15003
|
+
parent.notify('selection', { prop: 'getFreehandDrawEditing', onPropertyChange: false, value: { obj: freehandObj } });
|
|
15004
|
+
if (freehandObj['bool']) {
|
|
15005
|
+
if (!isBlazor()) {
|
|
15006
|
+
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
15007
|
+
}
|
|
15008
|
+
else {
|
|
15009
|
+
parent.updateToolbar(parent.element, 'destroyQuickAccessToolbar');
|
|
15010
|
+
}
|
|
15011
|
+
}
|
|
15012
|
+
if (parent.activeObj.shape !== undefined) {
|
|
15013
|
+
isActiveObj = true;
|
|
15014
|
+
if (parent.textArea.style.display === 'block') {
|
|
15015
|
+
parent.notify('shape', { prop: 'redrawActObj', onPropertyChange: false,
|
|
15016
|
+
value: { x: null, y: null, isMouseDown: null } });
|
|
15017
|
+
if (!isBlazor()) {
|
|
15018
|
+
parent.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
|
|
15019
|
+
}
|
|
15020
|
+
else {
|
|
15021
|
+
parent.updateToolbar(parent.element, 'destroyQuickAccessToolbar');
|
|
15022
|
+
}
|
|
15023
|
+
}
|
|
15024
|
+
else {
|
|
15025
|
+
parent.notify('shape', { prop: 'updImgRatioForActObj', onPropertyChange: false });
|
|
15026
|
+
parent.objColl.push(parent.activeObj);
|
|
15027
|
+
}
|
|
15028
|
+
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
15029
|
+
}
|
|
15030
|
+
}
|
|
15031
|
+
var tempFilter = this.lowerContext.filter;
|
|
15037
15032
|
var canvasWrapper = document.querySelector('#' + parent.element.id + '_canvasWrapper');
|
|
15038
|
-
if (
|
|
15033
|
+
if (canvasWrapper) {
|
|
15039
15034
|
canvasWrapper.style.width = parent.element.offsetWidth - 2 + 'px';
|
|
15040
15035
|
}
|
|
15041
15036
|
parent.lowerCanvas.width = parent.upperCanvas.width = parent.element.offsetWidth - 2;
|
|
15042
|
-
if (
|
|
15043
|
-
parent.
|
|
15037
|
+
if (parent.toolbarTemplate) {
|
|
15038
|
+
toolbarHeight = parent.element.querySelector('#' + parent.element.id + '_toolbarArea').clientHeight;
|
|
15044
15039
|
}
|
|
15045
15040
|
else if (parent.element.querySelector('#' + parent.element.id + '_toolbar')) {
|
|
15046
15041
|
toolbarHeight = parent.element.querySelector('#' + parent.element.id + '_toolbar').clientHeight;
|
|
15047
|
-
parent.notify('toolbar', { prop: 'setToolbarHeight', value: { height: toolbarHeight } });
|
|
15048
15042
|
}
|
|
15043
|
+
parent.notify('toolbar', { prop: 'setToolbarHeight', value: { height: toolbarHeight } });
|
|
15049
15044
|
if (Browser.isDevice) {
|
|
15050
|
-
if (
|
|
15045
|
+
if (canvasWrapper) {
|
|
15051
15046
|
canvasWrapper.style.height = parent.element.offsetHeight - (2 * toolbarHeight) - 5 + 'px';
|
|
15052
15047
|
}
|
|
15053
|
-
parent.lowerCanvas.height = parent.upperCanvas.height = parent.element.offsetHeight - (2 * toolbarHeight) - 5;
|
|
15054
|
-
}
|
|
15055
|
-
else {
|
|
15056
|
-
if (
|
|
15057
|
-
canvasWrapper.style.height = parent.element.offsetHeight - toolbarHeight - 3 + 'px';
|
|
15048
|
+
parent.lowerCanvas.height = parent.upperCanvas.height = parent.element.offsetHeight - (2 * toolbarHeight) - 5;
|
|
15049
|
+
}
|
|
15050
|
+
else {
|
|
15051
|
+
if (canvasWrapper) {
|
|
15052
|
+
canvasWrapper.style.height = parent.element.offsetHeight - toolbarHeight - 3 + 'px';
|
|
15053
|
+
}
|
|
15054
|
+
parent.lowerCanvas.height = parent.upperCanvas.height = parent.element.offsetHeight - toolbarHeight - 3;
|
|
15055
|
+
}
|
|
15056
|
+
this.lowerContext.filter =
|
|
15057
|
+
'brightness(' + 1 + ') ' + 'contrast(' + 100 + '%) ' + 'hue-rotate(' + 0 + 'deg) ' +
|
|
15058
|
+
'saturate(' + 100 + '%) ' + 'opacity(' + 1 + ') ' + 'blur(' + 0 + 'px) ' + 'sepia(0%) ' + 'grayscale(0%) ' + 'invert(0%)';
|
|
15059
|
+
parent.notify('filter', { prop: 'setAdjustmentValue', onPropertyChange: false, value: { adjustmentValue: this.lowerContext.filter } });
|
|
15060
|
+
parent.canvasFilter = this.lowerContext.filter;
|
|
15061
|
+
this.parent.initialAdjustmentValue = this.lowerContext.filter;
|
|
15062
|
+
parent.clearContext(this.lowerContext);
|
|
15063
|
+
this.parent.clearContext(this.upperContext);
|
|
15064
|
+
if (parent.isImageLoaded) {
|
|
15065
|
+
parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: null } });
|
|
15066
|
+
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
15067
|
+
this.lowerContext.filter = tempFilter;
|
|
15068
|
+
parent.initialAdjustmentValue = tempFilter;
|
|
15069
|
+
if (parent.isImageLoaded) {
|
|
15070
|
+
showSpinner(parent.element);
|
|
15071
|
+
parent.element.style.opacity = '0.5';
|
|
15072
|
+
}
|
|
15073
|
+
this.lowerContext.clearRect(0, 0, parent.lowerCanvas.width, parent.lowerCanvas.height);
|
|
15074
|
+
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
15075
|
+
if (canvasWrapper) {
|
|
15076
|
+
canvasWrapper.style.width = parent.element.offsetWidth - 2 + 'px';
|
|
15077
|
+
canvasWrapper.style.height = parent.element.offsetHeight + 'px';
|
|
15078
|
+
var obj_1 = { toolbarHeight: !isBlazor() ? 0 : parent.toolbarHeight };
|
|
15079
|
+
if (!isBlazor()) {
|
|
15080
|
+
parent.notify('toolbar', { prop: 'getToolbarHeight', value: { obj: obj_1 } });
|
|
15081
|
+
}
|
|
15082
|
+
if (Browser.isDevice) {
|
|
15083
|
+
canvasWrapper.style.height = (parseFloat(canvasWrapper.style.height) - (2 * obj_1['toolbarHeight'])) - 3 + 'px';
|
|
15084
|
+
}
|
|
15085
|
+
else {
|
|
15086
|
+
canvasWrapper.style.height = (parseFloat(canvasWrapper.style.height) - obj_1['toolbarHeight']) - 3 + 'px';
|
|
15087
|
+
}
|
|
15088
|
+
}
|
|
15089
|
+
var obj = { width: 0, height: 0 };
|
|
15090
|
+
parent.notify('transform', { prop: 'calcMaxDimension', onPropertyChange: false,
|
|
15091
|
+
value: { width: parent.img.srcWidth, height: parent.img.srcHeight, obj: obj } });
|
|
15092
|
+
var maxDimension = obj;
|
|
15093
|
+
if (parent.transform.defaultZoomFactor > 0) {
|
|
15094
|
+
maxDimension.width += (maxDimension.width * parent.transform.defaultZoomFactor);
|
|
15095
|
+
maxDimension.height += (maxDimension.height * parent.transform.defaultZoomFactor);
|
|
15096
|
+
}
|
|
15097
|
+
parent.img.destLeft = (parent.lowerCanvas.clientWidth - maxDimension.width) / 2;
|
|
15098
|
+
parent.img.destTop = (parent.lowerCanvas.clientHeight - maxDimension.height) / 2;
|
|
15099
|
+
if (parent.transform.degree === 0 && parent.transform.currFlipState === '') {
|
|
15100
|
+
if (parent.transform.defaultZoomFactor > 0) {
|
|
15101
|
+
parent.img.destLeft += parent.panPoint.totalPannedPoint.x;
|
|
15102
|
+
parent.img.destTop += parent.panPoint.totalPannedPoint.y;
|
|
15103
|
+
}
|
|
15104
|
+
parent.notify('draw', { prop: 'draw-image-to-canvas', value: { dimension: maxDimension } });
|
|
15105
|
+
}
|
|
15106
|
+
else {
|
|
15107
|
+
parent.notify('draw', { prop: 'draw-image-to-canvas', value: { dimension: maxDimension } });
|
|
15108
|
+
parent.notify('draw', { prop: 'updateCurrTransState', onPropertyChange: false,
|
|
15109
|
+
value: { type: 'initial', isPreventDestination: null, isRotatePan: null } });
|
|
15110
|
+
var temp = this.lowerContext.filter;
|
|
15111
|
+
parent.notify('filter', { prop: 'updateBrightFilter', onPropertyChange: false });
|
|
15112
|
+
this.lowerContext.drawImage(parent.baseImg, parent.img.srcLeft, parent.img.srcTop, parent.img.srcWidth, parent.img.srcHeight, parent.img.destLeft, parent.img.destTop, parent.img.destWidth, parent.img.destHeight);
|
|
15113
|
+
this.lowerContext.filter = temp;
|
|
15114
|
+
parent.notify('draw', { prop: 'updateCurrTransState', onPropertyChange: false,
|
|
15115
|
+
value: { type: 'reverse', isPreventDestination: null, isRotatePan: null } });
|
|
15116
|
+
}
|
|
15117
|
+
parent.notify('shape', { prop: 'zoomObjColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
15118
|
+
parent.notify('freehand-draw', { prop: 'zoomFHDColl', onPropertyChange: false, value: { isPreventApply: null } });
|
|
15119
|
+
if (parent.isCircleCrop) {
|
|
15120
|
+
parent.notify('crop', { prop: 'cropCircle', onPropertyChange: false,
|
|
15121
|
+
value: { context: this.lowerContext, isSave: null, isFlip: null } });
|
|
15122
|
+
}
|
|
15123
|
+
hideSpinner(parent.element);
|
|
15124
|
+
parent.element.style.opacity = '1';
|
|
15125
|
+
var obj1 = { defToolbarItems: null };
|
|
15126
|
+
if (!isBlazor()) {
|
|
15127
|
+
parent.notify('toolbar', { prop: 'getDefToolbarItems', value: { obj: obj1 } });
|
|
15128
|
+
if (obj1['defToolbarItems'] && obj1['defToolbarItems'].length > 0 && document.getElementById(parent.element.id + '_toolbar')) {
|
|
15129
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
15130
|
+
var toolbar_1 = getComponent(parent.element.id + '_toolbar', 'toolbar');
|
|
15131
|
+
toolbar_1.refreshOverflow();
|
|
15132
|
+
if (parent.element.querySelector('.e-contextual-toolbar-wrapper')) {
|
|
15133
|
+
parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
15134
|
+
}
|
|
15135
|
+
}
|
|
15136
|
+
}
|
|
15137
|
+
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
15138
|
+
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
15139
|
+
if (isActiveObj) {
|
|
15140
|
+
parent.activeObj = extend({}, parent.objColl[parent.objColl.length - 1], null, true);
|
|
15141
|
+
parent.objColl.pop();
|
|
15142
|
+
if (parent.activeObj.activePoint.width !== 0 && parent.activeObj.activePoint.height !== 0) {
|
|
15143
|
+
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj } });
|
|
15144
|
+
if (parent.activeObj.shape === 'rectangle' || parent.activeObj.shape === 'ellipse' || parent.activeObj.shape === 'text' ||
|
|
15145
|
+
parent.activeObj.shape === 'line' || parent.activeObj.shape === 'arrow' || parent.activeObj.shape === 'path') {
|
|
15146
|
+
if (!isBlazor()) {
|
|
15147
|
+
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
|
|
15148
|
+
}
|
|
15149
|
+
else {
|
|
15150
|
+
parent.updateToolbar(parent.element, 'quickAccessToolbar', parent.activeObj.shape);
|
|
15151
|
+
}
|
|
15152
|
+
}
|
|
15153
|
+
}
|
|
15154
|
+
}
|
|
15155
|
+
if (freehandObj['bool']) {
|
|
15156
|
+
if (!isBlazor()) {
|
|
15157
|
+
parent.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
|
|
15158
|
+
}
|
|
15159
|
+
else {
|
|
15160
|
+
parent.updateToolbar(parent.element, 'quickAccessToolbar', 'pen');
|
|
15161
|
+
}
|
|
15162
|
+
}
|
|
15163
|
+
if ((parent.transform.degree !== 0 || parent.transform.currFlipState !== '') && parent.transform.defaultZoomFactor > 0) {
|
|
15164
|
+
var totalPannedPoint = extend({}, parent.panPoint.totalPannedPoint, null, true);
|
|
15165
|
+
var totalPannedInternalPoint = extend({}, parent.panPoint.totalPannedInternalPoint, null, true);
|
|
15166
|
+
var totalPannedClientPoint = extend({}, parent.panPoint.totalPannedClientPoint, null, true);
|
|
15167
|
+
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
15168
|
+
value: { zoomFactor: .1, zoomPoint: null } });
|
|
15169
|
+
parent.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
15170
|
+
value: { zoomFactor: -.1, zoomPoint: null } });
|
|
15171
|
+
if (parent.transform.degree === 0) {
|
|
15172
|
+
parent.img.destLeft += totalPannedPoint.x;
|
|
15173
|
+
parent.img.destTop += totalPannedPoint.y;
|
|
15174
|
+
parent.panPoint.totalPannedPoint = totalPannedPoint;
|
|
15175
|
+
parent.notify('draw', { prop: 'updateFlipPan', value: { tempSelectionObj: null } });
|
|
15176
|
+
}
|
|
15177
|
+
else {
|
|
15178
|
+
parent.panPoint.totalPannedInternalPoint = totalPannedInternalPoint;
|
|
15179
|
+
parent.panPoint.totalPannedClientPoint = totalPannedClientPoint;
|
|
15180
|
+
parent.panPoint.currentPannedPoint = { x: 0, y: 0 };
|
|
15181
|
+
parent.isCropTab = true;
|
|
15182
|
+
parent.notify('transform', { prop: 'rotatePan', onPropertyChange: false,
|
|
15183
|
+
value: { isCropSelection: null, isDefaultZoom: null } });
|
|
15184
|
+
parent.isCropTab = false;
|
|
15185
|
+
}
|
|
15186
|
+
}
|
|
15187
|
+
else if (parent.transform.degree !== 0 && parent.transform.cropZoomFactor > 0) {
|
|
15188
|
+
parent.transform.zoomFactor = 0;
|
|
15189
|
+
parent.transform.cropZoomFactor = null;
|
|
15190
|
+
if (!isBlazor()) {
|
|
15191
|
+
parent.notify('toolbar', { prop: 'enable-disable-btns', onPropertyChange: false });
|
|
15192
|
+
}
|
|
15193
|
+
else {
|
|
15194
|
+
parent.updateToolbar(parent.element, 'enableDisableToolbarBtn');
|
|
15195
|
+
}
|
|
15058
15196
|
}
|
|
15059
|
-
parent.lowerCanvas.height = parent.upperCanvas.height = parent.element.offsetHeight - toolbarHeight - 3;
|
|
15060
15197
|
}
|
|
15061
|
-
this.lowerContext.filter =
|
|
15062
|
-
'brightness(' + 1 + ') ' + 'contrast(' + 100 + '%) ' + 'hue-rotate(' + 0 + 'deg) ' +
|
|
15063
|
-
'saturate(' + 100 + '%) ' + 'opacity(' + 1 + ') ' + 'blur(' + 0 + 'px) ' + 'sepia(0%) ' + 'grayscale(0%) ' + 'invert(0%)';
|
|
15064
|
-
parent.notify('filter', { prop: 'setAdjustmentValue', onPropertyChange: false, value: { adjustmentValue: this.lowerContext.filter } });
|
|
15065
|
-
this.parent.canvasFilter = this.lowerContext.filter;
|
|
15066
|
-
this.parent.initialAdjustmentValue = this.lowerContext.filter;
|
|
15067
|
-
this.parent.clearContext(this.lowerContext);
|
|
15068
|
-
this.parent.clearContext(this.upperContext);
|
|
15069
15198
|
};
|
|
15070
15199
|
Transform.prototype.calcMaxDimension = function (width, height, obj) {
|
|
15071
15200
|
var object = { toolbarHeight: 0 };
|
|
@@ -15096,7 +15225,15 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
15096
15225
|
cssMaxWidth = width * heightScale;
|
|
15097
15226
|
cssMaxHeight = height * heightScale;
|
|
15098
15227
|
}
|
|
15099
|
-
|
|
15228
|
+
var cropObj = { bool: null };
|
|
15229
|
+
this.parent.notify('crop', { prop: 'getPreventScaling', onPropertyChange: false,
|
|
15230
|
+
value: { obj: cropObj } });
|
|
15231
|
+
if (cropObj['bool'] && this.parent.cropObj.activeObj.activePoint &&
|
|
15232
|
+
this.parent.cropObj.activeObj.activePoint.width !== 0 && this.parent.cropObj.activeObj.activePoint.height !== 0) {
|
|
15233
|
+
cssMaxWidth = this.parent.cropObj.activeObj.activePoint.width;
|
|
15234
|
+
cssMaxHeight = this.parent.cropObj.activeObj.activePoint.height;
|
|
15235
|
+
}
|
|
15236
|
+
if (obj) {
|
|
15100
15237
|
obj['width'] = cssMaxWidth;
|
|
15101
15238
|
obj['height'] = cssMaxHeight;
|
|
15102
15239
|
}
|
|
@@ -15144,7 +15281,7 @@ var Transform = /** @__PURE__ @class */ (function () {
|
|
|
15144
15281
|
}
|
|
15145
15282
|
this.limitPan();
|
|
15146
15283
|
parent.activeObj = tempActObj;
|
|
15147
|
-
if (
|
|
15284
|
+
if (obj) {
|
|
15148
15285
|
obj['x'] = parent.img.destLeft - tempDestLeft;
|
|
15149
15286
|
obj['y'] = parent.img.destTop - tempDestTop;
|
|
15150
15287
|
}
|
|
@@ -15178,10 +15315,10 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
15178
15315
|
this.parent.off('destroyed', this.destroy);
|
|
15179
15316
|
};
|
|
15180
15317
|
UndoRedo.prototype.initializeUrPvtProp = function () {
|
|
15181
|
-
if (
|
|
15318
|
+
if (this.parent.lowerCanvas) {
|
|
15182
15319
|
this.lowerContext = this.parent.lowerCanvas.getContext('2d');
|
|
15183
15320
|
}
|
|
15184
|
-
if (
|
|
15321
|
+
if (this.parent.upperCanvas) {
|
|
15185
15322
|
this.upperContext = this.parent.upperCanvas.getContext('2d');
|
|
15186
15323
|
}
|
|
15187
15324
|
};
|
|
@@ -15401,14 +15538,16 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
15401
15538
|
if (!parent.disabled && parent.isImageLoaded) {
|
|
15402
15539
|
if (this.undoRedoStep > 0) {
|
|
15403
15540
|
this.refreshToolbarActions();
|
|
15404
|
-
if (
|
|
15541
|
+
if (parent.activeObj.activePoint && parent.activeObj.activePoint.width !== 0) {
|
|
15405
15542
|
this.tempActObj = parent.activeObj;
|
|
15406
15543
|
}
|
|
15407
15544
|
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
15408
15545
|
this.undoRedoStep--;
|
|
15409
15546
|
if (!isBlazor()) {
|
|
15410
15547
|
parent.notify('toolbar', { prop: 'enable-disable-btns' });
|
|
15411
|
-
parent.element.querySelector('.e-contextual-toolbar-wrapper')
|
|
15548
|
+
if (parent.element.querySelector('.e-contextual-toolbar-wrapper')) {
|
|
15549
|
+
parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
15550
|
+
}
|
|
15412
15551
|
}
|
|
15413
15552
|
else {
|
|
15414
15553
|
parent.updateToolbar(parent.element, 'enableDisableToolbarBtn');
|
|
@@ -15511,7 +15650,7 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
15511
15650
|
parent.cropObj = extend({}, obj.currentCropObj, {}, true);
|
|
15512
15651
|
parent.afterCropActions = obj.currentObj.afterCropActions;
|
|
15513
15652
|
this.lowerContext.filter = obj.currentObj.filter;
|
|
15514
|
-
if (!isBlazor()) {
|
|
15653
|
+
if (!isBlazor() && parent.element.querySelector('.e-contextual-toolbar-wrapper')) {
|
|
15515
15654
|
parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
15516
15655
|
}
|
|
15517
15656
|
parent.canvasFilter = this.lowerContext.filter;
|
|
@@ -15573,10 +15712,10 @@ var UndoRedo = /** @__PURE__ @class */ (function () {
|
|
|
15573
15712
|
if (obj.operation === 'crop' && !obj.isCircleCrop) {
|
|
15574
15713
|
parent.isCircleCrop = false;
|
|
15575
15714
|
}
|
|
15576
|
-
if (obj.operation === 'crop' &&
|
|
15715
|
+
if (obj.operation === 'crop' && obj.currentObj.currSelectionPoint) {
|
|
15577
15716
|
parent.currSelectionPoint = extend({}, obj.currentObj.currSelectionPoint, {}, true);
|
|
15578
15717
|
}
|
|
15579
|
-
if (
|
|
15718
|
+
if (parent.currSelectionPoint && isNullOrUndefined(parent.currSelectionPoint.shape)) {
|
|
15580
15719
|
parent.currSelectionPoint = null;
|
|
15581
15720
|
}
|
|
15582
15721
|
this.endUndoRedo(obj.operation, false);
|
|
@@ -16254,7 +16393,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16254
16393
|
break;
|
|
16255
16394
|
case 'theme':
|
|
16256
16395
|
if (newProperties.theme) {
|
|
16257
|
-
if (
|
|
16396
|
+
if (this.theme && this.theme !== '') {
|
|
16258
16397
|
this.theme = this.toPascalCase(this.theme);
|
|
16259
16398
|
}
|
|
16260
16399
|
else {
|
|
@@ -16316,7 +16455,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16316
16455
|
case 'selectionSettings':
|
|
16317
16456
|
if (newProperties.selectionSettings) {
|
|
16318
16457
|
this.selectionSettings = newProperties.selectionSettings;
|
|
16319
|
-
if (
|
|
16458
|
+
if (this.activeObj.shape) {
|
|
16320
16459
|
this.upperContext.clearRect(0, 0, this.upperCanvas.width, this.upperCanvas.height);
|
|
16321
16460
|
this.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: this.activeObj } });
|
|
16322
16461
|
}
|
|
@@ -16336,9 +16475,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16336
16475
|
this.element.removeAttribute('class');
|
|
16337
16476
|
}
|
|
16338
16477
|
if (!isBlazor()) {
|
|
16339
|
-
this.notify('toolbar', {
|
|
16340
|
-
prop: 'destroySubComponents', onPropertyChange: false
|
|
16341
|
-
});
|
|
16478
|
+
this.notify('toolbar', { prop: 'destroySubComponents', onPropertyChange: false });
|
|
16342
16479
|
this.notify('destroyed', null);
|
|
16343
16480
|
_super.prototype.destroy.call(this);
|
|
16344
16481
|
}
|
|
@@ -16349,7 +16486,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16349
16486
|
this.element.innerHTML = '';
|
|
16350
16487
|
};
|
|
16351
16488
|
ImageEditor.prototype.initialize = function () {
|
|
16352
|
-
if (
|
|
16489
|
+
if (this.toolbarTemplate) {
|
|
16353
16490
|
this.element.appendChild(this.createElement('div', {
|
|
16354
16491
|
id: this.element.id + '_toolbarArea', className: 'e-toolbar-area'
|
|
16355
16492
|
}));
|
|
@@ -16368,13 +16505,13 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16368
16505
|
var quickAccessToolbar = document.getElementById(this.element.id + '_quickAccessToolbarArea');
|
|
16369
16506
|
quickAccessToolbar.style.position = 'absolute';
|
|
16370
16507
|
quickAccessToolbar.style.display = 'none';
|
|
16371
|
-
if (
|
|
16508
|
+
if (this.activeObj) {
|
|
16372
16509
|
quickAccessToolbar.style.left = this.activeObj.activePoint.startX + 'px';
|
|
16373
16510
|
quickAccessToolbar.style.top = this.activeObj.activePoint.startY + 'px';
|
|
16374
16511
|
}
|
|
16375
16512
|
quickAccessToolbar.style.width = '100%';
|
|
16376
16513
|
}
|
|
16377
|
-
if (
|
|
16514
|
+
if (this.quickAccessToolbarTemplate) {
|
|
16378
16515
|
this.quickAccessToolbarTemplateFn();
|
|
16379
16516
|
}
|
|
16380
16517
|
else {
|
|
@@ -16451,6 +16588,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16451
16588
|
screen.orientation.removeEventListener('change', this.screenOrientation.bind(this));
|
|
16452
16589
|
}
|
|
16453
16590
|
this.notify('shape', { prop: 'unWireEvent', onPropertyChange: false });
|
|
16591
|
+
this.notify('selection', { prop: 'unWireEvent', onPropertyChange: false });
|
|
16454
16592
|
};
|
|
16455
16593
|
ImageEditor.prototype.createCanvas = function () {
|
|
16456
16594
|
this.element.style.boxSizing = 'border-box';
|
|
@@ -16530,7 +16668,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16530
16668
|
this.notify('selection', { prop: 'handleScroll', onPropertyChange: false, value: { e: e } });
|
|
16531
16669
|
};
|
|
16532
16670
|
ImageEditor.prototype.adjustToScreen = function () {
|
|
16533
|
-
this.
|
|
16671
|
+
this.update();
|
|
16534
16672
|
};
|
|
16535
16673
|
ImageEditor.prototype.screenOrientation = function () {
|
|
16536
16674
|
if (Browser.isDevice) {
|
|
@@ -16687,10 +16825,10 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16687
16825
|
this.currentFilter = '';
|
|
16688
16826
|
var obj_1 = { initialZoomValue: false };
|
|
16689
16827
|
this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj_1 } });
|
|
16690
|
-
if (
|
|
16828
|
+
if (obj_1['initialZoomValue']) {
|
|
16691
16829
|
this.setProperties({ zoomSettings: { zoomFactor: obj_1['initialZoomValue'] } }, true);
|
|
16692
16830
|
}
|
|
16693
|
-
if (
|
|
16831
|
+
if (document.getElementById(this.element.id + '_quickAccessToolbarArea')) {
|
|
16694
16832
|
document.getElementById(this.element.id + '_quickAccessToolbarArea').style.display = 'none';
|
|
16695
16833
|
}
|
|
16696
16834
|
this.notifyResetForAllModules();
|
|
@@ -16699,7 +16837,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16699
16837
|
this.notify('draw', { prop: 'update-canvas', onPropertyChange: false });
|
|
16700
16838
|
this.isImageLoaded = true;
|
|
16701
16839
|
if (!isBlazor()) {
|
|
16702
|
-
if (
|
|
16840
|
+
if (this.element.querySelector('.e-contextual-toolbar-wrapper')) {
|
|
16703
16841
|
this.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
16704
16842
|
}
|
|
16705
16843
|
this.notify('toolbar', { prop: 'refresh-dropdown-btn', value: { isDisabled: false } });
|
|
@@ -16835,7 +16973,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16835
16973
|
ImageEditor.prototype.drawEllipse = function (x, y, radiusX, radiusY, strokeWidth, strokeColor, fillColor) {
|
|
16836
16974
|
var isEllipse = false;
|
|
16837
16975
|
var isPointsInRange = this.allowShape(x, y);
|
|
16838
|
-
if (!this.disabled && this.isImageLoaded && isPointsInRange) {
|
|
16976
|
+
if (!this.disabled && this.isImageLoaded && (isPointsInRange || (isNullOrUndefined(x) && isNullOrUndefined(y)))) {
|
|
16839
16977
|
isEllipse = true;
|
|
16840
16978
|
this.notify('shape', { prop: 'drawEllipse', onPropertyChange: false, value: { x: x, y: y, radiusX: radiusX, radiusY: radiusY,
|
|
16841
16979
|
strokeWidth: strokeWidth, strokeColor: strokeColor, fillColor: fillColor } });
|
|
@@ -16856,7 +16994,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16856
16994
|
ImageEditor.prototype.drawLine = function (startX, startY, endX, endY, strokeWidth, strokeColor) {
|
|
16857
16995
|
var isLine = false;
|
|
16858
16996
|
var isPointsInRange = this.allowShape(startX, startY);
|
|
16859
|
-
if (!this.disabled && this.isImageLoaded && isPointsInRange) {
|
|
16997
|
+
if (!this.disabled && this.isImageLoaded && (isPointsInRange || (isNullOrUndefined(startX) && isNullOrUndefined(startY)))) {
|
|
16860
16998
|
isLine = true;
|
|
16861
16999
|
this.notify('shape', { prop: 'drawLine', onPropertyChange: false, value: { startX: startX, startY: startY, endX: endX,
|
|
16862
17000
|
endY: endY, strokeWidth: strokeWidth, strokeColor: strokeColor } });
|
|
@@ -16874,14 +17012,12 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16874
17012
|
* @param {string} strokeColor - Specifies the stroke color of arrow.
|
|
16875
17013
|
* @param {ArrowheadType} arrowStart – Specifies the type of arrowhead for start position. The default value is ‘None’.
|
|
16876
17014
|
* @param {ArrowheadType} arrowEnd – Specifies the type of arrowhead for end position. The default value is ‘SolidArrow’.
|
|
16877
|
-
|
|
16878
17015
|
* @returns {boolean}.
|
|
16879
|
-
* @private
|
|
16880
17016
|
*/
|
|
16881
17017
|
ImageEditor.prototype.drawArrow = function (startX, startY, endX, endY, strokeWidth, strokeColor, arrowStart, arrowEnd) {
|
|
16882
17018
|
var isArrow = false;
|
|
16883
17019
|
var isPointsInRange = this.allowShape(startX, startY);
|
|
16884
|
-
if (!this.disabled && this.isImageLoaded && isPointsInRange) {
|
|
17020
|
+
if (!this.disabled && this.isImageLoaded && (isPointsInRange || (isNullOrUndefined(startX) && isNullOrUndefined(startY)))) {
|
|
16885
17021
|
isArrow = true;
|
|
16886
17022
|
this.notify('shape', { prop: 'drawArrow', onPropertyChange: false, value: { startX: startX, startY: startY, endX: endX,
|
|
16887
17023
|
endY: endY, strokeWidth: strokeWidth, strokeColor: strokeColor, arrowStart: arrowStart, arrowEnd: arrowEnd } });
|
|
@@ -16900,7 +17036,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16900
17036
|
this.isPublicMethod = true;
|
|
16901
17037
|
var obj = { inRange: false };
|
|
16902
17038
|
var isPath = false;
|
|
16903
|
-
if (pointColl.length > 0) {
|
|
17039
|
+
if (pointColl && pointColl.length > 0) {
|
|
16904
17040
|
for (var i = 0; i < pointColl.length; i++) {
|
|
16905
17041
|
if (obj['inRange']) {
|
|
16906
17042
|
break;
|
|
@@ -16909,7 +17045,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16909
17045
|
value: { x: pointColl[i].x, y: pointColl[i].y, obj: obj } });
|
|
16910
17046
|
}
|
|
16911
17047
|
}
|
|
16912
|
-
if (!this.disabled && this.isImageLoaded && obj['inRange']) {
|
|
17048
|
+
if (!this.disabled && this.isImageLoaded && (obj['inRange'] || isNullOrUndefined(pointColl))) {
|
|
16913
17049
|
isPath = true;
|
|
16914
17050
|
this.notify('shape', { prop: 'drawPath', onPropertyChange: false, value: { pointColl: pointColl,
|
|
16915
17051
|
strokeWidth: strokeWidth, strokeColor: strokeColor } });
|
|
@@ -16931,7 +17067,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16931
17067
|
ImageEditor.prototype.drawRectangle = function (x, y, width, height, strokeWidth, strokeColor, fillColor) {
|
|
16932
17068
|
var isRectangle = false;
|
|
16933
17069
|
var isPointsInRange = this.allowShape(x, y);
|
|
16934
|
-
if (!this.disabled && this.isImageLoaded && isPointsInRange) {
|
|
17070
|
+
if (!this.disabled && this.isImageLoaded && (isPointsInRange || (isNullOrUndefined(x) && isNullOrUndefined(y)))) {
|
|
16935
17071
|
isRectangle = true;
|
|
16936
17072
|
this.notify('shape', { prop: 'drawRectangle', onPropertyChange: false, value: { x: x, y: y, width: width, height: height,
|
|
16937
17073
|
strokeWidth: strokeWidth, strokeColor: strokeColor, fillColor: fillColor } });
|
|
@@ -16957,7 +17093,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
16957
17093
|
ImageEditor.prototype.drawText = function (x, y, text, fontFamily, fontSize, bold, italic, color) {
|
|
16958
17094
|
var isText = false;
|
|
16959
17095
|
var isPointsInRange = this.allowShape(x, y);
|
|
16960
|
-
if (!this.disabled && this.isImageLoaded && isPointsInRange) {
|
|
17096
|
+
if (!this.disabled && this.isImageLoaded && (isPointsInRange || (isNullOrUndefined(x) && isNullOrUndefined(y)))) {
|
|
16961
17097
|
isText = true;
|
|
16962
17098
|
this.notify('shape', { prop: 'drawText', onPropertyChange: false, value: { x: x, y: y, text: text, fontFamily: fontFamily,
|
|
16963
17099
|
fontSize: fontSize, bold: bold, italic: italic, color: color } });
|
|
@@ -17109,6 +17245,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17109
17245
|
template = this.toolbarFn({ type: 'toolbar' }, this, 'Template', templateID)[0];
|
|
17110
17246
|
}
|
|
17111
17247
|
toolbarArea.appendChild(template);
|
|
17248
|
+
this.toolbarHeight = toolbarArea.clientHeight;
|
|
17249
|
+
this.notify('toolbar', { prop: 'setToolbarHeight', value: { height: this.toolbarHeight } });
|
|
17112
17250
|
this['renderReactTemplates']();
|
|
17113
17251
|
}
|
|
17114
17252
|
};
|
|
@@ -17176,7 +17314,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17176
17314
|
var isUndoRedo = this.isUndoRedo;
|
|
17177
17315
|
this.isCropTab = false;
|
|
17178
17316
|
this.isUndoRedo = true;
|
|
17179
|
-
if (
|
|
17317
|
+
if (this.transform.cropZoomFactor && this.transform.cropZoomFactor > 0) {
|
|
17180
17318
|
this.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
17181
17319
|
value: { zoomFactor: -this.transform.cropZoomFactor, zoomPoint: null } });
|
|
17182
17320
|
}
|
|
@@ -17193,120 +17331,6 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17193
17331
|
this.isCropTab = true;
|
|
17194
17332
|
this.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: this.activeObj } });
|
|
17195
17333
|
};
|
|
17196
|
-
ImageEditor.prototype.moveToSelectionRange = function (type, activeObj) {
|
|
17197
|
-
if (!isNullOrUndefined(this.activeObj.shape)) {
|
|
17198
|
-
if (type === 'rotateleft' || type === 'rotateright') {
|
|
17199
|
-
var zoomFactor = this.transform.zoomFactor;
|
|
17200
|
-
this.objColl.push(this.activeObj);
|
|
17201
|
-
this.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
17202
|
-
if (this.transform.degree % 90 === 0 && this.transform.degree % 180 !== 0) {
|
|
17203
|
-
if (this.objColl[this.objColl.length - 1].activePoint.width < activeObj.activePoint.height) {
|
|
17204
|
-
for (var i = 2; i < this.zoomSettings.maxZoomFactor; i++) {
|
|
17205
|
-
if (this.objColl[this.objColl.length - 1].activePoint.width >= activeObj.activePoint.height ||
|
|
17206
|
-
this.isSelectionBiggerThanCanvas(this.objColl[this.objColl.length - 1]) ||
|
|
17207
|
-
this.isSelectionOutsideCanvas(this.objColl[this.objColl.length - 1])) {
|
|
17208
|
-
if (!isNullOrUndefined(zoomFactor)) {
|
|
17209
|
-
this.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
17210
|
-
value: { zoomFactor: -0.1, zoomPoint: null } });
|
|
17211
|
-
}
|
|
17212
|
-
break;
|
|
17213
|
-
}
|
|
17214
|
-
zoomFactor += .1;
|
|
17215
|
-
this.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
17216
|
-
value: { zoomFactor: zoomFactor, zoomPoint: null } });
|
|
17217
|
-
}
|
|
17218
|
-
}
|
|
17219
|
-
else {
|
|
17220
|
-
for (var i = 2; i < this.zoomSettings.maxZoomFactor; i++) {
|
|
17221
|
-
if (this.objColl[this.objColl.length - 1].activePoint.width >= activeObj.activePoint.height ||
|
|
17222
|
-
this.isSelectionBiggerThanCanvas(this.objColl[this.objColl.length - 1]) ||
|
|
17223
|
-
this.isSelectionOutsideCanvas(this.objColl[this.objColl.length - 1])) {
|
|
17224
|
-
if (!isNullOrUndefined(zoomFactor)) {
|
|
17225
|
-
this.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
17226
|
-
value: { zoomFactor: 0.1, zoomPoint: null } });
|
|
17227
|
-
}
|
|
17228
|
-
break;
|
|
17229
|
-
}
|
|
17230
|
-
zoomFactor -= .1;
|
|
17231
|
-
this.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
17232
|
-
value: { zoomFactor: zoomFactor, zoomPoint: null } });
|
|
17233
|
-
}
|
|
17234
|
-
}
|
|
17235
|
-
}
|
|
17236
|
-
else {
|
|
17237
|
-
if (this.objColl[this.objColl.length - 1].activePoint.height < activeObj.activePoint.width) {
|
|
17238
|
-
for (var i = 2; i < this.zoomSettings.maxZoomFactor; i++) {
|
|
17239
|
-
if (this.objColl[this.objColl.length - 1].activePoint.height >= activeObj.activePoint.width ||
|
|
17240
|
-
this.isSelectionBiggerThanCanvas(this.objColl[this.objColl.length - 1]) ||
|
|
17241
|
-
this.isSelectionOutsideCanvas(this.objColl[this.objColl.length - 1])) {
|
|
17242
|
-
if (!isNullOrUndefined(zoomFactor)) {
|
|
17243
|
-
this.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
17244
|
-
value: { zoomFactor: -0.1, zoomPoint: null } });
|
|
17245
|
-
}
|
|
17246
|
-
break;
|
|
17247
|
-
}
|
|
17248
|
-
zoomFactor += .1;
|
|
17249
|
-
this.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
17250
|
-
value: { zoomFactor: zoomFactor, zoomPoint: null } });
|
|
17251
|
-
}
|
|
17252
|
-
}
|
|
17253
|
-
else {
|
|
17254
|
-
for (var i = 2; i < this.zoomSettings.maxZoomFactor; i++) {
|
|
17255
|
-
if (this.objColl[this.objColl.length - 1].activePoint.height >= activeObj.activePoint.width ||
|
|
17256
|
-
this.isSelectionBiggerThanCanvas(this.objColl[this.objColl.length - 1]) ||
|
|
17257
|
-
this.isSelectionOutsideCanvas(this.objColl[this.objColl.length - 1])) {
|
|
17258
|
-
if (!isNullOrUndefined(zoomFactor)) {
|
|
17259
|
-
this.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
17260
|
-
value: { zoomFactor: 0.1, zoomPoint: null } });
|
|
17261
|
-
}
|
|
17262
|
-
break;
|
|
17263
|
-
}
|
|
17264
|
-
zoomFactor -= .1;
|
|
17265
|
-
this.notify('transform', { prop: 'zoomAction', onPropertyChange: false,
|
|
17266
|
-
value: { zoomFactor: zoomFactor, zoomPoint: null } });
|
|
17267
|
-
}
|
|
17268
|
-
}
|
|
17269
|
-
}
|
|
17270
|
-
var panX = (this.lowerCanvas.clientWidth / 2) - (this.objColl[this.objColl.length - 1].activePoint.startX +
|
|
17271
|
-
(this.objColl[this.objColl.length - 1].activePoint.width / 2));
|
|
17272
|
-
var panY = (this.lowerCanvas.clientHeight / 2) - (this.objColl[this.objColl.length - 1].activePoint.startY +
|
|
17273
|
-
(this.objColl[this.objColl.length - 1].activePoint.height / 2));
|
|
17274
|
-
if (this.transform.degree === 0) {
|
|
17275
|
-
this.img.destLeft += panX;
|
|
17276
|
-
this.img.destTop += panY;
|
|
17277
|
-
this.notify('transform', { prop: 'drawPannImage', value: { point: { x: panX, y: panY } } });
|
|
17278
|
-
}
|
|
17279
|
-
else {
|
|
17280
|
-
this.panPoint.currentPannedPoint = { x: panX, y: panY };
|
|
17281
|
-
this.notify('transform', { prop: 'drawPannedImage', value: { xDiff: panX, yDiff: panY } });
|
|
17282
|
-
this.panPoint.currentPannedPoint = { x: 0, y: 0 };
|
|
17283
|
-
}
|
|
17284
|
-
this.notify('transform', { prop: 'setTempPanMove', onPropertyChange: false,
|
|
17285
|
-
value: { point: null } });
|
|
17286
|
-
this.activeObj = extend({}, this.objColl[this.objColl.length - 1]);
|
|
17287
|
-
this.objColl.pop();
|
|
17288
|
-
this.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: this.activeObj } });
|
|
17289
|
-
}
|
|
17290
|
-
}
|
|
17291
|
-
};
|
|
17292
|
-
ImageEditor.prototype.isSelectionBiggerThanCanvas = function (obj) {
|
|
17293
|
-
var isBigger = false;
|
|
17294
|
-
if (obj.activePoint.startX <= this.img.destLeft ||
|
|
17295
|
-
obj.activePoint.startY <= this.img.destTop ||
|
|
17296
|
-
obj.activePoint.endX >= this.img.destLeft + this.img.destWidth ||
|
|
17297
|
-
obj.activePoint.endY >= this.img.destTop + this.img.destHeight) {
|
|
17298
|
-
isBigger = true;
|
|
17299
|
-
}
|
|
17300
|
-
return isBigger;
|
|
17301
|
-
};
|
|
17302
|
-
ImageEditor.prototype.isSelectionOutsideCanvas = function (obj) {
|
|
17303
|
-
var isOutside = false;
|
|
17304
|
-
if ((obj.activePoint.height < this.lowerCanvas.height - this.toolbarHeight) ||
|
|
17305
|
-
(obj.activePoint.width < this.lowerCanvas.width)) {
|
|
17306
|
-
isOutside = true;
|
|
17307
|
-
}
|
|
17308
|
-
return isOutside;
|
|
17309
|
-
};
|
|
17310
17334
|
/**
|
|
17311
17335
|
* Set the old item Transform item state.
|
|
17312
17336
|
*
|
|
@@ -17350,7 +17374,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17350
17374
|
for (var i = 0; i < strArr.length; i++) {
|
|
17351
17375
|
strArr[i] = strArr[i].charAt(0).toUpperCase() + strArr[i].slice(1);
|
|
17352
17376
|
}
|
|
17353
|
-
if (
|
|
17377
|
+
if (obj) {
|
|
17354
17378
|
obj['maxText'] = strArr.join('');
|
|
17355
17379
|
}
|
|
17356
17380
|
return strArr.join('');
|
|
@@ -17417,7 +17441,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17417
17441
|
this.notify('undo-redo', { prop: 'updateCurrUrc', value: { type: 'ok' } });
|
|
17418
17442
|
}
|
|
17419
17443
|
}
|
|
17420
|
-
else if ((!isBlazor() &&
|
|
17444
|
+
else if ((!isBlazor() && document.querySelector('#' + this.element.id + '_sliderWrapper')) || (isBlazor() && !this.element.querySelector('.e-ie-contextual-slider').classList.contains('e-hidden')) ||
|
|
17421
17445
|
this.currObjType.isFiltered) {
|
|
17422
17446
|
this.initialAdjustmentValue = this.canvasFilter = this.lowerContext.filter;
|
|
17423
17447
|
this.currObjType.isFiltered = false;
|
|
@@ -17479,7 +17503,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17479
17503
|
* @returns {void}.
|
|
17480
17504
|
*/
|
|
17481
17505
|
ImageEditor.prototype.cropSelectedState = function () {
|
|
17482
|
-
if (
|
|
17506
|
+
if (this.activeObj.shape && this.activeObj.shape.split('-')[0] === 'crop') {
|
|
17483
17507
|
this.okBtn();
|
|
17484
17508
|
}
|
|
17485
17509
|
};
|
|
@@ -17494,7 +17518,10 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17494
17518
|
var tempFilter = this.lowerContext.filter;
|
|
17495
17519
|
this.lowerContext.filter = this.canvasFilter = 'none';
|
|
17496
17520
|
var objColl = extend([], this.objColl, null, true);
|
|
17521
|
+
var pointColl = extend([], this.pointColl, null, true);
|
|
17497
17522
|
this.objColl = [];
|
|
17523
|
+
this.pointColl = [];
|
|
17524
|
+
this.freehandCounter = 0;
|
|
17498
17525
|
this.notify('draw', { prop: 'render-image', value: { isMouseWheel: false } });
|
|
17499
17526
|
var data = this.getImageData();
|
|
17500
17527
|
if (!isBlazor()) {
|
|
@@ -17503,6 +17530,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17503
17530
|
this.element.querySelector('#' + this.element.id + '_contextualToolbarArea').classList.remove('e-hide');
|
|
17504
17531
|
}
|
|
17505
17532
|
this.objColl = objColl;
|
|
17533
|
+
this.pointColl = pointColl;
|
|
17534
|
+
this.freehandCounter = pointColl.length;
|
|
17506
17535
|
this.notify('shape', { prop: 'iterateObjColl', onPropertyChange: false });
|
|
17507
17536
|
this.lowerContext.filter = this.canvasFilter = tempFilter;
|
|
17508
17537
|
return data;
|
|
@@ -17519,7 +17548,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17519
17548
|
var _this = this;
|
|
17520
17549
|
var finetuneValueChanging = { finetune: this.getFinetuneOption(type),
|
|
17521
17550
|
value: value, cancel: false };
|
|
17522
|
-
if (isBlazor() &&
|
|
17551
|
+
if (isBlazor() && this.events && this.events.finetuneValueChanging.hasDelegate === true) {
|
|
17523
17552
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
17524
17553
|
this.dotNetRef.invokeMethodAsync('OnFinetuneValueChangeAsync', finetuneValueChanging).then(function (finetuneValueChanging) {
|
|
17525
17554
|
if (finetuneValueChanging.cancel) {
|
|
@@ -17536,82 +17565,6 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17536
17565
|
this.notify('filter', { prop: 'setCurrAdjValue', value: { type: type.toLowerCase(), value: value } });
|
|
17537
17566
|
}
|
|
17538
17567
|
};
|
|
17539
|
-
/**
|
|
17540
|
-
* Get the square point for rotated shape.
|
|
17541
|
-
*
|
|
17542
|
-
* @param { SelectionPoint } obj - Specifies the selection point.
|
|
17543
|
-
* @param { Object } object - Specifies the object.
|
|
17544
|
-
* @hidden
|
|
17545
|
-
* @returns {ActivePoint}.
|
|
17546
|
-
* An ActivePoint object which returns the square point.
|
|
17547
|
-
*/
|
|
17548
|
-
ImageEditor.prototype.getSquarePointForRotatedShape = function (obj, object) {
|
|
17549
|
-
var point = { startX: 0, startY: 0, endX: 0, endY: 0, width: 0, height: 0 };
|
|
17550
|
-
var center = { x: obj.activePoint.startX + (obj.activePoint.width / 2), y: obj.activePoint.startY +
|
|
17551
|
-
(obj.activePoint.height / 2) };
|
|
17552
|
-
var p1 = { x: Math.cos(obj.rotatedAngle) * (obj.activePoint.startX - center.x) - Math.sin(obj.rotatedAngle)
|
|
17553
|
-
* (obj.activePoint.startY - center.y) + center.x,
|
|
17554
|
-
y: Math.sin(obj.rotatedAngle) * (obj.activePoint.startX - center.x) + Math.cos(obj.rotatedAngle) * (obj.activePoint.startY
|
|
17555
|
-
- center.y) + center.y };
|
|
17556
|
-
var p2 = { x: Math.cos(obj.rotatedAngle) * (obj.activePoint.endX - center.x) - Math.sin(obj.rotatedAngle) *
|
|
17557
|
-
(obj.activePoint.startY - center.y) + center.x,
|
|
17558
|
-
y: Math.sin(obj.rotatedAngle) * (obj.activePoint.endX - center.x) + Math.cos(obj.rotatedAngle) * (obj.activePoint.startY
|
|
17559
|
-
- center.y) + center.y };
|
|
17560
|
-
var p3 = { x: Math.cos(obj.rotatedAngle) * (obj.activePoint.startX - center.x) - Math.sin(obj.rotatedAngle) *
|
|
17561
|
-
(obj.activePoint.endY - center.y) + center.x,
|
|
17562
|
-
y: Math.sin(obj.rotatedAngle) * (obj.activePoint.startX - center.x) + Math.cos(obj.rotatedAngle) * (obj.activePoint.endY
|
|
17563
|
-
- center.y) + center.y };
|
|
17564
|
-
var p4 = { x: Math.cos(obj.rotatedAngle) * (obj.activePoint.endX - center.x) - Math.sin(obj.rotatedAngle) *
|
|
17565
|
-
(obj.activePoint.endY - center.y) + center.x,
|
|
17566
|
-
y: Math.sin(obj.rotatedAngle) * (obj.activePoint.endX - center.x) + Math.cos(obj.rotatedAngle) *
|
|
17567
|
-
(obj.activePoint.endY - center.y) + center.y };
|
|
17568
|
-
point.startX = p1.x;
|
|
17569
|
-
point.startY = p1.y;
|
|
17570
|
-
point.endX = p1.x;
|
|
17571
|
-
point.endY = p1.y;
|
|
17572
|
-
if (point.startX > p2.x) {
|
|
17573
|
-
point.startX = p2.x;
|
|
17574
|
-
}
|
|
17575
|
-
if (point.startX > p3.x) {
|
|
17576
|
-
point.startX = p3.x;
|
|
17577
|
-
}
|
|
17578
|
-
if (point.startX > p4.x) {
|
|
17579
|
-
point.startX = p4.x;
|
|
17580
|
-
}
|
|
17581
|
-
if (point.startY > p2.y) {
|
|
17582
|
-
point.startY = p2.y;
|
|
17583
|
-
}
|
|
17584
|
-
if (point.startY > p3.y) {
|
|
17585
|
-
point.startY = p3.y;
|
|
17586
|
-
}
|
|
17587
|
-
if (point.startY > p4.y) {
|
|
17588
|
-
point.startY = p4.y;
|
|
17589
|
-
}
|
|
17590
|
-
if (point.endX < p2.x) {
|
|
17591
|
-
point.endX = p2.x;
|
|
17592
|
-
}
|
|
17593
|
-
if (point.endX < p3.x) {
|
|
17594
|
-
point.endX = p3.x;
|
|
17595
|
-
}
|
|
17596
|
-
if (point.endX < p4.x) {
|
|
17597
|
-
point.endX = p4.x;
|
|
17598
|
-
}
|
|
17599
|
-
if (point.endY < p2.y) {
|
|
17600
|
-
point.endY = p2.y;
|
|
17601
|
-
}
|
|
17602
|
-
if (point.endY < p3.y) {
|
|
17603
|
-
point.endY = p3.y;
|
|
17604
|
-
}
|
|
17605
|
-
if (point.endY < p4.y) {
|
|
17606
|
-
point.endY = p4.y;
|
|
17607
|
-
}
|
|
17608
|
-
point.width = point.endX - point.startX;
|
|
17609
|
-
point.height = point.endY - point.startY;
|
|
17610
|
-
if (!isNullOrUndefined(object)) {
|
|
17611
|
-
object['activePoint'] = point;
|
|
17612
|
-
}
|
|
17613
|
-
return point;
|
|
17614
|
-
};
|
|
17615
17568
|
/**
|
|
17616
17569
|
* Get the square point for path.
|
|
17617
17570
|
*
|
|
@@ -17700,14 +17653,14 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
17700
17653
|
this.notify('selection', { prop: 'redrawShape', value: { obj: this.objColl[this.objColl.length - 1] } });
|
|
17701
17654
|
if (!isBlazor()) {
|
|
17702
17655
|
if (Browser.isDevice) {
|
|
17703
|
-
if (
|
|
17656
|
+
if (document.getElementById(this.element.id + '_bottomToolbar')) {
|
|
17704
17657
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
17705
17658
|
var toolbar_1 = getComponent(this.element.id + '_bottomToolbar', 'toolbar');
|
|
17706
17659
|
toolbar_1.refreshOverflow();
|
|
17707
17660
|
}
|
|
17708
17661
|
}
|
|
17709
17662
|
else {
|
|
17710
|
-
if (
|
|
17663
|
+
if (document.getElementById(this.element.id + '_toolbar')) {
|
|
17711
17664
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
17712
17665
|
var toolbar_2 = getComponent(this.element.id + '_toolbar', 'toolbar');
|
|
17713
17666
|
toolbar_2.refreshOverflow();
|
|
@@ -18141,9 +18094,8 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18141
18094
|
var obj = { adjustmentLevel: null };
|
|
18142
18095
|
this.notify('filter', { prop: 'getAdjustmentLevel', onPropertyChange: false,
|
|
18143
18096
|
value: { obj: obj } });
|
|
18144
|
-
var value;
|
|
18145
18097
|
var typeToAdjustmentLevel = { 'brightness': obj['adjustmentLevel'].brightness,
|
|
18146
|
-
'contrast':
|
|
18098
|
+
'contrast': obj['adjustmentLevel'].contrast, 'hue': obj['adjustmentLevel'].hue,
|
|
18147
18099
|
'saturation': obj['adjustmentLevel'].saturation, 'opacity': obj['adjustmentLevel'].opacity,
|
|
18148
18100
|
'blur': obj['adjustmentLevel'].blur, 'exposure': obj['adjustmentLevel'].exposure };
|
|
18149
18101
|
return typeToAdjustmentLevel["" + type];
|
|
@@ -18162,7 +18114,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18162
18114
|
this.cropSelectedState();
|
|
18163
18115
|
this.notify('draw', { prop: 'resetCurrentSelectionPoint' });
|
|
18164
18116
|
this.notify('transform', { prop: 'performTransformation', value: { text: type } });
|
|
18165
|
-
this.moveToSelectionRange
|
|
18117
|
+
this.notify('draw', { prop: 'moveToSelectionRange', value: { type: type, activeObj: activeObj } });
|
|
18166
18118
|
this.isCropToolbar = false;
|
|
18167
18119
|
};
|
|
18168
18120
|
/**
|
|
@@ -18189,7 +18141,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18189
18141
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
18190
18142
|
this.element = element;
|
|
18191
18143
|
var canvasWrapper = this.element.querySelector('.e-canvas-wrapper');
|
|
18192
|
-
if (
|
|
18144
|
+
if (this.element.querySelector('#' + this.element.id + '_toolbar')) {
|
|
18193
18145
|
this.toolbarHeight = this.element.querySelector('#' + this.element.id + '_toolbar').clientHeight;
|
|
18194
18146
|
}
|
|
18195
18147
|
else {
|
|
@@ -18207,9 +18159,6 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
|
|
|
18207
18159
|
});
|
|
18208
18160
|
this.upperCanvas.width = this.lowerCanvas.width = this.inMemoryCanvas.width = this.element.offsetWidth;
|
|
18209
18161
|
this.upperCanvas.height = this.lowerCanvas.height = this.inMemoryCanvas.height = (this.element.offsetHeight - this.toolbarHeight);
|
|
18210
|
-
this.baseImg = this.createElement('img', {
|
|
18211
|
-
id: this.element.id + '_orgImg', attrs: { name: 'Image', crossorigin: 'anonymous' }
|
|
18212
|
-
});
|
|
18213
18162
|
this.lowerContext = this.lowerCanvas.getContext('2d');
|
|
18214
18163
|
this.baseImg = this.createElement('img', {
|
|
18215
18164
|
id: this.element.id + '_orgImg', attrs: { name: 'Image', crossorigin: 'anonymous' }
|
|
@@ -18709,6 +18658,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
18709
18658
|
this.l10n = new L10n('image-editor', this.defaultLocale, this.parent.locale);
|
|
18710
18659
|
};
|
|
18711
18660
|
ToolbarModule.prototype.toolbar = function (args) {
|
|
18661
|
+
var parent = this.parent;
|
|
18712
18662
|
this.updatePrivateVariables();
|
|
18713
18663
|
switch (args.prop) {
|
|
18714
18664
|
case 'create-toolbar':
|
|
@@ -18781,19 +18731,19 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
18781
18731
|
this.selFhdColor = args.value['color'];
|
|
18782
18732
|
break;
|
|
18783
18733
|
case 'getCurrentFilter':
|
|
18784
|
-
args.value['obj']['currentFilter'] =
|
|
18734
|
+
args.value['obj']['currentFilter'] = parent.currentFilter;
|
|
18785
18735
|
break;
|
|
18786
18736
|
case 'setCurrentFilter':
|
|
18787
|
-
|
|
18737
|
+
parent.currentFilter = args.value['filter'];
|
|
18788
18738
|
break;
|
|
18789
18739
|
case 'setInitialAdjustmentValue':
|
|
18790
|
-
|
|
18740
|
+
parent.initialAdjustmentValue = args.value['value'];
|
|
18791
18741
|
break;
|
|
18792
18742
|
case 'getCanvasFilter':
|
|
18793
|
-
args.value['obj']['canvasFilter'] =
|
|
18743
|
+
args.value['obj']['canvasFilter'] = parent.canvasFilter;
|
|
18794
18744
|
break;
|
|
18795
18745
|
case 'setCanvasFilter':
|
|
18796
|
-
|
|
18746
|
+
parent.canvasFilter = args.value['filter'];
|
|
18797
18747
|
break;
|
|
18798
18748
|
case 'getDefToolbarItems':
|
|
18799
18749
|
args.value['obj']['defToolbarItems'] = this.defToolbarItems;
|
|
@@ -18805,7 +18755,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
18805
18755
|
this.performDefTbrClick(args.value['type'], args.value['isContextualToolbar'], args.value['isDisabledAdjustment'], args.value['isDisabledFilter'], args.value['isFilterFinetune']);
|
|
18806
18756
|
break;
|
|
18807
18757
|
case 'setTempFilterProperties':
|
|
18808
|
-
|
|
18758
|
+
parent.setTempFilterProperties();
|
|
18809
18759
|
break;
|
|
18810
18760
|
case 'refreshSlider':
|
|
18811
18761
|
this.refreshSlider();
|
|
@@ -18814,28 +18764,25 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
18814
18764
|
this.renderSlider(args.value['type']);
|
|
18815
18765
|
break;
|
|
18816
18766
|
case 'getCurrAdjustmentValue':
|
|
18817
|
-
|
|
18767
|
+
parent.getCurrAdjustmentValue(args.value['type']);
|
|
18818
18768
|
break;
|
|
18819
18769
|
case 'setCurrAdjustmentValue':
|
|
18820
|
-
|
|
18770
|
+
parent.setCurrAdjustmentValue(args.value['type'], args.value['value']);
|
|
18821
18771
|
break;
|
|
18822
18772
|
case 'refreshShapeDrawing':
|
|
18823
18773
|
this.refreshShapeDrawing();
|
|
18824
18774
|
break;
|
|
18825
|
-
case 'getSquarePointForRotatedShape':
|
|
18826
|
-
this.parent.getSquarePointForRotatedShape(args.value['obj'], args.value['object']);
|
|
18827
|
-
break;
|
|
18828
18775
|
case 'getCropToolbar':
|
|
18829
|
-
args.value['obj']['isCropToolbar'] =
|
|
18776
|
+
args.value['obj']['isCropToolbar'] = parent.isCropToolbar;
|
|
18830
18777
|
break;
|
|
18831
18778
|
case 'getPrevCurrSelectionPoint':
|
|
18832
|
-
args.value['obj']['prevCurrSelectionPoint'] =
|
|
18779
|
+
args.value['obj']['prevCurrSelectionPoint'] = parent.prevCurrSelectionPoint;
|
|
18833
18780
|
break;
|
|
18834
18781
|
case 'setPrevCurrSelectionPoint':
|
|
18835
|
-
|
|
18782
|
+
parent.prevCurrSelectionPoint = args.value['point'];
|
|
18836
18783
|
break;
|
|
18837
18784
|
case 'updateCropTransformItems':
|
|
18838
|
-
|
|
18785
|
+
parent.updateCropTransformItems();
|
|
18839
18786
|
break;
|
|
18840
18787
|
case 'setEnableDisableUndoRedo':
|
|
18841
18788
|
this.preventEnableDisableUr = args.value['isPrevent'];
|
|
@@ -18848,52 +18795,54 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
18848
18795
|
ToolbarModule.prototype.updatePrivateVariables = function () {
|
|
18849
18796
|
var parent = this.parent;
|
|
18850
18797
|
this.inMemoryCanvas = parent.inMemoryCanvas;
|
|
18851
|
-
if (
|
|
18798
|
+
if (parent.lowerCanvas) {
|
|
18852
18799
|
this.lowerContext = parent.lowerCanvas.getContext('2d');
|
|
18853
18800
|
}
|
|
18854
|
-
if (
|
|
18801
|
+
if (parent.upperCanvas) {
|
|
18855
18802
|
this.upperContext = parent.upperCanvas.getContext('2d');
|
|
18856
18803
|
}
|
|
18857
|
-
if (
|
|
18804
|
+
if (this.inMemoryCanvas) {
|
|
18858
18805
|
this.inMemoryContext = this.inMemoryCanvas.getContext('2d');
|
|
18859
18806
|
}
|
|
18860
18807
|
};
|
|
18861
18808
|
ToolbarModule.prototype.reset = function () {
|
|
18809
|
+
var parent = this.parent;
|
|
18862
18810
|
this.defToolbarItems = [];
|
|
18863
18811
|
this.toolbarHeight = 46;
|
|
18864
|
-
|
|
18812
|
+
parent.prevCurrSelectionPoint = null;
|
|
18865
18813
|
this.zoomBtnHold = null;
|
|
18866
18814
|
this.currToolbar = '';
|
|
18867
18815
|
this.currentToolbar = 'main';
|
|
18868
18816
|
this.selFhdColor = '#42a5f5';
|
|
18869
|
-
|
|
18870
|
-
this.preventZoomBtn =
|
|
18871
|
-
|
|
18817
|
+
parent.currentFilter = '';
|
|
18818
|
+
this.preventZoomBtn = parent.isCropToolbar = this.preventEnableDisableUr = false;
|
|
18819
|
+
parent.initialAdjustmentValue = parent.canvasFilter =
|
|
18872
18820
|
'brightness(' + 1 + ') ' + 'contrast(' + 100 + '%) ' + 'hue-rotate(' + 0 + 'deg) ' +
|
|
18873
18821
|
'saturate(' + 100 + '%) ' + 'opacity(' + 1 + ') ' + 'blur(' + 0 + 'px) ' + 'sepia(0%) ' + 'grayscale(0%) ' + 'invert(0%)';
|
|
18874
18822
|
};
|
|
18875
18823
|
ToolbarModule.prototype.destroyTopToolbar = function () {
|
|
18876
18824
|
var parent = this.parent;
|
|
18877
|
-
|
|
18878
|
-
|
|
18825
|
+
var toolbar = document.getElementById(parent.element.id + '_toolbar');
|
|
18826
|
+
if (this.isToolbar() && toolbar && toolbar.classList.contains('e-control')) {
|
|
18879
18827
|
getComponent(document.getElementById(parent.element.id + '_toolbar'), 'toolbar').destroy();
|
|
18880
18828
|
}
|
|
18881
18829
|
};
|
|
18882
18830
|
ToolbarModule.prototype.destroyBottomToolbar = function () {
|
|
18883
18831
|
var parent = this.parent;
|
|
18884
|
-
|
|
18885
|
-
|
|
18832
|
+
var toolbar = document.getElementById(parent.element.id + '_bottomToolbar');
|
|
18833
|
+
if (toolbar && toolbar.classList.contains('e-control')) {
|
|
18886
18834
|
getComponent(document.getElementById(parent.element.id + '_bottomToolbar'), 'toolbar').destroy();
|
|
18887
18835
|
}
|
|
18888
18836
|
};
|
|
18889
18837
|
ToolbarModule.prototype.isToolbar = function () {
|
|
18890
|
-
|
|
18891
|
-
|
|
18838
|
+
var parent = this.parent;
|
|
18839
|
+
return (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.length > 0)
|
|
18840
|
+
|| !isNullOrUndefined(parent.toolbarTemplate));
|
|
18892
18841
|
};
|
|
18893
18842
|
ToolbarModule.prototype.createToolbar = function () {
|
|
18894
18843
|
var _this = this;
|
|
18895
18844
|
var parent = this.parent;
|
|
18896
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
18845
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.length > 0)) {
|
|
18897
18846
|
parent.element.appendChild(parent.createElement('div', {
|
|
18898
18847
|
id: parent.element.id + '_toolbarArea', className: 'e-toolbar-area'
|
|
18899
18848
|
}));
|
|
@@ -18919,10 +18868,10 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
18919
18868
|
if (!parent.disabled) {
|
|
18920
18869
|
if (Browser.isDevice) {
|
|
18921
18870
|
if (_this.defToolbarItems.length > 0 &&
|
|
18922
|
-
|
|
18871
|
+
document.getElementById(parent.element.id + '_toolbar')) {
|
|
18923
18872
|
getComponent(document.getElementById(parent.element.id + '_toolbar'), 'toolbar').destroy();
|
|
18924
18873
|
}
|
|
18925
|
-
if (
|
|
18874
|
+
if (document.getElementById(parent.element.id + '_bottomToolbar')) {
|
|
18926
18875
|
getComponent(document.getElementById(parent.element.id + '_bottomToolbar'), 'toolbar').destroy();
|
|
18927
18876
|
}
|
|
18928
18877
|
_this.initMainToolbar(false, Browser.isDevice, null);
|
|
@@ -18930,7 +18879,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
18930
18879
|
}
|
|
18931
18880
|
else {
|
|
18932
18881
|
if (_this.defToolbarItems.length > 0 &&
|
|
18933
|
-
|
|
18882
|
+
document.getElementById(parent.element.id + '_toolbar')) {
|
|
18934
18883
|
getComponent(document.getElementById(parent.element.id + '_toolbar'), 'toolbar').destroy();
|
|
18935
18884
|
}
|
|
18936
18885
|
_this.initMainToolbar(false, false, null);
|
|
@@ -18947,7 +18896,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
18947
18896
|
clicked: this.defToolbarClicked.bind(this) });
|
|
18948
18897
|
toolbarObj.appendTo('#' + parent.element.id + '_toolbar');
|
|
18949
18898
|
this.createLeftToolbarControls();
|
|
18950
|
-
if (
|
|
18899
|
+
if (document.getElementById(parent.element.id + '_toolbar')) {
|
|
18951
18900
|
this.toolbarHeight = document.getElementById(parent.element.id + '_toolbar').clientHeight;
|
|
18952
18901
|
}
|
|
18953
18902
|
}
|
|
@@ -18957,7 +18906,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
18957
18906
|
};
|
|
18958
18907
|
ToolbarModule.prototype.createContextualToolbar = function () {
|
|
18959
18908
|
var parent = this.parent;
|
|
18960
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
18909
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.length > 0)) {
|
|
18961
18910
|
parent.element.appendChild(parent.createElement('div', { id: parent.element.id + '_contextualToolbarArea',
|
|
18962
18911
|
className: 'e-contextual-toolbar-wrapper e-hide', attrs: { style: 'position: absolute;' }
|
|
18963
18912
|
}));
|
|
@@ -18968,7 +18917,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
18968
18917
|
};
|
|
18969
18918
|
ToolbarModule.prototype.createBottomToolbar = function () {
|
|
18970
18919
|
var parent = this.parent;
|
|
18971
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
18920
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.length > 0)) {
|
|
18972
18921
|
parent.element.appendChild(parent.createElement('div', {
|
|
18973
18922
|
id: parent.element.id + '_bottomToolbarArea', className: 'e-bottom-toolbar'
|
|
18974
18923
|
}));
|
|
@@ -19032,7 +18981,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19032
18981
|
toolbarObj.appendTo('#' + parent.element.id + '_toolbar');
|
|
19033
18982
|
this.createLeftToolbarControls();
|
|
19034
18983
|
this.enableDisableTbrBtn();
|
|
19035
|
-
if (this.isToolbar() &&
|
|
18984
|
+
if (this.isToolbar() && document.getElementById(parent.element.id + '_toolbar')) {
|
|
19036
18985
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
19037
18986
|
var toolbar_4 = getComponent(parent.element.id + '_toolbar', 'toolbar');
|
|
19038
18987
|
toolbar_4.refreshOverflow();
|
|
@@ -19042,7 +18991,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19042
18991
|
ToolbarModule.prototype.initBottomToolbar = function () {
|
|
19043
18992
|
var _this = this;
|
|
19044
18993
|
var parent = this.parent;
|
|
19045
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
18994
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.length > 0)) {
|
|
19046
18995
|
var items = this.getMainToolbarItem();
|
|
19047
18996
|
var toolbarObj = new Toolbar({ items: items, width: '100%',
|
|
19048
18997
|
created: function () {
|
|
@@ -19054,7 +19003,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19054
19003
|
clicked: this.defToolbarClicked.bind(this)
|
|
19055
19004
|
});
|
|
19056
19005
|
toolbarObj.appendTo('#' + parent.element.id + '_bottomToolbar');
|
|
19057
|
-
if (this.defToolbarItems.length > 0 &&
|
|
19006
|
+
if (this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_bottomToolbar')) {
|
|
19058
19007
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
19059
19008
|
var toolbar_5 = getComponent(parent.element.id + '_bottomToolbar', 'toolbar');
|
|
19060
19009
|
toolbar_5.refreshOverflow();
|
|
@@ -19069,21 +19018,21 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19069
19018
|
toolbarItems.push({ visible: false, cssClass: 'e-image-position e-btn e-flat', tooltipText: this.l10n.getConstant('Browse'), align: 'Left' });
|
|
19070
19019
|
}
|
|
19071
19020
|
if (parent.allowUndoRedo) {
|
|
19072
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19021
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Undo') > -1)) {
|
|
19073
19022
|
toolbarItems.push({ id: parent.element.id + '_undo', prefixIcon: 'e-icons e-undo', cssClass: 'top-icon e-undo',
|
|
19074
19023
|
tooltipText: this.l10n.getConstant('Undo'), align: 'Left' });
|
|
19075
19024
|
}
|
|
19076
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19025
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Redo') > -1)) {
|
|
19077
19026
|
toolbarItems.push({ id: parent.element.id + '_redo', prefixIcon: 'e-icons e-redo', cssClass: 'top-icon e-redo',
|
|
19078
19027
|
tooltipText: this.l10n.getConstant('Redo'), align: 'Left' });
|
|
19079
19028
|
}
|
|
19080
19029
|
}
|
|
19081
19030
|
if (!this.preventZoomBtn && (parent.zoomSettings.zoomTrigger & ZoomTrigger.Toolbar) === ZoomTrigger.Toolbar) {
|
|
19082
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19031
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('ZoomOut') > -1)) {
|
|
19083
19032
|
toolbarItems.push({ id: parent.element.id + '_zoomOut', prefixIcon: 'e-icons e-zoom-out', cssClass: 'top-icon e-dec-zoom',
|
|
19084
19033
|
tooltipText: this.l10n.getConstant('ZoomOut'), align: 'Left' });
|
|
19085
19034
|
}
|
|
19086
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19035
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('ZoomIn') > -1)) {
|
|
19087
19036
|
toolbarItems.push({ id: parent.element.id + '_zoomIn', prefixIcon: 'e-icons e-zoom-in', cssClass: 'top-icon e-inc-zoom',
|
|
19088
19037
|
tooltipText: this.l10n.getConstant('ZoomIn'), align: 'Left' });
|
|
19089
19038
|
}
|
|
@@ -19103,12 +19052,12 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19103
19052
|
toolbarItems.push({ id: parent.element.id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
19104
19053
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
19105
19054
|
}
|
|
19106
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19055
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Reset') > -1)) {
|
|
19107
19056
|
toolbarItems.push({ id: parent.element.id + '_reset', prefixIcon: 'e-icons e-btn-reset', cssClass: 'top-icon e-img-reset',
|
|
19108
19057
|
tooltipText: this.l10n.getConstant('Reset'), align: 'Right' });
|
|
19109
19058
|
}
|
|
19110
19059
|
if (!isOkBtn) {
|
|
19111
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19060
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Save') > -1)) {
|
|
19112
19061
|
toolbarItems.push({ id: parent.element.id + '_save', prefixIcon: 'e-icons e-btn-save', cssClass: 'top-icon e-save',
|
|
19113
19062
|
tooltipText: this.l10n.getConstant('Save'), align: 'Right', template: '<button id="' + parent.element.id + '_saveBtn"></button>' });
|
|
19114
19063
|
}
|
|
@@ -19122,19 +19071,19 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19122
19071
|
ToolbarModule.prototype.getMainToolbarItem = function (isApplyOption) {
|
|
19123
19072
|
var parent = this.parent;
|
|
19124
19073
|
var toolbarItems = [];
|
|
19125
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19074
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Crop') > -1)) {
|
|
19126
19075
|
toolbarItems.push({ id: parent.element.id + '_cropTransform', prefixIcon: 'e-icons e-crop', cssClass: 'top-icon e-crop',
|
|
19127
19076
|
tooltipText: this.l10n.getConstant('CropAndTransform'), align: 'Center' });
|
|
19128
19077
|
}
|
|
19129
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19078
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Annotate') > -1)) {
|
|
19130
19079
|
toolbarItems.push({ id: parent.element.id + '_annotation', tooltipText: this.l10n.getConstant('Annotation'), align: 'Center',
|
|
19131
|
-
template: '<button id="' +
|
|
19080
|
+
template: '<button id="' + parent.element.id + '_annotationBtn"></button>' });
|
|
19132
19081
|
}
|
|
19133
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19082
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Finetune') > -1)) {
|
|
19134
19083
|
toolbarItems.push({ id: parent.element.id + '_adjustment', prefixIcon: 'e-icons e-adjustment', cssClass: 'top-icon e-adjustment',
|
|
19135
19084
|
tooltipText: this.l10n.getConstant('Finetune'), align: 'Center' });
|
|
19136
19085
|
}
|
|
19137
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19086
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Filter') > -1)) {
|
|
19138
19087
|
toolbarItems.push({ id: parent.element.id + '_filter', prefixIcon: 'e-icons e-filters', cssClass: 'top-icon e-filters',
|
|
19139
19088
|
tooltipText: this.l10n.getConstant('Filter'), align: 'Center' });
|
|
19140
19089
|
}
|
|
@@ -19197,7 +19146,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19197
19146
|
if (typeof (parent.toolbar[i]) === 'object') {
|
|
19198
19147
|
if (isNullOrUndefined(parent.toolbar[i].align)) {
|
|
19199
19148
|
if (position === 'left') {
|
|
19200
|
-
toolbarItems.push(
|
|
19149
|
+
toolbarItems.push(parent.toolbar[i]);
|
|
19201
19150
|
}
|
|
19202
19151
|
}
|
|
19203
19152
|
else if (parent.toolbar[i].align.toLowerCase() === position) {
|
|
@@ -19223,13 +19172,13 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19223
19172
|
ToolbarModule.prototype.wireZoomBtnEvents = function () {
|
|
19224
19173
|
var zoomIn = document.querySelector('#' + this.parent.element.id + '_zoomIn');
|
|
19225
19174
|
var zoomOut = document.querySelector('#' + this.parent.element.id + '_zoomOut');
|
|
19226
|
-
if (
|
|
19175
|
+
if (zoomIn) {
|
|
19227
19176
|
zoomIn.addEventListener('mousedown', this.zoomInBtnMouseDownHandler.bind(this));
|
|
19228
19177
|
zoomIn.addEventListener('mouseup', this.zoomBtnMouseUpHandler.bind(this));
|
|
19229
19178
|
zoomIn.addEventListener('click', this.zoomInBtnClickHandler.bind(this));
|
|
19230
19179
|
zoomIn.addEventListener('touchstart', this.zoomInBtnClickHandler.bind(this));
|
|
19231
19180
|
}
|
|
19232
|
-
if (
|
|
19181
|
+
if (zoomOut) {
|
|
19233
19182
|
zoomOut.addEventListener('mousedown', this.zoomOutBtnMouseDownHandler.bind(this));
|
|
19234
19183
|
zoomOut.addEventListener('mouseup', this.zoomBtnMouseUpHandler.bind(this));
|
|
19235
19184
|
zoomOut.addEventListener('click', this.zoomOutBtnClickHandler.bind(this));
|
|
@@ -19244,58 +19193,58 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19244
19193
|
var undoRedoObj = { undoRedoStep: null };
|
|
19245
19194
|
parent.notify('undo-redo', { prop: 'getUndoRedoStep', value: { obj: undoRedoObj } });
|
|
19246
19195
|
var undo = document.querySelector('#' + parent.element.id + '_undo');
|
|
19247
|
-
if (
|
|
19196
|
+
if (undo && undoRedoObj['undoRedoStep'] === 0) {
|
|
19248
19197
|
undo.classList.add('e-disabled');
|
|
19249
19198
|
undo.parentElement.classList.add('e-overlay');
|
|
19250
19199
|
}
|
|
19251
|
-
else if (
|
|
19200
|
+
else if (undo && undoRedoObj['undoRedoStep'] > 0) {
|
|
19252
19201
|
undo.classList.remove('e-disabled');
|
|
19253
19202
|
undo.parentElement.classList.remove('e-overlay');
|
|
19254
19203
|
}
|
|
19255
19204
|
var redo = document.querySelector('#' + parent.element.id + '_redo');
|
|
19256
|
-
if (
|
|
19205
|
+
if (redo && (undoRedoObj['undoRedoStep'] === object['appliedUndoRedoColl'].length)) {
|
|
19257
19206
|
redo.classList.add('e-disabled');
|
|
19258
19207
|
redo.parentElement.classList.add('e-overlay');
|
|
19259
19208
|
}
|
|
19260
|
-
else if (
|
|
19209
|
+
else if (redo && (undoRedoObj['undoRedoStep'] === 0 && object['appliedUndoRedoColl'].length > 0)) {
|
|
19261
19210
|
redo.classList.remove('e-disabled');
|
|
19262
19211
|
redo.parentElement.classList.remove('e-overlay');
|
|
19263
19212
|
}
|
|
19264
|
-
else if (
|
|
19213
|
+
else if (redo && undoRedoObj['undoRedoStep'] > 0) {
|
|
19265
19214
|
redo.classList.remove('e-disabled');
|
|
19266
19215
|
redo.parentElement.classList.remove('e-overlay');
|
|
19267
19216
|
}
|
|
19268
19217
|
}
|
|
19269
19218
|
var zoomIn = document.querySelector('#' + parent.element.id + '_zoomIn');
|
|
19270
|
-
if (
|
|
19219
|
+
if (zoomIn && parent.zoomSettings.zoomFactor >= parent.zoomSettings.maxZoomFactor) {
|
|
19271
19220
|
zoomIn.classList.add('e-disabled');
|
|
19272
19221
|
zoomIn.parentElement.classList.add('e-overlay');
|
|
19273
19222
|
}
|
|
19274
|
-
else if (
|
|
19223
|
+
else if (zoomIn) {
|
|
19275
19224
|
zoomIn.classList.remove('e-disabled');
|
|
19276
19225
|
zoomIn.parentElement.classList.remove('e-overlay');
|
|
19277
19226
|
}
|
|
19278
19227
|
var zoomOut = document.querySelector('#' + parent.element.id + '_zoomOut');
|
|
19279
|
-
if (
|
|
19228
|
+
if (zoomOut && parent.zoomSettings.zoomFactor <= parent.zoomSettings.minZoomFactor) {
|
|
19280
19229
|
zoomOut.classList.add('e-disabled');
|
|
19281
19230
|
zoomOut.parentElement.classList.add('e-overlay');
|
|
19282
19231
|
}
|
|
19283
|
-
else if (
|
|
19232
|
+
else if (zoomOut) {
|
|
19284
19233
|
zoomOut.classList.remove('e-disabled');
|
|
19285
19234
|
zoomOut.parentElement.classList.remove('e-overlay');
|
|
19286
19235
|
}
|
|
19287
19236
|
var pan = document.querySelector('#' + parent.element.id + '_pan');
|
|
19288
|
-
if (
|
|
19237
|
+
if (pan && parent.zoomSettings.zoomFactor <= parent.zoomSettings.minZoomFactor) {
|
|
19289
19238
|
pan.style.display = 'none';
|
|
19290
19239
|
}
|
|
19291
|
-
else if (
|
|
19240
|
+
else if (pan) {
|
|
19292
19241
|
pan.style.display = 'block';
|
|
19293
19242
|
}
|
|
19294
19243
|
};
|
|
19295
19244
|
ToolbarModule.prototype.createLeftToolbarControls = function () {
|
|
19296
19245
|
var parent = this.parent;
|
|
19297
19246
|
if (this.defToolbarItems !== undefined && this.defToolbarItems.length > 0 &&
|
|
19298
|
-
(
|
|
19247
|
+
(document.getElementById(parent.element.id + '_toolbar'))) {
|
|
19299
19248
|
var uploadDiv = document.getElementById(parent.element.id + '_toolbar')
|
|
19300
19249
|
.querySelector('.e-image-upload');
|
|
19301
19250
|
if (uploadDiv) {
|
|
@@ -19317,25 +19266,25 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19317
19266
|
var _this = this;
|
|
19318
19267
|
var parent = this.parent;
|
|
19319
19268
|
var items = [];
|
|
19320
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19269
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Pen') > -1)) {
|
|
19321
19270
|
items.push({ text: this.l10n.getConstant('Pen'), id: 'pen', iconCss: 'e-icons e-free-pen' });
|
|
19322
19271
|
}
|
|
19323
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19272
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Line') > -1)) {
|
|
19324
19273
|
items.push({ text: this.l10n.getConstant('Line'), id: 'line', iconCss: 'e-icons e-line' });
|
|
19325
19274
|
}
|
|
19326
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19275
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Rectangle') > -1)) {
|
|
19327
19276
|
items.push({ text: this.l10n.getConstant('Rectangle'), id: 'rectangle', iconCss: 'e-icons e-rectangle' });
|
|
19328
19277
|
}
|
|
19329
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19278
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Ellipse') > -1)) {
|
|
19330
19279
|
items.push({ text: this.l10n.getConstant('Ellipse'), id: 'ellipse', iconCss: 'e-icons e-circle' });
|
|
19331
19280
|
}
|
|
19332
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19281
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Arrow') > -1)) {
|
|
19333
19282
|
items.push({ text: this.l10n.getConstant('Arrow'), id: 'arrow', iconCss: 'e-icons e-arrow-right-up' });
|
|
19334
19283
|
}
|
|
19335
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19284
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Path') > -1)) {
|
|
19336
19285
|
items.push({ text: this.l10n.getConstant('Path'), id: 'path', iconCss: 'e-icons e-critical-path' });
|
|
19337
19286
|
}
|
|
19338
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19287
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Text') > -1)) {
|
|
19339
19288
|
items.push({ text: this.l10n.getConstant('Text'), id: 'text', iconCss: 'e-icons e-add-text' });
|
|
19340
19289
|
}
|
|
19341
19290
|
var obj = { freehandDrawSelectedId: null };
|
|
@@ -19344,7 +19293,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19344
19293
|
var removeElement = document.querySelector('#' + parent.element.id + '_remove');
|
|
19345
19294
|
var editTextElement = document.querySelector('#' + parent.element.id + '_editText');
|
|
19346
19295
|
if ((parent.activeObj.activePoint.width === 0 && parent.activeObj.activePoint.height === 0) &&
|
|
19347
|
-
(isNullOrUndefined(parent.activeObj.pointColl) || (
|
|
19296
|
+
(isNullOrUndefined(parent.activeObj.pointColl) || (parent.activeObj.pointColl
|
|
19348
19297
|
&& parent.activeObj.pointColl.length === 0)) &&
|
|
19349
19298
|
isNullOrUndefined(obj['freehandDrawSelectedId'])) {
|
|
19350
19299
|
if (duplicateElement) {
|
|
@@ -19376,10 +19325,10 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19376
19325
|
args.element.parentElement.style.top = drpDownBtn.element.getBoundingClientRect().top -
|
|
19377
19326
|
args.element.parentElement.offsetHeight + 'px';
|
|
19378
19327
|
}
|
|
19379
|
-
if (
|
|
19380
|
-
document.getElementById(
|
|
19328
|
+
if (parent.activeObj.shape) {
|
|
19329
|
+
document.getElementById(parent.activeObj.shape).classList.add('e-selected');
|
|
19381
19330
|
}
|
|
19382
|
-
else if (
|
|
19331
|
+
else if (parent.togglePen) {
|
|
19383
19332
|
document.getElementById('pen').classList.add('e-selected');
|
|
19384
19333
|
}
|
|
19385
19334
|
},
|
|
@@ -19434,22 +19383,22 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19434
19383
|
}
|
|
19435
19384
|
});
|
|
19436
19385
|
// Render initialized DropDownButton.
|
|
19437
|
-
drpDownBtn.appendTo('#' +
|
|
19386
|
+
drpDownBtn.appendTo('#' + parent.element.id + '_annotationBtn');
|
|
19438
19387
|
};
|
|
19439
19388
|
ToolbarModule.prototype.renderCropBtn = function () {
|
|
19440
19389
|
var _this = this;
|
|
19441
19390
|
var parent = this.parent;
|
|
19442
19391
|
var items = [];
|
|
19443
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19392
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('CustomSelection') > -1)) {
|
|
19444
19393
|
items.push({ text: this.l10n.getConstant('Custom'), id: 'custom', iconCss: 'e-icons e-custom' });
|
|
19445
19394
|
}
|
|
19446
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19395
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('CircleSelection') > -1)) {
|
|
19447
19396
|
items.push({ text: this.l10n.getConstant('Circle'), id: 'circle', iconCss: 'e-icons e-circle' });
|
|
19448
19397
|
}
|
|
19449
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19398
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('SquareSelection') > -1)) {
|
|
19450
19399
|
items.push({ text: this.l10n.getConstant('Square'), id: 'square', iconCss: 'e-icons e-square' });
|
|
19451
19400
|
}
|
|
19452
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19401
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('RatioSelection') > -1)) {
|
|
19453
19402
|
items.push({ text: '3:2', id: '3:2', iconCss: 'e-icons e-custom-a' });
|
|
19454
19403
|
items.push({ text: '4:3', id: '4:3', iconCss: 'e-icons e-custom-b' });
|
|
19455
19404
|
items.push({ text: '5:4', id: '5:4', iconCss: 'e-icons e-custom-c' });
|
|
@@ -19458,11 +19407,11 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19458
19407
|
}
|
|
19459
19408
|
var iconCss;
|
|
19460
19409
|
var shape;
|
|
19461
|
-
if (
|
|
19410
|
+
if (parent.activeObj.shape) {
|
|
19462
19411
|
iconCss = this.getCurrentShapeIcon(parent.activeObj.shape);
|
|
19463
19412
|
shape = parent.activeObj.shape;
|
|
19464
19413
|
}
|
|
19465
|
-
else if (
|
|
19414
|
+
else if (parent.currSelectionPoint) {
|
|
19466
19415
|
iconCss = this.getCurrentShapeIcon(parent.currSelectionPoint.shape);
|
|
19467
19416
|
shape = parent.currSelectionPoint.shape;
|
|
19468
19417
|
}
|
|
@@ -19479,8 +19428,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19479
19428
|
args.element.parentElement.style.top = drpDownBtn.element.getBoundingClientRect().top -
|
|
19480
19429
|
args.element.parentElement.offsetHeight + 'px';
|
|
19481
19430
|
}
|
|
19482
|
-
if (
|
|
19483
|
-
document.getElementById(
|
|
19431
|
+
if (parent.activeObj.shape && parent.activeObj.shape.split('-').length > 1) {
|
|
19432
|
+
document.getElementById(parent.activeObj.shape.split('-')[1]).classList.add('e-selected');
|
|
19484
19433
|
}
|
|
19485
19434
|
parent.notify('transform', { prop: 'disableZoomOutBtn', value: { isZoomOut: true } });
|
|
19486
19435
|
},
|
|
@@ -19493,21 +19442,21 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19493
19442
|
iconCss: 'e-icons ' + iconCss, cssClass: 'e-image-popup',
|
|
19494
19443
|
content: parent.toPascalCase(shape.replace('crop-', ''))
|
|
19495
19444
|
});
|
|
19496
|
-
drpDownBtn.appendTo('#' +
|
|
19445
|
+
drpDownBtn.appendTo('#' + parent.element.id + '_cropBtn');
|
|
19497
19446
|
};
|
|
19498
19447
|
ToolbarModule.prototype.renderTransformBtn = function () {
|
|
19499
19448
|
var parent = this.parent;
|
|
19500
19449
|
var items = [];
|
|
19501
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19450
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('RotateLeft') > -1)) {
|
|
19502
19451
|
items.push({ text: this.l10n.getConstant('RotateLeft'), id: 'rotateleft', iconCss: 'e-icons e-anti-clock-wise' });
|
|
19503
19452
|
}
|
|
19504
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19453
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('RotateRight') > -1)) {
|
|
19505
19454
|
items.push({ text: this.l10n.getConstant('RotateRight'), id: 'rotateright', iconCss: 'e-icons e-clock-wise' });
|
|
19506
19455
|
}
|
|
19507
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19456
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('FlipHorizontal') > -1)) {
|
|
19508
19457
|
items.push({ text: this.l10n.getConstant('HorizontalFlip'), id: 'horizontalflip', iconCss: 'e-icons e-horizontal-flip' });
|
|
19509
19458
|
}
|
|
19510
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19459
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('FlipVertical') > -1)) {
|
|
19511
19460
|
items.push({ text: this.l10n.getConstant('VerticalFlip'), id: 'verticalflip', iconCss: 'e-icons e-vertical-flip' });
|
|
19512
19461
|
}
|
|
19513
19462
|
var drpDownBtn = new DropDownButton({
|
|
@@ -19520,27 +19469,27 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19520
19469
|
args.element.parentElement.style.display = 'block';
|
|
19521
19470
|
}
|
|
19522
19471
|
},
|
|
19523
|
-
items: items, select:
|
|
19472
|
+
items: items, select: parent.transformSelect.bind(this),
|
|
19524
19473
|
iconCss: 'e-icons e-transform', cssClass: 'e-image-popup'
|
|
19525
19474
|
});
|
|
19526
19475
|
drpDownBtn.appendTo('#' + parent.element.id + '_transformBtn');
|
|
19527
19476
|
};
|
|
19528
19477
|
ToolbarModule.prototype.renderSaveBtn = function () {
|
|
19529
|
-
var
|
|
19478
|
+
var parent = this.parent;
|
|
19530
19479
|
var saveItems = [
|
|
19531
19480
|
{ text: 'JPEG', id: 'jpeg' },
|
|
19532
19481
|
{ text: 'PNG', id: 'png' },
|
|
19533
19482
|
{ text: 'SVG', id: 'svg' }
|
|
19534
19483
|
];
|
|
19535
|
-
var ddbElem = document.getElementById(
|
|
19484
|
+
var ddbElem = document.getElementById(parent.element.id + '_saveBtn');
|
|
19536
19485
|
if (ddbElem) {
|
|
19537
19486
|
// Initialize the DropDownButton component.
|
|
19538
19487
|
var saveDrpDownBtn = new DropDownButton({ items: saveItems, cssClass: 'e-caret-hide e-image-popup', iconCss: 'e-icons e-save',
|
|
19539
19488
|
select: function (args) {
|
|
19540
|
-
|
|
19489
|
+
parent.export(args.item.text);
|
|
19541
19490
|
}
|
|
19542
19491
|
});
|
|
19543
|
-
saveDrpDownBtn.appendTo('#' +
|
|
19492
|
+
saveDrpDownBtn.appendTo('#' + parent.element.id + '_saveBtn');
|
|
19544
19493
|
}
|
|
19545
19494
|
};
|
|
19546
19495
|
ToolbarModule.prototype.getCropTransformToolbarItem = function () {
|
|
@@ -19550,19 +19499,19 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19550
19499
|
template: '<button id="' + parent.element.id + '_cropBtn"></button>'
|
|
19551
19500
|
});
|
|
19552
19501
|
toolbarItems.push({ align: 'Center', type: 'Separator' });
|
|
19553
|
-
toolbarItems.push({ id:
|
|
19502
|
+
toolbarItems.push({ id: parent.element.id + '_rotateLeft', prefixIcon: 'e-icons e-anti-clock-wise',
|
|
19554
19503
|
tooltipText: this.l10n.getConstant('RotateLeft'), align: 'Center' });
|
|
19555
|
-
toolbarItems.push({ id:
|
|
19504
|
+
toolbarItems.push({ id: parent.element.id + '_rotateRight', prefixIcon: 'e-icons e-clock-wise',
|
|
19556
19505
|
tooltipText: this.l10n.getConstant('RotateRight'), align: 'Center' });
|
|
19557
19506
|
toolbarItems.push({ align: 'Center', type: 'Separator' });
|
|
19558
|
-
toolbarItems.push({ id:
|
|
19507
|
+
toolbarItems.push({ id: parent.element.id + '_horizontalFlip', prefixIcon: 'e-icons e-horizontal-flip',
|
|
19559
19508
|
tooltipText: this.l10n.getConstant('HorizontalFlip'), align: 'Center' });
|
|
19560
|
-
toolbarItems.push({ id:
|
|
19509
|
+
toolbarItems.push({ id: parent.element.id + '_verticalFlip', prefixIcon: 'e-icons e-vertical-flip',
|
|
19561
19510
|
tooltipText: this.l10n.getConstant('VerticalFlip'), align: 'Center' });
|
|
19562
19511
|
if (!Browser.isDevice) {
|
|
19563
|
-
toolbarItems.push({ id:
|
|
19512
|
+
toolbarItems.push({ id: parent.element.id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
19564
19513
|
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
19565
|
-
toolbarItems.push({ id:
|
|
19514
|
+
toolbarItems.push({ id: parent.element.id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
19566
19515
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
19567
19516
|
}
|
|
19568
19517
|
return toolbarItems;
|
|
@@ -19570,31 +19519,31 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19570
19519
|
ToolbarModule.prototype.getShapesToolbarItem = function (items) {
|
|
19571
19520
|
var parent = this.parent;
|
|
19572
19521
|
var toolbarItems = [];
|
|
19573
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19522
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar)) {
|
|
19574
19523
|
toolbarItems.push({ id: parent.element.id + '_annotation', tooltipText: this.l10n.getConstant('Annotation'), align: 'Center',
|
|
19575
|
-
template: '<button id="' +
|
|
19524
|
+
template: '<button id="' + parent.element.id + '_annotationBtn"></button>' });
|
|
19576
19525
|
}
|
|
19577
19526
|
if (items.indexOf('fillColor') > -1) {
|
|
19578
|
-
toolbarItems.push({ prefixIcon: 'e-icons e-copy', id:
|
|
19527
|
+
toolbarItems.push({ prefixIcon: 'e-icons e-copy', id: parent.element.id + '_fillcolor',
|
|
19579
19528
|
cssClass: 'top-icon e-fill', tooltipText: this.l10n.getConstant('FillColor'), align: 'Center', type: 'Input',
|
|
19580
|
-
template: '<button id="' +
|
|
19529
|
+
template: '<button id="' + parent.element.id + '_fillColorBtn"></button>' });
|
|
19581
19530
|
}
|
|
19582
19531
|
if (items.indexOf('strokeColor') > -1) {
|
|
19583
|
-
toolbarItems.push({ prefixIcon: 'e-icons e-copy', id:
|
|
19532
|
+
toolbarItems.push({ prefixIcon: 'e-icons e-copy', id: parent.element.id + '_strokecolor',
|
|
19584
19533
|
cssClass: 'top-icon e-stroke', tooltipText: this.l10n.getConstant('StrokeColor'), align: 'Center', type: 'Input',
|
|
19585
|
-
template: '<button id="' +
|
|
19534
|
+
template: '<button id="' + parent.element.id + '_borderColorBtn"></button>' });
|
|
19586
19535
|
}
|
|
19587
19536
|
if (items.indexOf('strokeWidth') > -1) {
|
|
19588
|
-
toolbarItems.push({ id:
|
|
19589
|
-
type: 'Input', template: '<button id="' +
|
|
19537
|
+
toolbarItems.push({ id: parent.element.id + '_strokeWidth', cssClass: 'top-icon e-size', tooltipText: 'Stroke Width', align: 'Center',
|
|
19538
|
+
type: 'Input', template: '<button id="' + parent.element.id + '_borderWidthBtn"></button>' });
|
|
19590
19539
|
}
|
|
19591
19540
|
if (items.indexOf('start') > -1) {
|
|
19592
|
-
toolbarItems.push({ id:
|
|
19593
|
-
type: 'Input', template: '<button id="' +
|
|
19541
|
+
toolbarItems.push({ id: parent.element.id + '_start', cssClass: 'top-icon e-size', tooltipText: 'Start', align: 'Center',
|
|
19542
|
+
type: 'Input', template: '<button id="' + parent.element.id + '_startBtn"></button>' });
|
|
19594
19543
|
}
|
|
19595
19544
|
if (items.indexOf('end') > -1) {
|
|
19596
|
-
toolbarItems.push({ id:
|
|
19597
|
-
type: 'Input', template: '<button id="' +
|
|
19545
|
+
toolbarItems.push({ id: parent.element.id + '_end', cssClass: 'top-icon e-size', tooltipText: 'End', align: 'Center',
|
|
19546
|
+
type: 'Input', template: '<button id="' + parent.element.id + '_endBtn"></button>' });
|
|
19598
19547
|
}
|
|
19599
19548
|
toolbarItems.push({ align: 'Center', type: 'Separator' });
|
|
19600
19549
|
if (items.indexOf('duplicate') > -1) {
|
|
@@ -19617,9 +19566,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19617
19566
|
var obj = { shape: null };
|
|
19618
19567
|
parent.notify('selection', { prop: 'getCurrentDrawingShape', value: { obj: obj } });
|
|
19619
19568
|
if (obj['shape'] !== 'path') {
|
|
19620
|
-
toolbarItems.push({ id:
|
|
19569
|
+
toolbarItems.push({ id: parent.element.id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
19621
19570
|
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
19622
|
-
toolbarItems.push({ id:
|
|
19571
|
+
toolbarItems.push({ id: parent.element.id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
19623
19572
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
19624
19573
|
}
|
|
19625
19574
|
}
|
|
@@ -19627,6 +19576,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19627
19576
|
};
|
|
19628
19577
|
ToolbarModule.prototype.initCropTransformToolbar = function () {
|
|
19629
19578
|
var _this = this;
|
|
19579
|
+
var parent = this.parent;
|
|
19630
19580
|
var leftItem = this.getLeftToolbarItem();
|
|
19631
19581
|
var rightItem = this.getRightToolbarItem();
|
|
19632
19582
|
var mainItem = this.getCropTransformToolbarItem();
|
|
@@ -19647,9 +19597,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19647
19597
|
if (!Browser.isDevice) {
|
|
19648
19598
|
_this.renderSaveBtn();
|
|
19649
19599
|
}
|
|
19650
|
-
|
|
19600
|
+
parent.trigger('toolbarCreated', { toolbarType: 'shapes' });
|
|
19651
19601
|
if (Browser.isDevice) {
|
|
19652
|
-
if (_this.defToolbarItems.length > 0 &&
|
|
19602
|
+
if (_this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_bottomToolbar')) {
|
|
19653
19603
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
19654
19604
|
toolbar.refreshOverflow();
|
|
19655
19605
|
toolbar.refreshOverflow();
|
|
@@ -19658,22 +19608,22 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19658
19608
|
}
|
|
19659
19609
|
else {
|
|
19660
19610
|
_this.createLeftToolbarControls();
|
|
19661
|
-
if (_this.defToolbarItems.length > 0 &&
|
|
19611
|
+
if (_this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_toolbar')) {
|
|
19662
19612
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
19663
19613
|
toolbar.refreshOverflow();
|
|
19664
19614
|
}
|
|
19665
19615
|
}
|
|
19666
|
-
|
|
19616
|
+
parent.select('custom');
|
|
19667
19617
|
}
|
|
19668
19618
|
});
|
|
19669
19619
|
if (Browser.isDevice) {
|
|
19670
|
-
toolbar.appendTo('#' +
|
|
19620
|
+
toolbar.appendTo('#' + parent.element.id + '_bottomToolbar');
|
|
19671
19621
|
}
|
|
19672
19622
|
else {
|
|
19673
|
-
toolbar.appendTo('#' +
|
|
19623
|
+
toolbar.appendTo('#' + parent.element.id + '_toolbar');
|
|
19674
19624
|
}
|
|
19675
19625
|
this.enableDisableTbrBtn();
|
|
19676
|
-
|
|
19626
|
+
parent.notify('transform', { prop: 'disableZoomOutBtn', value: { isZoomOut: true } });
|
|
19677
19627
|
};
|
|
19678
19628
|
ToolbarModule.prototype.getCurrentShapeIcon = function (shape) {
|
|
19679
19629
|
var icon = '';
|
|
@@ -19684,9 +19634,6 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19684
19634
|
case 'ellipse':
|
|
19685
19635
|
icon = 'e-circle';
|
|
19686
19636
|
break;
|
|
19687
|
-
case 'triangle':
|
|
19688
|
-
icon = 'e-triangle';
|
|
19689
|
-
break;
|
|
19690
19637
|
case 'line':
|
|
19691
19638
|
icon = 'e-line';
|
|
19692
19639
|
break;
|
|
@@ -19734,6 +19681,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19734
19681
|
};
|
|
19735
19682
|
ToolbarModule.prototype.initShapesToolbarItem = function (items) {
|
|
19736
19683
|
var _this = this;
|
|
19684
|
+
var parent = this.parent;
|
|
19737
19685
|
var leftItem = this.getLeftToolbarItem();
|
|
19738
19686
|
var rightItem = this.getRightToolbarItem();
|
|
19739
19687
|
var mainItem = this.getShapesToolbarItem(items);
|
|
@@ -19752,7 +19700,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19752
19700
|
_this.renderAnnotationBtn(true);
|
|
19753
19701
|
_this.createShapeColor(items);
|
|
19754
19702
|
_this.createShapeBtn(items);
|
|
19755
|
-
if (
|
|
19703
|
+
if (parent.activeObj.shape === 'arrow') {
|
|
19756
19704
|
_this.createStartBtn();
|
|
19757
19705
|
_this.createEndBtn();
|
|
19758
19706
|
}
|
|
@@ -19760,9 +19708,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19760
19708
|
if (!Browser.isDevice) {
|
|
19761
19709
|
_this.renderSaveBtn();
|
|
19762
19710
|
}
|
|
19763
|
-
|
|
19711
|
+
parent.trigger('toolbarCreated', { toolbarType: 'shapes' });
|
|
19764
19712
|
if (Browser.isDevice) {
|
|
19765
|
-
if (_this.defToolbarItems.length > 0 &&
|
|
19713
|
+
if (_this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_bottomToolbar')) {
|
|
19766
19714
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
19767
19715
|
toolbar.refreshOverflow();
|
|
19768
19716
|
toolbar.refreshOverflow();
|
|
@@ -19771,7 +19719,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19771
19719
|
}
|
|
19772
19720
|
else {
|
|
19773
19721
|
_this.createLeftToolbarControls();
|
|
19774
|
-
if (_this.defToolbarItems.length > 0 &&
|
|
19722
|
+
if (_this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_toolbar')) {
|
|
19775
19723
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
19776
19724
|
toolbar.refreshOverflow();
|
|
19777
19725
|
}
|
|
@@ -19779,15 +19727,14 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19779
19727
|
}
|
|
19780
19728
|
});
|
|
19781
19729
|
if (Browser.isDevice) {
|
|
19782
|
-
toolbar.appendTo('#' +
|
|
19730
|
+
toolbar.appendTo('#' + parent.element.id + '_bottomToolbar');
|
|
19783
19731
|
}
|
|
19784
19732
|
else {
|
|
19785
|
-
toolbar.appendTo('#' +
|
|
19733
|
+
toolbar.appendTo('#' + parent.element.id + '_toolbar');
|
|
19786
19734
|
}
|
|
19787
19735
|
this.enableDisableTbrBtn();
|
|
19788
19736
|
};
|
|
19789
19737
|
ToolbarModule.prototype.createShapeColor = function (items) {
|
|
19790
|
-
var _this = this;
|
|
19791
19738
|
var parent = this.parent;
|
|
19792
19739
|
if (items.indexOf('fillColor') > -1) {
|
|
19793
19740
|
parent.element.querySelector('.e-template.e-fill').appendChild(parent.createElement('input', {
|
|
@@ -19797,7 +19744,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19797
19744
|
modeSwitcher: false, noColor: true, value: '',
|
|
19798
19745
|
showButtons: false, mode: 'Palette', cssClass: 'e-shape-fill-color',
|
|
19799
19746
|
change: function (args) {
|
|
19800
|
-
|
|
19747
|
+
parent.updateFillColor(args.currentValue.hex);
|
|
19801
19748
|
if (args.currentValue.rgba === '') {
|
|
19802
19749
|
fillDDB_1.element.children[0].classList.add('e-nocolor-item');
|
|
19803
19750
|
}
|
|
@@ -19818,7 +19765,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19818
19765
|
},
|
|
19819
19766
|
target: '.e-shape-fill-color',
|
|
19820
19767
|
iconCss: 'e-dropdownbtn-preview'
|
|
19821
|
-
}, '#' +
|
|
19768
|
+
}, '#' + parent.element.id + '_fillColorBtn');
|
|
19822
19769
|
fillColor.inline = true;
|
|
19823
19770
|
parent.element.querySelector('.e-fill.e-template .e-dropdownbtn-preview').classList.add('e-nocolor-item');
|
|
19824
19771
|
}
|
|
@@ -19830,7 +19777,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19830
19777
|
modeSwitcher: false, noColor: false, value: '#fff',
|
|
19831
19778
|
showButtons: false, mode: 'Palette', cssClass: 'e-shape-stroke-color',
|
|
19832
19779
|
change: function (args) {
|
|
19833
|
-
|
|
19780
|
+
parent.updateStrokeColor(args.currentValue.hex);
|
|
19834
19781
|
strokeDDB_1.element.children[0].style.backgroundColor = args.currentValue.rgba;
|
|
19835
19782
|
strokeDDB_1.toggle();
|
|
19836
19783
|
}
|
|
@@ -19840,7 +19787,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19840
19787
|
if (Browser.isDevice) {
|
|
19841
19788
|
args.element.parentElement.style.top = strokeDDB_1.element.getBoundingClientRect().top -
|
|
19842
19789
|
args.element.parentElement.offsetHeight + 'px';
|
|
19843
|
-
args.element.parentElement.style.left =
|
|
19790
|
+
args.element.parentElement.style.left = parent.element.offsetLeft + 'px';
|
|
19844
19791
|
}
|
|
19845
19792
|
},
|
|
19846
19793
|
target: '.e-shape-stroke-color',
|
|
@@ -19851,7 +19798,6 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19851
19798
|
}
|
|
19852
19799
|
};
|
|
19853
19800
|
ToolbarModule.prototype.createShapeBtn = function (items) {
|
|
19854
|
-
var _this = this;
|
|
19855
19801
|
var parent = this.parent;
|
|
19856
19802
|
var strokeWidthItems = [
|
|
19857
19803
|
{ id: '1', text: this.l10n.getConstant('XSmall') },
|
|
@@ -19880,18 +19826,18 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19880
19826
|
},
|
|
19881
19827
|
select: function (args) {
|
|
19882
19828
|
spanElem_1.textContent = args.item.text;
|
|
19883
|
-
|
|
19829
|
+
parent.updateStrokeWidth(args.item.id);
|
|
19884
19830
|
if (Browser.isDevice) {
|
|
19885
|
-
if (
|
|
19831
|
+
if (document.getElementById(parent.element.id + '_bottomToolbar')) {
|
|
19886
19832
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
19887
|
-
var toolbar_6 = getComponent(
|
|
19833
|
+
var toolbar_6 = getComponent(parent.element.id + '_bottomToolbar', 'toolbar');
|
|
19888
19834
|
toolbar_6.refreshOverflow();
|
|
19889
19835
|
}
|
|
19890
19836
|
}
|
|
19891
19837
|
else {
|
|
19892
|
-
if (
|
|
19838
|
+
if (document.getElementById(parent.element.id + '_toolbar')) {
|
|
19893
19839
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
19894
|
-
var toolbar_7 = getComponent(
|
|
19840
|
+
var toolbar_7 = getComponent(parent.element.id + '_toolbar', 'toolbar');
|
|
19895
19841
|
toolbar_7.refreshOverflow();
|
|
19896
19842
|
}
|
|
19897
19843
|
}
|
|
@@ -19915,10 +19861,10 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19915
19861
|
];
|
|
19916
19862
|
var strokeWidthBtn = document.getElementById(parent.element.id + '_startBtn');
|
|
19917
19863
|
var spanElem = document.createElement('span');
|
|
19918
|
-
if (isNullOrUndefined(
|
|
19919
|
-
|
|
19864
|
+
if (isNullOrUndefined(parent.activeObj.start)) {
|
|
19865
|
+
parent.activeObj.start = 'none';
|
|
19920
19866
|
}
|
|
19921
|
-
spanElem.innerHTML =
|
|
19867
|
+
spanElem.innerHTML = parent.pascalToSplitWords(parent.activeObj.start);
|
|
19922
19868
|
spanElem.className = 'e-shape-start';
|
|
19923
19869
|
strokeWidthBtn.appendChild(spanElem);
|
|
19924
19870
|
// Initialize the DropDownButton component.
|
|
@@ -19955,10 +19901,10 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19955
19901
|
];
|
|
19956
19902
|
var strokeEndBtn = document.getElementById(parent.element.id + '_endBtn');
|
|
19957
19903
|
var spanElem = document.createElement('span');
|
|
19958
|
-
if (isNullOrUndefined(
|
|
19959
|
-
|
|
19904
|
+
if (isNullOrUndefined(parent.activeObj.end)) {
|
|
19905
|
+
parent.activeObj.end = 'arrowSolid';
|
|
19960
19906
|
}
|
|
19961
|
-
spanElem.innerHTML =
|
|
19907
|
+
spanElem.innerHTML = parent.pascalToSplitWords(parent.activeObj.end);
|
|
19962
19908
|
spanElem.className = 'e-shape-end';
|
|
19963
19909
|
strokeEndBtn.appendChild(spanElem);
|
|
19964
19910
|
// Initialize the DropDownButton component.
|
|
@@ -19984,9 +19930,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19984
19930
|
ToolbarModule.prototype.getTextToolbarItem = function (items) {
|
|
19985
19931
|
var parent = this.parent;
|
|
19986
19932
|
var toolbarItems = [];
|
|
19987
|
-
if (isNullOrUndefined(parent.toolbar) || (
|
|
19933
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar)) {
|
|
19988
19934
|
toolbarItems.push({ id: parent.element.id + '_annotation', tooltipText: this.l10n.getConstant('Annotation'), align: 'Center',
|
|
19989
|
-
template: '<button id="' +
|
|
19935
|
+
template: '<button id="' + parent.element.id + '_annotationBtn"></button>' });
|
|
19990
19936
|
}
|
|
19991
19937
|
if (items.indexOf('fontFamily') > -1) {
|
|
19992
19938
|
toolbarItems.push({ id: parent.element.id + '_fontFamily', cssClass: 'top-icon e-img-font-family',
|
|
@@ -20071,7 +20017,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20071
20017
|
}
|
|
20072
20018
|
parent.trigger('toolbarCreated', { toolbarType: 'text' });
|
|
20073
20019
|
if (Browser.isDevice) {
|
|
20074
|
-
if (_this.defToolbarItems.length > 0 &&
|
|
20020
|
+
if (_this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_bottomToolbar')) {
|
|
20075
20021
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
20076
20022
|
toolbar.refreshOverflow();
|
|
20077
20023
|
toolbar.refreshOverflow();
|
|
@@ -20080,7 +20026,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20080
20026
|
}
|
|
20081
20027
|
else {
|
|
20082
20028
|
_this.createLeftToolbarControls();
|
|
20083
|
-
if (_this.defToolbarItems.length > 0 &&
|
|
20029
|
+
if (_this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_toolbar')) {
|
|
20084
20030
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
20085
20031
|
toolbar.refreshOverflow();
|
|
20086
20032
|
}
|
|
@@ -20096,9 +20042,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20096
20042
|
this.enableDisableTbrBtn();
|
|
20097
20043
|
};
|
|
20098
20044
|
ToolbarModule.prototype.createTextColor = function (items) {
|
|
20099
|
-
var _this = this;
|
|
20100
20045
|
var parent = this.parent;
|
|
20101
|
-
if (items.indexOf('fontColor') > -1 &&
|
|
20046
|
+
if (items.indexOf('fontColor') > -1 && parent.element.querySelector('.e-template.e-text-font-color')) {
|
|
20102
20047
|
parent.element.querySelector('.e-template.e-text-font-color').appendChild(parent.createElement('input', {
|
|
20103
20048
|
id: parent.element.id + '_text_font'
|
|
20104
20049
|
}));
|
|
@@ -20106,7 +20051,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20106
20051
|
modeSwitcher: false, value: '#fff',
|
|
20107
20052
|
showButtons: false, mode: 'Palette', cssClass: 'e-text-fontt-color',
|
|
20108
20053
|
change: function (args) {
|
|
20109
|
-
|
|
20054
|
+
parent.updateFontColor(args.currentValue.hex);
|
|
20110
20055
|
strokeDDB_2.element.children[0].style.backgroundColor = args.currentValue.rgba;
|
|
20111
20056
|
strokeDDB_2.toggle();
|
|
20112
20057
|
}
|
|
@@ -20140,7 +20085,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20140
20085
|
spanElem_2.innerHTML = 'Arial';
|
|
20141
20086
|
}
|
|
20142
20087
|
spanElem_2.className = 'e-text-font-family';
|
|
20143
|
-
if (
|
|
20088
|
+
if (fontNameBtn) {
|
|
20144
20089
|
fontNameBtn.appendChild(spanElem_2);
|
|
20145
20090
|
}
|
|
20146
20091
|
var fontFamilyBtn_1 = new DropDownButton({ items: this.getFontFamilyItems(),
|
|
@@ -20201,24 +20146,25 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20201
20146
|
}
|
|
20202
20147
|
};
|
|
20203
20148
|
ToolbarModule.prototype.refreshToolbar = function (type, isApplyBtn, isCropping, isZooming, cType) {
|
|
20204
|
-
|
|
20149
|
+
var parent = this.parent;
|
|
20150
|
+
if (!parent.isImageLoaded || parent.isCropToolbar) {
|
|
20205
20151
|
return;
|
|
20206
20152
|
}
|
|
20207
20153
|
var args = { toolbarType: type };
|
|
20208
20154
|
if (type !== 'filter' && type !== 'color') {
|
|
20209
|
-
if (document.getElementById(
|
|
20210
|
-
getComponent(document.getElementById(
|
|
20211
|
-
document.getElementById(
|
|
20155
|
+
if (document.getElementById(parent.element.id + '_toolbar') && this.defToolbarItems.length > 0) {
|
|
20156
|
+
getComponent(document.getElementById(parent.element.id + '_toolbar'), 'toolbar').destroy();
|
|
20157
|
+
document.getElementById(parent.element.id + '_toolbar').innerHTML = '';
|
|
20212
20158
|
}
|
|
20213
|
-
if (document.getElementById(
|
|
20214
|
-
if (document.getElementById(
|
|
20215
|
-
getComponent(document.getElementById(
|
|
20216
|
-
document.getElementById(
|
|
20159
|
+
if (document.getElementById(parent.element.id + '_bottomToolbar') && this.defToolbarItems.length > 0) {
|
|
20160
|
+
if (document.getElementById(parent.element.id + '_bottomToolbar').className.indexOf('e-control') > -1) {
|
|
20161
|
+
getComponent(document.getElementById(parent.element.id + '_bottomToolbar'), 'toolbar').destroy();
|
|
20162
|
+
document.getElementById(parent.element.id + '_bottomToolbar').innerHTML = '';
|
|
20217
20163
|
}
|
|
20218
20164
|
}
|
|
20219
20165
|
}
|
|
20220
20166
|
this.refreshSlider();
|
|
20221
|
-
|
|
20167
|
+
parent.isCropTab = false;
|
|
20222
20168
|
switch (type) {
|
|
20223
20169
|
case 'main':
|
|
20224
20170
|
if (Browser.isDevice) {
|
|
@@ -20245,16 +20191,16 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20245
20191
|
if (Browser.isDevice) {
|
|
20246
20192
|
this.initMainToolbar(false, true, true);
|
|
20247
20193
|
}
|
|
20248
|
-
if (
|
|
20194
|
+
if (parent.activeObj.shape === 'line' || parent.activeObj.shape === 'path') {
|
|
20249
20195
|
args.toolbarItems = ['strokeColor', 'strokeWidth', 'duplicate', 'remove'];
|
|
20250
20196
|
}
|
|
20251
|
-
else if (
|
|
20197
|
+
else if (parent.activeObj.shape === 'arrow') {
|
|
20252
20198
|
args.toolbarItems = ['strokeColor', 'strokeWidth', 'start', 'end', 'duplicate', 'remove'];
|
|
20253
20199
|
}
|
|
20254
20200
|
else {
|
|
20255
20201
|
args.toolbarItems = ['fillColor', 'strokeColor', 'strokeWidth', 'duplicate', 'remove'];
|
|
20256
20202
|
}
|
|
20257
|
-
|
|
20203
|
+
parent.trigger('toolbarUpdating', args);
|
|
20258
20204
|
this.initShapesToolbarItem(args.toolbarItems);
|
|
20259
20205
|
break;
|
|
20260
20206
|
case 'text':
|
|
@@ -20262,7 +20208,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20262
20208
|
this.initMainToolbar(false, true, true);
|
|
20263
20209
|
}
|
|
20264
20210
|
args.toolbarItems = ['fontFamily', 'fontSize', 'fontColor', 'bold', 'italic', 'duplicate', 'remove', 'text'];
|
|
20265
|
-
|
|
20211
|
+
parent.trigger('toolbarUpdating', args);
|
|
20266
20212
|
this.initTextToolbarItem(args.toolbarItems);
|
|
20267
20213
|
break;
|
|
20268
20214
|
case 'pen':
|
|
@@ -20270,7 +20216,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20270
20216
|
this.initMainToolbar(false, true, true);
|
|
20271
20217
|
}
|
|
20272
20218
|
args.toolbarItems = ['strokeColor', 'strokeWidth', 'remove'];
|
|
20273
|
-
|
|
20219
|
+
parent.trigger('toolbarUpdating', args);
|
|
20274
20220
|
this.initPenToolbarItem(args.toolbarItems);
|
|
20275
20221
|
break;
|
|
20276
20222
|
case 'adjustment':
|
|
@@ -20286,11 +20232,11 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20286
20232
|
this.updateContextualToolbar(type, cType);
|
|
20287
20233
|
break;
|
|
20288
20234
|
case 'croptransform':
|
|
20289
|
-
|
|
20235
|
+
parent.isCropTab = true;
|
|
20290
20236
|
if (Browser.isDevice) {
|
|
20291
20237
|
this.initMainToolbar(false, true, true);
|
|
20292
20238
|
}
|
|
20293
|
-
|
|
20239
|
+
parent.updateCropTransformItems();
|
|
20294
20240
|
this.initCropTransformToolbar();
|
|
20295
20241
|
break;
|
|
20296
20242
|
}
|
|
@@ -20299,32 +20245,33 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20299
20245
|
};
|
|
20300
20246
|
ToolbarModule.prototype.getAdjustmentToolbarItem = function () {
|
|
20301
20247
|
var toolbarItems = [];
|
|
20302
|
-
|
|
20303
|
-
|
|
20248
|
+
var parent = this.parent;
|
|
20249
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Brightness') > -1)) {
|
|
20250
|
+
toolbarItems.push({ id: parent.element.id + '_brightness', prefixIcon: 'e-icons e-brightness', cssClass: 'top-icon e-brightness',
|
|
20304
20251
|
tooltipText: this.l10n.getConstant('Brightness'), align: 'Center' });
|
|
20305
20252
|
}
|
|
20306
|
-
if (isNullOrUndefined(
|
|
20307
|
-
toolbarItems.push({ id:
|
|
20253
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Contrast') > -1)) {
|
|
20254
|
+
toolbarItems.push({ id: parent.element.id + '_contrast', prefixIcon: 'e-icons e-contrast', cssClass: 'top-icon e-contrast',
|
|
20308
20255
|
tooltipText: this.l10n.getConstant('Contrast'), align: 'Center' });
|
|
20309
20256
|
}
|
|
20310
|
-
if (isNullOrUndefined(
|
|
20311
|
-
toolbarItems.push({ id:
|
|
20257
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Hue') > -1)) {
|
|
20258
|
+
toolbarItems.push({ id: parent.element.id + '_hue', prefixIcon: 'e-icons e-fade', cssClass: 'top-icon e-fade',
|
|
20312
20259
|
tooltipText: this.l10n.getConstant('Hue'), align: 'Center' });
|
|
20313
20260
|
}
|
|
20314
|
-
if (isNullOrUndefined(
|
|
20315
|
-
toolbarItems.push({ id:
|
|
20261
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Saturation') > -1)) {
|
|
20262
|
+
toolbarItems.push({ id: parent.element.id + '_saturation', prefixIcon: 'e-icons e-saturation', cssClass: 'top-icon e-saturation',
|
|
20316
20263
|
tooltipText: this.l10n.getConstant('Saturation'), align: 'Center' });
|
|
20317
20264
|
}
|
|
20318
|
-
if (isNullOrUndefined(
|
|
20319
|
-
toolbarItems.push({ id:
|
|
20265
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Exposure') > -1)) {
|
|
20266
|
+
toolbarItems.push({ id: parent.element.id + '_exposure', prefixIcon: 'e-icons e-grain', cssClass: 'top-icon e-grain',
|
|
20320
20267
|
tooltipText: this.l10n.getConstant('Exposure'), align: 'Center' });
|
|
20321
20268
|
}
|
|
20322
|
-
if (isNullOrUndefined(
|
|
20323
|
-
toolbarItems.push({ id:
|
|
20269
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Opacity') > -1)) {
|
|
20270
|
+
toolbarItems.push({ id: parent.element.id + '_opacity', prefixIcon: 'e-icons e-opacity', cssClass: 'top-icon e-opacity',
|
|
20324
20271
|
tooltipText: this.l10n.getConstant('Opacity'), align: 'Center' });
|
|
20325
20272
|
}
|
|
20326
|
-
if (isNullOrUndefined(
|
|
20327
|
-
toolbarItems.push({ id:
|
|
20273
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Blur') > -1)) {
|
|
20274
|
+
toolbarItems.push({ id: parent.element.id + '_blur', prefixIcon: 'e-icons e-tint', cssClass: 'top-icon e-tint',
|
|
20328
20275
|
tooltipText: this.l10n.getConstant('Blur'), align: 'Center' });
|
|
20329
20276
|
}
|
|
20330
20277
|
var tempToolbarItems = this.processToolbar('center');
|
|
@@ -20332,49 +20279,50 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20332
20279
|
toolbarItems.push(tempToolbarItems[i]);
|
|
20333
20280
|
}
|
|
20334
20281
|
if (!Browser.isDevice) {
|
|
20335
|
-
toolbarItems.push({ id:
|
|
20282
|
+
toolbarItems.push({ id: parent.element.id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
20336
20283
|
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
20337
|
-
toolbarItems.push({ id:
|
|
20284
|
+
toolbarItems.push({ id: parent.element.id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
20338
20285
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
20339
20286
|
}
|
|
20340
20287
|
return toolbarItems;
|
|
20341
20288
|
};
|
|
20342
20289
|
ToolbarModule.prototype.getFilterToolbarItem = function () {
|
|
20343
20290
|
var toolbarItems = [];
|
|
20344
|
-
|
|
20345
|
-
|
|
20291
|
+
var parent = this.parent;
|
|
20292
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Default') > -1)) {
|
|
20293
|
+
toolbarItems.push({ id: parent.element.id + '_default', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20346
20294
|
tooltipText: this.l10n.getConstant('Default'), align: 'Center',
|
|
20347
|
-
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' +
|
|
20295
|
+
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_defaultCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Default') + '</span></div></div>' });
|
|
20348
20296
|
}
|
|
20349
|
-
if (isNullOrUndefined(
|
|
20350
|
-
toolbarItems.push({ id:
|
|
20297
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
|
|
20298
|
+
toolbarItems.push({ id: parent.element.id + '_chrome', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20351
20299
|
tooltipText: this.l10n.getConstant('Chrome'), align: 'Center',
|
|
20352
|
-
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' +
|
|
20300
|
+
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_chromeCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Chrome') + '</span></div></div>' });
|
|
20353
20301
|
}
|
|
20354
|
-
if (isNullOrUndefined(
|
|
20355
|
-
toolbarItems.push({ id:
|
|
20302
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Cold') > -1)) {
|
|
20303
|
+
toolbarItems.push({ id: parent.element.id + '_cold', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20356
20304
|
tooltipText: this.l10n.getConstant('Cold'), align: 'Center',
|
|
20357
|
-
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' +
|
|
20305
|
+
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_coldCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Cold') + '</span></div></div>' });
|
|
20358
20306
|
}
|
|
20359
|
-
if (isNullOrUndefined(
|
|
20360
|
-
toolbarItems.push({ id:
|
|
20307
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Warm') > -1)) {
|
|
20308
|
+
toolbarItems.push({ id: parent.element.id + '_warm', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20361
20309
|
tooltipText: this.l10n.getConstant('Warm'), align: 'Center',
|
|
20362
|
-
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' +
|
|
20310
|
+
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_warmCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Warm') + '</span></div></div>' });
|
|
20363
20311
|
}
|
|
20364
|
-
if (isNullOrUndefined(
|
|
20365
|
-
toolbarItems.push({ id:
|
|
20312
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Grayscale') > -1)) {
|
|
20313
|
+
toolbarItems.push({ id: parent.element.id + '_grayscale', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20366
20314
|
tooltipText: this.l10n.getConstant('Grayscale'), align: 'Center',
|
|
20367
|
-
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' +
|
|
20315
|
+
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_grayscaleCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Grayscale') + '</span></div></div>' });
|
|
20368
20316
|
}
|
|
20369
|
-
if (isNullOrUndefined(
|
|
20370
|
-
toolbarItems.push({ id:
|
|
20317
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Sepia') > -1)) {
|
|
20318
|
+
toolbarItems.push({ id: parent.element.id + '_sepia', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20371
20319
|
tooltipText: this.l10n.getConstant('Sepia'), align: 'Center',
|
|
20372
|
-
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' +
|
|
20320
|
+
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_sepiaCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Sepia') + '</span></div></div>' });
|
|
20373
20321
|
}
|
|
20374
|
-
if (isNullOrUndefined(
|
|
20375
|
-
toolbarItems.push({ id:
|
|
20322
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Invert') > -1)) {
|
|
20323
|
+
toolbarItems.push({ id: parent.element.id + '_invert', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20376
20324
|
tooltipText: this.l10n.getConstant('Invert'), align: 'Center',
|
|
20377
|
-
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' +
|
|
20325
|
+
template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_invertCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Invert') + '</span></div></div>' });
|
|
20378
20326
|
}
|
|
20379
20327
|
var tempToolbarItems = this.processToolbar('center');
|
|
20380
20328
|
for (var i = 0, len = tempToolbarItems.length; i < len; i++) {
|
|
@@ -20385,20 +20333,20 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20385
20333
|
ToolbarModule.prototype.getPenToolbarItem = function (items) {
|
|
20386
20334
|
var parent = this.parent;
|
|
20387
20335
|
var toolbarItems = [];
|
|
20388
|
-
if (isNullOrUndefined(parent.toolbar) ||
|
|
20336
|
+
if (isNullOrUndefined(parent.toolbar) || parent.toolbar) {
|
|
20389
20337
|
toolbarItems.push({ id: parent.element.id + '_annotation', tooltipText: this.l10n.getConstant('Annotation'), align: 'Center',
|
|
20390
|
-
template: '<button id="' +
|
|
20338
|
+
template: '<button id="' + parent.element.id + '_annotationBtn"></button>' });
|
|
20391
20339
|
}
|
|
20392
20340
|
if (items.indexOf('strokeColor') > -1) {
|
|
20393
|
-
toolbarItems.push({ prefixIcon: 'e-icons e-copy', id:
|
|
20341
|
+
toolbarItems.push({ prefixIcon: 'e-icons e-copy', id: parent.element.id + '_pen_strokecolor',
|
|
20394
20342
|
cssClass: 'top-icon e-pen-stroke-color',
|
|
20395
20343
|
tooltipText: this.l10n.getConstant('StrokeColor'), align: 'Center', type: 'Input',
|
|
20396
|
-
template: '<button id="' +
|
|
20344
|
+
template: '<button id="' + parent.element.id + '_penColorBtn"></button>' });
|
|
20397
20345
|
}
|
|
20398
20346
|
if (items.indexOf('strokeWidth') > -1) {
|
|
20399
20347
|
toolbarItems.push({ prefixIcon: 'e-icons e-copy', cssClass: 'top-icon e-size',
|
|
20400
20348
|
tooltipText: this.l10n.getConstant('StrokeWidth'),
|
|
20401
|
-
align: 'Center', type: 'Input', template: '<button id="' +
|
|
20349
|
+
align: 'Center', type: 'Input', template: '<button id="' + parent.element.id + '_penStrokeWidth"></button>' });
|
|
20402
20350
|
}
|
|
20403
20351
|
toolbarItems.push({ align: 'Center', type: 'Separator' });
|
|
20404
20352
|
if (items.indexOf('remove') > -1) {
|
|
@@ -20410,15 +20358,16 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20410
20358
|
toolbarItems.push(tempToolbarItems[i]);
|
|
20411
20359
|
}
|
|
20412
20360
|
if (!Browser.isDevice) {
|
|
20413
|
-
toolbarItems.push({ id:
|
|
20361
|
+
toolbarItems.push({ id: parent.element.id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
20414
20362
|
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
20415
|
-
toolbarItems.push({ id:
|
|
20363
|
+
toolbarItems.push({ id: parent.element.id + '_cancel', prefixIcon: 'e-icons e-close', cssClass: 'top-icon e-save',
|
|
20416
20364
|
tooltipText: this.l10n.getConstant('Cancel'), align: 'Right' });
|
|
20417
20365
|
}
|
|
20418
20366
|
return toolbarItems;
|
|
20419
20367
|
};
|
|
20420
20368
|
ToolbarModule.prototype.initPenToolbarItem = function (items) {
|
|
20421
20369
|
var _this = this;
|
|
20370
|
+
var parent = this.parent;
|
|
20422
20371
|
var leftItem = this.getLeftToolbarItem();
|
|
20423
20372
|
var rightItem = this.getRightToolbarItem();
|
|
20424
20373
|
var mainItem = this.getPenToolbarItem(items);
|
|
@@ -20441,9 +20390,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20441
20390
|
if (!Browser.isDevice) {
|
|
20442
20391
|
_this.renderSaveBtn();
|
|
20443
20392
|
}
|
|
20444
|
-
|
|
20393
|
+
parent.trigger('toolbarCreated', { toolbarType: 'pen' });
|
|
20445
20394
|
if (Browser.isDevice) {
|
|
20446
|
-
if (_this.defToolbarItems.length > 0 &&
|
|
20395
|
+
if (_this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_toolbar')) {
|
|
20447
20396
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
20448
20397
|
toolbar.refreshOverflow();
|
|
20449
20398
|
toolbar.refreshOverflow();
|
|
@@ -20451,7 +20400,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20451
20400
|
}
|
|
20452
20401
|
else {
|
|
20453
20402
|
_this.createLeftToolbarControls();
|
|
20454
|
-
if (_this.defToolbarItems.length > 0 &&
|
|
20403
|
+
if (_this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_toolbar')) {
|
|
20455
20404
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
20456
20405
|
toolbar.refreshOverflow();
|
|
20457
20406
|
}
|
|
@@ -20459,17 +20408,16 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20459
20408
|
}
|
|
20460
20409
|
});
|
|
20461
20410
|
if (Browser.isDevice) {
|
|
20462
|
-
toolbar.appendTo('#' +
|
|
20411
|
+
toolbar.appendTo('#' + parent.element.id + '_bottomToolbar');
|
|
20463
20412
|
}
|
|
20464
20413
|
else {
|
|
20465
|
-
toolbar.appendTo('#' +
|
|
20414
|
+
toolbar.appendTo('#' + parent.element.id + '_toolbar');
|
|
20466
20415
|
}
|
|
20467
20416
|
this.enableDisableTbrBtn();
|
|
20468
20417
|
};
|
|
20469
20418
|
ToolbarModule.prototype.createPenColor = function (items) {
|
|
20470
20419
|
var _this = this;
|
|
20471
20420
|
var parent = this.parent;
|
|
20472
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
20473
20421
|
if (items.indexOf('strokeColor') > -1) {
|
|
20474
20422
|
parent.element.querySelector('.e-template.e-pen-stroke-color').appendChild(parent.createElement('input', {
|
|
20475
20423
|
id: parent.element.id + '_pen_stroke'
|
|
@@ -20478,7 +20426,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20478
20426
|
modeSwitcher: false, value: '#fff',
|
|
20479
20427
|
showButtons: false, mode: 'Palette', cssClass: 'e-pen-color',
|
|
20480
20428
|
change: function (args) {
|
|
20481
|
-
|
|
20429
|
+
parent.updatePenStrokeColor(args.currentValue.hex);
|
|
20482
20430
|
_this.selFhdColor = args.currentValue.hex;
|
|
20483
20431
|
strokeDDB_3.element.children[0].style.backgroundColor = args.currentValue.rgba;
|
|
20484
20432
|
strokeDDB_3.toggle();
|
|
@@ -20501,7 +20449,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20501
20449
|
var indexObj = { freehandSelectedIndex: null };
|
|
20502
20450
|
parent.notify('freehand-draw', { prop: 'getFreehandSelectedIndex', onPropertyChange: false, value: { obj: indexObj } });
|
|
20503
20451
|
if (!isNullOrUndefined(indexObj['freehandSelectedIndex']) && indexObj['freehandSelectedIndex'] > -1) {
|
|
20504
|
-
|
|
20452
|
+
parent.element.querySelector('.e-pen-stroke-color.e-template .e-dropdownbtn-preview').style.background
|
|
20505
20453
|
= this.selFhdColor === '#42a5f5' ? obj['tempFreeHandDrawEditingStyles'].strokeColor :
|
|
20506
20454
|
parent.pointColl[indexObj['freehandSelectedIndex']].strokeColor;
|
|
20507
20455
|
}
|
|
@@ -20512,7 +20460,6 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20512
20460
|
}
|
|
20513
20461
|
};
|
|
20514
20462
|
ToolbarModule.prototype.createPenBtn = function (items) {
|
|
20515
|
-
var _this = this;
|
|
20516
20463
|
var parent = this.parent;
|
|
20517
20464
|
var strokeWidthItems = [
|
|
20518
20465
|
{ id: '1', text: this.l10n.getConstant('XSmall') },
|
|
@@ -20546,16 +20493,16 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20546
20493
|
},
|
|
20547
20494
|
select: function (args) {
|
|
20548
20495
|
spanElem_3.textContent = args.item.text;
|
|
20549
|
-
|
|
20496
|
+
parent.updatePenStrokeWidth(args.item.id);
|
|
20550
20497
|
if (Browser.isDevice) {
|
|
20551
|
-
if (
|
|
20498
|
+
if (document.getElementById(parent.element.id + '_bottomToolbar')) {
|
|
20552
20499
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
20553
20500
|
var toolbar_8 = getComponent(parent.element.id + '_bottomToolbar', 'toolbar');
|
|
20554
20501
|
toolbar_8.refreshOverflow();
|
|
20555
20502
|
}
|
|
20556
20503
|
}
|
|
20557
20504
|
else {
|
|
20558
|
-
if (
|
|
20505
|
+
if (document.getElementById(parent.element.id + '_toolbar')) {
|
|
20559
20506
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
20560
20507
|
var toolbar_9 = getComponent(parent.element.id + '_toolbar', 'toolbar');
|
|
20561
20508
|
toolbar_9.refreshOverflow();
|
|
@@ -20604,14 +20551,14 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20604
20551
|
_this.renderSaveBtn();
|
|
20605
20552
|
}
|
|
20606
20553
|
if (Browser.isDevice) {
|
|
20607
|
-
if (_this.defToolbarItems.length > 0 &&
|
|
20554
|
+
if (_this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_toolbar')) {
|
|
20608
20555
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
20609
20556
|
toolbar.refreshOverflow();
|
|
20610
20557
|
}
|
|
20611
20558
|
}
|
|
20612
20559
|
else {
|
|
20613
20560
|
_this.createLeftToolbarControls();
|
|
20614
|
-
if (_this.defToolbarItems.length > 0 &&
|
|
20561
|
+
if (_this.defToolbarItems.length > 0 && document.getElementById(parent.element.id + '_toolbar')) {
|
|
20615
20562
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
20616
20563
|
toolbar.refreshOverflow();
|
|
20617
20564
|
}
|
|
@@ -20630,8 +20577,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20630
20577
|
var _this = this;
|
|
20631
20578
|
var parent = this.parent;
|
|
20632
20579
|
var mainItem = this.getFilterToolbarItem();
|
|
20633
|
-
if (document.querySelector('#' +
|
|
20634
|
-
getComponent(document.getElementById(
|
|
20580
|
+
if (document.querySelector('#' + parent.element.id + '_contextualToolbar').classList.contains('e-control')) {
|
|
20581
|
+
getComponent(document.getElementById(parent.element.id + '_contextualToolbar'), 'toolbar').destroy();
|
|
20635
20582
|
}
|
|
20636
20583
|
var toolbar = new Toolbar({
|
|
20637
20584
|
width: '100%',
|
|
@@ -20641,7 +20588,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20641
20588
|
_this.updatePrivateVariables();
|
|
20642
20589
|
_this.createCanvasFilter();
|
|
20643
20590
|
if (parent.currentFilter === '') {
|
|
20644
|
-
parent.currentFilter =
|
|
20591
|
+
parent.currentFilter = parent.element.id + '_default';
|
|
20645
20592
|
}
|
|
20646
20593
|
var hdrWrapper = document.querySelector('#' + parent.element.id + '_headWrapper');
|
|
20647
20594
|
if (hdrWrapper) {
|
|
@@ -20652,10 +20599,12 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20652
20599
|
toolbar.refreshOverflow();
|
|
20653
20600
|
}
|
|
20654
20601
|
});
|
|
20655
|
-
toolbar.appendTo('#' +
|
|
20602
|
+
toolbar.appendTo('#' + parent.element.id + '_contextualToolbar');
|
|
20656
20603
|
};
|
|
20657
20604
|
ToolbarModule.prototype.createCanvasFilter = function () {
|
|
20658
20605
|
var parent = this.parent;
|
|
20606
|
+
showSpinner(parent.element);
|
|
20607
|
+
parent.element.style.opacity = '0.5';
|
|
20659
20608
|
var imageData = parent.getCurrentCanvasData();
|
|
20660
20609
|
this.inMemoryCanvas.width = imageData.width;
|
|
20661
20610
|
this.inMemoryCanvas.height = imageData.height;
|
|
@@ -20667,16 +20616,19 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20667
20616
|
this.updateFilterCanvas('_grayscaleCanvas', 'grayscale');
|
|
20668
20617
|
this.updateFilterCanvas('_sepiaCanvas', 'sepia');
|
|
20669
20618
|
this.updateFilterCanvas('_invertCanvas', 'invert');
|
|
20619
|
+
hideSpinner(parent.element);
|
|
20620
|
+
parent.element.style.opacity = '1';
|
|
20670
20621
|
parent.initialAdjustmentValue = this.lowerContext.filter;
|
|
20671
20622
|
};
|
|
20672
20623
|
ToolbarModule.prototype.updateFilterCanvas = function (selector, type) {
|
|
20673
|
-
var
|
|
20674
|
-
|
|
20624
|
+
var parent = this.parent;
|
|
20625
|
+
var filter = parent.element.querySelector('#' + parent.element.id + selector);
|
|
20626
|
+
if (filter) {
|
|
20675
20627
|
var ctx = filter.getContext('2d');
|
|
20676
20628
|
ctx = filter.getContext('2d');
|
|
20677
20629
|
filter.style.width = '100px';
|
|
20678
20630
|
filter.style.height = '100px';
|
|
20679
|
-
|
|
20631
|
+
parent.notify('filter', { prop: 'updateAdj', value: { type: type, value: null, isPreview: true, ctx: ctx } });
|
|
20680
20632
|
ctx.drawImage(this.inMemoryCanvas, 0, 0, 300, 150);
|
|
20681
20633
|
}
|
|
20682
20634
|
};
|
|
@@ -20726,47 +20678,51 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20726
20678
|
return orgToolbarItems;
|
|
20727
20679
|
};
|
|
20728
20680
|
ToolbarModule.prototype.renderQAT = function (isPenEdit) {
|
|
20729
|
-
|
|
20730
|
-
|
|
20731
|
-
|
|
20681
|
+
var parent = this.parent;
|
|
20682
|
+
if (parent.activeObj && parent.showQuickAccessToolbar) {
|
|
20683
|
+
var qtArea = document.getElementById(parent.element.id + '_quickAccessToolbarArea');
|
|
20684
|
+
if (qtArea) {
|
|
20732
20685
|
this.destroyQuickAccessToolbar();
|
|
20733
|
-
|
|
20686
|
+
qtArea.style.display = 'block';
|
|
20734
20687
|
}
|
|
20735
20688
|
var items = this.getQuickAccessToolbarItem(isPenEdit);
|
|
20736
20689
|
if (items.length === 0) {
|
|
20737
20690
|
return;
|
|
20738
20691
|
}
|
|
20739
|
-
if (isNullOrUndefined(
|
|
20692
|
+
if (isNullOrUndefined(parent.quickAccessToolbarTemplate)) {
|
|
20740
20693
|
var toolbarObj = new Toolbar({
|
|
20741
20694
|
items: items,
|
|
20742
20695
|
clicked: this.quickAccessToolbarClicked.bind(this)
|
|
20743
20696
|
});
|
|
20744
|
-
toolbarObj.appendTo('#' +
|
|
20697
|
+
toolbarObj.appendTo('#' + parent.element.id + '_quickAccessToolbar');
|
|
20745
20698
|
}
|
|
20746
20699
|
if (isNullOrUndefined(isPenEdit)) {
|
|
20747
20700
|
qtArea.style.width = 'auto';
|
|
20748
|
-
|
|
20749
|
-
|
|
20750
|
-
var x =
|
|
20751
|
-
|
|
20752
|
-
var y =
|
|
20753
|
-
|
|
20754
|
-
var width =
|
|
20755
|
-
if (
|
|
20756
|
-
var
|
|
20701
|
+
parent.activeObj.activePoint.width = Math.abs(parent.activeObj.activePoint.width);
|
|
20702
|
+
parent.activeObj.activePoint.height = Math.abs(parent.activeObj.activePoint.height);
|
|
20703
|
+
var x = parent.activeObj.activePoint.startX < parent.activeObj.activePoint.endX ?
|
|
20704
|
+
parent.activeObj.activePoint.startX : parent.activeObj.activePoint.endX;
|
|
20705
|
+
var y = parent.activeObj.activePoint.startY < parent.activeObj.activePoint.endY ?
|
|
20706
|
+
parent.activeObj.activePoint.startY : parent.activeObj.activePoint.endY;
|
|
20707
|
+
var width = parent.activeObj.activePoint.width;
|
|
20708
|
+
if (parent.activeObj.rotatedAngle !== 0 && parent.activeObj.shape !== 'arrow') {
|
|
20709
|
+
var object = { activePoint: null };
|
|
20710
|
+
parent.notify('shape', { prop: 'getSquarePointForRotatedShape', onPropertyChange: false,
|
|
20711
|
+
value: { obj: parent.activeObj, object: object } });
|
|
20712
|
+
var point = object['activePoint'];
|
|
20757
20713
|
x = point.startX;
|
|
20758
20714
|
y = point.startY;
|
|
20759
20715
|
width = point.width;
|
|
20760
20716
|
}
|
|
20761
|
-
else if (
|
|
20762
|
-
var path =
|
|
20717
|
+
else if (parent.activeObj.shape === 'path') {
|
|
20718
|
+
var path = parent.getSquarePointForPath(parent.activeObj);
|
|
20763
20719
|
x = path.startX;
|
|
20764
20720
|
y = path.startY;
|
|
20765
20721
|
width = path.width;
|
|
20766
20722
|
}
|
|
20767
20723
|
qtArea.style.left = (x + (width / 2)) - (items.length * 25) + 'px';
|
|
20768
|
-
if (y - 60 <
|
|
20769
|
-
qtArea.style.top =
|
|
20724
|
+
if (y - 60 < parent.img.destTop) {
|
|
20725
|
+
qtArea.style.top = parent.img.destTop + 'px';
|
|
20770
20726
|
}
|
|
20771
20727
|
else {
|
|
20772
20728
|
qtArea.style.top = y - 60 + 'px';
|
|
@@ -20775,14 +20731,14 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20775
20731
|
else if (isPenEdit) {
|
|
20776
20732
|
var obj = { activePoint: null };
|
|
20777
20733
|
var indexObj = { freehandSelectedIndex: null };
|
|
20778
|
-
|
|
20779
|
-
|
|
20734
|
+
parent.notify('freehand-draw', { prop: 'getFreehandSelectedIndex', onPropertyChange: false, value: { obj: indexObj } });
|
|
20735
|
+
parent.notify('freehand-draw', { prop: 'getSqPtFD',
|
|
20780
20736
|
value: { idx: indexObj['freehandSelectedIndex'], obj: obj } });
|
|
20781
20737
|
var point = obj['activePoint'];
|
|
20782
20738
|
qtArea.style.width = 'auto';
|
|
20783
20739
|
qtArea.style.left = (point.startX + (point.width / 2)) - (items.length * 27) + 'px';
|
|
20784
|
-
if (point.startY - 60 <
|
|
20785
|
-
qtArea.style.top =
|
|
20740
|
+
if (point.startY - 60 < parent.img.destTop) {
|
|
20741
|
+
qtArea.style.top = parent.img.destTop + 'px';
|
|
20786
20742
|
}
|
|
20787
20743
|
else {
|
|
20788
20744
|
qtArea.style.top = point.startY - 60 + 'px';
|
|
@@ -20794,8 +20750,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20794
20750
|
if (isNullOrUndefined(isDisabled)) {
|
|
20795
20751
|
return;
|
|
20796
20752
|
}
|
|
20797
|
-
var
|
|
20798
|
-
|
|
20753
|
+
var parent = this.parent;
|
|
20754
|
+
var annotation = document.querySelector('#' + parent.element.id + '_annotationBtn');
|
|
20755
|
+
if (annotation) {
|
|
20799
20756
|
if (isDisabled) {
|
|
20800
20757
|
annotation.classList.add('e-disabled');
|
|
20801
20758
|
annotation.parentElement.classList.add('e-overlay');
|
|
@@ -20806,8 +20763,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20806
20763
|
}
|
|
20807
20764
|
getComponent(annotation, 'dropdown-btn').disabled = isDisabled;
|
|
20808
20765
|
}
|
|
20809
|
-
var transform = document.querySelector('#' +
|
|
20810
|
-
if (
|
|
20766
|
+
var transform = document.querySelector('#' + parent.element.id + '_transformBtn');
|
|
20767
|
+
if (transform) {
|
|
20811
20768
|
if (isDisabled) {
|
|
20812
20769
|
transform.classList.add('e-disabled');
|
|
20813
20770
|
transform.parentElement.classList.add('e-overlay');
|
|
@@ -20818,8 +20775,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20818
20775
|
}
|
|
20819
20776
|
getComponent(transform, 'dropdown-btn').disabled = isDisabled;
|
|
20820
20777
|
}
|
|
20821
|
-
var adjustment = document.querySelector('#' +
|
|
20822
|
-
if (
|
|
20778
|
+
var adjustment = document.querySelector('#' + parent.element.id + '_adjustment');
|
|
20779
|
+
if (adjustment) {
|
|
20823
20780
|
if (isDisabled) {
|
|
20824
20781
|
adjustment.classList.add('e-disabled');
|
|
20825
20782
|
adjustment.parentElement.classList.add('e-overlay');
|
|
@@ -20830,8 +20787,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20830
20787
|
}
|
|
20831
20788
|
getComponent(adjustment, 'btn').disabled = isDisabled;
|
|
20832
20789
|
}
|
|
20833
|
-
var filter = document.querySelector('#' +
|
|
20834
|
-
if (
|
|
20790
|
+
var filter = document.querySelector('#' + parent.element.id + '_filter');
|
|
20791
|
+
if (filter) {
|
|
20835
20792
|
if (isDisabled) {
|
|
20836
20793
|
filter.classList.add('e-disabled');
|
|
20837
20794
|
filter.parentElement.classList.add('e-overlay');
|
|
@@ -20861,7 +20818,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20861
20818
|
ToolbarModule.prototype.quickAccessToolbarClicked = function (args, isContextualToolbar) {
|
|
20862
20819
|
var parent = this.parent;
|
|
20863
20820
|
var points = { x: parent.activeObj.activePoint.startX, y: parent.activeObj.activePoint.startY };
|
|
20864
|
-
if (
|
|
20821
|
+
if (args.item) {
|
|
20865
20822
|
var duplicateObj = void 0;
|
|
20866
20823
|
var objColl = void 0;
|
|
20867
20824
|
var isPreventUndoRedo = null;
|
|
@@ -20874,7 +20831,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20874
20831
|
parent.notify('draw', { prop: 'getNewPath', value: { obj: pathObject } });
|
|
20875
20832
|
switch (args.item.id.replace(parent.element.id + '_', '').toLowerCase()) {
|
|
20876
20833
|
case 'duplicate':
|
|
20877
|
-
if (!
|
|
20834
|
+
if (!parent.element.querySelector('#' + parent.element.id + '_duplicate').classList.contains('e-disabled')) {
|
|
20878
20835
|
if (!pathObject['isNewPath'] && JSON.stringify(object['tempObj']) === JSON.stringify(parent.activeObj)) {
|
|
20879
20836
|
isPreventUndoRedo = true;
|
|
20880
20837
|
}
|
|
@@ -20882,7 +20839,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20882
20839
|
if (isNullOrUndefined(parent.activeObj.currIndex)) {
|
|
20883
20840
|
parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: isPreventUndoRedo } });
|
|
20884
20841
|
}
|
|
20885
|
-
else if (
|
|
20842
|
+
else if (obj['prevActObj']) {
|
|
20886
20843
|
parent.activeObj.currIndex = null;
|
|
20887
20844
|
duplicateObj.currIndex = null;
|
|
20888
20845
|
parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: isPreventUndoRedo } });
|
|
@@ -20909,19 +20866,19 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20909
20866
|
parent.notify('shape', { prop: 'setPointCollForLineArrow', onPropertyChange: false,
|
|
20910
20867
|
value: { obj: parent.activeObj } });
|
|
20911
20868
|
}
|
|
20912
|
-
// parent.updateTrianglePoints(
|
|
20869
|
+
// parent.updateTrianglePoints(parent.activeObj); Invoke
|
|
20913
20870
|
parent.notify('draw', { prop: 'drawObject', onPropertyChange: false, value: { canvas: 'duplicate', obj: parent.activeObj } });
|
|
20914
20871
|
parent.notify('undo-redo', { prop: 'updateUrObj', onPropertyChange: false, value: { objColl: objColl } });
|
|
20915
20872
|
this.renderQAT();
|
|
20916
20873
|
}
|
|
20917
20874
|
break;
|
|
20918
20875
|
case 'remove':
|
|
20919
|
-
if (!
|
|
20876
|
+
if (!parent.element.querySelector('#' + parent.element.id + '_remove').classList.contains('e-disabled')) {
|
|
20920
20877
|
parent.notify('selection', { prop: 'deleteItem', onPropertyChange: false });
|
|
20921
20878
|
}
|
|
20922
20879
|
break;
|
|
20923
20880
|
case 'edittext':
|
|
20924
|
-
if (!
|
|
20881
|
+
if (!parent.element.querySelector('#' + parent.element.id + '_editText').classList.contains('e-disabled')) {
|
|
20925
20882
|
this.upperContext.clearRect(0, 0, parent.upperCanvas.width, parent.upperCanvas.height);
|
|
20926
20883
|
parent.notify('selection', { prop: 'setTempActObj', onPropertyChange: false,
|
|
20927
20884
|
value: { obj: extend({}, parent.activeObj, {}, true) } });
|
|
@@ -20938,10 +20895,10 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20938
20895
|
if (isNullOrUndefined(parent.activeObj.currIndex)) {
|
|
20939
20896
|
parent.notify('draw', { prop: 'setShapeTextInsert', onPropertyChange: false, value: { bool: true } });
|
|
20940
20897
|
}
|
|
20941
|
-
else if (
|
|
20898
|
+
else if (obj['prevActObj']) {
|
|
20942
20899
|
parent.notify('draw', { prop: 'setShapeTextInsert', onPropertyChange: false, value: { bool: true } });
|
|
20943
20900
|
}
|
|
20944
|
-
if (
|
|
20901
|
+
if (document.getElementById(parent.element.id + '_quickAccessToolbarArea')) {
|
|
20945
20902
|
document.getElementById(parent.element.id + '_quickAccessToolbarArea').style.display = 'none';
|
|
20946
20903
|
}
|
|
20947
20904
|
}
|
|
@@ -20962,7 +20919,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20962
20919
|
}
|
|
20963
20920
|
parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
20964
20921
|
}
|
|
20965
|
-
if (
|
|
20922
|
+
if (args.item) {
|
|
20966
20923
|
var type = args.item.id.replace(parent.element.id + '_', '').toLowerCase();
|
|
20967
20924
|
if (type === 'duplicate' || type === 'remove' || type === 'edittext') {
|
|
20968
20925
|
this.quickAccessToolbarClicked(args, true);
|
|
@@ -20972,11 +20929,11 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20972
20929
|
var isDisabledFilter = false;
|
|
20973
20930
|
var isDisabledAdjustment = false;
|
|
20974
20931
|
var adjustment = document.querySelector('#' + parent.element.id + '_adjustment');
|
|
20975
|
-
if (
|
|
20932
|
+
if (adjustment && adjustment.classList.contains('e-disabled')) {
|
|
20976
20933
|
isDisabledAdjustment = true;
|
|
20977
20934
|
}
|
|
20978
20935
|
var filter = document.querySelector('#' + parent.element.id + '_filter');
|
|
20979
|
-
if (
|
|
20936
|
+
if (filter && filter.classList.contains('e-disabled')) {
|
|
20980
20937
|
isDisabledFilter = true;
|
|
20981
20938
|
}
|
|
20982
20939
|
this.enableDisableTbrBtn();
|
|
@@ -21021,18 +20978,18 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21021
20978
|
}
|
|
21022
20979
|
}
|
|
21023
20980
|
else {
|
|
21024
|
-
panBtn =
|
|
21025
|
-
if (
|
|
20981
|
+
panBtn = parent.element.querySelector('.e-img-pan .e-btn');
|
|
20982
|
+
if (panBtn) {
|
|
21026
20983
|
panBtn.classList.add('e-selected-btn');
|
|
21027
20984
|
}
|
|
21028
20985
|
parent.pan(true);
|
|
21029
20986
|
parent.notify('transform', { prop: 'setDisablePan', onPropertyChange: false, value: { bool: false } });
|
|
21030
20987
|
}
|
|
21031
|
-
if (
|
|
20988
|
+
if (zoomIn && parent.zoomSettings.zoomFactor >= parent.zoomSettings.maxZoomFactor) {
|
|
21032
20989
|
zoomIn.classList.add('e-disabled');
|
|
21033
20990
|
zoomIn.parentElement.classList.add('e-overlay');
|
|
21034
20991
|
}
|
|
21035
|
-
else if (
|
|
20992
|
+
else if (zoomIn) {
|
|
21036
20993
|
zoomIn.classList.remove('e-disabled');
|
|
21037
20994
|
zoomIn.parentElement.classList.remove('e-overlay');
|
|
21038
20995
|
}
|
|
@@ -21047,19 +21004,6 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21047
21004
|
this.currentToolbar = 'main';
|
|
21048
21005
|
break;
|
|
21049
21006
|
case 'crop':
|
|
21050
|
-
if (!isNullOrUndefined(parent.currSelectionPoint)) {
|
|
21051
|
-
if (parent.currObjType.isUndoAction) {
|
|
21052
|
-
parent.notify('undo-redo', { prop: 'refreshUrc', value: { bool: null } });
|
|
21053
|
-
}
|
|
21054
|
-
if (!isNullOrUndefined(parent.cropObj.activeObj.shape)) {
|
|
21055
|
-
parent.select(parent.activeObj.shape);
|
|
21056
|
-
}
|
|
21057
|
-
this.refreshToolbar('main', true, true);
|
|
21058
|
-
getComponent(parent.element.querySelector('#' + this.parent.element.id + '_cropBtn'), 'dropdown-btn').toggle();
|
|
21059
|
-
if (!isNullOrUndefined(parent.activeObj.shape)) {
|
|
21060
|
-
document.getElementById(parent.activeObj.shape.split('-')[1]).classList.add('e-selected');
|
|
21061
|
-
}
|
|
21062
|
-
}
|
|
21063
21007
|
parent.notify('transform', { prop: 'disableZoomOutBtn', value: { isZoomOut: true } });
|
|
21064
21008
|
break;
|
|
21065
21009
|
case 'reset':
|
|
@@ -21173,7 +21117,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21173
21117
|
case 'rotateright':
|
|
21174
21118
|
case 'horizontalflip':
|
|
21175
21119
|
case 'verticalflip':
|
|
21176
|
-
|
|
21120
|
+
parent.transformSelect(type);
|
|
21177
21121
|
parent.notify('transform', { prop: 'disableZoomOutBtn', value: { isZoomOut: true } });
|
|
21178
21122
|
break;
|
|
21179
21123
|
case 'save':
|
|
@@ -21198,7 +21142,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21198
21142
|
}
|
|
21199
21143
|
var type = args.item.id.replace(parent.element.id, '').split('_')[1];
|
|
21200
21144
|
var imageFiltering = { filter: parent.toPascalCase(type), cancel: false };
|
|
21201
|
-
|
|
21145
|
+
parent.trigger('imageFiltering', imageFiltering);
|
|
21202
21146
|
if (imageFiltering.cancel) {
|
|
21203
21147
|
return;
|
|
21204
21148
|
}
|
|
@@ -21209,11 +21153,12 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21209
21153
|
this.enableDisableTbrBtn();
|
|
21210
21154
|
};
|
|
21211
21155
|
ToolbarModule.prototype.refreshShapeDrawing = function () {
|
|
21156
|
+
var parent = this.parent;
|
|
21212
21157
|
var object = { shape: '' };
|
|
21213
|
-
|
|
21158
|
+
parent.notify('selection', { prop: 'getCurrentDrawingShape', onPropertyChange: false, value: { obj: object } });
|
|
21214
21159
|
if (object['shape'] !== '') {
|
|
21215
|
-
|
|
21216
|
-
|
|
21160
|
+
parent.notify('selection', { prop: 'setCurrentDrawingShape', onPropertyChange: false, value: { value: '' } });
|
|
21161
|
+
parent.notify('shape', { prop: 'refreshActiveObj', onPropertyChange: false });
|
|
21217
21162
|
this.refreshToolbar('main', false);
|
|
21218
21163
|
}
|
|
21219
21164
|
};
|
|
@@ -21292,9 +21237,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21292
21237
|
ToolbarModule.prototype.closeContextualToolbar = function () {
|
|
21293
21238
|
var parent = this.parent;
|
|
21294
21239
|
var isContextualToolbar = false;
|
|
21295
|
-
if ((
|
|
21240
|
+
if ((parent.element.querySelector('#' + parent.element.id + '_contextualToolbar') &&
|
|
21296
21241
|
!parent.element.querySelector('#' + parent.element.id + '_contextualToolbar').parentElement.classList.contains('e-hide')) ||
|
|
21297
|
-
(
|
|
21242
|
+
(parent.element.querySelector('#' + parent.element.id + '_headWrapper')
|
|
21298
21243
|
&& !parent.element.querySelector('#' + parent.element.id + '_headWrapper').parentElement.classList.contains('e-hide'))) {
|
|
21299
21244
|
parent.element.querySelector('.e-contextual-toolbar-wrapper').classList.add('e-hide');
|
|
21300
21245
|
parent.okBtn();
|
|
@@ -21305,12 +21250,13 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21305
21250
|
};
|
|
21306
21251
|
ToolbarModule.prototype.destroyQuickAccessToolbar = function () {
|
|
21307
21252
|
var parent = this.parent;
|
|
21308
|
-
|
|
21309
|
-
|
|
21310
|
-
getComponent(
|
|
21253
|
+
var quickToolbar = document.getElementById(parent.element.id + '_quickAccessToolbar');
|
|
21254
|
+
if (quickToolbar && quickToolbar.classList.contains('e-control')) {
|
|
21255
|
+
getComponent(quickToolbar, 'toolbar').destroy();
|
|
21311
21256
|
}
|
|
21312
|
-
|
|
21313
|
-
|
|
21257
|
+
var qatArea = document.getElementById(parent.element.id + '_quickAccessToolbarArea');
|
|
21258
|
+
if (qatArea) {
|
|
21259
|
+
qatArea.style.display = 'none';
|
|
21314
21260
|
}
|
|
21315
21261
|
};
|
|
21316
21262
|
ToolbarModule.prototype.renderSlider = function (type) {
|
|
@@ -21323,7 +21269,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21323
21269
|
id: parent.element.id + '_headWrapper',
|
|
21324
21270
|
styles: 'position: relative'
|
|
21325
21271
|
}));
|
|
21326
|
-
labelWrapper = hdrWrapper.appendChild(
|
|
21272
|
+
labelWrapper = hdrWrapper.appendChild(parent.createElement('label', {
|
|
21327
21273
|
id: parent.element.id + '_labelWrapper',
|
|
21328
21274
|
styles: Browser.isDevice ? 'position: absolute; top: 25%; left: calc(50% - 150px); font-size: 15px; text-transform: capitalize; font-weight: 400;'
|
|
21329
21275
|
: 'position: absolute; top: 25%; left: calc(50% - 226px); font-size: 15px; text-transform: capitalize; font-weight: 400;'
|
|
@@ -21337,12 +21283,12 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21337
21283
|
id: parent.element.id + '_sliderWrapper',
|
|
21338
21284
|
styles: 'position: absolute'
|
|
21339
21285
|
}));
|
|
21340
|
-
var value =
|
|
21286
|
+
var value = parent.getCurrAdjustmentValue(type);
|
|
21341
21287
|
var min;
|
|
21342
21288
|
var max;
|
|
21343
21289
|
var slider;
|
|
21344
21290
|
if (type === 'brightness' || type === 'contrast' || type === 'saturation' || type === 'exposure') {
|
|
21345
|
-
if (
|
|
21291
|
+
if (parent.finetuneSettings) {
|
|
21346
21292
|
if (type === 'brightness' && parent.finetuneSettings.brightness) {
|
|
21347
21293
|
min = parent.finetuneSettings.brightness.min;
|
|
21348
21294
|
max = parent.finetuneSettings.brightness.max;
|
|
@@ -21355,7 +21301,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21355
21301
|
min = parent.finetuneSettings.saturation.min;
|
|
21356
21302
|
max = parent.finetuneSettings.saturation.max;
|
|
21357
21303
|
}
|
|
21358
|
-
else if (type === 'exposure' &&
|
|
21304
|
+
else if (type === 'exposure' && parent.finetuneSettings.exposure) {
|
|
21359
21305
|
min = parent.finetuneSettings.exposure.min;
|
|
21360
21306
|
max = parent.finetuneSettings.exposure.max;
|
|
21361
21307
|
}
|
|
@@ -21411,27 +21357,29 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21411
21357
|
width: Browser.isDevice ? '200px' : '300px',
|
|
21412
21358
|
cssClass: 'e-slider',
|
|
21413
21359
|
change: function (args) {
|
|
21414
|
-
|
|
21360
|
+
parent.setCurrAdjustmentValue(type, args.value);
|
|
21415
21361
|
_this.enableDisableTbrBtn();
|
|
21416
21362
|
}
|
|
21417
21363
|
});
|
|
21418
21364
|
};
|
|
21419
21365
|
ToolbarModule.prototype.applyPreviewFilter = function () {
|
|
21420
|
-
|
|
21421
|
-
|
|
21422
|
-
|
|
21423
|
-
|
|
21366
|
+
var parent = this.parent;
|
|
21367
|
+
if (document.querySelector('#' + parent.element.id + '_sliderWrapper') ||
|
|
21368
|
+
parent.currObjType.isFiltered) {
|
|
21369
|
+
parent.initialAdjustmentValue = parent.canvasFilter = this.lowerContext.filter;
|
|
21370
|
+
parent.currObjType.isFiltered = false;
|
|
21424
21371
|
}
|
|
21425
21372
|
};
|
|
21426
21373
|
ToolbarModule.prototype.unselectBtn = function () {
|
|
21374
|
+
var parent = this.parent;
|
|
21427
21375
|
var selectors = [
|
|
21428
|
-
'#' +
|
|
21429
|
-
'#' +
|
|
21430
|
-
'#' +
|
|
21431
|
-
'#' +
|
|
21432
|
-
'#' +
|
|
21433
|
-
'#' +
|
|
21434
|
-
'#' +
|
|
21376
|
+
'#' + parent.element.id + '_brightness',
|
|
21377
|
+
'#' + parent.element.id + '_contrast',
|
|
21378
|
+
'#' + parent.element.id + '_hue',
|
|
21379
|
+
'#' + parent.element.id + '_saturation',
|
|
21380
|
+
'#' + parent.element.id + '_opacity',
|
|
21381
|
+
'#' + parent.element.id + '_blur',
|
|
21382
|
+
'#' + parent.element.id + '_exposure'
|
|
21435
21383
|
];
|
|
21436
21384
|
for (var _i = 0, selectors_1 = selectors; _i < selectors_1.length; _i++) {
|
|
21437
21385
|
var selector = selectors_1[_i];
|
|
@@ -21456,68 +21404,69 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21456
21404
|
if (hdrWrapper) {
|
|
21457
21405
|
hdrWrapper.style.display = 'none';
|
|
21458
21406
|
}
|
|
21459
|
-
if (
|
|
21407
|
+
if (sliderWrapper && slider) {
|
|
21460
21408
|
slider.ej2_instances[0].destroy();
|
|
21461
21409
|
sliderWrapper.remove();
|
|
21462
21410
|
}
|
|
21463
21411
|
};
|
|
21464
21412
|
ToolbarModule.prototype.updateToolbarItems = function () {
|
|
21465
|
-
var
|
|
21466
|
-
var
|
|
21467
|
-
var
|
|
21468
|
-
var
|
|
21469
|
-
var
|
|
21470
|
-
var
|
|
21471
|
-
var
|
|
21472
|
-
var
|
|
21473
|
-
var
|
|
21474
|
-
|
|
21475
|
-
|
|
21413
|
+
var parent = this.parent;
|
|
21414
|
+
var selFillElem = parent.element.querySelector('.e-fill.e-template .e-dropdownbtn-preview');
|
|
21415
|
+
var selStrokeElem = parent.element.querySelector('.e-stroke.e-template .e-dropdownbtn-preview');
|
|
21416
|
+
var selTextStrokeElem = parent.element.querySelector('.e-text-font-color.e-template .e-dropdownbtn-preview');
|
|
21417
|
+
var selPenStrokeElem = parent.element.querySelector('.e-pen-stroke-color.e-template .e-dropdownbtn-preview');
|
|
21418
|
+
var strokeWidthElem = parent.element.querySelector('.e-shape-stroke-width');
|
|
21419
|
+
var fontFamilyElem = parent.element.querySelector('.e-text-font-family');
|
|
21420
|
+
var fontSizeElem = parent.element.querySelector('.e-text-font-size');
|
|
21421
|
+
var boldBtn = parent.element.querySelector('#' + parent.element.id + '_bold');
|
|
21422
|
+
var italicBtn = parent.element.querySelector('#' + parent.element.id + '_italic');
|
|
21423
|
+
if (isNullOrUndefined(parent.activeObj.strokeSettings.strokeWidth)) {
|
|
21424
|
+
parent.activeObj.strokeSettings.strokeWidth = 2;
|
|
21476
21425
|
}
|
|
21477
21426
|
if (selFillElem) {
|
|
21478
|
-
if (
|
|
21427
|
+
if (parent.activeObj.strokeSettings.fillColor === '') {
|
|
21479
21428
|
selFillElem.classList.add('e-nocolor-item');
|
|
21480
21429
|
}
|
|
21481
21430
|
else {
|
|
21482
21431
|
selFillElem.classList.remove('e-nocolor-item');
|
|
21483
|
-
selFillElem.style.background =
|
|
21432
|
+
selFillElem.style.background = parent.activeObj.strokeSettings.fillColor;
|
|
21484
21433
|
}
|
|
21485
|
-
getComponent(
|
|
21486
|
-
=
|
|
21434
|
+
getComponent(parent.element.id + '_shape_fill', 'colorpicker').value
|
|
21435
|
+
= parent.activeObj.strokeSettings.fillColor + 'ff';
|
|
21487
21436
|
}
|
|
21488
21437
|
if (selStrokeElem) {
|
|
21489
|
-
selStrokeElem.style.background =
|
|
21490
|
-
getComponent(
|
|
21491
|
-
=
|
|
21438
|
+
selStrokeElem.style.background = parent.activeObj.strokeSettings.strokeColor;
|
|
21439
|
+
getComponent(parent.element.id + '_shape_stroke', 'colorpicker').value
|
|
21440
|
+
= parent.activeObj.strokeSettings.strokeColor + 'ff';
|
|
21492
21441
|
}
|
|
21493
21442
|
if (selTextStrokeElem) {
|
|
21494
|
-
selTextStrokeElem.style.background =
|
|
21495
|
-
getComponent(
|
|
21496
|
-
=
|
|
21443
|
+
selTextStrokeElem.style.background = parent.activeObj.strokeSettings.strokeColor;
|
|
21444
|
+
getComponent(parent.element.id + '_text_font', 'colorpicker').value
|
|
21445
|
+
= parent.activeObj.strokeSettings.strokeColor + 'ff';
|
|
21497
21446
|
}
|
|
21498
21447
|
if (selPenStrokeElem) {
|
|
21499
|
-
selPenStrokeElem.style.background =
|
|
21500
|
-
getComponent(
|
|
21501
|
-
=
|
|
21448
|
+
selPenStrokeElem.style.background = parent.activeObj.strokeSettings.strokeColor;
|
|
21449
|
+
getComponent(parent.element.id + '_pen_stroke', 'colorpicker').value
|
|
21450
|
+
= parent.activeObj.strokeSettings.strokeColor + 'ff';
|
|
21502
21451
|
}
|
|
21503
21452
|
if (fontFamilyElem) {
|
|
21504
21453
|
if (Browser.isDevice) {
|
|
21505
|
-
fontFamilyElem.setAttribute('style', 'font-family:' +
|
|
21454
|
+
fontFamilyElem.setAttribute('style', 'font-family:' + parent.activeObj.textSettings.fontFamily.toLowerCase());
|
|
21506
21455
|
}
|
|
21507
21456
|
else {
|
|
21508
|
-
fontFamilyElem.textContent =
|
|
21457
|
+
fontFamilyElem.textContent = parent.activeObj.textSettings.fontFamily;
|
|
21509
21458
|
}
|
|
21510
21459
|
}
|
|
21511
21460
|
if (fontSizeElem) {
|
|
21512
|
-
for (var i = 0; i <
|
|
21513
|
-
if (parseInt(
|
|
21461
|
+
for (var i = 0; i < parent.fontSizeColl.length; i++) {
|
|
21462
|
+
if (parseInt(parent.fontSizeColl[i].text, 10) >= Math.round(parent.activeObj.textSettings.fontSize)) {
|
|
21514
21463
|
fontSizeElem.textContent = (i + 1).toString();
|
|
21515
21464
|
break;
|
|
21516
21465
|
}
|
|
21517
21466
|
}
|
|
21518
21467
|
}
|
|
21519
21468
|
if (boldBtn) {
|
|
21520
|
-
if (
|
|
21469
|
+
if (parent.activeObj.textSettings.bold) {
|
|
21521
21470
|
boldBtn.classList.add('e-selected-btn');
|
|
21522
21471
|
}
|
|
21523
21472
|
else {
|
|
@@ -21525,7 +21474,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21525
21474
|
}
|
|
21526
21475
|
}
|
|
21527
21476
|
if (italicBtn) {
|
|
21528
|
-
if (
|
|
21477
|
+
if (parent.activeObj.textSettings.italic) {
|
|
21529
21478
|
italicBtn.classList.add('e-selected-btn');
|
|
21530
21479
|
}
|
|
21531
21480
|
else {
|
|
@@ -21533,7 +21482,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21533
21482
|
}
|
|
21534
21483
|
}
|
|
21535
21484
|
if (strokeWidthElem) {
|
|
21536
|
-
var strokeWidth = Math.round((
|
|
21485
|
+
var strokeWidth = Math.round((parent.activeObj.strokeSettings.strokeWidth)).toString();
|
|
21537
21486
|
strokeWidthElem.textContent = this.getStrokeWidth(strokeWidth);
|
|
21538
21487
|
}
|
|
21539
21488
|
};
|
|
@@ -21563,7 +21512,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21563
21512
|
var parent = this.parent;
|
|
21564
21513
|
parent.notify('shape', { prop: 'applyActObj', onPropertyChange: false, value: { isMouseDown: true } });
|
|
21565
21514
|
var panBtn = parent.element.querySelector('.e-img-pan .e-btn');
|
|
21566
|
-
if (
|
|
21515
|
+
if (panBtn) {
|
|
21567
21516
|
panBtn.classList.remove('e-selected-btn');
|
|
21568
21517
|
}
|
|
21569
21518
|
parent.pan(false);
|
|
@@ -21574,22 +21523,23 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21574
21523
|
}
|
|
21575
21524
|
};
|
|
21576
21525
|
ToolbarModule.prototype.destroySubComponents = function () {
|
|
21577
|
-
var
|
|
21578
|
-
var
|
|
21526
|
+
var parent = this.parent;
|
|
21527
|
+
var inputElement = parent.element.querySelectorAll('input.e-control');
|
|
21528
|
+
var btnElement = parent.element.querySelectorAll('button.e-control');
|
|
21579
21529
|
for (var i = 0, len = inputElement.length; i < len; i++) {
|
|
21580
21530
|
if (inputElement[i].classList.contains('e-color-picker')) {
|
|
21581
21531
|
getComponent(inputElement[i], 'color-picker').destroy();
|
|
21582
|
-
detach(select('input#' + inputElement[i].id,
|
|
21532
|
+
detach(select('input#' + inputElement[i].id, parent.element));
|
|
21583
21533
|
}
|
|
21584
21534
|
}
|
|
21585
21535
|
for (var i = 0, len = btnElement.length; i < len; i++) {
|
|
21586
21536
|
if (btnElement[i].classList.contains('e-dropdown-btn')) {
|
|
21587
21537
|
getComponent(btnElement[i], 'dropdown-btn').destroy();
|
|
21588
|
-
detach(select('button#' + btnElement[i].id,
|
|
21538
|
+
detach(select('button#' + btnElement[i].id, parent.element));
|
|
21589
21539
|
}
|
|
21590
21540
|
else if (btnElement[i].classList.contains('e-btn')) {
|
|
21591
21541
|
getComponent(btnElement[i], 'btn').destroy();
|
|
21592
|
-
detach(select('button#' + btnElement[i].id,
|
|
21542
|
+
detach(select('button#' + btnElement[i].id, parent.element));
|
|
21593
21543
|
}
|
|
21594
21544
|
}
|
|
21595
21545
|
};
|