ember-validated-form 6.1.1 → 6.2.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/CHANGELOG.md +19 -0
- package/addon/components/validated-button.js +1 -1
- package/addon/components/validated-form.js +3 -1
- package/addon/components/validated-input/error.hbs +2 -1
- package/addon/components/validated-input/hint.hbs +1 -0
- package/addon/components/validated-input/label.hbs +1 -1
- package/addon/components/validated-input/types/checkbox-group.hbs +2 -0
- package/addon/components/validated-input/types/checkbox.hbs +2 -0
- package/addon/components/validated-input/types/radio-group.hbs +2 -0
- package/addon/components/validated-input.hbs +13 -4
- package/addon/components/validated-input.js +9 -0
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [6.2.0](https://github.com/adfinis/ember-validated-form/compare/v6.1.2...v6.2.0) (2023-02-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* scroll error into view with nested key names ([#904](https://github.com/adfinis/ember-validated-form/issues/904)) ([5c192a5](https://github.com/adfinis/ember-validated-form/commit/5c192a5b00abf05d80f36d1fad8b67a79a36e43c))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **a11y:** add aria invalid and describedby attributes on validation ([6e16a51](https://github.com/adfinis/ember-validated-form/commit/6e16a5122f134ca991205c03c0dd8628288e4b08)), closes [#48](https://github.com/adfinis/ember-validated-form/issues/48)
|
|
12
|
+
|
|
13
|
+
## [6.1.2](https://github.com/adfinis/ember-validated-form/compare/v6.1.1...v6.1.2) (2022-09-20)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **label:** only show requiredness indicator if a label is given ([72c212d](https://github.com/adfinis/ember-validated-form/commit/72c212dc036c643dca43e1c22a7ec43384f70ab5))
|
|
19
|
+
|
|
1
20
|
## [6.1.1](https://github.com/adfinis/ember-validated-form/compare/v6.1.0...v6.1.1) (2022-09-20)
|
|
2
21
|
|
|
3
22
|
|
|
@@ -43,7 +43,7 @@ export default class ValidatedButtonComponent extends Component {
|
|
|
43
43
|
if (macroCondition(getOwnConfig().scrollErrorIntoView)) {
|
|
44
44
|
if (model.errors[0]?.key) {
|
|
45
45
|
document
|
|
46
|
-
.querySelector(`[name=${model.errors[0].key}]`)
|
|
46
|
+
.querySelector(`[name=${model.errors[0].key.replaceAll(".", "\\.")}]`)
|
|
47
47
|
?.scrollIntoView({ behavior: "smooth" });
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -48,7 +48,9 @@ export default class ValidatedFormComponent extends Component {
|
|
|
48
48
|
if (macroCondition(getOwnConfig().scrollErrorIntoView)) {
|
|
49
49
|
if (model.errors[0]?.key) {
|
|
50
50
|
document
|
|
51
|
-
.querySelector(
|
|
51
|
+
.querySelector(
|
|
52
|
+
`[name=${model.errors[0].key.replaceAll(".", "\\.")}]`
|
|
53
|
+
)
|
|
52
54
|
?.scrollIntoView({ behavior: "smooth" });
|
|
53
55
|
}
|
|
54
56
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{{#if (macroCondition (macroGetOwnConfig "isUikit"))}}
|
|
2
|
-
<small class="uk-text-danger" ...attributes>
|
|
2
|
+
<small id={{@id}} class="uk-text-danger" ...attributes>
|
|
3
3
|
{{yield}}{{this.errorString}}
|
|
4
4
|
</small>
|
|
5
5
|
{{else}}
|
|
6
6
|
<span
|
|
7
|
+
id={{@id}}
|
|
7
8
|
class={{if
|
|
8
9
|
(macroCondition (macroGetOwnConfig "isBootstrap"))
|
|
9
10
|
"d-block invalid-feedback"
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
id="{{@inputId}}-{{i}}"
|
|
15
15
|
disabled={{@disabled}}
|
|
16
16
|
{{on "input" (fn this.onUpdate option.key)}}
|
|
17
|
+
...attributes
|
|
17
18
|
/>
|
|
18
19
|
{{option.label}}
|
|
19
20
|
</label>
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
id="{{@inputId}}-{{i}}"
|
|
30
31
|
disabled={{@disabled}}
|
|
31
32
|
{{on "input" (fn this.onUpdate option.key)}}
|
|
33
|
+
...attributes
|
|
32
34
|
/>
|
|
33
35
|
<label
|
|
34
36
|
class="custom-control-label"
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
disabled={{@disabled}}
|
|
11
11
|
checked={{@value}}
|
|
12
12
|
{{on "input" this.onUpdate}}
|
|
13
|
+
...attributes
|
|
13
14
|
/>
|
|
14
15
|
</@labelComponent>
|
|
15
16
|
{{else if (macroCondition (macroGetOwnConfig "isBootstrap"))}}
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
disabled={{@disabled}}
|
|
25
26
|
checked={{@value}}
|
|
26
27
|
{{on "input" this.onUpdate}}
|
|
28
|
+
...attributes
|
|
27
29
|
/>
|
|
28
30
|
<@labelComponent class="custom-control-label" />
|
|
29
31
|
</div>
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
id="{{@inputId}}-{{i}}"
|
|
16
16
|
disabled={{@disabled}}
|
|
17
17
|
{{on "input" (fn this.onUpdate option.key)}}
|
|
18
|
+
...attributes
|
|
18
19
|
/>
|
|
19
20
|
{{option.label}}
|
|
20
21
|
</label>
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
id="{{@inputId}}-{{i}}"
|
|
32
33
|
disabled={{@disabled}}
|
|
33
34
|
{{on "input" (fn this.onUpdate option.key)}}
|
|
35
|
+
...attributes
|
|
34
36
|
/>
|
|
35
37
|
<label
|
|
36
38
|
class="custom-control-label"
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
}}
|
|
22
22
|
|
|
23
23
|
{{#if @hint}}
|
|
24
|
-
<this.hintComponent @hint={{@hint}} />
|
|
24
|
+
<this.hintComponent @hint={{@hint}} id={{this.hintId}} />
|
|
25
25
|
{{/if}}
|
|
26
26
|
|
|
27
27
|
{{#if (and this.showValidity this.errors)}}
|
|
28
|
-
<this.errorComponent @errors={{this.errors}} />
|
|
28
|
+
<this.errorComponent @errors={{this.errors}} id={{this.errorId}} />
|
|
29
29
|
{{/if}}
|
|
30
30
|
{{else}}
|
|
31
31
|
<this.renderComponent
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
@multiple={{@multiple}}
|
|
54
54
|
@update={{this.update}}
|
|
55
55
|
@setDirty={{this.setDirty}}
|
|
56
|
+
@submitted={{@submitted}}
|
|
56
57
|
@labelComponent={{component
|
|
57
58
|
(ensure-safe-component this.labelComponent)
|
|
58
59
|
label=@label
|
|
@@ -63,12 +64,20 @@
|
|
|
63
64
|
}}
|
|
64
65
|
@hintComponent={{if
|
|
65
66
|
@hint
|
|
66
|
-
(component
|
|
67
|
+
(component
|
|
68
|
+
(ensure-safe-component this.hintComponent) hint=@hint id=this.hintId
|
|
69
|
+
)
|
|
67
70
|
}}
|
|
68
71
|
@errorComponent={{if
|
|
69
72
|
(and this.showValidity this.errors)
|
|
70
|
-
(component
|
|
73
|
+
(component
|
|
74
|
+
(ensure-safe-component this.errorComponent)
|
|
75
|
+
errors=this.errors
|
|
76
|
+
id=this.errorId
|
|
77
|
+
)
|
|
71
78
|
}}
|
|
79
|
+
aria-invalid={{if this.isInvalid "true"}}
|
|
80
|
+
aria-describedby={{if this.isInvalid this.errorId this.hintId}}
|
|
72
81
|
...attributes
|
|
73
82
|
/>
|
|
74
83
|
{{/if}}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { action, set, get } from "@ember/object";
|
|
2
2
|
import { guidFor } from "@ember/object/internals";
|
|
3
|
+
import { isEmpty } from "@ember/utils";
|
|
3
4
|
import Component from "@glimmer/component";
|
|
4
5
|
import { tracked } from "@glimmer/tracking";
|
|
5
6
|
|
|
@@ -21,6 +22,14 @@ import passedOrDefault from "ember-validated-form/passed-or-default";
|
|
|
21
22
|
export default class ValidatedInputComponent extends Component {
|
|
22
23
|
inputId = guidFor(this);
|
|
23
24
|
|
|
25
|
+
get errorId() {
|
|
26
|
+
return `${this.inputId}-error`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get hintId() {
|
|
30
|
+
return !isEmpty(this.args.hint) ? `${this.inputId}-hint` : null;
|
|
31
|
+
}
|
|
32
|
+
|
|
24
33
|
@tracked dirty;
|
|
25
34
|
@tracked required;
|
|
26
35
|
@tracked type;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-validated-form",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Easily create forms with client-side validations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -20,25 +20,25 @@
|
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "ember build --environment=production",
|
|
23
|
-
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
|
|
24
|
-
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
|
|
23
|
+
"lint": "npm-run-all --print-name --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
|
|
24
|
+
"lint:fix": "npm-run-all --print-name --aggregate-output --continue-on-error --parallel \"lint:*:fix\"",
|
|
25
25
|
"lint:hbs": "ember-template-lint .",
|
|
26
26
|
"lint:hbs:fix": "ember-template-lint . --fix",
|
|
27
27
|
"lint:js": "eslint . --cache",
|
|
28
28
|
"lint:js:fix": "eslint . --fix",
|
|
29
29
|
"start": "ember serve",
|
|
30
|
-
"test": "npm-run-all lint test
|
|
30
|
+
"test": "npm-run-all --print-name \"lint\" \"test:*\"",
|
|
31
31
|
"test:ember": "ember test",
|
|
32
32
|
"test:ember-compatibility": "ember try:each",
|
|
33
33
|
"prepare": "husky install"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@embroider/macros": "^1.8.3",
|
|
37
|
-
"@embroider/util": "^1.
|
|
37
|
+
"@embroider/util": "^1.9.0",
|
|
38
38
|
"@glimmer/component": "^1.1.2",
|
|
39
39
|
"@glimmer/tracking": "^1.1.2",
|
|
40
|
-
"ember-changeset": "^4.1.
|
|
41
|
-
"ember-changeset-validations": "^4.1.
|
|
40
|
+
"ember-changeset": "^4.1.2",
|
|
41
|
+
"ember-changeset-validations": "^4.1.1",
|
|
42
42
|
"ember-cli-babel": "^7.26.11",
|
|
43
43
|
"ember-cli-htmlbars": "^6.1.1",
|
|
44
44
|
"ember-truth-helpers": "^3.1.1"
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@fortawesome/free-solid-svg-icons": "6.2.0",
|
|
54
54
|
"babel-eslint": "10.1.0",
|
|
55
55
|
"broccoli-asset-rev": "3.0.0",
|
|
56
|
-
"ember-auto-import": "2.4.
|
|
57
|
-
"ember-cli": "4.
|
|
56
|
+
"ember-auto-import": "2.4.3",
|
|
57
|
+
"ember-cli": "4.8.0",
|
|
58
58
|
"ember-cli-addon-docs": "5.0.0",
|
|
59
59
|
"ember-cli-dependency-checker": "3.3.1",
|
|
60
60
|
"ember-cli-deploy": "1.0.2",
|
|
@@ -70,31 +70,31 @@
|
|
|
70
70
|
"ember-disable-prototype-extensions": "1.1.3",
|
|
71
71
|
"ember-flatpickr": "3.2.3",
|
|
72
72
|
"ember-load-initializers": "2.1.2",
|
|
73
|
-
"ember-qunit": "
|
|
73
|
+
"ember-qunit": "6.0.0",
|
|
74
74
|
"ember-resolver": "8.0.3",
|
|
75
|
-
"ember-source": "4.
|
|
75
|
+
"ember-source": "4.8.0",
|
|
76
76
|
"ember-source-channel-url": "3.0.0",
|
|
77
|
-
"ember-template-lint": "4.
|
|
77
|
+
"ember-template-lint": "4.17.0",
|
|
78
78
|
"ember-template-lint-plugin-prettier": "4.0.0",
|
|
79
79
|
"ember-try": "2.0.0",
|
|
80
80
|
"eslint": "7.32.0",
|
|
81
81
|
"eslint-config-prettier": "8.5.0",
|
|
82
|
-
"eslint-plugin-ember": "11.0
|
|
82
|
+
"eslint-plugin-ember": "11.2.0",
|
|
83
83
|
"eslint-plugin-import": "2.26.0",
|
|
84
84
|
"eslint-plugin-node": "11.1.0",
|
|
85
85
|
"eslint-plugin-prettier": "4.2.1",
|
|
86
86
|
"eslint-plugin-qunit": "7.3.1",
|
|
87
|
-
"husky": "8.0.
|
|
87
|
+
"husky": "8.0.3",
|
|
88
88
|
"lint-staged": "13.0.3",
|
|
89
89
|
"loader.js": "4.7.0",
|
|
90
90
|
"npm-run-all": "4.1.5",
|
|
91
91
|
"prettier": "2.7.1",
|
|
92
|
-
"qunit": "2.19.
|
|
92
|
+
"qunit": "2.19.3",
|
|
93
93
|
"qunit-dom": "2.0.0",
|
|
94
94
|
"webpack": "5.74.0"
|
|
95
95
|
},
|
|
96
96
|
"engines": {
|
|
97
|
-
"node": "14.* || >=
|
|
97
|
+
"node": "14.* || 16.* || >= 18"
|
|
98
98
|
},
|
|
99
99
|
"ember": {
|
|
100
100
|
"edition": "octane"
|