@lion/ui 0.23.0 → 0.24.0

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 (787) hide show
  1. package/README.md +50 -20
  2. package/components/accordion/src/LionAccordion.js +31 -42
  3. package/components/accordion/test/lion-accordion.test.js +108 -134
  4. package/components/button/src/LionButton.js +9 -12
  5. package/components/button/src/LionButtonReset.js +0 -5
  6. package/components/button/src/LionButtonSubmit.js +7 -12
  7. package/components/button/test/demos.screenshots-test.js +50 -11
  8. package/components/button/test/lion-button.test.js +0 -1
  9. package/components/button/test-suites/LionButton.suite.js +135 -145
  10. package/components/button/test-suites/LionButtonReset.suite.js +54 -72
  11. package/components/button/test-suites/LionButtonSubmit.suite.js +49 -68
  12. package/components/calendar/src/LionCalendar.js +151 -104
  13. package/components/calendar/src/calendarStyle.js +0 -1
  14. package/components/calendar/src/utils/createMonth.js +3 -4
  15. package/components/calendar/src/utils/createMultipleMonth.js +15 -7
  16. package/components/calendar/src/utils/createWeek.js +0 -2
  17. package/components/calendar/src/utils/dataTemplate.js +8 -4
  18. package/components/calendar/src/utils/dayTemplate.js +0 -6
  19. package/components/calendar/src/utils/getDayMonthYear.js +6 -2
  20. package/components/calendar/test/demos.screenshots-test.js +40 -9
  21. package/components/calendar/test/lion-calendar.test.js +171 -282
  22. package/components/calendar/test/utils/createMonth.test.js +61 -22
  23. package/components/calendar/test/utils/createMultipleMonth.test.js +14 -7
  24. package/components/calendar/test/utils/createWeek.test.js +51 -17
  25. package/components/calendar/test/utils/dataTemplate.test.js +3 -4
  26. package/components/calendar/test/utils/dayTemplate.test.js +106 -34
  27. package/components/calendar/test/utils/getFirstDayNextMonth.test.js +0 -1
  28. package/components/calendar/test/utils/getLastDayPreviousMonth.test.js +0 -1
  29. package/components/calendar/test/utils/isSameDate.test.js +0 -1
  30. package/components/calendar/test/utils/snapshots/monthTemplate_en-GB_Sunday_2018-12.js +1 -2
  31. package/components/calendar/test-helpers/CalendarObject.js +31 -62
  32. package/components/calendar/test-helpers/DayObject.js +7 -15
  33. package/components/calendar/test-suites/LionCalendar.suite.js +7 -9
  34. package/components/checkbox-group/src/LionCheckboxIndeterminate.js +17 -30
  35. package/components/checkbox-group/test/lion-checkbox-group-integrations.test.js +0 -1
  36. package/components/checkbox-group/test/lion-checkbox-group.test.js +21 -16
  37. package/components/checkbox-group/test/lion-checkbox-indeterminate-integrations.test.js +3 -3
  38. package/components/checkbox-group/test/lion-checkbox-integrations.test.js +3 -2
  39. package/components/checkbox-group/test/lion-checkbox.test.js +30 -16
  40. package/components/checkbox-group/test-suites/CheckboxIndeterminate.suite.js +147 -191
  41. package/components/collapsible/src/LionCollapsible.js +10 -15
  42. package/components/collapsible/test/lion-collapsible.test.js +4 -18
  43. package/components/combobox/src/LionCombobox.js +35 -53
  44. package/components/combobox/src/utils/makeMatchingTextBold.js +2 -5
  45. package/components/combobox/src/validators.js +0 -1
  46. package/components/combobox/test/lion-combobox-integrations.test.js +6 -6
  47. package/components/combobox/test/lion-combobox.test.js +576 -869
  48. package/components/combobox/test/validators.test.js +6 -13
  49. package/components/combobox/test-helpers/combobox-helpers.js +24 -11
  50. package/components/core/src/DisabledMixin.js +61 -66
  51. package/components/core/src/DisabledWithTabIndexMixin.js +76 -83
  52. package/components/core/src/EventTargetShim.js +1 -4
  53. package/components/core/src/ScopedElementsMixin.js +4 -15
  54. package/components/core/src/ScopedStylesController.js +1 -5
  55. package/components/core/src/SlotMixin.js +236 -239
  56. package/components/core/src/browserDetection.js +5 -12
  57. package/components/core/test/DisabledMixin.test.js +24 -39
  58. package/components/core/test/DisabledWithTabIndexMixin.test.js +21 -34
  59. package/components/core/test/EventTargetShim.test.js +0 -8
  60. package/components/core/test/ScopedElementsMixin.test.js +22 -38
  61. package/components/core/test/ScopedStylesController.test.js +11 -20
  62. package/components/core/test/SlotMixin.test.js +102 -154
  63. package/components/core/test-helpers/getCachedFixture.js +5 -11
  64. package/components/core/types/SlotMixinTypes.ts +8 -3
  65. package/components/dialog/src/LionDialog.js +4 -3
  66. package/components/dialog/test/lion-dialog.integration.test.js +10 -20
  67. package/components/dialog/test/lion-dialog.test.js +48 -62
  68. package/components/dialog/test-helpers/test-router.js +4 -6
  69. package/components/drawer/src/LionDrawer.js +18 -34
  70. package/components/drawer/src/drawerStyle.js +0 -1
  71. package/components/drawer/test/lion-drawer.test.js +1 -17
  72. package/components/fieldset/test/lion-fieldset.test.js +6 -4
  73. package/components/form/src/LionForm.js +18 -13
  74. package/components/form/test/lion-form.test.js +22 -52
  75. package/components/form-core/src/FocusMixin.js +172 -174
  76. package/components/form-core/src/FormControlMixin.js +811 -813
  77. package/components/form-core/src/FormatMixin.js +537 -537
  78. package/components/form-core/src/InteractionStateMixin.js +196 -183
  79. package/components/form-core/src/LionField.js +9 -5
  80. package/components/form-core/src/NativeTextFieldMixin.js +114 -116
  81. package/components/form-core/src/choice-group/ChoiceGroupMixin.js +322 -364
  82. package/components/form-core/src/choice-group/ChoiceInputMixin.js +306 -296
  83. package/components/form-core/src/choice-group/CustomChoiceGroupMixin.js +114 -139
  84. package/components/form-core/src/form-group/FormElementsHaveNoError.js +0 -2
  85. package/components/form-core/src/form-group/FormGroupMixin.js +551 -557
  86. package/components/form-core/src/registration/FormRegisteringMixin.js +72 -71
  87. package/components/form-core/src/registration/FormRegistrarMixin.js +201 -217
  88. package/components/form-core/src/registration/FormRegistrarPortalMixin.js +31 -37
  89. package/components/form-core/src/utils/SyncUpdatableMixin.js +106 -117
  90. package/components/form-core/src/utils/getAriaElementsInRightDomOrder.js +1 -2
  91. package/components/form-core/src/validate/LionValidationFeedback.js +12 -8
  92. package/components/form-core/src/validate/Unparseable.js +4 -2
  93. package/components/form-core/src/validate/ValidateMixin.js +829 -883
  94. package/components/form-core/src/validate/Validator.js +3 -6
  95. package/components/form-core/src/validate/resultValidators/DefaultSuccess.js +1 -2
  96. package/components/form-core/src/validate/validators/DateValidators.js +0 -5
  97. package/components/form-core/src/validate/validators/NumberValidators.js +1 -5
  98. package/components/form-core/src/validate/validators/Required.js +1 -1
  99. package/components/form-core/src/validate/validators/StringValidators.js +1 -8
  100. package/components/form-core/test/FocusMixin.test.js +96 -82
  101. package/components/form-core/test/FormControlMixin.test.js +120 -176
  102. package/components/form-core/test/FormRegistrationMixins.test.js +0 -2
  103. package/components/form-core/test/FormatMixin.test.js +0 -1
  104. package/components/form-core/test/InteractionStateMixin.test.js +0 -1
  105. package/components/form-core/test/NativeTextFieldMixin.test.js +0 -1
  106. package/components/form-core/test/choice-group/ChoiceGroupMixin.test.js +0 -1
  107. package/components/form-core/test/choice-group/ChoiceInputMixin.test.js +0 -1
  108. package/components/form-core/test/choice-group/CustomChoiceGroupMixin.integrations.test.js +6 -8
  109. package/components/form-core/test/choice-group/CustomChoiceGroupMixin.test.js +0 -3
  110. package/components/form-core/test/form-group/FormGroupMixin.test.js +0 -1
  111. package/components/form-core/test/lion-field.test.js +88 -98
  112. package/components/form-core/test/utils/SyncUpdatableMixin.test.js +51 -65
  113. package/components/form-core/test/utils/getAriaElementsInRightDomOrder.test.js +3 -3
  114. package/components/form-core/test/validate/DateValidators.test.js +5 -27
  115. package/components/form-core/test/validate/NumberValidators.test.js +4 -16
  116. package/components/form-core/test/validate/Required.test.js +8 -21
  117. package/components/form-core/test/validate/ResultValidator.test.js +1 -2
  118. package/components/form-core/test/validate/StringValidators.test.js +4 -35
  119. package/components/form-core/test/validate/ValidateMixin.test.js +0 -1
  120. package/components/form-core/test/validate/ValidateMixinFeedbackPart.test.js +0 -1
  121. package/components/form-core/test/validate/Validator.test.js +39 -34
  122. package/components/form-core/test/validate/lion-validation-feedback.test.js +81 -43
  123. package/components/form-core/test-helpers/ExampleValidators.js +0 -5
  124. package/components/form-core/test-helpers/getFormControlMembers.js +2 -2
  125. package/components/form-core/test-helpers/mimicUserInput.js +5 -1
  126. package/components/form-core/test-suites/FormRegistrationMixins.suite.js +65 -122
  127. package/components/form-core/test-suites/FormatMixin.suite.js +202 -227
  128. package/components/form-core/test-suites/InteractionStateMixin.suite.js +47 -60
  129. package/components/form-core/test-suites/NativeTextFieldMixin.suite.js +8 -11
  130. package/components/form-core/test-suites/ValidateMixin.suite.js +280 -359
  131. package/components/form-core/test-suites/ValidateMixinFeedbackPart.suite.js +112 -163
  132. package/components/form-core/test-suites/choice-group/ChoiceGroupMixin.suite.js +185 -218
  133. package/components/form-core/test-suites/choice-group/ChoiceInputMixin.suite.js +116 -109
  134. package/components/form-core/test-suites/choice-group/CustomChoiceGroupMixin.suite.js +36 -70
  135. package/components/form-core/test-suites/form-group/FormGroupMixin-input.suite.js +57 -65
  136. package/components/form-core/test-suites/form-group/FormGroupMixin.suite.js +664 -523
  137. package/components/form-core/translations/bg-BG.js +0 -1
  138. package/components/form-core/translations/cs-CZ.js +0 -1
  139. package/components/form-core/translations/de-DE.js +0 -1
  140. package/components/form-core/translations/en-AU.js +0 -1
  141. package/components/form-core/translations/en-GB.js +0 -1
  142. package/components/form-core/translations/en-US.js +0 -1
  143. package/components/form-core/translations/es-ES.js +0 -1
  144. package/components/form-core/translations/fr-BE.js +0 -1
  145. package/components/form-core/translations/fr-FR.js +0 -1
  146. package/components/form-core/translations/hu-HU.js +0 -1
  147. package/components/form-core/translations/it-IT.js +0 -1
  148. package/components/form-core/translations/nl-BE.js +0 -1
  149. package/components/form-core/translations/nl-NL.js +0 -1
  150. package/components/form-core/translations/pl-PL.js +0 -1
  151. package/components/form-core/translations/ro-RO.js +0 -1
  152. package/components/form-core/translations/ru-RU.js +0 -1
  153. package/components/form-core/translations/sk-SK.js +0 -1
  154. package/components/form-core/translations/tr-TR.js +0 -1
  155. package/components/form-core/translations/uk-UA.js +0 -1
  156. package/components/form-integrations/test/dialog-integrations.test.js +1 -4
  157. package/components/form-integrations/test/form-group-methods.test.js +28 -31
  158. package/components/form-integrations/test/form-integrations.test.js +27 -28
  159. package/components/form-integrations/test/form-validation-integrations.test.js +21 -29
  160. package/components/form-integrations/test/helpers/umbrella-form.js +3 -5
  161. package/components/form-integrations/test/model-value-consistency.test.js +75 -77
  162. package/components/form-integrations/test/model-value-event.test.js +10 -20
  163. package/components/helpers/src/SbActionLogger.js +13 -17
  164. package/components/helpers/src/SbLocaleSwitcher.js +5 -5
  165. package/components/helpers/src/sortEachDepth.js +0 -2
  166. package/components/helpers/test/renderLitAsNode.test.js +0 -4
  167. package/components/helpers/test/sb-action-logger.test.js +24 -55
  168. package/components/icon/src/IconManager.js +0 -2
  169. package/components/icon/src/LionIcon.js +2 -7
  170. package/components/icon/src/icons.js +0 -2
  171. package/components/icon/test/IconManager.test.js +0 -15
  172. package/components/icon/test/hammer.svg.js +3 -4
  173. package/components/icon/test/heart.svg.js +3 -4
  174. package/components/icon/test/lion-icon.test.js +14 -43
  175. package/components/input/src/LionInput.js +2 -8
  176. package/components/input/test/input-integrations.test.js +0 -5
  177. package/components/input/test/lion-input-integrations.test.js +0 -4
  178. package/components/input/test/lion-input.test.js +28 -58
  179. package/components/input/test-helpers/getInputMembers.js +2 -2
  180. package/components/input-amount/src/LionInputAmount.js +20 -20
  181. package/components/input-amount/src/formatters.js +0 -3
  182. package/components/input-amount/src/parsers.js +0 -3
  183. package/components/input-amount/test/formatters.test.js +24 -16
  184. package/components/input-amount/test/lion-input-amount-integrations.test.js +0 -4
  185. package/components/input-amount/test/lion-input-amount.test.js +123 -147
  186. package/components/input-amount/test/parsers.test.js +33 -17
  187. package/components/input-amount/test/preprocessors.test.js +0 -3
  188. package/components/input-amount-dropdown/src/LionInputAmountDropdown.js +49 -59
  189. package/components/input-amount-dropdown/src/currencyUtil.js +8 -7
  190. package/components/input-amount-dropdown/src/parsers.js +0 -1
  191. package/components/input-amount-dropdown/src/validators.js +0 -1
  192. package/components/input-amount-dropdown/test/LionInputAmountDropdown.test.js +34 -36
  193. package/components/input-amount-dropdown/test/lion-input-amount-dropdown-integrations.test.js +18 -13
  194. package/components/input-amount-dropdown/test-helpers/mimicUserChangingDropdown.js +5 -1
  195. package/components/input-amount-dropdown/test-suites/LionInputAmountDropdown.suite.js +132 -107
  196. package/components/input-date/src/LionInputDate.js +4 -3
  197. package/components/input-date/test/lion-input-date-integrations.test.js +0 -3
  198. package/components/input-date/test/lion-input-date.test.js +19 -32
  199. package/components/input-datepicker/src/LionInputDatepicker.js +17 -29
  200. package/components/input-datepicker/src/localizeNamespaceLoader.js +1 -2
  201. package/components/input-datepicker/test/lion-input-datepicker-integrations.test.js +0 -3
  202. package/components/input-datepicker/test/lion-input-datepicker.test.js +88 -153
  203. package/components/input-datepicker/test-helpers/DatepickerInputObject.js +9 -12
  204. package/components/input-datepicker/test-suites/LionInputDatepicker.suite.js +6 -4
  205. package/components/input-datepicker/translations/bg-BG.js +0 -1
  206. package/components/input-datepicker/translations/cs-CZ.js +0 -1
  207. package/components/input-datepicker/translations/de-DE.js +0 -1
  208. package/components/input-datepicker/translations/en-AU.js +0 -1
  209. package/components/input-datepicker/translations/en-GB.js +0 -1
  210. package/components/input-datepicker/translations/en-US.js +0 -1
  211. package/components/input-datepicker/translations/es-ES.js +0 -1
  212. package/components/input-datepicker/translations/fr-BE.js +0 -1
  213. package/components/input-datepicker/translations/fr-FR.js +0 -1
  214. package/components/input-datepicker/translations/hu-HU.js +0 -1
  215. package/components/input-datepicker/translations/it-IT.js +0 -1
  216. package/components/input-datepicker/translations/nl-BE.js +0 -1
  217. package/components/input-datepicker/translations/nl-NL.js +0 -1
  218. package/components/input-datepicker/translations/pl-PL.js +0 -1
  219. package/components/input-datepicker/translations/ro-RO.js +0 -1
  220. package/components/input-datepicker/translations/ru-RU.js +0 -1
  221. package/components/input-datepicker/translations/sk-SK.js +0 -1
  222. package/components/input-datepicker/translations/tr-TR.js +0 -1
  223. package/components/input-datepicker/translations/uk-UA.js +0 -1
  224. package/components/input-email/test/lion-input-email-integrations.test.js +0 -2
  225. package/components/input-email/test/lion-input-email.test.js +1 -7
  226. package/components/input-file/src/FileHandle.js +0 -3
  227. package/components/input-file/src/LionInputFile.js +85 -83
  228. package/components/input-file/src/LionSelectedFileList.js +12 -12
  229. package/components/input-file/src/validators.js +10 -9
  230. package/components/input-file/test/FileValidators.test.js +170 -80
  231. package/components/input-file/test/lion-input-file.test.js +160 -244
  232. package/components/input-file/test/lion-selected-file-list.test.js +13 -22
  233. package/components/input-file/translations/bg-BG.js +0 -1
  234. package/components/input-file/translations/cs-CZ.js +0 -1
  235. package/components/input-file/translations/de-DE.js +0 -1
  236. package/components/input-file/translations/en-AU.js +0 -1
  237. package/components/input-file/translations/en-GB.js +0 -1
  238. package/components/input-file/translations/en-PH.js +0 -1
  239. package/components/input-file/translations/en-US.js +0 -1
  240. package/components/input-file/translations/en.js +2 -1
  241. package/components/input-file/translations/es-ES.js +0 -1
  242. package/components/input-file/translations/fr-BE.js +0 -1
  243. package/components/input-file/translations/fr-FR.js +0 -1
  244. package/components/input-file/translations/hu-HU.js +0 -1
  245. package/components/input-file/translations/id-ID.js +0 -1
  246. package/components/input-file/translations/id.js +2 -1
  247. package/components/input-file/translations/it-IT.js +0 -1
  248. package/components/input-file/translations/nl-BE.js +0 -1
  249. package/components/input-file/translations/nl-NL.js +0 -1
  250. package/components/input-file/translations/pl-PL.js +0 -1
  251. package/components/input-file/translations/ro-RO.js +0 -1
  252. package/components/input-file/translations/ru-RU.js +0 -1
  253. package/components/input-file/translations/sk-SK.js +0 -1
  254. package/components/input-file/translations/uk-UA.js +0 -1
  255. package/components/input-file/translations/zh-CN.js +0 -1
  256. package/components/input-iban/src/validators.js +6 -11
  257. package/components/input-iban/test/formatters.test.js +0 -3
  258. package/components/input-iban/test/lion-input-iban-integrations.test.js +0 -2
  259. package/components/input-iban/test/lion-input-iban.test.js +1 -9
  260. package/components/input-iban/test/parsers.test.js +0 -2
  261. package/components/input-iban/test/validators.test.js +0 -12
  262. package/components/input-iban/translations/bg-BG.js +0 -1
  263. package/components/input-iban/translations/cs-CZ.js +0 -1
  264. package/components/input-iban/translations/de-DE.js +0 -1
  265. package/components/input-iban/translations/en-AU.js +0 -1
  266. package/components/input-iban/translations/en-GB.js +0 -1
  267. package/components/input-iban/translations/en-US.js +0 -1
  268. package/components/input-iban/translations/es-ES.js +0 -1
  269. package/components/input-iban/translations/fr-BE.js +0 -1
  270. package/components/input-iban/translations/fr-FR.js +0 -1
  271. package/components/input-iban/translations/hu-HU.js +0 -1
  272. package/components/input-iban/translations/it-IT.js +0 -1
  273. package/components/input-iban/translations/nl-BE.js +0 -1
  274. package/components/input-iban/translations/nl-NL.js +0 -1
  275. package/components/input-iban/translations/pl-PL.js +0 -1
  276. package/components/input-iban/translations/ro-RO.js +0 -1
  277. package/components/input-iban/translations/ru-RU.js +0 -1
  278. package/components/input-iban/translations/sk-SK.js +0 -1
  279. package/components/input-iban/translations/uk-UA.js +0 -1
  280. package/components/input-range/src/LionInputRange.js +18 -19
  281. package/components/input-range/test/lion-input-range.test.js +23 -48
  282. package/components/input-range/translations/bg-BG.js +0 -1
  283. package/components/input-range/translations/cs-CZ.js +0 -1
  284. package/components/input-range/translations/de-DE.js +0 -1
  285. package/components/input-range/translations/en-AU.js +0 -1
  286. package/components/input-range/translations/en-GB.js +0 -1
  287. package/components/input-range/translations/en-PH.js +0 -1
  288. package/components/input-range/translations/en-US.js +0 -1
  289. package/components/input-range/translations/es-ES.js +0 -1
  290. package/components/input-range/translations/fr-BE.js +0 -1
  291. package/components/input-range/translations/fr-FR.js +0 -1
  292. package/components/input-range/translations/hu-HU.js +0 -1
  293. package/components/input-range/translations/it-IT.js +0 -1
  294. package/components/input-range/translations/nl-BE.js +0 -1
  295. package/components/input-range/translations/nl-NL.js +0 -1
  296. package/components/input-range/translations/pl-PL.js +0 -1
  297. package/components/input-range/translations/ro-RO.js +0 -1
  298. package/components/input-range/translations/ru-RU.js +0 -1
  299. package/components/input-range/translations/sk-SK.js +0 -1
  300. package/components/input-range/translations/uk-UA.js +0 -1
  301. package/components/input-range/translations/zh-CN.js +0 -1
  302. package/components/input-stepper/src/LionInputStepper.js +19 -38
  303. package/components/input-stepper/test/lion-input-stepper-integrations.test.js +0 -1
  304. package/components/input-stepper/test/lion-input-stepper.test.js +0 -1
  305. package/components/input-stepper/test-suites/lion-input-stepper.integration.suite.js +0 -2
  306. package/components/input-stepper/test-suites/lion-input-stepper.suite.js +56 -105
  307. package/components/input-stepper/translations/bg-BG.js +0 -1
  308. package/components/input-stepper/translations/cs-CZ.js +0 -1
  309. package/components/input-stepper/translations/de-DE.js +0 -1
  310. package/components/input-stepper/translations/en-AU.js +0 -1
  311. package/components/input-stepper/translations/en-GB.js +0 -1
  312. package/components/input-stepper/translations/en-US.js +0 -1
  313. package/components/input-stepper/translations/es-ES.js +0 -1
  314. package/components/input-stepper/translations/fr-BE.js +0 -1
  315. package/components/input-stepper/translations/fr-FR.js +0 -1
  316. package/components/input-stepper/translations/hu-HU.js +0 -1
  317. package/components/input-stepper/translations/it-IT.js +0 -1
  318. package/components/input-stepper/translations/nl-BE.js +0 -1
  319. package/components/input-stepper/translations/nl-NL.js +0 -1
  320. package/components/input-stepper/translations/pl-PL.js +0 -1
  321. package/components/input-stepper/translations/ro-RO.js +0 -1
  322. package/components/input-stepper/translations/ru-RU.js +0 -1
  323. package/components/input-stepper/translations/sk-SK.js +0 -1
  324. package/components/input-stepper/translations/uk-UA.js +0 -1
  325. package/components/input-tel/src/LionInputTel.js +53 -37
  326. package/components/input-tel/src/PhoneUtilManager.js +6 -4
  327. package/components/input-tel/src/formatters.js +12 -10
  328. package/components/input-tel/src/parsers.js +3 -3
  329. package/components/input-tel/src/preprocessors.js +15 -7
  330. package/components/input-tel/src/validators.js +4 -6
  331. package/components/input-tel/test/LionInputTel.test.js +4 -2
  332. package/components/input-tel/test/formatters.test.js +22 -10
  333. package/components/input-tel/test/parsers.test.js +40 -11
  334. package/components/input-tel/test/preprocessors.test.js +24 -13
  335. package/components/input-tel/test/validators.test.js +7 -14
  336. package/components/input-tel/test-helpers/mockPhoneUtilManager.js +7 -6
  337. package/components/input-tel/test-suites/LionInputTel.suite.js +33 -73
  338. package/components/input-tel/translations/bg-BG.js +0 -1
  339. package/components/input-tel/translations/cs-CZ.js +0 -1
  340. package/components/input-tel/translations/de-DE.js +0 -1
  341. package/components/input-tel/translations/en-AU.js +0 -1
  342. package/components/input-tel/translations/en-GB.js +0 -1
  343. package/components/input-tel/translations/en-US.js +0 -1
  344. package/components/input-tel/translations/es-ES.js +0 -1
  345. package/components/input-tel/translations/fr-BE.js +0 -1
  346. package/components/input-tel/translations/fr-FR.js +0 -1
  347. package/components/input-tel/translations/hu-HU.js +0 -1
  348. package/components/input-tel/translations/it-IT.js +0 -1
  349. package/components/input-tel/translations/nl-BE.js +0 -1
  350. package/components/input-tel/translations/nl-NL.js +0 -1
  351. package/components/input-tel/translations/pl-PL.js +0 -1
  352. package/components/input-tel/translations/ro-RO.js +0 -1
  353. package/components/input-tel/translations/ru-RU.js +0 -1
  354. package/components/input-tel/translations/sk-SK.js +0 -1
  355. package/components/input-tel/translations/uk-UA.js +0 -1
  356. package/components/input-tel-dropdown/src/LionInputTelDropdown.js +10 -28
  357. package/components/input-tel-dropdown/src/regionCodeToLocale.js +3 -1
  358. package/components/input-tel-dropdown/test/LionInputTelDropdown.test.js +31 -38
  359. package/components/input-tel-dropdown/test/regionCodeToLocale.test.js +0 -1
  360. package/components/input-tel-dropdown/test-helpers/mimicUserChangingDropdown.js +5 -1
  361. package/components/input-tel-dropdown/test-suites/LionInputTelDropdown--parentheses.suite.js +16 -11
  362. package/components/input-tel-dropdown/test-suites/LionInputTelDropdown.suite.js +54 -79
  363. package/components/listbox/src/LionListbox.js +4 -1
  364. package/components/listbox/src/LionOption.js +8 -7
  365. package/components/listbox/src/LionOptions.js +0 -3
  366. package/components/listbox/src/ListboxMixin.js +786 -820
  367. package/components/listbox/test/lion-listbox.test.js +0 -1
  368. package/components/listbox/test/lion-option.test.js +53 -64
  369. package/components/listbox/test/lion-options.test.js +3 -4
  370. package/components/listbox/test-helpers/getListboxMembers.js +6 -3
  371. package/components/listbox/test-suites/ListboxMixin.suite.js +101 -261
  372. package/components/localize/src/LocalizeManager.js +40 -40
  373. package/components/localize/src/LocalizeMixin.js +130 -157
  374. package/components/localize/src/date/formatDate.js +1 -5
  375. package/components/localize/src/date/getDateFormatBasedOnLocale.js +5 -3
  376. package/components/localize/src/date/getMonthNames.js +3 -5
  377. package/components/localize/src/date/getWeekdayNames.js +1 -5
  378. package/components/localize/src/date/parseDate.js +5 -20
  379. package/components/localize/src/date/utils/normalizeIntlDate.js +0 -7
  380. package/components/localize/src/getLocalizeManager.js +0 -3
  381. package/components/localize/src/number/formatNumber.js +3 -7
  382. package/components/localize/src/number/formatNumberToParts.js +52 -18
  383. package/components/localize/src/number/getCurrencyName.js +5 -5
  384. package/components/localize/src/number/getFractionDigits.js +4 -4
  385. package/components/localize/src/number/getSeparatorsFromNumber.js +1 -3
  386. package/components/localize/src/number/parseNumber.js +0 -3
  387. package/components/localize/src/number/utils/normalize-format-number-to-parts/forceAddGroupSeparators.js +0 -1
  388. package/components/localize/src/number/utils/normalize-format-number-to-parts/forceSpaceBetweenCurrencyCodeAndNumber.js +4 -1
  389. package/components/localize/test/LocalizeManager.test.js +385 -278
  390. package/components/localize/test/LocalizeMixin.test.js +28 -112
  391. package/components/localize/test/date/formatDate.test.js +18 -48
  392. package/components/localize/test/date/getDateFormatBasedOnLocale.test.js +0 -3
  393. package/components/localize/test/date/getMonthNames.test.js +27 -12
  394. package/components/localize/test/date/getWeekdayNames.test.js +93 -49
  395. package/components/localize/test/date/normalizeDateTime.test.js +0 -2
  396. package/components/localize/test/date/parseDate.test.js +12 -16
  397. package/components/localize/test/getLocalizeManager.test.js +0 -3
  398. package/components/localize/test/isLocalizeESModule.test.js +32 -13
  399. package/components/localize/test/localize.test.js +0 -4
  400. package/components/localize/test/number/formatNumber.test.js +215 -106
  401. package/components/localize/test/number/formatNumberToParts.test.js +31 -38
  402. package/components/localize/test/number/getCurrencyName.test.js +20 -6
  403. package/components/localize/test/number/getDecimalSeparator.test.js +5 -4
  404. package/components/localize/test/number/getFractionDigits.test.js +0 -2
  405. package/components/localize/test/number/getGroupSeparator.test.js +0 -2
  406. package/components/localize/test/number/getSeparatorsFromNumber.test.js +5 -3
  407. package/components/localize/test/number/parseNumber.test.js +123 -56
  408. package/components/localize/test/side-effect-free-entrypoint.test.js +0 -6
  409. package/components/localize/test-helpers/fake-imports.js +11 -6
  410. package/components/localize/test-helpers/localizeTearDown.js +0 -1
  411. package/components/menu/src/InteractiveListMixin.js +637 -638
  412. package/components/menu/src/LionMenu.js +46 -59
  413. package/components/menu/src/MoreButtonMenuMixin.js +215 -238
  414. package/components/menu/src/MultiLevelListMixin.js +240 -246
  415. package/components/menu/src/utils/isInView.js +0 -1
  416. package/components/menu/src/utils/listItemInteractions.js +4 -4
  417. package/components/menu/test/InteractiveListMixin.test.js +0 -1
  418. package/components/menu/test/MoreButtonMenuMixin.test.js +3 -2
  419. package/components/menu/test/MultiLevelListMixin.test.js +0 -1
  420. package/components/menu/test/lion-menu-interactions.test.js +0 -1
  421. package/components/menu/test/lion-menu.test.js +6 -2
  422. package/components/menu/test-helpers/mimicKeyPress.js +12 -2
  423. package/components/menu/test-suites/InteractiveListMixin.suite.js +4 -43
  424. package/components/menu/test-suites/LionMenu.suite.js +1 -8
  425. package/components/menu/test-suites/LionMenuInteractions.suite.js +22 -44
  426. package/components/menu/test-suites/MoreButtonMenuMixin.suite.js +34 -41
  427. package/components/menu/test-suites/MultiLevelListMixin.suite.js +5 -23
  428. package/components/overlays/src/ArrowMixin.js +111 -127
  429. package/components/overlays/src/OverlayController.js +166 -151
  430. package/components/overlays/src/OverlayMixin.js +61 -63
  431. package/components/overlays/src/OverlaysManager.js +30 -32
  432. package/components/overlays/src/configurations/visibility-trigger-partials/withClickInteraction.js +0 -1
  433. package/components/overlays/src/configurations/visibility-trigger-partials/withHoverInteraction.js +11 -11
  434. package/components/overlays/src/configurations/withBottomSheetConfig.js +12 -13
  435. package/components/overlays/src/configurations/withDropdownConfig.js +4 -2
  436. package/components/overlays/src/configurations/withModalDialogConfig.js +12 -13
  437. package/components/overlays/src/configurations/withPopoverConfig.js +27 -25
  438. package/components/overlays/src/configurations/withTooltipConfig.js +15 -13
  439. package/components/overlays/src/overlayDocumentStyle.js +1 -1
  440. package/components/overlays/src/overlayShadowDomStyle.js +0 -1
  441. package/components/overlays/src/singleton.js +0 -2
  442. package/components/overlays/src/utils/adopt-styles.js +18 -18
  443. package/components/overlays/src/utils/deep-contains.js +7 -6
  444. package/components/overlays/src/utils/get-focusable-elements.js +7 -10
  445. package/components/overlays/src/utils/inert-siblings.js +2 -4
  446. package/components/overlays/src/utils/is-equal-config.js +2 -3
  447. package/components/overlays/src/utils/is-visible.js +0 -1
  448. package/components/overlays/src/utils/simulate-tab.js +1 -4
  449. package/components/overlays/src/utils/sort-by-tabindex.js +2 -4
  450. package/components/overlays/test/ArrowMixin.test.js +18 -30
  451. package/components/overlays/test/OverlayController.test.js +375 -555
  452. package/components/overlays/test/OverlayMixin.test.js +0 -2
  453. package/components/overlays/test/OverlaysManager.test.js +30 -35
  454. package/components/overlays/test/global-positioning.test.js +6 -10
  455. package/components/overlays/test/local-positioning.test.js +101 -103
  456. package/components/overlays/test/utils-tests/active-element.test.js +12 -27
  457. package/components/overlays/test/utils-tests/adopt-styles.test.js +25 -56
  458. package/components/overlays/test/utils-tests/deep-contains.test.js +73 -74
  459. package/components/overlays/test/utils-tests/get-focusable-elements.test.js +6 -23
  460. package/components/overlays/test/utils-tests/is-equal-config.test.js +32 -13
  461. package/components/overlays/test/utils-tests/visibility.test.js +44 -79
  462. package/components/overlays/test-helpers/createShadowHost.js +5 -3
  463. package/components/overlays/test-helpers/normalizeTransformStyle.js +2 -4
  464. package/components/overlays/test-suites/OverlayMixin.suite.js +152 -181
  465. package/components/overlays/test-suites/WithHoverInteraction.suite.js +96 -79
  466. package/components/overlays/translations/bg-BG.js +0 -1
  467. package/components/overlays/translations/cs-CZ.js +0 -1
  468. package/components/overlays/translations/de-DE.js +0 -1
  469. package/components/overlays/translations/en-AU.js +0 -1
  470. package/components/overlays/translations/en-GB.js +0 -1
  471. package/components/overlays/translations/en-US.js +0 -1
  472. package/components/overlays/translations/es-ES.js +0 -1
  473. package/components/overlays/translations/fr-BE.js +0 -1
  474. package/components/overlays/translations/fr-FR.js +0 -1
  475. package/components/overlays/translations/hu-HU.js +0 -1
  476. package/components/overlays/translations/it-IT.js +0 -1
  477. package/components/overlays/translations/nl-BE.js +0 -1
  478. package/components/overlays/translations/nl-NL.js +0 -1
  479. package/components/overlays/translations/pl-PL.js +0 -1
  480. package/components/overlays/translations/ro-RO.js +0 -1
  481. package/components/overlays/translations/ru-RU.js +0 -1
  482. package/components/overlays/translations/sk-SK.js +0 -1
  483. package/components/overlays/translations/tr-TR.js +0 -1
  484. package/components/overlays/translations/uk-UA.js +0 -1
  485. package/components/pagination/src/LionPagination.js +9 -12
  486. package/components/pagination/test/lion-pagination.test.js +18 -50
  487. package/components/progress-indicator/src/LionProgressIndicator.js +10 -12
  488. package/components/progress-indicator/test/lion-progress-indicator.test.js +1 -22
  489. package/components/radio-group/src/LionRadioGroup.js +1 -2
  490. package/components/radio-group/test/lion-radio-group-integrations.test.js +0 -1
  491. package/components/radio-group/test/lion-radio-group.test.js +27 -27
  492. package/components/radio-group/test/lion-radio-integrations.test.js +3 -2
  493. package/components/radio-group/test/lion-radio.test.js +30 -16
  494. package/components/select/src/LionSelect.js +12 -13
  495. package/components/select/test/lion-select.test.js +7 -12
  496. package/components/select-rich/src/LionSelectInvoker.js +18 -11
  497. package/components/select-rich/src/LionSelectRich.js +20 -43
  498. package/components/select-rich/test/demos.screenshots-test.js +40 -9
  499. package/components/select-rich/test/lion-select-invoker.test.js +26 -43
  500. package/components/select-rich/test/lion-select-listbox-suite-integration.test.js +3 -3
  501. package/components/select-rich/test/lion-select-rich-dialog-integration.test.js +4 -9
  502. package/components/select-rich/test/lion-select-rich-interaction.test.js +116 -116
  503. package/components/select-rich/test/lion-select-rich-upgrade.test.js +3 -7
  504. package/components/select-rich/test/lion-select-rich.test.js +153 -195
  505. package/components/select-rich/test-helpers/getSelectRichMembers.js +4 -1
  506. package/components/steps/src/LionStep.js +21 -12
  507. package/components/steps/src/LionSteps.js +25 -25
  508. package/components/steps/test/lion-step.test.js +18 -25
  509. package/components/steps/test/lion-steps.test.js +45 -78
  510. package/components/switch/src/LionSwitch.js +2 -7
  511. package/components/switch/src/LionSwitchButton.js +5 -6
  512. package/components/switch/test/lion-switch-button.test.js +16 -28
  513. package/components/switch/test/lion-switch.test.js +17 -31
  514. package/components/tabs/src/LionTabs.js +25 -28
  515. package/components/tabs/test/lion-tabs.test.js +156 -154
  516. package/components/textarea/src/LionTextarea.js +4 -23
  517. package/components/textarea/test/lion-textarea-integrations.test.js +0 -5
  518. package/components/textarea/test/lion-textarea.test.js +2 -28
  519. package/components/tooltip/src/LionTooltip.js +6 -6
  520. package/components/tooltip/test/lion-tooltip.test.js +75 -102
  521. package/components/validate-messages/src/getLocalizedMessage.js +8 -7
  522. package/components/validate-messages/src/loadDefaultFeedbackMessages.js +3 -1
  523. package/components/validate-messages/src/loadDefaultFeedbackMessagesNoSideEffects.js +9 -5
  524. package/components/validate-messages/src/per-entrypoint/loadComboboxMessagesNoSideEffects.js +5 -2
  525. package/components/validate-messages/src/per-entrypoint/loadFormCoreMessagesNoSideEffects.js +99 -35
  526. package/components/validate-messages/src/per-entrypoint/loadInputTelMessagesNoSideEffects.js +4 -3
  527. package/components/validate-messages/test/loadDefaultFeedbackMessages.test.js +5 -3
  528. package/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.test.js +80 -45
  529. package/components/validate-messages/translations/bg-BG.js +0 -1
  530. package/components/validate-messages/translations/cs-CZ.js +0 -1
  531. package/components/validate-messages/translations/de-DE.js +0 -1
  532. package/components/validate-messages/translations/en-AU.js +0 -1
  533. package/components/validate-messages/translations/en-GB.js +0 -1
  534. package/components/validate-messages/translations/en-PH.js +0 -1
  535. package/components/validate-messages/translations/en-US.js +0 -1
  536. package/components/validate-messages/translations/es-ES.js +0 -1
  537. package/components/validate-messages/translations/fr-BE.js +0 -1
  538. package/components/validate-messages/translations/fr-FR.js +0 -1
  539. package/components/validate-messages/translations/hu-HU.js +0 -1
  540. package/components/validate-messages/translations/it-IT.js +0 -1
  541. package/components/validate-messages/translations/nl-BE.js +0 -1
  542. package/components/validate-messages/translations/nl-NL.js +0 -1
  543. package/components/validate-messages/translations/pl-PL.js +0 -1
  544. package/components/validate-messages/translations/ro-RO.js +0 -1
  545. package/components/validate-messages/translations/ru-RU.js +0 -1
  546. package/components/validate-messages/translations/sk-SK.js +0 -1
  547. package/components/validate-messages/translations/tr-TR.js +0 -1
  548. package/components/validate-messages/translations/uk-UA.js +0 -1
  549. package/custom-elements.json +191 -56
  550. package/dist-types/components/core/src/SlotMixin.d.ts +6 -1
  551. package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
  552. package/dist-types/components/core/types/SlotMixinTypes.d.ts +5 -1
  553. package/dist-types/components/core/types/SlotMixinTypes.d.ts.map +1 -1
  554. package/dist-types/components/form-core/src/LionField.d.ts +3 -1
  555. package/dist-types/components/form-core/src/LionField.d.ts.map +1 -1
  556. package/dist-types/components/input-tel/src/LionInputTel.d.ts +6 -6
  557. package/dist-types/components/input-tel/src/LionInputTel.d.ts.map +1 -1
  558. package/dist-types/components/input-tel/src/PhoneUtilManager.d.ts +2 -2
  559. package/dist-types/components/input-tel/src/PhoneUtilManager.d.ts.map +1 -1
  560. package/dist-types/components/input-tel/src/formatters.d.ts +2 -2
  561. package/dist-types/components/input-tel/src/formatters.d.ts.map +1 -1
  562. package/dist-types/components/input-tel/src/preprocessors.d.ts +2 -2
  563. package/dist-types/components/input-tel/src/preprocessors.d.ts.map +1 -1
  564. package/dist-types/components/input-tel/test/validators.test.d.ts +1 -1
  565. package/dist-types/components/input-tel/test/validators.test.d.ts.map +1 -1
  566. package/dist-types/components/listbox/src/LionOption.d.ts +5 -2
  567. package/dist-types/components/listbox/src/LionOption.d.ts.map +1 -1
  568. package/dist-types/components/overlays/src/OverlaysManager.d.ts.map +1 -1
  569. package/dist-types/components/overlays/src/overlayDocumentStyle.d.ts.map +1 -1
  570. package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts +3 -1
  571. package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts.map +1 -1
  572. package/dist-types/components/select-rich/src/LionSelectRich.d.ts +1 -1
  573. package/dist-types/tsconfig.tsbuildinfo +1 -1
  574. package/docs/components/accordion/overview.md +2 -2
  575. package/docs/components/accordion/reference.md +2 -2
  576. package/docs/components/accordion/use-cases.md +2 -2
  577. package/docs/components/button/examples.md +2 -2
  578. package/docs/components/button/extensions.md +2 -2
  579. package/docs/components/button/overview.md +2 -2
  580. package/docs/components/button/use-cases.md +2 -2
  581. package/docs/components/calendar/overview.md +2 -2
  582. package/docs/components/calendar/use-cases.md +2 -2
  583. package/docs/components/checkbox-group/overview.md +4 -4
  584. package/docs/components/checkbox-group/use-cases.md +2 -2
  585. package/docs/components/collapsible/examples.md +2 -2
  586. package/docs/components/collapsible/overview.md +3 -3
  587. package/docs/components/collapsible/use-cases.md +2 -2
  588. package/docs/components/combobox/extensions.md +2 -2
  589. package/docs/components/combobox/overview.md +3 -3
  590. package/docs/components/combobox/use-cases.md +3 -3
  591. package/docs/components/dialog/overview.md +3 -3
  592. package/docs/components/dialog/use-cases.md +2 -2
  593. package/docs/components/drawer/overview.md +2 -2
  594. package/docs/components/drawer/use-cases.md +2 -2
  595. package/docs/components/fieldset/overview.md +7 -7
  596. package/docs/components/fieldset/use-cases.md +2 -2
  597. package/docs/components/form/overview.md +5 -5
  598. package/docs/components/form/use-cases.md +4 -4
  599. package/docs/components/icon/overview.md +2 -2
  600. package/docs/components/icon/use-cases.md +3 -3
  601. package/docs/components/input/overview.md +3 -3
  602. package/docs/components/input/use-cases.md +2 -2
  603. package/docs/components/input-amount/overview.md +5 -5
  604. package/docs/components/input-amount/use-cases.md +2 -2
  605. package/docs/components/input-amount-dropdown/use-cases.md +2 -2
  606. package/docs/components/input-date/overview.md +5 -5
  607. package/docs/components/input-date/use-cases.md +2 -2
  608. package/docs/components/input-datepicker/overview.md +7 -7
  609. package/docs/components/input-datepicker/use-cases.md +2 -2
  610. package/docs/components/input-email/overview.md +4 -4
  611. package/docs/components/input-email/use-cases.md +2 -2
  612. package/docs/components/input-file/overview.md +3 -3
  613. package/docs/components/input-file/use-cases.md +2 -2
  614. package/docs/components/input-iban/overview.md +4 -4
  615. package/docs/components/input-iban/use-cases.md +2 -2
  616. package/docs/components/input-range/overview.md +4 -4
  617. package/docs/components/input-range/use-cases.md +2 -2
  618. package/docs/components/input-stepper/overview.md +3 -3
  619. package/docs/components/input-stepper/use-cases.md +2 -2
  620. package/docs/components/input-tel/overview.md +3 -3
  621. package/docs/components/input-tel/use-cases.md +8 -8
  622. package/docs/components/input-tel-dropdown/extensions.md +2 -2
  623. package/docs/components/input-tel-dropdown/overview.md +3 -3
  624. package/docs/components/input-tel-dropdown/use-cases.md +2 -2
  625. package/docs/components/listbox/overview.md +2 -2
  626. package/docs/components/listbox/use-cases.md +3 -3
  627. package/docs/components/menu/extensions.md +2 -2
  628. package/docs/components/menu/migration.md +2 -2
  629. package/docs/components/menu/overview.md +2 -2
  630. package/docs/components/menu/use-cases.md +1 -1
  631. package/docs/components/pagination/overview.md +2 -2
  632. package/docs/components/pagination/use-cases.md +2 -2
  633. package/docs/components/progress-indicator/examples.md +2 -2
  634. package/docs/components/progress-indicator/overview.md +2 -2
  635. package/docs/components/radio-group/overview.md +5 -5
  636. package/docs/components/radio-group/use-cases.md +2 -2
  637. package/docs/components/select/overview.md +2 -2
  638. package/docs/components/select/use-cases.md +3 -3
  639. package/docs/components/select-rich/examples.md +2 -2
  640. package/docs/components/select-rich/overview.md +2 -2
  641. package/docs/components/select-rich/use-cases.md +4 -4
  642. package/docs/components/steps/overview.md +2 -2
  643. package/docs/components/steps/use-cases.md +2 -2
  644. package/docs/components/switch/overview.md +2 -2
  645. package/docs/components/switch/reference.md +2 -2
  646. package/docs/components/switch/use-cases.md +2 -2
  647. package/docs/components/tabs/examples.md +3 -3
  648. package/docs/components/tabs/overview.md +2 -2
  649. package/docs/components/tabs/use-cases.md +2 -2
  650. package/docs/components/textarea/overview.md +2 -2
  651. package/docs/components/textarea/use-cases.md +2 -2
  652. package/docs/components/tooltip/examples.md +2 -2
  653. package/docs/components/tooltip/overview.md +2 -2
  654. package/docs/components/tooltip/use-cases.md +2 -2
  655. package/docs/fundamentals/index.md +4 -4
  656. package/docs/fundamentals/node-tools/babel-plugin-extend-docs/index.md +2 -2
  657. package/docs/fundamentals/node-tools/babel-plugin-extend-docs/overview.md +2 -2
  658. package/docs/fundamentals/node-tools/providence-analytics/index.md +2 -2
  659. package/docs/fundamentals/node-tools/providence-analytics/overview.md +2 -2
  660. package/docs/fundamentals/node-tools/publish-docs/index.md +2 -2
  661. package/docs/fundamentals/node-tools/publish-docs/overview.md +5 -5
  662. package/docs/fundamentals/node-tools/remark-extend/index.md +2 -2
  663. package/docs/fundamentals/node-tools/remark-extend/overview.md +2 -2
  664. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/index.md +2 -2
  665. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +4 -4
  666. package/docs/fundamentals/rationales/TypeScript.md +62 -2
  667. package/docs/fundamentals/rationales/accessibility.md +5 -5
  668. package/docs/fundamentals/rationales/side-effects.md +2 -2
  669. package/docs/fundamentals/rationales/versioning.md +2 -2
  670. package/docs/fundamentals/systems/core/SlotMixin.md +3 -3
  671. package/docs/fundamentals/systems/core/index.md +2 -2
  672. package/docs/fundamentals/systems/core/overview.md +3 -3
  673. package/docs/fundamentals/systems/form/formatting-and-parsing.md +6 -6
  674. package/docs/fundamentals/systems/form/index.md +2 -2
  675. package/docs/fundamentals/systems/form/interaction-states.md +2 -2
  676. package/docs/fundamentals/systems/form/model-value.md +3 -3
  677. package/docs/fundamentals/systems/form/overview.md +30 -30
  678. package/docs/fundamentals/systems/form/styling.md +2 -2
  679. package/docs/fundamentals/systems/form/use-cases.md +2 -2
  680. package/docs/fundamentals/systems/form/validate.md +4 -4
  681. package/docs/fundamentals/systems/icon/index.md +2 -2
  682. package/docs/fundamentals/systems/icon/overview.md +2 -2
  683. package/docs/fundamentals/systems/localize/dates.md +2 -2
  684. package/docs/fundamentals/systems/localize/index.md +2 -2
  685. package/docs/fundamentals/systems/localize/numbers.md +2 -2
  686. package/docs/fundamentals/systems/localize/overview.md +6 -6
  687. package/docs/fundamentals/systems/localize/rationale.md +2 -2
  688. package/docs/fundamentals/systems/localize/text.md +2 -2
  689. package/docs/fundamentals/systems/localize/use-cases.md +2 -2
  690. package/docs/fundamentals/systems/overlays/_edge-cases.md +2 -2
  691. package/docs/fundamentals/systems/overlays/configuration.md +4 -4
  692. package/docs/fundamentals/systems/overlays/index.md +2 -2
  693. package/docs/fundamentals/systems/overlays/overview.md +7 -7
  694. package/docs/fundamentals/systems/overlays/rationale.md +2 -2
  695. package/docs/fundamentals/systems/overlays/use-cases.md +4 -4
  696. package/docs/fundamentals/tools/ajax/index.md +2 -2
  697. package/docs/fundamentals/tools/ajax/overview.md +2 -2
  698. package/docs/fundamentals/tools/ajax/use-cases.md +2 -2
  699. package/docs/fundamentals/tools/helpers/action-logger.md +2 -2
  700. package/docs/fundamentals/tools/helpers/index.md +2 -2
  701. package/docs/fundamentals/tools/helpers/overview.md +3 -3
  702. package/docs/fundamentals/tools/singleton-manager/example-complex/index.md +2 -2
  703. package/docs/fundamentals/tools/singleton-manager/example-fail/index.md +2 -2
  704. package/docs/fundamentals/tools/singleton-manager/example-success/index.md +2 -2
  705. package/docs/fundamentals/tools/singleton-manager/index.md +2 -2
  706. package/docs/fundamentals/tools/singleton-manager/overview.md +6 -6
  707. package/docs/guides/how-to/create-a-custom-field.md +7 -7
  708. package/docs/guides/how-to/create-a-form.md +6 -6
  709. package/docs/guides/how-to/extend-a-native-input.md +4 -4
  710. package/docs/guides/how-to/get-started.md +2 -2
  711. package/docs/guides/how-to/index.md +1 -1
  712. package/docs/guides/index.md +8 -8
  713. package/docs/guides/principles/definitions-and-terms.md +2 -2
  714. package/docs/guides/principles/index.md +5 -5
  715. package/docs/guides/principles/scoped-elements.md +2 -2
  716. package/docs/guides/principles/styling.md +3 -3
  717. package/docs/guides/principles/subclasser-apis.md +2 -2
  718. package/exports/define/lion-accordion.js +0 -1
  719. package/exports/define/lion-button-reset.js +0 -1
  720. package/exports/define/lion-button-submit.js +0 -1
  721. package/exports/define/lion-button.js +0 -1
  722. package/exports/define/lion-calendar.js +0 -1
  723. package/exports/define/lion-checkbox-group.js +0 -1
  724. package/exports/define/lion-checkbox-indeterminate.js +0 -1
  725. package/exports/define/lion-checkbox.js +0 -1
  726. package/exports/define/lion-collapsible.js +0 -1
  727. package/exports/define/lion-combobox.js +0 -1
  728. package/exports/define/lion-dialog.js +0 -1
  729. package/exports/define/lion-drawer.js +0 -1
  730. package/exports/define/lion-field.js +0 -1
  731. package/exports/define/lion-fieldset.js +0 -1
  732. package/exports/define/lion-form.js +0 -1
  733. package/exports/define/lion-icon.js +0 -1
  734. package/exports/define/lion-input-amount-dropdown.js +0 -1
  735. package/exports/define/lion-input-amount.js +0 -1
  736. package/exports/define/lion-input-date.js +0 -1
  737. package/exports/define/lion-input-datepicker.js +0 -1
  738. package/exports/define/lion-input-email.js +0 -1
  739. package/exports/define/lion-input-file.js +0 -1
  740. package/exports/define/lion-input-iban.js +0 -1
  741. package/exports/define/lion-input-range.js +0 -1
  742. package/exports/define/lion-input-stepper.js +0 -1
  743. package/exports/define/lion-input-tel-dropdown.js +0 -1
  744. package/exports/define/lion-input-tel.js +0 -1
  745. package/exports/define/lion-input.js +0 -1
  746. package/exports/define/lion-item.js +0 -1
  747. package/exports/define/lion-listbox.js +0 -1
  748. package/exports/define/lion-menu.js +0 -1
  749. package/exports/define/lion-menuitem.js +0 -1
  750. package/exports/define/lion-option.js +0 -1
  751. package/exports/define/lion-options.js +0 -1
  752. package/exports/define/lion-pagination.js +0 -1
  753. package/exports/define/lion-progress-indicator.js +0 -1
  754. package/exports/define/lion-radio-group.js +0 -1
  755. package/exports/define/lion-radio.js +0 -1
  756. package/exports/define/lion-select-invoker.js +0 -1
  757. package/exports/define/lion-select-rich.js +0 -1
  758. package/exports/define/lion-select.js +0 -1
  759. package/exports/define/lion-selected-file-list.js +0 -1
  760. package/exports/define/lion-step.js +0 -1
  761. package/exports/define/lion-steps.js +0 -1
  762. package/exports/define/lion-switch-button.js +0 -1
  763. package/exports/define/lion-switch.js +0 -1
  764. package/exports/define/lion-tabs.js +0 -1
  765. package/exports/define/lion-textarea.js +0 -1
  766. package/exports/define/lion-tooltip.js +0 -1
  767. package/exports/define/lion-validation-feedback.js +0 -1
  768. package/exports/define-helpers/sb-action-logger.js +0 -1
  769. package/exports/define-helpers/sb-locale-switcher.js +0 -1
  770. package/exports/form-core.js +0 -8
  771. package/exports/localize-no-side-effects.js +0 -1
  772. package/exports/localize.js +0 -2
  773. package/exports/overlays.js +0 -4
  774. package/generated/awesome-phonenumber/LICENSE +22 -0
  775. package/generated/awesome-phonenumber/LICENSE.closure-library +176 -0
  776. package/generated/awesome-phonenumber/LICENSE.libphonenumber +176 -0
  777. package/generated/awesome-phonenumber/checksums.json +6 -0
  778. package/generated/awesome-phonenumber/index-esm.mjs +817 -0
  779. package/generated/awesome-phonenumber/index.d.ts +227 -0
  780. package/generated/awesome-phonenumber/index.js +45 -0
  781. package/generated/awesome-phonenumber/lib/index.js +710 -0
  782. package/generated/awesome-phonenumber/package.json +9 -0
  783. package/generated/awesome-phonenumber/provenance.json +13 -0
  784. package/package.json +32 -10
  785. package/web-types.json +1 -1
  786. package/vendor/README.md +0 -61
  787. package/vendor/awesome-phonenumber-7.9.0-tlouisse.libphonenumber-9.0.41.tgz +0 -0
