ember-validated-form 4.1.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -1
  2. package/.github/dependabot.yml +11 -0
  3. package/.github/workflows/deploy.yml +1 -1
  4. package/.github/workflows/test.yml +1 -1
  5. package/CHANGELOG.md +24 -0
  6. package/README.md +2 -2
  7. package/addon/-private/themed-component.js +31 -35
  8. package/addon/components/validated-button/-themes/bootstrap/button.js +7 -9
  9. package/addon/components/validated-button/-themes/uikit/button.js +7 -9
  10. package/addon/components/validated-button/button.hbs +9 -0
  11. package/addon/components/validated-button/button.js +3 -8
  12. package/addon/components/validated-button.hbs +17 -0
  13. package/addon/components/validated-button.js +4 -8
  14. package/addon/components/validated-form.hbs +21 -0
  15. package/addon/components/validated-form.js +32 -46
  16. package/addon/components/validated-input/-themes/bootstrap/error.js +3 -3
  17. package/addon/components/validated-input/-themes/bootstrap/hint.js +3 -3
  18. package/addon/components/validated-input/-themes/bootstrap/label.js +1 -1
  19. package/addon/components/validated-input/-themes/bootstrap/render.js +3 -3
  20. package/addon/components/validated-input/-themes/uikit/error.hbs +4 -0
  21. package/addon/components/validated-input/-themes/uikit/error.js +1 -4
  22. package/addon/components/validated-input/-themes/uikit/hint.js +3 -3
  23. package/addon/components/validated-input/-themes/uikit/label.js +3 -3
  24. package/addon/components/validated-input/-themes/uikit/render.hbs +110 -0
  25. package/addon/components/validated-input/-themes/uikit/render.js +3 -5
  26. package/addon/components/validated-input/error.hbs +1 -0
  27. package/addon/components/validated-input/error.js +6 -7
  28. package/addon/components/validated-input/hint.hbs +1 -0
  29. package/addon/components/validated-input/hint.js +3 -7
  30. package/addon/components/validated-input/label.hbs +3 -0
  31. package/addon/components/validated-input/label.js +3 -8
  32. package/addon/components/validated-input/render.hbs +108 -0
  33. package/addon/components/validated-input/render.js +10 -13
  34. package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.hbs +19 -0
  35. package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.js +1 -4
  36. package/addon/components/validated-input/types/-themes/bootstrap/checkbox.hbs +14 -0
  37. package/addon/components/validated-input/types/-themes/bootstrap/checkbox.js +1 -6
  38. package/addon/components/validated-input/types/-themes/bootstrap/input.js +11 -4
  39. package/addon/components/validated-input/types/-themes/bootstrap/radio-group.hbs +20 -0
  40. package/addon/components/validated-input/types/-themes/bootstrap/radio-group.js +1 -4
  41. package/addon/components/validated-input/types/-themes/bootstrap/select.js +11 -4
  42. package/addon/components/validated-input/types/-themes/bootstrap/textarea.js +11 -4
  43. package/addon/components/validated-input/types/-themes/uikit/checkbox-group.hbs +19 -0
  44. package/addon/components/validated-input/types/-themes/uikit/checkbox-group.js +1 -4
  45. package/addon/components/validated-input/types/-themes/uikit/checkbox.hbs +15 -0
  46. package/addon/components/validated-input/types/-themes/uikit/checkbox.js +1 -4
  47. package/addon/components/validated-input/types/-themes/uikit/input.js +11 -4
  48. package/addon/components/validated-input/types/-themes/uikit/radio-group.hbs +20 -0
  49. package/addon/components/validated-input/types/-themes/uikit/radio-group.js +1 -4
  50. package/addon/components/validated-input/types/-themes/uikit/select.js +11 -4
  51. package/addon/components/validated-input/types/-themes/uikit/textarea.js +11 -4
  52. package/addon/components/validated-input/types/checkbox-group.hbs +14 -0
  53. package/addon/components/validated-input/types/checkbox-group.js +9 -11
  54. package/addon/components/validated-input/types/checkbox.hbs +9 -0
  55. package/addon/components/validated-input/types/checkbox.js +10 -6
  56. package/addon/components/validated-input/types/input.hbs +6 -0
  57. package/addon/components/validated-input/types/input.js +9 -17
  58. package/addon/components/validated-input/types/radio-group.hbs +14 -0
  59. package/addon/components/validated-input/types/radio-group.js +10 -6
  60. package/addon/components/validated-input/types/select.hbs +17 -0
  61. package/addon/components/validated-input/types/select.js +3 -7
  62. package/addon/components/validated-input/types/textarea.hbs +7 -0
  63. package/addon/components/validated-input/types/textarea.js +9 -17
  64. package/addon/{templates/components → components}/validated-input.hbs +3 -5
  65. package/addon/components/validated-input.js +1 -10
  66. package/app/components/validated-form.js +1 -7
  67. package/config/environment.js +1 -1
  68. package/package.json +40 -28
  69. package/.dependabot/config.yml +0 -14
  70. package/.prettierignore +0 -1
  71. package/addon/templates/components/validated-button/button.hbs +0 -1
  72. package/addon/templates/components/validated-button.hbs +0 -7
  73. package/addon/templates/components/validated-form.hbs +0 -15
  74. package/addon/templates/components/validated-input/-themes/uikit/render.hbs +0 -108
  75. package/addon/templates/components/validated-input/error.hbs +0 -1
  76. package/addon/templates/components/validated-input/hint.hbs +0 -1
  77. package/addon/templates/components/validated-input/label.hbs +0 -1
  78. package/addon/templates/components/validated-input/render.hbs +0 -107
  79. package/addon/templates/components/validated-input/types/-themes/bootstrap/checkbox-group.hbs +0 -14
  80. package/addon/templates/components/validated-input/types/-themes/bootstrap/checkbox.hbs +0 -10
  81. package/addon/templates/components/validated-input/types/-themes/bootstrap/radio-group.hbs +0 -15
  82. package/addon/templates/components/validated-input/types/-themes/bootstrap/select.hbs +0 -16
  83. package/addon/templates/components/validated-input/types/-themes/uikit/checkbox-group.hbs +0 -15
  84. package/addon/templates/components/validated-input/types/-themes/uikit/checkbox.hbs +0 -11
  85. package/addon/templates/components/validated-input/types/-themes/uikit/radio-group.hbs +0 -17
  86. package/addon/templates/components/validated-input/types/-themes/uikit/select.hbs +0 -17
  87. package/addon/templates/components/validated-input/types/checkbox-group.hbs +0 -14
  88. package/addon/templates/components/validated-input/types/checkbox.hbs +0 -9
  89. package/addon/templates/components/validated-input/types/radio-group.hbs +0 -14
  90. package/addon/templates/components/validated-input/types/select.hbs +0 -16
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: Bug report
3
3
  about: Template for bug reports
