igniteui-webcomponents 4.3.1 → 4.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (464) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/animations/presets/fade/index.d.ts +2 -2
  3. package/animations/presets/fade/index.js +4 -6
  4. package/animations/presets/fade/index.js.map +1 -1
  5. package/animations/presets/grow/index.d.ts +2 -2
  6. package/animations/presets/grow/index.js +8 -10
  7. package/animations/presets/grow/index.js.map +1 -1
  8. package/animations/presets/index.d.ts +1 -0
  9. package/animations/presets/index.js +1 -0
  10. package/animations/presets/index.js.map +1 -1
  11. package/animations/presets/slide/index.d.ts +3 -0
  12. package/animations/presets/slide/index.js +16 -0
  13. package/animations/presets/slide/index.js.map +1 -0
  14. package/components/avatar/avatar.js +7 -7
  15. package/components/avatar/avatar.js.map +1 -1
  16. package/components/avatar/themes/{light/avatar.base.css.js → avatar.base.css.js} +2 -32
  17. package/components/avatar/themes/avatar.base.css.js.map +1 -0
  18. package/components/{nav-drawer/themes/dark/nav-drawer-item.base.css.js → avatar/themes/dark/avatar.bootstrap.css.js} +1 -1
  19. package/components/avatar/themes/dark/avatar.bootstrap.css.js.map +1 -0
  20. package/components/avatar/themes/dark/{avatar.base.bootstrap.css.js → avatar.fluent.css.js} +1 -1
  21. package/components/avatar/themes/dark/avatar.fluent.css.js.map +1 -0
  22. package/components/{nav-drawer/themes/dark/nav-drawer-item.indigo.css.js → avatar/themes/dark/avatar.indigo.css.js} +1 -1
  23. package/components/avatar/themes/dark/avatar.indigo.css.js.map +1 -0
  24. package/components/{nav-drawer/themes/dark/nav-drawer-item.fluent.css.js → avatar/themes/dark/avatar.material.css.js} +1 -1
  25. package/components/avatar/themes/dark/avatar.material.css.js.map +1 -0
  26. package/components/avatar/themes/light/avatar.bootstrap.css.js +17 -3
  27. package/components/avatar/themes/light/avatar.bootstrap.css.js.map +1 -1
  28. package/components/avatar/themes/light/avatar.fluent.css.js +27 -0
  29. package/components/avatar/themes/light/avatar.fluent.css.js.map +1 -0
  30. package/components/avatar/themes/light/avatar.indigo.css.js +27 -0
  31. package/components/avatar/themes/light/avatar.indigo.css.js.map +1 -0
  32. package/components/avatar/themes/light/avatar.material.css.js +27 -0
  33. package/components/avatar/themes/light/avatar.material.css.js.map +1 -0
  34. package/components/button/button-base.d.ts +14 -6
  35. package/components/button/button-base.js +51 -18
  36. package/components/button/button-base.js.map +1 -1
  37. package/components/button/button.d.ts +0 -3
  38. package/components/button/button.js +1 -4
  39. package/components/button/button.js.map +1 -1
  40. package/components/button/themes/button/light/button.base.css.js +4 -16
  41. package/components/button/themes/button/light/button.base.css.js.map +1 -1
  42. package/components/button/themes/button/light/button.bootstrap.css.js +64 -32
  43. package/components/button/themes/button/light/button.bootstrap.css.js.map +1 -1
  44. package/components/button/themes/button/light/button.fluent.css.js +75 -40
  45. package/components/button/themes/button/light/button.fluent.css.js.map +1 -1
  46. package/components/button/themes/button/light/button.indigo.css.js +86 -42
  47. package/components/button/themes/button/light/button.indigo.css.js.map +1 -1
  48. package/components/button/themes/button/light/button.material.css.js +88 -38
  49. package/components/button/themes/button/light/button.material.css.js.map +1 -1
  50. package/components/button/themes/icon-button/light/icon-button.base.css.js +2 -13
  51. package/components/button/themes/icon-button/light/icon-button.base.css.js.map +1 -1
  52. package/components/button/themes/icon-button/light/icon-button.bootstrap.css.js +12 -7
  53. package/components/button/themes/icon-button/light/icon-button.bootstrap.css.js.map +1 -1
  54. package/components/button/themes/icon-button/light/icon-button.fluent.css.js +4 -3
  55. package/components/button/themes/icon-button/light/icon-button.fluent.css.js.map +1 -1
  56. package/components/button/themes/icon-button/light/icon-button.indigo.css.js +6 -4
  57. package/components/button/themes/icon-button/light/icon-button.indigo.css.js.map +1 -1
  58. package/components/button/themes/icon-button/light/icon-button.material.css.js +7 -4
  59. package/components/button/themes/icon-button/light/icon-button.material.css.js.map +1 -1
  60. package/components/calendar/themes/bootstrap/calendar.bootstrap.css.js +3 -10
  61. package/components/calendar/themes/bootstrap/calendar.bootstrap.css.js.map +1 -1
  62. package/components/calendar/themes/bootstrap/days-view.bootstrap.css.js +2 -2
  63. package/components/calendar/themes/bootstrap/days-view.bootstrap.css.js.map +1 -1
  64. package/components/calendar/themes/bootstrap/year-month-view.bootstrap.css.js +2 -2
  65. package/components/calendar/themes/bootstrap/year-month-view.bootstrap.css.js.map +1 -1
  66. package/components/calendar/themes/calendar.base.css.js +14 -12
  67. package/components/calendar/themes/calendar.base.css.js.map +1 -1
  68. package/components/calendar/themes/fluent/calendar.fluent.css.js +18 -23
  69. package/components/calendar/themes/fluent/calendar.fluent.css.js.map +1 -1
  70. package/components/calendar/themes/fluent/days-view.fluent.css.js +7 -23
  71. package/components/calendar/themes/fluent/days-view.fluent.css.js.map +1 -1
  72. package/components/calendar/themes/indigo/calendar.indigo.css.js +3 -10
  73. package/components/calendar/themes/indigo/calendar.indigo.css.js.map +1 -1
  74. package/components/checkbox/checkbox-base.d.ts +8 -35
  75. package/components/checkbox/checkbox-base.js +28 -41
  76. package/components/checkbox/checkbox-base.js.map +1 -1
  77. package/components/checkbox/checkbox.d.ts +0 -1
  78. package/components/checkbox/checkbox.js +5 -16
  79. package/components/checkbox/checkbox.js.map +1 -1
  80. package/components/checkbox/switch.d.ts +0 -2
  81. package/components/checkbox/switch.js +4 -16
  82. package/components/checkbox/switch.js.map +1 -1
  83. package/components/checkbox/themes/light/checkbox.base.css.js +2 -1
  84. package/components/checkbox/themes/light/checkbox.base.css.js.map +1 -1
  85. package/components/checkbox/themes/light/checkbox.bootstrap.css.js +27 -10
  86. package/components/checkbox/themes/light/checkbox.bootstrap.css.js.map +1 -1
  87. package/components/checkbox/themes/light/checkbox.fluent.css.js +31 -15
  88. package/components/checkbox/themes/light/checkbox.fluent.css.js.map +1 -1
  89. package/components/checkbox/themes/light/checkbox.indigo.css.js +47 -21
  90. package/components/checkbox/themes/light/checkbox.indigo.css.js.map +1 -1
  91. package/components/checkbox/themes/light/checkbox.material.css.js +24 -12
  92. package/components/checkbox/themes/light/checkbox.material.css.js.map +1 -1
  93. package/components/checkbox/themes/light/switch.base.css.js +2 -1
  94. package/components/checkbox/themes/light/switch.base.css.js.map +1 -1
  95. package/components/checkbox/themes/light/switch.bootstrap.css.js +12 -4
  96. package/components/checkbox/themes/light/switch.bootstrap.css.js.map +1 -1
  97. package/components/checkbox/themes/light/switch.fluent.css.js +33 -15
  98. package/components/checkbox/themes/light/switch.fluent.css.js.map +1 -1
  99. package/components/checkbox/themes/light/switch.indigo.css.js +26 -11
  100. package/components/checkbox/themes/light/switch.indigo.css.js.map +1 -1
  101. package/components/checkbox/themes/light/switch.material.css.js +14 -7
  102. package/components/checkbox/themes/light/switch.material.css.js.map +1 -1
  103. package/components/chip/themes/chip.base.css.js +12 -40
  104. package/components/chip/themes/chip.base.css.js.map +1 -1
  105. package/components/chip/themes/chip.bootstrap.css.js +14 -40
  106. package/components/chip/themes/chip.bootstrap.css.js.map +1 -1
  107. package/components/chip/themes/chip.fluent.css.js +14 -40
  108. package/components/chip/themes/chip.fluent.css.js.map +1 -1
  109. package/components/chip/themes/chip.indigo.css.js +14 -40
  110. package/components/chip/themes/chip.indigo.css.js.map +1 -1
  111. package/components/chip/themes/chip.material.css.js +14 -40
  112. package/components/chip/themes/chip.material.css.js.map +1 -1
  113. package/components/combo/combo.d.ts +7 -32
  114. package/components/combo/combo.js +57 -49
  115. package/components/combo/combo.js.map +1 -1
  116. package/components/combo/controllers/selection.js +1 -3
  117. package/components/combo/controllers/selection.js.map +1 -1
  118. package/components/combo/themes/light/combo.base.css.js +5 -0
  119. package/components/combo/themes/light/combo.base.css.js.map +1 -1
  120. package/components/combo/themes/light/combo.bootstrap.css.js +27 -24
  121. package/components/combo/themes/light/combo.bootstrap.css.js.map +1 -1
  122. package/components/combo/themes/light/combo.fluent.css.js +27 -24
  123. package/components/combo/themes/light/combo.fluent.css.js.map +1 -1
  124. package/components/combo/themes/light/combo.indigo.css.js +26 -23
  125. package/components/combo/themes/light/combo.indigo.css.js.map +1 -1
  126. package/components/combo/themes/light/combo.material.css.js +32 -23
  127. package/components/combo/themes/light/combo.material.css.js.map +1 -1
  128. package/components/combo/themes/light/item/combo-item.base.css.js +0 -1
  129. package/components/combo/themes/light/item/combo-item.base.css.js.map +1 -1
  130. package/components/common/localization/validation-en.d.ts +10 -0
  131. package/components/common/localization/validation-en.js +10 -0
  132. package/components/common/localization/validation-en.js.map +1 -0
  133. package/components/common/mixins/form-associated-required.d.ts +16 -0
  134. package/components/common/mixins/form-associated-required.js +29 -0
  135. package/components/common/mixins/form-associated-required.js.map +1 -0
  136. package/components/common/mixins/form-associated.d.ts +92 -0
  137. package/components/common/mixins/form-associated.js +151 -0
  138. package/components/common/mixins/form-associated.js.map +1 -0
  139. package/components/common/mixins/sizable.d.ts +3 -0
  140. package/components/common/mixins/sizable.js +7 -0
  141. package/components/common/mixins/sizable.js.map +1 -1
  142. package/components/common/util.d.ts +38 -0
  143. package/components/common/util.js +34 -0
  144. package/components/common/util.js.map +1 -1
  145. package/components/common/validators.d.ts +45 -0
  146. package/components/common/validators.js +54 -0
  147. package/components/common/validators.js.map +1 -0
  148. package/components/date-time-input/date-time-input.d.ts +30 -11
  149. package/components/date-time-input/date-time-input.js +147 -135
  150. package/components/date-time-input/date-time-input.js.map +1 -1
  151. package/components/date-time-input/date-util.d.ts +1 -0
  152. package/components/date-time-input/date-util.js +6 -3
  153. package/components/date-time-input/date-util.js.map +1 -1
  154. package/components/dialog/dialog.js +1 -1
  155. package/components/dialog/dialog.js.map +1 -1
  156. package/components/dialog/themes/light/dialog.base.css.js +1 -1
  157. package/components/dialog/themes/light/dialog.base.css.js.map +1 -1
  158. package/components/dropdown/dropdown-group.js +0 -2
  159. package/components/dropdown/dropdown-group.js.map +1 -1
  160. package/components/dropdown/dropdown-item.js +2 -6
  161. package/components/dropdown/dropdown-item.js.map +1 -1
  162. package/components/dropdown/dropdown.d.ts +0 -1
  163. package/components/dropdown/dropdown.js +0 -6
  164. package/components/dropdown/dropdown.js.map +1 -1
  165. package/components/dropdown/themes/light/dropdown.base.css.js +0 -12
  166. package/components/dropdown/themes/light/dropdown.base.css.js.map +1 -1
  167. package/components/dropdown/themes/light/dropdown.bootstrap.css.js +1 -1
  168. package/components/dropdown/themes/light/dropdown.bootstrap.css.js.map +1 -1
  169. package/components/dropdown/themes/light/dropdown.fluent.css.js +1 -1
  170. package/components/dropdown/themes/light/dropdown.fluent.css.js.map +1 -1
  171. package/components/dropdown/themes/light/dropdown.indigo.css.js +1 -1
  172. package/components/dropdown/themes/light/dropdown.indigo.css.js.map +1 -1
  173. package/components/dropdown/themes/light/dropdown.material.css.js +1 -1
  174. package/components/dropdown/themes/light/dropdown.material.css.js.map +1 -1
  175. package/components/dropdown/themes/light/group/dropdown-group.bootstrap.css.js +1 -1
  176. package/components/dropdown/themes/light/group/dropdown-group.bootstrap.css.js.map +1 -1
  177. package/components/dropdown/themes/light/group/dropdown-group.fluent.css.js +1 -1
  178. package/components/dropdown/themes/light/group/dropdown-group.fluent.css.js.map +1 -1
  179. package/components/dropdown/themes/light/group/dropdown-group.indigo.css.js +1 -1
  180. package/components/dropdown/themes/light/group/dropdown-group.indigo.css.js.map +1 -1
  181. package/components/dropdown/themes/light/group/dropdown-group.material.css.js +1 -1
  182. package/components/dropdown/themes/light/group/dropdown-group.material.css.js.map +1 -1
  183. package/components/dropdown/themes/light/header/dropdown-header.bootstrap.css.js +1 -1
  184. package/components/dropdown/themes/light/header/dropdown-header.bootstrap.css.js.map +1 -1
  185. package/components/dropdown/themes/light/header/dropdown-header.fluent.css.js +1 -1
  186. package/components/dropdown/themes/light/header/dropdown-header.fluent.css.js.map +1 -1
  187. package/components/dropdown/themes/light/header/dropdown-header.indigo.css.js +1 -1
  188. package/components/dropdown/themes/light/header/dropdown-header.indigo.css.js.map +1 -1
  189. package/components/dropdown/themes/light/header/dropdown-header.material.css.js +1 -1
  190. package/components/dropdown/themes/light/header/dropdown-header.material.css.js.map +1 -1
  191. package/components/dropdown/themes/light/item/dropdown-item.bootstrap.css.js +1 -1
  192. package/components/dropdown/themes/light/item/dropdown-item.bootstrap.css.js.map +1 -1
  193. package/components/dropdown/themes/light/item/dropdown-item.fluent.css.js +1 -1
  194. package/components/dropdown/themes/light/item/dropdown-item.fluent.css.js.map +1 -1
  195. package/components/dropdown/themes/light/item/dropdown-item.indigo.css.js +1 -1
  196. package/components/dropdown/themes/light/item/dropdown-item.indigo.css.js.map +1 -1
  197. package/components/dropdown/themes/light/item/dropdown-item.material.css.js +1 -1
  198. package/components/dropdown/themes/light/item/dropdown-item.material.css.js.map +1 -1
  199. package/components/expansion-panel/expansion-panel.js +1 -1
  200. package/components/expansion-panel/expansion-panel.js.map +1 -1
  201. package/components/expansion-panel/themes/light/expansion-panel.base.css.js +1 -2
  202. package/components/expansion-panel/themes/light/expansion-panel.base.css.js.map +1 -1
  203. package/components/form/form.d.ts +3 -0
  204. package/components/form/form.js.map +1 -1
  205. package/components/icon/icon.base.css.js +6 -8
  206. package/components/icon/icon.base.css.js.map +1 -1
  207. package/components/icon/light/icon.bootstrap.css.js +6 -1
  208. package/components/icon/light/icon.bootstrap.css.js.map +1 -1
  209. package/components/icon/light/icon.fluent.css.js +6 -1
  210. package/components/icon/light/icon.fluent.css.js.map +1 -1
  211. package/components/icon/light/icon.indigo.css.js +6 -1
  212. package/components/icon/light/icon.indigo.css.js.map +1 -1
  213. package/components/icon/light/icon.material.css.js +6 -1
  214. package/components/icon/light/icon.material.css.js.map +1 -1
  215. package/components/input/input-base.d.ts +10 -20
  216. package/components/input/input-base.js +23 -22
  217. package/components/input/input-base.js.map +1 -1
  218. package/components/input/input.d.ts +24 -15
  219. package/components/input/input.js +106 -48
  220. package/components/input/input.js.map +1 -1
  221. package/components/input/themes/light/input.base.css.js +0 -15
  222. package/components/input/themes/light/input.base.css.js.map +1 -1
  223. package/components/input/themes/light/input.bootstrap.css.js +7 -17
  224. package/components/input/themes/light/input.bootstrap.css.js.map +1 -1
  225. package/components/input/themes/light/input.fluent.css.js +6 -19
  226. package/components/input/themes/light/input.fluent.css.js.map +1 -1
  227. package/components/input/themes/light/input.indigo.css.js +16 -1
  228. package/components/input/themes/light/input.indigo.css.js.map +1 -1
  229. package/components/input/themes/light/input.material.css.js +30 -11
  230. package/components/input/themes/light/input.material.css.js.map +1 -1
  231. package/components/list/themes/light/list-header.base.css.js +0 -32
  232. package/components/list/themes/light/list-header.base.css.js.map +1 -1
  233. package/components/list/themes/light/list-item.base.css.js +4 -33
  234. package/components/list/themes/light/list-item.base.css.js.map +1 -1
  235. package/components/list/themes/light/list-item.bootstrap.css.js +1 -1
  236. package/components/list/themes/light/list-item.bootstrap.css.js.map +1 -1
  237. package/components/list/themes/light/list-item.fluent.css.js +1 -1
  238. package/components/list/themes/light/list-item.fluent.css.js.map +1 -1
  239. package/components/list/themes/light/list-item.indigo.css.js +1 -1
  240. package/components/list/themes/light/list-item.indigo.css.js.map +1 -1
  241. package/components/list/themes/light/list.base.css.js +1 -13
  242. package/components/list/themes/light/list.base.css.js.map +1 -1
  243. package/components/list/themes/light/list.bootstrap.css.js +1 -1
  244. package/components/list/themes/light/list.bootstrap.css.js.map +1 -1
  245. package/components/mask-input/mask-input-base.d.ts +2 -9
  246. package/components/mask-input/mask-input-base.js +7 -12
  247. package/components/mask-input/mask-input-base.js.map +1 -1
  248. package/components/mask-input/mask-input.d.ts +5 -6
  249. package/components/mask-input/mask-input.js +42 -51
  250. package/components/mask-input/mask-input.js.map +1 -1
  251. package/components/mask-input/mask-parser.js +1 -0
  252. package/components/mask-input/mask-parser.js.map +1 -1
  253. package/components/nav-drawer/nav-drawer-header-item.js +6 -4
  254. package/components/nav-drawer/nav-drawer-header-item.js.map +1 -1
  255. package/components/nav-drawer/nav-drawer-item.js +6 -4
  256. package/components/nav-drawer/nav-drawer-item.js.map +1 -1
  257. package/components/nav-drawer/nav-drawer.js +5 -2
  258. package/components/nav-drawer/nav-drawer.js.map +1 -1
  259. package/components/nav-drawer/themes/dark/nav-drawer.bootstrap.css.js +3 -0
  260. package/components/nav-drawer/themes/dark/{nav-drawer-item.base.css.js.map → nav-drawer.bootstrap.css.js.map} +1 -1
  261. package/components/nav-drawer/themes/dark/nav-drawer.fluent.css.js +3 -0
  262. package/components/nav-drawer/themes/dark/nav-drawer.fluent.css.js.map +1 -0
  263. package/components/nav-drawer/themes/dark/nav-drawer.material.css.js +3 -0
  264. package/components/nav-drawer/themes/dark/nav-drawer.material.css.js.map +1 -0
  265. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.base.css.js +7 -0
  266. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.base.css.js.map +1 -0
  267. package/components/nav-drawer/themes/light/{fluent/nav-drawer-header-item.fluent.css.js → header-item/nav-drawer-header-item.bootstrap.css.js} +2 -1
  268. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.bootstrap.css.js.map +1 -0
  269. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.fluent.css.d.ts +1 -0
  270. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.fluent.css.js +14 -0
  271. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.fluent.css.js.map +1 -0
  272. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.indigo.css.d.ts +1 -0
  273. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.indigo.css.js +14 -0
  274. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.indigo.css.js.map +1 -0
  275. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.material.css.d.ts +1 -0
  276. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.material.css.js +14 -0
  277. package/components/nav-drawer/themes/light/header-item/nav-drawer-header-item.material.css.js.map +1 -0
  278. package/components/nav-drawer/themes/light/item/nav-drawer-item.base.css.d.ts +1 -0
  279. package/components/nav-drawer/themes/light/item/nav-drawer-item.base.css.js +65 -0
  280. package/components/nav-drawer/themes/light/item/nav-drawer-item.base.css.js.map +1 -0
  281. package/components/nav-drawer/themes/light/item/nav-drawer-item.bootstrap.css.d.ts +1 -0
  282. package/components/nav-drawer/themes/light/item/nav-drawer-item.bootstrap.css.js +54 -0
  283. package/components/nav-drawer/themes/light/item/nav-drawer-item.bootstrap.css.js.map +1 -0
  284. package/components/nav-drawer/themes/light/item/nav-drawer-item.fluent.css.d.ts +1 -0
  285. package/components/nav-drawer/themes/light/item/nav-drawer-item.fluent.css.js +54 -0
  286. package/components/nav-drawer/themes/light/item/nav-drawer-item.fluent.css.js.map +1 -0
  287. package/components/nav-drawer/themes/light/item/nav-drawer-item.indigo.css.d.ts +1 -0
  288. package/components/nav-drawer/themes/light/{indigo → item}/nav-drawer-item.indigo.css.js +32 -11
  289. package/components/nav-drawer/themes/light/item/nav-drawer-item.indigo.css.js.map +1 -0
  290. package/components/nav-drawer/themes/light/item/nav-drawer-item.material.css.d.ts +1 -0
  291. package/components/nav-drawer/themes/light/item/nav-drawer-item.material.css.js +54 -0
  292. package/components/nav-drawer/themes/light/item/nav-drawer-item.material.css.js.map +1 -0
  293. package/components/nav-drawer/themes/light/nav-drawer.base.css.js +11 -19
  294. package/components/nav-drawer/themes/light/nav-drawer.base.css.js.map +1 -1
  295. package/components/nav-drawer/themes/light/nav-drawer.bootstrap.css.d.ts +1 -0
  296. package/components/nav-drawer/themes/light/nav-drawer.bootstrap.css.js +60 -0
  297. package/components/nav-drawer/themes/light/nav-drawer.bootstrap.css.js.map +1 -0
  298. package/components/nav-drawer/themes/light/nav-drawer.fluent.css.d.ts +1 -0
  299. package/components/nav-drawer/themes/light/nav-drawer.fluent.css.js +60 -0
  300. package/components/nav-drawer/themes/light/nav-drawer.fluent.css.js.map +1 -0
  301. package/components/nav-drawer/themes/light/nav-drawer.indigo.css.d.ts +1 -0
  302. package/components/nav-drawer/themes/light/{indigo/nav-drawer.indigo.css.js → nav-drawer.indigo.css.js} +35 -4
  303. package/components/nav-drawer/themes/light/nav-drawer.indigo.css.js.map +1 -0
  304. package/components/nav-drawer/themes/light/nav-drawer.material.css.d.ts +1 -0
  305. package/components/nav-drawer/themes/light/nav-drawer.material.css.js +60 -0
  306. package/components/nav-drawer/themes/light/nav-drawer.material.css.js.map +1 -0
  307. package/components/navbar/themes/light/navbar.bootstrap.css.js +0 -32
  308. package/components/navbar/themes/light/navbar.bootstrap.css.js.map +1 -1
  309. package/components/navbar/themes/light/navbar.fluent.css.js +0 -32
  310. package/components/navbar/themes/light/navbar.fluent.css.js.map +1 -1
  311. package/components/navbar/themes/light/navbar.indigo.css.js +0 -32
  312. package/components/navbar/themes/light/navbar.indigo.css.js.map +1 -1
  313. package/components/navbar/themes/light/navbar.material.css.js +0 -32
  314. package/components/navbar/themes/light/navbar.material.css.js.map +1 -1
  315. package/components/navbar/themes/navbar.base.css.js +4 -10
  316. package/components/navbar/themes/navbar.base.css.js.map +1 -1
  317. package/components/progress/themes/linear/linear.progress.base.css.js +1 -0
  318. package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
  319. package/components/progress/themes/linear/linear.progress.indigo.css.js +0 -32
  320. package/components/progress/themes/linear/linear.progress.indigo.css.js.map +1 -1
  321. package/components/radio/radio.d.ts +13 -37
  322. package/components/radio/radio.js +135 -97
  323. package/components/radio/radio.js.map +1 -1
  324. package/components/radio/themes/light/radio.bootstrap.css.js +8 -36
  325. package/components/radio/themes/light/radio.bootstrap.css.js.map +1 -1
  326. package/components/radio/themes/light/radio.fluent.css.js +0 -32
  327. package/components/radio/themes/light/radio.fluent.css.js.map +1 -1
  328. package/components/radio/themes/light/radio.indigo.css.js +11 -37
  329. package/components/radio/themes/light/radio.indigo.css.js.map +1 -1
  330. package/components/radio/themes/light/radio.material.css.js +1 -33
  331. package/components/radio/themes/light/radio.material.css.js.map +1 -1
  332. package/components/radio-group/radio-group.d.ts +0 -4
  333. package/components/radio-group/radio-group.js +3 -54
  334. package/components/radio-group/radio-group.js.map +1 -1
  335. package/components/rating/dark/rating.fluent.css.d.ts +1 -0
  336. package/components/rating/dark/rating.fluent.css.js +3 -0
  337. package/components/rating/dark/rating.fluent.css.js.map +1 -0
  338. package/components/rating/rating-symbol.base.css.js +1 -1
  339. package/components/rating/rating-symbol.base.css.js.map +1 -1
  340. package/components/rating/rating.base.css.js +8 -16
  341. package/components/rating/rating.base.css.js.map +1 -1
  342. package/components/rating/rating.d.ts +10 -11
  343. package/components/rating/rating.fluent.css.js +13 -7
  344. package/components/rating/rating.fluent.css.js.map +1 -1
  345. package/components/rating/rating.js +19 -15
  346. package/components/rating/rating.js.map +1 -1
  347. package/components/select/select-item.d.ts +0 -2
  348. package/components/select/select-item.js +0 -3
  349. package/components/select/select-item.js.map +1 -1
  350. package/components/select/select.d.ts +7 -34
  351. package/components/select/select.js +27 -37
  352. package/components/select/select.js.map +1 -1
  353. package/components/select/themes/light/select.base.css.js +1 -12
  354. package/components/select/themes/light/select.base.css.js.map +1 -1
  355. package/components/select/themes/light/select.bootstrap.css.js +5 -37
  356. package/components/select/themes/light/select.bootstrap.css.js.map +1 -1
  357. package/components/select/themes/light/select.fluent.css.js +5 -37
  358. package/components/select/themes/light/select.fluent.css.js.map +1 -1
  359. package/components/select/themes/light/select.indigo.css.js +4 -36
  360. package/components/select/themes/light/select.indigo.css.js.map +1 -1
  361. package/components/select/themes/light/select.material.css.js +14 -46
  362. package/components/select/themes/light/select.material.css.js.map +1 -1
  363. package/components/slider/slider.d.ts +4 -12
  364. package/components/slider/slider.js +16 -25
  365. package/components/slider/slider.js.map +1 -1
  366. package/components/slider/themes/light/slider.base.css.js +17 -8
  367. package/components/slider/themes/light/slider.base.css.js.map +1 -1
  368. package/components/slider/themes/light/slider.fluent.css.js +6 -3
  369. package/components/slider/themes/light/slider.fluent.css.js.map +1 -1
  370. package/components/slider/themes/light/slider.indigo.css.js +4 -1
  371. package/components/slider/themes/light/slider.indigo.css.js.map +1 -1
  372. package/components/snackbar/snackbar.js +1 -1
  373. package/components/snackbar/snackbar.js.map +1 -1
  374. package/components/stepper/animations.d.ts +2 -0
  375. package/components/stepper/animations.js +22 -0
  376. package/components/stepper/animations.js.map +1 -0
  377. package/components/stepper/step.d.ts +17 -8
  378. package/components/stepper/step.js +29 -0
  379. package/components/stepper/step.js.map +1 -1
  380. package/components/stepper/stepper.d.ts +19 -3
  381. package/components/stepper/stepper.js +58 -7
  382. package/components/stepper/stepper.js.map +1 -1
  383. package/components/stepper/themes/step/light/step.base.css.js +44 -165
  384. package/components/stepper/themes/step/light/step.base.css.js.map +1 -1
  385. package/components/stepper/themes/step/light/step.bootstrap.css.js +116 -19
  386. package/components/stepper/themes/step/light/step.bootstrap.css.js.map +1 -1
  387. package/components/stepper/themes/step/light/step.fluent.css.js +112 -12
  388. package/components/stepper/themes/step/light/step.fluent.css.js.map +1 -1
  389. package/components/stepper/themes/step/light/step.indigo.css.js +112 -25
  390. package/components/stepper/themes/step/light/step.indigo.css.js.map +1 -1
  391. package/components/stepper/themes/step/light/step.material.css.js +112 -4
  392. package/components/stepper/themes/step/light/step.material.css.js.map +1 -1
  393. package/components/stepper/themes/stepper/stepper.base.css.js +2 -0
  394. package/components/stepper/themes/stepper/stepper.base.css.js.map +1 -1
  395. package/components/tabs/themes/light/tab.base.css.js +3 -4
  396. package/components/tabs/themes/light/tab.base.css.js.map +1 -1
  397. package/components/tabs/themes/light/tabs.base.css.js +1 -0
  398. package/components/tabs/themes/light/tabs.base.css.js.map +1 -1
  399. package/components/toast/toast.js +1 -1
  400. package/components/toast/toast.js.map +1 -1
  401. package/components/tree/themes/light/tree-item.base.css.js +5 -19
  402. package/components/tree/themes/light/tree-item.base.css.js.map +1 -1
  403. package/components/tree/themes/light/tree-item.bootstrap.css.js +60 -3
  404. package/components/tree/themes/light/tree-item.bootstrap.css.js.map +1 -1
  405. package/components/tree/themes/light/tree-item.fluent.css.js +58 -1
  406. package/components/tree/themes/light/tree-item.fluent.css.js.map +1 -1
  407. package/components/tree/themes/light/tree-item.indigo.css.js +58 -1
  408. package/components/tree/themes/light/tree-item.indigo.css.js.map +1 -1
  409. package/components/tree/themes/light/tree-item.material.css.d.ts +1 -0
  410. package/components/tree/themes/light/tree-item.material.css.js +58 -0
  411. package/components/tree/themes/light/tree-item.material.css.js.map +1 -0
  412. package/components/tree/themes/light/tree.base.css.js +0 -12
  413. package/components/tree/themes/light/tree.base.css.js.map +1 -1
  414. package/components/tree/tree-item.js +10 -17
  415. package/components/tree/tree-item.js.map +1 -1
  416. package/components/tree/tree.d.ts +0 -6
  417. package/components/tree/tree.js +0 -4
  418. package/components/tree/tree.js.map +1 -1
  419. package/components/tree/tree.navigation.js +3 -2
  420. package/components/tree/tree.navigation.js.map +1 -1
  421. package/custom-elements.json +854 -553
  422. package/package.json +4 -4
  423. package/themes/dark/bootstrap.css +277 -66
  424. package/themes/dark/fluent.css +293 -67
  425. package/themes/dark/indigo.css +498 -15
  426. package/themes/dark/material.css +246 -58
  427. package/themes/light/bootstrap.css +5 -2
  428. package/themes/light/fluent.css +5 -2
  429. package/themes/light/indigo.css +229 -2
  430. package/themes/light/material.css +5 -2
  431. package/vscode-html-custom-data.json +240 -287
  432. package/components/avatar/themes/dark/avatar.base.bootstrap.css.js.map +0 -1
  433. package/components/avatar/themes/light/avatar.base.css.js.map +0 -1
  434. package/components/common/types.d.ts +0 -1
  435. package/components/common/types.js +0 -2
  436. package/components/common/types.js.map +0 -1
  437. package/components/nav-drawer/themes/dark/nav-drawer-item.bootstrap.css.js +0 -3
  438. package/components/nav-drawer/themes/dark/nav-drawer-item.bootstrap.css.js.map +0 -1
  439. package/components/nav-drawer/themes/dark/nav-drawer-item.fluent.css.js.map +0 -1
  440. package/components/nav-drawer/themes/dark/nav-drawer-item.indigo.css.js.map +0 -1
  441. package/components/nav-drawer/themes/light/fluent/nav-drawer-header-item.fluent.css.js.map +0 -1
  442. package/components/nav-drawer/themes/light/fluent/nav-drawer-item.fluent.css.js +0 -17
  443. package/components/nav-drawer/themes/light/fluent/nav-drawer-item.fluent.css.js.map +0 -1
  444. package/components/nav-drawer/themes/light/indigo/nav-drawer-header-item.indigo.css.js +0 -5
  445. package/components/nav-drawer/themes/light/indigo/nav-drawer-header-item.indigo.css.js.map +0 -1
  446. package/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.js.map +0 -1
  447. package/components/nav-drawer/themes/light/indigo/nav-drawer.indigo.css.js.map +0 -1
  448. package/components/nav-drawer/themes/light/nav-drawer-header-item.base.css.js +0 -49
  449. package/components/nav-drawer/themes/light/nav-drawer-header-item.base.css.js.map +0 -1
  450. package/components/nav-drawer/themes/light/nav-drawer-item.base.css.js +0 -137
  451. package/components/nav-drawer/themes/light/nav-drawer-item.base.css.js.map +0 -1
  452. /package/components/avatar/themes/{light/avatar.base.css.d.ts → avatar.base.css.d.ts} +0 -0
  453. /package/components/avatar/themes/dark/{avatar.base.bootstrap.css.d.ts → avatar.bootstrap.css.d.ts} +0 -0
  454. /package/components/{nav-drawer/themes/dark/nav-drawer-item.base.css.d.ts → avatar/themes/dark/avatar.fluent.css.d.ts} +0 -0
  455. /package/components/{nav-drawer/themes/dark/nav-drawer-item.bootstrap.css.d.ts → avatar/themes/dark/avatar.indigo.css.d.ts} +0 -0
  456. /package/components/{nav-drawer/themes/dark/nav-drawer-item.fluent.css.d.ts → avatar/themes/dark/avatar.material.css.d.ts} +0 -0
  457. /package/components/{nav-drawer/themes/dark/nav-drawer-item.indigo.css.d.ts → avatar/themes/light/avatar.fluent.css.d.ts} +0 -0
  458. /package/components/{nav-drawer/themes/light/fluent/nav-drawer-header-item.fluent.css.d.ts → avatar/themes/light/avatar.indigo.css.d.ts} +0 -0
  459. /package/components/{nav-drawer/themes/light/fluent/nav-drawer-item.fluent.css.d.ts → avatar/themes/light/avatar.material.css.d.ts} +0 -0
  460. /package/components/nav-drawer/themes/{light/indigo/nav-drawer-header-item.indigo.css.d.ts → dark/nav-drawer.bootstrap.css.d.ts} +0 -0
  461. /package/components/nav-drawer/themes/{light/indigo/nav-drawer-item.indigo.css.d.ts → dark/nav-drawer.fluent.css.d.ts} +0 -0
  462. /package/components/nav-drawer/themes/{light/indigo/nav-drawer.indigo.css.d.ts → dark/nav-drawer.material.css.d.ts} +0 -0
  463. /package/components/nav-drawer/themes/light/{nav-drawer-header-item.base.css.d.ts → header-item/nav-drawer-header-item.base.css.d.ts} +0 -0
  464. /package/components/nav-drawer/themes/light/{nav-drawer-item.base.css.d.ts → header-item/nav-drawer-header-item.bootstrap.css.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"list.base.css.js","sourceRoot":"","sources":["../../../../../src/components/list/themes/light/list.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkFvB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host {\n --is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);\n --is-medium: min(\n clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1),\n clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1)\n );\n --is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);\n position: relative;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n scrollbar-width: var(--ig-scrollbar-size);\n scrollbar-color: var(--ig-scrollbar-thumb-background) var(--ig-scrollbar-track-background);\n}\n:host *,\n:host *::before,\n:host *::after {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n:host ::-webkit-scrollbar {\n width: var(--ig-scrollbar-size);\n height: var(--ig-scrollbar-size);\n background: var(--ig-scrollbar-track-background);\n}\n:host ::-webkit-scrollbar-thumb {\n background: var(--ig-scrollbar-thumb-background);\n}\n\n:host([hidden]),\n[hidden] {\n display: none !important;\n}\n:host {\n --background: var(--ig-list-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));\n --header-background: var(--ig-list-header-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));\n --header-text-color: var(--ig-list-header-text-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));\n --item-background: var(--ig-list-item-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));\n --item-background-hover: var(--ig-list-item-background-hover, hsla(var(--ig-gray-200), var(--ig-gray-a)));\n --item-background-active: var(--ig-list-item-background-active, hsla(var(--ig-gray-200), var(--ig-gray-a)));\n --item-text-color: var(--ig-list-item-text-color, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n --item-text-color-hover: var(--ig-list-item-text-color-hover, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n --item-text-color-active: var(--ig-list-item-text-color-active, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n --item-title-color: var(--ig-list-item-title-color, 'currentColor');\n --item-title-color-hover: var(--ig-list-item-title-color-hover, 'currentColor');\n --item-title-color-active: var(--ig-list-item-title-color-active, 'currentColor');\n --item-action-color: var(--ig-list-item-action-color, 'currentColor');\n --item-action-color-hover: var(--ig-list-item-action-color-hover, 'currentColor');\n --item-action-color-active: var(--ig-list-item-action-color-active, 'currentColor');\n --item-subtitle-color: var(--ig-list-item-subtitle-color, 'currentColor');\n --item-subtitle-color-hover: var(--ig-list-item-subtitle-color-hover, 'currentColor');\n --item-subtitle-color-active: var(--ig-list-item-subtitle-color-active, 'currentColor');\n --item-thumbnail-color: var(--ig-list-item-thumbnail-color, 'currentColor');\n --item-thumbnail-color-hover: var(--ig-list-item-thumbnail-color-hover, 'currentColor');\n --item-thumbnail-color-active: var(--ig-list-item-thumbnail-color-active, 'currentColor');\n --border-color: var(--ig-list-border-color, transparent);\n --border-width: var(--ig-list-border-width, 0);\n --border-radius: var(--ig-list-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.5rem), 1.5rem));\n --item-border-radius: var(--ig-list-item-border-radius, 0rem, 0rem, 1.5rem);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-flow: column nowrap;\n flex-flow: column nowrap;\n font-family: var(--ig-font-family);\n overflow: hidden auto;\n height: auto;\n background: hsla(var(--ig-surface-500), var(--ig-surface-a));\n border-radius: var(--border-radius);\n}\n\n:host([size=small]) {\n --component-size: var(--ig-size, var(--ig-size-small));\n}\n\n:host([size=medium]) {\n --component-size: var(--ig-size, var(--ig-size-medium));\n}\n\n:host([size=large]) {\n --component-size: var(--ig-size, var(--ig-size-large));\n}`;\n"]}
