@daffodil/design 0.94.1 → 0.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/accordion/src/accordion-theme.scss +4 -4
- package/article/README.md +4 -27
- package/article/src/article-theme.scss +14 -14
- package/badge/src/badge-theme.scss +0 -6
- package/button/README.md +0 -4
- package/button/src/button/basic/button-theme.scss +17 -42
- package/button/src/button/button-base.scss +12 -3
- package/button/src/button/flat/flat-theme.scss +14 -12
- package/button/src/button/icon/icon-theme.scss +19 -40
- package/button/src/button/stroked/stroked-theme.scss +22 -36
- package/card/src/card/stroked/stroked-theme.scss +1 -1
- package/card/src/card-base.scss +0 -1
- package/fesm2022/daffodil-design-accordion.mjs +285 -188
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +578 -340
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-badge.mjs +166 -84
- package/fesm2022/daffodil-design-badge.mjs.map +1 -1
- package/fesm2022/daffodil-design-beacon.mjs +109 -47
- package/fesm2022/daffodil-design-beacon.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs +384 -277
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +541 -408
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +349 -224
- package/fesm2022/daffodil-design-callout.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +496 -327
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox.mjs +373 -313
- package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
- package/fesm2022/daffodil-design-container.mjs +103 -60
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +441 -352
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +155 -57
- package/fesm2022/daffodil-design-form.mjs.map +1 -1
- package/fesm2022/daffodil-design-hero.mjs +349 -234
- package/fesm2022/daffodil-design-hero.mjs.map +1 -1
- package/fesm2022/daffodil-design-image-lite.mjs +60 -0
- package/fesm2022/daffodil-design-image-lite.mjs.map +1 -0
- package/fesm2022/daffodil-design-image.mjs +245 -107
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +217 -164
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-list.mjs +308 -170
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +351 -278
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +525 -417
- package/fesm2022/daffodil-design-menu.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +680 -450
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-native-select.mjs +175 -166
- package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar.mjs +145 -68
- package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +376 -226
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +296 -192
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +243 -157
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-radio.mjs +382 -300
- package/fesm2022/daffodil-design-radio.mjs.map +1 -1
- package/fesm2022/daffodil-design-select.mjs +424 -364
- package/fesm2022/daffodil-design-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +874 -887
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-spinner.mjs +156 -99
- package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch.mjs +176 -106
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +685 -427
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-tag.mjs +251 -133
- package/fesm2022/daffodil-design-tag.mjs.map +1 -1
- package/fesm2022/daffodil-design-testing.mjs +4 -16
- package/fesm2022/daffodil-design-testing.mjs.map +1 -1
- package/fesm2022/daffodil-design-text-snippet.mjs +140 -54
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-textarea.mjs +170 -150
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +658 -481
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +456 -469
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design-youtube-player.mjs +168 -115
- package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +1628 -1650
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form-field/README.md +0 -4
- package/form-field/src/form-field-theme.scss +12 -4
- package/image/README.md +4 -0
- package/image-lite/README.md +58 -0
- package/image-lite/src/image-theme.scss +18 -0
- package/list/src/list-base.scss +3 -4
- package/list/src/list-theme.scss +6 -5
- package/media-gallery/README.md +1 -1
- package/media-gallery/src/media-gallery-theme.scss +3 -3
- package/menu/src/menu-theme.scss +6 -2
- package/notification/src/notification-theme.scss +10 -10
- package/package.json +1 -1
- package/scss/global.scss +17 -11
- package/scss/theme.scss +2 -18
- package/scss/theming/_get-palette.scss +0 -3
- package/scss/theming/_index.scss +0 -1
- package/scss/theming/_light-dark.scss +2 -2
- package/scss/theming/_theme-css-variables.scss +1 -1
- package/scss/theming/create-theme/_create-theme.scss +2 -2
- package/scss/theming/get-font-colors/_get-font-colors.scss +7 -25
- package/scss/theming/get-font-colors/_get-font-colors.spec.scss +0 -12
- package/scss/typography/_classes.scss +0 -6
- package/scss/typography/_index.scss +0 -1
- package/scss/typography/mixins/_sizes.scss +0 -1
- package/scss/typography/utilities/_variables.scss +3 -0
- package/select/src/select-theme.scss +10 -14
- package/switch/src/switch-theme.scss +2 -2
- package/tabs/src/tabs-theme.scss +4 -4
- package/types/daffodil-design-accordion.d.ts +92 -67
- package/types/daffodil-design-article.d.ts +49 -56
- package/types/daffodil-design-badge.d.ts +56 -33
- package/types/daffodil-design-beacon.d.ts +35 -14
- package/types/daffodil-design-breadcrumb.d.ts +89 -85
- package/types/daffodil-design-button.d.ts +128 -146
- package/types/daffodil-design-callout.d.ts +55 -39
- package/types/daffodil-design-card.d.ts +66 -56
- package/types/daffodil-design-checkbox.d.ts +211 -167
- package/types/daffodil-design-container.d.ts +17 -16
- package/types/daffodil-design-form-field.d.ts +273 -240
- package/types/daffodil-design-form.d.ts +21 -21
- package/types/daffodil-design-hero.d.ts +55 -39
- package/types/daffodil-design-image-lite.d.ts +17 -0
- package/types/daffodil-design-image.d.ts +89 -55
- package/types/daffodil-design-input.d.ts +86 -72
- package/types/daffodil-design-list.d.ts +49 -43
- package/types/daffodil-design-media-gallery.d.ts +176 -148
- package/types/daffodil-design-menu.d.ts +177 -169
- package/types/daffodil-design-modal.d.ts +205 -205
- package/types/daffodil-design-native-select.d.ts +94 -84
- package/types/daffodil-design-navbar.d.ts +34 -24
- package/types/daffodil-design-notification.d.ts +82 -67
- package/types/daffodil-design-paginator.d.ts +140 -118
- package/types/daffodil-design-progress-bar.d.ts +92 -74
- package/types/daffodil-design-radio.d.ts +183 -144
- package/types/daffodil-design-select.d.ts +207 -178
- package/types/daffodil-design-sidebar.d.ts +270 -253
- package/types/daffodil-design-spinner.d.ts +49 -36
- package/types/daffodil-design-switch.d.ts +77 -46
- package/types/daffodil-design-tabs.d.ts +248 -198
- package/types/daffodil-design-tag.d.ts +91 -56
- package/types/daffodil-design-testing.d.ts +1 -3
- package/types/daffodil-design-text-snippet.d.ts +48 -37
- package/types/daffodil-design-textarea.d.ts +88 -79
- package/types/daffodil-design-toast.d.ts +175 -183
- package/types/daffodil-design-tree.d.ts +186 -169
- package/types/daffodil-design-youtube-player.d.ts +56 -52
- package/types/daffodil-design.d.ts +614 -695
- package/button/src/button/raised/raised-theme.scss +0 -92
- package/button/src/button/underline/underline-theme.scss +0 -141
- package/fesm2022/daffodil-design-link-set.mjs +0 -160
- package/fesm2022/daffodil-design-link-set.mjs.map +0 -1
- package/fesm2022/daffodil-design-quantity-field.mjs +0 -364
- package/fesm2022/daffodil-design-quantity-field.mjs.map +0 -1
- package/link-set/README.md +0 -86
- package/quantity-field/README.md +0 -63
- package/scss/theming/_configure-theme.scss +0 -120
- package/scss/typography/mixins/_font-weight.scss +0 -14
- package/types/daffodil-design-link-set.d.ts +0 -72
- package/types/daffodil-design-quantity-field.d.ts +0 -171
|
@@ -1,250 +1,397 @@
|
|
|
1
|
-
import * as i1 from
|
|
2
|
-
import * as i1
|
|
3
|
-
import { GlobalPositionStrategy } from
|
|
4
|
-
import { ComponentPortal } from
|
|
5
|
-
import * as i0 from
|
|
6
|
-
import {
|
|
7
|
-
import { merge, of
|
|
8
|
-
import { filter, map,
|
|
9
|
-
import * as i2 from
|
|
10
|
-
import { DaffBreakpoints, DaffPrefixDirective,
|
|
11
|
-
import { createConfigInjectionToken } from
|
|
12
|
-
import { NgTemplateOutlet, SlicePipe } from
|
|
13
|
-
import { FaIconComponent } from
|
|
14
|
-
import { faTimes } from
|
|
15
|
-
import * as i2
|
|
16
|
-
import { DAFF_BUTTON_COMPONENTS } from
|
|
17
|
-
import * as i1$1 from
|
|
18
|
-
|
|
1
|
+
import * as i1$2 from "@angular/cdk/layout";
|
|
2
|
+
import * as i1 from "@angular/cdk/overlay";
|
|
3
|
+
import { GlobalPositionStrategy } from "@angular/cdk/overlay";
|
|
4
|
+
import { ComponentPortal } from "@angular/cdk/portal";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import { ChangeDetectionStrategy, Component, Directive, EventEmitter, Inject, Injectable, Input, Optional, Output, SkipSelf, ViewEncapsulation, contentChild, input } from "@angular/core";
|
|
7
|
+
import { EMPTY, merge, of } from "rxjs";
|
|
8
|
+
import { delay, filter, map, take, tap } from "rxjs/operators";
|
|
9
|
+
import * as i2$1 from "@daffodil/design";
|
|
10
|
+
import { DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffPrefixDirective, DaffStatusableDirective } from "@daffodil/design";
|
|
11
|
+
import { createConfigInjectionToken } from "@daffodil/core";
|
|
12
|
+
import { NgTemplateOutlet, SlicePipe } from "@angular/common";
|
|
13
|
+
import { FaIconComponent } from "@fortawesome/angular-fontawesome";
|
|
14
|
+
import { faTimes } from "@fortawesome/free-solid-svg-icons";
|
|
15
|
+
import * as i2 from "@daffodil/design/button";
|
|
16
|
+
import { DAFF_BUTTON_COMPONENTS } from "@daffodil/design/button";
|
|
17
|
+
import * as i1$1 from "@angular/cdk/a11y";
|
|
19
18
|
const daffToastChangesFocus = (toast) => toast.actions?.length > 0;
|
|
20
|
-
|
|
21
19
|
const createPositionStrategy = (position) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
return strat;
|
|
20
|
+
const strat = new GlobalPositionStrategy();
|
|
21
|
+
switch (position.horizontal) {
|
|
22
|
+
case "left":
|
|
23
|
+
strat.left("48px");
|
|
24
|
+
break;
|
|
25
|
+
case "right":
|
|
26
|
+
strat.right("48px");
|
|
27
|
+
break;
|
|
28
|
+
case "center":
|
|
29
|
+
strat.centerHorizontally();
|
|
30
|
+
break;
|
|
31
|
+
default: strat.right("48px");
|
|
32
|
+
}
|
|
33
|
+
switch (position.vertical) {
|
|
34
|
+
case "top":
|
|
35
|
+
strat.top("80px");
|
|
36
|
+
break;
|
|
37
|
+
case "bottom":
|
|
38
|
+
strat.bottom("48px");
|
|
39
|
+
break;
|
|
40
|
+
default: strat.top("80px");
|
|
41
|
+
}
|
|
42
|
+
return strat;
|
|
47
43
|
};
|
|
48
|
-
|
|
49
|
-
;
|
|
50
|
-
;
|
|
51
44
|
const daffToastDefaultOptions = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
position: {
|
|
46
|
+
vertical: "top",
|
|
47
|
+
horizontal: "right"
|
|
48
|
+
},
|
|
49
|
+
useParent: true
|
|
57
50
|
};
|
|
58
|
-
const { token: DAFF_TOAST_OPTIONS, provider: provideDaffToastOptions
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
i0.ɵɵ
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
51
|
+
const { token: DAFF_TOAST_OPTIONS, provider: provideDaffToastOptions } = createConfigInjectionToken(daffToastDefaultOptions, "DAFF_TOAST_OPTIONS");
|
|
52
|
+
var DaffToastPositionService = class DaffToastPositionService {
|
|
53
|
+
constructor(options, mediaQuery) {
|
|
54
|
+
this.options = options;
|
|
55
|
+
this.mediaQuery = mediaQuery;
|
|
56
|
+
this._config = options.position;
|
|
57
|
+
}
|
|
58
|
+
get config() {
|
|
59
|
+
return this.mediaQuery.isMatched(DaffBreakpoints.MOBILE) ? this._position ?? this._config : {
|
|
60
|
+
vertical: "bottom",
|
|
61
|
+
horizontal: "center"
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
set config(val) {
|
|
65
|
+
this._config = val;
|
|
66
|
+
}
|
|
67
|
+
setPosition(position) {
|
|
68
|
+
this._position = position;
|
|
69
|
+
}
|
|
70
|
+
static {
|
|
71
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
72
|
+
minVersion: "12.0.0",
|
|
73
|
+
version: "22.2.4",
|
|
74
|
+
ngImport: i0,
|
|
75
|
+
type: DaffToastPositionService,
|
|
76
|
+
deps: [{ token: DAFF_TOAST_OPTIONS }, { token: i1$2.BreakpointObserver }],
|
|
77
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
static {
|
|
81
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
82
|
+
minVersion: "12.0.0",
|
|
83
|
+
version: "22.2.4",
|
|
84
|
+
ngImport: i0,
|
|
85
|
+
type: DaffToastPositionService
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
90
|
+
minVersion: "12.0.0",
|
|
91
|
+
version: "22.2.4",
|
|
92
|
+
ngImport: i0,
|
|
93
|
+
type: DaffToastPositionService,
|
|
94
|
+
decorators: [{ type: Injectable }],
|
|
95
|
+
ctorParameters: () => [{
|
|
96
|
+
type: void 0,
|
|
97
|
+
decorators: [{
|
|
98
|
+
type: Inject,
|
|
99
|
+
args: [DAFF_TOAST_OPTIONS]
|
|
100
|
+
}]
|
|
101
|
+
}, { type: i1$2.BreakpointObserver }]
|
|
102
|
+
});
|
|
95
103
|
const daffDefaultToastConfiguration = {};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
104
|
+
var DaffToastActionsDirective = class DaffToastActionsDirective {
|
|
105
|
+
static {
|
|
106
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
107
|
+
minVersion: "12.0.0",
|
|
108
|
+
version: "22.2.4",
|
|
109
|
+
ngImport: i0,
|
|
110
|
+
type: DaffToastActionsDirective,
|
|
111
|
+
deps: [],
|
|
112
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
static {
|
|
116
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
117
|
+
minVersion: "14.0.0",
|
|
118
|
+
version: "22.2.4",
|
|
119
|
+
type: DaffToastActionsDirective,
|
|
120
|
+
isStandalone: true,
|
|
121
|
+
selector: "[daffToastActions]",
|
|
122
|
+
host: { classAttribute: "daff-toast__actions" },
|
|
123
|
+
ngImport: i0
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
128
|
+
minVersion: "12.0.0",
|
|
129
|
+
version: "22.2.4",
|
|
130
|
+
ngImport: i0,
|
|
131
|
+
type: DaffToastActionsDirective,
|
|
132
|
+
decorators: [{
|
|
133
|
+
type: Directive,
|
|
134
|
+
args: [{
|
|
135
|
+
selector: "[daffToastActions]",
|
|
136
|
+
host: { class: "daff-toast__actions" }
|
|
137
|
+
}]
|
|
138
|
+
}]
|
|
139
|
+
});
|
|
140
|
+
var DaffToastComponent = class DaffToastComponent {
|
|
141
|
+
onEscape() {
|
|
142
|
+
this.toast().dismiss();
|
|
143
|
+
}
|
|
144
|
+
constructor(_elementRef, _focusTrapFactory, _focusStack) {
|
|
145
|
+
this._elementRef = _elementRef;
|
|
146
|
+
this._focusTrapFactory = _focusTrapFactory;
|
|
147
|
+
this._focusStack = _focusStack;
|
|
148
|
+
this._actions = contentChild(DaffToastActionsDirective, ...ngDevMode ? [{ debugName: "_actions" }] : /* istanbul ignore next */ []);
|
|
149
|
+
this._prefix = contentChild(DaffPrefixDirective, ...ngDevMode ? [{ debugName: "_prefix" }] : /* istanbul ignore next */ []);
|
|
150
|
+
this.toast = input.required(...ngDevMode ? [{ debugName: "toast" }] : /* istanbul ignore next */ []);
|
|
151
|
+
}
|
|
152
|
+
ngAfterContentInit() {
|
|
153
|
+
if (daffToastChangesFocus(this.toast())) this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
|
|
154
|
+
}
|
|
155
|
+
ngAfterViewInit() {
|
|
156
|
+
if (daffToastChangesFocus(this.toast())) {
|
|
157
|
+
this._focusStack.push();
|
|
158
|
+
this._focusTrap.focusFirstTabbableElementWhenReady();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
ngOnDestroy() {
|
|
162
|
+
if (daffToastChangesFocus(this.toast())) this._focusTrap.destroy();
|
|
163
|
+
}
|
|
164
|
+
static {
|
|
165
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
166
|
+
minVersion: "12.0.0",
|
|
167
|
+
version: "22.2.4",
|
|
168
|
+
ngImport: i0,
|
|
169
|
+
type: DaffToastComponent,
|
|
170
|
+
deps: [
|
|
171
|
+
{ token: i0.ElementRef },
|
|
172
|
+
{ token: i1$1.ConfigurableFocusTrapFactory },
|
|
173
|
+
{ token: i2$1.DaffFocusStackService }
|
|
174
|
+
],
|
|
175
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
static {
|
|
179
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
180
|
+
minVersion: "17.0.0",
|
|
181
|
+
version: "22.2.4",
|
|
182
|
+
type: DaffToastComponent,
|
|
183
|
+
isStandalone: true,
|
|
184
|
+
selector: "daff-toast",
|
|
185
|
+
inputs: { toast: {
|
|
186
|
+
classPropertyName: "toast",
|
|
187
|
+
publicName: "toast",
|
|
188
|
+
isSignal: true,
|
|
189
|
+
isRequired: true,
|
|
190
|
+
transformFunction: null
|
|
191
|
+
} },
|
|
192
|
+
host: {
|
|
193
|
+
listeners: { "keydown.escape": "onEscape()" },
|
|
194
|
+
classAttribute: "daff-toast"
|
|
195
|
+
},
|
|
196
|
+
queries: [{
|
|
197
|
+
propertyName: "_actions",
|
|
198
|
+
first: true,
|
|
199
|
+
predicate: DaffToastActionsDirective,
|
|
200
|
+
descendants: true,
|
|
201
|
+
isSignal: true
|
|
202
|
+
}, {
|
|
203
|
+
propertyName: "_prefix",
|
|
204
|
+
first: true,
|
|
205
|
+
predicate: DaffPrefixDirective,
|
|
206
|
+
descendants: true,
|
|
207
|
+
isSignal: true
|
|
208
|
+
}],
|
|
209
|
+
hostDirectives: [{ directive: i2$1.DaffArticleEncapsulatedDirective }, {
|
|
210
|
+
directive: i2$1.DaffStatusableDirective,
|
|
211
|
+
inputs: ["status", "status"]
|
|
212
|
+
}],
|
|
213
|
+
ngImport: i0,
|
|
214
|
+
template: "@if (_prefix()) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-toast__details\">\n <div class=\"daff-toast__content\">\n <ng-content select=\"[daffToastTitle]\"></ng-content>\n <ng-content select=\"[daffToastMessage]\"></ng-content>\n </div>\n <ng-content select=\"[daffToastActions]\"></ng-content>\n</div>\n<ng-content></ng-content>\n",
|
|
215
|
+
styles: [".daff-toast{display:flex;border-radius:.25rem;font-size:1rem;line-height:1.5rem;position:relative;min-width:15rem;max-width:90vw}@media(min-width:480px){.daff-toast{max-width:22rem}}.daff-toast+div+.daff-toast{margin-top:.75rem}.daff-toast+div+div+.daff-toast{margin-top:.75rem}.daff-toast+.daff-toast{margin-top:.75rem}.daff-toast:before{content:\"\";border-radius:.25rem 0 0 .25rem;position:absolute;height:100%;left:0;top:0;width:.25rem}.daff-toast .daff-prefix{padding:1rem 0 1rem 1rem}.daff-toast__close-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;background:none;border:none;color:currentColor;margin:0;min-height:3rem;height:3rem;min-width:3rem;width:3rem}.daff-toast__details{display:block;font-size:1rem;line-height:1.5rem;width:100%}.daff-toast__content{display:flex;flex-direction:column;gap:.25rem;padding:1rem}.daff-toast__title{font-weight:600}.daff-toast__message{font-weight:400;line-height:1.25rem}.daff-toast__actions{display:flex;align-items:center;gap:.5rem;min-height:3rem;padding:0 1rem 1rem}@keyframes slideInLeft{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideInRight{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes slideInTop{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slideInBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}.daff-toast.slide-in-left{animation:slideInLeft .3s ease-out}.daff-toast.slide-in-right{animation:slideInRight .3s ease-out}.daff-toast.slide-in-top{animation:slideInTop .3s ease-out}.daff-toast.slide-in-bottom{animation:slideInBottom .3s ease-out}@media screen and (prefers-reduced-motion:reduce){.daff-toast.slide-in-left,.daff-toast.slide-in-right,.daff-toast.slide-in-top,.daff-toast.slide-in-bottom{animation:none}}\n"],
|
|
216
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
217
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
222
|
+
minVersion: "12.0.0",
|
|
223
|
+
version: "22.2.4",
|
|
224
|
+
ngImport: i0,
|
|
225
|
+
type: DaffToastComponent,
|
|
226
|
+
decorators: [{
|
|
227
|
+
type: Component,
|
|
228
|
+
args: [{
|
|
229
|
+
selector: "daff-toast",
|
|
230
|
+
hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }, {
|
|
231
|
+
directive: DaffStatusableDirective,
|
|
232
|
+
inputs: ["status"]
|
|
233
|
+
}],
|
|
234
|
+
host: {
|
|
235
|
+
class: "daff-toast",
|
|
236
|
+
"(keydown.escape)": "onEscape()"
|
|
237
|
+
},
|
|
238
|
+
encapsulation: ViewEncapsulation.None,
|
|
239
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
240
|
+
template: "@if (_prefix()) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-toast__details\">\n <div class=\"daff-toast__content\">\n <ng-content select=\"[daffToastTitle]\"></ng-content>\n <ng-content select=\"[daffToastMessage]\"></ng-content>\n </div>\n <ng-content select=\"[daffToastActions]\"></ng-content>\n</div>\n<ng-content></ng-content>\n",
|
|
241
|
+
styles: [".daff-toast{display:flex;border-radius:.25rem;font-size:1rem;line-height:1.5rem;position:relative;min-width:15rem;max-width:90vw}@media(min-width:480px){.daff-toast{max-width:22rem}}.daff-toast+div+.daff-toast{margin-top:.75rem}.daff-toast+div+div+.daff-toast{margin-top:.75rem}.daff-toast+.daff-toast{margin-top:.75rem}.daff-toast:before{content:\"\";border-radius:.25rem 0 0 .25rem;position:absolute;height:100%;left:0;top:0;width:.25rem}.daff-toast .daff-prefix{padding:1rem 0 1rem 1rem}.daff-toast__close-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;background:none;border:none;color:currentColor;margin:0;min-height:3rem;height:3rem;min-width:3rem;width:3rem}.daff-toast__details{display:block;font-size:1rem;line-height:1.5rem;width:100%}.daff-toast__content{display:flex;flex-direction:column;gap:.25rem;padding:1rem}.daff-toast__title{font-weight:600}.daff-toast__message{font-weight:400;line-height:1.25rem}.daff-toast__actions{display:flex;align-items:center;gap:.5rem;min-height:3rem;padding:0 1rem 1rem}@keyframes slideInLeft{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideInRight{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes slideInTop{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slideInBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}.daff-toast.slide-in-left{animation:slideInLeft .3s ease-out}.daff-toast.slide-in-right{animation:slideInRight .3s ease-out}.daff-toast.slide-in-top{animation:slideInTop .3s ease-out}.daff-toast.slide-in-bottom{animation:slideInBottom .3s ease-out}@media screen and (prefers-reduced-motion:reduce){.daff-toast.slide-in-left,.daff-toast.slide-in-right,.daff-toast.slide-in-top,.daff-toast.slide-in-bottom{animation:none}}\n"]
|
|
242
|
+
}]
|
|
243
|
+
}],
|
|
244
|
+
ctorParameters: () => [
|
|
245
|
+
{ type: i0.ElementRef },
|
|
246
|
+
{ type: i1$1.ConfigurableFocusTrapFactory },
|
|
247
|
+
{ type: i2$1.DaffFocusStackService }
|
|
248
|
+
],
|
|
249
|
+
propDecorators: {
|
|
250
|
+
_actions: [{
|
|
251
|
+
type: i0.ContentChild,
|
|
252
|
+
args: [i0.forwardRef(() => DaffToastActionsDirective), { isSignal: true }]
|
|
253
|
+
}],
|
|
254
|
+
_prefix: [{
|
|
255
|
+
type: i0.ContentChild,
|
|
256
|
+
args: [i0.forwardRef(() => DaffPrefixDirective), { isSignal: true }]
|
|
257
|
+
}],
|
|
258
|
+
toast: [{
|
|
259
|
+
type: i0.Input,
|
|
260
|
+
args: [{
|
|
261
|
+
isSignal: true,
|
|
262
|
+
alias: "toast",
|
|
263
|
+
required: true
|
|
264
|
+
}]
|
|
265
|
+
}]
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
var DaffToastMessageDirective = class DaffToastMessageDirective {
|
|
269
|
+
static {
|
|
270
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
271
|
+
minVersion: "12.0.0",
|
|
272
|
+
version: "22.2.4",
|
|
273
|
+
ngImport: i0,
|
|
274
|
+
type: DaffToastMessageDirective,
|
|
275
|
+
deps: [],
|
|
276
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
static {
|
|
280
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
281
|
+
minVersion: "14.0.0",
|
|
282
|
+
version: "22.2.4",
|
|
283
|
+
type: DaffToastMessageDirective,
|
|
284
|
+
isStandalone: true,
|
|
285
|
+
selector: "[daffToastMessage]",
|
|
286
|
+
host: { classAttribute: "daff-toast__message" },
|
|
287
|
+
ngImport: i0
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
292
|
+
minVersion: "12.0.0",
|
|
293
|
+
version: "22.2.4",
|
|
294
|
+
ngImport: i0,
|
|
295
|
+
type: DaffToastMessageDirective,
|
|
296
|
+
decorators: [{
|
|
297
|
+
type: Directive,
|
|
298
|
+
args: [{
|
|
299
|
+
selector: "[daffToastMessage]",
|
|
300
|
+
host: { "class": "daff-toast__message" }
|
|
301
|
+
}]
|
|
302
|
+
}]
|
|
303
|
+
});
|
|
304
|
+
var DaffToastTitleDirective = class DaffToastTitleDirective {
|
|
305
|
+
static {
|
|
306
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
307
|
+
minVersion: "12.0.0",
|
|
308
|
+
version: "22.2.4",
|
|
309
|
+
ngImport: i0,
|
|
310
|
+
type: DaffToastTitleDirective,
|
|
311
|
+
deps: [],
|
|
312
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
static {
|
|
316
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
317
|
+
minVersion: "14.0.0",
|
|
318
|
+
version: "22.2.4",
|
|
319
|
+
type: DaffToastTitleDirective,
|
|
320
|
+
isStandalone: true,
|
|
321
|
+
selector: "[daffToastTitle]",
|
|
322
|
+
host: { classAttribute: "daff-toast__title" },
|
|
323
|
+
ngImport: i0
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
328
|
+
minVersion: "12.0.0",
|
|
329
|
+
version: "22.2.4",
|
|
330
|
+
ngImport: i0,
|
|
331
|
+
type: DaffToastTitleDirective,
|
|
332
|
+
decorators: [{
|
|
333
|
+
type: Directive,
|
|
334
|
+
args: [{
|
|
335
|
+
selector: "[daffToastTitle]",
|
|
336
|
+
host: { "class": "daff-toast__title" }
|
|
337
|
+
}]
|
|
338
|
+
}]
|
|
339
|
+
});
|
|
340
|
+
var DaffToastTemplateComponent = class DaffToastTemplateComponent {
|
|
341
|
+
constructor(cd, options, toastPosition) {
|
|
342
|
+
this.cd = cd;
|
|
343
|
+
this.options = options;
|
|
344
|
+
this.toastPosition = toastPosition;
|
|
345
|
+
this.faTimes = faTimes;
|
|
346
|
+
this._items = [];
|
|
347
|
+
this.closeToast = new EventEmitter();
|
|
348
|
+
}
|
|
349
|
+
onCloseToast(event) {
|
|
350
|
+
this.closeToast.emit();
|
|
351
|
+
}
|
|
352
|
+
getAnimationDirection() {
|
|
353
|
+
switch (this.toastPosition.config.horizontal + "-" + this.toastPosition.config.vertical) {
|
|
354
|
+
case "left-top":
|
|
355
|
+
case "left-bottom": return "left";
|
|
356
|
+
case "right-top":
|
|
357
|
+
case "right-bottom": return "right";
|
|
358
|
+
case "center-top": return "top";
|
|
359
|
+
case "center-bottom": return "bottom";
|
|
360
|
+
default: return "left";
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
get items() {
|
|
364
|
+
return this._items;
|
|
365
|
+
}
|
|
366
|
+
set items(value) {
|
|
367
|
+
this._items = value;
|
|
368
|
+
this.cd.markForCheck();
|
|
369
|
+
}
|
|
370
|
+
static {
|
|
371
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
372
|
+
minVersion: "12.0.0",
|
|
373
|
+
version: "22.2.4",
|
|
374
|
+
ngImport: i0,
|
|
375
|
+
type: DaffToastTemplateComponent,
|
|
376
|
+
deps: [
|
|
377
|
+
{ token: i0.ChangeDetectorRef },
|
|
378
|
+
{ token: DAFF_TOAST_OPTIONS },
|
|
379
|
+
{ token: DaffToastPositionService }
|
|
380
|
+
],
|
|
381
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
static {
|
|
385
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
386
|
+
minVersion: "17.0.0",
|
|
387
|
+
version: "22.2.4",
|
|
388
|
+
type: DaffToastTemplateComponent,
|
|
389
|
+
isStandalone: true,
|
|
390
|
+
selector: "ng-component",
|
|
391
|
+
inputs: { items: "items" },
|
|
392
|
+
outputs: { closeToast: "closeToast" },
|
|
393
|
+
ngImport: i0,
|
|
394
|
+
template: `
|
|
248
395
|
@for (item of items | slice:0:3; track item) {
|
|
249
396
|
<daff-toast
|
|
250
397
|
[toast]="item"
|
|
@@ -296,16 +443,6 @@ class DaffToastTemplateComponent {
|
|
|
296
443
|
{{ action.content }}
|
|
297
444
|
</button>
|
|
298
445
|
}
|
|
299
|
-
@case ('underline') {
|
|
300
|
-
<button type="button" daff-underline-button
|
|
301
|
-
[status]="action.status"
|
|
302
|
-
[color]="action.color"
|
|
303
|
-
[size]="action.size"
|
|
304
|
-
[attr.aria-label]="action.content"
|
|
305
|
-
(click)="action.eventEmitter?.emit({ event: $event, action})">
|
|
306
|
-
{{ action.content }}
|
|
307
|
-
</button>
|
|
308
|
-
}
|
|
309
446
|
@default {
|
|
310
447
|
<button type="button" daff-button
|
|
311
448
|
[status]="action.status"
|
|
@@ -318,13 +455,119 @@ class DaffToastTemplateComponent {
|
|
|
318
455
|
}
|
|
319
456
|
}
|
|
320
457
|
</ng-template>
|
|
321
|
-
`,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
458
|
+
`,
|
|
459
|
+
isInline: true,
|
|
460
|
+
dependencies: [
|
|
461
|
+
{
|
|
462
|
+
kind: "component",
|
|
463
|
+
type: i2.DaffButtonComponent,
|
|
464
|
+
selector: "button[daff-button],a[daff-button]",
|
|
465
|
+
inputs: ["elevated"]
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
kind: "component",
|
|
469
|
+
type: i2.DaffFlatButtonComponent,
|
|
470
|
+
selector: "button[daff-flat-button],a[daff-flat-button]"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
kind: "component",
|
|
474
|
+
type: i2.DaffIconButtonComponent,
|
|
475
|
+
selector: "button[daff-icon-button],a[daff-icon-button]"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
kind: "component",
|
|
479
|
+
type: i2.DaffStrokedButtonComponent,
|
|
480
|
+
selector: "button[daff-stroked-button],a[daff-stroked-button]",
|
|
481
|
+
inputs: ["elevated"]
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
kind: "component",
|
|
485
|
+
type: DaffToastComponent,
|
|
486
|
+
selector: "daff-toast",
|
|
487
|
+
inputs: ["toast"]
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
kind: "directive",
|
|
491
|
+
type: DaffToastActionsDirective,
|
|
492
|
+
selector: "[daffToastActions]"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
kind: "directive",
|
|
496
|
+
type: DaffToastTitleDirective,
|
|
497
|
+
selector: "[daffToastTitle]"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
kind: "directive",
|
|
501
|
+
type: DaffToastMessageDirective,
|
|
502
|
+
selector: "[daffToastMessage]"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
kind: "component",
|
|
506
|
+
type: FaIconComponent,
|
|
507
|
+
selector: "fa-icon",
|
|
508
|
+
inputs: [
|
|
509
|
+
"icon",
|
|
510
|
+
"title",
|
|
511
|
+
"animation",
|
|
512
|
+
"mask",
|
|
513
|
+
"flip",
|
|
514
|
+
"size",
|
|
515
|
+
"pull",
|
|
516
|
+
"border",
|
|
517
|
+
"inverse",
|
|
518
|
+
"symbol",
|
|
519
|
+
"rotate",
|
|
520
|
+
"fixedWidth",
|
|
521
|
+
"transform",
|
|
522
|
+
"a11yRole"
|
|
523
|
+
],
|
|
524
|
+
outputs: [
|
|
525
|
+
"iconChange",
|
|
526
|
+
"titleChange",
|
|
527
|
+
"animationChange",
|
|
528
|
+
"maskChange",
|
|
529
|
+
"flipChange",
|
|
530
|
+
"sizeChange",
|
|
531
|
+
"pullChange",
|
|
532
|
+
"borderChange",
|
|
533
|
+
"inverseChange",
|
|
534
|
+
"symbolChange",
|
|
535
|
+
"rotateChange",
|
|
536
|
+
"fixedWidthChange",
|
|
537
|
+
"transformChange",
|
|
538
|
+
"a11yRoleChange"
|
|
539
|
+
]
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
kind: "directive",
|
|
543
|
+
type: NgTemplateOutlet,
|
|
544
|
+
selector: "[ngTemplateOutlet]",
|
|
545
|
+
inputs: [
|
|
546
|
+
"ngTemplateOutletContext",
|
|
547
|
+
"ngTemplateOutlet",
|
|
548
|
+
"ngTemplateOutletInjector"
|
|
549
|
+
]
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
kind: "pipe",
|
|
553
|
+
type: SlicePipe,
|
|
554
|
+
name: "slice"
|
|
555
|
+
}
|
|
556
|
+
],
|
|
557
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
562
|
+
minVersion: "12.0.0",
|
|
563
|
+
version: "22.2.4",
|
|
564
|
+
ngImport: i0,
|
|
565
|
+
type: DaffToastTemplateComponent,
|
|
566
|
+
decorators: [{
|
|
567
|
+
type: Component,
|
|
568
|
+
args: [{
|
|
569
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
570
|
+
template: `
|
|
328
571
|
@for (item of items | slice:0:3; track item) {
|
|
329
572
|
<daff-toast
|
|
330
573
|
[toast]="item"
|
|
@@ -376,16 +619,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
376
619
|
{{ action.content }}
|
|
377
620
|
</button>
|
|
378
621
|
}
|
|
379
|
-
@case ('underline') {
|
|
380
|
-
<button type="button" daff-underline-button
|
|
381
|
-
[status]="action.status"
|
|
382
|
-
[color]="action.color"
|
|
383
|
-
[size]="action.size"
|
|
384
|
-
[attr.aria-label]="action.content"
|
|
385
|
-
(click)="action.eventEmitter?.emit({ event: $event, action})">
|
|
386
|
-
{{ action.content }}
|
|
387
|
-
</button>
|
|
388
|
-
}
|
|
389
622
|
@default {
|
|
390
623
|
<button type="button" daff-button
|
|
391
624
|
[status]="action.status"
|
|
@@ -399,219 +632,163 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
399
632
|
}
|
|
400
633
|
</ng-template>
|
|
401
634
|
`,
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
throw new Error('The Toast that you are trying to remove does not exist.');
|
|
555
|
-
}
|
|
556
|
-
this._toasts = this._toasts.filter(m => m !== toast);
|
|
557
|
-
this._template.instance.items = [...this._toasts];
|
|
558
|
-
if (this._toasts.length === 0) {
|
|
559
|
-
this._overlayRef.dispose();
|
|
560
|
-
this._template.destroy();
|
|
561
|
-
this._overlayRef = undefined;
|
|
562
|
-
this._template = undefined;
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastService, deps: [{ token: i1$2.Overlay }, { token: DAFF_TOAST_OPTIONS }, { token: DaffToastService, optional: true, skipSelf: true }, { token: i1.BreakpointObserver }, { token: DaffToastPositionService }, { token: i2.DaffFocusStackService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
566
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastService }); }
|
|
567
|
-
}
|
|
568
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastService, decorators: [{
|
|
569
|
-
type: Injectable
|
|
570
|
-
}], ctorParameters: () => [{ type: i1$2.Overlay }, { type: undefined, decorators: [{
|
|
571
|
-
type: Inject,
|
|
572
|
-
args: [DAFF_TOAST_OPTIONS]
|
|
573
|
-
}] }, { type: DaffToastService, decorators: [{
|
|
574
|
-
type: Optional
|
|
575
|
-
}, {
|
|
576
|
-
type: SkipSelf
|
|
577
|
-
}] }, { type: i1.BreakpointObserver }, { type: DaffToastPositionService }, { type: i2.DaffFocusStackService }, { type: i0.Injector }] });
|
|
578
|
-
|
|
579
|
-
/**
|
|
580
|
-
* Registers the `DaffToastService` for displaying a toast. This provider ensures
|
|
581
|
-
* toasts function correctly within your application.
|
|
582
|
-
*
|
|
583
|
-
* ```ts
|
|
584
|
-
* import { provideDaffToast } from '@daffodil/design/toast';
|
|
585
|
-
*
|
|
586
|
-
* @NgModule({
|
|
587
|
-
* providers: [
|
|
588
|
-
* provideDaffToast({
|
|
589
|
-
* position: {
|
|
590
|
-
* vertical: 'bottom',
|
|
591
|
-
* horizontal: 'left',
|
|
592
|
-
* },
|
|
593
|
-
* }),
|
|
594
|
-
* ]
|
|
595
|
-
* )}
|
|
596
|
-
*
|
|
597
|
-
* export class AppModule {}
|
|
598
|
-
* ```
|
|
599
|
-
* @param config Sets the configuration for all toasts.
|
|
600
|
-
* Toasts are displayed in the top-right corner of the screen by default on desktop devices.
|
|
601
|
-
*
|
|
602
|
-
* On mobile devices, toasts will always appear in the bottom-center position,
|
|
603
|
-
* regardless of configuration settings.
|
|
604
|
-
*
|
|
605
|
-
*/
|
|
635
|
+
imports: [
|
|
636
|
+
DAFF_BUTTON_COMPONENTS,
|
|
637
|
+
DaffToastComponent,
|
|
638
|
+
DaffToastActionsDirective,
|
|
639
|
+
DaffToastTitleDirective,
|
|
640
|
+
DaffToastMessageDirective,
|
|
641
|
+
FaIconComponent,
|
|
642
|
+
SlicePipe,
|
|
643
|
+
NgTemplateOutlet
|
|
644
|
+
]
|
|
645
|
+
}]
|
|
646
|
+
}],
|
|
647
|
+
ctorParameters: () => [
|
|
648
|
+
{ type: i0.ChangeDetectorRef },
|
|
649
|
+
{
|
|
650
|
+
type: void 0,
|
|
651
|
+
decorators: [{
|
|
652
|
+
type: Inject,
|
|
653
|
+
args: [DAFF_TOAST_OPTIONS]
|
|
654
|
+
}]
|
|
655
|
+
},
|
|
656
|
+
{ type: DaffToastPositionService }
|
|
657
|
+
],
|
|
658
|
+
propDecorators: {
|
|
659
|
+
closeToast: [{ type: Output }],
|
|
660
|
+
items: [{ type: Input }]
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
var DaffToastService = class DaffToastService {
|
|
664
|
+
constructor(overlay, options, _parentToast, mediaQuery, toastPosition, focusStack, injector) {
|
|
665
|
+
this.overlay = overlay;
|
|
666
|
+
this.options = options;
|
|
667
|
+
this._parentToast = _parentToast;
|
|
668
|
+
this.mediaQuery = mediaQuery;
|
|
669
|
+
this.toastPosition = toastPosition;
|
|
670
|
+
this.focusStack = focusStack;
|
|
671
|
+
this.injector = injector;
|
|
672
|
+
this._toasts = [];
|
|
673
|
+
this._sub = this.mediaQuery.observe(DaffBreakpoints.MOBILE).pipe(filter(() => this._overlayRef !== void 0), map((position) => createPositionStrategy(this.toastPosition.config)), tap((strategy) => this._overlayRef.updatePositionStrategy(strategy))).subscribe();
|
|
674
|
+
}
|
|
675
|
+
ngOnDestroy() {
|
|
676
|
+
this._sub.unsubscribe();
|
|
677
|
+
}
|
|
678
|
+
_attachToastTemplate(overlayRef) {
|
|
679
|
+
return overlayRef.attach(new ComponentPortal(DaffToastTemplateComponent, null, this.injector));
|
|
680
|
+
}
|
|
681
|
+
_createOverlayRef() {
|
|
682
|
+
return this.overlay.create({
|
|
683
|
+
hasBackdrop: false,
|
|
684
|
+
scrollStrategy: this.overlay.scrollStrategies.noop(),
|
|
685
|
+
positionStrategy: createPositionStrategy(this.toastPosition.config)
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
open(toast, configuration) {
|
|
689
|
+
if (this._parentToast && this.options.useParent) return this._parentToast.open(toast, configuration);
|
|
690
|
+
const config = {
|
|
691
|
+
...daffDefaultToastConfiguration,
|
|
692
|
+
duration: toast.actions?.length > 0 ? void 0 : 5e3,
|
|
693
|
+
...configuration
|
|
694
|
+
};
|
|
695
|
+
if (this._toasts.length === 0) {
|
|
696
|
+
this._overlayRef = this._createOverlayRef();
|
|
697
|
+
this._template = this._attachToastTemplate(this._overlayRef);
|
|
698
|
+
}
|
|
699
|
+
const dismissEvent = new EventEmitter();
|
|
700
|
+
const _toastPlus = {
|
|
701
|
+
dismissible: true,
|
|
702
|
+
...toast,
|
|
703
|
+
dismiss: () => {
|
|
704
|
+
dismissEvent.emit();
|
|
705
|
+
},
|
|
706
|
+
dismissalStream: merge(config.duration ? of(void 0).pipe(delay(config.duration)) : EMPTY, dismissEvent).pipe(take(1))
|
|
707
|
+
};
|
|
708
|
+
_toastPlus.dismissalStream.subscribe(() => {
|
|
709
|
+
this.close(_toastPlus);
|
|
710
|
+
});
|
|
711
|
+
this._toasts = [_toastPlus, ...this._toasts];
|
|
712
|
+
this._template.instance.items = this._toasts;
|
|
713
|
+
return _toastPlus;
|
|
714
|
+
}
|
|
715
|
+
close(toast) {
|
|
716
|
+
if (this._parentToast && this.options.useParent) {
|
|
717
|
+
this._parentToast.close(toast);
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
if (daffToastChangesFocus(toast)) this.focusStack.pop();
|
|
721
|
+
if (this._toasts.indexOf(toast) === -1) throw new Error("The Toast that you are trying to remove does not exist.");
|
|
722
|
+
this._toasts = this._toasts.filter((m) => m !== toast);
|
|
723
|
+
this._template.instance.items = [...this._toasts];
|
|
724
|
+
if (this._toasts.length === 0) {
|
|
725
|
+
this._overlayRef.dispose();
|
|
726
|
+
this._template.destroy();
|
|
727
|
+
this._overlayRef = void 0;
|
|
728
|
+
this._template = void 0;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
static {
|
|
732
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
733
|
+
minVersion: "12.0.0",
|
|
734
|
+
version: "22.2.4",
|
|
735
|
+
ngImport: i0,
|
|
736
|
+
type: DaffToastService,
|
|
737
|
+
deps: [
|
|
738
|
+
{ token: i1.Overlay },
|
|
739
|
+
{ token: DAFF_TOAST_OPTIONS },
|
|
740
|
+
{
|
|
741
|
+
token: DaffToastService,
|
|
742
|
+
optional: true,
|
|
743
|
+
skipSelf: true
|
|
744
|
+
},
|
|
745
|
+
{ token: i1$2.BreakpointObserver },
|
|
746
|
+
{ token: DaffToastPositionService },
|
|
747
|
+
{ token: i2$1.DaffFocusStackService },
|
|
748
|
+
{ token: i0.Injector }
|
|
749
|
+
],
|
|
750
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
static {
|
|
754
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
755
|
+
minVersion: "12.0.0",
|
|
756
|
+
version: "22.2.4",
|
|
757
|
+
ngImport: i0,
|
|
758
|
+
type: DaffToastService
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
763
|
+
minVersion: "12.0.0",
|
|
764
|
+
version: "22.2.4",
|
|
765
|
+
ngImport: i0,
|
|
766
|
+
type: DaffToastService,
|
|
767
|
+
decorators: [{ type: Injectable }],
|
|
768
|
+
ctorParameters: () => [
|
|
769
|
+
{ type: i1.Overlay },
|
|
770
|
+
{
|
|
771
|
+
type: void 0,
|
|
772
|
+
decorators: [{
|
|
773
|
+
type: Inject,
|
|
774
|
+
args: [DAFF_TOAST_OPTIONS]
|
|
775
|
+
}]
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
type: DaffToastService,
|
|
779
|
+
decorators: [{ type: Optional }, { type: SkipSelf }]
|
|
780
|
+
},
|
|
781
|
+
{ type: i1$2.BreakpointObserver },
|
|
782
|
+
{ type: DaffToastPositionService },
|
|
783
|
+
{ type: i2$1.DaffFocusStackService },
|
|
784
|
+
{ type: i0.Injector }
|
|
785
|
+
]
|
|
786
|
+
});
|
|
606
787
|
const provideDaffToast = (config = daffToastDefaultOptions) => [
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
788
|
+
DaffToastService,
|
|
789
|
+
DaffToastPositionService,
|
|
790
|
+
provideDaffToastOptions(config)
|
|
610
791
|
];
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* Generated bundle index. Do not edit.
|
|
614
|
-
*/
|
|
615
|
-
|
|
616
792
|
export { DaffToastService, provideDaffToast };
|
|
617
|
-
|
|
793
|
+
|
|
794
|
+
//# sourceMappingURL=daffodil-design-toast.mjs.map
|