@ember-eui/validated-form 7.1.5 → 8.0.0-beta.12

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 (174) hide show
  1. package/addon-main.js +5 -0
  2. package/declarations/components/validated-form/field-base/index.d.ts +37 -0
  3. package/declarations/components/validated-form/field-base/index.d.ts.map +1 -0
  4. package/declarations/components/validated-form/field-base.d.ts +56 -0
  5. package/declarations/components/validated-form/field-base.d.ts.map +1 -0
  6. package/declarations/components/validated-form/field-checkbox-group/index.d.ts +8 -0
  7. package/declarations/components/validated-form/field-checkbox-group/index.d.ts.map +1 -0
  8. package/declarations/components/validated-form/field-checkbox-group.d.ts +30 -0
  9. package/declarations/components/validated-form/field-checkbox-group.d.ts.map +1 -0
  10. package/declarations/components/validated-form/field-combo-box/index.d.ts +5 -0
  11. package/declarations/components/validated-form/field-combo-box/index.d.ts.map +1 -0
  12. package/declarations/components/validated-form/field-combo-box.d.ts +27 -0
  13. package/declarations/components/validated-form/field-combo-box.d.ts.map +1 -0
  14. package/declarations/components/validated-form/field-dual-range-slider/index.d.ts +5 -0
  15. package/declarations/components/validated-form/field-dual-range-slider/index.d.ts.map +1 -0
  16. package/declarations/components/validated-form/field-dual-range-slider.d.ts +32 -0
  17. package/declarations/components/validated-form/field-dual-range-slider.d.ts.map +1 -0
  18. package/{addon/components/validated-form/field-markdown-editor/index.js → declarations/components/validated-form/field-markdown-editor/index.d.ts} +3 -8
  19. package/declarations/components/validated-form/field-markdown-editor/index.d.ts.map +1 -0
  20. package/declarations/components/validated-form/field-markdown-editor.d.ts +25 -0
  21. package/declarations/components/validated-form/field-markdown-editor.d.ts.map +1 -0
  22. package/{addon/components/validated-form/field-number/index.js → declarations/components/validated-form/field-number/index.d.ts} +3 -2
  23. package/declarations/components/validated-form/field-number/index.d.ts.map +1 -0
  24. package/declarations/components/validated-form/field-number.d.ts +24 -0
  25. package/declarations/components/validated-form/field-number.d.ts.map +1 -0
  26. package/{addon/components/validated-form/field-password/index.js → declarations/components/validated-form/field-password/index.d.ts} +3 -2
  27. package/declarations/components/validated-form/field-password/index.d.ts.map +1 -0
  28. package/declarations/components/validated-form/field-password.d.ts +24 -0
  29. package/declarations/components/validated-form/field-password.d.ts.map +1 -0
  30. package/declarations/components/validated-form/field-radio-group/index.d.ts +8 -0
  31. package/declarations/components/validated-form/field-radio-group/index.d.ts.map +1 -0
  32. package/declarations/components/validated-form/field-radio-group.d.ts +29 -0
  33. package/declarations/components/validated-form/field-radio-group.d.ts.map +1 -0
  34. package/{addon/components/validated-form/field-range-slider/index.js → declarations/components/validated-form/field-range-slider/index.d.ts} +3 -2
  35. package/declarations/components/validated-form/field-range-slider/index.d.ts.map +1 -0
  36. package/declarations/components/validated-form/field-range-slider.d.ts +28 -0
  37. package/declarations/components/validated-form/field-range-slider.d.ts.map +1 -0
  38. package/{addon/components/validated-form/field-select/index.js → declarations/components/validated-form/field-select/index.d.ts} +3 -2
  39. package/declarations/components/validated-form/field-select/index.d.ts.map +1 -0
  40. package/declarations/components/validated-form/field-select.d.ts +23 -0
  41. package/declarations/components/validated-form/field-select.d.ts.map +1 -0
  42. package/declarations/components/validated-form/field-switch/index.d.ts +5 -0
  43. package/declarations/components/validated-form/field-switch/index.d.ts.map +1 -0
  44. package/declarations/components/validated-form/field-switch.d.ts +24 -0
  45. package/declarations/components/validated-form/field-switch.d.ts.map +1 -0
  46. package/{addon/components/validated-form/field-text/index.js → declarations/components/validated-form/field-text/index.d.ts} +3 -2
  47. package/declarations/components/validated-form/field-text/index.d.ts.map +1 -0
  48. package/{addon/components/validated-form/field-text-area/index.js → declarations/components/validated-form/field-text-area/index.d.ts} +3 -2
  49. package/declarations/components/validated-form/field-text-area/index.d.ts.map +1 -0
  50. package/declarations/components/validated-form/field-text-area.d.ts +29 -0
  51. package/declarations/components/validated-form/field-text-area.d.ts.map +1 -0
  52. package/declarations/components/validated-form/field-text.d.ts +22 -0
  53. package/declarations/components/validated-form/field-text.d.ts.map +1 -0
  54. package/declarations/components/validated-form/index.d.ts +30 -0
  55. package/declarations/components/validated-form/index.d.ts.map +1 -0
  56. package/declarations/components/validated-form.d.ts +91 -0
  57. package/declarations/components/validated-form.d.ts.map +1 -0
  58. package/declarations/utils/build-validation-messages.d.ts +13 -0
  59. package/declarations/utils/build-validation-messages.d.ts.map +1 -0
  60. package/declarations/utils/get-messages.d.ts +11 -0
  61. package/declarations/utils/get-messages.d.ts.map +1 -0
  62. package/declarations/utils/validation-errors.d.ts +2 -0
  63. package/declarations/utils/validation-errors.d.ts.map +1 -0
  64. package/declarations/utils/with-defaults.d.ts +10 -0
  65. package/declarations/utils/with-defaults.d.ts.map +1 -0
  66. package/declarations/validators/messages.d.ts +4 -0
  67. package/declarations/validators/messages.d.ts.map +1 -0
  68. package/dist/_app_/components/validated-form/field-base.js +1 -0
  69. package/dist/_app_/components/validated-form/field-checkbox-group.js +1 -0
  70. package/dist/_app_/components/validated-form/field-combo-box.js +1 -0
  71. package/dist/_app_/components/validated-form/field-dual-range-slider.js +1 -0
  72. package/dist/_app_/components/validated-form/field-markdown-editor.js +1 -0
  73. package/dist/_app_/components/validated-form/field-number.js +1 -0
  74. package/dist/_app_/components/validated-form/field-password.js +1 -0
  75. package/dist/_app_/components/validated-form/field-radio-group.js +1 -0
  76. package/dist/_app_/components/validated-form/field-range-slider.js +1 -0
  77. package/dist/_app_/components/validated-form/field-select.js +1 -0
  78. package/dist/_app_/components/validated-form/field-switch.js +1 -0
  79. package/dist/_app_/components/validated-form/field-text-area.js +1 -0
  80. package/dist/_app_/components/validated-form/field-text.js +1 -0
  81. package/dist/_app_/components/validated-form.js +1 -0
  82. package/dist/_app_/utils/build-validation-messages.js +1 -0
  83. package/dist/_app_/utils/get-messages.js +1 -0
  84. package/dist/_app_/utils/validation-errors.js +1 -0
  85. package/dist/_app_/utils/with-defaults.js +1 -0
  86. package/dist/_app_/validators/messages.js +1 -0
  87. package/dist/components/validated-form/field-base.js +7 -0
  88. package/dist/components/validated-form/field-base.js.map +1 -0
  89. package/dist/components/validated-form/field-checkbox-group.js +104 -0
  90. package/dist/components/validated-form/field-checkbox-group.js.map +1 -0
  91. package/dist/components/validated-form/field-combo-box.js +106 -0
  92. package/dist/components/validated-form/field-combo-box.js.map +1 -0
  93. package/dist/components/validated-form/field-dual-range-slider.js +112 -0
  94. package/dist/components/validated-form/field-dual-range-slider.js.map +1 -0
  95. package/dist/components/validated-form/field-markdown-editor.js +102 -0
  96. package/dist/components/validated-form/field-markdown-editor.js.map +1 -0
  97. package/dist/components/validated-form/field-number.js +94 -0
  98. package/dist/components/validated-form/field-number.js.map +1 -0
  99. package/dist/components/validated-form/field-password.js +87 -0
  100. package/dist/components/validated-form/field-password.js.map +1 -0
  101. package/dist/components/validated-form/field-radio-group.js +102 -0
  102. package/dist/components/validated-form/field-radio-group.js.map +1 -0
  103. package/dist/components/validated-form/field-range-slider.js +119 -0
  104. package/dist/components/validated-form/field-range-slider.js.map +1 -0
  105. package/dist/components/validated-form/field-select.js +88 -0
  106. package/dist/components/validated-form/field-select.js.map +1 -0
  107. package/dist/components/validated-form/field-switch.js +87 -0
  108. package/dist/components/validated-form/field-switch.js.map +1 -0
  109. package/dist/components/validated-form/field-text-area.js +80 -0
  110. package/dist/components/validated-form/field-text-area.js.map +1 -0
  111. package/dist/components/validated-form/field-text.js +90 -0
  112. package/dist/components/validated-form/field-text.js.map +1 -0
  113. package/dist/components/validated-form.js +303 -0
  114. package/dist/components/validated-form.js.map +1 -0
  115. package/dist/field-base-t4F7Xj_I.js +185 -0
  116. package/dist/field-base-t4F7Xj_I.js.map +1 -0
  117. package/{addon → dist}/utils/build-validation-messages.js +13 -36
  118. package/dist/utils/build-validation-messages.js.map +1 -0
  119. package/{addon → dist}/utils/get-messages.js +6 -7
  120. package/dist/utils/get-messages.js.map +1 -0
  121. package/dist/utils/validation-errors.js +18 -0
  122. package/dist/utils/validation-errors.js.map +1 -0
  123. package/{addon → dist}/utils/with-defaults.js +5 -2
  124. package/dist/utils/with-defaults.js.map +1 -0
  125. package/dist/validators/messages.js +7 -0
  126. package/dist/validators/messages.js.map +1 -0
  127. package/package.json +116 -75
  128. package/addon/components/validated-form/field-base/index.js +0 -144
  129. package/addon/components/validated-form/field-checkbox-group/index.hbs +0 -47
  130. package/addon/components/validated-form/field-checkbox-group/index.js +0 -42
  131. package/addon/components/validated-form/field-combo-box/index.hbs +0 -65
  132. package/addon/components/validated-form/field-combo-box/index.js +0 -12
  133. package/addon/components/validated-form/field-dual-range-slider/index.hbs +0 -80
  134. package/addon/components/validated-form/field-dual-range-slider/index.js +0 -12
  135. package/addon/components/validated-form/field-markdown-editor/index.hbs +0 -61
  136. package/addon/components/validated-form/field-number/index.hbs +0 -63
  137. package/addon/components/validated-form/field-password/index.hbs +0 -56
  138. package/addon/components/validated-form/field-radio-group/index.hbs +0 -45
  139. package/addon/components/validated-form/field-radio-group/index.js +0 -39
  140. package/addon/components/validated-form/field-range-slider/index.hbs +0 -93
  141. package/addon/components/validated-form/field-select/index.hbs +0 -57
  142. package/addon/components/validated-form/field-switch/index.hbs +0 -48
  143. package/addon/components/validated-form/field-switch/index.js +0 -12
  144. package/addon/components/validated-form/field-text/index.hbs +0 -59
  145. package/addon/components/validated-form/field-text-area/index.hbs +0 -54
  146. package/addon/components/validated-form/index.hbs +0 -158
  147. package/addon/components/validated-form/index.js +0 -132
  148. package/addon/utils/validation-errors.js +0 -13
  149. package/addon/validators/messages.js +0 -4
  150. package/app/components/validated-form/field-base/index.js +0 -1
  151. package/app/components/validated-form/field-checkbox-group/index.js +0 -1
  152. package/app/components/validated-form/field-combo-box/index.js +0 -1
  153. package/app/components/validated-form/field-dual-range-slider/index.js +0 -1
  154. package/app/components/validated-form/field-markdown-editor/index.js +0 -1
  155. package/app/components/validated-form/field-number/index.js +0 -1
  156. package/app/components/validated-form/field-password/index.js +0 -1
  157. package/app/components/validated-form/field-radio-group/index.js +0 -1
  158. package/app/components/validated-form/field-range-slider/index.js +0 -1
  159. package/app/components/validated-form/field-select/index.js +0 -1
  160. package/app/components/validated-form/field-switch/index.js +0 -1
  161. package/app/components/validated-form/field-text/index.js +0 -1
  162. package/app/components/validated-form/field-text-area/index.js +0 -1
  163. package/app/components/validated-form/index.js +0 -1
  164. package/app/utils/build-validation-messages.js +0 -1
  165. package/app/utils/get-messages.js +0 -1
  166. package/app/utils/validation-errors.js +0 -1
  167. package/app/validators/messages.js +0 -1
  168. package/config/environment.js +0 -5
  169. package/docs/validated-form-demo/demo1.md +0 -162
  170. package/docs/validated-form.md +0 -1
  171. package/index.js +0 -5
  172. package/tsconfig.json +0 -27
  173. package/types/dummy/index.d.ts +0 -1
  174. package/types/global.d.ts +0 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/validated-form",
