ember-validated-form 4.0.0 → 5.1.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 (93) 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 +2 -2
  4. package/.github/workflows/test.yml +3 -3
  5. package/.husky/commit-msg +6 -0
  6. package/.husky/pre-commit +8 -0
  7. package/CHANGELOG.md +47 -0
  8. package/README.md +3 -3
  9. package/addon/-private/themed-component.js +31 -35
  10. package/addon/components/validated-button/-themes/bootstrap/button.js +7 -9
  11. package/addon/components/validated-button/-themes/uikit/button.js +7 -9
  12. package/addon/components/validated-button/button.hbs +9 -0
  13. package/addon/components/validated-button/button.js +3 -8
  14. package/addon/components/validated-button.hbs +17 -0
  15. package/addon/components/validated-button.js +53 -9
  16. package/addon/components/validated-form.hbs +28 -0
  17. package/addon/components/validated-form.js +36 -45
  18. package/addon/components/validated-input/-themes/bootstrap/error.js +3 -3
  19. package/addon/components/validated-input/-themes/bootstrap/hint.js +3 -3
  20. package/addon/components/validated-input/-themes/bootstrap/label.js +1 -1
  21. package/addon/components/validated-input/-themes/bootstrap/render.js +3 -3
  22. package/addon/components/validated-input/-themes/uikit/error.hbs +4 -0
  23. package/addon/components/validated-input/-themes/uikit/error.js +1 -4
  24. package/addon/components/validated-input/-themes/uikit/hint.js +3 -3
  25. package/addon/components/validated-input/-themes/uikit/label.js +3 -3
  26. package/addon/components/validated-input/-themes/uikit/render.hbs +110 -0
  27. package/addon/components/validated-input/-themes/uikit/render.js +3 -5
  28. package/addon/components/validated-input/error.hbs +1 -0
  29. package/addon/components/validated-input/error.js +6 -7
  30. package/addon/components/validated-input/hint.hbs +1 -0
  31. package/addon/components/validated-input/hint.js +3 -7
  32. package/addon/components/validated-input/label.hbs +3 -0
  33. package/addon/components/validated-input/label.js +3 -8
  34. package/addon/components/validated-input/render.hbs +108 -0
  35. package/addon/components/validated-input/render.js +10 -10
  36. package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.hbs +19 -0
  37. package/addon/components/validated-input/types/-themes/bootstrap/checkbox-group.js +3 -0
  38. package/addon/components/validated-input/types/-themes/bootstrap/checkbox.hbs +14 -0
  39. package/addon/components/validated-input/types/-themes/bootstrap/checkbox.js +1 -6
  40. package/addon/components/validated-input/types/-themes/bootstrap/input.js +11 -4
  41. package/addon/components/validated-input/types/-themes/bootstrap/radio-group.hbs +20 -0
  42. package/addon/components/validated-input/types/-themes/bootstrap/radio-group.js +1 -4
  43. package/addon/components/validated-input/types/-themes/bootstrap/select.js +11 -4
  44. package/addon/components/validated-input/types/-themes/bootstrap/textarea.js +11 -4
  45. package/addon/components/validated-input/types/-themes/uikit/checkbox-group.hbs +19 -0
  46. package/addon/components/validated-input/types/-themes/uikit/checkbox-group.js +3 -0
  47. package/addon/components/validated-input/types/-themes/uikit/checkbox.hbs +15 -0
  48. package/addon/components/validated-input/types/-themes/uikit/checkbox.js +1 -4
  49. package/addon/components/validated-input/types/-themes/uikit/input.js +11 -4
  50. package/addon/components/validated-input/types/-themes/uikit/radio-group.hbs +20 -0
  51. package/addon/components/validated-input/types/-themes/uikit/radio-group.js +1 -4
  52. package/addon/components/validated-input/types/-themes/uikit/select.js +11 -4
  53. package/addon/components/validated-input/types/-themes/uikit/textarea.js +11 -4
  54. package/addon/components/validated-input/types/checkbox-group.hbs +14 -0
  55. package/addon/components/validated-input/types/checkbox-group.js +21 -0
  56. package/addon/components/validated-input/types/checkbox.hbs +9 -0
  57. package/addon/components/validated-input/types/checkbox.js +10 -6
  58. package/addon/components/validated-input/types/input.hbs +6 -0
  59. package/addon/components/validated-input/types/input.js +9 -17
  60. package/addon/components/validated-input/types/radio-group.hbs +14 -0
  61. package/addon/components/validated-input/types/radio-group.js +10 -6
  62. package/addon/components/validated-input/types/select.hbs +49 -0
  63. package/addon/components/validated-input/types/select.js +83 -6
  64. package/addon/components/validated-input/types/textarea.hbs +7 -0
  65. package/addon/components/validated-input/types/textarea.js +9 -17
  66. package/addon/{templates/components → components}/validated-input.hbs +3 -5
  67. package/addon/components/validated-input.js +6 -13
  68. package/app/components/validated-form.js +1 -7
  69. package/app/components/validated-input/types/-themes/bootstrap/checkbox-group.js +1 -0
  70. package/app/components/validated-input/types/-themes/uikit/checkbox-group.js +1 -0
  71. package/app/components/validated-input/types/checkbox-group.js +1 -0
  72. package/config/environment.js +1 -1
  73. package/package.json +57 -41
  74. package/.dependabot/config.yml +0 -14
  75. package/.husky/precommit +0 -1
  76. package/.prettierignore +0 -1
  77. package/addon/templates/components/validated-button/button.hbs +0 -1
  78. package/addon/templates/components/validated-button.hbs +0 -7
  79. package/addon/templates/components/validated-form.hbs +0 -15
  80. package/addon/templates/components/validated-input/-themes/uikit/render.hbs +0 -94
  81. package/addon/templates/components/validated-input/error.hbs +0 -1
  82. package/addon/templates/components/validated-input/hint.hbs +0 -1
  83. package/addon/templates/components/validated-input/label.hbs +0 -1
  84. package/addon/templates/components/validated-input/render.hbs +0 -93
  85. package/addon/templates/components/validated-input/types/-themes/bootstrap/checkbox.hbs +0 -10
  86. package/addon/templates/components/validated-input/types/-themes/bootstrap/radio-group.hbs +0 -15
  87. package/addon/templates/components/validated-input/types/-themes/bootstrap/select.hbs +0 -16
  88. package/addon/templates/components/validated-input/types/-themes/uikit/checkbox.hbs +0 -11
  89. package/addon/templates/components/validated-input/types/-themes/uikit/radio-group.hbs +0 -17
  90. package/addon/templates/components/validated-input/types/-themes/uikit/select.hbs +0 -17
  91. package/addon/templates/components/validated-input/types/checkbox.hbs +0 -9
  92. package/addon/templates/components/validated-input/types/radio-group.hbs +0 -14
  93. package/addon/templates/components/validated-input/types/select.hbs +0 -16
