@progress/kendo-angular-layout 6.5.0-dev.202202091626 → 6.5.0-dev.202202140804

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.
@@ -3,10 +3,10 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
- import { Component, HostBinding, Input, Renderer2, ElementRef } from '@angular/core';
6
+ import { Component, HostBinding, Input, Renderer2, ElementRef, isDevMode } from '@angular/core';
7
7
  import { validatePackage } from '@progress/kendo-licensing';
8
8
  import { packageMetadata } from '../package-metadata';
9
- import { ALIGN_PREFIX, generateGapStyle, generateGridStyle, GRID_JUSTIFY_PREFIX, normalizeGap, VERTICAL_SUFFIX } from './util';
9
+ import { ALIGN_PREFIX, generateGapStyle, generateGridStyle, GRID_JUSTIFY_PREFIX, normalizeGap, VERTICAL_SUFFIX, validateGridLayoutRowsCols } from './util';
10
10
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
11
11
  import { isPresent } from '../common/util';
12
12
  import { isChanged } from '@progress/kendo-angular-common';
@@ -91,6 +91,11 @@ var GridLayoutComponent = /** @class */ (function () {
91
91
  if (!isPresent(this[type])) {
92
92
  return;
93
93
  }
94
+ var isValid = validateGridLayoutRowsCols(this[type]);
95
+ if (!isValid && isDevMode()) {
96
+ var valueType = type === 'rows' ? 'GridLayoutRowSize' : 'GridLayoutColSize';
97
+ throw new Error("The provided " + type + " value contains invalid elements. The array supports values of type number, string or " + valueType + ".");
98
+ }
94
99
  var gridTemplateStyle = type === 'rows' ? 'grid-template-rows' : 'grid-template-columns';
95
100
  var gridStyle = generateGridStyle(this[type], type);
96
101
  this.renderer.setStyle(this.element.nativeElement, gridTemplateStyle, gridStyle.join(' '));
@@ -85,3 +85,18 @@ export var generateGridStyle = function (items, itemType) {
85
85
  });
86
86
  return styling;
87
87
  };
88
+ /**
89
+ * @hidden
90
+ */
91
+ export var validateGridLayoutRowsCols = function (arr) {
92
+ for (var _i = 0, arr_1 = arr; _i < arr_1.length; _i++) {
93
+ var el = arr_1[_i];
94
+ var isNum = typeof el === 'number';
95
+ var isStr = typeof el === 'string';
96
+ var isObject = typeof el === 'object' && el !== null;
97
+ if (!isNum && !isStr && !isObject) {
98
+ return false;
99
+ }
100
+ }
101
+ return true;
102
+ };
@@ -9,7 +9,7 @@ export var packageMetadata = {
9
9
  name: '@progress/kendo-angular-layout',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1644423873,
12
+ publishDate: 1644825801,
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
  };