igniteui-webcomponents 4.3.1 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/CHANGELOG.md +49 -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 +5 -2
  15. package/components/avatar/avatar.js.map +1 -1
  16. package/components/avatar/themes/{light/avatar.base.css.js → avatar.base.css.js} +2 -20
  17. package/components/avatar/themes/avatar.base.css.js.map +1 -0
  18. package/components/avatar/themes/dark/{avatar.base.bootstrap.css.js → 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.fluent.css.d.ts +1 -0
  21. package/components/avatar/themes/dark/avatar.fluent.css.js +3 -0
  22. package/components/avatar/themes/dark/avatar.fluent.css.js.map +1 -0
  23. package/components/avatar/themes/dark/avatar.indigo.css.d.ts +1 -0
  24. package/components/avatar/themes/dark/avatar.indigo.css.js +3 -0
  25. package/components/avatar/themes/dark/avatar.indigo.css.js.map +1 -0
  26. package/components/avatar/themes/dark/avatar.material.css.d.ts +1 -0
  27. package/components/avatar/themes/dark/avatar.material.css.js +3 -0
  28. package/components/avatar/themes/dark/avatar.material.css.js.map +1 -0
  29. package/components/avatar/themes/light/avatar.bootstrap.css.js +17 -3
  30. package/components/avatar/themes/light/avatar.bootstrap.css.js.map +1 -1
  31. package/components/avatar/themes/light/avatar.fluent.css.d.ts +1 -0
  32. package/components/avatar/themes/light/avatar.fluent.css.js +27 -0
  33. package/components/avatar/themes/light/avatar.fluent.css.js.map +1 -0
  34. package/components/avatar/themes/light/avatar.indigo.css.d.ts +1 -0
  35. package/components/avatar/themes/light/avatar.indigo.css.js +27 -0
  36. package/components/avatar/themes/light/avatar.indigo.css.js.map +1 -0
  37. package/components/avatar/themes/light/avatar.material.css.d.ts +1 -0
  38. package/components/avatar/themes/light/avatar.material.css.js +27 -0
  39. package/components/avatar/themes/light/avatar.material.css.js.map +1 -0
  40. package/components/button/button-base.d.ts +14 -6
  41. package/components/button/button-base.js +51 -18
  42. package/components/button/button-base.js.map +1 -1
  43. package/components/button/themes/button/light/button.base.css.js +4 -4
  44. package/components/button/themes/button/light/button.base.css.js.map +1 -1
  45. package/components/button/themes/button/light/button.bootstrap.css.js +64 -32
  46. package/components/button/themes/button/light/button.bootstrap.css.js.map +1 -1
  47. package/components/button/themes/button/light/button.fluent.css.js +75 -40
  48. package/components/button/themes/button/light/button.fluent.css.js.map +1 -1
  49. package/components/button/themes/button/light/button.indigo.css.js +86 -42
  50. package/components/button/themes/button/light/button.indigo.css.js.map +1 -1
  51. package/components/button/themes/button/light/button.material.css.js +88 -38
  52. package/components/button/themes/button/light/button.material.css.js.map +1 -1
  53. package/components/button/themes/icon-button/light/icon-button.base.css.js +2 -1
  54. package/components/button/themes/icon-button/light/icon-button.base.css.js.map +1 -1
  55. package/components/button/themes/icon-button/light/icon-button.bootstrap.css.js +12 -7
  56. package/components/button/themes/icon-button/light/icon-button.bootstrap.css.js.map +1 -1
  57. package/components/button/themes/icon-button/light/icon-button.fluent.css.js +4 -3
  58. package/components/button/themes/icon-button/light/icon-button.fluent.css.js.map +1 -1
  59. package/components/button/themes/icon-button/light/icon-button.indigo.css.js +6 -4
  60. package/components/button/themes/icon-button/light/icon-button.indigo.css.js.map +1 -1
  61. package/components/button/themes/icon-button/light/icon-button.material.css.js +7 -4
  62. package/components/button/themes/icon-button/light/icon-button.material.css.js.map +1 -1
  63. package/components/calendar/themes/bootstrap/days-view.bootstrap.css.js +2 -2
  64. package/components/calendar/themes/bootstrap/days-view.bootstrap.css.js.map +1 -1
  65. package/components/calendar/themes/bootstrap/year-month-view.bootstrap.css.js +2 -2
  66. package/components/calendar/themes/bootstrap/year-month-view.bootstrap.css.js.map +1 -1
  67. package/components/calendar/themes/calendar.base.css.js +1 -0
  68. package/components/calendar/themes/calendar.base.css.js.map +1 -1
  69. package/components/calendar/themes/fluent/calendar.fluent.css.js +2 -1
  70. package/components/calendar/themes/fluent/calendar.fluent.css.js.map +1 -1
  71. package/components/checkbox/checkbox-base.d.ts +8 -35
  72. package/components/checkbox/checkbox-base.js +28 -41
  73. package/components/checkbox/checkbox-base.js.map +1 -1
  74. package/components/checkbox/checkbox.d.ts +0 -1
  75. package/components/checkbox/checkbox.js +5 -16
  76. package/components/checkbox/checkbox.js.map +1 -1
  77. package/components/checkbox/switch.d.ts +0 -2
  78. package/components/checkbox/switch.js +4 -16
  79. package/components/checkbox/switch.js.map +1 -1
  80. package/components/checkbox/themes/light/checkbox.base.css.js +2 -1
  81. package/components/checkbox/themes/light/checkbox.base.css.js.map +1 -1
  82. package/components/checkbox/themes/light/checkbox.bootstrap.css.js +26 -9
  83. package/components/checkbox/themes/light/checkbox.bootstrap.css.js.map +1 -1
  84. package/components/checkbox/themes/light/checkbox.fluent.css.js +31 -15
  85. package/components/checkbox/themes/light/checkbox.fluent.css.js.map +1 -1
  86. package/components/checkbox/themes/light/checkbox.indigo.css.js +31 -13
  87. package/components/checkbox/themes/light/checkbox.indigo.css.js.map +1 -1
  88. package/components/checkbox/themes/light/checkbox.material.css.js +24 -12
  89. package/components/checkbox/themes/light/checkbox.material.css.js.map +1 -1
  90. package/components/checkbox/themes/light/switch.base.css.js +2 -1
  91. package/components/checkbox/themes/light/switch.base.css.js.map +1 -1
  92. package/components/checkbox/themes/light/switch.bootstrap.css.js +12 -4
  93. package/components/checkbox/themes/light/switch.bootstrap.css.js.map +1 -1
  94. package/components/checkbox/themes/light/switch.fluent.css.js +33 -15
  95. package/components/checkbox/themes/light/switch.fluent.css.js.map +1 -1
  96. package/components/checkbox/themes/light/switch.indigo.css.js +26 -11
  97. package/components/checkbox/themes/light/switch.indigo.css.js.map +1 -1
  98. package/components/checkbox/themes/light/switch.material.css.js +14 -7
  99. package/components/checkbox/themes/light/switch.material.css.js.map +1 -1
  100. package/components/chip/themes/chip.base.css.js +0 -2
  101. package/components/chip/themes/chip.base.css.js.map +1 -1
  102. package/components/chip/themes/chip.bootstrap.css.js +2 -2
  103. package/components/chip/themes/chip.bootstrap.css.js.map +1 -1
  104. package/components/chip/themes/chip.fluent.css.js +2 -2
  105. package/components/chip/themes/chip.fluent.css.js.map +1 -1
  106. package/components/chip/themes/chip.indigo.css.js +2 -2
  107. package/components/chip/themes/chip.indigo.css.js.map +1 -1
  108. package/components/chip/themes/chip.material.css.js +2 -2
  109. package/components/chip/themes/chip.material.css.js.map +1 -1
  110. package/components/combo/combo.d.ts +7 -32
  111. package/components/combo/combo.js +57 -49
  112. package/components/combo/combo.js.map +1 -1
  113. package/components/combo/controllers/selection.js +1 -3
  114. package/components/combo/controllers/selection.js.map +1 -1
  115. package/components/combo/themes/light/combo.bootstrap.css.js +27 -24
  116. package/components/combo/themes/light/combo.bootstrap.css.js.map +1 -1
  117. package/components/combo/themes/light/combo.fluent.css.js +27 -24
  118. package/components/combo/themes/light/combo.fluent.css.js.map +1 -1
  119. package/components/combo/themes/light/combo.indigo.css.js +26 -23
  120. package/components/combo/themes/light/combo.indigo.css.js.map +1 -1
  121. package/components/combo/themes/light/combo.material.css.js +32 -23
  122. package/components/combo/themes/light/combo.material.css.js.map +1 -1
  123. package/components/combo/themes/light/item/combo-item.base.css.js +0 -1
  124. package/components/combo/themes/light/item/combo-item.base.css.js.map +1 -1
  125. package/components/common/localization/validation-en.d.ts +10 -0
  126. package/components/common/localization/validation-en.js +10 -0
  127. package/components/common/localization/validation-en.js.map +1 -0
  128. package/components/common/mixins/form-associated-required.d.ts +16 -0
  129. package/components/common/mixins/form-associated-required.js +29 -0
  130. package/components/common/mixins/form-associated-required.js.map +1 -0
  131. package/components/common/mixins/form-associated.d.ts +92 -0
  132. package/components/common/mixins/form-associated.js +151 -0
  133. package/components/common/mixins/form-associated.js.map +1 -0
  134. package/components/common/util.d.ts +38 -0
  135. package/components/common/util.js +34 -0
  136. package/components/common/util.js.map +1 -1
  137. package/components/common/validators.d.ts +45 -0
  138. package/components/common/validators.js +54 -0
  139. package/components/common/validators.js.map +1 -0
  140. package/components/date-time-input/date-time-input.d.ts +30 -11
  141. package/components/date-time-input/date-time-input.js +147 -135
  142. package/components/date-time-input/date-time-input.js.map +1 -1
  143. package/components/date-time-input/date-util.d.ts +1 -0
  144. package/components/date-time-input/date-util.js +6 -3
  145. package/components/date-time-input/date-util.js.map +1 -1
  146. package/components/dialog/dialog.js +1 -1
  147. package/components/dialog/dialog.js.map +1 -1
  148. package/components/dialog/themes/light/dialog.base.css.js +1 -1
  149. package/components/dialog/themes/light/dialog.base.css.js.map +1 -1
  150. package/components/dropdown/dropdown-item.js +2 -6
  151. package/components/dropdown/dropdown-item.js.map +1 -1
  152. package/components/dropdown/themes/light/dropdown.bootstrap.css.js +1 -1
  153. package/components/dropdown/themes/light/dropdown.bootstrap.css.js.map +1 -1
  154. package/components/dropdown/themes/light/dropdown.fluent.css.js +1 -1
  155. package/components/dropdown/themes/light/dropdown.fluent.css.js.map +1 -1
  156. package/components/dropdown/themes/light/dropdown.indigo.css.js +1 -1
  157. package/components/dropdown/themes/light/dropdown.indigo.css.js.map +1 -1
  158. package/components/dropdown/themes/light/dropdown.material.css.js +1 -1
  159. package/components/dropdown/themes/light/dropdown.material.css.js.map +1 -1
  160. package/components/dropdown/themes/light/group/dropdown-group.bootstrap.css.js +1 -1
  161. package/components/dropdown/themes/light/group/dropdown-group.bootstrap.css.js.map +1 -1
  162. package/components/dropdown/themes/light/group/dropdown-group.fluent.css.js +1 -1
  163. package/components/dropdown/themes/light/group/dropdown-group.fluent.css.js.map +1 -1
  164. package/components/dropdown/themes/light/group/dropdown-group.indigo.css.js +1 -1
  165. package/components/dropdown/themes/light/group/dropdown-group.indigo.css.js.map +1 -1
  166. package/components/dropdown/themes/light/group/dropdown-group.material.css.js +1 -1
  167. package/components/dropdown/themes/light/group/dropdown-group.material.css.js.map +1 -1
  168. package/components/dropdown/themes/light/header/dropdown-header.bootstrap.css.js +1 -1
  169. package/components/dropdown/themes/light/header/dropdown-header.bootstrap.css.js.map +1 -1
  170. package/components/dropdown/themes/light/header/dropdown-header.fluent.css.js +1 -1
  171. package/components/dropdown/themes/light/header/dropdown-header.fluent.css.js.map +1 -1
  172. package/components/dropdown/themes/light/header/dropdown-header.indigo.css.js +1 -1
  173. package/components/dropdown/themes/light/header/dropdown-header.indigo.css.js.map +1 -1
  174. package/components/dropdown/themes/light/header/dropdown-header.material.css.js +1 -1
  175. package/components/dropdown/themes/light/header/dropdown-header.material.css.js.map +1 -1
  176. package/components/dropdown/themes/light/item/dropdown-item.bootstrap.css.js +1 -1
  177. package/components/dropdown/themes/light/item/dropdown-item.bootstrap.css.js.map +1 -1
  178. package/components/dropdown/themes/light/item/dropdown-item.fluent.css.js +1 -1
  179. package/components/dropdown/themes/light/item/dropdown-item.fluent.css.js.map +1 -1
  180. package/components/dropdown/themes/light/item/dropdown-item.indigo.css.js +1 -1
  181. package/components/dropdown/themes/light/item/dropdown-item.indigo.css.js.map +1 -1
  182. package/components/dropdown/themes/light/item/dropdown-item.material.css.js +1 -1
  183. package/components/dropdown/themes/light/item/dropdown-item.material.css.js.map +1 -1
  184. package/components/expansion-panel/expansion-panel.js +1 -1
  185. package/components/expansion-panel/expansion-panel.js.map +1 -1
  186. package/components/form/form.d.ts +3 -0
  187. package/components/form/form.js.map +1 -1
  188. package/components/icon/icon.base.css.js +0 -8
  189. package/components/icon/icon.base.css.js.map +1 -1
  190. package/components/icon/light/icon.bootstrap.css.js +7 -1
  191. package/components/icon/light/icon.bootstrap.css.js.map +1 -1
  192. package/components/icon/light/icon.fluent.css.js +7 -1
  193. package/components/icon/light/icon.fluent.css.js.map +1 -1
  194. package/components/icon/light/icon.indigo.css.js +7 -1
  195. package/components/icon/light/icon.indigo.css.js.map +1 -1
  196. package/components/icon/light/icon.material.css.js +7 -1
  197. package/components/icon/light/icon.material.css.js.map +1 -1
  198. package/components/input/input-base.d.ts +10 -20
  199. package/components/input/input-base.js +19 -20
  200. package/components/input/input-base.js.map +1 -1
  201. package/components/input/input.d.ts +24 -15
  202. package/components/input/input.js +106 -48
  203. package/components/input/input.js.map +1 -1
  204. package/components/input/themes/light/input.base.css.js +0 -3
  205. package/components/input/themes/light/input.base.css.js.map +1 -1
  206. package/components/input/themes/light/input.bootstrap.css.js +7 -17
  207. package/components/input/themes/light/input.bootstrap.css.js.map +1 -1
  208. package/components/input/themes/light/input.fluent.css.js +6 -19
  209. package/components/input/themes/light/input.fluent.css.js.map +1 -1
  210. package/components/input/themes/light/input.indigo.css.js +16 -1
  211. package/components/input/themes/light/input.indigo.css.js.map +1 -1
  212. package/components/input/themes/light/input.material.css.js +30 -11
  213. package/components/input/themes/light/input.material.css.js.map +1 -1
  214. package/components/list/themes/light/list-header.base.css.js +0 -32
  215. package/components/list/themes/light/list-header.base.css.js.map +1 -1
  216. package/components/list/themes/light/list-item.base.css.js +1 -33
  217. package/components/list/themes/light/list-item.base.css.js.map +1 -1
  218. package/components/list/themes/light/list-item.bootstrap.css.js +1 -1
  219. package/components/list/themes/light/list-item.bootstrap.css.js.map +1 -1
  220. package/components/list/themes/light/list-item.fluent.css.js +1 -1
  221. package/components/list/themes/light/list-item.fluent.css.js.map +1 -1
  222. package/components/list/themes/light/list-item.indigo.css.js +1 -1
  223. package/components/list/themes/light/list-item.indigo.css.js.map +1 -1
  224. package/components/list/themes/light/list.base.css.js +1 -1
  225. package/components/list/themes/light/list.base.css.js.map +1 -1
  226. package/components/list/themes/light/list.bootstrap.css.js +1 -1
  227. package/components/list/themes/light/list.bootstrap.css.js.map +1 -1
  228. package/components/mask-input/mask-input-base.d.ts +2 -9
  229. package/components/mask-input/mask-input-base.js +7 -12
  230. package/components/mask-input/mask-input-base.js.map +1 -1
  231. package/components/mask-input/mask-input.d.ts +5 -6
  232. package/components/mask-input/mask-input.js +42 -51
  233. package/components/mask-input/mask-input.js.map +1 -1
  234. package/components/mask-input/mask-parser.js +1 -0
  235. package/components/mask-input/mask-parser.js.map +1 -1
  236. package/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.js +2 -2
  237. package/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.js.map +1 -1
  238. package/components/nav-drawer/themes/light/indigo/nav-drawer.indigo.css.js +2 -2
  239. package/components/nav-drawer/themes/light/indigo/nav-drawer.indigo.css.js.map +1 -1
  240. package/components/nav-drawer/themes/light/nav-drawer-header-item.base.css.js +0 -32
  241. package/components/nav-drawer/themes/light/nav-drawer-header-item.base.css.js.map +1 -1
  242. package/components/nav-drawer/themes/light/nav-drawer-item.base.css.js +1 -34
  243. package/components/nav-drawer/themes/light/nav-drawer-item.base.css.js.map +1 -1
  244. package/components/nav-drawer/themes/light/nav-drawer.base.css.js +1 -1
  245. package/components/nav-drawer/themes/light/nav-drawer.base.css.js.map +1 -1
  246. package/components/navbar/themes/light/navbar.bootstrap.css.js +0 -32
  247. package/components/navbar/themes/light/navbar.bootstrap.css.js.map +1 -1
  248. package/components/navbar/themes/light/navbar.fluent.css.js +0 -32
  249. package/components/navbar/themes/light/navbar.fluent.css.js.map +1 -1
  250. package/components/navbar/themes/light/navbar.indigo.css.js +0 -32
  251. package/components/navbar/themes/light/navbar.indigo.css.js.map +1 -1
  252. package/components/navbar/themes/light/navbar.material.css.js +0 -32
  253. package/components/navbar/themes/light/navbar.material.css.js.map +1 -1
  254. package/components/progress/themes/linear/linear.progress.base.css.js +1 -0
  255. package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
  256. package/components/progress/themes/linear/linear.progress.indigo.css.js +0 -32
  257. package/components/progress/themes/linear/linear.progress.indigo.css.js.map +1 -1
  258. package/components/radio/radio.d.ts +13 -37
  259. package/components/radio/radio.js +135 -97
  260. package/components/radio/radio.js.map +1 -1
  261. package/components/radio/themes/light/radio.bootstrap.css.js +8 -36
  262. package/components/radio/themes/light/radio.bootstrap.css.js.map +1 -1
  263. package/components/radio/themes/light/radio.fluent.css.js +0 -32
  264. package/components/radio/themes/light/radio.fluent.css.js.map +1 -1
  265. package/components/radio/themes/light/radio.indigo.css.js +11 -37
  266. package/components/radio/themes/light/radio.indigo.css.js.map +1 -1
  267. package/components/radio/themes/light/radio.material.css.js +1 -33
  268. package/components/radio/themes/light/radio.material.css.js.map +1 -1
  269. package/components/radio-group/radio-group.d.ts +0 -4
  270. package/components/radio-group/radio-group.js +3 -54
  271. package/components/radio-group/radio-group.js.map +1 -1
  272. package/components/rating/dark/rating.fluent.css.d.ts +1 -0
  273. package/components/rating/dark/rating.fluent.css.js +3 -0
  274. package/components/rating/dark/rating.fluent.css.js.map +1 -0
  275. package/components/rating/rating-symbol.base.css.js +1 -1
  276. package/components/rating/rating-symbol.base.css.js.map +1 -1
  277. package/components/rating/rating.base.css.js +8 -4
  278. package/components/rating/rating.base.css.js.map +1 -1
  279. package/components/rating/rating.d.ts +10 -11
  280. package/components/rating/rating.fluent.css.js +13 -7
  281. package/components/rating/rating.fluent.css.js.map +1 -1
  282. package/components/rating/rating.js +19 -15
  283. package/components/rating/rating.js.map +1 -1
  284. package/components/select/select-item.d.ts +0 -2
  285. package/components/select/select-item.js +0 -3
  286. package/components/select/select-item.js.map +1 -1
  287. package/components/select/select.d.ts +7 -34
  288. package/components/select/select.js +27 -37
  289. package/components/select/select.js.map +1 -1
  290. package/components/select/themes/light/select.base.css.js +1 -0
  291. package/components/select/themes/light/select.base.css.js.map +1 -1
  292. package/components/select/themes/light/select.bootstrap.css.js +5 -37
  293. package/components/select/themes/light/select.bootstrap.css.js.map +1 -1
  294. package/components/select/themes/light/select.fluent.css.js +5 -37
  295. package/components/select/themes/light/select.fluent.css.js.map +1 -1
  296. package/components/select/themes/light/select.indigo.css.js +4 -36
  297. package/components/select/themes/light/select.indigo.css.js.map +1 -1
  298. package/components/select/themes/light/select.material.css.js +14 -46
  299. package/components/select/themes/light/select.material.css.js.map +1 -1
  300. package/components/slider/slider.d.ts +4 -12
  301. package/components/slider/slider.js +16 -25
  302. package/components/slider/slider.js.map +1 -1
  303. package/components/slider/themes/light/slider.base.css.js +17 -8
  304. package/components/slider/themes/light/slider.base.css.js.map +1 -1
  305. package/components/slider/themes/light/slider.fluent.css.js +6 -3
  306. package/components/slider/themes/light/slider.fluent.css.js.map +1 -1
  307. package/components/slider/themes/light/slider.indigo.css.js +4 -1
  308. package/components/slider/themes/light/slider.indigo.css.js.map +1 -1
  309. package/components/snackbar/snackbar.js +1 -1
  310. package/components/snackbar/snackbar.js.map +1 -1
  311. package/components/stepper/animations.d.ts +2 -0
  312. package/components/stepper/animations.js +22 -0
  313. package/components/stepper/animations.js.map +1 -0
  314. package/components/stepper/step.d.ts +17 -8
  315. package/components/stepper/step.js +29 -0
  316. package/components/stepper/step.js.map +1 -1
  317. package/components/stepper/stepper.d.ts +19 -3
  318. package/components/stepper/stepper.js +58 -7
  319. package/components/stepper/stepper.js.map +1 -1
  320. package/components/stepper/themes/step/light/step.base.css.js +44 -165
  321. package/components/stepper/themes/step/light/step.base.css.js.map +1 -1
  322. package/components/stepper/themes/step/light/step.bootstrap.css.js +116 -19
  323. package/components/stepper/themes/step/light/step.bootstrap.css.js.map +1 -1
  324. package/components/stepper/themes/step/light/step.fluent.css.js +112 -12
  325. package/components/stepper/themes/step/light/step.fluent.css.js.map +1 -1
  326. package/components/stepper/themes/step/light/step.indigo.css.js +112 -25
  327. package/components/stepper/themes/step/light/step.indigo.css.js.map +1 -1
  328. package/components/stepper/themes/step/light/step.material.css.js +112 -4
  329. package/components/stepper/themes/step/light/step.material.css.js.map +1 -1
  330. package/components/stepper/themes/stepper/stepper.base.css.js +2 -0
  331. package/components/stepper/themes/stepper/stepper.base.css.js.map +1 -1
  332. package/components/toast/toast.js +1 -1
  333. package/components/toast/toast.js.map +1 -1
  334. package/components/tree/themes/light/tree-item.base.css.js +0 -3
  335. package/components/tree/themes/light/tree-item.base.css.js.map +1 -1
  336. package/components/tree/themes/light/tree-item.bootstrap.css.js +60 -3
  337. package/components/tree/themes/light/tree-item.bootstrap.css.js.map +1 -1
  338. package/components/tree/themes/light/tree-item.fluent.css.js +58 -1
  339. package/components/tree/themes/light/tree-item.fluent.css.js.map +1 -1
  340. package/components/tree/themes/light/tree-item.indigo.css.js +58 -1
  341. package/components/tree/themes/light/tree-item.indigo.css.js.map +1 -1
  342. package/components/tree/themes/light/tree-item.material.css.d.ts +1 -0
  343. package/components/tree/themes/light/tree-item.material.css.js +58 -0
  344. package/components/tree/themes/light/tree-item.material.css.js.map +1 -0
  345. package/components/tree/tree-item.js +8 -6
  346. package/components/tree/tree-item.js.map +1 -1
  347. package/components/tree/tree.d.ts +0 -6
  348. package/components/tree/tree.js +0 -4
  349. package/components/tree/tree.js.map +1 -1
  350. package/components/tree/tree.navigation.js +3 -2
  351. package/components/tree/tree.navigation.js.map +1 -1
  352. package/custom-elements.json +798 -525
  353. package/package.json +3 -3
  354. package/themes/dark/bootstrap.css +274 -61
  355. package/themes/dark/fluent.css +291 -60
  356. package/themes/dark/indigo.css +508 -3
  357. package/themes/dark/material.css +244 -54
  358. package/themes/light/bootstrap.css +5 -2
  359. package/themes/light/fluent.css +5 -2
  360. package/themes/light/indigo.css +229 -2
  361. package/themes/light/material.css +5 -2
  362. package/vscode-html-custom-data.json +239 -286
  363. package/components/avatar/themes/dark/avatar.base.bootstrap.css.js.map +0 -1
  364. package/components/avatar/themes/light/avatar.base.css.js.map +0 -1
  365. package/components/common/types.d.ts +0 -1
  366. package/components/common/types.js +0 -2
  367. package/components/common/types.js.map +0 -1
  368. /package/components/avatar/themes/{light/avatar.base.css.d.ts → avatar.base.css.d.ts} +0 -0
  369. /package/components/avatar/themes/dark/{avatar.base.bootstrap.css.d.ts → avatar.bootstrap.css.d.ts} +0 -0
@@ -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 @@
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,aAAQ,GAAG,KAAK,CAAC;QAGjB,gBAAW,GAAG,EAAE,CAAC;QAGjB,UAAK,GAAG,EAAE,CAAC;QAQd,YAAO,GAAG,KAAK,CAAC;IA2HzB,CAAC;IAzHC,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,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AG,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG;SAC7B,CAAC,CAAC;IACL,CAAC;IAES,aAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAGe,iBAAiB,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,IAA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KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;YACtD,IAAI,CAAC,MAAM,EAAE,CAAC;SACf;IACH,CAAC;IAGe,iBAAiB,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;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,OAA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["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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,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;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,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AAM,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!: 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;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CAAC;QAEH,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,MAAM,CAAC;SACf;QAED,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,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"]}
@@ -2,7 +2,7 @@ import { css } from 'lit';
2
2
  export const styles = css `:host {
3
3
  --elevation: var(--ig-nav-drawer-elevation, var(--ig-elevation-0));
4
4
  --background: var(--ig-nav-drawer-background, hsla(var(--ig-gray-700), var(--ig-gray-a)));
5
- --border-color: var(--ig-nav-drawer-border-color, hsla(var(--ig-gray-900), 0.14));
5
+ --border-color: var(--ig-nav-drawer-border-color, transparent);
6
6
  --item-header-text-color: var(--ig-nav-drawer-item-header-text-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));
7
7
  --item-text-color: var(--ig-nav-drawer-item-text-color, hsla(var(--ig-gray-300), 0.8));
8
8
  --item-icon-color: var(--ig-nav-drawer-item-icon-color, hsla(var(--ig-gray-300), 0.8));
@@ -12,7 +12,7 @@ export const styles = css `:host {
12
12
  --item-hover-text-color: var(--ig-nav-drawer-item-hover-text-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));
