@lion/ui 0.23.0 → 0.25.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 (803) 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 +127 -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 +20 -8
  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 +5 -2
  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 +172 -152
  430. package/components/overlays/src/OverlayMixin.js +64 -69
  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 +406 -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/invoker-compatibility.test.js +37 -0
  456. package/components/overlays/test/local-positioning.test.js +101 -103
  457. package/components/overlays/test/utils-tests/active-element.test.js +12 -27
  458. package/components/overlays/test/utils-tests/adopt-styles.test.js +25 -56
  459. package/components/overlays/test/utils-tests/deep-contains.test.js +73 -74
  460. package/components/overlays/test/utils-tests/get-focusable-elements.test.js +6 -23
  461. package/components/overlays/test/utils-tests/is-equal-config.test.js +32 -13
  462. package/components/overlays/test/utils-tests/visibility.test.js +44 -79
  463. package/components/overlays/test-helpers/createShadowHost.js +5 -3
  464. package/components/overlays/test-helpers/normalizeTransformStyle.js +2 -4
  465. package/components/overlays/test-suites/OverlayMixin.suite.js +152 -181
  466. package/components/overlays/test-suites/WithHoverInteraction.suite.js +96 -79
  467. package/components/overlays/translations/bg-BG.js +0 -1
  468. package/components/overlays/translations/cs-CZ.js +0 -1
  469. package/components/overlays/translations/de-DE.js +0 -1
  470. package/components/overlays/translations/en-AU.js +0 -1
  471. package/components/overlays/translations/en-GB.js +0 -1
  472. package/components/overlays/translations/en-US.js +0 -1
  473. package/components/overlays/translations/es-ES.js +0 -1
  474. package/components/overlays/translations/fr-BE.js +0 -1
  475. package/components/overlays/translations/fr-FR.js +0 -1
  476. package/components/overlays/translations/hu-HU.js +0 -1
  477. package/components/overlays/translations/it-IT.js +0 -1
  478. package/components/overlays/translations/nl-BE.js +0 -1
  479. package/components/overlays/translations/nl-NL.js +0 -1
  480. package/components/overlays/translations/pl-PL.js +0 -1
  481. package/components/overlays/translations/ro-RO.js +0 -1
  482. package/components/overlays/translations/ru-RU.js +0 -1
  483. package/components/overlays/translations/sk-SK.js +0 -1
  484. package/components/overlays/translations/tr-TR.js +0 -1
  485. package/components/overlays/translations/uk-UA.js +0 -1
  486. package/components/pagination/src/LionPagination.js +9 -12
  487. package/components/pagination/test/lion-pagination.test.js +18 -50
  488. package/components/progress-indicator/src/LionProgressIndicator.js +10 -12
  489. package/components/progress-indicator/test/lion-progress-indicator.test.js +1 -22
  490. package/components/radio-group/src/LionRadioGroup.js +1 -2
  491. package/components/radio-group/test/lion-radio-group-integrations.test.js +0 -1
  492. package/components/radio-group/test/lion-radio-group.test.js +27 -27
  493. package/components/radio-group/test/lion-radio-integrations.test.js +3 -2
  494. package/components/radio-group/test/lion-radio.test.js +30 -16
  495. package/components/select/src/LionSelect.js +12 -13
  496. package/components/select/test/lion-select.test.js +7 -12
  497. package/components/select-rich/src/LionSelectInvoker.js +18 -11
  498. package/components/select-rich/src/LionSelectRich.js +22 -44
  499. package/components/select-rich/test/demos.screenshots-test.js +40 -9
  500. package/components/select-rich/test/lion-select-invoker.test.js +26 -43
  501. package/components/select-rich/test/lion-select-listbox-suite-integration.test.js +3 -3
  502. package/components/select-rich/test/lion-select-rich-dialog-integration.test.js +4 -9
  503. package/components/select-rich/test/lion-select-rich-interaction.test.js +116 -116
  504. package/components/select-rich/test/lion-select-rich-upgrade.test.js +3 -7
  505. package/components/select-rich/test/lion-select-rich.test.js +153 -195
  506. package/components/select-rich/test-helpers/getSelectRichMembers.js +4 -1
  507. package/components/steps/src/LionStep.js +21 -12
  508. package/components/steps/src/LionSteps.js +25 -25
  509. package/components/steps/test/lion-step.test.js +18 -25
  510. package/components/steps/test/lion-steps.test.js +45 -78
  511. package/components/switch/src/LionSwitch.js +2 -7
  512. package/components/switch/src/LionSwitchButton.js +5 -6
  513. package/components/switch/test/lion-switch-button.test.js +16 -28
  514. package/components/switch/test/lion-switch.test.js +17 -31
  515. package/components/tabs/src/LionTabs.js +25 -28
  516. package/components/tabs/test/lion-tabs.test.js +156 -154
  517. package/components/textarea/src/LionTextarea.js +4 -23
  518. package/components/textarea/test/lion-textarea-integrations.test.js +0 -5
  519. package/components/textarea/test/lion-textarea.test.js +2 -28
  520. package/components/tooltip/src/LionTooltip.js +6 -6
  521. package/components/tooltip/test/lion-tooltip.test.js +75 -102
  522. package/components/validate-messages/src/getLocalizedMessage.js +8 -7
  523. package/components/validate-messages/src/loadDefaultFeedbackMessages.js +3 -1
  524. package/components/validate-messages/src/loadDefaultFeedbackMessagesNoSideEffects.js +9 -5
  525. package/components/validate-messages/src/per-entrypoint/loadComboboxMessagesNoSideEffects.js +5 -2
  526. package/components/validate-messages/src/per-entrypoint/loadFormCoreMessagesNoSideEffects.js +99 -35
  527. package/components/validate-messages/src/per-entrypoint/loadInputTelMessagesNoSideEffects.js +4 -3
  528. package/components/validate-messages/test/loadDefaultFeedbackMessages.test.js +5 -3
  529. package/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.test.js +80 -45
  530. package/components/validate-messages/translations/bg-BG.js +0 -1
  531. package/components/validate-messages/translations/cs-CZ.js +0 -1
  532. package/components/validate-messages/translations/de-DE.js +0 -1
  533. package/components/validate-messages/translations/en-AU.js +0 -1
  534. package/components/validate-messages/translations/en-GB.js +0 -1
  535. package/components/validate-messages/translations/en-PH.js +0 -1
  536. package/components/validate-messages/translations/en-US.js +0 -1
  537. package/components/validate-messages/translations/es-ES.js +0 -1
  538. package/components/validate-messages/translations/fr-BE.js +0 -1
  539. package/components/validate-messages/translations/fr-FR.js +0 -1
  540. package/components/validate-messages/translations/hu-HU.js +0 -1
  541. package/components/validate-messages/translations/it-IT.js +0 -1
  542. package/components/validate-messages/translations/nl-BE.js +0 -1
  543. package/components/validate-messages/translations/nl-NL.js +0 -1
  544. package/components/validate-messages/translations/pl-PL.js +0 -1
  545. package/components/validate-messages/translations/ro-RO.js +0 -1
  546. package/components/validate-messages/translations/ru-RU.js +0 -1
  547. package/components/validate-messages/translations/sk-SK.js +0 -1
  548. package/components/validate-messages/translations/tr-TR.js +0 -1
  549. package/components/validate-messages/translations/uk-UA.js +0 -1
  550. package/custom-elements.json +229 -85
  551. package/dist-types/components/core/src/SlotMixin.d.ts +6 -1
  552. package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
  553. package/dist-types/components/core/types/SlotMixinTypes.d.ts +5 -1
  554. package/dist-types/components/core/types/SlotMixinTypes.d.ts.map +1 -1
  555. package/dist-types/components/form-core/src/LionField.d.ts +3 -1
  556. package/dist-types/components/form-core/src/LionField.d.ts.map +1 -1
  557. package/dist-types/components/input-tel/src/LionInputTel.d.ts +6 -6
  558. package/dist-types/components/input-tel/src/LionInputTel.d.ts.map +1 -1
  559. package/dist-types/components/input-tel/src/PhoneUtilManager.d.ts +2 -2
  560. package/dist-types/components/input-tel/src/PhoneUtilManager.d.ts.map +1 -1
  561. package/dist-types/components/input-tel/src/formatters.d.ts +2 -2
  562. package/dist-types/components/input-tel/src/formatters.d.ts.map +1 -1
  563. package/dist-types/components/input-tel/src/preprocessors.d.ts +2 -2
  564. package/dist-types/components/input-tel/src/preprocessors.d.ts.map +1 -1
  565. package/dist-types/components/input-tel/test/validators.test.d.ts +1 -1
  566. package/dist-types/components/input-tel/test/validators.test.d.ts.map +1 -1
  567. package/dist-types/components/input-tel/test-helpers/mockPhoneUtilManager.d.ts +5 -0
  568. package/dist-types/components/input-tel/test-helpers/mockPhoneUtilManager.d.ts.map +1 -1
  569. package/dist-types/components/listbox/src/LionListbox.d.ts +2 -2
  570. package/dist-types/components/listbox/src/LionListbox.d.ts.map +1 -1
  571. package/dist-types/components/listbox/src/LionOption.d.ts +5 -2
  572. package/dist-types/components/listbox/src/LionOption.d.ts.map +1 -1
  573. package/dist-types/components/overlays/src/OverlayController.d.ts +3 -1
  574. package/dist-types/components/overlays/src/OverlayController.d.ts.map +1 -1
  575. package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
  576. package/dist-types/components/overlays/src/OverlaysManager.d.ts.map +1 -1
  577. package/dist-types/components/overlays/src/overlayDocumentStyle.d.ts.map +1 -1
  578. package/dist-types/components/overlays/test/invoker-compatibility.test.d.ts +3 -0
  579. package/dist-types/components/overlays/test/invoker-compatibility.test.d.ts.map +1 -0
  580. package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts +3 -1
  581. package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts.map +1 -1
  582. package/dist-types/components/select-rich/src/LionSelectRich.d.ts +6 -5
  583. package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
  584. package/dist-types/tsconfig.tsbuildinfo +1 -1
  585. package/docs/components/accordion/overview.md +2 -2
  586. package/docs/components/accordion/reference.md +2 -2
  587. package/docs/components/accordion/use-cases.md +2 -2
  588. package/docs/components/button/examples.md +2 -2
  589. package/docs/components/button/extensions.md +2 -2
  590. package/docs/components/button/overview.md +2 -2
  591. package/docs/components/button/use-cases.md +2 -2
  592. package/docs/components/calendar/overview.md +2 -2
  593. package/docs/components/calendar/use-cases.md +2 -2
  594. package/docs/components/checkbox-group/overview.md +4 -4
  595. package/docs/components/checkbox-group/use-cases.md +2 -2
  596. package/docs/components/collapsible/examples.md +2 -2
  597. package/docs/components/collapsible/overview.md +3 -3
  598. package/docs/components/collapsible/use-cases.md +2 -2
  599. package/docs/components/combobox/api-table.md +1 -1
  600. package/docs/components/combobox/extensions.md +2 -2
  601. package/docs/components/combobox/overview.md +3 -3
  602. package/docs/components/combobox/use-cases.md +3 -3
  603. package/docs/components/dialog/overview.md +3 -3
  604. package/docs/components/dialog/use-cases.md +2 -2
  605. package/docs/components/drawer/overview.md +2 -2
  606. package/docs/components/drawer/use-cases.md +2 -2
  607. package/docs/components/fieldset/overview.md +7 -7
  608. package/docs/components/fieldset/use-cases.md +2 -2
  609. package/docs/components/form/overview.md +5 -5
  610. package/docs/components/form/use-cases.md +4 -4
  611. package/docs/components/icon/overview.md +2 -2
  612. package/docs/components/icon/use-cases.md +3 -3
  613. package/docs/components/input/overview.md +3 -3
  614. package/docs/components/input/use-cases.md +2 -2
  615. package/docs/components/input-amount/overview.md +5 -5
  616. package/docs/components/input-amount/use-cases.md +2 -2
  617. package/docs/components/input-amount-dropdown/use-cases.md +2 -2
  618. package/docs/components/input-date/overview.md +5 -5
  619. package/docs/components/input-date/use-cases.md +2 -2
  620. package/docs/components/input-datepicker/overview.md +7 -7
  621. package/docs/components/input-datepicker/use-cases.md +2 -2
  622. package/docs/components/input-email/overview.md +4 -4
  623. package/docs/components/input-email/use-cases.md +2 -2
  624. package/docs/components/input-file/overview.md +3 -3
  625. package/docs/components/input-file/use-cases.md +2 -2
  626. package/docs/components/input-iban/overview.md +4 -4
  627. package/docs/components/input-iban/use-cases.md +2 -2
  628. package/docs/components/input-range/overview.md +4 -4
  629. package/docs/components/input-range/use-cases.md +2 -2
  630. package/docs/components/input-stepper/overview.md +3 -3
  631. package/docs/components/input-stepper/use-cases.md +2 -2
  632. package/docs/components/input-tel/overview.md +3 -3
  633. package/docs/components/input-tel/use-cases.md +8 -8
  634. package/docs/components/input-tel-dropdown/extensions.md +2 -2
  635. package/docs/components/input-tel-dropdown/overview.md +3 -3
  636. package/docs/components/input-tel-dropdown/use-cases.md +2 -2
  637. package/docs/components/listbox/api-table.md +4 -4
  638. package/docs/components/listbox/overview.md +2 -2
  639. package/docs/components/listbox/use-cases.md +3 -3
  640. package/docs/components/menu/extensions.md +2 -2
  641. package/docs/components/menu/migration.md +2 -2
  642. package/docs/components/menu/overview.md +2 -2
  643. package/docs/components/menu/use-cases.md +1 -1
  644. package/docs/components/pagination/overview.md +2 -2
  645. package/docs/components/pagination/use-cases.md +2 -2
  646. package/docs/components/progress-indicator/examples.md +2 -2
  647. package/docs/components/progress-indicator/overview.md +2 -2
  648. package/docs/components/radio-group/overview.md +5 -5
  649. package/docs/components/radio-group/use-cases.md +2 -2
  650. package/docs/components/select/overview.md +2 -2
  651. package/docs/components/select/use-cases.md +3 -3
  652. package/docs/components/select-rich/api-table.md +1 -1
  653. package/docs/components/select-rich/examples.md +2 -2
  654. package/docs/components/select-rich/overview.md +2 -2
  655. package/docs/components/select-rich/use-cases.md +4 -4
  656. package/docs/components/steps/overview.md +2 -2
  657. package/docs/components/steps/use-cases.md +2 -2
  658. package/docs/components/switch/overview.md +2 -2
  659. package/docs/components/switch/reference.md +2 -2
  660. package/docs/components/switch/use-cases.md +2 -2
  661. package/docs/components/tabs/examples.md +3 -3
  662. package/docs/components/tabs/overview.md +2 -2
  663. package/docs/components/tabs/use-cases.md +2 -2
  664. package/docs/components/textarea/overview.md +2 -2
  665. package/docs/components/textarea/use-cases.md +2 -2
  666. package/docs/components/tooltip/examples.md +2 -2
  667. package/docs/components/tooltip/overview.md +2 -2
  668. package/docs/components/tooltip/use-cases.md +2 -2
  669. package/docs/fundamentals/index.md +4 -4
  670. package/docs/fundamentals/node-tools/babel-plugin-extend-docs/index.md +2 -2
  671. package/docs/fundamentals/node-tools/babel-plugin-extend-docs/overview.md +2 -2
  672. package/docs/fundamentals/node-tools/providence-analytics/index.md +2 -2
  673. package/docs/fundamentals/node-tools/providence-analytics/overview.md +2 -2
  674. package/docs/fundamentals/node-tools/publish-docs/index.md +2 -2
  675. package/docs/fundamentals/node-tools/publish-docs/overview.md +5 -5
  676. package/docs/fundamentals/node-tools/remark-extend/index.md +2 -2
  677. package/docs/fundamentals/node-tools/remark-extend/overview.md +2 -2
  678. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/index.md +2 -2
  679. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +4 -4
  680. package/docs/fundamentals/rationales/TypeScript.md +62 -2
  681. package/docs/fundamentals/rationales/accessibility.md +5 -5
  682. package/docs/fundamentals/rationales/side-effects.md +2 -2
  683. package/docs/fundamentals/rationales/versioning.md +2 -2
  684. package/docs/fundamentals/systems/core/SlotMixin.md +3 -3
  685. package/docs/fundamentals/systems/core/index.md +2 -2
  686. package/docs/fundamentals/systems/core/overview.md +3 -3
  687. package/docs/fundamentals/systems/form/formatting-and-parsing.md +6 -6
  688. package/docs/fundamentals/systems/form/index.md +2 -2
  689. package/docs/fundamentals/systems/form/interaction-states.md +2 -2
  690. package/docs/fundamentals/systems/form/model-value.md +3 -3
  691. package/docs/fundamentals/systems/form/overview.md +30 -30
  692. package/docs/fundamentals/systems/form/styling.md +2 -2
  693. package/docs/fundamentals/systems/form/use-cases.md +2 -2
  694. package/docs/fundamentals/systems/form/validate.md +4 -4
  695. package/docs/fundamentals/systems/icon/index.md +2 -2
  696. package/docs/fundamentals/systems/icon/overview.md +2 -2
  697. package/docs/fundamentals/systems/localize/dates.md +2 -2
  698. package/docs/fundamentals/systems/localize/index.md +2 -2
  699. package/docs/fundamentals/systems/localize/numbers.md +2 -2
  700. package/docs/fundamentals/systems/localize/overview.md +6 -6
  701. package/docs/fundamentals/systems/localize/rationale.md +2 -2
  702. package/docs/fundamentals/systems/localize/text.md +2 -2
  703. package/docs/fundamentals/systems/localize/use-cases.md +2 -2
  704. package/docs/fundamentals/systems/overlays/_edge-cases.md +2 -2
  705. package/docs/fundamentals/systems/overlays/api-table.md +1 -1
  706. package/docs/fundamentals/systems/overlays/configuration.md +4 -4
  707. package/docs/fundamentals/systems/overlays/index.md +2 -2
  708. package/docs/fundamentals/systems/overlays/overview.md +7 -7
  709. package/docs/fundamentals/systems/overlays/rationale.md +2 -2
  710. package/docs/fundamentals/systems/overlays/use-cases.md +4 -4
  711. package/docs/fundamentals/tools/ajax/index.md +2 -2
  712. package/docs/fundamentals/tools/ajax/overview.md +2 -2
  713. package/docs/fundamentals/tools/ajax/use-cases.md +2 -2
  714. package/docs/fundamentals/tools/helpers/action-logger.md +2 -2
  715. package/docs/fundamentals/tools/helpers/index.md +2 -2
  716. package/docs/fundamentals/tools/helpers/overview.md +3 -3
  717. package/docs/fundamentals/tools/singleton-manager/example-complex/index.md +2 -2
  718. package/docs/fundamentals/tools/singleton-manager/example-fail/index.md +2 -2
  719. package/docs/fundamentals/tools/singleton-manager/example-success/index.md +2 -2
  720. package/docs/fundamentals/tools/singleton-manager/index.md +2 -2
  721. package/docs/fundamentals/tools/singleton-manager/overview.md +6 -6
  722. package/docs/guides/how-to/create-a-custom-field.md +7 -7
  723. package/docs/guides/how-to/create-a-form.md +6 -6
  724. package/docs/guides/how-to/extend-a-native-input.md +4 -4
  725. package/docs/guides/how-to/get-started.md +2 -2
  726. package/docs/guides/how-to/index.md +1 -1
  727. package/docs/guides/index.md +8 -8
  728. package/docs/guides/principles/definitions-and-terms.md +2 -2
  729. package/docs/guides/principles/index.md +5 -5
  730. package/docs/guides/principles/scoped-elements.md +2 -2
  731. package/docs/guides/principles/styling.md +3 -3
  732. package/docs/guides/principles/subclasser-apis.md +2 -2
  733. package/exports/define/lion-accordion.js +0 -1
  734. package/exports/define/lion-button-reset.js +0 -1
  735. package/exports/define/lion-button-submit.js +0 -1
  736. package/exports/define/lion-button.js +0 -1
  737. package/exports/define/lion-calendar.js +0 -1
  738. package/exports/define/lion-checkbox-group.js +0 -1
  739. package/exports/define/lion-checkbox-indeterminate.js +0 -1
  740. package/exports/define/lion-checkbox.js +0 -1
  741. package/exports/define/lion-collapsible.js +0 -1
  742. package/exports/define/lion-combobox.js +0 -1
  743. package/exports/define/lion-dialog.js +0 -1
  744. package/exports/define/lion-drawer.js +0 -1
  745. package/exports/define/lion-field.js +0 -1
  746. package/exports/define/lion-fieldset.js +0 -1
  747. package/exports/define/lion-form.js +0 -1
  748. package/exports/define/lion-icon.js +0 -1
  749. package/exports/define/lion-input-amount-dropdown.js +0 -1
  750. package/exports/define/lion-input-amount.js +0 -1
  751. package/exports/define/lion-input-date.js +0 -1
  752. package/exports/define/lion-input-datepicker.js +0 -1
  753. package/exports/define/lion-input-email.js +0 -1
  754. package/exports/define/lion-input-file.js +0 -1
  755. package/exports/define/lion-input-iban.js +0 -1
  756. package/exports/define/lion-input-range.js +0 -1
  757. package/exports/define/lion-input-stepper.js +0 -1
  758. package/exports/define/lion-input-tel-dropdown.js +0 -1
  759. package/exports/define/lion-input-tel.js +0 -1
  760. package/exports/define/lion-input.js +0 -1
  761. package/exports/define/lion-item.js +0 -1
  762. package/exports/define/lion-listbox.js +0 -1
  763. package/exports/define/lion-menu.js +0 -1
  764. package/exports/define/lion-menuitem.js +0 -1
  765. package/exports/define/lion-option.js +0 -1
  766. package/exports/define/lion-options.js +0 -1
  767. package/exports/define/lion-pagination.js +0 -1
  768. package/exports/define/lion-progress-indicator.js +0 -1
  769. package/exports/define/lion-radio-group.js +0 -1
  770. package/exports/define/lion-radio.js +0 -1
  771. package/exports/define/lion-select-invoker.js +0 -1
  772. package/exports/define/lion-select-rich.js +0 -1
  773. package/exports/define/lion-select.js +0 -1
  774. package/exports/define/lion-selected-file-list.js +0 -1
  775. package/exports/define/lion-step.js +0 -1
  776. package/exports/define/lion-steps.js +0 -1
  777. package/exports/define/lion-switch-button.js +0 -1
  778. package/exports/define/lion-switch.js +0 -1
  779. package/exports/define/lion-tabs.js +0 -1
  780. package/exports/define/lion-textarea.js +0 -1
  781. package/exports/define/lion-tooltip.js +0 -1
  782. package/exports/define/lion-validation-feedback.js +0 -1
  783. package/exports/define-helpers/sb-action-logger.js +0 -1
  784. package/exports/define-helpers/sb-locale-switcher.js +0 -1
  785. package/exports/form-core.js +0 -8
  786. package/exports/localize-no-side-effects.js +0 -1
  787. package/exports/localize.js +0 -2
  788. package/exports/overlays.js +0 -4
  789. package/generated/awesome-phonenumber/LICENSE +22 -0
  790. package/generated/awesome-phonenumber/LICENSE.closure-library +176 -0
  791. package/generated/awesome-phonenumber/LICENSE.libphonenumber +176 -0
  792. package/generated/awesome-phonenumber/checksums.json +6 -0
  793. package/generated/awesome-phonenumber/index-esm.mjs +817 -0
  794. package/generated/awesome-phonenumber/index.d.ts +227 -0
  795. package/generated/awesome-phonenumber/index.js +45 -0
  796. package/generated/awesome-phonenumber/lib/index.js +710 -0
  797. package/generated/awesome-phonenumber/package.json +9 -0
  798. package/generated/awesome-phonenumber/provenance.json +13 -0
  799. package/package.json +38 -15
  800. package/vscode.html-custom-data.json +5 -5
  801. package/web-types.json +1 -1
  802. package/vendor/README.md +0 -61
  803. package/vendor/awesome-phonenumber-7.9.0-tlouisse.libphonenumber-9.0.41.tgz +0 -0
