@syncfusion/ej2-image-editor 23.1.39 → 23.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15254,7 +15254,8 @@ class Transform {
15254
15254
  parent.rotateFlipColl = obj['collection'];
15255
15255
  if (parent.cropObj.activeObj.shape && !this.isPreventSelect) {
15256
15256
  this.isPreventSelect = true;
15257
- parent.select('custom');
15257
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
15258
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
15258
15259
  this.isPreventSelect = false;
15259
15260
  parent.setProperties({ zoomSettings: { zoomFactor: 1 } }, true);
15260
15261
  this.prevZoomValue = parent.zoomSettings.zoomFactor;
@@ -15520,7 +15521,8 @@ class Transform {
15520
15521
  parent.rotateFlipColl = obj['collection'];
15521
15522
  if (parent.cropObj.activeObj.shape && !this.isPreventSelect) {
15522
15523
  this.isPreventSelect = true;
15523
- parent.select('custom');
15524
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
15525
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
15524
15526
  this.isPreventSelect = false;
15525
15527
  parent.setProperties({ zoomSettings: { zoomFactor: 1 } }, true);
15526
15528
  this.prevZoomValue = parent.zoomSettings.zoomFactor;
@@ -17069,13 +17071,17 @@ class Transform {
17069
17071
  }
17070
17072
  else if (parent.img.srcWidth === parent.baseImgCanvas.width && parent.img.srcHeight === parent.baseImgCanvas.height) {
17071
17073
  parent.currSelectionPoint = null;
17072
- parent.select('custom');
17074
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
17075
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
17073
17076
  }
17074
17077
  if (isNullOrUndefined(parent.currSelectionPoint)) {
17075
- parent.select('custom', parent.img.destLeft, parent.img.destTop, parent.img.destWidth, parent.img.destHeight);
17078
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
17079
+ value: { type: 'custom', startX: parent.img.destLeft, startY: parent.img.destTop,
17080
+ width: parent.img.destWidth, height: parent.img.destHeight } });
17076
17081
  }
17077
17082
  else {
17078
- parent.select('custom');
17083
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
17084
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
17079
17085
  }
17080
17086
  width = parent.activeObj.activePoint.width * widthRatio;
17081
17087
  height = parent.activeObj.activePoint.height * heightRatio;
@@ -17083,7 +17089,8 @@ class Transform {
17083
17089
  const sy = (parent.activeObj.activePoint.startY + (parent.activeObj.activePoint.height / 2)) - (height / 2);
17084
17090
  parent.transform.defaultZoomFactor = 0;
17085
17091
  parent.notify('draw', { prop: 'setResizeSelect', value: { bool: true } });
17086
- parent.select('custom', sx, sy, width, height);
17092
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
17093
+ value: { type: 'custom', startX: sx, startY: sy, width: width, height: height } });
17087
17094
  parent.notify('draw', { prop: 'setResizeSelect', value: { bool: false } });
17088
17095
  parent.isCropToolbar = true;
17089
17096
  parent.crop();
@@ -17548,7 +17555,8 @@ class UndoRedo {
17548
17555
  }
17549
17556
  }
17550
17557
  parent.updateCropTransformItems();
