ember-validated-form 5.2.2 → 6.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 (89) hide show
  1. package/CHANGELOG.md +149 -123
  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 +29 -27
  12. package/addon/components/validated-input/render.js +7 -8
  13. package/addon/components/validated-input/types/checkbox-group.hbs +51 -12
  14. package/addon/components/validated-input/types/checkbox.hbs +41 -9
  15. package/addon/components/validated-input/types/input.hbs +17 -2
  16. package/addon/components/validated-input/types/input.js +0 -1
  17. package/addon/components/validated-input/types/radio-group.hbs +53 -12
  18. package/addon/components/validated-input/types/select.hbs +19 -4
  19. package/addon/components/validated-input/types/select.js +11 -28
  20. package/addon/components/validated-input/types/textarea.hbs +17 -2
  21. package/addon/components/validated-input.hbs +52 -52
  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 +17 -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/blueprints/ember-validated-form/index.js +1 -0
  28. package/index.js +63 -0
  29. package/package.json +40 -44
  30. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -9
  31. package/.github/dependabot.yml +0 -11
  32. package/.github/workflows/deploy.yml +0 -28
  33. package/.github/workflows/release.yml +0 -25
  34. package/.github/workflows/test.yml +0 -84
  35. package/addon/-private/themed-component.js +0 -38
  36. package/addon/components/validated-button/-themes/bootstrap/button.js +0 -10
  37. package/addon/components/validated-button/-themes/uikit/button.js +0 -10
  38. package/addon/components/validated-button/button.js +0 -4
  39. package/addon/components/validated-input/-themes/bootstrap/error.js +0 -5
  40. package/addon/components/validated-input/-themes/bootstrap/hint.js +0 -5
  41. package/addon/components/validated-input/-themes/bootstrap/label.js +0 -3
  42. package/addon/components/validated-input/-themes/bootstrap/render.js +0 -5
  43. package/addon/components/validated-input/-themes/uikit/error.hbs +0 -4
  44. package/addon/components/validated-input/-themes/uikit/error.js +0 -3
  45. package/addon/components/validated-input/-themes/uikit/hint.js +0 -5
  46. package/addon/components/validated-input/-themes/uikit/label.js +0 -5
  47. package/addon/components/validated-input/-themes/uikit/render.hbs +0 -110
  48. package/addon/components/validated-input/-themes/uikit/render.js +0 -5
  49. package/addon/components/validated-input/hint.js +0 -4
  50. package/addon/components/validated-input/label.js +0 -4
  51. package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.hbs +0 -19
  52. package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.js +0 -3
  53. package/addon/components/validated-input/types/-themes/bootstrap/checkbox.hbs +0 -14
  54. package/addon/components/validated-input/types/-themes/bootstrap/checkbox.js +0 -3
  55. package/addon/components/validated-input/types/-themes/bootstrap/input.js +0 -13
  56. package/addon/components/validated-input/types/-themes/bootstrap/radio-group.hbs +0 -20
  57. package/addon/components/validated-input/types/-themes/bootstrap/radio-group.js +0 -3
  58. package/addon/components/validated-input/types/-themes/bootstrap/select.js +0 -13
  59. package/addon/components/validated-input/types/-themes/bootstrap/textarea.js +0 -13
  60. package/addon/components/validated-input/types/-themes/uikit/checkbox-group.hbs +0 -19
  61. package/addon/components/validated-input/types/-themes/uikit/checkbox-group.js +0 -3
  62. package/addon/components/validated-input/types/-themes/uikit/checkbox.hbs +0 -15
  63. package/addon/components/validated-input/types/-themes/uikit/checkbox.js +0 -3
  64. package/addon/components/validated-input/types/-themes/uikit/input.js +0 -13
  65. package/addon/components/validated-input/types/-themes/uikit/radio-group.hbs +0 -20
  66. package/addon/components/validated-input/types/-themes/uikit/radio-group.js +0 -3
  67. package/addon/components/validated-input/types/-themes/uikit/select.js +0 -13
  68. package/addon/components/validated-input/types/-themes/uikit/textarea.js +0 -13
  69. package/app/components/validated-button/-themes/bootstrap/button.js +0 -1
  70. package/app/components/validated-button/-themes/uikit/button.js +0 -1
  71. package/app/components/validated-input/-themes/bootstrap/error.js +0 -1
  72. package/app/components/validated-input/-themes/bootstrap/hint.js +0 -1
  73. package/app/components/validated-input/-themes/bootstrap/label.js +0 -1
  74. package/app/components/validated-input/-themes/bootstrap/render.js +0 -1
  75. package/app/components/validated-input/-themes/uikit/error.js +0 -1
  76. package/app/components/validated-input/-themes/uikit/label.js +0 -1
  77. package/app/components/validated-input/-themes/uikit/render.js +0 -1
  78. package/app/components/validated-input/types/-themes/bootstrap/checkbox-group.js +0 -1
  79. package/app/components/validated-input/types/-themes/bootstrap/checkbox.js +0 -1
  80. package/app/components/validated-input/types/-themes/bootstrap/input.js +0 -1
  81. package/app/components/validated-input/types/-themes/bootstrap/radio-group.js +0 -1
  82. package/app/components/validated-input/types/-themes/bootstrap/select.js +0 -1
  83. package/app/components/validated-input/types/-themes/bootstrap/textarea.js +0 -1
  84. package/app/components/validated-input/types/-themes/uikit/checkbox-group.js +0 -1
  85. package/app/components/validated-input/types/-themes/uikit/checkbox.js +0 -1
  86. package/app/components/validated-input/types/-themes/uikit/input.js +0 -1
  87. package/app/components/validated-input/types/-themes/uikit/radio-group.js +0 -1
  88. package/app/components/validated-input/types/-themes/uikit/select.js +0 -1
  89. package/app/components/validated-input/types/-themes/uikit/textarea.js +0 -1