@@ -2,7 +2,6 @@ import { LitElement } from 'lit';
2
2
  import { IsNumber, Required, LionField, Validator, FormGroupMixin } from '@lion/ui/form-core.js';
3
3
  import '@lion/ui/define/lion-field.js';
4
4
  import '@lion/ui/define/lion-validation-feedback.js';
5
-
6
5
  import { localizeTearDown } from '@lion/ui/localize-test-helpers.js';
7
6
  import {
8
7
  aTimeout,
@@ -29,9 +28,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
29
28
  };
30
29
  }
31
30
  }
32
-
33
31
  const childTagString = cfg.childTagString || defineCE(FormChild);
34
-
35
32
  class FormGroup extends FormGroupMixin(LitElement) {
36
33
  constructor() {
37
34
  super();
@@ -41,7 +38,6 @@ export function runFormGroupMixinSuite(cfg = {}) {
41
38
  this._repropagationRole = 'fieldset'; // configures FormControlMixin
42
39
  }
43
40
  }
44
-
45
41
  const tagString = cfg.tagString || defineCE(FormGroup);
46
42
  const tag = unsafeStatic(tagString);
47
43
  const childTag = unsafeStatic(childTagString);
@@ -52,47 +48,42 @@ export function runFormGroupMixinSuite(cfg = {}) {
52
48
  <${childTag} name="hobbies[]"></${childTag}>
53
49
  <${childTag} name="hobbies[]"></${childTag}>
54
50
  `;
55
-
56
51
  beforeEach(() => {
57
52
  localizeTearDown();
58
53
  });
59
-
60
54
  describe('FormGroupMixin', () => {
61
55
  // TODO: Tests below belong to FormControlMixin. Preferably run suite integration test
62
56
  it(`has a fieldName based on the label`, async () => {
63
- const el1 = /** @type {FormGroup} */ (
64
- await fixture(html`<${tag} label="foo">${inputSlots}</${tag}>`)
65
- );
57
+ const el1 =
58
+ /** @type {FormGroup} */
59
+ await fixture(html`<${tag} label="foo">${inputSlots}</${tag}>`);
66
60
  const { _labelNode: _labelNode1 } = getFormControlMembers(el1);
67
61
  expect(el1.fieldName).to.equal(_labelNode1.textContent);
68
-
69
- const el2 = /** @type {FormGroup} */ (
70
- await fixture(html`<${tag}><label slot="label">bar</label>${inputSlots}</${tag}>`)
71
- );
62
+ const el2 =
63
+ /** @type {FormGroup} */
64
+ await fixture(html`<${tag}><label slot="label">bar</label>${inputSlots}</${tag}>`);
72
65
  const { _labelNode: _labelNode2 } = getFormControlMembers(el2);
73
66
  expect(el2.fieldName).to.equal(_labelNode2.textContent);
74
67
  });
75
-
76
68
  it(`has a fieldName based on the name if no label exists`, async () => {
77
- const el = /** @type {FormGroup} */ (
78
- await fixture(html`<${tag} name="foo">${inputSlots}</${tag}>`)
79
- );
69
+ const el =
70
+ /** @type {FormGroup} */
71
+ await fixture(html`<${tag} name="foo">${inputSlots}</${tag}>`);
80
72
  expect(el.fieldName).to.equal(el.name);
81
73
  });
82
-
83
74
  it(`can override fieldName`, async () => {
84
- const el = /** @type {FormGroup} */ (
75
+ const el =
76
+ /** @type {FormGroup} */
85
77
  await fixture(html`
86
78
  <${tag} label="foo" .fieldName="${'bar'}">${inputSlots}</${tag}>
87
- `)
88
- );
79
+ `);
89
80
  // @ts-ignore [allow-protected] in test
90
81
  expect(el.__fieldName).to.equal(el.fieldName);
91
82
  });
92
83
 
93
84
  // TODO: Tests below belong to FormRegistrarMixin. Preferably run suite integration test
