Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_error: string;
// #region fields
@Input() optional: string | TemplateRef;
@Input() optionalHelp: string | TemplateRef;
@Input()
set error(val: string | { [key: string]: string }) {
this.errorData = typeof val === 'string' ? { '': val } : val;
}
@Input() extra: string;
@Input() label: string | TemplateRef;
@Input() @InputNumber(null) col: number;
@Input() @InputBoolean() required = false;
@Input() controlClass: string = '';
@Input() @InputBoolean(null) line: boolean;
@Input() @InputNumber(null) labelWidth: number;
@Input()
set id(value: string) {
this._id = value;
this._autoId = false;
}
_id = `_se-${nextUniqueId++}`;
_autoId = true;
// #endregion
get paddingValue(): number {
return this.parent.gutter / 2;
}
encapsulation: ViewEncapsulation.None,
})
export class SVComponent implements AfterViewInit, OnChanges {
@ViewChild('conEl', { static: false })
private conEl: ElementRef;
private el: HTMLElement;
private clsMap: string[] = [];
// #region fields
@Input() optional: string | TemplateRef;
@Input() optionalHelp: string | TemplateRef;
@Input() label: string | TemplateRef;
@Input() unit: string | TemplateRef;
@Input() @InputNumber(null) col: number;
@Input() @InputBoolean(null) default: boolean;
@Input() type: 'primary' | 'success' | 'danger' | 'warning';
// #endregion
get paddingValue(): number {
return this.parent && this.parent.gutter / 2;
}
get labelWidth(): number | null {
const { labelWidth, layout } = this.parent;
return layout === 'horizontal' ? labelWidth : null;
}
constructor(
el: ElementRef,
@Host() @Optional() public parent: SVContainerComponent,