@@ -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,110 +0,0 @@
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,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 {}
@@ -1,14 +0,0 @@
1
- <div class="custom-control custom-checkbox">
2
- <input
3
- class="custom-control-input
4
- {{if @isValid 'is-valid'}}
5
- {{if @isInvalid 'is-invalid'}}"
6
- type="checkbox"
7
- name={{@name}}
8
- id={{@inputId}}
9
- disabled={{@disabled}}
10
- checked={{@value}}
11
- {{on "input" this.onUpdate}}
12
- />
13
- <@labelComponent class="custom-control-label" />
14
- </div>
@@ -1,3 +0,0 @@
1
- import Component from "../../checkbox";
2
-
3
- export default class BootstrapCheckboxComponent extends Component {}
@@ -1,13 +0,0 @@
1
- import Component from "../../input";
2
-
3
- export default class BootstrapInputComponent extends Component {
4
- get class() {
5
- const style = this.args.isValid
6
- ? "is-valid"
7
- : this.args.isInvalid
8
- ? "is-invalid"
9
- : "";
10
-
11
- return `form-control ${style}`;
12
- }
13
- }
@@ -1,20 +0,0 @@
1
- {{#each @options as |option i|}}
2
- <div class="custom-control custom-radio">
3
- <input
4
- type="radio"
5
- class="custom-control-input
6
- {{if @isValid 'is-valid'}}
7
- {{if @isInvalid 'is-invalid'}}"
8
- checked={{eq @value option.key}}
9
- value={{option.key}}
10
- name={{@name}}
11
- id="{{@inputId}}-{{i}}"
12
- disabled={{@disabled}}
13
- {{on "input" (fn this.onUpdate option.key)}}
14
- />
15
- <label
16
- class="custom-control-label"
17
- for="{{@inputId}}-{{i}}"
18
- >{{option.label}}</label>
19
- </div>
20
- {{/each}}
@@ -1,3 +0,0 @@
1
- import Component from "../../radio-group";
2
-
3
- export default class BootstrapRadioGroupComponent extends Component {}
@@ -1,13 +0,0 @@
1
- import Component from "../../select";
2
-
3
- export default class BootstrapSelectComponent extends Component {
4
- get class() {
5
- const style = this.args.isValid
6
- ? "is-valid"
7
- : this.args.isInvalid
8
- ? "is-invalid"
9
- : "";
10
-
11
- return `form-control ${style}`;
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- import Component from "../../textarea";
2
-
3
- export default class BootstrapTextareaComponent extends Component {
4
- get class() {
5
- const style = this.args.isValid
6
- ? "is-valid"
7
- : this.args.isInvalid
8
- ? "is-invalid"
9
- : "";
10
-
11
- return `form-control ${style}`;
12
- }
13
- }
@@ -1,19 +0,0 @@
1
- {{#each @options as |option i|}}
2
- {{#if (not-eq i 0)}}<br />{{/if}}
3
- <label
4
- class="uk-form-label
5
- {{if @isValid 'uk-text-success'}}
6
- {{if @isInvalid 'uk-text-danger'}}"
7
- >
8
- <input
9
- type="checkbox"
10
- class="uk-checkbox uk-margin-small-right"
11
- checked={{includes option.key @value}}
12
- name={{@name}}
13
- id="{{@inputId}}-{{i}}"
14
- disabled={{@disabled}}
15
- {{on "input" (fn this.onUpdate option.key)}}
16
- />
17
- {{option.label}}
18
- </label>
19
- {{/each}}
@@ -1,3 +0,0 @@
1
- import Component from "../../checkbox-group";
2
-
3
- export default class UikitCheckboxGroupComponent extends Component {}
@@ -1,15 +0,0 @@
1
- {{#let (component @labelComponent) as |Label|}}
2
- <Label
3
- class="{{if @isValid 'uk-text-success'}} {{if @isInvalid 'uk-text-danger'}}"
4
- >
5
- <input
6
- class="uk-checkbox uk-margin-small-right"
7
- type="checkbox"
8
- name={{@name}}
9
- id={{@inputId}}
10
- disabled={{@disabled}}
11
- checked={{@value}}
12
- {{on "input" this.onUpdate}}
13
- />
14
- </Label>
15
- {{/let}}
@@ -1,3 +0,0 @@
1
- import Component from "../../checkbox";
2
-
3
- export default class UikitCheckboxComponent extends Component {}
@@ -1,13 +0,0 @@
1
- import Component from "../../input";
2
-
3
- export default class UikitInputComponent extends Component {
4
- get class() {
5
- const style = this.args.isValid
6
- ? "uk-form-success"
7
- : this.args.isInvalid
8
- ? "uk-form-danger"
9
- : "";
10
-
11
- return `uk-input ${style}`;
12
- }
13
- }
@@ -1,20 +0,0 @@
1
- {{#each @options as |option i|}}
2
- {{#if (not-eq i 0)}}<br />{{/if}}
3
- <label
4
- class="uk-form-label
5
- {{if @isValid 'uk-text-success'}}
6
- {{if @isInvalid 'uk-text-danger'}}"
7
- >
8
- <input
9
- type="radio"
10
- class="uk-radio uk-margin-small-right"
11
- checked={{eq @value option.key}}
12
- value={{option.key}}
13
- name={{@name}}
14
- id="{{@inputId}}-{{i}}"
15
- disabled={{@disabled}}
16
- {{on "input" (fn this.onUpdate option.key)}}
17
- />
18
- {{option.label}}
19
- </label>
20
- {{/each}}
@@ -1,3 +0,0 @@
1
- import Component from "../../radio-group";
2
-
3
- export default class UikitRadioGroupComponent extends Component {}
@@ -1,13 +0,0 @@
1
- import Component from "../../select";
2
-
3
- export default class UikitSelectComponent extends Component {
4
- get class() {
5
- const style = this.args.isValid
6
- ? "uk-form-success"
7
- : this.args.isInvalid
8
- ? "uk-form-danger"
9
- : "";
10
-
11
- return `uk-select ${style}`;
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- import Component from "../../textarea";
2
-
3
- export default class UikitTextareaComponent extends Component {
4
- get class() {
5
- const style = this.args.isValid
6
- ? "uk-form-success"
7
- : this.args.isInvalid
8
- ? "uk-form-danger"
9
- : "";
10
-
11
- return `uk-textarea ${style}`;
12
- }
13
- }
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-button/-themes/bootstrap/button";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-button/-themes/uikit/button";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/-themes/bootstrap/error";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/-themes/bootstrap/hint";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/-themes/bootstrap/label";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/-themes/bootstrap/render";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/-themes/uikit/error";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/-themes/uikit/label";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/-themes/uikit/render";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/bootstrap/checkbox-group";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/bootstrap/checkbox";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/bootstrap/input";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/bootstrap/radio-group";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/bootstrap/select";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/bootstrap/textarea";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/uikit/checkbox-group";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/uikit/checkbox";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/uikit/input";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/uikit/radio-group";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/uikit/select";
@@ -1 +0,0 @@
1
- export { default } from "ember-validated-form/components/validated-input/types/-themes/uikit/textarea";