carbon-components-angular
Version:
Next generation components
145 lines (140 loc) • 6.29 kB
JavaScript
import * as i0 from '@angular/core';
import { Component, HostBinding, Input, NgModule } from '@angular/core';
import { Select, SelectModule } from 'carbon-components-angular/select';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from 'carbon-components-angular/icon';
import { IconModule } from 'carbon-components-angular/icon';
/**
* Get started with importing the module:
*
* ```typescript
* import { TimePickerSelectModule } from 'carbon-components-angular';
* ```
*
* [See demo](../../?path=/story/components-time-picker-select--simple)
*/
class TimePickerSelect extends Select {
constructor() {
super(...arguments);
this.timeSelect = true;
this.timePickerSelect = true;
this.id = `timepicker-select-${TimePickerSelect.selectCount++}`;
/**
* Set to true for a loading select.
*/
this.skeleton = false;
/**
* @deprecated since v5 - Use `cdsLayer` directive instead
* `light` or `dark` select theme
*/
this.theme = "dark";
this.timePickerSelectSkeleton = this.skeleton;
}
get timePickerSelectLight() {
return this.theme === "light";
}
}
TimePickerSelect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TimePickerSelect, deps: null, target: i0.ɵɵFactoryTarget.Component });
TimePickerSelect.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TimePickerSelect, selector: "cds-timepicker-select, ibm-timepicker-select", inputs: { id: "id", ariaLabel: "ariaLabel", skeleton: "skeleton", theme: "theme", label: "label" }, host: { properties: { "class.cds--select": "this.timeSelect", "class.cds--time-picker__select": "this.timePickerSelect", "class.cds--skeleton": "this.timePickerSelectSkeleton", "class.cds--select--light": "this.timePickerSelectLight" } }, providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: TimePickerSelect,
multi: true
}
], usesInheritance: true, ngImport: i0, template: `
<label *ngIf="!skeleton && label" [attr.for]="id" class="cds--label cds--visually-hidden">{{label}}</label>
<div class="cds--select-input__wrapper">
<select
[ ]="id"
[ ]="ariaLabel"
[ ]="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>
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TimePickerSelect, decorators: [{
type: Component,
args: [{
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
[ ]="id"
[ ]="ariaLabel"
[ ]="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
}
]
}]
}], propDecorators: { timeSelect: [{
type: HostBinding,
args: ["class.cds--select"]
}], timePickerSelect: [{
type: HostBinding,
args: ["class.cds--time-picker__select"]
}], id: [{
type: Input
}], ariaLabel: [{
type: Input
}], skeleton: [{
type: Input
}], theme: [{
type: Input
}], label: [{
type: Input
}], timePickerSelectSkeleton: [{
type: HostBinding,
args: ["class.cds--skeleton"]
}], timePickerSelectLight: [{
type: HostBinding,
args: ["class.cds--select--light"]
}] } });
class TimePickerSelectModule {
}
TimePickerSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TimePickerSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
TimePickerSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TimePickerSelectModule, declarations: [TimePickerSelect], imports: [SelectModule,
CommonModule,
IconModule], exports: [TimePickerSelect] });
TimePickerSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TimePickerSelectModule, imports: [SelectModule,
CommonModule,
IconModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TimePickerSelectModule, decorators: [{
type: NgModule,
args: [{
declarations: [
TimePickerSelect
],
exports: [
TimePickerSelect
],
imports: [
SelectModule,
CommonModule,
IconModule
]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { TimePickerSelect, TimePickerSelectModule };
//# sourceMappingURL=carbon-components-angular-timepicker-select.mjs.map