igniteui-webcomponents 3.1.0 → 3.3.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 (411) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +56 -1
  3. package/components/accordion/accordion.d.ts +36 -0
  4. package/components/accordion/accordion.js +127 -0
  5. package/components/accordion/accordion.js.map +1 -0
  6. package/components/{nav-drawer/styles/indigo/nav-drawer-header-item.indigo.css.d.ts → accordion/themes/accordion.base.css.d.ts} +0 -0
  7. package/components/accordion/themes/accordion.base.css.js +3 -0
  8. package/components/accordion/themes/accordion.base.css.js.map +1 -0
  9. package/components/badge/themes/light/badge.bootstrap.css.js +1 -1
  10. package/components/badge/themes/light/badge.bootstrap.css.js.map +1 -1
  11. package/components/button/button-base.d.ts +6 -1
  12. package/components/button/button-base.js +4 -0
  13. package/components/button/button-base.js.map +1 -1
  14. package/components/button/icon-button.d.ts +0 -1
  15. package/components/button/icon-button.js +13 -9
  16. package/components/button/icon-button.js.map +1 -1
  17. package/components/button/themes/button/light/button.base.css.js +1 -1
  18. package/components/button/themes/button/light/button.base.css.js.map +1 -1
  19. package/components/button/themes/button/light/button.material.css.js +1 -1
  20. package/components/button/themes/button/light/button.material.css.js.map +1 -1
  21. package/components/button/themes/icon-button/light/icon-button.base.css.js +1 -1
  22. package/components/button/themes/icon-button/light/icon-button.base.css.js.map +1 -1
  23. package/components/button/themes/icon-button/light/icon-button.bootstrap.css.js +1 -1
  24. package/components/button/themes/icon-button/light/icon-button.bootstrap.css.js.map +1 -1
  25. package/components/button/themes/icon-button/light/icon-button.fluent.css.js +1 -1
  26. package/components/button/themes/icon-button/light/icon-button.fluent.css.js.map +1 -1
  27. package/components/button/themes/icon-button/light/icon-button.indigo.css.js +1 -1
  28. package/components/button/themes/icon-button/light/icon-button.indigo.css.js.map +1 -1
  29. package/components/button/themes/icon-button/light/icon-button.material.css.js +1 -1
  30. package/components/button/themes/icon-button/light/icon-button.material.css.js.map +1 -1
  31. package/components/calendar/calendar.d.ts +1 -5
  32. package/components/calendar/calendar.js +6 -4
  33. package/components/calendar/calendar.js.map +1 -1
  34. package/components/calendar/common/calendar-base.js +16 -12
  35. package/components/calendar/common/calendar-base.js.map +1 -1
  36. package/components/calendar/common/calendar.model.js.map +1 -1
  37. package/components/calendar/days-view/days-view.d.ts +2 -1
  38. package/components/calendar/days-view/days-view.js +2 -2
  39. package/components/calendar/days-view/days-view.js.map +1 -1
  40. package/components/calendar/months-view/months-view.d.ts +2 -1
  41. package/components/calendar/months-view/months-view.js +2 -2
  42. package/components/calendar/months-view/months-view.js.map +1 -1
  43. package/components/calendar/themes/bootstrap/calendar.bootstrap.css.js +1 -1
  44. package/components/calendar/themes/bootstrap/calendar.bootstrap.css.js.map +1 -1
  45. package/components/calendar/years-view/years-view.d.ts +2 -1
  46. package/components/calendar/years-view/years-view.js +2 -2
  47. package/components/calendar/years-view/years-view.js.map +1 -1
  48. package/components/card/card.header.js +2 -0
  49. package/components/card/card.header.js.map +1 -1
  50. package/components/card/card.js +6 -0
  51. package/components/card/card.js.map +1 -1
  52. package/components/card/themes/light/card.header.bootstrap.css.js +1 -1
  53. package/components/card/themes/light/card.header.bootstrap.css.js.map +1 -1
  54. package/components/{nav-drawer/styles/indigo/nav-drawer-item.indigo.css.d.ts → card/themes/light/card.header.fluent.css.d.ts} +0 -0
  55. package/components/card/themes/light/card.header.fluent.css.js +3 -0
  56. package/components/card/themes/light/card.header.fluent.css.js.map +1 -0
  57. package/components/checkbox/checkbox-base.d.ts +1 -1
  58. package/components/checkbox/checkbox.d.ts +1 -0
  59. package/components/checkbox/checkbox.js +6 -5
  60. package/components/checkbox/checkbox.js.map +1 -1
  61. package/components/checkbox/switch.d.ts +1 -0
  62. package/components/checkbox/switch.js +6 -5
  63. package/components/checkbox/switch.js.map +1 -1
  64. package/components/checkbox/themes/light/checkbox.base.css.js +1 -1
  65. package/components/checkbox/themes/light/checkbox.base.css.js.map +1 -1
  66. package/components/checkbox/themes/light/checkbox.bootstrap.css.js +1 -1
  67. package/components/checkbox/themes/light/checkbox.bootstrap.css.js.map +1 -1
  68. package/components/checkbox/themes/light/checkbox.fluent.css.js +1 -1
  69. package/components/checkbox/themes/light/checkbox.fluent.css.js.map +1 -1
  70. package/components/checkbox/themes/light/checkbox.indigo.css.js +1 -1
  71. package/components/checkbox/themes/light/checkbox.indigo.css.js.map +1 -1
  72. package/components/checkbox/themes/light/checkbox.material.css.js +1 -1
  73. package/components/checkbox/themes/light/checkbox.material.css.js.map +1 -1
  74. package/components/checkbox/themes/light/switch.base.css.js +1 -1
  75. package/components/checkbox/themes/light/switch.base.css.js.map +1 -1
  76. package/components/checkbox/themes/light/switch.fluent.css.js +1 -1
  77. package/components/checkbox/themes/light/switch.fluent.css.js.map +1 -1
  78. package/components/chip/chip.d.ts +1 -2
  79. package/components/chip/chip.js +3 -1
  80. package/components/chip/chip.js.map +1 -1
  81. package/components/chip/themes/chip.base.css.js +1 -1
  82. package/components/chip/themes/chip.base.css.js.map +1 -1
  83. package/components/chip/themes/chip.bootstrap.css.js +1 -1
  84. package/components/chip/themes/chip.bootstrap.css.js.map +1 -1
  85. package/components/chip/themes/chip.fluent.css.js +1 -1
  86. package/components/chip/themes/chip.fluent.css.js.map +1 -1
  87. package/components/chip/themes/chip.indigo.css.js +1 -1
  88. package/components/chip/themes/chip.indigo.css.js.map +1 -1
  89. package/components/chip/themes/chip.material.css.js +1 -1
  90. package/components/chip/themes/chip.material.css.js.map +1 -1
  91. package/components/common/decorators/blazorAdditionalDependencies.d.ts +5 -0
  92. package/components/common/decorators/blazorAdditionalDependencies.js +6 -0
  93. package/components/common/decorators/blazorAdditionalDependencies.js.map +1 -0
  94. package/components/common/decorators/index.d.ts +1 -0
  95. package/components/common/decorators/index.js +1 -0
  96. package/components/common/decorators/index.js.map +1 -1
  97. package/components/common/definitions/defineAllComponents.js +18 -0
  98. package/components/common/definitions/defineAllComponents.js.map +1 -1
  99. package/components/common/i18n/calendar.resources.js.map +1 -1
  100. package/components/common/mixins/constructor.d.ts +1 -0
  101. package/components/common/mixins/constructor.js.map +1 -1
  102. package/components/common/mixins/event-emitter.d.ts +2 -2
  103. package/components/common/mixins/event-emitter.js +2 -2
  104. package/components/common/mixins/event-emitter.js.map +1 -1
  105. package/components/common/types.d.ts +1 -0
  106. package/components/common/types.js +2 -0
  107. package/components/common/types.js.map +1 -0
  108. package/components/common/util.d.ts +18 -0
  109. package/components/common/util.js +17 -0
  110. package/components/common/util.js.map +1 -1
  111. package/components/date-time-input/date-time-input.d.ts +110 -0
  112. package/components/date-time-input/date-time-input.js +505 -0
  113. package/components/date-time-input/date-time-input.js.map +1 -0
  114. package/components/date-time-input/date-util.d.ts +89 -0
  115. package/components/date-time-input/date-util.js +597 -0
  116. package/components/date-time-input/date-util.js.map +1 -0
  117. package/components/dropdown/dropdown-group.d.ts +3 -2
  118. package/components/dropdown/dropdown-group.js +9 -10
  119. package/components/dropdown/dropdown-group.js.map +1 -1
  120. package/components/dropdown/dropdown.d.ts +25 -21
  121. package/components/dropdown/dropdown.js +63 -79
  122. package/components/dropdown/dropdown.js.map +1 -1
  123. package/components/expansion-panel/expansion-panel.d.ts +73 -0
  124. package/components/expansion-panel/expansion-panel.js +173 -0
  125. package/components/expansion-panel/expansion-panel.js.map +1 -0
  126. package/components/{nav-drawer/styles/indigo/nav-drawer.indigo.css.d.ts → expansion-panel/themes/light/expansion-panel.base.css.d.ts} +0 -0
  127. package/components/expansion-panel/themes/light/expansion-panel.base.css.js +3 -0
  128. package/components/expansion-panel/themes/light/expansion-panel.base.css.js.map +1 -0
  129. package/components/{nav-drawer/styles/nav-drawer-header-item.base.css.d.ts → expansion-panel/themes/light/expansion-panel.bootstrap.css.d.ts} +0 -0
  130. package/components/expansion-panel/themes/light/expansion-panel.bootstrap.css.js +3 -0
  131. package/components/expansion-panel/themes/light/expansion-panel.bootstrap.css.js.map +1 -0
  132. package/components/{nav-drawer/styles/nav-drawer-item.base.css.d.ts → expansion-panel/themes/light/expansion-panel.fluent.css.d.ts} +0 -0
  133. package/components/expansion-panel/themes/light/expansion-panel.fluent.css.js +3 -0
  134. package/components/expansion-panel/themes/light/expansion-panel.fluent.css.js.map +1 -0
  135. package/components/{nav-drawer/styles/nav-drawer.base.css.d.ts → expansion-panel/themes/light/expansion-panel.indigo.css.d.ts} +0 -0
  136. package/components/expansion-panel/themes/light/expansion-panel.indigo.css.js +3 -0
  137. package/components/expansion-panel/themes/light/expansion-panel.indigo.css.js.map +1 -0
  138. package/components/form/form.d.ts +1 -1
  139. package/components/form/form.js +12 -2
  140. package/components/form/form.js.map +1 -1
  141. package/components/icon/icon.js +3 -7
  142. package/components/icon/icon.js.map +1 -1
  143. package/components/icon/icon.material.css.js +1 -1
  144. package/components/icon/icon.material.css.js.map +1 -1
  145. package/components/icon/icon.registry.js +5 -0
  146. package/components/icon/icon.registry.js.map +1 -1
  147. package/components/input/input-base.d.ts +7 -3
  148. package/components/input/input-base.js +16 -11
  149. package/components/input/input-base.js.map +1 -1
  150. package/components/input/input.d.ts +1 -4
  151. package/components/input/input.js +8 -4
  152. package/components/input/input.js.map +1 -1
  153. package/components/input/themes/light/input.base.css.js +1 -1
  154. package/components/input/themes/light/input.base.css.js.map +1 -1
  155. package/components/input/themes/light/input.bootstrap.css.js +1 -1
  156. package/components/input/themes/light/input.bootstrap.css.js.map +1 -1
  157. package/components/list/list.js +4 -0
  158. package/components/list/list.js.map +1 -1
  159. package/components/list/themes/light/list-item.bootstrap.css.js +1 -1
  160. package/components/list/themes/light/list-item.bootstrap.css.js.map +1 -1
  161. package/components/list/themes/light/list-item.fluent.css.js +1 -1
  162. package/components/list/themes/light/list-item.fluent.css.js.map +1 -1
  163. package/components/list/themes/light/list-item.indigo.css.js +1 -1
  164. package/components/list/themes/light/list-item.indigo.css.js.map +1 -1
  165. package/components/list/themes/light/list.base.css.js +1 -1
  166. package/components/list/themes/light/list.base.css.js.map +1 -1
  167. package/components/mask-input/mask-input-base.d.ts +38 -0
  168. package/components/mask-input/mask-input-base.js +110 -0
  169. package/components/mask-input/mask-input-base.js.map +1 -0
  170. package/components/mask-input/mask-input.d.ts +71 -0
  171. package/components/mask-input/mask-input.js +182 -0
  172. package/components/mask-input/mask-input.js.map +1 -0
  173. package/components/mask-input/mask-parser.d.ts +30 -0
  174. package/components/mask-input/mask-parser.js +167 -0
  175. package/components/mask-input/mask-parser.js.map +1 -0
  176. package/components/nav-drawer/nav-drawer-header-item.js +4 -3
  177. package/components/nav-drawer/nav-drawer-header-item.js.map +1 -1
  178. package/components/nav-drawer/nav-drawer-item.d.ts +1 -0
  179. package/components/nav-drawer/nav-drawer-item.js +9 -5
  180. package/components/nav-drawer/nav-drawer-item.js.map +1 -1
  181. package/components/nav-drawer/nav-drawer.js +6 -2
  182. package/components/nav-drawer/nav-drawer.js.map +1 -1
  183. package/components/{snackbar/themes/snackbar.base.css.d.ts → nav-drawer/themes/dark/nav-drawer-item.base.css.d.ts} +0 -0
  184. package/components/nav-drawer/themes/dark/nav-drawer-item.base.css.js +3 -0
  185. package/components/nav-drawer/themes/dark/nav-drawer-item.base.css.js.map +1 -0
  186. package/components/{snackbar/themes/snackbar.bootstrap.css.d.ts → nav-drawer/themes/dark/nav-drawer-item.bootstrap.css.d.ts} +0 -0
  187. package/components/nav-drawer/themes/dark/nav-drawer-item.bootstrap.css.js +3 -0
  188. package/components/nav-drawer/themes/dark/nav-drawer-item.bootstrap.css.js.map +1 -0
  189. package/components/{snackbar/themes/snackbar.fluent.css.d.ts → nav-drawer/themes/dark/nav-drawer-item.fluent.css.d.ts} +0 -0
  190. package/components/nav-drawer/themes/dark/nav-drawer-item.fluent.css.js +3 -0
  191. package/components/nav-drawer/themes/dark/nav-drawer-item.fluent.css.js.map +1 -0
  192. package/components/{snackbar/themes/snackbar.indigo.css.d.ts → nav-drawer/themes/dark/nav-drawer-item.indigo.css.d.ts} +0 -0
  193. package/components/nav-drawer/themes/dark/nav-drawer-item.indigo.css.js +3 -0
  194. package/components/nav-drawer/themes/dark/nav-drawer-item.indigo.css.js.map +1 -0
  195. package/components/nav-drawer/themes/dark/nav-drawer.indigo.css.d.ts +1 -0
  196. package/components/nav-drawer/themes/dark/nav-drawer.indigo.css.js +3 -0
  197. package/components/nav-drawer/themes/dark/nav-drawer.indigo.css.js.map +1 -0
  198. package/components/nav-drawer/themes/light/fluent/nav-drawer-header-item.fluent.css.d.ts +1 -0
  199. package/components/nav-drawer/themes/light/fluent/nav-drawer-header-item.fluent.css.js +3 -0
  200. package/components/nav-drawer/themes/light/fluent/nav-drawer-header-item.fluent.css.js.map +1 -0
  201. package/components/nav-drawer/themes/light/fluent/nav-drawer-item.fluent.css.d.ts +1 -0
  202. package/components/nav-drawer/themes/light/fluent/nav-drawer-item.fluent.css.js +3 -0
  203. package/components/nav-drawer/themes/light/fluent/nav-drawer-item.fluent.css.js.map +1 -0
  204. package/components/nav-drawer/themes/light/indigo/nav-drawer-header-item.indigo.css.d.ts +1 -0
  205. package/components/nav-drawer/{styles → themes/light}/indigo/nav-drawer-header-item.indigo.css.js +0 -0
  206. package/components/nav-drawer/themes/light/indigo/nav-drawer-header-item.indigo.css.js.map +1 -0
  207. package/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.d.ts +1 -0
  208. package/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.js +3 -0
  209. package/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.js.map +1 -0
  210. package/components/nav-drawer/themes/light/indigo/nav-drawer.indigo.css.d.ts +1 -0
  211. package/components/nav-drawer/themes/light/indigo/nav-drawer.indigo.css.js +3 -0
  212. package/components/nav-drawer/themes/light/indigo/nav-drawer.indigo.css.js.map +1 -0
  213. package/components/nav-drawer/themes/light/nav-drawer-header-item.base.css.d.ts +1 -0
  214. package/components/nav-drawer/{styles → themes/light}/nav-drawer-header-item.base.css.js +1 -1
  215. package/components/nav-drawer/themes/light/nav-drawer-header-item.base.css.js.map +1 -0
  216. package/components/nav-drawer/themes/light/nav-drawer-item.base.css.d.ts +1 -0
  217. package/components/nav-drawer/themes/light/nav-drawer-item.base.css.js +3 -0
  218. package/components/nav-drawer/themes/light/nav-drawer-item.base.css.js.map +1 -0
  219. package/components/nav-drawer/themes/light/nav-drawer.base.css.d.ts +1 -0
  220. package/components/nav-drawer/{styles → themes/light}/nav-drawer.base.css.js +1 -1
  221. package/components/nav-drawer/themes/light/nav-drawer.base.css.js.map +1 -0
  222. package/components/navbar/navbar.js +2 -1
  223. package/components/navbar/navbar.js.map +1 -1
  224. package/components/navbar/themes/light/navbar.base.css.js +1 -1
  225. package/components/navbar/themes/light/navbar.base.css.js.map +1 -1
  226. package/components/navbar/themes/light/navbar.bootstrap.css.js +1 -1
  227. package/components/navbar/themes/light/navbar.bootstrap.css.js.map +1 -1
  228. package/components/navbar/themes/light/navbar.fluent.css.d.ts +1 -0
  229. package/components/navbar/themes/light/navbar.fluent.css.js +3 -0
  230. package/components/navbar/themes/light/navbar.fluent.css.js.map +1 -0
  231. package/components/progress/circular-progress.d.ts +1 -1
  232. package/components/progress/circular-progress.js +3 -0
  233. package/components/progress/circular-progress.js.map +1 -1
  234. package/components/radio/radio.d.ts +2 -1
  235. package/components/radio/radio.js +6 -5
  236. package/components/radio/radio.js.map +1 -1
  237. package/components/radio/themes/light/radio.base.css.js +1 -1
  238. package/components/radio/themes/light/radio.base.css.js.map +1 -1
  239. package/components/radio/themes/light/radio.fluent.css.js +1 -1
  240. package/components/radio/themes/light/radio.fluent.css.js.map +1 -1
  241. package/components/rating/rating-symbol.base.css.d.ts +1 -0
  242. package/components/rating/rating-symbol.base.css.js +3 -0
  243. package/components/rating/rating-symbol.base.css.js.map +1 -0
  244. package/components/rating/rating-symbol.d.ts +8 -2
  245. package/components/rating/rating-symbol.js +12 -3
  246. package/components/rating/rating-symbol.js.map +1 -1
  247. package/components/rating/rating.base.css.js +1 -1
  248. package/components/rating/rating.base.css.js.map +1 -1
  249. package/components/rating/rating.bootstrap.css.js +1 -1
  250. package/components/rating/rating.bootstrap.css.js.map +1 -1
  251. package/components/rating/rating.d.ts +19 -14
  252. package/components/rating/rating.fluent.css.js +1 -1
  253. package/components/rating/rating.fluent.css.js.map +1 -1
  254. package/components/rating/rating.indigo.css.js +1 -1
  255. package/components/rating/rating.indigo.css.js.map +1 -1
  256. package/components/rating/rating.js +86 -44
  257. package/components/rating/rating.js.map +1 -1
  258. package/components/slider/range-slider.d.ts +1 -1
  259. package/components/slider/range-slider.js.map +1 -1
  260. package/components/slider/slider-base.js +4 -1
  261. package/components/slider/slider-base.js.map +1 -1
  262. package/components/slider/slider.d.ts +1 -1
  263. package/components/slider/themes/light/slider.base.css.js +1 -1
  264. package/components/slider/themes/light/slider.base.css.js.map +1 -1
  265. package/components/slider/themes/light/slider.bootstrap.css.js +1 -1
  266. package/components/slider/themes/light/slider.bootstrap.css.js.map +1 -1
  267. package/components/slider/themes/light/slider.fluent.css.js +1 -1
  268. package/components/slider/themes/light/slider.fluent.css.js.map +1 -1
  269. package/components/slider/themes/light/slider.indigo.css.js +1 -1
  270. package/components/slider/themes/light/slider.indigo.css.js.map +1 -1
  271. package/components/slider/themes/light/slider.material.css.js +1 -1
  272. package/components/slider/themes/light/slider.material.css.js.map +1 -1
  273. package/components/snackbar/snackbar.d.ts +1 -1
  274. package/components/snackbar/snackbar.js +8 -4
  275. package/components/snackbar/snackbar.js.map +1 -1
  276. package/components/snackbar/themes/dark/snackbar.indigo.css.d.ts +1 -0
  277. package/components/snackbar/themes/dark/snackbar.indigo.css.js +3 -0
  278. package/components/snackbar/themes/dark/snackbar.indigo.css.js.map +1 -0
  279. package/components/snackbar/themes/light/snackbar.base.css.d.ts +1 -0
  280. package/components/snackbar/themes/light/snackbar.base.css.js +3 -0
  281. package/components/snackbar/themes/light/snackbar.base.css.js.map +1 -0
  282. package/components/snackbar/themes/light/snackbar.bootstrap.css.d.ts +1 -0
  283. package/components/snackbar/themes/light/snackbar.bootstrap.css.js +3 -0
  284. package/components/snackbar/themes/light/snackbar.bootstrap.css.js.map +1 -0
  285. package/components/snackbar/themes/light/snackbar.fluent.css.d.ts +1 -0
  286. package/components/snackbar/themes/light/snackbar.fluent.css.js +3 -0
  287. package/components/snackbar/themes/light/snackbar.fluent.css.js.map +1 -0
  288. package/components/snackbar/themes/light/snackbar.indigo.css.d.ts +1 -0
  289. package/components/snackbar/themes/light/snackbar.indigo.css.js +3 -0
  290. package/components/snackbar/themes/light/snackbar.indigo.css.js.map +1 -0
  291. package/components/tabs/tab-panel.d.ts +20 -0
  292. package/components/tabs/tab-panel.js +20 -0
  293. package/components/tabs/tab-panel.js.map +1 -0
  294. package/components/tabs/tab.d.ts +37 -0
  295. package/components/tabs/tab.js +71 -0
  296. package/components/tabs/tab.js.map +1 -0
  297. package/components/tabs/tabs.d.ts +79 -0
  298. package/components/tabs/tabs.js +316 -0
  299. package/components/tabs/tabs.js.map +1 -0
  300. package/components/tabs/themes/dark/tab.dark.base.css.d.ts +1 -0
  301. package/components/tabs/themes/dark/tab.dark.base.css.js +3 -0
  302. package/components/tabs/themes/dark/tab.dark.base.css.js.map +1 -0
  303. package/components/tabs/themes/dark/tab.dark.bootstrap.css.d.ts +1 -0
  304. package/components/tabs/themes/dark/tab.dark.bootstrap.css.js +3 -0
  305. package/components/tabs/themes/dark/tab.dark.bootstrap.css.js.map +1 -0
  306. package/components/tabs/themes/light/tab-panel.base.css.d.ts +1 -0
  307. package/components/tabs/themes/light/tab-panel.base.css.js +3 -0
  308. package/components/tabs/themes/light/tab-panel.base.css.js.map +1 -0
  309. package/components/tabs/themes/light/tab.base.css.d.ts +1 -0
  310. package/components/tabs/themes/light/tab.base.css.js +3 -0
  311. package/components/tabs/themes/light/tab.base.css.js.map +1 -0
  312. package/components/tabs/themes/light/tab.bootstrap.css.d.ts +1 -0
  313. package/components/tabs/themes/light/tab.bootstrap.css.js +3 -0
  314. package/components/tabs/themes/light/tab.bootstrap.css.js.map +1 -0
  315. package/components/tabs/themes/light/tab.fluent.css.d.ts +1 -0
  316. package/components/tabs/themes/light/tab.fluent.css.js +3 -0
  317. package/components/tabs/themes/light/tab.fluent.css.js.map +1 -0
  318. package/components/tabs/themes/light/tab.indigo.css.d.ts +1 -0
  319. package/components/tabs/themes/light/tab.indigo.css.js +3 -0
  320. package/components/tabs/themes/light/tab.indigo.css.js.map +1 -0
  321. package/components/tabs/themes/light/tabs.base.css.d.ts +1 -0
  322. package/components/tabs/themes/light/tabs.base.css.js +3 -0
  323. package/components/tabs/themes/light/tabs.base.css.js.map +1 -0
  324. package/components/tabs/themes/light/tabs.bootstrap.css.d.ts +1 -0
  325. package/components/tabs/themes/light/tabs.bootstrap.css.js +3 -0
  326. package/components/tabs/themes/light/tabs.bootstrap.css.js.map +1 -0
  327. package/components/tabs/themes/light/tabs.fluent.css.d.ts +1 -0
  328. package/components/tabs/themes/light/tabs.fluent.css.js +3 -0
  329. package/components/tabs/themes/light/tabs.fluent.css.js.map +1 -0
  330. package/components/tabs/themes/light/tabs.indigo.css.d.ts +1 -0
  331. package/components/tabs/themes/light/tabs.indigo.css.js +3 -0
  332. package/components/tabs/themes/light/tabs.indigo.css.js.map +1 -0
  333. package/components/tabs/utils.d.ts +14 -0
  334. package/components/tabs/utils.js +32 -0
  335. package/components/tabs/utils.js.map +1 -0
  336. package/components/toast/themes/toast.base.css.js +1 -1
  337. package/components/toast/themes/toast.base.css.js.map +1 -1
  338. package/components/toggle/toggle.controller.d.ts +17 -2
  339. package/components/toggle/toggle.controller.js +16 -11
  340. package/components/toggle/toggle.controller.js.map +1 -1
  341. package/components/toggle/toggle.directive.d.ts +1 -1
  342. package/components/toggle/toggle.directive.js +6 -4
  343. package/components/toggle/toggle.directive.js.map +1 -1
  344. package/components/tree/themes/dark/tree-item.bootstrap.css.d.ts +1 -0
  345. package/components/tree/themes/dark/tree-item.bootstrap.css.js +3 -0
  346. package/components/tree/themes/dark/tree-item.bootstrap.css.js.map +1 -0
  347. package/components/tree/themes/dark/tree-item.fluent.css.d.ts +1 -0
  348. package/components/tree/themes/dark/tree-item.fluent.css.js +3 -0
  349. package/components/tree/themes/dark/tree-item.fluent.css.js.map +1 -0
  350. package/components/tree/themes/dark/tree-item.indigo.css.d.ts +1 -0
  351. package/components/tree/themes/dark/tree-item.indigo.css.js +3 -0
  352. package/components/tree/themes/dark/tree-item.indigo.css.js.map +1 -0
  353. package/components/tree/themes/light/tree-item.base.css.d.ts +1 -0
  354. package/components/tree/themes/light/tree-item.base.css.js +3 -0
  355. package/components/tree/themes/light/tree-item.base.css.js.map +1 -0
  356. package/components/tree/themes/light/tree-item.bootstrap.css.d.ts +1 -0
  357. package/components/tree/themes/light/tree-item.bootstrap.css.js +3 -0
  358. package/components/tree/themes/light/tree-item.bootstrap.css.js.map +1 -0
  359. package/components/tree/themes/light/tree-item.fluent.css.d.ts +1 -0
  360. package/components/tree/themes/light/tree-item.fluent.css.js +3 -0
  361. package/components/tree/themes/light/tree-item.fluent.css.js.map +1 -0
  362. package/components/tree/themes/light/tree-item.indigo.css.d.ts +1 -0
  363. package/components/tree/themes/light/tree-item.indigo.css.js +3 -0
  364. package/components/tree/themes/light/tree-item.indigo.css.js.map +1 -0
  365. package/components/tree/themes/light/tree.base.css.d.ts +1 -0
  366. package/components/tree/themes/light/tree.base.css.js +3 -0
  367. package/components/tree/themes/light/tree.base.css.js.map +1 -0
  368. package/components/tree/tree-item.d.ts +116 -0
  369. package/components/tree/tree-item.js +465 -0
  370. package/components/tree/tree-item.js.map +1 -0
  371. package/components/tree/tree.common.d.ts +17 -0
  372. package/components/tree/tree.common.js +2 -0
  373. package/components/tree/tree.common.js.map +1 -0
  374. package/components/tree/tree.d.ts +71 -0
  375. package/components/tree/tree.js +169 -0
  376. package/components/tree/tree.js.map +1 -0
  377. package/components/tree/tree.navigation.d.ts +41 -0
  378. package/components/tree/tree.navigation.js +260 -0
  379. package/components/tree/tree.navigation.js.map +1 -0
  380. package/components/tree/tree.selection.d.ts +55 -0
  381. package/components/tree/tree.selection.js +265 -0
  382. package/components/tree/tree.selection.js.map +1 -0
  383. package/custom-elements.json +2754 -1522
  384. package/index.d.ts +12 -8
  385. package/index.js +9 -7
  386. package/index.js.map +1 -1
  387. package/package.json +10 -8
  388. package/themes/dark/bootstrap.css +1 -1
  389. package/themes/dark/fluent.css +1 -1
  390. package/themes/dark/indigo.css +1 -1
  391. package/themes/dark/material.css +1 -1
  392. package/themes/light/bootstrap.css +1 -1
  393. package/themes/light/fluent.css +1 -1
  394. package/vscode-html-custom-data.json +515 -72
  395. package/components/nav-drawer/styles/indigo/nav-drawer-header-item.indigo.css.js.map +0 -1
  396. package/components/nav-drawer/styles/indigo/nav-drawer-item.indigo.css.js +0 -3
  397. package/components/nav-drawer/styles/indigo/nav-drawer-item.indigo.css.js.map +0 -1
  398. package/components/nav-drawer/styles/indigo/nav-drawer.indigo.css.js +0 -3
  399. package/components/nav-drawer/styles/indigo/nav-drawer.indigo.css.js.map +0 -1
  400. package/components/nav-drawer/styles/nav-drawer-header-item.base.css.js.map +0 -1
  401. package/components/nav-drawer/styles/nav-drawer-item.base.css.js +0 -3
  402. package/components/nav-drawer/styles/nav-drawer-item.base.css.js.map +0 -1
  403. package/components/nav-drawer/styles/nav-drawer.base.css.js.map +0 -1
  404. package/components/snackbar/themes/snackbar.base.css.js +0 -3
  405. package/components/snackbar/themes/snackbar.base.css.js.map +0 -1
  406. package/components/snackbar/themes/snackbar.bootstrap.css.js +0 -3
  407. package/components/snackbar/themes/snackbar.bootstrap.css.js.map +0 -1
  408. package/components/snackbar/themes/snackbar.fluent.css.js +0 -3
  409. package/components/snackbar/themes/snackbar.fluent.css.js.map +0 -1
  410. package/components/snackbar/themes/snackbar.indigo.css.js +0 -3
  411. package/components/snackbar/themes/snackbar.indigo.css.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"list.base.css.js","sourceRoot":"","sources":["../../../../../src/components/list/themes/light/list.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,u9CAAu9C,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-width:var(--scrolbar-size, 0.875rem);scrollbar-color:var(--igc-scrollbar-thumb-color, hsla(var(--igc-gray-400), var(--igc-gray-a))) var(--igc-scrollbar-track-color, hsla(var(--igc-gray-200), var(--igc-gray-a)))}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host ::-webkit-scrollbar{width:var(--scrolbar-size, 0.875rem);height:var(--scrolbar-size, 0.875rem);background:var(--igc-scrollbar-track-color, hsla(var(--igc-gray-200), var(--igc-gray-a)))}:host ::-webkit-scrollbar-thumb{background:var(--igc-scrollbar-thumb-color, hsla(var(--igc-gray-400), var(--igc-gray-a)))}[hidden]{display:none !important}:host{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-flow:column nowrap;flex-flow:column nowrap;font-family:var(--igc-font-family);overflow:hidden;background:hsla(var(--igc-surface-500), var(--igc-surface-a))}:host([size=small]) ::slotted(igc-list-item),:host([size=small]) ::slotted(igc-list-header){padding:var(--igc-spacing-small) calc(var(--igc-spacing-small)*2)}:host([size=medium]) ::slotted(igc-list-item),:host([size=medium]) ::slotted(igc-list-header){padding:var(--igc-spacing-medium) calc(var(--igc-spacing-medium)*2)}:host([size=large]) ::slotted(igc-list-item),:host([size=large]) ::slotted(igc-list-header){padding:var(--igc-spacing-large) calc(var(--igc-spacing-large)*2)}`;\n"]}