3
- "version": "7.1.5",
3
+ "version": "8.0.0-beta.12",
4
4
  "description": "The default blueprint for ember-cli addons.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -13,91 +13,109 @@
13
13
  "test": "tests"
14
14
  },
15
15
  "scripts": {
16
- "build": "ember build --environment=production",
17
- "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
18
- "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
19
- "lint:hbs": "ember-template-lint .",
20
- "lint:hbs:fix": "ember-template-lint . --fix",
16
+ "build": "concurrently 'npm:build:*'",
17
+ "build:js": "rollup --config",
18
+ "build:types": "glint --declaration",
19
+ "lint": "eslint . --cache",
20
+ "lint:fix": "eslint . --fix",
21
21
  "lint:js": "eslint . --cache",
22
22
  "lint:js:fix": "eslint . --fix",
23
- "start": "ember serve",
24
- "test": "npm-run-all lint test:*",
25
- "test:ember": "ember test",
26
- "test:ember-compatibility": "ember try:each",
27
- "prepack": "ember ts:precompile",
28
- "postpack": "ember ts:clean"
23
+ "prepublishOnly": "pnpm run build",
24
+ "start": "concurrently 'npm:start:*'",
25
+ "start:js": "rollup --config --watch",
26
+ "start:types": "glint --build --watch"
29
27
  },
