@daffodil/design 0.81.1 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/README.md +44 -29
- package/accordion/accordion/accordion/accordion.component.d.ts +3 -0
- package/accordion/accordion/accordion-item/accordion-item.component.d.ts +23 -12
- package/accordion/accordion/accordion-item-title/accordion-item-title.directive.d.ts +3 -0
- package/accordion/accordion.d.ts +5 -0
- package/accordion/examples/disabled-accordion/disabled-accordion.component.d.ts +5 -0
- package/accordion/examples/initially-expanded-accordion/initially-expanded-accordion.component.d.ts +5 -0
- package/accordion/examples/public_api.d.ts +2 -0
- package/accordion/src/accordion-theme.scss +28 -6
- package/article/README.md +4 -3
- package/article/article.d.ts +3 -0
- package/article/src/article-theme.scss +128 -51
- package/breadcrumb/README.md +38 -28
- package/breadcrumb/breadcrumb/breadcrumb.component.d.ts +15 -2
- package/breadcrumb/breadcrumb-item/breadcrumb-item.directive.d.ts +18 -4
- package/breadcrumb/breadcrumb.d.ts +3 -0
- package/breadcrumb/examples/iterated-breadcrumb/iterated-breadcrumb.component.d.ts +6 -0
- package/breadcrumb/public_api.d.ts +2 -2
- package/button/README.md +43 -23
- package/button/button/basic/button.component.d.ts +5 -1
- package/button/button/button-base.directive.d.ts +11 -3
- package/button/button/button-sizable.directive.d.ts +1 -1
- package/button/button/raised/raised.component.d.ts +2 -0
- package/button/button/stroked/stroked.component.d.ts +5 -1
- package/button/button.d.ts +4 -2
- package/button/button.module.d.ts +1 -2
- package/button/examples/elevated-button/elevated-button.component.d.ts +6 -0
- package/button/examples/examples.d.ts +2 -1
- package/button/examples/public_api.d.ts +1 -0
- package/button/public_api.d.ts +0 -1
- package/button/src/button/basic/button-theme.scss +185 -80
- package/button/src/button/button-base.scss +41 -16
- package/button/src/button/flat/flat-theme.scss +144 -85
- package/button/src/button/icon/icon-theme.scss +183 -79
- package/button/src/button/raised/raised-theme.scss +2 -7
- package/button/src/button/stroked/stroked-theme.scss +128 -94
- package/button/src/button/underline/underline-theme.scss +112 -44
- package/callout/README.md +4 -3
- package/callout/callout.d.ts +3 -0
- package/card/README.md +6 -3
- package/card/card/basic/basic.component.d.ts +7 -0
- package/card/card/raised/raised.component.d.ts +7 -0
- package/card/card/stroked/stroked.component.d.ts +7 -0
- package/card/card-base.directive.d.ts +25 -0
- package/card/card.d.ts +18 -1
- package/card/card.module.d.ts +10 -8
- package/card/examples/card-theming/card-theming.component.d.ts +2 -1
- package/card/examples/public_api.d.ts +1 -1
- package/card/public_api.d.ts +6 -1
- package/card/src/card/raised/raised-theme.scss +30 -0
- package/card/src/card/stroked/stroked-theme.scss +135 -0
- package/card/src/card-base-theme.scss +197 -0
- package/card/src/card-base.scss +134 -0
- package/container/README.md +5 -3
- package/container/container.d.ts +3 -0
- package/core/colorable/colorable.d.ts +20 -14
- package/core/colorable/colorable.directive.d.ts +9 -6
- package/fesm2022/daffodil-design-accordion-examples.mjs +28 -4
- package/fesm2022/daffodil-design-accordion-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-accordion.mjs +56 -29
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article-examples.mjs +30 -30
- package/fesm2022/daffodil-design-article.mjs +14 -11
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb-examples.mjs +24 -4
- package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs +78 -40
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button-examples.mjs +55 -33
- package/fesm2022/daffodil-design-button-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +79 -69
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout-examples.mjs +12 -12
- package/fesm2022/daffodil-design-callout-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +25 -22
- package/fesm2022/daffodil-design-callout.mjs.map +1 -1
- package/fesm2022/daffodil-design-card-examples.mjs +35 -31
- package/fesm2022/daffodil-design-card-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +140 -86
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox-examples.mjs +6 -6
- package/fesm2022/daffodil-design-checkbox-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-container-examples.mjs +3 -3
- package/fesm2022/daffodil-design-container.mjs +10 -7
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-hero-examples.mjs +12 -12
- package/fesm2022/daffodil-design-hero-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-hero.mjs +25 -22
- package/fesm2022/daffodil-design-hero.mjs.map +1 -1
- package/fesm2022/daffodil-design-image-examples.mjs +9 -9
- package/fesm2022/daffodil-design-image.mjs +36 -19
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input-examples.mjs +12 -12
- package/fesm2022/daffodil-design-link-set.mjs +19 -16
- package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
- package/fesm2022/daffodil-design-list-examples.mjs +12 -12
- package/fesm2022/daffodil-design-list.mjs +13 -10
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-loading-icon-examples.mjs +4 -4
- package/fesm2022/daffodil-design-loading-icon-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-loading-icon.mjs +11 -8
- package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery-examples.mjs +62 -13
- package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +204 -250
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu-examples.mjs +6 -6
- package/fesm2022/daffodil-design-menu-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +16 -16
- package/fesm2022/daffodil-design-modal-examples.mjs +7 -7
- package/fesm2022/daffodil-design-modal-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +28 -25
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar-examples.mjs +12 -12
- package/fesm2022/daffodil-design-navbar-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar.mjs +10 -7
- package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification-examples.mjs +17 -16
- package/fesm2022/daffodil-design-notification-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +23 -20
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator-examples.mjs +6 -6
- package/fesm2022/daffodil-design-paginator.mjs +13 -7
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar-examples.mjs +10 -10
- package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +13 -13
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field-examples.mjs +12 -12
- package/fesm2022/daffodil-design-radio-examples.mjs +3 -3
- package/fesm2022/daffodil-design-sidebar-examples.mjs +14 -14
- package/fesm2022/daffodil-design-sidebar-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +150 -61
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch-examples.mjs +15 -15
- package/fesm2022/daffodil-design-switch-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch.mjs +38 -10
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs-examples.mjs +23 -17
- package/fesm2022/daffodil-design-tabs-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +67 -35
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-text-snippet-examples.mjs +3 -3
- package/fesm2022/daffodil-design-text-snippet.mjs +4 -5
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast-examples.mjs +40 -15
- package/fesm2022/daffodil-design-toast-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +296 -239
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree-examples.mjs +6 -6
- package/fesm2022/daffodil-design-tree.mjs +15 -12
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design-youtube-player.mjs +104 -0
- package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -0
- package/fesm2022/daffodil-design.mjs +167 -155
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/hero/README.md +4 -3
- package/hero/hero.d.ts +3 -0
- package/image/README.md +4 -3
- package/image/image/image.component.d.ts +22 -1
- package/image/image.d.ts +3 -0
- package/link-set/README.md +4 -3
- package/link-set/link-set.d.ts +3 -0
- package/list/README.md +4 -3
- package/list/list.d.ts +3 -0
- package/loading-icon/README.md +10 -7
- package/loading-icon/loading-icon.d.ts +3 -0
- package/loading-icon/src/loading-icon-theme.scss +66 -38
- package/media-gallery/README.md +19 -10
- package/media-gallery/examples/iterated-media-gallery/iterated-media-gallery.component.d.ts +13 -0
- package/media-gallery/examples/media-gallery-with-video/media-gallery-with-video.component.d.ts +5 -0
- package/media-gallery/examples/public_api.d.ts +2 -0
- package/media-gallery/helpers/media-gallery-registration.interface.d.ts +1 -1
- package/media-gallery/media-gallery/media-gallery.component.d.ts +89 -11
- package/media-gallery/media-gallery.d.ts +4 -2
- package/media-gallery/media-gallery.module.d.ts +1 -2
- package/media-gallery/public_api.d.ts +3 -4
- package/media-gallery/src/media-gallery-theme.scss +30 -4
- package/media-gallery/thumbnail/thumbnail.directive.d.ts +45 -22
- package/menu/README.md +1 -2
- package/modal/README.md +3 -2
- package/modal/modal.d.ts +3 -0
- package/navbar/README.md +3 -2
- package/navbar/navbar.d.ts +3 -0
- package/notification/README.md +5 -4
- package/notification/notification.d.ts +3 -0
- package/notification/src/notification-theme.scss +62 -23
- package/package.json +1 -1
- package/paginator/README.md +3 -2
- package/paginator/paginator/paginator.component.d.ts +3 -0
- package/paginator/paginator.d.ts +3 -0
- package/progress-bar/README.md +5 -6
- package/progress-bar/progress-bar.component.d.ts +0 -3
- package/progress-bar/progress-bar.d.ts +3 -0
- package/progress-bar/src/progress-bar-theme.scss +17 -8
- package/scss/theme.scss +36 -17
- package/scss/theming/_configure-theme.scss +2 -0
- package/scss/theming/_index.scss +1 -0
- package/scss/theming/_light-dark.scss +45 -0
- package/sidebar/README.md +20 -21
- package/sidebar/helper/sidebar-mode.d.ts +9 -15
- package/sidebar/public_api.d.ts +10 -11
- package/sidebar/sidebar/sidebar.component.d.ts +22 -7
- package/sidebar/sidebar-footer/sidebar-footer.component.d.ts +11 -0
- package/sidebar/sidebar-header/sidebar-header-title/sidebar-header-title.directive.d.ts +8 -0
- package/sidebar/sidebar-header/sidebar-header.component.d.ts +19 -1
- package/sidebar/sidebar-viewport/sidebar-viewport.component.d.ts +36 -15
- package/sidebar/sidebar-viewport-backdrop/sidebar-viewport-backdrop.component.d.ts +17 -0
- package/sidebar/sidebar.d.ts +4 -2
- package/sidebar/sidebar.module.d.ts +1 -2
- package/switch/README.md +3 -2
- package/switch/src/switch-theme.scss +29 -10
- package/switch/switch/switch.component.d.ts +31 -6
- package/switch/switch.d.ts +3 -0
- package/tabs/README.md +33 -3
- package/tabs/src/tabs-theme.scss +31 -13
- package/tabs/tabs/tab/tab.component.d.ts +1 -1
- package/tabs/tabs/tab-label/tab-label.component.d.ts +6 -0
- package/tabs/tabs/tab-panel/tab-panel.component.d.ts +8 -0
- package/tabs/tabs/tabs.component.d.ts +21 -4
- package/tabs/tabs.d.ts +8 -2
- package/text-snippet/README.md +19 -1
- package/toast/README.md +21 -151
- package/toast/examples/dismissible-toast/dismissible-toast.component.d.ts +11 -0
- package/toast/examples/public_api.d.ts +2 -1
- package/toast/interfaces/toast-action.d.ts +22 -11
- package/toast/interfaces/toast-action.type.d.ts +10 -0
- package/toast/interfaces/toast.d.ts +11 -5
- package/toast/options/daff-toast-options.d.ts +2 -1
- package/toast/public_api.d.ts +2 -6
- package/toast/service/position.service.d.ts +9 -1
- package/toast/service/toast.service.d.ts +63 -0
- package/toast/src/toast-theme.scss +80 -33
- package/toast/toast/toast-config.d.ts +24 -1
- package/toast/toast/toast-provider.d.ts +16 -0
- package/toast/toast/toast.component.d.ts +20 -1
- package/toast/toast-actions/toast-actions.directive.d.ts +3 -0
- package/toast/toast-message/toast-message.directive.d.ts +3 -0
- package/toast/toast-title/toast-title.directive.d.ts +3 -0
- package/tree/README.md +6 -10
- package/tree/src/tree-theme.scss +39 -13
- package/tree/tree.d.ts +3 -0
- package/youtube-player/index.d.ts +1 -0
- package/youtube-player/public_api.d.ts +3 -0
- package/youtube-player/safe-url.pipe.d.ts +10 -0
- package/youtube-player/youtube-player.component.d.ts +23 -0
- package/youtube-player/youtube-player.d.ts +6 -0
- package/card/card/card.component.d.ts +0 -48
- package/card/src/card-theme-variants/basic-card.scss +0 -6
- package/card/src/card-theme-variants/linkable-card.scss +0 -16
- package/card/src/card-theme-variants/stroked-card.scss +0 -3
- package/card/src/card-theme.scss +0 -170
- package/media-gallery/media-renderer/media-renderer.component.d.ts +0 -29
- package/media-gallery/registry/media-gallery.registry.d.ts +0 -34
- package/media-gallery/thumbnail/thumbnail-compat.token.d.ts +0 -1
- package/media-gallery/thumbnail/thumbnail-registration.interface.d.ts +0 -9
- package/scss/theming/prebuilt/internal-theme.scss +0 -13
- package/toast/toast.module.d.ts +0 -19
@@ -1,11 +1,9 @@
|
|
1
|
+
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
1
2
|
import * as i0 from '@angular/core';
|
2
|
-
import {
|
3
|
-
import * as
|
3
|
+
import { isDevMode, Directive, Inject, Input, EventEmitter, contentChildren, computed, signal, ElementRef, Component, ChangeDetectionStrategy, HostBinding, Output, ViewChildren, NgModule } from '@angular/core';
|
4
|
+
import * as i1 from '@daffodil/design';
|
4
5
|
import { DaffSelectableDirective, DaffArticleEncapsulatedDirective, DaffSkeletonableDirective } from '@daffodil/design';
|
5
6
|
import { createSingleInjectionToken } from '@daffodil/core';
|
6
|
-
import { BehaviorSubject, Subject } from 'rxjs';
|
7
|
-
import { takeUntil } from 'rxjs/operators';
|
8
|
-
import { CommonModule } from '@angular/common';
|
9
7
|
|
10
8
|
const { token: DAFF_MEDIA_GALLERY_TOKEN,
|
11
9
|
/**
|
@@ -13,279 +11,223 @@ const { token: DAFF_MEDIA_GALLERY_TOKEN,
|
|
13
11
|
*/
|
14
12
|
provider: provideDaffMediaGalleryToken, } = createSingleInjectionToken('DAFF_MEDIA_GALLERY_TOKEN');
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
let uniqueThumbnailId = 0;
|
15
|
+
/**
|
16
|
+
* DaffThumbnailDirective is a structural directive used to mark elements as thumbnails within the `DaffMediaGalleryComponent`.
|
17
|
+
*
|
18
|
+
* ```html
|
19
|
+
* <ng-template daffThumbnail></ng-template>
|
20
|
+
* ```
|
21
|
+
*/
|
22
|
+
class DaffThumbnailDirective {
|
21
23
|
/**
|
22
|
-
* @
|
23
|
-
*
|
24
|
+
* @docs-private
|
25
|
+
*
|
26
|
+
* The autogenerated unique id for a thumbnail.
|
24
27
|
*/
|
25
|
-
|
26
|
-
|
27
|
-
let newGallery = this.galleries[gallery.name].getValue();
|
28
|
-
if (thumbnail) {
|
29
|
-
newGallery = {
|
30
|
-
...newGallery,
|
31
|
-
thumbnails: [
|
32
|
-
...newGallery.thumbnails.filter(t => t !== thumbnail),
|
33
|
-
thumbnail,
|
34
|
-
],
|
35
|
-
};
|
36
|
-
}
|
37
|
-
this.galleries[gallery.name].next(newGallery);
|
38
|
-
}
|
39
|
-
else {
|
40
|
-
this.galleries[gallery.name] = new BehaviorSubject({
|
41
|
-
gallery,
|
42
|
-
thumbnails: thumbnail ? [thumbnail] : [],
|
43
|
-
});
|
44
|
-
}
|
45
|
-
if (this.galleries[gallery.name].getValue().thumbnails.length === 1) {
|
46
|
-
thumbnail.select();
|
47
|
-
}
|
28
|
+
get id() {
|
29
|
+
return this.gallery.id + '-thumbnail-' + this._increment;
|
48
30
|
}
|
49
31
|
/**
|
50
|
-
* @
|
51
|
-
*
|
32
|
+
* @docs-private
|
33
|
+
*
|
34
|
+
* The unique id of the selected thumbnail.
|
52
35
|
*/
|
53
|
-
|
54
|
-
|
55
|
-
this.removeGallery(element);
|
56
|
-
}
|
57
|
-
else {
|
58
|
-
this.removeThumbnail(element);
|
59
|
-
}
|
60
|
-
}
|
61
|
-
removeThumbnail(thumbnail) {
|
62
|
-
if (!this.galleries[thumbnail.gallery.name]) {
|
63
|
-
return;
|
64
|
-
}
|
65
|
-
const gallery = this.galleries[thumbnail.gallery.name].getValue();
|
66
|
-
const index = gallery.thumbnails.indexOf(thumbnail);
|
67
|
-
if (index === -1) {
|
68
|
-
return;
|
69
|
-
}
|
70
|
-
this.galleries[thumbnail.gallery.name].next({
|
71
|
-
...gallery,
|
72
|
-
thumbnails: [
|
73
|
-
...gallery.thumbnails.slice(0, index),
|
74
|
-
...gallery.thumbnails.slice(index + 1),
|
75
|
-
],
|
76
|
-
});
|
77
|
-
}
|
78
|
-
removeGallery(gallery) {
|
79
|
-
delete this.galleries[gallery.name];
|
36
|
+
get selectedThumbnailId() {
|
37
|
+
return this.id + '-selected';
|
80
38
|
}
|
39
|
+
constructor(
|
81
40
|
/**
|
82
|
-
* @
|
83
|
-
* Selects a media element for a given gallery.
|
41
|
+
* @docs-private
|
84
42
|
*/
|
85
|
-
|
86
|
-
if (!this.galleries[thumbnail.gallery.name]) {
|
87
|
-
return;
|
88
|
-
}
|
89
|
-
const gallery = this.galleries[thumbnail.gallery.name].getValue();
|
90
|
-
const index = gallery.thumbnails.indexOf(thumbnail);
|
91
|
-
if (thumbnail.selected || index === -1) {
|
92
|
-
return;
|
93
|
-
}
|
94
|
-
this.galleries[thumbnail.gallery.name].next({
|
95
|
-
...gallery,
|
96
|
-
thumbnails: [
|
97
|
-
...gallery.thumbnails.filter(m => m !== thumbnail).map(m => m.deselect()),
|
98
|
-
thumbnail.select(),
|
99
|
-
],
|
100
|
-
});
|
101
|
-
}
|
102
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
103
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryRegistry, providedIn: 'root' }); }
|
104
|
-
}
|
105
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryRegistry, decorators: [{
|
106
|
-
type: Injectable,
|
107
|
-
args: [{ providedIn: 'root' }]
|
108
|
-
}] });
|
109
|
-
|
110
|
-
/**
|
111
|
-
* Dynamically renders the selected `DaffThumbnailDirective` in a `daff-media-gallery` any time the selected thumbnail
|
112
|
-
* changes.
|
113
|
-
*/
|
114
|
-
class DaffMediaRendererComponent {
|
115
|
-
constructor(componentFactoryResolver, registry, gallery) {
|
116
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
117
|
-
this.registry = registry;
|
118
|
-
this.gallery = gallery;
|
119
|
-
/**
|
120
|
-
* Private tracker for indicating when the component is destroyed.
|
121
|
-
*/
|
122
|
-
this._destroy$ = new Subject();
|
123
|
-
}
|
124
|
-
ngOnInit() {
|
125
|
-
this.registry.galleries[this.gallery.name]
|
126
|
-
.pipe(takeUntil(this._destroy$))
|
127
|
-
.subscribe((gallery) => {
|
128
|
-
/**
|
129
|
-
* Clear out the slot for the dynamically rendered thumbnail
|
130
|
-
*/
|
131
|
-
this.slot.clear();
|
132
|
-
const _selectedThumbnail = gallery.thumbnails.filter(media => media.selected).shift();
|
133
|
-
/**
|
134
|
-
* If there's no selected media, render nothing.
|
135
|
-
*/
|
136
|
-
if (!_selectedThumbnail) {
|
137
|
-
return;
|
138
|
-
}
|
139
|
-
const _selectedThumbnailComponent = _selectedThumbnail.component;
|
140
|
-
/**
|
141
|
-
* Create the component to insert.
|
142
|
-
*/
|
143
|
-
const component = this.componentFactoryResolver.resolveComponentFactory(_selectedThumbnailComponent.constructor);
|
144
|
-
const componentRef = this.slot.createComponent(component);
|
145
|
-
/**
|
146
|
-
* Fill the component with it's values from the original component
|
147
|
-
*/
|
148
|
-
component.inputs.forEach(input => {
|
149
|
-
componentRef.instance[input.propName] = _selectedThumbnailComponent[input.propName];
|
150
|
-
});
|
151
|
-
/**
|
152
|
-
* Trigger a change detection on the component tree, outside the cycle to address
|
153
|
-
* the fact that the component was created outside a typical CD loop.
|
154
|
-
*/
|
155
|
-
componentRef.changeDetectorRef.detectChanges();
|
156
|
-
});
|
157
|
-
}
|
43
|
+
gallery,
|
158
44
|
/**
|
159
|
-
*
|
45
|
+
* @docs-private
|
160
46
|
*/
|
161
|
-
|
162
|
-
this._destroy$.next(true);
|
163
|
-
this._destroy$.unsubscribe();
|
164
|
-
}
|
165
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaRendererComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: DaffMediaGalleryRegistry }, { token: DAFF_MEDIA_GALLERY_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
166
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: DaffMediaRendererComponent, isStandalone: true, selector: "daff-media-renderer", viewQueries: [{ propertyName: "slot", first: true, predicate: TemplateRef, descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: '<ng-template></ng-template>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
167
|
-
}
|
168
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaRendererComponent, decorators: [{
|
169
|
-
type: Component,
|
170
|
-
args: [{
|
171
|
-
selector: 'daff-media-renderer',
|
172
|
-
template: '<ng-template></ng-template>',
|
173
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
174
|
-
standalone: true,
|
175
|
-
}]
|
176
|
-
}], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: DaffMediaGalleryRegistry }, { type: undefined, decorators: [{
|
177
|
-
type: Inject,
|
178
|
-
args: [DAFF_MEDIA_GALLERY_TOKEN]
|
179
|
-
}] }], propDecorators: { slot: [{
|
180
|
-
type: ViewChild,
|
181
|
-
args: [TemplateRef, { static: true, read: ViewContainerRef }]
|
182
|
-
}] } });
|
183
|
-
|
184
|
-
const {
|
185
|
-
/**
|
186
|
-
* A multi provider injection token that marks a component as renderable for the `DaffMediaRendererComponent`.
|
187
|
-
*/
|
188
|
-
token: daffThumbnailCompatToken,
|
189
|
-
/**
|
190
|
-
* Provider function for {@link daffThumbnailCompatToken}.
|
191
|
-
*/
|
192
|
-
provider: provideDaffThumbnailCompatToken, } = createSingleInjectionToken('thumbnailCompatToken');
|
193
|
-
|
194
|
-
/**
|
195
|
-
* A directive marking thumbnails for the `DaffMediaRendererComponent`. Needs to be wrapped in a `daff-media-gallery` component
|
196
|
-
* and needs to be placed on a component that is provided as a `daffThumbnailCompatToken`.
|
197
|
-
*/
|
198
|
-
class DaffThumbnailDirective {
|
199
|
-
constructor(component, registry, gallery, selectedDirective) {
|
200
|
-
this.component = component;
|
201
|
-
this.registry = registry;
|
47
|
+
templateRef) {
|
202
48
|
this.gallery = gallery;
|
203
|
-
this.
|
49
|
+
this.templateRef = templateRef;
|
50
|
+
this._increment = uniqueThumbnailId;
|
204
51
|
/**
|
205
|
-
*
|
52
|
+
* The file path to a thumbnail, presumably an image.
|
206
53
|
*/
|
207
|
-
this.
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
this.
|
214
|
-
|
215
|
-
}
|
216
|
-
deselect() {
|
217
|
-
this.selectedDirective.deselect();
|
218
|
-
return this;
|
54
|
+
this.thumbnailSrc = undefined;
|
55
|
+
/**
|
56
|
+
* Provides an accessible label for a thumbnail.
|
57
|
+
*/
|
58
|
+
this.label = undefined;
|
59
|
+
/** Indicates whether the thumbnail represents a video. */
|
60
|
+
this.isVideo = false;
|
61
|
+
uniqueThumbnailId++;
|
219
62
|
}
|
220
63
|
/**
|
221
|
-
*
|
222
|
-
*
|
223
|
-
* @param event: MouseEvent
|
64
|
+
* @docs-private
|
224
65
|
*/
|
225
|
-
onClick($event) {
|
226
|
-
this.registry.select(this);
|
227
|
-
}
|
228
66
|
ngOnInit() {
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
this.registry.remove(this);
|
67
|
+
if (!this.label && isDevMode()) {
|
68
|
+
console.warn('The thumbnail ' + this.id + ' is missing a label.');
|
69
|
+
}
|
233
70
|
}
|
234
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
235
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.
|
71
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffThumbnailDirective, deps: [{ token: DAFF_MEDIA_GALLERY_TOKEN }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
72
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.5", type: DaffThumbnailDirective, isStandalone: true, selector: "[daffThumbnail]", inputs: { thumbnailSrc: "thumbnailSrc", label: "label", isVideo: "isVideo" }, ngImport: i0 }); }
|
236
73
|
}
|
237
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffThumbnailDirective, decorators: [{
|
238
75
|
type: Directive,
|
239
76
|
args: [{
|
240
77
|
selector: '[daffThumbnail]',
|
241
|
-
standalone: true,
|
242
|
-
hostDirectives: [{
|
243
|
-
directive: DaffSelectableDirective,
|
244
|
-
inputs: ['selected'],
|
245
|
-
outputs: ['becameSelected'],
|
246
|
-
}],
|
247
78
|
}]
|
248
|
-
}], ctorParameters: () => [{ type:
|
249
|
-
type: Inject,
|
250
|
-
args: [daffThumbnailCompatToken]
|
251
|
-
}] }, { type: DaffMediaGalleryRegistry }, { type: undefined, decorators: [{
|
79
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
252
80
|
type: Inject,
|
253
81
|
args: [DAFF_MEDIA_GALLERY_TOKEN]
|
254
|
-
}] }, { type:
|
255
|
-
type:
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
82
|
+
}] }, { type: i0.TemplateRef }], propDecorators: { thumbnailSrc: [{
|
83
|
+
type: Input
|
84
|
+
}], label: [{
|
85
|
+
type: Input
|
86
|
+
}], isVideo: [{
|
87
|
+
type: Input
|
260
88
|
}] } });
|
261
89
|
|
262
90
|
let uniqueGalleryId = 0;
|
91
|
+
/**
|
92
|
+
* The `DaffMediaGalleryComonent` is used to display a group of thumbnails in a gallery format.
|
93
|
+
*
|
94
|
+
* ```html
|
95
|
+
* <daff-media-gallery>
|
96
|
+
* <ng-template daffThumbnail thumbnailSrc="/thumbnail-path.jpg" label="Your description">
|
97
|
+
* <daff-image src="/image-path.jpg" alt="Your description" width="100" height="100"></daff-image>
|
98
|
+
* </ng-template>
|
99
|
+
* </daff-media-gallery>
|
100
|
+
* ```
|
101
|
+
*/
|
263
102
|
class DaffMediaGalleryComponent {
|
264
|
-
|
265
|
-
|
103
|
+
/**
|
104
|
+
* Custom ID for the media gallery that overrides the auto-generated one. When using this input, it is your responsibility to ensure that the ID is unique.
|
105
|
+
*/
|
106
|
+
get id() {
|
107
|
+
return this._id;
|
108
|
+
}
|
109
|
+
set id(val) {
|
110
|
+
if (!val) {
|
111
|
+
return;
|
112
|
+
}
|
113
|
+
this._id = val;
|
114
|
+
}
|
115
|
+
;
|
116
|
+
/**
|
117
|
+
* @docs-private
|
118
|
+
*/
|
119
|
+
constructor(skeletonDirective) {
|
120
|
+
this.skeletonDirective = skeletonDirective;
|
121
|
+
/**
|
122
|
+
* @docs-private
|
123
|
+
*/
|
124
|
+
this.role = 'tablist';
|
266
125
|
/**
|
126
|
+
* The internal ID of the gallery.
|
127
|
+
*/
|
128
|
+
this._id = 'media-gallery-' + uniqueGalleryId;
|
129
|
+
/**
|
130
|
+
* @docs-private
|
131
|
+
*
|
267
132
|
* Adds a class for styling the media gallery
|
268
133
|
*/
|
269
134
|
this.class = true;
|
270
135
|
/**
|
271
|
-
*
|
136
|
+
* An event indicating that the selected media gallery element has changed.
|
137
|
+
*/
|
138
|
+
this.elementChange = new EventEmitter();
|
139
|
+
/**
|
140
|
+
* @docs-private
|
272
141
|
*/
|
273
|
-
this.
|
142
|
+
this._thumbnails = contentChildren(DaffThumbnailDirective);
|
143
|
+
/**
|
144
|
+
* @docs-private
|
145
|
+
*/
|
146
|
+
this._selectedThumbnail = computed(() => {
|
147
|
+
const idx = this._selectedIndex();
|
148
|
+
if (!idx) {
|
149
|
+
return this._thumbnails().at(0);
|
150
|
+
}
|
151
|
+
return this._thumbnails().at(idx);
|
152
|
+
});
|
153
|
+
this._selectedIndex = signal(null);
|
274
154
|
uniqueGalleryId++;
|
275
155
|
}
|
276
|
-
|
277
|
-
|
156
|
+
/**
|
157
|
+
* @docs-private
|
158
|
+
*
|
159
|
+
* Whether or not the component its currently displaying its skeleton state.
|
160
|
+
*/
|
161
|
+
get skeleton() {
|
162
|
+
return this.skeletonDirective.skeleton;
|
163
|
+
}
|
164
|
+
focusSelected() {
|
165
|
+
this._thumbnailButtons.get(this._selectedIndex())?.nativeElement.focus();
|
166
|
+
}
|
167
|
+
/**
|
168
|
+
* Select a specific entry in the media gallery by its index.
|
169
|
+
*
|
170
|
+
* @param index The index to set, starting at 0.
|
171
|
+
*/
|
172
|
+
selectIndex(index) {
|
173
|
+
this._selectedIndex.set(index);
|
174
|
+
this.elementChange.emit(index);
|
175
|
+
}
|
176
|
+
/**
|
177
|
+
* Navigate to the next element in the list of thumbnails.
|
178
|
+
*
|
179
|
+
* @param focus Whether to move focus to the newly selected item.
|
180
|
+
*/
|
181
|
+
next(focus = true) {
|
182
|
+
this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);
|
183
|
+
this.elementChange.emit(this._selectedIndex());
|
184
|
+
if (focus) {
|
185
|
+
this.focusSelected();
|
186
|
+
}
|
278
187
|
}
|
279
|
-
|
280
|
-
|
188
|
+
/**
|
189
|
+
* Navigate to the previous element in the list of thumbnails.
|
190
|
+
*
|
191
|
+
* @param focus Whether to move focus to the newly selected item.
|
192
|
+
*/
|
193
|
+
previous(focus = true) {
|
194
|
+
this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);
|
195
|
+
this.elementChange.emit(this._selectedIndex());
|
196
|
+
if (focus) {
|
197
|
+
this.focusSelected();
|
198
|
+
}
|
281
199
|
}
|
282
|
-
/**
|
283
|
-
|
200
|
+
/**
|
201
|
+
* Select the first element.
|
202
|
+
*
|
203
|
+
* @param focus Whether to move focus to the newly selected item.
|
204
|
+
*/
|
205
|
+
selectFirst(focus = true) {
|
206
|
+
this._selectedIndex.set(0);
|
207
|
+
this.elementChange.emit(this._selectedIndex());
|
208
|
+
if (focus) {
|
209
|
+
this.focusSelected();
|
210
|
+
}
|
211
|
+
}
|
212
|
+
/**
|
213
|
+
* Select the last element of the gallery.
|
214
|
+
*
|
215
|
+
* @param Whether to move focus to the newly selected item.
|
216
|
+
*/
|
217
|
+
selectLast(focus = true) {
|
218
|
+
this._selectedIndex.set(this._thumbnails().length - 1);
|
219
|
+
this.elementChange.emit(this._selectedIndex());
|
220
|
+
if (focus) {
|
221
|
+
this.focusSelected();
|
222
|
+
}
|
223
|
+
}
|
224
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryComponent, deps: [{ token: i1.DaffSkeletonableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
|
225
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: DaffMediaGalleryComponent, isStandalone: true, selector: "daff-media-gallery", inputs: { id: "id" }, outputs: { elementChange: "elementChange" }, host: { properties: { "attr.role": "this.role", "attr.id": "this.id", "class.daff-media-gallery": "this.class" } }, providers: [
|
284
226
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
285
227
|
{ provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },
|
286
|
-
], hostDirectives: [{ directive:
|
228
|
+
], queries: [{ propertyName: "_thumbnails", predicate: DaffThumbnailDirective, isSignal: true }], viewQueries: [{ propertyName: "_thumbnailButtons", predicate: ["thumbnailButtons"], descendants: true, read: ElementRef }], hostDirectives: [{ directive: i1.DaffArticleEncapsulatedDirective }, { directive: i1.DaffSkeletonableDirective, inputs: ["skeleton", "skeleton"] }], ngImport: i0, template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl>\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column;gap:.5rem}@media (min-width: 1024px){:host(.daff-media-gallery){flex-direction:row}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:flex;flex-direction:row;justify-content:center;align-items:center;height:4rem;width:4rem;max-width:100%;overflow:hidden;user-select:none;padding:0;position:relative;flex-shrink:0}@media (min-width: 480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:4.5rem;width:4.5rem}}@media (min-width: 1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{flex-direction:column;height:5rem;width:5rem}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail img{display:block;width:100%}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4rem;width:4rem;position:absolute;top:0;left:0}@media (min-width: 480px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4.5rem;width:4.5rem;position:absolute;top:0;left:0}}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:5rem;width:5rem;position:absolute;top:0;left:0}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{display:flex;position:relative;flex-grow:1}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:100%;width:100%;position:absolute;top:0;left:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:16rem}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:30rem}}.daff-media-gallery__thumbnails{display:flex;flex-direction:row;flex-shrink:0;gap:.25rem;order:2;max-width:100%;overflow-x:auto}@media (min-width: 1024px){.daff-media-gallery__thumbnails{max-height:29.5rem;flex-direction:column;overflow-y:auto;order:1}}.daff-media-gallery__selected-thumbnail{display:flex;align-items:center;justify-content:center;flex-grow:1;width:100%;order:1}@media (min-width: 1024px){.daff-media-gallery__selected-thumbnail{order:2;margin:0}}.daff-media-gallery__video-button{width:2rem;height:2rem;border-radius:100%;position:absolute}.daff-media-gallery__video-button:after{content:\"\";position:absolute;width:.75rem;height:.75rem;left:60%;top:50%;transform:translate(-60%,-50%) rotate(90deg);clip-path:polygon(50% 15%,0% 100%,100% 100%);transition:all .4s ease-in-out}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DaffSelectableDirective, selector: "[daffSelected]", inputs: ["selected"], outputs: ["becameSelected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
287
229
|
}
|
288
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryComponent, decorators: [{
|
289
231
|
type: Component,
|
290
232
|
args: [{ selector: 'daff-media-gallery', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
291
233
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
@@ -297,36 +239,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
|
|
297
239
|
inputs: ['skeleton'],
|
298
240
|
},
|
299
241
|
], imports: [
|
300
|
-
DaffMediaRendererComponent,
|
301
242
|
DaffThumbnailDirective,
|
302
|
-
|
303
|
-
|
243
|
+
NgTemplateOutlet,
|
244
|
+
DaffSelectableDirective,
|
245
|
+
], template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl>\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column;gap:.5rem}@media (min-width: 1024px){:host(.daff-media-gallery){flex-direction:row}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:flex;flex-direction:row;justify-content:center;align-items:center;height:4rem;width:4rem;max-width:100%;overflow:hidden;user-select:none;padding:0;position:relative;flex-shrink:0}@media (min-width: 480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:4.5rem;width:4.5rem}}@media (min-width: 1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{flex-direction:column;height:5rem;width:5rem}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail img{display:block;width:100%}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4rem;width:4rem;position:absolute;top:0;left:0}@media (min-width: 480px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4.5rem;width:4.5rem;position:absolute;top:0;left:0}}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:5rem;width:5rem;position:absolute;top:0;left:0}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{display:flex;position:relative;flex-grow:1}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:100%;width:100%;position:absolute;top:0;left:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:16rem}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:30rem}}.daff-media-gallery__thumbnails{display:flex;flex-direction:row;flex-shrink:0;gap:.25rem;order:2;max-width:100%;overflow-x:auto}@media (min-width: 1024px){.daff-media-gallery__thumbnails{max-height:29.5rem;flex-direction:column;overflow-y:auto;order:1}}.daff-media-gallery__selected-thumbnail{display:flex;align-items:center;justify-content:center;flex-grow:1;width:100%;order:1}@media (min-width: 1024px){.daff-media-gallery__selected-thumbnail{order:2;margin:0}}.daff-media-gallery__video-button{width:2rem;height:2rem;border-radius:100%;position:absolute}.daff-media-gallery__video-button:after{content:\"\";position:absolute;width:.75rem;height:.75rem;left:60%;top:50%;transform:translate(-60%,-50%) rotate(90deg);clip-path:polygon(50% 15%,0% 100%,100% 100%);transition:all .4s ease-in-out}\n"] }]
|
246
|
+
}], ctorParameters: () => [{ type: i1.DaffSkeletonableDirective }], propDecorators: { role: [{
|
304
247
|
type: HostBinding,
|
305
|
-
args: ['
|
306
|
-
}],
|
248
|
+
args: ['attr.role']
|
249
|
+
}], id: [{
|
250
|
+
type: HostBinding,
|
251
|
+
args: ['attr.id']
|
252
|
+
}, {
|
307
253
|
type: Input
|
254
|
+
}], class: [{
|
255
|
+
type: HostBinding,
|
256
|
+
args: ['class.daff-media-gallery']
|
257
|
+
}], elementChange: [{
|
258
|
+
type: Output
|
259
|
+
}], _thumbnailButtons: [{
|
260
|
+
type: ViewChildren,
|
261
|
+
args: ['thumbnailButtons', { read: ElementRef }]
|
308
262
|
}] } });
|
309
263
|
|
310
264
|
/**
|
311
265
|
* @deprecated in favor of {@link DAFF_MEDIA_GALLERY_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
|
312
266
|
*/
|
313
267
|
class DaffMediaGalleryModule {
|
314
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
315
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
268
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
269
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryModule, imports: [CommonModule,
|
316
270
|
DaffMediaGalleryComponent,
|
317
|
-
DaffThumbnailDirective,
|
318
|
-
DaffMediaRendererComponent], exports: [DaffMediaGalleryComponent,
|
271
|
+
DaffThumbnailDirective], exports: [DaffMediaGalleryComponent,
|
319
272
|
DaffThumbnailDirective] }); }
|
320
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
273
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryModule, imports: [CommonModule] }); }
|
321
274
|
}
|
322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
275
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryModule, decorators: [{
|
323
276
|
type: NgModule,
|
324
277
|
args: [{
|
325
278
|
imports: [
|
326
279
|
CommonModule,
|
327
280
|
DaffMediaGalleryComponent,
|
328
281
|
DaffThumbnailDirective,
|
329
|
-
DaffMediaRendererComponent,
|
330
282
|
],
|
331
283
|
exports: [
|
332
284
|
DaffMediaGalleryComponent,
|
@@ -335,15 +287,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
|
|
335
287
|
}]
|
336
288
|
}] });
|
337
289
|
|
290
|
+
/**
|
291
|
+
* @docs-private
|
292
|
+
*/
|
338
293
|
const DAFF_MEDIA_GALLERY_COMPONENTS = [
|
339
294
|
DaffMediaGalleryComponent,
|
340
295
|
DaffThumbnailDirective,
|
341
|
-
DaffMediaRendererComponent,
|
342
296
|
];
|
343
297
|
|
344
298
|
/**
|
345
299
|
* Generated bundle index. Do not edit.
|
346
300
|
*/
|
347
301
|
|
348
|
-
export { DAFF_MEDIA_GALLERY_COMPONENTS, DaffMediaGalleryComponent, DaffMediaGalleryModule, DaffThumbnailDirective
|
302
|
+
export { DAFF_MEDIA_GALLERY_COMPONENTS, DaffMediaGalleryComponent, DaffMediaGalleryModule, DaffThumbnailDirective };
|
349
303
|
//# sourceMappingURL=daffodil-design-media-gallery.mjs.map
|