@syncfusion/ej2-image-editor 25.1.37 → 25.1.39
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 +23 -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 +97 -15
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +110 -15
- package/dist/es6/ej2-image-editor.es5.js.map +1 -1
- package/dist/global/ej2-image-editor.min.js +2 -2
- package/dist/global/ej2-image-editor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +10 -10
- package/src/image-editor/action/freehand-draw.js +3 -0
- package/src/image-editor/action/shape.js +1 -0
- package/src/image-editor/action/transform.js +39 -10
- package/src/image-editor/base/image-editor-model.d.ts +5 -0
- package/src/image-editor/base/image-editor.d.ts +8 -1
- package/src/image-editor/base/image-editor.js +6 -3
- package/src/image-editor/renderer/toolbar.d.ts +1 -0
- package/src/image-editor/renderer/toolbar.js +62 -3
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 25.1.
|
|
3
|
+
* version : 25.1.39
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-image-editor@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-image-editor@25.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-image-editor@25.1.38",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-X2EocZP+w7YICz06hF1pi8Es3eRTIbYWVztXRVQZ49YCDZJ3E6t49d5q0oskE/0qHPuWZizMXjdG1m6YaSDALA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-image-editor",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-image-editor",
|
|
24
24
|
"/@syncfusion/ej2-vue-image-editor"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-25.1.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-25.1.38.tgz",
|
|
27
|
+
"_shasum": "c691770cca2b120b6933b6a59a64985a5f15ae2d",
|
|
28
28
|
"_spec": "@syncfusion/ej2-image-editor@*",
|
|
29
29
|
"_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"bundleDependencies": false,
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@syncfusion/ej2-base": "~25.1.35",
|
|
36
|
-
"@syncfusion/ej2-buttons": "~25.1.
|
|
37
|
-
"@syncfusion/ej2-inputs": "~25.1.
|
|
38
|
-
"@syncfusion/ej2-navigations": "~25.1.
|
|
39
|
-
"@syncfusion/ej2-popups": "~25.1.
|
|
40
|
-
"@syncfusion/ej2-splitbuttons": "~25.1.
|
|
36
|
+
"@syncfusion/ej2-buttons": "~25.1.39",
|
|
37
|
+
"@syncfusion/ej2-inputs": "~25.1.38",
|
|
38
|
+
"@syncfusion/ej2-navigations": "~25.1.39",
|
|
39
|
+
"@syncfusion/ej2-popups": "~25.1.39",
|
|
40
|
+
"@syncfusion/ej2-splitbuttons": "~25.1.38"
|
|
41
41
|
},
|
|
42
42
|
"deprecated": false,
|
|
43
43
|
"description": "Essential JS 2 ImageEditor",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/imageeditor"
|
|
68
68
|
},
|
|
69
69
|
"typings": "index.d.ts",
|
|
70
|
-
"version": "25.1.
|
|
70
|
+
"version": "25.1.39",
|
|
71
71
|
"sideEffects": false,
|
|
72
72
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
73
73
|
}
|
|
@@ -179,6 +179,9 @@ var FreehandDrawing = /** @class */ (function () {
|
|
|
179
179
|
case 'reset':
|
|
180
180
|
this.reset();
|
|
181
181
|
break;
|
|
182
|
+
case 'triggerShapeChanging':
|
|
183
|
+
this.triggerShapeChanging(args.value['shapeChangingArgs']);
|
|
184
|
+
break;
|
|
182
185
|
}
|
|
183
186
|
};
|
|
184
187
|
FreehandDrawing.prototype.updateFhdPvtVar = function () {
|
|
@@ -2132,6 +2132,7 @@ var Shape = /** @class */ (function () {
|
|
|
2132
2132
|
var shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
|
|
2133
2133
|
currentShapeSettings: shapeSettings };
|
|
2134
2134
|
parent.trigger('shapeChanging', shapeChangingArgs);
|
|
2135
|
+
isSelect = isSelect ? isSelect : isSelected;
|
|
2135
2136
|
this.drawShapeImageEvent(shapeChangingArgs, isSelect);
|
|
2136
2137
|
if (parent.isPublicMethod && !isSelected) {
|
|
2137
2138
|
parent.notify('undo-redo', { prop: 'updateUndoRedo', onPropertyChange: false });
|
|
@@ -78,7 +78,7 @@ var Transform = /** @class */ (function () {
|
|
|
78
78
|
this.resetZoom();
|
|
79
79
|
break;
|
|
80
80
|
case 'pan':
|
|
81
|
-
this.pan(args.value['value']);
|
|
81
|
+
this.pan(args.value['value'], args.value['x'], args.value['y']);
|
|
82
82
|
break;
|
|
83
83
|
case 'zoom':
|
|
84
84
|
this.zoom(args.value['zoomFactor'], args.value['zoomPoint']);
|
|
@@ -1091,12 +1091,12 @@ var Transform = /** @class */ (function () {
|
|
|
1091
1091
|
parent.notify('selection', { prop: 'getPanDown', onPropertyChange: false, value: { obj: obj } });
|
|
1092
1092
|
var panEventArgs = { startPoint: obj['panDown'], endPoint: this.panMove, cancel: false };
|
|
1093
1093
|
parent.trigger('panning', panEventArgs);
|
|
1094
|
-
this.panEvent(panEventArgs, xDiff, yDiff);
|
|
1095
|
-
};
|
|
1096
|
-
Transform.prototype.panEvent = function (panEventArgs, xDiff, yDiff) {
|
|
1097
1094
|
if (panEventArgs.cancel) {
|
|
1098
1095
|
return;
|
|
1099
1096
|
}
|
|
1097
|
+
this.panEvent(xDiff, yDiff);
|
|
1098
|
+
};
|
|
1099
|
+
Transform.prototype.panEvent = function (xDiff, yDiff, isPanMethod) {
|
|
1100
1100
|
var parent = this.parent;
|
|
1101
1101
|
var isObjCreated = false;
|
|
1102
1102
|
if (parent.activeObj.shape && parent.activeObj.shape === 'shape') {
|
|
@@ -1134,8 +1134,13 @@ var Transform = /** @class */ (function () {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
if (parent.transform.degree === 0) {
|
|
1136
1136
|
var point = void 0;
|
|
1137
|
-
if (isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) {
|
|
1138
|
-
|
|
1137
|
+
if ((isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) || isPanMethod) {
|
|
1138
|
+
if (isPanMethod) {
|
|
1139
|
+
point = this.updatePanPoints(xDiff, yDiff);
|
|
1140
|
+
}
|
|
1141
|
+
else {
|
|
1142
|
+
point = this.updatePanPoints();
|
|
1143
|
+
}
|
|
1139
1144
|
}
|
|
1140
1145
|
else {
|
|
1141
1146
|
point = { x: xDiff, y: yDiff };
|
|
@@ -1156,8 +1161,13 @@ var Transform = /** @class */ (function () {
|
|
|
1156
1161
|
else {
|
|
1157
1162
|
var tempFlipState = parent.transform.currFlipState;
|
|
1158
1163
|
parent.isCropTab = true;
|
|
1159
|
-
if (isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) {
|
|
1160
|
-
|
|
1164
|
+
if ((isNullOrUndefined(xDiff) && isNullOrUndefined(yDiff)) || isPanMethod) {
|
|
1165
|
+
if (isPanMethod) {
|
|
1166
|
+
parent.panPoint.currentPannedPoint = this.updatePanPoints(xDiff, yDiff);
|
|
1167
|
+
}
|
|
1168
|
+
else {
|
|
1169
|
+
parent.panPoint.currentPannedPoint = this.updatePanPoints();
|
|
1170
|
+
}
|
|
1161
1171
|
}
|
|
1162
1172
|
else {
|
|
1163
1173
|
parent.panPoint.currentPannedPoint = { x: xDiff, y: yDiff };
|
|
@@ -1444,7 +1454,7 @@ var Transform = /** @class */ (function () {
|
|
|
1444
1454
|
parent.notify('draw', { prop: 'updateActiveObject', onPropertyChange: false, value: { actPoint: actPoint,
|
|
1445
1455
|
obj: parent.activeObj, isMouseMove: null, x: null, y: null } });
|
|
1446
1456
|
};
|
|
1447
|
-
Transform.prototype.pan = function (value) {
|
|
1457
|
+
Transform.prototype.pan = function (value, x, y) {
|
|
1448
1458
|
var parent = this.parent;
|
|
1449
1459
|
if (!parent.disabled && parent.isImageLoaded) {
|
|
1450
1460
|
if (value) {
|
|
@@ -1454,6 +1464,18 @@ var Transform = /** @class */ (function () {
|
|
|
1454
1464
|
parent.notify('selection', { prop: 'setDragCanvas', value: { bool: true } });
|
|
1455
1465
|
parent.lowerCanvas.style.cursor = parent.upperCanvas.style.cursor = parent.cursor = 'grab';
|
|
1456
1466
|
parent.notify('selection', { prop: 'setPanDown', onPropertyChange: false, value: { panDown: null } });
|
|
1467
|
+
if (x || y) {
|
|
1468
|
+
x = x ? x : 0;
|
|
1469
|
+
y = y ? y : 0;
|
|
1470
|
+
if (isNullOrUndefined(this.panMove)) {
|
|
1471
|
+
this.panMove = { x: x, y: y };
|
|
1472
|
+
}
|
|
1473
|
+
if (isNullOrUndefined(this.tempPanMove)) {
|
|
1474
|
+
this.tempPanMove = { x: this.panMove.x, y: this.panMove.y };
|
|
1475
|
+
}
|
|
1476
|
+
this.panEvent(x, y, true);
|
|
1477
|
+
this.tempPanMove = null;
|
|
1478
|
+
}
|
|
1457
1479
|
}
|
|
1458
1480
|
else {
|
|
1459
1481
|
parent.togglePan = parent.currObjType.isCustomCrop = false;
|
|
@@ -1768,6 +1790,9 @@ var Transform = /** @class */ (function () {
|
|
|
1768
1790
|
var cxtTbar = parent.element.querySelector('#' + parent.element.id + '_contextualToolbarArea');
|
|
1769
1791
|
canvasMaxHeight -= cxtTbar ? cxtTbar.clientHeight : 0;
|
|
1770
1792
|
}
|
|
1793
|
+
if (!isImgShape && parent.element.clientHeight === 0) {
|
|
1794
|
+
canvasMaxHeight = 0;
|
|
1795
|
+
}
|
|
1771
1796
|
if (isNullOrUndefined(isImgShape)) {
|
|
1772
1797
|
if (canvasMaxWidth > 30) {
|
|
1773
1798
|
canvasMaxWidth -= 30;
|
|
@@ -1804,7 +1829,7 @@ var Transform = /** @class */ (function () {
|
|
|
1804
1829
|
}
|
|
1805
1830
|
return { width: cssMaxWidth, height: cssMaxHeight };
|
|
1806
1831
|
};
|
|
1807
|
-
Transform.prototype.updatePanPoints = function () {
|
|
1832
|
+
Transform.prototype.updatePanPoints = function (x, y) {
|
|
1808
1833
|
var parent = this.parent;
|
|
1809
1834
|
var tempActObj = extend({}, parent.activeObj, {}, true);
|
|
1810
1835
|
var tempDestLeft = parent.img.destLeft;
|
|
@@ -1814,6 +1839,10 @@ var Transform = /** @class */ (function () {
|
|
|
1814
1839
|
}
|
|
1815
1840
|
var xDiff = this.panMove.x - this.tempPanMove.x;
|
|
1816
1841
|
var yDiff = this.panMove.y - this.tempPanMove.y;
|
|
1842
|
+
if (x || y) {
|
|
1843
|
+
xDiff = x;
|
|
1844
|
+
yDiff = y;
|
|
1845
|
+
}
|
|
1817
1846
|
parent.img.destLeft += xDiff;
|
|
1818
1847
|
parent.img.destTop += yDiff;
|
|
1819
1848
|
this.limitPan();
|
|
@@ -282,14 +282,19 @@ export interface ImageEditorModel extends ComponentModel{
|
|
|
282
282
|
* If the property is defined as empty collection, the toolbar will not be rendered.
|
|
283
283
|
* The preconfigured toolbar commands are
|
|
284
284
|
* - Crop: helps to crop an image as ellipse, square, various ratio aspects, custom selection with resize, drag and drop.
|
|
285
|
+
* - Straightening: helps to rotate an image by a specified angle.
|
|
285
286
|
* - Annotate: help to insert a shape on image that supports rectangle, ellipse, line, arrow, path, text, image and freehand drawing with resize, drag and drop, and customize its appearance.
|
|
286
287
|
* - Transform: helps to rotate and flip an image.
|
|
287
288
|
* - Finetunes: helps to perform adjustments on an image.
|
|
288
289
|
* - Filters: helps to perform predefined color filters.
|
|
290
|
+
* - Frame: helps to add decorative borders or frames around images.
|
|
291
|
+
* - Resize: helps to modify the dimensions of an image.
|
|
289
292
|
* - ZoomIn: performs zoom-in an image.
|
|
290
293
|
* - ZoomOut: performs zoom-out an image.
|
|
291
294
|
* - Save: save the modified image.
|
|
292
295
|
* - Open: open an image to perform editing.
|
|
296
|
+
* - Undo: helps to revert the last action.
|
|
297
|
+
* - Redo: helps to redo the last action.
|
|
293
298
|
* - Reset: reset the modification and restore the original image.
|
|
294
299
|
*
|
|
295
300
|
* {% codeBlock src='image-editor/toolbar/index.md' %}{% endcodeBlock %}
|
|
@@ -428,14 +428,19 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
|
|
|
428
428
|
* If the property is defined as empty collection, the toolbar will not be rendered.
|
|
429
429
|
* The preconfigured toolbar commands are
|
|
430
430
|
* - Crop: helps to crop an image as ellipse, square, various ratio aspects, custom selection with resize, drag and drop.
|
|
431
|
+
* - Straightening: helps to rotate an image by a specified angle.
|
|
431
432
|
* - Annotate: help to insert a shape on image that supports rectangle, ellipse, line, arrow, path, text, image and freehand drawing with resize, drag and drop, and customize its appearance.
|
|
432
433
|
* - Transform: helps to rotate and flip an image.
|
|
433
434
|
* - Finetunes: helps to perform adjustments on an image.
|
|
434
435
|
* - Filters: helps to perform predefined color filters.
|
|
436
|
+
* - Frame: helps to add decorative borders or frames around images.
|
|
437
|
+
* - Resize: helps to modify the dimensions of an image.
|
|
435
438
|
* - ZoomIn: performs zoom-in an image.
|
|
436
439
|
* - ZoomOut: performs zoom-out an image.
|
|
437
440
|
* - Save: save the modified image.
|
|
438
441
|
* - Open: open an image to perform editing.
|
|
442
|
+
* - Undo: helps to revert the last action.
|
|
443
|
+
* - Redo: helps to redo the last action.
|
|
439
444
|
* - Reset: reset the modification and restore the original image.
|
|
440
445
|
*
|
|
441
446
|
* {% codeBlock src='image-editor/toolbar/index.md' %}{% endcodeBlock %}
|
|
@@ -1007,13 +1012,15 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
|
|
|
1007
1012
|
* Enable or disable a panning on the Image Editor.
|
|
1008
1013
|
*
|
|
1009
1014
|
* @param {boolean} value - Specifies a value whether enable or disable panning.
|
|
1015
|
+
* @param {number} x - Optional, Specifies a value to pan the image horizontally.
|
|
1016
|
+
* @param {number} y - Optional, Specifies a value to pan the image vertically.
|
|
1010
1017
|
*
|
|
1011
1018
|
* @remarks
|
|
1012
1019
|
* This option will take into effect once the image's visibility is hidden when zooming an image or selection has been performed.
|
|
1013
1020
|
*
|
|
1014
1021
|
* @returns {void}.
|
|
1015
1022
|
*/
|
|
1016
|
-
pan(value: boolean): void;
|
|
1023
|
+
pan(value: boolean, x?: number, y?: number): void;
|
|
1017
1024
|
/**
|
|
1018
1025
|
* Zoom in or out on a point in the image editor.
|
|
1019
1026
|
*
|
|
@@ -1130,14 +1130,16 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
1130
1130
|
* Enable or disable a panning on the Image Editor.
|
|
1131
1131
|
*
|
|
1132
1132
|
* @param {boolean} value - Specifies a value whether enable or disable panning.
|
|
1133
|
+
* @param {number} x - Optional, Specifies a value to pan the image horizontally.
|
|
1134
|
+
* @param {number} y - Optional, Specifies a value to pan the image vertically.
|
|
1133
1135
|
*
|
|
1134
1136
|
* @remarks
|
|
1135
1137
|
* This option will take into effect once the image's visibility is hidden when zooming an image or selection has been performed.
|
|
1136
1138
|
*
|
|
1137
1139
|
* @returns {void}.
|
|
1138
1140
|
*/
|
|
1139
|
-
ImageEditor.prototype.pan = function (value) {
|
|
1140
|
-
this.notify('transform', { prop: 'pan', onPropertyChange: false, value: { value: value } });
|
|
1141
|
+
ImageEditor.prototype.pan = function (value, x, y) {
|
|
1142
|
+
this.notify('transform', { prop: 'pan', onPropertyChange: false, value: { value: value, x: x, y: y } });
|
|
1141
1143
|
};
|
|
1142
1144
|
/**
|
|
1143
1145
|
* Zoom in or out on a point in the image editor.
|
|
@@ -2119,7 +2121,7 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2119
2121
|
this.notify('toolbar', { prop: 'destroy-qa-toolbar' });
|
|
2120
2122
|
this.notify('undo-redo', { prop: 'updateCurrUrc', value: { type: 'ok' } });
|
|
2121
2123
|
}
|
|
2122
|
-
else if ((this.activeObj.activePoint.width !== 0
|
|
2124
|
+
else if ((this.activeObj.activePoint.width !== 0 || this.activeObj.activePoint.height !== 0) ||
|
|
2123
2125
|
(this.activeObj.shape === 'path' && this.activeObj.pointColl.length > 0)) {
|
|
2124
2126
|
if (this.activeObj.shape === 'image') {
|
|
2125
2127
|
this.notify('draw', { prop: 'setImageApply', onPropertyChange: false, value: { bool: true } });
|
|
@@ -2280,6 +2282,7 @@ var ImageEditor = /** @class */ (function (_super) {
|
|
|
2280
2282
|
* An string which returns the SelectionType.
|
|
2281
2283
|
*/
|
|
2282
2284
|
ImageEditor.prototype.getSelectionType = function (type) {
|
|
2285
|
+
type = type === 'crop-custom' ? 'CropCustom' : type;
|
|
2283
2286
|
var typeToSelectionType = { 'CropCustom': 'Custom', 'CropSquare': 'Square', 'CropCircle': 'Circle',
|
|
2284
2287
|
'Crop3:2': '3:2', 'Crop4:3': '4:3', 'Crop5:4': '5:4', 'Crop7:5': '7:5', 'Crop16:9': '16:9',
|
|
2285
2288
|
'Crop2:3': '2:3', 'Crop3:4': '3:4', 'Crop4:5': '4:5', 'Crop5:7': '5:7', 'Crop9:16': '9:16' };
|
|
@@ -4,7 +4,7 @@ import { NumericTextBox } from '@syncfusion/ej2-inputs';
|
|
|
4
4
|
import { Toolbar } from '@syncfusion/ej2-navigations';
|
|
5
5
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
6
6
|
import { ColorPicker, Uploader, Slider } from '@syncfusion/ej2-inputs';
|
|
7
|
-
import { ZoomTrigger } from '../index';
|
|
7
|
+
import { ZoomTrigger, ShapeType } from '../index';
|
|
8
8
|
import { hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
|
9
9
|
var ToolbarModule = /** @class */ (function () {
|
|
10
10
|
function ToolbarModule(parent) {
|
|
@@ -1122,6 +1122,10 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1122
1122
|
this.parent.showDialogPopup();
|
|
1123
1123
|
}
|
|
1124
1124
|
};
|
|
1125
|
+
ToolbarModule.prototype.triggerTbarClickEvent = function (args) {
|
|
1126
|
+
var clickEvent = { item: args.item, originalEvent: args.event };
|
|
1127
|
+
this.parent.trigger('toolbarItemClicked', clickEvent);
|
|
1128
|
+
};
|
|
1125
1129
|
ToolbarModule.prototype.renderAnnotationBtn = function (isContextualToolbar) {
|
|
1126
1130
|
var _this = this;
|
|
1127
1131
|
var parent = this.parent;
|
|
@@ -1211,6 +1215,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1211
1215
|
}
|
|
1212
1216
|
},
|
|
1213
1217
|
select: function (args) {
|
|
1218
|
+
_this.triggerTbarClickEvent(args);
|
|
1214
1219
|
parent.okBtn();
|
|
1215
1220
|
var isCropSelection = false;
|
|
1216
1221
|
var splitWords;
|
|
@@ -1231,6 +1236,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1231
1236
|
}
|
|
1232
1237
|
var obj = { currentFreehandDrawIndex: null };
|
|
1233
1238
|
parent.notify('freehand-draw', { prop: 'getCurrentFreehandDrawIndex', value: { obj: obj } });
|
|
1239
|
+
var prevObj = { shapeSettingsObj: {} };
|
|
1240
|
+
var shapeSettings;
|
|
1241
|
+
var shapeChangingArgs;
|
|
1234
1242
|
drpDownBtn.iconCss = 'e-icons ' + _this.getCurrentShapeIcon(args.item.id);
|
|
1235
1243
|
switch (args.item.id) {
|
|
1236
1244
|
case 'pen':
|
|
@@ -1238,6 +1246,12 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1238
1246
|
parent.notify('draw', { prop: 'setTempCurrentFreehandDrawIndex', value: { tempCurrentFreehandDrawIndex: obj['currentFreehandDrawIndex'] } });
|
|
1239
1247
|
_this.currentToolbar = 'pen';
|
|
1240
1248
|
parent.freeHandDraw(true);
|
|
1249
|
+
parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: prevObj } });
|
|
1250
|
+
shapeSettings = prevObj['shapeSettingsObj'];
|
|
1251
|
+
shapeSettings.type = ShapeType.FreehandDraw;
|
|
1252
|
+
shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
|
|
1253
|
+
currentShapeSettings: shapeSettings };
|
|
1254
|
+
parent.notify('freehand-draw', { prop: 'triggerShapeChanging', value: { shapeChangingArgs: shapeChangingArgs } });
|
|
1241
1255
|
break;
|
|
1242
1256
|
case 'text':
|
|
1243
1257
|
_this.currentToolbar = 'text';
|
|
@@ -1247,12 +1261,22 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1247
1261
|
_this.currentToolbar = 'shapes';
|
|
1248
1262
|
parent.element.querySelector('#' + id + '_fileUpload').click();
|
|
1249
1263
|
break;
|
|
1250
|
-
|
|
1264
|
+
case 'ellipse':
|
|
1265
|
+
case 'arrow':
|
|
1266
|
+
case 'line':
|
|
1267
|
+
case 'rectangle':
|
|
1268
|
+
case 'path':
|
|
1251
1269
|
_this.currentToolbar = 'shapes';
|
|
1252
1270
|
_this.setInitialShapeSettings(args);
|
|
1253
1271
|
parent.notify('selection', { prop: 'annotate', value: { shape: args.item.id } });
|
|
1254
1272
|
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'shapes',
|
|
1255
1273
|
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
1274
|
+
parent.notify('selection', { prop: 'updatePrevShapeSettings', onPropertyChange: false, value: { obj: prevObj } });
|
|
1275
|
+
shapeSettings = prevObj['shapeSettingsObj'];
|
|
1276
|
+
shapeChangingArgs = { cancel: false, action: 'insert', previousShapeSettings: shapeSettings,
|
|
1277
|
+
currentShapeSettings: shapeSettings };
|
|
1278
|
+
parent.trigger('shapeChanging', shapeChangingArgs);
|
|
1279
|
+
parent.notify('shape', { prop: 'updateShapeChangeEventArgs', value: { shapeSettings: shapeChangingArgs.currentShapeSettings } });
|
|
1256
1280
|
break;
|
|
1257
1281
|
}
|
|
1258
1282
|
_this.updateToolbarItems();
|
|
@@ -1358,6 +1382,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1358
1382
|
},
|
|
1359
1383
|
items: items,
|
|
1360
1384
|
select: function (args) {
|
|
1385
|
+
_this.triggerTbarClickEvent(args);
|
|
1361
1386
|
_this.cropSelect(args);
|
|
1362
1387
|
drpDownBtn.iconCss = 'e-icons ' + _this.getCurrentShapeIcon('crop-' + args.item.id);
|
|
1363
1388
|
drpDownBtn.content = Browser.isDevice ? null : parent.toPascalCase(args.item.id);
|
|
@@ -1368,6 +1393,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1368
1393
|
drpDownBtn.appendTo('#' + parent.element.id + '_cropBtn');
|
|
1369
1394
|
};
|
|
1370
1395
|
ToolbarModule.prototype.renderTransformBtn = function () {
|
|
1396
|
+
var _this = this;
|
|
1371
1397
|
var parent = this.parent;
|
|
1372
1398
|
var items = [];
|
|
1373
1399
|
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('RotateLeft') > -1)) {
|
|
@@ -1392,12 +1418,17 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1392
1418
|
elem.style.display = 'block';
|
|
1393
1419
|
}
|
|
1394
1420
|
},
|
|
1395
|
-
items: items,
|
|
1421
|
+
items: items,
|
|
1422
|
+
select: function (args) {
|
|
1423
|
+
_this.triggerTbarClickEvent(args);
|
|
1424
|
+
parent.transformSelect.bind(_this);
|
|
1425
|
+
},
|
|
1396
1426
|
iconCss: 'e-icons e-transform', cssClass: 'e-image-popup'
|
|
1397
1427
|
});
|
|
1398
1428
|
drpDownBtn.appendTo('#' + parent.element.id + '_transformBtn');
|
|
1399
1429
|
};
|
|
1400
1430
|
ToolbarModule.prototype.renderSaveBtn = function () {
|
|
1431
|
+
var _this = this;
|
|
1401
1432
|
var parent = this.parent;
|
|
1402
1433
|
var id = parent.element.id;
|
|
1403
1434
|
var saveItems = [
|
|
@@ -1410,6 +1441,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1410
1441
|
// Initialize the DropDownButton component.
|
|
1411
1442
|
var saveDrpDownBtn = new DropDownButton({ items: saveItems, cssClass: 'e-caret-hide e-image-popup', iconCss: 'e-icons e-save',
|
|
1412
1443
|
select: function (args) {
|
|
1444
|
+
_this.triggerTbarClickEvent(args);
|
|
1413
1445
|
parent.export(args.item.text);
|
|
1414
1446
|
parent.isChangesSaved = true;
|
|
1415
1447
|
parent.notify('draw', { prop: 'redrawDownScale' });
|
|
@@ -1847,6 +1879,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1847
1879
|
}
|
|
1848
1880
|
};
|
|
1849
1881
|
ToolbarModule.prototype.createShapeBtn = function (items) {
|
|
1882
|
+
var _this = this;
|
|
1850
1883
|
var parent = this.parent;
|
|
1851
1884
|
var id = parent.element.id;
|
|
1852
1885
|
if (items.indexOf('strokeWidth') > -1) {
|
|
@@ -1885,6 +1918,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1885
1918
|
}
|
|
1886
1919
|
},
|
|
1887
1920
|
select: function (args) {
|
|
1921
|
+
_this.triggerTbarClickEvent(args);
|
|
1888
1922
|
spanElem_1.textContent = args.item.text;
|
|
1889
1923
|
parent.updateStrokeWidth(args.item.id);
|
|
1890
1924
|
if (Browser.isDevice) {
|
|
@@ -1908,6 +1942,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1908
1942
|
}
|
|
1909
1943
|
};
|
|
1910
1944
|
ToolbarModule.prototype.createStartBtn = function () {
|
|
1945
|
+
var _this = this;
|
|
1911
1946
|
var parent = this.parent;
|
|
1912
1947
|
var id = parent.element.id;
|
|
1913
1948
|
var strokeWidthItems = [
|
|
@@ -1941,6 +1976,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1941
1976
|
}
|
|
1942
1977
|
},
|
|
1943
1978
|
select: function (args) {
|
|
1979
|
+
_this.triggerTbarClickEvent(args);
|
|
1944
1980
|
spanElem.textContent = args.item.text;
|
|
1945
1981
|
parent.updateArrow('startArrow', args.item.id);
|
|
1946
1982
|
}
|
|
@@ -1949,6 +1985,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1949
1985
|
drpDownBtn.appendTo('#' + id + '_startBtn');
|
|
1950
1986
|
};
|
|
1951
1987
|
ToolbarModule.prototype.createEndBtn = function () {
|
|
1988
|
+
var _this = this;
|
|
1952
1989
|
var parent = this.parent;
|
|
1953
1990
|
var id = parent.element.id;
|
|
1954
1991
|
var strokeWidthItems = [
|
|
@@ -1982,6 +2019,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
1982
2019
|
}
|
|
1983
2020
|
},
|
|
1984
2021
|
select: function (args) {
|
|
2022
|
+
_this.triggerTbarClickEvent(args);
|
|
1985
2023
|
spanElem.textContent = args.item.text;
|
|
1986
2024
|
parent.updateArrow('endArrow', args.item.id);
|
|
1987
2025
|
}
|
|
@@ -2180,6 +2218,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2180
2218
|
}
|
|
2181
2219
|
};
|
|
2182
2220
|
ToolbarModule.prototype.createTextBtn = function (items) {
|
|
2221
|
+
var _this = this;
|
|
2183
2222
|
var parent = this.parent;
|
|
2184
2223
|
var id = parent.element.id;
|
|
2185
2224
|
if (items.indexOf('fontFamily') > -1) {
|
|
@@ -2220,6 +2259,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2220
2259
|
}
|
|
2221
2260
|
},
|
|
2222
2261
|
select: function (args) {
|
|
2262
|
+
_this.triggerTbarClickEvent(args);
|
|
2223
2263
|
spanElem_2.textContent = args.item.text;
|
|
2224
2264
|
if (Browser.isDevice) {
|
|
2225
2265
|
spanElem_2.setAttribute('style', 'font-family:' + args.item.id);
|
|
@@ -2248,6 +2288,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2248
2288
|
args.element.querySelector('[aria-label *= ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
|
|
2249
2289
|
},
|
|
2250
2290
|
select: function (args) {
|
|
2291
|
+
_this.triggerTbarClickEvent(args);
|
|
2251
2292
|
fontSizeSpanElem_1.textContent = args.item.text;
|
|
2252
2293
|
parent.updateFontSize(args.item.text);
|
|
2253
2294
|
}
|
|
@@ -2681,6 +2722,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2681
2722
|
parent.element.querySelector('.e-template.e-pen-stroke-color').appendChild(parent.createElement('input', {
|
|
2682
2723
|
id: id + '_pen_stroke'
|
|
2683
2724
|
}));
|
|
2725
|
+
var presentVal = parent.activeObj.strokeSettings.strokeColor;
|
|
2684
2726
|
var penColor = new ColorPicker({
|
|
2685
2727
|
modeSwitcher: false, value: '#fff',
|
|
2686
2728
|
showButtons: false, mode: 'Palette', cssClass: 'e-pen-color',
|
|
@@ -2706,6 +2748,9 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2706
2748
|
}, '#' + id + '_penColorBtn');
|
|
2707
2749
|
penColor.inline = true;
|
|
2708
2750
|
penColor.value = penColor.getValue(parent.activeObj.strokeSettings.strokeColor, 'rgba');
|
|
2751
|
+
if (penColor.value === 'null') {
|
|
2752
|
+
penColor.value = presentVal;
|
|
2753
|
+
}
|
|
2709
2754
|
var obj = { tempFreeHandDrawEditingStyles: null };
|
|
2710
2755
|
parent.notify('freehand-draw', { prop: 'getTempFreeHandDrawEditingStyles', value: { obj: obj } });
|
|
2711
2756
|
var indexObj = { freehandSelectedIndex: null };
|
|
@@ -2722,6 +2767,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2722
2767
|
}
|
|
2723
2768
|
};
|
|
2724
2769
|
ToolbarModule.prototype.createPenBtn = function (items) {
|
|
2770
|
+
var _this = this;
|
|
2725
2771
|
var parent = this.parent;
|
|
2726
2772
|
var id = parent.element.id;
|
|
2727
2773
|
var strokeWidthItems = [
|
|
@@ -2754,6 +2800,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
2754
2800
|
args.element.querySelector('[aria-label = ' + '"' + activeBtn + '"' + ']').classList.add('e-selected-btn');
|
|
2755
2801
|
},
|
|
2756
2802
|
select: function (args) {
|
|
2803
|
+
_this.triggerTbarClickEvent(args);
|
|
2757
2804
|
spanElem_3.textContent = args.item.text;
|
|
2758
2805
|
parent.updatePenStrokeWidth(args.item.id);
|
|
2759
2806
|
if (Browser.isDevice) {
|
|
@@ -3033,6 +3080,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3033
3080
|
parent.element.querySelector('.e-stroke.e-template .e-dropdownbtn-preview').style.background = parent.frameObj.color;
|
|
3034
3081
|
};
|
|
3035
3082
|
ToolbarModule.prototype.createFrameSize = function () {
|
|
3083
|
+
var _this = this;
|
|
3036
3084
|
var parent = this.parent;
|
|
3037
3085
|
var prevFrameSettings;
|
|
3038
3086
|
var obj = { frameChangeEventArgs: null };
|
|
@@ -3063,6 +3111,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3063
3111
|
}
|
|
3064
3112
|
},
|
|
3065
3113
|
select: function (args) {
|
|
3114
|
+
_this.triggerTbarClickEvent(args);
|
|
3066
3115
|
prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
|
|
3067
3116
|
gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
|
|
3068
3117
|
offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
|
|
@@ -3108,6 +3157,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3108
3157
|
drpDownBtn.appendTo('#' + id + '_frameSizeBtn');
|
|
3109
3158
|
};
|
|
3110
3159
|
ToolbarModule.prototype.createFrameInset = function () {
|
|
3160
|
+
var _this = this;
|
|
3111
3161
|
var parent = this.parent;
|
|
3112
3162
|
var prevFrameSettings;
|
|
3113
3163
|
var obj = { frameChangeEventArgs: null };
|
|
@@ -3138,6 +3188,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3138
3188
|
}
|
|
3139
3189
|
},
|
|
3140
3190
|
select: function (args) {
|
|
3191
|
+
_this.triggerTbarClickEvent(args);
|
|
3141
3192
|
prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
|
|
3142
3193
|
gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
|
|
3143
3194
|
offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
|
|
@@ -3183,6 +3234,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3183
3234
|
drpDownBtn.appendTo('#' + id + '_frameInsetBtn');
|
|
3184
3235
|
};
|
|
3185
3236
|
ToolbarModule.prototype.createFrameOffset = function () {
|
|
3237
|
+
var _this = this;
|
|
3186
3238
|
var parent = this.parent;
|
|
3187
3239
|
var prevFrameSettings;
|
|
3188
3240
|
var obj = { frameChangeEventArgs: null };
|
|
@@ -3213,6 +3265,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3213
3265
|
}
|
|
3214
3266
|
},
|
|
3215
3267
|
select: function (args) {
|
|
3268
|
+
_this.triggerTbarClickEvent(args);
|
|
3216
3269
|
prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
|
|
3217
3270
|
gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
|
|
3218
3271
|
offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
|
|
@@ -3258,6 +3311,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3258
3311
|
drpDownBtn.appendTo('#' + id + '_frameOffsetBtn');
|
|
3259
3312
|
};
|
|
3260
3313
|
ToolbarModule.prototype.createFrameRadius = function () {
|
|
3314
|
+
var _this = this;
|
|
3261
3315
|
var parent = this.parent;
|
|
3262
3316
|
var prevFrameSettings;
|
|
3263
3317
|
var obj = { frameChangeEventArgs: null };
|
|
@@ -3289,6 +3343,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3289
3343
|
}
|
|
3290
3344
|
},
|
|
3291
3345
|
select: function (args) {
|
|
3346
|
+
_this.triggerTbarClickEvent(args);
|
|
3292
3347
|
prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
|
|
3293
3348
|
gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
|
|
3294
3349
|
offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
|
|
@@ -3334,6 +3389,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3334
3389
|
drpDownBtn.appendTo('#' + id + '_frameRadiusBtn');
|
|
3335
3390
|
};
|
|
3336
3391
|
ToolbarModule.prototype.createFrameAmount = function () {
|
|
3392
|
+
var _this = this;
|
|
3337
3393
|
var parent = this.parent;
|
|
3338
3394
|
var prevFrameSettings;
|
|
3339
3395
|
var obj = { frameChangeEventArgs: null };
|
|
@@ -3364,6 +3420,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3364
3420
|
}
|
|
3365
3421
|
},
|
|
3366
3422
|
select: function (args) {
|
|
3423
|
+
_this.triggerTbarClickEvent(args);
|
|
3367
3424
|
prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
|
|
3368
3425
|
gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
|
|
3369
3426
|
offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
|
|
@@ -3409,6 +3466,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3409
3466
|
drpDownBtn.appendTo('#' + id + '_frameAmountBtn');
|
|
3410
3467
|
};
|
|
3411
3468
|
ToolbarModule.prototype.createFrameBorder = function () {
|
|
3469
|
+
var _this = this;
|
|
3412
3470
|
var parent = this.parent;
|
|
3413
3471
|
var prevFrameSettings;
|
|
3414
3472
|
var obj = { frameChangeEventArgs: null };
|
|
@@ -3437,6 +3495,7 @@ var ToolbarModule = /** @class */ (function () {
|
|
|
3437
3495
|
}
|
|
3438
3496
|
},
|
|
3439
3497
|
select: function (args) {
|
|
3498
|
+
_this.triggerTbarClickEvent(args);
|
|
3440
3499
|
prevFrameSettings = { type: parent.toPascalCase(parent.frameObj.type), color: parent.frameObj.color,
|
|
3441
3500
|
gradientColor: parent.frameObj.gradientColor, size: parent.frameObj.size, inset: parent.frameObj.inset,
|
|
3442
3501
|
offset: parent.frameObj.offset, borderRadius: parent.frameObj.radius, frameLineStyle: parent.toPascalCase(parent.frameObj.border),
|