@lion/ui 0.7.2 → 0.7.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 (325) hide show
  1. package/components/button/test-suites/LionButtonReset.suite.js +7 -9
  2. package/components/calendar/test/lion-calendar.test.js +26 -30
  3. package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +3 -0
  4. package/components/combobox/src/LionCombobox.js +35 -22
  5. package/components/combobox/test/lion-combobox.test.js +141 -98
  6. package/components/core/src/SlotMixin.js +7 -1
  7. package/components/form/test/lion-form.test.js +4 -4
  8. package/components/form-core/src/FormControlMixin.js +0 -9
  9. package/components/form-core/src/localizeNamespaceLoader.js +75 -0
  10. package/components/form-core/src/registration/FormRegisteringMixin.js +28 -0
  11. package/components/form-core/src/validate/LionValidationFeedback.js +36 -2
  12. package/components/form-core/test/validate/lion-validation-feedback.test.js +30 -2
  13. package/components/form-core/test-suites/FormRegistrationMixins.suite.js +17 -0
  14. package/components/form-core/test-suites/ValidateMixin.suite.js +2 -1
  15. package/components/form-core/test-suites/form-group/FormGroupMixin.suite.js +18 -18
  16. package/components/form-core/translations/bg-BG.js +5 -0
  17. package/components/form-core/translations/bg.js +6 -0
  18. package/components/form-core/translations/cs-CZ.js +5 -0
  19. package/components/form-core/translations/cs.js +6 -0
  20. package/components/form-core/translations/de-DE.js +5 -0
  21. package/components/form-core/translations/de.js +6 -0
  22. package/components/form-core/translations/en-AU.js +5 -0
  23. package/components/form-core/translations/en-GB.js +5 -0
  24. package/components/form-core/translations/en-US.js +5 -0
  25. package/components/form-core/translations/en.js +6 -0
  26. package/components/form-core/translations/es-ES.js +5 -0
  27. package/components/form-core/translations/es.js +6 -0
  28. package/components/form-core/translations/fr-BE.js +5 -0
  29. package/components/form-core/translations/fr-FR.js +5 -0
  30. package/components/form-core/translations/fr.js +6 -0
  31. package/components/form-core/translations/hu-HU.js +5 -0
  32. package/components/form-core/translations/hu.js +6 -0
  33. package/components/form-core/translations/it-IT.js +5 -0
  34. package/components/form-core/translations/it.js +6 -0
  35. package/components/form-core/translations/nl-BE.js +5 -0
  36. package/components/form-core/translations/nl-NL.js +5 -0
  37. package/components/form-core/translations/nl.js +6 -0
  38. package/components/form-core/translations/pl-PL.js +5 -0
  39. package/components/form-core/translations/pl.js +6 -0
  40. package/components/form-core/translations/ro-RO.js +5 -0
  41. package/components/form-core/translations/ro.js +6 -0
  42. package/components/form-core/translations/ru-RU.js +5 -0
  43. package/components/form-core/translations/ru.js +6 -0
  44. package/components/form-core/translations/sk-SK.js +5 -0
  45. package/components/form-core/translations/sk.js +6 -0
  46. package/components/form-core/translations/uk-UA.js +5 -0
  47. package/components/form-core/translations/uk.js +6 -0
  48. package/components/form-core/translations/zh.js +6 -0
  49. package/components/form-core/types/FormControlMixinTypes.ts +0 -4
  50. package/components/form-core/types/registration/FormRegisteringMixinTypes.ts +17 -4
  51. package/components/form-integrations/test/dialog-integrations.test.js +6 -4
  52. package/components/helpers/src/SbActionLogger.js +11 -2
  53. package/components/icon/test/lion-icon.test.js +12 -14
  54. package/components/input-amount/test/lion-input-amount.test.js +13 -14
  55. package/components/input-datepicker/test/lion-input-datepicker.test.js +4 -4
  56. package/components/input-file/src/LionInputFile.js +88 -30
  57. package/components/input-file/test/lion-input-file.test.js +105 -9
  58. package/components/input-file/test/lion-selected-file-list.test.js +2 -1
  59. package/components/input-file/translations/bg.js +3 -0
  60. package/components/input-file/translations/cs.js +3 -0
  61. package/components/input-file/translations/de.js +3 -0
  62. package/components/input-file/translations/en.js +3 -0
  63. package/components/input-file/translations/es.js +3 -0
  64. package/components/input-file/translations/fr.js +3 -0
  65. package/components/input-file/translations/hu.js +3 -0
  66. package/components/input-file/translations/it.js +3 -0
  67. package/components/input-file/translations/nl.js +3 -0
  68. package/components/input-file/translations/pl.js +3 -0
  69. package/components/input-file/translations/ro.js +3 -0
  70. package/components/input-file/translations/ru.js +3 -0
  71. package/components/input-file/translations/sk.js +3 -0
  72. package/components/input-file/translations/uk.js +3 -0
  73. package/components/input-file/translations/zh.js +3 -0
  74. package/components/input-tel-dropdown/test/LionInputTelDropdown.test.js +23 -23
  75. package/components/listbox/test-suites/ListboxMixin.suite.js +10 -3
  76. package/components/localize/src/date/utils/normalizeIntlDate.js +13 -2
  77. package/components/overlays/src/OverlayMixin.js +8 -1
  78. package/components/progress-indicator/test/lion-progress-indicator.test.js +42 -46
  79. package/components/select-rich/test/lion-select-rich.test.js +6 -8
  80. package/components/steps/test/lion-step.test.js +5 -7
  81. package/components/switch/src/LionSwitch.js +10 -0
  82. package/components/switch/test/lion-switch.test.js +5 -7
  83. package/components/tabs/src/LionTabs.js +10 -0
  84. package/components/tabs/test/lion-tabs.test.js +49 -38
  85. package/custom-elements.json +83073 -76992
  86. package/dist-types/components/button/test-suites/LionButtonReset.suite.d.ts.map +1 -1
  87. package/dist-types/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.d.ts.map +1 -1
  88. package/dist-types/components/combobox/src/LionCombobox.d.ts +12 -8
  89. package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
  90. package/dist-types/components/core/src/SlotMixin.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/LionField.d.ts +1 -1
  93. package/dist-types/components/form-core/src/localizeNamespaceLoader.d.ts +2 -0
  94. package/dist-types/components/form-core/src/localizeNamespaceLoader.d.ts.map +1 -0
  95. package/dist-types/components/form-core/src/registration/FormRegisteringMixin.d.ts.map +1 -1
  96. package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts +5 -6
  97. package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts.map +1 -1
  98. package/dist-types/components/form-core/test-suites/FormRegistrationMixins.suite.d.ts.map +1 -1
  99. package/dist-types/components/form-core/test-suites/ValidateMixin.suite.d.ts.map +1 -1
  100. package/dist-types/components/form-core/translations/bg-BG.d.ts +8 -0
  101. package/dist-types/components/form-core/translations/bg-BG.d.ts.map +1 -0
  102. package/dist-types/components/form-core/translations/bg.d.ts +8 -0
  103. package/dist-types/components/form-core/translations/bg.d.ts.map +1 -0
  104. package/dist-types/components/form-core/translations/cs-CZ.d.ts +8 -0
  105. package/dist-types/components/form-core/translations/cs-CZ.d.ts.map +1 -0
  106. package/dist-types/components/form-core/translations/cs.d.ts +8 -0
  107. package/dist-types/components/form-core/translations/cs.d.ts.map +1 -0
  108. package/dist-types/components/form-core/translations/de-DE.d.ts +8 -0
  109. package/dist-types/components/form-core/translations/de-DE.d.ts.map +1 -0
  110. package/dist-types/components/form-core/translations/de.d.ts +8 -0
  111. package/dist-types/components/form-core/translations/de.d.ts.map +1 -0
  112. package/dist-types/components/form-core/translations/en-AU.d.ts +8 -0
  113. package/dist-types/components/form-core/translations/en-AU.d.ts.map +1 -0
  114. package/dist-types/components/form-core/translations/en-GB.d.ts +8 -0
  115. package/dist-types/components/form-core/translations/en-GB.d.ts.map +1 -0
  116. package/dist-types/components/form-core/translations/en-US.d.ts +8 -0
  117. package/dist-types/components/form-core/translations/en-US.d.ts.map +1 -0
  118. package/dist-types/components/form-core/translations/en.d.ts +8 -0
  119. package/dist-types/components/form-core/translations/en.d.ts.map +1 -0
  120. package/dist-types/components/form-core/translations/es-ES.d.ts +8 -0
  121. package/dist-types/components/form-core/translations/es-ES.d.ts.map +1 -0
  122. package/dist-types/components/form-core/translations/es.d.ts +8 -0
  123. package/dist-types/components/form-core/translations/es.d.ts.map +1 -0
  124. package/dist-types/components/form-core/translations/fr-BE.d.ts +8 -0
  125. package/dist-types/components/form-core/translations/fr-BE.d.ts.map +1 -0
  126. package/dist-types/components/form-core/translations/fr-FR.d.ts +8 -0
  127. package/dist-types/components/form-core/translations/fr-FR.d.ts.map +1 -0
  128. package/dist-types/components/form-core/translations/fr.d.ts +8 -0
  129. package/dist-types/components/form-core/translations/fr.d.ts.map +1 -0
  130. package/dist-types/components/form-core/translations/hu-HU.d.ts +8 -0
  131. package/dist-types/components/form-core/translations/hu-HU.d.ts.map +1 -0
  132. package/dist-types/components/form-core/translations/hu.d.ts +8 -0
  133. package/dist-types/components/form-core/translations/hu.d.ts.map +1 -0
  134. package/dist-types/components/form-core/translations/it-IT.d.ts +8 -0
  135. package/dist-types/components/form-core/translations/it-IT.d.ts.map +1 -0
  136. package/dist-types/components/form-core/translations/it.d.ts +8 -0
  137. package/dist-types/components/form-core/translations/it.d.ts.map +1 -0
  138. package/dist-types/components/form-core/translations/nl-BE.d.ts +8 -0
  139. package/dist-types/components/form-core/translations/nl-BE.d.ts.map +1 -0
  140. package/dist-types/components/form-core/translations/nl-NL.d.ts +8 -0
  141. package/dist-types/components/form-core/translations/nl-NL.d.ts.map +1 -0
  142. package/dist-types/components/form-core/translations/nl.d.ts +8 -0
  143. package/dist-types/components/form-core/translations/nl.d.ts.map +1 -0
  144. package/dist-types/components/form-core/translations/pl-PL.d.ts +8 -0
  145. package/dist-types/components/form-core/translations/pl-PL.d.ts.map +1 -0
  146. package/dist-types/components/form-core/translations/pl.d.ts +8 -0
  147. package/dist-types/components/form-core/translations/pl.d.ts.map +1 -0
  148. package/dist-types/components/form-core/translations/ro-RO.d.ts +8 -0
  149. package/dist-types/components/form-core/translations/ro-RO.d.ts.map +1 -0
  150. package/dist-types/components/form-core/translations/ro.d.ts +8 -0
  151. package/dist-types/components/form-core/translations/ro.d.ts.map +1 -0
  152. package/dist-types/components/form-core/translations/ru-RU.d.ts +8 -0
  153. package/dist-types/components/form-core/translations/ru-RU.d.ts.map +1 -0
  154. package/dist-types/components/form-core/translations/ru.d.ts +8 -0
  155. package/dist-types/components/form-core/translations/ru.d.ts.map +1 -0
  156. package/dist-types/components/form-core/translations/sk-SK.d.ts +8 -0
  157. package/dist-types/components/form-core/translations/sk-SK.d.ts.map +1 -0
  158. package/dist-types/components/form-core/translations/sk.d.ts +8 -0
  159. package/dist-types/components/form-core/translations/sk.d.ts.map +1 -0
  160. package/dist-types/components/form-core/translations/uk-UA.d.ts +8 -0
  161. package/dist-types/components/form-core/translations/uk-UA.d.ts.map +1 -0
  162. package/dist-types/components/form-core/translations/uk.d.ts +8 -0
  163. package/dist-types/components/form-core/translations/uk.d.ts.map +1 -0
  164. package/dist-types/components/form-core/translations/zh.d.ts +8 -0
  165. package/dist-types/components/form-core/translations/zh.d.ts.map +1 -0
  166. package/dist-types/components/form-core/types/FormControlMixinTypes.d.ts +0 -4
  167. package/dist-types/components/form-core/types/FormControlMixinTypes.d.ts.map +1 -1
  168. package/dist-types/components/form-core/types/registration/FormRegisteringMixinTypes.d.ts +14 -4
  169. package/dist-types/components/form-core/types/registration/FormRegisteringMixinTypes.d.ts.map +1 -1
  170. package/dist-types/components/helpers/src/SbActionLogger.d.ts.map +1 -1
  171. package/dist-types/components/input-file/src/LionInputFile.d.ts +12 -6
  172. package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -1
  173. package/dist-types/components/input-file/translations/bg-BG.d.ts +3 -0
  174. package/dist-types/components/input-file/translations/bg.d.ts +3 -0
  175. package/dist-types/components/input-file/translations/cs-CZ.d.ts +3 -0
  176. package/dist-types/components/input-file/translations/cs.d.ts +3 -0
  177. package/dist-types/components/input-file/translations/de-DE.d.ts +3 -0
  178. package/dist-types/components/input-file/translations/de.d.ts +3 -0
  179. package/dist-types/components/input-file/translations/en-AU.d.ts +3 -0
  180. package/dist-types/components/input-file/translations/en-GB.d.ts +3 -0
  181. package/dist-types/components/input-file/translations/en-PH.d.ts +3 -0
  182. package/dist-types/components/input-file/translations/en-US.d.ts +3 -0
  183. package/dist-types/components/input-file/translations/en.d.ts +3 -0
  184. package/dist-types/components/input-file/translations/es-ES.d.ts +3 -0
  185. package/dist-types/components/input-file/translations/es.d.ts +3 -0
  186. package/dist-types/components/input-file/translations/fr-BE.d.ts +3 -0
  187. package/dist-types/components/input-file/translations/fr-FR.d.ts +3 -0
  188. package/dist-types/components/input-file/translations/fr.d.ts +3 -0
  189. package/dist-types/components/input-file/translations/hu-HU.d.ts +3 -0
  190. package/dist-types/components/input-file/translations/hu.d.ts +3 -0
  191. package/dist-types/components/input-file/translations/it-IT.d.ts +3 -0
  192. package/dist-types/components/input-file/translations/it.d.ts +3 -0
  193. package/dist-types/components/input-file/translations/nl-BE.d.ts +3 -0
  194. package/dist-types/components/input-file/translations/nl-NL.d.ts +3 -0
  195. package/dist-types/components/input-file/translations/nl.d.ts +3 -0
  196. package/dist-types/components/input-file/translations/pl-PL.d.ts +3 -0
  197. package/dist-types/components/input-file/translations/pl.d.ts +3 -0
  198. package/dist-types/components/input-file/translations/ro-RO.d.ts +3 -0
  199. package/dist-types/components/input-file/translations/ro.d.ts +3 -0
  200. package/dist-types/components/input-file/translations/ru-RU.d.ts +3 -0
  201. package/dist-types/components/input-file/translations/ru.d.ts +3 -0
  202. package/dist-types/components/input-file/translations/sk-SK.d.ts +3 -0
  203. package/dist-types/components/input-file/translations/sk.d.ts +3 -0
  204. package/dist-types/components/input-file/translations/uk-UA.d.ts +3 -0
  205. package/dist-types/components/input-file/translations/uk.d.ts +3 -0
  206. package/dist-types/components/input-file/translations/zh-CN.d.ts +3 -0
  207. package/dist-types/components/input-file/translations/zh.d.ts +3 -0
  208. package/dist-types/components/input-tel-dropdown/test/LionInputTelDropdown.test.d.ts.map +1 -1
  209. package/dist-types/components/listbox/src/LionOption.d.ts +1 -1
  210. package/dist-types/components/listbox/test-suites/ListboxMixin.suite.d.ts.map +1 -1
  211. package/dist-types/components/localize/src/date/utils/normalizeIntlDate.d.ts.map +1 -1
  212. package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
  213. package/dist-types/components/switch/src/LionSwitch.d.ts.map +1 -1
  214. package/dist-types/components/tabs/src/LionTabs.d.ts.map +1 -1
  215. package/dist-types/tsconfig.tsbuildinfo +1 -1
  216. package/docs/components/accordion/api-table.md +31 -0
  217. package/docs/components/button/api-table.md +104 -0
  218. package/docs/components/button/use-cases.md +11 -10
  219. package/docs/components/calendar/api-table.md +44 -0
  220. package/docs/components/checkbox-group/api-table.md +564 -0
  221. package/docs/components/checkbox-group/overview.md +2 -2
  222. package/docs/components/collapsible/api-table.md +36 -0
  223. package/docs/components/collapsible/assets/applyDemoCollapsibleStyles.js +6 -2
  224. package/docs/components/collapsible/overview.md +1 -1
  225. package/docs/components/combobox/api-table.md +256 -0
  226. package/docs/components/combobox/overview.md +4 -3
  227. package/docs/components/combobox/src/gh-combobox/gh-button.js +3 -1
  228. package/docs/components/combobox/src/gh-combobox/gh-combobox.js +9 -2
  229. package/docs/components/combobox/src/google-combobox/google-combobox.js +6 -8
  230. package/docs/components/combobox/src/md-combobox/MdFieldMixin.js +7 -3
  231. package/docs/components/combobox/src/md-combobox/style/md-ripple.js +1 -0
  232. package/docs/components/combobox/src/wa-combobox/wa-combobox.js +15 -3
  233. package/docs/components/combobox/use-cases.md +19 -17
  234. package/docs/components/dialog/api-table.md +45 -0
  235. package/docs/components/dialog/overview.md +1 -1
  236. package/docs/components/drawer/api-table.md +45 -0
  237. package/docs/components/fieldset/api-table.md +163 -0
  238. package/docs/components/fieldset/overview.md +5 -5
  239. package/docs/components/form/api-table.md +1 -0
  240. package/docs/components/form/overview.md +3 -3
  241. package/docs/components/icon/api-table.md +29 -0
  242. package/docs/components/icon/use-cases.md +1 -1
  243. package/docs/components/input/api-table.md +187 -0
  244. package/docs/components/input/overview.md +1 -1
  245. package/docs/components/input/use-cases.md +3 -2
  246. package/docs/components/input-amount/api-table.md +196 -0
  247. package/docs/components/input-amount/overview.md +3 -3
  248. package/docs/components/input-date/api-table.md +188 -0
  249. package/docs/components/input-date/overview.md +3 -3
  250. package/docs/components/input-datepicker/api-table.md +234 -0
  251. package/docs/components/input-datepicker/overview.md +5 -5
  252. package/docs/components/input-email/api-table.md +187 -0
  253. package/docs/components/input-email/overview.md +2 -2
  254. package/docs/components/input-file/api-table.md +272 -0
  255. package/docs/components/input-file/overview.md +1 -1
  256. package/docs/components/input-iban/api-table.md +187 -0
  257. package/docs/components/input-iban/overview.md +2 -2
  258. package/docs/components/input-range/api-table.md +198 -0
  259. package/docs/components/input-range/overview.md +2 -2
  260. package/docs/components/input-stepper/api-table.md +205 -0
  261. package/docs/components/input-stepper/overview.md +1 -1
  262. package/docs/components/input-tel/api-table.md +202 -0
  263. package/docs/components/input-tel/overview.md +1 -1
  264. package/docs/components/input-tel/use-cases.md +6 -6
  265. package/docs/components/input-tel-dropdown/api-table.md +213 -0
  266. package/docs/components/input-tel-dropdown/overview.md +1 -1
  267. package/docs/components/input-tel-dropdown/src/intl-input-tel-dropdown.js +15 -5
  268. package/docs/components/listbox/api-table.md +293 -0
  269. package/docs/components/listbox/use-cases.md +1 -1
  270. package/docs/components/pagination/api-table.md +33 -0
  271. package/docs/components/progress-indicator/api-table.md +36 -0
  272. package/docs/components/progress-indicator/examples.md +11 -11
  273. package/docs/components/radio-group/api-table.md +378 -0
  274. package/docs/components/radio-group/overview.md +3 -3
  275. package/docs/components/select/api-table.md +181 -0
  276. package/docs/components/select/use-cases.md +1 -1
  277. package/docs/components/select-rich/api-table.md +288 -0
  278. package/docs/components/select-rich/use-cases.md +1 -1
  279. package/docs/components/steps/api-table.md +80 -0
  280. package/docs/components/switch/api-table.md +229 -0
  281. package/docs/components/tabs/api-table.md +32 -0
  282. package/docs/components/tabs/examples.md +1 -1
  283. package/docs/components/tabs/src/lea-tab-panel.js +3 -1
  284. package/docs/components/tabs/src/lea-tab.js +7 -2
  285. package/docs/components/textarea/api-table.md +192 -0
  286. package/docs/components/tooltip/api-table.md +53 -0
  287. package/docs/fundamentals/index.md +4 -4
  288. package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
  289. package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
  290. package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
  291. package/docs/fundamentals/node-tools/providence-analytics/assets/_mermaid.svg.js +32 -8
  292. package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
  293. package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
  294. package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
  295. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
  296. package/docs/fundamentals/rationales/accessibility.md +1 -1
  297. package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
  298. package/docs/fundamentals/systems/core/api-table.md +34 -0
  299. package/docs/fundamentals/systems/core/overview.md +1 -1
  300. package/docs/fundamentals/systems/form/api-table.md +166 -0
  301. package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
  302. package/docs/fundamentals/systems/form/model-value.md +1 -1
  303. package/docs/fundamentals/systems/form/overview.md +28 -28
  304. package/docs/fundamentals/systems/form/validate.md +3 -3
  305. package/docs/fundamentals/systems/localize/api-table.md +65 -0
  306. package/docs/fundamentals/systems/localize/overview.md +4 -4
  307. package/docs/fundamentals/systems/overlays/_configuration-positioning.md +0 -9
  308. package/docs/fundamentals/systems/overlays/_edge-cases.md +74 -80
  309. package/docs/fundamentals/systems/overlays/api-table.md +168 -0
  310. package/docs/fundamentals/systems/overlays/configuration.md +2 -2
  311. package/docs/fundamentals/systems/overlays/overview.md +5 -5
  312. package/docs/fundamentals/systems/overlays/use-cases.md +5 -8
  313. package/docs/fundamentals/tools/helpers/action-logger.md +3 -6
  314. package/docs/fundamentals/tools/helpers/overview.md +1 -1
  315. package/docs/fundamentals/tools/singleton-manager/example-complex/demo-app.js +3 -1
  316. package/docs/fundamentals/tools/singleton-manager/example-fail/demo-app.js +3 -1
  317. package/docs/fundamentals/tools/singleton-manager/example-success/demo-app.js +3 -1
  318. package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
  319. package/docs/guides/how-to/create-a-custom-field.md +5 -5
  320. package/docs/guides/how-to/create-a-form.md +4 -4
  321. package/docs/guides/how-to/extend-a-native-input.md +2 -2
  322. package/docs/guides/index.md +8 -8
  323. package/docs/guides/principles/index.md +5 -5
  324. package/docs/guides/principles/styling.md +1 -1
  325. package/package.json +6 -5
