import type { ComponentCustomOptions, MethodOptions } from 'vue'; import type { ComponentSetupFunction, Cons } from 'vue-facing-decorator/dist/component'; import type { ValidationRuleset, ValidationState } from '../common/static-wrappers/interfaces/validation-interface'; import { Component as OriginalComponent, Prop, Vue } from 'vue-facing-decorator'; import { slotUnwrapper } from '../common/slot-unwrapper'; @Component export default class TsxComponent
extends Vue { private vueTsxProps: Readonly<{ ref?: string; key?: string | number }> & Readonly
;
model: never;
@Prop() validationState!: ValidationState;
protected get hasValidationError(): boolean {
return this.validationState != null && this.validationState.valid == false;
}
protected get validationCssClass(): string {
return this.hasValidationError ? 'has-danger' : '';
}
protected get validationErrorMessage(): string {
return this.hasValidationError ? this.validationState.errorMessage : null;
}
protected populateValidationDeclaration(): void {
if (this.validationState != null) {
// @ts-expect-error it is readonly
this.validationState.validationDeclaration._changed = true;
// @ts-expect-error it is readonly
this.validationState.validationDeclaration._label = this.label;
}
}
protected getSlotProperties extends Vue {
model: never;
private vueTsxProps: Readonly<{ ref?: string }> & Readonly ;
}
interface ComponentOption {
name?: string;
emits?: string[];
provide?: Record