@exhaustive-ui/core 3.0.0-alpha.0 → 3.0.0-alpha.1
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/fesm2022/exhaustive-ui-core-accordion.mjs +51 -78
- package/fesm2022/exhaustive-ui-core-accordion.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-animateonscroll.mjs +72 -73
- package/fesm2022/exhaustive-ui-core-animateonscroll.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-api.mjs +6 -13
- package/fesm2022/exhaustive-ui-core-api.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-autocomplete.mjs +485 -683
- package/fesm2022/exhaustive-ui-core-autocomplete.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-autofocus.mjs +21 -31
- package/fesm2022/exhaustive-ui-core-autofocus.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-avatar.mjs +47 -63
- package/fesm2022/exhaustive-ui-core-avatar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-badge.mjs +88 -115
- package/fesm2022/exhaustive-ui-core-badge.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-blockui.mjs +58 -91
- package/fesm2022/exhaustive-ui-core-blockui.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-breadcrumb.mjs +155 -169
- package/fesm2022/exhaustive-ui-core-breadcrumb.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-button.mjs +280 -385
- package/fesm2022/exhaustive-ui-core-button.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-carousel.mjs +379 -451
- package/fesm2022/exhaustive-ui-core-carousel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-cascadeselect.mjs +388 -507
- package/fesm2022/exhaustive-ui-core-cascadeselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-chart.mjs +75 -91
- package/fesm2022/exhaustive-ui-core-chart.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-checkbox.mjs +109 -160
- package/fesm2022/exhaustive-ui-core-checkbox.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-chip.mjs +98 -137
- package/fesm2022/exhaustive-ui-core-chip.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-colorpicker.mjs +123 -190
- package/fesm2022/exhaustive-ui-core-colorpicker.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-confirmdialog.mjs +157 -332
- package/fesm2022/exhaustive-ui-core-confirmdialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-confirmpopup.mjs +187 -210
- package/fesm2022/exhaustive-ui-core-confirmpopup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-contextmenu.mjs +315 -361
- package/fesm2022/exhaustive-ui-core-contextmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dataview.mjs +225 -272
- package/fesm2022/exhaustive-ui-core-dataview.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-datepicker.mjs +1012 -1157
- package/fesm2022/exhaustive-ui-core-datepicker.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dialog.mjs +370 -507
- package/fesm2022/exhaustive-ui-core-dialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dock.mjs +87 -115
- package/fesm2022/exhaustive-ui-core-dock.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dragdrop.mjs +98 -105
- package/fesm2022/exhaustive-ui-core-dragdrop.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-drawer.mjs +174 -235
- package/fesm2022/exhaustive-ui-core-drawer.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs +42 -280
- package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-editor.mjs +109 -121
- package/fesm2022/exhaustive-ui-core-editor.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-fieldset.mjs +90 -132
- package/fesm2022/exhaustive-ui-core-fieldset.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-fileupload.mjs +486 -541
- package/fesm2022/exhaustive-ui-core-fileupload.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-floatlabel.mjs +13 -16
- package/fesm2022/exhaustive-ui-core-floatlabel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-focustrap.mjs +44 -40
- package/fesm2022/exhaustive-ui-core-focustrap.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-galleria.mjs +642 -853
- package/fesm2022/exhaustive-ui-core-galleria.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-iconfield.mjs +15 -27
- package/fesm2022/exhaustive-ui-core-iconfield.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-icons-baseicon.mjs +8 -13
- package/fesm2022/exhaustive-ui-core-icons-baseicon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-image.mjs +209 -251
- package/fesm2022/exhaustive-ui-core-image.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-imagecompare.mjs +39 -48
- package/fesm2022/exhaustive-ui-core-imagecompare.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inplace.mjs +64 -98
- package/fesm2022/exhaustive-ui-core-inplace.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputgroup.mjs +10 -20
- package/fesm2022/exhaustive-ui-core-inputgroup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs +15 -24
- package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputicon.mjs +11 -22
- package/fesm2022/exhaustive-ui-core-inputicon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputmask.mjs +423 -392
- package/fesm2022/exhaustive-ui-core-inputmask.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputnumber.mjs +397 -469
- package/fesm2022/exhaustive-ui-core-inputnumber.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputotp.mjs +75 -95
- package/fesm2022/exhaustive-ui-core-inputotp.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputtext.mjs +27 -36
- package/fesm2022/exhaustive-ui-core-inputtext.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-keyfilter.mjs +29 -46
- package/fesm2022/exhaustive-ui-core-keyfilter.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-knob.mjs +140 -187
- package/fesm2022/exhaustive-ui-core-knob.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-listbox.mjs +365 -546
- package/fesm2022/exhaustive-ui-core-listbox.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-megamenu.mjs +320 -371
- package/fesm2022/exhaustive-ui-core-megamenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-menu.mjs +298 -348
- package/fesm2022/exhaustive-ui-core-menu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-menubar.mjs +277 -372
- package/fesm2022/exhaustive-ui-core-menubar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-metergroup.mjs +138 -166
- package/fesm2022/exhaustive-ui-core-metergroup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-multiselect.mjs +647 -835
- package/fesm2022/exhaustive-ui-core-multiselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-orderlist.mjs +337 -409
- package/fesm2022/exhaustive-ui-core-orderlist.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-organizationchart.mjs +114 -175
- package/fesm2022/exhaustive-ui-core-organizationchart.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-overlaybadge.mjs +22 -47
- package/fesm2022/exhaustive-ui-core-overlaybadge.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-paginator.mjs +232 -320
- package/fesm2022/exhaustive-ui-core-paginator.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-panel.mjs +114 -174
- package/fesm2022/exhaustive-ui-core-panel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-panelmenu.mjs +171 -282
- package/fesm2022/exhaustive-ui-core-panelmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-password.mjs +317 -377
- package/fesm2022/exhaustive-ui-core-password.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-picklist.mjs +557 -655
- package/fesm2022/exhaustive-ui-core-picklist.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-popover.mjs +154 -181
- package/fesm2022/exhaustive-ui-core-popover.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-rating.mjs +87 -119
- package/fesm2022/exhaustive-ui-core-rating.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scroller.mjs +465 -596
- package/fesm2022/exhaustive-ui-core-scroller.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scrollpanel.mjs +147 -155
- package/fesm2022/exhaustive-ui-core-scrollpanel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scrolltop.mjs +81 -115
- package/fesm2022/exhaustive-ui-core-scrolltop.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-select.mjs +581 -784
- package/fesm2022/exhaustive-ui-core-select.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-selectbutton.mjs +84 -120
- package/fesm2022/exhaustive-ui-core-selectbutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-slider.mjs +322 -352
- package/fesm2022/exhaustive-ui-core-slider.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-speeddial.mjs +209 -268
- package/fesm2022/exhaustive-ui-core-speeddial.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-splitbutton.mjs +153 -249
- package/fesm2022/exhaustive-ui-core-splitbutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-splitter.mjs +221 -237
- package/fesm2022/exhaustive-ui-core-splitter.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-steps.mjs +56 -72
- package/fesm2022/exhaustive-ui-core-steps.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-styleclass.mjs +145 -146
- package/fesm2022/exhaustive-ui-core-styleclass.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-table.mjs +2213 -2543
- package/fesm2022/exhaustive-ui-core-table.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-terminal.mjs +50 -67
- package/fesm2022/exhaustive-ui-core-terminal.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-textarea.mjs +23 -36
- package/fesm2022/exhaustive-ui-core-textarea.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tieredmenu.mjs +318 -394
- package/fesm2022/exhaustive-ui-core-tieredmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-timeline.mjs +56 -74
- package/fesm2022/exhaustive-ui-core-timeline.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-togglebutton.mjs +86 -129
- package/fesm2022/exhaustive-ui-core-togglebutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-toggleswitch.mjs +57 -94
- package/fesm2022/exhaustive-ui-core-toggleswitch.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-toolbar.mjs +36 -55
- package/fesm2022/exhaustive-ui-core-toolbar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tooltip.mjs +264 -343
- package/fesm2022/exhaustive-ui-core-tooltip.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tree.mjs +508 -639
- package/fesm2022/exhaustive-ui-core-tree.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-treeselect.mjs +327 -421
- package/fesm2022/exhaustive-ui-core-treeselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-treetable.mjs +1267 -1473
- package/fesm2022/exhaustive-ui-core-treetable.mjs.map +1 -1
- package/package.json +5 -5
- package/schematics/migrations/remove-dead-inputs/migration.js +213 -7
- package/schematics/migrations/renamed-inputs/migration.js +97 -0
- package/schematics/migrations/styleclass-to-class/migration.js +92 -1
- package/schematics/migrations.json +7 -2
- package/schematics/utils/removed-inputs.js +0 -0
- package/schematics/utils/renamed-inputs.js +175 -0
- package/schematics/utils/styleclass.js +24 -8
- package/schematics/utils/versions.json +8 -8
- package/types/exhaustive-ui-core-accordion.d.ts +8 -24
- package/types/exhaustive-ui-core-animateonscroll.d.ts +19 -21
- package/types/exhaustive-ui-core-api.d.ts +2 -3
- package/types/exhaustive-ui-core-autocomplete.d.ts +103 -176
- package/types/exhaustive-ui-core-autofocus.d.ts +4 -7
- package/types/exhaustive-ui-core-avatar.d.ts +18 -25
- package/types/exhaustive-ui-core-badge.d.ts +13 -27
- package/types/exhaustive-ui-core-blockui.d.ts +18 -30
- package/types/exhaustive-ui-core-breadcrumb.d.ts +21 -22
- package/types/exhaustive-ui-core-button.d.ts +57 -89
- package/types/exhaustive-ui-core-carousel.d.ts +56 -82
- package/types/exhaustive-ui-core-cascadeselect.d.ts +77 -111
- package/types/exhaustive-ui-core-chart.d.ts +21 -29
- package/types/exhaustive-ui-core-checkbox.d.ts +25 -39
- package/types/exhaustive-ui-core-chip.d.ts +31 -38
- package/types/exhaustive-ui-core-colorpicker.d.ts +23 -57
- package/types/exhaustive-ui-core-confirmdialog.d.ts +39 -109
- package/types/exhaustive-ui-core-confirmpopup.d.ts +24 -43
- package/types/exhaustive-ui-core-contextmenu.d.ts +54 -71
- package/types/exhaustive-ui-core-dataview.d.ts +42 -65
- package/types/exhaustive-ui-core-datepicker.d.ts +109 -191
- package/types/exhaustive-ui-core-dialog.d.ts +73 -123
- package/types/exhaustive-ui-core-dock.d.ts +16 -25
- package/types/exhaustive-ui-core-dragdrop.d.ts +32 -36
- package/types/exhaustive-ui-core-drawer.d.ts +32 -64
- package/types/exhaustive-ui-core-dynamicdialog.d.ts +9 -54
- package/types/exhaustive-ui-core-editor.d.ts +15 -25
- package/types/exhaustive-ui-core-fieldset.d.ts +15 -35
- package/types/exhaustive-ui-core-fileupload.d.ts +69 -95
- package/types/exhaustive-ui-core-floatlabel.d.ts +4 -6
- package/types/exhaustive-ui-core-focustrap.d.ts +5 -10
- package/types/exhaustive-ui-core-galleria.d.ts +124 -194
- package/types/exhaustive-ui-core-iconfield.d.ts +5 -13
- package/types/exhaustive-ui-core-icons-baseicon.d.ts +4 -5
- package/types/exhaustive-ui-core-image.d.ts +35 -68
- package/types/exhaustive-ui-core-imagecompare.d.ts +19 -20
- package/types/exhaustive-ui-core-inplace.d.ts +30 -42
- package/types/exhaustive-ui-core-inputgroup.d.ts +2 -9
- package/types/exhaustive-ui-core-inputgroupaddon.d.ts +6 -10
- package/types/exhaustive-ui-core-inputicon.d.ts +4 -11
- package/types/exhaustive-ui-core-inputmask.d.ts +53 -66
- package/types/exhaustive-ui-core-inputnumber.d.ts +62 -84
- package/types/exhaustive-ui-core-inputotp.d.ts +16 -20
- package/types/exhaustive-ui-core-inputtext.d.ts +5 -8
- package/types/exhaustive-ui-core-keyfilter.d.ts +11 -15
- package/types/exhaustive-ui-core-knob.d.ts +45 -60
- package/types/exhaustive-ui-core-listbox.d.ts +90 -126
- package/types/exhaustive-ui-core-megamenu.d.ts +45 -66
- package/types/exhaustive-ui-core-menu.d.ts +33 -53
- package/types/exhaustive-ui-core-menubar.d.ts +38 -85
- package/types/exhaustive-ui-core-metergroup.d.ts +39 -48
- package/types/exhaustive-ui-core-multiselect.d.ts +166 -219
- package/types/exhaustive-ui-core-orderlist.d.ts +58 -81
- package/types/exhaustive-ui-core-organizationchart.d.ts +32 -67
- package/types/exhaustive-ui-core-overlaybadge.d.ts +10 -20
- package/types/exhaustive-ui-core-paginator.d.ts +41 -69
- package/types/exhaustive-ui-core-panel.d.ts +18 -45
- package/types/exhaustive-ui-core-panelmenu.d.ts +31 -76
- package/types/exhaustive-ui-core-password.d.ts +56 -93
- package/types/exhaustive-ui-core-picklist.d.ts +107 -121
- package/types/exhaustive-ui-core-popover.d.ts +23 -47
- package/types/exhaustive-ui-core-rating.d.ts +18 -26
- package/types/exhaustive-ui-core-scroller.d.ts +90 -120
- package/types/exhaustive-ui-core-scrollpanel.d.ts +35 -46
- package/types/exhaustive-ui-core-scrolltop.d.ts +28 -45
- package/types/exhaustive-ui-core-select.d.ts +137 -188
- package/types/exhaustive-ui-core-selectbutton.d.ts +35 -44
- package/types/exhaustive-ui-core-slider.d.ts +52 -67
- package/types/exhaustive-ui-core-speeddial.d.ts +40 -56
- package/types/exhaustive-ui-core-splitbutton.d.ts +31 -71
- package/types/exhaustive-ui-core-splitter.d.ts +47 -59
- package/types/exhaustive-ui-core-steps.d.ts +24 -31
- package/types/exhaustive-ui-core-styleclass.d.ts +27 -33
- package/types/exhaustive-ui-core-table.d.ts +349 -453
- package/types/exhaustive-ui-core-terminal.d.ts +10 -22
- package/types/exhaustive-ui-core-textarea.d.ts +7 -10
- package/types/exhaustive-ui-core-tieredmenu.d.ts +49 -84
- package/types/exhaustive-ui-core-timeline.d.ts +20 -28
- package/types/exhaustive-ui-core-togglebutton.d.ts +32 -48
- package/types/exhaustive-ui-core-toggleswitch.d.ts +26 -37
- package/types/exhaustive-ui-core-toolbar.d.ts +17 -25
- package/types/exhaustive-ui-core-tooltip.d.ts +53 -88
- package/types/exhaustive-ui-core-tree.d.ts +82 -119
- package/types/exhaustive-ui-core-treeselect.d.ts +63 -92
- package/types/exhaustive-ui-core-treetable.d.ts +203 -280
- package/types/exhaustive-ui-core-types-chip.d.ts +1 -1
|
@@ -2,7 +2,7 @@ export * from '@exhaustive-ui/core/types/galleria';
|
|
|
2
2
|
import * as i2 from '@angular/common';
|
|
3
3
|
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { Injectable, InjectionToken, inject, ElementRef,
|
|
5
|
+
import { Injectable, InjectionToken, inject, ElementRef, afterEveryRender, effect, model, input, booleanAttribute, numberAttribute, computed, signal, viewChild, contentChild, linkedSignal, contentChildren, ViewEncapsulation, ChangeDetectionStrategy, Component, output, untracked, afterNextRender, NgModule } from '@angular/core';
|
|
6
6
|
import { findSingle, focus, removeClass, uuid, setAttribute, find, getAttribute, addClass } from '@exhaustive-ui/utils';
|
|
7
7
|
import { PrimeTemplate, SharedModule } from '@exhaustive-ui/core/api';
|
|
8
8
|
import { BaseComponent, PARENT_INSTANCE } from '@exhaustive-ui/core/basecomponent';
|
|
@@ -21,14 +21,14 @@ import { BaseStyle } from '@exhaustive-ui/core/base';
|
|
|
21
21
|
const classes = {
|
|
22
22
|
mask: 'p-galleria-mask p-overlay-mask',
|
|
23
23
|
root: ({ instance }) => {
|
|
24
|
-
const thumbnailsPosClass = instance.galleria.showThumbnails && instance.getPositionClass('p-galleria-thumbnails', instance.galleria.thumbnailsPosition);
|
|
25
|
-
const indicatorPosClass = instance.galleria.showIndicators && instance.getPositionClass('p-galleria-indicators', instance.galleria.indicatorsPosition);
|
|
24
|
+
const thumbnailsPosClass = instance.galleria.showThumbnails() && instance.getPositionClass('p-galleria-thumbnails', instance.galleria.thumbnailsPosition());
|
|
25
|
+
const indicatorPosClass = instance.galleria.showIndicators() && instance.getPositionClass('p-galleria-indicators', instance.galleria.indicatorsPosition());
|
|
26
26
|
return [
|
|
27
27
|
'p-galleria p-component',
|
|
28
28
|
{
|
|
29
|
-
'p-galleria-fullscreen': instance.galleria.fullScreen,
|
|
30
|
-
'p-galleria-inset-indicators': instance.galleria.showIndicatorsOnItem,
|
|
31
|
-
'p-galleria-hover-navigators': instance.galleria.showItemNavigatorsOnHover && !instance.galleria.fullScreen
|
|
29
|
+
'p-galleria-fullscreen': instance.galleria.fullScreen(),
|
|
30
|
+
'p-galleria-inset-indicators': instance.galleria.showIndicatorsOnItem(),
|
|
31
|
+
'p-galleria-hover-navigators': instance.galleria.showItemNavigatorsOnHover() && !instance.galleria.fullScreen()
|
|
32
32
|
},
|
|
33
33
|
thumbnailsPosClass,
|
|
34
34
|
indicatorPosClass
|
|
@@ -239,147 +239,142 @@ class Galleria extends BaseComponent {
|
|
|
239
239
|
componentName = 'Galleria';
|
|
240
240
|
bindDirectiveInstance = inject(Bind, { self: true });
|
|
241
241
|
$pcGalleria = inject(GALLERIA_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
constructor() {
|
|
243
|
+
super();
|
|
244
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptm('host')));
|
|
245
|
+
effect(() => {
|
|
246
|
+
if (this.visible()) {
|
|
247
|
+
this.renderMask.set(true);
|
|
248
|
+
this.renderContent.set(true);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
244
251
|
}
|
|
245
252
|
/**
|
|
246
|
-
* Index of the first item.
|
|
253
|
+
* Index of the first item, supports one or two-way binding as well.
|
|
254
|
+
* Emits `activeIndexChange` with the new index when the active item changes.
|
|
247
255
|
* @group Props
|
|
248
256
|
*/
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
set activeIndex(activeIndex) {
|
|
253
|
-
this._activeIndex = activeIndex;
|
|
254
|
-
}
|
|
257
|
+
activeIndex = model(0, /* @ts-ignore */
|
|
258
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
255
259
|
/**
|
|
256
260
|
* Whether to display the component on fullscreen.
|
|
257
261
|
* @group Props
|
|
258
262
|
*/
|
|
259
|
-
fullScreen = false;
|
|
263
|
+
fullScreen = input(false, { ...(ngDevMode ? { debugName: "fullScreen" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
260
264
|
/**
|
|
261
265
|
* Unique identifier of the element.
|
|
262
266
|
* @group Props
|
|
263
267
|
*/
|
|
264
|
-
id
|
|
268
|
+
id = input(/* @ts-ignore */
|
|
269
|
+
...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
|
|
265
270
|
/**
|
|
266
271
|
* An array of objects to display.
|
|
267
272
|
* @group Props
|
|
268
273
|
*/
|
|
269
|
-
value
|
|
274
|
+
value = input(/* @ts-ignore */
|
|
275
|
+
...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
270
276
|
/**
|
|
271
277
|
* Number of items per page.
|
|
272
278
|
* @group Props
|
|
273
279
|
*/
|
|
274
|
-
numVisible = 3;
|
|
280
|
+
numVisible = input(3, { ...(ngDevMode ? { debugName: "numVisible" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
275
281
|
/**
|
|
276
282
|
* An array of options for responsive design.
|
|
277
283
|
* @see {GalleriaResponsiveOptions}
|
|
278
284
|
* @group Props
|
|
279
285
|
*/
|
|
280
|
-
responsiveOptions
|
|
286
|
+
responsiveOptions = input(/* @ts-ignore */
|
|
287
|
+
...(ngDevMode ? [undefined, { debugName: "responsiveOptions" }] : /* istanbul ignore next */ []));
|
|
281
288
|
/**
|
|
282
289
|
* Whether to display navigation buttons in item section.
|
|
283
290
|
* @group Props
|
|
284
291
|
*/
|
|
285
|
-
showItemNavigators = false;
|
|
292
|
+
showItemNavigators = input(false, { ...(ngDevMode ? { debugName: "showItemNavigators" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
286
293
|
/**
|
|
287
294
|
* Whether to display navigation buttons in thumbnail container.
|
|
288
295
|
* @group Props
|
|
289
296
|
*/
|
|
290
|
-
showThumbnailNavigators = true;
|
|
297
|
+
showThumbnailNavigators = input(true, { ...(ngDevMode ? { debugName: "showThumbnailNavigators" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
291
298
|
/**
|
|
292
299
|
* Whether to display navigation buttons on item hover.
|
|
293
300
|
* @group Props
|
|
294
301
|
*/
|
|
295
|
-
showItemNavigatorsOnHover = false;
|
|
302
|
+
showItemNavigatorsOnHover = input(false, { ...(ngDevMode ? { debugName: "showItemNavigatorsOnHover" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
296
303
|
/**
|
|
297
304
|
* When enabled, item is changed on indicator hover.
|
|
298
305
|
* @group Props
|
|
299
306
|
*/
|
|
300
|
-
changeItemOnIndicatorHover = false;
|
|
307
|
+
changeItemOnIndicatorHover = input(false, { ...(ngDevMode ? { debugName: "changeItemOnIndicatorHover" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
301
308
|
/**
|
|
302
309
|
* Defines if scrolling would be infinite.
|
|
303
310
|
* @group Props
|
|
304
311
|
*/
|
|
305
|
-
circular = false;
|
|
312
|
+
circular = input(false, { ...(ngDevMode ? { debugName: "circular" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
306
313
|
/**
|
|
307
314
|
* Items are displayed with a slideshow in autoPlay mode.
|
|
308
315
|
* @group Props
|
|
309
316
|
*/
|
|
310
|
-
autoPlay = false;
|
|
317
|
+
autoPlay = input(false, { ...(ngDevMode ? { debugName: "autoPlay" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
311
318
|
/**
|
|
312
319
|
* When enabled, autorun should stop by click.
|
|
313
320
|
* @group Props
|
|
314
321
|
*/
|
|
315
|
-
shouldStopAutoplayByClick = true;
|
|
322
|
+
shouldStopAutoplayByClick = input(true, { ...(ngDevMode ? { debugName: "shouldStopAutoplayByClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
316
323
|
/**
|
|
317
324
|
* Time in milliseconds to scroll items.
|
|
318
325
|
* @group Props
|
|
319
326
|
*/
|
|
320
|
-
transitionInterval = 4000;
|
|
327
|
+
transitionInterval = input(4000, { ...(ngDevMode ? { debugName: "transitionInterval" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
321
328
|
/**
|
|
322
329
|
* Whether to display thumbnail container.
|
|
323
330
|
* @group Props
|
|
324
331
|
*/
|
|
325
|
-
showThumbnails = true;
|
|
332
|
+
showThumbnails = input(true, { ...(ngDevMode ? { debugName: "showThumbnails" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
326
333
|
/**
|
|
327
334
|
* Position of thumbnails.
|
|
328
335
|
* @group Props
|
|
329
336
|
*/
|
|
330
|
-
thumbnailsPosition = 'bottom'
|
|
337
|
+
thumbnailsPosition = input('bottom', /* @ts-ignore */
|
|
338
|
+
...(ngDevMode ? [{ debugName: "thumbnailsPosition" }] : /* istanbul ignore next */ []));
|
|
331
339
|
/**
|
|
332
340
|
* Height of the viewport in vertical thumbnail.
|
|
333
341
|
* @group Props
|
|
334
342
|
*/
|
|
335
|
-
verticalThumbnailViewPortHeight = '300px'
|
|
343
|
+
verticalThumbnailViewPortHeight = input('300px', /* @ts-ignore */
|
|
344
|
+
...(ngDevMode ? [{ debugName: "verticalThumbnailViewPortHeight" }] : /* istanbul ignore next */ []));
|
|
336
345
|
/**
|
|
337
346
|
* Whether to display indicator container.
|
|
338
347
|
* @group Props
|
|
339
348
|
*/
|
|
340
|
-
showIndicators = false;
|
|
349
|
+
showIndicators = input(false, { ...(ngDevMode ? { debugName: "showIndicators" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
341
350
|
/**
|
|
342
351
|
* When enabled, indicator container is displayed on item container.
|
|
343
352
|
* @group Props
|
|
344
353
|
*/
|
|
345
|
-
showIndicatorsOnItem = false;
|
|
354
|
+
showIndicatorsOnItem = input(false, { ...(ngDevMode ? { debugName: "showIndicatorsOnItem" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
346
355
|
/**
|
|
347
356
|
* Position of indicators.
|
|
348
357
|
* @group Props
|
|
349
358
|
*/
|
|
350
|
-
indicatorsPosition = 'bottom'
|
|
359
|
+
indicatorsPosition = input('bottom', /* @ts-ignore */
|
|
360
|
+
...(ngDevMode ? [{ debugName: "indicatorsPosition" }] : /* istanbul ignore next */ []));
|
|
351
361
|
/**
|
|
352
362
|
* Base zIndex value to use in layering.
|
|
353
363
|
* @group Props
|
|
354
364
|
*/
|
|
355
|
-
baseZIndex = 0;
|
|
365
|
+
baseZIndex = input(0, { ...(ngDevMode ? { debugName: "baseZIndex" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
356
366
|
/**
|
|
357
367
|
* Style class of the mask on fullscreen mode.
|
|
358
368
|
* @group Props
|
|
359
369
|
*/
|
|
360
|
-
maskClass
|
|
361
|
-
|
|
362
|
-
* Style class of the component on fullscreen mode. Otherwise, the 'class' property can be used.
|
|
363
|
-
* @group Props
|
|
364
|
-
*/
|
|
365
|
-
containerClass;
|
|
370
|
+
maskClass = input(/* @ts-ignore */
|
|
371
|
+
...(ngDevMode ? [undefined, { debugName: "maskClass" }] : /* istanbul ignore next */ []));
|
|
366
372
|
/**
|
|
367
373
|
* Inline style of the component on fullscreen mode. Otherwise, the 'style' property can be used.
|
|
368
374
|
* @group Props
|
|
369
375
|
*/
|
|
370
|
-
containerStyle
|
|
371
|
-
|
|
372
|
-
* Transition options of the show animation.
|
|
373
|
-
* @deprecated since v21.0.0. Use `motionOptions` instead.
|
|
374
|
-
* @group Props
|
|
375
|
-
*/
|
|
376
|
-
showTransitionOptions = '150ms cubic-bezier(0, 0, 0.2, 1)';
|
|
377
|
-
/**
|
|
378
|
-
* Transition options of the hide animation.
|
|
379
|
-
* @deprecated since v21.0.0. Use `motionOptions` instead.
|
|
380
|
-
* @group Props
|
|
381
|
-
*/
|
|
382
|
-
hideTransitionOptions = '150ms cubic-bezier(0, 0, 0.2, 1)';
|
|
376
|
+
containerStyle = input(/* @ts-ignore */
|
|
377
|
+
...(ngDevMode ? [undefined, { debugName: "containerStyle" }] : /* istanbul ignore next */ []));
|
|
383
378
|
/**
|
|
384
379
|
* The motion options.
|
|
385
380
|
* @group Props
|
|
@@ -407,176 +402,141 @@ class Galleria extends BaseComponent {
|
|
|
407
402
|
}, /* @ts-ignore */
|
|
408
403
|
...(ngDevMode ? [{ debugName: "computedMaskMotionOptions" }] : /* istanbul ignore next */ []));
|
|
409
404
|
/**
|
|
410
|
-
* Specifies the visibility of the mask on fullscreen mode.
|
|
405
|
+
* Specifies the visibility of the mask on fullscreen mode, supports one or two-way binding as well.
|
|
406
|
+
* Emits `visibleChange` with the new value when the visibility changes.
|
|
411
407
|
* @group Props
|
|
412
408
|
*/
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
set visible(visible) {
|
|
417
|
-
this._visible = visible;
|
|
418
|
-
if (this._visible && !this.maskVisible) {
|
|
419
|
-
this.maskVisible = true;
|
|
420
|
-
this.renderMask.set(true);
|
|
421
|
-
this.renderContent.set(true);
|
|
422
|
-
}
|
|
423
|
-
else if (!this._visible && this.maskVisible) {
|
|
424
|
-
this.maskVisible = false;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
409
|
+
visible = model(false, /* @ts-ignore */
|
|
410
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
427
411
|
renderMask = signal(false, /* @ts-ignore */
|
|
428
412
|
...(ngDevMode ? [{ debugName: "renderMask" }] : /* istanbul ignore next */ []));
|
|
429
413
|
renderContent = signal(false, /* @ts-ignore */
|
|
430
414
|
...(ngDevMode ? [{ debugName: "renderContent" }] : /* istanbul ignore next */ []));
|
|
431
|
-
/**
|
|
432
|
-
* Callback to invoke on active index change.
|
|
433
|
-
* @param {number} number - Active index.
|
|
434
|
-
* @group Emits
|
|
435
|
-
*/
|
|
436
|
-
activeIndexChange = output();
|
|
437
|
-
/**
|
|
438
|
-
* Callback to invoke on visiblity change.
|
|
439
|
-
* @param {boolean} boolean - Visible value.
|
|
440
|
-
* @group Emits
|
|
441
|
-
*/
|
|
442
|
-
visibleChange = output();
|
|
443
415
|
container = viewChild('container', /* @ts-ignore */
|
|
444
416
|
...(ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []));
|
|
445
|
-
_visible = false;
|
|
446
|
-
_activeIndex = 0;
|
|
447
417
|
/**
|
|
448
418
|
* Custom header template.
|
|
449
419
|
* @group Templates
|
|
450
420
|
*/
|
|
451
421
|
headerTemplate = contentChild('header', { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
452
|
-
headerFacet
|
|
422
|
+
headerFacet = computed(() => this.templates()
|
|
423
|
+
.filter((item) => item.getType() === 'header')
|
|
424
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
425
|
+
...(ngDevMode ? [{ debugName: "headerFacet" }] : /* istanbul ignore next */ []));
|
|
453
426
|
/**
|
|
454
427
|
* Custom footer template.
|
|
455
428
|
* @group Templates
|
|
456
429
|
*/
|
|
457
430
|
footerTemplate = contentChild('footer', { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
458
|
-
footerFacet
|
|
431
|
+
footerFacet = computed(() => this.templates()
|
|
432
|
+
.filter((item) => item.getType() === 'footer')
|
|
433
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
434
|
+
...(ngDevMode ? [{ debugName: "footerFacet" }] : /* istanbul ignore next */ []));
|
|
459
435
|
/**
|
|
460
436
|
* Custom indicator template.
|
|
461
437
|
* @group Templates
|
|
462
438
|
*/
|
|
463
439
|
indicatorTemplate = contentChild('indicator', { ...(ngDevMode ? { debugName: "indicatorTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
464
|
-
indicatorFacet
|
|
440
|
+
indicatorFacet = computed(() => this.templates()
|
|
441
|
+
.filter((item) => item.getType() === 'indicator')
|
|
442
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
443
|
+
...(ngDevMode ? [{ debugName: "indicatorFacet" }] : /* istanbul ignore next */ []));
|
|
465
444
|
/**
|
|
466
445
|
* Custom caption template.
|
|
467
446
|
* @group Templates
|
|
468
447
|
*/
|
|
469
448
|
captionTemplate = contentChild('caption', { ...(ngDevMode ? { debugName: "captionTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
470
|
-
captionFacet
|
|
449
|
+
captionFacet = computed(() => this.templates()
|
|
450
|
+
.filter((item) => item.getType() === 'caption')
|
|
451
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
452
|
+
...(ngDevMode ? [{ debugName: "captionFacet" }] : /* istanbul ignore next */ []));
|
|
471
453
|
/**
|
|
472
454
|
* Custom close icon template.
|
|
473
455
|
* @group Templates
|
|
474
456
|
*/
|
|
475
457
|
_closeIconTemplate = contentChild('closeicon', { ...(ngDevMode ? { debugName: "_closeIconTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
476
|
-
closeIconTemplate
|
|
458
|
+
closeIconTemplate = computed(() => this.templates()
|
|
459
|
+
.filter((item) => item.getType() === 'closeicon')
|
|
460
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
461
|
+
...(ngDevMode ? [{ debugName: "closeIconTemplate" }] : /* istanbul ignore next */ []));
|
|
477
462
|
/**
|
|
478
463
|
* Custom previous thumbnail icon template.
|
|
479
464
|
* @group Templates
|
|
480
465
|
*/
|
|
481
466
|
_previousThumbnailIconTemplate = contentChild('previousthumbnailicon', { ...(ngDevMode ? { debugName: "_previousThumbnailIconTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
482
|
-
previousThumbnailIconTemplate
|
|
467
|
+
previousThumbnailIconTemplate = computed(() => this.templates()
|
|
468
|
+
.filter((item) => item.getType() === 'previousthumbnailicon')
|
|
469
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
470
|
+
...(ngDevMode ? [{ debugName: "previousThumbnailIconTemplate" }] : /* istanbul ignore next */ []));
|
|
483
471
|
/**
|
|
484
472
|
* Custom next thumbnail icon template.
|
|
485
473
|
* @group Templates
|
|
486
474
|
*/
|
|
487
475
|
_nextThumbnailIconTemplate = contentChild('nextthumbnailicon', { ...(ngDevMode ? { debugName: "_nextThumbnailIconTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
488
|
-
nextThumbnailIconTemplate
|
|
476
|
+
nextThumbnailIconTemplate = computed(() => this.templates()
|
|
477
|
+
.filter((item) => item.getType() === 'nextthumbnailicon')
|
|
478
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
479
|
+
...(ngDevMode ? [{ debugName: "nextThumbnailIconTemplate" }] : /* istanbul ignore next */ []));
|
|
489
480
|
/**
|
|
490
481
|
* Custom item previous icon template.
|
|
491
482
|
* @group Templates
|
|
492
483
|
*/
|
|
493
484
|
_itemPreviousIconTemplate = contentChild('itempreviousicon', { ...(ngDevMode ? { debugName: "_itemPreviousIconTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
494
|
-
itemPreviousIconTemplate
|
|
485
|
+
itemPreviousIconTemplate = computed(() => this.templates()
|
|
486
|
+
.filter((item) => item.getType() === 'itempreviousicon')
|
|
487
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
488
|
+
...(ngDevMode ? [{ debugName: "itemPreviousIconTemplate" }] : /* istanbul ignore next */ []));
|
|
495
489
|
/**
|
|
496
490
|
* Custom item next icon template.
|
|
497
491
|
* @group Templates
|
|
498
492
|
*/
|
|
499
493
|
_itemNextIconTemplate = contentChild('itemnexticon', { ...(ngDevMode ? { debugName: "_itemNextIconTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
500
|
-
itemNextIconTemplate
|
|
494
|
+
itemNextIconTemplate = computed(() => this.templates()
|
|
495
|
+
.filter((item) => item.getType() === 'itemnexticon')
|
|
496
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
497
|
+
...(ngDevMode ? [{ debugName: "itemNextIconTemplate" }] : /* istanbul ignore next */ []));
|
|
501
498
|
/**
|
|
502
499
|
* Custom item template.
|
|
503
500
|
* @group Templates
|
|
504
501
|
*/
|
|
505
502
|
_itemTemplate = contentChild('item', { ...(ngDevMode ? { debugName: "_itemTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
506
|
-
itemTemplate
|
|
503
|
+
itemTemplate = computed(() => this.templates()
|
|
504
|
+
.filter((item) => item.getType() === 'item')
|
|
505
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
506
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
507
507
|
/**
|
|
508
508
|
* Custom thumbnail template.
|
|
509
509
|
* @group Templates
|
|
510
510
|
*/
|
|
511
511
|
_thumbnailTemplate = contentChild('thumbnail', { ...(ngDevMode ? { debugName: "_thumbnailTemplate" } : /* istanbul ignore next */ {}), descendants: false });
|
|
512
|
-
thumbnailTemplate
|
|
513
|
-
|
|
514
|
-
|
|
512
|
+
thumbnailTemplate = computed(() => this.templates()
|
|
513
|
+
.filter((item) => item.getType() === 'thumbnail')
|
|
514
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
515
|
+
...(ngDevMode ? [{ debugName: "thumbnailTemplate" }] : /* istanbul ignore next */ []));
|
|
516
|
+
maskVisible = linkedSignal(() => this.visible(), /* @ts-ignore */
|
|
517
|
+
...(ngDevMode ? [{ debugName: "maskVisible" }] : /* istanbul ignore next */ []));
|
|
518
|
+
numVisibleLimit = computed(() => {
|
|
519
|
+
const value = this.value();
|
|
520
|
+
return value && value.length < this.numVisible() ? value.length : 0;
|
|
521
|
+
}, /* @ts-ignore */
|
|
522
|
+
...(ngDevMode ? [{ debugName: "numVisibleLimit" }] : /* istanbul ignore next */ []));
|
|
515
523
|
_componentStyle = inject(GalleriaStyle);
|
|
516
|
-
mask
|
|
524
|
+
mask = signal(undefined, /* @ts-ignore */
|
|
525
|
+
...(ngDevMode ? [{ debugName: "mask" }] : /* istanbul ignore next */ []));
|
|
517
526
|
templates = contentChildren(PrimeTemplate, /* @ts-ignore */
|
|
518
527
|
...(ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []));
|
|
519
|
-
onAfterContentInit() {
|
|
520
|
-
this.templates()?.forEach((item) => {
|
|
521
|
-
switch (item.getType()) {
|
|
522
|
-
case 'header':
|
|
523
|
-
this.headerFacet = item.template;
|
|
524
|
-
break;
|
|
525
|
-
case 'footer':
|
|
526
|
-
this.footerFacet = item.template;
|
|
527
|
-
break;
|
|
528
|
-
case 'indicator':
|
|
529
|
-
this.indicatorFacet = item.template;
|
|
530
|
-
break;
|
|
531
|
-
case 'closeicon':
|
|
532
|
-
this.closeIconTemplate = item.template;
|
|
533
|
-
break;
|
|
534
|
-
case 'itemnexticon':
|
|
535
|
-
this.itemNextIconTemplate = item.template;
|
|
536
|
-
break;
|
|
537
|
-
case 'itempreviousicon':
|
|
538
|
-
this.itemPreviousIconTemplate = item.template;
|
|
539
|
-
break;
|
|
540
|
-
case 'previousthumbnailicon':
|
|
541
|
-
this.previousThumbnailIconTemplate = item.template;
|
|
542
|
-
break;
|
|
543
|
-
case 'nextthumbnailicon':
|
|
544
|
-
this.nextThumbnailIconTemplate = item.template;
|
|
545
|
-
break;
|
|
546
|
-
case 'caption':
|
|
547
|
-
this.captionFacet = item.template;
|
|
548
|
-
break;
|
|
549
|
-
case 'item':
|
|
550
|
-
this.itemTemplate = item.template;
|
|
551
|
-
break;
|
|
552
|
-
case 'thumbnail':
|
|
553
|
-
this.thumbnailTemplate = item.template;
|
|
554
|
-
break;
|
|
555
|
-
}
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
onChanges(simpleChanges) {
|
|
559
|
-
if (simpleChanges.value && simpleChanges.value.currentValue?.length < this.numVisible) {
|
|
560
|
-
this.numVisibleLimit = simpleChanges.value.currentValue.length;
|
|
561
|
-
}
|
|
562
|
-
else {
|
|
563
|
-
this.numVisibleLimit = 0;
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
528
|
onMaskHide(event) {
|
|
567
529
|
if (!event || event.target === event.currentTarget) {
|
|
568
|
-
this.visible
|
|
569
|
-
this.visibleChange.emit(false);
|
|
530
|
+
this.visible.set(false);
|
|
570
531
|
}
|
|
571
532
|
}
|
|
572
533
|
onActiveItemChange(index) {
|
|
573
|
-
if (this.activeIndex !== index) {
|
|
574
|
-
this.activeIndex
|
|
575
|
-
this.activeIndexChange.emit(index);
|
|
534
|
+
if (this.activeIndex() !== index) {
|
|
535
|
+
this.activeIndex.set(index);
|
|
576
536
|
}
|
|
577
537
|
}
|
|
578
538
|
onBeforeEnter(event) {
|
|
579
|
-
this.mask
|
|
539
|
+
this.mask.set(event.element?.parentElement);
|
|
580
540
|
this.enableModality();
|
|
581
541
|
setTimeout(() => {
|
|
582
542
|
const focusTarget = findSingle(this.container()?.nativeElement, '[data-pc-section="closebutton"]');
|
|
@@ -585,8 +545,8 @@ class Galleria extends BaseComponent {
|
|
|
585
545
|
}, 25);
|
|
586
546
|
}
|
|
587
547
|
onBeforeLeave() {
|
|
588
|
-
if (this.mask) {
|
|
589
|
-
this.maskVisible
|
|
548
|
+
if (this.mask()) {
|
|
549
|
+
this.maskVisible.set(false);
|
|
590
550
|
}
|
|
591
551
|
}
|
|
592
552
|
onAfterLeave() {
|
|
@@ -601,66 +561,65 @@ class Galleria extends BaseComponent {
|
|
|
601
561
|
enableModality() {
|
|
602
562
|
//@ts-ignore
|
|
603
563
|
blockBodyScroll();
|
|
604
|
-
this.
|
|
605
|
-
if (
|
|
606
|
-
ZIndexUtils.set('modal',
|
|
564
|
+
const mask = this.mask();
|
|
565
|
+
if (mask) {
|
|
566
|
+
ZIndexUtils.set('modal', mask, this.baseZIndex() || this.config.zIndex.modal);
|
|
607
567
|
}
|
|
608
568
|
}
|
|
609
569
|
disableModality() {
|
|
610
570
|
//@ts-ignore
|
|
611
571
|
unblockBodyScroll();
|
|
612
|
-
this.
|
|
613
|
-
if (
|
|
614
|
-
ZIndexUtils.clear(
|
|
572
|
+
const mask = this.mask();
|
|
573
|
+
if (mask) {
|
|
574
|
+
ZIndexUtils.clear(mask);
|
|
615
575
|
}
|
|
616
576
|
}
|
|
617
577
|
onDestroy() {
|
|
618
|
-
if (this.fullScreen) {
|
|
578
|
+
if (this.fullScreen()) {
|
|
619
579
|
removeClass(this.document.body, 'p-overflow-hidden');
|
|
620
580
|
}
|
|
621
|
-
if (this.mask) {
|
|
581
|
+
if (this.mask()) {
|
|
622
582
|
this.disableModality();
|
|
623
583
|
}
|
|
624
584
|
}
|
|
625
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: Galleria, deps:
|
|
626
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: Galleria, isStandalone: false, selector: "p-galleria", inputs: { activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal:
|
|
627
|
-
@if (fullScreen) {
|
|
585
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: Galleria, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
586
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: Galleria, isStandalone: false, selector: "p-galleria", inputs: { activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null }, fullScreen: { classPropertyName: "fullScreen", publicName: "fullScreen", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, numVisible: { classPropertyName: "numVisible", publicName: "numVisible", isSignal: true, isRequired: false, transformFunction: null }, responsiveOptions: { classPropertyName: "responsiveOptions", publicName: "responsiveOptions", isSignal: true, isRequired: false, transformFunction: null }, showItemNavigators: { classPropertyName: "showItemNavigators", publicName: "showItemNavigators", isSignal: true, isRequired: false, transformFunction: null }, showThumbnailNavigators: { classPropertyName: "showThumbnailNavigators", publicName: "showThumbnailNavigators", isSignal: true, isRequired: false, transformFunction: null }, showItemNavigatorsOnHover: { classPropertyName: "showItemNavigatorsOnHover", publicName: "showItemNavigatorsOnHover", isSignal: true, isRequired: false, transformFunction: null }, changeItemOnIndicatorHover: { classPropertyName: "changeItemOnIndicatorHover", publicName: "changeItemOnIndicatorHover", isSignal: true, isRequired: false, transformFunction: null }, circular: { classPropertyName: "circular", publicName: "circular", isSignal: true, isRequired: false, transformFunction: null }, autoPlay: { classPropertyName: "autoPlay", publicName: "autoPlay", isSignal: true, isRequired: false, transformFunction: null }, shouldStopAutoplayByClick: { classPropertyName: "shouldStopAutoplayByClick", publicName: "shouldStopAutoplayByClick", isSignal: true, isRequired: false, transformFunction: null }, transitionInterval: { classPropertyName: "transitionInterval", publicName: "transitionInterval", isSignal: true, isRequired: false, transformFunction: null }, showThumbnails: { classPropertyName: "showThumbnails", publicName: "showThumbnails", isSignal: true, isRequired: false, transformFunction: null }, thumbnailsPosition: { classPropertyName: "thumbnailsPosition", publicName: "thumbnailsPosition", isSignal: true, isRequired: false, transformFunction: null }, verticalThumbnailViewPortHeight: { classPropertyName: "verticalThumbnailViewPortHeight", publicName: "verticalThumbnailViewPortHeight", isSignal: true, isRequired: false, transformFunction: null }, showIndicators: { classPropertyName: "showIndicators", publicName: "showIndicators", isSignal: true, isRequired: false, transformFunction: null }, showIndicatorsOnItem: { classPropertyName: "showIndicatorsOnItem", publicName: "showIndicatorsOnItem", isSignal: true, isRequired: false, transformFunction: null }, indicatorsPosition: { classPropertyName: "indicatorsPosition", publicName: "indicatorsPosition", isSignal: true, isRequired: false, transformFunction: null }, baseZIndex: { classPropertyName: "baseZIndex", publicName: "baseZIndex", isSignal: true, isRequired: false, transformFunction: null }, maskClass: { classPropertyName: "maskClass", publicName: "maskClass", isSignal: true, isRequired: false, transformFunction: null }, containerStyle: { classPropertyName: "containerStyle", publicName: "containerStyle", isSignal: true, isRequired: false, transformFunction: null }, motionOptions: { classPropertyName: "motionOptions", publicName: "motionOptions", isSignal: true, isRequired: false, transformFunction: null }, maskMotionOptions: { classPropertyName: "maskMotionOptions", publicName: "maskMotionOptions", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeIndex: "activeIndexChange", visible: "visibleChange" }, providers: [GalleriaStyle, { provide: GALLERIA_INSTANCE, useExisting: Galleria }, { provide: PARENT_INSTANCE, useExisting: Galleria }], queries: [{ propertyName: "headerTemplate", first: true, predicate: ["header"], isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], isSignal: true }, { propertyName: "indicatorTemplate", first: true, predicate: ["indicator"], isSignal: true }, { propertyName: "captionTemplate", first: true, predicate: ["caption"], isSignal: true }, { propertyName: "_closeIconTemplate", first: true, predicate: ["closeicon"], isSignal: true }, { propertyName: "_previousThumbnailIconTemplate", first: true, predicate: ["previousthumbnailicon"], isSignal: true }, { propertyName: "_nextThumbnailIconTemplate", first: true, predicate: ["nextthumbnailicon"], isSignal: true }, { propertyName: "_itemPreviousIconTemplate", first: true, predicate: ["itempreviousicon"], isSignal: true }, { propertyName: "_itemNextIconTemplate", first: true, predicate: ["itemnexticon"], isSignal: true }, { propertyName: "_itemTemplate", first: true, predicate: ["item"], isSignal: true }, { propertyName: "_thumbnailTemplate", first: true, predicate: ["thumbnail"], isSignal: true }, { propertyName: "templates", predicate: PrimeTemplate, isSignal: true }], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0, template: `
|
|
587
|
+
@if (fullScreen()) {
|
|
628
588
|
<div #container>
|
|
629
589
|
@if (renderMask()) {
|
|
630
590
|
<div
|
|
631
591
|
[pBind]="ptm('mask')"
|
|
632
|
-
[pMotion]="maskVisible"
|
|
592
|
+
[pMotion]="maskVisible()"
|
|
633
593
|
[pMotionAppear]="true"
|
|
634
|
-
[pMotionEnterActiveClass]="fullScreen ? 'p-overlay-mask-enter-active' : ''"
|
|
635
|
-
[pMotionLeaveActiveClass]="fullScreen ? 'p-overlay-mask-leave-active' : ''"
|
|
594
|
+
[pMotionEnterActiveClass]="fullScreen() ? 'p-overlay-mask-enter-active' : ''"
|
|
595
|
+
[pMotionLeaveActiveClass]="fullScreen() ? 'p-overlay-mask-leave-active' : ''"
|
|
636
596
|
[pMotionOptions]="computedMaskMotionOptions()"
|
|
637
597
|
(pMotionOnAfterLeave)="onMaskAfterLeave()"
|
|
638
598
|
[ngClass]="cx('mask')"
|
|
639
|
-
[class]="maskClass"
|
|
640
|
-
[attr.role]="fullScreen ? 'dialog' : 'region'"
|
|
641
|
-
[attr.aria-modal]="fullScreen ? 'true' : undefined"
|
|
599
|
+
[class]="maskClass()"
|
|
600
|
+
[attr.role]="fullScreen() ? 'dialog' : 'region'"
|
|
601
|
+
[attr.aria-modal]="fullScreen() ? 'true' : undefined"
|
|
642
602
|
(click)="onMaskHide($event)"
|
|
643
603
|
>
|
|
644
604
|
@if (renderContent()) {
|
|
645
605
|
<div
|
|
646
606
|
pGalleriaContent
|
|
647
|
-
[pMotion]="visible"
|
|
607
|
+
[pMotion]="visible()"
|
|
648
608
|
[pMotionAppear]="true"
|
|
649
609
|
[pMotionName]="'p-galleria'"
|
|
650
610
|
[pMotionOptions]="computedMotionOptions()"
|
|
651
611
|
(pMotionOnBeforeEnter)="onBeforeEnter($event)"
|
|
652
612
|
(pMotionOnBeforeLeave)="onBeforeLeave()"
|
|
653
613
|
(pMotionOnAfterLeave)="onAfterLeave()"
|
|
654
|
-
[value]="value"
|
|
655
|
-
[activeIndex]="activeIndex"
|
|
656
|
-
[numVisible]="numVisibleLimit || numVisible"
|
|
614
|
+
[value]="value()"
|
|
615
|
+
[activeIndex]="activeIndex()"
|
|
616
|
+
[numVisible]="numVisibleLimit() || numVisible()"
|
|
657
617
|
(maskHide)="onMaskHide()"
|
|
658
618
|
(activeItemChange)="onActiveItemChange($event)"
|
|
659
|
-
[ngStyle]="containerStyle"
|
|
660
|
-
[fullScreen]="fullScreen"
|
|
619
|
+
[ngStyle]="containerStyle()"
|
|
661
620
|
[pt]="pt()"
|
|
662
621
|
pFocusTrap
|
|
663
|
-
[pFocusTrapDisabled]="!fullScreen"
|
|
622
|
+
[pFocusTrapDisabled]="!fullScreen()"
|
|
664
623
|
[unstyled]="unstyled()"
|
|
665
624
|
></div>
|
|
666
625
|
}
|
|
@@ -668,9 +627,9 @@ class Galleria extends BaseComponent {
|
|
|
668
627
|
}
|
|
669
628
|
</div>
|
|
670
629
|
} @else {
|
|
671
|
-
<div pGalleriaContent [pt]="pt()" [unstyled]="unstyled()" [value]="value" [activeIndex]="activeIndex" [numVisible]="numVisibleLimit || numVisible" (activeItemChange)="onActiveItemChange($event)"></div>
|
|
630
|
+
<div pGalleriaContent [pt]="pt()" [unstyled]="unstyled()" [value]="value()" [activeIndex]="activeIndex()" [numVisible]="numVisibleLimit() || numVisible()" (activeItemChange)="onActiveItemChange($event)"></div>
|
|
672
631
|
}
|
|
673
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i0.forwardRef(() => i2.NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => i2.NgStyle), selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i0.forwardRef(() => FocusTrap), selector: "[pFocusTrap]", inputs: ["pFocusTrapDisabled"] }, { kind: "directive", type: i0.forwardRef(() => i1.Bind), selector: "[pBind]", inputs: ["pBind"] }, { kind: "directive", type: i0.forwardRef(() => i3.MotionDirective), selector: "[pMotion]", inputs: ["pMotion", "pMotionName", "pMotionType", "pMotionSafe", "pMotionDisabled", "pMotionAppear", "pMotionEnter", "pMotionLeave", "pMotionDuration", "pMotionHideStrategy", "pMotionEnterFromClass", "pMotionEnterToClass", "pMotionEnterActiveClass", "pMotionLeaveFromClass", "pMotionLeaveToClass", "pMotionLeaveActiveClass", "pMotionOptions"], outputs: ["pMotionOnBeforeEnter", "pMotionOnEnter", "pMotionOnAfterEnter", "pMotionOnEnterCancelled", "pMotionOnBeforeLeave", "pMotionOnLeave", "pMotionOnAfterLeave", "pMotionOnLeaveCancelled"] }, { kind: "component", type: i0.forwardRef(() => GalleriaContent), selector: "div[pGalleriaContent]", inputs: ["activeIndex", "value", "numVisible"
|
|
632
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i0.forwardRef(() => i2.NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => i2.NgStyle), selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i0.forwardRef(() => FocusTrap), selector: "[pFocusTrap]", inputs: ["pFocusTrapDisabled"] }, { kind: "directive", type: i0.forwardRef(() => i1.Bind), selector: "[pBind]", inputs: ["pBind"] }, { kind: "directive", type: i0.forwardRef(() => i3.MotionDirective), selector: "[pMotion]", inputs: ["pMotion", "pMotionName", "pMotionType", "pMotionSafe", "pMotionDisabled", "pMotionAppear", "pMotionEnter", "pMotionLeave", "pMotionDuration", "pMotionHideStrategy", "pMotionEnterFromClass", "pMotionEnterToClass", "pMotionEnterActiveClass", "pMotionLeaveFromClass", "pMotionLeaveToClass", "pMotionLeaveActiveClass", "pMotionOptions"], outputs: ["pMotionOnBeforeEnter", "pMotionOnEnter", "pMotionOnAfterEnter", "pMotionOnEnterCancelled", "pMotionOnBeforeLeave", "pMotionOnLeave", "pMotionOnAfterLeave", "pMotionOnLeaveCancelled"] }, { kind: "component", type: i0.forwardRef(() => GalleriaContent), selector: "div[pGalleriaContent]", inputs: ["activeIndex", "value", "numVisible"], outputs: ["maskHide", "activeItemChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
674
633
|
}
|
|
675
634
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: Galleria, decorators: [{
|
|
676
635
|
type: Component,
|
|
@@ -678,43 +637,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
678
637
|
selector: 'p-galleria',
|
|
679
638
|
standalone: false,
|
|
680
639
|
template: `
|
|
681
|
-
@if (fullScreen) {
|
|
640
|
+
@if (fullScreen()) {
|
|
682
641
|
<div #container>
|
|
683
642
|
@if (renderMask()) {
|
|
684
643
|
<div
|
|
685
644
|
[pBind]="ptm('mask')"
|
|
686
|
-
[pMotion]="maskVisible"
|
|
645
|
+
[pMotion]="maskVisible()"
|
|
687
646
|
[pMotionAppear]="true"
|
|
688
|
-
[pMotionEnterActiveClass]="fullScreen ? 'p-overlay-mask-enter-active' : ''"
|
|
689
|
-
[pMotionLeaveActiveClass]="fullScreen ? 'p-overlay-mask-leave-active' : ''"
|
|
647
|
+
[pMotionEnterActiveClass]="fullScreen() ? 'p-overlay-mask-enter-active' : ''"
|
|
648
|
+
[pMotionLeaveActiveClass]="fullScreen() ? 'p-overlay-mask-leave-active' : ''"
|
|
690
649
|
[pMotionOptions]="computedMaskMotionOptions()"
|
|
691
650
|
(pMotionOnAfterLeave)="onMaskAfterLeave()"
|
|
692
651
|
[ngClass]="cx('mask')"
|
|
693
|
-
[class]="maskClass"
|
|
694
|
-
[attr.role]="fullScreen ? 'dialog' : 'region'"
|
|
695
|
-
[attr.aria-modal]="fullScreen ? 'true' : undefined"
|
|
652
|
+
[class]="maskClass()"
|
|
653
|
+
[attr.role]="fullScreen() ? 'dialog' : 'region'"
|
|
654
|
+
[attr.aria-modal]="fullScreen() ? 'true' : undefined"
|
|
696
655
|
(click)="onMaskHide($event)"
|
|
697
656
|
>
|
|
698
657
|
@if (renderContent()) {
|
|
699
658
|
<div
|
|
700
659
|
pGalleriaContent
|
|
701
|
-
[pMotion]="visible"
|
|
660
|
+
[pMotion]="visible()"
|
|
702
661
|
[pMotionAppear]="true"
|
|
703
662
|
[pMotionName]="'p-galleria'"
|
|
704
663
|
[pMotionOptions]="computedMotionOptions()"
|
|
705
664
|
(pMotionOnBeforeEnter)="onBeforeEnter($event)"
|
|
706
665
|
(pMotionOnBeforeLeave)="onBeforeLeave()"
|
|
707
666
|
(pMotionOnAfterLeave)="onAfterLeave()"
|
|
708
|
-
[value]="value"
|
|
709
|
-
[activeIndex]="activeIndex"
|
|
710
|
-
[numVisible]="numVisibleLimit || numVisible"
|
|
667
|
+
[value]="value()"
|
|
668
|
+
[activeIndex]="activeIndex()"
|
|
669
|
+
[numVisible]="numVisibleLimit() || numVisible()"
|
|
711
670
|
(maskHide)="onMaskHide()"
|
|
712
671
|
(activeItemChange)="onActiveItemChange($event)"
|
|
713
|
-
[ngStyle]="containerStyle"
|
|
714
|
-
[fullScreen]="fullScreen"
|
|
672
|
+
[ngStyle]="containerStyle()"
|
|
715
673
|
[pt]="pt()"
|
|
716
674
|
pFocusTrap
|
|
717
|
-
[pFocusTrapDisabled]="!fullScreen"
|
|
675
|
+
[pFocusTrapDisabled]="!fullScreen()"
|
|
718
676
|
[unstyled]="unstyled()"
|
|
719
677
|
></div>
|
|
720
678
|
}
|
|
@@ -722,7 +680,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
722
680
|
}
|
|
723
681
|
</div>
|
|
724
682
|
} @else {
|
|
725
|
-
<div pGalleriaContent [pt]="pt()" [unstyled]="unstyled()" [value]="value" [activeIndex]="activeIndex" [numVisible]="numVisibleLimit || numVisible" (activeItemChange)="onActiveItemChange($event)"></div>
|
|
683
|
+
<div pGalleriaContent [pt]="pt()" [unstyled]="unstyled()" [value]="value()" [activeIndex]="activeIndex()" [numVisible]="numVisibleLimit() || numVisible()" (activeItemChange)="onActiveItemChange($event)"></div>
|
|
726
684
|
}
|
|
727
685
|
`,
|
|
728
686
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -730,163 +688,75 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
730
688
|
providers: [GalleriaStyle, { provide: GALLERIA_INSTANCE, useExisting: Galleria }, { provide: PARENT_INSTANCE, useExisting: Galleria }],
|
|
731
689
|
hostDirectives: [Bind]
|
|
732
690
|
}]
|
|
733
|
-
}], propDecorators: { activeIndex: [{
|
|
734
|
-
type: Input
|
|
735
|
-
}], fullScreen: [{
|
|
736
|
-
type: Input,
|
|
737
|
-
args: [{ transform: booleanAttribute }]
|
|
738
|
-
}], id: [{
|
|
739
|
-
type: Input
|
|
740
|
-
}], value: [{
|
|
741
|
-
type: Input
|
|
742
|
-
}], numVisible: [{
|
|
743
|
-
type: Input,
|
|
744
|
-
args: [{ transform: numberAttribute }]
|
|
745
|
-
}], responsiveOptions: [{
|
|
746
|
-
type: Input
|
|
747
|
-
}], showItemNavigators: [{
|
|
748
|
-
type: Input,
|
|
749
|
-
args: [{ transform: booleanAttribute }]
|
|
750
|
-
}], showThumbnailNavigators: [{
|
|
751
|
-
type: Input,
|
|
752
|
-
args: [{ transform: booleanAttribute }]
|
|
753
|
-
}], showItemNavigatorsOnHover: [{
|
|
754
|
-
type: Input,
|
|
755
|
-
args: [{ transform: booleanAttribute }]
|
|
756
|
-
}], changeItemOnIndicatorHover: [{
|
|
757
|
-
type: Input,
|
|
758
|
-
args: [{ transform: booleanAttribute }]
|
|
759
|
-
}], circular: [{
|
|
760
|
-
type: Input,
|
|
761
|
-
args: [{ transform: booleanAttribute }]
|
|
762
|
-
}], autoPlay: [{
|
|
763
|
-
type: Input,
|
|
764
|
-
args: [{ transform: booleanAttribute }]
|
|
765
|
-
}], shouldStopAutoplayByClick: [{
|
|
766
|
-
type: Input,
|
|
767
|
-
args: [{ transform: booleanAttribute }]
|
|
768
|
-
}], transitionInterval: [{
|
|
769
|
-
type: Input,
|
|
770
|
-
args: [{ transform: numberAttribute }]
|
|
771
|
-
}], showThumbnails: [{
|
|
772
|
-
type: Input,
|
|
773
|
-
args: [{ transform: booleanAttribute }]
|
|
774
|
-
}], thumbnailsPosition: [{
|
|
775
|
-
type: Input
|
|
776
|
-
}], verticalThumbnailViewPortHeight: [{
|
|
777
|
-
type: Input
|
|
778
|
-
}], showIndicators: [{
|
|
779
|
-
type: Input,
|
|
780
|
-
args: [{ transform: booleanAttribute }]
|
|
781
|
-
}], showIndicatorsOnItem: [{
|
|
782
|
-
type: Input,
|
|
783
|
-
args: [{ transform: booleanAttribute }]
|
|
784
|
-
}], indicatorsPosition: [{
|
|
785
|
-
type: Input
|
|
786
|
-
}], baseZIndex: [{
|
|
787
|
-
type: Input,
|
|
788
|
-
args: [{ transform: numberAttribute }]
|
|
789
|
-
}], maskClass: [{
|
|
790
|
-
type: Input
|
|
791
|
-
}], containerClass: [{
|
|
792
|
-
type: Input
|
|
793
|
-
}], containerStyle: [{
|
|
794
|
-
type: Input
|
|
795
|
-
}], showTransitionOptions: [{
|
|
796
|
-
type: Input
|
|
797
|
-
}], hideTransitionOptions: [{
|
|
798
|
-
type: Input
|
|
799
|
-
}], motionOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionOptions", required: false }] }], maskMotionOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "maskMotionOptions", required: false }] }], visible: [{
|
|
800
|
-
type: Input
|
|
801
|
-
}], activeIndexChange: [{ type: i0.Output, args: ["activeIndexChange"] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }], container: [{ type: i0.ViewChild, args: ['container', { isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: ['header', { ...{ descendants: false }, isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: ['footer', { ...{ descendants: false }, isSignal: true }] }], indicatorTemplate: [{ type: i0.ContentChild, args: ['indicator', { ...{ descendants: false }, isSignal: true }] }], captionTemplate: [{ type: i0.ContentChild, args: ['caption', { ...{ descendants: false }, isSignal: true }] }], _closeIconTemplate: [{ type: i0.ContentChild, args: ['closeicon', { ...{ descendants: false }, isSignal: true }] }], _previousThumbnailIconTemplate: [{ type: i0.ContentChild, args: ['previousthumbnailicon', { ...{ descendants: false }, isSignal: true }] }], _nextThumbnailIconTemplate: [{ type: i0.ContentChild, args: ['nextthumbnailicon', { ...{ descendants: false }, isSignal: true }] }], _itemPreviousIconTemplate: [{ type: i0.ContentChild, args: ['itempreviousicon', { ...{ descendants: false }, isSignal: true }] }], _itemNextIconTemplate: [{ type: i0.ContentChild, args: ['itemnexticon', { ...{ descendants: false }, isSignal: true }] }], _itemTemplate: [{ type: i0.ContentChild, args: ['item', { ...{ descendants: false }, isSignal: true }] }], _thumbnailTemplate: [{ type: i0.ContentChild, args: ['thumbnail', { ...{ descendants: false }, isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }] } });
|
|
691
|
+
}], ctorParameters: () => [], propDecorators: { activeIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIndex", required: false }] }, { type: i0.Output, args: ["activeIndexChange"] }], fullScreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullScreen", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], numVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "numVisible", required: false }] }], responsiveOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsiveOptions", required: false }] }], showItemNavigators: [{ type: i0.Input, args: [{ isSignal: true, alias: "showItemNavigators", required: false }] }], showThumbnailNavigators: [{ type: i0.Input, args: [{ isSignal: true, alias: "showThumbnailNavigators", required: false }] }], showItemNavigatorsOnHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "showItemNavigatorsOnHover", required: false }] }], changeItemOnIndicatorHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "changeItemOnIndicatorHover", required: false }] }], circular: [{ type: i0.Input, args: [{ isSignal: true, alias: "circular", required: false }] }], autoPlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoPlay", required: false }] }], shouldStopAutoplayByClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "shouldStopAutoplayByClick", required: false }] }], transitionInterval: [{ type: i0.Input, args: [{ isSignal: true, alias: "transitionInterval", required: false }] }], showThumbnails: [{ type: i0.Input, args: [{ isSignal: true, alias: "showThumbnails", required: false }] }], thumbnailsPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "thumbnailsPosition", required: false }] }], verticalThumbnailViewPortHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "verticalThumbnailViewPortHeight", required: false }] }], showIndicators: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIndicators", required: false }] }], showIndicatorsOnItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIndicatorsOnItem", required: false }] }], indicatorsPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "indicatorsPosition", required: false }] }], baseZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseZIndex", required: false }] }], maskClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "maskClass", required: false }] }], containerStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "containerStyle", required: false }] }], motionOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionOptions", required: false }] }], maskMotionOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "maskMotionOptions", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], container: [{ type: i0.ViewChild, args: ['container', { isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: ['header', { ...{ descendants: false }, isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: ['footer', { ...{ descendants: false }, isSignal: true }] }], indicatorTemplate: [{ type: i0.ContentChild, args: ['indicator', { ...{ descendants: false }, isSignal: true }] }], captionTemplate: [{ type: i0.ContentChild, args: ['caption', { ...{ descendants: false }, isSignal: true }] }], _closeIconTemplate: [{ type: i0.ContentChild, args: ['closeicon', { ...{ descendants: false }, isSignal: true }] }], _previousThumbnailIconTemplate: [{ type: i0.ContentChild, args: ['previousthumbnailicon', { ...{ descendants: false }, isSignal: true }] }], _nextThumbnailIconTemplate: [{ type: i0.ContentChild, args: ['nextthumbnailicon', { ...{ descendants: false }, isSignal: true }] }], _itemPreviousIconTemplate: [{ type: i0.ContentChild, args: ['itempreviousicon', { ...{ descendants: false }, isSignal: true }] }], _itemNextIconTemplate: [{ type: i0.ContentChild, args: ['itemnexticon', { ...{ descendants: false }, isSignal: true }] }], _itemTemplate: [{ type: i0.ContentChild, args: ['item', { ...{ descendants: false }, isSignal: true }] }], _thumbnailTemplate: [{ type: i0.ContentChild, args: ['thumbnail', { ...{ descendants: false }, isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }] } });
|
|
802
692
|
class GalleriaContent extends BaseComponent {
|
|
803
693
|
galleria = inject(Galleria);
|
|
804
|
-
differs = inject(KeyValueDiffers);
|
|
805
694
|
hostName = 'Galleria';
|
|
806
695
|
bindDirectiveInstance = inject(Bind, { self: true });
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
get activeIndex() {
|
|
811
|
-
return this._activeIndex;
|
|
812
|
-
}
|
|
813
|
-
set activeIndex(activeIndex) {
|
|
814
|
-
this._activeIndex = activeIndex;
|
|
696
|
+
constructor() {
|
|
697
|
+
super();
|
|
698
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.getPTOptions('root')));
|
|
815
699
|
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
700
|
+
activeIndex = input(0, /* @ts-ignore */
|
|
701
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
702
|
+
value = input([], /* @ts-ignore */
|
|
703
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
704
|
+
numVisible = input(undefined, { ...(ngDevMode ? { debugName: "numVisible" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
819
705
|
maskHide = output();
|
|
820
706
|
activeItemChange = output();
|
|
821
707
|
_componentStyle = inject(GalleriaStyle);
|
|
822
708
|
$pcGalleria = inject(GALLERIA_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;
|
|
823
|
-
id;
|
|
824
|
-
_activeIndex =
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
this.id = this.galleria.id || uuid('pn_id_');
|
|
832
|
-
this.differ = this.differs.find(this.galleria).create();
|
|
833
|
-
}
|
|
834
|
-
// For custom fullscreen
|
|
835
|
-
handleFullscreenChange(event) {
|
|
836
|
-
if (document?.fullscreenElement === this.el.nativeElement?.children[0]) {
|
|
837
|
-
this.fullScreen = true;
|
|
838
|
-
}
|
|
839
|
-
else {
|
|
840
|
-
this.fullScreen = false;
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
onDoCheck() {
|
|
844
|
-
if (isPlatformBrowser(this.galleria.platformId)) {
|
|
845
|
-
const changes = this.differ.diff(this.galleria);
|
|
846
|
-
if (changes && changes.forEachItem.length > 0) {
|
|
847
|
-
// Because we change the properties of the parent component,
|
|
848
|
-
// and the children take our entity from the injector.
|
|
849
|
-
// We can tell the children to redraw themselves when we change the properties of the parent component.
|
|
850
|
-
// Since we have an onPush strategy
|
|
851
|
-
this.cd.markForCheck();
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
shouldRenderFooter() {
|
|
709
|
+
id = this.galleria.id() || uuid('pn_id_');
|
|
710
|
+
_activeIndex = linkedSignal(() => this.activeIndex(), /* @ts-ignore */
|
|
711
|
+
...(ngDevMode ? [{ debugName: "_activeIndex" }] : /* istanbul ignore next */ []));
|
|
712
|
+
slideShowActive = signal(true, /* @ts-ignore */
|
|
713
|
+
...(ngDevMode ? [{ debugName: "slideShowActive" }] : /* istanbul ignore next */ []));
|
|
714
|
+
interval = signal(undefined, /* @ts-ignore */
|
|
715
|
+
...(ngDevMode ? [{ debugName: "interval" }] : /* istanbul ignore next */ []));
|
|
716
|
+
shouldRenderFooter = computed(() => {
|
|
856
717
|
const templates = this.galleria.templates();
|
|
857
|
-
return (this.galleria.footerFacet && templates && templates.length > 0) || this.galleria.footerTemplate();
|
|
858
|
-
}
|
|
718
|
+
return (this.galleria.footerFacet() && templates && templates.length > 0) || this.galleria.footerTemplate();
|
|
719
|
+
}, /* @ts-ignore */
|
|
720
|
+
...(ngDevMode ? [{ debugName: "shouldRenderFooter" }] : /* istanbul ignore next */ []));
|
|
859
721
|
startSlideShow() {
|
|
860
722
|
if (isPlatformBrowser(this.galleria.platformId)) {
|
|
861
|
-
this.
|
|
862
|
-
|
|
723
|
+
this.clearSlideShowInterval();
|
|
724
|
+
this.interval.set(setInterval(() => {
|
|
725
|
+
let activeIndex = this.galleria.circular() && this.value().length - 1 === this._activeIndex() ? 0 : this._activeIndex() + 1;
|
|
863
726
|
this.onActiveIndexChange(activeIndex);
|
|
864
|
-
this.activeIndex
|
|
865
|
-
}, this.galleria.transitionInterval);
|
|
866
|
-
this.slideShowActive
|
|
727
|
+
this._activeIndex.set(activeIndex);
|
|
728
|
+
}, this.galleria.transitionInterval()));
|
|
729
|
+
this.slideShowActive.set(true);
|
|
867
730
|
}
|
|
868
731
|
}
|
|
869
732
|
stopSlideShow() {
|
|
870
|
-
if (this.galleria.autoPlay && !this.galleria.shouldStopAutoplayByClick) {
|
|
733
|
+
if (this.galleria.autoPlay() && !this.galleria.shouldStopAutoplayByClick()) {
|
|
871
734
|
return;
|
|
872
735
|
}
|
|
873
|
-
|
|
874
|
-
|
|
736
|
+
this.clearSlideShowInterval();
|
|
737
|
+
this.slideShowActive.set(false);
|
|
738
|
+
}
|
|
739
|
+
clearSlideShowInterval() {
|
|
740
|
+
const interval = this.interval();
|
|
741
|
+
if (interval) {
|
|
742
|
+
clearInterval(interval);
|
|
743
|
+
this.interval.set(undefined);
|
|
875
744
|
}
|
|
876
|
-
|
|
745
|
+
}
|
|
746
|
+
onDestroy() {
|
|
747
|
+
this.clearSlideShowInterval();
|
|
877
748
|
}
|
|
878
749
|
getPositionClass(preClassName, position) {
|
|
879
750
|
const positions = ['top', 'left', 'bottom', 'right'];
|
|
880
751
|
const pos = positions.find((item) => item === position);
|
|
881
752
|
return pos ? `${preClassName}-${pos}` : '';
|
|
882
753
|
}
|
|
883
|
-
isVertical()
|
|
884
|
-
|
|
885
|
-
}
|
|
754
|
+
isVertical = computed(() => this.galleria.thumbnailsPosition() === 'left' || this.galleria.thumbnailsPosition() === 'right', /* @ts-ignore */
|
|
755
|
+
...(ngDevMode ? [{ debugName: "isVertical" }] : /* istanbul ignore next */ []));
|
|
886
756
|
onActiveIndexChange(index) {
|
|
887
|
-
if (this.
|
|
888
|
-
this.
|
|
889
|
-
this.activeItemChange.emit(this.
|
|
757
|
+
if (this._activeIndex() !== index) {
|
|
758
|
+
this._activeIndex.set(index);
|
|
759
|
+
this.activeItemChange.emit(this._activeIndex());
|
|
890
760
|
}
|
|
891
761
|
}
|
|
892
762
|
closeAriaLabel() {
|
|
@@ -901,56 +771,56 @@ class GalleriaContent extends BaseComponent {
|
|
|
901
771
|
});
|
|
902
772
|
}
|
|
903
773
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GalleriaContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
904
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: GalleriaContent, isStandalone: false, selector: "div[pGalleriaContent]", inputs: { activeIndex: "activeIndex",
|
|
905
|
-
@if (value && value.length > 0) {
|
|
906
|
-
@if (galleria.fullScreen) {
|
|
774
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: GalleriaContent, isStandalone: false, selector: "div[pGalleriaContent]", inputs: { activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, numVisible: { classPropertyName: "numVisible", publicName: "numVisible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { maskHide: "maskHide", activeItemChange: "activeItemChange" }, host: { properties: { "attr.id": "id", "attr.role": "\"region\"", "style": "!galleria.fullScreen() ? galleria.containerStyle() : {}", "class": "cn(cx('root'))" } }, providers: [GalleriaStyle], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0, template: `
|
|
775
|
+
@if (value() && value().length > 0) {
|
|
776
|
+
@if (galleria.fullScreen()) {
|
|
907
777
|
<button type="button" [pBind]="getPTOptions('closeButton')" [class]="cx('closeButton')" (click)="maskHide.emit()" [attr.aria-label]="closeAriaLabel()">
|
|
908
|
-
@if (!galleria.closeIconTemplate && !galleria._closeIconTemplate()) {
|
|
778
|
+
@if (!galleria.closeIconTemplate() && !galleria._closeIconTemplate()) {
|
|
909
779
|
<svg data-p-icon="times" [pBind]="getPTOptions('closeIcon')" [class]="cx('closeIcon')" />
|
|
910
780
|
}
|
|
911
|
-
<ng-template *ngTemplateOutlet="galleria.closeIconTemplate || galleria._closeIconTemplate()"></ng-template>
|
|
781
|
+
<ng-template *ngTemplateOutlet="galleria.closeIconTemplate() || galleria._closeIconTemplate()"></ng-template>
|
|
912
782
|
</button>
|
|
913
783
|
}
|
|
914
|
-
@if (galleria.templates() && (galleria.headerFacet || galleria.headerTemplate())) {
|
|
784
|
+
@if (galleria.templates() && (galleria.headerFacet() || galleria.headerTemplate())) {
|
|
915
785
|
<div pGalleriaItemSlot [unstyled]="unstyled()" type="header" [templates]="galleria.templates()" [pBind]="getPTOptions('header')" [class]="cx('header')"></div>
|
|
916
786
|
}
|
|
917
|
-
<div [pBind]="getPTOptions('content')" [class]="cx('content')" [attr.aria-live]="galleria.autoPlay ? 'polite' : 'off'">
|
|
787
|
+
<div [pBind]="getPTOptions('content')" [class]="cx('content')" [attr.aria-live]="galleria.autoPlay() ? 'polite' : 'off'">
|
|
918
788
|
<div
|
|
919
789
|
pGalleriaItem
|
|
920
790
|
[id]="id"
|
|
921
|
-
[value]="value"
|
|
922
|
-
[activeIndex]="
|
|
923
|
-
[circular]="galleria.circular"
|
|
791
|
+
[value]="value()"
|
|
792
|
+
[activeIndex]="_activeIndex()"
|
|
793
|
+
[circular]="galleria.circular()"
|
|
924
794
|
[templates]="galleria.templates()"
|
|
925
795
|
(onActiveIndexChange)="onActiveIndexChange($event)"
|
|
926
|
-
[showIndicators]="galleria.showIndicators"
|
|
927
|
-
[changeItemOnIndicatorHover]="galleria.changeItemOnIndicatorHover"
|
|
928
|
-
[indicatorFacet]="galleria.indicatorFacet"
|
|
929
|
-
[captionFacet]="galleria.captionFacet"
|
|
930
|
-
[showItemNavigators]="galleria.showItemNavigators"
|
|
931
|
-
[autoPlay]="galleria.autoPlay"
|
|
932
|
-
[slideShowActive]="slideShowActive"
|
|
796
|
+
[showIndicators]="galleria.showIndicators()"
|
|
797
|
+
[changeItemOnIndicatorHover]="galleria.changeItemOnIndicatorHover()"
|
|
798
|
+
[indicatorFacet]="galleria.indicatorFacet()"
|
|
799
|
+
[captionFacet]="galleria.captionFacet()"
|
|
800
|
+
[showItemNavigators]="galleria.showItemNavigators()"
|
|
801
|
+
[autoPlay]="galleria.autoPlay()"
|
|
802
|
+
[slideShowActive]="slideShowActive()"
|
|
933
803
|
(startSlideShow)="startSlideShow()"
|
|
934
804
|
(stopSlideShow)="stopSlideShow()"
|
|
935
805
|
[pt]="pt()"
|
|
936
806
|
[unstyled]="unstyled()"
|
|
937
807
|
[class]="cx('itemsContainer')"
|
|
938
808
|
></div>
|
|
939
|
-
@if (galleria.showThumbnails) {
|
|
809
|
+
@if (galleria.showThumbnails()) {
|
|
940
810
|
<div
|
|
941
811
|
pGalleriaThumbnails
|
|
942
812
|
[containerId]="id"
|
|
943
|
-
[value]="value"
|
|
813
|
+
[value]="value()"
|
|
944
814
|
(onActiveIndexChange)="onActiveIndexChange($event)"
|
|
945
|
-
[activeIndex]="
|
|
815
|
+
[activeIndex]="_activeIndex()"
|
|
946
816
|
[templates]="galleria.templates()"
|
|
947
|
-
[numVisible]="numVisible"
|
|
948
|
-
[responsiveOptions]="galleria.responsiveOptions"
|
|
949
|
-
[circular]="galleria.circular"
|
|
817
|
+
[numVisible]="numVisible()"
|
|
818
|
+
[responsiveOptions]="galleria.responsiveOptions()"
|
|
819
|
+
[circular]="galleria.circular()"
|
|
950
820
|
[isVertical]="isVertical()"
|
|
951
|
-
[contentHeight]="galleria.verticalThumbnailViewPortHeight"
|
|
952
|
-
[showThumbnailNavigators]="galleria.showThumbnailNavigators"
|
|
953
|
-
[slideShowActive]="slideShowActive"
|
|
821
|
+
[contentHeight]="galleria.verticalThumbnailViewPortHeight()"
|
|
822
|
+
[showThumbnailNavigators]="galleria.showThumbnailNavigators()"
|
|
823
|
+
[slideShowActive]="slideShowActive()"
|
|
954
824
|
(stopSlideShow)="stopSlideShow()"
|
|
955
825
|
[pt]="pt()"
|
|
956
826
|
[unstyled]="unstyled()"
|
|
@@ -969,55 +839,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
969
839
|
selector: 'div[pGalleriaContent]',
|
|
970
840
|
standalone: false,
|
|
971
841
|
template: `
|
|
972
|
-
@if (value && value.length > 0) {
|
|
973
|
-
@if (galleria.fullScreen) {
|
|
842
|
+
@if (value() && value().length > 0) {
|
|
843
|
+
@if (galleria.fullScreen()) {
|
|
974
844
|
<button type="button" [pBind]="getPTOptions('closeButton')" [class]="cx('closeButton')" (click)="maskHide.emit()" [attr.aria-label]="closeAriaLabel()">
|
|
975
|
-
@if (!galleria.closeIconTemplate && !galleria._closeIconTemplate()) {
|
|
845
|
+
@if (!galleria.closeIconTemplate() && !galleria._closeIconTemplate()) {
|
|
976
846
|
<svg data-p-icon="times" [pBind]="getPTOptions('closeIcon')" [class]="cx('closeIcon')" />
|
|
977
847
|
}
|
|
978
|
-
<ng-template *ngTemplateOutlet="galleria.closeIconTemplate || galleria._closeIconTemplate()"></ng-template>
|
|
848
|
+
<ng-template *ngTemplateOutlet="galleria.closeIconTemplate() || galleria._closeIconTemplate()"></ng-template>
|
|
979
849
|
</button>
|
|
980
850
|
}
|
|
981
|
-
@if (galleria.templates() && (galleria.headerFacet || galleria.headerTemplate())) {
|
|
851
|
+
@if (galleria.templates() && (galleria.headerFacet() || galleria.headerTemplate())) {
|
|
982
852
|
<div pGalleriaItemSlot [unstyled]="unstyled()" type="header" [templates]="galleria.templates()" [pBind]="getPTOptions('header')" [class]="cx('header')"></div>
|
|
983
853
|
}
|
|
984
|
-
<div [pBind]="getPTOptions('content')" [class]="cx('content')" [attr.aria-live]="galleria.autoPlay ? 'polite' : 'off'">
|
|
854
|
+
<div [pBind]="getPTOptions('content')" [class]="cx('content')" [attr.aria-live]="galleria.autoPlay() ? 'polite' : 'off'">
|
|
985
855
|
<div
|
|
986
856
|
pGalleriaItem
|
|
987
857
|
[id]="id"
|
|
988
|
-
[value]="value"
|
|
989
|
-
[activeIndex]="
|
|
990
|
-
[circular]="galleria.circular"
|
|
858
|
+
[value]="value()"
|
|
859
|
+
[activeIndex]="_activeIndex()"
|
|
860
|
+
[circular]="galleria.circular()"
|
|
991
861
|
[templates]="galleria.templates()"
|
|
992
862
|
(onActiveIndexChange)="onActiveIndexChange($event)"
|
|
993
|
-
[showIndicators]="galleria.showIndicators"
|
|
994
|
-
[changeItemOnIndicatorHover]="galleria.changeItemOnIndicatorHover"
|
|
995
|
-
[indicatorFacet]="galleria.indicatorFacet"
|
|
996
|
-
[captionFacet]="galleria.captionFacet"
|
|
997
|
-
[showItemNavigators]="galleria.showItemNavigators"
|
|
998
|
-
[autoPlay]="galleria.autoPlay"
|
|
999
|
-
[slideShowActive]="slideShowActive"
|
|
863
|
+
[showIndicators]="galleria.showIndicators()"
|
|
864
|
+
[changeItemOnIndicatorHover]="galleria.changeItemOnIndicatorHover()"
|
|
865
|
+
[indicatorFacet]="galleria.indicatorFacet()"
|
|
866
|
+
[captionFacet]="galleria.captionFacet()"
|
|
867
|
+
[showItemNavigators]="galleria.showItemNavigators()"
|
|
868
|
+
[autoPlay]="galleria.autoPlay()"
|
|
869
|
+
[slideShowActive]="slideShowActive()"
|
|
1000
870
|
(startSlideShow)="startSlideShow()"
|
|
1001
871
|
(stopSlideShow)="stopSlideShow()"
|
|
1002
872
|
[pt]="pt()"
|
|
1003
873
|
[unstyled]="unstyled()"
|
|
1004
874
|
[class]="cx('itemsContainer')"
|
|
1005
875
|
></div>
|
|
1006
|
-
@if (galleria.showThumbnails) {
|
|
876
|
+
@if (galleria.showThumbnails()) {
|
|
1007
877
|
<div
|
|
1008
878
|
pGalleriaThumbnails
|
|
1009
879
|
[containerId]="id"
|
|
1010
|
-
[value]="value"
|
|
880
|
+
[value]="value()"
|
|
1011
881
|
(onActiveIndexChange)="onActiveIndexChange($event)"
|
|
1012
|
-
[activeIndex]="
|
|
882
|
+
[activeIndex]="_activeIndex()"
|
|
1013
883
|
[templates]="galleria.templates()"
|
|
1014
|
-
[numVisible]="numVisible"
|
|
1015
|
-
[responsiveOptions]="galleria.responsiveOptions"
|
|
1016
|
-
[circular]="galleria.circular"
|
|
884
|
+
[numVisible]="numVisible()"
|
|
885
|
+
[responsiveOptions]="galleria.responsiveOptions()"
|
|
886
|
+
[circular]="galleria.circular()"
|
|
1017
887
|
[isVertical]="isVertical()"
|
|
1018
|
-
[contentHeight]="galleria.verticalThumbnailViewPortHeight"
|
|
1019
|
-
[showThumbnailNavigators]="galleria.showThumbnailNavigators"
|
|
1020
|
-
[slideShowActive]="slideShowActive"
|
|
888
|
+
[contentHeight]="galleria.verticalThumbnailViewPortHeight()"
|
|
889
|
+
[showThumbnailNavigators]="galleria.showThumbnailNavigators()"
|
|
890
|
+
[slideShowActive]="slideShowActive()"
|
|
1021
891
|
(stopSlideShow)="stopSlideShow()"
|
|
1022
892
|
[pt]="pt()"
|
|
1023
893
|
[unstyled]="unstyled()"
|
|
@@ -1034,139 +904,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
1034
904
|
host: {
|
|
1035
905
|
'[attr.id]': 'id',
|
|
1036
906
|
'[attr.role]': '"region"',
|
|
1037
|
-
'[style]': '!galleria.fullScreen ? galleria.containerStyle : {}',
|
|
907
|
+
'[style]': '!galleria.fullScreen() ? galleria.containerStyle() : {}',
|
|
1038
908
|
'[class]': "cn(cx('root'))"
|
|
1039
909
|
},
|
|
1040
910
|
hostDirectives: [Bind]
|
|
1041
911
|
}]
|
|
1042
|
-
}], ctorParameters: () => [], propDecorators: { activeIndex: [{
|
|
1043
|
-
type: Input
|
|
1044
|
-
}], value: [{
|
|
1045
|
-
type: Input
|
|
1046
|
-
}], numVisible: [{
|
|
1047
|
-
type: Input,
|
|
1048
|
-
args: [{ transform: numberAttribute }]
|
|
1049
|
-
}], fullScreen: [{
|
|
1050
|
-
type: Input,
|
|
1051
|
-
args: [{ transform: booleanAttribute }]
|
|
1052
|
-
}], maskHide: [{ type: i0.Output, args: ["maskHide"] }], activeItemChange: [{ type: i0.Output, args: ["activeItemChange"] }], handleFullscreenChange: [{
|
|
1053
|
-
type: HostListener,
|
|
1054
|
-
args: ['document:fullscreenchange', ['$event']]
|
|
1055
|
-
}] } });
|
|
912
|
+
}], ctorParameters: () => [], propDecorators: { activeIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIndex", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], numVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "numVisible", required: false }] }], maskHide: [{ type: i0.Output, args: ["maskHide"] }], activeItemChange: [{ type: i0.Output, args: ["activeItemChange"] }] } });
|
|
1056
913
|
class GalleriaItemSlot extends BaseComponent {
|
|
1057
914
|
hostName = 'Galleria';
|
|
1058
|
-
templates
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
}
|
|
1063
|
-
shouldRender()
|
|
1064
|
-
|
|
1065
|
-
return (this.contentTemplate ||
|
|
1066
|
-
this.galleria._itemTemplate() ||
|
|
1067
|
-
this.galleria.itemTemplate ||
|
|
1068
|
-
captionTemplate ||
|
|
1069
|
-
captionTemplate ||
|
|
1070
|
-
this.galleria.captionFacet ||
|
|
1071
|
-
this.galleria.thumbnailTemplate ||
|
|
1072
|
-
this.galleria._thumbnailTemplate() ||
|
|
1073
|
-
this.galleria.footerTemplate());
|
|
1074
|
-
}
|
|
915
|
+
templates = input(/* @ts-ignore */
|
|
916
|
+
...(ngDevMode ? [undefined, { debugName: "templates" }] : /* istanbul ignore next */ []));
|
|
917
|
+
index = input(undefined, { ...(ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
918
|
+
item = input(/* @ts-ignore */
|
|
919
|
+
...(ngDevMode ? [undefined, { debugName: "item" }] : /* istanbul ignore next */ []));
|
|
920
|
+
shouldRender = computed(() => !!this.contentTemplate(), /* @ts-ignore */
|
|
921
|
+
...(ngDevMode ? [{ debugName: "shouldRender" }] : /* istanbul ignore next */ []));
|
|
1075
922
|
galleria = inject(Galleria);
|
|
1076
923
|
$pcGalleria = inject(GALLERIA_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
break;
|
|
1089
|
-
case 'footer':
|
|
1090
|
-
this.context = { $implicit: this.item };
|
|
1091
|
-
this.contentTemplate = item.template;
|
|
1092
|
-
break;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
});
|
|
1096
|
-
}
|
|
1097
|
-
else {
|
|
1098
|
-
this.getContentTemplate();
|
|
924
|
+
type = input(/* @ts-ignore */
|
|
925
|
+
...(ngDevMode ? [undefined, { debugName: "type" }] : /* istanbul ignore next */ []));
|
|
926
|
+
/**
|
|
927
|
+
* The template of the slot type: the last pTemplate of that type wins, then the #ref template of the same type.
|
|
928
|
+
* A slot without a type is the main item slot.
|
|
929
|
+
*/
|
|
930
|
+
contentTemplate = computed(() => {
|
|
931
|
+
const type = this.type() || 'item';
|
|
932
|
+
const pTemplate = (this.templates() ?? this.galleria.templates())?.filter((item) => item.getType() === type).at(-1)?.template;
|
|
933
|
+
if (pTemplate) {
|
|
934
|
+
return pTemplate;
|
|
1099
935
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
switch (this.type) {
|
|
936
|
+
switch (type) {
|
|
937
|
+
case 'header':
|
|
938
|
+
return this.galleria.headerTemplate();
|
|
939
|
+
case 'footer':
|
|
940
|
+
return this.galleria.footerTemplate();
|
|
1106
941
|
case 'item':
|
|
1107
|
-
|
|
1108
|
-
this.contentTemplate = this.galleria._itemTemplate() || this.getTemplateFromQueryList('item');
|
|
1109
|
-
break;
|
|
942
|
+
return this.galleria._itemTemplate();
|
|
1110
943
|
case 'caption':
|
|
1111
|
-
|
|
1112
|
-
this.contentTemplate = this.galleria.captionTemplate() || this.getTemplateFromQueryList('caption');
|
|
1113
|
-
break;
|
|
944
|
+
return this.galleria.captionTemplate();
|
|
1114
945
|
case 'thumbnail':
|
|
1115
|
-
|
|
1116
|
-
this.contentTemplate = this.galleria._thumbnailTemplate() || this.getTemplateFromQueryList('thumbnail');
|
|
1117
|
-
break;
|
|
946
|
+
return this.galleria._thumbnailTemplate();
|
|
1118
947
|
case 'indicator':
|
|
1119
|
-
|
|
1120
|
-
this.contentTemplate = this.galleria.indicatorTemplate() || this.getTemplateFromQueryList('indicator');
|
|
1121
|
-
break;
|
|
1122
|
-
case 'footer':
|
|
1123
|
-
this.context = { $implicit: this.item };
|
|
1124
|
-
this.contentTemplate = this.galleria.footerTemplate() || this.getTemplateFromQueryList('footer');
|
|
1125
|
-
break;
|
|
948
|
+
return this.galleria.indicatorTemplate();
|
|
1126
949
|
default:
|
|
1127
|
-
|
|
1128
|
-
this.contentTemplate = this.galleria._itemTemplate() || this.getTemplateFromQueryList('item');
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
type;
|
|
1132
|
-
contentTemplate;
|
|
1133
|
-
context;
|
|
1134
|
-
_item;
|
|
1135
|
-
onAfterContentInit() {
|
|
1136
|
-
if (this.templates && this.templates.length > 0) {
|
|
1137
|
-
this.templates?.forEach((item) => {
|
|
1138
|
-
if (item.getType() === this.type) {
|
|
1139
|
-
switch (this.type) {
|
|
1140
|
-
case 'item':
|
|
1141
|
-
case 'caption':
|
|
1142
|
-
case 'thumbnail':
|
|
1143
|
-
this.context = { $implicit: this.item };
|
|
1144
|
-
this.contentTemplate = item.template;
|
|
1145
|
-
break;
|
|
1146
|
-
case 'indicator':
|
|
1147
|
-
this.context = { $implicit: this.index };
|
|
1148
|
-
this.contentTemplate = item.template;
|
|
1149
|
-
break;
|
|
1150
|
-
case 'footer':
|
|
1151
|
-
this.context = { $implicit: this.item };
|
|
1152
|
-
this.contentTemplate = item.template;
|
|
1153
|
-
break;
|
|
1154
|
-
default:
|
|
1155
|
-
this.context = { $implicit: this.item };
|
|
1156
|
-
this.contentTemplate = item.template;
|
|
1157
|
-
break;
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
});
|
|
1161
|
-
}
|
|
1162
|
-
else {
|
|
1163
|
-
this.getContentTemplate();
|
|
950
|
+
return undefined;
|
|
1164
951
|
}
|
|
1165
|
-
}
|
|
952
|
+
}, /* @ts-ignore */
|
|
953
|
+
...(ngDevMode ? [{ debugName: "contentTemplate" }] : /* istanbul ignore next */ []));
|
|
954
|
+
context = computed(() => (this.type() === 'indicator' ? { $implicit: this.index() } : { $implicit: this.item() }), /* @ts-ignore */
|
|
955
|
+
...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
|
|
1166
956
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GalleriaItemSlot, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1167
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: GalleriaItemSlot, isStandalone: false, selector: "div[pGalleriaItemSlot]", inputs: { templates: "templates", index:
|
|
957
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: GalleriaItemSlot, isStandalone: false, selector: "div[pGalleriaItemSlot]", inputs: { templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
|
|
1168
958
|
@if (shouldRender()) {
|
|
1169
|
-
<ng-container *ngTemplateOutlet="contentTemplate; context: context"></ng-container>
|
|
959
|
+
<ng-container *ngTemplateOutlet="contentTemplate(); context: context()"></ng-container>
|
|
1170
960
|
}
|
|
1171
961
|
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1172
962
|
}
|
|
@@ -1177,96 +967,95 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
1177
967
|
standalone: false,
|
|
1178
968
|
template: `
|
|
1179
969
|
@if (shouldRender()) {
|
|
1180
|
-
<ng-container *ngTemplateOutlet="contentTemplate; context: context"></ng-container>
|
|
970
|
+
<ng-container *ngTemplateOutlet="contentTemplate(); context: context()"></ng-container>
|
|
1181
971
|
}
|
|
1182
972
|
`,
|
|
1183
973
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1184
974
|
}]
|
|
1185
|
-
}], propDecorators: { templates: [{
|
|
1186
|
-
type: Input
|
|
1187
|
-
}], index: [{
|
|
1188
|
-
type: Input,
|
|
1189
|
-
args: [{ transform: numberAttribute }]
|
|
1190
|
-
}], item: [{
|
|
1191
|
-
type: Input
|
|
1192
|
-
}], type: [{
|
|
1193
|
-
type: Input
|
|
1194
|
-
}] } });
|
|
975
|
+
}], propDecorators: { templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
1195
976
|
class GalleriaItem extends BaseComponent {
|
|
1196
977
|
galleria = inject(Galleria);
|
|
1197
978
|
hostName = 'Galleria';
|
|
1198
979
|
bindDirectiveInstance = inject(Bind, { self: true });
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
980
|
+
constructor() {
|
|
981
|
+
super();
|
|
982
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptm('itemsContainer')));
|
|
983
|
+
effect(() => {
|
|
984
|
+
const autoPlay = this.autoPlay();
|
|
985
|
+
untracked(() => {
|
|
986
|
+
if (autoPlay) {
|
|
987
|
+
this.startSlideShow.emit(undefined);
|
|
988
|
+
}
|
|
989
|
+
if (autoPlay === false) {
|
|
990
|
+
this.stopTheSlideShow();
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
id = input(/* @ts-ignore */
|
|
996
|
+
...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
|
|
997
|
+
circular = input(false, { ...(ngDevMode ? { debugName: "circular" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
998
|
+
value = input(/* @ts-ignore */
|
|
999
|
+
...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1000
|
+
showItemNavigators = input(false, { ...(ngDevMode ? { debugName: "showItemNavigators" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1001
|
+
showIndicators = input(true, { ...(ngDevMode ? { debugName: "showIndicators" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1002
|
+
slideShowActive = input(true, { ...(ngDevMode ? { debugName: "slideShowActive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1003
|
+
changeItemOnIndicatorHover = input(true, { ...(ngDevMode ? { debugName: "changeItemOnIndicatorHover" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1004
|
+
autoPlay = input(false, { ...(ngDevMode ? { debugName: "autoPlay" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1005
|
+
templates = input(/* @ts-ignore */
|
|
1006
|
+
...(ngDevMode ? [undefined, { debugName: "templates" }] : /* istanbul ignore next */ []));
|
|
1007
|
+
indicatorFacet = input(/* @ts-ignore */
|
|
1008
|
+
...(ngDevMode ? [undefined, { debugName: "indicatorFacet" }] : /* istanbul ignore next */ []));
|
|
1009
|
+
captionFacet = input(/* @ts-ignore */
|
|
1010
|
+
...(ngDevMode ? [undefined, { debugName: "captionFacet" }] : /* istanbul ignore next */ []));
|
|
1213
1011
|
startSlideShow = output();
|
|
1214
1012
|
stopSlideShow = output();
|
|
1215
1013
|
onActiveIndexChange = output();
|
|
1216
1014
|
_componentStyle = inject(GalleriaStyle);
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
this.
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
rightButtonFocused = false;
|
|
1015
|
+
activeIndex = input(0, /* @ts-ignore */
|
|
1016
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
1017
|
+
activeItem = computed(() => {
|
|
1018
|
+
const value = this.value();
|
|
1019
|
+
return value && value[this.activeIndex()];
|
|
1020
|
+
}, /* @ts-ignore */
|
|
1021
|
+
...(ngDevMode ? [{ debugName: "activeItem" }] : /* istanbul ignore next */ []));
|
|
1022
|
+
leftButtonFocused = signal(false, /* @ts-ignore */
|
|
1023
|
+
...(ngDevMode ? [{ debugName: "leftButtonFocused" }] : /* istanbul ignore next */ []));
|
|
1024
|
+
rightButtonFocused = signal(false, /* @ts-ignore */
|
|
1025
|
+
...(ngDevMode ? [{ debugName: "rightButtonFocused" }] : /* istanbul ignore next */ []));
|
|
1229
1026
|
getIndicatorPTOptions(index) {
|
|
1230
1027
|
return this.ptm('indicator', {
|
|
1231
1028
|
context: {
|
|
1232
|
-
highlighted: this.activeIndex === index
|
|
1029
|
+
highlighted: this.activeIndex() === index
|
|
1233
1030
|
}
|
|
1234
1031
|
});
|
|
1235
1032
|
}
|
|
1236
|
-
onChanges({ autoPlay }) {
|
|
1237
|
-
if (autoPlay?.currentValue) {
|
|
1238
|
-
this.startSlideShow.emit(undefined);
|
|
1239
|
-
}
|
|
1240
|
-
if (autoPlay && autoPlay.currentValue === false) {
|
|
1241
|
-
this.stopTheSlideShow();
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
1033
|
next() {
|
|
1245
|
-
let nextItemIndex = this.activeIndex + 1;
|
|
1246
|
-
let activeIndex = this.circular && this.value.length - 1 === this.activeIndex ? 0 : nextItemIndex;
|
|
1034
|
+
let nextItemIndex = this.activeIndex() + 1;
|
|
1035
|
+
let activeIndex = this.circular() && this.value().length - 1 === this.activeIndex() ? 0 : nextItemIndex;
|
|
1247
1036
|
this.onActiveIndexChange.emit(activeIndex);
|
|
1248
1037
|
}
|
|
1249
1038
|
prev() {
|
|
1250
|
-
let prevItemIndex = this.activeIndex !== 0 ? this.activeIndex - 1 : 0;
|
|
1251
|
-
let activeIndex = this.circular && this.activeIndex === 0 ? this.value.length - 1 : prevItemIndex;
|
|
1039
|
+
let prevItemIndex = this.activeIndex() !== 0 ? this.activeIndex() - 1 : 0;
|
|
1040
|
+
let activeIndex = this.circular() && this.activeIndex() === 0 ? this.value().length - 1 : prevItemIndex;
|
|
1252
1041
|
this.onActiveIndexChange.emit(activeIndex);
|
|
1253
1042
|
}
|
|
1254
1043
|
onButtonFocus(pos) {
|
|
1255
1044
|
if (pos === 'left') {
|
|
1256
|
-
this.leftButtonFocused
|
|
1045
|
+
this.leftButtonFocused.set(true);
|
|
1257
1046
|
}
|
|
1258
1047
|
else
|
|
1259
|
-
this.rightButtonFocused
|
|
1048
|
+
this.rightButtonFocused.set(true);
|
|
1260
1049
|
}
|
|
1261
1050
|
onButtonBlur(pos) {
|
|
1262
1051
|
if (pos === 'left') {
|
|
1263
|
-
this.leftButtonFocused
|
|
1052
|
+
this.leftButtonFocused.set(false);
|
|
1264
1053
|
}
|
|
1265
1054
|
else
|
|
1266
|
-
this.rightButtonFocused
|
|
1055
|
+
this.rightButtonFocused.set(false);
|
|
1267
1056
|
}
|
|
1268
1057
|
stopTheSlideShow() {
|
|
1269
|
-
if (this.slideShowActive && this.stopSlideShow) {
|
|
1058
|
+
if (this.slideShowActive() && this.stopSlideShow) {
|
|
1270
1059
|
this.stopSlideShow.emit(undefined);
|
|
1271
1060
|
}
|
|
1272
1061
|
}
|
|
@@ -1291,7 +1080,7 @@ class GalleriaItem extends BaseComponent {
|
|
|
1291
1080
|
this.onActiveIndexChange.emit(index);
|
|
1292
1081
|
}
|
|
1293
1082
|
onIndicatorMouseEnter(index) {
|
|
1294
|
-
if (this.changeItemOnIndicatorHover) {
|
|
1083
|
+
if (this.changeItemOnIndicatorHover()) {
|
|
1295
1084
|
this.stopTheSlideShow();
|
|
1296
1085
|
this.onActiveIndexChange.emit(index);
|
|
1297
1086
|
}
|
|
@@ -1312,14 +1101,12 @@ class GalleriaItem extends BaseComponent {
|
|
|
1312
1101
|
break;
|
|
1313
1102
|
}
|
|
1314
1103
|
}
|
|
1315
|
-
isNavForwardDisabled()
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
return !this.circular && this.activeIndex === 0;
|
|
1320
|
-
}
|
|
1104
|
+
isNavForwardDisabled = computed(() => !this.circular() && this.activeIndex() === this.value().length - 1, /* @ts-ignore */
|
|
1105
|
+
...(ngDevMode ? [{ debugName: "isNavForwardDisabled" }] : /* istanbul ignore next */ []));
|
|
1106
|
+
isNavBackwardDisabled = computed(() => !this.circular() && this.activeIndex() === 0, /* @ts-ignore */
|
|
1107
|
+
...(ngDevMode ? [{ debugName: "isNavBackwardDisabled" }] : /* istanbul ignore next */ []));
|
|
1321
1108
|
isIndicatorItemActive(index) {
|
|
1322
|
-
return this.activeIndex === index;
|
|
1109
|
+
return this.activeIndex() === index;
|
|
1323
1110
|
}
|
|
1324
1111
|
ariaSlideLabel() {
|
|
1325
1112
|
return this.galleria.config.translation.aria ? this.galleria.config.translation.aria.slide : undefined;
|
|
@@ -1330,45 +1117,46 @@ class GalleriaItem extends BaseComponent {
|
|
|
1330
1117
|
ariaPageLabel(value) {
|
|
1331
1118
|
return this.galleria.config.translation.aria ? this.galleria.config.translation.aria.pageLabel?.replace(/{page}/g, value) : undefined;
|
|
1332
1119
|
}
|
|
1333
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GalleriaItem, deps:
|
|
1334
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: GalleriaItem, isStandalone: false, selector: "div[pGalleriaItem]", inputs: { id: "id", circular:
|
|
1120
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GalleriaItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1121
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: GalleriaItem, isStandalone: false, selector: "div[pGalleriaItem]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, circular: { classPropertyName: "circular", publicName: "circular", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, showItemNavigators: { classPropertyName: "showItemNavigators", publicName: "showItemNavigators", isSignal: true, isRequired: false, transformFunction: null }, showIndicators: { classPropertyName: "showIndicators", publicName: "showIndicators", isSignal: true, isRequired: false, transformFunction: null }, slideShowActive: { classPropertyName: "slideShowActive", publicName: "slideShowActive", isSignal: true, isRequired: false, transformFunction: null }, changeItemOnIndicatorHover: { classPropertyName: "changeItemOnIndicatorHover", publicName: "changeItemOnIndicatorHover", isSignal: true, isRequired: false, transformFunction: null }, autoPlay: { classPropertyName: "autoPlay", publicName: "autoPlay", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null }, indicatorFacet: { classPropertyName: "indicatorFacet", publicName: "indicatorFacet", isSignal: true, isRequired: false, transformFunction: null }, captionFacet: { classPropertyName: "captionFacet", publicName: "captionFacet", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { startSlideShow: "startSlideShow", stopSlideShow: "stopSlideShow", onActiveIndexChange: "onActiveIndexChange" }, providers: [GalleriaStyle], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0, template: `
|
|
1335
1122
|
<div [pBind]="ptm('items')" [class]="cx('items')">
|
|
1336
|
-
@if (showItemNavigators) {
|
|
1123
|
+
@if (showItemNavigators()) {
|
|
1337
1124
|
<button type="button" role="navigation" [pBind]="ptm('prevButton')" [class]="cx('prevButton')" (click)="navBackward($event)" (focus)="onButtonFocus('left')" (blur)="onButtonBlur('left')" data-pc-group-section="itemnavigator">
|
|
1338
|
-
@if (!galleria.itemPreviousIconTemplate && !galleria._itemPreviousIconTemplate()) {
|
|
1125
|
+
@if (!galleria.itemPreviousIconTemplate() && !galleria._itemPreviousIconTemplate()) {
|
|
1339
1126
|
<svg data-p-icon="chevron-left" [pBind]="ptm('prevIcon')" [class]="cx('prevIcon')" />
|
|
1340
1127
|
}
|
|
1341
|
-
<ng-template *ngTemplateOutlet="galleria.itemPreviousIconTemplate || galleria._itemPreviousIconTemplate()"></ng-template>
|
|
1128
|
+
<ng-template *ngTemplateOutlet="galleria.itemPreviousIconTemplate() || galleria._itemPreviousIconTemplate()"></ng-template>
|
|
1342
1129
|
</button>
|
|
1343
1130
|
}
|
|
1344
1131
|
<div
|
|
1345
1132
|
pGalleriaItemSlot
|
|
1133
|
+
type="item"
|
|
1346
1134
|
[pBind]="ptm('item')"
|
|
1347
1135
|
[unstyled]="unstyled()"
|
|
1348
1136
|
[class]="cx('item')"
|
|
1349
|
-
[item]="activeItem"
|
|
1350
|
-
[templates]="templates"
|
|
1351
|
-
[id]="id + '_item_' + activeIndex"
|
|
1137
|
+
[item]="activeItem()"
|
|
1138
|
+
[templates]="templates()"
|
|
1139
|
+
[id]="id() + '_item_' + activeIndex()"
|
|
1352
1140
|
role="group"
|
|
1353
1141
|
[class]="cx('item')"
|
|
1354
|
-
[attr.aria-label]="ariaSlideNumber(activeIndex + 1)"
|
|
1142
|
+
[attr.aria-label]="ariaSlideNumber(activeIndex() + 1)"
|
|
1355
1143
|
[attr.aria-roledescription]="ariaSlideLabel()"
|
|
1356
1144
|
></div>
|
|
1357
|
-
@if (showItemNavigators) {
|
|
1145
|
+
@if (showItemNavigators()) {
|
|
1358
1146
|
<button type="button" [pBind]="ptm('nextButton')" [class]="cx('nextButton')" (click)="navForward($event)" role="navigation" (focus)="onButtonFocus('right')" (blur)="onButtonBlur('right')" data-pc-group-section="itemnavigator">
|
|
1359
|
-
@if (!galleria.itemNextIconTemplate && !galleria._itemNextIconTemplate()) {
|
|
1147
|
+
@if (!galleria.itemNextIconTemplate() && !galleria._itemNextIconTemplate()) {
|
|
1360
1148
|
<svg data-p-icon="chevron-right" [pBind]="ptm('nextIcon')" [class]="cx('nextIcon')" />
|
|
1361
1149
|
}
|
|
1362
|
-
<ng-template *ngTemplateOutlet="galleria.itemNextIconTemplate || galleria._itemNextIconTemplate()"></ng-template>
|
|
1150
|
+
<ng-template *ngTemplateOutlet="galleria.itemNextIconTemplate() || galleria._itemNextIconTemplate()"></ng-template>
|
|
1363
1151
|
</button>
|
|
1364
1152
|
}
|
|
1365
|
-
@if (captionFacet || galleria.captionTemplate()) {
|
|
1366
|
-
<div pGalleriaItemSlot [pBind]="ptm('caption')" [unstyled]="unstyled()" [class]="cx('caption')" type="caption" [item]="activeItem" [templates]="templates"></div>
|
|
1153
|
+
@if (captionFacet() || galleria.captionTemplate()) {
|
|
1154
|
+
<div pGalleriaItemSlot [pBind]="ptm('caption')" [unstyled]="unstyled()" [class]="cx('caption')" type="caption" [item]="activeItem()" [templates]="templates()"></div>
|
|
1367
1155
|
}
|
|
1368
1156
|
</div>
|
|
1369
|
-
@if (showIndicators) {
|
|
1157
|
+
@if (showIndicators()) {
|
|
1370
1158
|
<ul [pBind]="ptm('indicatorList')" [class]="cx('indicatorList')">
|
|
1371
|
-
@for (item of value; track item; let index = $index) {
|
|
1159
|
+
@for (item of value(); track item; let index = $index) {
|
|
1372
1160
|
<li
|
|
1373
1161
|
[pBind]="getIndicatorPTOptions(index)"
|
|
1374
1162
|
tabindex="0"
|
|
@@ -1377,16 +1165,16 @@ class GalleriaItem extends BaseComponent {
|
|
|
1377
1165
|
(keydown)="onIndicatorKeyDown($event, index)"
|
|
1378
1166
|
[class]="cx('indicator', { index })"
|
|
1379
1167
|
[attr.aria-label]="ariaPageLabel(index + 1)"
|
|
1380
|
-
[attr.aria-selected]="activeIndex === index"
|
|
1381
|
-
[attr.aria-controls]="id + '_item_' + index"
|
|
1168
|
+
[attr.aria-selected]="activeIndex() === index"
|
|
1169
|
+
[attr.aria-controls]="id() + '_item_' + index"
|
|
1382
1170
|
[pBind]="ptm('indicator', getIndicatorPTOptions(index))"
|
|
1383
1171
|
[attr.data-p-active]="isIndicatorItemActive(index)"
|
|
1384
1172
|
>
|
|
1385
|
-
@if (!indicatorFacet && !galleria.indicatorTemplate()) {
|
|
1173
|
+
@if (!indicatorFacet() && !galleria.indicatorTemplate()) {
|
|
1386
1174
|
<button type="button" tabIndex="-1" [pBind]="ptm('indicatorButton', getIndicatorPTOptions(index))" [class]="cx('indicatorButton')"></button>
|
|
1387
1175
|
}
|
|
1388
|
-
@if (indicatorFacet || galleria.indicatorTemplate()) {
|
|
1389
|
-
<div pGalleriaItemSlot type="indicator" [index]="index" [templates]="templates" [pBind]="ptm('item')" [unstyled]="unstyled()"></div>
|
|
1176
|
+
@if (indicatorFacet() || galleria.indicatorTemplate()) {
|
|
1177
|
+
<div pGalleriaItemSlot type="indicator" [index]="index" [templates]="templates()" [pBind]="ptm('item')" [unstyled]="unstyled()"></div>
|
|
1390
1178
|
}
|
|
1391
1179
|
</li>
|
|
1392
1180
|
}
|
|
@@ -1401,42 +1189,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
1401
1189
|
standalone: false,
|
|
1402
1190
|
template: `
|
|
1403
1191
|
<div [pBind]="ptm('items')" [class]="cx('items')">
|
|
1404
|
-
@if (showItemNavigators) {
|
|
1192
|
+
@if (showItemNavigators()) {
|
|
1405
1193
|
<button type="button" role="navigation" [pBind]="ptm('prevButton')" [class]="cx('prevButton')" (click)="navBackward($event)" (focus)="onButtonFocus('left')" (blur)="onButtonBlur('left')" data-pc-group-section="itemnavigator">
|
|
1406
|
-
@if (!galleria.itemPreviousIconTemplate && !galleria._itemPreviousIconTemplate()) {
|
|
1194
|
+
@if (!galleria.itemPreviousIconTemplate() && !galleria._itemPreviousIconTemplate()) {
|
|
1407
1195
|
<svg data-p-icon="chevron-left" [pBind]="ptm('prevIcon')" [class]="cx('prevIcon')" />
|
|
1408
1196
|
}
|
|
1409
|
-
<ng-template *ngTemplateOutlet="galleria.itemPreviousIconTemplate || galleria._itemPreviousIconTemplate()"></ng-template>
|
|
1197
|
+
<ng-template *ngTemplateOutlet="galleria.itemPreviousIconTemplate() || galleria._itemPreviousIconTemplate()"></ng-template>
|
|
1410
1198
|
</button>
|
|
1411
1199
|
}
|
|
1412
1200
|
<div
|
|
1413
1201
|
pGalleriaItemSlot
|
|
1202
|
+
type="item"
|
|
1414
1203
|
[pBind]="ptm('item')"
|
|
1415
1204
|
[unstyled]="unstyled()"
|
|
1416
1205
|
[class]="cx('item')"
|
|
1417
|
-
[item]="activeItem"
|
|
1418
|
-
[templates]="templates"
|
|
1419
|
-
[id]="id + '_item_' + activeIndex"
|
|
1206
|
+
[item]="activeItem()"
|
|
1207
|
+
[templates]="templates()"
|
|
1208
|
+
[id]="id() + '_item_' + activeIndex()"
|
|
1420
1209
|
role="group"
|
|
1421
1210
|
[class]="cx('item')"
|
|
1422
|
-
[attr.aria-label]="ariaSlideNumber(activeIndex + 1)"
|
|
1211
|
+
[attr.aria-label]="ariaSlideNumber(activeIndex() + 1)"
|
|
1423
1212
|
[attr.aria-roledescription]="ariaSlideLabel()"
|
|
1424
1213
|
></div>
|
|
1425
|
-
@if (showItemNavigators) {
|
|
1214
|
+
@if (showItemNavigators()) {
|
|
1426
1215
|
<button type="button" [pBind]="ptm('nextButton')" [class]="cx('nextButton')" (click)="navForward($event)" role="navigation" (focus)="onButtonFocus('right')" (blur)="onButtonBlur('right')" data-pc-group-section="itemnavigator">
|
|
1427
|
-
@if (!galleria.itemNextIconTemplate && !galleria._itemNextIconTemplate()) {
|
|
1216
|
+
@if (!galleria.itemNextIconTemplate() && !galleria._itemNextIconTemplate()) {
|
|
1428
1217
|
<svg data-p-icon="chevron-right" [pBind]="ptm('nextIcon')" [class]="cx('nextIcon')" />
|
|
1429
1218
|
}
|
|
1430
|
-
<ng-template *ngTemplateOutlet="galleria.itemNextIconTemplate || galleria._itemNextIconTemplate()"></ng-template>
|
|
1219
|
+
<ng-template *ngTemplateOutlet="galleria.itemNextIconTemplate() || galleria._itemNextIconTemplate()"></ng-template>
|
|
1431
1220
|
</button>
|
|
1432
1221
|
}
|
|
1433
|
-
@if (captionFacet || galleria.captionTemplate()) {
|
|
1434
|
-
<div pGalleriaItemSlot [pBind]="ptm('caption')" [unstyled]="unstyled()" [class]="cx('caption')" type="caption" [item]="activeItem" [templates]="templates"></div>
|
|
1222
|
+
@if (captionFacet() || galleria.captionTemplate()) {
|
|
1223
|
+
<div pGalleriaItemSlot [pBind]="ptm('caption')" [unstyled]="unstyled()" [class]="cx('caption')" type="caption" [item]="activeItem()" [templates]="templates()"></div>
|
|
1435
1224
|
}
|
|
1436
1225
|
</div>
|
|
1437
|
-
@if (showIndicators) {
|
|
1226
|
+
@if (showIndicators()) {
|
|
1438
1227
|
<ul [pBind]="ptm('indicatorList')" [class]="cx('indicatorList')">
|
|
1439
|
-
@for (item of value; track item; let index = $index) {
|
|
1228
|
+
@for (item of value(); track item; let index = $index) {
|
|
1440
1229
|
<li
|
|
1441
1230
|
[pBind]="getIndicatorPTOptions(index)"
|
|
1442
1231
|
tabindex="0"
|
|
@@ -1445,16 +1234,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
1445
1234
|
(keydown)="onIndicatorKeyDown($event, index)"
|
|
1446
1235
|
[class]="cx('indicator', { index })"
|
|
1447
1236
|
[attr.aria-label]="ariaPageLabel(index + 1)"
|
|
1448
|
-
[attr.aria-selected]="activeIndex === index"
|
|
1449
|
-
[attr.aria-controls]="id + '_item_' + index"
|
|
1237
|
+
[attr.aria-selected]="activeIndex() === index"
|
|
1238
|
+
[attr.aria-controls]="id() + '_item_' + index"
|
|
1450
1239
|
[pBind]="ptm('indicator', getIndicatorPTOptions(index))"
|
|
1451
1240
|
[attr.data-p-active]="isIndicatorItemActive(index)"
|
|
1452
1241
|
>
|
|
1453
|
-
@if (!indicatorFacet && !galleria.indicatorTemplate()) {
|
|
1242
|
+
@if (!indicatorFacet() && !galleria.indicatorTemplate()) {
|
|
1454
1243
|
<button type="button" tabIndex="-1" [pBind]="ptm('indicatorButton', getIndicatorPTOptions(index))" [class]="cx('indicatorButton')"></button>
|
|
1455
1244
|
}
|
|
1456
|
-
@if (indicatorFacet || galleria.indicatorTemplate()) {
|
|
1457
|
-
<div pGalleriaItemSlot type="indicator" [index]="index" [templates]="templates" [pBind]="ptm('item')" [unstyled]="unstyled()"></div>
|
|
1245
|
+
@if (indicatorFacet() || galleria.indicatorTemplate()) {
|
|
1246
|
+
<div pGalleriaItemSlot type="indicator" [index]="index" [templates]="templates()" [pBind]="ptm('item')" [unstyled]="unstyled()"></div>
|
|
1458
1247
|
}
|
|
1459
1248
|
</li>
|
|
1460
1249
|
}
|
|
@@ -1465,143 +1254,128 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
1465
1254
|
providers: [GalleriaStyle],
|
|
1466
1255
|
hostDirectives: [Bind]
|
|
1467
1256
|
}]
|
|
1468
|
-
}], propDecorators: { id: [{
|
|
1469
|
-
type: Input
|
|
1470
|
-
}], circular: [{
|
|
1471
|
-
type: Input,
|
|
1472
|
-
args: [{ transform: booleanAttribute }]
|
|
1473
|
-
}], value: [{
|
|
1474
|
-
type: Input
|
|
1475
|
-
}], showItemNavigators: [{
|
|
1476
|
-
type: Input,
|
|
1477
|
-
args: [{ transform: booleanAttribute }]
|
|
1478
|
-
}], showIndicators: [{
|
|
1479
|
-
type: Input,
|
|
1480
|
-
args: [{ transform: booleanAttribute }]
|
|
1481
|
-
}], slideShowActive: [{
|
|
1482
|
-
type: Input,
|
|
1483
|
-
args: [{ transform: booleanAttribute }]
|
|
1484
|
-
}], changeItemOnIndicatorHover: [{
|
|
1485
|
-
type: Input,
|
|
1486
|
-
args: [{ transform: booleanAttribute }]
|
|
1487
|
-
}], autoPlay: [{
|
|
1488
|
-
type: Input,
|
|
1489
|
-
args: [{ transform: booleanAttribute }]
|
|
1490
|
-
}], templates: [{
|
|
1491
|
-
type: Input
|
|
1492
|
-
}], indicatorFacet: [{
|
|
1493
|
-
type: Input
|
|
1494
|
-
}], captionFacet: [{
|
|
1495
|
-
type: Input
|
|
1496
|
-
}], startSlideShow: [{ type: i0.Output, args: ["startSlideShow"] }], stopSlideShow: [{ type: i0.Output, args: ["stopSlideShow"] }], onActiveIndexChange: [{ type: i0.Output, args: ["onActiveIndexChange"] }], activeIndex: [{
|
|
1497
|
-
type: Input
|
|
1498
|
-
}] } });
|
|
1257
|
+
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], circular: [{ type: i0.Input, args: [{ isSignal: true, alias: "circular", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], showItemNavigators: [{ type: i0.Input, args: [{ isSignal: true, alias: "showItemNavigators", required: false }] }], showIndicators: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIndicators", required: false }] }], slideShowActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "slideShowActive", required: false }] }], changeItemOnIndicatorHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "changeItemOnIndicatorHover", required: false }] }], autoPlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoPlay", required: false }] }], templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }], indicatorFacet: [{ type: i0.Input, args: [{ isSignal: true, alias: "indicatorFacet", required: false }] }], captionFacet: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionFacet", required: false }] }], startSlideShow: [{ type: i0.Output, args: ["startSlideShow"] }], stopSlideShow: [{ type: i0.Output, args: ["stopSlideShow"] }], onActiveIndexChange: [{ type: i0.Output, args: ["onActiveIndexChange"] }], activeIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIndex", required: false }] }] } });
|
|
1499
1258
|
class GalleriaThumbnails extends BaseComponent {
|
|
1500
1259
|
galleria = inject(Galleria);
|
|
1501
1260
|
hostName = 'Galleria';
|
|
1502
1261
|
bindDirectiveInstance = inject(Bind, { self: true });
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1262
|
+
constructor() {
|
|
1263
|
+
super();
|
|
1264
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptm('thumbnails')));
|
|
1265
|
+
effect(() => {
|
|
1266
|
+
const activeIndex = this.activeIndex();
|
|
1267
|
+
untracked(() => {
|
|
1268
|
+
this._oldactiveIndex.set(this._activeIndex());
|
|
1269
|
+
this._activeIndex.set(activeIndex);
|
|
1270
|
+
});
|
|
1271
|
+
});
|
|
1272
|
+
effect(() => {
|
|
1273
|
+
const itemsContainer = this.itemsContainer();
|
|
1274
|
+
const d_numVisible = this.d_numVisible();
|
|
1275
|
+
const _activeIndex = this._activeIndex();
|
|
1276
|
+
untracked(() => {
|
|
1277
|
+
let totalShiftedItems = this.totalShiftedItems();
|
|
1278
|
+
if ((this._oldNumVisible() !== d_numVisible || this._oldactiveIndex() !== _activeIndex) && itemsContainer) {
|
|
1279
|
+
if (_activeIndex <= this.getMedianItemIndex()) {
|
|
1280
|
+
totalShiftedItems = 0;
|
|
1281
|
+
}
|
|
1282
|
+
else if (this.value().length - d_numVisible + this.getMedianItemIndex() < _activeIndex) {
|
|
1283
|
+
totalShiftedItems = d_numVisible - this.value().length;
|
|
1284
|
+
}
|
|
1285
|
+
else if (this.value().length - d_numVisible < _activeIndex && d_numVisible % 2 === 0) {
|
|
1286
|
+
totalShiftedItems = _activeIndex * -1 + this.getMedianItemIndex() + 1;
|
|
1287
|
+
}
|
|
1288
|
+
else {
|
|
1289
|
+
totalShiftedItems = _activeIndex * -1 + this.getMedianItemIndex();
|
|
1290
|
+
}
|
|
1291
|
+
if (totalShiftedItems !== this.totalShiftedItems()) {
|
|
1292
|
+
this.totalShiftedItems.set(totalShiftedItems);
|
|
1293
|
+
}
|
|
1294
|
+
if (itemsContainer && itemsContainer.nativeElement) {
|
|
1295
|
+
itemsContainer.nativeElement.style.transform = this.isVertical() ? `translate3d(0, ${totalShiftedItems * (100 / d_numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100 / d_numVisible)}%, 0, 0)`;
|
|
1296
|
+
}
|
|
1297
|
+
if (this._oldactiveIndex() !== _activeIndex) {
|
|
1298
|
+
this.document.body.setAttribute('data-p-items-hidden', 'false');
|
|
1299
|
+
!this.$unstyled() && removeClass(itemsContainer.nativeElement, 'p-items-hidden');
|
|
1300
|
+
itemsContainer.nativeElement.style.transition = 'transform 500ms ease 0s';
|
|
1301
|
+
}
|
|
1302
|
+
this._oldactiveIndex.set(_activeIndex);
|
|
1303
|
+
this._oldNumVisible.set(d_numVisible);
|
|
1304
|
+
}
|
|
1305
|
+
});
|
|
1306
|
+
});
|
|
1307
|
+
afterNextRender(() => {
|
|
1308
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
1309
|
+
this.calculatePosition();
|
|
1310
|
+
}
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
containerId = input(/* @ts-ignore */
|
|
1314
|
+
...(ngDevMode ? [undefined, { debugName: "containerId" }] : /* istanbul ignore next */ []));
|
|
1315
|
+
value = input(/* @ts-ignore */
|
|
1316
|
+
...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1317
|
+
isVertical = input(false, { ...(ngDevMode ? { debugName: "isVertical" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1318
|
+
slideShowActive = input(false, { ...(ngDevMode ? { debugName: "slideShowActive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1319
|
+
circular = input(false, { ...(ngDevMode ? { debugName: "circular" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1320
|
+
responsiveOptions = input(/* @ts-ignore */
|
|
1321
|
+
...(ngDevMode ? [undefined, { debugName: "responsiveOptions" }] : /* istanbul ignore next */ []));
|
|
1322
|
+
contentHeight = input('300px', /* @ts-ignore */
|
|
1323
|
+
...(ngDevMode ? [{ debugName: "contentHeight" }] : /* istanbul ignore next */ []));
|
|
1324
|
+
showThumbnailNavigators = input(true, /* @ts-ignore */
|
|
1325
|
+
...(ngDevMode ? [{ debugName: "showThumbnailNavigators" }] : /* istanbul ignore next */ []));
|
|
1326
|
+
templates = input(/* @ts-ignore */
|
|
1327
|
+
...(ngDevMode ? [undefined, { debugName: "templates" }] : /* istanbul ignore next */ []));
|
|
1515
1328
|
onActiveIndexChange = output();
|
|
1516
1329
|
stopSlideShow = output();
|
|
1517
1330
|
itemsContainer = viewChild('itemsContainer', /* @ts-ignore */
|
|
1518
1331
|
...(ngDevMode ? [{ debugName: "itemsContainer" }] : /* istanbul ignore next */ []));
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
_numVisible = 0;
|
|
1542
|
-
d_numVisible = 0;
|
|
1543
|
-
_oldNumVisible = 0;
|
|
1544
|
-
_activeIndex = 0;
|
|
1545
|
-
_oldactiveIndex = 0;
|
|
1332
|
+
numVisible = input(0, /* @ts-ignore */
|
|
1333
|
+
...(ngDevMode ? [{ debugName: "numVisible" }] : /* istanbul ignore next */ []));
|
|
1334
|
+
activeIndex = input(0, /* @ts-ignore */
|
|
1335
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
1336
|
+
startPos = signal(null, /* @ts-ignore */
|
|
1337
|
+
...(ngDevMode ? [{ debugName: "startPos" }] : /* istanbul ignore next */ []));
|
|
1338
|
+
thumbnailsStyle = signal(null, /* @ts-ignore */
|
|
1339
|
+
...(ngDevMode ? [{ debugName: "thumbnailsStyle" }] : /* istanbul ignore next */ []));
|
|
1340
|
+
sortedResponsiveOptions = signal(null, /* @ts-ignore */
|
|
1341
|
+
...(ngDevMode ? [{ debugName: "sortedResponsiveOptions" }] : /* istanbul ignore next */ []));
|
|
1342
|
+
totalShiftedItems = signal(0, /* @ts-ignore */
|
|
1343
|
+
...(ngDevMode ? [{ debugName: "totalShiftedItems" }] : /* istanbul ignore next */ []));
|
|
1344
|
+
documentResizeListener = signal(undefined, /* @ts-ignore */
|
|
1345
|
+
...(ngDevMode ? [{ debugName: "documentResizeListener" }] : /* istanbul ignore next */ []));
|
|
1346
|
+
d_numVisible = linkedSignal(() => this.numVisible(), /* @ts-ignore */
|
|
1347
|
+
...(ngDevMode ? [{ debugName: "d_numVisible" }] : /* istanbul ignore next */ []));
|
|
1348
|
+
_oldNumVisible = signal(0, /* @ts-ignore */
|
|
1349
|
+
...(ngDevMode ? [{ debugName: "_oldNumVisible" }] : /* istanbul ignore next */ []));
|
|
1350
|
+
_activeIndex = signal(0, /* @ts-ignore */
|
|
1351
|
+
...(ngDevMode ? [{ debugName: "_activeIndex" }] : /* istanbul ignore next */ []));
|
|
1352
|
+
_oldactiveIndex = signal(0, /* @ts-ignore */
|
|
1353
|
+
...(ngDevMode ? [{ debugName: "_oldactiveIndex" }] : /* istanbul ignore next */ []));
|
|
1546
1354
|
_componentStyle = inject(GalleriaStyle);
|
|
1547
1355
|
onInit() {
|
|
1548
1356
|
if (isPlatformBrowser(this.platformId)) {
|
|
1549
1357
|
this.createStyle();
|
|
1550
|
-
if (this.responsiveOptions) {
|
|
1358
|
+
if (this.responsiveOptions()) {
|
|
1551
1359
|
this.bindDocumentListeners();
|
|
1552
1360
|
}
|
|
1553
1361
|
}
|
|
1554
1362
|
}
|
|
1555
|
-
onAfterContentChecked() {
|
|
1556
|
-
let totalShiftedItems = this.totalShiftedItems;
|
|
1557
|
-
const itemsContainer = this.itemsContainer();
|
|
1558
|
-
if ((this._oldNumVisible !== this.d_numVisible || this._oldactiveIndex !== this._activeIndex) && itemsContainer) {
|
|
1559
|
-
if (this._activeIndex <= this.getMedianItemIndex()) {
|
|
1560
|
-
totalShiftedItems = 0;
|
|
1561
|
-
}
|
|
1562
|
-
else if (this.value.length - this.d_numVisible + this.getMedianItemIndex() < this._activeIndex) {
|
|
1563
|
-
totalShiftedItems = this.d_numVisible - this.value.length;
|
|
1564
|
-
}
|
|
1565
|
-
else if (this.value.length - this.d_numVisible < this._activeIndex && this.d_numVisible % 2 === 0) {
|
|
1566
|
-
totalShiftedItems = this._activeIndex * -1 + this.getMedianItemIndex() + 1;
|
|
1567
|
-
}
|
|
1568
|
-
else {
|
|
1569
|
-
totalShiftedItems = this._activeIndex * -1 + this.getMedianItemIndex();
|
|
1570
|
-
}
|
|
1571
|
-
if (totalShiftedItems !== this.totalShiftedItems) {
|
|
1572
|
-
this.totalShiftedItems = totalShiftedItems;
|
|
1573
|
-
}
|
|
1574
|
-
if (itemsContainer && itemsContainer.nativeElement) {
|
|
1575
|
-
itemsContainer.nativeElement.style.transform = this.isVertical ? `translate3d(0, ${totalShiftedItems * (100 / this.d_numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100 / this.d_numVisible)}%, 0, 0)`;
|
|
1576
|
-
}
|
|
1577
|
-
if (this._oldactiveIndex !== this._activeIndex) {
|
|
1578
|
-
this.document.body.setAttribute('data-p-items-hidden', 'false');
|
|
1579
|
-
!this.$unstyled() && removeClass(itemsContainer.nativeElement, 'p-items-hidden');
|
|
1580
|
-
itemsContainer.nativeElement.style.transition = 'transform 500ms ease 0s';
|
|
1581
|
-
}
|
|
1582
|
-
this._oldactiveIndex = this._activeIndex;
|
|
1583
|
-
this._oldNumVisible = this.d_numVisible;
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
onAfterViewInit() {
|
|
1587
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
1588
|
-
this.calculatePosition();
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
1363
|
createStyle() {
|
|
1592
|
-
if (!this.thumbnailsStyle) {
|
|
1593
|
-
|
|
1594
|
-
setAttribute(
|
|
1595
|
-
this.document.body.appendChild(
|
|
1364
|
+
if (!this.thumbnailsStyle()) {
|
|
1365
|
+
const thumbnailsStyle = this.document.createElement('style');
|
|
1366
|
+
setAttribute(thumbnailsStyle, 'nonce', this.galleria.config?.csp()?.nonce);
|
|
1367
|
+
this.document.body.appendChild(thumbnailsStyle);
|
|
1368
|
+
this.thumbnailsStyle.set(thumbnailsStyle);
|
|
1596
1369
|
}
|
|
1597
1370
|
let innerHTML = `
|
|
1598
|
-
#${this.containerId} .p-galleria-thumbnail-item {
|
|
1599
|
-
flex: 1 0 ${100 / this.d_numVisible}%
|
|
1371
|
+
#${this.containerId()} .p-galleria-thumbnail-item {
|
|
1372
|
+
flex: 1 0 ${100 / this.d_numVisible()}%
|
|
1600
1373
|
}
|
|
1601
1374
|
`;
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1375
|
+
const responsiveOptions = this.responsiveOptions();
|
|
1376
|
+
if (responsiveOptions && !this.$unstyled()) {
|
|
1377
|
+
const sortedResponsiveOptions = [...responsiveOptions];
|
|
1378
|
+
sortedResponsiveOptions.sort((data1, data2) => {
|
|
1605
1379
|
const value1 = data1.breakpoint;
|
|
1606
1380
|
const value2 = data2.breakpoint;
|
|
1607
1381
|
let result;
|
|
@@ -1617,36 +1391,38 @@ class GalleriaThumbnails extends BaseComponent {
|
|
|
1617
1391
|
result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
|
|
1618
1392
|
return -1 * result;
|
|
1619
1393
|
});
|
|
1620
|
-
|
|
1621
|
-
|
|
1394
|
+
this.sortedResponsiveOptions.set(sortedResponsiveOptions);
|
|
1395
|
+
for (let i = 0; i < sortedResponsiveOptions.length; i++) {
|
|
1396
|
+
let res = sortedResponsiveOptions[i];
|
|
1622
1397
|
innerHTML += `
|
|
1623
1398
|
@media screen and (max-width: ${res.breakpoint}) {
|
|
1624
|
-
#${this.containerId} .p-galleria-thumbnail-item {
|
|
1399
|
+
#${this.containerId()} .p-galleria-thumbnail-item {
|
|
1625
1400
|
flex: 1 0 ${100 / res.numVisible}%
|
|
1626
1401
|
}
|
|
1627
1402
|
}
|
|
1628
1403
|
`;
|
|
1629
1404
|
}
|
|
1630
1405
|
}
|
|
1631
|
-
|
|
1632
|
-
|
|
1406
|
+
const thumbnailsStyle = this.thumbnailsStyle();
|
|
1407
|
+
thumbnailsStyle.innerHTML = innerHTML;
|
|
1408
|
+
setAttribute(thumbnailsStyle, 'nonce', this.galleria.config?.csp()?.nonce);
|
|
1633
1409
|
}
|
|
1634
1410
|
calculatePosition() {
|
|
1635
1411
|
if (isPlatformBrowser(this.platformId)) {
|
|
1636
|
-
|
|
1412
|
+
const sortedResponsiveOptions = this.sortedResponsiveOptions();
|
|
1413
|
+
if (this.itemsContainer() && sortedResponsiveOptions) {
|
|
1637
1414
|
let windowWidth = window.innerWidth;
|
|
1638
1415
|
let matchedResponsiveData = {
|
|
1639
|
-
numVisible: this.
|
|
1416
|
+
numVisible: this.numVisible()
|
|
1640
1417
|
};
|
|
1641
|
-
for (let i = 0; i <
|
|
1642
|
-
let res =
|
|
1418
|
+
for (let i = 0; i < sortedResponsiveOptions.length; i++) {
|
|
1419
|
+
let res = sortedResponsiveOptions[i];
|
|
1643
1420
|
if (parseInt(res.breakpoint, 10) >= windowWidth) {
|
|
1644
1421
|
matchedResponsiveData = res;
|
|
1645
1422
|
}
|
|
1646
1423
|
}
|
|
1647
|
-
if (this.d_numVisible !== matchedResponsiveData.numVisible) {
|
|
1648
|
-
this.d_numVisible
|
|
1649
|
-
this.cd.markForCheck();
|
|
1424
|
+
if (this.d_numVisible() !== matchedResponsiveData.numVisible) {
|
|
1425
|
+
this.d_numVisible.set(matchedResponsiveData.numVisible);
|
|
1650
1426
|
}
|
|
1651
1427
|
}
|
|
1652
1428
|
}
|
|
@@ -1656,11 +1432,11 @@ class GalleriaThumbnails extends BaseComponent {
|
|
|
1656
1432
|
}
|
|
1657
1433
|
navForward(e) {
|
|
1658
1434
|
this.stopTheSlideShow();
|
|
1659
|
-
let nextItemIndex = this._activeIndex + 1;
|
|
1660
|
-
if (nextItemIndex + this.totalShiftedItems > this.getMedianItemIndex() && (-1 * this.totalShiftedItems < this.getTotalPageNumber() - 1 || this.circular)) {
|
|
1435
|
+
let nextItemIndex = this._activeIndex() + 1;
|
|
1436
|
+
if (nextItemIndex + this.totalShiftedItems() > this.getMedianItemIndex() && (-1 * this.totalShiftedItems() < this.getTotalPageNumber() - 1 || this.circular())) {
|
|
1661
1437
|
this.step(-1);
|
|
1662
1438
|
}
|
|
1663
|
-
let activeIndex = this.circular && this.value.length - 1 === this._activeIndex ? 0 : nextItemIndex;
|
|
1439
|
+
let activeIndex = this.circular() && this.value().length - 1 === this._activeIndex() ? 0 : nextItemIndex;
|
|
1664
1440
|
this.onActiveIndexChange.emit(activeIndex);
|
|
1665
1441
|
if (e.cancelable) {
|
|
1666
1442
|
e.preventDefault();
|
|
@@ -1668,12 +1444,12 @@ class GalleriaThumbnails extends BaseComponent {
|
|
|
1668
1444
|
}
|
|
1669
1445
|
navBackward(e) {
|
|
1670
1446
|
this.stopTheSlideShow();
|
|
1671
|
-
let prevItemIndex = this._activeIndex !== 0 ? this._activeIndex - 1 : 0;
|
|
1672
|
-
let diff = prevItemIndex + this.totalShiftedItems;
|
|
1673
|
-
if (this.d_numVisible - diff - 1 > this.getMedianItemIndex() && (-1 * this.totalShiftedItems !== 0 || this.circular)) {
|
|
1447
|
+
let prevItemIndex = this._activeIndex() !== 0 ? this._activeIndex() - 1 : 0;
|
|
1448
|
+
let diff = prevItemIndex + this.totalShiftedItems();
|
|
1449
|
+
if (this.d_numVisible() - diff - 1 > this.getMedianItemIndex() && (-1 * this.totalShiftedItems() !== 0 || this.circular())) {
|
|
1674
1450
|
this.step(1);
|
|
1675
1451
|
}
|
|
1676
|
-
let activeIndex = this.circular && this._activeIndex === 0 ? this.value.length - 1 : prevItemIndex;
|
|
1452
|
+
let activeIndex = this.circular() && this._activeIndex() === 0 ? this.value().length - 1 : prevItemIndex;
|
|
1677
1453
|
this.onActiveIndexChange.emit(activeIndex);
|
|
1678
1454
|
if (e.cancelable) {
|
|
1679
1455
|
e.preventDefault();
|
|
@@ -1682,23 +1458,24 @@ class GalleriaThumbnails extends BaseComponent {
|
|
|
1682
1458
|
onItemClick(index) {
|
|
1683
1459
|
this.stopTheSlideShow();
|
|
1684
1460
|
let selectedItemIndex = index;
|
|
1685
|
-
if (selectedItemIndex !== this._activeIndex) {
|
|
1686
|
-
const diff = selectedItemIndex + this.totalShiftedItems;
|
|
1461
|
+
if (selectedItemIndex !== this._activeIndex()) {
|
|
1462
|
+
const diff = selectedItemIndex + this.totalShiftedItems();
|
|
1687
1463
|
let dir = 0;
|
|
1688
|
-
if (selectedItemIndex < this._activeIndex) {
|
|
1689
|
-
dir = this.d_numVisible - diff - 1 - this.getMedianItemIndex();
|
|
1690
|
-
if (dir > 0 && -1 * this.totalShiftedItems !== 0) {
|
|
1464
|
+
if (selectedItemIndex < this._activeIndex()) {
|
|
1465
|
+
dir = this.d_numVisible() - diff - 1 - this.getMedianItemIndex();
|
|
1466
|
+
if (dir > 0 && -1 * this.totalShiftedItems() !== 0) {
|
|
1691
1467
|
this.step(dir);
|
|
1692
1468
|
}
|
|
1693
1469
|
}
|
|
1694
1470
|
else {
|
|
1695
1471
|
dir = this.getMedianItemIndex() - diff;
|
|
1696
|
-
if (dir < 0 && -1 * this.totalShiftedItems < this.getTotalPageNumber() - 1) {
|
|
1472
|
+
if (dir < 0 && -1 * this.totalShiftedItems() < this.getTotalPageNumber() - 1) {
|
|
1697
1473
|
this.step(dir);
|
|
1698
1474
|
}
|
|
1699
1475
|
}
|
|
1700
|
-
this.
|
|
1701
|
-
this.
|
|
1476
|
+
this._oldactiveIndex.set(this._activeIndex());
|
|
1477
|
+
this._activeIndex.set(selectedItemIndex);
|
|
1478
|
+
this.onActiveIndexChange.emit(this._activeIndex());
|
|
1702
1479
|
}
|
|
1703
1480
|
}
|
|
1704
1481
|
onThumbnailKeydown(event, index) {
|
|
@@ -1772,52 +1549,78 @@ class GalleriaThumbnails extends BaseComponent {
|
|
|
1772
1549
|
indicators[nextInd].children[0].focus();
|
|
1773
1550
|
}
|
|
1774
1551
|
step(dir) {
|
|
1775
|
-
let totalShiftedItems = this.totalShiftedItems + dir;
|
|
1776
|
-
if (dir < 0 && -1 * totalShiftedItems + this.d_numVisible > this.value.length - 1) {
|
|
1777
|
-
totalShiftedItems = this.d_numVisible - this.value.length;
|
|
1552
|
+
let totalShiftedItems = this.totalShiftedItems() + dir;
|
|
1553
|
+
if (dir < 0 && -1 * totalShiftedItems + this.d_numVisible() > this.value().length - 1) {
|
|
1554
|
+
totalShiftedItems = this.d_numVisible() - this.value().length;
|
|
1778
1555
|
}
|
|
1779
1556
|
else if (dir > 0 && totalShiftedItems > 0) {
|
|
1780
1557
|
totalShiftedItems = 0;
|
|
1781
1558
|
}
|
|
1782
|
-
if (this.circular) {
|
|
1783
|
-
if (dir < 0 && this.value.length - 1 === this._activeIndex) {
|
|
1559
|
+
if (this.circular()) {
|
|
1560
|
+
if (dir < 0 && this.value().length - 1 === this._activeIndex()) {
|
|
1784
1561
|
totalShiftedItems = 0;
|
|
1785
1562
|
}
|
|
1786
|
-
else if (dir > 0 && this._activeIndex === 0) {
|
|
1787
|
-
totalShiftedItems = this.d_numVisible - this.value.length;
|
|
1563
|
+
else if (dir > 0 && this._activeIndex() === 0) {
|
|
1564
|
+
totalShiftedItems = this.d_numVisible() - this.value().length;
|
|
1788
1565
|
}
|
|
1789
1566
|
}
|
|
1790
1567
|
const itemsContainer = this.itemsContainer();
|
|
1791
1568
|
if (itemsContainer) {
|
|
1792
1569
|
this.document.body.setAttribute('data-p-items-hidden', 'false');
|
|
1793
1570
|
!this.$unstyled() && removeClass(itemsContainer.nativeElement, 'p-items-hidden');
|
|
1794
|
-
itemsContainer.nativeElement.style.transform = this.isVertical ? `translate3d(0, ${totalShiftedItems * (100 / this.d_numVisible)}%, 0)` : `translate3d(${totalShiftedItems * (100 / this.d_numVisible)}%, 0, 0)`;
|
|
1571
|
+
itemsContainer.nativeElement.style.transform = this.isVertical() ? `translate3d(0, ${totalShiftedItems * (100 / this.d_numVisible())}%, 0)` : `translate3d(${totalShiftedItems * (100 / this.d_numVisible())}%, 0, 0)`;
|
|
1795
1572
|
itemsContainer.nativeElement.style.transition = 'transform 500ms ease 0s';
|
|
1796
1573
|
}
|
|
1797
|
-
this.totalShiftedItems
|
|
1574
|
+
this.totalShiftedItems.set(totalShiftedItems);
|
|
1798
1575
|
}
|
|
1799
1576
|
stopTheSlideShow() {
|
|
1800
|
-
if (this.slideShowActive && this.stopSlideShow) {
|
|
1577
|
+
if (this.slideShowActive() && this.stopSlideShow) {
|
|
1801
1578
|
this.stopSlideShow.emit(undefined);
|
|
1802
1579
|
}
|
|
1803
1580
|
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Minimum touch move distance, in pixels, for a touch to be a swipe rather than a tap.
|
|
1583
|
+
*/
|
|
1584
|
+
swipeThreshold = 20;
|
|
1804
1585
|
changePageOnTouch(e, diff) {
|
|
1586
|
+
if (Math.abs(diff) <= this.swipeThreshold) {
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1589
|
+
const lastIndex = this.value().length - 1;
|
|
1805
1590
|
if (diff < 0) {
|
|
1806
1591
|
// left
|
|
1807
|
-
this.
|
|
1592
|
+
if (this.circular() || this._activeIndex() < lastIndex) {
|
|
1593
|
+
this.navForward(e);
|
|
1594
|
+
}
|
|
1808
1595
|
}
|
|
1809
1596
|
else {
|
|
1810
1597
|
// right
|
|
1811
|
-
this.
|
|
1598
|
+
if (this.circular() || this._activeIndex() > 0) {
|
|
1599
|
+
this.navBackward(e);
|
|
1600
|
+
}
|
|
1812
1601
|
}
|
|
1813
1602
|
}
|
|
1814
|
-
|
|
1815
|
-
|
|
1603
|
+
getTouchDiff(e) {
|
|
1604
|
+
const startPos = this.startPos();
|
|
1605
|
+
const touchobj = e.changedTouches?.[0];
|
|
1606
|
+
if (!startPos || !touchobj) {
|
|
1607
|
+
return 0;
|
|
1608
|
+
}
|
|
1609
|
+
return this.isVertical() ? touchobj.pageY - startPos.y : touchobj.pageX - startPos.x;
|
|
1816
1610
|
}
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1611
|
+
onThumbnailTouchEnd(e, index) {
|
|
1612
|
+
// a swipe that ends on a thumbnail changes the page (onTouchEnd), it does not select that thumbnail
|
|
1613
|
+
if (Math.abs(this.getTouchDiff(e)) <= this.swipeThreshold) {
|
|
1614
|
+
this.onItemClick(index);
|
|
1615
|
+
}
|
|
1820
1616
|
}
|
|
1617
|
+
getTotalPageNumber = computed(() => (this.value().length > this.d_numVisible() ? this.value().length - this.d_numVisible() + 1 : 0), /* @ts-ignore */
|
|
1618
|
+
...(ngDevMode ? [{ debugName: "getTotalPageNumber" }] : /* istanbul ignore next */ []));
|
|
1619
|
+
getMedianItemIndex = computed(() => {
|
|
1620
|
+
let index = Math.floor(this.d_numVisible() / 2);
|
|
1621
|
+
return this.d_numVisible() % 2 ? index : index - 1;
|
|
1622
|
+
}, /* @ts-ignore */
|
|
1623
|
+
...(ngDevMode ? [{ debugName: "getMedianItemIndex" }] : /* istanbul ignore next */ []));
|
|
1821
1624
|
onTransitionEnd() {
|
|
1822
1625
|
const itemsContainer = this.itemsContainer();
|
|
1823
1626
|
if (itemsContainer && itemsContainer.nativeElement) {
|
|
@@ -1827,13 +1630,8 @@ class GalleriaThumbnails extends BaseComponent {
|
|
|
1827
1630
|
}
|
|
1828
1631
|
}
|
|
1829
1632
|
onTouchEnd(e) {
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
this.changePageOnTouch(e, touchobj.pageY - this.startPos.y);
|
|
1833
|
-
}
|
|
1834
|
-
else {
|
|
1835
|
-
this.changePageOnTouch(e, touchobj.pageX - this.startPos.x);
|
|
1836
|
-
}
|
|
1633
|
+
this.changePageOnTouch(e, this.getTouchDiff(e));
|
|
1634
|
+
this.startPos.set(null);
|
|
1837
1635
|
}
|
|
1838
1636
|
onTouchMove(e) {
|
|
1839
1637
|
if (e.cancelable) {
|
|
@@ -1842,46 +1640,44 @@ class GalleriaThumbnails extends BaseComponent {
|
|
|
1842
1640
|
}
|
|
1843
1641
|
onTouchStart(e) {
|
|
1844
1642
|
let touchobj = e.changedTouches[0];
|
|
1845
|
-
this.startPos
|
|
1643
|
+
this.startPos.set({
|
|
1846
1644
|
x: touchobj.pageX,
|
|
1847
1645
|
y: touchobj.pageY
|
|
1848
|
-
};
|
|
1849
|
-
}
|
|
1850
|
-
isNavBackwardDisabled() {
|
|
1851
|
-
return (!this.circular && this._activeIndex === 0) || this.value.length <= this.d_numVisible;
|
|
1852
|
-
}
|
|
1853
|
-
isNavForwardDisabled() {
|
|
1854
|
-
return (!this.circular && this._activeIndex === this.value.length - 1) || this.value.length <= this.d_numVisible;
|
|
1855
|
-
}
|
|
1856
|
-
firstItemAciveIndex() {
|
|
1857
|
-
return this.totalShiftedItems * -1;
|
|
1858
|
-
}
|
|
1859
|
-
lastItemActiveIndex() {
|
|
1860
|
-
return this.firstItemAciveIndex() + this.d_numVisible - 1;
|
|
1646
|
+
});
|
|
1861
1647
|
}
|
|
1648
|
+
isNavBackwardDisabled = computed(() => (!this.circular() && this._activeIndex() === 0) || this.value().length <= this.d_numVisible(), /* @ts-ignore */
|
|
1649
|
+
...(ngDevMode ? [{ debugName: "isNavBackwardDisabled" }] : /* istanbul ignore next */ []));
|
|
1650
|
+
isNavForwardDisabled = computed(() => (!this.circular() && this._activeIndex() === this.value().length - 1) || this.value().length <= this.d_numVisible(), /* @ts-ignore */
|
|
1651
|
+
...(ngDevMode ? [{ debugName: "isNavForwardDisabled" }] : /* istanbul ignore next */ []));
|
|
1652
|
+
firstItemAciveIndex = computed(() => this.totalShiftedItems() * -1, /* @ts-ignore */
|
|
1653
|
+
...(ngDevMode ? [{ debugName: "firstItemAciveIndex" }] : /* istanbul ignore next */ []));
|
|
1654
|
+
lastItemActiveIndex = computed(() => this.firstItemAciveIndex() + this.d_numVisible() - 1, /* @ts-ignore */
|
|
1655
|
+
...(ngDevMode ? [{ debugName: "lastItemActiveIndex" }] : /* istanbul ignore next */ []));
|
|
1862
1656
|
isItemActive(index) {
|
|
1863
1657
|
return this.firstItemAciveIndex() <= index && this.lastItemActiveIndex() >= index;
|
|
1864
1658
|
}
|
|
1865
1659
|
bindDocumentListeners() {
|
|
1866
1660
|
if (isPlatformBrowser(this.platformId)) {
|
|
1867
1661
|
const window = this.document.defaultView || 'window';
|
|
1868
|
-
this.documentResizeListener
|
|
1662
|
+
this.documentResizeListener.set(this.renderer.listen(window, 'resize', () => {
|
|
1869
1663
|
this.calculatePosition();
|
|
1870
|
-
});
|
|
1664
|
+
}));
|
|
1871
1665
|
}
|
|
1872
1666
|
}
|
|
1873
1667
|
unbindDocumentListeners() {
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1668
|
+
const documentResizeListener = this.documentResizeListener();
|
|
1669
|
+
if (documentResizeListener) {
|
|
1670
|
+
documentResizeListener();
|
|
1671
|
+
this.documentResizeListener.set(null);
|
|
1877
1672
|
}
|
|
1878
1673
|
}
|
|
1879
1674
|
onDestroy() {
|
|
1880
|
-
if (this.responsiveOptions) {
|
|
1675
|
+
if (this.responsiveOptions()) {
|
|
1881
1676
|
this.unbindDocumentListeners();
|
|
1882
1677
|
}
|
|
1883
|
-
|
|
1884
|
-
|
|
1678
|
+
const thumbnailsStyle = this.thumbnailsStyle();
|
|
1679
|
+
if (thumbnailsStyle) {
|
|
1680
|
+
thumbnailsStyle.parentNode?.removeChild(thumbnailsStyle);
|
|
1885
1681
|
}
|
|
1886
1682
|
}
|
|
1887
1683
|
ariaPrevButtonLabel() {
|
|
@@ -1893,60 +1689,69 @@ class GalleriaThumbnails extends BaseComponent {
|
|
|
1893
1689
|
ariaPageLabel(value) {
|
|
1894
1690
|
return this.galleria.config.translation.aria ? this.galleria.config.translation.aria.pageLabel?.replace(/{page}/g, value) : undefined;
|
|
1895
1691
|
}
|
|
1896
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GalleriaThumbnails, deps:
|
|
1897
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: GalleriaThumbnails, isStandalone: false, selector: "div[pGalleriaThumbnails]", inputs: { containerId: "containerId", value: "value", isVertical:
|
|
1692
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GalleriaThumbnails, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1693
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: GalleriaThumbnails, isStandalone: false, selector: "div[pGalleriaThumbnails]", inputs: { containerId: { classPropertyName: "containerId", publicName: "containerId", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, isVertical: { classPropertyName: "isVertical", publicName: "isVertical", isSignal: true, isRequired: false, transformFunction: null }, slideShowActive: { classPropertyName: "slideShowActive", publicName: "slideShowActive", isSignal: true, isRequired: false, transformFunction: null }, circular: { classPropertyName: "circular", publicName: "circular", isSignal: true, isRequired: false, transformFunction: null }, responsiveOptions: { classPropertyName: "responsiveOptions", publicName: "responsiveOptions", isSignal: true, isRequired: false, transformFunction: null }, contentHeight: { classPropertyName: "contentHeight", publicName: "contentHeight", isSignal: true, isRequired: false, transformFunction: null }, showThumbnailNavigators: { classPropertyName: "showThumbnailNavigators", publicName: "showThumbnailNavigators", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null }, numVisible: { classPropertyName: "numVisible", publicName: "numVisible", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onActiveIndexChange: "onActiveIndexChange", stopSlideShow: "stopSlideShow" }, host: { properties: { "class": "cx(\"thumbnails\")" } }, providers: [GalleriaStyle], viewQueries: [{ propertyName: "itemsContainer", first: true, predicate: ["itemsContainer"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0, template: `
|
|
1898
1694
|
<div [pBind]="ptm('thumbnailContent')" [class]="cx('thumbnailContent')">
|
|
1899
|
-
@if (showThumbnailNavigators) {
|
|
1695
|
+
@if (showThumbnailNavigators()) {
|
|
1900
1696
|
<button type="button" [pBind]="ptm('thumbnailPrevButton')" [class]="cx('thumbnailPrevButton')" (click)="navBackward($event)" pRipple [attr.aria-label]="ariaPrevButtonLabel()" data-pc-group-section="thumbnailnavigator">
|
|
1901
|
-
@if (!galleria.previousThumbnailIconTemplate && !galleria._previousThumbnailIconTemplate()) {
|
|
1902
|
-
@if (!isVertical) {
|
|
1697
|
+
@if (!galleria.previousThumbnailIconTemplate() && !galleria._previousThumbnailIconTemplate()) {
|
|
1698
|
+
@if (!isVertical()) {
|
|
1903
1699
|
<svg data-p-icon="chevron-left" [pBind]="ptm('thumbnailPrevIcon')" [class]="cx('thumbnailPrevIcon')" />
|
|
1904
1700
|
}
|
|
1905
|
-
@if (isVertical) {
|
|
1701
|
+
@if (isVertical()) {
|
|
1906
1702
|
<svg data-p-icon="chevron-up" [pBind]="ptm('thumbnailPrevIcon')" [class]="cx('thumbnailPrevIcon')" />
|
|
1907
1703
|
}
|
|
1908
1704
|
}
|
|
1909
|
-
<ng-template *ngTemplateOutlet="galleria.previousThumbnailIconTemplate || galleria._previousThumbnailIconTemplate()"></ng-template>
|
|
1705
|
+
<ng-template *ngTemplateOutlet="galleria.previousThumbnailIconTemplate() || galleria._previousThumbnailIconTemplate()"></ng-template>
|
|
1910
1706
|
</button>
|
|
1911
1707
|
}
|
|
1912
|
-
<div [pBind]="ptm('thumbnailsViewport')" [class]="cx('thumbnailsViewport')" [ngStyle]="{ height: isVertical ? contentHeight : '' }">
|
|
1913
|
-
<div
|
|
1914
|
-
|
|
1708
|
+
<div [pBind]="ptm('thumbnailsViewport')" [class]="cx('thumbnailsViewport')" [ngStyle]="{ height: isVertical() ? contentHeight() : '' }">
|
|
1709
|
+
<div
|
|
1710
|
+
#itemsContainer
|
|
1711
|
+
[pBind]="ptm('thumbnailItems')"
|
|
1712
|
+
[class]="cx('thumbnailItems')"
|
|
1713
|
+
(transitionend)="onTransitionEnd()"
|
|
1714
|
+
(touchstart)="onTouchStart($event)"
|
|
1715
|
+
(touchmove)="onTouchMove($event)"
|
|
1716
|
+
(touchend)="onTouchEnd($event)"
|
|
1717
|
+
role="tablist"
|
|
1718
|
+
>
|
|
1719
|
+
@for (item of value(); track item; let index = $index) {
|
|
1915
1720
|
<div
|
|
1916
1721
|
[pBind]="ptm('thumbnailItem')"
|
|
1917
|
-
[class]="cx('thumbnailItem', { index, activeIndex })"
|
|
1918
|
-
[attr.aria-selected]="
|
|
1919
|
-
[attr.aria-controls]="containerId + '_item_' + index"
|
|
1722
|
+
[class]="cx('thumbnailItem', { index, activeIndex: _activeIndex() })"
|
|
1723
|
+
[attr.aria-selected]="_activeIndex() === index"
|
|
1724
|
+
[attr.aria-controls]="containerId() + '_item_' + index"
|
|
1920
1725
|
(keydown)="onThumbnailKeydown($event, index)"
|
|
1921
|
-
[attr.data-p-active]="
|
|
1726
|
+
[attr.data-p-active]="_activeIndex() === index"
|
|
1922
1727
|
>
|
|
1923
1728
|
<div
|
|
1924
1729
|
[pBind]="ptm('thumbnail')"
|
|
1925
1730
|
[class]="cx('thumbnail')"
|
|
1926
|
-
[attr.tabindex]="
|
|
1927
|
-
[attr.aria-current]="
|
|
1731
|
+
[attr.tabindex]="_activeIndex() === index ? 0 : -1"
|
|
1732
|
+
[attr.aria-current]="_activeIndex() === index ? 'page' : undefined"
|
|
1928
1733
|
[attr.aria-label]="ariaPageLabel(index + 1)"
|
|
1929
1734
|
(click)="onItemClick(index)"
|
|
1930
|
-
(touchend)="
|
|
1735
|
+
(touchend)="onThumbnailTouchEnd($event, index)"
|
|
1931
1736
|
(keydown.enter)="onItemClick(index)"
|
|
1932
1737
|
>
|
|
1933
|
-
<div pGalleriaItemSlot type="thumbnail" [pBind]="ptm('thumbnailItem')" [item]="item" [templates]="templates" [unstyled]="unstyled()"></div>
|
|
1738
|
+
<div pGalleriaItemSlot type="thumbnail" [pBind]="ptm('thumbnailItem')" [item]="item" [templates]="templates()" [unstyled]="unstyled()"></div>
|
|
1934
1739
|
</div>
|
|
1935
1740
|
</div>
|
|
1936
1741
|
}
|
|
1937
1742
|
</div>
|
|
1938
1743
|
</div>
|
|
1939
|
-
@if (showThumbnailNavigators) {
|
|
1744
|
+
@if (showThumbnailNavigators()) {
|
|
1940
1745
|
<button type="button" [pBind]="ptm('thumbnailNextButton')" [class]="cx('thumbnailNextButton')" (click)="navForward($event)" pRipple [attr.aria-label]="ariaNextButtonLabel()" data-pc-group-section="thumbnailnavigator">
|
|
1941
|
-
@if (!galleria.nextThumbnailIconTemplate && !galleria._nextThumbnailIconTemplate()) {
|
|
1942
|
-
@if (!isVertical) {
|
|
1746
|
+
@if (!galleria.nextThumbnailIconTemplate() && !galleria._nextThumbnailIconTemplate()) {
|
|
1747
|
+
@if (!isVertical()) {
|
|
1943
1748
|
<svg data-p-icon="chevron-right" [pBind]="ptm('thumbnailNextIcon')" [class]="cx('thumbnailNextIcon')" />
|
|
1944
1749
|
}
|
|
1945
|
-
@if (isVertical) {
|
|
1750
|
+
@if (isVertical()) {
|
|
1946
1751
|
<svg data-p-icon="chevron-down" [pBind]="ptm('thumbnailNextIcon')" [class]="cx('thumbnailNextIcon')" />
|
|
1947
1752
|
}
|
|
1948
1753
|
}
|
|
1949
|
-
<ng-template *ngTemplateOutlet="galleria.nextThumbnailIconTemplate || galleria._nextThumbnailIconTemplate()"></ng-template>
|
|
1754
|
+
<ng-template *ngTemplateOutlet="galleria.nextThumbnailIconTemplate() || galleria._nextThumbnailIconTemplate()"></ng-template>
|
|
1950
1755
|
</button>
|
|
1951
1756
|
}
|
|
1952
1757
|
</div>
|
|
@@ -1959,57 +1764,66 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
1959
1764
|
standalone: false,
|
|
1960
1765
|
template: `
|
|
1961
1766
|
<div [pBind]="ptm('thumbnailContent')" [class]="cx('thumbnailContent')">
|
|
1962
|
-
@if (showThumbnailNavigators) {
|
|
1767
|
+
@if (showThumbnailNavigators()) {
|
|
1963
1768
|
<button type="button" [pBind]="ptm('thumbnailPrevButton')" [class]="cx('thumbnailPrevButton')" (click)="navBackward($event)" pRipple [attr.aria-label]="ariaPrevButtonLabel()" data-pc-group-section="thumbnailnavigator">
|
|
1964
|
-
@if (!galleria.previousThumbnailIconTemplate && !galleria._previousThumbnailIconTemplate()) {
|
|
1965
|
-
@if (!isVertical) {
|
|
1769
|
+
@if (!galleria.previousThumbnailIconTemplate() && !galleria._previousThumbnailIconTemplate()) {
|
|
1770
|
+
@if (!isVertical()) {
|
|
1966
1771
|
<svg data-p-icon="chevron-left" [pBind]="ptm('thumbnailPrevIcon')" [class]="cx('thumbnailPrevIcon')" />
|
|
1967
1772
|
}
|
|
1968
|
-
@if (isVertical) {
|
|
1773
|
+
@if (isVertical()) {
|
|
1969
1774
|
<svg data-p-icon="chevron-up" [pBind]="ptm('thumbnailPrevIcon')" [class]="cx('thumbnailPrevIcon')" />
|
|
1970
1775
|
}
|
|
1971
1776
|
}
|
|
1972
|
-
<ng-template *ngTemplateOutlet="galleria.previousThumbnailIconTemplate || galleria._previousThumbnailIconTemplate()"></ng-template>
|
|
1777
|
+
<ng-template *ngTemplateOutlet="galleria.previousThumbnailIconTemplate() || galleria._previousThumbnailIconTemplate()"></ng-template>
|
|
1973
1778
|
</button>
|
|
1974
1779
|
}
|
|
1975
|
-
<div [pBind]="ptm('thumbnailsViewport')" [class]="cx('thumbnailsViewport')" [ngStyle]="{ height: isVertical ? contentHeight : '' }">
|
|
1976
|
-
<div
|
|
1977
|
-
|
|
1780
|
+
<div [pBind]="ptm('thumbnailsViewport')" [class]="cx('thumbnailsViewport')" [ngStyle]="{ height: isVertical() ? contentHeight() : '' }">
|
|
1781
|
+
<div
|
|
1782
|
+
#itemsContainer
|
|
1783
|
+
[pBind]="ptm('thumbnailItems')"
|
|
1784
|
+
[class]="cx('thumbnailItems')"
|
|
1785
|
+
(transitionend)="onTransitionEnd()"
|
|
1786
|
+
(touchstart)="onTouchStart($event)"
|
|
1787
|
+
(touchmove)="onTouchMove($event)"
|
|
1788
|
+
(touchend)="onTouchEnd($event)"
|
|
1789
|
+
role="tablist"
|
|
1790
|
+
>
|
|
1791
|
+
@for (item of value(); track item; let index = $index) {
|
|
1978
1792
|
<div
|
|
1979
1793
|
[pBind]="ptm('thumbnailItem')"
|
|
1980
|
-
[class]="cx('thumbnailItem', { index, activeIndex })"
|
|
1981
|
-
[attr.aria-selected]="
|
|
1982
|
-
[attr.aria-controls]="containerId + '_item_' + index"
|
|
1794
|
+
[class]="cx('thumbnailItem', { index, activeIndex: _activeIndex() })"
|
|
1795
|
+
[attr.aria-selected]="_activeIndex() === index"
|
|
1796
|
+
[attr.aria-controls]="containerId() + '_item_' + index"
|
|
1983
1797
|
(keydown)="onThumbnailKeydown($event, index)"
|
|
1984
|
-
[attr.data-p-active]="
|
|
1798
|
+
[attr.data-p-active]="_activeIndex() === index"
|
|
1985
1799
|
>
|
|
1986
1800
|
<div
|
|
1987
1801
|
[pBind]="ptm('thumbnail')"
|
|
1988
1802
|
[class]="cx('thumbnail')"
|
|
1989
|
-
[attr.tabindex]="
|
|
1990
|
-
[attr.aria-current]="
|
|
1803
|
+
[attr.tabindex]="_activeIndex() === index ? 0 : -1"
|
|
1804
|
+
[attr.aria-current]="_activeIndex() === index ? 'page' : undefined"
|
|
1991
1805
|
[attr.aria-label]="ariaPageLabel(index + 1)"
|
|
1992
1806
|
(click)="onItemClick(index)"
|
|
1993
|
-
(touchend)="
|
|
1807
|
+
(touchend)="onThumbnailTouchEnd($event, index)"
|
|
1994
1808
|
(keydown.enter)="onItemClick(index)"
|
|
1995
1809
|
>
|
|
1996
|
-
<div pGalleriaItemSlot type="thumbnail" [pBind]="ptm('thumbnailItem')" [item]="item" [templates]="templates" [unstyled]="unstyled()"></div>
|
|
1810
|
+
<div pGalleriaItemSlot type="thumbnail" [pBind]="ptm('thumbnailItem')" [item]="item" [templates]="templates()" [unstyled]="unstyled()"></div>
|
|
1997
1811
|
</div>
|
|
1998
1812
|
</div>
|
|
1999
1813
|
}
|
|
2000
1814
|
</div>
|
|
2001
1815
|
</div>
|
|
2002
|
-
@if (showThumbnailNavigators) {
|
|
1816
|
+
@if (showThumbnailNavigators()) {
|
|
2003
1817
|
<button type="button" [pBind]="ptm('thumbnailNextButton')" [class]="cx('thumbnailNextButton')" (click)="navForward($event)" pRipple [attr.aria-label]="ariaNextButtonLabel()" data-pc-group-section="thumbnailnavigator">
|
|
2004
|
-
@if (!galleria.nextThumbnailIconTemplate && !galleria._nextThumbnailIconTemplate()) {
|
|
2005
|
-
@if (!isVertical) {
|
|
1818
|
+
@if (!galleria.nextThumbnailIconTemplate() && !galleria._nextThumbnailIconTemplate()) {
|
|
1819
|
+
@if (!isVertical()) {
|
|
2006
1820
|
<svg data-p-icon="chevron-right" [pBind]="ptm('thumbnailNextIcon')" [class]="cx('thumbnailNextIcon')" />
|
|
2007
1821
|
}
|
|
2008
|
-
@if (isVertical) {
|
|
1822
|
+
@if (isVertical()) {
|
|
2009
1823
|
<svg data-p-icon="chevron-down" [pBind]="ptm('thumbnailNextIcon')" [class]="cx('thumbnailNextIcon')" />
|
|
2010
1824
|
}
|
|
2011
1825
|
}
|
|
2012
|
-
<ng-template *ngTemplateOutlet="galleria.nextThumbnailIconTemplate || galleria._nextThumbnailIconTemplate()"></ng-template>
|
|
1826
|
+
<ng-template *ngTemplateOutlet="galleria.nextThumbnailIconTemplate() || galleria._nextThumbnailIconTemplate()"></ng-template>
|
|
2013
1827
|
</button>
|
|
2014
1828
|
}
|
|
2015
1829
|
</div>
|
|
@@ -2021,32 +1835,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
2021
1835
|
},
|
|
2022
1836
|
hostDirectives: [Bind]
|
|
2023
1837
|
}]
|
|
2024
|
-
}], propDecorators: { containerId: [{
|
|
2025
|
-
type: Input
|
|
2026
|
-
}], value: [{
|
|
2027
|
-
type: Input
|
|
2028
|
-
}], isVertical: [{
|
|
2029
|
-
type: Input,
|
|
2030
|
-
args: [{ transform: booleanAttribute }]
|
|
2031
|
-
}], slideShowActive: [{
|
|
2032
|
-
type: Input,
|
|
2033
|
-
args: [{ transform: booleanAttribute }]
|
|
2034
|
-
}], circular: [{
|
|
2035
|
-
type: Input,
|
|
2036
|
-
args: [{ transform: booleanAttribute }]
|
|
2037
|
-
}], responsiveOptions: [{
|
|
2038
|
-
type: Input
|
|
2039
|
-
}], contentHeight: [{
|
|
2040
|
-
type: Input
|
|
2041
|
-
}], showThumbnailNavigators: [{
|
|
2042
|
-
type: Input
|
|
2043
|
-
}], templates: [{
|
|
2044
|
-
type: Input
|
|
2045
|
-
}], onActiveIndexChange: [{ type: i0.Output, args: ["onActiveIndexChange"] }], stopSlideShow: [{ type: i0.Output, args: ["stopSlideShow"] }], itemsContainer: [{ type: i0.ViewChild, args: ['itemsContainer', { isSignal: true }] }], numVisible: [{
|
|
2046
|
-
type: Input
|
|
2047
|
-
}], activeIndex: [{
|
|
2048
|
-
type: Input
|
|
2049
|
-
}] } });
|
|
1838
|
+
}], ctorParameters: () => [], propDecorators: { containerId: [{ type: i0.Input, args: [{ isSignal: true, alias: "containerId", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], isVertical: [{ type: i0.Input, args: [{ isSignal: true, alias: "isVertical", required: false }] }], slideShowActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "slideShowActive", required: false }] }], circular: [{ type: i0.Input, args: [{ isSignal: true, alias: "circular", required: false }] }], responsiveOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsiveOptions", required: false }] }], contentHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentHeight", required: false }] }], showThumbnailNavigators: [{ type: i0.Input, args: [{ isSignal: true, alias: "showThumbnailNavigators", required: false }] }], templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }], onActiveIndexChange: [{ type: i0.Output, args: ["onActiveIndexChange"] }], stopSlideShow: [{ type: i0.Output, args: ["stopSlideShow"] }], itemsContainer: [{ type: i0.ViewChild, args: ['itemsContainer', { isSignal: true }] }], numVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "numVisible", required: false }] }], activeIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeIndex", required: false }] }] } });
|
|
2050
1839
|
class GalleriaModule {
|
|
2051
1840
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GalleriaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2052
1841
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: GalleriaModule, declarations: [Galleria, GalleriaContent, GalleriaItemSlot, GalleriaItem, GalleriaThumbnails], imports: [CommonModule, SharedModule, Ripple, TimesIcon, ChevronRightIcon, ChevronUpIcon, ChevronDownIcon, ChevronLeftIcon, FocusTrap, BindModule, MotionModule], exports: [CommonModule, Galleria, GalleriaContent, GalleriaItemSlot, GalleriaItem, GalleriaThumbnails, SharedModule] });
|