@six-group/ui-library 3.0.0-beta.1.7 → 3.0.0-beta.1.8

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 (367) hide show
  1. package/dist/cjs/{event-listeners-4a8d66d5.js → event-listeners-74715e62.js} +38 -38
  2. package/dist/cjs/{execution-control-3bc9c7c4.js → execution-control-46f388e0.js} +35 -35
  3. package/dist/cjs/{focus-visible-b08d956f.js → focus-visible-0b352c74.js} +40 -40
  4. package/dist/cjs/{form-control-9e4dffd1.js → form-control-866bbece.js} +25 -25
  5. package/dist/cjs/{modal-a9679ddf.js → modal-48d42228.js} +41 -41
  6. package/dist/cjs/{popover-e3781f5a.js → popover-1d2a037c.js} +95 -95
  7. package/dist/cjs/{scroll-5b8676ba.js → scroll-76e6f5d7.js} +57 -57
  8. package/dist/cjs/set-attributes_2.cjs.entry.js +57 -57
  9. package/dist/cjs/six-alert.cjs.entry.js +131 -131
  10. package/dist/cjs/six-avatar.cjs.entry.js +28 -28
  11. package/dist/cjs/six-badge.cjs.entry.js +26 -26
  12. package/dist/cjs/six-button.cjs.entry.js +97 -97
  13. package/dist/cjs/six-card.cjs.entry.js +8 -8
  14. package/dist/cjs/six-checkbox.cjs.entry.js +152 -152
  15. package/dist/cjs/six-datepicker.cjs.entry.js +1189 -1189
  16. package/dist/cjs/six-details.cjs.entry.js +139 -139
  17. package/dist/cjs/six-dialog.cjs.entry.js +152 -152
  18. package/dist/cjs/six-drawer.cjs.entry.js +174 -174
  19. package/dist/cjs/six-dropdown_3.cjs.entry.js +728 -728
  20. package/dist/cjs/six-error-page.cjs.entry.js +94 -94
  21. package/dist/cjs/six-file-list-item.cjs.entry.js +38 -38
  22. package/dist/cjs/six-file-list.cjs.entry.js +8 -8
  23. package/dist/cjs/six-file-upload.cjs.entry.js +96 -96
  24. package/dist/cjs/six-footer.cjs.entry.js +8 -8
  25. package/dist/cjs/six-form.cjs.entry.js +219 -219
  26. package/dist/cjs/six-group-label.cjs.entry.js +46 -46
  27. package/dist/cjs/six-header.cjs.entry.js +149 -149
  28. package/dist/cjs/six-icon-button.cjs.entry.js +33 -33
  29. package/dist/cjs/six-icon.cjs.entry.js +24 -24
  30. package/dist/cjs/six-input.cjs.entry.js +230 -230
  31. package/dist/cjs/six-item-picker.cjs.entry.js +361 -361
  32. package/dist/cjs/six-language-switcher.cjs.entry.js +52 -52
  33. package/dist/cjs/six-layout-grid.cjs.entry.js +19 -19
  34. package/dist/cjs/six-main-container.cjs.entry.js +11 -11
  35. package/dist/cjs/six-menu-divider.cjs.entry.js +8 -8
  36. package/dist/cjs/six-menu-label.cjs.entry.js +8 -8
  37. package/dist/cjs/six-picto.cjs.entry.js +15 -15
  38. package/dist/cjs/six-progress-bar.cjs.entry.js +17 -17
  39. package/dist/cjs/six-progress-ring.cjs.entry.js +31 -31
  40. package/dist/cjs/six-radio.cjs.entry.js +121 -121
  41. package/dist/cjs/six-range.cjs.entry.js +198 -198
  42. package/dist/cjs/six-root.cjs.entry.js +34 -34
  43. package/dist/cjs/six-search-field.cjs.entry.js +43 -43
  44. package/dist/cjs/six-select.cjs.entry.js +447 -447
  45. package/dist/cjs/six-sidebar-item-group.cjs.entry.js +42 -42
  46. package/dist/cjs/six-sidebar-item.cjs.entry.js +18 -18
  47. package/dist/cjs/six-sidebar.cjs.entry.js +171 -171
  48. package/dist/cjs/six-spinner.cjs.entry.js +16 -16
  49. package/dist/cjs/six-switch.cjs.entry.js +100 -100
  50. package/dist/cjs/six-tab-group.cjs.entry.js +226 -226
  51. package/dist/cjs/six-tab-panel.cjs.entry.js +17 -17
  52. package/dist/cjs/six-tab.cjs.entry.js +42 -42
  53. package/dist/cjs/six-table-cell_4.cjs.entry.js +70 -70
  54. package/dist/cjs/six-table.cjs.entry.js +145 -145
  55. package/dist/cjs/six-tag.cjs.entry.js +40 -40
  56. package/dist/cjs/six-textarea.cjs.entry.js +211 -211
  57. package/dist/cjs/six-tile.cjs.entry.js +89 -89
  58. package/dist/cjs/six-timepicker.cjs.entry.js +489 -489
  59. package/dist/cjs/{six-timepicker.types-c58cc88b.js → six-timepicker.types-c19ebff3.js} +43 -43
  60. package/dist/cjs/six-tooltip.cjs.entry.js +172 -172
  61. package/dist/cjs/{slot-8abe833c.js → slot-ad537f24.js} +42 -42
  62. package/dist/cjs/{types-65e5c95b.js → types-581e8ff0.js} +12 -12
  63. package/dist/cjs/{types-0c28e484.js → types-64878648.js} +12 -12
  64. package/dist/collection/components/six-alert/six-alert.js +366 -366
  65. package/dist/collection/components/six-avatar/six-avatar.js +131 -131
  66. package/dist/collection/components/six-badge/six-badge.js +101 -101
  67. package/dist/collection/components/six-button/six-button.js +466 -466
  68. package/dist/collection/components/six-card/six-card.js +21 -21
  69. package/dist/collection/components/six-checkbox/six-checkbox.js +550 -550
  70. package/dist/collection/components/six-datepicker/components/day-selection.js +13 -13
  71. package/dist/collection/components/six-datepicker/components/month-selection.js +12 -12
  72. package/dist/collection/components/six-datepicker/components/year-selection.js +10 -10
  73. package/dist/collection/components/six-datepicker/six-date-formats.js +23 -23
  74. package/dist/collection/components/six-datepicker/six-datepicker.js +1343 -1343
  75. package/dist/collection/components/six-datepicker/test/six-datepicker.test-helpers.js +16 -16
  76. package/dist/collection/components/six-details/six-details.js +432 -432
  77. package/dist/collection/components/six-dialog/six-dialog.js +401 -401
  78. package/dist/collection/components/six-drawer/six-drawer.js +458 -458
  79. package/dist/collection/components/six-dropdown/six-dropdown.js +939 -939
  80. package/dist/collection/components/six-error-page/six-error-page.js +199 -199
  81. package/dist/collection/components/six-file-list/six-file-list.js +20 -20
  82. package/dist/collection/components/six-file-list-item/six-file-list-item.js +203 -203
  83. package/dist/collection/components/six-file-upload/six-file-upload.js +272 -272
  84. package/dist/collection/components/six-footer/six-footer.js +21 -21
  85. package/dist/collection/components/six-form/six-form.js +408 -408
  86. package/dist/collection/components/six-group-label/six-group-label.js +166 -166
  87. package/dist/collection/components/six-header/six-header.js +420 -420
  88. package/dist/collection/components/six-icon/six-icon.js +77 -77
  89. package/dist/collection/components/six-icon-button/six-icon-button.js +142 -142
  90. package/dist/collection/components/six-input/six-input.js +1141 -1141
  91. package/dist/collection/components/six-item-picker/six-item-picker.js +688 -688
  92. package/dist/collection/components/six-item-picker/types.js +13 -13
  93. package/dist/collection/components/six-language-switcher/six-language-switcher.js +128 -128
  94. package/dist/collection/components/six-layout-grid/six-layout-grid.js +52 -52
  95. package/dist/collection/components/six-main-container/six-main-container.js +53 -53
  96. package/dist/collection/components/six-menu/six-menu.js +406 -406
  97. package/dist/collection/components/six-menu-divider/six-menu-divider.js +22 -22
  98. package/dist/collection/components/six-menu-item/six-menu-item.js +177 -177
  99. package/dist/collection/components/six-menu-label/six-menu-label.js +25 -25
  100. package/dist/collection/components/six-picto/six-picto.js +50 -50
  101. package/dist/collection/components/six-progress-bar/six-progress-bar.js +77 -77
  102. package/dist/collection/components/six-progress-ring/six-progress-ring.js +111 -111
  103. package/dist/collection/components/six-radio/six-radio.js +410 -410
  104. package/dist/collection/components/six-range/six-range.js +620 -620
  105. package/dist/collection/components/six-root/six-root.js +167 -167
  106. package/dist/collection/components/six-search-field/six-search-field.js +171 -171
  107. package/dist/collection/components/six-select/six-select.js +1105 -1105
  108. package/dist/collection/components/six-sidebar/six-sidebar.js +455 -455
  109. package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +89 -89
  110. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js +158 -158
  111. package/dist/collection/components/six-spinner/six-spinner.js +55 -55
  112. package/dist/collection/components/six-stage-indicator/six-stage-indicator.js +46 -46
  113. package/dist/collection/components/six-switch/six-switch.js +393 -393
  114. package/dist/collection/components/six-tab/six-tab.js +198 -198
  115. package/dist/collection/components/six-tab-group/six-tab-group.js +362 -362
  116. package/dist/collection/components/six-tab-panel/six-tab-panel.js +75 -75
  117. package/dist/collection/components/six-table/six-table.js +209 -209
  118. package/dist/collection/components/six-table/test/helpers.js +13 -13
  119. package/dist/collection/components/six-table/types.js +8 -8
  120. package/dist/collection/components/six-table/util/filter-by.js +34 -34
  121. package/dist/collection/components/six-table/util/from-data.js +33 -33
  122. package/dist/collection/components/six-table/util/is.js +3 -3
  123. package/dist/collection/components/six-table/util/quick-filter-by.js +13 -13
  124. package/dist/collection/components/six-table/util/sort-by.js +25 -25
  125. package/dist/collection/components/six-table-cell/six-table-cell.js +21 -21
  126. package/dist/collection/components/six-table-header/six-table-header.js +21 -21
  127. package/dist/collection/components/six-table-header-cell/get-next-state.js +7 -7
  128. package/dist/collection/components/six-table-header-cell/icons.js +12 -12
  129. package/dist/collection/components/six-table-header-cell/six-table-header-cell.js +174 -174
  130. package/dist/collection/components/six-table-header-cell/types.js +13 -13
  131. package/dist/collection/components/six-table-header-cell/util/create-model.js +6 -6
  132. package/dist/collection/components/six-table-header-cell/util/get-next-state.js +7 -7
  133. package/dist/collection/components/six-table-row/six-table-row.js +21 -21
  134. package/dist/collection/components/six-tag/six-tag.js +157 -157
  135. package/dist/collection/components/six-textarea/six-textarea.js +912 -912
  136. package/dist/collection/components/six-tile/six-tile.js +315 -315
  137. package/dist/collection/components/six-timepicker/six-time-format.js +14 -14
  138. package/dist/collection/components/six-timepicker/six-timepicker.js +980 -980
  139. package/dist/collection/components/six-timepicker/six-timepicker.types.js +40 -40
  140. package/dist/collection/components/six-tooltip/six-tooltip.js +435 -435
  141. package/dist/collection/functional-components/form-control/form-control.js +28 -28
  142. package/dist/collection/index.js +1 -1
  143. package/dist/collection/testUtil/delay.js +3 -3
  144. package/dist/collection/utils/as-array.js +1 -1
  145. package/dist/collection/utils/date-util.js +712 -712
  146. package/dist/collection/utils/event-listeners.js +39 -39
  147. package/dist/collection/utils/execution-control.js +38 -38
  148. package/dist/collection/utils/focus-visible.js +41 -41
  149. package/dist/collection/utils/matchers.js +2 -2
  150. package/dist/collection/utils/modal.js +28 -28
  151. package/dist/collection/utils/offset.js +13 -13
  152. package/dist/collection/utils/popover.js +113 -113
  153. package/dist/collection/utils/scroll.js +47 -47
  154. package/dist/collection/utils/slot.js +59 -59
  155. package/dist/collection/utils/support.js +15 -15
  156. package/dist/collection/utils/tabbable.js +22 -22
  157. package/dist/collection/utils/testing.js +38 -38
  158. package/dist/collection/utils/time.util.js +74 -74
  159. package/dist/collection/utils/type-check.js +5 -5
  160. package/dist/collection/utils/types.js +1 -1
  161. package/dist/collection/wrappers/set-attributes/set-attributes.js +68 -68
  162. package/dist/components.json +1 -1
  163. package/dist/custom-elements/index.js +7595 -7595
  164. package/dist/esm/{event-listeners-1bef934e.js → event-listeners-570a24ea.js} +38 -38
  165. package/dist/esm/{execution-control-235f5126.js → execution-control-1a60d709.js} +35 -35
  166. package/dist/esm/{focus-visible-4b7946aa.js → focus-visible-97933ea9.js} +40 -40
  167. package/dist/esm/{form-control-17478ad2.js → form-control-24f446af.js} +25 -25
  168. package/dist/esm/{modal-e5709f6b.js → modal-5ebdc320.js} +41 -41
  169. package/dist/esm/polyfills/core-js.js +0 -0
  170. package/dist/esm/polyfills/dom.js +0 -0
  171. package/dist/esm/polyfills/es5-html-element.js +0 -0
  172. package/dist/esm/polyfills/index.js +0 -0
  173. package/dist/esm/polyfills/system.js +0 -0
  174. package/dist/esm/{popover-5a51f84d.js → popover-1c7a1139.js} +95 -95
  175. package/dist/esm/{scroll-99b214c2.js → scroll-180b53fd.js} +57 -57
  176. package/dist/esm/set-attributes_2.entry.js +57 -57
  177. package/dist/esm/six-alert.entry.js +131 -131
  178. package/dist/esm/six-avatar.entry.js +28 -28
  179. package/dist/esm/six-badge.entry.js +26 -26
  180. package/dist/esm/six-button.entry.js +97 -97
  181. package/dist/esm/six-card.entry.js +8 -8
  182. package/dist/esm/six-checkbox.entry.js +152 -152
  183. package/dist/esm/six-datepicker.entry.js +1189 -1189
  184. package/dist/esm/six-details.entry.js +139 -139
  185. package/dist/esm/six-dialog.entry.js +152 -152
  186. package/dist/esm/six-drawer.entry.js +174 -174
  187. package/dist/esm/six-dropdown_3.entry.js +728 -728
  188. package/dist/esm/six-error-page.entry.js +94 -94
  189. package/dist/esm/six-file-list-item.entry.js +38 -38
  190. package/dist/esm/six-file-list.entry.js +8 -8
  191. package/dist/esm/six-file-upload.entry.js +96 -96
  192. package/dist/esm/six-footer.entry.js +8 -8
  193. package/dist/esm/six-form.entry.js +219 -219
  194. package/dist/esm/six-group-label.entry.js +46 -46
  195. package/dist/esm/six-header.entry.js +149 -149
  196. package/dist/esm/six-icon-button.entry.js +33 -33
  197. package/dist/esm/six-icon.entry.js +24 -24
  198. package/dist/esm/six-input.entry.js +230 -230
  199. package/dist/esm/six-item-picker.entry.js +361 -361
  200. package/dist/esm/six-language-switcher.entry.js +52 -52
  201. package/dist/esm/six-layout-grid.entry.js +19 -19
  202. package/dist/esm/six-main-container.entry.js +11 -11
  203. package/dist/esm/six-menu-divider.entry.js +8 -8
  204. package/dist/esm/six-menu-label.entry.js +8 -8
  205. package/dist/esm/six-picto.entry.js +15 -15
  206. package/dist/esm/six-progress-bar.entry.js +17 -17
  207. package/dist/esm/six-progress-ring.entry.js +31 -31
  208. package/dist/esm/six-radio.entry.js +121 -121
  209. package/dist/esm/six-range.entry.js +198 -198
  210. package/dist/esm/six-root.entry.js +34 -34
  211. package/dist/esm/six-search-field.entry.js +43 -43
  212. package/dist/esm/six-select.entry.js +447 -447
  213. package/dist/esm/six-sidebar-item-group.entry.js +42 -42
  214. package/dist/esm/six-sidebar-item.entry.js +18 -18
  215. package/dist/esm/six-sidebar.entry.js +171 -171
  216. package/dist/esm/six-spinner.entry.js +16 -16
  217. package/dist/esm/six-switch.entry.js +100 -100
  218. package/dist/esm/six-tab-group.entry.js +226 -226
  219. package/dist/esm/six-tab-panel.entry.js +17 -17
  220. package/dist/esm/six-tab.entry.js +42 -42
  221. package/dist/esm/six-table-cell_4.entry.js +70 -70
  222. package/dist/esm/six-table.entry.js +145 -145
  223. package/dist/esm/six-tag.entry.js +40 -40
  224. package/dist/esm/six-textarea.entry.js +211 -211
  225. package/dist/esm/six-tile.entry.js +89 -89
  226. package/dist/esm/six-timepicker.entry.js +489 -489
  227. package/dist/esm/{six-timepicker.types-cd6bac03.js → six-timepicker.types-e161a447.js} +43 -43
  228. package/dist/esm/six-tooltip.entry.js +172 -172
  229. package/dist/esm/{slot-5253e199.js → slot-6f3984c7.js} +42 -42
  230. package/dist/esm/{types-a37c1695.js → types-4b10b413.js} +12 -12
  231. package/dist/esm/{types-33d15673.js → types-ed860f7c.js} +12 -12
  232. package/dist/types/components/six-alert/six-alert.d.ts +60 -60
  233. package/dist/types/components/six-avatar/six-avatar.d.ts +27 -27
  234. package/dist/types/components/six-badge/six-badge.d.ts +20 -20
  235. package/dist/types/components/six-button/six-button.d.ts +69 -69
  236. package/dist/types/components/six-card/six-card.d.ts +9 -9
  237. package/dist/types/components/six-checkbox/six-checkbox.d.ts +86 -86
  238. package/dist/types/components/six-datepicker/components/day-selection.d.ts +5 -5
  239. package/dist/types/components/six-datepicker/components/month-selection.d.ts +5 -5
  240. package/dist/types/components/six-datepicker/components/year-selection.d.ts +5 -5
  241. package/dist/types/components/six-datepicker/six-date-formats.d.ts +22 -22
  242. package/dist/types/components/six-datepicker/six-datepicker.d.ts +214 -214
  243. package/dist/types/components/six-datepicker/test/six-datepicker.test-helpers.d.ts +1 -1
  244. package/dist/types/components/six-details/six-details.d.ts +61 -61
  245. package/dist/types/components/six-dialog/six-dialog.d.ts +75 -75
  246. package/dist/types/components/six-drawer/six-drawer.d.ts +82 -82
  247. package/dist/types/components/six-dropdown/six-dropdown.d.ts +140 -140
  248. package/dist/types/components/six-error-page/six-error-page.d.ts +27 -27
  249. package/dist/types/components/six-file-list/six-file-list.d.ts +8 -8
  250. package/dist/types/components/six-file-list-item/six-file-list-item.d.ts +35 -35
  251. package/dist/types/components/six-file-upload/six-file-upload.d.ts +42 -42
  252. package/dist/types/components/six-footer/six-footer.d.ts +9 -9
  253. package/dist/types/components/six-form/six-form.d.ts +69 -69
  254. package/dist/types/components/six-group-label/six-group-label.d.ts +37 -37
  255. package/dist/types/components/six-header/six-header.d.ts +90 -90
  256. package/dist/types/components/six-icon/six-icon.d.ts +13 -13
  257. package/dist/types/components/six-icon-button/six-icon-button.d.ts +28 -28
  258. package/dist/types/components/six-input/six-input.d.ts +165 -165
  259. package/dist/types/components/six-item-picker/six-item-picker.d.ts +106 -106
  260. package/dist/types/components/six-item-picker/types.d.ts +11 -11
  261. package/dist/types/components/six-language-switcher/six-language-switcher.d.ts +25 -25
  262. package/dist/types/components/six-layout-grid/six-layout-grid.d.ts +14 -14
  263. package/dist/types/components/six-main-container/six-main-container.d.ts +16 -16
  264. package/dist/types/components/six-menu/six-menu.d.ts +81 -81
  265. package/dist/types/components/six-menu-divider/six-menu-divider.d.ts +11 -11
  266. package/dist/types/components/six-menu-item/six-menu-item.d.ts +36 -36
  267. package/dist/types/components/six-menu-label/six-menu-label.d.ts +13 -13
  268. package/dist/types/components/six-picto/six-picto.d.ts +14 -14
  269. package/dist/types/components/six-progress-bar/six-progress-bar.d.ts +19 -19
  270. package/dist/types/components/six-progress-ring/six-progress-ring.d.ts +24 -24
  271. package/dist/types/components/six-radio/six-radio.d.ts +66 -66
  272. package/dist/types/components/six-range/six-range.d.ts +101 -101
  273. package/dist/types/components/six-root/six-root.d.ts +34 -34
  274. package/dist/types/components/six-search-field/six-search-field.d.ts +32 -32
  275. package/dist/types/components/six-select/six-select.d.ts +163 -163
  276. package/dist/types/components/six-sidebar/six-sidebar.d.ts +55 -55
  277. package/dist/types/components/six-sidebar-item/six-sidebar-item.d.ts +15 -15
  278. package/dist/types/components/six-sidebar-item-group/six-sidebar-item-group.d.ts +26 -26
  279. package/dist/types/components/six-spinner/six-spinner.d.ts +15 -15
  280. package/dist/types/components/six-stage-indicator/six-stage-indicator.d.ts +6 -6
  281. package/dist/types/components/six-switch/six-switch.d.ts +62 -62
  282. package/dist/types/components/six-tab/six-tab.d.ts +35 -35
  283. package/dist/types/components/six-tab-group/six-tab-group.d.ts +62 -62
  284. package/dist/types/components/six-tab-panel/six-tab-panel.d.ts +19 -19
  285. package/dist/types/components/six-table/six-table.d.ts +30 -30
  286. package/dist/types/components/six-table/test/helpers.d.ts +2 -2
  287. package/dist/types/components/six-table/types.d.ts +33 -33
  288. package/dist/types/components/six-table/util/filter-by.d.ts +2 -2
  289. package/dist/types/components/six-table/util/from-data.d.ts +8 -8
  290. package/dist/types/components/six-table/util/is.d.ts +3 -3
  291. package/dist/types/components/six-table/util/quick-filter-by.d.ts +2 -2
  292. package/dist/types/components/six-table/util/sort-by.d.ts +2 -2
  293. package/dist/types/components/six-table-cell/six-table-cell.d.ts +9 -9
  294. package/dist/types/components/six-table-header/six-table-header.d.ts +9 -9
  295. package/dist/types/components/six-table-header-cell/get-next-state.d.ts +2 -2
  296. package/dist/types/components/six-table-header-cell/icons.d.ts +3 -3
  297. package/dist/types/components/six-table-header-cell/six-table-header-cell.d.ts +32 -32
  298. package/dist/types/components/six-table-header-cell/types.d.ts +11 -11
  299. package/dist/types/components/six-table-header-cell/util/create-model.d.ts +4 -4
  300. package/dist/types/components/six-table-header-cell/util/get-next-state.d.ts +3 -3
  301. package/dist/types/components/six-table-row/six-table-row.d.ts +9 -9
  302. package/dist/types/components/six-tag/six-tag.d.ts +30 -30
  303. package/dist/types/components/six-textarea/six-textarea.d.ts +134 -134
  304. package/dist/types/components/six-tile/six-tile.d.ts +40 -40
  305. package/dist/types/components/six-timepicker/six-time-format.d.ts +13 -13
  306. package/dist/types/components/six-timepicker/six-timepicker.d.ts +184 -184
  307. package/dist/types/components/six-timepicker/six-timepicker.types.d.ts +36 -36
  308. package/dist/types/components/six-tooltip/six-tooltip.d.ts +72 -72
  309. package/dist/types/functional-components/form-control/form-control.d.ts +34 -34
  310. package/dist/types/index.d.ts +1 -1
  311. package/dist/types/testUtil/delay.d.ts +1 -1
  312. package/dist/types/utils/as-array.d.ts +1 -1
  313. package/dist/types/utils/date-util.d.ts +194 -194
  314. package/dist/types/utils/event-listeners.d.ts +15 -15
  315. package/dist/types/utils/execution-control.d.ts +26 -26
  316. package/dist/types/utils/focus-visible.d.ts +6 -6
  317. package/dist/types/utils/matchers.d.ts +2 -2
  318. package/dist/types/utils/modal.d.ts +13 -13
  319. package/dist/types/utils/offset.d.ts +4 -4
  320. package/dist/types/utils/popover.d.ts +27 -27
  321. package/dist/types/utils/scroll.d.ts +3 -3
  322. package/dist/types/utils/slot.d.ts +9 -9
  323. package/dist/types/utils/support.d.ts +1 -1
  324. package/dist/types/utils/tabbable.d.ts +2 -2
  325. package/dist/types/utils/testing.d.ts +2 -2
  326. package/dist/types/utils/time.util.d.ts +10 -10
  327. package/dist/types/utils/type-check.d.ts +4 -4
  328. package/dist/types/utils/types.d.ts +4 -4
  329. package/dist/types/wrappers/set-attributes/set-attributes.d.ts +9 -9
  330. package/dist/ui-library/{p-a8c225f2.entry.js → p-007bc8e8.entry.js} +1 -1
  331. package/dist/ui-library/{p-f9c0cfb7.entry.js → p-044b784e.entry.js} +1 -1
  332. package/dist/ui-library/{p-c733dead.js → p-0786fa7c.js} +0 -0
  333. package/dist/ui-library/{p-12cc24c3.js → p-07d1e830.js} +0 -0
  334. package/dist/ui-library/{p-48ea4419.entry.js → p-09cb13fa.entry.js} +1 -1
  335. package/dist/ui-library/{p-e96dcf96.entry.js → p-0c596054.entry.js} +1 -1
  336. package/dist/ui-library/{p-a77a6442.entry.js → p-1b8dc7b7.entry.js} +1 -1
  337. package/dist/ui-library/{p-68d31736.js → p-25a3bf57.js} +0 -0
  338. package/dist/ui-library/{p-ebaea182.entry.js → p-281e8c2d.entry.js} +1 -1
  339. package/dist/ui-library/{p-9f2dc381.entry.js → p-2924f82f.entry.js} +1 -1
  340. package/dist/ui-library/{p-ea1fcff2.entry.js → p-2d7ed407.entry.js} +1 -1
  341. package/dist/ui-library/{p-89f68e76.entry.js → p-4162dcdd.entry.js} +1 -1
  342. package/dist/ui-library/{p-6f67f986.entry.js → p-4d3a4e93.entry.js} +1 -1
  343. package/dist/ui-library/{p-8bd0873f.entry.js → p-4ed023b8.entry.js} +1 -1
  344. package/dist/ui-library/{p-af3d757c.js → p-4f8394d7.js} +0 -0
  345. package/dist/ui-library/{p-1b92cc7a.entry.js → p-530ea6ec.entry.js} +1 -1
  346. package/dist/ui-library/{p-19543c96.entry.js → p-531ab886.entry.js} +1 -1
  347. package/dist/ui-library/{p-fdb455d7.entry.js → p-54c48654.entry.js} +1 -1
  348. package/dist/ui-library/{p-c948d3db.entry.js → p-55c64cbc.entry.js} +1 -1
  349. package/dist/ui-library/{p-1c9f0dc6.js → p-5f1c6a5f.js} +0 -0
  350. package/dist/ui-library/{p-60491176.entry.js → p-675a8243.entry.js} +1 -1
  351. package/dist/ui-library/{p-b9fb8455.entry.js → p-6d622ed0.entry.js} +1 -1
  352. package/dist/ui-library/{p-572e3690.js → p-75297ad7.js} +0 -0
  353. package/dist/ui-library/{p-2ff97cdf.entry.js → p-90b26447.entry.js} +1 -1
  354. package/dist/ui-library/{p-fcd2356c.entry.js → p-93945629.entry.js} +1 -1
  355. package/dist/ui-library/{p-7735d99f.js → p-9a860acc.js} +0 -0
  356. package/dist/ui-library/{p-4cc01afc.entry.js → p-aa37e45a.entry.js} +1 -1
  357. package/dist/ui-library/{p-191f958b.js → p-b1e66136.js} +0 -0
  358. package/dist/ui-library/{p-c09dc3a9.js → p-b4dfb7cf.js} +0 -0
  359. package/dist/ui-library/{p-968c5169.entry.js → p-c24292b3.entry.js} +1 -1
  360. package/dist/ui-library/{p-ed21cc57.entry.js → p-cd79de73.entry.js} +1 -1
  361. package/dist/ui-library/{p-34e6d8e8.js → p-d12c6092.js} +0 -0
  362. package/dist/ui-library/{p-f0e91e17.entry.js → p-d28ac80a.entry.js} +1 -1
  363. package/dist/ui-library/{p-5ead7b2f.entry.js → p-d837e5a8.entry.js} +1 -1
  364. package/dist/ui-library/{p-ec1ecc2a.entry.js → p-dd3cae68.entry.js} +1 -1
  365. package/dist/ui-library/{p-044c6bf9.js → p-eb8f05a9.js} +0 -0
  366. package/dist/ui-library/ui-library.esm.js +1 -1
  367. package/package.json +1 -1
