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,15 +1,40 @@
1
1
  import { type LitElement, type ReactiveController, type ReactiveControllerHost } from 'lit';
2
2
  import { Directive, type DirectiveParameters, type ElementPart, type PartInfo } from 'lit/directive.js';
3
+ import type { SlotController } from './slot.js';
3
4
  type ControllerHost = ReactiveControllerHost & LitElement;
5
+ /** The host attributes that {@link resolveNaming} reads. */
6
+ export declare const NAMING_ATTRIBUTES: string[];
7
+ /** The name sources of a component, resolved by {@link resolveNaming}. */
8
+ export type ResolvedNaming = {
9
+ /** The elements that name the component, bound as element references. */
10
+ labelledBy: ReadonlyArray<Element> | null;
11
+ /** The id of the own label in the shadow root, bound as an IDREF. */
12
+ labelledByRef?: string;
13
+ /** The host `aria-label` or the fallback, when no label names the component. */
14
+ label?: string;
15
+ };
16
+ /**
17
+ * Resolves the name of a form associated component. The first source that is
18
+ * present wins: the host `aria-labelledby`, the external `<label>` elements,
19
+ * the own label of the component, the host `aria-label`, and `fallback`.
20
+ *
21
+ * `ownLabel` is the id of the own label in the shadow root, or `true` for an
22
+ * own label that names the control natively, for example a `<label for>`.
23
+ *
24
+ * @remarks
25
+ * Assistive technology reads the native control in the shadow root, so the
26
+ * name moves from the host to that control. `host.ariaLabelledByElements`
27
+ * resolves the host IDREFs in the host tree. An external label replaces the
28
+ * own label. A wrapping label contains the own label text.
29
+ */
30
+ export declare function resolveNaming(host: Element, ownLabel: string | boolean, fallback?: string): ResolvedNaming;
4
31
  /**
5
- * ARIA semantics a composite host projects onto the native editor of an
6
- * input-shaped component.
32
+ * The ARIA semantics that a composite host projects onto the native editor.
7
33
  *
8
- * The host cannot publish these itself: it delegates focus, so the native
9
- * editor inside the input component's shadow root is what assistive technology
10
- * lands on and reports. All relations travel as element references - an IDREF
11
- * cannot cross a shadow boundary, while ARIA element reflection resolves into
12
- * ancestor tree scopes.
34
+ * @remarks
35
+ * The host delegates focus, so assistive technology lands on the editor of
36
+ * the input-shaped component and reports it. Every relation travels as an
37
+ * element reference, because an IDREF does not cross a shadow boundary.
13
38
  */
