Newer
Older
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
34
35
36
37
38
39
40
41
42
43
import { ElementFactory } from 'common/util/element.factory';
import {
BasicStyles,
InputAssistancePreset,
InputElement,
PositionedUIElement,
PositionProperties
} from 'common/models/elements/element';
import { Type } from '@angular/core';
import { ElementComponent } from 'common/directives/element-component.directive';
import { TextAreaComponent } from 'common/components/input-elements/text-area.component';
export class TextAreaElement extends InputElement implements PositionedUIElement {
appearance: 'fill' | 'outline' = 'outline';
resizeEnabled: boolean = false;
rowCount: number = 3;
inputAssistancePreset: InputAssistancePreset = null;
inputAssistancePosition: 'floating' | 'right' = 'floating';
restrictedToInputAssistanceChars: boolean = true;
showSoftwareKeyboard: boolean = false;
softwareKeyboardShowFrench: boolean = false;
position: PositionProperties;
styling: BasicStyles & {
lineHeight: number;
};
constructor(element: Partial<TextAreaElement>) {
super({ width: 230, height: 132, ...element });
Object.assign(this, element);
this.position = ElementFactory.initPositionProps(element.position);
this.styling = {
...ElementFactory.initStylingProps({
backgroundColor: 'transparent',
lineHeight: 135,
...element.styling
})
};
}
getComponentFactory(): Type<ElementComponent> {
return TextAreaComponent;
}
}