igniteui-webcomponents 7.3.2 → 7.4.1

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 (478) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/animations/easings.d.ts +21 -31
  3. package/animations/easings.js +21 -34
  4. package/animations/easings.js.map +1 -1
  5. package/animations/player.d.ts +8 -16
  6. package/animations/player.js +5 -8
  7. package/animations/player.js.map +1 -1
  8. package/animations/view-transition.d.ts +10 -10
  9. package/animations/view-transition.js +26 -37
  10. package/animations/view-transition.js.map +1 -1
  11. package/components/breadcrumb/breadcrumb.d.ts +74 -0
  12. package/components/breadcrumb/breadcrumb.js +107 -0
  13. package/components/breadcrumb/breadcrumb.js.map +1 -0
  14. package/components/breadcrumb/breadcrumbs.d.ts +60 -0
  15. package/components/breadcrumb/breadcrumbs.js +50 -0
  16. package/components/breadcrumb/breadcrumbs.js.map +1 -0
  17. package/components/breadcrumb/themes/breadcrumb.base.css.js +3 -0
  18. package/components/breadcrumb/themes/breadcrumb.base.css.js.map +1 -0
  19. package/components/breadcrumb/themes/breadcrumbs.base.css.d.ts +1 -0
  20. package/components/{resize-container/themes/resize-container.base.css.js → breadcrumb/themes/breadcrumbs.base.css.js} +2 -2
  21. package/components/breadcrumb/themes/breadcrumbs.base.css.js.map +1 -0
  22. package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.d.ts +1 -0
  23. package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.js +3 -0
  24. package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.js.map +1 -0
  25. package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.d.ts +1 -0
  26. package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.js +3 -0
  27. package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.js.map +1 -0
  28. package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.d.ts +1 -0
  29. package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.js +3 -0
  30. package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.js.map +1 -0
  31. package/components/breadcrumb/themes/dark/breadcrumb.material.css.d.ts +1 -0
  32. package/components/breadcrumb/themes/dark/breadcrumb.material.css.js +3 -0
  33. package/components/breadcrumb/themes/dark/breadcrumb.material.css.js.map +1 -0
  34. package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.d.ts +1 -0
  35. package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.js +3 -0
  36. package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.js.map +1 -0
  37. package/components/breadcrumb/themes/light/breadcrumb.fluent.css.d.ts +1 -0
  38. package/components/breadcrumb/themes/light/breadcrumb.fluent.css.js +3 -0
  39. package/components/breadcrumb/themes/light/breadcrumb.fluent.css.js.map +1 -0
  40. package/components/breadcrumb/themes/light/breadcrumb.indigo.css.d.ts +1 -0
  41. package/components/breadcrumb/themes/light/breadcrumb.indigo.css.js +3 -0
  42. package/components/breadcrumb/themes/light/breadcrumb.indigo.css.js.map +1 -0
  43. package/components/breadcrumb/themes/light/breadcrumb.material.css.d.ts +1 -0
  44. package/components/breadcrumb/themes/light/breadcrumb.material.css.js +3 -0
  45. package/components/breadcrumb/themes/light/breadcrumb.material.css.js.map +1 -0
  46. package/components/breadcrumb/themes/light/breadcrumb.shared.css.d.ts +1 -0
  47. package/components/breadcrumb/themes/light/breadcrumb.shared.css.js +3 -0
  48. package/components/breadcrumb/themes/light/breadcrumb.shared.css.js.map +1 -0
  49. package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.d.ts +1 -0
  50. package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.js +3 -0
  51. package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.js.map +1 -0
  52. package/components/breadcrumb/themes/shared/breadcrumb.common.css.d.ts +1 -0
  53. package/components/breadcrumb/themes/shared/breadcrumb.common.css.js +3 -0
  54. package/components/breadcrumb/themes/shared/breadcrumb.common.css.js.map +1 -0
  55. package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.d.ts +1 -0
  56. package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.js +3 -0
  57. package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.js.map +1 -0
  58. package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.d.ts +1 -0
  59. package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.js +3 -0
  60. package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.js.map +1 -0
  61. package/components/breadcrumb/themes/shared/breadcrumb.material.css.d.ts +1 -0
  62. package/components/breadcrumb/themes/shared/breadcrumb.material.css.js +3 -0
  63. package/components/breadcrumb/themes/shared/breadcrumb.material.css.js.map +1 -0
  64. package/components/breadcrumb/themes/themes.d.ts +2 -0
  65. package/components/breadcrumb/themes/themes.js +50 -0
  66. package/components/breadcrumb/themes/themes.js.map +1 -0
  67. package/components/button/button.d.ts +0 -2
  68. package/components/button/button.js.map +1 -1
  69. package/components/button-group/button-group.d.ts +42 -12
  70. package/components/button-group/button-group.js +82 -34
  71. package/components/button-group/button-group.js.map +1 -1
  72. package/components/button-group/toggle-button.d.ts +6 -1
  73. package/components/button-group/toggle-button.js +28 -2
  74. package/components/button-group/toggle-button.js.map +1 -1
  75. package/components/calendar/base.js +2 -1
  76. package/components/calendar/base.js.map +1 -1
  77. package/components/calendar/calendar.d.ts +2 -3
  78. package/components/calendar/calendar.js.map +1 -1
  79. package/components/calendar/days-view/days-view.d.ts +2 -2
  80. package/components/calendar/days-view/days-view.js.map +1 -1
  81. package/components/carousel/carousel-indicator.js +1 -0
  82. package/components/carousel/carousel-indicator.js.map +1 -1
  83. package/components/carousel/carousel-slide.d.ts +1 -1
  84. package/components/carousel/carousel-slide.js.map +1 -1
  85. package/components/carousel/carousel.d.ts +3 -3
  86. package/components/carousel/carousel.js.map +1 -1
  87. package/components/chat/chat-input.d.ts +1 -2
  88. package/components/chat/chat-input.js +1 -1
  89. package/components/chat/chat-input.js.map +1 -1
  90. package/components/chat/chat-state.d.ts +8 -9
  91. package/components/chat/chat-state.js.map +1 -1
  92. package/components/chat/chat.d.ts +1 -3
  93. package/components/chat/chat.js +2 -2
  94. package/components/chat/chat.js.map +1 -1
  95. package/components/chat/message-attachments.d.ts +6 -15
  96. package/components/chat/message-attachments.js.map +1 -1
  97. package/components/chat/utils.d.ts +0 -1
  98. package/components/chat/utils.js +1 -1
  99. package/components/chat/utils.js.map +1 -1
  100. package/components/checkbox/checkbox-base.d.ts +3 -1
  101. package/components/checkbox/checkbox-base.js +4 -0
  102. package/components/checkbox/checkbox-base.js.map +1 -1
  103. package/components/checkbox/checkbox.js +4 -12
  104. package/components/checkbox/checkbox.js.map +1 -1
  105. package/components/checkbox/switch.js +1 -8
  106. package/components/checkbox/switch.js.map +1 -1
  107. package/components/chip/chip.d.ts +2 -2
  108. package/components/chip/chip.js.map +1 -1
  109. package/components/color-picker/color-picker.d.ts +35 -34
  110. package/components/color-picker/color-picker.js +12 -7
  111. package/components/color-picker/color-picker.js.map +1 -1
  112. package/components/color-picker/common.d.ts +0 -2
  113. package/components/color-picker/common.js +2 -2
  114. package/components/color-picker/common.js.map +1 -1
  115. package/components/color-picker/converters.js.map +1 -1
  116. package/components/color-picker/picker-canvas.js.map +1 -1
  117. package/components/combo/combo.d.ts +24 -24
  118. package/components/combo/combo.js +21 -26
  119. package/components/combo/combo.js.map +1 -1
  120. package/components/combo/controllers/data.d.ts +7 -10
  121. package/components/combo/controllers/data.js.map +1 -1
  122. package/components/date-picker/date-picker.base.d.ts +22 -27
  123. package/components/date-picker/date-picker.base.js +9 -3
  124. package/components/date-picker/date-picker.base.js.map +1 -1
  125. package/components/date-picker/date-picker.d.ts +1 -1
  126. package/components/date-picker/date-picker.js +5 -3
  127. package/components/date-picker/date-picker.js.map +1 -1
  128. package/components/date-range-picker/date-range-input.d.ts +0 -2
  129. package/components/date-range-picker/date-range-input.js +0 -6
  130. package/components/date-range-picker/date-range-input.js.map +1 -1
  131. package/components/date-range-picker/date-range-picker.d.ts +22 -31
  132. package/components/date-range-picker/date-range-picker.js +7 -7
  133. package/components/date-range-picker/date-range-picker.js.map +1 -1
  134. package/components/date-range-picker/i18n.d.ts +21 -0
  135. package/components/date-range-picker/i18n.js +10 -0
  136. package/components/date-range-picker/i18n.js.map +1 -0
  137. package/components/date-range-picker/predefined-ranges-area.d.ts +3 -3
  138. package/components/date-range-picker/predefined-ranges-area.js +2 -5
  139. package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
  140. package/components/date-range-picker/validators.d.ts +0 -4
  141. package/components/date-range-picker/validators.js +4 -4
  142. package/components/date-range-picker/validators.js.map +1 -1
  143. package/components/date-time-input/date-time-input.base.d.ts +42 -40
  144. package/components/date-time-input/date-time-input.base.js +9 -5
  145. package/components/date-time-input/date-time-input.base.js.map +1 -1
  146. package/components/date-time-input/date-time-input.d.ts +1 -11
  147. package/components/date-time-input/date-time-input.js +0 -6
  148. package/components/date-time-input/date-time-input.js.map +1 -1
  149. package/components/date-time-input/datetime-mask-parser.d.ts +0 -10
  150. package/components/date-time-input/datetime-mask-parser.js +1 -1
  151. package/components/date-time-input/datetime-mask-parser.js.map +1 -1
  152. package/components/dialog/dialog.js.map +1 -1
  153. package/components/dropdown/dropdown-group.d.ts +2 -10
  154. package/components/dropdown/dropdown-group.js +2 -27
  155. package/components/dropdown/dropdown-group.js.map +1 -1
  156. package/components/dropdown/dropdown.d.ts +17 -23
  157. package/components/dropdown/dropdown.js +5 -17
  158. package/components/dropdown/dropdown.js.map +1 -1
  159. package/components/file-input/file-input.d.ts +7 -2
  160. package/components/file-input/file-input.js +4 -0
  161. package/components/file-input/file-input.js.map +1 -1
  162. package/components/icon/icon.d.ts +1 -1
  163. package/components/icon/icon.registry.d.ts +6 -6
  164. package/components/icon/icon.registry.js.map +1 -1
  165. package/components/input/input-base.d.ts +2 -2
  166. package/components/input/input-base.js +3 -5
  167. package/components/input/input-base.js.map +1 -1
  168. package/components/input/input.d.ts +3 -3
  169. package/components/input/input.js.map +1 -1
  170. package/components/mask-input/mask-history.d.ts +22 -18
  171. package/components/mask-input/mask-history.js.map +1 -1
  172. package/components/mask-input/mask-input.d.ts +1 -1
  173. package/components/mask-input/mask-parser.d.ts +11 -13
  174. package/components/mask-input/mask-parser.js.map +1 -1
  175. package/components/popover/popover.d.ts +45 -34
  176. package/components/popover/popover.js +54 -122
  177. package/components/popover/popover.js.map +1 -1
  178. package/components/popover/position/arrow.d.ts +19 -0
  179. package/components/popover/position/arrow.js +33 -0
  180. package/components/popover/position/arrow.js.map +1 -0
  181. package/components/popover/position/floating.d.ts +40 -0
  182. package/components/popover/position/floating.js +146 -0
  183. package/components/popover/position/floating.js.map +1 -0
  184. package/components/popover/position/native.d.ts +45 -0
  185. package/components/popover/position/native.js +158 -0
  186. package/components/popover/position/native.js.map +1 -0
  187. package/components/popover/position/strategy.d.ts +37 -0
  188. package/components/popover/position/strategy.js +21 -0
  189. package/components/popover/position/strategy.js.map +1 -0
  190. package/components/popover/position/types.d.ts +26 -0
  191. package/components/popover/position/types.js +15 -0
  192. package/components/popover/position/types.js.map +1 -0
  193. package/components/popover/themes/light/popover.base.css.js +1 -1
  194. package/components/popover/themes/light/popover.base.css.js.map +1 -1
  195. package/components/progress/circular-progress.d.ts +0 -5
  196. package/components/progress/circular-progress.js.map +1 -1
  197. package/components/qr-code/qr-code.d.ts +1 -1
  198. package/components/radio/radio.d.ts +6 -4
  199. package/components/radio/radio.js +24 -25
  200. package/components/radio/radio.js.map +1 -1
  201. package/components/radio-group/radio-group.js.map +1 -1
  202. package/components/rating/rating.d.ts +9 -6
  203. package/components/rating/rating.js +17 -18
  204. package/components/rating/rating.js.map +1 -1
  205. package/components/select/select-group.d.ts +5 -10
  206. package/components/select/select-group.js +10 -34
  207. package/components/select/select-group.js.map +1 -1
  208. package/components/select/select.d.ts +12 -20
  209. package/components/select/select.js +5 -15
  210. package/components/select/select.js.map +1 -1
  211. package/components/slider/range-slider.d.ts +0 -1
  212. package/components/slider/range-slider.js +6 -11
  213. package/components/slider/range-slider.js.map +1 -1
  214. package/components/slider/slider-base.d.ts +4 -1
  215. package/components/slider/slider-base.js +20 -18
  216. package/components/slider/slider-base.js.map +1 -1
  217. package/components/slider/slider.d.ts +2 -0
  218. package/components/slider/slider.js +5 -1
  219. package/components/slider/slider.js.map +1 -1
  220. package/components/splitter/splitter.d.ts +6 -6
  221. package/components/splitter/splitter.js.map +1 -1
  222. package/components/textarea/textarea.d.ts +2 -5
  223. package/components/textarea/textarea.js +3 -5
  224. package/components/textarea/textarea.js.map +1 -1
  225. package/components/tile-manager/tile-manager.d.ts +6 -7
  226. package/components/tile-manager/tile-manager.js.map +1 -1
  227. package/components/tile-manager/tile.d.ts +3 -3
  228. package/components/tile-manager/tile.js.map +1 -1
  229. package/components/toast/toast.d.ts +0 -2
  230. package/components/toast/toast.js.map +1 -1
  231. package/components/tooltip/controller.js.map +1 -1
  232. package/components/tooltip/service.js +4 -5
  233. package/components/tooltip/service.js.map +1 -1
  234. package/components/tooltip/tooltip.d.ts +34 -13
  235. package/components/tooltip/tooltip.js +8 -4
  236. package/components/tooltip/tooltip.js.map +1 -1
  237. package/components/tree/tree-item.d.ts +6 -6
  238. package/components/tree/tree-item.js.map +1 -1
  239. package/components/tree/tree.navigation.d.ts +5 -6
  240. package/components/tree/tree.navigation.js.map +1 -1
  241. package/components/tree/tree.selection.js.map +1 -1
  242. package/components/types.d.ts +1 -1
  243. package/components/types.js.map +1 -1
  244. package/components/validation-container/validation-container.js +2 -1
  245. package/components/validation-container/validation-container.js.map +1 -1
  246. package/components/virtualization/engine.d.ts +40 -9
  247. package/components/virtualization/engine.js +126 -61
  248. package/components/virtualization/engine.js.map +1 -1
  249. package/components/virtualization/recycle.d.ts +13 -0
  250. package/components/virtualization/recycle.js +152 -0
  251. package/components/virtualization/recycle.js.map +1 -0
  252. package/components/virtualization/virtualization.d.ts +84 -65
  253. package/components/virtualization/virtualization.js +20 -16
  254. package/components/virtualization/virtualization.js.map +1 -1
  255. package/custom-elements.json +18455 -19551
  256. package/igniteui-webcomponents.css-data.json +2 -2
  257. package/igniteui-webcomponents.html-data.json +1 -1
  258. package/index.d.ts +3 -1
  259. package/index.js +2 -0
  260. package/index.js.map +1 -1
  261. package/internals/abort-handler.d.ts +13 -25
  262. package/internals/abort-handler.js +4 -6
  263. package/internals/abort-handler.js.map +1 -1
  264. package/internals/context.d.ts +13 -7
  265. package/internals/context.js +2 -1
  266. package/internals/context.js.map +1 -1
  267. package/internals/controllers/adopt-styles.d.ts +19 -20
  268. package/internals/controllers/adopt-styles.js +3 -8
  269. package/internals/controllers/adopt-styles.js.map +1 -1
  270. package/internals/controllers/aria-projection.d.ts +100 -61
  271. package/internals/controllers/aria-projection.js +81 -31
  272. package/internals/controllers/aria-projection.js.map +1 -1
  273. package/internals/controllers/async-consumer.js.map +1 -1
  274. package/internals/controllers/command.d.ts +15 -30
  275. package/internals/controllers/command.js +2 -7
  276. package/internals/controllers/command.js.map +1 -1
  277. package/internals/controllers/context-provider.d.ts +7 -13
  278. package/internals/controllers/context-provider.js.map +1 -1
  279. package/internals/controllers/focus-ring.d.ts +10 -30
  280. package/internals/controllers/focus-ring.js +6 -12
  281. package/internals/controllers/focus-ring.js.map +1 -1
  282. package/internals/controllers/fullscreen.d.ts +7 -23
  283. package/internals/controllers/fullscreen.js +3 -9
  284. package/internals/controllers/fullscreen.js.map +1 -1
  285. package/internals/controllers/gestures.d.ts +10 -29
  286. package/internals/controllers/gestures.js +1 -3
  287. package/internals/controllers/gestures.js.map +1 -1
  288. package/internals/controllers/group.d.ts +13 -30
  289. package/internals/controllers/group.js.map +1 -1
  290. package/internals/controllers/host-listeners.d.ts +28 -0
  291. package/internals/controllers/host-listeners.js +27 -0
  292. package/internals/controllers/host-listeners.js.map +1 -0
  293. package/internals/controllers/id-resolver.d.ts +8 -9
  294. package/internals/controllers/id-resolver.js +6 -14
  295. package/internals/controllers/id-resolver.js.map +1 -1
  296. package/internals/controllers/internals.d.ts +53 -104
  297. package/internals/controllers/internals.js +40 -13
  298. package/internals/controllers/internals.js.map +1 -1
  299. package/internals/controllers/key-bindings.d.ts +61 -158
  300. package/internals/controllers/key-bindings.js +68 -67
  301. package/internals/controllers/key-bindings.js.map +1 -1
  302. package/internals/controllers/keys.d.ts +32 -0
  303. package/internals/controllers/keys.js +20 -0
  304. package/internals/controllers/keys.js.map +1 -0
  305. package/internals/controllers/mutation-observer.d.ts +14 -37
  306. package/internals/controllers/mutation-observer.js +1 -1
  307. package/internals/controllers/mutation-observer.js.map +1 -1
  308. package/internals/controllers/resize-observer.d.ts +9 -19
  309. package/internals/controllers/resize-observer.js.map +1 -1
  310. package/internals/controllers/root-click.d.ts +11 -42
  311. package/internals/controllers/root-click.js +4 -6
  312. package/internals/controllers/root-click.js.map +1 -1
  313. package/internals/controllers/roving-focus.d.ts +16 -35
  314. package/internals/controllers/roving-focus.js.map +1 -1
  315. package/internals/controllers/slot.d.ts +25 -54
  316. package/internals/controllers/slot.js +6 -6
  317. package/internals/controllers/slot.js.map +1 -1
  318. package/internals/controllers/toggle.d.ts +44 -48
  319. package/internals/controllers/toggle.js.map +1 -1
  320. package/internals/date/compare.js.map +1 -1
  321. package/internals/date/converters.d.ts +10 -7
  322. package/internals/date/converters.js.map +1 -1
  323. package/internals/date/model.d.ts +9 -16
  324. package/internals/date/model.js +22 -25
  325. package/internals/date/model.js.map +1 -1
  326. package/internals/decorators/blazorAdditionalDependencies.d.ts +4 -2
  327. package/internals/decorators/blazorAdditionalDependencies.js.map +1 -1
  328. package/internals/decorators/blazorDeepImport.d.ts +1 -3
  329. package/internals/decorators/blazorDeepImport.js.map +1 -1
  330. package/internals/decorators/blazorInclude.d.ts +3 -2
  331. package/internals/decorators/blazorInclude.js.map +1 -1
  332. package/internals/decorators/blazorIndirectRender.d.ts +1 -3
  333. package/internals/decorators/blazorIndirectRender.js.map +1 -1
  334. package/internals/decorators/blazorSuppressComponent.d.ts +1 -3
  335. package/internals/decorators/blazorSuppressComponent.js.map +1 -1
  336. package/internals/decorators/coerced-property.d.ts +14 -20
  337. package/internals/decorators/coerced-property.js.map +1 -1
  338. package/internals/decorators/shadow-options.d.ts +2 -5
  339. package/internals/decorators/shadow-options.js.map +1 -1
  340. package/internals/definitions/defineAllComponents.js +2 -0
  341. package/internals/definitions/defineAllComponents.js.map +1 -1
  342. package/internals/directives/drag.d.ts +51 -81
  343. package/internals/directives/drag.js +27 -89
  344. package/internals/directives/drag.js.map +1 -1
  345. package/internals/directives/pointer-operation.d.ts +75 -0
  346. package/internals/directives/pointer-operation.js +92 -0
  347. package/internals/directives/pointer-operation.js.map +1 -0
  348. package/internals/directives/resize.d.ts +36 -64
  349. package/internals/directives/resize.js +18 -85
  350. package/internals/directives/resize.js.map +1 -1
  351. package/internals/i18n/EN/calendar.resources.d.ts +8 -2
  352. package/internals/i18n/EN/calendar.resources.js +2 -2
  353. package/internals/i18n/EN/calendar.resources.js.map +1 -1
  354. package/internals/i18n/EN/chat.resources.d.ts +8 -2
  355. package/internals/i18n/EN/chat.resources.js +3 -10
  356. package/internals/i18n/EN/chat.resources.js.map +1 -1
  357. package/internals/i18n/EN/date-picker.resources.d.ts +6 -4
  358. package/internals/i18n/EN/date-picker.resources.js +1 -7
  359. package/internals/i18n/EN/date-picker.resources.js.map +1 -1
  360. package/internals/i18n/EN/date-range-picker.resources.d.ts +9 -2
  361. package/internals/i18n/EN/date-range-picker.resources.js +2 -2
  362. package/internals/i18n/EN/date-range-picker.resources.js.map +1 -1
  363. package/internals/i18n/i18n-controller.d.ts +44 -46
  364. package/internals/i18n/i18n-controller.js +46 -33
  365. package/internals/i18n/i18n-controller.js.map +1 -1
  366. package/internals/i18n/utils.d.ts +9 -4
  367. package/internals/i18n/utils.js +4 -27
  368. package/internals/i18n/utils.js.map +1 -1
  369. package/internals/mixins/alert.d.ts +10 -25
  370. package/internals/mixins/alert.js.map +1 -1
  371. package/internals/mixins/combo-box.d.ts +21 -11
  372. package/internals/mixins/combo-box.js +16 -22
  373. package/internals/mixins/combo-box.js.map +1 -1
  374. package/internals/mixins/event-emitter.js +9 -11
  375. package/internals/mixins/event-emitter.js.map +1 -1
  376. package/internals/mixins/forms/associated-required.d.ts +4 -4
  377. package/internals/mixins/forms/associated-required.js.map +1 -1
  378. package/internals/mixins/forms/associated.d.ts +4 -2
  379. package/internals/mixins/forms/associated.js +42 -19
  380. package/internals/mixins/forms/associated.js.map +1 -1
  381. package/internals/mixins/forms/form-transformers.js.map +1 -1
  382. package/internals/mixins/forms/types.d.ts +27 -78
  383. package/internals/mixins/forms/types.js.map +1 -1
  384. package/internals/mixins/group.d.ts +18 -0
  385. package/internals/mixins/group.js +37 -0
  386. package/internals/mixins/group.js.map +1 -0
  387. package/internals/mixins/i18n.d.ts +10 -16
  388. package/internals/mixins/i18n.js.map +1 -1
  389. package/internals/mixins/mask-behavior.d.ts +8 -22
  390. package/internals/mixins/mask-behavior.js +1 -2
  391. package/internals/mixins/mask-behavior.js.map +1 -1
  392. package/internals/mixins/option.d.ts +1 -2
  393. package/internals/mixins/option.js +2 -1
  394. package/internals/mixins/option.js.map +1 -1
  395. package/internals/part-map.d.ts +4 -2
  396. package/internals/part-map.js +1 -1
  397. package/internals/part-map.js.map +1 -1
  398. package/internals/templates/input-shell.d.ts +8 -17
  399. package/internals/templates/input-shell.js +4 -1
  400. package/internals/templates/input-shell.js.map +1 -1
  401. package/internals/templates/masked-input.d.ts +7 -8
  402. package/internals/templates/masked-input.js.map +1 -1
  403. package/internals/templates/slotted-icon.d.ts +7 -12
  404. package/internals/templates/slotted-icon.js.map +1 -1
  405. package/internals/templates/toggle-shell.d.ts +19 -19
  406. package/internals/templates/toggle-shell.js +12 -8
  407. package/internals/templates/toggle-shell.js.map +1 -1
  408. package/internals/timing.d.ts +5 -14
  409. package/internals/timing.js.map +1 -1
  410. package/internals/utils/arrays.d.ts +21 -21
  411. package/internals/utils/arrays.js +14 -0
  412. package/internals/utils/arrays.js.map +1 -1
  413. package/internals/utils/dom.d.ts +53 -41
  414. package/internals/utils/dom.js +3 -4
  415. package/internals/utils/dom.js.map +1 -1
  416. package/internals/utils/events.d.ts +29 -16
  417. package/internals/utils/events.js +9 -1
  418. package/internals/utils/events.js.map +1 -1
  419. package/internals/utils/lit.d.ts +5 -2
  420. package/internals/utils/lit.js.map +1 -1
  421. package/internals/utils/math.d.ts +8 -6
  422. package/internals/utils/math.js.map +1 -1
  423. package/internals/utils/objects.d.ts +3 -20
  424. package/internals/utils/objects.js +1 -39
  425. package/internals/utils/objects.js.map +1 -1
  426. package/internals/utils/strings.d.ts +9 -11
  427. package/internals/utils/strings.js.map +1 -1
  428. package/internals/utils/types.d.ts +16 -3
  429. package/internals/utils/types.js +3 -0
  430. package/internals/utils/types.js.map +1 -1
  431. package/internals/validators.d.ts +9 -8
  432. package/internals/validators.js +12 -6
  433. package/internals/validators.js.map +1 -1
  434. package/package.json +1 -1
  435. package/skills/README.md +4 -3
  436. package/skills/igniteui-wc-choose-components/SKILL.md +2 -1
  437. package/skills/igniteui-wc-customize-component-theme/SKILL.md +2 -1
  438. package/skills/igniteui-wc-figma-to-app/SKILL.md +328 -0
  439. package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +343 -0
  440. package/skills/igniteui-wc-figma-to-app/references/design-provenance.md +199 -0
  441. package/skills/igniteui-wc-figma-to-app/references/design-token-bridge.md +489 -0
  442. package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +370 -0
  443. package/skills/igniteui-wc-figma-to-app/references/figma-exploration.md +222 -0
  444. package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +363 -0
  445. package/skills/igniteui-wc-figma-to-app/references/project-setup.md +105 -0
  446. package/skills/igniteui-wc-figma-to-app/references/theme-generation.md +180 -0
  447. package/skills/igniteui-wc-figma-to-app/references/validation-patterns.md +370 -0
  448. package/skills/igniteui-wc-generate-from-image-design/SKILL.md +2 -1
  449. package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +3 -3
  450. package/skills/igniteui-wc-grids/SKILL.md +133 -0
  451. package/skills/igniteui-wc-integrate-with-framework/SKILL.md +2 -1
  452. package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +2 -1
  453. package/skills/igniteui-wc-optimize-bundle-size/SKILL.md +2 -1
  454. package/theming/config.d.ts +14 -5
  455. package/theming/config.js +38 -18
  456. package/theming/config.js.map +1 -1
  457. package/theming/context.d.ts +1 -23
  458. package/theming/context.js.map +1 -1
  459. package/theming/theming-controller.d.ts +2 -32
  460. package/theming/theming-controller.js +15 -21
  461. package/theming/theming-controller.js.map +1 -1
  462. package/theming/theming-event.d.ts +0 -7
  463. package/theming/theming-event.js +0 -13
  464. package/theming/theming-event.js.map +1 -1
  465. package/theming/types.d.ts +1 -8
  466. package/theming/types.js.map +1 -1
  467. package/web-types.json +3 -3
  468. package/animations/presets/slide/index.d.ts +0 -3
  469. package/animations/presets/slide/index.js +0 -16
  470. package/animations/presets/slide/index.js.map +0 -1
  471. package/components/resize-container/themes/resize-container.base.css.js.map +0 -1
  472. package/internals/controllers/root-scroll.d.ts +0 -31
  473. package/internals/controllers/root-scroll.js +0 -71
  474. package/internals/controllers/root-scroll.js.map +0 -1
  475. package/theming/utils.d.ts +0 -11
  476. package/theming/utils.js +0 -20
  477. package/theming/utils.js.map +0 -1
  478. /package/components/{resize-container/themes/resize-container.base.css.d.ts → breadcrumb/themes/breadcrumb.base.css.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"part-map.js","sourceRoot":"","sources":["../../src/internals/part-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAEL,SAAS,EAET,SAAS,EAET,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAM1B,MAAM,gBAAiB,SAAQ,SAAS;IAGtC,YAAY,QAAkB;QAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,IACE,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,SAAS;YACpC,QAAQ,CAAC,IAAI,KAAK,MAAM;YACvB,QAAQ,CAAC,OAAO,EAAE,MAAiB,GAAG,CAAC,EACxC,CAAC;YACD,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAC;QACJ,CAAC;IACH,CAAC;IAEe,MAAM,CAAC,WAAwB;QAC7C,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;aAC5B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;aACjC,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAEe,MAAM,CACpB,IAAmB,EACnB,CAAC,WAAW,CAA4B;QAExC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAEnC,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;YACtC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;YAEhC,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;gBAC/B,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;oBACtB,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBACnB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAChC,CAAC;YACH,CAAC;YAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAClC,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACvC,IAAI,CAAC,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACtB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAClC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5C,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACnB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAMD,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { noChange } from 'lit';\nimport {\n type AttributePart,\n Directive,\n type DirectiveParameters,\n directive,\n type PartInfo,\n PartType,\n} from 'lit/directive.js';\n\nexport interface PartMapInfo {\n readonly [name: string]: boolean | null | undefined;\n}\n\nclass PartMapDirective extends Directive {\n private _previousParts?: Set<string>;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n\n if (\n partInfo.type !== PartType.ATTRIBUTE ||\n partInfo.name !== 'part' ||\n (partInfo.strings?.length as number) > 0\n ) {\n throw new Error(\n '`partMap() can only be used in the `part` attribute and must be the only part in the attribute.'\n );\n }\n }\n\n public override render(partMapInfo: PartMapInfo): string {\n return Object.keys(partMapInfo)\n .filter((key) => partMapInfo[key])\n .join(' ');\n }\n\n public override update(\n part: AttributePart,\n [partMapInfo]: DirectiveParameters<this>\n ) {\n const partList = part.element.part;\n\n if (this._previousParts === undefined) {\n this._previousParts = new Set();\n\n for (const name in partMapInfo) {\n if (partMapInfo[name]) {\n partList.add(name);\n this._previousParts.add(name);\n }\n }\n\n return this.render(partMapInfo);\n }\n\n for (const name of this._previousParts) {\n if (!(name in partMapInfo) || !partMapInfo[name]) {\n partList.remove(name);\n this._previousParts.delete(name);\n }\n }\n\n for (const name in partMapInfo) {\n const value = !!partMapInfo[name];\n if (value && !this._previousParts.has(name)) {\n partList.add(name);\n this._previousParts.add(name);\n }\n }\n\n return noChange;\n }\n}\n\n/**\n * Similar to Lit's {@link https://lit.dev/docs/templates/directives/#classmap | `classMap`} and\n * {@link https://lit.dev/docs/templates/directives/#stylemap | `styleMap`} but for `part` attributes.\n */\nexport const partMap = directive(PartMapDirective);\nexport type { PartMapDirective };\n"]}