1
+ {"version":3,"file":"list.base.css.js","sourceRoot":"","sources":["../../../../../src/components/list/themes/light/list.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsEvB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host {\n --is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);\n --is-medium: min(\n clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1),\n clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1)\n );\n --is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);\n position: relative;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n scrollbar-width: var(--ig-scrollbar-size);\n scrollbar-color: var(--ig-scrollbar-thumb-background) var(--ig-scrollbar-track-background);\n}\n:host *,\n:host *::before,\n:host *::after {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n:host ::-webkit-scrollbar {\n width: var(--ig-scrollbar-size);\n height: var(--ig-scrollbar-size);\n background: var(--ig-scrollbar-track-background);\n}\n:host ::-webkit-scrollbar-thumb {\n background: var(--ig-scrollbar-thumb-background);\n}\n\n:host([hidden]),\n[hidden] {\n display: none !important;\n}\n:host {\n --background: var(--ig-list-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));\n --header-background: var(--ig-list-header-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));\n --header-text-color: var(--ig-list-header-text-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));\n --item-background: var(--ig-list-item-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));\n --item-background-hover: var(--ig-list-item-background-hover, hsla(var(--ig-gray-200), var(--ig-gray-a)));\n --item-background-active: var(--ig-list-item-background-active, hsla(var(--ig-gray-200), var(--ig-gray-a)));\n --item-text-color: var(--ig-list-item-text-color, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n --item-text-color-hover: var(--ig-list-item-text-color-hover, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n --item-text-color-active: var(--ig-list-item-text-color-active, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n --item-title-color: var(--ig-list-item-title-color, 'currentColor');\n --item-title-color-hover: var(--ig-list-item-title-color-hover, 'currentColor');\n --item-title-color-active: var(--ig-list-item-title-color-active, 'currentColor');\n --item-action-color: var(--ig-list-item-action-color, 'currentColor');\n --item-action-color-hover: var(--ig-list-item-action-color-hover, 'currentColor');\n --item-action-color-active: var(--ig-list-item-action-color-active, 'currentColor');\n --item-subtitle-color: var(--ig-list-item-subtitle-color, 'currentColor');\n --item-subtitle-color-hover: var(--ig-list-item-subtitle-color-hover, 'currentColor');\n --item-subtitle-color-active: var(--ig-list-item-subtitle-color-active, 'currentColor');\n --item-thumbnail-color: var(--ig-list-item-thumbnail-color, 'currentColor');\n --item-thumbnail-color-hover: var(--ig-list-item-thumbnail-color-hover, 'currentColor');\n --item-thumbnail-color-active: var(--ig-list-item-thumbnail-color-active, 'currentColor');\n --border-color: var(--ig-list-border-color, transparent);\n --border-width: var(--ig-list-border-width, 0);\n --border-radius: var(--ig-list-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.5rem), 1.5rem));\n --item-border-radius: var(--ig-list-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.5rem), 1.5rem));\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-flow: column nowrap;\n flex-flow: column nowrap;\n font-family: var(--ig-font-family);\n overflow: hidden auto;\n height: auto;\n background: hsla(var(--ig-surface-500), var(--ig-surface-a));\n border-radius: var(--border-radius);\n}`;\n"]}
@@ -24,7 +24,7 @@ export const styles = css `:host {
24
24
  --border-color: var(--ig-list-border-color, hsla(var(--ig-gray-300), var(--ig-gray-a)));
25
25
  --border-width: var(--ig-list-border-width, 0.0625rem);
26
26
  --border-radius: var(--ig-list-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.1666666667) * 1.5rem), 1.5rem));
27
- --item-border-radius: var(--ig-list-item-border-radius, 0rem, 0rem, 1.5rem);
27
+ --item-border-radius: var(--ig-list-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.5rem), 1.5rem));
28
28
  background: var(--ig-gray-900-contrast);
29
29
  border: 0.0625rem solid hsla(var(--ig-gray-300), var(--ig-gray-a));
30
30
  border-radius: var(--border-radius);
@@ -1 +1 @@
1
- {"version":3,"file":"list.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/list/themes/light/list.bootstrap.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BvB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host {\n --background: var(--ig-list-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));\n --header-background: var(--ig-list-header-background, var(--ig-gray-900-contrast));\n --header-text-color: var(--ig-list-header-text-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));\n --item-background: var(--ig-list-item-background, var(--ig-gray-900-contrast));\n --item-background-hover: var(--ig-list-item-background-hover, hsla(var(--ig-gray-200), var(--ig-gray-a)));\n --item-background-active: var(--ig-list-item-background-active, hsla(var(--ig-gray-200), var(--ig-gray-a)));\n --item-text-color: var(--ig-list-item-text-color, hsla(var(--ig-gray-900), var(--ig-gray-a)));\n --item-text-color-hover: var(--ig-list-item-text-color-hover, hsla(var(--ig-gray-900), var(--ig-gray-a)));\n --item-text-color-active: var(--ig-list-item-text-color-active, hsla(var(--ig-gray-900), var(--ig-gray-a)));\n --item-title-color: var(--ig-list-item-title-color, 'currentColor');\n --item-title-color-hover: var(--ig-list-item-title-color-hover, 'currentColor');\n --item-title-color-active: var(--ig-list-item-title-color-active, 'currentColor');\n --item-action-color: var(--ig-list-item-action-color, 'currentColor');\n --item-action-color-hover: var(--ig-list-item-action-color-hover, 'currentColor');\n --item-action-color-active: var(--ig-list-item-action-color-active, 'currentColor');\n --item-subtitle-color: var(--ig-list-item-subtitle-color, 'currentColor');\n --item-subtitle-color-hover: var(--ig-list-item-subtitle-color-hover, 'currentColor');\n --item-subtitle-color-active: var(--ig-list-item-subtitle-color-active, 'currentColor');\n --item-thumbnail-color: var(--ig-list-item-thumbnail-color, 'currentColor');\n --item-thumbnail-color-hover: var(--ig-list-item-thumbnail-color-hover, 'currentColor');\n --item-thumbnail-color-active: var(--ig-list-item-thumbnail-color-active, 'currentColor');\n --border-color: var(--ig-list-border-color, hsla(var(--ig-gray-300), var(--ig-gray-a)));\n --border-width: var(--ig-list-border-width, 0.0625rem);\n --border-radius: var(--ig-list-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.1666666667) * 1.5rem), 1.5rem));\n --item-border-radius: var(--ig-list-item-border-radius, 0rem, 0rem, 1.5rem);\n background: var(--ig-gray-900-contrast);\n border: 0.0625rem solid hsla(var(--ig-gray-300), var(--ig-gray-a));\n border-radius: var(--border-radius);\n}`;\n"]}
1
+ {"version":3,"file":"list.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/list/themes/light/list.bootstrap.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BvB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host {\n --background: var(--ig-list-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));\n --header-background: var(--ig-list-header-background, var(--ig-gray-900-contrast));\n --header-text-color: var(--ig-list-header-text-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));\n --item-background: var(--ig-list-item-background, var(--ig-gray-900-contrast));\n --item-background-hover: var(--ig-list-item-background-hover, hsla(var(--ig-gray-200), var(--ig-gray-a)));\n --item-background-active: var(--ig-list-item-background-active, hsla(var(--ig-gray-200), var(--ig-gray-a)));\n --item-text-color: var(--ig-list-item-text-color, hsla(var(--ig-gray-900), var(--ig-gray-a)));\n --item-text-color-hover: var(--ig-list-item-text-color-hover, hsla(var(--ig-gray-900), var(--ig-gray-a)));\n --item-text-color-active: var(--ig-list-item-text-color-active, hsla(var(--ig-gray-900), var(--ig-gray-a)));\n --item-title-color: var(--ig-list-item-title-color, 'currentColor');\n --item-title-color-hover: var(--ig-list-item-title-color-hover, 'currentColor');\n --item-title-color-active: var(--ig-list-item-title-color-active, 'currentColor');\n --item-action-color: var(--ig-list-item-action-color, 'currentColor');\n --item-action-color-hover: var(--ig-list-item-action-color-hover, 'currentColor');\n --item-action-color-active: var(--ig-list-item-action-color-active, 'currentColor');\n --item-subtitle-color: var(--ig-list-item-subtitle-color, 'currentColor');\n --item-subtitle-color-hover: var(--ig-list-item-subtitle-color-hover, 'currentColor');\n --item-subtitle-color-active: var(--ig-list-item-subtitle-color-active, 'currentColor');\n --item-thumbnail-color: var(--ig-list-item-thumbnail-color, 'currentColor');\n --item-thumbnail-color-hover: var(--ig-list-item-thumbnail-color-hover, 'currentColor');\n --item-thumbnail-color-active: var(--ig-list-item-thumbnail-color-active, 'currentColor');\n --border-color: var(--ig-list-border-color, hsla(var(--ig-gray-300), var(--ig-gray-a)));\n --border-width: var(--ig-list-border-width, 0.0625rem);\n --border-radius: var(--ig-list-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.1666666667) * 1.5rem), 1.5rem));\n --item-border-radius: var(--ig-list-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 1.5rem), 1.5rem));\n background: var(--ig-gray-900-contrast);\n border: 0.0625rem solid hsla(var(--ig-gray-300), var(--ig-gray-a));\n border-radius: var(--border-radius);\n}`;\n"]}
@@ -8,21 +8,14 @@ export declare abstract class IgcMaskInputBaseComponent extends IgcInputBaseComp
8
8
  protected parser: MaskParser;
