ng-devui
Version:
DevUI components based on Angular
99 lines (94 loc) • 4.33 kB
JavaScript
import { __decorate, __metadata } from 'tslib';
import * as i0 from '@angular/core';
import { Directive, Input, HostBinding, NgModule } from '@angular/core';
import * as i1 from 'ng-devui/utils';
import { WithConfig } from 'ng-devui/utils';
import { CommonModule } from '@angular/common';
class TextDirective {
get hasGlowStyle() {
return this.showGlowStyle;
}
get large() {
return this.size === 'lg';
}
get small() {
return this.size === 'sm';
}
get gray() {
return this.styleType === 'gray';
}
get showTitle() {
const dom = this.el?.nativeElement;
return dom?.disabled ? dom.value ?? '' : '';
}
constructor(el, devConfigService) {
this.el = el;
this.devConfigService = devConfigService;
this.size = '';
this.styleType = 'default';
this.showGlowStyle = true;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextDirective, deps: [{ token: i0.ElementRef }, { token: i1.DevConfigService }], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TextDirective, selector: "[dTextInput]", inputs: { error: "error", size: "size", styleType: "styleType", showGlowStyle: "showGlowStyle" }, host: { properties: { "class.error": "this.error", "class.devui-glow-style": "this.hasGlowStyle", "class.devui-textinput-lg": "this.large", "class.devui-textinput-sm": "this.small", "class.devui-gray-style": "this.gray", "attr.title": "this.showTitle" } }, exportAs: ["dTextInput"], ngImport: i0 }); }
}
__decorate([
WithConfig(),
__metadata("design:type", Object)
], TextDirective.prototype, "styleType", void 0);
__decorate([
WithConfig(),
__metadata("design:type", Object)
], TextDirective.prototype, "showGlowStyle", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextDirective, decorators: [{
type: Directive,
args: [{
selector: '[dTextInput]',
exportAs: 'dTextInput',
}]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DevConfigService }], propDecorators: { error: [{
type: Input
}, {
type: HostBinding,
args: ['class.error']
}], size: [{
type: Input
}], styleType: [{
type: Input
}], showGlowStyle: [{
type: Input
}], hasGlowStyle: [{
type: HostBinding,
args: ['class.devui-glow-style']
}], large: [{
type: HostBinding,
args: ['class.devui-textinput-lg']
}], small: [{
type: HostBinding,
args: ['class.devui-textinput-sm']
}], gray: [{
type: HostBinding,
args: ['class.devui-gray-style']
}], showTitle: [{
type: HostBinding,
args: ['attr.title']
}] } });
class TextInputModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: TextInputModule, declarations: [TextDirective], imports: [CommonModule], exports: [TextDirective] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextInputModule, imports: [CommonModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextInputModule, decorators: [{
type: NgModule,
args: [{
imports: [
CommonModule,
],
exports: [TextDirective],
declarations: [TextDirective],
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { TextDirective, TextInputModule };
//# sourceMappingURL=ng-devui-text-input.mjs.map