@lion/ui 0.6.0-alpha.2 → 0.6.0-alpha.3

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 (295) hide show
  1. package/components/checkbox-group/src/LionCheckboxIndeterminate.js +17 -2
  2. package/components/checkbox-group/test/lion-checkbox-indeterminate-integrations.test.js +3 -0
  3. package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +435 -396
  4. package/components/form/src/LionForm.js +24 -0
  5. package/components/form/test/lion-form.test.js +66 -2
  6. package/components/form-core/src/FormControlMixin.js +17 -1
  7. package/components/form-core/src/form-group/FormGroupMixin.js +5 -6
  8. package/components/form-core/test/FormControlMixin.test.js +39 -20
  9. package/components/form-core/test-suites/form-group/FormGroupMixin-input.suite.js +0 -47
  10. package/components/form-core/test-suites/form-group/FormGroupMixin.suite.js +21 -3
  11. package/components/input-range/src/LionInputRange.js +36 -4
  12. package/components/input-range/src/localizeNamespaceLoader.js +75 -0
  13. package/components/input-range/test/lion-input-range.test.js +6 -6
  14. package/components/input-range/translations/bg-BG.js +5 -0
  15. package/components/input-range/translations/bg.js +4 -0
  16. package/components/input-range/translations/cs-CZ.js +5 -0
  17. package/components/input-range/translations/cs.js +4 -0
  18. package/components/input-range/translations/de-DE.js +5 -0
  19. package/components/input-range/translations/de.js +4 -0
  20. package/components/input-range/translations/en-AU.js +5 -0
  21. package/components/input-range/translations/en-GB.js +5 -0
  22. package/components/input-range/translations/en-PH.js +5 -0
  23. package/components/input-range/translations/en-US.js +5 -0
  24. package/components/input-range/translations/en.js +4 -0
  25. package/components/input-range/translations/es-ES.js +5 -0
  26. package/components/input-range/translations/es.js +4 -0
  27. package/components/input-range/translations/fr-BE.js +5 -0
  28. package/components/input-range/translations/fr-FR.js +5 -0
  29. package/components/input-range/translations/fr.js +4 -0
  30. package/components/input-range/translations/hu-HU.js +5 -0
  31. package/components/input-range/translations/hu.js +4 -0
  32. package/components/input-range/translations/it-IT.js +5 -0
  33. package/components/input-range/translations/it.js +4 -0
  34. package/components/input-range/translations/nl-BE.js +5 -0
  35. package/components/input-range/translations/nl-NL.js +5 -0
  36. package/components/input-range/translations/nl.js +4 -0
  37. package/components/input-range/translations/pl-PL.js +5 -0
  38. package/components/input-range/translations/pl.js +4 -0
  39. package/components/input-range/translations/ro-RO.js +5 -0
  40. package/components/input-range/translations/ro.js +4 -0
  41. package/components/input-range/translations/ru-RU.js +5 -0
  42. package/components/input-range/translations/ru.js +4 -0
  43. package/components/input-range/translations/sk-SK.js +5 -0
  44. package/components/input-range/translations/sk.js +4 -0
  45. package/components/input-range/translations/uk-UA.js +5 -0
  46. package/components/input-range/translations/uk.js +4 -0
  47. package/components/input-range/translations/zh-CN.js +5 -0
  48. package/components/input-range/translations/zh.js +4 -0
  49. package/components/input-stepper/src/LionInputStepper.js +53 -33
  50. package/components/input-stepper/src/localizeNamespaceLoader.js +75 -0
  51. package/components/input-stepper/test/lion-input-stepper.test.js +61 -8
  52. package/components/input-stepper/translations/bg-BG.js +5 -0
  53. package/components/input-stepper/translations/bg.js +4 -0
  54. package/components/input-stepper/translations/cs-CZ.js +5 -0
  55. package/components/input-stepper/translations/cs.js +4 -0
  56. package/components/input-stepper/translations/de-DE.js +5 -0
  57. package/components/input-stepper/translations/de.js +4 -0
  58. package/components/input-stepper/translations/en-AU.js +5 -0
  59. package/components/input-stepper/translations/en-GB.js +5 -0
  60. package/components/input-stepper/translations/en-US.js +5 -0
  61. package/components/input-stepper/translations/en.js +4 -0
  62. package/components/input-stepper/translations/es-ES.js +5 -0
  63. package/components/input-stepper/translations/es.js +4 -0
  64. package/components/input-stepper/translations/fr-BE.js +5 -0
  65. package/components/input-stepper/translations/fr-FR.js +5 -0
  66. package/components/input-stepper/translations/fr.js +4 -0
  67. package/components/input-stepper/translations/hu-HU.js +5 -0
  68. package/components/input-stepper/translations/hu.js +4 -0
  69. package/components/input-stepper/translations/it-IT.js +5 -0
  70. package/components/input-stepper/translations/it.js +4 -0
  71. package/components/input-stepper/translations/nl-BE.js +5 -0
  72. package/components/input-stepper/translations/nl-NL.js +5 -0
  73. package/components/input-stepper/translations/nl.js +4 -0
  74. package/components/input-stepper/translations/pl-PL.js +5 -0
  75. package/components/input-stepper/translations/pl.js +4 -0
  76. package/components/input-stepper/translations/ro-RO.js +5 -0
  77. package/components/input-stepper/translations/ro.js +4 -0
  78. package/components/input-stepper/translations/ru-RU.js +5 -0
  79. package/components/input-stepper/translations/ru.js +4 -0
  80. package/components/input-stepper/translations/sk-SK.js +5 -0
  81. package/components/input-stepper/translations/sk.js +4 -0
  82. package/components/input-stepper/translations/uk-UA.js +5 -0
  83. package/components/input-stepper/translations/uk.js +4 -0
  84. package/components/input-stepper/translations/zh.js +4 -0
  85. package/custom-elements.json +1472 -12
  86. package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts +7 -1
  87. package/dist-types/components/checkbox-group/src/LionCheckboxIndeterminate.d.ts.map +1 -1
  88. package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts.map +1 -1
  89. package/dist-types/components/form/src/LionForm.d.ts +6 -0
  90. package/dist-types/components/form/src/LionForm.d.ts.map +1 -1
  91. package/dist-types/components/form-core/src/FormControlMixin.d.ts.map +1 -1
  92. package/dist-types/components/form-core/src/form-group/FormGroupMixin.d.ts.map +1 -1
  93. package/dist-types/components/form-core/test-suites/form-group/FormGroupMixin-input.suite.d.ts.map +1 -1
  94. package/dist-types/components/form-core/test-suites/form-group/FormGroupMixin.suite.d.ts.map +1 -1
  95. package/dist-types/components/input-range/src/LionInputRange.d.ts +7 -1
  96. package/dist-types/components/input-range/src/LionInputRange.d.ts.map +1 -1
  97. package/dist-types/components/input-range/src/localizeNamespaceLoader.d.ts +2 -0
  98. package/dist-types/components/input-range/src/localizeNamespaceLoader.d.ts.map +1 -0
  99. package/dist-types/components/input-range/translations/bg-BG.d.ts +6 -0
  100. package/dist-types/components/input-range/translations/bg-BG.d.ts.map +1 -0
  101. package/dist-types/components/input-range/translations/bg.d.ts +6 -0
  102. package/dist-types/components/input-range/translations/bg.d.ts.map +1 -0
  103. package/dist-types/components/input-range/translations/cs-CZ.d.ts +6 -0
  104. package/dist-types/components/input-range/translations/cs-CZ.d.ts.map +1 -0
  105. package/dist-types/components/input-range/translations/cs.d.ts +6 -0
  106. package/dist-types/components/input-range/translations/cs.d.ts.map +1 -0
  107. package/dist-types/components/input-range/translations/de-DE.d.ts +6 -0
  108. package/dist-types/components/input-range/translations/de-DE.d.ts.map +1 -0
  109. package/dist-types/components/input-range/translations/de.d.ts +6 -0
  110. package/dist-types/components/input-range/translations/de.d.ts.map +1 -0
  111. package/dist-types/components/input-range/translations/en-AU.d.ts +6 -0
  112. package/dist-types/components/input-range/translations/en-AU.d.ts.map +1 -0
  113. package/dist-types/components/input-range/translations/en-GB.d.ts +6 -0
  114. package/dist-types/components/input-range/translations/en-GB.d.ts.map +1 -0
  115. package/dist-types/components/input-range/translations/en-PH.d.ts +6 -0
  116. package/dist-types/components/input-range/translations/en-PH.d.ts.map +1 -0
  117. package/dist-types/components/input-range/translations/en-US.d.ts +6 -0
  118. package/dist-types/components/input-range/translations/en-US.d.ts.map +1 -0
  119. package/dist-types/components/input-range/translations/en.d.ts +6 -0
  120. package/dist-types/components/input-range/translations/en.d.ts.map +1 -0
  121. package/dist-types/components/input-range/translations/es-ES.d.ts +6 -0
  122. package/dist-types/components/input-range/translations/es-ES.d.ts.map +1 -0
  123. package/dist-types/components/input-range/translations/es.d.ts +6 -0
  124. package/dist-types/components/input-range/translations/es.d.ts.map +1 -0
  125. package/dist-types/components/input-range/translations/fr-BE.d.ts +6 -0
  126. package/dist-types/components/input-range/translations/fr-BE.d.ts.map +1 -0
  127. package/dist-types/components/input-range/translations/fr-FR.d.ts +6 -0
  128. package/dist-types/components/input-range/translations/fr-FR.d.ts.map +1 -0
  129. package/dist-types/components/input-range/translations/fr.d.ts +6 -0
  130. package/dist-types/components/input-range/translations/fr.d.ts.map +1 -0
  131. package/dist-types/components/input-range/translations/hu-HU.d.ts +6 -0
  132. package/dist-types/components/input-range/translations/hu-HU.d.ts.map +1 -0
  133. package/dist-types/components/input-range/translations/hu.d.ts +6 -0
  134. package/dist-types/components/input-range/translations/hu.d.ts.map +1 -0
  135. package/dist-types/components/input-range/translations/it-IT.d.ts +6 -0
  136. package/dist-types/components/input-range/translations/it-IT.d.ts.map +1 -0
  137. package/dist-types/components/input-range/translations/it.d.ts +6 -0
  138. package/dist-types/components/input-range/translations/it.d.ts.map +1 -0
  139. package/dist-types/components/input-range/translations/nl-BE.d.ts +6 -0
  140. package/dist-types/components/input-range/translations/nl-BE.d.ts.map +1 -0
  141. package/dist-types/components/input-range/translations/nl-NL.d.ts +6 -0
  142. package/dist-types/components/input-range/translations/nl-NL.d.ts.map +1 -0
  143. package/dist-types/components/input-range/translations/nl.d.ts +6 -0
  144. package/dist-types/components/input-range/translations/nl.d.ts.map +1 -0
  145. package/dist-types/components/input-range/translations/pl-PL.d.ts +6 -0
  146. package/dist-types/components/input-range/translations/pl-PL.d.ts.map +1 -0
  147. package/dist-types/components/input-range/translations/pl.d.ts +6 -0
  148. package/dist-types/components/input-range/translations/pl.d.ts.map +1 -0
  149. package/dist-types/components/input-range/translations/ro-RO.d.ts +6 -0
  150. package/dist-types/components/input-range/translations/ro-RO.d.ts.map +1 -0
  151. package/dist-types/components/input-range/translations/ro.d.ts +6 -0
  152. package/dist-types/components/input-range/translations/ro.d.ts.map +1 -0
  153. package/dist-types/components/input-range/translations/ru-RU.d.ts +6 -0
  154. package/dist-types/components/input-range/translations/ru-RU.d.ts.map +1 -0
  155. package/dist-types/components/input-range/translations/ru.d.ts +6 -0
  156. package/dist-types/components/input-range/translations/ru.d.ts.map +1 -0
  157. package/dist-types/components/input-range/translations/sk-SK.d.ts +6 -0
  158. package/dist-types/components/input-range/translations/sk-SK.d.ts.map +1 -0
  159. package/dist-types/components/input-range/translations/sk.d.ts +6 -0
  160. package/dist-types/components/input-range/translations/sk.d.ts.map +1 -0
  161. package/dist-types/components/input-range/translations/uk-UA.d.ts +6 -0
  162. package/dist-types/components/input-range/translations/uk-UA.d.ts.map +1 -0
  163. package/dist-types/components/input-range/translations/uk.d.ts +6 -0
  164. package/dist-types/components/input-range/translations/uk.d.ts.map +1 -0
  165. package/dist-types/components/input-range/translations/zh-CN.d.ts +6 -0
  166. package/dist-types/components/input-range/translations/zh-CN.d.ts.map +1 -0
  167. package/dist-types/components/input-range/translations/zh.d.ts +6 -0
  168. package/dist-types/components/input-range/translations/zh.d.ts.map +1 -0
  169. package/dist-types/components/input-stepper/src/LionInputStepper.d.ts +22 -3
  170. package/dist-types/components/input-stepper/src/LionInputStepper.d.ts.map +1 -1
  171. package/dist-types/components/input-stepper/src/localizeNamespaceLoader.d.ts +2 -0
  172. package/dist-types/components/input-stepper/src/localizeNamespaceLoader.d.ts.map +1 -0
  173. package/dist-types/components/input-stepper/translations/bg-BG.d.ts +6 -0
  174. package/dist-types/components/input-stepper/translations/bg-BG.d.ts.map +1 -0
  175. package/dist-types/components/input-stepper/translations/bg.d.ts +6 -0
  176. package/dist-types/components/input-stepper/translations/bg.d.ts.map +1 -0
  177. package/dist-types/components/input-stepper/translations/cs-CZ.d.ts +6 -0
  178. package/dist-types/components/input-stepper/translations/cs-CZ.d.ts.map +1 -0
  179. package/dist-types/components/input-stepper/translations/cs.d.ts +6 -0
  180. package/dist-types/components/input-stepper/translations/cs.d.ts.map +1 -0
  181. package/dist-types/components/input-stepper/translations/de-DE.d.ts +6 -0
  182. package/dist-types/components/input-stepper/translations/de-DE.d.ts.map +1 -0
  183. package/dist-types/components/input-stepper/translations/de.d.ts +6 -0
  184. package/dist-types/components/input-stepper/translations/de.d.ts.map +1 -0
  185. package/dist-types/components/input-stepper/translations/en-AU.d.ts +6 -0
  186. package/dist-types/components/input-stepper/translations/en-AU.d.ts.map +1 -0
  187. package/dist-types/components/input-stepper/translations/en-GB.d.ts +6 -0
  188. package/dist-types/components/input-stepper/translations/en-GB.d.ts.map +1 -0
  189. package/dist-types/components/input-stepper/translations/en-US.d.ts +6 -0
  190. package/dist-types/components/input-stepper/translations/en-US.d.ts.map +1 -0
  191. package/dist-types/components/input-stepper/translations/en.d.ts +6 -0
  192. package/dist-types/components/input-stepper/translations/en.d.ts.map +1 -0
  193. package/dist-types/components/input-stepper/translations/es-ES.d.ts +6 -0
  194. package/dist-types/components/input-stepper/translations/es-ES.d.ts.map +1 -0
  195. package/dist-types/components/input-stepper/translations/es.d.ts +6 -0
  196. package/dist-types/components/input-stepper/translations/es.d.ts.map +1 -0
  197. package/dist-types/components/input-stepper/translations/fr-BE.d.ts +6 -0
  198. package/dist-types/components/input-stepper/translations/fr-BE.d.ts.map +1 -0
  199. package/dist-types/components/input-stepper/translations/fr-FR.d.ts +6 -0
  200. package/dist-types/components/input-stepper/translations/fr-FR.d.ts.map +1 -0
  201. package/dist-types/components/input-stepper/translations/fr.d.ts +6 -0
  202. package/dist-types/components/input-stepper/translations/fr.d.ts.map +1 -0
  203. package/dist-types/components/input-stepper/translations/hu-HU.d.ts +6 -0
  204. package/dist-types/components/input-stepper/translations/hu-HU.d.ts.map +1 -0
  205. package/dist-types/components/input-stepper/translations/hu.d.ts +6 -0
  206. package/dist-types/components/input-stepper/translations/hu.d.ts.map +1 -0
  207. package/dist-types/components/input-stepper/translations/it-IT.d.ts +6 -0
  208. package/dist-types/components/input-stepper/translations/it-IT.d.ts.map +1 -0
  209. package/dist-types/components/input-stepper/translations/it.d.ts +6 -0
  210. package/dist-types/components/input-stepper/translations/it.d.ts.map +1 -0
  211. package/dist-types/components/input-stepper/translations/nl-BE.d.ts +6 -0
  212. package/dist-types/components/input-stepper/translations/nl-BE.d.ts.map +1 -0
  213. package/dist-types/components/input-stepper/translations/nl-NL.d.ts +6 -0
  214. package/dist-types/components/input-stepper/translations/nl-NL.d.ts.map +1 -0
  215. package/dist-types/components/input-stepper/translations/nl.d.ts +6 -0
  216. package/dist-types/components/input-stepper/translations/nl.d.ts.map +1 -0
  217. package/dist-types/components/input-stepper/translations/pl-PL.d.ts +6 -0
  218. package/dist-types/components/input-stepper/translations/pl-PL.d.ts.map +1 -0
  219. package/dist-types/components/input-stepper/translations/pl.d.ts +6 -0
  220. package/dist-types/components/input-stepper/translations/pl.d.ts.map +1 -0
  221. package/dist-types/components/input-stepper/translations/ro-RO.d.ts +6 -0
  222. package/dist-types/components/input-stepper/translations/ro-RO.d.ts.map +1 -0
  223. package/dist-types/components/input-stepper/translations/ro.d.ts +6 -0
  224. package/dist-types/components/input-stepper/translations/ro.d.ts.map +1 -0
  225. package/dist-types/components/input-stepper/translations/ru-RU.d.ts +6 -0
  226. package/dist-types/components/input-stepper/translations/ru-RU.d.ts.map +1 -0
  227. package/dist-types/components/input-stepper/translations/ru.d.ts +6 -0
  228. package/dist-types/components/input-stepper/translations/ru.d.ts.map +1 -0
  229. package/dist-types/components/input-stepper/translations/sk-SK.d.ts +6 -0
  230. package/dist-types/components/input-stepper/translations/sk-SK.d.ts.map +1 -0
  231. package/dist-types/components/input-stepper/translations/sk.d.ts +6 -0
  232. package/dist-types/components/input-stepper/translations/sk.d.ts.map +1 -0
  233. package/dist-types/components/input-stepper/translations/uk-UA.d.ts +6 -0
  234. package/dist-types/components/input-stepper/translations/uk-UA.d.ts.map +1 -0
  235. package/dist-types/components/input-stepper/translations/uk.d.ts +6 -0
  236. package/dist-types/components/input-stepper/translations/uk.d.ts.map +1 -0
  237. package/dist-types/components/input-stepper/translations/zh.d.ts +6 -0
  238. package/dist-types/components/input-stepper/translations/zh.d.ts.map +1 -0
  239. package/dist-types/tsconfig.tsbuildinfo +1 -1
  240. package/docs/components/checkbox-group/overview.md +2 -2
  241. package/docs/components/collapsible/overview.md +1 -1
  242. package/docs/components/combobox/overview.md +1 -1
  243. package/docs/components/combobox/use-cases.md +1 -1
  244. package/docs/components/dialog/overview.md +1 -1
  245. package/docs/components/fieldset/overview.md +5 -5
  246. package/docs/components/fieldset/use-cases.md +0 -1
  247. package/docs/components/form/overview.md +22 -11
  248. package/docs/components/form/use-cases.md +10 -14
  249. package/docs/components/icon/use-cases.md +1 -1
  250. package/docs/components/input/overview.md +1 -1
  251. package/docs/components/input-amount/overview.md +3 -3
  252. package/docs/components/input-date/overview.md +3 -3
  253. package/docs/components/input-datepicker/overview.md +5 -5
  254. package/docs/components/input-email/overview.md +2 -2
  255. package/docs/components/input-file/overview.md +1 -1
  256. package/docs/components/input-iban/overview.md +2 -2
  257. package/docs/components/input-range/overview.md +4 -6
  258. package/docs/components/input-range/use-cases.md +40 -48
  259. package/docs/components/input-stepper/overview.md +8 -8
  260. package/docs/components/input-stepper/use-cases.md +30 -21
  261. package/docs/components/input-tel/overview.md +1 -1
  262. package/docs/components/input-tel/use-cases.md +6 -6
  263. package/docs/components/input-tel-dropdown/overview.md +1 -1
  264. package/docs/components/radio-group/overview.md +3 -3
  265. package/docs/components/select-rich/use-cases.md +1 -1
  266. package/docs/components/tabs/examples.md +1 -1
  267. package/docs/fundamentals/index.md +4 -4
  268. package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
  269. package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
  270. package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
  271. package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
  272. package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
  273. package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
  274. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
  275. package/docs/fundamentals/rationales/accessibility.md +1 -1
  276. package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
  277. package/docs/fundamentals/systems/core/overview.md +1 -1
  278. package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
  279. package/docs/fundamentals/systems/form/model-value.md +1 -1
  280. package/docs/fundamentals/systems/form/overview.md +28 -28
  281. package/docs/fundamentals/systems/form/use-cases.md +16 -5
  282. package/docs/fundamentals/systems/form/validate.md +1 -1
  283. package/docs/fundamentals/systems/localize/overview.md +4 -4
  284. package/docs/fundamentals/systems/overlays/configuration.md +2 -2
  285. package/docs/fundamentals/systems/overlays/overview.md +5 -5
  286. package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
  287. package/docs/fundamentals/tools/helpers/overview.md +1 -1
  288. package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
  289. package/docs/guides/how-to/create-a-custom-field.md +5 -5
  290. package/docs/guides/how-to/create-a-form.md +4 -4
  291. package/docs/guides/how-to/extend-a-native-input.md +2 -2
  292. package/docs/guides/index.md +8 -8
  293. package/docs/guides/principles/index.md +5 -5
  294. package/docs/guides/principles/styling.md +1 -1
  295. package/package.json +3 -1