13
13
  --item-active-icon-color: var(--ig-nav-drawer-item-active-icon-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));
14
14
  --item-hover-icon-color: var(--ig-nav-drawer-item-hover-icon-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));
15
- --border-radius: var(--ig-nav-drawer-border-radius, 0rem, 0rem, 2.25rem);
15
+ --border-radius: var(--ig-nav-drawer-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 2.25rem), 2.25rem));
16
16
  --item-border-radius: var(--ig-nav-drawer-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 1) * 1.5rem), 1.5rem));
17
17
  }
18
18
  :host [part~=base] {
@@ -1 +1 @@
1
- {"version":3,"file":"nav-drawer-item.indigo.css.js","sourceRoot":"","sources":["../../../../../../src/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCvB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host {\n --elevation: var(--ig-nav-drawer-elevation, var(--ig-elevation-0));\n --background: var(--ig-nav-drawer-background, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n --border-color: var(--ig-nav-drawer-border-color, hsla(var(--ig-gray-900), 0.14));\n --item-header-text-color: var(--ig-nav-drawer-item-header-text-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-text-color: var(--ig-nav-drawer-item-text-color, hsla(var(--ig-gray-300), 0.8));\n --item-icon-color: var(--ig-nav-drawer-item-icon-color, hsla(var(--ig-gray-300), 0.8));\n --item-active-text-color: var(--ig-nav-drawer-item-active-text-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-active-background: var(--ig-nav-drawer-item-active-background, hsla(var(--ig-gray-600), 0.8));\n --item-hover-background: var(--ig-nav-drawer-item-hover-background, transparent);\n --item-hover-text-color: var(--ig-nav-drawer-item-hover-text-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));\n --item-active-icon-color: var(--ig-nav-drawer-item-active-icon-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-hover-icon-color: var(--ig-nav-drawer-item-hover-icon-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));\n --border-radius: var(--ig-nav-drawer-border-radius, 0rem, 0rem, 2.25rem);\n --item-border-radius: var(--ig-nav-drawer-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 1) * 1.5rem), 1.5rem));\n}\n:host [part~=base] {\n border-radius: var(--item-border-radius);\n gap: 1.5rem;\n color: var(--text-color, hsla(var(--ig-gray-300), 0.8));\n padding: 0.25rem;\n margin: 0.9375rem 0.5rem;\n}\n:host [part~=base]:hover, :host [part~=base]:focus-within {\n background: transparent;\n color: var(--hover-text-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));\n}\n:host [part=content] {\n -webkit-padding-start: 0.5rem;\n padding-inline-start: 0.5rem;\n}\n\n:host([active]) [part~=base] {\n background: var(--active-background, hsla(var(--ig-gray-600), 0.8));\n color: hsla(var(--ig-gray-50), var(--ig-gray-a));\n}`;\n"]}
1
+ {"version":3,"file":"nav-drawer-item.indigo.css.js","sourceRoot":"","sources":["../../../../../../src/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCvB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host {\n --elevation: var(--ig-nav-drawer-elevation, var(--ig-elevation-0));\n --background: var(--ig-nav-drawer-background, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n --border-color: var(--ig-nav-drawer-border-color, transparent);\n --item-header-text-color: var(--ig-nav-drawer-item-header-text-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-text-color: var(--ig-nav-drawer-item-text-color, hsla(var(--ig-gray-300), 0.8));\n --item-icon-color: var(--ig-nav-drawer-item-icon-color, hsla(var(--ig-gray-300), 0.8));\n --item-active-text-color: var(--ig-nav-drawer-item-active-text-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-active-background: var(--ig-nav-drawer-item-active-background, hsla(var(--ig-gray-600), 0.8));\n --item-hover-background: var(--ig-nav-drawer-item-hover-background, transparent);\n --item-hover-text-color: var(--ig-nav-drawer-item-hover-text-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));\n --item-active-icon-color: var(--ig-nav-drawer-item-active-icon-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-hover-icon-color: var(--ig-nav-drawer-item-hover-icon-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));\n --border-radius: var(--ig-nav-drawer-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 2.25rem), 2.25rem));\n --item-border-radius: var(--ig-nav-drawer-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 1) * 1.5rem), 1.5rem));\n}\n:host [part~=base] {\n border-radius: var(--item-border-radius);\n gap: 1.5rem;\n color: var(--text-color, hsla(var(--ig-gray-300), 0.8));\n padding: 0.25rem;\n margin: 0.9375rem 0.5rem;\n}\n:host [part~=base]:hover, :host [part~=base]:focus-within {\n background: transparent;\n color: var(--hover-text-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));\n}\n:host [part=content] {\n -webkit-padding-start: 0.5rem;\n padding-inline-start: 0.5rem;\n}\n\n:host([active]) [part~=base] {\n background: var(--active-background, hsla(var(--ig-gray-600), 0.8));\n color: hsla(var(--ig-gray-50), var(--ig-gray-a));\n}`;\n"]}
@@ -2,7 +2,7 @@ import { css } from 'lit';
2
2
  export const styles = css `:host {
3
3
  --elevation: var(--ig-nav-drawer-elevation, var(--ig-elevation-0));
4
4
  --background: var(--ig-nav-drawer-background, hsla(var(--ig-gray-700), var(--ig-gray-a)));
5
- --border-color: var(--ig-nav-drawer-border-color, hsla(var(--ig-gray-900), 0.14));
5
+ --border-color: var(--ig-nav-drawer-border-color, transparent);
6
6
  --item-header-text-color: var(--ig-nav-drawer-item-header-text-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));
7
7
  --item-text-color: var(--ig-nav-drawer-item-text-color, hsla(var(--ig-gray-300), 0.8));
8
8
  --item-icon-color: var(--ig-nav-drawer-item-icon-color, hsla(var(--ig-gray-300), 0.8));
@@ -13,7 +13,7 @@ export const styles = css `:host {
13
13
  --item-active-icon-color: var(--ig-nav-drawer-item-active-icon-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));
14
14
  --item-hover-icon-color: var(--ig-nav-drawer-item-hover-icon-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));
