@tekus/design-system 5.37.0 → 5.39.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/assets/readme-images/tk-data-list-anatomy.png +0 -0
- package/assets/readme-images/tk-data-list-grid.png +0 -0
- package/assets/readme-images/tk-data-list-list.png +0 -0
- package/assets/tokens/tk-foundations.json +4 -0
- package/fesm2022/tekus-design-system-components-autocomplete.mjs +7 -17
- package/fesm2022/tekus-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-avatar.mjs +120 -0
- package/fesm2022/tekus-design-system-components-avatar.mjs.map +1 -0
- package/fesm2022/tekus-design-system-components-button.mjs +2 -2
- package/fesm2022/tekus-design-system-components-button.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-card.mjs +1 -1
- package/fesm2022/tekus-design-system-components-card.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-checkbox.mjs +9 -3
- package/fesm2022/tekus-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-data-list.mjs +185 -0
- package/fesm2022/tekus-design-system-components-data-list.mjs.map +1 -0
- package/fesm2022/tekus-design-system-components-date-picker.mjs +16 -3
- package/fesm2022/tekus-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-input-number.mjs +37 -3
- package/fesm2022/tekus-design-system-components-input-number.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-input-text.mjs +2 -2
- package/fesm2022/tekus-design-system-components-input-text.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-menu.mjs +2 -2
- package/fesm2022/tekus-design-system-components-menu.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-multiselect.mjs +2 -2
- package/fesm2022/tekus-design-system-components-multiselect.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-panel-menu.mjs +2 -2
- package/fesm2022/tekus-design-system-components-panel-menu.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-radio-button.mjs +9 -3
- package/fesm2022/tekus-design-system-components-radio-button.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-select.mjs +37 -32
- package/fesm2022/tekus-design-system-components-select.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-sidebar-layout.mjs +2 -2
- package/fesm2022/tekus-design-system-components-sidebar-layout.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-stat.mjs +193 -0
- package/fesm2022/tekus-design-system-components-stat.mjs.map +1 -0
- package/fesm2022/tekus-design-system-components-table.mjs +1 -1
- package/fesm2022/tekus-design-system-components-table.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-tabs.mjs +2 -2
- package/fesm2022/tekus-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-textarea.mjs +2 -2
- package/fesm2022/tekus-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-time-picker.mjs +13 -3
- package/fesm2022/tekus-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-toggle.mjs +4 -3
- package/fesm2022/tekus-design-system-components-toggle.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-toolbar.mjs +2 -2
- package/fesm2022/tekus-design-system-components-toolbar.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-topbar.mjs +2 -2
- package/fesm2022/tekus-design-system-components-topbar.mjs.map +1 -1
- package/fesm2022/tekus-design-system-core-types.mjs +4 -3
- package/fesm2022/tekus-design-system-core-types.mjs.map +1 -1
- package/fesm2022/tekus-design-system-core.mjs +4 -3
- package/fesm2022/tekus-design-system-core.mjs.map +1 -1
- package/package.json +13 -1
- package/scss/_config.scss +242 -0
- package/scss/tk-bundle.scss +105 -0
- package/styles/variables.css +1 -0
- package/types/tekus-design-system-components-autocomplete.d.ts +3 -12
- package/types/tekus-design-system-components-avatar.d.ts +104 -0
- package/types/tekus-design-system-components-checkbox.d.ts +7 -1
- package/types/tekus-design-system-components-data-list.d.ts +193 -0
- package/types/tekus-design-system-components-date-picker.d.ts +11 -1
- package/types/tekus-design-system-components-input-number.d.ts +35 -1
- package/types/tekus-design-system-components-radio-button.d.ts +7 -1
- package/types/tekus-design-system-components-select.d.ts +2 -6
- package/types/tekus-design-system-components-stat.d.ts +161 -0
- package/types/tekus-design-system-components-time-picker.d.ts +8 -1
- package/types/tekus-design-system-components-toggle.d.ts +2 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
type AvatarVariant = 'text' | 'icon' | 'image';
|
|
4
|
+
type AvatarSeverity = 'secondary' | 'primary' | 'contrast';
|
|
5
|
+
type AvatarSize = 's' | 'm' | 'l' | 'xl';
|
|
6
|
+
/**
|
|
7
|
+
* Maximum number of characters rendered by the `'text'` variant. This variant is
|
|
8
|
+
* designed for initials (e.g. `'AB'`); longer strings break the layout at every
|
|
9
|
+
* size, so `value` is always truncated to this length rather than allowed to overflow.
|
|
10
|
+
*/
|
|
11
|
+
declare const AVATAR_TEXT_MAX_LENGTH = 2;
|
|
12
|
+
/**
|
|
13
|
+
* @component AvatarComponent
|
|
14
|
+
* @description
|
|
15
|
+
* A component used to represent a user, entity, or placeholder with initials, an icon, or an image.
|
|
16
|
+
*
|
|
17
|
+
* This component supports:
|
|
18
|
+
* - `variant`: What the avatar displays. Options: `'text' | 'icon' | 'image'`.
|
|
19
|
+
* - `severity`: The color scheme of the avatar. Options: `'secondary' | 'primary' | 'contrast'`. Ignored when `variant` is `'image'`.
|
|
20
|
+
* - `size`: The size of the avatar. Options: `'s' | 'm' | 'l' | 'xl'`.
|
|
21
|
+
* - `value`: The initials to display for the `'text'` variant. Limited to 2 characters — longer values are truncated.
|
|
22
|
+
* - `icon`: The icon name to display for the `'icon'` variant, rendered via `tk-icon`.
|
|
23
|
+
* - `image` / `alt`: The image source and accessible text for the `'image'` variant.
|
|
24
|
+
* - `ariaLabel`: The accessible name for the `'text'` and `'icon'` variants.
|
|
25
|
+
*
|
|
26
|
+
* @usage
|
|
27
|
+
* ### Basic Usage
|
|
28
|
+
* ```html
|
|
29
|
+
* <tk-avatar variant="text" value="AB" severity="primary" size="m" ariaLabel="Ana Bermúdez"></tk-avatar>
|
|
30
|
+
* <tk-avatar variant="icon" icon="user" severity="secondary" size="m" ariaLabel="Usuario sin foto"></tk-avatar>
|
|
31
|
+
* <tk-avatar variant="image" image="/assets/avatar.png" alt="Ana Bermúdez" size="m"></tk-avatar>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare class AvatarComponent {
|
|
35
|
+
/**
|
|
36
|
+
* What the avatar displays.
|
|
37
|
+
* @default 'text'
|
|
38
|
+
*/
|
|
39
|
+
variant: _angular_core.InputSignal<AvatarVariant>;
|
|
40
|
+
/**
|
|
41
|
+
* The color scheme of the avatar. Ignored when `variant` is `'image'`.
|
|
42
|
+
* @default 'secondary'
|
|
43
|
+
*/
|
|
44
|
+
severity: _angular_core.InputSignal<AvatarSeverity>;
|
|
45
|
+
/**
|
|
46
|
+
* The size of the avatar.
|
|
47
|
+
* @default 'm'
|
|
48
|
+
*/
|
|
49
|
+
size: _angular_core.InputSignal<AvatarSize>;
|
|
50
|
+
/**
|
|
51
|
+
* The initials to display. Only used when `variant` is `'text'`.
|
|
52
|
+
*
|
|
53
|
+
* Limited to {@link AVATAR_TEXT_MAX_LENGTH} characters — this variant is meant
|
|
54
|
+
* for initials (e.g. `'AB'`), not arbitrary text. Longer values are silently
|
|
55
|
+
* truncated (see `displayValue`) since they overflow the avatar at every size.
|
|
56
|
+
*/
|
|
57
|
+
value: _angular_core.InputSignal<string>;
|
|
58
|
+
/** The icon name to display, forwarded to `tk-icon`. Only used when `variant` is `'icon'`. */
|
|
59
|
+
icon: _angular_core.InputSignal<string>;
|
|
60
|
+
/** The image source. Only used when `variant` is `'image'`. */
|
|
61
|
+
image: _angular_core.InputSignal<string>;
|
|
62
|
+
/** The accessible alt text for the image. Only used when `variant` is `'image'`. */
|
|
63
|
+
alt: _angular_core.InputSignal<string>;
|
|
64
|
+
/**
|
|
65
|
+
* The accessible name announced by screen readers, for the `'text'` and
|
|
66
|
+
* `'icon'` variants. Should be the entity the avatar stands for (e.g. the
|
|
67
|
+
* user's full name), not a description of the graphic.
|
|
68
|
+
*
|
|
69
|
+
* Always worth setting: neither variant carries a meaningful name on its own —
|
|
70
|
+
* `'text'` would otherwise announce bare initials and `'icon'` the raw icon
|
|
71
|
+
* name. The `'image'` variant ignores this input and uses `alt` instead,
|
|
72
|
+
* since its `<img>` already provides the accessible name.
|
|
73
|
+
*/
|
|
74
|
+
ariaLabel: _angular_core.InputSignal<string>;
|
|
75
|
+
/**
|
|
76
|
+
* The `value` truncated to {@link AVATAR_TEXT_MAX_LENGTH} characters. This is
|
|
77
|
+
* what actually gets rendered for the `'text'` variant.
|
|
78
|
+
*/
|
|
79
|
+
displayValue: _angular_core.Signal<string>;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the avatar exposes itself as a labelled image to assistive tech.
|
|
82
|
+
* True for every variant except `'image'`, which is excluded because its
|
|
83
|
+
* `<img [alt]>` already carries the accessible name — adding `role="img"`
|
|
84
|
+
* plus a label on the wrapper too would announce the avatar twice.
|
|
85
|
+
*/
|
|
86
|
+
isLabelled: _angular_core.Signal<boolean>;
|
|
87
|
+
/**
|
|
88
|
+
* The accessible name actually rendered for the `'text'` and `'icon'`
|
|
89
|
+
* variants. Falls back to the displayed initials or the icon name when
|
|
90
|
+
* `ariaLabel` is not provided, so the avatar is never fully silent.
|
|
91
|
+
*/
|
|
92
|
+
accessibleLabel: _angular_core.Signal<string>;
|
|
93
|
+
/**
|
|
94
|
+
* Computed host class (BEM block + modifiers) combining `variant` and `size`
|
|
95
|
+
* always, plus `severity` unless `variant` is `'image'` (severity doesn't
|
|
96
|
+
* apply to images).
|
|
97
|
+
*/
|
|
98
|
+
hostClass: _angular_core.Signal<string>;
|
|
99
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AvatarComponent, never>;
|
|
100
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AvatarComponent, "tk-avatar", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "severity": { "alias": "severity"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "image": { "alias": "image"; "required": false; "isSignal": true; }; "alt": { "alias": "alt"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export { AVATAR_TEXT_MAX_LENGTH, AvatarComponent };
|
|
104
|
+
export type { AvatarSeverity, AvatarSize, AvatarVariant };
|
|
@@ -58,6 +58,12 @@ declare class CheckboxComponent implements ControlValueAccessor, OnInit {
|
|
|
58
58
|
* Message to display when the control is invalid and touched.
|
|
59
59
|
*/
|
|
60
60
|
errorMessage: _angular_core.InputSignal<string>;
|
|
61
|
+
/**
|
|
62
|
+
* @property {InputSignal<string>} hint
|
|
63
|
+
* @description
|
|
64
|
+
* Hint text to display below the checkbox when there is no error.
|
|
65
|
+
*/
|
|
66
|
+
hint: _angular_core.InputSignal<string>;
|
|
61
67
|
/**
|
|
62
68
|
* @property {ModelSignal<boolean>} indeterminate
|
|
63
69
|
* @description
|
|
@@ -101,7 +107,7 @@ declare class CheckboxComponent implements ControlValueAccessor, OnInit {
|
|
|
101
107
|
*/
|
|
102
108
|
onBlur(): void;
|
|
103
109
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CheckboxComponent, never>;
|
|
104
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CheckboxComponent, "tk-checkbox", never, { "model": { "alias": "model"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "binary": { "alias": "binary"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "model": "modelChange"; "indeterminate": "indeterminateChange"; "disabled": "disabledChange"; }, never, never, true, never>;
|
|
110
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CheckboxComponent, "tk-checkbox", never, { "model": { "alias": "model"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "binary": { "alias": "binary"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "model": "modelChange"; "indeterminate": "indeterminateChange"; "disabled": "disabledChange"; }, never, never, true, never>;
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
export { CheckboxComponent };
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import * as _angular_cdk_layout from '@angular/cdk/layout';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { TagSeverity } from '@tekus/design-system/components/tag';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* How the pairs are arranged.
|
|
7
|
+
*
|
|
8
|
+
* - `'list'`: a single vertical column at 100% width. Each item lays out
|
|
9
|
+
* horizontally — term on the left, value on the right — with a divider between items.
|
|
10
|
+
* - `'grid'`: a responsive multi-column grid with no dividers. Each item stacks
|
|
11
|
+
* vertically — term above value. The column count is owned by the component
|
|
12
|
+
* (see `DataListComponent.gridColumnCount`), not by the consumer.
|
|
13
|
+
*/
|
|
14
|
+
type TkDataListLayout = 'list' | 'grid';
|
|
15
|
+
/**
|
|
16
|
+
* The closed set of value types a data list can render.
|
|
17
|
+
*
|
|
18
|
+
* This union is deliberately closed: a value is governed, typed data, not free-form
|
|
19
|
+
* content. Adding a type is a system-level change, never something a consumer does
|
|
20
|
+
* inline.
|
|
21
|
+
*
|
|
22
|
+
* It expresses the same idea as `tk-table`'s `TableColumnType` — typed values rather
|
|
23
|
+
* than free-form content — but the two unions are independent and only overlap on
|
|
24
|
+
* `'text'` and `'tag'`. Do not expect parity: `'link'` and `'number'` exist only here,
|
|
25
|
+
* and table's `'image'`, `'actions'`, `'checkbox'`, `'selection'`, `'action-group'` and
|
|
26
|
+
* `'connection-status'` exist only there. Unifying the vocabulary would be a
|
|
27
|
+
* system-level decision affecting both components.
|
|
28
|
+
*/
|
|
29
|
+
type TkDataListValueType = 'text' | 'link' | 'tag' | 'number';
|
|
30
|
+
/**
|
|
31
|
+
* A single term→value pair rendered by `tk-data-list`.
|
|
32
|
+
*/
|
|
33
|
+
interface TkDataListItem {
|
|
34
|
+
/** The term naming the value. Required. */
|
|
35
|
+
label: string;
|
|
36
|
+
/**
|
|
37
|
+
* The value to render.
|
|
38
|
+
*
|
|
39
|
+
* `null`, `undefined` and blank strings all render as the `--` placeholder,
|
|
40
|
+
* uniformly across every `type`. Note that `0` is a real value, not an empty one.
|
|
41
|
+
*/
|
|
42
|
+
value: string | number | null | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* How the value is rendered.
|
|
45
|
+
* @default 'text'
|
|
46
|
+
*/
|
|
47
|
+
type?: TkDataListValueType;
|
|
48
|
+
/** An optional secondary line beneath the label. */
|
|
49
|
+
description?: string;
|
|
50
|
+
/**
|
|
51
|
+
* An optional icon shown in a secondary icon avatar before the label.
|
|
52
|
+
* Forwarded to `tk-avatar` as `variant="icon"`; decorative and hidden from
|
|
53
|
+
* assistive technology.
|
|
54
|
+
*/
|
|
55
|
+
leadingIcon?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The colour scheme of the tag. Only used when `type` is `'tag'`.
|
|
58
|
+
* @default 'primary'
|
|
59
|
+
*/
|
|
60
|
+
tagSeverity?: TagSeverity;
|
|
61
|
+
/**
|
|
62
|
+
* Invoked when the value is activated. Required in practice for `type: 'link'`.
|
|
63
|
+
*
|
|
64
|
+
* Link values render a `tk-button` in its link variant, so they are
|
|
65
|
+
* action-based rather than href-based: this callback is the navigation or
|
|
66
|
+
* action hook. Assistive technology announces them as buttons.
|
|
67
|
+
*
|
|
68
|
+
* A `'link'` without a handler would be a button that does nothing, so it is
|
|
69
|
+
* rendered as plain text instead — no dead control reaches the accessibility
|
|
70
|
+
* tree or the tab order.
|
|
71
|
+
*/
|
|
72
|
+
handler?: () => void;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Rendered in place of a value that is `null`, `undefined` or a blank string. */
|
|
76
|
+
declare const DATA_LIST_EMPTY_PLACEHOLDER = "--";
|
|
77
|
+
/**
|
|
78
|
+
* @component DataListComponent
|
|
79
|
+
* @description
|
|
80
|
+
* Displays a collection of read-only term→value pairs, where each value is a typed
|
|
81
|
+
* piece of data (text, link, tag or number). It is the pair-oriented sibling of
|
|
82
|
+
* `tk-table`: both render governed, typed values, but the data list presents them as
|
|
83
|
+
* label→value pairs instead of rows and columns. Use it for detail panels, record
|
|
84
|
+
* summaries and entity overviews.
|
|
85
|
+
*
|
|
86
|
+
* This component supports:
|
|
87
|
+
* - `items`: the pairs to render. See {@link TkDataListItem}.
|
|
88
|
+
* - `layout`: `'list'` (one column, dividers, term left / value right) or `'grid'`
|
|
89
|
+
* (responsive multi-column, no dividers, term above value).
|
|
90
|
+
* - `emptyPlaceholder`: the text rendered in place of an empty value.
|
|
91
|
+
*
|
|
92
|
+
* The consumer only chooses the layout. Everything that follows from it — item
|
|
93
|
+
* orientation, dividers and the responsive column count — is owned by the component.
|
|
94
|
+
* To vary the layout across breakpoints (e.g. list on mobile, grid on desktop), switch
|
|
95
|
+
* the `layout` input at your own breakpoint.
|
|
96
|
+
*
|
|
97
|
+
* Renders as a description list (`<dl>`) so assistive technology announces each entry
|
|
98
|
+
* as a term→value pair. Interactivity lives inside the value, never on the item — the
|
|
99
|
+
* item itself is neither focusable nor clickable.
|
|
100
|
+
*
|
|
101
|
+
* @usage
|
|
102
|
+
* ### Basic Usage
|
|
103
|
+
* ```html
|
|
104
|
+
* <tk-data-list [items]="details" layout="list"></tk-data-list>
|
|
105
|
+
* ```
|
|
106
|
+
* ```ts
|
|
107
|
+
* details: TkDataListItem[] = [
|
|
108
|
+
* { label: 'Owner', value: 'Ana Bermúdez' },
|
|
109
|
+
* { label: 'Status', value: 'Active', type: 'tag' },
|
|
110
|
+
* { label: 'Devices', value: 2322, type: 'number' },
|
|
111
|
+
* { label: 'Contract', value: 'Open', type: 'link', handler: () => this.openContract() },
|
|
112
|
+
* ];
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
declare class DataListComponent {
|
|
116
|
+
/**
|
|
117
|
+
* The term→value pairs to render, in order.
|
|
118
|
+
* @default []
|
|
119
|
+
*/
|
|
120
|
+
items: _angular_core.InputSignal<TkDataListItem[]>;
|
|
121
|
+
/**
|
|
122
|
+
* How the pairs are arranged.
|
|
123
|
+
* @default 'list'
|
|
124
|
+
*/
|
|
125
|
+
layout: _angular_core.InputSignal<TkDataListLayout>;
|
|
126
|
+
/**
|
|
127
|
+
* The text rendered in place of a value that is `null`, `undefined` or blank.
|
|
128
|
+
*
|
|
129
|
+
* Exposed as an input so it can be localised (`'N/A'`, `'Sin dato'`, …). The
|
|
130
|
+
* default is the system-wide placeholder.
|
|
131
|
+
* @default '--'
|
|
132
|
+
*/
|
|
133
|
+
emptyPlaceholder: _angular_core.InputSignal<string>;
|
|
134
|
+
private readonly breakpointObserver;
|
|
135
|
+
/**
|
|
136
|
+
* Reactive viewport state across every breakpoint the design system defines.
|
|
137
|
+
*
|
|
138
|
+
* Grid mode sizes off the viewport rather than the component's own width, matching
|
|
139
|
+
* `tk-grid-container`. A consequence worth knowing: a data list inside a narrow
|
|
140
|
+
* drawer still reports the viewport's column count.
|
|
141
|
+
*/
|
|
142
|
+
readonly screenChanges: _angular_core.Signal<_angular_cdk_layout.BreakpointState | undefined>;
|
|
143
|
+
/** Whether the grid layout is active. */
|
|
144
|
+
readonly isGrid: _angular_core.Signal<boolean>;
|
|
145
|
+
/**
|
|
146
|
+
* The number of grid columns for the current viewport.
|
|
147
|
+
*
|
|
148
|
+
* Mobile 1 · Tablet 2 · Small 2 · Normal 3 · Extra large 5. Falls back to a single
|
|
149
|
+
* column when the observer has not reported yet, so the first paint is mobile-first
|
|
150
|
+
* rather than over-wide.
|
|
151
|
+
*/
|
|
152
|
+
readonly gridColumnCount: _angular_core.Signal<1 | 5 | 3 | 2>;
|
|
153
|
+
/**
|
|
154
|
+
* The `grid-template-columns` value bound on the `<dl>`, or `null` in list layout
|
|
155
|
+
* so the property is left off the element entirely.
|
|
156
|
+
*
|
|
157
|
+
* The track count is capped at the number of items: a data list usually holds fewer
|
|
158
|
+
* pairs than the viewport allows columns, and emitting the full count would leave
|
|
159
|
+
* empty tracks that squeeze every value into a fraction of the available width
|
|
160
|
+
* (e.g. three items over five tracks). Never drops below one, so an empty list still
|
|
161
|
+
* produces a valid value.
|
|
162
|
+
*/
|
|
163
|
+
readonly gridTemplateColumns: _angular_core.Signal<string | null>;
|
|
164
|
+
/**
|
|
165
|
+
* Whether a value should render as the `--` placeholder.
|
|
166
|
+
*
|
|
167
|
+
* Applied before the type is considered, so the rule holds uniformly across every
|
|
168
|
+
* type. `0` and `false`-ish numbers are real values and are not treated as empty.
|
|
169
|
+
*/
|
|
170
|
+
isEmpty(value: TkDataListItem['value']): boolean;
|
|
171
|
+
/**
|
|
172
|
+
* The effective value type, defaulting to `'text'`.
|
|
173
|
+
*
|
|
174
|
+
* A `'link'` with no `handler` has nothing to invoke, so it resolves to `'text'`: it
|
|
175
|
+
* renders as plain data instead of as a button that does nothing. That keeps a dead
|
|
176
|
+
* control out of the accessibility tree and the tab order entirely, which `disabled`
|
|
177
|
+
* would not do — and `disabled` would also claim the action merely is unavailable
|
|
178
|
+
* right now, which is not the case.
|
|
179
|
+
*/
|
|
180
|
+
resolveType(item: TkDataListItem): TkDataListValueType;
|
|
181
|
+
/** The effective tag severity, defaulting to the one used in the design. */
|
|
182
|
+
resolveTagSeverity(item: TkDataListItem): TagSeverity;
|
|
183
|
+
/**
|
|
184
|
+
* The value as a string, for the child components that require one
|
|
185
|
+
* (`tk-tag.value` and `tk-button.label` are both typed `string`).
|
|
186
|
+
*/
|
|
187
|
+
asText(value: TkDataListItem['value']): string;
|
|
188
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DataListComponent, never>;
|
|
189
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DataListComponent, "tk-data-list", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "emptyPlaceholder": { "alias": "emptyPlaceholder"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export { DATA_LIST_EMPTY_PLACEHOLDER, DataListComponent };
|
|
193
|
+
export type { TkDataListItem, TkDataListLayout, TkDataListValueType };
|
|
@@ -213,6 +213,16 @@ declare class DatePickerComponent implements OnInit, ControlValueAccessor, Valid
|
|
|
213
213
|
* <tk-date-picker [minDate]="minDate" errorMessage="Date is required" />
|
|
214
214
|
*/
|
|
215
215
|
errorMessage: _angular_core.InputSignal<string | null>;
|
|
216
|
+
/**
|
|
217
|
+
* @description
|
|
218
|
+
* Hint text rendered beneath the field when there is no error to show.
|
|
219
|
+
*
|
|
220
|
+
* @default null
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* <tk-date-picker hint="Format: dd/mm/yyyy" />
|
|
224
|
+
*/
|
|
225
|
+
hint: _angular_core.InputSignal<string | null>;
|
|
216
226
|
/**
|
|
217
227
|
* @description
|
|
218
228
|
* Optional external `FormControl` to bind when not using the standard
|
|
@@ -312,7 +322,7 @@ declare class DatePickerComponent implements OnInit, ControlValueAccessor, Valid
|
|
|
312
322
|
*/
|
|
313
323
|
private applyTimeCascading;
|
|
314
324
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DatePickerComponent, never>;
|
|
315
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatePickerComponent, "tk-date-picker", never, { "required": { "alias": "required"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; "dateFormat": { "alias": "dateFormat"; "required": false; "isSignal": true; }; "stepHour": { "alias": "stepHour"; "required": false; "isSignal": true; }; "stepMinute": { "alias": "stepMinute"; "required": false; "isSignal": true; }; "stepSecond": { "alias": "stepSecond"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "inline": { "alias": "inline"; "required": false; "isSignal": true; }; "showTime": { "alias": "showTime"; "required": false; "isSignal": true; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "appendTo": { "alias": "appendTo"; "required": false; "isSignal": true; }; "baseZIndex": { "alias": "baseZIndex"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "labelText": { "alias": "labelText"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "modelValue": { "alias": "modelValue"; "required": false; "isSignal": true; }; }, { "modelValue": "modelValueChange"; "handleSelect": "handleSelect"; "handleClear": "handleClear"; }, never, never, true, never>;
|
|
325
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatePickerComponent, "tk-date-picker", never, { "required": { "alias": "required"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; "dateFormat": { "alias": "dateFormat"; "required": false; "isSignal": true; }; "stepHour": { "alias": "stepHour"; "required": false; "isSignal": true; }; "stepMinute": { "alias": "stepMinute"; "required": false; "isSignal": true; }; "stepSecond": { "alias": "stepSecond"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "inline": { "alias": "inline"; "required": false; "isSignal": true; }; "showTime": { "alias": "showTime"; "required": false; "isSignal": true; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "appendTo": { "alias": "appendTo"; "required": false; "isSignal": true; }; "baseZIndex": { "alias": "baseZIndex"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "labelText": { "alias": "labelText"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "modelValue": { "alias": "modelValue"; "required": false; "isSignal": true; }; }, { "modelValue": "modelValueChange"; "handleSelect": "handleSelect"; "handleClear": "handleClear"; }, never, never, true, never>;
|
|
316
326
|
}
|
|
317
327
|
|
|
318
328
|
export { DatePickerComponent };
|
|
@@ -38,6 +38,12 @@ declare class InputNumberComponent implements ControlValueAccessor, OnInit {
|
|
|
38
38
|
* Message to display when the control is invalid and touched.
|
|
39
39
|
*/
|
|
40
40
|
errorMessage: _angular_core.InputSignal<string>;
|
|
41
|
+
/**
|
|
42
|
+
* @property {InputSignal<string>} hint
|
|
43
|
+
* @description
|
|
44
|
+
* Hint text to display below the input.
|
|
45
|
+
*/
|
|
46
|
+
hint: _angular_core.InputSignal<string>;
|
|
41
47
|
/**
|
|
42
48
|
* @property {InputSignal<boolean>} showButtons
|
|
43
49
|
* @description
|
|
@@ -45,6 +51,34 @@ declare class InputNumberComponent implements ControlValueAccessor, OnInit {
|
|
|
45
51
|
* @default false
|
|
46
52
|
*/
|
|
47
53
|
showButtons: _angular_core.InputSignal<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* @property {InputSignal<boolean>} useGrouping
|
|
56
|
+
* @description
|
|
57
|
+
* Whether to display thousands separators.
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
useGrouping: _angular_core.InputSignal<boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* @property {InputSignal<number | null>} minFractionDigits
|
|
63
|
+
* @description
|
|
64
|
+
* Minimum number of decimal digits allowed.
|
|
65
|
+
*/
|
|
66
|
+
minFractionDigits: _angular_core.InputSignal<number | null>;
|
|
67
|
+
/**
|
|
68
|
+
* @property {InputSignal<number | null>} maxFractionDigits
|
|
69
|
+
* @description
|
|
70
|
+
* Maximum number of decimal digits allowed. Left unset (`null`) by
|
|
71
|
+
* default — integer entry only, matching prior behavior — and safe for
|
|
72
|
+
* already-bound decimal values (Intl.NumberFormat applies its own default
|
|
73
|
+
* of up to 3 decimal places for display when this isn't set, so no
|
|
74
|
+
* rounding happens). PrimeNG's InputNumber only lets the user *type* a new
|
|
75
|
+
* decimal separator when this is explicitly set to a value greater than 0
|
|
76
|
+
* — set it (e.g. `[maxFractionDigits]="2"`) to accept typed decimal
|
|
77
|
+
* input. Set to 0 only if you deliberately want to force integer-only
|
|
78
|
+
* display too — it rounds any already-bound decimal value.
|
|
79
|
+
* @default null
|
|
80
|
+
*/
|
|
81
|
+
maxFractionDigits: _angular_core.InputSignal<number | null>;
|
|
48
82
|
/**
|
|
49
83
|
* @property {boolean} disabled
|
|
50
84
|
* @description
|
|
@@ -98,7 +132,7 @@ declare class InputNumberComponent implements ControlValueAccessor, OnInit {
|
|
|
98
132
|
*/
|
|
99
133
|
onBlur(): void;
|
|
100
134
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<InputNumberComponent, never>;
|
|
101
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<InputNumberComponent, "tk-input-number", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "showButtons": { "alias": "showButtons"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
135
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<InputNumberComponent, "tk-input-number", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "showButtons": { "alias": "showButtons"; "required": false; "isSignal": true; }; "useGrouping": { "alias": "useGrouping"; "required": false; "isSignal": true; }; "minFractionDigits": { "alias": "minFractionDigits"; "required": false; "isSignal": true; }; "maxFractionDigits": { "alias": "maxFractionDigits"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
102
136
|
}
|
|
103
137
|
|
|
104
138
|
export { InputNumberComponent };
|
|
@@ -53,6 +53,12 @@ declare class RadioButtonComponent implements ControlValueAccessor, OnInit {
|
|
|
53
53
|
* Message to display when the control is invalid and touched.
|
|
54
54
|
*/
|
|
55
55
|
errorMessage: _angular_core.InputSignal<string>;
|
|
56
|
+
/**
|
|
57
|
+
* @property {InputSignal<string>} hint
|
|
58
|
+
* @description
|
|
59
|
+
* Hint text to display below the radio button when there is no error.
|
|
60
|
+
*/
|
|
61
|
+
hint: _angular_core.InputSignal<string>;
|
|
56
62
|
/**
|
|
57
63
|
* @property {ModelSignal<boolean>} disabled
|
|
58
64
|
* @description
|
|
@@ -94,7 +100,7 @@ declare class RadioButtonComponent implements ControlValueAccessor, OnInit {
|
|
|
94
100
|
*/
|
|
95
101
|
onBlur(): void;
|
|
96
102
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadioButtonComponent, never>;
|
|
97
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RadioButtonComponent, "tk-radio-button", never, { "model": { "alias": "model"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "model": "modelChange"; "disabled": "disabledChange"; }, never, never, true, never>;
|
|
103
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RadioButtonComponent, "tk-radio-button", never, { "model": { "alias": "model"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "model": "modelChange"; "disabled": "disabledChange"; }, never, never, true, never>;
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
export { RadioButtonComponent };
|
|
@@ -185,10 +185,6 @@ declare class SelectComponent<T = unknown> implements ControlValueAccessor, OnDe
|
|
|
185
185
|
* Text to display when no results match the filter.
|
|
186
186
|
*/
|
|
187
187
|
emptyFilterMessage: _angular_core.InputSignal<string>;
|
|
188
|
-
/**
|
|
189
|
-
* Emits whenever the value changes.
|
|
190
|
-
*/
|
|
191
|
-
modelChange: _angular_core.OutputEmitterRef<T | null>;
|
|
192
188
|
/**
|
|
193
189
|
* Emits the filter search term.
|
|
194
190
|
*/
|
|
@@ -205,7 +201,7 @@ declare class SelectComponent<T = unknown> implements ControlValueAccessor, OnDe
|
|
|
205
201
|
* Includes a "Ghost Option" logic to ensure the selected item is always visible
|
|
206
202
|
* even if it's not in the current loaded chunk of data.
|
|
207
203
|
*/
|
|
208
|
-
|
|
204
|
+
readonly items: _angular_core.Signal<T[]>;
|
|
209
205
|
/**
|
|
210
206
|
* Receives value updates from Angular Forms API.
|
|
211
207
|
* @param value - New value from the forms API.
|
|
@@ -265,7 +261,7 @@ declare class SelectComponent<T = unknown> implements ControlValueAccessor, OnDe
|
|
|
265
261
|
*/
|
|
266
262
|
private handleScroll;
|
|
267
263
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectComponent<any>, never>;
|
|
268
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectComponent<any>, "tk-select", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "dataSource": { "alias": "dataSource"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "fetchParams": { "alias": "fetchParams"; "required": false; "isSignal": true; }; "sortField": { "alias": "sortField"; "required": false; "isSignal": true; }; "sortOrder": { "alias": "sortOrder"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "emptyFilterMessage": { "alias": "emptyFilterMessage"; "required": false; "isSignal": true; }; }, { "dataSource": "dataSourceChange"; "model": "modelChange"; "
|
|
264
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectComponent<any>, "tk-select", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "dataSource": { "alias": "dataSource"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "fetchParams": { "alias": "fetchParams"; "required": false; "isSignal": true; }; "sortField": { "alias": "sortField"; "required": false; "isSignal": true; }; "sortOrder": { "alias": "sortOrder"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "emptyFilterMessage": { "alias": "emptyFilterMessage"; "required": false; "isSignal": true; }; }, { "dataSource": "dataSourceChange"; "model": "modelChange"; "filterChange": "filterChange"; }, never, never, true, never>;
|
|
269
265
|
}
|
|
270
266
|
|
|
271
267
|
declare class IntersectionDirective implements OnInit, OnDestroy {
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Signal, InjectionToken } from '@angular/core';
|
|
3
|
+
import { TagSeverity } from '@tekus/design-system/components/tag';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The feedback intent of a stat. It drives the color of the value — and only the
|
|
7
|
+
* value: the surface, the label, the description and the progress bar are
|
|
8
|
+
* identical across every severity.
|
|
9
|
+
*/
|
|
10
|
+
type StatSeverity = 'secondary' | 'primary' | 'success' | 'warn' | 'danger';
|
|
11
|
+
/**
|
|
12
|
+
* How a `tk-stat-group` lays its children out.
|
|
13
|
+
* - `auto`: a row that collapses to a column on small screens.
|
|
14
|
+
* - `row`: always horizontal.
|
|
15
|
+
* - `column`: always vertical.
|
|
16
|
+
*/
|
|
17
|
+
type StatGroupOrientation = 'auto' | 'row' | 'column';
|
|
18
|
+
/** The contract a `tk-stat-group` exposes to the `tk-stat` children it projects. */
|
|
19
|
+
interface StatGroupContext {
|
|
20
|
+
readonly orientation: Signal<StatGroupOrientation>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Provided by `tk-stat-group`, injected optionally by `tk-stat`.
|
|
24
|
+
*
|
|
25
|
+
* This is how a stat discovers that it lives inside a group and must drop its own
|
|
26
|
+
* surface — the group owns the background, so the children must not paint their
|
|
27
|
+
* own. A stat never sets its grouped appearance itself, and a consumer never has
|
|
28
|
+
* to hand it down.
|
|
29
|
+
*/
|
|
30
|
+
declare const TK_STAT_GROUP: InjectionToken<StatGroupContext>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @component StatComponent
|
|
34
|
+
* @description
|
|
35
|
+
* Displays a single highlighted metric: a large dominant value, a small label above
|
|
36
|
+
* it, and optionally a status tag, a description and a progress bar. Used at the top
|
|
37
|
+
* of listings, summaries and dashboards to surface a key figure at a glance.
|
|
38
|
+
*
|
|
39
|
+
* This component supports:
|
|
40
|
+
* - `label` / `value`: the two required parts. The value is the dominant figure.
|
|
41
|
+
* - `severity`: the feedback intent. Colors the value — and nothing else.
|
|
42
|
+
* - `prefix` / `suffix`: small muted affixes flanking the value (e.g. `'$'`, `'/200'`).
|
|
43
|
+
* - `description`: a secondary line below the value.
|
|
44
|
+
* - `tagValue` / `tagSeverity`: a trailing tag in the header, via `tk-tag`.
|
|
45
|
+
* - `progress`: shows a `tk-progress-bar` below the content when set.
|
|
46
|
+
* - `severityLabel`: screen-reader-only text so `severity` is not color-only.
|
|
47
|
+
*
|
|
48
|
+
* There is no `grouped` input: wrapping stats in `tk-stat-group` applies the grouped
|
|
49
|
+
* appearance automatically.
|
|
50
|
+
*
|
|
51
|
+
* @usage
|
|
52
|
+
* ### Basic Usage
|
|
53
|
+
* ```html
|
|
54
|
+
* <tk-stat label="Usuarios mensuales" [value]="500" description="Audiencia estimada" />
|
|
55
|
+
* <tk-stat label="Slots" [value]="25" suffix="/200" [progress]="12" tagValue="Disponible" tagSeverity="success" />
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare class StatComponent {
|
|
59
|
+
/** The small title shown above the value. */
|
|
60
|
+
label: _angular_core.InputSignal<string>;
|
|
61
|
+
/**
|
|
62
|
+
* The dominant figure. Accepts a number or an already-formatted string
|
|
63
|
+
* (`'1.2K'`, `'99,9 %'`) so the consumer keeps control of formatting and locale.
|
|
64
|
+
*/
|
|
65
|
+
value: _angular_core.InputSignal<string | number>;
|
|
66
|
+
/**
|
|
67
|
+
* The feedback intent of the stat, which colors the value.
|
|
68
|
+
* @default 'secondary'
|
|
69
|
+
*/
|
|
70
|
+
severity: _angular_core.InputSignal<StatSeverity>;
|
|
71
|
+
/** Small muted text rendered immediately before the value (e.g. `'$'`). */
|
|
72
|
+
prefix: _angular_core.InputSignal<string>;
|
|
73
|
+
/** Small muted text rendered immediately after the value (e.g. `'/200'`, `'/GB'`). */
|
|
74
|
+
suffix: _angular_core.InputSignal<string>;
|
|
75
|
+
/** A secondary line below the value, giving context or the origin of the figure. */
|
|
76
|
+
description: _angular_core.InputSignal<string>;
|
|
77
|
+
/** The text of the trailing header tag. The tag is only rendered when this is set. */
|
|
78
|
+
tagValue: _angular_core.InputSignal<string>;
|
|
79
|
+
/**
|
|
80
|
+
* The severity of the trailing header tag.
|
|
81
|
+
* @default 'secondary'
|
|
82
|
+
*/
|
|
83
|
+
tagSeverity: _angular_core.InputSignal<TagSeverity>;
|
|
84
|
+
/**
|
|
85
|
+
* The completion percentage (0-100) shown as a progress bar below the content.
|
|
86
|
+
* Leave `undefined` to omit the bar — `0` is a valid value and renders an empty bar.
|
|
87
|
+
*/
|
|
88
|
+
progress: _angular_core.InputSignal<number | undefined>;
|
|
89
|
+
/**
|
|
90
|
+
* Screen-reader-only text describing what this stat's `severity` means (e.g.
|
|
91
|
+
* `'sobre la cuota'`). Set it whenever `severity` is not `'secondary'`, so the
|
|
92
|
+
* meaning is not carried by color alone. Saying it visibly through `tagValue` or
|
|
93
|
+
* `description` is usually better, since it serves sighted users too.
|
|
94
|
+
*/
|
|
95
|
+
severityLabel: _angular_core.InputSignal<string>;
|
|
96
|
+
/**
|
|
97
|
+
* The group this stat is projected into, if any. Injected optionally: a standalone
|
|
98
|
+
* stat resolves `null` and keeps its own surface.
|
|
99
|
+
*/
|
|
100
|
+
private readonly group;
|
|
101
|
+
/** Whether this stat is projected inside a `tk-stat-group`. */
|
|
102
|
+
readonly grouped: boolean;
|
|
103
|
+
/** Unique DOM id linking the rendered label to the host's `aria-labelledby`. */
|
|
104
|
+
readonly labelId: string;
|
|
105
|
+
/**
|
|
106
|
+
* Whether a progress bar should be rendered. Tests for `null`/`undefined` rather
|
|
107
|
+
* than truthiness so that `progress = 0` still renders an empty bar.
|
|
108
|
+
*/
|
|
109
|
+
hasProgress: _angular_core.Signal<boolean>;
|
|
110
|
+
/** Computed host class: the BEM block plus the severity and grouped modifiers. */
|
|
111
|
+
hostClass: _angular_core.Signal<string>;
|
|
112
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StatComponent, never>;
|
|
113
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StatComponent, "tk-stat", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "severity": { "alias": "severity"; "required": false; "isSignal": true; }; "prefix": { "alias": "prefix"; "required": false; "isSignal": true; }; "suffix": { "alias": "suffix"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "tagValue": { "alias": "tagValue"; "required": false; "isSignal": true; }; "tagSeverity": { "alias": "tagSeverity"; "required": false; "isSignal": true; }; "progress": { "alias": "progress"; "required": false; "isSignal": true; }; "severityLabel": { "alias": "severityLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @component StatGroupComponent
|
|
118
|
+
* @description
|
|
119
|
+
* Wraps a row of related `tk-stat` into a single shared surface, inserting a
|
|
120
|
+
* separator between each pair. The group owns the background and the radius; every
|
|
121
|
+
* stat projected into it drops its own surface automatically, through the
|
|
122
|
+
* {@link TK_STAT_GROUP} token this component provides.
|
|
123
|
+
*
|
|
124
|
+
* This component supports:
|
|
125
|
+
* - `orientation`: `'auto'` (a row that collapses to a column on small screens),
|
|
126
|
+
* `'row'` or `'column'`.
|
|
127
|
+
* - `ariaLabel`: names the group for assistive tech. Only when set does the group
|
|
128
|
+
* expose `role="group"` — an unnamed group is noise.
|
|
129
|
+
*
|
|
130
|
+
* @usage
|
|
131
|
+
* ### Basic Usage
|
|
132
|
+
* ```html
|
|
133
|
+
* <tk-stat-group ariaLabel="Resumen de la campaña">
|
|
134
|
+
* <tk-stat label="Usuarios mensuales" [value]="500" description="Audiencia estimada" />
|
|
135
|
+
* <tk-stat label="Estado de la pantalla" [value]="500" severity="success" description="12 de 12 días" />
|
|
136
|
+
* <tk-stat label="Slots" [value]="25" suffix="/200" [progress]="12" />
|
|
137
|
+
* </tk-stat-group>
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
declare class StatGroupComponent implements StatGroupContext {
|
|
141
|
+
/**
|
|
142
|
+
* How the stats are laid out.
|
|
143
|
+
* - `'auto'`: horizontal, collapsing to a column on viewports narrower than a
|
|
144
|
+
* vertical tablet. This is the responsive default the design calls for.
|
|
145
|
+
* - `'row'` / `'column'`: force one direction — for a group inside a narrow
|
|
146
|
+
* sidebar on a wide screen, or one that must stay horizontal on mobile.
|
|
147
|
+
* @default 'auto'
|
|
148
|
+
*/
|
|
149
|
+
orientation: _angular_core.InputSignal<StatGroupOrientation>;
|
|
150
|
+
/**
|
|
151
|
+
* The accessible name of the group. When set, the group exposes itself as
|
|
152
|
+
* `role="group"` with this label; when omitted it stays structurally invisible to
|
|
153
|
+
* assistive tech, since an unnamed group adds nothing but noise.
|
|
154
|
+
*/
|
|
155
|
+
ariaLabel: _angular_core.InputSignal<string>;
|
|
156
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StatGroupComponent, never>;
|
|
157
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StatGroupComponent, "tk-stat-group", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export { StatComponent, StatGroupComponent, TK_STAT_GROUP };
|
|
161
|
+
export type { StatGroupContext, StatGroupOrientation, StatSeverity };
|