14
39
  export type ProjectedARIA = {
15
40
  role?: string;
@@ -22,21 +47,21 @@ export type ProjectedARIA = {
22
47
  labelledBy?: ReadonlyArray<Element> | null;
23
48
  activeDescendant?: Element | null;
24
49
  };
25
- /** Configuration for the {@link AriaTargetController}. */
50
+ /** The id of the helper-text container of `IgcValidationContainerComponent`. */
51
+ export declare const HELPER_TEXT_ID = "helper-text";
52
+ /** Returns the helper-text container when the `helper-text` slot has content. */
53
+ export declare function helperText(host: LitElement, slots: Pick<SlotController<'helper-text'>, 'hasAssignedElements'>): Element | null;
26
54
  type AriaTargetConfig = {
27
- /** Resolves the component's own `ElementInternals` labels. */
28
- labels: () => ReadonlyArray<Element> | null;
29
- /**
30
- * Resolves the component's own description element (its helper-text
31
- * container), or `null` when it currently renders no description content.
32
- */
33
- description: () => Element | null;
55
+ /** Resolves the helper-text container, or `null` when there is none. */
56
+ description?: () => Element | null;
57
+ /** Whether an own label names the editor natively, for example a `<label for>`. */
58
+ hasOwnLabel?: () => boolean;
34
59
  };
35
60
  /**
36
- * Binding values for a native editor element, resolved from the projected
37
- * state merged with the editor's own ARIA. Applied onto the editor with the
38
- * {@link ariaBindings} directive: scalars bind as attributes, relations bind
39
- * through the ARIA element-reflection properties.
61
+ * The binding values for a native editor element, resolved from the projected
62
+ * state and the own ARIA of the editor, and applied by the
63
+ * {@link ariaBindings} directive. A scalar binds as an attribute, a relation
64
+ * through an ARIA element-reflection property.
40
65
  */
41
66
  export type ResolvedARIABindings = {
42
67
  role?: string;
@@ -45,100 +70,114 @@ export type ResolvedARIABindings = {
45
70
  disabled?: string;
46
71
  label?: string;
47
72
  /**
48
- * Same-root IDREF for the editor's own description, applied while no
49
- * description is projected. Unlike element reflection, a content attribute
50
- * stays visible to tooling that only reads attributes (e.g. axe).
73
+ * The IDREF of the own description in the same root. The directive binds it
74
+ * while `describedBy` is null, so a tool that reads only attributes, for
75
+ * example axe, still sees the relation.
51
76
  */
52
77
  describedByRef?: string;
78
+ /** The IDREF of the own label in the same root. It binds as `describedByRef`. */
79
+ labelledByRef?: string;
53
80
  labelledBy: ReadonlyArray<Element> | null;
54
81
  controls: ReadonlyArray<Element> | null;
55
82
  describedBy: ReadonlyArray<Element> | null;
56
83
  activeDescendant: Element | null;
57
84
  };
58
85
  /**
59
- * The receiving end of an ARIA projection, added by every input-shaped
60
- * component. Holds the state a composite host currently projects and resolves
61
- * it against the component's own ARIA when the native editor is rendered.
86
+ * The receiving end of an ARIA projection. It names the native control in the
87
+ * shadow root, see {@link resolveNaming}, and applies the state that a
88
+ * composite host projects.
62
89
  *
63
- * Not a reactive controller - it needs no lifecycle hooks, only a render
64
- * scheduled on the host when the projected state changes.
90
+ * @remarks
91
+ * Not a reactive controller. The host render resolves the bindings, and the
92
+ * form associated mixin renders the host again when the name sources change.
65
93
  */
66
94
  declare class AriaTargetController {
67
95
  private readonly _host;
68
96
  private readonly _config;
69
97
  private _projected;
98
+ /** The bindings last resolved for the native editor. */
99
+ private _resolved?;
70
100
  constructor(host: ControllerHost, config: AriaTargetConfig);
71
101
  /**
72
- * Replaces the projected state, scheduling a host render only when it
73
- * actually changed so projecting on every host update stays cheap.
102
+ * Replaces the projected state.
103
+ *
104
+ * @remarks
105
+ * A host render happens only when the resolved bindings change, so a
106
+ * projection on every host update stays inexpensive. The comparison uses
107
+ * the resolved bindings, so it also catches a change to the own labels or
108
+ * description, which the component cannot observe.
74
109
  */
75
110
  setProjected(state: ProjectedARIA): void;
76
111
  /**
77
- * Mirrors the projected `role`/`hasPopup` as `data-role`/`data-haspopup`
78
- * attributes on the component itself. The input themes style anchors of
79
- * composite widgets differently and key off these; the ARIA itself lives on
80
- * the native editor inside the shadow root, where `:host()` selectors
81
- * cannot observe it.
112
+ * Mirrors the projected `role` and `hasPopup` onto `data-role` and
113
+ * `data-haspopup`.
114
+ *
115
+ * @remarks
116
+ * The input themes style the anchor of a composite widget from these
117
+ * attributes. The ARIA itself stays on the editor in the shadow root, where
118
+ * a `:host()` selector cannot observe it.
82
119
  */
83
120
  private _reflectStylingHooks;
84
121
  /**
85
- * Resolves the binding values for the native editor element by merging the
86
- * projected state with the editor's own ARIA.
87
- *
88
- * Projected labels take precedence over the component's own. The editor's
89
- * description stays a same-root IDREF ({@link ResolvedARIABindings.describedByRef})
90
- * while nothing is projected; once a host projects a description, the whole
91
- * relation switches to element references - attribute and reflection cannot
92
- * coexist - with the editor's own description element joining the projected
93
- * ones.
122
+ * Resolves the binding values for the native editor element. A projected
123
+ * value wins over the own naming.
94
124
  */
95
125
  resolveBindings(): ResolvedARIABindings;
96
126
  }
127
+ /** The bindings that {@link ariaBindings} accepts. Each key is optional. */
128
+ export type ARIABindings = Partial<ResolvedARIABindings>;
97
129
  /**
98
- * Applies {@link ResolvedARIABindings} onto the native editor element -
99
- * relations on every render, scalar attributes only when they changed.
130
+ * Applies {@link ARIABindings} to the native editor. It writes only changed
131
+ * values, and only to the attributes that its bindings set.
100
132
  */
101
133
  declare class AriaBindingsDirective extends Directive {
102
134
  private _previous?;
103
135
  constructor(partInfo: PartInfo);
104
- render(_: ResolvedARIABindings): unknown;
136
+ render(_: ARIABindings): unknown;
105
137
  update(part: ElementPart, [bindings]: DirectiveParameters<this>): unknown;
106
138
  }
107
139
  /**
108
- * Binds resolved ARIA state onto a native editor element as a single element
109
- * expression, e.g. `<input ${ariaBindings(aria)} />`.
140
+ * Binds the resolved ARIA state onto a native editor element as one element
141
+ * expression, for example `<input ${ariaBindings(aria)} />`.
110
142
  */
111
- export declare const ariaBindings: (_: ResolvedARIABindings) => import("lit-html/directive.js").DirectiveResult<typeof AriaBindingsDirective>;
112
- /** Configuration for the {@link AriaProjectorController}. */
143
+ export declare const ariaBindings: (_: Partial<ResolvedARIABindings>) => import("lit-html/directive.js").DirectiveResult<typeof AriaBindingsDirective>;
113
144
  type AriaProjectorConfig = {
114
- /** Resolves the input-shaped component the ARIA state is projected onto. */
145
+ /** Resolves the input-shaped component that receives the ARIA state. */
115
146
  target: () => Element | null | undefined;
116
- /** Computes the ARIA state to project. Invoked after every host update. */
147
+ /** Computes the ARIA state to project, after every host update. */
117
148
  state: () => ProjectedARIA;
149
+ /**
150
+ * Whether the host shows an own label. When set, the projector also
151
+ * projects the name of the host, see {@link resolveNaming}.
152
+ */
153
+ hasOwnLabel?: () => boolean;
154
+ /** Resolves the name to use when no other source names the host. */
155
+ fallbackLabel?: () => string;
118
156
  };
119
157
  /**
120
- * The sending end of an ARIA projection, added by composite hosts
121
- * (e.g. `igc-select`). After every host update it pushes the computed ARIA
122
- * state onto the target component's {@link AriaTargetController}.
158
+ * The sending end of an ARIA projection. A composite host such as
159
+ * `igc-select` adds it to push the computed ARIA state onto the
160
+ * {@link AriaTargetController} of the target after every host update.
123
161
  */
124
162
  declare class AriaProjectorController implements ReactiveController {
125
163
  private readonly _host;
126
164
  private readonly _config;
127
165
  private _retryScheduled;
128
166
  constructor(host: ControllerHost, config: AriaProjectorConfig);
167
+ /** Computes the state, with the name of the host when it is configured. */
168
+ private _state;
129
169
  /** @internal */
130
170
  hostUpdated(): void;
131
171
  }
132
172
  /**
133
- * Creates and adds an {@link AriaTargetController} to an input-shaped
134
- * component, making its native editor a valid target for
135
- * {@link addAriaProjector} - the editor is what assistive technology lands on
136
- * and reports once the component's host delegates focus to it.
173
+ * Creates an {@link AriaTargetController} and adds it to an input-shaped
174
+ * component. It makes the native editor of the component a valid target for
175
+ * {@link addAriaProjector}.
137
176
  */
138
177
  export declare function addAriaTarget(host: ControllerHost, config: AriaTargetConfig): AriaTargetController;
139
178
  /**
140
- * Creates and adds an {@link AriaProjectorController} to a composite host,
141
- * projecting ARIA semantics onto the native editor of the target component.
179
+ * Creates an {@link AriaProjectorController} and adds it to a composite host.
180
+ * It projects ARIA onto the native editor of the target component.
142
181
  */
143
182
  export declare function addAriaProjector(host: ControllerHost, config: AriaProjectorConfig): AriaProjectorController;
144
183
  export type { AriaProjectorController, AriaTargetController };
@@ -1,23 +1,34 @@
1
1
  import { noChange, } from 'lit';
2
2
  import { Directive, directive, PartType, } from 'lit/directive.js';
3
- const targets = new WeakMap();
4
- function elementsEqual(a, b) {
5
- if (a == null || b == null) {
6
- return a == null && b == null;
3
+ import { sameItems } from '../utils/arrays.js';
4
+ import { isString } from '../utils/types.js';
5
+ import { internalsOf } from './internals.js';
6
+ export const NAMING_ATTRIBUTES = ['aria-label', 'aria-labelledby'];
7
+ export function resolveNaming(host, ownLabel, fallback) {
8
+ const referenced = host.ariaLabelledByElements;
9
+ if (referenced?.length) {
10
+ return { labelledBy: referenced };
11
+ }
12
+ const labels = internalsOf(host)?.labels;
13
+ if (labels) {
14
+ return { labelledBy: labels };
15
+ }
16
+ const naming = {
17
+ labelledBy: null,
18
+ label: ownLabel ? undefined : host.getAttribute('aria-label') || fallback,
19
+ };
20
+ if (isString(ownLabel)) {
21
+ naming.labelledByRef = ownLabel;
7
22
  }
8
- return a.length === b.length && a.every((element, i) => element === b[i]);
23
+ return naming;
9
24
  }
10
- function projectionsEqual(a, b) {
11
- return (a.role === b.role &&
12
- a.hasPopup === b.hasPopup &&
13
- a.expanded === b.expanded &&
14
- a.disabled === b.disabled &&
15
- a.label === b.label &&
16
- (a.activeDescendant ?? null) === (b.activeDescendant ?? null) &&
17
- elementsEqual(a.controls, b.controls) &&
18
- elementsEqual(a.describedBy, b.describedBy) &&
19
- elementsEqual(a.labelledBy, b.labelledBy));
25
+ export const HELPER_TEXT_ID = 'helper-text';
26
+ export function helperText(host, slots) {
27
+ return slots.hasAssignedElements('helper-text')
28
+ ? host.renderRoot.querySelector(`#${HELPER_TEXT_ID}`)
29
+ : null;
20
30
  }
31
+ const targets = new WeakMap();
21
32
  class AriaTargetController {
22
33
  constructor(host, config) {
23
34
  this._projected = {};
@@ -26,8 +37,9 @@ class AriaTargetController {
26
37
  targets.set(host, this);
27
38
  }
28
39
  setProjected(state) {
29
- if (!projectionsEqual(this._projected, state)) {
30
- this._projected = state;
40
+ const previous = this._resolved;
41
+ this._projected = state;
42
+ if (!bindingsEqual(previous, this.resolveBindings())) {
31
43
  this._reflectStylingHooks();
32
44
  this._host.requestUpdate();
33
45
  }
@@ -44,25 +56,27 @@ class AriaTargetController {
44
56
  }
45
57
  resolveBindings() {
46
58
  const projected = this._projected;
47
- const description = this._config.description();
48
- return {
59
+ const description = this._config.description?.() ?? null;
60
+ const naming = projected.labelledBy
61
+ ? projected
62
+ : resolveNaming(this._host, this._config.hasOwnLabel?.() ?? false);
63
+ this._resolved = {
49
64
  role: projected.role,
50
65
  hasPopup: projected.hasPopup,
51
66
  expanded: projected.expanded,
52
67
  disabled: projected.disabled,
53
- label: projected.label,
54
- labelledBy: projected.labelledBy ?? this._config.labels(),
68
+ label: projected.label ?? naming.label,
69
+ labelledBy: naming.labelledBy ?? null,
55
70
  controls: projected.controls ?? null,
56
71
  describedBy: projected.describedBy
57
72
  ? description
58
73
  ? [description, ...projected.describedBy]
59
74
  : projected.describedBy
60
75
  : null,
61
- describedByRef: projected.describedBy
62
- ? undefined
63
- : description?.id || undefined,
76
+ describedByRef: description?.id || undefined,
64
77
  activeDescendant: projected.activeDescendant ?? null,
65
78
  };
79
+ return this._resolved;
66
80
  }
67
81
  }
68
82
  const scalarBindings = [
@@ -71,8 +85,23 @@ const scalarBindings = [
71
85
  ['expanded', 'aria-expanded'],
72
86
  ['disabled', 'aria-disabled'],
73
87
  ['label', 'aria-label'],
74
- ['describedByRef', 'aria-describedby'],
75
88
  ];
89
+ const relationBindings = [
90
+ ['labelledBy', 'labelledByRef', 'ariaLabelledByElements', 'aria-labelledby'],
91
+ [
92
+ 'describedBy',
93
+ 'describedByRef',
94
+ 'ariaDescribedByElements',
95
+ 'aria-describedby',
96
+ ],
97
+ ['controls', null, 'ariaControlsElements', 'aria-controls'],
98
+ ];
99
+ function bindingsEqual(a, b) {
100
+ return (a !== undefined &&
101
+ a.activeDescendant === b.activeDescendant &&
102
+ scalarBindings.every(([key]) => a[key] === b[key]) &&
103
+ relationBindings.every(([key, refKey]) => sameItems(a[key], b[key]) && (!refKey || a[refKey] === b[refKey])));
104
+ }
76
105
  class AriaBindingsDirective extends Directive {
77
106
  constructor(partInfo) {
78
107
  super(partInfo);
@@ -87,13 +116,25 @@ class AriaBindingsDirective extends Directive {
87
116
  const element = part.element;
88
117
  const previous = this._previous;
89
118
  this._previous = bindings;
90
- element.ariaLabelledByElements = bindings.labelledBy;
91
- element.ariaControlsElements = bindings.controls;
92
- element.ariaDescribedByElements = bindings.describedBy;
93
- element.ariaActiveDescendantElement = bindings.activeDescendant;
119
+ for (const [key, refKey, property, attribute] of relationBindings) {
120
+ const next = bindings[key] ?? (refKey && bindings[refKey]) ?? null;
121
+ const prev = previous?.[key] ?? (refKey && previous?.[refKey]) ?? null;
122
+ if (typeof next === 'string') {
123
+ if (next !== prev) {
124
+ element.setAttribute(attribute, next);
125
+ }
126
+ }
127
+ else if (typeof prev === 'string' || !sameItems(prev, next)) {
128
+ element[property] = next;
129
+ }
130
+ }
131
+ const activeDescendant = bindings.activeDescendant ?? null;
132
+ if (activeDescendant !== (previous?.activeDescendant ?? null)) {
133
+ element.ariaActiveDescendantElement = activeDescendant;
134
+ }
94
135
  for (const [key, attribute] of scalarBindings) {
95
136
  const value = bindings[key];
96
- if (!previous || previous[key] !== value) {
137
+ if (previous?.[key] !== value) {
97
138
  value != null
98
139
  ? element.setAttribute(attribute, value)
99
140
  : element.removeAttribute(attribute);
@@ -110,6 +151,15 @@ class AriaProjectorController {
110
151
  this._config = config;
111
152
  host.addController(this);
112
153
  }
154
+ _state() {
155
+ const { state, hasOwnLabel, fallbackLabel } = this._config;
156
+ return hasOwnLabel
157
+ ? {
158
+ ...resolveNaming(this._host, hasOwnLabel(), fallbackLabel?.()),
159
+ ...state(),
160
+ }
161
+ : state();
162
+ }
113
163
  hostUpdated() {
114
164
  const element = this._config.target();
115
165
  if (!element) {
@@ -117,7 +167,7 @@ class AriaProjectorController {
117
167
  }
118
168
  const target = targets.get(element);
119
169
  if (target) {
120
- target.setProjected(this._config.state());
170
+ target.setProjected(this._state());
121
171
  return;
122
172
  }
123
173
  if (!this._retryScheduled) {
@@ -1 +1 @@
1
- {"version":3,"file":"aria-projection.js","sourceRoot":"","sources":["../../../src/internals/controllers/aria-projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,GAGT,MAAM,KAAK,CAAC;AACb,OAAO,EACL,SAAS,EAET,SAAS,EAGT,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAkE1B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAiC,CAAC;AAE7D,SAAS,aAAa,CACpB,CAA4C,EAC5C,CAA4C;IAE5C,IAAI,CAAC,IAAI,IAAI,IAAI,C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E;gBACtD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;gBAC7B,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAQD,MAAM,UAAU,aAAa,CAC3B,IAAoB,EACpB,MAAwB;IAExB,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC;AAMD,MAAM,UAAU,gBAAgB,CAC9B,IAAoB,EACpB,MAA2B;IAE3B,OAAO,IAAI,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import {\n type LitElement,\n noChange,\n type ReactiveController,\n type ReactiveControllerHost,\n} from 'lit';\nimport {\n Directive,\n type DirectiveParameters,\n directive,\n type ElementPart,\n type PartInfo,\n PartType,\n} from 'lit/directive.js';\n\ntype ControllerHost = ReactiveControllerHost & LitElement;\n\n/**\n * ARIA semantics a composite host projects onto the native editor of an\n * input-shaped component.\n *\n * The host cannot publish these itself: it delegates focus, so the native\n * editor inside the input component's shadow root is what assistive technology\n * lands on and reports. All relations travel as element references - an IDREF\n * cannot cross a shadow boundary, while ARIA element reflection resolves into\n * ancestor tree scopes.\n */\nexport type ProjectedARIA = {\n role?: string;\n hasPopup?: string;\n expanded?: string;\n disabled?: string;\n label?: string;\n controls?: ReadonlyArray<Element> | null;\n describedBy?: ReadonlyArray<Element> | null;\n labelledBy?: ReadonlyArray<Element> | null;\n activeDescendant?: Element | null;\n};\n\n/** Configuration for the {@link AriaTargetController}. */\ntype AriaTargetConfig = {\n /** Resolves the component's own `ElementInternals` labels. */\n labels: () => ReadonlyArray<Element> | null;\n /**\n * Resolves the component's own description element (its helper-text\n * container), or `null` when it currently renders no description content.\n */\n description: () => Element | null;\n};\n\n/**\n * Binding values for a native editor element, resolved from the projected\n * state merged with the editor's own ARIA. Applied onto the editor with the\n * {@link ariaBindings} directive: scalars bind as attributes, relations bind\n * through the ARIA element-reflection properties.\n */\nexport type ResolvedARIABindings = {\n role?: string;\n hasPopup?: string;\n expanded?: string;\n disabled?: string;\n label?: string;\n /**\n * Same-root IDREF for the editor's own description, applied while no\n * description is projected. Unlike element reflection, a content attribute\n * stays visible to tooling that only reads attributes (e.g. axe).\n */\n describedByRef?: string;\n labelledBy: ReadonlyArray<Element> | null;\n controls: ReadonlyArray<Element> | null;\n describedBy: ReadonlyArray<Element> | null;\n activeDescendant: Element | null;\n};\n\n/**\n * Internal registry resolving an input-shaped component to its ARIA target\n * controller, so composite hosts can project state without the component\n * exposing a public member for it.\n */\nconst targets = new WeakMap<Element, AriaTargetController>();\n\nfunction elementsEqual(\n a: ReadonlyArray<Element> | null | undefined,\n b: ReadonlyArray<Element> | null | undefined\n): boolean {\n if (a == null || b == null) {\n return a == null && b == null;\n }\n\n return a.length === b.length && a.every((element, i) => element === b[i]);\n}\n\nfunction projectionsEqual(a: ProjectedARIA, b: ProjectedARIA): boolean {\n return (\n a.role === b.role &&\n a.hasPopup === b.hasPopup &&\n a.expanded === b.expanded &&\n a.disabled === b.disabled &&\n a.label === b.label &&\n (a.activeDescendant ?? null) === (b.activeDescendant ?? null) &&\n elementsEqual(a.controls, b.controls) &&\n elementsEqual(a.describedBy, b.describedBy) &&\n elementsEqual(a.labelledBy, b.labelledBy)\n );\n}\n\n/**\n * The receiving end of an ARIA projection, added by every input-shaped\n * component. Holds the state a composite host currently projects and resolves\n * it against the component's own ARIA when the native editor is rendered.\n *\n * Not a reactive controller - it needs no lifecycle hooks, only a render\n * scheduled on the host when the projected state changes.\n */\nclass AriaTargetController {\n private readonly _host: ControllerHost;\n private readonly _config: AriaTargetConfig;\n private _projected: ProjectedARIA = {};\n\n constructor(host: ControllerHost, config: AriaTargetConfig) {\n this._host = host;\n this._config = config;\n targets.set(host, this);\n }\n\n /**\n * Replaces the projected state, scheduling a host render only when it\n * actually changed so projecting on every host update stays cheap.\n */\n public setProjected(state: ProjectedARIA): void {\n if (!projectionsEqual(this._projected, state)) {\n this._projected = state;\n this._reflectStylingHooks();\n this._host.requestUpdate();\n }\n }\n\n /**\n * Mirrors the projected `role`/`hasPopup` as `data-role`/`data-haspopup`\n * attributes on the component itself. The input themes style anchors of\n * composite widgets differently and key off these; the ARIA itself lives on\n * the native editor inside the shadow root, where `:host()` selectors\n * cannot observe it.\n */\n private _reflectStylingHooks(): void {\n const host = this._host;\n const { role, hasPopup } = this._projected;\n\n role\n ? host.setAttribute('data-role', role)\n : host.removeAttribute('data-role');\n hasPopup\n ? host.setAttribute('data-haspopup', hasPopup)\n : host.removeAttribute('data-haspopup');\n }\n\n /**\n * Resolves the binding values for the native editor element by merging the\n * projected state with the editor's own ARIA.\n *\n * Projected labels take precedence over the component's own. The editor's\n * description stays a same-root IDREF ({@link ResolvedARIABindings.describedByRef})\n * while nothing is projected; once a host projects a description, the whole\n * relation switches to element references - attribute and reflection cannot\n * coexist - with the editor's own description element joining the projected\n * ones.\n */\n public resolveBindings(): ResolvedARIABindings {\n const projected = this._projected;\n const description = this._config.description();\n\n return {\n role: projected.role,\n hasPopup: projected.hasPopup,\n expanded: projected.expanded,\n disabled: projected.disabled,\n label: projected.label,\n labelledBy: projected.labelledBy ?? this._config.labels(),\n controls: projected.controls ?? null,\n describedBy: projected.describedBy\n ? description\n ? [description, ...projected.describedBy]\n : projected.describedBy\n : null,\n describedByRef: projected.describedBy\n ? undefined\n : description?.id || undefined,\n activeDescendant: projected.activeDescendant ?? null,\n };\n }\n}\n\nconst scalarBindings = [\n ['role', 'role'],\n ['hasPopup', 'aria-haspopup'],\n ['expanded', 'aria-expanded'],\n ['disabled', 'aria-disabled'],\n ['label', 'aria-label'],\n ['describedByRef', 'aria-describedby'],\n] as const;\n\n/**\n * Applies {@link ResolvedARIABindings} onto the native editor element -\n * relations on every render, scalar attributes only when they changed.\n */\nclass AriaBindingsDirective extends Directive {\n private _previous?: ResolvedARIABindings;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n\n if (partInfo.type !== PartType.ELEMENT) {\n throw new Error(\n '`ariaBindings()` can only be used as an element expression.'\n );\n }\n }\n\n public override render(_: ResolvedARIABindings): unknown {\n return noChange;\n }\n\n public override update(\n part: ElementPart,\n [bindings]: DirectiveParameters<this>\n ): unknown {\n const element = part.element;\n const previous = this._previous;\n this._previous = bindings;\n\n // Relations are re-asserted on every render: element references assigned\n // while the editor is detached (its first render commits inside the\n // template fragment) are dropped by the browser, so memoizing them here\n // would leave the associations permanently missing.\n // Assigning them first also means the scalar pass below always observes\n // the final state, since a reflection property detaches the corresponding\n // content attribute.\n element.ariaLabelledByElements = bindings.labelledBy;\n element.ariaControlsElements = bindings.controls;\n element.ariaDescribedByElements = bindings.describedBy;\n element.ariaActiveDescendantElement = bindings.activeDescendant;\n\n for (const [key, attribute] of scalarBindings) {\n const value = bindings[key];\n\n if (!previous || previous[key] !== value) {\n value != null\n ? element.setAttribute(attribute, value)\n : element.removeAttribute(attribute);\n }\n }\n\n return noChange;\n }\n}\n\n/**\n * Binds resolved ARIA state onto a native editor element as a single element\n * expression, e.g. `<input ${ariaBindings(aria)} />`.\n */\nexport const ariaBindings = directive(AriaBindingsDirective);\n\n/** Configuration for the {@link AriaProjectorController}. */\ntype AriaProjectorConfig = {\n /** Resolves the input-shaped component the ARIA state is projected onto. */\n target: () => Element | null | undefined;\n /** Computes the ARIA state to project. Invoked after every host update. */\n state: () => ProjectedARIA;\n};\n\n/**\n * The sending end of an ARIA projection, added by composite hosts\n * (e.g. `igc-select`). After every host update it pushes the computed ARIA\n * state onto the target component's {@link AriaTargetController}.\n */\nclass AriaProjectorController implements ReactiveController {\n private readonly _host: ControllerHost;\n private readonly _config: AriaProjectorConfig;\n private _retryScheduled = false;\n\n constructor(host: ControllerHost, config: AriaProjectorConfig) {\n this._host = host;\n this._config = config;\n host.addController(this);\n }\n\n /** @internal */\n public hostUpdated(): void {\n const element = this._config.target();\n\n if (!element) {\n return;\n }\n\n const target = targets.get(element);\n\n if (target) {\n target.setProjected(this._config.state());\n return;\n }\n\n // The target exists but has no controller yet - it is not upgraded on the\n // host's first render when definitions register late. Re-project once its\n // definition resolves.\n if (!this._retryScheduled) {\n this._retryScheduled = true;\n\n customElements.whenDefined(element.localName).then(() => {\n this._retryScheduled = false;\n this._host.requestUpdate();\n });\n }\n }\n}\n\n/**\n * Creates and adds an {@link AriaTargetController} to an input-shaped\n * component, making its native editor a valid target for\n * {@link addAriaProjector} - the editor is what assistive technology lands on\n * and reports once the component's host delegates focus to it.\n */\nexport function addAriaTarget(\n host: ControllerHost,\n config: AriaTargetConfig\n): AriaTargetController {\n return new AriaTargetController(host, config);\n}\n\n/**\n * Creates and adds an {@link AriaProjectorController} to a composite host,\n * projecting ARIA semantics onto the native editor of the target component.\n */\nexport function addAriaProjector(\n host: ControllerHost,\n config: AriaProjectorConfig\n): AriaProjectorController {\n return new AriaProjectorController(host, config);\n}\n\nexport type { AriaProjectorController, AriaTargetController };\n"]}
1
+ {"version":3,"file":"aria-projection.js","sourceRoot":"","sources":["../../../src/internals/controllers/aria-projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,GAGT,MAAM,KAAK,CAAC;AACb,OAAO,EACL,SAAS,EAET,SAAS,EAGT,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;AA0BnE,MAAM,UAAU,aAAa,CAC3B,IAAa,EACb,QAA0B,EAC1B,QAAiB;IAEjB,MAAM,UAAU,GAAG,IAAI,CAAC,sBAAsB,CAAC;IAE/C,IAAI,UAAU,EAAE,MAAM,EAAE,CAAC;QACvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IACpC,C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AE,CAAC;gBAC9D,GAAG,KAAK,EAAE;aACX;YACH,CAAC,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAGM,WAAW;QAChB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAEtC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEpC,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YACnC,OAAO;QACT,CAAC;QAID,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAE5B,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBACtD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;gBAC7B,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAOD,MAAM,UAAU,aAAa,CAC3B,IAAoB,EACpB,MAAwB;IAExB,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC;AAMD,MAAM,UAAU,gBAAgB,CAC9B,IAAoB,EACpB,MAA2B;IAE3B,OAAO,IAAI,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import {\n type LitElement,\n noChange,\n type ReactiveController,\n type ReactiveControllerHost,\n} from 'lit';\nimport {\n Directive,\n type DirectiveParameters,\n directive,\n type ElementPart,\n type PartInfo,\n PartType,\n} from 'lit/directive.js';\nimport { sameItems } from '../utils/arrays.js';\nimport { isString } from '../utils/types.js';\nimport { internalsOf } from './internals.js';\nimport type { SlotController } from './slot.js';\n\ntype ControllerHost = ReactiveControllerHost & LitElement;\n\n/** The host attributes that {@link resolveNaming} reads. */\nexport const NAMING_ATTRIBUTES = ['aria-label', 'aria-labelledby'];\n\n/** The name sources of a component, resolved by {@link resolveNaming}. */\nexport type ResolvedNaming = {\n /** The elements that name the component, bound as element references. */\n labelledBy: ReadonlyArray<Element> | null;\n /** The id of the own label in the shadow root, bound as an IDREF. */\n labelledByRef?: string;\n /** The host `aria-label` or the fallback, when no label names the component. */\n label?: string;\n};\n\n/**\n * Resolves the name of a form associated component. The first source that is\n * present wins: the host `aria-labelledby`, the external `<label>` elements,\n * the own label of the component, the host `aria-label`, and `fallback`.\n *\n * `ownLabel` is the id of the own label in the shadow root, or `true` for an\n * own label that names the control natively, for example a `<label for>`.\n *\n * @remarks\n * Assistive technology reads the native control in the shadow root, so the\n * name moves from the host to that control. `host.ariaLabelledByElements`\n * resolves the host IDREFs in the host tree. An external label replaces the\n * own label. A wrapping label contains the own label text.\n */\nexport function resolveNaming(\n host: Element,\n ownLabel: string | boolean,\n fallback?: string\n): ResolvedNaming {\n const referenced = host.ariaLabelledByElements;\n\n if (referenced?.length) {\n return { labelledBy: referenced };\n }\n\n const labels = internalsOf(host)?.labels;\n\n if (labels) {\n return { labelledBy: labels };\n }\n\n const naming: ResolvedNaming = {\n labelledBy: null,\n label: ownLabel ? undefined : host.getAttribute('aria-label') || fallback,\n };\n\n if (isString(ownLabel)) {\n naming.labelledByRef = ownLabel;\n }\n\n return naming;\n}\n\n/**\n * The ARIA semantics that a composite host projects onto the native editor.\n *\n * @remarks\n * The host delegates focus, so assistive technology lands on the editor of\n * the input-shaped component and reports it. Every relation travels as an\n * element reference, because an IDREF does not cross a shadow boundary.\n */\nexport type ProjectedARIA = {\n role?: string;\n hasPopup?: string;\n expanded?: string;\n disabled?: string;\n label?: string;\n controls?: ReadonlyArray<Element> | null;\n describedBy?: ReadonlyArray<Element> | null;\n labelledBy?: ReadonlyArray<Element> | null;\n activeDescendant?: Element | null;\n};\n\n/** The id of the helper-text container of `IgcValidationContainerComponent`. */\nexport const HELPER_TEXT_ID = 'helper-text';\n\n/** Returns the helper-text container when the `helper-text` slot has content. */\nexport function helperText(\n host: LitElement,\n slots: Pick<SlotController<'helper-text'>, 'hasAssignedElements'>\n): Element | null {\n return slots.hasAssignedElements('helper-text')\n ? host.renderRoot.querySelector(`#${HELPER_TEXT_ID}`)\n : null;\n}\n\ntype AriaTargetConfig = {\n /** Resolves the helper-text container, or `null` when there is none. */\n description?: () => Element | null;\n /** Whether an own label names the editor natively, for example a `<label for>`. */\n hasOwnLabel?: () => boolean;\n};\n\n/**\n * The binding values for a native editor element, resolved from the projected\n * state and the own ARIA of the editor, and applied by the\n * {@link ariaBindings} directive. A scalar binds as an attribute, a relation\n * through an ARIA element-reflection property.\n */\nexport type ResolvedARIABindings = {\n role?: string;\n hasPopup?: string;\n expanded?: string;\n disabled?: string;\n label?: string;\n /**\n * The IDREF of the own description in the same root. The directive binds it\n * while `describedBy` is null, so a tool that reads only attributes, for\n * example axe, still sees the relation.\n */\n describedByRef?: string;\n /** The IDREF of the own label in the same root. It binds as `describedByRef`. */\n labelledByRef?: string;\n labelledBy: ReadonlyArray<Element> | null;\n controls: ReadonlyArray<Element> | null;\n describedBy: ReadonlyArray<Element> | null;\n activeDescendant: Element | null;\n};\n\n/**\n * Resolves an input-shaped component to its ARIA target controller, so the\n * component needs no public member for the projection.\n */\nconst targets = new WeakMap<Element, AriaTargetController>();\n\n/**\n * The receiving end of an ARIA projection. It names the native control in the\n * shadow root, see {@link resolveNaming}, and applies the state that a\n * composite host projects.\n *\n * @remarks\n * Not a reactive controller. The host render resolves the bindings, and the\n * form associated mixin renders the host again when the name sources change.\n */\nclass AriaTargetController {\n private readonly _host: ControllerHost;\n private readonly _config: AriaTargetConfig;\n private _projected: ProjectedARIA = {};\n /** The bindings last resolved for the native editor. */\n private _resolved?: ResolvedARIABindings;\n\n constructor(host: ControllerHost, config: AriaTargetConfig) {\n this._host = host;\n this._config = config;\n targets.set(host, this);\n }\n\n /**\n * Replaces the projected state.\n *\n * @remarks\n * A host render happens only when the resolved bindings change, so a\n * projection on every host update stays inexpensive. The comparison uses\n * the resolved bindings, so it also catches a change to the own labels or\n * description, which the component cannot observe.\n */\n public setProjected(state: ProjectedARIA): void {\n const previous = this._resolved;\n this._projected = state;\n\n if (!bindingsEqual(previous, this.resolveBindings())) {\n this._reflectStylingHooks();\n this._host.requestUpdate();\n }\n }\n\n /**\n * Mirrors the projected `role` and `hasPopup` onto `data-role` and\n * `data-haspopup`.\n *\n * @remarks\n * The input themes style the anchor of a composite widget from these\n * attributes. The ARIA itself stays on the editor in the shadow root, where\n * a `:host()` selector cannot observe it.\n */\n private _reflectStylingHooks(): void {\n const host = this._host;\n const { role, hasPopup } = this._projected;\n\n role\n ? host.setAttribute('data-role', role)\n : host.removeAttribute('data-role');\n hasPopup\n ? host.setAttribute('data-haspopup', hasPopup)\n : host.removeAttribute('data-haspopup');\n }\n\n /**\n * Resolves the binding values for the native editor element. A projected\n * value wins over the own naming.\n */\n public resolveBindings(): ResolvedARIABindings {\n const projected = this._projected;\n const description = this._config.description?.() ?? null;\n const naming = projected.labelledBy\n ? projected\n : resolveNaming(this._host, this._config.hasOwnLabel?.() ?? false);\n\n this._resolved = {\n role: projected.role,\n hasPopup: projected.hasPopup,\n expanded: projected.expanded,\n disabled: projected.disabled,\n label: projected.label ?? naming.label,\n labelledBy: naming.labelledBy ?? null,\n controls: projected.controls ?? null,\n describedBy: projected.describedBy\n ? description\n ? [description, ...projected.describedBy]\n : projected.describedBy\n : null,\n describedByRef: description?.id || undefined,\n activeDescendant: projected.activeDescendant ?? null,\n };\n\n return this._resolved;\n }\n}\n\nconst scalarBindings = [\n ['role', 'role'],\n ['hasPopup', 'aria-haspopup'],\n ['expanded', 'aria-expanded'],\n ['disabled', 'aria-disabled'],\n ['label', 'aria-label'],\n] as const;\n\n/** The relations: the key, the IDREF key, the property, and the attribute. */\nconst relationBindings = [\n ['labelledBy', 'labelledByRef', 'ariaLabelledByElements', 'aria-labelledby'],\n [\n 'describedBy',\n 'describedByRef',\n 'ariaDescribedByElements',\n 'aria-describedby',\n ],\n ['controls', null, 'ariaControlsElements', 'aria-controls'],\n] as const;\n\nfunction bindingsEqual(\n a: ResolvedARIABindings | undefined,\n b: ResolvedARIABindings\n): boolean {\n return (\n a !== undefined &&\n a.activeDescendant === b.activeDescendant &&\n scalarBindings.every(([key]) => a[key] === b[key]) &&\n relationBindings.every(\n ([key, refKey]) =>\n sameItems(a[key], b[key]) && (!refKey || a[refKey] === b[refKey])\n )\n );\n}\n\n/** The bindings that {@link ariaBindings} accepts. Each key is optional. */\nexport type ARIABindings = Partial<ResolvedARIABindings>;\n\n/**\n * Applies {@link ARIABindings} to the native editor. It writes only changed\n * values, and only to the attributes that its bindings set.\n */\nclass AriaBindingsDirective extends Directive {\n private _previous?: ARIABindings;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n\n if (partInfo.type !== PartType.ELEMENT) {\n throw new Error(\n '`ariaBindings()` can only be used as an element expression.'\n );\n }\n }\n\n public override render(_: ARIABindings): unknown {\n return noChange;\n }\n\n public override update(\n part: ElementPart,\n [bindings]: DirectiveParameters<this>\n ): unknown {\n const element = part.element;\n const previous = this._previous;\n this._previous = bindings;\n\n // A value is an element list, an IDREF string or null. An IDREF write\n // clears the reflection. A null write removes the attribute.\n for (const [key, refKey, property, attribute] of relationBindings) {\n const next = bindings[key] ?? (refKey && bindings[refKey]) ?? null;\n const prev = previous?.[key] ?? (refKey && previous?.[refKey]) ?? null;\n\n if (typeof next === 'string') {\n if (next !== prev) {\n element.setAttribute(attribute, next);\n }\n } else if (typeof prev === 'string' || !sameItems(prev, next)) {\n element[property] = next;\n }\n }\n\n const activeDescendant = bindings.activeDescendant ?? null;\n\n if (activeDescendant !== (previous?.activeDescendant ?? null)) {\n element.ariaActiveDescendantElement = activeDescendant;\n }\n\n for (const [key, attribute] of scalarBindings) {\n const value = bindings[key];\n\n if (previous?.[key] !== value) {\n value != null\n ? element.setAttribute(attribute, value)\n : element.removeAttribute(attribute);\n }\n }\n\n return noChange;\n }\n}\n\n/**\n * Binds the resolved ARIA state onto a native editor element as one element\n * expression, for example `<input ${ariaBindings(aria)} />`.\n */\nexport const ariaBindings = directive(AriaBindingsDirective);\n\ntype AriaProjectorConfig = {\n /** Resolves the input-shaped component that receives the ARIA state. */\n target: () => Element | null | undefined;\n /** Computes the ARIA state to project, after every host update. */\n state: () => ProjectedARIA;\n /**\n * Whether the host shows an own label. When set, the projector also\n * projects the name of the host, see {@link resolveNaming}.\n */\n hasOwnLabel?: () => boolean;\n /** Resolves the name to use when no other source names the host. */\n fallbackLabel?: () => string;\n};\n\n/**\n * The sending end of an ARIA projection. A composite host such as\n * `igc-select` adds it to push the computed ARIA state onto the\n * {@link AriaTargetController} of the target after every host update.\n */\nclass AriaProjectorController implements ReactiveController {\n private readonly _host: ControllerHost;\n private readonly _config: AriaProjectorConfig;\n private _retryScheduled = false;\n\n constructor(host: ControllerHost, config: AriaProjectorConfig) {\n this._host = host;\n this._config = config;\n host.addController(this);\n }\n\n /** Computes the state, with the name of the host when it is configured. */\n private _state(): ProjectedARIA {\n const { state, hasOwnLabel, fallbackLabel } = this._config;\n\n return hasOwnLabel\n ? {\n ...resolveNaming(this._host, hasOwnLabel(), fallbackLabel?.()),\n ...state(),\n }\n : state();\n }\n\n /** @internal */\n public hostUpdated(): void {\n const element = this._config.target();\n\n if (!element) {\n return;\n }\n\n const target = targets.get(element);\n\n if (target) {\n target.setProjected(this._state());\n return;\n }\n\n // The target exists but is not upgraded yet, because its definition\n // registered late. Project again once that definition resolves.\n if (!this._retryScheduled) {\n this._retryScheduled = true;\n\n customElements.whenDefined(element.localName).then(() => {\n this._retryScheduled = false;\n this._host.requestUpdate();\n });\n }\n }\n}\n\n/**\n * Creates an {@link AriaTargetController} and adds it to an input-shaped\n * component. It makes the native editor of the component a valid target for\n * {@link addAriaProjector}.\n */\nexport function addAriaTarget(\n host: ControllerHost,\n config: AriaTargetConfig\n): AriaTargetController {\n return new AriaTargetController(host, config);\n}\n\n/**\n * Creates an {@link AriaProjectorController} and adds it to a composite host.\n * It projects ARIA onto the native editor of the target component.\n */\nexport function addAriaProjector(\n host: ControllerHost,\n config: AriaProjectorConfig\n): AriaProjectorController {\n return new AriaProjectorController(host, config);\n}\n\nexport type { AriaProjectorController, AriaTargetController };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"async-consumer.js","sourceRoot":"","sources":["../../../src/internals/controllers/async-consumer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAoB,MAAM,cAAc,CAAC;AAc/E,MAAM,OAAO,oBAAoB;IAQ/B,YAAY,IAAU,EAAE,OAA+B;QACrD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAExB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC;IAC/B,CAAC;IAKM,KAAK,CAAC,aAAa;QACxB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;QAEhC,IAAI,CAAC,SAAS,KAAK,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE;YACjD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO;YAC9B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ;YAChC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS;SACnC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB,CAIhC,IAAU,EACV,OAAU,EACV,QAAgE;IAEhE,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE;QACpC,OAAO;QACP,QAAQ;QACR,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { type Context, ContextConsumer, type ContextType } from '@lit/context';\nimport type {\n LitElement,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\n\ntype AsyncContextOptions<T extends Context<unknown, unknown>> = {\n context: T;\n callback?: (value: ContextType<T>, dispose?: () => void) => void;\n subscribe?: boolean;\n};\n\n/* blazorSuppress */\nexport class AsyncContextConsumer<\n T extends Context<unknown, unknown>,\n Host extends ReactiveControllerHost & HTMLElement,\n> implements ReactiveController {\n protected _host: Host;\n protected _options: AsyncContextOptions<T>;\n protected _consumer?: ContextConsumer<T, Host>;\n\n constructor(host: Host, options: AsyncContextOptions<T>) {\n this._host = host;\n this._options = options;\n\n this._host.addController(this);\n }\n\n public get value(): ContextType<T> | undefined {\n return this._consumer?.value;\n }\n\n // If there is already an instance of a consumer (because of an attach/detach cycle),\n // skip creating a new instance for this host - checked both before and after the\n // await, since a reconnect can land in between.\n public async hostConnected(): Promise<void> {\n if (this._consumer) {\n return;\n }\n\n await this._host.updateComplete;\n\n this._consumer ??= new ContextConsumer(this._host, {\n context: this._options.context,\n callback: this._options.callback,\n subscribe: this._options.subscribe,\n });\n }\n}\n\nexport function createAsyncContext<\n T extends Context<unknown, unknown>,\n Host extends ReactiveControllerHost & LitElement,\n>(\n host: Host,\n context: T,\n callback?: (value: ContextType<T>, dispose?: () => void) => void\n): AsyncContextConsumer<T, Host> {\n return new AsyncContextConsumer(host, {\n context,\n callback,\n subscribe: true,\n });\n}\n"]}
1
+ {"version":3,"file":"async-consumer.js","sourceRoot":"","sources":["../../../src/internals/controllers/async-consumer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAoB,MAAM,cAAc,CAAC;AAc/E,MAAM,OAAO,oBAAoB;IAQ/B,YAAY,IAAU,EAAE,OAA+B;QACrD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAExB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC;IAC/B,CAAC;IAIM,KAAK,CAAC,aAAa;QACxB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;QAEhC,IAAI,CAAC,SAAS,KAAK,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE;YACjD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO;YAC9B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ;YAChC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS;SACnC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB,CAIhC,IAAU,EACV,OAAU,EACV,QAAgE;IAEhE,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE;QACpC,OAAO;QACP,QAAQ;QACR,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { type Context, ContextConsumer, type ContextType } from '@lit/context';\nimport type {\n LitElement,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\n\ntype AsyncContextOptions<T extends Context<unknown, unknown>> = {\n context: T;\n callback?: (value: ContextType<T>, dispose?: () => void) => void;\n subscribe?: boolean;\n};\n\n/* blazorSuppress */\nexport class AsyncContextConsumer<\n T extends Context<unknown, unknown>,\n Host extends ReactiveControllerHost & HTMLElement,\n> implements ReactiveController {\n protected _host: Host;\n protected _options: AsyncContextOptions<T>;\n protected _consumer?: ContextConsumer<T, Host>;\n\n constructor(host: Host, options: AsyncContextOptions<T>) {\n this._host = host;\n this._options = options;\n\n this._host.addController(this);\n }\n\n public get value(): ContextType<T> | undefined {\n return this._consumer?.value;\n }\n\n // The consumer survives a disconnect, and a reconnect can land during the\n // await, so the guard runs on both sides of it.\n public async hostConnected(): Promise<void> {\n if (this._consumer) {\n return;\n }\n\n await this._host.updateComplete;\n\n this._consumer ??= new ContextConsumer(this._host, {\n context: this._options.context,\n callback: this._options.callback,\n subscribe: this._options.subscribe,\n });\n }\n}\n\nexport function createAsyncContext<\n T extends Context<unknown, unknown>,\n Host extends ReactiveControllerHost & LitElement,\n>(\n host: Host,\n context: T,\n callback?: (value: ContextType<T>, dispose?: () => void) => void\n): AsyncContextConsumer<T, Host> {\n return new AsyncContextConsumer(host, {\n context,\n callback,\n subscribe: true,\n });\n}\n"]}
@@ -1,14 +1,13 @@
1
- import type { LitElement, ReactiveController } from 'lit';
1
+ import type { LitElement } from 'lit';
2
2
  /**
3
- * A Lit reactive controller that bridges the native
3
+ * Connects the native
4
4
  * [Invoker Commands API](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API)
5
- * with a component's programmatic API.
5
+ * to the programmatic API of a component.
6
6
  *
7
- * When an `igc-button` (or any element using the `command` / `commandfor`
8
- * attributes) invokes a command on the host, the browser dispatches a
9
- * `CommandEvent` on the target element. This controller listens for that
10
- * event and forwards it to the registered callback for the given command
11
- * string.
7
+ * @remarks
8
+ * An element with the `command` and `commandfor` attributes makes the browser
9
+ * send a `CommandEvent` to the host, and the controller runs the callback of
10
+ * that command string.
12
11
  *
13
12
  * @example
14
13
  * ```ts
@@ -20,43 +19,29 @@ import type { LitElement, ReactiveController } from 'lit';
20
19
  * }
21
20
  * ```
22
21
  *
23
- * With the above setup, a button in the document can control the dialog
24
- * declaratively:
22
+ * A button in the document then controls the dialog declaratively:
25
23
  *
26
24
  * ```html
27
25
  * <igc-button command="open" commandfor="my-dialog">Open</igc-button>
28
26
  * <igc-dialog id="my-dialog"></igc-dialog>
29
27
  * ```
30
28
  */
31
- declare class CommandController implements ReactiveController {
29
+ declare class CommandController {
32
30
  private readonly _host;
33
31
  private readonly _commandMap;
34
32
  constructor(host: LitElement);
35
33
  /**
36
- * Registers a command string and its corresponding handler callback.
34
+ * Registers a command string and its handler callback.
37
35
  *
38
- * Returns `this` to allow chained calls:
39
- * ```ts
40
- * addCommandController(this)
41
- * .set('open', this.show)
42
- * .set('close', this.hide);
43
- * ```
44
- *
45
- * @param command - The command string to listen for (e.g. `'open'`,
46
- * `'toggle-popover'`, or a custom `'--my-command'`).
47
- * @param callback - The method to invoke when the command is received.
48
- * Called with the host as `this`.
36
+ * @param command - The command string to listen for, for example `'open'`,
37
+ * `'toggle-popover'`, or a custom `'--my-command'`.
38
+ * @param callback - The method that runs when the command arrives. The
39
+ * controller calls it with the host as `this`.
49
40
  */
50
41
  set(command: string, callback: () => unknown): this;
51
42
  /** @internal */
52
- hostConnected(): void;
53
- /** @internal */
54
- hostDisconnected(): void;
55
- /** @internal */
56
43
  handleEvent(event: Event): void;
57
44
  }
58
- /**
59
- * Creates a {@link CommandController} and attaches it to the given host.
60
- */
45
+ /** Creates a {@link CommandController} and adds it to the given host. */
61
46
  export declare function addCommandController(host: LitElement): CommandController;
62
47
  export type { CommandController };
@@ -1,19 +1,14 @@
1
+ import { addHostListeners } from './host-listeners.js';
1
2
  class CommandController {
2
3
  constructor(host) {
3
4
  this._commandMap = new Map();
4
5
  this._host = host;
5
- host.addController(this);
6
+ addHostListeners(host, { events: ['command'], listener: this });
6
7
  }
7
8
  set(command, callback) {
8
9
  this._commandMap.set(command, callback);
9
10
  return this;
10
11
  }
11
- hostConnected() {
12
- this._host.addEventListener('command', this);
13
- }
14
- hostDisconnected() {
15
- this._host.removeEventListener('command', this);
16
- }
17
12
  handleEvent(event) {
18
13
  const commandEvent = event;
19
14
  this._commandMap.get(commandEvent.command)?.call(this._host);