Simple list of string property control
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user