@sbb-esta/lyne-elements 2.11.0 → 2.11.2

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 (379) hide show
  1. package/accordion/accordion.component.js +19 -22
  2. package/action-group/action-group.component.js +3 -5
  3. package/alert/alert/alert.component.js +1 -2
  4. package/alert/alert-group/alert-group.component.js +2 -3
  5. package/autocomplete/autocomplete-base-element.js +71 -82
  6. package/autocomplete/autocomplete.component.js +31 -36
  7. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +44 -52
  8. package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +3 -4
  9. package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +17 -20
  10. package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +23 -26
  11. package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +9 -9
  12. package/breadcrumb/breadcrumb-group/breadcrumb-group.component.js +29 -33
  13. package/button/mini-button/mini-button.component.js +1 -1
  14. package/button/mini-button-group/mini-button-group.component.js +1 -2
  15. package/calendar/calendar.component.js +8 -13
  16. package/card/card/card.component.js +12 -12
  17. package/card/card-badge/card-badge.component.js +16 -16
  18. package/card/common/card-action-common.js +23 -25
  19. package/checkbox/checkbox/checkbox.component.js +17 -20
  20. package/checkbox/checkbox-group/checkbox-group.component.js +39 -52
  21. package/checkbox/checkbox-panel/checkbox-panel.component.js +22 -25
  22. package/checkbox/common/checkbox-common.js +13 -15
  23. package/chip/chip-group/chip-group.component.js +59 -70
  24. package/clock/clock.component.js +50 -60
  25. package/container/container/container.component.js +28 -29
  26. package/container/sticky-bar/sticky-bar.component.js +26 -27
  27. package/core/a11y/focus-trap-controller.js +11 -14
  28. package/core/a11y/focus.js +27 -29
  29. package/core/a11y/input-modality-detector.js +18 -19
  30. package/core/a11y/interactivity-checker.js +10 -10
  31. package/core/base-elements/button-base-element.js +13 -18
  32. package/core/base-elements/link-base-element.js +3 -6
  33. package/core/base-elements/open-close-base-element.js +1 -1
  34. package/core/controllers/connected-abort-controller.js +2 -4
  35. package/core/controllers/escapable-overlay-controller.js +10 -12
  36. package/core/controllers/id-reference-controller.js +13 -14
  37. package/core/controllers/inert-controller.js +8 -10
  38. package/core/controllers/slot-state-controller.js +16 -26
  39. package/core/datetime/date-adapter.d.ts.map +1 -1
  40. package/core/datetime/date-adapter.js +21 -21
  41. package/core/datetime/native-date-adapter.js +11 -11
  42. package/core/decorators/date-converter.js +10 -12
  43. package/core/decorators/date-only-type.js +5 -6
  44. package/core/decorators/force-type.js +4 -5
  45. package/core/dom/breakpoint.js +8 -8
  46. package/core/dom/input-element.js +4 -9
  47. package/core/eventing/event-emitter.js +4 -5
  48. package/core/mixins/form-associated-checkbox-mixin.js +32 -37
  49. package/core/mixins/form-associated-input-mixin.js +58 -64
  50. package/core/mixins/form-associated-mixin.js +42 -44
  51. package/core/mixins/form-associated-radio-button-mixin.js +3 -5
  52. package/core/mixins/hydration-mixin.js +12 -13
  53. package/core/mixins/named-slot-list-mixin.js +32 -37
  54. package/core/mixins/panel-mixin.js +26 -27
  55. package/core/mixins.js +1 -1
  56. package/core/overlay/position.js +23 -23
  57. package/core/styles/core/mediaqueries.scss +1 -1
  58. package/core/styles/core.scss +27 -28
  59. package/core/styles/mixins/table.scss +1 -24
  60. package/core/styles/mixins/typo.scss +0 -1
  61. package/core/testing/event-spy.js +2 -4
  62. package/core/testing/wait-for-image-ready.js +8 -9
  63. package/core/testing/wait-for-render.js +8 -9
  64. package/custom-elements.json +2 -2
  65. package/date-input/date-input.component.js +2 -4
  66. package/datepicker/common/datepicker-association-controllers.js +21 -24
  67. package/datepicker/common/datepicker-button.js +53 -57
  68. package/datepicker/datepicker/datepicker.component.js +82 -95
  69. package/datepicker/datepicker-next-day/datepicker-next-day.component.js +1 -1
  70. package/datepicker/datepicker-previous-day/datepicker-previous-day.component.js +1 -1
  71. package/datepicker/datepicker-toggle/datepicker-toggle.component.js +74 -81
  72. package/development/accordion/accordion.component.js +4 -7
  73. package/development/action-group/action-group.component.js +3 -5
  74. package/development/alert/alert/alert.component.js +2 -3
  75. package/development/alert/alert-group/alert-group.component.js +2 -3
  76. package/development/autocomplete/autocomplete-base-element.js +19 -30
  77. package/development/autocomplete/autocomplete.component.js +7 -12
  78. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +10 -18
  79. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +3 -4
  80. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +1 -1
  81. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +4 -7
  82. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +4 -7
  83. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -2
  84. package/development/breadcrumb/breadcrumb/breadcrumb.component.js +1 -1
  85. package/development/breadcrumb/breadcrumb-group/breadcrumb-group.component.js +5 -9
  86. package/development/button/accent-button/accent-button.component.js +1 -1
  87. package/development/button/accent-button-link/accent-button-link.component.js +1 -1
  88. package/development/button/accent-button-static/accent-button-static.component.js +1 -1
  89. package/development/button/button/button.component.js +1 -1
  90. package/development/button/button-link/button-link.component.js +1 -1
  91. package/development/button/button-static/button-static.component.js +1 -1
  92. package/development/button/common/button-common.js +1 -1
  93. package/development/button/mini-button/mini-button.component.js +1 -1
  94. package/development/button/mini-button-group/mini-button-group.component.js +2 -3
  95. package/development/button/secondary-button/secondary-button.component.js +1 -1
  96. package/development/button/secondary-button-link/secondary-button-link.component.js +1 -1
  97. package/development/button/secondary-button-static/secondary-button-static.component.js +1 -1
  98. package/development/button/transparent-button/transparent-button.component.js +1 -1
  99. package/development/button/transparent-button-link/transparent-button-link.component.js +1 -1
  100. package/development/button/transparent-button-static/transparent-button-static.component.js +1 -1
  101. package/development/calendar/calendar.component.js +9 -14
  102. package/development/card/card/card.component.js +1 -1
  103. package/development/card/card-badge/card-badge.component.js +1 -1
  104. package/development/card/card-button/card-button.component.js +1 -1
  105. package/development/card/card-link/card-link.component.js +1 -1
  106. package/development/card/common/card-action-common.js +3 -5
  107. package/development/checkbox/checkbox/checkbox.component.js +2 -5
  108. package/development/checkbox/checkbox-group/checkbox-group.component.js +8 -21
  109. package/development/checkbox/checkbox-panel/checkbox-panel.component.js +2 -5
  110. package/development/checkbox/common/checkbox-common.js +3 -5
  111. package/development/chip/chip/chip.component.js +1 -1
  112. package/development/chip/chip-group/chip-group.component.js +15 -26
  113. package/development/chip-label/chip-label.component.js +1 -1
  114. package/development/clock/clock.component.js +23 -33
  115. package/development/container/container/container.component.js +2 -3
  116. package/development/container/sticky-bar/sticky-bar.component.js +2 -3
  117. package/development/core/a11y/arrow-navigation.js +1 -1
  118. package/development/core/a11y/fake-event-detection.js +1 -1
  119. package/development/core/a11y/focus-trap-controller.js +6 -9
  120. package/development/core/a11y/focus-visible-within-controller.js +1 -1
  121. package/development/core/a11y/focus.js +8 -10
  122. package/development/core/a11y/input-modality-detector.js +2 -3
  123. package/development/core/a11y/interactivity-checker.js +2 -2
  124. package/development/core/base-elements/action-base-element.js +2 -3
  125. package/development/core/base-elements/button-base-element.js +6 -11
  126. package/development/core/base-elements/link-base-element.js +4 -7
  127. package/development/core/base-elements/open-close-base-element.js +2 -2
  128. package/development/core/config/config.js +1 -1
  129. package/development/core/controllers/connected-abort-controller.js +3 -5
  130. package/development/core/controllers/escapable-overlay-controller.js +3 -5
  131. package/development/core/controllers/id-reference-controller.js +2 -3
  132. package/development/core/controllers/inert-controller.js +4 -6
  133. package/development/core/controllers/language-controller.js +1 -1
  134. package/development/core/controllers/media-matchers-controller.js +1 -1
  135. package/development/core/controllers/slot-state-controller.js +8 -18
  136. package/development/core/datetime/date-adapter.d.ts.map +1 -1
  137. package/development/core/datetime/date-adapter.js +5 -5
  138. package/development/core/datetime/native-date-adapter.js +2 -2
  139. package/development/core/decorators/date-converter.js +3 -5
  140. package/development/core/decorators/date-only-type.js +2 -3
  141. package/development/core/decorators/force-type.js +3 -4
  142. package/development/core/decorators/get-override.js +1 -1
  143. package/development/core/decorators/handle-distinct-change.js +1 -1
  144. package/development/core/decorators/host-attributes.js +1 -1
  145. package/development/core/decorators/slot-state.js +1 -1
  146. package/development/core/dom/animation.js +1 -1
  147. package/development/core/dom/breakpoint.js +2 -2
  148. package/development/core/dom/find-referenced-element.js +1 -1
  149. package/development/core/dom/host-context.js +1 -1
  150. package/development/core/dom/input-element.js +3 -4
  151. package/development/core/dom/platform.js +1 -1
  152. package/development/core/dom/scroll.js +1 -1
  153. package/development/core/dom/set-or-remove-attribute.js +1 -1
  154. package/development/core/eventing/composed-path-has-attribute.js +1 -1
  155. package/development/core/eventing/event-emitter.js +2 -3
  156. package/development/core/eventing/form-element-handlers.js +1 -1
  157. package/development/core/eventing/forward-event.js +1 -1
  158. package/development/core/eventing/throttle.js +1 -1
  159. package/development/core/i18n/i18n.js +1 -1
  160. package/development/core/mixins/animation-complete-mixin.js +1 -1
  161. package/development/core/mixins/disabled-mixin.js +1 -1
  162. package/development/core/mixins/form-associated-checkbox-mixin.js +6 -9
  163. package/development/core/mixins/form-associated-input-mixin.js +14 -20
  164. package/development/core/mixins/form-associated-mixin.js +5 -7
  165. package/development/core/mixins/form-associated-radio-button-mixin.js +7 -9
  166. package/development/core/mixins/hydration-mixin.js +3 -4
  167. package/development/core/mixins/named-slot-list-mixin.js +4 -7
  168. package/development/core/mixins/negative-mixin.js +1 -1
  169. package/development/core/mixins/panel-mixin.js +2 -3
  170. package/development/core/mixins/required-mixin.js +1 -1
  171. package/development/core/mixins/update-scheduler-mixin.js +1 -1
  172. package/development/core/overlay/overlay-option-panel.js +1 -1
  173. package/development/core/overlay/overlay-trigger-attributes.js +1 -1
  174. package/development/core/overlay/overlay.js +1 -1
  175. package/development/core/overlay/position.js +5 -5
  176. package/development/core/testing/event-spy.js +3 -5
  177. package/development/core/testing/mocha-extensions.js +1 -1
  178. package/development/core/testing/wait-for-condition.js +1 -1
  179. package/development/core/testing/wait-for-image-ready.js +2 -3
  180. package/development/core/testing/wait-for-render.js +2 -3
  181. package/development/date-input/date-input.component.js +4 -6
  182. package/development/datepicker/common/datepicker-association-controllers.js +6 -9
  183. package/development/datepicker/common/datepicker-button.js +7 -11
  184. package/development/datepicker/datepicker/datepicker.component.js +22 -35
  185. package/development/datepicker/datepicker-next-day/datepicker-next-day.component.js +1 -1
  186. package/development/datepicker/datepicker-previous-day/datepicker-previous-day.component.js +1 -1
  187. package/development/datepicker/datepicker-toggle/datepicker-toggle.component.js +13 -20
  188. package/development/dialog/dialog/dialog.component.js +16 -27
  189. package/development/dialog/dialog-actions/dialog-actions.component.js +1 -1
  190. package/development/dialog/dialog-content/dialog-content.component.js +1 -1
  191. package/development/dialog/dialog-title/dialog-title.component.js +1 -1
  192. package/development/divider/divider.component.js +1 -1
  193. package/development/expansion-panel/expansion-panel/expansion-panel.component.js +9 -13
  194. package/development/expansion-panel/expansion-panel-content/expansion-panel-content.component.js +1 -1
  195. package/development/expansion-panel/expansion-panel-header/expansion-panel-header.component.js +4 -5
  196. package/development/file-selector/common/file-selector-common.js +2 -3
  197. package/development/file-selector/file-selector/file-selector.component.js +1 -1
  198. package/development/file-selector/file-selector-dropzone/file-selector-dropzone.component.js +1 -1
  199. package/development/flip-card/flip-card/flip-card.component.js +7 -13
  200. package/development/flip-card/flip-card-details/flip-card-details.component.js +2 -3
  201. package/development/flip-card/flip-card-summary/flip-card-summary.component.js +2 -3
  202. package/development/footer/footer.component.js +1 -1
  203. package/development/form-error/form-error.component.js +3 -4
  204. package/development/form-field/form-field/form-field.component.js +19 -30
  205. package/development/form-field/form-field-clear/form-field-clear.component.js +4 -6
  206. package/development/header/common/header-action-common.js +1 -1
  207. package/development/header/header/header.component.js +5 -8
  208. package/development/header/header-button/header-button.component.js +1 -1
  209. package/development/header/header-link/header-link.component.js +1 -1
  210. package/development/icon/icon-base.js +1 -1
  211. package/development/icon/icon-name-mixin.js +1 -1
  212. package/development/icon/icon-request.js +2 -3
  213. package/development/icon/icon-validate.js +1 -1
  214. package/development/icon/icon.component.js +1 -1
  215. package/development/image/image.component.js +7 -9
  216. package/development/journey-header/journey-header.component.js +1 -1
  217. package/development/lead-container/lead-container.component.js +1 -1
  218. package/development/link/block-link/block-link.component.js +1 -1
  219. package/development/link/block-link-button/block-link-button.component.js +1 -1
  220. package/development/link/block-link-static/block-link-static.component.js +1 -1
  221. package/development/link/common/block-link-common.js +1 -1
  222. package/development/link/common/inline-link-common.js +1 -1
  223. package/development/link/link/link.component.js +1 -1
  224. package/development/link/link-button/link-button.component.js +1 -1
  225. package/development/link/link-static/link-static.component.js +1 -1
  226. package/development/link-common-CJEWffDZ.js +1 -1
  227. package/development/link-list/common/link-list-base.js +1 -1
  228. package/development/link-list/link-list/link-list.component.js +1 -1
  229. package/development/link-list/link-list-anchor/link-list-anchor.component.js +1 -1
  230. package/development/loading-indicator/loading-indicator.component.js +1 -1
  231. package/development/loading-indicator-circle/loading-indicator-circle.component.js +1 -1
  232. package/development/logo/logo.component.js +1 -1
  233. package/development/map-container/map-container.component.js +2 -3
  234. package/development/menu/common/menu-action-common.js +1 -1
  235. package/development/menu/menu/menu.component.js +17 -25
  236. package/development/menu/menu-button/menu-button.component.js +1 -1
  237. package/development/menu/menu-link/menu-link.component.js +1 -1
  238. package/development/message/message.component.js +1 -1
  239. package/development/navigation/common/navigation-action-common.js +3 -5
  240. package/development/navigation/navigation/navigation.component.js +19 -35
  241. package/development/navigation/navigation-button/navigation-button.component.js +1 -1
  242. package/development/navigation/navigation-link/navigation-link.component.js +1 -1
  243. package/development/navigation/navigation-list/navigation-list.component.js +1 -1
  244. package/development/navigation/navigation-marker/navigation-marker.component.js +4 -6
  245. package/development/navigation/navigation-section/navigation-section.component.js +22 -32
  246. package/development/notification/notification.component.js +22 -24
  247. package/development/option/optgroup/optgroup-base-element.js +4 -6
  248. package/development/option/optgroup/optgroup.component.js +6 -10
  249. package/development/option/option/option-base-element.js +3 -4
  250. package/development/option/option/option.component.js +7 -10
  251. package/development/overlay/overlay-base-element.js +4 -6
  252. package/development/overlay/overlay.component.js +7 -9
  253. package/development/paginator/common/paginator-common.js +1 -1
  254. package/development/paginator/compact-paginator/compact-paginator.component.js +1 -1
  255. package/development/paginator/paginator/paginator.component.js +2 -3
  256. package/development/popover/popover/popover.component.d.ts.map +1 -1
  257. package/development/popover/popover/popover.component.js +17 -19
  258. package/development/popover/popover-trigger/popover-trigger.component.js +1 -1
  259. package/development/radio-button/common/radio-button-common.js +6 -10
  260. package/development/radio-button/radio-button/radio-button.component.js +2 -5
  261. package/development/radio-button/radio-button-group/radio-button-group.component.js +8 -24
  262. package/development/radio-button/radio-button-panel/radio-button-panel.component.js +3 -7
  263. package/development/screen-reader-only/screen-reader-only.component.js +1 -1
  264. package/development/select/select.component.js +26 -48
  265. package/development/selection-expansion-panel/selection-expansion-panel.component.js +7 -11
  266. package/development/sidebar/icon-sidebar/icon-sidebar.component.js +1 -1
  267. package/development/sidebar/icon-sidebar-button/icon-sidebar-button.component.js +1 -1
  268. package/development/sidebar/icon-sidebar-container/icon-sidebar-container.component.js +4 -7
  269. package/development/sidebar/icon-sidebar-content/icon-sidebar-content.component.js +1 -1
  270. package/development/sidebar/icon-sidebar-link/icon-sidebar-link.component.js +1 -1
  271. package/development/sidebar/sidebar/sidebar.component.js +8 -15
  272. package/development/sidebar/sidebar-close-button/sidebar-close-button.component.js +1 -1
  273. package/development/sidebar/sidebar-container/sidebar-container.component.js +9 -13
  274. package/development/sidebar/sidebar-content/sidebar-content.component.js +1 -1
  275. package/development/sidebar/sidebar-title/sidebar-title.component.js +2 -2
  276. package/development/signet/signet.component.js +1 -1
  277. package/development/skiplink-list/skiplink-list.component.js +1 -1
  278. package/development/slider/slider.component.js +3 -4
  279. package/development/status/status.component.js +3 -2
  280. package/development/stepper/step/step.component.js +5 -7
  281. package/development/stepper/step-label/step-label.component.js +3 -4
  282. package/development/stepper/stepper/stepper.component.js +16 -29
  283. package/development/table/table-wrapper/table-wrapper.component.js +2 -7
  284. package/development/tabs/tab/tab.component.js +1 -1
  285. package/development/tabs/tab-group/tab-group.component.js +23 -38
  286. package/development/tabs/tab-label/tab-label.component.js +1 -1
  287. package/development/tag/tag/tag.component.js +6 -12
  288. package/development/tag/tag-group/tag-group.component.js +5 -13
  289. package/development/teaser/teaser.component.js +1 -1
  290. package/development/teaser-hero/teaser-hero.component.js +1 -1
  291. package/development/teaser-product/common/teaser-product-common.js +1 -1
  292. package/development/teaser-product/teaser-product/teaser-product.component.js +1 -1
  293. package/development/teaser-product/teaser-product-static/teaser-product-static.component.js +1 -1
  294. package/development/time-input/time-input.component.js +8 -12
  295. package/development/timetable-occupancy/timetable-occupancy.component.js +1 -1
  296. package/development/timetable-occupancy-icon/timetable-occupancy-icon.component.js +2 -3
  297. package/development/title/title-base.js +1 -2
  298. package/development/title/title.component.js +1 -1
  299. package/development/toast/toast.component.js +4 -7
  300. package/development/toggle/toggle/toggle.component.js +8 -12
  301. package/development/toggle/toggle-option/toggle-option.component.js +9 -16
  302. package/development/toggle-check/toggle-check.component.js +1 -1
  303. package/development/train/train/train.component.js +1 -1
  304. package/development/train/train-blocked-passage/train-blocked-passage.component.js +1 -1
  305. package/development/train/train-formation/train-formation.component.js +5 -7
  306. package/development/train/train-wagon/train-wagon.component.js +1 -1
  307. package/development/visual-checkbox/visual-checkbox.component.js +1 -1
  308. package/dialog/dialog/dialog.component.js +59 -70
  309. package/expansion-panel/expansion-panel/expansion-panel.component.js +5 -9
  310. package/expansion-panel/expansion-panel-header/expansion-panel-header.component.js +31 -32
  311. package/file-selector/common/file-selector-common.js +1 -2
  312. package/flip-card/flip-card/flip-card.component.js +48 -54
  313. package/flip-card/flip-card-details/flip-card-details.component.js +16 -17
  314. package/flip-card/flip-card-summary/flip-card-summary.component.js +18 -19
  315. package/form-error/form-error.component.js +13 -14
  316. package/form-field/form-field/form-field.component.js +128 -139
  317. package/form-field/form-field-clear/form-field-clear.component.js +20 -22
  318. package/header/header/header.component.js +25 -28
  319. package/icon/icon-request.js +10 -11
  320. package/icon-sidebar-button-common-CM-ueEhH.js +7 -0
  321. package/image/image.component.js +4 -6
  322. package/map-container/map-container.component.js +1 -2
  323. package/menu/menu/menu.component.js +48 -56
  324. package/navigation/common/navigation-action-common.js +19 -21
  325. package/navigation/navigation/navigation.component.js +74 -93
  326. package/navigation/navigation-marker/navigation-marker.component.js +26 -28
  327. package/navigation/navigation-section/navigation-section.component.js +79 -89
  328. package/notification/notification.component.js +18 -20
  329. package/option/optgroup/optgroup-base-element.js +40 -42
  330. package/option/optgroup/optgroup.component.js +16 -20
  331. package/option/option/option-base-element.js +3 -4
  332. package/option/option/option.component.js +28 -31
  333. package/overlay/overlay-base-element.js +25 -27
  334. package/overlay/overlay.component.js +38 -40
  335. package/package.json +1 -1
  336. package/paginator/paginator/paginator.component.js +3 -4
  337. package/popover/popover/popover.component.d.ts.map +1 -1
  338. package/popover/popover/popover.component.js +65 -72
  339. package/popover/popover-trigger/popover-trigger.component.js +1 -1
  340. package/radio-button/common/radio-button-common.js +11 -15
  341. package/radio-button/radio-button/radio-button.component.js +20 -23
  342. package/radio-button/radio-button-group/radio-button-group.component.js +27 -43
  343. package/radio-button/radio-button-panel/radio-button-panel.component.js +31 -35
  344. package/select/select.component.js +89 -111
  345. package/selection-expansion-panel/selection-expansion-panel.component.js +35 -39
  346. package/sidebar/common.js +1 -1
  347. package/sidebar/icon-sidebar-container/icon-sidebar-container.component.js +10 -13
  348. package/sidebar/sidebar/sidebar.component.js +61 -68
  349. package/sidebar/sidebar-container/sidebar-container.component.js +29 -33
  350. package/sidebar/sidebar-title/sidebar-title.component.js +1 -1
  351. package/sidebar.js +1 -1
  352. package/slider/slider.component.js +3 -4
  353. package/standard-theme.css +0 -25
  354. package/status/status.component.js +17 -17
  355. package/stepper/step/step.component.js +22 -24
  356. package/stepper/step-label/step-label.component.js +2 -3
  357. package/stepper/stepper/stepper.component.js +72 -86
  358. package/table/table-wrapper/table-wrapper.component.js +13 -14
  359. package/table.css +0 -25
  360. package/tabs/tab-group/tab-group.component.js +77 -92
  361. package/tabs/tab-label/tab-label.component.js +10 -10
  362. package/tag/tag/tag.component.js +55 -61
  363. package/tag/tag-group/tag-group.component.js +21 -29
  364. package/teaser/teaser.component.js +1 -1
  365. package/teaser-product/common.js +1 -1
  366. package/teaser-product/teaser-product/teaser-product.component.js +1 -1
  367. package/teaser-product-common-C8oSkIxy.js +5 -0
  368. package/teaser-product.js +1 -1
  369. package/time-input/time-input.component.js +62 -66
  370. package/timetable-occupancy-icon/timetable-occupancy-icon.component.js +9 -10
  371. package/title/title-base.js +1 -1
  372. package/toast/toast.component.js +4 -7
  373. package/toggle/toggle/toggle.component.js +38 -42
  374. package/toggle/toggle-option/toggle-option.component.js +47 -54
  375. package/train/train-formation/train-formation.component.js +41 -43
  376. package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables.scss +0 -530
  377. package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables_css--mixin.scss +0 -1123
  378. package/icon-sidebar-button-common-DG8bnrBu.js +0 -7
  379. package/teaser-product-common-CpMAlYEp.js +0 -5