28
+ "exports": {
29
+ ".": {
30
+ "types": "./declarations/index.d.ts",
31
+ "default": "./dist/index.js"
32
+ },
33
+ "./*": {
34
+ "types": "./declarations/*.d.ts",
35
+ "default": "./dist/*.js"
36
+ },
37
+ "./addon-main.js": "./addon-main.js"
38
+ },
39
+ "files": [
40
+ "addon-main.js",
41
+ "declarations",
42
+ "dist"
43
+ ],
30
44
  "dependencies": {
31
- "@ember-eui/core": "^7.1.5",
32
- "ember-cli-babel": "^7.26.11",
33
- "ember-cli-htmlbars": "^6.0.1",
34
- "ember-cli-typescript": "4.2.1",
35
- "ember-composable-helpers": "^4.4.1",
36
- "ember-named-blocks-polyfill": "^0.2.3",
45
+ "@ember/render-modifiers": "^2.1.0",
46
+ "@embroider/util": "^1.12.0",
47
+ "ember-auto-import": "^2.6.3",
48
+ "ember-composable-helpers": "^5.0.0",
49
+ "ember-modifier": "^4.1.0",
37
50
  "ember-svg-jar": "^2.3.4",
51
+ "ember-truth-helpers": "^4.0.3",
38
52
  "ember-unique-id-helper-polyfill": "^1.2.2",
39
53
  "ember-validators": "^4.1.2"
40
54
  },