15
15
  --border-radius: var(--ig-nav-drawer-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 2.25rem), 2.25rem));
16
- --item-border-radius: var(--ig-nav-drawer-item-border-radius, 1.5rem, 0rem, 1.5rem);
16
+ --item-border-radius: var(--ig-nav-drawer-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 1) * 1.5rem), 1.5rem));
17
17
  }
18
18
  :host [part=base] {
19
19
  border-radius: var(--border-radius);
@@ -1 +1 @@
1
- {"version":3,"file":"nav-drawer.indigo.css.js","sourceRoot":"","sources":["../../../../../../src/components/nav-drawer/themes/light/indigo/nav-drawer.indigo.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BvB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host {\n --elevation: var(--ig-nav-drawer-elevation, var(--ig-elevation-0));\n --background: var(--ig-nav-drawer-background, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n --border-color: var(--ig-nav-drawer-border-color, hsla(var(--ig-gray-900), 0.14));\n --item-header-text-color: var(--ig-nav-drawer-item-header-text-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-text-color: var(--ig-nav-drawer-item-text-color, hsla(var(--ig-gray-300), 0.8));\n --item-icon-color: var(--ig-nav-drawer-item-icon-color, hsla(var(--ig-gray-300), 0.8));\n --item-active-text-color: var(--ig-nav-drawer-item-active-text-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-active-background: var(--ig-nav-drawer-item-active-background, hsla(var(--ig-gray-600), 0.8));\n --item-hover-background: var(--ig-nav-drawer-item-hover-background, transparent);\n --item-hover-text-color: var(--ig-nav-drawer-item-hover-text-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));\n --item-active-icon-color: var(--ig-nav-drawer-item-active-icon-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-hover-icon-color: var(--ig-nav-drawer-item-hover-icon-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));\n --border-radius: var(--ig-nav-drawer-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 2.25rem), 2.25rem));\n --item-border-radius: var(--ig-nav-drawer-item-border-radius, 1.5rem, 0rem, 1.5rem);\n}\n:host [part=base] {\n border-radius: var(--border-radius);\n background: var(--background, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n border: none;\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n\n:host([position=start]) [part=mini],\n:host([position=end]) [part=mini] {\n background: var(--background, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n}`;\n"]}
1
+ {"version":3,"file":"nav-drawer.indigo.css.js","sourceRoot":"","sources":["../../../../../../src/components/nav-drawer/themes/light/indigo/nav-drawer.indigo.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BvB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host {\n --elevation: var(--ig-nav-drawer-elevation, var(--ig-elevation-0));\n --background: var(--ig-nav-drawer-background, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n --border-color: var(--ig-nav-drawer-border-color, transparent);\n --item-header-text-color: var(--ig-nav-drawer-item-header-text-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-text-color: var(--ig-nav-drawer-item-text-color, hsla(var(--ig-gray-300), 0.8));\n --item-icon-color: var(--ig-nav-drawer-item-icon-color, hsla(var(--ig-gray-300), 0.8));\n --item-active-text-color: var(--ig-nav-drawer-item-active-text-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-active-background: var(--ig-nav-drawer-item-active-background, hsla(var(--ig-gray-600), 0.8));\n --item-hover-background: var(--ig-nav-drawer-item-hover-background, transparent);\n --item-hover-text-color: var(--ig-nav-drawer-item-hover-text-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));\n --item-active-icon-color: var(--ig-nav-drawer-item-active-icon-color, hsla(var(--ig-gray-50), var(--ig-gray-a)));\n --item-hover-icon-color: var(--ig-nav-drawer-item-hover-icon-color, hsla(var(--ig-gray-100), var(--ig-gray-a)));\n --border-radius: var(--ig-nav-drawer-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 2.25rem), 2.25rem));\n --item-border-radius: var(--ig-nav-drawer-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 1) * 1.5rem), 1.5rem));\n}\n:host [part=base] {\n border-radius: var(--border-radius);\n background: var(--background, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n border: none;\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n\n:host([position=start]) [part=mini],\n:host([position=end]) [part=mini] {\n background: var(--background, hsla(var(--ig-gray-700), var(--ig-gray-a)));\n}`;\n"]}
@@ -1,37 +1,5 @@
1
1
  import { css } from 'lit';
2
2
  export const styles = css `:host {
3
- --is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);
4
- --is-medium: min(
5
- clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1),
6
- clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1)
7
- );
8
- --is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);
9
- position: relative;
10
- -webkit-box-sizing: border-box;
11
- box-sizing: border-box;
12
- scrollbar-width: var(--ig-scrollbar-size);
13
- scrollbar-color: var(--ig-scrollbar-thumb-background) var(--ig-scrollbar-track-background);
14
- }
15
- :host *,
16
- :host *::before,
17
- :host *::after {
18
- -webkit-box-sizing: border-box;
19
- box-sizing: border-box;
20
- }
21
- :host ::-webkit-scrollbar {
22
- width: var(--ig-scrollbar-size);
23
- height: var(--ig-scrollbar-size);
24
- background: var(--ig-scrollbar-track-background);
25
- }
26
- :host ::-webkit-scrollbar-thumb {
27
- background: var(--ig-scrollbar-thumb-background);
28
- }
29
-
30
- :host([hidden]),
31
- [hidden] {
32
- display: none !important;
33
- }
34
- :host {
35
3
  display: block;
36
4
  padding: 1.25rem 1rem;
37
5
  white-space: nowrap;
@@ -1 +1 @@
1
- {"version":3,"file":"nav-drawer-header-item.base.css.js","sourceRoot":"","sources":["../../../../../src/components/nav-drawer/themes/light/nav-drawer-header-item.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CvB,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 display: block;\n padding: 1.25rem 1rem;\n white-space: nowrap;\n color: hsla(var(--ig-gray-800), var(--ig-gray-a));\n font-family: var(--ig-subtitle-1-font-family, var(--ig-font-family));\n font-size: var(--ig-subtitle-1-font-size);\n font-weight: var(--ig-subtitle-1-font-weight);\n font-style: var(--ig-subtitle-1-font-style);\n line-height: var(--ig-subtitle-1-line-height);\n letter-spacing: var(--ig-subtitle-1-letter-spacing);\n text-transform: var(--ig-subtitle-1-text-transform);\n margin-top: var(--ig-subtitle-1-margin-top);\n margin-bottom: var(--ig-subtitle-1-margin-bottom);\n}`;\n"]}
1
+ {"version":3,"file":"nav-drawer-header-item.base.css.js","sourceRoot":"","sources":["../../../../../src/components/nav-drawer/themes/light/nav-drawer-header-item.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;EAcvB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host {\n display: block;\n padding: 1.25rem 1rem;\n white-space: nowrap;\n color: hsla(var(--ig-gray-800), var(--ig-gray-a));\n font-family: var(--ig-subtitle-1-font-family, var(--ig-font-family));\n font-size: var(--ig-subtitle-1-font-size);\n font-weight: var(--ig-subtitle-1-font-weight);\n font-style: var(--ig-subtitle-1-font-style);\n line-height: var(--ig-subtitle-1-line-height);\n letter-spacing: var(--ig-subtitle-1-letter-spacing);\n text-transform: var(--ig-subtitle-1-text-transform);\n margin-top: var(--ig-subtitle-1-margin-top);\n margin-bottom: var(--ig-subtitle-1-margin-bottom);\n}`;\n"]}
@@ -1,37 +1,5 @@
1
1
  import { css } from 'lit';
2
2
  export const styles = css `:host {
3
- --is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);
4
- --is-medium: min(
5
- clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1),
6
- clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1)
7
- );
8
- --is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);
9
- position: relative;
10
- -webkit-box-sizing: border-box;
11
- box-sizing: border-box;
12
- scrollbar-width: var(--ig-scrollbar-size);
13
- scrollbar-color: var(--ig-scrollbar-thumb-background) var(--ig-scrollbar-track-background);
14
- }
15
- :host *,
16
- :host *::before,
17
- :host *::after {
18
- -webkit-box-sizing: border-box;
19
- box-sizing: border-box;
20
- }
21
- :host ::-webkit-scrollbar {
22
- width: var(--ig-scrollbar-size);
23
- height: var(--ig-scrollbar-size);
24
- background: var(--ig-scrollbar-track-background);
25
- }
26
- :host ::-webkit-scrollbar-thumb {
27
- background: var(--ig-scrollbar-thumb-background);
28
- }
29
-
30
- :host([hidden]),
31
- [hidden] {
32
- display: none !important;
33
- }
34
- :host {
35
3
  --elevation: var(--ig-nav-drawer-elevation, var(--ig-elevation-16));
36
4
  --background: var(--ig-nav-drawer-background, hsla(var(--ig-surface-500), var(--ig-surface-a)));
37
5
  --border-color: var(--ig-nav-drawer-border-color, hsla(var(--ig-gray-900), 0.14));
@@ -44,7 +12,7 @@ export const styles = css `:host {
44
12
  --item-hover-text-color: var(--ig-nav-drawer-item-hover-text-color, hsla(var(--ig-gray-900), var(--ig-gray-a)));
45
13
  --item-active-icon-color: var(--ig-nav-drawer-item-active-icon-color, hsla(var(--ig-primary-500), var(--ig-primary-a)));
46
14
  --item-hover-icon-color: var(--ig-nav-drawer-item-hover-icon-color, hsla(var(--ig-gray-900), var(--ig-gray-a)));
47
- --border-radius: var(--ig-nav-drawer-border-radius, 0rem, 0rem, 2.25rem);
15
+ --border-radius: var(--ig-nav-drawer-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0) * 2.25rem), 2.25rem));
48
16
  --item-border-radius: var(--ig-nav-drawer-item-border-radius, clamp(0rem, calc(var(--ig-radius-factor, 0.1666666667) * 1.5rem), 1.5rem));
49
17
  }
50
18
 
@@ -74,7 +42,6 @@ export const styles = css `:host {
74
42
  outline: transparent;
75
43
  white-space: nowrap;
76
44
  text-decoration: none;
77
- width: calc(100% - 1rem);
78
45
  border: none;
79
46
  -webkit-box-pack: start;
80
47
  -ms-flex-pack: start;