@c-standard/angular-devui-extension
Version:
an extensional components lib for devui
111 lines (106 loc) • 5.88 kB
JavaScript
import * as i0 from '@angular/core';
import { EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
import * as i1 from 'ng-devui';
import { RadioModule, FormModule } from 'ng-devui';
import * as i2 from '@angular/forms';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import * as i3 from '@angular/common';
import { CommonModule } from '@angular/common';
class RadioPlusGroupComponent {
constructor() {
this.direction = 'row';
this.dataSource = [];
this.valueExpr = 'value';
this.displayExpr = 'text';
this.disabled = false;
this.align = 'horizontal';
this.validateRules = [];
this.checkedValueChange = new EventEmitter();
}
ngOnInit() {
if (this.align === 'vertical') {
this.direction = 'column';
}
else {
this.direction = 'row';
}
this.control.valueChanges.subscribe((v) => {
this.checkedValueChange.emit(v);
});
}
}
RadioPlusGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: RadioPlusGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
RadioPlusGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: RadioPlusGroupComponent, selector: "d-radio-plus-group", inputs: { dataSource: "dataSource", name: "name", value: "value", control: "control", valueExpr: "valueExpr", displayExpr: "displayExpr", disabled: "disabled", align: "align", validateRules: "validateRules" }, outputs: { checkedValueChange: "checkedValueChange" }, ngImport: i0, template: `
<d-radio-group
[direction]="direction || 'column'"
[formControl]="control"
[dValidateRules]="validateRules"
>
<d-radio
[name]="name"
*ngFor="let item of dataSource"
[value]="item[valueExpr || 'value']"
>{{ item[displayExpr || 'text'] }}</d-radio
>
</d-radio-group>
`, isInline: true, components: [{ type: i1.RadioGroupComponent, selector: "d-radio-group", inputs: ["name", "values", "cssStyle", "direction", "disabled", "beforeChange"], outputs: ["change"] }, { type: i1.RadioComponent, selector: "d-radio", inputs: ["name", "disabled", "value", "beforeChange"] }], directives: [{ type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1.DFormControlRuleDirective, selector: "[dValidateRules][formControlName],[dValidateRules][ngModel],[dValidateRules][formControl]", inputs: ["dValidateRules", "dValidatePopConfig"], outputs: ["dRulesStatusChange"], exportAs: ["dValidateRules"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: RadioPlusGroupComponent, decorators: [{
type: Component,
args: [{
selector: 'd-radio-plus-group',
template: `
<d-radio-group
[direction]="direction || 'column'"
[formControl]="control"
[dValidateRules]="validateRules"
>
<d-radio
[name]="name"
*ngFor="let item of dataSource"
[value]="item[valueExpr || 'value']"
>{{ item[displayExpr || 'text'] }}</d-radio
>
</d-radio-group>
`,
// encapsulation: ViewEncapsulation.None,
// changeDetection: ChangeDetectionStrategy.OnPush,
}]
}], propDecorators: { dataSource: [{
type: Input
}], name: [{
type: Input
}], value: [{
type: Input
}], control: [{
type: Input
}], valueExpr: [{
type: Input
}], displayExpr: [{
type: Input
}], disabled: [{
type: Input
}], align: [{
type: Input
}], validateRules: [{
type: Input
}], checkedValueChange: [{
type: Output
}] } });
class RadioPlusModule {
}
RadioPlusModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: RadioPlusModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
RadioPlusModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: RadioPlusModule, declarations: [RadioPlusGroupComponent], imports: [CommonModule, RadioModule, FormsModule, FormModule, ReactiveFormsModule], exports: [RadioPlusGroupComponent] });
RadioPlusModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: RadioPlusModule, imports: [[CommonModule, RadioModule, FormsModule, FormModule, ReactiveFormsModule]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: RadioPlusModule, decorators: [{
type: NgModule,
args: [{
declarations: [RadioPlusGroupComponent],
imports: [CommonModule, RadioModule, FormsModule, FormModule, ReactiveFormsModule],
exports: [RadioPlusGroupComponent],
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { RadioPlusGroupComponent, RadioPlusModule };
//# sourceMappingURL=c-standard-angular-devui-extension-radio.mjs.map