55
+ "peerDependencies": {
56
+ "@ember-eui/core": "^8.0.0-beta.11",
57
+ "@glimmer/component": "^1.1.2",
58
+ "@glimmer/tracking": "^1.1.2"
59
+ },
41
60
  "devDependencies": {
61
+ "@babel/core": "^7.23.2",
62
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
63
+ "@babel/plugin-proposal-decorators": "^7.17.9",
64
+ "@babel/plugin-transform-class-static-block": "^7.20.0",
65
+ "@babel/plugin-transform-typescript": "^7.12.13",
66
+ "@babel/preset-typescript": "^7.18.6",
67
+ "@ember-eui/core": "^8.0.0-beta.12",
42
68
  "@ember/optional-features": "^2.0.0",
43
- "@ember/test-helpers": "^2.6.0",
44
- "@embroider/test-setup": "^1.5.0",
45
- "@embroider/util": "^1.5.0",
46
- "@glimmer/component": "^1.0.4",
47
- "@glimmer/tracking": "^1.0.4",
48
- "@types/ember-qunit": "^5.0.0",
69
+ "@ember/test-helpers": "^3.2.0",
70
+ "@embroider/addon-dev": "^4.1.1",
71
+ "@embroider/test-setup": "^3.0.2",
72
+ "@glimmer/component": "^1.1.2",
73
+ "@glimmer/tracking": "^1.1.2",
74
+ "@glint/core": "^1.2.0",
75
+ "@glint/environment-ember-loose": "^1.2.0",
76
+ "@glint/environment-ember-template-imports": "^1.2.0",
77
+ "@glint/template": "^1.2.0",
78
+ "@rollup/plugin-babel": "^6.0.4",
79
+ "@rollup/plugin-node-resolve": "^15.2.3",
80
+ "@tsconfig/ember": "3.0.0",
81
+ "@types/ember": "^4.0.4",
49
82
  "@types/ember-resolver": "^5.0.11",
50
- "@types/ember__application": "^4.0.0",
51
- "@types/ember__array": "^4.0.1",
52
- "@types/ember__component": "^4.0.4",
53
- "@types/ember__controller": "^4.0.0",
54
- "@types/ember__debug": "^4.0.0",
55
- "@types/ember__engine": "^4.0.0",
56
- "@types/ember__error": "^4.0.0",
57
- "@types/ember__object": "^4.0.0",
58
- "@types/ember__polyfills": "^4.0.0",
59
- "@types/ember__routing": "^4.0.3",
60
- "@types/ember__runloop": "^4.0.0",
61
- "@types/ember__service": "^4.0.0",
62
- "@types/ember__string": "^3.0.9",
63
- "@types/ember__template": "^4.0.0",
64
- "@types/ember__test": "^4.0.0",
65
- "@types/ember__utils": "^4.0.0",
66
- "@types/htmlbars-inline-precompile": "^3.0.0",
67
- "@types/qunit": "^2.11.3",
68
- "@types/rsvp": "^4.0.4",
69
- "babel-eslint": "^10.1.0",
70
- "broccoli-asset-rev": "^3.0.0",
71
- "ember-auto-import": "^2.4.0",
83
+ "@types/ember__application": "^4.0.6",
84
+ "@types/ember__array": "^4.0.4",
85
+ "@types/ember__component": "^4.0.14",
86
+ "@types/ember__controller": "^4.0.5",
87
+ "@types/ember__debug": "^4.0.4",
88
+ "@types/ember__destroyable": "^4.0.3",
89
+ "@types/ember__engine": "^4.0.5",
90
+ "@types/ember__error": "^4.0.3",
91
+ "@types/ember__helper": "^4.0.3",
92
+ "@types/ember__modifier": "^4.0.6",
93
+ "@types/ember__object": "^4.0.6",
94
+ "@types/ember__owner": "^4.0.4",
95
+ "@types/ember__polyfills": "^4.0.2",
96
+ "@types/ember__routing": "^4.0.13",
97
+ "@types/ember__runloop": "^4.0.3",
98
+ "@types/ember__service": "^4.0.3",
99
+ "@types/ember__string": "^3.16.3",
100
+ "@types/ember__template": "^4.0.2",
101
+ "@types/ember__test": "^4.0.2",
102
+ "@types/ember__utils": "^4.0.3",
103
+ "babel-plugin-ember-template-compilation": "^2.2.1",
104
+ "concurrently": "^8.2.2",
72
105
  "ember-cli": "~4.1.1",
73
- "ember-cli-dependency-checker": "^3.2.0",
74
- "ember-cli-inject-live-reload": "^2.1.0",
75
- "ember-cli-sri": "^2.1.1",
76
- "ember-cli-terser": "^4.0.2",
77
- "ember-cli-typescript-blueprints": "^3.0.0",
78
- "ember-disable-prototype-extensions": "^1.1.3",
79
- "ember-export-application-global": "^2.0.1",
80
- "ember-load-initializers": "^2.1.2",
81
- "ember-page-title": "^7.0.0",
82
- "ember-qunit": "^5.1.5",
83
- "ember-resolver": "^8.0.3",
84
- "ember-source": "~4.1.0",
85
- "ember-source-channel-url": "^3.0.0",
86
- "ember-template-lint": "^3.15.0",
87
- "ember-try": "^2.0.0",
88
- "eslint": "^7.32.0",
89
- "eslint-config-prettier": "^8.3.0",
90
- "eslint-plugin-ember": "^10.5.8",
106
+ "ember-source": "~4.2.0",
107
+ "ember-template-imports": "^3.4.2",
108
+ "ember-template-lint": "^5.11.2",
109
+ "eslint": "^8.31.0",
110
+ "eslint-config-prettier": "^8.5.0",
111
+ "eslint-plugin-ember": "^11.6.0",
91
112
  "eslint-plugin-node": "^11.1.0",
92
- "eslint-plugin-prettier": "^4.0.0",
93
- "eslint-plugin-qunit": "^7.2.0",
94
- "loader.js": "^4.7.0",
95
- "npm-run-all": "^4.1.5",
96
- "prettier": "^2.5.1",
97
- "qunit": "^2.17.2",
98
- "qunit-dom": "^2.0.0",
99
- "typescript": "^4.5.5",
100
- "webpack": "^5.65.0"
113
+ "rollup": "~4.3.0",
114
+ "rollup-plugin-copy": "^3.5.0",
115
+ "rollup-plugin-glimmer-template-tag": "^0.4.1",
116
+ "rollup-plugin-ts": "^3.0.2",
117
+ "typescript": "~5.0.3",
118
+ "webpack": "^5.89.0"
101
119
  },