94
85
  it(`${tagString} has an up to date list of every form element in .formElements`, async () => {
95
- const el = /** @type {FormGroup} */ (await fixture(html`<${tag}>${inputSlots}</${tag}>`));
86
+ const el = /** @type {FormGroup} */ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
96
87
  // @ts-ignore [allow-protected] in test
97
88
  expect(el.formElements._keys().length).to.equal(3);
98
89
  expect(el.formElements['hobbies[]'].length).to.equal(2);
@@ -101,27 +92,33 @@ export function runFormGroupMixinSuite(cfg = {}) {
101
92
  expect(el.formElements._keys().length).to.equal(3);
102
93
  expect(el.formElements['hobbies[]'].length).to.equal(1);
103
94
  });
104
-
105
95
  it(`supports in html wrapped form elements`, async () => {
106
- const el = /** @type {FormGroup} */ (
96
+ const el =
97
+ /** @type {FormGroup} */
107
98
  await fixture(html`
108
99
  <${tag}>
109
100
  <div>
110
101
  <${childTag} name="foo"></${childTag}>
111
102
  </div>
112
103
  </${tag}>
113
- `)
114
- );
104
+ `);
115
105
  expect(el.formElements.length).to.equal(1);
116
106
  el.children[0].removeChild(el.formElements.foo);
117
107
  expect(el.formElements.length).to.equal(0);
118
108
  });
119
-
120
109
  it('handles names with ending [] as an array', async () => {
121
- const el = /** @type {FormGroup} */ (await fixture(html`<${tag}>${inputSlots}</${tag}>`));
122
- el.formElements['gender[]'][0].modelValue = { value: 'male' };
123
- el.formElements['hobbies[]'][0].modelValue = { checked: false, value: 'chess' };
124
- el.formElements['hobbies[]'][1].modelValue = { checked: false, value: 'rugby' };
110
+ const el = /** @type {FormGroup} */ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
111
+ el.formElements['gender[]'][0].modelValue = {
112
+ value: 'male',
113
+ };
114
+ el.formElements['hobbies[]'][0].modelValue = {
115
+ checked: false,
116
+ value: 'chess',
117
+ };
118
+ el.formElements['hobbies[]'][1].modelValue = {
119
+ checked: false,
120
+ value: 'rugby',
121
+ };
125
122
 
126
123
  // @ts-ignore
127
124
  expect(el.formElements._keys().length).to.equal(3);
@@ -129,81 +126,79 @@ export function runFormGroupMixinSuite(cfg = {}) {
129
126
  expect(el.formElements['hobbies[]'][0].modelValue.value).to.equal('chess');
130
127
  expect(el.formElements['gender[]'][0].modelValue.value).to.equal('male');
131
128
  expect(el.modelValue['hobbies[]']).to.deep.equal([
132
- { checked: false, value: 'chess' },
133
- { checked: false, value: 'rugby' },
129
+ {
130
+ checked: false,
131
+ value: 'chess',
132
+ },
133
+ {
134
+ checked: false,
135
+ value: 'rugby',
136
+ },
134
137
  ]);
135
138
  });
136
-
137
139
  it('throws if name is the same as its parent', async () => {
138
140
  const orig = console.info;
139
141
  console.info = () => {};
140
-
141
142
  let error;
142
- const el = /** @type {FormGroup} */ (await fixture(html`<${tag} name="foo"></${tag}>`));
143
+ const el = /** @type {FormGroup} */ await fixture(html`<${tag} name="foo"></${tag}>`);
143
144
  try {
144
145
  // we test the api directly as errors thrown from a web component are in a
145
146
  // different context and we can not catch them here => register fake elements
146
147
  el.addFormElement(
147
- /** @type {HTMLElement & import('../../types/FormControlMixinTypes.js').FormControlHost} */ ({
148
+ /** @type {HTMLElement & import('../../types/FormControlMixinTypes.js').FormControlHost} */ {
148
149
  name: 'foo',
149
- }),
150
+ },
150
151
  );
151
152
  } catch (err) {
152
153
  error = err;
153
154
  }
154
155
  expect(error).to.be.instanceOf(TypeError);
155
- expect(/** @type {TypeError} */ (error).message).to.equal(
156
+ expect(/** @type {TypeError} */ error.message).to.equal(
156
157
  'You can not have the same name "foo" as your parent',
157
158
  );
158
-
159
159
  console.info = orig; // restore original console
160
160
  });
161
-
162
161
  it('throws if same name without ending [] is used', async () => {
163
162
  const orig = console.info;
164
163
  console.info = () => {};
165
-
166
164
  let error;
167
- const el = /** @type {FormGroup} */ (await fixture(html`<${tag}></${tag}>`));
165
+ const el = /** @type {FormGroup} */ await fixture(html`<${tag}></${tag}>`);
168
166
  try {
169
167
  // we test the api directly as errors thrown from a web component are in a
170
168
  // different context and we can not catch them here => register fake elements
171
169
  el.addFormElement(
172
- /** @type {HTMLElement & import('../../types/FormControlMixinTypes.js').FormControlHost} */ ({
170
+ /** @type {HTMLElement & import('../../types/FormControlMixinTypes.js').FormControlHost} */ {
173
171
  name: 'fooBar',
174
- }),
172
+ },
175
173
  );
176
174
  el.addFormElement(
177
- /** @type {HTMLElement & import('../../types/FormControlMixinTypes.js').FormControlHost} */ ({
175
+ /** @type {HTMLElement & import('../../types/FormControlMixinTypes.js').FormControlHost} */ {
178
176
  name: 'fooBar',
179
- }),
177
+ },
180
178
  );
181
179
  } catch (err) {
182
180
  error = err;
183
181
  }
184
182
  expect(error).to.be.instanceOf(TypeError);
185
- expect(/** @type {TypeError} */ (error).message).to.equal(
183
+ expect(/** @type {TypeError} */ error.message).to.equal(
186
184
  'Name "fooBar" is already registered - if you want an array add [] to the end',
187
185
  );
188
-
189
186
  console.info = orig; // restore original console
190
187
  });
191
188
  /* eslint-enable no-console */
192
189
 
193
190
  it('can dynamically add/remove elements', async () => {
194
- const el = /** @type {FormGroup} */ (await fixture(html`<${tag}>${inputSlots}</${tag}>`));
195
- const newField = /** @type {FormGroup} */ (
196
- await fixture(html`<${childTag} name="lastName"></${childTag}>`)
197
- );
191
+ const el = /** @type {FormGroup} */ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
192
+ const newField =
193
+ /** @type {FormGroup} */
194
+ await fixture(html`<${childTag} name="lastName"></${childTag}>`);
198
195
  const { _inputNode } = getFormControlMembers(el);
199
196
 
200
197
  // @ts-ignore [allow-protected] in test
201
198
  expect(el.formElements._keys().length).to.equal(3);
202
-
203
199
  el.appendChild(newField);
204
200
  // @ts-ignore [allow-protected] in test
205
201
  expect(el.formElements._keys().length).to.equal(4);
206
-
207
202
  _inputNode.removeChild(newField);
208
203
  // @ts-ignore [allow-protected] in test
209
204
  expect(el.formElements._keys().length).to.equal(3);
@@ -212,34 +207,63 @@ export function runFormGroupMixinSuite(cfg = {}) {
212
207
  // TODO: Tests below belong to FormGroupMixin. Preferably run suite integration test
213
208
 
214
209
  it('can read/write all values (of every input) via this.modelValue', async () => {
215
- const el = /** @type {FormGroup} */ (
210
+ const el =
211
+ /** @type {FormGroup} */
216
212
  await fixture(html`
217
213
  <${tag}>
218
214
  <${childTag} name="lastName"></${childTag}>
219
215
  <${tag} name="newfieldset">${inputSlots}</${tag}>
220
216
  </${tag}>
221
- `)
222
- );
223
- const newFieldset = /** @type {FormGroup} */ (el.querySelector(tagString));
217
+ `);
218
+ const newFieldset = /** @type {FormGroup} */ el.querySelector(tagString);
224
219
  el.formElements.lastName.modelValue = 'Bar';
225
- newFieldset.formElements['hobbies[]'][0].modelValue = { checked: true, value: 'chess' };
226
- newFieldset.formElements['hobbies[]'][1].modelValue = { checked: false, value: 'football' };
227
- newFieldset.formElements['gender[]'][0].modelValue = { checked: false, value: 'male' };
228
- newFieldset.formElements['gender[]'][1].modelValue = { checked: false, value: 'female' };
229
- newFieldset.formElements.color.modelValue = { checked: false, value: 'blue' };
230
-
220
+ newFieldset.formElements['hobbies[]'][0].modelValue = {
221
+ checked: true,
222
+ value: 'chess',
223
+ };
224
+ newFieldset.formElements['hobbies[]'][1].modelValue = {
225
+ checked: false,
226
+ value: 'football',
227
+ };
228
+ newFieldset.formElements['gender[]'][0].modelValue = {
229
+ checked: false,
230
+ value: 'male',
231
+ };
232
+ newFieldset.formElements['gender[]'][1].modelValue = {
233
+ checked: false,
234
+ value: 'female',
235
+ };
236
+ newFieldset.formElements.color.modelValue = {
237
+ checked: false,
238
+ value: 'blue',
239
+ };
231
240
  expect(el.modelValue).to.deep.equal({
232
241
  lastName: 'Bar',
233
242
  newfieldset: {
234
243
  'hobbies[]': [
235
- { checked: true, value: 'chess' },
236
- { checked: false, value: 'football' },
244
+ {
245
+ checked: true,
246
+ value: 'chess',
247
+ },
248
+ {
249
+ checked: false,
250
+ value: 'football',
251
+ },
237
252
  ],
238
253
  'gender[]': [
239
- { checked: false, value: 'male' },
240
- { checked: false, value: 'female' },
254
+ {
255
+ checked: false,
256
+ value: 'male',
257
+ },
258
+ {
259
+ checked: false,
260
+ value: 'female',
261
+ },
241
262
  ],
242
- color: { checked: false, value: 'blue' },
263
+ color: {
264
+ checked: false,
265
+ value: 'blue',
266
+ },
243
267
  },
244
268
  });
245
269
 
@@ -249,17 +273,31 @@ export function runFormGroupMixinSuite(cfg = {}) {
249
273
  lastName: 2,
250
274
  newfieldset: {
251
275
  'hobbies[]': [
252
- { checked: true, value: 'chess' },
253
- { checked: false, value: 'baseball' },
276
+ {
277
+ checked: true,
278
+ value: 'chess',
279
+ },
280
+ {
281
+ checked: false,
282
+ value: 'baseball',
283
+ },
254
284
  ],
255
285
  'gender[]': [
256
- { checked: false, value: 'male' },
257
- { checked: false, value: 'female' },
286
+ {
287
+ checked: false,
288
+ value: 'male',
289
+ },
290
+ {
291
+ checked: false,
292
+ value: 'female',
293
+ },
258
294
  ],
259
- color: { checked: false, value: 'blue' },
295
+ color: {
296
+ checked: false,
297
+ value: 'blue',
298
+ },
260
299
  },
261
300
  };
262
-
263
301
  expect(newFieldset.formElements['hobbies[]'][0].modelValue).to.deep.equal({
264
302
  checked: true,
265
303
  value: 'chess',
@@ -270,26 +308,24 @@ export function runFormGroupMixinSuite(cfg = {}) {
270
308
  });
271
309
  expect(el.formElements.lastName.modelValue).to.equal(2);
272
310
  });
273
-
274
311
  it('works with document.createElement', async () => {
275
- const el = /** @type {FormGroup} */ (document.createElement(tagString));
276
- const childEl = /** @type {FormChild} */ (document.createElement(childTagString));
312
+ const el = /** @type {FormGroup} */ document.createElement(tagString);
313
+ const childEl = /** @type {FormChild} */ document.createElement(childTagString);
277
314
  childEl.name = 'planet';
278
315
  childEl.modelValue = 'earth';
279
316
  expect(el.formElements.length).to.equal(0);
280
-
281
317
  const wrapper = await fixture('<div></div>');
282
318
  el.appendChild(childEl);
283
319
  wrapper.appendChild(el);
284
-
285
320
  expect(el.formElements.length).to.equal(1);
286
-
287
321
  await el.registrationComplete;
288
- expect(el.modelValue).to.deep.equal({ planet: 'earth' });
322
+ expect(el.modelValue).to.deep.equal({
323
+ planet: 'earth',
324
+ });
289
325
  });
290
-
291
326
  it('does not list disabled values in this.modelValue', async () => {
292
- const el = /** @type {FormGroup} */ (
327
+ const el =
328
+ /** @type {FormGroup} */
293
329
  await fixture(html`
294
330
  <${tag}>
295
331
  <${childTag} name="a" disabled .modelValue="${'x'}"></${childTag}>
@@ -302,8 +338,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
302
338
  <${childTag} name="e" .modelValue="${'x'}"></${childTag}>
303
339
  </${tag}>
304
340
  </${tag}>
305
- `)
306
- );
341
+ `);
307
342
  expect(el.modelValue).to.deep.equal({
308
343
  b: 'x',
309
344
  newFieldset: {
@@ -311,7 +346,6 @@ export function runFormGroupMixinSuite(cfg = {}) {
311
346
  },
312
347
  });
313
348
  });
314
-
315
349
  it('allows overriding whether fields are included in when fetching modelValue/serializedValue etc.', async () => {
316
350
  class FormGroupSubclass extends FormGroupMixin(LitElement) {
317
351
  constructor() {
@@ -334,10 +368,10 @@ export function runFormGroupMixinSuite(cfg = {}) {
334
368
  return true;
335
369
  }
336
370
  }
337
-
338
371
  const tagStringSubclass = defineCE(FormGroupSubclass);
339
372
  const tagSubclass = unsafeStatic(tagStringSubclass);
340
- const el = /** @type {FormGroup} */ (
373
+ const el =
374
+ /** @type {FormGroup} */
341
375
  await fixture(html`
342
376
  <${tagSubclass}>
343
377
  <${childTag} name="a" disabled .modelValue="${'x'}"></${childTag}>
@@ -350,8 +384,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
350
384
  <${childTag} name="e" .modelValue="${'x'}"></${childTag}>
351
385
  </${tagSubclass}>
352
386
  </${tagSubclass}>
353
- `)
354
- );
387
+ `);
355
388
  expect(el.modelValue).to.deep.equal({
356
389
  a: 'x',
357
390
  b: 'x',
@@ -363,7 +396,6 @@ export function runFormGroupMixinSuite(cfg = {}) {
363
396
  e: 'x',
364
397
  },
365
398
  });
366
-
367
399
  expect(el.serializedValue).to.deep.equal({
368
400
  b: 'x',
369
401
  newFieldset: {
@@ -371,7 +403,6 @@ export function runFormGroupMixinSuite(cfg = {}) {
371
403
  },
372
404
  });
373
405
  });
374
-
375
406
  it('allows imperatively passing a filter function to _getFromAllFormElements', async () => {
376
407
  class FormGroupSubclass extends FormGroupMixin(LitElement) {
377
408
  constructor() {
@@ -393,10 +424,10 @@ export function runFormGroupMixinSuite(cfg = {}) {
393
424
  return true;
394
425
  }
395
426
  }
396
-
397
427
  const tagStringSubclass = defineCE(FormGroupSubclass);
398
428
  const tagSubclass = unsafeStatic(tagStringSubclass);
399
- const el = /** @type {FormGroup} */ (
429
+ const el =
430
+ /** @type {FormGroup} */
400
431
  await fixture(html`
401
432
  <${tagSubclass}>
402
433
  <${childTag} name="a" disabled .modelValue="${'x'}"></${childTag}>
@@ -409,8 +440,7 @@ export function runFormGroupMixinSuite(cfg = {}) {
409
440
  <${childTag} name="e" .modelValue="${'x'}"></${childTag}>
410
441
  </${tagSubclass}>
411
442
  </${tagSubclass}>
412
- `)
413
- );
443
+ `);
414
444
 
415
445
  // @ts-ignore -- we are testing a protected method here
416
446
  expect(el._getFromAllFormElements('serializedValue')).to.eql({
@@ -430,86 +460,80 @@ export function runFormGroupMixinSuite(cfg = {}) {
430
460
  disabledFieldset: {},
431
461
  });
432
462
  });
433
-
434
463
  it('does not throw if setter data of this.modelValue can not be handled', async () => {
435
- const el = /** @type {FormGroup} */ (
464
+ const el =
465
+ /** @type {FormGroup} */
436
466
  await fixture(html`
437
467
  <${tag}>
438
468
  <${childTag} name="firstName" .modelValue=${'foo'}></${childTag}>
439
469
  <${childTag} name="lastName" .modelValue=${'bar'}></${childTag}>
440
470
  </${tag}>
441
- `)
442
- );
471
+ `);
443
472
  const initState = {
444
473
  firstName: 'foo',
445
474
  lastName: 'bar',
446
475
  };
447
476
  expect(el.modelValue).to.deep.equal(initState);
448
-
449
477
  el.modelValue = undefined;
450
478
  expect(el.modelValue).to.deep.equal(initState);
451
-
452
479
  el.modelValue = null;
453
480
  expect(el.modelValue).to.deep.equal(initState);
454
481
  });
455
-
456
482
  it('disables/enables all its formElements if it becomes disabled/enabled', async () => {
457
- const el = /** @type {FormGroup} */ (
458
- await fixture(html`<${tag} disabled>${inputSlots}</${tag}>`)
459
- );
483
+ const el =
484
+ /** @type {FormGroup} */
485
+ await fixture(html`<${tag} disabled>${inputSlots}</${tag}>`);
460
486
  expect(el.formElements.color.disabled).to.be.true;
461
487
  expect(el.formElements['hobbies[]'][0].disabled).to.be.true;
462
488
  expect(el.formElements['hobbies[]'][1].disabled).to.be.true;
463
-
464
489
  el.disabled = false;
465
490
  await el.updateComplete;
466
491
  expect(el.formElements.color.disabled).to.equal(false);
467
492
  expect(el.formElements['hobbies[]'][0].disabled).to.equal(false);
468
493
  expect(el.formElements['hobbies[]'][1].disabled).to.equal(false);
469
494
  });
470
-
471
495
  it('does not propagate/override initial disabled value on nested form elements', async () => {
472
- const el = /** @type {FormGroup} */ (
496
+ const el =
497
+ /** @type {FormGroup} */
473
498
  await fixture(html`
474
499
  <${tag}>
475
500
  <${tag} name="sub" disabled>${inputSlots}</${tag}>
476
501
  </${tag}>
477
- `)
478
- );
479
-
502
+ `);
480
503
  expect(el.disabled).to.equal(false);
481
504
  expect(el.formElements.sub.disabled).to.be.true;
482
505
  expect(el.formElements.sub.formElements.color.disabled).to.be.true;
483
506
  expect(el.formElements.sub.formElements['hobbies[]'][0].disabled).to.be.true;
484
507
  expect(el.formElements.sub.formElements['hobbies[]'][1].disabled).to.be.true;
485
508
  });
486
-
487
509
  it('can set initial modelValue on creation', async () => {
488
- const el = /** @type {FormGroup} */ (
510
+ const el =
511
+ /** @type {FormGroup} */
489
512
  await fixture(html`
490
- <${tag} .modelValue=${{ lastName: 'Bar' }}>
513
+ <${tag} .modelValue=${{
514
+ lastName: 'Bar',
515
+ }}>
491
516
  <${childTag} name="lastName"></${childTag}>
492
517
  </${tag}>
493
- `)
494
- );
495
-
518
+ `);
496
519
  expect(el.modelValue).to.eql({
497
520
  lastName: 'Bar',
498
521
  });
499
522
  });
