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

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.
@@ -6,9 +6,9 @@ import { Component, ContentChild, EventEmitter, HostBinding, Input, Output } fro
6
6
  import { validatePackage } from '@progress/kendo-licensing';
7
7
  import { packageMetadata } from '../package-metadata';
8
8
  import { Subscription } from 'rxjs';
9
- import { ActionSheetTitleTemplateDirective, ActionSheetItemTemplateDirective } from './models';
9
+ import { ActionSheetHeaderTemplateDirective, ActionSheetItemTemplateDirective, ActionSheetContentTemplateDirective, ActionSheetFooterTemplateDirective } from './models';
10
10
  import { Keys } from '@progress/kendo-angular-common';
11
- import { getId, getActionSheetItemIndex, getFirstAndLastFocusable } from '../common/util';
11
+ import { getId, getActionSheetItemIndex, getFirstAndLastFocusable, ACTIONSHEET_ITEM_INDEX_ATTRIBUTE } from '../common/util';
12
12
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
13
13
  import * as i0 from "@angular/core";
14
14
  import * as i1 from "@progress/kendo-angular-l10n";
@@ -141,7 +141,7 @@ export class ActionSheetComponent {
141
141
  }
142
142
  }
143
143
  triggerItemClick(target, event) {
144
- const itemIndex = getActionSheetItemIndex(target);
144
+ const itemIndex = getActionSheetItemIndex(target, ACTIONSHEET_ITEM_INDEX_ATTRIBUTE, this.element.nativeElement);
145
145
  const item = this.items[itemIndex];
146
146
  if (!item || item.disabled) {
147
147
  return;
@@ -156,20 +156,21 @@ ActionSheetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
156
156
  provide: L10N_PREFIX,
157
157
  useValue: 'kendo.actionsheet.component'
158
158
  }
159
- ], queries: [{ propertyName: "titleTemplate", first: true, predicate: ActionSheetTitleTemplateDirective, descendants: true }, { propertyName: "itemTemplate", first: true, predicate: ActionSheetItemTemplateDirective, descendants: true }], exportAs: ["kendoActionSheet"], ngImport: i0, template: `
159
+ ], queries: [{ propertyName: "headerTemplate", first: true, predicate: ActionSheetHeaderTemplateDirective, descendants: true }, { propertyName: "contentTemplate", first: true, predicate: ActionSheetContentTemplateDirective, descendants: true }, { propertyName: "itemTemplate", first: true, predicate: ActionSheetItemTemplateDirective, descendants: true }, { propertyName: "footerTemplate", first: true, predicate: ActionSheetFooterTemplateDirective, descendants: true }], exportAs: ["kendoActionSheet"], ngImport: i0, template: `
160
160
  <div class="k-overlay" (click)="onOverlayClick()"></div>
161
161
  <div class="k-animation-container">
162
- <div class="k-child-animation-container">
162
+ <div class="k-child-animation-container" style="bottom: 0px; width: 100%;">
163
163
  <div class="k-actionsheet k-actionsheet-bottom"
164
+ style="--kendo-actionsheet-height: auto; --kendo-actionsheet-max-height: none;"
164
165
  role="dialog"
165
166
  aria-modal="true"
166
167
  [attr.aria-labelledby]="titleId">
167
168
 
168
- <div *ngIf="title || titleTemplate" class="k-actionsheet-titlebar">
169
+ <div *ngIf="title || headerTemplate" class="k-actionsheet-titlebar">
169
170
  <div class="k-actionsheet-titlebar-group k-hbox">
170
171
  <div class="k-actionsheet-title" [id]="titleId">
171
- <ng-template *ngIf="titleTemplate; else defaultTemplate"
172
- [ngTemplateOutlet]="titleTemplate?.templateRef">
172
+ <ng-template *ngIf="headerTemplate; else defaultTemplate"
173
+ [ngTemplateOutlet]="headerTemplate?.templateRef">
173
174
  </ng-template>
174
175
  <ng-template #defaultTemplate>
175
176
  <div *ngIf="title" class="k-text-center">{{title}}</div>
@@ -179,26 +180,36 @@ ActionSheetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
179
180
  </div>
180
181
  </div>
181
182
 
