import type { ComponentCustomOptions, MethodOptions, VNode } 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;
}
}
/**
* The props of the default slot's children of `type`. A component that also RENDERS that slot passes the nodes its
* render already got (`slotNodes`): every call of the slot re-runs the parent's slot function — with Vue's JSX, every
* expression written inside those children — so reading the props off a second call builds the content twice.
*/
protected getSlotProperties extends Vue {
model: never;
private vueTsxProps: Readonly<{ ref?: string }> & Readonly ;
}
interface ComponentOption {
name?: string;
emits?: string[];
provide?: Record