@progress/kendo-angular-navigation 1.1.6 → 2.0.0-dev.202204141001

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 (161) hide show
  1. package/{dist/es2015/appbar → appbar}/appbar-section.component.d.ts +3 -0
  2. package/{dist/es2015/appbar → appbar}/appbar-spacer.component.d.ts +4 -1
  3. package/{dist/es2015/appbar → appbar}/appbar.component.d.ts +11 -8
  4. package/{dist/es2015/appbar → appbar}/models/position-mode.d.ts +0 -0
  5. package/{dist/es2015/appbar → appbar}/models/position.d.ts +0 -0
  6. package/{dist/es2015/appbar → appbar}/models/theme-color.d.ts +0 -0
  7. package/{dist/es2015/appbar.module.d.ts → appbar.module.d.ts} +8 -0
  8. package/{dist/es2015/bottomnavigation → bottomnavigation}/bottomnavigation-item.component.d.ts +11 -8
  9. package/{dist/es2015/bottomnavigation → bottomnavigation}/bottomnavigation.component.d.ts +13 -6
  10. package/{dist/es2015/bottomnavigation → bottomnavigation}/constants.d.ts +0 -0
  11. package/{dist/es2015/bottomnavigation → bottomnavigation}/events/select-event.d.ts +0 -0
  12. package/{dist/es2015/bottomnavigation → bottomnavigation}/templates/item-template.directive.d.ts +3 -0
  13. package/{dist/es2015/bottomnavigation → bottomnavigation}/types/bottomnavigation-fill.d.ts +0 -0
  14. package/{dist/es2015/bottomnavigation → bottomnavigation}/types/bottomnavigation-item-flow.d.ts +0 -0
  15. package/{dist/es2015/bottomnavigation → bottomnavigation}/types/bottomnavigation-item.d.ts +0 -0
  16. package/{dist/es2015/bottomnavigation → bottomnavigation}/types/bottomnavigation-position-mode.d.ts +0 -0
  17. package/{dist/es2015/bottomnavigation → bottomnavigation}/types/bottomnavigation-theme-color.d.ts +0 -0
  18. package/{dist/es2015/bottomnavigation.module.d.ts → bottomnavigation.module.d.ts} +8 -0
  19. package/{dist/es2015/breadcrumb → breadcrumb}/breadcrumb-item.component.d.ts +6 -3
  20. package/{dist/es2015/breadcrumb → breadcrumb}/breadcrumb.component.d.ts +9 -4
  21. package/{dist/es2015/breadcrumb → breadcrumb}/list.component.d.ts +3 -0
  22. package/{dist/es2015/breadcrumb → breadcrumb}/models/breadcrumb-item.interface.d.ts +0 -0
  23. package/{dist/es2015/breadcrumb → breadcrumb}/models/collapse-mode.d.ts +0 -0
  24. package/{dist/es2015/breadcrumb → breadcrumb}/models/constants.d.ts +0 -0
  25. package/{dist/es2015/breadcrumb → breadcrumb}/template-directives/item-template.directive.d.ts +3 -0
  26. package/{dist/es2015/breadcrumb → breadcrumb}/template-directives/separator.directive.d.ts +5 -1
  27. package/{dist/es2015/breadcrumb → breadcrumb}/util.d.ts +0 -0
  28. package/{dist/es2015/breadcrumb.module.d.ts → breadcrumb.module.d.ts} +11 -0
  29. package/bundles/kendo-angular-navigation.umd.js +5 -0
  30. package/{dist/es2015/common → common}/direction.d.ts +0 -0
  31. package/{dist/es2015/common → common}/dom-queries.d.ts +0 -0
  32. package/{dist/es2015/common → common}/preventable-event.d.ts +0 -0
  33. package/{dist/es2015/common → common}/util.d.ts +0 -0
  34. package/esm2015/appbar/appbar-section.component.js +45 -0
  35. package/{dist/es2015 → esm2015}/appbar/appbar-spacer.component.js +21 -25
  36. package/{dist/es2015 → esm2015}/appbar/appbar.component.js +65 -79
  37. package/{dist/es → esm2015}/appbar/models/position-mode.js +1 -0
  38. package/{dist/es2015 → esm2015}/appbar/models/position.js +1 -0
  39. package/{dist/es2015 → esm2015}/appbar/models/theme-color.js +1 -0
  40. package/{dist/es2015 → esm2015}/appbar.module.js +18 -11
  41. package/esm2015/bottomnavigation/bottomnavigation-item.component.js +102 -0
  42. package/{dist/es2015 → esm2015}/bottomnavigation/bottomnavigation.component.js +70 -88
  43. package/{dist/es2015 → esm2015}/bottomnavigation/constants.js +0 -0
  44. package/{dist/es2015 → esm2015}/bottomnavigation/events/select-event.js +0 -0
  45. package/esm2015/bottomnavigation/templates/item-template.directive.js +26 -0
  46. package/{dist/es2015 → esm2015}/bottomnavigation/types/bottomnavigation-fill.js +1 -0
  47. package/{dist/es → esm2015}/bottomnavigation/types/bottomnavigation-item-flow.js +1 -0
  48. package/{dist/es → esm2015}/bottomnavigation/types/bottomnavigation-item.js +1 -0
  49. package/{dist/es → esm2015}/bottomnavigation/types/bottomnavigation-position-mode.js +1 -0
  50. package/{dist/es2015 → esm2015}/bottomnavigation/types/bottomnavigation-theme-color.js +1 -0
  51. package/{dist/es2015 → esm2015}/bottomnavigation.module.js +14 -11
  52. package/esm2015/breadcrumb/breadcrumb-item.component.js +161 -0
  53. package/{dist/es2015 → esm2015}/breadcrumb/breadcrumb.component.js +88 -73
  54. package/esm2015/breadcrumb/list.component.js +92 -0
  55. package/{dist/es → esm2015}/breadcrumb/models/breadcrumb-item.interface.js +1 -0
  56. package/{dist/es → esm2015}/breadcrumb/models/collapse-mode.js +1 -0
  57. package/{dist/es2015 → esm2015}/breadcrumb/models/constants.js +0 -0
  58. package/esm2015/breadcrumb/template-directives/item-template.directive.js +27 -0
  59. package/esm2015/breadcrumb/template-directives/separator.directive.js +69 -0
  60. package/{dist/es2015 → esm2015}/breadcrumb/util.js +0 -3
  61. package/{dist/es2015 → esm2015}/breadcrumb.module.js +18 -11
  62. package/{dist/es → esm2015}/common/direction.js +1 -0
  63. package/{dist/es2015 → esm2015}/common/dom-queries.js +0 -3
  64. package/{dist/es2015 → esm2015}/common/preventable-event.js +0 -0
  65. package/{dist/es2015 → esm2015}/common/util.js +0 -0
  66. package/{dist/es/appbar/models/position.js → esm2015/kendo-angular-navigation.js} +4 -0
  67. package/{dist/es → esm2015}/main.js +2 -0
  68. package/{dist/es2015 → esm2015}/navigation.module.js +20 -13
  69. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  70. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-navigation.js} +584 -568
  71. package/{dist/es/breadcrumb/models/constants.js → kendo-angular-navigation.d.ts} +3 -2
  72. package/{dist/es2015/main.d.ts → main.d.ts} +2 -0
  73. package/{dist/es2015/navigation.module.d.ts → navigation.module.d.ts} +7 -0
  74. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  75. package/package.json +33 -109
  76. package/schematics/ngAdd/index.js +5 -2
  77. package/schematics/ngAdd/index.js.map +1 -1
  78. package/dist/cdn/js/kendo-angular-navigation.js +0 -20
  79. package/dist/cdn/main.js +0 -5
  80. package/dist/es/appbar/appbar-section.component.js +0 -41
  81. package/dist/es/appbar/appbar-spacer.component.js +0 -77
  82. package/dist/es/appbar/appbar.component.js +0 -202
  83. package/dist/es/appbar/models/theme-color.js +0 -4
  84. package/dist/es/appbar.module.js +0 -61
  85. package/dist/es/bottomnavigation/bottomnavigation-item.component.js +0 -136
  86. package/dist/es/bottomnavigation/bottomnavigation.component.js +0 -356
  87. package/dist/es/bottomnavigation/constants.js +0 -12
  88. package/dist/es/bottomnavigation/events/select-event.js +0 -17
  89. package/dist/es/bottomnavigation/templates/item-template.directive.js +0 -25
  90. package/dist/es/bottomnavigation/types/bottomnavigation-fill.js +0 -4
  91. package/dist/es/bottomnavigation/types/bottomnavigation-theme-color.js +0 -19
  92. package/dist/es/bottomnavigation.module.js +0 -57
  93. package/dist/es/breadcrumb/breadcrumb-item.component.js +0 -98
  94. package/dist/es/breadcrumb/breadcrumb.component.js +0 -274
  95. package/dist/es/breadcrumb/list.component.js +0 -80
  96. package/dist/es/breadcrumb/template-directives/item-template.directive.js +0 -26
  97. package/dist/es/breadcrumb/template-directives/separator.directive.js +0 -78
  98. package/dist/es/breadcrumb/util.js +0 -27
  99. package/dist/es/breadcrumb.module.js +0 -68
  100. package/dist/es/common/dom-queries.js +0 -25
  101. package/dist/es/common/preventable-event.js +0 -36
  102. package/dist/es/common/util.js +0 -17
  103. package/dist/es/index.js +0 -15
  104. package/dist/es/navigation.module.js +0 -55
  105. package/dist/es/package-metadata.js +0 -15
  106. package/dist/es2015/appbar/appbar-section.component.js +0 -60
  107. package/dist/es2015/appbar/models/position-mode.js +0 -4
  108. package/dist/es2015/bottomnavigation/bottomnavigation-item.component.js +0 -110
  109. package/dist/es2015/bottomnavigation/templates/item-template.directive.js +0 -24
  110. package/dist/es2015/bottomnavigation/types/bottomnavigation-item-flow.js +0 -4
  111. package/dist/es2015/bottomnavigation/types/bottomnavigation-item.js +0 -4
  112. package/dist/es2015/bottomnavigation/types/bottomnavigation-position-mode.js +0 -4
  113. package/dist/es2015/breadcrumb/breadcrumb-item.component.js +0 -128
  114. package/dist/es2015/breadcrumb/list.component.js +0 -98
  115. package/dist/es2015/breadcrumb/models/breadcrumb-item.interface.js +0 -4
  116. package/dist/es2015/breadcrumb/models/collapse-mode.js +0 -4
  117. package/dist/es2015/breadcrumb/template-directives/item-template.directive.js +0 -25
  118. package/dist/es2015/breadcrumb/template-directives/separator.directive.js +0 -71
  119. package/dist/es2015/common/direction.js +0 -4
  120. package/dist/es2015/index.d.ts +0 -15
  121. package/dist/es2015/index.js +0 -15
  122. package/dist/es2015/index.metadata.json +0 -1
  123. package/dist/es2015/main.js +0 -19
  124. package/dist/fesm5/index.js +0 -1633
  125. package/dist/npm/appbar/appbar-section.component.js +0 -43
  126. package/dist/npm/appbar/appbar-spacer.component.js +0 -79
  127. package/dist/npm/appbar/appbar.component.js +0 -204
  128. package/dist/npm/appbar/models/position-mode.js +0 -6
  129. package/dist/npm/appbar/models/position.js +0 -6
  130. package/dist/npm/appbar/models/theme-color.js +0 -6
  131. package/dist/npm/appbar.module.js +0 -63
  132. package/dist/npm/bottomnavigation/bottomnavigation-item.component.js +0 -138
  133. package/dist/npm/bottomnavigation/bottomnavigation.component.js +0 -358
  134. package/dist/npm/bottomnavigation/constants.js +0 -14
  135. package/dist/npm/bottomnavigation/events/select-event.js +0 -19
  136. package/dist/npm/bottomnavigation/templates/item-template.directive.js +0 -27
  137. package/dist/npm/bottomnavigation/types/bottomnavigation-fill.js +0 -6
  138. package/dist/npm/bottomnavigation/types/bottomnavigation-item-flow.js +0 -6
  139. package/dist/npm/bottomnavigation/types/bottomnavigation-item.js +0 -6
  140. package/dist/npm/bottomnavigation/types/bottomnavigation-position-mode.js +0 -6
  141. package/dist/npm/bottomnavigation/types/bottomnavigation-theme-color.js +0 -21
  142. package/dist/npm/bottomnavigation.module.js +0 -59
  143. package/dist/npm/breadcrumb/breadcrumb-item.component.js +0 -100
  144. package/dist/npm/breadcrumb/breadcrumb.component.js +0 -276
  145. package/dist/npm/breadcrumb/list.component.js +0 -82
  146. package/dist/npm/breadcrumb/models/breadcrumb-item.interface.js +0 -6
  147. package/dist/npm/breadcrumb/models/collapse-mode.js +0 -6
  148. package/dist/npm/breadcrumb/models/constants.js +0 -10
  149. package/dist/npm/breadcrumb/template-directives/item-template.directive.js +0 -28
  150. package/dist/npm/breadcrumb/template-directives/separator.directive.js +0 -80
  151. package/dist/npm/breadcrumb/util.js +0 -30
  152. package/dist/npm/breadcrumb.module.js +0 -70
  153. package/dist/npm/common/direction.js +0 -6
  154. package/dist/npm/common/dom-queries.js +0 -28
  155. package/dist/npm/common/preventable-event.js +0 -38
  156. package/dist/npm/common/util.js +0 -19
  157. package/dist/npm/index.js +0 -25
  158. package/dist/npm/main.js +0 -33
  159. package/dist/npm/navigation.module.js +0 -57
  160. package/dist/npm/package-metadata.js +0 -17
  161. package/dist/systemjs/kendo-angular-navigation.js +0 -5