500
-
501
523
  it('can set initial serializedValue on creation', async () => {
502
- const el = /** @type {FormGroup} */ (
524
+ const el =
525
+ /** @type {FormGroup} */
503
526
  await fixture(html`
504
- <${tag} .modelValue=${{ lastName: 'Bar' }}>
527
+ <${tag} .modelValue=${{
528
+ lastName: 'Bar',
529
+ }}>
505
530
  <${childTag} name="lastName"></${childTag}>
506
531
  </${tag}>
507
- `)
508
- );
509
-
510
- expect(el.modelValue).to.eql({ lastName: 'Bar' });
532
+ `);
533
+ expect(el.modelValue).to.eql({
534
+ lastName: 'Bar',
535
+ });
511
536
  });
512
-
513
537
  describe('Validation', () => {
514
538
  it('validates on init', async () => {
515
539
  class IsCat extends Validator {
@@ -525,27 +549,24 @@ export function runFormGroupMixinSuite(cfg = {}) {
525
549
  return hasError;
526
550
  }
527
551
  }
528
-
529
- const el = /** @type {FormGroup} */ (
552
+ const el =
553
+ /** @type {FormGroup} */
530
554
  await fixture(html`
531
555
  <${tag}>
532
- <${childTag} name="color" .validators=${[
533
- new IsCat(),
534
- ]} .modelValue=${'blue'}></${childTag}>
556
+ <${childTag} name="color" .validators=${[new IsCat()]} .modelValue=${'blue'}></${childTag}>
535
557
  </${tag}>
536
- `)
537
- );
558
+ `);
538
559
  expect(el.formElements.color.validationStates.error.IsCat).to.be.true;
539
560
  });
540
-
541
561
  it('validates when a value changes', async () => {
542
- const el = /** @type {FormGroup} */ (await fixture(html`<${tag}>${inputSlots}</${tag}>`));
543
-
562
+ const el = /** @type {FormGroup} */ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
544
563
  const spy = sinon.spy(el, 'validate');
545
- el.formElements.color.modelValue = { checked: true, value: 'red' };
564
+ el.formElements.color.modelValue = {
565
+ checked: true,
566
+ value: 'red',
567
+ };
546
568
  expect(spy.callCount).to.equal(1);
547
569
  });
548
-
549
570
  it('has a special validator for all children - can be checked via this.error.FormElementsHaveNoError', async () => {
550
571
  class IsCat extends Validator {
551
572
  static get validatorName() {
@@ -560,32 +581,27 @@ export function runFormGroupMixinSuite(cfg = {}) {
560
581
  return hasError;
561
582
  }
562
583
  }
563
-
564
- const el = /** @type {FormGroup} */ (
584
+ const el =
585
+ /** @type {FormGroup} */
565
586
  await fixture(html`
566
587
  <${tag}>
567
- <${childTag} name="color" .validators=${[
568
- new IsCat(),
569
- ]} .modelValue=${'blue'}></${childTag}>
588
+ <${childTag} name="color" .validators=${[new IsCat()]} .modelValue=${'blue'}></${childTag}>
570
589
  </${tag}>
571
- `)
572
- );
573
-
590
+ `);
574
591
  expect(el.validationStates.error.FormElementsHaveNoError).to.be.true;
575
592
  expect(el.formElements.color.validationStates.error.IsCat).to.be.true;
576
593
  el.formElements.color.modelValue = 'cat';
577
594
  expect(el.validationStates.error).to.deep.equal({});
578
595
  });
579
-
580
596
  it('works with Required', async () => {
581
- const el = /** @type {FormGroup} */ (
597
+ const el =
598
+ /** @type {FormGroup} */
582
599
  await fixture(html`
583
600
  <${tag} name="myGroup" .validators="${[new Required()]}">
584
601
  <${childTag} name="fieldA"></${childTag}>
585
602
  <${childTag} name="fieldB"></${childTag}>
586
603
  </${tag}>
587
- `)
588
- );
604
+ `);
589
605
  // initially the group is invalid
590
606
  expect(el.validationStates.error.Required).to.be.true;
591
607
  el.formElements.fieldA.modelValue = 'foo';
@@ -595,15 +611,14 @@ export function runFormGroupMixinSuite(cfg = {}) {
595
611
  el.formElements.fieldA.modelValue = '';
596
612
  expect(el.validationStates.error.Required).to.be.true;
597
613
  });
598
-
599
614
  it('does not show error feedback (nor aria-invalid) for invalid children before interaction', async () => {
600
- const el = /** @type {FormGroup} */ (
615
+ const el =
616
+ /** @type {FormGroup} */
601
617
  await fixture(html`
602
618
  <${tag}>
603
619
  <${childTag} name="myField" .validators=${[new Required()]}></${childTag}>
604
620
  </${tag}>
605
- `)
606
- );
621
+ `);
607
622
  await el.updateComplete;
608
623
  await el.feedbackComplete;
609
624
 
@@ -620,7 +635,6 @@ export function runFormGroupMixinSuite(cfg = {}) {
620
635
  expect(el.showsFeedbackFor).to.deep.equal(['error']);
621
636
  expect(el.getAttribute('aria-invalid')).to.equal('true');
622
637
  });
623
-
624
638
  it('validates on children (de)registration', async () => {
625
639
  class HasEvenNumberOfChildren extends Validator {
626
640
  static get validatorName() {
@@ -635,115 +649,103 @@ export function runFormGroupMixinSuite(cfg = {}) {
635
649
  return hasError;
636
650
  }
637
651
  }
638
- const el = /** @type {FormGroup} */ (
652
+ const el =
653
+ /** @type {FormGroup} */
639
654
  await fixture(html`
640
655
  <${tag} .validators=${[new HasEvenNumberOfChildren()]}>
641
656
  <${childTag} id="c1" name="c1"></${childTag}>
642
657
  </${tag}>
643
- `)
644
- );
645
- const child2 = /** @type {FormGroup} */ (
658
+ `);
659
+ const child2 =
660
+ /** @type {FormGroup} */
646
661
  await fixture(html`
647
662
  <${childTag} name="c2"></${childTag}>
648
- `)
649
- );
663
+ `);
650
664
  expect(el.validationStates.error.HasEvenNumberOfChildren).to.be.true;
651
-
652
665
  el.appendChild(child2);
653
666
  expect(el.validationStates.error.HasEvenNumberOfChildren).to.equal(undefined);
654
-
655
667
  el.removeChild(child2);
656
668
  expect(el.validationStates.error.HasEvenNumberOfChildren).to.be.true;
657
669
 
658
670
  // Edge case: remove all children
659
- el.removeChild(/** @type {Node} */ (el.querySelector('[id=c1]')));
660
-
671
+ el.removeChild(/** @type {Node} */ el.querySelector('[id=c1]'));
661
672
  expect(el.validationStates.error.HasEvenNumberOfChildren).to.equal(undefined);
662
673
  });
663
674
  });
664
-
665
675
  describe('Interaction states', () => {
666
676
  it('has false states (dirty, touched, prefilled) on init', async () => {
667
- const fieldset = /** @type {FormGroup} */ (
668
- await fixture(html`<${tag}>${inputSlots}</${tag}>`)
669
- );
677
+ const fieldset =
678
+ /** @type {FormGroup} */
679
+ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
670
680
  expect(fieldset.dirty).to.equal(false, 'dirty');
671
681
  expect(fieldset.touched).to.equal(false, 'touched');
672
682
  expect(fieldset.prefilled).to.equal(false, 'prefilled');
673
683
  });
674
-
675
684
  it('sets dirty when value changed', async () => {
676
- const fieldset = /** @type {FormGroup} */ (
677
- await fixture(html`<${tag}>${inputSlots}</${tag}>`)
678
- );
679
- fieldset.formElements['hobbies[]'][0].modelValue = { checked: true, value: 'football' };
685
+ const fieldset =
686
+ /** @type {FormGroup} */
687
+ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
688
+ fieldset.formElements['hobbies[]'][0].modelValue = {
689
+ checked: true,
690
+ value: 'football',
691
+ };
680
692
  expect(fieldset.dirty).to.be.true;
681
693
  });
682
-
683
694
  it('sets touched when last field in fieldset left after focus', async () => {
684
- const el = /** @type {FormGroup} */ (await fixture(html`<${tag}>${inputSlots}</${tag}>`));
695
+ const el = /** @type {FormGroup} */ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
685
696
  const { _inputNode: hobbyInputNode } = getFormControlMembers(
686
697
  el.formElements['hobbies[]'][0],
687
698
  );
688
699
  const { _inputNode: genderInputNode } = getFormControlMembers(
689
700
  el.formElements['hobbies[]'][el.formElements['gender[]'].length - 1],
690
701
  );
691
-
692
702
  await triggerFocusFor(hobbyInputNode);
693
703
  await triggerFocusFor(genderInputNode);
694
- const button = /** @type {FormGroup} */ (await fixture(html`<button>Button</button>`));
704
+ const button = /** @type {FormGroup} */ await fixture(html`<button>Button</button>`);
695
705
  button.focus();
696
-
697
706
  expect(el.touched).to.be.true;
698
707
  });
699
-
700
708
  it('sets attributes [touched][dirty]', async () => {
701
- const el = /** @type {FormGroup} */ (await fixture(html`<${tag}></${tag}>`));
709
+ const el = /** @type {FormGroup} */ await fixture(html`<${tag}></${tag}>`);
702
710
  el.touched = true;
703
711
  await el.updateComplete;
704
712
  expect(el).to.have.attribute('touched');
705
-
706
713
  el.dirty = true;
707
714
  await el.updateComplete;
708
715
  expect(el).to.have.attribute('dirty');
709
716
  });
710
-
711
717
  it('becomes prefilled if all form elements are prefilled', async () => {
712
- const el = /** @type {FormGroup} */ (
718
+ const el =
719
+ /** @type {FormGroup} */
713
720
  await fixture(html`
714
721
  <${tag}>
715
722
  <${childTag} name="input1" .modelValue="${'prefilled'}"></${childTag}>
716
723
  <${childTag} name="input2"></${childTag}>
717
724
  </${tag}>
718
- `)
719
- );
725
+ `);
720
726
  expect(el.prefilled).to.be.false;
721
-
722
- const el2 = /** @type {FormGroup} */ (
727
+ const el2 =
728
+ /** @type {FormGroup} */
723
729
  await fixture(html`
724
730
  <${tag}>
725
731
  <${childTag} name="input1" .modelValue="${'prefilled'}"></${childTag}>
726
732
  <${childTag} name="input2" .modelValue="${'prefilled'}"></${childTag}>
727
733
  </${tag}>
728
- `)
729
- );
734
+ `);
730
735
  expect(el2.prefilled).to.be.true;
731
736
  });
732
-
733
737
  it(`becomes "touched" once the last element of a group becomes blurred by keyboard
