@progress/kendo-angular-navigation 2.0.3-dev.202210121055 → 2.1.0-dev.202210170736

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 (30) hide show
  1. package/actionsheet/actionsheet.component.d.ts +92 -0
  2. package/actionsheet/item.component.d.ts +19 -0
  3. package/actionsheet/list.component.d.ts +27 -0
  4. package/actionsheet/models/actionsheet-item.interface.d.ts +57 -0
  5. package/actionsheet/models/group.d.ts +5 -0
  6. package/actionsheet/models/index.d.ts +9 -0
  7. package/actionsheet/models/item-click.event.d.ts +18 -0
  8. package/actionsheet/templates/item-template.directive.d.ts +17 -0
  9. package/actionsheet/templates/title-template.directive.d.ts +17 -0
  10. package/actionsheet.module.d.ts +48 -0
  11. package/bundles/kendo-angular-navigation.umd.js +1 -1
  12. package/common/util.d.ts +16 -0
  13. package/esm2015/actionsheet/actionsheet.component.js +290 -0
  14. package/esm2015/actionsheet/item.component.js +108 -0
  15. package/esm2015/actionsheet/list.component.js +91 -0
  16. package/esm2015/actionsheet/models/actionsheet-item.interface.js +5 -0
  17. package/esm2015/actionsheet/models/group.js +5 -0
  18. package/esm2015/actionsheet/models/index.js +7 -0
  19. package/esm2015/actionsheet/models/item-click.event.js +9 -0
  20. package/esm2015/actionsheet/templates/item-template.directive.js +26 -0
  21. package/esm2015/actionsheet/templates/title-template.directive.js +26 -0
  22. package/esm2015/actionsheet.module.js +72 -0
  23. package/esm2015/common/util.js +63 -0
  24. package/esm2015/main.js +6 -0
  25. package/esm2015/navigation.module.js +7 -3
  26. package/esm2015/package-metadata.js +1 -1
  27. package/fesm2015/kendo-angular-navigation.js +656 -23
  28. package/main.d.ts +5 -0
  29. package/navigation.module.d.ts +2 -1
  30. package/package.json +1 -1