1
+ {"version":3,"file":"part-map.js","sourceRoot":"","sources":["../../src/internals/part-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAEL,SAAS,EAET,SAAS,EAET,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAM1B,MAAM,gBAAiB,SAAQ,SAAS;IAGtC,YAAY,QAAkB;QAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,IACE,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,SAAS;YACpC,QAAQ,CAAC,IAAI,KAAK,MAAM;YACvB,QAAQ,CAAC,OAAO,EAAE,MAAiB,GAAG,CAAC,EACxC,CAAC;YACD,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAC;QACJ,CAAC;IACH,CAAC;IAEe,MAAM,CAAC,WAAwB;QAC7C,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;aAC5B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;aACjC,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAEe,MAAM,CACpB,IAAmB,EACnB,CAAC,WAAW,CAA4B;QAExC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAEnC,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;YACtC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;YAEhC,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;gBAC/B,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;oBACtB,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBACnB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAChC,CAAC;YACH,CAAC;YAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAClC,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACvC,IAAI,CAAC,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACtB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAClC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5C,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACnB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAQD,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { noChange } from 'lit';\nimport {\n type AttributePart,\n Directive,\n type DirectiveParameters,\n directive,\n type PartInfo,\n PartType,\n} from 'lit/directive.js';\n\nexport interface PartMapInfo {\n readonly [name: string]: boolean | null | undefined;\n}\n\nclass PartMapDirective extends Directive {\n private _previousParts?: Set<string>;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n\n if (\n partInfo.type !== PartType.ATTRIBUTE ||\n partInfo.name !== 'part' ||\n (partInfo.strings?.length as number) > 0\n ) {\n throw new Error(\n 'partMap() can only be used in the `part` attribute, and must be the only binding in it.'\n );\n }\n }\n\n public override render(partMapInfo: PartMapInfo): string {\n return Object.keys(partMapInfo)\n .filter((key) => partMapInfo[key])\n .join(' ');\n }\n\n public override update(\n part: AttributePart,\n [partMapInfo]: DirectiveParameters<this>\n ) {\n const partList = part.element.part;\n\n if (this._previousParts === undefined) {\n this._previousParts = new Set();\n\n for (const name in partMapInfo) {\n if (partMapInfo[name]) {\n partList.add(name);\n this._previousParts.add(name);\n }\n }\n\n return this.render(partMapInfo);\n }\n\n for (const name of this._previousParts) {\n if (!(name in partMapInfo) || !partMapInfo[name]) {\n partList.remove(name);\n this._previousParts.delete(name);\n }\n }\n\n for (const name in partMapInfo) {\n const value = !!partMapInfo[name];\n if (value && !this._previousParts.has(name)) {\n partList.add(name);\n this._previousParts.add(name);\n }\n }\n\n return noChange;\n }\n}\n\n/**\n * Sets the `part` attribute of an element from a map of part names, like the\n * Lit {@link https://lit.dev/docs/templates/directives/#classmap | `classMap`}\n * and {@link https://lit.dev/docs/templates/directives/#stylemap | `styleMap`}\n * directives.\n */\nexport const partMap = directive(PartMapDirective);\nexport type { PartMapDirective };\n"]}
@@ -1,13 +1,9 @@
1
1
  import { nothing, type TemplateResult } from 'lit';
