primeng 16.1.0 → 16.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.d.ts +14 -2
- package/api/primengconfig.d.ts +1 -1
- package/api/translation.d.ts +78 -23
- package/api/treetablenode.d.ts +1 -1
- package/autocomplete/autocomplete.d.ts +7 -10
- package/button/button.d.ts +1 -1
- package/calendar/calendar.d.ts +1 -0
- package/carousel/carousel.d.ts +19 -2
- package/chips/chips.d.ts +2 -1
- package/confirmdialog/confirmdialog.d.ts +7 -1
- package/contextmenu/contextmenu.d.ts +3 -1
- package/dataview/dataview.d.ts +11 -1
- package/dialog/dialog.d.ts +1 -0
- package/dynamicdialog/dynamicdialog-config.d.ts +8 -0
- package/dynamicdialog/dynamicdialog.d.ts +3 -0
- package/esm2022/accordion/accordion.mjs +37 -9
- package/esm2022/api/primengconfig.mjs +1 -1
- package/esm2022/api/translation.mjs +1 -1
- package/esm2022/api/treetablenode.mjs +1 -1
- package/esm2022/autocomplete/autocomplete.mjs +53 -31
- package/esm2022/button/button.mjs +37 -23
- package/esm2022/calendar/calendar.mjs +26 -6
- package/esm2022/carousel/carousel.mjs +158 -28
- package/esm2022/chips/chips.mjs +8 -4
- package/esm2022/confirmdialog/confirmdialog.mjs +22 -6
- package/esm2022/confirmpopup/confirmpopup.mjs +3 -1
- package/esm2022/contextmenu/contextmenu.mjs +19 -12
- package/esm2022/dataview/dataview.mjs +22 -4
- package/esm2022/dialog/dialog.mjs +32 -24
- package/esm2022/dropdown/dropdown.mjs +8 -5
- package/esm2022/dynamicdialog/dialogservice.mjs +8 -2
- package/esm2022/dynamicdialog/dynamicdialog-config.mjs +9 -1
- package/esm2022/dynamicdialog/dynamicdialog.mjs +28 -9
- package/esm2022/fileupload/fileupload.mjs +50 -41
- package/esm2022/galleria/galleria.mjs +254 -35
- package/esm2022/image/image.mjs +72 -24
- package/esm2022/inputnumber/inputnumber.mjs +13 -3
- package/esm2022/inputtextarea/inputtextarea.mjs +2 -18
- package/esm2022/keyfilter/keyfilter.interface.mjs +2 -0
- package/esm2022/keyfilter/keyfilter.mjs +15 -3
- package/esm2022/keyfilter/public_api.mjs +2 -1
- package/esm2022/megamenu/megamenu.mjs +15 -6
- package/esm2022/menu/menu.mjs +13 -7
- package/esm2022/menubar/menubar.mjs +17 -8
- package/esm2022/messages/messages.mjs +27 -27
- package/esm2022/multiselect/multiselect.mjs +17 -9
- package/esm2022/organizationchart/organizationchart.mjs +5 -5
- package/esm2022/overlaypanel/overlaypanel.mjs +12 -13
- package/esm2022/paginator/paginator.mjs +23 -5
- package/esm2022/panel/panel.mjs +2 -2
- package/esm2022/panelmenu/panelmenu.mjs +48 -26
- package/esm2022/password/password.mjs +13 -4
- package/esm2022/picklist/picklist.mjs +8 -4
- package/esm2022/selectbutton/selectbutton.mjs +14 -16
- package/esm2022/sidebar/sidebar.mjs +44 -13
- package/esm2022/slidemenu/slidemenu.mjs +27 -17
- package/esm2022/speeddial/speeddial.mjs +291 -15
- package/esm2022/splitbutton/splitbutton.mjs +63 -8
- package/esm2022/splitter/splitter.mjs +2 -2
- package/esm2022/table/table.interface.mjs +1 -1
- package/esm2022/table/table.mjs +35 -16
- package/esm2022/tabmenu/tabmenu.mjs +13 -3
- package/esm2022/tabview/tabview.mjs +64 -15
- package/esm2022/tieredmenu/tieredmenu.mjs +21 -13
- package/esm2022/toast/toast.mjs +69 -29
- package/esm2022/togglebutton/togglebutton.mjs +2 -2
- package/esm2022/tooltip/tooltip.mjs +29 -18
- package/esm2022/treeselect/treeselect.mjs +5 -5
- package/esm2022/treetable/treetable.interface.mjs +1 -1
- package/esm2022/treetable/treetable.mjs +26 -4
- package/fesm2022/primeng-accordion.mjs +36 -8
- package/fesm2022/primeng-accordion.mjs.map +1 -1
- package/fesm2022/primeng-api.mjs.map +1 -1
- package/fesm2022/primeng-autocomplete.mjs +52 -30
- package/fesm2022/primeng-autocomplete.mjs.map +1 -1
- package/fesm2022/primeng-button.mjs +36 -22
- package/fesm2022/primeng-button.mjs.map +1 -1
- package/fesm2022/primeng-calendar.mjs +25 -5
- package/fesm2022/primeng-calendar.mjs.map +1 -1
- package/fesm2022/primeng-carousel.mjs +157 -27
- package/fesm2022/primeng-carousel.mjs.map +1 -1
- package/fesm2022/primeng-chips.mjs +7 -3
- package/fesm2022/primeng-chips.mjs.map +1 -1
- package/fesm2022/primeng-confirmdialog.mjs +21 -5
- package/fesm2022/primeng-confirmdialog.mjs.map +1 -1
- package/fesm2022/primeng-confirmpopup.mjs +2 -0
- package/fesm2022/primeng-confirmpopup.mjs.map +1 -1
- package/fesm2022/primeng-contextmenu.mjs +18 -11
- package/fesm2022/primeng-contextmenu.mjs.map +1 -1
- package/fesm2022/primeng-dataview.mjs +21 -3
- package/fesm2022/primeng-dataview.mjs.map +1 -1
- package/fesm2022/primeng-dialog.mjs +31 -23
- package/fesm2022/primeng-dialog.mjs.map +1 -1
- package/fesm2022/primeng-dropdown.mjs +7 -4
- package/fesm2022/primeng-dropdown.mjs.map +1 -1
- package/fesm2022/primeng-dynamicdialog.mjs +42 -10
- package/fesm2022/primeng-dynamicdialog.mjs.map +1 -1
- package/fesm2022/primeng-fileupload.mjs +49 -40
- package/fesm2022/primeng-fileupload.mjs.map +1 -1
- package/fesm2022/primeng-galleria.mjs +253 -34
- package/fesm2022/primeng-galleria.mjs.map +1 -1
- package/fesm2022/primeng-image.mjs +71 -23
- package/fesm2022/primeng-image.mjs.map +1 -1
- package/fesm2022/primeng-inputnumber.mjs +12 -2
- package/fesm2022/primeng-inputnumber.mjs.map +1 -1
- package/fesm2022/primeng-inputtextarea.mjs +1 -17
- package/fesm2022/primeng-inputtextarea.mjs.map +1 -1
- package/fesm2022/primeng-keyfilter.mjs +14 -2
- package/fesm2022/primeng-keyfilter.mjs.map +1 -1
- package/fesm2022/primeng-megamenu.mjs +14 -5
- package/fesm2022/primeng-megamenu.mjs.map +1 -1
- package/fesm2022/primeng-menu.mjs +12 -6
- package/fesm2022/primeng-menu.mjs.map +1 -1
- package/fesm2022/primeng-menubar.mjs +16 -7
- package/fesm2022/primeng-menubar.mjs.map +1 -1
- package/fesm2022/primeng-messages.mjs +26 -26
- package/fesm2022/primeng-messages.mjs.map +1 -1
- package/fesm2022/primeng-multiselect.mjs +16 -8
- package/fesm2022/primeng-multiselect.mjs.map +1 -1
- package/fesm2022/primeng-organizationchart.mjs +4 -4
- package/fesm2022/primeng-organizationchart.mjs.map +1 -1
- package/fesm2022/primeng-overlaypanel.mjs +11 -12
- package/fesm2022/primeng-overlaypanel.mjs.map +1 -1
- package/fesm2022/primeng-paginator.mjs +22 -4
- package/fesm2022/primeng-paginator.mjs.map +1 -1
- package/fesm2022/primeng-panel.mjs +2 -2
- package/fesm2022/primeng-panelmenu.mjs +47 -25
- package/fesm2022/primeng-panelmenu.mjs.map +1 -1
- package/fesm2022/primeng-password.mjs +12 -3
- package/fesm2022/primeng-password.mjs.map +1 -1
- package/fesm2022/primeng-picklist.mjs +7 -3
- package/fesm2022/primeng-picklist.mjs.map +1 -1
- package/fesm2022/primeng-selectbutton.mjs +13 -15
- package/fesm2022/primeng-selectbutton.mjs.map +1 -1
- package/fesm2022/primeng-sidebar.mjs +43 -12
- package/fesm2022/primeng-sidebar.mjs.map +1 -1
- package/fesm2022/primeng-slidemenu.mjs +26 -16
- package/fesm2022/primeng-slidemenu.mjs.map +1 -1
- package/fesm2022/primeng-speeddial.mjs +290 -14
- package/fesm2022/primeng-speeddial.mjs.map +1 -1
- package/fesm2022/primeng-splitbutton.mjs +62 -7
- package/fesm2022/primeng-splitbutton.mjs.map +1 -1
- package/fesm2022/primeng-splitter.mjs +2 -2
- package/fesm2022/primeng-splitter.mjs.map +1 -1
- package/fesm2022/primeng-table.mjs +34 -15
- package/fesm2022/primeng-table.mjs.map +1 -1
- package/fesm2022/primeng-tabmenu.mjs +12 -2
- package/fesm2022/primeng-tabmenu.mjs.map +1 -1
- package/fesm2022/primeng-tabview.mjs +63 -14
- package/fesm2022/primeng-tabview.mjs.map +1 -1
- package/fesm2022/primeng-tieredmenu.mjs +20 -12
- package/fesm2022/primeng-tieredmenu.mjs.map +1 -1
- package/fesm2022/primeng-toast.mjs +68 -28
- package/fesm2022/primeng-toast.mjs.map +1 -1
- package/fesm2022/primeng-togglebutton.mjs +2 -2
- package/fesm2022/primeng-togglebutton.mjs.map +1 -1
- package/fesm2022/primeng-tooltip.mjs +28 -17
- package/fesm2022/primeng-tooltip.mjs.map +1 -1
- package/fesm2022/primeng-treeselect.mjs +4 -4
- package/fesm2022/primeng-treeselect.mjs.map +1 -1
- package/fesm2022/primeng-treetable.mjs +25 -3
- package/fesm2022/primeng-treetable.mjs.map +1 -1
- package/galleria/galleria.d.ts +30 -5
- package/image/image.d.ts +16 -2
- package/inputtextarea/inputtextarea.d.ts +0 -2
- package/keyfilter/keyfilter.d.ts +6 -5
- package/keyfilter/keyfilter.interface.d.ts +5 -0
- package/keyfilter/public_api.d.ts +1 -0
- package/megamenu/megamenu.d.ts +3 -1
- package/menu/menu.d.ts +1 -0
- package/menubar/menubar.d.ts +3 -1
- package/multiselect/multiselect.d.ts +8 -6
- package/package.json +134 -134
- package/paginator/paginator.d.ts +7 -1
- package/panelmenu/panelmenu.d.ts +3 -1
- package/password/password.d.ts +6 -1
- package/resources/components/button/button.css +4 -0
- package/resources/components/menubar/menubar.css +4 -0
- package/resources/components/panel/panel.css +1 -1
- package/resources/components/splitter/splitter.css +2 -1
- package/resources/components/tabview/tabview.css +3 -2
- package/resources/primeng.css +3 -0
- package/resources/primeng.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +16 -6
- package/resources/themes/arya-green/theme.css +16 -6
- package/resources/themes/arya-orange/theme.css +16 -6
- package/resources/themes/arya-purple/theme.css +16 -6
- package/resources/themes/bootstrap4-dark-blue/theme.css +16 -6
- package/resources/themes/bootstrap4-dark-purple/theme.css +16 -6
- package/resources/themes/bootstrap4-light-blue/theme.css +16 -6
- package/resources/themes/bootstrap4-light-purple/theme.css +16 -6
- package/resources/themes/fluent-light/theme.css +16 -6
- package/resources/themes/lara-dark-blue/theme.css +16 -6
- package/resources/themes/lara-dark-indigo/theme.css +16 -6
- package/resources/themes/lara-dark-purple/theme.css +16 -6
- package/resources/themes/lara-dark-teal/theme.css +16 -6
- package/resources/themes/lara-light-blue/theme.css +16 -6
- package/resources/themes/lara-light-indigo/theme.css +16 -6
- package/resources/themes/lara-light-purple/theme.css +16 -6
- package/resources/themes/lara-light-teal/theme.css +16 -6
- package/resources/themes/luna-amber/theme.css +16 -6
- package/resources/themes/luna-blue/theme.css +16 -6
- package/resources/themes/luna-green/theme.css +16 -6
- package/resources/themes/luna-pink/theme.css +16 -6
- package/resources/themes/md-dark-deeppurple/theme.css +16 -6
- package/resources/themes/md-dark-indigo/theme.css +16 -6
- package/resources/themes/md-light-deeppurple/theme.css +16 -6
- package/resources/themes/md-light-indigo/theme.css +16 -6
- package/resources/themes/mdc-dark-deeppurple/theme.css +16 -6
- package/resources/themes/mdc-dark-indigo/theme.css +16 -6
- package/resources/themes/mdc-light-deeppurple/theme.css +16 -6
- package/resources/themes/mdc-light-indigo/theme.css +16 -6
- package/resources/themes/mira/theme.css +16 -6
- package/resources/themes/nano/theme.css +16 -6
- package/resources/themes/nova/theme.css +16 -6
- package/resources/themes/nova-accent/theme.css +16 -6
- package/resources/themes/nova-alt/theme.css +16 -6
- package/resources/themes/rhea/theme.css +16 -6
- package/resources/themes/saga-blue/theme.css +16 -6
- package/resources/themes/saga-green/theme.css +16 -6
- package/resources/themes/saga-orange/theme.css +16 -6
- package/resources/themes/saga-purple/theme.css +16 -6
- package/resources/themes/soho-dark/theme.css +16 -6
- package/resources/themes/soho-light/theme.css +16 -6
- package/resources/themes/tailwind-light/theme.css +16 -6
- package/resources/themes/vela-blue/theme.css +16 -6
- package/resources/themes/vela-green/theme.css +16 -6
- package/resources/themes/vela-orange/theme.css +16 -6
- package/resources/themes/vela-purple/theme.css +16 -6
- package/resources/themes/viva-dark/theme.css +16 -6
- package/resources/themes/viva-light/theme.css +16 -6
- package/sidebar/sidebar.d.ts +1 -0
- package/slidemenu/slidemenu.d.ts +8 -6
- package/speeddial/speeddial.d.ts +34 -1
- package/splitbutton/splitbutton.d.ts +5 -1
- package/table/table.d.ts +12 -3
- package/table/table.interface.d.ts +1 -1
- package/tabmenu/tabmenu.d.ts +3 -1
- package/tabview/tabview.d.ts +10 -2
- package/tieredmenu/tieredmenu.d.ts +3 -1
- package/toast/toast.d.ts +8 -2
- package/tooltip/tooltip.d.ts +6 -6
- package/treeselect/treeselect.d.ts +5 -5
- package/treetable/treetable.d.ts +14 -4
- package/treetable/treetable.interface.d.ts +9 -2
@@ -1,15 +1,17 @@
|
|
1
|
-
import * as
|
1
|
+
import * as i2 from '@angular/common';
|
2
2
|
import { isPlatformBrowser, DOCUMENT, CommonModule } from '@angular/common';
|
3
3
|
import * as i0 from '@angular/core';
|
4
4
|
import { EventEmitter, PLATFORM_ID, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, Input, Output, ViewChild, ContentChild, ContentChildren, NgModule } from '@angular/core';
|
5
|
+
import * as i1 from 'primeng/api';
|
5
6
|
import { Header, Footer, PrimeTemplate, SharedModule } from 'primeng/api';
|
6
7
|
import { ChevronDownIcon } from 'primeng/icons/chevrondown';
|
7
8
|
import { ChevronLeftIcon } from 'primeng/icons/chevronleft';
|
8
9
|
import { ChevronRightIcon } from 'primeng/icons/chevronright';
|
9
10
|
import { ChevronUpIcon } from 'primeng/icons/chevronup';
|
10
|
-
import * as
|
11
|
+
import * as i3 from 'primeng/ripple';
|
11
12
|
import { RippleModule } from 'primeng/ripple';
|
12
13
|
import { UniqueComponentId } from 'primeng/utils';
|
14
|
+
import { DomHandler } from 'primeng/dom';
|
13
15
|
|
14
16
|
/**
|
15
17
|
* Carousel is a content slider featuring various customization options.
|
@@ -22,6 +24,7 @@ class Carousel {
|
|
22
24
|
renderer;
|
23
25
|
document;
|
24
26
|
platformId;
|
27
|
+
config;
|
25
28
|
/**
|
26
29
|
* Index of the first item.
|
27
30
|
* @defaultValue 0
|
@@ -34,7 +37,6 @@ class Carousel {
|
|
34
37
|
if (this.isCreated && val !== this._page) {
|
35
38
|
if (this.autoplayInterval) {
|
36
39
|
this.stopAutoplay();
|
37
|
-
this.allowAutoplay = false;
|
38
40
|
}
|
39
41
|
if (val > this._page && val <= this.totalDots() - 1) {
|
40
42
|
this.step(-1, val);
|
@@ -156,6 +158,7 @@ class Carousel {
|
|
156
158
|
*/
|
157
159
|
onPage = new EventEmitter();
|
158
160
|
itemsContainer;
|
161
|
+
indicatorContent;
|
159
162
|
headerFacet;
|
160
163
|
footerFacet;
|
161
164
|
templates;
|
@@ -193,13 +196,14 @@ class Carousel {
|
|
193
196
|
previousIconTemplate;
|
194
197
|
nextIconTemplate;
|
195
198
|
window;
|
196
|
-
constructor(el, zone, cd, renderer, document, platformId) {
|
199
|
+
constructor(el, zone, cd, renderer, document, platformId, config) {
|
197
200
|
this.el = el;
|
198
201
|
this.zone = zone;
|
199
202
|
this.cd = cd;
|
200
203
|
this.renderer = renderer;
|
201
204
|
this.document = document;
|
202
205
|
this.platformId = platformId;
|
206
|
+
this.config = config;
|
203
207
|
this.totalShiftedItems = this.page * this.numScroll * -1;
|
204
208
|
this.window = this.document.defaultView;
|
205
209
|
}
|
@@ -270,7 +274,7 @@ class Carousel {
|
|
270
274
|
let totalShiftedItems = this.totalShiftedItems;
|
271
275
|
if (this.value && this.itemsContainer && (this.prevState.numScroll !== this._numScroll || this.prevState.numVisible !== this._numVisible || this.prevState.value.length !== this.value.length)) {
|
272
276
|
if (this.autoplayInterval) {
|
273
|
-
this.stopAutoplay();
|
277
|
+
this.stopAutoplay(false);
|
274
278
|
}
|
275
279
|
this.remainingItems = (this.value.length - this._numVisible) % this._numScroll;
|
276
280
|
let page = this._page;
|
@@ -444,7 +448,6 @@ class Carousel {
|
|
444
448
|
}
|
445
449
|
if (this.autoplayInterval) {
|
446
450
|
this.stopAutoplay();
|
447
|
-
this.allowAutoplay = false;
|
448
451
|
}
|
449
452
|
if (e && e.cancelable) {
|
450
453
|
e.preventDefault();
|
@@ -456,7 +459,6 @@ class Carousel {
|
|
456
459
|
}
|
457
460
|
if (this.autoplayInterval) {
|
458
461
|
this.stopAutoplay();
|
459
|
-
this.allowAutoplay = false;
|
460
462
|
}
|
461
463
|
if (e && e.cancelable) {
|
462
464
|
e.preventDefault();
|
@@ -466,7 +468,6 @@ class Carousel {
|
|
466
468
|
let page = this._page;
|
467
469
|
if (this.autoplayInterval) {
|
468
470
|
this.stopAutoplay();
|
469
|
-
this.allowAutoplay = false;
|
470
471
|
}
|
471
472
|
if (index > page) {
|
472
473
|
this.navForward(e, index);
|
@@ -475,6 +476,53 @@ class Carousel {
|
|
475
476
|
this.navBackward(e, index);
|
476
477
|
}
|
477
478
|
}
|
479
|
+
onIndicatorKeydown(event) {
|
480
|
+
switch (event.code) {
|
481
|
+
case 'ArrowRight':
|
482
|
+
this.onRightKey();
|
483
|
+
break;
|
484
|
+
case 'ArrowLeft':
|
485
|
+
this.onLeftKey();
|
486
|
+
break;
|
487
|
+
}
|
488
|
+
}
|
489
|
+
onRightKey() {
|
490
|
+
const indicators = [...DomHandler.find(this.indicatorContent.nativeElement, '[data-pc-section="indicator"]')];
|
491
|
+
const activeIndex = this.findFocusedIndicatorIndex();
|
492
|
+
this.changedFocusedIndicator(activeIndex, activeIndex + 1 === indicators.length ? indicators.length - 1 : activeIndex + 1);
|
493
|
+
}
|
494
|
+
onLeftKey() {
|
495
|
+
const activeIndex = this.findFocusedIndicatorIndex();
|
496
|
+
this.changedFocusedIndicator(activeIndex, activeIndex - 1 <= 0 ? 0 : activeIndex - 1);
|
497
|
+
}
|
498
|
+
onHomeKey() {
|
499
|
+
const activeIndex = this.findFocusedIndicatorIndex();
|
500
|
+
this.changedFocusedIndicator(activeIndex, 0);
|
501
|
+
}
|
502
|
+
onEndKey() {
|
503
|
+
const indicators = [...DomHandler.find(this.indicatorContent.nativeElement, '[data-pc-section="indicator"]r')];
|
504
|
+
const activeIndex = this.findFocusedIndicatorIndex();
|
505
|
+
this.changedFocusedIndicator(activeIndex, indicators.length - 1);
|
506
|
+
}
|
507
|
+
onTabKey() {
|
508
|
+
const indicators = [...DomHandler.find(this.indicatorContent.nativeElement, '[data-pc-section="indicator"]')];
|
509
|
+
const highlightedIndex = indicators.findIndex((ind) => DomHandler.getAttribute(ind, 'data-p-highlight') === true);
|
510
|
+
const activeIndicator = DomHandler.findSingle(this.indicatorContent.nativeElement, '[data-pc-section="indicator"] > button[tabindex="0"]');
|
511
|
+
const activeIndex = indicators.findIndex((ind) => ind === activeIndicator.parentElement);
|
512
|
+
indicators[activeIndex].children[0].tabIndex = '-1';
|
513
|
+
indicators[highlightedIndex].children[0].tabIndex = '0';
|
514
|
+
}
|
515
|
+
findFocusedIndicatorIndex() {
|
516
|
+
const indicators = [...DomHandler.find(this.indicatorContent.nativeElement, '[data-pc-section="indicator"]')];
|
517
|
+
const activeIndicator = DomHandler.findSingle(this.indicatorContent.nativeElement, '[data-pc-section="indicator"] > button[tabindex="0"]');
|
518
|
+
return indicators.findIndex((ind) => ind === activeIndicator.parentElement);
|
519
|
+
}
|
520
|
+
changedFocusedIndicator(prevInd, nextInd) {
|
521
|
+
const indicators = [...DomHandler.find(this.indicatorContent.nativeElement, '[data-pc-section="indicator"]')];
|
522
|
+
indicators[prevInd].children[0].tabIndex = '-1';
|
523
|
+
indicators[nextInd].children[0].tabIndex = '0';
|
524
|
+
indicators[nextInd].children[0].focus();
|
525
|
+
}
|
478
526
|
step(dir, page) {
|
479
527
|
let totalShiftedItems = this.totalShiftedItems;
|
480
528
|
const isCircular = this.isCircular();
|
@@ -527,12 +575,20 @@ class Carousel {
|
|
527
575
|
}
|
528
576
|
}
|
529
577
|
}, this.autoplayInterval);
|
578
|
+
this.allowAutoplay = true;
|
530
579
|
}
|
531
|
-
stopAutoplay() {
|
580
|
+
stopAutoplay(changeAllow = true) {
|
532
581
|
if (this.interval) {
|
533
582
|
clearInterval(this.interval);
|
583
|
+
this.interval = undefined;
|
584
|
+
if (changeAllow) {
|
585
|
+
this.allowAutoplay = false;
|
586
|
+
}
|
534
587
|
}
|
535
588
|
}
|
589
|
+
isPlaying() {
|
590
|
+
return !!this.interval;
|
591
|
+
}
|
536
592
|
onTransitionEnd() {
|
537
593
|
if (this.itemsContainer) {
|
538
594
|
this.itemsContainer.nativeElement.style.transition = '';
|
@@ -572,6 +628,21 @@ class Carousel {
|
|
572
628
|
}
|
573
629
|
}
|
574
630
|
}
|
631
|
+
ariaPrevButtonLabel() {
|
632
|
+
return this.config.translation.aria ? this.config.translation.aria.prevPageLabel : undefined;
|
633
|
+
}
|
634
|
+
ariaSlideLabel() {
|
635
|
+
return this.config.translation.aria ? this.config.translation.aria.slide : undefined;
|
636
|
+
}
|
637
|
+
ariaNextButtonLabel() {
|
638
|
+
return this.config.translation.aria ? this.config.translation.aria.nextPageLabel : undefined;
|
639
|
+
}
|
640
|
+
ariaSlideNumber(value) {
|
641
|
+
return this.config.translation.aria ? this.config.translation.aria.slideNumber.replace(/{slideNumber}/g, value) : undefined;
|
642
|
+
}
|
643
|
+
ariaPageLabel(value) {
|
644
|
+
return this.config.translation.aria ? this.config.translation.aria.pageLabel.replace(/{page}/g, value) : undefined;
|
645
|
+
}
|
575
646
|
bindDocumentListeners() {
|
576
647
|
if (isPlatformBrowser(this.platformId)) {
|
577
648
|
if (!this.documentResizeListener) {
|
@@ -597,16 +668,24 @@ class Carousel {
|
|
597
668
|
this.stopAutoplay();
|
598
669
|
}
|
599
670
|
}
|
600
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: Carousel, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: DOCUMENT }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
|
601
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: Carousel, selector: "p-carousel", inputs: { page: "page", numVisible: "numVisible", numScroll: "numScroll", responsiveOptions: "responsiveOptions", orientation: "orientation", verticalViewPortHeight: "verticalViewPortHeight", contentClass: "contentClass", indicatorsContentClass: "indicatorsContentClass", indicatorsContentStyle: "indicatorsContentStyle", indicatorStyleClass: "indicatorStyleClass", indicatorStyle: "indicatorStyle", value: "value", circular: "circular", showIndicators: "showIndicators", showNavigators: "showNavigators", autoplayInterval: "autoplayInterval", style: "style", styleClass: "styleClass" }, outputs: { onPage: "onPage" }, host: { classAttribute: "p-element" }, queries: [{ propertyName: "headerFacet", first: true, predicate: Header, descendants: true }, { propertyName: "footerFacet", first: true, predicate: Footer, descendants: true }, { propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "itemsContainer", first: true, predicate: ["itemsContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
602
|
-
<div [attr.id]="id" [ngClass]="{ 'p-carousel p-component': true, 'p-carousel-vertical': isVertical(), 'p-carousel-horizontal': !isVertical() }" [ngStyle]="style" [class]="styleClass">
|
671
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: Carousel, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: DOCUMENT }, { token: PLATFORM_ID }, { token: i1.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
|
672
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: Carousel, selector: "p-carousel", inputs: { page: "page", numVisible: "numVisible", numScroll: "numScroll", responsiveOptions: "responsiveOptions", orientation: "orientation", verticalViewPortHeight: "verticalViewPortHeight", contentClass: "contentClass", indicatorsContentClass: "indicatorsContentClass", indicatorsContentStyle: "indicatorsContentStyle", indicatorStyleClass: "indicatorStyleClass", indicatorStyle: "indicatorStyle", value: "value", circular: "circular", showIndicators: "showIndicators", showNavigators: "showNavigators", autoplayInterval: "autoplayInterval", style: "style", styleClass: "styleClass" }, outputs: { onPage: "onPage" }, host: { classAttribute: "p-element" }, queries: [{ propertyName: "headerFacet", first: true, predicate: Header, descendants: true }, { propertyName: "footerFacet", first: true, predicate: Footer, descendants: true }, { propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "itemsContainer", first: true, predicate: ["itemsContainer"], descendants: true }, { propertyName: "indicatorContent", first: true, predicate: ["indicatorContent"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
673
|
+
<div [attr.id]="id" [ngClass]="{ 'p-carousel p-component': true, 'p-carousel-vertical': isVertical(), 'p-carousel-horizontal': !isVertical() }" [ngStyle]="style" [class]="styleClass" role="region">
|
603
674
|
<div class="p-carousel-header" *ngIf="headerFacet || headerTemplate">
|
604
675
|
<ng-content select="p-header"></ng-content>
|
605
676
|
<ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
|
606
677
|
</div>
|
607
678
|
<div [class]="contentClass" [ngClass]="'p-carousel-content'">
|
608
|
-
<div class="p-carousel-container">
|
609
|
-
<button
|
679
|
+
<div class="p-carousel-container" [attr.aria-live]="allowAutoplay ? 'polite' : 'off'">
|
680
|
+
<button
|
681
|
+
type="button"
|
682
|
+
*ngIf="showNavigators"
|
683
|
+
[ngClass]="{ 'p-carousel-prev p-link': true, 'p-disabled': isBackwardNavDisabled() }"
|
684
|
+
[disabled]="isBackwardNavDisabled()"
|
685
|
+
[attr.aria-label]="ariaPrevButtonLabel()"
|
686
|
+
(click)="navBackward($event)"
|
687
|
+
pRipple
|
688
|
+
>
|
610
689
|
<ng-container *ngIf="!previousIconTemplate">
|
611
690
|
<ChevronLeftIcon *ngIf="!isVertical()" [styleClass]="'carousel-prev-icon'" />
|
612
691
|
<ChevronUpIcon *ngIf="isVertical()" [styleClass]="'carousel-prev-icon'" />
|
@@ -625,6 +704,9 @@ class Carousel {
|
|
625
704
|
'p-carousel-item-start': 0 === index,
|
626
705
|
'p-carousel-item-end': clonedItemsForStarting.length - 1 === index
|
627
706
|
}"
|
707
|
+
[attr.aria-hidden]="!(totalShiftedItems * -1 === value.length)"
|
708
|
+
[attr.aria-label]="ariaSlideNumber(index)"
|
709
|
+
[attr.aria-roledescription]="ariaSlideLabel()"
|
628
710
|
>
|
629
711
|
<ng-container *ngTemplateOutlet="itemTemplate; context: { $implicit: item }"></ng-container>
|
630
712
|
</div>
|
@@ -647,7 +729,15 @@ class Carousel {
|
|
647
729
|
</div>
|
648
730
|
</div>
|
649
731
|
</div>
|
650
|
-
<button
|
732
|
+
<button
|
733
|
+
type="button"
|
734
|
+
*ngIf="showNavigators"
|
735
|
+
[ngClass]="{ 'p-carousel-next p-link': true, 'p-disabled': isForwardNavDisabled() }"
|
736
|
+
[disabled]="isForwardNavDisabled()"
|
737
|
+
(click)="navForward($event)"
|
738
|
+
pRipple
|
739
|
+
[attr.aria-label]="ariaNextButtonLabel()"
|
740
|
+
>
|
651
741
|
<ng-container *ngIf="!nextIconTemplate">
|
652
742
|
<ChevronRightIcon *ngIf="!isVertical()" [styleClass]="'carousel-prev-icon'" />
|
653
743
|
<ChevronDownIcon *ngIf="isVertical()" [styleClass]="'carousel-prev-icon'" />
|
@@ -657,9 +747,18 @@ class Carousel {
|
|
657
747
|
</span>
|
658
748
|
</button>
|
659
749
|
</div>
|
660
|
-
<ul [ngClass]="'p-carousel-indicators p-reset'" [class]="indicatorsContentClass" [ngStyle]="indicatorsContentStyle" *ngIf="showIndicators">
|
661
|
-
<li *ngFor="let totalDot of totalDotsArray(); let i = index" [ngClass]="{ 'p-carousel-indicator': true, 'p-highlight': _page === i }">
|
662
|
-
<button
|
750
|
+
<ul #indicatorContent [ngClass]="'p-carousel-indicators p-reset'" [class]="indicatorsContentClass" [ngStyle]="indicatorsContentStyle" *ngIf="showIndicators" (keydown)="onIndicatorKeydown($event)">
|
751
|
+
<li *ngFor="let totalDot of totalDotsArray(); let i = index" [ngClass]="{ 'p-carousel-indicator': true, 'p-highlight': _page === i }" [attr.data-pc-section]="'indicator'">
|
752
|
+
<button
|
753
|
+
type="button"
|
754
|
+
[ngClass]="'p-link'"
|
755
|
+
(click)="onDotClick($event, i)"
|
756
|
+
[class]="indicatorStyleClass"
|
757
|
+
[ngStyle]="indicatorStyle"
|
758
|
+
[attr.aria-label]="ariaPageLabel(i + 1)"
|
759
|
+
[attr.aria-current]="_page === i ? 'page' : undefined"
|
760
|
+
[tabindex]="_page === i ? 0 : -1"
|
761
|
+
></button>
|
663
762
|
</li>
|
664
763
|
</ul>
|
665
764
|
</div>
|
@@ -668,19 +767,27 @@ class Carousel {
|
|
668
767
|
<ng-container *ngTemplateOutlet="footerTemplate"></ng-container>
|
669
768
|
</div>
|
670
769
|
</div>
|
671
|
-
`, isInline: true, styles: [".p-carousel{display:flex;flex-direction:column}.p-carousel-content{display:flex;flex-direction:column;overflow:auto}.p-carousel-prev,.p-carousel-next{align-self:center;flex-grow:0;flex-shrink:0;display:flex;justify-content:center;align-items:center;overflow:hidden;position:relative}.p-carousel-container{display:flex;flex-direction:row}.p-carousel-items-content{overflow:hidden;width:100%}.p-carousel-items-container{display:flex;flex-direction:row}.p-carousel-indicators{display:flex;flex-direction:row;justify-content:center;flex-wrap:wrap}.p-carousel-indicator>button{display:flex;align-items:center;justify-content:center}.p-carousel-vertical .p-carousel-container{flex-direction:column}.p-carousel-vertical .p-carousel-items-container{flex-direction:column;height:100%}.p-items-hidden .p-carousel-item{visibility:hidden}.p-items-hidden .p-carousel-item.p-carousel-item-active{visibility:visible}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(function () { return
|
770
|
+
`, isInline: true, styles: [".p-carousel{display:flex;flex-direction:column}.p-carousel-content{display:flex;flex-direction:column;overflow:auto}.p-carousel-prev,.p-carousel-next{align-self:center;flex-grow:0;flex-shrink:0;display:flex;justify-content:center;align-items:center;overflow:hidden;position:relative}.p-carousel-container{display:flex;flex-direction:row}.p-carousel-items-content{overflow:hidden;width:100%}.p-carousel-items-container{display:flex;flex-direction:row}.p-carousel-indicators{display:flex;flex-direction:row;justify-content:center;flex-wrap:wrap}.p-carousel-indicator>button{display:flex;align-items:center;justify-content:center}.p-carousel-vertical .p-carousel-container{flex-direction:column}.p-carousel-vertical .p-carousel-items-container{flex-direction:column;height:100%}.p-items-hidden .p-carousel-item{visibility:hidden}.p-items-hidden .p-carousel-item.p-carousel-item-active{visibility:visible}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(function () { return i2.NgClass; }), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgTemplateOutlet; }), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgStyle; }), selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i0.forwardRef(function () { return i3.Ripple; }), selector: "[pRipple]" }, { kind: "component", type: i0.forwardRef(function () { return ChevronRightIcon; }), selector: "ChevronRightIcon" }, { kind: "component", type: i0.forwardRef(function () { return ChevronLeftIcon; }), selector: "ChevronLeftIcon" }, { kind: "component", type: i0.forwardRef(function () { return ChevronDownIcon; }), selector: "ChevronDownIcon" }, { kind: "component", type: i0.forwardRef(function () { return ChevronUpIcon; }), selector: "ChevronUpIcon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
672
771
|
}
|
673
772
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: Carousel, decorators: [{
|
674
773
|
type: Component,
|
675
774
|
args: [{ selector: 'p-carousel', template: `
|
676
|
-
<div [attr.id]="id" [ngClass]="{ 'p-carousel p-component': true, 'p-carousel-vertical': isVertical(), 'p-carousel-horizontal': !isVertical() }" [ngStyle]="style" [class]="styleClass">
|
775
|
+
<div [attr.id]="id" [ngClass]="{ 'p-carousel p-component': true, 'p-carousel-vertical': isVertical(), 'p-carousel-horizontal': !isVertical() }" [ngStyle]="style" [class]="styleClass" role="region">
|
677
776
|
<div class="p-carousel-header" *ngIf="headerFacet || headerTemplate">
|
678
777
|
<ng-content select="p-header"></ng-content>
|
679
778
|
<ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
|
680
779
|
</div>
|
681
780
|
<div [class]="contentClass" [ngClass]="'p-carousel-content'">
|
682
|
-
<div class="p-carousel-container">
|
683
|
-
<button
|
781
|
+
<div class="p-carousel-container" [attr.aria-live]="allowAutoplay ? 'polite' : 'off'">
|
782
|
+
<button
|
783
|
+
type="button"
|
784
|
+
*ngIf="showNavigators"
|
785
|
+
[ngClass]="{ 'p-carousel-prev p-link': true, 'p-disabled': isBackwardNavDisabled() }"
|
786
|
+
[disabled]="isBackwardNavDisabled()"
|
787
|
+
[attr.aria-label]="ariaPrevButtonLabel()"
|
788
|
+
(click)="navBackward($event)"
|
789
|
+
pRipple
|
790
|
+
>
|
684
791
|
<ng-container *ngIf="!previousIconTemplate">
|
685
792
|
<ChevronLeftIcon *ngIf="!isVertical()" [styleClass]="'carousel-prev-icon'" />
|
686
793
|
<ChevronUpIcon *ngIf="isVertical()" [styleClass]="'carousel-prev-icon'" />
|
@@ -699,6 +806,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
699
806
|
'p-carousel-item-start': 0 === index,
|
700
807
|
'p-carousel-item-end': clonedItemsForStarting.length - 1 === index
|
701
808
|
}"
|
809
|
+
[attr.aria-hidden]="!(totalShiftedItems * -1 === value.length)"
|
810
|
+
[attr.aria-label]="ariaSlideNumber(index)"
|
811
|
+
[attr.aria-roledescription]="ariaSlideLabel()"
|
702
812
|
>
|
703
813
|
<ng-container *ngTemplateOutlet="itemTemplate; context: { $implicit: item }"></ng-container>
|
704
814
|
</div>
|
@@ -721,7 +831,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
721
831
|
</div>
|
722
832
|
</div>
|
723
833
|
</div>
|
724
|
-
<button
|
834
|
+
<button
|
835
|
+
type="button"
|
836
|
+
*ngIf="showNavigators"
|
837
|
+
[ngClass]="{ 'p-carousel-next p-link': true, 'p-disabled': isForwardNavDisabled() }"
|
838
|
+
[disabled]="isForwardNavDisabled()"
|
839
|
+
(click)="navForward($event)"
|
840
|
+
pRipple
|
841
|
+
[attr.aria-label]="ariaNextButtonLabel()"
|
842
|
+
>
|
725
843
|
<ng-container *ngIf="!nextIconTemplate">
|
726
844
|
<ChevronRightIcon *ngIf="!isVertical()" [styleClass]="'carousel-prev-icon'" />
|
727
845
|
<ChevronDownIcon *ngIf="isVertical()" [styleClass]="'carousel-prev-icon'" />
|
@@ -731,9 +849,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
731
849
|
</span>
|
732
850
|
</button>
|
733
851
|
</div>
|
734
|
-
<ul [ngClass]="'p-carousel-indicators p-reset'" [class]="indicatorsContentClass" [ngStyle]="indicatorsContentStyle" *ngIf="showIndicators">
|
735
|
-
<li *ngFor="let totalDot of totalDotsArray(); let i = index" [ngClass]="{ 'p-carousel-indicator': true, 'p-highlight': _page === i }">
|
736
|
-
<button
|
852
|
+
<ul #indicatorContent [ngClass]="'p-carousel-indicators p-reset'" [class]="indicatorsContentClass" [ngStyle]="indicatorsContentStyle" *ngIf="showIndicators" (keydown)="onIndicatorKeydown($event)">
|
853
|
+
<li *ngFor="let totalDot of totalDotsArray(); let i = index" [ngClass]="{ 'p-carousel-indicator': true, 'p-highlight': _page === i }" [attr.data-pc-section]="'indicator'">
|
854
|
+
<button
|
855
|
+
type="button"
|
856
|
+
[ngClass]="'p-link'"
|
857
|
+
(click)="onDotClick($event, i)"
|
858
|
+
[class]="indicatorStyleClass"
|
859
|
+
[ngStyle]="indicatorStyle"
|
860
|
+
[attr.aria-label]="ariaPageLabel(i + 1)"
|
861
|
+
[attr.aria-current]="_page === i ? 'page' : undefined"
|
862
|
+
[tabindex]="_page === i ? 0 : -1"
|
863
|
+
></button>
|
737
864
|
</li>
|
738
865
|
</ul>
|
739
866
|
</div>
|
@@ -751,7 +878,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
751
878
|
}] }, { type: undefined, decorators: [{
|
752
879
|
type: Inject,
|
753
880
|
args: [PLATFORM_ID]
|
754
|
-
}] }]; }, propDecorators: { page: [{
|
881
|
+
}] }, { type: i1.PrimeNGConfig }]; }, propDecorators: { page: [{
|
755
882
|
type: Input
|
756
883
|
}], numVisible: [{
|
757
884
|
type: Input
|
@@ -792,6 +919,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImpor
|
|
792
919
|
}], itemsContainer: [{
|
793
920
|
type: ViewChild,
|
794
921
|
args: ['itemsContainer']
|
922
|
+
}], indicatorContent: [{
|
923
|
+
type: ViewChild,
|
924
|
+
args: ['indicatorContent']
|
795
925
|
}], headerFacet: [{
|
796
926
|
type: ContentChild,
|
797
927
|
args: [Header]
|