@hokulea/ember 0.0.3 → 0.0.4

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 (401) hide show
  1. package/README.md +56 -0
  2. package/declarations/-private/form/components/description.d.ts +10 -0
  3. package/declarations/-private/form/components/description.d.ts.map +1 -0
  4. package/declarations/-private/form/components/errors.d.ts +15 -0
  5. package/declarations/-private/form/components/errors.d.ts.map +1 -0
  6. package/declarations/-private/form/components/field.d.ts +141 -0
  7. package/declarations/-private/form/components/field.d.ts.map +1 -0
  8. package/declarations/-private/form/components/fields/checkbox.d.ts +15 -0
  9. package/declarations/-private/form/components/fields/checkbox.d.ts.map +1 -0
  10. package/declarations/-private/form/components/fields/currency.d.ts +15 -0
  11. package/declarations/-private/form/components/fields/currency.d.ts.map +1 -0
  12. package/declarations/-private/form/components/fields/date.d.ts +15 -0
  13. package/declarations/-private/form/components/fields/date.d.ts.map +1 -0
  14. package/declarations/-private/form/components/fields/email.d.ts +15 -0
  15. package/declarations/-private/form/components/fields/email.d.ts.map +1 -0
  16. package/declarations/-private/form/components/fields/list.d.ts +27 -0
  17. package/declarations/-private/form/components/fields/list.d.ts.map +1 -0
  18. package/declarations/-private/form/components/fields/multiple-choice.d.ts +58 -0
  19. package/declarations/-private/form/components/fields/multiple-choice.d.ts.map +1 -0
  20. package/declarations/-private/form/components/fields/number.d.ts +15 -0
  21. package/declarations/-private/form/components/fields/number.d.ts.map +1 -0
  22. package/declarations/-private/form/components/fields/password.d.ts +15 -0
  23. package/declarations/-private/form/components/fields/password.d.ts.map +1 -0
  24. package/declarations/-private/form/components/fields/phone.d.ts +15 -0
  25. package/declarations/-private/form/components/fields/phone.d.ts.map +1 -0
  26. package/declarations/-private/form/components/fields/select.d.ts +16 -0
  27. package/declarations/-private/form/components/fields/select.d.ts.map +1 -0
  28. package/declarations/-private/form/components/fields/singular-choice.d.ts +56 -0
  29. package/declarations/-private/form/components/fields/singular-choice.d.ts.map +1 -0
  30. package/declarations/-private/form/components/fields/stories-utils.d.ts +50 -0
  31. package/declarations/-private/form/components/fields/stories-utils.d.ts.map +1 -0
  32. package/declarations/-private/form/components/fields/text-area.d.ts +15 -0
  33. package/declarations/-private/form/components/fields/text-area.d.ts.map +1 -0
  34. package/declarations/-private/form/components/fields/text.d.ts +15 -0
  35. package/declarations/-private/form/components/fields/text.d.ts.map +1 -0
  36. package/declarations/-private/form/components/label.d.ts +16 -0
  37. package/declarations/-private/form/components/label.d.ts.map +1 -0
  38. package/declarations/-private/form/components/reset.d.ts +24 -0
  39. package/declarations/-private/form/components/reset.d.ts.map +1 -0
  40. package/declarations/-private/form/components/submit.d.ts +24 -0
  41. package/declarations/-private/form/components/submit.d.ts.map +1 -0
  42. package/declarations/-private/form/index.d.ts +49 -0
  43. package/declarations/-private/form/index.d.ts.map +1 -0
  44. package/declarations/-private/form/modifiers/capture-events.d.ts +21 -0
  45. package/declarations/-private/form/modifiers/capture-events.d.ts.map +1 -0
  46. package/declarations/-private/form/modifiers/manage-validation.d.ts +21 -0
  47. package/declarations/-private/form/modifiers/manage-validation.d.ts.map +1 -0
  48. package/declarations/-private/helpers.d.ts +10 -0
  49. package/declarations/-private/helpers.d.ts.map +1 -0
  50. package/declarations/-private/modifiers/disabled.d.ts +20 -0
  51. package/declarations/-private/modifiers/disabled.d.ts.map +1 -0
  52. package/declarations/components/-input.d.ts +7 -0
  53. package/declarations/components/-input.d.ts.map +1 -0
  54. package/declarations/components/-menu.d.ts +22 -0
  55. package/declarations/components/-menu.d.ts.map +1 -0
  56. package/declarations/components/app-header.d.ts +49 -0
  57. package/declarations/components/app-header.d.ts.map +1 -0
  58. package/declarations/components/box.d.ts +16 -0
  59. package/declarations/components/box.d.ts.map +1 -0
  60. package/declarations/components/button.d.ts +26 -0
  61. package/declarations/components/button.d.ts.map +1 -0
  62. package/declarations/components/card.d.ts +13 -0
  63. package/declarations/components/card.d.ts.map +1 -0
  64. package/declarations/components/checkbox.d.ts +9 -0
  65. package/declarations/components/checkbox.d.ts.map +1 -0
  66. package/declarations/components/currency-input.d.ts +9 -0
  67. package/declarations/components/currency-input.d.ts.map +1 -0
  68. package/declarations/components/date-input.d.ts +9 -0
  69. package/declarations/components/date-input.d.ts.map +1 -0
  70. package/declarations/components/dialog.d.ts +26 -0
  71. package/declarations/components/dialog.d.ts.map +1 -0
  72. package/declarations/components/email-input.d.ts +9 -0
  73. package/declarations/components/email-input.d.ts.map +1 -0
  74. package/declarations/components/form.d.ts +312 -0
  75. package/declarations/components/form.d.ts.map +1 -0
  76. package/declarations/components/icon-button.d.ts +27 -0
  77. package/declarations/components/icon-button.d.ts.map +1 -0
  78. package/declarations/components/icon.d.ts +13698 -0
  79. package/declarations/components/icon.d.ts.map +1 -0
  80. package/declarations/components/input-builder.d.ts +29 -0
  81. package/declarations/components/input-builder.d.ts.map +1 -0
  82. package/declarations/components/list.d.ts +51 -0
  83. package/declarations/components/list.d.ts.map +1 -0
  84. package/declarations/components/list.stories copy.d.ts +27 -0
  85. package/declarations/components/list.stories copy.d.ts.map +1 -0
  86. package/declarations/components/main.d.ts +18 -0
  87. package/declarations/components/main.d.ts.map +1 -0
  88. package/declarations/components/menu.d.ts +36 -0
  89. package/declarations/components/menu.d.ts.map +1 -0
  90. package/declarations/components/menu.stories copy.d.ts +25 -0
  91. package/declarations/components/menu.stories copy.d.ts.map +1 -0
  92. package/declarations/components/number-input.d.ts +9 -0
  93. package/declarations/components/number-input.d.ts.map +1 -0
  94. package/declarations/components/page copy.d.ts +17 -0
  95. package/declarations/components/page copy.d.ts.map +1 -0
  96. package/declarations/components/page-header.d.ts +16 -0
  97. package/declarations/components/page-header.d.ts.map +1 -0
  98. package/declarations/components/page.d.ts +32 -0
  99. package/declarations/components/page.d.ts.map +1 -0
  100. package/declarations/components/password-input.d.ts +9 -0
  101. package/declarations/components/password-input.d.ts.map +1 -0
  102. package/declarations/components/phone-input.d.ts +9 -0
  103. package/declarations/components/phone-input.d.ts.map +1 -0
  104. package/declarations/components/popover.d.ts +10 -0
  105. package/declarations/components/popover.d.ts.map +1 -0
  106. package/declarations/components/radio.d.ts +9 -0
  107. package/declarations/components/radio.d.ts.map +1 -0
  108. package/declarations/components/section.d.ts +19 -0
  109. package/declarations/components/section.d.ts.map +1 -0
  110. package/declarations/components/section.stories copy.d.ts +18 -0
  111. package/declarations/components/section.stories copy.d.ts.map +1 -0
  112. package/declarations/components/select.d.ts +36 -0
  113. package/declarations/components/select.d.ts.map +1 -0
  114. package/declarations/components/test.d.ts +26 -0
  115. package/declarations/components/test.d.ts.map +1 -0
  116. package/declarations/components/text-area.d.ts +9 -0
  117. package/declarations/components/text-area.d.ts.map +1 -0
  118. package/declarations/components/text-input.d.ts +9 -0
  119. package/declarations/components/text-input.d.ts.map +1 -0
  120. package/declarations/helpers/popover.d.ts +30 -0
  121. package/declarations/helpers/popover.d.ts.map +1 -0
  122. package/declarations/index.d.ts +27 -0
  123. package/declarations/index.d.ts.map +1 -0
  124. package/declarations/modifiers/popover.d.ts +31 -0
  125. package/declarations/modifiers/popover.d.ts.map +1 -0
  126. package/declarations/src/-private/form/components/description.d.ts +11 -0
  127. package/declarations/src/-private/form/components/description.d.ts.map +1 -0
  128. package/declarations/src/-private/form/components/errors.d.ts +15 -0
  129. package/declarations/src/-private/form/components/errors.d.ts.map +1 -0
  130. package/declarations/src/-private/form/components/field.d.ts +141 -0
  131. package/declarations/src/-private/form/components/field.d.ts.map +1 -0
  132. package/declarations/src/-private/form/components/fields/checkbox.d.ts +15 -0
  133. package/declarations/src/-private/form/components/fields/checkbox.d.ts.map +1 -0
  134. package/declarations/src/-private/form/components/fields/currency.d.ts +15 -0
  135. package/declarations/src/-private/form/components/fields/currency.d.ts.map +1 -0
  136. package/declarations/src/-private/form/components/fields/date.d.ts +15 -0
  137. package/declarations/src/-private/form/components/fields/date.d.ts.map +1 -0
  138. package/declarations/src/-private/form/components/fields/email.d.ts +15 -0
  139. package/declarations/src/-private/form/components/fields/email.d.ts.map +1 -0
  140. package/declarations/src/-private/form/components/fields/list.d.ts +27 -0
  141. package/declarations/src/-private/form/components/fields/list.d.ts.map +1 -0
  142. package/declarations/src/-private/form/components/fields/multiple-choice.d.ts +58 -0
  143. package/declarations/src/-private/form/components/fields/multiple-choice.d.ts.map +1 -0
  144. package/declarations/src/-private/form/components/fields/number.d.ts +15 -0
  145. package/declarations/src/-private/form/components/fields/number.d.ts.map +1 -0
  146. package/declarations/src/-private/form/components/fields/password.d.ts +15 -0
  147. package/declarations/src/-private/form/components/fields/password.d.ts.map +1 -0
  148. package/declarations/src/-private/form/components/fields/phone.d.ts +15 -0
  149. package/declarations/src/-private/form/components/fields/phone.d.ts.map +1 -0
  150. package/declarations/src/-private/form/components/fields/select.d.ts +16 -0
  151. package/declarations/src/-private/form/components/fields/select.d.ts.map +1 -0
  152. package/declarations/src/-private/form/components/fields/singular-choice.d.ts +56 -0
  153. package/declarations/src/-private/form/components/fields/singular-choice.d.ts.map +1 -0
  154. package/declarations/src/-private/form/components/fields/stories-utils.d.ts +50 -0
  155. package/declarations/src/-private/form/components/fields/stories-utils.d.ts.map +1 -0
  156. package/declarations/src/-private/form/components/fields/text-area.d.ts +15 -0
  157. package/declarations/src/-private/form/components/fields/text-area.d.ts.map +1 -0
  158. package/declarations/src/-private/form/components/fields/text.d.ts +15 -0
  159. package/declarations/src/-private/form/components/fields/text.d.ts.map +1 -0
  160. package/declarations/src/-private/form/components/label.d.ts +17 -0
  161. package/declarations/src/-private/form/components/label.d.ts.map +1 -0
  162. package/declarations/src/-private/form/components/reset.d.ts +25 -0
  163. package/declarations/src/-private/form/components/reset.d.ts.map +1 -0
  164. package/declarations/src/-private/form/components/submit.d.ts +25 -0
  165. package/declarations/src/-private/form/components/submit.d.ts.map +1 -0
  166. package/declarations/src/-private/form/index.d.ts +49 -0
  167. package/declarations/src/-private/form/index.d.ts.map +1 -0
  168. package/declarations/src/-private/form/modifiers/capture-events.d.ts +21 -0
  169. package/declarations/src/-private/form/modifiers/capture-events.d.ts.map +1 -0
  170. package/declarations/src/-private/form/modifiers/manage-validation.d.ts +21 -0
  171. package/declarations/src/-private/form/modifiers/manage-validation.d.ts.map +1 -0
  172. package/declarations/src/-private/helpers.d.ts +10 -0
  173. package/declarations/src/-private/helpers.d.ts.map +1 -0
  174. package/declarations/src/-private/modifiers/disabled.d.ts +20 -0
  175. package/declarations/src/-private/modifiers/disabled.d.ts.map +1 -0
  176. package/declarations/src/components/-input.d.ts +7 -0
  177. package/declarations/src/components/-input.d.ts.map +1 -0
  178. package/declarations/src/components/-menu.d.ts +22 -0
  179. package/declarations/src/components/-menu.d.ts.map +1 -0
  180. package/declarations/src/components/app-header.d.ts +48 -0
  181. package/declarations/src/components/app-header.d.ts.map +1 -0
  182. package/declarations/src/components/box.d.ts +16 -0
  183. package/declarations/src/components/box.d.ts.map +1 -0
  184. package/declarations/src/components/button.d.ts +27 -0
  185. package/declarations/src/components/button.d.ts.map +1 -0
  186. package/declarations/src/components/card.d.ts +14 -0
  187. package/declarations/src/components/card.d.ts.map +1 -0
  188. package/declarations/src/components/checkbox.d.ts +10 -0
  189. package/declarations/src/components/checkbox.d.ts.map +1 -0
  190. package/declarations/src/components/currency-input.d.ts +10 -0
  191. package/declarations/src/components/currency-input.d.ts.map +1 -0
  192. package/declarations/src/components/date-input.d.ts +10 -0
  193. package/declarations/src/components/date-input.d.ts.map +1 -0
  194. package/declarations/src/components/email-input.d.ts +10 -0
  195. package/declarations/src/components/email-input.d.ts.map +1 -0
  196. package/declarations/src/components/form.d.ts +313 -0
  197. package/declarations/src/components/form.d.ts.map +1 -0
  198. package/declarations/src/components/icon-button.d.ts +23 -0
  199. package/declarations/src/components/icon-button.d.ts.map +1 -0
  200. package/declarations/src/components/icon.d.ts +11 -0
  201. package/declarations/src/components/icon.d.ts.map +1 -0
  202. package/declarations/src/components/input-builder.d.ts +30 -0
  203. package/declarations/src/components/input-builder.d.ts.map +1 -0
  204. package/declarations/src/components/list.d.ts +55 -0
  205. package/declarations/src/components/list.d.ts.map +1 -0
  206. package/declarations/src/components/menu.d.ts +40 -0
  207. package/declarations/src/components/menu.d.ts.map +1 -0
  208. package/declarations/src/components/number-input.d.ts +10 -0
  209. package/declarations/src/components/number-input.d.ts.map +1 -0
  210. package/declarations/src/components/password-input.d.ts +10 -0
  211. package/declarations/src/components/password-input.d.ts.map +1 -0
  212. package/declarations/src/components/phone-input.d.ts +10 -0
  213. package/declarations/src/components/phone-input.d.ts.map +1 -0
  214. package/declarations/src/components/radio.d.ts +10 -0
  215. package/declarations/src/components/radio.d.ts.map +1 -0
  216. package/declarations/src/components/section.d.ts +20 -0
  217. package/declarations/src/components/section.d.ts.map +1 -0
  218. package/declarations/src/components/select.d.ts +37 -0
  219. package/declarations/src/components/select.d.ts.map +1 -0
  220. package/declarations/src/components/text-area.d.ts +10 -0
  221. package/declarations/src/components/text-area.d.ts.map +1 -0
  222. package/declarations/src/components/text-input.d.ts +10 -0
  223. package/declarations/src/components/text-input.d.ts.map +1 -0
  224. package/declarations/src/helpers/popover.d.ts +32 -0
  225. package/declarations/src/helpers/popover.d.ts.map +1 -0
  226. package/declarations/src/index.d.ts +25 -0
  227. package/declarations/src/index.d.ts.map +1 -0
  228. package/declarations/src/template-registry.d.ts +49 -0
  229. package/declarations/src/template-registry.d.ts.map +1 -0
  230. package/declarations/src/test-support/index.d.ts +16 -0
  231. package/declarations/src/test-support/index.d.ts.map +1 -0
  232. package/declarations/src/test-support/page-objects/-menu.d.ts +11 -0
  233. package/declarations/src/test-support/page-objects/-menu.d.ts.map +1 -0
  234. package/declarations/src/test-support/page-objects/-private/choices.d.ts +61 -0
  235. package/declarations/src/test-support/page-objects/-private/choices.d.ts.map +1 -0
  236. package/declarations/src/test-support/page-objects/-private/field.d.ts +50 -0
  237. package/declarations/src/test-support/page-objects/-private/field.d.ts.map +1 -0
  238. package/declarations/src/test-support/page-objects/app-header.d.ts +73 -0
  239. package/declarations/src/test-support/page-objects/app-header.d.ts.map +1 -0
  240. package/declarations/src/test-support/page-objects/button.d.ts +14 -0
  241. package/declarations/src/test-support/page-objects/button.d.ts.map +1 -0
  242. package/declarations/src/test-support/page-objects/choice.d.ts +12 -0
  243. package/declarations/src/test-support/page-objects/choice.d.ts.map +1 -0
  244. package/declarations/src/test-support/page-objects/form.d.ts +15 -0
  245. package/declarations/src/test-support/page-objects/form.d.ts.map +1 -0
  246. package/declarations/src/test-support/page-objects/icon-button.d.ts +13 -0
  247. package/declarations/src/test-support/page-objects/icon-button.d.ts.map +1 -0
  248. package/declarations/src/test-support/page-objects/icon.d.ts +8 -0
  249. package/declarations/src/test-support/page-objects/icon.d.ts.map +1 -0
  250. package/declarations/src/test-support/page-objects/input-builder.d.ts +15 -0
  251. package/declarations/src/test-support/page-objects/input-builder.d.ts.map +1 -0
  252. package/declarations/src/test-support/page-objects/input.d.ts +17 -0
  253. package/declarations/src/test-support/page-objects/input.d.ts.map +1 -0
  254. package/declarations/src/test-support/page-objects/list.d.ts +10 -0
  255. package/declarations/src/test-support/page-objects/list.d.ts.map +1 -0
  256. package/declarations/src/test-support/page-objects/menu.d.ts +19 -0
  257. package/declarations/src/test-support/page-objects/menu.d.ts.map +1 -0
  258. package/declarations/src/test-support/page-objects/pill-button.d.ts +14 -0
  259. package/declarations/src/test-support/page-objects/pill-button.d.ts.map +1 -0
  260. package/declarations/src/test-support/page-objects/section.d.ts +9 -0
  261. package/declarations/src/test-support/page-objects/section.d.ts.map +1 -0
  262. package/declarations/src/test-support/page-objects/select.d.ts +10 -0
  263. package/declarations/src/test-support/page-objects/select.d.ts.map +1 -0
  264. package/declarations/src/test-support/page-objects/text-area.d.ts +9 -0
  265. package/declarations/src/test-support/page-objects/text-area.d.ts.map +1 -0
  266. package/declarations/template-registry.d.ts +53 -0
  267. package/declarations/template-registry.d.ts.map +1 -0
  268. package/declarations/test-support/index.d.ts +18 -0
  269. package/declarations/test-support/index.d.ts.map +1 -0
  270. package/declarations/test-support/page-objects/-menu.d.ts +12 -0
  271. package/declarations/test-support/page-objects/-menu.d.ts.map +1 -0
  272. package/declarations/test-support/page-objects/-private/choices.d.ts +15 -0
  273. package/declarations/test-support/page-objects/-private/choices.d.ts.map +1 -0
  274. package/declarations/test-support/page-objects/-private/field.d.ts +51 -0
  275. package/declarations/test-support/page-objects/-private/field.d.ts.map +1 -0
  276. package/declarations/test-support/page-objects/app-header.d.ts +103 -0
  277. package/declarations/test-support/page-objects/app-header.d.ts.map +1 -0
  278. package/declarations/test-support/page-objects/button.d.ts +14 -0
  279. package/declarations/test-support/page-objects/button.d.ts.map +1 -0
  280. package/declarations/test-support/page-objects/choice.d.ts +12 -0
  281. package/declarations/test-support/page-objects/choice.d.ts.map +1 -0
  282. package/declarations/test-support/page-objects/form.d.ts +15 -0
  283. package/declarations/test-support/page-objects/form.d.ts.map +1 -0
  284. package/declarations/test-support/page-objects/icon-button.d.ts +13 -0
  285. package/declarations/test-support/page-objects/icon-button.d.ts.map +1 -0
  286. package/declarations/test-support/page-objects/icon.d.ts +9 -0
  287. package/declarations/test-support/page-objects/icon.d.ts.map +1 -0
  288. package/declarations/test-support/page-objects/input-builder.d.ts +15 -0
  289. package/declarations/test-support/page-objects/input-builder.d.ts.map +1 -0
  290. package/declarations/test-support/page-objects/input.d.ts +17 -0
  291. package/declarations/test-support/page-objects/input.d.ts.map +1 -0
  292. package/declarations/test-support/page-objects/list copy.d.ts +10 -0
  293. package/declarations/test-support/page-objects/list copy.d.ts.map +1 -0
  294. package/declarations/test-support/page-objects/list.d.ts +10 -0
  295. package/declarations/test-support/page-objects/list.d.ts.map +1 -0
  296. package/declarations/test-support/page-objects/menu copy.d.ts +9 -0
  297. package/declarations/test-support/page-objects/menu copy.d.ts.map +1 -0
  298. package/declarations/test-support/page-objects/menu.d.ts +20 -0
  299. package/declarations/test-support/page-objects/menu.d.ts.map +1 -0
  300. package/declarations/test-support/page-objects/page.d.ts +12 -0
  301. package/declarations/test-support/page-objects/page.d.ts.map +1 -0
  302. package/declarations/test-support/page-objects/pill-button.d.ts +14 -0
  303. package/declarations/test-support/page-objects/pill-button.d.ts.map +1 -0
  304. package/declarations/test-support/page-objects/popover.d.ts +7 -0
  305. package/declarations/test-support/page-objects/popover.d.ts.map +1 -0
  306. package/declarations/test-support/page-objects/section copy.d.ts +9 -0
  307. package/declarations/test-support/page-objects/section copy.d.ts.map +1 -0
  308. package/declarations/test-support/page-objects/section.d.ts +9 -0
  309. package/declarations/test-support/page-objects/section.d.ts.map +1 -0
  310. package/declarations/test-support/page-objects/select.d.ts +10 -0
  311. package/declarations/test-support/page-objects/select.d.ts.map +1 -0
  312. package/declarations/test-support/page-objects/text-area.d.ts +9 -0
  313. package/declarations/test-support/page-objects/text-area.d.ts.map +1 -0
  314. package/dist/-input-DGR-n9U_.js +9 -0
  315. package/dist/-input-DGR-n9U_.js.map +1 -0
  316. package/dist/_app_/components/app-header.js +1 -0
  317. package/dist/_app_/components/box.js +1 -0
  318. package/dist/_app_/components/button.js +1 -0
  319. package/dist/_app_/components/card.js +1 -0
  320. package/dist/_app_/components/checkbox.js +1 -0
  321. package/dist/_app_/components/currency-input.js +1 -0
  322. package/dist/_app_/components/date-input.js +1 -0
  323. package/dist/_app_/components/email-input.js +1 -0
  324. package/dist/_app_/components/form.js +1 -0
  325. package/dist/_app_/components/icon-button.js +1 -0
  326. package/dist/_app_/components/icon.js +1 -0
  327. package/dist/_app_/components/input-builder.js +1 -0
  328. package/dist/_app_/components/list.js +1 -0
  329. package/dist/_app_/components/menu.js +1 -0
  330. package/dist/_app_/components/number-input.js +1 -0
  331. package/dist/_app_/components/page.js +1 -0
  332. package/dist/_app_/components/password-input.js +1 -0
  333. package/dist/_app_/components/phone-input.js +1 -0
  334. package/dist/_app_/components/popover.js +1 -0
  335. package/dist/_app_/components/radio.js +1 -0
  336. package/dist/_app_/components/section.js +1 -0
  337. package/dist/_app_/components/select.js +1 -0
  338. package/dist/_app_/components/text-area.js +1 -0
  339. package/dist/_app_/components/text-input.js +1 -0
  340. package/dist/_app_/helpers/popover.js +1 -0
  341. package/dist/components/app-header.js +126 -0
  342. package/dist/components/app-header.js.map +1 -0
  343. package/dist/components/box.js +20 -0
  344. package/dist/components/box.js.map +1 -0
  345. package/dist/components/button.js +47 -0
  346. package/dist/components/button.js.map +1 -0
  347. package/dist/components/card.js +16 -0
  348. package/dist/components/card.js.map +1 -0
  349. package/dist/components/checkbox.js +18 -0
  350. package/dist/components/checkbox.js.map +1 -0
  351. package/dist/components/currency-input.js +22 -0
  352. package/dist/components/currency-input.js.map +1 -0
  353. package/dist/components/date-input.js +18 -0
  354. package/dist/components/date-input.js.map +1 -0
  355. package/dist/components/email-input.js +18 -0
  356. package/dist/components/email-input.js.map +1 -0
  357. package/dist/components/form.js +826 -0
  358. package/dist/components/form.js.map +1 -0
  359. package/dist/components/icon-button.js +29 -0
  360. package/dist/components/icon-button.js.map +1 -0
  361. package/dist/components/icon.js +41 -0
  362. package/dist/components/icon.js.map +1 -0
  363. package/dist/components/input-builder.js +20 -0
  364. package/dist/components/input-builder.js.map +1 -0
  365. package/dist/components/list.js +66 -0
  366. package/dist/components/list.js.map +1 -0
  367. package/dist/components/menu.js +106 -0
  368. package/dist/components/menu.js.map +1 -0
  369. package/dist/components/number-input.js +20 -0
  370. package/dist/components/number-input.js.map +1 -0
  371. package/dist/components/page.js +65 -0
  372. package/dist/components/page.js.map +1 -0
  373. package/dist/components/password-input.js +18 -0
  374. package/dist/components/password-input.js.map +1 -0
  375. package/dist/components/phone-input.js +18 -0
  376. package/dist/components/phone-input.js.map +1 -0
  377. package/dist/components/popover.js +14 -0
  378. package/dist/components/popover.js.map +1 -0
  379. package/dist/components/radio.js +18 -0
  380. package/dist/components/radio.js.map +1 -0
  381. package/dist/components/section.js +25 -0
  382. package/dist/components/section.js.map +1 -0
  383. package/dist/components/select.js +39 -0
  384. package/dist/components/select.js.map +1 -0
  385. package/dist/components/text-area.js +18 -0
  386. package/dist/components/text-area.js.map +1 -0
  387. package/dist/components/text-input.js +18 -0
  388. package/dist/components/text-input.js.map +1 -0
  389. package/dist/disabled-B_FQ0Z51.js +27 -0
  390. package/dist/disabled-B_FQ0Z51.js.map +1 -0
  391. package/dist/helpers/popover.js +74 -0
  392. package/dist/helpers/popover.js.map +1 -0
  393. package/dist/helpers-DApiJrHl.js +28 -0
  394. package/dist/helpers-DApiJrHl.js.map +1 -0
  395. package/dist/index.js +26 -0
  396. package/dist/index.js.map +1 -0
  397. package/dist/template-registry.js +2 -0
  398. package/dist/template-registry.js.map +1 -0
  399. package/dist/test-support/index.js +381 -0
  400. package/dist/test-support/index.js.map +1 -0
  401. package/package.json +3 -3
