ember-validated-form 5.3.1 → 6.0.2
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 +152 -135
- package/README.md +3 -3
- package/addon/components/validated-button/button.hbs +17 -1
- package/addon/components/validated-button.hbs +19 -17
- package/addon/components/validated-button.js +9 -15
- package/addon/components/validated-form.js +7 -9
- package/addon/components/validated-input/error.hbs +15 -1
- package/addon/components/validated-input/hint.hbs +9 -1
- package/addon/components/validated-input/label.hbs +5 -1
- package/addon/components/validated-input/render/wrapper.hbs +5 -0
- package/addon/components/validated-input/render.hbs +21 -27
- package/addon/components/validated-input/render.js +7 -8
- package/addon/components/validated-input/types/checkbox-group.hbs +51 -13
- package/addon/components/validated-input/types/checkbox.hbs +41 -10
- package/addon/components/validated-input/types/input.hbs +16 -1
- package/addon/components/validated-input/types/input.js +0 -1
- package/addon/components/validated-input/types/radio-group.hbs +53 -13
- package/addon/components/validated-input/types/select.hbs +18 -3
- package/addon/components/validated-input/types/select.js +8 -28
- package/addon/components/validated-input/types/textarea.hbs +16 -1
- package/addon/components/validated-input.hbs +52 -54
- package/addon/components/validated-input.js +5 -5
- package/addon/helpers/class-list.js +9 -0
- package/addon/passed-or-default.js +16 -0
- package/app/components/validated-input/{-themes/uikit/hint.js → render/wrapper.js} +1 -1
- package/app/helpers/class-list.js +1 -0
- package/index.js +63 -0
- package/package.json +25 -23
- package/addon/-private/themed-component.js +0 -38
- package/addon/components/validated-button/-themes/bootstrap/button.js +0 -10
- package/addon/components/validated-button/-themes/uikit/button.js +0 -10
- package/addon/components/validated-button/button.js +0 -4
- package/addon/components/validated-input/-themes/bootstrap/error.js +0 -5
- package/addon/components/validated-input/-themes/bootstrap/hint.js +0 -5
- package/addon/components/validated-input/-themes/bootstrap/label.js +0 -3
- package/addon/components/validated-input/-themes/bootstrap/render.js +0 -5
- package/addon/components/validated-input/-themes/uikit/error.hbs +0 -4
- package/addon/components/validated-input/-themes/uikit/error.js +0 -3
- package/addon/components/validated-input/-themes/uikit/hint.js +0 -5
- package/addon/components/validated-input/-themes/uikit/label.js +0 -5
- package/addon/components/validated-input/-themes/uikit/render.hbs +0 -118
- package/addon/components/validated-input/-themes/uikit/render.js +0 -5
- package/addon/components/validated-input/hint.js +0 -4
- package/addon/components/validated-input/label.js +0 -4
- package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.hbs +0 -19
- package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.js +0 -3
- package/addon/components/validated-input/types/-themes/bootstrap/checkbox.hbs +0 -14
- package/addon/components/validated-input/types/-themes/bootstrap/checkbox.js +0 -3
- package/addon/components/validated-input/types/-themes/bootstrap/input.js +0 -13
- package/addon/components/validated-input/types/-themes/bootstrap/radio-group.hbs +0 -20
- package/addon/components/validated-input/types/-themes/bootstrap/radio-group.js +0 -3
- package/addon/components/validated-input/types/-themes/bootstrap/select.js +0 -13
- package/addon/components/validated-input/types/-themes/bootstrap/textarea.js +0 -13
- package/addon/components/validated-input/types/-themes/uikit/checkbox-group.hbs +0 -19
- package/addon/components/validated-input/types/-themes/uikit/checkbox-group.js +0 -3
- package/addon/components/validated-input/types/-themes/uikit/checkbox.hbs +0 -15
- package/addon/components/validated-input/types/-themes/uikit/checkbox.js +0 -3
- package/addon/components/validated-input/types/-themes/uikit/input.js +0 -13
- package/addon/components/validated-input/types/-themes/uikit/radio-group.hbs +0 -20
- package/addon/components/validated-input/types/-themes/uikit/radio-group.js +0 -3
- package/addon/components/validated-input/types/-themes/uikit/select.js +0 -13
- package/addon/components/validated-input/types/-themes/uikit/textarea.js +0 -13
- package/app/components/validated-button/-themes/bootstrap/button.js +0 -1
- package/app/components/validated-button/-themes/uikit/button.js +0 -1
- package/app/components/validated-input/-themes/bootstrap/error.js +0 -1
- package/app/components/validated-input/-themes/bootstrap/hint.js +0 -1
- package/app/components/validated-input/-themes/bootstrap/label.js +0 -1
- package/app/components/validated-input/-themes/bootstrap/render.js +0 -1
- package/app/components/validated-input/-themes/uikit/error.js +0 -1
- package/app/components/validated-input/-themes/uikit/label.js +0 -1
- package/app/components/validated-input/-themes/uikit/render.js +0 -1
- package/app/components/validated-input/types/-themes/bootstrap/checkbox-group.js +0 -1
- package/app/components/validated-input/types/-themes/bootstrap/checkbox.js +0 -1
- package/app/components/validated-input/types/-themes/bootstrap/input.js +0 -1
- package/app/components/validated-input/types/-themes/bootstrap/radio-group.js +0 -1
- package/app/components/validated-input/types/-themes/bootstrap/select.js +0 -1
- package/app/components/validated-input/types/-themes/bootstrap/textarea.js +0 -1
- package/app/components/validated-input/types/-themes/uikit/checkbox-group.js +0 -1
- package/app/components/validated-input/types/-themes/uikit/checkbox.js +0 -1
- package/app/components/validated-input/types/-themes/uikit/input.js +0 -1
- package/app/components/validated-input/types/-themes/uikit/radio-group.js +0 -1
- package/app/components/validated-input/types/-themes/uikit/select.js +0 -1
- package/app/components/validated-input/types/-themes/uikit/textarea.js +0 -1
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{{#if (has-block)}}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/>
|
|
10
|
-
{{/let}}
|
|
2
|
+
<this.labelComponent
|
|
3
|
+
@label={{@label}}
|
|
4
|
+
@required={{this.required}}
|
|
5
|
+
@isValid={{this.isValid}}
|
|
6
|
+
@isInvalid={{this.isInvalid}}
|
|
7
|
+
@inputId={{this.inputId}}
|
|
8
|
+
/>
|
|
11
9
|
|
|
12
10
|
{{yield
|
|
13
11
|
(hash
|
|
@@ -23,54 +21,54 @@
|
|
|
23
21
|
}}
|
|
24
22
|
|
|
25
23
|
{{#if @hint}}
|
|
26
|
-
|
|
24
|
+
<this.hintComponent @hint={{@hint}} />
|
|
27
25
|
{{/if}}
|
|
28
26
|
|
|
29
27
|
{{#if (and this.showValidity this.errors)}}
|
|
30
|
-
|
|
28
|
+
<this.errorComponent @errors={{this.errors}} />
|
|
31
29
|
{{/if}}
|
|
32
30
|
{{else}}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
31
|
+
<this.renderComponent
|
|
32
|
+
@type={{this.type}}
|
|
33
|
+
@value={{this._val}}
|
|
34
|
+
@inputId={{this.inputId}}
|
|
35
|
+
@options={{@options}}
|
|
36
|
+
@name={{@name}}
|
|
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
|
+
@labelComponent={{component
|
|
57
|
+
(ensure-safe-component this.labelComponent)
|
|
58
|
+
label=@label
|
|
59
|
+
required=@required
|
|
60
|
+
isValid=this.isValid
|
|
61
|
+
isInvalid=this.isInvalid
|
|
62
|
+
inputId=this.inputId
|
|
63
|
+
}}
|
|
64
|
+
@hintComponent={{if
|
|
65
|
+
@hint
|
|
66
|
+
(component (ensure-safe-component this.hintComponent) hint=@hint)
|
|
67
|
+
}}
|
|
68
|
+
@errorComponent={{if
|
|
69
|
+
(and this.showValidity this.errors)
|
|
70
|
+
(component (ensure-safe-component this.errorComponent) errors=this.errors)
|
|
71
|
+
}}
|
|
72
|
+
...attributes
|
|
73
|
+
/>
|
|
76
74
|
{{/if}}
|
|
@@ -3,7 +3,7 @@ import { guidFor } from "@ember/object/internals";
|
|
|
3
3
|
import Component from "@glimmer/component";
|
|
4
4
|
import { tracked } from "@glimmer/tracking";
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import passedOrDefault from "ember-validated-form/passed-or-default";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* This component wraps form inputs.
|
|
@@ -26,10 +26,10 @@ export default class ValidatedInputComponent extends Component {
|
|
|
26
26
|
@tracked type;
|
|
27
27
|
@tracked validateBeforeSubmit;
|
|
28
28
|
|
|
29
|
-
@
|
|
30
|
-
@
|
|
31
|
-
@
|
|
32
|
-
@
|
|
29
|
+
@passedOrDefault("error") errorComponent;
|
|
30
|
+
@passedOrDefault("hint") hintComponent;
|
|
31
|
+
@passedOrDefault("label") labelComponent;
|
|
32
|
+
@passedOrDefault("render") renderComponent;
|
|
33
33
|
|
|
34
34
|
constructor(...args) {
|
|
35
35
|
super(...args);
|
|
@@ -0,0 +1,16 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
export { default } from "ember-validated-form/components/validated-input
|
|
1
|
+
export { default } from "ember-validated-form/components/validated-input/render/wrapper";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "ember-validated-form/helpers/class-list";
|
package/index.js
CHANGED
|
@@ -2,4 +2,67 @@
|
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
name: require("./package").name,
|
|
5
|
+
|
|
6
|
+
included(...args) {
|
|
7
|
+
this._super.included.apply(this, ...args);
|
|
8
|
+
|
|
9
|
+
const app = this._findHost(this);
|
|
10
|
+
|
|
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
|
+
},
|
|
62
|
+
|
|
63
|
+
options: {
|
|
64
|
+
"@embroider/macros": {
|
|
65
|
+
setOwnConfig: {},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
5
68
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-validated-form",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "Easily create forms with client-side validations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
"form validation",
|
|
9
9
|
"validation messages"
|
|
10
10
|
],
|
|
11
|
-
"repository": "https://github.com/adfinis
|
|
11
|
+
"repository": "https://github.com/adfinis/ember-validated-form",
|
|
12
12
|
"license": "MIT",
|
|
13
|
-
"author": "Adfinis
|
|
13
|
+
"author": "Adfinis AG <info@adfinis.com>",
|
|
14
14
|
"directories": {
|
|
15
15
|
"test": "tests"
|
|
16
16
|
},
|
|
17
|
-
"homepage": "https://
|
|
17
|
+
"homepage": "https://adfinis.github.io/ember-validated-form",
|
|
18
18
|
"bugs": {
|
|
19
|
-
"url": "https://github.com/adfinis
|
|
19
|
+
"url": "https://github.com/adfinis/ember-validated-form/issues"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "ember build --environment=production",
|
|
@@ -33,27 +33,29 @@
|
|
|
33
33
|
"prepare": "husky install"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
+
"@embroider/macros": "^1.8.3",
|
|
37
|
+
"@embroider/util": "^1.8.3",
|
|
36
38
|
"@glimmer/component": "^1.1.2",
|
|
37
39
|
"@glimmer/tracking": "^1.1.2",
|
|
38
|
-
"ember-
|
|
39
|
-
"ember-changeset": "^4.1.0",
|
|
40
|
+
"ember-changeset": "^4.1.1",
|
|
40
41
|
"ember-changeset-validations": "^4.1.0",
|
|
41
42
|
"ember-cli-babel": "^7.26.11",
|
|
42
|
-
"ember-cli-htmlbars": "^6.0
|
|
43
|
-
"ember-truth-helpers": "^3.
|
|
43
|
+
"ember-cli-htmlbars": "^6.1.0",
|
|
44
|
+
"ember-truth-helpers": "^3.1.1"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@adfinis-sygroup/eslint-config": "1.5.0",
|
|
47
48
|
"@adfinis-sygroup/semantic-release-config": "3.4.0",
|
|
48
49
|
"@ember/optional-features": "2.0.0",
|
|
49
50
|
"@ember/test-helpers": "2.8.1",
|
|
50
|
-
"@embroider/test-setup": "1.
|
|
51
|
-
"@fortawesome/ember-fontawesome": "0.4.
|
|
52
|
-
"@fortawesome/free-solid-svg-icons": "6.
|
|
51
|
+
"@embroider/test-setup": "1.8.3",
|
|
52
|
+
"@fortawesome/ember-fontawesome": "0.4.1",
|
|
53
|
+
"@fortawesome/free-solid-svg-icons": "6.2.0",
|
|
53
54
|
"babel-eslint": "10.1.0",
|
|
54
55
|
"broccoli-asset-rev": "3.0.0",
|
|
55
|
-
"ember-
|
|
56
|
-
"ember-cli
|
|
56
|
+
"ember-auto-import": "2.4.2",
|
|
57
|
+
"ember-cli": "4.7.0",
|
|
58
|
+
"ember-cli-addon-docs": "5.0.0",
|
|
57
59
|
"ember-cli-dependency-checker": "3.3.1",
|
|
58
60
|
"ember-cli-deploy": "1.0.2",
|
|
59
61
|
"ember-cli-deploy-build": "2.0.0",
|
|
@@ -63,24 +65,24 @@
|
|
|
63
65
|
"ember-cli-sri": "2.1.1",
|
|
64
66
|
"ember-cli-terser": "4.0.2",
|
|
65
67
|
"ember-cli-test-loader": "3.0.0",
|
|
66
|
-
"ember-concurrency": "2.
|
|
67
|
-
"ember-data": "4.4.
|
|
68
|
+
"ember-concurrency": "2.3.6",
|
|
69
|
+
"ember-data": "4.4.1",
|
|
68
70
|
"ember-disable-prototype-extensions": "1.1.3",
|
|
69
71
|
"ember-load-initializers": "2.1.2",
|
|
70
72
|
"ember-qunit": "5.1.5",
|
|
71
73
|
"ember-resolver": "8.0.3",
|
|
72
|
-
"ember-source": "4.
|
|
74
|
+
"ember-source": "4.7.0",
|
|
73
75
|
"ember-source-channel-url": "3.0.0",
|
|
74
|
-
"ember-template-lint": "4.
|
|
76
|
+
"ember-template-lint": "4.14.0",
|
|
75
77
|
"ember-template-lint-plugin-prettier": "4.0.0",
|
|
76
78
|
"ember-try": "2.0.0",
|
|
77
79
|
"eslint": "7.32.0",
|
|
78
80
|
"eslint-config-prettier": "8.5.0",
|
|
79
|
-
"eslint-plugin-ember": "
|
|
81
|
+
"eslint-plugin-ember": "11.0.6",
|
|
80
82
|
"eslint-plugin-import": "2.26.0",
|
|
81
83
|
"eslint-plugin-node": "11.1.0",
|
|
82
|
-
"eslint-plugin-prettier": "4.
|
|
83
|
-
"eslint-plugin-qunit": "7.
|
|
84
|
+
"eslint-plugin-prettier": "4.2.1",
|
|
85
|
+
"eslint-plugin-qunit": "7.3.1",
|
|
84
86
|
"husky": "8.0.1",
|
|
85
87
|
"lint-staged": "13.0.3",
|
|
86
88
|
"loader.js": "4.7.0",
|
|
@@ -91,14 +93,14 @@
|
|
|
91
93
|
"webpack": "5.74.0"
|
|
92
94
|
},
|
|
93
95
|
"engines": {
|
|
94
|
-
"node": "
|
|
96
|
+
"node": "14.* || >= 16"
|
|
95
97
|
},
|
|
96
98
|
"ember": {
|
|
97
99
|
"edition": "octane"
|
|
98
100
|
},
|
|
99
101
|
"ember-addon": {
|
|
100
102
|
"configPath": "tests/dummy/config",
|
|
101
|
-
"demoURL": "https://
|
|
103
|
+
"demoURL": "https://adfinis.github.io/ember-validated-form"
|
|
102
104
|
},
|
|
103
105
|
"release": {
|
|
104
106
|
"extends": "@adfinis-sygroup/semantic-release-config"
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { getOwner } from "@ember/application";
|
|
2
|
-
|
|
3
|
-
export default function (component) {
|
|
4
|
-
return function (_, propertyName) {
|
|
5
|
-
return {
|
|
6
|
-
get() {
|
|
7
|
-
const parts = component.split("/");
|
|
8
|
-
const componentName = parts.slice(1, parts.length).join("/");
|
|
9
|
-
|
|
10
|
-
if (this.args[propertyName]) {
|
|
11
|
-
return this.args[propertyName];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const config =
|
|
15
|
-
getOwner(this).resolveRegistration("config:environment")[
|
|
16
|
-
"ember-validated-form"
|
|
17
|
-
] !== undefined
|
|
18
|
-
? getOwner(this).resolveRegistration("config:environment")[
|
|
19
|
-
"ember-validated-form"
|
|
20
|
-
]
|
|
21
|
-
: {};
|
|
22
|
-
|
|
23
|
-
const theme = config.theme;
|
|
24
|
-
const defaultComponent = config.defaults?.[componentName];
|
|
25
|
-
|
|
26
|
-
const name = parts.pop();
|
|
27
|
-
const basePath = parts.join("/");
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
defaultComponent ||
|
|
31
|
-
(theme
|
|
32
|
-
? `${basePath}/-themes/${theme}/${name}`
|
|
33
|
-
: `${basePath}/${name}`)
|
|
34
|
-
);
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import Component from "../../button";
|
|
2
|
-
|
|
3
|
-
export default class BootstrapButton extends Component {
|
|
4
|
-
get class() {
|
|
5
|
-
const style = this.args.type === "submit" ? "btn-primary" : "btn-default";
|
|
6
|
-
const loading = this.args.loading ? "loading" : "";
|
|
7
|
-
|
|
8
|
-
return `btn ${style} ${loading}`;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
{{! template-lint-disable no-autofocus-attribute }}
|
|
2
|
-
<div class={{this.class}}>
|
|
3
|
-
{{#if (not-eq @type "checkbox")}}
|
|
4
|
-
<@labelComponent />
|
|
5
|
-
{{/if}}
|
|
6
|
-
|
|
7
|
-
<div class="uk-form-controls">
|
|
8
|
-
{{#if (eq @type "select")}}
|
|
9
|
-
{{#let (component this.selectComponent) as |Select|}}
|
|
10
|
-
<Select
|
|
11
|
-
@disabled={{@disabled}}
|
|
12
|
-
@includeBlank={{@includeBlank}}
|
|
13
|
-
@inputId={{@inputId}}
|
|
14
|
-
@isInvalid={{@isInvalid}}
|
|
15
|
-
@isValid={{@isValid}}
|
|
16
|
-
@multiple={{@multiple}}
|
|
17
|
-
@name={{or @inputName @name}}
|
|
18
|
-
@optionLabelPath={{@optionLabelPath}}
|
|
19
|
-
@options={{@options}}
|
|
20
|
-
@optionTargetPath={{@optionTargetPath}}
|
|
21
|
-
@optionValuePath={{@optionValuePath}}
|
|
22
|
-
@prompt={{@prompt}}
|
|
23
|
-
@promptIsSelectable={{@promptIsSelectable}}
|
|
24
|
-
@setDirty={{@setDirty}}
|
|
25
|
-
@update={{@update}}
|
|
26
|
-
@value={{@value}}
|
|
27
|
-
...attributes
|
|
28
|
-
/>
|
|
29
|
-
{{/let}}
|
|
30
|
-
{{else if (or (eq @type "radioGroup") (eq @type "radio-group"))}}
|
|
31
|
-
{{#let (component this.radioGroupComponent) as |RadioGroup|}}
|
|
32
|
-
<RadioGroup
|
|
33
|
-
@disabled={{@disabled}}
|
|
34
|
-
@inputId={{@inputId}}
|
|
35
|
-
@isInvalid={{@isInvalid}}
|
|
36
|
-
@isValid={{@isValid}}
|
|
37
|
-
@name={{or @inputName @name}}
|
|
38
|
-
@options={{@options}}
|
|
39
|
-
@setDirty={{@setDirty}}
|
|
40
|
-
@update={{@update}}
|
|
41
|
-
@value={{@value}}
|
|
42
|
-
...attributes
|
|
43
|
-
/>
|
|
44
|
-
{{/let}}
|
|
45
|
-
{{else if (or (eq @type "checkboxGroup") (eq @type "checkbox-group"))}}
|
|
46
|
-
{{#let (component this.checkboxGroupComponent) as |CheckboxGroup|}}
|
|
47
|
-
<CheckboxGroup
|
|
48
|
-
@disabled={{@disabled}}
|
|
49
|
-
@inputId={{@inputId}}
|
|
50
|
-
@isInvalid={{@isInvalid}}
|
|
51
|
-
@isValid={{@isValid}}
|
|
52
|
-
@name={{or @inputName @name}}
|
|
53
|
-
@options={{@options}}
|
|
54
|
-
@setDirty={{@setDirty}}
|
|
55
|
-
@update={{@update}}
|
|
56
|
-
@value={{@value}}
|
|
57
|
-
...attributes
|
|
58
|
-
/>
|
|
59
|
-
{{/let}}
|
|
60
|
-
{{else if (eq @type "checkbox")}}
|
|
61
|
-
{{#let (component this.checkboxComponent) as |Checkbox|}}
|
|
62
|
-
<Checkbox
|
|
63
|
-
@disabled={{@disabled}}
|
|
64
|
-
@inputId={{@inputId}}
|
|
65
|
-
@isInvalid={{@isInvalid}}
|
|
66
|
-
@isValid={{@isValid}}
|
|
67
|
-
@labelComponent={{@labelComponent}}
|
|
68
|
-
@name={{or @inputName @name}}
|
|
69
|
-
@options={{@options}}
|
|
70
|
-
@setDirty={{@setDirty}}
|
|
71
|
-
@update={{@update}}
|
|
72
|
-
@value={{@value}}
|
|
73
|
-
...attributes
|
|
74
|
-
/>
|
|
75
|
-
{{/let}}
|
|
76
|
-
{{else if (eq @type "textarea")}}
|
|
77
|
-
{{#let (component this.textareaComponent) as |DynamicTextarea|}}
|
|
78
|
-
<DynamicTextarea
|
|
79
|
-
autocomplete={{@autocomplete}}
|
|
80
|
-
autofocus={{@autofocus}}
|
|
81
|
-
cols={{@cols}}
|
|
82
|
-
disabled={{@disabled}}
|
|
83
|
-
id={{@inputId}}
|
|
84
|
-
name={{or @inputName @name}}
|
|
85
|
-
placeholder={{@placeholder}}
|
|
86
|
-
rows={{@rows}}
|
|
87
|
-
value={{@value}}
|
|
88
|
-
@isInvalid={{@isInvalid}}
|
|
89
|
-
@isValid={{@isValid}}
|
|
90
|
-
@setDirty={{@setDirty}}
|
|
91
|
-
@update={{@update}}
|
|
92
|
-
...attributes
|
|
93
|
-
/>
|
|
94
|
-
{{/let}}
|
|
95
|
-
{{else}}
|
|
96
|
-
{{#let (component this.inputComponent) as |DynamicInput|}}
|
|
97
|
-
<DynamicInput
|
|
98
|
-
autocomplete={{@autocomplete}}
|
|
99
|
-
autofocus={{@autofocus}}
|
|
100
|
-
disabled={{@disabled}}
|
|
101
|
-
id={{@inputId}}
|
|
102
|
-
name={{or @inputName @name}}
|
|
103
|
-
placeholder={{@placeholder}}
|
|
104
|
-
type={{@type}}
|
|
105
|
-
value={{@value}}
|
|
106
|
-
@isInvalid={{@isInvalid}}
|
|
107
|
-
@isValid={{@isValid}}
|
|
108
|
-
@setDirty={{@setDirty}}
|
|
109
|
-
@update={{@update}}
|
|
110
|
-
...attributes
|
|
111
|
-
/>
|
|
112
|
-
{{/let}}
|
|
113
|
-
{{/if}}
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
<@hintComponent />
|
|
117
|
-
<@errorComponent />
|
|
118
|
-
</div>
|
|
@@ -1,19 +0,0 @@
|
|
|
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}}
|