igniteui-webcomponents 7.3.2 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (441) hide show
  1. package/CHANGELOG.md +49 -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 +1 -1
  101. package/components/checkbox/checkbox.js +1 -1
  102. package/components/checkbox/checkbox.js.map +1 -1
  103. package/components/chip/chip.d.ts +2 -2
  104. package/components/chip/chip.js.map +1 -1
  105. package/components/color-picker/color-picker.d.ts +35 -34
  106. package/components/color-picker/color-picker.js +9 -4
  107. package/components/color-picker/color-picker.js.map +1 -1
  108. package/components/color-picker/common.d.ts +0 -2
  109. package/components/color-picker/common.js +2 -2
  110. package/components/color-picker/common.js.map +1 -1
  111. package/components/color-picker/converters.js.map +1 -1
  112. package/components/color-picker/picker-canvas.js.map +1 -1
  113. package/components/combo/combo.d.ts +18 -20
  114. package/components/combo/combo.js +8 -2
  115. package/components/combo/combo.js.map +1 -1
  116. package/components/combo/controllers/data.d.ts +7 -10
  117. package/components/combo/controllers/data.js.map +1 -1
  118. package/components/date-picker/date-picker.base.d.ts +22 -27
  119. package/components/date-picker/date-picker.base.js +7 -1
  120. package/components/date-picker/date-picker.base.js.map +1 -1
  121. package/components/date-picker/date-picker.d.ts +1 -1
  122. package/components/date-picker/date-picker.js +5 -3
  123. package/components/date-picker/date-picker.js.map +1 -1
  124. package/components/date-range-picker/date-range-input.d.ts +0 -2
  125. package/components/date-range-picker/date-range-input.js +0 -6
  126. package/components/date-range-picker/date-range-input.js.map +1 -1
  127. package/components/date-range-picker/date-range-picker.d.ts +22 -31
  128. package/components/date-range-picker/date-range-picker.js +7 -7
  129. package/components/date-range-picker/date-range-picker.js.map +1 -1
  130. package/components/date-range-picker/i18n.d.ts +21 -0
  131. package/components/date-range-picker/i18n.js +10 -0
  132. package/components/date-range-picker/i18n.js.map +1 -0
  133. package/components/date-range-picker/predefined-ranges-area.d.ts +3 -3
  134. package/components/date-range-picker/predefined-ranges-area.js +2 -5
  135. package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
  136. package/components/date-range-picker/validators.d.ts +0 -4
  137. package/components/date-range-picker/validators.js +4 -4
  138. package/components/date-range-picker/validators.js.map +1 -1
  139. package/components/date-time-input/date-time-input.base.d.ts +39 -37
  140. package/components/date-time-input/date-time-input.base.js +6 -0
  141. package/components/date-time-input/date-time-input.base.js.map +1 -1
  142. package/components/date-time-input/date-time-input.d.ts +1 -11
  143. package/components/date-time-input/date-time-input.js +0 -6
  144. package/components/date-time-input/date-time-input.js.map +1 -1
  145. package/components/date-time-input/datetime-mask-parser.d.ts +0 -10
  146. package/components/date-time-input/datetime-mask-parser.js +1 -1
  147. package/components/date-time-input/datetime-mask-parser.js.map +1 -1
  148. package/components/dialog/dialog.js.map +1 -1
  149. package/components/dropdown/dropdown-group.d.ts +2 -10
  150. package/components/dropdown/dropdown-group.js +2 -27
  151. package/components/dropdown/dropdown-group.js.map +1 -1
  152. package/components/dropdown/dropdown.d.ts +17 -23
  153. package/components/dropdown/dropdown.js +5 -17
  154. package/components/dropdown/dropdown.js.map +1 -1
  155. package/components/file-input/file-input.d.ts +2 -2
  156. package/components/file-input/file-input.js.map +1 -1
  157. package/components/icon/icon.d.ts +1 -1
  158. package/components/icon/icon.registry.d.ts +6 -6
  159. package/components/icon/icon.registry.js.map +1 -1
  160. package/components/input/input.d.ts +3 -3
  161. package/components/input/input.js.map +1 -1
  162. package/components/mask-input/mask-history.d.ts +22 -18
  163. package/components/mask-input/mask-history.js.map +1 -1
  164. package/components/mask-input/mask-input.d.ts +1 -1
  165. package/components/mask-input/mask-parser.d.ts +11 -13
  166. package/components/mask-input/mask-parser.js.map +1 -1
  167. package/components/popover/popover.d.ts +45 -34
  168. package/components/popover/popover.js +54 -122
  169. package/components/popover/popover.js.map +1 -1
  170. package/components/popover/position/arrow.d.ts +19 -0
  171. package/components/popover/position/arrow.js +33 -0
  172. package/components/popover/position/arrow.js.map +1 -0
  173. package/components/popover/position/floating.d.ts +40 -0
  174. package/components/popover/position/floating.js +146 -0
  175. package/components/popover/position/floating.js.map +1 -0
  176. package/components/popover/position/native.d.ts +45 -0
  177. package/components/popover/position/native.js +158 -0
  178. package/components/popover/position/native.js.map +1 -0
  179. package/components/popover/position/strategy.d.ts +37 -0
  180. package/components/popover/position/strategy.js +21 -0
  181. package/components/popover/position/strategy.js.map +1 -0
  182. package/components/popover/position/types.d.ts +26 -0
  183. package/components/popover/position/types.js +15 -0
  184. package/components/popover/position/types.js.map +1 -0
  185. package/components/popover/themes/light/popover.base.css.js +1 -1
  186. package/components/popover/themes/light/popover.base.css.js.map +1 -1
  187. package/components/progress/circular-progress.d.ts +0 -5
  188. package/components/progress/circular-progress.js.map +1 -1
  189. package/components/qr-code/qr-code.d.ts +1 -1
  190. package/components/radio/radio.d.ts +4 -4
  191. package/components/radio/radio.js +17 -14
  192. package/components/radio/radio.js.map +1 -1
  193. package/components/radio-group/radio-group.js.map +1 -1
  194. package/components/rating/rating.d.ts +6 -6
  195. package/components/rating/rating.js.map +1 -1
  196. package/components/select/select-group.d.ts +5 -10
  197. package/components/select/select-group.js +10 -34
  198. package/components/select/select-group.js.map +1 -1
  199. package/components/select/select.d.ts +12 -20
  200. package/components/select/select.js +4 -14
  201. package/components/select/select.js.map +1 -1
  202. package/components/splitter/splitter.d.ts +6 -6
  203. package/components/splitter/splitter.js.map +1 -1
  204. package/components/textarea/textarea.d.ts +1 -1
  205. package/components/textarea/textarea.js.map +1 -1
  206. package/components/tile-manager/tile-manager.d.ts +6 -7
  207. package/components/tile-manager/tile-manager.js.map +1 -1
  208. package/components/tile-manager/tile.d.ts +3 -3
  209. package/components/tile-manager/tile.js.map +1 -1
  210. package/components/toast/toast.d.ts +0 -2
  211. package/components/toast/toast.js.map +1 -1
  212. package/components/tooltip/controller.js.map +1 -1
  213. package/components/tooltip/service.js +4 -5
  214. package/components/tooltip/service.js.map +1 -1
  215. package/components/tooltip/tooltip.d.ts +34 -13
  216. package/components/tooltip/tooltip.js +8 -4
  217. package/components/tooltip/tooltip.js.map +1 -1
  218. package/components/tree/tree-item.d.ts +6 -6
  219. package/components/tree/tree-item.js.map +1 -1
  220. package/components/tree/tree.navigation.d.ts +5 -6
  221. package/components/tree/tree.navigation.js.map +1 -1
  222. package/components/tree/tree.selection.js.map +1 -1
  223. package/components/types.d.ts +1 -1
  224. package/components/types.js.map +1 -1
  225. package/components/validation-container/validation-container.js.map +1 -1
  226. package/components/virtualization/engine.d.ts +5 -5
  227. package/components/virtualization/engine.js.map +1 -1
  228. package/components/virtualization/virtualization.d.ts +61 -63
  229. package/components/virtualization/virtualization.js +6 -5
  230. package/components/virtualization/virtualization.js.map +1 -1
  231. package/custom-elements.json +16280 -19679
  232. package/igniteui-webcomponents.css-data.json +2 -2
  233. package/igniteui-webcomponents.html-data.json +1 -1
  234. package/index.d.ts +2 -0
  235. package/index.js +2 -0
  236. package/index.js.map +1 -1
  237. package/internals/abort-handler.d.ts +13 -25
  238. package/internals/abort-handler.js +4 -6
  239. package/internals/abort-handler.js.map +1 -1
  240. package/internals/context.d.ts +13 -7
  241. package/internals/context.js +2 -1
  242. package/internals/context.js.map +1 -1
  243. package/internals/controllers/adopt-styles.d.ts +19 -20
  244. package/internals/controllers/adopt-styles.js +3 -8
  245. package/internals/controllers/adopt-styles.js.map +1 -1
  246. package/internals/controllers/aria-projection.d.ts +56 -55
  247. package/internals/controllers/aria-projection.js +14 -15
  248. package/internals/controllers/aria-projection.js.map +1 -1
  249. package/internals/controllers/async-consumer.js.map +1 -1
  250. package/internals/controllers/command.d.ts +15 -30
  251. package/internals/controllers/command.js +2 -7
  252. package/internals/controllers/command.js.map +1 -1
  253. package/internals/controllers/context-provider.d.ts +7 -13
  254. package/internals/controllers/context-provider.js.map +1 -1
  255. package/internals/controllers/focus-ring.d.ts +10 -30
  256. package/internals/controllers/focus-ring.js +6 -12
  257. package/internals/controllers/focus-ring.js.map +1 -1
  258. package/internals/controllers/fullscreen.d.ts +7 -23
  259. package/internals/controllers/fullscreen.js +3 -9
  260. package/internals/controllers/fullscreen.js.map +1 -1
  261. package/internals/controllers/gestures.d.ts +10 -29
  262. package/internals/controllers/gestures.js +1 -3
  263. package/internals/controllers/gestures.js.map +1 -1
  264. package/internals/controllers/group.d.ts +13 -30
  265. package/internals/controllers/group.js.map +1 -1
  266. package/internals/controllers/host-listeners.d.ts +28 -0
  267. package/internals/controllers/host-listeners.js +27 -0
  268. package/internals/controllers/host-listeners.js.map +1 -0
  269. package/internals/controllers/id-resolver.d.ts +8 -9
  270. package/internals/controllers/id-resolver.js +6 -14
  271. package/internals/controllers/id-resolver.js.map +1 -1
  272. package/internals/controllers/internals.d.ts +53 -104
  273. package/internals/controllers/internals.js +40 -13
  274. package/internals/controllers/internals.js.map +1 -1
  275. package/internals/controllers/key-bindings.d.ts +61 -158
  276. package/internals/controllers/key-bindings.js +68 -67
  277. package/internals/controllers/key-bindings.js.map +1 -1
  278. package/internals/controllers/keys.d.ts +32 -0
  279. package/internals/controllers/keys.js +20 -0
  280. package/internals/controllers/keys.js.map +1 -0
  281. package/internals/controllers/mutation-observer.d.ts +14 -37
  282. package/internals/controllers/mutation-observer.js +1 -1
  283. package/internals/controllers/mutation-observer.js.map +1 -1
  284. package/internals/controllers/resize-observer.d.ts +9 -19
  285. package/internals/controllers/resize-observer.js.map +1 -1
  286. package/internals/controllers/root-click.d.ts +11 -42
  287. package/internals/controllers/root-click.js +4 -6
  288. package/internals/controllers/root-click.js.map +1 -1
  289. package/internals/controllers/roving-focus.d.ts +16 -35
  290. package/internals/controllers/roving-focus.js.map +1 -1
  291. package/internals/controllers/slot.d.ts +25 -54
  292. package/internals/controllers/slot.js +6 -6
  293. package/internals/controllers/slot.js.map +1 -1
  294. package/internals/controllers/toggle.d.ts +44 -48
  295. package/internals/controllers/toggle.js.map +1 -1
  296. package/internals/date/compare.js.map +1 -1
  297. package/internals/date/converters.d.ts +10 -7
  298. package/internals/date/converters.js.map +1 -1
  299. package/internals/date/model.d.ts +9 -16
  300. package/internals/date/model.js +22 -25
  301. package/internals/date/model.js.map +1 -1
  302. package/internals/decorators/blazorAdditionalDependencies.d.ts +4 -2
  303. package/internals/decorators/blazorAdditionalDependencies.js.map +1 -1
  304. package/internals/decorators/blazorDeepImport.d.ts +1 -3
  305. package/internals/decorators/blazorDeepImport.js.map +1 -1
  306. package/internals/decorators/blazorInclude.d.ts +3 -2
  307. package/internals/decorators/blazorInclude.js.map +1 -1
  308. package/internals/decorators/blazorIndirectRender.d.ts +1 -3
  309. package/internals/decorators/blazorIndirectRender.js.map +1 -1
  310. package/internals/decorators/blazorSuppressComponent.d.ts +1 -3
  311. package/internals/decorators/blazorSuppressComponent.js.map +1 -1
  312. package/internals/decorators/coerced-property.d.ts +14 -20
  313. package/internals/decorators/coerced-property.js.map +1 -1
  314. package/internals/decorators/shadow-options.d.ts +2 -5
  315. package/internals/decorators/shadow-options.js.map +1 -1
  316. package/internals/definitions/defineAllComponents.js +2 -0
  317. package/internals/definitions/defineAllComponents.js.map +1 -1
  318. package/internals/directives/drag.d.ts +51 -81
  319. package/internals/directives/drag.js +27 -89
  320. package/internals/directives/drag.js.map +1 -1
  321. package/internals/directives/pointer-operation.d.ts +75 -0
  322. package/internals/directives/pointer-operation.js +92 -0
  323. package/internals/directives/pointer-operation.js.map +1 -0
  324. package/internals/directives/resize.d.ts +36 -64
  325. package/internals/directives/resize.js +18 -85
  326. package/internals/directives/resize.js.map +1 -1
  327. package/internals/i18n/EN/calendar.resources.d.ts +8 -2
  328. package/internals/i18n/EN/calendar.resources.js +2 -2
  329. package/internals/i18n/EN/calendar.resources.js.map +1 -1
  330. package/internals/i18n/EN/chat.resources.d.ts +8 -2
  331. package/internals/i18n/EN/chat.resources.js +3 -10
  332. package/internals/i18n/EN/chat.resources.js.map +1 -1
  333. package/internals/i18n/EN/date-picker.resources.d.ts +6 -4
  334. package/internals/i18n/EN/date-picker.resources.js +1 -7
  335. package/internals/i18n/EN/date-picker.resources.js.map +1 -1
  336. package/internals/i18n/EN/date-range-picker.resources.d.ts +9 -2
  337. package/internals/i18n/EN/date-range-picker.resources.js +2 -2
  338. package/internals/i18n/EN/date-range-picker.resources.js.map +1 -1
  339. package/internals/i18n/i18n-controller.d.ts +44 -46
  340. package/internals/i18n/i18n-controller.js +46 -33
  341. package/internals/i18n/i18n-controller.js.map +1 -1
  342. package/internals/i18n/utils.d.ts +9 -4
  343. package/internals/i18n/utils.js +4 -27
  344. package/internals/i18n/utils.js.map +1 -1
  345. package/internals/mixins/alert.d.ts +10 -25
  346. package/internals/mixins/alert.js.map +1 -1
  347. package/internals/mixins/combo-box.d.ts +21 -11
  348. package/internals/mixins/combo-box.js +16 -22
  349. package/internals/mixins/combo-box.js.map +1 -1
  350. package/internals/mixins/event-emitter.js +9 -11
  351. package/internals/mixins/event-emitter.js.map +1 -1
  352. package/internals/mixins/forms/associated-required.d.ts +4 -4
  353. package/internals/mixins/forms/associated-required.js.map +1 -1
  354. package/internals/mixins/forms/associated.d.ts +4 -2
  355. package/internals/mixins/forms/associated.js +8 -19
  356. package/internals/mixins/forms/associated.js.map +1 -1
  357. package/internals/mixins/forms/form-transformers.js.map +1 -1
  358. package/internals/mixins/forms/types.d.ts +24 -80
  359. package/internals/mixins/forms/types.js.map +1 -1
  360. package/internals/mixins/group.d.ts +18 -0
  361. package/internals/mixins/group.js +37 -0
  362. package/internals/mixins/group.js.map +1 -0
  363. package/internals/mixins/i18n.d.ts +10 -16
  364. package/internals/mixins/i18n.js.map +1 -1
  365. package/internals/mixins/mask-behavior.d.ts +8 -22
  366. package/internals/mixins/mask-behavior.js +1 -2
  367. package/internals/mixins/mask-behavior.js.map +1 -1
  368. package/internals/mixins/option.d.ts +1 -2
  369. package/internals/mixins/option.js +2 -1
  370. package/internals/mixins/option.js.map +1 -1
  371. package/internals/part-map.d.ts +4 -2
  372. package/internals/part-map.js +1 -1
  373. package/internals/part-map.js.map +1 -1
  374. package/internals/templates/input-shell.d.ts +8 -17
  375. package/internals/templates/input-shell.js +4 -1
  376. package/internals/templates/input-shell.js.map +1 -1
  377. package/internals/templates/masked-input.d.ts +7 -8
  378. package/internals/templates/masked-input.js.map +1 -1
  379. package/internals/templates/slotted-icon.d.ts +7 -12
  380. package/internals/templates/slotted-icon.js.map +1 -1
  381. package/internals/templates/toggle-shell.d.ts +6 -7
  382. package/internals/templates/toggle-shell.js.map +1 -1
  383. package/internals/timing.d.ts +5 -14
  384. package/internals/timing.js.map +1 -1
  385. package/internals/utils/arrays.d.ts +21 -21
  386. package/internals/utils/arrays.js +14 -0
  387. package/internals/utils/arrays.js.map +1 -1
  388. package/internals/utils/dom.d.ts +51 -39
  389. package/internals/utils/dom.js +1 -2
  390. package/internals/utils/dom.js.map +1 -1
  391. package/internals/utils/events.d.ts +29 -16
  392. package/internals/utils/events.js +9 -1
  393. package/internals/utils/events.js.map +1 -1
  394. package/internals/utils/lit.d.ts +5 -2
  395. package/internals/utils/lit.js.map +1 -1
  396. package/internals/utils/math.d.ts +8 -6
  397. package/internals/utils/math.js.map +1 -1
  398. package/internals/utils/objects.d.ts +3 -20
  399. package/internals/utils/objects.js +1 -39
  400. package/internals/utils/objects.js.map +1 -1
  401. package/internals/utils/strings.d.ts +9 -11
  402. package/internals/utils/strings.js.map +1 -1
  403. package/internals/utils/types.d.ts +16 -3
  404. package/internals/utils/types.js +3 -0
  405. package/internals/utils/types.js.map +1 -1
  406. package/internals/validators.d.ts +9 -8
  407. package/internals/validators.js +12 -6
  408. package/internals/validators.js.map +1 -1
  409. package/package.json +1 -1
  410. package/skills/README.md +3 -0
  411. package/skills/igniteui-wc-figma-to-app/SKILL.md +907 -0
  412. package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +363 -0
  413. package/skills/igniteui-wc-figma-to-app/references/design-token-bridge.md +407 -0
  414. package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +325 -0
  415. package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +409 -0
  416. package/skills/igniteui-wc-figma-to-app/references/validation-patterns.md +376 -0
  417. package/theming/config.d.ts +14 -5
  418. package/theming/config.js +38 -18
  419. package/theming/config.js.map +1 -1
  420. package/theming/context.d.ts +1 -23
  421. package/theming/context.js.map +1 -1
  422. package/theming/theming-controller.d.ts +2 -32
  423. package/theming/theming-controller.js +15 -21
  424. package/theming/theming-controller.js.map +1 -1
  425. package/theming/theming-event.d.ts +0 -7
  426. package/theming/theming-event.js +0 -13
  427. package/theming/theming-event.js.map +1 -1
  428. package/theming/types.d.ts +1 -8
  429. package/theming/types.js.map +1 -1
  430. package/web-types.json +3 -3
  431. package/animations/presets/slide/index.d.ts +0 -3
  432. package/animations/presets/slide/index.js +0 -16
  433. package/animations/presets/slide/index.js.map +0 -1
  434. package/components/resize-container/themes/resize-container.base.css.js.map +0 -1
  435. package/internals/controllers/root-scroll.d.ts +0 -31
  436. package/internals/controllers/root-scroll.js +0 -71
  437. package/internals/controllers/root-scroll.js.map +0 -1
  438. package/theming/utils.d.ts +0 -11
  439. package/theming/utils.js +0 -20
  440. package/theming/utils.js.map +0 -1
  441. /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":"chat.js","sourceRoot":"","sources":["../../../src/components/chat/chat.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,qBAAqB,GAEtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;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DACC;AAOhD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gDAG9B;AAWD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;oDAO9B;AAcD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CAG9B;AAWD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uDAK9B","sourcesContent":["import {\n ChatResourceStringsEN,\n type IChatResourceStrings,\n} from 'igniteui-i18n-core';\nimport { html, LitElement, nothing, type PropertyValues } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { cache } from 'lit/directives/cache.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { chatContext, chatUserInputContext } from '#internals/context.js';\nimport { addContextProvider } from '#internals/controllers/context-provider.js';\nimport { addSlotController, setSlots } from '#internals/controllers/slot.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport type { IgcChatResourceStrings } from '#internals/i18n/EN/chat.resources.js';\nimport { addI18nController } from '#internals/i18n/i18n-controller.js';\nimport type { Constructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { isEmpty } from '#internals/utils/arrays.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcButtonComponent from '../button/button.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcListComponent from '../list/list.js';\nimport IgcToastComponent from '../toast/toast.js';\nimport IgcTooltipComponent from '../tooltip/tooltip.js';\nimport IgcChatInputComponent from './chat-input.js';\nimport IgcChatMessageComponent from './chat-message.js';\nimport { ChatState } from './chat-state.js';\nimport { styles } from './themes/chat.base.css.js';\nimport { styles as shared } from './themes/shared/chat.common.css.js';\nimport { all } from './themes/themes.js';\nimport type {\n ChatRenderContext,\n ChatTemplateRenderer,\n IgcChatDraftMessage,\n IgcChatMessage,\n IgcChatMessageAttachment,\n IgcChatMessageReaction,\n IgcChatOptions,\n} from './types.js';\n\ntype DefaultChatRenderers = {\n suggestionPrefix: ChatTemplateRenderer<ChatRenderContext>;\n};\n\n/**\n * Defines the custom events dispatched by the chat component.\n */\nexport interface IgcChatComponentEventMap {\n /**\n * Dispatched when a new chat message is created (sent).\n */\n igcMessageCreated: CustomEvent<IgcChatMessage>;\n\n /**\n * Dispatched when a message is reacted to.\n */\n igcMessageReact: CustomEvent<IgcChatMessageReaction>;\n\n /**\n * Dispatched when a chat message attachment is clicked.\n */\n igcAttachmentClick: CustomEvent<IgcChatMessageAttachment>;\n\n /* blazorSuppress */\n /**\n * Dispatched when attachment(s) are added either through drag & drop or through\n * the default file input.\n */\n igcAttachmentAdded: CustomEvent<IgcChatMessageAttachment[]>;\n\n /* blazorSuppress */\n /**\n * Dispatched when an attachment is removed by the user.\n */\n igcAttachmentRemoved: CustomEvent<IgcChatMessageAttachment>;\n\n /* blazorSuppress */\n /**\n * Dispatched during an attachment drag operation.\n */\n igcAttachmentDrag: CustomEvent<void>;\n\n /* blazorSuppress */\n /**\n * Dispatched when an attachment is dropped (e.g., in a drag-and-drop operation).\n */\n igcAttachmentDrop: CustomEvent<void>;\n\n /**\n * Dispatched when the typing status changes (e.g., user starts or stops typing).\n */\n igcTypingChange: CustomEvent<boolean>;\n\n /**\n * Dispatched when the chat input field gains focus.\n */\n igcInputFocus: CustomEvent<void>;\n\n /**\n * Dispatched when the chat input field loses focus.\n */\n igcInputBlur: CustomEvent<void>;\n\n /**\n * Dispatched when the content of the chat input changes.\n */\n igcInputChange: CustomEvent<string>;\n}\n\nconst Slots = setSlots(\n 'prefix',\n 'title',\n 'actions',\n 'suggestions-header',\n 'suggestions',\n 'suggestions-actions',\n 'suggestion',\n 'empty-state',\n 'typing-indicator'\n);\n\n/* blazorIndirectRender */\n/* blazorSupportsVisualChildren */\n/**\n * A chat UI component for displaying messages, attachments, and input interaction.\n *\n * @element igc-chat\n *\n * @fires igcMessageCreated - Dispatched when a new chat message is created (sent).\n * @fires igcMessageReact - Dispatched when a message is reacted to.\n * @fires igcAttachmentClick - Dispatched when a chat message attachment is clicked.\n * @fires igcAttachmentAdded - Dispatched when attachment(s) are added either through drag & drop or through the default file input.\n * @fires igcAttachmentRemoved - Dispatched when an attachment is removed by the user.\n * @fires igcAttachmentDrag - Dispatched during an attachment drag operation.\n * @fires igcAttachmentDrop - Dispatched when an attachment is dropped (e.g., in a drag-and-drop operation).\n * @fires igcTypingChange - Dispatched when the typing status changes (e.g., user starts or stops typing).\n * @fires igcInputFocus - Dispatched when the chat input field gains focus.\n * @fires igcInputBlur - Dispatched when the chat input field loses focus.\n * @fires igcInputChange - Dispatched when the content of the chat input changes.\n *\n * @slot prefix - Slot for injecting content (e.g., avatar or icon) before the chat title.\n * @slot title - Slot for overriding the chat title content.\n * @slot actions - Slot for injecting header actions (e.g., buttons, menus).\n * @slot suggestions-header - Slot for rendering a custom header for the suggestions list.\n * @slot suggestions - Slot for rendering a custom list of quick reply suggestions.\n * @slot suggestions-actions - Slot for rendering additional actions.\n * @slot suggestion - Slot for rendering a single suggestion item.\n * @slot empty-state - Slot shown when there are no messages.\n * @slot typing-indicator - Slot for the \"is typing\" indicator.\n *\n * @csspart chat-container - Styles the main chat container.\n * @csspart header - Styles the chat header container.\n * @csspart prefix - Styles the element before the chat title (e.g., avatar).\n * @csspart title - Styles the chat header title.\n *\n * @csspart message-area-container - Styles the container holding the messages and (optional) suggestions.\n * @csspart message-list - Styles the message list container.\n * @csspart message-item - Styles each message wrapper.\n * @csspart typing-indicator - Styles the typing indicator container.\n * @csspart typing-dot - Styles individual typing indicator dots.\n *\n * @csspart suggestions-container - Styles the container holding all suggestions.\n * @csspart suggestions-header - Styles the suggestions header.\n * @csspart suggestion - Styles each suggestion item.\n * @csspart suggestion-prefix - Styles the icon or prefix in a suggestion.\n * @csspart suggestion-title - Styles the text/title of a suggestion.\n *\n * @csspart empty-state - Styles the empty state container when there are no messages.\n *\n * @csspart input-area-container - Styles the wrapper around the chat input area.\n * @csspart input-area - Styles the main text input area.\n * @csspart input-attachments-container - Styles the container for attachments in the input.\n * @csspart input-attachment-container - Styles a single attachment in the input area.\n * @csspart input-attachment-name - Styles the file name of an attachment.\n * @csspart input-attachment-icon - Styles the icon of an attachment.\n * @csspart text-input - Styles the text input field for typing messages.\n * @csspart input-actions-container - Styles the container for input actions.\n * @csspart input-actions-start - Styles the group of actions at the start of the input after the default file upload.\n * @csspart input-actions-end - Styles the group of actions at the end of the input.\n * @csspart file-upload-container - Styles the container for the file upload input.\n * @csspart file-upload - Styles the file upload input itself.\n * @csspart send-button-container - Styles the container around the send button.\n * @csspart send-button - Styles the send button.\n *\n * @csspart message-container - Styles the container of a single message.\n * @csspart message-list (forwarded) - Styles the internal list of messages.\n * @csspart message-header - Styles the header of a message (e.g., sender, timestamp).\n * @csspart message-content - Styles the text content of a message.\n * @csspart message-attachments-container - Styles the container for message attachments.\n * @csspart message-attachment - Styles a single message attachment.\n * @csspart message-actions-container - Styles the container holding message actions.\n * @csspart message-sent - Styles messages marked as sent by the current user.\n * @csspart attachment-header - Styles the header of an attachment block.\n * @csspart attachment-content - Styles the content of an attachment block.\n * @csspart attachment-icon - Styles the icon of an attachment.\n * @csspart file-name - Styles the file name shown in an attachment.\n */\nexport default class IgcChatComponent extends EventEmitterMixin<\n IgcChatComponentEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-chat';\n\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcChatComponent,\n IgcChatInputComponent,\n IgcChatMessageComponent,\n IgcButtonComponent,\n IgcIconComponent,\n IgcListComponent,\n IgcTooltipComponent,\n IgcToastComponent\n );\n }\n\n private readonly _state: ChatState = new ChatState(\n this,\n () => this._context.publish(),\n () => this._userInputContext.publish()\n );\n\n private readonly _defaults = Object.freeze<DefaultChatRenderers>({\n suggestionPrefix: () => this._renderSuggestionPrefix(),\n });\n\n private readonly _slots = addSlotController(this, {\n slots: Slots,\n });\n\n private readonly _context = addContextProvider(this, {\n context: chatContext,\n value: () => this._state,\n });\n\n private readonly _userInputContext = addContextProvider(this, {\n context: chatUserInputContext,\n value: () => this._state,\n });\n\n private readonly _i18nController = addI18nController<\n IgcChatResourceStrings | IChatResourceStrings\n >(this, {\n defaultEN: ChatResourceStringsEN,\n resourceMapName: 'chat',\n });\n\n @query(IgcChatInputComponent.tagName)\n private readonly _input?: IgcChatInputComponent;\n\n @query('[part=\"typing-indicator\"]')\n private readonly _typingIndicator?: HTMLElement;\n\n @query('[part=\"suggestions-container\"]')\n private readonly _suggestionsContainer?: HTMLElement;\n\n @query('[part=\"message-area-container\"]', true)\n private readonly _scrollContainer!: HTMLElement;\n\n /**\n * The list of chat messages currently displayed.\n * Use this property to set or update the message history.\n */\n @property({ attribute: false })\n public set messages(value: IgcChatMessage[]) {\n this._state.messages = value;\n }\n\n public get messages(): IgcChatMessage[] {\n return this._state.messages;\n }\n\n /**\n * The chat message currently being composed but not yet sent.\n * Includes the draft text and any attachments.\n */\n @property({ attribute: false })\n public set draftMessage(value: IgcChatDraftMessage) {\n if (this._state && value) {\n this._state.inputValue = value.text;\n this._state.inputAttachments = value.attachments || [];\n this.requestUpdate();\n }\n }\n\n public get draftMessage(): IgcChatDraftMessage {\n return {\n text: this._state.inputValue,\n attachments: this._state.inputAttachments,\n };\n }\n\n /**\n * Controls the chat behavior and appearance through a configuration object.\n * Use this to toggle UI options, provide suggestions, templates, etc.\n */\n @property({ attribute: false })\n public set options(value: IgcChatOptions) {\n this._state.options = value;\n }\n\n public get options(): IgcChatOptions | undefined {\n return this._state.options;\n }\n\n /* blazorSuppress */\n /**\n * The resource strings of the chat.\n */\n @property({ attribute: false })\n public set resourceStrings(\n value: IgcChatResourceStrings | IChatResourceStrings\n ) {\n this._i18nController.resourceStrings = value;\n }\n\n /* blazorSuppress */\n public get resourceStrings(): IgcChatResourceStrings & IChatResourceStrings {\n return this._i18nController.resourceStrings;\n }\n\n constructor() {\n super();\n addThemingController(this, all);\n }\n\n private _getRenderer<U extends keyof DefaultChatRenderers>(\n name: U\n ): DefaultChatRenderers[U] {\n return this._state.options?.renderers\n ? (this._state.options.renderers[name] ?? this._defaults[name])\n : this._defaults[name];\n }\n\n private _handleSuggestionClick(text: string): void {\n this._state.addMessageWithEvent({ text });\n this._input?.focusInput();\n }\n\n /**\n * Scrolls the view to a specific message by id.\n */\n public scrollToMessage(messageId: string): void {\n if (!isEmpty(this.messages)) {\n const message = this.renderRoot.querySelector(`#message-${messageId}`);\n message?.scrollIntoView({ block: 'end', inline: 'end' });\n }\n }\n\n protected override updated(properties: PropertyValues<this>): void {\n if (\n (properties.has('messages') ||\n this._typingIndicator ||\n this._suggestionsContainer) &&\n !this._state.disableAutoScroll\n ) {\n this._scrollToBottom();\n }\n }\n\n private _scrollToBottom(): void {\n const current = this._scrollContainer.scrollTop;\n\n requestAnimationFrame(() => {\n const scrollHeight = this._scrollContainer.scrollHeight;\n if (current < scrollHeight) {\n this._scrollContainer.scrollBy({\n top: Math.abs(scrollHeight - current),\n });\n }\n });\n }\n\n private _renderHeader() {\n const hasContent =\n this._slots.hasAssignedElements('prefix') ||\n this._slots.hasAssignedElements('title') ||\n this._slots.hasAssignedElements('actions') ||\n this._state.options?.headerText;\n\n return html`\n <div part=\"header\" ?hidden=${!hasContent}>\n <slot\n name=\"prefix\"\n ?hidden=${!this._slots.hasAssignedElements('prefix')}\n ></slot>\n <slot name=\"title\">${this._state.options?.headerText}</slot>\n <slot name=\"actions\"></slot>\n </div>\n `;\n }\n\n private _renderMessages() {\n return html`\n <div part=\"message-list\" tabindex=\"0\">\n ${repeat(\n this._state.messages,\n (message) => message.id,\n (message) => {\n return html`\n <igc-chat-message\n id=${`message-${message.id}`}\n part=\"message-item\"\n .message=${message}\n exportparts=\"\n message-container,\n message-list,\n message-header,\n plain-text: message-content,\n message-attachments: message-attachments-container,\n attachment: message-attachment,\n message-actions: message-actions-container,\n sent: message-sent,\n attachment-header,\n attachment-content,\n attachment-icon,\n file-name,\n \"\n >\n </igc-chat-message>\n `;\n }\n )}\n ${\n this._state.options?.isTyping\n ? html`\n <div part=\"typing-indicator\">\n <slot name=\"typing-indicator\"\n >${this._renderLoadingTemplate()}</slot\n >\n </div>\n `\n : nothing\n }\n </div>\n `;\n }\n\n private _renderLoadingTemplate() {\n return html`\n <div part=\"typing-dot\"></div>\n <div part=\"typing-dot\"></div>\n <div part=\"typing-dot\"></div>\n <div part=\"typing-dot\"></div>\n `;\n }\n\n private _renderSuggestionPrefix() {\n return html`<igc-icon name=\"auto_suggest\"></igc-icon>`;\n }\n\n private _renderSuggestions() {\n const hasContent = this._slots.hasAssignedElements('suggestions-header');\n const suggestions = this._state.options?.suggestions ?? [];\n const ctx = { instance: this };\n\n return html`\n <div part=\"suggestions-container\">\n <igc-list>\n <igc-list-header part=\"suggestions-header\">\n <span ?hidden=${hasContent}>\n ${this.resourceStrings.chat_suggestions_header}\n </span>\n <slot name=\"suggestions-header\"></slot>\n </igc-list-header>\n <slot name=\"suggestions\">\n ${suggestions.map(\n (suggestion) => html`\n <slot name=\"suggestion\">\n <igc-list-item\n part=\"suggestion\"\n @click=${() => this._handleSuggestionClick(suggestion)}\n >\n <span slot=\"start\" part=\"suggestion-prefix\">\n ${this._getRenderer('suggestionPrefix')(ctx)}\n </span>\n <span slot=\"title\" part=\"suggestion-title\"\n >${suggestion}</span\n >\n </igc-list-item>\n </slot>\n `\n )}\n </slot>\n <slot name=\"suggestions-actions\"></slot>\n </igc-list>\n </div>\n `;\n }\n\n private _renderEmptyState() {\n return html`\n <div part=\"empty-state\">\n <slot name=\"empty-state\"></slot>\n </div>\n `;\n }\n\n protected override render() {\n const hasMessages = !isEmpty(this.messages);\n const suggestions = isEmpty(this._state.options?.suggestions ?? [])\n ? nothing\n : this._renderSuggestions();\n\n return html`\n <div part=\"chat-container\">\n ${this._renderHeader()}\n\n <div part=\"message-area-container\">\n ${cache(\n hasMessages || this._state.options?.isTyping\n ? this._renderMessages()\n : this._renderEmptyState()\n )}\n ${\n this._state.suggestionsPosition === 'below-messages'\n ? suggestions\n : nothing\n }\n </div>\n\n <div part=\"input-area-container\">\n <igc-chat-input\n exportparts=\"\n input-container: input-area,\n input-wrapper: input-container,\n attachments: input-attachments-container,\n attachment-wrapper: input-attachment-container,\n attachment-name: input-attachment-name,\n attachment-icon: input-attachment-icon,\n text-input,\n actions-container: input-actions-container,\n input-actions-start,\n input-actions-end,\n file-upload-container,\n file-upload,\n send-button-container,\n send-button\"\n >\n </igc-chat-input>\n ${\n this._state.suggestionsPosition === 'below-input'\n ? suggestions\n : nothing\n }\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-chat': IgcChatComponent;\n }\n}\n"]}