102
120
  "engines": {
103
121
  "node": "12.* || 14.* || >= 16"
@@ -109,10 +127,33 @@
109
127
  "access": "public"
110
128
  },
111
129
  "ember-addon": {
112
- "configPath": "tests/dummy/config"
130
+ "version": 2,
131
+ "type": "addon",
132
+ "main": "addon-main.js",
133
+ "app-js": {
134
+ "./components/validated-form.js": "./dist/_app_/components/validated-form.js",
135
+ "./components/validated-form/field-base.js": "./dist/_app_/components/validated-form/field-base.js",
136
+ "./components/validated-form/field-checkbox-group.js": "./dist/_app_/components/validated-form/field-checkbox-group.js",
137
+ "./components/validated-form/field-combo-box.js": "./dist/_app_/components/validated-form/field-combo-box.js",
138
+ "./components/validated-form/field-dual-range-slider.js": "./dist/_app_/components/validated-form/field-dual-range-slider.js",
139
+ "./components/validated-form/field-markdown-editor.js": "./dist/_app_/components/validated-form/field-markdown-editor.js",
140
+ "./components/validated-form/field-number.js": "./dist/_app_/components/validated-form/field-number.js",
141
+ "./components/validated-form/field-password.js": "./dist/_app_/components/validated-form/field-password.js",
142
+ "./components/validated-form/field-radio-group.js": "./dist/_app_/components/validated-form/field-radio-group.js",
143
+ "./components/validated-form/field-range-slider.js": "./dist/_app_/components/validated-form/field-range-slider.js",
144
+ "./components/validated-form/field-select.js": "./dist/_app_/components/validated-form/field-select.js",
145
+ "./components/validated-form/field-switch.js": "./dist/_app_/components/validated-form/field-switch.js",
146
+ "./components/validated-form/field-text-area.js": "./dist/_app_/components/validated-form/field-text-area.js",
147
+ "./components/validated-form/field-text.js": "./dist/_app_/components/validated-form/field-text.js",
148
+ "./utils/build-validation-messages.js": "./dist/_app_/utils/build-validation-messages.js",
149
+ "./utils/get-messages.js": "./dist/_app_/utils/get-messages.js",
150
+ "./utils/validation-errors.js": "./dist/_app_/utils/validation-errors.js",
151
+ "./utils/with-defaults.js": "./dist/_app_/utils/with-defaults.js",
152
+ "./validators/messages.js": "./dist/_app_/validators/messages.js"
153
+ }
113
154
  },
