igniteui-webcomponents 7.3.2 → 7.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (478) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/animations/easings.d.ts +21 -31
  3. package/animations/easings.js +21 -34
  4. package/animations/easings.js.map +1 -1
  5. package/animations/player.d.ts +8 -16
  6. package/animations/player.js +5 -8
  7. package/animations/player.js.map +1 -1
  8. package/animations/view-transition.d.ts +10 -10
  9. package/animations/view-transition.js +26 -37
  10. package/animations/view-transition.js.map +1 -1
  11. package/components/breadcrumb/breadcrumb.d.ts +74 -0
  12. package/components/breadcrumb/breadcrumb.js +107 -0
  13. package/components/breadcrumb/breadcrumb.js.map +1 -0
  14. package/components/breadcrumb/breadcrumbs.d.ts +60 -0
  15. package/components/breadcrumb/breadcrumbs.js +50 -0
  16. package/components/breadcrumb/breadcrumbs.js.map +1 -0
  17. package/components/breadcrumb/themes/breadcrumb.base.css.js +3 -0
  18. package/components/breadcrumb/themes/breadcrumb.base.css.js.map +1 -0
  19. package/components/breadcrumb/themes/breadcrumbs.base.css.d.ts +1 -0
  20. package/components/{resize-container/themes/resize-container.base.css.js → breadcrumb/themes/breadcrumbs.base.css.js} +2 -2
  21. package/components/breadcrumb/themes/breadcrumbs.base.css.js.map +1 -0
  22. package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.d.ts +1 -0
  23. package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.js +3 -0
  24. package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.js.map +1 -0
  25. package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.d.ts +1 -0
  26. package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.js +3 -0
  27. package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.js.map +1 -0
  28. package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.d.ts +1 -0
  29. package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.js +3 -0
  30. package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.js.map +1 -0
  31. package/components/breadcrumb/themes/dark/breadcrumb.material.css.d.ts +1 -0
  32. package/components/breadcrumb/themes/dark/breadcrumb.material.css.js +3 -0
  33. package/components/breadcrumb/themes/dark/breadcrumb.material.css.js.map +1 -0
  34. package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.d.ts +1 -0
  35. package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.js +3 -0
  36. package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.js.map +1 -0
  37. package/components/breadcrumb/themes/light/breadcrumb.fluent.css.d.ts +1 -0
  38. package/components/breadcrumb/themes/light/breadcrumb.fluent.css.js +3 -0
  39. package/components/breadcrumb/themes/light/breadcrumb.fluent.css.js.map +1 -0
  40. package/components/breadcrumb/themes/light/breadcrumb.indigo.css.d.ts +1 -0
  41. package/components/breadcrumb/themes/light/breadcrumb.indigo.css.js +3 -0
  42. package/components/breadcrumb/themes/light/breadcrumb.indigo.css.js.map +1 -0
  43. package/components/breadcrumb/themes/light/breadcrumb.material.css.d.ts +1 -0
  44. package/components/breadcrumb/themes/light/breadcrumb.material.css.js +3 -0
  45. package/components/breadcrumb/themes/light/breadcrumb.material.css.js.map +1 -0
  46. package/components/breadcrumb/themes/light/breadcrumb.shared.css.d.ts +1 -0
  47. package/components/breadcrumb/themes/light/breadcrumb.shared.css.js +3 -0
  48. package/components/breadcrumb/themes/light/breadcrumb.shared.css.js.map +1 -0
  49. package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.d.ts +1 -0
  50. package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.js +3 -0
  51. package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.js.map +1 -0
  52. package/components/breadcrumb/themes/shared/breadcrumb.common.css.d.ts +1 -0
  53. package/components/breadcrumb/themes/shared/breadcrumb.common.css.js +3 -0
  54. package/components/breadcrumb/themes/shared/breadcrumb.common.css.js.map +1 -0
  55. package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.d.ts +1 -0
  56. package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.js +3 -0
  57. package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.js.map +1 -0
  58. package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.d.ts +1 -0
  59. package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.js +3 -0
  60. package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.js.map +1 -0
  61. package/components/breadcrumb/themes/shared/breadcrumb.material.css.d.ts +1 -0
  62. package/components/breadcrumb/themes/shared/breadcrumb.material.css.js +3 -0
  63. package/components/breadcrumb/themes/shared/breadcrumb.material.css.js.map +1 -0
  64. package/components/breadcrumb/themes/themes.d.ts +2 -0
  65. package/components/breadcrumb/themes/themes.js +50 -0
  66. package/components/breadcrumb/themes/themes.js.map +1 -0
  67. package/components/button/button.d.ts +0 -2
  68. package/components/button/button.js.map +1 -1
  69. package/components/button-group/button-group.d.ts +42 -12
  70. package/components/button-group/button-group.js +82 -34
  71. package/components/button-group/button-group.js.map +1 -1
  72. package/components/button-group/toggle-button.d.ts +6 -1
  73. package/components/button-group/toggle-button.js +28 -2
  74. package/components/button-group/toggle-button.js.map +1 -1
  75. package/components/calendar/base.js +2 -1
  76. package/components/calendar/base.js.map +1 -1
  77. package/components/calendar/calendar.d.ts +2 -3
  78. package/components/calendar/calendar.js.map +1 -1
  79. package/components/calendar/days-view/days-view.d.ts +2 -2
  80. package/components/calendar/days-view/days-view.js.map +1 -1
  81. package/components/carousel/carousel-indicator.js +1 -0
  82. package/components/carousel/carousel-indicator.js.map +1 -1
  83. package/components/carousel/carousel-slide.d.ts +1 -1
  84. package/components/carousel/carousel-slide.js.map +1 -1
  85. package/components/carousel/carousel.d.ts +3 -3
  86. package/components/carousel/carousel.js.map +1 -1
  87. package/components/chat/chat-input.d.ts +1 -2
  88. package/components/chat/chat-input.js +1 -1
  89. package/components/chat/chat-input.js.map +1 -1
  90. package/components/chat/chat-state.d.ts +8 -9
  91. package/components/chat/chat-state.js.map +1 -1
  92. package/components/chat/chat.d.ts +1 -3
  93. package/components/chat/chat.js +2 -2
  94. package/components/chat/chat.js.map +1 -1
  95. package/components/chat/message-attachments.d.ts +6 -15
  96. package/components/chat/message-attachments.js.map +1 -1
  97. package/components/chat/utils.d.ts +0 -1
  98. package/components/chat/utils.js +1 -1
  99. package/components/chat/utils.js.map +1 -1
  100. package/components/checkbox/checkbox-base.d.ts +3 -1
  101. package/components/checkbox/checkbox-base.js +4 -0
  102. package/components/checkbox/checkbox-base.js.map +1 -1
  103. package/components/checkbox/checkbox.js +4 -12
  104. package/components/checkbox/checkbox.js.map +1 -1
  105. package/components/checkbox/switch.js +1 -8
  106. package/components/checkbox/switch.js.map +1 -1
  107. package/components/chip/chip.d.ts +2 -2
  108. package/components/chip/chip.js.map +1 -1
  109. package/components/color-picker/color-picker.d.ts +35 -34
  110. package/components/color-picker/color-picker.js +12 -7
  111. package/components/color-picker/color-picker.js.map +1 -1
  112. package/components/color-picker/common.d.ts +0 -2
  113. package/components/color-picker/common.js +2 -2
  114. package/components/color-picker/common.js.map +1 -1
  115. package/components/color-picker/converters.js.map +1 -1
  116. package/components/color-picker/picker-canvas.js.map +1 -1
  117. package/components/combo/combo.d.ts +24 -24
  118. package/components/combo/combo.js +21 -26
  119. package/components/combo/combo.js.map +1 -1
  120. package/components/combo/controllers/data.d.ts +7 -10
  121. package/components/combo/controllers/data.js.map +1 -1
  122. package/components/date-picker/date-picker.base.d.ts +22 -27
  123. package/components/date-picker/date-picker.base.js +9 -3
  124. package/components/date-picker/date-picker.base.js.map +1 -1
  125. package/components/date-picker/date-picker.d.ts +1 -1
  126. package/components/date-picker/date-picker.js +5 -3
  127. package/components/date-picker/date-picker.js.map +1 -1
  128. package/components/date-range-picker/date-range-input.d.ts +0 -2
  129. package/components/date-range-picker/date-range-input.js +0 -6
  130. package/components/date-range-picker/date-range-input.js.map +1 -1
  131. package/components/date-range-picker/date-range-picker.d.ts +22 -31
  132. package/components/date-range-picker/date-range-picker.js +7 -7
  133. package/components/date-range-picker/date-range-picker.js.map +1 -1
  134. package/components/date-range-picker/i18n.d.ts +21 -0
  135. package/components/date-range-picker/i18n.js +10 -0
  136. package/components/date-range-picker/i18n.js.map +1 -0
  137. package/components/date-range-picker/predefined-ranges-area.d.ts +3 -3
  138. package/components/date-range-picker/predefined-ranges-area.js +2 -5
  139. package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
  140. package/components/date-range-picker/validators.d.ts +0 -4
  141. package/components/date-range-picker/validators.js +4 -4
  142. package/components/date-range-picker/validators.js.map +1 -1
  143. package/components/date-time-input/date-time-input.base.d.ts +42 -40
  144. package/components/date-time-input/date-time-input.base.js +9 -5
  145. package/components/date-time-input/date-time-input.base.js.map +1 -1
  146. package/components/date-time-input/date-time-input.d.ts +1 -11
  147. package/components/date-time-input/date-time-input.js +0 -6
  148. package/components/date-time-input/date-time-input.js.map +1 -1
  149. package/components/date-time-input/datetime-mask-parser.d.ts +0 -10
  150. package/components/date-time-input/datetime-mask-parser.js +1 -1
  151. package/components/date-time-input/datetime-mask-parser.js.map +1 -1
  152. package/components/dialog/dialog.js.map +1 -1
  153. package/components/dropdown/dropdown-group.d.ts +2 -10
  154. package/components/dropdown/dropdown-group.js +2 -27
  155. package/components/dropdown/dropdown-group.js.map +1 -1
  156. package/components/dropdown/dropdown.d.ts +17 -23
  157. package/components/dropdown/dropdown.js +5 -17
  158. package/components/dropdown/dropdown.js.map +1 -1
  159. package/components/file-input/file-input.d.ts +7 -2
  160. package/components/file-input/file-input.js +4 -0
  161. package/components/file-input/file-input.js.map +1 -1
  162. package/components/icon/icon.d.ts +1 -1
  163. package/components/icon/icon.registry.d.ts +6 -6
  164. package/components/icon/icon.registry.js.map +1 -1
  165. package/components/input/input-base.d.ts +2 -2
  166. package/components/input/input-base.js +3 -5
  167. package/components/input/input-base.js.map +1 -1
  168. package/components/input/input.d.ts +3 -3
  169. package/components/input/input.js.map +1 -1
  170. package/components/mask-input/mask-history.d.ts +22 -18
  171. package/components/mask-input/mask-history.js.map +1 -1
  172. package/components/mask-input/mask-input.d.ts +1 -1
  173. package/components/mask-input/mask-parser.d.ts +11 -13
  174. package/components/mask-input/mask-parser.js.map +1 -1
  175. package/components/popover/popover.d.ts +45 -34
  176. package/components/popover/popover.js +54 -122
  177. package/components/popover/popover.js.map +1 -1
  178. package/components/popover/position/arrow.d.ts +19 -0
  179. package/components/popover/position/arrow.js +33 -0
  180. package/components/popover/position/arrow.js.map +1 -0
  181. package/components/popover/position/floating.d.ts +40 -0
  182. package/components/popover/position/floating.js +146 -0
  183. package/components/popover/position/floating.js.map +1 -0
  184. package/components/popover/position/native.d.ts +45 -0
  185. package/components/popover/position/native.js +158 -0
  186. package/components/popover/position/native.js.map +1 -0
  187. package/components/popover/position/strategy.d.ts +37 -0
  188. package/components/popover/position/strategy.js +21 -0
  189. package/components/popover/position/strategy.js.map +1 -0
  190. package/components/popover/position/types.d.ts +26 -0
  191. package/components/popover/position/types.js +15 -0
  192. package/components/popover/position/types.js.map +1 -0
  193. package/components/popover/themes/light/popover.base.css.js +1 -1
  194. package/components/popover/themes/light/popover.base.css.js.map +1 -1
  195. package/components/progress/circular-progress.d.ts +0 -5
  196. package/components/progress/circular-progress.js.map +1 -1
  197. package/components/qr-code/qr-code.d.ts +1 -1
  198. package/components/radio/radio.d.ts +6 -4
  199. package/components/radio/radio.js +24 -25
  200. package/components/radio/radio.js.map +1 -1
  201. package/components/radio-group/radio-group.js.map +1 -1
  202. package/components/rating/rating.d.ts +9 -6
  203. package/components/rating/rating.js +17 -18
  204. package/components/rating/rating.js.map +1 -1
  205. package/components/select/select-group.d.ts +5 -10
  206. package/components/select/select-group.js +10 -34
  207. package/components/select/select-group.js.map +1 -1
  208. package/components/select/select.d.ts +12 -20
  209. package/components/select/select.js +5 -15
  210. package/components/select/select.js.map +1 -1
  211. package/components/slider/range-slider.d.ts +0 -1
  212. package/components/slider/range-slider.js +6 -11
  213. package/components/slider/range-slider.js.map +1 -1
  214. package/components/slider/slider-base.d.ts +4 -1
  215. package/components/slider/slider-base.js +20 -18
  216. package/components/slider/slider-base.js.map +1 -1
  217. package/components/slider/slider.d.ts +2 -0
  218. package/components/slider/slider.js +5 -1
  219. package/components/slider/slider.js.map +1 -1
  220. package/components/splitter/splitter.d.ts +6 -6
  221. package/components/splitter/splitter.js.map +1 -1
  222. package/components/textarea/textarea.d.ts +2 -5
  223. package/components/textarea/textarea.js +3 -5
  224. package/components/textarea/textarea.js.map +1 -1
  225. package/components/tile-manager/tile-manager.d.ts +6 -7
  226. package/components/tile-manager/tile-manager.js.map +1 -1
  227. package/components/tile-manager/tile.d.ts +3 -3
  228. package/components/tile-manager/tile.js.map +1 -1
  229. package/components/toast/toast.d.ts +0 -2
  230. package/components/toast/toast.js.map +1 -1
  231. package/components/tooltip/controller.js.map +1 -1
  232. package/components/tooltip/service.js +4 -5
  233. package/components/tooltip/service.js.map +1 -1
  234. package/components/tooltip/tooltip.d.ts +34 -13
  235. package/components/tooltip/tooltip.js +8 -4
  236. package/components/tooltip/tooltip.js.map +1 -1
  237. package/components/tree/tree-item.d.ts +6 -6
  238. package/components/tree/tree-item.js.map +1 -1
  239. package/components/tree/tree.navigation.d.ts +5 -6
  240. package/components/tree/tree.navigation.js.map +1 -1
  241. package/components/tree/tree.selection.js.map +1 -1
  242. package/components/types.d.ts +1 -1
  243. package/components/types.js.map +1 -1
  244. package/components/validation-container/validation-container.js +2 -1
  245. package/components/validation-container/validation-container.js.map +1 -1
  246. package/components/virtualization/engine.d.ts +40 -9
  247. package/components/virtualization/engine.js +126 -61
  248. package/components/virtualization/engine.js.map +1 -1
  249. package/components/virtualization/recycle.d.ts +13 -0
  250. package/components/virtualization/recycle.js +152 -0
  251. package/components/virtualization/recycle.js.map +1 -0
  252. package/components/virtualization/virtualization.d.ts +84 -65
  253. package/components/virtualization/virtualization.js +20 -16
  254. package/components/virtualization/virtualization.js.map +1 -1
  255. package/custom-elements.json +18455 -19551
  256. package/igniteui-webcomponents.css-data.json +2 -2
  257. package/igniteui-webcomponents.html-data.json +1 -1
  258. package/index.d.ts +3 -1
  259. package/index.js +2 -0
  260. package/index.js.map +1 -1
  261. package/internals/abort-handler.d.ts +13 -25
  262. package/internals/abort-handler.js +4 -6
  263. package/internals/abort-handler.js.map +1 -1
  264. package/internals/context.d.ts +13 -7
  265. package/internals/context.js +2 -1
  266. package/internals/context.js.map +1 -1
  267. package/internals/controllers/adopt-styles.d.ts +19 -20
  268. package/internals/controllers/adopt-styles.js +3 -8
  269. package/internals/controllers/adopt-styles.js.map +1 -1
  270. package/internals/controllers/aria-projection.d.ts +100 -61
  271. package/internals/controllers/aria-projection.js +81 -31
  272. package/internals/controllers/aria-projection.js.map +1 -1
  273. package/internals/controllers/async-consumer.js.map +1 -1
  274. package/internals/controllers/command.d.ts +15 -30
  275. package/internals/controllers/command.js +2 -7
  276. package/internals/controllers/command.js.map +1 -1
  277. package/internals/controllers/context-provider.d.ts +7 -13
  278. package/internals/controllers/context-provider.js.map +1 -1
  279. package/internals/controllers/focus-ring.d.ts +10 -30
  280. package/internals/controllers/focus-ring.js +6 -12
  281. package/internals/controllers/focus-ring.js.map +1 -1
  282. package/internals/controllers/fullscreen.d.ts +7 -23
  283. package/internals/controllers/fullscreen.js +3 -9
  284. package/internals/controllers/fullscreen.js.map +1 -1
  285. package/internals/controllers/gestures.d.ts +10 -29
  286. package/internals/controllers/gestures.js +1 -3
  287. package/internals/controllers/gestures.js.map +1 -1
  288. package/internals/controllers/group.d.ts +13 -30
  289. package/internals/controllers/group.js.map +1 -1
  290. package/internals/controllers/host-listeners.d.ts +28 -0
  291. package/internals/controllers/host-listeners.js +27 -0
  292. package/internals/controllers/host-listeners.js.map +1 -0
  293. package/internals/controllers/id-resolver.d.ts +8 -9
  294. package/internals/controllers/id-resolver.js +6 -14
  295. package/internals/controllers/id-resolver.js.map +1 -1
  296. package/internals/controllers/internals.d.ts +53 -104
  297. package/internals/controllers/internals.js +40 -13
  298. package/internals/controllers/internals.js.map +1 -1
  299. package/internals/controllers/key-bindings.d.ts +61 -158
  300. package/internals/controllers/key-bindings.js +68 -67
  301. package/internals/controllers/key-bindings.js.map +1 -1
  302. package/internals/controllers/keys.d.ts +32 -0
  303. package/internals/controllers/keys.js +20 -0
  304. package/internals/controllers/keys.js.map +1 -0
  305. package/internals/controllers/mutation-observer.d.ts +14 -37
  306. package/internals/controllers/mutation-observer.js +1 -1
  307. package/internals/controllers/mutation-observer.js.map +1 -1
  308. package/internals/controllers/resize-observer.d.ts +9 -19
  309. package/internals/controllers/resize-observer.js.map +1 -1
  310. package/internals/controllers/root-click.d.ts +11 -42
  311. package/internals/controllers/root-click.js +4 -6
  312. package/internals/controllers/root-click.js.map +1 -1
  313. package/internals/controllers/roving-focus.d.ts +16 -35
  314. package/internals/controllers/roving-focus.js.map +1 -1
  315. package/internals/controllers/slot.d.ts +25 -54
  316. package/internals/controllers/slot.js +6 -6
  317. package/internals/controllers/slot.js.map +1 -1
  318. package/internals/controllers/toggle.d.ts +44 -48
  319. package/internals/controllers/toggle.js.map +1 -1
  320. package/internals/date/compare.js.map +1 -1
  321. package/internals/date/converters.d.ts +10 -7
  322. package/internals/date/converters.js.map +1 -1
  323. package/internals/date/model.d.ts +9 -16
  324. package/internals/date/model.js +22 -25
  325. package/internals/date/model.js.map +1 -1
  326. package/internals/decorators/blazorAdditionalDependencies.d.ts +4 -2
  327. package/internals/decorators/blazorAdditionalDependencies.js.map +1 -1
  328. package/internals/decorators/blazorDeepImport.d.ts +1 -3
  329. package/internals/decorators/blazorDeepImport.js.map +1 -1
  330. package/internals/decorators/blazorInclude.d.ts +3 -2
  331. package/internals/decorators/blazorInclude.js.map +1 -1
  332. package/internals/decorators/blazorIndirectRender.d.ts +1 -3
  333. package/internals/decorators/blazorIndirectRender.js.map +1 -1
  334. package/internals/decorators/blazorSuppressComponent.d.ts +1 -3
  335. package/internals/decorators/blazorSuppressComponent.js.map +1 -1
  336. package/internals/decorators/coerced-property.d.ts +14 -20
  337. package/internals/decorators/coerced-property.js.map +1 -1
  338. package/internals/decorators/shadow-options.d.ts +2 -5
  339. package/internals/decorators/shadow-options.js.map +1 -1
  340. package/internals/definitions/defineAllComponents.js +2 -0
  341. package/internals/definitions/defineAllComponents.js.map +1 -1
  342. package/internals/directives/drag.d.ts +51 -81
  343. package/internals/directives/drag.js +27 -89
  344. package/internals/directives/drag.js.map +1 -1
  345. package/internals/directives/pointer-operation.d.ts +75 -0
  346. package/internals/directives/pointer-operation.js +92 -0
  347. package/internals/directives/pointer-operation.js.map +1 -0
  348. package/internals/directives/resize.d.ts +36 -64
  349. package/internals/directives/resize.js +18 -85
  350. package/internals/directives/resize.js.map +1 -1
  351. package/internals/i18n/EN/calendar.resources.d.ts +8 -2
  352. package/internals/i18n/EN/calendar.resources.js +2 -2
  353. package/internals/i18n/EN/calendar.resources.js.map +1 -1
  354. package/internals/i18n/EN/chat.resources.d.ts +8 -2
  355. package/internals/i18n/EN/chat.resources.js +3 -10
  356. package/internals/i18n/EN/chat.resources.js.map +1 -1
  357. package/internals/i18n/EN/date-picker.resources.d.ts +6 -4
  358. package/internals/i18n/EN/date-picker.resources.js +1 -7
  359. package/internals/i18n/EN/date-picker.resources.js.map +1 -1
  360. package/internals/i18n/EN/date-range-picker.resources.d.ts +9 -2
  361. package/internals/i18n/EN/date-range-picker.resources.js +2 -2
  362. package/internals/i18n/EN/date-range-picker.resources.js.map +1 -1
  363. package/internals/i18n/i18n-controller.d.ts +44 -46
  364. package/internals/i18n/i18n-controller.js +46 -33
  365. package/internals/i18n/i18n-controller.js.map +1 -1
  366. package/internals/i18n/utils.d.ts +9 -4
  367. package/internals/i18n/utils.js +4 -27
  368. package/internals/i18n/utils.js.map +1 -1
  369. package/internals/mixins/alert.d.ts +10 -25
  370. package/internals/mixins/alert.js.map +1 -1
  371. package/internals/mixins/combo-box.d.ts +21 -11
  372. package/internals/mixins/combo-box.js +16 -22
  373. package/internals/mixins/combo-box.js.map +1 -1
  374. package/internals/mixins/event-emitter.js +9 -11
  375. package/internals/mixins/event-emitter.js.map +1 -1
  376. package/internals/mixins/forms/associated-required.d.ts +4 -4
  377. package/internals/mixins/forms/associated-required.js.map +1 -1
  378. package/internals/mixins/forms/associated.d.ts +4 -2
  379. package/internals/mixins/forms/associated.js +42 -19
  380. package/internals/mixins/forms/associated.js.map +1 -1
  381. package/internals/mixins/forms/form-transformers.js.map +1 -1
  382. package/internals/mixins/forms/types.d.ts +27 -78
  383. package/internals/mixins/forms/types.js.map +1 -1
  384. package/internals/mixins/group.d.ts +18 -0
  385. package/internals/mixins/group.js +37 -0
  386. package/internals/mixins/group.js.map +1 -0
  387. package/internals/mixins/i18n.d.ts +10 -16
  388. package/internals/mixins/i18n.js.map +1 -1
  389. package/internals/mixins/mask-behavior.d.ts +8 -22
  390. package/internals/mixins/mask-behavior.js +1 -2
  391. package/internals/mixins/mask-behavior.js.map +1 -1
  392. package/internals/mixins/option.d.ts +1 -2
  393. package/internals/mixins/option.js +2 -1
  394. package/internals/mixins/option.js.map +1 -1
  395. package/internals/part-map.d.ts +4 -2
  396. package/internals/part-map.js +1 -1
  397. package/internals/part-map.js.map +1 -1
  398. package/internals/templates/input-shell.d.ts +8 -17
  399. package/internals/templates/input-shell.js +4 -1
  400. package/internals/templates/input-shell.js.map +1 -1
  401. package/internals/templates/masked-input.d.ts +7 -8
  402. package/internals/templates/masked-input.js.map +1 -1
  403. package/internals/templates/slotted-icon.d.ts +7 -12
  404. package/internals/templates/slotted-icon.js.map +1 -1
  405. package/internals/templates/toggle-shell.d.ts +19 -19
  406. package/internals/templates/toggle-shell.js +12 -8
  407. package/internals/templates/toggle-shell.js.map +1 -1
  408. package/internals/timing.d.ts +5 -14
  409. package/internals/timing.js.map +1 -1
  410. package/internals/utils/arrays.d.ts +21 -21
  411. package/internals/utils/arrays.js +14 -0
  412. package/internals/utils/arrays.js.map +1 -1
  413. package/internals/utils/dom.d.ts +53 -41
  414. package/internals/utils/dom.js +3 -4
  415. package/internals/utils/dom.js.map +1 -1
  416. package/internals/utils/events.d.ts +29 -16
  417. package/internals/utils/events.js +9 -1
  418. package/internals/utils/events.js.map +1 -1
  419. package/internals/utils/lit.d.ts +5 -2
  420. package/internals/utils/lit.js.map +1 -1
  421. package/internals/utils/math.d.ts +8 -6
  422. package/internals/utils/math.js.map +1 -1
  423. package/internals/utils/objects.d.ts +3 -20
  424. package/internals/utils/objects.js +1 -39
  425. package/internals/utils/objects.js.map +1 -1
  426. package/internals/utils/strings.d.ts +9 -11
  427. package/internals/utils/strings.js.map +1 -1
  428. package/internals/utils/types.d.ts +16 -3
  429. package/internals/utils/types.js +3 -0
  430. package/internals/utils/types.js.map +1 -1
  431. package/internals/validators.d.ts +9 -8
  432. package/internals/validators.js +12 -6
  433. package/internals/validators.js.map +1 -1
  434. package/package.json +1 -1
  435. package/skills/README.md +4 -3
  436. package/skills/igniteui-wc-choose-components/SKILL.md +2 -1
  437. package/skills/igniteui-wc-customize-component-theme/SKILL.md +2 -1
  438. package/skills/igniteui-wc-figma-to-app/SKILL.md +328 -0
  439. package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +343 -0
  440. package/skills/igniteui-wc-figma-to-app/references/design-provenance.md +199 -0
  441. package/skills/igniteui-wc-figma-to-app/references/design-token-bridge.md +489 -0
  442. package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +370 -0
  443. package/skills/igniteui-wc-figma-to-app/references/figma-exploration.md +222 -0
  444. package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +363 -0
  445. package/skills/igniteui-wc-figma-to-app/references/project-setup.md +105 -0
  446. package/skills/igniteui-wc-figma-to-app/references/theme-generation.md +180 -0
  447. package/skills/igniteui-wc-figma-to-app/references/validation-patterns.md +370 -0
  448. package/skills/igniteui-wc-generate-from-image-design/SKILL.md +2 -1
  449. package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +3 -3
  450. package/skills/igniteui-wc-grids/SKILL.md +133 -0
  451. package/skills/igniteui-wc-integrate-with-framework/SKILL.md +2 -1
  452. package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +2 -1
  453. package/skills/igniteui-wc-optimize-bundle-size/SKILL.md +2 -1
  454. package/theming/config.d.ts +14 -5
  455. package/theming/config.js +38 -18
  456. package/theming/config.js.map +1 -1
  457. package/theming/context.d.ts +1 -23
  458. package/theming/context.js.map +1 -1
  459. package/theming/theming-controller.d.ts +2 -32
  460. package/theming/theming-controller.js +15 -21
  461. package/theming/theming-controller.js.map +1 -1
  462. package/theming/theming-event.d.ts +0 -7
  463. package/theming/theming-event.js +0 -13
  464. package/theming/theming-event.js.map +1 -1
  465. package/theming/types.d.ts +1 -8
  466. package/theming/types.js.map +1 -1
  467. package/web-types.json +3 -3
  468. package/animations/presets/slide/index.d.ts +0 -3
  469. package/animations/presets/slide/index.js +0 -16
  470. package/animations/presets/slide/index.js.map +0 -1
  471. package/components/resize-container/themes/resize-container.base.css.js.map +0 -1
  472. package/internals/controllers/root-scroll.d.ts +0 -31
  473. package/internals/controllers/root-scroll.js +0 -71
  474. package/internals/controllers/root-scroll.js.map +0 -1
  475. package/theming/utils.d.ts +0 -11
  476. package/theming/utils.js +0 -20
  477. package/theming/utils.js.map +0 -1
  478. /package/components/{resize-container/themes/resize-container.base.css.d.ts → breadcrumb/themes/breadcrumb.base.css.d.ts} +0 -0