1
+ {"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../src/components/chat/chat.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,qBAAqB,GAEtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE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ing, type PropertyValues } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { cache } from 'lit/directives/cache.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { chatContext, chatUserInputContext } from '#internals/context.js';\nimport { addContextProvider } from '#internals/controllers/context-provider.js';\nimport { addSlotController, setSlots } from '#internals/controllers/slot.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport type { IgcChatResourceStrings } from '#internals/i18n/EN/chat.resources.js';\nimport { addI18nController } from '#internals/i18n/i18n-controller.js';\nimport { chatResourcesMap } from '#internals/i18n/utils.js';\nimport type { Constructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { isEmpty } from '#internals/utils/arrays.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcButtonComponent from '../button/button.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcListComponent from '../list/list.js';\nimport IgcToastComponent from '../toast/toast.js';\nimport IgcTooltipComponent from '../tooltip/tooltip.js';\nimport IgcChatInputComponent from './chat-input.js';\nimport IgcChatMessageComponent from './chat-message.js';\nimport { ChatState } from './chat-state.js';\nimport { styles } from './themes/chat.base.css.js';\nimport { styles as shared } from './themes/shared/chat.common.css.js';\nimport { all } from './themes/themes.js';\nimport type {\n ChatRenderContext,\n ChatTemplateRenderer,\n IgcChatDraftMessage,\n IgcChatMessage,\n IgcChatMessageAttachment,\n IgcChatMessageReaction,\n IgcChatOptions,\n} from './types.js';\n\ntype DefaultChatRenderers = {\n suggestionPrefix: ChatTemplateRenderer<ChatRenderContext>;\n};\n\n/**\n * Defines the custom events dispatched by the chat component.\n */\nexport interface IgcChatComponentEventMap {\n /**\n * Dispatched when a new chat message is created (sent).\n */\n igcMessageCreated: CustomEvent<IgcChatMessage>;\n\n /**\n * Dispatched when a message is reacted to.\n */\n igcMessageReact: CustomEvent<IgcChatMessageReaction>;\n\n /**\n * Dispatched when a chat message attachment is clicked.\n */\n igcAttachmentClick: CustomEvent<IgcChatMessageAttachment>;\n\n /* blazorSuppress */\n /**\n * Dispatched when attachment(s) are added either through drag & drop or through\n * the default file input.\n */\n igcAttachmentAdded: CustomEvent<IgcChatMessageAttachment[]>;\n\n /* blazorSuppress */\n /**\n * Dispatched when an attachment is removed by the user.\n */\n igcAttachmentRemoved: CustomEvent<IgcChatMessageAttachment>;\n\n /* blazorSuppress */\n /**\n * Dispatched during an attachment drag operation.\n */\n igcAttachmentDrag: CustomEvent<void>;\n\n /* blazorSuppress */\n /**\n * Dispatched when an attachment is dropped (e.g., in a drag-and-drop operation).\n */\n igcAttachmentDrop: CustomEvent<void>;\n\n /**\n * Dispatched when the typing status changes (e.g., user starts or stops typing).\n */\n igcTypingChange: CustomEvent<boolean>;\n\n /**\n * Dispatched when the chat input field gains focus.\n */\n igcInputFocus: CustomEvent<void>;\n\n /**\n * Dispatched when the chat input field loses focus.\n */\n igcInputBlur: CustomEvent<void>;\n\n /**\n * Dispatched when the content of the chat input changes.\n */\n igcInputChange: CustomEvent<string>;\n}\n\nconst Slots = setSlots(\n 'prefix',\n 'title',\n 'actions',\n 'suggestions-header',\n 'suggestions',\n 'suggestions-actions',\n 'suggestion',\n 'empty-state',\n 'typing-indicator'\n);\n\n/* blazorIndirectRender */\n/* blazorSupportsVisualChildren */\n/**\n * A chat UI component for displaying messages, attachments, and input interaction.\n *\n * @element igc-chat\n *\n * @fires igcMessageCreated - Dispatched when a new chat message is created (sent).\n * @fires igcMessageReact - Dispatched when a message is reacted to.\n * @fires igcAttachmentClick - Dispatched when a chat message attachment is clicked.\n * @fires igcAttachmentAdded - Dispatched when attachment(s) are added either through drag & drop or through the default file input.\n * @fires igcAttachmentRemoved - Dispatched when an attachment is removed by the user.\n * @fires igcAttachmentDrag - Dispatched during an attachment drag operation.\n * @fires igcAttachmentDrop - Dispatched when an attachment is dropped (e.g., in a drag-and-drop operation).\n * @fires igcTypingChange - Dispatched when the typing status changes (e.g., user starts or stops typing).\n * @fires igcInputFocus - Dispatched when the chat input field gains focus.\n * @fires igcInputBlur - Dispatched when the chat input field loses focus.\n * @fires igcInputChange - Dispatched when the content of the chat input changes.\n *\n * @slot prefix - Slot for injecting content (e.g., avatar or icon) before the chat title.\n * @slot title - Slot for overriding the chat title content.\n * @slot actions - Slot for injecting header actions (e.g., buttons, menus).\n * @slot suggestions-header - Slot for rendering a custom header for the suggestions list.\n * @slot suggestions - Slot for rendering a custom list of quick reply suggestions.\n * @slot suggestions-actions - Slot for rendering additional actions.\n * @slot suggestion - Slot for rendering a single suggestion item.\n * @slot empty-state - Slot shown when there are no messages.\n * @slot typing-indicator - Slot for the \"is typing\" indicator.\n *\n * @csspart chat-container - Styles the main chat container.\n * @csspart header - Styles the chat header container.\n *\n * @csspart message-area-container - Styles the container holding the messages and (optional) suggestions.\n * @csspart message-list - Styles the message list container.\n * @csspart message-item - Styles each message wrapper.\n * @csspart typing-indicator - Styles the typing indicator container.\n * @csspart typing-dot - Styles individual typing indicator dots.\n *\n * @csspart suggestions-container - Styles the container holding all suggestions.\n * @csspart suggestions-header - Styles the suggestions header.\n * @csspart suggestion - Styles each suggestion item.\n * @csspart suggestion-prefix - Styles the icon or prefix in a suggestion.\n * @csspart suggestion-title - Styles the text/title of a suggestion.\n *\n * @csspart empty-state - Styles the empty state container when there are no messages.\n *\n * @csspart input-area-container - Styles the wrapper around the chat input area.\n * @csspart input-area - Styles the main text input area.\n * @csspart input-container - Styles the wrapper around the text input.\n * @csspart input-attachments-container - Styles the container for attachments in the input.\n * @csspart input-attachment-container - Styles a single attachment in the input area.\n * @csspart input-attachment-name - Styles the file name of an attachment.\n * @csspart input-attachment-icon - Styles the icon of an attachment.\n * @csspart text-input - Styles the text input field for typing messages.\n * @csspart input-actions-container - Styles the container for input actions.\n * @csspart input-actions-start - Styles the group of actions at the start of the input after the default file upload.\n * @csspart input-actions-end - Styles the group of actions at the end of the input.\n * @csspart file-upload-container - Styles the container for the file upload input.\n * @csspart file-upload - Styles the file upload input itself.\n * @csspart send-button-container - Styles the container around the send button.\n * @csspart send-button - Styles the send button.\n *\n * @csspart message-container - Styles the container of a single message.\n * @csspart message-header - Styles the header of a message (e.g., sender, timestamp).\n * @csspart message-content - Styles the text content of a message.\n * @csspart message-attachments-container - Styles the container for message attachments.\n * @csspart message-attachment - Styles a single message attachment.\n * @csspart message-actions-container - Styles the container holding message actions.\n * @csspart message-sent - Styles messages marked as sent by the current user.\n * @csspart attachment-header - Styles the header of an attachment block.\n * @csspart attachment-content - Styles the content of an attachment block.\n * @csspart attachment-icon - Styles the icon of an attachment.\n * @csspart file-name - Styles the file name shown in an attachment.\n */\nexport default class IgcChatComponent extends EventEmitterMixin<\n IgcChatComponentEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-chat';\n\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcChatComponent,\n IgcChatInputComponent,\n IgcChatMessageComponent,\n IgcButtonComponent,\n IgcIconComponent,\n IgcListComponent,\n IgcTooltipComponent,\n IgcToastComponent\n );\n }\n\n private readonly _state: ChatState = new ChatState(\n this,\n () => this._context.publish(),\n () => this._userInputContext.publish()\n );\n\n private readonly _defaults = Object.freeze<DefaultChatRenderers>({\n suggestionPrefix: () => this._renderSuggestionPrefix(),\n });\n\n private readonly _slots = addSlotController(this, {\n slots: Slots,\n });\n\n private readonly _context = addContextProvider(this, {\n context: chatContext,\n value: () => this._state,\n });\n\n private readonly _userInputContext = addContextProvider(this, {\n context: chatUserInputContext,\n value: () => this._state,\n });\n\n private readonly _i18nController = addI18nController<\n IgcChatResourceStrings | IChatResourceStrings\n >(this, {\n defaultEN: ChatResourceStringsEN,\n resourceMap: chatResourcesMap,\n });\n\n @query(IgcChatInputComponent.tagName)\n private readonly _input?: IgcChatInputComponent;\n\n @query('[part=\"typing-indicator\"]')\n private readonly _typingIndicator?: HTMLElement;\n\n @query('[part=\"suggestions-container\"]')\n private readonly _suggestionsContainer?: HTMLElement;\n\n @query('[part=\"message-area-container\"]', true)\n private readonly _scrollContainer!: HTMLElement;\n\n /**\n * The list of chat messages currently displayed.\n * Use this property to set or update the message history.\n */\n @property({ attribute: false })\n public set messages(value: IgcChatMessage[]) {\n this._state.messages = value;\n }\n\n public get messages(): IgcChatMessage[] {\n return this._state.messages;\n }\n\n /**\n * The chat message currently being composed but not yet sent.\n * Includes the draft text and any attachments.\n */\n @property({ attribute: false })\n public set draftMessage(value: IgcChatDraftMessage) {\n if (this._state && value) {\n this._state.inputValue = value.text;\n this._state.inputAttachments = value.attachments || [];\n this.requestUpdate();\n }\n }\n\n public get draftMessage(): IgcChatDraftMessage {\n return {\n text: this._state.inputValue,\n attachments: this._state.inputAttachments,\n };\n }\n\n /**\n * Controls the chat behavior and appearance through a configuration object.\n * Use this to toggle UI options, provide suggestions, templates, etc.\n */\n @property({ attribute: false })\n public set options(value: IgcChatOptions) {\n this._state.options = value;\n }\n\n public get options(): IgcChatOptions | undefined {\n return this._state.options;\n }\n\n /* blazorSuppress */\n /**\n * The resource strings of the chat.\n */\n @property({ attribute: false })\n public set resourceStrings(\n value: IgcChatResourceStrings | IChatResourceStrings\n ) {\n this._i18nController.resourceStrings = value;\n }\n\n /* blazorSuppress */\n public get resourceStrings(): IgcChatResourceStrings & IChatResourceStrings {\n return this._i18nController.resourceStrings;\n }\n\n constructor() {\n super();\n addThemingController(this, all);\n }\n\n private _getRenderer<U extends keyof DefaultChatRenderers>(\n name: U\n ): DefaultChatRenderers[U] {\n return this._state.options?.renderers\n ? (this._state.options.renderers[name] ?? this._defaults[name])\n : this._defaults[name];\n }\n\n private _handleSuggestionClick(text: string): void {\n this._state.addMessageWithEvent({ text });\n this._input?.focusInput();\n }\n\n /**\n * Scrolls the view to a specific message by id.\n */\n public scrollToMessage(messageId: string): void {\n if (!isEmpty(this.messages)) {\n const message = this.renderRoot.querySelector(`#message-${messageId}`);\n message?.scrollIntoView({ block: 'end', inline: 'end' });\n }\n }\n\n protected override updated(properties: PropertyValues<this>): void {\n if (\n (properties.has('messages') ||\n this._typingIndicator ||\n this._suggestionsContainer) &&\n !this._state.disableAutoScroll\n ) {\n this._scrollToBottom();\n }\n }\n\n private _scrollToBottom(): void {\n const current = this._scrollContainer.scrollTop;\n\n requestAnimationFrame(() => {\n const scrollHeight = this._scrollContainer.scrollHeight;\n if (current < scrollHeight) {\n this._scrollContainer.scrollBy({\n top: Math.abs(scrollHeight - current),\n });\n }\n });\n }\n\n private _renderHeader() {\n const hasContent =\n this._slots.hasAssignedElements('prefix') ||\n this._slots.hasAssignedElements('title') ||\n this._slots.hasAssignedElements('actions') ||\n this._state.options?.headerText;\n\n return html`\n <div part=\"header\" ?hidden=${!hasContent}>\n <slot\n name=\"prefix\"\n ?hidden=${!this._slots.hasAssignedElements('prefix')}\n ></slot>\n <slot name=\"title\">${this._state.options?.headerText}</slot>\n <slot name=\"actions\"></slot>\n </div>\n `;\n }\n\n private _renderMessages() {\n return html`\n <div part=\"message-list\" tabindex=\"0\">\n ${repeat(\n this._state.messages,\n (message) => message.id,\n (message) => {\n return html`\n <igc-chat-message\n id=${`message-${message.id}`}\n part=\"message-item\"\n .message=${message}\n exportparts=\"\n message-container,\n message-header,\n plain-text: message-content,\n message-attachments: message-attachments-container,\n attachment: message-attachment,\n message-actions: message-actions-container,\n sent: message-sent,\n attachment-header,\n attachment-content,\n attachment-icon,\n file-name,\n \"\n >\n </igc-chat-message>\n `;\n }\n )}\n ${\n this._state.options?.isTyping\n ? html`\n <div part=\"typing-indicator\">\n <slot name=\"typing-indicator\"\n >${this._renderLoadingTemplate()}</slot\n >\n </div>\n `\n : nothing\n }\n </div>\n `;\n }\n\n private _renderLoadingTemplate() {\n return html`\n <div part=\"typing-dot\"></div>\n <div part=\"typing-dot\"></div>\n <div part=\"typing-dot\"></div>\n <div part=\"typing-dot\"></div>\n `;\n }\n\n private _renderSuggestionPrefix() {\n return html`<igc-icon name=\"auto_suggest\"></igc-icon>`;\n }\n\n private _renderSuggestions() {\n const hasContent = this._slots.hasAssignedElements('suggestions-header');\n const suggestions = this._state.options?.suggestions ?? [];\n const ctx = { instance: this };\n\n return html`\n <div part=\"suggestions-container\">\n <igc-list>\n <igc-list-header part=\"suggestions-header\">\n <span ?hidden=${hasContent}>\n ${this.resourceStrings.chat_suggestions_header}\n </span>\n <slot name=\"suggestions-header\"></slot>\n </igc-list-header>\n <slot name=\"suggestions\">\n ${suggestions.map(\n (suggestion) => html`\n <slot name=\"suggestion\">\n <igc-list-item\n part=\"suggestion\"\n @click=${() => this._handleSuggestionClick(suggestion)}\n >\n <span slot=\"start\" part=\"suggestion-prefix\">\n ${this._getRenderer('suggestionPrefix')(ctx)}\n </span>\n <span slot=\"title\" part=\"suggestion-title\"\n >${suggestion}</span\n >\n </igc-list-item>\n </slot>\n `\n )}\n </slot>\n <slot name=\"suggestions-actions\"></slot>\n </igc-list>\n </div>\n `;\n }\n\n private _renderEmptyState() {\n return html`\n <div part=\"empty-state\">\n <slot name=\"empty-state\"></slot>\n </div>\n `;\n }\n\n protected override render() {\n const hasMessages = !isEmpty(this.messages);\n const suggestions = isEmpty(this._state.options?.suggestions ?? [])\n ? nothing\n : this._renderSuggestions();\n\n return html`\n <div part=\"chat-container\">\n ${this._renderHeader()}\n\n <div part=\"message-area-container\">\n ${cache(\n hasMessages || this._state.options?.isTyping\n ? this._renderMessages()\n : this._renderEmptyState()\n )}\n ${\n this._state.suggestionsPosition === 'below-messages'\n ? suggestions\n : nothing\n }\n </div>\n\n <div part=\"input-area-container\">\n <igc-chat-input\n exportparts=\"\n input-container: input-area,\n input-wrapper: input-container,\n attachments: input-attachments-container,\n attachment-wrapper: input-attachment-container,\n attachment-name: input-attachment-name,\n attachment-icon: input-attachment-icon,\n text-input,\n actions-container: input-actions-container,\n input-actions-start,\n input-actions-end,\n file-upload-container,\n file-upload,\n send-button-container,\n send-button\"\n >\n </igc-chat-input>\n ${\n this._state.suggestionsPosition === 'below-input'\n ? suggestions\n : nothing\n }\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-chat': IgcChatComponent;\n }\n}\n"]}
@@ -11,11 +11,12 @@ import type { IgcChatMessage } from './types.js';
11
11
  * @csspart attachments-container - Container wrapping all attachments.
