mirror of
https://github.com/status-im/consul.git
synced 2025-02-07 19:35:35 +00:00
* ui: Add the most basic workspace root in /ui * We already have a LICENSE file in the repository root * Change directory path in build scripts ui-v2 -> ui * Make yarn install flags configurable from elsewhere * Minimal workspace root makefile * Call the new docker specific target * Update yarn in the docker build image * Reconfigure the netlify target and move to the higher makefile * Move ui-v2 -> ui/packages/consul-ui * Change repo root to refleect new folder structure * Temporarily don't hoist consul-api-double * Fixup CI configuration * Fixup lint errors * Fixup Netlify target
38 lines
873 B
JavaScript
38 lines
873 B
JavaScript
import Component from '@glimmer/component';
|
|
import { tracked } from '@glimmer/tracking';
|
|
import { action } from '@ember/object';
|
|
|
|
export default class Element extends Component {
|
|
@tracked el;
|
|
|
|
@tracked touched = false;
|
|
|
|
get type() {
|
|
if (typeof this.el !== 'undefined') {
|
|
return this.el.dataset.type || this.el.getAttribute('type') || this.el.getAttribute('role');
|
|
}
|
|
return this.args.type;
|
|
}
|
|
get name() {
|
|
if (typeof this.args.group !== 'undefined') {
|
|
return `${this.args.group.name}[${this.args.name}]`;
|
|
} else {
|
|
return this.args.name;
|
|
}
|
|
}
|
|
get prop() {
|
|
return `${this.args.name.toLowerCase().replaceAll('.', '-')}`;
|
|
}
|
|
get state() {
|
|
const error = this.touched && this.args.error;
|
|
return {
|
|
matches: name => name === 'error' && error,
|
|
};
|
|
}
|
|
|
|
@action
|
|
connect($el) {
|
|
this.el = $el;
|
|
}
|
|
}
|