@eagami/ui 5.20.0 → 5.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/eagami-ui.mjs +329 -73
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/src/styles/_mixins.scss +40 -0
- package/types/eagami-ui.d.ts +41 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eagami/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.21.0",
|
|
4
4
|
"description": "Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties",
|
|
5
5
|
"author": "Michal Wiraszka <michal@eagami.com>",
|
|
6
6
|
"license": "MIT",
|
package/src/styles/_mixins.scss
CHANGED
|
@@ -30,6 +30,46 @@ $target-size-min: 24px;
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
// A readonly field takes no input, so it offers a pointer nothing: no ring on
|
|
34
|
+
// click, no icon hover, no pointer cursor. Keyboard focus still has to be
|
|
35
|
+
// visible, so the border alone picks up the focus colour, without the halo.
|
|
36
|
+
@mixin readonly-focus-cue {
|
|
37
|
+
border-color: var(--color-border-focus);
|
|
38
|
+
box-shadow: none;
|
|
39
|
+
|
|
40
|
+
// Border colour is unreliable in forced-colors, so the ring's outline stands
|
|
41
|
+
// in there, matching what `focus-ring` paints for an editable field
|
|
42
|
+
@media (forced-colors: active) {
|
|
43
|
+
outline: 2px solid Highlight;
|
|
44
|
+
outline-offset: 2px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@mixin readonly-field {
|
|
49
|
+
&:has(:focus-visible) {
|
|
50
|
+
@include readonly-focus-cue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
button {
|
|
54
|
+
cursor: default;
|
|
55
|
+
|
|
56
|
+
&:hover {
|
|
57
|
+
background-color: transparent;
|
|
58
|
+
color: var(--color-text-secondary);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// `readonly-field` for a control whose root is the focusable element itself: it
|
|
64
|
+
// keeps the quiet keyboard cue but stops offering to be pressed or typed into.
|
|
65
|
+
@mixin readonly-control {
|
|
66
|
+
cursor: default;
|
|
67
|
+
|
|
68
|
+
&:focus-visible {
|
|
69
|
+
@include readonly-focus-cue;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
33
73
|
// Hides an element visually while keeping it in the accessibility tree, so
|
|
34
74
|
// screen readers still announce it. The clip pattern is used instead of
|
|
35
75
|
// `display: none` or `visibility: hidden`, which would remove it entirely.
|
package/types/eagami-ui.d.ts
CHANGED
|
@@ -733,6 +733,7 @@ declare class AutocompleteComponent implements ControlValueAccessor {
|
|
|
733
733
|
[x: string]: boolean;
|
|
734
734
|
'ea-autocomplete__wrapper--error': boolean;
|
|
735
735
|
'ea-autocomplete__wrapper--focused': boolean;
|
|
736
|
+
'ea-autocomplete__wrapper--readonly': boolean;
|
|
736
737
|
'ea-autocomplete__wrapper--disabled': boolean;
|
|
737
738
|
}>;
|
|
738
739
|
readonly listboxClasses: _angular_core.Signal<{
|
|
@@ -1333,6 +1334,7 @@ declare class ColorPickerComponent implements ControlValueAccessor {
|
|
|
1333
1334
|
'ea-color-picker__trigger--error': boolean;
|
|
1334
1335
|
'ea-color-picker__trigger--open': boolean;
|
|
1335
1336
|
'ea-color-picker__trigger--disabled': boolean;
|
|
1337
|
+
'ea-color-picker__trigger--readonly': boolean;
|
|
1336
1338
|
}>;
|
|
1337
1339
|
readonly wrapperClasses: _angular_core.Signal<{
|
|
1338
1340
|
[x: string]: boolean;
|
|
@@ -1557,7 +1559,7 @@ declare class CodeInputComponent implements ControlValueAccessor {
|
|
|
1557
1559
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CodeInputComponent, "ea-code-input", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "length": { "alias": "length"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "errorMsg": { "alias": "errorMsg"; "required": false; "isSignal": true; }; "errorMessages": { "alias": "errorMessages"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "allowAllChars": { "alias": "allowAllChars"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "completed": "completed"; }, never, never, true, never>;
|
|
1558
1560
|
}
|
|
1559
1561
|
|
|
1560
|
-
/** Visual size of the date picker
|
|
1562
|
+
/** Visual size of the date picker field. */
|
|
1561
1563
|
type DatePickerSize = EaSize;
|
|
1562
1564
|
/** Locale-aware date format used for the displayed value. */
|
|
1563
1565
|
type DatePickerFormat = 'short' | 'medium' | 'long';
|
|
@@ -1575,17 +1577,21 @@ interface CalendarDay {
|
|
|
1575
1577
|
isFocused: boolean;
|
|
1576
1578
|
}
|
|
1577
1579
|
/**
|
|
1578
|
-
*
|
|
1579
|
-
*
|
|
1580
|
-
* and
|
|
1581
|
-
*
|
|
1580
|
+
* Date field with a calendar popover. The date can be typed straight into the
|
|
1581
|
+
* field in any reasonable shape (ISO, all-numeric in the locale's field order,
|
|
1582
|
+
* or with a month name) and is rewritten in the configured `format` on commit.
|
|
1583
|
+
* Supports `min`/`max` bounds, configurable week start, locale-aware formatting
|
|
1584
|
+
* via `Intl.DateTimeFormat`, and full keyboard navigation (arrows,
|
|
1585
|
+
* PageUp/PageDown, Home/End, Enter, Escape). Integrates with Angular forms via
|
|
1586
|
+
* `ControlValueAccessor`.
|
|
1582
1587
|
*/
|
|
1583
1588
|
declare class DatePickerComponent implements ControlValueAccessor {
|
|
1584
|
-
protected readonly
|
|
1589
|
+
protected readonly fieldEl: _angular_core.Signal<ElementRef<HTMLElement> | undefined>;
|
|
1590
|
+
protected readonly inputEl: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
1585
1591
|
private readonly injector;
|
|
1586
1592
|
protected readonly i18n: EagamiI18nService;
|
|
1587
1593
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
1588
|
-
/** Placeholder shown when no date is selected.
|
|
1594
|
+
/** Placeholder shown in the field when no date is selected. */
|
|
1589
1595
|
readonly placeholder: _angular_core.InputSignal<string | undefined>;
|
|
1590
1596
|
readonly size: _angular_core.InputSignal<EaSize>;
|
|
1591
1597
|
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
@@ -1609,6 +1615,9 @@ declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
1609
1615
|
readonly viewMonth: _angular_core.WritableSignal<number>;
|
|
1610
1616
|
readonly focusedDate: _angular_core.WritableSignal<Date | null>;
|
|
1611
1617
|
private readonly _formDisabled;
|
|
1618
|
+
private readonly isFocused;
|
|
1619
|
+
/** Entry in progress, held verbatim until it is committed or abandoned. */
|
|
1620
|
+
private readonly draft;
|
|
1612
1621
|
private onChange;
|
|
1613
1622
|
private onTouched;
|
|
1614
1623
|
readonly isDisabled: _angular_core.Signal<boolean>;
|
|
@@ -1628,23 +1637,23 @@ declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
1628
1637
|
* Some browsers ship a reduced ICU that silently falls back to English for
|
|
1629
1638
|
* less common locales, so a matching request is not a given. */
|
|
1630
1639
|
private readonly intlLocalizesEffectiveLocale;
|
|
1631
|
-
/** Placeholder text
|
|
1640
|
+
/** Placeholder text, empty unless a `placeholder` is given. */
|
|
1632
1641
|
readonly resolvedPlaceholder: _angular_core.Signal<string>;
|
|
1642
|
+
/** Accessible name when no `label` is given. */
|
|
1643
|
+
protected readonly fallbackLabel: _angular_core.Signal<string>;
|
|
1633
1644
|
readonly dialogId: _angular_core.Signal<string>;
|
|
1634
|
-
readonly
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
'ea-date-
|
|
1638
|
-
'ea-date-
|
|
1639
|
-
'ea-date-picker__trigger--disabled': boolean;
|
|
1640
|
-
}>;
|
|
1641
|
-
readonly wrapperClasses: _angular_core.Signal<{
|
|
1642
|
-
[x: string]: boolean;
|
|
1645
|
+
readonly fieldClasses: _angular_core.Signal<{
|
|
1646
|
+
'ea-date-picker__field--focused': boolean;
|
|
1647
|
+
'ea-date-picker__field--error': boolean;
|
|
1648
|
+
'ea-date-picker__field--disabled': boolean;
|
|
1649
|
+
'ea-date-picker__field--readonly': boolean;
|
|
1643
1650
|
}>;
|
|
1644
1651
|
readonly popoverClasses: _angular_core.Signal<{
|
|
1645
1652
|
[x: string]: boolean;
|
|
1646
1653
|
}>;
|
|
1647
1654
|
readonly displayValue: _angular_core.Signal<string>;
|
|
1655
|
+
/** Field text: the entry in progress while typing, else the formatted value. */
|
|
1656
|
+
readonly inputText: _angular_core.Signal<string>;
|
|
1648
1657
|
readonly monthYearLabel: _angular_core.Signal<string>;
|
|
1649
1658
|
readonly weekdayLabels: _angular_core.Signal<string[]>;
|
|
1650
1659
|
readonly weeks: _angular_core.Signal<CalendarDay[][]>;
|
|
@@ -1659,7 +1668,7 @@ declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
1659
1668
|
/** Closes the calendar popover. */
|
|
1660
1669
|
close(): void;
|
|
1661
1670
|
private focusFocusedDayCell;
|
|
1662
|
-
/** Moves keyboard focus to the
|
|
1671
|
+
/** Moves keyboard focus to the date field. */
|
|
1663
1672
|
focus(): void;
|
|
1664
1673
|
selectDay(day: CalendarDay): void;
|
|
1665
1674
|
/** Clears the selected date and emits `changed` with `null`. */
|
|
@@ -1676,7 +1685,13 @@ declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
1676
1685
|
*/
|
|
1677
1686
|
private pullFocusIntoView;
|
|
1678
1687
|
goToToday(): void;
|
|
1679
|
-
|
|
1688
|
+
protected onInput(event: Event): void;
|
|
1689
|
+
protected onInputFocus(): void;
|
|
1690
|
+
protected onInputBlur(): void;
|
|
1691
|
+
protected handleInputKeydown(event: KeyboardEvent): void;
|
|
1692
|
+
private commitDraft;
|
|
1693
|
+
private applyValue;
|
|
1694
|
+
private isOutOfRange;
|
|
1680
1695
|
handleGridKeydown(event: KeyboardEvent): void;
|
|
1681
1696
|
/** Called by `<ea-popover>` when the user clicks outside the picker. */
|
|
1682
1697
|
onPopoverCloseRequested(): void;
|
|
@@ -1901,6 +1916,7 @@ declare class DropdownComponent implements ControlValueAccessor {
|
|
|
1901
1916
|
'ea-dropdown__trigger--error': boolean;
|
|
1902
1917
|
'ea-dropdown__trigger--open': boolean;
|
|
1903
1918
|
'ea-dropdown__trigger--disabled': boolean;
|
|
1919
|
+
'ea-dropdown__trigger--readonly': boolean;
|
|
1904
1920
|
}>;
|
|
1905
1921
|
readonly menuClasses: _angular_core.Signal<{
|
|
1906
1922
|
[x: string]: boolean;
|
|
@@ -2461,6 +2477,7 @@ declare class MultiSelectComponent implements ControlValueAccessor {
|
|
|
2461
2477
|
'ea-multi-select__trigger--error': boolean;
|
|
2462
2478
|
'ea-multi-select__trigger--open': boolean;
|
|
2463
2479
|
'ea-multi-select__trigger--disabled': boolean;
|
|
2480
|
+
'ea-multi-select__trigger--readonly': boolean;
|
|
2464
2481
|
'ea-multi-select__trigger--placeholder': boolean;
|
|
2465
2482
|
}>;
|
|
2466
2483
|
readonly menuClasses: _angular_core.Signal<{
|
|
@@ -3643,6 +3660,7 @@ declare class TimePickerComponent implements ControlValueAccessor {
|
|
|
3643
3660
|
'ea-time-picker__trigger--error': boolean;
|
|
3644
3661
|
'ea-time-picker__trigger--open': boolean;
|
|
3645
3662
|
'ea-time-picker__trigger--disabled': boolean;
|
|
3663
|
+
'ea-time-picker__trigger--readonly': boolean;
|
|
3646
3664
|
'ea-time-picker__trigger--placeholder': boolean;
|
|
3647
3665
|
}>;
|
|
3648
3666
|
readonly wrapperClasses: _angular_core.Signal<{
|
|
@@ -3777,6 +3795,8 @@ type ToastVariant = 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
|
3777
3795
|
interface Toast {
|
|
3778
3796
|
id: number;
|
|
3779
3797
|
message: string;
|
|
3798
|
+
/** Heading shown above the message; the message steps back when set. */
|
|
3799
|
+
title?: string;
|
|
3780
3800
|
variant: ToastVariant;
|
|
3781
3801
|
duration: number;
|
|
3782
3802
|
/** Icon component rendered in place of the variant's own; `null` renders none. */
|
|
@@ -3784,6 +3804,8 @@ interface Toast {
|
|
|
3784
3804
|
}
|
|
3785
3805
|
/** Optional configuration for a toast; defaults to `default` variant and 4s duration. */
|
|
3786
3806
|
interface ToastOptions {
|
|
3807
|
+
/** Heading shown above the message; the message steps back when set. */
|
|
3808
|
+
title?: string;
|
|
3787
3809
|
variant?: ToastVariant;
|
|
3788
3810
|
duration?: number;
|
|
3789
3811
|
/** Any icon component to render in place of the variant's own; `null` for no icon. */
|