@@ -0,0 +1,826 @@
1
+ import Component from '@glimmer/component';
2
+ import { tracked, cached } from '@glimmer/tracking';
3
+ import { assert, warn } from '@ember/debug';
4
+ import { uniqueId, fn, hash } from '@ember/helper';
5
+ import { on } from '@ember/modifier';
6
+ import { get, set } from '@ember/object';
7
+ import { TrackedAsyncData } from 'ember-async-data';
8
+ import Modifier, { modifier } from 'ember-modifier';
9
+ import { TrackedObject } from 'tracked-built-ins';
10
+ import styles from '@hokulea/core/forms.module.css';
11
+ import { element } from 'ember-element-helper';
12
+ import { precompileTemplate } from '@ember/template-compilation';
13
+ import { setComponentTemplate } from '@ember/component';
14
+ import templateOnly from '@ember/component/template-only';
15
+ import Checkbox from './checkbox.js';
16
+ import { b as asBoolean, c as asNumber, d as asString, e as eq } from '../helpers-DApiJrHl.js';
17
+ import CurrencyInput from './currency-input.js';
18
+ import DateInput from './date-input.js';
19
+ import EmailInput from './email-input.js';
20
+ import List from './list.js';
21
+ import NumberInput from './number-input.js';
22
+ import PasswordInput from './password-input.js';
23
+ import PhoneInput from './phone-input.js';
24
+ import Select from './select.js';
25
+ import Radio from './radio.js';
26
+ import TextInput from './text-input.js';
27
+ import TextArea from './text-area.js';
28
+ import styles$1 from '@hokulea/core/actions.module.css';
29
+ import { d as disabled } from '../disabled-B_FQ0Z51.js';
30
+ import { g, i, n } from 'decorator-transforms/runtime';
31
+
32
+ /**
33
+ * What the user can pass as @data
34
+ */
35
+
36
+ /**
37
+ * The subset of properties of DATA, whose keys are strings (and not number or symbol)
38
+ * Only this data is useable in the form
39
+ */
40
+
41
+ /**
42
+ * Returns the type of all keys of DATA, that are also strings. Only strings can be used as field @name
43
+ */
44
+
45
+ /**
46
+ * Generic interface for all validation errors
47
+ */
48
+
49
+ /**
50
+ * Callback used for form level validation
51
+ */
52
+
53
+ /**
54
+ * Callback used for field level validation
55
+ */
56
+
57
+ /**
58
+ * Internal structure to track used fields
59
+ * @private
60
+ */
61
+
62
+ /**
63
+ * For internal field registration
64
+ * @private
65
+ */
66
+
67
+ /**
68
+ * Mapper type to construct subset of objects, whose keys are only strings (and not number or symbol)
69
+ */
70
+
71
+ function mergeErrorRecord(...records) {
72
+ const errors = {};
73
+ for (const record of records) {
74
+ if (!record) {
75
+ continue;
76
+ }
77
+ for (const [name, fieldErrors] of Object.entries(record)) {
78
+ const existingFieldErrors = errors[name];
79
+ errors[name] = existingFieldErrors ? [...existingFieldErrors, ...fieldErrors] : fieldErrors;
80
+ }
81
+ }
82
+ return errors;
83
+ }
84
+
85
+ const CaptureEventsModifier = modifier((element, _pos, {
86
+ event,
87
+ triggerValidation
88
+ }) => {
89
+ if (event) {
90
+ element.addEventListener(event, triggerValidation, {
91
+ passive: true
92
+ });
93
+ return () => {
94
+ element.removeEventListener(event, triggerValidation);
95
+ };
96
+ }
97
+ return undefined;
98
+ });
99
+
100
+ const Description = setComponentTemplate(precompileTemplate("\n <p class={{styles.description}} data-test-description ...attributes>\n {{yield}}\n </p>\n", {
101
+ scope: () => ({
102
+ styles
103
+ }),
104
+ strictMode: true
105
+ }), templateOnly());
106
+
107
+ class Errors extends Component {
108
+ static {
109
+ setComponentTemplate(precompileTemplate("\n <div id={{@id}} aria-live=\"assertive\" class={{styles.errors}} ...attributes>\n {{!-- <span><Icon @icon='dismiss-circle' @style='filled' /></span> --}}\n {{#if (has-block)}}\n {{yield @errors}}\n {{else}}\n <div>\n {{#each @errors as |e|}}\n {{#if e.message}}\n <p data-test-error data-test-error-type=\"{{e.type}}\" data-test-error-value=\"{{e.value}}\">{{e.message}}</p>\n {{/if}}\n {{/each}}\n </div>\n {{/if}}\n </div>\n ", {
110
+ scope: () => ({
111
+ styles
112
+ }),
113
+ strictMode: true
114
+ }), this);
115
+ }
116
+ }
117
+
118
+ const Label = setComponentTemplate(precompileTemplate("\n {{#let (if @element @element (element \"label\")) as |Element|}}\n {{!-- @glint-expect-error https://github.com/typed-ember/glint/issues/610 --}}\n <Element class={{styles.label}} data-test-label ...attributes>\n {{yield}}\n </Element>\n {{/let}}\n", {
119
+ scope: () => ({
120
+ element,
121
+ styles
122
+ }),
123
+ strictMode: true
124
+ }), templateOnly());
125
+
126
+ class Field extends Component {
127
+ // Label = this.args.labelComponent ?? Label;
128
+ constructor(owner1, args1) {
129
+ super(owner1, args1);
130
+ assert('Nested property paths in @name are not supported.', typeof this.args.name !== 'string' || !this.args.name.includes('.'));
131
+ this.args.registerField(this.args.name, {
132
+ validate: this.args.validate
133
+ });
134
+ }
135
+ willDestroy() {
136
+ this.args.unregisterField(this.args.name);
137
+ super.willDestroy();
138
+ }
139
+ get value() {
140
+ // when @mutableData is set, data is something we don't control, i.e. might require old-school get() to be on the safe side
141
+ // we do not want to support nested property paths for now though, see the constructor assertion!
142
+ return get(this.args.data, this.args.name);
143
+ }
144
+ get errors() {
145
+ return this.args.errors?.[this.args.name];
146
+ }
147
+ get invalid() {
148
+ return this.errors !== undefined;
149
+ }
150
+ get valueAsString() {
151
+ assert(`Only string values are expected for ${String(this.args.name)}, but you passed ${typeof this.value}`, typeof this.value === 'undefined' || typeof this.value === 'string');
152
+ return this.value;
153
+ }
154
+ get valueAsStringOrNumber() {
155
+ assert(`Only string or number values are expected for ${String(this.args.name)}, but you passed ${typeof this.value}`, typeof this.value === 'undefined' || typeof this.value === 'string' || typeof this.value === 'number');
156
+ return this.value;
157
+ }
158
+ get valueAsBoolean() {
159
+ assert(`Only boolean values are expected for ${String(this.args.name)}, but you passed ${typeof this.value}`, typeof this.value === 'undefined' || typeof this.value === 'boolean');
160
+ return this.value;
161
+ }
162
+ setValue = value1 => {
163
+ this.args.set(this.args.name, value1);
164
+ };
165
+ static {
166
+ setComponentTemplate(precompileTemplate("\n {{#let (uniqueId) (uniqueId) (fn @triggerValidationFor @name) (if @element @element (element \"div\")) as |fieldId errorId triggerValidation Element|}}\n <Element class={{styles.field}} data-test-field={{@name}}>\n {{#if @label}}\n {{#let (if @labelComponent @labelComponent Label) as |L|}}\n <L for={{unless @labelComponent fieldId}}>{{@label}}</L>\n {{/let}}\n {{/if}}\n\n {{#if @description}}\n <Description>{{@description}}</Description>\n {{/if}}\n\n {{yield (hash value=this.value setValue=this.setValue id=fieldId errorId=errorId invalid=this.invalid rawErrors=this.errors triggerValidation=triggerValidation captureEvents=(modifier CaptureEventsModifier event=(if this.invalid @fieldRevalidationEvent @fieldValidationEvent) triggerValidation=triggerValidation) manageValidation=(modifier @manageValidation invalid=this.invalid errorMessageId=errorId name=@name))}}\n\n {{#if this.errors}}\n <Errors @id={{errorId}} @errors={{this.errors}} />\n {{/if}}\n </Element>\n {{/let}}\n ", {
167
+ scope: () => ({
168
+ uniqueId,
169
+ fn,
170
+ element,
171
+ styles,
172
+ Label,
173
+ Description,
174
+ hash,
175
+ CaptureEventsModifier,
176
+ Errors
177
+ }),
178
+ strictMode: true
179
+ }), this);
180
+ }
181
+ }
182
+
183
+ class RadioField extends Component {
184
+ Field = this.args.Field;
185
+ setBooleanValue = setValue1 => {
186
+ return value1 => setValue1(value1);
187
+ };
188
+ static {
189
+ setComponentTemplate(precompileTemplate("\n <this.Field @label @name={{@name}} @validate={{@validate}} as |f|>\n <div class={{styles.choices}}>\n <div class={{styles.choice}}>\n <span>\n <Checkbox @value={{asBoolean f.value}} @update={{this.setBooleanValue f.setValue}} @disabled={{@disabled}} id={{f.id}} name={{@name}} {{f.manageValidation}} {{f.captureEvents}} ...attributes />\n </span>\n\n <div>\n <Label for={{f.id}}>{{@label}}</Label>\n\n {{#if @description}}\n <Description>{{@description}}</Description>\n {{/if}}\n </div>\n </div>\n </div>\n </this.Field>\n ", {
190
+ scope: () => ({
191
+ styles,
192
+ Checkbox,
193
+ asBoolean,
194
+ Label,
195
+ Description
196
+ }),
197
+ strictMode: true
198
+ }), this);
199
+ }
200
+ }
201
+
202
+ class CurrencyField extends Component {
203
+ Field = this.args.Field;
204
+ setNumberValue = setValue1 => {
205
+ return value1 => setValue1(value1);
206
+ };
207
+ static {
208
+ setComponentTemplate(precompileTemplate("\n <this.Field @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <CurrencyInput @value={{asNumber f.value}} @update={{this.setNumberValue f.setValue}} @disabled={{@disabled}} name={{@name}} id={{f.id}} {{f.manageValidation}} {{f.captureEvents}} ...attributes />\n </this.Field>\n ", {
209
+ scope: () => ({
210
+ CurrencyInput,
211
+ asNumber
212
+ }),
213
+ strictMode: true
214
+ }), this);
215
+ }
216
+ }
217
+
218
+ class DateField extends Component {
219
+ Field = this.args.Field;
220
+ setStringValue = setValue1 => {
221
+ return value1 => setValue1(value1);
222
+ };
223
+ static {
224
+ setComponentTemplate(precompileTemplate("\n <this.Field @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <DateInput @value={{asString f.value}} @update={{this.setStringValue f.setValue}} @disabled={{@disabled}} name={{@name}} id={{f.id}} {{f.manageValidation}} {{f.captureEvents}} ...attributes />\n </this.Field>\n ", {
225
+ scope: () => ({
226
+ DateInput,
227
+ asString
228
+ }),
229
+ strictMode: true
230
+ }), this);
231
+ }
232
+ }
233
+
234
+ class EmailField extends Component {
235
+ Field = this.args.Field;
236
+ setStringValue = setValue1 => {
237
+ return value1 => setValue1(value1);
238
+ };
239
+ static {
240
+ setComponentTemplate(precompileTemplate("\n <this.Field @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <EmailInput @value={{asString f.value}} @update={{this.setStringValue f.setValue}} @disabled={{@disabled}} name={{@name}} id={{f.id}} {{f.manageValidation}} {{f.captureEvents}} ...attributes />\n </this.Field>\n ", {
241
+ scope: () => ({
242
+ EmailInput,
243
+ asString
244
+ }),
245
+ strictMode: true
246
+ }), this);
247
+ }
248
+ }
249
+
250
+ const ListLabel = setComponentTemplate(precompileTemplate("\n <Label @element={{element \"span\"}} id={{@id}}>{{yield}}</Label>\n", {
251
+ scope: () => ({
252
+ Label,
253
+ element
254
+ }),
255
+ strictMode: true
256
+ }), templateOnly());
257
+ class ListField extends Component {
258
+ Field = this.args.Field;
259
+ List = List;
260
+ setValue = setValue1 => {
261
+ return value1 => setValue1(value1);
262
+ };
263
+ asValue = value1 => value1;
264
+ static {
265
+ setComponentTemplate(precompileTemplate("\n {{#let (uniqueId) as |labelId|}}\n <this.Field @name={{@name}} @label={{@label}} @labelComponent={{component ListLabel id=labelId}} @description={{@description}} @validate={{@validate}} as |f|>\n <this.List @value={{this.asValue f.value}} @update={{this.setValue f.setValue}} @disabled={{@disabled}} name={{@name}} aria-labelledby={{labelId}} {{f.manageValidation}} {{f.captureEvents}} ...attributes as |s|>\n {{yield s}}\n </this.List>\n </this.Field>\n {{/let}}\n ", {
266
+ scope: () => ({
267
+ uniqueId,
268
+ ListLabel
269
+ }),
270
+ strictMode: true
271
+ }), this);
272
+ }
273
+ }
274
+
275
+ let Option$1 = class Option extends Component {
276
+ select = checked1 => {
277
+ if (checked1) {
278
+ this.args.field.setValue([...(this.args.field.value ?? []), this.args.value]);
279
+ } else {
280
+ const values1 = this.args.field.value;
281
+ const index1 = this.args.field.value?.indexOf(this.args.value);
282
+ if (Array.isArray(values1) && index1) {
283
+ values1.splice(index1, 1);
284
+ this.args.field.setValue(values1);
285
+ }
286
+ }
287
+ };
288
+ get checked() {
289
+ return this.args.field.value?.includes(this.args.value);
290
+ }
291
+ static {
292
+ setComponentTemplate(precompileTemplate("\n {{#let (uniqueId) as |id|}}\n <div class={{styles.choice}} data-test-option>\n <span>\n <Checkbox @value={{this.checked}} @update={{this.select}} @disabled={{@disabled}} id={{id}} name={{@name}} value={{@value}} {{@field.manageValidation}} {{@field.captureEvents}} ...attributes />\n </span>\n\n <div>\n <Label for={{id}}>{{@label}}</Label>\n\n {{#if @description}}\n <Description>{{@description}}</Description>\n {{/if}}\n\n {{yield}}\n </div>\n </div>\n {{/let}}\n ", {
293
+ scope: () => ({
294
+ uniqueId,
295
+ styles,
296
+ Checkbox,
297
+ Label,
298
+ Description
299
+ }),
300
+ strictMode: true
301
+ }), this);
302
+ }
303
+ };
304
+ class MultipleChoiceField extends Component {
305
+ Field = this.args.Field;
306
+ Option = Option$1;
307
+ asMultiField = field1 => {
308
+ return field1;
309
+ };
310
+ static {
311
+ setComponentTemplate(precompileTemplate("\n <this.Field @element={{element \"fieldset\"}} @labelComponent={{component Label element=(element \"legend\")}} @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <div class={{styles.choices}} data-test-choices>\n {{yield (hash Option=(component this.Option field=(this.asMultiField f) name=@name disabled=@disabled))}}\n </div>\n </this.Field>\n ", {
312
+ scope: () => ({
313
+ element,
314
+ Label,
315
+ styles,
316
+ hash
317
+ }),
318
+ strictMode: true
319
+ }), this);
320
+ }
321
+ }
322
+
323
+ class NumberField extends Component {
324
+ Field = this.args.Field;
325
+ setNumberValue = setValue1 => {
326
+ return value1 => setValue1(value1);
327
+ };
328
+ static {
329
+ setComponentTemplate(precompileTemplate("\n <this.Field @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <NumberInput @value={{asNumber f.value}} @update={{this.setNumberValue f.setValue}} @disabled={{@disabled}} name={{@name}} id={{f.id}} {{f.manageValidation}} {{f.captureEvents}} ...attributes />\n </this.Field>\n ", {
330
+ scope: () => ({
331
+ NumberInput,
332
+ asNumber
333
+ }),
334
+ strictMode: true
335
+ }), this);
336
+ }
337
+ }
338
+
339
+ class PasswordField extends Component {
340
+ Field = this.args.Field;
341
+ setStringValue = setValue1 => {
342
+ return value1 => setValue1(value1);
343
+ };
344
+ static {
345
+ setComponentTemplate(precompileTemplate("\n <this.Field @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <PasswordInput @value={{asString f.value}} @update={{this.setStringValue f.setValue}} @disabled={{@disabled}} name={{@name}} id={{f.id}} {{f.manageValidation}} {{f.captureEvents}} ...attributes />\n </this.Field>\n ", {
346
+ scope: () => ({
347
+ PasswordInput,
348
+ asString
349
+ }),
350
+ strictMode: true
351
+ }), this);
352
+ }
353
+ }
354
+
355
+ class PhoneField extends Component {
356
+ Field = this.args.Field;
357
+ setStringValue = setValue1 => {
358
+ return value1 => setValue1(value1);
359
+ };
360
+ static {
361
+ setComponentTemplate(precompileTemplate("\n <this.Field @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <PhoneInput @value={{asString f.value}} @update={{this.setStringValue f.setValue}} @disabled={{@disabled}} name={{@name}} id={{f.id}} {{f.manageValidation}} {{f.captureEvents}} ...attributes />\n </this.Field>\n ", {
362
+ scope: () => ({
363
+ PhoneInput,
364
+ asString
365
+ }),
366
+ strictMode: true
367
+ }), this);
368
+ }
369
+ }
370
+
371
+ class SelectField extends Component {
372
+ Field = this.args.Field;
373
+ setValue = setValue1 => {
374
+ return value1 => setValue1(value1);
375
+ };
376
+ static {
377
+ setComponentTemplate(precompileTemplate("\n <this.Field @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <Select @value={{asString f.value}} @update={{this.setValue f.setValue}} @disabled={{@disabled}} name={{@name}} id={{f.id}} {{f.manageValidation}} {{f.captureEvents}} ...attributes as |s|>\n {{yield s}}\n </Select>\n </this.Field>\n ", {
378
+ scope: () => ({
379
+ Select,
380
+ asString
381
+ }),
382
+ strictMode: true
383
+ }), this);
384
+ }
385
+ }
386
+
387
+ let Option = class Option extends Component {
388
+ select = () => {
389
+ this.args.field.setValue(this.args.value);
390
+ };
391
+ static {
392
+ setComponentTemplate(precompileTemplate("\n {{#let (uniqueId) as |id|}}\n <div class={{styles.choice}} data-test-option>\n <span>\n <Radio @value={{eq @field.value @value}} @update={{this.select}} @disabled={{@disabled}} id={{id}} name={{@name}} value={{@value}} {{@field.manageValidation}} {{@field.captureEvents}} ...attributes />\n </span>\n\n <div>\n <Label for={{id}}>{{@label}}</Label>\n\n {{#if @description}}\n <Description>{{@description}}</Description>\n {{/if}}\n\n {{yield}}\n </div>\n </div>\n {{/let}}\n ", {
393
+ scope: () => ({
394
+ uniqueId,
395
+ styles,
396
+ Radio,
397
+ eq,
398
+ Label,
399
+ Description
400
+ }),
401
+ strictMode: true
402
+ }), this);
403
+ }
404
+ };
405
+ class SingularChoiceField extends Component {
406
+ Field = this.args.Field;
407
+ Option = Option;
408
+ static {
409
+ setComponentTemplate(precompileTemplate("\n <this.Field @element={{element \"fieldset\"}} @labelComponent={{component Label element=(element \"legend\")}} @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <div class={{styles.choices}} data-test-choices>\n {{yield (hash Option=(component this.Option field=f name=@name disabled=@disabled))}}\n </div>\n </this.Field>\n ", {
410
+ scope: () => ({
411
+ element,
412
+ Label,
413
+ styles,
414
+ hash
415
+ }),
416
+ strictMode: true
417
+ }), this);
418
+ }
419
+ }
420
+
421
+ let TextField$1 = class TextField extends Component {
422
+ Field = this.args.Field;
423
+ setStringValue = setValue1 => {
424
+ return value1 => setValue1(value1);
425
+ };
426
+ static {
427
+ setComponentTemplate(precompileTemplate("\n <this.Field @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <TextInput @value={{asString f.value}} @update={{this.setStringValue f.setValue}} @disabled={{@disabled}} name={{@name}} id={{f.id}} {{f.manageValidation}} {{f.captureEvents}} ...attributes />\n </this.Field>\n ", {
428
+ scope: () => ({
429
+ TextInput,
430
+ asString
431
+ }),
432
+ strictMode: true
433
+ }), this);
434
+ }
435
+ };
436
+
437
+ class TextField extends Component {
438
+ Field = this.args.Field;
439
+ setStringValue = setValue1 => {
440
+ return value1 => setValue1(value1);
441
+ };
442
+ static {
443
+ setComponentTemplate(precompileTemplate("\n <this.Field @name={{@name}} @label={{@label}} @description={{@description}} @validate={{@validate}} as |f|>\n <TextArea @value={{asString f.value}} @update={{this.setStringValue f.setValue}} @disabled={{@disabled}} name={{@name}} id={{f.id}} {{f.manageValidation}} {{f.captureEvents}} ...attributes />\n </this.Field>\n ", {
444
+ scope: () => ({
445
+ TextArea,
446
+ asString
447
+ }),
448
+ strictMode: true
449
+ }), this);
450
+ }
451
+ }
452
+
453
+ const Reset = setComponentTemplate(precompileTemplate("\n <button type=\"reset\" class={{styles.button}} data-intent={{if @intent @intent \"action\"}} data-importance={{if @importance @importance \"supreme\"}} data-spacing={{@spacing}} {{disabled when=(if @disabled @disabled false)}} data-test-button ...attributes>\n {{#if (has-block \"before\")}}\n <span data-test-button=\"before\">\n {{yield to=\"before\"}}\n </span>\n {{/if}}\n\n <span data-test-button=\"label\">\n {{#if (has-block \"label\")}}\n {{yield to=\"label\"}}\n {{/if}}\n\n {{#if (has-block)}}\n {{yield}}\n {{/if}}\n </span>\n\n {{#if (has-block \"after\")}}\n <span data-test-button=\"after\">\n {{yield to=\"after\"}}\n </span>\n {{/if}}\n </button>\n", {
454
+ scope: () => ({
455
+ styles: styles$1,
456
+ disabled
457
+ }),
458
+ strictMode: true
459
+ }), templateOnly());
460
+
461
+ const Submit = setComponentTemplate(precompileTemplate("\n <button type=\"submit\" class={{styles.button}} data-intent={{if @intent @intent \"action\"}} data-importance={{if @importance @importance \"supreme\"}} data-spacing={{@spacing}} {{disabled when=(if @disabled @disabled false)}} data-test-button ...attributes>\n {{#if (has-block \"before\")}}\n <span data-test-button=\"before\">\n {{yield to=\"before\"}}\n </span>\n {{/if}}\n\n <span data-test-button=\"label\">\n {{#if (has-block \"label\")}}\n {{yield to=\"label\"}}\n {{/if}}\n\n {{#if (has-block)}}\n {{yield}}\n {{/if}}\n </span>\n\n {{#if (has-block \"after\")}}\n <span data-test-button=\"after\">\n {{yield to=\"after\"}}\n </span>\n {{/if}}\n </button>\n", {
462
+ scope: () => ({
463
+ styles: styles$1,
464
+ disabled
465
+ }),
466
+ strictMode: true
467
+ }), templateOnly());
468
+
469
+ // import { modifier } from 'ember-modifier';
470
+ // import Modifier from 'ember-modifier';
471
+ // import { renderToCanvas, VertexArray, RenderOptions } from 'neat-webgl-library';
472
+
473
+ // type Positional = [model: VertexArray];
474
+
475
+ // export interface Render3DModelSignature {
476
+ // Element: HTMLCanvasElement;
477
+ // Args: {
478
+ // Positional: Positional;
479
+ // Named: RenderOptions;
480
+ // };
481
+ // }
482
+
483
+ class ManageValidationModifier extends Modifier {
484
+ modify(element, _pos, {
485
+ name,
486
+ showErrorsFor,
487
+ invalid,
488
+ errorMessageId
489
+ }) {
490
+ if (showErrorsFor(name)) {
491
+ element.ariaInvalid = invalid ? 'true' : 'false';
492
+ if (invalid) {
493
+ element.setAttribute('aria-errormessage', errorMessageId);
494
+ } else {
495
+ element.removeAttribute('aria-errormessage');
496
+ }
497
+ if (element.parentElement && 'inputBuilder' in element.parentElement.dataset) {
498
+ element.parentElement.setAttribute('data-invalid', invalid ? 'true' : 'false');
499
+ }
500
+ }
501
+ return undefined;
502
+ }
503
+ }
504
+
505
+ /**
506
+ * This internal data structure maintains information about each field that is registered to the form by `registerField`.
507
+ */
508
+ let FieldData = class FieldData {
509
+ constructor(fieldRegistration1) {
510
+ this.validate = fieldRegistration1.validate;
511
+ }
512
+ /**
513
+ * tracked state that enabled a dynamic validation of a field *before* the whole form is submitted, e.g. by `@validateOn="blur" and the blur event being triggered for that particular field.
514
+ */
515
+ static {
516
+ g(this.prototype, "validationEnabled", [tracked], function () {
517
+ return false;
518
+ });
519
+ }
520
+ #validationEnabled = (i(this, "validationEnabled"), void 0);
521
+ /**
522
+ * The *field* level validation callback passed to the field as in `<form.field @name="foo" @validate={{this.validateCallback}}>`
523
+ */
524
+ validate;
525
+ };
526
+ // eslint-disable-next-line @typescript-eslint/naming-convention
527
+ class Form extends Component {
528
+ Field = Field;
529
+ CheckboxField = RadioField;
530
+ CurrencyField = CurrencyField;
531
+ DateField = DateField;
532
+ EmailField = EmailField;
533
+ ListField = ListField;
534
+ MultipleChoiceField = MultipleChoiceField;
535
+ NumberField = NumberField;
536
+ PasswordField = PasswordField;
537
+ PhoneField = PhoneField;
538
+ SelectField = SelectField;
539
+ SingularChoiceField = SingularChoiceField;
540
+ TextField = TextField$1;
541
+ TextAreaField = TextField;
542
+ ManagaValidationModifier = ManageValidationModifier;
543
+ formElement;
544
+ registerForm = modifier((el1, _p1) => {
545
+ this.formElement = el1;
546
+ });
547
+ submit = async e1 => {
548
+ e1?.preventDefault();
549
+ await this.validateWithState();
550
+ this.showAllValidations = true;
551
+ if (!this.validationErrorsExist) {
552
+ if (this.args.submit) {
553
+ this.submissionState = new TrackedAsyncData(this.args.submit(this.effectiveData));
554
+ }
555
+ } else {
556
+ assert('Validation errors expected to be present. If you see this, please report it as a bug to ember-headless-form!',
557
+ // with optional chaining this leads to a NPE
558
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
559
+ this.validationState && this.validationState.isResolved);
560
+ this.args.invalidated?.(this.effectiveData, this.validationState.value);
561
+ }
562
+ };
563
+ reset = async e1 => {
564
+ e1?.preventDefault();
565
+ for (const key1 of Object.keys(this.internalData)) {
566
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
567
+ delete this.internalData[key1];
568
+ }
569
+ this.validationState = undefined;
570
+ this.submissionState = undefined;
571
+ };
572
+ /**
573
+ * A copy of the passed `@data` stored internally, which is only passed back to the component consumer after a (successful) form submission.
574
+ */
575
+ internalData = new TrackedObject({});
576
+ get effectiveData() {
577
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
578
+ const obj1 = this.args.data ?? {};
579
+ if (this.args.dataMode === 'mutable') {
580
+ return obj1;
581
+ }
582
+ const {
583
+ internalData: internalData1
584
+ } = this;
585
+ return new Proxy(obj1, {
586
+ get(target1, prop1) {
587
+ return prop1 in internalData1 ? internalData1[prop1] : Reflect.get(target1, prop1);
588
+ },
589
+ set(_target1, property1, value1) {
590
+ return Reflect.set(internalData1, property1, value1);
591
+ },
592
+ has(target1, prop1) {
593
+ return prop1 in internalData1 ? true : Reflect.has(target1, prop1);
594
+ },
595
+ getOwnPropertyDescriptor(target1, prop1) {
596
+ return Reflect.getOwnPropertyDescriptor(prop1 in internalData1 ? internalData1 : target1, prop1);
597
+ },
598
+ ownKeys(target1) {
599
+ return [...Reflect.ownKeys(target1), ...Reflect.ownKeys(internalData1)] // return only unique values
600
+ .filter((value1, index1, array1) => array1.indexOf(value1) === index1);
601
+ },
602
+ deleteProperty(_target1, prop1) {
603
+ if (prop1 in internalData1) {
604
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
605
+ delete internalData1[prop1];
606
+ }
607
+ return true;
608
+ }
609
+ });
610
+ }
611
+ static {
612
+ n(this.prototype, "effectiveData", [cached]);
613
+ }
614
+ fields = new Map();
615
+ registerField = (name1, field1) => {
616
+ assert(`You passed @name="${String(name1)}" to the form field, but this is already in use. Names of form fields must be unique!`, !this.fields.has(name1));
617
+ this.fields.set(name1, new FieldData(field1));
618
+ };
619
+ unregisterField = name1 => {
620
+ this.fields.delete(name1);
621
+ };
622
+ set = (key1, value1) => {
623
+ // when @mutableData is set, our effectiveData is something we don't control, i.e. might require old-school set() to be on the safe side
624
+ set(this.effectiveData, key1, value1);
625
+ // console.log('internalData', this.internalData);
626
+ };
627
+ static {
628
+ g(this.prototype, "validationState", [tracked]);
629
+ }
630
+ #validationState = (i(this, "validationState"), void 0);
631
+ static {
632
+ g(this.prototype, "submissionState", [tracked]);
633
+ }
634
+ #submissionState = (i(this, "submissionState"), void 0);
635
+ static {
636
+ g(this.prototype, "showAllValidations", [tracked], function () {
637
+ return false;
638
+ });
639
+ }
640
+ #showAllValidations = (i(this, "showAllValidations"), void 0);
641
+ /**
642
+ * When this is set to true by submitting the form, eventual validation errors are show for *all* field, regardless of their individual dynamic validation status in `FieldData#validationEnabled`
643
+ */
644
+ get validateOn() {
645
+ return this.args.validateOn ?? 'submit';
646
+ }
647
+ get revalidateOn() {
648
+ return this.args.revalidateOn ?? 'change';
649
+ }
650
+ /**
651
+ * Return the event type that will be listened on for dynamic validation (i.e. *before* submitting)
652
+ */
653
+ get fieldValidationEvent() {
654
+ const {
655
+ validateOn: validateOn1
656
+ } = this;
657
+ return validateOn1 === 'submit' ? undefined : validateOn1;
658
+ }
659
+ /**
660
+ * Return the event type that will be listened on for dynamic *re*validation, i.e. updating the validation status of a field that has been previously marked as invalid
661
+ */
662
+ get fieldRevalidationEvent() {
663
+ const {
664
+ validateOn: validateOn1,
665
+ revalidateOn: revalidateOn1
666
+ } = this;
667
+ return revalidateOn1 === 'submit' ? undefined : validateOn1 === 'input' || validateOn1 === 'change' && revalidateOn1 === 'focusout' || validateOn1 === revalidateOn1 ? undefined : revalidateOn1;
668
+ }
669
+ /**
670
+ * Return true if validation has happened (by submitting or by an `@validateOn` event being triggered) and at least one field is invalid
671
+ */
672
+ get validationErrorsExist() {
673
+ const {
674
+ validationState: validationState1
675
+ } = this;
676
+ // Only consider validation errors for which we actually have a field rendered
677
+ return validationState1?.isResolved ? Object.keys(validationState1.value).some(name1 => this.fields.has(name1)) : false;
678
+ }
679
+ /**
680
+ * Call the passed validation callbacks, defined both on the whole form as well as on field level, and return the merged result for all fields.
681
+ */
682
+ async validate() {
683
+ const nativeValidation1 = this.args.ignoreNativeValidation !== true ? this.validateNative() : {};
684
+ const customFormValidation1 = await this.args.validate?.(this.effectiveData, Array.from(this.fields.keys()));
685
+ const customFieldValidations1 = [];
686
+ for (const [name1, field1] of this.fields) {
687
+ const fieldValidationResult1 = await field1.validate?.(this.effectiveData[name1], name1, this.effectiveData);
688
+ if (fieldValidationResult1) {
689
+ customFieldValidations1.push({
690
+ [name1]: fieldValidationResult1
691
+ });
692
+ }
693
+ }
694
+ return mergeErrorRecord(nativeValidation1, customFormValidation1, ...customFieldValidations1);
695
+ }
696
+ validateWithState = async () => {
697
+ const promise1 = this.validate();
698
+ this.validationState = new TrackedAsyncData(promise1);
699
+ return promise1;
700
+ };
701
+ validateNative() {
702
+ const form1 = this.formElement;
703
+ assert('Form element expected to be present. If you see this, please report it as a bug to ember-headless-form!', form1);
704
+ if (form1.checkValidity()) {
705
+ return;
706
+ }
707
+ const errors1 = {};
708
+ for (const el1 of form1.elements) {
709
+ // This is just to make TS happy, as we need to access properties on el that only form elements have, but elements in `form.elements` are just typed as plain `Element`. Should never occur in reality.
710
+ assert('Unexpected form element. If you see this, please report it as a bug to ember-headless-form!', el1 instanceof HTMLInputElement || el1 instanceof HTMLTextAreaElement || el1 instanceof HTMLSelectElement || el1 instanceof HTMLButtonElement || el1 instanceof HTMLFieldSetElement || el1 instanceof HTMLObjectElement || el1 instanceof HTMLOutputElement);
711
+ if (el1.validity.valid) {
712
+ continue;
713
+ }
714
+ const name1 = el1.name;
715
+ if (this.fields.has(name1)) {
716
+ errors1[name1] = [{
717
+ type: 'native',
718
+ value: this.effectiveData[name1],
719
+ message: el1.validationMessage
720
+ }];
721
+ } else {
722
+ warn(`An invalid form element with name "${name1}" was detected, but this name is not used as a form field. It will be ignored for validation. Make sure to apply the correct name to custom form elements that participate in form validation!`, {
723
+ id: 'headless-form.invalid-control-for-unknown-field'
724
+ });
725
+ }
726
+ }
727
+ return errors1;
728
+ }
729
+ /**
730
+ * Return a mapping of field to validation errors, for all fields that are invalid *and* for which validation errors should be visible.
731
+ * Validation errors will be visible for a certain field, if validation errors for *all* fields are visible, which is the case when trying to submit the form,
732
+ * or when that field has triggered the event given by `@validateOn` for showing validation errors before submitting, e.g. on blur.
733
+ */
734
+ get visibleErrors() {
735
+ if (!this.validationState?.isResolved) {
736
+ return undefined;
737
+ }
738
+ const visibleErrors1 = {};
739
+ for (const [field1, errors1] of Object.entries(this.validationState.value)) {
740
+ if (this.showErrorsFor(field1)) {
741
+ visibleErrors1[field1] = errors1;
742
+ }
743
+ }
744
+ return visibleErrors1;
745
+ }
746
+ /**
747
+ * Given a field name, return if eventual errors for the field should be visible. See `visibleErrors` for further details.
748
+ */
749
+ showErrorsFor = field1 => {
750
+ return this.showAllValidations || (this.fields.get(field1)?.validationEnabled ?? false);
751
+ };
752
+ /**
753
+ * Handle the `@validateOn` event for a certain field, e.g. "blur".
754
+ * Associating the event with a field is done by looking at the event target's `name` attribute, which must match one of the `<form.field @name="...">` invocations by the user's template.
755
+ * Validation will be triggered, and the particular field will be marked to show eventual validation errors.
756
+ */
757
+ handleFieldValidation = async e1 => {
758
+ // eslint-disable-next-line @typescript-eslint/init-declarations
759
+ let name1;
760
+ if (typeof e1 === 'string') {
761
+ name1 = e1;
762
+ } else {
763
+ const {
764
+ target: target1
765
+ } = e1;
766
+ name1 = target1.name;
767
+ }
768
+ if (name1) {
769
+ const field1 = this.fields.get(name1);
770
+ if (field1) {
771
+ await this.validateWithState();
772
+ field1.validationEnabled = true;
773
+ }
774
+ } else if (e1 instanceof Event) {
775
+ warn(`An event of type "${e1.type}" was received by headless-form, which is supposed to trigger validations for a certain field. But the name of that field could not be determined. Make sure that your control element has a \`name\` attribute matching the field, or use the yielded \`{{field.captureEvents}}\` to capture the events.`, {
776
+ id: 'headless-form.validation-event-for-unknown-field'
777
+ });
778
+ }
779
+ };
780
+ /**
781
+ * Handle the `@revalidateOn` event for a certain field, e.g. "blur".
782
+ * Associating the event with a field is done by looking at the event target's `name` attribute, which must match one of the `<form.field @name="...">` invocations by the user's template.
783
+ * When a field has been already marked to show validation errors by `@validateOn`, then for revalidation another validation will be triggered.
784
+ *
785
+ * The use case here is to allow this to happen more frequently than the initial validation, e.g. `@validateOn="blur" @revalidateOn="change"`.
786
+ */
787
+ handleFieldRevalidation = async e1 => {
788
+ const {
789
+ target: target1
790
+ } = e1;
791
+ const {
792
+ name: name1
793
+ } = target1;
794
+ if (name1) {
795
+ if (this.showErrorsFor(name1)) {
796
+ await this.validateWithState();
797
+ }
798
+ } else {
799
+ warn(`An event of type "${e1.type}" was received by headless-form, which is supposed to trigger validations for a certain field. But the name of that field could not be determined. Make sure that your control element has a \`name\` attribute matching the field, or use the yielded \`{{field.captureEvents}}\` to capture the events.`, {
800
+ id: 'headless-form.validation-event-for-unknown-field'
801
+ });
802
+ }
803
+ };
804
+ attachValidation = modifier((el1, [eventName1, handler1]) => {
805
+ if (eventName1) {
806
+ el1.addEventListener(eventName1, handler1);
807
+ return () => el1.removeEventListener(eventName1, handler1);
808
+ }
809
+ return undefined;
810
+ });
811
+ static {
812
+ setComponentTemplate(precompileTemplate("\n <form novalidate class={{styles.form}} data-test-form ...attributes {{this.registerForm}} {{on \"submit\" this.submit}} {{on \"reset\" this.reset}} {{this.attachValidation this.fieldValidationEvent this.handleFieldValidation}} {{this.attachValidation this.fieldRevalidationEvent this.handleFieldRevalidation}}>\n {{#let (component this.Field data=this.effectiveData set=this.set errors=this.visibleErrors registerField=this.registerField unregisterField=this.unregisterField triggerValidationFor=this.handleFieldValidation fieldValidationEvent=this.fieldValidationEvent fieldRevalidationEvent=this.fieldRevalidationEvent manageValidation=(modifier this.ManagaValidationModifier showErrorsFor=this.showErrorsFor)) as |WiredField|}}\n {{yield (hash Submit=Submit Reset=Reset Field=WiredField Checkbox=(component this.CheckboxField Field=WiredField) Currency=(component this.CurrencyField Field=WiredField) Date=(component this.DateField Field=WiredField) Email=(component this.EmailField Field=WiredField) List=(component this.ListField Field=WiredField) MultipleChoice=(component this.MultipleChoiceField Field=WiredField) Number=(component this.NumberField Field=WiredField) Password=(component this.PasswordField Field=WiredField) Phone=(component this.PhoneField Field=WiredField) Select=(component this.SelectField Field=WiredField) SingularChoice=(component this.SingularChoiceField Field=WiredField) Text=(component this.TextField Field=WiredField) TextArea=(component this.TextAreaField Field=WiredField) validationState=this.validationState submissionState=this.submissionState invalid=this.validationErrorsExist rawErrors=this.visibleErrors submit=this.submit reset=this.reset)}}\n {{/let}}\n </form>\n ", {
813
+ scope: () => ({
814
+ styles,
815
+ on,
816
+ hash,
817
+ Submit,
818
+ Reset
819
+ }),
820
+ strictMode: true
821
+ }), this);
822
+ }
823
+ }
824
+
825
+ export { Form as default };
826
+ //# sourceMappingURL=form.js.map