import { PSEditorImpl } from '../pseditor-impl'; import { IPSTextEditor } from './ipstext-editor'; import { IPSSysValueRule } from '../../valuerule/ipssys-value-rule'; export class PSTextEditorImpl extends PSEditorImpl implements IPSTextEditor { get maxLength(): number { return this.M.maxLength; } get minLength(): number { return this.M.minLength != null ? this.M.minLength : 0; } protected pssysvaluerule: IPSSysValueRule | null = null; getPSSysValueRule(): IPSSysValueRule | null { if (this.pssysvaluerule != null) return this.pssysvaluerule; const value = this.M.getPSSysValueRule; if (value == null) { return null; } this.pssysvaluerule = this.getPSModel4('valuerule.IPSSysValueRule', value, 'getPSSysValueRule') as IPSSysValueRule; return this.pssysvaluerule; } get psSysValueRule(): IPSSysValueRule | null { return this.getPSSysValueRule(); } getPSSysValueRuleMust(): IPSSysValueRule { const value = this.getPSSysValueRule(); if (value == null) { throw new Error('未指定值规则'); } return value; } get showMaxLength(): boolean { return this.M.showMaxLength != null ? this.M.showMaxLength : false; } get cls(): string { return 'PSTextEditorImpl'; } instanceof(cls: string): boolean { if (cls == 'control.editor.IPSTextEditor') return true; return super.instanceof(cls); } }