@@ -1,688 +1,688 @@
1
- import { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core';
2
- import { ItemPickerPaddingDirection, ItemPickerType } from './types';
3
- import { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';
4
- import { EventListeners } from '../../utils/event-listeners';
5
- const A_CHARCODE = 65;
6
- const NUMBER_OF_LETTERS = 26;
7
- const CAPITAL_ALPHABET = (() => {
8
- const alphabetCodes = Array.from(Array(NUMBER_OF_LETTERS)).map((_, i) => i + A_CHARCODE);
9
- const letterIndexes = {};
10
- const alphabet = alphabetCodes.map((charCode, index) => {
11
- const character = String.fromCharCode(charCode);
12
- letterIndexes[character] = index;
13
- return character;
14
- });
15
- return { alphabet, letterIndexes };
16
- })();
17
- const LOWERCASE_ALPHABET = (() => {
18
- const alphabet = [];
19
- const letterIndexes = {};
20
- for (let i = 0; i < CAPITAL_ALPHABET.alphabet.length; i++) {
21
- const lowercaseCharacter = CAPITAL_ALPHABET.alphabet[i].toLowerCase();
22
- letterIndexes[lowercaseCharacter] = alphabet.length;
23
- alphabet.push(lowercaseCharacter);
24
- }
25
- return { alphabet, letterIndexes };
26
- })();
27
- const ALPHABET = (() => {
28
- const alphabet = [];
29
- const letterIndexes = {};
30
- for (let i = 0; i < CAPITAL_ALPHABET.alphabet.length; i++) {
31
- const capitalCharacter = CAPITAL_ALPHABET.alphabet[i];
32
- letterIndexes[capitalCharacter] = alphabet.length;
33
- alphabet.push(capitalCharacter);
34
- const lowerCharacter = LOWERCASE_ALPHABET.alphabet[i];
35
- letterIndexes[lowerCharacter] = alphabet.length;
36
- alphabet.push(lowerCharacter);
37
- }
38
- return { alphabet, letterIndexes };
39
- })();
40
- const createItemIndexes = (arr) => {
41
- const itemIndexes = {};
42
- for (let i = 0; i < (arr === null || arr === void 0 ? void 0 : arr.length); i++) {
43
- itemIndexes[arr[i]] = i;
44
- }
45
- return itemIndexes;
46
- };
47
- const TAG = `[SIX-ITEM-PICKER]`;
48
- const subtract = (a, b) => a - b;
49
- const add = (a, b) => a + b;
50
- const DEBOUNCE_ITEM_PICKER_LISTENER = 'debounced-item-picker';
51
- /**
52
- * @since 2.0.0
53
- * @status experimental
54
- * @part container - The whole component container
55
- * @part up - The up button
56
- * @part content - The content area
57
- * @part down - The down button
58
- *
59
- */
60
- export class SixItemPicker {
61
- constructor() {
62
- this.eventListeners = new EventListeners();
63
- /** The item picker's value attribute. */
64
- this.value = '';
65
- /** The type of items you want to rotate through. */
66
- this.type = ItemPickerType.NUMBER;
67
- /** Define whether the picker should to a roundtrip i.e. start at max when reaching min and vice versa. */
68
- this.roundtrip = true;
69
- /** Defines how many steps should be taken when navigating */
70
- this.step = 1;
71
- /** Defines whether the items should be padded */
72
- this.padded = false;
73
- /** Defines the length of the padded area */
74
- this.paddingLength = 2;
75
- /** Defines the character used for padding */
76
- this.paddingChar = '0';
77
- /** Defines whether the padding should be before or after the value. You can either use 'before' or 'after'. By default
78
- * before is selected */
79
- this.paddingDirection = ItemPickerPaddingDirection.BEFORE;
80
- /**
81
- * Set the amount of time, in milliseconds, to wait to trigger faster switching between items.
82
- */
83
- this.timeout = DEFAULT_DEBOUNCE_FAST;
84
- /**
85
- * Set the amount of time, in milliseconds, to wait between switching to next item when mouse button is held pressed.
86
- */
87
- this.interval = DEFAULT_DEBOUNCE_INSANELY_FAST;
88
- /**
89
- * Set the amount of time, in milliseconds, to wait to trigger the `six-item-picker-change-debounced` event.
90
- * If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce
91
- * is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click
92
- * (and keep pressed) and once you release
93
- */
94
- this.debounce = DEFAULT_DEBOUNCE_FAST;
95
- this._items = [];
96
- this.handleSixItemPickerChangeDebounced = () => {
97
- this.sixChangeDebounced.emit(this.value);
98
- };
99
- }
100
- handleValueChange() {
101
- this.setup();
102
- }
103
- debounceChanged() {
104
- this.eventListeners.removeByIdentifier(DEBOUNCE_ITEM_PICKER_LISTENER);
105
- this.eventListeners.add(this.host, 'six-item-picker-change', debounce(this.handleSixItemPickerChangeDebounced, this.debounce), DEBOUNCE_ITEM_PICKER_LISTENER);
106
- }
107
- handleSetChange() {
108
- this.setup();
109
- this.min = this._items[0];
110
- this.max = this.getLastStringItem();
111
- }
112
- componentWillLoad() {
113
- this.setup();
114
- }
115
- componentDidLoad() {
116
- this.eventListeners.add(this.host, 'six-item-picker-change', debounce(this.handleSixItemPickerChangeDebounced, this.debounce), DEBOUNCE_ITEM_PICKER_LISTENER);
117
- }
118
- disconnectedCallback() {
119
- this.eventListeners.removeAll();
120
- }
121
- setup() {
122
- if (this.isNumber()) {
123
- this.setupNumberItems();
124
- }
125
- else {
126
- this.setUpStringItems();
127
- }
128
- }
129
- setupNumberItems() {
130
- var _a;
131
- if (this.isInvalidNumber()) {
132
- console.warn(`${TAG} Expected number but value is not a number: "${this.value}"`);
133
- console.info(`${TAG} Will set value to either minimum or if not provided to zero.`);
134
- this.value = (_a = this.min) !== null && _a !== void 0 ? _a : 0;
135
- }
136
- }
137
- setUpStringItems() {
138
- this._items = this.getItems();
139
- if (!this._items) {
140
- console.warn(`${TAG}: abort setup because no items were found.`);
141
- return;
142
- }
143
- this._itemIndexes = this.getItemIndexes();
144
- const itemsMissValue = this._items.find((i) => String(i) === String(this.value)) === undefined;
145
- if (itemsMissValue) {
146
- console.warn(`${TAG} Expected item from item set but value was not found in set: "${this.value}"`);
147
- console.info(`${TAG} Will set value to either minimum or if not provided to "${this._items[0]}".`);
148
- this.value = this._items[0];
149
- }
150
- if (this.min === undefined) {
151
- if (!this.roundtrip) {
152
- console.warn(`${TAG} Expected a min value`);
153
- console.info(`${TAG} Will set min value to ${this._items[0]}`);
154
- }
155
- this.min = this._items[0];
156
- }
157
- if (this.max === undefined) {
158
- const maxItem = this.getLastStringItem();
159
- if (!this.roundtrip) {
160
- console.warn(`${TAG} Expected a min value if roundtrip is enabled`);
161
- console.info(`${TAG} Will set min value to ${maxItem}`);
162
- }
163
- this.max = maxItem;
164
- }
165
- }
166
- getLastStringItem() {
167
- return this._items[this._items.length - 1];
168
- }
169
- getItems() {
170
- return {
171
- [ItemPickerType.LETTER]: ALPHABET.alphabet,
172
- [ItemPickerType.CAPITAL_LETTER]: CAPITAL_ALPHABET.alphabet,
173
- [ItemPickerType.LOWER_LETTER]: LOWERCASE_ALPHABET.alphabet,
174
- [ItemPickerType.CUSTOM]: this.items,
175
- }[this.type];
176
- }
177
- getItemIndexes() {
178
- if (this.type === ItemPickerType.CUSTOM) {
179
- return createItemIndexes(this.items);
180
- }
181
- return {
182
- [ItemPickerType.LETTER]: ALPHABET.letterIndexes,
183
- [ItemPickerType.CAPITAL_LETTER]: CAPITAL_ALPHABET.letterIndexes,
184
- [ItemPickerType.LOWER_LETTER]: LOWERCASE_ALPHABET.letterIndexes,
185
- }[this.type];
186
- }
187
- previousItem() {
188
- if (this.isNumber()) {
189
- this.previousNumber();
190
- }
191
- else {
192
- this.previousStringItem();
193
- }
194
- this.sixChange.emit(this.value);
195
- }
196
- previousNumber() {
197
- this.changeValue({
198
- isNextItemAllowed: () => !this.isPreviousNumberDisabled(),
199
- getNextItem: () => Number(this.value) - this.step,
200
- getRoundtripItem: () => Number(this.max),
201
- isRoundtripPossible: () => this.max === undefined && this.roundtrip,
202
- });
203
- }
204
- previousStringItem() {
205
- const value = this.value;
206
- const minLetter = this.min;
207
- this.changeValue({
208
- isNextItemAllowed: () => minLetter === undefined || this.getStringItemIndex(value) > this.getStringItemIndex(minLetter),
209
- getNextItem: () => this.getNextItemByOperation(subtract),
210
- getRoundtripItem: () => this.max,
211
- isRoundtripPossible: () => this.max === undefined && this.roundtrip,
212
- });
213
- }
214
- nextItem() {
215
- if (this.isNumber()) {
216
- this.nextNumber();
217
- }
218
- else {
219
- this.nextStringItem();
220
- }
221
- this.sixChange.emit(this.value);
222
- }
223
- nextNumber() {
224
- this.changeValue({
225
- isNextItemAllowed: () => !this.isNextNumberDisabled(),
226
- getNextItem: () => Number(this.value) + this.step,
227
- getRoundtripItem: () => Number(this.min),
228
- isRoundtripPossible: () => this.min === undefined && this.roundtrip,
229
- });
230
- }
231
- getStringItemIndex(char) {
232
- return this._itemIndexes[char];
233
- }
234
- nextStringItem() {
235
- const value = this.value;
236
- const maxLetter = this.max;
237
- this.changeValue({
238
- isNextItemAllowed: () => maxLetter === undefined || this.getStringItemIndex(value) < this.getStringItemIndex(maxLetter),
239
- getNextItem: () => this.getNextItemByOperation(add),
240
- getRoundtripItem: () => this.min,
241
- isRoundtripPossible: () => this.min === undefined && this.roundtrip,
242
- });
243
- }
244
- getNextItemByOperation(operation) {
245
- const value = this.value;
246
- const nextIndexCandidate = operation(this.getStringItemIndex(value), this.step);
247
- const numberOfItems = this._items.length;
248
- const nextIndex = ((nextIndexCandidate % numberOfItems) + numberOfItems) % numberOfItems;
249
- return this._items[nextIndex];
250
- }
251
- changeValue(params) {
252
- if (params.isNextItemAllowed()) {
253
- this.value = params.getNextItem();
254
- return;
255
- }
256
- if (params.isRoundtripPossible()) {
257
- console.error(`${TAG} Item picker is expected to perform a roundtrip, but either max or min value is missing so a roundtrip is not possible`);
258
- return;
259
- }
260
- if (this.roundtrip) {
261
- this.value = params.getRoundtripItem();
262
- return;
263
- }
264
- console.warn(`${TAG} Roundtrip is not allowed, but was still triggered, please report this issue to the developer of six-item-picker`);
265
- }
266
- isNumber() {
267
- return this.type === ItemPickerType.NUMBER;
268
- }
269
- isInvalidNumber() {
270
- return this.value === '' || !!isNaN(this.value);
271
- }
272
- isNextDisabled() {
273
- if (this.roundtrip) {
274
- return false;
275
- }
276
- if (this.isNumber()) {
277
- return this.isNextNumberDisabled();
278
- }
279
- else {
280
- if (!this._itemIndexes) {
281
- return true;
282
- }
283
- return this._itemIndexes[String(this.value)] + this.step > this._itemIndexes[String(this.max)];
284
- }
285
- }
286
- isNextNumberDisabled() {
287
- var _a;
288
- return Number(this.value) + this.step > ((_a = this.max) !== null && _a !== void 0 ? _a : Infinity);
289
- }
290
- isPrevDisabled() {
291
- if (this.roundtrip) {
292
- return false;
293
- }
294
- if (this.isNumber()) {
295
- return this.isPreviousNumberDisabled();
296
- }
297
- else {
298
- if (!this._itemIndexes) {
299
- return true;
300
- }
301
- return this._itemIndexes[String(this.value)] - this.step < this._itemIndexes[String(this.min)];
302
- }
303
- }
304
- isPreviousNumberDisabled() {
305
- var _a;
306
- return Number(this.value) - this.step < ((_a = this.min) !== null && _a !== void 0 ? _a : -Infinity);
307
- }
308
- onMouseDownNext() {
309
- if (this.isNextDisabled()) {
310
- return;
311
- }
312
- this.nextItem();
313
- this._timeoutNext = setTimeout(() => {
314
- this._intervalNext = setInterval(() => {
315
- this.nextItem();
316
- }, this.interval);
317
- }, this.timeout);
318
- }
319
- onMouseUpNext() {
320
- clearTimeout(this._timeoutNext);
321
- clearInterval(this._intervalNext);
322
- }
323
- onMouseDownPrev() {
324
- if (this.isPrevDisabled()) {
325
- return;
326
- }
327
- this.previousItem();
328
- this._timeoutPrev = setTimeout(() => {
329
- this._intervalPrev = setInterval(() => {
330
- this.previousItem();
331
- }, this.interval);
332
- }, this.timeout);
333
- }
334
- onMouseUpPrev() {
335
- clearTimeout(this._timeoutPrev);
336
- clearInterval(this._intervalPrev);
337
- }
338
- getFormattedValue() {
339
- if (this.value === undefined || this.value === null) {
340
- return this.value;
341
- }
342
- if (!this.padded) {
343
- return this.value;
344
- }
345
- if (this.paddingDirection === ItemPickerPaddingDirection.BEFORE) {
346
- return String(this.value).padStart(this.paddingLength, this.paddingChar);
347
- }
348
- else if (this.paddingDirection === ItemPickerPaddingDirection.AFTER) {
349
- return String(this.value).padEnd(this.paddingLength, this.paddingChar);
350
- }
351
- return this.value;
352
- }
353
- render() {
354
- return (h("div", { part: "container", class: "item_picker__container" },
355
- h("div", { part: "up", class: {
356
- item_picker__btn: true,
357
- 'item_picker__btn--disabled': this.isNextDisabled(),
358
- }, onMouseDown: () => this.onMouseDownNext(), onMouseUp: () => this.onMouseUpNext() },
359
- h("six-icon", { size: "large" }, "expand_less")),
360
- h("div", { part: "content", class: "item_picker__content" }, this.getFormattedValue()),
361
- h("div", { part: "down", class: {
362
- item_picker__btn: true,
363
- 'item_picker__btn--disabled': this.isPrevDisabled(),
364
- }, onMouseDown: () => this.onMouseDownPrev(), onMouseUp: () => this.onMouseUpPrev() },
365
- h("six-icon", { size: "large" }, "expand_more"))));
366
- }
367
- static get is() { return "six-item-picker"; }
368
- static get encapsulation() { return "shadow"; }
369
- static get originalStyleUrls() { return {
370
- "$": ["six-item-picker.scss"]
371
- }; }
372
- static get styleUrls() { return {
373
- "$": ["six-item-picker.css"]
374
- }; }
375
- static get properties() { return {
376
- "value": {
377
- "type": "any",
378
- "mutable": true,
379
- "complexType": {
380
- "original": "number | string",
381
- "resolved": "number | string",
382
- "references": {}
383
- },
384
- "required": false,
385
- "optional": false,
386
- "docs": {
387
- "tags": [],
388
- "text": "The item picker's value attribute."
389
- },
390
- "attribute": "value",
391
- "reflect": true,
392
- "defaultValue": "''"
393
- },
394
- "type": {
395
- "type": "string",
396
- "mutable": false,
397
- "complexType": {
398
- "original": "ItemPickerType",
399
- "resolved": "ItemPickerType.CAPITAL_LETTER | ItemPickerType.CUSTOM | ItemPickerType.LETTER | ItemPickerType.LOWER_LETTER | ItemPickerType.NUMBER",
400
- "references": {
401
- "ItemPickerType": {
402
- "location": "import",
403
- "path": "./types"
404
- }
405
- }
406
- },
407
- "required": false,
408
- "optional": false,
409
- "docs": {
410
- "tags": [],
411
- "text": "The type of items you want to rotate through."
412
- },
413
- "attribute": "type",
414
- "reflect": false,
415
- "defaultValue": "ItemPickerType.NUMBER"
416
- },
417
- "min": {
418
- "type": "any",
419
- "mutable": true,
420
- "complexType": {
421
- "original": "number | string",
422
- "resolved": "number | string",
423
- "references": {}
424
- },
425
- "required": false,
426
- "optional": false,
427
- "docs": {
428
- "tags": [],
429
- "text": "The minimum value allowed to pick."
430
- },
431
- "attribute": "min",
432
- "reflect": true
433
- },
434
- "max": {
435
- "type": "any",
436
- "mutable": true,
437
- "complexType": {
438
- "original": "number | string",
439
- "resolved": "number | string",
440
- "references": {}
441
- },
442
- "required": false,
443
- "optional": false,
444
- "docs": {
445
- "tags": [],
446
- "text": "The maximum value allowed to pick."
447
- },
448
- "attribute": "max",
449
- "reflect": true
450
- },
451
- "roundtrip": {
452
- "type": "boolean",
453
- "mutable": false,
454
- "complexType": {
455
- "original": "boolean",
456
- "resolved": "boolean",
457
- "references": {}
458
- },
459
- "required": false,
460
- "optional": false,
461
- "docs": {
462
- "tags": [],
463
- "text": "Define whether the picker should to a roundtrip i.e. start at max when reaching min and vice versa."
464
- },
465
- "attribute": "roundtrip",
466
- "reflect": true,
467
- "defaultValue": "true"
468
- },
469
- "step": {
470
- "type": "number",
471
- "mutable": false,
472
- "complexType": {
473
- "original": "number",
474
- "resolved": "number",
475
- "references": {}
476
- },
477
- "required": false,
478
- "optional": false,
479
- "docs": {
480
- "tags": [],
481
- "text": "Defines how many steps should be taken when navigating"
482
- },
483
- "attribute": "step",
484
- "reflect": true,
485
- "defaultValue": "1"
486
- },
487
- "items": {
488
- "type": "unknown",
489
- "mutable": false,
490
- "complexType": {
491
- "original": "string[]",
492
- "resolved": "string[]",
493
- "references": {}
494
- },
495
- "required": false,
496
- "optional": false,
497
- "docs": {
498
- "tags": [],
499
- "text": "Defines a custom list of items you can iterate through"
500
- }
501
- },
502
- "padded": {
503
- "type": "boolean",
504
- "mutable": false,
505
- "complexType": {
506
- "original": "boolean",
507
- "resolved": "boolean",
508
- "references": {}
509
- },
510
- "required": false,
511
- "optional": false,
512
- "docs": {
513
- "tags": [],
514
- "text": "Defines whether the items should be padded"
515
- },
516
- "attribute": "padded",
517
- "reflect": false,
518
- "defaultValue": "false"
519
- },
520
- "paddingLength": {
521
- "type": "number",
522
- "mutable": false,
523
- "complexType": {
524
- "original": "number",
525
- "resolved": "number",
526
- "references": {}
527
- },
528
- "required": false,
529
- "optional": false,
530
- "docs": {
531
- "tags": [],
532
- "text": "Defines the length of the padded area"
533
- },
534
- "attribute": "padding-length",
535
- "reflect": false,
536
- "defaultValue": "2"
537
- },
538
- "paddingChar": {
539
- "type": "string",
540
- "mutable": false,
541
- "complexType": {
542
- "original": "string",
543
- "resolved": "string",
544
- "references": {}
545
- },
546
- "required": false,
547
- "optional": false,
548
- "docs": {
549
- "tags": [],
550
- "text": "Defines the character used for padding"
551
- },
552
- "attribute": "padding-char",
553
- "reflect": false,
554
- "defaultValue": "'0'"
555
- },
556
- "paddingDirection": {
557
- "type": "string",
558
- "mutable": false,
559
- "complexType": {
560
- "original": "ItemPickerPaddingDirection",
561
- "resolved": "ItemPickerPaddingDirection.AFTER | ItemPickerPaddingDirection.BEFORE",
562
- "references": {
563
- "ItemPickerPaddingDirection": {
564
- "location": "import",
565
- "path": "./types"
566
- }
567
- }
568
- },
569
- "required": false,
570
- "optional": false,
571
- "docs": {
572
- "tags": [],
573
- "text": "Defines whether the padding should be before or after the value. You can either use 'before' or 'after'. By default\nbefore is selected"
574
- },
575
- "attribute": "padding-direction",
576
- "reflect": false,
577
- "defaultValue": "ItemPickerPaddingDirection.BEFORE"
578
- },
579
- "timeout": {
580
- "type": "number",
581
- "mutable": false,
582
- "complexType": {
583
- "original": "number",
584
- "resolved": "number",
585
- "references": {}
586
- },
587
- "required": false,
588
- "optional": false,
589
- "docs": {
590
- "tags": [],
591
- "text": "Set the amount of time, in milliseconds, to wait to trigger faster switching between items."
592
- },
593
- "attribute": "timeout",
594
- "reflect": false,
595
- "defaultValue": "DEFAULT_DEBOUNCE_FAST"
596
- },
597
- "interval": {
598
- "type": "number",
599
- "mutable": false,
600
- "complexType": {
601
- "original": "number",
602
- "resolved": "number",
603
- "references": {}
604
- },
605
- "required": false,
606
- "optional": false,
607
- "docs": {
608
- "tags": [],
609
- "text": "Set the amount of time, in milliseconds, to wait between switching to next item when mouse button is held pressed."
610
- },
611
- "attribute": "interval",
612
- "reflect": false,
613
- "defaultValue": "DEFAULT_DEBOUNCE_INSANELY_FAST"
614
- },
615
- "debounce": {
616
- "type": "number",
617
- "mutable": false,
618
- "complexType": {
619
- "original": "number",
620
- "resolved": "number",
621
- "references": {}
622
- },
623
- "required": false,
624
- "optional": false,
625
- "docs": {
626
- "tags": [],
627
- "text": "Set the amount of time, in milliseconds, to wait to trigger the `six-item-picker-change-debounced` event.\nIf you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\nis a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click\n(and keep pressed) and once you release"
628
- },
629
- "attribute": "debounce",
630
- "reflect": false,
631
- "defaultValue": "DEFAULT_DEBOUNCE_FAST"
632
- }
633
- }; }
634
- static get states() { return {
635
- "_items": {},
636
- "_itemIndexes": {}
637
- }; }
638
- static get events() { return [{
639
- "method": "sixChange",
640
- "name": "six-item-picker-change",
641
- "bubbles": true,
642
- "cancelable": true,
643
- "composed": true,
644
- "docs": {
645
- "tags": [],
646
- "text": "Emitted when the item picker's value changes"
647
- },
648
- "complexType": {
649
- "original": "SixItemPickerChangePayload",
650
- "resolved": "number | string",
651
- "references": {
652
- "SixItemPickerChangePayload": {
653
- "location": "local"
654
- }
655
- }
656
- }
657
- }, {
658
- "method": "sixChangeDebounced",
659
- "name": "six-item-picker-change-debounced",
660
- "bubbles": true,
661
- "cancelable": true,
662
- "composed": true,
663
- "docs": {
664
- "tags": [],
665
- "text": "Emitted when the item picker's value changes, but debounced"
666
- },
667
- "complexType": {
668
- "original": "SixItemPickerChangePayload",
669
- "resolved": "number | string",
670
- "references": {
671
- "SixItemPickerChangePayload": {
672
- "location": "local"
673
- }
674
- }
675
- }
676
- }]; }
677
- static get elementRef() { return "host"; }
678
- static get watchers() { return [{
679
- "propName": "value",
680
- "methodName": "handleValueChange"
681
- }, {
682
- "propName": "debounce",
683
- "methodName": "debounceChanged"
684
- }, {
685
- "propName": "items",
686
- "methodName": "handleSetChange"
687
- }]; }
688
- }
1
+ import { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core';
2
+ import { ItemPickerPaddingDirection, ItemPickerType } from './types';
3
+ import { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';
4
+ import { EventListeners } from '../../utils/event-listeners';
5
+ const A_CHARCODE = 65;
6
+ const NUMBER_OF_LETTERS = 26;
7
+ const CAPITAL_ALPHABET = (() => {
8
+ const alphabetCodes = Array.from(Array(NUMBER_OF_LETTERS)).map((_, i) => i + A_CHARCODE);
9
+ const letterIndexes = {};
10
+ const alphabet = alphabetCodes.map((charCode, index) => {
11
+ const character = String.fromCharCode(charCode);
12
+ letterIndexes[character] = index;
13
+ return character;
14
+ });
15
+ return { alphabet, letterIndexes };
16
+ })();
17
+ const LOWERCASE_ALPHABET = (() => {
18
+ const alphabet = [];
19
+ const letterIndexes = {};
20
+ for (let i = 0; i < CAPITAL_ALPHABET.alphabet.length; i++) {
21
+ const lowercaseCharacter = CAPITAL_ALPHABET.alphabet[i].toLowerCase();
22
+ letterIndexes[lowercaseCharacter] = alphabet.length;
23
+ alphabet.push(lowercaseCharacter);
24
+ }
25
+ return { alphabet, letterIndexes };
26
+ })();
27
+ const ALPHABET = (() => {
28
+ const alphabet = [];
29
+ const letterIndexes = {};
30
+ for (let i = 0; i < CAPITAL_ALPHABET.alphabet.length; i++) {
31
+ const capitalCharacter = CAPITAL_ALPHABET.alphabet[i];
32
+ letterIndexes[capitalCharacter] = alphabet.length;
33
+ alphabet.push(capitalCharacter);
34
+ const lowerCharacter = LOWERCASE_ALPHABET.alphabet[i];
35
+ letterIndexes[lowerCharacter] = alphabet.length;
36
+ alphabet.push(lowerCharacter);
37
+ }
38
+ return { alphabet, letterIndexes };
39
+ })();
40
+ const createItemIndexes = (arr) => {
41
+ const itemIndexes = {};
42
+ for (let i = 0; i < (arr === null || arr === void 0 ? void 0 : arr.length); i++) {
43
+ itemIndexes[arr[i]] = i;
44
+ }
45
+ return itemIndexes;
46
+ };
47
+ const TAG = `[SIX-ITEM-PICKER]`;
48
+ const subtract = (a, b) => a - b;
49
+ const add = (a, b) => a + b;
50
+ const DEBOUNCE_ITEM_PICKER_LISTENER = 'debounced-item-picker';
51
+ /**
52
+ * @since 2.0.0
53
+ * @status experimental
54
+ * @part container - The whole component container
55
+ * @part up - The up button
56
+ * @part content - The content area
57
+ * @part down - The down button
58
+ *
59
+ */
60
+ export class SixItemPicker {
61
+ constructor() {
62
+ this.eventListeners = new EventListeners();
63
+ /** The item picker's value attribute. */
64
+ this.value = '';
65
+ /** The type of items you want to rotate through. */
66
+ this.type = ItemPickerType.NUMBER;
67
+ /** Define whether the picker should to a roundtrip i.e. start at max when reaching min and vice versa. */
68
+ this.roundtrip = true;
69
+ /** Defines how many steps should be taken when navigating */
70
+ this.step = 1;
71
+ /** Defines whether the items should be padded */
72
+ this.padded = false;
73
+ /** Defines the length of the padded area */
74
+ this.paddingLength = 2;
75
+ /** Defines the character used for padding */
76
+ this.paddingChar = '0';
77
+ /** Defines whether the padding should be before or after the value. You can either use 'before' or 'after'. By default
78
+ * before is selected */
79
+ this.paddingDirection = ItemPickerPaddingDirection.BEFORE;
80
+ /**
81
+ * Set the amount of time, in milliseconds, to wait to trigger faster switching between items.
82
+ */
83
+ this.timeout = DEFAULT_DEBOUNCE_FAST;
84
+ /**
85
+ * Set the amount of time, in milliseconds, to wait between switching to next item when mouse button is held pressed.
86
+ */
87
+ this.interval = DEFAULT_DEBOUNCE_INSANELY_FAST;
88
+ /**
89
+ * Set the amount of time, in milliseconds, to wait to trigger the `six-item-picker-change-debounced` event.
90
+ * If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce
91
+ * is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click
92
+ * (and keep pressed) and once you release
93
+ */
94
+ this.debounce = DEFAULT_DEBOUNCE_FAST;
95
+ this._items = [];
96
+ this.handleSixItemPickerChangeDebounced = () => {
97
+ this.sixChangeDebounced.emit(this.value);
98
+ };
99
+ }
100
+ handleValueChange() {
101
+ this.setup();
102
+ }
103
+ debounceChanged() {
104
+ this.eventListeners.removeByIdentifier(DEBOUNCE_ITEM_PICKER_LISTENER);
105
+ this.eventListeners.add(this.host, 'six-item-picker-change', debounce(this.handleSixItemPickerChangeDebounced, this.debounce), DEBOUNCE_ITEM_PICKER_LISTENER);
106
+ }
107
+ handleSetChange() {
108
+ this.setup();
109
+ this.min = this._items[0];
110
+ this.max = this.getLastStringItem();
111
+ }
112
+ componentWillLoad() {
113
+ this.setup();
114
+ }
115
+ componentDidLoad() {
116
+ this.eventListeners.add(this.host, 'six-item-picker-change', debounce(this.handleSixItemPickerChangeDebounced, this.debounce), DEBOUNCE_ITEM_PICKER_LISTENER);
117
+ }
118
+ disconnectedCallback() {
119
+ this.eventListeners.removeAll();
120
+ }
121
+ setup() {
122
+ if (this.isNumber()) {
123
+ this.setupNumberItems();
124
+ }
125
+ else {
126
+ this.setUpStringItems();
127
+ }
128
+ }
129
+ setupNumberItems() {
130
+ var _a;
131
+ if (this.isInvalidNumber()) {
132
+ console.warn(`${TAG} Expected number but value is not a number: "${this.value}"`);
133
+ console.info(`${TAG} Will set value to either minimum or if not provided to zero.`);
134
+ this.value = (_a = this.min) !== null && _a !== void 0 ? _a : 0;
135
+ }
136
+ }
137
+ setUpStringItems() {
138
+ this._items = this.getItems();
139
+ if (!this._items) {
140
+ console.warn(`${TAG}: abort setup because no items were found.`);
141
+ return;
142
+ }
143
+ this._itemIndexes = this.getItemIndexes();
144
+ const itemsMissValue = this._items.find((i) => String(i) === String(this.value)) === undefined;
145
+ if (itemsMissValue) {
146
+ console.warn(`${TAG} Expected item from item set but value was not found in set: "${this.value}"`);
147
+ console.info(`${TAG} Will set value to either minimum or if not provided to "${this._items[0]}".`);
148
+ this.value = this._items[0];
149
+ }
150
+ if (this.min === undefined) {
151
+ if (!this.roundtrip) {
152
+ console.warn(`${TAG} Expected a min value`);
153
+ console.info(`${TAG} Will set min value to ${this._items[0]}`);
154
+ }
155
+ this.min = this._items[0];
156
+ }
157
+ if (this.max === undefined) {
158
+ const maxItem = this.getLastStringItem();
159
+ if (!this.roundtrip) {
160
+ console.warn(`${TAG} Expected a min value if roundtrip is enabled`);
161
+ console.info(`${TAG} Will set min value to ${maxItem}`);
162
+ }
163
+ this.max = maxItem;
164
+ }
165
+ }
166
+ getLastStringItem() {
167
+ return this._items[this._items.length - 1];
168
+ }
169
+ getItems() {
170
+ return {
171
+ [ItemPickerType.LETTER]: ALPHABET.alphabet,
172
+ [ItemPickerType.CAPITAL_LETTER]: CAPITAL_ALPHABET.alphabet,
173
+ [ItemPickerType.LOWER_LETTER]: LOWERCASE_ALPHABET.alphabet,
174
+ [ItemPickerType.CUSTOM]: this.items,
175
+ }[this.type];
176
+ }
177
+ getItemIndexes() {
178
+ if (this.type === ItemPickerType.CUSTOM) {
179
+ return createItemIndexes(this.items);
180
+ }
181
+ return {
182
+ [ItemPickerType.LETTER]: ALPHABET.letterIndexes,
183
+ [ItemPickerType.CAPITAL_LETTER]: CAPITAL_ALPHABET.letterIndexes,
184
+ [ItemPickerType.LOWER_LETTER]: LOWERCASE_ALPHABET.letterIndexes,
185
+ }[this.type];
186
+ }
187
+ previousItem() {
188
+ if (this.isNumber()) {
189
+ this.previousNumber();
190
+ }
191
+ else {
192
+ this.previousStringItem();
193
+ }
194
+ this.sixChange.emit(this.value);
195
+ }
196
+ previousNumber() {
197
+ this.changeValue({
198
+ isNextItemAllowed: () => !this.isPreviousNumberDisabled(),
199
+ getNextItem: () => Number(this.value) - this.step,
200
+ getRoundtripItem: () => Number(this.max),
201
+ isRoundtripPossible: () => this.max === undefined && this.roundtrip,
202
+ });
203
+ }
204
+ previousStringItem() {
205
+ const value = this.value;
206
+ const minLetter = this.min;
207
+ this.changeValue({
208
+ isNextItemAllowed: () => minLetter === undefined || this.getStringItemIndex(value) > this.getStringItemIndex(minLetter),
209
+ getNextItem: () => this.getNextItemByOperation(subtract),
210
+ getRoundtripItem: () => this.max,
211
+ isRoundtripPossible: () => this.max === undefined && this.roundtrip,
212
+ });
213
+ }
214
+ nextItem() {
215
+ if (this.isNumber()) {
216
+ this.nextNumber();
217
+ }
218
+ else {
219
+ this.nextStringItem();
220
+ }
221
+ this.sixChange.emit(this.value);
222
+ }
223
+ nextNumber() {
224
+ this.changeValue({
225
+ isNextItemAllowed: () => !this.isNextNumberDisabled(),
226
+ getNextItem: () => Number(this.value) + this.step,
227
+ getRoundtripItem: () => Number(this.min),
228
+ isRoundtripPossible: () => this.min === undefined && this.roundtrip,
229
+ });
230
+ }
231
+ getStringItemIndex(char) {
232
+ return this._itemIndexes[char];
233
+ }
234
+ nextStringItem() {
235
+ const value = this.value;
236
+ const maxLetter = this.max;
237
+ this.changeValue({
238
+ isNextItemAllowed: () => maxLetter === undefined || this.getStringItemIndex(value) < this.getStringItemIndex(maxLetter),
239
+ getNextItem: () => this.getNextItemByOperation(add),
240
+ getRoundtripItem: () => this.min,
241
+ isRoundtripPossible: () => this.min === undefined && this.roundtrip,
242
+ });
243
+ }
244
+ getNextItemByOperation(operation) {
245
+ const value = this.value;
246
+ const nextIndexCandidate = operation(this.getStringItemIndex(value), this.step);
247
+ const numberOfItems = this._items.length;
248
+ const nextIndex = ((nextIndexCandidate % numberOfItems) + numberOfItems) % numberOfItems;
249
+ return this._items[nextIndex];
250
+ }
251
+ changeValue(params) {
252
+ if (params.isNextItemAllowed()) {
253
+ this.value = params.getNextItem();
254
+ return;
255
+ }
256
+ if (params.isRoundtripPossible()) {
257
+ console.error(`${TAG} Item picker is expected to perform a roundtrip, but either max or min value is missing so a roundtrip is not possible`);
258
+ return;
259
+ }
260
+ if (this.roundtrip) {
261
+ this.value = params.getRoundtripItem();
262
+ return;
263
+ }
264
+ console.warn(`${TAG} Roundtrip is not allowed, but was still triggered, please report this issue to the developer of six-item-picker`);
265
+ }
266
+ isNumber() {
267
+ return this.type === ItemPickerType.NUMBER;
268
+ }
269
+ isInvalidNumber() {
270
+ return this.value === '' || !!isNaN(this.value);
271
+ }
272
+ isNextDisabled() {
273
+ if (this.roundtrip) {
274
+ return false;
275
+ }
276
+ if (this.isNumber()) {
277
+ return this.isNextNumberDisabled();
278
+ }
279
+ else {
280
+ if (!this._itemIndexes) {
281
+ return true;
282
+ }
283
+ return this._itemIndexes[String(this.value)] + this.step > this._itemIndexes[String(this.max)];
284
+ }
285
+ }
286
+ isNextNumberDisabled() {
287
+ var _a;
288
+ return Number(this.value) + this.step > ((_a = this.max) !== null && _a !== void 0 ? _a : Infinity);
289
+ }
290
+ isPrevDisabled() {
291
+ if (this.roundtrip) {
292
+ return false;
293
+ }
294
+ if (this.isNumber()) {
295
+ return this.isPreviousNumberDisabled();
296
+ }
297
+ else {
298
+ if (!this._itemIndexes) {
299
+ return true;
300
+ }
301
+ return this._itemIndexes[String(this.value)] - this.step < this._itemIndexes[String(this.min)];
302
+ }
303
+ }
304
+ isPreviousNumberDisabled() {
305
+ var _a;
306
+ return Number(this.value) - this.step < ((_a = this.min) !== null && _a !== void 0 ? _a : -Infinity);
307
+ }
308
+ onMouseDownNext() {
309
+ if (this.isNextDisabled()) {
310
+ return;
311
+ }
312
+ this.nextItem();
313
+ this._timeoutNext = setTimeout(() => {
314
+ this._intervalNext = setInterval(() => {
315
+ this.nextItem();
316
+ }, this.interval);
317
+ }, this.timeout);
318
+ }
319
+ onMouseUpNext() {
320
+ clearTimeout(this._timeoutNext);
321
+ clearInterval(this._intervalNext);
322
+ }
323
+ onMouseDownPrev() {
324
+ if (this.isPrevDisabled()) {
325
+ return;
326
+ }
327
+ this.previousItem();
328
+ this._timeoutPrev = setTimeout(() => {
329
+ this._intervalPrev = setInterval(() => {
330
+ this.previousItem();
331
+ }, this.interval);
332
+ }, this.timeout);
333
+ }
334
+ onMouseUpPrev() {
335
+ clearTimeout(this._timeoutPrev);
336
+ clearInterval(this._intervalPrev);
337
+ }
338
+ getFormattedValue() {
339
+ if (this.value === undefined || this.value === null) {
340
+ return this.value;
341
+ }
342
+ if (!this.padded) {
343
+ return this.value;
344
+ }
345
+ if (this.paddingDirection === ItemPickerPaddingDirection.BEFORE) {
346
+ return String(this.value).padStart(this.paddingLength, this.paddingChar);
347
+ }
348
+ else if (this.paddingDirection === ItemPickerPaddingDirection.AFTER) {
349
+ return String(this.value).padEnd(this.paddingLength, this.paddingChar);
350
+ }
351
+ return this.value;
352
+ }
353
+ render() {
354
+ return (h("div", { part: "container", class: "item_picker__container" },
355
+ h("div", { part: "up", class: {
356
+ item_picker__btn: true,
357
+ 'item_picker__btn--disabled': this.isNextDisabled(),
358
+ }, onMouseDown: () => this.onMouseDownNext(), onMouseUp: () => this.onMouseUpNext() },
359
+ h("six-icon", { size: "large" }, "expand_less")),
360
+ h("div", { part: "content", class: "item_picker__content" }, this.getFormattedValue()),
361
+ h("div", { part: "down", class: {
362
+ item_picker__btn: true,
363
+ 'item_picker__btn--disabled': this.isPrevDisabled(),
364
+ }, onMouseDown: () => this.onMouseDownPrev(), onMouseUp: () => this.onMouseUpPrev() },
365
+ h("six-icon", { size: "large" }, "expand_more"))));
366
+ }
367
+ static get is() { return "six-item-picker"; }
368
+ static get encapsulation() { return "shadow"; }
369
+ static get originalStyleUrls() { return {
370
+ "$": ["six-item-picker.scss"]
371
+ }; }
372
+ static get styleUrls() { return {
373
+ "$": ["six-item-picker.css"]
374
+ }; }
375
+ static get properties() { return {
376
+ "value": {
377
+ "type": "any",
378
+ "mutable": true,
379
+ "complexType": {
380
+ "original": "number | string",
381
+ "resolved": "number | string",
382
+ "references": {}
383
+ },
384
+ "required": false,
385
+ "optional": false,
386
+ "docs": {
387
+ "tags": [],
388
+ "text": "The item picker's value attribute."
389
+ },
390
+ "attribute": "value",
391
+ "reflect": true,
392
+ "defaultValue": "''"
393
+ },
394
+ "type": {
395
+ "type": "string",
396
+ "mutable": false,
397
+ "complexType": {
398
+ "original": "ItemPickerType",
399
+ "resolved": "ItemPickerType.CAPITAL_LETTER | ItemPickerType.CUSTOM | ItemPickerType.LETTER | ItemPickerType.LOWER_LETTER | ItemPickerType.NUMBER",
400
+ "references": {
401
+ "ItemPickerType": {
402
+ "location": "import",
403
+ "path": "./types"
404
+ }
405
+ }
406
+ },
407
+ "required": false,
408
+ "optional": false,
409
+ "docs": {
410
+ "tags": [],
411
+ "text": "The type of items you want to rotate through."
412
+ },
413
+ "attribute": "type",
414
+ "reflect": false,
415
+ "defaultValue": "ItemPickerType.NUMBER"
416
+ },
417
+ "min": {
418
+ "type": "any",
419
+ "mutable": true,
420
+ "complexType": {
421
+ "original": "number | string",
422
+ "resolved": "number | string",
423
+ "references": {}
424
+ },
425
+ "required": false,
426
+ "optional": false,
427
+ "docs": {
428
+ "tags": [],
429
+ "text": "The minimum value allowed to pick."
430
+ },
431
+ "attribute": "min",
432
+ "reflect": true
433
+ },
434
+ "max": {
435
+ "type": "any",
436
+ "mutable": true,
437
+ "complexType": {
438
+ "original": "number | string",
439
+ "resolved": "number | string",
440
+ "references": {}
441
+ },
442
+ "required": false,
443
+ "optional": false,
444
+ "docs": {
445
+ "tags": [],
446
+ "text": "The maximum value allowed to pick."
447
+ },
448
+ "attribute": "max",
449
+ "reflect": true
450
+ },
451
+ "roundtrip": {
452
+ "type": "boolean",
453
+ "mutable": false,
454
+ "complexType": {
455
+ "original": "boolean",
456
+ "resolved": "boolean",
457
+ "references": {}
458
+ },
459
+ "required": false,
460
+ "optional": false,
461
+ "docs": {
462
+ "tags": [],
463
+ "text": "Define whether the picker should to a roundtrip i.e. start at max when reaching min and vice versa."
464
+ },
465
+ "attribute": "roundtrip",
466
+ "reflect": true,
467
+ "defaultValue": "true"
468
+ },
469
+ "step": {
470
+ "type": "number",
471
+ "mutable": false,
472
+ "complexType": {
473
+ "original": "number",
474
+ "resolved": "number",
475
+ "references": {}
476
+ },
477
+ "required": false,
478
+ "optional": false,
479
+ "docs": {
480
+ "tags": [],
481
+ "text": "Defines how many steps should be taken when navigating"
482
+ },
483
+ "attribute": "step",
484
+ "reflect": true,
485
+ "defaultValue": "1"
486
+ },
487
+ "items": {
488
+ "type": "unknown",
489
+ "mutable": false,
490
+ "complexType": {
491
+ "original": "string[]",
492
+ "resolved": "string[]",
493
+ "references": {}
494
+ },
495
+ "required": false,
496
+ "optional": false,
497
+ "docs": {
498
+ "tags": [],
499
+ "text": "Defines a custom list of items you can iterate through"
500
+ }
501
+ },
502
+ "padded": {
503
+ "type": "boolean",
504
+ "mutable": false,
505
+ "complexType": {
506
+ "original": "boolean",
507
+ "resolved": "boolean",
508
+ "references": {}
509
+ },
510
+ "required": false,
511
+ "optional": false,
512
+ "docs": {
513
+ "tags": [],
514
+ "text": "Defines whether the items should be padded"
515
+ },
516
+ "attribute": "padded",
517
+ "reflect": false,
518
+ "defaultValue": "false"
519
+ },
520
+ "paddingLength": {
521
+ "type": "number",
522
+ "mutable": false,
523
+ "complexType": {
524
+ "original": "number",
525
+ "resolved": "number",
526
+ "references": {}
527
+ },
528
+ "required": false,
529
+ "optional": false,
530
+ "docs": {
531
+ "tags": [],
532
+ "text": "Defines the length of the padded area"
533
+ },
534
+ "attribute": "padding-length",
535
+ "reflect": false,
536
+ "defaultValue": "2"
537
+ },
538
+ "paddingChar": {
539
+ "type": "string",
540
+ "mutable": false,
541
+ "complexType": {
542
+ "original": "string",
543
+ "resolved": "string",
544
+ "references": {}
545
+ },
546
+ "required": false,
547
+ "optional": false,
548
+ "docs": {
549
+ "tags": [],
550
+ "text": "Defines the character used for padding"
551
+ },
552
+ "attribute": "padding-char",
553
+ "reflect": false,
554
+ "defaultValue": "'0'"
555
+ },
556
+ "paddingDirection": {
557
+ "type": "string",
558
+ "mutable": false,
559
+ "complexType": {
560
+ "original": "ItemPickerPaddingDirection",
561
+ "resolved": "ItemPickerPaddingDirection.AFTER | ItemPickerPaddingDirection.BEFORE",
562
+ "references": {
563
+ "ItemPickerPaddingDirection": {
564
+ "location": "import",
565
+ "path": "./types"
566
+ }
567
+ }
568
+ },
569
+ "required": false,
570
+ "optional": false,
571
+ "docs": {
572
+ "tags": [],
573
+ "text": "Defines whether the padding should be before or after the value. You can either use 'before' or 'after'. By default\nbefore is selected"
574
+ },
575
+ "attribute": "padding-direction",
576
+ "reflect": false,
577
+ "defaultValue": "ItemPickerPaddingDirection.BEFORE"
578
+ },
579
+ "timeout": {
580
+ "type": "number",
581
+ "mutable": false,
582
+ "complexType": {
583
+ "original": "number",
584
+ "resolved": "number",
585
+ "references": {}
586
+ },
587
+ "required": false,
588
+ "optional": false,
589
+ "docs": {
590
+ "tags": [],
591
+ "text": "Set the amount of time, in milliseconds, to wait to trigger faster switching between items."
592
+ },
593
+ "attribute": "timeout",
594
+ "reflect": false,
595
+ "defaultValue": "DEFAULT_DEBOUNCE_FAST"
596
+ },
597
+ "interval": {
598
+ "type": "number",
599
+ "mutable": false,
600
+ "complexType": {
601
+ "original": "number",
602
+ "resolved": "number",
603
+ "references": {}
604
+ },
605
+ "required": false,
606
+ "optional": false,
607
+ "docs": {
608
+ "tags": [],
609
+ "text": "Set the amount of time, in milliseconds, to wait between switching to next item when mouse button is held pressed."
610
+ },
611
+ "attribute": "interval",
612
+ "reflect": false,
613
+ "defaultValue": "DEFAULT_DEBOUNCE_INSANELY_FAST"
614
+ },
615
+ "debounce": {
616
+ "type": "number",
617
+ "mutable": false,
618
+ "complexType": {
619
+ "original": "number",
620
+ "resolved": "number",
621
+ "references": {}
622
+ },
623
+ "required": false,
624
+ "optional": false,
625
+ "docs": {
626
+ "tags": [],
627
+ "text": "Set the amount of time, in milliseconds, to wait to trigger the `six-item-picker-change-debounced` event.\nIf you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\nis a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click\n(and keep pressed) and once you release"
628
+ },
629
+ "attribute": "debounce",
630
+ "reflect": false,
631
+ "defaultValue": "DEFAULT_DEBOUNCE_FAST"
632
+ }
633
+ }; }
634
+ static get states() { return {
635
+ "_items": {},
636
+ "_itemIndexes": {}
637
+ }; }
638
+ static get events() { return [{
639
+ "method": "sixChange",
640
+ "name": "six-item-picker-change",
641
+ "bubbles": true,
642
+ "cancelable": true,
643
+ "composed": true,
644
+ "docs": {
645
+ "tags": [],
646
+ "text": "Emitted when the item picker's value changes"
647
+ },
648
+ "complexType": {
649
+ "original": "SixItemPickerChangePayload",
650
+ "resolved": "number | string",
651
+ "references": {
652
+ "SixItemPickerChangePayload": {
653
+ "location": "local"
654
+ }
655
+ }
656
+ }
657
+ }, {
658
+ "method": "sixChangeDebounced",
659
+ "name": "six-item-picker-change-debounced",
660
+ "bubbles": true,
661
+ "cancelable": true,
662
+ "composed": true,
663
+ "docs": {
664
+ "tags": [],
665
+ "text": "Emitted when the item picker's value changes, but debounced"
666
+ },
667
+ "complexType": {
668
+ "original": "SixItemPickerChangePayload",
669
+ "resolved": "number | string",
670
+ "references": {
671
+ "SixItemPickerChangePayload": {
672
+ "location": "local"
673
+ }
674
+ }
675
+ }
676
+ }]; }
677
+ static get elementRef() { return "host"; }
678
+ static get watchers() { return [{
679
+ "propName": "value",
680
+ "methodName": "handleValueChange"
681
+ }, {
682
+ "propName": "debounce",
683
+ "methodName": "debounceChanged"
684
+ }, {
685
+ "propName": "items",
686
+ "methodName": "handleSetChange"
687
+ }]; }
688
+ }