9
9
  protected selection: MaskRange;
10
10
  protected compositionStart: number;
11
- protected hasFocus: boolean;
11
+ protected focused: boolean;
12
12
  protected maskedValue: string;
13
13
  protected _mask: string;
14
14
  /** The prompt symbol to use for unfilled parts of the mask. */
15
15
  prompt: string;
16
- /** Controls the validity of the control. */
17
- invalid: boolean;
18
16
  protected get inputSelection(): MaskRange;
19
17
  protected get emptyMask(): string;
20
18
  connectedCallback(): void;
21
- /**
22
- * Sets a custom validation message for the control.
23
- * As long as `message` is not empty, the control is considered invalid.
24
- */
25
- setCustomValidity(message: string): void;
26
19
  /** Selects all text within the input. */
27
20
  select(): void;
28
21
  protected handleInput({ inputType, isComposing }: InputEvent): void | Promise<void>;
@@ -31,7 +24,7 @@ export declare abstract class IgcMaskInputBaseComponent extends IgcInputBaseComp
31
24
  protected handleDragStart(): void;
32
25
  protected handleCompositionStart(): void;
33
26
  protected handleCompositionEnd({ data }: CompositionEvent): void;
34
- protected handleInvalid(): void;
27
+ protected handleClick(): void;
35
28
  setSelectionRange(start: number, end: number, direction?: 'backward' | 'forward' | 'none'): void;
