Files
nomad/ui/app/components/variable-form/input-group.js
2023-04-10 15:36:59 +00:00

24 lines
458 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
// @ts-check
import { action } from '@ember/object';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
export default class InputGroup extends Component {
@tracked isObscured = true;
get inputType() {
return this.isObscured ? 'password' : 'text';
}
@action
toggleInputType() {
this.isObscured = !this.isObscured;
}
}