@progress/kendo-angular-dialog 5.1.1 → 5.2.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 (33) hide show
  1. package/dist/cdn/js/kendo-angular-dialog.js +1 -1
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/common/util.js +66 -1
  4. package/dist/es/dialog/dialog-titlebar.component.js +1 -1
  5. package/dist/es/dialog/dialog.component.js +93 -26
  6. package/dist/es/dialog/dialog.service.js +2 -0
  7. package/dist/es/package-metadata.js +1 -1
  8. package/dist/es/window/window.component.js +52 -2
  9. package/dist/es/window/window.service.js +6 -0
  10. package/dist/es2015/common/util.d.ts +21 -0
  11. package/dist/es2015/common/util.js +66 -1
  12. package/dist/es2015/dialog/dialog-settings.d.ts +12 -0
  13. package/dist/es2015/dialog/dialog-titlebar.component.js +1 -1
  14. package/dist/es2015/dialog/dialog.component.d.ts +26 -6
  15. package/dist/es2015/dialog/dialog.component.js +84 -26
  16. package/dist/es2015/dialog/dialog.service.js +2 -0
  17. package/dist/es2015/index.metadata.json +1 -1
  18. package/dist/es2015/package-metadata.js +1 -1
  19. package/dist/es2015/window/window-settings.d.ts +12 -0
  20. package/dist/es2015/window/window.component.d.ts +13 -0
  21. package/dist/es2015/window/window.component.js +43 -2
  22. package/dist/es2015/window/window.service.js +6 -0
  23. package/dist/fesm2015/index.js +197 -28
  24. package/dist/fesm5/index.js +215 -28
  25. package/dist/npm/common/util.js +68 -0
  26. package/dist/npm/dialog/dialog-titlebar.component.js +1 -1
  27. package/dist/npm/dialog/dialog.component.js +91 -24
  28. package/dist/npm/dialog/dialog.service.js +2 -0
  29. package/dist/npm/package-metadata.js +1 -1
  30. package/dist/npm/window/window.component.js +51 -1
  31. package/dist/npm/window/window.service.js +6 -0
  32. package/dist/systemjs/kendo-angular-dialog.js +1 -1
  33. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { __decorate, __metadata, __extends, __param } from 'tslib';
6
- import { TemplateRef, Input, Output, EventEmitter, HostBinding, Component, ElementRef, InjectionToken, Inject, Optional, NgZone, ContentChildren, QueryList, ViewChild, HostListener, Renderer2, ChangeDetectorRef, Injectable, isDevMode, ComponentFactoryResolver, Directive, Host, ContentChild, ViewChildren, ViewContainerRef, forwardRef, NgModule } from '@angular/core';
6
+ import { TemplateRef, Input, Output, EventEmitter, HostBinding, Component, ElementRef, InjectionToken, Inject, Optional, NgZone, ContentChildren, QueryList, ViewChildren, ViewChild, HostListener, Renderer2, ChangeDetectorRef, Injectable, isDevMode, ComponentFactoryResolver, Directive, Host, ContentChild, ViewContainerRef, forwardRef, NgModule } from '@angular/core';
7
7
  import { trigger, state, style, transition, animate } from '@angular/animations';
8
8
  import { L10N_PREFIX, RTL, MessageService, LocalizationService, ComponentMessages } from '@progress/kendo-angular-l10n';
9
9
  import { take, filter, map, share, tap, switchMap, takeUntil } from 'rxjs/operators';