36
29
  protected abstract updateInput(string: string, range: MaskRange): void;
37
30
  }
@@ -15,10 +15,9 @@ let IgcMaskInputBaseComponent = class IgcMaskInputBaseComponent extends IgcInput
15
15
  this.parser = new MaskParser();
16
16
  this.selection = { start: 0, end: 0 };
17
17
  this.compositionStart = 0;
18
- this.hasFocus = false;
18
+ this.focused = false;
19
19
  this.maskedValue = '';
20
20
  this._mask = '';
21
- this.invalid = false;
22
21
  }
23
22
  get inputSelection() {
24
23
  return {
@@ -34,10 +33,6 @@ let IgcMaskInputBaseComponent = class IgcMaskInputBaseComponent extends IgcInput
34
33
  this._mask = this._mask || this.parser.mask;
35
34
  this.prompt = this.prompt || this.parser.prompt;
36
35
  }
37
- setCustomValidity(message) {
38
- this.input.setCustomValidity(message);
39
- this.invalid = !this.input.checkValidity();
40
- }
41
36
  select() {
42
37
  this.input.select();
43
38
  }
@@ -91,8 +86,11 @@ let IgcMaskInputBaseComponent = class IgcMaskInputBaseComponent extends IgcInput
91
86
  end: this.inputSelection.end,
92
87
  });
93
88
  }
94
- handleInvalid() {
95
- this.invalid = true;
89
+ handleClick() {
90
+ const { selectionStart: start, selectionEnd: end } = this.input;
91
+ if (start === end && start === this.maskedValue.length) {
92
+ this.select();
93
+ }
96
94
  }
97
95
  setSelectionRange(start, end, direction) {
98
96
  super.setSelectionRange(start, end, direction);
@@ -101,7 +99,7 @@ let IgcMaskInputBaseComponent = class IgcMaskInputBaseComponent extends IgcInput
101
99
  };
102
100
  __decorate([
103
101
  state()
104
- ], IgcMaskInputBaseComponent.prototype, "hasFocus", void 0);
102
+ ], IgcMaskInputBaseComponent.prototype, "focused", void 0);
105
103
  __decorate([
106
104
  state()
107
105
  ], IgcMaskInputBaseComponent.prototype, "maskedValue", void 0);