@@ -18,7 +18,7 @@ declare const IgcFileInputComponent_base: AbstractConstructor<import("#internals
18
18
  * @slot custom-error - Renders content when setCustomValidity(message) is set.
19
19
  * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).
20
20
  *
21
- * @fires igcChange - Emitted when the control's checked state changes.
21
+ * @fires igcChange - Emitted when the selection of the control changes.
22
22
  * @fires igcCancel - Emitted when the control's file picker dialog is canceled.
23
23
  *
24
24
  * @csspart container - The main wrapper that holds all main input elements.
@@ -35,7 +35,7 @@ export default class IgcFileInputComponent extends IgcFileInputComponent_base {
35
35
  static styles: import("lit").CSSResult[];
36
36
  static register(): void;
37
37
  protected readonly _themes: import("#theming/theming-controller.js").ThemingController;
38
- protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "prefix" | "helper-text" | "[default]" | "suffix" | "value-missing" | "custom-error" | "file-selector-text" | "file-missing-text">;
38
+ protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "prefix" | "[default]" | "suffix" | "helper-text" | "value-missing" | "custom-error" | "file-selector-text" | "file-missing-text">;
39
39
  protected readonly _formValue: import("#internals/mixins/forms/form-value.js").FormValue<FileList | null>;
40
40
  protected get __validators(): import("../../internals/validators.js").Validator<IgcFileInputComponent>[];
41
41
  private get _fileNames();
@@ -85,6 +85,11 @@ export default class IgcFileInputComponent extends IgcFileInputComponent_base {
85
85
  private _handleCancel;
86
86
  protected _handleBlur(): void;
87
87
  protected _handleClick(): void;
88
+ /**
89
+ * Focuses the native input and opens the file picker. Delegated focus alone
90
+ * goes to the browse button.
91
+ */
92
+ protected _handleLabelActivation(): void;
88
93
  protected _renderFileParts(): import("lit-html").TemplateResult<1>;
89
94
  protected _renderInput(): import("lit-html").TemplateResult<1>;
90
95
  }
@@ -101,6 +101,10 @@ export default class IgcFileInputComponent extends I18nMixin(EventEmitterMixin(I
101
101
  _handleClick() {
102
102
  this._filePickerActive = true;
103
103
  }
104
+ _handleLabelActivation() {
105
+ this._input?.focus();
106
+ this._input?.click();
107
+ }
104
108
  _renderFileParts() {
105
109
  const emptyText = this.placeholder ?? this.resourceStrings.file_input_placeholder;
106
110
  return html `
@@ -1 +1 @@
1
- {"version":3,"file":"file-input.js","sourceRoot":"","sources":["../../../src/components/file-input/file-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,0BAA0B,GAE3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAA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FileInputResourceStringsEN,\n type IFileInputResourceStrings,\n} from 'igniteui-i18n-core';\nimport { html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ariaBindings } from '#internals/controllers/aria-projection.js';\nimport { addSlotController, setSlots } from '#internals/controllers/slot.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport type { I18nControllerConfig } from '#internals/i18n/i18n-controller.js';\nimport type { AbstractConstructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { FormValueFileListTransformers } from '#internals/mixins/forms/form-transformers.js';\nimport { createFormValueState } from '#internals/mixins/forms/form-value.js';\nimport { I18nMixin } from '#internals/mixins/i18n.js';\nimport { partMap } from '#internals/part-map.js';\nimport { hasFiles } from '#internals/utils/dom.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcButtonComponent from '../button/button.js';\nimport {\n IgcInputBaseComponent,\n type IgcInputComponentEventMap,\n} from '../input/input-base.js';\nimport { styles as baseStyle } from '../input/themes/input.base.css.js';\nimport { styles as shared } from '../input/themes/shared/input.common.css.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { styles } from './themes/file-input.base.css.js';\nimport { all } from './themes/themes.js';\nimport { fileValidators } from './validators.js';\n\n/* blazorSuppress */\nexport interface IgcFileInputComponentEventMap extends Omit<\n IgcInputComponentEventMap,\n 'igcChange' | 'igcInput'\n> {\n igcCancel: CustomEvent<FileList>;\n igcChange: CustomEvent<FileList>;\n}\n\nconst Slots = setSlots(\n 'prefix',\n 'suffix',\n 'helper-text',\n 'file-selector-text',\n 'file-missing-text',\n 'value-missing',\n 'custom-error',\n 'invalid'\n);\n\nconst i18n: I18nControllerConfig<IFileInputResourceStrings> = {\n defaultEN: FileInputResourceStringsEN,\n};\n\n/* blazorSuppress */\n/**\n * @element igc-file-input\n *\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after input.\n * @slot helper-text - Renders content below the input.\n * @slot file-selector-text - Renders content for the browse button when input type is file.\n * @slot file-missing-text - Renders content when input type is file and no file is chosen.\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 * @fires igcCancel - Emitted when the control's file picker dialog is canceled.\n *\n * @csspart container - The main wrapper that holds all main input elements.\n * @csspart input - The native input element.\n * @csspart label - The native label element.\n * @csspart file-names - The file names wrapper when input type is 'file'.\n * @csspart file-selector-button - The browse button when input type is 'file'.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart helper-text - The helper text wrapper.\n */\nexport default class IgcFileInputComponent extends I18nMixin(\n EventEmitterMixin<\n IgcFileInputComponentEventMap,\n AbstractConstructor<IgcInputBaseComponent>\n >(IgcInputBaseComponent),\n i18n\n) {\n public static readonly tagName = 'igc-file-input';\n public static styles = [baseStyle, shared, styles];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcFileInputComponent,\n IgcValidationContainerComponent,\n IgcButtonComponent\n );\n }\n\n //#region Internal attributes and properties\n\n protected override readonly _themes = addThemingController(this, all);\n\n protected override readonly _slots = addSlotController(this, {\n slots: Slots,\n });\n\n protected override readonly _formValue = createFormValueState(this, {\n initialValue: null,\n transformers: FormValueFileListTransformers,\n });\n\n protected override get __validators() {\n return fileValidators;\n }\n\n private get _fileNames(): string | null {\n if (!hasFiles(this)) {\n return null;\n }\n\n return Array.from(this.files)\n .map((file) => file.name || 'unnamed')\n .join(', ');\n }\n\n /**\n * Indicates whether the file picker dialog is currently active.\n * Used to manage validation on blur.\n */\n @state()\n private _filePickerActive = false;\n\n //#endregion\n\n //#region Public attributes and properties\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the control.\n * Similar to native file input, this property is read-only and cannot be set programmatically.\n * @attr\n */\n @property()\n public set value(value: string) {\n if (value === '' && this._input) {\n this._input.value = value;\n }\n }\n\n public get value(): string {\n return this._input?.value ?? '';\n }\n\n /**\n * Whether the control allows the user to select more than one file.\n *\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public multiple = false;\n\n /**\n * The file types the control accepts, as a comma-separated list.\n * @attr\n */\n @property()\n public accept = '';\n\n /**\n * Whether the control should receive focus automatically.\n * @attr\n */\n @property({ type: Boolean })\n public override autofocus!: boolean;\n\n /** Returns the list of selected files. */\n public get files(): FileList {\n return this._input?.files ?? new DataTransfer().files;\n }\n\n //#endregion\n\n //#region Internal methods\n\n /**\n * A file input cannot have a default file list, so the `value` attribute\n * never contributes a default - otherwise its string would be stored as the\n * FileList default and submitted character-by-character after a form reset.\n */\n protected override _setDefaultValue(): void {\n this._formValue.defaultValue = null;\n }\n\n /**\n * Restores directly instead of through the `value` setter: the setter is\n * deliberately inert (read-only semantics) and never updates the form state.\n */\n protected override _restoreDefaultValue(): void {\n if (this._input) {\n this._input.value = '';\n }\n this._formValue.setValueAndFormState(this._formValue.defaultValue);\n this.requestUpdate();\n }\n\n //#endregion\n\n //#region Event Handlers\n\n private _handleChange(): void {\n this._filePickerActive = false;\n this._setTouchedState();\n this._formValue.setValueAndFormState(this.files);\n\n this.requestUpdate();\n this.emitEvent('igcChange', { detail: this.files });\n }\n\n private _handleCancel(): void {\n this._filePickerActive = false;\n this._setTouchedState();\n this._validate();\n\n this.emitEvent('igcCancel', { detail: this.files });\n }\n\n protected override _handleBlur(): void {\n this._filePickerActive ? this._validate() : super._handleBlur();\n }\n\n /* c8 ignore next 3 */\n protected _handleClick(): void {\n this._filePickerActive = true;\n }\n\n //#endregion\n\n protected override _renderFileParts() {\n const emptyText =\n this.placeholder ?? this.resourceStrings.file_input_placeholder;\n\n return html`\n <div part=\"file-parts\">\n <div part=\"file-selector-button\">\n <igc-button variant=\"flat\" ?disabled=${this.disabled} tabindex=\"-1\">\n <slot name=\"file-selector-text\"\n >${this.resourceStrings.file_input_upload_button}</slot\n >\n </igc-button>\n </div>\n <div part=\"file-names\">\n <span>\n ${\n this._fileNames ??\n html`<slot name=\"file-missing-text\">${emptyText}</slot>`\n }\n </span>\n </div>\n </div>\n `;\n }\n\n protected override _renderInput() {\n const hasNegativeTabIndex = this.getAttribute('tabindex') === '-1';\n\n return html`\n <input\n ${ariaBindings(this._ariaTarget.resolveBindings())}\n id=${this._inputId}\n part=${partMap(this._resolvePartNames('input'))}\n type=\"file\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?autofocus=${this.autofocus}\n ?multiple=${this.multiple}\n tabindex=${bindIf(hasNegativeTabIndex, -1)}\n accept=${bindIf(this.accept, this.accept)}\n @click=${this._handleClick}\n @change=${this._handleChange}\n @cancel=${this._handleCancel}\n @blur=${this._handleBlur}\n />\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-file-input': IgcFileInputComponent;\n }\n}\n"]}
1
+ {"version":3,"file":"file-input.js","sourceRoot":"","sources":["../../../src/components/file-input/file-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,0BAA0B,GAE3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OA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OhD,IAAI,CAAC,UAAU;YACf,IAAI,CAAA,kCAAkC,SAAS,SACjD;;;;KAIP,CAAC;IACJ,CAAC;IAEkB,YAAY;QAC7B,MAAM,mBAAmB,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;QAEnE,OAAO,IAAI,CAAA;;UAEL,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC;aAC7C,IAAI,CAAC,QAAQ;eACX,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;;oBAEnC,IAAI,CAAC,QAAQ;oBACb,IAAI,CAAC,QAAQ;qBACZ,IAAI,CAAC,SAAS;oBACf,IAAI,CAAC,QAAQ;mBACd,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;iBACjC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;iBAChC,IAAI,CAAC,YAAY;kBAChB,IAAI,CAAC,aAAa;kBAClB,IAAI,CAAC,aAAa;gBACpB,IAAI,CAAC,WAAW;;KAE3B,CAAC;IACJ,CAAC;;AAlKO;IADP,KAAK,EAAE;gEAC0B;AAalC;IADC,QAAQ,EAAE;kDAKV;AAaM;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDACnB;AAOjB;IADN,QAAQ,EAAE;qDACQ;AAOH;IADf,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wDACQ","sourcesContent":["import {\n FileInputResourceStringsEN,\n type IFileInputResourceStrings,\n} from 'igniteui-i18n-core';\nimport { html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ariaBindings } from '#internals/controllers/aria-projection.js';\nimport { addSlotController, setSlots } from '#internals/controllers/slot.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport type { I18nControllerConfig } from '#internals/i18n/i18n-controller.js';\nimport type { AbstractConstructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { FormValueFileListTransformers } from '#internals/mixins/forms/form-transformers.js';\nimport { createFormValueState } from '#internals/mixins/forms/form-value.js';\nimport { I18nMixin } from '#internals/mixins/i18n.js';\nimport { partMap } from '#internals/part-map.js';\nimport { hasFiles } from '#internals/utils/dom.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcButtonComponent from '../button/button.js';\nimport {\n IgcInputBaseComponent,\n type IgcInputComponentEventMap,\n} from '../input/input-base.js';\nimport { styles as baseStyle } from '../input/themes/input.base.css.js';\nimport { styles as shared } from '../input/themes/shared/input.common.css.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { styles } from './themes/file-input.base.css.js';\nimport { all } from './themes/themes.js';\nimport { fileValidators } from './validators.js';\n\n/* blazorSuppress */\nexport interface IgcFileInputComponentEventMap extends Omit<\n IgcInputComponentEventMap,\n 'igcChange' | 'igcInput'\n> {\n igcCancel: CustomEvent<FileList>;\n igcChange: CustomEvent<FileList>;\n}\n\nconst Slots = setSlots(\n 'prefix',\n 'suffix',\n 'helper-text',\n 'file-selector-text',\n 'file-missing-text',\n 'value-missing',\n 'custom-error',\n 'invalid'\n);\n\nconst i18n: I18nControllerConfig<IFileInputResourceStrings> = {\n defaultEN: FileInputResourceStringsEN,\n};\n\n/* blazorSuppress */\n/**\n * @element igc-file-input\n *\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after input.\n * @slot helper-text - Renders content below the input.\n * @slot file-selector-text - Renders content for the browse button when input type is file.\n * @slot file-missing-text - Renders content when input type is file and no file is chosen.\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 selection of the control changes.\n * @fires igcCancel - Emitted when the control's file picker dialog is canceled.\n *\n * @csspart container - The main wrapper that holds all main input elements.\n * @csspart input - The native input element.\n * @csspart label - The native label element.\n * @csspart file-names - The file names wrapper when input type is 'file'.\n * @csspart file-selector-button - The browse button when input type is 'file'.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart helper-text - The helper text wrapper.\n */\nexport default class IgcFileInputComponent extends I18nMixin(\n EventEmitterMixin<\n IgcFileInputComponentEventMap,\n AbstractConstructor<IgcInputBaseComponent>\n >(IgcInputBaseComponent),\n i18n\n) {\n public static readonly tagName = 'igc-file-input';\n public static styles = [baseStyle, shared, styles];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcFileInputComponent,\n IgcValidationContainerComponent,\n IgcButtonComponent\n );\n }\n\n //#region Internal attributes and properties\n\n protected override readonly _themes = addThemingController(this, all);\n\n protected override readonly _slots = addSlotController(this, {\n slots: Slots,\n });\n\n protected override readonly _formValue = createFormValueState(this, {\n initialValue: null,\n transformers: FormValueFileListTransformers,\n });\n\n protected override get __validators() {\n return fileValidators;\n }\n\n private get _fileNames(): string | null {\n if (!hasFiles(this)) {\n return null;\n }\n\n return Array.from(this.files)\n .map((file) => file.name || 'unnamed')\n .join(', ');\n }\n\n /**\n * Indicates whether the file picker dialog is currently active.\n * Used to manage validation on blur.\n */\n @state()\n private _filePickerActive = false;\n\n //#endregion\n\n //#region Public attributes and properties\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the control.\n * Similar to native file input, this property is read-only and cannot be set programmatically.\n * @attr\n */\n @property()\n public set value(value: string) {\n if (value === '' && this._input) {\n this._input.value = value;\n }\n }\n\n public get value(): string {\n return this._input?.value ?? '';\n }\n\n /**\n * Whether the control allows the user to select more than one file.\n *\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public multiple = false;\n\n /**\n * The file types the control accepts, as a comma-separated list.\n * @attr\n */\n @property()\n public accept = '';\n\n /**\n * Whether the control should receive focus automatically.\n * @attr\n */\n @property({ type: Boolean })\n public override autofocus!: boolean;\n\n /** Returns the list of selected files. */\n public get files(): FileList {\n return this._input?.files ?? new DataTransfer().files;\n }\n\n //#endregion\n\n //#region Internal methods\n\n /**\n * A file input cannot have a default file list, so the `value` attribute\n * never contributes a default - otherwise its string would be stored as the\n * FileList default and submitted character-by-character after a form reset.\n */\n protected override _setDefaultValue(): void {\n this._formValue.defaultValue = null;\n }\n\n /**\n * Restores directly instead of through the `value` setter: the setter is\n * deliberately inert (read-only semantics) and never updates the form state.\n */\n protected override _restoreDefaultValue(): void {\n if (this._input) {\n this._input.value = '';\n }\n this._formValue.setValueAndFormState(this._formValue.defaultValue);\n this.requestUpdate();\n }\n\n //#endregion\n\n //#region Event Handlers\n\n private _handleChange(): void {\n this._filePickerActive = false;\n this._setTouchedState();\n this._formValue.setValueAndFormState(this.files);\n\n this.requestUpdate();\n this.emitEvent('igcChange', { detail: this.files });\n }\n\n private _handleCancel(): void {\n this._filePickerActive = false;\n this._setTouchedState();\n this._validate();\n\n this.emitEvent('igcCancel', { detail: this.files });\n }\n\n protected override _handleBlur(): void {\n this._filePickerActive ? this._validate() : super._handleBlur();\n }\n\n protected _handleClick(): void {\n this._filePickerActive = true;\n }\n\n /**\n * Focuses the native input and opens the file picker. Delegated focus alone\n * goes to the browse button.\n */\n protected override _handleLabelActivation(): void {\n this._input?.focus();\n this._input?.click();\n }\n\n //#endregion\n\n protected override _renderFileParts() {\n const emptyText =\n this.placeholder ?? this.resourceStrings.file_input_placeholder;\n\n return html`\n <div part=\"file-parts\">\n <div part=\"file-selector-button\">\n <igc-button variant=\"flat\" ?disabled=${this.disabled} tabindex=\"-1\">\n <slot name=\"file-selector-text\"\n >${this.resourceStrings.file_input_upload_button}</slot\n >\n </igc-button>\n </div>\n <div part=\"file-names\">\n <span>\n ${\n this._fileNames ??\n html`<slot name=\"file-missing-text\">${emptyText}</slot>`\n }\n </span>\n </div>\n </div>\n `;\n }\n\n protected override _renderInput() {\n const hasNegativeTabIndex = this.getAttribute('tabindex') === '-1';\n\n return html`\n <input\n ${ariaBindings(this._ariaTarget.resolveBindings())}\n id=${this._inputId}\n part=${partMap(this._resolvePartNames('input'))}\n type=\"file\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?autofocus=${this.autofocus}\n ?multiple=${this.multiple}\n tabindex=${bindIf(hasNegativeTabIndex, -1)}\n accept=${bindIf(this.accept, this.accept)}\n @click=${this._handleClick}\n @change=${this._handleChange}\n @cancel=${this._handleCancel}\n @blur=${this._handleBlur}\n />\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-file-input': IgcFileInputComponent;\n }\n}\n"]}
@@ -96,7 +96,7 @@ export default class IgcIconComponent extends LitElement {
96
96
  protected update(props: PropertyValues<this>): void;
97
97
  protected firstUpdated(): void;
98
98
  private _getIcon;
99
- protected render(): typeof nothing | import("lit-html").TemplateResult<1>;
99
+ protected render(): import("lit-html").TemplateResult<1> | typeof nothing;
100
100
  protected registerIcon(name: string, url: string, collection?: string, stripMeta?: boolean): Promise<void>;
101
101
  protected registerIconFromText(name: string, iconText: string, collection?: string, stripMeta?: boolean): void;
102
102
  protected setIconRef(name: string, collection: string, icon: IconMeta): void;
@@ -1,15 +1,15 @@
1
1
  import type { Theme } from '#theming/types.js';
2
2
  import type { IconCallback, IconMeta, IconReferencePair, RegisterIconOptions, SvgIcon } from './registry/types.js';
3
3
  /**
4
- * Global singleton registry for managing SVG icons and their references.
4
+ * The global registry of SVG icons and their references.
5
5
  *
6
6
  * @remarks
7
- * The registry stores SVG icons in named collections, resolves aliases against
8
- * the active theme, notifies subscribers once per microtask however many icons
9
- * changed, and publishes user-set state to other browsing contexts (see
10
- * {@link IconsStateBroadcast}).
7
+ * The registry keeps the icons in named collections, resolves an alias against
8
+ * the active theme, notifies the subscribers one time per microtask however
9
+ * many icons changed, and publishes user-set state to the other browsing
10
+ * contexts. See {@link IconsStateBroadcast}.
11
11
  *
12
- * @internal Not exposed directly - use the exported functions.
12
+ * @internal Use the exported functions.
13
13
  */
14
14
  declare class IconsRegistry {
15
15
  private readonly _listeners;
@@ -1 +1 @@
1
- {"version":3,"file":"icon.registry.js","sourceRoot":"","sources":["../../../src/components/icon/icon.registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AASrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMjD,SAAS,kBAAkB,CACzB,mBAAkD;IAElD,IAAI,OAAO,mBAAmB,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC/D,CAAC;IAED,OAAO;QACL,UAAU,EAAE,mBAAmB,EAAE,UAAU,IAAI,SAAS;QACxD,SAAS,EAAE,mBAAmB,EAAE,SAAS,IAAI,KAAK;KACnD,CAAC;AACJ,CAAC;AAGD,SAAS,YAAY,CACnB,WAA+B,EAC/B,IAAY;IAEZ,IAAI,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAEvC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QACvB,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAaD,MAAM,aAAa;IAAnB;QACmB,eAAU,GAAG,IAAI,GAAG,EAAgB,CAAC;QACrC,gBAAW,GAA8B,IAAI,GAAG,EAAE,CAAC;QACnD,iBAAY,GAA6B,IAAI,GAAG,CAAC;YAChE,CAAC,UAAU,EAAE,aAAa,CAAC;SAC5B,CAAC,CAAC;QACc,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gC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IACtE,CAAC;AACH,CAAC;AA8CD,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,QAAgB,EAChB,mBAAkD;IAElD,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAC1E,eAAe,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;AACpE,CAAC;AAmCD,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,UAAkB,EAAE,IAAc;IACzE,eAAe,EAAE,CAAC,UAAU,CAAC;QAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;QAC3B,MAAM,EAAE;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,IAAI;SACf;QACD,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Theme } from '#theming/types.js';\nimport { ICON_REFERENCES } from './icon-references.js';\nimport { IconsStateBroadcast } from './icon-state.broadcast.js';\nimport { internalIcons } from './internal-icons-lib.js';\nimport { SvgIconParser } from './registry/parser.js';\nimport type {\n IconCallback,\n IconMeta,\n IconReferencePair,\n IconsCollection,\n RegisterIconOptions,\n SvgIcon,\n} from './registry/types.js';\nimport { ActionType } from './registry/types.js';\n\n/**\n * Normalizes the third argument of `registerIcon` / `registerIconFromText`,\n * which is either a collection name or a {@link RegisterIconOptions} object.\n */\nfunction resolveIconOptions(\n collectionOrOptions?: string | RegisterIconOptions\n): Required<RegisterIconOptions> {\n if (typeof collectionOrOptions === 'string') {\n return { collection: collectionOrOptions, stripMeta: false };\n }\n\n return {\n collection: collectionOrOptions?.collection ?? 'default',\n stripMeta: collectionOrOptions?.stripMeta ?? false,\n };\n}\n\n/** Returns the named collection, creating it when absent. */\nfunction collectionOf<V>(\n collections: IconsCollection<V>,\n name: string\n): Map<string, V> {\n let collection = collections.get(name);\n\n if (!collection) {\n collection = new Map();\n collections.set(name, collection);\n }\n\n return collection;\n}\n\n/**\n * Global singleton registry for managing SVG icons and their references.\n *\n * @remarks\n * The registry stores SVG icons in named collections, resolves aliases against\n * the active theme, notifies subscribers once per microtask however many icons\n * changed, and publishes user-set state to other browsing contexts (see\n * {@link IconsStateBroadcast}).\n *\n * @internal Not exposed directly - use the exported functions.\n */\nclass IconsRegistry {\n private readonly _listeners = new Set<IconCallback>();\n private readonly _references: IconsCollection<IconMeta> = new Map();\n private readonly _collections: IconsCollection<SvgIcon> = new Map([\n ['internal', internalIcons],\n ]);\n private readonly _svgIconParser = new SvgIconParser();\n private readonly _broadcast = new IconsStateBroadcast(\n this._collections,\n this._references\n );\n private _notificationScheduled = false;\n\n /**\n * Parses and stores an SVG icon, then publishes and notifies.\n *\n * @param stripMeta - See {@link RegisterIconOptions.stripMeta}.\n * @throws If the SVG text is malformed.\n */\n public register(\n name: string,\n iconText: string,\n collection = 'default',\n stripMeta = false\n ): void {\n const svgIcon = this._svgIconParser.parse(iconText, stripMeta);\n collectionOf(this._collections, collection).set(name, svgIcon);\n\n this._broadcast.send({\n actionType: ActionType.RegisterIcon,\n collections: new Map([[collection, new Map([[name, svgIcon]])]]),\n });\n\n this._notify();\n }\n\n /**\n * Subscribes a callback to registry changes. It is invoked once per\n * microtask, however many icons changed, so subscribers re-resolve their\n * own state.\n */\n public subscribe(callback: IconCallback): void {\n this._listeners.add(callback);\n }\n\n /** Unsubscribes a previously subscribed callback. */\n public unsubscribe(callback: IconCallback): void {\n this._listeners.delete(callback);\n }\n\n /**\n * Aliases an icon name to another icon.\n *\n * @remarks\n * `overwrite` stores the reference and notifies subscribers; `external`\n * marks it as user-set, which takes precedence over the built-in theme\n * aliases and is published to other browsing contexts.\n */\n public setIconRef(options: IconReferencePair): void {\n const { alias, target, overwrite } = options;\n\n if (overwrite) {\n collectionOf(this._references, alias.collection).set(alias.name, {\n name: target.name,\n collection: target.collection,\n external: target.external,\n });\n this._notify();\n }\n\n if (target.external) {\n const ref = { name: target.name, collection: target.collection };\n\n this._broadcast.send({\n actionType: ActionType.UpdateIconReference,\n references: new Map([[alias.collection, new Map([[alias.name, ref]])]]),\n });\n }\n }\n\n /**\n * Resolves a name that may be an alias to the icon it points at, for the\n * given theme. The result never carries the internal `external` flag.\n */\n public getIconRef(name: string, collection: string, theme?: Theme): IconMeta {\n // Check for any user-set reference first (external or internal)\n const storedRef = this._references.get(collection)?.get(name);\n if (storedRef) {\n return {\n name: storedRef.name,\n collection: storedRef.collection,\n };\n }\n\n // Resolve theme-based alias for the default collection\n if (collection === 'default' && theme) {\n const targets = ICON_REFERENCES.get(name);\n const target = targets?.get(theme) ?? targets?.get('default');\n\n if (target) {\n return target;\n }\n }\n\n return { name, collection };\n }\n\n /** Retrieves an icon. Resolve aliases with `getIconRef` first. */\n public get(name: string, collection = 'default'): SvgIcon | undefined {\n return this._collections.get(collection)?.get(name);\n }\n\n /**\n * Notifies subscribers, coalescing a burst of changes in the same microtask\n * into a single notification.\n */\n private _notify(): void {\n if (this._notificationScheduled) {\n return;\n }\n\n this._notificationScheduled = true;\n\n queueMicrotask(() => {\n this._notificationScheduled = false;\n\n for (const listener of this._listeners) {\n listener();\n }\n });\n }\n}\n\nconst registry = Symbol.for('igc.icons-registry.instance');\n\ntype IgcIconRegistry = typeof globalThis & {\n [registry]?: IconsRegistry;\n};\n\n/**\n * Gets the icon registry, creating it on first use. The well-known symbol on\n * `globalThis` keeps it a single instance even across multiple bundles.\n */\nexport function getIconRegistry(): IconsRegistry {\n const global = globalThis as IgcIconRegistry;\n global[registry] ??= new IconsRegistry();\n return global[registry];\n}\n\n/**\n * Registers an icon by fetching it from a URL.\n *\n * @param name - The unique name for the icon\n * @param url - The URL to fetch the SVG icon from\n * @param collection - The collection to register the icon in (default: `'default'`)\n *\n * @returns A promise that resolves when the icon is registered\n *\n * @throws If the HTTP request fails or returns a non-OK status\n */\nexport async function registerIcon(\n name: string,\n url: string,\n collection?: string\n): Promise<void>;\n\n/**\n * Registers an icon by fetching it from a URL.\n *\n * @param name - The unique name for the icon\n * @param url - The URL to fetch the SVG icon from\n * @param options - Registration options: target collection and/or `stripMeta`\n *\n * @returns A promise that resolves when the icon is registered\n *\n * @throws If the HTTP request fails or returns a non-OK status\n *\n * @remarks\n * This overload accepts a {@link RegisterIconOptions} object so you can control\n * the target collection **and** opt into SVG meta stripping in one call:\n *\n * ```typescript\n * // Strip <title>/<desc> to prevent browser-native tooltips on hover\n * await registerIcon('home', '/icons/home.svg', { stripMeta: true });\n *\n * // Or with a custom collection:\n * await registerIcon('home', '/icons/home.svg', {\n * collection: 'my-lib',\n * stripMeta: true,\n * });\n * ```\n */\nexport async function registerIcon(\n name: string,\n url: string,\n options?: RegisterIconOptions\n): Promise<void>;\n\nexport async function registerIcon(\n name: string,\n url: string,\n collectionOrOptions?: string | RegisterIconOptions\n): Promise<void> {\n const { collection, stripMeta } = resolveIconOptions(collectionOrOptions);\n const response = await fetch(url);\n\n if (response.ok) {\n const value = await response.text();\n getIconRegistry().register(name, value, collection, stripMeta);\n } else {\n throw new Error(`Icon request failed. Status: ${response.status}.`);\n }\n}\n\n/**\n * Registers an icon from SVG text content.\n *\n * @param name - The unique name for the icon\n * @param iconText - The SVG markup as a string\n * @param collection - The collection to register the icon in (default: `'default'`)\n *\n * @throws If the SVG text is malformed or doesn't contain an SVG element\n */\nexport function registerIconFromText(\n name: string,\n iconText: string,\n collection?: string\n): void;\n\n/**\n * Registers an icon from SVG text content.\n *\n * @param name - The unique name for the icon\n * @param iconText - The SVG markup as a string\n * @param options - Registration options: target collection and/or `stripMeta`\n *\n * @throws If the SVG text is malformed or doesn't contain an SVG element\n *\n * @remarks\n * This overload accepts a {@link RegisterIconOptions} object so you can control\n * the target collection **and** opt into SVG meta stripping in one call:\n *\n * ```typescript\n * const iconSvg = '<svg viewBox=\"0 0 24 24\"><title>Home</title><path d=\"...\"/></svg>';\n *\n * // Strip <title>/<desc> to prevent browser-native tooltips on hover\n * registerIconFromText('home', iconSvg, { stripMeta: true });\n *\n * // Or with a custom collection:\n * registerIconFromText('home', iconSvg, { collection: 'my-lib', stripMeta: true });\n * ```\n */\nexport function registerIconFromText(\n name: string,\n iconText: string,\n options?: RegisterIconOptions\n): void;\n\nexport function registerIconFromText(\n name: string,\n iconText: string,\n collectionOrOptions?: string | RegisterIconOptions\n): void {\n const { collection, stripMeta } = resolveIconOptions(collectionOrOptions);\n getIconRegistry().register(name, iconText, collection, stripMeta);\n}\n\n/**\n * Sets an icon reference/alias that points to another icon.\n *\n * @param name - The alias name\n * @param collection - The collection for the alias\n * @param icon - The target icon metadata (name and collection)\n *\n * @remarks\n * Icon references allow you to create aliases that point to other icons.\n * This is useful for:\n * - Creating semantic names (e.g., 'close' → 'x')\n * - Overriding default icon mappings\n * - Providing fallbacks for missing icons\n *\n * User-set references are marked as external and have higher priority than\n * theme-based aliases. They are also published to other browsing contexts.\n *\n * @example\n * ```typescript\n * // Register target icon\n * registerIconFromText('x-mark', '<svg>...</svg>');\n *\n * // Create an alias\n * setIconRef('close', 'default', {\n * name: 'x-mark',\n * collection: 'default'\n * });\n *\n * // Both work the same way:\n * // <igc-icon name=\"close\"></igc-icon>\n * // <igc-icon name=\"x-mark\"></igc-icon>\n * ```\n */\nexport function setIconRef(name: string, collection: string, icon: IconMeta) {\n getIconRegistry().setIconRef({\n alias: { name, collection },\n target: {\n name: icon.name,\n collection: icon.collection,\n external: true,\n },\n overwrite: true,\n });\n}\n"]}
1
+ {"version":3,"file":"icon.registry.js","sourceRoot":"","sources":["../../../src/components/icon/icon.registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MA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AU,CAAC,IAAY,EAAE,UAAkB,EAAE,IAAc;IACzE,eAAe,EAAE,CAAC,UAAU,CAAC;QAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;QAC3B,MAAM,EAAE;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,IAAI;SACf;QACD,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Theme } from '#theming/types.js';\nimport { ICON_REFERENCES } from './icon-references.js';\nimport { IconsStateBroadcast } from './icon-state.broadcast.js';\nimport { internalIcons } from './internal-icons-lib.js';\nimport { SvgIconParser } from './registry/parser.js';\nimport type {\n IconCallback,\n IconMeta,\n IconReferencePair,\n IconsCollection,\n RegisterIconOptions,\n SvgIcon,\n} from './registry/types.js';\nimport { ActionType } from './registry/types.js';\n\n/**\n * Normalizes the third argument of `registerIcon` / `registerIconFromText`,\n * which is either a collection name or a {@link RegisterIconOptions} object.\n */\nfunction resolveIconOptions(\n collectionOrOptions?: string | RegisterIconOptions\n): Required<RegisterIconOptions> {\n if (typeof collectionOrOptions === 'string') {\n return { collection: collectionOrOptions, stripMeta: false };\n }\n\n return {\n collection: collectionOrOptions?.collection ?? 'default',\n stripMeta: collectionOrOptions?.stripMeta ?? false,\n };\n}\n\n/** Returns the named collection, creating it when absent. */\nfunction collectionOf<V>(\n collections: IconsCollection<V>,\n name: string\n): Map<string, V> {\n let collection = collections.get(name);\n\n if (!collection) {\n collection = new Map();\n collections.set(name, collection);\n }\n\n return collection;\n}\n\n/**\n * The global registry of SVG icons and their references.\n *\n * @remarks\n * The registry keeps the icons in named collections, resolves an alias against\n * the active theme, notifies the subscribers one time per microtask however\n * many icons changed, and publishes user-set state to the other browsing\n * contexts. See {@link IconsStateBroadcast}.\n *\n * @internal Use the exported functions.\n */\nclass IconsRegistry {\n private readonly _listeners = new Set<IconCallback>();\n private readonly _references: IconsCollection<IconMeta> = new Map();\n private readonly _collections: IconsCollection<SvgIcon> = new Map([\n ['internal', internalIcons],\n ]);\n private readonly _svgIconParser = new SvgIconParser();\n private readonly _broadcast = new IconsStateBroadcast(\n this._collections,\n this._references\n );\n private _notificationScheduled = false;\n\n /**\n * Parses and stores an SVG icon, then publishes and notifies.\n *\n * @param stripMeta - See {@link RegisterIconOptions.stripMeta}.\n * @throws If the SVG text is malformed.\n */\n public register(\n name: string,\n iconText: string,\n collection = 'default',\n stripMeta = false\n ): void {\n const svgIcon = this._svgIconParser.parse(iconText, stripMeta);\n collectionOf(this._collections, collection).set(name, svgIcon);\n\n this._broadcast.send({\n actionType: ActionType.RegisterIcon,\n collections: new Map([[collection, new Map([[name, svgIcon]])]]),\n });\n\n this._notify();\n }\n\n /**\n * Subscribes a callback to registry changes. It is invoked once per\n * microtask, however many icons changed, so subscribers re-resolve their\n * own state.\n */\n public subscribe(callback: IconCallback): void {\n this._listeners.add(callback);\n }\n\n /** Unsubscribes a previously subscribed callback. */\n public unsubscribe(callback: IconCallback): void {\n this._listeners.delete(callback);\n }\n\n /**\n * Aliases an icon name to another icon.\n *\n * @remarks\n * `overwrite` stores the reference and notifies subscribers; `external`\n * marks it as user-set, which takes precedence over the built-in theme\n * aliases and is published to other browsing contexts.\n */\n public setIconRef(options: IconReferencePair): void {\n const { alias, target, overwrite } = options;\n\n if (overwrite) {\n collectionOf(this._references, alias.collection).set(alias.name, {\n name: target.name,\n collection: target.collection,\n external: target.external,\n });\n this._notify();\n }\n\n if (target.external) {\n const ref = { name: target.name, collection: target.collection };\n\n this._broadcast.send({\n actionType: ActionType.UpdateIconReference,\n references: new Map([[alias.collection, new Map([[alias.name, ref]])]]),\n });\n }\n }\n\n /**\n * Resolves a name that may be an alias to the icon it points at, for the\n * given theme. The result never carries the internal `external` flag.\n */\n public getIconRef(name: string, collection: string, theme?: Theme): IconMeta {\n // Check for any user-set reference first (external or internal)\n const storedRef = this._references.get(collection)?.get(name);\n if (storedRef) {\n return {\n name: storedRef.name,\n collection: storedRef.collection,\n };\n }\n\n // Resolve theme-based alias for the default collection\n if (collection === 'default' && theme) {\n const targets = ICON_REFERENCES.get(name);\n const target = targets?.get(theme) ?? targets?.get('default');\n\n if (target) {\n return target;\n }\n }\n\n return { name, collection };\n }\n\n /** Retrieves an icon. Resolve aliases with `getIconRef` first. */\n public get(name: string, collection = 'default'): SvgIcon | undefined {\n return this._collections.get(collection)?.get(name);\n }\n\n /**\n * Notifies subscribers, coalescing a burst of changes in the same microtask\n * into a single notification.\n */\n private _notify(): void {\n if (this._notificationScheduled) {\n return;\n }\n\n this._notificationScheduled = true;\n\n queueMicrotask(() => {\n this._notificationScheduled = false;\n\n for (const listener of this._listeners) {\n listener();\n }\n });\n }\n}\n\nconst registry = Symbol.for('igc.icons-registry.instance');\n\ntype IgcIconRegistry = typeof globalThis & {\n [registry]?: IconsRegistry;\n};\n\n/**\n * Gets the icon registry, creating it on first use. The well-known symbol on\n * `globalThis` keeps it a single instance even across multiple bundles.\n */\nexport function getIconRegistry(): IconsRegistry {\n const global = globalThis as IgcIconRegistry;\n global[registry] ??= new IconsRegistry();\n return global[registry];\n}\n\n/**\n * Registers an icon by fetching it from a URL.\n *\n * @param name - The unique name for the icon\n * @param url - The URL to fetch the SVG icon from\n * @param collection - The collection to register the icon in (default: `'default'`)\n *\n * @returns A promise that resolves when the icon is registered\n *\n * @throws If the HTTP request fails or returns a non-OK status\n */\nexport async function registerIcon(\n name: string,\n url: string,\n collection?: string\n): Promise<void>;\n\n/**\n * Registers an icon by fetching it from a URL.\n *\n * @param name - The unique name for the icon\n * @param url - The URL to fetch the SVG icon from\n * @param options - Registration options: target collection and/or `stripMeta`\n *\n * @returns A promise that resolves when the icon is registered\n *\n * @throws If the HTTP request fails or returns a non-OK status\n *\n * @remarks\n * This overload accepts a {@link RegisterIconOptions} object so you can control\n * the target collection **and** opt into SVG meta stripping in one call:\n *\n * ```typescript\n * // Strip <title>/<desc> to prevent browser-native tooltips on hover\n * await registerIcon('home', '/icons/home.svg', { stripMeta: true });\n *\n * // Or with a custom collection:\n * await registerIcon('home', '/icons/home.svg', {\n * collection: 'my-lib',\n * stripMeta: true,\n * });\n * ```\n */\nexport async function registerIcon(\n name: string,\n url: string,\n options?: RegisterIconOptions\n): Promise<void>;\n\nexport async function registerIcon(\n name: string,\n url: string,\n collectionOrOptions?: string | RegisterIconOptions\n): Promise<void> {\n const { collection, stripMeta } = resolveIconOptions(collectionOrOptions);\n const response = await fetch(url);\n\n if (response.ok) {\n const value = await response.text();\n getIconRegistry().register(name, value, collection, stripMeta);\n } else {\n throw new Error(`Icon request failed. Status: ${response.status}.`);\n }\n}\n\n/**\n * Registers an icon from SVG text content.\n *\n * @param name - The unique name for the icon\n * @param iconText - The SVG markup as a string\n * @param collection - The collection to register the icon in (default: `'default'`)\n *\n * @throws If the SVG text is malformed or doesn't contain an SVG element\n */\nexport function registerIconFromText(\n name: string,\n iconText: string,\n collection?: string\n): void;\n\n/**\n * Registers an icon from SVG text content.\n *\n * @param name - The unique name for the icon\n * @param iconText - The SVG markup as a string\n * @param options - Registration options: target collection and/or `stripMeta`\n *\n * @throws If the SVG text is malformed or doesn't contain an SVG element\n *\n * @remarks\n * This overload accepts a {@link RegisterIconOptions} object so you can control\n * the target collection **and** opt into SVG meta stripping in one call:\n *\n * ```typescript\n * const iconSvg = '<svg viewBox=\"0 0 24 24\"><title>Home</title><path d=\"...\"/></svg>';\n *\n * // Strip <title>/<desc> to prevent browser-native tooltips on hover\n * registerIconFromText('home', iconSvg, { stripMeta: true });\n *\n * // Or with a custom collection:\n * registerIconFromText('home', iconSvg, { collection: 'my-lib', stripMeta: true });\n * ```\n */\nexport function registerIconFromText(\n name: string,\n iconText: string,\n options?: RegisterIconOptions\n): void;\n\nexport function registerIconFromText(\n name: string,\n iconText: string,\n collectionOrOptions?: string | RegisterIconOptions\n): void {\n const { collection, stripMeta } = resolveIconOptions(collectionOrOptions);\n getIconRegistry().register(name, iconText, collection, stripMeta);\n}\n\n/**\n * Sets an icon reference/alias that points to another icon.\n *\n * @param name - The alias name\n * @param collection - The collection for the alias\n * @param icon - The target icon metadata (name and collection)\n *\n * @remarks\n * Icon references allow you to create aliases that point to other icons.\n * This is useful for:\n * - Creating semantic names (e.g., 'close' → 'x')\n * - Overriding default icon mappings\n * - Providing fallbacks for missing icons\n *\n * User-set references are marked as external and have higher priority than\n * theme-based aliases. They are also published to other browsing contexts.\n *\n * @example\n * ```typescript\n * // Register target icon\n * registerIconFromText('x-mark', '<svg>...</svg>');\n *\n * // Create an alias\n * setIconRef('close', 'default', {\n * name: 'x-mark',\n * collection: 'default'\n * });\n *\n * // Both work the same way:\n * // <igc-icon name=\"close\"></igc-icon>\n * // <igc-icon name=\"x-mark\"></igc-icon>\n * ```\n */\nexport function setIconRef(name: string, collection: string, icon: IconMeta) {\n getIconRegistry().setIconRef({\n alias: { name, collection },\n target: {\n name: icon.name,\n collection: icon.collection,\n external: true,\n },\n overwrite: true,\n });\n}\n"]}
@@ -15,8 +15,8 @@ export declare abstract class IgcInputBaseComponent extends IgcInputBaseComponen
15
15
  protected readonly _inputId: string;
16
16
  protected readonly _input?: HTMLInputElement;
17
17
  /**
18
- * Receives ARIA semantics projected by a composite host (e.g. `igc-select`)
19
- * onto the inner native input. See {@link addAriaTarget}.
18
+ * Names and describes the native input, and applies the ARIA that a
19
+ * composite host, for example `igc-select`, projects. See {@link addAriaTarget}.
20
20
  */
21
21
  protected readonly _ariaTarget: import("#internals/controllers/aria-projection.js").AriaTargetController;
22
22
  /** The value of the control. */
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { LitElement, nothing } from 'lit';
8
8
  import { property, query } from 'lit/decorators.js';
9
9
  import { cache } from 'lit/directives/cache.js';
10
- import { addAriaTarget } from '#internals/controllers/aria-projection.js';
10
+ import { addAriaTarget, helperText, } from '#internals/controllers/aria-projection.js';
11
11
  import { blazorDeepImport } from '#internals/decorators/blazorDeepImport.js';
12
12
  import { shadowOptions } from '#internals/decorators/shadow-options.js';
13
13
  import { EventEmitterMixin } from '#internals/mixins/event-emitter.js';
@@ -18,10 +18,8 @@ let IgcInputBaseComponent = class IgcInputBaseComponent extends FormAssociatedRe
18
18
  super(...arguments);
19
19
  this._inputId = nextInputId();
20
20
  this._ariaTarget = addAriaTarget(this, {
21
- labels: () => this._internals.labels,
22
- description: () => this._slots.hasAssignedElements('helper-text')
23
- ? this.renderRoot.querySelector('#helper-text')
24
- : null,
21
+ description: () => helperText(this, this._slots),
22
+ hasOwnLabel: () => Boolean(this.label),
25
23
  });
26
24
  this.outlined = false;
27
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"input-base.js","sourceRoot":"","sources":["../../../src/components/input/input-base.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,qCAAqC,CAAC;AAoBtC,IAAe,qBAAqB,GAApC,MAAe,qBAAsB,SAAQ,2BAA2B,CAC7E,iBAAiB,CACf,UAAU,CACX,CACF;IAJM;;QAQc,aAAQ,GAAG,WAAW,EAAE,CAAC;QASzB,gBAAW,GAAG,aAAa,CAAC,IAAI,EAAE;YACnD,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UA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AAOrB;IADN,QAAQ,EAAE;oDACW;AAlDF,qBAAqB;IAF1C,gBAAgB;IAChB,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;GAClB,qBAAqB,CA+F1C","sourcesContent":["import { LitElement, nothing, type TemplateResult } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { cache } from 'lit/directives/cache.js';\nimport { addAriaTarget } from '#internals/controllers/aria-projection.js';\nimport type { SlotController } from '#internals/controllers/slot.js';\nimport { blazorDeepImport } from '#internals/decorators/blazorDeepImport.js';\nimport { shadowOptions } from '#internals/decorators/shadow-options.js';\nimport type { Constructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '#internals/mixins/forms/associated-required.js';\nimport {\n nextInputId,\n renderInputShell,\n resolveInputPartNames,\n} from '#internals/templates/input-shell.js';\nimport type { ThemingController } from '#theming/theming-controller.js';\n\nexport interface IgcInputComponentEventMap {\n /* alternateName: inputOcurred */\n igcInput: CustomEvent<string>;\n /* blazorSuppress */\n igcChange: CustomEvent<string>;\n // For analyzer meta only:\n /* skipWCPrefix */\n focus: FocusEvent;\n /* skipWCPrefix */\n blur: FocusEvent;\n}\n\n/* blazorIndirectRender */\n/* blazorSupportsVisualChildren */\n/* omitModule */\n@blazorDeepImport\n@shadowOptions({ delegatesFocus: true })\nexport abstract class IgcInputBaseComponent extends FormAssociatedRequiredMixin(\n EventEmitterMixin<IgcInputComponentEventMap, Constructor<LitElement>>(\n LitElement\n )\n) {\n protected abstract readonly _themes: ThemingController;\n protected abstract readonly _slots: SlotController<any>;\n\n protected readonly _inputId = nextInputId();\n\n @query('input')\n protected readonly _input?: HTMLInputElement;\n\n /**\n * Receives ARIA semantics projected by a composite host (e.g. `igc-select`)\n * onto the inner native input. See {@link addAriaTarget}.\n */\n protected readonly _ariaTarget = addAriaTarget(this, {\n labels: () => this._internals.labels,\n description: () =>\n this._slots.hasAssignedElements('helper-text')\n ? this.renderRoot.querySelector('#helper-text')\n : null,\n });\n\n /* blazorSuppress */\n /** The value of the control. */\n public abstract value: string;\n\n /**\n * Whether the control will have outlined appearance.\n *\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public outlined = false;\n\n /**\n * The placeholder text of the control.\n * @attr\n */\n @property()\n public placeholder!: string;\n\n /**\n * The label for the control.\n * @attr\n */\n @property()\n public label!: string;\n\n /**\n * Resolves the part names for the container based on the current state.\n * Used to apply conditional styling via CSS parts.\n */\n protected _resolvePartNames(base: string) {\n return resolveInputPartNames(this._slots, base, !!this.value);\n }\n\n /** Selects all the text inside the input. */\n public select(): void {\n this._input?.select();\n }\n\n /* alternateName: focusComponent */\n /** Sets focus on the control. */\n public override focus(options?: FocusOptions): void {\n this._input?.focus(options);\n }\n\n /* alternateName: blurComponent */\n /** Removes focus from the control. */\n public override blur(): void {\n this._input?.blur();\n }\n\n protected abstract _renderInput(): TemplateResult;\n\n protected _renderFileParts(): TemplateResult | typeof nothing {\n return nothing;\n }\n\n protected override render() {\n return cache(\n renderInputShell(this, {\n theme: this._themes.theme,\n label: this.label,\n labelId: this._inputId,\n containerParts: this._resolvePartNames('container'),\n renderInput: this._renderInput,\n renderFileParts: this._renderFileParts,\n })\n );\n }\n}\n"]}
1
+ {"version":3,"file":"input-base.js","sourceRoot":"","sources":["../../../src/components/input/input-base.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EACL,aAAa,EACb,UAAU,GACX,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,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iB,CAAC,WAAW,CAAC;YACnD,WAAW,EAAE,IAAI,CAAC,YAAY;YAC9B,eAAe,EAAE,IAAI,CAAC,gBAAgB;SACvC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAA;AAjFoB;IADlB,KAAK,CAAC,OAAO,CAAC;qDAC8B;AAsBtC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDACnB;AAOjB;IADN,QAAQ,EAAE;0DACiB;AAOrB;IADN,QAAQ,EAAE;oDACW;AA/CF,qBAAqB;IAF1C,gBAAgB;IAChB,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;GAClB,qBAAqB,CA4F1C","sourcesContent":["import { LitElement, nothing, type TemplateResult } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { cache } from 'lit/directives/cache.js';\nimport {\n addAriaTarget,\n helperText,\n} from '#internals/controllers/aria-projection.js';\nimport type { SlotController } from '#internals/controllers/slot.js';\nimport { blazorDeepImport } from '#internals/decorators/blazorDeepImport.js';\nimport { shadowOptions } from '#internals/decorators/shadow-options.js';\nimport type { Constructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '#internals/mixins/forms/associated-required.js';\nimport {\n nextInputId,\n renderInputShell,\n resolveInputPartNames,\n} from '#internals/templates/input-shell.js';\nimport type { ThemingController } from '#theming/theming-controller.js';\n\nexport interface IgcInputComponentEventMap {\n /* alternateName: inputOcurred */\n igcInput: CustomEvent<string>;\n /* blazorSuppress */\n igcChange: CustomEvent<string>;\n // For analyzer meta only:\n /* skipWCPrefix */\n focus: FocusEvent;\n /* skipWCPrefix */\n blur: FocusEvent;\n}\n\n/* blazorIndirectRender */\n/* blazorSupportsVisualChildren */\n/* omitModule */\n@blazorDeepImport\n@shadowOptions({ delegatesFocus: true })\nexport abstract class IgcInputBaseComponent extends FormAssociatedRequiredMixin(\n EventEmitterMixin<IgcInputComponentEventMap, Constructor<LitElement>>(\n LitElement\n )\n) {\n protected abstract readonly _themes: ThemingController;\n protected abstract readonly _slots: SlotController<any>;\n\n protected readonly _inputId = nextInputId();\n\n @query('input')\n protected readonly _input?: HTMLInputElement;\n\n /**\n * Names and describes the native input, and applies the ARIA that a\n * composite host, for example `igc-select`, projects. See {@link addAriaTarget}.\n */\n protected readonly _ariaTarget = addAriaTarget(this, {\n description: () => helperText(this, this._slots),\n hasOwnLabel: () => Boolean(this.label),\n });\n\n /* blazorSuppress */\n /** The value of the control. */\n public abstract value: string;\n\n /**\n * Whether the control will have outlined appearance.\n *\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public outlined = false;\n\n /**\n * The placeholder text of the control.\n * @attr\n */\n @property()\n public placeholder!: string;\n\n /**\n * The label for the control.\n * @attr\n */\n @property()\n public label!: string;\n\n /**\n * Resolves the part names for the container based on the current state.\n * Used to apply conditional styling via CSS parts.\n */\n protected _resolvePartNames(base: string) {\n return resolveInputPartNames(this._slots, base, !!this.value);\n }\n\n /** Selects all the text inside the input. */\n public select(): void {\n this._input?.select();\n }\n\n /* alternateName: focusComponent */\n /** Sets focus on the control. */\n public override focus(options?: FocusOptions): void {\n this._input?.focus(options);\n }\n\n /* alternateName: blurComponent */\n /** Removes focus from the control. */\n public override blur(): void {\n this._input?.blur();\n }\n\n protected abstract _renderInput(): TemplateResult;\n\n protected _renderFileParts(): TemplateResult | typeof nothing {\n return nothing;\n }\n\n protected override render() {\n return cache(\n renderInputShell(this, {\n theme: this._themes.theme,\n label: this.label,\n labelId: this._inputId,\n containerParts: this._resolvePartNames('container'),\n renderInput: this._renderInput,\n renderFileParts: this._renderFileParts,\n })\n );\n }\n}\n"]}
@@ -10,7 +10,7 @@ import { IgcInputBaseComponent } from './input-base.js';
10
10
  * @slot suffix - Renders content after input.
11
11
  * @slot helper-text - Renders content below the input.
12
12
  * @slot value-missing - Renders content when the required validation fails.
13
- * @slot type-mismatch - Renders content when the a type url/email input pattern validation fails.
13
+ * @slot type-mismatch - Renders content when the url/email type validation fails.
14
14
  * @slot pattern-mismatch - Renders content when the pattern validation fails.
15
15
  * @slot too-long - Renders content when the maxlength validation fails.
16
16
  * @slot too-short - Renders content when the minlength validation fails.
@@ -21,7 +21,7 @@ import { IgcInputBaseComponent } from './input-base.js';
21
21
  * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).
22
22
  *
23
23
  * @fires igcInput - Emitted when the control input receives user input.
24
- * @fires igcChange - Emitted when the control's checked state changes.
24
+ * @fires igcChange - Emitted when the value of the control is committed.
25
25
  *
26
26
  * @csspart container - The main wrapper that holds all main input elements.
27
27
  * @csspart input - The native input element.
@@ -37,7 +37,7 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
37
37
  private static readonly _revalidate;
38
38
  static register(): void;
39
39
  protected readonly _themes: import("#theming/theming-controller.js").ThemingController;
40
- protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "prefix" | "helper-text" | "[default]" | "suffix" | "value-missing" | "too-long" | "too-short" | "custom-error" | "range-overflow" | "range-underflow" | "type-mismatch" | "pattern-mismatch" | "step-mismatch">;
40
+ protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "prefix" | "[default]" | "suffix" | "helper-text" | "value-missing" | "range-overflow" | "range-underflow" | "custom-error" | "too-long" | "too-short" | "type-mismatch" | "pattern-mismatch" | "step-mismatch">;
41
41
  protected readonly _formValue: import("#internals/mixins/forms/form-value.js").FormValue<string>;
42
42
  protected get __validators(): import("../../internals/validators.js").Validator<IgcInputComponent>[];
43
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BA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/B;IAFN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;IAClD,eAAe,CAAC,iBAAiB,CAAC,WAAW,CAAC;oDACT;AAQ/B;IAFN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,CAAC,iBAAiB,CAAC,WAAW,CAAC;8CACf;AAQzB;IAFN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,CAAC,iBAAiB,CAAC,WAAW,CAAC;8CACf;AAQzB;IAFN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,CAAC,iBAAiB,CAAC,WAAW,CAAC;+CACd;AAOjB;IADf,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACQ;AAO7B;IADN,QAAQ,EAAE;uDACkB;AAUtB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;uDAC3C","sourcesContent":["import { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { ariaBindings } from '#internals/controllers/aria-projection.js';\nimport { addSlotController, setSlots } from '#internals/controllers/slot.js';\nimport {\n coercedProperty,\n type CoercedPropertyConfig,\n} from '#internals/decorators/coerced-property.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport { createFormValueState } from '#internals/mixins/forms/form-value.js';\nimport { partMap } from '#internals/part-map.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport type {\n InputType,\n RangeTextSelectMode,\n SelectionRangeDirection,\n} from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { IgcInputBaseComponent } from './input-base.js';\nimport { styles } from './themes/input.base.css.js';\nimport { styles as shared } from './themes/shared/input.common.css.js';\nimport { all } from './themes/themes.js';\nimport { numberValidators, stringValidators } from './validators.js';\n\nconst Slots = setSlots(\n 'prefix',\n 'suffix',\n 'helper-text',\n 'value-missing',\n 'type-mismatch',\n 'pattern-mismatch',\n 'too-long',\n 'too-short',\n 'range-overflow',\n 'range-underflow',\n 'step-mismatch',\n 'custom-error',\n 'invalid'\n);\n\n/**\n * A highly customizable single-line text field for entering and editing data,\n * with support for prefix/suffix content, helper text, form integration, and built-in validation.\n *\n * @element igc-input\n *\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after input.\n * @slot helper-text - Renders content below the input.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot type-mismatch - Renders content when the a type url/email input pattern validation fails.\n * @slot pattern-mismatch - Renders content when the pattern validation fails.\n * @slot too-long - Renders content when the maxlength validation fails.\n * @slot too-short - Renders content when the minlength validation fails.\n * @slot range-overflow - Renders content when the max validation fails.\n * @slot range-underflow - Renders content when the min validation fails.\n * @slot step-mismatch - Renders content when the step 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 igcInput - Emitted when the control input receives user input.\n * @fires igcChange - Emitted when the control's checked state changes.\n *\n * @csspart container - The main wrapper that holds all main input elements.\n * @csspart input - The native input element.\n * @csspart label - The native label element.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart helper-text - The helper text wrapper.\n */\nexport default class IgcInputComponent extends IgcInputBaseComponent {\n public static readonly tagName = 'igc-input';\n public static styles = [styles, shared];\n\n /** Shared config for the constraint properties - a change revalidates. */\n private static readonly _revalidate: CoercedPropertyConfig<\n unknown,\n IgcInputComponent\n > = {\n onChange: ({ host }) => host._validate(),\n };\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcInputComponent, IgcValidationContainerComponent);\n }\n\n protected override readonly _themes = addThemingController(this, all);\n\n protected override readonly _slots = addSlotController(this, {\n slots: Slots,\n });\n\n protected override readonly _formValue = createFormValueState(this, {\n initialValue: '',\n });\n\n protected override get __validators() {\n return this.type !== 'number' ? stringValidators : numberValidators;\n }\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the control.\n * @attr\n */\n @property()\n public set value(value: string) {\n this._formValue.setValueAndFormState(value);\n }\n\n public get value(): string {\n return this._formValue.value;\n }\n\n /* alternateName: displayType */\n /**\n * The type of the control.\n * @attr\n */\n @property({ reflect: true })\n public type: InputType = 'text';\n\n /**\n * Makes the control a readonly field.\n *\n * @attr readonly\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public readOnly = false;\n\n /**\n * A hint to the browser for which virtual keyboard layout to display.\n * See [relevant MDN article](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)\n * @attr inputmode\n */\n @property({ attribute: 'inputmode' })\n public override inputMode!: string;\n\n /**\n * The regular expression the value is validated against.\n * @attr\n */\n @property()\n @coercedProperty(IgcInputComponent._revalidate)\n public pattern?: string = undefined;\n\n /**\n * The minimum string length required by the control.\n * @attr minlength\n */\n @property({ type: Number, attribute: 'minlength' })\n @coercedProperty(IgcInputComponent._revalidate)\n public minLength?: number = undefined;\n\n /**\n * The maximum string length of the control.\n * @attr maxlength\n */\n @property({ type: Number, attribute: 'maxlength' })\n @coercedProperty(IgcInputComponent._revalidate)\n public maxLength?: number = undefined;\n\n /**\n * The minimum value the control accepts.\n * @attr\n */\n @property({ type: Number })\n @coercedProperty(IgcInputComponent._revalidate)\n public min?: number = undefined;\n\n /**\n * The maximum value the control accepts.\n * @attr\n */\n @property({ type: Number })\n @coercedProperty(IgcInputComponent._revalidate)\n public max?: number = undefined;\n\n /**\n * The granularity the value must adhere to.\n * @attr\n */\n @property({ type: Number })\n @coercedProperty(IgcInputComponent._revalidate)\n public step?: number = undefined;\n\n /**\n * Whether the control should receive focus automatically.\n * @attr\n */\n @property({ type: Boolean })\n public override autofocus!: boolean;\n\n /**\n * A hint for the browser on how to autofill the control.\n * @attr\n */\n @property()\n public autocomplete!: string;\n\n /**\n * Enables validation rules to be evaluated without restricting user input. This applies to the `maxLength` property for\n * string-type inputs or allows spin buttons to exceed the predefined `min/max` limits for number-type inputs.\n *\n * @attr validate-only\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'validate-only' })\n public validateOnly = false;\n\n /* blazorSuppress */\n /** Replaces the selected text in the input. */\n public setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode: RangeTextSelectMode = 'preserve'\n ): void {\n this._input?.setRangeText(replacement, start!, end!, selectMode);\n this.value = this._input?.value ?? '';\n }\n\n /* blazorSuppress */\n /** Sets the text selection range of the control */\n public setSelectionRange(\n start?: number,\n end?: number,\n direction: SelectionRangeDirection = 'none'\n ): void {\n this._input?.setSelectionRange(start ?? null, end ?? null, direction);\n }\n\n /** Increments the numeric value of the input by one or more steps. */\n public stepUp(n?: number): void {\n this._input?.stepUp(n);\n this.value = this._input?.value ?? '';\n }\n\n /** Decrements the numeric value of the input by one or more steps. */\n public stepDown(n?: number): void {\n this._input?.stepDown(n);\n this.value = this._input?.value ?? '';\n }\n\n private _handleInput(): void {\n this._commitValue(this._input?.value ?? '', 'igcInput');\n }\n\n private _handleChange(): void {\n this._commitValue(this._input?.value ?? '', 'igcChange');\n }\n\n protected _renderInput() {\n const hasNegativeTabIndex = this.getAttribute('tabindex') === '-1';\n\n return html`\n <input\n ${ariaBindings(this._ariaTarget.resolveBindings())}\n id=${this._inputId}\n part=${partMap(this._resolvePartNames('input'))}\n name=${ifDefined(this.name)}\n type=${ifDefined(this.type)}\n pattern=${ifDefined(this.pattern)}\n placeholder=${ifDefined(this.placeholder)}\n .value=${live(this.value)}\n ?readonly=${this.readOnly}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?autofocus=${this.autofocus}\n tabindex=${bindIf(hasNegativeTabIndex, -1)}\n autocomplete=${ifDefined(this.autocomplete as any)}\n inputmode=${ifDefined(this.inputMode)}\n min=${bindIf(!this.validateOnly, this.min)}\n max=${bindIf(!this.validateOnly, this.max)}\n minlength=${ifDefined(this.minLength)}\n maxlength=${bindIf(!this.validateOnly, this.maxLength)}\n step=${ifDefined(this.step)}\n @keydown=${this._handleEnterKeydown}\n @change=${this._handleChange}\n @input=${this._handleInput}\n @blur=${this._handleBlur}\n />\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-input': IgcInputComponent;\n }\n}\n"]}
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EACL,eAAe,GAEhB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAMtE,OAAO,+BAA+B,MAAM,iDAAiD,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,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'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { ariaBindings } from '#internals/controllers/aria-projection.js';\nimport { addSlotController, setSlots } from '#internals/controllers/slot.js';\nimport {\n coercedProperty,\n type CoercedPropertyConfig,\n} from '#internals/decorators/coerced-property.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport { createFormValueState } from '#internals/mixins/forms/form-value.js';\nimport { partMap } from '#internals/part-map.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport type {\n InputType,\n RangeTextSelectMode,\n SelectionRangeDirection,\n} from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { IgcInputBaseComponent } from './input-base.js';\nimport { styles } from './themes/input.base.css.js';\nimport { styles as shared } from './themes/shared/input.common.css.js';\nimport { all } from './themes/themes.js';\nimport { numberValidators, stringValidators } from './validators.js';\n\nconst Slots = setSlots(\n 'prefix',\n 'suffix',\n 'helper-text',\n 'value-missing',\n 'type-mismatch',\n 'pattern-mismatch',\n 'too-long',\n 'too-short',\n 'range-overflow',\n 'range-underflow',\n 'step-mismatch',\n 'custom-error',\n 'invalid'\n);\n\n/**\n * A highly customizable single-line text field for entering and editing data,\n * with support for prefix/suffix content, helper text, form integration, and built-in validation.\n *\n * @element igc-input\n *\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after input.\n * @slot helper-text - Renders content below the input.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot type-mismatch - Renders content when the url/email type validation fails.\n * @slot pattern-mismatch - Renders content when the pattern validation fails.\n * @slot too-long - Renders content when the maxlength validation fails.\n * @slot too-short - Renders content when the minlength validation fails.\n * @slot range-overflow - Renders content when the max validation fails.\n * @slot range-underflow - Renders content when the min validation fails.\n * @slot step-mismatch - Renders content when the step 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 igcInput - Emitted when the control input receives user input.\n * @fires igcChange - Emitted when the value of the control is committed.\n *\n * @csspart container - The main wrapper that holds all main input elements.\n * @csspart input - The native input element.\n * @csspart label - The native label element.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart helper-text - The helper text wrapper.\n */\nexport default class IgcInputComponent extends IgcInputBaseComponent {\n public static readonly tagName = 'igc-input';\n public static styles = [styles, shared];\n\n /** Shared config for the constraint properties - a change revalidates. */\n private static readonly _revalidate: CoercedPropertyConfig<\n unknown,\n IgcInputComponent\n > = {\n onChange: ({ host }) => host._validate(),\n };\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcInputComponent, IgcValidationContainerComponent);\n }\n\n protected override readonly _themes = addThemingController(this, all);\n\n protected override readonly _slots = addSlotController(this, {\n slots: Slots,\n });\n\n protected override readonly _formValue = createFormValueState(this, {\n initialValue: '',\n });\n\n protected override get __validators() {\n return this.type !== 'number' ? stringValidators : numberValidators;\n }\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the control.\n * @attr\n */\n @property()\n public set value(value: string) {\n this._formValue.setValueAndFormState(value);\n }\n\n public get value(): string {\n return this._formValue.value;\n }\n\n /* alternateName: displayType */\n /**\n * The type of the control.\n * @attr\n */\n @property({ reflect: true })\n public type: InputType = 'text';\n\n /**\n * Makes the control a readonly field.\n *\n * @attr readonly\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public readOnly = false;\n\n /**\n * A hint to the browser for which virtual keyboard layout to display.\n * See [relevant MDN article](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)\n * @attr inputmode\n */\n @property({ attribute: 'inputmode' })\n public override inputMode!: string;\n\n /**\n * The regular expression the value is validated against.\n * @attr\n */\n @property()\n @coercedProperty(IgcInputComponent._revalidate)\n public pattern?: string = undefined;\n\n /**\n * The minimum string length required by the control.\n * @attr minlength\n */\n @property({ type: Number, attribute: 'minlength' })\n @coercedProperty(IgcInputComponent._revalidate)\n public minLength?: number = undefined;\n\n /**\n * The maximum string length of the control.\n * @attr maxlength\n */\n @property({ type: Number, attribute: 'maxlength' })\n @coercedProperty(IgcInputComponent._revalidate)\n public maxLength?: number = undefined;\n\n /**\n * The minimum value the control accepts.\n * @attr\n */\n @property({ type: Number })\n @coercedProperty(IgcInputComponent._revalidate)\n public min?: number = undefined;\n\n /**\n * The maximum value the control accepts.\n * @attr\n */\n @property({ type: Number })\n @coercedProperty(IgcInputComponent._revalidate)\n public max?: number = undefined;\n\n /**\n * The granularity the value must adhere to.\n * @attr\n */\n @property({ type: Number })\n @coercedProperty(IgcInputComponent._revalidate)\n public step?: number = undefined;\n\n /**\n * Whether the control should receive focus automatically.\n * @attr\n */\n @property({ type: Boolean })\n public override autofocus!: boolean;\n\n /**\n * A hint for the browser on how to autofill the control.\n * @attr\n */\n @property()\n public autocomplete!: string;\n\n /**\n * Enables validation rules to be evaluated without restricting user input. This applies to the `maxLength` property for\n * string-type inputs or allows spin buttons to exceed the predefined `min/max` limits for number-type inputs.\n *\n * @attr validate-only\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'validate-only' })\n public validateOnly = false;\n\n /* blazorSuppress */\n /** Replaces the selected text in the input. */\n public setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode: RangeTextSelectMode = 'preserve'\n ): void {\n this._input?.setRangeText(replacement, start!, end!, selectMode);\n this.value = this._input?.value ?? '';\n }\n\n /* blazorSuppress */\n /** Sets the text selection range of the control */\n public setSelectionRange(\n start?: number,\n end?: number,\n direction: SelectionRangeDirection = 'none'\n ): void {\n this._input?.setSelectionRange(start ?? null, end ?? null, direction);\n }\n\n /** Increments the numeric value of the input by one or more steps. */\n public stepUp(n?: number): void {\n this._input?.stepUp(n);\n this.value = this._input?.value ?? '';\n }\n\n /** Decrements the numeric value of the input by one or more steps. */\n public stepDown(n?: number): void {\n this._input?.stepDown(n);\n this.value = this._input?.value ?? '';\n }\n\n private _handleInput(): void {\n this._commitValue(this._input?.value ?? '', 'igcInput');\n }\n\n private _handleChange(): void {\n this._commitValue(this._input?.value ?? '', 'igcChange');\n }\n\n protected _renderInput() {\n const hasNegativeTabIndex = this.getAttribute('tabindex') === '-1';\n\n return html`\n <input\n ${ariaBindings(this._ariaTarget.resolveBindings())}\n id=${this._inputId}\n part=${partMap(this._resolvePartNames('input'))}\n name=${ifDefined(this.name)}\n type=${ifDefined(this.type)}\n pattern=${ifDefined(this.pattern)}\n placeholder=${ifDefined(this.placeholder)}\n .value=${live(this.value)}\n ?readonly=${this.readOnly}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?autofocus=${this.autofocus}\n tabindex=${bindIf(hasNegativeTabIndex, -1)}\n autocomplete=${ifDefined(this.autocomplete as any)}\n inputmode=${ifDefined(this.inputMode)}\n min=${bindIf(!this.validateOnly, this.min)}\n max=${bindIf(!this.validateOnly, this.max)}\n minlength=${ifDefined(this.minLength)}\n maxlength=${bindIf(!this.validateOnly, this.maxLength)}\n step=${ifDefined(this.step)}\n @keydown=${this._handleEnterKeydown}\n @change=${this._handleChange}\n @input=${this._handleInput}\n @blur=${this._handleBlur}\n />\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-input': IgcInputComponent;\n }\n}\n"]}
@@ -15,18 +15,20 @@ type MaskEditKind = 'insert' | 'delete-backward' | 'delete-forward' | 'atomic';
15
15
  /** Resolves the identity of the mask pattern the snapshots were taken against. */
16
16
  type MaskSignature = () => string;
17
17
  /**
18
- * The undo/redo history of a masked editor.
18
+ * The undo and redo history of a masked editor.
19
19
  *
20
- * Masked text is rendered through `.value=${live(...)}`, so every edit reassigns the
21
- * native input's value - which wipes the browser's own undo stack. This replaces it.
20
+ * @remarks
21
+ * `.value=${live(...)}` renders the masked text, so each edit assigns the value
22
+ * of the native input again and clears the undo stack of the browser. This
23
+ * history replaces that stack.
22
24
  *
23
- * It holds no timers: a run is coalesced purely from the caret geometry, so the same
24
- * sequence of edits always produces the same sequence of steps.
25
+ * It holds no timers. The caret geometry alone groups a run, so the same edits
26
+ * always give the same steps.
25
27
  *
26
- * The history is self-invalidating rather than instrumented. Anything that moves the
27
- * masked text without going through it - a programmatic `value`, `clear()`, a form reset -
28
- * is caught by comparing against the text it last observed, and a changed mask pattern is
29
- * caught by the signature. That is why no call site has to announce those changes.
28
+ * The history invalidates itself. It compares against the text it last saw to
29
+ * find a change that did not go through it, such as a `value` from code,
30
+ * `clear()` or a form reset, and the signature finds a changed mask pattern. No
31
+ * call site must report those changes.
30
32
  *
31
33
  * @hidden
32
34
  */
@@ -39,26 +41,28 @@ declare class MaskHistory {
39
41
  private _lastValue;
40
42
  private _pattern;
41
43
  /**
42
- * The state the most recent traversal restored.
44
+ * The state that the last traversal restored.
43
45
  *
44
- * Holding `Ctrl + Z` fires faster than the caret can be written back to the DOM, so the
45
- * live selection is not a trustworthy counterpart entry for the opposite stack. The
46
- * state we know we just restored is.
46
+ * @remarks
47
+ * A held `Ctrl + Z` repeats faster than the caret reaches the DOM, so the live
48
+ * selection is not a reliable entry for the opposite stack. This state holds
49
+ * the value and the caret that the traversal wrote, so it pushes the correct
50
+ * entry.
47
51
  */
48
52
  private _lastRestored;
49
53
  constructor(signature: MaskSignature);
50
54
  get canUndo(): boolean;
51
55
  get canRedo(): boolean;
52
56
  /**
53
- * A run continues only while the caret stays where the previous edit left it, which is
54
- * what makes a click or an arrow key break it without any extra hook. Replacing a
55
- * selection is always a deliberate edit of its own.
57
+ * A run continues only while the caret stays where the last edit left it, so a
58
+ * click or an arrow key breaks it with no extra hook. A replaced selection is
59
+ * always its own edit.
56
60
  */
57
61
  private _shouldCoalesce;
58
62
  private _clear;
59
63
  /**
60
- * Drops everything the history holds when the mask pattern changed or the text moved
61
- * behind our back. Returns whether the snapshots are still usable.
64
+ * Drops all the history if the mask pattern changed, or if the text moved
65
+ * from outside. Returns whether the snapshots are still usable.
62
66
  */
63
67
  private _validate;
64
68
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"mask-history.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-history.ts"],"names":[],"mappings":"AAmBA,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAkB7B,MAAM,WAAW;IAmBf,YAAY,SAAwB;QAjBnB,eAAU,GAAuB,EAAE,CAAC;QACpC,eAAU,GAAuB,EAAE,CAAC;QAE7C,cAAS,GAAwB,IAAI,CAAC;QACtC,eAAU,GAAG,CAAC,CAAC,CAAC;QAChB,eAAU,GAAG,EAAE,CAAC;QAChB,aAAQ,GAAG,EAAE,CAAC;QASd,kBAAa,GAA4B,IAAI,CAAC;QAGpD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,CAAC;IAOO,eAAe,CACrB,IAAkB,EAClB,KAAuB;QAEvB,IACE,IAAI,KAAK,QAAQ;YACjB,IAAI,KAAK,IAAI,CAAC,SAAS;YACvB,CAAC,IAAI,CAAC,OAAO;YACb,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,GAAG,EACzB,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,KAAK,QAAQ;YACtB,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,UAAU;YACjC,CAAC,CAAC,KAAK,CAAC,GAAG,KAAK,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;IAEO,MAAM;QACZ,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,C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*before* an edit was applied. */\ntype MaskHistoryState = {\n value: string;\n start: number;\n end: number;\n};\n\n/**\n * The granularity an edit contributes to the history.\n *\n * The three granular kinds coalesce, so a run of typed characters or of deletions\n * collapses into a single step. Everything else - paste, drop, cut, composition,\n * auto-fill, spinning a date part, `setRangeText` - is `atomic` and gets its own step.\n */\ntype MaskEditKind = 'insert' | 'delete-backward' | 'delete-forward' | 'atomic';\n\n/** Resolves the identity of the mask pattern the snapshots were taken against. */\ntype MaskSignature = () => string;\n\nconst MAX_HISTORY_SIZE = 100;\n\n/**\n * The undo/redo history of a masked editor.\n *\n * Masked text is rendered through `.value=${live(...)}`, so every edit reassigns the\n * native input's value - which wipes the browser's own undo stack. This replaces it.\n *\n * It holds no timers: a run is coalesced purely from the caret geometry, so the same\n * sequence of edits always produces the same sequence of steps.\n *\n * The history is self-invalidating rather than instrumented. Anything that moves the\n * masked text without going through it - a programmatic `value`, `clear()`, a form reset -\n * is caught by comparing against the text it last observed, and a changed mask pattern is\n * caught by the signature. That is why no call site has to announce those changes.\n *\n * @hidden\n */\nclass MaskHistory {\n private readonly _signature: MaskSignature;\n private readonly _undoStack: MaskHistoryState[] = [];\n private readonly _redoStack: MaskHistoryState[] = [];\n\n private _lastKind: MaskEditKind | null = null;\n private _lastCaret = -1;\n private _lastValue = '';\n private _pattern = '';\n\n /**\n * The state the most recent traversal restored.\n *\n * Holding `Ctrl + Z` fires faster than the caret can be written back to the DOM, so the\n * live selection is not a trustworthy counterpart entry for the opposite stack. The\n * state we know we just restored is.\n */\n private _lastRestored: MaskHistoryState | null = null;\n\n constructor(signature: MaskSignature) {\n this._signature = signature;\n }\n\n public get canUndo(): boolean {\n return this._undoStack.length > 0;\n }\n\n public get canRedo(): boolean {\n return this._redoStack.length > 0;\n }\n\n /**\n * A run continues only while the caret stays where the previous edit left it, which is\n * what makes a click or an arrow key break it without any extra hook. Replacing a\n * selection is always a deliberate edit of its own.\n */\n private _shouldCoalesce(\n kind: MaskEditKind,\n state: MaskHistoryState\n ): boolean {\n if (\n kind === 'atomic' ||\n kind !== this._lastKind ||\n !this.canUndo ||\n state.start !== state.end\n ) {\n return false;\n }\n\n return kind === 'insert'\n ? state.start === this._lastCaret\n : state.end === this._lastCaret;\n }\n\n private _clear(): void {\n this._undoStack.length = 0;\n this._redoStack.length = 0;\n this._lastKind = null;\n this._lastCaret = -1;\n this._lastRestored = null;\n }\n\n /**\n * Drops everything the history holds when the mask pattern changed or the text moved\n * behind our back. Returns whether the snapshots are still usable.\n */\n private _validate(value: string): boolean {\n const pattern = this._signature();\n const stale =\n pattern !== this._pattern || (this.canUndo && value !== this._lastValue);\n\n if (stale) {\n this._pattern = pattern;\n this._clear();\n this._lastValue = value;\n }\n\n return !stale;\n }\n\n /**\n * Records the state an edit is about to overwrite. Must be called *before* the mask is\n * mutated, and only once the edit is known to change something.\n */\n public record(kind: MaskEditKind, state: MaskHistoryState): void {\n this._validate(state.value);\n this._redoStack.length = 0;\n this._lastRestored = null;\n\n if (!this._shouldCoalesce(kind, state)) {\n this._undoStack.push({ ...state });\n\n if (this._undoStack.length > MAX_HISTORY_SIZE) {\n this._undoStack.shift();\n }\n }\n\n this._lastKind = kind;\n }\n\n /**\n * Reports the state an edit settled on, so that the next {@link record} can tell\n * whether it continues the run.\n */\n public settle(value: string, caret: number): void {\n this._lastValue = value;\n this._lastCaret = caret;\n }\n\n /**\n * Reconciles the history with the editor's current text, typically on focus where a\n * date editor swaps the display format back for the input format. An unchanged\n * document keeps its history, a changed one drops it, and either way the run ends.\n */\n public resync(value: string): void {\n this._validate(value);\n\n this._lastValue = value;\n this._lastKind = null;\n this._lastCaret = -1;\n this._lastRestored = null;\n }\n\n /** Steps one edit back, handing `current` to the redo stack. */\n public undo(current: MaskHistoryState): MaskHistoryState | null {\n return this._step(this._undoStack, this._redoStack, current);\n }\n\n /** Steps one edit forward, handing `current` back to the undo stack. */\n public redo(current: MaskHistoryState): MaskHistoryState | null {\n return this._step(this._redoStack, this._undoStack, current);\n }\n\n private _step(\n from: MaskHistoryState[],\n to: MaskHistoryState[],\n current: MaskHistoryState\n ): MaskHistoryState | null {\n // Traversing a history whose document has moved on would restore text belonging to a\n // value the component no longer holds.\n if (!this._validate(current.value)) {\n return null;\n }\n\n const state = from.pop();\n\n if (!state) {\n return null;\n }\n\n to.push(this._lastRestored ?? { ...current });\n\n // Typing after an undo must not extend the step that was just restored.\n this._lastKind = null;\n this._lastValue = state.value;\n this._lastCaret = state.start;\n this._lastRestored = { ...state };\n\n return state;\n }\n}\n\n/**\n * Creates a {@link MaskHistory} for a masked editor.\n *\n * @param signature - resolves the identity of the mask pattern the snapshots are taken\n * against. A callback rather than a value because the history is created by the mask\n * behavior mixin, whose fields initialize *before* the parser of the concrete component.\n *\n * @example\n * ```ts\n * const history = createMaskHistory(() => `${parser.mask} ${parser.prompt}`);\n * ```\n */\nexport function createMaskHistory(signature: MaskSignature): MaskHistory {\n return new MaskHistory(signature);\n}\n\nexport type { MaskEditKind, MaskHistory, MaskHistoryState, MaskSignature };\n"]}
1
+ {"version":3,"file":"mask-history.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-history.ts"],"names":[],"mappings":"AAmBA,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAoB7B,MAAM,WAAW;IAqBf,YAAY,SAAwB;QAnBnB,eAAU,GAAuB,EAAE,CAAC;QACpC,eAAU,GAAuB,EAAE,CAAC;QAE7C,cAAS,GAAwB,IAAI,CAAC;QACtC,eAAU,GAAG,CAAC,CAAC,CAAC;QAChB,eAAU,GAAG,EAAE,CAAC;QAChB,aAAQ,GAAG,EAAE,CAAC;QAWd,kBAAa,GAA4B,IAAI,CAAC;QAGpD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,C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ACnC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAEzB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAC;QACd,CAAC;QAED,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAG9C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;QAElC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAcD,MAAM,UAAU,iBAAiB,CAAC,SAAwB;IACxD,OAAO,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/** A snapshot of the editor state as it was *before* an edit was applied. */\ntype MaskHistoryState = {\n value: string;\n start: number;\n end: number;\n};\n\n/**\n * The granularity an edit contributes to the history.\n *\n * The three granular kinds coalesce, so a run of typed characters or of deletions\n * collapses into a single step. Everything else - paste, drop, cut, composition,\n * auto-fill, spinning a date part, `setRangeText` - is `atomic` and gets its own step.\n */\ntype MaskEditKind = 'insert' | 'delete-backward' | 'delete-forward' | 'atomic';\n\n/** Resolves the identity of the mask pattern the snapshots were taken against. */\ntype MaskSignature = () => string;\n\nconst MAX_HISTORY_SIZE = 100;\n\n/**\n * The undo and redo history of a masked editor.\n *\n * @remarks\n * `.value=${live(...)}` renders the masked text, so each edit assigns the value\n * of the native input again and clears the undo stack of the browser. This\n * history replaces that stack.\n *\n * It holds no timers. The caret geometry alone groups a run, so the same edits\n * always give the same steps.\n *\n * The history invalidates itself. It compares against the text it last saw to\n * find a change that did not go through it, such as a `value` from code,\n * `clear()` or a form reset, and the signature finds a changed mask pattern. No\n * call site must report those changes.\n *\n * @hidden\n */\nclass MaskHistory {\n private readonly _signature: MaskSignature;\n private readonly _undoStack: MaskHistoryState[] = [];\n private readonly _redoStack: MaskHistoryState[] = [];\n\n private _lastKind: MaskEditKind | null = null;\n private _lastCaret = -1;\n private _lastValue = '';\n private _pattern = '';\n\n /**\n * The state that the last traversal restored.\n *\n * @remarks\n * A held `Ctrl + Z` repeats faster than the caret reaches the DOM, so the live\n * selection is not a reliable entry for the opposite stack. This state holds\n * the value and the caret that the traversal wrote, so it pushes the correct\n * entry.\n */\n private _lastRestored: MaskHistoryState | null = null;\n\n constructor(signature: MaskSignature) {\n this._signature = signature;\n }\n\n public get canUndo(): boolean {\n return this._undoStack.length > 0;\n }\n\n public get canRedo(): boolean {\n return this._redoStack.length > 0;\n }\n\n /**\n * A run continues only while the caret stays where the last edit left it, so a\n * click or an arrow key breaks it with no extra hook. A replaced selection is\n * always its own edit.\n */\n private _shouldCoalesce(\n kind: MaskEditKind,\n state: MaskHistoryState\n ): boolean {\n if (\n kind === 'atomic' ||\n kind !== this._lastKind ||\n !this.canUndo ||\n state.start !== state.end\n ) {\n return false;\n }\n\n return kind === 'insert'\n ? state.start === this._lastCaret\n : state.end === this._lastCaret;\n }\n\n private _clear(): void {\n this._undoStack.length = 0;\n this._redoStack.length = 0;\n this._lastKind = null;\n this._lastCaret = -1;\n this._lastRestored = null;\n }\n\n /**\n * Drops all the history if the mask pattern changed, or if the text moved\n * from outside. Returns whether the snapshots are still usable.\n */\n private _validate(value: string): boolean {\n const pattern = this._signature();\n const stale =\n pattern !== this._pattern || (this.canUndo && value !== this._lastValue);\n\n if (stale) {\n this._pattern = pattern;\n this._clear();\n this._lastValue = value;\n }\n\n return !stale;\n }\n\n /**\n * Records the state an edit is about to overwrite. Must be called *before* the mask is\n * mutated, and only once the edit is known to change something.\n */\n public record(kind: MaskEditKind, state: MaskHistoryState): void {\n this._validate(state.value);\n this._redoStack.length = 0;\n this._lastRestored = null;\n\n if (!this._shouldCoalesce(kind, state)) {\n this._undoStack.push({ ...state });\n\n if (this._undoStack.length > MAX_HISTORY_SIZE) {\n this._undoStack.shift();\n }\n }\n\n this._lastKind = kind;\n }\n\n /**\n * Reports the state an edit settled on, so that the next {@link record} can tell\n * whether it continues the run.\n */\n public settle(value: string, caret: number): void {\n this._lastValue = value;\n this._lastCaret = caret;\n }\n\n /**\n * Reconciles the history with the editor's current text, typically on focus where a\n * date editor swaps the display format back for the input format. An unchanged\n * document keeps its history, a changed one drops it, and either way the run ends.\n */\n public resync(value: string): void {\n this._validate(value);\n\n this._lastValue = value;\n this._lastKind = null;\n this._lastCaret = -1;\n this._lastRestored = null;\n }\n\n /** Steps one edit back, handing `current` to the redo stack. */\n public undo(current: MaskHistoryState): MaskHistoryState | null {\n return this._step(this._undoStack, this._redoStack, current);\n }\n\n /** Steps one edit forward, handing `current` back to the undo stack. */\n public redo(current: MaskHistoryState): MaskHistoryState | null {\n return this._step(this._redoStack, this._undoStack, current);\n }\n\n private _step(\n from: MaskHistoryState[],\n to: MaskHistoryState[],\n current: MaskHistoryState\n ): MaskHistoryState | null {\n // Traversing a history whose document has moved on would restore text belonging to a\n // value the component no longer holds.\n if (!this._validate(current.value)) {\n return null;\n }\n\n const state = from.pop();\n\n if (!state) {\n return null;\n }\n\n to.push(this._lastRestored ?? { ...current });\n\n // Typing after an undo must not extend the step that was just restored.\n this._lastKind = null;\n this._lastValue = state.value;\n this._lastCaret = state.start;\n this._lastRestored = { ...state };\n\n return state;\n }\n}\n\n/**\n * Creates a {@link MaskHistory} for a masked editor.\n *\n * @param signature - resolves the identity of the mask pattern the snapshots are taken\n * against. A callback rather than a value because the history is created by the mask\n * behavior mixin, whose fields initialize *before* the parser of the concrete component.\n *\n * @example\n * ```ts\n * const history = createMaskHistory(() => `${parser.mask} ${parser.prompt}`);\n * ```\n */\nexport function createMaskHistory(signature: MaskSignature): MaskHistory {\n return new MaskHistory(signature);\n}\n\nexport type { MaskEditKind, MaskHistory, MaskHistoryState, MaskSignature };\n"]}
@@ -35,7 +35,7 @@ export default class IgcMaskInputComponent extends IgcMaskInputComponent_base {
35
35
  protected readonly _parser: MaskParser;
36
36
  protected get __validators(): import("../../internals/validators.js").Validator<IgcMaskInputComponent>[];
37
37
  protected readonly _themes: import("#theming/theming-controller.js").ThemingController;
38
- protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "prefix" | "helper-text" | "[default]" | "suffix" | "value-missing" | "custom-error" | "bad-input">;
38
+ protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "prefix" | "[default]" | "suffix" | "helper-text" | "value-missing" | "custom-error" | "bad-input">;
39
39
  protected readonly _formValue: import("#internals/mixins/forms/form-value.js").FormValue<string>;
40
40
  protected get _isRawMode(): boolean;
41
41
  /**
@@ -46,9 +46,9 @@ export declare class MaskParser {
46
46
  /** Cached array of required non-literal positions for validation */
47
47
  protected _requiredPositions: number[];
48
48
  /**
49
- * Declared without an initializer on purpose. With `useDefineForClassFields: false`
50
- * nothing is emitted for it, so {@link _invalidate} can safely run from the
51
- * constructor - before subclass fields exist.
49
+ * Declared with no initializer. `useDefineForClassFields: false` emits nothing
50
+ * for it, so {@link _invalidate} can run from the constructor, before the
51
+ * subclass fields exist.
52
52
  */
53
53
  private _emptyMask?;
54
54
  /**
@@ -87,25 +87,23 @@ export declare class MaskParser {
87
87
  constructor(options?: MaskOptions);
88
88
  private _isEscapedFlag;
89
89
  /**
90
- * The pattern the literal parser consumes. Subclasses whose public format is not itself
91
- * a mask pattern - date formats, for instance - translate it here.
90
+ * The pattern for the literal parser. A subclass whose public format is not a
91
+ * mask pattern, such as a date format, converts it here.
92
92
  */
93
93
  protected _toMaskFormat(format: string): string;
94
94
  /**
95
- * Drops everything derived from the mask. Runs on every mask *and* prompt change, and
96
- * from the constructor, so overrides must not touch fields with initializers.
95
+ * Drops all that comes from the mask. Runs on each mask and prompt change, and
96
+ * from the constructor, so an override must not touch an initialized field.
97
97
  */
98
98
  protected _invalidate(): void;
99
99
  /**
100
- * Parses the mask format string to identify literal characters and
101
- * create the escaped mask. This method is called whenever the mask format changes.
100
+ * Finds the literal characters of the mask format and builds the escaped
101
+ * mask. Runs on each mask format change.
102
102
  */
103
103
  protected _parseMaskLiterals(): void;
104
104
  /**
105
- * Computes an array of positions in the escaped mask that correspond to
106
- * required input flags (e.g., '0', 'L') and are not literal characters.
107
- *
108
- * These positions must be filled for the masked string to be valid.
105
+ * The positions of the escaped mask that hold a required input flag, such as
106
+ * '0' or 'L', and are not literals. A valid masked string fills them all.
109
107
  */
110
108
  protected _computeRequiredPositions(): number[];
111
109
  /**