17551
- parent.select('custom');
17558
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
17559
+ value: { type: 'custom', startX: null, startY: null, width: null, height: null } });
17552
17560
  if (parent.isCircleCrop) {
17553
17561
  parent.isCircleCrop = false;
17554
17562
  this.tempCurrSelPoint = extend({}, parent.currSelectionPoint, {}, true);
@@ -18395,6 +18403,7 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18395
18403
  * @private
18396
18404
  */
18397
18405
  onPropertyChanged(newProperties, oldProperties) {
18406
+ let indexObj;
18398
18407
  for (const prop of Object.keys(newProperties)) {
18399
18408
  switch (prop) {
18400
18409
  case 'cssClass':
@@ -18417,9 +18426,11 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18417
18426
  break;
18418
18427
  case 'height':
18419
18428
  this.element.style.height = newProperties.height;
18429
+ this.update();
18420
18430
  break;
18421
18431
  case 'width':
18422
18432
  this.element.style.width = newProperties.width;
18433
+ this.update();
18423
18434
  break;
18424
18435
  case 'theme':
18425
18436
  if (newProperties.theme) {
@@ -18431,6 +18442,13 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18431
18442
  }
18432
18443
  this.upperContext.strokeStyle = this.themeColl[this.theme]['primaryColor'];
18433
18444
  this.upperContext.fillStyle = this.themeColl[this.theme]['secondaryColor'];
18445
+ if (isBlazor()) {
18446
+ this.updateToolbar(this.element, 'imageLoaded');
18447
+ }
18448
+ else {
18449
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
18450
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
18451
+ }
18434
18452
  }
18435
18453
  break;
18436
18454
  case 'finetuneSettings':
@@ -18442,8 +18460,13 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18442
18460
  case 'locale':
18443
18461
  if (newProperties.locale) {
18444
18462
  this.notify('toolbar', { prop: 'setLocale', onPropertyChange: false, value: { locale: newProperties.locale } });
18445
- this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
18446
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
18463
+ if (isBlazor()) {
18464
+ this.updateToolbar(this.element, 'imageLoaded');
18465
+ }
18466
+ else {
18467
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
18468
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
18469
+ }
18447
18470
  }
18448
18471
  break;
18449
18472
  case 'allowUndoRedo':
@@ -18453,18 +18476,47 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18453
18476
  else {
18454
18477
  this.allowUndoRedo = false;
18455
18478
  }
18456
- this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
18457
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
18479
+ if (isBlazor()) {
18480
+ this.updateToolbar(this.element, 'imageLoaded');
18481
+ }
18482
+ else {
18483
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
18484
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
18485
+ }
18458
18486
  break;
18459
18487
  case 'showQuickAccessToolbar':
18460
18488
  if (newProperties.showQuickAccessToolbar) {
18461
18489
  this.showQuickAccessToolbar = true;
18462
- this.notify('toolbar', { prop: 'create-qa-toolbar', onPropertyChange: false });
18463
- this.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
18490
+ if (!isBlazor()) {
18491
+ this.notify('toolbar', { prop: 'create-qa-toolbar', onPropertyChange: false });
18492
+ }
18493
+ indexObj = { freehandSelectedIndex: null };
18494
+ this.notify('freehand-draw', { prop: 'getFreehandSelectedIndex', onPropertyChange: false, value: { obj: indexObj } });
18495
+ if (this.activeObj.shape) {
18496
+ if (isBlazor()) {
18497
+ this.updateToolbar(this.element, 'quickAccessToolbar', this.activeObj.shape);
18498
+ }
18499
+ else {
18500
+ this.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: null } });
18501
+ }
18502
+ }
18503
+ else if (indexObj['freehandSelectedIndex']) {
18504
+ if (isBlazor()) {
18505
+ this.updateToolbar(this.element, 'quickAccessToolbar', 'pen');
18506
+ }
18507
+ else {
18508
+ this.notify('toolbar', { prop: 'renderQAT', onPropertyChange: false, value: { isPenEdit: true } });
18509
+ }
18510
+ }
18464
18511
  }
18465
18512
  else {
18466
18513
  this.showQuickAccessToolbar = false;
18467
- this.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
18514
+ if (isBlazor()) {
18515
+ this.updateToolbar(this.element, 'destroyQuickAccessToolbar');
18516
+ }
18517
+ else {
18518
+ this.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
18519
+ }
18468
18520
  }
18469
18521
  break;
18470
18522
  case 'zoomSettings':
@@ -18474,12 +18526,22 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18474
18526
  if (isNullOrUndefined(this.zoomSettings.zoomTrigger)) {
18475
18527
  this.zoomSettings.zoomTrigger = (ZoomTrigger.MouseWheel | ZoomTrigger.Pinch | ZoomTrigger.Toolbar |
18476
18528
  ZoomTrigger.Commands);
18477
- this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
18478
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
18529
+ if (isBlazor()) {
18530
+ this.updateToolbar(this.element, 'imageLoaded');
18531
+ }
18532
+ else {
18533
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
18534
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
18535
+ }
18479
18536
  }
18480
18537
  else if ((newProperties.zoomSettings.zoomTrigger & ZoomTrigger.Toolbar) === ZoomTrigger.Toolbar) {
18481
- this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
18482
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
18538
+ if (isBlazor()) {
18539
+ this.updateToolbar(this.element, 'imageLoaded');
18540
+ }
18541
+ else {
18542
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
18543
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
18544
+ }
18483
18545
  }
18484
18546
  break;
18485
18547
  case 'selectionSettings':
@@ -18491,6 +18553,38 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18491
18553
  }
