discourse/app/assets/javascripts/admin/addon/components/schema-theme-setting/field.gjs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
614 B
Plaintext
Raw Normal View History

import Component from "@glimmer/component";
import { Input } from "@ember/component";
export default class SchemaThemeSettingField extends Component {
#bufferVal;
get component() {
if (this.args.type === "string") {
return Input;
}
}
get value() {
return this.#bufferVal || this.args.value;
}
set value(v) {
this.#bufferVal = v;
this.args.onValueChange(v);
}
<template>
<div class="schema-field" data-name={{@name}}>
<label>{{@name}}</label>
<div class="input">
<this.component @value={{this.value}} />
</div>
</div>
</template>
}