@progress/kendo-angular-editor 2.4.1-dev.202110221203 → 2.4.1-dev.202110261541

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.
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-editor',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1634903968,
12
+ publishDate: 1635262687,
13
13
  version: '',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
15
15
  };
@@ -27,7 +27,7 @@ const packageMetadata = {
27
27
  name: '@progress/kendo-angular-editor',
28
28
  productName: 'Kendo UI for Angular',
29
29
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
30
- publishDate: 1634903968,
30
+ publishDate: 1635262687,
31
31
  version: '',
32
32
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
33
33
  };
@@ -2721,19 +2721,19 @@ let EditorComponent = EditorComponent_1 = class EditorComponent {
2721
2721
  }
2722
2722
  get minWidth() {
2723
2723
  const resizableOptions = this.resizable;
2724
- return resizableOptions.minWidth;
2724
+ return resizableOptions.minWidth ? resizableOptions.minWidth + 'px' : undefined;
2725
2725
  }
2726
2726
  get maxWidth() {
2727
2727
  const resizableOptions = this.resizable;
2728
- return resizableOptions.maxWidth;
2728
+ return resizableOptions.maxWidth ? resizableOptions.maxWidth + 'px' : undefined;
2729
2729
  }
2730
2730
  get minHeight() {
2731
2731
  const resizableOptions = this.resizable;
2732
- return resizableOptions.minHeight;
2732
+ return resizableOptions.minHeight ? resizableOptions.minHeight + 'px' : undefined;
2733
2733
  }
2734
2734
  get maxHeight() {
2735
2735
  const resizableOptions = this.resizable;
2736
- return resizableOptions.maxHeight;
2736
+ return resizableOptions.maxHeight ? resizableOptions.maxHeight + 'px' : undefined;
2737
2737
  }
