@syncfusion/ej2-image-editor 23.2.5 → 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.
@@ -11082,6 +11082,10 @@ var Selection = /** @__PURE__ @class */ (function () {
11082
11082
  Selection.prototype.performEnterAction = function (e) {
11083
11083
  var parent = this.parent;
11084
11084
  if (parent.isResize) {
11085
+ var isValue = this.isValueUpdated();
11086
+ if (!isValue) {
11087
+ return;
11088
+ }
11085
11089
  var point = this.getNumTextValue();
11086
11090
  var aspectRatioElement = this.parent.element.querySelector('#' + this.parent.element.id + '_aspectratio');
11087
11091
  var blrAspRatElem = this.parent.element.querySelector('.e-ie-toolbar-aspect-ratio-btn');
@@ -11111,15 +11115,19 @@ var Selection = /** @__PURE__ @class */ (function () {
11111
11115
  var aspectRatioHeight = parent.element.querySelector('#' + parent.element.id + '_resizeHeight');
11112
11116
  var aspectRatioWidth = parent.element.querySelector('#' + parent.element.id + '_resizeWidth');
11113
11117
  if (isNullOrUndefined(aspectRatioElement)) {
11114
- var elem = getComponent(aspectRatioHeight, 'numerictextbox');
11115
- if (aspectRatioHeight && isNullOrUndefined(elem.value)) {
11116
- elem.value = parseFloat(elem.placeholder);
11117
- aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
11118
- }
11119
- elem = getComponent(aspectRatioWidth, 'numerictextbox');
11120
- if (aspectRatioWidth && isNullOrUndefined(elem.value)) {
11121
- elem.value = parseFloat(elem.placeholder);
11122
- aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
11118
+ if (aspectRatioHeight) {
11119
+ var elem = getComponent(aspectRatioHeight, 'numerictextbox');
11120
+ if (aspectRatioHeight && isNullOrUndefined(elem.value)) {
11121
+ elem.value = parseFloat(elem.placeholder);
11122
+ aspectRatioHeight.value = Math.floor(parent.img.destHeight).toString() + ' px';
11123
+ }
11124
+ }
11125
+ if (aspectRatioWidth) {
11126
+ var elem = getComponent(aspectRatioWidth, 'numerictextbox');
11127
+ if (aspectRatioWidth && isNullOrUndefined(elem.value)) {
11128
+ elem.value = parseFloat(elem.placeholder);
11129
+ aspectRatioWidth.value = Math.floor(parent.img.destWidth).toString() + ' px';
11130
+ }
11123
11131
  }
11124
11132
  }
11125
11133
  }
@@ -12096,6 +12104,25 @@ var Selection = /** @__PURE__ @class */ (function () {
12096
12104
  }
12097
12105
  return { x: width, y: height };
12098
12106
  };
12107
+ Selection.prototype.isValueUpdated = function () {
12108
+ var isValue = true;
12109
+ var widthElement;
12110
+ var heightElement;
12111
+ if (!isBlazor()) {
12112
+ widthElement = this.parent.element.querySelector('#' + this.parent.element.id + '_resizeWidth');
12113
+ heightElement = this.parent.element.querySelector('#' + this.parent.element.id + '_resizeHeight');
12114
+ }
12115
+ else {
12116
+ widthElement = this.parent.element.querySelector('.e-ie-toolbar-e-resize-width-input .e-numerictextbox');
12117
+ heightElement = this.parent.element.querySelector('.e-ie-toolbar-e-resize-height-input .e-numerictextbox');
12118
+ }
12119
+ if (widthElement && heightElement) {
12120
+ if (heightElement.value.replace(/,/g, '') === '' && widthElement.value.replace(/,/g, '') === '') {
12121
+ isValue = false;
12122
+ }
12123
+ }
12124
+ return isValue;
12125
+ };
12099
12126
  return Selection;
12100
12127
  }());
12101
12128
 
@@ -16634,7 +16661,8 @@ var Transform = /** @__PURE__ @class */ (function () {
16634
16661
  }
16635
16662
  };
16636
16663
  Transform.prototype.getCurrentZoomFactor = function (zoomFactor) {
16637
- return (zoomFactor - this.prevZoomValue) * 0.1;
16664
+ return zoomFactor >= 1 ? (this.prevZoomValue < 1 ? (zoomFactor - this.prevZoomValue) : (zoomFactor - this.prevZoomValue) * 0.1) :
16665
+ (zoomFactor - this.prevZoomValue);
16638
16666
  };
16639
16667
  Transform.prototype.setCurrPanRegion = function (region, type, obj) {
16640
16668
  var panRegion = region;
@@ -19281,6 +19309,7 @@ var ImageEditor = /** @__PURE__ @class */ (function (_super) {
19281
19309
  this.currentFilter = '';
19282
19310
  this.tempFrameZoomLevel = null;
19283
19311
  this.cxtTbarHeight = null;
19312
+ this.aspectWidth = this.aspectHeight = null;
19284
19313
  var obj_1 = { initialZoomValue: false };
19285
19314
  this.notify('draw', { prop: 'getInitialZoomValue', onPropertyChange: false, value: { obj: obj_1 } });
19286
19315
  if (obj_1['initialZoomValue']) {
@@ -22414,13 +22443,17 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
22414
22443
  ToolbarModule.prototype.getResizeToolbarItem = function () {
22415
22444
  var toolbarItems = [];
22416
22445
  var isResize = this.parent.aspectWidth && this.parent.aspectHeight ? true : false;
22446
+ var width = this.parent.transform.degree % 90 === 0 && this.parent.transform.degree % 180 !== 0 ?
22447
+ Math.ceil(this.parent.img.srcHeight).toString() : Math.ceil(this.parent.img.srcWidth).toString();
22448
+ var height = this.parent.transform.degree % 90 === 0 && this.parent.transform.degree % 180 !== 0 ?
22449
+ Math.ceil(this.parent.img.srcWidth).toString() : Math.ceil(this.parent.img.srcHeight).toString();
22417
22450
  var spanWidth = document.createElement('span');
22418
22451
  spanWidth.innerHTML = this.l10n.getConstant('W');
22419
22452
  toolbarItems.push({ id: this.parent.element.id + '_width', cssClass: 'e-ie-resize-width', template: spanWidth, align: 'Center' });
22420
22453
  toolbarItems.push({ id: this.parent.element.id + '_resizeWidth', prefixIcon: 'e-icons e-anti-clock-wise',
22421
22454
  tooltipText: this.l10n.getConstant('Width'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
22422
22455
  showSpinButton: false, value: isResize ? this.parent.aspectWidth : null,
22423
- placeholder: isResize ? null : Math.ceil(this.parent.img.srcWidth).toString(), format: '###.## px' })
22456
+ placeholder: isResize ? null : width, format: '###.## px' })
22424
22457
  });
22425
22458
  var spanHeight = document.createElement('span');
22426
22459
  spanHeight.innerHTML = this.l10n.getConstant('H');
@@ -22428,7 +22461,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
22428
22461
  toolbarItems.push({ id: this.parent.element.id + '_resizeHeight', prefixIcon: 'e-icons e-clock-wise',
22429
22462
  tooltipText: this.l10n.getConstant('Height'), align: 'Center', type: 'Input', template: new NumericTextBox({ width: 75, htmlAttributes: { maxLength: "4" },
22430
22463
  showSpinButton: false, value: isResize ? this.parent.aspectHeight : null,
22431
- placeholder: isResize ? null : Math.ceil(this.parent.img.srcHeight).toString(), format: '###.## px' })
22464
+ placeholder: isResize ? null : height, format: '###.## px' })
22432
22465
  });
22433
22466
  if (!this.isAspectRatio) {
22434
22467
  toolbarItems.push({ id: this.parent.element.id + '_aspectratio', prefixIcon: 'e-icons e-lock', align: 'Center', tooltipText: this.l10n.getConstant('AspectRatio'), type: 'Button' });