@@ -1,5 +1,5 @@
1
- const n = 7, D = 4, c = 4, g = 12, l = 24, u = /(^0?[1-9]?|[12]?[0-9]?|3?[01]?)[.,\\/\-\s](0?[1-9]?|1?[0-2]?)?[.,\\/\-\s](\d{1,4}$)?/, O = /^(\d{4})-(\d{2})-(\d{2})$/;
2
- class _ {
1
+ const h = 7, o = 4, D = 4, c = 12, g = 24, l = /(0?[1-9]|[12][0-9]|3[01])[.,\\/\-\s](0?[1-9]|1[0-2])[.,\\/\-\s]([0-9]{1,4}$)?/, u = /^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-3][0-9])$/;
2
+ class O {
3
3
  /**
4
4
  * Attempts to deserialize a value to a valid date object. This is different from parsing in that
5
5
  * deserialize should only accept non-ambiguous, locale-independent formats (e.g. a ISO 8601
@@ -19,23 +19,23 @@ class _ {
19
19
  format(t, e) {
20
20
  if (!this.isValid(t))
21
21
  return "";
22
- const r = /* @__PURE__ */ new Date(this.toIso8601(t) + "T00:00:00"), s = new Intl.DateTimeFormat("de-CH", {
22
+ const s = /* @__PURE__ */ new Date(this.toIso8601(t) + "T00:00:00"), i = new Intl.DateTimeFormat("de-CH", {
23
23
  day: "2-digit",
24
24
  month: "2-digit",
25
25
  year: "numeric"
26
26
  });
27
- if ((e == null ? void 0 : e.weekdayStyle) === "none")
28
- return s.format(r);
29
- const a = (e == null ? void 0 : e.weekdayStyle) ?? "short";
30
- let i = this.getDayOfWeekNames(a)[this.getDayOfWeek(t)];
31
- return i = i.charAt(0).toUpperCase() + i.substring(1), a === "short" && (i = i.substring(0, 2)), `${i}, ${s.format(r)}`;
27
+ if (e?.weekdayStyle === "none")
28
+ return i.format(s);
29
+ const a = e?.weekdayStyle ?? "short";
30
+ let r = this.getDayOfWeekNames(a)[this.getDayOfWeek(t)];
31
+ return r = r.charAt(0).toUpperCase() + r.substring(1), a === "short" && (r = r.substring(0, 2)), `${r}, ${i.format(s)}`;
32
32
  }
33
33
  /**
34
34
  * Get the given date as ISO String.
35
35
  * @param date The date to convert to ISO String.
36
36
  */
37
37
  toIso8601(t) {
38
- const e = (r, s = 2) => `${r}`.padStart(s, "0");
38
+ const e = (s, i = 2) => `${s}`.padStart(i, "0");
39
39
  return `${e(this.getYear(t), 4)}-${e(this.getMonth(t))}-${e(this.getDate(t))}`;
40
40
  }
41
41
  /**
@@ -73,8 +73,8 @@ class _ {
73
73
  */
74
74
  sameDate(t, e) {
75
75
  if (t && e) {
76
- const r = this.isValid(t), s = this.isValid(e);
77
- return r && s ? !this.compareDate(t, e) : r == s;
76
+ const s = this.isValid(t), i = this.isValid(e);
77
+ return s && i ? !this.compareDate(t, e) : s == i;
78
78
  }
79
79
  return t == e;
80
80
  }
@@ -86,17 +86,17 @@ class _ {
86
86
  * @returns `min` if `date` is less than `min`, `max` if date is greater than `max`,
87
87
  * otherwise `date`.
88
88
  */
89
- clampDate(t, e, r) {
90
- return e && this.compareDate(t, e) < 0 ? e : r && this.compareDate(t, r) > 0 ? r : t;
89
+ clampDate(t, e, s) {
90
+ return e && this.compareDate(t, e) < 0 ? e : s && this.compareDate(t, s) > 0 ? s : t;
91
91
  }
92
92
  }
93
93
  export {
94
- n as DAYS_PER_ROW,
95
- _ as DateAdapter,
96
- u as FORMAT_DATE,
97
- O as ISO8601_FORMAT_DATE,
98
- g as MONTHS_PER_PAGE,
99
- D as MONTHS_PER_ROW,
100
- l as YEARS_PER_PAGE,
101
- c as YEARS_PER_ROW
94
+ h as DAYS_PER_ROW,
95
+ O as DateAdapter,
96
+ l as FORMAT_DATE,
97
+ u as ISO8601_FORMAT_DATE,
98
+ c as MONTHS_PER_PAGE,
99
+ o as MONTHS_PER_ROW,
100
+ g as YEARS_PER_PAGE,
101
+ D as YEARS_PER_ROW
102
102
  };
@@ -1,4 +1,4 @@
1
- import { SbbLanguageController as o } from "../controllers.js";
1
+ import { SbbLanguageController as s } from "../controllers.js";
2
2
  import { DateAdapter as u, ISO8601_FORMAT_DATE as h, FORMAT_DATE as D } from "./date-adapter.js";
3
3
  const c = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;
4
4
  class f extends u {
@@ -28,7 +28,7 @@ class f extends u {
28
28
  month: "long",
29
29
  day: "numeric"
30
30
  };
31
- return new Intl.DateTimeFormat(o.current, t).format(new Date(e));
31
+ return new Intl.DateTimeFormat(s.current, t).format(new Date(e));
32
32
  }
33
33
  /**
34
34
  * Creates an array of strings with length = 12, filled with the name of the months starting from January, in the document language.
@@ -36,12 +36,12 @@ class f extends u {
36
36
  * E.g., with January in en-gb: `long` returns "January", `short` returns "Jan", `narrow` returns "J".
37
37
  */
38
38
  getMonthNames(e) {
39
- const t = new Intl.DateTimeFormat(o.current, { month: e });
39
+ const t = new Intl.DateTimeFormat(s.current, { month: e });
40
40
  return this._range(12, (r) => t.format(new Date(2017, r, 1)));
41
41
  }
42
42
  /** Creates a string array with length = 31, filled with the days in a month, starting from 1. */
43
43
  getDateNames() {
44
- const e = new Intl.DateTimeFormat(o.current, { day: "numeric" });
44
+ const e = new Intl.DateTimeFormat(s.current, { day: "numeric" });
45
45
  return this._range(31, (t) => e.format(new Date(2017, 0, t + 1)));
46
46
  }
47
47
  /**
@@ -50,7 +50,7 @@ class f extends u {
50
50
  * E.g., with Monday in en-gb: `long` returns "Monday", `short` returns "Mon", `narrow` returns "M".
51
51
  */
52
52
  getDayOfWeekNames(e) {
53
- const t = new Intl.DateTimeFormat(o.current, { weekday: e });
53
+ const t = new Intl.DateTimeFormat(s.current, { weekday: e });
54
54
  return this._range(7, (r) => t.format(new Date(2017, 0, r + 1)));
55
55
  }
56
56
  /* Defines which is the first day of the week (0: sunday; 1: monday; etc.). */
@@ -102,8 +102,8 @@ class f extends u {
102
102
  * E.g., with `date` = new Date(2022, 0, 31) and `months` = 1, it returns new Date(2022, 1, 28).
103
103
  */
104
104
  addCalendarMonths(e, t) {
105
- const r = e.getMonth() + t, n = new Date(e.getFullYear(), r, 1, 0, 0, 0, 0), s = this.getNumDaysInMonth(n);
106
- return new Date(this.clone(e).setMonth(r, Math.min(s, e.getDate())));
105
+ const r = e.getMonth() + t, n = new Date(e.getFullYear(), r, 1, 0, 0, 0, 0), l = this.getNumDaysInMonth(n);
106
+ return new Date(this.clone(e).setMonth(r, Math.min(l, e.getDate())));
107
107
  }
108
108
  /** Creates a new date by adding the number of provided `days` to the provided `date`. */
109
109
  addCalendarDays(e, t) {
@@ -135,13 +135,13 @@ class f extends u {
135
135
  }
136
136
  if (this.isValid(r))
137
137
  return r;
138
- const s = e.replace(/\D/g, " ").trim(), a = s == null ? void 0 : s.match(D);
139
- if (!a || a.index !== 0 || a.length <= 2 || a.some((l) => l === void 0) || !this.isValid(this.createDate(+a[3], +a[2], +a[1])))
138
+ const a = e.replace(/\D/g, " ").trim()?.match(D);
139
+ if (!a || a.index !== 0 || a.length <= 2 || a.some((o) => o === void 0) || !this.isValid(this.createDate(+a[3], +a[2], +a[1])))
140
140
  return null;
141
141
  let i = +a[3];
142
142
  if (typeof i == "number" && i < 100 && i >= 0) {
143
- const l = t.getFullYear() - 2e3 + this._cutoffYearOffset;
144
- i = i <= l ? 2e3 + i : 1900 + i;
143
+ const o = t.getFullYear() - 2e3 + this._cutoffYearOffset;
144
+ i = i <= o ? 2e3 + i : 1900 + i;
145
145
  }
146
146
  return new Date(i, +a[2] - 1, +a[1]);
147
147
  }
@@ -1,17 +1,15 @@
1
- import { readConfig as a } from "../config.js";
2
- import { defaultDateAdapter as d } from "../datetime.js";
3
- const n = {
4
- fromAttribute(r, o) {
5
- var e;
6
- const t = ((e = a().datetime) == null ? void 0 : e.dateAdapter) ?? d;
7
- return t.getValidDateOrNull(t.deserialize(r));
1
+ import { readConfig as r } from "../config.js";
2
+ import { defaultDateAdapter as a } from "../datetime.js";
3
+ const p = {
4
+ fromAttribute(e, d) {
5
+ const t = r().datetime?.dateAdapter ?? a;
6
+ return t.getValidDateOrNull(t.deserialize(e));
8
7
  },
9
- toAttribute(r, o) {
10
- var e;
11
- const t = ((e = a().datetime) == null ? void 0 : e.dateAdapter) ?? d;
12
- return t.isValid(r) ? t.toIso8601(r) : null;
8
+ toAttribute(e, d) {
9
+ const t = r().datetime?.dateAdapter ?? a;
10
+ return t.isValid(e) ? t.toIso8601(e) : null;
13
11
  }
14
12
  };
15
13
  export {
16
- n as dateConverter
14
+ p as dateConverter
17
15
  };
@@ -1,10 +1,9 @@
1
- import { readConfig as r } from "../config.js";
2
- import { defaultDateAdapter as n } from "../datetime.js";
3
- function i(e) {
4
- var a;
5
- const t = ((a = r().datetime) == null ? void 0 : a.dateAdapter) ?? n;
1
+ import { readConfig as a } from "../config.js";
2
+ import { defaultDateAdapter as r } from "../datetime.js";
3
+ function o(e) {
4
+ const t = a().datetime?.dateAdapter ?? r;
6
5
  return t.isDateInstance(e) && t.isValid(e) ? t.createDate(t.getYear(e), t.getMonth(e), t.getDate(e)) : null;
7
6
  }
8
7
  export {
9
- i as DateOnlyType
8
+ o as DateOnlyType
10
9
  };
@@ -1,7 +1,6 @@
1
- const p = (e) => (i, a) => {
2
- var l, s;
3
- const { kind: r, metadata: n, name: o } = a, u = ((s = (l = globalThis.litPropertyMetadata.get(n)) == null ? void 0 : l.get(o)) == null ? void 0 : s.type) ?? String;
4
- if (e ?? (e = u), e === String ? e = (t) => t == null ? "" : String(t) : e === Number && (e = (t) => t == null ? NaN : Number(t)), r === "accessor")
1
+ const o = (e) => (i, l) => {
2
+ const { kind: r, metadata: s, name: a } = l, n = globalThis.litPropertyMetadata.get(s)?.get(a)?.type ?? String;
3
+ if (e ??= n, e === String ? e = (t) => t == null ? "" : String(t) : e === Number && (e = (t) => t == null ? NaN : Number(t)), r === "accessor")
5
4
  return {
6
5
  set(t) {
7
6
  i.set.call(this, e(t));
@@ -14,5 +13,5 @@ const p = (e) => (i, a) => {
14
13
  throw new Error(`Unsupported decorator location: ${r}`);
15
14
  };
16
15
  export {
17
- p as forceType
16
+ o as forceType
18
17
  };
@@ -1,12 +1,12 @@
1
- import { isServer as l } from "lit";
2
- const b = ["zero", "micro", "small", "medium", "large", "wide", "ultra"];
3
- function $(e, i, n) {
4
- if (l)
1
+ import { isServer as d } from "lit";
2
+ const s = ["zero", "micro", "small", "medium", "large", "wide", "ultra"];
3
+ function u(n, i, a) {
4
+ if (d)
5
5
  return null;
6
- const m = getComputedStyle(document.documentElement), t = e ? m.getPropertyValue(`--sbb-breakpoint-${e}-min`) : "", a = i ? `${parseFloat(m.getPropertyValue(`--sbb-breakpoint-${i}-${n != null && n.includeMaxBreakpoint ? "max" : "min"}`)) - (n != null && n.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", o = t && `(min-width: ${t})`, c = a && `(max-width: ${a})`, d = t && a && " and ";
7
- return window.matchMedia(`${o}${d}${c}`).matches;
6
+ const o = getComputedStyle(document.documentElement), t = n ? o.getPropertyValue(`--sbb-breakpoint-${n}-min`) : "", e = i ? `${parseFloat(o.getPropertyValue(`--sbb-breakpoint-${i}-${a?.includeMaxBreakpoint ? "max" : "min"}`)) - (a?.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", r = t && `(min-width: ${t})`, m = e && `(max-width: ${e})`, c = t && e && " and ";
7
+ return window.matchMedia(`${r}${c}${m}`).matches;
8
8
  }
9
9
  export {
10
- b as breakpoints,
11
- $ as isBreakpoint
10
+ s as breakpoints,
11
+ u as isBreakpoint
12
12
  };
@@ -1,12 +1,7 @@
1
- import { findReferencedElement as u } from "./find-referenced-element.js";
2
- function t(f, r, n = "input") {
3
- var i;
4
- if (!r) {
5
- const o = (i = f.closest) == null ? void 0 : i.call(f, "sbb-form-field");
6
- return o == null ? void 0 : o.querySelector(n);
7
- }
8
- return u(r);
1
+ import { findReferencedElement as r } from "./find-referenced-element.js";
2
+ function i(n, e, t = "input") {
3
+ return e ? r(e) : n.closest?.("sbb-form-field")?.querySelector(t);
9
4
  }
10
5
  export {
11
- t as findInput
6
+ i as findInput
12
7
  };
@@ -4,8 +4,8 @@ const n = {
4
4
  composed: !0
5
5
  };
6
6
  class o {
7
- constructor(s, t, e = n) {
8
- this._element = s, this._eventName = t, this._options = e;
7
+ constructor(t, e, s = n) {
8
+ this._element = t, this._eventName = e, this._options = s;
9
9
  }
10
10
  /**
11
11
  * Dispatches an event.
@@ -13,9 +13,8 @@ class o {
13
13
  * @returns true when the event was successfully emitted or false,
14
14
  * if preventDefault() was called. Always returns true in SSR.
15
15
  */
16
- emit(s) {
17
- var t, e;
18
- return ((e = (t = this._element).dispatchEvent) == null ? void 0 : e.call(t, new CustomEvent(this._eventName, { ...this._options, detail: s }))) ?? !0;
16
+ emit(t) {
17
+ return this._element.dispatchEvent?.(new CustomEvent(this._eventName, { ...this._options, detail: t })) ?? !0;
19
18
  }
20
19
  }
21
20
  export {
@@ -1,19 +1,19 @@
1
- import { __esDecorate as b, __runInitializers as m } from "tslib";
2
- import { defaultConverter as k } from "lit";
3
- import { property as _ } from "lit/decorators.js";
4
- import { SbbLanguageController as v } from "../controllers.js";
5
- import { hostAttributes as y } from "../decorators.js";
6
- import { preventScrollOnSpacebarPress as g } from "../eventing.js";
7
- import { i18nCheckboxRequired as S } from "../i18n.js";
8
- import { SbbDisabledMixin as x } from "./disabled-mixin.js";
9
- import { SbbFormAssociatedMixin as C } from "./form-associated-mixin.js";
10
- import { SbbRequiredMixin as E } from "./required-mixin.js";
11
- const R = (p) => (() => {
12
- var a;
13
- let f = [y({
1
+ import { __esDecorate as h, __runInitializers as d } from "tslib";
2
+ import { defaultConverter as u } from "lit";
3
+ import { property as k } from "lit/decorators.js";
4
+ import { SbbLanguageController as p } from "../controllers.js";
5
+ import { hostAttributes as f } from "../decorators.js";
6
+ import { preventScrollOnSpacebarPress as _ } from "../eventing.js";
7
+ import { i18nCheckboxRequired as v } from "../i18n.js";
8
+ import { SbbDisabledMixin as y } from "./disabled-mixin.js";
9
+ import { SbbFormAssociatedMixin as g } from "./form-associated-mixin.js";
10
+ import { SbbRequiredMixin as S } from "./required-mixin.js";
11
+ const D = (b) => (() => {
12
+ var r;
13
+ let m = [f({
14
14
  tabindex: "0"
15
- })], o, l = [], r, c = x(E(C(p))), n = [], h;
16
- return a = class extends c {
15
+ })], s, o = [], i, l = y(S(g(b))), c = [], n;
16
+ return r = class extends l {
17
17
  /** Whether the checkbox is checked. */
18
18
  set checked(e) {
19
19
  const t = typeof e == "object" ? e.attribute : !1;
@@ -30,16 +30,14 @@ const R = (p) => (() => {
30
30
  return "checkbox";
31
31
  }
32
32
  constructor() {
33
- var e, t, i;
34
- super(), this._attributeMutationBlocked = (m(this, n), !1), this._languageController = new v(this), this._checked = !1, this._handleKeyboardInteraction = (s) => {
35
- s.key === " " && this._handleUserInteraction();
33
+ super(), this._attributeMutationBlocked = (d(this, c), !1), this._languageController = new p(this), this._checked = !1, this._handleKeyboardInteraction = (e) => {
34
+ e.key === " " && this._handleUserInteraction();
36
35
  }, this._handleUserInteraction = () => {
37
- var s;
38
- this.disabled || ((s = this.withUserInteraction) == null || s.call(this), this.checked = !this.checked, this._attributeMutationBlocked = !0, this.dispatchEvent(new InputEvent("input", { composed: !0, bubbles: !0 })), this.dispatchEvent(new Event("change", { bubbles: !0 })));
39
- }, this.internals.role = "checkbox", (e = this.addEventListener) == null || e.call(this, "click", this._handleUserInteraction), (t = this.addEventListener) == null || t.call(this, "keydown", g), (i = this.addEventListener) == null || i.call(this, "keyup", this._handleKeyboardInteraction);
36
+ this.disabled || (this.withUserInteraction?.(), this.checked = !this.checked, this._attributeMutationBlocked = !0, this.dispatchEvent(new InputEvent("input", { composed: !0, bubbles: !0 })), this.dispatchEvent(new Event("change", { bubbles: !0 })));
37
+ }, this.internals.role = "checkbox", this.addEventListener?.("click", this._handleUserInteraction), this.addEventListener?.("keydown", _), this.addEventListener?.("keyup", this._handleKeyboardInteraction);
40
38
  }
41
- attributeChangedCallback(e, t, i) {
42
- (e !== "checked" || !this._attributeMutationBlocked) && super.attributeChangedCallback(e, t, i);
39
+ attributeChangedCallback(e, t, a) {
40
+ (e !== "checked" || !this._attributeMutationBlocked) && super.attributeChangedCallback(e, t, a);
43
41
  }
44
42
  /**
45
43
  * Is called whenever the form is being reset.
@@ -68,25 +66,22 @@ const R = (p) => (() => {
68
66
  return super.shouldValidate(e) || e === "checked" || e === "required";
69
67
  }
70
68
  validate() {
71
- super.validate(), this.required && !this.checked ? this.setValidityFlag("valueMissing", S[this._languageController.current]) : this.removeValidityFlag("valueMissing");
69
+ super.validate(), this.required && !this.checked ? this.setValidityFlag("valueMissing", v[this._languageController.current]) : this.removeValidityFlag("valueMissing");
72
70
  }
73
- }, r = a, (() => {
74
- const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(c[Symbol.metadata] ?? null) : void 0;
75
- h = [_({
71
+ }, i = r, (() => {
72
+ const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(l[Symbol.metadata] ?? null) : void 0;
73
+ n = [k({
76
74
  type: Boolean,
77
75
  converter: {
78
- ...k,
76
+ ...u,
79
77
  // We need to pass information to the setter so that we know it was called by attribute change.
80
- fromAttribute: (t, i) => {
81
- var d, u;
82
- return { value: (u = (d = k).fromAttribute) == null ? void 0 : u.call(d, t, i), attribute: !0 };
83
- }
78
+ fromAttribute: (t, a) => ({ value: u.fromAttribute?.(t, a), attribute: !0 })
84
79
  }
85
- })], b(a, null, h, { kind: "setter", name: "checked", static: !1, private: !1, access: { has: (t) => "checked" in t, set: (t, i) => {
86
- t.checked = i;
87
- } }, metadata: e }, null, n), b(null, o = { value: r }, f, { kind: "class", name: r.name, metadata: e }, null, l), r = o.value, e && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e }), m(r, l);
88
- })(), r;
80
+ })], h(r, null, n, { kind: "setter", name: "checked", static: !1, private: !1, access: { has: (t) => "checked" in t, set: (t, a) => {
81
+ t.checked = a;
82
+ } }, metadata: e }, null, c), h(null, s = { value: i }, m, { kind: "class", name: i.name, metadata: e }, null, o), i = s.value, e && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e }), d(i, o);
83
+ })(), i;
89
84
  })();
90
85
  export {
91
- R as SbbFormAssociatedCheckboxMixin
86
+ D as SbbFormAssociatedCheckboxMixin
92
87
  };
@@ -1,21 +1,21 @@
1
- import { __esDecorate as o, __runInitializers as k } from "tslib";
2
- import { isServer as h, html as x } from "lit";
3
- import { property as u, eventOptions as O } from "lit/decorators.js";
4
- import { sbbInputModalityDetector as S } from "../a11y.js";
5
- import { SbbLanguageController as w } from "../controllers.js";
6
- import { isWebkit as A } from "../dom.js";
7
- import { i18nInputRequired as T } from "../i18n.js";
8
- import { SbbFormAssociatedMixin as L } from "./form-associated-mixin.js";
9
- import { SbbRequiredMixin as I } from "./required-mixin.js";
10
- const R = () => {
11
- if (h)
1
+ import { __esDecorate as r, __runInitializers as f } from "tslib";
2
+ import { isServer as d, html as b } from "lit";
3
+ import { property as l, eventOptions as g } from "lit/decorators.js";
4
+ import { sbbInputModalityDetector as m } from "../a11y.js";
5
+ import { SbbLanguageController as y } from "../controllers.js";
6
+ import { isWebkit as _ } from "../dom.js";
7
+ import { i18nInputRequired as v } from "../i18n.js";
8
+ import { SbbFormAssociatedMixin as C } from "./form-associated-mixin.js";
9
+ import { SbbRequiredMixin as E } from "./required-mixin.js";
10
+ const k = () => {
11
+ if (d)
12
12
  return !1;
13
- const d = document.createElement("div");
14
- return d.setAttribute("contenteditable", "PLAINTEXT-ONLY"), d.contentEditable === "plaintext-only";
15
- }, M = R(), z = (d) => (() => {
16
- var n;
17
- let c = I(L(d)), l = [], p, f, b, g;
18
- return n = class extends c {
13
+ const n = document.createElement("div");
14
+ return n.setAttribute("contenteditable", "PLAINTEXT-ONLY"), n.contentEditable === "plaintext-only";
15
+ }, x = k(), N = (n) => (() => {
16
+ var s;
17
+ let o = E(C(n)), a = [], u, h, c, p;
18
+ return s = class extends o {
19
19
  /**
20
20
  * Form type of element.
21
21
  * @default 'text'
@@ -61,55 +61,49 @@ const R = () => {
61
61
  return this.getAttribute("placeholder") ?? "";
62
62
  }
63
63
  constructor() {
64
- var e, t, a, m, y, _, v;
65
- super(), this._interacted = (k(this, l), !1), this._shouldEmitChange = !1, this._shouldTriggerSubmit = !1, this.language = new w(this), this.internals.role = "textbox", (e = this.addEventListener) == null || e.call(this, "input", () => {
64
+ super(), this._interacted = (f(this, a), !1), this._shouldEmitChange = !1, this._shouldTriggerSubmit = !1, this.language = new y(this), this.internals.role = "textbox", this.addEventListener?.("input", () => {
66
65
  super.value = this._cleanText(this.textContent ?? ""), this._interacted = !0, this._shouldEmitChange = !0;
67
- }, { capture: !0 }), (t = this.addEventListener) == null || t.call(this, "change", () => this._shouldEmitChange = !1, { capture: !0 }), (a = this.addEventListener) == null || a.call(this, "keydown", (i) => {
68
- var r;
69
- if ((i.key === "Enter" || i.key === `
70
- `) && i.isTrusted)
71
- i.preventDefault(), i.stopImmediatePropagation(), this._shouldTriggerSubmit = this.dispatchEvent(new KeyboardEvent("keydown", i));
72
- else if (A && this.value && (i.key === "Backspace" || i.key === "Delete") && i.isTrusted) {
73
- if (i.preventDefault(), i.stopImmediatePropagation(), !this.dispatchEvent(new KeyboardEvent("keydown", i)))
66
+ }, { capture: !0 }), this.addEventListener?.("change", () => this._shouldEmitChange = !1, { capture: !0 }), this.addEventListener?.("keydown", (e) => {
67
+ if ((e.key === "Enter" || e.key === `
68
+ `) && e.isTrusted)
69
+ e.preventDefault(), e.stopImmediatePropagation(), this._shouldTriggerSubmit = this.dispatchEvent(new KeyboardEvent("keydown", e));
70
+ else if (_ && this.value && (e.key === "Backspace" || e.key === "Delete") && e.isTrusted) {
71
+ if (e.preventDefault(), e.stopImmediatePropagation(), !this.dispatchEvent(new KeyboardEvent("keydown", e)))
74
72
  return;
75
- const s = (r = window.getSelection()) == null ? void 0 : r.getRangeAt(0);
76
- if (!s)
73
+ const t = window.getSelection()?.getRangeAt(0);
74
+ if (!t)
77
75
  return;
78
- s.startOffset !== s.endOffset ? (s.deleteContents(), this._dispatchInputEvent()) : i.key === "Backspace" && s.startOffset > 0 ? (s.setStart(s.startContainer, s.startOffset - 1), s.deleteContents(), this._dispatchInputEvent()) : i.key === "Delete" && s.endOffset < this.value.length && (s.setEnd(s.endContainer, s.endOffset + 1), s.deleteContents(), this._dispatchInputEvent());
76
+ t.startOffset !== t.endOffset ? (t.deleteContents(), this._dispatchInputEvent()) : e.key === "Backspace" && t.startOffset > 0 ? (t.setStart(t.startContainer, t.startOffset - 1), t.deleteContents(), this._dispatchInputEvent()) : e.key === "Delete" && t.endOffset < this.value.length && (t.setEnd(t.endContainer, t.endOffset + 1), t.deleteContents(), this._dispatchInputEvent());
79
77
  }
80
- }, { capture: !0 }), (m = this.addEventListener) == null || m.call(this, "keyup", (i) => {
81
- var r;
82
- (i.key === "Enter" || i.key === `
83
- `) && (this._emitChangeIfNecessary(), this._shouldTriggerSubmit && (this._shouldTriggerSubmit = !1, (r = this.form) == null || r.requestSubmit()));
84
- }, { capture: !0 }), (y = this.addEventListener) == null || y.call(this, "paste", (i) => {
85
- var C, E;
86
- i.preventDefault();
87
- const r = this._cleanText(((C = i.clipboardData) == null ? void 0 : C.getData("text/plain")) ?? ""), s = (E = window.getSelection()) == null ? void 0 : E.getRangeAt(0);
88
- !s || !r || (s.deleteContents(), s.insertNode(document.createTextNode(r)), s.setStart(s.endContainer, s.endOffset), this._dispatchInputEvent());
89
- }), (_ = this.addEventListener) == null || _.call(this, "focus", () => {
90
- var i;
91
- S.mostRecentModality === "keyboard" && ((i = window.getSelection()) == null || i.selectAllChildren(this));
92
- }), (v = this.addEventListener) == null || v.call(this, "blur", () => {
93
- var i;
94
- (i = window.getSelection()) == null || i.removeAllRanges(), this._emitChangeIfNecessary(), this.scrollLeft = 0;
78
+ }, { capture: !0 }), this.addEventListener?.("keyup", (e) => {
79
+ (e.key === "Enter" || e.key === `
80
+ `) && (this._emitChangeIfNecessary(), this._shouldTriggerSubmit && (this._shouldTriggerSubmit = !1, this.form?.requestSubmit()));
81
+ }, { capture: !0 }), this.addEventListener?.("paste", (e) => {
82
+ e.preventDefault();
83
+ const t = this._cleanText(e.clipboardData?.getData("text/plain") ?? ""), i = window.getSelection()?.getRangeAt(0);
84
+ !i || !t || (i.deleteContents(), i.insertNode(document.createTextNode(t)), i.setStart(i.endContainer, i.endOffset), this._dispatchInputEvent());
85
+ }), this.addEventListener?.("focus", () => {
86
+ m.mostRecentModality === "keyboard" && window.getSelection()?.selectAllChildren(this);
87
+ }), this.addEventListener?.("blur", () => {
88
+ window.getSelection()?.removeAllRanges(), this._emitChangeIfNecessary(), this.scrollLeft = 0;
95
89
  }, { capture: !0 });
96
90
  }
97
91
  connectedCallback() {
98
92
  super.connectedCallback(), this.internals.ariaMultiLine = "false", this._updateContenteditable(), this.innerHTML = this.value;
99
93
  }
100
94
  focus(e) {
101
- if (super.focus(e), !h && !this.disabled && !this.readOnly && this.value) {
95
+ if (super.focus(e), !d && !this.disabled && !this.readOnly && this.value) {
102
96
  const t = window.getSelection();
103
97
  if (!t)
104
98
  return;
105
- let a = t.rangeCount > 0 ? t.getRangeAt(0) : null;
106
- if (a && a.startOffset !== 0)
99
+ let i = t.rangeCount > 0 ? t.getRangeAt(0) : null;
100
+ if (i && i.startOffset !== 0)
107
101
  return;
108
- a = document.createRange(), a.setStart(this.firstChild, this.textContent.length), a.collapse(!0), t.removeAllRanges(), t.addRange(a);
102
+ i = document.createRange(), i.setStart(this.firstChild, this.textContent.length), i.collapse(!0), t.removeAllRanges(), t.addRange(i);
109
103
  }
110
104
  }
111
- attributeChangedCallback(e, t, a) {
112
- (e !== "value" || !this._interacted) && super.attributeChangedCallback(e, t, a);
105
+ attributeChangedCallback(e, t, i) {
106
+ (e !== "value" || !this._interacted) && super.attributeChangedCallback(e, t, i);
113
107
  }
114
108
  /**
115
109
  * Is called whenever the form is being reset.
@@ -141,7 +135,7 @@ const R = () => {
141
135
  return super.shouldValidate(e) || e === "value" || e === "required";
142
136
  }
143
137
  validate() {
144
- super.validate(), this.required && !this.value ? this.setValidityFlag("valueMissing", T[this.language.current]) : this.removeValidityFlag("valueMissing");
138
+ super.validate(), this.required && !this.value ? this.setValidityFlag("valueMissing", v[this.language.current]) : this.removeValidityFlag("valueMissing");
145
139
  }
146
140
  _cleanText(e) {
147
141
  return e === null ? "" : `${e}`.replace(/[\n\r]+/g, "");
@@ -155,8 +149,8 @@ const R = () => {
155
149
  e.remove();
156
150
  }
157
151
  _updateContenteditable() {
158
- if (!h && this.isConnected) {
159
- const e = this.disabled || this.readOnly ? "false" : M ? "plaintext-only" : "true";
152
+ if (!d && this.isConnected) {
153
+ const e = this.disabled || this.readOnly ? "false" : x ? "plaintext-only" : "true";
160
154
  this.setAttribute("contenteditable", e), this.readOnly ? this.setAttribute("tabindex", "0") : this.removeAttribute("tabindex");
161
155
  }
162
156
  }
@@ -164,19 +158,19 @@ const R = () => {
164
158
  this._shouldEmitChange && (this._shouldEmitChange = !1, this.dispatchEvent(new Event("change", { bubbles: !0 })));
165
159
  }
166
160
  render() {
167
- return x`<slot @slotchange=${this._cleanChildren}></slot>`;
161
+ return b`<slot @slotchange=${this._cleanChildren}></slot>`;
168
162
  }
169
163
  }, (() => {
170
- const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(c[Symbol.metadata] ?? null) : void 0;
171
- p = [u({ type: Boolean })], f = [u({ type: Boolean })], b = [u({ attribute: !1 })], g = [O({ passive: !0 })], o(n, null, p, { kind: "setter", name: "readOnly", static: !1, private: !1, access: { has: (t) => "readOnly" in t, set: (t, a) => {
172
- t.readOnly = a;
173
- } }, metadata: e }, null, l), o(n, null, f, { kind: "setter", name: "disabled", static: !1, private: !1, access: { has: (t) => "disabled" in t, set: (t, a) => {
174
- t.disabled = a;
175
- } }, metadata: e }, null, l), o(n, null, b, { kind: "setter", name: "placeholder", static: !1, private: !1, access: { has: (t) => "placeholder" in t, set: (t, a) => {
176
- t.placeholder = a;
177
- } }, metadata: e }, null, l), o(n, null, g, { kind: "method", name: "_cleanChildren", static: !1, private: !1, access: { has: (t) => "_cleanChildren" in t, get: (t) => t._cleanChildren }, metadata: e }, null, l), e && Object.defineProperty(n, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
178
- })(), n;
164
+ const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
165
+ u = [l({ type: Boolean })], h = [l({ type: Boolean })], c = [l({ attribute: !1 })], p = [g({ passive: !0 })], r(s, null, u, { kind: "setter", name: "readOnly", static: !1, private: !1, access: { has: (t) => "readOnly" in t, set: (t, i) => {
166
+ t.readOnly = i;
167
+ } }, metadata: e }, null, a), r(s, null, h, { kind: "setter", name: "disabled", static: !1, private: !1, access: { has: (t) => "disabled" in t, set: (t, i) => {
168
+ t.disabled = i;
169
+ } }, metadata: e }, null, a), r(s, null, c, { kind: "setter", name: "placeholder", static: !1, private: !1, access: { has: (t) => "placeholder" in t, set: (t, i) => {
170
+ t.placeholder = i;
171
+ } }, metadata: e }, null, a), r(s, null, p, { kind: "method", name: "_cleanChildren", static: !1, private: !1, access: { has: (t) => "_cleanChildren" in t, get: (t) => t._cleanChildren }, metadata: e }, null, a), e && Object.defineProperty(s, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
172
+ })(), s;
179
173
  })();
180
174
  export {
181
- z as SbbFormAssociatedInputMixin
175
+ N as SbbFormAssociatedInputMixin
182
176
  };