734
738
  interaction (e.g. tabbing through the checkbox-group)`, async () => {
735
- const el = /** @type {FormGroup} */ (
739
+ const el =
740
+ /** @type {FormGroup} */
736
741
  await fixture(html`
737
742
  <${tag}>
738
743
  <label slot="label">My group</label>
739
744
  <${childTag} name="myGroup[]" label="Option 1" value="1"></${childTag}>
740
745
  <${childTag} name="myGroup[]" label="Option 2" value="2"></${childTag}>
741
746
  </${tag}>
742
- `)
743
- );
744
-
745
- const button = /** @type {HTMLButtonElement} */ (await fixture(`<button>Blur</button>`));
746
-
747
+ `);
748
+ const button = /** @type {HTMLButtonElement} */ await fixture(`<button>Blur</button>`);
747
749
  expect(el.touched).to.equal(false, 'initially, touched state is false');
748
750
  el.formElements[1].focus();
749
751
  expect(el.touched).to.equal(false, 'focus is on second checkbox');
@@ -753,44 +755,38 @@ export function runFormGroupMixinSuite(cfg = {}) {
753
755
  `focus is on element behind second checkbox (group has blurred)`,
754
756
  );
755
757
  });
756
-
757
758
  it(`becomes "touched" once the group as a whole becomes blurred via mouse interaction after
758
759
  keyboard interaction (e.g. focus is moved inside the group and user clicks somewhere outside
759
760
  the group)`, async () => {
760
- const el = /** @type {FormGroup} */ (
761
+ const el =
762
+ /** @type {FormGroup} */
761
763
  await fixture(html`
762
764
  <${tag}>
763
765
  <${childTag} name="input1"></${childTag}>
764
766
  <${childTag} name="input2"></${childTag}>
765
767
  </${tag}>
766
- `)
767
- );
768
- const el2 = /** @type {FormGroup} */ (
768
+ `);
769
+ const el2 =
770
+ /** @type {FormGroup} */
769
771
  await fixture(html`
770
772
  <${tag}>
771
773
  <${childTag} name="input1"></${childTag}>
772
774
  <${childTag} name="input2"></${childTag}>
773
775
  </${tag}>
774
- `)
775
- );
776
-
777
- const outside = /** @type {HTMLButtonElement} */ (
778
- await fixture(html`<button>outside</button>`)
779
- );
780
-
776
+ `);
777
+ const outside =
778
+ /** @type {HTMLButtonElement} */
779
+ await fixture(html`<button>outside</button>`);
781
780
  outside.click();
782
781
  expect(el.touched, 'unfocused fieldset should stay untouched').to.be.false;
783
-
784
782
  el.formElements[0].focus();
785
783
  el.formElements[1].focus();
786
784
  expect(el.touched).to.be.false;
787
-
788
785
  outside.click(); // blur the group via a click
789
786
  outside.focus(); // a real mouse click moves focus as well
790
787
  expect(el.touched).to.be.true;
791
788
  expect(el2.touched).to.be.false;
792
789
  });
793
-
794
790
  it('potentially shows fieldset error message on interaction change', async () => {
795
791
  class Input1IsTen extends Validator {
796
792
  static get validatorName() {
@@ -805,27 +801,24 @@ export function runFormGroupMixinSuite(cfg = {}) {
805
801
  return hasError;
806
802
  }
807
803
  }
808
-
809
- const outSideButton = /** @type {FormGroup} */ (
810
- await fixture(html`<button>outside</button>`)
811
- );
812
- const el = /** @type {FormGroup} */ (
804
+ const outSideButton =
805
+ /** @type {FormGroup} */
806
+ await fixture(html`<button>outside</button>`);
807
+ const el =
808
+ /** @type {FormGroup} */
813
809
  await fixture(html`
814
810
  <${tag} .validators=${[new Input1IsTen()]}>
815
811
  <${childTag} name="input1" .validators=${[new IsNumber()]}></${childTag}>
816
812
  </${tag}>
817
- `)
818
- );
819
- const input1 = /** @type {FormChild} */ (el.querySelector('[name=input1]'));
813
+ `);
814
+ const input1 = /** @type {FormChild} */ el.querySelector('[name=input1]');
820
815
  input1.modelValue = 2;
821
816
  input1.focus();
822
817
  outSideButton.focus();
823
-
824
818
  await el.updateComplete;
825
819
  expect(el.validationStates.error.Input1IsTen).to.be.true;
826
820
  expect(el.showsFeedbackFor).to.deep.equal(['error']);
827
821
  });
828
-
829
822
  it('show error if tabbing "out" of last ', async () => {
830
823
  class Input1IsTen extends Validator {
831
824
  static get validatorName() {
@@ -838,46 +831,48 @@ export function runFormGroupMixinSuite(cfg = {}) {
838
831
  return hasError;
839
832
  }
840
833
  }
841
- const outSideButton = /** @type {FormGroup} */ (
842
- await fixture(html`<button>outside</button>`)
843
- );
844
- const el = /** @type {FormGroup} */ (
834
+ const outSideButton =
835
+ /** @type {FormGroup} */
836
+ await fixture(html`<button>outside</button>`);
837
+ const el =
838
+ /** @type {FormGroup} */
845
839
  await fixture(html`
846
840
  <${tag} .validators=${[new Input1IsTen()]}>
847
841
  <${childTag} name="input1" .validators=${[new IsNumber()]}></${childTag}>
848
842
  <${childTag} name="input2" .validators=${[new IsNumber()]}></${childTag}>
849
843
  </${tag}>
850
- `)
851
- );
852
- const inputs = /** @type {FormChild[]} */ (Array.from(el.querySelectorAll(childTagString)));
844
+ `);
845
+ const inputs = /** @type {FormChild[]} */ Array.from(el.querySelectorAll(childTagString));
853
846
  inputs[1].modelValue = 2; // make it dirty
854
847
  inputs[1].focus();
855
-
856
848
  outSideButton.focus();
857
-
858
849
  expect(el.validationStates.error.Input1IsTen).to.be.true;
859
850
  expect(el.hasFeedbackFor).to.deep.equal(['error']);
860
851
  });
861
-
862
852
  it('does not become dirty when elements are prefilled', async () => {
863
- const el = /** @type {FormGroup} */ (
853
+ const el =
854
+ /** @type {FormGroup} */
864
855
  await fixture(html`
865
- <${tag} .serializedValue="${{ input1: 'x', input2: 'y' }}">
856
+ <${tag} .serializedValue="${{
857
+ input1: 'x',
858
+ input2: 'y',
859
+ }}">
866
860
  <${childTag} name="input1" ></${childTag}>
867
861
  <${childTag} name="input2"></${childTag}>
868
862
  </${tag}>
869
- `)
870
- );
863
+ `);
871
864
  expect(el.dirty).to.be.false;
872
-
873
- const el2 = /** @type {FormGroup} */ (
865
+ const el2 =
866
+ /** @type {FormGroup} */
874
867
  await fixture(html`
875
- <${tag} .modelValue="${{ input1: 'x', input2: 'y' }}">
868
+ <${tag} .modelValue="${{
869
+ input1: 'x',
870
+ input2: 'y',
871
+ }}">
876
872
  <${childTag} name="input1" ></${childTag}>
877
873
  <${childTag} name="input2"></${childTag}>
878
874
  </${tag}>
879
- `)
880
- );
875
+ `);
881
876
  expect(el2.dirty).to.be.false;
882
877
  });
883
878
  });
@@ -885,75 +880,149 @@ export function runFormGroupMixinSuite(cfg = {}) {
885
880
  // TODO: this should be tested in FormGroupMixin
886
881
  describe('serializedValue', () => {
887
882
  it('use form elements serializedValue', async () => {
888
- const fieldset = /** @type {FormGroup} */ (
889
- await fixture(html`<${tag}>${inputSlots}</${tag}>`)
890
- );
891
- fieldset.formElements['hobbies[]'][0].serializer = /** @param {any} v */ v =>
883
+ const fieldset =
884
+ /** @type {FormGroup} */
885
+ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
886
+ fieldset.formElements['hobbies[]'][0].serializer = /** @param {any} v */ (v) =>
892
887
  `${v.value}-serialized`;
893
- fieldset.formElements['hobbies[]'][0].modelValue = { checked: false, value: 'Bar' };
894
- fieldset.formElements['hobbies[]'][1].modelValue = { checked: false, value: 'rugby' };
895
- fieldset.formElements['gender[]'][0].modelValue = { checked: false, value: 'male' };
896
- fieldset.formElements['gender[]'][1].modelValue = { checked: false, value: 'female' };
897
- fieldset.formElements.color.modelValue = { checked: false, value: 'blue' };
888
+ fieldset.formElements['hobbies[]'][0].modelValue = {
889
+ checked: false,
890
+ value: 'Bar',
891
+ };
892
+ fieldset.formElements['hobbies[]'][1].modelValue = {
893
+ checked: false,
894
+ value: 'rugby',
895
+ };
896
+ fieldset.formElements['gender[]'][0].modelValue = {
897
+ checked: false,
898
+ value: 'male',
899
+ };
900
+ fieldset.formElements['gender[]'][1].modelValue = {
901
+ checked: false,
902
+ value: 'female',
903
+ };
904
+ fieldset.formElements.color.modelValue = {
905
+ checked: false,
906
+ value: 'blue',
907
+ };
898
908
  expect(fieldset.formElements['hobbies[]'][0].serializedValue).to.equal('Bar-serialized');
899
909
  expect(fieldset.serializedValue).to.deep.equal({
900
- 'hobbies[]': ['Bar-serialized', { checked: false, value: 'rugby' }],
910
+ 'hobbies[]': [
911
+ 'Bar-serialized',
912
+ {
913
+ checked: false,
914
+ value: 'rugby',
915
+ },
916
+ ],
901
917
  'gender[]': [
902
- { checked: false, value: 'male' },
903
- { checked: false, value: 'female' },
918
+ {
919
+ checked: false,
920
+ value: 'male',
921
+ },
922
+ {
923
+ checked: false,
924
+ value: 'female',
925
+ },
904
926
  ],
905
- color: { checked: false, value: 'blue' },
927
+ color: {
928
+ checked: false,
929
+ value: 'blue',
930
+ },
906
931
  });
907
932
  });
908
-
909
933
  it('treats names with ending [] as arrays', async () => {
910
- const fieldset = /** @type {FormGroup} */ (
911
- await fixture(html`<${tag}>${inputSlots}</${tag}>`)
912
- );
913
- fieldset.formElements['hobbies[]'][0].modelValue = { checked: false, value: 'chess' };
914
- fieldset.formElements['hobbies[]'][1].modelValue = { checked: false, value: 'rugby' };
915
- fieldset.formElements['gender[]'][0].modelValue = { checked: false, value: 'male' };
916
- fieldset.formElements['gender[]'][1].modelValue = { checked: false, value: 'female' };
917
- fieldset.formElements.color.modelValue = { checked: false, value: 'blue' };
934
+ const fieldset =
935
+ /** @type {FormGroup} */
936
+ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
937
+ fieldset.formElements['hobbies[]'][0].modelValue = {
938
+ checked: false,
939
+ value: 'chess',
940
+ };
941
+ fieldset.formElements['hobbies[]'][1].modelValue = {
942
+ checked: false,
943
+ value: 'rugby',
944
+ };
945
+ fieldset.formElements['gender[]'][0].modelValue = {
946
+ checked: false,
947
+ value: 'male',
948
+ };
949
+ fieldset.formElements['gender[]'][1].modelValue = {
950
+ checked: false,
951
+ value: 'female',
952
+ };
953
+ fieldset.formElements.color.modelValue = {
954
+ checked: false,
955
+ value: 'blue',
956
+ };
918
957
  expect(fieldset.serializedValue).to.deep.equal({
919
958
  'hobbies[]': [
920
- { checked: false, value: 'chess' },
921
- { checked: false, value: 'rugby' },
959
+ {
960
+ checked: false,
961
+ value: 'chess',
962
+ },
963
+ {
964
+ checked: false,
965
+ value: 'rugby',
966
+ },
922
967
  ],
923
968
  'gender[]': [
924
- { checked: false, value: 'male' },
925
- { checked: false, value: 'female' },
969
+ {
970
+ checked: false,
971
+ value: 'male',
972
+ },
973
+ {
974
+ checked: false,
975
+ value: 'female',
976
+ },
926
977
  ],
927
- color: { checked: false, value: 'blue' },
978
+ color: {
979
+ checked: false,
980
+ value: 'blue',
981
+ },
928
982
  });
929
983
  });
930
-
931
984
  it('0 is a valid value to be serialized', async () => {
932
- const fieldset = /** @type {FormGroup} */ (
985
+ const fieldset =
986
+ /** @type {FormGroup} */
933
987
  await fixture(html`
934
988
  <${tag}>
935
989
  <${childTag} name="price"></${childTag}>
936
- </${tag}>`)
937
- );
990
+ </${tag}>`);
938
991
  fieldset.formElements.price.modelValue = 0;
939
- expect(fieldset.serializedValue).to.deep.equal({ price: 0 });
992
+ expect(fieldset.serializedValue).to.deep.equal({
993
+ price: 0,
994
+ });
940
995
  });
941
-
942
996
  it('allows for nested fieldsets', async () => {
943
- const fieldset = /** @type {FormGroup} */ (
997
+ const fieldset =
998
+ /** @type {FormGroup} */
944
999
  await fixture(html`
945
1000
  <${tag} name="userData">
946
1001
  <${childTag} name="comment"></${childTag}>
947
1002
  <${tag} name="newfieldset">${inputSlots}</${tag}>
948
1003
  </${tag}>
949
- `)
950
- );
951
- const newFieldset = /** @type {FormGroup} */ (fieldset.querySelector(tagString));
952
- newFieldset.formElements['hobbies[]'][0].modelValue = { checked: false, value: 'chess' };
953
- newFieldset.formElements['hobbies[]'][1].modelValue = { checked: false, value: 'rugby' };
954
- newFieldset.formElements['gender[]'][0].modelValue = { checked: false, value: 'male' };
955
- newFieldset.formElements['gender[]'][1].modelValue = { checked: false, value: 'female' };
956
- newFieldset.formElements.color.modelValue = { checked: false, value: 'blue' };
1004
+ `);
1005
+ const newFieldset = /** @type {FormGroup} */ fieldset.querySelector(tagString);
1006
+ newFieldset.formElements['hobbies[]'][0].modelValue = {
1007
+ checked: false,
1008
+ value: 'chess',
1009
+ };
1010
+ newFieldset.formElements['hobbies[]'][1].modelValue = {
1011
+ checked: false,
1012
+ value: 'rugby',
1013
+ };
1014
+ newFieldset.formElements['gender[]'][0].modelValue = {
1015
+ checked: false,
1016
+ value: 'male',
1017
+ };
1018
+ newFieldset.formElements['gender[]'][1].modelValue = {
1019
+ checked: false,
1020
+ value: 'female',
1021
+ };
1022
+ newFieldset.formElements.color.modelValue = {
1023
+ checked: false,
1024
+ value: 'blue',
1025
+ };
957
1026
  fieldset.formElements.comment.modelValue = 'Foo';
958
1027
  // @ts-ignore
959
1028
  expect(fieldset.formElements._keys().length).to.equal(2);
@@ -963,93 +1032,143 @@ export function runFormGroupMixinSuite(cfg = {}) {
963
1032
  comment: 'Foo',
964
1033
  newfieldset: {
965
1034
  'hobbies[]': [
966
- { checked: false, value: 'chess' },
967
- { checked: false, value: 'rugby' },
1035
+ {
1036
+ checked: false,
1037
+ value: 'chess',
1038
+ },
1039
+ {
1040
+ checked: false,
1041
+ value: 'rugby',
1042
+ },
968
1043
  ],
969
1044
  'gender[]': [
970
- { checked: false, value: 'male' },
971
- { checked: false, value: 'female' },
1045
+ {
1046
+ checked: false,
1047
+ value: 'male',
1048
+ },
1049
+ {
1050
+ checked: false,
1051
+ value: 'female',
1052
+ },
972
1053
  ],
973
- color: { checked: false, value: 'blue' },
1054
+ color: {
1055
+ checked: false,
1056
+ value: 'blue',
1057
+ },
974
1058
  },
975
1059
  });
976
1060
  });
977
-
978
1061
  it('does not serialize disabled values', async () => {
979
- const fieldset = /** @type {FormGroup} */ (
1062
+ const fieldset =
1063
+ /** @type {FormGroup} */
980
1064
  await fixture(html`
981
1065
  <${tag}>
982
1066
  <${childTag} name="custom[]"></${childTag}>
983
1067
  <${childTag} name="custom[]"></${childTag}>
984
1068
  </${tag}>
985
- `)
986
- );
1069
+ `);
987
1070
  fieldset.formElements['custom[]'][0].modelValue = 'custom 1';
988
1071
  fieldset.formElements['custom[]'][1].disabled = true;
989
-
990
1072
  expect(fieldset.serializedValue).to.deep.equal({
991
1073
  'custom[]': ['custom 1'],
992
1074
  });
993
1075
  });
994
-
995
1076
  it('will exclude form elements within a disabled fieldset', async () => {
996
- const fieldset = /** @type {FormGroup} */ (
1077
+ const fieldset =
1078
+ /** @type {FormGroup} */
997
1079
  await fixture(html`
998
1080
  <${tag} name="userData">
999
1081
  <${childTag} name="comment"></${childTag}>
1000
1082
  <${tag} name="newfieldset">${inputSlots}</${tag}>
1001
1083
  </${tag}>
1002
- `)
1003
- );
1004
-
1005
- const newFieldset = /** @type {FormGroup} */ (fieldset.querySelector(tagString));
1084
+ `);
1085
+ const newFieldset = /** @type {FormGroup} */ fieldset.querySelector(tagString);
1006
1086
  fieldset.formElements.comment.modelValue = 'Foo';
1007
- newFieldset.formElements['hobbies[]'][0].modelValue = { checked: false, value: 'chess' };
1008
- newFieldset.formElements['hobbies[]'][1].modelValue = { checked: false, value: 'rugby' };
1009
- newFieldset.formElements['gender[]'][0].modelValue = { checked: false, value: 'male' };
1010
- newFieldset.formElements['gender[]'][1].modelValue = { checked: false, value: 'female' };
1011
- newFieldset.formElements.color.modelValue = { checked: false, value: 'blue' };
1087
+ newFieldset.formElements['hobbies[]'][0].modelValue = {
1088
+ checked: false,
1089
+ value: 'chess',
1090
+ };
1091
+ newFieldset.formElements['hobbies[]'][1].modelValue = {
1092
+ checked: false,
1093
+ value: 'rugby',
1094
+ };
1095
+ newFieldset.formElements['gender[]'][0].modelValue = {
1096
+ checked: false,
1097
+ value: 'male',
1098
+ };
1099
+ newFieldset.formElements['gender[]'][1].modelValue = {
1100
+ checked: false,
1101
+ value: 'female',
1102
+ };
1103
+ newFieldset.formElements.color.modelValue = {
1104
+ checked: false,
1105
+ value: 'blue',
1106
+ };
1012
1107
  newFieldset.formElements.color.disabled = true;
1013
-
1014
1108
  expect(fieldset.serializedValue).to.deep.equal({
1015
1109
  comment: 'Foo',
1016
1110
  newfieldset: {
1017
1111
  'hobbies[]': [
1018
- { checked: false, value: 'chess' },
1019
- { checked: false, value: 'rugby' },
1112
+ {
1113
+ checked: false,
1114
+ value: 'chess',
1115
+ },
1116
+ {
1117
+ checked: false,
1118
+ value: 'rugby',
1119
+ },
1020
1120
  ],
1021
1121
  'gender[]': [
1022
- { checked: false, value: 'male' },
1023
- { checked: false, value: 'female' },
1122
+ {
1123
+ checked: false,
1124
+ value: 'male',
1125
+ },
1126
+ {
1127
+ checked: false,
1128
+ value: 'female',
1129
+ },
1024
1130
  ],
1025
1131
  },
1026
1132
  });
1027
-
1028
1133
  newFieldset.formElements.color.disabled = false;
1029
1134
  expect(fieldset.serializedValue).to.deep.equal({
1030
1135
  comment: 'Foo',
1031
1136
  newfieldset: {
1032
1137
  'hobbies[]': [
1033
- { checked: false, value: 'chess' },
1034
- { checked: false, value: 'rugby' },
1138
+ {
1139
+ checked: false,
1140
+ value: 'chess',
1141
+ },
1142
+ {
1143
+ checked: false,
1144
+ value: 'rugby',
1145
+ },
1035
1146
  ],
1036
1147
  'gender[]': [
1037
- { checked: false, value: 'male' },
1038
- { checked: false, value: 'female' },
1148
+ {
1149
+ checked: false,
1150
+ value: 'male',
1151
+ },
1152
+ {
1153
+ checked: false,
1154
+ value: 'female',
1155
+ },
1039
1156
  ],
1040
- color: { checked: false, value: 'blue' },
1157
+ color: {
1158
+ checked: false,
1159
+ value: 'blue',
1160
+ },
1041
1161
  },
1042
1162
  });
1043
1163
  });