@@ -1,7 +1,6 @@
1
1
  import { html } from 'lit';
2
2
  import { LionCollapsible } from '@lion/ui/collapsible.js';
3
3
  import { drawerStyle } from './drawerStyle.js';
4
-
5
4
  const EVENT = {
6
5
  TRANSITION_END: 'transitionend',
7
6
  TRANSITION_START: 'transitionstart',
@@ -36,27 +35,21 @@ export class LionDrawer extends LionCollapsible {
36
35
 
37
36
  /** @private */
38
37
  __toggle;
39
-
40
38
  constructor() {
41
39
  super();
42
-
43
40
  this.__toggle = () => {
44
41
  // @ts-ignore [ts7-2565] TS7 checks definite assignment on this inferred field; Lit reactive property: read through a typed local instead (e.g. const next = this.x ?? DEFAULT) - a class field would shadow the accessor Lit creates from static properties
45
42
  this.opened = !this.opened;
46
43
  };
47
44
  }
48
-
49
45
  connectedCallback() {
50
46
  super.connectedCallback();
51
-
52
47
  if (!this.hasAttribute('position')) {
53
48
  this.position = 'left';
54
49
  }
55
-
56
50
  if (this._contentNode) {
57
51
  this._contentNode.style.setProperty('display', '');
58
52
  }
59
-
60
53
  this.__setBoundaries();
61
54
  }
62
55
 
@@ -70,14 +63,11 @@ export class LionDrawer extends LionCollapsible {
70
63
  this._openedChanged();
71
64
  }
72
65
  }
73
-
74
66
  static get styles() {
75
67
  return [drawerStyle];
76
68
  }
77
-
78
69
  __setBoundaries() {
79
70
  const host = this.shadowRoot?.host;
80
-
81
71
  if (this.position === 'top') {
82
72
  this.minHeight = host ? getComputedStyle(host).getPropertyValue('--min-height') : '0px';
83
73
  this.maxHeight = host ? getComputedStyle(host).getPropertyValue('--max-height') : '0px';
@@ -89,10 +79,8 @@ export class LionDrawer extends LionCollapsible {
89
79
  this.minHeight = 'auto';
90
80
  this.maxHeight = 'fit-content';
91
81
  }
92
-
93
82
  setTimeout(() => {
94
83
  const prop = this.position === 'top' ? 'width' : 'height';
95
-
96
84
  if (this.__contentNode) {
97
85
  this.__contentNode.style.setProperty(prop, '');
98
86
  }
@@ -107,11 +95,9 @@ export class LionDrawer extends LionCollapsible {
107
95
  const stale = this.position;
108
96
  this._position = position;
109
97
  this.setAttribute('position', position);
110
-
111
98
  this.__setBoundaries();
112
99
  this.requestUpdate('position', stale);
113
100
  }
114
-
115
101
  get position() {
116
102
  return this._position ?? 'left';
117
103
  }
@@ -126,12 +112,13 @@ export class LionDrawer extends LionCollapsible {
126
112
  const min = this.position === 'top' ? this.minHeight : this.minWidth;
127
113
  const max = this.position === 'top' ? this.maxHeight : this.maxWidth;
128
114
  const prop = this.position === 'top' ? 'height' : 'width';
129
-
130
- contentNode.style.setProperty(prop, /** @type {string} */ (min));
115
+ contentNode.style.setProperty(prop, /** @type {string} */ min);
131
116
  // eslint-disable-next-line no-promise-executor-return
132
- await new Promise(resolve => requestAnimationFrame(() => resolve(true)));
133
- contentNode.style.setProperty(prop, /** @type {string} */ (max));
134
- await this._waitForTransition({ contentNode });
117
+ await new Promise((resolve) => requestAnimationFrame(() => resolve(true)));
118
+ contentNode.style.setProperty(prop, /** @type {string} */ max);
119
+ await this._waitForTransition({
120
+ contentNode,
121
+ });
135
122
  }
136
123
 
137
124
  /**
@@ -148,12 +135,12 @@ export class LionDrawer extends LionCollapsible {
148
135
  ) {
149
136
  return;
150
137
  }
151
-
152
138
  const min = this.position === 'top' ? this.minHeight : this.minWidth;
153
139
  const prop = this.position === 'top' ? 'height' : 'width';
154
-
155
- contentNode.style.setProperty(prop, /** @type {string} */ (min));
156
- await this._waitForTransition({ contentNode });
140
+ contentNode.style.setProperty(prop, /** @type {string} */ min);
141
+ await this._waitForTransition({
142
+ contentNode,
143
+ });
157
144
  }
158
145
 
159
146
  /**
@@ -163,13 +150,12 @@ export class LionDrawer extends LionCollapsible {
163
150
  * @returns {Promise<void>} transition event
164
151
  */
165
152
  _waitForTransition({ contentNode }) {
166
- return new Promise(resolve => {
153
+ return new Promise((resolve) => {
167
154
  const transitionStarted = () => {
168
155
  contentNode.removeEventListener(EVENT.TRANSITION_START, transitionStarted);
169
156
  this.transitioning = true;
170
157
  };
171
158
  contentNode.addEventListener(EVENT.TRANSITION_START, transitionStarted);
172
-
173
159
  const transitionEnded = () => {
174
160
  contentNode.removeEventListener(EVENT.TRANSITION_END, transitionEnded);
175
161
  this.transitioning = false;
@@ -183,38 +169,36 @@ export class LionDrawer extends LionCollapsible {
183
169
  * @protected
184
170
  */
185
171
  get __contentNode() {
186
- return /** @type {HTMLElement} */ (this.shadowRoot?.querySelector('.container'));
172
+ return /** @type {HTMLElement} */ this.shadowRoot?.querySelector('.container');
187
173
  }
188
-
189
174
  get _contentWidth() {
190
175
  const size = this.__contentNode?.getBoundingClientRect().width || 0;
191
176
  return `${size}px`;
192
177
  }
193
-
194
178
  get _contentHeight() {
195
179
  const size = this.__contentNode?.getBoundingClientRect().height || 0;
196
180
  return `${size}px`;
197
181
  }
198
-
199
182
  _openedChanged() {
200
183
  this._updateContentSize();
201
184
  if (this._invokerNode) {
202
185
  this._invokerNode.setAttribute('aria-expanded', `${this.opened}`);
203
186
  }
204
-
205
187
  this.dispatchEvent(new CustomEvent('opened-changed'));
206
188
  }
207
-
208
189
  async _updateContentSize() {
209
190
  if (this.__contentNode) {
210
191
  if (this.opened) {
211
- await this._showAnimation({ contentNode: this.__contentNode });
192
+ await this._showAnimation({
193
+ contentNode: this.__contentNode,
194
+ });
212
195
  } else {
213
- await this._hideAnimation({ contentNode: this.__contentNode });
196
+ await this._hideAnimation({
197
+ contentNode: this.__contentNode,
198
+ });
214
199
  }
215
200
  }
216
201
  }
217
-
218
202
  render() {
219
203
  return html`
220
204
  <div class="container">
@@ -1,5 +1,4 @@
1
1
  import { css } from 'lit';
2
-
3
2
  export const drawerStyle = css`
4
3
  :host {
5
4
  display: block;
@@ -6,8 +6,7 @@ import '@lion/ui/define/lion-drawer.js';
6
6
  * @typedef {import('../src/LionDrawer.js').LionDrawer} LionDrawer
7
7
  * @typedef {import('lit').TemplateResult} TemplateResult
8
8
  */
9
- const fixture = /** @type {(arg: TemplateResult) => Promise<LionDrawer>} */ (_fixture);
10
-
9
+ const fixture = /** @type {(arg: TemplateResult) => Promise<LionDrawer>} */ _fixture;
11
10
  const template = html`
12
11
  <lion-drawer>
13
12
  <button slot="invoker">Open</button>
@@ -15,65 +14,52 @@ const template = html`
15
14
  <div slot="content" class="drawer">This is the content of the drawer</div>
16
15
  </lion-drawer>
17
16
  `;
18
-
19
17
  describe('<lion-drawer>', () => {
20
18
  describe('Drawer', () => {
21
19
  it('sets position to "left" by default', async () => {
22
20
  const drawer = await fixture(template);
23
21
  expect(drawer.position).to.equal('left');
24
22
  });
25
-
26
23
  it('has [position] attribute which serves as styling hook', async () => {
27
24
  const drawer = await fixture(template);
28
25
  expect(drawer).to.have.attribute('position').equal('left');
29
26
  });
30
-
31
27
  it('sets the minimum and maximum width when position=left', async () => {
32
28
  const drawer = await fixture(template);
33
29
  const minWidth = getComputedStyle(drawer).getPropertyValue('--min-width');
34
30
  const maxWidth = getComputedStyle(drawer).getPropertyValue('--max-width');
35
-
36
31
  expect(drawer.minWidth).to.equal(minWidth);
37
32
  expect(drawer.maxWidth).to.equal(maxWidth);
38
33
  });
39
-
40
34
  it('sets the minimum and maximum width when position=right', async () => {
41
35
  const drawer = await fixture(template);
42
36
  drawer.position = 'right';
43
37
  await drawer.updateComplete;
44
-
45
38
  const minWidth = getComputedStyle(drawer).getPropertyValue('--min-width');
46
39
  const maxWidth = getComputedStyle(drawer).getPropertyValue('--max-width');
47
-
48
40
  expect(drawer.minWidth).to.equal(minWidth);
49
41
  expect(drawer.maxWidth).to.equal(maxWidth);
50
42
  });
51
-
52
43
  it('sets the minimum and maximum height when position=top', async () => {
53
44
  const drawer = await fixture(template);
54
45
  drawer.position = 'top';
55
46
  await drawer.updateComplete;
56
-
57
47
  const minHeight = getComputedStyle(drawer).getPropertyValue('--min-height');
58
48
  const maxHeight = getComputedStyle(drawer).getPropertyValue('--max-height');
59
-
60
49
  expect(drawer.minHeight).to.equal(minHeight);
61
50
  expect(drawer.maxHeight).to.equal(maxHeight);
62
51
  });
63
52
  });
64
-
65
53
  describe('Accessibility', () => {
66
54
  it('[collapsed] is a11y AXE accessible', async () => {
67
55
  const drawer = await fixture(template);
68
56
  await expect(drawer).to.be.accessible();
69
57
  });
70
-
71
58
  it('[opened] is a11y AXE accessible', async () => {
72
59
  const drawer = await fixture(template);
73
60
  drawer.opened = true;
74
61
  await expect(drawer).to.be.accessible();
75
62
  });
76
-
77
63
  describe('Invoker', () => {
78
64
  it('links id of content items to invoker via [aria-controls]', async () => {
79
65
  const drawerElement = await fixture(template);
@@ -81,13 +67,11 @@ describe('<lion-drawer>', () => {
81
67
  const content = drawerElement.querySelector('[slot=content]');
82
68
  expect(invoker?.getAttribute('aria-controls')).to.equal(content?.id);
83
69
  });
84
-
85
70
  it('adds aria-expanded="false" to invoker when its content is not expanded', async () => {
86
71
  const drawerElement = await fixture(template);
87
72
  const invoker = drawerElement.querySelector('[slot=invoker]');
88
73
  expect(invoker).to.have.attribute('aria-expanded', 'false');
89
74
  });
90
-
91
75
  it('adds aria-expanded="true" to invoker when its content is expanded', async () => {
92
76
  const drawerElement = await fixture(template);
93
77
  const invoker = drawerElement.querySelector('[slot=invoker]');
@@ -2,8 +2,10 @@ import {
2
2
  runFormGroupMixinSuite,
3
3
  runFormGroupMixinInputSuite,
4
4
  } from '@lion/ui/form-core-test-suites.js';
5
-
6
5
  import '@lion/ui/define/lion-fieldset.js';
7
-
8
- runFormGroupMixinSuite({ tagString: 'lion-fieldset' });
9
- runFormGroupMixinInputSuite({ tagString: 'lion-fieldset' });
6
+ runFormGroupMixinSuite({
7
+ tagString: 'lion-fieldset',
8
+ });
9
+ runFormGroupMixinInputSuite({
10
+ tagString: 'lion-fieldset',
11
+ });
@@ -23,7 +23,6 @@ export class LionForm extends LionFieldset {
23
23
  /** @protected */
24
24
  this._reset = this._reset.bind(this);
25
25
  }
26
-
27
26
  connectedCallback() {
28
27
  super.connectedCallback();
29
28
  this.__registerEventsForLionForm();
@@ -31,21 +30,22 @@ export class LionForm extends LionFieldset {
31
30
  // @override LionFieldset: makes sure a11y is handled by ._formNode
32
31
  this.removeAttribute('role');
33
32
  }
34
-
35
33
  disconnectedCallback() {
36
34
  super.disconnectedCallback();
37
35
  this.__teardownEventsForLionForm();
38
36
  }
39
-
40
37
  get _formNode() {
41
- return /** @type {HTMLFormElement} */ (this.querySelector('form'));
38
+ return /** @type {HTMLFormElement} */ this.querySelector('form');
42
39
  }
43
-
44
40
  submit() {
45
41
  if (this._formNode) {
46
42
  // Firefox requires cancelable flag, otherwise we cannot preventDefault
47
43
  // Firefox still runs default handlers for untrusted events :\
48
- this._formNode.dispatchEvent(new Event('submit', { cancelable: true }));
44
+ this._formNode.dispatchEvent(
45
+ new Event('submit', {
46
+ cancelable: true,
47
+ }),
48
+ );
49
49
  } else {
50
50
  throwFormNodeError();
51
51
  }
@@ -59,13 +59,15 @@ export class LionForm extends LionFieldset {
59
59
  ev.preventDefault();
60
60
  ev.stopPropagation();
61
61
  this.submitGroup();
62
- this.dispatchEvent(new Event('submit', { bubbles: true }));
63
-
62
+ this.dispatchEvent(
63
+ new Event('submit', {
64
+ bubbles: true,
65
+ }),
66
+ );
64
67
  if (this.hasFeedbackFor?.includes('error')) {
65
- this._setFocusOnFirstErroneousFormElement(/** @type { * & FormRegistrarHost } */ (this));
68
+ this._setFocusOnFirstErroneousFormElement(/** @type { * & FormRegistrarHost } */ this);
66
69
  }
67
70
  }
68
-
69
71
  reset() {
70
72
  if (this._formNode) {
71
73
  this._formNode.reset();
@@ -82,7 +84,11 @@ export class LionForm extends LionFieldset {
82
84
  ev.preventDefault();
83
85
  ev.stopPropagation();
84
86
  this.resetGroup();
85
- this.dispatchEvent(new Event('reset', { bubbles: true }));
87
+ this.dispatchEvent(
88
+ new Event('reset', {
89
+ bubbles: true,
90
+ }),
91
+ );
86
92
  }
87
93
 
88
94
  /**
@@ -91,9 +97,8 @@ export class LionForm extends LionFieldset {
91
97
  */
92
98
  _setFocusOnFirstErroneousFormElement(element) {
93
99
  const firstFormElWithError =
94
- element.formElements.find(child => child.hasFeedbackFor.includes('error')) ||
100
+ element.formElements.find((child) => child.hasFeedbackFor.includes('error')) ||
95
101
  element.formElements[0];
96
-
97
102
  if (firstFormElWithError._focusableNode) {
98
103
  firstFormElWithError._focusableNode.focus();
99
104
  } else {
@@ -20,15 +20,13 @@ import {
20
20
  expect,
21
21
  html,
22
22
  } from '@open-wc/testing';
23
-
24
23
  import { isActiveElement } from '../../core/test-helpers/isActiveElement.js';
25
24
 
26
25
  /**
27
26
  * @typedef {import('../src/LionForm.js').LionForm} LionForm
28
27
  * @typedef {import('lit').TemplateResult} TemplateResult
29
28
  */
30
- const fixture = /** @type {(arg: TemplateResult) => Promise<LionForm>} */ (_fixture);
31
-
29
+ const fixture = /** @type {(arg: TemplateResult) => Promise<LionForm>} */ _fixture;
32
30
  const childTagString = defineCE(
33
31
  class extends LionField {
34
32
  get slots() {
@@ -39,7 +37,6 @@ const childTagString = defineCE(
39
37
  },
40
38
  );
41
39
  const childTag = unsafeStatic(childTagString);
42
-
43
40
  describe('<lion-form>', () => {
44
41
  it('is an instance of LionFieldSet', async () => {
45
42
  const el = await fixture(html`
@@ -49,7 +46,6 @@ describe('<lion-form>', () => {
49
46
  `);
50
47
  expect(el).to.be.instanceOf(LionFieldset);
51
48
  });
52
-
53
49
  it('relies on the native form for its accessible role', async () => {
54
50
  const el = await fixture(html`
55
51
  <lion-form>
@@ -58,7 +54,6 @@ describe('<lion-form>', () => {
58
54
  `);
59
55
  expect(el.getAttribute('role')).to.be.null;
60
56
  });
61
-
62
57
  it('has a custom reset that gets triggered by native reset', async () => {
63
58
  const withDefaults = await fixture(html`
64
59
  <lion-form>
@@ -68,15 +63,13 @@ describe('<lion-form>', () => {
68
63
  </form>
69
64
  </lion-form>
70
65
  `);
71
- const resetButton = /** @type {HTMLInputElement} */ (
72
- withDefaults.querySelector('input[type=reset]')
73
- );
74
-
66
+ const resetButton =
67
+ /** @type {HTMLInputElement} */
68
+ withDefaults.querySelector('input[type=reset]');
75
69
  withDefaults.formElements.firstName.modelValue = 'updatedFoo';
76
70
  expect(withDefaults.modelValue).to.deep.equal({
77
71
  firstName: 'updatedFoo',
78
72
  });
79
-
80
73
  withDefaults.reset();
81
74
  expect(withDefaults.modelValue).to.deep.equal({
82
75
  firstName: 'Foo',
@@ -87,13 +80,11 @@ describe('<lion-form>', () => {
87
80
  expect(withDefaults.modelValue).to.deep.equal({
88
81
  firstName: 'updatedFoo',
89
82
  });
90
-
91
83
  resetButton.click();
92
84
  expect(withDefaults.modelValue).to.deep.equal({
93
85
  firstName: 'Foo',
94
86
  });
95
87
  });
96
-
97
88
  it('dispatches reset events', async () => {
98
89
  const el = await fixture(html`
99
90
  <lion-form>
@@ -102,7 +93,6 @@ describe('<lion-form>', () => {
102
93
  </form>
103
94
  </lion-form>
104
95
  `);
105
-
106
96
  setTimeout(() => el.reset());
107
97
  const resetEv = await oneEvent(el, 'reset');
108
98
  expect(resetEv).to.be.instanceOf(Event);
@@ -111,7 +101,6 @@ describe('<lion-form>', () => {
111
101
  expect(resetEv.bubbles).to.be.true;
112
102
  expect(resetEv.composed).to.be.false;
113
103
  });
114
-
115
104
  it('works with the native submit event (triggered via a button)', async () => {
116
105
  const submitSpy = spy();
117
106
  const el = await fixture(html`
@@ -121,12 +110,10 @@ describe('<lion-form>', () => {
121
110
  </form>
122
111
  </lion-form>
123
112
  `);
124
-
125
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
113
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
126
114
  button.click();
127
115
  expect(submitSpy.callCount).to.equal(1);
128
116
  });
129
-
130
117
  it('dispatches submit events', async () => {
131
118
  const el = await fixture(html`
132
119
  <lion-form>
@@ -135,7 +122,7 @@ describe('<lion-form>', () => {
135
122
  </form>
136
123
  </lion-form>
137
124
  `);
138
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
125
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
139
126
  setTimeout(() => button.click());
140
127
  const submitEv = await oneEvent(el, 'submit');
141
128
  expect(submitEv).to.be.instanceOf(Event);
@@ -144,7 +131,6 @@ describe('<lion-form>', () => {
144
131
  expect(submitEv.bubbles).to.be.true;
145
132
  expect(submitEv.composed).to.be.false;
146
133
  });
147
-
148
134
  it('redispatches a submit event on the native form node when calling submit() imperatively', async () => {
149
135
  const nativeFormSubmitEventSpy = spy();
150
136
  const el = await fixture(html`
@@ -161,7 +147,6 @@ describe('<lion-form>', () => {
161
147
  expect(nativeFormSubmitEventSpy.calledOnce).to.be.true;
162
148
  expect(submitGroupSpy.calledOnce).to.be.true;
163
149
  });
164
-
165
150
  it('handles internal submit handler before dispatch', async () => {
166
151
  const el = await fixture(html`
167
152
  <lion-form>
@@ -170,14 +155,13 @@ describe('<lion-form>', () => {
170
155
  </form>
171
156
  </lion-form>
172
157
  `);
173
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
158
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
174
159
  const internalHandlerSpy = spy(el, 'submitGroup');
175
160
  const dispatchSpy = spy(el, 'dispatchEvent');
176
161
  await aTimeout(0);
177
162
  button.click();
178
163
  expect(internalHandlerSpy).to.be.calledBefore(dispatchSpy);
179
164
  });
180
-
181
165
  it('handles internal submit handler before dispatch', async () => {
182
166
  const el = await fixture(html`
183
167
  <lion-form>
@@ -186,14 +170,13 @@ describe('<lion-form>', () => {
186
170
  </form>
187
171
  </lion-form>
188
172
  `);
189
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
173
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
190
174
  const internalHandlerSpy = spy(el, 'submitGroup');
191
175
  const dispatchSpy = spy(el, 'dispatchEvent');
192
176
  button.click();
193
177
  expect(dispatchSpy.args[0][0].type).to.equal('submit');
194
178
  expect(internalHandlerSpy).to.be.calledBefore(dispatchSpy);
195
179
  });
196
-
197
180
  it('handles internal reset handler before dispatch', async () => {
198
181
  const el = await fixture(html`
199
182
  <lion-form>
@@ -202,58 +185,51 @@ describe('<lion-form>', () => {
202
185
  </form>
203
186
  </lion-form>
204
187
  `);
205
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
188
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
206
189
  const internalHandlerSpy = spy(el, 'resetGroup');
207
190
  const dispatchSpy = spy(el, 'dispatchEvent');
208
191
  button.click();
209
192
  expect(dispatchSpy.args[0][0].type).to.equal('reset');
210
193
  expect(internalHandlerSpy).to.be.calledBefore(dispatchSpy);
211
194
  });
212
-
213
195
  it('sets focus on submit to the first erroneous form element', async () => {
214
196
  const el = await fixture(html`
215
197
  <lion-form>
216
198
  <form>
217
- <${childTag} name="firstName" .modelValue=${'Foo'} .validators=${[
218
- new Required(),
219
- ]}></${childTag}>
199
+ <${childTag} name="firstName" .modelValue=${'Foo'} .validators=${[new Required()]}></${childTag}>
220
200
  <${childTag} name="lastName" .validators=${[new Required()]}></${childTag}>
221
201
  <button type="submit">submit</button>
222
202
  </form>
223
203
  </lion-form>
224
204
  `);
225
205
  expect(el.getAttribute('aria-invalid')).to.equal('false');
226
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
206
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
227
207
  const dispatchSpy = spy(el, 'dispatchEvent');
228
208
  button.click();
229
- expect(dispatchSpy.args.map(args => args[0].type)).to.contain('submit');
209
+ expect(dispatchSpy.args.map((args) => args[0].type)).to.contain('submit');
230
210
  // @ts-ignore [allow-protected] in test
231
211
  expect(isActiveElement(el.formElements[1]._inputNode)).to.be.true;
232
212
  });
233
-
234
213
  it('sets focus on submit to the first erroneous form element within a fieldset', async () => {
235
214
  const el = await fixture(html`
236
215
  <lion-form>
237
216
  <form>
238
217
  <lion-fieldset name="name">
239
- <${childTag} name="firstName" .modelValue=${'Foo'} .validators=${[
240
- new Required(),
241
- ]}></${childTag}>
218
+ <${childTag} name="firstName" .modelValue=${'Foo'} .validators=${[new Required()]}></${childTag}>
242
219
  <${childTag} name="lastName" .validators=${[new Required()]}></${childTag}>
243
220
  </lion-fieldset>
244
221
  <button type="submit">submit</button>
245
222
  </form>
246
223
  </lion-form>
247
224
  `);
248
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
225
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
249
226
  const dispatchSpy = spy(el, 'dispatchEvent');
250
227
  button.click();
251
- expect(dispatchSpy.args.map(args => args[0].type)).to.contain('submit');
228
+ expect(dispatchSpy.args.map((args) => args[0].type)).to.contain('submit');
252
229
  const fieldset = el.formElements[0];
253
230
  // @ts-ignore [allow-protected] in test
254
231
  expect(isActiveElement(fieldset.formElements[1]._inputNode)).to.be.true;
255
232
  });
256
-
257
233
  it('sets focus on submit to the first form element within a erroneous fieldset', async () => {
258
234
  const el = await fixture(html`
259
235
  <lion-form>
@@ -266,14 +242,13 @@ describe('<lion-form>', () => {
266
242
  </form>
267
243
  </lion-form>
268
244
  `);
269
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
245
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
270
246
  const dispatchSpy = spy(el, 'dispatchEvent');
271
247
  button.click();
272
- expect(dispatchSpy.args.map(args => args[0].type)).to.contain('submit');
248
+ expect(dispatchSpy.args.map((args) => args[0].type)).to.contain('submit');
273
249
  const fieldset = el.formElements[0];
274
250
  expect(isActiveElement(fieldset.formElements[0]._inputNode)).to.be.true;
275
251
  });
276
-
277
252
  it('sets focus on submit to the first form element within a erroneous fieldset within another fieldset', async () => {
278
253
  const el = await fixture(html`
279
254
  <lion-form>
@@ -288,14 +263,13 @@ describe('<lion-form>', () => {
288
263
  </form>
289
264
  </lion-form>
290
265
  `);
291
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
266
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
292
267
  const parentFieldSetEl = el.formElements[0];
293
268
  const childFieldsetEl = parentFieldSetEl.formElements[0];
294
269
  const inputEl = childFieldsetEl.formElements[0];
295
270
  button.click();
296
271
  expect(isActiveElement(inputEl._focusableNode)).to.be.true;
297
272
  });
298
-
299
273
  it('sets focus on submit to the first form element within a erroneous listbox', async () => {
300
274
  const el = await fixture(html`
301
275
  <lion-form>
@@ -308,12 +282,11 @@ describe('<lion-form>', () => {
308
282
  </form>
309
283
  </lion-form>
310
284
  `);
311
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
285
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
312
286
  button.click();
313
287
  const listboxEl = el.formElements[0];
314
288
  expect(isActiveElement(listboxEl._inputNode)).to.be.true;
315
289
  });
316
-
317
290
  it('sets focus on submit to the first form element within a erroneous listbox within a fieldset', async () => {
318
291
  const el = await fixture(html`
319
292
  <lion-form>
@@ -328,13 +301,12 @@ describe('<lion-form>', () => {
328
301
  </form>
329
302
  </lion-form>
330
303
  `);
331
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
304
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
332
305
  button.click();
333
306
  const fieldsetEl = el.formElements[0];
334
307
  const listboxEl = fieldsetEl.formElements[0];
335
308
  expect(isActiveElement(listboxEl._inputNode)).to.be.true;
336
309
  });
337
-
338
310
  it('sets focus on submit to the first form element within a erroneous checkbox-group', async () => {
339
311
  const el = await fixture(html`
340
312
  <lion-form>
@@ -347,13 +319,12 @@ describe('<lion-form>', () => {
347
319
  </form>
348
320
  </lion-form>
349
321
  `);
350
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
322
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
351
323
  const checkboxGroupEl = el.formElements[0];
352
324
  const checkboxEl = checkboxGroupEl.formElements[0];
353
325
  button.click();
354
326
  expect(isActiveElement(checkboxEl._focusableNode)).to.be.true;
355
327
  });
356
-
357
328
  it('sets focus on submit to the first form element within a erroneous radio-group', async () => {
358
329
  const el = await fixture(html`
359
330
  <lion-form>
@@ -368,8 +339,7 @@ describe('<lion-form>', () => {
368
339
  </form>
369
340
  </lion-form>
370
341
  `);
371
- const button = /** @type {HTMLButtonElement} */ (el.querySelector('button'));
372
-
342
+ const button = /** @type {HTMLButtonElement} */ el.querySelector('button');
373
343
  const radioGroupEl = el.formElements[0];
374
344
  const radioEl = radioGroupEl.formElements[0];
375
345
  button.click();