12
12
  * @csspart attachment - Wrapper for a single attachment.
13
13
  * @csspart attachment-header - Wrapper for a single attachment header.
14
- * @csspart attachments-content - Part representing the attachment preview.
14
+ * @csspart attachment-content - Part representing the attachment preview.
15
15
  * @csspart attachment-icon - Icon part representing the attachment type.
16
16
  * @csspart file-name - Part representing the attachment's file name.
17
- * @csspart actions - Container for header action buttons.
18
- * @csspart image-attachment - Part for the image element inside an image attachment.
17
+ * @csspart details - Container for the icon and file name inside the attachment header.
18
+ * @csspart image-attachment-icon - The image element inside an image attachment.
19
+ * @csspart file-attachment-icon - The file type icon inside a file attachment.
19
20
  *
20
21
  * @fires igcAttachmentClick - Fired when an attachment header is toggled (clicked).
21
22
  * @hidden @internal
@@ -33,19 +34,9 @@ export default class IgcMessageAttachmentsComponent extends LitElement {
33
34
  constructor();
34
35
  private _getRenderer;
35
36
  private _handleHeaderClick;
36
- /**
37
- * Default attachment header template used when no custom template is provided.
38
- * Renders the attachment icon and name.
39
- * @param attachment The message attachment to render
40
- * @returns TemplateResult containing the rendered attachment header
41
- */
37
+ /** The default header of `attachment`: its icon and its name. */
42
38
  private renderHeader;
43
- /**
44
- * Default attachment content template used when no custom template is provided.
45
- * Renders the attachment content based on its type.
46
- * @param attachment The message attachment to render
47
- * @returns TemplateResult containing the rendered attachment content
48
- */
39
+ /** The default content of `attachment`, by attachment type. */
49
40
  private _renderContent;
50
41
  private _renderAttachment;
51
42
  protected render(): import("lit-html").TemplateResult<1>;
@@ -1 +1 @@
1
- {"version":3,"file":"message-attachments.js","sourceRoot":"","sources":["../../../src/components/chat/message-attachments.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,M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AAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;KACrC,CAAC;IACJ,CAAC;IAEkB,MAAM;QACvB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,IAAI,EAAE,CAAC;QACpD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrE,MAAM,eAAe,GAAG;YACtB,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,aAAa;SACpB,CAAC;QACF,OAAO,IAAI,CAAA,GAAG,KAAK,CACjB,IAAI,CAAC,OAAO;YACV,CAAC,CAAC,IAAI,CAAA;;gBAEE,MAAM,CACN,WAAW,EACX,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,EAC7B,CAAC,UAAU,EAAE,EAAE,CAAC,WAAW,CAAA;+BACZ,OAAO,CAAC,eAAe,CAAC;sBACjC,KAAK,CACL,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;gBAC9B,UAAU;gBACV,OAAO,EAAE,IAAI,CAAC,OAAQ;gBACtB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;aAC3B,CAAC,CACH;;iBAEJ,CACF;;WAEJ;YACH,CAAC,CAAC,OAAO,CACZ,EAAE,CAAC;IACN,CAAC;;AAxIgB;IADhB,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;8DACf;AAM7B;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+DACC","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { cache } from 'lit/directives/cache.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { until } from 'lit/directives/until.js';\nimport { chatContext } from '#internals/context.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport { partMap } from '#internals/part-map.js';\nimport { trimmedHtml } from '#internals/utils/lit.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcIconButtonComponent from '../button/icon-button.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport type { ChatState } from './chat-state.js';\nimport { all } from './themes/attachments.js';\nimport { styles } from './themes/message-attachments.base.css.js';\nimport { styles as shared } from './themes/shared/message-attachments/message-attachments.common.css.js';\nimport type {\n ChatAttachmentRenderContext,\n ChatTemplateRenderer,\n IgcChatMessage,\n IgcChatMessageAttachment,\n} from './types.js';\nimport {\n ChatFileTypeIcons,\n createAttachmentURL,\n getFileExtension,\n isImageAttachment,\n} from './utils.js';\n\ntype DefaultAttachmentRenderers = {\n attachment: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n attachmentHeader: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n attachmentContent: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n};\n\n/**\n * A component that renders message attachments within a chat.\n *\n * Displays attachments such as images or files, supporting custom templates\n * and default rendering using expansion panels.\n *\n * @element igc-message-attachments\n *\n * @csspart attachments-container - Container wrapping all attachments.\n * @csspart attachment - Wrapper for a single attachment.\n * @csspart attachment-header - Wrapper for a single attachment header.\n * @csspart attachments-content - Part representing the attachment preview.\n * @csspart attachment-icon - Icon part representing the attachment type.\n * @csspart file-name - Part representing the attachment's file name.\n * @csspart actions - Container for header action buttons.\n * @csspart image-attachment - Part for the image element inside an image attachment.\n *\n * @fires igcAttachmentClick - Fired when an attachment header is toggled (clicked).\n * @hidden @internal\n */\nexport default class IgcMessageAttachmentsComponent extends LitElement {\n public static readonly tagName = 'igc-message-attachments';\n public static override styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcMessageAttachmentsComponent,\n IgcIconComponent,\n IgcIconButtonComponent\n );\n }\n\n private readonly _defaults: Readonly<DefaultAttachmentRenderers> =\n Object.freeze<DefaultAttachmentRenderers>({\n attachment: (ctx) => this._renderAttachment(ctx.attachment),\n attachmentHeader: (ctx) => this.renderHeader(ctx.attachment),\n attachmentContent: (ctx) => this._renderContent(ctx.attachment),\n });\n\n @consume({ context: chatContext, subscribe: true })\n private readonly _state!: ChatState;\n\n /**\n * The array of attachments to render.\n */\n @property({ attribute: false })\n public message?: IgcChatMessage;\n\n constructor() {\n super();\n addThemingController(this, all);\n }\n\n private _getRenderer(name: keyof DefaultAttachmentRenderers) {\n return this._state.options?.renderers\n ? (this._state.options.renderers[name] ?? this._defaults[name])\n : this._defaults[name];\n }\n\n private _handleHeaderClick = (attachment: IgcChatMessageAttachment) => {\n this._state.emitEvent('igcAttachmentClick', { detail: attachment });\n };\n /**\n * Default attachment header template used when no custom template is provided.\n * Renders the attachment icon and name.\n * @param attachment The message attachment to render\n * @returns TemplateResult containing the rendered attachment header\n */\n private renderHeader(attachment: IgcChatMessageAttachment) {\n const isCurrentUser = this._state.isCurrentUserMessage(this.message);\n const iconName = isImageAttachment(attachment)\n ? 'attach_image'\n : 'document_thumbnail';\n\n return html`\n ${\n !isCurrentUser\n ? html`<igc-icon name=${iconName} part=\"attachment-icon\"></igc-icon>`\n : nothing\n }\n <span part=\"file-name\">${attachment.name}</span>\n `;\n }\n\n /**\n * Default attachment content template used when no custom template is provided.\n * Renders the attachment content based on its type.\n * @param attachment The message attachment to render\n * @returns TemplateResult containing the rendered attachment content\n */\n private _renderContent(attachment: IgcChatMessageAttachment) {\n const iconName =\n ChatFileTypeIcons.get(getFileExtension(attachment.name)) ??\n ChatFileTypeIcons.get('default')!;\n\n return isImageAttachment(attachment)\n ? html`\n <img\n part=\"image-attachment-icon\"\n src=${createAttachmentURL(attachment)}\n alt=${attachment.name}\n />\n `\n : html`<igc-icon\n part=\"file-attachment-icon\"\n name=${iconName}\n ></igc-icon>`;\n }\n\n private _renderAttachment(attachment: IgcChatMessageAttachment) {\n const isCurrentUser = this._state.isCurrentUserMessage(this.message);\n\n const contentParts = {\n 'attachment-content': true,\n sent: isCurrentUser,\n };\n const headerParts = {\n 'attachment-header': true,\n sent: isCurrentUser,\n };\n\n const ctx: ChatAttachmentRenderContext = {\n attachment,\n message: this.message!,\n instance: this._state.host,\n };\n\n const content = html`<div part=${partMap(contentParts)}>\n ${until(this._getRenderer('attachmentContent')(ctx))}\n </div>`;\n const header = html` <div\n part=${partMap(headerParts)}\n role=\"button\"\n @click=${() => this._handleHeaderClick(attachment)}\n >\n <div part=\"details\">\n ${until(this._getRenderer('attachmentHeader')(ctx))}\n </div>\n </div>`;\n\n return html`\n ${isCurrentUser ? content : nothing} ${header}\n ${!isCurrentUser ? content : nothing}\n `;\n }\n\n protected override render() {\n const attachments = this.message?.attachments ?? [];\n const isCurrentUser = this._state.isCurrentUserMessage(this.message);\n const attachmentParts = {\n attachment: true,\n sent: isCurrentUser,\n };\n return html`${cache(\n this.message\n ? html`\n <div part=\"attachments-container\">\n ${repeat(\n attachments,\n (attachment) => attachment.id,\n (attachment) => trimmedHtml`\n <div part=\"${partMap(attachmentParts)}\">\n ${until(\n this._getRenderer('attachment')({\n attachment,\n message: this.message!,\n instance: this._state.host,\n })\n )}\n </div>\n `\n )}\n </div>\n `\n : nothing\n )}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-message-attachments': IgcMessageAttachmentsComponent;\n }\n}\n"]}
1
+ {"version":3,"file":"message-attachments.js","sourceRoot":"","sources":["../../../src/components/chat/message-attachments.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MA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;QACrE,MAAM,eAAe,GAAG;YACtB,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,aAAa;SACpB,CAAC;QACF,OAAO,IAAI,CAAA,GAAG,KAAK,CACjB,IAAI,CAAC,OAAO;YACV,CAAC,CAAC,IAAI,CAAA;;gBAEE,MAAM,CACN,WAAW,EACX,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,EAC7B,CAAC,UAAU,EAAE,EAAE,CAAC,WAAW,CAAA;+BACZ,OAAO,CAAC,eAAe,CAAC;sBACjC,KAAK,CACL,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;gBAC9B,UAAU;gBACV,OAAO,EAAE,IAAI,CAAC,OAAQ;gBACtB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;aAC3B,CAAC,CACH;;iBAEJ,CACF;;WAEJ;YACH,CAAC,CAAC,OAAO,CACZ,EAAE,CAAC;IACN,CAAC;;AA9HgB;IADhB,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;8DACf;AAM7B;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+DACC","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { cache } from 'lit/directives/cache.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { until } from 'lit/directives/until.js';\nimport { chatContext } from '#internals/context.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport { partMap } from '#internals/part-map.js';\nimport { trimmedHtml } from '#internals/utils/lit.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcIconButtonComponent from '../button/icon-button.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport type { ChatState } from './chat-state.js';\nimport { all } from './themes/attachments.js';\nimport { styles } from './themes/message-attachments.base.css.js';\nimport { styles as shared } from './themes/shared/message-attachments/message-attachments.common.css.js';\nimport type {\n ChatAttachmentRenderContext,\n ChatTemplateRenderer,\n IgcChatMessage,\n IgcChatMessageAttachment,\n} from './types.js';\nimport {\n ChatFileTypeIcons,\n createAttachmentURL,\n getFileExtension,\n isImageAttachment,\n} from './utils.js';\n\ntype DefaultAttachmentRenderers = {\n attachment: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n attachmentHeader: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n attachmentContent: ChatTemplateRenderer<ChatAttachmentRenderContext>;\n};\n\n/**\n * A component that renders message attachments within a chat.\n *\n * Displays attachments such as images or files, supporting custom templates\n * and default rendering using expansion panels.\n *\n * @element igc-message-attachments\n *\n * @csspart attachments-container - Container wrapping all attachments.\n * @csspart attachment - Wrapper for a single attachment.\n * @csspart attachment-header - Wrapper for a single attachment header.\n * @csspart attachment-content - Part representing the attachment preview.\n * @csspart attachment-icon - Icon part representing the attachment type.\n * @csspart file-name - Part representing the attachment's file name.\n * @csspart details - Container for the icon and file name inside the attachment header.\n * @csspart image-attachment-icon - The image element inside an image attachment.\n * @csspart file-attachment-icon - The file type icon inside a file attachment.\n *\n * @fires igcAttachmentClick - Fired when an attachment header is toggled (clicked).\n * @hidden @internal\n */\nexport default class IgcMessageAttachmentsComponent extends LitElement {\n public static readonly tagName = 'igc-message-attachments';\n public static override styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcMessageAttachmentsComponent,\n IgcIconComponent,\n IgcIconButtonComponent\n );\n }\n\n private readonly _defaults: Readonly<DefaultAttachmentRenderers> =\n Object.freeze<DefaultAttachmentRenderers>({\n attachment: (ctx) => this._renderAttachment(ctx.attachment),\n attachmentHeader: (ctx) => this.renderHeader(ctx.attachment),\n attachmentContent: (ctx) => this._renderContent(ctx.attachment),\n });\n\n @consume({ context: chatContext, subscribe: true })\n private readonly _state!: ChatState;\n\n /**\n * The array of attachments to render.\n */\n @property({ attribute: false })\n public message?: IgcChatMessage;\n\n constructor() {\n super();\n addThemingController(this, all);\n }\n\n private _getRenderer(name: keyof DefaultAttachmentRenderers) {\n return this._state.options?.renderers\n ? (this._state.options.renderers[name] ?? this._defaults[name])\n : this._defaults[name];\n }\n\n private _handleHeaderClick = (attachment: IgcChatMessageAttachment) => {\n this._state.emitEvent('igcAttachmentClick', { detail: attachment });\n };\n /** The default header of `attachment`: its icon and its name. */\n private renderHeader(attachment: IgcChatMessageAttachment) {\n const isCurrentUser = this._state.isCurrentUserMessage(this.message);\n const iconName = isImageAttachment(attachment)\n ? 'attach_image'\n : 'document_thumbnail';\n\n return html`\n ${\n !isCurrentUser\n ? html`<igc-icon name=${iconName} part=\"attachment-icon\"></igc-icon>`\n : nothing\n }\n <span part=\"file-name\">${attachment.name}</span>\n `;\n }\n\n /** The default content of `attachment`, by attachment type. */\n private _renderContent(attachment: IgcChatMessageAttachment) {\n const iconName =\n ChatFileTypeIcons.get(getFileExtension(attachment.name)) ??\n ChatFileTypeIcons.get('default')!;\n\n return isImageAttachment(attachment)\n ? html`\n <img\n part=\"image-attachment-icon\"\n src=${createAttachmentURL(attachment)}\n alt=${attachment.name}\n />\n `\n : html`<igc-icon\n part=\"file-attachment-icon\"\n name=${iconName}\n ></igc-icon>`;\n }\n\n private _renderAttachment(attachment: IgcChatMessageAttachment) {\n const isCurrentUser = this._state.isCurrentUserMessage(this.message);\n\n const contentParts = {\n 'attachment-content': true,\n sent: isCurrentUser,\n };\n const headerParts = {\n 'attachment-header': true,\n sent: isCurrentUser,\n };\n\n const ctx: ChatAttachmentRenderContext = {\n attachment,\n message: this.message!,\n instance: this._state.host,\n };\n\n const content = html`<div part=${partMap(contentParts)}>\n ${until(this._getRenderer('attachmentContent')(ctx))}\n </div>`;\n const header = html` <div\n part=${partMap(headerParts)}\n role=\"button\"\n @click=${() => this._handleHeaderClick(attachment)}\n >\n <div part=\"details\">\n ${until(this._getRenderer('attachmentHeader')(ctx))}\n </div>\n </div>`;\n\n return html`\n ${isCurrentUser ? content : nothing} ${header}\n ${!isCurrentUser ? content : nothing}\n `;\n }\n\n protected override render() {\n const attachments = this.message?.attachments ?? [];\n const isCurrentUser = this._state.isCurrentUserMessage(this.message);\n const attachmentParts = {\n attachment: true,\n sent: isCurrentUser,\n };\n return html`${cache(\n this.message\n ? html`\n <div part=\"attachments-container\">\n ${repeat(\n attachments,\n (attachment) => attachment.id,\n (attachment) => trimmedHtml`\n <div part=\"${partMap(attachmentParts)}\">\n ${until(\n this._getRenderer('attachment')({\n attachment,\n message: this.message!,\n instance: this._state.host,\n })\n )}\n </div>\n `\n )}\n </div>\n `\n : nothing\n )}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-message-attachments': IgcMessageAttachmentsComponent;\n }\n}\n"]}
@@ -6,7 +6,6 @@ export type ChatAcceptedFileTypes = {
6
6
  };
7
7
  export declare const ChatFileTypeIcons: Map<string, string>;
8
8
  export declare function parseAcceptedFileTypes(fileTypes: string): ChatAcceptedFileTypes;
9
- export declare function isAcceptedFileType(file: File, accepted: ChatAcceptedFileTypes | null): boolean;
10
9
  export declare function getChatAcceptedFiles(event: DragEvent, accepted: ChatAcceptedFileTypes | null): File[];
11
10
  export declare function getIconName(fileType?: string): "attach_image" | "attach_document";
12
11
  export declare function createAttachmentURL(attachment: IgcChatMessageAttachment): string;
@@ -27,7 +27,7 @@ export function parseAcceptedFileTypes(fileTypes) {
27
27
  wildcardTypes: new Set(types.filter((t) => t.endsWith('/*')).map((t) => t.slice(0, -2))),
28
28
  };
29
29
  }