@@ -1,5 +1,9 @@
1
1
  import { LionFieldset } from '@lion/ui/fieldset.js';
2
2
 
3
+ /**
4
+ * @typedef {import('../../form-core/types/registration/FormRegistrarMixinTypes.js').FormRegistrarHost} FormRegistrarHost
5
+ */
6
+
3
7
  const throwFormNodeError = () => {
4
8
  throw new Error(
5
9
  'No form node found. Did you put a <form> element inside your custom-form element?',
@@ -57,6 +61,10 @@ export class LionForm extends LionFieldset {
57
61
  ev.stopPropagation();
58
62
  this.submitGroup();
59
63
  this.dispatchEvent(new Event('submit', { bubbles: true }));
64
+
65
+ if (this.hasFeedbackFor?.includes('error')) {
66
+ this._setFocusOnFirstErroneousFormElement(this);
67
+ }
60
68
  }
61
69
 
62
70
  reset() {
@@ -78,6 +86,22 @@ export class LionForm extends LionFieldset {
78
86
  this.dispatchEvent(new Event('reset', { bubbles: true }));
79
87
  }
80
88
 
89
+ /**
90
+ * @param {FormRegistrarHost} element
91
+ * @protected
92
+ */
93
+ _setFocusOnFirstErroneousFormElement(element) {
94
+ const firstFormElWithError =
95
+ element.formElements.find(child => child.hasFeedbackFor.includes('error')) ||
96
+ element.formElements[0];
97
+
98
+ if (firstFormElWithError.formElements?.length > 0) {
99
+ this._setFocusOnFirstErroneousFormElement(firstFormElWithError);
100
+ } else {
101
+ firstFormElWithError._focusableNode.focus();
102
+ }
103
+ }
104
+
81
105
  /** @private */
82
106
  __registerEventsForLionForm() {
83
107
  this._formNode.addEventListener('submit', this._submit);
@@ -1,6 +1,6 @@
1
1
  import { LionFieldset } from '@lion/ui/fieldset.js';
2
2
  import '@lion/ui/define/lion-fieldset.js';
3
- import { LionField } from '@lion/ui/form-core.js';
3
+ import { LionField, Required } from '@lion/ui/form-core.js';
4
4
  import '@lion/ui/define/lion-field.js';
5
5
  import '@lion/ui/define/lion-validation-feedback.js';
6
6
 
@@ -191,7 +191,7 @@ describe('<lion-form>', () => {
191
191
  const el = await fixture(html`
192
192
  <lion-form>
193
193
  <form>
194
- <button type="reset">submit</button>
194
+ <button type="reset">reset</button>
195
195
  </form>
196
196
  </lion-form>
197
197
  `);
@@ -202,4 +202,68 @@ describe('<lion-form>', () => {
202
202
  expect(dispatchSpy.args[0][0].type).to.equal('reset');
203
203
  expect(internalHandlerSpy).to.be.calledBefore(dispatchSpy);
204
204
  });
205
+
206
+ it('sets focus on submit to the first erroneous form element', async () => {
207
+ const el = await fixture(html`
208
+ <lion-form>
209
+ <form>
210
+ <${childTag} name="firstName" .modelValue=${'Foo'} .validators=${[
211
+ new Required(),
212
+ ]}></${childTag}>
213
+ <${childTag} name="lastName" .validators=${[new Required()]}></${childTag}>
214
+ <button type="submit">submit</button>
215
+ </form>
216
+ </lion-form>
217
+ `);
218
+ const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
219
+ const dispatchSpy = spy(el, 'dispatchEvent');
220
+ button.click();
221
+ expect(dispatchSpy.args[0][0].type).to.equal('submit');
222
+ // @ts-ignore [allow-protected] in test
223
+ expect(document.activeElement).to.equal(el.formElements[1]._inputNode);
224
+ });
225
+
226
+ it('sets focus on submit to the first erroneous form element with a fieldset', async () => {
227
+ const el = await fixture(html`
228
+ <lion-form>
229
+ <form>
230
+ <lion-fieldset name="name">
231
+ <${childTag} name="firstName" .modelValue=${'Foo'} .validators=${[
232
+ new Required(),
233
+ ]}></${childTag}>
234
+ <${childTag} name="lastName" .validators=${[new Required()]}></${childTag}>
235
+ </lion-fieldset>
236
+ <button type="submit">submit</button>
237
+ </form>
238
+ </lion-form>
239
+ `);
240
+ const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
241
+ const dispatchSpy = spy(el, 'dispatchEvent');
242
+ button.click();
243
+ expect(dispatchSpy.args[0][0].type).to.equal('submit');
244
+ const fieldset = el.formElements[0];
245
+ // @ts-ignore [allow-protected] in test
246
+ expect(document.activeElement).to.equal(fieldset.formElements[1]._inputNode);
247
+ });
248
+
249
+ it('sets focus on submit to the first form element within a erroneous fieldset', async () => {
250
+ const el = await fixture(html`
251
+ <lion-form>
252
+ <form>
253
+ <lion-fieldset name="name" .validators=${[new Required()]}>
254
+ <${childTag} name="firstName"></${childTag}>
255
+ <${childTag} name="lastName"></${childTag}>
256
+ </lion-fieldset>
257
+ <button type="submit">submit</button>
258
+ </form>
259
+ </lion-form>
260
+ `);
261
+ const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
262
+ const dispatchSpy = spy(el, 'dispatchEvent');
263
+ button.click();
264
+ expect(dispatchSpy.args[0][0].type).to.equal('submit');
265
+ const fieldset = el.formElements[0];
266
+ // @ts-ignore [allow-protected] in test
267
+ expect(document.activeElement).to.equal(fieldset.formElements[0]._inputNode);
268
+ });
205
269
  });
@@ -276,6 +276,10 @@ const FormControlMixinImplementation = superclass =>
276
276
  updated(changedProperties) {
277
277
  super.updated(changedProperties);
278
278
 
279
+ if (changedProperties.has('disabled')) {
280
+ this._inputNode?.setAttribute('aria-disabled', this.disabled.toString());
281
+ }
282
+
279
283
  if (changedProperties.has('_ariaLabelledNodes')) {
280
284
  this.__reflectAriaAttr(
281
285
  'aria-labelledby',
@@ -390,8 +394,20 @@ const FormControlMixinImplementation = superclass =>
390
394
  const insideNodes = nodes.filter(n => this.contains(n));
391
395
  const outsideNodes = nodes.filter(n => !this.contains(n));
392
396
 
397
+ const insideSlots = insideNodes.map(n => n.assignedSlot || n);
398
+ const orderedInsideSlots = [...getAriaElementsInRightDomOrder(insideSlots)];
399
+ /** @type {Element[]} */
400
+ const orderedInsideNodes = [];
401
+ orderedInsideSlots.forEach(assignedNode => {
402
+ insideNodes.forEach(node => {
403
+ // @ts-ignore
404
+ if (assignedNode.name === node.slot) {
405
+ orderedInsideNodes.push(node);
406
+ }
407
+ });
408
+ });
393
409
  // eslint-disable-next-line no-param-reassign
394
- nodes = [...getAriaElementsInRightDomOrder(insideNodes), ...outsideNodes];
410
+ nodes = [...orderedInsideNodes, ...outsideNodes];
395
411
  }
396
412
  const string = nodes.map(n => n.id).join(' ');
397
413
  this._inputNode.setAttribute(attrName, string);
@@ -46,7 +46,7 @@ const FormGroupMixinImplementation = superclass =>
46
46
  }
47
47
 
48
48
  /**
49
- * The host element with role group (or radigroup or form) containing neccessary aria attributes
49
+ * The host element with role group (or radio-group or form) containing necessary aria attributes
50
50
  * @protected
51
51
  */
52
52
  get _inputNode() {
@@ -478,7 +478,7 @@ const FormGroupMixinImplementation = superclass =>
478
478
 
479
479
  /**
480
480
  * Traverses the _parentFormGroup tree, and gathers all aria description elements
481
- * (feedback and helptext) that should be provided to children.
481
+ * (feedback) that should be provided to children.
482
482
  *
483
483
  * In the example below, when the input for 'street' has focus, a screenreader user
484
484
  * would hear the #group-error.
@@ -503,7 +503,9 @@ const FormGroupMixinImplementation = superclass =>
503
503
  const descriptionElements = parent._getAriaDescriptionElements();
504
504
  const orderedEls = getAriaElementsInRightDomOrder(descriptionElements, { reverse: true });
505
505
  orderedEls.forEach(el => {
506
- this.__descriptionElementsInParentChain.add(el);
506
+ if (el.getAttribute('slot') === 'feedback') {
507
+ this.__descriptionElementsInParentChain.add(el);
508
+ }
507
509
  });
508
510
  // Also check if the newly added child needs to refer grandparents
509
511
  parent = parent._parentFormGroup;
@@ -549,9 +551,6 @@ const FormGroupMixinImplementation = superclass =>
549
551
  this.__linkParentMessages(child);
550
552
  this.validate({ clearCurrentResult: true });
551
553
 
552
- if (typeof child.addToAriaLabelledBy === 'function' && this._labelNode) {
553
- child.addToAriaLabelledBy(this._labelNode, { reorder: false });
554
- }
555
554
  if (!child.modelValue) {
556
555
  const pVals = this.__pendingValues;
557
556
  if (pVals.modelValue && pVals.modelValue[child.name]) {
@@ -198,6 +198,21 @@ describe('FormControlMixin', () => {
198
198
  expect(descriptionIdsBefore).to.equal(descriptionIdsAfter);
199
199
  });
200
200
 
201
+ it('sets aria-disabled on inputNode based on disabled property', async () => {
202
+ const el = /** @type {FormControlMixinClass} */ (
203
+ await fixture(html`
204
+ <${tag}>${inputSlot}</${tag}>
205
+ `)
206
+ );
207
+ const { _inputNode } = getFormControlMembers(el);
208
+ expect(_inputNode.hasAttribute('aria-disabled')).to.be.true;
209
+ expect(_inputNode.getAttribute('aria-disabled')).to.equal('false');
210
+
211
+ el.disabled = true;
212
+
213
+ expect(_inputNode.getAttribute('aria-disabled')).to.equal('false');
214
+ });
215
+
201
216
  it('clicking the label should call `_onLabelClick`', async () => {
202
217
  const spy = sinon.spy();
203
218
  const el = /** @type {FormControlMixinClass} */ (
@@ -349,19 +364,18 @@ describe('FormControlMixin', () => {
349
364
  );
350
365
  });
351
366
 
352
- it('sorts internal elements, and allows opt-out', async () => {
367
+ it('sorts internal elements based on assigned slots, and allows opt-out', async () => {
353
368
  const wrapper = await fixture(html`
354
- <div id="wrapper">
355
- <${tag}>
356
- <input slot="input" id="myInput" />
357
- <label slot="label" id="internalLabel">Added to label by default</label>
358
- <div slot="help-text" id="internalDescription">
359
- Added to description by default
360
- </div>
361
- </${tag}>
362
- <div id="externalLabelB">should go after input internals</div>
363
- <div id="externalDescriptionB">should go after input internals</div>
364
- </div>`);
369
+ <div id="wrapper">
370
+ <${tag}>
371
+ <input slot="input" id="myInput" />
372
+ <label slot="label" id="internalLabel">Added to label by default</label>
373
+ <div slot="help-text" id="internalDescription">
374
+ Added to description by default
375
+ </div>
376
+ </${tag}>
377
+ </div>
378
+ `);
365
379
  const el = /** @type {FormControlMixinClass} */ (wrapper.querySelector(tagString));
366
380
  const { _inputNode } = getFormControlMembers(el);
367
381
 
@@ -370,6 +384,11 @@ describe('FormControlMixin', () => {
370
384
  // A real life scenario would be for instance when
371
385
  // a Field or FormGroup would be extended and an extra slot would be added in the template
372
386
  const myInput = /** @type {HTMLElement} */ (wrapper.querySelector('#myInput'));
387
+ const internalLabel = /** @type {HTMLElement} */ (wrapper.querySelector('#internalLabel'));
388
+ const internalDescription = /** @type {HTMLElement} */ (
389
+ wrapper.querySelector('#internalDescription')
390
+ );
391
+
373
392
  el.addToAriaLabelledBy(myInput);
374
393
  await el.updateComplete;
375
394
  el.addToAriaDescribedBy(myInput);
@@ -377,29 +396,29 @@ describe('FormControlMixin', () => {
377
396
 
378
397
  expect(
379
398
  /** @type {string} */ (_inputNode.getAttribute('aria-labelledby')).split(' '),
380
- ).to.eql(['myInput', 'internalLabel']);
399
+ ).to.eql(['internalLabel', 'myInput']);
381
400
  expect(
382
401
  /** @type {string} */ (_inputNode.getAttribute('aria-describedby')).split(' '),
383
- ).to.eql(['myInput', 'internalDescription']);
402
+ ).to.eql(['internalDescription', 'myInput']);
384
403
 
385
404
  // cleanup
386
- el.removeFromAriaLabelledBy(myInput);
405
+ el.removeFromAriaLabelledBy(internalLabel);
387
406
  await el.updateComplete;
388
- el.removeFromAriaDescribedBy(myInput);
407
+ el.removeFromAriaDescribedBy(internalDescription);
389
408
  await el.updateComplete;
390
409
 
391
410
  // opt-out of reorder
392
- el.addToAriaLabelledBy(myInput, { reorder: false });
411
+ el.addToAriaLabelledBy(internalLabel, { reorder: false });
393
412
  await el.updateComplete;
394
- el.addToAriaDescribedBy(myInput, { reorder: false });
413
+ el.addToAriaDescribedBy(internalDescription, { reorder: false });
395
414
  await el.updateComplete;
396
415
 
397
416
  expect(
398
417
  /** @type {string} */ (_inputNode.getAttribute('aria-labelledby')).split(' '),
399
- ).to.eql(['internalLabel', 'myInput']);
418
+ ).to.eql(['myInput', 'internalLabel']);
400
419
  expect(
401
420
  /** @type {string} */ (_inputNode.getAttribute('aria-describedby')).split(' '),
402
- ).to.eql(['internalDescription', 'myInput']);
421
+ ).to.eql(['myInput', 'internalDescription']);
403
422
  });
404
423
 
405
424
  it('respects provided order for external elements', async () => {
@@ -1,7 +1,6 @@
1
1
  import { LitElement } from 'lit';
2
2
  import '@lion/ui/define/lion-field.js';
3
3
  import '@lion/ui/define/lion-validation-feedback.js';
4
- import { getFormControlMembers } from '@lion/ui/form-core-test-helpers.js';
5
4
  import { LionInput } from '@lion/ui/input.js';
6
5
  import { localizeTearDown } from '@lion/ui/localize-test-helpers.js';
7
6
  import { defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing';
@@ -63,41 +62,6 @@ export function runFormGroupMixinInputSuite(cfg = {}) {
63
62
  'custom[]': ['custom 1', ''],
64
63
  });
65
64
  });
66
-
67
- it('suffixes child labels with group label, just like in <fieldset>', async () => {
68
- const el = /** @type {FormGroup} */ (
69
- await fixture(html`
70
- <${tag} label="set">
71
- <${childTag} name="A" label="fieldA"></${childTag}>
72
- <${childTag} name="B" label="fieldB"></${childTag}>
73
- </${tag}>
74
- `)
75
- );
76
- const { _labelNode } = getFormControlMembers(el);
77
-
78
- /**
79
- * @param {LionInput} formControl
80
- */
81
- function getLabels(formControl) {
82
- const control = getFormControlMembers(formControl);
83
-
84
- return /** @type {string} */ (control._inputNode.getAttribute('aria-labelledby')).split(
85
- ' ',
86
- );
87
- }
88
- const field1 = el.formElements[0];
89
- const field2 = el.formElements[1];
90
-
91
- expect(getLabels(field1)).to.eql([field1._labelNode.id, _labelNode.id]);
92
- expect(getLabels(field2)).to.eql([field2._labelNode.id, _labelNode.id]);
93
-
94
- // Test the cleanup on disconnected
95
- el.removeChild(field1);
96
-
97
- // TODO: wait for updated on disconnected to be fixed: https://github.com/lit/lit/issues/1901
98
- // await field1.updateComplete;
99
- // expect(getLabels(field1)).to.eql([field1._labelNode.id]);
100
- });
101
65
  });
102
66
 
103
67
  describe('Screen reader relations (aria-describedby) for child inputs and fieldsets', () => {
@@ -307,21 +271,10 @@ export function runFormGroupMixinInputSuite(cfg = {}) {
307
271
  await childAriaTest(await childAriaFixture('feedback'));
308
272
  });
309
273
 
310
- it(`reads help-text message belonging to fieldset when child input is focused
311
- (via aria-describedby)`, async () => {
312
- await childAriaTest(await childAriaFixture('help-text'));
313
- });
314
-
315
274
  // TODO: wait for updated on disconnected to be fixed: https://github.com/lit/lit/issues/1901
316
275
  it.skip(`cleans up feedback message belonging to fieldset on disconnect`, async () => {
317
276
  const el = await childAriaFixture('feedback');
318
277
  await childAriaTest(el, { cleanupPhase: true });
319
278
  });
320
-
321
- // TODO: wait for updated on disconnected to be fixed: https://github.com/lit/lit/issues/1901
322
- it.skip(`cleans up help-text message belonging to fieldset on disconnect`, async () => {
323
- const el = await childAriaFixture('help-text');
324
- await childAriaTest(el, { cleanupPhase: true });
325
- });
326
279
  });
327
280
  }
@@ -1356,6 +1356,24 @@ export function runFormGroupMixinSuite(cfg = {}) {
1356
1356
  expect(el.hasAttribute('aria-labelledby')).to.equal(true);
1357
1357
  expect(el.getAttribute('aria-labelledby')).contains(label.id);
1358
1358
  });
1359
+
1360
+ it('sets an aria-describedby to its children from element with slot="feedback"', async () => {
1361
+ const el = /** @type {FormGroup} */ (
1362
+ await fixture(html`
1363
+ <${tag}>
1364
+ <label slot="label">My Label</label>
1365
+ <div slot="feedback">My Feedback</div>
1366
+ ${inputSlots}
1367
+ </${tag}>
1368
+ `)
1369
+ );
1370
+ const feedback = /** @type {HTMLElement} */ (
1371
+ Array.from(el.children).find(child => child.slot === 'feedback')
1372
+ );
1373
+ expect(el.formElements[0]._inputNode.getAttribute('aria-describedby')).contains(
1374
+ feedback.id,
1375
+ );
1376
+ });
1359
1377
  });
1360
1378
 
1361
1379
  describe('Dynamically rendered children', () => {
@@ -1395,7 +1413,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
1395
1413
  const dynamicChildrenTag = unsafeStatic(dynamicChildrenTagString);
1396
1414
 
1397
1415
  it(`when rendering children right from the start, sets their values correctly
1398
- based on prefilled model/seriazedValue`, async () => {
1416
+ based on prefilled model/serializedValue`, async () => {
1399
1417
  const el = /** @type {DynamicCWrapper} */ (
1400
1418
  await fixture(html`
1401
1419
  <${dynamicChildrenTag}
@@ -1430,7 +1448,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
1430
1448
  });
1431
1449
 
1432
1450
  it(`when rendering children delayed, sets their values
1433
- correctly based on prefilled model/seriazedValue`, async () => {
1451
+ correctly based on prefilled model/serializedValue`, async () => {
1434
1452
  const el = /** @type {DynamicCWrapper} */ (
1435
1453
  await fixture(html`
1436
1454
  <${dynamicChildrenTag} .modelValue="${{ firstName: 'foo', lastName: 'bar' }}">
@@ -1463,7 +1481,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
1463
1481
  });
1464
1482
 
1465
1483
  it(`when rendering children partly delayed, sets their values correctly based on
1466
- prefilled model/seriazedValue`, async () => {
1484
+ prefilled model/serializedValue`, async () => {
1467
1485
  const el = /** @type {DynamicCWrapper} */ (
1468
1486
  await fixture(html`
1469
1487
  <${dynamicChildrenTag} .fields="${['firstName']}" .modelValue="${{
@@ -1,8 +1,9 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
2
  import { css, html } from 'lit';
3
+ import { LocalizeMixin, formatNumber } from '@lion/ui/localize-no-side-effects.js';
3
4
  import { ScopedStylesController } from '@lion/ui/core.js';
4
5
  import { LionInput } from '@lion/ui/input.js';
5
- import { formatNumber } from '@lion/ui/localize-no-side-effects.js';
6
+ import { localizeNamespaceLoader } from './localizeNamespaceLoader.js';
6
7
 
7
8
  /**
8
9
  * @typedef {import('lit').CSSResult} CSSResult
@@ -13,7 +14,7 @@ import { formatNumber } from '@lion/ui/localize-no-side-effects.js';
13
14
  *
14
15
  * @customElement `lion-input-range`
15
16
  */
16
- export class LionInputRange extends LionInput {
17
+ export class LionInputRange extends LocalizeMixin(LionInput) {
17
18
  /** @type {any} */
18
19
  static get properties() {
19
20
  return {
@@ -40,6 +41,11 @@ export class LionInputRange extends LionInput {
40
41
  };
41
42
  }
42
43
 
44
+ static localizeNamespaces = [
45
+ { 'lion-input-range': localizeNamespaceLoader },
46
+ ...super.localizeNamespaces,
47
+ ];
48
+
43
49
  /**
44
50
  * @param {CSSResult} scope
45
51
  */
@@ -54,6 +60,26 @@ export class LionInputRange extends LionInput {
54
60
  `;
55
61
  }
56
62
 
63
+ static get styles() {
64
+ return [
65
+ super.styles,
66
+ css`
67
+ .sr-only {
68
+ position: absolute;
69
+ width: 1px;
70
+ height: 1px;
71
+ overflow: hidden;
72
+ clip-path: inset(100%);
73
+ clip: rect(1px, 1px, 1px, 1px);
74
+ white-space: nowrap;
75
+ border: 0;
76
+ margin: 0;
77
+ padding: 0;
78
+ }
79
+ `,
80
+ ];
81
+ }
82
+
57
83
  get _inputNode() {
58
84
  return /** @type {HTMLInputElement} */ (super._inputNode);
59
85
  }
@@ -130,8 +156,14 @@ export class LionInputRange extends LionInput {
130
156
  ${!this.noMinMaxLabels
131
157
  ? html`
132
158
  <div class="input-range__limits">
133
- <span>${formatNumber(this.min)}</span>
134
- <span>${formatNumber(this.max)}</span>
159
+ <div>
160
+ <span class="sr-only">${this.msgLit('lion-input-range:minimum')} </span
161
+ >${formatNumber(this.min)}
162
+ </div>
163
+ <div>
164
+ <span class="sr-only">${this.msgLit('lion-input-range:maximum')} </span
165
+ >${formatNumber(this.max)}
166
+ </div>
135
167
  </div>
136
168
  `
137
169
  : ''}
@@ -0,0 +1,75 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ export const localizeNamespaceLoader = /** @param {string} locale */ locale => {
3
+ switch (locale) {
4
+ case 'bg-BG':
5
+ return import('@lion/ui/input-range-translations/bg-BG.js');
6
+ case 'bg':
7
+ return import('@lion/ui/input-range-translations/bg.js');
8
+ case 'cs-CZ':
9
+ return import('@lion/ui/input-range-translations/cs-CZ.js');
10
+ case 'cs':
11
+ return import('@lion/ui/input-range-translations/cs.js');
12
+ case 'de-DE':
13
+ return import('@lion/ui/input-range-translations/de-DE.js');
14
+ case 'de':
15
+ return import('@lion/ui/input-range-translations/de.js');
16
+ case 'en-AU':
17
+ return import('@lion/ui/input-range-translations/en-AU.js');
18
+ case 'en-GB':
19
+ return import('@lion/ui/input-range-translations/en-GB.js');
20
+ case 'en-US':
21
+ return import('@lion/ui/input-range-translations/en-US.js');
22
+ case 'en-PH':
23
+ case 'en':
24
+ return import('@lion/ui/input-range-translations/en.js');
25
+ case 'es-ES':
26
+ return import('@lion/ui/input-range-translations/es-ES.js');
27
+ case 'es':
28
+ return import('@lion/ui/input-range-translations/es.js');
29
+ case 'fr-FR':
30
+ return import('@lion/ui/input-range-translations/fr-FR.js');
31
+ case 'fr-BE':
32
+ return import('@lion/ui/input-range-translations/fr-BE.js');
33
+ case 'fr':
34
+ return import('@lion/ui/input-range-translations/fr.js');
35
+ case 'hu-HU':
36
+ return import('@lion/ui/input-range-translations/hu-HU.js');
37
+ case 'hu':
38
+ return import('@lion/ui/input-range-translations/hu.js');
39
+ case 'it-IT':
40
+ return import('@lion/ui/input-range-translations/it-IT.js');
41
+ case 'it':
42
+ return import('@lion/ui/input-range-translations/it.js');
43
+ case 'nl-BE':
44
+ return import('@lion/ui/input-range-translations/nl-BE.js');
45
+ case 'nl-NL':
46
+ return import('@lion/ui/input-range-translations/nl-NL.js');
47
+ case 'nl':
48
+ return import('@lion/ui/input-range-translations/nl.js');
49
+ case 'pl-PL':
50
+ return import('@lion/ui/input-range-translations/pl-PL.js');
51
+ case 'pl':
52
+ return import('@lion/ui/input-range-translations/pl.js');
53
+ case 'ro-RO':
54
+ return import('@lion/ui/input-range-translations/ro-RO.js');
55
+ case 'ro':
56
+ return import('@lion/ui/input-range-translations/ro.js');
57
+ case 'ru-RU':
58
+ return import('@lion/ui/input-range-translations/ru-RU.js');
59
+ case 'ru':
60
+ return import('@lion/ui/input-range-translations/ru.js');
61
+ case 'sk-SK':
62
+ return import('@lion/ui/input-range-translations/sk-SK.js');
63
+ case 'sk':
64
+ return import('@lion/ui/input-range-translations/sk.js');
65
+ case 'uk-UA':
66
+ return import('@lion/ui/input-range-translations/uk-UA.js');
67
+ case 'uk':
68
+ return import('@lion/ui/input-range-translations/uk.js');
69
+ case 'zh-CN':
70
+ case 'zh':
71
+ return import('@lion/ui/input-range-translations/zh.js');
72
+ default:
73
+ return import('@lion/ui/input-range-translations/en.js');
74
+ }
75
+ };
@@ -35,14 +35,14 @@ describe('<lion-input-range>', () => {
35
35
  expect(el.shadowRoot?.querySelectorAll('.input-range__limits span').length).to.equal(2);
36
36
  expect(
37
37
  /** @type {HTMLElement} */ (
38
- /** @type {ShadowRoot} */ (el.shadowRoot).querySelectorAll('.input-range__limits span')[0]
39
- ).innerText,
40
- ).to.equal(el.min.toString());
38
+ /** @type {ShadowRoot} */ (el.shadowRoot).querySelectorAll('.input-range__limits > div')[0]
39
+ ).textContent?.trim(),
40
+ ).to.equal(`Minimum ${el.min.toString()}`);
41
41
  expect(
42
42
  /** @type {HTMLElement} */ (
43
- /** @type {ShadowRoot} */ (el.shadowRoot).querySelectorAll('.input-range__limits span')[1]
44
- ).innerText,
45
- ).to.equal(el.max.toString());
43
+ /** @type {ShadowRoot} */ (el.shadowRoot).querySelectorAll('.input-range__limits > div')[1]
44
+ ).textContent?.trim(),
45
+ ).to.equal(`Maximum ${el.max.toString()}`);
46
46
  });
47
47
 
48
48
  it('update min and max attributes when min and max property change', async () => {
@@ -0,0 +1,5 @@
1
+ import bg from './bg.js';
2
+
3
+ export default {
4
+ ...bg,
5
+ };
@@ -0,0 +1,4 @@
1
+ export default {
2
+ minimum: 'Минимум',
3
+ maximum: 'Максимум',
4
+ };
@@ -0,0 +1,5 @@
1
+ import cs from './cs.js';
2
+
3
+ export default {
4
+ ...cs,
5
+ };
@@ -0,0 +1,4 @@
1
+ export default {
2
+ minimum: 'Minimální',
3
+ maximum: 'Maximálně',
4
+ };
@@ -0,0 +1,5 @@
1
+ import de from './de.js';
2
+
3
+ export default {
4
+ ...de,
5
+ };
@@ -0,0 +1,4 @@
1
+ export default {
2
+ minimum: 'Minimum',
3
+ maximum: 'Maximum',
4
+ };
@@ -0,0 +1,5 @@
1
+ import en from './en.js';
2
+
3
+ export default {
4
+ ...en,
5
+ };
@@ -0,0 +1,5 @@
1
+ import en from './en.js';
2
+
3
+ export default {
4
+ ...en,
5
+ };
@@ -0,0 +1,5 @@
1
+ import en from './en.js';
2
+
3
+ export default {
4
+ ...en,
5
+ };