2738
2738
  get toolbar() {
2739
2739
  return this.defaultToolbarComponent || this.userToolBarComponent;
@@ -2761,11 +2761,17 @@ let EditorComponent = EditorComponent_1 = class EditorComponent {
2761
2761
  if (!this.iframe) {
2762
2762
  this.contentAreaLoaded.next();
2763
2763
  }
2764
+ if (this.resizable) {
2765
+ this.normalizeSize();
2766
+ }
2764
2767
  }
2765
2768
  ngOnChanges(changes) {
2766
2769
  if (changes.iframe && !changes.iframe.isFirstChange()) {
2767
2770
  this.ngZone.onStable.pipe(take(1)).subscribe(() => this.initialize());
2768
2771
  }
2772
+ if (changes.resizable && !changes.resizable.isFirstChange()) {
2773
+ this.normalizeSize();
2774
+ }
2769
2775
  }
2770
2776
  /**
2771
2777
  * @hidden
@@ -2924,6 +2930,9 @@ let EditorComponent = EditorComponent_1 = class EditorComponent {
2924
2930
  if (this.subs) {
2925
2931
  this.subs.unsubscribe();
2926
2932
  }
2933
+ if (this._styleObserver) {
2934
+ this._styleObserver.disconnect();
2935
+ }
2927
2936
  }
2928
2937
  /**
2929
2938
  * @hidden
@@ -3103,6 +3112,47 @@ let EditorComponent = EditorComponent_1 = class EditorComponent {
3103
3112
  .pipe(filter((event) => !this.viewMountElement.contains(event.relatedTarget)))
3104
3113
  .subscribe(() => this.onTouchedCallback()));
3105
3114
  }
3115
+ normalizeSize() {
3116
+ if (typeof this.resizable === 'object' && !this._styleObserver) {
3117
+ const element = this.element.nativeElement;
3118
+ this._styleObserver = new MutationObserver(() => {
3119
+ this.ngZone.runOutsideAngular(() => this.normalizeProperties(element));
3120
+ });
3121
+ this._styleObserver.observe(element, { attributeFilter: ['style'] });
3122
+ }
3123
+ }
3124
+ normalizeProperties(element) {
3125
+ const props = Object.keys(this.resizable);
3126
+ const pixelWidth = parseInt(element.style.width, 10);
3127
+ const pixelHeight = parseInt(element.style.height, 10);
3128
+ const resizable = this.resizable;
3129
+ props.forEach(prop => {
3130
+ const isMinProp = prop.startsWith('min');
3131
+ const isMaxProp = !isMinProp;
3132
+ const isWidthProp = prop.endsWith('Width');
3133
+ const isHeightProp = !isWidthProp;
3134
+ if (isMinProp && isWidthProp) {
3135
+ if (pixelWidth < resizable.minWidth) {
3136
+ element.style.width = resizable.minWidth + 'px';
3137
+ }
3138
+ }
3139
+ else if (isMinProp && isHeightProp) {
3140
+ if (pixelHeight < resizable.minHeight) {
3141
+ element.style.height = resizable.minHeight + 'px';
3142
+ }
3143
+ }
3144
+ else if (isMaxProp && isWidthProp) {
3145
+ if (pixelWidth > resizable.maxWidth) {
3146
+ element.style.width = resizable.maxWidth + 'px';
3147
+ }
3148
+ }
3149
+ else {
3150
+ if (pixelHeight > resizable.maxHeight) {
3151
+ element.style.height = resizable.maxHeight + 'px';
3152
+ }
3153
+ }
3154
+ });
3155
+ }
3106
3156
  };
3107
3157
  __decorate([
3108
3158
  Input(),
@@ -27,7 +27,7 @@ var packageMetadata = {
27
27
  name: '@progress/kendo-angular-editor',
28
28
  productName: 'Kendo UI for Angular',
29
29
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
30
- publishDate: 1634903968,
30
+ publishDate: 1635262687,
31
31
  version: '',
32
32
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
33
33
  };
@@ -2586,7 +2586,7 @@ var EditorComponent = /** @class */ (function () {
2586
2586
  Object.defineProperty(EditorComponent.prototype, "minWidth", {
2587
2587
  get: function () {
2588
2588
  var resizableOptions = this.resizable;
2589
- return resizableOptions.minWidth;
2589
+ return resizableOptions.minWidth ? resizableOptions.minWidth + 'px' : undefined;
2590
2590
  },
2591
2591
  enumerable: true,
2592
2592
  configurable: true
@@ -2594,7 +2594,7 @@ var EditorComponent = /** @class */ (function () {
2594
2594
  Object.defineProperty(EditorComponent.prototype, "maxWidth", {
2595
2595
  get: function () {
2596
2596
  var resizableOptions = this.resizable;
2597
- return resizableOptions.maxWidth;
2597
+ return resizableOptions.maxWidth ? resizableOptions.maxWidth + 'px' : undefined;
2598
2598
  },
2599
2599
  enumerable: true,
2600
2600
  configurable: true
@@ -2602,7 +2602,7 @@ var EditorComponent = /** @class */ (function () {
2602
2602
  Object.defineProperty(EditorComponent.prototype, "minHeight", {
2603
2603
  get: function () {
2604
2604
  var resizableOptions = this.resizable;
2605
- return resizableOptions.minHeight;
2605
+ return resizableOptions.minHeight ? resizableOptions.minHeight + 'px' : undefined;
2606
2606
  },
2607
2607
  enumerable: true,
2608
2608
  configurable: true
@@ -2610,7 +2610,7 @@ var EditorComponent = /** @class */ (function () {
2610
2610
  Object.defineProperty(EditorComponent.prototype, "maxHeight", {
2611
2611
  get: function () {
2612
2612
  var resizableOptions = this.resizable;
2613
- return resizableOptions.maxHeight;
2613
+ return resizableOptions.maxHeight ? resizableOptions.maxHeight + 'px' : undefined;
2614
2614
  },
2615
2615
  enumerable: true,
2616
2616
  configurable: true
@@ -2655,12 +2655,18 @@ var EditorComponent = /** @class */ (function () {
2655
2655
  if (!this.iframe) {
2656
2656
  this.contentAreaLoaded.next();
2657
2657
  }
2658
+ if (this.resizable) {
2659
+ this.normalizeSize();
2660
+ }
2658
2661
  };
2659
2662
  EditorComponent.prototype.ngOnChanges = function (changes) {
2660
2663
  var _this = this;
2661
2664
  if (changes.iframe && !changes.iframe.isFirstChange()) {
2662
2665
  this.ngZone.onStable.pipe(take(1)).subscribe(function () { return _this.initialize(); });
2663
2666
  }
2667
+ if (changes.resizable && !changes.resizable.isFirstChange()) {
2668
+ this.normalizeSize();
2669
+ }
2664
2670
  };
2665
2671
  /**
2666
2672
  * @hidden
@@ -2819,6 +2825,9 @@ var EditorComponent = /** @class */ (function () {
2819
2825
  if (this.subs) {
2820
2826
  this.subs.unsubscribe();
2821
2827
  }
2828
+ if (this._styleObserver) {
2829
+ this._styleObserver.disconnect();
2830
+ }
2822
2831
  };
2823
2832
  /**
2824
2833
  * @hidden
@@ -2999,6 +3008,48 @@ var EditorComponent = /** @class */ (function () {
2999
3008
  .pipe(filter(function (event) { return !_this.viewMountElement.contains(event.relatedTarget); }))
3000
3009
  .subscribe(function () { return _this.onTouchedCallback(); }));
3001
3010
  };
3011
+ EditorComponent.prototype.normalizeSize = function () {
3012
+ var _this = this;
3013
+ if (typeof this.resizable === 'object' && !this._styleObserver) {
3014
+ var element_1 = this.element.nativeElement;
3015
+ this._styleObserver = new MutationObserver(function () {
3016
+ _this.ngZone.runOutsideAngular(function () { return _this.normalizeProperties(element_1); });
3017
+ });
3018
+ this._styleObserver.observe(element_1, { attributeFilter: ['style'] });
3019
+ }
3020
+ };
3021
+ EditorComponent.prototype.normalizeProperties = function (element) {
3022
+ var props = Object.keys(this.resizable);
3023
+ var pixelWidth = parseInt(element.style.width, 10);
3024
+ var pixelHeight = parseInt(element.style.height, 10);
3025
+ var resizable = this.resizable;
3026
+ props.forEach(function (prop) {
3027
+ var isMinProp = prop.startsWith('min');
3028
+ var isMaxProp = !isMinProp;
3029
+ var isWidthProp = prop.endsWith('Width');
3030
+ var isHeightProp = !isWidthProp;
3031
+ if (isMinProp && isWidthProp) {
3032
+ if (pixelWidth < resizable.minWidth) {
3033
+ element.style.width = resizable.minWidth + 'px';
3034
+ }
3035
+ }
3036
+ else if (isMinProp && isHeightProp) {
3037
+ if (pixelHeight < resizable.minHeight) {
3038
+ element.style.height = resizable.minHeight + 'px';
3039
+ }
3040
+ }
3041
+ else if (isMaxProp && isWidthProp) {
3042
+ if (pixelWidth > resizable.maxWidth) {
3043
+ element.style.width = resizable.maxWidth + 'px';
3044
+ }
3045
+ }
3046
+ else {
3047
+ if (pixelHeight > resizable.maxHeight) {
3048
+ element.style.height = resizable.maxHeight + 'px';
3049
+ }
3050
+ }
3051
+ });
3052
+ };
3002
3053
  var EditorComponent_1;
3003
3054
  __decorate([
3004
3055
  Input(),
@@ -347,7 +347,7 @@ var EditorComponent = /** @class */ (function () {
347
347
  Object.defineProperty(EditorComponent.prototype, "minWidth", {
348
348
  get: function () {
349
349
  var resizableOptions = this.resizable;
350
- return resizableOptions.minWidth;
350
+ return resizableOptions.minWidth ? resizableOptions.minWidth + 'px' : undefined;
351
351
  },
352
352
  enumerable: true,
353
353
  configurable: true
@@ -355,7 +355,7 @@ var EditorComponent = /** @class */ (function () {
355
355
  Object.defineProperty(EditorComponent.prototype, "maxWidth", {
356
356
  get: function () {
357
357
  var resizableOptions = this.resizable;
358
- return resizableOptions.maxWidth;
358
+ return resizableOptions.maxWidth ? resizableOptions.maxWidth + 'px' : undefined;
359
359
  },
360
360
  enumerable: true,
361
361
  configurable: true
@@ -363,7 +363,7 @@ var EditorComponent = /** @class */ (function () {
363
363
  Object.defineProperty(EditorComponent.prototype, "minHeight", {
364
364
  get: function () {
365
365
  var resizableOptions = this.resizable;
366
- return resizableOptions.minHeight;
366
+ return resizableOptions.minHeight ? resizableOptions.minHeight + 'px' : undefined;
367
367
  },
368
368
  enumerable: true,
369
369
  configurable: true
@@ -371,7 +371,7 @@ var EditorComponent = /** @class */ (function () {
371
371
  Object.defineProperty(EditorComponent.prototype, "maxHeight", {
372
372
  get: function () {
373
373
  var resizableOptions = this.resizable;
374
- return resizableOptions.maxHeight;
374
+ return resizableOptions.maxHeight ? resizableOptions.maxHeight + 'px' : undefined;
375
375
  },
376
376
  enumerable: true,
377
377
  configurable: true
@@ -416,12 +416,18 @@ var EditorComponent = /** @class */ (function () {
416
416
  if (!this.iframe) {
417
417
  this.contentAreaLoaded.next();
418
418
  }
419
+ if (this.resizable) {
420
+ this.normalizeSize();
421
+ }
419
422
  };
420
423
  EditorComponent.prototype.ngOnChanges = function (changes) {
421
424
  var _this = this;
422
425
  if (changes.iframe && !changes.iframe.isFirstChange()) {
423
426
  this.ngZone.onStable.pipe(operators_1.take(1)).subscribe(function () { return _this.initialize(); });
424
427
  }
428
+ if (changes.resizable && !changes.resizable.isFirstChange()) {
429
+ this.normalizeSize();
430
+ }
425
431
  };
426
432
  /**
427
433
  * @hidden
@@ -580,6 +586,9 @@ var EditorComponent = /** @class */ (function () {
580
586
  if (this.subs) {
581
587
  this.subs.unsubscribe();
582
588
  }
589
+ if (this._styleObserver) {
590
+ this._styleObserver.disconnect();
591
+ }
583
592
  };
584
593
  /**
585
594
  * @hidden
@@ -760,6 +769,48 @@ var EditorComponent = /** @class */ (function () {
760
769
  .pipe(operators_1.filter(function (event) { return !_this.viewMountElement.contains(event.relatedTarget); }))
761
770
  .subscribe(function () { return _this.onTouchedCallback(); }));
762
771
  };
772
+ EditorComponent.prototype.normalizeSize = function () {
773
+ var _this = this;
774
+ if (typeof this.resizable === 'object' && !this._styleObserver) {
775
+ var element_1 = this.element.nativeElement;
776
+ this._styleObserver = new MutationObserver(function () {
777
+ _this.ngZone.runOutsideAngular(function () { return _this.normalizeProperties(element_1); });
778
+ });
779
+ this._styleObserver.observe(element_1, { attributeFilter: ['style'] });
780
+ }
781
+ };
782
+ EditorComponent.prototype.normalizeProperties = function (element) {
783
+ var props = Object.keys(this.resizable);
784
+ var pixelWidth = parseInt(element.style.width, 10);
785
+ var pixelHeight = parseInt(element.style.height, 10);
786
+ var resizable = this.resizable;
787
+ props.forEach(function (prop) {
788
+ var isMinProp = prop.startsWith('min');
789
+ var isMaxProp = !isMinProp;
790
+ var isWidthProp = prop.endsWith('Width');
791
+ var isHeightProp = !isWidthProp;
792
+ if (isMinProp && isWidthProp) {
793
+ if (pixelWidth < resizable.minWidth) {
794
+ element.style.width = resizable.minWidth + 'px';
795
+ }
796
+ }
797
+ else if (isMinProp && isHeightProp) {
798
+ if (pixelHeight < resizable.minHeight) {
799
+ element.style.height = resizable.minHeight + 'px';
800
+ }
801
+ }
802
+ else if (isMaxProp && isWidthProp) {
803
+ if (pixelWidth > resizable.maxWidth) {
804
+ element.style.width = resizable.maxWidth + 'px';
805
+ }
806
+ }
807
+ else {
808
+ if (pixelHeight > resizable.maxHeight) {
809
+ element.style.height = resizable.maxHeight + 'px';
810
+ }
811
+ }
812
+ });
813
+ };
763
814
  var EditorComponent_1;
764
815
  tslib_1.__decorate([
765
816
  core_1.Input(),
@@ -11,7 +11,7 @@ exports.packageMetadata = {
11
11
  name: '@progress/kendo-angular-editor',
12
12
  productName: 'Kendo UI for Angular',
13
13
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
14
- publishDate: 1634903968,
14
+ publishDate: 1635262687,
15
15
  version: '',
16
16
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
17
17
  };