ngx-wapp-components 3.4.2 → 3.4.3-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngx-wapp-components-home-preview.mjs +1041 -0
- package/fesm2022/ngx-wapp-components-home-preview.mjs.map +1 -0
- package/fesm2022/ngx-wapp-components-schema-form.mjs +1018 -0
- package/fesm2022/ngx-wapp-components-schema-form.mjs.map +1 -0
- package/fesm2022/ngx-wapp-components.mjs +825 -576
- package/fesm2022/ngx-wapp-components.mjs.map +1 -1
- package/home-preview/README.md +53 -0
- package/package.json +25 -2
- package/schema-form/README.md +151 -0
- package/types/ngx-wapp-components-home-preview.d.ts +572 -0
- package/types/ngx-wapp-components-schema-form.d.ts +253 -0
- package/types/ngx-wapp-components.d.ts +402 -338
- package/types/ngx-wapp-components.d.ts.map +0 -1
|
@@ -0,0 +1,1041 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Input, ChangeDetectionStrategy, Component, EventEmitter, ViewChild, Output, Directive } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
const W_HOME_PAGE_FRAME_DEFAULT_LABELS = {
|
|
5
|
+
header: 'Header',
|
|
6
|
+
menu: 'Menu',
|
|
7
|
+
footer: 'Footer',
|
|
8
|
+
greeting: 'Hello, Alex',
|
|
9
|
+
genericGreeting: 'Hello',
|
|
10
|
+
pullToRefresh: 'Pull to refresh',
|
|
11
|
+
emptyState: 'No content'
|
|
12
|
+
};
|
|
13
|
+
const W_HOME_D1_DEFAULT_LABELS = {
|
|
14
|
+
title: '',
|
|
15
|
+
viewAll: 'View all',
|
|
16
|
+
empty: 'There is no content',
|
|
17
|
+
error: 'Content could not be loaded',
|
|
18
|
+
retry: 'Retry',
|
|
19
|
+
loading: 'Loading',
|
|
20
|
+
imageUnavailable: 'Image unavailable',
|
|
21
|
+
previous: 'Previous',
|
|
22
|
+
next: 'Next',
|
|
23
|
+
unavailable: 'Not available for this customer'
|
|
24
|
+
};
|
|
25
|
+
const W_HOME_K1_DEFAULT_LABELS = {
|
|
26
|
+
title: '',
|
|
27
|
+
points: 'points',
|
|
28
|
+
auxiliary: 'Also',
|
|
29
|
+
empty: 'There is no value to show',
|
|
30
|
+
error: 'The value could not be loaded',
|
|
31
|
+
retry: 'Retry',
|
|
32
|
+
loading: 'Loading',
|
|
33
|
+
unavailable: 'Not available for this customer'
|
|
34
|
+
};
|
|
35
|
+
const W_HOME_C1_DEFAULT_LABELS = {
|
|
36
|
+
title: '',
|
|
37
|
+
empty: 'There is no content',
|
|
38
|
+
error: 'Content could not be loaded',
|
|
39
|
+
retry: 'Retry',
|
|
40
|
+
loading: 'Loading',
|
|
41
|
+
unavailable: 'Not available for this customer'
|
|
42
|
+
};
|
|
43
|
+
const W_HOME_C2_DEFAULT_LABELS = {
|
|
44
|
+
title: '',
|
|
45
|
+
progress: 'Progress',
|
|
46
|
+
steps: 'Membership levels',
|
|
47
|
+
empty: 'There is no membership level',
|
|
48
|
+
error: 'Membership level could not be loaded',
|
|
49
|
+
retry: 'Retry',
|
|
50
|
+
loading: 'Loading',
|
|
51
|
+
unavailable: 'Not available for this customer'
|
|
52
|
+
};
|
|
53
|
+
const W_HOME_E1_DEFAULT_LABELS = {
|
|
54
|
+
title: '',
|
|
55
|
+
detail: '',
|
|
56
|
+
empty: 'There is no selected item',
|
|
57
|
+
error: 'The item could not be loaded',
|
|
58
|
+
retry: 'Retry',
|
|
59
|
+
loading: 'Loading',
|
|
60
|
+
unavailable: 'Not available for this customer'
|
|
61
|
+
};
|
|
62
|
+
const W_HOME_E2_DEFAULT_LABELS = {
|
|
63
|
+
title: '',
|
|
64
|
+
achieved: 'Earned',
|
|
65
|
+
pending: 'Pending',
|
|
66
|
+
customerReward: 'Your reward',
|
|
67
|
+
friendReward: 'Friend reward',
|
|
68
|
+
invitations: 'Invitations',
|
|
69
|
+
acceptedInvitations: 'Accepted',
|
|
70
|
+
pendingInvitations: 'Pending',
|
|
71
|
+
openProgram: 'Open program',
|
|
72
|
+
empty: 'There is no program data',
|
|
73
|
+
error: 'The program could not be loaded',
|
|
74
|
+
retry: 'Retry',
|
|
75
|
+
loading: 'Loading',
|
|
76
|
+
unavailable: 'Not available for this customer'
|
|
77
|
+
};
|
|
78
|
+
const W_HOME_E3_DEFAULT_LABELS = {
|
|
79
|
+
title: '',
|
|
80
|
+
viewAll: 'View all',
|
|
81
|
+
imageUnavailable: 'Image unavailable',
|
|
82
|
+
empty: 'There are no items',
|
|
83
|
+
error: 'The items could not be loaded',
|
|
84
|
+
retry: 'Retry',
|
|
85
|
+
loading: 'Loading',
|
|
86
|
+
unavailable: 'Not available for this customer'
|
|
87
|
+
};
|
|
88
|
+
const W_HOME_PROMOTIONS_DEFAULT_LABELS = {
|
|
89
|
+
...W_HOME_D1_DEFAULT_LABELS,
|
|
90
|
+
title: 'Promotions',
|
|
91
|
+
empty: 'There are no promotions',
|
|
92
|
+
error: 'Promotions could not be loaded'
|
|
93
|
+
};
|
|
94
|
+
const W_HOME_PREVIEW_LIMIT = { min: 1, max: 5, default: 5 };
|
|
95
|
+
const W_HOME_CONTENT_MARGIN = { min: 0, max: 48 };
|
|
96
|
+
const W_HOME_WIDGET_GAP = { min: 0, max: 32 };
|
|
97
|
+
const W_HOME_WIDGET_BORDER_RADIUS = { min: 0, max: 24 };
|
|
98
|
+
const W_HOME_MAX_CONTENT_WIDTH = { min: 320, max: 1440 };
|
|
99
|
+
const W_HOME_ACTION_DEFAULT_BACKGROUND = '#d4f0dd';
|
|
100
|
+
const HEX6 = /^#[0-9A-Fa-f]{6}$/;
|
|
101
|
+
/** Returns the color only when it is a Hex6 value; anything else falls back to the default (null). */
|
|
102
|
+
function wHomeHexColor(value) {
|
|
103
|
+
return typeof value === 'string' && HEX6.test(value) ? value : null;
|
|
104
|
+
}
|
|
105
|
+
function wHomeIntegerInRange(value, min, max) {
|
|
106
|
+
return typeof value === 'number' && Number.isInteger(value) && value >= min && value <= max ? value : null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Closed registry `widgetKey → type → composition` shared by Wallet and the Retail preview (WIDGETS-001).
|
|
111
|
+
* Only widgets with an implemented composition are listed; each wave adds its widgets.
|
|
112
|
+
*/
|
|
113
|
+
const W_HOME_WIDGET_REGISTRY = Object.freeze([
|
|
114
|
+
{ widgetKey: 'promotions', type: 'featured', composition: 'D1', labelsKey: 'promotions' },
|
|
115
|
+
{ widgetKey: 'savings-points', type: 'kpi', composition: 'K1', labelsKey: 'savings-points' },
|
|
116
|
+
{ widgetKey: 'card-balance', type: 'kpi', composition: 'K1', labelsKey: 'card-balance' },
|
|
117
|
+
{ widgetKey: 'profile', type: 'action', composition: 'A1', labelsKey: 'profile' },
|
|
118
|
+
{ widgetKey: 'customer-qr', type: 'action', composition: 'A1', labelsKey: 'customer-qr' },
|
|
119
|
+
{ widgetKey: 'wallet-passes', type: 'action', composition: 'A1', labelsKey: 'wallet-passes' },
|
|
120
|
+
{ widgetKey: 'communication-preferences', type: 'action', composition: 'A1', labelsKey: 'communication-preferences' },
|
|
121
|
+
{ widgetKey: 'scan-code', type: 'action', composition: 'A1', labelsKey: 'scan-code' },
|
|
122
|
+
{ widgetKey: 'access-security', type: 'action', composition: 'A1', labelsKey: 'access-security' },
|
|
123
|
+
{ widgetKey: 'menu-link', type: 'action', composition: 'A1', labelsKey: 'menu-link' },
|
|
124
|
+
{ widgetKey: 'services-by-category', type: 'featured', composition: 'D1', labelsKey: 'services-by-category' },
|
|
125
|
+
{ widgetKey: 'points-rewards', type: 'featured', composition: 'D1', labelsKey: 'points-rewards' },
|
|
126
|
+
{ widgetKey: 'digital-rewards', type: 'featured', composition: 'D1', labelsKey: 'digital-rewards' },
|
|
127
|
+
{ widgetKey: 'earn-and-burn', type: 'featured', composition: 'D1', labelsKey: 'earn-and-burn' },
|
|
128
|
+
{ widgetKey: 'draws', type: 'featured', composition: 'D1', labelsKey: 'draws' },
|
|
129
|
+
{ widgetKey: 'posts', type: 'featured', composition: 'D1', labelsKey: 'posts' },
|
|
130
|
+
{ widgetKey: 'member-get-member', type: 'standard', composition: 'E2', labelsKey: 'member-get-member' },
|
|
131
|
+
{ widgetKey: 'loyalty-programs', type: 'featured', composition: 'D1', labelsKey: 'loyalty-programs' },
|
|
132
|
+
{ widgetKey: 'gift-cards', type: 'featured', composition: 'D1', labelsKey: 'gift-cards' },
|
|
133
|
+
{ widgetKey: 'voucher-cards', type: 'featured', composition: 'D1', labelsKey: 'voucher-cards' },
|
|
134
|
+
{ widgetKey: 'direct-discounts', type: 'featured', composition: 'D1', labelsKey: 'direct-discounts' },
|
|
135
|
+
{ widgetKey: 'wallet-coupons', type: 'featured', composition: 'D1', labelsKey: 'wallet-coupons' },
|
|
136
|
+
{ widgetKey: 'products', type: 'featured', composition: 'D2', labelsKey: 'products' },
|
|
137
|
+
{ widgetKey: 'subscriptions', type: 'compact', composition: 'C1', labelsKey: 'subscriptions' },
|
|
138
|
+
{ widgetKey: 'tickets', type: 'compact', composition: 'C1', labelsKey: 'tickets' },
|
|
139
|
+
{ widgetKey: 'notifications', type: 'compact', composition: 'C1', labelsKey: 'notifications' },
|
|
140
|
+
{ widgetKey: 'membership-level', type: 'compact', composition: 'C2', labelsKey: 'membership-level' },
|
|
141
|
+
{ widgetKey: 'customer-groups', type: 'standard', composition: 'E3', labelsKey: 'customer-groups' },
|
|
142
|
+
{ widgetKey: 'stores', type: 'standard', composition: 'E1', labelsKey: 'stores' }
|
|
143
|
+
]);
|
|
144
|
+
/**
|
|
145
|
+
* Returns the registration only when key and type match together; anything else is a configuration error
|
|
146
|
+
* that consumers must render with `w-home-unsupported-widget`, never with another widget.
|
|
147
|
+
*/
|
|
148
|
+
function resolveHomeWidget(widgetKey, type, registry = W_HOME_WIDGET_REGISTRY) {
|
|
149
|
+
return registry.find(item => item.widgetKey === widgetKey && item.type === type) ?? null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Wallet Home page shell for previews (HP-002): header, menu, two-column widget grid and footer. */
|
|
153
|
+
class WHomePageFrameComponent {
|
|
154
|
+
constructor() {
|
|
155
|
+
this.pageStyle = null;
|
|
156
|
+
this.labels = null;
|
|
157
|
+
/** When false, shows the empty state message; null/true never shows it. */
|
|
158
|
+
this.hasWidgets = null;
|
|
159
|
+
}
|
|
160
|
+
get texts() {
|
|
161
|
+
return { ...W_HOME_PAGE_FRAME_DEFAULT_LABELS, ...(this.labels ?? {}) };
|
|
162
|
+
}
|
|
163
|
+
get backgroundColor() {
|
|
164
|
+
return wHomeHexColor(this.pageStyle?.backgroundColor);
|
|
165
|
+
}
|
|
166
|
+
/** Null keeps the Wallet default padding (16px, 22px from 1024px). */
|
|
167
|
+
get contentMargin() {
|
|
168
|
+
return wHomeIntegerInRange(this.pageStyle?.contentMargin, W_HOME_CONTENT_MARGIN.min, W_HOME_CONTENT_MARGIN.max);
|
|
169
|
+
}
|
|
170
|
+
/** Null keeps the Wallet default gap (12px). */
|
|
171
|
+
get widgetGap() {
|
|
172
|
+
return wHomeIntegerInRange(this.pageStyle?.widgetGap, W_HOME_WIDGET_GAP.min, W_HOME_WIDGET_GAP.max);
|
|
173
|
+
}
|
|
174
|
+
get maxContentWidth() {
|
|
175
|
+
return wHomeIntegerInRange(this.pageStyle?.maxContentWidth, W_HOME_MAX_CONTENT_WIDTH.min, W_HOME_MAX_CONTENT_WIDTH.max);
|
|
176
|
+
}
|
|
177
|
+
/** Same rule as Wallet `/main`: false hides it, true adds the customer name, absent shows a generic greeting. */
|
|
178
|
+
get greeting() {
|
|
179
|
+
const showGreeting = this.pageStyle?.showGreeting;
|
|
180
|
+
if (showGreeting === false) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
return showGreeting === true ? this.texts.greeting : this.texts.genericGreeting;
|
|
184
|
+
}
|
|
185
|
+
get enablePullToRefresh() {
|
|
186
|
+
return this.pageStyle?.enablePullToRefresh === true;
|
|
187
|
+
}
|
|
188
|
+
get emptyStateMessage() {
|
|
189
|
+
const message = this.pageStyle?.emptyStateMessage?.trim();
|
|
190
|
+
return message ? message : this.texts.emptyState;
|
|
191
|
+
}
|
|
192
|
+
get showHeader() {
|
|
193
|
+
return this.pageStyle?.showHeader !== false;
|
|
194
|
+
}
|
|
195
|
+
get showMenu() {
|
|
196
|
+
return this.pageStyle?.showMenu !== false;
|
|
197
|
+
}
|
|
198
|
+
get showFooter() {
|
|
199
|
+
return this.pageStyle?.showFooter !== false;
|
|
200
|
+
}
|
|
201
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomePageFrameComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
202
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: WHomePageFrameComponent, isStandalone: true, selector: "w-home-page-frame", inputs: { pageStyle: "pageStyle", labels: "labels", hasWidgets: "hasWidgets" }, ngImport: i0, template: `
|
|
203
|
+
<div class="frame" [style.background-color]="backgroundColor" data-testid="home-frame">
|
|
204
|
+
@if (showHeader) {
|
|
205
|
+
<header class="frame__header" data-testid="home-frame-header">
|
|
206
|
+
<span>{{ texts.header }}</span>
|
|
207
|
+
</header>
|
|
208
|
+
}
|
|
209
|
+
@if (showMenu) {
|
|
210
|
+
<nav class="frame__menu" data-testid="home-frame-menu" [attr.aria-label]="texts.menu">
|
|
211
|
+
<span></span><span></span><span></span>
|
|
212
|
+
</nav>
|
|
213
|
+
}
|
|
214
|
+
@if (greeting) {
|
|
215
|
+
<p class="frame__greeting" data-testid="home-frame-greeting">{{ greeting }}</p>
|
|
216
|
+
}
|
|
217
|
+
@if (enablePullToRefresh) {
|
|
218
|
+
<p class="frame__refresh" data-testid="home-frame-refresh">{{ texts.pullToRefresh }}</p>
|
|
219
|
+
}
|
|
220
|
+
<div class="home-grid" [style.padding.px]="contentMargin" [style.gap.px]="widgetGap"
|
|
221
|
+
[style.max-width.px]="maxContentWidth" data-testid="home-frame-grid">
|
|
222
|
+
<ng-content></ng-content>
|
|
223
|
+
@if (hasWidgets === false) {
|
|
224
|
+
<p class="frame__empty" data-testid="home-frame-empty">{{ emptyStateMessage }}</p>
|
|
225
|
+
}
|
|
226
|
+
</div>
|
|
227
|
+
@if (showFooter) {
|
|
228
|
+
<footer class="frame__footer" data-testid="home-frame-footer">{{ texts.footer }}</footer>
|
|
229
|
+
}
|
|
230
|
+
</div>
|
|
231
|
+
`, isInline: true, styles: [":host{display:block;container-type:inline-size;container-name:w-home}.frame{min-height:100%;background:#f7f8f5;color:#1f2522;display:flex;flex-direction:column}.frame__header{height:84px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;background:#123d2d;color:#fff;font-weight:800}.frame__greeting{margin:0;padding:12px 16px 0;font-size:14px;color:#1f2522}.frame__refresh{margin:0;padding:8px 16px 0;color:#68716c;font-size:12px;text-align:center}.frame__empty{grid-column:1 / -1;margin:0;padding:24px 0;color:#68716c;text-align:center}.frame__menu{display:flex;gap:8px;padding:10px 16px;border-bottom:1px solid #dfe3dd;background:#fff}.frame__menu span{width:56px;height:10px;border-radius:5px;background:#dfe3dd}.home-grid{flex:1;box-sizing:border-box;width:100%;margin:0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:16px;align-content:start}.frame__footer{height:56px;display:flex;align-items:center;justify-content:center;border-top:1px solid #dfe3dd;background:#fff;color:#68716c;font-size:12px}@container w-home (min-width: 1024px){.home-grid{padding:22px}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
232
|
+
}
|
|
233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomePageFrameComponent, decorators: [{
|
|
234
|
+
type: Component,
|
|
235
|
+
args: [{ selector: 'w-home-page-frame', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
236
|
+
<div class="frame" [style.background-color]="backgroundColor" data-testid="home-frame">
|
|
237
|
+
@if (showHeader) {
|
|
238
|
+
<header class="frame__header" data-testid="home-frame-header">
|
|
239
|
+
<span>{{ texts.header }}</span>
|
|
240
|
+
</header>
|
|
241
|
+
}
|
|
242
|
+
@if (showMenu) {
|
|
243
|
+
<nav class="frame__menu" data-testid="home-frame-menu" [attr.aria-label]="texts.menu">
|
|
244
|
+
<span></span><span></span><span></span>
|
|
245
|
+
</nav>
|
|
246
|
+
}
|
|
247
|
+
@if (greeting) {
|
|
248
|
+
<p class="frame__greeting" data-testid="home-frame-greeting">{{ greeting }}</p>
|
|
249
|
+
}
|
|
250
|
+
@if (enablePullToRefresh) {
|
|
251
|
+
<p class="frame__refresh" data-testid="home-frame-refresh">{{ texts.pullToRefresh }}</p>
|
|
252
|
+
}
|
|
253
|
+
<div class="home-grid" [style.padding.px]="contentMargin" [style.gap.px]="widgetGap"
|
|
254
|
+
[style.max-width.px]="maxContentWidth" data-testid="home-frame-grid">
|
|
255
|
+
<ng-content></ng-content>
|
|
256
|
+
@if (hasWidgets === false) {
|
|
257
|
+
<p class="frame__empty" data-testid="home-frame-empty">{{ emptyStateMessage }}</p>
|
|
258
|
+
}
|
|
259
|
+
</div>
|
|
260
|
+
@if (showFooter) {
|
|
261
|
+
<footer class="frame__footer" data-testid="home-frame-footer">{{ texts.footer }}</footer>
|
|
262
|
+
}
|
|
263
|
+
</div>
|
|
264
|
+
`, styles: [":host{display:block;container-type:inline-size;container-name:w-home}.frame{min-height:100%;background:#f7f8f5;color:#1f2522;display:flex;flex-direction:column}.frame__header{height:84px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;background:#123d2d;color:#fff;font-weight:800}.frame__greeting{margin:0;padding:12px 16px 0;font-size:14px;color:#1f2522}.frame__refresh{margin:0;padding:8px 16px 0;color:#68716c;font-size:12px;text-align:center}.frame__empty{grid-column:1 / -1;margin:0;padding:24px 0;color:#68716c;text-align:center}.frame__menu{display:flex;gap:8px;padding:10px 16px;border-bottom:1px solid #dfe3dd;background:#fff}.frame__menu span{width:56px;height:10px;border-radius:5px;background:#dfe3dd}.home-grid{flex:1;box-sizing:border-box;width:100%;margin:0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:16px;align-content:start}.frame__footer{height:56px;display:flex;align-items:center;justify-content:center;border-top:1px solid #dfe3dd;background:#fff;color:#68716c;font-size:12px}@container w-home (min-width: 1024px){.home-grid{padding:22px}}\n"] }]
|
|
265
|
+
}], propDecorators: { pageStyle: [{
|
|
266
|
+
type: Input
|
|
267
|
+
}], labels: [{
|
|
268
|
+
type: Input
|
|
269
|
+
}], hasWidgets: [{
|
|
270
|
+
type: Input
|
|
271
|
+
}] } });
|
|
272
|
+
|
|
273
|
+
const SCROLL_STEP_PX = 260;
|
|
274
|
+
/**
|
|
275
|
+
* Featured composition D1 (WIDGETS-002): header, optional count, "view all" and a snap carousel of image cards.
|
|
276
|
+
* Driven only by inputs; it never calls HTTP nor navigates, it emits events.
|
|
277
|
+
*/
|
|
278
|
+
class WHomeD1Component {
|
|
279
|
+
constructor() {
|
|
280
|
+
this.state = 'loading';
|
|
281
|
+
this.model = null;
|
|
282
|
+
/** Items used when `model` is not set (3.9.0 promotions API). */
|
|
283
|
+
this.items = [];
|
|
284
|
+
/** Total used when `model` is not set (3.9.0 promotions API). */
|
|
285
|
+
this.totalCount = null;
|
|
286
|
+
this.widgetStyle = null;
|
|
287
|
+
this.config = null;
|
|
288
|
+
this.labels = null;
|
|
289
|
+
this.showPrice = false;
|
|
290
|
+
this.borderRadiusInput = null;
|
|
291
|
+
this.viewAll = new EventEmitter();
|
|
292
|
+
this.itemSelect = new EventEmitter();
|
|
293
|
+
this.retry = new EventEmitter();
|
|
294
|
+
this.skeletonCards = [0, 1, 2];
|
|
295
|
+
this.brokenImages = new Set();
|
|
296
|
+
}
|
|
297
|
+
get defaultLabels() {
|
|
298
|
+
return W_HOME_D1_DEFAULT_LABELS;
|
|
299
|
+
}
|
|
300
|
+
get texts() {
|
|
301
|
+
return { ...this.defaultLabels, ...(this.labels ?? {}) };
|
|
302
|
+
}
|
|
303
|
+
get title() {
|
|
304
|
+
return this.model?.title?.trim() || this.texts.title;
|
|
305
|
+
}
|
|
306
|
+
get backgroundColor() {
|
|
307
|
+
return wHomeHexColor(this.widgetStyle?.backgroundColor);
|
|
308
|
+
}
|
|
309
|
+
get foregroundColor() {
|
|
310
|
+
return wHomeHexColor(this.widgetStyle?.foregroundColor);
|
|
311
|
+
}
|
|
312
|
+
/** Null keeps the Wallet default radius from the stylesheet. */
|
|
313
|
+
get borderRadius() {
|
|
314
|
+
return wHomeIntegerInRange(this.borderRadiusInput, W_HOME_WIDGET_BORDER_RADIUS.min, W_HOME_WIDGET_BORDER_RADIUS.max);
|
|
315
|
+
}
|
|
316
|
+
get previewLimit() {
|
|
317
|
+
return wHomeIntegerInRange(this.config?.previewLimit, W_HOME_PREVIEW_LIMIT.min, W_HOME_PREVIEW_LIMIT.max)
|
|
318
|
+
?? W_HOME_PREVIEW_LIMIT.default;
|
|
319
|
+
}
|
|
320
|
+
get showCount() {
|
|
321
|
+
return this.config?.showCount === true;
|
|
322
|
+
}
|
|
323
|
+
get allItems() {
|
|
324
|
+
return this.model ? this.model.items : this.items;
|
|
325
|
+
}
|
|
326
|
+
get count() {
|
|
327
|
+
return (this.model ? this.model.total : this.totalCount) ?? this.allItems.length;
|
|
328
|
+
}
|
|
329
|
+
get visibleItems() {
|
|
330
|
+
return this.allItems.slice(0, this.previewLimit);
|
|
331
|
+
}
|
|
332
|
+
hasImage(item) {
|
|
333
|
+
return !!item.imageUrl && !this.brokenImages.has(item.id);
|
|
334
|
+
}
|
|
335
|
+
onImageError(item) {
|
|
336
|
+
this.brokenImages.add(item.id);
|
|
337
|
+
}
|
|
338
|
+
formatPrice(item) {
|
|
339
|
+
const currency = item.currency?.trim();
|
|
340
|
+
if (typeof item.price !== 'number' || !Number.isFinite(item.price) ||
|
|
341
|
+
!currency || !/^[A-Za-z]{3}$/.test(currency)) {
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
try {
|
|
345
|
+
return new Intl.NumberFormat(undefined, { style: 'currency', currency: currency.toUpperCase() }).format(item.price);
|
|
346
|
+
}
|
|
347
|
+
catch {
|
|
348
|
+
return null;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
scroll(direction) {
|
|
352
|
+
const reduceMotion = typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
|
|
353
|
+
this.collection?.nativeElement.scrollBy?.({ left: direction * SCROLL_STEP_PX, behavior: reduceMotion ? 'auto' : 'smooth' });
|
|
354
|
+
}
|
|
355
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeD1Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
356
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: WHomeD1Component, isStandalone: true, selector: "w-home-d1", inputs: { state: "state", model: "model", items: "items", totalCount: "totalCount", widgetStyle: "widgetStyle", config: "config", labels: "labels", showPrice: "showPrice", borderRadiusInput: ["borderRadius", "borderRadiusInput"] }, outputs: { viewAll: "viewAll", itemSelect: "itemSelect", retry: "retry" }, host: { attributes: { "data-composition": "D1" }, classAttribute: "span-full" }, viewQueries: [{ propertyName: "collection", first: true, predicate: ["collection"], descendants: true }], ngImport: i0, template: "<article class=\"widget widget--featured\"\r\n [style.background-color]=\"backgroundColor\"\r\n [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\"\r\n data-testid=\"promotions-widget\">\r\n <header class=\"card-header\">\r\n <h2 class=\"card-header__title\">\r\n {{ title }}\r\n @if (showCount && state === 'loaded') {\r\n <span class=\"card-header__count\" data-testid=\"promotions-count\">({{ count }})</span>\r\n }\r\n </h2>\r\n @if (state === 'loaded') {\r\n <button type=\"button\" class=\"text-action\" (click)=\"viewAll.emit()\" data-testid=\"promotions-see-all\">\r\n {{ texts.viewAll }}\r\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\"\r\n stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <path d=\"M5 12h14\" /><path d=\"m13 6 6 6-6 6\" />\r\n </svg>\r\n </button>\r\n }\r\n </header>\r\n\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"collection collection--static\" role=\"status\" [attr.aria-label]=\"texts.loading\"\r\n data-testid=\"promotions-loading\">\r\n @for (item of skeletonCards; track item) {\r\n <span class=\"domain-card domain-card--skeleton\"></span>\r\n }\r\n </div>\r\n }\r\n @case ('error') {\r\n <div class=\"widget-state widget-state--error\" role=\"alert\" data-testid=\"promotions-error\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">!</span>\r\n <div>\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"promotions-retry\">{{ texts.retry }}</button>\r\n </div>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"widget-state widget-state--unavailable\" role=\"note\" data-testid=\"promotions-unavailable\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">×</span>\r\n <strong>{{ texts.unavailable }}</strong>\r\n </div>\r\n }\r\n @case ('empty') {\r\n <div class=\"widget-state\" data-testid=\"promotions-empty\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">—</span>\r\n <strong>{{ texts.empty }}</strong>\r\n </div>\r\n }\r\n @case ('loaded') {\r\n <div class=\"carousel-shell\">\r\n <div #collection class=\"collection\" tabindex=\"0\" [attr.aria-label]=\"title\"\r\n data-testid=\"promotions-collection\">\r\n @for (card of visibleItems; track card.id) {\r\n <button type=\"button\" class=\"domain-card\" (click)=\"itemSelect.emit(card)\" data-testid=\"promotion-card\">\r\n @if (hasImage(card)) {\r\n <img [src]=\"card.imageUrl\" alt=\"\" loading=\"lazy\" (error)=\"onImageError(card)\" />\r\n } @else {\r\n <span class=\"domain-card__placeholder\" data-testid=\"promotion-image-placeholder\">\r\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\" stroke=\"currentColor\"\r\n stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"2\" /><rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" rx=\"2\" />\r\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"2\" /><rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"2\" />\r\n </svg>\r\n <span>{{ texts.imageUnavailable }}</span>\r\n </span>\r\n }\r\n <span class=\"domain-card__shade\"></span>\r\n @if (card.badge) {\r\n <span class=\"domain-card__badge\" data-testid=\"promotion-badge\">{{ card.badge }}</span>\r\n }\r\n <span class=\"domain-card__copy\">\r\n <strong>{{ card.name }}</strong>\r\n @if (card.description) {\r\n <span>{{ card.description }}</span>\r\n }\r\n @if (showPrice && formatPrice(card); as price) {\r\n <span class=\"domain-card__price\">{{ price }}</span>\r\n }\r\n </span>\r\n </button>\r\n }\r\n </div>\r\n @if (visibleItems.length > 1) {\r\n <div class=\"carousel-controls\" role=\"group\">\r\n <button type=\"button\" class=\"button--icon\" [attr.aria-label]=\"texts.previous\" (click)=\"scroll(-1)\">\r\n <span aria-hidden=\"true\">←</span>\r\n </button>\r\n <button type=\"button\" class=\"button--icon\" [attr.aria-label]=\"texts.next\" (click)=\"scroll(1)\">\r\n <span aria-hidden=\"true\">→</span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;grid-column:1 / -1;min-width:0;--home-ink: #1f2522;--home-muted: #68716c;--home-line: #dfe3dd;--home-accent: #1f5d45;--home-accent-dark: #123d2d}.widget{box-sizing:border-box;color:var(--home-ink);background:#fff;border:1px solid #e3e7e1;border-radius:16px;box-shadow:0 4px 14px #1d2b230a}.widget--featured{min-height:235px;padding:15px 0 15px 15px;overflow:hidden}.card-header{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:36px;padding-right:15px}.card-header__title{display:flex;align-items:center;gap:5px;min-width:0;margin:0;font-size:12px;font-weight:800;line-height:1.3;color:inherit}.card-header__count{font-weight:700;opacity:.7}.text-action{min-height:36px;display:flex;align-items:center;gap:5px;border:0;padding:0 2px;color:var(--home-accent);background:none;font:inherit;font-size:11px;font-weight:800;cursor:pointer;white-space:nowrap}.carousel-shell{position:relative}.collection{display:flex;gap:10px;margin-top:12px;padding-right:15px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none}.collection::-webkit-scrollbar{display:none}.collection--static{overflow:hidden}.domain-card{position:relative;flex:0 0 74%;height:160px;overflow:hidden;padding:0;border:0;border-radius:13px;color:#fff;background:var(--home-accent-dark);text-align:left;font:inherit;cursor:pointer;scroll-snap-align:start}.domain-card img{width:100%;height:100%;display:block;object-fit:cover}.domain-card__placeholder{position:absolute;inset:8px 8px auto;height:84px;display:grid;place-items:center;align-content:center;gap:6px;border:1px dashed #abb6ae;border-radius:10px;color:#6c7770;background:#f3f5f2;font-size:11px}.domain-card__shade{position:absolute;inset:0;background:linear-gradient(180deg,transparent 30%,rgba(10,20,14,.82));pointer-events:none}.domain-card__badge{position:absolute;top:10px;left:10px;max-width:calc(100% - 20px);padding:3px 8px;overflow:hidden;border-radius:999px;color:var(--home-ink);background:#ffffffeb;font-size:10px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}.domain-card__copy{position:absolute;left:14px;right:14px;bottom:12px}.domain-card__copy>*{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.domain-card__copy strong{font-size:15px;font-weight:800;line-height:1.3}.domain-card__copy span{margin-top:2px;font-size:10px;opacity:.85}.domain-card--skeleton{cursor:default;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{to{background-position:-200% 0}}.carousel-controls{position:absolute;right:26px;bottom:11px;display:none;gap:5px}.button--icon{width:40px;height:40px;display:grid;place-items:center;padding:0;border:1px solid var(--home-line);border-radius:11px;color:var(--home-ink);background:#ffffffeb;font:inherit;cursor:pointer}.widget-state{min-height:160px;margin:12px 15px 0 0;padding:13px;display:flex;align-items:center;gap:8px;border-radius:13px;background:#f4f5f3;color:var(--home-muted);font-size:12px}.widget-state strong{display:block;line-height:1.3}.widget-state--unavailable{border:1px dashed #abb6ae}.widget-state--error{color:#8c302d;background:#fff8f7}.widget-state--error button{margin-top:4px;border:0;padding:0;color:#a63834;background:none;font:inherit;font-size:11px;font-weight:800;text-decoration:underline;cursor:pointer}.widget-state__icon{width:24px;height:24px;flex:0 0 auto;display:grid;place-items:center;border-radius:50%;background:#eef0ed;font-weight:800}button:focus-visible,.collection:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@container w-home (min-width: 768px){.domain-card{flex-basis:44%}}@container w-home (min-width: 1024px){.domain-card{flex-basis:32%}.carousel-controls{display:flex}}@media(prefers-reduced-motion:reduce){.collection{scroll-behavior:auto}.domain-card--skeleton{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
357
|
+
}
|
|
358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeD1Component, decorators: [{
|
|
359
|
+
type: Component,
|
|
360
|
+
args: [{ selector: 'w-home-d1', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'span-full', 'data-composition': 'D1' }, template: "<article class=\"widget widget--featured\"\r\n [style.background-color]=\"backgroundColor\"\r\n [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\"\r\n data-testid=\"promotions-widget\">\r\n <header class=\"card-header\">\r\n <h2 class=\"card-header__title\">\r\n {{ title }}\r\n @if (showCount && state === 'loaded') {\r\n <span class=\"card-header__count\" data-testid=\"promotions-count\">({{ count }})</span>\r\n }\r\n </h2>\r\n @if (state === 'loaded') {\r\n <button type=\"button\" class=\"text-action\" (click)=\"viewAll.emit()\" data-testid=\"promotions-see-all\">\r\n {{ texts.viewAll }}\r\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\"\r\n stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <path d=\"M5 12h14\" /><path d=\"m13 6 6 6-6 6\" />\r\n </svg>\r\n </button>\r\n }\r\n </header>\r\n\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"collection collection--static\" role=\"status\" [attr.aria-label]=\"texts.loading\"\r\n data-testid=\"promotions-loading\">\r\n @for (item of skeletonCards; track item) {\r\n <span class=\"domain-card domain-card--skeleton\"></span>\r\n }\r\n </div>\r\n }\r\n @case ('error') {\r\n <div class=\"widget-state widget-state--error\" role=\"alert\" data-testid=\"promotions-error\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">!</span>\r\n <div>\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"promotions-retry\">{{ texts.retry }}</button>\r\n </div>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"widget-state widget-state--unavailable\" role=\"note\" data-testid=\"promotions-unavailable\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">×</span>\r\n <strong>{{ texts.unavailable }}</strong>\r\n </div>\r\n }\r\n @case ('empty') {\r\n <div class=\"widget-state\" data-testid=\"promotions-empty\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">—</span>\r\n <strong>{{ texts.empty }}</strong>\r\n </div>\r\n }\r\n @case ('loaded') {\r\n <div class=\"carousel-shell\">\r\n <div #collection class=\"collection\" tabindex=\"0\" [attr.aria-label]=\"title\"\r\n data-testid=\"promotions-collection\">\r\n @for (card of visibleItems; track card.id) {\r\n <button type=\"button\" class=\"domain-card\" (click)=\"itemSelect.emit(card)\" data-testid=\"promotion-card\">\r\n @if (hasImage(card)) {\r\n <img [src]=\"card.imageUrl\" alt=\"\" loading=\"lazy\" (error)=\"onImageError(card)\" />\r\n } @else {\r\n <span class=\"domain-card__placeholder\" data-testid=\"promotion-image-placeholder\">\r\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\" stroke=\"currentColor\"\r\n stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"2\" /><rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" rx=\"2\" />\r\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"2\" /><rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"2\" />\r\n </svg>\r\n <span>{{ texts.imageUnavailable }}</span>\r\n </span>\r\n }\r\n <span class=\"domain-card__shade\"></span>\r\n @if (card.badge) {\r\n <span class=\"domain-card__badge\" data-testid=\"promotion-badge\">{{ card.badge }}</span>\r\n }\r\n <span class=\"domain-card__copy\">\r\n <strong>{{ card.name }}</strong>\r\n @if (card.description) {\r\n <span>{{ card.description }}</span>\r\n }\r\n @if (showPrice && formatPrice(card); as price) {\r\n <span class=\"domain-card__price\">{{ price }}</span>\r\n }\r\n </span>\r\n </button>\r\n }\r\n </div>\r\n @if (visibleItems.length > 1) {\r\n <div class=\"carousel-controls\" role=\"group\">\r\n <button type=\"button\" class=\"button--icon\" [attr.aria-label]=\"texts.previous\" (click)=\"scroll(-1)\">\r\n <span aria-hidden=\"true\">←</span>\r\n </button>\r\n <button type=\"button\" class=\"button--icon\" [attr.aria-label]=\"texts.next\" (click)=\"scroll(1)\">\r\n <span aria-hidden=\"true\">→</span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;grid-column:1 / -1;min-width:0;--home-ink: #1f2522;--home-muted: #68716c;--home-line: #dfe3dd;--home-accent: #1f5d45;--home-accent-dark: #123d2d}.widget{box-sizing:border-box;color:var(--home-ink);background:#fff;border:1px solid #e3e7e1;border-radius:16px;box-shadow:0 4px 14px #1d2b230a}.widget--featured{min-height:235px;padding:15px 0 15px 15px;overflow:hidden}.card-header{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:36px;padding-right:15px}.card-header__title{display:flex;align-items:center;gap:5px;min-width:0;margin:0;font-size:12px;font-weight:800;line-height:1.3;color:inherit}.card-header__count{font-weight:700;opacity:.7}.text-action{min-height:36px;display:flex;align-items:center;gap:5px;border:0;padding:0 2px;color:var(--home-accent);background:none;font:inherit;font-size:11px;font-weight:800;cursor:pointer;white-space:nowrap}.carousel-shell{position:relative}.collection{display:flex;gap:10px;margin-top:12px;padding-right:15px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none}.collection::-webkit-scrollbar{display:none}.collection--static{overflow:hidden}.domain-card{position:relative;flex:0 0 74%;height:160px;overflow:hidden;padding:0;border:0;border-radius:13px;color:#fff;background:var(--home-accent-dark);text-align:left;font:inherit;cursor:pointer;scroll-snap-align:start}.domain-card img{width:100%;height:100%;display:block;object-fit:cover}.domain-card__placeholder{position:absolute;inset:8px 8px auto;height:84px;display:grid;place-items:center;align-content:center;gap:6px;border:1px dashed #abb6ae;border-radius:10px;color:#6c7770;background:#f3f5f2;font-size:11px}.domain-card__shade{position:absolute;inset:0;background:linear-gradient(180deg,transparent 30%,rgba(10,20,14,.82));pointer-events:none}.domain-card__badge{position:absolute;top:10px;left:10px;max-width:calc(100% - 20px);padding:3px 8px;overflow:hidden;border-radius:999px;color:var(--home-ink);background:#ffffffeb;font-size:10px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}.domain-card__copy{position:absolute;left:14px;right:14px;bottom:12px}.domain-card__copy>*{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.domain-card__copy strong{font-size:15px;font-weight:800;line-height:1.3}.domain-card__copy span{margin-top:2px;font-size:10px;opacity:.85}.domain-card--skeleton{cursor:default;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{to{background-position:-200% 0}}.carousel-controls{position:absolute;right:26px;bottom:11px;display:none;gap:5px}.button--icon{width:40px;height:40px;display:grid;place-items:center;padding:0;border:1px solid var(--home-line);border-radius:11px;color:var(--home-ink);background:#ffffffeb;font:inherit;cursor:pointer}.widget-state{min-height:160px;margin:12px 15px 0 0;padding:13px;display:flex;align-items:center;gap:8px;border-radius:13px;background:#f4f5f3;color:var(--home-muted);font-size:12px}.widget-state strong{display:block;line-height:1.3}.widget-state--unavailable{border:1px dashed #abb6ae}.widget-state--error{color:#8c302d;background:#fff8f7}.widget-state--error button{margin-top:4px;border:0;padding:0;color:#a63834;background:none;font:inherit;font-size:11px;font-weight:800;text-decoration:underline;cursor:pointer}.widget-state__icon{width:24px;height:24px;flex:0 0 auto;display:grid;place-items:center;border-radius:50%;background:#eef0ed;font-weight:800}button:focus-visible,.collection:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@container w-home (min-width: 768px){.domain-card{flex-basis:44%}}@container w-home (min-width: 1024px){.domain-card{flex-basis:32%}.carousel-controls{display:flex}}@media(prefers-reduced-motion:reduce){.collection{scroll-behavior:auto}.domain-card--skeleton{animation:none}}\n"] }]
|
|
361
|
+
}], propDecorators: { state: [{
|
|
362
|
+
type: Input
|
|
363
|
+
}], model: [{
|
|
364
|
+
type: Input
|
|
365
|
+
}], items: [{
|
|
366
|
+
type: Input
|
|
367
|
+
}], totalCount: [{
|
|
368
|
+
type: Input
|
|
369
|
+
}], widgetStyle: [{
|
|
370
|
+
type: Input
|
|
371
|
+
}], config: [{
|
|
372
|
+
type: Input
|
|
373
|
+
}], labels: [{
|
|
374
|
+
type: Input
|
|
375
|
+
}], showPrice: [{
|
|
376
|
+
type: Input
|
|
377
|
+
}], borderRadiusInput: [{
|
|
378
|
+
type: Input,
|
|
379
|
+
args: ['borderRadius']
|
|
380
|
+
}], viewAll: [{
|
|
381
|
+
type: Output
|
|
382
|
+
}], itemSelect: [{
|
|
383
|
+
type: Output
|
|
384
|
+
}], retry: [{
|
|
385
|
+
type: Output
|
|
386
|
+
}], collection: [{
|
|
387
|
+
type: ViewChild,
|
|
388
|
+
args: ['collection']
|
|
389
|
+
}] } });
|
|
390
|
+
|
|
391
|
+
/** Featured composition D2 reuses D1's responsive carousel and adds validated product prices. */
|
|
392
|
+
class WHomeD2Component {
|
|
393
|
+
constructor() {
|
|
394
|
+
this.state = 'loading';
|
|
395
|
+
this.model = null;
|
|
396
|
+
this.widgetStyle = null;
|
|
397
|
+
this.config = null;
|
|
398
|
+
this.labels = null;
|
|
399
|
+
this.borderRadiusInput = null;
|
|
400
|
+
this.viewAll = new EventEmitter();
|
|
401
|
+
this.itemSelect = new EventEmitter();
|
|
402
|
+
this.retry = new EventEmitter();
|
|
403
|
+
}
|
|
404
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeD2Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
405
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.27", type: WHomeD2Component, isStandalone: true, selector: "w-home-d2", inputs: { state: "state", model: "model", widgetStyle: "widgetStyle", config: "config", labels: "labels", borderRadiusInput: ["borderRadius", "borderRadiusInput"] }, outputs: { viewAll: "viewAll", itemSelect: "itemSelect", retry: "retry" }, host: { attributes: { "data-composition": "D2" }, classAttribute: "span-full" }, ngImport: i0, template: "<w-home-d1\r\n [state]=\"state\"\r\n [model]=\"model\"\r\n [widgetStyle]=\"widgetStyle\"\r\n [config]=\"config\"\r\n [labels]=\"labels\"\r\n [showPrice]=\"true\"\r\n [borderRadius]=\"borderRadiusInput\"\r\n (viewAll)=\"viewAll.emit()\"\r\n (itemSelect)=\"itemSelect.emit($event)\"\r\n (retry)=\"retry.emit()\">\r\n</w-home-d1>\r\n", dependencies: [{ kind: "component", type: WHomeD1Component, selector: "w-home-d1", inputs: ["state", "model", "items", "totalCount", "widgetStyle", "config", "labels", "showPrice", "borderRadius"], outputs: ["viewAll", "itemSelect", "retry"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
406
|
+
}
|
|
407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeD2Component, decorators: [{
|
|
408
|
+
type: Component,
|
|
409
|
+
args: [{ selector: 'w-home-d2', standalone: true, imports: [WHomeD1Component], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'span-full', 'data-composition': 'D2' }, template: "<w-home-d1\r\n [state]=\"state\"\r\n [model]=\"model\"\r\n [widgetStyle]=\"widgetStyle\"\r\n [config]=\"config\"\r\n [labels]=\"labels\"\r\n [showPrice]=\"true\"\r\n [borderRadius]=\"borderRadiusInput\"\r\n (viewAll)=\"viewAll.emit()\"\r\n (itemSelect)=\"itemSelect.emit($event)\"\r\n (retry)=\"retry.emit()\">\r\n</w-home-d1>\r\n" }]
|
|
410
|
+
}], propDecorators: { state: [{
|
|
411
|
+
type: Input
|
|
412
|
+
}], model: [{
|
|
413
|
+
type: Input
|
|
414
|
+
}], widgetStyle: [{
|
|
415
|
+
type: Input
|
|
416
|
+
}], config: [{
|
|
417
|
+
type: Input
|
|
418
|
+
}], labels: [{
|
|
419
|
+
type: Input
|
|
420
|
+
}], borderRadiusInput: [{
|
|
421
|
+
type: Input,
|
|
422
|
+
args: ['borderRadius']
|
|
423
|
+
}], viewAll: [{
|
|
424
|
+
type: Output
|
|
425
|
+
}], itemSelect: [{
|
|
426
|
+
type: Output
|
|
427
|
+
}], retry: [{
|
|
428
|
+
type: Output
|
|
429
|
+
}] } });
|
|
430
|
+
|
|
431
|
+
class WHomeC1Component {
|
|
432
|
+
constructor() {
|
|
433
|
+
this.state = 'loading';
|
|
434
|
+
this.model = null;
|
|
435
|
+
this.widgetStyle = null;
|
|
436
|
+
this.labels = null;
|
|
437
|
+
this.borderRadius = null;
|
|
438
|
+
this.itemSelect = new EventEmitter();
|
|
439
|
+
this.retry = new EventEmitter();
|
|
440
|
+
}
|
|
441
|
+
get texts() {
|
|
442
|
+
return { ...W_HOME_C1_DEFAULT_LABELS, ...(this.labels ?? {}) };
|
|
443
|
+
}
|
|
444
|
+
get title() {
|
|
445
|
+
return this.model?.title?.trim() || this.texts.title;
|
|
446
|
+
}
|
|
447
|
+
get backgroundColor() {
|
|
448
|
+
return wHomeHexColor(this.widgetStyle?.backgroundColor);
|
|
449
|
+
}
|
|
450
|
+
get foregroundColor() {
|
|
451
|
+
return wHomeHexColor(this.widgetStyle?.foregroundColor);
|
|
452
|
+
}
|
|
453
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeC1Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
454
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: WHomeC1Component, isStandalone: true, selector: "w-home-c1", inputs: { state: "state", model: "model", widgetStyle: "widgetStyle", labels: "labels", borderRadius: "borderRadius" }, outputs: { itemSelect: "itemSelect", retry: "retry" }, host: { attributes: { "data-composition": "C1" } }, ngImport: i0, template: "<article class=\"widget compact\" [style.background-color]=\"backgroundColor\" [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\" data-testid=\"home-c1\">\r\n <h2>{{ title }}</h2>\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"state\" role=\"status\" [attr.aria-label]=\"texts.loading\" data-testid=\"home-c1-loading\"><span></span></div>\r\n }\r\n @case ('error') {\r\n <div class=\"state state--error\" role=\"alert\" data-testid=\"home-c1-error\">\r\n <strong>{{ texts.error }}</strong><button type=\"button\" (click)=\"retry.emit()\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"state\" role=\"note\" data-testid=\"home-c1-unavailable\">{{ texts.unavailable }}</div>\r\n }\r\n @case ('empty') {\r\n <div class=\"state\" data-testid=\"home-c1-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n @if (model; as item) {\r\n <button class=\"item\" type=\"button\" (click)=\"itemSelect.emit(item)\" data-testid=\"home-c1-item\">\r\n @if (item.imageUrl) { <img [src]=\"item.imageUrl\" alt=\"\" loading=\"lazy\" /> }\r\n <span class=\"copy\">\r\n <strong>{{ item.name }}</strong>\r\n @if (item.date) { <span>{{ item.date }}</span> }\r\n @if (item.detail) { <span>{{ item.detail }}</span> }\r\n </span>\r\n @if (item.badge) { <span class=\"badge\">{{ item.badge }}</span> }\r\n <span class=\"chevron\" aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n }\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0;--compact-ink: #1f2522;--compact-muted: #68716c;--compact-line: #e3e7e1}.widget{box-sizing:border-box;min-height:120px;padding:14px;border:1px solid var(--compact-line);border-radius:16px;color:var(--compact-ink);background:#fff;box-shadow:0 4px 14px #1d2b230a}h2{margin:0 0 10px;font-size:12px;font-weight:800;line-height:1.3}.item{width:100%;min-height:64px;display:flex;align-items:center;gap:10px;padding:6px 0;border:0;color:inherit;background:transparent;text-align:left;font:inherit;cursor:pointer}.item img{width:48px;height:48px;flex:0 0 48px;border-radius:12px;object-fit:cover}.copy{min-width:0;flex:1 1 auto;display:grid;gap:3px}.copy>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.copy strong{font-size:13px;line-height:1.35}.copy span{color:var(--compact-muted);font-size:11px}.badge{max-width:35%;overflow:hidden;padding:4px 8px;border-radius:999px;color:inherit;background:#eef0ed;font-size:10px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}.chevron{flex:0 0 auto;color:var(--compact-muted);font-size:22px}.state{min-height:66px;display:flex;align-items:center;gap:10px;color:var(--compact-muted);font-size:12px}.state--error{color:#8c302d}.state button{border:0;padding:4px;color:inherit;background:transparent;font:inherit;font-weight:800;text-decoration:underline;cursor:pointer}.state span{width:100%;height:42px;border-radius:10px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.state span{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
455
|
+
}
|
|
456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeC1Component, decorators: [{
|
|
457
|
+
type: Component,
|
|
458
|
+
args: [{ selector: 'w-home-c1', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { 'data-composition': 'C1' }, template: "<article class=\"widget compact\" [style.background-color]=\"backgroundColor\" [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\" data-testid=\"home-c1\">\r\n <h2>{{ title }}</h2>\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"state\" role=\"status\" [attr.aria-label]=\"texts.loading\" data-testid=\"home-c1-loading\"><span></span></div>\r\n }\r\n @case ('error') {\r\n <div class=\"state state--error\" role=\"alert\" data-testid=\"home-c1-error\">\r\n <strong>{{ texts.error }}</strong><button type=\"button\" (click)=\"retry.emit()\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"state\" role=\"note\" data-testid=\"home-c1-unavailable\">{{ texts.unavailable }}</div>\r\n }\r\n @case ('empty') {\r\n <div class=\"state\" data-testid=\"home-c1-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n @if (model; as item) {\r\n <button class=\"item\" type=\"button\" (click)=\"itemSelect.emit(item)\" data-testid=\"home-c1-item\">\r\n @if (item.imageUrl) { <img [src]=\"item.imageUrl\" alt=\"\" loading=\"lazy\" /> }\r\n <span class=\"copy\">\r\n <strong>{{ item.name }}</strong>\r\n @if (item.date) { <span>{{ item.date }}</span> }\r\n @if (item.detail) { <span>{{ item.detail }}</span> }\r\n </span>\r\n @if (item.badge) { <span class=\"badge\">{{ item.badge }}</span> }\r\n <span class=\"chevron\" aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n }\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0;--compact-ink: #1f2522;--compact-muted: #68716c;--compact-line: #e3e7e1}.widget{box-sizing:border-box;min-height:120px;padding:14px;border:1px solid var(--compact-line);border-radius:16px;color:var(--compact-ink);background:#fff;box-shadow:0 4px 14px #1d2b230a}h2{margin:0 0 10px;font-size:12px;font-weight:800;line-height:1.3}.item{width:100%;min-height:64px;display:flex;align-items:center;gap:10px;padding:6px 0;border:0;color:inherit;background:transparent;text-align:left;font:inherit;cursor:pointer}.item img{width:48px;height:48px;flex:0 0 48px;border-radius:12px;object-fit:cover}.copy{min-width:0;flex:1 1 auto;display:grid;gap:3px}.copy>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.copy strong{font-size:13px;line-height:1.35}.copy span{color:var(--compact-muted);font-size:11px}.badge{max-width:35%;overflow:hidden;padding:4px 8px;border-radius:999px;color:inherit;background:#eef0ed;font-size:10px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}.chevron{flex:0 0 auto;color:var(--compact-muted);font-size:22px}.state{min-height:66px;display:flex;align-items:center;gap:10px;color:var(--compact-muted);font-size:12px}.state--error{color:#8c302d}.state button{border:0;padding:4px;color:inherit;background:transparent;font:inherit;font-weight:800;text-decoration:underline;cursor:pointer}.state span{width:100%;height:42px;border-radius:10px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.state span{animation:none}}\n"] }]
|
|
459
|
+
}], propDecorators: { state: [{
|
|
460
|
+
type: Input
|
|
461
|
+
}], model: [{
|
|
462
|
+
type: Input
|
|
463
|
+
}], widgetStyle: [{
|
|
464
|
+
type: Input
|
|
465
|
+
}], labels: [{
|
|
466
|
+
type: Input
|
|
467
|
+
}], borderRadius: [{
|
|
468
|
+
type: Input
|
|
469
|
+
}], itemSelect: [{
|
|
470
|
+
type: Output
|
|
471
|
+
}], retry: [{
|
|
472
|
+
type: Output
|
|
473
|
+
}] } });
|
|
474
|
+
|
|
475
|
+
class WHomeC2Component {
|
|
476
|
+
constructor() {
|
|
477
|
+
this.state = 'loading';
|
|
478
|
+
this.model = null;
|
|
479
|
+
this.config = null;
|
|
480
|
+
this.widgetStyle = null;
|
|
481
|
+
this.labels = null;
|
|
482
|
+
this.borderRadius = null;
|
|
483
|
+
this.openDetails = new EventEmitter();
|
|
484
|
+
this.retry = new EventEmitter();
|
|
485
|
+
}
|
|
486
|
+
get texts() {
|
|
487
|
+
return { ...W_HOME_C2_DEFAULT_LABELS, ...(this.labels ?? {}) };
|
|
488
|
+
}
|
|
489
|
+
get title() {
|
|
490
|
+
return this.model?.title?.trim() || this.texts.title;
|
|
491
|
+
}
|
|
492
|
+
get backgroundColor() {
|
|
493
|
+
return wHomeHexColor(this.widgetStyle?.backgroundColor);
|
|
494
|
+
}
|
|
495
|
+
get foregroundColor() {
|
|
496
|
+
return wHomeHexColor(this.widgetStyle?.foregroundColor);
|
|
497
|
+
}
|
|
498
|
+
get progressPercent() {
|
|
499
|
+
const model = this.model;
|
|
500
|
+
if (!model || !Number.isFinite(model.current) || !Number.isFinite(model.from) || !Number.isFinite(model.to)) {
|
|
501
|
+
return 0;
|
|
502
|
+
}
|
|
503
|
+
if (model.to <= model.from) {
|
|
504
|
+
return model.current >= model.to ? 100 : 0;
|
|
505
|
+
}
|
|
506
|
+
return Math.max(0, Math.min(100, ((model.current - model.from) / (model.to - model.from)) * 100));
|
|
507
|
+
}
|
|
508
|
+
get progressValue() {
|
|
509
|
+
const model = this.model;
|
|
510
|
+
if (!model || !Number.isFinite(model.current)) {
|
|
511
|
+
return 0;
|
|
512
|
+
}
|
|
513
|
+
return Math.max(model.from, Math.min(model.to, model.current));
|
|
514
|
+
}
|
|
515
|
+
get steps() {
|
|
516
|
+
return this.config?.showSteps === true ? (this.model?.steps ?? []) : [];
|
|
517
|
+
}
|
|
518
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeC2Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
519
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: WHomeC2Component, isStandalone: true, selector: "w-home-c2", inputs: { state: "state", model: "model", config: "config", widgetStyle: "widgetStyle", labels: "labels", borderRadius: "borderRadius" }, outputs: { openDetails: "openDetails", retry: "retry" }, host: { attributes: { "data-composition": "C2" } }, ngImport: i0, template: "<article class=\"widget membership\" [style.background-color]=\"backgroundColor\" [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\" data-testid=\"home-c2\">\r\n <h2>{{ title }}</h2>\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"state\" role=\"status\" [attr.aria-label]=\"texts.loading\" data-testid=\"home-c2-loading\"><span></span></div>\r\n }\r\n @case ('error') {\r\n <div class=\"state state--error\" role=\"alert\" data-testid=\"home-c2-error\">\r\n <strong>{{ texts.error }}</strong><button type=\"button\" (click)=\"retry.emit()\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"state\" role=\"note\" data-testid=\"home-c2-unavailable\">{{ texts.unavailable }}</div>\r\n }\r\n @case ('empty') {\r\n <div class=\"state\" data-testid=\"home-c2-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n @if (model; as membership) {\r\n <button class=\"level\" type=\"button\" (click)=\"openDetails.emit()\" data-testid=\"home-c2-level\">\r\n <span class=\"medal\" [style.background-color]=\"membership.color || null\" aria-hidden=\"true\"></span>\r\n <span class=\"copy\">\r\n <strong>{{ membership.levelName }}</strong>\r\n <span>{{ texts.progress }}: {{ membership.current }} / {{ membership.to }}</span>\r\n </span>\r\n <span class=\"chevron\" aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n <div class=\"progress\" role=\"progressbar\" [attr.aria-label]=\"texts.progress\"\r\n [attr.aria-valuemin]=\"membership.from\" [attr.aria-valuemax]=\"membership.to\"\r\n [attr.aria-valuenow]=\"progressValue\">\r\n <span [style.width.%]=\"progressPercent\" [style.background-color]=\"membership.color || null\"></span>\r\n </div>\r\n @if (steps.length) {\r\n <div class=\"steps\" data-testid=\"home-c2-steps\">\r\n <span class=\"steps__title\">{{ texts.steps }}</span>\r\n @for (step of steps; track step.name) {\r\n <span class=\"step\">{{ step.name }}<small>{{ step.threshold }}</small></span>\r\n }\r\n </div>\r\n }\r\n }\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0;--compact-ink: #1f2522;--compact-muted: #68716c;--compact-line: #e3e7e1;--compact-accent: #1f5d45}.widget{box-sizing:border-box;min-height:150px;padding:14px;border:1px solid var(--compact-line);border-radius:16px;color:var(--compact-ink);background:#fff;box-shadow:0 4px 14px #1d2b230a}h2{margin:0 0 10px;font-size:12px;font-weight:800;line-height:1.3}.level{width:100%;min-height:48px;display:flex;align-items:center;gap:10px;padding:2px 0;border:0;color:inherit;background:transparent;text-align:left;font:inherit;cursor:pointer}.medal{width:34px;height:34px;flex:0 0 34px;border-radius:50%;background:var(--compact-accent);box-shadow:inset 0 0 0 5px #ffffffc2}.copy{min-width:0;flex:1 1 auto;display:grid;gap:3px}.copy>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.copy strong{font-size:14px;line-height:1.3}.copy span,.steps__title{color:var(--compact-muted);font-size:11px}.chevron{color:var(--compact-muted);font-size:22px}.progress{height:7px;margin-top:12px;overflow:hidden;border-radius:999px;background:#eef0ed}.progress span{height:100%;display:block;border-radius:inherit;background:var(--compact-accent);transition:width .18s ease-out}.steps{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}.steps__title{width:100%;font-weight:700}.step{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:4px 7px;border-radius:999px;background:#f2f4f1;font-size:10px}.step small{color:var(--compact-muted);font-size:9px}.state{min-height:78px;display:flex;align-items:center;gap:10px;color:var(--compact-muted);font-size:12px}.state--error{color:#8c302d}.state button{border:0;padding:4px;color:inherit;background:transparent;font:inherit;font-weight:800;text-decoration:underline;cursor:pointer}.state span{width:100%;height:54px;border-radius:10px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.state span{animation:none}.progress span{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
520
|
+
}
|
|
521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeC2Component, decorators: [{
|
|
522
|
+
type: Component,
|
|
523
|
+
args: [{ selector: 'w-home-c2', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { 'data-composition': 'C2' }, template: "<article class=\"widget membership\" [style.background-color]=\"backgroundColor\" [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\" data-testid=\"home-c2\">\r\n <h2>{{ title }}</h2>\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"state\" role=\"status\" [attr.aria-label]=\"texts.loading\" data-testid=\"home-c2-loading\"><span></span></div>\r\n }\r\n @case ('error') {\r\n <div class=\"state state--error\" role=\"alert\" data-testid=\"home-c2-error\">\r\n <strong>{{ texts.error }}</strong><button type=\"button\" (click)=\"retry.emit()\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"state\" role=\"note\" data-testid=\"home-c2-unavailable\">{{ texts.unavailable }}</div>\r\n }\r\n @case ('empty') {\r\n <div class=\"state\" data-testid=\"home-c2-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n @if (model; as membership) {\r\n <button class=\"level\" type=\"button\" (click)=\"openDetails.emit()\" data-testid=\"home-c2-level\">\r\n <span class=\"medal\" [style.background-color]=\"membership.color || null\" aria-hidden=\"true\"></span>\r\n <span class=\"copy\">\r\n <strong>{{ membership.levelName }}</strong>\r\n <span>{{ texts.progress }}: {{ membership.current }} / {{ membership.to }}</span>\r\n </span>\r\n <span class=\"chevron\" aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n <div class=\"progress\" role=\"progressbar\" [attr.aria-label]=\"texts.progress\"\r\n [attr.aria-valuemin]=\"membership.from\" [attr.aria-valuemax]=\"membership.to\"\r\n [attr.aria-valuenow]=\"progressValue\">\r\n <span [style.width.%]=\"progressPercent\" [style.background-color]=\"membership.color || null\"></span>\r\n </div>\r\n @if (steps.length) {\r\n <div class=\"steps\" data-testid=\"home-c2-steps\">\r\n <span class=\"steps__title\">{{ texts.steps }}</span>\r\n @for (step of steps; track step.name) {\r\n <span class=\"step\">{{ step.name }}<small>{{ step.threshold }}</small></span>\r\n }\r\n </div>\r\n }\r\n }\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0;--compact-ink: #1f2522;--compact-muted: #68716c;--compact-line: #e3e7e1;--compact-accent: #1f5d45}.widget{box-sizing:border-box;min-height:150px;padding:14px;border:1px solid var(--compact-line);border-radius:16px;color:var(--compact-ink);background:#fff;box-shadow:0 4px 14px #1d2b230a}h2{margin:0 0 10px;font-size:12px;font-weight:800;line-height:1.3}.level{width:100%;min-height:48px;display:flex;align-items:center;gap:10px;padding:2px 0;border:0;color:inherit;background:transparent;text-align:left;font:inherit;cursor:pointer}.medal{width:34px;height:34px;flex:0 0 34px;border-radius:50%;background:var(--compact-accent);box-shadow:inset 0 0 0 5px #ffffffc2}.copy{min-width:0;flex:1 1 auto;display:grid;gap:3px}.copy>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.copy strong{font-size:14px;line-height:1.3}.copy span,.steps__title{color:var(--compact-muted);font-size:11px}.chevron{color:var(--compact-muted);font-size:22px}.progress{height:7px;margin-top:12px;overflow:hidden;border-radius:999px;background:#eef0ed}.progress span{height:100%;display:block;border-radius:inherit;background:var(--compact-accent);transition:width .18s ease-out}.steps{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}.steps__title{width:100%;font-weight:700}.step{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:4px 7px;border-radius:999px;background:#f2f4f1;font-size:10px}.step small{color:var(--compact-muted);font-size:9px}.state{min-height:78px;display:flex;align-items:center;gap:10px;color:var(--compact-muted);font-size:12px}.state--error{color:#8c302d}.state button{border:0;padding:4px;color:inherit;background:transparent;font:inherit;font-weight:800;text-decoration:underline;cursor:pointer}.state span{width:100%;height:54px;border-radius:10px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.state span{animation:none}.progress span{transition:none}}\n"] }]
|
|
524
|
+
}], propDecorators: { state: [{
|
|
525
|
+
type: Input
|
|
526
|
+
}], model: [{
|
|
527
|
+
type: Input
|
|
528
|
+
}], config: [{
|
|
529
|
+
type: Input
|
|
530
|
+
}], widgetStyle: [{
|
|
531
|
+
type: Input
|
|
532
|
+
}], labels: [{
|
|
533
|
+
type: Input
|
|
534
|
+
}], borderRadius: [{
|
|
535
|
+
type: Input
|
|
536
|
+
}], openDetails: [{
|
|
537
|
+
type: Output
|
|
538
|
+
}], retry: [{
|
|
539
|
+
type: Output
|
|
540
|
+
}] } });
|
|
541
|
+
|
|
542
|
+
class WHomeE1Component {
|
|
543
|
+
constructor() {
|
|
544
|
+
this.state = 'loading';
|
|
545
|
+
this.model = null;
|
|
546
|
+
this.widgetStyle = null;
|
|
547
|
+
this.labels = null;
|
|
548
|
+
this.itemSelect = new EventEmitter();
|
|
549
|
+
this.retry = new EventEmitter();
|
|
550
|
+
this.imageFailed = false;
|
|
551
|
+
this.borderRadiusInput = null;
|
|
552
|
+
}
|
|
553
|
+
get texts() {
|
|
554
|
+
return { ...W_HOME_E1_DEFAULT_LABELS, ...(this.labels ?? {}) };
|
|
555
|
+
}
|
|
556
|
+
get title() {
|
|
557
|
+
return this.model?.title?.trim() || this.texts.title;
|
|
558
|
+
}
|
|
559
|
+
get backgroundColor() {
|
|
560
|
+
return wHomeHexColor(this.widgetStyle?.backgroundColor);
|
|
561
|
+
}
|
|
562
|
+
get foregroundColor() {
|
|
563
|
+
return wHomeHexColor(this.widgetStyle?.foregroundColor);
|
|
564
|
+
}
|
|
565
|
+
get borderRadius() {
|
|
566
|
+
return wHomeIntegerInRange(this.borderRadiusInput, W_HOME_WIDGET_BORDER_RADIUS.min, W_HOME_WIDGET_BORDER_RADIUS.max);
|
|
567
|
+
}
|
|
568
|
+
get hasImage() {
|
|
569
|
+
return !!this.model?.entity.imageUrl && !this.imageFailed;
|
|
570
|
+
}
|
|
571
|
+
onImageError() {
|
|
572
|
+
this.imageFailed = true;
|
|
573
|
+
}
|
|
574
|
+
select() {
|
|
575
|
+
if (this.model) {
|
|
576
|
+
this.itemSelect.emit(this.model.entity.id);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeE1Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
580
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: WHomeE1Component, isStandalone: true, selector: "w-home-e1", inputs: { state: "state", model: "model", widgetStyle: "widgetStyle", labels: "labels", borderRadiusInput: ["borderRadius", "borderRadiusInput"] }, outputs: { itemSelect: "itemSelect", retry: "retry" }, host: { attributes: { "data-composition": "E1" }, classAttribute: "span-full" }, ngImport: i0, template: "<article class=\"widget\" [style.background-color]=\"backgroundColor\" [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\" data-testid=\"e1-widget\">\r\n <h2>{{ title }}</h2>\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"state\" role=\"status\" [attr.aria-label]=\"texts.loading\" data-testid=\"e1-loading\"><span></span></div>\r\n }\r\n @case ('error') {\r\n <div class=\"state state--error\" role=\"alert\" data-testid=\"e1-error\">\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"e1-retry\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"state\" role=\"note\" data-testid=\"e1-unavailable\">{{ texts.unavailable }}</div>\r\n }\r\n @case ('empty') {\r\n <div class=\"state\" data-testid=\"e1-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n @if (model; as data) {\r\n <button class=\"entity\" type=\"button\" (click)=\"select()\" data-testid=\"e1-entity\">\r\n @if (hasImage) {\r\n <img [src]=\"data.entity.imageUrl\" alt=\"\" loading=\"lazy\" (error)=\"onImageError()\" />\r\n } @else {\r\n <span class=\"entity__placeholder\" aria-hidden=\"true\">{{ data.entity.name.slice(0, 1) }}</span>\r\n }\r\n <span class=\"entity__copy\">\r\n <strong>{{ data.entity.name }}</strong>\r\n @if (data.entity.detail) {\r\n <span>{{ data.entity.detail }}</span>\r\n }\r\n </span>\r\n <span class=\"entity__chevron\" aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n }\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0}.widget{box-sizing:border-box;min-height:126px;padding:16px;border:1px solid #e3e7e1;border-radius:16px;color:#1f2522;background:#fff;box-shadow:0 4px 14px #1d2b230a}h2{margin:0 0 12px;font-size:15px;font-weight:750;line-height:1.3}.entity{display:flex;align-items:center;gap:12px;width:100%;min-height:68px;padding:0;border:0;color:inherit;background:transparent;text-align:left;font:inherit;cursor:pointer}.entity img,.entity__placeholder{width:56px;height:56px;flex:0 0 56px;border-radius:12px;object-fit:cover;background:#f0f2ef}.entity__placeholder{display:grid;place-items:center;color:#68716c;font-size:21px}.entity__copy{display:grid;flex:1 1 auto;min-width:0;gap:4px}.entity__copy strong,.entity__copy span{overflow:hidden;text-overflow:ellipsis}.entity__copy strong{font-size:15px;line-height:1.35}.entity__copy span{color:#68716c;font-size:12px}.entity__chevron{color:#68716c;font-size:24px}.state{min-height:76px;display:flex;align-items:center;gap:10px;color:#68716c;font-size:13px}.state--error{color:#8c302d}.state button{border:0;padding:4px;color:inherit;background:transparent;font:inherit;font-weight:700;text-decoration:underline;cursor:pointer}.state>span{width:100%;height:54px;border-radius:10px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.state>span{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
581
|
+
}
|
|
582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeE1Component, decorators: [{
|
|
583
|
+
type: Component,
|
|
584
|
+
args: [{ selector: 'w-home-e1', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'span-full', 'data-composition': 'E1' }, template: "<article class=\"widget\" [style.background-color]=\"backgroundColor\" [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\" data-testid=\"e1-widget\">\r\n <h2>{{ title }}</h2>\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"state\" role=\"status\" [attr.aria-label]=\"texts.loading\" data-testid=\"e1-loading\"><span></span></div>\r\n }\r\n @case ('error') {\r\n <div class=\"state state--error\" role=\"alert\" data-testid=\"e1-error\">\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"e1-retry\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"state\" role=\"note\" data-testid=\"e1-unavailable\">{{ texts.unavailable }}</div>\r\n }\r\n @case ('empty') {\r\n <div class=\"state\" data-testid=\"e1-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n @if (model; as data) {\r\n <button class=\"entity\" type=\"button\" (click)=\"select()\" data-testid=\"e1-entity\">\r\n @if (hasImage) {\r\n <img [src]=\"data.entity.imageUrl\" alt=\"\" loading=\"lazy\" (error)=\"onImageError()\" />\r\n } @else {\r\n <span class=\"entity__placeholder\" aria-hidden=\"true\">{{ data.entity.name.slice(0, 1) }}</span>\r\n }\r\n <span class=\"entity__copy\">\r\n <strong>{{ data.entity.name }}</strong>\r\n @if (data.entity.detail) {\r\n <span>{{ data.entity.detail }}</span>\r\n }\r\n </span>\r\n <span class=\"entity__chevron\" aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n }\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0}.widget{box-sizing:border-box;min-height:126px;padding:16px;border:1px solid #e3e7e1;border-radius:16px;color:#1f2522;background:#fff;box-shadow:0 4px 14px #1d2b230a}h2{margin:0 0 12px;font-size:15px;font-weight:750;line-height:1.3}.entity{display:flex;align-items:center;gap:12px;width:100%;min-height:68px;padding:0;border:0;color:inherit;background:transparent;text-align:left;font:inherit;cursor:pointer}.entity img,.entity__placeholder{width:56px;height:56px;flex:0 0 56px;border-radius:12px;object-fit:cover;background:#f0f2ef}.entity__placeholder{display:grid;place-items:center;color:#68716c;font-size:21px}.entity__copy{display:grid;flex:1 1 auto;min-width:0;gap:4px}.entity__copy strong,.entity__copy span{overflow:hidden;text-overflow:ellipsis}.entity__copy strong{font-size:15px;line-height:1.35}.entity__copy span{color:#68716c;font-size:12px}.entity__chevron{color:#68716c;font-size:24px}.state{min-height:76px;display:flex;align-items:center;gap:10px;color:#68716c;font-size:13px}.state--error{color:#8c302d}.state button{border:0;padding:4px;color:inherit;background:transparent;font:inherit;font-weight:700;text-decoration:underline;cursor:pointer}.state>span{width:100%;height:54px;border-radius:10px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.state>span{animation:none}}\n"] }]
|
|
585
|
+
}], propDecorators: { state: [{
|
|
586
|
+
type: Input
|
|
587
|
+
}], model: [{
|
|
588
|
+
type: Input
|
|
589
|
+
}], widgetStyle: [{
|
|
590
|
+
type: Input
|
|
591
|
+
}], labels: [{
|
|
592
|
+
type: Input
|
|
593
|
+
}], itemSelect: [{
|
|
594
|
+
type: Output
|
|
595
|
+
}], retry: [{
|
|
596
|
+
type: Output
|
|
597
|
+
}], borderRadiusInput: [{
|
|
598
|
+
type: Input,
|
|
599
|
+
args: ['borderRadius']
|
|
600
|
+
}] } });
|
|
601
|
+
|
|
602
|
+
class WHomeE2Component {
|
|
603
|
+
constructor() {
|
|
604
|
+
this.state = 'loading';
|
|
605
|
+
this.model = null;
|
|
606
|
+
this.config = null;
|
|
607
|
+
this.widgetStyle = null;
|
|
608
|
+
this.labels = null;
|
|
609
|
+
this.itemSelect = new EventEmitter();
|
|
610
|
+
this.retry = new EventEmitter();
|
|
611
|
+
this.borderRadiusInput = null;
|
|
612
|
+
}
|
|
613
|
+
get texts() {
|
|
614
|
+
return { ...W_HOME_E2_DEFAULT_LABELS, ...(this.labels ?? {}) };
|
|
615
|
+
}
|
|
616
|
+
get title() {
|
|
617
|
+
return this.model?.title?.trim() || this.texts.title;
|
|
618
|
+
}
|
|
619
|
+
get backgroundColor() {
|
|
620
|
+
return wHomeHexColor(this.widgetStyle?.backgroundColor);
|
|
621
|
+
}
|
|
622
|
+
get foregroundColor() {
|
|
623
|
+
return wHomeHexColor(this.widgetStyle?.foregroundColor);
|
|
624
|
+
}
|
|
625
|
+
get borderRadius() {
|
|
626
|
+
return wHomeIntegerInRange(this.borderRadiusInput, W_HOME_WIDGET_BORDER_RADIUS.min, W_HOME_WIDGET_BORDER_RADIUS.max);
|
|
627
|
+
}
|
|
628
|
+
formatValue(value) {
|
|
629
|
+
const formatted = new Intl.NumberFormat(undefined, {
|
|
630
|
+
maximumFractionDigits: this.model?.unit === 'money' ? 2 : 0
|
|
631
|
+
}).format(value);
|
|
632
|
+
if (this.model?.unit !== 'money' || !this.model.currencySymbol) {
|
|
633
|
+
return formatted;
|
|
634
|
+
}
|
|
635
|
+
return this.model.symbolPosition === 'before'
|
|
636
|
+
? `${this.model.currencySymbol}${formatted}`
|
|
637
|
+
: `${formatted}${this.model.currencySymbol}`;
|
|
638
|
+
}
|
|
639
|
+
select() {
|
|
640
|
+
const id = this.model?.serviceId;
|
|
641
|
+
if (typeof id === 'number' && Number.isFinite(id)) {
|
|
642
|
+
this.itemSelect.emit(id);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeE2Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
646
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: WHomeE2Component, isStandalone: true, selector: "w-home-e2", inputs: { state: "state", model: "model", config: "config", widgetStyle: "widgetStyle", labels: "labels", borderRadiusInput: ["borderRadius", "borderRadiusInput"] }, outputs: { itemSelect: "itemSelect", retry: "retry" }, host: { attributes: { "data-composition": "E2" }, classAttribute: "span-full" }, ngImport: i0, template: "<article class=\"widget\" [style.background-color]=\"backgroundColor\" [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\" data-testid=\"e2-widget\">\r\n <h2>{{ title }}</h2>\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"state\" role=\"status\" [attr.aria-label]=\"texts.loading\" data-testid=\"e2-loading\"><span></span></div>\r\n }\r\n @case ('error') {\r\n <div class=\"state state--error\" role=\"alert\" data-testid=\"e2-error\">\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"e2-retry\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"state\" role=\"note\" data-testid=\"e2-unavailable\">{{ texts.unavailable }}</div>\r\n }\r\n @case ('empty') {\r\n <div class=\"state\" data-testid=\"e2-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n @if (model; as data) {\r\n <div class=\"metrics\" data-testid=\"e2-summary\">\r\n @if (data.achieved !== null && data.achieved !== undefined) {\r\n <div class=\"metric\">\r\n <span>{{ texts.achieved }}</span>\r\n <strong>{{ formatValue(data.achieved) }}</strong>\r\n </div>\r\n }\r\n @if (data.pending !== null && data.pending !== undefined) {\r\n <div class=\"metric\">\r\n <span>{{ texts.pending }}</span>\r\n <strong>{{ formatValue(data.pending) }}</strong>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"rewards\">\r\n @if (data.customerReward !== null && data.customerReward !== undefined) {\r\n <p><span>{{ texts.customerReward }}</span><strong>{{ formatValue(data.customerReward) }}</strong></p>\r\n }\r\n @if (data.friendReward !== null && data.friendReward !== undefined) {\r\n <p><span>{{ texts.friendReward }}</span><strong>{{ formatValue(data.friendReward) }}</strong></p>\r\n }\r\n </div>\r\n @if (config?.showInvitations === true && data.invitations; as invitations) {\r\n <div class=\"invitations\" data-testid=\"e2-invitations\">\r\n <strong>{{ texts.invitations }}</strong>\r\n <span>{{ texts.acceptedInvitations }}: {{ invitations.accepted }}</span>\r\n <span>{{ texts.pendingInvitations }}: {{ invitations.pending }}</span>\r\n </div>\r\n }\r\n <button class=\"program-action\" type=\"button\" (click)=\"select()\" data-testid=\"e2-open\">\r\n {{ texts.openProgram }} <span aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n }\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0}.widget{box-sizing:border-box;min-height:176px;padding:16px;border:1px solid #e3e7e1;border-radius:16px;color:#1f2522;background:#fff;box-shadow:0 4px 14px #1d2b230a}h2{margin:0 0 14px;font-size:15px;font-weight:750;line-height:1.3}.metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric{display:grid;gap:3px;min-width:0;padding:10px;border-radius:12px;background:#f5f6f4}.metric span,.rewards span,.invitations span{color:#68716c;font-size:12px}.metric strong{overflow-wrap:anywhere;font-size:18px;font-variant-numeric:tabular-nums}.rewards{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:10px}.rewards p{display:flex;flex-wrap:wrap;gap:4px;margin:0;font-size:12px}.rewards strong{font-variant-numeric:tabular-nums}.invitations{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:12px;padding-top:10px;border-top:1px solid #e3e7e1}.invitations>strong{width:100%;font-size:12px}.program-action{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:12px;padding:8px 0 0;border:0;border-top:1px solid #e3e7e1;color:inherit;background:transparent;font:inherit;font-size:13px;font-weight:700;text-align:left;cursor:pointer}.program-action span{font-size:22px;color:#68716c}.state{min-height:90px;display:flex;align-items:center;gap:10px;color:#68716c;font-size:13px}.state--error{color:#8c302d}.state button{border:0;padding:4px;color:inherit;background:transparent;font:inherit;font-weight:700;text-decoration:underline;cursor:pointer}.state>span{width:100%;height:64px;border-radius:10px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(max-width:400px){.metric{padding:8px}.metric strong{font-size:16px}}@media(prefers-reduced-motion:reduce){.state>span{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
647
|
+
}
|
|
648
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeE2Component, decorators: [{
|
|
649
|
+
type: Component,
|
|
650
|
+
args: [{ selector: 'w-home-e2', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'span-full', 'data-composition': 'E2' }, template: "<article class=\"widget\" [style.background-color]=\"backgroundColor\" [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\" data-testid=\"e2-widget\">\r\n <h2>{{ title }}</h2>\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"state\" role=\"status\" [attr.aria-label]=\"texts.loading\" data-testid=\"e2-loading\"><span></span></div>\r\n }\r\n @case ('error') {\r\n <div class=\"state state--error\" role=\"alert\" data-testid=\"e2-error\">\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"e2-retry\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"state\" role=\"note\" data-testid=\"e2-unavailable\">{{ texts.unavailable }}</div>\r\n }\r\n @case ('empty') {\r\n <div class=\"state\" data-testid=\"e2-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n @if (model; as data) {\r\n <div class=\"metrics\" data-testid=\"e2-summary\">\r\n @if (data.achieved !== null && data.achieved !== undefined) {\r\n <div class=\"metric\">\r\n <span>{{ texts.achieved }}</span>\r\n <strong>{{ formatValue(data.achieved) }}</strong>\r\n </div>\r\n }\r\n @if (data.pending !== null && data.pending !== undefined) {\r\n <div class=\"metric\">\r\n <span>{{ texts.pending }}</span>\r\n <strong>{{ formatValue(data.pending) }}</strong>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"rewards\">\r\n @if (data.customerReward !== null && data.customerReward !== undefined) {\r\n <p><span>{{ texts.customerReward }}</span><strong>{{ formatValue(data.customerReward) }}</strong></p>\r\n }\r\n @if (data.friendReward !== null && data.friendReward !== undefined) {\r\n <p><span>{{ texts.friendReward }}</span><strong>{{ formatValue(data.friendReward) }}</strong></p>\r\n }\r\n </div>\r\n @if (config?.showInvitations === true && data.invitations; as invitations) {\r\n <div class=\"invitations\" data-testid=\"e2-invitations\">\r\n <strong>{{ texts.invitations }}</strong>\r\n <span>{{ texts.acceptedInvitations }}: {{ invitations.accepted }}</span>\r\n <span>{{ texts.pendingInvitations }}: {{ invitations.pending }}</span>\r\n </div>\r\n }\r\n <button class=\"program-action\" type=\"button\" (click)=\"select()\" data-testid=\"e2-open\">\r\n {{ texts.openProgram }} <span aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n }\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0}.widget{box-sizing:border-box;min-height:176px;padding:16px;border:1px solid #e3e7e1;border-radius:16px;color:#1f2522;background:#fff;box-shadow:0 4px 14px #1d2b230a}h2{margin:0 0 14px;font-size:15px;font-weight:750;line-height:1.3}.metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric{display:grid;gap:3px;min-width:0;padding:10px;border-radius:12px;background:#f5f6f4}.metric span,.rewards span,.invitations span{color:#68716c;font-size:12px}.metric strong{overflow-wrap:anywhere;font-size:18px;font-variant-numeric:tabular-nums}.rewards{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:10px}.rewards p{display:flex;flex-wrap:wrap;gap:4px;margin:0;font-size:12px}.rewards strong{font-variant-numeric:tabular-nums}.invitations{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:12px;padding-top:10px;border-top:1px solid #e3e7e1}.invitations>strong{width:100%;font-size:12px}.program-action{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:12px;padding:8px 0 0;border:0;border-top:1px solid #e3e7e1;color:inherit;background:transparent;font:inherit;font-size:13px;font-weight:700;text-align:left;cursor:pointer}.program-action span{font-size:22px;color:#68716c}.state{min-height:90px;display:flex;align-items:center;gap:10px;color:#68716c;font-size:13px}.state--error{color:#8c302d}.state button{border:0;padding:4px;color:inherit;background:transparent;font:inherit;font-weight:700;text-decoration:underline;cursor:pointer}.state>span{width:100%;height:64px;border-radius:10px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(max-width:400px){.metric{padding:8px}.metric strong{font-size:16px}}@media(prefers-reduced-motion:reduce){.state>span{animation:none}}\n"] }]
|
|
651
|
+
}], propDecorators: { state: [{
|
|
652
|
+
type: Input
|
|
653
|
+
}], model: [{
|
|
654
|
+
type: Input
|
|
655
|
+
}], config: [{
|
|
656
|
+
type: Input
|
|
657
|
+
}], widgetStyle: [{
|
|
658
|
+
type: Input
|
|
659
|
+
}], labels: [{
|
|
660
|
+
type: Input
|
|
661
|
+
}], itemSelect: [{
|
|
662
|
+
type: Output
|
|
663
|
+
}], retry: [{
|
|
664
|
+
type: Output
|
|
665
|
+
}], borderRadiusInput: [{
|
|
666
|
+
type: Input,
|
|
667
|
+
args: ['borderRadius']
|
|
668
|
+
}] } });
|
|
669
|
+
|
|
670
|
+
class WHomeE3Component {
|
|
671
|
+
constructor() {
|
|
672
|
+
this.state = 'loading';
|
|
673
|
+
this.model = null;
|
|
674
|
+
this.widgetStyle = null;
|
|
675
|
+
this.config = null;
|
|
676
|
+
this.labels = null;
|
|
677
|
+
this.viewAll = new EventEmitter();
|
|
678
|
+
this.itemSelect = new EventEmitter();
|
|
679
|
+
this.retry = new EventEmitter();
|
|
680
|
+
this.brokenImages = new Set();
|
|
681
|
+
this.borderRadiusInput = null;
|
|
682
|
+
}
|
|
683
|
+
get texts() {
|
|
684
|
+
return { ...W_HOME_E3_DEFAULT_LABELS, ...(this.labels ?? {}) };
|
|
685
|
+
}
|
|
686
|
+
get title() {
|
|
687
|
+
return this.model?.title?.trim() || this.texts.title;
|
|
688
|
+
}
|
|
689
|
+
get backgroundColor() {
|
|
690
|
+
return wHomeHexColor(this.widgetStyle?.backgroundColor);
|
|
691
|
+
}
|
|
692
|
+
get foregroundColor() {
|
|
693
|
+
return wHomeHexColor(this.widgetStyle?.foregroundColor);
|
|
694
|
+
}
|
|
695
|
+
get borderRadius() {
|
|
696
|
+
return wHomeIntegerInRange(this.borderRadiusInput, W_HOME_WIDGET_BORDER_RADIUS.min, W_HOME_WIDGET_BORDER_RADIUS.max);
|
|
697
|
+
}
|
|
698
|
+
get previewLimit() {
|
|
699
|
+
return wHomeIntegerInRange(this.config?.previewLimit, W_HOME_PREVIEW_LIMIT.min, W_HOME_PREVIEW_LIMIT.max)
|
|
700
|
+
?? W_HOME_PREVIEW_LIMIT.default;
|
|
701
|
+
}
|
|
702
|
+
get visibleItems() {
|
|
703
|
+
return (this.model?.items ?? []).slice(0, this.previewLimit);
|
|
704
|
+
}
|
|
705
|
+
get total() {
|
|
706
|
+
return this.model?.total ?? this.model?.items.length ?? 0;
|
|
707
|
+
}
|
|
708
|
+
get hasMore() {
|
|
709
|
+
return this.total > this.visibleItems.length;
|
|
710
|
+
}
|
|
711
|
+
hasImage(item) {
|
|
712
|
+
return !!item.imageUrl && !this.brokenImages.has(item.id);
|
|
713
|
+
}
|
|
714
|
+
onImageError(item) {
|
|
715
|
+
this.brokenImages.add(item.id);
|
|
716
|
+
}
|
|
717
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeE3Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
718
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: WHomeE3Component, isStandalone: true, selector: "w-home-e3", inputs: { state: "state", model: "model", widgetStyle: "widgetStyle", config: "config", labels: "labels", borderRadiusInput: ["borderRadius", "borderRadiusInput"] }, outputs: { viewAll: "viewAll", itemSelect: "itemSelect", retry: "retry" }, host: { attributes: { "data-composition": "E3" }, classAttribute: "span-full" }, ngImport: i0, template: "<article class=\"widget\" [style.background-color]=\"backgroundColor\" [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\" data-testid=\"e3-widget\">\r\n <header class=\"card-header\">\r\n <h2>{{ title }}</h2>\r\n @if (state === 'loaded' && hasMore) {\r\n <button type=\"button\" class=\"text-action\" (click)=\"viewAll.emit()\" data-testid=\"e3-view-all\">\r\n {{ texts.viewAll }} <span aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n }\r\n </header>\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"state\" role=\"status\" [attr.aria-label]=\"texts.loading\" data-testid=\"e3-loading\">\r\n <span></span><span></span><span></span>\r\n </div>\r\n }\r\n @case ('error') {\r\n <div class=\"state state--error\" role=\"alert\" data-testid=\"e3-error\">\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"e3-retry\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"state\" role=\"note\" data-testid=\"e3-unavailable\">{{ texts.unavailable }}</div>\r\n }\r\n @case ('empty') {\r\n <div class=\"state\" data-testid=\"e3-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n <div class=\"collection\" data-testid=\"e3-collection\">\r\n @for (item of visibleItems; track item.id) {\r\n <button type=\"button\" class=\"entity\" (click)=\"itemSelect.emit(item.id)\" data-testid=\"e3-item\">\r\n @if (hasImage(item)) {\r\n <img [src]=\"item.imageUrl\" alt=\"\" loading=\"lazy\" (error)=\"onImageError(item)\" />\r\n } @else {\r\n <span class=\"entity__placeholder\" aria-hidden=\"true\">{{ item.name.slice(0, 1) }}</span>\r\n }\r\n <span class=\"entity__copy\">\r\n <strong>{{ item.name }}</strong>\r\n @if (item.description) {\r\n <span>{{ item.description }}</span>\r\n }\r\n </span>\r\n <span class=\"entity__chevron\" aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0}.widget{box-sizing:border-box;padding:16px;border:1px solid #e3e7e1;border-radius:16px;color:#1f2522;background:#fff;box-shadow:0 4px 14px #1d2b230a}.card-header{display:flex;justify-content:space-between;align-items:start;gap:12px;margin-bottom:8px}h2{min-width:0;margin:0;font-size:15px;font-weight:750;line-height:1.3}.text-action{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;padding:0;border:0;color:#1f5d45;background:transparent;font:inherit;font-size:12px;font-weight:750;cursor:pointer}.text-action span{font-size:20px;line-height:1}.collection{display:grid}.entity{display:flex;align-items:center;gap:12px;width:100%;min-height:72px;padding:9px 0;border:0;border-top:1px solid #eef0ed;color:inherit;background:transparent;text-align:left;font:inherit;cursor:pointer}.entity img,.entity__placeholder{width:48px;height:48px;flex:0 0 48px;border-radius:10px;object-fit:cover;background:#f0f2ef}.entity__placeholder{display:grid;place-items:center;color:#68716c;font-size:19px}.entity__copy{display:grid;flex:1 1 auto;min-width:0;gap:3px}.entity__copy strong,.entity__copy span{overflow:hidden;text-overflow:ellipsis}.entity__copy strong{font-size:14px;line-height:1.3}.entity__copy span{display:-webkit-box;color:#68716c;font-size:12px;line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2}.entity__chevron{color:#68716c;font-size:22px}.state{min-height:82px;display:grid;align-content:center;gap:8px;color:#68716c;font-size:13px}.state--error{color:#8c302d}.state button{justify-self:start;border:0;padding:4px;color:inherit;background:transparent;font:inherit;font-weight:700;text-decoration:underline;cursor:pointer}.state>span{width:100%;height:20px;border-radius:8px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.state>span{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
719
|
+
}
|
|
720
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeE3Component, decorators: [{
|
|
721
|
+
type: Component,
|
|
722
|
+
args: [{ selector: 'w-home-e3', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'span-full', 'data-composition': 'E3' }, template: "<article class=\"widget\" [style.background-color]=\"backgroundColor\" [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\" data-testid=\"e3-widget\">\r\n <header class=\"card-header\">\r\n <h2>{{ title }}</h2>\r\n @if (state === 'loaded' && hasMore) {\r\n <button type=\"button\" class=\"text-action\" (click)=\"viewAll.emit()\" data-testid=\"e3-view-all\">\r\n {{ texts.viewAll }} <span aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n }\r\n </header>\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"state\" role=\"status\" [attr.aria-label]=\"texts.loading\" data-testid=\"e3-loading\">\r\n <span></span><span></span><span></span>\r\n </div>\r\n }\r\n @case ('error') {\r\n <div class=\"state state--error\" role=\"alert\" data-testid=\"e3-error\">\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"e3-retry\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"state\" role=\"note\" data-testid=\"e3-unavailable\">{{ texts.unavailable }}</div>\r\n }\r\n @case ('empty') {\r\n <div class=\"state\" data-testid=\"e3-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n <div class=\"collection\" data-testid=\"e3-collection\">\r\n @for (item of visibleItems; track item.id) {\r\n <button type=\"button\" class=\"entity\" (click)=\"itemSelect.emit(item.id)\" data-testid=\"e3-item\">\r\n @if (hasImage(item)) {\r\n <img [src]=\"item.imageUrl\" alt=\"\" loading=\"lazy\" (error)=\"onImageError(item)\" />\r\n } @else {\r\n <span class=\"entity__placeholder\" aria-hidden=\"true\">{{ item.name.slice(0, 1) }}</span>\r\n }\r\n <span class=\"entity__copy\">\r\n <strong>{{ item.name }}</strong>\r\n @if (item.description) {\r\n <span>{{ item.description }}</span>\r\n }\r\n </span>\r\n <span class=\"entity__chevron\" aria-hidden=\"true\">\u203A</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0}.widget{box-sizing:border-box;padding:16px;border:1px solid #e3e7e1;border-radius:16px;color:#1f2522;background:#fff;box-shadow:0 4px 14px #1d2b230a}.card-header{display:flex;justify-content:space-between;align-items:start;gap:12px;margin-bottom:8px}h2{min-width:0;margin:0;font-size:15px;font-weight:750;line-height:1.3}.text-action{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;padding:0;border:0;color:#1f5d45;background:transparent;font:inherit;font-size:12px;font-weight:750;cursor:pointer}.text-action span{font-size:20px;line-height:1}.collection{display:grid}.entity{display:flex;align-items:center;gap:12px;width:100%;min-height:72px;padding:9px 0;border:0;border-top:1px solid #eef0ed;color:inherit;background:transparent;text-align:left;font:inherit;cursor:pointer}.entity img,.entity__placeholder{width:48px;height:48px;flex:0 0 48px;border-radius:10px;object-fit:cover;background:#f0f2ef}.entity__placeholder{display:grid;place-items:center;color:#68716c;font-size:19px}.entity__copy{display:grid;flex:1 1 auto;min-width:0;gap:3px}.entity__copy strong,.entity__copy span{overflow:hidden;text-overflow:ellipsis}.entity__copy strong{font-size:14px;line-height:1.3}.entity__copy span{display:-webkit-box;color:#68716c;font-size:12px;line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2}.entity__chevron{color:#68716c;font-size:22px}.state{min-height:82px;display:grid;align-content:center;gap:8px;color:#68716c;font-size:13px}.state--error{color:#8c302d}.state button{justify-self:start;border:0;padding:4px;color:inherit;background:transparent;font:inherit;font-weight:700;text-decoration:underline;cursor:pointer}.state>span{width:100%;height:20px;border-radius:8px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.state>span{animation:none}}\n"] }]
|
|
723
|
+
}], propDecorators: { state: [{
|
|
724
|
+
type: Input
|
|
725
|
+
}], model: [{
|
|
726
|
+
type: Input
|
|
727
|
+
}], widgetStyle: [{
|
|
728
|
+
type: Input
|
|
729
|
+
}], config: [{
|
|
730
|
+
type: Input
|
|
731
|
+
}], labels: [{
|
|
732
|
+
type: Input
|
|
733
|
+
}], viewAll: [{
|
|
734
|
+
type: Output
|
|
735
|
+
}], itemSelect: [{
|
|
736
|
+
type: Output
|
|
737
|
+
}], retry: [{
|
|
738
|
+
type: Output
|
|
739
|
+
}], borderRadiusInput: [{
|
|
740
|
+
type: Input,
|
|
741
|
+
args: ['borderRadius']
|
|
742
|
+
}] } });
|
|
743
|
+
|
|
744
|
+
class WHomeK1Component {
|
|
745
|
+
constructor() {
|
|
746
|
+
this.state = 'loading';
|
|
747
|
+
this.model = null;
|
|
748
|
+
this.widgetStyle = null;
|
|
749
|
+
this.config = null;
|
|
750
|
+
this.labels = null;
|
|
751
|
+
this.borderRadiusInput = null;
|
|
752
|
+
this.retry = new EventEmitter();
|
|
753
|
+
this.skeletonLines = [0, 1];
|
|
754
|
+
}
|
|
755
|
+
get texts() {
|
|
756
|
+
return { ...W_HOME_K1_DEFAULT_LABELS, ...(this.labels ?? {}) };
|
|
757
|
+
}
|
|
758
|
+
get title() {
|
|
759
|
+
return this.model?.title?.trim() || this.texts.title;
|
|
760
|
+
}
|
|
761
|
+
get backgroundColor() {
|
|
762
|
+
return wHomeHexColor(this.widgetStyle?.backgroundColor);
|
|
763
|
+
}
|
|
764
|
+
get foregroundColor() {
|
|
765
|
+
return wHomeHexColor(this.widgetStyle?.foregroundColor);
|
|
766
|
+
}
|
|
767
|
+
get borderRadius() {
|
|
768
|
+
return wHomeIntegerInRange(this.borderRadiusInput, W_HOME_WIDGET_BORDER_RADIUS.min, W_HOME_WIDGET_BORDER_RADIUS.max);
|
|
769
|
+
}
|
|
770
|
+
get hasUsableValue() {
|
|
771
|
+
return this.model !== null && this.isUsableValue(this.model.value, this.model.unit, this.model.currency);
|
|
772
|
+
}
|
|
773
|
+
get showAuxiliary() {
|
|
774
|
+
const auxiliary = this.model?.auxiliary;
|
|
775
|
+
return this.config?.showAuxiliary === true &&
|
|
776
|
+
auxiliary != null &&
|
|
777
|
+
this.isUsableValue(auxiliary.value, auxiliary.unit, auxiliary.currency);
|
|
778
|
+
}
|
|
779
|
+
get formattedValue() {
|
|
780
|
+
return this.model && typeof this.model.value === 'number'
|
|
781
|
+
? this.formatValue(this.model.value, this.model.unit, this.model.currency, this.model.symbolPosition)
|
|
782
|
+
: '';
|
|
783
|
+
}
|
|
784
|
+
get formattedAuxiliary() {
|
|
785
|
+
const auxiliary = this.model?.auxiliary;
|
|
786
|
+
return auxiliary && typeof auxiliary.value === 'number'
|
|
787
|
+
? this.formatValue(auxiliary.value, auxiliary.unit, auxiliary.currency, auxiliary.symbolPosition)
|
|
788
|
+
: '';
|
|
789
|
+
}
|
|
790
|
+
formatValue(value, unit, currency, symbolPosition) {
|
|
791
|
+
if (unit === 'points') {
|
|
792
|
+
return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 2 }).format(value)} ${this.texts.points}`;
|
|
793
|
+
}
|
|
794
|
+
const code = currency?.trim();
|
|
795
|
+
if (!code || !/^[A-Za-z]{3}$/.test(code)) {
|
|
796
|
+
return new Intl.NumberFormat(undefined, { maximumFractionDigits: 2 }).format(value);
|
|
797
|
+
}
|
|
798
|
+
const parts = new Intl.NumberFormat(undefined, { style: 'currency', currency: code }).formatToParts(value);
|
|
799
|
+
const symbol = parts.find(part => part.type === 'currency')?.value ?? code.toUpperCase();
|
|
800
|
+
const amount = parts
|
|
801
|
+
.filter(part => ['integer', 'group', 'decimal', 'fraction', 'minusSign', 'plusSign'].includes(part.type))
|
|
802
|
+
.map(part => part.value)
|
|
803
|
+
.join('');
|
|
804
|
+
return symbolPosition === 'before' ? `${symbol} ${amount}` : `${amount} ${symbol}`;
|
|
805
|
+
}
|
|
806
|
+
isUsableValue(value, unit, currency) {
|
|
807
|
+
return typeof value === 'number' &&
|
|
808
|
+
Number.isFinite(value) &&
|
|
809
|
+
(unit === 'points' || /^[A-Za-z]{3}$/.test(currency?.trim() ?? ''));
|
|
810
|
+
}
|
|
811
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeK1Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
812
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: WHomeK1Component, isStandalone: true, selector: "w-home-k1", inputs: { state: "state", model: "model", widgetStyle: "widgetStyle", config: "config", labels: "labels", borderRadiusInput: ["borderRadius", "borderRadiusInput"] }, outputs: { retry: "retry" }, host: { attributes: { "data-composition": "K1" }, classAttribute: "span-kpi" }, ngImport: i0, template: "<article class=\"widget\"\r\n [style.background-color]=\"backgroundColor\"\r\n [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\"\r\n data-testid=\"kpi-widget\">\r\n <header class=\"card-header\">\r\n <h2 class=\"card-header__title\">{{ title }}</h2>\r\n </header>\r\n\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"widget-state widget-state--loading\" role=\"status\" [attr.aria-label]=\"texts.loading\"\r\n data-testid=\"kpi-loading\">\r\n @for (line of skeletonLines; track line) {\r\n <span class=\"skeleton-line\" [class.skeleton-line--value]=\"line === 1\"></span>\r\n }\r\n </div>\r\n }\r\n @case ('error') {\r\n <div class=\"widget-state widget-state--error\" role=\"alert\" data-testid=\"kpi-error\">\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"kpi-retry\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"widget-state widget-state--unavailable\" role=\"note\" data-testid=\"kpi-unavailable\">\r\n {{ texts.unavailable }}\r\n </div>\r\n }\r\n @case ('empty') {\r\n <div class=\"widget-state\" data-testid=\"kpi-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n @if (model && hasUsableValue) {\r\n <div class=\"kpi-content\" data-testid=\"kpi-content\">\r\n <p class=\"kpi-value\" data-testid=\"kpi-value\">{{ formattedValue }}</p>\r\n @if (showAuxiliary) {\r\n <p class=\"kpi-auxiliary\" data-testid=\"kpi-auxiliary\">\r\n <span>{{ texts.auxiliary }}</span>\r\n <strong>{{ formattedAuxiliary }}</strong>\r\n </p>\r\n }\r\n </div>\r\n } @else {\r\n <div class=\"widget-state widget-state--unavailable\" role=\"note\" data-testid=\"kpi-unavailable\">\r\n {{ texts.unavailable }}\r\n </div>\r\n }\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0;container-type:inline-size;--home-ink: #1f2522;--home-muted: #68716c;--home-line: #dfe3dd;--home-accent: #1f5d45}.widget{box-sizing:border-box;width:100%;min-height:132px;padding:16px;overflow:hidden;border:1px solid #e3e7e1;border-radius:16px;color:var(--home-ink);background:#fff;box-shadow:0 4px 14px #1d2b230a}.card-header{min-width:0;min-height:20px}.card-header__title{margin:0;overflow-wrap:anywhere;color:inherit;font-size:12px;font-weight:800;line-height:1.35}.kpi-content{min-width:0;margin-top:16px}.kpi-value{margin:0;overflow-wrap:anywhere;font-size:clamp(20px,13cqi,32px);font-variant-numeric:tabular-nums;font-weight:800;line-height:1.15}.kpi-auxiliary{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 8px;margin:10px 0 0;color:var(--home-muted);font-size:11px;line-height:1.35}.kpi-auxiliary strong{color:inherit;font-variant-numeric:tabular-nums}.widget-state{box-sizing:border-box;min-height:76px;margin-top:8px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;color:var(--home-muted);font-size:12px;line-height:1.4}.widget-state--unavailable{color:var(--home-muted)}.widget-state--error{color:#8c302d}.widget-state--error button{min-height:36px;border:0;padding:4px 0;color:#a63834;background:none;font:inherit;font-weight:800;text-decoration:underline;cursor:pointer}.skeleton-line{width:42%;height:10px;border-radius:8px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}.skeleton-line--value{width:74%;height:30px}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.skeleton-line{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
813
|
+
}
|
|
814
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeK1Component, decorators: [{
|
|
815
|
+
type: Component,
|
|
816
|
+
args: [{ selector: 'w-home-k1', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'span-kpi', 'data-composition': 'K1' }, template: "<article class=\"widget\"\r\n [style.background-color]=\"backgroundColor\"\r\n [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\"\r\n data-testid=\"kpi-widget\">\r\n <header class=\"card-header\">\r\n <h2 class=\"card-header__title\">{{ title }}</h2>\r\n </header>\r\n\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"widget-state widget-state--loading\" role=\"status\" [attr.aria-label]=\"texts.loading\"\r\n data-testid=\"kpi-loading\">\r\n @for (line of skeletonLines; track line) {\r\n <span class=\"skeleton-line\" [class.skeleton-line--value]=\"line === 1\"></span>\r\n }\r\n </div>\r\n }\r\n @case ('error') {\r\n <div class=\"widget-state widget-state--error\" role=\"alert\" data-testid=\"kpi-error\">\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"kpi-retry\">{{ texts.retry }}</button>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"widget-state widget-state--unavailable\" role=\"note\" data-testid=\"kpi-unavailable\">\r\n {{ texts.unavailable }}\r\n </div>\r\n }\r\n @case ('empty') {\r\n <div class=\"widget-state\" data-testid=\"kpi-empty\">{{ texts.empty }}</div>\r\n }\r\n @case ('loaded') {\r\n @if (model && hasUsableValue) {\r\n <div class=\"kpi-content\" data-testid=\"kpi-content\">\r\n <p class=\"kpi-value\" data-testid=\"kpi-value\">{{ formattedValue }}</p>\r\n @if (showAuxiliary) {\r\n <p class=\"kpi-auxiliary\" data-testid=\"kpi-auxiliary\">\r\n <span>{{ texts.auxiliary }}</span>\r\n <strong>{{ formattedAuxiliary }}</strong>\r\n </p>\r\n }\r\n </div>\r\n } @else {\r\n <div class=\"widget-state widget-state--unavailable\" role=\"note\" data-testid=\"kpi-unavailable\">\r\n {{ texts.unavailable }}\r\n </div>\r\n }\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;min-width:0;container-type:inline-size;--home-ink: #1f2522;--home-muted: #68716c;--home-line: #dfe3dd;--home-accent: #1f5d45}.widget{box-sizing:border-box;width:100%;min-height:132px;padding:16px;overflow:hidden;border:1px solid #e3e7e1;border-radius:16px;color:var(--home-ink);background:#fff;box-shadow:0 4px 14px #1d2b230a}.card-header{min-width:0;min-height:20px}.card-header__title{margin:0;overflow-wrap:anywhere;color:inherit;font-size:12px;font-weight:800;line-height:1.35}.kpi-content{min-width:0;margin-top:16px}.kpi-value{margin:0;overflow-wrap:anywhere;font-size:clamp(20px,13cqi,32px);font-variant-numeric:tabular-nums;font-weight:800;line-height:1.15}.kpi-auxiliary{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 8px;margin:10px 0 0;color:var(--home-muted);font-size:11px;line-height:1.35}.kpi-auxiliary strong{color:inherit;font-variant-numeric:tabular-nums}.widget-state{box-sizing:border-box;min-height:76px;margin-top:8px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;color:var(--home-muted);font-size:12px;line-height:1.4}.widget-state--unavailable{color:var(--home-muted)}.widget-state--error{color:#8c302d}.widget-state--error button{min-height:36px;border:0;padding:4px 0;color:#a63834;background:none;font:inherit;font-weight:800;text-decoration:underline;cursor:pointer}.skeleton-line{width:42%;height:10px;border-radius:8px;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}.skeleton-line--value{width:74%;height:30px}button:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.skeleton-line{animation:none}}\n"] }]
|
|
817
|
+
}], propDecorators: { state: [{
|
|
818
|
+
type: Input
|
|
819
|
+
}], model: [{
|
|
820
|
+
type: Input
|
|
821
|
+
}], widgetStyle: [{
|
|
822
|
+
type: Input
|
|
823
|
+
}], config: [{
|
|
824
|
+
type: Input
|
|
825
|
+
}], labels: [{
|
|
826
|
+
type: Input
|
|
827
|
+
}], borderRadiusInput: [{
|
|
828
|
+
type: Input,
|
|
829
|
+
args: ['borderRadius']
|
|
830
|
+
}], retry: [{
|
|
831
|
+
type: Output
|
|
832
|
+
}] } });
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Promotions widget (HP-003): composition D1 with the promotions labels.
|
|
836
|
+
* Kept as an alias of `w-home-d1` until the library version with the registry is released (WIDGETS-002).
|
|
837
|
+
*/
|
|
838
|
+
class WHomePromotionsWidgetComponent extends WHomeD1Component {
|
|
839
|
+
get defaultLabels() {
|
|
840
|
+
return W_HOME_PROMOTIONS_DEFAULT_LABELS;
|
|
841
|
+
}
|
|
842
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomePromotionsWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
843
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: WHomePromotionsWidgetComponent, isStandalone: true, selector: "w-home-promotions-widget", host: { attributes: { "data-composition": "D1" }, classAttribute: "span-full" }, usesInheritance: true, ngImport: i0, template: "<article class=\"widget widget--featured\"\r\n [style.background-color]=\"backgroundColor\"\r\n [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\"\r\n data-testid=\"promotions-widget\">\r\n <header class=\"card-header\">\r\n <h2 class=\"card-header__title\">\r\n {{ title }}\r\n @if (showCount && state === 'loaded') {\r\n <span class=\"card-header__count\" data-testid=\"promotions-count\">({{ count }})</span>\r\n }\r\n </h2>\r\n @if (state === 'loaded') {\r\n <button type=\"button\" class=\"text-action\" (click)=\"viewAll.emit()\" data-testid=\"promotions-see-all\">\r\n {{ texts.viewAll }}\r\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\"\r\n stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <path d=\"M5 12h14\" /><path d=\"m13 6 6 6-6 6\" />\r\n </svg>\r\n </button>\r\n }\r\n </header>\r\n\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"collection collection--static\" role=\"status\" [attr.aria-label]=\"texts.loading\"\r\n data-testid=\"promotions-loading\">\r\n @for (item of skeletonCards; track item) {\r\n <span class=\"domain-card domain-card--skeleton\"></span>\r\n }\r\n </div>\r\n }\r\n @case ('error') {\r\n <div class=\"widget-state widget-state--error\" role=\"alert\" data-testid=\"promotions-error\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">!</span>\r\n <div>\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"promotions-retry\">{{ texts.retry }}</button>\r\n </div>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"widget-state widget-state--unavailable\" role=\"note\" data-testid=\"promotions-unavailable\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">×</span>\r\n <strong>{{ texts.unavailable }}</strong>\r\n </div>\r\n }\r\n @case ('empty') {\r\n <div class=\"widget-state\" data-testid=\"promotions-empty\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">—</span>\r\n <strong>{{ texts.empty }}</strong>\r\n </div>\r\n }\r\n @case ('loaded') {\r\n <div class=\"carousel-shell\">\r\n <div #collection class=\"collection\" tabindex=\"0\" [attr.aria-label]=\"title\"\r\n data-testid=\"promotions-collection\">\r\n @for (card of visibleItems; track card.id) {\r\n <button type=\"button\" class=\"domain-card\" (click)=\"itemSelect.emit(card)\" data-testid=\"promotion-card\">\r\n @if (hasImage(card)) {\r\n <img [src]=\"card.imageUrl\" alt=\"\" loading=\"lazy\" (error)=\"onImageError(card)\" />\r\n } @else {\r\n <span class=\"domain-card__placeholder\" data-testid=\"promotion-image-placeholder\">\r\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\" stroke=\"currentColor\"\r\n stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"2\" /><rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" rx=\"2\" />\r\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"2\" /><rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"2\" />\r\n </svg>\r\n <span>{{ texts.imageUnavailable }}</span>\r\n </span>\r\n }\r\n <span class=\"domain-card__shade\"></span>\r\n @if (card.badge) {\r\n <span class=\"domain-card__badge\" data-testid=\"promotion-badge\">{{ card.badge }}</span>\r\n }\r\n <span class=\"domain-card__copy\">\r\n <strong>{{ card.name }}</strong>\r\n @if (card.description) {\r\n <span>{{ card.description }}</span>\r\n }\r\n @if (showPrice && formatPrice(card); as price) {\r\n <span class=\"domain-card__price\">{{ price }}</span>\r\n }\r\n </span>\r\n </button>\r\n }\r\n </div>\r\n @if (visibleItems.length > 1) {\r\n <div class=\"carousel-controls\" role=\"group\">\r\n <button type=\"button\" class=\"button--icon\" [attr.aria-label]=\"texts.previous\" (click)=\"scroll(-1)\">\r\n <span aria-hidden=\"true\">←</span>\r\n </button>\r\n <button type=\"button\" class=\"button--icon\" [attr.aria-label]=\"texts.next\" (click)=\"scroll(1)\">\r\n <span aria-hidden=\"true\">→</span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;grid-column:1 / -1;min-width:0;--home-ink: #1f2522;--home-muted: #68716c;--home-line: #dfe3dd;--home-accent: #1f5d45;--home-accent-dark: #123d2d}.widget{box-sizing:border-box;color:var(--home-ink);background:#fff;border:1px solid #e3e7e1;border-radius:16px;box-shadow:0 4px 14px #1d2b230a}.widget--featured{min-height:235px;padding:15px 0 15px 15px;overflow:hidden}.card-header{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:36px;padding-right:15px}.card-header__title{display:flex;align-items:center;gap:5px;min-width:0;margin:0;font-size:12px;font-weight:800;line-height:1.3;color:inherit}.card-header__count{font-weight:700;opacity:.7}.text-action{min-height:36px;display:flex;align-items:center;gap:5px;border:0;padding:0 2px;color:var(--home-accent);background:none;font:inherit;font-size:11px;font-weight:800;cursor:pointer;white-space:nowrap}.carousel-shell{position:relative}.collection{display:flex;gap:10px;margin-top:12px;padding-right:15px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none}.collection::-webkit-scrollbar{display:none}.collection--static{overflow:hidden}.domain-card{position:relative;flex:0 0 74%;height:160px;overflow:hidden;padding:0;border:0;border-radius:13px;color:#fff;background:var(--home-accent-dark);text-align:left;font:inherit;cursor:pointer;scroll-snap-align:start}.domain-card img{width:100%;height:100%;display:block;object-fit:cover}.domain-card__placeholder{position:absolute;inset:8px 8px auto;height:84px;display:grid;place-items:center;align-content:center;gap:6px;border:1px dashed #abb6ae;border-radius:10px;color:#6c7770;background:#f3f5f2;font-size:11px}.domain-card__shade{position:absolute;inset:0;background:linear-gradient(180deg,transparent 30%,rgba(10,20,14,.82));pointer-events:none}.domain-card__badge{position:absolute;top:10px;left:10px;max-width:calc(100% - 20px);padding:3px 8px;overflow:hidden;border-radius:999px;color:var(--home-ink);background:#ffffffeb;font-size:10px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}.domain-card__copy{position:absolute;left:14px;right:14px;bottom:12px}.domain-card__copy>*{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.domain-card__copy strong{font-size:15px;font-weight:800;line-height:1.3}.domain-card__copy span{margin-top:2px;font-size:10px;opacity:.85}.domain-card--skeleton{cursor:default;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{to{background-position:-200% 0}}.carousel-controls{position:absolute;right:26px;bottom:11px;display:none;gap:5px}.button--icon{width:40px;height:40px;display:grid;place-items:center;padding:0;border:1px solid var(--home-line);border-radius:11px;color:var(--home-ink);background:#ffffffeb;font:inherit;cursor:pointer}.widget-state{min-height:160px;margin:12px 15px 0 0;padding:13px;display:flex;align-items:center;gap:8px;border-radius:13px;background:#f4f5f3;color:var(--home-muted);font-size:12px}.widget-state strong{display:block;line-height:1.3}.widget-state--unavailable{border:1px dashed #abb6ae}.widget-state--error{color:#8c302d;background:#fff8f7}.widget-state--error button{margin-top:4px;border:0;padding:0;color:#a63834;background:none;font:inherit;font-size:11px;font-weight:800;text-decoration:underline;cursor:pointer}.widget-state__icon{width:24px;height:24px;flex:0 0 auto;display:grid;place-items:center;border-radius:50%;background:#eef0ed;font-weight:800}button:focus-visible,.collection:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@container w-home (min-width: 768px){.domain-card{flex-basis:44%}}@container w-home (min-width: 1024px){.domain-card{flex-basis:32%}.carousel-controls{display:flex}}@media(prefers-reduced-motion:reduce){.collection{scroll-behavior:auto}.domain-card--skeleton{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
844
|
+
}
|
|
845
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomePromotionsWidgetComponent, decorators: [{
|
|
846
|
+
type: Component,
|
|
847
|
+
args: [{ selector: 'w-home-promotions-widget', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'span-full', 'data-composition': 'D1' }, template: "<article class=\"widget widget--featured\"\r\n [style.background-color]=\"backgroundColor\"\r\n [style.color]=\"foregroundColor\"\r\n [style.border-radius.px]=\"borderRadius\"\r\n data-testid=\"promotions-widget\">\r\n <header class=\"card-header\">\r\n <h2 class=\"card-header__title\">\r\n {{ title }}\r\n @if (showCount && state === 'loaded') {\r\n <span class=\"card-header__count\" data-testid=\"promotions-count\">({{ count }})</span>\r\n }\r\n </h2>\r\n @if (state === 'loaded') {\r\n <button type=\"button\" class=\"text-action\" (click)=\"viewAll.emit()\" data-testid=\"promotions-see-all\">\r\n {{ texts.viewAll }}\r\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\"\r\n stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <path d=\"M5 12h14\" /><path d=\"m13 6 6 6-6 6\" />\r\n </svg>\r\n </button>\r\n }\r\n </header>\r\n\r\n @switch (state) {\r\n @case ('loading') {\r\n <div class=\"collection collection--static\" role=\"status\" [attr.aria-label]=\"texts.loading\"\r\n data-testid=\"promotions-loading\">\r\n @for (item of skeletonCards; track item) {\r\n <span class=\"domain-card domain-card--skeleton\"></span>\r\n }\r\n </div>\r\n }\r\n @case ('error') {\r\n <div class=\"widget-state widget-state--error\" role=\"alert\" data-testid=\"promotions-error\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">!</span>\r\n <div>\r\n <strong>{{ texts.error }}</strong>\r\n <button type=\"button\" (click)=\"retry.emit()\" data-testid=\"promotions-retry\">{{ texts.retry }}</button>\r\n </div>\r\n </div>\r\n }\r\n @case ('unavailable') {\r\n <div class=\"widget-state widget-state--unavailable\" role=\"note\" data-testid=\"promotions-unavailable\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">×</span>\r\n <strong>{{ texts.unavailable }}</strong>\r\n </div>\r\n }\r\n @case ('empty') {\r\n <div class=\"widget-state\" data-testid=\"promotions-empty\">\r\n <span class=\"widget-state__icon\" aria-hidden=\"true\">—</span>\r\n <strong>{{ texts.empty }}</strong>\r\n </div>\r\n }\r\n @case ('loaded') {\r\n <div class=\"carousel-shell\">\r\n <div #collection class=\"collection\" tabindex=\"0\" [attr.aria-label]=\"title\"\r\n data-testid=\"promotions-collection\">\r\n @for (card of visibleItems; track card.id) {\r\n <button type=\"button\" class=\"domain-card\" (click)=\"itemSelect.emit(card)\" data-testid=\"promotion-card\">\r\n @if (hasImage(card)) {\r\n <img [src]=\"card.imageUrl\" alt=\"\" loading=\"lazy\" (error)=\"onImageError(card)\" />\r\n } @else {\r\n <span class=\"domain-card__placeholder\" data-testid=\"promotion-image-placeholder\">\r\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\" stroke=\"currentColor\"\r\n stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"2\" /><rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" rx=\"2\" />\r\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"2\" /><rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"2\" />\r\n </svg>\r\n <span>{{ texts.imageUnavailable }}</span>\r\n </span>\r\n }\r\n <span class=\"domain-card__shade\"></span>\r\n @if (card.badge) {\r\n <span class=\"domain-card__badge\" data-testid=\"promotion-badge\">{{ card.badge }}</span>\r\n }\r\n <span class=\"domain-card__copy\">\r\n <strong>{{ card.name }}</strong>\r\n @if (card.description) {\r\n <span>{{ card.description }}</span>\r\n }\r\n @if (showPrice && formatPrice(card); as price) {\r\n <span class=\"domain-card__price\">{{ price }}</span>\r\n }\r\n </span>\r\n </button>\r\n }\r\n </div>\r\n @if (visibleItems.length > 1) {\r\n <div class=\"carousel-controls\" role=\"group\">\r\n <button type=\"button\" class=\"button--icon\" [attr.aria-label]=\"texts.previous\" (click)=\"scroll(-1)\">\r\n <span aria-hidden=\"true\">←</span>\r\n </button>\r\n <button type=\"button\" class=\"button--icon\" [attr.aria-label]=\"texts.next\" (click)=\"scroll(1)\">\r\n <span aria-hidden=\"true\">→</span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n }\r\n</article>\r\n", styles: [":host{display:block;grid-column:1 / -1;min-width:0;--home-ink: #1f2522;--home-muted: #68716c;--home-line: #dfe3dd;--home-accent: #1f5d45;--home-accent-dark: #123d2d}.widget{box-sizing:border-box;color:var(--home-ink);background:#fff;border:1px solid #e3e7e1;border-radius:16px;box-shadow:0 4px 14px #1d2b230a}.widget--featured{min-height:235px;padding:15px 0 15px 15px;overflow:hidden}.card-header{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:36px;padding-right:15px}.card-header__title{display:flex;align-items:center;gap:5px;min-width:0;margin:0;font-size:12px;font-weight:800;line-height:1.3;color:inherit}.card-header__count{font-weight:700;opacity:.7}.text-action{min-height:36px;display:flex;align-items:center;gap:5px;border:0;padding:0 2px;color:var(--home-accent);background:none;font:inherit;font-size:11px;font-weight:800;cursor:pointer;white-space:nowrap}.carousel-shell{position:relative}.collection{display:flex;gap:10px;margin-top:12px;padding-right:15px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none}.collection::-webkit-scrollbar{display:none}.collection--static{overflow:hidden}.domain-card{position:relative;flex:0 0 74%;height:160px;overflow:hidden;padding:0;border:0;border-radius:13px;color:#fff;background:var(--home-accent-dark);text-align:left;font:inherit;cursor:pointer;scroll-snap-align:start}.domain-card img{width:100%;height:100%;display:block;object-fit:cover}.domain-card__placeholder{position:absolute;inset:8px 8px auto;height:84px;display:grid;place-items:center;align-content:center;gap:6px;border:1px dashed #abb6ae;border-radius:10px;color:#6c7770;background:#f3f5f2;font-size:11px}.domain-card__shade{position:absolute;inset:0;background:linear-gradient(180deg,transparent 30%,rgba(10,20,14,.82));pointer-events:none}.domain-card__badge{position:absolute;top:10px;left:10px;max-width:calc(100% - 20px);padding:3px 8px;overflow:hidden;border-radius:999px;color:var(--home-ink);background:#ffffffeb;font-size:10px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}.domain-card__copy{position:absolute;left:14px;right:14px;bottom:12px}.domain-card__copy>*{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.domain-card__copy strong{font-size:15px;font-weight:800;line-height:1.3}.domain-card__copy span{margin-top:2px;font-size:10px;opacity:.85}.domain-card--skeleton{cursor:default;background:linear-gradient(90deg,#eef0ed 20%,#dfe4df,#eef0ed 80%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{to{background-position:-200% 0}}.carousel-controls{position:absolute;right:26px;bottom:11px;display:none;gap:5px}.button--icon{width:40px;height:40px;display:grid;place-items:center;padding:0;border:1px solid var(--home-line);border-radius:11px;color:var(--home-ink);background:#ffffffeb;font:inherit;cursor:pointer}.widget-state{min-height:160px;margin:12px 15px 0 0;padding:13px;display:flex;align-items:center;gap:8px;border-radius:13px;background:#f4f5f3;color:var(--home-muted);font-size:12px}.widget-state strong{display:block;line-height:1.3}.widget-state--unavailable{border:1px dashed #abb6ae}.widget-state--error{color:#8c302d;background:#fff8f7}.widget-state--error button{margin-top:4px;border:0;padding:0;color:#a63834;background:none;font:inherit;font-size:11px;font-weight:800;text-decoration:underline;cursor:pointer}.widget-state__icon{width:24px;height:24px;flex:0 0 auto;display:grid;place-items:center;border-radius:50%;background:#eef0ed;font-weight:800}button:focus-visible,.collection:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}@container w-home (min-width: 768px){.domain-card{flex-basis:44%}}@container w-home (min-width: 1024px){.domain-card{flex-basis:32%}.carousel-controls{display:flex}}@media(prefers-reduced-motion:reduce){.collection{scroll-behavior:auto}.domain-card--skeleton{animation:none}}\n"] }]
|
|
848
|
+
}] });
|
|
849
|
+
|
|
850
|
+
/** Marks the projected icon of `w-home-action-widget`. */
|
|
851
|
+
class WHomeActionIconDirective {
|
|
852
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeActionIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
853
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.27", type: WHomeActionIconDirective, isStandalone: true, selector: "[wHomeActionIcon]", ngImport: i0 }); }
|
|
854
|
+
}
|
|
855
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeActionIconDirective, decorators: [{
|
|
856
|
+
type: Directive,
|
|
857
|
+
args: [{ selector: '[wHomeActionIcon]', standalone: true }]
|
|
858
|
+
}] });
|
|
859
|
+
/** Action widget A1 (HP-004): projected icon, label, optional description and forward arrow. */
|
|
860
|
+
class WHomeActionWidgetComponent {
|
|
861
|
+
constructor() {
|
|
862
|
+
this.label = '';
|
|
863
|
+
this.description = null;
|
|
864
|
+
this.widgetStyle = null;
|
|
865
|
+
this.config = null;
|
|
866
|
+
this.borderRadiusInput = null;
|
|
867
|
+
/** Only `unavailable` changes the rendering: A1 has no data to load (WIDGETS-003). */
|
|
868
|
+
this.state = 'loaded';
|
|
869
|
+
this.unavailableLabel = W_HOME_D1_DEFAULT_LABELS.unavailable;
|
|
870
|
+
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
871
|
+
this.select = new EventEmitter();
|
|
872
|
+
}
|
|
873
|
+
/** Null keeps the Wallet default radius (16px). */
|
|
874
|
+
get borderRadius() {
|
|
875
|
+
return wHomeIntegerInRange(this.borderRadiusInput, W_HOME_WIDGET_BORDER_RADIUS.min, W_HOME_WIDGET_BORDER_RADIUS.max);
|
|
876
|
+
}
|
|
877
|
+
get backgroundColor() {
|
|
878
|
+
return wHomeHexColor(this.widgetStyle?.backgroundColor) ?? W_HOME_ACTION_DEFAULT_BACKGROUND;
|
|
879
|
+
}
|
|
880
|
+
get foregroundColor() {
|
|
881
|
+
return wHomeHexColor(this.widgetStyle?.foregroundColor);
|
|
882
|
+
}
|
|
883
|
+
get unavailable() {
|
|
884
|
+
return this.state === 'unavailable';
|
|
885
|
+
}
|
|
886
|
+
get showDescription() {
|
|
887
|
+
return !!this.description && this.config?.showDescription !== false;
|
|
888
|
+
}
|
|
889
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeActionWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
890
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: WHomeActionWidgetComponent, isStandalone: true, selector: "w-home-action-widget", inputs: { label: "label", description: "description", widgetStyle: "widgetStyle", config: "config", borderRadiusInput: ["borderRadius", "borderRadiusInput"], state: "state", unavailableLabel: "unavailableLabel" }, outputs: { select: "select" }, ngImport: i0, template: `
|
|
891
|
+
<button type="button" class="action" [class.action--unavailable]="unavailable" [disabled]="unavailable"
|
|
892
|
+
[style.background-color]="backgroundColor" [style.color]="foregroundColor"
|
|
893
|
+
[style.border-radius.px]="borderRadius" (click)="select.emit()" data-testid="home-action">
|
|
894
|
+
<span class="action__icon" aria-hidden="true"><ng-content select="[wHomeActionIcon]"></ng-content></span>
|
|
895
|
+
<span class="action__copy">
|
|
896
|
+
<span class="action__label" data-testid="home-action-label">{{ label }}</span>
|
|
897
|
+
@if (unavailable) {
|
|
898
|
+
<span class="action__description" data-testid="home-action-unavailable">{{ unavailableLabel }}</span>
|
|
899
|
+
} @else if (showDescription) {
|
|
900
|
+
<span class="action__description" data-testid="home-action-description">{{ description }}</span>
|
|
901
|
+
}
|
|
902
|
+
</span>
|
|
903
|
+
<svg class="action__arrow" aria-hidden="true" viewBox="0 0 24 24" width="20" height="20" fill="none"
|
|
904
|
+
stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
905
|
+
<path d="M5 12h14" /><path d="m13 6 6 6-6 6" />
|
|
906
|
+
</svg>
|
|
907
|
+
</button>
|
|
908
|
+
`, isInline: true, styles: [":host{display:block;min-width:0}.action{width:100%;height:100%;display:flex;align-items:center;gap:12px;padding:16px;border:0;border-radius:16px;box-shadow:0 4px 14px #1d2b2314;color:#1f2522;font:inherit;text-align:left;cursor:pointer}.action__icon{width:24px;height:24px;flex:0 0 auto;display:grid;place-items:center;font-size:24px}.action__copy{flex:1;min-width:0;display:flex;flex-direction:column}.action__label{font-weight:600}.action__description{font-size:.875rem;opacity:.8}.action__arrow{flex:0 0 auto}.action:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}.action--unavailable{cursor:default;opacity:.6;box-shadow:none;outline:1px dashed #abb6ae}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
909
|
+
}
|
|
910
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeActionWidgetComponent, decorators: [{
|
|
911
|
+
type: Component,
|
|
912
|
+
args: [{ selector: 'w-home-action-widget', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
913
|
+
<button type="button" class="action" [class.action--unavailable]="unavailable" [disabled]="unavailable"
|
|
914
|
+
[style.background-color]="backgroundColor" [style.color]="foregroundColor"
|
|
915
|
+
[style.border-radius.px]="borderRadius" (click)="select.emit()" data-testid="home-action">
|
|
916
|
+
<span class="action__icon" aria-hidden="true"><ng-content select="[wHomeActionIcon]"></ng-content></span>
|
|
917
|
+
<span class="action__copy">
|
|
918
|
+
<span class="action__label" data-testid="home-action-label">{{ label }}</span>
|
|
919
|
+
@if (unavailable) {
|
|
920
|
+
<span class="action__description" data-testid="home-action-unavailable">{{ unavailableLabel }}</span>
|
|
921
|
+
} @else if (showDescription) {
|
|
922
|
+
<span class="action__description" data-testid="home-action-description">{{ description }}</span>
|
|
923
|
+
}
|
|
924
|
+
</span>
|
|
925
|
+
<svg class="action__arrow" aria-hidden="true" viewBox="0 0 24 24" width="20" height="20" fill="none"
|
|
926
|
+
stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
927
|
+
<path d="M5 12h14" /><path d="m13 6 6 6-6 6" />
|
|
928
|
+
</svg>
|
|
929
|
+
</button>
|
|
930
|
+
`, styles: [":host{display:block;min-width:0}.action{width:100%;height:100%;display:flex;align-items:center;gap:12px;padding:16px;border:0;border-radius:16px;box-shadow:0 4px 14px #1d2b2314;color:#1f2522;font:inherit;text-align:left;cursor:pointer}.action__icon{width:24px;height:24px;flex:0 0 auto;display:grid;place-items:center;font-size:24px}.action__copy{flex:1;min-width:0;display:flex;flex-direction:column}.action__label{font-weight:600}.action__description{font-size:.875rem;opacity:.8}.action__arrow{flex:0 0 auto}.action:focus-visible{outline:3px solid #77b5ff;outline-offset:3px}.action--unavailable{cursor:default;opacity:.6;box-shadow:none;outline:1px dashed #abb6ae}\n"] }]
|
|
931
|
+
}], propDecorators: { label: [{
|
|
932
|
+
type: Input
|
|
933
|
+
}], description: [{
|
|
934
|
+
type: Input
|
|
935
|
+
}], widgetStyle: [{
|
|
936
|
+
type: Input
|
|
937
|
+
}], config: [{
|
|
938
|
+
type: Input
|
|
939
|
+
}], borderRadiusInput: [{
|
|
940
|
+
type: Input,
|
|
941
|
+
args: ['borderRadius']
|
|
942
|
+
}], state: [{
|
|
943
|
+
type: Input
|
|
944
|
+
}], unavailableLabel: [{
|
|
945
|
+
type: Input
|
|
946
|
+
}], select: [{
|
|
947
|
+
type: Output
|
|
948
|
+
}] } });
|
|
949
|
+
|
|
950
|
+
/** Approved A1 action composition, kept as a semantic wrapper over the original action widget. */
|
|
951
|
+
class WHomeA1Component {
|
|
952
|
+
constructor() {
|
|
953
|
+
this.label = '';
|
|
954
|
+
this.description = null;
|
|
955
|
+
this.widgetStyle = null;
|
|
956
|
+
this.config = null;
|
|
957
|
+
this.borderRadius = null;
|
|
958
|
+
this.state = 'loaded';
|
|
959
|
+
this.unavailableLabel = W_HOME_D1_DEFAULT_LABELS.unavailable;
|
|
960
|
+
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
961
|
+
this.select = new EventEmitter();
|
|
962
|
+
}
|
|
963
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeA1Component, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
964
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.27", type: WHomeA1Component, isStandalone: true, selector: "w-home-a1", inputs: { label: "label", description: "description", widgetStyle: "widgetStyle", config: "config", borderRadius: "borderRadius", state: "state", unavailableLabel: "unavailableLabel" }, outputs: { select: "select" }, ngImport: i0, template: `
|
|
965
|
+
<w-home-action-widget
|
|
966
|
+
[label]="label"
|
|
967
|
+
[description]="description"
|
|
968
|
+
[widgetStyle]="widgetStyle"
|
|
969
|
+
[config]="config"
|
|
970
|
+
[borderRadius]="borderRadius"
|
|
971
|
+
[state]="state"
|
|
972
|
+
[unavailableLabel]="unavailableLabel"
|
|
973
|
+
(select)="select.emit()">
|
|
974
|
+
<ng-content select="[wHomeActionIcon]"></ng-content>
|
|
975
|
+
</w-home-action-widget>
|
|
976
|
+
`, isInline: true, dependencies: [{ kind: "component", type: WHomeActionWidgetComponent, selector: "w-home-action-widget", inputs: ["label", "description", "widgetStyle", "config", "borderRadius", "state", "unavailableLabel"], outputs: ["select"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
977
|
+
}
|
|
978
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeA1Component, decorators: [{
|
|
979
|
+
type: Component,
|
|
980
|
+
args: [{
|
|
981
|
+
selector: 'w-home-a1',
|
|
982
|
+
standalone: true,
|
|
983
|
+
imports: [WHomeActionWidgetComponent],
|
|
984
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
985
|
+
template: `
|
|
986
|
+
<w-home-action-widget
|
|
987
|
+
[label]="label"
|
|
988
|
+
[description]="description"
|
|
989
|
+
[widgetStyle]="widgetStyle"
|
|
990
|
+
[config]="config"
|
|
991
|
+
[borderRadius]="borderRadius"
|
|
992
|
+
[state]="state"
|
|
993
|
+
[unavailableLabel]="unavailableLabel"
|
|
994
|
+
(select)="select.emit()">
|
|
995
|
+
<ng-content select="[wHomeActionIcon]"></ng-content>
|
|
996
|
+
</w-home-action-widget>
|
|
997
|
+
`
|
|
998
|
+
}]
|
|
999
|
+
}], propDecorators: { label: [{
|
|
1000
|
+
type: Input
|
|
1001
|
+
}], description: [{
|
|
1002
|
+
type: Input
|
|
1003
|
+
}], widgetStyle: [{
|
|
1004
|
+
type: Input
|
|
1005
|
+
}], config: [{
|
|
1006
|
+
type: Input
|
|
1007
|
+
}], borderRadius: [{
|
|
1008
|
+
type: Input
|
|
1009
|
+
}], state: [{
|
|
1010
|
+
type: Input
|
|
1011
|
+
}], unavailableLabel: [{
|
|
1012
|
+
type: Input
|
|
1013
|
+
}], select: [{
|
|
1014
|
+
type: Output
|
|
1015
|
+
}] } });
|
|
1016
|
+
|
|
1017
|
+
/** Full-width notice for a widget the preview cannot represent (HP-005). */
|
|
1018
|
+
class WHomeUnsupportedWidgetComponent {
|
|
1019
|
+
constructor() {
|
|
1020
|
+
this.message = '';
|
|
1021
|
+
}
|
|
1022
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeUnsupportedWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1023
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.27", type: WHomeUnsupportedWidgetComponent, isStandalone: true, selector: "w-home-unsupported-widget", inputs: { message: "message" }, host: { classAttribute: "span-full" }, ngImport: i0, template: `<div class="home-state home-state--muted" role="note" data-testid="home-unsupported">{{ message }}</div>`, isInline: true, styles: [":host{display:block;grid-column:1 / -1;min-width:0}.home-state{padding:14px;border:1px dashed #abb6ae;border-radius:13px;background:#f4f5f3;color:#68716c;font-size:12px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1024
|
+
}
|
|
1025
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: WHomeUnsupportedWidgetComponent, decorators: [{
|
|
1026
|
+
type: Component,
|
|
1027
|
+
args: [{ selector: 'w-home-unsupported-widget', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'span-full' }, template: `<div class="home-state home-state--muted" role="note" data-testid="home-unsupported">{{ message }}</div>`, styles: [":host{display:block;grid-column:1 / -1;min-width:0}.home-state{padding:14px;border:1px dashed #abb6ae;border-radius:13px;background:#f4f5f3;color:#68716c;font-size:12px}\n"] }]
|
|
1028
|
+
}], propDecorators: { message: [{
|
|
1029
|
+
type: Input
|
|
1030
|
+
}] } });
|
|
1031
|
+
|
|
1032
|
+
/*
|
|
1033
|
+
* Public API Surface of ngx-wapp-components/home-preview (change home-preview, HP-002..HP-006).
|
|
1034
|
+
*/
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* Generated bundle index. Do not edit.
|
|
1038
|
+
*/
|
|
1039
|
+
|
|
1040
|
+
export { WHomeA1Component, WHomeActionIconDirective, WHomeActionWidgetComponent, WHomeC1Component, WHomeC2Component, WHomeD1Component, WHomeD2Component, WHomeE1Component, WHomeE2Component, WHomeE3Component, WHomeK1Component, WHomePageFrameComponent, WHomePromotionsWidgetComponent, WHomeUnsupportedWidgetComponent, W_HOME_ACTION_DEFAULT_BACKGROUND, W_HOME_C1_DEFAULT_LABELS, W_HOME_C2_DEFAULT_LABELS, W_HOME_CONTENT_MARGIN, W_HOME_D1_DEFAULT_LABELS, W_HOME_E1_DEFAULT_LABELS, W_HOME_E2_DEFAULT_LABELS, W_HOME_E3_DEFAULT_LABELS, W_HOME_K1_DEFAULT_LABELS, W_HOME_MAX_CONTENT_WIDTH, W_HOME_PAGE_FRAME_DEFAULT_LABELS, W_HOME_PREVIEW_LIMIT, W_HOME_PROMOTIONS_DEFAULT_LABELS, W_HOME_WIDGET_BORDER_RADIUS, W_HOME_WIDGET_GAP, W_HOME_WIDGET_REGISTRY, resolveHomeWidget, wHomeHexColor, wHomeIntegerInRange };
|
|
1041
|
+
//# sourceMappingURL=ngx-wapp-components-home-preview.mjs.map
|