@@ -111,9 +109,6 @@ __decorate([
111
109
  __decorate([
112
110
  property()
113
111
  ], IgcMaskInputBaseComponent.prototype, "prompt", void 0);
114
- __decorate([
115
- property({ reflect: true, type: Boolean })
116
- ], IgcMaskInputBaseComponent.prototype, "invalid", void 0);
117
112
  __decorate([
118
113
  blazorSuppress()
119
114
  ], IgcMaskInputBaseComponent.prototype, "setSelectionRange", null);
@@ -1 +1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BAAiB,CAC/B,KAAa,EACb,GAAW,EACX,SAA2C;QAE3C,KAAK,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IAClC,CAAC;CAGF,CAAA;AAzIW;IADT,KAAK,EAAE;2DACmB;AAGjB;IADT,KAAK,EAAE;8DACmB;AAGjB;IADT,KAAK,EAAE;wDACa;AAId;IADN,QAAQ,EAAE;yDACY;AAIhB;IADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DACpB;AAiHP;IADf,cAAc,EAAE;kEAQhB;AA5ImB,yBAAyB;IAD9C,gBAAgB;GACK,yBAAyB,CA+I9C;SA/IqB,yBAAyB","sourcesContent":["import { property, state } from 'lit/decorators.js';\nimport { blazorDeepImport } from '../common/decorators/blazorDeepImport.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\nimport { IgcInputBaseComponent } from '../input/input-base.js';\nimport { MaskParser } from './mask-parser.js';\n\nexport type MaskRange = {\n start: number;\n end: number;\n};\n\n@blazorDeepImport\nexport abstract class IgcMaskInputBaseComponent extends IgcInputBaseComponent {\n protected parser = new MaskParser();\n protected selection: MaskRange = { start: 0, end: 0 };\n protected compositionStart = 0;\n\n @state()\n protected hasFocus = false;\n\n @state()\n protected maskedValue = '';\n\n @state()\n protected _mask = '';\n\n /** The prompt symbol to use for unfilled parts of the mask. */\n @property()\n public prompt!: string;\n\n /** Controls the validity of the control. */\n @property({ reflect: true, type: Boolean })\n public invalid = false;\n\n protected get inputSelection(): MaskRange {\n return {\n start: this.input.selectionStart || 0,\n end: this.input.selectionEnd || 0,\n };\n }\n\n protected get emptyMask(): string {\n return this.parser.apply();\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n\n this._mask = this._mask || this.parser.mask;\n this.prompt = this.prompt || this.parser.prompt;\n }\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) {\n this.input.setCustomValidity(message);\n this.invalid = !this.input.checkValidity();\n }\n\n /** Selects all text within the input. */\n public select() {\n this.input.select();\n }\n\n protected handleInput({ inputType, isComposing }: InputEvent) {\n const EMPTY = '';\n const value = this.input.value;\n const { start, end } = this.selection;\n const deleteEnd = this.parser.getNextNonLiteralPosition(end) + 1;\n\n switch (inputType) {\n case 'deleteContentForward':\n this.updateInput(EMPTY, { start, end: deleteEnd });\n return this.updateComplete.then(() =>\n this.input.setSelectionRange(deleteEnd, deleteEnd)\n );\n\n case 'deleteContentBackward':\n if (isComposing) return;\n return this.updateInput(EMPTY, {\n start: this.parser.getPreviousNonLiteralPosition(\n this.inputSelection.start\n ),\n end,\n });\n\n case 'deleteByCut':\n return this.updateInput(EMPTY, this.selection);\n\n case 'insertText':\n return this.updateInput(\n value.substring(start, this.inputSelection.end),\n this.selection\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 );\n\n case 'insertFromDrop':\n return this.updateInput(\n value.substring(this.inputSelection.start, this.inputSelection.end),\n { ...this.inputSelection }\n );\n }\n }\n\n protected handleKeydown({ key }: KeyboardEvent) {\n if (!key) {\n return;\n }\n this.selection = this.inputSelection;\n }\n\n protected handleCut() {\n this.selection = this.inputSelection;\n }\n\n protected handleDragStart() {\n this.selection = this.inputSelection;\n }\n\n protected handleCompositionStart() {\n this.compositionStart = this.inputSelection.start;\n }\n\n protected handleCompositionEnd({ data }: CompositionEvent) {\n this.updateInput(data, {\n start: this.compositionStart,\n end: this.inputSelection.end,\n });\n }\n\n protected handleInvalid() {\n this.invalid = true;\n }\n\n @blazorSuppress()\n public override setSelectionRange(\n start: number,\n end: number,\n direction?: 'backward' | 'forward' | 'none'\n ): void {\n super.setSelectionRange(start, end, direction);\n this.selection = { start, end };\n }\n\n protected abstract updateInput(string: string, range: MaskRange): void;\n}\n"]}
1
+ {"version":3,"file":"mask-input-base.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-input-base.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQ9C,IAAsB,yBAAyB,GAA/C,MAAsB,yBAA0B,SAAQ,qBAAqB;IAA7E;;QACY,WAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC1B,cAAS,GAAc,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;QAC5C,qBAAgB,GAAG,CAAC,CAAC;QAGrB,YAAO,GAAG,KAAK,CAAC;QAGhB,gBAAW,GAAG,EAAE,CAAC;QAGjB,UAAK,GAAG,EAAE,CAAC;IA2HvB,CAAC;IArHC,IAAc,cAAc;QAC1B,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,CAAC;YACrC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC;SAClC,CAAC;IACJ,CAAC;IAED,IAAc,SAAS;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAEe,iBAAiB;QAC/B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAClD,CAAC;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/B,KAAa,EACb,GAAW,EACX,SAA2C;QAE3C,KAAK,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IAClC,CAAC;CAGF,CAAA;AAjIW;IADT,KAAK,EAAE;0DACkB;AAGhB;IADT,KAAK,EAAE;8DACmB;AAGjB;IADT,KAAK,EAAE;wDACa;AAId;IADN,QAAQ,EAAE;yDACY;AA6GP;IADf,cAAc,EAAE;kEAQhB;AApImB,yBAAyB;IAD9C,gBAAgB;GACK,yBAAyB,CAuI9C;SAvIqB,yBAAyB","sourcesContent":["import { property, state } from 'lit/decorators.js';\nimport { blazorDeepImport } from '../common/decorators/blazorDeepImport.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\nimport { IgcInputBaseComponent } from '../input/input-base.js';\nimport { MaskParser } from './mask-parser.js';\n\nexport type MaskRange = {\n start: number;\n end: number;\n};\n\n@blazorDeepImport\nexport abstract class IgcMaskInputBaseComponent extends IgcInputBaseComponent {\n protected parser = new MaskParser();\n protected selection: MaskRange = { start: 0, end: 0 };\n protected compositionStart = 0;\n\n @state()\n protected focused = false;\n\n @state()\n protected maskedValue = '';\n\n @state()\n protected _mask = '';\n\n /** The prompt symbol to use for unfilled parts of the mask. */\n @property()\n public prompt!: string;\n\n protected get inputSelection(): MaskRange {\n return {\n start: this.input.selectionStart || 0,\n end: this.input.selectionEnd || 0,\n };\n }\n\n protected get emptyMask(): string {\n return this.parser.apply();\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n\n this._mask = this._mask || this.parser.mask;\n this.prompt = this.prompt || this.parser.prompt;\n }\n\n /** Selects all text within the input. */\n public select() {\n this.input.select();\n }\n\n protected handleInput({ inputType, isComposing }: InputEvent) {\n const EMPTY = '';\n const value = this.input.value;\n const { start, end } = this.selection;\n const deleteEnd = this.parser.getNextNonLiteralPosition(end) + 1;\n\n switch (inputType) {\n case 'deleteContentForward':\n this.updateInput(EMPTY, { start, end: deleteEnd });\n return this.updateComplete.then(() =>\n this.input.setSelectionRange(deleteEnd, deleteEnd)\n );\n\n case 'deleteContentBackward':\n if (isComposing) return;\n return this.updateInput(EMPTY, {\n start: this.parser.getPreviousNonLiteralPosition(\n this.inputSelection.start\n ),\n end,\n });\n\n case 'deleteByCut':\n return this.updateInput(EMPTY, this.selection);\n\n case 'insertText':\n return this.updateInput(\n value.substring(start, this.inputSelection.end),\n this.selection\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 );\n\n case 'insertFromDrop':\n return this.updateInput(\n value.substring(this.inputSelection.start, this.inputSelection.end),\n { ...this.inputSelection }\n );\n }\n }\n\n protected handleKeydown({ key }: KeyboardEvent) {\n if (!key) {\n return;\n }\n this.selection = this.inputSelection;\n }\n\n protected handleCut() {\n this.selection = this.inputSelection;\n }\n\n protected handleDragStart() {\n this.selection = this.inputSelection;\n }\n\n protected handleCompositionStart() {\n this.compositionStart = this.inputSelection.start;\n }\n\n protected handleCompositionEnd({ data }: CompositionEvent) {\n this.updateInput(data, {\n start: this.compositionStart,\n end: this.inputSelection.end,\n });\n }\n\n protected handleClick() {\n const { selectionStart: start, selectionEnd: end } = this.input;\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 @blazorSuppress()\n public override setSelectionRange(\n start: number,\n end: number,\n direction?: 'backward' | 'forward' | 'none'\n ): void {\n super.setSelectionRange(start, end, direction);\n this.selection = { start, end };\n }\n\n protected abstract updateInput(string: string, range: MaskRange): void;\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { IgcMaskInputBaseComponent, MaskRange } from './mask-input-base.js';
2
+ import { Validator } from '../common/validators.js';
2
3
  /**
3
4
  * A masked input is an input field where a developer can control user input and format the visible value,
4
5
  * based on configurable rules
@@ -23,6 +24,7 @@ import { IgcMaskInputBaseComponent, MaskRange } from './mask-input-base.js';
23
24
  */
24
25
  export default class IgcMaskInputComponent extends IgcMaskInputBaseComponent {
25
26
  static readonly tagName = "igc-mask-input";
27
+ protected validators: Validator<this>[];
26
28
  protected _value: string;
27
29
  /**
28
30
  * Dictates the behavior when retrieving the value of the control:
@@ -47,22 +49,19 @@ export default class IgcMaskInputComponent extends IgcMaskInputBaseComponent {
47
49
  get mask(): string;
48
50
  /** The mask pattern to apply on the input. */
49
51
  set mask(value: string);
52
+ connectedCallback(): void;
53
+ protected setDefaultValue(): void;
54
+ protected updateFormValue(): void;
50
55
  protected promptChange(): void;
51
- protected handleInvalidState(): Promise<void>;
52
56
  protected updateInput(string: string, range: MaskRange): Promise<void>;
53
57
  protected handleDragEnter(): void;
54
58
  protected handleDragLeave(): void;
55
59
  protected handleFocus(): Promise<void>;
56
60
  protected handleBlur(): void;
57
61
  protected handleChange(): void;
58
- protected handleClick(): void;
59
62
  protected updateMaskedValue(): void;
60
63
  /** Replaces the selected text in the control and re-applies the mask */
61
64
  setRangeText(replacement: string, start: number, end: number, _selectMode?: 'select' | 'start' | 'end' | 'preserve'): void;
62
- /** Checks for validity of the control and shows the browser message if it's invalid. */
63
- reportValidity(): boolean;
64
- /** Check for validity of the control */
65
- checkValidity(): boolean;
66
65
  protected renderInput(): import("lit-html").TemplateResult<1>;
67
66
  }
68
67
  declare global {
@@ -12,22 +12,32 @@ import { watch } from '../common/decorators/watch.js';
12
12
  import { blazorTwoWayBind } from '../common/decorators/blazorTwoWayBind.js';
13
13
  import { partNameMap } from '../common/util.js';
14
14
  import { IgcMaskInputBaseComponent } from './mask-input-base.js';
15
+ import messages from '../common/localization/validation-en.js';
16
+ import { requiredValidator } from '../common/validators.js';
15
17
  class IgcMaskInputComponent extends IgcMaskInputBaseComponent {
16
18
  constructor() {
17
19
  super(...arguments);
20
+ this.validators = [
21
+ {
22
+ ...requiredValidator,
23
+ isValid: () => (this.required ? !!this._value : true),
24
+ },
25
+ {
26
+ key: 'badInput',
27
+ message: messages.mask,
28
+ isValid: () => this.parser.isValidString(this.maskedValue),
29
+ },
30
+ ];
18
31
  this._value = '';
19
32
  this.valueMode = 'raw';
20
33
  }
21
34
  get value() {
22
- return this._value
23
- ? this.valueMode !== 'raw'
24
- ? this.maskedValue
25
- : this._value
26
- : this._value;
35
+ return this.valueMode !== 'raw' ? this.maskedValue : this._value;
27
36
  }
28
37
  set value(string) {
29
38
  this._value = string !== null && string !== void 0 ? string : '';
30
39
  this.maskedValue = this.parser.apply(this._value);
40
+ this.updateFormValue();
31
41
  }
32
42
  get mask() {
33
43
  return this._mask;
@@ -39,90 +49,78 @@ class IgcMaskInputComponent extends IgcMaskInputBaseComponent {
39
49
  this.maskedValue = this.parser.apply(this._value);
40
50
  }
41
51
  }
52
+ connectedCallback() {
53
+ super.connectedCallback();
54
+ this.updateValidity();
55
+ }
56
+ setDefaultValue() {
57
+ this._defaultValue = this._value;
58
+ }
59
+ updateFormValue() {
60
+ this.valueMode === 'raw'
61
+ ? this.setFormValue(this.value || null, this.value)
62
+ : this.setFormValue(this.maskedValue || null, this.maskedValue);
63
+ this.updateValidity();
64
+ this.setInvalidState();
65
+ }
42
66
  promptChange() {
43
67
  this.parser.prompt = this.prompt;
44
68
  if (this.value) {
45
69
  this.maskedValue = this.parser.apply(this._value);
46
70
  }
47
71
  }
48
- async handleInvalidState() {
49
- await this.updateComplete;
50
- this.invalid = !this.checkValidity();
51
- }
52
72
  async updateInput(string, range) {
53
73
  const { value, end } = this.parser.replace(this.maskedValue, string, range.start, range.end);
54
74
  this.maskedValue = value;
55
75
  this._value = this.parser.parse(value);
76
+ this.updateFormValue();
56
77
  this.requestUpdate();
57
78
  if (range.start !== this.mask.length) {
58
79
  this.emitEvent('igcInput', { detail: this.value });
59
80
  }
60
81
  await this.updateComplete;
61
82
  this.input.setSelectionRange(end, end);
62
- this.invalid = !this.checkValidity();
63
83
  }
64
84
  handleDragEnter() {
65
- if (!this.hasFocus && !this._value) {
66
- this.maskedValue = this.parser.apply();
85
+ if (!this.focused && !this._value) {
86
+ this.maskedValue = this.emptyMask;
67
87
  }
68
88
  }
69
89
  handleDragLeave() {
70
- if (!this.hasFocus) {
90
+ if (!this.focused) {
71
91
  this.updateMaskedValue();
72
92
  }
73
93
  }
74
94
  async handleFocus() {
75
- this.hasFocus = true;
95
+ this.focused = true;
76
96
  super.handleFocus();
77
97
  if (this.readonly) {
78
98
  return;
79
99
  }
80
100
  if (!this._value) {
81
- this.maskedValue = this.parser.apply();
101
+ this.maskedValue = this.emptyMask;
82
102
  await this.updateComplete;
83
103
  this.select();
84
104
  }
85
105
  }
86
106
  handleBlur() {
87
- this.hasFocus = false;
107
+ this.focused = false;
88
108
  this.updateMaskedValue();
109
+ this.invalid = !this.checkValidity();
89
110
  super.handleBlur();
90
111
  }
91
112
  handleChange() {
92
113
  this.emitEvent('igcChange', { detail: this.value });
93
- this.invalid = !this.checkValidity();
94
- }
95
- handleClick() {
96
- if (this.input.selectionStart === this.input.selectionEnd &&
97
- this.input.selectionStart === this.maskedValue.length) {
98
- this.select();
99
- }
100
114
  }
101
115
  updateMaskedValue() {
102
- if (this.maskedValue === this.parser.apply()) {
116
+ if (this.maskedValue === this.emptyMask) {
103
117
  this.maskedValue = '';
104
118
  }
105
119
  }
106
120
  setRangeText(replacement, start, end, _selectMode = 'preserve') {
107
- this.input.value = this.parser.replace(this.input.value, replacement, start, end).value;
108
- this.maskedValue = this.parser.apply(this.parser.parse(this.input.value));
109
- this._value = this.parser.parse(this.maskedValue);
110
- }
111
- reportValidity() {
112
- const state = this._value
113
- ? this.parser.isValidString(this.input.value)
114
- : this.input.reportValidity();
115
- this.invalid = !state;
116
- return state;
117
- }
118
- checkValidity() {
119
- if (this.disabled) {
120
- return this.input.checkValidity();
121
- }
122
- if (!this._value) {
123
- return !this.required;
124
- }
125
- return (this.input.checkValidity() && this.parser.isValidString(this.input.value));
121
+ const { value } = this.parser.replace(this.maskedValue || this.emptyMask, replacement, start, end);
122
+ this.maskedValue = this.parser.apply(this.parser.parse(value));
123
+ this.value = this.parser.parse(this.maskedValue);
126
124
  }
127
125
  renderInput() {
128
126
  var _a;
@@ -135,7 +133,6 @@ class IgcMaskInputComponent extends IgcMaskInputBaseComponent {
135
133
  .placeholder=${live((_a = this.placeholder) !== null && _a !== void 0 ? _a : this.parser.escapedMask)}
136
134
  ?readonly=${this.readonly}
137
135
  ?disabled=${this.disabled}
138
- ?required=${this.required}
139
136
  @dragenter=${this.handleDragEnter}
140
137
  @dragleave=${this.handleDragLeave}
141
138
  @dragstart=${this.handleDragStart}
@@ -147,8 +144,7 @@ class IgcMaskInputComponent extends IgcMaskInputBaseComponent {
147
144
  @compositionstart=${this.handleCompositionStart}
148
145
  @compositionend=${this.handleCompositionEnd}
149
146
  @input=${this.handleInput}
150
- aria-invalid="${this.invalid ? 'true' : 'false'}"
151
- @invalid="${this.handleInvalid}"
147
+ aria-invalid=${this.invalid ? 'true' : 'false'}
152
148
  @keydown=${this.handleKeydown}
153
149
  />
154
150
  `;
@@ -168,10 +164,5 @@ __decorate([
168
164
  __decorate([
169
165
  watch('prompt')
170
166
  ], IgcMaskInputComponent.prototype, "promptChange", null);
171
- __decorate([
172
- watch('required', { waitUntilFirstUpdate: true }),
173
- watch('disabled', { waitUntilFirstUpdate: true }),
174
- watch('value', { waitUntilFirstUpdate: true })
175
- ], IgcMaskInputComponent.prototype, "handleInvalidState", null);
176
167
  export default IgcMaskInputComponent;
177
168
  //# sourceMappingURL=mask-input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mask-input.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAA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CAAC,MAAA,IAAI,CAAC,WAAW,mCAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;oBACpD,IAAI,CAAC,QAAQ;oBACb,IAAI,CAAC,QAAQ;oBACb,IAAI,CAAC,QAAQ;qBACZ,IAAI,CAAC,eAAe;qBACpB,IAAI,CAAC,eAAe;qBACpB,IAAI,CAAC,eAAe;gBACzB,IAAI,CAAC,UAAU;iBACd,IAAI,CAAC,WAAW;eAClB,IAAI,CAAC,SAAS;kBACX,IAAI,CAAC,YAAY;iBAClB,IAAI,CAAC,WAAW;4BACL,IAAI,CAAC,sBAAsB;0BAC7B,IAAI,CAAC,oBAAoB;iBAClC,IAAI,CAAC,WAAW;wBACT,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;oBACnC,IAAI,CAAC,aAAa;mBACnB,IAAI,CAAC,aAAa;;KAEhC,CAAC;IACJ,CAAC;;AAxNsB,6BAAO,GAAG,gBAAgB,AAAnB,CAAoB;AAY3C;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;wDACa;AAUnD;IAFC,QAAQ,EAAE;IACV,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC;kDAOvC;AAYD;IADC,QAAQ,EAAE;iDAGV;AAYS;IADT,KAAK,CAAC,QAAQ,CAAC;yDAMf;AAKe;IAHf,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IACjD,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IACjD,KAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;+DAI9C;eApEkB,qBAAqB","sourcesContent":["import { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { blazorTwoWayBind } from '../common/decorators/blazorTwoWayBind.js';\nimport { partNameMap } from '../common/util.js';\nimport { IgcMaskInputBaseComponent, MaskRange } from './mask-input-base.js';\n\n/**\n * A masked input is an input field where a developer can control user input and format the visible value,\n * based on configurable rules\n *\n * @element igc-mask-input\n *\n * @slot prefix - Renders content before the input\n * @slot suffix - Renders content after the input\n * @slot helper-text - Renders content below the input\n *\n * @fires igcInput - Emitted when the control receives user input\n * @fires igcChange - Emitted when an alteration of the control's value is committed by the user\n * @fires igcFocus - Emitted when the control gains focus\n * @fires igcBlur - Emitted when the control loses focus\n *\n * @csspart container - The main wrapper that holds all main input elements\n * @csspart input - The native input element\n * @csspart label - The native label element\n * @csspart prefix - The prefix wrapper\n * @csspart suffix - The suffix wrapper\n * @csspart helper-text - The helper text wrapper\n */\nexport default class IgcMaskInputComponent extends IgcMaskInputBaseComponent {\n public static readonly tagName = 'igc-mask-input';\n\n protected _value = '';\n\n /**\n * Dictates the behavior when retrieving the value of the control:\n *\n * - `raw` will return the clean user input.\n * - `withFormatting` will return the value with all literals and prompts.\n * @attr value-mode\n */\n @property({ attribute: 'value-mode' })\n public valueMode: 'raw' | 'withFormatting' = 'raw';\n\n /**\n * The value of the input.\n *\n * Regardless of the currently set `value-mode`, an empty value will return an empty string.\n * @attr\n */\n @property()\n @blazorTwoWayBind('igcChange', 'detail')\n public get value() {\n return this._value\n ? this.valueMode !== 'raw'\n ? this.maskedValue\n : this._value\n : this._value;\n }\n\n public set value(string: string) {\n this._value = string ?? '';\n this.maskedValue = this.parser.apply(this._value);\n }\n\n /**\n * The mask pattern to apply on the input.\n * @attr\n */\n @property()\n public get mask() {\n return this._mask;\n }\n\n /** The mask pattern to apply on the input. */\n public set mask(value: string) {\n this._mask = value;\n this.parser.mask = value;\n if (this.value) {\n this.maskedValue = this.parser.apply(this._value);\n }\n }\n\n @watch('prompt')\n protected promptChange() {\n this.parser.prompt = this.prompt;\n if (this.value) {\n this.maskedValue = this.parser.apply(this._value);\n }\n }\n\n @watch('required', { waitUntilFirstUpdate: true })\n @watch('disabled', { waitUntilFirstUpdate: true })\n @watch('value', { waitUntilFirstUpdate: true })\n protected async handleInvalidState() {\n await this.updateComplete;\n this.invalid = !this.checkValidity();\n }\n\n protected async updateInput(string: string, range: MaskRange) {\n const { value, end } = this.parser.replace(\n this.maskedValue,\n string,\n range.start,\n range.end\n );\n\n this.maskedValue = value;\n this._value = this.parser.parse(value);\n\n this.requestUpdate();\n\n if (range.start !== this.mask.length) {\n this.emitEvent('igcInput', { detail: this.value });\n }\n await this.updateComplete;\n\n this.input.setSelectionRange(end, end);\n this.invalid = !this.checkValidity();\n }\n\n protected handleDragEnter() {\n if (!this.hasFocus && !this._value) {\n this.maskedValue = this.parser.apply();\n }\n }\n\n protected handleDragLeave() {\n if (!this.hasFocus) {\n this.updateMaskedValue();\n }\n }\n\n protected override async handleFocus() {\n this.hasFocus = true;\n super.handleFocus();\n\n if (this.readonly) {\n return;\n }\n\n if (!this._value) {\n // In case of empty value, select the whole mask\n this.maskedValue = this.parser.apply();\n\n await this.updateComplete;\n this.select();\n }\n }\n\n protected override handleBlur() {\n this.hasFocus = false;\n this.updateMaskedValue();\n super.handleBlur();\n }\n\n protected handleChange() {\n this.emitEvent('igcChange', { detail: this.value });\n this.invalid = !this.checkValidity();\n }\n\n protected handleClick() {\n // Clicking at the end of the input field will select the entire mask\n if (\n this.input.selectionStart === this.input.selectionEnd &&\n this.input.selectionStart === this.maskedValue.length\n ) {\n this.select();\n }\n }\n\n protected updateMaskedValue() {\n if (this.maskedValue === this.parser.apply()) {\n this.maskedValue = '';\n }\n }\n\n /* blazorSuppress */\n /** Replaces the selected text in the control and re-applies the mask */\n public override setRangeText(\n replacement: string,\n start: number,\n end: number,\n _selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n this.input.value = this.parser.replace(\n this.input.value,\n replacement,\n start,\n end\n ).value;\n this.maskedValue = this.parser.apply(this.parser.parse(this.input.value));\n this._value = this.parser.parse(this.maskedValue);\n }\n\n /** Checks for validity of the control and shows the browser message if it's invalid. */\n public reportValidity() {\n const state = this._value\n ? this.parser.isValidString(this.input.value)\n : this.input.reportValidity();\n this.invalid = !state;\n return state;\n }\n\n /** Check for validity of the control */\n public checkValidity() {\n if (this.disabled) {\n return this.input.checkValidity();\n }\n\n if (!this._value) {\n return !this.required;\n }\n\n return (\n this.input.checkValidity() && this.parser.isValidString(this.input.value)\n );\n }\n\n protected override renderInput() {\n return html`\n <input\n type=\"text\"\n part=${partNameMap(this.resolvePartNames('input'))}\n name=${ifDefined(this.name)}\n .value=${live(this.maskedValue)}\n .placeholder=${live(this.placeholder ?? this.parser.escapedMask)}\n ?readonly=${this.readonly}\n ?disabled=${this.disabled}\n ?required=${this.required}\n @dragenter=${this.handleDragEnter}\n @dragleave=${this.handleDragLeave}\n @dragstart=${this.handleDragStart}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @cut=${this.handleCut}\n @change=${this.handleChange}\n @click=${this.handleClick}\n @compositionstart=${this.handleCompositionStart}\n @compositionend=${this.handleCompositionEnd}\n @input=${this.handleInput}\n aria-invalid=\"${this.invalid ? 'true' : 'false'}\"\n @invalid=\"${this.handleInvalid}\"\n @keydown=${this.handleKeydown}\n />\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-mask-input': IgcMaskInputComponent;\n }\n}\n"]}
1
+ {"version":3,"file":"mask-input.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0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S;kBACX,IAAI,CAAC,YAAY;iBAClB,IAAI,CAAC,WAAW;4BACL,IAAI,CAAC,sBAAsB;0BAC7B,IAAI,CAAC,oBAAoB;iBAClC,IAAI,CAAC,WAAW;uBACV,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;mBACnC,IAAI,CAAC,aAAa;;KAEhC,CAAC;IACJ,CAAC;;AAtMsB,6BAAO,GAAG,gBAAgB,AAAnB,CAAoB;AAwB3C;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;wDACa;AAUnD;IAFC,QAAQ,EAAE;IACV,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC;kDAGvC;AAaD;IADC,QAAQ,EAAE;iDAGV;AA6BS;IADT,KAAK,CAAC,QAAQ,CAAC;yDAMf;eAtFkB,qBAAqB","sourcesContent":["import { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { blazorTwoWayBind } from '../common/decorators/blazorTwoWayBind.js';\nimport { partNameMap } from '../common/util.js';\nimport { IgcMaskInputBaseComponent, MaskRange } from './mask-input-base.js';\nimport messages from '../common/localization/validation-en.js';\nimport { Validator, requiredValidator } from '../common/validators.js';\n\n/**\n * A masked input is an input field where a developer can control user input and format the visible value,\n * based on configurable rules\n *\n * @element igc-mask-input\n *\n * @slot prefix - Renders content before the input\n * @slot suffix - Renders content after the input\n * @slot helper-text - Renders content below the input\n *\n * @fires igcInput - Emitted when the control receives user input\n * @fires igcChange - Emitted when an alteration of the control's value is committed by the user\n * @fires igcFocus - Emitted when the control gains focus\n * @fires igcBlur - Emitted when the control loses focus\n *\n * @csspart container - The main wrapper that holds all main input elements\n * @csspart input - The native input element\n * @csspart label - The native label element\n * @csspart prefix - The prefix wrapper\n * @csspart suffix - The suffix wrapper\n * @csspart helper-text - The helper text wrapper\n */\nexport default class IgcMaskInputComponent extends IgcMaskInputBaseComponent {\n public static readonly tagName = 'igc-mask-input';\n\n protected override validators: Validator<this>[] = [\n {\n ...requiredValidator,\n isValid: () => (this.required ? !!this._value : true),\n },\n {\n key: 'badInput',\n message: messages.mask,\n isValid: () => this.parser.isValidString(this.maskedValue),\n },\n ];\n\n protected _value = '';\n\n /**\n * Dictates the behavior when retrieving the value of the control:\n *\n * - `raw` will return the clean user input.\n * - `withFormatting` will return the value with all literals and prompts.\n * @attr value-mode\n */\n @property({ attribute: 'value-mode' })\n public valueMode: 'raw' | 'withFormatting' = 'raw';\n\n /**\n * The value of the input.\n *\n * Regardless of the currently set `value-mode`, an empty value will return an empty string.\n * @attr\n */\n @property()\n @blazorTwoWayBind('igcChange', 'detail')\n public get value() {\n return this.valueMode !== 'raw' ? this.maskedValue : this._value;\n }\n\n public set value(string: string) {\n this._value = string ?? '';\n this.maskedValue = this.parser.apply(this._value);\n this.updateFormValue();\n }\n\n /**\n * The mask pattern to apply on the input.\n * @attr\n */\n @property()\n public get mask() {\n return this._mask;\n }\n\n /** The mask pattern to apply on the input. */\n public set mask(value: string) {\n this._mask = value;\n this.parser.mask = value;\n if (this.value) {\n this.maskedValue = this.parser.apply(this._value);\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.updateValidity();\n }\n\n protected override setDefaultValue(): void {\n this._defaultValue = this._value;\n }\n\n protected updateFormValue() {\n this.valueMode === 'raw'\n ? this.setFormValue(this.value || null, this.value)\n : this.setFormValue(this.maskedValue || null, this.maskedValue);\n this.updateValidity();\n this.setInvalidState();\n }\n\n @watch('prompt')\n protected promptChange() {\n this.parser.prompt = this.prompt;\n if (this.value) {\n this.maskedValue = this.parser.apply(this._value);\n }\n }\n\n protected async updateInput(string: string, range: MaskRange) {\n const { value, end } = this.parser.replace(\n this.maskedValue,\n string,\n range.start,\n range.end\n );\n\n this.maskedValue = value;\n this._value = this.parser.parse(value);\n\n this.updateFormValue();\n this.requestUpdate();\n\n if (range.start !== this.mask.length) {\n this.emitEvent('igcInput', { detail: this.value });\n }\n await this.updateComplete;\n\n this.input.setSelectionRange(end, end);\n }\n\n protected handleDragEnter() {\n if (!this.focused && !this._value) {\n this.maskedValue = this.emptyMask;\n }\n }\n\n protected handleDragLeave() {\n if (!this.focused) {\n this.updateMaskedValue();\n }\n }\n\n protected override async handleFocus() {\n this.focused = true;\n super.handleFocus();\n\n if (this.readonly) {\n return;\n }\n\n if (!this._value) {\n // In case of empty value, select the whole mask\n this.maskedValue = this.emptyMask;\n\n await this.updateComplete;\n this.select();\n }\n }\n\n protected override handleBlur() {\n this.focused = false;\n this.updateMaskedValue();\n this.invalid = !this.checkValidity();\n super.handleBlur();\n }\n\n protected handleChange() {\n this.emitEvent('igcChange', { detail: this.value });\n }\n\n protected updateMaskedValue() {\n if (this.maskedValue === this.emptyMask) {\n this.maskedValue = '';\n }\n }\n\n /* blazorSuppress */\n /** Replaces the selected text in the control and re-applies the mask */\n public override setRangeText(\n replacement: string,\n start: number,\n end: number,\n _selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n const { value } = this.parser.replace(\n this.maskedValue || this.emptyMask,\n replacement,\n start,\n end\n );\n this.maskedValue = this.parser.apply(this.parser.parse(value));\n this.value = this.parser.parse(this.maskedValue);\n }\n\n protected override renderInput() {\n return html`\n <input\n type=\"text\"\n part=${partNameMap(this.resolvePartNames('input'))}\n name=${ifDefined(this.name)}\n .value=${live(this.maskedValue)}\n .placeholder=${live(this.placeholder ?? this.parser.escapedMask)}\n ?readonly=${this.readonly}\n ?disabled=${this.disabled}\n @dragenter=${this.handleDragEnter}\n @dragleave=${this.handleDragLeave}\n @dragstart=${this.handleDragStart}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @cut=${this.handleCut}\n @change=${this.handleChange}\n @click=${this.handleClick}\n @compositionstart=${this.handleCompositionStart}\n @compositionend=${this.handleCompositionEnd}\n @input=${this.handleInput}\n aria-invalid=${this.invalid ? 'true' : 'false'}\n @keydown=${this.handleKeydown}\n />\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-mask-input': IgcMaskInputComponent;\n }\n}\n"]}
@@ -28,6 +28,7 @@ const replaceIMENumbers = (string) => {
28
28
  export class MaskParser {
29
29
  constructor(options = { format: 'CCCCCCCCCC', promptCharacter: '_' }) {
30
30
  this.literals = new Map();
31
+ this._escapedMask = '';
31
32
  this.options = options;
32
33
  }
33
34
  get literalPositions() {
@@ -1 +1 @@
1
- {"version":3,"file":"mask-parser.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-parser.ts"],"names":[],"mappings":"AAKA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;AACnC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC;IACpB,CAAC,GAAG,EAAE,SAAS,CAAC;IAChB,CAAC,GAAG,EAAE,mBAAmB,CAAC;IAC1B,CAAC,GAAG,EAAE,8BAA8B,CAAC;IACrC,CAAC,GAAG,EAAE,iBAAiB,CAAC;IACxB,CAAC,GAAG,EAAE,4BAA4B,CAAC;IACnC,CAAC,GAAG,EAAE,aAAa,CAAC;IACpB,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,oBAAoB,CAAC;IAC3B,CAAC,GAAG,EAAE,SAAS,CAAC;CACjB,CAAC,CAAC;AACH,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;AAElC,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC3C,OAAO,MAAM,CAAC,OAAO,CACnB,eAAe,EACf,CAAC,GAAG,EAAE,EAAE,CACN,CAAC;QACC,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,GAAG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AG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;SACvE;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["interface MaskOptions {\n format: string;\n promptCharacter: string;\n}\n\nconst FLAGS = new Set('aACL09#&?');\nconst REGEX = new Map([\n ['C', /(?!^$)/u], // Non-empty\n ['&', /[^\\p{Separator}]/u], // Whitespace\n ['a', /[\\p{Letter}\\d\\p{Separator}]/u], // Alphanumeric & whitespace\n ['A', /[\\p{Letter}\\d]/u], // Alphanumeric\n ['?', /[\\p{Letter}\\p{Separator}]/u], // Alpha & whitespace\n ['L', /\\p{Letter}/u], // Alpha\n ['0', /\\d/], // Numeric\n ['9', /[\\d\\p{Separator}]/u], // Numeric & whitespace\n ['#', /[\\d\\-+]/], // Numeric and sign\n]);\nconst REQUIRED = new Set('0#LA&');\n\nconst replaceIMENumbers = (string: string) => {\n return string.replace(\n /[0123456789]/g,\n (num) =>\n ({\n '1': '1',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9',\n '0': '0',\n })[num] as string\n );\n};\n\nexport class MaskParser {\n protected options!: MaskOptions;\n\n constructor(\n options: MaskOptions = { format: 'CCCCCCCCCC', promptCharacter: '_' }\n ) {\n this.options = options;\n }\n\n protected literals = new Map<number, string>();\n protected _escapedMask!: string;\n\n public get literalPositions() {\n this.getMaskLiterals();\n return Array.from(this.literals.keys());\n }\n\n public get escapedMask() {\n this.getMaskLiterals();\n return this._escapedMask;\n }\n\n public get mask() {\n return this.options.format;\n }\n\n public set mask(value: string) {\n this.options.format = value || this.options.format;\n this.getMaskLiterals();\n }\n\n public get prompt() {\n return this.options.promptCharacter;\n }\n\n public set prompt(value: string) {\n this.options.promptCharacter = value\n ? value.substring(0, 1)\n : this.options.promptCharacter;\n }\n\n protected getMaskLiterals() {\n this.literals.clear();\n this._escapedMask = this.mask;\n\n for (let i = 0, j = 0; i < this.mask.length; i++, j++) {\n const [current, next] = [this.mask.charAt(i), this.mask.charAt(i + 1)];\n\n if (current === '\\\\' && FLAGS.has(next)) {\n this._escapedMask = this.replaceCharAt(this._escapedMask, j, '');\n this.literals.set(j, next);\n i++;\n } else {\n if (!FLAGS.has(current)) {\n this.literals.set(j, current);\n }\n }\n }\n }\n\n protected isPromptChar(char: string) {\n return char === this.prompt;\n }\n\n protected replaceCharAt(string: string, pos: number, char: string) {\n return `${string.substring(0, pos)}${char}${string.substring(pos + 1)}`;\n }\n\n protected validate(char: string, maskedChar: string) {\n const regex = REGEX.get(maskedChar);\n return regex ? regex.test(char) : false;\n }\n\n protected getNonLiteralPositions(mask = '') {\n const positions = this.literalPositions;\n return Array.from(mask)\n .map((_, pos) => (!positions.includes(pos) ? pos : -1))\n .filter((pos) => pos > -1);\n }\n\n protected getRequiredNonLiteralPositions(mask: string) {\n const positions = this.literalPositions;\n return Array.from(mask)\n .map((char, pos) =>\n REQUIRED.has(char) && !positions.includes(pos) ? pos : -1\n )\n .filter((pos) => pos > -1);\n }\n\n public getPreviousNonLiteralPosition(start: number) {\n const positions = this.literalPositions;\n for (let i = start; i > 0; i--) {\n if (!positions.includes(i)) return i;\n }\n return start;\n }\n\n public getNextNonLiteralPosition(start: number) {\n const positions = this.literalPositions;\n for (let i = start; i < this._escapedMask.length; i++) {\n if (!positions.includes(i)) return i;\n }\n return start;\n }\n\n public replace(masked = '', value: string, start: number, end: number) {\n const chars = Array.from(replaceIMENumbers(value));\n const positions = this.literalPositions;\n end = Math.min(end, masked.length);\n let cursor = start;\n\n for (let i = start; i < end || (chars.length && i < masked.length); i++) {\n if (positions.includes(i)) {\n if (chars[0] === masked[i]) {\n cursor = i + 1;\n chars.shift();\n }\n continue;\n }\n\n if (\n chars[0] &&\n !this.validate(chars[0], this._escapedMask[i]) &&\n !this.isPromptChar(chars[0])\n ) {\n break;\n }\n\n let char = this.prompt;\n if (chars.length) {\n cursor = i + 1;\n char = chars.shift() as string;\n }\n masked = this.replaceCharAt(masked, i, char);\n }\n\n return { value: masked, end: cursor };\n }\n\n public parse(masked = '') {\n return Array.from(masked).reduce((prev, char, pos) => {\n return `${prev}${\n !this.literalPositions.includes(pos) && !this.isPromptChar(char)\n ? char\n : ''\n }`;\n }, '');\n }\n\n public isValidString(input = '') {\n const required = this.getRequiredNonLiteralPositions(this._escapedMask);\n\n if (required.length > this.parse(input).length) {\n return false;\n }\n return required.every((pos) => {\n const char = input.charAt(pos);\n return (\n char !== undefined &&\n this.validate(char, this._escapedMask.charAt(pos)) &&\n !this.isPromptChar(char)\n );\n });\n }\n\n public apply(input = '') {\n const nonLiteralPositions = this.getNonLiteralPositions(this._escapedMask);\n let output = new Array(this._escapedMask.length).fill(this.prompt).join('');\n\n this.literals.forEach((char, pos) => {\n output = this.replaceCharAt(output, pos, char);\n });\n\n if (!input) {\n return output;\n }\n\n const values = nonLiteralPositions.map((pos, index) => {\n const char = input.charAt(index);\n return !this.validate(char, this._escapedMask.charAt(pos)) &&\n !this.isPromptChar(char)\n ? this.prompt\n : char;\n });\n\n if (values.length > nonLiteralPositions.length) {\n values.splice(nonLiteralPositions.length);\n }\n\n let pos = 0;\n for (const each of values) {\n output = this.replaceCharAt(output, nonLiteralPositions[pos++], each);\n }\n\n return output;\n }\n}\n"]}
1
+ {"version":3,"file":"mask-parser.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-parser.ts"],"names":[],"mappings":"AAKA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;AACnC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC;IACpB,CAAC,GAAG,EAAE,SAAS,CAAC;IAChB,CAAC,GAAG,EAAE,mBAAmB,CAAC;IAC1B,CAAC,GAAG,EAAE,8BAA8B,CAAC;IACrC,CAAC,GAAG,EAAE,iBAAiB,CAAC;IACxB,CAAC,GAAG,EAAE,4BAA4B,CAAC;IACnC,CAAC,GAAG,EAAE,a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,EAAE;YACpD,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACxD,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;gBACxB,CAAC,CAAC,IAAI,CAAC,MAAM;gBACb,CAAC,CAAC,IAAI,CAAC;QACX,CAAC,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,EAAE;YAC9C,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;SAC3C;QAED,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE;YACzB,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;SACvE;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["interface MaskOptions {\n format: string;\n promptCharacter: string;\n}\n\nconst FLAGS = new Set('aACL09#&?');\nconst REGEX = new Map([\n ['C', /(?!^$)/u], // Non-empty\n ['&', /[^\\p{Separator}]/u], // Whitespace\n ['a', /[\\p{Letter}\\d\\p{Separator}]/u], // Alphanumeric & whitespace\n ['A', /[\\p{Letter}\\d]/u], // Alphanumeric\n ['?', /[\\p{Letter}\\p{Separator}]/u], // Alpha & whitespace\n ['L', /\\p{Letter}/u], // Alpha\n ['0', /\\d/], // Numeric\n ['9', /[\\d\\p{Separator}]/u], // Numeric & whitespace\n ['#', /[\\d\\-+]/], // Numeric and sign\n]);\nconst REQUIRED = new Set('0#LA&');\n\nconst replaceIMENumbers = (string: string) => {\n return string.replace(\n /[0123456789]/g,\n (num) =>\n ({\n '1': '1',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9',\n '0': '0',\n })[num] as string\n );\n};\n\nexport class MaskParser {\n protected options!: MaskOptions;\n\n constructor(\n options: MaskOptions = { format: 'CCCCCCCCCC', promptCharacter: '_' }\n ) {\n this.options = options;\n }\n\n protected literals = new Map<number, string>();\n protected _escapedMask = '';\n\n public get literalPositions() {\n this.getMaskLiterals();\n return Array.from(this.literals.keys());\n }\n\n public get escapedMask() {\n this.getMaskLiterals();\n return this._escapedMask;\n }\n\n public get mask() {\n return this.options.format;\n }\n\n public set mask(value: string) {\n this.options.format = value || this.options.format;\n this.getMaskLiterals();\n }\n\n public get prompt() {\n return this.options.promptCharacter;\n }\n\n public set prompt(value: string) {\n this.options.promptCharacter = value\n ? value.substring(0, 1)\n : this.options.promptCharacter;\n }\n\n protected getMaskLiterals() {\n this.literals.clear();\n this._escapedMask = this.mask;\n\n for (let i = 0, j = 0; i < this.mask.length; i++, j++) {\n const [current, next] = [this.mask.charAt(i), this.mask.charAt(i + 1)];\n\n if (current === '\\\\' && FLAGS.has(next)) {\n this._escapedMask = this.replaceCharAt(this._escapedMask, j, '');\n this.literals.set(j, next);\n i++;\n } else {\n if (!FLAGS.has(current)) {\n this.literals.set(j, current);\n }\n }\n }\n }\n\n protected isPromptChar(char: string) {\n return char === this.prompt;\n }\n\n protected replaceCharAt(string: string, pos: number, char: string) {\n return `${string.substring(0, pos)}${char}${string.substring(pos + 1)}`;\n }\n\n protected validate(char: string, maskedChar: string) {\n const regex = REGEX.get(maskedChar);\n return regex ? regex.test(char) : false;\n }\n\n protected getNonLiteralPositions(mask = '') {\n const positions = this.literalPositions;\n return Array.from(mask)\n .map((_, pos) => (!positions.includes(pos) ? pos : -1))\n .filter((pos) => pos > -1);\n }\n\n protected getRequiredNonLiteralPositions(mask: string) {\n const positions = this.literalPositions;\n return Array.from(mask)\n .map((char, pos) =>\n REQUIRED.has(char) && !positions.includes(pos) ? pos : -1\n )\n .filter((pos) => pos > -1);\n }\n\n public getPreviousNonLiteralPosition(start: number) {\n const positions = this.literalPositions;\n for (let i = start; i > 0; i--) {\n if (!positions.includes(i)) return i;\n }\n return start;\n }\n\n public getNextNonLiteralPosition(start: number) {\n const positions = this.literalPositions;\n for (let i = start; i < this._escapedMask.length; i++) {\n if (!positions.includes(i)) return i;\n }\n return start;\n }\n\n public replace(masked = '', value: string, start: number, end: number) {\n const chars = Array.from(replaceIMENumbers(value));\n const positions = this.literalPositions;\n end = Math.min(end, masked.length);\n let cursor = start;\n\n for (let i = start; i < end || (chars.length && i < masked.length); i++) {\n if (positions.includes(i)) {\n if (chars[0] === masked[i]) {\n cursor = i + 1;\n chars.shift();\n }\n continue;\n }\n\n if (\n chars[0] &&\n !this.validate(chars[0], this._escapedMask[i]) &&\n !this.isPromptChar(chars[0])\n ) {\n break;\n }\n\n let char = this.prompt;\n if (chars.length) {\n cursor = i + 1;\n char = chars.shift() as string;\n }\n masked = this.replaceCharAt(masked, i, char);\n }\n\n return { value: masked, end: cursor };\n }\n\n public parse(masked = '') {\n return Array.from(masked).reduce((prev, char, pos) => {\n return `${prev}${\n !this.literalPositions.includes(pos) && !this.isPromptChar(char)\n ? char\n : ''\n }`;\n }, '');\n }\n\n public isValidString(input = '') {\n const required = this.getRequiredNonLiteralPositions(this._escapedMask);\n\n if (required.length > this.parse(input).length) {\n return false;\n }\n return required.every((pos) => {\n const char = input.charAt(pos);\n return (\n char !== undefined &&\n this.validate(char, this._escapedMask.charAt(pos)) &&\n !this.isPromptChar(char)\n );\n });\n }\n\n public apply(input = '') {\n const nonLiteralPositions = this.getNonLiteralPositions(this._escapedMask);\n let output = new Array(this._escapedMask.length).fill(this.prompt).join('');\n\n this.literals.forEach((char, pos) => {\n output = this.replaceCharAt(output, pos, char);\n });\n\n if (!input) {\n return output;\n }\n\n const values = nonLiteralPositions.map((pos, index) => {\n const char = input.charAt(index);\n return !this.validate(char, this._escapedMask.charAt(pos)) &&\n !this.isPromptChar(char)\n ? this.prompt\n : char;\n });\n\n if (values.length > nonLiteralPositions.length) {\n values.splice(nonLiteralPositions.length);\n }\n\n let pos = 0;\n for (const each of values) {\n output = this.replaceCharAt(output, nonLiteralPositions[pos++], each);\n }\n\n return output;\n }\n}\n"]}
@@ -6,9 +6,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html, LitElement } from 'lit';
8
8
  import { themes } from '../../theming/theming-decorator.js';
9
- import { styles as fluent } from './themes/light/fluent/nav-drawer-header-item.fluent.css.js';
10
- import { styles as indigo } from './themes/light/indigo/nav-drawer-header-item.indigo.css.js';
11
- import { styles } from './themes/light/nav-drawer-header-item.base.css.js';
9
+ import { styles as fluent } from './themes/light/header-item/nav-drawer-header-item.fluent.css.js';
10
+ import { styles as indigo } from './themes/light/header-item/nav-drawer-header-item.indigo.css.js';
11
+ import { styles as bootstrap } from './themes/light/header-item/nav-drawer-header-item.indigo.css.js';
12
+ import { styles as material } from './themes/light/header-item/nav-drawer-header-item.indigo.css.js';
13
+ import { styles } from './themes/light/header-item/nav-drawer-header-item.base.css.js';
12
14
  let IgcNavDrawerHeaderItemComponent = class IgcNavDrawerHeaderItemComponent extends LitElement {
13
15
  render() {
14
16
  return html `<slot></slot>`;
@@ -17,7 +19,7 @@ let IgcNavDrawerHeaderItemComponent = class IgcNavDrawerHeaderItemComponent exte
17
19
  IgcNavDrawerHeaderItemComponent.tagName = 'igc-nav-drawer-header-item';
18
20
  IgcNavDrawerHeaderItemComponent.styles = styles;
19
21
  IgcNavDrawerHeaderItemComponent = __decorate([
20
- themes({ fluent, indigo })
22
+ themes({ fluent, indigo, bootstrap, material })
21
23
  ], IgcNavDrawerHeaderItemComponent);
22
24
  export default IgcNavDrawerHeaderItemComponent;
23
25
  //# sourceMappingURL=nav-drawer-header-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nav-drawer-header-item.js","sourceRoot":"","sources":["../../../src/components/nav-drawer/nav-drawer-header-item.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,4DAA4D,CAAC;AAC9F,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,4DAA4D,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,mDAAmD,CAAC;AAS3E,IAAqB,+BAA+B,GAApD,MAAqB,+BAAgC,SAAQ,UAAU;IAIlD,MAAM;QACvB,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AALsB,uCAAO,GAAG,4BAA4B,AAA/B,CAAgC;AACvC,sCAAM,GAAG,MAAM,AAAT,CAAU;AAFpB,+BAA+B;IADnD,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;GACN,+BAA+B,CAOnD;eAPoB,+BAA+B","sourcesContent":["import { html, LitElement } from 'lit';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { styles as fluent } from './themes/light/fluent/nav-drawer-header-item.fluent.css.js';\nimport { styles as indigo } from './themes/light/indigo/nav-drawer-header-item.indigo.css.js';\nimport { styles } from './themes/light/nav-drawer-header-item.base.css.js';\n\n/**\n * A wrapper for navigation drawer's header.\n * @element igc-nav-drawer-header-item\n *\n * @slot - Renders the header content\n */\n@themes({ fluent, indigo })\nexport default class IgcNavDrawerHeaderItemComponent extends LitElement {\n public static readonly tagName = 'igc-nav-drawer-header-item';\n public static override styles = styles;\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-nav-drawer-header-item': IgcNavDrawerHeaderItemComponent;\n }\n}\n"]}
1
+ {"version":3,"file":"nav-drawer-header-item.js","sourceRoot":"","sources":["../../../src/components/nav-drawer/nav-drawer-header-item.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,iEAAiE,CAAC;AACnG,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,iEAAiE,CAAC;AACnG,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,iEAAiE,CAAC;AACtG,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,iEAAiE,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,+DAA+D,CAAC;AASvF,IAAqB,+BAA+B,GAApD,MAAqB,+BAAgC,SAAQ,UAAU;IAIlD,MAAM;QACvB,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AALsB,uCAAO,GAAG,4BAA4B,AAA/B,CAAgC;AACvC,sCAAM,GAAG,MAAM,AAAT,CAAU;AAFpB,+BAA+B;IADnD,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;GAC3B,+BAA+B,CAOnD;eAPoB,+BAA+B","sourcesContent":["import { html, LitElement } from 'lit';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { styles as fluent } from './themes/light/header-item/nav-drawer-header-item.fluent.css.js';\nimport { styles as indigo } from './themes/light/header-item/nav-drawer-header-item.indigo.css.js';\nimport { styles as bootstrap } from './themes/light/header-item/nav-drawer-header-item.indigo.css.js';\nimport { styles as material } from './themes/light/header-item/nav-drawer-header-item.indigo.css.js';\nimport { styles } from './themes/light/header-item/nav-drawer-header-item.base.css.js';\n\n/**\n * A wrapper for navigation drawer's header.\n * @element igc-nav-drawer-header-item\n *\n * @slot - Renders the header content\n */\n@themes({ fluent, indigo, bootstrap, material })\nexport default class IgcNavDrawerHeaderItemComponent extends LitElement {\n public static readonly tagName = 'igc-nav-drawer-header-item';\n public static override styles = styles;\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-nav-drawer-header-item': IgcNavDrawerHeaderItemComponent;\n }\n}\n"]}
@@ -8,9 +8,11 @@ import { html, LitElement } from 'lit';
8
8
  import { property, queryAssignedElements, queryAssignedNodes, state, } from 'lit/decorators.js';
9
9
  import { themes } from '../../theming/theming-decorator.js';
10
10
  import { partNameMap } from '../common/util.js';
11
- import { styles as fluent } from './themes/light/fluent/nav-drawer-item.fluent.css.js';
12
- import { styles as indigo } from './themes/light/indigo/nav-drawer-item.indigo.css.js';
13
- import { styles } from './themes/light/nav-drawer-item.base.css.js';
11
+ import { styles } from './themes/light/item/nav-drawer-item.base.css.js';
12
+ import { styles as fluent } from './themes/light/item/nav-drawer-item.fluent.css.js';
13
+ import { styles as indigo } from './themes/light/item/nav-drawer-item.indigo.css.js';
14
+ import { styles as bootstrap } from './themes/light/item/nav-drawer-item.bootstrap.css.js';
15
+ import { styles as material } from './themes/light/item/nav-drawer-item.material.css.js';
14
16
  let IgcNavDrawerItemComponent = class IgcNavDrawerItemComponent extends LitElement {
15
17
  constructor() {
16
18
  super(...arguments);
@@ -61,7 +63,7 @@ __decorate([
61
63
  queryAssignedNodes({ slot: 'icon', flatten: true })
62
64
  ], IgcNavDrawerItemComponent.prototype, "navdrawerIcon", void 0);
63
65
  IgcNavDrawerItemComponent = __decorate([
64
- themes({ fluent, indigo })
66
+ themes({ fluent, indigo, bootstrap, material })
65
67
  ], IgcNavDrawerItemComponent);
66
68
  export default IgcNavDrawerItemComponent;
67
69
  //# sourceMappingURL=nav-drawer-item.js.map