@daffodil/design 0.82.0 → 0.84.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/src/accordion-theme.scss +28 -6
- package/article/src/article-theme.scss +118 -64
- package/atoms/form/checkbox/cva/checkbox-cva.directive.d.ts +3 -0
- package/atoms/form/error-message/error-message.component.d.ts +4 -1
- package/atoms/form/error-message/error-message.module.d.ts +4 -1
- package/atoms/form/form-field/form-field/form-field.component.d.ts +23 -29
- package/atoms/form/form-field/form-field-control.d.ts +18 -4
- package/atoms/form/form-field/form-field-state.d.ts +7 -0
- package/atoms/form/form-field/form-field.d.ts +10 -0
- package/atoms/form/form-field/form-field.module.d.ts +6 -4
- package/atoms/form/form-field/public_api.d.ts +2 -1
- package/atoms/form/form-label/form-label.directive.d.ts +4 -1
- package/atoms/form/form-label/form-label.module.d.ts +4 -1
- package/atoms/form/hint/hint.component.d.ts +9 -0
- package/atoms/form/hint/public_api.d.ts +1 -0
- package/atoms/form/input/input.component.d.ts +15 -19
- package/atoms/form/input/input.module.d.ts +4 -2
- package/atoms/form/native-select/native-select.component.d.ts +5 -1
- package/atoms/form/quantity-field/quantity-field.component.d.ts +2 -1
- package/atoms/form/quantity-field/quantity-field.module.d.ts +3 -3
- package/atoms/form/quantity-field/quantity-input/quantity-input.component.d.ts +3 -0
- package/atoms/form/radio/cva/radio-cva.directive.d.ts +3 -0
- package/breadcrumb/breadcrumb/breadcrumb.component.d.ts +3 -0
- package/breadcrumb/src/breadcrumb-theme.scss +12 -3
- package/button/button/button-base.directive.d.ts +6 -23
- package/button/src/button/basic/button-theme.scss +17 -40
- package/button/src/button/button-base.scss +32 -5
- package/button/src/button/flat/flat-theme.scss +4 -38
- package/button/src/button/icon/icon-theme.scss +157 -79
- package/button/src/button/raised/raised-theme.scss +2 -2
- package/button/src/button/stroked/stroked-theme.scss +7 -39
- package/button/src/button/underline/underline-theme.scss +4 -18
- package/callout/src/callout-theme.scss +27 -10
- package/card/card/basic/basic.component.d.ts +3 -0
- package/card/card/raised/raised.component.d.ts +3 -0
- package/card/card/stroked/stroked.component.d.ts +3 -0
- package/card/examples/card-theming/card-theming.component.d.ts +2 -1
- package/card/examples/public_api.d.ts +1 -1
- package/card/src/card/stroked/stroked-theme.scss +102 -13
- package/card/src/card-base-theme.scss +126 -55
- package/checkbox/examples/basic-checkbox/basic-checkbox.component.d.ts +3 -0
- package/checkbox/examples/checkbox-set/checkbox-set.component.d.ts +3 -0
- package/core/article-encapsulated/article-encapsulated.directive.d.ts +3 -0
- package/core/colorable/colorable.directive.d.ts +8 -0
- package/core/manage-container-layout/manage-container-layout.directive.d.ts +3 -0
- package/core/openable/openable.directive.d.ts +3 -0
- package/core/prefix-suffix/prefix-suffix.module.d.ts +1 -1
- package/core/prefix-suffix/prefix.directive.d.ts +4 -1
- package/core/prefix-suffix/public_api.d.ts +0 -4
- package/core/prefix-suffix/suffix.directive.d.ts +4 -1
- package/core/sizable/sizable.directive.d.ts +8 -0
- package/core/statusable/statusable.directive.d.ts +2 -0
- package/core/text-alignable/text-alignable.directive.d.ts +6 -1
- package/fesm2022/daffodil-design-accordion.mjs +2 -2
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs +5 -2
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button-examples.mjs +21 -17
- package/fesm2022/daffodil-design-button-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +25 -32
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-card-examples.mjs +14 -12
- package/fesm2022/daffodil-design-card-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +9 -0
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox-examples.mjs +6 -0
- package/fesm2022/daffodil-design-checkbox-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-image.mjs +2 -2
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input-examples.mjs +45 -22
- package/fesm2022/daffodil-design-input-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +57 -18
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +23 -10
- package/fesm2022/daffodil-design-menu.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +33 -0
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar.mjs +2 -2
- package/fesm2022/daffodil-design-notification-examples.mjs +8 -12
- package/fesm2022/daffodil-design-notification-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +32 -5
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +2 -2
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar-examples.mjs +2 -2
- package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +18 -3
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field-examples.mjs +9 -9
- package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +3 -8
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch-examples.mjs +6 -6
- package/fesm2022/daffodil-design-switch-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch.mjs +35 -11
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +27 -8
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast-examples.mjs +6 -0
- package/fesm2022/daffodil-design-toast-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +17 -18
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +21 -7
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design-youtube-player.mjs +3 -0
- package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +301 -224
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/hero/src/hero-theme.scss +27 -10
- package/input/examples/examples.d.ts +2 -2
- package/input/examples/input-disabled/input-disabled.component.d.ts +2 -0
- package/input/examples/input-hint/input-hint.component.d.ts +5 -0
- package/input/examples/input-with-form-field/input-with-form-field.component.d.ts +2 -0
- package/list/list/list.component.d.ts +1 -1
- package/list/src/list-theme.scss +16 -20
- package/media-gallery/README.md +3 -3
- package/media-gallery/media-gallery/media-gallery.component.d.ts +21 -5
- package/media-gallery/public_api.d.ts +3 -3
- package/media-gallery/thumbnail/thumbnail.directive.d.ts +23 -6
- package/menu/menu/menu.component.d.ts +15 -0
- package/menu/menu-activator/menu-activator.component.d.ts +3 -0
- package/menu/src/menu-theme.scss +29 -10
- package/modal/modal/modal.component.d.ts +21 -0
- package/modal/modal-actions/modal-actions.component.d.ts +3 -0
- package/modal/modal-close/modal-close.directive.d.ts +3 -0
- package/modal/modal-content/modal-content.component.d.ts +3 -0
- package/modal/modal-title/modal-title.directive.d.ts +3 -0
- package/navbar/src/navbar-theme.scss +8 -3
- package/notification/README.md +11 -12
- package/notification/notification/notification.component.d.ts +17 -2
- package/notification/notification-actions/notification-actions.directive.d.ts +3 -0
- package/notification/notification-message/notification-message.directive.d.ts +3 -0
- package/notification/notification-subtitle/notification-subtitle.directive.d.ts +3 -0
- package/notification/notification-title/notification-title.directive.d.ts +3 -0
- package/notification/notification.d.ts +2 -2
- package/notification/src/notification-theme.scss +62 -23
- package/package.json +1 -1
- package/paginator/src/paginator-theme.scss +22 -17
- package/progress-bar/README.md +2 -4
- package/progress-bar/progress-bar-label/progress-bar-label.directive.d.ts +3 -0
- package/progress-bar/progress-bar.component.d.ts +15 -3
- package/progress-bar/src/progress-bar-theme.scss +17 -8
- package/public_api.d.ts +1 -0
- package/scss/state/skeleton/_mixins.scss +19 -9
- package/scss/theme.scss +2 -0
- package/sidebar/public_api.d.ts +10 -11
- package/sidebar/sidebar.d.ts +1 -2
- package/sidebar/sidebar.module.d.ts +1 -2
- package/src/atoms/form/error-message/error-message-theme.scss +4 -1
- package/src/atoms/form/form-field/form-field/form-field-theme.scss +22 -10
- package/src/atoms/form/hint/hint-theme.scss +17 -0
- package/src/atoms/form/input/input-theme.scss +1 -5
- package/switch/src/switch-theme.scss +29 -10
- package/switch/switch/switch.component.d.ts +31 -6
- package/switch/switch.d.ts +2 -2
- package/tabs/src/tabs-theme.scss +31 -13
- package/tabs/tabs/tab-activator/tab-activator.component.d.ts +15 -0
- package/tabs/tabs/tab-label/tab-label.component.d.ts +2 -5
- package/tabs/tabs/tabs.component.d.ts +3 -0
- package/toast/examples/default-toast/default-toast.component.d.ts +3 -0
- package/toast/examples/toast-positions/toast-positions.component.d.ts +3 -0
- package/toast/src/toast-theme.scss +80 -33
- package/toast/toast/toast-template.component.d.ts +3 -1
- package/toast/toast/toast.component.d.ts +3 -5
- package/tree/interfaces/tree-data.d.ts +15 -0
- package/tree/interfaces/tree-render-mode.d.ts +2 -2
- package/tree/src/tree-theme.scss +39 -13
- package/tree/tree/tree-notifier.service.d.ts +3 -3
- package/tree/tree/tree.component.d.ts +13 -3
- package/tree/tree-item/tree-item.directive.d.ts +6 -0
- package/youtube-player/youtube-player.component.d.ts +3 -0
- package/core/prefix-suffix/prefixable/prefixable-interface.d.ts +0 -7
- package/core/prefix-suffix/prefixable/prefixable.d.ts +0 -11
- package/core/prefix-suffix/suffixable/suffixable-interface.d.ts +0 -7
- package/core/prefix-suffix/suffixable/suffixable.d.ts +0 -11
- package/input/examples/basic-input/basic-input.component.d.ts +0 -5
@@ -1,26 +1,26 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
3
|
-
import * as i1 from '@
|
4
|
-
import {
|
5
|
-
import * as
|
6
|
-
import {
|
7
|
-
|
8
|
-
|
9
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: BasicInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
10
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: BasicInputComponent, isStandalone: true, selector: "basic-input", ngImport: i0, template: "<input daff-input type=\"text\" placeholder=\"Email\" name=\"email\" />", dependencies: [{ kind: "ngmodule", type: DaffInputModule }, { kind: "component", type: i1.DaffInputComponent, selector: "input[daff-input]", inputs: ["formSubmitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
11
|
-
}
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: BasicInputComponent, decorators: [{
|
13
|
-
type: Component,
|
14
|
-
args: [{ selector: 'basic-input', changeDetection: ChangeDetectionStrategy.OnPush, imports: [DaffInputModule], template: "<input daff-input type=\"text\" placeholder=\"Email\" name=\"email\" />" }]
|
15
|
-
}] });
|
3
|
+
import * as i1 from '@angular/forms';
|
4
|
+
import { UntypedFormControl, ReactiveFormsModule, Validators } from '@angular/forms';
|
5
|
+
import * as i1$1 from '@daffodil/design';
|
6
|
+
import { DaffInputComponent, DAFF_FORM_FIELD_COMPONENTS, DaffHintComponent, DaffPrefixSuffixModule } from '@daffodil/design';
|
7
|
+
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
8
|
+
import { faUser, faCircleXmark } from '@fortawesome/free-solid-svg-icons';
|
16
9
|
|
17
10
|
class InputDisabledComponent {
|
11
|
+
constructor() {
|
12
|
+
this.disabled = new UntypedFormControl({ value: '', disabled: true });
|
13
|
+
}
|
18
14
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: InputDisabledComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
19
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: InputDisabledComponent, isStandalone: true, selector: "input-disabled", ngImport: i0, template: "<daff-form-field>\n <
|
15
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: InputDisabledComponent, isStandalone: true, selector: "input-disabled", ngImport: i0, template: "<daff-form-field>\n <label daffFormLabel for=\"disabled-input\">Email</label>\n <input daff-input type=\"text\" name=\"email\" id=\"disabled-input\" [formControl]=\"disabled\"/>\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: DaffInputComponent, selector: "input[daff-input]" }, { kind: "component", type: i1$1.DaffFormFieldComponent, selector: "daff-form-field" }, { kind: "directive", type: i1$1.DaffFormLabelDirective, selector: "[daffFormLabel]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
20
16
|
}
|
21
17
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: InputDisabledComponent, decorators: [{
|
22
18
|
type: Component,
|
23
|
-
args: [{ selector: 'input-disabled', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
19
|
+
args: [{ selector: 'input-disabled', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
20
|
+
ReactiveFormsModule,
|
21
|
+
DaffInputComponent,
|
22
|
+
DAFF_FORM_FIELD_COMPONENTS,
|
23
|
+
], template: "<daff-form-field>\n <label daffFormLabel for=\"disabled-input\">Email</label>\n <input daff-input type=\"text\" name=\"email\" id=\"disabled-input\" [formControl]=\"disabled\"/>\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"] }]
|
24
24
|
}] });
|
25
25
|
|
26
26
|
class InputErrorComponent {
|
@@ -31,31 +31,54 @@ class InputErrorComponent {
|
|
31
31
|
]);
|
32
32
|
}
|
33
33
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: InputErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
34
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
34
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: InputErrorComponent, isStandalone: true, selector: "input-error", ngImport: i0, template: "<daff-form-field>\n <label daffFormLabel for=\"error-input\">Email</label>\n <input daff-input type=\"text\" name=\"email\" [formControl]=\"control\" id=\"error-input\"/>\n @if (control.errors?.required) {\n <daff-error-message>Email is a required field.</daff-error-message>\n }\n @if (control.errors?.email) {\n <daff-error-message>Email is not valid.</daff-error-message>\n }\n</daff-form-field>\n<p>Value: {{ control.value }} </p>", styles: ["daff-form-field{max-width:320px}\n"], dependencies: [{ kind: "component", type: i1$1.DaffFormFieldComponent, selector: "daff-form-field" }, { kind: "component", type: i1$1.DaffErrorMessageComponent, selector: "daff-error-message" }, { kind: "directive", type: i1$1.DaffFormLabelDirective, selector: "[daffFormLabel]" }, { kind: "component", type: DaffInputComponent, selector: "input[daff-input]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
35
35
|
}
|
36
36
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: InputErrorComponent, decorators: [{
|
37
37
|
type: Component,
|
38
38
|
args: [{ selector: 'input-error', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
39
|
-
|
40
|
-
|
39
|
+
DAFF_FORM_FIELD_COMPONENTS,
|
40
|
+
DaffInputComponent,
|
41
|
+
DaffHintComponent,
|
41
42
|
ReactiveFormsModule,
|
42
|
-
], template: "<daff-form-field>\n <input daff-input type=\"text\"
|
43
|
+
], template: "<daff-form-field>\n <label daffFormLabel for=\"error-input\">Email</label>\n <input daff-input type=\"text\" name=\"email\" [formControl]=\"control\" id=\"error-input\"/>\n @if (control.errors?.required) {\n <daff-error-message>Email is a required field.</daff-error-message>\n }\n @if (control.errors?.email) {\n <daff-error-message>Email is not valid.</daff-error-message>\n }\n</daff-form-field>\n<p>Value: {{ control.value }} </p>", styles: ["daff-form-field{max-width:320px}\n"] }]
|
44
|
+
}] });
|
45
|
+
|
46
|
+
class InputHintComponent {
|
47
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: InputHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
48
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: InputHintComponent, isStandalone: true, selector: "input-hint", ngImport: i0, template: "<daff-form-field>\n <label daffFormLabel for=\"input-hint\">Email</label>\n <input daff-input type=\"text\" name=\"email\" id=\"input-hint\"/>\n <daff-hint>Hint goes here.</daff-hint>\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"], dependencies: [{ kind: "component", type: i1$1.DaffFormFieldComponent, selector: "daff-form-field" }, { kind: "directive", type: i1$1.DaffFormLabelDirective, selector: "[daffFormLabel]" }, { kind: "component", type: i1$1.DaffHintComponent, selector: "daff-hint" }, { kind: "component", type: DaffInputComponent, selector: "input[daff-input]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
49
|
+
}
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: InputHintComponent, decorators: [{
|
51
|
+
type: Component,
|
52
|
+
args: [{ selector: 'input-hint', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
53
|
+
DAFF_FORM_FIELD_COMPONENTS,
|
54
|
+
DaffInputComponent,
|
55
|
+
DaffHintComponent,
|
56
|
+
], template: "<daff-form-field>\n <label daffFormLabel for=\"input-hint\">Email</label>\n <input daff-input type=\"text\" name=\"email\" id=\"input-hint\"/>\n <daff-hint>Hint goes here.</daff-hint>\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"] }]
|
43
57
|
}] });
|
44
58
|
|
45
59
|
class InputWithFormFieldComponent {
|
60
|
+
constructor() {
|
61
|
+
this.faUser = faUser;
|
62
|
+
this.faCircleXmark = faCircleXmark;
|
63
|
+
}
|
46
64
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: InputWithFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
47
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: InputWithFormFieldComponent, isStandalone: true, selector: "input-with-form-field", ngImport: i0, template: "<daff-form-field>\n <input daff-input type=\"text\"
|
65
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: InputWithFormFieldComponent, isStandalone: true, selector: "input-with-form-field", ngImport: i0, template: "<daff-form-field>\n <fa-icon [icon]=\"faUser\" daffPrefix></fa-icon>\n <label daffFormLabel for=\"example-input\">First Name</label>\n <input daff-input type=\"text\" name=\"first-name\" id=\"example-input\" />\n <fa-icon [icon]=\"faCircleXmark\" daffSuffix></fa-icon>\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"], dependencies: [{ kind: "component", type: i1$1.DaffFormFieldComponent, selector: "daff-form-field" }, { kind: "directive", type: i1$1.DaffFormLabelDirective, selector: "[daffFormLabel]" }, { kind: "directive", type: i1$1.DaffPrefixDirective, selector: "[daffPrefix]" }, { kind: "directive", type: i1$1.DaffSuffixDirective, selector: "[daffSuffix]" }, { kind: "component", type: DaffInputComponent, selector: "input[daff-input]" }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { kind: "ngmodule", type: DaffPrefixSuffixModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
48
66
|
}
|
49
67
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: InputWithFormFieldComponent, decorators: [{
|
50
68
|
type: Component,
|
51
|
-
args: [{ selector: 'input-with-form-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
69
|
+
args: [{ selector: 'input-with-form-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
70
|
+
DAFF_FORM_FIELD_COMPONENTS,
|
71
|
+
DaffInputComponent,
|
72
|
+
FaIconComponent,
|
73
|
+
DaffPrefixSuffixModule,
|
74
|
+
], template: "<daff-form-field>\n <fa-icon [icon]=\"faUser\" daffPrefix></fa-icon>\n <label daffFormLabel for=\"example-input\">First Name</label>\n <input daff-input type=\"text\" name=\"first-name\" id=\"example-input\" />\n <fa-icon [icon]=\"faCircleXmark\" daffSuffix></fa-icon>\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"] }]
|
52
75
|
}] });
|
53
76
|
|
54
77
|
const INPUT_EXAMPLES = [
|
55
|
-
BasicInputComponent,
|
56
78
|
InputWithFormFieldComponent,
|
57
79
|
InputDisabledComponent,
|
58
80
|
InputErrorComponent,
|
81
|
+
InputHintComponent,
|
59
82
|
];
|
60
83
|
|
61
84
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-design-input-examples.mjs","sources":["../../../libs/design/input/examples/src/basic-input/basic-input.component.ts","../../../libs/design/input/examples/src/basic-input/basic-input.component.html","../../../libs/design/input/examples/src/input-disabled/input-disabled.component.ts","../../../libs/design/input/examples/src/input-disabled/input-disabled.component.html","../../../libs/design/input/examples/src/input-error/input-error.component.ts","../../../libs/design/input/examples/src/input-error/input-error.component.html","../../../libs/design/input/examples/src/input-with-form-field/input-with-form-field.component.ts","../../../libs/design/input/examples/src/input-with-form-field/input-with-form-field.component.html","../../../libs/design/input/examples/src/examples.ts","../../../libs/design/input/examples/src/daffodil-design-input-examples.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\n\nimport { DaffInputModule } from '@daffodil/design';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'basic-input',\n templateUrl: './basic-input.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [DaffInputModule],\n})\nexport class BasicInputComponent {\n\n}\n","<input daff-input type=\"text\" placeholder=\"Email\" name=\"email\" />","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\n\nimport {\n DaffFormFieldModule,\n DaffInputModule,\n} from '@daffodil/design';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-disabled',\n templateUrl: './input-disabled.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [DaffFormFieldModule, DaffInputModule],\n})\nexport class InputDisabledComponent {\n\n}\n","<daff-form-field>\n <input disabled daff-input type=\"text\" placeholder=\"Email\" name=\"email\" />\n</daff-form-field>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport {\n UntypedFormControl,\n Validators,\n ReactiveFormsModule,\n} from '@angular/forms';\n\nimport {\n DaffFormFieldModule,\n DaffInputModule,\n} from '@daffodil/design';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-error',\n templateUrl: './input-error.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DaffFormFieldModule,\n DaffInputModule,\n ReactiveFormsModule,\n ],\n})\nexport class InputErrorComponent {\n control: UntypedFormControl = new UntypedFormControl('test@example.com', [\n Validators.email,\n Validators.required,\n ]);\n}\n","<daff-form-field>\n <input daff-input type=\"text\" placeholder=\"Email\" name=\"email\" [formControl]=\"control\" />\n</daff-form-field>\n<p>Value: {{ control.value }} </p>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\n\nimport {\n DaffFormFieldModule,\n DaffInputModule,\n} from '@daffodil/design';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-with-form-field',\n templateUrl: './input-with-form-field.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [DaffFormFieldModule, DaffInputModule],\n})\nexport class InputWithFormFieldComponent {\n\n}\n","<daff-form-field>\n <input daff-input type=\"text\" placeholder=\"Email\" name=\"email\" />\n</daff-form-field>\n","import { BasicInputComponent } from './basic-input/basic-input.component';\nimport { InputDisabledComponent } from './input-disabled/input-disabled.component';\nimport { InputErrorComponent } from './input-error/input-error.component';\nimport { InputWithFormFieldComponent } from './input-with-form-field/input-with-form-field.component';\n\nexport const INPUT_EXAMPLES = [\n BasicInputComponent,\n InputWithFormFieldComponent,\n InputDisab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AAA,EAAA,IAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEnC,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAPvC,SAAS;+BAEE,uBAAuB,EAAA,eAAA,EAEhB,uBAAuB,CAAC,MAAM,WACtC,CAAC,mBAAmB,EAAE,eAAe,CAAC,EAAA,QAAA,EAAA,oHAAA,EAAA;;;AEVpC,MAAA,cAAc,GAAG;IAC5B,mBAAmB;IACnB,2BAA2B;IAC3B,sBAAsB;IACtB,mBAAmB;;;ACTrB;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"daffodil-design-input-examples.mjs","sources":["../../../libs/design/input/examples/src/input-disabled/input-disabled.component.ts","../../../libs/design/input/examples/src/input-disabled/input-disabled.component.html","../../../libs/design/input/examples/src/input-error/input-error.component.ts","../../../libs/design/input/examples/src/input-error/input-error.component.html","../../../libs/design/input/examples/src/input-hint/input-hint.component.ts","../../../libs/design/input/examples/src/input-hint/input-hint.component.html","../../../libs/design/input/examples/src/input-with-form-field/input-with-form-field.component.ts","../../../libs/design/input/examples/src/input-with-form-field/input-with-form-field.component.html","../../../libs/design/input/examples/src/examples.ts","../../../libs/design/input/examples/src/daffodil-design-input-examples.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport {\n ReactiveFormsModule,\n UntypedFormControl,\n} from '@angular/forms';\n\nimport {\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n} from '@daffodil/design';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-disabled',\n templateUrl: './input-disabled.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n ReactiveFormsModule,\n DaffInputComponent,\n DAFF_FORM_FIELD_COMPONENTS,\n ],\n})\nexport class InputDisabledComponent {\n disabled = new UntypedFormControl({ value : '' , disabled: true });\n}\n","<daff-form-field>\n <label daffFormLabel for=\"disabled-input\">Email</label>\n <input daff-input type=\"text\" name=\"email\" id=\"disabled-input\" [formControl]=\"disabled\"/>\n</daff-form-field>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport {\n UntypedFormControl,\n Validators,\n ReactiveFormsModule,\n} from '@angular/forms';\n\nimport {\n DAFF_FORM_FIELD_COMPONENTS,\n DaffHintComponent,\n DaffInputComponent,\n} from '@daffodil/design';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-error',\n templateUrl: './input-error.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n DaffHintComponent,\n ReactiveFormsModule,\n ],\n})\nexport class InputErrorComponent {\n control: UntypedFormControl = new UntypedFormControl('test@example.com', [\n Validators.email,\n Validators.required,\n ]);\n}\n","<daff-form-field>\n <label daffFormLabel for=\"error-input\">Email</label>\n <input daff-input type=\"text\" name=\"email\" [formControl]=\"control\" id=\"error-input\"/>\n @if (control.errors?.required) {\n <daff-error-message>Email is a required field.</daff-error-message>\n }\n @if (control.errors?.email) {\n <daff-error-message>Email is not valid.</daff-error-message>\n }\n</daff-form-field>\n<p>Value: {{ control.value }} </p>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\n\nimport {\n DAFF_FORM_FIELD_COMPONENTS,\n DaffHintComponent,\n DaffInputComponent,\n} from '@daffodil/design';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-hint',\n templateUrl: './input-hint.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n DaffHintComponent,\n ],\n})\nexport class InputHintComponent {\n}\n","<daff-form-field>\n <label daffFormLabel for=\"input-hint\">Email</label>\n <input daff-input type=\"text\" name=\"email\" id=\"input-hint\"/>\n <daff-hint>Hint goes here.</daff-hint>\n</daff-form-field>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faUser,\n faCircleXmark,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport {\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n DaffPrefixSuffixModule,\n} from '@daffodil/design';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-with-form-field',\n templateUrl: './input-with-form-field.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n FaIconComponent,\n DaffPrefixSuffixModule,\n ],\n})\nexport class InputWithFormFieldComponent {\n faUser = faUser;\n faCircleXmark = faCircleXmark;\n}\n","<daff-form-field>\n <fa-icon [icon]=\"faUser\" daffPrefix></fa-icon>\n <label daffFormLabel for=\"example-input\">First Name</label>\n <input daff-input type=\"text\" name=\"first-name\" id=\"example-input\" />\n <fa-icon [icon]=\"faCircleXmark\" daffSuffix></fa-icon>\n</daff-form-field>","import { InputDisabledComponent } from './input-disabled/input-disabled.component';\nimport { InputErrorComponent } from './input-error/input-error.component';\nimport { InputHintComponent } from './input-hint/input-hint.component';\nimport { InputWithFormFieldComponent } from './input-with-form-field/input-with-form-field.component';\n\nexport const INPUT_EXAMPLES = [\n InputWithFormFieldComponent,\n InputDisabledComponent,\n InputErrorComponent,\n InputHintComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2","i1"],"mappings":";;;;;;;;;MA8Ba,sBAAsB,CAAA;AAhBnC,IAAA,WA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,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDuBd,kBAAkB,EAClB,QAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,eAAe,2MACf,sBAAsB,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAGb,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAjBvC,SAAS;AAEE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,EAOhB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACtC,OAAA,EAAA;wBACP,0BAA0B;wBAC1B,kBAAkB;wBAClB,eAAe;wBACf,sBAAsB;AACvB,qBAAA,EAAA,QAAA,EAAA,sSAAA,EAAA,MAAA,EAAA,CAAA,oCAAA,CAAA,EAAA;;;AE1BU,MAAA,cAAc,GAAG;IAC5B,2BAA2B;IAC3B,sBAAsB;IACtB,mBAAmB;IACnB,kBAAkB;;;ACTpB;;AAEG;;;;"}
|
@@ -13,7 +13,7 @@ provider: provideDaffMediaGalleryToken, } = createSingleInjectionToken('DAFF_MED
|
|
13
13
|
|
14
14
|
let uniqueThumbnailId = 0;
|
15
15
|
/**
|
16
|
-
*
|
16
|
+
* DaffThumbnailDirective is a structural directive used to mark elements as thumbnails within the `DaffMediaGalleryComponent`.
|
17
17
|
*
|
18
18
|
* ```html
|
19
19
|
* <ng-template daffThumbnail></ng-template>
|
@@ -21,31 +21,42 @@ let uniqueThumbnailId = 0;
|
|
21
21
|
*/
|
22
22
|
class DaffThumbnailDirective {
|
23
23
|
/**
|
24
|
-
*
|
24
|
+
* @docs-private
|
25
|
+
*
|
26
|
+
* The autogenerated unique id for a thumbnail.
|
25
27
|
*/
|
26
28
|
get id() {
|
27
|
-
return this.gallery.id + '-thumbnail-' +
|
29
|
+
return this.gallery.id + '-thumbnail-' + this._increment;
|
28
30
|
}
|
29
31
|
/**
|
30
|
-
*
|
32
|
+
* @docs-private
|
33
|
+
*
|
34
|
+
* The unique id of the selected thumbnail.
|
31
35
|
*/
|
32
|
-
get
|
33
|
-
return this.id + '-
|
36
|
+
get selectedThumbnailId() {
|
37
|
+
return this.id + '-selected';
|
34
38
|
}
|
39
|
+
constructor(
|
40
|
+
/**
|
41
|
+
* @docs-private
|
42
|
+
*/
|
43
|
+
gallery,
|
35
44
|
/**
|
36
45
|
* @docs-private
|
37
46
|
*/
|
38
|
-
|
47
|
+
templateRef) {
|
39
48
|
this.gallery = gallery;
|
40
49
|
this.templateRef = templateRef;
|
50
|
+
this._increment = uniqueThumbnailId;
|
41
51
|
/**
|
42
52
|
* The file path to a thumbnail, presumably an image.
|
43
53
|
*/
|
44
54
|
this.thumbnailSrc = undefined;
|
45
55
|
/**
|
46
|
-
*
|
56
|
+
* Provides an accessible label for a thumbnail.
|
47
57
|
*/
|
48
58
|
this.label = undefined;
|
59
|
+
/** Indicates whether the thumbnail represents a video. */
|
49
60
|
this.isVideo = false;
|
50
61
|
uniqueThumbnailId++;
|
51
62
|
}
|
@@ -78,13 +89,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
78
89
|
|
79
90
|
let uniqueGalleryId = 0;
|
80
91
|
/**
|
92
|
+
* The `DaffMediaGalleryComonent` is used to display a group of thumbnails in a gallery format.
|
93
|
+
*
|
81
94
|
* ```html
|
82
|
-
* <daff-media-gallery
|
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>
|
83
100
|
* ```
|
84
101
|
*/
|
85
102
|
class DaffMediaGalleryComponent {
|
86
103
|
/**
|
87
|
-
*
|
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.
|
88
105
|
*/
|
89
106
|
get id() {
|
90
107
|
return this._id;
|
@@ -105,6 +122,10 @@ class DaffMediaGalleryComponent {
|
|
105
122
|
* @docs-private
|
106
123
|
*/
|
107
124
|
this.role = 'tablist';
|
125
|
+
/**
|
126
|
+
* The internal ID of the gallery.
|
127
|
+
*/
|
128
|
+
this._id = 'media-gallery-' + uniqueGalleryId;
|
108
129
|
/**
|
109
130
|
* @docs-private
|
110
131
|
*
|
@@ -144,7 +165,9 @@ class DaffMediaGalleryComponent {
|
|
144
165
|
this._thumbnailButtons.get(this._selectedIndex())?.nativeElement.focus();
|
145
166
|
}
|
146
167
|
/**
|
147
|
-
* Select a specific entry in the media gallery by its index
|
168
|
+
* Select a specific entry in the media gallery by its index.
|
169
|
+
*
|
170
|
+
* @param index The index to set, starting at 0.
|
148
171
|
*/
|
149
172
|
selectIndex(index) {
|
150
173
|
this._selectedIndex.set(index);
|
@@ -152,41 +175,57 @@ class DaffMediaGalleryComponent {
|
|
152
175
|
}
|
153
176
|
/**
|
154
177
|
* Navigate to the next element in the list of thumbnails.
|
178
|
+
*
|
179
|
+
* @param focus Whether to move focus to the newly selected item.
|
155
180
|
*/
|
156
181
|
next(focus = true) {
|
157
182
|
this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);
|
158
183
|
this.elementChange.emit(this._selectedIndex());
|
159
|
-
|
184
|
+
if (focus) {
|
185
|
+
this.focusSelected();
|
186
|
+
}
|
160
187
|
}
|
161
188
|
/**
|
162
189
|
* Navigate to the previous element in the list of thumbnails.
|
190
|
+
*
|
191
|
+
* @param focus Whether to move focus to the newly selected item.
|
163
192
|
*/
|
164
193
|
previous(focus = true) {
|
165
194
|
this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);
|
166
195
|
this.elementChange.emit(this._selectedIndex());
|
167
|
-
|
196
|
+
if (focus) {
|
197
|
+
this.focusSelected();
|
198
|
+
}
|
168
199
|
}
|
169
200
|
/**
|
170
|
-
* Select the first element
|
201
|
+
* Select the first element.
|
202
|
+
*
|
203
|
+
* @param focus Whether to move focus to the newly selected item.
|
171
204
|
*/
|
172
205
|
selectFirst(focus = true) {
|
173
206
|
this._selectedIndex.set(0);
|
174
207
|
this.elementChange.emit(this._selectedIndex());
|
175
|
-
|
208
|
+
if (focus) {
|
209
|
+
this.focusSelected();
|
210
|
+
}
|
176
211
|
}
|
177
212
|
/**
|
178
213
|
* Select the last element of the gallery.
|
214
|
+
*
|
215
|
+
* @param Whether to move focus to the newly selected item.
|
179
216
|
*/
|
180
217
|
selectLast(focus = true) {
|
181
218
|
this._selectedIndex.set(this._thumbnails().length - 1);
|
182
219
|
this.elementChange.emit(this._selectedIndex());
|
183
|
-
|
220
|
+
if (focus) {
|
221
|
+
this.focusSelected();
|
222
|
+
}
|
184
223
|
}
|
185
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 }); }
|
186
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: [
|
187
226
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
188
227
|
{ provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },
|
189
|
-
], 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.
|
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}@keyframes loading{0%{opacity:.5}to{opacity:1}}}@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}@keyframes loading{0%{opacity:.5}to{opacity:1}}}: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}@keyframes loading{0%{opacity:.5}to{opacity:1}}: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 }); }
|
190
229
|
}
|
191
230
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryComponent, decorators: [{
|
192
231
|
type: Component,
|
@@ -203,7 +242,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
203
242
|
DaffThumbnailDirective,
|
204
243
|
NgTemplateOutlet,
|
205
244
|
DaffSelectableDirective,
|
206
|
-
], 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.
|
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}@keyframes loading{0%{opacity:.5}to{opacity:1}}}@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}@keyframes loading{0%{opacity:.5}to{opacity:1}}}: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}@keyframes loading{0%{opacity:.5}to{opacity:1}}: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"] }]
|
207
246
|
}], ctorParameters: () => [{ type: i1.DaffSkeletonableDirective }], propDecorators: { role: [{
|
208
247
|
type: HostBinding,
|
209
248
|
args: ['attr.role']
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-design-media-gallery.mjs","sources":["../../../libs/design/media-gallery/src/helpers/media-gallery-token.ts","../../../libs/design/media-gallery/src/thumbnail/thumbnail.directive.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.html","../../../libs/design/media-gallery/src/media-gallery.module.ts","../../../libs/design/media-gallery/src/media-gallery.ts","../../../libs/design/media-gallery/src/daffodil-design-media-gallery.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nimport { DaffMediaGalleryRegistration } from './media-gallery-registration.interface';\n\nexport const {\n token: DAFF_MEDIA_GALLERY_TOKEN,\n /**\n * Provider function for {@link DAFF_MEDIA_GALLERY_TOKEN}.\n */\n provider: provideDaffMediaGalleryToken,\n} = createSingleInjectionToken<DaffMediaGalleryRegistration>('DAFF_MEDIA_GALLERY_TOKEN');\n","import {\n Directive,\n Inject,\n Input,\n TemplateRef,\n OnInit,\n isDevMode,\n} from '@angular/core';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\n\nlet uniqueThumbnailId = 0;\n\n/**\n * A structural directive marking thumbnails for the `DaffMediaGalleryComponent`.\n *\n * ```html\n * <ng-template daffThumbnail></ng-template>\n * ```\n */\n@Directive({\n selector: '[daffThumbnail]',\n})\nexport class DaffThumbnailDirective implements OnInit {\n\n /**\n * The id of the thumbnail.\n */\n get id(): string {\n return this.gallery.id + '-thumbnail-' + uniqueThumbnailId;\n }\n\n /**\n * The id of the thumbnail panel.\n */\n get panelId(): string {\n return this.id + '-el';\n }\n\n /**\n * The file path to a thumbnail, presumably an image.\n */\n @Input() thumbnailSrc = undefined;\n\n\n /**\n * The button label for the thumbnail.\n */\n @Input() label: string = undefined;\n\n @Input() isVideo = false;\n\n /**\n * @docs-private\n */\n constructor(\n @Inject(DAFF_MEDIA_GALLERY_TOKEN) public gallery: DaffMediaGalleryRegistration,\n public templateRef: TemplateRef<unknown>,\n ) {\n uniqueThumbnailId++;\n }\n\n /**\n * @docs-private\n */\n ngOnInit() {\n if(!this.label && isDevMode()) {\n console.warn('The thumbnail ' + this.id + ' is missing a label.');\n }\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n HostBinding,\n ChangeDetectionStrategy,\n Input,\n QueryList,\n ViewChildren,\n ElementRef,\n Output,\n EventEmitter,\n contentChildren,\n signal,\n computed,\n Signal,\n} from '@angular/core';\n\nimport {\n DaffArticleEncapsulatedDirective,\n DaffSelectableDirective,\n DaffSkeletonableDirective,\n} from '@daffodil/design';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\nimport { DaffThumbnailDirective } from '../thumbnail/thumbnail.directive';\n\nlet uniqueGalleryId = 0;\n\n/**\n * ```html\n * <daff-media-gallery></daff-media-gallery>\n * ```\n */\n@Component({\n selector: 'daff-media-gallery',\n templateUrl: './media-gallery.component.html',\n styleUrls: ['./media-gallery.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n { provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },\n ],\n hostDirectives: [\n { directive: DaffArticleEncapsulatedDirective },\n {\n directive: DaffSkeletonableDirective,\n inputs: ['skeleton'],\n },\n ],\n imports: [\n DaffThumbnailDirective,\n NgTemplateOutlet,\n DaffSelectableDirective,\n ],\n})\nexport class DaffMediaGalleryComponent implements DaffMediaGalleryRegistration {\n\n /**\n * @docs-private\n */\n @HostBinding('attr.role') role = 'tablist';\n\n /**\n * The internal id of the gallery.\n */\n private _id: string;\n\n /**\n * The id of the gallery.\n */\n @HostBinding('attr.id')\n @Input()\n get id() {\n return this._id;\n }\n set id(val: string | undefined | null) {\n if(!val){\n return;\n }\n this._id = val;\n };\n\n /**\n * @docs-private\n *\n * Adds a class for styling the media gallery\n */\n @HostBinding('class.daff-media-gallery') private class = true;\n\n /**\n * An event indicating that the selected media gallery element has changed.\n */\n @Output() elementChange: EventEmitter<number> = new EventEmitter<number>();\n\n /**\n * @docs-private\n */\n _thumbnails = contentChildren(DaffThumbnailDirective);\n\n /**\n * @docs-private\n */\n @ViewChildren('thumbnailButtons', { read: ElementRef }) private _thumbnailButtons: QueryList<ElementRef<HTMLElement>>;\n\n /**\n * @docs-private\n */\n constructor(private skeletonDirective: DaffSkeletonableDirective) {\n uniqueGalleryId++;\n }\n\n /**\n * @docs-private\n *\n * Whether or not the component its currently displaying its skeleton state.\n */\n get skeleton() {\n return this.skeletonDirective.skeleton;\n }\n\n /**\n * @docs-private\n */\n _selectedThumbnail: Signal<DaffThumbnailDirective> = computed(() => {\n const idx = this._selectedIndex();\n if(!idx) {\n return this._thumbnails().at(0);\n }\n return this._thumbnails().at(idx);\n });\n\n private _selectedIndex = signal<number | null>(null);\n\n\n private focusSelected() {\n this._thumbnailButtons.get(this._selectedIndex())?.nativeElement.focus();\n }\n\n /**\n * Select a specific entry in the media gallery by its index (starting at 0).\n */\n selectIndex(index: number) {\n this._selectedIndex.set(index);\n this.elementChange.emit(index);\n }\n\n /**\n * Navigate to the next element in the list of thumbnails.\n */\n next(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n this.focusSelected();\n }\n\n /**\n * Navigate to the previous element in the list of thumbnails.\n */\n previous(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n this.focusSelected();\n }\n\n /**\n * Select the first element\n */\n selectFirst(focus: boolean = true) {\n this._selectedIndex.set(0);\n this.elementChange.emit(this._selectedIndex());\n this.focusSelected();\n }\n\n /**\n * Select the last element of the gallery.\n */\n selectLast(focus: boolean = true) {\n this._selectedIndex.set(this._thumbnails().length - 1);\n this.elementChange.emit(this._selectedIndex());\n this.focusSelected();\n }\n}\n","<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.panelId\"\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 el = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"el?.panelId\">\n\t\t@if(el) {\n\t\t\t<ng-container *ngTemplateOutlet=\"el.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>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @deprecated in favor of {@link DAFF_MEDIA_GALLERY_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n exports: [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n})\nexport class DaffMediaGalleryModule {}\n","import { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_MEDIA_GALLERY_COMPONENTS = <const> [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,EACX,KAAK,EAAE,wBAAwB;AAC/B;;AAEG;AACH,QAAQ,EAAE,4BAA4B,GACvC,GAAG,0BAA0B,CAA+B,0BAA0B,CAAC;;ACExF,IAAI,iBAAiB,GAAG,CAAC;AAEzB;;;;;;AAMG;MAIU,sBAAsB,CAAA;AAEjC;;AAEG;AACH,IAAA,IAAI,EAAE,GAAA;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,aAAa,GAAG,iBAAiB;;AAG5D;;AAEG;AACH,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,EAAE,GAAG,KAAK;;AAgBxB;;AAEG;IACH,WAC2C,CAAA,OAAqC,EACvE,WAAiC,EAAA;QADC,IAAO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AA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAT/B,YAAY;YACZ,yBAAyB;AACzB,YAAA,sBAAsB,aAGtB,yBAAyB;YACzB,sBAAsB,CAAA,EAAA,CAAA,CAAA;AAGb,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAT/B,YAAY,CAAA,EAAA,CAAA,CAAA;;2FASH,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,yBAAyB;wBACzB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,yBAAyB;wBACzB,sBAAsB;AACvB,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;AACU,MAAA,6BAA6B,GAAW;IACnD,yBAAyB;IACzB,sBAAsB;;;ACRxB;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"daffodil-design-media-gallery.mjs","sources":["../../../libs/design/media-gallery/src/helpers/media-gallery-token.ts","../../../libs/design/media-gallery/src/thumbnail/thumbnail.directive.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.html","../../../libs/design/media-gallery/src/media-gallery.module.ts","../../../libs/design/media-gallery/src/media-gallery.ts","../../../libs/design/media-gallery/src/daffodil-design-media-gallery.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nimport { DaffMediaGalleryRegistration } from './media-gallery-registration.interface';\n\nexport const {\n token: DAFF_MEDIA_GALLERY_TOKEN,\n /**\n * Provider function for {@link DAFF_MEDIA_GALLERY_TOKEN}.\n */\n provider: provideDaffMediaGalleryToken,\n} = createSingleInjectionToken<DaffMediaGalleryRegistration>('DAFF_MEDIA_GALLERY_TOKEN');\n","import {\n Directive,\n Inject,\n Input,\n TemplateRef,\n OnInit,\n isDevMode,\n} from '@angular/core';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\n\nlet uniqueThumbnailId = 0;\n\n/**\n * DaffThumbnailDirective is a structural directive used to mark elements as thumbnails within the `DaffMediaGalleryComponent`.\n *\n * ```html\n * <ng-template daffThumbnail></ng-template>\n * ```\n */\n@Directive({\n selector: '[daffThumbnail]',\n})\nexport class DaffThumbnailDirective implements OnInit {\n\n private _increment = uniqueThumbnailId;\n\n /**\n * @docs-private\n *\n * The autogenerated unique id for a thumbnail.\n */\n get id(): string {\n return this.gallery.id + '-thumbnail-' + this._increment;\n }\n\n /**\n * @docs-private\n *\n * The unique id of the selected thumbnail.\n */\n get selectedThumbnailId(): string {\n return this.id + '-selected';\n }\n\n /**\n * The file path to a thumbnail, presumably an image.\n */\n @Input() thumbnailSrc = undefined;\n\n /**\n * Provides an accessible label for a thumbnail.\n */\n @Input() label: string = undefined;\n\n /** Indicates whether the thumbnail represents a video. */\n @Input() isVideo = false;\n\n constructor(\n /**\n * @docs-private\n */\n @Inject(DAFF_MEDIA_GALLERY_TOKEN) public gallery: DaffMediaGalleryRegistration,\n /**\n * @docs-private\n */\n public templateRef: TemplateRef<unknown>,\n ) {\n uniqueThumbnailId++;\n }\n\n /**\n * @docs-private\n */\n ngOnInit() {\n if(!this.label && isDevMode()) {\n console.warn('The thumbnail ' + this.id + ' is missing a label.');\n }\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n HostBinding,\n ChangeDetectionStrategy,\n Input,\n QueryList,\n ViewChildren,\n ElementRef,\n Output,\n EventEmitter,\n contentChildren,\n signal,\n computed,\n Signal,\n} from '@angular/core';\n\nimport {\n DaffArticleEncapsulatedDirective,\n DaffSelectableDirective,\n DaffSkeletonableDirective,\n} from '@daffodil/design';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\nimport { DaffThumbnailDirective } from '../thumbnail/thumbnail.directive';\n\nlet uniqueGalleryId = 0;\n\n/**\n * The `DaffMediaGalleryComonent` is used to display a group of thumbnails in a gallery format.\n *\n * ```html\n * <daff-media-gallery>\n * <ng-template daffThumbnail thumbnailSrc=\"/thumbnail-path.jpg\" label=\"Your description\">\n * <daff-image src=\"/image-path.jpg\" alt=\"Your description\" width=\"100\" height=\"100\"></daff-image>\n * </ng-template>\n * </daff-media-gallery>\n * ```\n */\n@Component({\n selector: 'daff-media-gallery',\n templateUrl: './media-gallery.component.html',\n styleUrls: ['./media-gallery.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n { provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },\n ],\n hostDirectives: [\n { directive: DaffArticleEncapsulatedDirective },\n {\n directive: DaffSkeletonableDirective,\n inputs: ['skeleton'],\n },\n ],\n imports: [\n DaffThumbnailDirective,\n NgTemplateOutlet,\n DaffSelectableDirective,\n ],\n})\nexport class DaffMediaGalleryComponent implements DaffMediaGalleryRegistration {\n\n /**\n * @docs-private\n */\n @HostBinding('attr.role') role = 'tablist';\n\n /**\n * The internal ID of the gallery.\n */\n private _id = 'media-gallery-' + uniqueGalleryId;\n\n /**\n * 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.\n */\n @HostBinding('attr.id')\n @Input()\n get id() {\n return this._id;\n }\n set id(val: string | undefined | null) {\n if(!val){\n return;\n }\n this._id = val;\n };\n\n /**\n * @docs-private\n *\n * Adds a class for styling the media gallery\n */\n @HostBinding('class.daff-media-gallery') private class = true;\n\n /**\n * An event indicating that the selected media gallery element has changed.\n */\n @Output() elementChange: EventEmitter<number> = new EventEmitter<number>();\n\n /**\n * @docs-private\n */\n _thumbnails = contentChildren(DaffThumbnailDirective);\n\n /**\n * @docs-private\n */\n @ViewChildren('thumbnailButtons', { read: ElementRef }) private _thumbnailButtons: QueryList<ElementRef<HTMLElement>>;\n\n /**\n * @docs-private\n */\n constructor(private skeletonDirective: DaffSkeletonableDirective) {\n uniqueGalleryId++;\n }\n\n /**\n * @docs-private\n *\n * Whether or not the component its currently displaying its skeleton state.\n */\n get skeleton() {\n return this.skeletonDirective.skeleton;\n }\n\n /**\n * @docs-private\n */\n _selectedThumbnail: Signal<DaffThumbnailDirective> = computed(() => {\n const idx = this._selectedIndex();\n if(!idx) {\n return this._thumbnails().at(0);\n }\n return this._thumbnails().at(idx);\n });\n\n private _selectedIndex = signal<number | null>(null);\n\n private focusSelected() {\n this._thumbnailButtons.get(this._selectedIndex())?.nativeElement.focus();\n }\n\n /**\n * Select a specific entry in the media gallery by its index.\n *\n * @param index The index to set, starting at 0.\n */\n selectIndex(index: number) {\n this._selectedIndex.set(index);\n this.elementChange.emit(index);\n }\n\n /**\n * Navigate to the next element in the list of thumbnails.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n next(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Navigate to the previous element in the list of thumbnails.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n previous(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Select the first element.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n selectFirst(focus: boolean = true) {\n this._selectedIndex.set(0);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Select the last element of the gallery.\n *\n * @param Whether to move focus to the newly selected item.\n */\n selectLast(focus: boolean = true) {\n this._selectedIndex.set(this._thumbnails().length - 1);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n}\n","<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>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @deprecated in favor of {@link DAFF_MEDIA_GALLERY_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n exports: [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n})\nexport class DaffMediaGalleryModule {}\n","import { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_MEDIA_GALLERY_COMPONENTS = <const> [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,EACX,KAAK,EAAE,wBAAwB;AAC/B;;AAEG;AACH,QAAQ,EAAE,4BAA4B,GACvC,GAAG,0BAA0B,CAA+B,0BAA0B,CAAC;;ACExF,IAAI,iBAAiB,GAAG,CAAC;AAEzB;;;;;;AAMG;MAIU,sBAAsB,CAAA;AAIjC;;;;AAIG;AACH,IAAA,IAAI,EAAE,GAAA;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,aAAa,GAAG,IAAI,CAAC,UAAU;;AAG1D;;;;AAIG;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|
|
4
4
|
import * as i0 from '@angular/core';
|
5
5
|
import { Type, TemplateRef, Injectable, Directive, HostBinding, Input, HostListener, Component, ChangeDetectionStrategy, ContentChild, NgModule } from '@angular/core';
|
6
6
|
import { BehaviorSubject, map, Subject, takeUntil, fromEvent, filter } from 'rxjs';
|
7
|
-
import {
|
7
|
+
import { CommonModule } from '@angular/common';
|
8
8
|
import * as i1$1 from '@angular/cdk/a11y';
|
9
|
-
import { DaffPrefixDirective,
|
9
|
+
import { DaffPrefixDirective, daffFocusableElementsSelector } from '@daffodil/design';
|
10
10
|
|
11
11
|
function daffMenuCreateOverlay(overlay, element, config = {}) {
|
12
12
|
return overlay.create({
|
@@ -84,6 +84,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
84
84
|
}], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.Injector }] });
|
85
85
|
|
86
86
|
class DaffMenuActivatorDirective {
|
87
|
+
/**
|
88
|
+
* @docs-private
|
89
|
+
*/
|
87
90
|
get openClass() {
|
88
91
|
return this._open;
|
89
92
|
}
|
@@ -141,15 +144,12 @@ class DaffMenuItemComponent {
|
|
141
144
|
this.role = 'menuitem';
|
142
145
|
}
|
143
146
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
144
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
147
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: DaffMenuItemComponent, isStandalone: true, selector: "a[daff-menu-item],button[daff-menu-item]", host: { properties: { "class.daff-menu-item": "this.class", "attr.role": "this.role" } }, queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true }], ngImport: i0, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>", styles: [":host{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:8px;border:none;border-radius:4px;margin:0;padding:12px 16px;text-decoration:none;width:100%}.daff-menu-item__content{font-size:1rem;line-height:1.25rem;text-align:left}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
145
148
|
}
|
146
149
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMenuItemComponent, decorators: [{
|
147
150
|
type: Component,
|
148
151
|
args: [{ selector: 'a[daff-menu-item]' + ',' +
|
149
|
-
'button[daff-menu-item]', changeDetection: ChangeDetectionStrategy.OnPush,
|
150
|
-
NgIf,
|
151
|
-
DaffPrefixSuffixModule,
|
152
|
-
], template: "<ng-container *ngIf=\"_prefix\">\n <ng-content select=\"[daffPrefix]\"></ng-content>\n</ng-container>\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>", styles: [":host{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:8px;border:none;border-radius:4px;margin:0;padding:12px 16px;text-decoration:none;width:100%}.daff-menu-item__content{font-size:1rem;line-height:1.25rem;text-align:left}\n"] }]
|
152
|
+
'button[daff-menu-item]', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>", styles: [":host{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:8px;border:none;border-radius:4px;margin:0;padding:12px 16px;text-decoration:none;width:100%}.daff-menu-item__content{font-size:1rem;line-height:1.25rem;text-align:left}\n"] }]
|
153
153
|
}], propDecorators: { class: [{
|
154
154
|
type: HostBinding,
|
155
155
|
args: ['class.daff-menu-item']
|
@@ -167,8 +167,17 @@ class DaffMenuComponent {
|
|
167
167
|
this._ngZone = _ngZone;
|
168
168
|
this._elementRef = _elementRef;
|
169
169
|
this.menuService = menuService;
|
170
|
+
/**
|
171
|
+
* @docs-private
|
172
|
+
*/
|
170
173
|
this.class = true;
|
174
|
+
/**
|
175
|
+
* @docs-private
|
176
|
+
*/
|
171
177
|
this.tabindex = 0;
|
178
|
+
/**
|
179
|
+
* @docs-private
|
180
|
+
*/
|
172
181
|
this.role = 'menu';
|
173
182
|
/**
|
174
183
|
* Listen to `keydown` events outside the zone so that change detection is not run every
|
@@ -184,9 +193,15 @@ class DaffMenuComponent {
|
|
184
193
|
}));
|
185
194
|
});
|
186
195
|
}
|
196
|
+
/**
|
197
|
+
* @docs-private
|
198
|
+
*/
|
187
199
|
ngAfterContentInit() {
|
188
200
|
this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
|
189
201
|
}
|
202
|
+
/**
|
203
|
+
* @docs-private
|
204
|
+
*/
|
190
205
|
ngAfterViewInit() {
|
191
206
|
const focusableChild = this._elementRef.nativeElement.querySelector(daffFocusableElementsSelector);
|
192
207
|
if (focusableChild) {
|
@@ -230,9 +245,7 @@ class DaffMenuModule {
|
|
230
245
|
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMenuModule, providers: [
|
231
246
|
DaffMenuService,
|
232
247
|
], imports: [CommonModule,
|
233
|
-
OverlayModule
|
234
|
-
DaffMenuComponent,
|
235
|
-
DaffMenuItemComponent] }); }
|
248
|
+
OverlayModule] }); }
|
236
249
|
}
|
237
250
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMenuModule, decorators: [{
|
238
251
|
type: NgModule,
|