@@ -180,7 +180,7 @@ var DialogTitleBarComponent = /** @class */ (function () {
180
180
  DialogTitleBarComponent.prototype.ngAfterViewInit = function () {
181
181
  var _this = this;
182
182
  this.zone.onStable.pipe(take(1)).subscribe(function () {
183
- var element = _this.hostElement.nativeElement;
183
+ var element = _this.hostElement.nativeElement.querySelector('.k-dialog-title');
184
184
  element.setAttribute('id', _this.id);
185
185
  });
186
186
  };
@@ -239,7 +239,7 @@ var packageMetadata = {
239
239
  name: '@progress/kendo-angular-dialog',
240
240
  productName: 'Kendo UI for Angular',
241
241
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
242
- publishDate: 1631198413,
242
+ publishDate: 1634903940,
243
243
  version: '',
244
244
  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'
245
245
  };
@@ -316,6 +316,60 @@ var isFocusable = function (element, checkVisibility) {
316
316
  }
317
317
  return false;
318
318
  };
319
+ /**
320
+ * @hidden
321
+ */
322
+ var setHTMLAttributes = function (attributes, renderer, element) {
323
+ for (var attribute in attributes) {
324
+ if (attribute) {
325
+ renderer.setAttribute(element, attribute, attributes[attribute]);
326
+ }
327
+ }
328
+ };
329
+ /**
330
+ * Receives CSS class declarations either as an object, string or array and returns an array of the class names.
331
+ *
332
+ * @hidden
333
+ */
334
+ var parseCSSClassNames = function (value) {
335
+ if (isObject(value)) {
336
+ return parseObjectClassNames(value);
337
+ }
338
+ if (isString(value)) {
339
+ return parseStringClassNames(value);
340
+ }
341
+ if (Array.isArray(value)) {
342
+ return parseArrayClassNames(value);
343
+ }
344
+ };
345
+ var parseObjectClassNames = function (value) {
346
+ var classes = [];
347
+ Object.keys(value).forEach(function (className) {
348
+ var currentClassName = splitStringToArray(className);
349
+ if (value[className] && currentClassName[0]) {
350
+ classes.push.apply(classes, currentClassName);
351
+ }
352
+ });
353
+ return classes;
354
+ };
355
+ var parseStringClassNames = function (value) {
356
+ var classes = [];
357
+ var classesArray = splitStringToArray(value);
358
+ classesArray.forEach(function (className) {
359
+ classes.push(className);
360
+ });
361
+ return classes;
362
+ };
363
+ var parseArrayClassNames = function (value) {
364
+ var classes = [];
365
+ value.forEach(function (className) {
366
+ var current = splitStringToArray(className);
367
+ if (current[0]) {
368
+ classes.push.apply(classes, current);
369
+ }
370
+ });
371
+ return classes;
372
+ };
319
373
  /**
320
374
  * @hidden
321
375
  */
@@ -352,6 +406,10 @@ var OFFSET_STYLES = ['top', 'left', 'width', 'height'];
352
406
  * @hidden
353
407
  */
354
408
  var isString = function (value) { return value instanceof String || typeof value === 'string'; };
409
+ /**
410
+ * @hidden
411
+ */
412
+ var isObject = function (value) { return isPresent(value) && !Array.isArray(value) && typeof value === 'object'; };
355
413
  /**
356
414
  * @hidden
357
415
  */
@@ -360,6 +418,10 @@ var isNumber = function (value) { return typeof value === 'number' && isFinite(v
360
418
  * @hidden
361
419
  */
362
420
  var createValueWithUnit = function (value) { return value + (isNumber(value) ? 'px' : ''); };
421
+ /**
422
+ * @hidden
423
+ */
424
+ var splitStringToArray = function (value) { return value.trim().replace(/\s+/g, " ").split(' '); };
363
425
 
364
426
  /**
365
427
  * The settings for the Dialog actions when the Dialog is opened through `DialogService`
@@ -421,13 +483,17 @@ var DialogComponent = /** @class */ (function () {
421
483
  * @hidden
422
484
  */
423
485
  this.titleId = null;
486
+ /**
487
+ * @hidden
488
+ */
489
+ this.contentId = null;
424
490
  /**
425
491
  * Fires when the user clicks an action button of the Dialog.
426
492
  * The event is fired only when the action buttons are specified through the `actions` options.
427
493
  */
428
494
  this.action = new EventEmitter();
429
495
  /**
430
- * Fires when the user clicks the **Close** button of the Dialog.
496
+ * Fires when the user clicks the **Close** button of the Dialog or the **ESC** key.
431
497
  */
432
498
  this.close = new EventEmitter();
433
499
  this.tabIndex = 0;
@@ -439,7 +505,45 @@ var DialogComponent = /** @class */ (function () {
439
505
  return (_this.direction = rtl ? 'rtl' : 'ltr');
440
506
  }));
441
507
  this.titleId = this.generateTitleId();
508
+ this.contentId = this.generateContentId();
442
509
  }
510
+ Object.defineProperty(DialogComponent.prototype, "htmlAttributes", {
511
+ get: function () {
512
+ return this._htmlAttributes;
513
+ },
514
+ /**
515
+ * @hidden
516
+ */
517
+ set: function (attributes) {
518
+ setHTMLAttributes(attributes, this._renderer, this._elRef.nativeElement);
519
+ var el = this._elRef.nativeElement;
520
+ var dir = el.getAttribute('dir');
521
+ var tIndex = el.getAttribute('tabindex');
522
+ if (this.direction !== dir) {
523
+ this.direction = dir;
524
+ }
525
+ if (this.tabIndex !== tIndex) {
526
+ this.tabIndex = tIndex;
527
+ }
528
+ this._htmlAttributes = attributes;
529
+ },
530
+ enumerable: true,
531
+ configurable: true
532
+ });
533
+ Object.defineProperty(DialogComponent.prototype, "cssClass", {
534
+ get: function () {
535
+ return this._cssClass;
536
+ },
537
+ /**
538
+ * @hidden
539
+ */
540
+ set: function (classes) {
541
+ this.setServiceClasses(this._cssClass, classes);
542
+ this._cssClass = classes;
543
+ },
544
+ enumerable: true,
545
+ configurable: true
546
+ });
443
547
  Object.defineProperty(DialogComponent.prototype, "dir", {
444
548
  get: function () {
445
549
  return this.direction;
@@ -470,6 +574,7 @@ var DialogComponent = /** @class */ (function () {
470
574
  DialogComponent.prototype.ngAfterContentInit = function () {
471
575
  var _this = this;
472
576
  this.bubble('close', this.titlebarContent.first);
577
+ this._renderer.setAttribute(this._elRef.nativeElement.querySelector('.k-dialog'), 'aria-describedby', this.contentId);
473
578
  if (this.titlebarContent.first) {
474
579
  this.titlebarContent.first.id = this.titleId;
475
580
  }
@@ -485,23 +590,26 @@ var DialogComponent = /** @class */ (function () {
485
590
  }));
486
591
  }
487
592
  };
488
- DialogComponent.prototype.ngOnChanges = function (changes) {
489
- var _this = this;
490
- if (changes.title && changes.title.currentValue && !changes.title.previousValue) {
491
- this.zone.onStable.pipe(take(1)).subscribe(function () {
492
- _this.bubble('close', _this.titlebarView);
493
- _this._renderer.setAttribute(_this._elRef.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', _this.titleId);
494
- });
495
- }
496
- };
497
593
  DialogComponent.prototype.ngAfterViewInit = function () {
594
+ var _this = this;
498
595
  this.handleInitialFocus();
499
- this.bubble('close', this.titlebarView);
596
+ this.bubble('close', this.titlebarView.first);
500
597
  this.bubble('action', this.actionsView);
501
- if (this.titlebarView || this.titlebarContent.first) {
598
+ if (this.titlebarView.first || this.titlebarContent.first) {
502
599
  //Needed for Dialogs created via service
503
600
  this._renderer.setAttribute(this._elRef.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', this.titleId);
504
601
  }
602
+ else {
603
+ this.subscriptions.push(this.titlebarView.changes.subscribe(function () {
604
+ if (isPresent(_this.titlebarView.first)) {
605
+ _this.titlebarView.first.id = _this.titleId;
606
+ _this.zone.onStable.pipe(take(1)).subscribe(function () {
607
+ _this.bubble('close', _this.titlebarView.first);
608
+ _this._renderer.setAttribute(_this._elRef.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', _this.titleId);
609
+ });
610
+ }
611
+ }));
612
+ }
505
613
  };
506
614
  DialogComponent.prototype.ngOnInit = function () {
507
615
  this._renderer.removeAttribute(this._elRef.nativeElement, 'title');
@@ -520,6 +628,20 @@ var DialogComponent = /** @class */ (function () {
520
628
  wrapper.focus();
521
629
  }
522
630
  };
631
+ DialogComponent.prototype.setServiceClasses = function (prevValue, value) {
632
+ var _this = this;
633
+ var el = this._elRef.nativeElement;
634
+ if (prevValue) {
635
+ parseCSSClassNames(prevValue).forEach(function (className) {
636
+ _this._renderer.removeClass(el, className);
637
+ });
638
+ }
639
+ if (value) {
640
+ parseCSSClassNames(value).forEach(function (className) {
641
+ _this._renderer.addClass(el, className);
642
+ });
643
+ }
644
+ };
523
645
  /**
524
646
  * @hidden
525
647
  */
@@ -562,16 +684,15 @@ var DialogComponent = /** @class */ (function () {
562
684
  * @hidden
563
685
  */
564
686
  DialogComponent.prototype.keepFocusWithinComponent = function (target, event) {
565
- var firstFocusable = this._elRef.nativeElement;
566
- var lastFocusable = this.getLastFocusableElement(firstFocusable);
567
- var tabBeforeFirstFocusable = target === firstFocusable && event.shiftKey;
568
- var tabAfterLastFocusable = !event.shiftKey && isPresent(lastFocusable) && target === lastFocusable;
569
- var tabWithNoFocusable = !isPresent(lastFocusable) && !event.shiftKey;
570
- if (tabBeforeFirstFocusable || tabWithNoFocusable) {
687
+ var wrapper = this._elRef.nativeElement;
688
+ var _a = this.getFirstAndLastFocusable(wrapper), firstFocusable = _a[0], lastFocusable = _a[1];
689
+ var tabAfterLastFocusable = !event.shiftKey && target === lastFocusable;
690
+ var shiftTabAfterFirstFocusable = event.shiftKey && target === firstFocusable;
691
+ if (tabAfterLastFocusable) {
571
692
  event.preventDefault();
572
693
  firstFocusable.focus();
573
694
  }
574
- if (tabAfterLastFocusable) {
695
+ if (shiftTabAfterFirstFocusable) {
575
696
  event.preventDefault();
576
697
  lastFocusable.focus();
577
698
  }
@@ -591,9 +712,11 @@ var DialogComponent = /** @class */ (function () {
591
712
  /**
592
713
  * @hidden
593
714
  */
594
- DialogComponent.prototype.getLastFocusableElement = function (parent) {
715
+ DialogComponent.prototype.getFirstAndLastFocusable = function (parent) {
595
716
  var all = this.getAllFocusableChildren(parent);
596
- return all.length > 0 ? all[all.length - 1] : null;
717
+ var firstFocusable = all.length > 0 ? all[0] : parent;
718
+ var lastFocusable = all.length > 0 ? all[all.length - 1] : parent;
719
+ return [firstFocusable, lastFocusable];
597
720
  };
598
721
  /**
599
722
  * @hidden
@@ -601,6 +724,12 @@ var DialogComponent = /** @class */ (function () {
601
724
  DialogComponent.prototype.generateTitleId = function () {
602
725
  return 'kendo-dialog-title-' + Math.ceil(Math.random() * 1000000).toString();
603
726
  };
727
+ /**
728
+ * @hidden
729
+ */
730
+ DialogComponent.prototype.generateContentId = function () {
731
+ return 'kendo-dialog-content-' + Math.ceil(Math.random() * 1000000).toString();
732
+ };
604
733
  Object.defineProperty(DialogComponent.prototype, "wrapperClass", {
605
734
  get: function () {
606
735
  return true;
@@ -704,8 +833,8 @@ var DialogComponent = /** @class */ (function () {
704
833
  __metadata("design:type", QueryList)
705
834
  ], DialogComponent.prototype, "titlebarContent", void 0);
706
835
  __decorate([
707
- ViewChild(DialogTitleBarComponent, { static: false }),
708
- __metadata("design:type", DialogTitleBarComponent)
836
+ ViewChildren(DialogTitleBarComponent),
837
+ __metadata("design:type", QueryList)
709
838
  ], DialogComponent.prototype, "titlebarView", void 0);
710
839
  __decorate([
711
840
  ViewChild(DialogActionsComponent, { static: false }),
@@ -747,7 +876,7 @@ var DialogComponent = /** @class */ (function () {
747
876
  }
748
877
  ],
749
878
  selector: 'kendo-dialog',
750
- template: "\n <ng-container\n kendoDialogLocalizedMessages\n i18n-closeTitle=\"kendo.dialog.closeTitle|The title of the close button\"\n closeTitle=\"Close\"\n >\n <div class=\"k-overlay\" @overlayAppear></div>\n\n <div class=\"k-widget k-window k-dialog\" role=\"dialog\" [ngStyle]=\"styles\" @dialogSlideInAppear>\n <kendo-dialog-titlebar *ngIf=\"title\" [closeTitle]=\"closeTitle\" [id]=\"titleId\">{{ title }}</kendo-dialog-titlebar>\n <ng-content select=\"kendo-dialog-titlebar\" *ngIf=\"!title\"></ng-content>\n\n <div class=\"k-content k-window-content k-dialog-content\">\n <ng-content *ngIf=\"!contentTemplate\"></ng-content>\n <ng-template [ngTemplateOutlet]=\"contentTemplate\" *ngIf=\"contentTemplate\"></ng-template>\n </div>\n\n <ng-content select=\"kendo-dialog-actions\" *ngIf=\"!actions\"></ng-content>\n <kendo-dialog-actions *ngIf=\"actions\" [actions]=\"actions\" [layout]=\"actionsLayout\"> </kendo-dialog-actions>\n </div>\n </ng-container>\n "
879
+ template: "\n <ng-container\n kendoDialogLocalizedMessages\n i18n-closeTitle=\"kendo.dialog.closeTitle|The title of the close button\"\n closeTitle=\"Close\"\n >\n <div class=\"k-overlay\" @overlayAppear></div>\n\n <div class=\"k-window k-dialog\" role=\"dialog\" aria-modal=\"true\" [ngStyle]=\"styles\" @dialogSlideInAppear>\n <kendo-dialog-titlebar *ngIf=\"title\" [closeTitle]=\"closeTitle\" [id]=\"titleId\">{{ title }}</kendo-dialog-titlebar>\n <ng-content select=\"kendo-dialog-titlebar\" *ngIf=\"!title\"></ng-content>\n\n <div [id]=\"contentId\" class=\"k-content k-window-content k-dialog-content\">\n <ng-content *ngIf=\"!contentTemplate\"></ng-content>\n <ng-template [ngTemplateOutlet]=\"contentTemplate\" *ngIf=\"contentTemplate\"></ng-template>\n </div>\n\n <ng-content select=\"kendo-dialog-actions\" *ngIf=\"!actions\"></ng-content>\n <kendo-dialog-actions *ngIf=\"actions\" [actions]=\"actions\" [layout]=\"actionsLayout\"> </kendo-dialog-actions>\n </div>\n </ng-container>\n "
751
880
  }),
752
881
  __metadata("design:paramtypes", [ElementRef,
753
882
  Renderer2,
@@ -973,6 +1102,8 @@ var DialogService = /** @class */ (function () {
973
1102
  instance.maxHeight = options.maxHeight;
974
1103
  instance.autoFocusedElement = options.autoFocusedElement;
975
1104
  instance.closeTitle = options.closeTitle;
1105
+ instance.cssClass = options.cssClass;
1106
+ instance.htmlAttributes = options.htmlAttributes;
976
1107
  if (options.content instanceof TemplateRef) {
977
1108
  instance.contentTemplate = options.content;
978
1109
  }
@@ -1800,6 +1931,43 @@ var WindowComponent = /** @class */ (function () {
1800
1931
  enumerable: true,
1801
1932
  configurable: true
1802
1933
  });
1934
+ Object.defineProperty(WindowComponent.prototype, "cssClass", {
1935
+ get: function () {
1936
+ return this._cssClass;
1937
+ },
1938
+ /**
1939
+ * @hidden
1940
+ */
1941
+ set: function (classes) {
1942
+ this.setServiceClasses(this._cssClass, classes);
1943
+ this._cssClass = classes;
1944
+ },
1945
+ enumerable: true,
1946
+ configurable: true
1947
+ });
1948
+ Object.defineProperty(WindowComponent.prototype, "htmlAttributes", {
1949
+ get: function () {
1950
+ return this._htmlAttributes;
1951
+ },
1952
+ /**
1953
+ * @hidden
1954
+ */
1955
+ set: function (attributes) {
1956
+ setHTMLAttributes(attributes, this.renderer, this.el.nativeElement);
1957
+ var el = this.el.nativeElement;
1958
+ var dir = el.getAttribute('dir');
1959
+ var tIndex = el.getAttribute('tabindex');
1960
+ if (this.direction !== dir) {
1961
+ this.direction = dir;
1962
+ }
1963
+ if (this.tabIndex !== tIndex) {
1964
+ this.tabIndex = tIndex;
1965
+ }
1966
+ this._htmlAttributes = attributes;
1967
+ },
1968
+ enumerable: true,
1969
+ configurable: true
1970
+ });
1803
1971
  Object.defineProperty(WindowComponent.prototype, "state", {
1804
1972
  get: function () {
1805
1973
  return this.options.state;
@@ -2168,6 +2336,20 @@ var WindowComponent = /** @class */ (function () {
2168
2336
  }
2169
2337
  }));
2170
2338
  };
2339
+ WindowComponent.prototype.setServiceClasses = function (prevValue, value) {
2340
+ var _this = this;
2341
+ var el = this.el.nativeElement;
2342
+ if (prevValue) {
2343
+ parseCSSClassNames(prevValue).forEach(function (className) {
2344
+ _this.renderer.removeClass(el, className);
2345
+ });
2346
+ }
2347
+ if (value) {
2348
+ parseCSSClassNames(value).forEach(function (className) {
2349
+ _this.renderer.addClass(el, className);
2350
+ });
2351
+ }
2352
+ };
2171
2353
  WindowComponent.prototype.setNextZIndex = function () {
2172
2354
  var currentZIndex = this.el.nativeElement.style['z-index'];
2173
2355
  var nextPossibleZIndex = this.service.nextPossibleZIndex;
@@ -2336,7 +2518,6 @@ var WindowComponent = /** @class */ (function () {
2336
2518
  __metadata("design:type", Number)
2337
2519
  ], WindowComponent.prototype, "tabIndex", void 0);
2338
2520
  __decorate([
2339
- HostBinding('class.k-widget'),
2340
2521
  HostBinding('class.k-window'),
2341
2522
  __metadata("design:type", Boolean),
2342
2523
  __metadata("design:paramtypes", [])
@@ -2836,6 +3017,12 @@ var WindowService = /** @class */ (function () {
2836
3017
  return windowRef;
2837
3018
  };
2838
3019
  WindowService.prototype.applyOptions = function (instance, options) {
3020
+ if (isPresent(options.htmlAttributes)) {
3021
+ instance.htmlAttributes = options.htmlAttributes;
3022
+ }
3023
+ if (isPresent(options.cssClass)) {
3024
+ instance.cssClass = options.cssClass;
3025
+ }
2839
3026
  if (isPresent(options.title)) {
2840
3027
  instance.title = options.title;
2841
3028
  }
@@ -80,6 +80,66 @@ exports.isFocusable = function (element, checkVisibility) {
80
80
  }
81
81
  return false;
82
82
  };
83
+ /**
84
+ * @hidden
85
+ */
86
+ exports.setHTMLAttributes = function (attributes, renderer, element) {
87
+ for (var attribute in attributes) {
88
+ if (attribute) {
89
+ renderer.setAttribute(element, attribute, attributes[attribute]);
90
+ }
91
+ }
92
+ };
93
+ /**
94
+ * Receives CSS class declarations either as an object, string or array and returns an array of the class names.
95
+ *
96
+ * @hidden
97
+ */
98
+ exports.parseCSSClassNames = function (value) {
99
+ if (exports.isObject(value)) {
100
+ return parseObjectClassNames(value);
101
+ }
102
+ if (exports.isString(value)) {
103
+ return parseStringClassNames(value);
104
+ }
105
+ if (Array.isArray(value)) {
106
+ return parseArrayClassNames(value);
107
+ }
108
+ };
109
+ var parseObjectClassNames = function (value) {
110
+ var classes = [];
111
+ Object.keys(value).forEach(function (className) {
112
+ var currentClassName = exports.splitStringToArray(className);
113
+ if (value[className] && currentClassName[0]) {
114
+ classes.push.apply(classes, currentClassName);
115
+ }
116
+ });
117
+ return classes;
118
+ };
119
+ var ɵ1 = parseObjectClassNames;
120
+ exports.ɵ1 = ɵ1;
121
+ var parseStringClassNames = function (value) {
122
+ var classes = [];
123
+ var classesArray = exports.splitStringToArray(value);
124
+ classesArray.forEach(function (className) {
125
+ classes.push(className);
126
+ });
127
+ return classes;
128
+ };
129
+ var ɵ2 = parseStringClassNames;
130
+ exports.ɵ2 = ɵ2;
131
+ var parseArrayClassNames = function (value) {
132
+ var classes = [];
133
+ value.forEach(function (className) {
134
+ var current = exports.splitStringToArray(className);
135
+ if (current[0]) {
136
+ classes.push.apply(classes, current);
137
+ }
138
+ });
139
+ return classes;
140
+ };
141
+ var ɵ3 = parseArrayClassNames;
142
+ exports.ɵ3 = ɵ3;
83
143
  /**
84
144
  * @hidden
85
145
  */
@@ -128,6 +188,10 @@ exports.OFFSET_STYLES = ['top', 'left', 'width', 'height'];
128
188
  * @hidden
129
189
  */
130
190
  exports.isString = function (value) { return value instanceof String || typeof value === 'string'; };
191
+ /**
192
+ * @hidden
193
+ */
194
+ exports.isObject = function (value) { return exports.isPresent(value) && !Array.isArray(value) && typeof value === 'object'; };
131
195
  /**
132
196
  * @hidden
133
197
  */
@@ -136,3 +200,7 @@ exports.isNumber = function (value) { return typeof value === 'number' && isFini
136
200
  * @hidden
137
201
  */
138
202
  exports.createValueWithUnit = function (value) { return value + (exports.isNumber(value) ? 'px' : ''); };
203
+ /**
204
+ * @hidden
205
+ */
206
+ exports.splitStringToArray = function (value) { return value.trim().replace(/\s+/g, " ").split(' '); };
@@ -42,7 +42,7 @@ var DialogTitleBarComponent = /** @class */ (function () {
42
42
  DialogTitleBarComponent.prototype.ngAfterViewInit = function () {
43
43
  var _this = this;
44
44
  this.zone.onStable.pipe(operators_1.take(1)).subscribe(function () {
45
- var element = _this.hostElement.nativeElement;
45
+ var element = _this.hostElement.nativeElement.querySelector('.k-dialog-title');
46
46
  element.setAttribute('id', _this.id);
47
47
  });
48
48
  };