@lion/ui 0.7.3 → 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 (280) hide show
  1. package/components/combobox/src/LionCombobox.js +35 -22
  2. package/components/combobox/test/lion-combobox.test.js +109 -66
  3. package/components/form-core/src/FormControlMixin.js +0 -9
  4. package/components/form-core/src/localizeNamespaceLoader.js +75 -0
  5. package/components/form-core/src/registration/FormRegisteringMixin.js +28 -0
  6. package/components/form-core/src/validate/LionValidationFeedback.js +36 -2
  7. package/components/form-core/test/validate/lion-validation-feedback.test.js +30 -2
  8. package/components/form-core/test-suites/FormRegistrationMixins.suite.js +17 -0
  9. package/components/form-core/test-suites/ValidateMixin.suite.js +1 -1
  10. package/components/form-core/translations/bg-BG.js +5 -0
  11. package/components/form-core/translations/bg.js +6 -0
  12. package/components/form-core/translations/cs-CZ.js +5 -0
  13. package/components/form-core/translations/cs.js +6 -0
  14. package/components/form-core/translations/de-DE.js +5 -0
  15. package/components/form-core/translations/de.js +6 -0
  16. package/components/form-core/translations/en-AU.js +5 -0
  17. package/components/form-core/translations/en-GB.js +5 -0
  18. package/components/form-core/translations/en-US.js +5 -0
  19. package/components/form-core/translations/en.js +6 -0
  20. package/components/form-core/translations/es-ES.js +5 -0
  21. package/components/form-core/translations/es.js +6 -0
  22. package/components/form-core/translations/fr-BE.js +5 -0
  23. package/components/form-core/translations/fr-FR.js +5 -0
  24. package/components/form-core/translations/fr.js +6 -0
  25. package/components/form-core/translations/hu-HU.js +5 -0
  26. package/components/form-core/translations/hu.js +6 -0
  27. package/components/form-core/translations/it-IT.js +5 -0
  28. package/components/form-core/translations/it.js +6 -0
  29. package/components/form-core/translations/nl-BE.js +5 -0
  30. package/components/form-core/translations/nl-NL.js +5 -0
  31. package/components/form-core/translations/nl.js +6 -0
  32. package/components/form-core/translations/pl-PL.js +5 -0
  33. package/components/form-core/translations/pl.js +6 -0
  34. package/components/form-core/translations/ro-RO.js +5 -0
  35. package/components/form-core/translations/ro.js +6 -0
  36. package/components/form-core/translations/ru-RU.js +5 -0
  37. package/components/form-core/translations/ru.js +6 -0
  38. package/components/form-core/translations/sk-SK.js +5 -0
  39. package/components/form-core/translations/sk.js +6 -0
  40. package/components/form-core/translations/uk-UA.js +5 -0
  41. package/components/form-core/translations/uk.js +6 -0
  42. package/components/form-core/translations/zh.js +6 -0
  43. package/components/form-core/types/FormControlMixinTypes.ts +0 -4
  44. package/components/form-core/types/registration/FormRegisteringMixinTypes.ts +17 -4
  45. package/components/input-amount/test/lion-input-amount.test.js +3 -0
  46. package/components/input-file/src/LionInputFile.js +88 -30
  47. package/components/input-file/test/lion-input-file.test.js +102 -6
  48. package/components/input-file/test/lion-selected-file-list.test.js +2 -1
  49. package/components/input-file/translations/bg.js +3 -0
  50. package/components/input-file/translations/cs.js +3 -0
  51. package/components/input-file/translations/de.js +3 -0
  52. package/components/input-file/translations/en.js +3 -0
  53. package/components/input-file/translations/es.js +3 -0
  54. package/components/input-file/translations/fr.js +3 -0
  55. package/components/input-file/translations/hu.js +3 -0
  56. package/components/input-file/translations/it.js +3 -0
  57. package/components/input-file/translations/nl.js +3 -0
  58. package/components/input-file/translations/pl.js +3 -0
  59. package/components/input-file/translations/ro.js +3 -0
  60. package/components/input-file/translations/ru.js +3 -0
  61. package/components/input-file/translations/sk.js +3 -0
  62. package/components/input-file/translations/uk.js +3 -0
  63. package/components/input-file/translations/zh.js +3 -0
  64. package/components/overlays/src/OverlayMixin.js +8 -1
  65. package/components/switch/src/LionSwitch.js +10 -0
  66. package/components/tabs/src/LionTabs.js +10 -0
  67. package/components/tabs/test/lion-tabs.test.js +49 -38
  68. package/custom-elements.json +85400 -74702
  69. package/dist-types/components/combobox/src/LionCombobox.d.ts +12 -8
  70. package/dist-types/components/combobox/src/LionCombobox.d.ts.map +1 -1
  71. package/dist-types/components/form-core/src/FormControlMixin.d.ts.map +1 -1
  72. package/dist-types/components/form-core/src/LionField.d.ts +1 -1
  73. package/dist-types/components/form-core/src/localizeNamespaceLoader.d.ts +2 -0
  74. package/dist-types/components/form-core/src/localizeNamespaceLoader.d.ts.map +1 -0
  75. package/dist-types/components/form-core/src/registration/FormRegisteringMixin.d.ts.map +1 -1
  76. package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts +5 -6
  77. package/dist-types/components/form-core/src/validate/LionValidationFeedback.d.ts.map +1 -1
  78. package/dist-types/components/form-core/test-suites/FormRegistrationMixins.suite.d.ts.map +1 -1
  79. package/dist-types/components/form-core/translations/bg-BG.d.ts +8 -0
  80. package/dist-types/components/form-core/translations/bg-BG.d.ts.map +1 -0
  81. package/dist-types/components/form-core/translations/bg.d.ts +8 -0
  82. package/dist-types/components/form-core/translations/bg.d.ts.map +1 -0
  83. package/dist-types/components/form-core/translations/cs-CZ.d.ts +8 -0
  84. package/dist-types/components/form-core/translations/cs-CZ.d.ts.map +1 -0
  85. package/dist-types/components/form-core/translations/cs.d.ts +8 -0
  86. package/dist-types/components/form-core/translations/cs.d.ts.map +1 -0
  87. package/dist-types/components/form-core/translations/de-DE.d.ts +8 -0
  88. package/dist-types/components/form-core/translations/de-DE.d.ts.map +1 -0
  89. package/dist-types/components/form-core/translations/de.d.ts +8 -0
  90. package/dist-types/components/form-core/translations/de.d.ts.map +1 -0
  91. package/dist-types/components/form-core/translations/en-AU.d.ts +8 -0
  92. package/dist-types/components/form-core/translations/en-AU.d.ts.map +1 -0
  93. package/dist-types/components/form-core/translations/en-GB.d.ts +8 -0
  94. package/dist-types/components/form-core/translations/en-GB.d.ts.map +1 -0
  95. package/dist-types/components/form-core/translations/en-US.d.ts +8 -0
  96. package/dist-types/components/form-core/translations/en-US.d.ts.map +1 -0
  97. package/dist-types/components/form-core/translations/en.d.ts +8 -0
  98. package/dist-types/components/form-core/translations/en.d.ts.map +1 -0
  99. package/dist-types/components/form-core/translations/es-ES.d.ts +8 -0
  100. package/dist-types/components/form-core/translations/es-ES.d.ts.map +1 -0
  101. package/dist-types/components/form-core/translations/es.d.ts +8 -0
  102. package/dist-types/components/form-core/translations/es.d.ts.map +1 -0
  103. package/dist-types/components/form-core/translations/fr-BE.d.ts +8 -0
  104. package/dist-types/components/form-core/translations/fr-BE.d.ts.map +1 -0
  105. package/dist-types/components/form-core/translations/fr-FR.d.ts +8 -0
  106. package/dist-types/components/form-core/translations/fr-FR.d.ts.map +1 -0
  107. package/dist-types/components/form-core/translations/fr.d.ts +8 -0
  108. package/dist-types/components/form-core/translations/fr.d.ts.map +1 -0
  109. package/dist-types/components/form-core/translations/hu-HU.d.ts +8 -0
  110. package/dist-types/components/form-core/translations/hu-HU.d.ts.map +1 -0
  111. package/dist-types/components/form-core/translations/hu.d.ts +8 -0
  112. package/dist-types/components/form-core/translations/hu.d.ts.map +1 -0
  113. package/dist-types/components/form-core/translations/it-IT.d.ts +8 -0
  114. package/dist-types/components/form-core/translations/it-IT.d.ts.map +1 -0
  115. package/dist-types/components/form-core/translations/it.d.ts +8 -0
  116. package/dist-types/components/form-core/translations/it.d.ts.map +1 -0
  117. package/dist-types/components/form-core/translations/nl-BE.d.ts +8 -0
  118. package/dist-types/components/form-core/translations/nl-BE.d.ts.map +1 -0
  119. package/dist-types/components/form-core/translations/nl-NL.d.ts +8 -0
  120. package/dist-types/components/form-core/translations/nl-NL.d.ts.map +1 -0
  121. package/dist-types/components/form-core/translations/nl.d.ts +8 -0
  122. package/dist-types/components/form-core/translations/nl.d.ts.map +1 -0
  123. package/dist-types/components/form-core/translations/pl-PL.d.ts +8 -0
  124. package/dist-types/components/form-core/translations/pl-PL.d.ts.map +1 -0
  125. package/dist-types/components/form-core/translations/pl.d.ts +8 -0
  126. package/dist-types/components/form-core/translations/pl.d.ts.map +1 -0
  127. package/dist-types/components/form-core/translations/ro-RO.d.ts +8 -0
  128. package/dist-types/components/form-core/translations/ro-RO.d.ts.map +1 -0
  129. package/dist-types/components/form-core/translations/ro.d.ts +8 -0
  130. package/dist-types/components/form-core/translations/ro.d.ts.map +1 -0
  131. package/dist-types/components/form-core/translations/ru-RU.d.ts +8 -0
  132. package/dist-types/components/form-core/translations/ru-RU.d.ts.map +1 -0
  133. package/dist-types/components/form-core/translations/ru.d.ts +8 -0
  134. package/dist-types/components/form-core/translations/ru.d.ts.map +1 -0
  135. package/dist-types/components/form-core/translations/sk-SK.d.ts +8 -0
  136. package/dist-types/components/form-core/translations/sk-SK.d.ts.map +1 -0
  137. package/dist-types/components/form-core/translations/sk.d.ts +8 -0
  138. package/dist-types/components/form-core/translations/sk.d.ts.map +1 -0
  139. package/dist-types/components/form-core/translations/uk-UA.d.ts +8 -0
  140. package/dist-types/components/form-core/translations/uk-UA.d.ts.map +1 -0
  141. package/dist-types/components/form-core/translations/uk.d.ts +8 -0
  142. package/dist-types/components/form-core/translations/uk.d.ts.map +1 -0
  143. package/dist-types/components/form-core/translations/zh.d.ts +8 -0
  144. package/dist-types/components/form-core/translations/zh.d.ts.map +1 -0
  145. package/dist-types/components/form-core/types/FormControlMixinTypes.d.ts +0 -4
  146. package/dist-types/components/form-core/types/FormControlMixinTypes.d.ts.map +1 -1
  147. package/dist-types/components/form-core/types/registration/FormRegisteringMixinTypes.d.ts +14 -4
  148. package/dist-types/components/form-core/types/registration/FormRegisteringMixinTypes.d.ts.map +1 -1
  149. package/dist-types/components/input-file/src/LionInputFile.d.ts +12 -6
  150. package/dist-types/components/input-file/src/LionInputFile.d.ts.map +1 -1
  151. package/dist-types/components/input-file/translations/bg-BG.d.ts +3 -0
  152. package/dist-types/components/input-file/translations/bg.d.ts +3 -0
  153. package/dist-types/components/input-file/translations/cs-CZ.d.ts +3 -0
  154. package/dist-types/components/input-file/translations/cs.d.ts +3 -0
  155. package/dist-types/components/input-file/translations/de-DE.d.ts +3 -0
  156. package/dist-types/components/input-file/translations/de.d.ts +3 -0
  157. package/dist-types/components/input-file/translations/en-AU.d.ts +3 -0
  158. package/dist-types/components/input-file/translations/en-GB.d.ts +3 -0
  159. package/dist-types/components/input-file/translations/en-PH.d.ts +3 -0
  160. package/dist-types/components/input-file/translations/en-US.d.ts +3 -0
  161. package/dist-types/components/input-file/translations/en.d.ts +3 -0
  162. package/dist-types/components/input-file/translations/es-ES.d.ts +3 -0
  163. package/dist-types/components/input-file/translations/es.d.ts +3 -0
  164. package/dist-types/components/input-file/translations/fr-BE.d.ts +3 -0
  165. package/dist-types/components/input-file/translations/fr-FR.d.ts +3 -0
  166. package/dist-types/components/input-file/translations/fr.d.ts +3 -0
  167. package/dist-types/components/input-file/translations/hu-HU.d.ts +3 -0
  168. package/dist-types/components/input-file/translations/hu.d.ts +3 -0
  169. package/dist-types/components/input-file/translations/it-IT.d.ts +3 -0
  170. package/dist-types/components/input-file/translations/it.d.ts +3 -0
  171. package/dist-types/components/input-file/translations/nl-BE.d.ts +3 -0
  172. package/dist-types/components/input-file/translations/nl-NL.d.ts +3 -0
  173. package/dist-types/components/input-file/translations/nl.d.ts +3 -0
  174. package/dist-types/components/input-file/translations/pl-PL.d.ts +3 -0
  175. package/dist-types/components/input-file/translations/pl.d.ts +3 -0
  176. package/dist-types/components/input-file/translations/ro-RO.d.ts +3 -0
  177. package/dist-types/components/input-file/translations/ro.d.ts +3 -0
  178. package/dist-types/components/input-file/translations/ru-RU.d.ts +3 -0
  179. package/dist-types/components/input-file/translations/ru.d.ts +3 -0
  180. package/dist-types/components/input-file/translations/sk-SK.d.ts +3 -0
  181. package/dist-types/components/input-file/translations/sk.d.ts +3 -0
  182. package/dist-types/components/input-file/translations/uk-UA.d.ts +3 -0
  183. package/dist-types/components/input-file/translations/uk.d.ts +3 -0
  184. package/dist-types/components/input-file/translations/zh-CN.d.ts +3 -0
  185. package/dist-types/components/input-file/translations/zh.d.ts +3 -0
  186. package/dist-types/components/listbox/src/LionOption.d.ts +1 -1
  187. package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
  188. package/dist-types/components/switch/src/LionSwitch.d.ts.map +1 -1
  189. package/dist-types/components/tabs/src/LionTabs.d.ts.map +1 -1
  190. package/dist-types/tsconfig.tsbuildinfo +1 -1
  191. package/docs/components/accordion/api-table.md +31 -0
  192. package/docs/components/button/api-table.md +104 -0
  193. package/docs/components/calendar/api-table.md +44 -0
  194. package/docs/components/checkbox-group/api-table.md +564 -0
  195. package/docs/components/checkbox-group/overview.md +2 -2
  196. package/docs/components/collapsible/api-table.md +36 -0
  197. package/docs/components/collapsible/overview.md +1 -1
  198. package/docs/components/combobox/api-table.md +256 -0
  199. package/docs/components/combobox/overview.md +1 -1
  200. package/docs/components/combobox/use-cases.md +1 -1
  201. package/docs/components/dialog/api-table.md +45 -0
  202. package/docs/components/dialog/overview.md +1 -1
  203. package/docs/components/drawer/api-table.md +45 -0
  204. package/docs/components/fieldset/api-table.md +163 -0
  205. package/docs/components/fieldset/overview.md +5 -5
  206. package/docs/components/form/api-table.md +1 -0
  207. package/docs/components/form/overview.md +3 -3
  208. package/docs/components/icon/api-table.md +29 -0
  209. package/docs/components/icon/use-cases.md +1 -1
  210. package/docs/components/input/api-table.md +187 -0
  211. package/docs/components/input/overview.md +1 -1
  212. package/docs/components/input-amount/api-table.md +196 -0
  213. package/docs/components/input-amount/overview.md +3 -3
  214. package/docs/components/input-date/api-table.md +188 -0
  215. package/docs/components/input-date/overview.md +3 -3
  216. package/docs/components/input-datepicker/api-table.md +234 -0
  217. package/docs/components/input-datepicker/overview.md +5 -5
  218. package/docs/components/input-email/api-table.md +187 -0
  219. package/docs/components/input-email/overview.md +2 -2
  220. package/docs/components/input-file/api-table.md +272 -0
  221. package/docs/components/input-file/overview.md +1 -1
  222. package/docs/components/input-iban/api-table.md +187 -0
  223. package/docs/components/input-iban/overview.md +2 -2
  224. package/docs/components/input-range/api-table.md +198 -0
  225. package/docs/components/input-range/overview.md +2 -2
  226. package/docs/components/input-stepper/api-table.md +205 -0
  227. package/docs/components/input-stepper/overview.md +1 -1
  228. package/docs/components/input-tel/api-table.md +202 -0
  229. package/docs/components/input-tel/overview.md +1 -1
  230. package/docs/components/input-tel/use-cases.md +6 -6
  231. package/docs/components/input-tel-dropdown/api-table.md +213 -0
  232. package/docs/components/input-tel-dropdown/overview.md +1 -1
  233. package/docs/components/listbox/api-table.md +293 -0
  234. package/docs/components/listbox/use-cases.md +1 -1
  235. package/docs/components/pagination/api-table.md +33 -0
  236. package/docs/components/progress-indicator/api-table.md +36 -0
  237. package/docs/components/radio-group/api-table.md +378 -0
  238. package/docs/components/radio-group/overview.md +3 -3
  239. package/docs/components/select/api-table.md +181 -0
  240. package/docs/components/select/use-cases.md +1 -1
  241. package/docs/components/select-rich/api-table.md +288 -0
  242. package/docs/components/select-rich/use-cases.md +1 -1
  243. package/docs/components/steps/api-table.md +80 -0
  244. package/docs/components/switch/api-table.md +229 -0
  245. package/docs/components/tabs/api-table.md +32 -0
  246. package/docs/components/tabs/examples.md +1 -1
  247. package/docs/components/textarea/api-table.md +192 -0
  248. package/docs/components/tooltip/api-table.md +53 -0
  249. package/docs/fundamentals/index.md +4 -4
  250. package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
  251. package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
  252. package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
  253. package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
  254. package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
  255. package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
  256. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
  257. package/docs/fundamentals/rationales/accessibility.md +1 -1
  258. package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
  259. package/docs/fundamentals/systems/core/api-table.md +34 -0
  260. package/docs/fundamentals/systems/core/overview.md +1 -1
  261. package/docs/fundamentals/systems/form/api-table.md +166 -0
  262. package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
  263. package/docs/fundamentals/systems/form/model-value.md +1 -1
  264. package/docs/fundamentals/systems/form/overview.md +28 -28
  265. package/docs/fundamentals/systems/form/validate.md +2 -2
  266. package/docs/fundamentals/systems/localize/api-table.md +65 -0
  267. package/docs/fundamentals/systems/localize/overview.md +4 -4
  268. package/docs/fundamentals/systems/overlays/api-table.md +168 -0
  269. package/docs/fundamentals/systems/overlays/configuration.md +2 -2
  270. package/docs/fundamentals/systems/overlays/overview.md +5 -5
  271. package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
  272. package/docs/fundamentals/tools/helpers/overview.md +1 -1
  273. package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
  274. package/docs/guides/how-to/create-a-custom-field.md +5 -5
  275. package/docs/guides/how-to/create-a-form.md +4 -4
  276. package/docs/guides/how-to/extend-a-native-input.md +2 -2
  277. package/docs/guides/index.md +8 -8
  278. package/docs/guides/principles/index.md +5 -5
  279. package/docs/guides/principles/styling.md +1 -1
  280. package/package.json +5 -4