18492
18554
  }
18493
18555
  break;
18556
+ case 'toolbar':
18557
+ if (newProperties.toolbar) {
18558
+ this.toolbar = newProperties.toolbar;
18559
+ if (isBlazor()) {
18560
+ this.updateToolbar(this.element, 'imageLoaded');
18561
+ }
18562
+ else {
18563
+ this.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'main',
18564
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
18565
+ }
18566
+ }
18567
+ break;
18568
+ case 'toolbarTemplate':
18569
+ if (newProperties.toolbarTemplate) {
18570
+ if (!isBlazor()) {
18571
+ this.notify('toolbar', { prop: 'destroy-bottom-toolbar', onPropertyChange: false });
18572
+ this.notify('toolbar', { prop: 'destroy-top-toolbar', onPropertyChange: false });
18573
+ this.element.appendChild(this.createElement('div', {
18574
+ id: this.element.id + '_toolbarArea', className: 'e-toolbar-area'
18575
+ }));
18576
+ this.toolbarTemplateFn();
18577
+ }
18578
+ }
18579
+ break;
18580
+ case 'quickAccessToolbarTemplate':
18581
+ if (newProperties.quickAccessToolbarTemplate) {
18582
+ if (!isBlazor()) {
18583
+ this.notify('toolbar', { prop: 'destroy-qa-toolbar', onPropertyChange: false });
18584
+ this.quickAccessToolbarTemplateFn();
18585
+ }
18586
+ }
18587
+ break;
18494
18588
  }
18495
18589
  }
18496
18590
  }
@@ -18574,15 +18668,20 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18574
18668
  const uploadObj = new Uploader({
18575
18669
  dropArea: document.getElementsByClassName('e-canvas-wrapper')[0],
18576
18670
  allowedExtensions: '.jpg, .jpeg, .png,.svg',
18671
+ multiple: false,
18577
18672
  selected: (args) => {
18578
18673
  if (args.event.type === 'change' || args.event.type === 'drop') {
18579
18674
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
18580
18675
  const type = args.filesData[0].type;
18581
- if (type === 'png' || type === 'jpg' || type === 'jpeg' || type === 'svg') {
18676
+ let errType = 'unsupported';
18677
+ if ((args.event.type === 'change' || (args.event.type === 'drop' && args.event.dataTransfer.files.length === 1)) && (type === 'png' || type === 'jpg' || type === 'jpeg' || type === 'svg')) {
18582
18678
  this.notify('draw', { prop: 'fileSelect', value: { inputElement: this.element.querySelector('#' + this.element.id + '_dropfileUpload'), args: args } });
18583
18679
  }
18584
18680
  else {
18585
- this.showDialogPopup();
18681
+ if (args.event.type === 'drop' && args.event.dataTransfer.files.length > 1) {
18682
+ errType = 'multi-select-image';
18683
+ }
18684
+ this.showDialogPopup(errType);
18586
18685
  }
18587
18686
  }
18588
18687
  }
@@ -18592,20 +18691,39 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
18592
18691
  dlgCloseBtnClick() {
18593
18692
  getComponent(document.getElementById(this.element.id + '_dialog'), 'dialog').destroy();
18594
18693
  }
18595
- showDialogPopup() {
18694
+ /**
18695
+ * Show dialog popup for unsupported files.
18696
+ *
18697
+ * @param { string } type - Specifies the type of error.
18698
+ * @hidden
18699
+ * @returns {void}.
18700
+ */
18701
+ showDialogPopup(type) {
18702
+ let content = '';
18596
18703
  this.element.querySelector('#' + this.element.id + '_dialog').style.display = 'block';
18597
- const headerObj = { key: 'AlertDialogHeader' };
18598
- this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: headerObj } });
18599
- const contentObj = { key: 'AlertDialogContent' };
18600
- this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: contentObj } });
18601
- const supportObj = { key: 'SupportText' };
18602
- this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: supportObj } });
18704
+ let headerObj;
18603
18705
  const okObj = { key: 'OK' };
18604
18706
  this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: okObj } });