@@ -7,10 +7,10 @@ import { Component, HostBinding, Input, NgModule, Directive, Optional, EventEmit
7
7
  import * as i1 from '@progress/kendo-angular-l10n';
8
8
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
9
9
  import { validatePackage } from '@progress/kendo-licensing';
10
+ import * as i3 from '@progress/kendo-angular-common';
11
+ import { isDocumentAvailable, closestInScope as closestInScope$1, Keys, ResizeSensorModule } from '@progress/kendo-angular-common';
10
12
  import * as i1$1 from '@angular/common';
11
13
  import { CommonModule } from '@angular/common';
12
- import * as i3 from '@progress/kendo-angular-common';
13
- import { isDocumentAvailable, Keys, ResizeSensorModule } from '@progress/kendo-angular-common';
14
14
  import { fromEvent, merge, ReplaySubject, Subject, Subscription } from 'rxjs';
15
15
  import { filter, map, startWith, share } from 'rxjs/operators';
16
16
 
@@ -21,7 +21,7 @@ const packageMetadata = {
21
21
  name: '@progress/kendo-angular-navigation',
22
22
  productName: 'Kendo UI for Angular',
23
23
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
24
- publishDate: 1665572111,
24
+ publishDate: 1665992185,
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
  };
@@ -225,6 +225,68 @@ const outerWidth = (element) => {
225
225
  width += (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);
226
226
  return width;
227
227
  };
228
+ /**
229
+ * @hidden
230
+ */
231
+ const getFirstAndLastFocusable = (parent) => {
232
+ const all = getAllFocusableChildren(parent);
233
+ const firstFocusable = all.length > 0 ? all[0] : parent;
234
+ const lastFocusable = all.length > 0 ? all[all.length - 1] : parent;
235
+ return [firstFocusable, lastFocusable];
236
+ };
237
+ /**
238
+ * @hidden
239
+ */
240
+ const getAllFocusableChildren = (parent) => {
241
+ return parent.querySelectorAll(focusableSelector);
242
+ };
243
+ /**
244
+ * @hidden
245
+ */
246
+ const focusableSelector = [
247
+ 'a[href]',
248
+ 'area[href]',
249
+ 'input:not([disabled])',
250
+ 'select:not([disabled])',
251
+ 'textarea:not([disabled])',
252
+ 'button:not([disabled])',
253
+ 'iframe',
254
+ 'object',
255
+ 'embed',
256
+ '*[tabindex]',
257
+ '*[contenteditable]'
258
+ ].join(',');
259
+ /**
260
+ * @hidden
261
+ */
262
+ let idx = 0;
263
+ /**
264
+ * @hidden
265
+ */
266
+ const hexColorRegex = /^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/;
267
+ /**
268
+ * @hidden
269
+ */
270
+ const getId = (prefix) => {
271
+ return `${prefix}${++idx}`;
272
+ };
273
+ /**
274
+ * @hidden
275
+ */
276
+ const getActionSheetItemIndex = (target) => {
277
+ if (!isDocumentAvailable()) {
278
+ return;
279
+ }
280
+ const allItemElements = document.querySelectorAll('.k-actionsheet-action');
281
+ const closestItem = closestInScope$1(target, el => { var _a; return (_a = el.classList) === null || _a === void 0 ? void 0 : _a.contains('k-actionsheet-action'); }, this);
282
+ let idx = null;
283
+ allItemElements.forEach((i, index) => {
284
+ if (i === closestItem) {
285
+ idx = index;
286
+ }
287
+ });
288
+ return idx;
289
+ };
228
290
 
229
291
  /**
230
292
  * Represents the [Kendo UI AppBarSpacer component for Angular]({% slug contentarrangement_appbar %}#toc-spacings).
@@ -288,13 +350,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
288
350
  type: Input
289
351
  }] } });
290
352
 
291
- const exportedModules$1 = [
353
+ const exportedModules$2 = [
292
354
  AppBarComponent,
293
355
  AppBarSectionComponent,
294
356
  AppBarSpacerComponent
295
357
  ];
296
- const declarations$2 = [
297
- ...exportedModules$1
358
+ const declarations$3 = [
359
+ ...exportedModules$2
298
360
  ];
299
361
  /**
300
362
  * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
@@ -340,8 +402,8 @@ AppBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
340
402
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AppBarModule, decorators: [{
341
403
  type: NgModule,
342
404
  args: [{
343
- declarations: [declarations$2],
344
- exports: [exportedModules$1],
405
+ declarations: [declarations$3],
406
+ exports: [exportedModules$2],
345
407
  imports: [CommonModule]
346
408
  }]
347
409
  }] });
@@ -972,17 +1034,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
972
1034
  args: ['attr.dir']
973
1035
  }] } });
974
1036
 
975
- const templateDirectives$1 = [
1037
+ const templateDirectives$2 = [
976
1038
  BreadCrumbItemTemplateDirective
977
1039
  ];
978
- const exportedModules = [
1040
+ const exportedModules$1 = [
979
1041
  BreadCrumbComponent,
980
1042
  BreadCrumbItemComponent,
981
1043
  BreadCrumbListComponent,
982
- ...templateDirectives$1
1044
+ ...templateDirectives$2
983
1045
  ];
984
- const declarations$1 = [
985
- ...exportedModules,
1046
+ const declarations$2 = [
1047
+ ...exportedModules$1,
986
1048
  BreadCrumbSeparatorDirective
987
1049
  ];
988
1050
  /**
@@ -1028,8 +1090,8 @@ BreadCrumbModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versio
1028
1090
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BreadCrumbModule, decorators: [{
1029
1091
  type: NgModule,
1030
1092
  args: [{
1031
- declarations: [declarations$1],
1032
- exports: [exportedModules],
1093
+ declarations: [declarations$2],
1094
+ exports: [exportedModules$1],
1033
1095
  imports: [CommonModule, ResizeSensorModule]
1034
1096
  }]
1035
1097
  }] });
@@ -1506,9 +1568,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1506
1568
  args: [BottomNavigationItemTemplateDirective, { static: false }]
1507
1569
  }] } });
1508
1570
 
1509
- const templateDirectives = [BottomNavigationItemTemplateDirective];
1510
- const exportedComponents = [BottomNavigationComponent, ...templateDirectives];
1511
- const declarations = [BottomNavigationItemComponent, ...exportedComponents];
1571
+ const templateDirectives$1 = [BottomNavigationItemTemplateDirective];
1572
+ const exportedComponents = [BottomNavigationComponent, ...templateDirectives$1];
1573
+ const declarations$1 = [BottomNavigationItemComponent, ...exportedComponents];
1512
1574
  /**
1513
1575
  * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
1514
1576
  * definition for the BottomNavigation component.
@@ -1548,12 +1610,580 @@ BottomNavigationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
1548
1610
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BottomNavigationModule, decorators: [{
1549
1611
  type: NgModule,
1550
1612
  args: [{
1551
- declarations: [declarations],
1613
+ declarations: [declarations$1],
1552
1614
  exports: [exportedComponents],
1553
1615
  imports: [CommonModule]
1554
1616
  }]
1555
1617
  }] });
1556
1618
 
1619
+ /**
1620
+ * Arguments for the `itemClick` event of the ActionSheet.
1621
+ */
1622
+ class ActionSheetItemClickEvent {
1623
+ }
1624
+
1625
+ /**
1626
+ * Represents a template that defines the title content of the ActionSheet. Utilizing the template overrides both the `title` and `subtitle` of the ActionSheet.
1627
+ * To define the template, nest an `<ng-template>` tag
1628
+ * with the `kendoActionSheetTitleTemplate` directive inside the `<kendo-actionsheet>` tag.
1629
+ */
1630
+ class ActionSheetTitleTemplateDirective {
1631
+ constructor(templateRef) {
1632
+ this.templateRef = templateRef;
1633
+ }
1634
+ }
1635
+ ActionSheetTitleTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetTitleTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
1636
+ ActionSheetTitleTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ActionSheetTitleTemplateDirective, selector: "[kendoActionSheetTitleTemplate]", ngImport: i0 });
1637
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetTitleTemplateDirective, decorators: [{
1638
+ type: Directive,
1639
+ args: [{
1640
+ selector: '[kendoActionSheetTitleTemplate]'
1641
+ }]
1642
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
1643
+ type: Optional
1644
+ }] }]; } });
1645
+
1646
+ /**
1647
+ * Represents a template that defines the item content of the ActionSheet.
1648
+ * To define the template, nest an `<ng-template>` tag
1649
+ * with the `kendoActionSheetItemTemplate` directive inside the `<kendo-actionsheet>` tag.
1650
+ */
1651
+ class ActionSheetItemTemplateDirective {
1652
+ constructor(templateRef) {
1653
+ this.templateRef = templateRef;
1654
+ }
1655
+ }
1656
+ ActionSheetItemTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetItemTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
1657
+ ActionSheetItemTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ActionSheetItemTemplateDirective, selector: "[kendoActionSheetItemTemplate]", ngImport: i0 });
1658
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetItemTemplateDirective, decorators: [{
1659
+ type: Directive,
1660
+ args: [{
1661
+ selector: '[kendoActionSheetItemTemplate]'
1662
+ }]
1663
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
1664
+ type: Optional
1665
+ }] }]; } });
1666
+
1667
+ /**
1668
+ * @hidden
1669
+ */
1670
+ class ActionSheetItemComponent {
1671
+ constructor() {
1672
+ this.pointerClass = true;
1673
+ }
1674
+ manageIconClasses(item) {
1675
+ let classes = ['k-actionsheet-item-icon'];
1676
+ if (item.icon) {
1677
+ classes.push(`k-icon k-i-${item.icon}`);
1678
+ }
1679
+ if (item.iconClass) {
1680
+ classes.push(`${item.iconClass}`);
1681
+ }
1682
+ const isHexColor = isPresent(item.iconColor) && hexColorRegex.test(item.iconColor);
1683
+ const isThemeColor = isPresent(item.iconColor) && item.iconColor !== '' && !isHexColor;
1684
+ if (isThemeColor) {
1685
+ classes.push(`k-text-${item.iconColor}`);
1686
+ }
1687
+ return classes.join(' ');
1688
+ }
1689
+ manageIconStyles(item) {
1690
+ const isHexColor = isPresent(item.iconColor) && hexColorRegex.test(item.iconColor);
1691
+ const isSizeSet = isPresent(item.iconSize) && item.iconSize !== '';
1692
+ const styles = {};
1693
+ if (isHexColor) {
1694
+ styles.color = item.iconColor;
1695
+ }
1696
+ if (isSizeSet) {
1697
+ styles.fontSize = item.iconSize;
1698
+ }
1699
+ return styles;
1700
+ }
1701
+ }
1702
+ ActionSheetItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1703
+ ActionSheetItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ActionSheetItemComponent, selector: "[kendoActionSheetItem]", inputs: { itemTemplate: "itemTemplate", item: "item" }, host: { properties: { "class.k-cursor-pointer": "this.pointerClass" } }, ngImport: i0, template: `
1704
+ <span class="k-actionsheet-action"
1705
+ tabindex="0"
1706
+ role="button"
1707
+ [attr.aria-disabled]="item.disabled">
1708
+ <ng-template *ngIf="itemTemplate; else defaultTemplate"
1709
+ [ngTemplateOutlet]="itemTemplate"
1710
+ [ngTemplateOutletContext]="{
1711
+ $implicit: item
1712
+ }">
1713
+ </ng-template>
1714
+ <ng-template #defaultTemplate>
1715
+ <span *ngIf="item.icon || item.iconClass" class="k-icon-wrap">
1716
+ <span
1717
+ [class]="manageIconClasses(item)"
1718
+ [style]="manageIconStyles(item)">
1719
+ </span>
1720
+ </span>
1721
+ <span *ngIf="item.title || item.description" class="k-actionsheet-item-text">
1722
+ <span *ngIf="item.title" class="k-actionsheet-item-title">{{item.title}}</span>
1723
+ <span *ngIf="item.description" class="k-actionsheet-item-description">{{item.description}}</span>
1724
+ </span>
1725
+ </ng-template>
1726
+ </span>
1727
+ `, isInline: true, directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
1728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetItemComponent, decorators: [{
1729
+ type: Component,
1730
+ args: [{
1731
+ // eslint-disable-next-line @angular-eslint/component-selector
1732
+ selector: '[kendoActionSheetItem]',
1733
+ template: `
1734
+ <span class="k-actionsheet-action"
1735
+ tabindex="0"
1736
+ role="button"
1737
+ [attr.aria-disabled]="item.disabled">
1738
+ <ng-template *ngIf="itemTemplate; else defaultTemplate"
1739
+ [ngTemplateOutlet]="itemTemplate"
1740
+ [ngTemplateOutletContext]="{
1741
+ $implicit: item
1742
+ }">
1743
+ </ng-template>
1744
+ <ng-template #defaultTemplate>
1745
+ <span *ngIf="item.icon || item.iconClass" class="k-icon-wrap">
1746
+ <span
1747
+ [class]="manageIconClasses(item)"
1748
+ [style]="manageIconStyles(item)">
1749
+ </span>
1750
+ </span>
1751
+ <span *ngIf="item.title || item.description" class="k-actionsheet-item-text">
1752
+ <span *ngIf="item.title" class="k-actionsheet-item-title">{{item.title}}</span>
1753
+ <span *ngIf="item.description" class="k-actionsheet-item-description">{{item.description}}</span>
1754
+ </span>
1755
+ </ng-template>
1756
+ </span>
1757
+ `
1758
+ }]
1759
+ }], propDecorators: { itemTemplate: [{
1760
+ type: Input
1761
+ }], item: [{
1762
+ type: Input
1763
+ }], pointerClass: [{
1764
+ type: HostBinding,
1765
+ args: ['class.k-cursor-pointer']
1766
+ }] } });
1767
+
1768
+ /**
1769
+ * @hidden
1770
+ */
1771
+ class ActionSheetListComponent {
1772
+ constructor(renderer, ngZone, element) {
1773
+ this.renderer = renderer;
1774
+ this.ngZone = ngZone;
1775
+ this.element = element;
1776
+ this.groupItems = [];
1777
+ this.allItems = [];
1778
+ this.itemClick = new EventEmitter();
1779
+ this.subscriptions = new Subscription();
1780
+ }
1781
+ ngAfterViewInit() {
1782
+ this.initDomEvents();
1783
+ }
1784
+ ngOnDestroy() {
1785
+ this.subscriptions.unsubscribe();
1786
+ }
1787
+ initDomEvents() {
1788
+ if (!this.element) {
1789
+ return;
1790
+ }
1791
+ this.ngZone.runOutsideAngular(() => {
1792
+ const nativeElement = this.element.nativeElement;
1793
+ this.subscriptions.add(this.renderer.listen(nativeElement, 'click', this.clickHandler.bind(this)));
1794
+ });
1795
+ }
1796
+ clickHandler(e) {
1797
+ const itemIndex = getActionSheetItemIndex(e.target);
1798
+ const item = this.allItems[itemIndex];
1799
+ if (!item) {
1800
+ return;
1801
+ }
1802
+ if (item.disabled) {
1803
+ e.preventDefault();
1804
+ return;
1805
+ }
1806
+ this.ngZone.run(() => {
1807
+ this.itemClick.emit({ item, originalEvent: e });
1808
+ });
1809
+ }
1810
+ }
1811
+ ActionSheetListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetListComponent, deps: [{ token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1812
+ ActionSheetListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ActionSheetListComponent, selector: "[kendoActionSheetList]", inputs: { groupItems: "groupItems", allItems: "allItems", itemTemplate: "itemTemplate" }, outputs: { itemClick: "itemClick" }, ngImport: i0, template: `
1813
+ <li *ngFor="let item of groupItems" kendoActionSheetItem
1814
+ role="none"
1815
+ [class.k-actionsheet-item]="true"
1816
+ [class.k-disabled]="item.disabled"
1817
+ [ngClass]="item.cssClass"
1818
+ [ngStyle]="item.cssStyle"
1819
+ [itemTemplate]="itemTemplate"
1820
+ [item]="item">
1821
+ </li>
1822
+ `, isInline: true, components: [{ type: ActionSheetItemComponent, selector: "[kendoActionSheetItem]", inputs: ["itemTemplate", "item"] }], directives: [{ type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1823
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetListComponent, decorators: [{
1824
+ type: Component,
1825
+ args: [{
1826
+ // eslint-disable-next-line @angular-eslint/component-selector
1827
+ selector: '[kendoActionSheetList]',
1828
+ template: `
1829
+ <li *ngFor="let item of groupItems" kendoActionSheetItem
1830
+ role="none"
1831
+ [class.k-actionsheet-item]="true"
1832
+ [class.k-disabled]="item.disabled"
1833
+ [ngClass]="item.cssClass"
1834
+ [ngStyle]="item.cssStyle"
1835
+ [itemTemplate]="itemTemplate"
1836
+ [item]="item">
1837
+ </li>
1838
+ `
1839
+ }]
1840
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { groupItems: [{
1841
+ type: Input
1842
+ }], allItems: [{
1843
+ type: Input
1844
+ }], itemTemplate: [{
1845
+ type: Input
1846
+ }], itemClick: [{
1847
+ type: Output
1848
+ }] } });
1849
+
1850
+ /**
1851
+ * Represents the [Kendo UI ActionSheet component for Angular]({% slug overview_actionsheet %}).
1852
+ * Used to display a set of choices related to a task the user initiates.
1853
+ */
1854
+ class ActionSheetComponent {
1855
+ constructor(element, ngZone, renderer, localizationService) {
1856
+ this.element = element;
1857
+ this.ngZone = ngZone;
1858
+ this.renderer = renderer;
1859
+ this.localizationService = localizationService;
1860
+ /**
1861
+ * @hidden
1862
+ */
1863
+ this.hostClass = true;
1864
+ /**
1865
+ * Fires when an ActionSheet item is clicked.
1866
+ */
1867
+ this.itemClick = new EventEmitter();
1868
+ /**
1869
+ * Fires when the modal overlay is clicked.
1870
+ */
1871
+ this.overlayClick = new EventEmitter();
1872
+ /**
1873
+ * @hidden
1874
+ */
1875
+ this.titleId = null;
1876
+ this.rtl = false;
1877
+ this.domSubs = new Subscription();
1878
+ validatePackage(packageMetadata);
1879
+ this.dynamicRTLSubscription = this.localizationService.changes.subscribe(({ rtl }) => {
1880
+ this.rtl = rtl;
1881
+ this.direction = this.rtl ? 'rtl' : 'ltr';
1882
+ });
1883
+ this.titleId = getId('k-actionsheet-title');
1884
+ }
1885
+ ngAfterViewInit() {
1886
+ this.handleInitialFocus();
1887
+ this.initDomEvents();
1888
+ }
1889
+ ngOnDestroy() {
1890
+ this.domSubs.unsubscribe();
1891
+ if (this.dynamicRTLSubscription) {
1892
+ this.dynamicRTLSubscription.unsubscribe();
1893
+ }
1894
+ }
1895
+ /**
1896
+ * @hidden
1897
+ */
1898
+ get topGroupItems() {
1899
+ var _a;
1900
+ return (_a = this.items) === null || _a === void 0 ? void 0 : _a.filter(item => !item.group || item.group === 'top');
1901
+ }
1902
+ /**
1903
+ * @hidden
1904
+ */
1905
+ get bottomGroupItems() {
1906
+ var _a;
1907
+ return (_a = this.items) === null || _a === void 0 ? void 0 : _a.filter(item => item.group === 'bottom');
1908
+ }
1909
+ /**
1910
+ * @hidden
1911
+ */
1912
+ onItemClick(ev) {
1913
+ this.itemClick.emit(ev);
1914
+ }
1915
+ /**
1916
+ * @hidden
1917
+ */
1918
+ onOverlayClick() {
1919
+ this.overlayClick.emit();
1920
+ }
1921
+ /**
1922
+ * @hidden
1923
+ */
1924
+ get shouldRenderSeparator() {
1925
+ var _a, _b;
1926
+ return ((_a = this.topGroupItems) === null || _a === void 0 ? void 0 : _a.length) > 0 && ((_b = this.bottomGroupItems) === null || _b === void 0 ? void 0 : _b.length) > 0;
1927
+ }
1928
+ initDomEvents() {
1929
+ if (!this.element) {
1930
+ return;
1931
+ }
1932
+ this.ngZone.runOutsideAngular(() => {
1933
+ this.domSubs.add(this.renderer.listen(this.element.nativeElement, 'keydown', (ev) => {
1934
+ this.onKeyDown(ev);
1935
+ }));
1936
+ });
1937
+ }
1938
+ onKeyDown(event) {
1939
+ const target = event.target;
1940
+ if (event.keyCode === Keys.Tab) {
1941
+ this.ngZone.run(() => {
1942
+ this.keepFocusWithinComponent(target, event);
1943
+ });
1944
+ }
1945
+ if (event.keyCode === Keys.Escape) {
1946
+ this.ngZone.run(() => {
1947
+ this.overlayClick.emit();
1948
+ });
1949
+ }
1950
+ if (event.keyCode === Keys.Enter) {
1951
+ this.ngZone.run(() => {
1952
+ this.triggerItemClick(target, event);
1953
+ });
1954
+ }
1955
+ }
1956
+ handleInitialFocus() {
1957
+ const [firstFocusable] = getFirstAndLastFocusable(this.element.nativeElement);
1958
+ if (firstFocusable) {
1959
+ firstFocusable.focus();
1960
+ }
1961
+ }
1962
+ keepFocusWithinComponent(target, event) {
1963
+ const wrapper = this.element.nativeElement;
1964
+ const [firstFocusable, lastFocusable] = getFirstAndLastFocusable(wrapper);
1965
+ const tabAfterLastFocusable = !event.shiftKey && target === lastFocusable;
1966
+ const shiftTabAfterFirstFocusable = event.shiftKey && target === firstFocusable;
1967
+ if (tabAfterLastFocusable) {
1968
+ event.preventDefault();
1969
+ firstFocusable.focus();
1970
+ }
1971
+ if (shiftTabAfterFirstFocusable) {
1972
+ event.preventDefault();
1973
+ lastFocusable.focus();
1974
+ }
1975
+ }
1976
+ triggerItemClick(target, event) {
1977
+ const itemIndex = getActionSheetItemIndex(target);
1978
+ const item = this.items[itemIndex];
1979
+ if (!item || item.disabled) {
1980
+ return;
1981
+ }
1982
+ this.itemClick.emit({ item, originalEvent: event });
1983
+ }
1984
+ }
1985
+ ActionSheetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
1986
+ ActionSheetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ActionSheetComponent, selector: "kendo-actionsheet", inputs: { title: "title", subtitle: "subtitle", items: "items" }, outputs: { itemClick: "itemClick", overlayClick: "overlayClick" }, host: { properties: { "class.k-actionsheet-container": "this.hostClass", "attr.dir": "this.direction" } }, providers: [
1987
+ LocalizationService,
1988
+ {
1989
+ provide: L10N_PREFIX,
1990
+ useValue: 'kendo.actionsheet.component'
1991
+ }
1992
+ ], queries: [{ propertyName: "titleTemplate", first: true, predicate: ActionSheetTitleTemplateDirective, descendants: true }, { propertyName: "itemTemplate", first: true, predicate: ActionSheetItemTemplateDirective, descendants: true }], exportAs: ["kendoActionSheet"], ngImport: i0, template: `
1993
+ <div class="k-overlay" (click)="onOverlayClick()"></div>
1994
+ <div class="k-animation-container">
1995
+ <div class="k-child-animation-container">
1996
+ <div class="k-actionsheet k-actionsheet-bottom"
1997
+ role="dialog"
1998
+ aria-modal="true"
1999
+ [attr.aria-labelledby]="titleId">
2000
+
2001
+ <div *ngIf="title || titleTemplate" class="k-actionsheet-titlebar">
2002
+ <div class="k-actionsheet-titlebar-group k-hbox">
2003
+ <div class="k-actionsheet-title" [id]="titleId">
2004
+ <ng-template *ngIf="titleTemplate; else defaultTemplate"
2005
+ [ngTemplateOutlet]="titleTemplate?.templateRef">
2006
+ </ng-template>
2007
+ <ng-template #defaultTemplate>
2008
+ <div *ngIf="title" class="k-text-center">{{title}}</div>
2009
+ <div *ngIf="subtitle" class="k-actionsheet-subtitle k-text-center">{{subtitle}}</div>
2010
+ </ng-template>
2011
+ </div>
2012
+ </div>
2013
+ </div>
2014
+
2015
+ <div *ngIf="topGroupItems || bottomGroupItems" class="k-actionsheet-content">
2016
+ <ul *ngIf="topGroupItems" kendoActionSheetList
2017
+ class="k-list-ul"
2018
+ role="group"
2019
+ [groupItems]="topGroupItems"
2020
+ [allItems]="items"
2021
+ [itemTemplate]="itemTemplate?.templateRef"
2022
+ (itemClick)="onItemClick($event)">
2023
+ </ul>
2024
+
2025
+ <hr *ngIf="shouldRenderSeparator" class="k-hr"/>
2026
+
2027
+ <ul *ngIf="bottomGroupItems" kendoActionSheetList
2028
+ class="k-list-ul"
2029
+ role="group"
2030
+ [groupItems]="bottomGroupItems"
2031
+ [allItems]="items"
2032
+ [itemTemplate]="itemTemplate?.templateRef"
2033
+ (itemClick)="onItemClick($event)">
2034
+ </ul>
2035
+ </div>
2036
+ </div>
2037
+ </div>
2038
+ </div>
2039
+ `, isInline: true, components: [{ type: ActionSheetListComponent, selector: "[kendoActionSheetList]", inputs: ["groupItems", "allItems", "itemTemplate"], outputs: ["itemClick"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
2040
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetComponent, decorators: [{
2041
+ type: Component,
2042
+ args: [{
2043
+ exportAs: 'kendoActionSheet',
2044
+ selector: 'kendo-actionsheet',
2045
+ template: `
2046
+ <div class="k-overlay" (click)="onOverlayClick()"></div>
2047
+ <div class="k-animation-container">
2048
+ <div class="k-child-animation-container">
2049
+ <div class="k-actionsheet k-actionsheet-bottom"
2050
+ role="dialog"
2051
+ aria-modal="true"
2052
+ [attr.aria-labelledby]="titleId">
2053
+
2054
+ <div *ngIf="title || titleTemplate" class="k-actionsheet-titlebar">
2055
+ <div class="k-actionsheet-titlebar-group k-hbox">
2056
+ <div class="k-actionsheet-title" [id]="titleId">
2057
+ <ng-template *ngIf="titleTemplate; else defaultTemplate"
2058
+ [ngTemplateOutlet]="titleTemplate?.templateRef">
2059
+ </ng-template>
2060
+ <ng-template #defaultTemplate>
2061
+ <div *ngIf="title" class="k-text-center">{{title}}</div>
2062
+ <div *ngIf="subtitle" class="k-actionsheet-subtitle k-text-center">{{subtitle}}</div>
2063
+ </ng-template>
2064
+ </div>
2065
+ </div>
2066
+ </div>
2067
+
2068
+ <div *ngIf="topGroupItems || bottomGroupItems" class="k-actionsheet-content">
2069
+ <ul *ngIf="topGroupItems" kendoActionSheetList
2070
+ class="k-list-ul"
2071
+ role="group"
2072
+ [groupItems]="topGroupItems"
2073
+ [allItems]="items"
2074
+ [itemTemplate]="itemTemplate?.templateRef"
2075
+ (itemClick)="onItemClick($event)">
2076
+ </ul>
2077
+
2078
+ <hr *ngIf="shouldRenderSeparator" class="k-hr"/>
2079
+
2080
+ <ul *ngIf="bottomGroupItems" kendoActionSheetList
2081
+ class="k-list-ul"
2082
+ role="group"
2083
+ [groupItems]="bottomGroupItems"
2084
+ [allItems]="items"
2085
+ [itemTemplate]="itemTemplate?.templateRef"
2086
+ (itemClick)="onItemClick($event)">
2087
+ </ul>
2088
+ </div>
2089
+ </div>
2090
+ </div>
2091
+ </div>
2092
+ `,
2093
+ providers: [
2094
+ LocalizationService,
2095
+ {
2096
+ provide: L10N_PREFIX,
2097
+ useValue: 'kendo.actionsheet.component'
2098
+ }
2099
+ ]
2100
+ }]
2101
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }]; }, propDecorators: { hostClass: [{
2102
+ type: HostBinding,
2103
+ args: ['class.k-actionsheet-container']
2104
+ }], direction: [{
2105
+ type: HostBinding,
2106
+ args: ['attr.dir']
2107
+ }], title: [{
2108
+ type: Input
2109
+ }], subtitle: [{
2110
+ type: Input
2111
+ }], items: [{
2112
+ type: Input
2113
+ }], itemClick: [{
2114
+ type: Output
2115
+ }], overlayClick: [{
2116
+ type: Output
2117
+ }], titleTemplate: [{
2118
+ type: ContentChild,
2119
+ args: [ActionSheetTitleTemplateDirective]
2120
+ }], itemTemplate: [{
2121
+ type: ContentChild,
2122
+ args: [ActionSheetItemTemplateDirective]
2123
+ }] } });
2124
+
2125
+ const templateDirectives = [
2126
+ ActionSheetTitleTemplateDirective,
2127
+ ActionSheetItemTemplateDirective
2128
+ ];
2129
+ const exportedModules = [
2130
+ ActionSheetComponent,
2131
+ ...templateDirectives
2132
+ ];
2133
+ const declarations = [
2134
+ ActionSheetItemComponent,
2135
+ ActionSheetListComponent,
2136
+ ...exportedModules
2137
+ ];
2138
+ /**
2139
+ * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
2140
+ * definition for the ActionSheet component.
2141
+ *
2142
+ * * @example
2143
+ *
2144
+ * ```ts-no-run
2145
+ * // Import the ActionSheet module
2146
+ * import { ActionSheetModule } from '@progress/kendo-angular-navigation';
2147
+ *
2148
+ * // The browser platform with a compiler
2149
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2150
+ * import { BrowserModule } from '@angular/platform-browser';
2151
+ *
2152
+ * import { NgModule } from '@angular/core';
2153
+ *
2154
+ * // Import the app component
2155
+ * import { AppComponent } from './app.component';
2156
+ *
2157
+ * // Define the app module
2158
+ * _@NgModule({
2159
+ * declarations: [AppComponent], // declare app component
2160
+ * imports: [BrowserModule, ActionSheetModule], // import ActionSheet module
2161
+ * bootstrap: [AppComponent]
2162
+ * })
2163
+ * export class AppModule {}
2164
+ *
2165
+ * // Compile and launch the module
2166
+ * platformBrowserDynamic().bootstrapModule(AppModule);
2167
+ *
2168
+ * ```
2169
+ */
2170
+ class ActionSheetModule {
2171
+ }
2172
+ ActionSheetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2173
+ ActionSheetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetModule, declarations: [ActionSheetItemComponent,
2174
+ ActionSheetListComponent, ActionSheetComponent, ActionSheetTitleTemplateDirective,
2175
+ ActionSheetItemTemplateDirective], imports: [CommonModule], exports: [ActionSheetComponent, ActionSheetTitleTemplateDirective,
2176
+ ActionSheetItemTemplateDirective] });
2177
+ ActionSheetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetModule, imports: [[CommonModule]] });
2178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetModule, decorators: [{
2179
+ type: NgModule,
2180
+ args: [{
2181
+ declarations: [declarations],
2182
+ exports: [exportedModules],
2183
+ imports: [CommonModule]
2184
+ }]
2185
+ }] });
2186
+
1557
2187
  /**
1558
2188
  * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
1559
2189
  * definition for the Navigation components.
@@ -1590,17 +2220,20 @@ class NavigationModule {
1590
2220
  NavigationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1591
2221
  NavigationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationModule, exports: [AppBarModule,
1592
2222
  BreadCrumbModule,
1593
- BottomNavigationModule] });
2223
+ BottomNavigationModule,
2224
+ ActionSheetModule] });
1594
2225
  NavigationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationModule, imports: [AppBarModule,
1595
2226
  BreadCrumbModule,
1596
- BottomNavigationModule] });
2227
+ BottomNavigationModule,
2228
+ ActionSheetModule] });
1597
2229
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationModule, decorators: [{
1598
2230
  type: NgModule,
1599
2231
  args: [{
1600
2232
  exports: [
1601
2233
  AppBarModule,
1602
2234
  BreadCrumbModule,
1603
- BottomNavigationModule
2235
+ BottomNavigationModule,
2236
+ ActionSheetModule
1604
2237
  ]
1605
2238
  }]
1606
2239
  }] });
@@ -1611,5 +2244,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1611
2244
  * Generated bundle index. Do not edit.
1612
2245
  */
1613
2246
 
1614
- export { AppBarComponent, AppBarModule, AppBarSectionComponent, AppBarSpacerComponent, BottomNavigationComponent, BottomNavigationItemTemplateDirective, BottomNavigationModule, BottomNavigationSelectEvent, BreadCrumbComponent, BreadCrumbItemComponent, BreadCrumbItemTemplateDirective, BreadCrumbListComponent, BreadCrumbModule, NavigationModule };
2247
+ export { ActionSheetComponent, ActionSheetItemClickEvent, ActionSheetItemTemplateDirective, ActionSheetModule, ActionSheetTitleTemplateDirective, AppBarComponent, AppBarModule, AppBarSectionComponent, AppBarSpacerComponent, BottomNavigationComponent, BottomNavigationItemTemplateDirective, BottomNavigationModule, BottomNavigationSelectEvent, BreadCrumbComponent, BreadCrumbItemComponent, BreadCrumbItemTemplateDirective, BreadCrumbListComponent, BreadCrumbModule, NavigationModule };
1615
2248