1044
-
1045
1164
  it('updates the formElements keys when a name attribute changes', async () => {
1046
- const fieldset = /** @type {FormGroup} */ (
1165
+ const fieldset =
1166
+ /** @type {FormGroup} */
1047
1167
  await fixture(html`
1048
1168
  <${tag}>
1049
1169
  <${childTag} name="foo" .modelValue=${'qux'}></${childTag}>
1050
1170
  </${tag}>
1051
- `)
1052
- );
1171
+ `);
1053
1172
  expect(fieldset.serializedValue.foo).to.equal('qux');
1054
1173
  fieldset.formElements[0].name = 'bar';
1055
1174
  await fieldset.updateComplete;
@@ -1057,83 +1176,94 @@ export function runFormGroupMixinSuite(cfg = {}) {
1057
1176
  expect(fieldset.serializedValue.bar).to.equal('qux');
1058
1177
  });
1059
1178
  });
1060
-
1061
1179
  describe('Reset', () => {
1062
1180
  it('restores default values if changes were made', async () => {
1063
- const el = /** @type {FormGroup} */ (
1181
+ const el =
1182
+ /** @type {FormGroup} */
1064
1183
  await fixture(html`
1065
1184
  <${tag}>
1066
1185
  <${childTag} id="firstName" name="firstName" .modelValue="${'Foo'}"></${childTag}>
1067
1186
  </${tag}>
1068
- `)
1069
- );
1070
- await /** @type {FormChild} */ (el.querySelector(childTagString)).updateComplete;
1071
-
1072
- const input = /** @type {FormChild} */ (el.querySelector('#firstName'));
1073
-
1187
+ `);
1188
+ await /** @type {FormChild} */ el.querySelector(childTagString).updateComplete;
1189
+ const input = /** @type {FormChild} */ el.querySelector('#firstName');
1074
1190
  input.modelValue = 'Bar';
1075
- expect(el.modelValue).to.deep.equal({ firstName: 'Bar' });
1191
+ expect(el.modelValue).to.deep.equal({
1192
+ firstName: 'Bar',
1193
+ });
1076
1194
  expect(input.modelValue).to.equal('Bar');
1077
-
1078
1195
  el.resetGroup();
1079
- expect(el.modelValue).to.deep.equal({ firstName: 'Foo' });
1196
+ expect(el.modelValue).to.deep.equal({
1197
+ firstName: 'Foo',
1198
+ });
1080
1199
  expect(input.modelValue).to.equal('Foo');
1081
1200
  });
1082
-
1083
1201
  it('restores default values of arrays if changes were made', async () => {
1084
- const el = /** @type {FormGroup} */ (
1202
+ const el =
1203
+ /** @type {FormGroup} */
1085
1204
  await fixture(html`
1086
1205
  <${tag}>
1087
1206
  <${childTag} id="firstName" name="firstName[]" .modelValue="${'Foo'}"></${childTag}>
1088
1207
  </${tag}>
1089
- `)
1090
- );
1091
- await /** @type {FormChild} */ (el.querySelector(childTagString)).updateComplete;
1092
-
1093
- const input = /** @type {FormChild} */ (el.querySelector('#firstName'));
1094
-
1208
+ `);
1209
+ await /** @type {FormChild} */ el.querySelector(childTagString).updateComplete;
1210
+ const input = /** @type {FormChild} */ el.querySelector('#firstName');
1095
1211
  input.modelValue = 'Bar';
1096
- expect(el.modelValue).to.deep.equal({ 'firstName[]': ['Bar'] });
1212
+ expect(el.modelValue).to.deep.equal({
1213
+ 'firstName[]': ['Bar'],
1214
+ });
1097
1215
  expect(input.modelValue).to.equal('Bar');
1098
-
1099
1216
  el.resetGroup();
1100
- expect(el.modelValue).to.deep.equal({ 'firstName[]': ['Foo'] });
1217
+ expect(el.modelValue).to.deep.equal({
1218
+ 'firstName[]': ['Foo'],
1219
+ });
1101
1220
  expect(input.modelValue).to.equal('Foo');
1102
1221
  });
1103
-
1104
1222
  it('restores default values of a nested fieldset if changes were made', async () => {
1105
- const el = /** @type {FormGroup} */ (
1223
+ const el =
1224
+ /** @type {FormGroup} */
1106
1225
  await fixture(html`
1107
1226
  <${tag}>
1108
1227
  <${tag} id="name" name="name[]">
1109
1228
  <${childTag} id="firstName" name="firstName" .modelValue="${'Foo'}"></${childTag}>
1110
1229
  </${tag}>
1111
1230
  </${tag}>
1112
- `)
1113
- );
1231
+ `);
1114
1232
  await Promise.all([
1115
- /** @type {FormChild} */ (el.querySelector(tagString)).updateComplete,
1116
- /** @type {FormChild} */ (el.querySelector(childTagString)).updateComplete,
1233
+ /** @type {FormChild} */ el.querySelector(tagString).updateComplete,
1234
+ /** @type {FormChild} */ el.querySelector(childTagString).updateComplete,
1117
1235
  ]);
1118
-
1119
- const input = /** @type {FormChild} */ (el.querySelector('#firstName'));
1120
- const nestedFieldset = /** @type {FormGroup} */ (el.querySelector('#name'));
1121
-
1236
+ const input = /** @type {FormChild} */ el.querySelector('#firstName');
1237
+ const nestedFieldset = /** @type {FormGroup} */ el.querySelector('#name');
1122
1238
  input.modelValue = 'Bar';
1123
- expect(el.modelValue).to.deep.equal({ 'name[]': [{ firstName: 'Bar' }] });
1124
- expect(nestedFieldset.modelValue).to.deep.equal({ firstName: 'Bar' });
1239
+ expect(el.modelValue).to.deep.equal({
1240
+ 'name[]': [
1241
+ {
1242
+ firstName: 'Bar',
1243
+ },
1244
+ ],
1245
+ });
1246
+ expect(nestedFieldset.modelValue).to.deep.equal({
1247
+ firstName: 'Bar',
1248
+ });
1125
1249
  expect(input.modelValue).to.equal('Bar');
1126
-
1127
1250
  el.resetGroup();
1128
- expect(el.modelValue).to.deep.equal({ 'name[]': [{ firstName: 'Foo' }] });
1129
- expect(nestedFieldset.modelValue).to.deep.equal({ firstName: 'Foo' });
1251
+ expect(el.modelValue).to.deep.equal({
1252
+ 'name[]': [
1253
+ {
1254
+ firstName: 'Foo',
1255
+ },
1256
+ ],
1257
+ });
1258
+ expect(nestedFieldset.modelValue).to.deep.equal({
1259
+ firstName: 'Foo',
1260
+ });
1130
1261
  expect(input.modelValue).to.equal('Foo');
1131
1262
  });
