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.
Files changed (83) hide show
  1. package/CHANGELOG.md +152 -135
  2. package/README.md +3 -3
  3. package/addon/components/validated-button/button.hbs +17 -1
  4. package/addon/components/validated-button.hbs +19 -17
  5. package/addon/components/validated-button.js +9 -15
  6. package/addon/components/validated-form.js +7 -9
  7. package/addon/components/validated-input/error.hbs +15 -1
  8. package/addon/components/validated-input/hint.hbs +9 -1
  9. package/addon/components/validated-input/label.hbs +5 -1
  10. package/addon/components/validated-input/render/wrapper.hbs +5 -0
  11. package/addon/components/validated-input/render.hbs +21 -27
  12. package/addon/components/validated-input/render.js +7 -8
  13. package/addon/components/validated-input/types/checkbox-group.hbs +51 -13
  14. package/addon/components/validated-input/types/checkbox.hbs +41 -10
  15. package/addon/components/validated-input/types/input.hbs +16 -1
  16. package/addon/components/validated-input/types/input.js +0 -1
  17. package/addon/components/validated-input/types/radio-group.hbs +53 -13
  18. package/addon/components/validated-input/types/select.hbs +18 -3
  19. package/addon/components/validated-input/types/select.js +8 -28
  20. package/addon/components/validated-input/types/textarea.hbs +16 -1
  21. package/addon/components/validated-input.hbs +52 -54
  22. package/addon/components/validated-input.js +5 -5
  23. package/addon/helpers/class-list.js +9 -0
  24. package/addon/passed-or-default.js +16 -0
  25. package/app/components/validated-input/{-themes/uikit/hint.js → render/wrapper.js} +1 -1
  26. package/app/helpers/class-list.js +1 -0
  27. package/index.js +63 -0
  28. package/package.json +25 -23
  29. package/addon/-private/themed-component.js +0 -38
  30. package/addon/components/validated-button/-themes/bootstrap/button.js +0 -10
  31. package/addon/components/validated-button/-themes/uikit/button.js +0 -10
  32. package/addon/components/validated-button/button.js +0 -4
  33. package/addon/components/validated-input/-themes/bootstrap/error.js +0 -5
  34. package/addon/components/validated-input/-themes/bootstrap/hint.js +0 -5
  35. package/addon/components/validated-input/-themes/bootstrap/label.js +0 -3
  36. package/addon/components/validated-input/-themes/bootstrap/render.js +0 -5
  37. package/addon/components/validated-input/-themes/uikit/error.hbs +0 -4
  38. package/addon/components/validated-input/-themes/uikit/error.js +0 -3
  39. package/addon/components/validated-input/-themes/uikit/hint.js +0 -5
  40. package/addon/components/validated-input/-themes/uikit/label.js +0 -5
  41. package/addon/components/validated-input/-themes/uikit/render.hbs +0 -118
  42. package/addon/components/validated-input/-themes/uikit/render.js +0 -5
  43. package/addon/components/validated-input/hint.js +0 -4
  44. package/addon/components/validated-input/label.js +0 -4
  45. package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.hbs +0 -19
  46. package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.js +0 -3
  47. package/addon/components/validated-input/types/-themes/bootstrap/checkbox.hbs +0 -14
  48. package/addon/components/validated-input/types/-themes/bootstrap/checkbox.js +0 -3
  49. package/addon/components/validated-input/types/-themes/bootstrap/input.js +0 -13
  50. package/addon/components/validated-input/types/-themes/bootstrap/radio-group.hbs +0 -20
  51. package/addon/components/validated-input/types/-themes/bootstrap/radio-group.js +0 -3
  52. package/addon/components/validated-input/types/-themes/bootstrap/select.js +0 -13
  53. package/addon/components/validated-input/types/-themes/bootstrap/textarea.js +0 -13
  54. package/addon/components/validated-input/types/-themes/uikit/checkbox-group.hbs +0 -19
  55. package/addon/components/validated-input/types/-themes/uikit/checkbox-group.js +0 -3
  56. package/addon/components/validated-input/types/-themes/uikit/checkbox.hbs +0 -15
  57. package/addon/components/validated-input/types/-themes/uikit/checkbox.js +0 -3
  58. package/addon/components/validated-input/types/-themes/uikit/input.js +0 -13
  59. package/addon/components/validated-input/types/-themes/uikit/radio-group.hbs +0 -20
  60. package/addon/components/validated-input/types/-themes/uikit/radio-group.js +0 -3
  61. package/addon/components/validated-input/types/-themes/uikit/select.js +0 -13
  62. package/addon/components/validated-input/types/-themes/uikit/textarea.js +0 -13
  63. package/app/components/validated-button/-themes/bootstrap/button.js +0 -1
  64. package/app/components/validated-button/-themes/uikit/button.js +0 -1
  65. package/app/components/validated-input/-themes/bootstrap/error.js +0 -1
  66. package/app/components/validated-input/-themes/bootstrap/hint.js +0 -1
  67. package/app/components/validated-input/-themes/bootstrap/label.js +0 -1
  68. package/app/components/validated-input/-themes/bootstrap/render.js +0 -1
  69. package/app/components/validated-input/-themes/uikit/error.js +0 -1
  70. package/app/components/validated-input/-themes/uikit/label.js +0 -1
  71. package/app/components/validated-input/-themes/uikit/render.js +0 -1
  72. package/app/components/validated-input/types/-themes/bootstrap/checkbox-group.js +0 -1
  73. package/app/components/validated-input/types/-themes/bootstrap/checkbox.js +0 -1
  74. package/app/components/validated-input/types/-themes/bootstrap/input.js +0 -1
  75. package/app/components/validated-input/types/-themes/bootstrap/radio-group.js +0 -1
  76. package/app/components/validated-input/types/-themes/bootstrap/select.js +0 -1
  77. package/app/components/validated-input/types/-themes/bootstrap/textarea.js +0 -1
  78. package/app/components/validated-input/types/-themes/uikit/checkbox-group.js +0 -1
  79. package/app/components/validated-input/types/-themes/uikit/checkbox.js +0 -1
  80. package/app/components/validated-input/types/-themes/uikit/input.js +0 -1
  81. package/app/components/validated-input/types/-themes/uikit/radio-group.js +0 -1
  82. package/app/components/validated-input/types/-themes/uikit/select.js +0 -1
  83. package/app/components/validated-input/types/-themes/uikit/textarea.js +0 -1
