File

src/timepicker-select/timepicker-select.component.ts

Description

Get started with importing the module:

Example :
import { TimePickerSelectModule } from 'carbon-components-angular';

See demo

Extends

Select

Metadata

Index

Properties
Methods
Inputs
Outputs
HostBindings
HostListeners
Accessors

Inputs

ariaLabel
Type : string
Inherited from Select
Defined in Select:52
id
Type : string
Default value : `timepicker-select-${TimePickerSelect.selectCount++}`
Inherited from Select
Defined in Select:50
label
Type : string
Inherited from Select
Defined in Select:65
skeleton
Type : boolean
Default value : false
Inherited from Select
Defined in Select:57

Set to true for a loading select.

theme
Type : "light" | "dark"
Default value : "dark"
Inherited from Select
Defined in Select:63
disabled
Type : boolean
Default value : false
Inherited from Select
Defined in Select:221

Set to true to disable component.

display
Type : "inline" | "default"
Default value : "default"
Inherited from Select
Defined in Select:189

inline or default select displays

fluid
Type : boolean
Default value : false
Inherited from Select
Defined in Select:245

Experimental: enable fluid state

helperText
Type : string | TemplateRef<any>
Inherited from Select
Defined in Select:197

Optional helper text that appears under the label.

invalid
Type : boolean
Default value : false
Inherited from Select
Defined in Select:229

Set to true for an invalid select component.

invalidText
Type : string | TemplateRef<any>
Inherited from Select
Defined in Select:201

Sets the invalid text.

readonly
Type : boolean
Default value : false
Inherited from Select
Defined in Select:233

Set to true for readonly state.

size
Type : "sm" | "md" | "lg"
Default value : "md"
Inherited from Select
Defined in Select:217

Number input field render size

value
Type : any
Inherited from Select
Defined in Select:170
warn
Type : boolean
Default value : false
Inherited from Select
Defined in Select:205

Set to true to show a warning (contents set by warningText)

warnText
Type : string | TemplateRef<any>
Inherited from Select
Defined in Select:209

Sets the warning text

Outputs

valueChange
Type : EventEmitter
Inherited from Select
Defined in Select:247

HostBindings

class.cds--select
Type : boolean
Default value : true
class.cds--select--light
Type : boolean
class.cds--skeleton
Type : boolean
Default value : this.skeleton
class.cds--time-picker__select
Type : boolean
Default value : true

HostListeners

focusout
focusout()
Inherited from Select
Defined in Select:308

Listens for the host blurring, and notifies the model

Methods

focusOut
focusOut()
Decorators :
@HostListener('focusout')
Inherited from Select
Defined in Select:308

Listens for the host blurring, and notifies the model

Returns : void
handleFocus
handleFocus(event: FocusEvent)
Inherited from Select
Defined in Select:336
Parameters :
Name Type Optional
event FocusEvent No
Returns : void
Public isTemplate
isTemplate(value)
Inherited from Select
Defined in Select:312
Parameters :
Name Optional
value No
Returns : boolean
ngAfterViewInit
ngAfterViewInit()
Inherited from Select
Defined in Select:255
Returns : void
onChange
onChange(event)
Inherited from Select
Defined in Select:298

Handles the change event from the select. Sends events to the change handler and emits a selected event.

Parameters :
Name Optional
event No
Returns : void
onKeyDown
onKeyDown(event: KeyboardEvent)
Inherited from Select
Defined in Select:326
Parameters :
Name Type Optional
event KeyboardEvent No
Returns : void
onMouseDown
onMouseDown(event: MouseEvent)
Inherited from Select
Defined in Select:316
Parameters :
Name Type Optional
event MouseEvent No
Returns : void
registerOnChange
registerOnChange(fn: any)
Inherited from Select
Defined in Select:276

Registers a listener that notifies the model when the control updates

Parameters :
Name Type Optional
fn any No
Returns : void
registerOnTouched
registerOnTouched(fn: any)
Inherited from Select
Defined in Select:283

Registers a listener that notifies the model when the control is blurred

Parameters :
Name Type Optional
fn any No
Returns : void
setDisabledState
setDisabledState(isDisabled: boolean)
Inherited from Select
Defined in Select:290

Sets the disabled state through the model

Parameters :
Name Type Optional
isDisabled boolean No
Returns : void
writeValue
writeValue(obj: any)
Inherited from Select
Defined in Select:269

Receives a value from the model.

Parameters :
Name Type Optional
obj any No
Returns : void

Properties

timePickerSelect
Default value : true
Decorators :
@HostBinding('class.cds--time-picker__select')
timePickerSelectSkeleton
Default value : this.skeleton
Decorators :
@HostBinding('class.cds--skeleton')
timeSelect
Default value : true
Decorators :
@HostBinding('class.cds--select')
Protected _value
Inherited from Select
Defined in Select:253
focused
Default value : false
Inherited from Select
Defined in Select:251
Protected onChangeHandler
Default value : () => {...}
Inherited from Select
Defined in Select:343

placeholder declarations. Replaced by the functions provided to registerOnChange and registerOnTouched

Protected onTouchedHandler
Default value : () => {...}
Inherited from Select
Defined in Select:344
select
Type : ElementRef
Decorators :
@ViewChild('select')
Inherited from Select
Defined in Select:249
Static selectCount
Type : number
Default value : 0
Inherited from Select
Defined in Select:184

Tracks the total number of selects instantiated. Used to generate unique IDs

Accessors

timePickerSelectLight
gettimePickerSelectLight()
import {
	Component,
	Input,
	Output,
	EventEmitter,
	HostBinding,
	TemplateRef
} from "@angular/core";
import { Select } from "carbon-components-angular/select";
import { NG_VALUE_ACCESSOR } from "@angular/forms";

/**
 * Get started with importing the module:
 *
 * ```typescript
 * import { TimePickerSelectModule } from 'carbon-components-angular';
 * ```
 *
 * [See demo](../../?path=/story/components-time-picker-select--simple)
 */
@Component({
	selector: "cds-timepicker-select, ibm-timepicker-select",
	template: `
		<label *ngIf="!skeleton && label" [attr.for]="id" class="cds--label cds--visually-hidden">{{label}}</label>
		<div class="cds--select-input__wrapper">
			<select
				#select
				[attr.id]="id"
				[attr.aria-label]="ariaLabel"
				[disabled]="disabled"
				(change)="onChange($event)"
				class="cds--select-input">
				<ng-content></ng-content>
			</select>
			<svg cdsIcon="chevron--down" size="16" *ngIf="!skeleton" class="cds--select__arrow"></svg>
		</div>
	`,
	providers: [
		{
			provide: NG_VALUE_ACCESSOR,
			useExisting: TimePickerSelect,
			multi: true
		}
	]
})
export class TimePickerSelect extends Select {
	@HostBinding("class.cds--select") timeSelect = true;
	@HostBinding("class.cds--time-picker__select") timePickerSelect = true;

	@Input() id = `timepicker-select-${TimePickerSelect.selectCount++}`;

	@Input() ariaLabel: string;

	/**
	 * Set to true for a loading select.
	 */
	@Input() skeleton = false;

	/**
	 * @deprecated since v5 - Use `cdsLayer` directive instead
	 * `light` or `dark` select theme
	 */
	@Input() theme: "light" | "dark" = "dark";

	@Input() label: string;

	@HostBinding("class.cds--skeleton") timePickerSelectSkeleton = this.skeleton;

	@HostBinding("class.cds--select--light") get timePickerSelectLight() {
		return this.theme === "light";
	}
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""