@@ -131,7 +131,13 @@ const SlotMixinImplementation = superclass =>
131
131
  if (isFirstRender) {
132
132
  // @ts-expect-error wait for browser support
133
133
  const supportsScopedRegistry = !!ShadowRoot.prototype.createElement;
134
- const registryRoot = supportsScopedRegistry ? this.shadowRoot || document : document;
134
+ const hasShadowRoot = Boolean(this.shadowRoot);
135
+ if (!hasShadowRoot) {
136
+ // TODO: throw an error in a breaking release
137
+ // eslint-disable-next-line no-console
138
+ console.error(`[SlotMixin] No shadowRoot was found`);
139
+ }
140
+ const registryRoot = supportsScopedRegistry ? this.shadowRoot : document;
135
141
 
136
142
  // @ts-expect-error wait for browser support
137
143
  const renderTargetThatRespectsShadowRootScoping = registryRoot.createElement('div');
@@ -208,8 +208,8 @@ describe('<lion-form>', () => {
208
208
  <lion-form>
209
209
  <form>
210
210
  <${childTag} name="firstName" .modelValue=${'Foo'} .validators=${[
211
- new Required(),
212
- ]}></${childTag}>
211
+ new Required(),
212
+ ]}></${childTag}>
213
213
  <${childTag} name="lastName" .validators=${[new Required()]}></${childTag}>
214
214
  <button type="submit">submit</button>
215
215
  </form>
@@ -229,8 +229,8 @@ describe('<lion-form>', () => {
229
229
  <form>
230
230
  <lion-fieldset name="name">
231
231
  <${childTag} name="firstName" .modelValue=${'Foo'} .validators=${[
232
- new Required(),
233
- ]}></${childTag}>
232
+ new Required(),
233
+ ]}></${childTag}>
234
234
  <${childTag} name="lastName" .validators=${[new Required()]}></${childTag}>
235
235
  </lion-fieldset>
236
236
  <button type="submit">submit</button>
@@ -34,7 +34,6 @@ const FormControlMixinImplementation = superclass =>
34
34
  /** @type {any} */
35
35
  static get properties() {
36
36
  return {
37
- name: { type: String, reflect: true },
38
37
  readOnly: { type: Boolean, attribute: 'readonly', reflect: true },
39
38
  label: String, // FIXME: { attribute: false } breaks a bunch of tests, but shouldn't...
40
39
  labelSrOnly: { type: Boolean, attribute: 'label-sr-only', reflect: true },
@@ -156,14 +155,6 @@ const FormControlMixinImplementation = superclass =>
156
155
  constructor() {
157
156
  super();
158
157
 
159
- /**
160
- * The name the element will be registered with to the .formElements collection
161
- * of the parent. Also, it serves as the key of key/value pairs in
162
- * modelValue/serializedValue objects
163
- * @type {string}
164
- */
165
- this.name = '';
166
-
167
158
  /**
168
159
  * A Boolean attribute which, if present, indicates that the user should not be able to edit
169
160
  * the value of the input. The difference between disabled and readonly is that read-only
@@ -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/form-core-translations/bg-BG.js');
6
+ case 'bg':
7
+ return import('@lion/ui/form-core-translations/bg.js');
8
+ case 'cs-CZ':
9
+ return import('@lion/ui/form-core-translations/cs-CZ.js');
10
+ case 'cs':
11
+ return import('@lion/ui/form-core-translations/cs.js');
12
+ case 'de-DE':
13
+ return import('@lion/ui/form-core-translations/de-DE.js');
14
+ case 'de':
15
+ return import('@lion/ui/form-core-translations/de.js');
16
+ case 'en-AU':
17
+ return import('@lion/ui/form-core-translations/en-AU.js');
18
+ case 'en-GB':
19
+ return import('@lion/ui/form-core-translations/en-GB.js');
20
+ case 'en-US':
21
+ return import('@lion/ui/form-core-translations/en-US.js');
22
+ case 'en-PH':
23
+ case 'en':
24
+ return import('@lion/ui/form-core-translations/en.js');
25
+ case 'es-ES':
26
+ return import('@lion/ui/form-core-translations/es-ES.js');
27
+ case 'es':
28
+ return import('@lion/ui/form-core-translations/es.js');
29
+ case 'fr-FR':
30
+ return import('@lion/ui/form-core-translations/fr-FR.js');
31
+ case 'fr-BE':
32
+ return import('@lion/ui/form-core-translations/fr-BE.js');
33
+ case 'fr':
34
+ return import('@lion/ui/form-core-translations/fr.js');
35
+ case 'hu-HU':
36
+ return import('@lion/ui/form-core-translations/hu-HU.js');
37
+ case 'hu':
38
+ return import('@lion/ui/form-core-translations/hu.js');
39
+ case 'it-IT':
40
+ return import('@lion/ui/form-core-translations/it-IT.js');
41
+ case 'it':
42
+ return import('@lion/ui/form-core-translations/it.js');
43
+ case 'nl-BE':
44
+ return import('@lion/ui/form-core-translations/nl-BE.js');
45
+ case 'nl-NL':
46
+ return import('@lion/ui/form-core-translations/nl-NL.js');
47
+ case 'nl':
48
+ return import('@lion/ui/form-core-translations/nl.js');
49
+ case 'pl-PL':
50
+ return import('@lion/ui/form-core-translations/pl-PL.js');
51
+ case 'pl':
52
+ return import('@lion/ui/form-core-translations/pl.js');
53
+ case 'ro-RO':
54
+ return import('@lion/ui/form-core-translations/ro-RO.js');
55
+ case 'ro':
56
+ return import('@lion/ui/form-core-translations/ro.js');
57
+ case 'ru-RU':
58
+ return import('@lion/ui/form-core-translations/ru-RU.js');
59
+ case 'ru':
60
+ return import('@lion/ui/form-core-translations/ru.js');
61
+ case 'sk-SK':
62
+ return import('@lion/ui/form-core-translations/sk-SK.js');
63
+ case 'sk':
64
+ return import('@lion/ui/form-core-translations/sk.js');
65
+ case 'uk-UA':
66
+ return import('@lion/ui/form-core-translations/uk-UA.js');
67
+ case 'uk':
68
+ return import('@lion/ui/form-core-translations/uk.js');
69
+ case 'zh-CN':
70
+ case 'zh':
71
+ return import('@lion/ui/form-core-translations/zh.js');
72
+ default:
73
+ return import('@lion/ui/form-core-translations/en.js');
74
+ }
75
+ };
@@ -22,6 +22,14 @@ const FormRegisteringMixinImplementation = superclass =>
22
22
  class extends superclass {
23
23
  constructor() {
24
24
  super();
25
+ /**
26
+ * The name the element will be registered with to the .formElements collection
27
+ * of the parent. Also, it serves as the key of key/value pairs in
28
+ * modelValue/serializedValue objects
29
+ * @type {string}
30
+ */
31
+ this.name = '';
32
+
25
33
  /**
26
34
  * The registrar this FormControl registers to, Usually a descendant of FormGroup or
27
35
  * ChoiceGroup
@@ -37,8 +45,28 @@ const FormRegisteringMixinImplementation = superclass =>
37
45
  this.allowCrossRootRegistration = false;
38
46
  }
39
47
 
48
+ /**
49
+ * Name attribute for the control.
50
+ * @type {string}
51
+ */
52
+ get name() {
53
+ return this.__name || '';
54
+ }
55
+
56
+ /**
57
+ * Converts values provided for the `name` attribute to string type.
58
+ * Mimics the native `input` behavior.
59
+ * @param {string} newName
60
+ */
61
+ set name(newName) {
62
+ const oldName = this.name;
63
+ this.__name = newName.toString();
64
+ this.requestUpdate('name', oldName);
65
+ }
66
+
40
67
  static get properties() {
41
68
  return {
69
+ name: { type: String, reflect: true },
42
70
  allowCrossRootRegistration: { type: Boolean, attribute: 'allow-cross-root-registration' },
43
71
  };
44
72
  }
@@ -1,4 +1,6 @@
1
- import { html, LitElement } from 'lit';
1
+ import { css, html, LitElement } from 'lit';
2
+ import { LocalizeMixin } from '@lion/ui/localize-no-side-effects.js';
3
+ import { localizeNamespaceLoader } from '../localizeNamespaceLoader.js';
2
4
 
3
5
  /**
4
6
  * @typedef {import('./Validator.js').Validator} Validator
@@ -6,17 +8,46 @@ import { html, LitElement } from 'lit';
6
8
  * @typedef {import('../../types/validate/ValidateMixinTypes.js').FeedbackMessage} FeedbackMessage
7
9
  */
8
10
 
11
+ /**
12
+ * @param {string} string
13
+ */
14
+ const capitalize = string => `${string[0].toUpperCase()}${string.slice(1)}`;
15
+
9
16
  /**
10
17
  * @desc Takes care of accessible rendering of error messages
11
18
  * Should be used in conjunction with FormControl having ValidateMixin applied
12
19
  */
13
- export class LionValidationFeedback extends LitElement {
20
+ export class LionValidationFeedback extends LocalizeMixin(LitElement) {
14
21
  static get properties() {
15
22
  return {
16
23
  feedbackData: { attribute: false },
17
24
  };
18
25
  }
19
26
 
27
+ static localizeNamespaces = [
28
+ { 'lion-form-core': localizeNamespaceLoader },
29
+ ...super.localizeNamespaces,
30
+ ];
31
+
32
+ static get styles() {
33
+ return [
34
+ css`
35
+ .validation-feedback__type {
36
+ position: absolute;
37
+ width: 1px;
38
+ height: 1px;
39
+ overflow: hidden;
40
+ clip-path: inset(100%);
41
+ clip: rect(1px, 1px, 1px, 1px);
42
+ white-space: nowrap;
43
+ border: 0;
44
+ margin: 0;
45
+ padding: 0;
46
+ }
47
+ `,
48
+ ];
49
+ }
50
+
20
51
  /**
21
52
  * @overridable
22
53
  * @param {Object} opts
@@ -58,6 +89,9 @@ export class LionValidationFeedback extends LitElement {
58
89
  ${this.feedbackData &&
59
90
  this.feedbackData.map(
60
91
  ({ message, type, validator }) => html`
92
+ <div class="validation-feedback__type">
93
+ ${this._localizeManager.msg(`lion-form-core:validation${capitalize(type)}`)}
94
+ </div>
61
95
  ${this._messageTemplate({ message, type, validator })}
62
96
  `,
63
97
  )}
@@ -14,10 +14,10 @@ describe('lion-validation-feedback', () => {
14
14
  const el = /** @type {LionValidationFeedback} */ (
15
15
  await fixture(html`<lion-validation-feedback></lion-validation-feedback>`)
16
16
  );
17
- expect(el).shadowDom.to.equal('');
17
+ expect(el.shadowRoot?.textContent).to.not.include('hello');
18
18
  el.feedbackData = [{ message: 'hello', type: 'error', validator: new AlwaysInvalid() }];
19
19
  await el.updateComplete;
20
- expect(el).shadowDom.to.equal('hello');
20
+ expect(el.shadowRoot?.textContent).to.include('hello');
21
21
  });
22
22
 
23
23
  it('renders the validation type attribute', async () => {
@@ -73,4 +73,32 @@ describe('lion-validation-feedback', () => {
73
73
 
74
74
  clock.restore();
75
75
  });
76
+
77
+ it('shares to the user the type of validation feedback', async () => {
78
+ const el = /** @type {LionValidationFeedback} */ (
79
+ await fixture(html`<lion-validation-feedback></lion-validation-feedback>`)
80
+ );
81
+
82
+ el.feedbackData = [{ message: 'hello', type: 'error', validator: new AlwaysInvalid() }];
83
+ await el.updateComplete;
84
+
85
+ const validationFeedbackType = el.shadowRoot?.querySelector('.validation-feedback__type');
86
+ expect(validationFeedbackType?.textContent?.trim()).to.equal('Error');
87
+
88
+ el.feedbackData = [{ message: 'hello', type: 'info', validator: new AlwaysInvalid() }];
89
+ await el.updateComplete;
90
+
91
+ expect(validationFeedbackType?.textContent?.trim()).to.equal('Info');
92
+ });
93
+
94
+ describe('accessibility', () => {
95
+ it('passes a11y audit when with a message', async () => {
96
+ const el = /** @type {LionValidationFeedback} */ (
97
+ await fixture(html`<lion-validation-feedback></lion-validation-feedback>`)
98
+ );
99
+ el.feedbackData = [{ message: 'hello', type: 'error', validator: new AlwaysInvalid() }];
100
+ await el.updateComplete;
101
+ await expect(el).to.be.accessible();
102
+ });
103
+ });
76
104
  });
@@ -310,6 +310,23 @@ export const runRegistrationSuite = customConfig => {
310
310
  expect(eventSpy).to.have.been.calledOnce;
311
311
  expect(eventSpy.getCall(0).args[0].composed).to.equal(false);
312
312
  });
313
+ it('accepts a name attribute and converts the values provided to a string', async () => {
314
+ const elAttr = /** @type {RegisteringClass} */ (
315
+ await fixture(html`<${childTag} name=${5}></${childTag}>`)
316
+ );
317
+
318
+ expect(elAttr.hasAttribute('name')).to.be.true;
319
+ expect(elAttr.name).to.be.a('string');
320
+ expect(elAttr.name).to.equal('5', 'as an attribute');
321
+
322
+ const elProp = /** @type {RegisteringClass} */ (
323
+ await fixture(html`<${childTag} .name=${5}></${childTag}>`)
324
+ );
325
+
326
+ expect(elProp.hasAttribute('name')).to.be.true;
327
+ expect(elProp.name).to.be.a('string');
328
+ expect(elProp.name).to.equal('5', 'as a property');
329
+ });
313
330
  });
314
331
  describe('FormRegistrarPortalMixin', () => {
315
332
  it('forwards registrations to the .registrationTarget', async () => {
@@ -788,6 +788,7 @@ export function runValidateMixinSuite(customConfig) {
788
788
  await fixture(html`
789
789
  <${tag}
790
790
  .validators="${[
791
+ // @ts-expect-error
791
792
  new EqualsLength(4, { getMessage: () => html`<div id="test123">test</div>` }),
792
793
  ]}" })]}"
793
794
  .modelValue="${'123'}"
@@ -799,7 +800,7 @@ export function runValidateMixinSuite(customConfig) {
799
800
  expect(el.hasFeedbackFor).to.deep.equal(['error']);
800
801
  const { _feedbackNode } = getFormControlMembers(el);
801
802
  await el.updateComplete;
802
- await el.updateComplete;
803
+ await _feedbackNode.updateComplete;
803
804
  const messageHtmlNode = _feedbackNode.shadowRoot?.querySelector(`#${messageHtmlId}`);
804
805
  expect(messageHtmlNode?.outerHTML).to.equal(messageHtml);
805
806
  expect(messageHtmlNode?.tagName).to.equal('DIV');
@@ -1485,9 +1485,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
1485
1485
  const el = /** @type {DynamicCWrapper} */ (
1486
1486
  await fixture(html`
1487
1487
  <${dynamicChildrenTag} .fields="${['firstName']}" .modelValue="${{
1488
- firstName: 'foo',
1489
- lastName: 'bar',
1490
- }}">
1488
+ firstName: 'foo',
1489
+ lastName: 'bar',
1490
+ }}">
1491
1491
  </${dynamicChildrenTag}>
1492
1492
  `)
1493
1493
  );
@@ -1503,9 +1503,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
1503
1503
  const el2 = /** @type {DynamicCWrapper} */ (
1504
1504
  await fixture(html`
1505
1505
  <${dynamicChildrenTag} .fields="${['firstName']}" .serializedValue="${{
1506
- firstName: 'foo',
1507
- lastName: 'bar',
1508
- }}">
1506
+ firstName: 'foo',
1507
+ lastName: 'bar',
1508
+ }}">
1509
1509
  </${dynamicChildrenTag}>
1510
1510
  `)
1511
1511
  );
@@ -1530,9 +1530,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
1530
1530
  const el = /** @type {DynamicCWrapper} */ (
1531
1531
  await fixture(html`
1532
1532
  <${dynamicChildrenTag} .fields="${['firstName']}" .modelValue="${{
1533
- firstName: 'foo',
1534
- lastName: 'bar',
1535
- }}">
1533
+ firstName: 'foo',
1534
+ lastName: 'bar',
1535
+ }}">
1536
1536
  </${dynamicChildrenTag}>
1537
1537
  `)
1538
1538
  );
@@ -1551,9 +1551,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
1551
1551
  const el2 = /** @type {DynamicCWrapper} */ (
1552
1552
  await fixture(html`
1553
1553
  <${dynamicChildrenTag} .fields="${['firstName']}" .serializedValue="${{
1554
- firstName: 'foo',
1555
- lastName: 'bar',
1556
- }}">
1554
+ firstName: 'foo',
1555
+ lastName: 'bar',
1556
+ }}">
1557
1557
  </${dynamicChildrenTag}>
1558
1558
  `)
1559
1559
  );
@@ -1574,9 +1574,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
1574
1574
  const el = /** @type {DynamicCWrapper} */ (
1575
1575
  await fixture(html`
1576
1576
  <${dynamicChildrenTag} .modelValue="${{
1577
- firstName: 'foo',
1578
- lastName: 'bar',
1579
- }}">
1577
+ firstName: 'foo',
1578
+ lastName: 'bar',
1579
+ }}">
1580
1580
  </${dynamicChildrenTag}>
1581
1581
  `)
1582
1582
  );
@@ -1595,9 +1595,9 @@ export function runFormGroupMixinSuite(cfg = {}) {
1595
1595
  const el2 = /** @type {DynamicCWrapper} */ (
1596
1596
  await fixture(html`
1597
1597
  <${dynamicChildrenTag} .serializedValue="${{
1598
- firstName: 'foo',
1599
- lastName: 'bar',
1600
- }}">
1598
+ firstName: 'foo',
1599
+ lastName: 'bar',
1600
+ }}">
1601
1601
  </${dynamicChildrenTag}>
1602
1602
  `)
1603
1603
  );
@@ -0,0 +1,5 @@
1
+ import bg from './bg.js';
2
+
3
+ export default {
4
+ ...bg,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Грешка',
3
+ validationWarning: 'Предупреждение',
4
+ validationSuccess: 'Успех',
5
+ validationInfo: 'Информация',
6
+ };
@@ -0,0 +1,5 @@
1
+ import cs from './cs.js';
2
+
3
+ export default {
4
+ ...cs,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Chyba',
3
+ validationWarning: 'Varování',
4
+ validationSuccess: 'Úspěch',
5
+ validationInfo: 'Informace',
6
+ };
@@ -0,0 +1,5 @@
1
+ import de from './de.js';
2
+
3
+ export default {
4
+ ...de,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Fehler',
3
+ validationWarning: 'Warnhinweis',
4
+ validationSuccess: 'Erfolgreich',
5
+ validationInfo: 'Info',
6
+ };
@@ -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
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Error',
3
+ validationWarning: 'Warning',
4
+ validationSuccess: 'Success',
5
+ validationInfo: 'Info',
6
+ };
@@ -0,0 +1,5 @@
1
+ import es from './es.js';
2
+
3
+ export default {
4
+ ...es,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Error',
3
+ validationWarning: 'Advertencia',
4
+ validationSuccess: 'Satisfactorio',
5
+ validationInfo: 'Información',
6
+ };
@@ -0,0 +1,5 @@
1
+ import fr from './fr.js';
2
+
3
+ export default {
4
+ ...fr,
5
+ };
@@ -0,0 +1,5 @@
1
+ import fr from './fr.js';
2
+
3
+ export default {
4
+ ...fr,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Erreur',
3
+ validationWarning: 'Avertissement',
4
+ validationSuccess: 'Succès',
5
+ validationInfo: 'Info',
6
+ };
@@ -0,0 +1,5 @@
1
+ import hu from './hu.js';
2
+
3
+ export default {
4
+ ...hu,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Hiba',
3
+ validationWarning: 'Figyelmeztetés',
4
+ validationSuccess: 'Sikeres',
5
+ validationInfo: 'Információ',
6
+ };
@@ -0,0 +1,5 @@
1
+ import it from './it.js';
2
+
3
+ export default {
4
+ ...it,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Errore',
3
+ validationWarning: 'Avvertenza',
4
+ validationSuccess: 'Operazione riuscita',
5
+ validationInfo: 'Info',
6
+ };
@@ -0,0 +1,5 @@
1
+ import nl from './nl.js';
2
+
3
+ export default {
4
+ ...nl,
5
+ };
@@ -0,0 +1,5 @@
1
+ import nl from './nl.js';
2
+
3
+ export default {
4
+ ...nl,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Fout',
3
+ validationWarning: 'Waarschuwing',
4
+ validationSuccess: 'Succes',
5
+ validationInfo: 'Informatie',
6
+ };
@@ -0,0 +1,5 @@
1
+ import pl from './pl.js';
2
+
3
+ export default {
4
+ ...pl,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Błąd',
3
+ validationWarning: 'Ostrzeżenie',
4
+ validationSuccess: 'Zrealizowano pomyślnie',
5
+ validationInfo: 'Informacja',
6
+ };
@@ -0,0 +1,5 @@
1
+ import ro from './ro.js';
2
+
3
+ export default {
4
+ ...ro,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Eroare',
3
+ validationWarning: 'Atenție',
4
+ validationSuccess: 'Succes',
5
+ validationInfo: 'Informații',
6
+ };
@@ -0,0 +1,5 @@
1
+ import ru from './ru.js';
2
+
3
+ export default {
4
+ ...ru,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Ошибка',
3
+ validationWarning: 'Предупреждение',
4
+ validationSuccess: 'Успешно',
5
+ validationInfo: 'Информация',
6
+ };
@@ -0,0 +1,5 @@
1
+ import sk from './sk.js';
2
+
3
+ export default {
4
+ ...sk,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Chyba',
3
+ validationWarning: 'Varovanie',
4
+ validationSuccess: 'Úspešné',
5
+ validationInfo: 'Info',
6
+ };
@@ -0,0 +1,5 @@
1
+ import uk from './uk.js';
2
+
3
+ export default {
4
+ ...uk,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: 'Помилка',
3
+ validationWarning: 'Попередження',
4
+ validationSuccess: 'Успішно',
5
+ validationInfo: 'Інформація',
6
+ };