1132
-
1133
1263
  it('clears interaction state', async () => {
1134
- const el = /** @type {FormGroup} */ (
1135
- await fixture(html`<${tag} touched dirty>${inputSlots}</${tag}>`)
1136
- );
1264
+ const el =
1265
+ /** @type {FormGroup} */
1266
+ await fixture(html`<${tag} touched dirty>${inputSlots}</${tag}>`);
1137
1267
  // Safety check initially
1138
1268
  // @ts-ignore [allow-protected] in test
1139
1269
  el._setValueForAllFormElements('prefilled', true);
@@ -1151,26 +1281,26 @@ export function runFormGroupMixinSuite(cfg = {}) {
1151
1281
 
1152
1282
  // Reset all children states with prefilled true
1153
1283
  // @ts-ignore [allow-protected] in test
1154
- el._setValueForAllFormElements('modelValue', { checked: true }); // not prefilled
1284
+ el._setValueForAllFormElements('modelValue', {
1285
+ checked: true,
1286
+ }); // not prefilled
1155
1287
  el.resetInteractionState();
1156
1288
  expect(el.dirty).to.equal(false, 'not "dirty" after 2nd reset');
1157
1289
  expect(el.touched).to.equal(false, 'not "touched" after 2nd reset');
1158
1290
  // prefilled state is dependant on value
1159
1291
  expect(el.prefilled).to.equal(true, '"prefilled" after 2nd reset');
1160
1292
  });
1161
-
1162
1293
  it('clears submitted state', async () => {
1163
- const fieldset = /** @type {FormGroup} */ (
1164
- await fixture(html`<${tag}>${inputSlots}</${tag}>`)
1165
- );
1294
+ const fieldset =
1295
+ /** @type {FormGroup} */
1296
+ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
1166
1297
  fieldset.submitted = true;
1167
1298
  fieldset.resetGroup();
1168
1299
  expect(fieldset.submitted).to.equal(false);
1169
- fieldset.formElements.forEach(el => {
1300
+ fieldset.formElements.forEach((el) => {
1170
1301
  expect(el.submitted).to.equal(false);
1171
1302
  });
1172
1303
  });
1173
-
1174
1304
  it('has correct validation afterwards', async () => {
1175
1305
  class IsCat extends Validator {
1176
1306
  static validatorName = 'IsCat';
@@ -1197,35 +1327,31 @@ export function runFormGroupMixinSuite(cfg = {}) {
1197
1327
  return hasError;
1198
1328
  }
1199
1329
  }
1200
-
1201
- const el = /** @type {FormGroup} */ (
1330
+ const el =
1331
+ /** @type {FormGroup} */
1202
1332
  await fixture(html`
1203
1333
  <${tag} .validators=${[new ColorContainsA()]}>
1204
1334
  <${childTag} name="color" .validators=${[new IsCat()]}></${childTag}>
1205
1335
  <${childTag} name="color2"></${childTag}>
1206
1336
  </${tag}>
1207
- `)
1208
- );
1337
+ `);
1209
1338
  expect(el.hasFeedbackFor).to.deep.equal(['error']);
1210
1339
  expect(el.validationStates.error.ColorContainsA).to.be.true;
1211
1340
  expect(el.formElements.color.hasFeedbackFor).to.deep.equal([]);
1212
-
1213
1341
  el.formElements.color.modelValue = 'onlyb';
1214
1342
  expect(el.hasFeedbackFor).to.deep.equal(['error']);
1215
1343
  expect(el.validationStates.error.ColorContainsA).to.be.true;
1216
1344
  expect(el.formElements.color.validationStates.error.IsCat).to.be.true;
1217
-
1218
1345
  el.formElements.color.modelValue = 'cat';
1219
1346
  expect(el.hasFeedbackFor).to.deep.equal([]);
1220
-
1221
1347
  el.resetGroup();
1222
1348
  expect(el.hasFeedbackFor).to.deep.equal(['error']);
1223
1349
  expect(el.validationStates.error.ColorContainsA).to.be.true;
1224
1350
  expect(el.formElements.color.hasFeedbackFor).to.deep.equal([]);
1225
1351
  });
1226
-
1227
1352
  it('has access to `_initialModelValue` based on initial children states', async () => {
1228
- const el = /** @type {FormGroup} */ (
1353
+ const el =
1354
+ /** @type {FormGroup} */
1229
1355
  await fixture(html`
1230
1356
  <${tag}>
1231
1357
  <${childTag} name="child[]" .modelValue="${'foo1'}">
@@ -1233,38 +1359,36 @@ export function runFormGroupMixinSuite(cfg = {}) {
1233
1359
  <${childTag} name="child[]" .modelValue="${'bar1'}">
1234
1360
  </${childTag}>
1235
1361
  </${tag}>
1236
- `)
1237
- );
1362
+ `);
1238
1363
  await el.updateComplete;
1239
1364
  el.modelValue['child[]'] = ['foo2', 'bar2'];
1240
1365
  // @ts-ignore [allow-protected] in test
1241
1366
  expect(el._initialModelValue['child[]']).to.eql(['foo1', 'bar1']);
1242
1367
  });
1243
-
1244
1368
  it('does not wrongly recompute `_initialModelValue` after dynamic changes of children', async () => {
1245
- const el = /** @type {FormGroup} */ (
1369
+ const el =
1370
+ /** @type {FormGroup} */
1246
1371
  await fixture(html`
1247
1372
  <${tag}>
1248
1373
  <${childTag} name="child[]" .modelValue="${'foo1'}">
1249
1374
  </${childTag}>
1250
1375
  </${tag}>
1251
- `)
1252
- );
1376
+ `);
1253
1377
  el.modelValue['child[]'] = ['foo2'];
1254
- const childEl = /** @type {FormGroup} */ (
1378
+ const childEl =
1379
+ /** @type {FormGroup} */
1255
1380
  await fixture(html`
1256
1381
  <${childTag} name="child[]" .modelValue="${'bar1'}">
1257
1382
  </${childTag}>
1258
- `)
1259
- );
1383
+ `);
1260
1384
  el.appendChild(childEl);
1261
1385
  // @ts-ignore [allow-protected] in test
1262
1386
  expect(el._initialModelValue['child[]']).to.eql(['foo1', 'bar1']);
1263
1387
  });
1264
-
1265
1388
  describe('resetGroup method', () => {
1266
1389
  it('calls resetGroup on children fieldsets', async () => {
1267
- const el = /** @type {FormGroup} */ (
1390
+ const el =
1391
+ /** @type {FormGroup} */
1268
1392
  await fixture(html`
1269
1393
  <${tag} name="parentFieldset">
1270
1394
  <${tag} name="childFieldset">
@@ -1272,16 +1396,15 @@ export function runFormGroupMixinSuite(cfg = {}) {
1272
1396
  </${childTag}>
1273
1397
  </${tag}>
1274
1398
  </${tag}>
1275
- `)
1276
- );
1277
- const childFieldsetEl = /** @type {FormGroup} */ (el.querySelector(tagString));
1399
+ `);
1400
+ const childFieldsetEl = /** @type {FormGroup} */ el.querySelector(tagString);
1278
1401
  const resetGroupSpy = sinon.spy(childFieldsetEl, 'resetGroup');
1279
1402
  el.resetGroup();
1280
1403
  expect(resetGroupSpy.callCount).to.equal(1);
1281
1404
  });
1282
-
1283
1405
  it('calls reset on children fields', async () => {
1284
- const el = /** @type {FormGroup} */ (
1406
+ const el =
1407
+ /** @type {FormGroup} */
1285
1408
  await fixture(html`
1286
1409
  <${tag} name="parentFieldset">
1287
1410
  <${tag} name="childFieldset">
@@ -1289,18 +1412,17 @@ export function runFormGroupMixinSuite(cfg = {}) {
1289
1412
  </${childTag}>
1290
1413
  </${tag}>
1291
1414
  </${tag}>
1292
- `)
1293
- );
1294
- const childFieldsetEl = /** @type {FormChild} */ (el.querySelector(childTagString));
1415
+ `);
1416
+ const childFieldsetEl = /** @type {FormChild} */ el.querySelector(childTagString);
1295
1417
  const resetSpy = sinon.spy(childFieldsetEl, 'reset');
1296
1418
  el.resetGroup();
1297
1419
  expect(resetSpy.callCount).to.equal(1);
1298
1420
  });
1299
1421
  });
1300
-
1301
1422
  describe('clearGroup method', () => {
1302
1423
  it('calls clearGroup on children fieldset', async () => {
1303
- const el = /** @type {FormGroup} */ (
1424
+ const el =
1425
+ /** @type {FormGroup} */
1304
1426
  await fixture(html`
1305
1427
  <${tag} name="parentFieldset">
1306
1428
  <${tag} name="childFieldset">
@@ -1308,16 +1430,15 @@ export function runFormGroupMixinSuite(cfg = {}) {
1308
1430
  </${childTag}>
1309
1431
  </${tag}>
1310
1432
  </${tag}>
1311
- `)
1312
- );
1313
- const childFieldsetEl = /** @type {FormGroup} */ (el.querySelector(tagString));
1433
+ `);
1434
+ const childFieldsetEl = /** @type {FormGroup} */ el.querySelector(tagString);
1314
1435
  const clearGroupSpy = sinon.spy(childFieldsetEl, 'clearGroup');
1315
1436
  el.clearGroup();
1316
1437
  expect(clearGroupSpy.callCount).to.equal(1);
1317
1438
  });
1318
-
1319
1439
  it('calls clear on children fields', async () => {
1320
- const el = /** @type {FormGroup} */ (
1440
+ const el =
1441
+ /** @type {FormGroup} */
1321
1442
  await fixture(html`
1322
1443
  <${tag} name="parentFieldset">
1323
1444
  <${tag} name="childFieldset">
@@ -1325,16 +1446,15 @@ export function runFormGroupMixinSuite(cfg = {}) {
1325
1446
  </${childTag}>
1326
1447
  </${tag}>
1327
1448
  </${tag}>
1328
- `)
1329
- );
1330
- const childFieldsetEl = /** @type {FormChild} */ (el.querySelector(childTagString));
1449
+ `);
1450
+ const childFieldsetEl = /** @type {FormChild} */ el.querySelector(childTagString);
1331
1451
  const clearSpy = sinon.spy(childFieldsetEl, 'clear');
1332
1452
  el.clearGroup();
1333
1453
  expect(clearSpy.callCount).to.equal(1);
1334
1454
  });
1335
-
1336
1455
  it('should clear the value of fields', async () => {
1337
- const el = /** @type {FormGroup} */ (
1456
+ const el =
1457
+ /** @type {FormGroup} */
1338
1458
  await fixture(html`
1339
1459
  <${tag} name="parentFieldset">
1340
1460
  <${tag} name="childFieldset">
@@ -1342,73 +1462,84 @@ export function runFormGroupMixinSuite(cfg = {}) {
1342
1462
  </${childTag}>
1343
1463
  </${tag}>
1344
1464
  </${tag}>
1345
- `)
1346
- );
1465
+ `);
1347
1466
  el.clearGroup();
1348
- expect(
1349
- /** @type {FormChild} */ (el.querySelector('[name="child"]')).modelValue,
1350
- ).to.equal('');
1467
+ expect(/** @type {FormChild} */ el.querySelector('[name="child"]').modelValue).to.equal(
1468
+ '',
1469
+ );
1351
1470
  });
1352
1471
  });
1353
1472
  });
1354
-
1355
1473
  describe('Accessibility', () => {
1356
1474
  it('has role="group" set', async () => {
1357
- const fieldset = /** @type {FormGroup} */ (
1358
- await fixture(html`<${tag}>${inputSlots}</${tag}>`)
1359
- );
1360
- fieldset.formElements['hobbies[]'][0].modelValue = { checked: false, value: 'chess' };
1361
- fieldset.formElements['hobbies[]'][1].modelValue = { checked: false, value: 'rugby' };
1362
- fieldset.formElements['gender[]'][0].modelValue = { checked: false, value: 'male' };
1363
- fieldset.formElements['gender[]'][1].modelValue = { checked: false, value: 'female' };
1364
- fieldset.formElements.color.modelValue = { checked: false, value: 'blue' };
1475
+ const fieldset =
1476
+ /** @type {FormGroup} */
1477
+ await fixture(html`<${tag}>${inputSlots}</${tag}>`);
1478
+ fieldset.formElements['hobbies[]'][0].modelValue = {
1479
+ checked: false,
1480
+ value: 'chess',
1481
+ };
1482
+ fieldset.formElements['hobbies[]'][1].modelValue = {
1483
+ checked: false,
1484
+ value: 'rugby',
1485
+ };
1486
+ fieldset.formElements['gender[]'][0].modelValue = {
1487
+ checked: false,
1488
+ value: 'male',
1489
+ };
1490
+ fieldset.formElements['gender[]'][1].modelValue = {
1491
+ checked: false,
1492
+ value: 'female',
1493
+ };
1494
+ fieldset.formElements.color.modelValue = {
1495
+ checked: false,
1496
+ value: 'blue',
1497
+ };
1365
1498
  expect(fieldset.hasAttribute('role')).to.be.true;
1366
1499
  expect(fieldset.getAttribute('role')).to.contain('group');
1367
1500
  });
1368
-
1369
1501
  it('has an aria-labelledby from element with slot="label"', async () => {
1370
- const el = /** @type {FormGroup} */ (
1502
+ const el =
1503
+ /** @type {FormGroup} */
1371
1504
  await fixture(html`
1372
1505
  <${tag}>
1373
1506
  <label slot="label">My Label</label>
1374
1507
  ${inputSlots}
1375
1508
  </${tag}>
1376
- `)
1377
- );
1378
- const label = /** @type {HTMLElement} */ (
1379
- Array.from(el.children).find(child => child.slot === 'label')
1380
- );
1509
+ `);
1510
+ const label =
1511
+ /** @type {HTMLElement} */
1512
+ Array.from(el.children).find((child) => child.slot === 'label');
1381
1513
  expect(el.hasAttribute('aria-labelledby')).to.equal(true);
1382
1514
  expect(el.getAttribute('aria-labelledby')).contains(label.id);
1383
1515
  });
1384
-
1385
1516
  it('sets an aria-describedby to its children from element with slot="feedback"', async () => {
1386
- const el = /** @type {FormGroup} */ (
1517
+ const el =
1518
+ /** @type {FormGroup} */
1387
1519
  await fixture(html`
1388
1520
  <${tag}>
1389
1521
  <label slot="label">My Label</label>
1390
1522
  <div slot="feedback">My Feedback</div>
1391
1523
  ${inputSlots}
1392
1524
  </${tag}>
1393
- `)
1394
- );
1395
- const feedback = /** @type {HTMLElement} */ (
1396
- Array.from(el.children).find(child => child.slot === 'feedback')
1397
- );
1525
+ `);
1526
+ const feedback =
1527
+ /** @type {HTMLElement} */
1528
+ Array.from(el.children).find((child) => child.slot === 'feedback');
1398
1529
  expect(el.formElements[0]._inputNode.getAttribute('aria-describedby')).contains(
1399
1530
  feedback.id,
1400
1531
  );
1401
1532
  });
1402
1533
  });
1403
-
1404
1534
  describe('Dynamically rendered children', () => {
1405
1535
  class DynamicCWrapper extends LitElement {
1406
1536
  static get properties() {
1407
1537
  return {
1408
- fields: { type: Array },
1538
+ fields: {
1539
+ type: Array,
1540
+ },
1409
1541
  };
1410
1542
  }
1411
-
1412
1543
  constructor() {
1413
1544
  super();
1414
1545
  /** @type {any[]} */
@@ -1418,13 +1549,12 @@ export function runFormGroupMixinSuite(cfg = {}) {
1418
1549
  /** @type {object|undefined} */
1419
1550
  this.serializedValue = undefined;
1420
1551
  }
1421
-
1422
1552
  render() {
1423
1553
  return html`
1424
1554
  <${tag}
1425
1555
  .modelValue=${this.modelValue}
1426
1556
  .serializedValue=${this.serializedValue}>
1427
- ${this.fields.map(field => {
1557
+ ${this.fields.map((field) => {
1428
1558
  if (typeof field === 'object') {
1429
1559
  return html`<${childTag} name="${field.name}" .modelValue="${field.value}"></${childTag}>`;
1430
1560
  }
@@ -1436,114 +1566,119 @@ export function runFormGroupMixinSuite(cfg = {}) {
1436
1566
  }
1437
1567
  const dynamicChildrenTagString = defineCE(DynamicCWrapper);
1438
1568
  const dynamicChildrenTag = unsafeStatic(dynamicChildrenTagString);
1439
-
1440
1569
  it(`when rendering children right from the start, sets their values correctly
1441
1570
  based on prefilled model/serializedValue`, async () => {
1442
- const el = /** @type {DynamicCWrapper} */ (
1571
+ const el =
1572
+ /** @type {DynamicCWrapper} */
1443
1573
  await fixture(html`
1444
1574
  <${dynamicChildrenTag}
1445
1575
  .fields="${['firstName', 'lastName']}"
1446
- .modelValue="${{ firstName: 'foo', lastName: 'bar' }}"
1576
+ .modelValue="${{
1577
+ firstName: 'foo',
1578
+ lastName: 'bar',
1579
+ }}"
1447
1580
  >
1448
1581
  </${dynamicChildrenTag}>
1449
- `)
1450
- );
1582
+ `);
1451
1583
  await el.updateComplete;
1452
- const fieldset = /** @type {FormGroup} */ (
1453
- /** @type {ShadowRoot} */ (el.shadowRoot).querySelector(tagString)
1454
- );
1584
+ const fieldset =
1585
+ /** @type {FormGroup} */
1586
+ /** @type {ShadowRoot} */ el.shadowRoot.querySelector(tagString);
1455
1587
  expect(fieldset.formElements[0].modelValue).to.equal('foo');
1456
1588
  expect(fieldset.formElements[1].modelValue).to.equal('bar');
1457
-
1458
- const el2 = /** @type {DynamicCWrapper} */ (
1589
+ const el2 =
1590
+ /** @type {DynamicCWrapper} */
1459
1591
  await fixture(html`
1460
1592
  <${dynamicChildrenTag}
1461
1593
  .fields="${['firstName', 'lastName']}"
1462
- .serializedValue="${{ firstName: 'foo', lastName: 'bar' }}"
1594
+ .serializedValue="${{
1595
+ firstName: 'foo',
1596
+ lastName: 'bar',
1597
+ }}"
1463
1598
  >
1464
1599
  </${dynamicChildrenTag}>
1465
- `)
1466
- );
1600
+ `);
1467
1601
  await el2.updateComplete;
1468
- const fieldset2 = /** @type {FormGroup} */ (
1469
- /** @type {ShadowRoot} */ (el2.shadowRoot).querySelector(tagString)
1470
- );
1602
+ const fieldset2 =
1603
+ /** @type {FormGroup} */
1604
+ /** @type {ShadowRoot} */ el2.shadowRoot.querySelector(tagString);
1471
1605
  expect(fieldset2.formElements[0].serializedValue).to.equal('foo');
1472
1606
  expect(fieldset2.formElements[1].serializedValue).to.equal('bar');
1473
1607
  });
1474
-
1475
1608
  it(`when rendering children delayed, sets their values
1476
1609
  correctly based on prefilled model/serializedValue`, async () => {
1477
- const el = /** @type {DynamicCWrapper} */ (
1610
+ const el =
1611
+ /** @type {DynamicCWrapper} */
1478
1612
  await fixture(html`
1479
- <${dynamicChildrenTag} .modelValue="${{ firstName: 'foo', lastName: 'bar' }}">
1613
+ <${dynamicChildrenTag} .modelValue="${{
1614
+ firstName: 'foo',
1615
+ lastName: 'bar',
1616
+ }}">
1480
1617
  </${dynamicChildrenTag}>
1481
- `)
1482
- );
1618
+ `);
1483
1619
  await el.updateComplete;
1484
- const fieldset = /** @type {FormGroup} */ (
1485
- /** @type {ShadowRoot} */ (el.shadowRoot).querySelector(tagString)
1486
- );
1620
+ const fieldset =
1621
+ /** @type {FormGroup} */
1622
+ /** @type {ShadowRoot} */ el.shadowRoot.querySelector(tagString);
1487
1623
  el.fields = ['firstName', 'lastName'];
1488
1624
  await el.updateComplete;
1489
1625
  expect(fieldset.formElements[0].modelValue).to.equal('foo');
1490
1626
  expect(fieldset.formElements[1].modelValue).to.equal('bar');
1491
-
1492
- const el2 = /** @type {DynamicCWrapper} */ (
1627
+ const el2 =
1628
+ /** @type {DynamicCWrapper} */
1493
1629
  await fixture(html`
1494
- <${dynamicChildrenTag} .serializedValue="${{ firstName: 'foo', lastName: 'bar' }}">
1630
+ <${dynamicChildrenTag} .serializedValue="${{
1631
+ firstName: 'foo',
1632
+ lastName: 'bar',
1633
+ }}">
1495
1634
  </${dynamicChildrenTag}>
1496
- `)
1497
- );
1635
+ `);
1498
1636
  await el2.updateComplete;
1499
- const fieldset2 = /** @type {FormGroup} */ (
1500
- /** @type {ShadowRoot} */ (el2.shadowRoot).querySelector(tagString)
1501
- );
1637
+ const fieldset2 =
1638
+ /** @type {FormGroup} */
1639
+ /** @type {ShadowRoot} */ el2.shadowRoot.querySelector(tagString);
1502
1640
  el2.fields = ['firstName', 'lastName'];
1503
1641
  await el2.updateComplete;
1504
1642
  expect(fieldset2.formElements[0].serializedValue).to.equal('foo');
1505
1643
  expect(fieldset2.formElements[1].serializedValue).to.equal('bar');
1506
1644
  });
1507
-
1508
1645
  it(`when rendering children partly delayed, sets their values correctly based on
1509
1646
  prefilled model/serializedValue`, async () => {
1510
- const el = /** @type {DynamicCWrapper} */ (
1647
+ const el =
1648
+ /** @type {DynamicCWrapper} */
1511
1649
  await fixture(html`
1512
1650
  <${dynamicChildrenTag} .fields="${['firstName']}" .modelValue="${{
1513
1651
  firstName: 'foo',
1514
1652
  lastName: 'bar',
1515
1653
  }}">
1516
1654
  </${dynamicChildrenTag}>
1517
- `)
1518
- );
1655
+ `);
1519
1656
  await el.updateComplete;
1520
- const fieldset = /** @type {FormGroup} */ (
1521
- /** @type {ShadowRoot} */ (el.shadowRoot).querySelector(tagString)
1522
- );
1657
+ const fieldset =
1658
+ /** @type {FormGroup} */
1659
+ /** @type {ShadowRoot} */ el.shadowRoot.querySelector(tagString);
1523
1660
  el.fields = ['firstName', 'lastName'];
1524
1661
  await el.updateComplete;
1525
1662
  expect(fieldset.formElements[0].modelValue).to.equal('foo');
1526
1663
  expect(fieldset.formElements[1].modelValue).to.equal('bar');
1527
-
1528
- const el2 = /** @type {DynamicCWrapper} */ (
1664
+ const el2 =
1665
+ /** @type {DynamicCWrapper} */
1529
1666
  await fixture(html`
1530
1667
  <${dynamicChildrenTag} .fields="${['firstName']}" .serializedValue="${{
1531
1668
  firstName: 'foo',
1532
1669
  lastName: 'bar',
1533
1670
  }}">
1534
1671
  </${dynamicChildrenTag}>
1535
- `)
1536
- );
1672
+ `);
1537
1673
  await el2.updateComplete;
1538
- const fieldset2 = /** @type {FormGroup} */ (
1539
- /** @type {ShadowRoot} */ (el2.shadowRoot).querySelector(tagString)
1540
- );
1674
+ const fieldset2 =
1675
+ /** @type {FormGroup} */
1676
+ /** @type {ShadowRoot} */ el2.shadowRoot.querySelector(tagString);
1541
1677
  el2.fields = ['firstName', 'lastName'];
1542
1678
  await el2.updateComplete;
1543
1679
  expect(fieldset2.formElements[0].serializedValue).to.equal('foo');
1544
1680
  expect(fieldset2.formElements[1].serializedValue).to.equal('bar');
1545
1681
  });
1546
-
1547
1682
  it(`does not change interaction states when values set for delayed children`, async () => {
1548
1683
  function expectInteractionStatesToBeCorrectFor(/** @type {FormChild|FormGroup} */ elm) {
1549
1684
  expect(Boolean(elm.submitted)).to.be.false;
@@ -1551,88 +1686,94 @@ export function runFormGroupMixinSuite(cfg = {}) {
1551
1686
  expect(elm.touched).to.be.false;
1552
1687
  expect(elm.prefilled).to.be.true;
1553
1688
  }
1554
-
1555
- const el = /** @type {DynamicCWrapper} */ (
1689
+ const el =
1690
+ /** @type {DynamicCWrapper} */
1556
1691
  await fixture(html`
1557
1692
  <${dynamicChildrenTag} .fields="${['firstName']}" .modelValue="${{
1558
1693
  firstName: 'foo',
1559
1694
  lastName: 'bar',
1560
1695
  }}">
1561
1696
  </${dynamicChildrenTag}>
1562
- `)
1563
- );
1697
+ `);
1564
1698
  await el.updateComplete;
1565
- const fieldset = /** @type {FormGroup} */ (
1566
- /** @type {ShadowRoot} */ (el.shadowRoot).querySelector(tagString)
1567
- );
1699
+ const fieldset =
1700
+ /** @type {FormGroup} */
1701
+ /** @type {ShadowRoot} */ el.shadowRoot.querySelector(tagString);
1568
1702
  await fieldset.registrationComplete;
1569
-
1570
1703
  el.fields = ['firstName', 'lastName'];
1571
1704
  await el.updateComplete;
1572
1705
  expectInteractionStatesToBeCorrectFor(fieldset.formElements[0]);
1573
1706
  expectInteractionStatesToBeCorrectFor(fieldset.formElements[1]);
1574
1707
  expectInteractionStatesToBeCorrectFor(fieldset);
1575
-
1576
- const el2 = /** @type {DynamicCWrapper} */ (
1708
+ const el2 =
1709
+ /** @type {DynamicCWrapper} */
1577
1710
  await fixture(html`
1578
1711
  <${dynamicChildrenTag} .fields="${['firstName']}" .serializedValue="${{
1579
1712
  firstName: 'foo',
1580
1713
  lastName: 'bar',
1581
1714
  }}">
1582
1715
  </${dynamicChildrenTag}>
1583
- `)
1584
- );
1716
+ `);
1585
1717
  await el2.updateComplete;
1586
- const fieldset2 = /** @type {FormGroup} */ (
1587
- /** @type {ShadowRoot} */ (el2.shadowRoot).querySelector(tagString)
1588
- );
1718
+ const fieldset2 =
1719
+ /** @type {FormGroup} */
1720
+ /** @type {ShadowRoot} */ el2.shadowRoot.querySelector(tagString);
1589
1721
  await fieldset2.registrationComplete;
1590
-
1591
1722
  el2.fields = ['firstName', 'lastName'];
1592
1723
  await el2.updateComplete;
1593
1724
  expectInteractionStatesToBeCorrectFor(fieldset2.formElements[0]);
1594
1725
  expectInteractionStatesToBeCorrectFor(fieldset2.formElements[1]);
1595
1726
  expectInteractionStatesToBeCorrectFor(fieldset2);
1596
1727
  });