@@ -0,0 +1,6 @@
1
+ <input
2
+ class={{this.class}}
3
+ ...attributes
4
+ {{on "input" this.onUpdate}}
5
+ {{on "blur" @setDirty}}
6
+ />
@@ -1,19 +1,11 @@
1
- import Component from "@ember/component";
1
+ import { action } from "@ember/object";
2
+ import Component from "@glimmer/component";
2
3
 
3
- export default Component.extend({
4
- tagName: "input",
5
- type: "text",
6
- attributeBindings: [
7
- "value",
8
- "placeholder",
9
- "type",
10
- "inputId:id",
11
- "name",
12
- "autofocus",
13
- "autocomplete",
14
- "disabled",
4
+ export default class InputComponent extends Component {
5
+ @action
6
+ onUpdate(event) {
7
+ event.preventDefault();
15
8
 
16
- "update:oninput",
17
- "setDirty:onblur",
18
- ],
19
- });
9
+ this.args.update(event.target.value);
10
+ }
11
+ }
@@ -0,0 +1,14 @@
1
+ {{#each @options as |option i|}}
2
+ <label>
3
+ <input
4
+ type="radio"
5
+ checked={{eq @value option.key}}
6
+ value={{option.key}}
7
+ name={{@name}}
8
+ id="{{@inputId}}-{{i}}"
9
+ disabled={{@disabled}}
10
+ {{on "input" (fn this.onUpdate option.key)}}
11
+ />
12
+ {{option.label}}
13
+ </label>
14
+ {{/each}}
@@ -1,8 +1,12 @@
1
- import Component from "@ember/component";
1
+ import { action } from "@ember/object";
2
+ import Component from "@glimmer/component";
2
3
 
3
- import layout from "../../../templates/components/validated-input/types/radio-group";
4
+ export default class RadioGroupComponent extends Component {
5
+ @action
6
+ onUpdate(value, event) {
7
+ event.preventDefault();
4
8
 
5
- export default Component.extend({
6
- layout,
7
- tagName: "",
8
- });
9
+ this.args.update(value);
10
+ this.args.setDirty();
11
+ }
12
+ }
@@ -0,0 +1,49 @@
1
+ <select
2
+ class={{this.class}}
3
+ ...attributes
4
+ name={{@name}}
5
+ id={{@inpudId}}
6
+ disabled={{@disabled}}
7
+ multiple={{@multiple}}
8
+ {{on "change" this.onUpdate}}
9
+ {{on "blur" this.onBlur}}
10
+ >
11
+ {{#if (or @prompt @includeBlank)}}
12
+ <option
13
+ value=""
14
+ disabled={{not @promptIsSelectable}}
15
+ selected={{not @value}}
16
+ >{{or @prompt @includeBlank}}</option>
17
+ {{/if}}
18
+
19
+ {{#if this.hasGrouping}}
20
+ {{#each this.optionGroups as |optionGroup|}}
21
+ <optgroup label={{optionGroup.groupName}}>
22
+ {{#each optionGroup.options as |opt|}}
23
+ {{#let
24
+ (if @optionValuePath (get opt @optionValuePath) opt)
25
+ as |optionValue|
26
+ }}
27
+ <option
28
+ selected={{eq optionValue @value}}
29
+ value={{optionValue}}
30
+ >{{if @optionLabelPath (get opt @optionLabelPath) opt}}</option>
31
+ {{/let}}
32
+ {{/each}}
33
+ </optgroup>
34
+ {{/each}}
35
+ {{else}}
36
+ {{#each @options as |opt|}}
37
+ {{#let
38
+ (if @optionValuePath (get opt @optionValuePath) opt)
39
+ as |optionValue|
40
+ }}
41
+ <option selected={{eq optionValue @value}} value={{optionValue}}>{{if
42
+ @optionLabelPath
43
+ (get opt @optionLabelPath)
44
+ opt
45
+ }}</option>
46
+ {{/let}}
47
+ {{/each}}
48
+ {{/if}}
49
+ </select>
@@ -1,8 +1,85 @@
1
- import Component from "@ember/component";
1
+ import { A as emberArray, isArray } from "@ember/array";
2
+ import { deprecate } from "@ember/debug";
3
+ import EmberObject, { action, get } from "@ember/object";
4
+ import Component from "@glimmer/component";
2
5
 
3
- import layout from "../../../templates/components/validated-input/types/select";
6
+ /**
7
+ * This component is heavily inspired by the ember-one-way-select addon.
8
+ * https://github.com/DockYard/ember-one-way-select
9
+ * Our implementation is slightly simpler, since it does not support
10
+ * the block syntax for options.
11
+ */
4
12
 
5
- export default Component.extend({
6
- layout,
7
- tagName: "",
8
- });
13
+ export default class SelectComponent extends Component {
14
+ constructor(...args) {
15
+ super(...args);
16
+
17
+ if (this.args.includeBlank) {
18
+ deprecate(
19
+ "The `includeBlank` property is deprecated. Please use `prompt` instead.",
20
+ false,
21
+ {
22
+ id: "ember-validated-form:NoMoreincludeBlank",
23
+ until: "6.0.0",
24
+ since: "5.1.0",
25
+ url: "https://github.com/adfinis-sygroup/ember-validated-form/releases/tag/v5.1.0",
26
+ }
27
+ );
28
+ }
29
+ }
30
+
31
+ get hasPreGroupedOptions() {
32
+ return (
33
+ this.args.options[0]?.groupName && isArray(this.args.options[0]?.options)
34
+ );
35
+ }
36
+
37
+ get hasGrouping() {
38
+ return this.hasPreGroupedOptions || this.args.groupLabelPath;
39
+ }
40
+
41
+ get optionGroups() {
42
+ const groupLabelPath = this.args.groupLabelPath;
43
+ if (!groupLabelPath) {
44
+ return this.args.options;
45
+ }
46
+ const groups = emberArray();
47
+
48
+ this.args.options.forEach((item) => {
49
+ const label = get(item, groupLabelPath);
50
+
51
+ if (label) {
52
+ let group = groups.findBy("groupName", label);
53
+
54
+ if (!group) {
55
+ group = EmberObject.create({
56
+ groupName: label,
57
+ options: emberArray(),
58
+ });
59
+
60
+ groups.pushObject(group);
61
+ }
62
+
63
+ group.options.pushObject(item);
64
+ } else {
65
+ groups.pushObject(item);
66
+ }
67
+ });
68
+
69
+ return groups;
70
+ }
71
+
72
+ @action
73
+ onUpdate(event) {
74
+ if (this.args.update) {
75
+ this.args.update(event.target.value);
76
+ }
77
+ }
78
+
79
+ @action
80
+ onBlur(event) {
81
+ if (this.args.setDirty) {
82
+ this.args.setDirty(event.target.value);
83
+ }
84
+ }
85
+ }
@@ -0,0 +1,7 @@
1
+ <textarea
2
+ class={{this.class}}
3
+ ...attributes
4
+ {{on "input" this.onUpdate}}
5
+ {{on "blur" @setDirty}}
6
+ >
7
+ </textarea>
@@ -1,19 +1,11 @@
1
- import Component from "@ember/component";
1
+ import { action } from "@ember/object";
2
+ import Component from "@glimmer/component";
2
3
 
3
- export default Component.extend({
4
- tagName: "textarea",
5
- attributeBindings: [
6
- "value",
7
- "placeholder",
8
- "name",
9
- "inputId:id",
10
- "disabled",
11
- "autofocus",
12
- "rows",
13
- "cols",
14
- "autocomplete",
4
+ export default class TextareaComponent extends Component {
5
+ @action
6
+ onUpdate(event) {
7
+ event.preventDefault();
15
8
 
16
- "update:oninput",
17
- "setDirty:onblur",
18
- ],
19
- });
9
+ this.args.update(event.target.value);
10
+ }
11
+ }
@@ -56,8 +56,7 @@
56
56
  @multiple={{@multiple}}
57
57
  @update={{this.update}}
58
58
  @setDirty={{this.setDirty}}
59
- @labelComponent={{
60
- component
59
+ @labelComponent={{component
61
60
  this.labelComponent
62
61
  label=@label
63
62
  required=@required
@@ -66,11 +65,10 @@
66
65
  inputId=this.inputId
67
66
  }}
68
67
  @hintComponent={{if @hint (component this.hintComponent hint=@hint)}}
69
- @errorComponent={{
70
- if
68
+ @errorComponent={{if
71
69
  (and this.showValidity this.errors)
72
70
  (component this.errorComponent errors=this.errors)
73
71
  }}
74
72
  />
75
73
  {{/let}}
76
- {{/if}}
74
+ {{/if}}
@@ -1,11 +1,9 @@
1
- import { setComponentTemplate } from "@ember/component";
2
1
  import { action, set, get } from "@ember/object";
3
2
  import { guidFor } from "@ember/object/internals";
4
3
  import Component from "@glimmer/component";
5
4
  import { tracked } from "@glimmer/tracking";
6
5
 
7
6
  import themedComponent from "../-private/themed-component";
8
- import template from "../templates/components/validated-input";
9
7
 
10
8
  /**
11
9
  * This component wraps form inputs.
@@ -20,7 +18,7 @@ import template from "../templates/components/validated-input";
20
18
  * @class validated-input
21
19
  * @export default
22
20
  */
23
- export class ValidatedInput extends Component {
21
+ export default class ValidatedInputComponent extends Component {
24
22
  inputId = guidFor(this);
25
23
 
26
24
  @tracked dirty;
@@ -40,11 +38,6 @@ export class ValidatedInput extends Component {
40
38
  this.required = this.args.required ?? false;
41
39
  this.type = this.args.type ?? "text";
42
40
  this.validateBeforeSubmit = this.args.validateBeforeSubmit ?? true;
43
-
44
- this.renderComponent = this.args.renderComponent ?? this.renderComponent;
45
- this.labelComponent = this.args.labelComponent ?? this.labelComponent;
46
- this.hintComponent = this.args.hintComponent ?? this.hintComponent;
47
- this.errorComponent = this.args.errorComponent ?? this.errorComponent;
48
41
  }
49
42
 
50
43
  get _val() {
@@ -88,12 +81,12 @@ export class ValidatedInput extends Component {
88
81
 
89
82
  @action
90
83
  update(value) {
91
- if (this["on-update"]) {
92
- this["on-update"](value, this.args.model);
84
+ if (this.args["on-update"]) {
85
+ this.args["on-update"](value, this.args.model);
93
86
  } else {
94
- set(this.args.model, this.args.name, value);
87
+ this.args.model.set
88
+ ? this.args.model.set(this.args.name, value)
89
+ : set(this.args.model, this.args.name, value);
95
90
  }
96
91
  }
97
92
  }
98
-
99
- export default setComponentTemplate(template, ValidatedInput);
@@ -1,7 +1 @@
1
- import ValidatedForm from "ember-validated-form/components/validated-form";
2
-
3
- import config from "../config/environment";
4
-
5
- export default ValidatedForm.extend({
6
- config: config["ember-validated-form"],
7
- });
1
+ export { default } from "ember-validated-form/components/validated-form";
@@ -0,0 +1 @@
1
+ export { default } from "ember-validated-form/components/validated-input/types/-themes/bootstrap/checkbox-group";
@@ -0,0 +1 @@
1
+ export { default } from "ember-validated-form/components/validated-input/types/-themes/uikit/checkbox-group";
@@ -0,0 +1 @@
1
+ export { default } from "ember-validated-form/components/validated-input/types/checkbox-group";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  module.exports = function (/* environment, appConfig */) {
4
- return { historySupportMiddleware: true };
4
+ return {};
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-validated-form",
3
- "version": "4.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Easily create forms with client-side validations",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -20,82 +20,93 @@
20
20
  },
21
21
  "scripts": {
22
22
  "build": "ember build --environment=production",
23
- "lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
23
+ "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
24
+ "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
24
25
  "lint:hbs": "ember-template-lint .",
25
- "lint:js": "eslint .",
26
+ "lint:hbs:fix": "ember-template-lint . --fix",
27
+ "lint:js": "eslint . --cache",
28
+ "lint:js:fix": "eslint . --fix",
26
29
  "start": "ember serve",
27
- "test": "npm-run-all lint:* test:*",
30
+ "test": "npm-run-all lint test:*",
28
31
  "test:ember": "ember test",
29
- "test:ember-compatibility": "ember try:each"
30
- },
31
- "lint-staged": {
32
- "*.{js,json,css,md}": [
33
- "prettier --write",
34
- "git add"
35
- ]
32
+ "test:ember-compatibility": "ember try:each",
33
+ "prepare": "husky install"
36
34
  },
37
35
  "dependencies": {
38
- "ember-auto-import": "^1.11.2",
39
- "ember-cli-babel": "^7.26.3",
36
+ "ember-auto-import": "^2.2.0",
37
+ "ember-cli-babel": "^7.26.6",
40
38
  "ember-cli-htmlbars": "^5.7.1",
41
- "ember-one-way-select": "^4.0.1",
42
39
  "ember-truth-helpers": "^3.0.0"
43
40
  },
44
41
  "devDependencies": {
45
- "@adfinis-sygroup/eslint-config": "1.3.2",
46
- "@adfinis-sygroup/semantic-release-config": "3.1.0",
47
- "@babel/core": "7.14.3",
42
+ "@adfinis-sygroup/eslint-config": "1.5.0",
43
+ "@adfinis-sygroup/semantic-release-config": "3.2.1",
44
+ "@babel/core": "7.16.5",
45
+ "@babel/helper-create-regexp-features-plugin": "^7.16.7",
46
+ "@babel/helper-environment-visitor": "^7.16.5",
47
+ "@babel/plugin-proposal-decorators": "^7.16.7",
48
+ "@babel/plugin-transform-modules-amd": "^7.16.7",
49
+ "@babel/preset-env": "^7.16.7",
48
50
  "@ember/optional-features": "2.0.0",
51
+ "@ember/test-helpers": "2.6.0",
52
+ "@embroider/test-setup": "0.45.0",
49
53
  "@fortawesome/ember-fontawesome": "0.2.3",
50
- "@fortawesome/free-solid-svg-icons": "5.15.3",
54
+ "@fortawesome/free-solid-svg-icons": "5.15.4",
51
55
  "@glimmer/component": "1.0.4",
52
56
  "@glimmer/tracking": "1.0.4",
53
57
  "babel-eslint": "10.1.0",
54
58
  "broccoli-asset-rev": "3.0.0",
55
- "ember-changeset": "3.13.3",
56
- "ember-changeset-validations": "3.14.2",
57
- "ember-cli": "3.26.1",
58
- "ember-cli-addon-docs": "1.0.0",
59
+ "ember-changeset": "3.15.0",
60
+ "ember-changeset-validations": "3.16.0",
61
+ "ember-cli": "3.28.1",
62
+ "ember-cli-addon-docs": "4.2.1",
59
63
  "ember-cli-dependency-checker": "3.2.0",
60
64
  "ember-cli-deploy": "1.0.2",
61
65
  "ember-cli-deploy-build": "2.0.0",
62
66
  "ember-cli-deploy-git": "1.3.4",
63
67
  "ember-cli-deploy-git-ci": "1.0.1",
64
- "ember-cli-inject-live-reload": "2.0.2",
68
+ "ember-cli-inject-live-reload": "2.1.0",
65
69
  "ember-cli-release": "1.0.0-beta.2",
66
70
  "ember-cli-sri": "2.1.1",
67
- "ember-cli-terser": "4.0.1",
71
+ "ember-cli-terser": "4.0.2",
68
72
  "ember-cli-test-loader": "3.0.0",
69
- "ember-concurrency": "2.0.3",
70
- "ember-data": "3.26.0",
73
+ "ember-concurrency": "2.2.0",
74
+ "ember-data": "3.28.3",
71
75
  "ember-disable-prototype-extensions": "1.1.3",
72
76
  "ember-load-initializers": "2.1.2",
73
- "ember-maybe-import-regenerator": "0.1.6",
74
- "ember-power-select": "4.1.4",
75
- "ember-qunit": "4.6.0",
76
- "ember-resolver": "8.0.2",
77
- "ember-source": "3.26.1",
77
+ "ember-maybe-import-regenerator": "1.0.0",
78
+ "ember-power-select": "4.1.6",
79
+ "ember-qunit": "5.1.5",
80
+ "ember-resolver": "8.0.3",
81
+ "ember-source": "3.28.1",
78
82
  "ember-source-channel-url": "3.0.0",
79
- "ember-template-lint": "2.21.0",
83
+ "ember-template-lint": "3.15.0",
84
+ "ember-template-lint-plugin-prettier": "2.0.1",
80
85
  "ember-try": "1.4.0",
81
- "eslint": "7.26.0",
86
+ "eslint": "7.32.0",
82
87
  "eslint-config-prettier": "8.3.0",
83
- "eslint-plugin-ember": "9.6.0",
84
- "eslint-plugin-import": "2.22.1",
88
+ "eslint-plugin-ember": "10.5.8",
89
+ "eslint-plugin-import": "2.25.3",
85
90
  "eslint-plugin-node": "11.1.0",
86
- "eslint-plugin-prettier": "3.4.0",
87
- "husky": "6.0.0",
88
- "lint-staged": "10.5.4",
91
+ "eslint-plugin-prettier": "4.0.0",
92
+ "eslint-plugin-qunit": "6.2.0",
93
+ "husky": "7.0.4",
94
+ "lint-staged": "11.2.0",
89
95
  "loader.js": "4.7.0",
90
96
  "npm-run-all": "4.1.5",
91
- "prettier": "2.3.0",
92
- "qunit-dom": "1.6.0"
97
+ "prettier": "2.4.1",
98
+ "qunit": "2.17.2",
99
+ "qunit-dom": "2.0.0",
100
+ "webpack": "5.58.0"
93
101
  },
94
102
  "resolutions": {
95
103
  "graceful-fs": ">=4.2.0"
96
104
  },
97
105
  "engines": {
98
- "node": "14.* || >= 16"
106
+ "node": "12.* || 14.* || >= 16"
107
+ },
108
+ "ember": {
109
+ "edition": "octane"
99
110
  },
100
111
  "ember-addon": {
101
112
  "configPath": "tests/dummy/config",
@@ -104,6 +115,11 @@
104
115
  "release": {
105
116
  "extends": "@adfinis-sygroup/semantic-release-config"
106
117
  },
118
+ "lint-staged": {
119
+ "*.js": "eslint --cache --fix",
120
+ "*.hbs": "ember-template-lint --fix",
121
+ "*.{scss,graphql,json,md,yml}": "prettier --write"
122
+ },
107
123
  "commitlint": {
108
124
  "extends": [
109
125
  "@commitlint/config-conventional"
@@ -1,14 +0,0 @@
1
- version: 1
2
- update_configs:
3
- - package_manager: "javascript"
4
- directory: "/"
5
- update_schedule: "live"
6
- version_requirement_updates: "increase_versions"
7
- automerged_updates:
8
- - match:
9
- dependency_type: "development"
10
- update_type: "semver:minor"
11
- commit_message:
12
- prefix: "fix"
13
- prefix_development: "chore"
14
- include_scope: true
package/.husky/precommit DELETED
@@ -1 +0,0 @@
1
- yarn lint-staged
package/.prettierignore DELETED
@@ -1 +0,0 @@
1
- package.json
@@ -1 +0,0 @@
1
- {{#if hasBlock}}{{~yield~}}{{else}}{{~label~}}{{/if}}
@@ -1,7 +0,0 @@
1
- {{#with (component buttonComponent onclick=action disabled=disabled label=label type=type class=class) as |button|}}
2
- {{#if hasBlock}}
3
- {{#component button}}{{yield}}{{/component}}
4
- {{else}}
5
- {{component button}}
6
- {{/if}}
7
- {{/with}}
@@ -1,15 +0,0 @@
1
- {{yield (hash
2
- model=model
3
- loading=loading
4
- input=(component "validated-input"
5
- model=model
6
- submitted=submitted
7
- validateBeforeSubmit=validateBeforeSubmit
8
- )
9
- submit=(component "validated-button"
10
- class=submitClass
11
- type="submit"
12
- loading=loading
13
- label="Save"
14
- )
15
- )}}
@@ -1,94 +0,0 @@
1
- {{#unless (eq type "checkbox")}}
2
- {{component labelComponent}}
3
- {{/unless}}
4
-
5
- <div class="uk-form-controls">
6
- {{#if (eq type "select")}}
7
- {{component selectComponent
8
- disabled=disabled
9
- name=(or inputName name)
10
- optionLabelPath=optionLabelPath
11
- optionValuePath=optionValuePath
12
- optionTargetPath=optionTargetPath
13
- includeBlank=includeBlank
14
- multiple=multiple
15
- value=value
16
- options=options
17
- inputId=inputId
18
-
19
- isValid=isValid
20
- isInvalid=isInvalid
21
-
22
- update=update
23
- setDirty=setDirty
24
- }}
25
- {{else if (or (eq type "radioGroup") (eq type "radio-group"))}}
26
- {{component radioGroupComponent
27
- value=value
28
- options=options
29
- inputId=inputId
30
- name=(or inputName name)
31
- disabled=disabled
32
-
33
- isValid=isValid
34
- isInvalid=isInvalid
35
-
36
- update=update
37
- setDirty=setDirty
38
- }}
39
- {{else if (eq type "checkbox")}}
40
- {{component checkboxComponent
41
- value=value
42
- options=options
43
- inputId=inputId
44
- name=(or inputName name)
45
- disabled=disabled
46
-
47
- isValid=isValid
48
- isInvalid=isInvalid
49
-
50
- update=update
51
- setDirty=setDirty
52
-
53
- labelComponent=labelComponent
54
- }}
55
- {{else if (eq type "textarea")}}
56
- {{component textareaComponent
57
- inputId=inputId
58
- name=(or inputName name)
59
- value=value
60
- placeholder=placeholder
61
- disabled=disabled
62
- autofocus=autofocus
63
- autocomplete=autocomplete
64
- rows=rows
65
- cols=cols
66
-
67
- isValid=isValid
68
- isInvalid=isInvalid
69
-
70
- update=(action update value="target.value")
71
- setDirty=setDirty
72
- }}
73
- {{else}}
74
- {{component inputComponent
75
- type=type
76
- inputId=inputId
77
- name=(or inputName name)
78
- value=value
79
- placeholder=placeholder
80
- disabled=disabled
81
- autofocus=autofocus
82
- autocomplete=autocomplete
83
-
84
- isValid=isValid
85
- isInvalid=isInvalid
86
-
87
- update=(action update value="target.value")
88
- setDirty=setDirty
89
- }}
90
- {{/if}}
91
- </div>
92
-
93
- {{component hintComponent}}
94
- {{component errorComponent}}
@@ -1 +0,0 @@
1
- {{yield}}{{#each errors as |e i|}}{{unless (eq i 0) ", "}}{{e}}{{/each}}
@@ -1 +0,0 @@
1
- {{yield}}{{hint}}
@@ -1 +0,0 @@
1
- {{yield}}{{label}}{{if required " *"}}