@compsych-ui-components/angular 7.0.42 → 7.0.44
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/index.js +8 -2
- package/esm2022/index.js.map +1 -1
- package/esm2022/lib/card-base/card.js +5 -3
- package/esm2022/lib/card-base/card.js.map +1 -1
- package/esm2022/lib/dropdown/dropdown-menu.js +135 -0
- package/esm2022/lib/dropdown/dropdown-menu.js.map +1 -0
- package/esm2022/lib/dropdown/dropdown-types.js.map +1 -1
- package/esm2022/lib/dropdown/dropdown.js +73 -25
- package/esm2022/lib/dropdown/dropdown.js.map +1 -1
- package/index.d.ts +4 -2
- package/lib/card-base/card.d.ts +3 -1
- package/lib/dropdown/dropdown-menu.d.ts +41 -0
- package/lib/dropdown/dropdown-types.d.ts +33 -2
- package/lib/dropdown/dropdown.d.ts +26 -5
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { SafeHtml } from '@angular/platform-browser';
|
|
|
3
3
|
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
|
4
4
|
import { ListboxValueChangeEvent } from '@angular/cdk/listbox';
|
|
5
5
|
import { ConnectedPosition } from '@angular/cdk/overlay';
|
|
6
|
-
import { DropdownOption, DropdownSize } from './dropdown-types';
|
|
6
|
+
import { DropdownLabelPosition, DropdownOption, DropdownSize } from './dropdown-types';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
/**
|
|
9
9
|
* A labelled single-select dropdown built on the CDK Listbox (`@angular/cdk/listbox`)
|
|
@@ -35,7 +35,7 @@ export declare class DropdownComponent implements ControlValueAccessor, OnChange
|
|
|
35
35
|
value: string;
|
|
36
36
|
/** Selectable options rendered in the overlay panel. */
|
|
37
37
|
options: DropdownOption[];
|
|
38
|
-
/** Size variant — controls height, padding, and font size. Defaults to `'
|
|
38
|
+
/** Size variant — controls height, padding, and font size. Defaults to `'md'`. */
|
|
39
39
|
size: DropdownSize;
|
|
40
40
|
/** Native `id` attribute for the trigger. Auto-generated if omitted. */
|
|
41
41
|
id?: string;
|
|
@@ -73,8 +73,20 @@ export declare class DropdownComponent implements ControlValueAccessor, OnChange
|
|
|
73
73
|
disabled: boolean;
|
|
74
74
|
/** Visually hides the label while keeping it accessible to screen readers. Supports boolean coercion. */
|
|
75
75
|
hideLabel: boolean;
|
|
76
|
-
/**
|
|
76
|
+
/** Places the label above the trigger (`'top'`, default) or beside it (`'left'`). */
|
|
77
|
+
labelPosition: DropdownLabelPosition;
|
|
78
|
+
/**
|
|
79
|
+
* Renders the label as the trigger's own resting text instead of a separate
|
|
80
|
+
* label above/beside it — e.g. the trigger reads "I want to" until an option
|
|
81
|
+
* is chosen. No visible external label is shown, but the `label` is still
|
|
82
|
+
* exposed to assistive tech (a screen-reader-only `<label>` + `aria-labelledby`),
|
|
83
|
+
* so the field is announced as a properly labelled combobox. Supports boolean coercion.
|
|
84
|
+
*/
|
|
85
|
+
inlineLabel: boolean;
|
|
86
|
+
/** Lucide icon name rendered inside the trigger, before the displayed value/placeholder (e.g. `'globe'`). */
|
|
77
87
|
leadingIcon?: string;
|
|
88
|
+
/** Default Lucide icon shown before every option's label; each option's own `icon` (from the Icon Mapping) overrides it. */
|
|
89
|
+
optionsLeadingIcon?: string;
|
|
78
90
|
/** Emits the newly selected value whenever the user picks an option. */
|
|
79
91
|
readonly valueChange: EventEmitter<string>;
|
|
80
92
|
/** Emitted when the overlay panel opens. */
|
|
@@ -82,17 +94,25 @@ export declare class DropdownComponent implements ControlValueAccessor, OnChange
|
|
|
82
94
|
/** Emitted when the overlay panel closes. */
|
|
83
95
|
readonly closed: EventEmitter<void>;
|
|
84
96
|
protected readonly chevronSvg: SafeHtml;
|
|
85
|
-
protected readonly checkSvg: SafeHtml;
|
|
86
97
|
protected leadingIconSvg: SafeHtml | null;
|
|
98
|
+
private readonly optionIconCache;
|
|
87
99
|
protected isOpen: boolean;
|
|
88
100
|
protected overlayWidth: number;
|
|
89
101
|
protected readonly overlayPositions: ConnectedPosition[];
|
|
90
102
|
ngOnChanges(): void;
|
|
91
103
|
private buildIconSvg;
|
|
104
|
+
/** Cached option-icon SVG by Lucide name (stable reference so option rows don't re-render each cycle). */
|
|
105
|
+
protected optionIconSvg(name: string | undefined): SafeHtml;
|
|
92
106
|
get triggerId(): string;
|
|
93
107
|
get labelId(): string;
|
|
94
108
|
get listboxId(): string;
|
|
95
109
|
get selectedOption(): DropdownOption | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Resting text shown in the trigger: the selected option's label, else the
|
|
112
|
+
* `label` in inline-label mode (so the label reads as the field's own text),
|
|
113
|
+
* else the placeholder.
|
|
114
|
+
*/
|
|
115
|
+
get triggerText(): string;
|
|
96
116
|
/** Value array bound to the CDK listbox (single-select, so 0 or 1 entry). */
|
|
97
117
|
get listboxValue(): readonly string[];
|
|
98
118
|
/** True when the bound FormControl is invalid and touched, or when `error` is explicitly set. */
|
|
@@ -116,9 +136,10 @@ export declare class DropdownComponent implements ControlValueAccessor, OnChange
|
|
|
116
136
|
/** Called by Angular when the bound FormControl is programmatically disabled or enabled. */
|
|
117
137
|
setDisabledState(isDisabled: boolean): void;
|
|
118
138
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownComponent, never>;
|
|
119
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownComponent, "compsych-dropdown", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "value": { "alias": "value"; "required": false; }; "options": { "alias": "options"; "required": false; }; "size": { "alias": "size"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; }; "supportingText": { "alias": "supportingText"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "required": { "alias": "required"; "required": false; }; "error": { "alias": "error"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hideLabel": { "alias": "hideLabel"; "required": false; }; "leadingIcon": { "alias": "leadingIcon"; "required": false; }; }, { "valueChange": "valueChange"; "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
|
|
139
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownComponent, "compsych-dropdown", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "value": { "alias": "value"; "required": false; }; "options": { "alias": "options"; "required": false; }; "size": { "alias": "size"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; }; "supportingText": { "alias": "supportingText"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "required": { "alias": "required"; "required": false; }; "error": { "alias": "error"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hideLabel": { "alias": "hideLabel"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "inlineLabel": { "alias": "inlineLabel"; "required": false; }; "leadingIcon": { "alias": "leadingIcon"; "required": false; }; "optionsLeadingIcon": { "alias": "optionsLeadingIcon"; "required": false; }; }, { "valueChange": "valueChange"; "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
|
|
120
140
|
static ngAcceptInputType_required: unknown;
|
|
121
141
|
static ngAcceptInputType_error: unknown;
|
|
122
142
|
static ngAcceptInputType_disabled: unknown;
|
|
123
143
|
static ngAcceptInputType_hideLabel: unknown;
|
|
144
|
+
static ngAcceptInputType_inlineLabel: unknown;
|
|
124
145
|
}
|