Placeholder now uses new dual property converter.

This commit is contained in:
Matt Mo 2020-09-25 09:25:36 -07:00
parent 81acb1f000
commit e617d3596a
2 changed files with 7 additions and 3 deletions

View File

@ -51,6 +51,7 @@ class ChipList extends IgniteElement {
get properties() {
return {
items: null,
placeholder: null,
editing: false,
input: null,
searchBox: null,
@ -59,7 +60,7 @@ class ChipList extends IgniteElement {
{ id: 502, corporation: "Starbucks", content: "Starbucks #1, Spokane WA" },
{ id: 503, corporation: "Starbucks", content: "Starbucks #2, Spokane WA" }
],
searchEmpty: "No results found.",
searchPlaceholder: "No results found.",
searchFooter: null,
blurTimeout: null,
documentListener: null
@ -71,10 +72,13 @@ class ChipList extends IgniteElement {
.style("position", "relative")
.class(this.editing, value => { return value ? "editing" : null })
.child(
new span(this.placeholder).hide([this.editing, this.items], (editing, items) => {
return editing || (items != null && items.length > 0);
}),
new list(this.items, (item) => {
return new Chip()
.id(item.id)
.property("onDelete", () => { this.items = this.items.filter(needle => needle != item) })
.property("onDelete", () => { this.items = this.items.filter(needle => needle != item); })
.child(item.content);
}),
new div()
@ -118,7 +122,7 @@ class ChipList extends IgniteElement {
.class("shadow d-flex flex-column justify-content-center p-2")
.style("background-color", "#fff")
.child(
new span(this.searchEmpty).class("mt-2").hide(this.searchResults, value => { return value != null && value.length > 0; }),
new span(this.searchPlaceholder).class("mt-2").hide(this.searchResults, value => { return value != null && value.length > 0; }),
new list(this.searchResults, item => {
return new div(item.content).class("search-result p-2").onClick(() => this.searchResultClick(item));
}),

0
selectable-label.js Normal file
View File