18707
+ if (type === 'multi-select-image') {
18708
+ headerObj = { key: 'ImageErrorDialogHeader' };
18709
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: headerObj } });
18710
+ const contentObj = { key: 'ImageErrorDialogContent' };
18711
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: contentObj } });
18712
+ content = '<span>' + contentObj['value'] + '</span>';
18713
+ }
18714
+ else {
18715
+ headerObj = { key: 'AlertDialogHeader' };
18716
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: headerObj } });
18717
+ const contentObj = { key: 'AlertDialogContent' };
18718
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: contentObj } });
18719
+ const supportObj = { key: 'SupportText' };
18720
+ this.notify('toolbar', { prop: 'getLocaleText', onPropertyChange: false, value: { obj: supportObj } });
18721
+ content = '<span>' + contentObj['value'] + ' ' + supportObj['value'] + '<b> JPG, PNG, and SVG</b></span>';
18722
+ }
18605
18723
  const dialog = new Dialog({
18606
18724
  header: headerObj['value'],
18607
18725
  closeOnEscape: true,
18608
- content: '<span>' + contentObj['value'] + ' ' + supportObj['value'] + '<b> JPG, PNG, and SVG</b></span>',
18726
+ content: content,
18609
18727
  target: document.getElementById('target'),
18610
18728
  width: '285px',
18611
18729
  isModal: true,
@@ -19050,6 +19168,8 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
19050
19168
  select(type, startX, startY, width, height) {
19051
19169
  this.notify('draw', { prop: 'select', onPropertyChange: false,
19052
19170
  value: { type: type, startX: startX, startY: startY, width: width, height: height } });
19171
+ this.notify('draw', { prop: 'select', onPropertyChange: false,
19172
+ value: { type: type, startX: startX, startY: startY, width: width, height: height } });
19053
19173
  }
19054
19174
  /**
19055
19175
  * Enable or disable a freehand drawing option in an Image Editor.
@@ -19471,11 +19591,19 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
19471
19591
  */
19472
19592
  drawFrame(frameType, color, gradientColor, size, inset, offset, borderRadius, frameLineStyle, lineCount) {
19473
19593
  let isFrame = false;
19474
- let obj = { frameChangeEventArgs: null };
19594
+ const obj = { frameChangeEventArgs: null };
19595
+ color = color ? color : '#fff';
19596
+ gradientColor = gradientColor ? gradientColor : '';
19597
+ size = size ? size : 20;
19598
+ inset = inset ? inset : 0;
19599
+ offset = offset ? offset : 0;
19600
+ borderRadius = borderRadius ? borderRadius : 0;
19601
+ frameLineStyle = frameLineStyle ? frameLineStyle : FrameLineStyle.Solid;
19602
+ lineCount = lineCount ? lineCount : 0;
19475
19603
  const prevFrameSettings = { type: this.toPascalCase(this.frameObj.type), color: this.frameObj.color,
19476
19604
  gradientColor: this.frameObj.gradientColor, size: this.frameObj.size, inset: this.frameObj.inset,
19477
- offset: this.frameObj.offset, borderRadius: this.frameObj.radius, frameLineStyle: this.toPascalCase(this.frameObj.border),
19478
- lineCount: this.frameObj.amount };
19605
+ offset: this.frameObj.offset, borderRadius: this.frameObj.radius,
19606
+ frameLineStyle: this.toPascalCase(this.frameObj.border), lineCount: this.frameObj.amount };
19479
19607
  extend(this.tempFrameObj, this.frameObj);
19480
19608
  this.tempFrameZoomLevel = this.transform.zoomFactor;
19481
19609
  this.frameDestPoints = extend({}, this.img, {}, true);
@@ -19483,6 +19611,7 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends Component {
19483
19611
  this.notify('toolbar', { prop: 'frameToolbarClick' });
19484
19612
  }
19485
19613
  else {
19614
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19486
19615
  this.performFrameClick();
19487
19616
  }
19488
19617
  this.frameObj.type = frameType.toLowerCase();
@@ -21416,7 +21545,9 @@ class ToolbarModule {
21416
21545
  AlertDialogHeader: 'Unsupported file',
21417
21546
  AlertDialogContent: 'The dropped file is unsupported.',
21418
21547
  Yes: 'Yes',
21419
- No: 'No'
21548
+ No: 'No',
21549
+ ImageErrorDialogHeader: 'Image Selection Error',
21550
+ ImageErrorDialogContent: 'Please select only one image to open.'
21420
21551
  };
21421
21552
  this.l10n = new L10n('image-editor', this.defaultLocale, this.parent.locale);
21422
21553
  }
@@ -21625,7 +21756,7 @@ class ToolbarModule {
21625
21756
  id: parent.element.id + '_toolbarArea', className: 'e-toolbar-area'
21626
21757
  }));
