@syncfusion/ej2-image-editor 23.2.4 → 23.2.6

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 23.2.4
3
+ * version : 23.2.6
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@23.1.43",
3
+ "_id": "@syncfusion/ej2-image-editor@23.2.5",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-5GOJdoi+vGksohDCzagLur1GQpWE6ZDNsm62D4TdX6aAltWilC1Z3BgWgOt4ZnJQka37BV8iZxb0krr05wPv0Q==",
5
+ "_integrity": "sha512-4nutRixVgh8ge2ig6lyUTE0c1Ig5S6ydk2gnBNOARqpPUx12BWmYf5GU27Nr4haAh+Tv3t+1xKjwxwb9AUxxmw==",
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.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-23.1.43.tgz",
27
- "_shasum": "6bbaed2aa3e4311d0b039d348c6b4c4f40d011a6",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-image-editor/-/ej2-image-editor-23.2.5.tgz",
27
+ "_shasum": "ea1a556cf7a98fbb21ced1ea332a49c6cb2766d8",
28
28
  "_spec": "@syncfusion/ej2-image-editor@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
30
30
  "author": {
@@ -32,10 +32,10 @@
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~23.2.4",
35
+ "@syncfusion/ej2-base": "~23.2.6",
36
36
  "@syncfusion/ej2-buttons": "~23.2.4",
37
37
  "@syncfusion/ej2-inputs": "~23.2.4",
38
- "@syncfusion/ej2-navigations": "~23.2.4",
38
+ "@syncfusion/ej2-navigations": "~23.2.5",
39
39
  "@syncfusion/ej2-popups": "~23.2.4",
40
40
  "@syncfusion/ej2-splitbuttons": "~23.2.4"
41
41
  },
@@ -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": "23.2.4",
70
+ "version": "23.2.6",
71
71
  "sideEffects": false,
72
72
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
73
73
  }
@@ -143,4 +143,5 @@ export declare class Selection {
143
143
  private getRectanglePoints;
144
144
  private getTransRotationPoint;
145
145
  private getNumTextValue;
146
+ private isValueUpdated;
146
147
  }
