oasys-lib 3.14.0 → 3.14.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/oasys-lib.mjs +2216 -64
- package/fesm2022/oasys-lib.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/bergamotte/variables.css +1 -1
- package/src/assets/bergamotte-loyalty-tier-1/variables.css +1 -1
- package/src/assets/bergamotte-loyalty-tier-2/variables.css +1 -1
- package/src/assets/bloomandwild/variables.css +1 -1
- package/src/assets/bloomandwild-loyalty-tier-1/variables.css +1 -1
- package/src/assets/bloomandwild-loyalty-tier-2/variables.css +1 -1
- package/src/assets/bloomon/variables.css +1 -1
- package/src/assets/bloomon-loyalty-tier-1/variables.css +1 -1
- package/src/assets/bloomon-loyalty-tier-2/variables.css +1 -1
- package/types/oasys-lib.d.ts +2209 -24
- package/types/oasys-lib.d.ts.map +1 -1
package/types/oasys-lib.d.ts
CHANGED
|
@@ -5,28 +5,61 @@ import { BehaviorSubject } from 'rxjs';
|
|
|
5
5
|
import { UrlTree } from '@angular/router';
|
|
6
6
|
import { ControlValueAccessor, ValidationErrors, AbstractControl, FormGroup } from '@angular/forms';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Dismissive action slot for `<ui-alert>`: its text becomes the label of a
|
|
10
|
+
* `tertiary` button that emits the alert's `cancel` output. Use for "Not now",
|
|
11
|
+
* "Keep my order" and similar. Adding it also turns off the live region and
|
|
12
|
+
* moves focus to the alert when it appears (see `<ui-alert>`).
|
|
13
|
+
*
|
|
14
|
+
* @import import { OasysAlertCancelDirective } from 'oasys-lib';
|
|
15
|
+
*/
|
|
8
16
|
declare class OasysAlertCancelDirective implements AfterContentChecked {
|
|
17
|
+
/** @ignore */
|
|
9
18
|
text: string;
|
|
10
19
|
private elem?;
|
|
20
|
+
/** @ignore */
|
|
11
21
|
ngAfterContentChecked(): void;
|
|
22
|
+
/** @ignore */
|
|
12
23
|
focus(): void;
|
|
13
24
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysAlertCancelDirective, never>;
|
|
14
25
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<OasysAlertCancelDirective, "ui-alert-cancel, [ui-alert-cancel]", never, {}, {}, never, never, true, never>;
|
|
15
26
|
}
|
|
16
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Main action slot for `<ui-alert>`: its text becomes the label of a
|
|
30
|
+
* `secondary` button that emits the alert's `confirm` output. Use for the
|
|
31
|
+
* action that resolves the message, such as "Try again" or "Reset your
|
|
32
|
+
* password".
|
|
33
|
+
*
|
|
34
|
+
* @import import { OasysAlertConfirmDirective } from 'oasys-lib';
|
|
35
|
+
*/
|
|
17
36
|
declare class OasysAlertConfirmDirective implements AfterContentChecked {
|
|
18
37
|
private elem;
|
|
38
|
+
/** @ignore */
|
|
19
39
|
text: string;
|
|
40
|
+
/** @ignore */
|
|
20
41
|
ngAfterContentChecked(): void;
|
|
21
42
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysAlertConfirmDirective, never>;
|
|
22
43
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<OasysAlertConfirmDirective, "ui-alert-confirm, [ui-alert-confirm]", never, {}, {}, never, never, true, never>;
|
|
23
44
|
}
|
|
24
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Message slot for `<ui-alert>`: `<ui-alert-content>…</ui-alert-content>`.
|
|
48
|
+
* Plain text or inline markup such as links.
|
|
49
|
+
*
|
|
50
|
+
* @import import { OasysAlertContentDirective } from 'oasys-lib';
|
|
51
|
+
*/
|
|
25
52
|
declare class OasysAlertContentDirective {
|
|
26
53
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysAlertContentDirective, never>;
|
|
27
54
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<OasysAlertContentDirective, "ui-alert-content, [ui-alert-content]", never, {}, {}, never, never, true, never>;
|
|
28
55
|
}
|
|
29
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Title slot for `<ui-alert>`: `<ui-alert-title>Payment failed</ui-alert-title>`.
|
|
59
|
+
* Rendered in bold above the message. Keep it to a few words.
|
|
60
|
+
*
|
|
61
|
+
* @import import { OasysAlertTitleDirective } from 'oasys-lib';
|
|
62
|
+
*/
|
|
30
63
|
declare class OasysAlertTitleDirective {
|
|
31
64
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysAlertTitleDirective, never>;
|
|
32
65
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<OasysAlertTitleDirective, "ui-alert-title, [ui-alert-title]", never, {}, {}, never, never, true, never>;
|
|
@@ -70,26 +103,98 @@ interface UIButton {
|
|
|
70
103
|
}
|
|
71
104
|
|
|
72
105
|
type UIAlertTone = 'positive' | 'neutral' | 'negative';
|
|
106
|
+
/**
|
|
107
|
+
* An inline message (`<ui-alert>`) that tells the user something has happened:
|
|
108
|
+
* a success, a failure, or neutral information, optionally with up to two
|
|
109
|
+
* actions. Use it for feedback next to the thing it is about (a form, a
|
|
110
|
+
* section of a page). It is not a modal and not a toast.
|
|
111
|
+
*
|
|
112
|
+
* Content is projected through four slot elements, all optional:
|
|
113
|
+
* - `<ui-alert-title>`: short, bold first line.
|
|
114
|
+
* - `<ui-alert-content>`: the message.
|
|
115
|
+
* - `<ui-alert-cancel>`: label for the dismissive action, rendered first as a
|
|
116
|
+
* `tertiary` button that emits `cancel`.
|
|
117
|
+
* - `<ui-alert-confirm>`: label for the main action, rendered second as a
|
|
118
|
+
* `secondary` button that emits `confirm`.
|
|
119
|
+
*
|
|
120
|
+
* A button only renders when its slot has text. The buttons are `small` on
|
|
121
|
+
* mobile whatever `button_size` says, and with `direction="dynamic"` they sit
|
|
122
|
+
* below the message on mobile and beside it from tablet up.
|
|
123
|
+
*
|
|
124
|
+
* Accessibility:
|
|
125
|
+
* - The message is a live region (`role="alert"` plus `aria-live` from
|
|
126
|
+
* `aria_live`). Screen readers announce it when it appears or its text
|
|
127
|
+
* changes, so add it to the page when the event happens (for example inside
|
|
128
|
+
* an `@if`) rather than rendering it in advance. Each time the alert goes
|
|
129
|
+
* from hidden to visible the component re-applies the live region so it is
|
|
130
|
+
* announced again.
|
|
131
|
+
* - An alert that is already on the page at first load may not be announced.
|
|
132
|
+
* If it must be, show it after the view has rendered (for example set the
|
|
133
|
+
* `@if` condition in `afterNextRender`).
|
|
134
|
+
* - When there is a `<ui-alert-cancel>`, the alert behaves like an interrupting
|
|
135
|
+
* prompt: `aria_live` is ignored (forced to `off`) and focus moves to the
|
|
136
|
+
* message when the alert becomes visible, so screen reader users hear it and
|
|
137
|
+
* can tab straight to the actions.
|
|
138
|
+
* - The tone icon is decorative. Say "success" or "failed" in the words of the
|
|
139
|
+
* title or message; never rely on colour or the icon alone.
|
|
140
|
+
* - Don't use it for content that is always on the page: every appearance
|
|
141
|
+
* interrupts screen reader users.
|
|
142
|
+
*
|
|
143
|
+
* Import the four slot directives (or `OasysAlertModule`) alongside the
|
|
144
|
+
* component.
|
|
145
|
+
*
|
|
146
|
+
* @import import { OasysAlertComponent, OasysAlertTitleDirective, OasysAlertContentDirective, OasysAlertCancelDirective, OasysAlertConfirmDirective } from 'oasys-lib';
|
|
147
|
+
*/
|
|
73
148
|
declare class OasysAlertComponent implements AfterContentChecked, AfterViewInit {
|
|
149
|
+
/** @ignore */
|
|
74
150
|
breakpointService: BreakpointService;
|
|
151
|
+
/**
|
|
152
|
+
* Where the actions sit. `dynamic` puts them below the message on mobile and
|
|
153
|
+
* beside it from tablet up; `vertical` and `horizontal` fix one layout.
|
|
154
|
+
*/
|
|
75
155
|
direction: 'dynamic' | 'vertical' | 'horizontal';
|
|
156
|
+
/**
|
|
157
|
+
* Meaning of the message, shown by colour and icon: `positive` for success,
|
|
158
|
+
* `negative` for errors and failures, `neutral` for general information.
|
|
159
|
+
*/
|
|
76
160
|
tone: UIAlertTone;
|
|
161
|
+
/**
|
|
162
|
+
* How urgently screen readers announce the alert. `polite` (default) waits
|
|
163
|
+
* until the user is idle: use it for confirmations and most messages.
|
|
164
|
+
* `assertive` interrupts: use it only for errors that block the user's task.
|
|
165
|
+
* `off` stops the announcement: use it when the same message is announced
|
|
166
|
+
* elsewhere. Ignored when there is a `<ui-alert-cancel>` (focus moves to the
|
|
167
|
+
* alert instead).
|
|
168
|
+
*/
|
|
77
169
|
aria_live: 'polite' | 'assertive' | 'off';
|
|
170
|
+
/** Size of the action buttons from tablet up. On mobile they are always `small`. */
|
|
78
171
|
button_size: UIButtonSize;
|
|
172
|
+
/** Emitted when the `<ui-alert-cancel>` button is clicked. */
|
|
79
173
|
cancel: EventEmitter<void>;
|
|
174
|
+
/** Emitted when the `<ui-alert-confirm>` button is clicked. */
|
|
80
175
|
confirm: EventEmitter<void>;
|
|
176
|
+
/** @ignore */
|
|
81
177
|
cancelButton?: OasysAlertCancelDirective;
|
|
178
|
+
/** @ignore */
|
|
82
179
|
confirmButton?: OasysAlertConfirmDirective;
|
|
180
|
+
/** @ignore */
|
|
83
181
|
cancelbuttoncontainer?: ElementRef<HTMLElement>;
|
|
182
|
+
/** @ignore */
|
|
84
183
|
alertHost?: ElementRef<HTMLElement>;
|
|
85
184
|
private wasVisible;
|
|
86
185
|
private hasFocusedOnCurrentVisibility;
|
|
87
186
|
private ariaLiveElement?;
|
|
187
|
+
/** @ignore */
|
|
88
188
|
get isVertical(): boolean;
|
|
189
|
+
/** @ignore */
|
|
89
190
|
get buttonSize(): UIButtonSize;
|
|
191
|
+
/** @ignore */
|
|
90
192
|
cancelled(): void;
|
|
193
|
+
/** @ignore */
|
|
91
194
|
confirmed(): void;
|
|
195
|
+
/** @ignore */
|
|
92
196
|
ngAfterViewInit(): void;
|
|
197
|
+
/** @ignore */
|
|
93
198
|
ngAfterContentChecked(): void;
|
|
94
199
|
private checkVisibilityAndFocus;
|
|
95
200
|
private isComponentVisible;
|
|
@@ -107,9 +212,50 @@ interface BreadcrumbsItem {
|
|
|
107
212
|
href: string;
|
|
108
213
|
name: string;
|
|
109
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* A breadcrumb trail (`<ui-breadcrumbs>`) showing where the current page sits in
|
|
217
|
+
* the site hierarchy, with a link back to each ancestor. Use it near the top of
|
|
218
|
+
* content pages such as help-centre articles and category pages. Don't use it
|
|
219
|
+
* for step-by-step flows like checkout.
|
|
220
|
+
*
|
|
221
|
+
* Pass the whole trail, root first and current page last, to
|
|
222
|
+
* `breadcrumbs_values`. Each item renders as a small tertiary `<ui-button>`
|
|
223
|
+
* link with a chevron between items, inside a `<nav>` landmark on a
|
|
224
|
+
* `core-secondary` full-width bar. Items wrap onto more lines when space runs
|
|
225
|
+
* out. The bar's background and padding are fixed; place the component inside
|
|
226
|
+
* a `<ui-container>` to line it up with the page content.
|
|
227
|
+
*
|
|
228
|
+
* Every item, including the last (current page), is rendered as a link, so
|
|
229
|
+
* give the last item the current page's URL.
|
|
230
|
+
*
|
|
231
|
+
* @import import { OasysBreadcrumbsComponent } from 'oasys-lib';
|
|
232
|
+
* @knownIssue `breadcrumbs_values` is only read once, when the component
|
|
233
|
+
* initialises: changing it afterwards does not update the trail. Workaround:
|
|
234
|
+
* have the final trail ready before rendering (for example inside an `@if`),
|
|
235
|
+
* or re-create the component when the trail changes.
|
|
236
|
+
* @knownIssue An empty array still renders an empty coloured bar and an empty
|
|
237
|
+
* `<nav>` landmark. Workaround: wrap the component in
|
|
238
|
+
* `@if (trail.length > 0)`.
|
|
239
|
+
* @knownIssue Screen readers are not told which item is the current page:
|
|
240
|
+
* `aria-current` is set to the item's name on the `<ui-button>` wrapper
|
|
241
|
+
* instead of `aria-current="page"` on the link. Workaround: none in consumer
|
|
242
|
+
* code; make sure the last item's name matches the page's `<h1>`.
|
|
243
|
+
* @knownIssue The landmark label is hard-coded in English
|
|
244
|
+
* (`aria-label="breadcrumbs"`) on every locale. Workaround: none in consumer
|
|
245
|
+
* code.
|
|
246
|
+
*/
|
|
110
247
|
declare class BreadcrumbsComponent implements OnInit {
|
|
248
|
+
/**
|
|
249
|
+
* The trail, root first and current page last, as an array of
|
|
250
|
+
* `{ href, name }` objects: `href` is the link URL and `name` the visible
|
|
251
|
+
* label. Also accepts the same array as a JSON string, for markup rendered
|
|
252
|
+
* from CMS content where attributes can only be strings; invalid JSON
|
|
253
|
+
* throws. Read once on init (see Known issues).
|
|
254
|
+
*/
|
|
111
255
|
breadcrumbs_values: string | BreadcrumbsItem[];
|
|
256
|
+
/** @ignore */
|
|
112
257
|
values: BreadcrumbsItem[];
|
|
258
|
+
/** @ignore */
|
|
113
259
|
ngOnInit(): void;
|
|
114
260
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BreadcrumbsComponent, never>;
|
|
115
261
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BreadcrumbsComponent, "ui-breadcrumbs", never, { "breadcrumbs_values": { "alias": "breadcrumbs_values"; "required": false; }; }, {}, never, never, true, never>;
|
|
@@ -291,19 +437,73 @@ declare class OasysButtonGroupModule {
|
|
|
291
437
|
|
|
292
438
|
type CardImageFormat = 'square' | 'portrait' | 'landscape';
|
|
293
439
|
|
|
440
|
+
/**
|
|
441
|
+
* A static content card (`<ui-card>`) for editorial and category content: an
|
|
442
|
+
* image on top, then an optional highlight label that overlaps the bottom edge
|
|
443
|
+
* of the image, a pair of small meta texts, and up to two lines of copy. Every
|
|
444
|
+
* text slot is optional and only renders when set.
|
|
445
|
+
*
|
|
446
|
+
* Use it for blog listings, category tiles and carousels of editorial content.
|
|
447
|
+
* It is not a product card: it has no price, CTA, output or selection state.
|
|
448
|
+
* For a selectable card use `<ui-select-card>`; for a marketing tile with a
|
|
449
|
+
* CTA use `<ui-promo-card>`.
|
|
450
|
+
*
|
|
451
|
+
* - The card is not interactive. To make it a link, wrap it in an `<a>` whose
|
|
452
|
+
* accessible name makes sense on its own (the link text is all the card's
|
|
453
|
+
* text plus the image alt text).
|
|
454
|
+
* - The card fills the width of its parent; size it with a grid column or
|
|
455
|
+
* wrapper.
|
|
456
|
+
* - No text slot is a heading except the label (see known issues). If the card
|
|
457
|
+
* needs a heading for the page outline, put it in the surrounding markup.
|
|
458
|
+
* - `alt_text` defaults to `''` (decorative). Set it only when the image adds
|
|
459
|
+
* information the text does not already give.
|
|
460
|
+
* - Image aspect ratios come from the `--oasys-component-card-aspect-ratio-*`
|
|
461
|
+
* tokens, so they can differ per brand.
|
|
462
|
+
*
|
|
463
|
+
* Requires an `IMAGE_URL_PROVIDER` (for the inner `<ui-image>`).
|
|
464
|
+
*
|
|
465
|
+
* @import import { OasysCardComponent } from 'oasys-lib';
|
|
466
|
+
* @knownIssue `label_text` renders as an `<h5>`, so every labelled card adds an
|
|
467
|
+
* out-of-sequence heading to the page outline. Workaround: only use
|
|
468
|
+
* `label_text` where an extra h5 is acceptable (for example a grid of category
|
|
469
|
+
* cards under an h4), otherwise leave it unset and show the label in
|
|
470
|
+
* surrounding markup.
|
|
471
|
+
*/
|
|
294
472
|
declare class CardComponent {
|
|
295
473
|
private readonly tokenService;
|
|
474
|
+
/**
|
|
475
|
+
* Short highlight label (for example a category name) shown on a tinted
|
|
476
|
+
* pill that overlaps the bottom edge of the image. Hidden when unset; an
|
|
477
|
+
* empty string still renders an empty pill.
|
|
478
|
+
*/
|
|
296
479
|
readonly label_text: _angular_core.InputSignal<string>;
|
|
480
|
+
/** Image URL, passed to `<ui-image>` (and so through the app's `IMAGE_URL_PROVIDER`). */
|
|
297
481
|
readonly image: _angular_core.InputSignal<string>;
|
|
482
|
+
/**
|
|
483
|
+
* Alt text for the image. Leave as `''` for decorative images, which is
|
|
484
|
+
* usually right when the card text already describes the content.
|
|
485
|
+
*/
|
|
298
486
|
readonly alt_text: _angular_core.InputSignal<string>;
|
|
487
|
+
/** Image aspect ratio. Unset behaves like `portrait`. */
|
|
299
488
|
readonly image_format: _angular_core.InputSignal<CardImageFormat>;
|
|
489
|
+
/** Small supporting text on the left of the meta row, such as a category or tags. */
|
|
300
490
|
readonly small_title_left: _angular_core.InputSignal<string>;
|
|
491
|
+
/** Small supporting text on the right of the meta row, such as a published date. */
|
|
301
492
|
readonly small_sub_title_right: _angular_core.InputSignal<string>;
|
|
493
|
+
/** Centred body copy, such as a short category description. */
|
|
302
494
|
readonly standard_content: _angular_core.InputSignal<string>;
|
|
495
|
+
/** Emphasised copy, typically the title of a blog post. Rendered as a `<p>`, not a heading. */
|
|
303
496
|
readonly bold_content: _angular_core.InputSignal<string>;
|
|
497
|
+
/**
|
|
498
|
+
* Drop the card's `core-primary` background so it blends into a coloured
|
|
499
|
+
* section.
|
|
500
|
+
*/
|
|
304
501
|
readonly transparent_background: _angular_core.InputSignal<boolean>;
|
|
502
|
+
/** @ignore */
|
|
305
503
|
readonly aspectRatio: _angular_core.Signal<string>;
|
|
504
|
+
/** @ignore */
|
|
306
505
|
readonly imageLabel: _angular_core.Signal<ElementRef<HTMLElement>>;
|
|
506
|
+
/** @ignore */
|
|
307
507
|
readonly stackOffset: _angular_core.WritableSignal<string>;
|
|
308
508
|
constructor();
|
|
309
509
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CardComponent, never>;
|
|
@@ -319,8 +519,33 @@ declare class OasysCardModule {
|
|
|
319
519
|
|
|
320
520
|
type DividerType = 'primary' | 'secondary';
|
|
321
521
|
|
|
522
|
+
/**
|
|
523
|
+
* A full-width horizontal rule (`<ui-divider>`) that separates sections of
|
|
524
|
+
* content, such as rows in a summary or groups of options in a form.
|
|
525
|
+
*
|
|
526
|
+
* - `secondary` (default) is a thin hairline for separating related items.
|
|
527
|
+
* - `primary` is a thick band for separating major sections.
|
|
528
|
+
*
|
|
529
|
+
* It always fills the width of its container, so control its length and the
|
|
530
|
+
* space around it from the parent (for example a `<ui-stack>` gap or
|
|
531
|
+
* `<ui-box>` padding). It takes no content.
|
|
532
|
+
*
|
|
533
|
+
* Accessibility: the divider is purely visual. It renders no `<hr>` and no
|
|
534
|
+
* `role="separator"`, so screen readers do not announce it. Don't rely on it
|
|
535
|
+
* to convey structure; use headings or lists for that.
|
|
536
|
+
*
|
|
537
|
+
* Don't stack a divider between two bordered `<ui-box>`es to fake a single
|
|
538
|
+
* card: use one outer box with the border instead.
|
|
539
|
+
*
|
|
540
|
+
* @import import { OasysDividerComponent } from 'oasys-lib';
|
|
541
|
+
*/
|
|
322
542
|
declare class DividerComponent {
|
|
543
|
+
/**
|
|
544
|
+
* Visual weight. `secondary` is a thin hairline between related items;
|
|
545
|
+
* `primary` is a thick band between major sections.
|
|
546
|
+
*/
|
|
323
547
|
divider_type: DividerType;
|
|
548
|
+
/** @ignore */
|
|
324
549
|
getClass(): string;
|
|
325
550
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DividerComponent, never>;
|
|
326
551
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DividerComponent, "ui-divider", never, { "divider_type": { "alias": "divider_type"; "required": false; }; }, {}, never, never, true, never>;
|
|
@@ -333,14 +558,45 @@ declare class OasysDividerModule {
|
|
|
333
558
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<OasysDividerModule>;
|
|
334
559
|
}
|
|
335
560
|
|
|
561
|
+
/**
|
|
562
|
+
* Groups related form controls under a caption (`<ui-form-group>`). Renders a
|
|
563
|
+
* `<fieldset>` with a `<legend>` and stacks the projected controls with `near`
|
|
564
|
+
* spacing.
|
|
565
|
+
*
|
|
566
|
+
* Use it whenever several controls answer one question or belong together:
|
|
567
|
+
* always for a set of radios or checkboxes (the legend is the question, e.g.
|
|
568
|
+
* "Delivery options"), and for blocks of text inputs such as an address.
|
|
569
|
+
* Screen readers announce the legend when focus enters the group, so keep it
|
|
570
|
+
* short.
|
|
571
|
+
*
|
|
572
|
+
* `group_title` is required. If the surrounding page already shows a visible
|
|
573
|
+
* heading for the group, set `[group_title_hidden]="true"`: the legend is then
|
|
574
|
+
* visually hidden but still announced. Do not leave it empty: it falls back to
|
|
575
|
+
* "Untitled Form Group".
|
|
576
|
+
*
|
|
577
|
+
* `group_type` only changes the legend's text style: `primary` for a main
|
|
578
|
+
* question, `secondary` for a smaller sub-group. Match it to the
|
|
579
|
+
* `radio_type` / `checkbox_type` of the controls inside.
|
|
580
|
+
*
|
|
581
|
+
* @import import { OasysFormGroupComponent } from 'oasys-lib';
|
|
582
|
+
* @knownIssue Every `<ui-form-group>` logs a console warning that
|
|
583
|
+
* "group_title" is required, even when it is set. Workaround: ignore the
|
|
584
|
+
* warning when `group_title` is set to non-empty text.
|
|
585
|
+
*/
|
|
336
586
|
declare class FormGroupComponent implements OnChanges {
|
|
587
|
+
/** Caption rendered in the `<legend>`: the group's accessible name. Phrase it as the question or topic ("Delivery options", "Recipient's address"). Empty text falls back to "Untitled Form Group". */
|
|
337
588
|
group_title: _angular_core.InputSignal<string>;
|
|
589
|
+
/** Visually hide the legend but keep it announced to screen readers. Use when a visible heading already introduces the group. */
|
|
338
590
|
group_title_hidden: _angular_core.InputSignal<boolean>;
|
|
591
|
+
/** Legend text style only (no effect on semantics): `primary` for a main question, `secondary` for a sub-group. */
|
|
339
592
|
group_type: _angular_core.InputSignal<"primary" | "secondary">;
|
|
593
|
+
/** Replaces what screen readers announce for the group (set as `aria-label` on the `<legend>`). Rarely needed: only when the visible title needs more context when read out. */
|
|
340
594
|
ariaLabel: _angular_core.InputSignal<string>;
|
|
595
|
+
/** @ignore */
|
|
341
596
|
protected resolvedTitle: _angular_core.Signal<string>;
|
|
342
597
|
private hasWarnedMissingTitle;
|
|
343
598
|
private readonly FALLBACK_TITLE;
|
|
599
|
+
/** @ignore */
|
|
344
600
|
ngOnChanges(): void;
|
|
345
601
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormGroupComponent, never>;
|
|
346
602
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormGroupComponent, "ui-form-group", never, { "group_title": { "alias": "group_title"; "required": true; "isSignal": true; }; "group_title_hidden": { "alias": "group_title_hidden"; "required": false; "isSignal": true; }; "group_type": { "alias": "group_type"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
@@ -353,27 +609,101 @@ declare class OasysFormGroupModule {
|
|
|
353
609
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<OasysFormGroupModule>;
|
|
354
610
|
}
|
|
355
611
|
|
|
612
|
+
/**
|
|
613
|
+
* The Oasys checkbox (`<ui-checkbox>`). Use it for an on/off choice (such as a
|
|
614
|
+
* marketing opt-in) or for picking any number of options from a list. For one
|
|
615
|
+
* choice from a list, use `<ui-radio>` or a radio `<ui-chip>`; for a
|
|
616
|
+
* stand-alone toggle button, use `<ui-button aria_role="switch">`.
|
|
617
|
+
*
|
|
618
|
+
* Renders a native `<input type="checkbox">` with a `<label>` holding `label`.
|
|
619
|
+
* Projected content:
|
|
620
|
+
* - default slot: hint text shown under the label. It sits inside the
|
|
621
|
+
* `<label>`, so it is read as part of the checkbox's name; keep it short.
|
|
622
|
+
* - `[tertiary-content]`: extra content on the label line, such as a price.
|
|
623
|
+
*
|
|
624
|
+
* Works with Angular forms (`formControlName`, `formControl`, `ngModel`); the
|
|
625
|
+
* value is a boolean. Without forms, use `[(checked)]` or `didChange`.
|
|
626
|
+
*
|
|
627
|
+
* Accessibility:
|
|
628
|
+
* - `label` is required and is the accessible name; make it describe the choice.
|
|
629
|
+
* - Wrap related checkboxes in `<ui-form-group>` so they sit in a
|
|
630
|
+
* `<fieldset>` whose `<legend>` (`group_title`) asks the question. Do not add
|
|
631
|
+
* `role="checkboxgroup"`: it is not an ARIA role.
|
|
632
|
+
* - Set `ariaDescribedBy` to the id of an element that explains the checkbox
|
|
633
|
+
* (for example an error message outside the component).
|
|
634
|
+
*
|
|
635
|
+
* Validation: `required` only sets the native attribute, which drives the
|
|
636
|
+
* error styling (red label and box once touched and unchecked). It does not
|
|
637
|
+
* validate your form control: add `Validators.requiredTrue` as well.
|
|
638
|
+
*
|
|
639
|
+
* @import import { OasysCheckboxComponent } from 'oasys-lib';
|
|
640
|
+
* @knownIssue Disabling the form control (`control.disable()` or
|
|
641
|
+
* `new FormControl({ value: false, disabled: true })`) does not disable the
|
|
642
|
+
* checkbox, because the component does not implement `setDisabledState`.
|
|
643
|
+
* Workaround: also bind `[disabled]` to the control's disabled state (Angular
|
|
644
|
+
* logs a dev-mode warning about `disabled` on a reactive form directive; it is
|
|
645
|
+
* safe to ignore here).
|
|
646
|
+
*/
|
|
356
647
|
declare class CheckboxComponent implements ControlValueAccessor, OnInit {
|
|
357
648
|
private readonly tokenService;
|
|
358
649
|
private readonly idGenerator;
|
|
650
|
+
/**
|
|
651
|
+
* `primary` is a bordered, tappable tile with body-size text, for choices
|
|
652
|
+
* that are the main content of a step. `secondary` is a compact inline
|
|
653
|
+
* checkbox with supporting-size text, for consents and opt-ins.
|
|
654
|
+
*/
|
|
359
655
|
checkbox_type: _angular_core.InputSignal<"primary" | "secondary">;
|
|
656
|
+
/** Visible label and accessible name. Describe the choice, not the action. */
|
|
360
657
|
label: _angular_core.InputSignal<string>;
|
|
658
|
+
/**
|
|
659
|
+
* Sets the native `required` attribute, which drives the error styling once
|
|
660
|
+
* the checkbox is touched and unchecked. Also add `Validators.requiredTrue` to
|
|
661
|
+
* your form control: this input does not validate it.
|
|
662
|
+
*/
|
|
361
663
|
required: _angular_core.InputSignal<boolean>;
|
|
664
|
+
/**
|
|
665
|
+
* Disables the checkbox. Bind it even when using reactive forms: disabling the
|
|
666
|
+
* form control alone does not disable the checkbox.
|
|
667
|
+
*/
|
|
362
668
|
disabled: _angular_core.InputSignal<boolean>;
|
|
669
|
+
/**
|
|
670
|
+
* Id of an element that describes the checkbox, such as an error message.
|
|
671
|
+
* Becomes the input's `aria-describedby`.
|
|
672
|
+
*/
|
|
363
673
|
ariaDescribedBy: _angular_core.InputSignal<string>;
|
|
674
|
+
/**
|
|
675
|
+
* Hides the tick box so the whole label acts as the control. Used by
|
|
676
|
+
* `<ui-chip>`; prefer a checkbox chip over setting this directly.
|
|
677
|
+
*/
|
|
364
678
|
hide_checkbox: _angular_core.InputSignal<boolean>;
|
|
679
|
+
/** Icon shown before the label. Only shown when `hide_checkbox` is `true`. */
|
|
365
680
|
iconName: _angular_core.InputSignal<IconNames>;
|
|
681
|
+
/**
|
|
682
|
+
* Checked state. Supports two-way binding with `[(checked)]`. With Angular
|
|
683
|
+
* forms, set the form control's value instead.
|
|
684
|
+
*/
|
|
366
685
|
checked: _angular_core.ModelSignal<boolean>;
|
|
686
|
+
/** Emits the new checked state when the user toggles the checkbox. */
|
|
367
687
|
didChange: _angular_core.OutputEmitterRef<boolean>;
|
|
688
|
+
/** @ignore */
|
|
368
689
|
id: _angular_core.WritableSignal<string | number>;
|
|
690
|
+
/** @ignore */
|
|
369
691
|
iconSize: _angular_core.WritableSignal<string>;
|
|
692
|
+
/** @ignore */
|
|
370
693
|
hint: _angular_core.Signal<string>;
|
|
694
|
+
/** @ignore */
|
|
371
695
|
ngOnInit(): void;
|
|
696
|
+
/** @ignore */
|
|
372
697
|
onChange: (value: boolean) => void;
|
|
698
|
+
/** @ignore */
|
|
373
699
|
onTouched: () => void;
|
|
700
|
+
/** @ignore */
|
|
374
701
|
writeValue(checked: boolean): void;
|
|
702
|
+
/** @ignore */
|
|
375
703
|
registerOnChange(fn: (value: boolean) => void): void;
|
|
704
|
+
/** @ignore */
|
|
376
705
|
registerOnTouched(fn: () => void): void;
|
|
706
|
+
/** @ignore */
|
|
377
707
|
onModelChange(event: boolean): void;
|
|
378
708
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CheckboxComponent, never>;
|
|
379
709
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CheckboxComponent, "ui-checkbox", never, { "checkbox_type": { "alias": "checkbox_type"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; "hide_checkbox": { "alias": "hide_checkbox"; "required": false; "isSignal": true; }; "iconName": { "alias": "iconName"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "didChange": "didChange"; }, never, ["[tertiary-content]", "*"], true, never>;
|
|
@@ -386,31 +716,112 @@ declare class OasysCheckboxModule {
|
|
|
386
716
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<OasysCheckboxModule>;
|
|
387
717
|
}
|
|
388
718
|
|
|
719
|
+
/**
|
|
720
|
+
* The Oasys radio button (`<ui-radio>`). Use a set of radios for picking
|
|
721
|
+
* exactly one option from a short list that should stay visible, such as
|
|
722
|
+
* delivery or email-frequency choices. For many options, use
|
|
723
|
+
* `<ui-combobox>`; for compact pill-style choices, use a radio `<ui-chip>`.
|
|
724
|
+
*
|
|
725
|
+
* Each `<ui-radio>` is one option. Renders a native `<input type="radio">`
|
|
726
|
+
* with a `<label>` holding `label`. Projected content:
|
|
727
|
+
* - default slot: hint text shown under the label, inside the `<label>`.
|
|
728
|
+
* - `[tertiary-content]`: extra content on the label line, such as a price.
|
|
729
|
+
*
|
|
730
|
+
* Grouping: give every radio in a set the same `name` and its own `value`, and
|
|
731
|
+
* wrap the set in `<ui-form-group>` so it sits in a `<fieldset>` whose
|
|
732
|
+
* `<legend>` (`group_title`) asks the question.
|
|
733
|
+
*
|
|
734
|
+
* Forms: bind every radio in the set to the same control
|
|
735
|
+
* (`formControlName="delivery"` on each). The control value is the `value`
|
|
736
|
+
* of the selected radio, as a string.
|
|
737
|
+
*
|
|
738
|
+
* Keyboard: arrow keys move focus between enabled radios with the same `name`
|
|
739
|
+
* (wrapping at the ends) without selecting; Space selects. Tab and Shift+Tab
|
|
740
|
+
* also step through the radios, leaving the set at the first and last one.
|
|
741
|
+
*
|
|
742
|
+
* @import import { OasysRadioComponent } from 'oasys-lib';
|
|
743
|
+
* @knownIssue `name` defaults to the same value (`testname`) for every radio,
|
|
744
|
+
* so radios without a `name` all join one native group across the page:
|
|
745
|
+
* selecting in one set clears the others, and arrow keys move between sets.
|
|
746
|
+
* Workaround: always give each set its own `name`.
|
|
747
|
+
* @knownIssue `[checked]="true"` does not check the radio: the radio's
|
|
748
|
+
* internal `ngModel` overwrites it on init. Workaround: bind the set to a form
|
|
749
|
+
* control (`formControlName`, `formControl`, or `[ngModel]` on every radio)
|
|
750
|
+
* and set that to the radio's `value`.
|
|
751
|
+
* @knownIssue Disabling the form control (`control.disable()` or
|
|
752
|
+
* `new FormControl({ value: '', disabled: true })`) does not disable the
|
|
753
|
+
* radios, because the component does not implement `setDisabledState`.
|
|
754
|
+
* Workaround: also bind `[disabled]` on each radio (Angular logs a dev-mode
|
|
755
|
+
* warning about `disabled` on a reactive form directive; it is safe to ignore
|
|
756
|
+
* here).
|
|
757
|
+
*/
|
|
389
758
|
declare class RadioComponent implements ControlValueAccessor {
|
|
390
759
|
private readonly NAV_KEYS;
|
|
391
760
|
private readonly FORWARD_KEYS;
|
|
392
761
|
private idGenerator;
|
|
393
762
|
private document;
|
|
763
|
+
/**
|
|
764
|
+
* `primary` is a bordered, tappable tile with body-size text. `secondary` is
|
|
765
|
+
* a compact inline radio with supporting-size text. Use the same type for
|
|
766
|
+
* every radio in a set.
|
|
767
|
+
*/
|
|
394
768
|
radio_type: _angular_core.InputSignal<"primary" | "secondary">;
|
|
769
|
+
/** Visible label and accessible name of this option. */
|
|
395
770
|
label: _angular_core.InputSignal<string>;
|
|
771
|
+
/**
|
|
772
|
+
* Native group name. Give every radio in a set the same `name`, unique on the
|
|
773
|
+
* page: it groups the radios for selection and for arrow-key navigation.
|
|
774
|
+
*/
|
|
396
775
|
name: _angular_core.InputSignal<string>;
|
|
776
|
+
/**
|
|
777
|
+
* Meant to check this radio without Angular forms, but it has no effect (see
|
|
778
|
+
* Known issues). Set the value of a form control or `ngModel` instead.
|
|
779
|
+
*/
|
|
397
780
|
checked: _angular_core.InputSignal<boolean>;
|
|
781
|
+
/**
|
|
782
|
+
* Disables this radio; arrow keys skip it. Bind it even when using reactive
|
|
783
|
+
* forms: disabling the form control alone does not disable the radio.
|
|
784
|
+
*/
|
|
398
785
|
disabled: _angular_core.InputSignal<boolean>;
|
|
786
|
+
/**
|
|
787
|
+
* Id given to the hint under the label, which the input references with
|
|
788
|
+
* `aria-describedby`. Set a unique id when you project hint text. Unlike
|
|
789
|
+
* `<ui-checkbox>`, do not pass the id of another element: it would be
|
|
790
|
+
* duplicated.
|
|
791
|
+
*/
|
|
399
792
|
ariaDescribedBy: _angular_core.InputSignal<string>;
|
|
793
|
+
/**
|
|
794
|
+
* Hides the radio circle so the whole label acts as the control. Used by
|
|
795
|
+
* `<ui-chip>`; prefer a radio chip over setting this directly.
|
|
796
|
+
*/
|
|
400
797
|
hide_radio: _angular_core.InputSignal<boolean>;
|
|
798
|
+
/** Icon shown before the label. Only shown when `hide_radio` is `true`. */
|
|
401
799
|
iconName: _angular_core.InputSignal<IconNames>;
|
|
800
|
+
/** Value this option gives the form control (or `didChange`) when selected. */
|
|
402
801
|
value: _angular_core.ModelSignal<string>;
|
|
802
|
+
/** Emits this radio's `value` when the user selects it. */
|
|
403
803
|
didChange: _angular_core.OutputEmitterRef<string>;
|
|
804
|
+
/** @ignore */
|
|
404
805
|
id: _angular_core.WritableSignal<string | number>;
|
|
806
|
+
/** @ignore */
|
|
405
807
|
selectedValue: _angular_core.WritableSignal<string>;
|
|
808
|
+
/** @ignore */
|
|
406
809
|
hint: _angular_core.Signal<string>;
|
|
810
|
+
/** @ignore */
|
|
407
811
|
onChange: (value: string | undefined) => void;
|
|
812
|
+
/** @ignore */
|
|
408
813
|
onTouched: () => void;
|
|
814
|
+
/** @ignore */
|
|
409
815
|
selectOption(): void;
|
|
816
|
+
/** @ignore */
|
|
410
817
|
writeValue(value: string): void;
|
|
818
|
+
/** @ignore */
|
|
411
819
|
registerOnChange(fn: (value: string | undefined) => void): void;
|
|
820
|
+
/** @ignore */
|
|
412
821
|
registerOnTouched(fn: () => void): void;
|
|
822
|
+
/** @ignore */
|
|
413
823
|
onModelChange(event: string): void;
|
|
824
|
+
/** @ignore */
|
|
414
825
|
onKeyDown(event: KeyboardEvent): void;
|
|
415
826
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadioComponent, never>;
|
|
416
827
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RadioComponent, "ui-radio", never, { "radio_type": { "alias": "radio_type"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; "hide_radio": { "alias": "hide_radio"; "required": false; "isSignal": true; }; "iconName": { "alias": "iconName"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "didChange": "didChange"; }, never, ["[tertiary-content]", "*"], true, never>;
|
|
@@ -438,49 +849,194 @@ interface ValidationErrorTypes {
|
|
|
438
849
|
[key: string]: string;
|
|
439
850
|
}
|
|
440
851
|
|
|
852
|
+
/**
|
|
853
|
+
* The Oasys single-line text field (`<ui-text-input>`), with a floating label,
|
|
854
|
+
* optional hint and inline error. Use it for names, emails, phone numbers,
|
|
855
|
+
* postcodes, passwords and other short free text. Use `<ui-textarea>` for
|
|
856
|
+
* multi-line text and `<ui-combobox>` to pick from a list.
|
|
857
|
+
*
|
|
858
|
+
* It is a `ControlValueAccessor`: bind it with `formControlName` (or
|
|
859
|
+
* `formControl` / `ngModel`) and put validation on the form control. It renders
|
|
860
|
+
* a native `<input>` with a `<label for>` pointing at it, so `label` is required
|
|
861
|
+
* and is the field's accessible name.
|
|
862
|
+
*
|
|
863
|
+
* Accessibility and form conventions:
|
|
864
|
+
* - Fields are optional by default. Set `[optional]="false"` on required fields
|
|
865
|
+
* so the input gets `aria-required="true"`. Nothing is shown visually, so
|
|
866
|
+
* mark optional fields in the label text instead, e.g. "Company (optional)".
|
|
867
|
+
* - Always set `autocomplete` for personal data (name, email, address, tel,
|
|
868
|
+
* passwords) so browsers and password managers can fill it, and pick the
|
|
869
|
+
* `type` / `inputmode` that brings up the right mobile keyboard.
|
|
870
|
+
* - `hint` is linked to the input with `aria-describedby`. For
|
|
871
|
+
* `type="password"` the hint only appears once the field is first focused.
|
|
872
|
+
* - `type="password"` adds a Show/Hide toggle button. Pass translated
|
|
873
|
+
* `show_password_*` / `hide_password_*` strings.
|
|
874
|
+
* - `type="tel"` replaces the accessible name with the label, preface text and
|
|
875
|
+
* the digits read one by one, unless you set `aria_label`.
|
|
876
|
+
*
|
|
877
|
+
* Errors: project a `<ui-form-errors>` as content. It is hidden until the
|
|
878
|
+
* control is dirty and invalid and the user has left the field (blur) or
|
|
879
|
+
* pressed Enter; it hides again while they type. Once shown it is linked to the
|
|
880
|
+
* input with `aria-describedby`. It is not a live region, so pair a form with
|
|
881
|
+
* `<ui-form-errors-summary>` to tell users about errors on submit.
|
|
882
|
+
*
|
|
883
|
+
* Project an element with the `preface` attribute to show a fixed prefix to
|
|
884
|
+
* the left of the input (e.g. a country dial code).
|
|
885
|
+
*
|
|
886
|
+
* @import import { OasysTextInputComponent } from 'oasys-lib';
|
|
887
|
+
* @knownIssue Disabling the form control (`control.disable()` or
|
|
888
|
+
* `new FormControl({ value, disabled: true })`) does not disable the input: the
|
|
889
|
+
* component does not implement `setDisabledState`. Workaround: also bind
|
|
890
|
+
* `[disabled]` to the control's state, e.g.
|
|
891
|
+
* `[disabled]="form.controls.email.disabled"`.
|
|
892
|
+
* @knownIssue `autocorrect` defaults to `true` for every `type`, so spellcheck
|
|
893
|
+
* and Safari autocorrect stay on for email, password, tel and url fields.
|
|
894
|
+
* Workaround: set `[autocorrect]="false"` on every field that is not natural
|
|
895
|
+
* language text.
|
|
896
|
+
* @knownIssue `inputmode` defaults to `text` for every type except `tel` and
|
|
897
|
+
* `number`, so `type="email"`, `url` and `search` fields render
|
|
898
|
+
* `inputmode="text"` instead of the matching keyboard. Workaround: set
|
|
899
|
+
* `inputmode` to match, e.g. `type="email" inputmode="email"`.
|
|
900
|
+
* @knownIssue The inline error only appears once the control is dirty (the
|
|
901
|
+
* user typed) and the input itself has been blurred or had Enter pressed.
|
|
902
|
+
* Tabbing through an empty required field, or submitting a form the user never
|
|
903
|
+
* typed in, shows no inline error, and `markAllAsTouched()` does not change
|
|
904
|
+
* that. Workaround: on submit, show a `<ui-form-errors-summary>` listing the
|
|
905
|
+
* errors; to also reveal inline errors, call `form.markAllAsDirty()` and
|
|
906
|
+
* dispatch a `blur` event on each field's `<input>`.
|
|
907
|
+
*/
|
|
441
908
|
declare class TextInputComponent implements ControlValueAccessor, OnInit {
|
|
909
|
+
/** Visible label, linked to the input with `<label for>`. It is the field's accessible name, so keep it short and specific ("Email address"). Add "(optional)" to the text for optional fields. */
|
|
442
910
|
label: _angular_core.InputSignal<string>;
|
|
911
|
+
/**
|
|
912
|
+
* Help text shown under the field and linked with `aria-describedby`. Use it
|
|
913
|
+
* for format or purpose ("We'll send your order confirmation here"). Hidden
|
|
914
|
+
* while an error is showing. For `type="password"` it appears on first focus.
|
|
915
|
+
*/
|
|
443
916
|
hint: _angular_core.InputSignal<string>;
|
|
917
|
+
/**
|
|
918
|
+
* Fields are optional by default. Set `[optional]="false"` on required fields
|
|
919
|
+
* to add `aria-required="true"`. This does not validate: also add
|
|
920
|
+
* `Validators.required` to the control.
|
|
921
|
+
*/
|
|
444
922
|
optional: _angular_core.InputSignal<boolean>;
|
|
923
|
+
/**
|
|
924
|
+
* Native input type. Use `email`, `tel`, `password`, `url`, `search` or
|
|
925
|
+
* `number` when they apply so browsers validate, autofill and pick a keyboard.
|
|
926
|
+
* `password` adds a Show/Hide toggle. Read once on init: changing it later has
|
|
927
|
+
* no effect.
|
|
928
|
+
*/
|
|
445
929
|
type: _angular_core.InputSignal<TextInputType>;
|
|
930
|
+
/**
|
|
931
|
+
* Virtual keyboard to show on touch devices. Ignored for `type="tel"` (always
|
|
932
|
+
* `tel`) and `type="number"` (always `numeric`). For every other type it is
|
|
933
|
+
* sent as-is, so match it to the type (`email` for email fields) or use
|
|
934
|
+
* `numeric` / `decimal` for digit-only text such as card or order numbers.
|
|
935
|
+
*/
|
|
446
936
|
inputmode: _angular_core.InputSignal<TextInputMode>;
|
|
937
|
+
/**
|
|
938
|
+
* Autofill hint for browsers and password managers. Always set it for
|
|
939
|
+
* personal data: `name`, `given-name`, `family-name`, `email`, `tel`,
|
|
940
|
+
* `street-address` / `address-line1`, `postal-code`, `current-password`,
|
|
941
|
+
* `new-password`, `one-time-code`. Use `off` only for fields that must never be
|
|
942
|
+
* autofilled, such as a gift message recipient's details.
|
|
943
|
+
*/
|
|
447
944
|
autocomplete: _angular_core.InputSignal<AutocompleteType>;
|
|
945
|
+
/** Focus the input when it first renders. Use sparingly (for example the first field in a modal): moving focus on page load disorientates screen reader users. */
|
|
448
946
|
autofocus: _angular_core.InputSignal<boolean>;
|
|
947
|
+
/**
|
|
948
|
+
* Native `minlength` attribute. It does not make your form control invalid;
|
|
949
|
+
* add `Validators.minLength` to the control as well, or the field shows a red
|
|
950
|
+
* border with no message.
|
|
951
|
+
*/
|
|
449
952
|
minlength: _angular_core.InputSignal<number>;
|
|
953
|
+
/** Native `maxlength`: the browser stops typing at this length. Defaults to 255. Add `Validators.maxLength` if the form control must also enforce it. */
|
|
450
954
|
maxlength: _angular_core.InputSignal<number>;
|
|
955
|
+
/**
|
|
956
|
+
* Native `pattern` attribute (a regular expression). Like `minlength`, it does
|
|
957
|
+
* not make your form control invalid; use `Validators.pattern` on the control.
|
|
958
|
+
*/
|
|
451
959
|
pattern: _angular_core.InputSignal<string>;
|
|
960
|
+
/**
|
|
961
|
+
* Turns browser spellcheck and Safari autocorrect on or off. Defaults to
|
|
962
|
+
* `true` for every type, so set `[autocorrect]="false"` on emails, passwords,
|
|
963
|
+
* phone numbers, postcodes, codes and names.
|
|
964
|
+
*/
|
|
452
965
|
autocorrect: _angular_core.InputSignal<boolean>;
|
|
966
|
+
/**
|
|
967
|
+
* Disables the input. The form control's own disabled state is not picked
|
|
968
|
+
* up, so bind this when you disable the control.
|
|
969
|
+
*/
|
|
453
970
|
disabled: _angular_core.InputSignal<boolean>;
|
|
971
|
+
/**
|
|
972
|
+
* Overrides the accessible name from `label`. Rarely needed; for
|
|
973
|
+
* `type="tel"` setting it also stops the label and digits being read out one
|
|
974
|
+
* by one.
|
|
975
|
+
*/
|
|
454
976
|
aria_label: _angular_core.InputSignal<string>;
|
|
977
|
+
/** Text of the password toggle while the password is hidden. Pass a translated string. Only used with `type="password"`. */
|
|
455
978
|
show_password_string: _angular_core.InputSignal<string>;
|
|
979
|
+
/** Text of the password toggle while the password is visible. Pass a translated string. Only used with `type="password"`. */
|
|
456
980
|
hide_password_string: _angular_core.InputSignal<string>;
|
|
981
|
+
/** Accessible name of the toggle while the password is hidden. Pass a translated string. */
|
|
457
982
|
show_password_aria_label: _angular_core.InputSignal<string>;
|
|
983
|
+
/**
|
|
984
|
+
* Accessible name of the toggle while the password is visible. Pass a
|
|
985
|
+
* translated string. The current value is appended, so screen readers read
|
|
986
|
+
* the revealed password.
|
|
987
|
+
*/
|
|
458
988
|
hide_password_aria_label: _angular_core.InputSignal<string>;
|
|
989
|
+
/** Not used: setting it has no effect. Pass error messages to the projected `<ui-form-errors>` via `error_messages`. */
|
|
459
990
|
validation_messages: _angular_core.InputSignal<ValidationErrorTypes>;
|
|
991
|
+
/** Emits the new value on every keystroke. Prefer reading the form control; use this when the field is not in a form. */
|
|
460
992
|
didChange: _angular_core.OutputEmitterRef<string>;
|
|
993
|
+
/** @ignore */
|
|
461
994
|
prefaceContent: _angular_core.Signal<ElementRef<HTMLElement>>;
|
|
995
|
+
/** @ignore */
|
|
462
996
|
protected textValue: _angular_core.WritableSignal<string>;
|
|
997
|
+
/** @ignore */
|
|
463
998
|
protected showPassword: _angular_core.WritableSignal<boolean>;
|
|
999
|
+
/** @ignore */
|
|
464
1000
|
protected inputDidChange: _angular_core.WritableSignal<boolean>;
|
|
1001
|
+
/** @ignore */
|
|
465
1002
|
protected textInputType: _angular_core.WritableSignal<TextInputType>;
|
|
1003
|
+
/** @ignore */
|
|
466
1004
|
protected hasBeenFocused: _angular_core.WritableSignal<boolean>;
|
|
1005
|
+
/** @ignore */
|
|
467
1006
|
protected id: _angular_core.WritableSignal<string>;
|
|
1007
|
+
/** @ignore */
|
|
468
1008
|
protected safariAutocorrect: _angular_core.WritableSignal<"off" | "on">;
|
|
1009
|
+
/** @ignore */
|
|
469
1010
|
hidePasswordLabel: _angular_core.Signal<string>;
|
|
1011
|
+
/** @ignore */
|
|
470
1012
|
shouldShowHint: _angular_core.Signal<boolean>;
|
|
1013
|
+
/** @ignore */
|
|
471
1014
|
ngOnInit(): void;
|
|
1015
|
+
/** @ignore */
|
|
472
1016
|
onChange: (value: string) => void;
|
|
1017
|
+
/** @ignore */
|
|
473
1018
|
onTouched: () => void;
|
|
1019
|
+
/** @ignore */
|
|
474
1020
|
writeValue(textValue: string): void;
|
|
1021
|
+
/** @ignore */
|
|
475
1022
|
registerOnChange(fn: (value: string) => void): void;
|
|
1023
|
+
/** @ignore */
|
|
476
1024
|
registerOnTouched(fn: () => void): void;
|
|
1025
|
+
/** @ignore */
|
|
477
1026
|
onModelChange(textValue: string): void;
|
|
1027
|
+
/** @ignore */
|
|
478
1028
|
onFocus(): void;
|
|
1029
|
+
/** @ignore */
|
|
479
1030
|
onBlur(): void;
|
|
1031
|
+
/** @ignore */
|
|
480
1032
|
onEnter(): void;
|
|
1033
|
+
/** @ignore */
|
|
481
1034
|
toggleShowPassword(): void;
|
|
1035
|
+
/** @ignore */
|
|
482
1036
|
accessibleAriaLabel(): string | undefined;
|
|
1037
|
+
/** @ignore */
|
|
483
1038
|
getInputMode(): string | undefined;
|
|
1039
|
+
/** @ignore */
|
|
484
1040
|
getAriaDescribedBy(): string | undefined;
|
|
485
1041
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TextInputComponent, never>;
|
|
486
1042
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TextInputComponent, "ui-text-input", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "optional": { "alias": "optional"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "inputmode": { "alias": "inputmode"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "minlength": { "alias": "minlength"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "pattern": { "alias": "pattern"; "required": false; "isSignal": true; }; "autocorrect": { "alias": "autocorrect"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "aria_label": { "alias": "aria_label"; "required": false; "isSignal": true; }; "show_password_string": { "alias": "show_password_string"; "required": false; "isSignal": true; }; "hide_password_string": { "alias": "hide_password_string"; "required": false; "isSignal": true; }; "show_password_aria_label": { "alias": "show_password_aria_label"; "required": false; "isSignal": true; }; "hide_password_aria_label": { "alias": "hide_password_aria_label"; "required": false; "isSignal": true; }; "validation_messages": { "alias": "validation_messages"; "required": false; "isSignal": true; }; }, { "didChange": "didChange"; }, never, ["[preface]", "ui-form-errors"], true, never>;
|
|
@@ -493,76 +1049,228 @@ declare class OasysTextInputModule {
|
|
|
493
1049
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<OasysTextInputModule>;
|
|
494
1050
|
}
|
|
495
1051
|
|
|
1052
|
+
/**
|
|
1053
|
+
* The Oasys multi-line text field (`<ui-textarea>`), with a floating label,
|
|
1054
|
+
* optional hint, optional character counter and inline error. Use it for free
|
|
1055
|
+
* text that can run to several lines, such as gift messages, delivery
|
|
1056
|
+
* instructions or contact-us messages. Use `<ui-text-input>` for single-line
|
|
1057
|
+
* values.
|
|
1058
|
+
*
|
|
1059
|
+
* It is a `ControlValueAccessor`: bind it with `formControlName` (or
|
|
1060
|
+
* `formControl` / `ngModel`) and put validation on the form control. Disabling
|
|
1061
|
+
* the form control disables the textarea. It renders a native `<textarea>` with
|
|
1062
|
+
* a `<label for>`, so `label` is required and is the accessible name.
|
|
1063
|
+
*
|
|
1064
|
+
* The textarea grows with its content from `min_rows` up to `max_rows`, then
|
|
1065
|
+
* scrolls. The user cannot resize it by hand.
|
|
1066
|
+
*
|
|
1067
|
+
* Accessibility and form conventions:
|
|
1068
|
+
* - Fields are optional by default. Set `[optional]="false"` on required fields
|
|
1069
|
+
* (adds the native `required` attribute). Mark optional fields in the label
|
|
1070
|
+
* text, e.g. "Delivery instructions (optional)".
|
|
1071
|
+
* - `hint` and the counter are linked with `aria-describedby`. The counter is a
|
|
1072
|
+
* polite live region.
|
|
1073
|
+
* - `char_limit` only drives the counter and a red border. It does not stop
|
|
1074
|
+
* typing or invalidate the control: add `Validators.maxLength` and a message.
|
|
1075
|
+
*
|
|
1076
|
+
* Errors: project a `<ui-form-errors>` as content. It is hidden until the
|
|
1077
|
+
* control is dirty and invalid and the user has left the field, and hides again
|
|
1078
|
+
* while they type. Once shown it is linked with `aria-describedby`.
|
|
1079
|
+
*
|
|
1080
|
+
* @import import { OasysTextareaComponent } from 'oasys-lib';
|
|
1081
|
+
* @knownIssue The inline error only appears once the control is dirty (the
|
|
1082
|
+
* user typed) and the textarea has been blurred. Submitting a form the user
|
|
1083
|
+
* never typed in shows no inline error, and `markAllAsTouched()` does not change
|
|
1084
|
+
* that. Workaround: on submit, show a `<ui-form-errors-summary>` listing the
|
|
1085
|
+
* errors; to also reveal inline errors, call `form.markAllAsDirty()` and
|
|
1086
|
+
* dispatch a `blur` event on the `<textarea>`.
|
|
1087
|
+
*/
|
|
496
1088
|
declare class TextareaComponent implements ControlValueAccessor, OnInit {
|
|
1089
|
+
/** Visible label, linked with `<label for>`. It is the accessible name. Add "(optional)" to the text for optional fields. */
|
|
497
1090
|
label: _angular_core.InputSignal<string>;
|
|
1091
|
+
/** Help text under the field, linked with `aria-describedby`. Hidden while an error is showing. */
|
|
498
1092
|
hint: _angular_core.InputSignal<string>;
|
|
1093
|
+
/** Example text shown while empty. It disappears on typing and is not a label, so never put instructions only here; use `hint`. */
|
|
499
1094
|
placeholder: _angular_core.InputSignal<string>;
|
|
1095
|
+
/** Height in rows when empty or short. The textarea grows from here as the user types. */
|
|
500
1096
|
min_rows: _angular_core.InputSignal<number>;
|
|
1097
|
+
/** Height in rows at which it stops growing and scrolls instead. Values below `min_rows` are treated as `min_rows`. */
|
|
501
1098
|
max_rows: _angular_core.InputSignal<number>;
|
|
1099
|
+
/**
|
|
1100
|
+
* Maximum characters, shown by the counter (`show_counter`). Going over turns
|
|
1101
|
+
* the border and counter red but does not stop typing or invalidate the form
|
|
1102
|
+
* control: add `Validators.maxLength` with the same value and an error message.
|
|
1103
|
+
*/
|
|
502
1104
|
char_limit: _angular_core.InputSignal<number>;
|
|
1105
|
+
/** Show a "count / limit" counter under the field. Only renders when `char_limit` is set. */
|
|
503
1106
|
show_counter: _angular_core.InputSignal<boolean>;
|
|
1107
|
+
/**
|
|
1108
|
+
* Fields are optional by default. Set `[optional]="false"` on required fields
|
|
1109
|
+
* to add the native `required` attribute. Also add `Validators.required` to the
|
|
1110
|
+
* control so the form is invalid and an error message can show.
|
|
1111
|
+
*/
|
|
504
1112
|
optional: _angular_core.InputSignal<boolean>;
|
|
1113
|
+
/** Disables the textarea. Disabling the form control works too. */
|
|
505
1114
|
disabled: _angular_core.InputSignal<boolean>;
|
|
1115
|
+
/** Shows the value but stops editing (still focusable and submitted). Use to show text the user cannot change here. */
|
|
506
1116
|
readonly: _angular_core.InputSignal<boolean>;
|
|
1117
|
+
/** Emits the new value on every keystroke. Prefer reading the form control; use this when the field is not in a form. */
|
|
507
1118
|
didChange: _angular_core.OutputEmitterRef<string>;
|
|
1119
|
+
/** @ignore */
|
|
508
1120
|
protected textareaEl: _angular_core.Signal<ElementRef<HTMLTextAreaElement>>;
|
|
1121
|
+
/** @ignore */
|
|
509
1122
|
protected textValue: _angular_core.WritableSignal<string>;
|
|
1123
|
+
/** @ignore */
|
|
510
1124
|
protected cvaDisabled: _angular_core.WritableSignal<boolean>;
|
|
1125
|
+
/** @ignore */
|
|
511
1126
|
protected inputDidChange: _angular_core.WritableSignal<boolean>;
|
|
1127
|
+
/** @ignore */
|
|
512
1128
|
protected id: _angular_core.WritableSignal<string>;
|
|
1129
|
+
/** @ignore */
|
|
513
1130
|
protected isDisabled: _angular_core.Signal<boolean>;
|
|
1131
|
+
/** @ignore */
|
|
514
1132
|
protected charCount: _angular_core.Signal<number>;
|
|
1133
|
+
/** @ignore */
|
|
515
1134
|
protected isOverLimit: _angular_core.Signal<boolean>;
|
|
1135
|
+
/** @ignore */
|
|
516
1136
|
protected counterId: _angular_core.Signal<string>;
|
|
517
1137
|
constructor();
|
|
1138
|
+
/** @ignore */
|
|
518
1139
|
ngOnInit(): void;
|
|
1140
|
+
/** @ignore */
|
|
519
1141
|
onChange: (value: string) => void;
|
|
1142
|
+
/** @ignore */
|
|
520
1143
|
onTouched: () => void;
|
|
1144
|
+
/** @ignore */
|
|
521
1145
|
writeValue(value: string): void;
|
|
1146
|
+
/** @ignore */
|
|
522
1147
|
registerOnChange(fn: (value: string) => void): void;
|
|
1148
|
+
/** @ignore */
|
|
523
1149
|
registerOnTouched(fn: () => void): void;
|
|
1150
|
+
/** @ignore */
|
|
524
1151
|
setDisabledState(isDisabled: boolean): void;
|
|
1152
|
+
/** @ignore */
|
|
525
1153
|
onModelChange(value: string): void;
|
|
1154
|
+
/** @ignore */
|
|
526
1155
|
onBlur(): void;
|
|
1156
|
+
/** @ignore */
|
|
527
1157
|
getAriaDescribedBy(): string | undefined;
|
|
528
1158
|
private autosize;
|
|
529
1159
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TextareaComponent, never>;
|
|
530
1160
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TextareaComponent, "ui-textarea", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "min_rows": { "alias": "min_rows"; "required": false; "isSignal": true; }; "max_rows": { "alias": "max_rows"; "required": false; "isSignal": true; }; "char_limit": { "alias": "char_limit"; "required": false; "isSignal": true; }; "show_counter": { "alias": "show_counter"; "required": false; "isSignal": true; }; "optional": { "alias": "optional"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; }, { "didChange": "didChange"; }, never, ["ui-form-errors"], true, never>;
|
|
531
1161
|
}
|
|
532
1162
|
|
|
1163
|
+
/**
|
|
1164
|
+
* The Oasys chip (`<ui-chip>`). A form choice styled as a bordered, tappable
|
|
1165
|
+
* pill: the radio or tick box is hidden and the whole label is the control.
|
|
1166
|
+
* Use chips for short choices laid out in a row or grid, such as delivery
|
|
1167
|
+
* slots, pause lengths or occasion types.
|
|
1168
|
+
*
|
|
1169
|
+
* `chip_type` picks the behaviour:
|
|
1170
|
+
* - `radio` (default): one choice from a set. Renders a `<ui-radio>`. Give
|
|
1171
|
+
* every chip in the set the same `name` and its own `value`; the form value
|
|
1172
|
+
* is the selected chip's `value` as a string.
|
|
1173
|
+
* - `checkbox`: an on/off choice. Renders a `<ui-checkbox>`; the form value is
|
|
1174
|
+
* a boolean.
|
|
1175
|
+
*
|
|
1176
|
+
* Chips are form inputs and belong in a form group. Wrap a set in
|
|
1177
|
+
* `<ui-form-group>` (a `<fieldset>` with a `<legend>`), and lay the chips out
|
|
1178
|
+
* with `<ui-stack>` or `<ui-grid>`. Do not add `role="chipgroup"`: it is not
|
|
1179
|
+
* an ARIA role. For a toggle outside a form, use
|
|
1180
|
+
* `<ui-button button_type="chip" aria_role="switch">` instead.
|
|
1181
|
+
*
|
|
1182
|
+
* Projected content is shown on the label line (for example a price or
|
|
1183
|
+
* "Sold out"). It is inside the `<label>`, so it is read as part of the name.
|
|
1184
|
+
*
|
|
1185
|
+
* Keyboard: radio chips behave like `<ui-radio>` (arrow keys move focus within
|
|
1186
|
+
* the same `name`, Space selects). Checkbox chips toggle with Space.
|
|
1187
|
+
*
|
|
1188
|
+
* @import import { OasysChipComponent } from 'oasys-lib';
|
|
1189
|
+
* @knownIssue Radio chips without a `name` all share the default name
|
|
1190
|
+
* (`Radio Group`), so separate sets on one page act as a single group:
|
|
1191
|
+
* selecting in one clears the others. Workaround: give each set its own
|
|
1192
|
+
* `name`.
|
|
1193
|
+
* @knownIssue Binding `[value]="true"` on a checkbox chip does not check it:
|
|
1194
|
+
* the chip's internal `ngModel` overwrites it on init. Workaround: bind the
|
|
1195
|
+
* chip to a form control (`formControlName`, `formControl` or `ngModel`) and
|
|
1196
|
+
* set that to `true`.
|
|
1197
|
+
* @knownIssue Disabling the form control (`control.disable()` or
|
|
1198
|
+
* `new FormControl({ value: '', disabled: true })`) does not disable the chip,
|
|
1199
|
+
* because the component does not implement `setDisabledState`. Workaround:
|
|
1200
|
+
* also bind `[disabled]` on each chip (Angular logs a dev-mode warning about
|
|
1201
|
+
* `disabled` on a reactive form directive; it is safe to ignore here).
|
|
1202
|
+
*/
|
|
533
1203
|
declare class ChipComponent implements ControlValueAccessor {
|
|
1204
|
+
/** `radio` for one choice from a set, `checkbox` for an on/off choice. */
|
|
534
1205
|
chip_type: _angular_core.InputSignal<"checkbox" | "radio">;
|
|
1206
|
+
/** Icon shown before the label. Decorative: the label must still say it all. */
|
|
535
1207
|
icon_name: _angular_core.InputSignal<IconNames>;
|
|
1208
|
+
/** Visible label and accessible name. Keep it short so chips fit in a row. */
|
|
536
1209
|
label: _angular_core.InputSignal<string>;
|
|
1210
|
+
/**
|
|
1211
|
+
* Disables the chip. Bind it even when using reactive forms: disabling the
|
|
1212
|
+
* form control alone does not disable the chip.
|
|
1213
|
+
*/
|
|
537
1214
|
disabled: _angular_core.InputSignal<boolean>;
|
|
1215
|
+
/**
|
|
1216
|
+
* Checkbox chips: the id of an element that describes the chip, such as an
|
|
1217
|
+
* error message. Radio chips: avoid. The id is also given to the chip's own
|
|
1218
|
+
* empty hint element, so it duplicates the id of the element you meant.
|
|
1219
|
+
*/
|
|
538
1220
|
ariaDescribedBy: _angular_core.InputSignal<string>;
|
|
1221
|
+
/**
|
|
1222
|
+
* Checkbox chips only. Sets the native `required` attribute for the error
|
|
1223
|
+
* styling; add `Validators.requiredTrue` to the form control as well.
|
|
1224
|
+
*/
|
|
539
1225
|
required: _angular_core.InputSignal<boolean>;
|
|
1226
|
+
/**
|
|
1227
|
+
* Radio chips only. Native group name: give every chip in a set the same
|
|
1228
|
+
* `name`, unique on the page.
|
|
1229
|
+
*/
|
|
540
1230
|
name: _angular_core.InputSignal<string>;
|
|
1231
|
+
/**
|
|
1232
|
+
* Radio chips: the value this chip gives the form control when selected.
|
|
1233
|
+
* Checkbox chips: holds the checked state after the user toggles it, but
|
|
1234
|
+
* binding `true` does not check the chip; set the form control's value
|
|
1235
|
+
* instead.
|
|
1236
|
+
*/
|
|
541
1237
|
value: _angular_core.ModelSignal<string | boolean>;
|
|
1238
|
+
/**
|
|
1239
|
+
* Emits on user selection: the chip's `value` for radio chips, the new checked
|
|
1240
|
+
* state for checkbox chips.
|
|
1241
|
+
*/
|
|
542
1242
|
didChange: _angular_core.OutputEmitterRef<string | boolean>;
|
|
543
1243
|
private readonly idGenerator;
|
|
1244
|
+
/** @ignore */
|
|
544
1245
|
id: _angular_core.WritableSignal<string>;
|
|
1246
|
+
/** @ignore */
|
|
545
1247
|
selectedValue: _angular_core.WritableSignal<string | boolean>;
|
|
1248
|
+
/** @ignore */
|
|
546
1249
|
onChange: (value: string | boolean) => void;
|
|
1250
|
+
/** @ignore */
|
|
547
1251
|
onTouched: () => void;
|
|
548
1252
|
/**
|
|
549
1253
|
* CVA - Write value
|
|
550
1254
|
* @param {string | boolean} value
|
|
1255
|
+
* @ignore
|
|
551
1256
|
*/
|
|
552
1257
|
writeValue(value: string | boolean): void;
|
|
553
1258
|
/**
|
|
554
1259
|
* CVA - Register on change
|
|
555
1260
|
* @param {() => void} fn
|
|
1261
|
+
* @ignore
|
|
556
1262
|
*/
|
|
557
1263
|
registerOnChange(fn: () => void): void;
|
|
558
1264
|
/**
|
|
559
1265
|
* CVA - Register on touched
|
|
560
1266
|
* @param {() => void} fn
|
|
1267
|
+
* @ignore
|
|
561
1268
|
*/
|
|
562
1269
|
registerOnTouched(fn: () => void): void;
|
|
563
1270
|
/**
|
|
564
1271
|
* On modal interaction and change
|
|
565
1272
|
* @param event
|
|
1273
|
+
* @ignore
|
|
566
1274
|
*/
|
|
567
1275
|
onModalChange(event: string | boolean): void;
|
|
568
1276
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChipComponent, never>;
|
|
@@ -576,9 +1284,37 @@ declare class OasysChipModule {
|
|
|
576
1284
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<OasysChipModule>;
|
|
577
1285
|
}
|
|
578
1286
|
|
|
1287
|
+
/**
|
|
1288
|
+
* Inline validation message for one form field (`<ui-form-errors>`). Project it
|
|
1289
|
+
* inside `<ui-text-input>`, `<ui-textarea>` or `<ui-combobox>`; the field shows
|
|
1290
|
+
* it below the input, styles the field as invalid and hides it while the user
|
|
1291
|
+
* is typing.
|
|
1292
|
+
*
|
|
1293
|
+
* Only `<ui-text-input>` and `<ui-textarea>` link the message to their input
|
|
1294
|
+
* with `aria-describedby` (once the user has left the field). `<ui-combobox>`
|
|
1295
|
+
* shows it but does not link it, so screen readers do not read it with the
|
|
1296
|
+
* field. `<ui-checkbox>` and `<ui-radio>` have no slot for it.
|
|
1297
|
+
*
|
|
1298
|
+
* Bind `errors` to the control's errors and `error_messages` to a map of
|
|
1299
|
+
* translated messages keyed by validator name (`required`, `email`,
|
|
1300
|
+
* `minlength`, `pattern`, or your custom validator's key). Only the message for
|
|
1301
|
+
* the first error key is shown, so put the most important validator first. If
|
|
1302
|
+
* that key has no message, nothing is rendered.
|
|
1303
|
+
*
|
|
1304
|
+
* Write messages that say how to fix the problem ("Enter an email address like
|
|
1305
|
+
* name@example.com"), not just that something is wrong.
|
|
1306
|
+
*
|
|
1307
|
+
* It renders plain text with no ARIA role or live region. Outside a form field
|
|
1308
|
+
* it is always visible while `errors` is set.
|
|
1309
|
+
*
|
|
1310
|
+
* @import import { OasysFormErrorsComponent } from 'oasys-lib';
|
|
1311
|
+
*/
|
|
579
1312
|
declare class FormErrorsComponent {
|
|
1313
|
+
/** The control's current errors, e.g. `form.get('email')?.errors`. `null` renders nothing. */
|
|
580
1314
|
errors: _angular_core.InputSignal<ValidationErrors>;
|
|
1315
|
+
/** Translated messages keyed by validator error key, e.g. `{ required: 'Enter your email address', email: 'Enter a valid email address' }`. */
|
|
581
1316
|
error_messages: _angular_core.InputSignal<ValidationErrorTypes>;
|
|
1317
|
+
/** @ignore */
|
|
582
1318
|
errorMessage: _angular_core.Signal<string>;
|
|
583
1319
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormErrorsComponent, never>;
|
|
584
1320
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormErrorsComponent, "ui-form-errors", never, { "errors": { "alias": "errors"; "required": false; "isSignal": true; }; "error_messages": { "alias": "error_messages"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -597,25 +1333,101 @@ type HeadingGap = 'default' | 'near' | 'tight';
|
|
|
597
1333
|
type UIBoolean = true | 'true' | false | 'false';
|
|
598
1334
|
type HeadingLevel = 'h1' | 'h2' | 'h3';
|
|
599
1335
|
|
|
1336
|
+
/**
|
|
1337
|
+
* A section or page heading (`<ui-heading>`) with an optional surtitle above
|
|
1338
|
+
* and subtitle below. Use it for headings that introduce a page or section;
|
|
1339
|
+
* for a one-off bold line inside a component, a text class such as
|
|
1340
|
+
* `text-heading--functional--secondary` on a `<p>` is enough.
|
|
1341
|
+
*
|
|
1342
|
+
* Visual style (`heading_type`) and HTML level (`heading_level`) are
|
|
1343
|
+
* independent: pick the style from the design and the level from the page
|
|
1344
|
+
* outline.
|
|
1345
|
+
* - The title renders as an `<h2>` by default. Use `h1` only for the main
|
|
1346
|
+
* title of the page, when there is no other `<h1>`. Use `h3` for a heading
|
|
1347
|
+
* inside a section that already has an `<h2>`. Don't skip levels.
|
|
1348
|
+
* - The subtitle renders as a heading one level below the title (an `<h2>`
|
|
1349
|
+
* title gets an `<h3>` subtitle), so it appears in the document outline. It
|
|
1350
|
+
* accepts simple HTML (sanitised by Angular).
|
|
1351
|
+
* - The surtitle is a plain `<p>`.
|
|
1352
|
+
*
|
|
1353
|
+
* Alignment comes from the brand: `hero`, `primary` and `secondary` headings
|
|
1354
|
+
* are centred on Bloom & Wild and Bergamotte and start-aligned on bloomon;
|
|
1355
|
+
* `functional-*` headings are start-aligned everywhere. Use
|
|
1356
|
+
* `heading_alignment_override` to force one.
|
|
1357
|
+
*
|
|
1358
|
+
* Text colour is inherited, so inside a dark `<ui-box>` that already switches
|
|
1359
|
+
* to on-dark text the heading follows. Set `heading_on_dark` when the heading
|
|
1360
|
+
* sits on a dark surface that does not, such as an image.
|
|
1361
|
+
*
|
|
1362
|
+
* @import import { OasysHeadingComponent } from 'oasys-lib';
|
|
1363
|
+
* @knownIssue The string `"false"` on `heading_on_dark` turns on-dark
|
|
1364
|
+
* (light) text on. Workaround: bind a real boolean, for example
|
|
1365
|
+
* `[heading_on_dark]="true"`, or leave the input out.
|
|
1366
|
+
* @knownIssue The heading level, alignment and spacing are worked out once,
|
|
1367
|
+
* on first render, so later changes to `heading_level`, `heading_priority`,
|
|
1368
|
+
* `heading_seo_priority`, `heading_alignment_override` or `heading_type` do
|
|
1369
|
+
* not update them. Workaround: set these inputs to their final values before
|
|
1370
|
+
* the heading renders, or re-create the heading (for example with `@if`) when
|
|
1371
|
+
* they need to change.
|
|
1372
|
+
*/
|
|
600
1373
|
declare class OasysHeadingComponent implements OnInit {
|
|
601
1374
|
private tokenService;
|
|
1375
|
+
/**
|
|
1376
|
+
* Visual style. `hero` for the largest page-top moment, `primary` for page
|
|
1377
|
+
* titles, `secondary` for section titles, `functional-primary` and
|
|
1378
|
+
* `functional-secondary` for compact UI headings such as card or form
|
|
1379
|
+
* titles. Does not change the HTML level.
|
|
1380
|
+
*/
|
|
602
1381
|
heading_type: HeadingType;
|
|
1382
|
+
/**
|
|
1383
|
+
* Use light text for a dark background. Only needed when the heading is not
|
|
1384
|
+
* inside a dark `<ui-box>` that already sets on-dark text. Bind a real
|
|
1385
|
+
* boolean: the string `"false"` turns it on.
|
|
1386
|
+
*/
|
|
603
1387
|
heading_on_dark: UIBoolean;
|
|
1388
|
+
/** The heading text. Plain text only. */
|
|
604
1389
|
heading_title: string;
|
|
1390
|
+
/** Legacy way to render an `<h1>`. Prefer `heading_level="h1"`. */
|
|
605
1391
|
heading_seo_priority: boolean;
|
|
1392
|
+
/**
|
|
1393
|
+
* Legacy numeric level (1 to 6). Prefer `heading_level`; only use this for
|
|
1394
|
+
* `h4` to `h6`, which `heading_level` does not offer. `heading_level` wins
|
|
1395
|
+
* when both are set.
|
|
1396
|
+
*/
|
|
606
1397
|
heading_priority?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
1398
|
+
/** Force `start` or `center` alignment instead of the brand default for this `heading_type`. */
|
|
607
1399
|
heading_alignment_override?: HeadingAlignment;
|
|
1400
|
+
/**
|
|
1401
|
+
* Supporting text below the title. Rendered as a heading one level below the
|
|
1402
|
+
* title (a `<p>` under an `<h6>`). Accepts simple HTML such as links or a
|
|
1403
|
+
* list (sanitised by Angular).
|
|
1404
|
+
*/
|
|
608
1405
|
heading_subtitle?: string;
|
|
1406
|
+
/** Small text above the title, such as a category or eyebrow label. Rendered as a `<p>`. */
|
|
609
1407
|
heading_surtitle?: string;
|
|
1408
|
+
/**
|
|
1409
|
+
* HTML level of the title: `h2` by default. Use `h1` only for the page's
|
|
1410
|
+
* main title and `h3` under an existing `<h2>`. Takes precedence over
|
|
1411
|
+
* `heading_priority` and `heading_seo_priority`.
|
|
1412
|
+
*/
|
|
610
1413
|
heading_level?: HeadingLevel;
|
|
1414
|
+
/** @ignore */
|
|
611
1415
|
computed_heading_level: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
1416
|
+
/** @ignore */
|
|
612
1417
|
headingAlignment: HeadingAlignment;
|
|
1418
|
+
/** @ignore */
|
|
613
1419
|
headingGap: HeadingGap;
|
|
1420
|
+
/** @ignore */
|
|
614
1421
|
get class(): string;
|
|
1422
|
+
/** @ignore */
|
|
615
1423
|
setComputedHeadingLevel(): void;
|
|
1424
|
+
/** @ignore */
|
|
616
1425
|
headingTypeIsFunctional(headingType: HeadingType): boolean;
|
|
1426
|
+
/** @ignore */
|
|
617
1427
|
setupHeadingStackAlignment(headingType: HeadingType): void;
|
|
1428
|
+
/** @ignore */
|
|
618
1429
|
setupHeadingStackGap(headingType: HeadingType): void;
|
|
1430
|
+
/** @ignore */
|
|
619
1431
|
ngOnInit(): void;
|
|
620
1432
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysHeadingComponent, never>;
|
|
621
1433
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OasysHeadingComponent, "ui-heading", never, { "heading_type": { "alias": "heading_type"; "required": false; }; "heading_on_dark": { "alias": "heading_on_dark"; "required": false; }; "heading_title": { "alias": "heading_title"; "required": false; }; "heading_seo_priority": { "alias": "heading_seo_priority"; "required": false; }; "heading_priority": { "alias": "heading_priority"; "required": false; }; "heading_alignment_override": { "alias": "heading_alignment_override"; "required": false; }; "heading_subtitle": { "alias": "heading_subtitle"; "required": false; }; "heading_surtitle": { "alias": "heading_surtitle"; "required": false; }; "heading_level": { "alias": "heading_level"; "required": false; }; }, {}, never, never, true, never>;
|
|
@@ -659,31 +1471,126 @@ interface LayoutContainerSizes {
|
|
|
659
1471
|
}
|
|
660
1472
|
type LayoutDeviceCollapse = 'tablet' | 'laptop' | 'desktop' | 'none';
|
|
661
1473
|
|
|
1474
|
+
/**
|
|
1475
|
+
* A page or section hero (`<ui-hero>`): a heading block with up to two CTAs
|
|
1476
|
+
* on one side and a large image (or projected video) on the other. Use it at
|
|
1477
|
+
* the top of landing and campaign pages, usually driven by CMS content.
|
|
1478
|
+
*
|
|
1479
|
+
* Layout: a 5/7 two-column grid that collapses to one column below tablet.
|
|
1480
|
+
* Text sits left and media right by default (`image_left_desktop` swaps them);
|
|
1481
|
+
* on mobile the image sits on top by default (`image_top_mobile`).
|
|
1482
|
+
*
|
|
1483
|
+
* Content:
|
|
1484
|
+
* - The heading block is an `<ui-heading>` built from `heading_surtitle`,
|
|
1485
|
+
* `heading_title` and `heading_subtitle`. `heading_subtitle` is rendered as
|
|
1486
|
+
* HTML and as a heading one level below the title.
|
|
1487
|
+
* - CTAs are `<ui-button>` links: the primary shows when `primary_cta_text`
|
|
1488
|
+
* is set, the secondary only when both CTA texts are set. Always set the
|
|
1489
|
+
* matching `href_*` too; the hero has no click output.
|
|
1490
|
+
* - `media_type="video"` hides the image and projects your content into the
|
|
1491
|
+
* media column instead.
|
|
1492
|
+
* - The image is a native `<picture>` with Contentful-style query parameters
|
|
1493
|
+
* (`?w=&h=&fm=webp&q=`) appended to `image`, not `<ui-image>`. Pass a bare
|
|
1494
|
+
* image URL without its own query string. It loads with high fetch priority.
|
|
1495
|
+
*
|
|
1496
|
+
* Accessibility:
|
|
1497
|
+
* - The title is an `h1` by default. Keep it only when the hero is the top of
|
|
1498
|
+
* the page and nothing else on the page is an `h1`. Use `h2` when the hero
|
|
1499
|
+
* titles a section under an existing `h1`, and `h3` under an `h2`.
|
|
1500
|
+
* - Set `alt_text` for the image; use `''` only when the image is purely
|
|
1501
|
+
* decorative. See [W3C guidance on informative images](https://www.w3.org/WAI/tutorials/images/informative/).
|
|
1502
|
+
* - On a dark brand background, text and buttons switch to their on-dark
|
|
1503
|
+
* styles automatically. With `non_brand_background_colour` they do not:
|
|
1504
|
+
* set `text_on_dark_override="true"` for dark custom colours.
|
|
1505
|
+
*
|
|
1506
|
+
* Requires a `ROUTING_HANDLER` (the CTAs are links).
|
|
1507
|
+
*
|
|
1508
|
+
* @import import { OasysHeroComponent } from 'oasys-lib';
|
|
1509
|
+
* @knownIssue When `alt_text` is not set, the hero image renders with no `alt`
|
|
1510
|
+
* attribute at all, so screen readers may announce the file name. Workaround:
|
|
1511
|
+
* always set `alt_text`, using `alt_text=""` for a purely decorative image.
|
|
1512
|
+
* @knownIssue A CTA whose `href_primary_cta` / `href_secondary_cta` is empty
|
|
1513
|
+
* renders as a `<button>` that does nothing, because the hero has no click
|
|
1514
|
+
* output. Workaround: only set `primary_cta_text` / `secondary_cta_text` when
|
|
1515
|
+
* you also set the matching href.
|
|
1516
|
+
* @knownIssue `non_brand_background_colour` is applied once, after the first
|
|
1517
|
+
* render; later changes are ignored. Workaround: set it once up front, or
|
|
1518
|
+
* re-create the hero (for example with `@if`) when the colour changes.
|
|
1519
|
+
*/
|
|
662
1520
|
declare class HeroComponent implements OnInit, AfterViewInit {
|
|
663
1521
|
private tokenService;
|
|
1522
|
+
/** @ignore */
|
|
664
1523
|
herobox: ElementRef;
|
|
1524
|
+
/** Minimum height of the hero in pixels. Unset lets the content decide. */
|
|
665
1525
|
min_container_height: number;
|
|
1526
|
+
/** Put the media on the left and the text on the right from tablet up. */
|
|
666
1527
|
image_left_desktop: boolean;
|
|
1528
|
+
/** On mobile (single column), show the media above the text. */
|
|
667
1529
|
image_top_mobile: boolean;
|
|
1530
|
+
/**
|
|
1531
|
+
* Brand background for the whole hero. Dark backgrounds automatically switch
|
|
1532
|
+
* the heading and CTAs to their on-dark styles.
|
|
1533
|
+
*/
|
|
668
1534
|
background_colour: LayoutBackgrounds;
|
|
1535
|
+
/**
|
|
1536
|
+
* Any CSS colour, applied as an inline background over `background_colour`.
|
|
1537
|
+
* For content-authored colours that are not in the brand palette. Text does
|
|
1538
|
+
* not adapt: pair a dark colour with `text_on_dark_override="true"`. Read
|
|
1539
|
+
* once after the first render.
|
|
1540
|
+
*/
|
|
669
1541
|
non_brand_background_colour: string;
|
|
1542
|
+
/** The hero title. Rendered at `heading_level`. */
|
|
670
1543
|
heading_title: string;
|
|
1544
|
+
/**
|
|
1545
|
+
* Supporting copy under the title. Rendered as HTML, as a heading one level
|
|
1546
|
+
* below the title (an `h2` under the default `h1`).
|
|
1547
|
+
*/
|
|
671
1548
|
heading_subtitle: string;
|
|
1549
|
+
/** Short eyebrow text above the title, such as "New season". */
|
|
672
1550
|
heading_surtitle: string;
|
|
1551
|
+
/** Label of the primary CTA. The CTA (and the secondary one) only renders when this is set. */
|
|
673
1552
|
primary_cta_text: string;
|
|
1553
|
+
/** Label of the secondary CTA. Ignored unless `primary_cta_text` is also set. */
|
|
674
1554
|
secondary_cta_text: string;
|
|
1555
|
+
/**
|
|
1556
|
+
* Image URL, without its own query string: width, height, format and quality
|
|
1557
|
+
* parameters are appended for each breakpoint. Used when `media_type` is `image`.
|
|
1558
|
+
*/
|
|
675
1559
|
image: string;
|
|
1560
|
+
/** Alt text for the image. Always set it; use `''` only for a purely decorative image. */
|
|
676
1561
|
alt_text: string;
|
|
1562
|
+
/**
|
|
1563
|
+
* `image` renders `image`. `video` renders nothing itself: project the video
|
|
1564
|
+
* (with its own accessible controls and text alternative) as content.
|
|
1565
|
+
*/
|
|
677
1566
|
media_type: 'image' | 'video';
|
|
1567
|
+
/**
|
|
1568
|
+
* Set to the string `'true'` to force on-dark text and inverse CTAs, for
|
|
1569
|
+
* dark `non_brand_background_colour` values. Any other value, including the
|
|
1570
|
+
* boolean `true`, is ignored.
|
|
1571
|
+
*/
|
|
678
1572
|
text_on_dark_override: string;
|
|
1573
|
+
/**
|
|
1574
|
+
* Heading level of the title; the subtitle takes the next level down. Keep
|
|
1575
|
+
* `h1` only when the hero is the top of the page and there is no other `h1`.
|
|
1576
|
+
* Use `h2` under an existing `h1`, `h3` under an `h2`.
|
|
1577
|
+
*/
|
|
679
1578
|
heading_level: HeadingLevel;
|
|
1579
|
+
/** Destination of the primary CTA. Required whenever `primary_cta_text` is set. */
|
|
680
1580
|
href_primary_cta: string;
|
|
1581
|
+
/** Destination of the secondary CTA. Required whenever `secondary_cta_text` is set. */
|
|
681
1582
|
href_secondary_cta: string;
|
|
1583
|
+
/** @ignore */
|
|
682
1584
|
heroCtaAlignment: LayoutAlignment;
|
|
1585
|
+
/** @ignore */
|
|
683
1586
|
heroInsetSpaceSmall: string;
|
|
1587
|
+
/** @ignore */
|
|
684
1588
|
heroInsetSpaceLarge: string;
|
|
1589
|
+
/** @ignore */
|
|
685
1590
|
setNonBrandBackgroundColour(): void;
|
|
1591
|
+
/** @ignore */
|
|
686
1592
|
ngAfterViewInit(): void;
|
|
1593
|
+
/** @ignore */
|
|
687
1594
|
ngOnInit(): void;
|
|
688
1595
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HeroComponent, never>;
|
|
689
1596
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HeroComponent, "ui-hero", never, { "min_container_height": { "alias": "min_container_height"; "required": false; }; "image_left_desktop": { "alias": "image_left_desktop"; "required": false; }; "image_top_mobile": { "alias": "image_top_mobile"; "required": false; }; "background_colour": { "alias": "background_colour"; "required": false; }; "non_brand_background_colour": { "alias": "non_brand_background_colour"; "required": false; }; "heading_title": { "alias": "heading_title"; "required": false; }; "heading_subtitle": { "alias": "heading_subtitle"; "required": false; }; "heading_surtitle": { "alias": "heading_surtitle"; "required": false; }; "primary_cta_text": { "alias": "primary_cta_text"; "required": false; }; "secondary_cta_text": { "alias": "secondary_cta_text"; "required": false; }; "image": { "alias": "image"; "required": false; }; "alt_text": { "alias": "alt_text"; "required": false; }; "media_type": { "alias": "media_type"; "required": false; }; "text_on_dark_override": { "alias": "text_on_dark_override"; "required": false; }; "heading_level": { "alias": "heading_level"; "required": false; }; "href_primary_cta": { "alias": "href_primary_cta"; "required": false; }; "href_secondary_cta": { "alias": "href_secondary_cta"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
@@ -696,21 +1603,94 @@ declare class OasysHeroModule {
|
|
|
696
1603
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<OasysHeroModule>;
|
|
697
1604
|
}
|
|
698
1605
|
|
|
1606
|
+
/**
|
|
1607
|
+
* A single-colour icon from the brand's icon sprite (`<ui-icon>`). Use it next
|
|
1608
|
+
* to text or inside your own layouts. For an icon on a button, use
|
|
1609
|
+
* `<ui-button button_icon="...">` instead of placing `<ui-icon>` in a button.
|
|
1610
|
+
* For full-colour artwork such as payment provider badges, use `<ui-logo>`.
|
|
1611
|
+
*
|
|
1612
|
+
* Renders an inline `<svg>` that references
|
|
1613
|
+
* `./<brand>/assets/icons/icons.svg#icon-<icon_name>`, so each brand gets its
|
|
1614
|
+
* own artwork for the same name. The consuming app must:
|
|
1615
|
+
* - serve the sprite at `<brand-slug>/assets/icons/icons.svg` relative to the
|
|
1616
|
+
* document base URL (copy it from `oasys-lib/src/assets/<brand>/icons`);
|
|
1617
|
+
* - have an element with a `brand-tokens-<brand>` class on the page (usually
|
|
1618
|
+
* `<body>`). The brand is read from the first such element; until one
|
|
1619
|
+
* exists the icon renders nothing.
|
|
1620
|
+
*
|
|
1621
|
+
* Colour: the icon is filled with `currentColor`, so it takes the text colour
|
|
1622
|
+
* of its parent. Set the colour on a wrapper (for example a `text-color--*`
|
|
1623
|
+
* class); never assume the inherited colour is the one in the design.
|
|
1624
|
+
*
|
|
1625
|
+
* Size: 2rem square by default (20px with the 62.5% root font size). Use
|
|
1626
|
+
* `icon_size_override` with a rem value to change it; `icon_size` does not
|
|
1627
|
+
* change the size.
|
|
1628
|
+
*
|
|
1629
|
+
* Accessibility: icons are decorative by default (`role="presentation"`),
|
|
1630
|
+
* which is right when visible text next to the icon already says the same
|
|
1631
|
+
* thing. When the icon is the only thing conveying meaning, add visually
|
|
1632
|
+
* hidden text next to it (`<span class="visually-hidden">`), or put the name on
|
|
1633
|
+
* the interactive element that contains it (for example `aria_label` on an
|
|
1634
|
+
* icon-only `<ui-button>`). Describe the purpose, not the picture:
|
|
1635
|
+
* https://www.w3.org/WAI/tutorials/images/functional/
|
|
1636
|
+
*
|
|
1637
|
+
* @import import { OasysIconComponent } from 'oasys-lib';
|
|
1638
|
+
* @knownIssue `icon_size` does not change the icon's size: it only adds an
|
|
1639
|
+
* `icon-size-*` class that no stylesheet uses. Workaround: set
|
|
1640
|
+
* `icon_size_override` to a rem value, for example `icon_size_override="1.6rem"`.
|
|
1641
|
+
* @knownIssue `icon_size_override` is always read as rem: `"24px"` renders a
|
|
1642
|
+
* 240px icon (24 x the root font size). Workaround: only pass rem values.
|
|
1643
|
+
* @knownIssue `alt_text` does not give the icon an accessible name: it sets
|
|
1644
|
+
* `role="img"` and an `alt` attribute, which SVG ignores, so screen readers
|
|
1645
|
+
* announce an unnamed image. Workaround: leave `alt_text` empty and add
|
|
1646
|
+
* `<span class="visually-hidden">` text next to the icon, or label the
|
|
1647
|
+
* surrounding control.
|
|
1648
|
+
* @knownIssue On bloomon, `gift`, `greeting-card`, `logomark` and
|
|
1649
|
+
* `loyalty-vip` render nothing because they are missing from the bloomon
|
|
1650
|
+
* sprite. Workaround: do not use these names on bloomon; check the Icon Gallery
|
|
1651
|
+
* story (Media Visual) under the bloomon theme.
|
|
1652
|
+
*/
|
|
699
1653
|
declare class IconComponent implements OnInit, OnChanges {
|
|
700
1654
|
private document;
|
|
701
1655
|
private tokenService;
|
|
1656
|
+
/**
|
|
1657
|
+
* Has no visual effect: it only adds an `icon-size-small` / `icon-size-large`
|
|
1658
|
+
* class. Use `icon_size_override` to resize.
|
|
1659
|
+
*/
|
|
702
1660
|
icon_size: 'small' | 'large';
|
|
1661
|
+
/**
|
|
1662
|
+
* Width and height of the icon, in rem (for example `"1.6rem"`). Defaults to
|
|
1663
|
+
* the `--oasys-size-unit-20` token (2rem). Other units are misread as rem.
|
|
1664
|
+
*/
|
|
703
1665
|
icon_size_override?: string;
|
|
1666
|
+
/** Which icon to show. Browse them all in the Icon Gallery story (Media Visual). */
|
|
704
1667
|
icon_name: IconNames;
|
|
1668
|
+
/**
|
|
1669
|
+
* Where the icon sits relative to text. Only adds an `icon-context-*` class
|
|
1670
|
+
* on the wrapper; it changes nothing visually or for accessibility.
|
|
1671
|
+
*/
|
|
705
1672
|
icon_context: IconContext;
|
|
1673
|
+
/**
|
|
1674
|
+
* Intended to make the icon meaningful, but it does not currently give the
|
|
1675
|
+
* icon an accessible name (see Known issues). Leave empty and use visually
|
|
1676
|
+
* hidden text or a label on the surrounding control instead.
|
|
1677
|
+
*/
|
|
706
1678
|
alt_text: string;
|
|
1679
|
+
/** Class(es) added to the `<svg>`, for one-off styling hooks. */
|
|
707
1680
|
icon_class?: string;
|
|
1681
|
+
/** @ignore */
|
|
708
1682
|
size?: string;
|
|
1683
|
+
/** @ignore */
|
|
709
1684
|
iconDisplayClasses: string[];
|
|
1685
|
+
/** @ignore */
|
|
710
1686
|
iconSizeInPixels: number;
|
|
1687
|
+
/** @ignore */
|
|
711
1688
|
iconPath: string;
|
|
1689
|
+
/** @ignore */
|
|
712
1690
|
getSizeInPixels(size: string): number;
|
|
1691
|
+
/** @ignore */
|
|
713
1692
|
ngOnChanges(): void;
|
|
1693
|
+
/** @ignore */
|
|
714
1694
|
ngOnInit(): void;
|
|
715
1695
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<IconComponent, never>;
|
|
716
1696
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<IconComponent, "ui-icon", never, { "icon_size": { "alias": "icon_size"; "required": false; }; "icon_size_override": { "alias": "icon_size_override"; "required": false; }; "icon_name": { "alias": "icon_name"; "required": false; }; "icon_context": { "alias": "icon_context"; "required": false; }; "alt_text": { "alias": "alt_text"; "required": false; }; "icon_class": { "alias": "icon_class"; "required": false; }; }, {}, never, never, true, never>;
|
|
@@ -750,38 +1730,107 @@ interface UIImage extends ImageUrlResponse {
|
|
|
750
1730
|
}
|
|
751
1731
|
|
|
752
1732
|
/**
|
|
753
|
-
*
|
|
754
|
-
*
|
|
1733
|
+
* A responsive image (`<ui-image>`). Use it for every content image (product
|
|
1734
|
+
* shots, banners, editorial images) instead of a bare `<img>`, so images get a
|
|
1735
|
+
* CDN `srcset`, lazy loading and reserved space by default.
|
|
1736
|
+
*
|
|
1737
|
+
* Renders a `<picture>` with a WebP `<source srcset>` and an `<img>` fallback.
|
|
1738
|
+
* The host is a block that fills its container's width; height follows the
|
|
1739
|
+
* image unless `image_fill` is set.
|
|
755
1740
|
*
|
|
756
|
-
*
|
|
757
|
-
*
|
|
1741
|
+
* Requires `IMAGE_URL_PROVIDER` from the consuming app: its
|
|
1742
|
+
* `generateImageUrl(src, breakpoints, fallbackBreakpoint)` returns the WebP
|
|
1743
|
+
* `srcSetUrls` and a `fallbackUrl` for your image CDN. Without it the component
|
|
1744
|
+
* throws a `NullInjectorError`. Breakpoint widths come from
|
|
1745
|
+
* `IMAGE_BREAKPOINTS`, which you can override.
|
|
1746
|
+
*
|
|
1747
|
+
* Accessibility: images are decorative by default (`alt=""` and
|
|
1748
|
+
* `role="presentation"`). Set `image_alt_text` whenever the image conveys
|
|
1749
|
+
* something the surrounding text does not, for example a product photo with
|
|
1750
|
+
* no visible product name. Use the W3C alt decision tree when unsure:
|
|
1751
|
+
* https://www.w3.org/WAI/tutorials/images/decision-tree/
|
|
1752
|
+
*
|
|
1753
|
+
* Performance (Core Web Vitals):
|
|
1754
|
+
* - Set `preload_aspect_ratio` so space is reserved before the image loads
|
|
1755
|
+
* (prevents layout shift).
|
|
1756
|
+
* - Images lazy-load by default. For the largest image in the first viewport
|
|
1757
|
+
* (the LCP image, such as a hero or the first product), set
|
|
1758
|
+
* `fetchpriority="high"`, which also loads it eagerly. Use it on one or two
|
|
1759
|
+
* images per page at most.
|
|
1760
|
+
* - Tell the browser how wide the image renders with `image_width` (fixed
|
|
1761
|
+
* pixel width) or `image_sizes` (a `sizes` value), so it downloads the right
|
|
1762
|
+
* file. Without either it assumes full viewport width (`100vw`).
|
|
1763
|
+
*
|
|
1764
|
+
* @import import { OasysImageComponent } from 'oasys-lib';
|
|
758
1765
|
*/
|
|
759
1766
|
declare class ImageComponent implements OnInit, OnChanges {
|
|
1767
|
+
/** Source image URL or path. Passed to `IMAGE_URL_PROVIDER` to build the `srcset`. */
|
|
760
1768
|
image_src: string;
|
|
1769
|
+
/**
|
|
1770
|
+
* Alternative text. Leave empty (the default) for decorative images, which
|
|
1771
|
+
* are then hidden from assistive technology. Set it when the image conveys
|
|
1772
|
+
* information; describe what matters in context, not "image of".
|
|
1773
|
+
*/
|
|
761
1774
|
image_alt_text: string;
|
|
1775
|
+
/**
|
|
1776
|
+
* `id` of an element that describes the image in more detail, such as a
|
|
1777
|
+
* caption. Sets `aria-describedby` on the `<img>`.
|
|
1778
|
+
*/
|
|
762
1779
|
image_aria_describedby: string | null;
|
|
1780
|
+
/**
|
|
1781
|
+
* Fill the parent's width and height, cropping with `object-fit: cover`. The
|
|
1782
|
+
* parent must have a height. Use for background-style and fixed-size tiles.
|
|
1783
|
+
*/
|
|
763
1784
|
image_fill: boolean;
|
|
1785
|
+
/**
|
|
1786
|
+
* Download priority hint. Use `high` for the LCP image only (it also forces
|
|
1787
|
+
* eager loading), `low` for images that matter least, such as later carousel
|
|
1788
|
+
* slides.
|
|
1789
|
+
*/
|
|
764
1790
|
fetchpriority: ImageFetchPriority;
|
|
1791
|
+
/**
|
|
1792
|
+
* Native `loading`. Keep `lazy` for images below the fold. Ignored when
|
|
1793
|
+
* `fetchpriority` is `high`, which always loads eagerly.
|
|
1794
|
+
*/
|
|
765
1795
|
loading: ImageLoading;
|
|
1796
|
+
/**
|
|
1797
|
+
* Intrinsic aspect ratio (width:height). Sets `width`/`height` and
|
|
1798
|
+
* `aspect-ratio` on the `<img>` so space is reserved before it loads,
|
|
1799
|
+
* avoiding layout shift. Strongly recommended; match the image's real ratio.
|
|
1800
|
+
*/
|
|
766
1801
|
preload_aspect_ratio: ImageAspectRatio | null;
|
|
1802
|
+
/**
|
|
1803
|
+
* Rendered width in px, when it is fixed and known. Sets `sizes` to that
|
|
1804
|
+
* width so the browser picks a smaller file. It does not size the element.
|
|
1805
|
+
*/
|
|
767
1806
|
image_width: number | null;
|
|
1807
|
+
/**
|
|
1808
|
+
* `sizes` value used when `image_width` is not set, for example
|
|
1809
|
+
* `"(min-width: 768px) 50vw, 100vw"`. Defaults to `100vw`.
|
|
1810
|
+
*/
|
|
768
1811
|
image_sizes: string | null;
|
|
1812
|
+
/** Emitted when the `<img>` finishes loading. */
|
|
769
1813
|
readonly image_loaded: EventEmitter<void>;
|
|
770
1814
|
private readonly imageUrlProvider;
|
|
1815
|
+
/** @ignore */
|
|
771
1816
|
readonly image: _angular_core.WritableSignal<UIImage>;
|
|
772
1817
|
private readonly breakpoints;
|
|
773
1818
|
private readonly fallbackBreakpoint;
|
|
1819
|
+
/** @ignore */
|
|
774
1820
|
get class(): string;
|
|
775
1821
|
/**
|
|
776
1822
|
* On init lifecycle hook to create the image.
|
|
1823
|
+
* @ignore
|
|
777
1824
|
*/
|
|
778
1825
|
ngOnInit(): void;
|
|
779
1826
|
/**
|
|
780
1827
|
* On changes, handle any changes in input properties.
|
|
1828
|
+
* @ignore
|
|
781
1829
|
*/
|
|
782
1830
|
ngOnChanges(changes: SimpleChanges): void;
|
|
783
1831
|
/**
|
|
784
1832
|
* Creates the image object with the provided properties.
|
|
1833
|
+
* @ignore
|
|
785
1834
|
*/
|
|
786
1835
|
createImage(): void;
|
|
787
1836
|
private resolveLoading;
|
|
@@ -807,112 +1856,409 @@ type BoxBorderWidth = 'none' | 'primary' | 'prominent';
|
|
|
807
1856
|
type BoxBorderStyle = 'solid' | 'dashed';
|
|
808
1857
|
type BoxBorderRadius = BoxBorderRadiusBrand | BoxBorderRadiusRewards;
|
|
809
1858
|
|
|
1859
|
+
/**
|
|
1860
|
+
* A padded block with an optional background, border and radius
|
|
1861
|
+
* (`<ui-box>`). Reach for it whenever you would otherwise write `padding`,
|
|
1862
|
+
* `background-color`, `border` or `border-radius` in SCSS.
|
|
1863
|
+
*
|
|
1864
|
+
* Renders `<ui-box>` (a flex column) wrapping your content in a single
|
|
1865
|
+
* `<div class="ui-box-content">`. Pair it with the other layout primitives:
|
|
1866
|
+
* `<ui-stack>` for spacing between children, `<ui-grid>` for columns and
|
|
1867
|
+
* `<ui-container>` for page width and gutters.
|
|
1868
|
+
*
|
|
1869
|
+
* Things to know:
|
|
1870
|
+
* - The background defaults to `primary` (white on Bloom & Wild), so a box
|
|
1871
|
+
* always paints one. Use `box_background="transparent"` for boxes that only
|
|
1872
|
+
* add padding, especially boxes nested inside another box.
|
|
1873
|
+
* - By default the content is capped at the desktop content width and centred.
|
|
1874
|
+
* Set `[box_content_fill_width]="true"` for cards, rows and full-bleed
|
|
1875
|
+
* backgrounds so the content uses the box's full width.
|
|
1876
|
+
* - Multi-section cards: use one outer box for the shared border and radius
|
|
1877
|
+
* (`box_space="none"`), and inner transparent boxes, without borders, for
|
|
1878
|
+
* each section's padding. Two adjacent bordered boxes draw a double border.
|
|
1879
|
+
* - Text switches to the on-dark colour automatically on dark backgrounds that
|
|
1880
|
+
* have a brand token for it; `box_text_on_dark` overrides that.
|
|
1881
|
+
* - Spacing values are brand tokens: `near` and `default` are larger on
|
|
1882
|
+
* bloomon than on Bloom & Wild.
|
|
1883
|
+
*
|
|
1884
|
+
* @import import { OasysLayoutBoxComponent } from 'oasys-lib';
|
|
1885
|
+
* @knownIssue Automatic on-dark text only works for the deprecated background
|
|
1886
|
+
* names (`core-*`, `tint-highlight`) and `rewards-*`: the current names
|
|
1887
|
+
* `tertiary` and `quaternary` have no on-dark token, so text stays dark on a
|
|
1888
|
+
* dark background (e.g. `quaternary` on every brand, `tertiary` on Bloom &
|
|
1889
|
+
* Wild). Workaround: for dark backgrounds use the matching deprecated name
|
|
1890
|
+
* (`core-tertiary`, `core-quaternary`), which renders the same colour and
|
|
1891
|
+
* switches the text per brand; or force it with `[box_text_on_dark]="true"`.
|
|
1892
|
+
* @knownIssue `box_border_color="rewards-primary"` and
|
|
1893
|
+
* `"rewards-primary-on-dark"` have no styles, so the border falls back to the
|
|
1894
|
+
* text colour. Workaround: use `primary` / `primary-on-dark`, or set
|
|
1895
|
+
* `border-color: var(--oasys-color-rewards-border-primary)` in the component's
|
|
1896
|
+
* SCSS.
|
|
1897
|
+
* @knownIssue `box_align_x` has no visible effect: the content wrapper always
|
|
1898
|
+
* fills the box's width (and with `box_fill_mode="fit"` the box shrinks to its
|
|
1899
|
+
* content), so `center` and `end` never move anything. Workaround: wrap the
|
|
1900
|
+
* children in `<ui-stack stack_align="center">` (or `end`), or use a text
|
|
1901
|
+
* alignment class for text.
|
|
1902
|
+
*/
|
|
810
1903
|
declare class LayoutBoxComponent implements OnInit, OnChanges {
|
|
1904
|
+
/**
|
|
1905
|
+
* Padding on all four sides. `none` for a box that only adds a background or
|
|
1906
|
+
* border; `gutter` matches the page container's gutter. Pass an object to
|
|
1907
|
+
* vary it by screen size, e.g.
|
|
1908
|
+
* `[box_space]="{ mobile: 'near', tablet: 'default', laptop: 'expanded', desktop: 'expanded' }"`:
|
|
1909
|
+
* give every device key, because a size you leave out gets no padding.
|
|
1910
|
+
*/
|
|
811
1911
|
box_space?: LayoutBoxSizes;
|
|
1912
|
+
/**
|
|
1913
|
+
* ARIA role for the inner content wrapper (not the `<ui-box>` element
|
|
1914
|
+
* itself). Leave unset unless the content needs a landmark or other role.
|
|
1915
|
+
*/
|
|
812
1916
|
box_role?: string | undefined;
|
|
1917
|
+
/** Overrides the top padding from `box_space`. Accepts the same values, including a per-device object. */
|
|
813
1918
|
box_space_top?: LayoutBoxSizes;
|
|
1919
|
+
/** Overrides the right padding from `box_space`. Accepts the same values, including a per-device object. */
|
|
814
1920
|
box_space_right?: LayoutBoxSizes;
|
|
1921
|
+
/** Overrides the bottom padding from `box_space`. Accepts the same values, including a per-device object. */
|
|
815
1922
|
box_space_bottom?: LayoutBoxSizes;
|
|
1923
|
+
/** Overrides the left padding from `box_space`. Accepts the same values, including a per-device object. */
|
|
816
1924
|
box_space_left?: LayoutBoxSizes;
|
|
1925
|
+
/**
|
|
1926
|
+
* Horizontal alignment of the content wrapper. Currently has no visible effect
|
|
1927
|
+
* (see Known issues): to centre the children, wrap them in
|
|
1928
|
+
* `<ui-stack stack_align="center">`.
|
|
1929
|
+
*/
|
|
817
1930
|
box_align_x?: LayoutAlignment;
|
|
1931
|
+
/**
|
|
1932
|
+
* Vertical alignment of the content when the box is taller than it, e.g.
|
|
1933
|
+
* `center` in a grid row of equal-height boxes.
|
|
1934
|
+
*/
|
|
818
1935
|
box_align_y?: LayoutAlignment;
|
|
1936
|
+
/**
|
|
1937
|
+
* How the box sizes itself: `fill` (default) takes the full width of its
|
|
1938
|
+
* parent (and its height, where the parent has one), `fit` shrinks to its content's width (badges, chips inside
|
|
1939
|
+
* a stack), `cover` fills the parent and stretches the content to match.
|
|
1940
|
+
*/
|
|
819
1941
|
box_fill_mode?: LayoutFillModes;
|
|
1942
|
+
/**
|
|
1943
|
+
* Background colour from the brand palette. `transparent` for padding-only
|
|
1944
|
+
* boxes. Prefer `primary`–`quaternary`, `highlight` and `rewards-*`; the
|
|
1945
|
+
* `core-*` and `tint-highlight` names are deprecated aliases (but see the
|
|
1946
|
+
* known issue about on-dark text).
|
|
1947
|
+
*/
|
|
820
1948
|
box_background: LayoutBackgroundsDeprecated | LayoutBackgrounds;
|
|
821
|
-
/**
|
|
1949
|
+
/**
|
|
1950
|
+
* Forces on-dark (`true`) or on-light (`false`) text colour. Leave unset to
|
|
1951
|
+
* follow the brand token for `box_background`.
|
|
1952
|
+
*/
|
|
822
1953
|
box_text_on_dark: boolean | undefined;
|
|
1954
|
+
/**
|
|
1955
|
+
* Let the content use the box's full width. Without it the content is capped
|
|
1956
|
+
* at the desktop content width and centred, which suits page-level bands but
|
|
1957
|
+
* not cards or rows. Bind a boolean: `[box_content_fill_width]="true"`.
|
|
1958
|
+
*/
|
|
823
1959
|
box_content_fill_width: boolean;
|
|
1960
|
+
/**
|
|
1961
|
+
* Border colour. `selectable` / `selected` for choice cards, `secondary` for
|
|
1962
|
+
* subtle dividers, `primary-on-dark` on dark backgrounds. Only visible when
|
|
1963
|
+
* `box_border_width` is set.
|
|
1964
|
+
*/
|
|
824
1965
|
box_border_color?: BoxBorderColor;
|
|
1966
|
+
/** Border width. `none` (default) hides the border; `prominent` for selected states. */
|
|
825
1967
|
box_border_width?: BoxBorderWidth;
|
|
1968
|
+
/** Border style; `dashed` for placeholder or drop areas. Only visible with `box_border_width`. */
|
|
826
1969
|
box_border_style?: BoxBorderStyle;
|
|
1970
|
+
/**
|
|
1971
|
+
* Corner radius. `layout` for cards and panels, `soften` for small
|
|
1972
|
+
* elements, `round` for pills and circles, `rewards-*` for loyalty UI.
|
|
1973
|
+
*/
|
|
827
1974
|
box_border_radius?: BoxBorderRadius;
|
|
1975
|
+
/** @ignore */
|
|
828
1976
|
didFirstInit: boolean;
|
|
1977
|
+
/** @ignore */
|
|
829
1978
|
prefix: string;
|
|
1979
|
+
/** @ignore */
|
|
830
1980
|
boxLayoutClasses?: string[];
|
|
1981
|
+
/** @ignore */
|
|
831
1982
|
backgroundIsDark: boolean;
|
|
832
1983
|
private changes;
|
|
833
1984
|
private tokenService;
|
|
834
1985
|
/**
|
|
835
1986
|
* Check the passed string to see if it contains JSON
|
|
836
1987
|
*
|
|
1988
|
+
* @ignore
|
|
837
1989
|
* @param string
|
|
838
1990
|
* @returns - boolean
|
|
839
1991
|
*/
|
|
840
1992
|
stringContainsJson(string: string): boolean;
|
|
1993
|
+
/** @ignore */
|
|
841
1994
|
getSizeClasses(spaceInput?: LayoutBoxSizes, overrideName?: string): string[];
|
|
1995
|
+
/** @ignore */
|
|
842
1996
|
getOverrideClasses(spaceOverrides: LayoutBoxSizes[]): string[][];
|
|
1997
|
+
/** @ignore */
|
|
843
1998
|
getAlignmentClasses(alignmentOverride: LayoutAlignment[]): string[];
|
|
1999
|
+
/** @ignore */
|
|
844
2000
|
getBackgroundClass(): string;
|
|
2001
|
+
/** @ignore */
|
|
845
2002
|
getBorderColorClass(): string;
|
|
2003
|
+
/** @ignore */
|
|
846
2004
|
getBorderWidthClass(): string;
|
|
2005
|
+
/** @ignore */
|
|
847
2006
|
getBorderStyleClass(): string;
|
|
2007
|
+
/** @ignore */
|
|
848
2008
|
getBorderRadiusClass(): string;
|
|
2009
|
+
/** @ignore */
|
|
849
2010
|
ngOnChanges(): void;
|
|
2011
|
+
/** @ignore */
|
|
850
2012
|
ngOnInit(): void;
|
|
851
2013
|
private getBoxModeClass;
|
|
852
2014
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LayoutBoxComponent, never>;
|
|
853
2015
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LayoutBoxComponent, "ui-box", never, { "box_space": { "alias": "box_space"; "required": false; }; "box_role": { "alias": "box_role"; "required": false; }; "box_space_top": { "alias": "box_space_top"; "required": false; }; "box_space_right": { "alias": "box_space_right"; "required": false; }; "box_space_bottom": { "alias": "box_space_bottom"; "required": false; }; "box_space_left": { "alias": "box_space_left"; "required": false; }; "box_align_x": { "alias": "box_align_x"; "required": false; }; "box_align_y": { "alias": "box_align_y"; "required": false; }; "box_fill_mode": { "alias": "box_fill_mode"; "required": false; }; "box_background": { "alias": "box_background"; "required": false; }; "box_text_on_dark": { "alias": "box_text_on_dark"; "required": false; }; "box_content_fill_width": { "alias": "box_content_fill_width"; "required": false; }; "box_border_color": { "alias": "box_border_color"; "required": false; }; "box_border_width": { "alias": "box_border_width"; "required": false; }; "box_border_style": { "alias": "box_border_style"; "required": false; }; "box_border_radius": { "alias": "box_border_radius"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
854
2016
|
}
|
|
855
2017
|
|
|
2018
|
+
/**
|
|
2019
|
+
* The page-width wrapper (`<ui-container>`). Use it once per page section to
|
|
2020
|
+
* align content to the site grid: it centres the content, caps its width at
|
|
2021
|
+
* each breakpoint (767px on tablet, 1080px on laptop, 1440px on desktop; full
|
|
2022
|
+
* width on mobile) and adds the side gutters (small up to laptop, large from
|
|
2023
|
+
* laptop up; gutter sizes are brand tokens).
|
|
2024
|
+
*
|
|
2025
|
+
* It has no background, padding top/bottom or layout of its own. For a
|
|
2026
|
+
* full-bleed coloured band, put the container inside a
|
|
2027
|
+
* `<ui-box [box_content_fill_width]="true">` with the background, not the
|
|
2028
|
+
* other way round. Lay out the content inside with `<ui-grid>` or
|
|
2029
|
+
* `<ui-stack>`.
|
|
2030
|
+
*
|
|
2031
|
+
* Don't nest containers: the gutters add up.
|
|
2032
|
+
*
|
|
2033
|
+
* @import import { OasysLayoutContainerComponent } from 'oasys-lib';
|
|
2034
|
+
*/
|
|
856
2035
|
declare class LayoutContainerComponent implements OnInit, OnChanges {
|
|
857
2036
|
private changes;
|
|
2037
|
+
/**
|
|
2038
|
+
* Span the full viewport width instead of stopping at the breakpoint widths.
|
|
2039
|
+
* The gutters still apply unless `container_gutter` is off. Bind a boolean:
|
|
2040
|
+
* `[container_fluid]="true"`.
|
|
2041
|
+
*/
|
|
858
2042
|
container_fluid: boolean;
|
|
2043
|
+
/**
|
|
2044
|
+
* Side gutters. Turn off (`[container_gutter]="false"`) when the content
|
|
2045
|
+
* must touch the container edges, e.g. an edge-to-edge image carousel.
|
|
2046
|
+
*/
|
|
859
2047
|
container_gutter: true | false | 'true' | 'false';
|
|
2048
|
+
/** @ignore */
|
|
860
2049
|
prefix: string;
|
|
2050
|
+
/** @ignore */
|
|
861
2051
|
containerLayoutClasses?: string[];
|
|
2052
|
+
/** @ignore */
|
|
862
2053
|
containerGutterNameLarge: string;
|
|
2054
|
+
/** @ignore */
|
|
863
2055
|
containerGutterNameSmall: string;
|
|
2056
|
+
/** @ignore */
|
|
864
2057
|
containerHorizontalSizes: LayoutContainerSizes;
|
|
2058
|
+
/** @ignore */
|
|
865
2059
|
ngOnChanges(): void;
|
|
2060
|
+
/** @ignore */
|
|
866
2061
|
ngOnInit(): void;
|
|
867
2062
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LayoutContainerComponent, never>;
|
|
868
2063
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LayoutContainerComponent, "ui-container", never, { "container_fluid": { "alias": "container_fluid"; "required": false; }; "container_gutter": { "alias": "container_gutter"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
869
2064
|
}
|
|
870
2065
|
|
|
2066
|
+
/**
|
|
2067
|
+
* One column of a `<ui-grid>` (`<ui-column>`). Only use it as a direct child
|
|
2068
|
+
* of `<ui-grid>`; it has no effect anywhere else.
|
|
2069
|
+
*
|
|
2070
|
+
* `columns` sets how many grid tracks it spans (out of 12, or the grid's
|
|
2071
|
+
* `grid_base`) and `column_inset` how many tracks to skip before it. Both take
|
|
2072
|
+
* a number, or an object per device for responsive layouts:
|
|
2073
|
+
* `[columns]="{ mobile: 12, tablet: 6, laptop: 4, desktop: 4 }"`. A device you
|
|
2074
|
+
* leave out of the object spans the full 12 tracks.
|
|
2075
|
+
*
|
|
2076
|
+
* Columns that add up to more than a row wrap onto the next row. The column
|
|
2077
|
+
* is only a grid cell: put a `<ui-box>` or `<ui-stack>` inside for padding,
|
|
2078
|
+
* background and spacing.
|
|
2079
|
+
*
|
|
2080
|
+
* @import import { OasysLayoutGridColumnComponent } from 'oasys-lib';
|
|
2081
|
+
* @knownIssue `column_inset` is silently ignored unless it has the same shape
|
|
2082
|
+
* as `columns`: a number inset needs a number `columns`, and each device key
|
|
2083
|
+
* in an inset object needs the same key in the `columns` object. Workaround:
|
|
2084
|
+
* write both as numbers, or both as objects with the same device keys, e.g.
|
|
2085
|
+
* `[columns]="{ mobile: 12, tablet: 6, laptop: 6, desktop: 6 }"` with
|
|
2086
|
+
* `[column_inset]="{ mobile: 0, tablet: 3, laptop: 3, desktop: 3 }"`.
|
|
2087
|
+
*/
|
|
871
2088
|
declare class LayoutGridColumnComponent implements OnInit, OnChanges {
|
|
872
2089
|
private changes;
|
|
2090
|
+
/** @ignore */
|
|
873
2091
|
didFirstInit: boolean;
|
|
2092
|
+
/** @ignore */
|
|
874
2093
|
prefix: string;
|
|
2094
|
+
/** @ignore */
|
|
875
2095
|
columnLayoutClasses?: string[];
|
|
2096
|
+
/**
|
|
2097
|
+
* Tracks to span: 1–12 (or up to the grid's `grid_base`), or an object per
|
|
2098
|
+
* device (`mobile`, `tablet`, `laptop`, `desktop`). `mobile` only applies
|
|
2099
|
+
* when the grid has `grid_collapse_below="none"`. Defaults to 12 (full
|
|
2100
|
+
* width).
|
|
2101
|
+
*/
|
|
876
2102
|
columns: ResponsiveGridColumns;
|
|
2103
|
+
/**
|
|
2104
|
+
* Tracks to leave empty before the column (1–11; `0` for none), to centre or
|
|
2105
|
+
* indent content. Must match the shape of `columns` (see known issues).
|
|
2106
|
+
*/
|
|
877
2107
|
column_inset: ResponsiveGridColumns;
|
|
2108
|
+
/** @ignore */
|
|
878
2109
|
grid_base: number;
|
|
2110
|
+
/** @ignore */
|
|
879
2111
|
getSizeClasses(columns: ResponsiveGridColumns, classString: string): string[];
|
|
2112
|
+
/** @ignore */
|
|
880
2113
|
ngOnChanges(): void;
|
|
2114
|
+
/** @ignore */
|
|
881
2115
|
ngOnInit(): void;
|
|
882
2116
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LayoutGridColumnComponent, never>;
|
|
883
2117
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LayoutGridColumnComponent, "ui-column", never, { "columns": { "alias": "columns"; "required": false; }; "column_inset": { "alias": "column_inset"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
884
2118
|
}
|
|
885
2119
|
|
|
2120
|
+
/**
|
|
2121
|
+
* A column grid (`<ui-grid>`) for side-by-side layouts: product grids, a
|
|
2122
|
+
* content column next to a sidebar, equal cards in a row. Its children must be
|
|
2123
|
+
* `<ui-column>`s, each saying how many tracks it spans.
|
|
2124
|
+
*
|
|
2125
|
+
* - Default: a 12-track CSS grid. Columns span 12 (full width) unless you set
|
|
2126
|
+
* `columns`, and wrap onto the next row when a row is full.
|
|
2127
|
+
* - `grid_base`: change the number of tracks, e.g. `[grid_base]="3"` with
|
|
2128
|
+
* `[columns]="1"` on each column for a three-up product grid.
|
|
2129
|
+
* - `grid_auto`: equal-width columns on one row, however many there are.
|
|
2130
|
+
*
|
|
2131
|
+
* Below `grid_collapse_below` (`tablet` by default, so on mobile) the grid
|
|
2132
|
+
* becomes a single vertical column and every `columns` / `column_inset` value
|
|
2133
|
+
* is ignored. To control mobile spans, set `grid_collapse_below="none"` and
|
|
2134
|
+
* give each column a `mobile` value.
|
|
2135
|
+
*
|
|
2136
|
+
* Use `<ui-stack>` instead for a single row or column of items that just need
|
|
2137
|
+
* even spacing. To expose a grid as a list, put `role="list"` on a wrapping
|
|
2138
|
+
* element and `role="listitem"` on each `<ui-column>`.
|
|
2139
|
+
*
|
|
2140
|
+
* @import import { OasysLayoutGridComponent } from 'oasys-lib';
|
|
2141
|
+
*/
|
|
886
2142
|
declare class LayoutGridComponent implements OnInit, OnChanges {
|
|
887
2143
|
private changes;
|
|
2144
|
+
/**
|
|
2145
|
+
* Give every column an equal share of one row, ignoring `columns`,
|
|
2146
|
+
* `column_inset` and `grid_base`. Columns never wrap, so keep the count
|
|
2147
|
+
* small. Bind a boolean: `[grid_auto]="true"`.
|
|
2148
|
+
*/
|
|
888
2149
|
grid_auto: boolean;
|
|
2150
|
+
/**
|
|
2151
|
+
* Below this breakpoint the columns stack into one vertical column:
|
|
2152
|
+
* `tablet` (under 767px), `laptop` (under 1080px) or `desktop` (under
|
|
2153
|
+
* 1440px). `none` keeps the grid at every size, which is required for
|
|
2154
|
+
* per-device `mobile` spans and for multi-column grids on mobile.
|
|
2155
|
+
*/
|
|
889
2156
|
grid_collapse_below: 'tablet' | 'laptop' | 'desktop' | 'none';
|
|
2157
|
+
/**
|
|
2158
|
+
* Space between columns and rows. Values are brand spacing tokens: `near`
|
|
2159
|
+
* and `default` are larger on bloomon than on Bloom & Wild.
|
|
2160
|
+
*/
|
|
890
2161
|
grid_gap: 'none' | 'tiny' | 'tight' | 'near' | 'default' | 'expanded';
|
|
2162
|
+
/**
|
|
2163
|
+
* Number of tracks. Columns and insets count in these tracks, so with
|
|
2164
|
+
* `[grid_base]="4"` a column of `[columns]="1"` is a quarter. Set `columns`
|
|
2165
|
+
* on every column when the base is under 12: the default span of 12 would
|
|
2166
|
+
* overflow it. Spans above 12 and insets above 11 are not supported.
|
|
2167
|
+
*/
|
|
891
2168
|
grid_base: number;
|
|
2169
|
+
/** @ignore */
|
|
892
2170
|
didFirstInit: boolean;
|
|
2171
|
+
/** @ignore */
|
|
893
2172
|
prefix: string;
|
|
2173
|
+
/** @ignore */
|
|
894
2174
|
gridLayoutClasses?: string[];
|
|
2175
|
+
/** @ignore */
|
|
895
2176
|
get gridTemplateColumns(): string | null;
|
|
2177
|
+
/** @ignore */
|
|
896
2178
|
ngOnChanges(): void;
|
|
2179
|
+
/** @ignore */
|
|
897
2180
|
ngOnInit(): void;
|
|
898
2181
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LayoutGridComponent, never>;
|
|
899
2182
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LayoutGridComponent, "ui-grid", never, { "grid_auto": { "alias": "grid_auto"; "required": false; }; "grid_collapse_below": { "alias": "grid_collapse_below"; "required": false; }; "grid_gap": { "alias": "grid_gap"; "required": false; }; "grid_base": { "alias": "grid_base"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
900
2183
|
}
|
|
901
2184
|
|
|
2185
|
+
/**
|
|
2186
|
+
* A flexbox row or column with consistent spacing between its children
|
|
2187
|
+
* (`<ui-stack>`). The default tool for spacing things out: use it instead of
|
|
2188
|
+
* margins, `gap` or `display: flex` in SCSS.
|
|
2189
|
+
*
|
|
2190
|
+
* - `stack_direction`: `y` (default) stacks vertically, `x` lays out a row.
|
|
2191
|
+
* - `stack_gap`: the space between children.
|
|
2192
|
+
* - `stack_align`: cross-axis alignment (horizontal in a column, vertical in a
|
|
2193
|
+
* row). `stack_distribute`: main-axis spacing, e.g. `space-between` to push
|
|
2194
|
+
* a label and a price to opposite ends of a row.
|
|
2195
|
+
* - `stack_collapse_below`: turn a row into a column on smaller screens.
|
|
2196
|
+
*
|
|
2197
|
+
* The stack is always full width and adds no padding or background; wrap it
|
|
2198
|
+
* in a `<ui-box>` for those. Nest stacks freely, e.g. a vertical stack of
|
|
2199
|
+
* horizontal rows. Use `<ui-grid>` when items must line up in columns.
|
|
2200
|
+
*
|
|
2201
|
+
* Lists: when the children are a list of like items (links, features,
|
|
2202
|
+
* results), set `[stack_as_list]="true"` and make each child an `<li>` (or
|
|
2203
|
+
* give it `role="listitem"`), so screen readers announce the list and its
|
|
2204
|
+
* length. List bullets are already removed.
|
|
2205
|
+
*
|
|
2206
|
+
* @import import { OasysLayoutStackComponent } from 'oasys-lib';
|
|
2207
|
+
*/
|
|
902
2208
|
declare class LayoutStackComponent implements OnInit, OnChanges {
|
|
903
2209
|
private changes;
|
|
2210
|
+
/** @ignore */
|
|
904
2211
|
didFirstInit: boolean;
|
|
2212
|
+
/** @ignore */
|
|
905
2213
|
prefix: string;
|
|
2214
|
+
/** @ignore */
|
|
906
2215
|
stackLayoutClasses?: string[];
|
|
2216
|
+
/**
|
|
2217
|
+
* Space between children. `tight` / `tiny` for related items (a label and
|
|
2218
|
+
* its value), `default` between blocks, `expanded` between sections;
|
|
2219
|
+
* `gutter` matches the page container gutter. Values are brand spacing
|
|
2220
|
+
* tokens: `near` and `default` are larger on bloomon than on Bloom & Wild.
|
|
2221
|
+
*/
|
|
907
2222
|
stack_gap: LayoutGapSizes;
|
|
2223
|
+
/**
|
|
2224
|
+
* Cross-axis alignment: where children sit horizontally in a vertical stack,
|
|
2225
|
+
* or vertically in a horizontal one (`center` to line up an icon with
|
|
2226
|
+
* text).
|
|
2227
|
+
*/
|
|
908
2228
|
stack_align: LayoutAlignment;
|
|
2229
|
+
/** `y` (default) for a column, `x` for a row. */
|
|
909
2230
|
stack_direction: LayoutDirections;
|
|
2231
|
+
/**
|
|
2232
|
+
* Main-axis distribution. `start` / `center` / `end` pack the children;
|
|
2233
|
+
* `space-between` / `space-around` / `space-evenly` spread them out;
|
|
2234
|
+
* `fill` makes every child grow to share the space; `fit` gives child
|
|
2235
|
+
* `<ui-stack>`s equal widths. `cover` has no effect on a stack.
|
|
2236
|
+
* `space-between` and `end` in a vertical stack need the stack to have a
|
|
2237
|
+
* height (e.g. inside a fixed-height or `box_fill_mode="cover"` box).
|
|
2238
|
+
*/
|
|
910
2239
|
stack_distribute?: LayoutDistribute;
|
|
2240
|
+
/**
|
|
2241
|
+
* Let children wrap onto new lines when they don't fit, e.g. a row of
|
|
2242
|
+
* chips or tags. Bind a boolean: `[stack_wrap]="true"`.
|
|
2243
|
+
*/
|
|
911
2244
|
stack_wrap?: boolean;
|
|
2245
|
+
/**
|
|
2246
|
+
* Below this breakpoint a horizontal stack becomes vertical: `tablet` (under
|
|
2247
|
+
* 767px), `laptop` (under 1080px) or `desktop` (under 1440px). `none`
|
|
2248
|
+
* (default) never collapses.
|
|
2249
|
+
*/
|
|
912
2250
|
stack_collapse_below: 'tablet' | 'laptop' | 'desktop' | 'none';
|
|
2251
|
+
/**
|
|
2252
|
+
* Adds `role="list"` so assistive technology announces the children as a
|
|
2253
|
+
* list. Each direct child must then be an `<li>` or have
|
|
2254
|
+
* `role="listitem"`. Bind a boolean: `[stack_as_list]="true"`.
|
|
2255
|
+
*/
|
|
913
2256
|
stack_as_list: boolean;
|
|
2257
|
+
/** @ignore */
|
|
914
2258
|
defaultDistribution(): LayoutDistribute;
|
|
2259
|
+
/** @ignore */
|
|
915
2260
|
ngOnChanges(): void;
|
|
2261
|
+
/** @ignore */
|
|
916
2262
|
ngOnInit(): void;
|
|
917
2263
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LayoutStackComponent, never>;
|
|
918
2264
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LayoutStackComponent, "ui-stack", never, { "stack_gap": { "alias": "stack_gap"; "required": false; }; "stack_align": { "alias": "stack_align"; "required": false; }; "stack_direction": { "alias": "stack_direction"; "required": false; }; "stack_distribute": { "alias": "stack_distribute"; "required": false; }; "stack_wrap": { "alias": "stack_wrap"; "required": false; }; "stack_collapse_below": { "alias": "stack_collapse_below"; "required": false; }; "stack_as_list": { "alias": "stack_as_list"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
@@ -925,29 +2271,112 @@ declare class OasysLayoutModule {
|
|
|
925
2271
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<OasysLayoutModule>;
|
|
926
2272
|
}
|
|
927
2273
|
|
|
2274
|
+
/**
|
|
2275
|
+
* A ready-made content block (`<ui-section>`): an image beside a heading,
|
|
2276
|
+
* optional subtitle and up to two text links, on a brand or custom
|
|
2277
|
+
* background. Use it for editorial and promotional bands (the CMS "story
|
|
2278
|
+
* block"); build anything else from `<ui-box>`, `<ui-grid>` and `<ui-stack>`.
|
|
2279
|
+
*
|
|
2280
|
+
* Two looks, set by `section_type`:
|
|
2281
|
+
* - `inform` (default): padded block, functional heading, links aligned to
|
|
2282
|
+
* the start.
|
|
2283
|
+
* - `spotlight`: image runs to the block's edge, larger heading, content and
|
|
2284
|
+
* links centred.
|
|
2285
|
+
*
|
|
2286
|
+
* From tablet up the image and the content take half the width each; on
|
|
2287
|
+
* mobile the image sits above the content. Without `image` the content still
|
|
2288
|
+
* only takes half the width. The image aspect ratio and padding come from
|
|
2289
|
+
* brand tokens, so they differ between brands (e.g. square spotlight images on
|
|
2290
|
+
* Bloom & Wild, 3:4 on bloomon).
|
|
2291
|
+
*
|
|
2292
|
+
* Accessibility: the title is always an `<h2>`, so place the section where a
|
|
2293
|
+
* second-level heading fits. Give `alt_text` for informative images and leave
|
|
2294
|
+
* it empty for decorative ones. Links render as standalone text links with
|
|
2295
|
+
* the CTA text as their accessible name, so make the text say where it goes.
|
|
2296
|
+
*
|
|
2297
|
+
* The consuming app must provide `IMAGE_URL_PROVIDER` (for the image) and
|
|
2298
|
+
* `ROUTING_HANDLER` (for the links).
|
|
2299
|
+
*
|
|
2300
|
+
* @import import { OasysSectionComponent } from 'oasys-lib';
|
|
2301
|
+
* @knownIssue `image_on_left` is inverted: from tablet up, `true` puts the
|
|
2302
|
+
* image on the right and the default (`false`) puts it on the left. On mobile
|
|
2303
|
+
* the image is always on top. Workaround: set `[image_on_left]="true"` when you
|
|
2304
|
+
* want the image on the right, and leave it unset for an image on the left.
|
|
2305
|
+
* @knownIssue Text does not switch to the on-dark colour on the current dark
|
|
2306
|
+
* brand backgrounds (`tertiary`, `quaternary`), and `text_on_dark_override`
|
|
2307
|
+
* only works with `non_brand_background_colour`. Workaround: use the
|
|
2308
|
+
* deprecated `core-tertiary` / `core-quaternary` names, which switch
|
|
2309
|
+
* automatically per brand.
|
|
2310
|
+
*/
|
|
928
2311
|
declare class SectionComponent {
|
|
2312
|
+
/**
|
|
2313
|
+
* Background from the brand palette (same values as `<ui-box>`'s
|
|
2314
|
+
* `box_background`). Leave unset for no background.
|
|
2315
|
+
*/
|
|
929
2316
|
readonly brand_background_colour: _angular_core.InputSignal<LayoutBackgrounds>;
|
|
2317
|
+
/**
|
|
2318
|
+
* Any CSS colour for a one-off, non-brand background (e.g. from the CMS).
|
|
2319
|
+
* Overrides `brand_background_colour`. Pair a dark colour with
|
|
2320
|
+
* `text_on_dark_override`.
|
|
2321
|
+
*/
|
|
930
2322
|
readonly non_brand_background_colour: _angular_core.InputSignal<string>;
|
|
2323
|
+
/**
|
|
2324
|
+
* Use on-dark (light) text. Only applies with `non_brand_background_colour`;
|
|
2325
|
+
* brand backgrounds pick the text colour from their tokens.
|
|
2326
|
+
*/
|
|
931
2327
|
readonly text_on_dark_override: _angular_core.InputSignal<boolean | "true" | "false">;
|
|
2328
|
+
/**
|
|
2329
|
+
* Swaps the image to the other side from tablet up. Inverted: `true` puts
|
|
2330
|
+
* the image on the right (see known issues).
|
|
2331
|
+
*/
|
|
932
2332
|
readonly image_on_left: _angular_core.InputSignal<boolean>;
|
|
2333
|
+
/**
|
|
2334
|
+
* `inform` (default) for a padded, start-aligned block; `spotlight` for an
|
|
2335
|
+
* edge-to-edge image with a larger, centred heading and links.
|
|
2336
|
+
*/
|
|
933
2337
|
readonly section_type: _angular_core.InputSignal<"spotlight" | "inform">;
|
|
2338
|
+
/** The heading, rendered as an `<h2>`. */
|
|
934
2339
|
readonly heading_title: _angular_core.InputSignal<string>;
|
|
2340
|
+
/** Supporting text under the heading. */
|
|
935
2341
|
readonly heading_subtitle: _angular_core.InputSignal<string>;
|
|
2342
|
+
/**
|
|
2343
|
+
* Text of the first link. Only shown when `href_primary_cta` is also set.
|
|
2344
|
+
* Describe the destination ("Shop birthday flowers", not "Click here").
|
|
2345
|
+
*/
|
|
936
2346
|
readonly primary_cta_text: _angular_core.InputSignal<string>;
|
|
2347
|
+
/** Text of the second link. Only shown when `href_secondary_cta` is also set. */
|
|
937
2348
|
readonly secondary_cta_text: _angular_core.InputSignal<string>;
|
|
2349
|
+
/** Image URL. Without it the image column is not rendered. */
|
|
938
2350
|
readonly image: _angular_core.InputSignal<string>;
|
|
2351
|
+
/**
|
|
2352
|
+
* Image alt text. Describe what the image shows when it adds information;
|
|
2353
|
+
* leave empty for a decorative image (it is then hidden from screen readers).
|
|
2354
|
+
*/
|
|
939
2355
|
readonly alt_text: _angular_core.InputSignal<string>;
|
|
2356
|
+
/** URL for the first link. Required for `primary_cta_text` to show. */
|
|
940
2357
|
readonly href_primary_cta: _angular_core.InputSignal<string>;
|
|
2358
|
+
/** URL for the second link. Required for `secondary_cta_text` to show. */
|
|
941
2359
|
readonly href_secondary_cta: _angular_core.InputSignal<string>;
|
|
942
2360
|
private readonly tokenService;
|
|
2361
|
+
/** @ignore */
|
|
943
2362
|
readonly uiBoxId: _angular_core.Signal<string>;
|
|
2363
|
+
/** @ignore */
|
|
944
2364
|
readonly displayBrandBackgroundColour: _angular_core.Signal<LayoutBackgrounds>;
|
|
945
|
-
/**
|
|
2365
|
+
/**
|
|
2366
|
+
* Non-brand fills: honour override only. Brand fills: leave undefined so ui-box uses tokens.
|
|
2367
|
+
*
|
|
2368
|
+
* @ignore
|
|
2369
|
+
*/
|
|
946
2370
|
readonly textOnDark: _angular_core.Signal<boolean>;
|
|
2371
|
+
/** @ignore */
|
|
947
2372
|
readonly containerInsetSpaceSmall: _angular_core.Signal<string>;
|
|
2373
|
+
/** @ignore */
|
|
948
2374
|
readonly containerInsetSpaceLarge: _angular_core.Signal<string>;
|
|
2375
|
+
/** @ignore */
|
|
949
2376
|
readonly contentInsetSpaceSmall: _angular_core.Signal<string>;
|
|
2377
|
+
/** @ignore */
|
|
950
2378
|
readonly contentInsetSpaceLarge: _angular_core.Signal<string>;
|
|
2379
|
+
/** @ignore */
|
|
951
2380
|
readonly imageAspectRatio: _angular_core.Signal<ImageAspectRatio>;
|
|
952
2381
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SectionComponent, never>;
|
|
953
2382
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SectionComponent, "ui-section", never, { "brand_background_colour": { "alias": "brand_background_colour"; "required": false; "isSignal": true; }; "non_brand_background_colour": { "alias": "non_brand_background_colour"; "required": false; "isSignal": true; }; "text_on_dark_override": { "alias": "text_on_dark_override"; "required": false; "isSignal": true; }; "image_on_left": { "alias": "image_on_left"; "required": false; "isSignal": true; }; "section_type": { "alias": "section_type"; "required": false; "isSignal": true; }; "heading_title": { "alias": "heading_title"; "required": false; "isSignal": true; }; "heading_subtitle": { "alias": "heading_subtitle"; "required": false; "isSignal": true; }; "primary_cta_text": { "alias": "primary_cta_text"; "required": false; "isSignal": true; }; "secondary_cta_text": { "alias": "secondary_cta_text"; "required": false; "isSignal": true; }; "image": { "alias": "image"; "required": false; "isSignal": true; }; "alt_text": { "alias": "alt_text"; "required": false; "isSignal": true; }; "href_primary_cta": { "alias": "href_primary_cta"; "required": false; "isSignal": true; }; "href_secondary_cta": { "alias": "href_secondary_cta"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -960,17 +2389,73 @@ declare class SectionModule {
|
|
|
960
2389
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<SectionModule>;
|
|
961
2390
|
}
|
|
962
2391
|
|
|
2392
|
+
/**
|
|
2393
|
+
* A full-width promotional strip (`<ui-banner>`): a short heading on a
|
|
2394
|
+
* coloured background with one optional call to action. Use it for offers and
|
|
2395
|
+
* prompts that sit between page sections, such as "Take £10 off your first
|
|
2396
|
+
* order". For a status or error message use `<ui-alert>` instead.
|
|
2397
|
+
*
|
|
2398
|
+
* Renders a `<ui-heading>` (`functional-primary` style) with optional
|
|
2399
|
+
* surtitle and subtitle, and a large `<ui-button>` that sits beside the text
|
|
2400
|
+
* from tablet up and below it on mobile. Content is set through inputs; there
|
|
2401
|
+
* is no content projection.
|
|
2402
|
+
*
|
|
2403
|
+
* The CTA is one of two things:
|
|
2404
|
+
* - `cta_link` set: an `<a href>` link. Use for navigation. The consuming app
|
|
2405
|
+
* must provide `ROUTING_HANDLER`, as for any Oasys link. `cta_clicked` does
|
|
2406
|
+
* not fire.
|
|
2407
|
+
* - `cta_link` empty: a `<button>` that emits `cta_clicked`. Use for in-page
|
|
2408
|
+
* actions such as opening a modal.
|
|
2409
|
+
*
|
|
2410
|
+
* Accessibility:
|
|
2411
|
+
* - The title is always an `<h2>` and the subtitle an `<h3>`, so place the
|
|
2412
|
+
* banner where a second-level heading fits the page outline.
|
|
2413
|
+
* - The CTA's accessible name is `cta_text`, so make it say where it goes or
|
|
2414
|
+
* what it does ("Claim offer", not "Click here").
|
|
2415
|
+
* - On dark backgrounds the text and button switch to their on-dark styles
|
|
2416
|
+
* automatically (see known issues for the background names that do not).
|
|
2417
|
+
*
|
|
2418
|
+
* @import import { OasysBannerComponent } from 'oasys-lib';
|
|
2419
|
+
* @knownIssue The `tertiary` and `quaternary` values of `background_colour`
|
|
2420
|
+
* never switch the text and CTA to their on-dark styles, so on brands where
|
|
2421
|
+
* those colours are dark (for example `quaternary` on Bloom & Wild) the banner
|
|
2422
|
+
* renders dark text and a dark `primary` button on a dark background.
|
|
2423
|
+
* Workaround: for dark banners use the matching `core-tertiary` or
|
|
2424
|
+
* `core-quaternary` value, which renders the same colour and does switch to
|
|
2425
|
+
* on-dark styles.
|
|
2426
|
+
*/
|
|
963
2427
|
declare class BannerComponent implements OnInit {
|
|
964
2428
|
private tokenService;
|
|
2429
|
+
/** @ignore */
|
|
965
2430
|
mobilePadding: string;
|
|
2431
|
+
/**
|
|
2432
|
+
* Background colour. Prefer the semantic names (`highlight`, `secondary`,
|
|
2433
|
+
* `tertiary`, `quaternary`, `rewards-*`); the `core-*` and `tint-highlight`
|
|
2434
|
+
* names are deprecated aliases of the same colours, except as a workaround
|
|
2435
|
+
* for dark backgrounds (see known issues).
|
|
2436
|
+
*/
|
|
966
2437
|
background_colour: LayoutBackgrounds | LayoutBackgroundsDeprecated;
|
|
2438
|
+
/** Label of the call-to-action button. Leave empty for a banner with no CTA. */
|
|
967
2439
|
cta_text: string;
|
|
2440
|
+
/** Main message, rendered as an `<h2>`. Keep it short: it is the offer or prompt itself. */
|
|
968
2441
|
banner_title: string;
|
|
2442
|
+
/** Small supporting line above the title, for context such as "Seen our TV advert?". */
|
|
969
2443
|
banner_surtitle: string;
|
|
2444
|
+
/**
|
|
2445
|
+
* Supporting sentence below the title, for terms or detail. Rendered as an
|
|
2446
|
+
* `<h3>`; accepts simple HTML such as a link (sanitised by Angular).
|
|
2447
|
+
*/
|
|
970
2448
|
banner_subtitle: string;
|
|
2449
|
+
/**
|
|
2450
|
+
* URL for the CTA. When set, the CTA renders as an `<a href>` link and
|
|
2451
|
+
* `cta_clicked` does not fire. Leave empty to render a `<button>` instead.
|
|
2452
|
+
*/
|
|
971
2453
|
cta_link: string;
|
|
2454
|
+
/** Emitted when the CTA button is clicked. Only fires when `cta_link` is empty. */
|
|
972
2455
|
cta_clicked: EventEmitter<void>;
|
|
2456
|
+
/** @ignore */
|
|
973
2457
|
ngOnInit(): void;
|
|
2458
|
+
/** @ignore */
|
|
974
2459
|
onCtaClicked(): void;
|
|
975
2460
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BannerComponent, never>;
|
|
976
2461
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BannerComponent, "ui-banner", never, { "background_colour": { "alias": "background_colour"; "required": false; }; "cta_text": { "alias": "cta_text"; "required": false; }; "banner_title": { "alias": "banner_title"; "required": false; }; "banner_surtitle": { "alias": "banner_surtitle"; "required": false; }; "banner_subtitle": { "alias": "banner_subtitle"; "required": false; }; "cta_link": { "alias": "cta_link"; "required": false; }; }, { "cta_clicked": "cta_clicked"; }, never, never, true, never>;
|
|
@@ -985,9 +2470,44 @@ declare class OasysBannerModule {
|
|
|
985
2470
|
|
|
986
2471
|
type PillTone = 'neutral' | 'positive' | 'negative';
|
|
987
2472
|
|
|
2473
|
+
/**
|
|
2474
|
+
* A small rounded label (`<ui-pill>`) that shows a short status or attribute,
|
|
2475
|
+
* such as "Shipped", "Paused" or "Default". Put the text inside the element.
|
|
2476
|
+
*
|
|
2477
|
+
* Use `tone` to match the meaning: `positive` for good or active states,
|
|
2478
|
+
* `negative` for problems or cancellations, `neutral` for everything else.
|
|
2479
|
+
* Don't rely on colour alone: the text must say what the state is.
|
|
2480
|
+
*
|
|
2481
|
+
* Keep the text to one or two words. Pills never wrap, so long text makes the
|
|
2482
|
+
* pill wider than its container on small screens.
|
|
2483
|
+
*
|
|
2484
|
+
* Pills are not interactive. For a selectable option use `<ui-chip>`, and for
|
|
2485
|
+
* a promotional badge use `<ui-label>`.
|
|
2486
|
+
*
|
|
2487
|
+
* Accessibility: the text is rendered inside an element with `role="status"`,
|
|
2488
|
+
* a polite live region. Several pills next to each other can be grouped with
|
|
2489
|
+
* `<ui-pill-group>`.
|
|
2490
|
+
*
|
|
2491
|
+
* @import import { OasysPillComponent } from 'oasys-lib';
|
|
2492
|
+
* @knownIssue `pill_role` has no effect: the host `role` is read once when the
|
|
2493
|
+
* pill is created, so it is always `role="none"`, and a static `role="..."`
|
|
2494
|
+
* attribute is overwritten too. This means pills inside `<ui-pill-group>`
|
|
2495
|
+
* (a `role="list"`) are never list items. Workaround: none in the component
|
|
2496
|
+
* yet; don't rely on `pill_role`, and see `<ui-pill-group>` for list semantics.
|
|
2497
|
+
*/
|
|
988
2498
|
declare class OasysPillComponent {
|
|
2499
|
+
/**
|
|
2500
|
+
* Colour that matches the meaning: `positive` for good or active states,
|
|
2501
|
+
* `negative` for problems or cancellations, `neutral` for everything else.
|
|
2502
|
+
*/
|
|
989
2503
|
tone: PillTone;
|
|
2504
|
+
/**
|
|
2505
|
+
* Intended to set the `role` of the host element (for example `listitem`
|
|
2506
|
+
* inside `<ui-pill-group>`). Currently ignored: the host always gets
|
|
2507
|
+
* `role="none"` (see known issues).
|
|
2508
|
+
*/
|
|
990
2509
|
pill_role?: string | undefined;
|
|
2510
|
+
/** @ignore */
|
|
991
2511
|
role: string | undefined;
|
|
992
2512
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysPillComponent, never>;
|
|
993
2513
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OasysPillComponent, "ui-pill", never, { "tone": { "alias": "tone"; "required": false; }; "pill_role": { "alias": "pill_role"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
@@ -1000,10 +2520,48 @@ declare class OasysPillModule {
|
|
|
1000
2520
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<OasysPillModule>;
|
|
1001
2521
|
}
|
|
1002
2522
|
|
|
2523
|
+
/**
|
|
2524
|
+
* Lays out several `<ui-pill>`s in a wrapping row with consistent spacing
|
|
2525
|
+
* (`<ui-pill-group>`), for example the attributes of an order or a card.
|
|
2526
|
+
*
|
|
2527
|
+
* Only `<ui-pill>` children are shown: any other element placed inside is
|
|
2528
|
+
* hidden with `display: none`.
|
|
2529
|
+
*
|
|
2530
|
+
* By default the pills stack vertically on mobile (below `tablet`). Set
|
|
2531
|
+
* `pill_group_collapse_below="none"` to keep them in a wrapping row at every
|
|
2532
|
+
* size, which is usually what you want for short pills.
|
|
2533
|
+
*
|
|
2534
|
+
* Accessibility: the group renders as `role="list"`, so screen readers
|
|
2535
|
+
* announce it as a list with a count of items.
|
|
2536
|
+
*
|
|
2537
|
+
* @import import { OasysPillGroupComponent } from 'oasys-lib';
|
|
2538
|
+
* @knownIssue The group is a `role="list"` but its pills are never list items
|
|
2539
|
+
* (`pill_role="listitem"` is ignored, every pill gets `role="none"`), so the
|
|
2540
|
+
* list semantics are invalid and fail automated accessibility checks (axe
|
|
2541
|
+
* `aria-required-children`). Workaround: where this matters, lay the
|
|
2542
|
+
* pills out with `<ui-stack stack_direction="x" stack_gap="near"
|
|
2543
|
+
* [stack_wrap]="true">` instead, which has no list role.
|
|
2544
|
+
* @knownIssue Children that are not `<ui-pill>` are hidden with
|
|
2545
|
+
* `display: none`, with no warning. Workaround: put only `<ui-pill>`s inside
|
|
2546
|
+
* the group and place any other content outside it.
|
|
2547
|
+
*/
|
|
1003
2548
|
declare class OasysPillGroupComponent {
|
|
1004
2549
|
private breakpointService;
|
|
2550
|
+
/**
|
|
2551
|
+
* Horizontal alignment of the row. `end` also reverses the order, so the
|
|
2552
|
+
* first pill in the markup sits furthest right.
|
|
2553
|
+
*/
|
|
1005
2554
|
pill_group_align: 'start' | 'center' | 'end';
|
|
2555
|
+
/**
|
|
2556
|
+
* Stack the pills vertically below this breakpoint: `tablet` (under 768px),
|
|
2557
|
+
* `laptop` (under 1080px) or `desktop` (under 1440px). `none` keeps a
|
|
2558
|
+
* wrapping row at every size.
|
|
2559
|
+
*/
|
|
1006
2560
|
pill_group_collapse_below: 'tablet' | 'laptop' | 'desktop' | 'none';
|
|
2561
|
+
/**
|
|
2562
|
+
* True when the screen is below `pill_group_collapse_below`. Read it through
|
|
2563
|
+
* a template reference if surrounding layout needs to follow the stacking.
|
|
2564
|
+
*/
|
|
1007
2565
|
get shouldCollapse(): boolean;
|
|
1008
2566
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysPillGroupComponent, never>;
|
|
1009
2567
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OasysPillGroupComponent, "ui-pill-group", never, { "pill_group_align": { "alias": "pill_group_align"; "required": false; }; "pill_group_collapse_below": { "alias": "pill_group_collapse_below"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
@@ -1031,26 +2589,83 @@ declare class SwiperProvider implements ISwiperProvider {
|
|
|
1031
2589
|
}
|
|
1032
2590
|
|
|
1033
2591
|
type PromoCardLayout = 'default' | 'compact';
|
|
2592
|
+
/**
|
|
2593
|
+
* A marketing tile (`<ui-promo-card>`): a full-width image, a title, a short
|
|
2594
|
+
* subtitle and one text-link CTA, on a background colour chosen by the content
|
|
2595
|
+
* author. Use it to drop a campaign or promotion into a product grid or a row
|
|
2596
|
+
* of cards.
|
|
2597
|
+
*
|
|
2598
|
+
* - The CTA is a plain `<a>` styled as a standalone text link, not a
|
|
2599
|
+
* `<ui-button>`. Set `href_primary_cta` for the destination; `cta_clicked`
|
|
2600
|
+
* also fires on click (for tracking or custom navigation).
|
|
2601
|
+
* - The title is always an `<h3>`. Place the card under an `h2` section
|
|
2602
|
+
* heading so the outline stays in order.
|
|
2603
|
+
* - `background_colour` and `font_colour` are raw CSS colours applied as
|
|
2604
|
+
* inline styles. Nothing checks contrast: choose a pair that meets WCAG AA
|
|
2605
|
+
* (4.5:1 for the subtitle and link).
|
|
2606
|
+
* - Image aspect ratio and text alignment come from the
|
|
2607
|
+
* `--oasys-component-promo-card-*` tokens, so they differ per brand.
|
|
2608
|
+
* - The card fills the width of its parent.
|
|
2609
|
+
*
|
|
2610
|
+
* Requires an `IMAGE_URL_PROVIDER` (for the image) and a `ROUTING_HANDLER`
|
|
2611
|
+
* (for the CTA link).
|
|
2612
|
+
*
|
|
2613
|
+
* @import import { OasysPromoCardComponent } from 'oasys-lib';
|
|
2614
|
+
* @knownIssue The CTA link always renders, even without `primary_cta_text` or
|
|
2615
|
+
* `href_primary_cta`, leaving an empty link (no accessible name) or a link to
|
|
2616
|
+
* the current page. Workaround: always set both `primary_cta_text` and
|
|
2617
|
+
* `href_primary_cta`.
|
|
2618
|
+
* @knownIssue `layout` is read once on init; changing it later has no effect.
|
|
2619
|
+
* Workaround: set it up front, or re-create the card (for example with `@if`)
|
|
2620
|
+
* when the layout must change.
|
|
2621
|
+
*/
|
|
1034
2622
|
declare class PromoCardComponent implements OnInit {
|
|
1035
2623
|
private tokenService;
|
|
2624
|
+
/** Image URL, passed to `<ui-image>` (and so through the app's `IMAGE_URL_PROVIDER`). */
|
|
1036
2625
|
image: string;
|
|
2626
|
+
/**
|
|
2627
|
+
* Alt text for the image. Leave it unset or `''` when the image is
|
|
2628
|
+
* decorative; don't repeat the title, which screen readers already announce.
|
|
2629
|
+
*/
|
|
1037
2630
|
alt_text: string;
|
|
2631
|
+
/** Card title, rendered as an `<h3>`. */
|
|
1038
2632
|
title: string;
|
|
2633
|
+
/** One or two sentences of supporting copy under the title. */
|
|
1039
2634
|
subtitle: string;
|
|
2635
|
+
/**
|
|
2636
|
+
* CTA link text. Make it meaningful out of context ("Shop birthday flowers",
|
|
2637
|
+
* not "Click here"). Always set it: the link renders even when empty.
|
|
2638
|
+
*/
|
|
1040
2639
|
primary_cta_text: string;
|
|
2640
|
+
/** CTA link destination. Always set it: an empty value links to the current page. */
|
|
1041
2641
|
href_primary_cta: string;
|
|
2642
|
+
/** Any CSS colour for the card background. Check contrast against `font_colour`. */
|
|
1042
2643
|
background_colour: string;
|
|
2644
|
+
/** Any CSS colour for the card text. Check contrast against `background_colour`. */
|
|
1043
2645
|
font_colour: string;
|
|
2646
|
+
/**
|
|
2647
|
+
* `default` uses a secondary heading and default body text. `compact` uses
|
|
2648
|
+
* smaller type and tighter spacing, for narrow grid cells. Read once on init.
|
|
2649
|
+
*/
|
|
1044
2650
|
layout: PromoCardLayout;
|
|
2651
|
+
/**
|
|
2652
|
+
* Emits when the CTA link is clicked. The link still navigates to
|
|
2653
|
+
* `href_primary_cta` unless the app's routing handler prevents it.
|
|
2654
|
+
*/
|
|
1045
2655
|
cta_clicked: EventEmitter<void>;
|
|
2656
|
+
/** @ignore */
|
|
1046
2657
|
aspectRatio: ImageAspectRatio;
|
|
2658
|
+
/** @ignore */
|
|
1047
2659
|
alignment: LayoutAlignment;
|
|
2660
|
+
/** @ignore */
|
|
1048
2661
|
layoutConfig: {
|
|
1049
2662
|
headingType: string;
|
|
1050
2663
|
bodyType: string;
|
|
1051
2664
|
spacing: LayoutGapSizes;
|
|
1052
2665
|
};
|
|
2666
|
+
/** @ignore */
|
|
1053
2667
|
ngOnInit(): void;
|
|
2668
|
+
/** @ignore */
|
|
1054
2669
|
ctaClicked(): void;
|
|
1055
2670
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PromoCardComponent, never>;
|
|
1056
2671
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PromoCardComponent, "ui-promo-card", never, { "image": { "alias": "image"; "required": false; }; "alt_text": { "alias": "alt_text"; "required": false; }; "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; "primary_cta_text": { "alias": "primary_cta_text"; "required": false; }; "href_primary_cta": { "alias": "href_primary_cta"; "required": false; }; "background_colour": { "alias": "background_colour"; "required": false; }; "font_colour": { "alias": "font_colour"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; }, { "cta_clicked": "cta_clicked"; }, never, never, true, never>;
|
|
@@ -1064,28 +2679,94 @@ declare class OasysPromoCardModule {
|
|
|
1064
2679
|
}
|
|
1065
2680
|
|
|
1066
2681
|
type ISelectCardType = 'product-card' | 'gift-card';
|
|
2682
|
+
/**
|
|
2683
|
+
* A selectable card (`<ui-select-card>`) for picking one option from a visual
|
|
2684
|
+
* set, such as a greeting card at checkout or a subscription bouquet. Two
|
|
2685
|
+
* layouts, chosen by `select_card_type`:
|
|
2686
|
+
* - `gift-card` (default): image, title and price.
|
|
2687
|
+
* - `product-card`: image, title, price (plus a tag icon when discounted),
|
|
2688
|
+
* supporting copy and a description, inside a bordered card.
|
|
2689
|
+
*
|
|
2690
|
+
* Selection: the whole card is a native `<button>` with `aria-pressed`, so it
|
|
2691
|
+
* works with Tab, Enter and Space and announces as a toggle button. It has no
|
|
2692
|
+
* internal state and no form integration: listen to `clicked`, store the
|
|
2693
|
+
* selection in the parent, and pass `selected` back in. For single-choice
|
|
2694
|
+
* sets, set `selected` on exactly one card.
|
|
2695
|
+
*
|
|
2696
|
+
* Accessibility:
|
|
2697
|
+
* - The button's accessible name is all of its text in order: the image alt
|
|
2698
|
+
* text, any projected content, the title, the price and (for
|
|
2699
|
+
* `product-card`) the copy. Keep the alt text `''` when the title already
|
|
2700
|
+
* names the option, so it isn't read twice.
|
|
2701
|
+
* - The struck-through original price is hidden from screen readers by
|
|
2702
|
+
* `<ui-price>`; put any discount wording that matters in `title` or the copy.
|
|
2703
|
+
* - Don't put links, buttons or other interactive content in the projected
|
|
2704
|
+
* content: it would be nested inside the card's `<button>`.
|
|
2705
|
+
*
|
|
2706
|
+
* Images: set `image` for a `<ui-image>`, or leave it unset and project your
|
|
2707
|
+
* own image as content (it renders in the image area). `image_format` only
|
|
2708
|
+
* applies to `image`.
|
|
2709
|
+
*
|
|
2710
|
+
* Requires an `IMAGE_URL_PROVIDER` when `image` is set.
|
|
2711
|
+
*
|
|
2712
|
+
* @import import { OasysSelectCardComponent } from 'oasys-lib';
|
|
2713
|
+
* @knownIssue `image_format` is read once on init (and only when `image` is
|
|
2714
|
+
* set then); later changes have no effect. Workaround: set `image` and
|
|
2715
|
+
* `image_format` up front, or re-create the card (for example with `@if`) when
|
|
2716
|
+
* they change.
|
|
2717
|
+
*/
|
|
1067
2718
|
declare class SelectCardComponent implements OnInit {
|
|
1068
2719
|
private tokenService;
|
|
2720
|
+
/**
|
|
2721
|
+
* Image URL, rendered with `<ui-image>`. Optional: leave unset and project an
|
|
2722
|
+
* image as content instead.
|
|
2723
|
+
*/
|
|
1069
2724
|
image?: string;
|
|
2725
|
+
/**
|
|
2726
|
+
* Alt text for `image`. It becomes part of the button's accessible name, so
|
|
2727
|
+
* leave it `''` when the title already identifies the option.
|
|
2728
|
+
*/
|
|
1070
2729
|
alt_text?: string;
|
|
2730
|
+
/**
|
|
2731
|
+
* Image aspect ratio: `portrait` (default) or `square`. Any other value falls
|
|
2732
|
+
* back to `portrait`. Only applies to `image`, and is read once on init.
|
|
2733
|
+
*/
|
|
1071
2734
|
image_format: string;
|
|
2735
|
+
/** Name of the option, such as the greeting card or bouquet name. */
|
|
1072
2736
|
title: string;
|
|
2737
|
+
/** `product-card` only: description shown at the bottom of the card. */
|
|
1073
2738
|
primary_copy: string;
|
|
2739
|
+
/** `product-card` only: short supporting text above the description, such as the stem count. */
|
|
1074
2740
|
secondary_copy: string;
|
|
2741
|
+
/**
|
|
2742
|
+
* Price to pay, as a pre-formatted string including the currency (for
|
|
2743
|
+
* example `'£3.50'`). It is displayed as given.
|
|
2744
|
+
*/
|
|
1075
2745
|
price: string;
|
|
2746
|
+
/**
|
|
2747
|
+
* Pre-formatted original price. When set, it is shown struck through before
|
|
2748
|
+
* `price` (hidden from screen readers), and `product-card` adds a tag icon.
|
|
2749
|
+
* Leave unset or `''` when there is no discount.
|
|
2750
|
+
*/
|
|
1076
2751
|
price_before_discount: string;
|
|
2752
|
+
/** Whether this card is the current selection. Sets the selected style and `aria-pressed`. */
|
|
1077
2753
|
selected: boolean;
|
|
2754
|
+
/** Which layout to render: compact `gift-card` or the fuller, bordered `product-card`. */
|
|
1078
2755
|
select_card_type: ISelectCardType;
|
|
2756
|
+
/**
|
|
2757
|
+
* Emits when the card is activated by click, Enter or Space. Update the
|
|
2758
|
+
* parent's selection here; the card doesn't change `selected` itself.
|
|
2759
|
+
*/
|
|
1079
2760
|
clicked: EventEmitter<void>;
|
|
2761
|
+
/** @ignore */
|
|
1080
2762
|
aspectRatio: string;
|
|
2763
|
+
/** @ignore */
|
|
1081
2764
|
alignment: string;
|
|
2765
|
+
/** @ignore */
|
|
1082
2766
|
ngOnInit(): void;
|
|
2767
|
+
/** @ignore */
|
|
1083
2768
|
onClick(): void;
|
|
1084
|
-
/**
|
|
1085
|
-
*
|
|
1086
|
-
* @param format
|
|
1087
|
-
* @returns
|
|
1088
|
-
*/
|
|
2769
|
+
/** @ignore */
|
|
1089
2770
|
setImageAspectRatio(format: string): string;
|
|
1090
2771
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectCardComponent, never>;
|
|
1091
2772
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectCardComponent, "ui-select-card", never, { "image": { "alias": "image"; "required": false; }; "alt_text": { "alias": "alt_text"; "required": false; }; "image_format": { "alias": "image_format"; "required": false; }; "title": { "alias": "title"; "required": false; }; "primary_copy": { "alias": "primary_copy"; "required": false; }; "secondary_copy": { "alias": "secondary_copy"; "required": false; }; "price": { "alias": "price"; "required": false; }; "price_before_discount": { "alias": "price_before_discount"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "select_card_type": { "alias": "select_card_type"; "required": false; }; }, { "clicked": "clicked"; }, never, ["*"], true, never>;
|
|
@@ -1106,85 +2787,249 @@ interface ComboboxOption<T = unknown> {
|
|
|
1106
2787
|
}
|
|
1107
2788
|
type ComboboxType = 'options' | 'autocomplete';
|
|
1108
2789
|
|
|
2790
|
+
/**
|
|
2791
|
+
* The Oasys combobox (`<ui-combobox>`): a labelled field that opens a list of
|
|
2792
|
+
* options to pick one from. Two modes, set with `type`:
|
|
2793
|
+
* - `options` (default): a read-only, select-style field. Use it instead of a
|
|
2794
|
+
* native `<select>` for choices such as delivery day or subscription
|
|
2795
|
+
* frequency. For two to five options that should stay visible, use radios
|
|
2796
|
+
* or chips instead.
|
|
2797
|
+
* - `autocomplete`: a text field that filters the options as the user types
|
|
2798
|
+
* (matches are emphasised), with a clear button, an optional `header` above
|
|
2799
|
+
* the list and an optional `footer` button (emits `didEdit`, for example
|
|
2800
|
+
* "Enter address manually"). The user can also keep free text that matches
|
|
2801
|
+
* no option.
|
|
2802
|
+
*
|
|
2803
|
+
* Each option is an object `{ value, label, subtext?, icon_name? }` (the
|
|
2804
|
+
* `ComboboxOption` shape; the type is not exported from `oasys-lib`). To use
|
|
2805
|
+
* your own objects, name their fields with `valueKey`, `displayKey`,
|
|
2806
|
+
* `iconNameKey` and `subtextKey`. Options are matched by their value field.
|
|
2807
|
+
* `subtext` is only shown in autocomplete mode.
|
|
2808
|
+
*
|
|
2809
|
+
* Value: `didChange` emits the selected option object. With Angular forms
|
|
2810
|
+
* (`formControlName`, `formControl`, `ngModel`), the control holds the text
|
|
2811
|
+
* in the field: the selected option's label, or what the user typed. Preselect
|
|
2812
|
+
* an option with `selected`.
|
|
2813
|
+
*
|
|
2814
|
+
* Errors and hint: project `<ui-form-errors>` as content; it is shown once the
|
|
2815
|
+
* control is touched, invalid and no longer focused. `hint` is shown below.
|
|
2816
|
+
*
|
|
2817
|
+
* Accessibility: the input has `role="combobox"` with `aria-expanded`,
|
|
2818
|
+
* `aria-controls` pointing at the `role="listbox"`, and
|
|
2819
|
+
* `aria-activedescendant` following the highlighted option, so focus stays in
|
|
2820
|
+
* the field. Each option's accessible name includes its subtext and, when
|
|
2821
|
+
* selected, `selectedLabel`. In localised apps, pass translated `clearLabel`
|
|
2822
|
+
* and `selectedLabel`. The `hint` and projected errors are not linked to the
|
|
2823
|
+
* input with `aria-describedby`, so keep anything essential in `label`.
|
|
2824
|
+
*
|
|
2825
|
+
* Keyboard (`options`): Enter, Space or an arrow key opens the list with the
|
|
2826
|
+
* selected option highlighted; arrows move (the field previews the option);
|
|
2827
|
+
* Enter, Space or Tab picks it; Escape closes and keeps the previous choice.
|
|
2828
|
+
* Keyboard (`autocomplete`): typing opens and filters the list; arrows move
|
|
2829
|
+
* and preview; Enter picks; Escape closes; Tab moves to the clear and footer
|
|
2830
|
+
* buttons while the list is open.
|
|
2831
|
+
*
|
|
2832
|
+
* Template reference API: `panelOpen()`, `selectedOption()`, `closePanel()` and
|
|
2833
|
+
* `cleanInput()` can be used through a `viewChild` or template reference.
|
|
2834
|
+
*
|
|
2835
|
+
* @import import { OasysComboboxComponent } from 'oasys-lib';
|
|
2836
|
+
* @knownIssue The form control value is the selected option's display label
|
|
2837
|
+
* (a string), not its `value`, and writing a value to the control only changes
|
|
2838
|
+
* the text shown; it does not select an option. Writing an option object
|
|
2839
|
+
* without `selected` set shows "[object Object]". Workaround: read the choice
|
|
2840
|
+
* from `didChange` (emits the whole option), preselect with `selected`, and
|
|
2841
|
+
* only write strings to the control.
|
|
2842
|
+
* @knownIssue `selected` is only read when the component initialises; changing
|
|
2843
|
+
* it later does not change the selection. Workaround: render the combobox
|
|
2844
|
+
* (for example inside `@if`) only once the selected option is known.
|
|
2845
|
+
* @knownIssue Autocomplete filtering only searches the display label: text in
|
|
2846
|
+
* `subtext` (for example an address line) never matches while the option has a
|
|
2847
|
+
* label. Workaround: put the searchable text in the label, or filter yourself
|
|
2848
|
+
* on `didSearch` and pass the results as `options`.
|
|
2849
|
+
* @knownIssue In autocomplete mode, the clear button, `cleanInput()` and
|
|
2850
|
+
* Escape (with the list closed) empty the field without updating the form
|
|
2851
|
+
* control, so the control keeps the old text. Workaround: when `didSearch`
|
|
2852
|
+
* emits `''` (clear button and `cleanInput()`), reset the control yourself.
|
|
2853
|
+
* @knownIssue Disabling the form control (`control.disable()` or
|
|
2854
|
+
* `new FormControl({ value: '', disabled: true })`) does not disable the
|
|
2855
|
+
* combobox, because the component does not implement `setDisabledState`.
|
|
2856
|
+
* Workaround: also bind `[disabled]` (Angular logs a dev-mode warning about
|
|
2857
|
+
* `disabled` on a reactive form directive; it is safe to ignore here).
|
|
2858
|
+
* @knownIssue In autocomplete mode the input renders `autocomplete="list"`,
|
|
2859
|
+
* which is not a valid autocomplete value, so automated accessibility checks
|
|
2860
|
+
* fail (axe `autocomplete-valid`) and browsers may show their own autofill
|
|
2861
|
+
* suggestions over the options list. Workaround: none in consumer code.
|
|
2862
|
+
*/
|
|
1109
2863
|
declare class OasysComboboxComponent implements ControlValueAccessor, OnInit, AfterViewInit, OnChanges {
|
|
2864
|
+
/** Visible field label and the field's accessible name. Required. */
|
|
1110
2865
|
readonly label: _angular_core.InputSignal<string>;
|
|
2866
|
+
/**
|
|
2867
|
+
* `options` for a select-style pick list; `autocomplete` for a searchable text
|
|
2868
|
+
* field with suggestions, a clear button and optional header and footer.
|
|
2869
|
+
*/
|
|
1111
2870
|
readonly type: _angular_core.InputSignal<ComboboxType>;
|
|
2871
|
+
/**
|
|
2872
|
+
* The choices: `{ value, label, subtext?, icon_name? }` objects, or your own objects with
|
|
2873
|
+
* `valueKey`/`displayKey`/`iconNameKey`/`subtextKey` set. In autocomplete
|
|
2874
|
+
* mode, replacing the array after init reopens the list (for drill-down
|
|
2875
|
+
* searches such as postcode then address); after a one-off async load, call
|
|
2876
|
+
* `closePanel()` if the list should stay closed.
|
|
2877
|
+
*/
|
|
1112
2878
|
readonly options: _angular_core.InputSignal<ComboboxOption<unknown>[]>;
|
|
2879
|
+
/**
|
|
2880
|
+
* Set `false` to mark the field required. This sets the native `required`
|
|
2881
|
+
* attribute, which drives the error styling; it does not validate your form
|
|
2882
|
+
* control, so add `Validators.required` as well.
|
|
2883
|
+
*/
|
|
1113
2884
|
readonly optional: _angular_core.InputSignal<boolean>;
|
|
2885
|
+
/** Help text shown under the field. */
|
|
1114
2886
|
readonly hint: _angular_core.InputSignal<string>;
|
|
2887
|
+
/** Autocomplete only. Heading shown above the list, such as "Saved recipients". */
|
|
1115
2888
|
readonly header: _angular_core.InputSignal<string>;
|
|
2889
|
+
/**
|
|
2890
|
+
* Autocomplete only. Label of a button below the list that emits `didEdit`,
|
|
2891
|
+
* for an escape hatch such as "Enter address manually".
|
|
2892
|
+
*/
|
|
1116
2893
|
readonly footer: _angular_core.InputSignal<string>;
|
|
2894
|
+
/** Focuses the field on load. Use sparingly, only as the first field of a focused task. */
|
|
1117
2895
|
readonly autofocus: _angular_core.InputSignal<boolean>;
|
|
2896
|
+
/**
|
|
2897
|
+
* Disables the field. Bind it even when using reactive forms: disabling the
|
|
2898
|
+
* form control alone does not disable the combobox.
|
|
2899
|
+
*/
|
|
1118
2900
|
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
2901
|
+
/**
|
|
2902
|
+
* Option selected on load, matched to `options` by its value field. Only read
|
|
2903
|
+
* on init.
|
|
2904
|
+
*/
|
|
1119
2905
|
readonly selected: _angular_core.InputSignal<ComboboxOption<unknown>>;
|
|
2906
|
+
/** Field of your option objects to show as the label. Defaults to `label`. */
|
|
1120
2907
|
readonly displayKey: _angular_core.InputSignal<string>;
|
|
2908
|
+
/** Field of your option objects holding an icon name. Defaults to `icon_name`. */
|
|
1121
2909
|
readonly iconNameKey: _angular_core.InputSignal<string>;
|
|
2910
|
+
/** Field of your option objects that identifies each option. Defaults to `value`. */
|
|
1122
2911
|
readonly valueKey: _angular_core.InputSignal<string>;
|
|
2912
|
+
/** Autocomplete only. Field of your option objects shown as secondary text. Defaults to `subtext`. */
|
|
1123
2913
|
readonly subtextKey: _angular_core.InputSignal<string>;
|
|
2914
|
+
/** Text shown in the empty field. Not a substitute for `label` or `hint`. */
|
|
1124
2915
|
readonly placeholder: _angular_core.InputSignal<string>;
|
|
2916
|
+
/** Opens the list on load, without selecting anything. */
|
|
1125
2917
|
readonly showOptions: _angular_core.InputSignal<boolean>;
|
|
2918
|
+
/**
|
|
2919
|
+
* Autocomplete only. Accessible name of the clear button. Pass a translated
|
|
2920
|
+
* string in localised apps.
|
|
2921
|
+
*/
|
|
1126
2922
|
readonly clearLabel: _angular_core.InputSignal<string>;
|
|
2923
|
+
/**
|
|
2924
|
+
* Appended to the selected option's accessible name, as in "Tuesdays is
|
|
2925
|
+
* selected". Pass a translated string in localised apps.
|
|
2926
|
+
*/
|
|
1127
2927
|
readonly selectedLabel: _angular_core.InputSignal<string>;
|
|
2928
|
+
/**
|
|
2929
|
+
* Emits the selected option object when the user picks one. Also emits on
|
|
2930
|
+
* blur and on every keystroke in autocomplete mode, with the current selection
|
|
2931
|
+
* (or `undefined`).
|
|
2932
|
+
*/
|
|
1128
2933
|
readonly didChange: _angular_core.OutputEmitterRef<unknown>;
|
|
2934
|
+
/**
|
|
2935
|
+
* Autocomplete only. Emits the field text on every keystroke, and `''` when
|
|
2936
|
+
* cleared. Use it to fetch results and pass them back as `options`.
|
|
2937
|
+
*/
|
|
1129
2938
|
readonly didSearch: _angular_core.OutputEmitterRef<unknown>;
|
|
2939
|
+
/** Autocomplete only. Emits when the `footer` button is pressed. */
|
|
1130
2940
|
readonly didEdit: _angular_core.OutputEmitterRef<unknown>;
|
|
2941
|
+
/** @ignore */
|
|
1131
2942
|
readonly textInput: Signal<ElementRef<HTMLElement>>;
|
|
2943
|
+
/** @ignore */
|
|
1132
2944
|
readonly combobox: Signal<ElementRef<HTMLElement>>;
|
|
2945
|
+
/** @ignore */
|
|
1133
2946
|
readonly comboboxContainer: Signal<ElementRef<HTMLElement>>;
|
|
2947
|
+
/** @ignore */
|
|
1134
2948
|
readonly footerButton: Signal<ElementRef<HTMLElement>>;
|
|
2949
|
+
/** @ignore */
|
|
1135
2950
|
readonly optionsList: Signal<readonly ElementRef<HTMLElement>[]>;
|
|
2951
|
+
/** @ignore */
|
|
1136
2952
|
readonly textValue: _angular_core.WritableSignal<string>;
|
|
2953
|
+
/** @ignore */
|
|
1137
2954
|
readonly inputDidChange: _angular_core.WritableSignal<boolean>;
|
|
2955
|
+
/** @ignore */
|
|
1138
2956
|
readonly displayOptions: _angular_core.WritableSignal<ComboboxOption<unknown>[]>;
|
|
1139
2957
|
private readonly _selectedOption;
|
|
1140
2958
|
private readonly _focusedOption;
|
|
1141
2959
|
private readonly _focusedOptionId;
|
|
2960
|
+
/** @ignore */
|
|
1142
2961
|
readonly id: _angular_core.WritableSignal<string>;
|
|
1143
|
-
/** Whether
|
|
2962
|
+
/** Whether the list is open. Read it through a `viewChild` to react to the list opening or closing. */
|
|
1144
2963
|
readonly panelOpen: _angular_core.WritableSignal<boolean>;
|
|
1145
2964
|
private readonly openedViaKeyboard;
|
|
1146
|
-
/**
|
|
2965
|
+
/** The selected option, or `undefined`. Read it through a `viewChild`. */
|
|
1147
2966
|
readonly selectedOption: Signal<ComboboxOption | undefined>;
|
|
1148
|
-
/**
|
|
2967
|
+
/** @ignore */
|
|
1149
2968
|
readonly focusedOption: Signal<ComboboxOption | undefined>;
|
|
1150
|
-
/**
|
|
2969
|
+
/** @ignore */
|
|
1151
2970
|
readonly focusedId: Signal<number>;
|
|
2971
|
+
/** @ignore */
|
|
1152
2972
|
readonly shouldShowFocus: Signal<boolean>;
|
|
2973
|
+
/** @ignore */
|
|
1153
2974
|
readonly valueOptionKey: Signal<string>;
|
|
2975
|
+
/** @ignore */
|
|
1154
2976
|
readonly displayOptionKey: Signal<string>;
|
|
2977
|
+
/** @ignore */
|
|
1155
2978
|
readonly subtextOptionKey: Signal<string>;
|
|
2979
|
+
/** @ignore */
|
|
1156
2980
|
readonly listboxId: Signal<string>;
|
|
2981
|
+
/** @ignore */
|
|
1157
2982
|
readonly activeDescendantId: Signal<string>;
|
|
2983
|
+
/** @ignore */
|
|
1158
2984
|
optionId(index: number): string;
|
|
1159
2985
|
private readonly document;
|
|
2986
|
+
/** @ignore */
|
|
1160
2987
|
onChange: (_: unknown) => void;
|
|
2988
|
+
/** @ignore */
|
|
1161
2989
|
onTouched: () => void;
|
|
1162
2990
|
/**
|
|
1163
2991
|
* Click outside combobox close the panel
|
|
2992
|
+
* @ignore
|
|
1164
2993
|
*/
|
|
1165
2994
|
onClick(targetElement: EventTarget | null): void;
|
|
1166
|
-
/**
|
|
2995
|
+
/**
|
|
2996
|
+
* Accessible name for an autocomplete list option.
|
|
2997
|
+
* @ignore
|
|
2998
|
+
*/
|
|
1167
2999
|
autocompleteOptionAriaLabel(option: ComboboxOption): string;
|
|
1168
|
-
/**
|
|
3000
|
+
/**
|
|
3001
|
+
* Accessible name for an options-type list option.
|
|
3002
|
+
* @ignore
|
|
3003
|
+
*/
|
|
1169
3004
|
optionsTypeOptionAriaLabel(option: ComboboxOption): string;
|
|
3005
|
+
/** @ignore */
|
|
1170
3006
|
isOptionSelected(option: ComboboxOption): boolean;
|
|
1171
3007
|
/**
|
|
1172
3008
|
* On Change
|
|
1173
3009
|
* @param changes
|
|
3010
|
+
* @ignore
|
|
1174
3011
|
*/
|
|
3012
|
+
/** @ignore */
|
|
1175
3013
|
ngOnChanges(changes: SimpleChanges): void;
|
|
3014
|
+
/** @ignore */
|
|
1176
3015
|
ngOnInit(): void;
|
|
3016
|
+
/** @ignore */
|
|
1177
3017
|
ngAfterViewInit(): void;
|
|
1178
3018
|
/**
|
|
1179
3019
|
* Select Option
|
|
3020
|
+
* @ignore
|
|
1180
3021
|
*/
|
|
1181
3022
|
selectOption(option?: ComboboxOption, index?: number): void;
|
|
1182
3023
|
/**
|
|
1183
3024
|
* On Key Navigation
|
|
3025
|
+
* @ignore
|
|
1184
3026
|
*/
|
|
1185
3027
|
onKeyDown(event: KeyboardEvent): void;
|
|
3028
|
+
/** @ignore */
|
|
1186
3029
|
onOptionsListKeyDown(event: KeyboardEvent): void;
|
|
3030
|
+
/** @ignore */
|
|
1187
3031
|
onClearButtonKeyDown(event: KeyboardEvent): void;
|
|
3032
|
+
/** @ignore */
|
|
1188
3033
|
onFooterButtonKeyDown(event: KeyboardEvent): void;
|
|
1189
3034
|
private handleAutocompleteTab;
|
|
1190
3035
|
private getClearButtonEl;
|
|
@@ -1192,52 +3037,69 @@ declare class OasysComboboxComponent implements ControlValueAccessor, OnInit, Af
|
|
|
1192
3037
|
/**
|
|
1193
3038
|
* Close the panel when focus leaves the combobox entirely (e.g. tabbing past
|
|
1194
3039
|
* the footer button to the next field on the page).
|
|
3040
|
+
* @ignore
|
|
1195
3041
|
*/
|
|
1196
3042
|
onContainerFocusOut(event: FocusEvent): void;
|
|
1197
3043
|
/**
|
|
1198
3044
|
* Escape from the footer closes the panel and returns focus to the input.
|
|
3045
|
+
* @ignore
|
|
1199
3046
|
*/
|
|
1200
3047
|
onFooterEscape(event: Event): void;
|
|
1201
3048
|
/**
|
|
1202
3049
|
* Toggle Options Panel
|
|
3050
|
+
* @ignore
|
|
1203
3051
|
*/
|
|
1204
3052
|
togglePanel(): void;
|
|
1205
3053
|
/**
|
|
1206
3054
|
* Open Options Panel
|
|
3055
|
+
* @ignore
|
|
1207
3056
|
*/
|
|
1208
3057
|
openPanelWithoutSelectingOption(event?: Event): void;
|
|
1209
3058
|
private openPanelAndSelectOption;
|
|
1210
3059
|
/**
|
|
1211
|
-
*
|
|
3060
|
+
* Closes the list, keeping the current selection. Call it through a
|
|
3061
|
+
* `viewChild`, for example after loading `options` asynchronously in
|
|
3062
|
+
* autocomplete mode.
|
|
1212
3063
|
*/
|
|
1213
3064
|
closePanel(): void;
|
|
1214
3065
|
/**
|
|
1215
3066
|
* Get Input display value
|
|
3067
|
+
* @ignore
|
|
1216
3068
|
*/
|
|
1217
3069
|
writeValue(textValue: string): void;
|
|
3070
|
+
/** @ignore */
|
|
1218
3071
|
registerOnChange(fn: (_: unknown) => void): void;
|
|
3072
|
+
/** @ignore */
|
|
1219
3073
|
registerOnTouched(fn: () => void): void;
|
|
1220
3074
|
/**
|
|
1221
3075
|
* On Model Change (options type)
|
|
3076
|
+
* @ignore
|
|
1222
3077
|
*/
|
|
1223
3078
|
onModelChange(textValue: string): void;
|
|
1224
3079
|
/**
|
|
1225
3080
|
* On Model Change (autocomplete type)
|
|
3081
|
+
* @ignore
|
|
1226
3082
|
*/
|
|
1227
3083
|
onModelChangeAutocomplete(textValue: string): void;
|
|
1228
3084
|
/**
|
|
1229
3085
|
* Event handling for Input value
|
|
3086
|
+
* @ignore
|
|
1230
3087
|
*/
|
|
1231
3088
|
handleEvent(): void;
|
|
1232
3089
|
/**
|
|
1233
|
-
*
|
|
3090
|
+
* Clears the field text and selection and closes the list, as the clear button
|
|
3091
|
+
* does. Emits `didSearch` with `''`. Call it through a `viewChild` to reset the
|
|
3092
|
+
* field. Does not update the form control: reset that yourself.
|
|
1234
3093
|
*/
|
|
1235
3094
|
cleanInput(): void;
|
|
1236
3095
|
/**
|
|
1237
3096
|
* On footer action
|
|
3097
|
+
* @ignore
|
|
1238
3098
|
*/
|
|
1239
3099
|
onFooterAction(): void;
|
|
3100
|
+
/** @ignore */
|
|
1240
3101
|
onTextInputClick(): void;
|
|
3102
|
+
/** @ignore */
|
|
1241
3103
|
onScreenReaderFocus(): void;
|
|
1242
3104
|
/**
|
|
1243
3105
|
* Search in Autocomplete
|
|
@@ -1280,22 +3142,97 @@ declare class OasysComboboxComponent implements ControlValueAccessor, OnInit, Af
|
|
|
1280
3142
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OasysComboboxComponent, "ui-combobox", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optional": { "alias": "optional"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "header": { "alias": "header"; "required": false; "isSignal": true; }; "footer": { "alias": "footer"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "displayKey": { "alias": "displayKey"; "required": false; "isSignal": true; }; "iconNameKey": { "alias": "iconNameKey"; "required": false; "isSignal": true; }; "valueKey": { "alias": "valueKey"; "required": false; "isSignal": true; }; "subtextKey": { "alias": "subtextKey"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "showOptions": { "alias": "showOptions"; "required": false; "isSignal": true; }; "clearLabel": { "alias": "clearLabel"; "required": false; "isSignal": true; }; "selectedLabel": { "alias": "selectedLabel"; "required": false; "isSignal": true; }; }, { "didChange": "didChange"; "didSearch": "didSearch"; "didEdit": "didEdit"; }, never, ["ui-form-errors"], true, never>;
|
|
1281
3143
|
}
|
|
1282
3144
|
|
|
3145
|
+
/**
|
|
3146
|
+
* One tab inside a `<ui-tab-group>` (`<ui-tab>`). Its `tab_label` is shown in
|
|
3147
|
+
* the tab row and its projected content is the panel shown while it is
|
|
3148
|
+
* active. Only use it as a direct child of `<ui-tab-group>`; on its own it
|
|
3149
|
+
* renders nothing.
|
|
3150
|
+
*
|
|
3151
|
+
* @import import { OasysTabComponent } from 'oasys-lib';
|
|
3152
|
+
*/
|
|
1283
3153
|
declare class OasysTabComponent implements AfterContentInit {
|
|
3154
|
+
/**
|
|
3155
|
+
* Text (a string) shown in the tab row, also used as the tab's accessible
|
|
3156
|
+
* name. Keep it short (one or two words) and plain text; bind it
|
|
3157
|
+
* (`[tab_label]`) for translated strings.
|
|
3158
|
+
*/
|
|
1284
3159
|
tab_label: any;
|
|
3160
|
+
/**
|
|
3161
|
+
* Open this tab when the group first renders instead of the first tab. Set
|
|
3162
|
+
* it on one tab only; if several are set, the first wins. Only read on init.
|
|
3163
|
+
*/
|
|
1285
3164
|
tab_active: boolean;
|
|
3165
|
+
/**
|
|
3166
|
+
* Emitted when the user opens this tab (click or Enter), including when it
|
|
3167
|
+
* is already open. Not emitted for the tab shown initially.
|
|
3168
|
+
*/
|
|
1286
3169
|
clicked: EventEmitter<void>;
|
|
3170
|
+
/** @ignore */
|
|
1287
3171
|
template: TemplateRef<void>;
|
|
3172
|
+
/** @ignore */
|
|
1288
3173
|
ngAfterContentInit(): void;
|
|
1289
3174
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysTabComponent, never>;
|
|
1290
3175
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OasysTabComponent, "ui-tab", never, { "tab_label": { "alias": "tab_label"; "required": false; }; "tab_active": { "alias": "tab_active"; "required": false; }; }, { "clicked": "clicked"; }, never, ["*"], true, never>;
|
|
1291
3176
|
}
|
|
1292
3177
|
|
|
3178
|
+
/**
|
|
3179
|
+
* A row of tabs that switches between panels of related content in the same
|
|
3180
|
+
* place on the page (`<ui-tab-group>`). Use it for peer views of one subject,
|
|
3181
|
+
* such as "Current" and "Past" orders. Don't use it for navigating between
|
|
3182
|
+
* pages (use links) or for steps in a flow.
|
|
3183
|
+
*
|
|
3184
|
+
* Put one `<ui-tab>` per panel inside the group; each tab's `tab_label` is its
|
|
3185
|
+
* heading and its content is the panel. At least one `<ui-tab>` is required,
|
|
3186
|
+
* otherwise the group throws on init. The first tab is shown unless one has
|
|
3187
|
+
* `[tab_active]="true"`.
|
|
3188
|
+
*
|
|
3189
|
+
* Only the active panel is rendered. Switching tabs destroys the previous
|
|
3190
|
+
* panel's content and creates the new one, so component state inside a panel
|
|
3191
|
+
* (such as unsaved form input) is lost when the user switches away.
|
|
3192
|
+
*
|
|
3193
|
+
* Renders `role="tablist"`, a `role="tab"` element per tab with
|
|
3194
|
+
* `aria-selected`, and one `role="tabpanel"` for the active panel. Keyboard:
|
|
3195
|
+
* Tab moves between tabs, Left and Right arrows move focus along the row
|
|
3196
|
+
* (wrapping), and Enter activates the focused tab. React to a tab being opened
|
|
3197
|
+
* with each `<ui-tab>`'s `clicked` output.
|
|
3198
|
+
*
|
|
3199
|
+
* @import import { OasysTabGroupComponent, OasysTabComponent } from 'oasys-lib';
|
|
3200
|
+
* @knownIssue With more than one `<ui-tab-group>` on the page, the arrow keys
|
|
3201
|
+
* move focus to the wrong tabs, including tabs in the other group: the
|
|
3202
|
+
* keyboard handler looks up tabs across the whole document. Workaround: show
|
|
3203
|
+
* only one tab group on a page at a time.
|
|
3204
|
+
* @knownIssue `tab_active` is only read when the group initialises: changing
|
|
3205
|
+
* it later does not switch tabs. Workaround: decide the starting tab before
|
|
3206
|
+
* the group renders, or re-create the group (for example inside an `@if`) to
|
|
3207
|
+
* reset it.
|
|
3208
|
+
* @knownIssue The keyboard pattern is incomplete: Space does not activate a
|
|
3209
|
+
* tab, Home and End do nothing, and every tab is a separate Tab stop instead
|
|
3210
|
+
* of the tab list being one. Workaround: none in consumer code; Enter and
|
|
3211
|
+
* click work.
|
|
3212
|
+
* @knownIssue Tabs and the panel are not linked (no `aria-controls`,
|
|
3213
|
+
* `aria-labelledby` or `id`), so the panel has no accessible name.
|
|
3214
|
+
* Workaround: start each panel's content with a heading or text that names
|
|
3215
|
+
* it.
|
|
3216
|
+
* @knownIssue `OasysTabsModule` exports nothing, so importing it does not
|
|
3217
|
+
* make `<ui-tab-group>` or `<ui-tab>` available. Workaround: import the
|
|
3218
|
+
* standalone `OasysTabGroupComponent` and `OasysTabComponent` instead.
|
|
3219
|
+
*/
|
|
1293
3220
|
declare class OasysTabGroupComponent implements AfterContentInit {
|
|
3221
|
+
/**
|
|
3222
|
+
* Width of the line under the active tab: `small` (30px) for compact rows
|
|
3223
|
+
* and filters, `large` (60px) for page-level tabs. Tab labels are the same
|
|
3224
|
+
* size either way.
|
|
3225
|
+
*/
|
|
1294
3226
|
tab_size: 'small' | 'large';
|
|
3227
|
+
/** @ignore */
|
|
1295
3228
|
tabs: QueryList<OasysTabComponent>;
|
|
3229
|
+
/** @ignore */
|
|
1296
3230
|
activeComponent: OasysTabComponent;
|
|
3231
|
+
/** @ignore */
|
|
1297
3232
|
getIndicatorClass(): string;
|
|
3233
|
+
/** @ignore */
|
|
1298
3234
|
ngAfterContentInit(): void;
|
|
3235
|
+
/** @ignore */
|
|
1299
3236
|
activateTab(tab: OasysTabComponent): void;
|
|
1300
3237
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysTabGroupComponent, never>;
|
|
1301
3238
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OasysTabGroupComponent, "ui-tab-group", never, { "tab_size": { "alias": "tab_size"; "required": false; }; }, {}, ["tabs"], never, true, never>;
|
|
@@ -1343,9 +3280,39 @@ declare class OasysTabsModule {
|
|
|
1343
3280
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<OasysTabsModule>;
|
|
1344
3281
|
}
|
|
1345
3282
|
|
|
3283
|
+
/**
|
|
3284
|
+
* A horizontal bar that shows how far through something the customer is
|
|
3285
|
+
* (`<ui-progress-bar>`), for example delivery tracking or steps in a flow.
|
|
3286
|
+
*
|
|
3287
|
+
* The filled width is `currentValue / maxValue`, clamped between 0% and 100%,
|
|
3288
|
+
* and animates when it changes. It fills the width of its container and has
|
|
3289
|
+
* no text of its own: put a visible label next to it that says what the
|
|
3290
|
+
* progress is (for example "Out for delivery" or "Step 2 of 4").
|
|
3291
|
+
*
|
|
3292
|
+
* Accessibility: renders `role="progressbar"` with `aria-valuemin="0"`,
|
|
3293
|
+
* `aria-valuemax="100"` and `aria-valuenow` set to the percentage (not the raw
|
|
3294
|
+
* `currentValue`).
|
|
3295
|
+
*
|
|
3296
|
+
* @import import { OasysProgressBarComponent } from 'oasys-lib';
|
|
3297
|
+
* @knownIssue The progress bar has no accessible name and there is no input to
|
|
3298
|
+
* give it one (the role is on an inner element, so `aria-label` on
|
|
3299
|
+
* `<ui-progress-bar>` doesn't reach it). Screen readers announce only
|
|
3300
|
+
* "progress bar, N%" and axe reports `aria-progressbar-name`. Workaround: always
|
|
3301
|
+
* show the progress as visible text right next to the bar so the information is
|
|
3302
|
+
* available without it.
|
|
3303
|
+
*/
|
|
1346
3304
|
declare class ProgressBarComponent {
|
|
3305
|
+
/**
|
|
3306
|
+
* How much progress has been made, in the same units as `maxValue`. Values
|
|
3307
|
+
* below 0 or above `maxValue` are clamped.
|
|
3308
|
+
*/
|
|
1347
3309
|
currentValue: number;
|
|
3310
|
+
/**
|
|
3311
|
+
* The value that means complete. Use it for step-based progress, e.g.
|
|
3312
|
+
* `currentValue` 3 of `maxValue` 5. A value of 0 or less shows an empty bar.
|
|
3313
|
+
*/
|
|
1348
3314
|
maxValue: number;
|
|
3315
|
+
/** @ignore */
|
|
1349
3316
|
get percentage(): number;
|
|
1350
3317
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ProgressBarComponent, never>;
|
|
1351
3318
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ProgressBarComponent, "ui-progress-bar", never, { "currentValue": { "alias": "currentValue"; "required": false; }; "maxValue": { "alias": "maxValue"; "required": false; }; }, {}, never, never, true, never>;
|
|
@@ -1355,62 +3322,243 @@ declare const LOGO_NAMES: readonly ["amazon", "amex", "apple-pay", "bancontact",
|
|
|
1355
3322
|
type LogoName = (typeof LOGO_NAMES)[number];
|
|
1356
3323
|
|
|
1357
3324
|
/**
|
|
1358
|
-
* Renders full-colour artwork from the shared logo sprite. Unlike
|
|
1359
|
-
* logos keep their own colours, so they look the same on every
|
|
1360
|
-
* payment provider badges exist so far
|
|
1361
|
-
*
|
|
3325
|
+
* Renders full-colour artwork from the shared logo sprite (`<ui-logo>`). Unlike
|
|
3326
|
+
* `<ui-icon>`, logos keep their own colours, so they look the same on every
|
|
3327
|
+
* brand. Only payment provider badges exist so far (the payment icons that used
|
|
3328
|
+
* to be in the icon sprite live here now); they render at a fixed 45 x 32 px
|
|
3329
|
+
* so rows of payment methods line up.
|
|
3330
|
+
*
|
|
3331
|
+
* Renders an inline `<svg viewBox="0 0 45 32">` that references
|
|
3332
|
+
* `./shared/assets/logos/logos.svg#logo-<logo_name>`. The consuming app must
|
|
3333
|
+
* serve `oasys-lib/src/assets/shared` at `shared/assets` relative to the
|
|
3334
|
+
* document base URL. An unknown `logo_name` renders nothing, silently.
|
|
3335
|
+
*
|
|
3336
|
+
* Accessibility: decorative by default (`aria-hidden="true"`), which is right
|
|
3337
|
+
* when visible text next to it names the provider. When the logo alone says
|
|
3338
|
+
* which payment methods are accepted, set `alt_text` to the provider's name
|
|
3339
|
+
* (for example "Visa"); it becomes the `aria-label` of a `role="img"`.
|
|
3340
|
+
*
|
|
3341
|
+
* Lay out a row of logos with `<ui-stack stack_direction="x" [stack_wrap]="true">`.
|
|
3342
|
+
*
|
|
3343
|
+
* @import import { OasysLogoComponent } from 'oasys-lib';
|
|
1362
3344
|
*/
|
|
1363
3345
|
declare class LogoComponent {
|
|
3346
|
+
/** Which logo to show. All names are listed in the exported `LOGO_NAMES`. */
|
|
1364
3347
|
logo_name: LogoName;
|
|
1365
3348
|
/** Any CSS length, e.g. '4.8rem'. Sets the height; the width keeps the 45 x 32 ratio. */
|
|
1366
3349
|
logo_size_override?: string;
|
|
1367
|
-
/**
|
|
3350
|
+
/**
|
|
3351
|
+
* Accessible name, usually the provider's name (for example "Visa"). Leave
|
|
3352
|
+
* empty when nearby text already names it; the logo is then hidden from
|
|
3353
|
+
* assistive technology.
|
|
3354
|
+
*/
|
|
1368
3355
|
alt_text: string;
|
|
3356
|
+
/** @ignore */
|
|
1369
3357
|
get isKnownLogo(): boolean;
|
|
3358
|
+
/** @ignore */
|
|
1370
3359
|
get logoPath(): string;
|
|
1371
3360
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LogoComponent, never>;
|
|
1372
3361
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LogoComponent, "ui-logo", never, { "logo_name": { "alias": "logo_name"; "required": true; }; "logo_size_override": { "alias": "logo_size_override"; "required": false; }; "alt_text": { "alias": "alt_text"; "required": false; }; }, {}, never, never, true, never>;
|
|
1373
3362
|
}
|
|
1374
3363
|
|
|
3364
|
+
/**
|
|
3365
|
+
* One field's entry in a `<ui-form-errors-summary>`
|
|
3366
|
+
* (`<ui-form-errors-summary-item>`). Shows the first error message of
|
|
3367
|
+
* `abstractControl` from `error_messages`, and nothing when the control is
|
|
3368
|
+
* valid or the key has no message.
|
|
3369
|
+
*
|
|
3370
|
+
* Clicking it or pressing Enter on it focuses the matching `<ui-text-input>`
|
|
3371
|
+
* and scrolls it into view; Shift+Tab from that input returns to the item. Only
|
|
3372
|
+
* `<ui-text-input>` is supported, not textarea, combobox or other controls.
|
|
3373
|
+
* See the known issues on `<ui-form-errors-summary>` before relying on this.
|
|
3374
|
+
*
|
|
3375
|
+
* @import import { OasysFormErrorsSummaryItemComponent } from 'oasys-lib';
|
|
3376
|
+
*/
|
|
1375
3377
|
declare class OasysFormErrorsSummaryItemComponent {
|
|
1376
3378
|
private readonly elementRef;
|
|
3379
|
+
/** @ignore */
|
|
1377
3380
|
readonly itemId: WritableSignal<string>;
|
|
3381
|
+
/** The control this item reports on, e.g. `form.get('email')`. Must belong to the summary's `formGroup` for click-to-focus to find it. */
|
|
1378
3382
|
abstractControl: _angular_core.InputSignal<AbstractControl<any, any, any>>;
|
|
3383
|
+
/** Translated messages keyed by validator error key, the same map as the field's `<ui-form-errors>`. */
|
|
1379
3384
|
error_messages: _angular_core.InputSignal<ValidationErrorTypes>;
|
|
3385
|
+
/** @ignore */
|
|
1380
3386
|
focusOnControl(): void;
|
|
1381
3387
|
private trapShiftTab;
|
|
3388
|
+
/** @ignore */
|
|
1382
3389
|
errorMessage: _angular_core.Signal<string>;
|
|
1383
3390
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysFormErrorsSummaryItemComponent, never>;
|
|
1384
3391
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OasysFormErrorsSummaryItemComponent, "ui-form-errors-summary-item", never, { "abstractControl": { "alias": "abstractControl"; "required": false; "isSignal": true; }; "error_messages": { "alias": "error_messages"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1385
3392
|
}
|
|
1386
3393
|
|
|
3394
|
+
/**
|
|
3395
|
+
* Lists every error in a form in one box (`<ui-form-errors-summary>`), so
|
|
3396
|
+
* users submitting a form know what to fix and can jump to each field. Use it
|
|
3397
|
+
* at the top of forms with more than one or two fields, alongside the inline
|
|
3398
|
+
* `<ui-form-errors>` on each field.
|
|
3399
|
+
*
|
|
3400
|
+
* Built from three components, all needed:
|
|
3401
|
+
* - `<ui-form-errors-summary [formGroup]>`: the box. Shown whenever the form
|
|
3402
|
+
* group is invalid and has at least one item.
|
|
3403
|
+
* - `<ui-form-errors-summary-title>`: the heading, e.g. "There's a problem
|
|
3404
|
+
* with your details".
|
|
3405
|
+
* - `<ui-form-errors-summary-item [abstractControl] [error_messages]>`: one per
|
|
3406
|
+
* field. Shows that control's first error message and nothing when the
|
|
3407
|
+
* control is valid.
|
|
3408
|
+
*
|
|
3409
|
+
* Usage rules:
|
|
3410
|
+
* - It shows as soon as the form is invalid, including on first load. Wrap it
|
|
3411
|
+
* in `@if (submitted)` so it only appears after the user submits.
|
|
3412
|
+
* - It has no live region and does not move focus. After submit, move focus to
|
|
3413
|
+
* the title (it has `tabindex="-1"`) or a focusable wrapper so screen readers
|
|
3414
|
+
* announce it and keyboard users land on it.
|
|
3415
|
+
* - Use the same messages as the inline `<ui-form-errors>` so both match.
|
|
3416
|
+
* - Only use one summary per page: the title has a fixed `id`.
|
|
3417
|
+
*
|
|
3418
|
+
* Logs a console error if it has no items.
|
|
3419
|
+
*
|
|
3420
|
+
* @import import { OasysFormErrorsSummaryComponent, OasysFormErrorsSummaryTitleComponent, OasysFormErrorsSummaryItemComponent } from 'oasys-lib';
|
|
3421
|
+
* @knownIssue Clicking a `<ui-form-errors-summary-item>` does nothing unless
|
|
3422
|
+
* the target `<ui-text-input>` has an `ng-reflect-name` attribute equal to its
|
|
3423
|
+
* control name. Angular no longer outputs these attributes (never in
|
|
3424
|
+
* production, and not in development since v20 by default). Workaround: add a
|
|
3425
|
+
* static attribute matching `formControlName`, e.g.
|
|
3426
|
+
* `<ui-text-input formControlName="email" ng-reflect-name="email">`.
|
|
3427
|
+
* @knownIssue A `<ui-form-errors-summary-item>` works out its message when it
|
|
3428
|
+
* first renders and does not follow later changes to the control's errors: a
|
|
3429
|
+
* control that was valid at that point never appears, and one whose error
|
|
3430
|
+
* changes (for example from `required` to `email`) keeps the first message. It
|
|
3431
|
+
* does disappear once the control is valid. Workaround: only render the summary
|
|
3432
|
+
* after submit, and render the items with `@for` over the fields that are
|
|
3433
|
+
* invalid now, tracking by field name and error key, so an item is re-created
|
|
3434
|
+
* when its error changes.
|
|
3435
|
+
* @knownIssue The error list is not a valid list: each `<li>` sits inside a
|
|
3436
|
+
* `<ui-form-errors-summary-item>` element rather than directly in the `<ul>`, so
|
|
3437
|
+
* screen readers may not announce it as a list or say how many errors there
|
|
3438
|
+
* are, and automated accessibility checks fail (axe `list` / `listitem`).
|
|
3439
|
+
* Workaround: none in consumer code; keep the summary title explicit about the
|
|
3440
|
+
* number of errors where you can.
|
|
3441
|
+
*/
|
|
1387
3442
|
declare class OasysFormErrorsSummaryComponent {
|
|
3443
|
+
/** The form to summarise. The box shows while it is invalid; pass the same `FormGroup` your `<form [formGroup]>` uses. */
|
|
1388
3444
|
formGroup: _angular_core.InputSignal<FormGroup<any>>;
|
|
3445
|
+
/** @ignore */
|
|
1389
3446
|
errorsSummaryItems: _angular_core.Signal<readonly OasysFormErrorsSummaryItemComponent[]>;
|
|
3447
|
+
/** @ignore */
|
|
1390
3448
|
hasErrorsSummaryItems: _angular_core.Signal<boolean>;
|
|
1391
3449
|
constructor();
|
|
1392
3450
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysFormErrorsSummaryComponent, never>;
|
|
1393
3451
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OasysFormErrorsSummaryComponent, "ui-form-errors-summary", never, { "formGroup": { "alias": "formGroup"; "required": true; "isSignal": true; }; }, {}, ["errorsSummaryItems"], ["ui-form-errors-summary-title", "*"], true, never>;
|
|
1394
3452
|
}
|
|
1395
3453
|
|
|
3454
|
+
/**
|
|
3455
|
+
* Heading of a `<ui-form-errors-summary>` (`<ui-form-errors-summary-title>`).
|
|
3456
|
+
* Project the text, e.g. "There's a problem with your details". It is
|
|
3457
|
+
* programmatically focusable (`tabindex="-1"`): move focus here after a failed
|
|
3458
|
+
* submit so screen readers announce the summary. Each item's accessible name
|
|
3459
|
+
* starts with this title.
|
|
3460
|
+
*
|
|
3461
|
+
* @import import { OasysFormErrorsSummaryTitleComponent } from 'oasys-lib';
|
|
3462
|
+
*/
|
|
1396
3463
|
declare class OasysFormErrorsSummaryTitleComponent {
|
|
1397
3464
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysFormErrorsSummaryTitleComponent, never>;
|
|
1398
3465
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OasysFormErrorsSummaryTitleComponent, "ui-form-errors-summary-title", never, {}, {}, never, ["*"], true, never>;
|
|
1399
3466
|
}
|
|
1400
3467
|
|
|
3468
|
+
/**
|
|
3469
|
+
* Hands every Oasys link to the consuming app's routing handler. It matches
|
|
3470
|
+
* **every `<a>`** in a template that imports it (plus `[uiHref]`), including
|
|
3471
|
+
* the links rendered inside `<ui-button href>`, `<ui-promo-card>`,
|
|
3472
|
+
* `<ui-section>` and `<ui-seo-block>`. There are no
|
|
3473
|
+
* inputs; it is mostly something apps configure rather than use.
|
|
3474
|
+
*
|
|
3475
|
+
* It calls the `ROUTING_HANDLER` provider (`IRoutingHandlerService`):
|
|
3476
|
+
* - `handleHrefDomains(anchor)` once, after the link renders: the place to
|
|
3477
|
+
* rewrite the `href` or add `target="_blank"` / `rel="noopener"` to links
|
|
3478
|
+
* that leave your domains.
|
|
3479
|
+
* - `handleRoutingOnClick(anchor, event)` on every click: the place to route
|
|
3480
|
+
* internally (call `event.preventDefault()` and navigate with your router),
|
|
3481
|
+
* open modals, or track analytics. The directive itself never prevents the
|
|
3482
|
+
* default, so a handler that does nothing leaves a normal browser link.
|
|
3483
|
+
*
|
|
3484
|
+
* Setup: every app (and test) that renders an Oasys link must provide the
|
|
3485
|
+
* token in its `bootstrapApplication` (or test) providers. There is no
|
|
3486
|
+
* default: without it, the first link that renders throws
|
|
3487
|
+
* `NullInjectorError: No provider for InjectionToken ROUTING_HANDLER`.
|
|
3488
|
+
*
|
|
3489
|
+
* Example handler (an `@Injectable` service provided in root):
|
|
3490
|
+
*
|
|
3491
|
+
* ```ts
|
|
3492
|
+
* export class AppRoutingHandler implements IRoutingHandlerService {
|
|
3493
|
+
* private readonly router = inject(Router);
|
|
3494
|
+
* handleHrefDomains(anchor: HTMLAnchorElement): void {
|
|
3495
|
+
* if (anchor.hostname !== location.hostname) {
|
|
3496
|
+
* anchor.target = '_blank';
|
|
3497
|
+
* anchor.rel = 'noopener';
|
|
3498
|
+
* }
|
|
3499
|
+
* }
|
|
3500
|
+
* handleRoutingOnClick(anchor: HTMLAnchorElement, event: MouseEvent): void {
|
|
3501
|
+
* if (anchor.hostname === location.hostname && anchor.target !== '_blank') {
|
|
3502
|
+
* event.preventDefault();
|
|
3503
|
+
* this.router.navigateByUrl(anchor.pathname + anchor.search);
|
|
3504
|
+
* }
|
|
3505
|
+
* }
|
|
3506
|
+
* }
|
|
3507
|
+
* // providers: [{ provide: ROUTING_HANDLER, useExisting: AppRoutingHandler }]
|
|
3508
|
+
* ```
|
|
3509
|
+
*
|
|
3510
|
+
* Links stay real `<a href>` elements, so they keep native keyboard and
|
|
3511
|
+
* screen reader behaviour; give each one text that makes sense on its own.
|
|
3512
|
+
*
|
|
3513
|
+
* @import import { OasysHrefDirective, ROUTING_HANDLER, IRoutingHandlerService } from 'oasys-lib';
|
|
3514
|
+
*/
|
|
1401
3515
|
declare class OasysHrefDirective implements AfterViewInit {
|
|
1402
3516
|
private readonly element;
|
|
1403
3517
|
private readonly routingHandler;
|
|
3518
|
+
/** @ignore */
|
|
1404
3519
|
onClick(event: any): void;
|
|
3520
|
+
/** @ignore */
|
|
1405
3521
|
ngAfterViewInit(): void;
|
|
1406
3522
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysHrefDirective, never>;
|
|
1407
3523
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<OasysHrefDirective, "a, uiHref, [uiHref]", never, {}, {}, never, never, true, never>;
|
|
1408
3524
|
}
|
|
1409
3525
|
|
|
3526
|
+
/**
|
|
3527
|
+
* Moves keyboard focus to the element shortly after it is created (`[autofocus]`
|
|
3528
|
+
* attribute). It focuses 500ms after init, so it also works for elements that
|
|
3529
|
+
* appear inside modals, drawers and steps that animate in, where the native
|
|
3530
|
+
* `autofocus` attribute may not apply.
|
|
3531
|
+
*
|
|
3532
|
+
* `<ui-text-input>` and `<ui-combobox>` already use it: prefer their own
|
|
3533
|
+
* `autofocus` input over adding this to an Oasys component yourself. Use the
|
|
3534
|
+
* directive directly on native focusable elements (`input`, `button`, `a`,
|
|
3535
|
+
* `textarea`, or anything with `tabindex`).
|
|
3536
|
+
*
|
|
3537
|
+
* Always bind a boolean: `[autofocus]="true"` or `[autofocus]="condition"`.
|
|
3538
|
+
* The selector matches the native attribute, so once the directive is imported,
|
|
3539
|
+
* a bare `autofocus` attribute is a template type error under strict templates.
|
|
3540
|
+
*
|
|
3541
|
+
* Accessibility: moving focus without the user asking can disorient screen
|
|
3542
|
+
* reader and keyboard users. Only autofocus the obvious first field of a
|
|
3543
|
+
* focused task (a modal, a single-field form), never on page load of a normal
|
|
3544
|
+
* page, and only one element per view.
|
|
3545
|
+
*
|
|
3546
|
+
* @import import { OasysAutofocusDirective } from 'oasys-lib';
|
|
3547
|
+
* @knownIssue The value is read once, when the element is created: changing it
|
|
3548
|
+
* from `false` to `true` later (for example to focus a field that has just
|
|
3549
|
+
* failed validation) does nothing. Workaround: create the element only when it
|
|
3550
|
+
* should take focus (wrap it in `@if`), or call `.focus()` on the element
|
|
3551
|
+
* yourself.
|
|
3552
|
+
*/
|
|
1410
3553
|
declare class OasysAutofocusDirective implements OnInit {
|
|
1411
3554
|
private el;
|
|
1412
3555
|
private _autofocus;
|
|
3556
|
+
/**
|
|
3557
|
+
* Whether to focus the element 500ms after it is created. `true` or unset
|
|
3558
|
+
* focuses; `false` does not. Only the value at creation time counts.
|
|
3559
|
+
*/
|
|
1413
3560
|
set autofocus(condition: boolean);
|
|
3561
|
+
/** @ignore */
|
|
1414
3562
|
ngOnInit(): void;
|
|
1415
3563
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OasysAutofocusDirective, never>;
|
|
1416
3564
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<OasysAutofocusDirective, "[autofocus]", never, { "autofocus": { "alias": "autofocus"; "required": false; }; }, {}, never, never, true, never>;
|
|
@@ -1424,8 +3572,45 @@ declare const THEME_VALUE: {
|
|
|
1424
3572
|
declare const SCOPED_THEME_CLASSES: readonly ["loyalty-tier-1", "loyalty-tier-2"];
|
|
1425
3573
|
type ScopedThemeClass = (typeof SCOPED_THEME_CLASSES)[number];
|
|
1426
3574
|
type OasysThemeName = typeof THEME_VALUE.DEFAULT | ScopedThemeClass;
|
|
3575
|
+
/**
|
|
3576
|
+
* Switches part of the page to a loyalty theme (`ui-theme` / `uiTheme`
|
|
3577
|
+
* attribute). Put it on any element or Oasys component; that element and
|
|
3578
|
+
* everything inside it then use the chosen theme's design tokens, so one view
|
|
3579
|
+
* can mix the normal brand look with loyalty-tier sections.
|
|
3580
|
+
*
|
|
3581
|
+
* - `loyalty-tier-1` / `loyalty-tier-2` add that class to the element.
|
|
3582
|
+
* - `default` resets the subtree back to the page brand inside a themed
|
|
3583
|
+
* section: it copies the nearest ancestor's `brand-tokens-*` class onto the
|
|
3584
|
+
* element. Use it for e.g. a normal product card inside a loyalty panel.
|
|
3585
|
+
*
|
|
3586
|
+
* Requirements:
|
|
3587
|
+
* - Import the directive (`OasysThemeDirective` or `OasysDirectivesModule`).
|
|
3588
|
+
* A static `ui-theme="loyalty-tier-1"` on an element whose template does not
|
|
3589
|
+
* import it does nothing, with no error.
|
|
3590
|
+
* - The page needs a base brand class (`brand-tokens-bloomandwild`,
|
|
3591
|
+
* `brand-tokens-bloomon` or `brand-tokens-bergamotte`) on an ancestor, and
|
|
3592
|
+
* the matching `<brand>-loyalty-tier-1/2/variables.css` must be loaded. The
|
|
3593
|
+
* tier tokens are scoped as `.brand-tokens-<brand> .loyalty-tier-N`, so they
|
|
3594
|
+
* do nothing under a whole-page loyalty brand class such as
|
|
3595
|
+
* `brand-tokens-bloomandwild-loyalty-tier-1`.
|
|
3596
|
+
*
|
|
3597
|
+
* Theming only changes colours and other tokens. It carries no meaning for
|
|
3598
|
+
* assistive technology, so never rely on the theme alone to tell users which
|
|
3599
|
+
* tier they are in: say it in text too.
|
|
3600
|
+
*
|
|
3601
|
+
* @import import { OasysThemeDirective } from 'oasys-lib';
|
|
3602
|
+
*/
|
|
1427
3603
|
declare class OasysThemeDirective {
|
|
3604
|
+
/**
|
|
3605
|
+
* Theme for this element and its subtree, written `ui-theme="..."`. Leave it
|
|
3606
|
+
* off to inherit from the parent; `default` explicitly resets to the page
|
|
3607
|
+
* brand. Bind it (`[ui-theme]="tierThemeName()"`) to follow the user's tier.
|
|
3608
|
+
*/
|
|
1428
3609
|
readonly uiThemeDashed: _angular_core.InputSignal<OasysThemeName>;
|
|
3610
|
+
/**
|
|
3611
|
+
* Same as `ui-theme`, written `uiTheme`. When both are set, `uiTheme` wins;
|
|
3612
|
+
* when it is `undefined`, `ui-theme` is used.
|
|
3613
|
+
*/
|
|
1429
3614
|
readonly uiThemeCamel: _angular_core.InputSignal<OasysThemeName>;
|
|
1430
3615
|
private readonly elementRef;
|
|
1431
3616
|
private appliedDefaultBrandClass?;
|