1597
-
1598
1728
  it(`prefilled children values take precedence over parent values`, async () => {
1599
- const el = /** @type {DynamicCWrapper} */ (
1729
+ const el =
1730
+ /** @type {DynamicCWrapper} */
1600
1731
  await fixture(html`
1601
1732
  <${dynamicChildrenTag} .modelValue="${{
1602
1733
  firstName: 'foo',
1603
1734
  lastName: 'bar',
1604
1735
  }}">
1605
1736
  </${dynamicChildrenTag}>
1606
- `)
1607
- );
1737
+ `);
1608
1738
  await el.updateComplete;
1609
- const fieldset = /** @type {FormGroup} */ (
1610
- /** @type {ShadowRoot} */ (el.shadowRoot).querySelector(tagString)
1611
- );
1739
+ const fieldset =
1740
+ /** @type {FormGroup} */
1741
+ /** @type {ShadowRoot} */ el.shadowRoot.querySelector(tagString);
1612
1742
  el.fields = [
1613
- { name: 'firstName', value: 'wins' },
1614
- { name: 'lastName', value: 'winsAsWell' },
1743
+ {
1744
+ name: 'firstName',
1745
+ value: 'wins',
1746
+ },
1747
+ {
1748
+ name: 'lastName',
1749
+ value: 'winsAsWell',
1750
+ },
1615
1751
  ];
1616
1752
  await el.updateComplete;
1617
1753
  expect(fieldset.formElements[0].modelValue).to.equal('wins');
1618
1754
  expect(fieldset.formElements[1].modelValue).to.equal('winsAsWell');
1619
-
1620
- const el2 = /** @type {DynamicCWrapper} */ (
1755
+ const el2 =
1756
+ /** @type {DynamicCWrapper} */
1621
1757
  await fixture(html`
1622
1758
  <${dynamicChildrenTag} .serializedValue="${{
1623
1759
  firstName: 'foo',
1624
1760
  lastName: 'bar',
1625
1761
  }}">
1626
1762
  </${dynamicChildrenTag}>
1627
- `)
1628
- );
1763
+ `);
1629
1764
  await el2.updateComplete;
1630
- const fieldset2 = /** @type {FormGroup} */ (
1631
- /** @type {ShadowRoot} */ (el2.shadowRoot).querySelector(tagString)
1632
- );
1765
+ const fieldset2 =
1766
+ /** @type {FormGroup} */
1767
+ /** @type {ShadowRoot} */ el2.shadowRoot.querySelector(tagString);
1633
1768
  el2.fields = [
1634
- { name: 'firstName', value: 'wins' },
1635
- { name: 'lastName', value: 'winsAsWell' },
1769
+ {
1770
+ name: 'firstName',
1771
+ value: 'wins',
1772
+ },
1773
+ {
1774
+ name: 'lastName',
1775
+ value: 'winsAsWell',
1776
+ },
1636
1777
  ];
1637
1778
  await el2.updateComplete;
1638
1779
  expect(fieldset2.formElements[0].serializedValue).to.equal('wins');