igniteui-webcomponents 7.3.1 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (606) hide show
  1. package/CHANGELOG.md +72 -1
  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/avatar/themes/avatar.base.css.js +1 -1
  12. package/components/avatar/themes/avatar.base.css.js.map +1 -1
  13. package/components/badge/themes/badge.base.css.js +1 -1
  14. package/components/badge/themes/badge.base.css.js.map +1 -1
  15. package/components/banner/themes/banner.base.css.js +1 -1
  16. package/components/banner/themes/banner.base.css.js.map +1 -1
  17. package/components/banner/themes/shared/banner.indigo.css.js +1 -1
  18. package/components/banner/themes/shared/banner.indigo.css.js.map +1 -1
  19. package/components/breadcrumb/breadcrumb.d.ts +74 -0
  20. package/components/breadcrumb/breadcrumb.js +107 -0
  21. package/components/breadcrumb/breadcrumb.js.map +1 -0
  22. package/components/breadcrumb/breadcrumbs.d.ts +60 -0
  23. package/components/breadcrumb/breadcrumbs.js +50 -0
  24. package/components/breadcrumb/breadcrumbs.js.map +1 -0
  25. package/components/breadcrumb/themes/breadcrumb.base.css.d.ts +1 -0
  26. package/components/breadcrumb/themes/breadcrumb.base.css.js +3 -0
  27. package/components/breadcrumb/themes/breadcrumb.base.css.js.map +1 -0
  28. package/components/breadcrumb/themes/breadcrumbs.base.css.d.ts +1 -0
  29. package/components/breadcrumb/themes/breadcrumbs.base.css.js +3 -0
  30. package/components/breadcrumb/themes/breadcrumbs.base.css.js.map +1 -0
  31. package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.d.ts +1 -0
  32. package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.js +3 -0
  33. package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.js.map +1 -0
  34. package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.d.ts +1 -0
  35. package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.js +3 -0
  36. package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.js.map +1 -0
  37. package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.d.ts +1 -0
  38. package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.js +3 -0
  39. package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.js.map +1 -0
  40. package/components/breadcrumb/themes/dark/breadcrumb.material.css.d.ts +1 -0
  41. package/components/breadcrumb/themes/dark/breadcrumb.material.css.js +3 -0
  42. package/components/breadcrumb/themes/dark/breadcrumb.material.css.js.map +1 -0
  43. package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.d.ts +1 -0
  44. package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.js +3 -0
  45. package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.js.map +1 -0
  46. package/components/breadcrumb/themes/light/breadcrumb.fluent.css.d.ts +1 -0
  47. package/components/breadcrumb/themes/light/breadcrumb.fluent.css.js +3 -0
  48. package/components/breadcrumb/themes/light/breadcrumb.fluent.css.js.map +1 -0
  49. package/components/breadcrumb/themes/light/breadcrumb.indigo.css.d.ts +1 -0
  50. package/components/breadcrumb/themes/light/breadcrumb.indigo.css.js +3 -0
  51. package/components/breadcrumb/themes/light/breadcrumb.indigo.css.js.map +1 -0
  52. package/components/breadcrumb/themes/light/breadcrumb.material.css.d.ts +1 -0
  53. package/components/breadcrumb/themes/light/breadcrumb.material.css.js +3 -0
  54. package/components/breadcrumb/themes/light/breadcrumb.material.css.js.map +1 -0
  55. package/components/breadcrumb/themes/light/breadcrumb.shared.css.d.ts +1 -0
  56. package/components/breadcrumb/themes/light/breadcrumb.shared.css.js +3 -0
  57. package/components/breadcrumb/themes/light/breadcrumb.shared.css.js.map +1 -0
  58. package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.d.ts +1 -0
  59. package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.js +3 -0
  60. package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.js.map +1 -0
  61. package/components/breadcrumb/themes/shared/breadcrumb.common.css.d.ts +1 -0
  62. package/components/breadcrumb/themes/shared/breadcrumb.common.css.js +3 -0
  63. package/components/breadcrumb/themes/shared/breadcrumb.common.css.js.map +1 -0
  64. package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.d.ts +1 -0
  65. package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.js +3 -0
  66. package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.js.map +1 -0
  67. package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.d.ts +1 -0
  68. package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.js +3 -0
  69. package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.js.map +1 -0
  70. package/components/breadcrumb/themes/shared/breadcrumb.material.css.d.ts +1 -0
  71. package/components/breadcrumb/themes/shared/breadcrumb.material.css.js +3 -0
  72. package/components/breadcrumb/themes/shared/breadcrumb.material.css.js.map +1 -0
  73. package/components/breadcrumb/themes/themes.d.ts +2 -0
  74. package/components/breadcrumb/themes/themes.js +50 -0
  75. package/components/breadcrumb/themes/themes.js.map +1 -0
  76. package/components/button/button.d.ts +0 -2
  77. package/components/button/button.js.map +1 -1
  78. package/components/button-group/button-group.d.ts +42 -12
  79. package/components/button-group/button-group.js +82 -34
  80. package/components/button-group/button-group.js.map +1 -1
  81. package/components/button-group/toggle-button.d.ts +6 -1
  82. package/components/button-group/toggle-button.js +28 -2
  83. package/components/button-group/toggle-button.js.map +1 -1
  84. package/components/calendar/base.d.ts +7 -2
  85. package/components/calendar/base.js +10 -4
  86. package/components/calendar/base.js.map +1 -1
  87. package/components/calendar/calendar.d.ts +6 -3
  88. package/components/calendar/calendar.js +41 -14
  89. package/components/calendar/calendar.js.map +1 -1
  90. package/components/calendar/days-view/days-view.d.ts +5 -8
  91. package/components/calendar/days-view/days-view.js +7 -16
  92. package/components/calendar/days-view/days-view.js.map +1 -1
  93. package/components/calendar/helpers.d.ts +13 -0
  94. package/components/calendar/helpers.js +15 -0
  95. package/components/calendar/helpers.js.map +1 -1
  96. package/components/calendar/themes/calendar.base.css.js +1 -1
  97. package/components/calendar/themes/calendar.base.css.js.map +1 -1
  98. package/components/calendar/themes/days-view.base.css.js +1 -1
  99. package/components/calendar/themes/days-view.base.css.js.map +1 -1
  100. package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js +1 -1
  101. package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js.map +1 -1
  102. package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js +1 -1
  103. package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js.map +1 -1
  104. package/components/calendar/themes/shared/fluent/days-view.fluent.css.js +1 -1
  105. package/components/calendar/themes/shared/fluent/days-view.fluent.css.js.map +1 -1
  106. package/components/calendar/themes/shared/indigo/calendar.indigo.css.js +1 -1
  107. package/components/calendar/themes/shared/indigo/calendar.indigo.css.js.map +1 -1
  108. package/components/calendar/themes/shared/indigo/days-view.indigo.css.js +1 -1
  109. package/components/calendar/themes/shared/indigo/days-view.indigo.css.js.map +1 -1
  110. package/components/calendar/themes/shared/material/days-view.material.css.js +1 -1
  111. package/components/calendar/themes/shared/material/days-view.material.css.js.map +1 -1
  112. package/components/calendar/themes/year-month-view.base.css.js +1 -1
  113. package/components/calendar/themes/year-month-view.base.css.js.map +1 -1
  114. package/components/card/themes/container.base.css.js +1 -1
  115. package/components/card/themes/container.base.css.js.map +1 -1
  116. package/components/carousel/carousel-indicator.js +1 -0
  117. package/components/carousel/carousel-indicator.js.map +1 -1
  118. package/components/carousel/carousel-slide.d.ts +1 -1
  119. package/components/carousel/carousel-slide.js.map +1 -1
  120. package/components/carousel/carousel.d.ts +3 -3
  121. package/components/carousel/carousel.js.map +1 -1
  122. package/components/carousel/themes/carousel.base.css.js +1 -1
  123. package/components/carousel/themes/carousel.base.css.js.map +1 -1
  124. package/components/carousel/themes/shared/carousel.indigo.css.js +1 -1
  125. package/components/carousel/themes/shared/carousel.indigo.css.js.map +1 -1
  126. package/components/chat/chat-input.d.ts +1 -2
  127. package/components/chat/chat-input.js +1 -1
  128. package/components/chat/chat-input.js.map +1 -1
  129. package/components/chat/chat-state.d.ts +8 -9
  130. package/components/chat/chat-state.js.map +1 -1
  131. package/components/chat/chat.d.ts +1 -3
  132. package/components/chat/chat.js +2 -2
  133. package/components/chat/chat.js.map +1 -1
  134. package/components/chat/message-attachments.d.ts +6 -15
  135. package/components/chat/message-attachments.js.map +1 -1
  136. package/components/chat/themes/chat.base.css.js +1 -1
  137. package/components/chat/themes/chat.base.css.js.map +1 -1
  138. package/components/chat/themes/message.base.css.js +1 -1
  139. package/components/chat/themes/message.base.css.js.map +1 -1
  140. package/components/chat/utils.d.ts +0 -1
  141. package/components/chat/utils.js +1 -1
  142. package/components/chat/utils.js.map +1 -1
  143. package/components/checkbox/checkbox-base.d.ts +1 -1
  144. package/components/checkbox/checkbox.js +1 -1
  145. package/components/checkbox/checkbox.js.map +1 -1
  146. package/components/checkbox/themes/checkbox.base.css.js +1 -1
  147. package/components/checkbox/themes/checkbox.base.css.js.map +1 -1
  148. package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js +1 -1
  149. package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js.map +1 -1
  150. package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js +1 -1
  151. package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js.map +1 -1
  152. package/components/checkbox/themes/shared/switch/switch.bootstrap.css.js +1 -1
  153. package/components/checkbox/themes/shared/switch/switch.bootstrap.css.js.map +1 -1
  154. package/components/checkbox/themes/shared/switch/switch.fluent.css.js +1 -1
  155. package/components/checkbox/themes/shared/switch/switch.fluent.css.js.map +1 -1
  156. package/components/checkbox/themes/shared/switch/switch.indigo.css.js +1 -1
  157. package/components/checkbox/themes/shared/switch/switch.indigo.css.js.map +1 -1
  158. package/components/checkbox/themes/shared/switch/switch.material.css.js +1 -1
  159. package/components/checkbox/themes/shared/switch/switch.material.css.js.map +1 -1
  160. package/components/checkbox/themes/switch.base.css.js +1 -1
  161. package/components/checkbox/themes/switch.base.css.js.map +1 -1
  162. package/components/chip/chip.d.ts +2 -2
  163. package/components/chip/chip.js.map +1 -1
  164. package/components/color-picker/color-picker.d.ts +35 -34
  165. package/components/color-picker/color-picker.js +9 -4
  166. package/components/color-picker/color-picker.js.map +1 -1
  167. package/components/color-picker/common.d.ts +0 -2
  168. package/components/color-picker/common.js +2 -2
  169. package/components/color-picker/common.js.map +1 -1
  170. package/components/color-picker/converters.js.map +1 -1
  171. package/components/color-picker/picker-canvas.js.map +1 -1
  172. package/components/color-picker/themes/color-picker.base.css.js +1 -1
  173. package/components/color-picker/themes/color-picker.base.css.js.map +1 -1
  174. package/components/combo/combo.d.ts +18 -20
  175. package/components/combo/combo.js +8 -2
  176. package/components/combo/combo.js.map +1 -1
  177. package/components/combo/controllers/data.d.ts +7 -10
  178. package/components/combo/controllers/data.js.map +1 -1
  179. package/components/combo/themes/combo-item.base.css.js +1 -1
  180. package/components/combo/themes/combo-item.base.css.js.map +1 -1
  181. package/components/combo/themes/combo.base.css.js +1 -1
  182. package/components/combo/themes/combo.base.css.js.map +1 -1
  183. package/components/combo/themes/shared/combo.bootstrap.css.js +1 -1
  184. package/components/combo/themes/shared/combo.bootstrap.css.js.map +1 -1
  185. package/components/date-picker/date-picker.base.d.ts +33 -29
  186. package/components/date-picker/date-picker.base.js +15 -4
  187. package/components/date-picker/date-picker.base.js.map +1 -1
  188. package/components/date-picker/date-picker.d.ts +1 -1
  189. package/components/date-picker/date-picker.js +5 -3
  190. package/components/date-picker/date-picker.js.map +1 -1
  191. package/components/date-picker/themes/date-picker.base.css.js +1 -1
  192. package/components/date-picker/themes/date-picker.base.css.js.map +1 -1
  193. package/components/date-range-picker/date-range-input.d.ts +0 -2
  194. package/components/date-range-picker/date-range-input.js +0 -6
  195. package/components/date-range-picker/date-range-input.js.map +1 -1
  196. package/components/date-range-picker/date-range-picker.base.css.js +1 -1
  197. package/components/date-range-picker/date-range-picker.base.css.js.map +1 -1
  198. package/components/date-range-picker/date-range-picker.d.ts +22 -31
  199. package/components/date-range-picker/date-range-picker.js +7 -7
  200. package/components/date-range-picker/date-range-picker.js.map +1 -1
  201. package/components/date-range-picker/i18n.d.ts +21 -0
  202. package/components/date-range-picker/i18n.js +10 -0
  203. package/components/date-range-picker/i18n.js.map +1 -0
  204. package/components/date-range-picker/predefined-ranges-area.base.css.js +1 -1
  205. package/components/date-range-picker/predefined-ranges-area.base.css.js.map +1 -1
  206. package/components/date-range-picker/predefined-ranges-area.d.ts +3 -3
  207. package/components/date-range-picker/predefined-ranges-area.js +2 -5
  208. package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
  209. package/components/date-range-picker/validators.d.ts +0 -4
  210. package/components/date-range-picker/validators.js +4 -4
  211. package/components/date-range-picker/validators.js.map +1 -1
  212. package/components/date-time-input/date-time-input.base.d.ts +39 -37
  213. package/components/date-time-input/date-time-input.base.js +6 -0
  214. package/components/date-time-input/date-time-input.base.js.map +1 -1
  215. package/components/date-time-input/date-time-input.d.ts +1 -11
  216. package/components/date-time-input/date-time-input.js +0 -6
  217. package/components/date-time-input/date-time-input.js.map +1 -1
  218. package/components/date-time-input/datetime-mask-parser.d.ts +0 -10
  219. package/components/date-time-input/datetime-mask-parser.js +1 -1
  220. package/components/date-time-input/datetime-mask-parser.js.map +1 -1
  221. package/components/dialog/dialog.js.map +1 -1
  222. package/components/divider/themes/divider.base.css.js +1 -1
  223. package/components/divider/themes/divider.base.css.js.map +1 -1
  224. package/components/dropdown/dropdown-group.d.ts +2 -10
  225. package/components/dropdown/dropdown-group.js +2 -27
  226. package/components/dropdown/dropdown-group.js.map +1 -1
  227. package/components/dropdown/dropdown.d.ts +17 -23
  228. package/components/dropdown/dropdown.js +5 -17
  229. package/components/dropdown/dropdown.js.map +1 -1
  230. package/components/dropdown/themes/dropdown-item.base.css.js +1 -1
  231. package/components/dropdown/themes/dropdown-item.base.css.js.map +1 -1
  232. package/components/dropdown/themes/dropdown.base.css.js +1 -1
  233. package/components/dropdown/themes/dropdown.base.css.js.map +1 -1
  234. package/components/file-input/file-input.d.ts +2 -2
  235. package/components/file-input/file-input.js.map +1 -1
  236. package/components/file-input/themes/file-input.base.css.js +1 -1
  237. package/components/file-input/themes/file-input.base.css.js.map +1 -1
  238. package/components/file-input/themes/shared/file-input.bootstrap.css.js +1 -1
  239. package/components/file-input/themes/shared/file-input.bootstrap.css.js.map +1 -1
  240. package/components/icon/icon.d.ts +1 -1
  241. package/components/icon/icon.registry.d.ts +6 -6
  242. package/components/icon/icon.registry.js.map +1 -1
  243. package/components/input/input.d.ts +3 -3
  244. package/components/input/input.js.map +1 -1
  245. package/components/input/themes/shared/input.indigo.css.js +1 -1
  246. package/components/input/themes/shared/input.indigo.css.js.map +1 -1
  247. package/components/input/themes/shared/input.material.css.js +1 -1
  248. package/components/input/themes/shared/input.material.css.js.map +1 -1
  249. package/components/list/themes/item.base.css.js +1 -1
  250. package/components/list/themes/item.base.css.js.map +1 -1
  251. package/components/mask-input/mask-history.d.ts +22 -18
  252. package/components/mask-input/mask-history.js.map +1 -1
  253. package/components/mask-input/mask-input.d.ts +1 -1
  254. package/components/mask-input/mask-parser.d.ts +11 -13
  255. package/components/mask-input/mask-parser.js.map +1 -1
  256. package/components/nav-drawer/themes/item.base.css.js +1 -1
  257. package/components/nav-drawer/themes/item.base.css.js.map +1 -1
  258. package/components/popover/popover.d.ts +45 -34
  259. package/components/popover/popover.js +54 -122
  260. package/components/popover/popover.js.map +1 -1
  261. package/components/popover/position/arrow.d.ts +19 -0
  262. package/components/popover/position/arrow.js +33 -0
  263. package/components/popover/position/arrow.js.map +1 -0
  264. package/components/popover/position/floating.d.ts +40 -0
  265. package/components/popover/position/floating.js +146 -0
  266. package/components/popover/position/floating.js.map +1 -0
  267. package/components/popover/position/native.d.ts +45 -0
  268. package/components/popover/position/native.js +158 -0
  269. package/components/popover/position/native.js.map +1 -0
  270. package/components/popover/position/strategy.d.ts +37 -0
  271. package/components/popover/position/strategy.js +21 -0
  272. package/components/popover/position/strategy.js.map +1 -0
  273. package/components/popover/position/types.d.ts +26 -0
  274. package/components/popover/position/types.js +15 -0
  275. package/components/popover/position/types.js.map +1 -0
  276. package/components/popover/themes/light/popover.base.css.js +1 -1
  277. package/components/popover/themes/light/popover.base.css.js.map +1 -1
  278. package/components/progress/circular-progress.d.ts +0 -5
  279. package/components/progress/circular-progress.js.map +1 -1
  280. package/components/progress/themes/linear/linear.progress.base.css.js +1 -1
  281. package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
  282. package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.d.ts +1 -0
  283. package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.js +3 -0
  284. package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.js.map +1 -0
  285. package/components/progress/themes/linear/themes.js +3 -2
  286. package/components/progress/themes/linear/themes.js.map +1 -1
  287. package/components/qr-code/qr-code.d.ts +29 -2
  288. package/components/qr-code/qr-code.js +56 -13
  289. package/components/qr-code/qr-code.js.map +1 -1
  290. package/components/qr-code/renderer/export.d.ts +28 -0
  291. package/components/qr-code/renderer/export.js +120 -0
  292. package/components/qr-code/renderer/export.js.map +1 -0
  293. package/components/qr-code/types.d.ts +26 -0
  294. package/components/qr-code/types.js.map +1 -1
  295. package/components/radio/radio.d.ts +4 -4
  296. package/components/radio/radio.js +17 -14
  297. package/components/radio/radio.js.map +1 -1
  298. package/components/radio/themes/radio.base.css.js +1 -1
  299. package/components/radio/themes/radio.base.css.js.map +1 -1
  300. package/components/radio/themes/shared/radio.bootstrap.css.js +1 -1
  301. package/components/radio/themes/shared/radio.bootstrap.css.js.map +1 -1
  302. package/components/radio/themes/shared/radio.indigo.css.js +1 -1
  303. package/components/radio/themes/shared/radio.indigo.css.js.map +1 -1
  304. package/components/radio-group/radio-group.js.map +1 -1
  305. package/components/rating/rating.d.ts +6 -6
  306. package/components/rating/rating.js.map +1 -1
  307. package/components/select/select-group.d.ts +5 -10
  308. package/components/select/select-group.js +10 -34
  309. package/components/select/select-group.js.map +1 -1
  310. package/components/select/select.d.ts +12 -20
  311. package/components/select/select.js +4 -14
  312. package/components/select/select.js.map +1 -1
  313. package/components/select/themes/select.base.css.js +1 -1
  314. package/components/select/themes/select.base.css.js.map +1 -1
  315. package/components/select/themes/shared/select.bootstrap.css.js +1 -1
  316. package/components/select/themes/shared/select.bootstrap.css.js.map +1 -1
  317. package/components/slider/themes/shared/slider.material.css.js +1 -1
  318. package/components/slider/themes/shared/slider.material.css.js.map +1 -1
  319. package/components/slider/themes/slider.base.css.js +1 -1
  320. package/components/slider/themes/slider.base.css.js.map +1 -1
  321. package/components/snackbar/themes/snackbar.base.css.js +1 -1
  322. package/components/snackbar/themes/snackbar.base.css.js.map +1 -1
  323. package/components/splitter/splitter.d.ts +6 -6
  324. package/components/splitter/splitter.js.map +1 -1
  325. package/components/splitter/themes/splitter.base.css.js +1 -1
  326. package/components/splitter/themes/splitter.base.css.js.map +1 -1
  327. package/components/stepper/themes/step/step.base.css.js +1 -1
  328. package/components/stepper/themes/step/step.base.css.js.map +1 -1
  329. package/components/tabs/themes/shared/tab/tab.bootstrap.css.js +1 -1
  330. package/components/tabs/themes/shared/tab/tab.bootstrap.css.js.map +1 -1
  331. package/components/tabs/themes/shared/tab/tab.fluent.css.js +1 -1
  332. package/components/tabs/themes/shared/tab/tab.fluent.css.js.map +1 -1
  333. package/components/tabs/themes/shared/tab/tab.indigo.css.js +1 -1
  334. package/components/tabs/themes/shared/tab/tab.indigo.css.js.map +1 -1
  335. package/components/tabs/themes/shared/tab/tab.material.css.js +1 -1
  336. package/components/tabs/themes/shared/tab/tab.material.css.js.map +1 -1
  337. package/components/tabs/themes/shared/tabs/tabs.fluent.css.js +1 -1
  338. package/components/tabs/themes/shared/tabs/tabs.fluent.css.js.map +1 -1
  339. package/components/tabs/themes/shared/tabs/tabs.indigo.css.js +1 -1
  340. package/components/tabs/themes/shared/tabs/tabs.indigo.css.js.map +1 -1
  341. package/components/tabs/themes/shared/tabs/tabs.material.css.js +1 -1
  342. package/components/tabs/themes/shared/tabs/tabs.material.css.js.map +1 -1
  343. package/components/tabs/themes/tab.base.css.js +1 -1
  344. package/components/tabs/themes/tab.base.css.js.map +1 -1
  345. package/components/textarea/textarea.d.ts +1 -1
  346. package/components/textarea/textarea.js.map +1 -1
  347. package/components/textarea/themes/shared/textarea.bootstrap.css.js +1 -1
  348. package/components/textarea/themes/shared/textarea.bootstrap.css.js.map +1 -1
  349. package/components/textarea/themes/shared/textarea.common.css.js +1 -1
  350. package/components/textarea/themes/shared/textarea.common.css.js.map +1 -1
  351. package/components/textarea/themes/shared/textarea.fluent.css.js +1 -1
  352. package/components/textarea/themes/shared/textarea.fluent.css.js.map +1 -1
  353. package/components/textarea/themes/shared/textarea.indigo.css.js +1 -1
  354. package/components/textarea/themes/shared/textarea.indigo.css.js.map +1 -1
  355. package/components/textarea/themes/shared/textarea.material.css.js +1 -1
  356. package/components/textarea/themes/shared/textarea.material.css.js.map +1 -1
  357. package/components/tile-manager/themes/tile.base.css.js +1 -1
  358. package/components/tile-manager/themes/tile.base.css.js.map +1 -1
  359. package/components/tile-manager/tile-manager.d.ts +6 -7
  360. package/components/tile-manager/tile-manager.js.map +1 -1
  361. package/components/tile-manager/tile.d.ts +3 -3
  362. package/components/tile-manager/tile.js.map +1 -1
  363. package/components/toast/themes/toast.base.css.js +1 -1
  364. package/components/toast/themes/toast.base.css.js.map +1 -1
  365. package/components/toast/toast.d.ts +0 -2
  366. package/components/toast/toast.js.map +1 -1
  367. package/components/tooltip/controller.js.map +1 -1
  368. package/components/tooltip/service.js +4 -5
  369. package/components/tooltip/service.js.map +1 -1
  370. package/components/tooltip/themes/tooltip.base.css.js +1 -1
  371. package/components/tooltip/themes/tooltip.base.css.js.map +1 -1
  372. package/components/tooltip/tooltip.d.ts +34 -13
  373. package/components/tooltip/tooltip.js +8 -4
  374. package/components/tooltip/tooltip.js.map +1 -1
  375. package/components/tree/themes/item.base.css.js +1 -1
  376. package/components/tree/themes/item.base.css.js.map +1 -1
  377. package/components/tree/tree-item.d.ts +6 -6
  378. package/components/tree/tree-item.js.map +1 -1
  379. package/components/tree/tree.navigation.d.ts +5 -6
  380. package/components/tree/tree.navigation.js.map +1 -1
  381. package/components/tree/tree.selection.js.map +1 -1
  382. package/components/types.d.ts +1 -1
  383. package/components/types.js.map +1 -1
  384. package/components/validation-container/themes/validator.base.css.js +1 -1
  385. package/components/validation-container/themes/validator.base.css.js.map +1 -1
  386. package/components/validation-container/validation-container.d.ts +10 -12
  387. package/components/validation-container/validation-container.js +14 -17
  388. package/components/validation-container/validation-container.js.map +1 -1
  389. package/components/virtualization/engine.d.ts +5 -5
  390. package/components/virtualization/engine.js.map +1 -1
  391. package/components/virtualization/virtualization.d.ts +61 -63
  392. package/components/virtualization/virtualization.js +6 -5
  393. package/components/virtualization/virtualization.js.map +1 -1
  394. package/custom-elements.json +16769 -19698
  395. package/igniteui-webcomponents.css-data.json +2 -2
  396. package/igniteui-webcomponents.html-data.json +1 -1
  397. package/index.d.ts +3 -1
  398. package/index.js +2 -0
  399. package/index.js.map +1 -1
  400. package/internals/abort-handler.d.ts +13 -25
  401. package/internals/abort-handler.js +4 -6
  402. package/internals/abort-handler.js.map +1 -1
  403. package/internals/context.d.ts +13 -7
  404. package/internals/context.js +2 -1
  405. package/internals/context.js.map +1 -1
  406. package/internals/controllers/adopt-styles.d.ts +19 -20
  407. package/internals/controllers/adopt-styles.js +3 -8
  408. package/internals/controllers/adopt-styles.js.map +1 -1
  409. package/internals/controllers/aria-projection.d.ts +56 -55
  410. package/internals/controllers/aria-projection.js +14 -15
  411. package/internals/controllers/aria-projection.js.map +1 -1
  412. package/internals/controllers/async-consumer.js.map +1 -1
  413. package/internals/controllers/command.d.ts +15 -30
  414. package/internals/controllers/command.js +2 -7
  415. package/internals/controllers/command.js.map +1 -1
  416. package/internals/controllers/context-provider.d.ts +7 -13
  417. package/internals/controllers/context-provider.js.map +1 -1
  418. package/internals/controllers/focus-ring.d.ts +10 -30
  419. package/internals/controllers/focus-ring.js +6 -12
  420. package/internals/controllers/focus-ring.js.map +1 -1
  421. package/internals/controllers/fullscreen.d.ts +7 -23
  422. package/internals/controllers/fullscreen.js +3 -9
  423. package/internals/controllers/fullscreen.js.map +1 -1
  424. package/internals/controllers/gestures.d.ts +10 -29
  425. package/internals/controllers/gestures.js +1 -3
  426. package/internals/controllers/gestures.js.map +1 -1
  427. package/internals/controllers/group.d.ts +13 -30
  428. package/internals/controllers/group.js.map +1 -1
  429. package/internals/controllers/host-listeners.d.ts +28 -0
  430. package/internals/controllers/host-listeners.js +27 -0
  431. package/internals/controllers/host-listeners.js.map +1 -0
  432. package/internals/controllers/id-resolver.d.ts +8 -9
  433. package/internals/controllers/id-resolver.js +6 -14
  434. package/internals/controllers/id-resolver.js.map +1 -1
  435. package/internals/controllers/internals.d.ts +53 -104
  436. package/internals/controllers/internals.js +40 -13
  437. package/internals/controllers/internals.js.map +1 -1
  438. package/internals/controllers/key-bindings.d.ts +61 -158
  439. package/internals/controllers/key-bindings.js +68 -67
  440. package/internals/controllers/key-bindings.js.map +1 -1
  441. package/internals/controllers/keys.d.ts +32 -0
  442. package/internals/controllers/keys.js +20 -0
  443. package/internals/controllers/keys.js.map +1 -0
  444. package/internals/controllers/mutation-observer.d.ts +14 -37
  445. package/internals/controllers/mutation-observer.js +1 -1
  446. package/internals/controllers/mutation-observer.js.map +1 -1
  447. package/internals/controllers/resize-observer.d.ts +9 -19
  448. package/internals/controllers/resize-observer.js.map +1 -1
  449. package/internals/controllers/root-click.d.ts +11 -42
  450. package/internals/controllers/root-click.js +4 -6
  451. package/internals/controllers/root-click.js.map +1 -1
  452. package/internals/controllers/roving-focus.d.ts +16 -35
  453. package/internals/controllers/roving-focus.js.map +1 -1
  454. package/internals/controllers/slot.d.ts +25 -54
  455. package/internals/controllers/slot.js +6 -6
  456. package/internals/controllers/slot.js.map +1 -1
  457. package/internals/controllers/toggle.d.ts +44 -48
  458. package/internals/controllers/toggle.js.map +1 -1
  459. package/internals/date/compare.js.map +1 -1
  460. package/internals/date/converters.d.ts +10 -7
  461. package/internals/date/converters.js.map +1 -1
  462. package/internals/date/model.d.ts +9 -16
  463. package/internals/date/model.js +22 -25
  464. package/internals/date/model.js.map +1 -1
  465. package/internals/decorators/blazorAdditionalDependencies.d.ts +4 -2
  466. package/internals/decorators/blazorAdditionalDependencies.js.map +1 -1
  467. package/internals/decorators/blazorDeepImport.d.ts +1 -3
  468. package/internals/decorators/blazorDeepImport.js.map +1 -1
  469. package/internals/decorators/blazorInclude.d.ts +3 -2
  470. package/internals/decorators/blazorInclude.js.map +1 -1
  471. package/internals/decorators/blazorIndirectRender.d.ts +1 -3
  472. package/internals/decorators/blazorIndirectRender.js.map +1 -1
  473. package/internals/decorators/blazorSuppressComponent.d.ts +1 -3
  474. package/internals/decorators/blazorSuppressComponent.js.map +1 -1
  475. package/internals/decorators/coerced-property.d.ts +14 -20
  476. package/internals/decorators/coerced-property.js.map +1 -1
  477. package/internals/decorators/shadow-options.d.ts +2 -5
  478. package/internals/decorators/shadow-options.js.map +1 -1
  479. package/internals/definitions/defineAllComponents.js +6 -0
  480. package/internals/definitions/defineAllComponents.js.map +1 -1
  481. package/internals/directives/drag.d.ts +51 -81
  482. package/internals/directives/drag.js +27 -89
  483. package/internals/directives/drag.js.map +1 -1
  484. package/internals/directives/pointer-operation.d.ts +75 -0
  485. package/internals/directives/pointer-operation.js +92 -0
  486. package/internals/directives/pointer-operation.js.map +1 -0
  487. package/internals/directives/resize.d.ts +36 -64
  488. package/internals/directives/resize.js +18 -85
  489. package/internals/directives/resize.js.map +1 -1
  490. package/internals/i18n/EN/calendar.resources.d.ts +8 -2
  491. package/internals/i18n/EN/calendar.resources.js +2 -2
  492. package/internals/i18n/EN/calendar.resources.js.map +1 -1
  493. package/internals/i18n/EN/chat.resources.d.ts +8 -2
  494. package/internals/i18n/EN/chat.resources.js +3 -10
  495. package/internals/i18n/EN/chat.resources.js.map +1 -1
  496. package/internals/i18n/EN/date-picker.resources.d.ts +6 -4
  497. package/internals/i18n/EN/date-picker.resources.js +1 -7
  498. package/internals/i18n/EN/date-picker.resources.js.map +1 -1
  499. package/internals/i18n/EN/date-range-picker.resources.d.ts +9 -2
  500. package/internals/i18n/EN/date-range-picker.resources.js +2 -2
  501. package/internals/i18n/EN/date-range-picker.resources.js.map +1 -1
  502. package/internals/i18n/i18n-controller.d.ts +44 -46
  503. package/internals/i18n/i18n-controller.js +46 -33
  504. package/internals/i18n/i18n-controller.js.map +1 -1
  505. package/internals/i18n/utils.d.ts +9 -4
  506. package/internals/i18n/utils.js +4 -27
  507. package/internals/i18n/utils.js.map +1 -1
  508. package/internals/mixins/alert.d.ts +10 -25
  509. package/internals/mixins/alert.js.map +1 -1
  510. package/internals/mixins/combo-box.d.ts +21 -11
  511. package/internals/mixins/combo-box.js +16 -22
  512. package/internals/mixins/combo-box.js.map +1 -1
  513. package/internals/mixins/event-emitter.js +9 -11
  514. package/internals/mixins/event-emitter.js.map +1 -1
  515. package/internals/mixins/forms/associated-required.d.ts +4 -4
  516. package/internals/mixins/forms/associated-required.js.map +1 -1
  517. package/internals/mixins/forms/associated.d.ts +4 -2
  518. package/internals/mixins/forms/associated.js +8 -19
  519. package/internals/mixins/forms/associated.js.map +1 -1
  520. package/internals/mixins/forms/form-transformers.js.map +1 -1
  521. package/internals/mixins/forms/types.d.ts +24 -80
  522. package/internals/mixins/forms/types.js.map +1 -1
  523. package/internals/mixins/group.d.ts +18 -0
  524. package/internals/mixins/group.js +37 -0
  525. package/internals/mixins/group.js.map +1 -0
  526. package/internals/mixins/i18n.d.ts +10 -16
  527. package/internals/mixins/i18n.js.map +1 -1
  528. package/internals/mixins/mask-behavior.d.ts +8 -22
  529. package/internals/mixins/mask-behavior.js +1 -2
  530. package/internals/mixins/mask-behavior.js.map +1 -1
  531. package/internals/mixins/option.d.ts +1 -2
  532. package/internals/mixins/option.js +2 -1
  533. package/internals/mixins/option.js.map +1 -1
  534. package/internals/part-map.d.ts +4 -2
  535. package/internals/part-map.js +1 -1
  536. package/internals/part-map.js.map +1 -1
  537. package/internals/templates/input-shell.d.ts +8 -17
  538. package/internals/templates/input-shell.js +4 -1
  539. package/internals/templates/input-shell.js.map +1 -1
  540. package/internals/templates/masked-input.d.ts +7 -8
  541. package/internals/templates/masked-input.js.map +1 -1
  542. package/internals/templates/slotted-icon.d.ts +7 -12
  543. package/internals/templates/slotted-icon.js.map +1 -1
  544. package/internals/templates/toggle-shell.d.ts +6 -7
  545. package/internals/templates/toggle-shell.js.map +1 -1
  546. package/internals/timing.d.ts +5 -14
  547. package/internals/timing.js.map +1 -1
  548. package/internals/utils/arrays.d.ts +21 -21
  549. package/internals/utils/arrays.js +14 -0
  550. package/internals/utils/arrays.js.map +1 -1
  551. package/internals/utils/dom.d.ts +51 -39
  552. package/internals/utils/dom.js +1 -2
  553. package/internals/utils/dom.js.map +1 -1
  554. package/internals/utils/events.d.ts +29 -16
  555. package/internals/utils/events.js +9 -1
  556. package/internals/utils/events.js.map +1 -1
  557. package/internals/utils/lit.d.ts +5 -2
  558. package/internals/utils/lit.js.map +1 -1
  559. package/internals/utils/math.d.ts +8 -6
  560. package/internals/utils/math.js.map +1 -1
  561. package/internals/utils/objects.d.ts +3 -20
  562. package/internals/utils/objects.js +1 -39
  563. package/internals/utils/objects.js.map +1 -1
  564. package/internals/utils/strings.d.ts +9 -11
  565. package/internals/utils/strings.js.map +1 -1
  566. package/internals/utils/types.d.ts +16 -3
  567. package/internals/utils/types.js +3 -0
  568. package/internals/utils/types.js.map +1 -1
  569. package/internals/validators.d.ts +9 -8
  570. package/internals/validators.js +12 -6
  571. package/internals/validators.js.map +1 -1
  572. package/package.json +1 -1
  573. package/skills/README.md +3 -0
  574. package/skills/igniteui-wc-figma-to-app/SKILL.md +907 -0
  575. package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +363 -0
  576. package/skills/igniteui-wc-figma-to-app/references/design-token-bridge.md +407 -0
  577. package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +325 -0
  578. package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +409 -0
  579. package/skills/igniteui-wc-figma-to-app/references/validation-patterns.md +376 -0
  580. package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +21 -0
  581. package/skills/igniteui-wc-integrate-with-framework/SKILL.md +4 -3
  582. package/skills/igniteui-wc-integrate-with-framework/references/vanilla-js.md +14 -0
  583. package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +12 -2
  584. package/theming/config.d.ts +14 -5
  585. package/theming/config.js +38 -18
  586. package/theming/config.js.map +1 -1
  587. package/theming/context.d.ts +1 -23
  588. package/theming/context.js.map +1 -1
  589. package/theming/theming-controller.d.ts +2 -32
  590. package/theming/theming-controller.js +15 -21
  591. package/theming/theming-controller.js.map +1 -1
  592. package/theming/theming-event.d.ts +0 -7
  593. package/theming/theming-event.js +0 -13
  594. package/theming/theming-event.js.map +1 -1
  595. package/theming/types.d.ts +1 -8
  596. package/theming/types.js.map +1 -1
  597. package/web-types.json +3 -3
  598. package/animations/presets/slide/index.d.ts +0 -3
  599. package/animations/presets/slide/index.js +0 -16
  600. package/animations/presets/slide/index.js.map +0 -1
  601. package/internals/controllers/root-scroll.d.ts +0 -31
  602. package/internals/controllers/root-scroll.js +0 -71
  603. package/internals/controllers/root-scroll.js.map +0 -1
  604. package/theming/utils.d.ts +0 -11
  605. package/theming/utils.js +0 -20
  606. package/theming/utils.js.map +0 -1
