valtech-components 2.0.816 → 2.0.818
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/esm2022/lib/components/molecules/pill/pill.component.mjs +147 -37
- package/esm2022/lib/components/molecules/pill/types.mjs +1 -1
- package/esm2022/lib/components/molecules/refresher/refresher.component.mjs +7 -3
- package/esm2022/lib/services/auth/oauth.service.mjs +6 -2
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +153 -38
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/molecules/pill/pill.component.d.ts +17 -6
- package/lib/components/molecules/pill/types.d.ts +55 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { ThemeService } from '../../../services/theme.service';
|
|
3
|
-
import { PillMetadata } from './types';
|
|
3
|
+
import { PillClickEvent, PillMetadata } from './types';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class PillComponent implements OnInit, OnChanges {
|
|
6
6
|
theme: ThemeService;
|
|
@@ -8,15 +8,16 @@ export declare class PillComponent implements OnInit, OnChanges {
|
|
|
8
8
|
/**
|
|
9
9
|
* Preset name to apply. Presets define reusable pill configurations
|
|
10
10
|
* that can be registered at app level via provideValtechPresets().
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* <val-pill preset="info" [props]="{ content: {...} }"></val-pill>
|
|
14
11
|
*/
|
|
15
12
|
preset?: string;
|
|
16
13
|
/**
|
|
17
14
|
* Pill configuration object. Values here override preset values.
|
|
18
15
|
*/
|
|
19
16
|
props: Partial<PillMetadata>;
|
|
17
|
+
/**
|
|
18
|
+
* Emits when a clickable text-pill is activated (click / Enter / Space).
|
|
19
|
+
*/
|
|
20
|
+
pillClick: EventEmitter<PillClickEvent>;
|
|
20
21
|
/**
|
|
21
22
|
* Resolved props after merging preset + explicit props.
|
|
22
23
|
*/
|
|
@@ -28,6 +29,16 @@ export declare class PillComponent implements OnInit, OnChanges {
|
|
|
28
29
|
* Explicit props take precedence over preset values.
|
|
29
30
|
*/
|
|
30
31
|
private resolveProps;
|
|
32
|
+
/** Text-pill mode is active when a `label` is provided. */
|
|
33
|
+
get isTextPill(): boolean;
|
|
34
|
+
/** Color variant for the text-pill, with a sensible default. */
|
|
35
|
+
get pillColor(): string;
|
|
36
|
+
/** Font weight for the text-pill, with a sensible default. */
|
|
37
|
+
get pillWeight(): string;
|
|
38
|
+
/** Size for the text-pill, with a sensible default. */
|
|
39
|
+
get pillSize(): string;
|
|
40
|
+
/** Handles activation of a clickable text-pill. */
|
|
41
|
+
onPillClick(event?: Event): void;
|
|
31
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<PillComponent, never>;
|
|
32
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PillComponent, "val-pill", never, { "preset": { "alias": "preset"; "required": false; }; "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PillComponent, "val-pill", never, { "preset": { "alias": "preset"; "required": false; }; "props": { "alias": "props"; "required": false; }; }, { "pillClick": "pillClick"; }, never, never, true, never>;
|
|
33
44
|
}
|
|
@@ -1,9 +1,63 @@
|
|
|
1
|
+
import { Color } from '@ionic/core';
|
|
1
2
|
import { ActionHeaderMetadata } from '../action-header/types';
|
|
3
|
+
/**
|
|
4
|
+
* Visual color variant for the text-pill (badge) mode of `val-pill`.
|
|
5
|
+
* Maps to Ionic theme colors so it stays coherent with the rest of the lib.
|
|
6
|
+
*/
|
|
7
|
+
export type PillColor = Color;
|
|
8
|
+
/**
|
|
9
|
+
* Font weight for the text-pill label.
|
|
10
|
+
*/
|
|
11
|
+
export type PillWeight = 'normal' | 'medium' | 'bold';
|
|
12
|
+
/**
|
|
13
|
+
* Size of the text-pill (badge) mode.
|
|
14
|
+
*/
|
|
15
|
+
export type PillSize = 'small' | 'medium' | 'large';
|
|
16
|
+
/**
|
|
17
|
+
* Configuration for `val-pill`.
|
|
18
|
+
*
|
|
19
|
+
* The component has two modes:
|
|
20
|
+
*
|
|
21
|
+
* 1. **Card mode** (legacy) — provide `content` (an `ActionHeaderMetadata`).
|
|
22
|
+
* Renders a large fun-card with a title + action button.
|
|
23
|
+
*
|
|
24
|
+
* 2. **Text-pill / badge mode** — provide `label`. Renders a compact rounded
|
|
25
|
+
* pill with a single text label. Supports `color`, `weight`, `size` and an
|
|
26
|
+
* optional click action (`clickable` + `pillClick` output).
|
|
27
|
+
*
|
|
28
|
+
* When both are provided, `label` (text-pill mode) takes precedence.
|
|
29
|
+
*/
|
|
2
30
|
export type PillMetadata = {
|
|
3
31
|
token?: string;
|
|
4
32
|
image?: string;
|
|
5
33
|
bordered?: boolean;
|
|
6
34
|
background?: string;
|
|
7
35
|
hoverable?: boolean;
|
|
8
|
-
content
|
|
36
|
+
/** Card-mode content. Optional — omit when using text-pill mode. */
|
|
37
|
+
content?: ActionHeaderMetadata;
|
|
38
|
+
/** Text-pill label. Presence of this switches the component to badge mode. */
|
|
39
|
+
label?: string;
|
|
40
|
+
/** Color variant for the text-pill. Default `medium`. */
|
|
41
|
+
color?: PillColor;
|
|
42
|
+
/** Font weight for the text-pill label. Default `medium`. */
|
|
43
|
+
weight?: PillWeight;
|
|
44
|
+
/** Size of the text-pill. Default `small`. */
|
|
45
|
+
size?: PillSize;
|
|
46
|
+
/** Optional icon name (ionicon) shown before the label. */
|
|
47
|
+
icon?: string;
|
|
48
|
+
/** When `true` the pill is interactive: pointer cursor + emits `pillClick`. */
|
|
49
|
+
clickable?: boolean;
|
|
50
|
+
/** Solid fill instead of the default soft/tinted fill. */
|
|
51
|
+
solid?: boolean;
|
|
52
|
+
/** Accessible label override for the clickable pill. Falls back to `label`. */
|
|
53
|
+
ariaLabel?: string;
|
|
9
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* Event emitted when a clickable text-pill is activated.
|
|
57
|
+
*/
|
|
58
|
+
export interface PillClickEvent {
|
|
59
|
+
/** The pill token, if one was set. */
|
|
60
|
+
token?: string;
|
|
61
|
+
/** The pill label at click time. */
|
|
62
|
+
label?: string;
|
|
63
|
+
}
|
package/lib/version.d.ts
CHANGED