182
- <div *ngIf="topGroupItems || bottomGroupItems" class="k-actionsheet-content">
183
- <ul *ngIf="topGroupItems" kendoActionSheetList
184
- class="k-list-ul"
185
- role="group"
186
- [groupItems]="topGroupItems"
187
- [allItems]="items"
188
- [itemTemplate]="itemTemplate?.templateRef"
189
- (itemClick)="onItemClick($event)">
190
- </ul>
191
-
192
- <hr *ngIf="shouldRenderSeparator" class="k-hr"/>
193
-
194
- <ul *ngIf="bottomGroupItems" kendoActionSheetList
195
- class="k-list-ul"
196
- role="group"
197
- [groupItems]="bottomGroupItems"
198
- [allItems]="items"
199
- [itemTemplate]="itemTemplate?.templateRef"
200
- (itemClick)="onItemClick($event)">
201
- </ul>
183
+ <div *ngIf="items || contentTemplate" class="k-actionsheet-content">
184
+ <ng-template *ngIf="contentTemplate; else defaultContentTemplate"
185
+ [ngTemplateOutlet]="contentTemplate?.templateRef">
186
+ </ng-template>
187
+ <ng-template #defaultContentTemplate>
188
+ <div *ngIf="topGroupItems" kendoActionSheetList
189
+ class="k-list-ul"
190
+ role="group"
191
+ [groupItems]="topGroupItems"
192
+ [allItems]="items"
193
+ [itemTemplate]="itemTemplate?.templateRef"
194
+ (itemClick)="onItemClick($event)">
195
+ </div>
196
+
197
+ <hr *ngIf="shouldRenderSeparator" class="k-hr"/>
198
+
199
+ <div *ngIf="bottomGroupItems" kendoActionSheetList
200
+ class="k-list-ul"
201
+ role="group"
202
+ [groupItems]="bottomGroupItems"
203
+ [allItems]="items"
204
+ [itemTemplate]="itemTemplate?.templateRef"
205
+ (itemClick)="onItemClick($event)">
206
+ </div>
207
+ </ng-template>
208
+ </div>
209
+ <div *ngIf="footerTemplate" class="k-actionsheet-footer">
210
+ <ng-template
211
+ [ngTemplateOutlet]="footerTemplate?.templateRef">
212
+ </ng-template>
202
213
  </div>
203
214
  </div>
204
215
  </div>