@@ -1,9 +1,8 @@
1
- import type { LitElement, TemplateResult } from 'lit';
2
- import type { ValidationContainerConfig } from '../../../components/validation-container/validation-container.js';
3
- import type { ElementInternalsController } from '../../controllers/internals.js';
1
+ import type { LitElement } from 'lit';
2
+ import type { ElementInternalsController, FormValueType } from '../../controllers/internals.js';
4
3
  import type { Validator } from '../../validators.js';
5
4
  export type FormRestoreMode = 'autocomplete' | 'restore';
6
- export type FormValueType = string | File | FormData | null;
5
+ export type { FormValueType };
7
6
  export type IgcFormControl = LitElement & (FormAssociatedElementInterface | FormAssociatedCheckboxElementInterface);
8
7
  export declare class BaseFormAssociatedElement {
9
8
  static readonly formAssociated: boolean;
@@ -32,103 +31,49 @@ export declare class BaseFormAssociatedElement {
32
31
  name: string;
33
32
  /** Returns the HTMLFormElement associated with this element. */
34
33
  get form(): HTMLFormElement | null;
35
- /**
36
- * Returns a ValidityState object which represents the different validity states
37
- * the element can be in, with respect to constraint validation.
38
- */
34
+ /** Returns a `ValidityState` object for the element. */
39
35
  get validity(): ValidityState;
40
36
  /** A string containing the validation message of this element. */
41
37
  get validationMessage(): string;
42
38
  /**
43
- * A boolean value which returns true if the element is a submittable element
44
- * that is a candidate for constraint validation.
39
+ * Returns `true` when the element is a candidate for constraint validation.
45
40
  */
46
41
  get willValidate(): boolean;
47
- /**
48
- * Default implementation for handling the `Enter` key press on the component.
49
- * Checks if the component is inside a form and if so, submits it.
50
- */
42
+ /** Submits the parent form, if any, on `Enter`. */
51
43
  protected _handleEnterKeydown(event: KeyboardEvent): void;
52
- /**
53
- * Sets the **touched** state of the component and invokes {@link BaseFormAssociatedElement._validate | `_validate()`} method.
54
- *
55
- * As the naming of the method suggests, this should be invoked either on **blur** or **focusout**, depending
56
- * on the DOM structure and how focus state is managed by the component.
57
- */
44
+ /** Sets **touched**, then validates. Call this on blur or focusout. */
58
45
  protected _handleBlur(): void;
59
- /**
60
- * Sets the **touched** state of the component and **DOES NOT** invoke {@link BaseFormAssociatedElement._validate | `_validate()`} method.
61
- *
62
- * This should be called whenever a user interaction triggers a response, usually an event, from the component in
63
- * regards to its value.
64
- */
46
+ /** Sets **touched** without validating. Call this on a user interaction. */
65
47
  protected _setTouchedState(): void;
66
- /**
67
- * Sets the **touched** state of the component and emits `eventName` - the pair every
68
- * user-interaction handler must apply when it responds to input.
69
- *
70
- * The host must compose the event-emitter mixin somewhere in its heritage.
71
- */
48
+ /** Sets **touched**, then emits `eventName`. Needs the emitter mixin. */
72
49
  protected _emitTouchedEvent(eventName: string, init?: CustomEventInit): boolean;
73
- /**
74
- * Renders a validation container bound to the component, projecting its helper-text
75
- * and validation message slots.
76
- */
77
- protected _renderValidationContainer(config?: ValidationContainerConfig): TemplateResult;
78
- /**
79
- * Sets the default value of the component.
80
- * Called in `attributeChangedCallback` (i.e. when the `value` attribute of the control is set).
81
- */
50
+ /** Sets the default value from a change of the `value` attribute. */
82
51
  protected _setDefaultValue(current: string | null): void;
83
- /**
84
- * Called when the associated parent form is reset.
85
- */
52
+ /** Restores the default value on a form reset. */
86
53
  protected _restoreDefaultValue(): void;
87
- /**
88
- * Executes the component validators and updates the internal validity state.
89
- */
54
+ /** Runs the validators and updates the internal validity state. */
90
55
  protected _validate(message?: string): void;
91
- /**
92
- * Sets the component's submission value and state.
93
- */
56
+ /** Sets the submission value and the submission state. */
94
57
  protected _setFormValue(value: FormValueType, state?: FormValueType): void;
95
- /**
96
- * Called by the browser when it associates/disassociates the component with/from a given form element.
97
- * Receives the form element as a parameter.
98
- *
99
- * @remarks
100
- * This is not implemented currently.
101
- */
58
+ /** Runs on form association or de-association. Not implemented. */
102
59
  protected formAssociatedCallback(form: HTMLFormElement): void;
103
60
  /**
104
- * Called whenever the component or a parent `fieldset` elements are disabled.
105
- * Receives the current disabled state.
61
+ * Runs when the component, or a parent `fieldset`, becomes disabled or
62
+ * enabled.
106
63
  */
107
64
  protected formDisabledCallback(state: boolean): void;
108
65
  /**
109
- * Called when the form is reset.
110
- * Resets the component value/checked state to the default one, internal state and validation.
111
- *
112
- * @remarks
113
- * The default implementation calls {@link BaseFormAssociatedElement._restoreDefaultValue | `_restoreDefaultValue`}.
114
- * If additional customization is needed, it is better to override that method instead of this callback.
66
+ * Resets the value, state and validation to the defaults. Override
67
+ * `_restoreDefaultValue`, not this callback.
115
68
  */
116
69
  protected formResetCallback(): void;
117
- /**
118
- * Called when the browser attempts to automatically fill out the component.
119
- *
120
- * @remarks
121
- * This is not implemented currently.
122
- */
70
+ /** Runs on browser auto-fill. Not implemented. */
123
71
  protected formStateRestoreCallback(state: FormValueType, mode: FormRestoreMode): void;
124
- /** Checks for validity of the control and emits the invalid event if it's invalid. */
72
+ /** Checks validity and emits `invalid` when the control is invalid. */
125
73
  checkValidity(): boolean;
126
- /** Checks for validity of the control and shows the browser message if it's invalid. */
74
+ /** Checks validity and shows the browser message when invalid. */
127
75
  reportValidity(): boolean;
128
- /**
129
- * Sets a custom validation message for the control.
130
- * As long as `message` is not empty, the control is considered invalid.
131
- */
76
+ /** Sets a custom message. Invalid while `message` is not empty. */
132
77
  setCustomValidity(message: string): void;
133
78
  }
134
79
  export declare class FormAssociatedElementInterface extends BaseFormAssociatedElement {
@@ -136,9 +81,8 @@ export declare class FormAssociatedElementInterface extends BaseFormAssociatedEl
136
81
  set defaultValue(value: unknown);
137
82
  get defaultValue(): unknown;
138
83
  /**
139
- * Commits a user-initiated value change: sets the **touched** state **before** assigning
140
- * to the public `value` setter, so the validation cycle the setter runs applies invalid
141
- * styling in the same pass, then emits `eventName` with the coerced value as `detail`.
84
+ * Commits a user value change, then emits `eventName`. Sets **touched**
85
+ * *before* the `value` assignment, so the setter styles invalid at once.
142
86
  */
143
87
  protected _commitValue(value: unknown, eventName: string): boolean;
144
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/internals/mixins/forms/types.ts"],"names":[],"mappings":"AAkNA,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC","sourcesContent":["import type { LitElement, TemplateResult } from 'lit';\nimport type { ValidationContainerConfig } from '../../../components/validation-container/validation-container.js';\nimport type { ElementInternalsController } from '../../controllers/internals.js';\nimport type { Validator } from '../../validators.js';\n\nexport type FormRestoreMode = 'autocomplete' | 'restore';\nexport type FormValueType = string | File | FormData | null;\nexport type IgcFormControl = LitElement &\n (FormAssociatedElementInterface | FormAssociatedCheckboxElementInterface);\n\nexport declare class BaseFormAssociatedElement {\n public static readonly formAssociated: boolean;\n\n //#region Properties\n\n protected readonly _internals: ElementInternalsController;\n protected readonly _formValue: unknown;\n\n protected _pristine: boolean;\n protected _disabled: boolean;\n protected _invalid: boolean;\n\n protected get __validators(): Validator[];\n\n /**\n * The disabled state of the component.\n * @attr\n * @default false\n */\n public disabled: boolean;\n\n /**\n * Sets the control into invalid state (visual state only).\n * @attr\n * @default false\n */\n public invalid: boolean;\n\n /**\n * The name of the control, submitted with the form data.\n * @attr\n */\n public name: string;\n\n /** Returns the HTMLFormElement associated with this element. */\n public get form(): HTMLFormElement | null;\n\n /**\n * Returns a ValidityState object which represents the different validity states\n * the element can be in, with respect to constraint validation.\n */\n public get validity(): ValidityState;\n\n /** A string containing the validation message of this element. */\n public get validationMessage(): string;\n\n /**\n * A boolean value which returns true if the element is a submittable element\n * that is a candidate for constraint validation.\n */\n public get willValidate(): boolean;\n\n //#endregion\n\n //#region Methods\n\n /**\n * Default implementation for handling the `Enter` key press on the component.\n * Checks if the component is inside a form and if so, submits it.\n */\n protected _handleEnterKeydown(event: KeyboardEvent): void;\n\n /**\n * Sets the **touched** state of the component and invokes {@link BaseFormAssociatedElement._validate | `_validate()`} method.\n *\n * As the naming of the method suggests, this should be invoked either on **blur** or **focusout**, depending\n * on the DOM structure and how focus state is managed by the component.\n */\n protected _handleBlur(): void;\n\n /**\n * Sets the **touched** state of the component and **DOES NOT** invoke {@link BaseFormAssociatedElement._validate | `_validate()`} method.\n *\n * This should be called whenever a user interaction triggers a response, usually an event, from the component in\n * regards to its value.\n */\n protected _setTouchedState(): void;\n\n /**\n * Sets the **touched** state of the component and emits `eventName` - the pair every\n * user-interaction handler must apply when it responds to input.\n *\n * The host must compose the event-emitter mixin somewhere in its heritage.\n */\n protected _emitTouchedEvent(\n eventName: string,\n init?: CustomEventInit\n ): boolean;\n\n /**\n * Renders a validation container bound to the component, projecting its helper-text\n * and validation message slots.\n */\n protected _renderValidationContainer(\n config?: ValidationContainerConfig\n ): TemplateResult;\n\n /**\n * Sets the default value of the component.\n * Called in `attributeChangedCallback` (i.e. when the `value` attribute of the control is set).\n */\n protected _setDefaultValue(current: string | null): void;\n\n /**\n * Called when the associated parent form is reset.\n */\n protected _restoreDefaultValue(): void;\n\n /**\n * Executes the component validators and updates the internal validity state.\n */\n protected _validate(message?: string): void;\n\n /**\n * Sets the component's submission value and state.\n */\n protected _setFormValue(value: FormValueType, state?: FormValueType): void;\n\n /**\n * Called by the browser when it associates/disassociates the component with/from a given form element.\n * Receives the form element as a parameter.\n *\n * @remarks\n * This is not implemented currently.\n */\n protected formAssociatedCallback(form: HTMLFormElement): void;\n\n /**\n * Called whenever the component or a parent `fieldset` elements are disabled.\n * Receives the current disabled state.\n */\n protected formDisabledCallback(state: boolean): void;\n\n /**\n * Called when the form is reset.\n * Resets the component value/checked state to the default one, internal state and validation.\n *\n * @remarks\n * The default implementation calls {@link BaseFormAssociatedElement._restoreDefaultValue | `_restoreDefaultValue`}.\n * If additional customization is needed, it is better to override that method instead of this callback.\n */\n protected formResetCallback(): void;\n\n /**\n * Called when the browser attempts to automatically fill out the component.\n *\n * @remarks\n * This is not implemented currently.\n */\n protected formStateRestoreCallback(\n state: FormValueType,\n mode: FormRestoreMode\n ): void;\n\n /** Checks for validity of the control and emits the invalid event if it's invalid. */\n public checkValidity(): boolean;\n\n /** Checks for validity of the control and shows the browser message if it's invalid. */\n public reportValidity(): boolean;\n\n /**\n * Sets a custom validation message for the control.\n * As long as `message` is not empty, the control is considered invalid.\n */\n public setCustomValidity(message: string): void;\n\n //#endregion\n}\n\nexport declare class FormAssociatedElementInterface extends BaseFormAssociatedElement {\n /** The initial value of the component. */\n public set defaultValue(value: unknown);\n public get defaultValue(): unknown;\n\n /**\n * Commits a user-initiated value change: sets the **touched** state **before** assigning\n * to the public `value` setter, so the validation cycle the setter runs applies invalid\n * styling in the same pass, then emits `eventName` with the coerced value as `detail`.\n */\n protected _commitValue(value: unknown, eventName: string): boolean;\n}\n\nexport declare class FormAssociatedCheckboxElementInterface extends BaseFormAssociatedElement {\n /** The initial checked state of the component. */\n public set defaultChecked(value: boolean);\n public get defaultChecked(): boolean;\n}\n\nexport declare class FormRequiredInterface {\n protected _required: boolean;\n\n /**\n * When set, makes the component a required field for validation.\n * @attr\n * @default false\n */\n public set required(value: boolean);\n public get required(): boolean;\n}\n\nexport const InternalInvalidEvent = 'igc-form-internal-invalid';\nexport const InternalResetEvent = 'igc-form-internal-reset';\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/internals/mixins/forms/types.ts"],"names":[],"mappings":"AA0JA,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport type {\n ElementInternalsController,\n FormValueType,\n} from '../../controllers/internals.js';\nimport type { Validator } from '../../validators.js';\n\nexport type FormRestoreMode = 'autocomplete' | 'restore';\nexport type { FormValueType };\nexport type IgcFormControl = LitElement &\n (FormAssociatedElementInterface | FormAssociatedCheckboxElementInterface);\n\nexport declare class BaseFormAssociatedElement {\n public static readonly formAssociated: boolean;\n\n //#region Properties\n\n protected readonly _internals: ElementInternalsController;\n protected readonly _formValue: unknown;\n\n protected _pristine: boolean;\n protected _disabled: boolean;\n protected _invalid: boolean;\n\n protected get __validators(): Validator[];\n\n /**\n * The disabled state of the component.\n * @attr\n * @default false\n */\n public disabled: boolean;\n\n /**\n * Sets the control into invalid state (visual state only).\n * @attr\n * @default false\n */\n public invalid: boolean;\n\n /**\n * The name of the control, submitted with the form data.\n * @attr\n */\n public name: string;\n\n /** Returns the HTMLFormElement associated with this element. */\n public get form(): HTMLFormElement | null;\n\n /** Returns a `ValidityState` object for the element. */\n public get validity(): ValidityState;\n\n /** A string containing the validation message of this element. */\n public get validationMessage(): string;\n\n /**\n * Returns `true` when the element is a candidate for constraint validation.\n */\n public get willValidate(): boolean;\n\n //#endregion\n\n //#region Methods\n\n /** Submits the parent form, if any, on `Enter`. */\n protected _handleEnterKeydown(event: KeyboardEvent): void;\n\n /** Sets **touched**, then validates. Call this on blur or focusout. */\n protected _handleBlur(): void;\n\n /** Sets **touched** without validating. Call this on a user interaction. */\n protected _setTouchedState(): void;\n\n /** Sets **touched**, then emits `eventName`. Needs the emitter mixin. */\n protected _emitTouchedEvent(\n eventName: string,\n init?: CustomEventInit\n ): boolean;\n\n /** Sets the default value from a change of the `value` attribute. */\n protected _setDefaultValue(current: string | null): void;\n\n /** Restores the default value on a form reset. */\n protected _restoreDefaultValue(): void;\n\n /** Runs the validators and updates the internal validity state. */\n protected _validate(message?: string): void;\n\n /** Sets the submission value and the submission state. */\n protected _setFormValue(value: FormValueType, state?: FormValueType): void;\n\n /** Runs on form association or de-association. Not implemented. */\n protected formAssociatedCallback(form: HTMLFormElement): void;\n\n /**\n * Runs when the component, or a parent `fieldset`, becomes disabled or\n * enabled.\n */\n protected formDisabledCallback(state: boolean): void;\n\n /**\n * Resets the value, state and validation to the defaults. Override\n * `_restoreDefaultValue`, not this callback.\n */\n protected formResetCallback(): void;\n\n /** Runs on browser auto-fill. Not implemented. */\n protected formStateRestoreCallback(\n state: FormValueType,\n mode: FormRestoreMode\n ): void;\n\n /** Checks validity and emits `invalid` when the control is invalid. */\n public checkValidity(): boolean;\n\n /** Checks validity and shows the browser message when invalid. */\n public reportValidity(): boolean;\n\n /** Sets a custom message. Invalid while `message` is not empty. */\n public setCustomValidity(message: string): void;\n\n //#endregion\n}\n\nexport declare class FormAssociatedElementInterface extends BaseFormAssociatedElement {\n /** The initial value of the component. */\n public set defaultValue(value: unknown);\n public get defaultValue(): unknown;\n\n /**\n * Commits a user value change, then emits `eventName`. Sets **touched**\n * *before* the `value` assignment, so the setter styles invalid at once.\n */\n protected _commitValue(value: unknown, eventName: string): boolean;\n}\n\nexport declare class FormAssociatedCheckboxElementInterface extends BaseFormAssociatedElement {\n /** The initial checked state of the component. */\n public set defaultChecked(value: boolean);\n public get defaultChecked(): boolean;\n}\n\nexport declare class FormRequiredInterface {\n protected _required: boolean;\n\n /**\n * When set, makes the component a required field for validation.\n * @attr\n * @default false\n */\n public set required(value: boolean);\n public get required(): boolean;\n}\n\nexport const InternalInvalidEvent = 'igc-form-internal-invalid';\nexport const InternalResetEvent = 'igc-form-internal-reset';\n"]}
@@ -0,0 +1,18 @@
1
+ import { LitElement } from 'lit';
2
+ import { type ARIAState } from '../controllers/internals.js';
3
+ /**
4
+ * The shared base of `igc-dropdown-group` and `igc-select-group`: a labelled
5
+ * `group` container for a list of items.
6
+ */
7
+ export declare abstract class IgcGroupBaseComponent extends LitElement {
8
+ private readonly _internals;
9
+ private readonly _slots;
10
+ /** The ARIA state of the host, in addition to its role. Empty by default. */
11
+ protected _resolveARIA(): ARIAState;
12
+ /**
13
+ * The label renders in this shadow root, out of reach of an
14
+ * `aria-labelledby` on the host, so its text names the `group` directly.
15
+ */
16
+ private _labelChange;
17
+ protected render(): import("lit-html").TemplateResult<1>;
18
+ }
@@ -0,0 +1,37 @@
1
+ import { html, LitElement } from 'lit';
2
+ import { addInternalsController, } from '../controllers/internals.js';
3
+ import { addSlotController, setSlots } from '../controllers/slot.js';
4
+ const Slots = setSlots('label');
5
+ const NO_ARIA = {};
6
+ export class IgcGroupBaseComponent extends LitElement {
7
+ constructor() {
8
+ super(...arguments);
9
+ this._internals = addInternalsController(this, {
10
+ initialARIA: {
11
+ role: 'group',
12
+ },
13
+ aria: () => this._resolveARIA(),
14
+ });
15
+ this._slots = addSlotController(this, {
16
+ slots: Slots,
17
+ initial: true,
18
+ onChange: this._labelChange,
19
+ });
20
+ }
21
+ _resolveARIA() {
22
+ return NO_ARIA;
23
+ }
24
+ _labelChange() {
25
+ const label = this._slots.getAssignedText('label', true);
26
+ this._internals.setARIA({ ariaLabel: label || null });
27
+ }
28
+ render() {
29
+ return html `
30
+ <label part="label">
31
+ <slot name="label"></slot>
32
+ </label>
33
+ <slot></slot>
34
+ `;
35
+ }
36
+ }
37
+ //# sourceMappingURL=group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.js","sourceRoot":"","sources":["../../../src/internals/mixins/group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAEL,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAErE,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;AAGhC,MAAM,OAAO,GAAc,EAAE,CAAC;AAO9B,MAAM,OAAgB,qBAAsB,SAAQ,UAAU;IAA9D;;QACmB,eAAU,GAAG,sBAAsB,CAAC,IAAI,EAAE;YACzD,WAAW,EAAE;gBACX,IAAI,EAAE,OAAO;aACd;YACD,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE;SAChC,CAAC,CAAC;QAEc,WAAM,GAAG,iBAAiB,CAAC,IAAI,EAAE;YAChD,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI,CAAC,YAAY;SAC5B,CAAC,CAAC;IAwBL,CAAC;IArBW,YAAY;QACpB,OAAO,OAAO,CAAC;IACjB,CAAC;IAMO,YAAY;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA;;;;;KAKV,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { html, LitElement } from 'lit';\nimport {\n type ARIAState,\n addInternalsController,\n} from '../controllers/internals.js';\nimport { addSlotController, setSlots } from '../controllers/slot.js';\n\nconst Slots = setSlots('label');\n\n/** The ARIA state of a group that adds nothing to its role. */\nconst NO_ARIA: ARIAState = {};\n\n/* omitModule */\n/**\n * The shared base of `igc-dropdown-group` and `igc-select-group`: a labelled\n * `group` container for a list of items.\n */\nexport abstract class IgcGroupBaseComponent extends LitElement {\n private readonly _internals = addInternalsController(this, {\n initialARIA: {\n role: 'group',\n },\n aria: () => this._resolveARIA(),\n });\n\n private readonly _slots = addSlotController(this, {\n slots: Slots,\n initial: true,\n onChange: this._labelChange,\n });\n\n /** The ARIA state of the host, in addition to its role. Empty by default. */\n protected _resolveARIA(): ARIAState {\n return NO_ARIA;\n }\n\n /**\n * The label renders in this shadow root, out of reach of an\n * `aria-labelledby` on the host, so its text names the `group` directly.\n */\n private _labelChange(): void {\n const label = this._slots.getAssignedText('label', true);\n this._internals.setARIA({ ariaLabel: label || null });\n }\n\n protected override render() {\n return html`\n <label part=\"label\">\n <slot name=\"label\"></slot>\n </label>\n <slot></slot>\n `;\n }\n}\n"]}
@@ -9,23 +9,17 @@ export declare class I18nInterface<T extends object, TGet extends T = Required<T
9
9
  get resourceStrings(): TGet;
10
10
  }
11
11
  /**
12
- * Mixes in the localization surface of a component - the `locale` and
13
- * `resourceStrings` reactive properties forwarding to an i18n controller
14
- * created with the passed configuration.
12
+ * Adds the `locale` and `resourceStrings` properties, both backed by the
13
+ * protected `_i18nController` that `config` creates.
15
14
  *
16
- * The controller is exposed as the protected `_i18nController` for hosts
17
- * that need direct access.
15
+ * @remarks
16
+ * `TGet` defaults to `Required<T>`, because the controller merges the full
17
+ * `defaultEN` set under any overrides, so every key resolves. A component
18
+ * that also accepts a deprecated resource shape overrides `TGet` with the
19
+ * intersection of the two shapes.
18
20
  *
19
- * `TGet` is the type of the resolved strings. It defaults to `Required<T>`,
20
- * because the controller merges the full `defaultEN` set under any overrides,
21
- * so every key resolves even though the resource interfaces declare them
22
- * optional. Components that still accept a deprecated component-specific
23
- * resource shape override it: `T` is the union of the two shapes accepted,
24
- * `TGet` their intersection.
25
- *
26
- * The base class must be the first argument - the manifest analyzer resolves
27
- * the superclass of an `extends Mixin(...)` clause from the first argument,
28
- * and a leading config object would sever the inheritance chain in the
29
- * manifest (dropping every inherited public member from the docs).
21
+ * The base class must be the first argument. The manifest analyzer reads the
22
+ * superclass of `extends Mixin(...)` from that argument; a leading config
23
+ * object drops every inherited public member from the docs.
30
24
  */
31
25
  export declare function I18nMixin<T extends object, B extends AbstractConstructor<LitElement>, TGet extends T = Required<T>>(superClass: B, config: I18nControllerConfig<T>): AbstractConstructor<I18nInterface<T, TGet>> & B;
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/internals/mixins/i18n.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,iBAAiB,GAGlB,MAAM,4BAA4B,CAAC;AAkCpC,MAAM,UAAU,SAAS,CAIvB,UAAa,EAAE,MAA+B;IAC9C,MAAe,WAAY,SAAQ,UAAU;QAA7C;;YACqB,oBAAe,GAAG,iBAAiB,CAAI,IAAI,EAAE,MAAM,CAAC,CAAC;QA2B1E,CAAC;QAnBC,IAAW,MAAM,CAAC,KAAa;YAC7B,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,KAAK,CAAC;QACtC,CAAC;QAED,IAAW,MAAM;YACf,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;QACrC,CAAC;QAMD,IAAW,eAAe,CAAC,KAAQ;YACjC,IAAI,CAAC,eAAe,CAAC,eAAe,GAAG,KAAK,CAAC;QAC/C,CAAC;QAED,IAAW,eAAe;YACxB,OAAO,IAAI,CAAC,eAAe,CAAC,eAAuB,CAAC;QACtD,CAAC;KACF;IAnBC;QADC,QAAQ,EAAE;6CAGV;IAUD;QADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;sDAG9B;IAMH,OAAO,WACJ,CAAC;AACN,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport {\n addI18nController,\n type I18nController,\n type I18nControllerConfig,\n} from '../i18n/i18n-controller.js';\nimport type { AbstractConstructor } from './constructor.js';\n\nexport declare class I18nInterface<\n T extends object,\n TGet extends T = Required<T>,\n> {\n protected readonly _i18nController: I18nController<T>;\n public set locale(value: string);\n public get locale(): string;\n public set resourceStrings(value: T);\n public get resourceStrings(): TGet;\n}\n\n/**\n * Mixes in the localization surface of a component - the `locale` and\n * `resourceStrings` reactive properties forwarding to an i18n controller\n * created with the passed configuration.\n *\n * The controller is exposed as the protected `_i18nController` for hosts\n * that need direct access.\n *\n * `TGet` is the type of the resolved strings. It defaults to `Required<T>`,\n * because the controller merges the full `defaultEN` set under any overrides,\n * so every key resolves even though the resource interfaces declare them\n * optional. Components that still accept a deprecated component-specific\n * resource shape override it: `T` is the union of the two shapes accepted,\n * `TGet` their intersection.\n *\n * The base class must be the first argument - the manifest analyzer resolves\n * the superclass of an `extends Mixin(...)` clause from the first argument,\n * and a leading config object would sever the inheritance chain in the\n * manifest (dropping every inherited public member from the docs).\n */\nexport function I18nMixin<\n T extends object,\n B extends AbstractConstructor<LitElement>,\n TGet extends T = Required<T>,\n>(superClass: B, config: I18nControllerConfig<T>) {\n abstract class I18nElement extends superClass {\n protected readonly _i18nController = addI18nController<T>(this, config);\n\n /**\n * The locale used to resolve the component's resource strings.\n * Falls back to the global locale when not set.\n * @attr locale\n */\n @property()\n public set locale(value: string) {\n this._i18nController.locale = value;\n }\n\n public get locale(): string {\n return this._i18nController.locale;\n }\n\n /**\n * The resource strings for localization.\n */\n @property({ attribute: false })\n public set resourceStrings(value: T) {\n this._i18nController.resourceStrings = value;\n }\n\n public get resourceStrings(): TGet {\n return this._i18nController.resourceStrings as TGet;\n }\n }\n return I18nElement as unknown as AbstractConstructor<I18nInterface<T, TGet>> &\n B;\n}\n"]}
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/internals/mixins/i18n.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,iBAAiB,GAGlB,MAAM,4BAA4B,CAAC;AA4BpC,MAAM,UAAU,SAAS,CAIvB,UAAa,EAAE,MAA+B;IAC9C,MAAe,WAAY,SAAQ,UAAU;QAA7C;;YACqB,oBAAe,GAAG,iBAAiB,CAAI,IAAI,EAAE,MAAM,CAAC,CAAC;QAyB1E,CAAC;QAjBC,IAAW,MAAM,CAAC,KAAa;YAC7B,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,KAAK,CAAC;QACtC,CAAC;QAED,IAAW,MAAM;YACf,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;QACrC,CAAC;QAID,IAAW,eAAe,CAAC,KAAQ;YACjC,IAAI,CAAC,eAAe,CAAC,eAAe,GAAG,KAAK,CAAC;QAC/C,CAAC;QAED,IAAW,eAAe;YACxB,OAAO,IAAI,CAAC,eAAe,CAAC,eAAuB,CAAC;QACtD,CAAC;KACF;IAjBC;QADC,QAAQ,EAAE;6CAGV;IAQD;QADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;sDAG9B;IAMH,OAAO,WACJ,CAAC;AACN,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport {\n addI18nController,\n type I18nController,\n type I18nControllerConfig,\n} from '../i18n/i18n-controller.js';\nimport type { AbstractConstructor } from './constructor.js';\n\nexport declare class I18nInterface<\n T extends object,\n TGet extends T = Required<T>,\n> {\n protected readonly _i18nController: I18nController<T>;\n public set locale(value: string);\n public get locale(): string;\n public set resourceStrings(value: T);\n public get resourceStrings(): TGet;\n}\n\n/**\n * Adds the `locale` and `resourceStrings` properties, both backed by the\n * protected `_i18nController` that `config` creates.\n *\n * @remarks\n * `TGet` defaults to `Required<T>`, because the controller merges the full\n * `defaultEN` set under any overrides, so every key resolves. A component\n * that also accepts a deprecated resource shape overrides `TGet` with the\n * intersection of the two shapes.\n *\n * The base class must be the first argument. The manifest analyzer reads the\n * superclass of `extends Mixin(...)` from that argument; a leading config\n * object drops every inherited public member from the docs.\n */\nexport function I18nMixin<\n T extends object,\n B extends AbstractConstructor<LitElement>,\n TGet extends T = Required<T>,\n>(superClass: B, config: I18nControllerConfig<T>) {\n abstract class I18nElement extends superClass {\n protected readonly _i18nController = addI18nController<T>(this, config);\n\n /**\n * The locale for the resource strings. Falls back to the global locale.\n *\n * @attr locale\n */\n @property()\n public set locale(value: string) {\n this._i18nController.locale = value;\n }\n\n public get locale(): string {\n return this._i18nController.locale;\n }\n\n /** The resource strings for localization. */\n @property({ attribute: false })\n public set resourceStrings(value: T) {\n this._i18nController.resourceStrings = value;\n }\n\n public get resourceStrings(): TGet {\n return this._i18nController.resourceStrings as TGet;\n }\n }\n return I18nElement as unknown as AbstractConstructor<I18nInterface<T, TGet>> &\n B;\n}\n"]}
@@ -3,22 +3,20 @@ import { type MaskEditKind, type MaskHistory } from '../../components/mask-input
3
3
  import type { MaskParser } from '../../components/mask-input/mask-parser.js';
4
4
  import type { RangeTextSelectMode, SelectionRangeDirection } from '../../components/types.js';
5
5
  import type { AbstractConstructor } from './constructor.js';
6
+ import type { BaseFormAssociatedElement } from './forms/types.js';
6
7
  export type MaskSelection = {
7
8
  start: number;
8
9
  end: number;
9
10
  };
10
11
  /**
11
- * Public + protected interface contributed by {@link MaskBehaviorMixin}.
12
- * Declared as a `declare class` so consumers can see protected members through
13
- * the cast return type (mirrors the pattern used by the form-associated mixins).
12
+ * The interface that {@link MaskBehaviorMixin} adds. A `declare class`, so the
13
+ * cast return type still exposes the protected members.
14
14
  */
15
15
  export declare class MaskBehaviorElementInterface {
16
16
  protected readonly _input?: HTMLInputElement;
17
17
  protected readonly _parser: MaskParser;
18
- /** Reflects the current parser state into the host's public value. */
18
+ /** Writes the parser state into the public value of the host. */
19
19
  protected _syncValueFromMask(): void;
20
- /** Delegates Enter-key handling to the form-associated base. */
21
- protected _handleEnterKeydown(event: KeyboardEvent): void;
22
20
  protected _maskSelection: MaskSelection;
23
21
  protected _compositionStart: number;
24
22
  protected _focused: boolean;
@@ -40,7 +38,7 @@ export declare class MaskBehaviorElementInterface {
40
38
  get mask(): string;
41
39
  set mask(value: string);
42
40
  /**
43
- * The prompt symbol to use for unfilled parts of the mask pattern.
41
+ * The prompt symbol for the unfilled parts of the mask pattern.
44
42
  * @attr
45
43
  * @default '_'
46
44
  */
@@ -64,19 +62,7 @@ export declare class MaskBehaviorElementInterface {
64
62
  setRangeText(replacement: string, start?: number, end?: number, selectMode?: RangeTextSelectMode): void;
65
63
  }
66
64
  /**
67
- * Adds masked-input behavior (parser-driven editing, selection tracking,
68
- * composition handling, range text replacement) to a LitElement-derived class.
69
- *
70
- * The host class is expected to provide:
71
- * - `_input` - the native `<input>` element (typically via `@query('input')`).
72
- * - `_parser` - a {@link MaskParser} (or subclass) instance.
73
- * - `_setTouchedState` - from `FormAssociatedMixin`.
74
- * - `_emitTouchedEvent` - from `FormAssociatedMixin`.
75
- * - `emitEvent` - from `EventEmitterMixin`.
76
- * - `select` - from the host base.
77
- *
78
- * The host class must implement `_syncValueFromMask` to bridge the masked
79
- * text back into its public `value`. It is called by the default
80
- * `_commitMaskedValue` implementation.
65
+ * Adds parser-driven editing, selection tracking, composition handling and
66
+ * text-range replacement to a form-associated element.
81
67
  */
82
- export declare function MaskBehaviorMixin<T extends AbstractConstructor<LitElement>>(superClass: T): AbstractConstructor<MaskBehaviorElementInterface> & T;
68
+ export declare function MaskBehaviorMixin<T extends AbstractConstructor<LitElement & BaseFormAssociatedElement>>(superClass: T): AbstractConstructor<MaskBehaviorElementInterface> & T;
@@ -68,7 +68,6 @@ export function MaskBehaviorMixin(superClass) {
68
68
  async _handleInput({ inputType, isComposing, }) {
69
69
  const value = this._input?.value ?? '';
70
70
  const { start, end } = this._maskSelection;
71
- const deletePosition = this._parser.getNextNonLiteralPosition(end) + 1;
72
71
  if (inputType === 'historyUndo' || inputType === 'historyRedo') {
73
72
  return this._historyStep(inputType === 'historyUndo' ? 'undo' : 'redo');
74
73
  }
@@ -85,6 +84,7 @@ export function MaskBehaviorMixin(superClass) {
85
84
  this._setTouchedState();
86
85
  switch (inputType) {
87
86
  case 'deleteContentForward': {
87
+ const deletePosition = this._parser.getNextNonLiteralPosition(end) + 1;
88
88
  await this._updateInput('', { start, end: deletePosition }, kind);
89
89
  this._input?.setSelectionRange(deletePosition, deletePosition);
90
90
  this._history.settle(this._historyText, deletePosition);
@@ -109,7 +109,6 @@ export function MaskBehaviorMixin(superClass) {
109
109
  start: this._inputSelection.start,
110
110
  end: this._inputSelection.start,
111
111
  });
112
- case undefined:
113
112
  case '':
114
113
  return this._updateInput(this._parser.parse(value.substring(start, this._inputSelection.end)), {
115
114
  start,
@@ -1 +1 @@
1
- {"version":3,"file":"mask-behavior.js","sourceRoot":"","sources":["../../../src/internals/mixins/mask-behavior.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,iBAAiB,GAIlB,MAAM,6CAA6C,CAAC;AAMrD,OAAO,EACL,cAAc,EACd,OAAO,EACP,OAAO,EACP,QAAQ,GACT,MAAM,gCAAgC,CAAC;AAcxC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAuB;IAClD,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxB,CAAC,uBAAuB,EAAE,iBAAiB,CAAC;IAC5C,CAAC,sBAAsB,EAAE,gBAAgB,CAAC;IAC1C,CAAC,aAAa,EAAE,QAAQ,CAAC;IACzB,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IAC7B,CAAC,gBAAgB,EAAE,QA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,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yDACnB;IAQxB;QADC,QAAQ,EAAE;mDAGV;IAaD;QADC,QAAQ,EAAE;qDAGV;IA0VH,OAAO,mBACJ,CAAC;AACN,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport {\n createMaskHistory,\n type MaskEditKind,\n type MaskHistory,\n type MaskHistoryState,\n} from '../../components/mask-input/mask-history.js';\nimport type { MaskParser } from '../../components/mask-input/mask-parser.js';\nimport type {\n RangeTextSelectMode,\n SelectionRangeDirection,\n} from '../../components/types.js';\nimport {\n addKeybindings,\n ctrlKey,\n metaKey,\n shiftKey,\n} from '../controllers/key-bindings.js';\nimport type { AbstractConstructor } from './constructor.js';\n\nexport type MaskSelection = {\n start: number;\n end: number;\n};\n\n/**\n * The `inputType` values the mask editor models, mapped to their undo granularity.\n *\n * Anything absent is a native mutation we do not model - auto-fill is the empty-string\n * entry, `deleteWordBackward` and friends are simply not handled.\n */\nconst MaskEditKinds = new Map<string, MaskEditKind>([\n ['insertText', 'insert'],\n ['deleteContentBackward', 'delete-backward'],\n ['deleteContentForward', 'delete-forward'],\n ['deleteByCut', 'atomic'],\n ['insertFromPaste', 'atomic'],\n ['insertFromDrop', 'atomic'],\n ['', 'atomic'],\n]);\n\n/**\n * Public + protected interface contributed by {@link MaskBehaviorMixin}.\n * Declared as a `declare class` so consumers can see protected members through\n * the cast return type (mirrors the pattern used by the form-associated mixins).\n */\nexport declare class MaskBehaviorElementInterface {\n //#region Required from host\n\n protected readonly _input?: HTMLInputElement;\n protected readonly _parser: MaskParser;\n\n /** Reflects the current parser state into the host's public value. */\n protected _syncValueFromMask(): void;\n\n /** Delegates Enter-key handling to the form-associated base. */\n protected _handleEnterKeydown(event: KeyboardEvent): void;\n\n //#endregion\n\n //#region Internal state\n\n protected _maskSelection: MaskSelection;\n protected _compositionStart: number;\n protected _focused: boolean;\n protected _maskedValue: string;\n protected readonly _history: MaskHistory;\n\n protected get _inputSelection(): MaskSelection;\n protected get _isEmptyMask(): boolean;\n protected get _historyText(): string;\n\n //#endregion\n\n //#region Public attributes and properties\n\n /**\n * Makes the control a readonly field.\n * @attr readonly\n * @default false\n */\n public readOnly: boolean;\n\n /**\n * The mask pattern of the component.\n * @attr\n */\n public get mask(): string;\n public set mask(value: string);\n\n /**\n * The prompt symbol to use for unfilled parts of the mask pattern.\n * @attr\n * @default '_'\n */\n public get prompt(): string;\n public set prompt(value: string);\n\n //#endregion\n\n //#region Event handlers\n\n protected _handleInput(event: InputEvent): Promise<void>;\n protected _handleBeforeInput(event: InputEvent): void;\n protected _updateInput(text: string, range: MaskSelection): Promise<void>;\n protected _commitMaskedValue(value: string): void;\n protected _emitInputEvent(): void;\n protected _setMaskSelection(event: Event): void;\n protected _handleCompositionStart(): void;\n protected _handleCompositionEnd(event: CompositionEvent): void;\n protected _handleClick(): void;\n\n //#endregion\n\n //#region Undo/redo\n\n protected _recordHistory(\n kind: MaskEditKind,\n next: string,\n caret: number,\n selection?: MaskSelection\n ): void;\n\n protected _historyStep(direction: 'undo' | 'redo'): Promise<void>;\n protected _historyResync(): void;\n\n //#endregion\n\n //#region Public methods\n\n /** Sets the text selection range of the control. */\n public setSelectionRange(\n start?: number,\n end?: number,\n direction?: SelectionRangeDirection\n ): void;\n\n /** Replaces the selected text in the control and re-applies the mask. */\n public setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: RangeTextSelectMode\n ): void;\n\n //#endregion\n}\n\n/**\n * Adds masked-input behavior (parser-driven editing, selection tracking,\n * composition handling, range text replacement) to a LitElement-derived class.\n *\n * The host class is expected to provide:\n * - `_input` - the native `<input>` element (typically via `@query('input')`).\n * - `_parser` - a {@link MaskParser} (or subclass) instance.\n * - `_setTouchedState` - from `FormAssociatedMixin`.\n * - `_emitTouchedEvent` - from `FormAssociatedMixin`.\n * - `emitEvent` - from `EventEmitterMixin`.\n * - `select` - from the host base.\n *\n * The host class must implement `_syncValueFromMask` to bridge the masked\n * text back into its public `value`. It is called by the default\n * `_commitMaskedValue` implementation.\n */\nexport function MaskBehaviorMixin<T extends AbstractConstructor<LitElement>>(\n superClass: T\n): AbstractConstructor<MaskBehaviorElementInterface> & T {\n abstract class MaskBehaviorElement extends superClass {\n //#region Required from host\n\n protected abstract readonly _input?: HTMLInputElement;\n protected abstract readonly _parser: MaskParser;\n protected abstract _setTouchedState(): void;\n protected abstract _emitTouchedEvent(\n eventName: string,\n init?: CustomEventInit\n ): boolean;\n public abstract select(): void;\n public abstract emitEvent(name: string, init?: CustomEventInit): boolean;\n\n protected abstract _syncValueFromMask(): void;\n protected abstract _handleEnterKeydown(event: KeyboardEvent): void;\n\n //#endregion\n\n //#region Internal state\n\n protected _maskSelection: MaskSelection = { start: 0, end: 0 };\n protected _compositionStart = 0;\n\n /**\n * The signature is the source pattern rather than the escaped one: the date parsers\n * convert a date format into mask flags, so `MM/dd/yyyy` and `dd/MM/yyyy` share an\n * escaped mask of `00/00/0000` while meaning entirely different things.\n */\n protected readonly _history = createMaskHistory(\n () => `${this._parser.mask} ${this._parser.prompt}`\n );\n\n @state()\n protected _focused = false;\n\n @state()\n protected _maskedValue = '';\n\n protected get _inputSelection(): MaskSelection {\n return {\n start: this._input?.selectionStart || 0,\n end: this._input?.selectionEnd || 0,\n };\n }\n\n /** Indicates whether the current mask value is empty. */\n protected get _isEmptyMask(): boolean {\n return this._maskedValue === this._parser.emptyMask;\n }\n\n /**\n * The masked text as the undo history sees it. `igc-mask-input` blanks it on blur and\n * restores the empty mask on focus; both spell the same empty document, so without\n * this normalization every focus of an empty editor would look like a foreign change.\n */\n protected get _historyText(): string {\n return this._maskedValue || this._parser.emptyMask;\n }\n\n //#endregion\n\n //#region Lifecycle\n\n constructor(...args: any[]) {\n super(...args);\n\n // Assigning `input.value` - which every masked edit does - clears the browser's\n // own undo stack, so the standard shortcuts have to be served from `_history`.\n // The IME owns the text until `compositionend`, hence the `isComposing` guard.\n const step =\n (direction: 'undo' | 'redo') =>\n (event: KeyboardEvent): void => {\n if (!event.isComposing) {\n this._historyStep(direction);\n }\n };\n\n addKeybindings(this, {\n skip: () => this.readOnly,\n bindingDefaults: { repeat: true },\n })\n .set([ctrlKey, 'z'], step('undo'))\n .set([metaKey, 'z'], step('undo'))\n .set([ctrlKey, 'y'], step('redo'))\n .set([ctrlKey, shiftKey, 'z'], step('redo'))\n .set([metaKey, shiftKey, 'z'], step('redo'));\n }\n\n //#endregion\n\n //#region Public attributes and properties\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 * The mask pattern of the component.\n *\n * @attr\n */\n @property()\n public set mask(value: string) {\n this._parser.mask = value;\n }\n\n public get mask(): string {\n return this._parser.mask;\n }\n\n /**\n * The prompt symbol to use for unfilled parts of the mask pattern.\n *\n * @attr\n * @default '_'\n */\n @property()\n public set prompt(value: string) {\n this._parser.prompt = value;\n }\n\n public get prompt(): string {\n return this._parser.prompt;\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected async _handleInput({\n inputType,\n isComposing,\n }: InputEvent): Promise<void> {\n const value = this._input?.value ?? '';\n const { start, end } = this._maskSelection;\n const deletePosition = this._parser.getNextNonLiteralPosition(end) + 1;\n\n // Reachable only where `beforeinput` is not cancelable - normally the browser's\n // history commands are intercepted before they ever mutate the input.\n if (inputType === 'historyUndo' || inputType === 'historyRedo') {\n return this._historyStep(inputType === 'historyUndo' ? 'undo' : 'redo');\n }\n\n // A composing backspace is handled by the composition events instead.\n if (inputType === 'deleteContentBackward' && isComposing) {\n return;\n }\n\n const kind = MaskEditKinds.get(inputType ?? '');\n\n if (kind === undefined) {\n // A non-modeled mutation has already changed the input's DOM value, so re-render\n // to let the `live()` binding roll it back to the masked text. Never mid-IME\n // though - `insertCompositionText` fires repeatedly there and resetting the value\n // underneath the browser breaks composition outright.\n if (!isComposing) {\n this.requestUpdate();\n }\n return;\n }\n\n this._setTouchedState();\n\n switch (inputType) {\n case 'deleteContentForward': {\n await this._updateInput('', { start, end: deletePosition }, kind);\n this._input?.setSelectionRange(deletePosition, deletePosition);\n // `_updateInput` settled on the parser's cursor, but the caret actually ends up\n // past the deleted character - record that so a run of deletes coalesces.\n this._history.settle(this._historyText, deletePosition);\n return;\n }\n\n case 'deleteContentBackward':\n return this._updateInput(\n '',\n {\n start: this._parser.getPreviousNonLiteralPosition(\n this._inputSelection.start + 1\n ),\n end,\n },\n kind\n );\n\n case 'deleteByCut':\n return this._updateInput('', this._maskSelection, kind);\n\n case 'insertText':\n return this._updateInput(\n value.substring(start, this._inputSelection.end),\n this._maskSelection,\n kind\n );\n\n case 'insertFromPaste':\n return this._updateInput(\n value.substring(start, this._inputSelection.end),\n {\n start,\n end: this._inputSelection.start,\n },\n kind\n );\n\n case 'insertFromDrop':\n // An external drop is preceded by no `dragstart`, so `_maskSelection` is stale.\n return this._updateInput(\n value.substring(\n this._inputSelection.start,\n this._inputSelection.end\n ),\n { ...this._inputSelection },\n kind,\n {\n start: this._inputSelection.start,\n end: this._inputSelection.start,\n }\n );\n\n // Potential browser auto-fill behavior\n case undefined:\n case '':\n return this._updateInput(\n this._parser.parse(\n value.substring(start, this._inputSelection.end)\n ),\n {\n start,\n end: this._inputSelection.end,\n },\n kind,\n { start, end: start }\n );\n }\n }\n\n /**\n * Default mask-update routine. Re-applies the parser, commits the result through\n * {@link MaskBehaviorElementInterface._commitMaskedValue} and emits an input event\n * when the edit is not at the trailing mask boundary.\n */\n protected async _updateInput(\n text: string,\n range: MaskSelection,\n kind: MaskEditKind = 'atomic',\n caretBefore?: MaskSelection\n ): Promise<void> {\n const { value, end } = this._parser.replace(\n this._maskedValue,\n text,\n range.start,\n range.end\n );\n\n this._recordHistory(kind, value, end, caretBefore ?? this._maskSelection);\n this._commitMaskedValue(value);\n this.requestUpdate();\n\n if (range.start !== this._parser.mask.length) {\n this._emitInputEvent();\n }\n\n await this.updateComplete;\n this._input?.setSelectionRange(end, end);\n }\n\n /**\n * Writes a fully-formed masked text into the component's value pipeline.\n *\n * This is the one step where the leaves genuinely differ - `igc-mask-input` commits\n * straight to its form value, while the date editors keep the text as a draft until\n * blur - so it is also the only thing undo/redo has to delegate.\n */\n protected _commitMaskedValue(value: string): void {\n this._maskedValue = value;\n this._syncValueFromMask();\n }\n\n /**\n * Emits an `igcInput` event with the current masked value as detail.\n * Override to emit a different payload (e.g. the parsed value).\n */\n protected _emitInputEvent(): void {\n this._emitTouchedEvent('igcInput', { detail: this._maskedValue });\n }\n\n protected _setMaskSelection(event: Event): void {\n this._maskSelection = this._inputSelection;\n if (event instanceof KeyboardEvent) {\n this._handleEnterKeydown(event);\n }\n }\n\n protected _handleCompositionStart(): void {\n this._compositionStart = this._inputSelection.start;\n }\n\n protected _handleCompositionEnd({ data }: CompositionEvent): void {\n // The whole composed sequence is one undo step, anchored where it began.\n this._updateInput(\n data,\n { start: this._compositionStart, end: this._inputSelection.end },\n 'atomic',\n { start: this._compositionStart, end: this._compositionStart }\n );\n }\n\n protected _handleClick(): void {\n const { selectionStart: start, selectionEnd: end } = this._input ?? {\n selectionStart: 0,\n selectionEnd: 0,\n };\n\n // Clicking at the end of the input field will select the entire mask\n if (start === end && start === this._maskedValue.length) {\n this.select();\n }\n }\n\n /**\n * Intercepts the browser's own history commands - the Edit and context menus, and\n * the software keyboard on mobile - which never reach the key bindings. The native\n * stack is empty anyway, so letting one through would only de-sync the input's DOM\n * value from the masked text.\n */\n protected _handleBeforeInput(event: InputEvent): void {\n const { inputType } = event;\n\n if (inputType !== 'historyUndo' && inputType !== 'historyRedo') {\n return;\n }\n\n event.preventDefault();\n\n if (!this.readOnly) {\n this._historyStep(inputType === 'historyUndo' ? 'undo' : 'redo');\n }\n }\n\n //#endregion\n\n //#region Undo/redo\n\n /**\n * Snapshots the current masked text before `next` replaces it, then reports where the\n * caret ends up. Must be called *before* the text is committed.\n *\n * Only a real change earns an undo step: a character the mask rejects, a backspace at\n * position zero or a spin that hit a boundary would otherwise leave behind a step\n * that appears to do nothing when undone.\n */\n protected _recordHistory(\n kind: MaskEditKind,\n next: string,\n caret: number,\n selection: MaskSelection = this._inputSelection\n ): void {\n const previous = this._historyText;\n\n if (next !== previous) {\n this._history.record(kind, { value: previous, ...selection });\n }\n\n this._history.settle(next, caret);\n }\n\n /** Reconciles the history with the current masked text. */\n protected _historyResync(): void {\n this._history.resync(this._historyText);\n }\n\n /** Restores the neighboring history state in the given direction. */\n protected async _historyStep(direction: 'undo' | 'redo'): Promise<void> {\n if (this.readOnly) {\n return;\n }\n\n const current: MaskHistoryState = {\n value: this._historyText,\n ...this._inputSelection,\n };\n\n const state =\n direction === 'undo'\n ? this._history.undo(current)\n : this._history.redo(current);\n\n if (!state) {\n return;\n }\n\n this._setTouchedState();\n this._commitMaskedValue(state.value);\n this.requestUpdate();\n\n // Native inputs announce an undo as an `input` event, and the composite hosts\n // (`igc-date-picker`, `igc-date-range-picker`) read the draft value from ours.\n this._emitInputEvent();\n\n await this.updateComplete;\n\n // Through the mixin method, since the input's own keydown handler has already\n // overwritten `_maskSelection` with the caret as it was before the restore.\n this.setSelectionRange(state.start, state.end);\n }\n\n //#endregion\n\n //#region Public methods\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 this._maskSelection = { start: start ?? 0, end: end ?? 0 };\n }\n\n /* blazorSuppress */\n /** Replaces the selected text in the control and re-applies the mask */\n public setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: RangeTextSelectMode\n ): void {\n const current = this._inputSelection;\n const _start = start ?? current.start;\n const _end = end ?? current.end;\n\n const result = this._parser.replace(\n this._maskedValue || this._parser.emptyMask,\n replacement,\n _start,\n _end\n );\n const next = this._parser.apply(this._parser.parse(result.value));\n\n this._recordHistory('atomic', next, _start, current);\n this._commitMaskedValue(next);\n\n this.updateComplete.then(() => {\n switch (selectMode) {\n case 'select':\n this.setSelectionRange(_start, _end);\n break;\n case 'start':\n this.setSelectionRange(_start, _start);\n break;\n case 'end':\n this.setSelectionRange(_end, _end);\n break;\n default:\n this.setSelectionRange(current.start, current.end);\n }\n });\n }\n\n //#endregion\n }\n\n return MaskBehaviorElement as unknown as AbstractConstructor<MaskBehaviorElementInterface> &\n T;\n}\n"]}
1
+ {"version":3,"file":"mask-behavior.js","sourceRoot":"","sources":["../../../src/internals/mixins/mask-behavior.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,iBAAiB,GAIlB,MAAM,6CAA6C,CAAC;AAMrD,OAAO,EACL,cAAc,EACd,OAAO,EACP,OAAO,EACP,QAAQ,GACT,MAAM,gCAAgC,CAAC;AAaxC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAuB;IAClD,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxB,CAAC,uBAAuB,EAAE,iBAAiB,CAAC;IAC5C,CAAC,sBAAsB,EAAE,gBAAgB,CAAC;IAC1C,CAAC,aAAa,EAAE,QAAQ,CAAC;IACzB,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IAC7B,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IAC5B,CAAC,EAAE,EAAE,QAAQ,CAAC;CACf,CAAC,CAAC;AA6GH,MAAM,UAAU,iBAAiB,CAE/B,UAAa;IACb,MAAe,mBAAoB,SAAQ,UAAU;QA6BnD,IAAc,eAAe;YAC3B,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,cAAc,IAAI,CAAC;gBACvC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,IAAI,CAAC;aACpC,CAAC;QACJ,CAAC;QAED,IAAc,YAAY;YACxB,OAAO,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QACtD,CAAC;Q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,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAElE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YACrD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;YAE9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC5B,QAAQ,UAAU,EAAE,CAAC;oBACnB,KAAK,QAAQ;wBACX,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;wBACrC,MAAM;oBACR,KAAK,OAAO;wBACV,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;wBACvC,MAAM;oBACR,KAAK,KAAK;wBACR,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;wBACnC,MAAM;oBACR;wBACE,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;KAGF;IApaW;QADT,KAAK,EAAE;yDACmB;IAGjB;QADT,KAAK,EAAE;6DACoB;IA4DrB;QADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yDACnB;IAQxB;QADC,QAAQ,EAAE;mDAGV;IAaD;QADC,QAAQ,EAAE;qDAGV;IA8UH,OAAO,mBACJ,CAAC;AACN,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport {\n createMaskHistory,\n type MaskEditKind,\n type MaskHistory,\n type MaskHistoryState,\n} from '../../components/mask-input/mask-history.js';\nimport type { MaskParser } from '../../components/mask-input/mask-parser.js';\nimport type {\n RangeTextSelectMode,\n SelectionRangeDirection,\n} from '../../components/types.js';\nimport {\n addKeybindings,\n ctrlKey,\n metaKey,\n shiftKey,\n} from '../controllers/key-bindings.js';\nimport type { AbstractConstructor } from './constructor.js';\nimport type { BaseFormAssociatedElement } from './forms/types.js';\n\nexport type MaskSelection = {\n start: number;\n end: number;\n};\n\n/**\n * Maps an `inputType` to its undo granularity. An absent value is a native\n * mutation that the editor does not model; the empty string is auto-fill.\n */\nconst MaskEditKinds = new Map<string, MaskEditKind>([\n ['insertText', 'insert'],\n ['deleteContentBackward', 'delete-backward'],\n ['deleteContentForward', 'delete-forward'],\n ['deleteByCut', 'atomic'],\n ['insertFromPaste', 'atomic'],\n ['insertFromDrop', 'atomic'],\n ['', 'atomic'],\n]);\n\n/**\n * The interface that {@link MaskBehaviorMixin} adds. A `declare class`, so the\n * cast return type still exposes the protected members.\n */\nexport declare class MaskBehaviorElementInterface {\n //#region Required from host\n\n protected readonly _input?: HTMLInputElement;\n protected readonly _parser: MaskParser;\n\n /** Writes the parser state into the public value of the host. */\n protected _syncValueFromMask(): void;\n\n //#endregion\n\n //#region Internal state\n\n protected _maskSelection: MaskSelection;\n protected _compositionStart: number;\n protected _focused: boolean;\n protected _maskedValue: string;\n protected readonly _history: MaskHistory;\n\n protected get _inputSelection(): MaskSelection;\n protected get _isEmptyMask(): boolean;\n protected get _historyText(): string;\n\n //#endregion\n\n //#region Public attributes and properties\n\n /**\n * Makes the control a readonly field.\n * @attr readonly\n * @default false\n */\n public readOnly: boolean;\n\n /**\n * The mask pattern of the component.\n * @attr\n */\n public get mask(): string;\n public set mask(value: string);\n\n /**\n * The prompt symbol for the unfilled parts of the mask pattern.\n * @attr\n * @default '_'\n */\n public get prompt(): string;\n public set prompt(value: string);\n\n //#endregion\n\n //#region Event handlers\n\n protected _handleInput(event: InputEvent): Promise<void>;\n protected _handleBeforeInput(event: InputEvent): void;\n protected _updateInput(text: string, range: MaskSelection): Promise<void>;\n protected _commitMaskedValue(value: string): void;\n protected _emitInputEvent(): void;\n protected _setMaskSelection(event: Event): void;\n protected _handleCompositionStart(): void;\n protected _handleCompositionEnd(event: CompositionEvent): void;\n protected _handleClick(): void;\n\n //#endregion\n\n //#region Undo/redo\n\n protected _recordHistory(\n kind: MaskEditKind,\n next: string,\n caret: number,\n selection?: MaskSelection\n ): void;\n\n protected _historyStep(direction: 'undo' | 'redo'): Promise<void>;\n protected _historyResync(): void;\n\n //#endregion\n\n //#region Public methods\n\n /** Sets the text selection range of the control. */\n public setSelectionRange(\n start?: number,\n end?: number,\n direction?: SelectionRangeDirection\n ): void;\n\n /** Replaces the selected text in the control and re-applies the mask. */\n public setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: RangeTextSelectMode\n ): void;\n\n //#endregion\n}\n\n/**\n * Adds parser-driven editing, selection tracking, composition handling and\n * text-range replacement to a form-associated element.\n */\nexport function MaskBehaviorMixin<\n T extends AbstractConstructor<LitElement & BaseFormAssociatedElement>,\n>(superClass: T): AbstractConstructor<MaskBehaviorElementInterface> & T {\n abstract class MaskBehaviorElement extends superClass {\n //#region Required from host\n\n protected abstract readonly _input?: HTMLInputElement;\n protected abstract readonly _parser: MaskParser;\n public abstract select(): void;\n protected abstract _syncValueFromMask(): void;\n\n //#endregion\n\n //#region Internal state\n\n protected _maskSelection: MaskSelection = { start: 0, end: 0 };\n protected _compositionStart = 0;\n\n /**\n * The signature uses the source pattern, not the escaped one:\n * `MM/dd/yyyy` and `dd/MM/yyyy` both escape to `00/00/0000`.\n */\n protected readonly _history = createMaskHistory(\n () => `${this._parser.mask} ${this._parser.prompt}`\n );\n\n @state()\n protected _focused = false;\n\n @state()\n protected _maskedValue = '';\n\n protected get _inputSelection(): MaskSelection {\n return {\n start: this._input?.selectionStart || 0,\n end: this._input?.selectionEnd || 0,\n };\n }\n\n protected get _isEmptyMask(): boolean {\n return this._maskedValue === this._parser.emptyMask;\n }\n\n /**\n * The masked text as the undo history sees it. `igc-mask-input` blanks\n * it on blur, so without this each focus looks like a foreign change.\n */\n protected get _historyText(): string {\n return this._maskedValue || this._parser.emptyMask;\n }\n\n //#endregion\n\n //#region Lifecycle\n\n constructor(...args: any[]) {\n super(...args);\n\n // Assigning `input.value` clears the native undo stack, so the\n // shortcuts read `_history`. Skip while an IME composition owns it.\n const step =\n (direction: 'undo' | 'redo') =>\n (event: KeyboardEvent): void => {\n if (!event.isComposing) {\n this._historyStep(direction);\n }\n };\n\n addKeybindings(this, {\n skip: () => this.readOnly,\n bindingDefaults: { repeat: true },\n })\n .set([ctrlKey, 'z'], step('undo'))\n .set([metaKey, 'z'], step('undo'))\n .set([ctrlKey, 'y'], step('redo'))\n .set([ctrlKey, shiftKey, 'z'], step('redo'))\n .set([metaKey, shiftKey, 'z'], step('redo'));\n }\n\n //#endregion\n\n //#region Public attributes and properties\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 * The mask pattern of the component.\n *\n * @attr\n */\n @property()\n public set mask(value: string) {\n this._parser.mask = value;\n }\n\n public get mask(): string {\n return this._parser.mask;\n }\n\n /**\n * The prompt symbol for the unfilled parts of the mask pattern.\n *\n * @attr\n * @default '_'\n */\n @property()\n public set prompt(value: string) {\n this._parser.prompt = value;\n }\n\n public get prompt(): string {\n return this._parser.prompt;\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected async _handleInput({\n inputType,\n isComposing,\n }: InputEvent): Promise<void> {\n const value = this._input?.value ?? '';\n const { start, end } = this._maskSelection;\n\n // Reachable only where `beforeinput` is not cancelable; otherwise\n // `_handleBeforeInput` intercepts these first.\n if (inputType === 'historyUndo' || inputType === 'historyRedo') {\n return this._historyStep(inputType === 'historyUndo' ? 'undo' : 'redo');\n }\n\n // The composition events handle a composing backspace instead.\n if (inputType === 'deleteContentBackward' && isComposing) {\n return;\n }\n\n const kind = MaskEditKinds.get(inputType ?? '');\n\n if (kind === undefined) {\n // An unmodeled mutation already changed the DOM value; a re-render\n // lets `live()` restore it. Skip during a composition, which it\n // would abort.\n if (!isComposing) {\n this.requestUpdate();\n }\n return;\n }\n\n this._setTouchedState();\n\n switch (inputType) {\n case 'deleteContentForward': {\n const deletePosition =\n this._parser.getNextNonLiteralPosition(end) + 1;\n\n await this._updateInput('', { start, end: deletePosition }, kind);\n this._input?.setSelectionRange(deletePosition, deletePosition);\n // Record the caret past the deleted character so deletes coalesce.\n this._history.settle(this._historyText, deletePosition);\n return;\n }\n\n case 'deleteContentBackward':\n return this._updateInput(\n '',\n {\n start: this._parser.getPreviousNonLiteralPosition(\n this._inputSelection.start + 1\n ),\n end,\n },\n kind\n );\n\n case 'deleteByCut':\n return this._updateInput('', this._maskSelection, kind);\n\n case 'insertText':\n return this._updateInput(\n value.substring(start, this._inputSelection.end),\n this._maskSelection,\n kind\n );\n\n case 'insertFromPaste':\n return this._updateInput(\n value.substring(start, this._inputSelection.end),\n {\n start,\n end: this._inputSelection.start,\n },\n kind\n );\n\n case 'insertFromDrop':\n // An external drop sends no `dragstart`; `_maskSelection` is stale.\n return this._updateInput(\n value.substring(\n this._inputSelection.start,\n this._inputSelection.end\n ),\n { ...this._inputSelection },\n kind,\n {\n start: this._inputSelection.start,\n end: this._inputSelection.start,\n }\n );\n\n // Browser auto-fill sends an empty `inputType`.\n case '':\n return this._updateInput(\n this._parser.parse(\n value.substring(start, this._inputSelection.end)\n ),\n {\n start,\n end: this._inputSelection.end,\n },\n kind,\n { start, end: start }\n );\n }\n }\n\n /**\n * Applies the parser to the text, commits the result, and emits an input\n * event unless the edit is at the trailing mask boundary.\n */\n protected async _updateInput(\n text: string,\n range: MaskSelection,\n kind: MaskEditKind = 'atomic',\n caretBefore?: MaskSelection\n ): Promise<void> {\n const { value, end } = this._parser.replace(\n this._maskedValue,\n text,\n range.start,\n range.end\n );\n\n this._recordHistory(kind, value, end, caretBefore ?? this._maskSelection);\n this._commitMaskedValue(value);\n this.requestUpdate();\n\n if (range.start !== this._parser.mask.length) {\n this._emitInputEvent();\n }\n\n await this.updateComplete;\n this._input?.setSelectionRange(end, end);\n }\n\n /**\n * Writes a complete masked text into the value pipeline. The one leaf\n * override: `igc-mask-input` commits to its form value, the date editors\n * keep a draft until blur.\n */\n protected _commitMaskedValue(value: string): void {\n this._maskedValue = value;\n this._syncValueFromMask();\n }\n\n /** Emits `igcInput` with the masked value. Override for another payload. */\n protected _emitInputEvent(): void {\n this._emitTouchedEvent('igcInput', { detail: this._maskedValue });\n }\n\n protected _setMaskSelection(event: Event): void {\n this._maskSelection = this._inputSelection;\n if (event instanceof KeyboardEvent) {\n this._handleEnterKeydown(event);\n }\n }\n\n protected _handleCompositionStart(): void {\n this._compositionStart = this._inputSelection.start;\n }\n\n protected _handleCompositionEnd({ data }: CompositionEvent): void {\n // One undo step for the whole sequence, anchored where it began.\n this._updateInput(\n data,\n { start: this._compositionStart, end: this._inputSelection.end },\n 'atomic',\n { start: this._compositionStart, end: this._compositionStart }\n );\n }\n\n protected _handleClick(): void {\n const { selectionStart: start, selectionEnd: end } = this._input ?? {\n selectionStart: 0,\n selectionEnd: 0,\n };\n\n // A click at the end of the input field selects the whole mask.\n if (start === end && start === this._maskedValue.length) {\n this.select();\n }\n }\n\n /**\n * Intercepts the browser history commands from the Edit menu, the context\n * menu and the software keyboard, which never reach the key bindings. The\n * native undo stack is empty, so letting one pass desyncs the input.\n */\n protected _handleBeforeInput(event: InputEvent): void {\n const { inputType } = event;\n\n if (inputType !== 'historyUndo' && inputType !== 'historyRedo') {\n return;\n }\n\n event.preventDefault();\n\n if (!this.readOnly) {\n this._historyStep(inputType === 'historyUndo' ? 'undo' : 'redo');\n }\n }\n\n //#endregion\n\n //#region Undo/redo\n\n /**\n * Records the current masked text before `next` replaces it. Call this\n * *before* you commit; only a real change adds a step.\n */\n protected _recordHistory(\n kind: MaskEditKind,\n next: string,\n caret: number,\n selection: MaskSelection = this._inputSelection\n ): void {\n const previous = this._historyText;\n\n if (next !== previous) {\n this._history.record(kind, { value: previous, ...selection });\n }\n\n this._history.settle(next, caret);\n }\n\n /** Reconciles the history with the current masked text. */\n protected _historyResync(): void {\n this._history.resync(this._historyText);\n }\n\n /** Restores the neighboring history state in the given direction. */\n protected async _historyStep(direction: 'undo' | 'redo'): Promise<void> {\n if (this.readOnly) {\n return;\n }\n\n const current: MaskHistoryState = {\n value: this._historyText,\n ...this._inputSelection,\n };\n\n const state =\n direction === 'undo'\n ? this._history.undo(current)\n : this._history.redo(current);\n\n if (!state) {\n return;\n }\n\n this._setTouchedState();\n this._commitMaskedValue(state.value);\n this.requestUpdate();\n\n // Native inputs announce an undo as an `input` event; the date picker\n // hosts read their draft value from it.\n this._emitInputEvent();\n\n await this.updateComplete;\n\n // Use the mixin method: the keydown handler already overwrote\n // `_maskSelection` with the pre-restore caret.\n this.setSelectionRange(state.start, state.end);\n }\n\n //#endregion\n\n //#region Public methods\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 this._maskSelection = { start: start ?? 0, end: end ?? 0 };\n }\n\n /* blazorSuppress */\n /** Replaces the selected text in the control and re-applies the mask. */\n public setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: RangeTextSelectMode\n ): void {\n const current = this._inputSelection;\n const _start = start ?? current.start;\n const _end = end ?? current.end;\n\n const result = this._parser.replace(\n this._maskedValue || this._parser.emptyMask,\n replacement,\n _start,\n _end\n );\n const next = this._parser.apply(this._parser.parse(result.value));\n\n this._recordHistory('atomic', next, _start, current);\n this._commitMaskedValue(next);\n\n this.updateComplete.then(() => {\n switch (selectMode) {\n case 'select':\n this.setSelectionRange(_start, _end);\n break;\n case 'start':\n this.setSelectionRange(_start, _start);\n break;\n case 'end':\n this.setSelectionRange(_end, _end);\n break;\n default:\n this.setSelectionRange(current.start, current.end);\n }\n });\n }\n\n //#endregion\n }\n\n return MaskBehaviorElement as unknown as AbstractConstructor<MaskBehaviorElementInterface> &\n T;\n}\n"]}
@@ -26,8 +26,7 @@ export declare abstract class IgcBaseOptionLikeComponent extends LitElement {
26
26
  set selected(value: boolean);
27
27
  get selected(): boolean;
28
28
  /**
29
- * The current value of the item.
30
- * If not specified, the element's text content is used.
29
+ * The value of the item. Falls back to the text content of the element.
31
30
  *
32
31
  * @attr
33
32
  */
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { html, LitElement } from 'lit';
8
8
  import { property, queryAssignedNodes } from 'lit/decorators.js';
9
9
  import { addInternalsController } from '../controllers/internals.js';
10
+ import { normalizedTextContent } from '../utils/dom.js';
10
11
  export class IgcBaseOptionLikeComponent extends LitElement {
11
12
  constructor() {
12
13
  super(...arguments);
@@ -23,7 +24,7 @@ export class IgcBaseOptionLikeComponent extends LitElement {
23
24
  this._selected = false;
24
25
  }
25
26
  get _contentSlotText() {
26
- return this._content.map((node) => node.textContent).join('');
27
+ return normalizedTextContent(this._content);
27
28
  }
28
29
  set active(value) {
29
30
  this._active = Boolean(value);
@@ -1 +1 @@
1
- {"version":3,"file":"option.js","sourceRoot":"","sources":["../../../src/internals/mixins/option.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,MAAM,OAAgB,0BAA2B,SAAQ,UAAU;IAAnE;;QACqB,eAAU,GAAG,sBAAsB,CAAC,IAAI,EAAE;YAC3D,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC/B,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;gBACX,YAAY,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;gBAChC,YAAY,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;aACjC,CAAC;SACH,CAAC,CAAC;QAEO,YAAO,GAAG,KAAK,CAAC;QAChB,cAAS,GA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AAE,IAAI,EAAE,CAAC;wDAG1C;AAWD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DAG1C;AAWD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DAI1C;AAaD;IADC,QAAQ,EAAE;uDAGV","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, queryAssignedNodes } from 'lit/decorators.js';\nimport { addInternalsController } from '../controllers/internals.js';\n\n/* omitModule */\nexport abstract class IgcBaseOptionLikeComponent extends LitElement {\n protected readonly _internals = addInternalsController(this, {\n initialARIA: { role: 'option' },\n reflectRole: true,\n aria: () => ({\n ariaDisabled: `${this.disabled}`,\n ariaSelected: `${this.selected}`,\n }),\n });\n\n protected _active = false;\n protected _disabled = false;\n protected _selected = false;\n protected _value!: string;\n\n @queryAssignedNodes({ flatten: true })\n protected readonly _content!: Array<Element>;\n\n protected get _contentSlotText(): string {\n return this._content.map((node) => node.textContent).join('');\n }\n\n /**\n * Whether the item is active.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public set active(value: boolean) {\n this._active = Boolean(value);\n }\n\n public get active(): boolean {\n return this._active;\n }\n\n /**\n * Whether the item is disabled.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public set disabled(value: boolean) {\n this._disabled = Boolean(value);\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n * Whether the item is selected.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public set selected(value: boolean) {\n this._selected = Boolean(value);\n this.active = this.selected;\n }\n\n public get selected(): boolean {\n return this._selected;\n }\n\n /**\n * The current value of the item.\n * If not specified, the element's text content is used.\n *\n * @attr\n */\n @property()\n public set value(value: string) {\n this._value = value;\n }\n\n public get value(): string {\n return this._value ? this._value : this._contentSlotText;\n }\n\n protected override render() {\n return html`\n <section part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </section>\n <section part=\"content\">\n <slot></slot>\n </section>\n <section part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </section>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"option.js","sourceRoot":"","sources":["../../../src/internals/mixins/option.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,MAAM,OAAgB,0BAA2B,SAAQ,UAAU;IAAnE;;QACqB,eAAU,GAAG,sBAAsB,CAAC,IAAI,EAAE;YAC3D,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC/B,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;gBACX,YAAY,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;gBAChC,YAAY,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;aACjC,CAAC;SACH,CAAC,CAAC;QAEO,YAAO,GAAG,KAAK,CAAC;QAChB,cAAS,GAAG,KAAK,CAAC;QAClB,cAAS,GAAG,KAAK,CAAC;IA6E9B,CAAC;IAvEC,IAAc,gBAAgB;QAC5B,OAAO,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAOD,IAAW,MAAM,CAAC,KAAc;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAOD,IAAW,QAAQ,CAAC,KAAc;QAChC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAOD,IAAW,QAAQ,CAAC,KAAc;QAChC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAQD,IAAW,KAAK,CAAC,KAAa;QAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;IAC3D,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA;;;;;;;;;;KAUV,CAAC;IACJ,CAAC;CACF;AAzEoB;IADlB,kBAAkB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4DACO;AAW7C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wDAG1C;AAWD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DAG1C;AAWD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DAI1C;AAYD;IADC,QAAQ,EAAE;uDAGV","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, queryAssignedNodes } from 'lit/decorators.js';\nimport { addInternalsController } from '../controllers/internals.js';\nimport { normalizedTextContent } from '../utils/dom.js';\n\n/* omitModule */\nexport abstract class IgcBaseOptionLikeComponent extends LitElement {\n protected readonly _internals = addInternalsController(this, {\n initialARIA: { role: 'option' },\n reflectRole: true,\n aria: () => ({\n ariaDisabled: `${this.disabled}`,\n ariaSelected: `${this.selected}`,\n }),\n });\n\n protected _active = false;\n protected _disabled = false;\n protected _selected = false;\n protected _value!: string;\n\n @queryAssignedNodes({ flatten: true })\n protected readonly _content!: Array<Element>;\n\n protected get _contentSlotText(): string {\n return normalizedTextContent(this._content);\n }\n\n /**\n * Whether the item is active.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public set active(value: boolean) {\n this._active = Boolean(value);\n }\n\n public get active(): boolean {\n return this._active;\n }\n\n /**\n * Whether the item is disabled.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public set disabled(value: boolean) {\n this._disabled = Boolean(value);\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n * Whether the item is selected.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public set selected(value: boolean) {\n this._selected = Boolean(value);\n this.active = this.selected;\n }\n\n public get selected(): boolean {\n return this._selected;\n }\n\n /**\n * The value of the item. Falls back to the text content of the element.\n *\n * @attr\n */\n @property()\n public set value(value: string) {\n this._value = value;\n }\n\n public get value(): string {\n return this._value ? this._value : this._contentSlotText;\n }\n\n protected override render() {\n return html`\n <section part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </section>\n <section part=\"content\">\n <slot></slot>\n </section>\n <section part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </section>\n `;\n }\n}\n"]}
@@ -10,8 +10,10 @@ declare class PartMapDirective extends Directive {
10
10
  update(part: AttributePart, [partMapInfo]: DirectiveParameters<this>): string | typeof noChange;
11
11
  }
12
12
  /**
13
- * Similar to Lit's {@link https://lit.dev/docs/templates/directives/#classmap | `classMap`} and
14
- * {@link https://lit.dev/docs/templates/directives/#stylemap | `styleMap`} but for `part` attributes.
13
+ * Sets the `part` attribute of an element from a map of part names, like the
14
+ * Lit {@link https://lit.dev/docs/templates/directives/#classmap | `classMap`}
15
+ * and {@link https://lit.dev/docs/templates/directives/#stylemap | `styleMap`}
16
+ * directives.
15
17
  */
16
18
  export declare const partMap: (partMapInfo: PartMapInfo) => import("lit-html/directive.js").DirectiveResult<typeof PartMapDirective>;
17
19
  export type { PartMapDirective };
@@ -6,7 +6,7 @@ class PartMapDirective extends Directive {
6
6
  if (partInfo.type !== PartType.ATTRIBUTE ||
7
7
  partInfo.name !== 'part' ||
8
8
  partInfo.strings?.length > 0) {
9
- throw new Error('`partMap() can only be used in the `part` attribute and must be the only part in the attribute.');
9
+ throw new Error('partMap() can only be used in the `part` attribute, and must be the only binding in it.');
10
10
  }
11
11
  }
12
12
  render(partMapInfo) {