ember-validated-form 4.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -1
- package/.github/dependabot.yml +11 -0
- package/.github/workflows/deploy.yml +1 -1
- package/.github/workflows/test.yml +1 -1
- package/CHANGELOG.md +24 -0
- package/README.md +2 -2
- package/addon/-private/themed-component.js +31 -35
- package/addon/components/validated-button/-themes/bootstrap/button.js +7 -9
- package/addon/components/validated-button/-themes/uikit/button.js +7 -9
- package/addon/components/validated-button/button.hbs +9 -0
- package/addon/components/validated-button/button.js +3 -8
- package/addon/components/validated-button.hbs +17 -0
- package/addon/components/validated-button.js +4 -8
- package/addon/components/validated-form.hbs +21 -0
- package/addon/components/validated-form.js +32 -46
- package/addon/components/validated-input/-themes/bootstrap/error.js +3 -3
- package/addon/components/validated-input/-themes/bootstrap/hint.js +3 -3
- package/addon/components/validated-input/-themes/bootstrap/label.js +1 -1
- package/addon/components/validated-input/-themes/bootstrap/render.js +3 -3
- package/addon/components/validated-input/-themes/uikit/error.hbs +4 -0
- package/addon/components/validated-input/-themes/uikit/error.js +1 -4
- package/addon/components/validated-input/-themes/uikit/hint.js +3 -3
- package/addon/components/validated-input/-themes/uikit/label.js +3 -3
- package/addon/components/validated-input/-themes/uikit/render.hbs +110 -0
- package/addon/components/validated-input/-themes/uikit/render.js +3 -5
- package/addon/components/validated-input/error.hbs +1 -0
- package/addon/components/validated-input/error.js +6 -7
- package/addon/components/validated-input/hint.hbs +1 -0
- package/addon/components/validated-input/hint.js +3 -7
- package/addon/components/validated-input/label.hbs +3 -0
- package/addon/components/validated-input/label.js +3 -8
- package/addon/components/validated-input/render.hbs +108 -0
- package/addon/components/validated-input/render.js +10 -13
- package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.hbs +19 -0
- package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.js +1 -4
- package/addon/components/validated-input/types/-themes/bootstrap/checkbox.hbs +14 -0
- package/addon/components/validated-input/types/-themes/bootstrap/checkbox.js +1 -6
- package/addon/components/validated-input/types/-themes/bootstrap/input.js +11 -4
- package/addon/components/validated-input/types/-themes/bootstrap/radio-group.hbs +20 -0
- package/addon/components/validated-input/types/-themes/bootstrap/radio-group.js +1 -4
- package/addon/components/validated-input/types/-themes/bootstrap/select.js +11 -4
- package/addon/components/validated-input/types/-themes/bootstrap/textarea.js +11 -4
- package/addon/components/validated-input/types/-themes/uikit/checkbox-group.hbs +19 -0
- package/addon/components/validated-input/types/-themes/uikit/checkbox-group.js +1 -4
- package/addon/components/validated-input/types/-themes/uikit/checkbox.hbs +15 -0
- package/addon/components/validated-input/types/-themes/uikit/checkbox.js +1 -4
- package/addon/components/validated-input/types/-themes/uikit/input.js +11 -4
- package/addon/components/validated-input/types/-themes/uikit/radio-group.hbs +20 -0
- package/addon/components/validated-input/types/-themes/uikit/radio-group.js +1 -4
- package/addon/components/validated-input/types/-themes/uikit/select.js +11 -4
- package/addon/components/validated-input/types/-themes/uikit/textarea.js +11 -4
- package/addon/components/validated-input/types/checkbox-group.hbs +14 -0
- package/addon/components/validated-input/types/checkbox-group.js +9 -11
- package/addon/components/validated-input/types/checkbox.hbs +9 -0
- package/addon/components/validated-input/types/checkbox.js +10 -6
- package/addon/components/validated-input/types/input.hbs +6 -0
- package/addon/components/validated-input/types/input.js +9 -17
- package/addon/components/validated-input/types/radio-group.hbs +14 -0
- package/addon/components/validated-input/types/radio-group.js +10 -6
- package/addon/components/validated-input/types/select.hbs +17 -0
- package/addon/components/validated-input/types/select.js +3 -7
- package/addon/components/validated-input/types/textarea.hbs +7 -0
- package/addon/components/validated-input/types/textarea.js +9 -17
- package/addon/{templates/components → components}/validated-input.hbs +3 -5
- package/addon/components/validated-input.js +1 -10
- package/app/components/validated-form.js +1 -7
- package/config/environment.js +1 -1
- package/package.json +40 -28
- package/.dependabot/config.yml +0 -14
- package/.prettierignore +0 -1
- package/addon/templates/components/validated-button/button.hbs +0 -1
- package/addon/templates/components/validated-button.hbs +0 -7
- package/addon/templates/components/validated-form.hbs +0 -15
- package/addon/templates/components/validated-input/-themes/uikit/render.hbs +0 -108
- package/addon/templates/components/validated-input/error.hbs +0 -1
- package/addon/templates/components/validated-input/hint.hbs +0 -1
- package/addon/templates/components/validated-input/label.hbs +0 -1
- package/addon/templates/components/validated-input/render.hbs +0 -107
- package/addon/templates/components/validated-input/types/-themes/bootstrap/checkbox-group.hbs +0 -14
- package/addon/templates/components/validated-input/types/-themes/bootstrap/checkbox.hbs +0 -10
- package/addon/templates/components/validated-input/types/-themes/bootstrap/radio-group.hbs +0 -15
- package/addon/templates/components/validated-input/types/-themes/bootstrap/select.hbs +0 -16
- package/addon/templates/components/validated-input/types/-themes/uikit/checkbox-group.hbs +0 -15
- package/addon/templates/components/validated-input/types/-themes/uikit/checkbox.hbs +0 -11
- package/addon/templates/components/validated-input/types/-themes/uikit/radio-group.hbs +0 -17
- package/addon/templates/components/validated-input/types/-themes/uikit/select.hbs +0 -17
- package/addon/templates/components/validated-input/types/checkbox-group.hbs +0 -14
- package/addon/templates/components/validated-input/types/checkbox.hbs +0 -9
- package/addon/templates/components/validated-input/types/radio-group.hbs +0 -14
- package/addon/templates/components/validated-input/types/select.hbs +0 -16
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<div class={{this.class}}>
|
|
2
|
+
{{#if (not-eq @type "checkbox")}}
|
|
3
|
+
<@labelComponent />
|
|
4
|
+
{{/if}}
|
|
5
|
+
|
|
6
|
+
{{#if (eq @type "select")}}
|
|
7
|
+
{{#let (component this.selectComponent) as |Select|}}
|
|
8
|
+
<Select
|
|
9
|
+
@disabled={{@disabled}}
|
|
10
|
+
@includeBlank={{@includeBlank}}
|
|
11
|
+
@inputId={{@inputId}}
|
|
12
|
+
@isInvalid={{@isInvalid}}
|
|
13
|
+
@isValid={{@isValid}}
|
|
14
|
+
@multiple={{@multiple}}
|
|
15
|
+
@name={{or @inputName @name}}
|
|
16
|
+
@optionLabelPath={{@optionLabelPath}}
|
|
17
|
+
@options={{@options}}
|
|
18
|
+
@optionTargetPath={{@optionTargetPath}}
|
|
19
|
+
@optionValuePath={{@optionValuePath}}
|
|
20
|
+
@promptIsSelectable={{@promptIsSelectable}}
|
|
21
|
+
@setDirty={{@setDirty}}
|
|
22
|
+
@update={{@update}}
|
|
23
|
+
@value={{@value}}
|
|
24
|
+
/>
|
|
25
|
+
{{/let}}
|
|
26
|
+
{{else if (or (eq @type "radioGroup") (eq @type "radio-group"))}}
|
|
27
|
+
{{#let (component this.radioGroupComponent) as |RadioGroup|}}
|
|
28
|
+
<RadioGroup
|
|
29
|
+
@disabled={{@disabled}}
|
|
30
|
+
@inputId={{@inputId}}
|
|
31
|
+
@isInvalid={{@isInvalid}}
|
|
32
|
+
@isValid={{@isValid}}
|
|
33
|
+
@name={{or @inputName @name}}
|
|
34
|
+
@options={{@options}}
|
|
35
|
+
@setDirty={{@setDirty}}
|
|
36
|
+
@update={{@update}}
|
|
37
|
+
@value={{@value}}
|
|
38
|
+
/>
|
|
39
|
+
{{/let}}
|
|
40
|
+
{{else if (or (eq @type "checkboxGroup") (eq @type "checkbox-group"))}}
|
|
41
|
+
{{#let (component this.checkboxGroupComponent) as |CheckboxGroup|}}
|
|
42
|
+
<CheckboxGroup
|
|
43
|
+
@disabled={{@disabled}}
|
|
44
|
+
@inputId={{@inputId}}
|
|
45
|
+
@isInvalid={{@isInvalid}}
|
|
46
|
+
@isValid={{@isValid}}
|
|
47
|
+
@name={{or @inputName @name}}
|
|
48
|
+
@options={{@options}}
|
|
49
|
+
@setDirty={{@setDirty}}
|
|
50
|
+
@update={{@update}}
|
|
51
|
+
@value={{@value}}
|
|
52
|
+
/>
|
|
53
|
+
{{/let}}
|
|
54
|
+
{{else if (eq @type "checkbox")}}
|
|
55
|
+
{{#let (component this.checkboxComponent) as |Checkbox|}}
|
|
56
|
+
<Checkbox
|
|
57
|
+
@disabled={{@disabled}}
|
|
58
|
+
@inputId={{@inputId}}
|
|
59
|
+
@isInvalid={{@isInvalid}}
|
|
60
|
+
@isValid={{@isValid}}
|
|
61
|
+
@labelComponent={{@labelComponent}}
|
|
62
|
+
@name={{or @inputName @name}}
|
|
63
|
+
@options={{@options}}
|
|
64
|
+
@setDirty={{@setDirty}}
|
|
65
|
+
@update={{@update}}
|
|
66
|
+
@value={{@value}}
|
|
67
|
+
/>
|
|
68
|
+
{{/let}}
|
|
69
|
+
{{else if (eq @type "textarea")}}
|
|
70
|
+
{{#let (component this.textareaComponent) as |DynamicTextarea|}}
|
|
71
|
+
<DynamicTextarea
|
|
72
|
+
autocomplete={{@autocomplete}}
|
|
73
|
+
autofocus={{@autofocus}}
|
|
74
|
+
cols={{@cols}}
|
|
75
|
+
disabled={{@disabled}}
|
|
76
|
+
id={{@inputId}}
|
|
77
|
+
name={{or @inputName @name}}
|
|
78
|
+
placeholder={{@placeholder}}
|
|
79
|
+
rows={{@rows}}
|
|
80
|
+
value={{@value}}
|
|
81
|
+
@isInvalid={{@isInvalid}}
|
|
82
|
+
@isValid={{@isValid}}
|
|
83
|
+
@setDirty={{@setDirty}}
|
|
84
|
+
@update={{@update}}
|
|
85
|
+
/>
|
|
86
|
+
{{/let}}
|
|
87
|
+
{{else}}
|
|
88
|
+
{{#let (component this.inputComponent) as |DynamicInput|}}
|
|
89
|
+
<DynamicInput
|
|
90
|
+
autocomplete={{@autocomplete}}
|
|
91
|
+
autofocus={{@autofocus}}
|
|
92
|
+
disabled={{@disabled}}
|
|
93
|
+
id={{@inputId}}
|
|
94
|
+
name={{or @inputName @name}}
|
|
95
|
+
placeholder={{@placeholder}}
|
|
96
|
+
type={{@type}}
|
|
97
|
+
value={{@value}}
|
|
98
|
+
@isInvalid={{@isInvalid}}
|
|
99
|
+
@isValid={{@isValid}}
|
|
100
|
+
@setDirty={{@setDirty}}
|
|
101
|
+
@update={{@update}}
|
|
102
|
+
/>
|
|
103
|
+
{{/let}}
|
|
104
|
+
{{/if}}
|
|
105
|
+
|
|
106
|
+
<@hintComponent />
|
|
107
|
+
<@errorComponent />
|
|
108
|
+
</div>
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import Component from "@
|
|
1
|
+
import Component from "@glimmer/component";
|
|
2
2
|
|
|
3
3
|
import themedComponent from "../../-private/themed-component";
|
|
4
|
-
import layout from "../../templates/components/validated-input/render";
|
|
5
4
|
|
|
6
|
-
export default Component
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
inputComponent: themedComponent("validated-input/types/input"),
|
|
16
|
-
});
|
|
5
|
+
export default class RenderComponent extends Component {
|
|
6
|
+
@themedComponent("validated-input/types/input") inputComponent;
|
|
7
|
+
@themedComponent("validated-input/types/textarea") textareaComponent;
|
|
8
|
+
@themedComponent("validated-input/types/checkbox") checkboxComponent;
|
|
9
|
+
@themedComponent("validated-input/types/radio-group") radioGroupComponent;
|
|
10
|
+
@themedComponent("validated-input/types/checkbox-group")
|
|
11
|
+
checkboxGroupComponent;
|
|
12
|
+
@themedComponent("validated-input/types/select") selectComponent;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{{#each @options as |option i|}}
|
|
2
|
+
<div class="custom-control custom-checkbox">
|
|
3
|
+
<input
|
|
4
|
+
type="checkbox"
|
|
5
|
+
class="custom-control-input
|
|
6
|
+
{{if @isValid "is-valid"}}
|
|
7
|
+
{{if @isInvalid "is-invalid"}}"
|
|
8
|
+
checked={{includes option.key @value}}
|
|
9
|
+
name={{@name}}
|
|
10
|
+
id="{{@inputId}}-{{i}}"
|
|
11
|
+
disabled={{@disabled}}
|
|
12
|
+
{{on "input" (fn this.onUpdate option.key)}}
|
|
13
|
+
/>
|
|
14
|
+
<label
|
|
15
|
+
class="custom-control-label"
|
|
16
|
+
for="{{@inputId}}-{{i}}"
|
|
17
|
+
>{{option.label}}</label>
|
|
18
|
+
</div>
|
|
19
|
+
{{/each}}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import layout from "../../../../../templates/components/validated-input/types/-themes/bootstrap/checkbox-group";
|
|
2
1
|
import Component from "../../checkbox-group";
|
|
3
2
|
|
|
4
|
-
export default Component
|
|
5
|
-
layout,
|
|
6
|
-
});
|
|
3
|
+
export default class BootstrapCheckboxGroupComponent extends Component {}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div class="custom-control custom-checkbox">
|
|
2
|
+
<input
|
|
3
|
+
class="custom-control-input
|
|
4
|
+
{{if @isValid "is-valid"}}
|
|
5
|
+
{{if @isInvalid "is-invalid"}}"
|
|
6
|
+
type="checkbox"
|
|
7
|
+
name={{@name}}
|
|
8
|
+
id={{@inputId}}
|
|
9
|
+
disabled={{@disabled}}
|
|
10
|
+
checked={{@value}}
|
|
11
|
+
{{on "input" this.onUpdate}}
|
|
12
|
+
/>
|
|
13
|
+
<@labelComponent class="custom-control-label" />
|
|
14
|
+
</div>
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import layout from "../../../../../templates/components/validated-input/types/-themes/bootstrap/checkbox";
|
|
2
1
|
import Component from "../../checkbox";
|
|
3
2
|
|
|
4
|
-
export default Component
|
|
5
|
-
layout,
|
|
6
|
-
tagName: "div",
|
|
7
|
-
classNames: ["custom-control", "custom-checkbox"],
|
|
8
|
-
});
|
|
3
|
+
export default class BootstrapCheckboxComponent extends Component {}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import Component from "../../input";
|
|
2
2
|
|
|
3
|
-
export default Component
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export default class BootstrapInputComponent extends Component {
|
|
4
|
+
get class() {
|
|
5
|
+
const style = this.args.isValid
|
|
6
|
+
? "is-valid"
|
|
7
|
+
: this.args.isInvalid
|
|
8
|
+
? "is-invalid"
|
|
9
|
+
: "";
|
|
10
|
+
|
|
11
|
+
return `form-control ${style}`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{{#each @options as |option i|}}
|
|
2
|
+
<div class="custom-control custom-radio">
|
|
3
|
+
<input
|
|
4
|
+
type="radio"
|
|
5
|
+
class="custom-control-input
|
|
6
|
+
{{if @isValid "is-valid"}}
|
|
7
|
+
{{if @isInvalid "is-invalid"}}"
|
|
8
|
+
checked={{eq @value option.key}}
|
|
9
|
+
value={{option.key}}
|
|
10
|
+
name={{@name}}
|
|
11
|
+
id="{{@inputId}}-{{i}}"
|
|
12
|
+
disabled={{@disabled}}
|
|
13
|
+
{{on "input" (fn this.onUpdate option.key)}}
|
|
14
|
+
/>
|
|
15
|
+
<label
|
|
16
|
+
class="custom-control-label"
|
|
17
|
+
for="{{@inputId}}-{{i}}"
|
|
18
|
+
>{{option.label}}</label>
|
|
19
|
+
</div>
|
|
20
|
+
{{/each}}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import layout from "../../../../../templates/components/validated-input/types/-themes/bootstrap/radio-group";
|
|
2
1
|
import Component from "../../radio-group";
|
|
3
2
|
|
|
4
|
-
export default Component
|
|
5
|
-
layout,
|
|
6
|
-
});
|
|
3
|
+
export default class BootstrapRadioGroupComponent extends Component {}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import layout from "../../../../../templates/components/validated-input/types/-themes/bootstrap/select";
|
|
2
1
|
import Component from "../../select";
|
|
3
2
|
|
|
4
|
-
export default Component
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export default class BootstrapSelectComponent extends Component {
|
|
4
|
+
get class() {
|
|
5
|
+
const style = this.args.isValid
|
|
6
|
+
? "is-valid"
|
|
7
|
+
: this.args.isInvalid
|
|
8
|
+
? "is-invalid"
|
|
9
|
+
: "";
|
|
10
|
+
|
|
11
|
+
return `form-control ${style}`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import Component from "../../textarea";
|
|
2
2
|
|
|
3
|
-
export default Component
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export default class BootstrapTextareaComponent extends Component {
|
|
4
|
+
get class() {
|
|
5
|
+
const style = this.args.isValid
|
|
6
|
+
? "is-valid"
|
|
7
|
+
: this.args.isInvalid
|
|
8
|
+
? "is-invalid"
|
|
9
|
+
: "";
|
|
10
|
+
|
|
11
|
+
return `form-control ${style}`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{{#each @options as |option i|}}
|
|
2
|
+
{{#if (not-eq i 0)}}<br />{{/if}}
|
|
3
|
+
<label
|
|
4
|
+
class="uk-form-label
|
|
5
|
+
{{if @isValid "uk-text-success"}}
|
|
6
|
+
{{if @isInvalid "uk-text-danger"}}"
|
|
7
|
+
>
|
|
8
|
+
<input
|
|
9
|
+
type="checkbox"
|
|
10
|
+
class="uk-checkbox uk-margin-small-right"
|
|
11
|
+
checked={{includes option.key @value}}
|
|
12
|
+
name={{@name}}
|
|
13
|
+
id="{{@inputId}}-{{i}}"
|
|
14
|
+
disabled={{@disabled}}
|
|
15
|
+
{{on "input" (fn this.onUpdate option.key)}}
|
|
16
|
+
/>
|
|
17
|
+
{{option.label}}
|
|
18
|
+
</label>
|
|
19
|
+
{{/each}}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import layout from "../../../../../templates/components/validated-input/types/-themes/uikit/checkbox-group";
|
|
2
1
|
import Component from "../../checkbox-group";
|
|
3
2
|
|
|
4
|
-
export default Component
|
|
5
|
-
layout,
|
|
6
|
-
});
|
|
3
|
+
export default class UikitCheckboxGroupComponent extends Component {}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{{#let (component @labelComponent) as |Label|}}
|
|
2
|
+
<Label
|
|
3
|
+
class="{{if @isValid "uk-text-success"}} {{if @isInvalid "uk-text-danger"}}"
|
|
4
|
+
>
|
|
5
|
+
<input
|
|
6
|
+
class="uk-checkbox uk-margin-small-right"
|
|
7
|
+
type="checkbox"
|
|
8
|
+
name={{@name}}
|
|
9
|
+
id={{@inputId}}
|
|
10
|
+
disabled={{@disabled}}
|
|
11
|
+
checked={{@value}}
|
|
12
|
+
{{on "input" this.onUpdate}}
|
|
13
|
+
/>
|
|
14
|
+
</Label>
|
|
15
|
+
{{/let}}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import Component from "../../input";
|
|
2
2
|
|
|
3
|
-
export default Component
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export default class UikitInputComponent extends Component {
|
|
4
|
+
get class() {
|
|
5
|
+
const style = this.args.isValid
|
|
6
|
+
? "uk-form-success"
|
|
7
|
+
: this.args.isInvalid
|
|
8
|
+
? "uk-form-danger"
|
|
9
|
+
: "";
|
|
10
|
+
|
|
11
|
+
return `uk-input ${style}`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{{#each @options as |option i|}}
|
|
2
|
+
{{#if (not-eq i 0)}}<br />{{/if}}
|
|
3
|
+
<label
|
|
4
|
+
class="uk-form-label
|
|
5
|
+
{{if @isValid "uk-text-success"}}
|
|
6
|
+
{{if @isInvalid "uk-text-danger"}}"
|
|
7
|
+
>
|
|
8
|
+
<input
|
|
9
|
+
type="radio"
|
|
10
|
+
class="uk-radio uk-margin-small-right"
|
|
11
|
+
checked={{eq @value option.key}}
|
|
12
|
+
value={{option.key}}
|
|
13
|
+
name={{@name}}
|
|
14
|
+
id="{{@inputId}}-{{i}}"
|
|
15
|
+
disabled={{@disabled}}
|
|
16
|
+
{{on "input" (fn this.onUpdate option.key)}}
|
|
17
|
+
/>
|
|
18
|
+
{{option.label}}
|
|
19
|
+
</label>
|
|
20
|
+
{{/each}}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import layout from "../../../../../templates/components/validated-input/types/-themes/uikit/radio-group";
|
|
2
1
|
import Component from "../../radio-group";
|
|
3
2
|
|
|
4
|
-
export default Component
|
|
5
|
-
layout,
|
|
6
|
-
});
|
|
3
|
+
export default class UikitRadioGroupComponent extends Component {}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import layout from "../../../../../templates/components/validated-input/types/-themes/uikit/select";
|
|
2
1
|
import Component from "../../select";
|
|
3
2
|
|
|
4
|
-
export default Component
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export default class UikitSelectComponent extends Component {
|
|
4
|
+
get class() {
|
|
5
|
+
const style = this.args.isValid
|
|
6
|
+
? "uk-form-success"
|
|
7
|
+
: this.args.isInvalid
|
|
8
|
+
? "uk-form-danger"
|
|
9
|
+
: "";
|
|
10
|
+
|
|
11
|
+
return `uk-select ${style}`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import Component from "../../textarea";
|
|
2
2
|
|
|
3
|
-
export default Component
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export default class UikitTextareaComponent extends Component {
|
|
4
|
+
get class() {
|
|
5
|
+
const style = this.args.isValid
|
|
6
|
+
? "uk-form-success"
|
|
7
|
+
: this.args.isInvalid
|
|
8
|
+
? "uk-form-danger"
|
|
9
|
+
: "";
|
|
10
|
+
|
|
11
|
+
return `uk-textarea ${style}`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{#each @options as |option i|}}
|
|
2
|
+
<label>
|
|
3
|
+
<input
|
|
4
|
+
type="checkbox"
|
|
5
|
+
checked={{eq @value option.key}}
|
|
6
|
+
value={{option.key}}
|
|
7
|
+
name={{@name}}
|
|
8
|
+
id="{{@inputId}}-{{i}}"
|
|
9
|
+
disabled={{@disabled}}
|
|
10
|
+
{{on "input" (fn this.onUpdate option.key)}}
|
|
11
|
+
/>
|
|
12
|
+
{{option.label}}
|
|
13
|
+
</label>
|
|
14
|
+
{{/each}}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import Component from "@ember/component";
|
|
2
1
|
import { action } from "@ember/object";
|
|
2
|
+
import Component from "@glimmer/component";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default Component.extend({
|
|
7
|
-
layout,
|
|
8
|
-
|
|
4
|
+
export default class CheckboxGroupComponent extends Component {
|
|
9
5
|
@action
|
|
10
|
-
onUpdate(key) {
|
|
6
|
+
onUpdate(event, key) {
|
|
7
|
+
event.preventDefault();
|
|
8
|
+
|
|
11
9
|
const value = this.value || [];
|
|
12
10
|
const index = value.indexOf(key);
|
|
13
11
|
|
|
@@ -17,7 +15,7 @@ export default Component.extend({
|
|
|
17
15
|
value.push(key);
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
this.update(value);
|
|
21
|
-
this.setDirty();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
18
|
+
this.args.update(value);
|
|
19
|
+
this.args.setDirty();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { action } from "@ember/object";
|
|
2
|
+
import Component from "@glimmer/component";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
export default class CheckboxComponent extends Component {
|
|
5
|
+
@action
|
|
6
|
+
onUpdate(event) {
|
|
7
|
+
event.preventDefault();
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
+
this.args.update(event.target.checked);
|
|
10
|
+
this.args.setDirty();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { action } from "@ember/object";
|
|
2
|
+
import Component from "@glimmer/component";
|
|
2
3
|
|
|
3
|
-
export default Component
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"value",
|
|
8
|
-
"placeholder",
|
|
9
|
-
"type",
|
|
10
|
-
"inputId:id",
|
|
11
|
-
"name",
|
|
12
|
-
"autofocus",
|
|
13
|
-
"autocomplete",
|
|
14
|
-
"disabled",
|
|
4
|
+
export default class InputComponent extends Component {
|
|
5
|
+
@action
|
|
6
|
+
onUpdate(event) {
|
|
7
|
+
event.preventDefault();
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
9
|
+
this.args.update(event.target.value);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{#each @options as |option i|}}
|
|
2
|
+
<label>
|
|
3
|
+
<input
|
|
4
|
+
type="radio"
|
|
5
|
+
checked={{eq @value option.key}}
|
|
6
|
+
value={{option.key}}
|
|
7
|
+
name={{@name}}
|
|
8
|
+
id="{{@inputId}}-{{i}}"
|
|
9
|
+
disabled={{@disabled}}
|
|
10
|
+
{{on "input" (fn this.onUpdate option.key)}}
|
|
11
|
+
/>
|
|
12
|
+
{{option.label}}
|
|
13
|
+
</label>
|
|
14
|
+
{{/each}}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { action } from "@ember/object";
|
|
2
|
+
import Component from "@glimmer/component";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
export default class RadioGroupComponent extends Component {
|
|
5
|
+
@action
|
|
6
|
+
onUpdate(value, event) {
|
|
7
|
+
event.preventDefault();
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
+
this.args.update(value);
|
|
10
|
+
this.args.setDirty();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{{! template-lint-disable no-passed-in-event-handlers }}
|
|
2
|
+
<OneWaySelect
|
|
3
|
+
@value={{@value}}
|
|
4
|
+
@options={{@options}}
|
|
5
|
+
@optionLabelPath={{@optionLabelPath}}
|
|
6
|
+
@optionValuePath={{@optionValuePath}}
|
|
7
|
+
@optionTargetPath={{@optionTargetPath}}
|
|
8
|
+
@name={{@name}}
|
|
9
|
+
@id={{@inputId}}
|
|
10
|
+
@class={{this.class}}
|
|
11
|
+
@update={{@update}}
|
|
12
|
+
@focusOut={{@setDirty}}
|
|
13
|
+
@includeBlank={{@includeBlank}}
|
|
14
|
+
@disabled={{@disabled}}
|
|
15
|
+
@multiple={{@multiple}}
|
|
16
|
+
@promptIsSelectable={{or @promptIsSelectable false}}
|
|
17
|
+
/>
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import Component from "@
|
|
1
|
+
import Component from "@glimmer/component";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default Component.extend({
|
|
6
|
-
layout,
|
|
7
|
-
tagName: "",
|
|
8
|
-
});
|
|
3
|
+
// eslint-disable-next-line ember/no-empty-glimmer-component-classes
|
|
4
|
+
export default class SelectComponent extends Component {}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { action } from "@ember/object";
|
|
2
|
+
import Component from "@glimmer/component";
|
|
2
3
|
|
|
3
|
-
export default Component
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"placeholder",
|
|
8
|
-
"name",
|
|
9
|
-
"inputId:id",
|
|
10
|
-
"disabled",
|
|
11
|
-
"autofocus",
|
|
12
|
-
"rows",
|
|
13
|
-
"cols",
|
|
14
|
-
"autocomplete",
|
|
4
|
+
export default class TextareaComponent extends Component {
|
|
5
|
+
@action
|
|
6
|
+
onUpdate(event) {
|
|
7
|
+
event.preventDefault();
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
9
|
+
this.args.update(event.target.value);
|
|
10
|
+
}
|
|
11
|
+
}
|