114
155
  "volta": {
115
156
  "extends": "../../package.json"
116
157
  },
117
- "gitHead": "3f2111a93c8afa11a1fad3623e33acefdcad68a5"
158
+ "gitHead": "1ef2133c63c1ba29b2f3f5f56f8e1e9ffa17587e"
118
159
  }
@@ -1,144 +0,0 @@
1
- import Component from '@glimmer/component';
2
- import { tracked } from '@glimmer/tracking';
3
- import {
4
- buildValidationMessages,
5
- notifyValidityChange
6
- } from '../../../utils/build-validation-messages';
7
- import { action } from '@ember/object';
8
- import { later } from '@ember/runloop';
9
-
10
- export default class ValidatedFormFieldBase extends Component {
11
- validationProperty = 'args.value';
12
-
13
- //cache for comparing
14
- lastIsValid;
15
- lastIsTouched;
16
-
17
- @tracked _validationErrorMessages = null;
18
-
19
- @tracked isTouched = false;
20
-
21
- get validations() {
22
- return this.args.validations || {};
23
- }
24
-
25
- get hasErrorMessages() {
26
- return this._validationErrorMessages?.length || this.error?.length > 0;
27
- }
28
-
29
- get isValid() {
30
- return !this.isInvalid;
31
- }
32
-
33
- get isInvalid() {
34
- return this.hasErrorMessages;
35
- }
36
-
37
- get isInvalidAndTouched() {
38
- return this.isInvalid && this.isTouched;
39
- }
40
-
41
- get formHasBeenValidated() {
42
- return this.isTouched;
43
- }
44
-
45
- set formHasBeenValidated(value) {
46
- this.isTouched = value;
47
- }
48
-
49
- get customValidations() {
50
- return this.args.customValidations || [];
51
- }
52
-
53
- get rowExtra() {
54
- return this.args.rowExtra || {};
55
- }
56
-
57
- get label() {
58
- return this.args.label || '';
59
- }
60
-
61
- get error() {
62
- return this.args.error || [];
63
- }
64
-
65
- get options() {
66
- return this.args.options || [];
67
- }
68
-
69
- get validationErrorMessages() {
70
- let error = [];
71
- if (this.error.length > 0) {
72
- error.push(...this.error);
73
- }
74
-
75
- if (
76
- this._validationErrorMessages &&
77
- this._validationErrorMessages.length > 0
78
- ) {
79
- error.push(...this._validationErrorMessages);
80
- }
81
-
82
- if (error.length === 0) {
83
- return null;
84
- }
85
-
86
- return error;
87
- }
88
-
89
- constructor() {
90
- super(...arguments);
91
- this.args.register?.(this);
92
- }
93
-
94
- //Should be executed by the child on start
95
- @action
96
- setValidationMessages() {
97
- this._validationErrorMessages = buildValidationMessages.call(
98
- this,
99
- this.validationProperty
100
- );
101
- }
102
-
103
- //Should be executed by the child on value update
104
- @action
105
- didUpdateValue() {
106
- later(() => {
107
- if (!this.isDestroyed && !this.isDestroying) {
108
- this.setValidationMessages();
109
- this.notifyValidityChange();
110
- }
111
- });
112
- }
113
-
114
- @action
115
- notifyValidityChange() {
116
- notifyValidityChange(this, this.args.onValidityChange);
117
- }
118
-
119
- @action
120
- setIsTouched(val) {
121
- this.isTouched = val;
122
- this.notifyValidityChange();
123
- }
124
-
125
- /**
126
- * This is just a default handleChange, you should override this method
127
- * if you need to or use whatever mechanism to bubble the changed
128
- * value outside and then notifyValidityChanges
129
- *
130
- * @override
131
- * @param {*} e
132
- */
133
- @action
134
- handleChange(e) {
135
- const value = e.target.value;
136
- this.args.onChange(value);
137
- this.notifyValidityChange();
138
- }
139
-
140
- willDestroy() {
141
- super.willDestroy(...arguments);
142
- this.args.unregister?.(this);
143
- }
144
- }
@@ -1,47 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
-
26
- <:field>
27
- <EuiCheckboxGroup
28
- class={{@fieldClasses}}
29
- @formId={{@formId}}
30
- @valueKey={{@valueKey}}
31
- @labelKey={{@labelKey}}
32
- aria-label={{@ariaLabel}}
33
- @disabled={{@disabled}}
34
- @compressed={{@compressed}}
35
- @isInvalid={{this.isInvalidAndTouched}}
36
- @options={{this.options}}
37
- @idToSelectedMap={{this.arrayToMap}}
38
- @legend={{@legend}}
39
- {{!template-lint-disable}}
40
- @id={{theId}}
41
- @onChange={{this.handleChange}}
42
- autofocus={{@autofocus}}
43
- ...attributes
44
- />
45
- </:field>
46
- </EuiFormRow>
47
- {{/let}}
@@ -1,42 +0,0 @@
1
- import ValidatedFormFieldBase from '../field-base';
2
- import { action } from '@ember/object';
3
- import { maybeUnwrapProxy } from '@ember-eui/core/utils/maybe-unwrap-proxy';
4
-
5
- export default class ValidatedFormFieldCheckboxGroup extends ValidatedFormFieldBase {
6
- get value() {
7
- let value = maybeUnwrapProxy(this.args.value);
8
- return value?.toArray?.() || value;
9
- }
10
-
11
- get arrayToMap() {
12
- const currArr = this.value || [];
13
- return this.transformToMap(currArr);
14
- }
15
-
16
- transformToMap(value = []) {
17
- let valuesMap = value.reduce((acc, val) => {
18
- acc[val] = true;
19
- return acc;
20
- }, {});
21
- return valuesMap;
22
- }
23
-
24
- @action
25
- handleChange(optionId) {
26
- let value = this.value || [];
27
-
28
- const found = value.find((v) => v === optionId);
29
- let newArr = [];
30
-
31
- if (found) {
32
- newArr = value.filter((v) => v !== optionId);
33
- } else {
34
- newArr = [...value, optionId];
35
- }
36
-
37
- this.args.onChange?.(newArr);
38
-
39
- this.notifyValidityChange();
40
- this.isTouched = true;
41
- }
42
- }
@@ -1,65 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @selectedOptions}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
- <:field>
26
- <EuiComboBox
27
- class={{@fieldClasses}}
28
- @onChange={{this.handleChange}}
29
- @dropdownClass={{@dropdownClass}}
30
- @placeholder={{@placeholder}}
31
- @options={{this.options}}
32
- @singleSelection={{@singleSelection}}
33
- @selectedOptions={{@selectedOptions}}
34
- @searchEnabled={{arg-or-default @searchEnabled true}}
35
- @searchField={{@searchField}}
36
- @seachMessage={{@searchMessage}}
37
- @search={{@search}}
38
- aria-label={{@ariaLabel}}
39
- form={{@formId}}
40
- @isInvalid={{this.isInvalidAndTouched}}
41
- @isClearable={{@isClearable}}
42
- @fullWidth={{@fullWidth}}
43
- @isLoading={{@isLoading}}
44
- @readOnly={{@readOnly}}
45
- @controlOnly={{@controlOnly}}
46
- @compressed={{@compressed}}
47
- {{!template-lint-disable}}
48
- @id={{theId}}
49
- @onCreateOption={{@onCreateOption}}
50
- @customOptionText={{@customOptionText}}
51
- @onBlur={{queue (fn this.setIsTouched true) (optional @onBlur)}}
52
- @onFocus={{@onFocus}}
53
- @onClose={{@onClose}}
54
- @onOpen={{@onOpen}}
55
- @isDisabled={{@isDisabled}}
56
- @renderInPlace={{@renderInPlace}}
57
- @extra={{@extra}}
58
- ...attributes
59
- as |opt index select|
60
- >
61
- {{yield opt index select}}
62
- </EuiComboBox>
63
- </:field>
64
- </EuiFormRow>
65
- {{/let}}
@@ -1,12 +0,0 @@
1
- import ValidatedFormFieldBase from '../field-base';
2
- import { action } from '@ember/object';
3
-
4
- export default class ValidatedFormFieldComboBox extends ValidatedFormFieldBase {
5
- validationProperty = 'args.selectedOptions';
6
-
7
- @action
8
- handleChange(options) {
9
- this.args.onChange(options);
10
- this.notifyValidityChange();
11
- }
12
- }
@@ -1,80 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
-
26
- <:field>
27
- <EuiDualRange
28
- class={{@fieldClasses}}
29
- form={{@formId}}
30
- @value={{@value}}
31
- @fullWidth={{@fullWidth}}
32
- @isInvalid={{this.isInvalidAndTouched}}
33
- @levels={{@levels}}
34
- @showLabels={{@showLabels}}
35
- @showInput={{@showInput}}
36
- @tickInternval={{@tickInternval}}
37
- @ticks={{@ticks}}
38
- aria-label={{@ariaLabel}}
39
- @disabled={{@disabled}}
40
- @compressed={{@compressed}}
41
- @hasFocus={{@hasFocus}}
42
- @showRange={{@showRange}}
43
- @showTicks={{@showTicks}}
44
- @readOnly={{@readOnly}}
45
- @id={{theId}}
46
- @step={{@step}}
47
- @showValue={{@showValue}}
48
- @onChange={{this.handleChange}}
49
- @max={{@max}}
50
- @isLoading={{@isLoading}}
51
- @min={{@min}}
52
- @icon={{@icon}}
53
- @side={{@side}}
54
- @inputRef={{@inputRef}}
55
- @controlOnly={{@controlOnly}}
56
- @autoSize={{@autoSize}}
57
- @isPrependProvided={{has-block "prepend"}}
58
- @isAppendProvided={{has-block "append"}}
59
- @isFakeMinBlock={{not (has-block "min")}}
60
- @isFakeMaxBlock={{not (has-block "max")}}
61
- autofocus={{@autofocus}}
62
- ...attributes
63
- {{on "blur" (fn this.setIsTouched true)}}
64
- >
65
- <:prepend as |classes|>
66
- {{yield classes to="prepend"}}
67
- </:prepend>
68
- <:min>
69
- {{yield to="min"}}
70
- </:min>
71
- <:max>
72
- {{yield to="max"}}
73
- </:max>
74
- <:append as |classes|>
75
- {{yield classes to="append"}}
76
- </:append>
77
- </EuiDualRange>
78
- </:field>
79
- </EuiFormRow>
80
- {{/let}}
@@ -1,12 +0,0 @@
1
- import ValidatedFormFieldBase from '../field-base';
2
- import { action } from '@ember/object';
3
-
4
- export default class ValidatedFormFieldRangeSlider extends ValidatedFormFieldBase {
5
- @action
6
- handleChange(e) {
7
- // The received event for the dual range is an array with [min, max] as strings
8
- const value = [Number(e[0]), Number(e[1])];
9
- this.args.onChange(value);
10
- this.notifyValidityChange();
11
- }
12
- }