4
-
5
4
  ---
6
5
 
7
6
  --
@@ -0,0 +1,11 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ day: "friday"
8
+ time: "12:00"
9
+ timezone: "Europe/Zurich"
10
+ open-pull-requests-limit: 10
11
+ versioning-strategy: increase
@@ -25,4 +25,4 @@ jobs:
25
25
  env:
26
26
  CI: true
27
27
  DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
28
- ADDON_DOCS_VERSION_PATH: ${GITHUB_REF#refs/heads/}
28
+ ADDON_DOCS_UPDATE_LATEST: true
@@ -67,8 +67,8 @@ jobs:
67
67
  strategy:
68
68
  matrix:
69
69
  scenario:
70
- - ember-lts-3.20
71
70
  - ember-lts-3.24
71
+ - ember-lts-3.28
72
72
  - ember-release
73
73
 
74
74
  steps:
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # [5.0.0](https://github.com/adfinis-sygroup/ember-validated-form/compare/v4.1.0...v5.0.0) (2021-10-08)
2
+
3
+
4
+ ### chore
5
+
6
+ * **deps:** update ember and other dependencies ([41e099c](https://github.com/adfinis-sygroup/ember-validated-form/commit/41e099c4da82135c562493e5b2a4f9420dca73c6))
7
+ * **ember:** remove support for ember 3.20 ([0cfebfc](https://github.com/adfinis-sygroup/ember-validated-form/commit/0cfebfcc5792a1df52093a972878af1617ec8100))
8
+
9
+
10
+ ### Features
11
+
12
+ * refactor all components to glimmer and use native classes ([cee7373](https://github.com/adfinis-sygroup/ember-validated-form/commit/cee7373a3c0783a02fe00b5e510c41ba604403c2))
13
+
14
+
15
+ ### BREAKING CHANGES
16
+
17
+ * **ember:** Remove support for ember LTS 3.20 since that version
18
+ has a bug with autotracking.
19
+ * **deps:** Require `ember-auto-import` v2+
20
+ * While the public API won't change, there is a huge
21
+ chance that this will break implementations if someone's extending the
22
+ components of this addon. Components that do need to be refactored to
23
+ glimmer.
24
+
1
25
  # [4.1.0](https://github.com/adfinis-sygroup/ember-validated-form/compare/v4.0.1...v4.1.0) (2021-09-30)
2
26
 
3
27
 
package/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/ember-validated-form.svg)](https://badge.fury.io/js/ember-validated-form)
4
4
  [![Ember Observer Score](https://emberobserver.com/badges/ember-validated-form.svg)](https://emberobserver.com/addons/ember-validated-form)
5
- [![Build Status](https://travis-ci.org/adfinis-sygroup/ember-validated-form.svg?branch=main)](https://travis-ci.org/adfinis-sygroup/ember-validated-form)
6
- [![Code style](https://img.shields.io/badge/code_style-prettier-red.svg)](https://github.com/prettier/prettier)
5
+ [![Test](https://github.com/adfinis-sygroup/ember-validated-form/workflows/Test/badge.svg)](https://github.com/adfinis-sygroup/ember-validated-form/actions?query=workflow%3ATest)
6
+ [![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
7
7
 
8
8
  Easily create forms with client side validations.
9
9
 
@@ -1,42 +1,38 @@
1
1
  import { getOwner } from "@ember/application";
2
- import { computed, get, set } from "@ember/object";
3
2
 
4
- export default (component) => {
5
- return computed({
6
- get() {
7
- const parts = component.split("/");
8
- const componentNameParts = parts.slice(1, parts.length).join("/");
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
9
 
10
- if (get(this, `overrideComponents.${componentNameParts}`)) {
11
- return get(this, `overrideComponents.${componentNameParts}`);
12
- }
10
+ if (this.args[propertyName]) {
11
+ return this.args[propertyName];
12
+ }
13
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
- : {};
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
22
 
23
- const theme = config.theme;
24
- const defaultComponent = get(config, `defaults.${componentNameParts}`);
23
+ const theme = config.theme;
24
+ const defaultComponent = config.defaults?.[componentName];
25
25
 
26
- const name = parts.pop();
27
- const basePath = parts.join("/");
26
+ const name = parts.pop();
27
+ const basePath = parts.join("/");
28
28
 
29
- return (
30
- defaultComponent ||
31
- (theme ? `${basePath}/-themes/${theme}/${name}` : `${basePath}/${name}`)
32
- );
33
- },
34
- set(key, value) {
35
- if (!get(this, `overrideComponents`)) {
36
- set(this, `overrideComponents`, {});
37
- }
38
- set(this, `overrideComponents.${key}`, value);
39
- return value;
40
- },
41
- });
42
- };
29
+ return (
30
+ defaultComponent ||
31
+ (theme
32
+ ? `${basePath}/-themes/${theme}/${name}`
33
+ : `${basePath}/${name}`)
34
+ );
35
+ },
36
+ };
37
+ };
38
+ }
@@ -1,12 +1,10 @@
1
- import { computed } from "@ember/object";
2
-
3
1
  import Component from "../../button";
4
2
 
5
- export default Component.extend({
6
- classNames: ["btn"],
7
- classNameBindings: ["style"],
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" : "";
8
7
 
9
- style: computed("type", function () {
10
- return this.type === "submit" ? "btn-primary" : "btn-default";
11
- }),
12
- });
8
+ return `btn ${style} ${loading}`;
9
+ }
10
+ }
@@ -1,12 +1,10 @@
1
- import { computed } from "@ember/object";
2
-
3
1
  import Component from "../../button";
4
2
 
5
- export default Component.extend({
6
- classNames: ["uk-button"],
7
- classNameBindings: ["style"],
3
+ export default class UikitButton extends Component {
4
+ get class() {
5
+ const style =
6
+ this.args.type === "submit" ? "uk-button-primary" : "uk-button-default";
8
7
 
9
- style: computed("type", function () {
10
- return this.type === "submit" ? "uk-button-primary" : "uk-button-default";
11
- }),
12
- });
8
+ return `uk-button ${style}`;
9
+ }
10
+ }
@@ -0,0 +1,9 @@
1
+ <button
2
+ class={{this.class}}
3
+ type={{@type}}
4
+ disabled={{@disabled}}
5
+ {{on "click" @onClick}}
6
+ ...attributes
7
+ >
8
+ {{#if (has-block)}}{{~yield~}}{{else}}{{~@label~}}{{/if}}
9
+ </button>
@@ -1,9 +1,4 @@
1
- import Component from "@ember/component";
1
+ import Component from "@glimmer/component";
2
2
 
3
- import layout from "../../templates/components/validated-button/button";
4
-
5
- export default Component.extend({
6
- layout,
7
- tagName: "button",
8
- attributeBindings: ["disabled", "type", "action:onclick"],
9
- });
3
+ // eslint-disable-next-line ember/no-empty-glimmer-component-classes
4
+ export default class ButtonComponent extends Component {}
@@ -0,0 +1,17 @@
1
+ {{#let
2
+ (component
3
+ this.buttonComponent
4
+ onClick=@action
5
+ loading=@loading
6
+ disabled=@disabled
7
+ label=@label
8
+ type=@type
9
+ )
10
+ as |Button|
11
+ }}
12
+ {{#if (has-block)}}
13
+ <Button ...attributes>{{yield}}</Button>
14
+ {{else}}
15
+ <Button ...attributes />
16
+ {{/if}}
17
+ {{/let}}
@@ -1,11 +1,7 @@
1
- import Component from "@ember/component";
1
+ import Component from "@glimmer/component";
2
2
 
3
3
  import themedComponent from "../-private/themed-component";
4
- import layout from "../templates/components/validated-button";
5
4
 
6
- export default Component.extend({
7
- layout,
8
- type: "button",
9
- tagName: "",
10
- buttonComponent: themedComponent("validated-button/button"),
11
- });
5
+ export default class ValidatedButtonComponent extends Component {
6
+ @themedComponent("validated-button/button") buttonComponent;
7
+ }
@@ -0,0 +1,21 @@
1
+ <form autocomplete={{@autocomplete}} class={{if this.submitted "submitted"}}>
2
+ {{yield
3
+ (hash
4
+ model=@model
5
+ loading=this.loading
6
+ input=(component
7
+ "validated-input"
8
+ model=@model
9
+ submitted=this.submitted
10
+ validateBeforeSubmit=@validateBeforeSubmit
11
+ )
12
+ submit=(component
13
+ "validated-button"
14
+ type="submit"
15
+ loading=this.loading
16
+ label="Save"
17
+ action=this.submit
18
+ )
19
+ )
20
+ }}
21
+ </form>
@@ -1,70 +1,56 @@
1
- import Component from "@ember/component";
1
+ import { action } from "@ember/object";
2
+ import Component from "@glimmer/component";
3
+ import { tracked } from "@glimmer/tracking";
2
4
  import { resolve } from "rsvp";
3
5
 
4
- import layout from "../templates/components/validated-form";
5
-
6
6
  const PROP_ON_SUBMIT = "on-submit";
7
7
  const PROP_ON_INVALID_SUBMIT = "on-invalid-submit";
8
8
 
9
- export default Component.extend({
10
- tagName: "form",
11
-
12
- classNameBindings: ["submitted"],
13
- attributeBindings: ["autocomplete"],
14
-
15
- loading: false,
16
-
17
- submitted: false,
18
-
19
- layout,
9
+ export default class ValidatedFormComponent extends Component {
10
+ @tracked loading = false;
11
+ @tracked submitted = false;
12
+ @tracked validateBeforeSubmit = true;
20
13
 
21
- validateBeforeSubmit: true,
14
+ constructor(...args) {
15
+ super(...args);
22
16
 
23
- init(...args) {
24
- this._super(...args);
25
- if (this.model && this.model.validate) {
26
- this.model.validate();
17
+ if (this.args.model && this.args.model.validate) {
18
+ this.args.model.validate();
27
19
  }
28
- },
20
+ }
29
21
 
30
- submit() {
31
- this.set("submitted", true);
32
- const model = this.model;
22
+ @action
23
+ async submit(event) {
24
+ event.preventDefault();
25
+
26
+ this.submitted = true;
27
+ const model = this.args.model;
33
28
 
34
29
  if (!model || !model.validate) {
35
30
  this.runCallback(PROP_ON_SUBMIT);
36
31
  return false;
37
32
  }
38
33
 
39
- model.validate().then(() => {
40
- if (!this.element) {
41
- // We were removed from the DOM while validating
42
- return;
43
- }
34
+ await model.validate();
35
+
36
+ if (model.get("isInvalid")) {
37
+ this.runCallback(PROP_ON_INVALID_SUBMIT);
38
+ } else {
39
+ this.runCallback(PROP_ON_SUBMIT);
40
+ }
44
41
 
45
- if (model.get("isInvalid")) {
46
- this.runCallback(PROP_ON_INVALID_SUBMIT);
47
- } else {
48
- this.runCallback(PROP_ON_SUBMIT);
49
- }
50
- });
51
42
  return false;
52
- },
43
+ }
53
44
 
54
45
  runCallback(callbackProp) {
55
- const callback = this.get(callbackProp);
46
+ const callback = this.args[callbackProp];
56
47
  if (typeof callback !== "function") {
57
48
  return;
58
49
  }
59
- const model = this.model;
60
50
 
61
- this.set("loading", true);
62
- resolve(callback(model)).finally(() => {
63
- if (!this.element) {
64
- // We were removed from the DOM while running on-submit()
65
- return;
66
- }
67
- this.set("loading", false);
51
+ this.loading = true;
52
+ resolve(callback(this.args.model)).finally(() => {
53
+ this.loading = false;
68
54
  });
69
- },
70
- });
55
+ }
56
+ }
@@ -1,5 +1,5 @@
1
1
  import Component from "../../error";
2
2
 
3
- export default Component.extend({
4
- classNames: ["invalid-feedback"],
5
- });
3
+ export default class BootstrapErrorComponent extends Component {
4
+ class = "invalid-feedback";
5
+ }
@@ -1,5 +1,5 @@
1
1
  import Component from "../../hint";
2
2
 
3
- export default Component.extend({
4
- classNames: ["form-text", "text-muted"],
5
- });
3
+ export default class BootstrapHintComponent extends Component {
4
+ class = "form-text text-muted";
5
+ }
@@ -1,3 +1,3 @@
1
1
  import Component from "../../label";
2
2
 
3
- export default Component.extend({});
3
+ export default class BootstrapLabelComponent extends Component {}
@@ -1,5 +1,5 @@
1
1
  import Component from "../../render";
2
2
 
3
- export default Component.extend({
4
- classNames: ["form-group"],
5
- });
3
+ export default class BootstrapRenderComponent extends Component {
4
+ class = "form-group";
5
+ }
@@ -0,0 +1,4 @@
1
+ <small
2
+ class="uk-text-danger"
3
+ ...attributes
4
+ >{{yield}}{{this.errorString}}</small>
@@ -1,6 +1,3 @@
1
1
  import Component from "../../error";
2
2
 
3
- export default Component.extend({
4
- tagName: "small",
5
- classNames: ["uk-text-danger"],
6
- });
3
+ export default class UikitErrorComponent extends Component {}
@@ -1,5 +1,5 @@
1
1
  import Component from "../../hint";
2
2
 
3
- export default Component.extend({
4
- classNames: ["uk-text-muted"],
5
- });
3
+ export default class UikitHintComponent extends Component {
4
+ class = "uk-text-muted";
5
+ }
@@ -1,5 +1,5 @@
1
1
  import Component from "../../label";
2
2
 
3
- export default Component.extend({
4
- classNames: ["uk-form-label"],
5
- });
3
+ export default class UikitLabelComponent extends Component {
4
+ class = "uk-form-label";
5
+ }
@@ -0,0 +1,110 @@
1
+ <div class={{this.class}}>
2
+ {{#if (not-eq @type "checkbox")}}
3
+ <@labelComponent />
4
+ {{/if}}
5
+
6
+ <div class="uk-form-controls">
7
+ {{#if (eq @type "select")}}
8
+ {{#let (component this.selectComponent) as |Select|}}
9
+ <Select
10
+ @disabled={{@disabled}}
11
+ @includeBlank={{@includeBlank}}
12
+ @inputId={{@inputId}}
13
+ @isInvalid={{@isInvalid}}
14
+ @isValid={{@isValid}}
15
+ @multiple={{@multiple}}
16
+ @name={{or @inputName @name}}
17
+ @optionLabelPath={{@optionLabelPath}}
18
+ @options={{@options}}
19
+ @optionTargetPath={{@optionTargetPath}}
20
+ @optionValuePath={{@optionValuePath}}
21
+ @promptIsSelectable={{@promptIsSelectable}}
22
+ @setDirty={{@setDirty}}
23
+ @update={{@update}}
24
+ @value={{@value}}
25
+ />
26
+ {{/let}}
27
+ {{else if (or (eq @type "radioGroup") (eq @type "radio-group"))}}
28
+ {{#let (component this.radioGroupComponent) as |RadioGroup|}}
29
+ <RadioGroup
30
+ @disabled={{@disabled}}
31
+ @inputId={{@inputId}}
32
+ @isInvalid={{@isInvalid}}
33
+ @isValid={{@isValid}}
34
+ @name={{or @inputName @name}}
35
+ @options={{@options}}
36
+ @setDirty={{@setDirty}}
37
+ @update={{@update}}
38
+ @value={{@value}}
39
+ />
40
+ {{/let}}
41
+ {{else if (or (eq @type "checkboxGroup") (eq @type "checkbox-group"))}}
42
+ {{#let (component this.checkboxGroupComponent) as |CheckboxGroup|}}
43
+ <CheckboxGroup
44
+ @disabled={{@disabled}}
45
+ @inputId={{@inputId}}
46
+ @isInvalid={{@isInvalid}}
47
+ @isValid={{@isValid}}
48
+ @name={{or @inputName @name}}
49
+ @options={{@options}}
50
+ @setDirty={{@setDirty}}
51
+ @update={{@update}}
52
+ @value={{@value}}
53
+ />
54
+ {{/let}}
55
+ {{else if (eq @type "checkbox")}}
56
+ {{#let (component this.checkboxComponent) as |Checkbox|}}
57
+ <Checkbox
58
+ @disabled={{@disabled}}
59
+ @inputId={{@inputId}}
60
+ @isInvalid={{@isInvalid}}
61
+ @isValid={{@isValid}}
62
+ @labelComponent={{@labelComponent}}
63
+ @name={{or @inputName @name}}
64
+ @options={{@options}}
65
+ @setDirty={{@setDirty}}
66
+ @update={{@update}}
67
+ @value={{@value}}
68
+ />
69
+ {{/let}}
70
+ {{else if (eq @type "textarea")}}
71
+ {{#let (component this.textareaComponent) as |DynamicTextarea|}}
72
+ <DynamicTextarea
73
+ autocomplete={{@autocomplete}}
74
+ autofocus={{@autofocus}}
75
+ cols={{@cols}}
76
+ disabled={{@disabled}}
77
+ id={{@inputId}}
78
+ name={{or @inputName @name}}
79
+ placeholder={{@placeholder}}
80
+ rows={{@rows}}
81
+ value={{@value}}
82
+ @isInvalid={{@isInvalid}}
83
+ @isValid={{@isValid}}
84
+ @setDirty={{@setDirty}}
85
+ @update={{@update}}
86
+ />
87
+ {{/let}}
88
+ {{else}}
89
+ {{#let (component this.inputComponent) as |DynamicInput|}}
90
+ <DynamicInput
91
+ autocomplete={{@autocomplete}}
92
+ autofocus={{@autofocus}}
93
+ disabled={{@disabled}}
94
+ id={{@inputId}}
95
+ name={{or @inputName @name}}
96
+ placeholder={{@placeholder}}
97
+ type={{@type}}
98
+ value={{@value}}
99
+ @isInvalid={{@isInvalid}}
100
+ @isValid={{@isValid}}
101
+ @setDirty={{@setDirty}}
102
+ @update={{@update}}
103
+ />
104
+ {{/let}}
105
+ {{/if}}
106
+ </div>
107
+
108
+ <@hintComponent />
109
+ <@errorComponent />
110
+ </div>
@@ -1,7 +1,5 @@
1
- import layout from "../../../../templates/components/validated-input/-themes/uikit/render";
2
1
  import Component from "../../render";
3
2
 
4
- export default Component.extend({
5
- layout,
6
- classNames: ["uk-margin"],
7
- });
3
+ export default class UikitRenderComponent extends Component {
4
+ class = "uk-margin";
5
+ }
@@ -0,0 +1 @@
1
+ <span class={{this.class}} ...attributes>{{yield}}{{this.errorString}}</span>
@@ -1,8 +1,7 @@
1
- import Component from "@ember/component";
1
+ import Component from "@glimmer/component";
2
2
 
3
- import layout from "../../templates/components/validated-input/error";
4
-
5
- export default Component.extend({
6
- layout,
7
- tagName: "span",
8
- });
3
+ export default class ErrorComponent extends Component {
4
+ get errorString() {
5
+ return this.args.errors?.join(", ");
6
+ }
7
+ }
@@ -0,0 +1 @@
1
+ <small class={{this.class}} ...attributes>{{yield}}{{@hint}}</small>
@@ -1,8 +1,4 @@
1
- import Component from "@ember/component";
1
+ import Component from "@glimmer/component";
2
2
 
3
- import layout from "../../templates/components/validated-input/hint";
4
-
5
- export default Component.extend({
6
- layout,
7
- tagName: "small",
8
- });
3
+ // eslint-disable-next-line ember/no-empty-glimmer-component-classes
4
+ export default class HintComponent extends Component {}
@@ -0,0 +1,3 @@
1
+ <label class={{this.class}} for={{@inputId}} ...attributes>
2
+ {{yield}}{{@label}}{{if @required " *"}}
3
+ </label>
@@ -1,9 +1,4 @@
1
- import Component from "@ember/component";
1
+ import Component from "@glimmer/component";
2
2
 
3
- import layout from "../../templates/components/validated-input/label";
4
-
5
- export default Component.extend({
6
- layout,
7
- tagName: "label",
8
- attributeBindings: ["inputId:for"],
9
- });
3
+ // eslint-disable-next-line ember/no-empty-glimmer-component-classes
4
+ export default class LabelComponent extends Component {}