Simple list of string property control

This commit is contained in:
BoykoAlex
2017-08-31 14:06:12 -04:00
parent 9b5d5a6041
commit a89903ceea
4 changed files with 25 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
<div id="palette-filter" class="palette-filter">
<input type="text" id="palette-filter-textfield" class="palette-filter-textfield" [(ngModel)]="filterText"/>
</div>
<div id="palette-paper-container" style="height:calc(100% - 46px); width:100%; overflow:auto;">
<div id="palette-paper-container" style="height:calc(100% - 40px); width:100%; overflow:auto;">
<div id="palette-paper" class="palette-paper" style="overflow:hidden;"></div>
</div>

View File

@@ -88,6 +88,22 @@ export namespace Properties {
}
export class GenericListControlModel extends GenericControlModel<string> {
constructor(property : Property, validation? : Validation) {
super(property, InputType.TEXT, validation);
}
get value() : string {
return this.property.value ? this.property.value.join(', ') : '';
}
set value(value : string) {
this.property.value = value && value.trim() ? value.split(/\s*,\s*/) : undefined;
}
}
export class SelectControlModel extends GenericControlModel<any> {
constructor(_property : Property, type : InputType, public options : Array<SelectOption>) {
super(_property, type);