@@ -212,17 +223,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
212
223
  template: `
213
224
  <div class="k-overlay" (click)="onOverlayClick()"></div>
214
225
  <div class="k-animation-container">
215
- <div class="k-child-animation-container">
226
+ <div class="k-child-animation-container" style="bottom: 0px; width: 100%;">
216
227
  <div class="k-actionsheet k-actionsheet-bottom"
228
+ style="--kendo-actionsheet-height: auto; --kendo-actionsheet-max-height: none;"
217
229
  role="dialog"
218
230
  aria-modal="true"
219
231
  [attr.aria-labelledby]="titleId">
220
232
 
221
- <div *ngIf="title || titleTemplate" class="k-actionsheet-titlebar">
233
+ <div *ngIf="title || headerTemplate" class="k-actionsheet-titlebar">
222
234
  <div class="k-actionsheet-titlebar-group k-hbox">
223
235
  <div class="k-actionsheet-title" [id]="titleId">
224
- <ng-template *ngIf="titleTemplate; else defaultTemplate"
225
- [ngTemplateOutlet]="titleTemplate?.templateRef">
236
+ <ng-template *ngIf="headerTemplate; else defaultTemplate"
237
+ [ngTemplateOutlet]="headerTemplate?.templateRef">
226
238
  </ng-template>
227
239
  <ng-template #defaultTemplate>
228
240
  <div *ngIf="title" class="k-text-center">{{title}}</div>
@@ -232,26 +244,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
232
244
  </div>
233
245
  </div>
234
246
 
235
- <div *ngIf="topGroupItems || bottomGroupItems" class="k-actionsheet-content">
236
- <ul *ngIf="topGroupItems" kendoActionSheetList
237
- class="k-list-ul"
238
- role="group"
239
- [groupItems]="topGroupItems"
240
- [allItems]="items"
241
- [itemTemplate]="itemTemplate?.templateRef"
242
- (itemClick)="onItemClick($event)">
243
- </ul>
244
-
245
- <hr *ngIf="shouldRenderSeparator" class="k-hr"/>
246
-
247
- <ul *ngIf="bottomGroupItems" kendoActionSheetList
248
- class="k-list-ul"
249
- role="group"
250
- [groupItems]="bottomGroupItems"
251
- [allItems]="items"
252
- [itemTemplate]="itemTemplate?.templateRef"
253
- (itemClick)="onItemClick($event)">
254
- </ul>
247
+ <div *ngIf="items || contentTemplate" class="k-actionsheet-content">
248
+ <ng-template *ngIf="contentTemplate; else defaultContentTemplate"
249
+ [ngTemplateOutlet]="contentTemplate?.templateRef">
250
+ </ng-template>
251
+ <ng-template #defaultContentTemplate>
252
+ <div *ngIf="topGroupItems" kendoActionSheetList
253
+ class="k-list-ul"
254
+ role="group"
255
+ [groupItems]="topGroupItems"
256
+ [allItems]="items"
257
+ [itemTemplate]="itemTemplate?.templateRef"
258
+ (itemClick)="onItemClick($event)">
259
+ </div>
260
+
261
+ <hr *ngIf="shouldRenderSeparator" class="k-hr"/>
262
+
263
+ <div *ngIf="bottomGroupItems" kendoActionSheetList
264
+ class="k-list-ul"
265
+ role="group"
266
+ [groupItems]="bottomGroupItems"
267
+ [allItems]="items"
268
+ [itemTemplate]="itemTemplate?.templateRef"
269
+ (itemClick)="onItemClick($event)">
270
+ </div>
271
+ </ng-template>
272
+ </div>
273
+ <div *ngIf="footerTemplate" class="k-actionsheet-footer">
274
+ <ng-template
275
+ [ngTemplateOutlet]="footerTemplate?.templateRef">
276
+ </ng-template>
255
277
  </div>
256
278
  </div>
257
279
  </div>
@@ -281,10 +303,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
281
303
  type: Output
282
304
  }], overlayClick: [{
283
305
  type: Output
284
- }], titleTemplate: [{
306
+ }], headerTemplate: [{
307
+ type: ContentChild,
308
+ args: [ActionSheetHeaderTemplateDirective]
309
+ }], contentTemplate: [{
285
310
  type: ContentChild,
286
- args: [ActionSheetTitleTemplateDirective]
311
+ args: [ActionSheetContentTemplateDirective]
287
312
  }], itemTemplate: [{
288
313
  type: ContentChild,
289
314
  args: [ActionSheetItemTemplateDirective]
315
+ }], footerTemplate: [{
316
+ type: ContentChild,
317
+ args: [ActionSheetFooterTemplateDirective]
290
318
  }] } });
@@ -43,17 +43,14 @@ export class ActionSheetItemComponent {
43
43
  }
44
44
  ActionSheetItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
45
45
  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: `
46
- <span class="k-actionsheet-action"
47
- tabindex="0"
48
- role="button"
49
- [attr.aria-disabled]="item.disabled">
50
- <ng-template *ngIf="itemTemplate; else defaultTemplate"
51
- [ngTemplateOutlet]="itemTemplate"
52
- [ngTemplateOutletContext]="{
53
- $implicit: item
54
- }">
55
- </ng-template>
56
- <ng-template #defaultTemplate>
46
+ <ng-template *ngIf="itemTemplate; else defaultTemplate"
47
+ [ngTemplateOutlet]="itemTemplate"
48
+ [ngTemplateOutletContext]="{
49
+ $implicit: item
50
+ }">
51
+ </ng-template>
52
+ <ng-template #defaultTemplate>
53
+ <span class="k-actionsheet-action">
57
54
  <span *ngIf="item.icon || item.iconClass" class="k-icon-wrap">
58
55
  <span
59
56
  [class]="manageIconClasses(item)"
@@ -64,8 +61,8 @@ ActionSheetItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0
64
61
  <span *ngIf="item.title" class="k-actionsheet-item-title">{{item.title}}</span>
65
62
  <span *ngIf="item.description" class="k-actionsheet-item-description">{{item.description}}</span>
66
63
  </span>
67
- </ng-template>
68
- </span>
64
+ </span>
65
+ </ng-template>
69
66
  `, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
70
67
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetItemComponent, decorators: [{
71
68
  type: Component,
@@ -73,17 +70,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
73
70
  // eslint-disable-next-line @angular-eslint/component-selector
74
71
  selector: '[kendoActionSheetItem]',
75
72
  template: `
