@progress/kendo-angular-layout 6.3.6-dev.202111110855 → 6.4.0

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.
Files changed (44) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +119 -79
  3. package/README.md +1 -1
  4. package/dist/cdn/js/kendo-angular-layout.js +2 -2
  5. package/dist/cdn/main.js +1 -1
  6. package/dist/es/avatar/avatar.component.js +120 -90
  7. package/dist/es/avatar/models/models.js +4 -0
  8. package/dist/es/avatar/models/rounded.js +4 -0
  9. package/dist/es/common/styling-classes.js +4 -0
  10. package/dist/es/common/util.js +40 -0
  11. package/dist/es/main.js +1 -0
  12. package/dist/es/package-metadata.js +1 -1
  13. package/dist/es2015/avatar/avatar.component.d.ts +30 -30
  14. package/dist/es2015/avatar/avatar.component.js +111 -81
  15. package/dist/es2015/avatar/models/fill.d.ts +2 -8
  16. package/dist/es2015/avatar/models/models.d.ts +9 -0
  17. package/dist/es2015/avatar/models/models.js +4 -0
  18. package/dist/es2015/avatar/models/rounded.d.ts +8 -0
  19. package/dist/es2015/avatar/models/rounded.js +4 -0
  20. package/dist/es2015/avatar/models/shape.d.ts +2 -8
  21. package/dist/es2015/avatar/models/size.d.ts +1 -8
  22. package/dist/es2015/avatar/models/theme-color.d.ts +2 -17
  23. package/dist/es2015/common/styling-classes.d.ts +11 -0
  24. package/dist/es2015/common/styling-classes.js +4 -0
  25. package/dist/es2015/common/util.d.ts +12 -0
  26. package/dist/es2015/common/util.js +40 -0
  27. package/dist/es2015/index.metadata.json +1 -1
  28. package/dist/es2015/main.d.ts +1 -4
  29. package/dist/es2015/main.js +1 -0
  30. package/dist/es2015/package-metadata.js +1 -1
  31. package/dist/es2015/tilelayout/tilelayout-item.component.d.ts +2 -2
  32. package/dist/es2015/tilelayout/tilelayout-resize-handle.directive.d.ts +2 -2
  33. package/dist/es2015/tilelayout/tilelayout.component.d.ts +2 -2
  34. package/dist/fesm2015/index.js +151 -82
  35. package/dist/fesm5/index.js +160 -91
  36. package/dist/npm/avatar/avatar.component.js +120 -90
  37. package/dist/npm/avatar/models/models.js +6 -0
  38. package/dist/npm/avatar/models/rounded.js +6 -0
  39. package/dist/npm/common/styling-classes.js +6 -0
  40. package/dist/npm/common/util.js +40 -0
  41. package/dist/npm/main.js +1 -0
  42. package/dist/npm/package-metadata.js +1 -1
  43. package/dist/systemjs/kendo-angular-layout.js +1 -1
  44. package/package.json +13 -11
@@ -21,7 +21,7 @@ var packageMetadata = {
21
21
  name: '@progress/kendo-angular-layout',
22
22
  productName: 'Kendo UI for Angular',
23
23
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
24
- publishDate: 1636620848,
24
+ publishDate: 1642588031,
25
25
  version: '',
26
26
  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'
27
27
  };
@@ -147,6 +147,21 @@ var PanelBarItemTitleDirective = /** @class */ (function () {
147
147
  }());
148
148
 
149
149
  var nextId = 0;
