ember-validated-form 7.0.0 → 8.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/.husky/commit-msg +2 -7
- package/.husky/pre-commit +1 -7
- package/CHANGELOG.md +36 -0
- package/README.md +1 -1
- package/addon/-private/features.js +7 -0
- package/addon/components/validated-button/button.hbs +5 -5
- package/addon/components/validated-button.hbs +19 -19
- package/addon/components/validated-button.js +5 -10
- package/addon/components/validated-form.js +11 -14
- package/addon/components/validated-input/error.hbs +2 -5
- package/addon/components/validated-input/hint.hbs +3 -5
- package/addon/components/validated-input/label.hbs +1 -1
- package/addon/components/validated-input/render/wrapper.hbs +1 -1
- package/addon/components/validated-input/render.hbs +149 -124
- package/addon/components/validated-input/types/checkbox-group.hbs +2 -2
- package/addon/components/validated-input/types/checkbox.hbs +2 -2
- package/addon/components/validated-input/types/date.hbs +16 -0
- package/addon/components/validated-input/types/input.hbs +5 -5
- package/addon/components/validated-input/types/radio-group.hbs +2 -2
- package/addon/components/validated-input/types/select.hbs +6 -6
- package/addon/components/validated-input/types/textarea.hbs +5 -5
- package/addon/components/validated-input.hbs +88 -76
- package/addon/components/validated-input.js +0 -7
- package/addon/helpers/evf-theme.js +14 -0
- package/app/components/validated-input/types/date.js +1 -0
- package/app/helpers/evf-class-list.js +1 -0
- package/app/helpers/evf-theme.js +1 -0
- package/config/addon-docs.js +9 -0
- package/index.js +9 -61
- package/package.json +86 -62
- package/addon/components/validated-input/render.js +0 -13
- package/addon/passed-or-default.js +0 -16
- package/app/helpers/class-list.js +0 -1
- /package/addon/helpers/{class-list.js → evf-class-list.js} +0 -0
package/.husky/commit-msg
CHANGED
package/.husky/pre-commit
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
# [8.0.0](https://github.com/adfinis/ember-validated-form/compare/v7.0.1...v8.0.0) (2026-04-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **config:** remove usage of importSync for global component overrides ([895790c](https://github.com/adfinis/ember-validated-form/commit/895790c27141a9c14569a4f263827d532edf9452)), closes [#1215](https://github.com/adfinis/ember-validated-form/issues/1215) [#1190](https://github.com/adfinis/ember-validated-form/issues/1190) [#915](https://github.com/adfinis/ember-validated-form/issues/915)
|
|
7
|
+
* **deps:** convert template relevant addons to peer dependencies ([09e7f5b](https://github.com/adfinis/ember-validated-form/commit/09e7f5bb8a9e42ffda3c56b33aeff85d023c8f4e))
|
|
8
|
+
* **deps:** update dependencies ([18c6f02](https://github.com/adfinis/ember-validated-form/commit/18c6f023d569498e2977fa32fc44f8da6d588b4a))
|
|
9
|
+
* **validated-input/types/select:** typo in inputId ([b6e347b](https://github.com/adfinis/ember-validated-form/commit/b6e347bd51883b5705f614c160f8c062cc2263df))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### chore
|
|
13
|
+
|
|
14
|
+
* **ember:** drop support for Ember < 5.12 LTS ([c6a1bed](https://github.com/adfinis/ember-validated-form/commit/c6a1bed4b3c9a23a880b22fe498f61773f6d0278)), closes [#1211](https://github.com/adfinis/ember-validated-form/issues/1211)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **form:** pass event to submit action ([076bddf](https://github.com/adfinis/ember-validated-form/commit/076bddfc6079b800b69950771f327fcf719531d7)), closes [#661](https://github.com/adfinis/ember-validated-form/issues/661)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* **config:** This changes the the way that global overrides for
|
|
25
|
+
`ember-validated-form` components are configured. For instructions on
|
|
26
|
+
how to migrate, check the [migration to v8 guide](https://docs.adfinis.com/ember-validated-form/docs/migration-v8).
|
|
27
|
+
* **ember:** This addon now only supports Ember.js versions from
|
|
28
|
+
5.12 upwards.
|
|
29
|
+
|
|
30
|
+
## [7.0.1](https://github.com/adfinis/ember-validated-form/compare/v7.0.0...v7.0.1) (2024-03-18)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **deps:** update dependencies ([c2d187b](https://github.com/adfinis/ember-validated-form/commit/c2d187bbbf8652f0bc30637a9b5b5f5c46e44296))
|
|
36
|
+
|
|
1
37
|
# [7.0.0](https://github.com/adfinis/ember-validated-form/compare/v6.2.0...v7.0.0) (2023-11-21)
|
|
2
38
|
|
|
3
39
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/ember-validated-form)
|
|
4
4
|
[](https://emberobserver.com/addons/ember-validated-form)
|
|
5
|
-
[](https://github.com/adfinis/ember-validated-form/actions/workflows/ci.yml)
|
|
6
6
|
[](https://github.com/prettier/prettier)
|
|
7
7
|
|
|
8
8
|
Easily create forms with client side validations.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<button
|
|
2
|
-
class={{class-list
|
|
2
|
+
class={{evf-class-list
|
|
3
3
|
(if
|
|
4
|
-
(
|
|
5
|
-
(class-list
|
|
4
|
+
(evf-theme "uikit")
|
|
5
|
+
(evf-class-list
|
|
6
6
|
"uk-button"
|
|
7
7
|
(if (eq @type "submit") "uk-button-primary" "uk-button-default")
|
|
8
8
|
)
|
|
9
9
|
)
|
|
10
10
|
(if
|
|
11
|
-
(
|
|
12
|
-
(class-list
|
|
11
|
+
(evf-theme "bootstrap")
|
|
12
|
+
(evf-class-list
|
|
13
13
|
"btn"
|
|
14
14
|
(if (eq @type "submit") "btn-primary" "btn-default")
|
|
15
15
|
(if @loading "loading")
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
{{#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...attributes
|
|
18
|
-
|
|
19
|
-
{{/
|
|
1
|
+
{{#let
|
|
2
|
+
(component
|
|
3
|
+
(ensure-safe-component
|
|
4
|
+
(or @buttonComponent (component "validated-button/button"))
|
|
5
|
+
)
|
|
6
|
+
onClick=this.click
|
|
7
|
+
loading=this.loading
|
|
8
|
+
disabled=(or @disabled this.loading)
|
|
9
|
+
label=@label
|
|
10
|
+
type=@type
|
|
11
|
+
)
|
|
12
|
+
as |ButtonComponent|
|
|
13
|
+
}}
|
|
14
|
+
{{#if (has-block)}}
|
|
15
|
+
<ButtonComponent ...attributes>{{yield}}</ButtonComponent>
|
|
16
|
+
{{else}}
|
|
17
|
+
<ButtonComponent ...attributes />
|
|
18
|
+
{{/if}}
|
|
19
|
+
{{/let}}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { action } from "@ember/object";
|
|
2
|
-
import { macroCondition, getOwnConfig } from "@embroider/macros";
|
|
3
2
|
import Component from "@glimmer/component";
|
|
4
3
|
import { tracked } from "@glimmer/tracking";
|
|
5
4
|
import { resolve } from "rsvp";
|
|
6
5
|
|
|
7
|
-
import
|
|
6
|
+
import { scrollErrorIntoViewEnabled } from "ember-validated-form/-private/features";
|
|
8
7
|
|
|
9
8
|
const ON_CLICK = "on-click";
|
|
10
9
|
const ON_INVALID_CLICK = "on-invalid-click";
|
|
11
10
|
export default class ValidatedButtonComponent extends Component {
|
|
12
11
|
@tracked _loading;
|
|
13
12
|
|
|
14
|
-
@passedOrDefault("button") buttonComponent;
|
|
15
|
-
|
|
16
13
|
get loading() {
|
|
17
14
|
return this.args.loading || this._loading;
|
|
18
15
|
}
|
|
@@ -40,12 +37,10 @@ export default class ValidatedButtonComponent extends Component {
|
|
|
40
37
|
|
|
41
38
|
await model.validate();
|
|
42
39
|
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
?.scrollIntoView({ behavior: "smooth" });
|
|
48
|
-
}
|
|
40
|
+
if (scrollErrorIntoViewEnabled(this) && model.errors[0]?.key) {
|
|
41
|
+
document
|
|
42
|
+
.querySelector(`[name=${model.errors[0].key.replaceAll(".", "\\.")}]`)
|
|
43
|
+
?.scrollIntoView({ behavior: "smooth" });
|
|
49
44
|
}
|
|
50
45
|
|
|
51
46
|
if (model.get("isInvalid")) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { action } from "@ember/object";
|
|
2
2
|
import { scheduleOnce } from "@ember/runloop";
|
|
3
|
-
import { macroCondition, getOwnConfig } from "@embroider/macros";
|
|
4
3
|
import Component from "@glimmer/component";
|
|
5
4
|
import { tracked } from "@glimmer/tracking";
|
|
6
5
|
import { resolve } from "rsvp";
|
|
7
6
|
|
|
7
|
+
import { scrollErrorIntoViewEnabled } from "ember-validated-form/-private/features";
|
|
8
|
+
|
|
8
9
|
const PROP_ON_SUBMIT = "on-submit";
|
|
9
10
|
const PROP_ON_INVALID_SUBMIT = "on-invalid-submit";
|
|
10
11
|
|
|
@@ -38,38 +39,34 @@ export default class ValidatedFormComponent extends Component {
|
|
|
38
39
|
const model = this.args.model;
|
|
39
40
|
|
|
40
41
|
if (!model || !model.validate) {
|
|
41
|
-
this.runCallback(PROP_ON_SUBMIT);
|
|
42
|
+
this.runCallback(PROP_ON_SUBMIT, event);
|
|
42
43
|
return false;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
await model.validate();
|
|
46
47
|
|
|
47
48
|
if (model.get("isInvalid")) {
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
`[name=${model.errors[0].key.replaceAll(".", "\\.")}]`
|
|
53
|
-
)
|
|
54
|
-
?.scrollIntoView({ behavior: "smooth" });
|
|
55
|
-
}
|
|
49
|
+
if (scrollErrorIntoViewEnabled(this) && model.errors[0]?.key) {
|
|
50
|
+
document
|
|
51
|
+
.querySelector(`[name=${model.errors[0].key.replaceAll(".", "\\.")}]`)
|
|
52
|
+
?.scrollIntoView({ behavior: "smooth" });
|
|
56
53
|
}
|
|
57
|
-
this.runCallback(PROP_ON_INVALID_SUBMIT);
|
|
54
|
+
this.runCallback(PROP_ON_INVALID_SUBMIT, event);
|
|
58
55
|
} else {
|
|
59
|
-
this.runCallback(PROP_ON_SUBMIT);
|
|
56
|
+
this.runCallback(PROP_ON_SUBMIT, event);
|
|
60
57
|
}
|
|
61
58
|
|
|
62
59
|
return false;
|
|
63
60
|
}
|
|
64
61
|
|
|
65
|
-
runCallback(callbackProp) {
|
|
62
|
+
runCallback(callbackProp, event) {
|
|
66
63
|
const callback = this.args[callbackProp];
|
|
67
64
|
if (typeof callback !== "function") {
|
|
68
65
|
return;
|
|
69
66
|
}
|
|
70
67
|
|
|
71
68
|
this.loading = true;
|
|
72
|
-
resolve(callback(this.args.model)).finally(() => {
|
|
69
|
+
resolve(callback(this.args.model, event)).finally(() => {
|
|
73
70
|
this.loading = false;
|
|
74
71
|
});
|
|
75
72
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
{{#if (
|
|
1
|
+
{{#if (evf-theme "uikit")}}
|
|
2
2
|
<small id={{@id}} class="uk-text-danger" ...attributes>
|
|
3
3
|
{{yield}}{{this.errorString}}
|
|
4
4
|
</small>
|
|
5
5
|
{{else}}
|
|
6
6
|
<span
|
|
7
7
|
id={{@id}}
|
|
8
|
-
class={{if
|
|
9
|
-
(macroCondition (macroGetOwnConfig "isBootstrap"))
|
|
10
|
-
"d-block invalid-feedback"
|
|
11
|
-
}}
|
|
8
|
+
class={{if (evf-theme "bootstrap") "d-block invalid-feedback"}}
|
|
12
9
|
...attributes
|
|
13
10
|
>
|
|
14
11
|
{{yield}}{{this.errorString}}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<small
|
|
2
2
|
id={{@id}}
|
|
3
|
-
class={{class-list
|
|
4
|
-
(if (
|
|
5
|
-
(if
|
|
6
|
-
(macroCondition (macroGetOwnConfig "isBootstrap")) "form-text text-muted"
|
|
7
|
-
)
|
|
3
|
+
class={{evf-class-list
|
|
4
|
+
(if (evf-theme "uikit") "uk-text-muted")
|
|
5
|
+
(if (evf-theme "bootstrap") "form-text text-muted")
|
|
8
6
|
}}
|
|
9
7
|
...attributes
|
|
10
8
|
>{{yield}}{{@hint}}</small>
|
|
@@ -1,127 +1,152 @@
|
|
|
1
|
-
{{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{{else if (or (eq @type "radioGroup") (eq @type "radio-group"))}}
|
|
33
|
-
<this.radioGroupComponent
|
|
34
|
-
@disabled={{@disabled}}
|
|
35
|
-
@inputId={{@inputId}}
|
|
36
|
-
@isInvalid={{@isInvalid}}
|
|
37
|
-
@isValid={{@isValid}}
|
|
38
|
-
@name={{or @inputName @name}}
|
|
39
|
-
@options={{@options}}
|
|
40
|
-
@setDirty={{@setDirty}}
|
|
41
|
-
@update={{@update}}
|
|
42
|
-
@value={{@value}}
|
|
43
|
-
...attributes
|
|
44
|
-
/>
|
|
45
|
-
{{else if (or (eq @type "checkboxGroup") (eq @type "checkbox-group"))}}
|
|
46
|
-
<this.checkboxGroupComponent
|
|
47
|
-
@disabled={{@disabled}}
|
|
48
|
-
@inputId={{@inputId}}
|
|
49
|
-
@isInvalid={{@isInvalid}}
|
|
50
|
-
@isValid={{@isValid}}
|
|
51
|
-
@name={{or @inputName @name}}
|
|
52
|
-
@options={{@options}}
|
|
53
|
-
@setDirty={{@setDirty}}
|
|
54
|
-
@update={{@update}}
|
|
55
|
-
@value={{@value}}
|
|
56
|
-
...attributes
|
|
57
|
-
/>
|
|
58
|
-
{{else if (eq @type "checkbox")}}
|
|
59
|
-
<this.checkboxComponent
|
|
60
|
-
@disabled={{@disabled}}
|
|
61
|
-
@inputId={{@inputId}}
|
|
62
|
-
@isInvalid={{@isInvalid}}
|
|
63
|
-
@isValid={{@isValid}}
|
|
64
|
-
@labelComponent={{@labelComponent}}
|
|
65
|
-
@name={{or @inputName @name}}
|
|
66
|
-
@options={{@options}}
|
|
67
|
-
@setDirty={{@setDirty}}
|
|
68
|
-
@update={{@update}}
|
|
69
|
-
@value={{@value}}
|
|
70
|
-
...attributes
|
|
71
|
-
/>
|
|
72
|
-
{{else if (eq @type "textarea")}}
|
|
73
|
-
<this.textareaComponent
|
|
74
|
-
autocomplete={{@autocomplete}}
|
|
75
|
-
autofocus={{@autofocus}}
|
|
76
|
-
cols={{@cols}}
|
|
77
|
-
disabled={{@disabled}}
|
|
78
|
-
id={{@inputId}}
|
|
79
|
-
name={{or @inputName @name}}
|
|
80
|
-
placeholder={{@placeholder}}
|
|
81
|
-
rows={{@rows}}
|
|
82
|
-
value={{@value}}
|
|
83
|
-
@isInvalid={{@isInvalid}}
|
|
84
|
-
@isValid={{@isValid}}
|
|
85
|
-
@setDirty={{@setDirty}}
|
|
86
|
-
@update={{@update}}
|
|
87
|
-
...attributes
|
|
88
|
-
/>
|
|
89
|
-
{{else if
|
|
90
|
-
(and (eq @type "date") (not-eq this.dateComponent this.inputComponent))
|
|
1
|
+
{{#let
|
|
2
|
+
(ensure-safe-component
|
|
3
|
+
(or @selectComponent (component "validated-input/types/select"))
|
|
4
|
+
)
|
|
5
|
+
(ensure-safe-component
|
|
6
|
+
(or @radioGroupComponent (component "validated-input/types/radio-group"))
|
|
7
|
+
)
|
|
8
|
+
(ensure-safe-component
|
|
9
|
+
(or
|
|
10
|
+
@checkboxGroupComponent (component "validated-input/types/checkbox-group")
|
|
11
|
+
)
|
|
12
|
+
)
|
|
13
|
+
(ensure-safe-component
|
|
14
|
+
(or @checkboxComponent (component "validated-input/types/checkbox"))
|
|
15
|
+
)
|
|
16
|
+
(ensure-safe-component
|
|
17
|
+
(or @textareaComponent (component "validated-input/types/textarea"))
|
|
18
|
+
)
|
|
19
|
+
(ensure-safe-component
|
|
20
|
+
(or @dateComponent (component "validated-input/types/date"))
|
|
21
|
+
)
|
|
22
|
+
(ensure-safe-component
|
|
23
|
+
(or @inputComponent (component "validated-input/types/input"))
|
|
24
|
+
)
|
|
25
|
+
as |SelectComponent RadioGroupComponent CheckboxGroupComponent CheckboxComponent TextareaComponent DateComponent InputComponent|
|
|
26
|
+
}}
|
|
27
|
+
{{! template-lint-disable no-autofocus-attribute }}
|
|
28
|
+
<div
|
|
29
|
+
class={{evf-class-list
|
|
30
|
+
(if (evf-theme "uikit") "uk-margin")
|
|
31
|
+
(if (evf-theme "bootstrap") "form-group")
|
|
91
32
|
}}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
@disabled={{@disabled}}
|
|
96
|
-
@id={{@inputId}}
|
|
97
|
-
@name={{or @inputName @name}}
|
|
98
|
-
@placeholder={{@placeholder}}
|
|
99
|
-
@value={{@value}}
|
|
100
|
-
@isInvalid={{@isInvalid}}
|
|
101
|
-
@isValid={{@isValid}}
|
|
102
|
-
@setDirty={{@setDirty}}
|
|
103
|
-
@update={{@update}}
|
|
104
|
-
...attributes
|
|
105
|
-
/>
|
|
106
|
-
{{else}}
|
|
107
|
-
<this.inputComponent
|
|
108
|
-
autocomplete={{@autocomplete}}
|
|
109
|
-
autofocus={{@autofocus}}
|
|
110
|
-
disabled={{@disabled}}
|
|
111
|
-
id={{@inputId}}
|
|
112
|
-
name={{or @inputName @name}}
|
|
113
|
-
placeholder={{@placeholder}}
|
|
114
|
-
type={{@type}}
|
|
115
|
-
value={{@value}}
|
|
116
|
-
@isInvalid={{@isInvalid}}
|
|
117
|
-
@isValid={{@isValid}}
|
|
118
|
-
@setDirty={{@setDirty}}
|
|
119
|
-
@update={{@update}}
|
|
120
|
-
...attributes
|
|
121
|
-
/>
|
|
33
|
+
>
|
|
34
|
+
{{#if (not-eq @type "checkbox")}}
|
|
35
|
+
<@labelComponent />
|
|
122
36
|
{{/if}}
|
|
123
|
-
</ValidatedInput::Render::Wrapper>
|
|
124
37
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
38
|
+
<ValidatedInput::Render::Wrapper>
|
|
39
|
+
{{#if (eq @type "select")}}
|
|
40
|
+
<SelectComponent
|
|
41
|
+
@disabled={{@disabled}}
|
|
42
|
+
@inputId={{@inputId}}
|
|
43
|
+
@isInvalid={{@isInvalid}}
|
|
44
|
+
@isValid={{@isValid}}
|
|
45
|
+
@multiple={{@multiple}}
|
|
46
|
+
@name={{or @inputName @name}}
|
|
47
|
+
@optionLabelPath={{@optionLabelPath}}
|
|
48
|
+
@options={{@options}}
|
|
49
|
+
@optionTargetPath={{@optionTargetPath}}
|
|
50
|
+
@optionValuePath={{@optionValuePath}}
|
|
51
|
+
@prompt={{@prompt}}
|
|
52
|
+
@promptIsSelectable={{@promptIsSelectable}}
|
|
53
|
+
@setDirty={{@setDirty}}
|
|
54
|
+
@update={{@update}}
|
|
55
|
+
@value={{@value}}
|
|
56
|
+
...attributes
|
|
57
|
+
/>
|
|
58
|
+
{{else if (or (eq @type "radioGroup") (eq @type "radio-group"))}}
|
|
59
|
+
<RadioGroupComponent
|
|
60
|
+
@disabled={{@disabled}}
|
|
61
|
+
@inputId={{@inputId}}
|
|
62
|
+
@isInvalid={{@isInvalid}}
|
|
63
|
+
@isValid={{@isValid}}
|
|
64
|
+
@name={{or @inputName @name}}
|
|
65
|
+
@options={{@options}}
|
|
66
|
+
@setDirty={{@setDirty}}
|
|
67
|
+
@update={{@update}}
|
|
68
|
+
@value={{@value}}
|
|
69
|
+
...attributes
|
|
70
|
+
/>
|
|
71
|
+
{{else if (or (eq @type "checkboxGroup") (eq @type "checkbox-group"))}}
|
|
72
|
+
<CheckboxGroupComponent
|
|
73
|
+
@disabled={{@disabled}}
|
|
74
|
+
@inputId={{@inputId}}
|
|
75
|
+
@isInvalid={{@isInvalid}}
|
|
76
|
+
@isValid={{@isValid}}
|
|
77
|
+
@name={{or @inputName @name}}
|
|
78
|
+
@options={{@options}}
|
|
79
|
+
@setDirty={{@setDirty}}
|
|
80
|
+
@update={{@update}}
|
|
81
|
+
@value={{@value}}
|
|
82
|
+
...attributes
|
|
83
|
+
/>
|
|
84
|
+
{{else if (eq @type "checkbox")}}
|
|
85
|
+
<CheckboxComponent
|
|
86
|
+
@disabled={{@disabled}}
|
|
87
|
+
@inputId={{@inputId}}
|
|
88
|
+
@isInvalid={{@isInvalid}}
|
|
89
|
+
@isValid={{@isValid}}
|
|
90
|
+
@labelComponent={{@labelComponent}}
|
|
91
|
+
@name={{or @inputName @name}}
|
|
92
|
+
@options={{@options}}
|
|
93
|
+
@setDirty={{@setDirty}}
|
|
94
|
+
@update={{@update}}
|
|
95
|
+
@value={{@value}}
|
|
96
|
+
...attributes
|
|
97
|
+
/>
|
|
98
|
+
{{else if (eq @type "textarea")}}
|
|
99
|
+
<TextareaComponent
|
|
100
|
+
autocomplete={{@autocomplete}}
|
|
101
|
+
autofocus={{@autofocus}}
|
|
102
|
+
cols={{@cols}}
|
|
103
|
+
disabled={{@disabled}}
|
|
104
|
+
id={{@inputId}}
|
|
105
|
+
name={{or @inputName @name}}
|
|
106
|
+
placeholder={{@placeholder}}
|
|
107
|
+
rows={{@rows}}
|
|
108
|
+
value={{@value}}
|
|
109
|
+
@isInvalid={{@isInvalid}}
|
|
110
|
+
@isValid={{@isValid}}
|
|
111
|
+
@setDirty={{@setDirty}}
|
|
112
|
+
@update={{@update}}
|
|
113
|
+
...attributes
|
|
114
|
+
/>
|
|
115
|
+
{{else if (eq @type "date")}}
|
|
116
|
+
<DateComponent
|
|
117
|
+
@autocomplete={{@autocomplete}}
|
|
118
|
+
@autofocus={{@autofocus}}
|
|
119
|
+
@disabled={{@disabled}}
|
|
120
|
+
@id={{@inputId}}
|
|
121
|
+
@name={{or @inputName @name}}
|
|
122
|
+
@placeholder={{@placeholder}}
|
|
123
|
+
@value={{@value}}
|
|
124
|
+
@isInvalid={{@isInvalid}}
|
|
125
|
+
@isValid={{@isValid}}
|
|
126
|
+
@setDirty={{@setDirty}}
|
|
127
|
+
@update={{@update}}
|
|
128
|
+
...attributes
|
|
129
|
+
/>
|
|
130
|
+
{{else}}
|
|
131
|
+
<InputComponent
|
|
132
|
+
autocomplete={{@autocomplete}}
|
|
133
|
+
autofocus={{@autofocus}}
|
|
134
|
+
disabled={{@disabled}}
|
|
135
|
+
id={{@inputId}}
|
|
136
|
+
name={{or @inputName @name}}
|
|
137
|
+
placeholder={{@placeholder}}
|
|
138
|
+
type={{@type}}
|
|
139
|
+
value={{@value}}
|
|
140
|
+
@isInvalid={{@isInvalid}}
|
|
141
|
+
@isValid={{@isValid}}
|
|
142
|
+
@setDirty={{@setDirty}}
|
|
143
|
+
@update={{@update}}
|
|
144
|
+
...attributes
|
|
145
|
+
/>
|
|
146
|
+
{{/if}}
|
|
147
|
+
</ValidatedInput::Render::Wrapper>
|
|
148
|
+
|
|
149
|
+
<@hintComponent />
|
|
150
|
+
<@errorComponent />
|
|
151
|
+
</div>
|
|
152
|
+
{{/let}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{{#each @options as |option i|}}
|
|
2
|
-
{{#if (
|
|
2
|
+
{{#if (evf-theme "uikit")}}
|
|
3
3
|
{{#if (not-eq i 0)}}<br />{{/if}}
|
|
4
4
|
<label
|
|
5
5
|
class="uk-form-label
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
/>
|
|
19
19
|
{{option.label}}
|
|
20
20
|
</label>
|
|
21
|
-
{{else if (
|
|
21
|
+
{{else if (evf-theme "bootstrap")}}
|
|
22
22
|
<div class="custom-control custom-checkbox">
|
|
23
23
|
<input
|
|
24
24
|
type="checkbox"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#if (
|
|
1
|
+
{{#if (evf-theme "uikit")}}
|
|
2
2
|
<@labelComponent
|
|
3
3
|
class="{{if @isValid 'uk-text-success'}} {{if @isInvalid 'uk-text-danger'}}"
|
|
4
4
|
>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
...attributes
|
|
14
14
|
/>
|
|
15
15
|
</@labelComponent>
|
|
16
|
-
{{else if (
|
|
16
|
+
{{else if (evf-theme "bootstrap")}}
|
|
17
17
|
<div class="custom-control custom-checkbox">
|
|
18
18
|
<input
|
|
19
19
|
class="custom-control-input
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{{! template-lint-disable no-autofocus-attribute }}
|
|
2
|
+
<ValidatedInput::Types::Input
|
|
3
|
+
autocomplete={{@autocomplete}}
|
|
4
|
+
autofocus={{@autofocus}}
|
|
5
|
+
disabled={{@disabled}}
|
|
6
|
+
id={{@id}}
|
|
7
|
+
name={{@name}}
|
|
8
|
+
placeholder={{@placeholder}}
|
|
9
|
+
type="date"
|
|
10
|
+
value={{@value}}
|
|
11
|
+
@isInvalid={{@isInvalid}}
|
|
12
|
+
@isValid={{@isValid}}
|
|
13
|
+
@setDirty={{@setDirty}}
|
|
14
|
+
@update={{@update}}
|
|
15
|
+
...attributes
|
|
16
|
+
/>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<input
|
|
2
|
-
class={{class-list
|
|
2
|
+
class={{evf-class-list
|
|
3
3
|
(if
|
|
4
|
-
(
|
|
5
|
-
(class-list
|
|
4
|
+
(evf-theme "uikit")
|
|
5
|
+
(evf-class-list
|
|
6
6
|
"uk-input"
|
|
7
7
|
(if @isValid "uk-form-success")
|
|
8
8
|
(if @isInvalid "uk-form-danger")
|
|
9
9
|
)
|
|
10
10
|
)
|
|
11
11
|
(if
|
|
12
|
-
(
|
|
13
|
-
(class-list
|
|
12
|
+
(evf-theme "bootstrap")
|
|
13
|
+
(evf-class-list
|
|
14
14
|
"form-control" (if @isValid "is-valid") (if @isInvalid "is-invalid")
|
|
15
15
|
)
|
|
16
16
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{{#each @options as |option i|}}
|
|
2
|
-
{{#if (
|
|
2
|
+
{{#if (evf-theme "uikit")}}
|
|
3
3
|
{{#if (not-eq i 0)}}<br />{{/if}}
|
|
4
4
|
<label
|
|
5
5
|
class="uk-form-label
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/>
|
|
20
20
|
{{option.label}}
|
|
21
21
|
</label>
|
|
22
|
-
{{else if (
|
|
22
|
+
{{else if (evf-theme "bootstrap")}}
|
|
23
23
|
<div class="custom-control custom-radio">
|
|
24
24
|
<input
|
|
25
25
|
type="radio"
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<select
|
|
2
|
-
class={{class-list
|
|
2
|
+
class={{evf-class-list
|
|
3
3
|
(if
|
|
4
|
-
(
|
|
5
|
-
(class-list
|
|
4
|
+
(evf-theme "uikit")
|
|
5
|
+
(evf-class-list
|
|
6
6
|
"uk-select"
|
|
7
7
|
(if @isValid "uk-form-success")
|
|
8
8
|
(if @isInvalid "uk-form-danger")
|
|
9
9
|
)
|
|
10
10
|
)
|
|
11
11
|
(if
|
|
12
|
-
(
|
|
13
|
-
(class-list
|
|
12
|
+
(evf-theme "bootstrap")
|
|
13
|
+
(evf-class-list
|
|
14
14
|
"form-control" (if @isValid "is-valid") (if @isInvalid "is-invalid")
|
|
15
15
|
)
|
|
16
16
|
)
|
|
17
17
|
}}
|
|
18
18
|
name={{@name}}
|
|
19
|
-
id={{@
|
|
19
|
+
id={{@inputId}}
|
|
20
20
|
disabled={{@disabled}}
|
|
21
21
|
multiple={{@multiple}}
|
|
22
22
|
{{on "change" this.onUpdate}}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<textarea
|
|
2
|
-
class={{class-list
|
|
2
|
+
class={{evf-class-list
|
|
3
3
|
(if
|
|
4
|
-
(
|
|
5
|
-
(class-list
|
|
4
|
+
(evf-theme "uikit")
|
|
5
|
+
(evf-class-list
|
|
6
6
|
"uk-textarea"
|
|
7
7
|
(if @isValid "uk-form-success")
|
|
8
8
|
(if @isInvalid "uk-form-danger")
|
|
9
9
|
)
|
|
10
10
|
)
|
|
11
11
|
(if
|
|
12
|
-
(
|
|
13
|
-
(class-list
|
|
12
|
+
(evf-theme "bootstrap")
|
|
13
|
+
(evf-class-list
|
|
14
14
|
"form-control" (if @isValid "is-valid") (if @isInvalid "is-invalid")
|
|
15
15
|
)
|
|
16
16
|
)
|
|
@@ -1,83 +1,95 @@
|
|
|
1
|
-
{{#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@isValid={{this.isValid}}
|
|
6
|
-
@isInvalid={{this.isInvalid}}
|
|
7
|
-
@inputId={{this.inputId}}
|
|
8
|
-
/>
|
|
9
|
-
|
|
10
|
-
{{yield
|
|
11
|
-
(hash
|
|
12
|
-
value=this._val
|
|
13
|
-
update=this.update
|
|
14
|
-
setDirty=this.setDirty
|
|
15
|
-
model=@model
|
|
16
|
-
name=@name
|
|
17
|
-
inputId=this.inputId
|
|
18
|
-
isValid=this.isValid
|
|
19
|
-
isInvalid=this.isInvalid
|
|
1
|
+
{{#let
|
|
2
|
+
(component
|
|
3
|
+
(ensure-safe-component
|
|
4
|
+
(or @labelComponent (component "validated-input/label"))
|
|
20
5
|
)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
label=@label
|
|
7
|
+
required=this.required
|
|
8
|
+
isValid=this.isValid
|
|
9
|
+
isInvalid=this.isInvalid
|
|
10
|
+
inputId=this.inputId
|
|
11
|
+
)
|
|
12
|
+
(component
|
|
13
|
+
(ensure-safe-component
|
|
14
|
+
(or @errorComponent (component "validated-input/error"))
|
|
15
|
+
)
|
|
16
|
+
errors=this.errors
|
|
17
|
+
id=this.errorId
|
|
18
|
+
)
|
|
19
|
+
(component
|
|
20
|
+
(ensure-safe-component
|
|
21
|
+
(or @hintComponent (component "validated-input/hint"))
|
|
22
|
+
)
|
|
23
|
+
hint=@hint
|
|
24
|
+
id=this.hintId
|
|
25
|
+
)
|
|
26
|
+
as |LabelComponent ErrorComponent HintComponent|
|
|
27
|
+
}}
|
|
28
|
+
{{#if (has-block)}}
|
|
29
|
+
<LabelComponent />
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
@inputName={{@inputName}}
|
|
38
|
-
@disabled={{@disabled}}
|
|
39
|
-
@autofocus={{@autofocus}}
|
|
40
|
-
@autocomplete={{@autocomplete}}
|
|
41
|
-
@rows={{@rows}}
|
|
42
|
-
@cols={{@cols}}
|
|
43
|
-
@model={{@model}}
|
|
44
|
-
@isValid={{this.isValid}}
|
|
45
|
-
@isInvalid={{this.isInvalid}}
|
|
46
|
-
@placeholder={{@placeholder}}
|
|
47
|
-
@class={{@class}}
|
|
48
|
-
@prompt={{@prompt}}
|
|
49
|
-
@promptIsSelectable={{@promptIsSelectable}}
|
|
50
|
-
@optionLabelPath={{@optionLabelPath}}
|
|
51
|
-
@optionValuePath={{@optionValuePath}}
|
|
52
|
-
@optionTargetPath={{@optionTargetPath}}
|
|
53
|
-
@multiple={{@multiple}}
|
|
54
|
-
@update={{this.update}}
|
|
55
|
-
@setDirty={{this.setDirty}}
|
|
56
|
-
@submitted={{@submitted}}
|
|
57
|
-
@labelComponent={{component
|
|
58
|
-
(ensure-safe-component this.labelComponent)
|
|
59
|
-
label=@label
|
|
60
|
-
required=@required
|
|
61
|
-
isValid=this.isValid
|
|
62
|
-
isInvalid=this.isInvalid
|
|
63
|
-
inputId=this.inputId
|
|
64
|
-
}}
|
|
65
|
-
@hintComponent={{if
|
|
66
|
-
@hint
|
|
67
|
-
(component
|
|
68
|
-
(ensure-safe-component this.hintComponent) hint=@hint id=this.hintId
|
|
31
|
+
{{yield
|
|
32
|
+
(hash
|
|
33
|
+
value=this._val
|
|
34
|
+
update=this.update
|
|
35
|
+
setDirty=this.setDirty
|
|
36
|
+
model=@model
|
|
37
|
+
name=@name
|
|
38
|
+
inputId=this.inputId
|
|
39
|
+
isValid=this.isValid
|
|
40
|
+
isInvalid=this.isInvalid
|
|
69
41
|
)
|
|
70
42
|
}}
|
|
71
|
-
|
|
72
|
-
|
|
43
|
+
|
|
44
|
+
{{#if @hint}}
|
|
45
|
+
<HintComponent />
|
|
46
|
+
{{/if}}
|
|
47
|
+
|
|
48
|
+
{{#if (and this.showValidity this.errors)}}
|
|
49
|
+
<ErrorComponent />
|
|
50
|
+
{{/if}}
|
|
51
|
+
{{else}}
|
|
52
|
+
{{#let
|
|
73
53
|
(component
|
|
74
|
-
(ensure-safe-component
|
|
75
|
-
|
|
76
|
-
|
|
54
|
+
(ensure-safe-component
|
|
55
|
+
(or @renderComponent (component "validated-input/render"))
|
|
56
|
+
)
|
|
57
|
+
type=this.type
|
|
58
|
+
value=this._val
|
|
59
|
+
inputId=this.inputId
|
|
60
|
+
options=@options
|
|
61
|
+
name=@name
|
|
62
|
+
inputName=@inputName
|
|
63
|
+
disabled=@disabled
|
|
64
|
+
autofocus=@autofocus
|
|
65
|
+
autocomplete=@autocomplete
|
|
66
|
+
rows=@rows
|
|
67
|
+
cols=@cols
|
|
68
|
+
model=@model
|
|
69
|
+
isValid=this.isValid
|
|
70
|
+
isInvalid=this.isInvalid
|
|
71
|
+
placeholder=@placeholder
|
|
72
|
+
class=@class
|
|
73
|
+
prompt=@prompt
|
|
74
|
+
promptIsSelectable=@promptIsSelectable
|
|
75
|
+
optionLabelPath=@optionLabelPath
|
|
76
|
+
optionValuePath=@optionValuePath
|
|
77
|
+
optionTargetPath=@optionTargetPath
|
|
78
|
+
multiple=@multiple
|
|
79
|
+
update=this.update
|
|
80
|
+
setDirty=this.setDirty
|
|
81
|
+
submitted=@submitted
|
|
82
|
+
labelComponent=LabelComponent
|
|
83
|
+
hintComponent=(if @hint HintComponent)
|
|
84
|
+
errorComponent=(if (and this.showValidity this.errors) ErrorComponent)
|
|
77
85
|
)
|
|
86
|
+
as |RenderComponent|
|
|
78
87
|
}}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
<RenderComponent
|
|
89
|
+
aria-invalid={{if this.isInvalid "true"}}
|
|
90
|
+
aria-describedby={{if this.isInvalid this.errorId this.hintId}}
|
|
91
|
+
...attributes
|
|
92
|
+
/>
|
|
93
|
+
{{/let}}
|
|
94
|
+
{{/if}}
|
|
95
|
+
{{/let}}
|
|
@@ -4,8 +4,6 @@ import { isEmpty } from "@ember/utils";
|
|
|
4
4
|
import Component from "@glimmer/component";
|
|
5
5
|
import { tracked } from "@glimmer/tracking";
|
|
6
6
|
|
|
7
|
-
import passedOrDefault from "ember-validated-form/passed-or-default";
|
|
8
|
-
|
|
9
7
|
/**
|
|
10
8
|
* This component wraps form inputs.
|
|
11
9
|
*
|
|
@@ -35,11 +33,6 @@ export default class ValidatedInputComponent extends Component {
|
|
|
35
33
|
@tracked type;
|
|
36
34
|
@tracked validateBeforeSubmit;
|
|
37
35
|
|
|
38
|
-
@passedOrDefault("error") errorComponent;
|
|
39
|
-
@passedOrDefault("hint") hintComponent;
|
|
40
|
-
@passedOrDefault("label") labelComponent;
|
|
41
|
-
@passedOrDefault("render") renderComponent;
|
|
42
|
-
|
|
43
36
|
constructor(...args) {
|
|
44
37
|
super(...args);
|
|
45
38
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getOwner } from "@ember/application";
|
|
2
|
+
import Helper from "@ember/component/helper";
|
|
3
|
+
|
|
4
|
+
export default class EVFThemeHelper extends Helper {
|
|
5
|
+
get currentTheme() {
|
|
6
|
+
return getOwner(this).resolveRegistration("config:environment")[
|
|
7
|
+
"ember-validated-form"
|
|
8
|
+
].theme;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
compute([expectedTheme]) {
|
|
12
|
+
return this.currentTheme === expectedTheme;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "ember-validated-form/components/validated-input/types/date";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "ember-validated-form/helpers/evf-class-list";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "ember-validated-form/helpers/evf-theme";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const AddonDocsConfig = require("ember-cli-addon-docs/lib/config");
|
|
5
|
+
|
|
6
|
+
module.exports = class extends AddonDocsConfig {
|
|
7
|
+
// See https://ember-learn.github.io/ember-cli-addon-docs/latest/docs/deploying
|
|
8
|
+
// for details on configuration you can override here.
|
|
9
|
+
};
|
package/index.js
CHANGED
|
@@ -3,69 +3,17 @@
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
name: require("./package").name,
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
this._super.included.apply(this, ...args);
|
|
8
|
-
|
|
6
|
+
config() {
|
|
9
7
|
const app = this._findHost(this);
|
|
10
8
|
|
|
11
|
-
const {
|
|
12
|
-
theme = null,
|
|
13
|
-
scrollErrorIntoView = false,
|
|
14
|
-
defaults = {},
|
|
15
|
-
} = app.options["ember-validated-form"] ?? {};
|
|
16
|
-
|
|
17
|
-
// Theming options
|
|
18
|
-
this.options["@embroider/macros"].setOwnConfig.isDefault = ![
|
|
19
|
-
"uikit",
|
|
20
|
-
"bootstrap",
|
|
21
|
-
].includes(theme);
|
|
22
|
-
this.options["@embroider/macros"].setOwnConfig.isUikit = theme === "uikit";
|
|
23
|
-
this.options["@embroider/macros"].setOwnConfig.isBootstrap =
|
|
24
|
-
theme === "bootstrap";
|
|
25
|
-
|
|
26
|
-
// Features
|
|
27
|
-
this.options["@embroider/macros"].setOwnConfig.scrollErrorIntoView =
|
|
28
|
-
scrollErrorIntoView;
|
|
29
|
-
|
|
30
|
-
// Component defaults
|
|
31
|
-
this.options["@embroider/macros"].setOwnConfig.error =
|
|
32
|
-
defaults.error ?? "ember-validated-form/components/validated-input/error";
|
|
33
|
-
this.options["@embroider/macros"].setOwnConfig.hint =
|
|
34
|
-
defaults.hint ?? "ember-validated-form/components/validated-input/hint";
|
|
35
|
-
this.options["@embroider/macros"].setOwnConfig.label =
|
|
36
|
-
defaults.label ?? "ember-validated-form/components/validated-input/label";
|
|
37
|
-
this.options["@embroider/macros"].setOwnConfig.render =
|
|
38
|
-
defaults.render ??
|
|
39
|
-
"ember-validated-form/components/validated-input/render";
|
|
40
|
-
this.options["@embroider/macros"].setOwnConfig.button =
|
|
41
|
-
defaults.button ??
|
|
42
|
-
"ember-validated-form/components/validated-button/button";
|
|
43
|
-
this.options["@embroider/macros"].setOwnConfig["types/checkbox-group"] =
|
|
44
|
-
defaults["types/checkbox-group"] ??
|
|
45
|
-
"ember-validated-form/components/validated-input/types/checkbox-group";
|
|
46
|
-
this.options["@embroider/macros"].setOwnConfig["types/checkbox"] =
|
|
47
|
-
defaults["types/checkbox"] ??
|
|
48
|
-
"ember-validated-form/components/validated-input/types/checkbox";
|
|
49
|
-
this.options["@embroider/macros"].setOwnConfig["types/input"] =
|
|
50
|
-
defaults["types/input"] ??
|
|
51
|
-
"ember-validated-form/components/validated-input/types/input";
|
|
52
|
-
this.options["@embroider/macros"].setOwnConfig["types/radio-group"] =
|
|
53
|
-
defaults["types/radio-group"] ??
|
|
54
|
-
"ember-validated-form/components/validated-input/types/radio-group";
|
|
55
|
-
this.options["@embroider/macros"].setOwnConfig["types/select"] =
|
|
56
|
-
defaults["types/select"] ??
|
|
57
|
-
"ember-validated-form/components/validated-input/types/select";
|
|
58
|
-
this.options["@embroider/macros"].setOwnConfig["types/textarea"] =
|
|
59
|
-
defaults["types/textarea"] ??
|
|
60
|
-
"ember-validated-form/components/validated-input/types/textarea";
|
|
61
|
-
this.options["@embroider/macros"].setOwnConfig["types/date"] =
|
|
62
|
-
defaults["types/date"] ??
|
|
63
|
-
"ember-validated-form/components/validated-input/types/input";
|
|
64
|
-
},
|
|
9
|
+
const appConfig = app.options["ember-validated-form"] ?? {};
|
|
65
10
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
11
|
+
return {
|
|
12
|
+
"ember-validated-form": {
|
|
13
|
+
theme: "default",
|
|
14
|
+
scrollErrorIntoView: false,
|
|
15
|
+
...appConfig,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
70
18
|
},
|
|
71
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-validated-form",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Easily create forms with client-side validations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -14,103 +14,127 @@
|
|
|
14
14
|
"directories": {
|
|
15
15
|
"test": "tests"
|
|
16
16
|
},
|
|
17
|
-
"homepage": "https://adfinis.
|
|
17
|
+
"homepage": "https://docs.adfinis.com/ember-validated-form",
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/adfinis/ember-validated-form/issues"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "ember build --environment=production",
|
|
23
|
-
"
|
|
23
|
+
"format": "prettier . --cache --write",
|
|
24
|
+
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
|
|
24
25
|
"lint:css": "stylelint \"**/*.css\"",
|
|
25
|
-
"lint:css:fix": "concurrently \"
|
|
26
|
-
"lint:fix": "concurrently \"
|
|
26
|
+
"lint:css:fix": "concurrently \"pnpm:lint:css -- --fix\"",
|
|
27
|
+
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm format",
|
|
28
|
+
"lint:format": "prettier . --cache --check",
|
|
27
29
|
"lint:hbs": "ember-template-lint .",
|
|
28
30
|
"lint:hbs:fix": "ember-template-lint . --fix",
|
|
29
31
|
"lint:js": "eslint . --cache",
|
|
30
32
|
"lint:js:fix": "eslint . --fix",
|
|
31
33
|
"start": "ember serve",
|
|
32
|
-
"test": "concurrently \"
|
|
34
|
+
"test": "concurrently \"pnpm:lint\" \"pnpm:test:*\" --names \"lint,test:\" --prefixColors auto",
|
|
33
35
|
"test:ember": "ember test",
|
|
34
36
|
"test:ember-compatibility": "ember try:each",
|
|
35
|
-
"prepare": "husky
|
|
37
|
+
"prepare": "husky"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"ember-
|
|
43
|
-
"ember-changeset-validations": "^4.1.1",
|
|
44
|
-
"ember-cli-babel": "^7.26.11",
|
|
45
|
-
"ember-cli-htmlbars": "^6.2.0",
|
|
46
|
-
"ember-truth-helpers": "^3.1.1"
|
|
40
|
+
"@babel/core": "^7.24.6",
|
|
41
|
+
"ember-auto-import": "^2.11.0",
|
|
42
|
+
"ember-cli-babel": "^8.2.0",
|
|
43
|
+
"ember-cli-htmlbars": "^6.3.0 || ^7.0.0",
|
|
44
|
+
"ember-template-imports": "^4.3.0"
|
|
47
45
|
},
|
|
48
46
|
"devDependencies": {
|
|
49
|
-
"@adfinis/eslint-config": "
|
|
50
|
-
"@adfinis/semantic-release-config": "
|
|
51
|
-
"@babel/eslint-parser": "7.
|
|
52
|
-
"@babel/plugin-proposal-decorators": "7.
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@ember/
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
47
|
+
"@adfinis/eslint-config": "3.0.2",
|
|
48
|
+
"@adfinis/semantic-release-config": "6.0.0",
|
|
49
|
+
"@babel/eslint-parser": "7.28.6",
|
|
50
|
+
"@babel/plugin-proposal-decorators": "7.28.6",
|
|
51
|
+
"@commitlint/cli": "20.3.1",
|
|
52
|
+
"@commitlint/config-conventional": "20.3.1",
|
|
53
|
+
"@ember/optional-features": "2.3.0",
|
|
54
|
+
"@ember/string": "4.0.1",
|
|
55
|
+
"@ember/test-helpers": "5.4.1",
|
|
56
|
+
"@embroider/macros": "1.19.6",
|
|
57
|
+
"@embroider/test-setup": "4.0.0",
|
|
58
|
+
"@eslint/js": "9.39.2",
|
|
59
|
+
"@fortawesome/ember-fontawesome": "3.1.0",
|
|
60
|
+
"@fortawesome/fontawesome-svg-core": "7.1.0",
|
|
61
|
+
"@fortawesome/free-solid-svg-icons": "7.1.0",
|
|
62
|
+
"@glimmer/component": "1.1.2",
|
|
63
|
+
"@glimmer/tracking": "1.1.2",
|
|
59
64
|
"broccoli-asset-rev": "3.0.0",
|
|
60
|
-
"concurrently": "
|
|
61
|
-
"ember-
|
|
62
|
-
"ember-
|
|
63
|
-
"ember-cli
|
|
64
|
-
"ember-cli-
|
|
65
|
+
"concurrently": "9.2.1",
|
|
66
|
+
"ember-changeset": "5.0.0",
|
|
67
|
+
"ember-changeset-validations": "5.0.0",
|
|
68
|
+
"ember-cli": "6.10.0",
|
|
69
|
+
"ember-cli-addon-docs": "10.1.0",
|
|
70
|
+
"ember-cli-clean-css": "3.0.0",
|
|
71
|
+
"ember-cli-dependency-checker": "3.3.3",
|
|
65
72
|
"ember-cli-deploy": "2.0.0",
|
|
66
|
-
"ember-cli-deploy-build": "
|
|
73
|
+
"ember-cli-deploy-build": "3.0.0",
|
|
67
74
|
"ember-cli-deploy-git": "1.3.4",
|
|
68
75
|
"ember-cli-deploy-git-ci": "1.0.1",
|
|
76
|
+
"ember-cli-deprecation-workflow": "4.0.0",
|
|
69
77
|
"ember-cli-inject-live-reload": "2.1.0",
|
|
70
78
|
"ember-cli-sri": "2.1.1",
|
|
71
79
|
"ember-cli-terser": "4.0.2",
|
|
72
|
-
"ember-cli-test-loader": "3.
|
|
73
|
-
"ember-concurrency": "
|
|
74
|
-
"ember-data": "
|
|
75
|
-
"ember-flatpickr": "
|
|
76
|
-
"ember-load-initializers": "
|
|
77
|
-
"ember-qunit": "
|
|
78
|
-
"ember-resolver": "
|
|
79
|
-
"ember-source": "
|
|
80
|
+
"ember-cli-test-loader": "3.1.0",
|
|
81
|
+
"ember-concurrency": "5.1.0",
|
|
82
|
+
"ember-data": "5.8.1",
|
|
83
|
+
"ember-flatpickr": "9.0.2",
|
|
84
|
+
"ember-load-initializers": "3.0.1",
|
|
85
|
+
"ember-qunit": "9.0.4",
|
|
86
|
+
"ember-resolver": "13.1.1",
|
|
87
|
+
"ember-source": "6.10.0",
|
|
80
88
|
"ember-source-channel-url": "3.0.0",
|
|
81
|
-
"ember-template-lint": "
|
|
82
|
-
"ember-
|
|
83
|
-
"ember-try": "
|
|
84
|
-
"eslint": "
|
|
85
|
-
"eslint-config-prettier": "
|
|
86
|
-
"eslint-plugin-ember": "
|
|
87
|
-
"eslint-plugin-import": "2.
|
|
88
|
-
"eslint-plugin-n": "
|
|
89
|
-
"eslint-plugin-prettier": "
|
|
90
|
-
"eslint-plugin-qunit": "
|
|
91
|
-
"
|
|
92
|
-
"
|
|
89
|
+
"ember-template-lint": "7.9.3",
|
|
90
|
+
"ember-truth-helpers": "5.0.0",
|
|
91
|
+
"ember-try": "4.0.0",
|
|
92
|
+
"eslint": "9.39.2",
|
|
93
|
+
"eslint-config-prettier": "10.1.8",
|
|
94
|
+
"eslint-plugin-ember": "12.7.5",
|
|
95
|
+
"eslint-plugin-import": "2.32.0",
|
|
96
|
+
"eslint-plugin-n": "17.23.2",
|
|
97
|
+
"eslint-plugin-prettier": "5.5.5",
|
|
98
|
+
"eslint-plugin-qunit": "8.2.5",
|
|
99
|
+
"flatpickr": "4.6.13",
|
|
100
|
+
"globals": "17.1.0",
|
|
101
|
+
"husky": "9.1.7",
|
|
102
|
+
"lint-staged": "16.2.7",
|
|
93
103
|
"loader.js": "4.7.0",
|
|
94
|
-
"prettier": "
|
|
95
|
-
"
|
|
96
|
-
"qunit
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"stylelint
|
|
100
|
-
"
|
|
104
|
+
"prettier": "3.8.1",
|
|
105
|
+
"prettier-plugin-ember-template-tag": "2.1.2",
|
|
106
|
+
"qunit": "2.25.0",
|
|
107
|
+
"qunit-dom": "3.5.0",
|
|
108
|
+
"semantic-release": "25.0.3",
|
|
109
|
+
"stylelint": "17.0.0",
|
|
110
|
+
"stylelint-config-standard": "40.0.0",
|
|
111
|
+
"stylelint-prettier": "5.0.3",
|
|
112
|
+
"webpack": "5.104.1"
|
|
101
113
|
},
|
|
102
114
|
"peerDependencies": {
|
|
103
|
-
"
|
|
115
|
+
"@embroider/util": "^1.13.0",
|
|
116
|
+
"ember-changeset": "^4.1.2 || ^5.0.0",
|
|
117
|
+
"ember-changeset-validations": "^4.1.1 || ^5.0.0",
|
|
118
|
+
"ember-source": ">= 4.0.0",
|
|
119
|
+
"ember-truth-helpers": "^3.1.0 || ^4.0.0 || ^5.0.0"
|
|
120
|
+
},
|
|
121
|
+
"packageManager": "pnpm@10.28.1",
|
|
122
|
+
"pnpm": {
|
|
123
|
+
"peerDependencyRules": {
|
|
124
|
+
"allowedVersions": {
|
|
125
|
+
"ember-source": "^5.0.0"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
104
128
|
},
|
|
105
129
|
"engines": {
|
|
106
|
-
"node": "
|
|
130
|
+
"node": ">= 20.19"
|
|
107
131
|
},
|
|
108
132
|
"ember": {
|
|
109
133
|
"edition": "octane"
|
|
110
134
|
},
|
|
111
135
|
"ember-addon": {
|
|
112
136
|
"configPath": "tests/dummy/config",
|
|
113
|
-
"demoURL": "https://adfinis.
|
|
137
|
+
"demoURL": "https://docs.adfinis.com/ember-validated-form"
|
|
114
138
|
},
|
|
115
139
|
"release": {
|
|
116
140
|
"extends": "@adfinis/semantic-release-config"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Component from "@glimmer/component";
|
|
2
|
-
|
|
3
|
-
import passedOrDefault from "ember-validated-form/passed-or-default";
|
|
4
|
-
|
|
5
|
-
export default class RenderComponent extends Component {
|
|
6
|
-
@passedOrDefault("types/checkbox-group") checkboxGroupComponent;
|
|
7
|
-
@passedOrDefault("types/checkbox") checkboxComponent;
|
|
8
|
-
@passedOrDefault("types/input") inputComponent;
|
|
9
|
-
@passedOrDefault("types/radio-group") radioGroupComponent;
|
|
10
|
-
@passedOrDefault("types/select") selectComponent;
|
|
11
|
-
@passedOrDefault("types/textarea") textareaComponent;
|
|
12
|
-
@passedOrDefault("types/date") dateComponent;
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { importSync, getOwnConfig } from "@embroider/macros";
|
|
2
|
-
import { ensureSafeComponent } from "@embroider/util";
|
|
3
|
-
|
|
4
|
-
export default function passedOrDefault(componentName) {
|
|
5
|
-
return function (target, property) {
|
|
6
|
-
return {
|
|
7
|
-
get() {
|
|
8
|
-
return ensureSafeComponent(
|
|
9
|
-
this.args[property] ??
|
|
10
|
-
importSync(getOwnConfig()[componentName]).default,
|
|
11
|
-
this
|
|
12
|
-
);
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "ember-validated-form/helpers/class-list";
|
|
File without changes
|