2
2
  import type { SlotController } from '../controllers/slot.js';
3
3
  import type { IgcFormControl } from '../mixins/forms/types.js';
4
- /** Returns a unique id for native input elements rendered by input components. */
4
+ /** Returns a unique id for a native input element. */
5
5
  export declare const nextInputId: () => string;
6
- /**
7
- * Resolves the shared container part names of an input-like component based
8
- * on its current slotted and filled state.
9
- * Used to apply conditional styling via CSS parts.
10
- */
6
+ /** Returns the shared container part names of an input-like component. */
11
7
  export declare function resolveInputPartNames(slots: Pick<SlotController<'prefix' | 'suffix'>, 'hasAssignedElements'>, base: string, filled: boolean): Record<string, boolean>;
12
8
  export interface InputShellOptions {
13
9
  /** Active theme name. The `material` theme uses the notch layout. */
@@ -20,23 +16,18 @@ export interface InputShellOptions {
20
16
  containerParts: Record<string, boolean>;
21
17
  /** Renders the native `<input>` element. */
22
18
  renderInput: () => TemplateResult;
23
- /** Optional renderer for components that need extra parts inside the container (e.g. file-input). */
19
+ /** Renders extra parts inside the container, as `igc-file-input` needs. */
24
20
  renderFileParts?: () => TemplateResult | typeof nothing;
25
- /**
26
- * Container part names contributed only by the material notch layout
27
- * (e.g. the `placeholder` part of `igc-textarea`).
28
- */
21
+ /** Container part names that only the material notch layout adds. */
29
22
  materialParts?: Record<string, boolean>;
30
23
  /**
31
- * Whether the prefix/suffix wrappers are hidden while their slot has no
32
- * visible assigned elements, driven by the `prefixed` and `suffixed` entries
33
- * of `containerParts`. Off by default, so the wrappers always render.
24
+ * Hides the prefix and suffix wrappers whose `containerParts` entry is
25
+ * false. Off by default, so the wrappers always render.
34
26
  */
35
27
  hideEmptyAffixes?: boolean;
36
28
  }
37
29
  /**
38
- * Renders the shared input chrome (label, prefix, suffix, validator container)
39
- * around a leaf-provided input template, switching layouts between the
40
- * material notch and the standard flow.
30
+ * Renders the label, prefix, suffix and validation container around the input
31
+ * template of a leaf component, in the notch or the standard layout.
41
32
  */
42
33
  export declare function renderInputShell(host: IgcFormControl, { containerParts, materialParts, hideEmptyAffixes, renderFileParts, renderInput, theme, label, labelId, }: InputShellOptions): TemplateResult;
@@ -1,6 +1,7 @@
1
1
  import { html, nothing } from 'lit';
2
2
  import IgcValidationContainerComponent from '../../components/validation-container/validation-container.js';
3
3
  import { partMap } from '../part-map.js';
4
+ import { stopPropagation } from '../utils/events.js';
4
5
  import { createIdGenerator } from '../utils/strings.js';
5
6
  export const nextInputId = createIdGenerator('input');
6
7
  export function resolveInputPartNames(slots, base, filled) {
@@ -17,7 +18,9 @@ export function resolveInputPartNames(slots, base, filled) {
17
18
  }
18
19
  function renderLabel(forId, label) {
19
20
  return label
20
- ? html `<label part="label" for=${forId}>${label}</label>`
21
+ ? html `<label part="label" for=${forId} @click=${stopPropagation}
22
+ >${label}</label
23
+ >`
21
24
  : nothing;
22
25
  }
23
26
  function renderAffix(name, hidden) {
@@ -1 +1 @@
1
- {"version":3,"file":"input-shell.js","sourceRoot":"","sources":["../../../src/internals/templates/input-shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACzD,OAAO,+BAA+B,MAAM,+DAA+D,CAAC;AAG5G,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAOtD,MAAM,UAAU,qBAAqB,CACnC,KAAuE,EACvE,IAAY,EACZ,MAAe;IAEf,OAAO;QACL,CAAC,IAAI,CAAC,EAAE,IAAI;QACZ,QAAQ,EAAE,KAAK,CAAC,mBAAmB,CAAC,QAAQ,EAAE;YAC5C,QAAQ,EAAE,+BAA+B;SAC1C,CAAC;QACF,QAAQ,EAAE,KAAK,CAAC,mBAAmB,CAAC,QAAQ,EAAE;YAC5C,QAAQ,EAAE,+BAA+B;SAC1C,CAAC;QACF,MAAM;KACP,CAAC;AACJ,CAAC;AA4BD,SAAS,WAAW,CAAC,KAAa,EAAE,KAAa;IAC/C,OAAO,KAAK;QACV,CAAC,CAAC,IAAI,CAAA,2BAA2B,KAAK,IAAI,KAAK,UAAU;QACzD,CAAC,CAAC,OAAO,CAAC;AACd,CAAC;AAED,SAAS,WAAW,CAAC,IAAyB,EAAE,MAAe;IAC7D,OAAO,IAAI,CAAA,aAAa,IAAI,YAAY,MAAM;iBAC/B,IAAI;SACZ,CAAC;AACV,CAAC;AAOD,MAAM,UAAU,gBAAgB,CAC9B,IAAoB,EACpB,EACE,cAAc,EACd,aAAa,EACb,gBAAgB,GAAG,KAAK,EACxB,eAAe,EACf,WAAW,EACX,KAAK,EACL,KAAK,EACL,OAAO,GACW;IAEpB,MAAM,SAAS,GAAG,+BAA+B,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC;IACzD,MAAM,MAAM,GAAG,WAAW,CACxB,QAAQ,EACR,gBAAgB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAC7C,CAAC;IACF,MAAM,MAAM,GAAG,WAAW,CACxB,QAAQ,EACR,gBAAgB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAC7C,CAAC;IAEF,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;QACzB,OAAO,IAAI,CAAA;;eAEA,OAAO,CAAC;YACb,GAAG,cAAc;YACjB,GAAG,aAAa;YAChB,QAAQ,EAAE,CAAC,CAAC,KAAK;SAClB,CAAC;;4BAEkB,MAAM;UACxB,KAAK,GAAG,SAAS;4BACC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC;;0BAE7B,MAAM;;QAExB,SAAS;KACZ,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAA;MACP,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC;gBACjB,OAAO,CAAC,cAAc,CAAC;QAC/B,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM;;MAErC,SAAS;GACZ,CAAC;AACJ,CAAC","sourcesContent":["import { html, nothing, type TemplateResult } from 'lit';\nimport IgcValidationContainerComponent from '../../components/validation-container/validation-container.js';\nimport type { SlotController } from '../controllers/slot.js';\nimport type { IgcFormControl } from '../mixins/forms/types.js';\nimport { partMap } from '../part-map.js';\nimport { createIdGenerator } from '../utils/strings.js';\n\n/** Returns a unique id for native input elements rendered by input components. */\nexport const nextInputId = createIdGenerator('input');\n\n/**\n * Resolves the shared container part names of an input-like component based\n * on its current slotted and filled state.\n * Used to apply conditional styling via CSS parts.\n */\nexport function resolveInputPartNames(\n slots: Pick<SlotController<'prefix' | 'suffix'>, 'hasAssignedElements'>,\n base: string,\n filled: boolean\n): Record<string, boolean> {\n return {\n [base]: true,\n prefixed: slots.hasAssignedElements('prefix', {\n selector: '[slot=\"prefix\"]:not([hidden])',\n }),\n suffixed: slots.hasAssignedElements('suffix', {\n selector: '[slot=\"suffix\"]:not([hidden])',\n }),\n filled,\n };\n}\n\nexport interface InputShellOptions {\n /** Active theme name. The `material` theme uses the notch layout. */\n theme: string;\n /** The label text. Empty string skips label rendering. */\n label: string;\n /** The id of the input element used by the label `for` attribute. */\n labelId: string;\n /** Resolved part-name map for the container element. */\n containerParts: Record<string, boolean>;\n /** Renders the native `<input>` element. */\n renderInput: () => TemplateResult;\n /** Optional renderer for components that need extra parts inside the container (e.g. file-input). */\n renderFileParts?: () => TemplateResult | typeof nothing;\n /**\n * Container part names contributed only by the material notch layout\n * (e.g. the `placeholder` part of `igc-textarea`).\n */\n materialParts?: Record<string, boolean>;\n /**\n * Whether the prefix/suffix wrappers are hidden while their slot has no\n * visible assigned elements, driven by the `prefixed` and `suffixed` entries\n * of `containerParts`. Off by default, so the wrappers always render.\n */\n hideEmptyAffixes?: boolean;\n}\n\nfunction renderLabel(forId: string, label: string) {\n return label\n ? html`<label part=\"label\" for=${forId}>${label}</label>`\n : nothing;\n}\n\nfunction renderAffix(name: 'prefix' | 'suffix', hidden: boolean) {\n return html`<div part=${name} ?hidden=${hidden}>\n <slot name=${name}></slot>\n </div>`;\n}\n\n/**\n * Renders the shared input chrome (label, prefix, suffix, validator container)\n * around a leaf-provided input template, switching layouts between the\n * material notch and the standard flow.\n */\nexport function renderInputShell(\n host: IgcFormControl,\n {\n containerParts,\n materialParts,\n hideEmptyAffixes = false,\n renderFileParts,\n renderInput,\n theme,\n label,\n labelId,\n }: InputShellOptions\n): TemplateResult {\n const validator = IgcValidationContainerComponent.create(host);\n const input = renderInput.call(host);\n const fileParts = renderFileParts?.call(host) ?? nothing;\n const prefix = renderAffix(\n 'prefix',\n hideEmptyAffixes && !containerParts.prefixed\n );\n const suffix = renderAffix(\n 'suffix',\n hideEmptyAffixes && !containerParts.suffixed\n );\n\n if (theme === 'material') {\n return html`\n <div\n part=${partMap({\n ...containerParts,\n ...materialParts,\n labelled: !!label,\n })}\n >\n <div part=\"start\">${prefix}</div>\n ${input}${fileParts}\n <div part=\"notch\">${renderLabel(labelId, label)}</div>\n <div part=\"filler\"></div>\n <div part=\"end\">${suffix}</div>\n </div>\n ${validator}\n `;\n }\n\n return html`\n ${renderLabel(labelId, label)}\n <div part=${partMap(containerParts)}>\n ${prefix}${fileParts}${input}${suffix}\n </div>\n ${validator}\n `;\n}\n"]}
1
+ {"version":3,"file":"input-shell.js","sourceRoot":"","sources":["../../../src/internals/templates/input-shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACzD,OAAO,+BAA+B,MAAM,+DAA+D,CAAC;AAG5G,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAGtD,MAAM,UAAU,qBAAqB,CACnC,KAAuE,EACvE,IAAY,EACZ,MAAe;IAEf,OAAO;QACL,CAAC,IAAI,CAAC,EAAE,IAAI;QACZ,QAAQ,EAAE,KAAK,CAAC,mBAAmB,CAAC,QAAQ,EAAE;YAC5C,QAAQ,EAAE,+BAA+B;SAC1C,CAAC;QACF,QAAQ,EAAE,KAAK,CAAC,mBAAmB,CAAC,QAAQ,EAAE;YAC5C,QAAQ,EAAE,+BAA+B;SAC1C,CAAC;QACF,MAAM;KACP,CAAC;AACJ,CAAC;AAkCD,SAAS,WAAW,CAAC,KAAa,EAAE,KAAa;IAC/C,OAAO,KAAK;QACV,CAAC,CAAC,IAAI,CAAA,2BAA2B,KAAK,WAAW,eAAe;WACzD,KAAK;QACR;QACJ,CAAC,CAAC,OAAO,CAAC;AACd,CAAC;AAED,SAAS,WAAW,CAAC,IAAyB,EAAE,MAAe;IAC7D,OAAO,IAAI,CAAA,aAAa,IAAI,YAAY,MAAM;iBAC/B,IAAI;SACZ,CAAC;AACV,CAAC;AAMD,MAAM,UAAU,gBAAgB,CAC9B,IAAoB,EACpB,EACE,cAAc,EACd,aAAa,EACb,gBAAgB,GAAG,KAAK,EACxB,eAAe,EACf,WAAW,EACX,KAAK,EACL,KAAK,EACL,OAAO,GACW;IAEpB,MAAM,SAAS,GAAG,+BAA+B,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC;IACzD,MAAM,MAAM,GAAG,WAAW,CACxB,QAAQ,EACR,gBAAgB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAC7C,CAAC;IACF,MAAM,MAAM,GAAG,WAAW,CACxB,QAAQ,EACR,gBAAgB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAC7C,CAAC;IAEF,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;QACzB,OAAO,IAAI,CAAA;;eAEA,OAAO,CAAC;YACb,GAAG,cAAc;YACjB,GAAG,aAAa;YAChB,QAAQ,EAAE,CAAC,CAAC,KAAK;SAClB,CAAC;;4BAEkB,MAAM;UACxB,KAAK,GAAG,SAAS;4BACC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC;;0BAE7B,MAAM;;QAExB,SAAS;KACZ,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAA;MACP,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC;gBACjB,OAAO,CAAC,cAAc,CAAC;QAC/B,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM;;MAErC,SAAS;GACZ,CAAC;AACJ,CAAC","sourcesContent":["import { html, nothing, type TemplateResult } from 'lit';\nimport IgcValidationContainerComponent from '../../components/validation-container/validation-container.js';\nimport type { SlotController } from '../controllers/slot.js';\nimport type { IgcFormControl } from '../mixins/forms/types.js';\nimport { partMap } from '../part-map.js';\nimport { stopPropagation } from '../utils/events.js';\nimport { createIdGenerator } from '../utils/strings.js';\n\n/** Returns a unique id for a native input element. */\nexport const nextInputId = createIdGenerator('input');\n\n/** Returns the shared container part names of an input-like component. */\nexport function resolveInputPartNames(\n slots: Pick<SlotController<'prefix' | 'suffix'>, 'hasAssignedElements'>,\n base: string,\n filled: boolean\n): Record<string, boolean> {\n return {\n [base]: true,\n prefixed: slots.hasAssignedElements('prefix', {\n selector: '[slot=\"prefix\"]:not([hidden])',\n }),\n suffixed: slots.hasAssignedElements('suffix', {\n selector: '[slot=\"suffix\"]:not([hidden])',\n }),\n filled,\n };\n}\n\nexport interface InputShellOptions {\n /** Active theme name. The `material` theme uses the notch layout. */\n theme: string;\n /** The label text. Empty string skips label rendering. */\n label: string;\n /** The id of the input element used by the label `for` attribute. */\n labelId: string;\n /** Resolved part-name map for the container element. */\n containerParts: Record<string, boolean>;\n /** Renders the native `<input>` element. */\n renderInput: () => TemplateResult;\n /** Renders extra parts inside the container, as `igc-file-input` needs. */\n renderFileParts?: () => TemplateResult | typeof nothing;\n /** Container part names that only the material notch layout adds. */\n materialParts?: Record<string, boolean>;\n /**\n * Hides the prefix and suffix wrappers whose `containerParts` entry is\n * false. Off by default, so the wrappers always render.\n */\n hideEmptyAffixes?: boolean;\n}\n\n/**\n * Renders the label of the input.\n *\n * @remarks\n * A label click reaches the host twice: the label click, then the synthetic\n * click that label activation sends to the input. That double-fires a\n * consumer click handler and breaks the toggles of `igc-combo` and\n * `igc-select`. The label therefore keeps its own click inside the shadow\n * root; activation is a default action, so focus still moves to the input.\n */\nfunction renderLabel(forId: string, label: string) {\n return label\n ? html`<label part=\"label\" for=${forId} @click=${stopPropagation}\n >${label}</label\n >`\n : nothing;\n}\n\nfunction renderAffix(name: 'prefix' | 'suffix', hidden: boolean) {\n return html`<div part=${name} ?hidden=${hidden}>\n <slot name=${name}></slot>\n </div>`;\n}\n\n/**\n * Renders the label, prefix, suffix and validation container around the input\n * template of a leaf component, in the notch or the standard layout.\n */\nexport function renderInputShell(\n host: IgcFormControl,\n {\n containerParts,\n materialParts,\n hideEmptyAffixes = false,\n renderFileParts,\n renderInput,\n theme,\n label,\n labelId,\n }: InputShellOptions\n): TemplateResult {\n const validator = IgcValidationContainerComponent.create(host);\n const input = renderInput.call(host);\n const fileParts = renderFileParts?.call(host) ?? nothing;\n const prefix = renderAffix(\n 'prefix',\n hideEmptyAffixes && !containerParts.prefixed\n );\n const suffix = renderAffix(\n 'suffix',\n hideEmptyAffixes && !containerParts.suffixed\n );\n\n if (theme === 'material') {\n return html`\n <div\n part=${partMap({\n ...containerParts,\n ...materialParts,\n labelled: !!label,\n })}\n >\n <div part=\"start\">${prefix}</div>\n ${input}${fileParts}\n <div part=\"notch\">${renderLabel(labelId, label)}</div>\n <div part=\"filler\"></div>\n <div part=\"end\">${suffix}</div>\n </div>\n ${validator}\n `;\n }\n\n return html`\n ${renderLabel(labelId, label)}\n <div part=${partMap(containerParts)}>\n ${prefix}${fileParts}${input}${suffix}\n </div>\n ${validator}\n `;\n}\n"]}
@@ -9,7 +9,7 @@ export interface MaskedInputOptions {
9
9
  name?: string;
10
10
  /** Current value to render through `live()`. */
11
11
  value: string;
12
- /** Pre-resolved placeholder text. Caller decides empty-string semantics. */
12
+ /** The resolved placeholder text. The caller defines an empty string. */
13
13
  placeholder: string;
14
14
  readOnly: boolean;
15
15
  disabled: boolean;
@@ -18,17 +18,17 @@ export interface MaskedInputOptions {
18
18
  /** When provided, sets the `tabindex` attribute. */
19
19
  tabindex?: number;
20
20
  /**
21
- * Resolved ARIA bindings for the native input - the projected host state
22
- * merged with the editor's own (see `AriaTargetController.resolveBindings`).
21
+ * The projected host state merged with the editor bindings. See
22
+ * `AriaTargetController.resolveBindings`.
23
23
  */
24
24
  aria: ResolvedARIABindings;
25
25
  onInput: (event: InputEvent) => void;
26
- /** Wired to `beforeinput` so the component owns `historyUndo` / `historyRedo`. */
26
+ /** Owns `historyUndo` and `historyRedo` through `beforeinput`. */
27
27
  onBeforeInput: (event: InputEvent) => void;
28
28
  onFocus: (event: FocusEvent) => void;
29
29
  onBlur: (event: FocusEvent) => void;
30
30
  onClick: () => void;
31
- /** Wired to `keydown`, `cut`, and `dragstart` to capture the current selection. */
31
+ /** Captures the selection on `keydown`, `cut` and `dragstart`. */
32
32
  onSetMaskSelection: (event: Event) => void;
33
33
  onCompositionStart: () => void;
34
34
  onCompositionEnd: (event: CompositionEvent) => void;
@@ -38,8 +38,7 @@ export interface MaskedInputOptions {
38
38
  onDragLeave?: () => void;
39
39
  }
40
40
  /**
41
- * Renders the native `<input>` element shared by mask-driven components
42
- * (`igc-mask-input`, `igc-date-time-input`, `igc-date-range-input`).
43
- * Centralizes mask event wiring so leaves only describe their extras.
41
+ * Renders the native `<input>` of the mask-driven components, with the mask
42
+ * event bindings, so a leaf component describes only its extras.
44
43
  */
45
44
  export declare function renderMaskedNativeInput(opts: MaskedInputOptions): TemplateResult;
@@ -1 +1 @@
1
- {"version":3,"file":"masked-input.js","sourceRoot":"","sources":["../../../src/internals/templates/masked-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EACL,YAAY,GAEb,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAiDzC,MAAM,UAAU,uBAAuB,CACrC,IAAwB;IAExB,OAAO,IAAI,CAAA;;WAEF,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;;aAEhB,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;aACvB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;eAClB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;qBACV,IAAI,CAAC,WAAW;kBACnB,IAAI,CAAC,QAAQ;kBACb,IAAI,CAAC,QAAQ;mBACZ,IAAI,CAAC,SAAS;kBACf,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;iBAC1B,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC;QACrD,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;eAChB,IAAI,CAAC,OAAO;qBACN,IAAI,CAAC,aAAa;eACxB,IAAI,CAAC,OAAO;cACb,IAAI,CAAC,MAAM;eACV,IAAI,CAAC,OAAO;iBACV,IAAI,CAAC,kBAAkB;aAC3B,IAAI,CAAC,kBAAkB;mBACjB,IAAI,CAAC,kBAAkB;0BAChB,IAAI,CAAC,kBAAkB;wBACzB,IAAI,CAAC,gBAAgB;gBAC7B,IAAI,CAAC,QAAQ;eACd,IAAI,CAAC,OAAO;mBACR,IAAI,CAAC,WAAW;mBAChB,IAAI,CAAC,WAAW;;GAEhC,CAAC;AACJ,CAAC","sourcesContent":["import { html, type TemplateResult } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport {\n ariaBindings,\n type ResolvedARIABindings,\n} from '../controllers/aria-projection.js';\nimport { partMap } from '../part-map.js';\nimport { bindIf } from '../utils/lit.js';\n\nexport interface MaskedInputOptions {\n /** Optional id for the native input element. */\n id?: string;\n /** Resolved part-name map applied to the input. */\n partNames: Record<string, boolean>;\n /** The form-associated name attribute. */\n name?: string;\n /** Current value to render through `live()`. */\n value: string;\n /** Pre-resolved placeholder text. Caller decides empty-string semantics. */\n placeholder: string;\n readOnly: boolean;\n disabled: boolean;\n autofocus?: boolean;\n inputMode?: string;\n /** When provided, sets the `tabindex` attribute. */\n tabindex?: number;\n /**\n * Resolved ARIA bindings for the native input - the projected host state\n * merged with the editor's own (see `AriaTargetController.resolveBindings`).\n */\n aria: ResolvedARIABindings;\n\n // Required mask handlers\n onInput: (event: InputEvent) => void;\n /** Wired to `beforeinput` so the component owns `historyUndo` / `historyRedo`. */\n onBeforeInput: (event: InputEvent) => void;\n onFocus: (event: FocusEvent) => void;\n onBlur: (event: FocusEvent) => void;\n onClick: () => void;\n /** Wired to `keydown`, `cut`, and `dragstart` to capture the current selection. */\n onSetMaskSelection: (event: Event) => void;\n onCompositionStart: () => void;\n onCompositionEnd: (event: CompositionEvent) => void;\n\n // Optional handlers\n onChange?: () => void;\n onWheel?: (event: WheelEvent) => void;\n onDragEnter?: () => void;\n onDragLeave?: () => void;\n}\n\n/**\n * Renders the native `<input>` element shared by mask-driven components\n * (`igc-mask-input`, `igc-date-time-input`, `igc-date-range-input`).\n * Centralizes mask event wiring so leaves only describe their extras.\n */\nexport function renderMaskedNativeInput(\n opts: MaskedInputOptions\n): TemplateResult {\n return html`\n <input\n id=${ifDefined(opts.id)}\n type=\"text\"\n part=${partMap(opts.partNames)}\n name=${ifDefined(opts.name)}\n .value=${live(opts.value)}\n .placeholder=${opts.placeholder}\n ?readonly=${opts.readOnly}\n ?disabled=${opts.disabled}\n ?autofocus=${opts.autofocus}\n inputmode=${ifDefined(opts.inputMode)}\n tabindex=${bindIf(opts.tabindex != null, opts.tabindex)}\n ${ariaBindings(opts.aria)}\n @input=${opts.onInput}\n @beforeinput=${opts.onBeforeInput}\n @focus=${opts.onFocus}\n @blur=${opts.onBlur}\n @click=${opts.onClick}\n @keydown=${opts.onSetMaskSelection}\n @cut=${opts.onSetMaskSelection}\n @dragstart=${opts.onSetMaskSelection}\n @compositionstart=${opts.onCompositionStart}\n @compositionend=${opts.onCompositionEnd}\n @change=${opts.onChange}\n @wheel=${opts.onWheel}\n @dragenter=${opts.onDragEnter}\n @dragleave=${opts.onDragLeave}\n />\n `;\n}\n"]}
1
+ {"version":3,"file":"masked-input.js","sourceRoot":"","sources":["../../../src/internals/templates/masked-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EACL,YAAY,GAEb,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAgDzC,MAAM,UAAU,uBAAuB,CACrC,IAAwB;IAExB,OAAO,IAAI,CAAA;;WAEF,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;;aAEhB,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;aACvB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;eAClB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;qBACV,IAAI,CAAC,WAAW;kBACnB,IAAI,CAAC,QAAQ;kBACb,IAAI,CAAC,QAAQ;mBACZ,IAAI,CAAC,SAAS;kBACf,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;iBAC1B,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC;QACrD,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;eAChB,IAAI,CAAC,OAAO;qBACN,IAAI,CAAC,aAAa;eACxB,IAAI,CAAC,OAAO;cACb,IAAI,CAAC,MAAM;eACV,IAAI,CAAC,OAAO;iBACV,IAAI,CAAC,kBAAkB;aAC3B,IAAI,CAAC,kBAAkB;mBACjB,IAAI,CAAC,kBAAkB;0BAChB,IAAI,CAAC,kBAAkB;wBACzB,IAAI,CAAC,gBAAgB;gBAC7B,IAAI,CAAC,QAAQ;eACd,IAAI,CAAC,OAAO;mBACR,IAAI,CAAC,WAAW;mBAChB,IAAI,CAAC,WAAW;;GAEhC,CAAC;AACJ,CAAC","sourcesContent":["import { html, type TemplateResult } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport {\n ariaBindings,\n type ResolvedARIABindings,\n} from '../controllers/aria-projection.js';\nimport { partMap } from '../part-map.js';\nimport { bindIf } from '../utils/lit.js';\n\nexport interface MaskedInputOptions {\n /** Optional id for the native input element. */\n id?: string;\n /** Resolved part-name map applied to the input. */\n partNames: Record<string, boolean>;\n /** The form-associated name attribute. */\n name?: string;\n /** Current value to render through `live()`. */\n value: string;\n /** The resolved placeholder text. The caller defines an empty string. */\n placeholder: string;\n readOnly: boolean;\n disabled: boolean;\n autofocus?: boolean;\n inputMode?: string;\n /** When provided, sets the `tabindex` attribute. */\n tabindex?: number;\n /**\n * The projected host state merged with the editor bindings. See\n * `AriaTargetController.resolveBindings`.\n */\n aria: ResolvedARIABindings;\n\n // Required mask handlers\n onInput: (event: InputEvent) => void;\n /** Owns `historyUndo` and `historyRedo` through `beforeinput`. */\n onBeforeInput: (event: InputEvent) => void;\n onFocus: (event: FocusEvent) => void;\n onBlur: (event: FocusEvent) => void;\n onClick: () => void;\n /** Captures the selection on `keydown`, `cut` and `dragstart`. */\n onSetMaskSelection: (event: Event) => void;\n onCompositionStart: () => void;\n onCompositionEnd: (event: CompositionEvent) => void;\n\n // Optional handlers\n onChange?: () => void;\n onWheel?: (event: WheelEvent) => void;\n onDragEnter?: () => void;\n onDragLeave?: () => void;\n}\n\n/**\n * Renders the native `<input>` of the mask-driven components, with the mask\n * event bindings, so a leaf component describes only its extras.\n */\nexport function renderMaskedNativeInput(\n opts: MaskedInputOptions\n): TemplateResult {\n return html`\n <input\n id=${ifDefined(opts.id)}\n type=\"text\"\n part=${partMap(opts.partNames)}\n name=${ifDefined(opts.name)}\n .value=${live(opts.value)}\n .placeholder=${opts.placeholder}\n ?readonly=${opts.readOnly}\n ?disabled=${opts.disabled}\n ?autofocus=${opts.autofocus}\n inputmode=${ifDefined(opts.inputMode)}\n tabindex=${bindIf(opts.tabindex != null, opts.tabindex)}\n ${ariaBindings(opts.aria)}\n @input=${opts.onInput}\n @beforeinput=${opts.onBeforeInput}\n @focus=${opts.onFocus}\n @blur=${opts.onBlur}\n @click=${opts.onClick}\n @keydown=${opts.onSetMaskSelection}\n @cut=${opts.onSetMaskSelection}\n @dragstart=${opts.onSetMaskSelection}\n @compositionstart=${opts.onCompositionStart}\n @compositionend=${opts.onCompositionEnd}\n @change=${opts.onChange}\n @wheel=${opts.onWheel}\n @dragenter=${opts.onDragEnter}\n @dragleave=${opts.onDragLeave}\n />\n `;\n}\n"]}
@@ -3,30 +3,25 @@ import '../../components/icon/icon.js';
3
3
  export interface SlottedIconOptions {
4
4
  /** The name of the slot that overrides the default icon. */
5
5
  slot: string;
6
- /** The registry name of the default icon rendered as fallback content. */
6
+ /** The registry name of the default icon in the fallback content. */
7
7
  icon: string;
8
8
  /** Controls the `hidden` attribute of the slot element. */
9
9
  hidden?: boolean;
10
10
  /** The `title` of the default icon. */
11
11
  title?: string;
12
- /**
13
- * The accessible label of the default icon. When set, the icon is exposed
14
- * to the accessibility tree with that label instead of being `aria-hidden`.
15
- */
12
+ /** The accessible label of the default icon. Suppresses `aria-hidden`. */
16
13
  label?: string;
17
14
  /**
18
- * Whether an unlabeled default icon carries `aria-hidden="true"`.
19
- * Pass false when an ancestor element already hides the icon from the
20
- * accessibility tree.
15
+ * Adds `aria-hidden="true"` to a default icon that has no label. Pass
16
+ * `false` when an ancestor already hides the icon.
21
17
  *
22
18
  * @default true
23
19
  */
24
20
  ariaHidden?: boolean;
25
21
  }
26
22
  /**
27
- * Renders a named slot with a default icon from the internal collection as
28
- * fallback content - the "overridable built-in control" idiom of the library.
29
- * Callers own the wrapping element with its parts, visibility gating and
30
- * event handlers, and must register the icon component themselves.
23
+ * Renders a named slot with a default icon from the `default` collection as
24
+ * the fallback content. The caller owns the wrapping element and registers
25
+ * the icon component.
31
26
  */
32
27
  export declare function renderSlottedIcon(options: SlottedIconOptions): TemplateResult;
@@ -1 +1 @@
1
- {"version":3,"file":"slotted-icon.js","sourceRoot":"","sources":["../../../src/internals/templates/slotted-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAgCzC,MAAM,UAAU,iBAAiB,CAAC,OAA2B;IAC3D,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC;IAExE,OAAO,IAAI,CAAA;iBACI,OAAO,CAAC,IAAI,YAAY,OAAO,CAAC,MAAM,IAAI,KAAK;;eAEjD,OAAO,CAAC,IAAI;;gBAEX,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;qBACnB,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;sBACvB,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC;;;GAG7C,CAAC;AACJ,CAAC","sourcesContent":["import { html, type TemplateResult } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n// The import satisfies the lit-analyzer element resolution for `igc-icon`.\n// It carries no side effects - registration stays with the consuming components.\nimport '../../components/icon/icon.js';\nimport { bindIf } from '../utils/lit.js';\n\nexport interface SlottedIconOptions {\n /** The name of the slot that overrides the default icon. */\n slot: string;\n /** The registry name of the default icon rendered as fallback content. */\n icon: string;\n /** Controls the `hidden` attribute of the slot element. */\n hidden?: boolean;\n /** The `title` of the default icon. */\n title?: string;\n /**\n * The accessible label of the default icon. When set, the icon is exposed\n * to the accessibility tree with that label instead of being `aria-hidden`.\n */\n label?: string;\n /**\n * Whether an unlabeled default icon carries `aria-hidden=\"true\"`.\n * Pass false when an ancestor element already hides the icon from the\n * accessibility tree.\n *\n * @default true\n */\n ariaHidden?: boolean;\n}\n\n/**\n * Renders a named slot with a default icon from the internal collection as\n * fallback content - the \"overridable built-in control\" idiom of the library.\n * Callers own the wrapping element with its parts, visibility gating and\n * event handlers, and must register the icon component themselves.\n */\nexport function renderSlottedIcon(options: SlottedIconOptions): TemplateResult {\n const ariaHidden = options.label ? false : (options.ariaHidden ?? true);\n\n return html`\n <slot name=${options.slot} ?hidden=${options.hidden ?? false}>\n <igc-icon\n name=${options.icon}\n collection=\"default\"\n title=${ifDefined(options.title)}\n aria-label=${ifDefined(options.label)}\n aria-hidden=${bindIf(ariaHidden, 'true')}\n ></igc-icon>\n </slot>\n `;\n}\n"]}
1
+ {"version":3,"file":"slotted-icon.js","sourceRoot":"","sources":["../../../src/internals/templates/slotted-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AA2BzC,MAAM,UAAU,iBAAiB,CAAC,OAA2B;IAC3D,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC;IAExE,OAAO,IAAI,CAAA;iBACI,OAAO,CAAC,IAAI,YAAY,OAAO,CAAC,MAAM,IAAI,KAAK;;eAEjD,OAAO,CAAC,IAAI;;gBAEX,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;qBACnB,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;sBACvB,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC;;;GAG7C,CAAC;AACJ,CAAC","sourcesContent":["import { html, type TemplateResult } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n// Satisfies the lit-analyzer element resolution for `igc-icon`. No side\n// effects; the consuming components register the icon.\nimport '../../components/icon/icon.js';\nimport { bindIf } from '../utils/lit.js';\n\nexport interface SlottedIconOptions {\n /** The name of the slot that overrides the default icon. */\n slot: string;\n /** The registry name of the default icon in the fallback content. */\n icon: string;\n /** Controls the `hidden` attribute of the slot element. */\n hidden?: boolean;\n /** The `title` of the default icon. */\n title?: string;\n /** The accessible label of the default icon. Suppresses `aria-hidden`. */\n label?: string;\n /**\n * Adds `aria-hidden=\"true\"` to a default icon that has no label. Pass\n * `false` when an ancestor already hides the icon.\n *\n * @default true\n */\n ariaHidden?: boolean;\n}\n\n/**\n * Renders a named slot with a default icon from the `default` collection as\n * the fallback content. The caller owns the wrapping element and registers\n * the icon component.\n */\nexport function renderSlottedIcon(options: SlottedIconOptions): TemplateResult {\n const ariaHidden = options.label ? false : (options.ariaHidden ?? true);\n\n return html`\n <slot name=${options.slot} ?hidden=${options.hidden ?? false}>\n <igc-icon\n name=${options.icon}\n collection=\"default\"\n title=${ifDefined(options.title)}\n aria-label=${ifDefined(options.label)}\n aria-hidden=${bindIf(ariaHidden, 'true')}\n ></igc-icon>\n </slot>\n `;\n}\n"]}
@@ -2,9 +2,9 @@ import { type TemplateResult } from 'lit';
2
2
  export interface ToggleShellOptions {
3
3
  /** The type of the native input element. */
4
4
  type: 'checkbox' | 'radio';
5
- /** The id of the native input; the wrapping label points at it through `for`. */
5
+ /** The id of the native input; the `for` target of the wrapping label. */
6
6
  inputId: string;
7
- /** The id of the label span, the fallback `aria-labelledby` target. */
7
+ /** The id of the label span. */
8
8
  labelId: string;
9
9
  /** Resolved part-name map for the wrapping label element. */
10
10
  baseParts: Record<string, boolean>;
@@ -14,33 +14,33 @@ export interface ToggleShellOptions {
14
14
  labelParts: Record<string, boolean>;
15
15
  /** Renders the control indicator inside the control span. */
16
16
  renderControl: () => TemplateResult;
17
- /** Current checked state rendered through `live()`. */
18
- checked: boolean;
19
17
  /** Hides the label span when the default slot has no assigned content. */
20
18
  hideLabel: boolean;
21
- name?: string;
22
- value?: string;
23
- required: boolean;
24
- disabled: boolean;
25
19
  /**
26
- * Current indeterminate state rendered through `live()`. When absent, the
27
- * binding stays `false` and `live()` skips the property write entirely.
20
+ * The current indeterminate state, rendered through `live()`. Defaults to
21
+ * `false`, and `live()` then writes nothing.
28
22
  */
29
23
  indeterminate?: boolean;
30
24
  /** When provided, sets the `tabindex` attribute. */
31
25
  tabindex?: number;
32
- /** Resolved `aria-labelledby` target - an external id or `labelId`. */
33
- ariaLabelledBy: string;
34
- /** When provided, sets the `aria-describedby` attribute. */
35
- ariaDescribedBy?: string;
26
+ /** The id of the helper-text container that describes the native input. */
27
+ describedBy?: string;
36
28
  onClick: (event: PointerEvent) => void;
37
29
  onKeyDown: (event: KeyboardEvent) => void;
38
30
  onBlur?: () => void;
39
31
  }
32
+ /** The host state that {@link renderToggleShell} binds onto the native input. */
33
+ type ToggleShellHost = HTMLElement & {
34
+ checked: boolean;
35
+ disabled: boolean;
36
+ required: boolean;
37
+ name?: string;
38
+ value?: string;
39
+ };
40
40
  /**
41
- * Renders the label-wrapped native input shared by the toggle controls
42
- * (`igc-checkbox`, `igc-switch`, `igc-radio`).
43
- * Centralizes the input binding set so leaves only describe their part maps
44
- * and control indicator.
41
+ * Renders the native input and its wrapping label for a toggle control, with
42
+ * the input bindings and the name, so a leaf component describes only its part
43
+ * maps and its control indicator.
45
44
  */
46
- export declare function renderToggleShell(options: ToggleShellOptions): TemplateResult;
45
+ export declare function renderToggleShell(host: ToggleShellHost, options: ToggleShellOptions): TemplateResult;
46
+ export {};
@@ -1,23 +1,27 @@
1
1
  import { html, nothing } from 'lit';
2
2
  import { ifDefined } from 'lit/directives/if-defined.js';
3
3
  import { live } from 'lit/directives/live.js';
4
+ import { ariaBindings, resolveNaming } from '../controllers/aria-projection.js';
4
5
  import { partMap } from '../part-map.js';
5
6
  import { bindIf } from '../utils/lit.js';
6
- export function renderToggleShell(options) {
7
+ export function renderToggleShell(host, options) {
8
+ const aria = {
9
+ ...resolveNaming(host, !options.hideLabel && options.labelId),
10
+ describedByRef: options.describedBy,
11
+ };
7
12
  return html `
8
13
  <label part=${partMap(options.baseParts)} for=${options.inputId}>
9
14
  <input
15
+ ${ariaBindings(aria)}
10
16
  id=${options.inputId}
11
17
  type=${options.type}
12
- name=${ifDefined(options.name)}
13
- value=${ifDefined(options.value)}
14
- ?required=${options.required}
15
- ?disabled=${options.disabled}
16
- .checked=${live(options.checked)}
18
+ name=${ifDefined(host.name)}
19
+ value=${ifDefined(host.value)}
20
+ ?required=${host.required}
21
+ ?disabled=${host.disabled}
22
+ .checked=${live(host.checked)}
17
23
  .indeterminate=${live(options.indeterminate ?? false)}
18
24
  tabindex=${bindIf(options.tabindex != null, options.tabindex)}
19
- aria-labelledby=${options.ariaLabelledBy}
20
- aria-describedby=${ifDefined(options.ariaDescribedBy)}
21
25
  @keydown=${options.onKeyDown}
22
26
  @click=${options.onClick}
23
27
  @blur=${options.onBlur ?? nothing}
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-shell.js","sourceRoot":"","sources":["../../../src/internals/templates/toggle-shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAgDzC,MAAM,UAAU,iBAAiB,CAAC,OAA2B;IAC3D,OAAO,IAAI,CAAA;kBACK,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,OAAO,CAAC,OAAO;;aAEtD,OAAO,CAAC,OAAO;eACb,OAAO,CAAC,IAAI;eACZ,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;gBACtB,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;oBACpB,OAAO,CAAC,QAAQ;oBAChB,OAAO,CAAC,QAAQ;mBACjB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;yBACf,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,KAAK,CAAC;mBAC1C,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC;0BAC3C,OAAO,CAAC,cAAc;2BACrB,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC;mBAC1C,OAAO,CAAC,SAAS;iBACnB,OAAO,CAAC,OAAO;gBAChB,OAAO,CAAC,MAAM,IAAI,OAAO;;mBAEtB,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;WACrC,OAAO,CAAC,aAAa,EAAE;;;aAGrB,OAAO,CAAC,OAAO;eACb,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;kBACxB,OAAO,CAAC,SAAS;;;;;GAKhC,CAAC;AACJ,CAAC","sourcesContent":["import { html, nothing, type TemplateResult } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { partMap } from '../part-map.js';\nimport { bindIf } from '../utils/lit.js';\n\nexport interface ToggleShellOptions {\n /** The type of the native input element. */\n type: 'checkbox' | 'radio';\n /** The id of the native input; the wrapping label points at it through `for`. */\n inputId: string;\n /** The id of the label span, the fallback `aria-labelledby` target. */\n labelId: string;\n /** Resolved part-name map for the wrapping label element. */\n baseParts: Record<string, boolean>;\n /** Resolved part-name map for the control span. */\n controlParts: Record<string, boolean>;\n /** Resolved part-name map for the label span. */\n labelParts: Record<string, boolean>;\n /** Renders the control indicator inside the control span. */\n renderControl: () => TemplateResult;\n /** Current checked state rendered through `live()`. */\n checked: boolean;\n /** Hides the label span when the default slot has no assigned content. */\n hideLabel: boolean;\n name?: string;\n value?: string;\n required: boolean;\n disabled: boolean;\n /**\n * Current indeterminate state rendered through `live()`. When absent, the\n * binding stays `false` and `live()` skips the property write entirely.\n */\n indeterminate?: boolean;\n /** When provided, sets the `tabindex` attribute. */\n tabindex?: number;\n /** Resolved `aria-labelledby` target - an external id or `labelId`. */\n ariaLabelledBy: string;\n /** When provided, sets the `aria-describedby` attribute. */\n ariaDescribedBy?: string;\n\n onClick: (event: PointerEvent) => void;\n onKeyDown: (event: KeyboardEvent) => void;\n onBlur?: () => void;\n}\n\n/**\n * Renders the label-wrapped native input shared by the toggle controls\n * (`igc-checkbox`, `igc-switch`, `igc-radio`).\n * Centralizes the input binding set so leaves only describe their part maps\n * and control indicator.\n */\nexport function renderToggleShell(options: ToggleShellOptions): TemplateResult {\n return html`\n <label part=${partMap(options.baseParts)} for=${options.inputId}>\n <input\n id=${options.inputId}\n type=${options.type}\n name=${ifDefined(options.name)}\n value=${ifDefined(options.value)}\n ?required=${options.required}\n ?disabled=${options.disabled}\n .checked=${live(options.checked)}\n .indeterminate=${live(options.indeterminate ?? false)}\n tabindex=${bindIf(options.tabindex != null, options.tabindex)}\n aria-labelledby=${options.ariaLabelledBy}\n aria-describedby=${ifDefined(options.ariaDescribedBy)}\n @keydown=${options.onKeyDown}\n @click=${options.onClick}\n @blur=${options.onBlur ?? nothing}\n />\n <span part=${partMap(options.controlParts)}\n >${options.renderControl()}</span\n >\n <span\n id=${options.labelId}\n part=${partMap(options.labelParts)}\n ?hidden=${options.hideLabel}\n >\n <slot></slot>\n </span>\n </label>\n `;\n}\n"]}
1
+ {"version":3,"file":"toggle-shell.js","sourceRoot":"","sources":["../../../src/internals/templates/toggle-shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAgDzC,MAAM,UAAU,iBAAiB,CAC/B,IAAqB,EACrB,OAA2B;IAE3B,MAAM,IAAI,GAAG;QACX,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;QAC7D,cAAc,EAAE,OAAO,CAAC,WAAW;KACpC,CAAC;IAEF,OAAO,IAAI,CAAA;kBACK,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,OAAO,CAAC,OAAO;;UAEzD,YAAY,CAAC,IAAI,CAAC;aACf,OAAO,CAAC,OAAO;eACb,OAAO,CAAC,IAAI;eACZ,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;gBACnB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;oBACjB,IAAI,CAAC,QAAQ;oBACb,IAAI,CAAC,QAAQ;mBACd,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;yBACZ,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,KAAK,CAAC;mBAC1C,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC;mBAClD,OAAO,CAAC,SAAS;iBACnB,OAAO,CAAC,OAAO;gBAChB,OAAO,CAAC,MAAM,IAAI,OAAO;;mBAEtB,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;WACrC,OAAO,CAAC,aAAa,EAAE;;;aAGrB,OAAO,CAAC,OAAO;eACb,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;kBACxB,OAAO,CAAC,SAAS;;;;;GAKhC,CAAC;AACJ,CAAC","sourcesContent":["import { html, nothing, type TemplateResult } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { ariaBindings, resolveNaming } from '../controllers/aria-projection.js';\nimport { partMap } from '../part-map.js';\nimport { bindIf } from '../utils/lit.js';\n\nexport interface ToggleShellOptions {\n /** The type of the native input element. */\n type: 'checkbox' | 'radio';\n /** The id of the native input; the `for` target of the wrapping label. */\n inputId: string;\n /** The id of the label span. */\n labelId: string;\n /** Resolved part-name map for the wrapping label element. */\n baseParts: Record<string, boolean>;\n /** Resolved part-name map for the control span. */\n controlParts: Record<string, boolean>;\n /** Resolved part-name map for the label span. */\n labelParts: Record<string, boolean>;\n /** Renders the control indicator inside the control span. */\n renderControl: () => TemplateResult;\n /** Hides the label span when the default slot has no assigned content. */\n hideLabel: boolean;\n /**\n * The current indeterminate state, rendered through `live()`. Defaults to\n * `false`, and `live()` then writes nothing.\n */\n indeterminate?: boolean;\n /** When provided, sets the `tabindex` attribute. */\n tabindex?: number;\n /** The id of the helper-text container that describes the native input. */\n describedBy?: string;\n\n onClick: (event: PointerEvent) => void;\n onKeyDown: (event: KeyboardEvent) => void;\n onBlur?: () => void;\n}\n\n/** The host state that {@link renderToggleShell} binds onto the native input. */\ntype ToggleShellHost = HTMLElement & {\n checked: boolean;\n disabled: boolean;\n required: boolean;\n name?: string;\n value?: string;\n};\n\n/**\n * Renders the native input and its wrapping label for a toggle control, with\n * the input bindings and the name, so a leaf component describes only its part\n * maps and its control indicator.\n */\nexport function renderToggleShell(\n host: ToggleShellHost,\n options: ToggleShellOptions\n): TemplateResult {\n const aria = {\n ...resolveNaming(host, !options.hideLabel && options.labelId),\n describedByRef: options.describedBy,\n };\n\n return html`\n <label part=${partMap(options.baseParts)} for=${options.inputId}>\n <input\n ${ariaBindings(aria)}\n id=${options.inputId}\n type=${options.type}\n name=${ifDefined(host.name)}\n value=${ifDefined(host.value)}\n ?required=${host.required}\n ?disabled=${host.disabled}\n .checked=${live(host.checked)}\n .indeterminate=${live(options.indeterminate ?? false)}\n tabindex=${bindIf(options.tabindex != null, options.tabindex)}\n @keydown=${options.onKeyDown}\n @click=${options.onClick}\n @blur=${options.onBlur ?? nothing}\n />\n <span part=${partMap(options.controlParts)}\n >${options.renderControl()}</span\n >\n <span\n id=${options.labelId}\n part=${partMap(options.labelParts)}\n ?hidden=${options.hideLabel}\n >\n <slot></slot>\n </span>\n </label>\n `;\n}\n"]}
@@ -1,24 +1,15 @@
1
- /**
2
- * A restartable timeout handle. See {@link createTimer}.
3
- */
1
+ /** A restartable timeout handle. See {@link createTimer}. */
4
2
  export type Timer = {
5
3
  /** Whether the timer is currently armed. */
6
4
  readonly active: boolean;
7
- /**
8
- * (Re)arms the timer, canceling a previously armed run.
9
- *
10
- * When `delay` is omitted, the default delay of the timer is used.
11
- */
5
+ /** Arms the timer, cancels an armed run, and defaults `delay`. */
12
6
  start(delay?: number): void;
13
- /** Cancels the armed run, if any. */
7
+ /** Cancels the armed run, if there is one. */
14
8
  stop(): void;
15
9
  };
16
10
  /**
17
- * Creates a restartable timeout around `callback`.
18
- *
19
- * Every `start` supersedes the previous one, so the callback runs at most once,
20
- * `delay` milliseconds after the most recent `start` - the recurring
21
- * "clear the stored handle, then set it again" bookkeeping is kept in one place.
11
+ * Creates a restartable timeout around `callback`. The callback runs one time
12
+ * at most, `delay` milliseconds after the most recent `start` call.
22
13
  *
23
14
  * @example
24
15
  * ```typescript
@@ -1 +1 @@
1
- {"version":3,"file":"timing.js","sourceRoot":"","sources":["../../src/internals/timing.ts"],"names":[],"mappings":"AAgCA,MAAM,UAAU,WAAW,CAAC,QAAoB,EAAE,YAAY,GAAG,CAAC;IAChE,IAAI,MAAiD,CAAC;IAEtD,OAAO;QACL,IAAI,MAAM;YACR,OAAO,MAAM,KAAK,SAAS,CAAC;QAC9B,CAAC;QACD,KAAK,CAAC,KAAK,GAAG,YAAY;YACxB,YAAY,CAAC,MAAM,CAAC,CAAC;YACrB,MAAM,GAAG,UAAU,CAAC,GAAG,EAAE;gBACvB,MAAM,GAAG,SAAS,CAAC;gBACnB,QAAQ,EAAE,CAAC;YACb,CAAC,EAAE,KAAK,CAAC,CAAC;QACZ,CAAC;QACD,IAAI;YACF,YAAY,CAAC,MAAM,CAAC,CAAC;YACrB,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * A restartable timeout handle. See {@link createTimer}.\n */\nexport type Timer = {\n /** Whether the timer is currently armed. */\n readonly active: boolean;\n /**\n * (Re)arms the timer, canceling a previously armed run.\n *\n * When `delay` is omitted, the default delay of the timer is used.\n */\n start(delay?: number): void;\n /** Cancels the armed run, if any. */\n stop(): void;\n};\n\n/**\n * Creates a restartable timeout around `callback`.\n *\n * Every `start` supersedes the previous one, so the callback runs at most once,\n * `delay` milliseconds after the most recent `start` - the recurring\n * \"clear the stored handle, then set it again\" bookkeeping is kept in one place.\n *\n * @example\n * ```typescript\n * const timer = createTimer(() => this.hideTooltip(), 500);\n *\n * timer.start(); // arms the timer with the default delay\n * timer.start(1000); // supersedes the run above\n * timer.stop(); // cancels it altogether\n * ```\n */\nexport function createTimer(callback: () => void, defaultDelay = 0): Timer {\n let handle: ReturnType<typeof setTimeout> | undefined;\n\n return {\n get active(): boolean {\n return handle !== undefined;\n },\n start(delay = defaultDelay): void {\n clearTimeout(handle);\n handle = setTimeout(() => {\n handle = undefined;\n callback();\n }, delay);\n },\n stop(): void {\n clearTimeout(handle);\n handle = undefined;\n },\n };\n}\n"]}
1
+ {"version":3,"file":"timing.js","sourceRoot":"","sources":["../../src/internals/timing.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,WAAW,CAAC,QAAoB,EAAE,YAAY,GAAG,CAAC;IAChE,IAAI,MAAiD,CAAC;IAEtD,OAAO;QACL,IAAI,MAAM;YACR,OAAO,MAAM,KAAK,SAAS,CAAC;QAC9B,CAAC;QACD,KAAK,CAAC,KAAK,GAAG,YAAY;YACxB,YAAY,CAAC,MAAM,CAAC,CAAC;YACrB,MAAM,GAAG,UAAU,CAAC,GAAG,EAAE;gBACvB,MAAM,GAAG,SAAS,CAAC;gBACnB,QAAQ,EAAE,CAAC;YACb,CAAC,EAAE,KAAK,CAAC,CAAC;QACZ,CAAC;QACD,IAAI;YACF,YAAY,CAAC,MAAM,CAAC,CAAC;YACrB,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** A restartable timeout handle. See {@link createTimer}. */\nexport type Timer = {\n /** Whether the timer is currently armed. */\n readonly active: boolean;\n /** Arms the timer, cancels an armed run, and defaults `delay`. */\n start(delay?: number): void;\n /** Cancels the armed run, if there is one. */\n stop(): void;\n};\n\n/**\n * Creates a restartable timeout around `callback`. The callback runs one time\n * at most, `delay` milliseconds after the most recent `start` call.\n *\n * @example\n * ```typescript\n * const timer = createTimer(() => this.hideTooltip(), 500);\n *\n * timer.start(); // arms the timer with the default delay\n * timer.start(1000); // supersedes the run above\n * timer.stop(); // cancels it altogether\n * ```\n */\nexport function createTimer(callback: () => void, defaultDelay = 0): Timer {\n let handle: ReturnType<typeof setTimeout> | undefined;\n\n return {\n get active(): boolean {\n return handle !== undefined;\n },\n start(delay = defaultDelay): void {\n clearTimeout(handle);\n handle = setTimeout(() => {\n handle = undefined;\n callback();\n }, delay);\n },\n stop(): void {\n clearTimeout(handle);\n handle = undefined;\n },\n };\n}\n"]}
@@ -1,36 +1,23 @@
1
- /**
2
- * Returns the first element of the given array.
3
- *
4
- * @remarks
5
- * Assumes a non-empty array - for an empty one it returns `undefined`
6
- * typed as `T`.
7
- */
1
+ /** Returns the first element, typed as `T` even for an empty array. */
8
2
  export declare function firstOf<T>(arr: T[]): T;
9
- /**
10
- * Returns the last element of the given array.
11
- *
12
- * @remarks
13
- * Assumes a non-empty array - for an empty one it returns `undefined`
14
- * typed as `T`.
15
- */
3
+ /** Returns the last element, typed as `T` even for an empty array. */
16
4
  export declare function lastOf<T>(arr: T[]): T;
17
5
  /**
18
- * Splits an array into chunks of a specified size and returns a generator that yields each chunk.
6
+ * Splits an array into chunks of the given size.
19
7
  *
20
8
  * @example
21
9
  * ```typescript
22
10
  * [...chunk([1, 2, 3, 4, 5], 2)]; // [[1, 2], [3, 4], [5]]
23
11
  * ```
24
12
  *
25
- * @throws If the `size` parameter is not a safe integer greater than or equal to 1.
13
+ * @throws If the `size` parameter is not a safe integer greater than or
14
+ * equal to 1.
26
15
  */
27
16
  export declare function chunk<T>(arr: T[], size: number): Generator<T[]>;
28
- /**
29
- * Returns whether a given collection is empty.
30
- */
17
+ /** Returns whether a given collection is empty. */
31
18
  export declare function isEmpty<T, U extends object>(x: ArrayLike<T> | Set<T> | Map<U, T>): boolean;
32
19
  /**
33
- * Ensures the given value is wrapped in an array. If the value is already an array, it is returned as-is. If the value is undefined, an empty array is returned.
20
+ * Returns the given value as an array. An empty value gives an empty array.
34
21
  *
35
22
  * @example
36
23
  * ```typescript
@@ -41,7 +28,20 @@ export declare function isEmpty<T, U extends object>(x: ArrayLike<T> | Set<T> |
41
28
  */
42
29
  export declare function asArray<T>(value?: T | T[]): T[];
43
30
  /**
44
- * Splits an array into two based on a predicate function, returning a tuple of [truthy, falsy] arrays.
31
+ * Returns whether two collections hold the same items, in the same order and
32
+ * by identity. Two empty values match; an empty value differs from a
33
+ * collection.
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * sameItems([a, b], [a, b]); // true
38
+ * sameItems([a, b], [b, a]); // false
39
+ * sameItems(null, undefined); // true
40
+ * ```
41
+ */
42
+ export declare function sameItems<T>(a: ArrayLike<T> | null | undefined, b: ArrayLike<T> | null | undefined): boolean;
43
+ /**
44
+ * Splits an array in two with a predicate: matching items first.
45
45
  *
46
46
  * @example
47
47
  * ```typescript
@@ -20,6 +20,20 @@ export function asArray(value) {
20
20
  return [];
21
21
  return Array.isArray(value) ? value : [value];
22
22
  }
23
+ export function sameItems(a, b) {
24
+ if (a == null || b == null) {
25
+ return a == null && b == null;
26
+ }
27
+ if (a.length !== b.length) {
28
+ return false;
29
+ }
30
+ for (let i = 0; i < a.length; i++) {
31
+ if (a[i] !== b[i]) {
32
+ return false;
33
+ }
34
+ }
35
+ return true;
36
+ }
23
37
  export function partition(array, isTruthy) {
24
38
  const truthy = [];
25
39
  const falsy = [];
@@ -1 +1 @@
1
- {"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../../src/internals/utils/arrays.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,OAAO,CAAI,GAAQ;IACjC,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC,CAAM,CAAC;AACxB,CAAC;AASD,MAAM,UAAU,MAAM,CAAI,GAAQ;IAChC,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAM,CAAC;AACzB,CAAC;AAYD,MAAM,SAAS,CAAC,CAAC,KAAK,CAAI,GAAQ,EAAE,IAAY;IAC9C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;QAC1C,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC;AAKD,MAAM,UAAU,OAAO,CACrB,CAAoC;IAEpC,OAAO,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;AACnD,CAAC;AAYD,MAAM,UAAU,OAAO,CAAI,KAAe;IACxC,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,EAAE,CAAC;IAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAYD,MAAM,UAAU,SAAS,CACvB,KAAU,EACV,QAA+B;IAE/B,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,MAAM,KAAK,GAAQ,EAAE,CAAC;IAEtB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzB,CAAC","sourcesContent":["/**\n * Returns the first element of the given array.\n *\n * @remarks\n * Assumes a non-empty array - for an empty one it returns `undefined`\n * typed as `T`.\n */\nexport function firstOf<T>(arr: T[]) {\n return arr.at(0) as T;\n}\n\n/**\n * Returns the last element of the given array.\n *\n * @remarks\n * Assumes a non-empty array - for an empty one it returns `undefined`\n * typed as `T`.\n */\nexport function lastOf<T>(arr: T[]) {\n return arr.at(-1) as T;\n}\n\n/**\n * Splits an array into chunks of a specified size and returns a generator that yields each chunk.\n *\n * @example\n * ```typescript\n * [...chunk([1, 2, 3, 4, 5], 2)]; // [[1, 2], [3, 4], [5]]\n * ```\n *\n * @throws If the `size` parameter is not a safe integer greater than or equal to 1.\n */\nexport function* chunk<T>(arr: T[], size: number): Generator<T[]> {\n if (!Number.isSafeInteger(size) || size < 1) {\n throw new Error('size must be an integer >= 1');\n }\n\n for (let i = 0; i < arr.length; i += size) {\n yield arr.slice(i, i + size);\n }\n}\n\n/**\n * Returns whether a given collection is empty.\n */\nexport function isEmpty<T, U extends object>(\n x: ArrayLike<T> | Set<T> | Map<U, T>\n): boolean {\n return 'length' in x ? x.length < 1 : x.size < 1;\n}\n\n/**\n * Ensures the given value is wrapped in an array. If the value is already an array, it is returned as-is. If the value is undefined, an empty array is returned.\n *\n * @example\n * ```typescript\n * asArray(5); // [5]\n * asArray([1, 2, 3]); // [1, 2, 3]\n * asArray(undefined); // []\n * ```\n */\nexport function asArray<T>(value?: T | T[]): T[] {\n if (value == null) return [];\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Splits an array into two based on a predicate function, returning a tuple of [truthy, falsy] arrays.\n *\n * @example\n * ```typescript\n * const [evens, odds] = partition([1, 2, 3, 4], x => x % 2 === 0);\n * console.log(evens); // [2, 4]\n * console.log(odds); // [1, 3]\n * ```\n */\nexport function partition<T>(\n array: T[],\n isTruthy: (value: T) => boolean\n): [truthy: T[], falsy: T[]] {\n const truthy: T[] = [];\n const falsy: T[] = [];\n\n for (const item of array) {\n (isTruthy(item) ? truthy : falsy).push(item);\n }\n\n return [truthy, falsy];\n}\n"]}
1
+ {"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../../src/internals/utils/arrays.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,OAAO,CAAI,GAAQ;IACjC,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC,CAAM,CAAC;AACxB,CAAC;AAGD,MAAM,UAAU,MAAM,CAAI,GAAQ;IAChC,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAM,CAAC;AACzB,CAAC;AAaD,MAAM,SAAS,CAAC,CAAC,KAAK,CAAI,GAAQ,EAAE,IAAY;IAC9C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;QAC1C,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC;AAGD,MAAM,UAAU,OAAO,CACrB,CAAoC;IAEpC,OAAO,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;AACnD,CAAC;AAYD,MAAM,UAAU,OAAO,CAAI,KAAe;IACxC,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,EAAE,CAAC;IAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAcD,MAAM,UAAU,SAAS,CACvB,CAAkC,EAClC,CAAkC;IAElC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC;IAChC,CAAC;IAED,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAYD,MAAM,UAAU,SAAS,CACvB,KAAU,EACV,QAA+B;IAE/B,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,MAAM,KAAK,GAAQ,EAAE,CAAC;IAEtB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzB,CAAC","sourcesContent":["/** Returns the first element, typed as `T` even for an empty array. */\nexport function firstOf<T>(arr: T[]) {\n return arr.at(0) as T;\n}\n\n/** Returns the last element, typed as `T` even for an empty array. */\nexport function lastOf<T>(arr: T[]) {\n return arr.at(-1) as T;\n}\n\n/**\n * Splits an array into chunks of the given size.\n *\n * @example\n * ```typescript\n * [...chunk([1, 2, 3, 4, 5], 2)]; // [[1, 2], [3, 4], [5]]\n * ```\n *\n * @throws If the `size` parameter is not a safe integer greater than or\n * equal to 1.\n */\nexport function* chunk<T>(arr: T[], size: number): Generator<T[]> {\n if (!Number.isSafeInteger(size) || size < 1) {\n throw new Error('size must be an integer >= 1');\n }\n\n for (let i = 0; i < arr.length; i += size) {\n yield arr.slice(i, i + size);\n }\n}\n\n/** Returns whether a given collection is empty. */\nexport function isEmpty<T, U extends object>(\n x: ArrayLike<T> | Set<T> | Map<U, T>\n): boolean {\n return 'length' in x ? x.length < 1 : x.size < 1;\n}\n\n/**\n * Returns the given value as an array. An empty value gives an empty array.\n *\n * @example\n * ```typescript\n * asArray(5); // [5]\n * asArray([1, 2, 3]); // [1, 2, 3]\n * asArray(undefined); // []\n * ```\n */\nexport function asArray<T>(value?: T | T[]): T[] {\n if (value == null) return [];\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Returns whether two collections hold the same items, in the same order and\n * by identity. Two empty values match; an empty value differs from a\n * collection.\n *\n * @example\n * ```typescript\n * sameItems([a, b], [a, b]); // true\n * sameItems([a, b], [b, a]); // false\n * sameItems(null, undefined); // true\n * ```\n */\nexport function sameItems<T>(\n a: ArrayLike<T> | null | undefined,\n b: ArrayLike<T> | null | undefined\n): boolean {\n if (a == null || b == null) {\n return a == null && b == null;\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Splits an array in two with a predicate: matching items first.\n *\n * @example\n * ```typescript\n * const [evens, odds] = partition([1, 2, 3, 4], x => x % 2 === 0);\n * console.log(evens); // [2, 4]\n * console.log(odds); // [1, 3]\n * ```\n */\nexport function partition<T>(\n array: T[],\n isTruthy: (value: T) => boolean\n): [truthy: T[], falsy: T[]] {\n const truthy: T[] = [];\n const falsy: T[] = [];\n\n for (const item of array) {\n (isTruthy(item) ? truthy : falsy).push(item);\n }\n\n return [truthy, falsy];\n}\n"]}