ud-components 0.8.4 → 0.8.6
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/lib/kpi/kpi.enum.d.ts
CHANGED
|
@@ -11,7 +11,14 @@ export declare enum KpiPillType {
|
|
|
11
11
|
SUCCESS = "success",
|
|
12
12
|
WARNING = "warning",
|
|
13
13
|
DANGER = "danger",
|
|
14
|
-
INFO = "info"
|
|
14
|
+
INFO = "info",
|
|
15
|
+
/** Draft, archived, cancelled: states that need nothing from anyone. */
|
|
16
|
+
NEUTRAL = "neutral",
|
|
17
|
+
/** Navy: active or current, without a good/bad reading. */
|
|
18
|
+
PRIMARY = "primary",
|
|
19
|
+
/** Categories with no good/bad meaning (room type, role, source). */
|
|
20
|
+
PURPLE = "purple",
|
|
21
|
+
TEAL = "teal"
|
|
15
22
|
}
|
|
16
23
|
export declare enum KpiVariant {
|
|
17
24
|
ICON_BADGE = "icon-badge",// colored gradient icon badge, white card
|
|
@@ -31,6 +31,9 @@ export interface UdMenuItem {
|
|
|
31
31
|
* <ud-menu [items]="items" ariaLabel="Charge actions" (itemSelected)="onAction($event)" />
|
|
32
32
|
* <ud-menu [items]="items" triggerVariant="stroked" triggerIcon="keyboard_arrow_down"
|
|
33
33
|
* [triggerLabel]="'Actions'" (itemSelected)="onAction($event)" />
|
|
34
|
+
* <ud-menu [items]="items" [customTrigger]="true" (itemSelected)="onAction($event)">
|
|
35
|
+
* <span>Anything clickable</span>
|
|
36
|
+
* </ud-menu>
|
|
34
37
|
*
|
|
35
38
|
* Prefer `disabled` + `disabledReason` over `hidden`, so the reader can tell
|
|
36
39
|
* "not possible here" from "does not exist".
|
|
@@ -43,6 +46,8 @@ export declare class UdMenuComponent {
|
|
|
43
46
|
triggerLabel?: string | Observable<string>;
|
|
44
47
|
triggerColor: UdButtonColor;
|
|
45
48
|
triggerSize: UdButtonSize;
|
|
49
|
+
/** Projected content becomes the trigger (wrapped in a bare button) instead of a ud-button. */
|
|
50
|
+
customTrigger: boolean;
|
|
46
51
|
/** Required in practice for icon-only triggers. */
|
|
47
52
|
ariaLabel?: string;
|
|
48
53
|
disabled: boolean;
|
|
@@ -63,5 +68,5 @@ export declare class UdMenuComponent {
|
|
|
63
68
|
onHostClick(event: Event): void;
|
|
64
69
|
select(item: UdMenuItem): void;
|
|
65
70
|
static ɵfac: i0.ɵɵFactoryDeclaration<UdMenuComponent, never>;
|
|
66
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UdMenuComponent, "ud-menu", never, { "items": { "alias": "items"; "required": true; }; "triggerVariant": { "alias": "triggerVariant"; "required": false; }; "triggerIcon": { "alias": "triggerIcon"; "required": false; }; "triggerLabel": { "alias": "triggerLabel"; "required": false; }; "triggerColor": { "alias": "triggerColor"; "required": false; }; "triggerSize": { "alias": "triggerSize"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "xPosition": { "alias": "xPosition"; "required": false; }; "yPosition": { "alias": "yPosition"; "required": false; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; }; "panelClass": { "alias": "panelClass"; "required": false; }; }, { "itemSelected": "itemSelected"; "opened": "opened"; "closed": "closed"; }, never,
|
|
71
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UdMenuComponent, "ud-menu", never, { "items": { "alias": "items"; "required": true; }; "triggerVariant": { "alias": "triggerVariant"; "required": false; }; "triggerIcon": { "alias": "triggerIcon"; "required": false; }; "triggerLabel": { "alias": "triggerLabel"; "required": false; }; "triggerColor": { "alias": "triggerColor"; "required": false; }; "triggerSize": { "alias": "triggerSize"; "required": false; }; "customTrigger": { "alias": "customTrigger"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "xPosition": { "alias": "xPosition"; "required": false; }; "yPosition": { "alias": "yPosition"; "required": false; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; }; "panelClass": { "alias": "panelClass"; "required": false; }; }, { "itemSelected": "itemSelected"; "opened": "opened"; "closed": "closed"; }, never, ["*"], true, never>;
|
|
67
72
|
}
|
|
@@ -1,10 +1,50 @@
|
|
|
1
1
|
import { KpiPillType } from '../kpi/kpi.enum';
|
|
2
|
+
import { EventEmitter, OnChanges } from '@angular/core';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
4
|
+
import { UdMenuItem } from '../menu/menu.component';
|
|
3
5
|
import * as i0 from "@angular/core";
|
|
4
|
-
export
|
|
6
|
+
export type UdPillVariant = 'modern' | 'legacy';
|
|
7
|
+
export interface UdPillOption {
|
|
8
|
+
/** What optionSelected reports; compared against the pill's `value`. */
|
|
9
|
+
value: string;
|
|
10
|
+
/** Already translated. */
|
|
11
|
+
text: string | Observable<string>;
|
|
12
|
+
/** Handy for the caller to set the pill's `type` after a change. */
|
|
13
|
+
type?: KpiPillType;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
disabledReason?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Status badge. Given `options`, it becomes a status picker: hovering widens it
|
|
19
|
+
* to show a chevron, clicking opens a ud-menu, and picking an option emits
|
|
20
|
+
* `optionSelected`. The pill does not change itself; the caller updates
|
|
21
|
+
* `text`/`type`/`value` once the change is saved.
|
|
22
|
+
*
|
|
23
|
+
* Usage:
|
|
24
|
+
* <ud-pill text="Pending" type="warning" />
|
|
25
|
+
* <ud-pill [text]="status.text" [type]="status.type" [value]="status.value"
|
|
26
|
+
* [options]="statusOptions" (optionSelected)="changeStatus($event)" />
|
|
27
|
+
*/
|
|
28
|
+
export declare class PillComponent implements OnChanges {
|
|
5
29
|
text: string | Observable<string>;
|
|
6
30
|
type: KpiPillType;
|
|
31
|
+
/** 'legacy' keeps the original gradient look for screens not yet moved over. */
|
|
32
|
+
variant: UdPillVariant;
|
|
33
|
+
/** Status dot before the text. Modern variant only. */
|
|
34
|
+
showDot: boolean;
|
|
35
|
+
/** The current option's value; it gets a check in the menu and is not re-emitted. */
|
|
36
|
+
value?: string;
|
|
37
|
+
/** Makes the pill a status picker. */
|
|
38
|
+
options?: UdPillOption[];
|
|
39
|
+
/** Keeps the menu closed, e.g. while a change is saving. */
|
|
40
|
+
disabled: boolean;
|
|
41
|
+
optionSelected: EventEmitter<UdPillOption>;
|
|
42
|
+
menuItems: UdMenuItem[];
|
|
43
|
+
menuOpen: boolean;
|
|
7
44
|
get observableText(): Observable<string>;
|
|
45
|
+
get editable(): boolean;
|
|
46
|
+
ngOnChanges(): void;
|
|
47
|
+
select(item: UdMenuItem): void;
|
|
8
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<PillComponent, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PillComponent, "ud-pill", never, { "text": { "alias": "text"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, never, true, never>;
|
|
49
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PillComponent, "ud-pill", never, { "text": { "alias": "text"; "required": false; }; "type": { "alias": "type"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "showDot": { "alias": "showDot"; "required": false; }; "value": { "alias": "value"; "required": false; }; "options": { "alias": "options"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "optionSelected": "optionSelected"; }, never, never, true, never>;
|
|
10
50
|
}
|