21627
21758
  const toolbarItems = { cssClass: 'e-image-upload', align: 'Left', type: 'Input',
21628
- tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg' }) };
21759
+ tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg', multiple: false }) };
21629
21760
  if (isNullOrUndefined(this.defToolbarItems)) {
21630
21761
  this.defToolbarItems = [];
21631
21762
  }
@@ -21642,6 +21773,7 @@ class ToolbarModule {
21642
21773
  tooltipText: this.l10n.getConstant('Browse'),
21643
21774
  template: new Uploader({
21644
21775
  allowedExtensions: '.jpg, .jpeg, .png,.svg',
21776
+ multiple: false,
21645
21777
  selected: () => {
21646
21778
  if (!parent.disabled) {
21647
21779
  if (Browser.isDevice) {
@@ -21715,7 +21847,7 @@ class ToolbarModule {
21715
21847
  const parent = this.parent;
21716
21848
  if (parent.showQuickAccessToolbar) {
21717
21849
  const toolbarItems = { cssClass: 'e-image-upload', align: 'Left', type: 'Input',
21718
- tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg' }) };
21850
+ tooltipText: this.l10n.getConstant('Browse'), template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg', multiple: false }) };
21719
21851
  if (isNullOrUndefined(this.defToolbarItems)) {
21720
21852
  this.defToolbarItems = [];
21721
21853
  }
@@ -21800,7 +21932,7 @@ class ToolbarModule {
21800
21932
  const parent = this.parent;
21801
21933
  const toolbarItems = [];
21802
21934
  if (!isOkBtn || isResize) {
21803
- toolbarItems.push({ id: parent.element.id + '_upload', cssClass: 'e-image-upload', align: 'Left', type: 'Input', template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg' }) });
21935
+ toolbarItems.push({ id: parent.element.id + '_upload', cssClass: 'e-image-upload', align: 'Left', type: 'Input', template: new Uploader({ allowedExtensions: '.jpg, .jpeg, .png,.svg', multiple: false }) });
21804
21936
  toolbarItems.push({ visible: false, cssClass: 'e-image-position e-btn e-flat', tooltipText: this.l10n.getConstant('Browse'), align: 'Left' });
21805
21937
  }
21806
21938
  if (parent.allowUndoRedo && !isResize) {
@@ -22225,7 +22357,13 @@ class ToolbarModule {
22225
22357
  }
22226
22358
  }
22227
22359
  fileSelect(inputElement, args) {
22228
- this.parent.notify('draw', { prop: 'fileSelect', value: { inputElement: inputElement, args: args } });
22360
+ const type = inputElement.files[0].type.split('/')[1];
22361
+ if (type === 'png' || type === 'jpg' || type === 'jpeg' || type === 'svg') {
22362
+ this.parent.notify('draw', { prop: 'fileSelect', value: { inputElement: inputElement, args: args } });
22363
+ }
22364
+ else {
22365
+ this.parent.showDialogPopup();
22366
+ }
22229
22367
  }
22230
22368
  renderAnnotationBtn(isContextualToolbar) {
22231
22369
  const parent = this.parent;
@@ -22628,7 +22766,9 @@ class ToolbarModule {
22628
22766
  }
22629
22767
  }
22630
22768
  if (document.getElementById(parent.element.id + '_cropBtn')) {
22631
- parent.select(document.getElementById(parent.element.id + '_cropBtn').textContent.toLowerCase());
22769
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
22770
+ value: { type: document.getElementById(parent.element.id + '_cropBtn').textContent.toLowerCase(),
22771
+ startX: null, startY: null, width: null, height: null } });
22632
22772
  }
22633
22773
  }
22634
22774
  });
@@ -24537,7 +24677,8 @@ class ToolbarModule {
24537
24677
  const text = args.item.id;
24538
24678
  this.currentToolbar = 'crop';
24539
24679
  parent.currSelectionPoint = null;
24540
- parent.select(text);
24680
+ parent.notify('draw', { prop: 'select', onPropertyChange: false,
24681
+ value: { type: text, startX: null, startY: null, width: null, height: null } });
24541
24682
  this.enableDisableTbrBtn();
24542
24683
  parent.notify('transform', { prop: 'disableZoomOutBtn', value: { isZoomOut: true } });
24543
24684
  }