govuk-angular
Version:
Angular components port of govuk-frontend nunjucks macros.
59 lines (58 loc) • 2.19 kB
TypeScript
import { EventEmitter } from '@angular/core';
import { Label } from '../label/label';
import { GovUKDataCapture } from '../data-capture.component';
import { ErrorMessage } from '../error/error-message.model';
import { Hint } from '../hint/hint';
import { SelectItems } from './select-item';
import * as i0 from "@angular/core";
/**
* Select component based on the nunjucks template version
* https://design-system.service.gov.uk/components/select/
*
* ```javascript
* <govuk-select
* [id]="'sort'"
* [name]="'sort'"
* [hint]='{text: "You should pick a value from the list"}'
* [label]='{text: "Sort by"}'
* [items]="selectItems"
* [(model)]="model.eventType" >
* </govuk-select>
*
* selectItems = [
* {value: "published", text: "Recently published" },
* {value: "updated", text: "Recently updated" },
* {value: "views", text: "Most views" },
* {value: "comments", text: "Most comments" }
* ];
*
* ```
*/
export declare class GovUKSelectComponent implements GovUKDataCapture<string> {
id: string;
name: string;
/** Required. Array of {value: string; text: string; disabled: boolean}
*
* ```javascript
* selectItems = [
* {value: "published", text: "Recently published" },
* {value: "updated", text: "Recently updated" },
* {value: "views", text: "Most views" },
* {value: "comments", text: "Most comments" }
* ];
* ```
*/
items: SelectItems[];
describeBy?: string;
label: Label;
hint: Hint;
errorMessage: ErrorMessage;
classes: string;
/** Selected value from the items.value */
model: string;
/** Selected value from the items.value */
modelChange: EventEmitter<string>;
onChange: (value: string) => void;
static ɵfac: i0.ɵɵFactoryDeclaration<GovUKSelectComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<GovUKSelectComponent, "govuk-select", never, { "id": "id"; "name": "name"; "items": "items"; "describeBy": "describeBy"; "label": "label"; "hint": "hint"; "errorMessage": "errorMessage"; "classes": "classes"; "model": "model"; }, { "modelChange": "modelChange"; }, never, never>;
}