@@ -1,13 +1,11 @@
1
1
  {{#if (has-block)}}
2
- {{#let (component this.labelComponent) as |LabelComponent|}}
3
- <LabelComponent
4
- @label={{@label}}
5
- @required={{this.required}}
6
- @isValid={{this.isValid}}
7
- @isInvalid={{this.isInvalid}}
8
- @inputId={{this.inputId}}
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
- {{component this.hintComponent hint=@hint}}
24
+ <this.hintComponent @hint={{@hint}} />
27
25
  {{/if}}
28
26
 
29
27
  {{#if (and this.showValidity this.errors)}}
30
- {{component this.errorComponent errors=this.errors}}
28
+ <this.errorComponent @errors={{this.errors}} />
31
29
  {{/if}}
32
30
  {{else}}
33
- {{#let (component this.renderComponent) as |RenderComponent|}}
34
- <RenderComponent
35
- @type={{this.type}}
36
- @value={{this._val}}
37
- @inputId={{this.inputId}}
38
- @options={{@options}}
39
- @name={{@name}}
40
- @inputName={{@inputName}}
41
- @disabled={{@disabled}}
42
- @autofocus={{@autofocus}}
43
- @autocomplete={{@autocomplete}}
44
- @rows={{@rows}}
45
- @cols={{@cols}}
46
- @model={{@model}}
47
- @isValid={{this.isValid}}
48
- @isInvalid={{this.isInvalid}}
49
- @placeholder={{@placeholder}}
50
- @class={{@class}}
51
- @prompt={{@prompt}}
52
- @promptIsSelectable={{@promptIsSelectable}}
53
- @optionLabelPath={{@optionLabelPath}}
54
- @optionValuePath={{@optionValuePath}}
55
- @optionTargetPath={{@optionTargetPath}}
56
- @includeBlank={{@includeBlank}}
57
- @multiple={{@multiple}}
58
- @update={{this.update}}
59
- @setDirty={{this.setDirty}}
60
- @labelComponent={{component
61
- this.labelComponent
62
- label=@label
63
- required=@required
64
- isValid=this.isValid
65
- isInvalid=this.isInvalid
66
- inputId=this.inputId
67
- }}
68
- @hintComponent={{if @hint (component this.hintComponent hint=@hint)}}
69
- @errorComponent={{if
70
- (and this.showValidity this.errors)
71
- (component this.errorComponent errors=this.errors)
72
- }}
73
- ...attributes
74
- />
75
- {{/let}}
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 themedComponent from "../-private/themed-component";
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
- @themedComponent("validated-input/render") renderComponent;
30
- @themedComponent("validated-input/label") labelComponent;
31
- @themedComponent("validated-input/hint") hintComponent;
32
- @themedComponent("validated-input/error") errorComponent;
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,9 @@
1
+ import { helper } from "@ember/component/helper";
2
+ import { isEmpty } from "@ember/utils";
3
+
4
+ export default helper(function classList(classes) {
5
+ return classes
6
+ .filter((cls) => !isEmpty(cls))
7
+ .map((cls) => cls.trim())
8
+ .join(" ");
9
+ });
@@ -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/-themes/uikit/hint";
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": "5.3.1",
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-sygroup/ember-validated-form",
11
+ "repository": "https://github.com/adfinis/ember-validated-form",
12
12
  "license": "MIT",
13
- "author": "Adfinis SyGroup AG <info@adfinis-sygroup.ch>",
13
+ "author": "Adfinis AG <info@adfinis.com>",
14
14
  "directories": {
15
15
  "test": "tests"
16
16
  },
17
- "homepage": "https://docs.adfinis.com/ember-validated-form",
17
+ "homepage": "https://adfinis.github.io/ember-validated-form",
18
18
  "bugs": {
19
- "url": "https://github.com/adfinis-sygroup/ember-validated-form/issues"
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-auto-import": "^2.4.2",
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.1",
43
- "ember-truth-helpers": "^3.0.0"
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.6.0",
51
- "@fortawesome/ember-fontawesome": "0.4.0",
52
- "@fortawesome/free-solid-svg-icons": "6.1.1",
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-cli": "4.3.0",
56
- "ember-cli-addon-docs": "ember-learn/ember-cli-addon-docs#667701d60650cf7af51611dbff9abf1879776421",
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.2.1",
67
- "ember-data": "4.4.0",
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.6.0",
74
+ "ember-source": "4.7.0",
73
75
  "ember-source-channel-url": "3.0.0",
74
- "ember-template-lint": "4.12.0",
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": "10.6.1",
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.0.0",
83
- "eslint-plugin-qunit": "7.2.0",
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": "12.* || 14.* || >= 16"
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://docs.adfinis.com/ember-validated-form"
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,10 +0,0 @@
1
- import Component from "../../button";
2
-
3
- export default class UikitButton extends Component {
4
- get class() {
5
- const style =
6
- this.args.type === "submit" ? "uk-button-primary" : "uk-button-default";
7
-
8
- return `uk-button ${style}`;
9
- }
10
- }
@@ -1,4 +0,0 @@
1
- import Component from "@glimmer/component";
2
-
3
- // eslint-disable-next-line ember/no-empty-glimmer-component-classes
4
- export default class ButtonComponent extends Component {}
@@ -1,5 +0,0 @@
1
- import Component from "../../error";
2
-
3
- export default class BootstrapErrorComponent extends Component {
4
- class = "invalid-feedback";
5
- }
@@ -1,5 +0,0 @@
1
- import Component from "../../hint";
2
-
3
- export default class BootstrapHintComponent extends Component {
4
- class = "form-text text-muted";
5
- }
@@ -1,3 +0,0 @@
1
- import Component from "../../label";
2
-
3
- export default class BootstrapLabelComponent extends Component {}
@@ -1,5 +0,0 @@
1
- import Component from "../../render";
2
-
3
- export default class BootstrapRenderComponent extends Component {
4
- class = "form-group";
5
- }
@@ -1,4 +0,0 @@
1
- <small
2
- class="uk-text-danger"
3
- ...attributes
4
- >{{yield}}{{this.errorString}}</small>
@@ -1,3 +0,0 @@
1
- import Component from "../../error";
2
-
3
- export default class UikitErrorComponent extends Component {}
@@ -1,5 +0,0 @@
1
- import Component from "../../hint";
2
-
3
- export default class UikitHintComponent extends Component {
4
- class = "uk-text-muted";
5
- }
@@ -1,5 +0,0 @@
1
- import Component from "../../label";
2
-
3
- export default class UikitLabelComponent extends Component {
4
- class = "uk-form-label";
5
- }
@@ -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,5 +0,0 @@
1
- import Component from "../../render";
2
-
3
- export default class UikitRenderComponent extends Component {
4
- class = "uk-margin";
5
- }
@@ -1,4 +0,0 @@
1
- import Component from "@glimmer/component";
2
-
3
- // eslint-disable-next-line ember/no-empty-glimmer-component-classes
4
- export default class HintComponent extends Component {}
@@ -1,4 +0,0 @@
1
- import Component from "@glimmer/component";
2
-
3
- // eslint-disable-next-line ember/no-empty-glimmer-component-classes
4
- export default class LabelComponent extends Component {}
@@ -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}}
@@ -1,3 +0,0 @@
1
- import Component from "../../checkbox-group";
2
-
3
- export default class BootstrapCheckboxGroupComponent extends Component {}