ud-components 0.5.39 → 0.5.42
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
export type UdButtonVariant = 'flat' | 'stroked' | 'icon-only';
|
|
3
4
|
export type UdButtonColor = 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info';
|
|
@@ -33,7 +34,15 @@ export declare class UdButtonComponent {
|
|
|
33
34
|
disabled: boolean;
|
|
34
35
|
/** Stretch to fill the container width */
|
|
35
36
|
fullWidth: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Emitted when the rendered button is clicked, but only while enabled.
|
|
39
|
+
* Bind to this instead of the native `(click)` — the latter attaches to
|
|
40
|
+
* the `<ud-button>` host element, not the inner native button, so it
|
|
41
|
+
* would fire even while `disabled`/`loading` is true.
|
|
42
|
+
*/
|
|
43
|
+
buttonClick: EventEmitter<MouseEvent>;
|
|
36
44
|
get isDisabled(): boolean;
|
|
45
|
+
onClick(event: MouseEvent): void;
|
|
37
46
|
static ɵfac: i0.ɵɵFactoryDeclaration<UdButtonComponent, never>;
|
|
38
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UdButtonComponent, "ud-button", never, { "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "size": { "alias": "size"; "required": false; }; "type": { "alias": "type"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconPosition": { "alias": "iconPosition"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
47
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UdButtonComponent, "ud-button", never, { "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "size": { "alias": "size"; "required": false; }; "type": { "alias": "type"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconPosition": { "alias": "iconPosition"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; }, { "buttonClick": "buttonClick"; }, never, ["*"], true, never>;
|
|
39
48
|
}
|
|
@@ -7,6 +7,29 @@ export interface UdSelectOption {
|
|
|
7
7
|
value: any;
|
|
8
8
|
/** Already-translated, human-readable label */
|
|
9
9
|
label: string;
|
|
10
|
+
/**
|
|
11
|
+
* Greys the option out and blocks selection, while leaving it visible.
|
|
12
|
+
*
|
|
13
|
+
* Prefer this over dropping the option from the array when the reason it is
|
|
14
|
+
* unavailable is something the reader needs to know. An option that silently
|
|
15
|
+
* disappears leaves them unable to tell "this does not exist" from "this is
|
|
16
|
+
* already taken" — and those call for very different next steps.
|
|
17
|
+
*
|
|
18
|
+
* Never clears a value that is already selected. Disabling an option is a
|
|
19
|
+
* statement about what can be chosen next, and quietly emptying a form
|
|
20
|
+
* control the user filled in earlier is not something a dropdown should do
|
|
21
|
+
* on its own.
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Why the option is unavailable — already-translated, shown muted beside the
|
|
26
|
+
* label.
|
|
27
|
+
*
|
|
28
|
+
* The half of `disabled` that earns its keep: greying a row out says a
|
|
29
|
+
* choice is closed, and only this says what closed it, so the reader knows
|
|
30
|
+
* whether to pick something else or go and change something.
|
|
31
|
+
*/
|
|
32
|
+
disabledReason?: string;
|
|
10
33
|
}
|
|
11
34
|
/**
|
|
12
35
|
* Styled multi-select with a chip trigger that participates in the parent FormGroup.
|
|
@@ -45,6 +68,45 @@ export declare class MultiSelectComponent implements OnInit, OnChanges, OnDestro
|
|
|
45
68
|
clearable: boolean;
|
|
46
69
|
hint: string;
|
|
47
70
|
selectedValues: any[];
|
|
71
|
+
/**
|
|
72
|
+
* Delay before an option's tooltip appears, in ms.
|
|
73
|
+
*
|
|
74
|
+
* Long enough that reading down a list does not trail a tooltip behind the
|
|
75
|
+
* cursor, short enough that someone who stopped because they could not read
|
|
76
|
+
* a clipped row does not have to wonder whether anything will happen.
|
|
77
|
+
*/
|
|
78
|
+
protected readonly optionTooltipDelay = 400;
|
|
79
|
+
private readonly selectRef?;
|
|
80
|
+
/**
|
|
81
|
+
* Which options are showing text too wide for their row, by index.
|
|
82
|
+
*
|
|
83
|
+
* A tooltip repeating a label the reader can already see in full is noise,
|
|
84
|
+
* and this component is used for plenty of short lists where that would be
|
|
85
|
+
* every option of every dropdown. So the tooltip is offered only where the
|
|
86
|
+
* text is genuinely cut off.
|
|
87
|
+
*
|
|
88
|
+
* Empty means "not measured yet", which reads as no tooltip — the safe way
|
|
89
|
+
* round, since a missing tooltip on clipped text is a smaller failure than a
|
|
90
|
+
* spurious one on text that fits.
|
|
91
|
+
*/
|
|
92
|
+
protected clippedLabels: boolean[];
|
|
93
|
+
protected clippedReasons: boolean[];
|
|
94
|
+
/**
|
|
95
|
+
* Measures once the panel opens, rather than when a row is hovered.
|
|
96
|
+
*
|
|
97
|
+
* Hover is too late by construction: matTooltip reads matTooltipDisabled at
|
|
98
|
+
* the instant it receives the mouseenter, so anything computed during that
|
|
99
|
+
* same event lands a change-detection tick after the decision it was meant to
|
|
100
|
+
* inform. Every option is laid out the moment the panel opens, which is well
|
|
101
|
+
* before any pointer arrives — so measuring there has no race to lose.
|
|
102
|
+
*
|
|
103
|
+
* Measured per opening, so a viewport resized while the panel is still open
|
|
104
|
+
* leaves the flags describing the width it had a moment ago. Not worth
|
|
105
|
+
* watching for: the worst case is a tooltip offered on text that now fits,
|
|
106
|
+
* or withheld from text that now does not, and the next opening corrects it.
|
|
107
|
+
*/
|
|
108
|
+
protected onPanelToggled(opened: boolean): void;
|
|
109
|
+
private measureClippedOptions;
|
|
48
110
|
private controlContainer;
|
|
49
111
|
private destroy$;
|
|
50
112
|
private labelMap;
|