150
+ var SIZES = {
151
+ small: 'sm',
152
+ medium: 'md',
153
+ large: 'lg'
154
+ };
155
+ var ROUNDNESS = {
156
+ small: 'sm',
157
+ medium: 'md',
158
+ large: 'lg',
159
+ full: 'full'
160
+ };
161
+ var SHAPE_TO_ROUNDED = {
162
+ rounded: 'large',
163
+ circle: 'full'
164
+ };
150
165
  var parsePanelBarItems = function (data) {
151
166
  return data.map(function (item) {
152
167
  if (!item.id) {
@@ -186,6 +201,31 @@ var isNavigationKey = function (keyCode) {
186
201
  return keyCode === Keys.PageUp || keyCode === Keys.PageDown ||
187
202
  keyCode === Keys.Home || keyCode === Keys.End;
188
203
  };
204
+ /**
205
+ * @hidden
206
+ *
207
+ * Returns the styling classes to be added and removed
208
+ */
209
+ var getStylingClasses = function (componentType, stylingOption, previousValue, newValue) {
210
+ switch (stylingOption) {
211
+ case 'size':
212
+ return {
213
+ toRemove: "k-" + componentType + "-" + SIZES[previousValue],
214
+ toAdd: newValue ? "k-" + componentType + "-" + SIZES[newValue] : null
215
+ };
216
+ case 'rounded':
217
+ return {
218
+ toRemove: "k-rounded-" + ROUNDNESS[previousValue],
219
+ toAdd: newValue ? "k-rounded-" + ROUNDNESS[newValue] : null
220
+ };
221
+ default:
222
+ break;
223
+ }
224
+ };
225
+ /**
226
+ * @hidden
227
+ */
228
+ var mapShapeToRounded = function (shape) { return SHAPE_TO_ROUNDED[shape] || null; };
189
229
 
190
230
  var focusableRegex = /^(?:a|input|select|option|textarea|button|object)$/i;
191
231
  var toClassList = function (classNames) { return String(classNames).trim().split(' '); };
@@ -4729,17 +4769,6 @@ var LocalizedStepperMessagesDirective = /** @class */ (function (_super) {
4729
4769
  return LocalizedStepperMessagesDirective;
4730
4770
  }(StepperMessages));
4731
4771
 
4732
- var SIZE_CLASSES = {
4733
- 'small': 'k-avatar-sm',
4734
- 'medium': 'k-avatar-md',
4735
- 'large': 'k-avatar-lg'
4736
- };
4737
- var SHAPE_CLASSES = {
4738
- 'circle': 'k-avatar-circle',
4739
- 'square': 'k-avatar-square',
4740
- 'rectangle': 'k-avatar-rectangle',
4741
- 'rounded': 'k-avatar-rounded'
4742
- };
4743
4772
  /**
4744
4773
  * Displays images, icons or initials representing people or other entities.
4745
4774
  */
@@ -4748,45 +4777,16 @@ var AvatarComponent = /** @class */ (function () {
4748
4777
  this.renderer = renderer;
4749
4778
  this.element = element;
4750
4779
  this.hostClass = true;
4751
- /**
4752
- * Specifies the appearance fill style of the avatar.
4753
- *
4754
- * The possible values are:
4755
- * * `solid` (Default)
4756
- * * `outline`
4757
- *
4758
- */
4759
- this.fill = 'solid';
4760
4780
  /**
4761
4781
  * Sets a border to the avatar.
4762
4782
  */
4763
4783
  this.border = false;
4764
4784
  this._themeColor = 'primary';
4765
4785
  this._size = 'medium';
4766
- this._shape = 'square';
4767
- this.avatar = this.element.nativeElement;
4786
+ this._fillMode = 'solid';
4787
+ this._rounded = 'full';
4768
4788
  validatePackage(packageMetadata);
4769
4789
  }
4770
- Object.defineProperty(AvatarComponent.prototype, "solidClass", {
4771
- /**
4772
- * @hidden
4773
- */
4774
- get: function () {
4775
- return this.fill === 'solid';
4776
- },
4777
- enumerable: true,
4778
- configurable: true
4779
- });
4780
- Object.defineProperty(AvatarComponent.prototype, "outlineClass", {
4781
- /**
4782
- * @hidden
4783
- */
4784
- get: function () {
4785
- return this.fill === 'outline';
4786
- },
4787
- enumerable: true,
4788
- configurable: true
4789
- });
4790
4790
  Object.defineProperty(AvatarComponent.prototype, "borderClass", {
4791
4791
  /**
4792
4792
  * @hidden
@@ -4808,23 +4808,12 @@ var AvatarComponent = /** @class */ (function () {
4808
4808
  configurable: true
4809
4809
  });
4810
4810
  Object.defineProperty(AvatarComponent.prototype, "shape", {
4811
- get: function () {
4812
- return this._shape;
4813
- },
4814
4811
  /**
4815
4812
  * Sets the shape for the avatar.
4816
- *
4817
- * Possible values are:
4818
- * * (Default) `square`
4819
- * * `circle`
4820
- * * `rectangle`
4821
- * * `rounded`
4822
- *
4813
+ * @hidden
4823
4814
  */
4824
4815
  set: function (shape) {
4825
- this.renderer.removeClass(this.avatar, SHAPE_CLASSES[this.shape]);
4826
- this.renderer.addClass(this.avatar, SHAPE_CLASSES[shape]);
4827
- this._shape = shape;
4816
+ this.rounded = mapShapeToRounded(shape);
4828
4817
  },
4829
4818
  enumerable: true,
4830
4819
  configurable: true
@@ -4844,9 +4833,35 @@ var AvatarComponent = /** @class */ (function () {
4844
4833
  *
4845
4834
  */
4846
4835
  set: function (size) {
4847
- this.renderer.removeClass(this.avatar, SIZE_CLASSES[this.size]);
4848
- this.renderer.addClass(this.avatar, SIZE_CLASSES[size]);
4849
- this._size = size;
4836
+ if (size !== this._size) {
4837
+ this.handleClasses('size', size);
4838
+ this._size = size === null ? null : size || 'medium';
4839
+ }
4840
+ },
4841
+ enumerable: true,
4842
+ configurable: true
4843
+ });
4844
+ Object.defineProperty(AvatarComponent.prototype, "rounded", {
4845
+ get: function () {
4846
+ return this._rounded;
4847
+ },
4848
+ /**
4849
+ * Specifies the rounded styling of the avatar
4850
+ * ([see example]({% slug appearance_avatar %}#toc-rounded-corners)).
4851
+ *
4852
+ * The possible values are:
4853
+ * * `small`
4854
+ * * `medium`
4855
+ * * `large`
4856
+ * * `full` (Default)
4857
+ * * null
4858
+ *
4859
+ */
4860
+ set: function (rounded) {
4861
+ if (rounded !== this._rounded) {
4862
+ this.handleClasses('rounded', rounded);
4863
+ this._rounded = rounded === null ? null : rounded || 'full';
4864
+ }
4850
4865
  },
4851
4866
  enumerable: true,
4852
4867
  configurable: true
@@ -4860,10 +4875,10 @@ var AvatarComponent = /** @class */ (function () {
4860
4875
  * The theme color will be applied as background and border color, while also amending the text color accordingly.
4861
4876
  *
4862
4877
  * The possible values are:
4878
+ * * `base`— Applies the base coloring value.
4863
4879
  * * `primary` (Default)—Applies coloring based on primary theme color.
4864
4880
  * * `secondary`—Applies coloring based on secondary theme color.
4865
4881
  * * `tertiary`— Applies coloring based on tertiary theme color.
4866
- * * `inherit`— Applies inherited coloring value.
4867
4882
  * * `info`—Applies coloring based on info theme color.
4868
4883
  * * `success`— Applies coloring based on success theme color.
4869
4884
  * * `warning`— Applies coloring based on warning theme color.
@@ -4871,45 +4886,67 @@ var AvatarComponent = /** @class */ (function () {
4871
4886
  * * `dark`— Applies coloring based on dark theme color.
4872
4887
  * * `light`— Applies coloring based on light theme color.
4873
4888
  * * `inverse`— Applies coloring based on inverted theme color.
4874
- *
4875
4889
  */
4876
4890
  set: function (themeColor) {
4877
- this.renderer.removeClass(this.avatar, "k-avatar-" + this.themeColor);
4878
- this.renderer.addClass(this.avatar, "k-avatar-" + themeColor);
4879
- this._themeColor = themeColor;
4891
+ if (themeColor !== this._themeColor) {
4892
+ this._themeColor = themeColor === null ? null : (themeColor || 'primary');
4893
+ this.handleFillModeAndThemeColorClasses(this.fillMode, this.themeColor);
4894
+ }
4880
4895
  },
4881
4896
  enumerable: true,
4882
4897
  configurable: true
4883
4898
  });
4884
- Object.defineProperty(AvatarComponent.prototype, "avatarWidth", {
4899
+ Object.defineProperty(AvatarComponent.prototype, "fillMode", {
4900
+ get: function () {
4901
+ return this._fillMode;
4902
+ },
4903
+ /**
4904
+ * Specifies the appearance fill style of the avatar.
4905
+ *
4906
+ * The possible values are:
4907
+ * * `solid` (Default)
4908
+ * * `outline`
4909
+ * * null
4910
+ *
4911
+ */
4912
+ set: function (fillMode) {
4913
+ if (fillMode !== this.fillMode) {
4914
+ this._fillMode = fillMode === null ? null : (fillMode || 'solid');
4915
+ this.handleFillModeAndThemeColorClasses(this.fillMode, this.themeColor);
4916
+ }
4917
+ },
4918
+ enumerable: true,
4919
+ configurable: true
4920
+ });
4921
+ Object.defineProperty(AvatarComponent.prototype, "fill", {
4885
4922
  /**
4923
+ * Specifies the appearance fill style of the avatar.
4924
+ * Deprecated, left for backward compatibility.
4925
+ *
4886
4926
  * @hidden
4887
4927
  */
4888
- get: function () {
4889
- return this.width;
4928
+ set: function (fillMode) {
4929
+ this.fillMode = fillMode;
4890
4930
  },
4891
4931
  enumerable: true,
4892
4932
  configurable: true
4893
4933
  });
4894
- Object.defineProperty(AvatarComponent.prototype, "avatarHeight", {
4934
+ Object.defineProperty(AvatarComponent.prototype, "avatarWidth", {
4895
4935
  /**
4896
4936
  * @hidden
4897
4937
  */
4898
4938
  get: function () {
4899
- return this.height;
4939
+ return this.width;
4900
4940
  },
4901
4941
  enumerable: true,
4902
4942
  configurable: true
4903
4943
  });
4904
- AvatarComponent.prototype.ngAfterViewInit = function () {
4905
- this.setAvatarClasses();
4906
- };
4907
- Object.defineProperty(AvatarComponent.prototype, "imageUrl", {
4944
+ Object.defineProperty(AvatarComponent.prototype, "avatarHeight", {
4908
4945
  /**
4909
4946
  * @hidden
4910
4947
  */
4911
4948
  get: function () {
4912
- return "url(" + this.imageSrc + ")";
4949
+ return this.height;
4913
4950
  },
4914
4951
  enumerable: true,
4915
4952
  configurable: true
@@ -4917,6 +4954,14 @@ var AvatarComponent = /** @class */ (function () {
4917
4954
  AvatarComponent.prototype.ngOnInit = function () {
4918
4955
  this.verifyProperties();
4919
4956
  };
4957
+ AvatarComponent.prototype.ngAfterViewInit = function () {
4958
+ var _this = this;
4959
+ var stylingInputs = ['size', 'rounded'];
4960
+ stylingInputs.forEach(function (input) {
4961
+ _this.handleClasses(input, _this[input]);
4962
+ });
4963
+ this.handleFillModeAndThemeColorClasses(this.fillMode, this.themeColor);
4964
+ };
4920
4965
  /**
4921
4966
  * @hidden
4922
4967
  */
@@ -4948,25 +4993,38 @@ var AvatarComponent = /** @class */ (function () {
4948
4993
  throw new Error("\n Invalid property configuration given.\n The kendo-avatar component can accept only one of:\n icon, imageSrc or initials properties.\n ");
4949
4994
  }
4950
4995
  };
4951
- AvatarComponent.prototype.setAvatarClasses = function () {
4952
- this.renderer.addClass(this.avatar, SHAPE_CLASSES[this.shape]);
4953
- this.renderer.addClass(this.avatar, "k-avatar-" + this.themeColor);
4954
- this.renderer.addClass(this.avatar, SIZE_CLASSES[this.size]);
4996
+ AvatarComponent.prototype.handleClasses = function (styleType, value) {
4997
+ var elem = this.element.nativeElement;
4998
+ var classes = getStylingClasses('avatar', styleType, this[styleType], value);
4999
+ if (classes.toRemove) {
5000
+ this.renderer.removeClass(elem, classes.toRemove);
5001
+ }
5002
+ if (classes.toAdd) {
5003
+ this.renderer.addClass(elem, classes.toAdd);
5004
+ }
5005
+ };
5006
+ AvatarComponent.prototype.handleFillModeAndThemeColorClasses = function (fill, themeColor) {
5007
+ var _this = this;
5008
+ var wrapperElement = this.element.nativeElement;
5009
+ // remove existing fill and theme color classes
5010
+ var currentClasses = Array.from(wrapperElement.classList);
5011
+ var classesToRemove = currentClasses.filter(function (cl) {
5012
+ return cl.startsWith('k-avatar-solid') || cl.startsWith('k-avatar-outline');
5013
+ });
5014
+ classesToRemove.forEach((function (cl) { return _this.renderer.removeClass(wrapperElement, cl); }));
5015
+ // add fill if needed
5016
+ if (fill !== null) {
5017
+ this.renderer.addClass(wrapperElement, "k-avatar-" + fill);
5018
+ }
5019
+ // add theme color class if fill and theme color
5020
+ if (fill !== null && themeColor !== null) {
5021
+ this.renderer.addClass(wrapperElement, "k-avatar-" + fill + "-" + themeColor);
5022
+ }
4955
5023
  };
4956
5024
  __decorate([
4957
5025
  HostBinding('class.k-avatar'),
4958
5026
  __metadata("design:type", Boolean)
4959
5027
  ], AvatarComponent.prototype, "hostClass", void 0);
4960
- __decorate([
4961
- HostBinding('class.k-avatar-solid'),
4962
- __metadata("design:type", Boolean),
4963
- __metadata("design:paramtypes", [])
4964
- ], AvatarComponent.prototype, "solidClass", null);
4965
- __decorate([
4966
- HostBinding('class.k-avatar-outline'),
4967
- __metadata("design:type", Boolean),
4968
- __metadata("design:paramtypes", [])
4969
- ], AvatarComponent.prototype, "outlineClass", null);
4970
5028
  __decorate([
4971
5029
  HostBinding('class.k-avatar-bordered'),
4972
5030
  __metadata("design:type", Boolean),
@@ -4987,6 +5045,11 @@ var AvatarComponent = /** @class */ (function () {
4987
5045
  __metadata("design:type", String),
4988
5046
  __metadata("design:paramtypes", [String])
4989
5047
  ], AvatarComponent.prototype, "size", null);
5048
+ __decorate([
5049
+ Input(),
5050
+ __metadata("design:type", String),
5051
+ __metadata("design:paramtypes", [String])
5052
+ ], AvatarComponent.prototype, "rounded", null);
4990
5053
  __decorate([
4991
5054
  Input(),
4992
5055
  __metadata("design:type", String),
@@ -4994,8 +5057,14 @@ var AvatarComponent = /** @class */ (function () {
4994
5057
  ], AvatarComponent.prototype, "themeColor", null);
4995
5058
  __decorate([
4996
5059
  Input(),
4997
- __metadata("design:type", String)
4998
- ], AvatarComponent.prototype, "fill", void 0);
5060
+ __metadata("design:type", String),
5061
+ __metadata("design:paramtypes", [String])
5062
+ ], AvatarComponent.prototype, "fillMode", null);
5063
+ __decorate([
5064
+ Input(),
5065
+ __metadata("design:type", String),
5066
+ __metadata("design:paramtypes", [String])
5067
+ ], AvatarComponent.prototype, "fill", null);
4999
5068
  __decorate([
5000
5069
  Input(),
5001
5070
  __metadata("design:type", Boolean)
@@ -5041,7 +5110,7 @@ var AvatarComponent = /** @class */ (function () {
5041
5110
  AvatarComponent = __decorate([
5042
5111
  Component({
5043
5112
  selector: 'kendo-avatar',
5044
- template: "\n <ng-content *ngIf=\"customAvatar\"></ng-content>\n\n <ng-container *ngIf=\"imageSrc\">\n <div class=\"k-avatar-image\" [ngStyle]=\"cssStyle\" [style.backgroundImage]=\"imageUrl\"></div>\n </ng-container>\n\n <ng-container *ngIf=\"initials\">\n <span class=\"k-avatar-text\" [ngStyle]=\"cssStyle\">{{ initials.substring(0, 2) }}</span>\n </ng-container>\n\n <ng-container *ngIf=\"icon || iconClass\">\n <span class=\"k-avatar-icon\" [ngStyle]=\"cssStyle\" [ngClass]=\"iconClasses()\"></span>\n </ng-container>\n "
5113
+ template: "\n <ng-content *ngIf=\"customAvatar\"></ng-content>\n\n <ng-container *ngIf=\"imageSrc\">\n <span class=\"k-avatar-image\">\n <img src=\"{{imageSrc}}\" [ngStyle]=\"cssStyle\" />\n </span>\n </ng-container>\n\n <ng-container *ngIf=\"initials\">\n <span class=\"k-avatar-text\" [ngStyle]=\"cssStyle\">{{ initials.substring(0, 2) }}</span>\n </ng-container>\n\n <ng-container *ngIf=\"icon || iconClass\">\n <span class=\"k-avatar-icon\" [ngStyle]=\"cssStyle\" [ngClass]=\"iconClasses()\"></span>\n </ng-container>\n "
5045
5114
  }),
5046
5115
  __metadata("design:paramtypes", [Renderer2, ElementRef])
5047
5116
  ], AvatarComponent);