@@ -1,274 +0,0 @@
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 * as tslib_1 from "tslib";
6
- import { Component, ContentChild, Input, Output, EventEmitter, ViewChild, HostBinding, ElementRef, ChangeDetectorRef, NgZone, ViewChildren, QueryList, isDevMode } from '@angular/core';
7
- import { Subscription, ReplaySubject, merge, Subject } from 'rxjs';
8
- import { filter, map, share, startWith } from 'rxjs/operators';
9
- import { ResizeSensorComponent, isDocumentAvailable } from '@progress/kendo-angular-common';
10
- import { validatePackage } from '@progress/kendo-licensing';
11
- import { packageMetadata } from '../package-metadata';
12
- import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
13
- import { BreadCrumbItemTemplateDirective } from './template-directives/item-template.directive';
14
- import { outerWidth } from '../common/util';
15
- import { BreadCrumbListComponent } from './list.component';
16
- import { collapsed, expanded, collapseFirst, expandFirst } from './util';
17
- /**
18
- * Represents the [Kendo UI Breadcrumb component for Angular]({% slug overview_breadcrumb %}).
19
- *
20
- * @example
21
- * ```ts-no-run
22
- * _@Component({
23
- * selector: 'my-app',
24
- * template: `
25
- * <kendo-breadcrumb
26
- * [items]="items"
27
- * (itemClick)="onItemClick($event)">
28
- * </kendo-breadcrumb>
29
- * `
30
- * })
31
- * class AppComponent {
32
- * public items: BreadCrumbItem[] = [
33
- * { text: 'Home', title: 'Home', icon: 'home' },
34
- * { text: 'Kids', title: 'Kids' },
35
- * { text: '8y-16y', title: '8y-16y', disabled: true },
36
- * { text: 'New collection', title: 'New collection' },
37
- * { text: 'Jeans', title: 'Jeans' }
38
- * ];
39
- *
40
- * public onItemClick(item: BreadCrumbItem): void {
41
- * console.log(item);
42
- * }
43
- * }
44
- * ```
45
- */
46
- var BreadCrumbComponent = /** @class */ (function () {
47
- function BreadCrumbComponent(el, cdr, zone, localization) {
48
- this.el = el;
49
- this.cdr = cdr;
50
- this.zone = zone;
51
- this.localization = localization;
52
- /**
53
- * Fires when a Breadcrumb item is clicked. The event will not be fired by disabled items and the last item.
54
- */
55
- this.itemClick = new EventEmitter();
56
- this.hostClasses = true;
57
- this._items = [];
58
- this._collapseMode = 'auto';
59
- this.updateItems = new ReplaySubject();
60
- this.afterViewInit = new Subject();
61
- this.subscriptions = new Subscription();
62
- this.direction = 'ltr';
63
- validatePackage(packageMetadata);
64
- var updateItems$ = this.updateItems.asObservable().pipe(startWith([]));
65
- this.direction = localization.rtl ? 'rtl' : 'ltr';
66
- this.itemsData$ = updateItems$.pipe(map(function (items) { return items.filter(Boolean); }), map(function (items) {
67
- return items.map(function (item, index, collection) { return ({
68
- context: {
69
- collapsed: false,
70
- isLast: index === collection.length - 1,
71
- isFirst: index === 0
72
- },
73
- data: item
74
- }); });
75
- }), share());
76
- this.firstItem$ = updateItems$.pipe(map(function (items) {
77
- if (items.length > 0) {
78
- return [
79
- {
80
- context: {
81
- collapsed: false,
82
- isLast: items.length === 1,
83
- isFirst: true
84
- },
85
- data: items[0]
86
- }
87
- ];
88
- }
89
- return [];
90
- }), share());
91
- }
92
- Object.defineProperty(BreadCrumbComponent.prototype, "items", {
93
- get: function () {
94
- return this._items;
95
- },
96
- /**
97
- * The collection of items that will be rendered in the Breadcrumb.
98
- */
99
- set: function (items) {
100
- this._items = items || [];
101
- this.updateItems.next(this._items);
102
- },
103
- enumerable: true,
104
- configurable: true
105
- });
106
- Object.defineProperty(BreadCrumbComponent.prototype, "collapseMode", {
107
- get: function () {
108
- return this._collapseMode;
109
- },
110
- /**
111
- * Specifies the collapse mode of the Breadcrumb ([see example]({% slug collapse_modes_breadcrumb %})).
112
- *
113
- * The possible values are:
114
- * - `auto` (default)&mdash;items are automatically collapsed based on the width of the Breadcrumb.
115
- * - `wrap`&mdash;items are wrapped on multiple rows.
116
- * - `none`&mdash;all items are expanded on the same row.
117
- *
118
- * For more information and example refer to the [Collapse Modes]({% slug collapse_modes_breadcrumb %}) article.
119
- */
120
- set: function (mode) {
121
- if (isDevMode() && ['auto', 'wrap', 'none'].indexOf(mode) < 0) {
122
- throw new Error('Invalid collapse mode. Allowed values are "auto", "wrap" or "none". \nFor more details see https://www.telerik.com/kendo-angular-ui/components/navigation/api/BreadCrumbCollapseMode/');
123
- }
124
- this._collapseMode = mode || 'auto';
125
- this.updateItems.next(this.items);
126
- },
127
- enumerable: true,
128
- configurable: true
129
- });
130
- Object.defineProperty(BreadCrumbComponent.prototype, "wrapMode", {
131
- get: function () {
132
- return this.collapseMode === 'wrap';
133
- },
134
- enumerable: true,
135
- configurable: true
136
- });
137
- Object.defineProperty(BreadCrumbComponent.prototype, "getDir", {
138
- get: function () {
139
- return this.direction;
140
- },
141
- enumerable: true,
142
- configurable: true
143
- });
144
- BreadCrumbComponent.prototype.ngOnInit = function () {
145
- var _this = this;
146
- this.subscriptions.add(this.localization.changes.subscribe(function (_a) {
147
- var rtl = _a.rtl;
148
- return (_this.direction = rtl ? 'rtl' : 'ltr');
149
- }));
150
- };
151
- BreadCrumbComponent.prototype.ngAfterViewInit = function () {
152
- this.attachResizeHandler();
153
- this.afterViewInit.next();
154
- };
155
- BreadCrumbComponent.prototype.ngOnDestroy = function () {
156
- this.subscriptions.unsubscribe();
157
- };
158
- BreadCrumbComponent.prototype.handleResize = function () {
159
- var autoCollapseCandidates = this.listComponent.renderedItems.toArray().filter(function (ri) { return !ri.item.context.isFirst && !ri.item.context.isLast; }).slice();
160
- var componentWidth = outerWidth(this.el.nativeElement);
161
- var itemsContainerWidth = Math.floor(this.itemsContainers
162
- .toArray()
163
- .map(function (el) { return outerWidth(el.nativeElement); })
164
- .reduce(function (acc, curr) { return acc + curr; }, 0));
165
- var nextExpandWidth = (autoCollapseCandidates.slice().reverse().find(collapsed) || { width: 0 }).width;
166
- // // shrink
167
- if (componentWidth <= itemsContainerWidth && autoCollapseCandidates.find(expanded)) {
168
- collapseFirst(autoCollapseCandidates);
169
- // needed by resize sensor
170
- this.cdr.detectChanges();
171
- return this.handleResize();
172
- }
173
- // expand
174
- if (componentWidth > itemsContainerWidth + nextExpandWidth && autoCollapseCandidates.find(collapsed)) {
175
- expandFirst(autoCollapseCandidates.slice().reverse());
176
- // needed by resize sensor
177
- this.cdr.detectChanges();
178
- return this.handleResize();
179
- }
180
- };
181
- BreadCrumbComponent.prototype.shouldResize = function () {
182
- return isDocumentAvailable() && this.collapseMode === 'auto';
183
- };
184
- BreadCrumbComponent.prototype.attachResizeHandler = function () {
185
- var _this = this;
186
- // resize when:
187
- // the component is initialized
188
- // the container is resized
189
- // items are added/removed
190
- this.subscriptions.add(merge(this.resizeSensor.resize, this.itemsData$, this.afterViewInit.asObservable())
191
- .pipe(filter(function () { return _this.shouldResize(); }))
192
- .subscribe(function () {
193
- _this.zone.runOutsideAngular(function () {
194
- return setTimeout(function () {
195
- _this.zone.run(function () {
196
- if (_this.listComponent) {
197
- _this.handleResize();
198
- _this.resizeSensor.acceptSize();
199
- }
200
- });
201
- });
202
- });
203
- }));
204
- };
205
- tslib_1.__decorate([
206
- Input(),
207
- tslib_1.__metadata("design:type", Array),
208
- tslib_1.__metadata("design:paramtypes", [Array])
209
- ], BreadCrumbComponent.prototype, "items", null);
210
- tslib_1.__decorate([
211
- Input(),
212
- tslib_1.__metadata("design:type", String)
213
- ], BreadCrumbComponent.prototype, "separatorIcon", void 0);
214
- tslib_1.__decorate([
215
- Input(),
216
- tslib_1.__metadata("design:type", String),
217
- tslib_1.__metadata("design:paramtypes", [String])
218
- ], BreadCrumbComponent.prototype, "collapseMode", null);
219
- tslib_1.__decorate([
220
- Output(),
221
- tslib_1.__metadata("design:type", EventEmitter)
222
- ], BreadCrumbComponent.prototype, "itemClick", void 0);
223
- tslib_1.__decorate([
224
- ViewChild('resizeSensor', { static: true }),
225
- tslib_1.__metadata("design:type", ResizeSensorComponent)
226
- ], BreadCrumbComponent.prototype, "resizeSensor", void 0);
227
- tslib_1.__decorate([
228
- ViewChildren('itemsContainer', { read: ElementRef }),
229
- tslib_1.__metadata("design:type", QueryList)
230
- ], BreadCrumbComponent.prototype, "itemsContainers", void 0);
231
- tslib_1.__decorate([
232
- ViewChild(BreadCrumbListComponent, { static: true }),
233
- tslib_1.__metadata("design:type", BreadCrumbListComponent)
234
- ], BreadCrumbComponent.prototype, "listComponent", void 0);
235
- tslib_1.__decorate([
236
- ContentChild(BreadCrumbItemTemplateDirective, { static: false }),
237
- tslib_1.__metadata("design:type", BreadCrumbItemTemplateDirective)
238
- ], BreadCrumbComponent.prototype, "itemTemplate", void 0);
239
- tslib_1.__decorate([
240
- HostBinding('class.k-widget'),
241
- HostBinding('class.k-breadcrumb'),
242
- tslib_1.__metadata("design:type", Boolean)
243
- ], BreadCrumbComponent.prototype, "hostClasses", void 0);
244
- tslib_1.__decorate([
245
- HostBinding('class.k-breadcrumb-wrap'),
246
- tslib_1.__metadata("design:type", Boolean),
247
- tslib_1.__metadata("design:paramtypes", [])
248
- ], BreadCrumbComponent.prototype, "wrapMode", null);
249
- tslib_1.__decorate([
250
- HostBinding('attr.dir'),
251
- tslib_1.__metadata("design:type", String),
252
- tslib_1.__metadata("design:paramtypes", [])
253
- ], BreadCrumbComponent.prototype, "getDir", null);
254
- BreadCrumbComponent = tslib_1.__decorate([
255
- Component({
256
- exportAs: 'kendoBreadCrumb',
257
- selector: 'kendo-breadcrumb',
258
- providers: [
259
- LocalizationService,
260
- {
261
- provide: L10N_PREFIX,
262
- useValue: 'kendo.breadcrumb'
263
- }
264
- ],
265
- template: "\n <ol\n #itemsContainer\n kendoBreadCrumbList\n class=\"k-breadcrumb-root-item-container\"\n *ngIf=\"collapseMode === 'wrap'\"\n [items]=\"firstItem$ | async\"\n [itemTemplate]=\"itemTemplate?.templateRef\"\n [collapseMode]=\"collapseMode\"\n [separatorIcon]=\"separatorIcon\"\n (itemClick)=\"itemClick.emit($event)\"\n ></ol>\n <ol\n #itemsContainer\n kendoBreadCrumbList\n class=\"k-breadcrumb-container\"\n [items]=\"itemsData$ | async\"\n [itemTemplate]=\"itemTemplate?.templateRef\"\n [collapseMode]=\"collapseMode\"\n [separatorIcon]=\"separatorIcon\"\n (itemClick)=\"itemClick.emit($event)\"\n [ngClass]=\"{ 'k-flex-wrap': collapseMode === 'wrap', 'k-flex-none': collapseMode === 'none' }\"\n ></ol>\n <kendo-resize-sensor [rateLimit]=\"1000\" #resizeSensor></kendo-resize-sensor>\n "
266
- }),
267
- tslib_1.__metadata("design:paramtypes", [ElementRef,
268
- ChangeDetectorRef,
269
- NgZone,
270
- LocalizationService])
271
- ], BreadCrumbComponent);
272
- return BreadCrumbComponent;
273
- }());
274
- export { BreadCrumbComponent };
@@ -1,80 +0,0 @@
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 * as tslib_1 from "tslib";
6
- import { Component, Output, Input, EventEmitter, TemplateRef, ViewChildren, QueryList, ElementRef, NgZone } from '@angular/core';
7
- import { fromEvent, merge } from 'rxjs';
8
- import { filter, map } from 'rxjs/operators';
9
- import { Keys } from '@progress/kendo-angular-common';
10
- import { BREADCRUMB_ITEM_INDEX } from './models/constants';
11
- import { BreadCrumbItemComponent } from './breadcrumb-item.component';
12
- import { closestItem, itemIndex } from '../common/dom-queries';
13
- import { isPresent } from '../common/util';
14
- /**
15
- * @hidden
16
- */
17
- var BreadCrumbListComponent = /** @class */ (function () {
18
- function BreadCrumbListComponent(el, zone) {
19
- var _this = this;
20
- this.el = el;
21
- this.zone = zone;
22
- this.items = [];
23
- this.collapseMode = 'auto';
24
- this.itemClick = new EventEmitter();
25
- var element = this.el.nativeElement;
26
- this.isRootItemContainer = element.classList.contains('k-breadcrumb-root-item-container');
27
- this.zone.runOutsideAngular(function () {
28
- var click$ = fromEvent(element, 'click');
29
- var enterKey$ = fromEvent(element, 'keydown').pipe(filter(function (ev /* KeyboardEvent causes lint error */) { return ev.keyCode === Keys.Enter; }));
30
- _this.domEventsSubscription = merge(click$, enterKey$)
31
- .pipe(map(function (ev) { return ev.target; }), filter(function (e) { return !e.classList.contains('k-breadcrumb-delimiter-icon'); }), // do not trigger handler when a separator is clicked
32
- map(function (e) { return _this.getItemIndex(e); }), filter(isPresent), map(function (i) { return parseInt(i, 10); }), map(function (i) { return _this.items[i]; }), filter(function (item) { return !item.data.disabled && !item.context.isLast; }), map(function (item) { return item.data; }))
33
- .subscribe(function (el) {
34
- _this.zone.run(function () { return _this.itemClick.emit(el); });
35
- });
36
- });
37
- }
38
- BreadCrumbListComponent.prototype.ngOnDestroy = function () {
39
- this.domEventsSubscription.unsubscribe();
40
- };
41
- BreadCrumbListComponent.prototype.getItemIndex = function (target) {
42
- var item = closestItem(target, BREADCRUMB_ITEM_INDEX, this.el.nativeElement);
43
- if (item) {
44
- return itemIndex(item, BREADCRUMB_ITEM_INDEX);
45
- }
46
- };
47
- tslib_1.__decorate([
48
- Input(),
49
- tslib_1.__metadata("design:type", Array)
50
- ], BreadCrumbListComponent.prototype, "items", void 0);
51
- tslib_1.__decorate([
52
- Input(),
53
- tslib_1.__metadata("design:type", TemplateRef)
54
- ], BreadCrumbListComponent.prototype, "itemTemplate", void 0);
55
- tslib_1.__decorate([
56
- Input(),
57
- tslib_1.__metadata("design:type", String)
58
- ], BreadCrumbListComponent.prototype, "collapseMode", void 0);
59
- tslib_1.__decorate([
60
- Input(),
61
- tslib_1.__metadata("design:type", String)
62
- ], BreadCrumbListComponent.prototype, "separatorIcon", void 0);
63
- tslib_1.__decorate([
64
- Output(),
65
- tslib_1.__metadata("design:type", EventEmitter)
66
- ], BreadCrumbListComponent.prototype, "itemClick", void 0);
67
- tslib_1.__decorate([
68
- ViewChildren(BreadCrumbItemComponent),
69
- tslib_1.__metadata("design:type", QueryList)
70
- ], BreadCrumbListComponent.prototype, "renderedItems", void 0);
71
- BreadCrumbListComponent = tslib_1.__decorate([
72
- Component({
73
- selector: '[kendoBreadCrumbList]',
74
- template: "\n <ng-container *ngFor=\"let item of items; let i = index; let isFirst = first; let isLast = last\">\n <li\n #renderedItem\n kendoBreadCrumbItem\n *ngIf=\"!(collapseMode === 'wrap' && isFirst) || isRootItemContainer\"\n [attr." + BREADCRUMB_ITEM_INDEX + "]=\"i\"\n [item]=\"item\"\n [index]=\"i\"\n [collapseMode]=\"collapseMode\"\n [itemTemplate]=\"itemTemplate\"\n >\n <span kendoBreadCrumbSeparator [icon]=\"separatorIcon\" *ngIf=\"collapseMode === 'wrap' && !isFirst\"></span>\n <span\n kendoBreadCrumbSeparator\n [icon]=\"separatorIcon\"\n *ngIf=\"collapseMode !== 'wrap' && !isLast && !(item?.context.collapsed && items[i + 1]?.context.collapsed)\"\n ></span>\n </li>\n </ng-container>\n "
75
- }),
76
- tslib_1.__metadata("design:paramtypes", [ElementRef, NgZone])
77
- ], BreadCrumbListComponent);
78
- return BreadCrumbListComponent;
79
- }());
80
- export { BreadCrumbListComponent };
@@ -1,26 +0,0 @@
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 * as tslib_1 from "tslib";
6
- import { Directive, Optional, TemplateRef } from '@angular/core';
7
- /**
8
- * Represents a template that defines the content of a Breadcrumb item.
9
- * To define the template, nest an `<ng-template>` tag with the `kendoBreadCrumbItemTemplate` directive inside the `<kendo-breadcrumb>` tag.
10
- *
11
- * For more information and example refer to the [Templates]({% slug templates_breadcrumb %}) article.
12
- */
13
- var BreadCrumbItemTemplateDirective = /** @class */ (function () {
14
- function BreadCrumbItemTemplateDirective(templateRef) {
15
- this.templateRef = templateRef;
16
- }
17
- BreadCrumbItemTemplateDirective = tslib_1.__decorate([
18
- Directive({
19
- selector: '[kendoBreadCrumbItemTemplate]'
20
- }),
21
- tslib_1.__param(0, Optional()),
22
- tslib_1.__metadata("design:paramtypes", [TemplateRef])
23
- ], BreadCrumbItemTemplateDirective);
24
- return BreadCrumbItemTemplateDirective;
25
- }());
26
- export { BreadCrumbItemTemplateDirective };
@@ -1,78 +0,0 @@
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 * as tslib_1 from "tslib";
6
- import { Directive, HostBinding, Input, ElementRef } from '@angular/core';
7
- import { isPresent } from '../../common/util';
8
- import { LocalizationService } from '@progress/kendo-angular-l10n';
9
- var DEFAULT_ICON = 'arrow-chevron-right';
10
- var DEFAULT_RTL_ICON = 'arrow-chevron-left';
11
- /**
12
- * @hidden
13
- */
14
- var BreadCrumbSeparatorDirective = /** @class */ (function () {
15
- function BreadCrumbSeparatorDirective(el, localization) {
16
- this.el = el;
17
- this.localization = localization;
18
- this.defaultClasses = true;
19
- this.ariaHidden = true;
20
- this.direction = 'ltr';
21
- this.direction = this.localization.rtl ? 'rtl' : 'ltr';
22
- }
23
- Object.defineProperty(BreadCrumbSeparatorDirective.prototype, "icon", {
24
- get: function () {
25
- return this._icon;
26
- },
27
- set: function (icon) {
28
- var element = this.el.nativeElement;
29
- element.classList.remove("k-i-" + this._icon);
30
- if (isPresent(icon)) {
31
- this._icon = icon;
32
- this.hasDefaultIcon = false;
33
- }
34
- else {
35
- this._icon = this.direction === 'ltr' ? DEFAULT_ICON : DEFAULT_RTL_ICON;
36
- this.hasDefaultIcon = true;
37
- }
38
- element.classList.add("k-i-" + this._icon);
39
- },
40
- enumerable: true,
41
- configurable: true
42
- });
43
- BreadCrumbSeparatorDirective.prototype.ngOnInit = function () {
44
- var _this = this;
45
- this.localizationChangesSubscription = this.localization.changes.subscribe(function (_a) {
46
- var rtl = _a.rtl;
47
- _this.direction = rtl ? 'rtl' : 'ltr';
48
- if (_this.hasDefaultIcon) {
49
- _this.icon = undefined;
50
- }
51
- });
52
- };
53
- BreadCrumbSeparatorDirective.prototype.ngOnDestroy = function () {
54
- this.localizationChangesSubscription.unsubscribe();
55
- };
56
- tslib_1.__decorate([
57
- Input(),
58
- tslib_1.__metadata("design:type", String),
59
- tslib_1.__metadata("design:paramtypes", [String])
60
- ], BreadCrumbSeparatorDirective.prototype, "icon", null);
61
- tslib_1.__decorate([
62
- HostBinding('class.k-breadcrumb-delimiter-icon'),
63
- HostBinding('class.k-icon'),
64
- tslib_1.__metadata("design:type", Boolean)
65
- ], BreadCrumbSeparatorDirective.prototype, "defaultClasses", void 0);
66
- tslib_1.__decorate([
67
- HostBinding('attr.aria-hidden'),
68
- tslib_1.__metadata("design:type", Boolean)
69
- ], BreadCrumbSeparatorDirective.prototype, "ariaHidden", void 0);
70
- BreadCrumbSeparatorDirective = tslib_1.__decorate([
71
- Directive({
72
- selector: '[kendoBreadCrumbSeparator]'
73
- }),
74
- tslib_1.__metadata("design:paramtypes", [ElementRef, LocalizationService])
75
- ], BreadCrumbSeparatorDirective);
76
- return BreadCrumbSeparatorDirective;
77
- }());
78
- export { BreadCrumbSeparatorDirective };
@@ -1,27 +0,0 @@
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
- var getCollapsed = function (itemComponent) { return itemComponent.item.context.collapsed; };
6
- var ɵ0 = getCollapsed;
7
- /**
8
- * @hidden
9
- */
10
- export var collapsed = function (itemComponent) { return getCollapsed(itemComponent) === true; };
11
- /**
12
- * @hidden
13
- */
14
- export var expanded = function (itemComponent) { return getCollapsed(itemComponent) === false; };
15
- var toggleFirst = function (collapsed) { return function (itemComponents) {
16
- return (itemComponents.find(function (ic) { return getCollapsed(ic) === collapsed; }).item.context.collapsed = !collapsed);
17
- }; };
18
- var ɵ1 = toggleFirst;
19
- /**
20
- * @hidden
21
- */
22
- export var collapseFirst = toggleFirst(false);
23
- /**
24
- * @hidden
25
- */
26
- export var expandFirst = toggleFirst(true);
27
- export { ɵ0, ɵ1 };
@@ -1,68 +0,0 @@
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 * as tslib_1 from "tslib";
6
- import { NgModule } from '@angular/core';
7
- import { CommonModule } from '@angular/common';
8
- import { ResizeSensorModule } from '@progress/kendo-angular-common';
9
- import { BreadCrumbComponent } from './breadcrumb/breadcrumb.component';
10
- import { BreadCrumbItemComponent } from './breadcrumb/breadcrumb-item.component';
11
- import { BreadCrumbItemTemplateDirective } from './breadcrumb/template-directives/item-template.directive';
12
- import { BreadCrumbSeparatorDirective } from './breadcrumb/template-directives/separator.directive';
13
- import { BreadCrumbListComponent } from './breadcrumb/list.component';
14
- var templateDirectives = [
15
- BreadCrumbItemTemplateDirective
16
- ];
17
- var exportedModules = [
18
- BreadCrumbComponent,
19
- BreadCrumbItemComponent,
20
- BreadCrumbListComponent
21
- ].concat(templateDirectives);
22
- var declarations = exportedModules.concat([
23
- BreadCrumbSeparatorDirective
24
- ]);
25
- /**
26
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
27
- * definition for the BreadCrumb component.
28
- * @example
29
- *
30
- * ```ts-no-run
31
- * // Import the BreadCrumb module
32
- * import { BreadCrumbModule } from '@progress/kendo-angular-navigation';
33
- *
34
- * // The browser platform with a compiler
35
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
36
- * import { BrowserModule } from '@angular/platform-browser';
37
- *
38
- * import { NgModule } from '@angular/core';
39
- *
40
- * // Import the app component
41
- * import { AppComponent } from './app.component';
42
- *
43
- * // Define the app module
44
- * _@NgModule({
45
- * declarations: [AppComponent], // declare app component
46
- * imports: [BrowserModule, BreadCrumbModule], // import BreadCrumb module
47
- * bootstrap: [AppComponent]
48
- * })
49
- * export class AppModule {}
50
- *
51
- * // Compile and launch the module
52
- * platformBrowserDynamic().bootstrapModule(AppModule);
53
- *
54
- * ```
55
- */
56
- var BreadCrumbModule = /** @class */ (function () {
57
- function BreadCrumbModule() {
58
- }
59
- BreadCrumbModule = tslib_1.__decorate([
60
- NgModule({
61
- declarations: [declarations],
62
- exports: [exportedModules],
63
- imports: [CommonModule, ResizeSensorModule]
64
- })
65
- ], BreadCrumbModule);
66
- return BreadCrumbModule;
67
- }());
68
- export { BreadCrumbModule };
@@ -1,25 +0,0 @@
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 { isPresent } from './util';
6
- var closestInScope = function (target, targetAttr, predicate, scope) {
7
- while (target && target !== scope && !predicate(target, targetAttr)) {
8
- target = target.parentNode;
9
- }
10
- if (target !== scope) {
11
- return target;
12
- }
13
- };
14
- var ɵ0 = closestInScope;
15
- var hasItemIndex = function (item, indexAttr) { return isPresent(item.getAttribute(indexAttr)); };
16
- var ɵ1 = hasItemIndex;
17
- /**
18
- * @hidden
19
- */
20
- export var itemIndex = function (item, indexAttr) { return +item.getAttribute(indexAttr); };
21
- /**
22
- * @hidden
23
- */
24
- export var closestItem = function (target, targetAttr, scope) { return closestInScope(target, targetAttr, hasItemIndex, scope); };
25
- export { ɵ0, ɵ1 };
@@ -1,36 +0,0 @@
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
- /**
6
- * @hidden
7
- */
8
- var PreventableEvent = /** @class */ (function () {
9
- /**
10
- * @hidden
11
- */
12
- function PreventableEvent(args) {
13
- this.prevented = false;
14
- Object.assign(this, args);
15
- }
16
- /**
17
- * Prevents the default action for a specified event.
18
- * In this way, the source component suppresses
19
- * the built-in behavior that follows the event.
20
- */
21
- PreventableEvent.prototype.preventDefault = function () {
22
- this.prevented = true;
23
- };
24
- /**
25
- * Returns `true` if the event was prevented
26
- * by any of its subscribers.
27
- *
28
- * @returns `true` if the default action was prevented.
29
- * Otherwise, returns `false`.
30
- */
31
- PreventableEvent.prototype.isDefaultPrevented = function () {
32
- return this.prevented;
33
- };
34
- return PreventableEvent;
35
- }());
36
- export { PreventableEvent };
@@ -1,17 +0,0 @@
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
- /**
6
- * @hidden
7
- */
8
- export var isPresent = function (value) { return value !== null && value !== undefined; };
9
- /**
10
- * @hidden
11
- */
12
- export var outerWidth = function (element) {
13
- var width = element.offsetWidth;
14
- var style = getComputedStyle(element);
15
- width += (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0);
16
- return width;
17
- };
package/dist/es/index.js DELETED
@@ -1,15 +0,0 @@
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
- /**
6
- * Generated bundle index. Do not edit.
7
- */
8
- export * from './main';
9
- export { BottomNavigationItemComponent } from './bottomnavigation/bottomnavigation-item.component';
10
- export { BOTTOMNAVIGATION_ITEM_INDEX } from './bottomnavigation/constants';
11
- export { BreadCrumbItemComponent } from './breadcrumb/breadcrumb-item.component';
12
- export { BreadCrumbListComponent } from './breadcrumb/list.component';
13
- export { BREADCRUMB_ITEM_INDEX } from './breadcrumb/models/constants';
14
- export { BreadCrumbSeparatorDirective } from './breadcrumb/template-directives/separator.directive';
15
- export { PreventableEvent } from './common/preventable-event';