Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 22x 22x 1x 22x 1x 20x 18x | import { DynamicForm } from '../../dynamic-form/dynamic-form';
import { DynamicFormBuilder } from '../../dynamic-form/dynamic-form.builder';
import { DynamicFormElement } from '../dynamic-form-element';
import { DynamicFormItemDefinition } from './dynamic-form-item-definition';
import { DynamicFormItemTemplate } from './dynamic-form-item-template';
export class DynamicFormItem<
Template extends DynamicFormItemTemplate = DynamicFormItemTemplate,
Definition extends DynamicFormItemDefinition<Template> = DynamicFormItemDefinition<Template>
> extends DynamicFormElement<Template, Definition> {
constructor(
builder: DynamicFormBuilder,
root: DynamicForm,
parent: DynamicFormElement,
definition: Definition,
) {
super(builder, root, parent, definition, null);
this.extendExpressionData({
index: () => this.index,
});
}
get index(): number { return this.definition.index; }
get label(): string { return this.template.label; }
get disabled(): boolean { return this.index > 0 && this.template.disabled; }
protected override getChildren(): DynamicFormElement[] {
return this._builder.createFormElements(this.root, this.parent, this.definition.children);
}
}
|