@@ -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 () => {
@@ -800,7 +800,7 @@ export function runValidateMixinSuite(customConfig) {
800
800
  expect(el.hasFeedbackFor).to.deep.equal(['error']);
801
801
  const { _feedbackNode } = getFormControlMembers(el);
802
802
  await el.updateComplete;
803
- await el.updateComplete;
803
+ await _feedbackNode.updateComplete;
804
804
  const messageHtmlNode = _feedbackNode.shadowRoot?.querySelector(`#${messageHtmlId}`);
805
805
  expect(messageHtmlNode?.outerHTML).to.equal(messageHtml);
806
806
  expect(messageHtmlNode?.tagName).to.equal('DIV');
@@ -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
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ validationError: '错误',
3
+ validationWarning: '警告',
4
+ validationSuccess: '成功',
5
+ validationInfo: '信息',
6
+ };
@@ -43,10 +43,6 @@ export declare interface HTMLElementWithValue extends HTMLElement {
43
43
  export declare class FormControlHost {
44
44
  static get styles(): CSSResultArray;
45
45
  static get properties(): {
46
- name: {
47
- type: StringConstructor;
48
- reflect: boolean;
49
- };
50
46
  readOnly: {
51
47
  type: BooleanConstructor;
52
48
  attribute: string;
@@ -4,10 +4,13 @@ import { LitElement } from 'lit';
4
4
  import { FormRegistrarHost } from './FormRegistrarMixinTypes.js';
5
5
 
6
6
  export declare class FormRegisteringHost {
7
- /**
8
- * The name the host is registered with to a parent
9
- */
10
- name: string;
7
+ static get properties(): {
8
+ name: {
9
+ type: StringConstructor;
10
+ reflect: boolean;
11
+ };
12
+ }
13
+
11
14
  /**
12
15
  * To encourage accessibility best practices, `form-element-register` events
13
16
  * do not pierce through shadow roots. This forces the developer to create form groups and fieldsets that
@@ -17,12 +20,22 @@ export declare class FormRegisteringHost {
17
20
  */
18
21
  allowCrossRootRegistration: boolean;
19
22
 
23
+ /**
24
+ * The name the element will be registered with to the .formElements collection
25
+ * of the parent. Also, it serves as the key of key/value pairs in
26
+ * modelValue/serializedValue objects
27
+ */
28
+ get name(): string;
29
+ set name(arg: any);
30
+
20
31
  /**
21
32
  * The registrar this FormControl registers to, Usually a descendant of FormGroup or
22
33
  * ChoiceGroup
23
34
  */
24
35
  protected _parentFormGroup: FormRegistrarHost | undefined;
25
36
 
37
+ private __name: string;
38
+
26
39
  private __unregisterFormElement: void;
27
40
  }
28
41
 
@@ -195,6 +195,9 @@ describe('<lion-input-amount>', () => {
195
195
  expect(el.formattedValue).to.equal('123.45');
196
196
  localize.locale = 'nl-NL';
197
197
  await el.updateComplete;
198
+ // TODO find out why the localize needs to be loaded for the feedbackNode
199
+ // @ts-ignore [allow-protected] in test
200
+ await el._feedbackNode.localizeNamespacesLoaded;
198
201
  expect(el.formattedValue).to.equal('123,45');
199
202
  });
200
203
 
@@ -77,6 +77,7 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
77
77
  >
78
78
  ${this.buttonLabel}
79
79
  </button>`,
80
+ after: () => html`<div data-description></div>`,
80
81
  'selected-file-list': () => ({
81
82
  template: html`
82
83
  <lion-selected-file-list
@@ -105,8 +106,7 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
105
106
  }
106
107
 
107
108
  /**
108
- * The helpt text for the input node.
109
- * When no light dom defined via [slot=help-text], this value will be used
109
+ * The label of the button
110
110
  * @type {string}
111
111
  */
112
112
  get buttonLabel() {
@@ -176,6 +176,11 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
176
176
 
177
177
  /** @private */
178
178
  this.__duplicateFileNamesValidator = new DuplicateFileNames({ show: false });
179
+ /**
180
+ * @private
181
+ * @type {FileList | null}
182
+ */
183
+ this.__previouslyParsedFiles = null;
179
184
  }
180
185
 
181
186
  /**
@@ -283,8 +288,20 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
283
288
  * @returns {InputFile[]} parsedValue
284
289
  */
285
290
  parser() {
286
- // @ts-ignore
287
- return this._inputNode.files ? Array.from(this._inputNode.files) : [];
291
+ // parser is called twice for one user event; one for 'user-input-change', another for 'change'
292
+ if (this.__previouslyParsedFiles === this._inputNode.files) {
293
+ return this.modelValue;
294
+ }
295
+ this.__previouslyParsedFiles = this._inputNode.files;
296
+
297
+ const files = this._inputNode.files
298
+ ? /** @type {InputFile[]} */ (Array.from(this._inputNode.files))
299
+ : [];
300
+ if (this.multiple) {
301
+ return [...(this.modelValue ?? []), ...files];
302
+ }
303
+
304
+ return files;
288
305
  }
289
306
 
290
307
  /**
@@ -332,8 +349,6 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
332
349
  super.firstUpdated(changedProperties);
333
350
 
334
351
  this.__setupFileValidators();
335
- // We need to update our light dom
336
- this._enhanceSelectedList();
337
352
 
338
353
  // TODO: if there's no inputNode by now, we should either throw an error or add a slot change listener
339
354
  if (this._inputNode) {
@@ -443,6 +458,7 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
443
458
  this._selectedFilesMetaData = [...this._selectedFilesMetaData];
444
459
  }
445
460
  });
461
+ this._updateUploadButtonDescription();
446
462
  }
447
463
  }
448
464
 
@@ -482,16 +498,17 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
482
498
  }
483
499
 
484
500
  this._inputNode.files = ev.dataTransfer.files;
485
- // @ts-ignore
486
- this.modelValue = Array.from(ev.dataTransfer.files);
487
- // if same file is selected again, e.dataTransfer.files lists that file.
488
- // So filter if the file already exists
489
- // @ts-ignore
490
- // const newFiles = this.__computeNewAddedFiles(Array.from(ev.dataTransfer.files));
491
- // if (newFiles.length > 0) {
492
- // this._processFiles(newFiles);
493
- // }
494
- this._processFiles(Array.from(ev.dataTransfer.files));
501
+
502
+ if (this.multiple) {
503
+ const computedFiles = this.__computeNewAddedFiles(
504
+ /** @type {InputFile[]} */ (Array.from(ev.dataTransfer.files)),
505
+ );
506
+ this.modelValue = [...(this.modelValue ?? []), ...computedFiles];
507
+ } else {
508
+ this.modelValue = /** @type {InputFile[]} */ (Array.from(ev.dataTransfer.files));
509
+ }
510
+
511
+ this._processFiles(/** @type {InputFile[]} */ (Array.from(ev.dataTransfer.files)));
495
512
  }
496
513
 
497
514
  /**
@@ -521,20 +538,6 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
521
538
  ev.target.value = ''; // eslint-disable-line no-param-reassign
522
539
  }
523
540
 
524
- /**
525
- * @protected
526
- */
527
- _enhanceSelectedList() {
528
- /**
529
- * @type {LionSelectedFileList | null}
530
- */
531
- const selectedFileList = this.querySelector('[slot="selected-file-list"]');
532
- if (selectedFileList) {
533
- selectedFileList.setAttribute('id', `selected-file-list-${this._inputId}`);
534
- this.addToAriaDescribedBy(selectedFileList, { idPrefix: 'selected-file-list' });
535
- }
536
- }
537
-
538
541
  /**
539
542
  * @protected
540
543
  */
@@ -739,6 +742,46 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
739
742
  fileObj.validationFeedback?.push(errorObj);
740
743
  }
