Good progress on styling post-registration form
This commit is contained in:
parent
8b03454d6f
commit
1fb924f59c
17 changed files with 234 additions and 85 deletions
|
@ -1,11 +1,18 @@
|
|||
<div class="mail-entry {{@wrapper-classes}}">
|
||||
<label>
|
||||
Email
|
||||
<Input @type="text" @value={{this.args.data.mail}} placeholder="Email address" {{on "change" (fn this.checkMail)}}/>
|
||||
<!--<div class="filling-spacer"/>-->
|
||||
<Input
|
||||
class="mail-input {{if this.mailOk "mail-input-ok" "mail-input-error"}} {{@input-classes}}"
|
||||
@type="text"
|
||||
@value={{this.args.data.mail}}
|
||||
placeholder="Email address"
|
||||
{{on "change" this.checkMail}}
|
||||
/>
|
||||
</label>
|
||||
{{#if this.mailOk}}
|
||||
<p class="mail-ok">O</p>
|
||||
<p class="mail-ok mail-status">✔</p>
|
||||
{{else}}
|
||||
<p class="mail-error">X</p>
|
||||
<p class="mail-error mail-status">X</p>
|
||||
{{/if}}
|
||||
</div>
|
|
@ -1,27 +1,27 @@
|
|||
import { action } from '@ember/object'
|
||||
import { map } from '@ember/object/computed'
|
||||
import Component from '@glimmer/component'
|
||||
import { tracked } from '@glimmer/tracking'
|
||||
import { action } from '@ember/object';
|
||||
import { map } from '@ember/object/computed';
|
||||
import Component from '@glimmer/component';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
|
||||
const re = /.+@\S+\.\S+/
|
||||
const re = /.+@\S+\.\S+/;
|
||||
|
||||
export interface UtilMailEntrySignature {
|
||||
// The arguments accepted by the component
|
||||
Args: {
|
||||
data: { mail: string; valid: boolean }
|
||||
}
|
||||
data: { mail: string; valid: boolean };
|
||||
};
|
||||
// Any blocks yielded by the component
|
||||
Blocks: {
|
||||
default: []
|
||||
}
|
||||
default: [];
|
||||
};
|
||||
// The element to which `...attributes` is applied in the component template
|
||||
Element: null
|
||||
Element: null;
|
||||
}
|
||||
|
||||
export default class UtilMailEntry extends Component<UtilMailEntrySignature> {
|
||||
@tracked mailOk = this.args.data.valid
|
||||
@tracked mailOk = this.args.data.valid;
|
||||
@action checkMail() {
|
||||
this.args.data.valid = re.test(this.args.data.mail)
|
||||
this.mailOk = this.args.data.valid
|
||||
this.args.data.valid = re.test(this.args.data.mail);
|
||||
this.mailOk = this.args.data.valid;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<Input
|
||||
@type="checkbox"
|
||||
name="{{element.name}}"
|
||||
class="{{@input-classes}}"
|
||||
@checked={{element.checked}}
|
||||
{{on "change" this.onChange}}
|
||||
/>
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
<ul>
|
||||
{{#each this.args.list as |element index|}}
|
||||
<li>
|
||||
<div class="string-array-element-wrapper">
|
||||
<div class="string-array-element-wrapper {{@element-wrapper-classes}}">
|
||||
<Input
|
||||
class="{{@element-classes}}"
|
||||
@type="text"
|
||||
@value={{element.value}}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue