FEATURE: color-palettes component (#6992)

This commit is contained in:
Joffrey JAFFEUX
2019-02-08 14:01:14 +01:00
committed by GitHub
parent babd80dfd1
commit 44d9bc12c9
6 changed files with 63 additions and 7 deletions

View File

@ -0,0 +1,7 @@
import ComboBoxComponent from "select-kit/components/combo-box";
export default ComboBoxComponent.extend({
pluginApiIdentifiers: ["color-palettes"],
classNames: "color-palettes",
rowComponent: "color-palettes/color-palettes-row"
});

View File

@ -0,0 +1,14 @@
import { escapeExpression } from "discourse/lib/utilities";
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
import { default as computed } from "ember-addons/ember-computed-decorators";
export default SelectKitRowComponent.extend({
layoutName:
"select-kit/templates/components/color-palettes/color-palettes-row",
classNames: "color-palettes-row",
@computed("computedContent.originalContent.colors")
colors(colors) {
return (colors || []).map(color => `#${escapeExpression(color.hex)}`);
}
});