741
744
 
745
+ /**
746
+ * Description for screen readers connected to the button about how many files have been updated
747
+ * @protected
748
+ */
749
+ _updateUploadButtonDescription() {
750
+ const erroneousFilesNames = /** @type {string[]} */ ([]);
751
+ let errorMessage;
752
+
753
+ this._selectedFilesMetaData.forEach(file => {
754
+ if (file.status === 'FAIL') {
755
+ errorMessage = file.validationFeedback ? file.validationFeedback[0].message.toString() : '';
756
+ erroneousFilesNames.push(/** @type {string} */ (file.systemFile.name));
757
+ }
758
+ });
759
+
760
+ const selectedFiles = this.querySelector('[slot="after"]');
761
+ if (selectedFiles) {
762
+ if (!this._selectedFilesMetaData || this._selectedFilesMetaData.length === 0) {
763
+ selectedFiles.textContent = /** @type {string} */ (
764
+ this.msgLit('lion-input-file:noFilesSelected')
765
+ );
766
+ } else if (this._selectedFilesMetaData.length === 1) {
767
+ selectedFiles.textContent = /** @type {string} */ (
768
+ errorMessage || this._selectedFilesMetaData[0].systemFile.name
769
+ );
770
+ } else {
771
+ selectedFiles.textContent = `${this.msgLit('lion-input-file:numberOfFiles', {
772
+ numberOfFiles: this._selectedFilesMetaData.length,
773
+ })} ${
774
+ errorMessage
775
+ ? this.msgLit('lion-input-file:generalValidatorMessage', {
776
+ validatorMessage: errorMessage,
777
+ listOfErroneousFiles: erroneousFilesNames.join(', '),
778
+ })
779
+ : ''
780
+ }`;
781
+ }
782
+ }
783
+ }
784
+
742
785
  /**
743
786
  * @private
744
787
  * @param {InputFile} removedFile
@@ -755,6 +798,7 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
755
798
  }
756
799
  this._inputNode.value = '';
757
800
  this._handleErrors();
801
+ this._updateUploadButtonDescription();
758
802
  }
759
803
 
760
804
  /**
@@ -847,6 +891,7 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
847
891
  _inputGroupInputTemplate() {
848
892
  return html`
849
893
  <slot name="input"> </slot>
894
+ <slot name="after"> </slot>
850
895
  ${this.enableDropZone && this._isDragAndDropSupported
851
896
  ? this._dropZoneTemplate()
852
897
  : html`
@@ -891,6 +936,19 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
891
936
  border: dashed 2px black;
892
937
  padding: 24px 0;
893
938
  }
939
+
940
+ .input-group__container ::slotted([slot='after']) {
941
+ position: absolute;
942
+ width: 1px;
943
+ height: 1px;
944
+ overflow: hidden;
945
+ clip-path: inset(100%);
946
+ clip: rect(1px, 1px, 1px, 1px);
947
+ white-space: nowrap;
948
+ border: 0;
949
+ margin: 0;
950
+ padding: 0;
951
+ }
894
952
  `,
895
953
  ];
896
954
  }