1
+ {"version":3,"file":"list.base.css.js","sourceRoot":"","sources":["../../../../../src/components/list/themes/light/list.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,w+CAAw+C,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-width:var(--scrolbar-size, 0.875rem);scrollbar-color:var(--igc-scrollbar-thumb-color, hsla(var(--igc-gray-400), var(--igc-gray-a))) var(--igc-scrollbar-track-color, hsla(var(--igc-gray-200), var(--igc-gray-a)))}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host ::-webkit-scrollbar{width:var(--scrolbar-size, 0.875rem);height:var(--scrolbar-size, 0.875rem);background:var(--igc-scrollbar-track-color, hsla(var(--igc-gray-200), var(--igc-gray-a)))}:host ::-webkit-scrollbar-thumb{background:var(--igc-scrollbar-thumb-color, hsla(var(--igc-gray-400), var(--igc-gray-a)))}[hidden]{display:none !important}:host{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-flow:column nowrap;flex-flow:column nowrap;font-family:var(--igc-font-family);overflow:hidden auto;height:auto;background:hsla(var(--igc-surface-500), var(--igc-surface-a))}:host([size=small]) ::slotted(igc-list-item),:host([size=small]) ::slotted(igc-list-header){padding:var(--igc-spacing-small) calc(var(--igc-spacing-small)*2)}:host([size=medium]) ::slotted(igc-list-item),:host([size=medium]) ::slotted(igc-list-header){padding:var(--igc-spacing-medium) calc(var(--igc-spacing-medium)*2)}:host([size=large]) ::slotted(igc-list-item),:host([size=large]) ::slotted(igc-list-header){padding:var(--igc-spacing-large) calc(var(--igc-spacing-large)*2)}`;\n"]}
@@ -0,0 +1,38 @@
1
+ import { IgcInputBaseComponent } from '../input/input-base.js';
2
+ import { MaskParser } from './mask-parser.js';
3
+ interface MaskSelection {
4
+ start: number;
5
+ end: number;
6
+ }
7
+ export declare abstract class IgcMaskInputBaseComponent extends IgcInputBaseComponent {
8
+ protected parser: MaskParser;
9
+ protected selection: MaskSelection;
10
+ protected compositionStart: number;
11
+ protected hasFocus: boolean;
12
+ protected maskedValue: string;
13
+ protected _mask: string;
14
+ /** The prompt symbol to use for unfilled parts of the mask. */
15
+ prompt: string;
16
+ /** Controls the validity of the control. */
17
+ invalid: boolean;
18
+ protected get inputSelection(): MaskSelection;
19
+ protected get emptyMask(): string;
20
+ connectedCallback(): void;
21
+ /**
22
+ * Sets a custom validation message for the control.
23
+ * As long as `message` is not empty, the control is considered invalid.
24
+ */
25
+ setCustomValidity(message: string): void;
26
+ /** Selects all text within the input. */
27
+ select(): void;
28
+ protected handleInput({ inputType, isComposing }: InputEvent): void | Promise<void>;
29
+ protected handleKeydown(e: KeyboardEvent): void;
30
+ protected handleCut(): void;
31
+ protected handleDragStart(): void;
32
+ protected handleCompositionStart(): void;
33
+ protected handleCompositionEnd({ data }: CompositionEvent): void;
34
+ protected handleInvalid(): void;
35
+ setSelectionRange(start: number, end: number, direction?: 'backward' | 'forward' | 'none'): void;
36
+ protected abstract updateInput(part: string, start: number, finish: number): void;
37
+ }
38
+ export {};
@@ -0,0 +1,110 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { property, state } from 'lit/decorators.js';
8
+ import { blazorSuppress } from '../common/decorators/blazorSuppress.js';
9
+ import { IgcInputBaseComponent } from '../input/input-base.js';
10
+ import { MaskParser } from './mask-parser.js';
11
+ export class IgcMaskInputBaseComponent extends IgcInputBaseComponent {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.parser = new MaskParser();
15
+ this.selection = { start: 0, end: 0 };
16
+ this.compositionStart = 0;
17
+ this.hasFocus = false;
18
+ this.maskedValue = '';
19
+ this._mask = '';
20
+ this.invalid = false;
21
+ }
22
+ get inputSelection() {
23
+ return {
24
+ start: this.input.selectionStart || 0,
25
+ end: this.input.selectionEnd || 0,
26
+ };
27
+ }
28
+ get emptyMask() {
29
+ return this.parser.apply();
30
+ }
31
+ connectedCallback() {
32
+ super.connectedCallback();
33
+ this._mask = this._mask || this.parser.mask;
34
+ this.prompt = this.prompt || this.parser.prompt;
35
+ }
36
+ setCustomValidity(message) {
37
+ this.input.setCustomValidity(message);
38
+ this.invalid = !this.input.checkValidity();
39
+ }
40
+ select() {
41
+ this.input.select();
42
+ }
43
+ handleInput({ inputType, isComposing }) {
44
+ const value = this.input.value;
45
+ const start = this.selection.start;
46
+ let end = this.selection.end;
47
+ switch (inputType) {
48
+ case 'deleteContentForward':
49
+ this.updateInput('', start, (end = start === end ? ++end : end));
50
+ return this.updateComplete.then(() => this.input.setSelectionRange(end, end));
51
+ case 'deleteContentBackward':
52
+ if (isComposing)
53
+ return;
54
+ return this.updateInput('', this.inputSelection.start, end);
55
+ case 'deleteByCut':
56
+ return this.updateInput('', start, end);
57
+ case 'insertText':
58
+ return this.updateInput(value.substring(start, this.inputSelection.end), start, end);
59
+ case 'insertFromPaste':
60
+ return this.updateInput(value.substring(start, this.inputSelection.end), start, this.inputSelection.start);
61
+ case 'insertFromDrop':
62
+ return this.updateInput(value.substring(this.inputSelection.start, this.inputSelection.end), this.inputSelection.start, this.inputSelection.end);
63
+ }
64
+ }
65
+ handleKeydown(e) {
66
+ if (!e.key) {
67
+ return;
68
+ }
69
+ this.selection = this.inputSelection;
70
+ }
71
+ handleCut() {
72
+ this.selection = this.inputSelection;
73
+ }
74
+ handleDragStart() {
75
+ this.selection = this.inputSelection;
76
+ }
77
+ handleCompositionStart() {
78
+ this.compositionStart = this.inputSelection.start;
79
+ }
80
+ handleCompositionEnd({ data }) {
81
+ const start = this.compositionStart, end = this.inputSelection.end;
82
+ this.updateInput(data, start, end);
83
+ }
84
+ handleInvalid() {
85
+ this.invalid = true;
86
+ }
87
+ setSelectionRange(start, end, direction) {
88
+ super.setSelectionRange(start, end, direction);
89
+ this.selection = { start, end };
90
+ }
91
+ }
92
+ __decorate([
93
+ state()
94
+ ], IgcMaskInputBaseComponent.prototype, "hasFocus", void 0);
95
+ __decorate([
96
+ state()
97
+ ], IgcMaskInputBaseComponent.prototype, "maskedValue", void 0);
98
+ __decorate([
99
+ state()
100
+ ], IgcMaskInputBaseComponent.prototype, "_mask", void 0);
101
+ __decorate([
102
+ property()
103
+ ], IgcMaskInputBaseComponent.prototype, "prompt", void 0);
104
+ __decorate([
105
+ property({ reflect: true, type: Boolean })
106
+ ], IgcMaskInputBaseComponent.prototype, "invalid", void 0);
107
+ __decorate([
108
+ blazorSuppress()
109
+ ], IgcMaskInputBaseComponent.prototype, "setSelectionRange", null);
110
+ //# sourceMappingURL=mask-input-base.js.map
@@ -0,0 +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,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAM9C,MAAM,OAAgB,yBAA0B,SAAQ,qBAAqB;IAA7E;;QACY,WAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC1B,cAAS,GAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;QAChD,qBAAgB,GAAG,CAAC,CAAC;QAGrB,aAAQ,GAAG,KAAK,CAAC;QAGjB,gBAAW,GAAG,EAAE,CAAC;QAGjB,UAAK,GAAG,EAAE,CAAC;QAQd,YAAO,GAAG,KAAK,CAAC;IAwHzB,CAAC;IAtHC,IAAc,cAAc;QAC1B,OAAO;YACL,KAAK,EAAE,IAAI,CAA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B;QAC9B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;IACpD,CAAC;IAES,oBAAoB,CAAC,EAAE,IAAI,EAAoB;QACvD,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,EACjC,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACrC,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;CAOF;AAtIC;IADC,KAAK,EAAE;2DACmB;AAG3B;IADC,KAAK,EAAE;8DACmB;AAG3B;IADC,KAAK,EAAE;wDACa;AAIrB;IADC,QAAQ,EAAE;yDACY;AAIvB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DACpB;AA0GvB;IADC,cAAc,EAAE;kEAQhB","sourcesContent":["import { property, state } from 'lit/decorators.js';\nimport { blazorSuppress } from '../common/decorators/blazorSuppress.js';\nimport { IgcInputBaseComponent } from '../input/input-base.js';\nimport { MaskParser } from './mask-parser.js';\ninterface MaskSelection {\n start: number;\n end: number;\n}\n\nexport abstract class IgcMaskInputBaseComponent extends IgcInputBaseComponent {\n protected parser = new MaskParser();\n protected selection: MaskSelection = { 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(): MaskSelection {\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 value = this.input.value;\n const start = this.selection.start;\n let end = this.selection.end;\n\n switch (inputType) {\n case 'deleteContentForward':\n this.updateInput('', start, (end = start === end ? ++end : end));\n return this.updateComplete.then(() =>\n this.input.setSelectionRange(end, end)\n );\n\n case 'deleteContentBackward':\n if (isComposing) return;\n return this.updateInput('', this.inputSelection.start, end);\n\n case 'deleteByCut':\n return this.updateInput('', start, end);\n\n case 'insertText':\n return this.updateInput(\n value.substring(start, this.inputSelection.end),\n start,\n end\n );\n\n case 'insertFromPaste':\n return this.updateInput(\n value.substring(start, this.inputSelection.end),\n start,\n this.inputSelection.start\n );\n\n case 'insertFromDrop':\n return this.updateInput(\n value.substring(this.inputSelection.start, this.inputSelection.end),\n this.inputSelection.start,\n this.inputSelection.end\n );\n }\n }\n\n protected handleKeydown(e: KeyboardEvent) {\n if (!e.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 const start = this.compositionStart,\n end = this.inputSelection.end;\n this.updateInput(data, start, end);\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(\n part: string,\n start: number,\n finish: number\n ): void;\n}\n"]}
@@ -0,0 +1,71 @@
1
+ import { IgcMaskInputBaseComponent } from './mask-input-base.js';
2
+ /**
3
+ * A masked input is an input field where a developer can control user input and format the visible value,
4
+ * based on configurable rules
5
+ *
6
+ * @element igc-mask-input
7
+ *
8
+ * @slot prefix - Renders content before the input
9
+ * @slot suffix - Renders content after the input
10
+ * @slot helper-text - Renders content below the input
11
+ *
12
+ * @fires igcInput - Emitted when the control receives user input
13
+ * @fires igcChange - Emitted when an alteration of the control's value is committed by the user
14
+ * @fires igcFocus - Emitted when the control gains focus
15
+ * @fires igcBlur - Emitted when the control loses focus
16
+ *
17
+ * @csspart container - The main wrapper that holds all main input elements
18
+ * @csspart input - The native input element
19
+ * @csspart label - The native label element
20
+ * @csspart prefix - The prefix wrapper
21
+ * @csspart suffix - The suffix wrapper
22
+ * @csspart helper-text - The helper text wrapper
23
+ */
24
+ export default class IgcMaskInputComponent extends IgcMaskInputBaseComponent {
25
+ static readonly tagName = "igc-mask-input";
26
+ protected _value: string;
27
+ /**
28
+ * Dictates the behavior when retrieving the value of the control:
29
+ *
30
+ * - `raw` will return the clean user input.
31
+ * - `withFormatting` will return the value with all literals and prompts.
32
+ *
33
+ */
34
+ valueMode: 'raw' | 'withFormatting';
35
+ /**
36
+ * The value of the input.
37
+ *
38
+ * Regardless of the currently set `value-mode`, an empty value will return an empty string.
39
+ *
40
+ */
41
+ get value(): string;
42
+ set value(string: string);
43
+ /** The mask pattern to apply on the input. */
44
+ get mask(): string;
45
+ /** The mask pattern to apply on the input. */
46
+ set mask(val: string);
47
+ protected promptChange(): void;
48
+ protected maskChange(): void;
49
+ protected handleInvalidState(): void;
50
+ connectedCallback(): void;
51
+ protected updateInput(part: string, start: number, finish: number): void;
52
+ protected handleDragEnter(): void;
53
+ protected handleDragLeave(): void;
54
+ protected handleFocus(): void;
55
+ protected handleBlur(): void;
56
+ protected handleChange(): void;
57
+ protected handleClick(): void;
58
+ protected updateMaskedValue(): void;
59
+ /** Replaces the selected text in the control and re-applies the mask */
60
+ setRangeText(replacement: string, start: number, end: number, _selectMode?: 'select' | 'start' | 'end' | 'preserve'): void;
61
+ /** Checks for validity of the control and shows the browser message if it's invalid. */
62
+ reportValidity(): boolean;
63
+ /** Check for validity of the control */
64
+ checkValidity(): boolean;
65
+ protected renderInput(): import("lit-html").TemplateResult<1>;
66
+ }
67
+ declare global {
68
+ interface HTMLElementTagNameMap {
69
+ 'igc-mask-input': IgcMaskInputComponent;
70
+ }
71
+ }
@@ -0,0 +1,182 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html } from 'lit';
8
+ import { property } from 'lit/decorators.js';
9
+ import { ifDefined } from 'lit/directives/if-defined.js';
10
+ import { live } from 'lit/directives/live.js';
11
+ import { watch } from '../common/decorators/watch.js';
12
+ import { blazorTwoWayBind } from '../common/decorators/blazorTwoWayBind.js';
13
+ import { partNameMap } from '../common/util.js';
14
+ import { IgcMaskInputBaseComponent } from './mask-input-base.js';
15
+ export default class IgcMaskInputComponent extends IgcMaskInputBaseComponent {
16
+ constructor() {
17
+ super(...arguments);
18
+ this._value = '';
19
+ this.valueMode = 'raw';
20
+ }
21
+ get value() {
22
+ return this._value
23
+ ? this.valueMode !== 'raw'
24
+ ? this.maskedValue
25
+ : this._value
26
+ : this._value;
27
+ }
28
+ set value(string) {
29
+ this._value = string !== null && string !== void 0 ? string : '';
30
+ this.maskedValue = this.parser.apply(this._value);
31
+ }
32
+ get mask() {
33
+ return this._mask;
34
+ }
35
+ set mask(val) {
36
+ this._mask = val;
37
+ }
38
+ promptChange() {
39
+ this.parser.prompt = this.prompt;
40
+ if (this.value) {
41
+ this.maskedValue = this.parser.apply(this._value);
42
+ }
43
+ }
44
+ maskChange() {
45
+ this.parser.mask = this.mask;
46
+ if (this.value) {
47
+ this.maskedValue = this.parser.apply(this._value);
48
+ }
49
+ }
50
+ handleInvalidState() {
51
+ this.updateComplete.then(() => (this.invalid = !this.checkValidity()));
52
+ }
53
+ connectedCallback() {
54
+ super.connectedCallback();
55
+ this.mask = this.mask || this.parser.mask;
56
+ this.prompt = this.prompt || this.parser.prompt;
57
+ }
58
+ updateInput(part, start, finish) {
59
+ const { value, end } = this.parser.replace(this.maskedValue, part, start, finish);
60
+ this.maskedValue = value;
61
+ this._value = this.parser.parse(value);
62
+ this.requestUpdate();
63
+ if (start !== this.mask.length) {
64
+ this.emitEvent('igcInput', { detail: this.value });
65
+ }
66
+ this.updateComplete.then(() => this.input.setSelectionRange(end, end));
67
+ }
68
+ handleDragEnter() {
69
+ if (!this.hasFocus && !this._value) {
70
+ this.maskedValue = this.parser.apply();
71
+ }
72
+ }
73
+ handleDragLeave() {
74
+ if (!this.hasFocus) {
75
+ this.updateMaskedValue();
76
+ }
77
+ }
78
+ handleFocus() {
79
+ this.hasFocus = true;
80
+ super.handleFocus();
81
+ if (this.readonly) {
82
+ return;
83
+ }
84
+ if (!this._value) {
85
+ this.maskedValue = this.parser.apply();
86
+ this.updateComplete.then(() => this.select());
87
+ }
88
+ }
89
+ handleBlur() {
90
+ this.hasFocus = false;
91
+ this.updateMaskedValue();
92
+ super.handleBlur();
93
+ }
94
+ handleChange() {
95
+ this.emitEvent('igcChange', { detail: this.value });
96
+ this.invalid = !this.checkValidity();
97
+ }
98
+ handleClick() {
99
+ if (this.input.selectionStart === this.input.selectionEnd &&
100
+ this.input.selectionStart === this.maskedValue.length) {
101
+ this.select();
102
+ }
103
+ }
104
+ updateMaskedValue() {
105
+ if (this.maskedValue === this.parser.apply()) {
106
+ this.maskedValue = '';
107
+ }
108
+ }
109
+ setRangeText(replacement, start, end, _selectMode = 'preserve') {
110
+ this.input.value = this.parser.replace(this.input.value, replacement, start, end).value;
111
+ this.maskedValue = this.parser.apply(this.parser.parse(this.input.value));
112
+ this._value = this.parser.parse(this.maskedValue);
113
+ }
114
+ reportValidity() {
115
+ const state = this._value
116
+ ? this.parser.isValidString(this.input.value)
117
+ : this.input.reportValidity();
118
+ this.invalid = !state;
119
+ return state;
120
+ }
121
+ checkValidity() {
122
+ if (this.disabled) {
123
+ return this.input.checkValidity();
124
+ }
125
+ if (!this._value) {
126
+ return !this.required;
127
+ }
128
+ return (this.input.checkValidity() && this.parser.isValidString(this.input.value));
129
+ }
130
+ renderInput() {
131
+ var _a;
132
+ return html `
133
+ <input
134
+ type="text"
135
+ part=${partNameMap(this.resolvePartNames('input'))}
136
+ name=${ifDefined(this.name)}
137
+ .value=${live(this.maskedValue)}
138
+ .placeholder=${live((_a = this.placeholder) !== null && _a !== void 0 ? _a : this.parser.escapedMask)}
139
+ ?readonly=${this.readonly}
140
+ ?disabled=${this.disabled}
141
+ ?required=${this.required}
142
+ @dragenter=${this.handleDragEnter}
143
+ @dragleave=${this.handleDragLeave}
144
+ @dragstart=${this.handleDragStart}
145
+ @blur=${this.handleBlur}
146
+ @focus=${this.handleFocus}
147
+ @cut=${this.handleCut}
148
+ @change=${this.handleChange}
149
+ @click=${this.handleClick}
150
+ @compositionstart=${this.handleCompositionStart}
151
+ @compositionend=${this.handleCompositionEnd}
152
+ @input=${this.handleInput}
153
+ aria-invalid="${this.invalid ? 'true' : 'false'}"
154
+ @invalid="${this.handleInvalid}"
155
+ @keydown=${this.handleKeydown}
156
+ />
157
+ `;
158
+ }
159
+ }
160
+ IgcMaskInputComponent.tagName = 'igc-mask-input';
161
+ __decorate([
162
+ property({ attribute: 'value-mode' })
163
+ ], IgcMaskInputComponent.prototype, "valueMode", void 0);
164
+ __decorate([
165
+ property(),
166
+ blazorTwoWayBind('igcChange', 'detail')
167
+ ], IgcMaskInputComponent.prototype, "value", null);
168
+ __decorate([
169
+ property()
170
+ ], IgcMaskInputComponent.prototype, "mask", null);
171
+ __decorate([
172
+ watch('prompt')
173
+ ], IgcMaskInputComponent.prototype, "promptChange", null);
174
+ __decorate([
175
+ watch('_mask')
176
+ ], IgcMaskInputComponent.prototype, "maskChange", null);
177
+ __decorate([
178
+ watch('required', { waitUntilFirstUpdate: true }),
179
+ watch('disabled', { waitUntilFirstUpdate: true }),
180
+ watch('value', { waitUntilFirstUpdate: true })
181
+ ], IgcMaskInputComponent.prototype, "handleInvalidState", null);
182
+ //# sourceMappingURL=mask-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-input.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAwBjE,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,yBAAyB;IAA5E;;QAGY,WAAM,GAAG,EAAE,CAAC;QAUf,cAAS,GAA6B,KAAK,CAAC;IA4MrD,CAAC;IAlMC,IAAW,KAA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,QAAQ;oBACb,IAAI,CAAC,QAAQ;qBACZ,IAAI,CAAC,eAAe;qBACpB,IAAI,CAAC,eAAe;qBACpB,IAAI,CAAC,eAAe;gBACzB,IAAI,CAAC,UAAU;iBACd,IAAI,CAAC,WAAW;eAClB,IAAI,CAAC,SAAS;kBACX,IAAI,CAAC,YAAY;iBAClB,IAAI,CAAC,WAAW;4BACL,IAAI,CAAC,sBAAsB;0BAC7B,IAAI,CAAC,oBAAoB;iBAClC,IAAI,CAAC,WAAW;wBACT,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;oBACnC,IAAI,CAAC,aAAa;mBACnB,IAAI,CAAC,aAAa;;KAEhC,CAAC;IACJ,CAAC;;AAvNsB,6BAAO,GAAG,gBAAgB,CAAC;AAYlD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;wDACa;AAUnD;IAFC,QAAQ,EAAE;IACV,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC;kDAOvC;AASD;IADC,QAAQ,EAAE;iDAGV;AAQD;IADC,KAAK,CAAC,QAAQ,CAAC;yDAMf;AAGD;IADC,KAAK,CAAC,OAAO,CAAC;uDAMd;AAKD;IAHC,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IACjD,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IACjD,KAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;+DAG9C","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 } 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 *\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 *\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 /** The mask pattern to apply on the input. */\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(val: string) {\n this._mask = val;\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('_mask')\n protected maskChange() {\n this.parser.mask = this.mask;\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 handleInvalidState() {\n this.updateComplete.then(() => (this.invalid = !this.checkValidity()));\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 protected updateInput(part: string, start: number, finish: number) {\n const { value, end } = this.parser.replace(\n this.maskedValue,\n part,\n start,\n finish\n );\n this.maskedValue = value;\n this._value = this.parser.parse(value);\n\n this.requestUpdate();\n if (start !== this.mask.length) {\n this.emitEvent('igcInput', { detail: this.value });\n }\n this.updateComplete.then(() => this.input.setSelectionRange(end, end));\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 handleFocus() {\n this.hasFocus = true;\n super.handleFocus();\n\n if (this.readonly) {\n return;\n }\n\n if (!this._value) {\n this.maskedValue = this.parser.apply();\n // In case of empty value, select the whole mask\n this.updateComplete.then(() => 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 /** 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"]}
@@ -0,0 +1,30 @@
1
+ interface MaskOptions {
2
+ format: string;
3
+ promptCharacter: string;
4
+ }
5
+ export declare class MaskParser {
6
+ protected options: MaskOptions;
7
+ constructor(options?: MaskOptions);
8
+ protected literals: Map<number, string>;
9
+ protected _escapedMask: string;
10
+ protected get literalPositions(): number[];
11
+ get escapedMask(): string;
12
+ get mask(): string;
13
+ set mask(value: string);
14
+ get prompt(): string;
15
+ set prompt(value: string);
16
+ protected getMaskLiterals(): void;
17
+ protected isPromptChar(char: string): boolean;
18
+ protected replaceCharAt(string: string, pos: number, char: string): string;
19
+ protected validate(char: string, maskedChar: string): boolean;
20
+ protected getNonLiteralPositions(mask?: string): number[];
21
+ protected getRequiredNonLiteralPositions(mask: string): number[];
22
+ replace(masked: string | undefined, value: string, start: number, end: number): {
23
+ value: string;
24
+ end: number;
25
+ };
26
+ parse(masked?: string): string;
27
+ isValidString(input?: string): boolean;
28
+ apply(input?: string): string;
29
+ }
30
+ export {};
@@ -0,0 +1,167 @@
1
+ const FLAGS = new Set('aACL09#&?');
2
+ const REGEX = new Map([
3
+ ['C', /(?!^$)/u],
4
+ ['&', /[^\p{Separator}]/u],
5
+ ['a', /[\p{Letter}\d\p{Separator}]/u],
6
+ ['A', /[\p{Letter}\d]/u],
7
+ ['?', /[\p{Letter}\p{Separator}]/u],
8
+ ['L', /\p{Letter}/u],
9
+ ['0', /\d/],
10
+ ['9', /[\d\p{Separator}]/u],
11
+ ['#', /[\d\-+]/],
12
+ ]);
13
+ const REQUIRED = new Set('0#LA&');
14
+ const replaceIMENumbers = (string) => {
15
+ return string.replace(/[0123456789]/g, (num) => ({
16
+ '1': '1',
17
+ '2': '2',
18
+ '3': '3',
19
+ '4': '4',
20
+ '5': '5',
21
+ '6': '6',
22
+ '7': '7',
23
+ '8': '8',
24
+ '9': '9',
25
+ '0': '0',
26
+ }[num]));
27
+ };
28
+ export class MaskParser {
29
+ constructor(options = { format: 'CCCCCCCCCC', promptCharacter: '_' }) {
30
+ this.literals = new Map();
31
+ this.options = options;
32
+ }
33
+ get literalPositions() {
34
+ this.getMaskLiterals();
35
+ return Array.from(this.literals.keys());
36
+ }
37
+ get escapedMask() {
38
+ this.getMaskLiterals();
39
+ return this._escapedMask;
40
+ }
41
+ get mask() {
42
+ return this.options.format;
43
+ }
44
+ set mask(value) {
45
+ this.options.format = value || this.options.format;
46
+ this.getMaskLiterals();
47
+ }
48
+ get prompt() {
49
+ return this.options.promptCharacter;
50
+ }
51
+ set prompt(value) {
52
+ this.options.promptCharacter = value
53
+ ? value.substring(0, 1)
54
+ : this.options.promptCharacter;
55
+ }
56
+ getMaskLiterals() {
57
+ this.literals.clear();
58
+ this._escapedMask = this.mask;
59
+ for (let i = 0, j = 0; i < this.mask.length; i++, j++) {
60
+ const [current, next] = [this.mask.charAt(i), this.mask.charAt(i + 1)];
61
+ if (current === '\\' && FLAGS.has(next)) {
62
+ this._escapedMask = this.replaceCharAt(this._escapedMask, j, '');
63
+ this.literals.set(j, next);
64
+ i++;
65
+ }
66
+ else {
67
+ if (!FLAGS.has(current)) {
68
+ this.literals.set(j, current);
69
+ }
70
+ }
71
+ }
72
+ }
73
+ isPromptChar(char) {
74
+ return char === this.prompt;
75
+ }
76
+ replaceCharAt(string, pos, char) {
77
+ return `${string.substring(0, pos)}${char}${string.substring(pos + 1)}`;
78
+ }
79
+ validate(char, maskedChar) {
80
+ const regex = REGEX.get(maskedChar);
81
+ return regex ? regex.test(char) : false;
82
+ }
83
+ getNonLiteralPositions(mask = '') {
84
+ const positions = this.literalPositions;
85
+ return Array.from(mask)
86
+ .map((_, pos) => (!positions.includes(pos) ? pos : -1))
87
+ .filter((pos) => pos > -1);
88
+ }
89
+ getRequiredNonLiteralPositions(mask) {
90
+ const positions = this.literalPositions;
91
+ return Array.from(mask)
92
+ .map((char, pos) => REQUIRED.has(char) && !positions.includes(pos) ? pos : -1)
93
+ .filter((pos) => pos > -1);
94
+ }
95
+ replace(masked = '', value, start, end) {
96
+ const chars = Array.from(replaceIMENumbers(value));
97
+ const positions = this.literalPositions;
98
+ end = Math.min(end, masked.length);
99
+ let cursor = start;
100
+ for (let i = start; i < end || (chars.length && i < masked.length); i++) {
101
+ if (positions.includes(i)) {
102
+ if (chars[0] === masked[i]) {
103
+ cursor = i + 1;
104
+ chars.shift();
105
+ }
106
+ continue;
107
+ }
108
+ if (chars[0] &&
109
+ !this.validate(chars[0], this._escapedMask[i]) &&
110
+ !this.isPromptChar(chars[0])) {
111
+ break;
112
+ }
113
+ let char = this.prompt;
114
+ if (chars.length) {
115
+ cursor = i + 1;
116
+ char = chars.shift();
117
+ }
118
+ masked = this.replaceCharAt(masked, i, char);
119
+ }
120
+ return { value: masked, end: cursor };
121
+ }
122
+ parse(masked = '') {
123
+ return Array.from(masked).reduce((prev, char, pos) => {
124
+ return `${prev}${!this.literalPositions.includes(pos) && !this.isPromptChar(char)
125
+ ? char
126
+ : ''}`;
127
+ }, '');
128
+ }
129
+ isValidString(input = '') {
130
+ const required = this.getRequiredNonLiteralPositions(this._escapedMask);
131
+ if (required.length > this.parse(input).length) {
132
+ return false;
133
+ }
134
+ return required.every((pos) => {
135
+ const char = input.charAt(pos);
136
+ return (char !== undefined &&
137
+ this.validate(char, this._escapedMask.charAt(pos)) &&
138
+ !this.isPromptChar(char));
139
+ });
140
+ }
141
+ apply(input = '') {
142
+ const nonLiteralPositions = this.getNonLiteralPositions(this._escapedMask);
143
+ let output = new Array(this._escapedMask.length).fill(this.prompt).join('');
144
+ this.literals.forEach((char, pos) => {
145
+ output = this.replaceCharAt(output, pos, char);
146
+ });
147
+ if (!input) {
148
+ return output;
149
+ }
150
+ const values = nonLiteralPositions.map((pos, index) => {
151
+ const char = input.charAt(index);
152
+ return !this.validate(char, this._escapedMask.charAt(pos)) &&
153
+ !this.isPromptChar(char)
154
+ ? this.prompt
155
+ : char;
156
+ });
157
+ if (values.length > nonLiteralPositions.length) {
158
+ values.splice(nonLiteralPositions.length);
159
+ }
160
+ let pos = 0;
161
+ for (const each of values) {
162
+ output = this.replaceCharAt(output, nonLiteralPositions[pos++], each);
163
+ }
164
+ return output;
165
+ }
166
+ }
167
+ //# sourceMappingURL=mask-parser.js.map