76
- <span class="k-actionsheet-action"
77
- tabindex="0"
78
- role="button"
79
- [attr.aria-disabled]="item.disabled">
80
- <ng-template *ngIf="itemTemplate; else defaultTemplate"
81
- [ngTemplateOutlet]="itemTemplate"
82
- [ngTemplateOutletContext]="{
83
- $implicit: item
84
- }">
85
- </ng-template>
86
- <ng-template #defaultTemplate>
73
+ <ng-template *ngIf="itemTemplate; else defaultTemplate"
74
+ [ngTemplateOutlet]="itemTemplate"
75
+ [ngTemplateOutletContext]="{
76
+ $implicit: item
77
+ }">
78
+ </ng-template>
79
+ <ng-template #defaultTemplate>
80
+ <span class="k-actionsheet-action">
87
81
  <span *ngIf="item.icon || item.iconClass" class="k-icon-wrap">
88
82
  <span
89
83
  [class]="manageIconClasses(item)"
@@ -94,8 +88,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
94
88
  <span *ngIf="item.title" class="k-actionsheet-item-title">{{item.title}}</span>
95
89
  <span *ngIf="item.description" class="k-actionsheet-item-description">{{item.description}}</span>
96
90
  </span>
97
- </ng-template>
98
- </span>
91
+ </span>
92
+ </ng-template>
99
93
  `
100
94
  }]
101
95
  }], propDecorators: { itemTemplate: [{
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { Component, Input, Output, EventEmitter } from "@angular/core";
6
6
  import { Subscription } from "rxjs";
7
- import { getActionSheetItemIndex } from "../common/util";
7
+ import { getActionSheetItemIndex, ACTIONSHEET_ITEM_INDEX_ATTRIBUTE } from "../common/util";
8
8
  import * as i0 from "@angular/core";
9
9
  import * as i1 from "./item.component";
10
10
  import * as i2 from "@angular/common";
@@ -37,7 +37,7 @@ export class ActionSheetListComponent {
37
37
  });
38
38
  }
39
39
  clickHandler(e) {
40
- const itemIndex = getActionSheetItemIndex(e.target);
40
+ const itemIndex = getActionSheetItemIndex(e.target, ACTIONSHEET_ITEM_INDEX_ATTRIBUTE, this.element.nativeElement);
41
41
  const item = this.allItems[itemIndex];
42
42
  if (!item) {
43
43
  return;
@@ -50,34 +50,30 @@ export class ActionSheetListComponent {
50
50
  this.itemClick.emit({ item, originalEvent: e });
51
51
  });
52
52
  }
53
+ setAttrIndex(item) {
54
+ return this.allItems.indexOf(item);
55
+ }
53
56
  }
54
57
  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 });
55
- 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: `
56
- <li *ngFor="let item of groupItems" kendoActionSheetItem
57
- role="none"
58
- [class.k-actionsheet-item]="true"
59
- [class.k-disabled]="item.disabled"
60
- [ngClass]="item.cssClass"
61
- [ngStyle]="item.cssStyle"
62
- [itemTemplate]="itemTemplate"
63
- [item]="item">
64
- </li>
65
- `, isInline: true, components: [{ type: i1.ActionSheetItemComponent, selector: "[kendoActionSheetItem]", inputs: ["itemTemplate", "item"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
58
+ 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: "\n <span *ngFor=\"let item of groupItems\" kendoActionSheetItem\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-disabled]=\"item.disabled\"\n [class.k-actionsheet-item]=\"true\"\n [attr.kendo-actionsheet-item-index]=\"setAttrIndex(item)\"\n [class.k-disabled]=\"item.disabled\"\n [ngClass]=\"item.cssClass\"\n [ngStyle]=\"item.cssStyle\"\n [itemTemplate]=\"itemTemplate\"\n [item]=\"item\">\n </span>\n ", isInline: true, components: [{ type: i1.ActionSheetItemComponent, selector: "[kendoActionSheetItem]", inputs: ["itemTemplate", "item"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
66
59
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetListComponent, decorators: [{
67
60
  type: Component,
68
61
  args: [{
69
62
  // eslint-disable-next-line @angular-eslint/component-selector
70
63
  selector: '[kendoActionSheetList]',
71
64
  template: `
72
- <li *ngFor="let item of groupItems" kendoActionSheetItem
73
- role="none"
65
+ <span *ngFor="let item of groupItems" kendoActionSheetItem
66
+ tabindex="0"
67
+ role="button"
68
+ [attr.aria-disabled]="item.disabled"
74
69
  [class.k-actionsheet-item]="true"
70
+ [attr.${ACTIONSHEET_ITEM_INDEX_ATTRIBUTE}]="setAttrIndex(item)"
75
71
  [class.k-disabled]="item.disabled"
76
72
  [ngClass]="item.cssClass"