30
- export function isAcceptedFileType(file, accepted) {
30
+ function isAcceptedFileType(file, accepted) {
31
31
  if (!(accepted && file)) {
32
32
  return true;
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/chat/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AASpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CACtC,MAAM,CAAC,OAAO,CAAC;IACb,G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,mBAAmB,CACjC,UAAoC;IAEpC,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,UAAU,CAAC,GAAG,IAAI,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,UAA2C;IAE3C,IAAI,UAAU,YAAY,IAAI,EAAE,CAAC;QAC/B,OAAO,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,OAAO,CACZ,UAAU,CAAC,IAAI,KAAK,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAC1E,CAAC;AACJ,CAAC","sourcesContent":["import { lastOf } from '#internals/utils/arrays.js';\nimport type { IgcChatMessageAttachment } from './types.js';\n\nexport type ChatAcceptedFileTypes = {\n extensions: Set<string>;\n mimeTypes: Set<string>;\n wildcardTypes: Set<string>;\n};\n\nexport const ChatFileTypeIcons = new Map(\n Object.entries({\n css: 'file_css',\n csv: 'file_csv',\n doc: 'file_doc',\n docx: 'file_doc',\n htm: 'file_htm',\n html: 'file_html',\n js: 'file_js',\n json: 'file_json',\n pdf: 'file_pdf',\n rtf: 'file_rtf',\n svg: 'file_svg',\n txt: 'file_txt',\n url: 'file_link',\n xls: 'file_xls',\n xlsx: 'file_xls',\n xml: 'file_xml',\n zip: 'file_zip',\n default: 'file_generic',\n })\n);\n\nexport function parseAcceptedFileTypes(\n fileTypes: string\n): ChatAcceptedFileTypes {\n const types = fileTypes.split(',').map((each) => each.trim().toLowerCase());\n return {\n extensions: new Set(types.filter((t) => t.startsWith('.'))),\n mimeTypes: new Set(\n types.filter((t) => !t.startsWith('.') && !t.endsWith('/*'))\n ),\n wildcardTypes: new Set(\n types.filter((t) => t.endsWith('/*')).map((t) => t.slice(0, -2))\n ),\n };\n}\n\nexport function isAcceptedFileType(\n file: File,\n accepted: ChatAcceptedFileTypes | null\n): boolean {\n if (!(accepted && file)) {\n return true;\n }\n\n const { extensions, mimeTypes, wildcardTypes } = accepted;\n const fileType = file.type.toLowerCase();\n const fileExtension = `.${lastOf(file.name.split('.'))?.toLowerCase()}`;\n const [fileBaseType] = fileType.split('/');\n\n return (\n extensions.has(fileExtension) ||\n mimeTypes.has(fileType) ||\n wildcardTypes.has(fileBaseType)\n );\n}\n\nexport function getChatAcceptedFiles(\n event: DragEvent,\n accepted: ChatAcceptedFileTypes | null\n): File[] {\n return Array.from(event.dataTransfer?.items ?? [])\n .filter(\n (item) =>\n item.kind === 'file' && isAcceptedFileType(item.getAsFile()!, accepted)\n )\n .map((item) => item.getAsFile()!);\n}\n\nexport function getIconName(fileType?: string) {\n return fileType?.startsWith('image') ? 'attach_image' : 'attach_document';\n}\n\nexport function createAttachmentURL(\n attachment: IgcChatMessageAttachment\n): string {\n if (attachment.file) {\n return URL.createObjectURL(attachment.file);\n }\n\n return attachment.url || '';\n}\n\nexport function getFileExtension(name: string): string {\n const parts = name.split('.');\n return parts.length > 1 ? lastOf(parts) : '';\n}\n\nexport function isImageAttachment(\n attachment: IgcChatMessageAttachment | File\n): boolean {\n if (attachment instanceof File) {\n return attachment.type.startsWith('image/');\n }\n\n return Boolean(\n attachment.type === 'image' || attachment.file?.type.startsWith('image/')\n );\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/chat/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AASpD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C,CAAC,cAAc,CAAC,CAAC,CAAC,iBAAiB,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,UAAoC;IAEpC,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,UAAU,CAAC,GAAG,IAAI,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,UAA2C;IAE3C,IAAI,UAAU,YAAY,IAAI,EAAE,CAAC;QAC/B,OAAO,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,OAAO,CACZ,UAAU,CAAC,IAAI,KAAK,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAC1E,CAAC;AACJ,CAAC","sourcesContent":["import { lastOf } from '#internals/utils/arrays.js';\nimport type { IgcChatMessageAttachment } from './types.js';\n\nexport type ChatAcceptedFileTypes = {\n extensions: Set<string>;\n mimeTypes: Set<string>;\n wildcardTypes: Set<string>;\n};\n\nexport const ChatFileTypeIcons = new Map(\n Object.entries({\n css: 'file_css',\n csv: 'file_csv',\n doc: 'file_doc',\n docx: 'file_doc',\n htm: 'file_htm',\n html: 'file_html',\n js: 'file_js',\n json: 'file_json',\n pdf: 'file_pdf',\n rtf: 'file_rtf',\n svg: 'file_svg',\n txt: 'file_txt',\n url: 'file_link',\n xls: 'file_xls',\n xlsx: 'file_xls',\n xml: 'file_xml',\n zip: 'file_zip',\n default: 'file_generic',\n })\n);\n\nexport function parseAcceptedFileTypes(\n fileTypes: string\n): ChatAcceptedFileTypes {\n const types = fileTypes.split(',').map((each) => each.trim().toLowerCase());\n return {\n extensions: new Set(types.filter((t) => t.startsWith('.'))),\n mimeTypes: new Set(\n types.filter((t) => !t.startsWith('.') && !t.endsWith('/*'))\n ),\n wildcardTypes: new Set(\n types.filter((t) => t.endsWith('/*')).map((t) => t.slice(0, -2))\n ),\n };\n}\n\nfunction isAcceptedFileType(\n file: File,\n accepted: ChatAcceptedFileTypes | null\n): boolean {\n if (!(accepted && file)) {\n return true;\n }\n\n const { extensions, mimeTypes, wildcardTypes } = accepted;\n const fileType = file.type.toLowerCase();\n const fileExtension = `.${lastOf(file.name.split('.'))?.toLowerCase()}`;\n const [fileBaseType] = fileType.split('/');\n\n return (\n extensions.has(fileExtension) ||\n mimeTypes.has(fileType) ||\n wildcardTypes.has(fileBaseType)\n );\n}\n\nexport function getChatAcceptedFiles(\n event: DragEvent,\n accepted: ChatAcceptedFileTypes | null\n): File[] {\n return Array.from(event.dataTransfer?.items ?? [])\n .filter(\n (item) =>\n item.kind === 'file' && isAcceptedFileType(item.getAsFile()!, accepted)\n )\n .map((item) => item.getAsFile()!);\n}\n\nexport function getIconName(fileType?: string) {\n return fileType?.startsWith('image') ? 'attach_image' : 'attach_document';\n}\n\nexport function createAttachmentURL(\n attachment: IgcChatMessageAttachment\n): string {\n if (attachment.file) {\n return URL.createObjectURL(attachment.file);\n }\n\n return attachment.url || '';\n}\n\nexport function getFileExtension(name: string): string {\n const parts = name.split('.');\n return parts.length > 1 ? lastOf(parts) : '';\n}\n\nexport function isImageAttachment(\n attachment: IgcChatMessageAttachment | File\n): boolean {\n if (attachment instanceof File) {\n return attachment.type.startsWith('image/');\n }\n\n return Boolean(\n attachment.type === 'image' || attachment.file?.type.startsWith('image/')\n );\n}\n"]}
@@ -13,7 +13,7 @@ export interface IgcCheckboxComponentEventMap {
13
13
  declare const IgcCheckboxBaseComponent_base: Constructor<import("../../internals/mixins/forms/types.js").FormRequiredInterface & import("../../internals/mixins/forms/types.js").FormAssociatedCheckboxElementInterface> & Constructor<import("#internals/mixins/event-emitter.js").EventEmitterInterface<IgcCheckboxComponentEventMap>> & Constructor<LitElement>;
14
14
  export declare class IgcCheckboxBaseComponent extends IgcCheckboxBaseComponent_base {
15
15
  protected get __validators(): import("../../internals/validators.js").Validator<IgcCheckboxBaseComponent>[];
16
- protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "helper-text" | "[default]" | "value-missing" | "custom-error">;
16
+ protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "[default]" | "helper-text" | "value-missing" | "custom-error">;
17
17
  protected readonly _focusRingManager: import("#internals/controllers/focus-ring.js").KeyboardFocusRingController;
18
18
  protected readonly _formValue: import("#internals/mixins/forms/form-value.js").FormValue<boolean>;
19
19
  protected _value: string;
@@ -88,7 +88,7 @@ export default class IgcCheckboxComponent extends IgcCheckboxBaseComponent {
88
88
  onKeyDown: this._handleEnterKeydown,
89
89
  onBlur: this._handleBlur,
90
90
  })}
91
- ${this._renderValidationContainer()}
91
+ ${IgcValidationContainerComponent.create(this)}
92
92
  `;
93
93
  }
94
94
  }
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAg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,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2DACd","sourcesContent":["import { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport { partMap } from '#internals/part-map.js';\nimport { renderToggleShell } from '#internals/templates/toggle-shell.js';\nimport { createIdGenerator } from '#internals/utils/strings.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { IgcCheckboxBaseComponent } from './checkbox-base.js';\nimport { all } from './themes/checkbox-themes.js';\nimport { styles } from './themes/checkbox.base.css.js';\nimport { styles as shared } from './themes/shared/checkbox/checkbox.common.css.js';\n\nconst nextId = createIdGenerator('checkbox');\n\n/**\n * A check box allowing single values to be selected/deselected.\n *\n * @element igc-checkbox\n *\n * @slot - The checkbox label.\n * @slot helper-text - Renders content below the input.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\n * @fires igcChange - Emitted when the control's checked state changes.\n *\n * @csspart base - The base wrapper of the checkbox.\n * @csspart control - The checkbox input element.\n * @csspart label - The checkbox label.\n * @csspart indicator - The checkbox indicator icon.\n */\nexport default class IgcCheckboxComponent extends IgcCheckboxBaseComponent {\n public static readonly tagName = 'igc-checkbox';\n protected static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcCheckboxComponent, IgcValidationContainerComponent);\n }\n\n private readonly _themes = addThemingController(this, all);\n\n private readonly _inputId = nextId();\n private readonly _labelId = `checkbox-label-${this._inputId}`;\n\n /**\n * Draws the checkbox in indeterminate state.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public indeterminate = false;\n\n protected override _handleClick(event: PointerEvent): void {\n this.indeterminate = false;\n super._handleClick(event);\n }\n\n protected _renderStandard() {\n return html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M4.1,12.7 9,17.6 20.3,6.3\" />\n </svg>\n `;\n }\n\n protected _renderIndigo() {\n return html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <rect width=\"18\" height=\"4\" x=\"3\" y=\"10\" rx=\"1.85\" />\n <path\n d=\"M19.033 5a1.966 1.966 0 0 0-1.418.586l-8.479 8.577-2.753-2.77a1.971 1.971 0 0 0-2.8 0 1.998 1.998 0 0 0 0 2.822l4.155 4.196a1.955 1.955 0 0 0 2.8 0l9.879-9.99a1.998 1.998 0 0 0 0-2.821 1.966 1.966 0 0 0-1.384-.6Z\"\n />\n </svg>\n `;\n }\n\n protected override render() {\n const labelledBy = this.getAttribute('aria-labelledby');\n const checked = this.checked;\n\n return html`\n ${renderToggleShell({\n type: 'checkbox',\n inputId: this._inputId,\n labelId: this._labelId,\n baseParts: {\n base: true,\n checked,\n focused: this._focusRingManager.focused,\n },\n controlParts: { control: true, checked },\n labelParts: { label: true, checked },\n renderControl: () => html`\n <span part=${partMap({ indicator: true, checked })}>\n ${\n this._themes.theme === 'indigo'\n ? this._renderIndigo()\n : this._renderStandard()\n }\n </span>\n `,\n checked,\n hideLabel: this._hideLabel,\n name: this.name,\n value: this.value,\n required: this.required,\n disabled: this.disabled,\n indeterminate: this.indeterminate,\n ariaLabelledBy: labelledBy ? labelledBy : this._labelId,\n ariaDescribedBy: this._slots.hasAssignedElements('helper-text')\n ? 'helper-text'\n : undefined,\n onClick: this._handleClick,\n onKeyDown: this._handleEnterKeydown,\n onBlur: this._handleBlur,\n })}\n ${this._renderValidationContainer()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-checkbox': IgcCheckboxComponent;\n }\n}\n"]}
1
+ {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,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AM,CAAC,mBAAmB,CAAC,aAAa,CAAC;gBAC7D,CAAC,CAAC,aAAa;gBACf,CAAC,CAAC,SAAS;YACb,OAAO,EAAE,IAAI,CAAC,YAAY;YAC1B,SAAS,EAAE,IAAI,CAAC,mBAAmB;YACnC,MAAM,EAAE,IAAI,CAAC,WAAW;SACzB,CAAC;QACA,+BAA+B,CAAC,MAAM,CAAC,IAAI,CAAC;KAC/C,CAAC;IACJ,CAAC;;AApEM;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2DACd","sourcesContent":["import { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport { partMap } from '#internals/part-map.js';\nimport { renderToggleShell } from '#internals/templates/toggle-shell.js';\nimport { createIdGenerator } from '#internals/utils/strings.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { IgcCheckboxBaseComponent } from './checkbox-base.js';\nimport { all } from './themes/checkbox-themes.js';\nimport { styles } from './themes/checkbox.base.css.js';\nimport { styles as shared } from './themes/shared/checkbox/checkbox.common.css.js';\n\nconst nextId = createIdGenerator('checkbox');\n\n/**\n * A check box allowing single values to be selected/deselected.\n *\n * @element igc-checkbox\n *\n * @slot - The checkbox label.\n * @slot helper-text - Renders content below the input.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\n * @fires igcChange - Emitted when the control's checked state changes.\n *\n * @csspart base - The base wrapper of the checkbox.\n * @csspart control - The checkbox input element.\n * @csspart label - The checkbox label.\n * @csspart indicator - The checkbox indicator icon.\n */\nexport default class IgcCheckboxComponent extends IgcCheckboxBaseComponent {\n public static readonly tagName = 'igc-checkbox';\n protected static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcCheckboxComponent, IgcValidationContainerComponent);\n }\n\n private readonly _themes = addThemingController(this, all);\n\n private readonly _inputId = nextId();\n private readonly _labelId = `checkbox-label-${this._inputId}`;\n\n /**\n * Draws the checkbox in indeterminate state.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public indeterminate = false;\n\n protected override _handleClick(event: PointerEvent): void {\n this.indeterminate = false;\n super._handleClick(event);\n }\n\n protected _renderStandard() {\n return html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M4.1,12.7 9,17.6 20.3,6.3\" />\n </svg>\n `;\n }\n\n protected _renderIndigo() {\n return html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <rect width=\"18\" height=\"4\" x=\"3\" y=\"10\" rx=\"1.85\" />\n <path\n d=\"M19.033 5a1.966 1.966 0 0 0-1.418.586l-8.479 8.577-2.753-2.77a1.971 1.971 0 0 0-2.8 0 1.998 1.998 0 0 0 0 2.822l4.155 4.196a1.955 1.955 0 0 0 2.8 0l9.879-9.99a1.998 1.998 0 0 0 0-2.821 1.966 1.966 0 0 0-1.384-.6Z\"\n />\n </svg>\n `;\n }\n\n protected override render() {\n const labelledBy = this.getAttribute('aria-labelledby');\n const checked = this.checked;\n\n return html`\n ${renderToggleShell({\n type: 'checkbox',\n inputId: this._inputId,\n labelId: this._labelId,\n baseParts: {\n base: true,\n checked,\n focused: this._focusRingManager.focused,\n },\n controlParts: { control: true, checked },\n labelParts: { label: true, checked },\n renderControl: () => html`\n <span part=${partMap({ indicator: true, checked })}>\n ${\n this._themes.theme === 'indigo'\n ? this._renderIndigo()\n : this._renderStandard()\n }\n </span>\n `,\n checked,\n hideLabel: this._hideLabel,\n name: this.name,\n value: this.value,\n required: this.required,\n disabled: this.disabled,\n indeterminate: this.indeterminate,\n ariaLabelledBy: labelledBy ? labelledBy : this._labelId,\n ariaDescribedBy: this._slots.hasAssignedElements('helper-text')\n ? 'helper-text'\n : undefined,\n onClick: this._handleClick,\n onKeyDown: this._handleEnterKeydown,\n onBlur: this._handleBlur,\n })}\n ${IgcValidationContainerComponent.create(this)}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-checkbox': IgcCheckboxComponent;\n }\n}\n"]}
@@ -21,7 +21,7 @@ declare const IgcChipComponent_base: import("#internals/mixins/constructor.js").
21
21
  * @slot remove - Content to override the default remove chip icon.
22
22
  *
23
23
  * @fires igcRemove - Emits an event when the chip component is removed.
24
- * @fires igcSelect - Emits event when the chip component is selected/deselected and any related animations and transitions also end.
24
+ * @fires igcSelect - Emits an event when the chip component is selected or deselected.
25
25
  *
26
26
  * @csspart base - The base wrapper of the chip.
27
27
  * @csspart action - The selection control of the chip, wrapping the chip content.
@@ -83,7 +83,7 @@ export default class IgcChipComponent extends IgcChipComponent_base {
83
83
  protected _handleRemove(event: Event): void;
84
84
  protected _renderPrefix(): import("lit-html").TemplateResult<1>;
85
85
  protected _renderSuffix(): import("lit-html").TemplateResult<1>;
86
- protected _renderRemove(): typeof nothing | import("lit-html").TemplateResult<1>;
86
+ protected _renderRemove(): import("lit-html").TemplateResult<1> | typeof nothing;
87
87
  protected render(): import("lit-html").TemplateResult<1>;
88
88
  }
89
89
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"chip.js","sourceRoot":"","sources":["../../../src/components/chip/chip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,qBAAqB,GAEtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EACL,iBAAiB,EAEjB,QAAQ,GACT,MAAM,gCAAgC,CAAC;AACxC,OAAO,E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AE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACE","sourcesContent":["import {\n ChipResourceStringsEN,\n type IChipResourceStrings,\n} from 'igniteui-i18n-core';\nimport { html, LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport { addKeybindings } from '#internals/controllers/key-bindings.js';\nimport {\n addSlotController,\n type InferSlotNames,\n setSlots,\n} from '#internals/controllers/slot.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport type { I18nControllerConfig } from '#internals/i18n/i18n-controller.js';\nimport type { Constructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { I18nMixin } from '#internals/mixins/i18n.js';\nimport { renderSlottedIcon } from '#internals/templates/slotted-icon.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport type { StyleVariant } from '../types.js';\nimport { styles } from './themes/chip.base.css.js';\nimport { styles as shared } from './themes/shared/chip.common.css.js';\nimport { all } from './themes/themes.js';\n\nexport interface IgcChipComponentEventMap {\n igcRemove: CustomEvent<void>;\n igcSelect: CustomEvent<boolean>;\n}\n\nconst Slots = setSlots('start', 'prefix', 'suffix', 'end');\n\nconst i18n: I18nControllerConfig<IChipResourceStrings> = {\n defaultEN: ChipResourceStringsEN,\n};\n\n/**\n * Chips help people enter information, make selections, filter content, or trigger actions.\n *\n * @element igc-chip\n *\n * @slot - Renders content in the default slot of the chip.\n * @slot prefix - Renders content at the start of the chip, before the default content.\n * @slot start - Renders content at the start of the chip, before the prefix content.\n * @slot suffix - Renders content at the end of the chip after the default content.\n * @slot end - Renders content at the end of the chip, before the suffix content.\n * @slot select - Content to render when the chip in selected state.\n * @slot remove - Content to override the default remove chip icon.\n *\n * @fires igcRemove - Emits an event when the chip component is removed.\n * @fires igcSelect - Emits event when the chip component is selected/deselected and any related animations and transitions also end.\n *\n * @csspart base - The base wrapper of the chip.\n * @csspart action - The selection control of the chip, wrapping the chip content.\n * @csspart content - The wrapper element around the default slot of the chip.\n * @csspart prefix - The prefix container of the chip.\n * @csspart suffix - The suffix container of the chip.\n * @csspart remove - The container of the remove control of the chip.\n */\nexport default class IgcChipComponent extends I18nMixin(\n EventEmitterMixin<IgcChipComponentEventMap, Constructor<LitElement>>(\n LitElement\n ),\n i18n\n) {\n public static readonly tagName = 'igc-chip';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcChipComponent, IgcIconComponent);\n }\n\n private readonly _removePartRef = createRef<HTMLSlotElement>();\n private readonly _slots = addSlotController(this, { slots: Slots });\n\n /**\n * Whether the chip is disabled or not.\n *\n * @attr disabled\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n /**\n * Whether the chip is removable or not.\n *\n * @attr removable\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public removable = false;\n\n /**\n * Whether the chip is outlined or not.\n *\n * @attr outlined\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public outlined = false;\n\n /**\n * Whether the chip is selectable or not.\n *\n * @attr selectable\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public selectable = false;\n\n /* @tsTwoWayProperty(true, \"igcSelect\", \"detail\", false) */\n /**\n * Whether the chip is selected or not.\n *\n * @attr selected\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n /**\n * A property that sets the color variant of the chip component.\n *\n * @attr variant\n */\n @property({ reflect: true })\n public variant?: StyleVariant;\n\n constructor() {\n super();\n\n addThemingController(this, all);\n\n addKeybindings(this, {\n ref: this._removePartRef,\n skip: () => !this._removePartRef.value,\n bindingDefaults: { triggers: ['keyup'] },\n }).setActivateHandler(this._handleRemove);\n }\n\n private _hasSlotted(...slots: InferSlotNames<typeof Slots>[]): boolean {\n return slots.some((slot) => this._slots.hasAssignedElements(slot));\n }\n\n protected _handleSelect(): void {\n if (this.selectable) {\n this.selected = !this.selected;\n this.emitEvent('igcSelect', { detail: this.selected });\n }\n }\n\n protected _handleRemove(event: Event): void {\n event.stopPropagation();\n this.emitEvent('igcRemove');\n }\n\n protected _renderPrefix() {\n const showSelected = this.selectable && this.selected;\n\n return html`\n <span\n part=\"prefix\"\n ?hidden=${!showSelected && !this._hasSlotted('start', 'prefix')}\n >\n ${\n showSelected\n ? renderSlottedIcon({ slot: 'select', icon: 'selected' })\n : nothing\n }\n <slot name=\"start\"></slot>\n <slot name=\"prefix\"></slot>\n </span>\n `;\n }\n\n protected _renderSuffix() {\n return html`\n <span part=\"suffix\" ?hidden=${!this._hasSlotted('end', 'suffix')}>\n <slot name=\"end\"></slot>\n <slot name=\"suffix\"></slot>\n </span>\n `;\n }\n\n protected _renderRemove() {\n if (!this.removable || this.disabled) {\n return nothing;\n }\n\n return html`\n <span part=\"remove\">\n <slot\n ${ref(this._removePartRef)}\n name=\"remove\"\n @click=${this._handleRemove}\n >\n <igc-icon\n name=\"remove\"\n collection=\"default\"\n tabindex=\"0\"\n role=\"button\"\n aria-label=${this.resourceStrings.chip_remove}\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n protected override render() {\n const ariaPressed = this.selectable ? this.selected.toString() : null;\n\n return html`\n <div part=\"base\">\n <button\n part=\"action\"\n type=\"button\"\n .ariaPressed=${ariaPressed}\n ?disabled=${this.disabled}\n @click=${this._handleSelect}\n >\n ${this._renderPrefix()}\n <span part=\"content\">\n <slot></slot>\n </span>\n ${this._renderSuffix()}\n </button>\n ${this._renderRemove()}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-chip': IgcChipComponent;\n }\n}\n"]}
1
+ {"version":3,"file":"chip.js","sourceRoot":"","sources":["../../../src/components/chip/chip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,qBAAqB,GAEtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAA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AC;kDACnB;AASjB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDACjB;AAUnB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACnB;AAQjB;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACE","sourcesContent":["import {\n ChipResourceStringsEN,\n type IChipResourceStrings,\n} from 'igniteui-i18n-core';\nimport { html, LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport { addKeybindings } from '#internals/controllers/key-bindings.js';\nimport {\n addSlotController,\n type InferSlotNames,\n setSlots,\n} from '#internals/controllers/slot.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport type { I18nControllerConfig } from '#internals/i18n/i18n-controller.js';\nimport type { Constructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { I18nMixin } from '#internals/mixins/i18n.js';\nimport { renderSlottedIcon } from '#internals/templates/slotted-icon.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport type { StyleVariant } from '../types.js';\nimport { styles } from './themes/chip.base.css.js';\nimport { styles as shared } from './themes/shared/chip.common.css.js';\nimport { all } from './themes/themes.js';\n\nexport interface IgcChipComponentEventMap {\n igcRemove: CustomEvent<void>;\n igcSelect: CustomEvent<boolean>;\n}\n\nconst Slots = setSlots('start', 'prefix', 'suffix', 'end');\n\nconst i18n: I18nControllerConfig<IChipResourceStrings> = {\n defaultEN: ChipResourceStringsEN,\n};\n\n/**\n * Chips help people enter information, make selections, filter content, or trigger actions.\n *\n * @element igc-chip\n *\n * @slot - Renders content in the default slot of the chip.\n * @slot prefix - Renders content at the start of the chip, before the default content.\n * @slot start - Renders content at the start of the chip, before the prefix content.\n * @slot suffix - Renders content at the end of the chip after the default content.\n * @slot end - Renders content at the end of the chip, before the suffix content.\n * @slot select - Content to render when the chip in selected state.\n * @slot remove - Content to override the default remove chip icon.\n *\n * @fires igcRemove - Emits an event when the chip component is removed.\n * @fires igcSelect - Emits an event when the chip component is selected or deselected.\n *\n * @csspart base - The base wrapper of the chip.\n * @csspart action - The selection control of the chip, wrapping the chip content.\n * @csspart content - The wrapper element around the default slot of the chip.\n * @csspart prefix - The prefix container of the chip.\n * @csspart suffix - The suffix container of the chip.\n * @csspart remove - The container of the remove control of the chip.\n */\nexport default class IgcChipComponent extends I18nMixin(\n EventEmitterMixin<IgcChipComponentEventMap, Constructor<LitElement>>(\n LitElement\n ),\n i18n\n) {\n public static readonly tagName = 'igc-chip';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcChipComponent, IgcIconComponent);\n }\n\n private readonly _removePartRef = createRef<HTMLSlotElement>();\n private readonly _slots = addSlotController(this, { slots: Slots });\n\n /**\n * Whether the chip is disabled or not.\n *\n * @attr disabled\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n /**\n * Whether the chip is removable or not.\n *\n * @attr removable\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public removable = false;\n\n /**\n * Whether the chip is outlined or not.\n *\n * @attr outlined\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public outlined = false;\n\n /**\n * Whether the chip is selectable or not.\n *\n * @attr selectable\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public selectable = false;\n\n /* @tsTwoWayProperty(true, \"igcSelect\", \"detail\", false) */\n /**\n * Whether the chip is selected or not.\n *\n * @attr selected\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n /**\n * A property that sets the color variant of the chip component.\n *\n * @attr variant\n */\n @property({ reflect: true })\n public variant?: StyleVariant;\n\n constructor() {\n super();\n\n addThemingController(this, all);\n\n addKeybindings(this, {\n ref: this._removePartRef,\n skip: () => !this._removePartRef.value,\n bindingDefaults: { triggers: ['keyup'] },\n }).setActivateHandler(this._handleRemove);\n }\n\n private _hasSlotted(...slots: InferSlotNames<typeof Slots>[]): boolean {\n return slots.some((slot) => this._slots.hasAssignedElements(slot));\n }\n\n protected _handleSelect(): void {\n if (this.selectable) {\n this.selected = !this.selected;\n this.emitEvent('igcSelect', { detail: this.selected });\n }\n }\n\n protected _handleRemove(event: Event): void {\n event.stopPropagation();\n this.emitEvent('igcRemove');\n }\n\n protected _renderPrefix() {\n const showSelected = this.selectable && this.selected;\n\n return html`\n <span\n part=\"prefix\"\n ?hidden=${!showSelected && !this._hasSlotted('start', 'prefix')}\n >\n ${\n showSelected\n ? renderSlottedIcon({ slot: 'select', icon: 'selected' })\n : nothing\n }\n <slot name=\"start\"></slot>\n <slot name=\"prefix\"></slot>\n </span>\n `;\n }\n\n protected _renderSuffix() {\n return html`\n <span part=\"suffix\" ?hidden=${!this._hasSlotted('end', 'suffix')}>\n <slot name=\"end\"></slot>\n <slot name=\"suffix\"></slot>\n </span>\n `;\n }\n\n protected _renderRemove() {\n if (!this.removable || this.disabled) {\n return nothing;\n }\n\n return html`\n <span part=\"remove\">\n <slot\n ${ref(this._removePartRef)}\n name=\"remove\"\n @click=${this._handleRemove}\n >\n <igc-icon\n name=\"remove\"\n collection=\"default\"\n tabindex=\"0\"\n role=\"button\"\n aria-label=${this.resourceStrings.chip_remove}\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n protected override render() {\n const ariaPressed = this.selectable ? this.selected.toString() : null;\n\n return html`\n <div part=\"base\">\n <button\n part=\"action\"\n type=\"button\"\n .ariaPressed=${ariaPressed}\n ?disabled=${this.disabled}\n @click=${this._handleSelect}\n >\n ${this._renderPrefix()}\n <span part=\"content\">\n <slot></slot>\n </span>\n ${this._renderSuffix()}\n </button>\n ${this._renderRemove()}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-chip': IgcChipComponent;\n }\n}\n"]}
@@ -57,7 +57,7 @@ export default class IgcColorPickerComponent extends IgcColorPickerComponent_bas
57
57
  static styles: import("lit").CSSResult[];
58
58
  static register(): void;
59
59
  protected get __validators(): import("../../internals/validators.js").Validator<IgcColorPickerComponent>[];
60
- protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "helper-text" | "[default]" | "value-missing" | "custom-error">;
60
+ protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "[default]" | "helper-text" | "value-missing" | "custom-error">;
61
61
  protected readonly _rootClickController: import("#internals/controllers/root-click.js").RootClickController;
62
62
  protected readonly _formValue: import("#internals/mixins/forms/form-value.js").FormValue<string>;
63
63
  private readonly _alphaRef;
@@ -143,37 +143,37 @@ export default class IgcColorPickerComponent extends IgcColorPickerComponent_bas
143
143
  private _handleHueValueChange;
144
144
  private _handleAlphaSliderValueChange;
145
145
  /**
146
- * Rewrites the alpha field as `<digits>%` after each edit.
146
+ * Writes the alpha field again as `<digits>%` after each edit.
147
147
  *
148
- * The `%` is part of the value and not a suffix element, so the browser
149
- * treats it as editable text. This handler normalizes the result of an edit
150
- * instead of a filter on the keystrokes in `beforeinput`. The `%` then
151
- * behaves as a literal for each way that text reaches the field: typing,
152
- * paste, drop, composition, undo and autofill. Of these, `beforeinput`
153
- * carries `data` only for typing.
148
+ * @remarks
149
+ * The `%` is part of the value, not a suffix element, so the browser lets the
150
+ * user edit it. This handler corrects the result of an edit, and does not
151
+ * filter the keystrokes in `beforeinput`. The `%` is then a literal for each
152
+ * way that text reaches the field: typing, paste, drop, composition, undo and
153
+ * autofill. `beforeinput` carries `data` only for typing.
154
154
  */
155
155
  private _handleAlphaInputEdit;
156
156
  /**
157
- * Keeps the caret and the selection inside the digits.
157
+ * Keeps the caret and the selection in the digits.
158
158
  *
159
- * The trailing `%` is a literal. Without this handler the caret goes after
160
- * the `%` on focus, on a click past the text, and after a shifted selection
161
- * extends over it. The handler therefore runs on `keyup` as well as on
162
- * `focusin` and `click`. Text after the `%` falls outside the number, and the
163
- * parse discards it.
159
+ * @remarks
160
+ * The last `%` is a literal. Without this handler, the caret goes after the
161
+ * `%` on focus, on a click past the text, and when a shifted selection
162
+ * extends over it. The handler thus runs on `keyup`, `focusin` and `click`.
163
+ * The parse discards text after the `%`.
164
164
  */
165
165
  private _handleAlphaInputCaret;
166
166
  /**
167
167
  * Steps the alpha by one percent.
168
168
  *
169
- * The step applies to the color and not to the text of the field. This keeps
170
- * a held arrow key correct. The key downs repeat faster than a render, so the
171
- * text of the field can be stale.
169
+ * @remarks
170
+ * The step applies to the color, not to the text of the field, which keeps a
171
+ * held arrow key correct. The key downs repeat faster than a render, so the
172
+ * text can be stale.
172
173
  *
173
- * The handler writes the new text and does not leave it to the render, so
174
- * that the caret does not move. A value assignment puts the caret behind the
175
- * `%`. A write from the render applies one frame after the keypress, which
176
- * the user sees as a jump forward and back.
174
+ * The handler writes the new text itself, so that the caret does not move. A
175
+ * value assignment puts the caret after the `%`, and a write from the render
176
+ * applies one frame late, which the user sees as a jump.
177
177
  */
178
178
  private _handleAlphaInputSpin;
179
179
  /**
@@ -196,15 +196,16 @@ export default class IgcColorPickerComponent extends IgcColorPickerComponent_bas
196
196
  /**
197
197
  * The current color with an opaque alpha channel.
198
198
  *
199
- * The swatch preview paints this color over one half of its surface, and
200
- * {@link _alphaColor} over the other half. A translucent color is then shown
201
- * next to its opaque form. At full alpha the two halves are identical and the
202
- * split is invisible, so opaque colors need no separate branch.
199
+ * @remarks
200
+ * The swatch preview paints this color on one half of its surface, and
201
+ * {@link _alphaColor} on the other half, which shows a translucent color next
202
+ * to its opaque form. At full alpha the two halves agree and the split is
203
+ * invisible, so an opaque color needs no separate branch.
203
204
  *
204
- * This value is defined also with no color value. An empty color is white,
205
- * which is where the alpha ramp and the canvas marker belong before the first
206
- * pick. The anchor keeps its "no color" mark, because {@link _previewStyle}
207
- * uses {@link _alphaColor}, which stays empty.
205
+ * This value is defined also with no color. An empty color is white, which is
206
+ * where the alpha ramp and the canvas marker belong before the first pick.
207
+ * The anchor keeps its "no color" mark, because {@link _previewStyle} uses
208
+ * {@link _alphaColor}, which stays empty.
208
209
  */
209
210
  private get _opaqueColor();
210
211
  /** The alpha channel as the whole percentage that both alpha controls use. */
@@ -212,12 +213,12 @@ export default class IgcColorPickerComponent extends IgcColorPickerComponent_bas
212
213
  /** The pure hue that the saturation/value plane and the hue thumb use. */
213
214
  private get _currentColor();
214
215
  /**
215
- * Mirrors the colors that the stylesheet needs onto the host.
216
+ * Copies the colors that the stylesheet needs onto the host.
216
217
  *
217
- * `update()` drives this, and not the handlers that change the color. It
218
- * therefore also runs for the first render. A picker with no value calls none
219
- * of those handlers, and the plane would keep the stylesheet fallback instead
220
- * of its actual hue.
218
+ * @remarks
219
+ * `update()` calls this, not the handlers that change the color, so it runs
220
+ * also for the first render. A picker with no value calls none of those
221
+ * handlers, and the plane would keep the stylesheet fallback.
221
222
  */
222
223
  private _applyColorProperties;
223
224
  /**
@@ -13,7 +13,7 @@ import { live } from 'lit/directives/live.js';
13
13
  import { createRef, ref } from 'lit/directives/ref.js';
14
14
  import { styleMap } from 'lit/directives/style-map.js';
15
15
  import { addAriaProjector } from '#internals/controllers/aria-projection.js';
16
- import { addKeybindings, altKey, arrowDown, arrowRight, arrowUp, endKey, escapeKey, } from '#internals/controllers/key-bindings.js';
16
+ import { addKeybindings, altKey, arrowDown, arrowRight, arrowUp, endKey, escapeKey, isKey, } from '#internals/controllers/key-bindings.js';
17
17
  import { addRootClickController } from '#internals/controllers/root-click.js';
18
18
  import { addSlotController, setSlots } from '#internals/controllers/slot.js';
19
19
  import { shadowOptions } from '#internals/decorators/shadow-options.js';
@@ -226,7 +226,7 @@ let IgcColorPickerComponent = class IgcColorPickerComponent extends FormAssociat
226
226
  if (!native)
227
227
  return;
228
228
  const limit = caretLimit(native.value);
229
- if (event.key === endKey || (native.selectionEnd ?? 0) >= limit) {
229
+ if (isKey(event, endKey) || (native.selectionEnd ?? 0) >= limit) {
230
230
  event.preventDefault();
231
231
  native.setSelectionRange(limit, limit);
232
232
  }
@@ -547,7 +547,7 @@ let IgcColorPickerComponent = class IgcColorPickerComponent extends FormAssociat
547
547
  : this._renderButtonAnchor();
548
548
  }
549
549
  _renderHelperText() {
550
- return this._renderValidationContainer({
550
+ return IgcValidationContainerComponent.create(this, {
551
551
  id: 'helper-text',
552
552
  hasHelperText: true,
553
553
  });
@@ -578,7 +578,12 @@ let IgcColorPickerComponent = class IgcColorPickerComponent extends FormAssociat
578
578
  render() {
579
579
  return html `
580
580
  <div part="color-picker">
581
- <igc-popover ?open=${this.open} shift flip>
581
+ <igc-popover
582
+ ?open=${this.open}
583
+ flip
584
+ .scrollStrategy=${this.scrollStrategy}
585
+ @igcPopoverScrollClose=${this._handleClosing}
586
+ >
582
587
  ${this._renderAnchor()}${this._renderPicker()}
583
588
  </igc-popover>
584
589
  ${!this._isInputMode && this.label