@@ -3920,6 +3920,10 @@ var Selection = /** @class */ (function () {
3920
3920
  Selection.prototype.performEnterAction = function (e) {
3921
3921
  var parent = this.parent;
3922
3922
  if (parent.isResize) {
3923
+ var isValue = this.isValueUpdated();
3924
+ if (!isValue) {
3925
+ return;
3926
+ }
3923
3927
  var point = this.getNumTextValue();
3924
3928
  var aspectRatioElement = this.parent.element.querySelector('#' + this.parent.element.id + '_aspectratio');
3925
3929
  var blrAspRatElem = this.parent.element.querySelector('.e-ie-toolbar-aspect-ratio-btn');
@@ -3949,15 +3953,19 @@ var Selection = /** @class */ (function () {
3949
3953
  var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
3950
3954
  var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
3951
3955
  if (isNullOrUndefined(aspectRatioElement)) {
3952
- var elem = getComponent(aspectRatioHeight, 'numerictextbox');
3953
- if (aspectRatioHeight && isNullOrUndefined(elem.value)) {
3954
- elem.value = parseFloat(elem.placeholder);
3955
- aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
3956
+ if (aspectRatioHeight) {
3957
+ var elem = getComponent(aspectRatioHeight, 'numerictextbox');
3958
+ if (aspectRatioHeight && isNullOrUndefined(elem.value)) {
3959
+ elem.value = parseFloat(elem.placeholder);
3960
+ aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
3961
+ }
3956
3962
  }
3957
- elem = getComponent(aspectRatioWidth, 'numerictextbox');
3958
- if (aspectRatioWidth && isNullOrUndefined(elem.value)) {
3959
- elem.value = parseFloat(elem.placeholder);
3960
- aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
3963
+ if (aspectRatioWidth) {
3964
+ var elem = getComponent(aspectRatioWidth, 'numerictextbox');
3965
+ if (aspectRatioWidth && isNullOrUndefined(elem.value)) {
3966
+ elem.value = parseFloat(elem.placeholder);
3967
+ aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
3968
+ }
3961
3969
  }
3962
3970
  }
3963
3971
  }
@@ -4934,6 +4942,25 @@ var Selection = /** @class */ (function () {
4934
4942
  }
4935
4943
  return { x: width, y: height };
4936
4944
  };
4945
+ Selection.prototype.isValueUpdated = function () {
4946
+ var isValue = true;
4947
+ var widthElement;
4948
+ var heightElement;
4949
+ if (!isBlazor()) {
4950
+ widthElement = this.parent.element.querySelector('#' + this.parent.element.id + '_resizeWidth');
4951
+ heightElement = this.parent.element.querySelector('#' + this.parent.element.id + '_resizeHeight');
4952
+ }
4953
+ else {
4954
+ widthElement = this.parent.element.querySelector('.e-ie-toolbar-e-resize-width-input .e-numerictextbox');
4955
+ heightElement = this.parent.element.querySelector('.e-ie-toolbar-e-resize-height-input .e-numerictextbox');
4956
+ }
4957
+ if (widthElement && heightElement) {
4958
+ if (heightElement.value.replace(/,/g, '') === '' && widthElement.value.replace(/,/g, '') === '') {
4959
+ isValue = false;
4960
+ }
4961
+ }
4962
+ return isValue;
4963
+ };
4937
4964
  return Selection;
4938
4965
  }());
4939
4966
  export { Selection };
@@ -41,6 +41,7 @@ export declare class Transform {
41
41
  private updateFlipColl;
42
42
  private setDestPointsForFlipState;
43
43
  private zoomAction;
44
+ private getZoomTriggerType;
44
45
  private zoomEvent;
45
46
  private disableZoomOutBtn;
46
47
  private drawZoomImgToCanvas;
@@ -680,7 +680,9 @@ var Transform = /** @class */ (function () {
680
680
  var previousZoomFactor = parent.zoomSettings.zoomFactor - (zoomFactor * 10);
681
681
  var zoomEventArgs = { zoomPoint: zoomPoint, cancel: false, previousZoomFactor: previousZoomFactor,
682
682
  currentZoomFactor: parent.zoomSettings.zoomFactor, zoomTrigger: obj['zoomType'] };
683
- if (!parent.isCropToolbar && isBlazor() && parent.events && parent.events.zooming.hasDelegate === true) {
683
+ if (isBlazor() && !parent.isCropToolbar && parent.currentToolbar !== 'resize-toolbar' && parent.currentToolbar !== 'frame-toolbar'
684
+ && parent.events && parent.events.zooming.hasDelegate === true) {
685
+ zoomEventArgs.zoomTrigger = parseInt(this.getZoomTriggerType(zoomEventArgs.zoomTrigger));
684
686
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
685
687
  parent.dotNetRef.invokeMethodAsync('ZoomEventAsync', 'OnZoom', zoomEventArgs).then(function (args) {
686
688
  _this.zoomEvent(args, zoomFactor);
@@ -694,6 +696,18 @@ var Transform = /** @class */ (function () {
694
696
  }
695
697
  }
696
698
  };
699
+ Transform.prototype.getZoomTriggerType = function (type) {
700
+ switch (type) {
701
+ case 'MouseWheel':
702
+ return '1';
703
+ case 'Pinch':
704
+ return '2';
705
+ case 'Commands':
706
+ return '4';
707
+ default:
708
+ return '8';
709
+ }
710
+ };
697
711
  Transform.prototype.zoomEvent = function (zoomEventArgs, zoomFactor) {
698
712
  var parent = this.parent;
699
713
  if (zoomEventArgs.cancel) {
@@ -1514,7 +1528,8 @@ var Transform = /** @class */ (function () {
1514
1528
  }
1515
1529
  };
1516
1530
  Transform.prototype.getCurrentZoomFactor = function (zoomFactor) {
1517
- return (zoomFactor - this.prevZoomValue) * 0.1;
1531
+ return zoomFactor >= 1 ? (this.prevZoomValue < 1 ? (zoomFactor - this.prevZoomValue) : (zoomFactor - this.prevZoomValue) * 0.1) :
1532
+ (zoomFactor - this.prevZoomValue);
1518
1533
  };
1519
1534
  Transform.prototype.setCurrPanRegion = function (region, type, obj) {
1520
1535
  var panRegion = region;
@@ -2175,7 +2190,9 @@ var Transform = /** @class */ (function () {
2175
2190
  Transform.prototype.resizeEventHandler = function (args) {
2176
2191
  var parent = this.parent;
2177
2192
  var isRotate;
2193
+ var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
2178
2194
  var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
2195
+ var widthElem = parent.element.querySelector(".e-ie-toolbar-e-resize-width-input .e-numerictextbox");
2179
2196
  var heightElem = parent.element.querySelector(".e-ie-toolbar-e-resize-height-input .e-numerictextbox");
2180
2197
  if (args.isAspectRatio) {
2181
2198
  if (this.resizedImgAngle == null || this.resizedImgAngle !== parent.transform.degree) {
@@ -2188,10 +2205,19 @@ var Transform = /** @class */ (function () {
2188
2205
  getComponent(aspectRatioHeight, 'numerictextbox').value = Math.floor(parent.img.destHeight);
2189
2206
  aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
2190
2207
  parent.aspectHeight = Math.floor(parent.img.destHeight);
2208
+ if (aspectRatioWidth && aspectRatioWidth.value === '') {
2209
+ getComponent(aspectRatioWidth, 'numerictextbox').value = Math.floor(parent.img.destWidth);
2210
+ aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
2211
+ parent.aspectWidth = Math.floor(parent.img.destWidth);
2212
+ }
2191
2213
  }
2192
2214
  else if (heightElem) {
2193
2215
  heightElem.value = Math.floor(parent.img.destHeight).toString();
2194
2216
  parent.aspectHeight = Math.floor(parent.img.destHeight);
2217
+ if (widthElem && widthElem.value === '') {
2218
+ widthElem.value = Math.floor(parent.img.destWidth).toString();
2219
+ parent.aspectWidth = Math.floor(parent.img.destWidth);
2220
+ }
2195
2221
  }
2196
2222
  }
2197
2223
  else {
@@ -999,6 +999,7 @@ var ImageEditor = /** @class */ (function (_super) {
999
999
  this.currentFilter = '';
1000
1000
  this.tempFrameZoomLevel = null;
1001
1001
  this.cxtTbarHeight = null;
1002
+ this.aspectWidth = this.aspectHeight = null;
1002
1003
  var obj_1 = { initialZoomValue: false };
1003
1004
  this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj_1 } });
1004
1005
  if (obj_1['initialZoomValue']) {
@@ -832,13 +832,17 @@ var ToolbarModule = /** @class */ (function () {
832
832
  ToolbarModule.prototype.getResizeToolbarItem = function () {
833
833
  var toolbarItems = [];
834
834
  var isResize = this.parent.aspectWidth && this.parent.aspectHeight ? true : false;
835
+ var width = this.parent.transform.degree % 90 === 0 && this.parent.transform.degree % 180 !== 0 ?
836
+ Math.ceil(this.parent.img.srcHeight).toString() : Math.ceil(this.parent.img.srcWidth).toString();
837
+ var height = this.parent.transform.degree % 90 === 0 && this.parent.transform.degree % 180 !== 0 ?
838
+ Math.ceil(this.parent.img.srcWidth).toString() : Math.ceil(this.parent.img.srcHeight).toString();
835
839
  var spanWidth = document.createElement('span');
836
840
  spanWidth.innerHTML = this.l10n.getConstant('W');
837
841
  toolbarItems.push({ id: this.parent.element.id + '_width', cssClass: 'e-ie-resize-width', template: spanWidth, align: 'Center' });
838
842
  toolbarItems.push({ id: this.parent.element.id + '_resizeWidth', prefixIcon: 'e-icons e-anti-clock-wise',
839
843
  tooltipText: this.l10n.getConstant('Width'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
840
844
  showSpinButton: false, value: isResize ? this.parent.aspectWidth : null,
841
- placeholder: isResize ? null : Math.ceil(this.parent.img.srcWidth).toString(), format: '###.## px' })
845
+ placeholder: isResize ? null : width, format: '###.## px' })
842
846
  });
843
847
  var spanHeight = document.createElement('span');
844
848
  spanHeight.innerHTML = this.l10n.getConstant('H');
@@ -846,7 +850,7 @@ var ToolbarModule = /** @class */ (function () {
846
850
  toolbarItems.push({ id: this.parent.element.id + '_resizeHeight', prefixIcon: 'e-icons e-clock-wise',
847
851
  tooltipText: this.l10n.getConstant('Height'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
848
852
  showSpinButton: false, value: isResize ? this.parent.aspectHeight : null,
849
- placeholder: isResize ? null : Math.ceil(this.parent.img.srcHeight).toString(), format: '###.## px' })
853
+ placeholder: isResize ? null : height, format: '###.## px' })
850
854
  });
851
855
  if (!this.isAspectRatio) {
852
856
  toolbarItems.push({ id: this.parent.element.id + '_aspectratio', prefixIcon: 'e-icons e-lock', align: 'Center', tooltipText: this.l10n.getConstant('AspectRatio'), type: 'Button' });