77
73
  [ngStyle]="item.cssStyle"
78
74
  [itemTemplate]="itemTemplate"
79
75
  [item]="item">
80
- </li>
76
+ </span>
81
77
  `
82
78
  }]
83
79
  }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { groupItems: [{
@@ -3,5 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  export { ActionSheetItemClickEvent } from './item-click.event';
6
- export { ActionSheetTitleTemplateDirective } from '../templates/title-template.directive';
6
+ export { ActionSheetHeaderTemplateDirective } from '../templates/header-template.directive';
7
7
  export { ActionSheetItemTemplateDirective } from '../templates/item-template.directive';
8
+ export { ActionSheetContentTemplateDirective } from '../templates/content-template.directive';
9
+ export { ActionSheetFooterTemplateDirective } from '../templates/footer-template.directive';
@@ -0,0 +1,26 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Directive, Optional } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents a template that defines the items list content of the ActionSheet.
9
+ * To define the template, nest an `<ng-template>` tag
10
+ * with the `kendoActionSheetContentTemplate` directive inside the `<kendo-actionsheet>` tag.
11
+ */
12
+ export class ActionSheetContentTemplateDirective {
13
+ constructor(templateRef) {
14
+ this.templateRef = templateRef;
15
+ }
16
+ }
17
+ ActionSheetContentTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetContentTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
18
+ ActionSheetContentTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ActionSheetContentTemplateDirective, selector: "[kendoActionSheetContentTemplate]", ngImport: i0 });
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetContentTemplateDirective, decorators: [{
20
+ type: Directive,
21
+ args: [{
22
+ selector: '[kendoActionSheetContentTemplate]'
23
+ }]
24
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
25
+ type: Optional
26
+ }] }]; } });
@@ -0,0 +1,26 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Directive, Optional } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents a template that defines the footer of the ActionSheet.
9
+ * To define the template, nest an `<ng-template>` tag
10
+ * with the `kendoActionSheetFooterTemplate` directive inside the `<kendo-actionsheet>` tag.
11
+ */
12
+ export class ActionSheetFooterTemplateDirective {
13
+ constructor(templateRef) {
14
+ this.templateRef = templateRef;
15
+ }
16
+ }
17
+ ActionSheetFooterTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetFooterTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
18
+ ActionSheetFooterTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ActionSheetFooterTemplateDirective, selector: "[kendoActionSheetFooterTemplate]", ngImport: i0 });
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetFooterTemplateDirective, decorators: [{
20
+ type: Directive,
21
+ args: [{
22
+ selector: '[kendoActionSheetFooterTemplate]'
23
+ }]
24
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
25
+ type: Optional
26
+ }] }]; } });
@@ -0,0 +1,26 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Directive, Optional } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Represents a template that defines the header content of the ActionSheet. Utilizing the template overrides both the `title` and `subtitle` of the ActionSheet.
9
+ * To define the template, nest an `<ng-template>` tag
10
+ * with the `kendoActionSheetHeaderTemplate` directive inside the `<kendo-actionsheet>` tag.
11
+ */
12
+ export class ActionSheetHeaderTemplateDirective {
13
+ constructor(templateRef) {
14
+ this.templateRef = templateRef;
15
+ }
16
+ }
17
+ ActionSheetHeaderTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetHeaderTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
18
+ ActionSheetHeaderTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ActionSheetHeaderTemplateDirective, selector: "[kendoActionSheetHeaderTemplate]", ngImport: i0 });
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetHeaderTemplateDirective, decorators: [{
20
+ type: Directive,
21
+ args: [{
22
+ selector: '[kendoActionSheetHeaderTemplate]'
23
+ }]
24
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
25
+ type: Optional
26
+ }] }]; } });
@@ -5,13 +5,15 @@
5
5
  import { NgModule } from '@angular/core';
6
6
  import { CommonModule } from '@angular/common';
7
7
  import { ActionSheetComponent } from './actionsheet/actionsheet.component';
8
- import { ActionSheetTitleTemplateDirective, ActionSheetItemTemplateDirective } from './actionsheet/models';
8
+ import { ActionSheetHeaderTemplateDirective, ActionSheetItemTemplateDirective, ActionSheetContentTemplateDirective, ActionSheetFooterTemplateDirective } from './actionsheet/models';
9
9
  import { ActionSheetItemComponent } from './actionsheet/item.component';
10
10
  import { ActionSheetListComponent } from './actionsheet/list.component';
11
11
  import * as i0 from "@angular/core";
12
12
  const templateDirectives = [
13
- ActionSheetTitleTemplateDirective,
14
- ActionSheetItemTemplateDirective
13
+ ActionSheetHeaderTemplateDirective,
14
+ ActionSheetItemTemplateDirective,
15
+ ActionSheetContentTemplateDirective,
16
+ ActionSheetFooterTemplateDirective
15
17
  ];
16
18
  const exportedModules = [
17
19
  ActionSheetComponent,
@@ -58,9 +60,13 @@ export class ActionSheetModule {
58
60
  }
59
61
  ActionSheetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
60
62
  ActionSheetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetModule, declarations: [ActionSheetItemComponent,
61
- ActionSheetListComponent, ActionSheetComponent, ActionSheetTitleTemplateDirective,
62
- ActionSheetItemTemplateDirective], imports: [CommonModule], exports: [ActionSheetComponent, ActionSheetTitleTemplateDirective,
63
- ActionSheetItemTemplateDirective] });
63
+ ActionSheetListComponent, ActionSheetComponent, ActionSheetHeaderTemplateDirective,
64
+ ActionSheetItemTemplateDirective,
65
+ ActionSheetContentTemplateDirective,
66
+ ActionSheetFooterTemplateDirective], imports: [CommonModule], exports: [ActionSheetComponent, ActionSheetHeaderTemplateDirective,
67
+ ActionSheetItemTemplateDirective,
68
+ ActionSheetContentTemplateDirective,
69
+ ActionSheetFooterTemplateDirective] });
64
70
  ActionSheetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetModule, imports: [[CommonModule]] });
65
71
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionSheetModule, decorators: [{
66
72
  type: NgModule,
@@ -2,7 +2,7 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { closestInScope, isDocumentAvailable } from "@progress/kendo-angular-common";
5
+ import { closestInScope } from "@progress/kendo-angular-common";
6
6
  /**
7
7
  * @hidden
8
8
  */
@@ -64,17 +64,16 @@ export const getId = (prefix) => {
64
64
  /**
65
65
  * @hidden
66
66
  */
67
- export const getActionSheetItemIndex = (target) => {
68
- if (!isDocumentAvailable()) {
69
- return;
67
+ export const ACTIONSHEET_ITEM_INDEX_ATTRIBUTE = 'kendo-actionsheet-item-index';
68
+ /**
69
+ * @hidden
70
+ */
71
+ export const getActionSheetItemIndex = (target, targetAttr, scope) => {
72
+ const item = closestItem(target, targetAttr, scope);
73
+ if (item) {
74
+ return itemIndex(item, targetAttr);
70
75
  }
71
- const allItemElements = document.querySelectorAll('.k-actionsheet-action');
72
- const closestItem = closestInScope(target, el => { var _a; return (_a = el.classList) === null || _a === void 0 ? void 0 : _a.contains('k-actionsheet-action'); }, this);
73
- let idx = null;
74
- allItemElements.forEach((i, index) => {
75
- if (i === closestItem) {
76
- idx = index;
77
- }
78
- });
79
- return idx;
80
76
  };
77
+ const itemIndex = (item, indexAttr) => +item.getAttribute(indexAttr);
78
+ const hasItemIndex = (item, indexAttr) => isPresent(item.getAttribute(indexAttr));
79
+ const closestItem = (target, targetAttr, scope) => closestInScope(target, el => hasItemIndex(el, targetAttr), scope);
package/esm2015/main.js CHANGED
@@ -21,7 +21,5 @@ export { BreadCrumbItemComponent } from './breadcrumb/breadcrumb-item.component'
21
21
  export { BreadCrumbListComponent } from './breadcrumb/list.component';
22
22
  //ActionSheet exports
23
23
  export { ActionSheetComponent } from './actionsheet/actionsheet.component';
24
- export { ActionSheetItemClickEvent } from './actionsheet/models';
25
- export { ActionSheetTitleTemplateDirective } from './actionsheet/templates/title-template.directive';
26
- export { ActionSheetItemTemplateDirective } from './actionsheet/templates/item-template.directive';
24
+ export { ActionSheetItemClickEvent, ActionSheetHeaderTemplateDirective, ActionSheetItemTemplateDirective, ActionSheetContentTemplateDirective, ActionSheetFooterTemplateDirective } from './actionsheet/models';
27
25
  export { ActionSheetModule } from './actionsheet.module';
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-navigation',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1665992185,
12
+ publishDate: 1666617075,
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
  };